From 7186aa9c34dcd1599a0ce80591902a9880ac9a7a Mon Sep 17 00:00:00 2001 From: AnashOommen Date: Wed, 9 Jul 2014 12:42:06 -0400 Subject: [PATCH] Commit v18.0.0 to github. --- AdWords.sln | 114 + AdXBuyer.sln | 114 + ChangeLog | 23 + Dfa.sln | 129 + Dfp.sln | 102 + LICENSE | 201 + README.md | 117 +- .../CSharp/AdWords.Examples.CSharp.csproj | 302 + examples/AdWords/CSharp/App.config | 192 + examples/AdWords/CSharp/ExampleBase.cs | 35 + examples/AdWords/CSharp/ExampleUtilities.cs | 100 + .../AdWords.Examples.CSharp.OAuth.csproj | 86 + .../AdWords/CSharp/OAuth/ConsoleExample.cs | 140 + examples/AdWords/CSharp/OAuth/Default.aspx | 53 + examples/AdWords/CSharp/OAuth/Default.aspx.cs | 232 + .../CSharp/OAuth/Default.aspx.designer.cs | 86 + examples/AdWords/CSharp/OAuth/OAuthLogin.aspx | 34 + .../AdWords/CSharp/OAuth/OAuthLogin.aspx.cs | 111 + .../CSharp/OAuth/OAuthLogin.aspx.designer.cs | 34 + .../CSharp/OAuth/Properties/AssemblyInfo.cs | 37 + .../CSharp/OAuth/Properties/Properties.cs | 24 + examples/AdWords/CSharp/OAuth/Web.config | 196 + examples/AdWords/CSharp/OAuth/css/main.css | 26 + examples/AdWords/CSharp/Program.cs | 167 + .../AdWords/CSharp/Properties/AssemblyInfo.cs | 37 + .../AdWords/CSharp/Properties/Properties.cs | 24 + .../AccountManagement/CreateAccount.cs | 95 + .../AccountManagement/GetAccountAlerts.cs | 126 + .../AccountManagement/GetAccountChanges.cs | 176 + .../AccountManagement/GetAccountHierarchy.cs | 196 + .../AdWordsForVideo/AddTargetingGroup.cs | 95 + .../AddTargetingGroupCriteria.cs | 167 + .../v201309/AdWordsForVideo/AddVideoAd.cs | 109 + .../AdWordsForVideo/AddVideoCallToAction.cs | 109 + .../AdWordsForVideo/AddVideoCampaign.cs | 122 + .../AddVideoCampaignCriteria.cs | 99 + .../v201309/AdWordsForVideo/FindVideos.cs | 100 + .../AdWordsForVideo/GetKeywordCriteria.cs | 117 + .../AdWordsForVideo/GetTargetingGroups.cs | 112 + .../GetVideoCampaignCriteria.cs | 116 + .../AdWordsForVideo/GetVideoCampaignStats.cs | 160 + .../AdWordsForVideo/GetVideoCampaigns.cs | 107 + .../AddAdGroupBidModifier.cs | 111 + .../AddClickToDownloadAd.cs | 146 + .../AdvancedOperations/AddSiteLinks.cs | 322 + .../GetAdGroupBidModifiers.cs | 122 + .../UploadOfflineConversions.cs | 139 + .../UseSharedBiddingStrategy.cs | 208 + .../AddAdGroupDemographicCriteria.cs | 123 + .../v201309/BasicOperations/AddAdGroups.cs | 141 + .../v201309/BasicOperations/AddCampaigns.cs | 173 + .../v201309/BasicOperations/AddKeywords.cs | 127 + .../v201309/BasicOperations/AddTextAds.cs | 129 + .../v201309/BasicOperations/DeleteAd.cs | 103 + .../v201309/BasicOperations/DeleteAdGroup.cs | 99 + .../v201309/BasicOperations/DeleteCampaign.cs | 99 + .../v201309/BasicOperations/DeleteKeyword.cs | 103 + .../v201309/BasicOperations/GetAdGroups.cs | 113 + .../v201309/BasicOperations/GetCampaigns.cs | 102 + .../BasicOperations/GetCampaignsWithAwql.cs | 100 + .../v201309/BasicOperations/GetKeywords.cs | 127 + .../v201309/BasicOperations/GetTextAds.cs | 140 + .../CSharp/v201309/BasicOperations/PauseAd.cs | 101 + .../v201309/BasicOperations/UpdateAdGroup.cs | 95 + .../v201309/BasicOperations/UpdateCampaign.cs | 94 + .../v201309/BasicOperations/UpdateKeyword.cs | 123 + .../CampaignManagement/AddExperiment.cs | 215 + .../CampaignManagement/AddKeywordsInBulk.cs | 173 + .../AddLocationExtension.cs | 148 + .../GetAllDisapprovedAds.cs | 121 + .../GetAllDisapprovedAdsWihAwql.cs | 108 + .../CampaignManagement/PromoteExperiment.cs | 98 + .../CampaignManagement/SetAdParameters.cs | 152 + .../CampaignManagement/SetBidModifier.cs | 111 + .../CampaignManagement/ValidateTextAd.cs | 109 + .../ErrorHandling/HandlePartialFailures.cs | 136 + .../HandlePolicyViolationError.cs | 173 + .../ErrorHandling/HandleRateExceededError.cs | 204 + .../HandleTwoFactorAuthorizationError.cs | 94 + .../v201309/Express/AddExpressBusinesses.cs | 114 + .../CSharp/v201309/Express/AddPromotion.cs | 154 + .../v201309/Express/GetExpressBusinesses.cs | 151 + .../v201309/Express/GetProductServices.cs | 119 + .../CSharp/v201309/Express/GetPromotions.cs | 110 + .../v201309/Express/UpdateExpressBusiness.cs | 89 + .../CSharp/v201309/Express/UpdatePromotion.cs | 100 + .../Miscellaneous/GetAllVideosAndImages.cs | 139 + .../v201309/Miscellaneous/UploadImage.cs | 106 + .../Optimization/EstimateKeywordTraffic.cs | 173 + .../Optimization/GetAdGroupBidSimulations.cs | 105 + .../Optimization/GetKeywordBidSimulations.cs | 133 + .../v201309/Optimization/GetKeywordIdeas.cs | 150 + .../v201309/Optimization/GetPlacementIdeas.cs | 122 + .../CSharp/v201309/Remarketing/AddAudience.cs | 156 + .../Remarketing/AddConversionTracker.cs | 106 + .../Reporting/DownloadCriteriaReport.cs | 114 + .../DownloadCriteriaReportWithAwql.cs | 99 + .../v201309/Reporting/GetReportFields.cs | 91 + .../Targeting/AddCampaignTargetingCriteria.cs | 138 + .../Targeting/GetCampaignTargetingCriteria.cs | 119 + .../GetTargetableLanguagesAndCarriers.cs | 99 + .../v201309/Targeting/LookupLocation.cs | 121 + .../AccountManagement/CreateAccount.cs | 95 + .../AccountManagement/GetAccountAlerts.cs | 126 + .../AccountManagement/GetAccountChanges.cs | 176 + .../AccountManagement/GetAccountHierarchy.cs | 196 + .../AdWordsForVideo/AddTargetingGroup.cs | 95 + .../AddTargetingGroupCriteria.cs | 167 + .../v201402/AdWordsForVideo/AddVideoAd.cs | 109 + .../AdWordsForVideo/AddVideoCallToAction.cs | 109 + .../AdWordsForVideo/AddVideoCampaign.cs | 122 + .../AddVideoCampaignCriteria.cs | 99 + .../v201402/AdWordsForVideo/FindVideos.cs | 100 + .../AdWordsForVideo/GetKeywordCriteria.cs | 117 + .../AdWordsForVideo/GetTargetingGroups.cs | 112 + .../GetVideoCampaignCriteria.cs | 116 + .../AdWordsForVideo/GetVideoCampaignStats.cs | 160 + .../AdWordsForVideo/GetVideoCampaigns.cs | 107 + .../AddAdGroupBidModifier.cs | 111 + .../AddClickToDownloadAd.cs | 146 + .../AddPlacesLocationExtension.cs | 193 + .../AdvancedOperations/AddSiteLinks.cs | 322 + .../GetAdGroupBidModifiers.cs | 122 + .../UploadOfflineConversions.cs | 139 + .../UseSharedBiddingStrategy.cs | 209 + .../AddAdGroupDemographicCriteria.cs | 123 + .../v201402/BasicOperations/AddAdGroups.cs | 137 + .../v201402/BasicOperations/AddCampaigns.cs | 168 + .../v201402/BasicOperations/AddKeywords.cs | 127 + .../v201402/BasicOperations/AddTextAds.cs | 129 + .../v201402/BasicOperations/DeleteAd.cs | 103 + .../v201402/BasicOperations/DeleteAdGroup.cs | 99 + .../v201402/BasicOperations/DeleteCampaign.cs | 99 + .../v201402/BasicOperations/DeleteKeyword.cs | 103 + .../v201402/BasicOperations/GetAdGroups.cs | 113 + .../v201402/BasicOperations/GetCampaigns.cs | 102 + .../BasicOperations/GetCampaignsWithAwql.cs | 100 + .../v201402/BasicOperations/GetKeywords.cs | 127 + .../v201402/BasicOperations/GetTextAds.cs | 140 + .../CSharp/v201402/BasicOperations/PauseAd.cs | 101 + .../v201402/BasicOperations/UpdateAdGroup.cs | 95 + .../v201402/BasicOperations/UpdateCampaign.cs | 94 + .../v201402/BasicOperations/UpdateKeyword.cs | 123 + .../CampaignManagement/AddExperiment.cs | 215 + .../CampaignManagement/AddKeywordsInBulk.cs | 173 + .../AddLocationExtension.cs | 148 + .../GetAllDisapprovedAds.cs | 121 + .../GetAllDisapprovedAdsWihAwql.cs | 108 + .../CampaignManagement/PromoteExperiment.cs | 98 + .../CampaignManagement/SetAdParameters.cs | 152 + .../CampaignManagement/SetBidModifier.cs | 111 + .../CampaignManagement/ValidateTextAd.cs | 109 + .../ErrorHandling/HandlePartialFailures.cs | 136 + .../HandlePolicyViolationError.cs | 173 + .../ErrorHandling/HandleRateExceededError.cs | 204 + .../v201402/Express/AddExpressBusinesses.cs | 114 + .../CSharp/v201402/Express/AddPromotion.cs | 154 + .../v201402/Express/GetExpressBusinesses.cs | 151 + .../v201402/Express/GetProductServices.cs | 119 + .../CSharp/v201402/Express/GetPromotions.cs | 110 + .../v201402/Express/UpdateExpressBusiness.cs | 89 + .../CSharp/v201402/Express/UpdatePromotion.cs | 100 + .../Miscellaneous/GetAllVideosAndImages.cs | 139 + .../v201402/Miscellaneous/UploadImage.cs | 106 + .../Optimization/EstimateKeywordTraffic.cs | 173 + .../Optimization/GetAdGroupBidSimulations.cs | 105 + .../Optimization/GetKeywordBidSimulations.cs | 133 + .../v201402/Optimization/GetKeywordIdeas.cs | 150 + .../v201402/Optimization/GetPlacementIdeas.cs | 122 + .../CSharp/v201402/Remarketing/AddAudience.cs | 156 + .../Remarketing/AddConversionTracker.cs | 107 + .../Reporting/DownloadCriteriaReport.cs | 114 + .../DownloadCriteriaReportWithAwql.cs | 99 + .../v201402/Reporting/GetReportFields.cs | 91 + .../AddProductPartitionTree.cs | 313 + .../ShoppingCampaigns/AddProductScope.cs | 127 + .../ShoppingCampaigns/AddShoppingCampaign.cs | 188 + .../GetProductCategoryTaxonomy.cs | 180 + .../SetProductSalesChannel.cs | 101 + .../Targeting/AddCampaignTargetingCriteria.cs | 182 + .../Targeting/GetCampaignTargetingCriteria.cs | 119 + .../GetTargetableLanguagesAndCarriers.cs | 99 + .../v201402/Targeting/LookupLocation.cs | 121 + .../AccountManagement/CreateAccount.cs | 95 + .../AccountManagement/GetAccountAlerts.cs | 126 + .../AccountManagement/GetAccountChanges.cs | 176 + .../AccountManagement/GetAccountHierarchy.cs | 196 + .../AdWordsForVideo/AddTargetingGroup.cs | 95 + .../AddTargetingGroupCriteria.cs | 167 + .../v201406/AdWordsForVideo/AddVideoAd.cs | 109 + .../AdWordsForVideo/AddVideoCallToAction.cs | 107 + .../AdWordsForVideo/AddVideoCampaign.cs | 122 + .../AddVideoCampaignCriteria.cs | 99 + .../v201406/AdWordsForVideo/FindVideos.cs | 100 + .../AdWordsForVideo/GetKeywordCriteria.cs | 117 + .../AdWordsForVideo/GetTargetingGroups.cs | 112 + .../GetVideoCampaignCriteria.cs | 116 + .../AdWordsForVideo/GetVideoCampaignStats.cs | 160 + .../AdWordsForVideo/GetVideoCampaigns.cs | 107 + .../AddAdGroupBidModifier.cs | 111 + .../AddClickToDownloadAd.cs | 146 + .../AddPlacesLocationExtension.cs | 193 + .../AdvancedOperations/AddSiteLinks.cs | 322 + .../AddTextAdWithUpgradedUrls.cs | 159 + .../GetAdGroupBidModifiers.cs | 122 + .../UploadOfflineConversions.cs | 139 + .../UseSharedBiddingStrategy.cs | 209 + .../AddAdGroupDemographicCriteria.cs | 123 + .../v201406/BasicOperations/AddAdGroups.cs | 137 + .../v201406/BasicOperations/AddCampaigns.cs | 168 + .../v201406/BasicOperations/AddKeywords.cs | 127 + .../v201406/BasicOperations/AddTextAds.cs | 129 + .../v201406/BasicOperations/GetAdGroups.cs | 113 + .../v201406/BasicOperations/GetCampaigns.cs | 102 + .../BasicOperations/GetCampaignsWithAwql.cs | 100 + .../v201406/BasicOperations/GetKeywords.cs | 127 + .../v201406/BasicOperations/GetTextAds.cs | 140 + .../CSharp/v201406/BasicOperations/PauseAd.cs | 101 + .../v201406/BasicOperations/RemoveAd.cs | 103 + .../v201406/BasicOperations/RemoveAdGroup.cs | 99 + .../v201406/BasicOperations/RemoveCampaign.cs | 99 + .../v201406/BasicOperations/RemoveKeyword.cs | 103 + .../v201406/BasicOperations/UpdateAdGroup.cs | 95 + .../v201406/BasicOperations/UpdateCampaign.cs | 94 + .../v201406/BasicOperations/UpdateKeyword.cs | 123 + .../CampaignManagement/AddCampaignLabels.cs | 104 + .../CampaignManagement/AddExperiment.cs | 215 + .../CampaignManagement/AddKeywordsInBulk.cs | 173 + .../AddLocationExtension.cs | 148 + .../GetAllDisapprovedAds.cs | 121 + .../GetAllDisapprovedAdsWihAwql.cs | 108 + .../CampaignManagement/GetCampaignsByLabel.cs | 121 + .../CampaignManagement/PromoteExperiment.cs | 98 + .../CampaignManagement/SetAdParameters.cs | 152 + .../CampaignManagement/SetBidModifier.cs | 111 + .../CampaignManagement/ValidateTextAd.cs | 109 + .../ErrorHandling/HandlePartialFailures.cs | 136 + .../HandlePolicyViolationError.cs | 173 + .../ErrorHandling/HandleRateExceededError.cs | 204 + .../v201406/Express/AddExpressBusinesses.cs | 114 + .../CSharp/v201406/Express/AddPromotion.cs | 154 + .../v201406/Express/GetBudgetSuggestion.cs | 125 + .../v201406/Express/GetExpressBusinesses.cs | 151 + .../v201406/Express/GetProductServices.cs | 119 + .../CSharp/v201406/Express/GetPromotions.cs | 110 + .../v201406/Express/UpdateExpressBusiness.cs | 89 + .../CSharp/v201406/Express/UpdatePromotion.cs | 100 + .../Miscellaneous/GetAllVideosAndImages.cs | 139 + .../v201406/Miscellaneous/UploadImage.cs | 106 + .../Optimization/EstimateKeywordTraffic.cs | 173 + .../Optimization/GetAdGroupBidSimulations.cs | 105 + .../Optimization/GetKeywordBidSimulations.cs | 133 + .../v201406/Optimization/GetKeywordIdeas.cs | 150 + .../v201406/Optimization/GetPlacementIdeas.cs | 122 + .../CSharp/v201406/Remarketing/AddAudience.cs | 156 + .../Remarketing/AddConversionTracker.cs | 107 + .../Reporting/DownloadCriteriaReport.cs | 114 + .../DownloadCriteriaReportWithAwql.cs | 99 + .../v201406/Reporting/GetReportFields.cs | 91 + .../AddProductPartitionTree.cs | 313 + .../ShoppingCampaigns/AddProductScope.cs | 127 + .../ShoppingCampaigns/AddShoppingCampaign.cs | 188 + .../GetProductCategoryTaxonomy.cs | 180 + .../SetProductSalesChannel.cs | 101 + .../Targeting/AddCampaignTargetingCriteria.cs | 199 + .../Targeting/GetCampaignTargetingCriteria.cs | 119 + .../GetTargetableLanguagesAndCarriers.cs | 99 + .../v201406/Targeting/LookupLocation.cs | 121 + .../AdWords/Vb/AdWords.Examples.VB.vbproj | 272 + examples/AdWords/Vb/App.config | 192 + examples/AdWords/Vb/ExampleBase.vb | 33 + examples/AdWords/Vb/ExampleUtilities.vb | 109 + examples/AdWords/Vb/Program.vb | 169 + .../AdWords/Vb/Properties/AssemblyInfo.vb | 44 + .../AccountManagement/CreateAccount.vb | 189 + .../AccountManagement/GetAccountAlerts.vb | 126 + .../AccountManagement/GetAccountChanges.vb | 183 + .../AccountManagement/GetAccountHierarchy.vb | 126 + .../AddAdGroupBidModifier.vb | 111 + .../AddClickToDownloadAd.vb | 149 + .../AdvancedOperations/AddSiteLinks.vb | 319 + .../GetAdGroupBidModifiers.vb | 125 + .../UploadOfflineConversions.vb | 245 + .../UseSharedBiddingStrategy.vb | 212 + .../AddAdGroupDemographicCriteria.vb | 124 + .../Vb/v201309/BasicOperations/AddAdGroups.vb | 142 + .../v201309/BasicOperations/AddCampaigns.vb | 174 + .../Vb/v201309/BasicOperations/AddKeywords.vb | 129 + .../Vb/v201309/BasicOperations/AddTextAds.vb | 130 + .../Vb/v201309/BasicOperations/DeleteAd.vb | 105 + .../v201309/BasicOperations/DeleteAdGroup.vb | 101 + .../v201309/BasicOperations/DeleteCampaign.vb | 102 + .../v201309/BasicOperations/DeleteKeyword.vb | 106 + .../Vb/v201309/BasicOperations/GetAdGroups.vb | 114 + .../v201309/BasicOperations/GetCampaigns.vb | 103 + .../BasicOperations/GetCampaignsWithAwql.vb | 102 + .../Vb/v201309/BasicOperations/GetKeywords.vb | 128 + .../Vb/v201309/BasicOperations/GetTextAds.vb | 140 + .../Vb/v201309/BasicOperations/PauseAd.vb | 102 + .../v201309/BasicOperations/UpdateAdGroup.vb | 96 + .../v201309/BasicOperations/UpdateCampaign.vb | 97 + .../v201309/BasicOperations/UpdateKeyword.vb | 122 + .../CampaignManagement/AddExperiment.vb | 216 + .../CampaignManagement/AddKeywordsInBulk.vb | 186 + .../AddLocationExtension.vb | 150 + .../GetAllDisapprovedAds.vb | 121 + .../GetAllDisapprovedAdsWithAwql.vb | 111 + .../CampaignManagement/PromoteExperiment.vb | 100 + .../CampaignManagement/SetAdParameters.vb | 155 + .../CampaignManagement/SetBidModifier.vb | 112 + .../CampaignManagement/ValidateTextAd.vb | 110 + .../ErrorHandling/HandlePartialFailures.vb | 137 + .../HandlePolicyViolationError.vb | 175 + .../ErrorHandling/HandleRateExceededError.vb | 206 + .../HandleTwoFactorAuthorizationError.vb | 95 + .../Miscellaneous/GetAllVideosAndImages.vb | 139 + .../Vb/v201309/Miscellaneous/UploadImage.vb | 107 + .../Optimization/EstimateKeywordTraffic.vb | 174 + .../Optimization/GetAdGroupBidSimulations.vb | 109 + .../Optimization/GetKeywordBidSimulations.vb | 134 + .../v201309/Optimization/GetKeywordIdeas.vb | 150 + .../v201309/Optimization/GetPlacementIdeas.vb | 123 + .../Vb/v201309/Remarketing/AddAudience.vb | 154 + .../Remarketing/AddConversionTracker.vb | 108 + .../Reporting/DownloadCriteriaReport.vb | 118 + .../DownloadCriteriaReportWithAwql.vb | 102 + .../Vb/v201309/Reporting/GetReportFields.vb | 97 + .../Targeting/AddCampaignTargetingCriteria.vb | 139 + .../Targeting/GetCampaignTargetingCriteria.vb | 123 + .../GetTargetableLanguagesAndCarriers.vb | 100 + .../Vb/v201309/Targeting/LookupLocation.vb | 121 + .../AccountManagement/CreateAccount.vb | 189 + .../AccountManagement/GetAccountAlerts.vb | 126 + .../AccountManagement/GetAccountChanges.vb | 183 + .../AccountManagement/GetAccountHierarchy.vb | 126 + .../AddAdGroupBidModifier.vb | 111 + .../AddClickToDownloadAd.vb | 149 + .../AddPlacesLocationExtension.vb | 198 + .../AdvancedOperations/AddSiteLinks.vb | 319 + .../GetAdGroupBidModifiers.vb | 125 + .../UploadOfflineConversions.vb | 245 + .../UseSharedBiddingStrategy.vb | 213 + .../AddAdGroupDemographicCriteria.vb | 124 + .../Vb/v201402/BasicOperations/AddAdGroups.vb | 138 + .../v201402/BasicOperations/AddCampaigns.vb | 169 + .../Vb/v201402/BasicOperations/AddKeywords.vb | 129 + .../Vb/v201402/BasicOperations/AddTextAds.vb | 130 + .../Vb/v201402/BasicOperations/DeleteAd.vb | 105 + .../v201402/BasicOperations/DeleteAdGroup.vb | 101 + .../v201402/BasicOperations/DeleteCampaign.vb | 102 + .../v201402/BasicOperations/DeleteKeyword.vb | 106 + .../Vb/v201402/BasicOperations/GetAdGroups.vb | 114 + .../v201402/BasicOperations/GetCampaigns.vb | 103 + .../BasicOperations/GetCampaignsWithAwql.vb | 102 + .../Vb/v201402/BasicOperations/GetKeywords.vb | 128 + .../Vb/v201402/BasicOperations/GetTextAds.vb | 140 + .../Vb/v201402/BasicOperations/PauseAd.vb | 102 + .../v201402/BasicOperations/UpdateAdGroup.vb | 96 + .../v201402/BasicOperations/UpdateCampaign.vb | 97 + .../v201402/BasicOperations/UpdateKeyword.vb | 122 + .../CampaignManagement/AddExperiment.vb | 216 + .../CampaignManagement/AddKeywordsInBulk.vb | 186 + .../AddLocationExtension.vb | 150 + .../GetAllDisapprovedAds.vb | 121 + .../GetAllDisapprovedAdsWithAwql.vb | 111 + .../CampaignManagement/PromoteExperiment.vb | 100 + .../CampaignManagement/SetAdParameters.vb | 155 + .../CampaignManagement/SetBidModifier.vb | 112 + .../CampaignManagement/ValidateTextAd.vb | 110 + .../ErrorHandling/HandlePartialFailures.vb | 137 + .../HandlePolicyViolationError.vb | 175 + .../ErrorHandling/HandleRateExceededError.vb | 206 + .../HandleTwoFactorAuthorizationError.vb | 95 + .../Miscellaneous/GetAllVideosAndImages.vb | 139 + .../Vb/v201402/Miscellaneous/UploadImage.vb | 107 + .../Optimization/EstimateKeywordTraffic.vb | 174 + .../Optimization/GetAdGroupBidSimulations.vb | 109 + .../Optimization/GetKeywordBidSimulations.vb | 134 + .../v201402/Optimization/GetKeywordIdeas.vb | 150 + .../v201402/Optimization/GetPlacementIdeas.vb | 123 + .../Vb/v201402/Remarketing/AddAudience.vb | 154 + .../Remarketing/AddConversionTracker.vb | 109 + .../Reporting/DownloadCriteriaReport.vb | 118 + .../DownloadCriteriaReportWithAwql.vb | 102 + .../Vb/v201402/Reporting/GetReportFields.vb | 97 + .../AddProductPartitionTree.vb | 318 + .../ShoppingCampaigns/AddProductScope.vb | 127 + .../ShoppingCampaigns/AddShoppingCampaign.vb | 191 + .../GetProductCategoryTaxonomy.vb | 183 + .../SetProductSalesChannel.vb | 104 + .../Targeting/AddCampaignTargetingCriteria.vb | 183 + .../Targeting/GetCampaignTargetingCriteria.vb | 123 + .../GetTargetableLanguagesAndCarriers.vb | 100 + .../Vb/v201402/Targeting/LookupLocation.vb | 121 + .../AccountManagement/CreateAccount.vb | 189 + .../AccountManagement/GetAccountAlerts.vb | 126 + .../AccountManagement/GetAccountChanges.vb | 183 + .../AccountManagement/GetAccountHierarchy.vb | 126 + .../AddAdGroupBidModifier.vb | 111 + .../AddClickToDownloadAd.vb | 149 + .../AddPlacesLocationExtension.vb | 198 + .../AdvancedOperations/AddSiteLinks.vb | 319 + .../AddTextAdWithUpgradedUrls.vb | 159 + .../GetAdGroupBidModifiers.vb | 125 + .../UploadOfflineConversions.vb | 245 + .../UseSharedBiddingStrategy.vb | 213 + .../AddAdGroupDemographicCriteria.vb | 124 + .../Vb/v201406/BasicOperations/AddAdGroups.vb | 138 + .../v201406/BasicOperations/AddCampaigns.vb | 169 + .../Vb/v201406/BasicOperations/AddKeywords.vb | 129 + .../Vb/v201406/BasicOperations/AddTextAds.vb | 130 + .../Vb/v201406/BasicOperations/GetAdGroups.vb | 114 + .../v201406/BasicOperations/GetCampaigns.vb | 103 + .../BasicOperations/GetCampaignsWithAwql.vb | 102 + .../Vb/v201406/BasicOperations/GetKeywords.vb | 128 + .../Vb/v201406/BasicOperations/GetTextAds.vb | 140 + .../Vb/v201406/BasicOperations/PauseAd.vb | 102 + .../Vb/v201406/BasicOperations/RemoveAd.vb | 105 + .../v201406/BasicOperations/RemoveAdGroup.vb | 101 + .../v201406/BasicOperations/RemoveCampaign.vb | 102 + .../v201406/BasicOperations/RemoveKeyword.vb | 106 + .../v201406/BasicOperations/UpdateAdGroup.vb | 96 + .../v201406/BasicOperations/UpdateCampaign.vb | 97 + .../v201406/BasicOperations/UpdateKeyword.vb | 122 + .../CampaignManagement/AddCampaignLabels.vb | 108 + .../CampaignManagement/AddExperiment.vb | 216 + .../CampaignManagement/AddKeywordsInBulk.vb | 186 + .../AddLocationExtension.vb | 150 + .../GetAllDisapprovedAds.vb | 121 + .../GetAllDisapprovedAdsWithAwql.vb | 111 + .../CampaignManagement/GetCampaignsByLabel.vb | 123 + .../CampaignManagement/PromoteExperiment.vb | 100 + .../CampaignManagement/SetAdParameters.vb | 155 + .../CampaignManagement/SetBidModifier.vb | 112 + .../CampaignManagement/ValidateTextAd.vb | 110 + .../ErrorHandling/HandlePartialFailures.vb | 137 + .../HandlePolicyViolationError.vb | 175 + .../ErrorHandling/HandleRateExceededError.vb | 206 + .../HandleTwoFactorAuthorizationError.vb | 95 + .../Miscellaneous/GetAllVideosAndImages.vb | 139 + .../Vb/v201406/Miscellaneous/UploadImage.vb | 107 + .../Optimization/EstimateKeywordTraffic.vb | 174 + .../Optimization/GetAdGroupBidSimulations.vb | 109 + .../Optimization/GetKeywordBidSimulations.vb | 134 + .../v201406/Optimization/GetKeywordIdeas.vb | 150 + .../v201406/Optimization/GetPlacementIdeas.vb | 123 + .../Vb/v201406/Remarketing/AddAudience.vb | 154 + .../Remarketing/AddConversionTracker.vb | 109 + .../Reporting/DownloadCriteriaReport.vb | 118 + .../DownloadCriteriaReportWithAwql.vb | 102 + .../Vb/v201406/Reporting/GetReportFields.vb | 97 + .../AddProductPartitionTree.vb | 318 + .../ShoppingCampaigns/AddProductScope.vb | 127 + .../ShoppingCampaigns/AddShoppingCampaign.vb | 191 + .../GetProductCategoryTaxonomy.vb | 183 + .../SetProductSalesChannel.vb | 104 + .../Targeting/AddCampaignTargetingCriteria.vb | 200 + .../Targeting/GetCampaignTargetingCriteria.vb | 123 + .../GetTargetableLanguagesAndCarriers.vb | 100 + .../Vb/v201406/Targeting/LookupLocation.vb | 121 + .../CSharp/AdWords.Examples.CSharp.csproj | 196 + examples/AdXBuyer/CSharp/App.config | 192 + examples/AdXBuyer/CSharp/ExampleBase.cs | 35 + examples/AdXBuyer/CSharp/ExampleUtilities.cs | 100 + .../AdWords.Examples.CSharp.OAuth.csproj | 96 + .../AdXBuyer/CSharp/OAuth/ConsoleExample.cs | 140 + examples/AdXBuyer/CSharp/OAuth/Default.aspx | 53 + .../AdXBuyer/CSharp/OAuth/Default.aspx.cs | 232 + .../CSharp/OAuth/Default.aspx.designer.cs | 86 + .../AdXBuyer/CSharp/OAuth/OAuthLogin.aspx | 34 + .../AdXBuyer/CSharp/OAuth/OAuthLogin.aspx.cs | 111 + .../CSharp/OAuth/OAuthLogin.aspx.designer.cs | 34 + .../CSharp/OAuth/Properties/AssemblyInfo.cs | 38 + .../CSharp/OAuth/Properties/Properties.cs | 24 + examples/AdXBuyer/CSharp/OAuth/Web.config | 196 + examples/AdXBuyer/CSharp/OAuth/css/main.css | 26 + examples/AdXBuyer/CSharp/Program.cs | 167 + .../CSharp/Properties/AssemblyInfo.cs | 37 + .../AdXBuyer/CSharp/Properties/Properties.cs | 24 + .../AccountManagement/GetAccountChanges.cs | 176 + .../AddAdGroupBidModifier.cs | 111 + .../GetAdGroupBidModifiers.cs | 122 + .../UploadOfflineConversions.cs | 139 + .../UseSharedBiddingStrategy.cs | 208 + .../AddAdGroupDemographicCriteria.cs | 123 + .../v201309/BasicOperations/AddAdGroups.cs | 137 + .../v201309/BasicOperations/AddCampaigns.cs | 168 + .../v201309/BasicOperations/AddPlacements.cs | 122 + .../AddThirdPartyRedirectAds.cs | 155 + .../v201309/BasicOperations/DeleteAd.cs | 103 + .../v201309/BasicOperations/DeleteAdGroup.cs | 99 + .../v201309/BasicOperations/DeleteCampaign.cs | 99 + .../BasicOperations/DeletePlacement.cs | 103 + .../v201309/BasicOperations/GetAdGroups.cs | 113 + .../v201309/BasicOperations/GetCampaigns.cs | 102 + .../BasicOperations/GetCampaignsWithAwql.cs | 100 + .../v201309/BasicOperations/GetPlacements.cs | 128 + .../GetThirdPartyRedirectAds.cs | 142 + .../CSharp/v201309/BasicOperations/PauseAd.cs | 101 + .../v201309/BasicOperations/UpdateAdGroup.cs | 95 + .../v201309/BasicOperations/UpdateCampaign.cs | 94 + .../BasicOperations/UpdatePlacement.cs | 122 + .../CampaignManagement/AddPlacementsInBulk.cs | 172 + .../GetAllDisapprovedAds.cs | 121 + .../GetAllDisapprovedAdsWihAwql.cs | 108 + .../ErrorHandling/HandlePartialFailures.cs | 135 + .../HandlePolicyViolationError.cs | 180 + .../ErrorHandling/HandleRateExceededError.cs | 204 + .../HandleTwoFactorAuthorizationError.cs | 94 + .../Miscellaneous/GetAllVideosAndImages.cs | 139 + .../v201309/Miscellaneous/UploadImage.cs | 106 + .../v201309/Optimization/GetPlacementIdeas.cs | 122 + .../CSharp/v201309/Remarketing/AddAudience.cs | 156 + .../Remarketing/AddConversionTracker.cs | 106 + .../Reporting/DownloadCriteriaReport.cs | 114 + .../DownloadCriteriaReportWithAwql.cs | 99 + .../v201309/Reporting/GetReportFields.cs | 91 + .../Targeting/AddCampaignTargetingCriteria.cs | 137 + .../Targeting/GetCampaignTargetingCriteria.cs | 124 + .../GetTargetableLanguagesAndCarriers.cs | 99 + .../v201309/Targeting/LookupLocation.cs | 121 + .../AccountManagement/GetAccountChanges.cs | 176 + .../AddAdGroupBidModifier.cs | 111 + .../GetAdGroupBidModifiers.cs | 122 + .../UploadOfflineConversions.cs | 139 + .../UseSharedBiddingStrategy.cs | 209 + .../AddAdGroupDemographicCriteria.cs | 123 + .../v201402/BasicOperations/AddAdGroups.cs | 137 + .../v201402/BasicOperations/AddCampaigns.cs | 173 + .../v201402/BasicOperations/AddPlacements.cs | 122 + .../AddThirdPartyRedirectAds.cs | 155 + .../v201402/BasicOperations/DeleteAd.cs | 103 + .../v201402/BasicOperations/DeleteAdGroup.cs | 99 + .../v201402/BasicOperations/DeleteCampaign.cs | 99 + .../BasicOperations/DeletePlacement.cs | 103 + .../v201402/BasicOperations/GetAdGroups.cs | 113 + .../v201402/BasicOperations/GetCampaigns.cs | 102 + .../BasicOperations/GetCampaignsWithAwql.cs | 100 + .../v201402/BasicOperations/GetPlacements.cs | 128 + .../GetThirdPartyRedirectAds.cs | 142 + .../CSharp/v201402/BasicOperations/PauseAd.cs | 101 + .../v201402/BasicOperations/UpdateAdGroup.cs | 95 + .../v201402/BasicOperations/UpdateCampaign.cs | 94 + .../BasicOperations/UpdatePlacement.cs | 122 + .../CampaignManagement/AddPlacementsInBulk.cs | 172 + .../GetAllDisapprovedAds.cs | 121 + .../GetAllDisapprovedAdsWihAwql.cs | 108 + .../ErrorHandling/HandlePartialFailures.cs | 135 + .../HandlePolicyViolationError.cs | 180 + .../ErrorHandling/HandleRateExceededError.cs | 204 + .../Miscellaneous/GetAllVideosAndImages.cs | 139 + .../v201402/Miscellaneous/UploadImage.cs | 106 + .../v201402/Optimization/GetPlacementIdeas.cs | 122 + .../CSharp/v201402/Remarketing/AddAudience.cs | 156 + .../Remarketing/AddConversionTracker.cs | 107 + .../Reporting/DownloadCriteriaReport.cs | 114 + .../DownloadCriteriaReportWithAwql.cs | 99 + .../v201402/Reporting/GetReportFields.cs | 91 + .../Targeting/AddCampaignTargetingCriteria.cs | 137 + .../Targeting/GetCampaignTargetingCriteria.cs | 124 + .../GetTargetableLanguagesAndCarriers.cs | 99 + .../v201402/Targeting/LookupLocation.cs | 121 + .../AccountManagement/GetAccountChanges.cs | 176 + .../AddAdGroupBidModifier.cs | 111 + .../GetAdGroupBidModifiers.cs | 122 + .../UploadOfflineConversions.cs | 139 + .../UseSharedBiddingStrategy.cs | 209 + .../AddAdGroupDemographicCriteria.cs | 123 + .../v201406/BasicOperations/AddAdGroups.cs | 137 + .../v201406/BasicOperations/AddCampaigns.cs | 173 + .../v201406/BasicOperations/AddPlacements.cs | 122 + .../AddThirdPartyRedirectAds.cs | 155 + .../v201406/BasicOperations/GetAdGroups.cs | 113 + .../v201406/BasicOperations/GetCampaigns.cs | 102 + .../BasicOperations/GetCampaignsWithAwql.cs | 100 + .../v201406/BasicOperations/GetPlacements.cs | 128 + .../GetThirdPartyRedirectAds.cs | 142 + .../CSharp/v201406/BasicOperations/PauseAd.cs | 101 + .../v201406/BasicOperations/RemoveAd.cs | 103 + .../v201406/BasicOperations/RemoveAdGroup.cs | 99 + .../v201406/BasicOperations/RemoveCampaign.cs | 99 + .../BasicOperations/RemovePlacement.cs | 103 + .../v201406/BasicOperations/UpdateAdGroup.cs | 95 + .../v201406/BasicOperations/UpdateCampaign.cs | 94 + .../BasicOperations/UpdatePlacement.cs | 122 + .../CampaignManagement/AddPlacementsInBulk.cs | 172 + .../GetAllDisapprovedAds.cs | 121 + .../GetAllDisapprovedAdsWihAwql.cs | 108 + .../ErrorHandling/HandlePartialFailures.cs | 135 + .../HandlePolicyViolationError.cs | 180 + .../ErrorHandling/HandleRateExceededError.cs | 204 + .../Miscellaneous/GetAllVideosAndImages.cs | 139 + .../v201406/Miscellaneous/UploadImage.cs | 106 + .../v201406/Optimization/GetPlacementIdeas.cs | 122 + .../CSharp/v201406/Remarketing/AddAudience.cs | 156 + .../Remarketing/AddConversionTracker.cs | 107 + .../Reporting/DownloadCriteriaReport.cs | 114 + .../DownloadCriteriaReportWithAwql.cs | 99 + .../v201406/Reporting/GetReportFields.cs | 91 + .../Targeting/AddCampaignTargetingCriteria.cs | 137 + .../Targeting/GetCampaignTargetingCriteria.cs | 124 + .../GetTargetableLanguagesAndCarriers.cs | 99 + .../v201406/Targeting/LookupLocation.cs | 121 + .../AdXBuyer/Vb/AdWords.Examples.VB.vbproj | 209 + examples/AdXBuyer/Vb/App.config | 192 + examples/AdXBuyer/Vb/ExampleBase.vb | 33 + examples/AdXBuyer/Vb/ExampleUtilities.vb | 109 + examples/AdXBuyer/Vb/Program.vb | 169 + .../AccountManagement/GetAccountChanges.vb | 183 + .../AddAdGroupBidModifier.vb | 111 + .../GetAdGroupBidModifiers.vb | 125 + .../UploadOfflineConversions.vb | 245 + .../UseSharedBiddingStrategy.vb | 212 + .../AddAdGroupDemographicCriteria.vb | 124 + .../Vb/v201309/BasicOperations/AddAdGroups.vb | 138 + .../v201309/BasicOperations/AddCampaigns.vb | 169 + .../v201309/BasicOperations/AddPlacements.vb | 121 + .../AddThirdPartyRedirectAds.vb | 151 + .../Vb/v201309/BasicOperations/DeleteAd.vb | 105 + .../v201309/BasicOperations/DeleteAdGroup.vb | 101 + .../v201309/BasicOperations/DeleteCampaign.vb | 102 + .../BasicOperations/DeletePlacement.vb | 106 + .../Vb/v201309/BasicOperations/GetAdGroups.vb | 114 + .../v201309/BasicOperations/GetCampaigns.vb | 103 + .../BasicOperations/GetCampaignsWithAwql.vb | 102 + .../v201309/BasicOperations/GetPlacements.vb | 128 + .../GetThirdPartyRedirectAds.vb | 143 + .../Vb/v201309/BasicOperations/PauseAd.vb | 102 + .../v201309/BasicOperations/UpdateAdGroup.vb | 96 + .../v201309/BasicOperations/UpdateCampaign.vb | 97 + .../BasicOperations/UpdatePlacement.vb | 123 + .../CampaignManagement/AddPlacementsInBulk.vb | 185 + .../GetAllDisapprovedAds.vb | 121 + .../GetAllDisapprovedAdsWithAwql.vb | 111 + .../ErrorHandling/HandlePartialFailures.vb | 136 + .../HandlePolicyViolationError.vb | 184 + .../ErrorHandling/HandleRateExceededError.vb | 206 + .../HandleTwoFactorAuthorizationError.vb | 95 + .../Miscellaneous/GetAllVideosAndImages.vb | 139 + .../Vb/v201309/Miscellaneous/UploadImage.vb | 107 + .../v201309/Optimization/GetPlacementIdeas.vb | 123 + .../Vb/v201309/Remarketing/AddAudience.vb | 154 + .../Remarketing/AddConversionTracker.vb | 108 + .../Reporting/DownloadCriteriaReport.vb | 118 + .../DownloadCriteriaReportWithAwql.vb | 102 + .../Vb/v201309/Reporting/GetReportFields.vb | 97 + .../Targeting/AddCampaignTargetingCriteria.vb | 138 + .../Targeting/GetCampaignTargetingCriteria.vb | 123 + .../GetTargetableLanguagesAndCarriers.vb | 100 + .../Vb/v201309/Targeting/LookupLocation.vb | 121 + .../AccountManagement/GetAccountChanges.vb | 183 + .../AddAdGroupBidModifier.vb | 111 + .../GetAdGroupBidModifiers.vb | 125 + .../UploadOfflineConversions.vb | 245 + .../UseSharedBiddingStrategy.vb | 213 + .../AddAdGroupDemographicCriteria.vb | 124 + .../Vb/v201402/BasicOperations/AddAdGroups.vb | 138 + .../v201402/BasicOperations/AddCampaigns.vb | 174 + .../v201402/BasicOperations/AddPlacements.vb | 121 + .../AddThirdPartyRedirectAds.vb | 151 + .../Vb/v201402/BasicOperations/DeleteAd.vb | 105 + .../v201402/BasicOperations/DeleteAdGroup.vb | 101 + .../v201402/BasicOperations/DeleteCampaign.vb | 102 + .../BasicOperations/DeletePlacement.vb | 106 + .../Vb/v201402/BasicOperations/GetAdGroups.vb | 114 + .../v201402/BasicOperations/GetCampaigns.vb | 103 + .../BasicOperations/GetCampaignsWithAwql.vb | 102 + .../v201402/BasicOperations/GetPlacements.vb | 128 + .../GetThirdPartyRedirectAds.vb | 143 + .../Vb/v201402/BasicOperations/PauseAd.vb | 102 + .../v201402/BasicOperations/UpdateAdGroup.vb | 96 + .../v201402/BasicOperations/UpdateCampaign.vb | 97 + .../BasicOperations/UpdatePlacement.vb | 123 + .../CampaignManagement/AddPlacementsInBulk.vb | 185 + .../GetAllDisapprovedAds.vb | 121 + .../GetAllDisapprovedAdsWithAwql.vb | 111 + .../ErrorHandling/HandlePartialFailures.vb | 136 + .../HandlePolicyViolationError.vb | 184 + .../ErrorHandling/HandleRateExceededError.vb | 206 + .../Miscellaneous/GetAllVideosAndImages.vb | 139 + .../Vb/v201402/Miscellaneous/UploadImage.vb | 107 + .../v201402/Optimization/GetPlacementIdeas.vb | 123 + .../Vb/v201402/Remarketing/AddAudience.vb | 154 + .../Remarketing/AddConversionTracker.vb | 109 + .../Reporting/DownloadCriteriaReport.vb | 118 + .../DownloadCriteriaReportWithAwql.vb | 102 + .../Vb/v201402/Reporting/GetReportFields.vb | 97 + .../Targeting/AddCampaignTargetingCriteria.vb | 138 + .../Targeting/GetCampaignTargetingCriteria.vb | 123 + .../GetTargetableLanguagesAndCarriers.vb | 100 + .../Vb/v201402/Targeting/LookupLocation.vb | 121 + .../AccountManagement/GetAccountChanges.vb | 183 + .../AddAdGroupBidModifier.vb | 111 + .../GetAdGroupBidModifiers.vb | 125 + .../UploadOfflineConversions.vb | 245 + .../UseSharedBiddingStrategy.vb | 213 + .../AddAdGroupDemographicCriteria.vb | 124 + .../Vb/v201406/BasicOperations/AddAdGroups.vb | 138 + .../v201406/BasicOperations/AddCampaigns.vb | 174 + .../v201406/BasicOperations/AddPlacements.vb | 121 + .../AddThirdPartyRedirectAds.vb | 151 + .../Vb/v201406/BasicOperations/GetAdGroups.vb | 114 + .../v201406/BasicOperations/GetCampaigns.vb | 103 + .../BasicOperations/GetCampaignsWithAwql.vb | 102 + .../v201406/BasicOperations/GetPlacements.vb | 128 + .../GetThirdPartyRedirectAds.vb | 143 + .../Vb/v201406/BasicOperations/PauseAd.vb | 102 + .../Vb/v201406/BasicOperations/RemoveAd.vb | 105 + .../v201406/BasicOperations/RemoveAdGroup.vb | 101 + .../v201406/BasicOperations/RemoveCampaign.vb | 102 + .../BasicOperations/RemovePlacement.vb | 106 + .../v201406/BasicOperations/UpdateAdGroup.vb | 96 + .../v201406/BasicOperations/UpdateCampaign.vb | 97 + .../BasicOperations/UpdatePlacement.vb | 123 + .../CampaignManagement/AddPlacementsInBulk.vb | 185 + .../GetAllDisapprovedAds.vb | 121 + .../GetAllDisapprovedAdsWithAwql.vb | 111 + .../ErrorHandling/HandlePartialFailures.vb | 136 + .../HandlePolicyViolationError.vb | 184 + .../ErrorHandling/HandleRateExceededError.vb | 206 + .../Miscellaneous/GetAllVideosAndImages.vb | 139 + .../Vb/v201406/Miscellaneous/UploadImage.vb | 107 + .../v201406/Optimization/GetPlacementIdeas.vb | 123 + .../Vb/v201406/Remarketing/AddAudience.vb | 154 + .../Remarketing/AddConversionTracker.vb | 109 + .../Reporting/DownloadCriteriaReport.vb | 118 + .../DownloadCriteriaReportWithAwql.vb | 102 + .../Vb/v201406/Reporting/GetReportFields.vb | 97 + .../Targeting/AddCampaignTargetingCriteria.vb | 138 + .../Targeting/GetCampaignTargetingCriteria.vb | 123 + .../GetTargetableLanguagesAndCarriers.vb | 100 + .../Vb/v201406/Targeting/LookupLocation.vb | 121 + examples/Dfa/CSharp/App.config | 189 + .../Dfa/CSharp/Dfa.Examples.CSharp.csproj | 189 + examples/Dfa/CSharp/OAuth/ConsoleExample.cs | 120 + examples/Dfa/CSharp/OAuth/Default.aspx | 51 + examples/Dfa/CSharp/OAuth/Default.aspx.cs | 164 + .../Dfa/CSharp/OAuth/Default.aspx.designer.cs | 78 + .../OAuth/Dfa.Examples.CSharp.OAuth.csproj | 100 + examples/Dfa/CSharp/OAuth/OAuthLogin.aspx | 34 + examples/Dfa/CSharp/OAuth/OAuthLogin.aspx.cs | 111 + .../CSharp/OAuth/OAuthLogin.aspx.designer.cs | 33 + .../CSharp/OAuth/Properties/AssemblyInfo.cs | 38 + .../Dfa/CSharp/OAuth/Properties/Properties.cs | 24 + examples/Dfa/CSharp/OAuth/Web.config | 175 + examples/Dfa/CSharp/OAuth/css/main.css | 27 + examples/Dfa/CSharp/Program.cs | 127 + .../Dfa/CSharp/Properties/AssemblyInfo.cs | 38 + examples/Dfa/CSharp/Properties/Properties.cs | 24 + examples/Dfa/CSharp/SampleBase.cs | 71 + .../CSharp/v1_19/AddAdvertiserUserFilter.cs | 117 + .../AssignAdvertisersToAdvertiserGroup.cs | 84 + .../v1_19/AssignCreativesToPlacements.cs | 91 + examples/Dfa/CSharp/v1_19/Authenticate.cs | 94 + examples/Dfa/CSharp/v1_19/CreateAdvertiser.cs | 89 + .../Dfa/CSharp/v1_19/CreateAdvertiserGroup.cs | 83 + examples/Dfa/CSharp/v1_19/CreateCampaign.cs | 97 + .../Dfa/CSharp/v1_19/CreateContentCategory.cs | 83 + .../Dfa/CSharp/v1_19/CreateCreativeField.cs | 85 + .../CSharp/v1_19/CreateCreativeFieldValue.cs | 86 + .../Dfa/CSharp/v1_19/CreateCreativeGroup.cs | 89 + .../CSharp/v1_19/CreateFlashInpageCreative.cs | 114 + examples/Dfa/CSharp/v1_19/CreateHTMLAsset.cs | 87 + examples/Dfa/CSharp/v1_19/CreateImageAsset.cs | 85 + .../v1_19/CreateInStreamVideoCreative.cs | 106 + .../Dfa/CSharp/v1_19/CreateMobileAsset.cs | 87 + .../Dfa/CSharp/v1_19/CreateMobileCreative.cs | 99 + examples/Dfa/CSharp/v1_19/CreatePlacement.cs | 116 + .../CSharp/v1_19/CreatePlacementStrategy.cs | 84 + .../Dfa/CSharp/v1_19/CreateRotationGroup.cs | 123 + .../CSharp/v1_19/CreateSpotlightActivity.cs | 98 + .../v1_19/CreateSpotlightActivityGroup.cs | 91 + examples/Dfa/CSharp/v1_19/CreateSubnetwork.cs | 92 + examples/Dfa/CSharp/v1_19/CreateUserRole.cs | 102 + examples/Dfa/CSharp/v1_19/DownloadTags.cs | 99 + .../Dfa/CSharp/v1_19/GetActivityGroups.cs | 91 + examples/Dfa/CSharp/v1_19/GetActivityTypes.cs | 76 + examples/Dfa/CSharp/v1_19/GetAdTypes.cs | 78 + .../Dfa/CSharp/v1_19/GetAdTypesNoConfig.cs | 100 + .../Dfa/CSharp/v1_19/GetAdvertiserGroups.cs | 92 + examples/Dfa/CSharp/v1_19/GetAdvertisers.cs | 89 + .../CSharp/v1_19/GetAvailablePermissions.cs | 91 + examples/Dfa/CSharp/v1_19/GetCampaigns.cs | 88 + .../CSharp/v1_19/GetChangeLogForAdvertiser.cs | 104 + .../CSharp/v1_19/GetChangeLogObjectTypes.cs | 76 + .../Dfa/CSharp/v1_19/GetContentCategories.cs | 90 + examples/Dfa/CSharp/v1_19/GetCountries.cs | 83 + examples/Dfa/CSharp/v1_19/GetCreativeField.cs | 94 + .../CSharp/v1_19/GetCreativeFieldValues.cs | 91 + .../Dfa/CSharp/v1_19/GetCreativeGroups.cs | 93 + examples/Dfa/CSharp/v1_19/GetCreativeTypes.cs | 77 + examples/Dfa/CSharp/v1_19/GetCreatives.cs | 90 + examples/Dfa/CSharp/v1_19/GetDFASite.cs | 91 + .../CSharp/v1_19/GetPlacementStrategies.cs | 91 + .../Dfa/CSharp/v1_19/GetPlacementTypes.cs | 77 + examples/Dfa/CSharp/v1_19/GetPlacements.cs | 88 + examples/Dfa/CSharp/v1_19/GetPricingTypes.cs | 77 + examples/Dfa/CSharp/v1_19/GetReport.cs | 82 + examples/Dfa/CSharp/v1_19/GetReports.cs | 94 + examples/Dfa/CSharp/v1_19/GetSize.cs | 84 + examples/Dfa/CSharp/v1_19/GetSubnetworks.cs | 88 + .../Dfa/CSharp/v1_19/GetTagMethodTypes.cs | 76 + .../Dfa/CSharp/v1_19/GetUserFilterTypes.cs | 79 + examples/Dfa/CSharp/v1_19/GetUserRoles.cs | 102 + examples/Dfa/CSharp/v1_19/GetUsers.cs | 90 + .../v1_19/ModifyInStreamMediaFilesAndAds.cs | 118 + examples/Dfa/CSharp/v1_19/RCReport.cs | 158 + .../Dfa/CSharp/v1_19/ReplaceInStreamAsset.cs | 111 + .../Dfa/CSharp/v1_19/RunDeferredReport.cs | 86 + .../Dfa/CSharp/v1_19/UploadInStreamAsset.cs | 107 + .../CSharp/v1_20/AddAdvertiserUserFilter.cs | 117 + .../AssignAdvertisersToAdvertiserGroup.cs | 84 + .../v1_20/AssignCreativesToPlacements.cs | 91 + examples/Dfa/CSharp/v1_20/Authenticate.cs | 94 + examples/Dfa/CSharp/v1_20/CreateAdvertiser.cs | 89 + .../Dfa/CSharp/v1_20/CreateAdvertiserGroup.cs | 83 + examples/Dfa/CSharp/v1_20/CreateCampaign.cs | 97 + .../Dfa/CSharp/v1_20/CreateContentCategory.cs | 83 + .../Dfa/CSharp/v1_20/CreateCreativeField.cs | 85 + .../CSharp/v1_20/CreateCreativeFieldValue.cs | 86 + .../Dfa/CSharp/v1_20/CreateCreativeGroup.cs | 89 + .../CSharp/v1_20/CreateFlashInpageCreative.cs | 114 + examples/Dfa/CSharp/v1_20/CreateHTMLAsset.cs | 87 + examples/Dfa/CSharp/v1_20/CreateImageAsset.cs | 85 + .../v1_20/CreateInStreamVideoCreative.cs | 106 + .../Dfa/CSharp/v1_20/CreateMobileAsset.cs | 87 + .../Dfa/CSharp/v1_20/CreateMobileCreative.cs | 99 + examples/Dfa/CSharp/v1_20/CreatePlacement.cs | 116 + .../CSharp/v1_20/CreatePlacementStrategy.cs | 84 + .../Dfa/CSharp/v1_20/CreateRotationGroup.cs | 123 + .../CSharp/v1_20/CreateSpotlightActivity.cs | 98 + .../v1_20/CreateSpotlightActivityGroup.cs | 91 + examples/Dfa/CSharp/v1_20/CreateSubnetwork.cs | 92 + examples/Dfa/CSharp/v1_20/CreateUserRole.cs | 102 + examples/Dfa/CSharp/v1_20/DownloadTags.cs | 99 + .../Dfa/CSharp/v1_20/GetActivityGroups.cs | 91 + examples/Dfa/CSharp/v1_20/GetActivityTypes.cs | 76 + examples/Dfa/CSharp/v1_20/GetAdTypes.cs | 78 + .../Dfa/CSharp/v1_20/GetAdTypesNoConfig.cs | 100 + .../Dfa/CSharp/v1_20/GetAdvertiserGroups.cs | 92 + examples/Dfa/CSharp/v1_20/GetAdvertisers.cs | 89 + .../CSharp/v1_20/GetAvailablePermissions.cs | 91 + examples/Dfa/CSharp/v1_20/GetCampaigns.cs | 88 + .../CSharp/v1_20/GetChangeLogForAdvertiser.cs | 104 + .../CSharp/v1_20/GetChangeLogObjectTypes.cs | 76 + .../Dfa/CSharp/v1_20/GetContentCategories.cs | 90 + examples/Dfa/CSharp/v1_20/GetCountries.cs | 83 + examples/Dfa/CSharp/v1_20/GetCreativeField.cs | 94 + .../CSharp/v1_20/GetCreativeFieldValues.cs | 91 + .../Dfa/CSharp/v1_20/GetCreativeGroups.cs | 93 + examples/Dfa/CSharp/v1_20/GetCreativeTypes.cs | 77 + examples/Dfa/CSharp/v1_20/GetCreatives.cs | 90 + examples/Dfa/CSharp/v1_20/GetDFASite.cs | 91 + .../CSharp/v1_20/GetPlacementStrategies.cs | 91 + .../Dfa/CSharp/v1_20/GetPlacementTypes.cs | 77 + examples/Dfa/CSharp/v1_20/GetPlacements.cs | 88 + examples/Dfa/CSharp/v1_20/GetPricingTypes.cs | 77 + examples/Dfa/CSharp/v1_20/GetReport.cs | 82 + examples/Dfa/CSharp/v1_20/GetReports.cs | 94 + examples/Dfa/CSharp/v1_20/GetSize.cs | 84 + examples/Dfa/CSharp/v1_20/GetSubnetworks.cs | 88 + .../Dfa/CSharp/v1_20/GetTagMethodTypes.cs | 76 + .../Dfa/CSharp/v1_20/GetUserFilterTypes.cs | 79 + examples/Dfa/CSharp/v1_20/GetUserRoles.cs | 102 + examples/Dfa/CSharp/v1_20/GetUsers.cs | 90 + .../v1_20/ModifyInStreamMediaFilesAndAds.cs | 118 + examples/Dfa/CSharp/v1_20/RCReport.cs | 158 + .../Dfa/CSharp/v1_20/ReplaceInStreamAsset.cs | 111 + .../Dfa/CSharp/v1_20/RunDeferredReport.cs | 86 + .../Dfa/CSharp/v1_20/UploadInStreamAsset.cs | 107 + examples/Dfa/Wcf/WcfService/AdTypeContract.cs | 49 + .../WcfService/Dfa.Examples.WcfService.csproj | 110 + examples/Dfa/Wcf/WcfService/DfaClient.cs | 113 + examples/Dfa/Wcf/WcfService/IWcfService.cs | 62 + .../Wcf/WcfService/Properties/AssemblyInfo.cs | 38 + .../Wcf/WcfService/Properties/Properties.cs | 24 + examples/Dfa/Wcf/WcfService/ReportContract.cs | 80 + examples/Dfa/Wcf/WcfService/WcfService.svc | 1 + examples/Dfa/Wcf/WcfService/WcfService.svc.cs | 75 + examples/Dfa/Wcf/WcfService/Web.config | 258 + .../Dfa.Examples.WcfServiceConsumer.csproj | 101 + .../WcfServiceConsumer/MainForm.Designer.cs | 60 + .../Dfa/Wcf/WcfServiceConsumer/MainForm.cs | 53 + .../Dfa/Wcf/WcfServiceConsumer/MainForm.resx | 120 + .../Dfa/Wcf/WcfServiceConsumer/Program.cs | 36 + .../Properties/AssemblyInfo.cs | 38 + .../Properties/Properties.cs | 24 + .../Properties/Resources.Designer.cs | 63 + .../Properties/Resources.resx | 117 + .../Properties/Settings.Designer.cs | 26 + .../Properties/Settings.settings | 7 + ....Wcf.WcfServiceReference.AdType.datasource | 10 + ...ServiceReference.AdTypeContract.datasource | 10 + ...ServiceReference.ReportContract.datasource | 10 + .../WcfServiceReference/Reference.cs | 354 + .../WcfServiceReference/Reference.svcmap | 33 + .../WcfServiceReference/WcfService.disco | 4 + .../WcfServiceReference/WcfService.wsdl | 370 + .../WcfServiceReference/WcfService.xsd | 33 + .../WcfServiceReference/WcfService1.xsd | 18 + .../WcfServiceReference/WcfService2.xsd | 42 + .../WcfServiceReference/WcfService3.xsd | 60 + .../WcfServiceReference/configuration.svcinfo | 10 + examples/Dfp/CSharp/App.config | 190 + .../Dfp/CSharp/Dfp.Examples.CSharp.csproj | 1145 + examples/Dfp/CSharp/OAuth/ConsoleExample.cs | 129 + examples/Dfp/CSharp/OAuth/Default.aspx | 49 + examples/Dfp/CSharp/OAuth/Default.aspx.cs | 167 + .../Dfp/CSharp/OAuth/Default.aspx.designer.cs | 61 + .../OAuth/Dfp.Examples.CSharp.OAuth.csproj | 89 + examples/Dfp/CSharp/OAuth/OAuthLogin.aspx | 34 + examples/Dfp/CSharp/OAuth/OAuthLogin.aspx.cs | 111 + .../CSharp/OAuth/OAuthLogin.aspx.designer.cs | 34 + .../CSharp/OAuth/Properties/AssemblyInfo.cs | 39 + .../Dfp/CSharp/OAuth/Properties/Properties.cs | 24 + examples/Dfp/CSharp/OAuth/Web.config | 191 + examples/Dfp/CSharp/OAuth/css/main.css | 27 + examples/Dfp/CSharp/Program.cs | 127 + .../Dfp/CSharp/Properties/AssemblyInfo.cs | 38 + examples/Dfp/CSharp/Properties/Properties.cs | 24 + examples/Dfp/CSharp/SampleBase.cs | 67 + .../GetAllAudienceSegments.cs | 88 + .../v201208/CompanyService/CreateCompanies.cs | 86 + .../v201208/CompanyService/GetAllCompanies.cs | 88 + .../CompanyService/GetCompaniesByStatement.cs | 85 + .../v201208/CompanyService/GetCompany.cs | 77 + .../v201208/CompanyService/UpdateCompanies.cs | 99 + .../v201208/ContentService/GetAllContent.cs | 89 + .../ContentService/GetContentByCategory.cs | 123 + .../CreativeService/CopyImageCreatives.cs | 119 + .../CreateCreativeFromTemplate.cs | 138 + .../CreativeService/CreateCreatives.cs | 113 + .../CreativeService/CreateCustomCreative.cs | 111 + .../CreativeService/GetAllCreatives.cs | 89 + .../v201208/CreativeService/GetCreative.cs | 77 + .../GetCreativesByStatement.cs | 86 + .../CreativeService/UpdateCreatives.cs | 104 + .../GetAllCreativeTemplates.cs | 92 + .../GetCreativeTemplate.cs | 87 + .../GetCreativeTemplatesByStatement.cs | 85 + .../CreateCustomFieldOptions.cs | 97 + .../CustomFieldService/CreateCustomFields.cs | 92 + .../DeactivateAllLineItemCustomFields.cs | 122 + .../CustomFieldService/GetAllCustomFields.cs | 107 + .../GetAllLineItemCustomFields.cs | 97 + .../SetLineItemCustomFieldValue.cs | 148 + .../CustomFieldService/UpdateCustomFields.cs | 95 + .../CreateCustomTargetingKeysAndValues.cs | 158 + .../GetAllCustomTargetingKeysAndValues.cs | 122 + .../GetCustomTargetingKeysByStatement.cs | 88 + .../GetCustomTargetingValuesByStatement.cs | 99 + .../UpdateCustomTargetingKeys.cs | 107 + .../UpdateCustomTargetingValues.cs | 113 + .../v201208/ForecastService/GetForecast.cs | 111 + .../ForecastService/GetForecastById.cs | 82 + .../v201208/InventoryService/CreateAdUnits.cs | 108 + .../InventoryService/CreateMobileAdUnit.cs | 104 + .../InventoryService/CreateVideoAdUnit.cs | 123 + .../InventoryService/DeActivateAdUnits.cs | 120 + .../v201208/InventoryService/GetAdUnit.cs | 77 + .../InventoryService/GetAdUnitSizes.cs | 80 + .../InventoryService/GetAdUnitsByStatement.cs | 93 + .../v201208/InventoryService/GetAllAdUnits.cs | 88 + .../InventoryService/GetInventoryTree.cs | 203 + .../v201208/InventoryService/UpdateAdUnits.cs | 92 + .../v201208/LabelService/CreateLabels.cs | 93 + .../LabelService/DeactivateActiveLabels.cs | 116 + .../v201208/LabelService/GetAllLabels.cs | 93 + .../CSharp/v201208/LabelService/GetLabel.cs | 83 + .../LabelService/GetLabelsByStatement.cs | 92 + .../v201208/LabelService/UpdateLabels.cs | 99 + .../ActivateLicas.cs | 125 + .../CreateLicas.cs | 108 + .../DeactivateLicas.cs | 125 + .../GetAllLicas.cs | 91 + .../GetLica.cs | 81 + .../GetLicasByStatement.cs | 89 + .../UpdateLicas.cs | 97 + .../LineItemService/ActivateLineItem.cs | 134 + .../LineItemService/CreateLineItems.cs | 217 + .../LineItemService/CreateMobileLineItem.cs | 172 + .../LineItemService/CreateVideoLineItem.cs | 184 + .../LineItemService/GetAllLineItems.cs | 91 + .../v201208/LineItemService/GetLineItem.cs | 78 + .../GetLineItemsByStatement.cs | 92 + .../GetRecentlyUpdatedLineItems.cs | 92 + .../LineItemService/TargetCustomCriteria.cs | 167 + .../LineItemService/UpdateLineItems.cs | 108 + .../v201208/NetworkService/GetAllNetworks.cs | 81 + .../NetworkService/GetCurrentNetwork.cs | 70 + .../v201208/NetworkService/MakeTestNetwork.cs | 85 + .../v201208/OrderService/ApproveOrder.cs | 121 + .../v201208/OrderService/CreateOrders.cs | 96 + .../v201208/OrderService/GetAllOrders.cs | 88 + .../CSharp/v201208/OrderService/GetOrder.cs | 75 + .../OrderService/GetOrdersByStatement.cs | 89 + .../v201208/OrderService/UpdateOrders.cs | 100 + .../PlacementService/CreatePlacements.cs | 164 + .../PlacementService/DeactivatePlacement.cs | 120 + .../PlacementService/GetAllPlacements.cs | 91 + .../v201208/PlacementService/GetPlacement.cs | 79 + .../GetPlacementsByStatement.cs | 85 + .../PlacementService/UpdatePlacements.cs | 105 + .../GetAllCities.cs | 85 + .../v201208/ReportService/DownloadReport.cs | 83 + .../ReportService/RunDeliveryReport.cs | 104 + .../ReportService/RunInventoryReport.cs | 97 + .../ReportService/RunMergedDeliveryReport.cs | 96 + .../RunReportWithCustomFields.cs | 145 + .../v201208/ReportService/RunSalesReport.cs | 93 + .../ApproveSuggestedAdUnits.cs | 105 + .../GetAllSuggestedAdUnits.cs | 94 + .../GetSuggestedAdUnit.cs | 83 + .../GetSuggestedUnitByStatement.cs | 90 + .../CSharp/v201208/TeamService/CreateTeams.cs | 88 + .../CSharp/v201208/TeamService/GetAllTeams.cs | 89 + .../Dfp/CSharp/v201208/TeamService/GetTeam.cs | 78 + .../TeamService/GetTeamsByStatement.cs | 85 + .../CSharp/v201208/TeamService/UpdateTeams.cs | 107 + .../ArchiveThirdPartySlots.cs | 120 + .../CreateThirdPartySlot.cs | 98 + .../GetAllThirdPartySlots.cs | 90 + .../GetThirdPartySlotsByStatement.cs | 87 + .../UpdateThirdPartySlots.cs | 93 + .../CSharp/v201208/UserService/CreateUsers.cs | 100 + .../v201208/UserService/DeactivateUser.cs | 123 + .../CSharp/v201208/UserService/GetAllRoles.cs | 77 + .../CSharp/v201208/UserService/GetAllUsers.cs | 87 + .../v201208/UserService/GetCurrentUser.cs | 71 + .../Dfp/CSharp/v201208/UserService/GetUser.cs | 76 + .../UserService/GetUsersByStatement.cs | 82 + .../CSharp/v201208/UserService/UpdateUsers.cs | 96 + .../CreateUserTeamAssociations.cs | 98 + .../DeleteUserTeamAssociations.cs | 121 + .../GetAllUserTeamAssociations.cs | 93 + .../GetUserTeamAssociation.cs | 84 + .../GetUserTeamAssociationsByStatement.cs | 98 + .../UpdateUserTeamAssociations.cs | 107 + .../GetAllAudienceSegments.cs | 88 + .../v201211/CompanyService/CreateCompanies.cs | 86 + .../v201211/CompanyService/GetAllCompanies.cs | 88 + .../CompanyService/GetCompaniesByStatement.cs | 85 + .../v201211/CompanyService/GetCompany.cs | 77 + .../v201211/CompanyService/UpdateCompanies.cs | 99 + .../v201211/ContentService/GetAllContent.cs | 89 + .../ContentService/GetContentByCategory.cs | 123 + .../CreativeService/CopyImageCreatives.cs | 119 + .../CreateCreativeFromTemplate.cs | 138 + .../CreativeService/CreateCreatives.cs | 113 + .../CreativeService/CreateCustomCreative.cs | 111 + .../CreativeService/GetAllCreatives.cs | 89 + .../v201211/CreativeService/GetCreative.cs | 77 + .../GetCreativesByStatement.cs | 86 + .../CreativeService/UpdateCreatives.cs | 104 + .../GetAllCreativeTemplates.cs | 92 + .../GetCreativeTemplate.cs | 87 + .../GetCreativeTemplatesByStatement.cs | 85 + .../CreateCreativeWrappers.cs | 89 + .../DeactivateCreativeWrappers.cs | 95 + .../GetActiveCreativeWrappers.cs | 94 + .../GetAllCreativeWrappers.cs | 92 + .../UpdateCreativeWrappers.cs | 84 + .../CreateCustomFieldOptions.cs | 97 + .../CustomFieldService/CreateCustomFields.cs | 92 + .../DeactivateAllLineItemCustomFields.cs | 122 + .../CustomFieldService/GetAllCustomFields.cs | 107 + .../GetAllLineItemCustomFields.cs | 97 + .../SetLineItemCustomFieldValue.cs | 148 + .../CustomFieldService/UpdateCustomFields.cs | 95 + .../CreateCustomTargetingKeysAndValues.cs | 158 + .../GetAllCustomTargetingKeysAndValues.cs | 122 + .../GetCustomTargetingKeysByStatement.cs | 88 + .../GetCustomTargetingValuesByStatement.cs | 99 + .../UpdateCustomTargetingKeys.cs | 107 + .../UpdateCustomTargetingValues.cs | 113 + .../v201211/ForecastService/GetForecast.cs | 111 + .../ForecastService/GetForecastById.cs | 82 + .../v201211/InventoryService/CreateAdUnits.cs | 108 + .../InventoryService/CreateMobileAdUnit.cs | 104 + .../InventoryService/CreateVideoAdUnit.cs | 123 + .../InventoryService/DeActivateAdUnits.cs | 120 + .../v201211/InventoryService/GetAdUnit.cs | 77 + .../InventoryService/GetAdUnitSizes.cs | 80 + .../InventoryService/GetAdUnitsByStatement.cs | 93 + .../v201211/InventoryService/GetAllAdUnits.cs | 88 + .../InventoryService/GetInventoryTree.cs | 203 + .../v201211/InventoryService/UpdateAdUnits.cs | 92 + .../v201211/LabelService/CreateLabels.cs | 93 + .../LabelService/DeactivateActiveLabels.cs | 116 + .../v201211/LabelService/GetAllLabels.cs | 93 + .../CSharp/v201211/LabelService/GetLabel.cs | 83 + .../LabelService/GetLabelsByStatement.cs | 92 + .../v201211/LabelService/UpdateLabels.cs | 99 + .../ActivateLicas.cs | 125 + .../CreateLicas.cs | 108 + .../DeactivateLicas.cs | 125 + .../GetAllLicas.cs | 91 + .../GetLica.cs | 81 + .../GetLicasByStatement.cs | 89 + .../UpdateLicas.cs | 97 + .../LineItemService/ActivateLineItem.cs | 134 + .../LineItemService/CreateLineItems.cs | 217 + .../LineItemService/CreateMobileLineItem.cs | 172 + .../LineItemService/CreateVideoLineItem.cs | 184 + .../LineItemService/GetAllLineItems.cs | 91 + .../v201211/LineItemService/GetLineItem.cs | 78 + .../GetLineItemsByStatement.cs | 92 + .../GetRecentlyUpdatedLineItems.cs | 92 + .../LineItemService/TargetCustomCriteria.cs | 167 + .../LineItemService/UpdateLineItems.cs | 108 + .../v201211/NetworkService/GetAllNetworks.cs | 81 + .../NetworkService/GetCurrentNetwork.cs | 70 + .../v201211/NetworkService/MakeTestNetwork.cs | 85 + .../v201211/OrderService/ApproveOrder.cs | 121 + .../v201211/OrderService/CreateOrders.cs | 96 + .../v201211/OrderService/GetAllOrders.cs | 88 + .../CSharp/v201211/OrderService/GetOrder.cs | 75 + .../OrderService/GetOrdersByStatement.cs | 89 + .../v201211/OrderService/UpdateOrders.cs | 100 + .../PlacementService/CreatePlacements.cs | 164 + .../PlacementService/DeactivatePlacement.cs | 120 + .../PlacementService/GetAllPlacements.cs | 91 + .../v201211/PlacementService/GetPlacement.cs | 79 + .../GetPlacementsByStatement.cs | 85 + .../PlacementService/UpdatePlacements.cs | 105 + .../GetAllCities.cs | 111 + .../v201211/ReportService/DownloadReport.cs | 83 + .../ReportService/RunDeliveryReport.cs | 104 + .../ReportService/RunInventoryReport.cs | 97 + .../ReportService/RunMergedDeliveryReport.cs | 96 + .../RunReportWithCustomFields.cs | 145 + .../v201211/ReportService/RunSalesReport.cs | 93 + .../ApproveSuggestedAdUnits.cs | 105 + .../GetAllSuggestedAdUnits.cs | 94 + .../GetSuggestedAdUnit.cs | 83 + .../GetSuggestedUnitByStatement.cs | 90 + .../CSharp/v201211/TeamService/CreateTeams.cs | 88 + .../CSharp/v201211/TeamService/GetAllTeams.cs | 89 + .../Dfp/CSharp/v201211/TeamService/GetTeam.cs | 78 + .../TeamService/GetTeamsByStatement.cs | 85 + .../CSharp/v201211/TeamService/UpdateTeams.cs | 107 + .../ArchiveThirdPartySlots.cs | 120 + .../CreateThirdPartySlot.cs | 98 + .../GetAllThirdPartySlots.cs | 90 + .../GetThirdPartySlotsByStatement.cs | 87 + .../UpdateThirdPartySlots.cs | 93 + .../CSharp/v201211/UserService/CreateUsers.cs | 100 + .../v201211/UserService/DeactivateUser.cs | 123 + .../CSharp/v201211/UserService/GetAllRoles.cs | 77 + .../CSharp/v201211/UserService/GetAllUsers.cs | 87 + .../v201211/UserService/GetCurrentUser.cs | 71 + .../Dfp/CSharp/v201211/UserService/GetUser.cs | 76 + .../UserService/GetUsersByStatement.cs | 82 + .../CSharp/v201211/UserService/UpdateUsers.cs | 96 + .../CreateUserTeamAssociations.cs | 98 + .../DeleteUserTeamAssociations.cs | 121 + .../GetAllUserTeamAssociations.cs | 93 + .../GetUserTeamAssociation.cs | 84 + .../GetUserTeamAssociationsByStatement.cs | 98 + .../UpdateUserTeamAssociations.cs | 107 + .../CreateActivityGroups.cs | 96 + .../GetActiveActivityGroups.cs | 94 + .../GetAllActivityGroups.cs | 91 + .../UpdateActivityGroups.cs | 93 + .../ActivityService/CreateActivities.cs | 93 + .../ActivityService/GetActiveActivities.cs | 100 + .../ActivityService/GetAllActivities.cs | 132 + .../ActivityService/UpdateActivities.cs | 88 + .../GetAllAudienceSegments.cs | 88 + .../v201302/CompanyService/CreateCompanies.cs | 86 + .../v201302/CompanyService/GetAllCompanies.cs | 88 + .../CompanyService/GetCompaniesByStatement.cs | 85 + .../v201302/CompanyService/GetCompany.cs | 77 + .../v201302/CompanyService/UpdateCompanies.cs | 99 + .../v201302/ContactService/CreateContacts.cs | 89 + .../v201302/ContactService/GetAllContacts.cs | 90 + .../ContactService/GetUninvitedContacts.cs | 92 + .../v201302/ContactService/UpdateContacts.cs | 83 + .../v201302/ContentService/GetAllContent.cs | 89 + .../ContentService/GetContentByCategory.cs | 123 + .../CreativeService/CopyImageCreatives.cs | 127 + .../CreateCreativeFromTemplate.cs | 138 + .../CreativeService/CreateCreatives.cs | 120 + .../CreativeService/CreateCustomCreative.cs | 111 + .../CreativeService/GetAllCreatives.cs | 89 + .../v201302/CreativeService/GetCreative.cs | 77 + .../GetCreativesByStatement.cs | 86 + .../CreativeService/UpdateCreatives.cs | 104 + .../GetAllCreativeTemplates.cs | 92 + .../GetCreativeTemplate.cs | 87 + .../GetCreativeTemplatesByStatement.cs | 85 + .../CreateCreativeWrappers.cs | 89 + .../DeactivateCreativeWrappers.cs | 95 + .../GetActiveCreativeWrappers.cs | 94 + .../GetAllCreativeWrappers.cs | 92 + .../UpdateCreativeWrappers.cs | 84 + .../CreateCustomFieldOptions.cs | 97 + .../CustomFieldService/CreateCustomFields.cs | 92 + .../DeactivateAllLineItemCustomFields.cs | 122 + .../CustomFieldService/GetAllCustomFields.cs | 107 + .../GetAllLineItemCustomFields.cs | 97 + .../SetLineItemCustomFieldValue.cs | 148 + .../CustomFieldService/UpdateCustomFields.cs | 95 + .../CreateCustomTargetingKeysAndValues.cs | 158 + .../GetAllCustomTargetingKeysAndValues.cs | 122 + .../GetCustomTargetingKeysByStatement.cs | 88 + .../GetCustomTargetingValuesByStatement.cs | 99 + .../UpdateCustomTargetingKeys.cs | 107 + .../UpdateCustomTargetingValues.cs | 113 + .../v201302/ForecastService/GetForecast.cs | 111 + .../ForecastService/GetForecastById.cs | 82 + .../v201302/InventoryService/CreateAdUnits.cs | 108 + .../InventoryService/CreateMobileAdUnit.cs | 104 + .../InventoryService/CreateVideoAdUnit.cs | 123 + .../InventoryService/DeActivateAdUnits.cs | 120 + .../v201302/InventoryService/GetAdUnit.cs | 77 + .../InventoryService/GetAdUnitSizes.cs | 80 + .../InventoryService/GetAdUnitsByStatement.cs | 93 + .../v201302/InventoryService/GetAllAdUnits.cs | 88 + .../InventoryService/GetInventoryTree.cs | 203 + .../v201302/InventoryService/UpdateAdUnits.cs | 92 + .../v201302/LabelService/CreateLabels.cs | 93 + .../LabelService/DeactivateActiveLabels.cs | 116 + .../v201302/LabelService/GetAllLabels.cs | 93 + .../CSharp/v201302/LabelService/GetLabel.cs | 83 + .../LabelService/GetLabelsByStatement.cs | 92 + .../v201302/LabelService/UpdateLabels.cs | 99 + .../ActivateLicas.cs | 125 + .../CreateLicas.cs | 108 + .../DeactivateLicas.cs | 125 + .../GetAllLicas.cs | 91 + .../GetLica.cs | 81 + .../GetLicasByStatement.cs | 89 + .../UpdateLicas.cs | 97 + .../LineItemService/ActivateLineItem.cs | 134 + .../LineItemService/CreateLineItems.cs | 217 + .../LineItemService/CreateMobileLineItem.cs | 172 + .../LineItemService/CreateVideoLineItem.cs | 187 + .../LineItemService/GetAllLineItems.cs | 91 + .../v201302/LineItemService/GetLineItem.cs | 78 + .../GetLineItemsByStatement.cs | 92 + .../GetRecentlyUpdatedLineItems.cs | 92 + .../LineItemService/TargetCustomCriteria.cs | 167 + .../LineItemService/UpdateLineItems.cs | 108 + .../v201302/NetworkService/GetAllNetworks.cs | 81 + .../NetworkService/GetCurrentNetwork.cs | 70 + .../v201302/NetworkService/MakeTestNetwork.cs | 85 + .../v201302/OrderService/ApproveOrder.cs | 121 + .../v201302/OrderService/CreateOrders.cs | 96 + .../v201302/OrderService/GetAllOrders.cs | 88 + .../CSharp/v201302/OrderService/GetOrder.cs | 75 + .../OrderService/GetOrdersByStatement.cs | 89 + .../v201302/OrderService/UpdateOrders.cs | 100 + .../PlacementService/CreatePlacements.cs | 164 + .../PlacementService/DeactivatePlacement.cs | 120 + .../PlacementService/GetAllPlacements.cs | 91 + .../v201302/PlacementService/GetPlacement.cs | 79 + .../GetPlacementsByStatement.cs | 85 + .../PlacementService/UpdatePlacements.cs | 105 + .../GetAllCities.cs | 111 + .../v201302/ReportService/DisplayReport.cs | 87 + .../v201302/ReportService/DownloadReport.cs | 83 + .../ReportService/RunDeliveryReport.cs | 104 + .../ReportService/RunInventoryReport.cs | 97 + .../ReportService/RunMergedDeliveryReport.cs | 96 + .../v201302/ReportService/RunReachReport.cs | 94 + .../RunReportWithCustomFields.cs | 145 + .../v201302/ReportService/RunSalesReport.cs | 94 + .../ApproveSuggestedAdUnits.cs | 105 + .../GetAllSuggestedAdUnits.cs | 94 + .../GetSuggestedAdUnit.cs | 83 + .../GetSuggestedUnitByStatement.cs | 90 + .../CSharp/v201302/TeamService/CreateTeams.cs | 88 + .../CSharp/v201302/TeamService/GetAllTeams.cs | 89 + .../Dfp/CSharp/v201302/TeamService/GetTeam.cs | 78 + .../TeamService/GetTeamsByStatement.cs | 85 + .../CSharp/v201302/TeamService/UpdateTeams.cs | 107 + .../ArchiveThirdPartySlots.cs | 120 + .../CreateThirdPartySlot.cs | 98 + .../GetAllThirdPartySlots.cs | 90 + .../GetThirdPartySlotsByStatement.cs | 87 + .../UpdateThirdPartySlots.cs | 93 + .../CSharp/v201302/UserService/CreateUsers.cs | 100 + .../v201302/UserService/DeactivateUser.cs | 123 + .../CSharp/v201302/UserService/GetAllRoles.cs | 77 + .../CSharp/v201302/UserService/GetAllUsers.cs | 87 + .../v201302/UserService/GetCurrentUser.cs | 71 + .../Dfp/CSharp/v201302/UserService/GetUser.cs | 76 + .../UserService/GetUsersByStatement.cs | 82 + .../CSharp/v201302/UserService/UpdateUsers.cs | 96 + .../CreateUserTeamAssociations.cs | 98 + .../DeleteUserTeamAssociations.cs | 121 + .../GetAllUserTeamAssociations.cs | 93 + .../GetUserTeamAssociation.cs | 84 + .../GetUserTeamAssociationsByStatement.cs | 98 + .../UpdateUserTeamAssociations.cs | 107 + .../CreateActivityGroups.cs | 96 + .../GetActiveActivityGroups.cs | 94 + .../GetAllActivityGroups.cs | 91 + .../UpdateActivityGroups.cs | 93 + .../ActivityService/CreateActivities.cs | 93 + .../ActivityService/GetActiveActivities.cs | 100 + .../ActivityService/GetAllActivities.cs | 132 + .../ActivityService/UpdateActivities.cs | 88 + .../GetAllAudienceSegments.cs | 88 + .../v201306/CompanyService/CreateCompanies.cs | 86 + .../v201306/CompanyService/GetAllCompanies.cs | 88 + .../CompanyService/GetCompaniesByStatement.cs | 85 + .../v201306/CompanyService/GetCompany.cs | 77 + .../v201306/CompanyService/UpdateCompanies.cs | 99 + .../v201306/ContactService/CreateContacts.cs | 89 + .../v201306/ContactService/GetAllContacts.cs | 90 + .../ContactService/GetUninvitedContacts.cs | 92 + .../v201306/ContactService/UpdateContacts.cs | 83 + .../v201306/ContentService/GetAllContent.cs | 89 + .../ContentService/GetContentByCategory.cs | 123 + .../CreativeService/CopyImageCreatives.cs | 127 + .../CreateCreativeFromTemplate.cs | 138 + .../CreativeService/CreateCreatives.cs | 120 + .../CreativeService/CreateCustomCreative.cs | 111 + .../CreativeService/GetAllCreatives.cs | 89 + .../v201306/CreativeService/GetCreative.cs | 77 + .../GetCreativesByStatement.cs | 86 + .../CreativeService/UpdateCreatives.cs | 104 + .../GetAllCreativeTemplates.cs | 92 + .../GetCreativeTemplate.cs | 87 + .../GetCreativeTemplatesByStatement.cs | 85 + .../CreateCreativeWrappers.cs | 89 + .../DeactivateCreativeWrappers.cs | 95 + .../GetActiveCreativeWrappers.cs | 94 + .../GetAllCreativeWrappers.cs | 92 + .../UpdateCreativeWrappers.cs | 84 + .../CreateCustomFieldOptions.cs | 97 + .../CustomFieldService/CreateCustomFields.cs | 92 + .../DeactivateAllLineItemCustomFields.cs | 122 + .../CustomFieldService/GetAllCustomFields.cs | 107 + .../GetAllLineItemCustomFields.cs | 97 + .../SetLineItemCustomFieldValue.cs | 148 + .../CustomFieldService/UpdateCustomFields.cs | 95 + .../CreateCustomTargetingKeysAndValues.cs | 158 + .../GetAllCustomTargetingKeysAndValues.cs | 122 + .../GetCustomTargetingKeysByStatement.cs | 88 + .../GetCustomTargetingValuesByStatement.cs | 99 + .../UpdateCustomTargetingKeys.cs | 107 + .../UpdateCustomTargetingValues.cs | 113 + .../v201306/ForecastService/GetForecast.cs | 111 + .../ForecastService/GetForecastById.cs | 82 + .../v201306/InventoryService/CreateAdUnits.cs | 108 + .../InventoryService/CreateMobileAdUnit.cs | 104 + .../InventoryService/CreateVideoAdUnit.cs | 123 + .../InventoryService/DeActivateAdUnits.cs | 120 + .../v201306/InventoryService/GetAdUnit.cs | 77 + .../InventoryService/GetAdUnitSizes.cs | 80 + .../InventoryService/GetAdUnitsByStatement.cs | 93 + .../v201306/InventoryService/GetAllAdUnits.cs | 88 + .../InventoryService/GetInventoryTree.cs | 203 + .../v201306/InventoryService/UpdateAdUnits.cs | 92 + .../v201306/LabelService/CreateLabels.cs | 93 + .../LabelService/DeactivateActiveLabels.cs | 116 + .../v201306/LabelService/GetAllLabels.cs | 93 + .../CSharp/v201306/LabelService/GetLabel.cs | 83 + .../LabelService/GetLabelsByStatement.cs | 92 + .../v201306/LabelService/UpdateLabels.cs | 99 + .../ActivateLicas.cs | 125 + .../CreateLicas.cs | 108 + .../DeactivateLicas.cs | 125 + .../GetAllLicas.cs | 91 + .../GetLica.cs | 81 + .../GetLicasByStatement.cs | 89 + .../UpdateLicas.cs | 97 + .../LineItemService/ActivateLineItem.cs | 134 + .../LineItemService/CreateLineItems.cs | 217 + .../LineItemService/CreateMobileLineItem.cs | 172 + .../LineItemService/CreateVideoLineItem.cs | 187 + .../LineItemService/GetAllLineItems.cs | 91 + .../v201306/LineItemService/GetLineItem.cs | 78 + .../GetLineItemsByStatement.cs | 92 + .../GetRecentlyUpdatedLineItems.cs | 92 + .../LineItemService/TargetCustomCriteria.cs | 167 + .../LineItemService/UpdateLineItems.cs | 108 + .../v201306/NetworkService/GetAllNetworks.cs | 81 + .../NetworkService/GetCurrentNetwork.cs | 70 + .../v201306/NetworkService/MakeTestNetwork.cs | 85 + .../v201306/OrderService/ApproveOrder.cs | 121 + .../v201306/OrderService/CreateOrders.cs | 96 + .../v201306/OrderService/GetAllOrders.cs | 88 + .../CSharp/v201306/OrderService/GetOrder.cs | 75 + .../OrderService/GetOrdersByStatement.cs | 89 + .../v201306/OrderService/UpdateOrders.cs | 100 + .../PlacementService/CreatePlacements.cs | 164 + .../PlacementService/DeactivatePlacement.cs | 120 + .../PlacementService/GetAllPlacements.cs | 91 + .../v201306/PlacementService/GetPlacement.cs | 79 + .../GetPlacementsByStatement.cs | 85 + .../PlacementService/UpdatePlacements.cs | 105 + .../GetAllCities.cs | 111 + .../v201306/ReportService/DisplayReport.cs | 87 + .../v201306/ReportService/DownloadReport.cs | 83 + .../ReportService/RunDeliveryReport.cs | 104 + .../ReportService/RunInventoryReport.cs | 97 + .../ReportService/RunMergedDeliveryReport.cs | 96 + .../v201306/ReportService/RunReachReport.cs | 94 + .../RunReportWithCustomFields.cs | 145 + .../v201306/ReportService/RunSalesReport.cs | 94 + .../ApproveSuggestedAdUnits.cs | 105 + .../GetAllSuggestedAdUnits.cs | 94 + .../GetSuggestedAdUnit.cs | 83 + .../GetSuggestedUnitByStatement.cs | 90 + .../CSharp/v201306/TeamService/CreateTeams.cs | 88 + .../CSharp/v201306/TeamService/GetAllTeams.cs | 89 + .../Dfp/CSharp/v201306/TeamService/GetTeam.cs | 78 + .../TeamService/GetTeamsByStatement.cs | 85 + .../CSharp/v201306/TeamService/UpdateTeams.cs | 107 + .../CSharp/v201306/UserService/CreateUsers.cs | 100 + .../v201306/UserService/DeactivateUser.cs | 123 + .../CSharp/v201306/UserService/GetAllRoles.cs | 77 + .../CSharp/v201306/UserService/GetAllUsers.cs | 87 + .../v201306/UserService/GetCurrentUser.cs | 71 + .../Dfp/CSharp/v201306/UserService/GetUser.cs | 76 + .../UserService/GetUsersByStatement.cs | 82 + .../CSharp/v201306/UserService/UpdateUsers.cs | 96 + .../CreateUserTeamAssociations.cs | 98 + .../DeleteUserTeamAssociations.cs | 121 + .../GetAllUserTeamAssociations.cs | 93 + .../GetUserTeamAssociation.cs | 84 + .../GetUserTeamAssociationsByStatement.cs | 98 + .../UpdateUserTeamAssociations.cs | 107 + .../CreateActivityGroups.cs | 96 + .../GetActiveActivityGroups.cs | 94 + .../GetAllActivityGroups.cs | 91 + .../UpdateActivityGroups.cs | 93 + .../ActivityService/CreateActivities.cs | 93 + .../ActivityService/GetActiveActivities.cs | 100 + .../ActivityService/GetAllActivities.cs | 132 + .../ActivityService/UpdateActivities.cs | 88 + .../CreateAudienceSegments.cs | 121 + .../GetAllAudienceSegments.cs | 90 + .../GetFirstPartyAudienceSegments.cs | 94 + .../PopulateFirstPartyAudienceSegments.cs | 98 + .../UpdateAudienceSegments.cs | 97 + .../v201308/CompanyService/CreateCompanies.cs | 86 + .../v201308/CompanyService/GetAllCompanies.cs | 88 + .../CompanyService/GetCompaniesByStatement.cs | 85 + .../v201308/CompanyService/GetCompany.cs | 77 + .../v201308/CompanyService/UpdateCompanies.cs | 99 + .../v201308/ContactService/CreateContacts.cs | 89 + .../v201308/ContactService/GetAllContacts.cs | 90 + .../ContactService/GetUninvitedContacts.cs | 92 + .../v201308/ContactService/UpdateContacts.cs | 83 + .../v201308/ContentService/GetAllContent.cs | 89 + .../ContentService/GetContentByCategory.cs | 123 + .../CreativeService/CopyImageCreatives.cs | 127 + .../CreateCreativeFromTemplate.cs | 138 + .../CreativeService/CreateCreatives.cs | 120 + .../CreativeService/CreateCustomCreative.cs | 111 + .../CreativeService/GetAllCreatives.cs | 89 + .../v201308/CreativeService/GetCreative.cs | 77 + .../GetCreativesByStatement.cs | 86 + .../CreativeService/UpdateCreatives.cs | 104 + .../GetAllCreativeTemplates.cs | 92 + .../GetCreativeTemplate.cs | 87 + .../GetCreativeTemplatesByStatement.cs | 85 + .../CreateCreativeWrappers.cs | 89 + .../DeactivateCreativeWrappers.cs | 95 + .../GetActiveCreativeWrappers.cs | 94 + .../GetAllCreativeWrappers.cs | 92 + .../UpdateCreativeWrappers.cs | 84 + .../CreateCustomFieldOptions.cs | 97 + .../CustomFieldService/CreateCustomFields.cs | 92 + .../DeactivateAllLineItemCustomFields.cs | 122 + .../CustomFieldService/GetAllCustomFields.cs | 107 + .../GetAllLineItemCustomFields.cs | 97 + .../SetLineItemCustomFieldValue.cs | 148 + .../CustomFieldService/UpdateCustomFields.cs | 95 + .../CreateCustomTargetingKeysAndValues.cs | 158 + .../GetAllCustomTargetingKeysAndValues.cs | 122 + .../GetCustomTargetingKeysByStatement.cs | 88 + .../GetCustomTargetingValuesByStatement.cs | 99 + .../UpdateCustomTargetingKeys.cs | 107 + .../UpdateCustomTargetingValues.cs | 113 + .../v201308/ForecastService/GetForecast.cs | 113 + .../ForecastService/GetForecastById.cs | 84 + .../v201308/InventoryService/CreateAdUnits.cs | 108 + .../InventoryService/CreateMobileAdUnit.cs | 104 + .../InventoryService/CreateVideoAdUnit.cs | 123 + .../InventoryService/DeActivateAdUnits.cs | 120 + .../v201308/InventoryService/GetAdUnit.cs | 77 + .../InventoryService/GetAdUnitSizes.cs | 80 + .../InventoryService/GetAdUnitsByStatement.cs | 93 + .../v201308/InventoryService/GetAllAdUnits.cs | 88 + .../InventoryService/GetInventoryTree.cs | 203 + .../v201308/InventoryService/UpdateAdUnits.cs | 92 + .../v201308/LabelService/CreateLabels.cs | 93 + .../LabelService/DeactivateActiveLabels.cs | 116 + .../v201308/LabelService/GetAllLabels.cs | 93 + .../CSharp/v201308/LabelService/GetLabel.cs | 83 + .../LabelService/GetLabelsByStatement.cs | 92 + .../v201308/LabelService/UpdateLabels.cs | 99 + .../ActivateLicas.cs | 125 + .../CreateLicas.cs | 108 + .../DeactivateLicas.cs | 125 + .../GetAllLicas.cs | 91 + .../GetLica.cs | 81 + .../GetLicasByStatement.cs | 89 + .../UpdateLicas.cs | 97 + .../LineItemService/ActivateLineItem.cs | 134 + .../LineItemService/CreateLineItems.cs | 217 + .../LineItemService/CreateMobileLineItem.cs | 172 + .../LineItemService/CreateVideoLineItem.cs | 187 + .../LineItemService/GetAllLineItems.cs | 91 + .../v201308/LineItemService/GetLineItem.cs | 78 + .../GetLineItemsByStatement.cs | 92 + .../GetRecentlyUpdatedLineItems.cs | 92 + .../LineItemService/TargetCustomCriteria.cs | 167 + .../LineItemService/UpdateLineItems.cs | 108 + .../v201308/NetworkService/GetAllNetworks.cs | 81 + .../NetworkService/GetCurrentNetwork.cs | 70 + .../v201308/NetworkService/MakeTestNetwork.cs | 85 + .../v201308/OrderService/ApproveOrder.cs | 121 + .../v201308/OrderService/CreateOrders.cs | 96 + .../v201308/OrderService/GetAllOrders.cs | 88 + .../CSharp/v201308/OrderService/GetOrder.cs | 75 + .../OrderService/GetOrdersByStatement.cs | 89 + .../v201308/OrderService/UpdateOrders.cs | 100 + .../PlacementService/CreatePlacements.cs | 164 + .../PlacementService/DeactivatePlacement.cs | 120 + .../PlacementService/GetAllPlacements.cs | 91 + .../v201308/PlacementService/GetPlacement.cs | 79 + .../GetPlacementsByStatement.cs | 85 + .../PlacementService/UpdatePlacements.cs | 105 + .../GetAllLineItemsUsingPql.cs | 109 + .../GetGeoTargets.cs | 119 + .../GetLineItemsNamedLike.cs | 108 + .../v201308/ReportService/DisplayReport.cs | 87 + .../v201308/ReportService/DownloadReport.cs | 83 + .../ReportService/RunDeliveryReport.cs | 104 + .../ReportService/RunInventoryReport.cs | 97 + .../ReportService/RunMergedDeliveryReport.cs | 96 + .../v201308/ReportService/RunReachReport.cs | 94 + .../RunReportWithCustomFields.cs | 145 + .../v201308/ReportService/RunSalesReport.cs | 94 + .../ApproveSuggestedAdUnits.cs | 105 + .../GetAllSuggestedAdUnits.cs | 94 + .../GetSuggestedAdUnit.cs | 83 + .../GetSuggestedUnitByStatement.cs | 90 + .../CSharp/v201308/TeamService/CreateTeams.cs | 88 + .../CSharp/v201308/TeamService/GetAllTeams.cs | 89 + .../Dfp/CSharp/v201308/TeamService/GetTeam.cs | 78 + .../TeamService/GetTeamsByStatement.cs | 85 + .../CSharp/v201308/TeamService/UpdateTeams.cs | 107 + .../CSharp/v201308/UserService/CreateUsers.cs | 100 + .../v201308/UserService/DeactivateUser.cs | 123 + .../CSharp/v201308/UserService/GetAllRoles.cs | 77 + .../CSharp/v201308/UserService/GetAllUsers.cs | 87 + .../v201308/UserService/GetCurrentUser.cs | 71 + .../Dfp/CSharp/v201308/UserService/GetUser.cs | 76 + .../UserService/GetUsersByStatement.cs | 82 + .../CSharp/v201308/UserService/UpdateUsers.cs | 96 + .../CreateUserTeamAssociations.cs | 98 + .../DeleteUserTeamAssociations.cs | 121 + .../GetAllUserTeamAssociations.cs | 93 + .../GetUserTeamAssociation.cs | 84 + .../GetUserTeamAssociationsByStatement.cs | 98 + .../UpdateUserTeamAssociations.cs | 107 + .../CreateActivityGroups.cs | 96 + .../GetActiveActivityGroups.cs | 94 + .../GetAllActivityGroups.cs | 91 + .../UpdateActivityGroups.cs | 93 + .../ActivityService/CreateActivities.cs | 93 + .../ActivityService/GetActiveActivities.cs | 95 + .../ActivityService/GetAllActivities.cs | 91 + .../ActivityService/UpdateActivities.cs | 88 + .../CreateAudienceSegments.cs | 121 + .../GetAllAudienceSegments.cs | 90 + .../GetFirstPartyAudienceSegments.cs | 94 + .../PopulateFirstPartyAudienceSegments.cs | 98 + .../UpdateAudienceSegments.cs | 97 + .../v201311/CompanyService/CreateCompanies.cs | 86 + .../v201311/CompanyService/GetAllCompanies.cs | 88 + .../CompanyService/GetCompaniesByStatement.cs | 85 + .../v201311/CompanyService/GetCompany.cs | 77 + .../v201311/CompanyService/UpdateCompanies.cs | 99 + .../v201311/ContactService/CreateContacts.cs | 89 + .../v201311/ContactService/GetAllContacts.cs | 90 + .../ContactService/GetUninvitedContacts.cs | 92 + .../v201311/ContactService/UpdateContacts.cs | 83 + .../v201311/ContentService/GetAllContent.cs | 89 + .../ContentService/GetContentByCategory.cs | 123 + .../CreativeService/CopyImageCreatives.cs | 127 + .../CreateCreativeFromTemplate.cs | 138 + .../CreativeService/CreateCreatives.cs | 120 + .../CreativeService/CreateCustomCreative.cs | 111 + .../CreativeService/GetAllCreatives.cs | 89 + .../v201311/CreativeService/GetCreative.cs | 77 + .../GetCreativesByStatement.cs | 86 + .../CreativeService/UpdateCreatives.cs | 104 + .../GetAllCreativeTemplates.cs | 92 + .../GetCreativeTemplate.cs | 87 + .../GetCreativeTemplatesByStatement.cs | 85 + .../CreateCreativeWrappers.cs | 89 + .../DeactivateCreativeWrappers.cs | 95 + .../GetActiveCreativeWrappers.cs | 94 + .../GetAllCreativeWrappers.cs | 92 + .../UpdateCreativeWrappers.cs | 84 + .../CreateCustomFieldOptions.cs | 97 + .../CustomFieldService/CreateCustomFields.cs | 92 + .../DeactivateAllLineItemCustomFields.cs | 122 + .../CustomFieldService/GetAllCustomFields.cs | 107 + .../GetAllLineItemCustomFields.cs | 97 + .../SetLineItemCustomFieldValue.cs | 148 + .../CustomFieldService/UpdateCustomFields.cs | 95 + .../CreateCustomTargetingKeysAndValues.cs | 158 + .../GetAllCustomTargetingKeysAndValues.cs | 122 + .../GetCustomTargetingKeysByStatement.cs | 88 + .../GetCustomTargetingValuesByStatement.cs | 99 + .../UpdateCustomTargetingKeys.cs | 107 + .../UpdateCustomTargetingValues.cs | 113 + .../v201311/ForecastService/GetForecast.cs | 113 + .../ForecastService/GetForecastById.cs | 84 + .../v201311/InventoryService/CreateAdUnits.cs | 108 + .../InventoryService/CreateMobileAdUnit.cs | 104 + .../InventoryService/CreateVideoAdUnit.cs | 123 + .../InventoryService/DeActivateAdUnits.cs | 120 + .../v201311/InventoryService/GetAdUnit.cs | 77 + .../InventoryService/GetAdUnitSizes.cs | 80 + .../InventoryService/GetAdUnitsByStatement.cs | 93 + .../v201311/InventoryService/GetAllAdUnits.cs | 88 + .../InventoryService/GetInventoryTree.cs | 203 + .../v201311/InventoryService/UpdateAdUnits.cs | 92 + .../v201311/LabelService/CreateLabels.cs | 93 + .../LabelService/DeactivateActiveLabels.cs | 116 + .../v201311/LabelService/GetAllLabels.cs | 93 + .../CSharp/v201311/LabelService/GetLabel.cs | 83 + .../LabelService/GetLabelsByStatement.cs | 92 + .../v201311/LabelService/UpdateLabels.cs | 99 + .../ActivateLicas.cs | 125 + .../CreateLicas.cs | 108 + .../DeactivateLicas.cs | 125 + .../GetAllLicas.cs | 91 + .../GetLica.cs | 81 + .../GetLicasByStatement.cs | 89 + .../UpdateLicas.cs | 97 + .../LineItemService/ActivateLineItem.cs | 134 + .../LineItemService/CreateLineItems.cs | 216 + .../LineItemService/CreateMobileLineItem.cs | 172 + .../LineItemService/CreateVideoLineItem.cs | 187 + .../LineItemService/GetAllLineItems.cs | 91 + .../v201311/LineItemService/GetLineItem.cs | 78 + .../GetLineItemsByStatement.cs | 92 + .../GetRecentlyUpdatedLineItems.cs | 92 + .../LineItemService/TargetCustomCriteria.cs | 167 + .../LineItemService/UpdateLineItems.cs | 108 + .../v201311/NetworkService/GetAllNetworks.cs | 81 + .../NetworkService/GetCurrentNetwork.cs | 70 + .../v201311/NetworkService/MakeTestNetwork.cs | 85 + .../v201311/OrderService/ApproveOrder.cs | 121 + .../v201311/OrderService/CreateOrders.cs | 96 + .../v201311/OrderService/GetAllOrders.cs | 88 + .../CSharp/v201311/OrderService/GetOrder.cs | 75 + .../OrderService/GetOrdersByStatement.cs | 89 + .../v201311/OrderService/UpdateOrders.cs | 100 + .../PlacementService/CreatePlacements.cs | 164 + .../PlacementService/DeactivatePlacement.cs | 120 + .../PlacementService/GetAllPlacements.cs | 91 + .../v201311/PlacementService/GetPlacement.cs | 79 + .../GetPlacementsByStatement.cs | 85 + .../PlacementService/UpdatePlacements.cs | 105 + .../FetchMatchTables.cs | 115 + .../GetAllLineItemsUsingPql.cs | 109 + .../GetGeoTargets.cs | 119 + .../GetLineItemsNamedLike.cs | 108 + .../v201311/ReportService/DisplayReport.cs | 87 + .../v201311/ReportService/DownloadReport.cs | 83 + .../ReportService/RunDeliveryReport.cs | 104 + .../ReportService/RunInventoryReport.cs | 116 + .../ReportService/RunMergedDeliveryReport.cs | 96 + .../v201311/ReportService/RunReachReport.cs | 94 + .../RunReportWithCustomFields.cs | 145 + .../v201311/ReportService/RunSalesReport.cs | 94 + .../ApproveSuggestedAdUnits.cs | 105 + .../GetAllSuggestedAdUnits.cs | 94 + .../GetSuggestedAdUnit.cs | 83 + .../GetSuggestedUnitByStatement.cs | 90 + .../CSharp/v201311/TeamService/CreateTeams.cs | 88 + .../CSharp/v201311/TeamService/GetAllTeams.cs | 89 + .../Dfp/CSharp/v201311/TeamService/GetTeam.cs | 78 + .../TeamService/GetTeamsByStatement.cs | 85 + .../CSharp/v201311/TeamService/UpdateTeams.cs | 107 + .../CSharp/v201311/UserService/CreateUsers.cs | 100 + .../v201311/UserService/DeactivateUser.cs | 123 + .../CSharp/v201311/UserService/GetAllRoles.cs | 77 + .../CSharp/v201311/UserService/GetAllUsers.cs | 87 + .../v201311/UserService/GetCurrentUser.cs | 71 + .../Dfp/CSharp/v201311/UserService/GetUser.cs | 76 + .../UserService/GetUsersByStatement.cs | 82 + .../CSharp/v201311/UserService/UpdateUsers.cs | 96 + .../CreateUserTeamAssociations.cs | 98 + .../DeleteUserTeamAssociations.cs | 121 + .../GetAllUserTeamAssociations.cs | 93 + .../GetUserTeamAssociation.cs | 84 + .../GetUserTeamAssociationsByStatement.cs | 98 + .../UpdateUserTeamAssociations.cs | 107 + .../CreateActivityGroups.cs | 96 + .../GetActiveActivityGroups.cs | 91 + .../GetAllActivityGroups.cs | 91 + .../UpdateActivityGroups.cs | 98 + .../ActivityService/CreateActivities.cs | 93 + .../ActivityService/GetActiveActivities.cs | 93 + .../ActivityService/GetAllActivities.cs | 91 + .../ActivityService/UpdateActivities.cs | 91 + .../CreateAudienceSegments.cs | 121 + .../GetAllAudienceSegments.cs | 92 + .../GetFirstPartyAudienceSegments.cs | 94 + .../PopulateFirstPartyAudienceSegments.cs | 98 + .../UpdateAudienceSegments.cs | 98 + .../v201403/CompanyService/CreateCompanies.cs | 86 + .../v201403/CompanyService/GetAllCompanies.cs | 87 + .../CompanyService/GetCompaniesByStatement.cs | 91 + .../v201403/CompanyService/UpdateCompanies.cs | 91 + .../v201403/ContactService/CreateContacts.cs | 89 + .../v201403/ContactService/GetAllContacts.cs | 89 + .../ContactService/GetUninvitedContacts.cs | 92 + .../v201403/ContactService/UpdateContacts.cs | 91 + .../CreateContentMetadataKeyHierarchies.cs | 105 + .../DeleteContentMetadataKeyHierarchies.cs | 104 + .../GetAllContentMetadataKeyHierarchies.cs | 94 + .../UpdateContentMetadataKeyHierarchies.cs | 118 + .../v201403/ContentService/GetAllContent.cs | 90 + .../ContentService/GetContentByCategory.cs | 128 + .../CreativeService/CopyImageCreatives.cs | 111 + .../CreateCreativeFromTemplate.cs | 138 + .../CreativeService/CreateCreatives.cs | 120 + .../CreativeService/CreateCustomCreative.cs | 110 + .../CreativeService/GetAllCreatives.cs | 90 + .../GetCreativesByStatement.cs | 93 + .../CreativeService/UpdateCreatives.cs | 98 + .../GetAllCreativeTemplates.cs | 93 + .../GetCreativeTemplatesByStatement.cs | 93 + .../CreateCreativeWrappers.cs | 89 + .../DeactivateCreativeWrappers.cs | 111 + .../GetActiveCreativeWrappers.cs | 95 + .../GetAllCreativeWrappers.cs | 92 + .../UpdateCreativeWrappers.cs | 90 + .../CreateCustomFieldOptions.cs | 97 + .../CustomFieldService/CreateCustomFields.cs | 92 + .../DeactivateCustomFields.cs | 120 + .../CustomFieldService/GetAllCustomFields.cs | 107 + .../GetAllLineItemCustomFields.cs | 94 + .../SetLineItemCustomFieldValue.cs | 152 + .../CustomFieldService/UpdateCustomFields.cs | 96 + .../CreateCustomTargetingKeysAndValues.cs | 158 + .../GetAllCustomTargetingKeysAndValues.cs | 123 + .../GetCustomTargetingKeysByStatement.cs | 97 + .../GetCustomTargetingValuesByStatement.cs | 105 + .../UpdateCustomTargetingKeys.cs | 103 + .../UpdateCustomTargetingValues.cs | 104 + .../v201403/ForecastService/GetForecast.cs | 113 + .../ForecastService/GetForecastById.cs | 84 + .../v201403/InventoryService/CreateAdUnits.cs | 108 + .../InventoryService/CreateMobileAdUnit.cs | 102 + .../InventoryService/CreateVideoAdUnit.cs | 121 + .../InventoryService/DeActivateAdUnits.cs | 118 + .../InventoryService/GetAdUnitSizes.cs | 82 + .../InventoryService/GetAdUnitsByStatement.cs | 101 + .../v201403/InventoryService/GetAllAdUnits.cs | 89 + .../InventoryService/GetInventoryTree.cs | 206 + .../v201403/InventoryService/UpdateAdUnits.cs | 91 + .../v201403/LabelService/CreateLabels.cs | 93 + .../LabelService/DeactivateActiveLabels.cs | 115 + .../v201403/LabelService/GetAllLabels.cs | 94 + .../LabelService/GetLabelsByStatement.cs | 99 + .../v201403/LabelService/UpdateLabels.cs | 94 + .../ActivateLicas.cs | 122 + .../CreateLicas.cs | 104 + .../DeactivateLicas.cs | 122 + .../GetAllLicas.cs | 92 + .../GetLicasByStatement.cs | 96 + .../UpdateLicas.cs | 103 + .../LineItemService/ActivateLineItem.cs | 131 + .../LineItemService/CreateLineItems.cs | 216 + .../LineItemService/CreateMobileLineItem.cs | 172 + .../LineItemService/CreateVideoLineItem.cs | 186 + .../LineItemService/GetAllLineItems.cs | 92 + .../GetLineItemsByStatement.cs | 97 + .../GetRecentlyUpdatedLineItems.cs | 98 + .../LineItemService/TargetCustomCriteria.cs | 173 + .../LineItemService/UpdateLineItems.cs | 100 + .../v201403/NetworkService/GetAllNetworks.cs | 81 + .../NetworkService/GetCurrentNetwork.cs | 70 + .../v201403/NetworkService/MakeTestNetwork.cs | 85 + .../v201403/OrderService/ApproveOrder.cs | 119 + .../v201403/OrderService/CreateOrders.cs | 96 + .../v201403/OrderService/GetAllOrders.cs | 89 + .../OrderService/GetOrdersByStatement.cs | 96 + .../v201403/OrderService/UpdateOrders.cs | 96 + .../PlacementService/CreatePlacements.cs | 164 + .../PlacementService/DeactivatePlacement.cs | 117 + .../PlacementService/GetAllPlacements.cs | 91 + .../GetPlacementsByStatement.cs | 94 + .../PlacementService/UpdatePlacements.cs | 101 + .../FetchMatchTables.cs | 119 + .../GetAllLineItemsUsingPql.cs | 109 + .../GetGeoTargets.cs | 116 + .../GetLineItemsNamedLike.cs | 107 + .../v201403/ReportService/DisplayReport.cs | 87 + .../v201403/ReportService/DownloadReport.cs | 83 + .../ReportService/RunDeliveryReport.cs | 105 + .../ReportService/RunInventoryReport.cs | 116 + .../ReportService/RunMergedDeliveryReport.cs | 96 + .../v201403/ReportService/RunReachReport.cs | 94 + .../RunReportWithCustomFields.cs | 141 + .../v201403/ReportService/RunSalesReport.cs | 94 + .../ApproveSuggestedAdUnits.cs | 117 + .../GetAllSuggestedAdUnits.cs | 94 + .../GetSuggestedUnitByStatement.cs | 100 + .../CSharp/v201403/TeamService/CreateTeams.cs | 88 + .../CSharp/v201403/TeamService/GetAllTeams.cs | 89 + .../TeamService/GetTeamsByStatement.cs | 92 + .../CSharp/v201403/TeamService/UpdateTeams.cs | 107 + .../CSharp/v201403/UserService/CreateUsers.cs | 100 + .../v201403/UserService/DeactivateUser.cs | 121 + .../CSharp/v201403/UserService/GetAllRoles.cs | 77 + .../CSharp/v201403/UserService/GetAllUsers.cs | 88 + .../v201403/UserService/GetCurrentUser.cs | 71 + .../UserService/GetUsersByStatement.cs | 90 + .../CSharp/v201403/UserService/UpdateUsers.cs | 96 + .../CreateUserTeamAssociations.cs | 98 + .../DeleteUserTeamAssociations.cs | 120 + .../GetAllUserTeamAssociations.cs | 93 + .../GetUserTeamAssociationsByStatement.cs | 100 + .../UpdateUserTeamAssociations.cs | 109 + .../CreateActivityGroups.cs | 96 + .../GetActiveActivityGroups.cs | 91 + .../GetAllActivityGroups.cs | 91 + .../UpdateActivityGroups.cs | 98 + .../ActivityService/CreateActivities.cs | 93 + .../ActivityService/GetActiveActivities.cs | 93 + .../ActivityService/GetAllActivities.cs | 91 + .../ActivityService/UpdateActivities.cs | 91 + .../CreateAudienceSegments.cs | 121 + .../GetAllAudienceSegments.cs | 92 + .../GetFirstPartyAudienceSegments.cs | 94 + .../PopulateFirstPartyAudienceSegments.cs | 98 + .../UpdateAudienceSegments.cs | 98 + .../v201405/CompanyService/CreateCompanies.cs | 86 + .../v201405/CompanyService/GetAllCompanies.cs | 87 + .../CompanyService/GetCompaniesByStatement.cs | 91 + .../v201405/CompanyService/UpdateCompanies.cs | 91 + .../v201405/ContactService/CreateContacts.cs | 89 + .../v201405/ContactService/GetAllContacts.cs | 89 + .../ContactService/GetUninvitedContacts.cs | 92 + .../v201405/ContactService/UpdateContacts.cs | 91 + .../CreateContentMetadataKeyHierarchies.cs | 105 + .../DeleteContentMetadataKeyHierarchies.cs | 104 + .../GetAllContentMetadataKeyHierarchies.cs | 94 + .../UpdateContentMetadataKeyHierarchies.cs | 118 + .../v201405/ContentService/GetAllContent.cs | 90 + .../ContentService/GetContentByCategory.cs | 128 + .../CreativeService/CopyImageCreatives.cs | 111 + .../CreateCreativeFromTemplate.cs | 138 + .../CreativeService/CreateCreatives.cs | 120 + .../CreativeService/CreateCustomCreative.cs | 110 + .../CreativeService/GetAllCreatives.cs | 90 + .../GetCreativesByStatement.cs | 93 + .../CreativeService/UpdateCreatives.cs | 98 + .../GetAllCreativeTemplates.cs | 93 + .../GetCreativeTemplatesByStatement.cs | 93 + .../CreateCreativeWrappers.cs | 89 + .../DeactivateCreativeWrappers.cs | 111 + .../GetActiveCreativeWrappers.cs | 95 + .../GetAllCreativeWrappers.cs | 92 + .../UpdateCreativeWrappers.cs | 90 + .../CreateCustomFieldOptions.cs | 97 + .../CustomFieldService/CreateCustomFields.cs | 92 + .../DeactivateCustomFields.cs | 120 + .../CustomFieldService/GetAllCustomFields.cs | 107 + .../GetAllLineItemCustomFields.cs | 94 + .../SetLineItemCustomFieldValue.cs | 152 + .../CustomFieldService/UpdateCustomFields.cs | 96 + .../CreateCustomTargetingKeysAndValues.cs | 158 + .../GetAllCustomTargetingKeysAndValues.cs | 123 + .../GetCustomTargetingKeysByStatement.cs | 97 + .../GetCustomTargetingValuesByStatement.cs | 105 + .../UpdateCustomTargetingKeys.cs | 103 + .../UpdateCustomTargetingValues.cs | 104 + .../v201405/ForecastService/GetForecast.cs | 117 + .../ForecastService/GetForecastById.cs | 84 + .../v201405/InventoryService/CreateAdUnits.cs | 108 + .../InventoryService/CreateMobileAdUnit.cs | 102 + .../InventoryService/CreateVideoAdUnit.cs | 121 + .../InventoryService/DeActivateAdUnits.cs | 118 + .../InventoryService/GetAdUnitSizes.cs | 82 + .../InventoryService/GetAdUnitsByStatement.cs | 101 + .../v201405/InventoryService/GetAllAdUnits.cs | 89 + .../InventoryService/GetInventoryTree.cs | 206 + .../v201405/InventoryService/UpdateAdUnits.cs | 91 + .../v201405/LabelService/CreateLabels.cs | 93 + .../LabelService/DeactivateActiveLabels.cs | 115 + .../v201405/LabelService/GetAllLabels.cs | 94 + .../LabelService/GetLabelsByStatement.cs | 99 + .../v201405/LabelService/UpdateLabels.cs | 94 + .../ActivateLicas.cs | 122 + .../CreateLicas.cs | 104 + .../DeactivateLicas.cs | 122 + .../GetAllLicas.cs | 92 + .../GetLicasByStatement.cs | 96 + .../UpdateLicas.cs | 103 + .../LineItemService/ActivateLineItem.cs | 131 + .../LineItemService/CreateLineItems.cs | 218 + .../LineItemService/CreateVideoLineItem.cs | 189 + .../LineItemService/GetAllLineItems.cs | 92 + .../GetLineItemsByStatement.cs | 97 + .../GetRecentlyUpdatedLineItems.cs | 98 + .../LineItemService/TargetCustomCriteria.cs | 173 + .../LineItemService/UpdateLineItems.cs | 100 + .../v201405/NetworkService/GetAllNetworks.cs | 81 + .../NetworkService/GetCurrentNetwork.cs | 70 + .../v201405/NetworkService/MakeTestNetwork.cs | 85 + .../v201405/OrderService/ApproveOrder.cs | 119 + .../v201405/OrderService/CreateOrders.cs | 96 + .../v201405/OrderService/GetAllOrders.cs | 89 + .../OrderService/GetOrdersByStatement.cs | 96 + .../v201405/OrderService/UpdateOrders.cs | 96 + .../PlacementService/CreatePlacements.cs | 164 + .../PlacementService/DeactivatePlacement.cs | 117 + .../PlacementService/GetAllPlacements.cs | 91 + .../GetPlacementsByStatement.cs | 94 + .../PlacementService/UpdatePlacements.cs | 101 + .../FetchMatchTables.cs | 119 + .../GetAllLineItemsUsingPql.cs | 109 + .../GetGeoTargets.cs | 116 + .../GetLineItemsNamedLike.cs | 107 + .../v201405/ReportService/DisplayReport.cs | 87 + .../v201405/ReportService/DownloadReport.cs | 83 + .../ReportService/RunDeliveryReport.cs | 105 + .../ReportService/RunInventoryReport.cs | 116 + .../ReportService/RunMergedDeliveryReport.cs | 96 + .../v201405/ReportService/RunReachReport.cs | 94 + .../RunReportWithCustomFields.cs | 141 + .../v201405/ReportService/RunSalesReport.cs | 94 + .../ApproveSuggestedAdUnits.cs | 117 + .../GetAllSuggestedAdUnits.cs | 94 + .../GetSuggestedUnitByStatement.cs | 100 + .../CSharp/v201405/TeamService/CreateTeams.cs | 88 + .../CSharp/v201405/TeamService/GetAllTeams.cs | 89 + .../TeamService/GetTeamsByStatement.cs | 92 + .../CSharp/v201405/TeamService/UpdateTeams.cs | 107 + .../CSharp/v201405/UserService/CreateUsers.cs | 100 + .../v201405/UserService/DeactivateUser.cs | 121 + .../CSharp/v201405/UserService/GetAllRoles.cs | 77 + .../CSharp/v201405/UserService/GetAllUsers.cs | 88 + .../v201405/UserService/GetCurrentUser.cs | 71 + .../UserService/GetUsersByStatement.cs | 90 + .../CSharp/v201405/UserService/UpdateUsers.cs | 96 + .../CreateUserTeamAssociations.cs | 98 + .../DeleteUserTeamAssociations.cs | 120 + .../GetAllUserTeamAssociations.cs | 93 + .../GetUserTeamAssociationsByStatement.cs | 100 + .../UpdateUserTeamAssociations.cs | 109 + lib/NUnit/license.txt | 15 + lib/NUnit/nunit.framework.dll | Bin 0 -> 131072 bytes src/AdWords/AdWords.csproj | 112 + src/AdWords/AdWordsErrorMessages.Designer.cs | 180 + src/AdWords/AdWordsErrorMessages.resx | 172 + src/AdWords/App.config | 192 + src/AdWords/Headers/AdWordsSoapHeader.cs | 50 + src/AdWords/Headers/RequestHeader.cs | 183 + src/AdWords/Headers/RequestHeaderStub.cs | 104 + src/AdWords/Headers/ResponseHeader.cs | 133 + src/AdWords/Headers/ResponseHeaderStub.cs | 71 + src/AdWords/Lib/AdWordsApiException.cs | 120 + src/AdWords/Lib/AdWordsAppConfig.cs | 296 + src/AdWords/Lib/AdWordsAuthorizationMethod.cs | 32 + src/AdWords/Lib/AdWordsCallListener.cs | 133 + .../Lib/AdWordsCredentialsExpiredException.cs | 32 + src/AdWords/Lib/AdWordsErrorHandler.cs | 204 + src/AdWords/Lib/AdWordsException.cs | 65 + src/AdWords/Lib/AdWordsService.cs | 50 + src/AdWords/Lib/AdWordsServiceFactory.cs | 177 + src/AdWords/Lib/AdWordsServiceSignature.cs | 70 + src/AdWords/Lib/AdWordsSoapClient.cs | 159 + src/AdWords/Lib/AdWordsTraceListener.cs | 118 + src/AdWords/Lib/AdWordsUser.cs | 124 + src/AdWords/Lib/ApiCallEntry.cs | 75 + src/AdWords/Properties/AssemblyInfo.cs | 39 + src/AdWords/Properties/Properties.cs | 24 + src/AdWords/Util/ErrorUtilities.cs | 44 + src/AdWords/Util/Reports/ClientReport.cs | 70 + .../Util/Reports/ReportDownloadError.cs | 78 + src/AdWords/Util/Reports/ReportUtilities.cs | 436 + src/AdWords/Util/Reports/ReportsException.cs | 98 + src/AdWords/Util/v201309/MapUtilities.cs | 90 + src/AdWords/Util/v201402/MapUtilities.cs | 90 + src/AdWords/Util/v201406/MapUtilities.cs | 90 + src/AdWords/v201309/AdWordsApi.cs | 31152 ++++++++++++++++ src/AdWords/v201309/AdWordsServiceV201309.cs | 410 + src/AdWords/v201309/ReportDefinition.cs | 203 + src/AdWords/v201402/AdWordsApi.cs | 30426 +++++++++++++++ src/AdWords/v201402/AdWordsServiceV201402.cs | 418 + src/AdWords/v201402/ReportDefinition.cs | 203 + src/AdWords/v201406/AdWordsApi.cs | 25224 +++++++++++++ src/AdWords/v201406/AdWordsServiceV201406.cs | 384 + src/AdWords/v201406/ReportDefinition.cs | 203 + src/Common/AdsApi.snk | Bin 0 -> 596 bytes src/Common/Common.csproj | 112 + src/Common/CommonErrorMessages.Designer.cs | 243 + src/Common/CommonErrorMessages.resx | 199 + src/Common/Lib/AdsClient.cs | 182 + src/Common/Lib/AdsException.cs | 74 + src/Common/Lib/AdsOAuthException.cs | 65 + src/Common/Lib/AdsOAuthProvider.cs | 120 + .../Lib/AdsOAuthProviderForApplications.cs | 69 + .../Lib/AdsOAuthProviderForServiceAccounts.cs | 51 + src/Common/Lib/AdsService.cs | 33 + src/Common/Lib/AdsSoapClient.cs | 362 + src/Common/Lib/AdsUser.cs | 334 + src/Common/Lib/AppConfig.cs | 155 + src/Common/Lib/AppConfigBase.cs | 677 + src/Common/Lib/AuthToken.cs | 346 + src/Common/Lib/AuthTokenCache.cs | 86 + src/Common/Lib/AuthTokenErrorCode.cs | 81 + src/Common/Lib/AuthTokenException.cs | 253 + src/Common/Lib/Configurable.cs | 29 + src/Common/Lib/ContextStore.cs | 71 + src/Common/Lib/CredentialsExpiredException.cs | 91 + src/Common/Lib/DefaultAuthTokenCache.cs | 135 + src/Common/Lib/ErrorHandler.cs | 97 + src/Common/Lib/InMemoryTokenCache.cs | 102 + src/Common/Lib/OAuth2ProviderBase.cs | 398 + .../Lib/OAuth2ProviderForApplications.cs | 203 + .../Lib/OAuth2ProviderForServiceAccounts.cs | 158 + src/Common/Lib/ServiceFactory.cs | 75 + src/Common/Lib/ServiceSignature.cs | 113 + src/Common/Lib/SoapHeaderBase.cs | 144 + src/Common/Lib/SoapListener.cs | 43 + src/Common/Lib/SoapListenerExtension.cs | 168 + .../Lib/SoapListenerExtensionAttribute.cs | 53 + src/Common/Lib/SoapMessageDirection.cs | 33 + src/Common/Lib/TraceListener.cs | 250 + src/Common/Properties/AssemblyInfo.cs | 37 + src/Common/Properties/Properties.cs | 23 + src/Common/Util/CsvException.cs | 64 + src/Common/Util/CsvFile.cs | 257 + src/Common/Util/DeprecationUtilities.cs | 53 + src/Common/Util/MediaUtilities.cs | 147 + src/Common/Util/PreconditionUtilities.cs | 20 + src/Common/Util/SerializationUtilities.cs | 167 + src/Common/Util/TraceUtilities.cs | 123 + src/Dfa/AdsApi.snk | Bin 0 -> 596 bytes src/Dfa/App.config | 189 + src/Dfa/Dfa.csproj | 114 + src/Dfa/DfaErrorMessages.Designer.cs | 99 + src/Dfa/DfaErrorMessages.resx | 136 + src/Dfa/Lib/DefaultLoginTokenCache.cs | 88 + src/Dfa/Lib/DfaApiException.cs | 115 + src/Dfa/Lib/DfaAppConfig.cs | 243 + src/Dfa/Lib/DfaAuthorizationMethod.cs | 32 + src/Dfa/Lib/DfaCredentialsExpiredException.cs | 33 + src/Dfa/Lib/DfaErrorHandler.cs | 121 + src/Dfa/Lib/DfaException.cs | 65 + src/Dfa/Lib/DfaService.cs | 47 + src/Dfa/Lib/DfaServiceFactory.cs | 155 + src/Dfa/Lib/DfaServiceSignature.cs | 82 + src/Dfa/Lib/DfaSoapClient.cs | 216 + src/Dfa/Lib/DfaTraceListener.cs | 90 + src/Dfa/Lib/DfaUser.cs | 66 + src/Dfa/Lib/LoginTokenCache.cs | 53 + src/Dfa/Lib/RequestHeader.cs | 60 + src/Dfa/Lib/ResponseHeader.cs | 58 + src/Dfa/Lib/SoapHeaderListener.cs | 223 + src/Dfa/Lib/UserToken.cs | 74 + src/Dfa/Properties/AssemblyInfo.cs | 37 + src/Dfa/Properties/Properties.cs | 24 + src/Dfa/Resources/ErrorCodes.csv | 1896 + src/Dfa/Util/ApiCodes/CodeCsvs.Designer.cs | 86 + src/Dfa/Util/ApiCodes/CodeCsvs.resx | 124 + src/Dfa/Util/ApiCodes/ErrorCode.cs | 115 + src/Dfa/Util/LoginUtil.cs | 104 + src/Dfa/v1_19/DfaApi.cs | 11267 ++++++ src/Dfa/v1_19/DfaServiceV1_19.cs | 191 + src/Dfa/v1_20/DfaApi.cs | 11423 ++++++ src/Dfa/v1_20/DfaServiceV1_20.cs | 191 + src/Dfp/App.config | 190 + src/Dfp/Dfp.csproj | 135 + src/Dfp/DfpErrorMessages.Designer.cs | 135 + src/Dfp/DfpErrorMessages.resx | 152 + src/Dfp/Headers/Authentication.cs | 46 + src/Dfp/Headers/ClientLogin.cs | 43 + src/Dfp/Headers/DfpSoapHeader.cs | 38 + src/Dfp/Headers/OAuth.cs | 43 + src/Dfp/Headers/RequestHeader.cs | 91 + src/Dfp/Headers/RequestHeaderStub.cs | 53 + src/Dfp/Headers/ResponseHeader.cs | 103 + src/Dfp/Headers/ResponseHeaderStub.cs | 44 + src/Dfp/Lib/DfpApiException.cs | 120 + src/Dfp/Lib/DfpAppConfig.cs | 200 + src/Dfp/Lib/DfpAuthorizationMethod.cs | 32 + src/Dfp/Lib/DfpException.cs | 65 + src/Dfp/Lib/DfpService.cs | 47 + src/Dfp/Lib/DfpServiceFactory.cs | 130 + src/Dfp/Lib/DfpServiceSignature.cs | 54 + src/Dfp/Lib/DfpSoapClient.cs | 152 + src/Dfp/Lib/DfpTraceListener.cs | 104 + src/Dfp/Lib/DfpUser.cs | 64 + src/Dfp/Properties/AssemblyInfo.cs | 38 + src/Dfp/Properties/Properties.cs | 24 + src/Dfp/Util/v201208/DateTimeUtilities.cs | 57 + src/Dfp/Util/v201208/PqlUtilities.cs | 187 + src/Dfp/Util/v201208/StatementBuilder.cs | 363 + src/Dfp/Util/v201211/DateTimeUtilities.cs | 57 + src/Dfp/Util/v201211/PqlUtilities.cs | 187 + src/Dfp/Util/v201211/StatementBuilder.cs | 363 + src/Dfp/Util/v201302/DateTimeUtilities.cs | 57 + src/Dfp/Util/v201302/PqlUtilities.cs | 187 + src/Dfp/Util/v201302/StatementBuilder.cs | 363 + src/Dfp/Util/v201306/DateTimeUtilities.cs | 57 + src/Dfp/Util/v201306/PqlUtilities.cs | 187 + src/Dfp/Util/v201306/StatementBuilder.cs | 375 + src/Dfp/Util/v201308/DateTimeUtilities.cs | 57 + src/Dfp/Util/v201308/PqlUtilities.cs | 214 + src/Dfp/Util/v201308/StatementBuilder.cs | 375 + src/Dfp/Util/v201311/DateTimeUtilities.cs | 57 + src/Dfp/Util/v201311/PqlUtilities.cs | 214 + src/Dfp/Util/v201311/StatementBuilder.cs | 375 + src/Dfp/Util/v201403/DateTimeUtilities.cs | 57 + src/Dfp/Util/v201403/PqlUtilities.cs | 214 + src/Dfp/Util/v201403/StatementBuilder.cs | 375 + src/Dfp/Util/v201405/DateTimeUtilities.cs | 57 + src/Dfp/Util/v201405/PqlUtilities.cs | 214 + src/Dfp/Util/v201405/StatementBuilder.cs | 375 + src/Dfp/v201208/DfpApi.cs | 16747 +++++++++ src/Dfp/v201208/DfpServiceV201208.cs | 212 + src/Dfp/v201211/DfpApi.cs | 17186 +++++++++ src/Dfp/v201211/DfpServiceV201211.cs | 220 + src/Dfp/v201302/DfpApi.cs | 19273 ++++++++++ src/Dfp/v201302/DfpServiceV201302.cs | 248 + src/Dfp/v201306/DfpApi.cs | 25427 +++++++++++++ src/Dfp/v201306/DfpServiceV201306.cs | 329 + src/Dfp/v201308/DfpApi.cs | 26043 +++++++++++++ src/Dfp/v201308/DfpServiceV201308.cs | 329 + src/Dfp/v201311/DfpApi.cs | 26871 +++++++++++++ src/Dfp/v201311/DfpServiceV201311.cs | 344 + src/Dfp/v201403/DfpApi.cs | 26775 +++++++++++++ src/Dfp/v201403/DfpServiceV201403.cs | 360 + src/Dfp/v201405/DfpApi.cs | 27857 ++++++++++++++ src/Dfp/v201405/DfpServiceV201405.cs | 360 + tests/AdWords/AdWords.Tests.csproj | 153 + tests/AdWords/AdWordsRequestInterceptor.cs | 90 + tests/AdWords/App.config | 192 + tests/AdWords/ExampleTestsBase.cs | 178 + tests/AdWords/ExamplesMockData.cs | 68 + tests/AdWords/Lib/AdWordsCallListenerTest.cs | 103 + .../AdWords/Lib/AdWordsServiceFactoryTests.cs | 112 + tests/AdWords/Properties/AssemblyInfo.cs | 37 + tests/AdWords/Properties/Properties.cs | 24 + .../Resources/GetAccountAlerts.v201309.txt | 12 + .../Resources/GetAccountAlerts.v201402.txt | 12 + .../Resources/GetAccountAlerts.v201406.txt | 12 + tests/AdWords/ServiceCreationTests.cs | 63 + .../AdWords/SoapMessages.v201309.Designer.cs | 75 + tests/AdWords/SoapMessages.v201309.resx | 124 + .../AdWords/SoapMessages.v201402.Designer.cs | 75 + tests/AdWords/SoapMessages.v201402.resx | 124 + .../AdWords/SoapMessages.v201406.Designer.cs | 75 + tests/AdWords/SoapMessages.v201406.resx | 124 + .../AdWords/Util/v201309/MapUtilitiesTest.cs | 129 + .../AdWords/Util/v201402/MapUtilitiesTest.cs | 129 + .../AdWords/Util/v201406/MapUtilitiesTest.cs | 129 + .../AdWords/v201309/AccountManagementTest.cs | 113 + .../AdWords/v201309/AdvancedOperationsTest.cs | 128 + tests/AdWords/v201309/BasicOperationsTest.cs | 371 + .../AdWords/v201309/CampaignManagementTest.cs | 233 + tests/AdWords/v201309/ErrorHandlingTest.cs | 108 + tests/AdWords/v201309/MiscellaneousTest.cs | 83 + tests/AdWords/v201309/OptimizationTest.cs | 130 + tests/AdWords/v201309/RemarketingTest.cs | 84 + tests/AdWords/v201309/ReportingTest.cs | 87 + tests/AdWords/v201309/TargetingTest.cs | 128 + tests/AdWords/v201309/TestUtils.cs | 541 + .../v201309/VersionedExampleTestsBase.cs | 35 + .../AdWords/v201402/AccountManagementTest.cs | 113 + .../AdWords/v201402/AdvancedOperationsTest.cs | 166 + tests/AdWords/v201402/BasicOperationsTest.cs | 371 + .../AdWords/v201402/CampaignManagementTest.cs | 229 + tests/AdWords/v201402/ErrorHandlingTest.cs | 88 + tests/AdWords/v201402/MiscellaneousTest.cs | 83 + tests/AdWords/v201402/OptimizationTest.cs | 130 + tests/AdWords/v201402/RemarketingTest.cs | 84 + tests/AdWords/v201402/ReportingTest.cs | 87 + .../AdWords/v201402/ShoppingCampaignsTest.cs | 147 + tests/AdWords/v201402/TargetingTest.cs | 128 + tests/AdWords/v201402/TestUtils.cs | 493 + .../v201402/VersionedExampleTestsBase.cs | 35 + .../AdWords/v201406/AccountManagementTest.cs | 113 + .../AdWords/v201406/AdvancedOperationsTest.cs | 166 + tests/AdWords/v201406/BasicOperationsTest.cs | 371 + .../AdWords/v201406/CampaignManagementTest.cs | 229 + tests/AdWords/v201406/ErrorHandlingTest.cs | 88 + tests/AdWords/v201406/MiscellaneousTest.cs | 83 + tests/AdWords/v201406/OptimizationTest.cs | 130 + tests/AdWords/v201406/RemarketingTest.cs | 84 + tests/AdWords/v201406/ReportingTest.cs | 87 + .../AdWords/v201406/ShoppingCampaignsTest.cs | 147 + tests/AdWords/v201406/TargetingTest.cs | 128 + tests/AdWords/v201406/TestUtils.cs | 493 + .../v201406/VersionedExampleTestsBase.cs | 35 + tests/AdXBuyer/AdWords.Tests.csproj | 127 + tests/AdXBuyer/AdWordsRequestInterceptor.cs | 90 + tests/AdXBuyer/App.config | 192 + tests/AdXBuyer/ExampleTestsBase.cs | 178 + tests/AdXBuyer/ExamplesMockData.cs | 68 + .../Lib/AdWordsServiceFactoryTests.cs | 112 + tests/AdXBuyer/Properties/AssemblyInfo.cs | 37 + tests/AdXBuyer/Properties/Properties.cs | 24 + .../AdXBuyer/Util/v201309/MapUtilitiesTest.cs | 129 + .../AdXBuyer/Util/v201402/MapUtilitiesTest.cs | 129 + .../AdXBuyer/Util/v201406/MapUtilitiesTest.cs | 129 + .../AdXBuyer/v201309/AccountManagementTest.cs | 56 + .../v201309/AdvancedOperationsTest.cs | 90 + tests/AdXBuyer/v201309/BasicOperationsTest.cs | 391 + .../v201309/CampaignManagementTest.cs | 108 + tests/AdXBuyer/v201309/ErrorHandlingTest.cs | 108 + tests/AdXBuyer/v201309/MiscellaneousTest.cs | 83 + tests/AdXBuyer/v201309/OptimizationTest.cs | 68 + tests/AdXBuyer/v201309/RemarketingTest.cs | 84 + tests/AdXBuyer/v201309/ReportingTest.cs | 107 + tests/AdXBuyer/v201309/TargetingTest.cs | 129 + tests/AdXBuyer/v201309/TestUtils.cs | 541 + .../v201309/VersionedExampleTestsBase.cs | 35 + .../AdXBuyer/v201402/AccountManagementTest.cs | 56 + .../v201402/AdvancedOperationsTest.cs | 90 + tests/AdXBuyer/v201402/BasicOperationsTest.cs | 391 + .../v201402/CampaignManagementTest.cs | 108 + tests/AdXBuyer/v201402/ErrorHandlingTest.cs | 88 + tests/AdXBuyer/v201402/MiscellaneousTest.cs | 83 + tests/AdXBuyer/v201402/OptimizationTest.cs | 68 + tests/AdXBuyer/v201402/RemarketingTest.cs | 84 + tests/AdXBuyer/v201402/ReportingTest.cs | 107 + tests/AdXBuyer/v201402/TargetingTest.cs | 129 + tests/AdXBuyer/v201402/TestUtils.cs | 493 + .../v201402/VersionedExampleTestsBase.cs | 35 + .../AdXBuyer/v201406/AccountManagementTest.cs | 56 + .../v201406/AdvancedOperationsTest.cs | 90 + tests/AdXBuyer/v201406/BasicOperationsTest.cs | 391 + .../v201406/CampaignManagementTest.cs | 108 + tests/AdXBuyer/v201406/ErrorHandlingTest.cs | 88 + tests/AdXBuyer/v201406/MiscellaneousTest.cs | 83 + tests/AdXBuyer/v201406/OptimizationTest.cs | 68 + tests/AdXBuyer/v201406/RemarketingTest.cs | 84 + tests/AdXBuyer/v201406/ReportingTest.cs | 107 + tests/AdXBuyer/v201406/TargetingTest.cs | 129 + tests/AdXBuyer/v201406/TestUtils.cs | 493 + .../v201406/VersionedExampleTestsBase.cs | 35 + tests/Common/ClientLoginRequestInterceptor.cs | 92 + tests/Common/Common.Tests.csproj | 105 + tests/Common/HttpMessage.cs | 76 + tests/Common/Lib/AdsExceptionTests.cs | 93 + tests/Common/Lib/AdsOAuthExceptionTests.cs | 91 + tests/Common/Lib/AppConfigBaseTests.cs | 154 + tests/Common/Lib/AuthTokenTest.cs | 175 + .../Common/Lib/DefaultAuthTokenCacheTests.cs | 116 + .../Lib/OAuth2ProviderForApplicationsTests.cs | 317 + .../OAuth2ProviderForServiceAccountsTests.cs | 202 + tests/Common/Lib/ServiceFactoryTests.cs | 45 + tests/Common/Lib/ServiceSignatureTests.cs | 58 + tests/Common/Lib/TraceListenerTests.cs | 157 + tests/Common/MockWebRequest.cs | 299 + tests/Common/MockWebResponse.cs | 119 + tests/Common/Mocks/MockAdsClient.cs | 224 + tests/Common/Mocks/MockAdsException.cs | 97 + tests/Common/Mocks/MockAdsUser.cs | 54 + tests/Common/Mocks/MockAppConfig.cs | 87 + tests/Common/Mocks/MockAuthTokenCache.cs | 102 + tests/Common/Mocks/MockServiceFactory.cs | 59 + tests/Common/Mocks/MockServiceSignature.cs | 47 + tests/Common/Mocks/MockTraceListener.cs | 62 + tests/Common/OAuth2RequestInterceptor.cs | 161 + tests/Common/Resources.Designer.cs | 132 + tests/Common/Resources.resx | 345 + tests/Common/Resources/certificate.p12 | Bin 0 -> 1668 bytes tests/Common/TestUtils.cs | 48 + tests/Common/Util/CsvFileTests.cs | 72 + tests/Common/Util/DeprecationUtilitiesTest.cs | 84 + tests/Common/Util/MediaUtilitiesTests.cs | 128 + tests/Common/WebRequestInterceptor.cs | 140 + tests/Dfa/App.config | 189 + tests/Dfa/BaseTests.cs | 48 + tests/Dfa/Dfa.Tests.csproj | 74 + tests/Dfa/Lib/DefaultLoginTokenCacheTests.cs | 112 + tests/Dfa/Lib/DfaErrorHandlerTests.cs | 132 + tests/Dfa/Properties/AssemblyInfo.cs | 37 + tests/Dfa/Properties/Properties.cs | 24 + tests/Dfp/App.config | 190 + tests/Dfp/BaseTests.cs | 47 + tests/Dfp/Dfp.Tests.csproj | 207 + tests/Dfp/DfpServiceFactoryTests.cs | 106 + tests/Dfp/Properties/AssemblyInfo.cs | 37 + tests/Dfp/Properties/Properties.cs | 24 + tests/Dfp/ServiceCreationTests.cs | 68 + tests/Dfp/v201208/CompanyServiceTests.cs | 192 + tests/Dfp/v201208/CreativeServiceTests.cs | 266 + tests/Dfp/v201208/ForecastServiceTests.cs | 171 + tests/Dfp/v201208/InventoryServiceTests.cs | 295 + ...LineItemCreativeAssociationServiceTests.cs | 303 + tests/Dfp/v201208/LineItemServiceTests.cs | 486 + tests/Dfp/v201208/OrderServiceTests.cs | 229 + tests/Dfp/v201208/PlacementServiceTests.cs | 242 + tests/Dfp/v201208/ReportServiceTests.cs | 160 + tests/Dfp/v201208/StatementBuilderTests.cs | 275 + tests/Dfp/v201208/TestUtils.cs | 343 + tests/Dfp/v201208/UserServiceTests.cs | 217 + tests/Dfp/v201211/CompanyServiceTests.cs | 192 + tests/Dfp/v201211/CreativeServiceTests.cs | 266 + tests/Dfp/v201211/ForecastServiceTests.cs | 171 + tests/Dfp/v201211/InventoryServiceTests.cs | 295 + ...LineItemCreativeAssociationServiceTests.cs | 303 + tests/Dfp/v201211/LineItemServiceTests.cs | 486 + tests/Dfp/v201211/OrderServiceTests.cs | 229 + tests/Dfp/v201211/PlacementServiceTests.cs | 242 + tests/Dfp/v201211/ReportServiceTests.cs | 160 + tests/Dfp/v201211/StatementBuilderTests.cs | 275 + tests/Dfp/v201211/TestUtils.cs | 343 + tests/Dfp/v201211/UserServiceTests.cs | 217 + tests/Dfp/v201302/CompanyServiceTests.cs | 192 + tests/Dfp/v201302/CreativeServiceTests.cs | 270 + tests/Dfp/v201302/ForecastServiceTests.cs | 171 + tests/Dfp/v201302/InventoryServiceTests.cs | 295 + ...LineItemCreativeAssociationServiceTests.cs | 303 + tests/Dfp/v201302/LineItemServiceTests.cs | 486 + tests/Dfp/v201302/OrderServiceTests.cs | 229 + tests/Dfp/v201302/PlacementServiceTests.cs | 242 + tests/Dfp/v201302/ReportServiceTests.cs | 161 + tests/Dfp/v201302/StatementBuilderTests.cs | 275 + tests/Dfp/v201302/TestUtils.cs | 350 + tests/Dfp/v201302/UserServiceTests.cs | 217 + tests/Dfp/v201306/CompanyServiceTests.cs | 192 + tests/Dfp/v201306/CreativeServiceTests.cs | 270 + tests/Dfp/v201306/ForecastServiceTests.cs | 171 + tests/Dfp/v201306/InventoryServiceTests.cs | 295 + ...LineItemCreativeAssociationServiceTests.cs | 303 + tests/Dfp/v201306/LineItemServiceTests.cs | 486 + tests/Dfp/v201306/OrderServiceTests.cs | 229 + tests/Dfp/v201306/PlacementServiceTests.cs | 242 + tests/Dfp/v201306/ReportServiceTests.cs | 161 + tests/Dfp/v201306/StatementBuilderTests.cs | 282 + tests/Dfp/v201306/TestUtils.cs | 350 + tests/Dfp/v201306/UserServiceTests.cs | 217 + tests/Dfp/v201308/CompanyServiceTests.cs | 192 + tests/Dfp/v201308/CreativeServiceTests.cs | 270 + tests/Dfp/v201308/ForecastServiceTests.cs | 171 + tests/Dfp/v201308/InventoryServiceTests.cs | 295 + ...LineItemCreativeAssociationServiceTests.cs | 303 + tests/Dfp/v201308/LineItemServiceTests.cs | 486 + tests/Dfp/v201308/OrderServiceTests.cs | 229 + tests/Dfp/v201308/PlacementServiceTests.cs | 242 + tests/Dfp/v201308/ReportServiceTests.cs | 161 + tests/Dfp/v201308/StatementBuilderTests.cs | 282 + tests/Dfp/v201308/TestUtils.cs | 350 + tests/Dfp/v201308/UserServiceTests.cs | 217 + tests/Dfp/v201311/CompanyServiceTests.cs | 192 + tests/Dfp/v201311/CreativeServiceTests.cs | 270 + tests/Dfp/v201311/ForecastServiceTests.cs | 171 + tests/Dfp/v201311/InventoryServiceTests.cs | 295 + ...LineItemCreativeAssociationServiceTests.cs | 303 + tests/Dfp/v201311/LineItemServiceTests.cs | 486 + tests/Dfp/v201311/OrderServiceTests.cs | 229 + tests/Dfp/v201311/PlacementServiceTests.cs | 242 + tests/Dfp/v201311/ReportServiceTests.cs | 161 + tests/Dfp/v201311/StatementBuilderTests.cs | 299 + tests/Dfp/v201311/TestUtils.cs | 350 + tests/Dfp/v201311/UserServiceTests.cs | 217 + tests/Dfp/v201403/CompanyServiceTests.cs | 139 + tests/Dfp/v201403/CreativeServiceTests.cs | 190 + tests/Dfp/v201403/ForecastServiceTests.cs | 171 + tests/Dfp/v201403/InventoryServiceTests.cs | 227 + ...LineItemCreativeAssociationServiceTests.cs | 249 + tests/Dfp/v201403/LineItemServiceTests.cs | 318 + tests/Dfp/v201403/OrderServiceTests.cs | 172 + tests/Dfp/v201403/PlacementServiceTests.cs | 180 + tests/Dfp/v201403/ReportServiceTests.cs | 161 + tests/Dfp/v201403/StatementBuilderTests.cs | 299 + tests/Dfp/v201403/TestUtils.cs | 351 + tests/Dfp/v201403/UserServiceTests.cs | 185 + tests/Dfp/v201405/CompanyServiceTests.cs | 139 + tests/Dfp/v201405/CreativeServiceTests.cs | 190 + tests/Dfp/v201405/ForecastServiceTests.cs | 173 + tests/Dfp/v201405/InventoryServiceTests.cs | 227 + ...LineItemCreativeAssociationServiceTests.cs | 249 + tests/Dfp/v201405/LineItemServiceTests.cs | 320 + tests/Dfp/v201405/OrderServiceTests.cs | 172 + tests/Dfp/v201405/PlacementServiceTests.cs | 180 + tests/Dfp/v201405/ReportServiceTests.cs | 161 + tests/Dfp/v201405/StatementBuilderTests.cs | 299 + tests/Dfp/v201405/TestUtils.cs | 353 + tests/Dfp/v201405/UserServiceTests.cs | 185 + .../OAuthTokenGenerator/LoginForm.Designer.cs | 76 + utilities/OAuthTokenGenerator/LoginForm.cs | 160 + utilities/OAuthTokenGenerator/LoginForm.resx | 120 + .../OAuthTokenGenerator/MainForm.Designer.cs | 168 + utilities/OAuthTokenGenerator/MainForm.cs | 94 + utilities/OAuthTokenGenerator/MainForm.resx | 128 + .../OAuthTokenGenerator.csproj | 99 + utilities/OAuthTokenGenerator/Program.cs | 38 + .../Properties/AssemblyInfo.cs | 38 + .../Properties/Properties.cs | 23 + 2405 files changed, 588066 insertions(+), 36 deletions(-) create mode 100644 AdWords.sln create mode 100644 AdXBuyer.sln create mode 100644 ChangeLog create mode 100644 Dfa.sln create mode 100644 Dfp.sln create mode 100644 LICENSE create mode 100644 examples/AdWords/CSharp/AdWords.Examples.CSharp.csproj create mode 100644 examples/AdWords/CSharp/App.config create mode 100644 examples/AdWords/CSharp/ExampleBase.cs create mode 100644 examples/AdWords/CSharp/ExampleUtilities.cs create mode 100644 examples/AdWords/CSharp/OAuth/AdWords.Examples.CSharp.OAuth.csproj create mode 100644 examples/AdWords/CSharp/OAuth/ConsoleExample.cs create mode 100644 examples/AdWords/CSharp/OAuth/Default.aspx create mode 100644 examples/AdWords/CSharp/OAuth/Default.aspx.cs create mode 100644 examples/AdWords/CSharp/OAuth/Default.aspx.designer.cs create mode 100644 examples/AdWords/CSharp/OAuth/OAuthLogin.aspx create mode 100644 examples/AdWords/CSharp/OAuth/OAuthLogin.aspx.cs create mode 100644 examples/AdWords/CSharp/OAuth/OAuthLogin.aspx.designer.cs create mode 100644 examples/AdWords/CSharp/OAuth/Properties/AssemblyInfo.cs create mode 100644 examples/AdWords/CSharp/OAuth/Properties/Properties.cs create mode 100644 examples/AdWords/CSharp/OAuth/Web.config create mode 100644 examples/AdWords/CSharp/OAuth/css/main.css create mode 100644 examples/AdWords/CSharp/Program.cs create mode 100644 examples/AdWords/CSharp/Properties/AssemblyInfo.cs create mode 100644 examples/AdWords/CSharp/Properties/Properties.cs create mode 100644 examples/AdWords/CSharp/v201309/AccountManagement/CreateAccount.cs create mode 100644 examples/AdWords/CSharp/v201309/AccountManagement/GetAccountAlerts.cs create mode 100644 examples/AdWords/CSharp/v201309/AccountManagement/GetAccountChanges.cs create mode 100644 examples/AdWords/CSharp/v201309/AccountManagement/GetAccountHierarchy.cs create mode 100644 examples/AdWords/CSharp/v201309/AdWordsForVideo/AddTargetingGroup.cs create mode 100644 examples/AdWords/CSharp/v201309/AdWordsForVideo/AddTargetingGroupCriteria.cs create mode 100644 examples/AdWords/CSharp/v201309/AdWordsForVideo/AddVideoAd.cs create mode 100644 examples/AdWords/CSharp/v201309/AdWordsForVideo/AddVideoCallToAction.cs create mode 100644 examples/AdWords/CSharp/v201309/AdWordsForVideo/AddVideoCampaign.cs create mode 100644 examples/AdWords/CSharp/v201309/AdWordsForVideo/AddVideoCampaignCriteria.cs create mode 100644 examples/AdWords/CSharp/v201309/AdWordsForVideo/FindVideos.cs create mode 100644 examples/AdWords/CSharp/v201309/AdWordsForVideo/GetKeywordCriteria.cs create mode 100644 examples/AdWords/CSharp/v201309/AdWordsForVideo/GetTargetingGroups.cs create mode 100644 examples/AdWords/CSharp/v201309/AdWordsForVideo/GetVideoCampaignCriteria.cs create mode 100644 examples/AdWords/CSharp/v201309/AdWordsForVideo/GetVideoCampaignStats.cs create mode 100644 examples/AdWords/CSharp/v201309/AdWordsForVideo/GetVideoCampaigns.cs create mode 100644 examples/AdWords/CSharp/v201309/AdvancedOperations/AddAdGroupBidModifier.cs create mode 100644 examples/AdWords/CSharp/v201309/AdvancedOperations/AddClickToDownloadAd.cs create mode 100644 examples/AdWords/CSharp/v201309/AdvancedOperations/AddSiteLinks.cs create mode 100644 examples/AdWords/CSharp/v201309/AdvancedOperations/GetAdGroupBidModifiers.cs create mode 100644 examples/AdWords/CSharp/v201309/AdvancedOperations/UploadOfflineConversions.cs create mode 100644 examples/AdWords/CSharp/v201309/AdvancedOperations/UseSharedBiddingStrategy.cs create mode 100644 examples/AdWords/CSharp/v201309/BasicOperations/AddAdGroupDemographicCriteria.cs create mode 100644 examples/AdWords/CSharp/v201309/BasicOperations/AddAdGroups.cs create mode 100644 examples/AdWords/CSharp/v201309/BasicOperations/AddCampaigns.cs create mode 100644 examples/AdWords/CSharp/v201309/BasicOperations/AddKeywords.cs create mode 100644 examples/AdWords/CSharp/v201309/BasicOperations/AddTextAds.cs create mode 100644 examples/AdWords/CSharp/v201309/BasicOperations/DeleteAd.cs create mode 100644 examples/AdWords/CSharp/v201309/BasicOperations/DeleteAdGroup.cs create mode 100644 examples/AdWords/CSharp/v201309/BasicOperations/DeleteCampaign.cs create mode 100644 examples/AdWords/CSharp/v201309/BasicOperations/DeleteKeyword.cs create mode 100644 examples/AdWords/CSharp/v201309/BasicOperations/GetAdGroups.cs create mode 100644 examples/AdWords/CSharp/v201309/BasicOperations/GetCampaigns.cs create mode 100644 examples/AdWords/CSharp/v201309/BasicOperations/GetCampaignsWithAwql.cs create mode 100644 examples/AdWords/CSharp/v201309/BasicOperations/GetKeywords.cs create mode 100644 examples/AdWords/CSharp/v201309/BasicOperations/GetTextAds.cs create mode 100644 examples/AdWords/CSharp/v201309/BasicOperations/PauseAd.cs create mode 100644 examples/AdWords/CSharp/v201309/BasicOperations/UpdateAdGroup.cs create mode 100644 examples/AdWords/CSharp/v201309/BasicOperations/UpdateCampaign.cs create mode 100644 examples/AdWords/CSharp/v201309/BasicOperations/UpdateKeyword.cs create mode 100644 examples/AdWords/CSharp/v201309/CampaignManagement/AddExperiment.cs create mode 100644 examples/AdWords/CSharp/v201309/CampaignManagement/AddKeywordsInBulk.cs create mode 100644 examples/AdWords/CSharp/v201309/CampaignManagement/AddLocationExtension.cs create mode 100644 examples/AdWords/CSharp/v201309/CampaignManagement/GetAllDisapprovedAds.cs create mode 100644 examples/AdWords/CSharp/v201309/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs create mode 100644 examples/AdWords/CSharp/v201309/CampaignManagement/PromoteExperiment.cs create mode 100644 examples/AdWords/CSharp/v201309/CampaignManagement/SetAdParameters.cs create mode 100644 examples/AdWords/CSharp/v201309/CampaignManagement/SetBidModifier.cs create mode 100644 examples/AdWords/CSharp/v201309/CampaignManagement/ValidateTextAd.cs create mode 100644 examples/AdWords/CSharp/v201309/ErrorHandling/HandlePartialFailures.cs create mode 100644 examples/AdWords/CSharp/v201309/ErrorHandling/HandlePolicyViolationError.cs create mode 100644 examples/AdWords/CSharp/v201309/ErrorHandling/HandleRateExceededError.cs create mode 100644 examples/AdWords/CSharp/v201309/ErrorHandling/HandleTwoFactorAuthorizationError.cs create mode 100644 examples/AdWords/CSharp/v201309/Express/AddExpressBusinesses.cs create mode 100644 examples/AdWords/CSharp/v201309/Express/AddPromotion.cs create mode 100644 examples/AdWords/CSharp/v201309/Express/GetExpressBusinesses.cs create mode 100644 examples/AdWords/CSharp/v201309/Express/GetProductServices.cs create mode 100644 examples/AdWords/CSharp/v201309/Express/GetPromotions.cs create mode 100644 examples/AdWords/CSharp/v201309/Express/UpdateExpressBusiness.cs create mode 100644 examples/AdWords/CSharp/v201309/Express/UpdatePromotion.cs create mode 100644 examples/AdWords/CSharp/v201309/Miscellaneous/GetAllVideosAndImages.cs create mode 100644 examples/AdWords/CSharp/v201309/Miscellaneous/UploadImage.cs create mode 100644 examples/AdWords/CSharp/v201309/Optimization/EstimateKeywordTraffic.cs create mode 100644 examples/AdWords/CSharp/v201309/Optimization/GetAdGroupBidSimulations.cs create mode 100644 examples/AdWords/CSharp/v201309/Optimization/GetKeywordBidSimulations.cs create mode 100644 examples/AdWords/CSharp/v201309/Optimization/GetKeywordIdeas.cs create mode 100644 examples/AdWords/CSharp/v201309/Optimization/GetPlacementIdeas.cs create mode 100644 examples/AdWords/CSharp/v201309/Remarketing/AddAudience.cs create mode 100644 examples/AdWords/CSharp/v201309/Remarketing/AddConversionTracker.cs create mode 100644 examples/AdWords/CSharp/v201309/Reporting/DownloadCriteriaReport.cs create mode 100644 examples/AdWords/CSharp/v201309/Reporting/DownloadCriteriaReportWithAwql.cs create mode 100644 examples/AdWords/CSharp/v201309/Reporting/GetReportFields.cs create mode 100644 examples/AdWords/CSharp/v201309/Targeting/AddCampaignTargetingCriteria.cs create mode 100644 examples/AdWords/CSharp/v201309/Targeting/GetCampaignTargetingCriteria.cs create mode 100644 examples/AdWords/CSharp/v201309/Targeting/GetTargetableLanguagesAndCarriers.cs create mode 100644 examples/AdWords/CSharp/v201309/Targeting/LookupLocation.cs create mode 100644 examples/AdWords/CSharp/v201402/AccountManagement/CreateAccount.cs create mode 100644 examples/AdWords/CSharp/v201402/AccountManagement/GetAccountAlerts.cs create mode 100644 examples/AdWords/CSharp/v201402/AccountManagement/GetAccountChanges.cs create mode 100644 examples/AdWords/CSharp/v201402/AccountManagement/GetAccountHierarchy.cs create mode 100644 examples/AdWords/CSharp/v201402/AdWordsForVideo/AddTargetingGroup.cs create mode 100644 examples/AdWords/CSharp/v201402/AdWordsForVideo/AddTargetingGroupCriteria.cs create mode 100644 examples/AdWords/CSharp/v201402/AdWordsForVideo/AddVideoAd.cs create mode 100644 examples/AdWords/CSharp/v201402/AdWordsForVideo/AddVideoCallToAction.cs create mode 100644 examples/AdWords/CSharp/v201402/AdWordsForVideo/AddVideoCampaign.cs create mode 100644 examples/AdWords/CSharp/v201402/AdWordsForVideo/AddVideoCampaignCriteria.cs create mode 100644 examples/AdWords/CSharp/v201402/AdWordsForVideo/FindVideos.cs create mode 100644 examples/AdWords/CSharp/v201402/AdWordsForVideo/GetKeywordCriteria.cs create mode 100644 examples/AdWords/CSharp/v201402/AdWordsForVideo/GetTargetingGroups.cs create mode 100644 examples/AdWords/CSharp/v201402/AdWordsForVideo/GetVideoCampaignCriteria.cs create mode 100644 examples/AdWords/CSharp/v201402/AdWordsForVideo/GetVideoCampaignStats.cs create mode 100644 examples/AdWords/CSharp/v201402/AdWordsForVideo/GetVideoCampaigns.cs create mode 100644 examples/AdWords/CSharp/v201402/AdvancedOperations/AddAdGroupBidModifier.cs create mode 100644 examples/AdWords/CSharp/v201402/AdvancedOperations/AddClickToDownloadAd.cs create mode 100644 examples/AdWords/CSharp/v201402/AdvancedOperations/AddPlacesLocationExtension.cs create mode 100644 examples/AdWords/CSharp/v201402/AdvancedOperations/AddSiteLinks.cs create mode 100644 examples/AdWords/CSharp/v201402/AdvancedOperations/GetAdGroupBidModifiers.cs create mode 100644 examples/AdWords/CSharp/v201402/AdvancedOperations/UploadOfflineConversions.cs create mode 100644 examples/AdWords/CSharp/v201402/AdvancedOperations/UseSharedBiddingStrategy.cs create mode 100644 examples/AdWords/CSharp/v201402/BasicOperations/AddAdGroupDemographicCriteria.cs create mode 100644 examples/AdWords/CSharp/v201402/BasicOperations/AddAdGroups.cs create mode 100644 examples/AdWords/CSharp/v201402/BasicOperations/AddCampaigns.cs create mode 100644 examples/AdWords/CSharp/v201402/BasicOperations/AddKeywords.cs create mode 100644 examples/AdWords/CSharp/v201402/BasicOperations/AddTextAds.cs create mode 100644 examples/AdWords/CSharp/v201402/BasicOperations/DeleteAd.cs create mode 100644 examples/AdWords/CSharp/v201402/BasicOperations/DeleteAdGroup.cs create mode 100644 examples/AdWords/CSharp/v201402/BasicOperations/DeleteCampaign.cs create mode 100644 examples/AdWords/CSharp/v201402/BasicOperations/DeleteKeyword.cs create mode 100644 examples/AdWords/CSharp/v201402/BasicOperations/GetAdGroups.cs create mode 100644 examples/AdWords/CSharp/v201402/BasicOperations/GetCampaigns.cs create mode 100644 examples/AdWords/CSharp/v201402/BasicOperations/GetCampaignsWithAwql.cs create mode 100644 examples/AdWords/CSharp/v201402/BasicOperations/GetKeywords.cs create mode 100644 examples/AdWords/CSharp/v201402/BasicOperations/GetTextAds.cs create mode 100644 examples/AdWords/CSharp/v201402/BasicOperations/PauseAd.cs create mode 100644 examples/AdWords/CSharp/v201402/BasicOperations/UpdateAdGroup.cs create mode 100644 examples/AdWords/CSharp/v201402/BasicOperations/UpdateCampaign.cs create mode 100644 examples/AdWords/CSharp/v201402/BasicOperations/UpdateKeyword.cs create mode 100644 examples/AdWords/CSharp/v201402/CampaignManagement/AddExperiment.cs create mode 100644 examples/AdWords/CSharp/v201402/CampaignManagement/AddKeywordsInBulk.cs create mode 100644 examples/AdWords/CSharp/v201402/CampaignManagement/AddLocationExtension.cs create mode 100644 examples/AdWords/CSharp/v201402/CampaignManagement/GetAllDisapprovedAds.cs create mode 100644 examples/AdWords/CSharp/v201402/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs create mode 100644 examples/AdWords/CSharp/v201402/CampaignManagement/PromoteExperiment.cs create mode 100644 examples/AdWords/CSharp/v201402/CampaignManagement/SetAdParameters.cs create mode 100644 examples/AdWords/CSharp/v201402/CampaignManagement/SetBidModifier.cs create mode 100644 examples/AdWords/CSharp/v201402/CampaignManagement/ValidateTextAd.cs create mode 100644 examples/AdWords/CSharp/v201402/ErrorHandling/HandlePartialFailures.cs create mode 100644 examples/AdWords/CSharp/v201402/ErrorHandling/HandlePolicyViolationError.cs create mode 100644 examples/AdWords/CSharp/v201402/ErrorHandling/HandleRateExceededError.cs create mode 100644 examples/AdWords/CSharp/v201402/Express/AddExpressBusinesses.cs create mode 100644 examples/AdWords/CSharp/v201402/Express/AddPromotion.cs create mode 100644 examples/AdWords/CSharp/v201402/Express/GetExpressBusinesses.cs create mode 100644 examples/AdWords/CSharp/v201402/Express/GetProductServices.cs create mode 100644 examples/AdWords/CSharp/v201402/Express/GetPromotions.cs create mode 100644 examples/AdWords/CSharp/v201402/Express/UpdateExpressBusiness.cs create mode 100644 examples/AdWords/CSharp/v201402/Express/UpdatePromotion.cs create mode 100644 examples/AdWords/CSharp/v201402/Miscellaneous/GetAllVideosAndImages.cs create mode 100644 examples/AdWords/CSharp/v201402/Miscellaneous/UploadImage.cs create mode 100644 examples/AdWords/CSharp/v201402/Optimization/EstimateKeywordTraffic.cs create mode 100644 examples/AdWords/CSharp/v201402/Optimization/GetAdGroupBidSimulations.cs create mode 100644 examples/AdWords/CSharp/v201402/Optimization/GetKeywordBidSimulations.cs create mode 100644 examples/AdWords/CSharp/v201402/Optimization/GetKeywordIdeas.cs create mode 100644 examples/AdWords/CSharp/v201402/Optimization/GetPlacementIdeas.cs create mode 100644 examples/AdWords/CSharp/v201402/Remarketing/AddAudience.cs create mode 100644 examples/AdWords/CSharp/v201402/Remarketing/AddConversionTracker.cs create mode 100644 examples/AdWords/CSharp/v201402/Reporting/DownloadCriteriaReport.cs create mode 100644 examples/AdWords/CSharp/v201402/Reporting/DownloadCriteriaReportWithAwql.cs create mode 100644 examples/AdWords/CSharp/v201402/Reporting/GetReportFields.cs create mode 100644 examples/AdWords/CSharp/v201402/ShoppingCampaigns/AddProductPartitionTree.cs create mode 100644 examples/AdWords/CSharp/v201402/ShoppingCampaigns/AddProductScope.cs create mode 100644 examples/AdWords/CSharp/v201402/ShoppingCampaigns/AddShoppingCampaign.cs create mode 100644 examples/AdWords/CSharp/v201402/ShoppingCampaigns/GetProductCategoryTaxonomy.cs create mode 100644 examples/AdWords/CSharp/v201402/ShoppingCampaigns/SetProductSalesChannel.cs create mode 100644 examples/AdWords/CSharp/v201402/Targeting/AddCampaignTargetingCriteria.cs create mode 100644 examples/AdWords/CSharp/v201402/Targeting/GetCampaignTargetingCriteria.cs create mode 100644 examples/AdWords/CSharp/v201402/Targeting/GetTargetableLanguagesAndCarriers.cs create mode 100644 examples/AdWords/CSharp/v201402/Targeting/LookupLocation.cs create mode 100644 examples/AdWords/CSharp/v201406/AccountManagement/CreateAccount.cs create mode 100644 examples/AdWords/CSharp/v201406/AccountManagement/GetAccountAlerts.cs create mode 100644 examples/AdWords/CSharp/v201406/AccountManagement/GetAccountChanges.cs create mode 100644 examples/AdWords/CSharp/v201406/AccountManagement/GetAccountHierarchy.cs create mode 100644 examples/AdWords/CSharp/v201406/AdWordsForVideo/AddTargetingGroup.cs create mode 100644 examples/AdWords/CSharp/v201406/AdWordsForVideo/AddTargetingGroupCriteria.cs create mode 100644 examples/AdWords/CSharp/v201406/AdWordsForVideo/AddVideoAd.cs create mode 100644 examples/AdWords/CSharp/v201406/AdWordsForVideo/AddVideoCallToAction.cs create mode 100644 examples/AdWords/CSharp/v201406/AdWordsForVideo/AddVideoCampaign.cs create mode 100644 examples/AdWords/CSharp/v201406/AdWordsForVideo/AddVideoCampaignCriteria.cs create mode 100644 examples/AdWords/CSharp/v201406/AdWordsForVideo/FindVideos.cs create mode 100644 examples/AdWords/CSharp/v201406/AdWordsForVideo/GetKeywordCriteria.cs create mode 100644 examples/AdWords/CSharp/v201406/AdWordsForVideo/GetTargetingGroups.cs create mode 100644 examples/AdWords/CSharp/v201406/AdWordsForVideo/GetVideoCampaignCriteria.cs create mode 100644 examples/AdWords/CSharp/v201406/AdWordsForVideo/GetVideoCampaignStats.cs create mode 100644 examples/AdWords/CSharp/v201406/AdWordsForVideo/GetVideoCampaigns.cs create mode 100644 examples/AdWords/CSharp/v201406/AdvancedOperations/AddAdGroupBidModifier.cs create mode 100644 examples/AdWords/CSharp/v201406/AdvancedOperations/AddClickToDownloadAd.cs create mode 100644 examples/AdWords/CSharp/v201406/AdvancedOperations/AddPlacesLocationExtension.cs create mode 100644 examples/AdWords/CSharp/v201406/AdvancedOperations/AddSiteLinks.cs create mode 100644 examples/AdWords/CSharp/v201406/AdvancedOperations/AddTextAdWithUpgradedUrls.cs create mode 100644 examples/AdWords/CSharp/v201406/AdvancedOperations/GetAdGroupBidModifiers.cs create mode 100644 examples/AdWords/CSharp/v201406/AdvancedOperations/UploadOfflineConversions.cs create mode 100644 examples/AdWords/CSharp/v201406/AdvancedOperations/UseSharedBiddingStrategy.cs create mode 100644 examples/AdWords/CSharp/v201406/BasicOperations/AddAdGroupDemographicCriteria.cs create mode 100644 examples/AdWords/CSharp/v201406/BasicOperations/AddAdGroups.cs create mode 100644 examples/AdWords/CSharp/v201406/BasicOperations/AddCampaigns.cs create mode 100644 examples/AdWords/CSharp/v201406/BasicOperations/AddKeywords.cs create mode 100644 examples/AdWords/CSharp/v201406/BasicOperations/AddTextAds.cs create mode 100644 examples/AdWords/CSharp/v201406/BasicOperations/GetAdGroups.cs create mode 100644 examples/AdWords/CSharp/v201406/BasicOperations/GetCampaigns.cs create mode 100644 examples/AdWords/CSharp/v201406/BasicOperations/GetCampaignsWithAwql.cs create mode 100644 examples/AdWords/CSharp/v201406/BasicOperations/GetKeywords.cs create mode 100644 examples/AdWords/CSharp/v201406/BasicOperations/GetTextAds.cs create mode 100644 examples/AdWords/CSharp/v201406/BasicOperations/PauseAd.cs create mode 100644 examples/AdWords/CSharp/v201406/BasicOperations/RemoveAd.cs create mode 100644 examples/AdWords/CSharp/v201406/BasicOperations/RemoveAdGroup.cs create mode 100644 examples/AdWords/CSharp/v201406/BasicOperations/RemoveCampaign.cs create mode 100644 examples/AdWords/CSharp/v201406/BasicOperations/RemoveKeyword.cs create mode 100644 examples/AdWords/CSharp/v201406/BasicOperations/UpdateAdGroup.cs create mode 100644 examples/AdWords/CSharp/v201406/BasicOperations/UpdateCampaign.cs create mode 100644 examples/AdWords/CSharp/v201406/BasicOperations/UpdateKeyword.cs create mode 100644 examples/AdWords/CSharp/v201406/CampaignManagement/AddCampaignLabels.cs create mode 100644 examples/AdWords/CSharp/v201406/CampaignManagement/AddExperiment.cs create mode 100644 examples/AdWords/CSharp/v201406/CampaignManagement/AddKeywordsInBulk.cs create mode 100644 examples/AdWords/CSharp/v201406/CampaignManagement/AddLocationExtension.cs create mode 100644 examples/AdWords/CSharp/v201406/CampaignManagement/GetAllDisapprovedAds.cs create mode 100644 examples/AdWords/CSharp/v201406/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs create mode 100644 examples/AdWords/CSharp/v201406/CampaignManagement/GetCampaignsByLabel.cs create mode 100644 examples/AdWords/CSharp/v201406/CampaignManagement/PromoteExperiment.cs create mode 100644 examples/AdWords/CSharp/v201406/CampaignManagement/SetAdParameters.cs create mode 100644 examples/AdWords/CSharp/v201406/CampaignManagement/SetBidModifier.cs create mode 100644 examples/AdWords/CSharp/v201406/CampaignManagement/ValidateTextAd.cs create mode 100644 examples/AdWords/CSharp/v201406/ErrorHandling/HandlePartialFailures.cs create mode 100644 examples/AdWords/CSharp/v201406/ErrorHandling/HandlePolicyViolationError.cs create mode 100644 examples/AdWords/CSharp/v201406/ErrorHandling/HandleRateExceededError.cs create mode 100644 examples/AdWords/CSharp/v201406/Express/AddExpressBusinesses.cs create mode 100644 examples/AdWords/CSharp/v201406/Express/AddPromotion.cs create mode 100644 examples/AdWords/CSharp/v201406/Express/GetBudgetSuggestion.cs create mode 100644 examples/AdWords/CSharp/v201406/Express/GetExpressBusinesses.cs create mode 100644 examples/AdWords/CSharp/v201406/Express/GetProductServices.cs create mode 100644 examples/AdWords/CSharp/v201406/Express/GetPromotions.cs create mode 100644 examples/AdWords/CSharp/v201406/Express/UpdateExpressBusiness.cs create mode 100644 examples/AdWords/CSharp/v201406/Express/UpdatePromotion.cs create mode 100644 examples/AdWords/CSharp/v201406/Miscellaneous/GetAllVideosAndImages.cs create mode 100644 examples/AdWords/CSharp/v201406/Miscellaneous/UploadImage.cs create mode 100644 examples/AdWords/CSharp/v201406/Optimization/EstimateKeywordTraffic.cs create mode 100644 examples/AdWords/CSharp/v201406/Optimization/GetAdGroupBidSimulations.cs create mode 100644 examples/AdWords/CSharp/v201406/Optimization/GetKeywordBidSimulations.cs create mode 100644 examples/AdWords/CSharp/v201406/Optimization/GetKeywordIdeas.cs create mode 100644 examples/AdWords/CSharp/v201406/Optimization/GetPlacementIdeas.cs create mode 100644 examples/AdWords/CSharp/v201406/Remarketing/AddAudience.cs create mode 100644 examples/AdWords/CSharp/v201406/Remarketing/AddConversionTracker.cs create mode 100644 examples/AdWords/CSharp/v201406/Reporting/DownloadCriteriaReport.cs create mode 100644 examples/AdWords/CSharp/v201406/Reporting/DownloadCriteriaReportWithAwql.cs create mode 100644 examples/AdWords/CSharp/v201406/Reporting/GetReportFields.cs create mode 100644 examples/AdWords/CSharp/v201406/ShoppingCampaigns/AddProductPartitionTree.cs create mode 100644 examples/AdWords/CSharp/v201406/ShoppingCampaigns/AddProductScope.cs create mode 100644 examples/AdWords/CSharp/v201406/ShoppingCampaigns/AddShoppingCampaign.cs create mode 100644 examples/AdWords/CSharp/v201406/ShoppingCampaigns/GetProductCategoryTaxonomy.cs create mode 100644 examples/AdWords/CSharp/v201406/ShoppingCampaigns/SetProductSalesChannel.cs create mode 100644 examples/AdWords/CSharp/v201406/Targeting/AddCampaignTargetingCriteria.cs create mode 100644 examples/AdWords/CSharp/v201406/Targeting/GetCampaignTargetingCriteria.cs create mode 100644 examples/AdWords/CSharp/v201406/Targeting/GetTargetableLanguagesAndCarriers.cs create mode 100644 examples/AdWords/CSharp/v201406/Targeting/LookupLocation.cs create mode 100644 examples/AdWords/Vb/AdWords.Examples.VB.vbproj create mode 100644 examples/AdWords/Vb/App.config create mode 100644 examples/AdWords/Vb/ExampleBase.vb create mode 100644 examples/AdWords/Vb/ExampleUtilities.vb create mode 100644 examples/AdWords/Vb/Program.vb create mode 100644 examples/AdWords/Vb/Properties/AssemblyInfo.vb create mode 100644 examples/AdWords/Vb/v201309/AccountManagement/CreateAccount.vb create mode 100644 examples/AdWords/Vb/v201309/AccountManagement/GetAccountAlerts.vb create mode 100644 examples/AdWords/Vb/v201309/AccountManagement/GetAccountChanges.vb create mode 100644 examples/AdWords/Vb/v201309/AccountManagement/GetAccountHierarchy.vb create mode 100644 examples/AdWords/Vb/v201309/AdvancedOperations/AddAdGroupBidModifier.vb create mode 100644 examples/AdWords/Vb/v201309/AdvancedOperations/AddClickToDownloadAd.vb create mode 100644 examples/AdWords/Vb/v201309/AdvancedOperations/AddSiteLinks.vb create mode 100644 examples/AdWords/Vb/v201309/AdvancedOperations/GetAdGroupBidModifiers.vb create mode 100644 examples/AdWords/Vb/v201309/AdvancedOperations/UploadOfflineConversions.vb create mode 100644 examples/AdWords/Vb/v201309/AdvancedOperations/UseSharedBiddingStrategy.vb create mode 100644 examples/AdWords/Vb/v201309/BasicOperations/AddAdGroupDemographicCriteria.vb create mode 100644 examples/AdWords/Vb/v201309/BasicOperations/AddAdGroups.vb create mode 100644 examples/AdWords/Vb/v201309/BasicOperations/AddCampaigns.vb create mode 100644 examples/AdWords/Vb/v201309/BasicOperations/AddKeywords.vb create mode 100644 examples/AdWords/Vb/v201309/BasicOperations/AddTextAds.vb create mode 100644 examples/AdWords/Vb/v201309/BasicOperations/DeleteAd.vb create mode 100644 examples/AdWords/Vb/v201309/BasicOperations/DeleteAdGroup.vb create mode 100644 examples/AdWords/Vb/v201309/BasicOperations/DeleteCampaign.vb create mode 100644 examples/AdWords/Vb/v201309/BasicOperations/DeleteKeyword.vb create mode 100644 examples/AdWords/Vb/v201309/BasicOperations/GetAdGroups.vb create mode 100644 examples/AdWords/Vb/v201309/BasicOperations/GetCampaigns.vb create mode 100644 examples/AdWords/Vb/v201309/BasicOperations/GetCampaignsWithAwql.vb create mode 100644 examples/AdWords/Vb/v201309/BasicOperations/GetKeywords.vb create mode 100644 examples/AdWords/Vb/v201309/BasicOperations/GetTextAds.vb create mode 100644 examples/AdWords/Vb/v201309/BasicOperations/PauseAd.vb create mode 100644 examples/AdWords/Vb/v201309/BasicOperations/UpdateAdGroup.vb create mode 100644 examples/AdWords/Vb/v201309/BasicOperations/UpdateCampaign.vb create mode 100644 examples/AdWords/Vb/v201309/BasicOperations/UpdateKeyword.vb create mode 100644 examples/AdWords/Vb/v201309/CampaignManagement/AddExperiment.vb create mode 100644 examples/AdWords/Vb/v201309/CampaignManagement/AddKeywordsInBulk.vb create mode 100644 examples/AdWords/Vb/v201309/CampaignManagement/AddLocationExtension.vb create mode 100644 examples/AdWords/Vb/v201309/CampaignManagement/GetAllDisapprovedAds.vb create mode 100644 examples/AdWords/Vb/v201309/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb create mode 100644 examples/AdWords/Vb/v201309/CampaignManagement/PromoteExperiment.vb create mode 100644 examples/AdWords/Vb/v201309/CampaignManagement/SetAdParameters.vb create mode 100644 examples/AdWords/Vb/v201309/CampaignManagement/SetBidModifier.vb create mode 100644 examples/AdWords/Vb/v201309/CampaignManagement/ValidateTextAd.vb create mode 100644 examples/AdWords/Vb/v201309/ErrorHandling/HandlePartialFailures.vb create mode 100644 examples/AdWords/Vb/v201309/ErrorHandling/HandlePolicyViolationError.vb create mode 100644 examples/AdWords/Vb/v201309/ErrorHandling/HandleRateExceededError.vb create mode 100644 examples/AdWords/Vb/v201309/ErrorHandling/HandleTwoFactorAuthorizationError.vb create mode 100644 examples/AdWords/Vb/v201309/Miscellaneous/GetAllVideosAndImages.vb create mode 100644 examples/AdWords/Vb/v201309/Miscellaneous/UploadImage.vb create mode 100644 examples/AdWords/Vb/v201309/Optimization/EstimateKeywordTraffic.vb create mode 100644 examples/AdWords/Vb/v201309/Optimization/GetAdGroupBidSimulations.vb create mode 100644 examples/AdWords/Vb/v201309/Optimization/GetKeywordBidSimulations.vb create mode 100644 examples/AdWords/Vb/v201309/Optimization/GetKeywordIdeas.vb create mode 100644 examples/AdWords/Vb/v201309/Optimization/GetPlacementIdeas.vb create mode 100644 examples/AdWords/Vb/v201309/Remarketing/AddAudience.vb create mode 100644 examples/AdWords/Vb/v201309/Remarketing/AddConversionTracker.vb create mode 100644 examples/AdWords/Vb/v201309/Reporting/DownloadCriteriaReport.vb create mode 100644 examples/AdWords/Vb/v201309/Reporting/DownloadCriteriaReportWithAwql.vb create mode 100644 examples/AdWords/Vb/v201309/Reporting/GetReportFields.vb create mode 100644 examples/AdWords/Vb/v201309/Targeting/AddCampaignTargetingCriteria.vb create mode 100644 examples/AdWords/Vb/v201309/Targeting/GetCampaignTargetingCriteria.vb create mode 100644 examples/AdWords/Vb/v201309/Targeting/GetTargetableLanguagesAndCarriers.vb create mode 100644 examples/AdWords/Vb/v201309/Targeting/LookupLocation.vb create mode 100644 examples/AdWords/Vb/v201402/AccountManagement/CreateAccount.vb create mode 100644 examples/AdWords/Vb/v201402/AccountManagement/GetAccountAlerts.vb create mode 100644 examples/AdWords/Vb/v201402/AccountManagement/GetAccountChanges.vb create mode 100644 examples/AdWords/Vb/v201402/AccountManagement/GetAccountHierarchy.vb create mode 100644 examples/AdWords/Vb/v201402/AdvancedOperations/AddAdGroupBidModifier.vb create mode 100644 examples/AdWords/Vb/v201402/AdvancedOperations/AddClickToDownloadAd.vb create mode 100644 examples/AdWords/Vb/v201402/AdvancedOperations/AddPlacesLocationExtension.vb create mode 100644 examples/AdWords/Vb/v201402/AdvancedOperations/AddSiteLinks.vb create mode 100644 examples/AdWords/Vb/v201402/AdvancedOperations/GetAdGroupBidModifiers.vb create mode 100644 examples/AdWords/Vb/v201402/AdvancedOperations/UploadOfflineConversions.vb create mode 100644 examples/AdWords/Vb/v201402/AdvancedOperations/UseSharedBiddingStrategy.vb create mode 100644 examples/AdWords/Vb/v201402/BasicOperations/AddAdGroupDemographicCriteria.vb create mode 100644 examples/AdWords/Vb/v201402/BasicOperations/AddAdGroups.vb create mode 100644 examples/AdWords/Vb/v201402/BasicOperations/AddCampaigns.vb create mode 100644 examples/AdWords/Vb/v201402/BasicOperations/AddKeywords.vb create mode 100644 examples/AdWords/Vb/v201402/BasicOperations/AddTextAds.vb create mode 100644 examples/AdWords/Vb/v201402/BasicOperations/DeleteAd.vb create mode 100644 examples/AdWords/Vb/v201402/BasicOperations/DeleteAdGroup.vb create mode 100644 examples/AdWords/Vb/v201402/BasicOperations/DeleteCampaign.vb create mode 100644 examples/AdWords/Vb/v201402/BasicOperations/DeleteKeyword.vb create mode 100644 examples/AdWords/Vb/v201402/BasicOperations/GetAdGroups.vb create mode 100644 examples/AdWords/Vb/v201402/BasicOperations/GetCampaigns.vb create mode 100644 examples/AdWords/Vb/v201402/BasicOperations/GetCampaignsWithAwql.vb create mode 100644 examples/AdWords/Vb/v201402/BasicOperations/GetKeywords.vb create mode 100644 examples/AdWords/Vb/v201402/BasicOperations/GetTextAds.vb create mode 100644 examples/AdWords/Vb/v201402/BasicOperations/PauseAd.vb create mode 100644 examples/AdWords/Vb/v201402/BasicOperations/UpdateAdGroup.vb create mode 100644 examples/AdWords/Vb/v201402/BasicOperations/UpdateCampaign.vb create mode 100644 examples/AdWords/Vb/v201402/BasicOperations/UpdateKeyword.vb create mode 100644 examples/AdWords/Vb/v201402/CampaignManagement/AddExperiment.vb create mode 100644 examples/AdWords/Vb/v201402/CampaignManagement/AddKeywordsInBulk.vb create mode 100644 examples/AdWords/Vb/v201402/CampaignManagement/AddLocationExtension.vb create mode 100644 examples/AdWords/Vb/v201402/CampaignManagement/GetAllDisapprovedAds.vb create mode 100644 examples/AdWords/Vb/v201402/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb create mode 100644 examples/AdWords/Vb/v201402/CampaignManagement/PromoteExperiment.vb create mode 100644 examples/AdWords/Vb/v201402/CampaignManagement/SetAdParameters.vb create mode 100644 examples/AdWords/Vb/v201402/CampaignManagement/SetBidModifier.vb create mode 100644 examples/AdWords/Vb/v201402/CampaignManagement/ValidateTextAd.vb create mode 100644 examples/AdWords/Vb/v201402/ErrorHandling/HandlePartialFailures.vb create mode 100644 examples/AdWords/Vb/v201402/ErrorHandling/HandlePolicyViolationError.vb create mode 100644 examples/AdWords/Vb/v201402/ErrorHandling/HandleRateExceededError.vb create mode 100644 examples/AdWords/Vb/v201402/ErrorHandling/HandleTwoFactorAuthorizationError.vb create mode 100644 examples/AdWords/Vb/v201402/Miscellaneous/GetAllVideosAndImages.vb create mode 100644 examples/AdWords/Vb/v201402/Miscellaneous/UploadImage.vb create mode 100644 examples/AdWords/Vb/v201402/Optimization/EstimateKeywordTraffic.vb create mode 100644 examples/AdWords/Vb/v201402/Optimization/GetAdGroupBidSimulations.vb create mode 100644 examples/AdWords/Vb/v201402/Optimization/GetKeywordBidSimulations.vb create mode 100644 examples/AdWords/Vb/v201402/Optimization/GetKeywordIdeas.vb create mode 100644 examples/AdWords/Vb/v201402/Optimization/GetPlacementIdeas.vb create mode 100644 examples/AdWords/Vb/v201402/Remarketing/AddAudience.vb create mode 100644 examples/AdWords/Vb/v201402/Remarketing/AddConversionTracker.vb create mode 100644 examples/AdWords/Vb/v201402/Reporting/DownloadCriteriaReport.vb create mode 100644 examples/AdWords/Vb/v201402/Reporting/DownloadCriteriaReportWithAwql.vb create mode 100644 examples/AdWords/Vb/v201402/Reporting/GetReportFields.vb create mode 100644 examples/AdWords/Vb/v201402/ShoppingCampaigns/AddProductPartitionTree.vb create mode 100644 examples/AdWords/Vb/v201402/ShoppingCampaigns/AddProductScope.vb create mode 100644 examples/AdWords/Vb/v201402/ShoppingCampaigns/AddShoppingCampaign.vb create mode 100644 examples/AdWords/Vb/v201402/ShoppingCampaigns/GetProductCategoryTaxonomy.vb create mode 100644 examples/AdWords/Vb/v201402/ShoppingCampaigns/SetProductSalesChannel.vb create mode 100644 examples/AdWords/Vb/v201402/Targeting/AddCampaignTargetingCriteria.vb create mode 100644 examples/AdWords/Vb/v201402/Targeting/GetCampaignTargetingCriteria.vb create mode 100644 examples/AdWords/Vb/v201402/Targeting/GetTargetableLanguagesAndCarriers.vb create mode 100644 examples/AdWords/Vb/v201402/Targeting/LookupLocation.vb create mode 100644 examples/AdWords/Vb/v201406/AccountManagement/CreateAccount.vb create mode 100644 examples/AdWords/Vb/v201406/AccountManagement/GetAccountAlerts.vb create mode 100644 examples/AdWords/Vb/v201406/AccountManagement/GetAccountChanges.vb create mode 100644 examples/AdWords/Vb/v201406/AccountManagement/GetAccountHierarchy.vb create mode 100644 examples/AdWords/Vb/v201406/AdvancedOperations/AddAdGroupBidModifier.vb create mode 100644 examples/AdWords/Vb/v201406/AdvancedOperations/AddClickToDownloadAd.vb create mode 100644 examples/AdWords/Vb/v201406/AdvancedOperations/AddPlacesLocationExtension.vb create mode 100644 examples/AdWords/Vb/v201406/AdvancedOperations/AddSiteLinks.vb create mode 100644 examples/AdWords/Vb/v201406/AdvancedOperations/AddTextAdWithUpgradedUrls.vb create mode 100644 examples/AdWords/Vb/v201406/AdvancedOperations/GetAdGroupBidModifiers.vb create mode 100644 examples/AdWords/Vb/v201406/AdvancedOperations/UploadOfflineConversions.vb create mode 100644 examples/AdWords/Vb/v201406/AdvancedOperations/UseSharedBiddingStrategy.vb create mode 100644 examples/AdWords/Vb/v201406/BasicOperations/AddAdGroupDemographicCriteria.vb create mode 100644 examples/AdWords/Vb/v201406/BasicOperations/AddAdGroups.vb create mode 100644 examples/AdWords/Vb/v201406/BasicOperations/AddCampaigns.vb create mode 100644 examples/AdWords/Vb/v201406/BasicOperations/AddKeywords.vb create mode 100644 examples/AdWords/Vb/v201406/BasicOperations/AddTextAds.vb create mode 100644 examples/AdWords/Vb/v201406/BasicOperations/GetAdGroups.vb create mode 100644 examples/AdWords/Vb/v201406/BasicOperations/GetCampaigns.vb create mode 100644 examples/AdWords/Vb/v201406/BasicOperations/GetCampaignsWithAwql.vb create mode 100644 examples/AdWords/Vb/v201406/BasicOperations/GetKeywords.vb create mode 100644 examples/AdWords/Vb/v201406/BasicOperations/GetTextAds.vb create mode 100644 examples/AdWords/Vb/v201406/BasicOperations/PauseAd.vb create mode 100644 examples/AdWords/Vb/v201406/BasicOperations/RemoveAd.vb create mode 100644 examples/AdWords/Vb/v201406/BasicOperations/RemoveAdGroup.vb create mode 100644 examples/AdWords/Vb/v201406/BasicOperations/RemoveCampaign.vb create mode 100644 examples/AdWords/Vb/v201406/BasicOperations/RemoveKeyword.vb create mode 100644 examples/AdWords/Vb/v201406/BasicOperations/UpdateAdGroup.vb create mode 100644 examples/AdWords/Vb/v201406/BasicOperations/UpdateCampaign.vb create mode 100644 examples/AdWords/Vb/v201406/BasicOperations/UpdateKeyword.vb create mode 100644 examples/AdWords/Vb/v201406/CampaignManagement/AddCampaignLabels.vb create mode 100644 examples/AdWords/Vb/v201406/CampaignManagement/AddExperiment.vb create mode 100644 examples/AdWords/Vb/v201406/CampaignManagement/AddKeywordsInBulk.vb create mode 100644 examples/AdWords/Vb/v201406/CampaignManagement/AddLocationExtension.vb create mode 100644 examples/AdWords/Vb/v201406/CampaignManagement/GetAllDisapprovedAds.vb create mode 100644 examples/AdWords/Vb/v201406/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb create mode 100644 examples/AdWords/Vb/v201406/CampaignManagement/GetCampaignsByLabel.vb create mode 100644 examples/AdWords/Vb/v201406/CampaignManagement/PromoteExperiment.vb create mode 100644 examples/AdWords/Vb/v201406/CampaignManagement/SetAdParameters.vb create mode 100644 examples/AdWords/Vb/v201406/CampaignManagement/SetBidModifier.vb create mode 100644 examples/AdWords/Vb/v201406/CampaignManagement/ValidateTextAd.vb create mode 100644 examples/AdWords/Vb/v201406/ErrorHandling/HandlePartialFailures.vb create mode 100644 examples/AdWords/Vb/v201406/ErrorHandling/HandlePolicyViolationError.vb create mode 100644 examples/AdWords/Vb/v201406/ErrorHandling/HandleRateExceededError.vb create mode 100644 examples/AdWords/Vb/v201406/ErrorHandling/HandleTwoFactorAuthorizationError.vb create mode 100644 examples/AdWords/Vb/v201406/Miscellaneous/GetAllVideosAndImages.vb create mode 100644 examples/AdWords/Vb/v201406/Miscellaneous/UploadImage.vb create mode 100644 examples/AdWords/Vb/v201406/Optimization/EstimateKeywordTraffic.vb create mode 100644 examples/AdWords/Vb/v201406/Optimization/GetAdGroupBidSimulations.vb create mode 100644 examples/AdWords/Vb/v201406/Optimization/GetKeywordBidSimulations.vb create mode 100644 examples/AdWords/Vb/v201406/Optimization/GetKeywordIdeas.vb create mode 100644 examples/AdWords/Vb/v201406/Optimization/GetPlacementIdeas.vb create mode 100644 examples/AdWords/Vb/v201406/Remarketing/AddAudience.vb create mode 100644 examples/AdWords/Vb/v201406/Remarketing/AddConversionTracker.vb create mode 100644 examples/AdWords/Vb/v201406/Reporting/DownloadCriteriaReport.vb create mode 100644 examples/AdWords/Vb/v201406/Reporting/DownloadCriteriaReportWithAwql.vb create mode 100644 examples/AdWords/Vb/v201406/Reporting/GetReportFields.vb create mode 100644 examples/AdWords/Vb/v201406/ShoppingCampaigns/AddProductPartitionTree.vb create mode 100644 examples/AdWords/Vb/v201406/ShoppingCampaigns/AddProductScope.vb create mode 100644 examples/AdWords/Vb/v201406/ShoppingCampaigns/AddShoppingCampaign.vb create mode 100644 examples/AdWords/Vb/v201406/ShoppingCampaigns/GetProductCategoryTaxonomy.vb create mode 100644 examples/AdWords/Vb/v201406/ShoppingCampaigns/SetProductSalesChannel.vb create mode 100644 examples/AdWords/Vb/v201406/Targeting/AddCampaignTargetingCriteria.vb create mode 100644 examples/AdWords/Vb/v201406/Targeting/GetCampaignTargetingCriteria.vb create mode 100644 examples/AdWords/Vb/v201406/Targeting/GetTargetableLanguagesAndCarriers.vb create mode 100644 examples/AdWords/Vb/v201406/Targeting/LookupLocation.vb create mode 100644 examples/AdXBuyer/CSharp/AdWords.Examples.CSharp.csproj create mode 100644 examples/AdXBuyer/CSharp/App.config create mode 100644 examples/AdXBuyer/CSharp/ExampleBase.cs create mode 100644 examples/AdXBuyer/CSharp/ExampleUtilities.cs create mode 100644 examples/AdXBuyer/CSharp/OAuth/AdWords.Examples.CSharp.OAuth.csproj create mode 100644 examples/AdXBuyer/CSharp/OAuth/ConsoleExample.cs create mode 100644 examples/AdXBuyer/CSharp/OAuth/Default.aspx create mode 100644 examples/AdXBuyer/CSharp/OAuth/Default.aspx.cs create mode 100644 examples/AdXBuyer/CSharp/OAuth/Default.aspx.designer.cs create mode 100644 examples/AdXBuyer/CSharp/OAuth/OAuthLogin.aspx create mode 100644 examples/AdXBuyer/CSharp/OAuth/OAuthLogin.aspx.cs create mode 100644 examples/AdXBuyer/CSharp/OAuth/OAuthLogin.aspx.designer.cs create mode 100644 examples/AdXBuyer/CSharp/OAuth/Properties/AssemblyInfo.cs create mode 100644 examples/AdXBuyer/CSharp/OAuth/Properties/Properties.cs create mode 100644 examples/AdXBuyer/CSharp/OAuth/Web.config create mode 100644 examples/AdXBuyer/CSharp/OAuth/css/main.css create mode 100644 examples/AdXBuyer/CSharp/Program.cs create mode 100644 examples/AdXBuyer/CSharp/Properties/AssemblyInfo.cs create mode 100644 examples/AdXBuyer/CSharp/Properties/Properties.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/AccountManagement/GetAccountChanges.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/AdvancedOperations/AddAdGroupBidModifier.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/AdvancedOperations/GetAdGroupBidModifiers.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/AdvancedOperations/UploadOfflineConversions.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/AdvancedOperations/UseSharedBiddingStrategy.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/BasicOperations/AddAdGroupDemographicCriteria.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/BasicOperations/AddAdGroups.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/BasicOperations/AddCampaigns.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/BasicOperations/AddPlacements.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/BasicOperations/AddThirdPartyRedirectAds.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/BasicOperations/DeleteAd.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/BasicOperations/DeleteAdGroup.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/BasicOperations/DeleteCampaign.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/BasicOperations/DeletePlacement.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/BasicOperations/GetAdGroups.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/BasicOperations/GetCampaigns.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/BasicOperations/GetCampaignsWithAwql.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/BasicOperations/GetPlacements.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/BasicOperations/GetThirdPartyRedirectAds.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/BasicOperations/PauseAd.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/BasicOperations/UpdateAdGroup.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/BasicOperations/UpdateCampaign.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/BasicOperations/UpdatePlacement.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/CampaignManagement/AddPlacementsInBulk.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/CampaignManagement/GetAllDisapprovedAds.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/ErrorHandling/HandlePartialFailures.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/ErrorHandling/HandlePolicyViolationError.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/ErrorHandling/HandleRateExceededError.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/ErrorHandling/HandleTwoFactorAuthorizationError.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/Miscellaneous/GetAllVideosAndImages.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/Miscellaneous/UploadImage.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/Optimization/GetPlacementIdeas.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/Remarketing/AddAudience.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/Remarketing/AddConversionTracker.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/Reporting/DownloadCriteriaReport.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/Reporting/DownloadCriteriaReportWithAwql.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/Reporting/GetReportFields.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/Targeting/AddCampaignTargetingCriteria.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/Targeting/GetCampaignTargetingCriteria.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/Targeting/GetTargetableLanguagesAndCarriers.cs create mode 100644 examples/AdXBuyer/CSharp/v201309/Targeting/LookupLocation.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/AccountManagement/GetAccountChanges.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/AdvancedOperations/AddAdGroupBidModifier.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/AdvancedOperations/GetAdGroupBidModifiers.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/AdvancedOperations/UploadOfflineConversions.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/AdvancedOperations/UseSharedBiddingStrategy.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/BasicOperations/AddAdGroupDemographicCriteria.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/BasicOperations/AddAdGroups.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/BasicOperations/AddCampaigns.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/BasicOperations/AddPlacements.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/BasicOperations/AddThirdPartyRedirectAds.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/BasicOperations/DeleteAd.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/BasicOperations/DeleteAdGroup.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/BasicOperations/DeleteCampaign.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/BasicOperations/DeletePlacement.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/BasicOperations/GetAdGroups.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/BasicOperations/GetCampaigns.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/BasicOperations/GetCampaignsWithAwql.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/BasicOperations/GetPlacements.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/BasicOperations/GetThirdPartyRedirectAds.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/BasicOperations/PauseAd.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/BasicOperations/UpdateAdGroup.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/BasicOperations/UpdateCampaign.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/BasicOperations/UpdatePlacement.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/CampaignManagement/AddPlacementsInBulk.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/CampaignManagement/GetAllDisapprovedAds.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/ErrorHandling/HandlePartialFailures.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/ErrorHandling/HandlePolicyViolationError.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/ErrorHandling/HandleRateExceededError.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/Miscellaneous/GetAllVideosAndImages.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/Miscellaneous/UploadImage.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/Optimization/GetPlacementIdeas.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/Remarketing/AddAudience.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/Remarketing/AddConversionTracker.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/Reporting/DownloadCriteriaReport.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/Reporting/DownloadCriteriaReportWithAwql.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/Reporting/GetReportFields.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/Targeting/AddCampaignTargetingCriteria.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/Targeting/GetCampaignTargetingCriteria.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/Targeting/GetTargetableLanguagesAndCarriers.cs create mode 100644 examples/AdXBuyer/CSharp/v201402/Targeting/LookupLocation.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/AccountManagement/GetAccountChanges.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/AdvancedOperations/AddAdGroupBidModifier.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/AdvancedOperations/GetAdGroupBidModifiers.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/AdvancedOperations/UploadOfflineConversions.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/AdvancedOperations/UseSharedBiddingStrategy.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/BasicOperations/AddAdGroupDemographicCriteria.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/BasicOperations/AddAdGroups.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/BasicOperations/AddCampaigns.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/BasicOperations/AddPlacements.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/BasicOperations/AddThirdPartyRedirectAds.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/BasicOperations/GetAdGroups.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/BasicOperations/GetCampaigns.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/BasicOperations/GetCampaignsWithAwql.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/BasicOperations/GetPlacements.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/BasicOperations/GetThirdPartyRedirectAds.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/BasicOperations/PauseAd.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/BasicOperations/RemoveAd.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/BasicOperations/RemoveAdGroup.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/BasicOperations/RemoveCampaign.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/BasicOperations/RemovePlacement.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/BasicOperations/UpdateAdGroup.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/BasicOperations/UpdateCampaign.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/BasicOperations/UpdatePlacement.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/CampaignManagement/AddPlacementsInBulk.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/CampaignManagement/GetAllDisapprovedAds.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/ErrorHandling/HandlePartialFailures.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/ErrorHandling/HandlePolicyViolationError.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/ErrorHandling/HandleRateExceededError.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/Miscellaneous/GetAllVideosAndImages.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/Miscellaneous/UploadImage.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/Optimization/GetPlacementIdeas.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/Remarketing/AddAudience.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/Remarketing/AddConversionTracker.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/Reporting/DownloadCriteriaReport.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/Reporting/DownloadCriteriaReportWithAwql.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/Reporting/GetReportFields.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/Targeting/AddCampaignTargetingCriteria.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/Targeting/GetCampaignTargetingCriteria.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/Targeting/GetTargetableLanguagesAndCarriers.cs create mode 100644 examples/AdXBuyer/CSharp/v201406/Targeting/LookupLocation.cs create mode 100644 examples/AdXBuyer/Vb/AdWords.Examples.VB.vbproj create mode 100644 examples/AdXBuyer/Vb/App.config create mode 100644 examples/AdXBuyer/Vb/ExampleBase.vb create mode 100644 examples/AdXBuyer/Vb/ExampleUtilities.vb create mode 100644 examples/AdXBuyer/Vb/Program.vb create mode 100644 examples/AdXBuyer/Vb/v201309/AccountManagement/GetAccountChanges.vb create mode 100644 examples/AdXBuyer/Vb/v201309/AdvancedOperations/AddAdGroupBidModifier.vb create mode 100644 examples/AdXBuyer/Vb/v201309/AdvancedOperations/GetAdGroupBidModifiers.vb create mode 100644 examples/AdXBuyer/Vb/v201309/AdvancedOperations/UploadOfflineConversions.vb create mode 100644 examples/AdXBuyer/Vb/v201309/AdvancedOperations/UseSharedBiddingStrategy.vb create mode 100644 examples/AdXBuyer/Vb/v201309/BasicOperations/AddAdGroupDemographicCriteria.vb create mode 100644 examples/AdXBuyer/Vb/v201309/BasicOperations/AddAdGroups.vb create mode 100644 examples/AdXBuyer/Vb/v201309/BasicOperations/AddCampaigns.vb create mode 100644 examples/AdXBuyer/Vb/v201309/BasicOperations/AddPlacements.vb create mode 100644 examples/AdXBuyer/Vb/v201309/BasicOperations/AddThirdPartyRedirectAds.vb create mode 100644 examples/AdXBuyer/Vb/v201309/BasicOperations/DeleteAd.vb create mode 100644 examples/AdXBuyer/Vb/v201309/BasicOperations/DeleteAdGroup.vb create mode 100644 examples/AdXBuyer/Vb/v201309/BasicOperations/DeleteCampaign.vb create mode 100644 examples/AdXBuyer/Vb/v201309/BasicOperations/DeletePlacement.vb create mode 100644 examples/AdXBuyer/Vb/v201309/BasicOperations/GetAdGroups.vb create mode 100644 examples/AdXBuyer/Vb/v201309/BasicOperations/GetCampaigns.vb create mode 100644 examples/AdXBuyer/Vb/v201309/BasicOperations/GetCampaignsWithAwql.vb create mode 100644 examples/AdXBuyer/Vb/v201309/BasicOperations/GetPlacements.vb create mode 100644 examples/AdXBuyer/Vb/v201309/BasicOperations/GetThirdPartyRedirectAds.vb create mode 100644 examples/AdXBuyer/Vb/v201309/BasicOperations/PauseAd.vb create mode 100644 examples/AdXBuyer/Vb/v201309/BasicOperations/UpdateAdGroup.vb create mode 100644 examples/AdXBuyer/Vb/v201309/BasicOperations/UpdateCampaign.vb create mode 100644 examples/AdXBuyer/Vb/v201309/BasicOperations/UpdatePlacement.vb create mode 100644 examples/AdXBuyer/Vb/v201309/CampaignManagement/AddPlacementsInBulk.vb create mode 100644 examples/AdXBuyer/Vb/v201309/CampaignManagement/GetAllDisapprovedAds.vb create mode 100644 examples/AdXBuyer/Vb/v201309/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb create mode 100644 examples/AdXBuyer/Vb/v201309/ErrorHandling/HandlePartialFailures.vb create mode 100644 examples/AdXBuyer/Vb/v201309/ErrorHandling/HandlePolicyViolationError.vb create mode 100644 examples/AdXBuyer/Vb/v201309/ErrorHandling/HandleRateExceededError.vb create mode 100644 examples/AdXBuyer/Vb/v201309/ErrorHandling/HandleTwoFactorAuthorizationError.vb create mode 100644 examples/AdXBuyer/Vb/v201309/Miscellaneous/GetAllVideosAndImages.vb create mode 100644 examples/AdXBuyer/Vb/v201309/Miscellaneous/UploadImage.vb create mode 100644 examples/AdXBuyer/Vb/v201309/Optimization/GetPlacementIdeas.vb create mode 100644 examples/AdXBuyer/Vb/v201309/Remarketing/AddAudience.vb create mode 100644 examples/AdXBuyer/Vb/v201309/Remarketing/AddConversionTracker.vb create mode 100644 examples/AdXBuyer/Vb/v201309/Reporting/DownloadCriteriaReport.vb create mode 100644 examples/AdXBuyer/Vb/v201309/Reporting/DownloadCriteriaReportWithAwql.vb create mode 100644 examples/AdXBuyer/Vb/v201309/Reporting/GetReportFields.vb create mode 100644 examples/AdXBuyer/Vb/v201309/Targeting/AddCampaignTargetingCriteria.vb create mode 100644 examples/AdXBuyer/Vb/v201309/Targeting/GetCampaignTargetingCriteria.vb create mode 100644 examples/AdXBuyer/Vb/v201309/Targeting/GetTargetableLanguagesAndCarriers.vb create mode 100644 examples/AdXBuyer/Vb/v201309/Targeting/LookupLocation.vb create mode 100644 examples/AdXBuyer/Vb/v201402/AccountManagement/GetAccountChanges.vb create mode 100644 examples/AdXBuyer/Vb/v201402/AdvancedOperations/AddAdGroupBidModifier.vb create mode 100644 examples/AdXBuyer/Vb/v201402/AdvancedOperations/GetAdGroupBidModifiers.vb create mode 100644 examples/AdXBuyer/Vb/v201402/AdvancedOperations/UploadOfflineConversions.vb create mode 100644 examples/AdXBuyer/Vb/v201402/AdvancedOperations/UseSharedBiddingStrategy.vb create mode 100644 examples/AdXBuyer/Vb/v201402/BasicOperations/AddAdGroupDemographicCriteria.vb create mode 100644 examples/AdXBuyer/Vb/v201402/BasicOperations/AddAdGroups.vb create mode 100644 examples/AdXBuyer/Vb/v201402/BasicOperations/AddCampaigns.vb create mode 100644 examples/AdXBuyer/Vb/v201402/BasicOperations/AddPlacements.vb create mode 100644 examples/AdXBuyer/Vb/v201402/BasicOperations/AddThirdPartyRedirectAds.vb create mode 100644 examples/AdXBuyer/Vb/v201402/BasicOperations/DeleteAd.vb create mode 100644 examples/AdXBuyer/Vb/v201402/BasicOperations/DeleteAdGroup.vb create mode 100644 examples/AdXBuyer/Vb/v201402/BasicOperations/DeleteCampaign.vb create mode 100644 examples/AdXBuyer/Vb/v201402/BasicOperations/DeletePlacement.vb create mode 100644 examples/AdXBuyer/Vb/v201402/BasicOperations/GetAdGroups.vb create mode 100644 examples/AdXBuyer/Vb/v201402/BasicOperations/GetCampaigns.vb create mode 100644 examples/AdXBuyer/Vb/v201402/BasicOperations/GetCampaignsWithAwql.vb create mode 100644 examples/AdXBuyer/Vb/v201402/BasicOperations/GetPlacements.vb create mode 100644 examples/AdXBuyer/Vb/v201402/BasicOperations/GetThirdPartyRedirectAds.vb create mode 100644 examples/AdXBuyer/Vb/v201402/BasicOperations/PauseAd.vb create mode 100644 examples/AdXBuyer/Vb/v201402/BasicOperations/UpdateAdGroup.vb create mode 100644 examples/AdXBuyer/Vb/v201402/BasicOperations/UpdateCampaign.vb create mode 100644 examples/AdXBuyer/Vb/v201402/BasicOperations/UpdatePlacement.vb create mode 100644 examples/AdXBuyer/Vb/v201402/CampaignManagement/AddPlacementsInBulk.vb create mode 100644 examples/AdXBuyer/Vb/v201402/CampaignManagement/GetAllDisapprovedAds.vb create mode 100644 examples/AdXBuyer/Vb/v201402/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb create mode 100644 examples/AdXBuyer/Vb/v201402/ErrorHandling/HandlePartialFailures.vb create mode 100644 examples/AdXBuyer/Vb/v201402/ErrorHandling/HandlePolicyViolationError.vb create mode 100644 examples/AdXBuyer/Vb/v201402/ErrorHandling/HandleRateExceededError.vb create mode 100644 examples/AdXBuyer/Vb/v201402/Miscellaneous/GetAllVideosAndImages.vb create mode 100644 examples/AdXBuyer/Vb/v201402/Miscellaneous/UploadImage.vb create mode 100644 examples/AdXBuyer/Vb/v201402/Optimization/GetPlacementIdeas.vb create mode 100644 examples/AdXBuyer/Vb/v201402/Remarketing/AddAudience.vb create mode 100644 examples/AdXBuyer/Vb/v201402/Remarketing/AddConversionTracker.vb create mode 100644 examples/AdXBuyer/Vb/v201402/Reporting/DownloadCriteriaReport.vb create mode 100644 examples/AdXBuyer/Vb/v201402/Reporting/DownloadCriteriaReportWithAwql.vb create mode 100644 examples/AdXBuyer/Vb/v201402/Reporting/GetReportFields.vb create mode 100644 examples/AdXBuyer/Vb/v201402/Targeting/AddCampaignTargetingCriteria.vb create mode 100644 examples/AdXBuyer/Vb/v201402/Targeting/GetCampaignTargetingCriteria.vb create mode 100644 examples/AdXBuyer/Vb/v201402/Targeting/GetTargetableLanguagesAndCarriers.vb create mode 100644 examples/AdXBuyer/Vb/v201402/Targeting/LookupLocation.vb create mode 100644 examples/AdXBuyer/Vb/v201406/AccountManagement/GetAccountChanges.vb create mode 100644 examples/AdXBuyer/Vb/v201406/AdvancedOperations/AddAdGroupBidModifier.vb create mode 100644 examples/AdXBuyer/Vb/v201406/AdvancedOperations/GetAdGroupBidModifiers.vb create mode 100644 examples/AdXBuyer/Vb/v201406/AdvancedOperations/UploadOfflineConversions.vb create mode 100644 examples/AdXBuyer/Vb/v201406/AdvancedOperations/UseSharedBiddingStrategy.vb create mode 100644 examples/AdXBuyer/Vb/v201406/BasicOperations/AddAdGroupDemographicCriteria.vb create mode 100644 examples/AdXBuyer/Vb/v201406/BasicOperations/AddAdGroups.vb create mode 100644 examples/AdXBuyer/Vb/v201406/BasicOperations/AddCampaigns.vb create mode 100644 examples/AdXBuyer/Vb/v201406/BasicOperations/AddPlacements.vb create mode 100644 examples/AdXBuyer/Vb/v201406/BasicOperations/AddThirdPartyRedirectAds.vb create mode 100644 examples/AdXBuyer/Vb/v201406/BasicOperations/GetAdGroups.vb create mode 100644 examples/AdXBuyer/Vb/v201406/BasicOperations/GetCampaigns.vb create mode 100644 examples/AdXBuyer/Vb/v201406/BasicOperations/GetCampaignsWithAwql.vb create mode 100644 examples/AdXBuyer/Vb/v201406/BasicOperations/GetPlacements.vb create mode 100644 examples/AdXBuyer/Vb/v201406/BasicOperations/GetThirdPartyRedirectAds.vb create mode 100644 examples/AdXBuyer/Vb/v201406/BasicOperations/PauseAd.vb create mode 100644 examples/AdXBuyer/Vb/v201406/BasicOperations/RemoveAd.vb create mode 100644 examples/AdXBuyer/Vb/v201406/BasicOperations/RemoveAdGroup.vb create mode 100644 examples/AdXBuyer/Vb/v201406/BasicOperations/RemoveCampaign.vb create mode 100644 examples/AdXBuyer/Vb/v201406/BasicOperations/RemovePlacement.vb create mode 100644 examples/AdXBuyer/Vb/v201406/BasicOperations/UpdateAdGroup.vb create mode 100644 examples/AdXBuyer/Vb/v201406/BasicOperations/UpdateCampaign.vb create mode 100644 examples/AdXBuyer/Vb/v201406/BasicOperations/UpdatePlacement.vb create mode 100644 examples/AdXBuyer/Vb/v201406/CampaignManagement/AddPlacementsInBulk.vb create mode 100644 examples/AdXBuyer/Vb/v201406/CampaignManagement/GetAllDisapprovedAds.vb create mode 100644 examples/AdXBuyer/Vb/v201406/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb create mode 100644 examples/AdXBuyer/Vb/v201406/ErrorHandling/HandlePartialFailures.vb create mode 100644 examples/AdXBuyer/Vb/v201406/ErrorHandling/HandlePolicyViolationError.vb create mode 100644 examples/AdXBuyer/Vb/v201406/ErrorHandling/HandleRateExceededError.vb create mode 100644 examples/AdXBuyer/Vb/v201406/Miscellaneous/GetAllVideosAndImages.vb create mode 100644 examples/AdXBuyer/Vb/v201406/Miscellaneous/UploadImage.vb create mode 100644 examples/AdXBuyer/Vb/v201406/Optimization/GetPlacementIdeas.vb create mode 100644 examples/AdXBuyer/Vb/v201406/Remarketing/AddAudience.vb create mode 100644 examples/AdXBuyer/Vb/v201406/Remarketing/AddConversionTracker.vb create mode 100644 examples/AdXBuyer/Vb/v201406/Reporting/DownloadCriteriaReport.vb create mode 100644 examples/AdXBuyer/Vb/v201406/Reporting/DownloadCriteriaReportWithAwql.vb create mode 100644 examples/AdXBuyer/Vb/v201406/Reporting/GetReportFields.vb create mode 100644 examples/AdXBuyer/Vb/v201406/Targeting/AddCampaignTargetingCriteria.vb create mode 100644 examples/AdXBuyer/Vb/v201406/Targeting/GetCampaignTargetingCriteria.vb create mode 100644 examples/AdXBuyer/Vb/v201406/Targeting/GetTargetableLanguagesAndCarriers.vb create mode 100644 examples/AdXBuyer/Vb/v201406/Targeting/LookupLocation.vb create mode 100644 examples/Dfa/CSharp/App.config create mode 100644 examples/Dfa/CSharp/Dfa.Examples.CSharp.csproj create mode 100644 examples/Dfa/CSharp/OAuth/ConsoleExample.cs create mode 100644 examples/Dfa/CSharp/OAuth/Default.aspx create mode 100644 examples/Dfa/CSharp/OAuth/Default.aspx.cs create mode 100644 examples/Dfa/CSharp/OAuth/Default.aspx.designer.cs create mode 100644 examples/Dfa/CSharp/OAuth/Dfa.Examples.CSharp.OAuth.csproj create mode 100644 examples/Dfa/CSharp/OAuth/OAuthLogin.aspx create mode 100644 examples/Dfa/CSharp/OAuth/OAuthLogin.aspx.cs create mode 100644 examples/Dfa/CSharp/OAuth/OAuthLogin.aspx.designer.cs create mode 100644 examples/Dfa/CSharp/OAuth/Properties/AssemblyInfo.cs create mode 100644 examples/Dfa/CSharp/OAuth/Properties/Properties.cs create mode 100644 examples/Dfa/CSharp/OAuth/Web.config create mode 100644 examples/Dfa/CSharp/OAuth/css/main.css create mode 100644 examples/Dfa/CSharp/Program.cs create mode 100644 examples/Dfa/CSharp/Properties/AssemblyInfo.cs create mode 100644 examples/Dfa/CSharp/Properties/Properties.cs create mode 100644 examples/Dfa/CSharp/SampleBase.cs create mode 100644 examples/Dfa/CSharp/v1_19/AddAdvertiserUserFilter.cs create mode 100644 examples/Dfa/CSharp/v1_19/AssignAdvertisersToAdvertiserGroup.cs create mode 100644 examples/Dfa/CSharp/v1_19/AssignCreativesToPlacements.cs create mode 100644 examples/Dfa/CSharp/v1_19/Authenticate.cs create mode 100644 examples/Dfa/CSharp/v1_19/CreateAdvertiser.cs create mode 100644 examples/Dfa/CSharp/v1_19/CreateAdvertiserGroup.cs create mode 100644 examples/Dfa/CSharp/v1_19/CreateCampaign.cs create mode 100644 examples/Dfa/CSharp/v1_19/CreateContentCategory.cs create mode 100644 examples/Dfa/CSharp/v1_19/CreateCreativeField.cs create mode 100644 examples/Dfa/CSharp/v1_19/CreateCreativeFieldValue.cs create mode 100644 examples/Dfa/CSharp/v1_19/CreateCreativeGroup.cs create mode 100644 examples/Dfa/CSharp/v1_19/CreateFlashInpageCreative.cs create mode 100644 examples/Dfa/CSharp/v1_19/CreateHTMLAsset.cs create mode 100644 examples/Dfa/CSharp/v1_19/CreateImageAsset.cs create mode 100644 examples/Dfa/CSharp/v1_19/CreateInStreamVideoCreative.cs create mode 100644 examples/Dfa/CSharp/v1_19/CreateMobileAsset.cs create mode 100644 examples/Dfa/CSharp/v1_19/CreateMobileCreative.cs create mode 100644 examples/Dfa/CSharp/v1_19/CreatePlacement.cs create mode 100644 examples/Dfa/CSharp/v1_19/CreatePlacementStrategy.cs create mode 100644 examples/Dfa/CSharp/v1_19/CreateRotationGroup.cs create mode 100644 examples/Dfa/CSharp/v1_19/CreateSpotlightActivity.cs create mode 100644 examples/Dfa/CSharp/v1_19/CreateSpotlightActivityGroup.cs create mode 100644 examples/Dfa/CSharp/v1_19/CreateSubnetwork.cs create mode 100644 examples/Dfa/CSharp/v1_19/CreateUserRole.cs create mode 100644 examples/Dfa/CSharp/v1_19/DownloadTags.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetActivityGroups.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetActivityTypes.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetAdTypes.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetAdTypesNoConfig.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetAdvertiserGroups.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetAdvertisers.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetAvailablePermissions.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetCampaigns.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetChangeLogForAdvertiser.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetChangeLogObjectTypes.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetContentCategories.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetCountries.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetCreativeField.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetCreativeFieldValues.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetCreativeGroups.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetCreativeTypes.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetCreatives.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetDFASite.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetPlacementStrategies.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetPlacementTypes.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetPlacements.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetPricingTypes.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetReport.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetReports.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetSize.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetSubnetworks.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetTagMethodTypes.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetUserFilterTypes.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetUserRoles.cs create mode 100644 examples/Dfa/CSharp/v1_19/GetUsers.cs create mode 100644 examples/Dfa/CSharp/v1_19/ModifyInStreamMediaFilesAndAds.cs create mode 100644 examples/Dfa/CSharp/v1_19/RCReport.cs create mode 100644 examples/Dfa/CSharp/v1_19/ReplaceInStreamAsset.cs create mode 100644 examples/Dfa/CSharp/v1_19/RunDeferredReport.cs create mode 100644 examples/Dfa/CSharp/v1_19/UploadInStreamAsset.cs create mode 100644 examples/Dfa/CSharp/v1_20/AddAdvertiserUserFilter.cs create mode 100644 examples/Dfa/CSharp/v1_20/AssignAdvertisersToAdvertiserGroup.cs create mode 100644 examples/Dfa/CSharp/v1_20/AssignCreativesToPlacements.cs create mode 100644 examples/Dfa/CSharp/v1_20/Authenticate.cs create mode 100644 examples/Dfa/CSharp/v1_20/CreateAdvertiser.cs create mode 100644 examples/Dfa/CSharp/v1_20/CreateAdvertiserGroup.cs create mode 100644 examples/Dfa/CSharp/v1_20/CreateCampaign.cs create mode 100644 examples/Dfa/CSharp/v1_20/CreateContentCategory.cs create mode 100644 examples/Dfa/CSharp/v1_20/CreateCreativeField.cs create mode 100644 examples/Dfa/CSharp/v1_20/CreateCreativeFieldValue.cs create mode 100644 examples/Dfa/CSharp/v1_20/CreateCreativeGroup.cs create mode 100644 examples/Dfa/CSharp/v1_20/CreateFlashInpageCreative.cs create mode 100644 examples/Dfa/CSharp/v1_20/CreateHTMLAsset.cs create mode 100644 examples/Dfa/CSharp/v1_20/CreateImageAsset.cs create mode 100644 examples/Dfa/CSharp/v1_20/CreateInStreamVideoCreative.cs create mode 100644 examples/Dfa/CSharp/v1_20/CreateMobileAsset.cs create mode 100644 examples/Dfa/CSharp/v1_20/CreateMobileCreative.cs create mode 100644 examples/Dfa/CSharp/v1_20/CreatePlacement.cs create mode 100644 examples/Dfa/CSharp/v1_20/CreatePlacementStrategy.cs create mode 100644 examples/Dfa/CSharp/v1_20/CreateRotationGroup.cs create mode 100644 examples/Dfa/CSharp/v1_20/CreateSpotlightActivity.cs create mode 100644 examples/Dfa/CSharp/v1_20/CreateSpotlightActivityGroup.cs create mode 100644 examples/Dfa/CSharp/v1_20/CreateSubnetwork.cs create mode 100644 examples/Dfa/CSharp/v1_20/CreateUserRole.cs create mode 100644 examples/Dfa/CSharp/v1_20/DownloadTags.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetActivityGroups.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetActivityTypes.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetAdTypes.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetAdTypesNoConfig.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetAdvertiserGroups.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetAdvertisers.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetAvailablePermissions.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetCampaigns.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetChangeLogForAdvertiser.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetChangeLogObjectTypes.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetContentCategories.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetCountries.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetCreativeField.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetCreativeFieldValues.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetCreativeGroups.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetCreativeTypes.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetCreatives.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetDFASite.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetPlacementStrategies.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetPlacementTypes.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetPlacements.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetPricingTypes.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetReport.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetReports.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetSize.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetSubnetworks.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetTagMethodTypes.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetUserFilterTypes.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetUserRoles.cs create mode 100644 examples/Dfa/CSharp/v1_20/GetUsers.cs create mode 100644 examples/Dfa/CSharp/v1_20/ModifyInStreamMediaFilesAndAds.cs create mode 100644 examples/Dfa/CSharp/v1_20/RCReport.cs create mode 100644 examples/Dfa/CSharp/v1_20/ReplaceInStreamAsset.cs create mode 100644 examples/Dfa/CSharp/v1_20/RunDeferredReport.cs create mode 100644 examples/Dfa/CSharp/v1_20/UploadInStreamAsset.cs create mode 100644 examples/Dfa/Wcf/WcfService/AdTypeContract.cs create mode 100644 examples/Dfa/Wcf/WcfService/Dfa.Examples.WcfService.csproj create mode 100644 examples/Dfa/Wcf/WcfService/DfaClient.cs create mode 100644 examples/Dfa/Wcf/WcfService/IWcfService.cs create mode 100644 examples/Dfa/Wcf/WcfService/Properties/AssemblyInfo.cs create mode 100644 examples/Dfa/Wcf/WcfService/Properties/Properties.cs create mode 100644 examples/Dfa/Wcf/WcfService/ReportContract.cs create mode 100644 examples/Dfa/Wcf/WcfService/WcfService.svc create mode 100644 examples/Dfa/Wcf/WcfService/WcfService.svc.cs create mode 100644 examples/Dfa/Wcf/WcfService/Web.config create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/Dfa.Examples.WcfServiceConsumer.csproj create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/MainForm.Designer.cs create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/MainForm.cs create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/MainForm.resx create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/Program.cs create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/Properties/AssemblyInfo.cs create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/Properties/Properties.cs create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/Properties/Resources.Designer.cs create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/Properties/Resources.resx create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/Properties/Settings.Designer.cs create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/Properties/Settings.settings create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.AdType.datasource create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.AdTypeContract.datasource create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.ReportContract.datasource create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/Reference.cs create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/Reference.svcmap create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService.disco create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService.wsdl create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService.xsd create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService1.xsd create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService2.xsd create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService3.xsd create mode 100644 examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/configuration.svcinfo create mode 100644 examples/Dfp/CSharp/App.config create mode 100644 examples/Dfp/CSharp/Dfp.Examples.CSharp.csproj create mode 100644 examples/Dfp/CSharp/OAuth/ConsoleExample.cs create mode 100644 examples/Dfp/CSharp/OAuth/Default.aspx create mode 100644 examples/Dfp/CSharp/OAuth/Default.aspx.cs create mode 100644 examples/Dfp/CSharp/OAuth/Default.aspx.designer.cs create mode 100644 examples/Dfp/CSharp/OAuth/Dfp.Examples.CSharp.OAuth.csproj create mode 100644 examples/Dfp/CSharp/OAuth/OAuthLogin.aspx create mode 100644 examples/Dfp/CSharp/OAuth/OAuthLogin.aspx.cs create mode 100644 examples/Dfp/CSharp/OAuth/OAuthLogin.aspx.designer.cs create mode 100644 examples/Dfp/CSharp/OAuth/Properties/AssemblyInfo.cs create mode 100644 examples/Dfp/CSharp/OAuth/Properties/Properties.cs create mode 100644 examples/Dfp/CSharp/OAuth/Web.config create mode 100644 examples/Dfp/CSharp/OAuth/css/main.css create mode 100644 examples/Dfp/CSharp/Program.cs create mode 100644 examples/Dfp/CSharp/Properties/AssemblyInfo.cs create mode 100644 examples/Dfp/CSharp/Properties/Properties.cs create mode 100644 examples/Dfp/CSharp/SampleBase.cs create mode 100644 examples/Dfp/CSharp/v201208/AudienceSegmentService/GetAllAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201208/CompanyService/CreateCompanies.cs create mode 100644 examples/Dfp/CSharp/v201208/CompanyService/GetAllCompanies.cs create mode 100644 examples/Dfp/CSharp/v201208/CompanyService/GetCompaniesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201208/CompanyService/GetCompany.cs create mode 100644 examples/Dfp/CSharp/v201208/CompanyService/UpdateCompanies.cs create mode 100644 examples/Dfp/CSharp/v201208/ContentService/GetAllContent.cs create mode 100644 examples/Dfp/CSharp/v201208/ContentService/GetContentByCategory.cs create mode 100644 examples/Dfp/CSharp/v201208/CreativeService/CopyImageCreatives.cs create mode 100644 examples/Dfp/CSharp/v201208/CreativeService/CreateCreativeFromTemplate.cs create mode 100644 examples/Dfp/CSharp/v201208/CreativeService/CreateCreatives.cs create mode 100644 examples/Dfp/CSharp/v201208/CreativeService/CreateCustomCreative.cs create mode 100644 examples/Dfp/CSharp/v201208/CreativeService/GetAllCreatives.cs create mode 100644 examples/Dfp/CSharp/v201208/CreativeService/GetCreative.cs create mode 100644 examples/Dfp/CSharp/v201208/CreativeService/GetCreativesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201208/CreativeService/UpdateCreatives.cs create mode 100644 examples/Dfp/CSharp/v201208/CreativeTemplateService/GetAllCreativeTemplates.cs create mode 100644 examples/Dfp/CSharp/v201208/CreativeTemplateService/GetCreativeTemplate.cs create mode 100644 examples/Dfp/CSharp/v201208/CreativeTemplateService/GetCreativeTemplatesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201208/CustomFieldService/CreateCustomFieldOptions.cs create mode 100644 examples/Dfp/CSharp/v201208/CustomFieldService/CreateCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201208/CustomFieldService/DeactivateAllLineItemCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201208/CustomFieldService/GetAllCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201208/CustomFieldService/GetAllLineItemCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201208/CustomFieldService/SetLineItemCustomFieldValue.cs create mode 100644 examples/Dfp/CSharp/v201208/CustomFieldService/UpdateCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201208/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs create mode 100644 examples/Dfp/CSharp/v201208/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs create mode 100644 examples/Dfp/CSharp/v201208/CustomTargetingService/GetCustomTargetingKeysByStatement.cs create mode 100644 examples/Dfp/CSharp/v201208/CustomTargetingService/GetCustomTargetingValuesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201208/CustomTargetingService/UpdateCustomTargetingKeys.cs create mode 100644 examples/Dfp/CSharp/v201208/CustomTargetingService/UpdateCustomTargetingValues.cs create mode 100644 examples/Dfp/CSharp/v201208/ForecastService/GetForecast.cs create mode 100644 examples/Dfp/CSharp/v201208/ForecastService/GetForecastById.cs create mode 100644 examples/Dfp/CSharp/v201208/InventoryService/CreateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201208/InventoryService/CreateMobileAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201208/InventoryService/CreateVideoAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201208/InventoryService/DeActivateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201208/InventoryService/GetAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201208/InventoryService/GetAdUnitSizes.cs create mode 100644 examples/Dfp/CSharp/v201208/InventoryService/GetAdUnitsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201208/InventoryService/GetAllAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201208/InventoryService/GetInventoryTree.cs create mode 100644 examples/Dfp/CSharp/v201208/InventoryService/UpdateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201208/LabelService/CreateLabels.cs create mode 100644 examples/Dfp/CSharp/v201208/LabelService/DeactivateActiveLabels.cs create mode 100644 examples/Dfp/CSharp/v201208/LabelService/GetAllLabels.cs create mode 100644 examples/Dfp/CSharp/v201208/LabelService/GetLabel.cs create mode 100644 examples/Dfp/CSharp/v201208/LabelService/GetLabelsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201208/LabelService/UpdateLabels.cs create mode 100644 examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/ActivateLicas.cs create mode 100644 examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/CreateLicas.cs create mode 100644 examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/DeactivateLicas.cs create mode 100644 examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/GetAllLicas.cs create mode 100644 examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/GetLica.cs create mode 100644 examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/GetLicasByStatement.cs create mode 100644 examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/UpdateLicas.cs create mode 100644 examples/Dfp/CSharp/v201208/LineItemService/ActivateLineItem.cs create mode 100644 examples/Dfp/CSharp/v201208/LineItemService/CreateLineItems.cs create mode 100644 examples/Dfp/CSharp/v201208/LineItemService/CreateMobileLineItem.cs create mode 100644 examples/Dfp/CSharp/v201208/LineItemService/CreateVideoLineItem.cs create mode 100644 examples/Dfp/CSharp/v201208/LineItemService/GetAllLineItems.cs create mode 100644 examples/Dfp/CSharp/v201208/LineItemService/GetLineItem.cs create mode 100644 examples/Dfp/CSharp/v201208/LineItemService/GetLineItemsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201208/LineItemService/GetRecentlyUpdatedLineItems.cs create mode 100644 examples/Dfp/CSharp/v201208/LineItemService/TargetCustomCriteria.cs create mode 100644 examples/Dfp/CSharp/v201208/LineItemService/UpdateLineItems.cs create mode 100644 examples/Dfp/CSharp/v201208/NetworkService/GetAllNetworks.cs create mode 100644 examples/Dfp/CSharp/v201208/NetworkService/GetCurrentNetwork.cs create mode 100644 examples/Dfp/CSharp/v201208/NetworkService/MakeTestNetwork.cs create mode 100644 examples/Dfp/CSharp/v201208/OrderService/ApproveOrder.cs create mode 100644 examples/Dfp/CSharp/v201208/OrderService/CreateOrders.cs create mode 100644 examples/Dfp/CSharp/v201208/OrderService/GetAllOrders.cs create mode 100644 examples/Dfp/CSharp/v201208/OrderService/GetOrder.cs create mode 100644 examples/Dfp/CSharp/v201208/OrderService/GetOrdersByStatement.cs create mode 100644 examples/Dfp/CSharp/v201208/OrderService/UpdateOrders.cs create mode 100644 examples/Dfp/CSharp/v201208/PlacementService/CreatePlacements.cs create mode 100644 examples/Dfp/CSharp/v201208/PlacementService/DeactivatePlacement.cs create mode 100644 examples/Dfp/CSharp/v201208/PlacementService/GetAllPlacements.cs create mode 100644 examples/Dfp/CSharp/v201208/PlacementService/GetPlacement.cs create mode 100644 examples/Dfp/CSharp/v201208/PlacementService/GetPlacementsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201208/PlacementService/UpdatePlacements.cs create mode 100644 examples/Dfp/CSharp/v201208/PublisherQueryLanguageService/GetAllCities.cs create mode 100644 examples/Dfp/CSharp/v201208/ReportService/DownloadReport.cs create mode 100644 examples/Dfp/CSharp/v201208/ReportService/RunDeliveryReport.cs create mode 100644 examples/Dfp/CSharp/v201208/ReportService/RunInventoryReport.cs create mode 100644 examples/Dfp/CSharp/v201208/ReportService/RunMergedDeliveryReport.cs create mode 100644 examples/Dfp/CSharp/v201208/ReportService/RunReportWithCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201208/ReportService/RunSalesReport.cs create mode 100644 examples/Dfp/CSharp/v201208/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201208/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201208/SuggestedAdUnitService/GetSuggestedAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201208/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs create mode 100644 examples/Dfp/CSharp/v201208/TeamService/CreateTeams.cs create mode 100644 examples/Dfp/CSharp/v201208/TeamService/GetAllTeams.cs create mode 100644 examples/Dfp/CSharp/v201208/TeamService/GetTeam.cs create mode 100644 examples/Dfp/CSharp/v201208/TeamService/GetTeamsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201208/TeamService/UpdateTeams.cs create mode 100644 examples/Dfp/CSharp/v201208/ThirdPartySlotService/ArchiveThirdPartySlots.cs create mode 100644 examples/Dfp/CSharp/v201208/ThirdPartySlotService/CreateThirdPartySlot.cs create mode 100644 examples/Dfp/CSharp/v201208/ThirdPartySlotService/GetAllThirdPartySlots.cs create mode 100644 examples/Dfp/CSharp/v201208/ThirdPartySlotService/GetThirdPartySlotsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201208/ThirdPartySlotService/UpdateThirdPartySlots.cs create mode 100644 examples/Dfp/CSharp/v201208/UserService/CreateUsers.cs create mode 100644 examples/Dfp/CSharp/v201208/UserService/DeactivateUser.cs create mode 100644 examples/Dfp/CSharp/v201208/UserService/GetAllRoles.cs create mode 100644 examples/Dfp/CSharp/v201208/UserService/GetAllUsers.cs create mode 100644 examples/Dfp/CSharp/v201208/UserService/GetCurrentUser.cs create mode 100644 examples/Dfp/CSharp/v201208/UserService/GetUser.cs create mode 100644 examples/Dfp/CSharp/v201208/UserService/GetUsersByStatement.cs create mode 100644 examples/Dfp/CSharp/v201208/UserService/UpdateUsers.cs create mode 100644 examples/Dfp/CSharp/v201208/UserTeamAssociationService/CreateUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201208/UserTeamAssociationService/DeleteUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201208/UserTeamAssociationService/GetAllUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201208/UserTeamAssociationService/GetUserTeamAssociation.cs create mode 100644 examples/Dfp/CSharp/v201208/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201208/UserTeamAssociationService/UpdateUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201211/AudienceSegmentService/GetAllAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201211/CompanyService/CreateCompanies.cs create mode 100644 examples/Dfp/CSharp/v201211/CompanyService/GetAllCompanies.cs create mode 100644 examples/Dfp/CSharp/v201211/CompanyService/GetCompaniesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201211/CompanyService/GetCompany.cs create mode 100644 examples/Dfp/CSharp/v201211/CompanyService/UpdateCompanies.cs create mode 100644 examples/Dfp/CSharp/v201211/ContentService/GetAllContent.cs create mode 100644 examples/Dfp/CSharp/v201211/ContentService/GetContentByCategory.cs create mode 100644 examples/Dfp/CSharp/v201211/CreativeService/CopyImageCreatives.cs create mode 100644 examples/Dfp/CSharp/v201211/CreativeService/CreateCreativeFromTemplate.cs create mode 100644 examples/Dfp/CSharp/v201211/CreativeService/CreateCreatives.cs create mode 100644 examples/Dfp/CSharp/v201211/CreativeService/CreateCustomCreative.cs create mode 100644 examples/Dfp/CSharp/v201211/CreativeService/GetAllCreatives.cs create mode 100644 examples/Dfp/CSharp/v201211/CreativeService/GetCreative.cs create mode 100644 examples/Dfp/CSharp/v201211/CreativeService/GetCreativesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201211/CreativeService/UpdateCreatives.cs create mode 100644 examples/Dfp/CSharp/v201211/CreativeTemplateService/GetAllCreativeTemplates.cs create mode 100644 examples/Dfp/CSharp/v201211/CreativeTemplateService/GetCreativeTemplate.cs create mode 100644 examples/Dfp/CSharp/v201211/CreativeTemplateService/GetCreativeTemplatesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201211/CreativeWrapperService/CreateCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201211/CreativeWrapperService/DeactivateCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201211/CreativeWrapperService/GetActiveCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201211/CreativeWrapperService/GetAllCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201211/CreativeWrapperService/UpdateCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201211/CustomFieldService/CreateCustomFieldOptions.cs create mode 100644 examples/Dfp/CSharp/v201211/CustomFieldService/CreateCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201211/CustomFieldService/DeactivateAllLineItemCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201211/CustomFieldService/GetAllCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201211/CustomFieldService/GetAllLineItemCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201211/CustomFieldService/SetLineItemCustomFieldValue.cs create mode 100644 examples/Dfp/CSharp/v201211/CustomFieldService/UpdateCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201211/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs create mode 100644 examples/Dfp/CSharp/v201211/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs create mode 100644 examples/Dfp/CSharp/v201211/CustomTargetingService/GetCustomTargetingKeysByStatement.cs create mode 100644 examples/Dfp/CSharp/v201211/CustomTargetingService/GetCustomTargetingValuesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201211/CustomTargetingService/UpdateCustomTargetingKeys.cs create mode 100644 examples/Dfp/CSharp/v201211/CustomTargetingService/UpdateCustomTargetingValues.cs create mode 100644 examples/Dfp/CSharp/v201211/ForecastService/GetForecast.cs create mode 100644 examples/Dfp/CSharp/v201211/ForecastService/GetForecastById.cs create mode 100644 examples/Dfp/CSharp/v201211/InventoryService/CreateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201211/InventoryService/CreateMobileAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201211/InventoryService/CreateVideoAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201211/InventoryService/DeActivateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201211/InventoryService/GetAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201211/InventoryService/GetAdUnitSizes.cs create mode 100644 examples/Dfp/CSharp/v201211/InventoryService/GetAdUnitsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201211/InventoryService/GetAllAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201211/InventoryService/GetInventoryTree.cs create mode 100644 examples/Dfp/CSharp/v201211/InventoryService/UpdateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201211/LabelService/CreateLabels.cs create mode 100644 examples/Dfp/CSharp/v201211/LabelService/DeactivateActiveLabels.cs create mode 100644 examples/Dfp/CSharp/v201211/LabelService/GetAllLabels.cs create mode 100644 examples/Dfp/CSharp/v201211/LabelService/GetLabel.cs create mode 100644 examples/Dfp/CSharp/v201211/LabelService/GetLabelsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201211/LabelService/UpdateLabels.cs create mode 100644 examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/ActivateLicas.cs create mode 100644 examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/CreateLicas.cs create mode 100644 examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/DeactivateLicas.cs create mode 100644 examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/GetAllLicas.cs create mode 100644 examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/GetLica.cs create mode 100644 examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/GetLicasByStatement.cs create mode 100644 examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/UpdateLicas.cs create mode 100644 examples/Dfp/CSharp/v201211/LineItemService/ActivateLineItem.cs create mode 100644 examples/Dfp/CSharp/v201211/LineItemService/CreateLineItems.cs create mode 100644 examples/Dfp/CSharp/v201211/LineItemService/CreateMobileLineItem.cs create mode 100644 examples/Dfp/CSharp/v201211/LineItemService/CreateVideoLineItem.cs create mode 100644 examples/Dfp/CSharp/v201211/LineItemService/GetAllLineItems.cs create mode 100644 examples/Dfp/CSharp/v201211/LineItemService/GetLineItem.cs create mode 100644 examples/Dfp/CSharp/v201211/LineItemService/GetLineItemsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201211/LineItemService/GetRecentlyUpdatedLineItems.cs create mode 100644 examples/Dfp/CSharp/v201211/LineItemService/TargetCustomCriteria.cs create mode 100644 examples/Dfp/CSharp/v201211/LineItemService/UpdateLineItems.cs create mode 100644 examples/Dfp/CSharp/v201211/NetworkService/GetAllNetworks.cs create mode 100644 examples/Dfp/CSharp/v201211/NetworkService/GetCurrentNetwork.cs create mode 100644 examples/Dfp/CSharp/v201211/NetworkService/MakeTestNetwork.cs create mode 100644 examples/Dfp/CSharp/v201211/OrderService/ApproveOrder.cs create mode 100644 examples/Dfp/CSharp/v201211/OrderService/CreateOrders.cs create mode 100644 examples/Dfp/CSharp/v201211/OrderService/GetAllOrders.cs create mode 100644 examples/Dfp/CSharp/v201211/OrderService/GetOrder.cs create mode 100644 examples/Dfp/CSharp/v201211/OrderService/GetOrdersByStatement.cs create mode 100644 examples/Dfp/CSharp/v201211/OrderService/UpdateOrders.cs create mode 100644 examples/Dfp/CSharp/v201211/PlacementService/CreatePlacements.cs create mode 100644 examples/Dfp/CSharp/v201211/PlacementService/DeactivatePlacement.cs create mode 100644 examples/Dfp/CSharp/v201211/PlacementService/GetAllPlacements.cs create mode 100644 examples/Dfp/CSharp/v201211/PlacementService/GetPlacement.cs create mode 100644 examples/Dfp/CSharp/v201211/PlacementService/GetPlacementsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201211/PlacementService/UpdatePlacements.cs create mode 100644 examples/Dfp/CSharp/v201211/PublisherQueryLanguageService/GetAllCities.cs create mode 100644 examples/Dfp/CSharp/v201211/ReportService/DownloadReport.cs create mode 100644 examples/Dfp/CSharp/v201211/ReportService/RunDeliveryReport.cs create mode 100644 examples/Dfp/CSharp/v201211/ReportService/RunInventoryReport.cs create mode 100644 examples/Dfp/CSharp/v201211/ReportService/RunMergedDeliveryReport.cs create mode 100644 examples/Dfp/CSharp/v201211/ReportService/RunReportWithCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201211/ReportService/RunSalesReport.cs create mode 100644 examples/Dfp/CSharp/v201211/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201211/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201211/SuggestedAdUnitService/GetSuggestedAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201211/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs create mode 100644 examples/Dfp/CSharp/v201211/TeamService/CreateTeams.cs create mode 100644 examples/Dfp/CSharp/v201211/TeamService/GetAllTeams.cs create mode 100644 examples/Dfp/CSharp/v201211/TeamService/GetTeam.cs create mode 100644 examples/Dfp/CSharp/v201211/TeamService/GetTeamsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201211/TeamService/UpdateTeams.cs create mode 100644 examples/Dfp/CSharp/v201211/ThirdPartySlotService/ArchiveThirdPartySlots.cs create mode 100644 examples/Dfp/CSharp/v201211/ThirdPartySlotService/CreateThirdPartySlot.cs create mode 100644 examples/Dfp/CSharp/v201211/ThirdPartySlotService/GetAllThirdPartySlots.cs create mode 100644 examples/Dfp/CSharp/v201211/ThirdPartySlotService/GetThirdPartySlotsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201211/ThirdPartySlotService/UpdateThirdPartySlots.cs create mode 100644 examples/Dfp/CSharp/v201211/UserService/CreateUsers.cs create mode 100644 examples/Dfp/CSharp/v201211/UserService/DeactivateUser.cs create mode 100644 examples/Dfp/CSharp/v201211/UserService/GetAllRoles.cs create mode 100644 examples/Dfp/CSharp/v201211/UserService/GetAllUsers.cs create mode 100644 examples/Dfp/CSharp/v201211/UserService/GetCurrentUser.cs create mode 100644 examples/Dfp/CSharp/v201211/UserService/GetUser.cs create mode 100644 examples/Dfp/CSharp/v201211/UserService/GetUsersByStatement.cs create mode 100644 examples/Dfp/CSharp/v201211/UserService/UpdateUsers.cs create mode 100644 examples/Dfp/CSharp/v201211/UserTeamAssociationService/CreateUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201211/UserTeamAssociationService/DeleteUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201211/UserTeamAssociationService/GetAllUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201211/UserTeamAssociationService/GetUserTeamAssociation.cs create mode 100644 examples/Dfp/CSharp/v201211/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201211/UserTeamAssociationService/UpdateUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201302/ActivityGroupService/CreateActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201302/ActivityGroupService/GetActiveActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201302/ActivityGroupService/GetAllActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201302/ActivityGroupService/UpdateActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201302/ActivityService/CreateActivities.cs create mode 100644 examples/Dfp/CSharp/v201302/ActivityService/GetActiveActivities.cs create mode 100644 examples/Dfp/CSharp/v201302/ActivityService/GetAllActivities.cs create mode 100644 examples/Dfp/CSharp/v201302/ActivityService/UpdateActivities.cs create mode 100644 examples/Dfp/CSharp/v201302/AudienceSegmentService/GetAllAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201302/CompanyService/CreateCompanies.cs create mode 100644 examples/Dfp/CSharp/v201302/CompanyService/GetAllCompanies.cs create mode 100644 examples/Dfp/CSharp/v201302/CompanyService/GetCompaniesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201302/CompanyService/GetCompany.cs create mode 100644 examples/Dfp/CSharp/v201302/CompanyService/UpdateCompanies.cs create mode 100644 examples/Dfp/CSharp/v201302/ContactService/CreateContacts.cs create mode 100644 examples/Dfp/CSharp/v201302/ContactService/GetAllContacts.cs create mode 100644 examples/Dfp/CSharp/v201302/ContactService/GetUninvitedContacts.cs create mode 100644 examples/Dfp/CSharp/v201302/ContactService/UpdateContacts.cs create mode 100644 examples/Dfp/CSharp/v201302/ContentService/GetAllContent.cs create mode 100644 examples/Dfp/CSharp/v201302/ContentService/GetContentByCategory.cs create mode 100644 examples/Dfp/CSharp/v201302/CreativeService/CopyImageCreatives.cs create mode 100644 examples/Dfp/CSharp/v201302/CreativeService/CreateCreativeFromTemplate.cs create mode 100644 examples/Dfp/CSharp/v201302/CreativeService/CreateCreatives.cs create mode 100644 examples/Dfp/CSharp/v201302/CreativeService/CreateCustomCreative.cs create mode 100644 examples/Dfp/CSharp/v201302/CreativeService/GetAllCreatives.cs create mode 100644 examples/Dfp/CSharp/v201302/CreativeService/GetCreative.cs create mode 100644 examples/Dfp/CSharp/v201302/CreativeService/GetCreativesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201302/CreativeService/UpdateCreatives.cs create mode 100644 examples/Dfp/CSharp/v201302/CreativeTemplateService/GetAllCreativeTemplates.cs create mode 100644 examples/Dfp/CSharp/v201302/CreativeTemplateService/GetCreativeTemplate.cs create mode 100644 examples/Dfp/CSharp/v201302/CreativeTemplateService/GetCreativeTemplatesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201302/CreativeWrapperService/CreateCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201302/CreativeWrapperService/DeactivateCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201302/CreativeWrapperService/GetActiveCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201302/CreativeWrapperService/GetAllCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201302/CreativeWrapperService/UpdateCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201302/CustomFieldService/CreateCustomFieldOptions.cs create mode 100644 examples/Dfp/CSharp/v201302/CustomFieldService/CreateCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201302/CustomFieldService/DeactivateAllLineItemCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201302/CustomFieldService/GetAllCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201302/CustomFieldService/GetAllLineItemCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201302/CustomFieldService/SetLineItemCustomFieldValue.cs create mode 100644 examples/Dfp/CSharp/v201302/CustomFieldService/UpdateCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201302/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs create mode 100644 examples/Dfp/CSharp/v201302/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs create mode 100644 examples/Dfp/CSharp/v201302/CustomTargetingService/GetCustomTargetingKeysByStatement.cs create mode 100644 examples/Dfp/CSharp/v201302/CustomTargetingService/GetCustomTargetingValuesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201302/CustomTargetingService/UpdateCustomTargetingKeys.cs create mode 100644 examples/Dfp/CSharp/v201302/CustomTargetingService/UpdateCustomTargetingValues.cs create mode 100644 examples/Dfp/CSharp/v201302/ForecastService/GetForecast.cs create mode 100644 examples/Dfp/CSharp/v201302/ForecastService/GetForecastById.cs create mode 100644 examples/Dfp/CSharp/v201302/InventoryService/CreateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201302/InventoryService/CreateMobileAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201302/InventoryService/CreateVideoAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201302/InventoryService/DeActivateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201302/InventoryService/GetAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201302/InventoryService/GetAdUnitSizes.cs create mode 100644 examples/Dfp/CSharp/v201302/InventoryService/GetAdUnitsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201302/InventoryService/GetAllAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201302/InventoryService/GetInventoryTree.cs create mode 100644 examples/Dfp/CSharp/v201302/InventoryService/UpdateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201302/LabelService/CreateLabels.cs create mode 100644 examples/Dfp/CSharp/v201302/LabelService/DeactivateActiveLabels.cs create mode 100644 examples/Dfp/CSharp/v201302/LabelService/GetAllLabels.cs create mode 100644 examples/Dfp/CSharp/v201302/LabelService/GetLabel.cs create mode 100644 examples/Dfp/CSharp/v201302/LabelService/GetLabelsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201302/LabelService/UpdateLabels.cs create mode 100644 examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/ActivateLicas.cs create mode 100644 examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/CreateLicas.cs create mode 100644 examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/DeactivateLicas.cs create mode 100644 examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/GetAllLicas.cs create mode 100644 examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/GetLica.cs create mode 100644 examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/GetLicasByStatement.cs create mode 100644 examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/UpdateLicas.cs create mode 100644 examples/Dfp/CSharp/v201302/LineItemService/ActivateLineItem.cs create mode 100644 examples/Dfp/CSharp/v201302/LineItemService/CreateLineItems.cs create mode 100644 examples/Dfp/CSharp/v201302/LineItemService/CreateMobileLineItem.cs create mode 100644 examples/Dfp/CSharp/v201302/LineItemService/CreateVideoLineItem.cs create mode 100644 examples/Dfp/CSharp/v201302/LineItemService/GetAllLineItems.cs create mode 100644 examples/Dfp/CSharp/v201302/LineItemService/GetLineItem.cs create mode 100644 examples/Dfp/CSharp/v201302/LineItemService/GetLineItemsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201302/LineItemService/GetRecentlyUpdatedLineItems.cs create mode 100644 examples/Dfp/CSharp/v201302/LineItemService/TargetCustomCriteria.cs create mode 100644 examples/Dfp/CSharp/v201302/LineItemService/UpdateLineItems.cs create mode 100644 examples/Dfp/CSharp/v201302/NetworkService/GetAllNetworks.cs create mode 100644 examples/Dfp/CSharp/v201302/NetworkService/GetCurrentNetwork.cs create mode 100644 examples/Dfp/CSharp/v201302/NetworkService/MakeTestNetwork.cs create mode 100644 examples/Dfp/CSharp/v201302/OrderService/ApproveOrder.cs create mode 100644 examples/Dfp/CSharp/v201302/OrderService/CreateOrders.cs create mode 100644 examples/Dfp/CSharp/v201302/OrderService/GetAllOrders.cs create mode 100644 examples/Dfp/CSharp/v201302/OrderService/GetOrder.cs create mode 100644 examples/Dfp/CSharp/v201302/OrderService/GetOrdersByStatement.cs create mode 100644 examples/Dfp/CSharp/v201302/OrderService/UpdateOrders.cs create mode 100644 examples/Dfp/CSharp/v201302/PlacementService/CreatePlacements.cs create mode 100644 examples/Dfp/CSharp/v201302/PlacementService/DeactivatePlacement.cs create mode 100644 examples/Dfp/CSharp/v201302/PlacementService/GetAllPlacements.cs create mode 100644 examples/Dfp/CSharp/v201302/PlacementService/GetPlacement.cs create mode 100644 examples/Dfp/CSharp/v201302/PlacementService/GetPlacementsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201302/PlacementService/UpdatePlacements.cs create mode 100644 examples/Dfp/CSharp/v201302/PublisherQueryLanguageService/GetAllCities.cs create mode 100644 examples/Dfp/CSharp/v201302/ReportService/DisplayReport.cs create mode 100644 examples/Dfp/CSharp/v201302/ReportService/DownloadReport.cs create mode 100644 examples/Dfp/CSharp/v201302/ReportService/RunDeliveryReport.cs create mode 100644 examples/Dfp/CSharp/v201302/ReportService/RunInventoryReport.cs create mode 100644 examples/Dfp/CSharp/v201302/ReportService/RunMergedDeliveryReport.cs create mode 100644 examples/Dfp/CSharp/v201302/ReportService/RunReachReport.cs create mode 100644 examples/Dfp/CSharp/v201302/ReportService/RunReportWithCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201302/ReportService/RunSalesReport.cs create mode 100644 examples/Dfp/CSharp/v201302/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201302/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201302/SuggestedAdUnitService/GetSuggestedAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201302/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs create mode 100644 examples/Dfp/CSharp/v201302/TeamService/CreateTeams.cs create mode 100644 examples/Dfp/CSharp/v201302/TeamService/GetAllTeams.cs create mode 100644 examples/Dfp/CSharp/v201302/TeamService/GetTeam.cs create mode 100644 examples/Dfp/CSharp/v201302/TeamService/GetTeamsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201302/TeamService/UpdateTeams.cs create mode 100644 examples/Dfp/CSharp/v201302/ThirdPartySlotService/ArchiveThirdPartySlots.cs create mode 100644 examples/Dfp/CSharp/v201302/ThirdPartySlotService/CreateThirdPartySlot.cs create mode 100644 examples/Dfp/CSharp/v201302/ThirdPartySlotService/GetAllThirdPartySlots.cs create mode 100644 examples/Dfp/CSharp/v201302/ThirdPartySlotService/GetThirdPartySlotsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201302/ThirdPartySlotService/UpdateThirdPartySlots.cs create mode 100644 examples/Dfp/CSharp/v201302/UserService/CreateUsers.cs create mode 100644 examples/Dfp/CSharp/v201302/UserService/DeactivateUser.cs create mode 100644 examples/Dfp/CSharp/v201302/UserService/GetAllRoles.cs create mode 100644 examples/Dfp/CSharp/v201302/UserService/GetAllUsers.cs create mode 100644 examples/Dfp/CSharp/v201302/UserService/GetCurrentUser.cs create mode 100644 examples/Dfp/CSharp/v201302/UserService/GetUser.cs create mode 100644 examples/Dfp/CSharp/v201302/UserService/GetUsersByStatement.cs create mode 100644 examples/Dfp/CSharp/v201302/UserService/UpdateUsers.cs create mode 100644 examples/Dfp/CSharp/v201302/UserTeamAssociationService/CreateUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201302/UserTeamAssociationService/DeleteUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201302/UserTeamAssociationService/GetAllUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201302/UserTeamAssociationService/GetUserTeamAssociation.cs create mode 100644 examples/Dfp/CSharp/v201302/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201302/UserTeamAssociationService/UpdateUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201306/ActivityGroupService/CreateActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201306/ActivityGroupService/GetActiveActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201306/ActivityGroupService/GetAllActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201306/ActivityGroupService/UpdateActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201306/ActivityService/CreateActivities.cs create mode 100644 examples/Dfp/CSharp/v201306/ActivityService/GetActiveActivities.cs create mode 100644 examples/Dfp/CSharp/v201306/ActivityService/GetAllActivities.cs create mode 100644 examples/Dfp/CSharp/v201306/ActivityService/UpdateActivities.cs create mode 100644 examples/Dfp/CSharp/v201306/AudienceSegmentService/GetAllAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201306/CompanyService/CreateCompanies.cs create mode 100644 examples/Dfp/CSharp/v201306/CompanyService/GetAllCompanies.cs create mode 100644 examples/Dfp/CSharp/v201306/CompanyService/GetCompaniesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201306/CompanyService/GetCompany.cs create mode 100644 examples/Dfp/CSharp/v201306/CompanyService/UpdateCompanies.cs create mode 100644 examples/Dfp/CSharp/v201306/ContactService/CreateContacts.cs create mode 100644 examples/Dfp/CSharp/v201306/ContactService/GetAllContacts.cs create mode 100644 examples/Dfp/CSharp/v201306/ContactService/GetUninvitedContacts.cs create mode 100644 examples/Dfp/CSharp/v201306/ContactService/UpdateContacts.cs create mode 100644 examples/Dfp/CSharp/v201306/ContentService/GetAllContent.cs create mode 100644 examples/Dfp/CSharp/v201306/ContentService/GetContentByCategory.cs create mode 100644 examples/Dfp/CSharp/v201306/CreativeService/CopyImageCreatives.cs create mode 100644 examples/Dfp/CSharp/v201306/CreativeService/CreateCreativeFromTemplate.cs create mode 100644 examples/Dfp/CSharp/v201306/CreativeService/CreateCreatives.cs create mode 100644 examples/Dfp/CSharp/v201306/CreativeService/CreateCustomCreative.cs create mode 100644 examples/Dfp/CSharp/v201306/CreativeService/GetAllCreatives.cs create mode 100644 examples/Dfp/CSharp/v201306/CreativeService/GetCreative.cs create mode 100644 examples/Dfp/CSharp/v201306/CreativeService/GetCreativesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201306/CreativeService/UpdateCreatives.cs create mode 100644 examples/Dfp/CSharp/v201306/CreativeTemplateService/GetAllCreativeTemplates.cs create mode 100644 examples/Dfp/CSharp/v201306/CreativeTemplateService/GetCreativeTemplate.cs create mode 100644 examples/Dfp/CSharp/v201306/CreativeTemplateService/GetCreativeTemplatesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201306/CreativeWrapperService/CreateCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201306/CreativeWrapperService/DeactivateCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201306/CreativeWrapperService/GetActiveCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201306/CreativeWrapperService/GetAllCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201306/CreativeWrapperService/UpdateCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201306/CustomFieldService/CreateCustomFieldOptions.cs create mode 100644 examples/Dfp/CSharp/v201306/CustomFieldService/CreateCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201306/CustomFieldService/DeactivateAllLineItemCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201306/CustomFieldService/GetAllCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201306/CustomFieldService/GetAllLineItemCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201306/CustomFieldService/SetLineItemCustomFieldValue.cs create mode 100644 examples/Dfp/CSharp/v201306/CustomFieldService/UpdateCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201306/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs create mode 100644 examples/Dfp/CSharp/v201306/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs create mode 100644 examples/Dfp/CSharp/v201306/CustomTargetingService/GetCustomTargetingKeysByStatement.cs create mode 100644 examples/Dfp/CSharp/v201306/CustomTargetingService/GetCustomTargetingValuesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201306/CustomTargetingService/UpdateCustomTargetingKeys.cs create mode 100644 examples/Dfp/CSharp/v201306/CustomTargetingService/UpdateCustomTargetingValues.cs create mode 100644 examples/Dfp/CSharp/v201306/ForecastService/GetForecast.cs create mode 100644 examples/Dfp/CSharp/v201306/ForecastService/GetForecastById.cs create mode 100644 examples/Dfp/CSharp/v201306/InventoryService/CreateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201306/InventoryService/CreateMobileAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201306/InventoryService/CreateVideoAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201306/InventoryService/DeActivateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201306/InventoryService/GetAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201306/InventoryService/GetAdUnitSizes.cs create mode 100644 examples/Dfp/CSharp/v201306/InventoryService/GetAdUnitsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201306/InventoryService/GetAllAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201306/InventoryService/GetInventoryTree.cs create mode 100644 examples/Dfp/CSharp/v201306/InventoryService/UpdateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201306/LabelService/CreateLabels.cs create mode 100644 examples/Dfp/CSharp/v201306/LabelService/DeactivateActiveLabels.cs create mode 100644 examples/Dfp/CSharp/v201306/LabelService/GetAllLabels.cs create mode 100644 examples/Dfp/CSharp/v201306/LabelService/GetLabel.cs create mode 100644 examples/Dfp/CSharp/v201306/LabelService/GetLabelsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201306/LabelService/UpdateLabels.cs create mode 100644 examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/ActivateLicas.cs create mode 100644 examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/CreateLicas.cs create mode 100644 examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/DeactivateLicas.cs create mode 100644 examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/GetAllLicas.cs create mode 100644 examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/GetLica.cs create mode 100644 examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/GetLicasByStatement.cs create mode 100644 examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/UpdateLicas.cs create mode 100644 examples/Dfp/CSharp/v201306/LineItemService/ActivateLineItem.cs create mode 100644 examples/Dfp/CSharp/v201306/LineItemService/CreateLineItems.cs create mode 100644 examples/Dfp/CSharp/v201306/LineItemService/CreateMobileLineItem.cs create mode 100644 examples/Dfp/CSharp/v201306/LineItemService/CreateVideoLineItem.cs create mode 100644 examples/Dfp/CSharp/v201306/LineItemService/GetAllLineItems.cs create mode 100644 examples/Dfp/CSharp/v201306/LineItemService/GetLineItem.cs create mode 100644 examples/Dfp/CSharp/v201306/LineItemService/GetLineItemsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201306/LineItemService/GetRecentlyUpdatedLineItems.cs create mode 100644 examples/Dfp/CSharp/v201306/LineItemService/TargetCustomCriteria.cs create mode 100644 examples/Dfp/CSharp/v201306/LineItemService/UpdateLineItems.cs create mode 100644 examples/Dfp/CSharp/v201306/NetworkService/GetAllNetworks.cs create mode 100644 examples/Dfp/CSharp/v201306/NetworkService/GetCurrentNetwork.cs create mode 100644 examples/Dfp/CSharp/v201306/NetworkService/MakeTestNetwork.cs create mode 100644 examples/Dfp/CSharp/v201306/OrderService/ApproveOrder.cs create mode 100644 examples/Dfp/CSharp/v201306/OrderService/CreateOrders.cs create mode 100644 examples/Dfp/CSharp/v201306/OrderService/GetAllOrders.cs create mode 100644 examples/Dfp/CSharp/v201306/OrderService/GetOrder.cs create mode 100644 examples/Dfp/CSharp/v201306/OrderService/GetOrdersByStatement.cs create mode 100644 examples/Dfp/CSharp/v201306/OrderService/UpdateOrders.cs create mode 100644 examples/Dfp/CSharp/v201306/PlacementService/CreatePlacements.cs create mode 100644 examples/Dfp/CSharp/v201306/PlacementService/DeactivatePlacement.cs create mode 100644 examples/Dfp/CSharp/v201306/PlacementService/GetAllPlacements.cs create mode 100644 examples/Dfp/CSharp/v201306/PlacementService/GetPlacement.cs create mode 100644 examples/Dfp/CSharp/v201306/PlacementService/GetPlacementsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201306/PlacementService/UpdatePlacements.cs create mode 100644 examples/Dfp/CSharp/v201306/PublisherQueryLanguageService/GetAllCities.cs create mode 100644 examples/Dfp/CSharp/v201306/ReportService/DisplayReport.cs create mode 100644 examples/Dfp/CSharp/v201306/ReportService/DownloadReport.cs create mode 100644 examples/Dfp/CSharp/v201306/ReportService/RunDeliveryReport.cs create mode 100644 examples/Dfp/CSharp/v201306/ReportService/RunInventoryReport.cs create mode 100644 examples/Dfp/CSharp/v201306/ReportService/RunMergedDeliveryReport.cs create mode 100644 examples/Dfp/CSharp/v201306/ReportService/RunReachReport.cs create mode 100644 examples/Dfp/CSharp/v201306/ReportService/RunReportWithCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201306/ReportService/RunSalesReport.cs create mode 100644 examples/Dfp/CSharp/v201306/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201306/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201306/SuggestedAdUnitService/GetSuggestedAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201306/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs create mode 100644 examples/Dfp/CSharp/v201306/TeamService/CreateTeams.cs create mode 100644 examples/Dfp/CSharp/v201306/TeamService/GetAllTeams.cs create mode 100644 examples/Dfp/CSharp/v201306/TeamService/GetTeam.cs create mode 100644 examples/Dfp/CSharp/v201306/TeamService/GetTeamsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201306/TeamService/UpdateTeams.cs create mode 100644 examples/Dfp/CSharp/v201306/UserService/CreateUsers.cs create mode 100644 examples/Dfp/CSharp/v201306/UserService/DeactivateUser.cs create mode 100644 examples/Dfp/CSharp/v201306/UserService/GetAllRoles.cs create mode 100644 examples/Dfp/CSharp/v201306/UserService/GetAllUsers.cs create mode 100644 examples/Dfp/CSharp/v201306/UserService/GetCurrentUser.cs create mode 100644 examples/Dfp/CSharp/v201306/UserService/GetUser.cs create mode 100644 examples/Dfp/CSharp/v201306/UserService/GetUsersByStatement.cs create mode 100644 examples/Dfp/CSharp/v201306/UserService/UpdateUsers.cs create mode 100644 examples/Dfp/CSharp/v201306/UserTeamAssociationService/CreateUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201306/UserTeamAssociationService/DeleteUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201306/UserTeamAssociationService/GetAllUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201306/UserTeamAssociationService/GetUserTeamAssociation.cs create mode 100644 examples/Dfp/CSharp/v201306/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201306/UserTeamAssociationService/UpdateUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201308/ActivityGroupService/CreateActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201308/ActivityGroupService/GetActiveActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201308/ActivityGroupService/GetAllActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201308/ActivityGroupService/UpdateActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201308/ActivityService/CreateActivities.cs create mode 100644 examples/Dfp/CSharp/v201308/ActivityService/GetActiveActivities.cs create mode 100644 examples/Dfp/CSharp/v201308/ActivityService/GetAllActivities.cs create mode 100644 examples/Dfp/CSharp/v201308/ActivityService/UpdateActivities.cs create mode 100644 examples/Dfp/CSharp/v201308/AudienceSegmentService/CreateAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201308/AudienceSegmentService/GetAllAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201308/AudienceSegmentService/GetFirstPartyAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201308/AudienceSegmentService/PopulateFirstPartyAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201308/AudienceSegmentService/UpdateAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201308/CompanyService/CreateCompanies.cs create mode 100644 examples/Dfp/CSharp/v201308/CompanyService/GetAllCompanies.cs create mode 100644 examples/Dfp/CSharp/v201308/CompanyService/GetCompaniesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201308/CompanyService/GetCompany.cs create mode 100644 examples/Dfp/CSharp/v201308/CompanyService/UpdateCompanies.cs create mode 100644 examples/Dfp/CSharp/v201308/ContactService/CreateContacts.cs create mode 100644 examples/Dfp/CSharp/v201308/ContactService/GetAllContacts.cs create mode 100644 examples/Dfp/CSharp/v201308/ContactService/GetUninvitedContacts.cs create mode 100644 examples/Dfp/CSharp/v201308/ContactService/UpdateContacts.cs create mode 100644 examples/Dfp/CSharp/v201308/ContentService/GetAllContent.cs create mode 100644 examples/Dfp/CSharp/v201308/ContentService/GetContentByCategory.cs create mode 100644 examples/Dfp/CSharp/v201308/CreativeService/CopyImageCreatives.cs create mode 100644 examples/Dfp/CSharp/v201308/CreativeService/CreateCreativeFromTemplate.cs create mode 100644 examples/Dfp/CSharp/v201308/CreativeService/CreateCreatives.cs create mode 100644 examples/Dfp/CSharp/v201308/CreativeService/CreateCustomCreative.cs create mode 100644 examples/Dfp/CSharp/v201308/CreativeService/GetAllCreatives.cs create mode 100644 examples/Dfp/CSharp/v201308/CreativeService/GetCreative.cs create mode 100644 examples/Dfp/CSharp/v201308/CreativeService/GetCreativesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201308/CreativeService/UpdateCreatives.cs create mode 100644 examples/Dfp/CSharp/v201308/CreativeTemplateService/GetAllCreativeTemplates.cs create mode 100644 examples/Dfp/CSharp/v201308/CreativeTemplateService/GetCreativeTemplate.cs create mode 100644 examples/Dfp/CSharp/v201308/CreativeTemplateService/GetCreativeTemplatesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201308/CreativeWrapperService/CreateCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201308/CreativeWrapperService/DeactivateCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201308/CreativeWrapperService/GetActiveCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201308/CreativeWrapperService/GetAllCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201308/CreativeWrapperService/UpdateCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201308/CustomFieldService/CreateCustomFieldOptions.cs create mode 100644 examples/Dfp/CSharp/v201308/CustomFieldService/CreateCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201308/CustomFieldService/DeactivateAllLineItemCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201308/CustomFieldService/GetAllCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201308/CustomFieldService/GetAllLineItemCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201308/CustomFieldService/SetLineItemCustomFieldValue.cs create mode 100644 examples/Dfp/CSharp/v201308/CustomFieldService/UpdateCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201308/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs create mode 100644 examples/Dfp/CSharp/v201308/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs create mode 100644 examples/Dfp/CSharp/v201308/CustomTargetingService/GetCustomTargetingKeysByStatement.cs create mode 100644 examples/Dfp/CSharp/v201308/CustomTargetingService/GetCustomTargetingValuesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201308/CustomTargetingService/UpdateCustomTargetingKeys.cs create mode 100644 examples/Dfp/CSharp/v201308/CustomTargetingService/UpdateCustomTargetingValues.cs create mode 100644 examples/Dfp/CSharp/v201308/ForecastService/GetForecast.cs create mode 100644 examples/Dfp/CSharp/v201308/ForecastService/GetForecastById.cs create mode 100644 examples/Dfp/CSharp/v201308/InventoryService/CreateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201308/InventoryService/CreateMobileAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201308/InventoryService/CreateVideoAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201308/InventoryService/DeActivateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201308/InventoryService/GetAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201308/InventoryService/GetAdUnitSizes.cs create mode 100644 examples/Dfp/CSharp/v201308/InventoryService/GetAdUnitsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201308/InventoryService/GetAllAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201308/InventoryService/GetInventoryTree.cs create mode 100644 examples/Dfp/CSharp/v201308/InventoryService/UpdateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201308/LabelService/CreateLabels.cs create mode 100644 examples/Dfp/CSharp/v201308/LabelService/DeactivateActiveLabels.cs create mode 100644 examples/Dfp/CSharp/v201308/LabelService/GetAllLabels.cs create mode 100644 examples/Dfp/CSharp/v201308/LabelService/GetLabel.cs create mode 100644 examples/Dfp/CSharp/v201308/LabelService/GetLabelsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201308/LabelService/UpdateLabels.cs create mode 100644 examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/ActivateLicas.cs create mode 100644 examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/CreateLicas.cs create mode 100644 examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/DeactivateLicas.cs create mode 100644 examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/GetAllLicas.cs create mode 100644 examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/GetLica.cs create mode 100644 examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/GetLicasByStatement.cs create mode 100644 examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/UpdateLicas.cs create mode 100644 examples/Dfp/CSharp/v201308/LineItemService/ActivateLineItem.cs create mode 100644 examples/Dfp/CSharp/v201308/LineItemService/CreateLineItems.cs create mode 100644 examples/Dfp/CSharp/v201308/LineItemService/CreateMobileLineItem.cs create mode 100644 examples/Dfp/CSharp/v201308/LineItemService/CreateVideoLineItem.cs create mode 100644 examples/Dfp/CSharp/v201308/LineItemService/GetAllLineItems.cs create mode 100644 examples/Dfp/CSharp/v201308/LineItemService/GetLineItem.cs create mode 100644 examples/Dfp/CSharp/v201308/LineItemService/GetLineItemsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201308/LineItemService/GetRecentlyUpdatedLineItems.cs create mode 100644 examples/Dfp/CSharp/v201308/LineItemService/TargetCustomCriteria.cs create mode 100644 examples/Dfp/CSharp/v201308/LineItemService/UpdateLineItems.cs create mode 100644 examples/Dfp/CSharp/v201308/NetworkService/GetAllNetworks.cs create mode 100644 examples/Dfp/CSharp/v201308/NetworkService/GetCurrentNetwork.cs create mode 100644 examples/Dfp/CSharp/v201308/NetworkService/MakeTestNetwork.cs create mode 100644 examples/Dfp/CSharp/v201308/OrderService/ApproveOrder.cs create mode 100644 examples/Dfp/CSharp/v201308/OrderService/CreateOrders.cs create mode 100644 examples/Dfp/CSharp/v201308/OrderService/GetAllOrders.cs create mode 100644 examples/Dfp/CSharp/v201308/OrderService/GetOrder.cs create mode 100644 examples/Dfp/CSharp/v201308/OrderService/GetOrdersByStatement.cs create mode 100644 examples/Dfp/CSharp/v201308/OrderService/UpdateOrders.cs create mode 100644 examples/Dfp/CSharp/v201308/PlacementService/CreatePlacements.cs create mode 100644 examples/Dfp/CSharp/v201308/PlacementService/DeactivatePlacement.cs create mode 100644 examples/Dfp/CSharp/v201308/PlacementService/GetAllPlacements.cs create mode 100644 examples/Dfp/CSharp/v201308/PlacementService/GetPlacement.cs create mode 100644 examples/Dfp/CSharp/v201308/PlacementService/GetPlacementsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201308/PlacementService/UpdatePlacements.cs create mode 100644 examples/Dfp/CSharp/v201308/PublisherQueryLanguageService/GetAllLineItemsUsingPql.cs create mode 100644 examples/Dfp/CSharp/v201308/PublisherQueryLanguageService/GetGeoTargets.cs create mode 100644 examples/Dfp/CSharp/v201308/PublisherQueryLanguageService/GetLineItemsNamedLike.cs create mode 100644 examples/Dfp/CSharp/v201308/ReportService/DisplayReport.cs create mode 100644 examples/Dfp/CSharp/v201308/ReportService/DownloadReport.cs create mode 100644 examples/Dfp/CSharp/v201308/ReportService/RunDeliveryReport.cs create mode 100644 examples/Dfp/CSharp/v201308/ReportService/RunInventoryReport.cs create mode 100644 examples/Dfp/CSharp/v201308/ReportService/RunMergedDeliveryReport.cs create mode 100644 examples/Dfp/CSharp/v201308/ReportService/RunReachReport.cs create mode 100644 examples/Dfp/CSharp/v201308/ReportService/RunReportWithCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201308/ReportService/RunSalesReport.cs create mode 100644 examples/Dfp/CSharp/v201308/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201308/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201308/SuggestedAdUnitService/GetSuggestedAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201308/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs create mode 100644 examples/Dfp/CSharp/v201308/TeamService/CreateTeams.cs create mode 100644 examples/Dfp/CSharp/v201308/TeamService/GetAllTeams.cs create mode 100644 examples/Dfp/CSharp/v201308/TeamService/GetTeam.cs create mode 100644 examples/Dfp/CSharp/v201308/TeamService/GetTeamsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201308/TeamService/UpdateTeams.cs create mode 100644 examples/Dfp/CSharp/v201308/UserService/CreateUsers.cs create mode 100644 examples/Dfp/CSharp/v201308/UserService/DeactivateUser.cs create mode 100644 examples/Dfp/CSharp/v201308/UserService/GetAllRoles.cs create mode 100644 examples/Dfp/CSharp/v201308/UserService/GetAllUsers.cs create mode 100644 examples/Dfp/CSharp/v201308/UserService/GetCurrentUser.cs create mode 100644 examples/Dfp/CSharp/v201308/UserService/GetUser.cs create mode 100644 examples/Dfp/CSharp/v201308/UserService/GetUsersByStatement.cs create mode 100644 examples/Dfp/CSharp/v201308/UserService/UpdateUsers.cs create mode 100644 examples/Dfp/CSharp/v201308/UserTeamAssociationService/CreateUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201308/UserTeamAssociationService/DeleteUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201308/UserTeamAssociationService/GetAllUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201308/UserTeamAssociationService/GetUserTeamAssociation.cs create mode 100644 examples/Dfp/CSharp/v201308/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201308/UserTeamAssociationService/UpdateUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201311/ActivityGroupService/CreateActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201311/ActivityGroupService/GetActiveActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201311/ActivityGroupService/GetAllActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201311/ActivityGroupService/UpdateActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201311/ActivityService/CreateActivities.cs create mode 100644 examples/Dfp/CSharp/v201311/ActivityService/GetActiveActivities.cs create mode 100644 examples/Dfp/CSharp/v201311/ActivityService/GetAllActivities.cs create mode 100644 examples/Dfp/CSharp/v201311/ActivityService/UpdateActivities.cs create mode 100644 examples/Dfp/CSharp/v201311/AudienceSegmentService/CreateAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201311/AudienceSegmentService/GetAllAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201311/AudienceSegmentService/GetFirstPartyAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201311/AudienceSegmentService/PopulateFirstPartyAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201311/AudienceSegmentService/UpdateAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201311/CompanyService/CreateCompanies.cs create mode 100644 examples/Dfp/CSharp/v201311/CompanyService/GetAllCompanies.cs create mode 100644 examples/Dfp/CSharp/v201311/CompanyService/GetCompaniesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201311/CompanyService/GetCompany.cs create mode 100644 examples/Dfp/CSharp/v201311/CompanyService/UpdateCompanies.cs create mode 100644 examples/Dfp/CSharp/v201311/ContactService/CreateContacts.cs create mode 100644 examples/Dfp/CSharp/v201311/ContactService/GetAllContacts.cs create mode 100644 examples/Dfp/CSharp/v201311/ContactService/GetUninvitedContacts.cs create mode 100644 examples/Dfp/CSharp/v201311/ContactService/UpdateContacts.cs create mode 100644 examples/Dfp/CSharp/v201311/ContentService/GetAllContent.cs create mode 100644 examples/Dfp/CSharp/v201311/ContentService/GetContentByCategory.cs create mode 100644 examples/Dfp/CSharp/v201311/CreativeService/CopyImageCreatives.cs create mode 100644 examples/Dfp/CSharp/v201311/CreativeService/CreateCreativeFromTemplate.cs create mode 100644 examples/Dfp/CSharp/v201311/CreativeService/CreateCreatives.cs create mode 100644 examples/Dfp/CSharp/v201311/CreativeService/CreateCustomCreative.cs create mode 100644 examples/Dfp/CSharp/v201311/CreativeService/GetAllCreatives.cs create mode 100644 examples/Dfp/CSharp/v201311/CreativeService/GetCreative.cs create mode 100644 examples/Dfp/CSharp/v201311/CreativeService/GetCreativesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201311/CreativeService/UpdateCreatives.cs create mode 100644 examples/Dfp/CSharp/v201311/CreativeTemplateService/GetAllCreativeTemplates.cs create mode 100644 examples/Dfp/CSharp/v201311/CreativeTemplateService/GetCreativeTemplate.cs create mode 100644 examples/Dfp/CSharp/v201311/CreativeTemplateService/GetCreativeTemplatesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201311/CreativeWrapperService/CreateCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201311/CreativeWrapperService/DeactivateCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201311/CreativeWrapperService/GetActiveCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201311/CreativeWrapperService/GetAllCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201311/CreativeWrapperService/UpdateCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201311/CustomFieldService/CreateCustomFieldOptions.cs create mode 100644 examples/Dfp/CSharp/v201311/CustomFieldService/CreateCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201311/CustomFieldService/DeactivateAllLineItemCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201311/CustomFieldService/GetAllCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201311/CustomFieldService/GetAllLineItemCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201311/CustomFieldService/SetLineItemCustomFieldValue.cs create mode 100644 examples/Dfp/CSharp/v201311/CustomFieldService/UpdateCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201311/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs create mode 100644 examples/Dfp/CSharp/v201311/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs create mode 100644 examples/Dfp/CSharp/v201311/CustomTargetingService/GetCustomTargetingKeysByStatement.cs create mode 100644 examples/Dfp/CSharp/v201311/CustomTargetingService/GetCustomTargetingValuesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201311/CustomTargetingService/UpdateCustomTargetingKeys.cs create mode 100644 examples/Dfp/CSharp/v201311/CustomTargetingService/UpdateCustomTargetingValues.cs create mode 100644 examples/Dfp/CSharp/v201311/ForecastService/GetForecast.cs create mode 100644 examples/Dfp/CSharp/v201311/ForecastService/GetForecastById.cs create mode 100644 examples/Dfp/CSharp/v201311/InventoryService/CreateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201311/InventoryService/CreateMobileAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201311/InventoryService/CreateVideoAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201311/InventoryService/DeActivateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201311/InventoryService/GetAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201311/InventoryService/GetAdUnitSizes.cs create mode 100644 examples/Dfp/CSharp/v201311/InventoryService/GetAdUnitsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201311/InventoryService/GetAllAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201311/InventoryService/GetInventoryTree.cs create mode 100644 examples/Dfp/CSharp/v201311/InventoryService/UpdateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201311/LabelService/CreateLabels.cs create mode 100644 examples/Dfp/CSharp/v201311/LabelService/DeactivateActiveLabels.cs create mode 100644 examples/Dfp/CSharp/v201311/LabelService/GetAllLabels.cs create mode 100644 examples/Dfp/CSharp/v201311/LabelService/GetLabel.cs create mode 100644 examples/Dfp/CSharp/v201311/LabelService/GetLabelsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201311/LabelService/UpdateLabels.cs create mode 100644 examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/ActivateLicas.cs create mode 100644 examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/CreateLicas.cs create mode 100644 examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/DeactivateLicas.cs create mode 100644 examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/GetAllLicas.cs create mode 100644 examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/GetLica.cs create mode 100644 examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/GetLicasByStatement.cs create mode 100644 examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/UpdateLicas.cs create mode 100644 examples/Dfp/CSharp/v201311/LineItemService/ActivateLineItem.cs create mode 100644 examples/Dfp/CSharp/v201311/LineItemService/CreateLineItems.cs create mode 100644 examples/Dfp/CSharp/v201311/LineItemService/CreateMobileLineItem.cs create mode 100644 examples/Dfp/CSharp/v201311/LineItemService/CreateVideoLineItem.cs create mode 100644 examples/Dfp/CSharp/v201311/LineItemService/GetAllLineItems.cs create mode 100644 examples/Dfp/CSharp/v201311/LineItemService/GetLineItem.cs create mode 100644 examples/Dfp/CSharp/v201311/LineItemService/GetLineItemsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201311/LineItemService/GetRecentlyUpdatedLineItems.cs create mode 100644 examples/Dfp/CSharp/v201311/LineItemService/TargetCustomCriteria.cs create mode 100644 examples/Dfp/CSharp/v201311/LineItemService/UpdateLineItems.cs create mode 100644 examples/Dfp/CSharp/v201311/NetworkService/GetAllNetworks.cs create mode 100644 examples/Dfp/CSharp/v201311/NetworkService/GetCurrentNetwork.cs create mode 100644 examples/Dfp/CSharp/v201311/NetworkService/MakeTestNetwork.cs create mode 100644 examples/Dfp/CSharp/v201311/OrderService/ApproveOrder.cs create mode 100644 examples/Dfp/CSharp/v201311/OrderService/CreateOrders.cs create mode 100644 examples/Dfp/CSharp/v201311/OrderService/GetAllOrders.cs create mode 100644 examples/Dfp/CSharp/v201311/OrderService/GetOrder.cs create mode 100644 examples/Dfp/CSharp/v201311/OrderService/GetOrdersByStatement.cs create mode 100644 examples/Dfp/CSharp/v201311/OrderService/UpdateOrders.cs create mode 100644 examples/Dfp/CSharp/v201311/PlacementService/CreatePlacements.cs create mode 100644 examples/Dfp/CSharp/v201311/PlacementService/DeactivatePlacement.cs create mode 100644 examples/Dfp/CSharp/v201311/PlacementService/GetAllPlacements.cs create mode 100644 examples/Dfp/CSharp/v201311/PlacementService/GetPlacement.cs create mode 100644 examples/Dfp/CSharp/v201311/PlacementService/GetPlacementsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201311/PlacementService/UpdatePlacements.cs create mode 100644 examples/Dfp/CSharp/v201311/PublisherQueryLanguageService/FetchMatchTables.cs create mode 100644 examples/Dfp/CSharp/v201311/PublisherQueryLanguageService/GetAllLineItemsUsingPql.cs create mode 100644 examples/Dfp/CSharp/v201311/PublisherQueryLanguageService/GetGeoTargets.cs create mode 100644 examples/Dfp/CSharp/v201311/PublisherQueryLanguageService/GetLineItemsNamedLike.cs create mode 100644 examples/Dfp/CSharp/v201311/ReportService/DisplayReport.cs create mode 100644 examples/Dfp/CSharp/v201311/ReportService/DownloadReport.cs create mode 100644 examples/Dfp/CSharp/v201311/ReportService/RunDeliveryReport.cs create mode 100644 examples/Dfp/CSharp/v201311/ReportService/RunInventoryReport.cs create mode 100644 examples/Dfp/CSharp/v201311/ReportService/RunMergedDeliveryReport.cs create mode 100644 examples/Dfp/CSharp/v201311/ReportService/RunReachReport.cs create mode 100644 examples/Dfp/CSharp/v201311/ReportService/RunReportWithCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201311/ReportService/RunSalesReport.cs create mode 100644 examples/Dfp/CSharp/v201311/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201311/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201311/SuggestedAdUnitService/GetSuggestedAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201311/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs create mode 100644 examples/Dfp/CSharp/v201311/TeamService/CreateTeams.cs create mode 100644 examples/Dfp/CSharp/v201311/TeamService/GetAllTeams.cs create mode 100644 examples/Dfp/CSharp/v201311/TeamService/GetTeam.cs create mode 100644 examples/Dfp/CSharp/v201311/TeamService/GetTeamsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201311/TeamService/UpdateTeams.cs create mode 100644 examples/Dfp/CSharp/v201311/UserService/CreateUsers.cs create mode 100644 examples/Dfp/CSharp/v201311/UserService/DeactivateUser.cs create mode 100644 examples/Dfp/CSharp/v201311/UserService/GetAllRoles.cs create mode 100644 examples/Dfp/CSharp/v201311/UserService/GetAllUsers.cs create mode 100644 examples/Dfp/CSharp/v201311/UserService/GetCurrentUser.cs create mode 100644 examples/Dfp/CSharp/v201311/UserService/GetUser.cs create mode 100644 examples/Dfp/CSharp/v201311/UserService/GetUsersByStatement.cs create mode 100644 examples/Dfp/CSharp/v201311/UserService/UpdateUsers.cs create mode 100644 examples/Dfp/CSharp/v201311/UserTeamAssociationService/CreateUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201311/UserTeamAssociationService/DeleteUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201311/UserTeamAssociationService/GetAllUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201311/UserTeamAssociationService/GetUserTeamAssociation.cs create mode 100644 examples/Dfp/CSharp/v201311/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201311/UserTeamAssociationService/UpdateUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201403/ActivityGroupService/CreateActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201403/ActivityGroupService/GetActiveActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201403/ActivityGroupService/GetAllActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201403/ActivityGroupService/UpdateActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201403/ActivityService/CreateActivities.cs create mode 100644 examples/Dfp/CSharp/v201403/ActivityService/GetActiveActivities.cs create mode 100644 examples/Dfp/CSharp/v201403/ActivityService/GetAllActivities.cs create mode 100644 examples/Dfp/CSharp/v201403/ActivityService/UpdateActivities.cs create mode 100644 examples/Dfp/CSharp/v201403/AudienceSegmentService/CreateAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201403/AudienceSegmentService/GetAllAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201403/AudienceSegmentService/GetFirstPartyAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201403/AudienceSegmentService/PopulateFirstPartyAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201403/AudienceSegmentService/UpdateAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201403/CompanyService/CreateCompanies.cs create mode 100644 examples/Dfp/CSharp/v201403/CompanyService/GetAllCompanies.cs create mode 100644 examples/Dfp/CSharp/v201403/CompanyService/GetCompaniesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201403/CompanyService/UpdateCompanies.cs create mode 100644 examples/Dfp/CSharp/v201403/ContactService/CreateContacts.cs create mode 100644 examples/Dfp/CSharp/v201403/ContactService/GetAllContacts.cs create mode 100644 examples/Dfp/CSharp/v201403/ContactService/GetUninvitedContacts.cs create mode 100644 examples/Dfp/CSharp/v201403/ContactService/UpdateContacts.cs create mode 100644 examples/Dfp/CSharp/v201403/ContentMetadataKeyHierarchyService/CreateContentMetadataKeyHierarchies.cs create mode 100644 examples/Dfp/CSharp/v201403/ContentMetadataKeyHierarchyService/DeleteContentMetadataKeyHierarchies.cs create mode 100644 examples/Dfp/CSharp/v201403/ContentMetadataKeyHierarchyService/GetAllContentMetadataKeyHierarchies.cs create mode 100644 examples/Dfp/CSharp/v201403/ContentMetadataKeyHierarchyService/UpdateContentMetadataKeyHierarchies.cs create mode 100644 examples/Dfp/CSharp/v201403/ContentService/GetAllContent.cs create mode 100644 examples/Dfp/CSharp/v201403/ContentService/GetContentByCategory.cs create mode 100644 examples/Dfp/CSharp/v201403/CreativeService/CopyImageCreatives.cs create mode 100644 examples/Dfp/CSharp/v201403/CreativeService/CreateCreativeFromTemplate.cs create mode 100644 examples/Dfp/CSharp/v201403/CreativeService/CreateCreatives.cs create mode 100644 examples/Dfp/CSharp/v201403/CreativeService/CreateCustomCreative.cs create mode 100644 examples/Dfp/CSharp/v201403/CreativeService/GetAllCreatives.cs create mode 100644 examples/Dfp/CSharp/v201403/CreativeService/GetCreativesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201403/CreativeService/UpdateCreatives.cs create mode 100644 examples/Dfp/CSharp/v201403/CreativeTemplateService/GetAllCreativeTemplates.cs create mode 100644 examples/Dfp/CSharp/v201403/CreativeTemplateService/GetCreativeTemplatesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201403/CreativeWrapperService/CreateCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201403/CreativeWrapperService/DeactivateCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201403/CreativeWrapperService/GetActiveCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201403/CreativeWrapperService/GetAllCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201403/CreativeWrapperService/UpdateCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201403/CustomFieldService/CreateCustomFieldOptions.cs create mode 100644 examples/Dfp/CSharp/v201403/CustomFieldService/CreateCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201403/CustomFieldService/DeactivateCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201403/CustomFieldService/GetAllCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201403/CustomFieldService/GetAllLineItemCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201403/CustomFieldService/SetLineItemCustomFieldValue.cs create mode 100644 examples/Dfp/CSharp/v201403/CustomFieldService/UpdateCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201403/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs create mode 100644 examples/Dfp/CSharp/v201403/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs create mode 100644 examples/Dfp/CSharp/v201403/CustomTargetingService/GetCustomTargetingKeysByStatement.cs create mode 100644 examples/Dfp/CSharp/v201403/CustomTargetingService/GetCustomTargetingValuesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201403/CustomTargetingService/UpdateCustomTargetingKeys.cs create mode 100644 examples/Dfp/CSharp/v201403/CustomTargetingService/UpdateCustomTargetingValues.cs create mode 100644 examples/Dfp/CSharp/v201403/ForecastService/GetForecast.cs create mode 100644 examples/Dfp/CSharp/v201403/ForecastService/GetForecastById.cs create mode 100644 examples/Dfp/CSharp/v201403/InventoryService/CreateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201403/InventoryService/CreateMobileAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201403/InventoryService/CreateVideoAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201403/InventoryService/DeActivateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201403/InventoryService/GetAdUnitSizes.cs create mode 100644 examples/Dfp/CSharp/v201403/InventoryService/GetAdUnitsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201403/InventoryService/GetAllAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201403/InventoryService/GetInventoryTree.cs create mode 100644 examples/Dfp/CSharp/v201403/InventoryService/UpdateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201403/LabelService/CreateLabels.cs create mode 100644 examples/Dfp/CSharp/v201403/LabelService/DeactivateActiveLabels.cs create mode 100644 examples/Dfp/CSharp/v201403/LabelService/GetAllLabels.cs create mode 100644 examples/Dfp/CSharp/v201403/LabelService/GetLabelsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201403/LabelService/UpdateLabels.cs create mode 100644 examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/ActivateLicas.cs create mode 100644 examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/CreateLicas.cs create mode 100644 examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/DeactivateLicas.cs create mode 100644 examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/GetAllLicas.cs create mode 100644 examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/GetLicasByStatement.cs create mode 100644 examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/UpdateLicas.cs create mode 100644 examples/Dfp/CSharp/v201403/LineItemService/ActivateLineItem.cs create mode 100644 examples/Dfp/CSharp/v201403/LineItemService/CreateLineItems.cs create mode 100644 examples/Dfp/CSharp/v201403/LineItemService/CreateMobileLineItem.cs create mode 100644 examples/Dfp/CSharp/v201403/LineItemService/CreateVideoLineItem.cs create mode 100644 examples/Dfp/CSharp/v201403/LineItemService/GetAllLineItems.cs create mode 100644 examples/Dfp/CSharp/v201403/LineItemService/GetLineItemsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201403/LineItemService/GetRecentlyUpdatedLineItems.cs create mode 100644 examples/Dfp/CSharp/v201403/LineItemService/TargetCustomCriteria.cs create mode 100644 examples/Dfp/CSharp/v201403/LineItemService/UpdateLineItems.cs create mode 100644 examples/Dfp/CSharp/v201403/NetworkService/GetAllNetworks.cs create mode 100644 examples/Dfp/CSharp/v201403/NetworkService/GetCurrentNetwork.cs create mode 100644 examples/Dfp/CSharp/v201403/NetworkService/MakeTestNetwork.cs create mode 100644 examples/Dfp/CSharp/v201403/OrderService/ApproveOrder.cs create mode 100644 examples/Dfp/CSharp/v201403/OrderService/CreateOrders.cs create mode 100644 examples/Dfp/CSharp/v201403/OrderService/GetAllOrders.cs create mode 100644 examples/Dfp/CSharp/v201403/OrderService/GetOrdersByStatement.cs create mode 100644 examples/Dfp/CSharp/v201403/OrderService/UpdateOrders.cs create mode 100644 examples/Dfp/CSharp/v201403/PlacementService/CreatePlacements.cs create mode 100644 examples/Dfp/CSharp/v201403/PlacementService/DeactivatePlacement.cs create mode 100644 examples/Dfp/CSharp/v201403/PlacementService/GetAllPlacements.cs create mode 100644 examples/Dfp/CSharp/v201403/PlacementService/GetPlacementsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201403/PlacementService/UpdatePlacements.cs create mode 100644 examples/Dfp/CSharp/v201403/PublisherQueryLanguageService/FetchMatchTables.cs create mode 100644 examples/Dfp/CSharp/v201403/PublisherQueryLanguageService/GetAllLineItemsUsingPql.cs create mode 100644 examples/Dfp/CSharp/v201403/PublisherQueryLanguageService/GetGeoTargets.cs create mode 100644 examples/Dfp/CSharp/v201403/PublisherQueryLanguageService/GetLineItemsNamedLike.cs create mode 100644 examples/Dfp/CSharp/v201403/ReportService/DisplayReport.cs create mode 100644 examples/Dfp/CSharp/v201403/ReportService/DownloadReport.cs create mode 100644 examples/Dfp/CSharp/v201403/ReportService/RunDeliveryReport.cs create mode 100644 examples/Dfp/CSharp/v201403/ReportService/RunInventoryReport.cs create mode 100644 examples/Dfp/CSharp/v201403/ReportService/RunMergedDeliveryReport.cs create mode 100644 examples/Dfp/CSharp/v201403/ReportService/RunReachReport.cs create mode 100644 examples/Dfp/CSharp/v201403/ReportService/RunReportWithCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201403/ReportService/RunSalesReport.cs create mode 100644 examples/Dfp/CSharp/v201403/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201403/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201403/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs create mode 100644 examples/Dfp/CSharp/v201403/TeamService/CreateTeams.cs create mode 100644 examples/Dfp/CSharp/v201403/TeamService/GetAllTeams.cs create mode 100644 examples/Dfp/CSharp/v201403/TeamService/GetTeamsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201403/TeamService/UpdateTeams.cs create mode 100644 examples/Dfp/CSharp/v201403/UserService/CreateUsers.cs create mode 100644 examples/Dfp/CSharp/v201403/UserService/DeactivateUser.cs create mode 100644 examples/Dfp/CSharp/v201403/UserService/GetAllRoles.cs create mode 100644 examples/Dfp/CSharp/v201403/UserService/GetAllUsers.cs create mode 100644 examples/Dfp/CSharp/v201403/UserService/GetCurrentUser.cs create mode 100644 examples/Dfp/CSharp/v201403/UserService/GetUsersByStatement.cs create mode 100644 examples/Dfp/CSharp/v201403/UserService/UpdateUsers.cs create mode 100644 examples/Dfp/CSharp/v201403/UserTeamAssociationService/CreateUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201403/UserTeamAssociationService/DeleteUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201403/UserTeamAssociationService/GetAllUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201403/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201403/UserTeamAssociationService/UpdateUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201405/ActivityGroupService/CreateActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201405/ActivityGroupService/GetActiveActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201405/ActivityGroupService/GetAllActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201405/ActivityGroupService/UpdateActivityGroups.cs create mode 100644 examples/Dfp/CSharp/v201405/ActivityService/CreateActivities.cs create mode 100644 examples/Dfp/CSharp/v201405/ActivityService/GetActiveActivities.cs create mode 100644 examples/Dfp/CSharp/v201405/ActivityService/GetAllActivities.cs create mode 100644 examples/Dfp/CSharp/v201405/ActivityService/UpdateActivities.cs create mode 100644 examples/Dfp/CSharp/v201405/AudienceSegmentService/CreateAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201405/AudienceSegmentService/GetAllAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201405/AudienceSegmentService/GetFirstPartyAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201405/AudienceSegmentService/PopulateFirstPartyAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201405/AudienceSegmentService/UpdateAudienceSegments.cs create mode 100644 examples/Dfp/CSharp/v201405/CompanyService/CreateCompanies.cs create mode 100644 examples/Dfp/CSharp/v201405/CompanyService/GetAllCompanies.cs create mode 100644 examples/Dfp/CSharp/v201405/CompanyService/GetCompaniesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201405/CompanyService/UpdateCompanies.cs create mode 100644 examples/Dfp/CSharp/v201405/ContactService/CreateContacts.cs create mode 100644 examples/Dfp/CSharp/v201405/ContactService/GetAllContacts.cs create mode 100644 examples/Dfp/CSharp/v201405/ContactService/GetUninvitedContacts.cs create mode 100644 examples/Dfp/CSharp/v201405/ContactService/UpdateContacts.cs create mode 100644 examples/Dfp/CSharp/v201405/ContentMetadataKeyHierarchyService/CreateContentMetadataKeyHierarchies.cs create mode 100644 examples/Dfp/CSharp/v201405/ContentMetadataKeyHierarchyService/DeleteContentMetadataKeyHierarchies.cs create mode 100644 examples/Dfp/CSharp/v201405/ContentMetadataKeyHierarchyService/GetAllContentMetadataKeyHierarchies.cs create mode 100644 examples/Dfp/CSharp/v201405/ContentMetadataKeyHierarchyService/UpdateContentMetadataKeyHierarchies.cs create mode 100644 examples/Dfp/CSharp/v201405/ContentService/GetAllContent.cs create mode 100644 examples/Dfp/CSharp/v201405/ContentService/GetContentByCategory.cs create mode 100644 examples/Dfp/CSharp/v201405/CreativeService/CopyImageCreatives.cs create mode 100644 examples/Dfp/CSharp/v201405/CreativeService/CreateCreativeFromTemplate.cs create mode 100644 examples/Dfp/CSharp/v201405/CreativeService/CreateCreatives.cs create mode 100644 examples/Dfp/CSharp/v201405/CreativeService/CreateCustomCreative.cs create mode 100644 examples/Dfp/CSharp/v201405/CreativeService/GetAllCreatives.cs create mode 100644 examples/Dfp/CSharp/v201405/CreativeService/GetCreativesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201405/CreativeService/UpdateCreatives.cs create mode 100644 examples/Dfp/CSharp/v201405/CreativeTemplateService/GetAllCreativeTemplates.cs create mode 100644 examples/Dfp/CSharp/v201405/CreativeTemplateService/GetCreativeTemplatesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201405/CreativeWrapperService/CreateCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201405/CreativeWrapperService/DeactivateCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201405/CreativeWrapperService/GetActiveCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201405/CreativeWrapperService/GetAllCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201405/CreativeWrapperService/UpdateCreativeWrappers.cs create mode 100644 examples/Dfp/CSharp/v201405/CustomFieldService/CreateCustomFieldOptions.cs create mode 100644 examples/Dfp/CSharp/v201405/CustomFieldService/CreateCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201405/CustomFieldService/DeactivateCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201405/CustomFieldService/GetAllCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201405/CustomFieldService/GetAllLineItemCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201405/CustomFieldService/SetLineItemCustomFieldValue.cs create mode 100644 examples/Dfp/CSharp/v201405/CustomFieldService/UpdateCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201405/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs create mode 100644 examples/Dfp/CSharp/v201405/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs create mode 100644 examples/Dfp/CSharp/v201405/CustomTargetingService/GetCustomTargetingKeysByStatement.cs create mode 100644 examples/Dfp/CSharp/v201405/CustomTargetingService/GetCustomTargetingValuesByStatement.cs create mode 100644 examples/Dfp/CSharp/v201405/CustomTargetingService/UpdateCustomTargetingKeys.cs create mode 100644 examples/Dfp/CSharp/v201405/CustomTargetingService/UpdateCustomTargetingValues.cs create mode 100644 examples/Dfp/CSharp/v201405/ForecastService/GetForecast.cs create mode 100644 examples/Dfp/CSharp/v201405/ForecastService/GetForecastById.cs create mode 100644 examples/Dfp/CSharp/v201405/InventoryService/CreateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201405/InventoryService/CreateMobileAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201405/InventoryService/CreateVideoAdUnit.cs create mode 100644 examples/Dfp/CSharp/v201405/InventoryService/DeActivateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201405/InventoryService/GetAdUnitSizes.cs create mode 100644 examples/Dfp/CSharp/v201405/InventoryService/GetAdUnitsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201405/InventoryService/GetAllAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201405/InventoryService/GetInventoryTree.cs create mode 100644 examples/Dfp/CSharp/v201405/InventoryService/UpdateAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201405/LabelService/CreateLabels.cs create mode 100644 examples/Dfp/CSharp/v201405/LabelService/DeactivateActiveLabels.cs create mode 100644 examples/Dfp/CSharp/v201405/LabelService/GetAllLabels.cs create mode 100644 examples/Dfp/CSharp/v201405/LabelService/GetLabelsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201405/LabelService/UpdateLabels.cs create mode 100644 examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/ActivateLicas.cs create mode 100644 examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/CreateLicas.cs create mode 100644 examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/DeactivateLicas.cs create mode 100644 examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/GetAllLicas.cs create mode 100644 examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/GetLicasByStatement.cs create mode 100644 examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/UpdateLicas.cs create mode 100644 examples/Dfp/CSharp/v201405/LineItemService/ActivateLineItem.cs create mode 100644 examples/Dfp/CSharp/v201405/LineItemService/CreateLineItems.cs create mode 100644 examples/Dfp/CSharp/v201405/LineItemService/CreateVideoLineItem.cs create mode 100644 examples/Dfp/CSharp/v201405/LineItemService/GetAllLineItems.cs create mode 100644 examples/Dfp/CSharp/v201405/LineItemService/GetLineItemsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201405/LineItemService/GetRecentlyUpdatedLineItems.cs create mode 100644 examples/Dfp/CSharp/v201405/LineItemService/TargetCustomCriteria.cs create mode 100644 examples/Dfp/CSharp/v201405/LineItemService/UpdateLineItems.cs create mode 100644 examples/Dfp/CSharp/v201405/NetworkService/GetAllNetworks.cs create mode 100644 examples/Dfp/CSharp/v201405/NetworkService/GetCurrentNetwork.cs create mode 100644 examples/Dfp/CSharp/v201405/NetworkService/MakeTestNetwork.cs create mode 100644 examples/Dfp/CSharp/v201405/OrderService/ApproveOrder.cs create mode 100644 examples/Dfp/CSharp/v201405/OrderService/CreateOrders.cs create mode 100644 examples/Dfp/CSharp/v201405/OrderService/GetAllOrders.cs create mode 100644 examples/Dfp/CSharp/v201405/OrderService/GetOrdersByStatement.cs create mode 100644 examples/Dfp/CSharp/v201405/OrderService/UpdateOrders.cs create mode 100644 examples/Dfp/CSharp/v201405/PlacementService/CreatePlacements.cs create mode 100644 examples/Dfp/CSharp/v201405/PlacementService/DeactivatePlacement.cs create mode 100644 examples/Dfp/CSharp/v201405/PlacementService/GetAllPlacements.cs create mode 100644 examples/Dfp/CSharp/v201405/PlacementService/GetPlacementsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201405/PlacementService/UpdatePlacements.cs create mode 100644 examples/Dfp/CSharp/v201405/PublisherQueryLanguageService/FetchMatchTables.cs create mode 100644 examples/Dfp/CSharp/v201405/PublisherQueryLanguageService/GetAllLineItemsUsingPql.cs create mode 100644 examples/Dfp/CSharp/v201405/PublisherQueryLanguageService/GetGeoTargets.cs create mode 100644 examples/Dfp/CSharp/v201405/PublisherQueryLanguageService/GetLineItemsNamedLike.cs create mode 100644 examples/Dfp/CSharp/v201405/ReportService/DisplayReport.cs create mode 100644 examples/Dfp/CSharp/v201405/ReportService/DownloadReport.cs create mode 100644 examples/Dfp/CSharp/v201405/ReportService/RunDeliveryReport.cs create mode 100644 examples/Dfp/CSharp/v201405/ReportService/RunInventoryReport.cs create mode 100644 examples/Dfp/CSharp/v201405/ReportService/RunMergedDeliveryReport.cs create mode 100644 examples/Dfp/CSharp/v201405/ReportService/RunReachReport.cs create mode 100644 examples/Dfp/CSharp/v201405/ReportService/RunReportWithCustomFields.cs create mode 100644 examples/Dfp/CSharp/v201405/ReportService/RunSalesReport.cs create mode 100644 examples/Dfp/CSharp/v201405/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201405/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs create mode 100644 examples/Dfp/CSharp/v201405/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs create mode 100644 examples/Dfp/CSharp/v201405/TeamService/CreateTeams.cs create mode 100644 examples/Dfp/CSharp/v201405/TeamService/GetAllTeams.cs create mode 100644 examples/Dfp/CSharp/v201405/TeamService/GetTeamsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201405/TeamService/UpdateTeams.cs create mode 100644 examples/Dfp/CSharp/v201405/UserService/CreateUsers.cs create mode 100644 examples/Dfp/CSharp/v201405/UserService/DeactivateUser.cs create mode 100644 examples/Dfp/CSharp/v201405/UserService/GetAllRoles.cs create mode 100644 examples/Dfp/CSharp/v201405/UserService/GetAllUsers.cs create mode 100644 examples/Dfp/CSharp/v201405/UserService/GetCurrentUser.cs create mode 100644 examples/Dfp/CSharp/v201405/UserService/GetUsersByStatement.cs create mode 100644 examples/Dfp/CSharp/v201405/UserService/UpdateUsers.cs create mode 100644 examples/Dfp/CSharp/v201405/UserTeamAssociationService/CreateUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201405/UserTeamAssociationService/DeleteUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201405/UserTeamAssociationService/GetAllUserTeamAssociations.cs create mode 100644 examples/Dfp/CSharp/v201405/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs create mode 100644 examples/Dfp/CSharp/v201405/UserTeamAssociationService/UpdateUserTeamAssociations.cs create mode 100644 lib/NUnit/license.txt create mode 100644 lib/NUnit/nunit.framework.dll create mode 100644 src/AdWords/AdWords.csproj create mode 100644 src/AdWords/AdWordsErrorMessages.Designer.cs create mode 100644 src/AdWords/AdWordsErrorMessages.resx create mode 100644 src/AdWords/App.config create mode 100644 src/AdWords/Headers/AdWordsSoapHeader.cs create mode 100644 src/AdWords/Headers/RequestHeader.cs create mode 100644 src/AdWords/Headers/RequestHeaderStub.cs create mode 100644 src/AdWords/Headers/ResponseHeader.cs create mode 100644 src/AdWords/Headers/ResponseHeaderStub.cs create mode 100644 src/AdWords/Lib/AdWordsApiException.cs create mode 100644 src/AdWords/Lib/AdWordsAppConfig.cs create mode 100644 src/AdWords/Lib/AdWordsAuthorizationMethod.cs create mode 100644 src/AdWords/Lib/AdWordsCallListener.cs create mode 100644 src/AdWords/Lib/AdWordsCredentialsExpiredException.cs create mode 100644 src/AdWords/Lib/AdWordsErrorHandler.cs create mode 100644 src/AdWords/Lib/AdWordsException.cs create mode 100644 src/AdWords/Lib/AdWordsService.cs create mode 100644 src/AdWords/Lib/AdWordsServiceFactory.cs create mode 100644 src/AdWords/Lib/AdWordsServiceSignature.cs create mode 100644 src/AdWords/Lib/AdWordsSoapClient.cs create mode 100644 src/AdWords/Lib/AdWordsTraceListener.cs create mode 100644 src/AdWords/Lib/AdWordsUser.cs create mode 100644 src/AdWords/Lib/ApiCallEntry.cs create mode 100644 src/AdWords/Properties/AssemblyInfo.cs create mode 100644 src/AdWords/Properties/Properties.cs create mode 100644 src/AdWords/Util/ErrorUtilities.cs create mode 100644 src/AdWords/Util/Reports/ClientReport.cs create mode 100644 src/AdWords/Util/Reports/ReportDownloadError.cs create mode 100644 src/AdWords/Util/Reports/ReportUtilities.cs create mode 100644 src/AdWords/Util/Reports/ReportsException.cs create mode 100644 src/AdWords/Util/v201309/MapUtilities.cs create mode 100644 src/AdWords/Util/v201402/MapUtilities.cs create mode 100644 src/AdWords/Util/v201406/MapUtilities.cs create mode 100644 src/AdWords/v201309/AdWordsApi.cs create mode 100644 src/AdWords/v201309/AdWordsServiceV201309.cs create mode 100644 src/AdWords/v201309/ReportDefinition.cs create mode 100644 src/AdWords/v201402/AdWordsApi.cs create mode 100644 src/AdWords/v201402/AdWordsServiceV201402.cs create mode 100644 src/AdWords/v201402/ReportDefinition.cs create mode 100644 src/AdWords/v201406/AdWordsApi.cs create mode 100644 src/AdWords/v201406/AdWordsServiceV201406.cs create mode 100644 src/AdWords/v201406/ReportDefinition.cs create mode 100644 src/Common/AdsApi.snk create mode 100644 src/Common/Common.csproj create mode 100644 src/Common/CommonErrorMessages.Designer.cs create mode 100644 src/Common/CommonErrorMessages.resx create mode 100644 src/Common/Lib/AdsClient.cs create mode 100644 src/Common/Lib/AdsException.cs create mode 100644 src/Common/Lib/AdsOAuthException.cs create mode 100644 src/Common/Lib/AdsOAuthProvider.cs create mode 100644 src/Common/Lib/AdsOAuthProviderForApplications.cs create mode 100644 src/Common/Lib/AdsOAuthProviderForServiceAccounts.cs create mode 100644 src/Common/Lib/AdsService.cs create mode 100644 src/Common/Lib/AdsSoapClient.cs create mode 100644 src/Common/Lib/AdsUser.cs create mode 100644 src/Common/Lib/AppConfig.cs create mode 100644 src/Common/Lib/AppConfigBase.cs create mode 100644 src/Common/Lib/AuthToken.cs create mode 100644 src/Common/Lib/AuthTokenCache.cs create mode 100644 src/Common/Lib/AuthTokenErrorCode.cs create mode 100644 src/Common/Lib/AuthTokenException.cs create mode 100644 src/Common/Lib/Configurable.cs create mode 100644 src/Common/Lib/ContextStore.cs create mode 100644 src/Common/Lib/CredentialsExpiredException.cs create mode 100644 src/Common/Lib/DefaultAuthTokenCache.cs create mode 100644 src/Common/Lib/ErrorHandler.cs create mode 100644 src/Common/Lib/InMemoryTokenCache.cs create mode 100644 src/Common/Lib/OAuth2ProviderBase.cs create mode 100644 src/Common/Lib/OAuth2ProviderForApplications.cs create mode 100644 src/Common/Lib/OAuth2ProviderForServiceAccounts.cs create mode 100644 src/Common/Lib/ServiceFactory.cs create mode 100644 src/Common/Lib/ServiceSignature.cs create mode 100644 src/Common/Lib/SoapHeaderBase.cs create mode 100644 src/Common/Lib/SoapListener.cs create mode 100644 src/Common/Lib/SoapListenerExtension.cs create mode 100644 src/Common/Lib/SoapListenerExtensionAttribute.cs create mode 100644 src/Common/Lib/SoapMessageDirection.cs create mode 100644 src/Common/Lib/TraceListener.cs create mode 100644 src/Common/Properties/AssemblyInfo.cs create mode 100644 src/Common/Properties/Properties.cs create mode 100644 src/Common/Util/CsvException.cs create mode 100644 src/Common/Util/CsvFile.cs create mode 100644 src/Common/Util/DeprecationUtilities.cs create mode 100644 src/Common/Util/MediaUtilities.cs create mode 100644 src/Common/Util/PreconditionUtilities.cs create mode 100644 src/Common/Util/SerializationUtilities.cs create mode 100644 src/Common/Util/TraceUtilities.cs create mode 100644 src/Dfa/AdsApi.snk create mode 100644 src/Dfa/App.config create mode 100644 src/Dfa/Dfa.csproj create mode 100644 src/Dfa/DfaErrorMessages.Designer.cs create mode 100644 src/Dfa/DfaErrorMessages.resx create mode 100644 src/Dfa/Lib/DefaultLoginTokenCache.cs create mode 100644 src/Dfa/Lib/DfaApiException.cs create mode 100644 src/Dfa/Lib/DfaAppConfig.cs create mode 100644 src/Dfa/Lib/DfaAuthorizationMethod.cs create mode 100644 src/Dfa/Lib/DfaCredentialsExpiredException.cs create mode 100644 src/Dfa/Lib/DfaErrorHandler.cs create mode 100644 src/Dfa/Lib/DfaException.cs create mode 100644 src/Dfa/Lib/DfaService.cs create mode 100644 src/Dfa/Lib/DfaServiceFactory.cs create mode 100644 src/Dfa/Lib/DfaServiceSignature.cs create mode 100644 src/Dfa/Lib/DfaSoapClient.cs create mode 100644 src/Dfa/Lib/DfaTraceListener.cs create mode 100644 src/Dfa/Lib/DfaUser.cs create mode 100644 src/Dfa/Lib/LoginTokenCache.cs create mode 100644 src/Dfa/Lib/RequestHeader.cs create mode 100644 src/Dfa/Lib/ResponseHeader.cs create mode 100644 src/Dfa/Lib/SoapHeaderListener.cs create mode 100644 src/Dfa/Lib/UserToken.cs create mode 100644 src/Dfa/Properties/AssemblyInfo.cs create mode 100644 src/Dfa/Properties/Properties.cs create mode 100644 src/Dfa/Resources/ErrorCodes.csv create mode 100644 src/Dfa/Util/ApiCodes/CodeCsvs.Designer.cs create mode 100644 src/Dfa/Util/ApiCodes/CodeCsvs.resx create mode 100644 src/Dfa/Util/ApiCodes/ErrorCode.cs create mode 100644 src/Dfa/Util/LoginUtil.cs create mode 100644 src/Dfa/v1_19/DfaApi.cs create mode 100644 src/Dfa/v1_19/DfaServiceV1_19.cs create mode 100644 src/Dfa/v1_20/DfaApi.cs create mode 100644 src/Dfa/v1_20/DfaServiceV1_20.cs create mode 100644 src/Dfp/App.config create mode 100644 src/Dfp/Dfp.csproj create mode 100644 src/Dfp/DfpErrorMessages.Designer.cs create mode 100644 src/Dfp/DfpErrorMessages.resx create mode 100644 src/Dfp/Headers/Authentication.cs create mode 100644 src/Dfp/Headers/ClientLogin.cs create mode 100644 src/Dfp/Headers/DfpSoapHeader.cs create mode 100644 src/Dfp/Headers/OAuth.cs create mode 100644 src/Dfp/Headers/RequestHeader.cs create mode 100644 src/Dfp/Headers/RequestHeaderStub.cs create mode 100644 src/Dfp/Headers/ResponseHeader.cs create mode 100644 src/Dfp/Headers/ResponseHeaderStub.cs create mode 100644 src/Dfp/Lib/DfpApiException.cs create mode 100644 src/Dfp/Lib/DfpAppConfig.cs create mode 100644 src/Dfp/Lib/DfpAuthorizationMethod.cs create mode 100644 src/Dfp/Lib/DfpException.cs create mode 100644 src/Dfp/Lib/DfpService.cs create mode 100644 src/Dfp/Lib/DfpServiceFactory.cs create mode 100644 src/Dfp/Lib/DfpServiceSignature.cs create mode 100644 src/Dfp/Lib/DfpSoapClient.cs create mode 100644 src/Dfp/Lib/DfpTraceListener.cs create mode 100644 src/Dfp/Lib/DfpUser.cs create mode 100644 src/Dfp/Properties/AssemblyInfo.cs create mode 100644 src/Dfp/Properties/Properties.cs create mode 100644 src/Dfp/Util/v201208/DateTimeUtilities.cs create mode 100644 src/Dfp/Util/v201208/PqlUtilities.cs create mode 100644 src/Dfp/Util/v201208/StatementBuilder.cs create mode 100644 src/Dfp/Util/v201211/DateTimeUtilities.cs create mode 100644 src/Dfp/Util/v201211/PqlUtilities.cs create mode 100644 src/Dfp/Util/v201211/StatementBuilder.cs create mode 100644 src/Dfp/Util/v201302/DateTimeUtilities.cs create mode 100644 src/Dfp/Util/v201302/PqlUtilities.cs create mode 100644 src/Dfp/Util/v201302/StatementBuilder.cs create mode 100644 src/Dfp/Util/v201306/DateTimeUtilities.cs create mode 100644 src/Dfp/Util/v201306/PqlUtilities.cs create mode 100644 src/Dfp/Util/v201306/StatementBuilder.cs create mode 100644 src/Dfp/Util/v201308/DateTimeUtilities.cs create mode 100644 src/Dfp/Util/v201308/PqlUtilities.cs create mode 100644 src/Dfp/Util/v201308/StatementBuilder.cs create mode 100644 src/Dfp/Util/v201311/DateTimeUtilities.cs create mode 100644 src/Dfp/Util/v201311/PqlUtilities.cs create mode 100644 src/Dfp/Util/v201311/StatementBuilder.cs create mode 100644 src/Dfp/Util/v201403/DateTimeUtilities.cs create mode 100644 src/Dfp/Util/v201403/PqlUtilities.cs create mode 100644 src/Dfp/Util/v201403/StatementBuilder.cs create mode 100644 src/Dfp/Util/v201405/DateTimeUtilities.cs create mode 100644 src/Dfp/Util/v201405/PqlUtilities.cs create mode 100644 src/Dfp/Util/v201405/StatementBuilder.cs create mode 100644 src/Dfp/v201208/DfpApi.cs create mode 100644 src/Dfp/v201208/DfpServiceV201208.cs create mode 100644 src/Dfp/v201211/DfpApi.cs create mode 100644 src/Dfp/v201211/DfpServiceV201211.cs create mode 100644 src/Dfp/v201302/DfpApi.cs create mode 100644 src/Dfp/v201302/DfpServiceV201302.cs create mode 100644 src/Dfp/v201306/DfpApi.cs create mode 100644 src/Dfp/v201306/DfpServiceV201306.cs create mode 100644 src/Dfp/v201308/DfpApi.cs create mode 100644 src/Dfp/v201308/DfpServiceV201308.cs create mode 100644 src/Dfp/v201311/DfpApi.cs create mode 100644 src/Dfp/v201311/DfpServiceV201311.cs create mode 100644 src/Dfp/v201403/DfpApi.cs create mode 100644 src/Dfp/v201403/DfpServiceV201403.cs create mode 100644 src/Dfp/v201405/DfpApi.cs create mode 100644 src/Dfp/v201405/DfpServiceV201405.cs create mode 100644 tests/AdWords/AdWords.Tests.csproj create mode 100644 tests/AdWords/AdWordsRequestInterceptor.cs create mode 100644 tests/AdWords/App.config create mode 100644 tests/AdWords/ExampleTestsBase.cs create mode 100644 tests/AdWords/ExamplesMockData.cs create mode 100644 tests/AdWords/Lib/AdWordsCallListenerTest.cs create mode 100644 tests/AdWords/Lib/AdWordsServiceFactoryTests.cs create mode 100644 tests/AdWords/Properties/AssemblyInfo.cs create mode 100644 tests/AdWords/Properties/Properties.cs create mode 100644 tests/AdWords/Resources/GetAccountAlerts.v201309.txt create mode 100644 tests/AdWords/Resources/GetAccountAlerts.v201402.txt create mode 100644 tests/AdWords/Resources/GetAccountAlerts.v201406.txt create mode 100644 tests/AdWords/ServiceCreationTests.cs create mode 100644 tests/AdWords/SoapMessages.v201309.Designer.cs create mode 100644 tests/AdWords/SoapMessages.v201309.resx create mode 100644 tests/AdWords/SoapMessages.v201402.Designer.cs create mode 100644 tests/AdWords/SoapMessages.v201402.resx create mode 100644 tests/AdWords/SoapMessages.v201406.Designer.cs create mode 100644 tests/AdWords/SoapMessages.v201406.resx create mode 100644 tests/AdWords/Util/v201309/MapUtilitiesTest.cs create mode 100644 tests/AdWords/Util/v201402/MapUtilitiesTest.cs create mode 100644 tests/AdWords/Util/v201406/MapUtilitiesTest.cs create mode 100644 tests/AdWords/v201309/AccountManagementTest.cs create mode 100644 tests/AdWords/v201309/AdvancedOperationsTest.cs create mode 100644 tests/AdWords/v201309/BasicOperationsTest.cs create mode 100644 tests/AdWords/v201309/CampaignManagementTest.cs create mode 100644 tests/AdWords/v201309/ErrorHandlingTest.cs create mode 100644 tests/AdWords/v201309/MiscellaneousTest.cs create mode 100644 tests/AdWords/v201309/OptimizationTest.cs create mode 100644 tests/AdWords/v201309/RemarketingTest.cs create mode 100644 tests/AdWords/v201309/ReportingTest.cs create mode 100644 tests/AdWords/v201309/TargetingTest.cs create mode 100644 tests/AdWords/v201309/TestUtils.cs create mode 100644 tests/AdWords/v201309/VersionedExampleTestsBase.cs create mode 100644 tests/AdWords/v201402/AccountManagementTest.cs create mode 100644 tests/AdWords/v201402/AdvancedOperationsTest.cs create mode 100644 tests/AdWords/v201402/BasicOperationsTest.cs create mode 100644 tests/AdWords/v201402/CampaignManagementTest.cs create mode 100644 tests/AdWords/v201402/ErrorHandlingTest.cs create mode 100644 tests/AdWords/v201402/MiscellaneousTest.cs create mode 100644 tests/AdWords/v201402/OptimizationTest.cs create mode 100644 tests/AdWords/v201402/RemarketingTest.cs create mode 100644 tests/AdWords/v201402/ReportingTest.cs create mode 100644 tests/AdWords/v201402/ShoppingCampaignsTest.cs create mode 100644 tests/AdWords/v201402/TargetingTest.cs create mode 100644 tests/AdWords/v201402/TestUtils.cs create mode 100644 tests/AdWords/v201402/VersionedExampleTestsBase.cs create mode 100644 tests/AdWords/v201406/AccountManagementTest.cs create mode 100644 tests/AdWords/v201406/AdvancedOperationsTest.cs create mode 100644 tests/AdWords/v201406/BasicOperationsTest.cs create mode 100644 tests/AdWords/v201406/CampaignManagementTest.cs create mode 100644 tests/AdWords/v201406/ErrorHandlingTest.cs create mode 100644 tests/AdWords/v201406/MiscellaneousTest.cs create mode 100644 tests/AdWords/v201406/OptimizationTest.cs create mode 100644 tests/AdWords/v201406/RemarketingTest.cs create mode 100644 tests/AdWords/v201406/ReportingTest.cs create mode 100644 tests/AdWords/v201406/ShoppingCampaignsTest.cs create mode 100644 tests/AdWords/v201406/TargetingTest.cs create mode 100644 tests/AdWords/v201406/TestUtils.cs create mode 100644 tests/AdWords/v201406/VersionedExampleTestsBase.cs create mode 100644 tests/AdXBuyer/AdWords.Tests.csproj create mode 100644 tests/AdXBuyer/AdWordsRequestInterceptor.cs create mode 100644 tests/AdXBuyer/App.config create mode 100644 tests/AdXBuyer/ExampleTestsBase.cs create mode 100644 tests/AdXBuyer/ExamplesMockData.cs create mode 100644 tests/AdXBuyer/Lib/AdWordsServiceFactoryTests.cs create mode 100644 tests/AdXBuyer/Properties/AssemblyInfo.cs create mode 100644 tests/AdXBuyer/Properties/Properties.cs create mode 100644 tests/AdXBuyer/Util/v201309/MapUtilitiesTest.cs create mode 100644 tests/AdXBuyer/Util/v201402/MapUtilitiesTest.cs create mode 100644 tests/AdXBuyer/Util/v201406/MapUtilitiesTest.cs create mode 100644 tests/AdXBuyer/v201309/AccountManagementTest.cs create mode 100644 tests/AdXBuyer/v201309/AdvancedOperationsTest.cs create mode 100644 tests/AdXBuyer/v201309/BasicOperationsTest.cs create mode 100644 tests/AdXBuyer/v201309/CampaignManagementTest.cs create mode 100644 tests/AdXBuyer/v201309/ErrorHandlingTest.cs create mode 100644 tests/AdXBuyer/v201309/MiscellaneousTest.cs create mode 100644 tests/AdXBuyer/v201309/OptimizationTest.cs create mode 100644 tests/AdXBuyer/v201309/RemarketingTest.cs create mode 100644 tests/AdXBuyer/v201309/ReportingTest.cs create mode 100644 tests/AdXBuyer/v201309/TargetingTest.cs create mode 100644 tests/AdXBuyer/v201309/TestUtils.cs create mode 100644 tests/AdXBuyer/v201309/VersionedExampleTestsBase.cs create mode 100644 tests/AdXBuyer/v201402/AccountManagementTest.cs create mode 100644 tests/AdXBuyer/v201402/AdvancedOperationsTest.cs create mode 100644 tests/AdXBuyer/v201402/BasicOperationsTest.cs create mode 100644 tests/AdXBuyer/v201402/CampaignManagementTest.cs create mode 100644 tests/AdXBuyer/v201402/ErrorHandlingTest.cs create mode 100644 tests/AdXBuyer/v201402/MiscellaneousTest.cs create mode 100644 tests/AdXBuyer/v201402/OptimizationTest.cs create mode 100644 tests/AdXBuyer/v201402/RemarketingTest.cs create mode 100644 tests/AdXBuyer/v201402/ReportingTest.cs create mode 100644 tests/AdXBuyer/v201402/TargetingTest.cs create mode 100644 tests/AdXBuyer/v201402/TestUtils.cs create mode 100644 tests/AdXBuyer/v201402/VersionedExampleTestsBase.cs create mode 100644 tests/AdXBuyer/v201406/AccountManagementTest.cs create mode 100644 tests/AdXBuyer/v201406/AdvancedOperationsTest.cs create mode 100644 tests/AdXBuyer/v201406/BasicOperationsTest.cs create mode 100644 tests/AdXBuyer/v201406/CampaignManagementTest.cs create mode 100644 tests/AdXBuyer/v201406/ErrorHandlingTest.cs create mode 100644 tests/AdXBuyer/v201406/MiscellaneousTest.cs create mode 100644 tests/AdXBuyer/v201406/OptimizationTest.cs create mode 100644 tests/AdXBuyer/v201406/RemarketingTest.cs create mode 100644 tests/AdXBuyer/v201406/ReportingTest.cs create mode 100644 tests/AdXBuyer/v201406/TargetingTest.cs create mode 100644 tests/AdXBuyer/v201406/TestUtils.cs create mode 100644 tests/AdXBuyer/v201406/VersionedExampleTestsBase.cs create mode 100644 tests/Common/ClientLoginRequestInterceptor.cs create mode 100644 tests/Common/Common.Tests.csproj create mode 100644 tests/Common/HttpMessage.cs create mode 100644 tests/Common/Lib/AdsExceptionTests.cs create mode 100644 tests/Common/Lib/AdsOAuthExceptionTests.cs create mode 100644 tests/Common/Lib/AppConfigBaseTests.cs create mode 100644 tests/Common/Lib/AuthTokenTest.cs create mode 100644 tests/Common/Lib/DefaultAuthTokenCacheTests.cs create mode 100644 tests/Common/Lib/OAuth2ProviderForApplicationsTests.cs create mode 100644 tests/Common/Lib/OAuth2ProviderForServiceAccountsTests.cs create mode 100644 tests/Common/Lib/ServiceFactoryTests.cs create mode 100644 tests/Common/Lib/ServiceSignatureTests.cs create mode 100644 tests/Common/Lib/TraceListenerTests.cs create mode 100644 tests/Common/MockWebRequest.cs create mode 100644 tests/Common/MockWebResponse.cs create mode 100644 tests/Common/Mocks/MockAdsClient.cs create mode 100644 tests/Common/Mocks/MockAdsException.cs create mode 100644 tests/Common/Mocks/MockAdsUser.cs create mode 100644 tests/Common/Mocks/MockAppConfig.cs create mode 100644 tests/Common/Mocks/MockAuthTokenCache.cs create mode 100644 tests/Common/Mocks/MockServiceFactory.cs create mode 100644 tests/Common/Mocks/MockServiceSignature.cs create mode 100644 tests/Common/Mocks/MockTraceListener.cs create mode 100644 tests/Common/OAuth2RequestInterceptor.cs create mode 100644 tests/Common/Resources.Designer.cs create mode 100644 tests/Common/Resources.resx create mode 100644 tests/Common/Resources/certificate.p12 create mode 100644 tests/Common/TestUtils.cs create mode 100644 tests/Common/Util/CsvFileTests.cs create mode 100644 tests/Common/Util/DeprecationUtilitiesTest.cs create mode 100644 tests/Common/Util/MediaUtilitiesTests.cs create mode 100644 tests/Common/WebRequestInterceptor.cs create mode 100644 tests/Dfa/App.config create mode 100644 tests/Dfa/BaseTests.cs create mode 100644 tests/Dfa/Dfa.Tests.csproj create mode 100644 tests/Dfa/Lib/DefaultLoginTokenCacheTests.cs create mode 100644 tests/Dfa/Lib/DfaErrorHandlerTests.cs create mode 100644 tests/Dfa/Properties/AssemblyInfo.cs create mode 100644 tests/Dfa/Properties/Properties.cs create mode 100644 tests/Dfp/App.config create mode 100644 tests/Dfp/BaseTests.cs create mode 100644 tests/Dfp/Dfp.Tests.csproj create mode 100644 tests/Dfp/DfpServiceFactoryTests.cs create mode 100644 tests/Dfp/Properties/AssemblyInfo.cs create mode 100644 tests/Dfp/Properties/Properties.cs create mode 100644 tests/Dfp/ServiceCreationTests.cs create mode 100644 tests/Dfp/v201208/CompanyServiceTests.cs create mode 100644 tests/Dfp/v201208/CreativeServiceTests.cs create mode 100644 tests/Dfp/v201208/ForecastServiceTests.cs create mode 100644 tests/Dfp/v201208/InventoryServiceTests.cs create mode 100644 tests/Dfp/v201208/LineItemCreativeAssociationServiceTests.cs create mode 100644 tests/Dfp/v201208/LineItemServiceTests.cs create mode 100644 tests/Dfp/v201208/OrderServiceTests.cs create mode 100644 tests/Dfp/v201208/PlacementServiceTests.cs create mode 100644 tests/Dfp/v201208/ReportServiceTests.cs create mode 100644 tests/Dfp/v201208/StatementBuilderTests.cs create mode 100644 tests/Dfp/v201208/TestUtils.cs create mode 100644 tests/Dfp/v201208/UserServiceTests.cs create mode 100644 tests/Dfp/v201211/CompanyServiceTests.cs create mode 100644 tests/Dfp/v201211/CreativeServiceTests.cs create mode 100644 tests/Dfp/v201211/ForecastServiceTests.cs create mode 100644 tests/Dfp/v201211/InventoryServiceTests.cs create mode 100644 tests/Dfp/v201211/LineItemCreativeAssociationServiceTests.cs create mode 100644 tests/Dfp/v201211/LineItemServiceTests.cs create mode 100644 tests/Dfp/v201211/OrderServiceTests.cs create mode 100644 tests/Dfp/v201211/PlacementServiceTests.cs create mode 100644 tests/Dfp/v201211/ReportServiceTests.cs create mode 100644 tests/Dfp/v201211/StatementBuilderTests.cs create mode 100644 tests/Dfp/v201211/TestUtils.cs create mode 100644 tests/Dfp/v201211/UserServiceTests.cs create mode 100644 tests/Dfp/v201302/CompanyServiceTests.cs create mode 100644 tests/Dfp/v201302/CreativeServiceTests.cs create mode 100644 tests/Dfp/v201302/ForecastServiceTests.cs create mode 100644 tests/Dfp/v201302/InventoryServiceTests.cs create mode 100644 tests/Dfp/v201302/LineItemCreativeAssociationServiceTests.cs create mode 100644 tests/Dfp/v201302/LineItemServiceTests.cs create mode 100644 tests/Dfp/v201302/OrderServiceTests.cs create mode 100644 tests/Dfp/v201302/PlacementServiceTests.cs create mode 100644 tests/Dfp/v201302/ReportServiceTests.cs create mode 100644 tests/Dfp/v201302/StatementBuilderTests.cs create mode 100644 tests/Dfp/v201302/TestUtils.cs create mode 100644 tests/Dfp/v201302/UserServiceTests.cs create mode 100644 tests/Dfp/v201306/CompanyServiceTests.cs create mode 100644 tests/Dfp/v201306/CreativeServiceTests.cs create mode 100644 tests/Dfp/v201306/ForecastServiceTests.cs create mode 100644 tests/Dfp/v201306/InventoryServiceTests.cs create mode 100644 tests/Dfp/v201306/LineItemCreativeAssociationServiceTests.cs create mode 100644 tests/Dfp/v201306/LineItemServiceTests.cs create mode 100644 tests/Dfp/v201306/OrderServiceTests.cs create mode 100644 tests/Dfp/v201306/PlacementServiceTests.cs create mode 100644 tests/Dfp/v201306/ReportServiceTests.cs create mode 100644 tests/Dfp/v201306/StatementBuilderTests.cs create mode 100644 tests/Dfp/v201306/TestUtils.cs create mode 100644 tests/Dfp/v201306/UserServiceTests.cs create mode 100644 tests/Dfp/v201308/CompanyServiceTests.cs create mode 100644 tests/Dfp/v201308/CreativeServiceTests.cs create mode 100644 tests/Dfp/v201308/ForecastServiceTests.cs create mode 100644 tests/Dfp/v201308/InventoryServiceTests.cs create mode 100644 tests/Dfp/v201308/LineItemCreativeAssociationServiceTests.cs create mode 100644 tests/Dfp/v201308/LineItemServiceTests.cs create mode 100644 tests/Dfp/v201308/OrderServiceTests.cs create mode 100644 tests/Dfp/v201308/PlacementServiceTests.cs create mode 100644 tests/Dfp/v201308/ReportServiceTests.cs create mode 100644 tests/Dfp/v201308/StatementBuilderTests.cs create mode 100644 tests/Dfp/v201308/TestUtils.cs create mode 100644 tests/Dfp/v201308/UserServiceTests.cs create mode 100644 tests/Dfp/v201311/CompanyServiceTests.cs create mode 100644 tests/Dfp/v201311/CreativeServiceTests.cs create mode 100644 tests/Dfp/v201311/ForecastServiceTests.cs create mode 100644 tests/Dfp/v201311/InventoryServiceTests.cs create mode 100644 tests/Dfp/v201311/LineItemCreativeAssociationServiceTests.cs create mode 100644 tests/Dfp/v201311/LineItemServiceTests.cs create mode 100644 tests/Dfp/v201311/OrderServiceTests.cs create mode 100644 tests/Dfp/v201311/PlacementServiceTests.cs create mode 100644 tests/Dfp/v201311/ReportServiceTests.cs create mode 100644 tests/Dfp/v201311/StatementBuilderTests.cs create mode 100644 tests/Dfp/v201311/TestUtils.cs create mode 100644 tests/Dfp/v201311/UserServiceTests.cs create mode 100644 tests/Dfp/v201403/CompanyServiceTests.cs create mode 100644 tests/Dfp/v201403/CreativeServiceTests.cs create mode 100644 tests/Dfp/v201403/ForecastServiceTests.cs create mode 100644 tests/Dfp/v201403/InventoryServiceTests.cs create mode 100644 tests/Dfp/v201403/LineItemCreativeAssociationServiceTests.cs create mode 100644 tests/Dfp/v201403/LineItemServiceTests.cs create mode 100644 tests/Dfp/v201403/OrderServiceTests.cs create mode 100644 tests/Dfp/v201403/PlacementServiceTests.cs create mode 100644 tests/Dfp/v201403/ReportServiceTests.cs create mode 100644 tests/Dfp/v201403/StatementBuilderTests.cs create mode 100644 tests/Dfp/v201403/TestUtils.cs create mode 100644 tests/Dfp/v201403/UserServiceTests.cs create mode 100644 tests/Dfp/v201405/CompanyServiceTests.cs create mode 100644 tests/Dfp/v201405/CreativeServiceTests.cs create mode 100644 tests/Dfp/v201405/ForecastServiceTests.cs create mode 100644 tests/Dfp/v201405/InventoryServiceTests.cs create mode 100644 tests/Dfp/v201405/LineItemCreativeAssociationServiceTests.cs create mode 100644 tests/Dfp/v201405/LineItemServiceTests.cs create mode 100644 tests/Dfp/v201405/OrderServiceTests.cs create mode 100644 tests/Dfp/v201405/PlacementServiceTests.cs create mode 100644 tests/Dfp/v201405/ReportServiceTests.cs create mode 100644 tests/Dfp/v201405/StatementBuilderTests.cs create mode 100644 tests/Dfp/v201405/TestUtils.cs create mode 100644 tests/Dfp/v201405/UserServiceTests.cs create mode 100644 utilities/OAuthTokenGenerator/LoginForm.Designer.cs create mode 100644 utilities/OAuthTokenGenerator/LoginForm.cs create mode 100644 utilities/OAuthTokenGenerator/LoginForm.resx create mode 100644 utilities/OAuthTokenGenerator/MainForm.Designer.cs create mode 100644 utilities/OAuthTokenGenerator/MainForm.cs create mode 100644 utilities/OAuthTokenGenerator/MainForm.resx create mode 100644 utilities/OAuthTokenGenerator/OAuthTokenGenerator.csproj create mode 100644 utilities/OAuthTokenGenerator/Program.cs create mode 100644 utilities/OAuthTokenGenerator/Properties/AssemblyInfo.cs create mode 100644 utilities/OAuthTokenGenerator/Properties/Properties.cs diff --git a/AdWords.sln b/AdWords.sln new file mode 100644 index 00000000000..64f008dfb63 --- /dev/null +++ b/AdWords.sln @@ -0,0 +1,114 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdWords", "src\AdWords\AdWords.csproj", "{50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdWords.Examples.CSharp", "examples\AdWords\csharp\AdWords.Examples.CSharp.csproj", "{5C1DE791-767A-4599-A0B9-51D6D2DFCC81}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "AdWords.Examples.VB", "examples\AdWords\vb\AdWords.Examples.VB.vbproj", "{A4AE3724-C225-4F03-AC77-A71C1330D8DD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "src\Common\Common.csproj", "{277404DB-A439-4450-B3A5-186294CDF245}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdWords.Examples.CSharp.OAuth", "examples\AdWords\csharp\oauth\AdWords.Examples.CSharp.OAuth.csproj", "{4641ADD7-0D1F-473D-B713-2830C5029367}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdWords.Tests", "tests\AdWords\AdWords.Tests.csproj", "{6D64AF43-1FC4-4128-9496-5ECE53F00B7F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Tests", "tests\Common\Common.Tests.csproj", "{7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OAuthTokenGenerator", "utilities\OAuthTokenGenerator\OAuthTokenGenerator.csproj", "{44B870E6-C579-40F5-A4BA-370C58708E36}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}.Debug|Any CPU.Build.0 = Debug|Any CPU + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}.Debug|x86.ActiveCfg = Debug|Any CPU + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}.Release|Any CPU.ActiveCfg = Release|Any CPU + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}.Release|Any CPU.Build.0 = Release|Any CPU + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}.Release|x86.ActiveCfg = Release|Any CPU + {5C1DE791-767A-4599-A0B9-51D6D2DFCC81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5C1DE791-767A-4599-A0B9-51D6D2DFCC81}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5C1DE791-767A-4599-A0B9-51D6D2DFCC81}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {5C1DE791-767A-4599-A0B9-51D6D2DFCC81}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {5C1DE791-767A-4599-A0B9-51D6D2DFCC81}.Debug|x86.ActiveCfg = Debug|Any CPU + {5C1DE791-767A-4599-A0B9-51D6D2DFCC81}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5C1DE791-767A-4599-A0B9-51D6D2DFCC81}.Release|Any CPU.Build.0 = Release|Any CPU + {5C1DE791-767A-4599-A0B9-51D6D2DFCC81}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {5C1DE791-767A-4599-A0B9-51D6D2DFCC81}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {5C1DE791-767A-4599-A0B9-51D6D2DFCC81}.Release|x86.ActiveCfg = Release|Any CPU + {A4AE3724-C225-4F03-AC77-A71C1330D8DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4AE3724-C225-4F03-AC77-A71C1330D8DD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4AE3724-C225-4F03-AC77-A71C1330D8DD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A4AE3724-C225-4F03-AC77-A71C1330D8DD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A4AE3724-C225-4F03-AC77-A71C1330D8DD}.Debug|x86.ActiveCfg = Debug|Any CPU + {A4AE3724-C225-4F03-AC77-A71C1330D8DD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4AE3724-C225-4F03-AC77-A71C1330D8DD}.Release|Any CPU.Build.0 = Release|Any CPU + {A4AE3724-C225-4F03-AC77-A71C1330D8DD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A4AE3724-C225-4F03-AC77-A71C1330D8DD}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A4AE3724-C225-4F03-AC77-A71C1330D8DD}.Release|x86.ActiveCfg = Release|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Debug|Any CPU.Build.0 = Debug|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Debug|x86.ActiveCfg = Debug|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Release|Any CPU.ActiveCfg = Release|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Release|Any CPU.Build.0 = Release|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Release|x86.ActiveCfg = Release|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Debug|x86.ActiveCfg = Debug|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Release|Any CPU.Build.0 = Release|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Release|x86.ActiveCfg = Release|Any CPU + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F}.Debug|x86.ActiveCfg = Debug|Any CPU + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F}.Release|Any CPU.Build.0 = Release|Any CPU + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F}.Release|x86.ActiveCfg = Release|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Debug|x86.ActiveCfg = Debug|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Release|Any CPU.Build.0 = Release|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Release|x86.ActiveCfg = Release|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Debug|Any CPU.Build.0 = Debug|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Debug|x86.ActiveCfg = Debug|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Release|Any CPU.ActiveCfg = Release|x86 + {44B870E6-C579-40F5-A4BA-370C58708E36}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {44B870E6-C579-40F5-A4BA-370C58708E36}.Release|Mixed Platforms.Build.0 = Release|x86 + {44B870E6-C579-40F5-A4BA-370C58708E36}.Release|x86.ActiveCfg = Release|x86 + {44B870E6-C579-40F5-A4BA-370C58708E36}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/AdXBuyer.sln b/AdXBuyer.sln new file mode 100644 index 00000000000..510b9f16851 --- /dev/null +++ b/AdXBuyer.sln @@ -0,0 +1,114 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "src\Common\Common.csproj", "{277404DB-A439-4450-B3A5-186294CDF245}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdWords.Examples.CSharp", "examples\AdXBuyer\csharp\AdWords.Examples.CSharp.csproj", "{01EF0848-0412-4AA5-9360-033E2060447F}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "AdWords.Examples.VB", "examples\AdXBuyer\vb\AdWords.Examples.VB.vbproj", "{D64BB23B-38E7-4E7D-88AD-2D608C713F1C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdWords", "src\AdWords\AdWords.csproj", "{50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdWords.Examples.CSharp.OAuth", "examples\adxbuyer\csharp\oauth\AdWords.Examples.CSharp.OAuth.csproj", "{4641ADD7-0D1F-473D-B713-2830C5029367}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdWords.Tests", "tests\AdXBuyer\AdWords.Tests.csproj", "{6D64AF43-1FC4-4128-9496-5ECE53F00B7F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Tests", "tests\Common\Common.Tests.csproj", "{7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OAuthTokenGenerator", "utilities\OAuthTokenGenerator\OAuthTokenGenerator.csproj", "{44B870E6-C579-40F5-A4BA-370C58708E36}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {277404DB-A439-4450-B3A5-186294CDF245}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Debug|Any CPU.Build.0 = Debug|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Debug|x86.ActiveCfg = Debug|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Release|Any CPU.ActiveCfg = Release|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Release|Any CPU.Build.0 = Release|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Release|x86.ActiveCfg = Release|Any CPU + {01EF0848-0412-4AA5-9360-033E2060447F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {01EF0848-0412-4AA5-9360-033E2060447F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {01EF0848-0412-4AA5-9360-033E2060447F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {01EF0848-0412-4AA5-9360-033E2060447F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {01EF0848-0412-4AA5-9360-033E2060447F}.Debug|x86.ActiveCfg = Debug|Any CPU + {01EF0848-0412-4AA5-9360-033E2060447F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {01EF0848-0412-4AA5-9360-033E2060447F}.Release|Any CPU.Build.0 = Release|Any CPU + {01EF0848-0412-4AA5-9360-033E2060447F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {01EF0848-0412-4AA5-9360-033E2060447F}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {01EF0848-0412-4AA5-9360-033E2060447F}.Release|x86.ActiveCfg = Release|Any CPU + {D64BB23B-38E7-4E7D-88AD-2D608C713F1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D64BB23B-38E7-4E7D-88AD-2D608C713F1C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D64BB23B-38E7-4E7D-88AD-2D608C713F1C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {D64BB23B-38E7-4E7D-88AD-2D608C713F1C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {D64BB23B-38E7-4E7D-88AD-2D608C713F1C}.Debug|x86.ActiveCfg = Debug|Any CPU + {D64BB23B-38E7-4E7D-88AD-2D608C713F1C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D64BB23B-38E7-4E7D-88AD-2D608C713F1C}.Release|Any CPU.Build.0 = Release|Any CPU + {D64BB23B-38E7-4E7D-88AD-2D608C713F1C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {D64BB23B-38E7-4E7D-88AD-2D608C713F1C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {D64BB23B-38E7-4E7D-88AD-2D608C713F1C}.Release|x86.ActiveCfg = Release|Any CPU + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}.Debug|Any CPU.Build.0 = Debug|Any CPU + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}.Debug|x86.ActiveCfg = Debug|Any CPU + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}.Release|Any CPU.ActiveCfg = Release|Any CPU + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}.Release|Any CPU.Build.0 = Release|Any CPU + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745}.Release|x86.ActiveCfg = Release|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Debug|x86.ActiveCfg = Debug|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Release|Any CPU.Build.0 = Release|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Release|x86.ActiveCfg = Release|Any CPU + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F}.Debug|x86.ActiveCfg = Debug|Any CPU + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F}.Release|Any CPU.Build.0 = Release|Any CPU + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F}.Release|x86.ActiveCfg = Release|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Debug|x86.ActiveCfg = Debug|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Release|Any CPU.Build.0 = Release|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Release|x86.ActiveCfg = Release|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Debug|x86.ActiveCfg = Debug|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Debug|x86.Build.0 = Debug|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Release|Any CPU.ActiveCfg = Release|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Release|x86.ActiveCfg = Release|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 00000000000..280385dd5e0 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,23 @@ +18.0.0 +====== + +- AdWords, AdxBuyer, DFP and DFA .NET client libraries were combined into a + single repository and given a single version number. The older versions + and ChangeLog may be obtained from + https://github.com/googleads/googleads-dotnet-lib/tree/master/legacy. + +AdWords: +- Added support for v201406, except for AdWords for Video. +- Updated OAuth scope. See + https://developers.google.com/adwords/api/docs/guides/authentication#scope + for details. + +DFA: + - + +DFP: + - + +Common: + - Version was bumped to 3.0.0. + diff --git a/Dfa.sln b/Dfa.sln new file mode 100644 index 00000000000..d6ad94ff617 --- /dev/null +++ b/Dfa.sln @@ -0,0 +1,129 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dfa", "src\Dfa\Dfa.csproj", "{CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "src\Common\Common.csproj", "{277404DB-A439-4450-B3A5-186294CDF245}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dfa.Tests", "tests\Dfa\Dfa.Tests.csproj", "{FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dfa.Examples.WcfService", "examples\Dfa\wcf\WcfService\Dfa.Examples.WcfService.csproj", "{B7569E63-95A3-46B1-A6BB-5ABBBA542BF5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dfa.Examples.WcfServiceConsumer", "examples\Dfa\wcf\WcfServiceConsumer\Dfa.Examples.WcfServiceConsumer.csproj", "{038AFADE-3AEE-44C9-AF5A-E210FD08452C}" + ProjectSection(ProjectDependencies) = postProject + {B7569E63-95A3-46B1-A6BB-5ABBBA542BF5} = {B7569E63-95A3-46B1-A6BB-5ABBBA542BF5} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dfa.Examples.CSharp", "examples\Dfa\csharp\Dfa.Examples.CSharp.csproj", "{65E3CAA4-8EE5-414A-AC88-02E4F33EC954}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dfa.Examples.CSharp.OAuth", "examples\Dfa\csharp\oauth\Dfa.Examples.CSharp.OAuth.csproj", "{4641ADD7-0D1F-473D-B713-2830C5029367}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Tests", "tests\Common\Common.Tests.csproj", "{7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OAuthTokenGenerator", "utilities\OAuthTokenGenerator\OAuthTokenGenerator.csproj", "{44B870E6-C579-40F5-A4BA-370C58708E36}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}.Debug|x86.ActiveCfg = Debug|Any CPU + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}.Release|Any CPU.Build.0 = Release|Any CPU + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}.Release|x86.ActiveCfg = Release|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Debug|Any CPU.Build.0 = Debug|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Debug|x86.ActiveCfg = Debug|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Release|Any CPU.ActiveCfg = Release|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Release|Any CPU.Build.0 = Release|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Release|x86.ActiveCfg = Release|Any CPU + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}.Debug|x86.ActiveCfg = Debug|Any CPU + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}.Release|Any CPU.Build.0 = Release|Any CPU + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}.Release|x86.ActiveCfg = Release|Any CPU + {B7569E63-95A3-46B1-A6BB-5ABBBA542BF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B7569E63-95A3-46B1-A6BB-5ABBBA542BF5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B7569E63-95A3-46B1-A6BB-5ABBBA542BF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {B7569E63-95A3-46B1-A6BB-5ABBBA542BF5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {B7569E63-95A3-46B1-A6BB-5ABBBA542BF5}.Debug|x86.ActiveCfg = Debug|Any CPU + {B7569E63-95A3-46B1-A6BB-5ABBBA542BF5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B7569E63-95A3-46B1-A6BB-5ABBBA542BF5}.Release|Any CPU.Build.0 = Release|Any CPU + {B7569E63-95A3-46B1-A6BB-5ABBBA542BF5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {B7569E63-95A3-46B1-A6BB-5ABBBA542BF5}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {B7569E63-95A3-46B1-A6BB-5ABBBA542BF5}.Release|x86.ActiveCfg = Release|Any CPU + {038AFADE-3AEE-44C9-AF5A-E210FD08452C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {038AFADE-3AEE-44C9-AF5A-E210FD08452C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {038AFADE-3AEE-44C9-AF5A-E210FD08452C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {038AFADE-3AEE-44C9-AF5A-E210FD08452C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {038AFADE-3AEE-44C9-AF5A-E210FD08452C}.Debug|x86.ActiveCfg = Debug|Any CPU + {038AFADE-3AEE-44C9-AF5A-E210FD08452C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {038AFADE-3AEE-44C9-AF5A-E210FD08452C}.Release|Any CPU.Build.0 = Release|Any CPU + {038AFADE-3AEE-44C9-AF5A-E210FD08452C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {038AFADE-3AEE-44C9-AF5A-E210FD08452C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {038AFADE-3AEE-44C9-AF5A-E210FD08452C}.Release|x86.ActiveCfg = Release|Any CPU + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954}.Debug|x86.ActiveCfg = Debug|Any CPU + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954}.Release|Any CPU.ActiveCfg = Release|Any CPU + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954}.Release|Any CPU.Build.0 = Release|Any CPU + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954}.Release|x86.ActiveCfg = Release|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Debug|x86.ActiveCfg = Debug|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Release|Any CPU.Build.0 = Release|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Release|x86.ActiveCfg = Release|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Debug|x86.ActiveCfg = Debug|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Release|Any CPU.Build.0 = Release|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Release|x86.ActiveCfg = Release|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Debug|x86.ActiveCfg = Debug|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Debug|x86.Build.0 = Debug|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Release|Any CPU.ActiveCfg = Release|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Release|x86.ActiveCfg = Release|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Dfp.sln b/Dfp.sln new file mode 100644 index 00000000000..e71e4a6cb48 --- /dev/null +++ b/Dfp.sln @@ -0,0 +1,102 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dfp", "src\Dfp\Dfp.csproj", "{CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dfp.Examples.CSharp", "examples\Dfp\csharp\Dfp.Examples.CSharp.csproj", "{65E3CAA4-8EE5-414A-AC88-02E4F33EC954}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "src\Common\Common.csproj", "{277404DB-A439-4450-B3A5-186294CDF245}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dfp.Tests", "tests\Dfp\Dfp.Tests.csproj", "{FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dfp.Examples.CSharp.OAuth", "examples\Dfp\csharp\oauth\Dfp.Examples.CSharp.OAuth.csproj", "{4641ADD7-0D1F-473D-B713-2830C5029367}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Tests", "tests\Common\Common.Tests.csproj", "{7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OAuthTokenGenerator", "utilities\OAuthTokenGenerator\OAuthTokenGenerator.csproj", "{44B870E6-C579-40F5-A4BA-370C58708E36}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}.Debug|x86.ActiveCfg = Debug|Any CPU + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}.Release|Any CPU.Build.0 = Release|Any CPU + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB}.Release|x86.ActiveCfg = Release|Any CPU + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954}.Debug|x86.ActiveCfg = Debug|Any CPU + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954}.Release|Any CPU.ActiveCfg = Release|Any CPU + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954}.Release|Any CPU.Build.0 = Release|Any CPU + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954}.Release|x86.ActiveCfg = Release|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Debug|Any CPU.Build.0 = Debug|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Debug|x86.ActiveCfg = Debug|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Release|Any CPU.ActiveCfg = Release|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Release|Any CPU.Build.0 = Release|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {277404DB-A439-4450-B3A5-186294CDF245}.Release|x86.ActiveCfg = Release|Any CPU + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}.Debug|x86.ActiveCfg = Debug|Any CPU + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}.Release|Any CPU.Build.0 = Release|Any CPU + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51}.Release|x86.ActiveCfg = Release|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Debug|x86.ActiveCfg = Debug|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Release|Any CPU.Build.0 = Release|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {4641ADD7-0D1F-473D-B713-2830C5029367}.Release|x86.ActiveCfg = Release|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Debug|x86.ActiveCfg = Debug|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Release|Any CPU.Build.0 = Release|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6}.Release|x86.ActiveCfg = Release|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Debug|x86.ActiveCfg = Debug|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Debug|x86.Build.0 = Debug|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Release|Any CPU.ActiveCfg = Release|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Release|x86.ActiveCfg = Release|Any CPU + {44B870E6-C579-40F5-A4BA-370C58708E36}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000000..9c5ab27f60b --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2011 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index 8a01e545305..5d1f6dcf6f2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ #Google Ads API .NET Client Library -This project hosts the .NET client library for the various SOAP-Based Ads APIs - AdWords API, DoubleClick Ad Exchange Buyer SOAP (AdxBuyer) API, DoubleClick for Advertisers (DFA) API, and Google's DoubleClick for Publishers (DFP) API at Google. +This project hosts the .NET client library for the various SOAP-Based Ads APIs - AdWords API, +DoubleClick Ad Exchange Buyer SOAP (AdxBuyer) API, DoubleClick for Advertisers (DFA) API, and +Google's DoubleClick for Publishers (DFP) API at Google. ##Features - Distributed via Nuget @@ -19,38 +21,53 @@ This project hosts the .NET client library for the various SOAP-Based Ads APIs - ##Announcements and updates -For API and client library updates and news, please follow our Google+ Ads Developers page: https://plus.google.com/+GoogleAdsDevelopers/posts and our Google Ads Developers blog: +For API and client library updates and news, please follow our Google+ Ads Developers page: +https://plus.google.com/+GoogleAdsDevelopers/posts and our Google Ads Developers blog: http://googleadsdeveloper.blogspot.com/. ##How do I start? -We provide source, binary and nuget distributions for the client library. You may continue reading the the appropriate section below, depending on the distribution you are using. +We provide source, binary and nuget distributions for the client library. You may continue reading +the the appropriate section below, depending on the distribution you are using. ##Nuget distribution -This is the recommended way to get the client library. The nuget distributions of the client library are listed below: +This is the recommended way to get the client library. The nuget distributions of the client library + are listed below: ###AdWords and AdxBuyer API -- [Google.AdWords](https://www.nuget.org/packages/Google.AdWords/): AdWords and DoubleClick Ad Exchange Buyer API DotNet Client Library -- [Google.AdWords.Examples.CSharp](https://www.nuget.org/packages/Google.AdWords.Examples.CSharp/): C# Code examples for AdWords API -- [Google.AdWords.Examples.VB](https://www.nuget.org/packages/Google.AdWords.Examples.VB/): VB.NET Code examples for AdWords API -- [Google.AdXBuyer.Examples.CSharp](https://www.nuget.org/packages/Google.AdXBuyer.Examples.CSharp/): C# Code examples for AdxBuyer API -- [Google.AdXBuyer.Examples.VB](https://www.nuget.org/packages/Google.AdXBuyer.Examples.VB/): VB.NET Code examples for AdxBuyer API +- [Google.AdWords](https://www.nuget.org/packages/Google.AdWords/): AdWords and DoubleClick Ad + Exchange Buyer API DotNet Client Library +- [Google.AdWords.Examples.CSharp](https://www.nuget.org/packages/Google.AdWords.Examples.CSharp/): + C# Code examples for AdWords API +- [Google.AdWords.Examples.VB](https://www.nuget.org/packages/Google.AdWords.Examples.VB/): + VB.NET Code examples for AdWords API +- [Google.AdXBuyer.Examples.CSharp](https://www.nuget.org/packages/Google.AdXBuyer.Examples.CSharp/): + C# Code examples for AdxBuyer API +- [Google.AdXBuyer.Examples.VB](https://www.nuget.org/packages/Google.AdXBuyer.Examples.VB/): + VB.NET Code examples for AdxBuyer API ###DFP API - [Google.Dfp](https://www.nuget.org/packages/Google.Dfp/): DFP API DotNet Client Library -- [Google.Dfp.Examples.CSharp](https://www.nuget.org/packages/Google.Dfp.Examples.CSharp/): C# Code examples for DFP API +- [Google.Dfp.Examples.CSharp](https://www.nuget.org/packages/Google.Dfp.Examples.CSharp/): + C# Code examples for DFP API ###DFA API - [Google.Dfa](https://www.nuget.org/packages/Google.Dfa/): DFA API DotNet Client Library -- [Google.Dfa.Examples.CSharp](https://www.nuget.org/packages/Google.Dfa.Examples.CSharp/): C# Code examples for DFA API +- [Google.Dfa.Examples.CSharp](https://www.nuget.org/packages/Google.Dfa.Examples.CSharp/): C# Code + examples for DFA API -To use the library, you can install the appropriate nuget packages and add reference to your Visual Studio project. You can learn more about the nuget package manager at http://www.nuget.org. +To use the library, you can install the appropriate nuget packages and add reference to your Visual + Studio project. You can learn more about the nuget package manager at http://www.nuget.org. ##Binary distribution -The binary distribution of the Ads API .NET library consists of a precompiled version of the library as a .NET assembly, code examples for using the library, and library documentation. If you are interested in just using the library and not in its internals, and you don't use nuget package manager in your development environment, then you should download this distribution. There are separate downloads for AdWords, AdxBuyer, DFA and DFP APIs. +The binary distribution of the Ads API .NET library consists of a precompiled version of the + library as a .NET assembly, code examples for using the library, and library documentation. + If you are interested in just using the library and not in its internals, and you don't use + nuget package manager in your development environment, then you should download this distribution. + There are separate downloads for AdWords, AdxBuyer, DFA and DFP APIs. The contents of this distribution are as follows: ``` @@ -67,22 +84,31 @@ The contents of this distribution are as follows: ``` To run the code examples: -- Open Visual Studio solution file in the root folder of the binary distribution in Microsoft Visual Studio -- Open `App.config` for the examples project and follow the instructions in the file to enter required configuration values. +- Open Visual Studio solution file in the root folder of the binary distribution in Microsoft + Visual Studio +- Open `App.config` for the examples project and follow the instructions in the file to enter + required configuration values. - Save and close `App.config`. -- Open the Properties dialog for the Examples project (Right click the Examples project of your choice in the Solution Explorer and select the Properties option from the context menu.). -- Navigate to the Debug Tab and enter the command line options. The command line options are of the form `version.examplename`. For instance, `v201402.AddCampaign` is the command line option to run `AddCampaign` example in `v201402` version of the AdWords API. +- Open the Properties dialog for the Examples project (Right click the Examples project of your + choice in the Solution Explorer and select the Properties option from the context menu.). +- Navigate to the Debug Tab and enter the command line options. The command line options are of + the form `version.examplename`. For instance, `v201402.AddCampaign` is the command line option to + run `AddCampaign` example in `v201402` version of the AdWords API. - Compile and run the Examples project. -Alternatively, each code example has a `main()` method, so you can set the appropriate code example as the Startup object (Select the Application tab on the Examples Properties dialog and pick the desired class from the "Startup object" dropdown.). +Alternatively, each code example has a `main()` method, so you can set the appropriate code example + as the Startup object (Select the Application tab on the Examples Properties dialog and pick + the desired class from the "Startup object" dropdown.). To use the library in a new project: - Create a new Visual Studio project of your choice (for instance, a C# Windows application). -- Copy the lib folder from the binary distribution to your project folder. Add references to all the assemblies in this folder in your project. +- Copy the lib folder from the binary distribution to your project folder. Add references to all + the assemblies in this folder in your project. - Add a reference to System.Web.Services in your project. - Copy `examples\App.config` to your project directory and add it to your project. -- Edit the required keys in `App.config`. If your application has its own `App.config`, then you need to merge its contents with the contents of `examples\App.config`. +- Edit the required keys in `App.config`. If your application has its own `App.config`, then you + need to merge its contents with the contents of `examples\App.config`. - Make a call to the library, e.g.: ``` @@ -92,14 +118,19 @@ AdWordsUser user = new AdWordsUser(); // Create the required service. CampaignService service = (CampaignService) user.GetService( AdWordsService.v201402.CampaignService); - + // make more calls to service class. ``` -You can refer to [this wiki article](/googleads/googleads-dotnet-lib/wiki/Getting-Started) for more details. +You can refer to [this wiki article](/googleads/googleads-dotnet-lib/wiki/Getting-Started) for + more details. ##Source distribution -The source distribution of the Ads API .NET Client Library consists of individual Visual Studio projects for the client library, code examples and test cases, documentation, and support libraries and tools for compiling and running the library. If you are interested in the library internals you should download this distribution. There are separate downloads for AdWords, AdxBuyer, DFP and DFA APIs. +The source distribution of the Ads API .NET Client Library consists of individual Visual Studio + projects for the client library, code examples and test cases, documentation, and support + libraries and tools for compiling and running the library. If you are interested in the + library internals you should download this distribution. There are separate downloads for + AdWords, AdxBuyer, DFP and DFA APIs. ``` The contents of this distribution are as follows: @@ -126,43 +157,57 @@ The contents of this distribution are as follows: To compile and run the project: - Open the Visual Studio solution in Microsoft Visual Studio. -- Open `App.config` for the examples project of your choice and follow the instructions in the file to enter required configuration values. +- Open `App.config` for the examples project of your choice and follow the instructions in the + file to enter required configuration values. - Save and close `App.config`. -- Open the Properties dialog for the Examples project (Right click the Examples project in the Solution Explorer and select the Properties option from the context menu.). -- Navigate to the Debug tab and enter the command line options. The command line options are of the form `version.examplename`. For instance, `v201402.AddCampaign` is the command line option to run the `AddCampaign` example for the `v201402` version of the AdWords API. +- Open the Properties dialog for the Examples project (Right click the Examples project in the + Solution Explorer and select the Properties option from the context menu.). +- Navigate to the Debug tab and enter the command line options. The command line options are of + the form `version.examplename`. For instance, `v201402.AddCampaign` is the command line option + to run the `AddCampaign` example for the `v201402` version of the AdWords API. - Set the Examples project as the Startup project. - Compile and run the Examples project. -Alternatively, each code example has a `main()` method, so you can set the appropriate code example as the Startup object (Select the Application tab on the Examples Properties dialog and pick the desired class from the "Startup object" dropdown.). +Alternatively, each code example has a `main()` method, so you can set the appropriate code + example as the Startup object (Select the Application tab on the Examples Properties dialog and + pick the desired class from the "Startup object" dropdown.). -To run the test cases, you need to download and install the latest version of NUnit from http://www.nunit.org/. Once you have installed NUnit, you can compile and run the test cases as follows: +To run the test cases, you need to download and install the latest version of NUnit from + http://www.nunit.org/. Once you have installed NUnit, you can compile and run the test cases + as follows: - Right click the appropriate Tests project and choose References from the context menu. - From the references dialog, add a reference to the `nunit.framework` assembly. -- Right click theTests project and choose Properties. Navigate to the Debug tab and choose "Start external program". Browse to the path for `nunit.exe` and pick it as the Startup application. -- Open `App.config` for the test project and follow the instructions in the file to enter required configuration values. +- Right click theTests project and choose Properties. Navigate to the Debug tab and choose + "Start external program". Browse to the path for `nunit.exe` and pick it as the Startup + application. +- Open `App.config` for the test project and follow the instructions in the file to enter + required configuration values. - Set the `AdWords.Tests` project as the startup project and run the project. -It is recommended that you run the test cases against a test environment. Refer to the appropriate API documentation for details on how this may be done. +It is recommended that you run the test cases against a test environment. Refer to the + appropriate API documentation for details on how this may be done. ###Miscellaneous ####Wiki - https://github.com/googleads/googleads-dotnet-lib/wiki ####Issue tracker -- https://github.com/googleads/googleads-dotnet-lib/issues +- https://github.com/googleads/googleads-dotnet-lib/issues ####API Documentation: - AdWords API: https://developers.google.com/adwords/api/ -- AdxBuyer API: https://developers.google.com/ad-exchange/buyer-soap/ +- AdxBuyer API: https://developers.google.com/ad-exchange/buyer-soap/ - DFP API: https://developers.google.com/doubleclick-publishers/ - DFA API: https://developers.google.com/doubleclick-advertisers/ ###Support forum - AdWords API: https://developers.google.com/adwords/api/community/ -- AdxBuyer API: https://developers.google.com/ad-exchange/buyer-soap/community/ +- AdxBuyer API: https://developers.google.com/ad-exchange/buyer-soap/community/ - DFP API: https://developers.google.com/doubleclick-publishers/community - DFA API: https://developers.google.com/doubleclick-advertisers/community - + ###Authors -List all github profiles here +- https://github.com/AnashOommen +- https://github.com/Narwalter +- https://github.com/jimper diff --git a/examples/AdWords/CSharp/AdWords.Examples.CSharp.csproj b/examples/AdWords/CSharp/AdWords.Examples.CSharp.csproj new file mode 100644 index 00000000000..d07a1782563 --- /dev/null +++ b/examples/AdWords/CSharp/AdWords.Examples.CSharp.csproj @@ -0,0 +1,302 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {5C1DE791-767A-4599-A0B9-51D6D2DFCC81} + Exe + Properties + Google.Api.Ads.AdWords.Examples.CSharp + Google.AdWords.Examples.CSharp + Google.Api.Ads.AdWords.Examples.CSharp.Program + v4.0 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AnyCPU + 0618 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + {277404DB-A439-4450-B3A5-186294CDF245} + Common + + + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745} + AdWords + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/AdWords/CSharp/App.config b/examples/AdWords/CSharp/App.config new file mode 100644 index 00000000000..1ee298baf62 --- /dev/null +++ b/examples/AdWords/CSharp/App.config @@ -0,0 +1,192 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/AdWords/CSharp/ExampleBase.cs b/examples/AdWords/CSharp/ExampleBase.cs new file mode 100644 index 00000000000..e31850d2eee --- /dev/null +++ b/examples/AdWords/CSharp/ExampleBase.cs @@ -0,0 +1,35 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp { + /// + /// This abstract class represents a code example. + /// + public abstract class ExampleBase { + /// + /// Returns a description about the code example. + /// + public abstract string Description { + get; + } + } +} diff --git a/examples/AdWords/CSharp/ExampleUtilities.cs b/examples/AdWords/CSharp/ExampleUtilities.cs new file mode 100644 index 00000000000..abbd9ae4c59 --- /dev/null +++ b/examples/AdWords/CSharp/ExampleUtilities.cs @@ -0,0 +1,100 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.Reflection; + +namespace Google.Api.Ads.AdWords.Examples.CSharp { + /// + /// Utility class for assisting in running code examples. + /// + public class ExampleUtilities { + /// + /// Gets a random string. Useful for generating unique names for campaigns, + /// ad groups, etc. + /// + /// The current timestamp as a string. + public static string GetRandomString() { + return string.Format("{0} - {1}", Guid.NewGuid(), + DateTime.Now.ToString("yyyy-M-d H-m-s.ffffff")); + } + + /// + /// Gets a random string. Useful for generating unique names for campaigns, + /// ad groups, etc. + /// + /// The current timestamp as a string. + public static string GetShortRandomString() { + return Guid.NewGuid().ToString().Substring(0, 8); + } + + /// + /// Formats the exception as a printable message. + /// + /// The exception. + /// The formatted exception string. + public static string FormatException(Exception ex) { + List messages = new List(); + Exception rootEx = ex; + while (rootEx != null) { + messages.Add(String.Format("{0} ({1})\n\n{2}\n", rootEx.GetType().ToString(), + rootEx.Message, rootEx.StackTrace)); + rootEx = rootEx.InnerException; + } + return String.Join("\nCaused by\n\n", messages.ToArray()); + } + + /// + /// Gets the current user's home directory. + /// + /// The current user's home directory. + public static String GetHomeDir() { + return Environment.GetEnvironmentVariable("USERPROFILE"); + } + + /// + /// Gets the parameters for running the code example. + /// + /// The method info for Run method in code + /// example. + /// An array of parameters for running the code example. + public static List GetParameters(MethodInfo methodInfo) { + List retval = new List(); + ParameterInfo[] paramInfos = methodInfo.GetParameters(); + for (int i = 1; i < paramInfos.Length; i++) { + ParameterInfo paramInfo = paramInfos[i]; + Console.Write("Enter {0}: ", paramInfo.Name); + string value = Console.ReadLine(); + object objValue = null; + if (paramInfo.ParameterType == typeof(long)) { + objValue = long.Parse(value); + } else if (paramInfo.ParameterType == typeof(double)) { + objValue = double.Parse(value); + } else if (paramInfo.ParameterType == typeof(string)) { + objValue = value; + } else if (paramInfo.ParameterType.IsEnum) { + objValue = Enum.Parse(paramInfo.ParameterType, value); + } else { + throw new ApplicationException("Unknown parameter type : " + + paramInfo.ParameterType.FullName); + } + retval.Add(objValue); + } + return retval; + } + } +} diff --git a/examples/AdWords/CSharp/OAuth/AdWords.Examples.CSharp.OAuth.csproj b/examples/AdWords/CSharp/OAuth/AdWords.Examples.CSharp.OAuth.csproj new file mode 100644 index 00000000000..83c2bd8d13e --- /dev/null +++ b/examples/AdWords/CSharp/OAuth/AdWords.Examples.CSharp.OAuth.csproj @@ -0,0 +1,86 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {4641ADD7-0D1F-473D-B713-2830C5029367} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Google.Api.Ads.AdWords.Examples.CSharp.OAuth + Google.AdWords.Examples.CSharp.OAuth + v4.0 + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + AnyCPU + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + + + + + + + + + + + {277404DB-A439-4450-B3A5-186294CDF245} + Common + + + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745} + AdWords + + + + + + + + + + True + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/AdWords/CSharp/OAuth/ConsoleExample.cs b/examples/AdWords/CSharp/OAuth/ConsoleExample.cs new file mode 100644 index 00000000000..0a0330df5f4 --- /dev/null +++ b/examples/AdWords/CSharp/OAuth/ConsoleExample.cs @@ -0,0 +1,140 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; +using Google.Api.Ads.Common.Lib; + +using System; +using System.Data; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.OAuth { + /// + /// This code example shows how to run an AdWords API command line application + /// while incorporating the OAuth2 installed application flow into your + /// application. If your application uses a single MCC login to make calls to + /// all your accounts, you shouldn't use this code example. Instead, you + /// should run Common\Util\OAuth2TokenGenerator.cs to generate a refresh token + /// and set that in user.Config.OAuth2RefreshToken field, or set + /// OAuth2RefreshToken key in your App.config / Web.config. + /// + /// This code example depends on Console environment only for reading and + /// writing values, you may use this code example in other environments like + /// Windows Form applications with minimial modifications. + /// + /// To run this application, + /// + /// 1. You should create a new Console Application project. + /// 2. Add reference to the following assemblies: + /// + /// Google.Ads.Common.dll + /// Google.Ads.OAuth.dll + /// Google.AdWords.dll + /// System.Web + /// System.Configuration + /// + /// 3. Replace the Main() method with this class's method. + /// 4. Copy App.config from AdWords.Examples.CSharp project, and configure + /// it as shown in ths project's Web.config. + /// 5. Compile and run this example. + /// + public class ConsoleExample { + /// + /// The main method. + /// + /// Command line arguments. + static void Main(string[] args) { + AdWordsUser user = new AdWordsUser(); + AdWordsAppConfig config = (user.Config as AdWordsAppConfig); + if (config.AuthorizationMethod == AdWordsAuthorizationMethod.OAuth2) { + if (config.OAuth2Mode == OAuth2Flow.APPLICATION && + string.IsNullOrEmpty(config.OAuth2RefreshToken)) { + DoAuth2Authorization(user); + } + } else { + throw new Exception("Authorization mode is not OAuth."); + } + + Console.Write("Enter the customer id: "); + string customerId = Console.ReadLine(); + config.ClientCustomerId = customerId; + + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201309.CampaignService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Name", "Status"}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + CampaignPage page = new CampaignPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the campaigns. + page = campaignService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (Campaign campaign in page.entries) { + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = '{3}'" + + " was found.", i + 1, campaign.id, campaign.name, campaign.status); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve campaigns", ex); + } + } + + /// + /// Does the OAuth2 authorization for installed applications. + /// + /// The AdWords user. + private static void DoAuth2Authorization(AdWordsUser user) { + // Since we are using a console application, set the callback url to null. + user.Config.OAuth2RedirectUri = null; + AdsOAuthProviderForApplications oAuth2Provider = + (user.OAuthProvider as AdsOAuthProviderForApplications); + // Get the authorization url. + string authorizationUrl = oAuth2Provider.GetAuthorizationUrl(); + Console.WriteLine("Open a fresh web browser and navigate to \n\n{0}\n\n. You will be " + + "prompted to login and then authorize this application to make calls to the " + + "AdWords API. Once approved, you will be presented with an authorization code.", + authorizationUrl); + + // Accept the OAuth2 authorization code from the user. + Console.Write("Enter the authorization code :"); + string authorizationCode = Console.ReadLine(); + + // Fetch the access and refresh tokens. + oAuth2Provider.FetchAccessAndRefreshTokens(authorizationCode); + } + } +} diff --git a/examples/AdWords/CSharp/OAuth/Default.aspx b/examples/AdWords/CSharp/OAuth/Default.aspx new file mode 100644 index 00000000000..093d0fb4324 --- /dev/null +++ b/examples/AdWords/CSharp/OAuth/Default.aspx @@ -0,0 +1,53 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" + Inherits="Google.Api.Ads.AdWords.Examples.CSharp.OAuth.Default" %> + + + + + + AdWords API - OAuth demo + + +
+

AdWords API OAuth demo

+

+ This code example uses OAuth to retrieve the list all campaigns in your account. +

+ +

+ + + + +
+
+ + + + + + + diff --git a/examples/AdWords/CSharp/OAuth/Default.aspx.cs b/examples/AdWords/CSharp/OAuth/Default.aspx.cs new file mode 100644 index 00000000000..0b81b03ece1 --- /dev/null +++ b/examples/AdWords/CSharp/OAuth/Default.aspx.cs @@ -0,0 +1,232 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util.Reports; +using Google.Api.Ads.AdWords.v201309; +using Google.Api.Ads.Common.Lib; + +using System; +using System.Data; +using System.IO; +using System.Web.UI.WebControls; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.OAuth { + /// + /// Code-behind class for Default.aspx. + /// + public partial class Default : System.Web.UI.Page { + /// + /// The user for creating services and making AdWords API calls. + /// + AdWordsUser user; + + /// + /// Handles the Load event of the Page control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + void Page_Load(object sender, EventArgs e) { + user = new AdWordsUser(); + } + + /// + /// Handles the Click event of the btnAuthorize control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + protected void OnAuthorizeButtonClick(object sender, EventArgs e) { + // This code example shows how to run an AdWords API web application + // while incorporating the OAuth2 web application flow into your + // application. If your application uses a single MCC login to make calls + // to all your accounts, you shouldn't use this code example. Instead, you + // should run Common\Util\OAuth2TokenGenerator.cs to generate a refresh + // token and set that in user.Config.OAuth2RefreshToken field, or set + // OAuth2RefreshToken key in your App.config / Web.config. + AdWordsAppConfig config = user.Config as AdWordsAppConfig; + if (config.AuthorizationMethod == AdWordsAuthorizationMethod.OAuth2) { + if (user.Config.OAuth2Mode == OAuth2Flow.APPLICATION && + string.IsNullOrEmpty(config.OAuth2RefreshToken)) { + Response.Redirect("OAuthLogin.aspx"); + } + } else { + throw new Exception("Authorization mode is not OAuth."); + } + } + + /// + /// Handles the Click event of the btnDownloadReport control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + protected void OnDownloadReportButtonClick(object sender, EventArgs e) { + ConfigureUserForOAuth(); + ReportDefinition definition = new ReportDefinition(); + + definition.reportName = "Last 7 days CRITERIA_PERFORMANCE_REPORT"; + definition.reportType = ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT; + definition.downloadFormat = DownloadFormat.GZIPPED_CSV; + definition.dateRangeType = ReportDefinitionDateRangeType.LAST_7_DAYS; + + // Create selector. + Selector selector = new Selector(); + selector.fields = new string[] {"CampaignId", "AdGroupId", "Id", "CriteriaType", "Criteria", + "CriteriaDestinationUrl", "Clicks", "Impressions", "Cost"}; + + Predicate predicate = new Predicate(); + predicate.field = "Status"; + predicate.@operator = PredicateOperator.IN; + predicate.values = new string[] {"ACTIVE", "PAUSED"}; + selector.predicates = new Predicate[] {predicate}; + + definition.selector = selector; + definition.includeZeroImpressions = true; + + string filePath = Path.GetTempFileName(); + + try { + // If you know that your report is small enough to fit in memory, then + // you can instead use + // ReportUtilities utilities = new ReportUtilities(user); + // utilities.ReportVersion = "v201309"; + // ClientReport report = utilities.GetClientReport(definition); + // + // // Get the text report directly if you requested a text format + // // (e.g. xml) + // string reportText = report.Text; + // + // // Get the binary report if you requested a binary format + // // (e.g. gzip) + // byte[] reportBytes = report.Contents; + // + // // Deflate a zipped binary report for further processing. + // string deflatedReportText = Encoding.UTF8.GetString( + // MediaUtilities.DeflateGZipData(report.Contents)); + + // Set the customer id. + (user.Config as AdWordsAppConfig).ClientCustomerId = txtCustomerId.Text; + ReportUtilities utilities = new ReportUtilities(user); + utilities.ReportVersion = "v201309"; + utilities.DownloadClientReport(definition, filePath); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to download report.", ex); + } + Response.AddHeader("content-disposition", "attachment;filename=report.gzip"); + Response.WriteFile(filePath); + Response.End(); + } + + /// + /// Handles the Click event of the btnGetCampaigns control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + protected void OnGetCampaignsButtonClick(object sender, EventArgs e) { + ConfigureUserForOAuth(); + + // Now proceed to make your API calls as usual. + // Create a selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Name", "Status"}; + + OrderBy orderByName = new OrderBy(); + orderByName.field = "Name"; + orderByName.sortOrder = SortOrder.ASCENDING; + + selector.ordering = new OrderBy[] {orderByName}; + (user.Config as AdWordsAppConfig).ClientCustomerId = txtCustomerId.Text; + + try { + CampaignService service = + (CampaignService) user.GetService(AdWordsService.v201309.CampaignService); + + CampaignPage page = service.get(selector); + + // Display campaigns. + if (page != null && page.entries != null && page.entries.Length > 0) { + DataTable dataTable = new DataTable(); + dataTable.Columns.AddRange(new DataColumn[] { + new DataColumn("Serial No.", typeof(int)), + new DataColumn("Campaign Id", typeof(long)), + new DataColumn("Campaign Name", typeof(string)), + new DataColumn("Status", typeof(string)) + }); + for (int i = 0; i < page.entries.Length; i++) { + Campaign campaign = page.entries[i]; + DataRow dataRow = dataTable.NewRow(); + dataRow.ItemArray = new object[] {i + 1, campaign.id, campaign.name, + campaign.status.ToString() + }; + dataTable.Rows.Add(dataRow); + } + CampaignGrid.DataSource = dataTable; + CampaignGrid.DataBind(); + } else { + Response.Write("No campaigns were found."); + } + } catch (Exception ex) { + Response.Write(string.Format("Failed to get campaigns. Exception says \"{0}\"", + ex.Message)); + } + } + + /// + /// Configures the AdWords user for OAuth. + /// + private void ConfigureUserForOAuth() { + AdWordsAppConfig config = (user.Config as AdWordsAppConfig); + if (config.AuthorizationMethod == AdWordsAuthorizationMethod.OAuth2) { + user.OAuthProvider = (OAuth2ProviderForApplications) Session["OAuthProvider"]; + if (config.OAuth2Mode == OAuth2Flow.APPLICATION && + string.IsNullOrEmpty(config.OAuth2RefreshToken)) { + user.OAuthProvider = (OAuth2ProviderForApplications) Session["OAuthProvider"]; + } + } else { + throw new Exception("Authorization mode is not OAuth."); + } + } + + /// + /// Handles the Click event of the btnLogout control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + protected void OnLogoutButtonClick(object sender, EventArgs e) { + Session.Clear(); + } + + /// + /// Handles the RowDataBound event of the CampaignGrid control. + /// + /// The source of the event. + /// The + /// instance + /// containing the event data. + protected void CampaignGrid_RowDataBound(object sender, GridViewRowEventArgs e) { + if (e.Row.DataItemIndex >= 0) { + e.Row.Cells[0].HorizontalAlign = HorizontalAlign.Center; + e.Row.Cells[1].HorizontalAlign = HorizontalAlign.Center; + e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Left; + e.Row.Cells[3].HorizontalAlign = HorizontalAlign.Center; + } + } + } +} diff --git a/examples/AdWords/CSharp/OAuth/Default.aspx.designer.cs b/examples/AdWords/CSharp/OAuth/Default.aspx.designer.cs new file mode 100644 index 00000000000..eeedbb506e8 --- /dev/null +++ b/examples/AdWords/CSharp/OAuth/Default.aspx.designer.cs @@ -0,0 +1,86 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.5456 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Google.Api.Ads.AdWords.Examples.CSharp.OAuth { + public partial class Default { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// btnAuthorize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAuthorize; + + /// + /// btnLogout control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnLogout; + + /// + /// lblCustomerId control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblCustomerId; + + /// + /// txtCustomerId control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtCustomerId; + + /// + /// btnGetCampaigns control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnGetCampaigns; + + /// + /// btnDownloadReport control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnDownloadReport; + + /// + /// CampaignGrid control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView CampaignGrid; + } +} diff --git a/examples/AdWords/CSharp/OAuth/OAuthLogin.aspx b/examples/AdWords/CSharp/OAuth/OAuthLogin.aspx new file mode 100644 index 00000000000..2cdcc9cdb1a --- /dev/null +++ b/examples/AdWords/CSharp/OAuth/OAuthLogin.aspx @@ -0,0 +1,34 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OAuthLogin.aspx.cs" + Inherits="Google.Api.Ads.AdWords.Examples.CSharp.OAuth.OAuthLogin" %> + + + + + + Untitled Page + + +
+
+ +
+
+ + diff --git a/examples/AdWords/CSharp/OAuth/OAuthLogin.aspx.cs b/examples/AdWords/CSharp/OAuth/OAuthLogin.aspx.cs new file mode 100644 index 00000000000..86ed1938f65 --- /dev/null +++ b/examples/AdWords/CSharp/OAuth/OAuthLogin.aspx.cs @@ -0,0 +1,111 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections; +using System.Configuration; +using System.Data; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.HtmlControls; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.OAuth { + /// + /// Login and callback page for handling OAuth2 authentication. + /// + public partial class OAuthLogin : Page { + /// + /// Handles the Load event of the Page control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + protected void Page_Load(object sender, EventArgs e) { + // Create an AdWordsAppConfig object with the default settings in + // App.config. + AdWordsAppConfig config = new AdWordsAppConfig(); + if (config.AuthorizationMethod == AdWordsAuthorizationMethod.OAuth2) { + if (config.OAuth2Mode == OAuth2Flow.APPLICATION && + string.IsNullOrEmpty(config.OAuth2RefreshToken)) { + DoAuth2Configuration(config); + } + } + } + + private void DoAuth2Configuration(AdWordsAppConfig config) { + // Since we use this page for OAuth callback also, we set the callback + // url as the current page. For a non-web application, this will be null. + config.OAuth2RedirectUri = Request.Url.GetLeftPart(UriPartial.Path); + + // Create an OAuth2 object for handling OAuth2 flow. + OAuth2ProviderForApplications oAuth = new OAuth2ProviderForApplications(config); + + if (Request.Params["state"] == null) { + // This is the first time this page is being loaded. + // Set the state variable to any value that helps you recognize + // when this url will be called by the OAuth2 server. + oAuth.State = "callback"; + + // Create an authorization url and redirect the user to that page. + Response.Redirect(oAuth.GetAuthorizationUrl()); + } else if (Request.Params["state"] == "callback") { + // This page was loaded because OAuth server did a callback. + // Retrieve the authorization code from the url and use it to fetch + // the access token. This call will also fetch the refresh token if + // your mode is offline. + oAuth.FetchAccessAndRefreshTokens(Request.Params["code"]); + + // Save the OAuth2 provider for future use. If you wish to save only + // the values and restore the object later, then save + // oAuth.RefreshToken, oAuth.AccessToken, oAuth.UpdatedOn and + // oAuth.ExpiresIn. + // + // You can later restore the values as + // AdWordsUser user = new AdWordsUser(); + // user.Config.OAuth2Mode = OAuth2Flow.APPLICATION; + // OAuth2ProviderForApplications oAuth = + // (user.OAuthProvider as OAuth2ProviderForApplications); + // oAuth.RefreshToken = xxx; + // oAuth.AccessToken = xxx; + // oAuth.UpdatedOn = xxx; + // oAuth.ExpiresIn = xxx; + // + // Note that only oAuth.RefreshToken is mandatory. If you leave + // oAuth.AccessToken as empty, or if oAuth.UpdatedOn + oAuth.ExpiresIn + // is in the past, the access token will be refreshed by the library. + // You can listen to this event as + // + // oAuth.OnOAuthTokensObtained += delegate(AdsOAuthProvider provider) { + // OAuth2ProviderForApplications oAuth = + // (provider as OAuth2ProviderForApplications); + // // Save oAuth.RefreshToken, oAuth.AccessToken, oAuth.UpdatedOn and + // // oAuth.ExpiresIn. + //}; + Session["OAuthProvider"] = oAuth; + // Redirect the user to the main page. + Response.Redirect("Default.aspx"); + } else { + throw new Exception("Unknown state for OAuth callback."); + } + } + } +} diff --git a/examples/AdWords/CSharp/OAuth/OAuthLogin.aspx.designer.cs b/examples/AdWords/CSharp/OAuth/OAuthLogin.aspx.designer.cs new file mode 100644 index 00000000000..3b527d3b084 --- /dev/null +++ b/examples/AdWords/CSharp/OAuth/OAuthLogin.aspx.designer.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.5456 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Google.Api.Ads.AdWords.Examples.CSharp.OAuth { + + + public partial class OAuthLogin { + + /// + /// Head1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlHead Head1; + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + } +} diff --git a/examples/AdWords/CSharp/OAuth/Properties/AssemblyInfo.cs b/examples/AdWords/CSharp/OAuth/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..1e0b681e12e --- /dev/null +++ b/examples/AdWords/CSharp/OAuth/Properties/AssemblyInfo.cs @@ -0,0 +1,37 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("AdWords API DotNet Library OAuth Samples")] +[assembly: AssemblyDescription("This application contains samples that shows how to use AdWords " + + "API using the client library and OAuth as authentication mechanism.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")] diff --git a/examples/AdWords/CSharp/OAuth/Properties/Properties.cs b/examples/AdWords/CSharp/OAuth/Properties/Properties.cs new file mode 100644 index 00000000000..de944c8264a --- /dev/null +++ b/examples/AdWords/CSharp/OAuth/Properties/Properties.cs @@ -0,0 +1,24 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; + +[assembly: AssemblyCompany("Google")] +[assembly: AssemblyProduct("AdWords API DotNet Client Library")] +[assembly: AssemblyCopyright("Copyright 2011, Google Inc. All Rights Reserved.")] + +[assembly: AssemblyVersion("18.0.0.0")] +[assembly: AssemblyFileVersion("18.0.0.0")] diff --git a/examples/AdWords/CSharp/OAuth/Web.config b/examples/AdWords/CSharp/OAuth/Web.config new file mode 100644 index 00000000000..c140a7e5e84 --- /dev/null +++ b/examples/AdWords/CSharp/OAuth/Web.config @@ -0,0 +1,196 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/AdWords/CSharp/OAuth/css/main.css b/examples/AdWords/CSharp/OAuth/css/main.css new file mode 100644 index 00000000000..e2a5949ccfb --- /dev/null +++ b/examples/AdWords/CSharp/OAuth/css/main.css @@ -0,0 +1,26 @@ +/** + * Copyright 2011, Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http: *www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + + * Author: api.anash@gmail.com (Anash P. Oommen) + */ + +body { + font-family: Verdana; + font-size:10pt; +} +h1 { + font-family: Arial; + font-size:20pt; +} diff --git a/examples/AdWords/CSharp/Program.cs b/examples/AdWords/CSharp/Program.cs new file mode 100644 index 00000000000..ce0903c0c94 --- /dev/null +++ b/examples/AdWords/CSharp/Program.cs @@ -0,0 +1,167 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; + +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Reflection; + +using ExamplePair = System.Collections.Generic.KeyValuePair; +using System.Threading; + +namespace Google.Api.Ads.AdWords.Examples.CSharp { + /// + /// The Main class for this application. + /// + class Program { + /// + /// A map to hold the code examples to be executed. + /// + static List codeExampleMap = new List(); + + /// + /// A flag to keep track of whether help message was shown earlier. + /// + private static bool helpShown = false; + + /// + /// Registers the code example. + /// + /// The code example name. + /// The code example instance. + static void RegisterCodeExample(string key, object value) { + codeExampleMap.Add(new ExamplePair(key, value)); + } + + /// + /// Static constructor to initialize the sample map. + /// + static Program() { + Type[] types = Assembly.GetExecutingAssembly().GetTypes(); + + foreach (Type type in types) { + if (type.IsSubclassOf(typeof(ExampleBase))) { + RegisterCodeExample(type.FullName.Replace(typeof(Program).Namespace + ".", ""), + Activator.CreateInstance(type)); + } + } + } + + /// + /// The main method. + /// + /// The command line arguments. + public static void Main(string[] args) { + if (args.Length == 0) { + ShowUsage(); + return; + } + + AdWordsUser user = new AdWordsUser(); + foreach (string cmdArgs in args) { + ExamplePair matchingPair = codeExampleMap.Find(delegate(ExamplePair pair) { + return string.Compare(pair.Key, cmdArgs, true) == 0; + }); + + if (matchingPair.Key != null) { + RunACodeExample(user, matchingPair.Value); + } else { + ShowUsage(); + } + } + } + + /// + /// Runs a code example. + /// + /// The user whose credentials should be used for + /// running the code example. + /// The code example to run. + private static void RunACodeExample(AdWordsUser user, object codeExample) { + try { + Console.WriteLine(GetDescription(codeExample)); + InvokeRun(codeExample, user); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } finally { + Console.WriteLine("Press [Enter] to continue"); + Console.ReadLine(); + } + } + + /// + /// Gets the description for the code example. + /// + /// The code example. + /// The description. + private static object GetDescription(object codeExample) { + Type exampleType = codeExample.GetType(); + return exampleType.GetProperty("Description").GetValue(codeExample, null); + } + + /// + /// Gets the parameters for running a code example. + /// + /// The user. + /// The code example. + /// The list of parameters. + private static object[] GetParameters(AdWordsUser user, object codeExample) { + MethodInfo methodInfo = codeExample.GetType().GetMethod("Run"); + List parameters = new List(); + parameters.Add(user); + parameters.AddRange(ExampleUtilities.GetParameters(methodInfo)); + return parameters.ToArray(); + } + + /// + /// Invokes the run method. + /// + /// The code example. + /// The user. + private static void InvokeRun(object codeExample, AdWordsUser user) { + MethodInfo methodInfo = codeExample.GetType().GetMethod("Run"); + methodInfo.Invoke(codeExample, GetParameters(user, codeExample)); + } + + /// + /// Prints program usage message. + /// + private static void ShowUsage() { + if (helpShown) { + return; + } else { + helpShown = true; + } + string exeName = Path.GetFileName(Assembly.GetExecutingAssembly().Location); + Console.WriteLine("Runs AdWords API code examples"); + Console.WriteLine("Usage : {0} [flags]\n", exeName); + Console.WriteLine("Available flags\n"); + Console.WriteLine("--help\t\t : Prints this help message.", exeName); + Console.WriteLine("--all\t\t : Run all code examples.", exeName); + Console.WriteLine("examplename1 [examplename1 ...] : " + + "Run specific code examples. Example name can be one of the following:\n", exeName); + foreach (ExamplePair pair in codeExampleMap) { + Console.WriteLine("{0} : {1}", pair.Key, GetDescription(pair.Value)); + } + Console.WriteLine("Press [Enter] to continue"); + Console.ReadLine(); + } + } +} diff --git a/examples/AdWords/CSharp/Properties/AssemblyInfo.cs b/examples/AdWords/CSharp/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..c78648350a1 --- /dev/null +++ b/examples/AdWords/CSharp/Properties/AssemblyInfo.cs @@ -0,0 +1,37 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("AdWords API DotNet Library Samples")] +[assembly: AssemblyDescription( + "This application contains samples that shows how to AdWords API using the client library.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("ccc25b61-18d8-49d5-993c-5fd838a03435")] diff --git a/examples/AdWords/CSharp/Properties/Properties.cs b/examples/AdWords/CSharp/Properties/Properties.cs new file mode 100644 index 00000000000..de944c8264a --- /dev/null +++ b/examples/AdWords/CSharp/Properties/Properties.cs @@ -0,0 +1,24 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; + +[assembly: AssemblyCompany("Google")] +[assembly: AssemblyProduct("AdWords API DotNet Client Library")] +[assembly: AssemblyCopyright("Copyright 2011, Google Inc. All Rights Reserved.")] + +[assembly: AssemblyVersion("18.0.0.0")] +[assembly: AssemblyFileVersion("18.0.0.0")] diff --git a/examples/AdWords/CSharp/v201309/AccountManagement/CreateAccount.cs b/examples/AdWords/CSharp/v201309/AccountManagement/CreateAccount.cs new file mode 100644 index 00000000000..55dd7826f50 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AccountManagement/CreateAccount.cs @@ -0,0 +1,95 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example illustrates how to create an account. Note by default, + /// this account will only be accessible via its parent MCC. + /// + /// Tags: ManagedCustomerService.mutate + /// + public class CreateAccount : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + CreateAccount codeExample = new CreateAccount(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create an account. Note by default " + + "this account will only be accessible via its parent MCC."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ManagedCustomerService. + ManagedCustomerService managedCustomerService = (ManagedCustomerService) user.GetService( + AdWordsService.v201309.ManagedCustomerService); + + // Create account. + ManagedCustomer customer = new ManagedCustomer(); + customer.name = "Customer created with ManagedCustomerService on " + + new DateTime().ToString(); + customer.currencyCode = "EUR"; + customer.dateTimeZone = "Europe/London"; + + // Create operations. + ManagedCustomerOperation operation = new ManagedCustomerOperation(); + operation.operand = customer; + operation.@operator = Operator.ADD; + try { + ManagedCustomerOperation[] operations = new ManagedCustomerOperation[] {operation}; + // Add account. + ManagedCustomerReturnValue result = managedCustomerService.mutate(operations); + + // Display accounts. + if (result.value != null && result.value.Length > 0) { + ManagedCustomer customerResult = result.value[0]; + Console.WriteLine("Account with customer ID \"{0}\" was created.", + customerResult.customerId); + } else { + Console.WriteLine("No accounts were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create accounts.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/AccountManagement/GetAccountAlerts.cs b/examples/AdWords/CSharp/v201309/AccountManagement/GetAccountAlerts.cs new file mode 100644 index 00000000000..8d94da8718d --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AccountManagement/GetAccountAlerts.cs @@ -0,0 +1,126 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example gets all alerts for all clients of an MCC account. + /// The effective user (ClientCustomerId or AuthToken) must be an MCC user + /// to get results. This code example won't work with Test Accounts. See + /// https://developers.google.com/adwords/api/docs/test-accounts + /// + /// Tags: AlertService.get + /// + public class GetAccountAlerts : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAccountAlerts codeExample = new GetAccountAlerts(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all alerts for all clients of an MCC account. The " + + "effective user (ClientCustomerId or AuthToken) must be an MCC user to get results. " + + "This code example won't work with Test Accounts. See " + + "https://developers.google.com/adwords/api/docs/test-accounts"; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the AlertService. + AlertService alertService = (AlertService) user.GetService( + AdWordsService.v201309.AlertService); + + // Create the selector. + AlertSelector selector = new AlertSelector(); + + // Create the alert query. + AlertQuery query = new AlertQuery(); + query.filterSpec = FilterSpec.ALL; + query.clientSpec = ClientSpec.ALL; + query.triggerTimeSpec = TriggerTimeSpec.ALL_TIME; + query.severities = new AlertSeverity[] {AlertSeverity.GREEN, AlertSeverity.YELLOW, + AlertSeverity.RED}; + + // Enter all possible values of AlertType to get all alerts. If you are + // interested only in specific alert types, then you may also do it as + // follows: + // query.types = new AlertType[] {AlertType.CAMPAIGN_ENDING, + // AlertType.CAMPAIGN_ENDED}; + query.types = (AlertType[]) Enum.GetValues(typeof(AlertType)); + selector.query = query; + + // Set paging for selector. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AlertPage page = new AlertPage(); + + try { + do { + // Get account alerts. + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + page = alertService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (Alert alert in page.entries) { + Console.WriteLine("{0}) Customer Id is {1:###-###-####}, Alert type is '{2}', " + + "Severity is {3}", i + 1, alert.clientCustomerId, alert.alertType, + alert.alertSeverity); + for (int j = 0; j < alert.details.Length; j++) { + Console.WriteLine(" - Triggered at {0}", alert.details[j].triggerTime); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of alerts found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve alerts.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/AccountManagement/GetAccountChanges.cs b/examples/AdWords/CSharp/v201309/AccountManagement/GetAccountChanges.cs new file mode 100644 index 00000000000..eb87a055512 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AccountManagement/GetAccountChanges.cs @@ -0,0 +1,176 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example gets the changes in the account during the last 24 + /// hours. + /// + /// Tags: CustomerSyncService.get + /// + public class GetAccountChanges : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAccountChanges codeExample = new GetAccountChanges(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the changes in the account during the last 24 hours."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the CustomerSyncService. + CustomerSyncService customerSyncService = + (CustomerSyncService) user.GetService(AdWordsService.v201309. + CustomerSyncService); + + // The date time string should be of the form yyyyMMdd HHmmss zzz + string minDateTime = DateTime.Now.AddDays(-1).ToUniversalTime().ToString("yyyyMMdd HHmmss") + + " UTC"; + string maxDateTime = DateTime.Now.ToUniversalTime().ToString("yyyyMMdd HHmmss") + " UTC"; + + // Create date time range. + DateTimeRange dateTimeRange = new DateTimeRange(); + dateTimeRange.min = minDateTime; + dateTimeRange.max = maxDateTime; + + try { + // Create the selector. + CustomerSyncSelector selector = new CustomerSyncSelector(); + selector.dateTimeRange = dateTimeRange; + selector.campaignIds = GetAllCampaignIds(user); + + // Get all account changes for campaign. + CustomerChangeData accountChanges = customerSyncService.get(selector); + + // Display the changes. + if (accountChanges != null && accountChanges.changedCampaigns != null) { + Console.WriteLine("Displaying changes up to: {0}", accountChanges.lastChangeTimestamp); + foreach (CampaignChangeData campaignChanges in accountChanges.changedCampaigns) { + Console.WriteLine("Campaign with id \"{0}\" was changed:", campaignChanges.campaignId); + Console.WriteLine(" Campaign changed status: {0}", + campaignChanges.campaignChangeStatus); + if (campaignChanges.campaignChangeStatus != ChangeStatus.NEW) { + Console.WriteLine(" Added ad extensions: {0}", GetFormattedList( + campaignChanges.addedAdExtensions)); + Console.WriteLine(" Added campaign criteria: {0}", + GetFormattedList(campaignChanges.addedCampaignCriteria)); + Console.WriteLine(" Added campaign targeting: {0}", + campaignChanges.campaignTargetingChanged? "yes" : "no"); + Console.WriteLine(" Deleted ad extensions: {0}", + GetFormattedList(campaignChanges.deletedAdExtensions)); + Console.WriteLine(" Deleted campaign criteria: {0}", + GetFormattedList(campaignChanges.deletedCampaignCriteria)); + + if (campaignChanges.changedAdGroups != null) { + foreach (AdGroupChangeData adGroupChanges in campaignChanges.changedAdGroups) { + Console.WriteLine(" Ad group with id \"{0}\" was changed:", + adGroupChanges.adGroupId); + Console.WriteLine(" Ad group changed status: {0}", + adGroupChanges.adGroupChangeStatus); + if (adGroupChanges.adGroupChangeStatus != ChangeStatus.NEW) { + Console.WriteLine(" Ads changed: {0}", + GetFormattedList(adGroupChanges.changedAds)); + Console.WriteLine(" Criteria changed: {0}", + GetFormattedList(adGroupChanges.changedCriteria)); + Console.WriteLine(" Criteria deleted: {0}", + GetFormattedList(adGroupChanges.deletedCriteria)); + } + } + } + } + Console.WriteLine(); + } + } else { + Console.WriteLine("No account changes were found.");; + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get account changes.", ex); + } + } + + /// + /// Formats a list of ids as a comma separated string. + /// + /// The list of ids. + /// The comma separed formatted string, enclosed in square braces. + /// + private string GetFormattedList(long[] ids) { + StringBuilder builder = new StringBuilder(); + if (ids != null) { + foreach (long id in ids) { + builder.AppendFormat("{0}, ", id); + } + } + return "[" + builder.ToString().TrimEnd(',', ' ') + "]"; + } + + /// + /// Gets all campaign ids in the account. + /// + /// The user for which campaigns are retrieved. + /// The list of campaign ids. + private long[] GetAllCampaignIds(AdWordsUser user) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201309.CampaignService); + + List allCampaigns = new List(); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id"}; + + // Get all campaigns. + CampaignPage page = campaignService.get(selector); + + // Return the results. + if (page != null && page.entries != null) { + foreach (Campaign campaign in page.entries) { + allCampaigns.Add(campaign.id); + } + } + return allCampaigns.ToArray(); + } + } +} diff --git a/examples/AdWords/CSharp/v201309/AccountManagement/GetAccountHierarchy.cs b/examples/AdWords/CSharp/v201309/AccountManagement/GetAccountHierarchy.cs new file mode 100644 index 00000000000..e36f3c99e0b --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AccountManagement/GetAccountHierarchy.cs @@ -0,0 +1,196 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example illustrates how to retrieve the account hierarchy under + /// an account. This code example won't work with Test Accounts. See + /// https://developers.google.com/adwords/api/docs/test-accounts + /// + /// Tags: ManagedCustomerService.get + /// + public class GetAccountHierarchy : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAccountHierarchy codeExample = new GetAccountHierarchy(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve the account hierarchy under" + + " an account. This code example won't work with Test Accounts. See " + + "https://developers.google.com/adwords/api/docs/test-accounts"; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ManagedCustomerService. + ManagedCustomerService managedCustomerService = (ManagedCustomerService) user.GetService( + AdWordsService.v201309.ManagedCustomerService); + managedCustomerService.RequestHeader.clientCustomerId = null; + + // Create selector. + Selector selector = new Selector(); + selector.fields = new String[] {"Login", "CustomerId", "Name"}; + + try { + // Get results. + ManagedCustomerPage page = managedCustomerService.get(selector); + + // Display serviced account graph. + if (page.entries != null) { + // Create map from customerId to customer node. + Dictionary customerIdToCustomerNode = + new Dictionary(); + + // Create account tree nodes for each customer. + foreach (ManagedCustomer customer in page.entries) { + ManagedCustomerTreeNode node = new ManagedCustomerTreeNode(); + node.Account = customer; + customerIdToCustomerNode.Add(customer.customerId, node); + } + + // For each link, connect nodes in tree. + if (page.links != null) { + foreach (ManagedCustomerLink link in page.links) { + ManagedCustomerTreeNode managerNode = + customerIdToCustomerNode[link.managerCustomerId]; + ManagedCustomerTreeNode childNode = customerIdToCustomerNode[link.clientCustomerId]; + childNode.ParentNode = managerNode; + if (managerNode != null) { + managerNode.ChildAccounts.Add(childNode); + } + } + } + + // Find the root account node in the tree. + ManagedCustomerTreeNode rootNode = null; + foreach (ManagedCustomer account in page.entries) { + if (customerIdToCustomerNode[account.customerId].ParentNode == null) { + rootNode = customerIdToCustomerNode[account.customerId]; + break; + } + } + + // Display account tree. + Console.WriteLine("Login, CustomerId, Name"); + Console.WriteLine(rootNode.ToTreeString(0, new StringBuilder())); + } else { + Console.WriteLine("No serviced accounts were found."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create ad groups.", ex); + } + } + + /** + * Example implementation of a node that would exist in an account tree. + */ + class ManagedCustomerTreeNode { + /// + /// The parent node. + /// + private ManagedCustomerTreeNode parentNode; + + /// + /// The account associated with this node. + /// + private ManagedCustomer account; + + /// + /// The list of child accounts. + /// + private List childAccounts = new List(); + + /// + /// Gets or sets the parent node. + /// + public ManagedCustomerTreeNode ParentNode { + get { return parentNode; } + set { parentNode = value; } + } + + /// + /// Gets or sets the account. + /// + public ManagedCustomer Account { + get { return account; } + set { account = value; } + } + + /// + /// Gets the child accounts. + /// + public List ChildAccounts { + get { return childAccounts; } + } + + /// + /// Returns a that represents this instance. + /// + /// + /// A that represents this instance. + /// + public override String ToString() { + String login = String.IsNullOrEmpty(account.login) ? "(no login)" : account.login; + return String.Format("{0}, {1}, {2}", login, account.customerId, account.name); + } + + /// + /// Returns a string representation of the current level of the tree and + /// recursively returns the string representation of the levels below it. + /// + /// The depth of the node. + /// The String Builder containing the tree + /// representation. + /// The tree string representation. + public StringBuilder ToTreeString(int depth, StringBuilder sb) { + sb.Append(new String('-', depth * 2)); + sb.Append(this); + sb.Append("\n"); + foreach (ManagedCustomerTreeNode childAccount in childAccounts) { + childAccount.ToTreeString(depth + 1, sb); + } + return sb; + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201309/AdWordsForVideo/AddTargetingGroup.cs b/examples/AdWords/CSharp/v201309/AdWordsForVideo/AddTargetingGroup.cs new file mode 100644 index 00000000000..5c0ad9a4f97 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AdWordsForVideo/AddTargetingGroup.cs @@ -0,0 +1,95 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + + /// + /// This code example illustrates how to create a targeting group. + /// + /// Tags: VideoTargetingGroupService.mutate + /// + /// AdWords for Video API is a Beta feature. + public class AddTargetingGroup : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create a targeting group."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddTargetingGroup codeExample = new AddTargetingGroup(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + string videoId = "INSERT_VIDEO_ID_HERE"; + codeExample.Run(new AdWordsUser(), campaignId, videoId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + /// The Youtube video ID. + public void Run(AdWordsUser user, long campaignId, string videoId) { + // Get the VideoTargetingGroupService. + VideoTargetingGroupService videoTargetingGroupService = + (VideoTargetingGroupService) user.GetService( + AdWordsService.v201309.VideoTargetingGroupService); + + TargetingGroup targetingGroup = new TargetingGroup(); + targetingGroup.campaignId = campaignId; + targetingGroup.name = "My Targeting Group " + ExampleUtilities.GetRandomString(); + + try { + TargetingGroupOperation operation = new TargetingGroupOperation(); + operation.operand = targetingGroup; + operation.@operator = Operator.ADD; + + TargetingGroupReturnValue retval = videoTargetingGroupService.mutate( + new TargetingGroupOperation[] { operation }); + + if (retval != null && retval.value != null && retval.value.Length > 0) { + TargetingGroup newTargetingGroup = retval.value[0]; + Console.WriteLine("New targeting group with id = {0}, name = {1} was created in " + + "campaign id {2}", newTargetingGroup.id, newTargetingGroup.name, + newTargetingGroup.campaignId); + } else { + Console.WriteLine("No targeting group was created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create targeting group.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201309/AdWordsForVideo/AddTargetingGroupCriteria.cs b/examples/AdWords/CSharp/v201309/AdWordsForVideo/AddTargetingGroupCriteria.cs new file mode 100644 index 00000000000..e0412fcb88a --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AdWordsForVideo/AddTargetingGroupCriteria.cs @@ -0,0 +1,167 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + + /// + /// This code example illustrates how to create targeting group criteria. + /// + /// Tags: VideoTargetingGroupCriterionService.mutate + /// + /// AdWords for Video API is a Beta feature. + public class AddTargetingGroupCriteria : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create targeting group criteria."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddTargetingGroupCriteria codeExample = new AddTargetingGroupCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + long targetingGroupId = long.Parse("INSERT_TARGETING_GROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId, targetingGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + /// The targeting group ID. + public void Run(AdWordsUser user, long campaignId, long targetingGroupId) { + // Get the VideoTargetingGroupCriterionService. + VideoTargetingGroupCriterionService videoTargetingGroupCriterionService = + (VideoTargetingGroupCriterionService) user.GetService( + AdWordsService.v201309.VideoTargetingGroupCriterionService); + + // Create age criteria. + TargetingGroupCriterion ageCriterion = new TargetingGroupCriterion(); + ageCriterion.campaignId = campaignId; + ageCriterion.targetingGroupId = targetingGroupId; + AudienceAge age = new AudienceAge(); + age.ageRange = AudienceAgeAgeRange.AGE_RANGE_18_24; + ageCriterion.criterion = age; + + TargetingGroupCriterionOperation addAgeCriterionOperation = + new TargetingGroupCriterionOperation(); + addAgeCriterionOperation.operand = ageCriterion; + addAgeCriterionOperation.@operator = Operator.ADD; + + // Create negative age criteria. + NegativeTargetingGroupCriterion negativeAgeCriterion = new NegativeTargetingGroupCriterion(); + negativeAgeCriterion.campaignId = campaignId; + negativeAgeCriterion.targetingGroupId = targetingGroupId; + AudienceAge negativeAge = new AudienceAge(); + negativeAge.ageRange = AudienceAgeAgeRange.AGE_RANGE_65_UP; + negativeAgeCriterion.criterion = negativeAge; + + TargetingGroupCriterionOperation addNegativeAgeCriterionOperation = + new TargetingGroupCriterionOperation(); + addNegativeAgeCriterionOperation.operand = negativeAgeCriterion; + addNegativeAgeCriterionOperation.@operator = Operator.ADD; + + // Create gender criteria. + TargetingGroupCriterion genderCriterion = new TargetingGroupCriterion(); + AudienceGender gender = new AudienceGender(); + gender.genderType = AudienceGenderGenderType.GENDER_MALE; + genderCriterion.campaignId = campaignId; + genderCriterion.targetingGroupId = targetingGroupId; + genderCriterion.criterion = gender; + + TargetingGroupCriterionOperation addGenderCriterionOperation = + new TargetingGroupCriterionOperation(); + addGenderCriterionOperation.operand = genderCriterion; + addGenderCriterionOperation.@operator = Operator.ADD; + + // Create topic criteria. + // See https://developers.google.com/adwords/api/docs/appendix/verticals + // for valid ids. + TargetingGroupCriterion topicCriterion = new TargetingGroupCriterion(); + Topic topic = new Topic(); + // Autos & Vehicles > Vehicle Brands > Buick + topic.verticalId = 1060L; + + topicCriterion.campaignId = campaignId; + topicCriterion.targetingGroupId = targetingGroupId; + topicCriterion.criterion = topic; + + TargetingGroupCriterionOperation addTopicCriterionOperation = + new TargetingGroupCriterionOperation(); + addTopicCriterionOperation.operand = topicCriterion; + addTopicCriterionOperation.@operator = Operator.ADD; + + // Add audience interest criteria. + // See https://developers.google.com/adwords/api/docs/appendix/verticals + // for valid ids. + TargetingGroupCriterion interestCriterion = new TargetingGroupCriterion(); + AudienceInterest interest = new AudienceInterest(); + // Computers & Electronics > Computer Hardware > Laptops & Notebooks > Tablet PCs + interest.interestId = 1277L; + + interestCriterion.campaignId = campaignId; + interestCriterion.targetingGroupId = targetingGroupId; + interestCriterion.criterion = topic; + + TargetingGroupCriterionOperation addUserInterestCriteriaOperation = + new TargetingGroupCriterionOperation(); + addUserInterestCriteriaOperation.operand = interestCriterion; + addUserInterestCriteriaOperation.@operator = Operator.ADD; + + try { + TargetingGroupCriterionReturnValue retval = videoTargetingGroupCriterionService.mutate( + new TargetingGroupCriterionOperation[] { + addAgeCriterionOperation, + addGenderCriterionOperation, + addNegativeAgeCriterionOperation, + addTopicCriterionOperation, + addUserInterestCriteriaOperation + }); + if (retval != null && retval.value != null) { + foreach (TargetingGroupCriterion newCriterion in retval.value) { + Console.WriteLine("Added targeting group criteria with id = {0} and type = {1} " + + "to campaign id {2}.", + newCriterion.criterion.id, newCriterion.criterion.BaseCriterionType, + newCriterion.campaignId); + } + } else { + Console.WriteLine("No new targeting group criteria were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add targeting group criteria.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201309/AdWordsForVideo/AddVideoAd.cs b/examples/AdWords/CSharp/v201309/AdWordsForVideo/AddVideoAd.cs new file mode 100644 index 00000000000..83c806fe6b6 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AdWordsForVideo/AddVideoAd.cs @@ -0,0 +1,109 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + + /// + /// This code example illustrates how to create a video ad. + /// + /// Tags: VideoAdService.mutate + /// + /// AdWords for Video API is a Beta feature. + public class AddVideoAd : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create a video ad."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddVideoAd codeExample = new AddVideoAd(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + string videoId = "INSERT_VIDEO_ID_HERE"; + codeExample.Run(new AdWordsUser(), campaignId, videoId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + /// The Youtube video ID. + public void Run(AdWordsUser user, long campaignId, string videoId) { + // Get the VideoAdService. + VideoAdService videoAdService = (VideoAdService) user.GetService( + AdWordsService.v201309.VideoAdService); + + VideoAd videoAd = new VideoAd(); + videoAd.campaignId = campaignId; + videoAd.name = "My first video ad"; + videoAd.status = VideoAdStatus.PAUSED; + + videoAd.headline = "Best headline ever"; + videoAd.destinationUrl = "http://www.example.com"; + videoAd.displayUrl = "www.example.com"; + videoAd.description1 = "My favorite line 1"; + videoAd.description2 = "My favorite line 2"; + + videoAd.videoId = videoId; + + VideoAdDisplayFormat_VideoAdStatusMapEntry statusByFormat = + new VideoAdDisplayFormat_VideoAdStatusMapEntry(); + statusByFormat.key = VideoAdDisplayFormat.TRUE_VIEW_IN_STREAM; + statusByFormat.value = VideoAdStatus.ENABLED; + + videoAd.statusByFormat = new VideoAdDisplayFormat_VideoAdStatusMapEntry[] { + statusByFormat + }; + + try { + VideoAdOperation operation = new VideoAdOperation(); + operation.operand = videoAd; + operation.@operator = Operator.ADD; + + VideoAdReturnValue retval = videoAdService.mutate(new VideoAdOperation[] { operation }); + if (retval != null && retval.value != null && retval.value.Length > 0) { + VideoAd newVideoAd = retval.value[0]; + Console.WriteLine("Ad with id = {0} was added to campaign id {1}.", newVideoAd.id, + newVideoAd.campaignId); + } else { + Console.WriteLine("No video ads were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add video ad.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201309/AdWordsForVideo/AddVideoCallToAction.cs b/examples/AdWords/CSharp/v201309/AdWordsForVideo/AddVideoCallToAction.cs new file mode 100644 index 00000000000..0d7c5ef1495 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AdWordsForVideo/AddVideoCallToAction.cs @@ -0,0 +1,109 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + + /// + /// This code example illustrates how to create a video call to action + /// overlay. + /// + /// Tags: VideoService.mutateCallToAction + /// + /// AdWords for Video API is a Beta feature. + public class AddVideoCallToAction : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create a video call to action overlay"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddVideoCallToAction codeExample = new AddVideoCallToAction(); + Console.WriteLine(codeExample.Description); + try { + string videoId = "INSERT_VIDEO_ID_HERE"; + codeExample.Run(new AdWordsUser(), videoId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The video ID. + public void Run(AdWordsUser user, string videoId) { + // Get the VideoService. + VideoService videoService = (VideoService) user.GetService( + AdWordsService.v201309.VideoService); + + VideoCallToAction videoCallToAction = new VideoCallToAction(); + videoCallToAction.id = videoId; + + CallToAction callToAction = new CallToAction(); + + CallToActionCreative callToActionCreative = new CallToActionCreative(); + callToActionCreative.headline = "Mars cruise"; + callToActionCreative.descriptionLine1 = "Astonishing views"; + callToActionCreative.descriptionLine2 = "Mild climate"; + callToActionCreative.displayUrl = "www.example.com/mars"; + callToActionCreative.destinationUrl = "www.example.com/mars"; + + callToAction.creative = callToActionCreative; + videoCallToAction.callToAction = callToAction; + + try { + VideoCallToActionOperation operation = new VideoCallToActionOperation(); + operation.operand = videoCallToAction; + + // If this is a new Call to Action, use Operator.ADD + // If a Call to Action already exists, use Operator.SET + operation.@operator = Operator.SET; + + VideoCallToActionOperation[] operations = new VideoCallToActionOperation[] { operation }; + + // Add video call to action. + VideoReturnValue result = videoService.mutateCallToAction(operations); + + if (result != null && result.value != null && result.value.Length > 0) { + foreach (YouTubeVideo youTubeVideo in result.value) { + Console.WriteLine("CallToAction overlay was added to video ID {0}, headline {1}.", + youTubeVideo.id, youTubeVideo.callToAction.creative.headline); + } + } else { + Console.WriteLine("No call to action overlays were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add call to action overlay.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201309/AdWordsForVideo/AddVideoCampaign.cs b/examples/AdWords/CSharp/v201309/AdWordsForVideo/AddVideoCampaign.cs new file mode 100644 index 00000000000..16489f28148 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AdWordsForVideo/AddVideoCampaign.cs @@ -0,0 +1,122 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + + /// + /// This code example illustrates how to create a video campaign. + /// + /// Tags: VideoCampaignService.mutate, BudgetService.mutate + /// + /// AdWords for Video API is a Beta feature. + public class AddVideoCampaign : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create a video campaign."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddVideoCampaign codeExample = new AddVideoCampaign(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the BudgetService. + BudgetService budgetService = + (BudgetService) user.GetService(AdWordsService.v201309.BudgetService); + + // Get the VideoCampaignService. + VideoCampaignService videoCampaignService = + (VideoCampaignService) user.GetService(AdWordsService.v201309.VideoCampaignService); + + // Create the campaign budget. + Budget budget = new Budget(); + budget.name = "Interplanetary Cruise Budget #" + ExampleUtilities.GetRandomString(); + budget.period = BudgetBudgetPeriod.DAILY; + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + budget.amount = new Money(); + budget.amount.microAmount = 500000; + + BudgetOperation budgetOperation = new BudgetOperation(); + budgetOperation.@operator = Operator.ADD; + budgetOperation.operand = budget; + + try { + BudgetReturnValue budgetRetval = budgetService.mutate(new BudgetOperation[] { budgetOperation }); + budget = budgetRetval.value[0]; + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add shared budget.", ex); + } + + // Create video campaign. + VideoCampaign videoCampaign = new VideoCampaign(); + videoCampaign.name = ("Interplanetary Cruise #" + ExampleUtilities.GetRandomString()); + videoCampaign.status = VideoCampaignStatus.PAUSED; + videoCampaign.budgetId = budget.budgetId; + + // You can optionally provide these field(s). The dates will be + // interpreted using the account's timezone. + videoCampaign.startDate = DateTime.Now.AddDays(1).ToString("yyyyMMdd"); + + try { + // Create operations. + VideoCampaignOperation operation = new VideoCampaignOperation(); + operation.operand = videoCampaign; + operation.@operator = Operator.ADD; + + VideoCampaignOperation[] operations = new VideoCampaignOperation[] { operation }; + + // Add video campaigns. + VideoCampaignReturnValue retval = videoCampaignService.mutate(operations); + + // Display video campaigns. + if (retval != null && retval.value != null && retval.value.Length > 0) { + VideoCampaign newVideoCampaign = retval.value[0]; + Console.WriteLine("Campaign with name '{0}' and id = {1} was added.", + newVideoCampaign.name, newVideoCampaign.id); + } else { + Console.WriteLine("No video campaigns were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add video campaign.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201309/AdWordsForVideo/AddVideoCampaignCriteria.cs b/examples/AdWords/CSharp/v201309/AdWordsForVideo/AddVideoCampaignCriteria.cs new file mode 100644 index 00000000000..3ccae1e987d --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AdWordsForVideo/AddVideoCampaignCriteria.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + + /// + /// This code example demonstrates how to add campaign-level criteria + /// targeting. + /// + /// Tags: VideoCampaignCriterionService.mutate + /// + /// AdWords for Video API is a Beta feature. + public class AddVideoCampaignCriteria : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example demonstrates how to add campaign-level criteria targeting."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddVideoCampaignCriteria codeExample = new AddVideoCampaignCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + public void Run(AdWordsUser user, long campaignId) { + // Get the VideoCampaignCriterionService. + VideoCampaignCriterionService service = + (VideoCampaignCriterionService) user.GetService( + AdWordsService.v201309.VideoCampaignCriterionService); + + try { + VideoCampaignCriterion criterion = new VideoCampaignCriterion(); + criterion.campaignId = campaignId; + + // for a list of languages, see + // https://devsite.googleplex.com/adwords/api/docs/appendix/languagecodes + LanguageVideoCriterion englishCriterion = new LanguageVideoCriterion(); + englishCriterion.id = 1001L; + criterion.criterion = englishCriterion; + + VideoCampaignCriterionOperation operation = new VideoCampaignCriterionOperation(); + operation.operand = criterion; + operation.@operator = Operator.ADD; + + VideoCampaignCriterionReturnValue retval = service.mutate( + new VideoCampaignCriterionOperation[] { operation }); + + if (retval != null && retval.value != null && retval.value.Length > 0) { + VideoCampaignCriterion newCriterion = retval.value[0]; + Console.WriteLine("Video campaign criterion with id = {0} and type = {1} was added " + + "to campaign id {2}", newCriterion.criterion.id, + newCriterion.criterion.BaseCriterionType, newCriterion.campaignId); + } else { + Console.WriteLine("No video campaign criteria were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add video campaign criteria.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201309/AdWordsForVideo/FindVideos.cs b/examples/AdWords/CSharp/v201309/AdWordsForVideo/FindVideos.cs new file mode 100644 index 00000000000..c3d6f72abdc --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AdWordsForVideo/FindVideos.cs @@ -0,0 +1,100 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + + /// + /// This code example illustrates how to find YouTube videos by a search + /// string. It retrieve details for the first 100 matching videos. + /// + /// Tags: VideoService.search + /// + /// AdWords for Video API is a Beta feature. + public class FindVideos : ExampleBase { + + /// + /// Maximum number of results to fetch. + /// + private const int PAGE_SIZE = 100; + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to find YouTube videos by a search " + + "string. It retrieve details for the first 100 matching videos."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + FindVideos codeExample = new FindVideos(); + Console.WriteLine(codeExample.Description); + try { + string queryString = "INSERT_QUERY_STRING_HERE"; + codeExample.Run(new AdWordsUser(), queryString); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The video search query text. + public void Run(AdWordsUser user, string queryString) { + // Get the VideoService. + VideoService videoService = (VideoService) user.GetService( + AdWordsService.v201309.VideoService); + + // Create a selector. + VideoSearchSelector selector = new VideoSearchSelector(); + selector.searchType = VideoSearchSelectorSearchType.VIDEO; + selector.query = queryString; + selector.paging = new Paging(); + selector.paging.startIndex = 0; + selector.paging.numberResults = PAGE_SIZE; + + try { + // Run the query. + VideoSearchPage page = videoService.search(selector); + + // Display videos. + if (page != null && page.totalNumEntries > 0) { + foreach (YouTubeVideo video in page.entries) { + Console.WriteLine("YouTube video ID {0} with title {1} found.", video.id, video.title); + } + Console.WriteLine("Total number of matching videos: {0}.", page.totalNumEntries); + } else { + Console.WriteLine("No videos matching {0} were found.", queryString); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to search for videos.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201309/AdWordsForVideo/GetKeywordCriteria.cs b/examples/AdWords/CSharp/v201309/AdWordsForVideo/GetKeywordCriteria.cs new file mode 100644 index 00000000000..e8c468b66b0 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AdWordsForVideo/GetKeywordCriteria.cs @@ -0,0 +1,117 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + + /// + /// This code example shows how to retrieve all keywords for a video + /// campaign. To get a list with all campaigns, run GetVideoCampaigns.cs. + /// + /// Tags: VideoTargetingGroupCriterionService.get + /// + /// AdWords for Video API is a Beta feature. + public class GetKeywordCriteria : ExampleBase { + + /// + /// Maximum number of results to fetch. + /// + private const int PAGE_SIZE = 100; + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to retrieve all keywords for a video campaign. " + + "To get a list with all campaigns, run GetVideoCampaigns.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetKeywordCriteria codeExample = new GetKeywordCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + public void Run(AdWordsUser user, long campaignId) { + // Get the VideoTargetingGroupCriterionService. + VideoTargetingGroupCriterionService videoTargetingGroupCriterionService = + (VideoTargetingGroupCriterionService) user.GetService( + AdWordsService.v201309.VideoTargetingGroupCriterionService); + + int offset = 0; + + TargetingGroupCriterionPage page = new TargetingGroupCriterionPage(); + + try { + // Create selector. + TargetingGroupCriterionSelector selector = new TargetingGroupCriterionSelector(); + + selector.criteriaDimension = CriteriaDimension.KEYWORD; + selector.campaignIds = new long[] { campaignId }; + + selector.paging = new Paging(); + + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = PAGE_SIZE; + + // Get all keywords. + page = videoTargetingGroupCriterionService.get(selector); + + // Display keywords. + if (page != null && page.entries != null) { + int i = offset; + foreach (TargetingGroupCriterion targetingGroupCriterion in page.entries) { + String negative = + (targetingGroupCriterion is NegativeTargetingGroupCriterion) ? + " (negative)" : ""; + BaseKeyword keyword = (BaseKeyword) targetingGroupCriterion.criterion; + Console.WriteLine("{0}) Criterion {1} ID {2}, targeting group ID {3} and " + + "text '{4}'\n", i, negative, keyword.id, + targetingGroupCriterion.targetingGroupId, keyword.text); + i++; + } + } + offset += PAGE_SIZE; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of keywords found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get keywords.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201309/AdWordsForVideo/GetTargetingGroups.cs b/examples/AdWords/CSharp/v201309/AdWordsForVideo/GetTargetingGroups.cs new file mode 100644 index 00000000000..ace576350f4 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AdWordsForVideo/GetTargetingGroups.cs @@ -0,0 +1,112 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + + /// + /// This code example shows how to retrieve all targeting groups for video + /// campaigns. + /// + /// Tags: VideoTargetingGroupService.get + /// + /// AdWords for Video API is a Beta feature. + public class GetTargetingGroups : ExampleBase { + + /// + /// Maximum number of results to fetch. + /// + private const int PAGE_SIZE = 100; + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to retrieve all targeting groups for " + + "video campaigns."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetTargetingGroups codeExample = new GetTargetingGroups(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + public void Run(AdWordsUser user, long campaignId) { + // Get the VideoTargetingGroupService. + VideoTargetingGroupService videoTargetingGroupService = (VideoTargetingGroupService) + user.GetService(AdWordsService.v201309.VideoTargetingGroupService); + + int offset = 0; + + TargetingGroupPage page = new TargetingGroupPage(); + + try { + // Create selector. + TargetingGroupSelector selector = new TargetingGroupSelector(); + selector.campaignIds = new long[] { campaignId }; + + selector.paging = new Paging(); + + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = PAGE_SIZE; + + // Get all targeting groups for this account. + page = videoTargetingGroupService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (TargetingGroup targetingGroup in page.entries) { + Console.WriteLine("{0}) Targeting group ID {1}, campaign ID {2} and name '{3}'", + (i + 1), targetingGroup.id, targetingGroup.campaignId, targetingGroup.name); + + i++; + } + } else { + Console.WriteLine("No targeting groups were found."); + } + offset += PAGE_SIZE; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of targeting groups found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get targeting groups.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201309/AdWordsForVideo/GetVideoCampaignCriteria.cs b/examples/AdWords/CSharp/v201309/AdWordsForVideo/GetVideoCampaignCriteria.cs new file mode 100644 index 00000000000..131d7700ba0 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AdWordsForVideo/GetVideoCampaignCriteria.cs @@ -0,0 +1,116 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + + /// + /// This code example demonstrates how to retrieve all campaign-level + /// criteria in a campaign. + /// + /// Tags: VideoCampaignCriterionService.get + /// + /// AdWords for Video API is a Beta feature. + public class GetVideoCampaignCriteria : ExampleBase { + + /// + /// Maximum number of results to fetch. + /// + private const int PAGE_SIZE = 100; + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve all non-deleted video " + + "campaigns for an account."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetVideoCampaignCriteria codeExample = new GetVideoCampaignCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + public void Run(AdWordsUser user, long campaignId) { + // Get the VideoCampaignCriterionService. + VideoCampaignCriterionService videoCampaignCriterionService = + (VideoCampaignCriterionService) user.GetService( + AdWordsService.v201309.VideoCampaignCriterionService); + + int offset = 0; + + VideoCampaignCriterionPage page = new VideoCampaignCriterionPage(); + + try { + // Create selector. + VideoCampaignCriterionSelector selector = new VideoCampaignCriterionSelector(); + selector.campaignIds = new long[] { campaignId }; + + selector.paging = new Paging(); + + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = PAGE_SIZE; + + page = videoCampaignCriterionService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (VideoCampaignCriterion videoCampaignCriterion in page.entries) { + String negative = + (videoCampaignCriterion is NegativeVideoCampaignCriterion) ? " (negative)" + : ""; + Console.WriteLine("{0}) Video {1} criterion ID {2} of type '{3}'", (i + 1), + negative, + videoCampaignCriterion.criterion.id, + videoCampaignCriterion.criterion.BaseCriterionType); + i++; + } + } else { + Console.WriteLine("No video campaign criteria were found."); + } + offset += PAGE_SIZE; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of video campaign criteria found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get video campaign criteria.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201309/AdWordsForVideo/GetVideoCampaignStats.cs b/examples/AdWords/CSharp/v201309/AdWordsForVideo/GetVideoCampaignStats.cs new file mode 100644 index 00000000000..5c14995c0f3 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AdWordsForVideo/GetVideoCampaignStats.cs @@ -0,0 +1,160 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + + /// + /// This code example illustrates how to retrieve stats for a video campaign. + /// + /// Tags: VideoCampaignService.get + /// + /// AdWords for Video API is a Beta feature. + public class GetVideoCampaignStats : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve stats for a video campaign."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetVideoCampaignStats codeExample = new GetVideoCampaignStats(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + public void Run(AdWordsUser user, long campaignId) { + // Get the VideoCampaignService. + VideoCampaignService videoCampaignService = (VideoCampaignService) user.GetService( + AdWordsService.v201309.VideoCampaignService); + + // The dates will be interpreted using the account's timezone. + String minDateTime = DateTime.Now.Year.ToString() + "0101"; + String maxDateTime = DateTime.Now.ToString("yyyyMMdd"); + + // Create selector. + StatsSelector statsSelector = new StatsSelector(); + DateRange dateRange = new DateRange(); + dateRange.min = minDateTime; + dateRange.max = maxDateTime; + + statsSelector.dateRange = dateRange; + statsSelector.segmentationDimensions = new SegmentationDimension[] { + SegmentationDimension.DATE_MONTH }; + statsSelector.metrics = new Metric[] { Metric.VIEWS, Metric.COST, Metric.AVERAGE_CPV }; + statsSelector.summaryTypes = new VideoEntityStatsSummaryType[] { + VideoEntityStatsSummaryType.ALL }; + statsSelector.segmentedSummaryType = VideoEntityStatsSummaryType.ALL; + + try { + // Create selector. + VideoCampaignSelector selector = new VideoCampaignSelector(); + selector.statsSelector = statsSelector; + selector.ids = new long[] { campaignId }; + + selector.paging = new Paging(); + + VideoCampaignPage page = videoCampaignService.get(selector); + + if (page != null) { + if (page.entries != null && page.entries.Length > 0) { + VideoCampaign videoCampaign = page.entries[0]; + + Console.WriteLine("Campaign ID {0}, name '{1}' and status '{2}'", videoCampaign.id, + videoCampaign.name, videoCampaign.status); + if (videoCampaign.stats != null) { + Console.WriteLine("\tCampaign stats:"); + Console.WriteLine("\t\t" + FormatStats(videoCampaign.stats)); + } + if (videoCampaign.segmentedStats != null) { + foreach (VideoEntityStats segment in videoCampaign.segmentedStats) { + Console.WriteLine("\tCampaign segmented stats for month of " + + ((DateKey) segment.segmentKey.Item).date); + Console.WriteLine("\t\t" + FormatStats(segment)); + } + } + } else { + Console.WriteLine("No campaigns were found."); + } + if (page.summaryStats != null) { + foreach (VideoEntityStats summary in page.summaryStats) { + Console.WriteLine("\tSummary of type " + summary.summaryType); + Console.WriteLine("\t\t" + FormatStats(summary)); + } + } else { + Console.WriteLine("No summary stats found."); + } + } else { + Console.WriteLine("No campaigns were found."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get campaigns.", ex); + } + } + + /// + /// Formats a money value for display purposes. + /// + /// The money value. + /// The formatted money value as text. + private static String Dashify(Money m) { + return m == null ? "--" : m.microAmount.ToString(); + } + + /// + /// Formats the stats for display. + /// + /// The stats. + /// Stats as formatted text. + private static String FormatStats(VideoEntityStats stats) { + return string.Format("Views: {0}, Cost: {1}, Avg. CPC: {2}, Avg. CPV: {3}, " + + "Avg. CPM: {4}, 25%: {5}, 50%: {6}, 75%: {7}, 100%: {8}", + stats.viewsSpecified? stats.views.ToString() : "--", + Dashify(stats.cost), + Dashify(stats.averageCpc), + Dashify(stats.averageCpv), + Dashify(stats.averageCpm), + stats.quartile25PercentsSpecified? stats.quartile25Percents.ToString() : "--", + stats.quartile50PercentsSpecified? stats.quartile50Percents.ToString() : "--", + stats.quartile75PercentsSpecified? stats.quartile75Percents.ToString() : "--", + stats.quartile100PercentsSpecified? stats.quartile100Percents.ToString() : "--" + ); + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201309/AdWordsForVideo/GetVideoCampaigns.cs b/examples/AdWords/CSharp/v201309/AdWordsForVideo/GetVideoCampaigns.cs new file mode 100644 index 00000000000..cef5f5c2f33 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AdWordsForVideo/GetVideoCampaigns.cs @@ -0,0 +1,107 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + + /// + /// This code example illustrates how to retrieve all non-deleted video + /// campaigns for an account. + /// + /// Tags: VideoCampaignService.get + /// + /// AdWords for Video API is a Beta feature. + public class GetVideoCampaigns : ExampleBase { + + /// + /// Maximum number of results to fetch. + /// + private const int PAGE_SIZE = 100; + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve all non-deleted video " + + "campaigns for an account."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetVideoCampaigns codeExample = new GetVideoCampaigns(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the VideoCampaignService. + VideoCampaignService videoCampaignService = (VideoCampaignService) user.GetService( + AdWordsService.v201309.VideoCampaignService); + + int offset = 0; + + VideoCampaignPage page = new VideoCampaignPage(); + + try { + // Create selector. + VideoCampaignSelector selector = new VideoCampaignSelector(); + + selector.paging = new Paging(); + + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = PAGE_SIZE; + + page = videoCampaignService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (VideoCampaign videoCampaign in page.entries) { + Console.WriteLine("{0}) Campaign ID {1}, name '{2}' and status '{3}'", + (i + 1), videoCampaign.id, videoCampaign.name, videoCampaign.status); + i++; + } + } else { + Console.WriteLine("No campaigns were found."); + } + offset += PAGE_SIZE; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get campaigns.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201309/AdvancedOperations/AddAdGroupBidModifier.cs b/examples/AdWords/CSharp/v201309/AdvancedOperations/AddAdGroupBidModifier.cs new file mode 100644 index 00000000000..8f14ccf109b --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AdvancedOperations/AddAdGroupBidModifier.cs @@ -0,0 +1,111 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example illustrates how to add ad group level mobile bid + /// modifier override. + /// + /// Tags: AdGroupBidModifierService.mutate + /// + public class AddAdGroupBidModifier : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAdGroupBidModifier codeExample = new AddAdGroupBidModifier(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + double bidModifier = double.Parse("INSERT_ADGROUP_BID_MODIFIER_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, bidModifier); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to add ad group level mobile bid modifier " + + "override."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the adgroup for which bid modifier is + /// set. + /// The mobile bid modifier for adgroup + public void Run(AdWordsUser user, long adGroupId, double bidModifier) { + // Get the AdGroupAdService. + AdGroupBidModifierService adGroupBidModifierService = + (AdGroupBidModifierService) user.GetService( + AdWordsService.v201309.AdGroupBidModifierService); + + // Mobile criterion ID. + long criterionId = 30001; + + + // Create the adgroup bid modifier. + AdGroupBidModifier adGroupBidModifier = new AdGroupBidModifier(); + adGroupBidModifier.bidModifier = bidModifier; + adGroupBidModifier.adGroupId = adGroupId; + + Platform platform = new Platform(); + platform.id = criterionId; + + adGroupBidModifier.criterion = platform; + + AdGroupBidModifierOperation operation = new AdGroupBidModifierOperation(); + operation.@operator = Operator.ADD; + operation.operand = adGroupBidModifier; + + + try { + // Add ad group level mobile bid modifier. + AdGroupBidModifierReturnValue retval = adGroupBidModifierService.mutate( + new AdGroupBidModifierOperation[] {operation}); + + // Display the results. + if (retval != null && retval.value != null && retval.value.Length > 0) { + AdGroupBidModifier newBidModifier = retval.value[0]; + Console.WriteLine("AdGroup ID {0}, Criterion ID {1} was updated with ad group level " + + "modifier: {2}", newBidModifier.adGroupId, newBidModifier.criterion.id, + newBidModifier.bidModifier); + } else { + Console.WriteLine("No bid modifiers were added to the adgroup."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add bid modifiers to adgroup.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/AdvancedOperations/AddClickToDownloadAd.cs b/examples/AdWords/CSharp/v201309/AdvancedOperations/AddClickToDownloadAd.cs new file mode 100644 index 00000000000..8b7ddd4ad83 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AdvancedOperations/AddClickToDownloadAd.cs @@ -0,0 +1,146 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example creates a click-to-download ad, also known as an + /// app promotion ad to a given ad group. To list ad groups, run + /// GetAdGroups.cs. + /// + /// Tags: AdGroupAdService.mutate + /// + public class AddClickToDownloadAd : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddClickToDownloadAd codeExample = new AddClickToDownloadAd(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a click-to-download ad, also known as an app " + + "promotion ad to a given ad group. To list ad groups, run GetAdGroups.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which ads are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService adGroupAdService = + (AdGroupAdService) user.GetService(AdWordsService.v201309.AdGroupAdService); + + // Create the template ad. + TemplateAd clickToDownloadAppAd = new TemplateAd(); + + clickToDownloadAppAd.name = "Ad for demo game"; + clickToDownloadAppAd.templateId = 353; + clickToDownloadAppAd.url = + "http://play.google.com/store/apps/details?id=com.example.demogame"; + clickToDownloadAppAd.displayUrl = "play.google.com"; + + // Create the template elements for the ad. You can refer to + // https://developers.google.com/adwords/api/docs/appendix/templateads + // for the list of avaliable template fields. + TemplateElementField headline = new TemplateElementField(); + headline.name = "headline"; + headline.fieldText = "Enjoy your drive in Mars"; + headline.type = TemplateElementFieldType.TEXT; + + TemplateElementField description1 = new TemplateElementField(); + description1.name = "description1"; + description1.fieldText = "Realistic physics simulation"; + description1.type = TemplateElementFieldType.TEXT; + + TemplateElementField description2 = new TemplateElementField(); + description2.name = "description2"; + description2.fieldText = "Race against players online"; + description2.type = TemplateElementFieldType.TEXT; + + TemplateElementField appId = new TemplateElementField(); + appId.name = "appId"; + appId.fieldText = "com.example.demogame"; + appId.type = TemplateElementFieldType.TEXT; + + TemplateElementField appStore = new TemplateElementField(); + appStore.name = "appStore"; + appStore.fieldText = "2"; + appStore.type = TemplateElementFieldType.ENUM; + + TemplateElement adData = new TemplateElement(); + adData.uniqueName = "adData"; + adData.fields = new TemplateElementField[] {headline, description1, description2, appId, + appStore}; + + clickToDownloadAppAd.templateElements = new TemplateElement[] {adData}; + + // Create the adgroupad. + AdGroupAd clickToDownloadAppAdGroupAd = new AdGroupAd(); + clickToDownloadAppAdGroupAd.adGroupId = adGroupId; + clickToDownloadAppAdGroupAd.ad = clickToDownloadAppAd; + + // Optional: Set the status. + clickToDownloadAppAdGroupAd.status = AdGroupAdStatus.PAUSED; + + // Create the operation. + AdGroupAdOperation operation = new AdGroupAdOperation(); + operation.@operator = Operator.ADD; + operation.operand = clickToDownloadAppAdGroupAd; + + try { + // Create the ads. + AdGroupAdReturnValue retval = adGroupAdService.mutate(new AdGroupAdOperation[] {operation}); + + // Display the results. + if (retval != null && retval.value != null) { + foreach (AdGroupAd adGroupAd in retval.value) { + Console.WriteLine("New click-to-download ad with id = \"{0}\" and url = \"{1}\" " + + "was created.", adGroupAd.ad.id, adGroupAd.ad.url); + } + } else { + Console.WriteLine("No click-to-download ads were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create click-to-download ad.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/AdvancedOperations/AddSiteLinks.cs b/examples/AdWords/CSharp/v201309/AdvancedOperations/AddSiteLinks.cs new file mode 100644 index 00000000000..042958f247b --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AdvancedOperations/AddSiteLinks.cs @@ -0,0 +1,322 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: thagikura@gmail.com (Takeshi Hagikura) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + + class SiteLinksDataHolder { + long siteLinksFeedId; + long linkTextFeedAttributeId; + long linkUrlFeedAttributeId; + List siteLinkFeedItemIds = new List(); + + public long SiteLinksFeedId { + get { + return siteLinksFeedId; + } + set { + siteLinksFeedId = value; + } + } + + public long LinkTextFeedAttributeId { + get { + return linkTextFeedAttributeId; + } + set { + linkTextFeedAttributeId = value; + } + } + + public long LinkUrlFeedAttributeId { + get { + return linkUrlFeedAttributeId; + } + set { + linkUrlFeedAttributeId = value; + } + } + + public List SiteLinkFeedItemIds { + get { + return siteLinkFeedItemIds; + } + set { + siteLinkFeedItemIds = value; + } + } + } + + /// + /// This code example adds a sitelinks feed and associates it with a campaign. + /// To create a campaign, run AddCampaign.cs. + /// + /// Tags: CampaignFeedService.mutate, FeedService.mutate, FeedItemService.mutate, + /// Tags: FeedMappingService.mutate + /// + public class AddSiteLinks : ExampleBase { + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddSiteLinks codeExample = new AddSiteLinks(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a sitelinks feed and associates it with a campaign."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign with which sitelinks are associated. + /// + public void Run(AdWordsUser user, long campaignId) { + SiteLinksDataHolder siteLinksData = new SiteLinksDataHolder(); + createSiteLinksFeed(user, siteLinksData); + createSiteLinksFeedItems(user, siteLinksData); + createSiteLinksFeedMapping(user, siteLinksData); + createSiteLinksCampaignFeed(user, siteLinksData, campaignId); + } + + private static void createSiteLinksFeed( + AdWordsUser user, SiteLinksDataHolder siteLinksData) { + // Get the FeedService. + FeedService feedService = (FeedService) user.GetService(AdWordsService.v201309.FeedService); + + // Create attributes. + FeedAttribute textAttribute = new FeedAttribute(); + textAttribute.type = FeedAttributeType.STRING; + textAttribute.name = "Link Text"; + FeedAttribute urlAttribute = new FeedAttribute(); + urlAttribute.type = FeedAttributeType.URL; + urlAttribute.name = "Link URL"; + + // Create the feed. + Feed siteLinksFeed = new Feed(); + siteLinksFeed.name = "Feed For Site Links"; + siteLinksFeed.attributes = new FeedAttribute[] {textAttribute, urlAttribute}; + siteLinksFeed.origin = FeedOrigin.USER; + + // Create operation. + FeedOperation operation = new FeedOperation(); + operation.operand = siteLinksFeed; + operation.@operator = Operator.ADD; + + // Add the feed. + FeedReturnValue result = feedService.mutate(new FeedOperation[] {operation}); + + Feed savedFeed = result.value[0]; + siteLinksData.SiteLinksFeedId = savedFeed.id; + FeedAttribute[] savedAttributes = savedFeed.attributes; + siteLinksData.LinkTextFeedAttributeId = savedAttributes[0].id; + siteLinksData.LinkUrlFeedAttributeId = savedAttributes[1].id; + Console.WriteLine("Feed with name {0} and ID {1} with linkTextAttributeId {2}" + + " and linkUrlAttributeId {3} was created.", savedFeed.name, savedFeed.id, + savedAttributes[0].id, savedAttributes[1].id); + } + + private static void createSiteLinksFeedItems( + AdWordsUser user, SiteLinksDataHolder siteLinksData) { + // Get the FeedItemService. + FeedItemService feedItemService = + (FeedItemService) user.GetService(AdWordsService.v201309.FeedItemService); + + // Create operations to add FeedItems. + FeedItemOperation home = + newSiteLinkFeedItemAddOperation(siteLinksData, + "Home", "http://www.example.com"); + FeedItemOperation stores = + newSiteLinkFeedItemAddOperation(siteLinksData, + "Stores", "http://www.example.com/stores"); + FeedItemOperation onSale = + newSiteLinkFeedItemAddOperation(siteLinksData, + "On Sale", "http://www.example.com/sale"); + FeedItemOperation support = + newSiteLinkFeedItemAddOperation(siteLinksData, + "Support", "http://www.example.com/support"); + FeedItemOperation products = + newSiteLinkFeedItemAddOperation(siteLinksData, + "Products", "http://www.example.com/prods"); + FeedItemOperation aboutUs = + newSiteLinkFeedItemAddOperation(siteLinksData, + "About Us", "http://www.example.com/about"); + + FeedItemOperation[] operations = + new FeedItemOperation[] {home, stores, onSale, support, products, aboutUs}; + + FeedItemReturnValue result = feedItemService.mutate(operations); + foreach (FeedItem item in result.value) { + Console.WriteLine("FeedItem with feedItemId {0} was added.", item.feedItemId); + siteLinksData.SiteLinkFeedItemIds.Add(item.feedItemId); + } + } + + // See the Placeholder reference page for a list of all the placeholder types and fields. + // https://developers.google.com/adwords/api/docs/appendix/placeholders.html + private const int PLACEHOLDER_SITELINKS = 1; + + // See the Placeholder reference page for a list of all the placeholder types and fields. + private const int PLACEHOLDER_FIELD_SITELINK_LINK_TEXT = 1; + private const int PLACEHOLDER_FIELD_SITELINK_URL = 2; + + private static void createSiteLinksFeedMapping( + AdWordsUser user, SiteLinksDataHolder siteLinksData) { + // Get the FeedItemService. + FeedMappingService feedMappingService = + (FeedMappingService) user.GetService(AdWordsService.v201309.FeedMappingService); + + // Map the FeedAttributeIds to the fieldId constants. + AttributeFieldMapping linkTextFieldMapping = new AttributeFieldMapping(); + linkTextFieldMapping.feedAttributeId = siteLinksData.LinkTextFeedAttributeId; + linkTextFieldMapping.fieldId = PLACEHOLDER_FIELD_SITELINK_LINK_TEXT; + AttributeFieldMapping linkUrlFieldMapping = new AttributeFieldMapping(); + linkUrlFieldMapping.feedAttributeId = siteLinksData.LinkUrlFeedAttributeId; + linkUrlFieldMapping.fieldId = PLACEHOLDER_FIELD_SITELINK_URL; + + // Create the FieldMapping and operation. + FeedMapping feedMapping = new FeedMapping(); + feedMapping.placeholderType = PLACEHOLDER_SITELINKS; + feedMapping.feedId = siteLinksData.SiteLinksFeedId; + feedMapping.attributeFieldMappings = + new AttributeFieldMapping[] {linkTextFieldMapping, linkUrlFieldMapping}; + FeedMappingOperation operation = new FeedMappingOperation(); + operation.operand = feedMapping; + operation.@operator = Operator.ADD; + + // Save the field mapping. + FeedMappingReturnValue result = + feedMappingService.mutate(new FeedMappingOperation[] {operation}); + foreach (FeedMapping savedFeedMapping in result.value) { + Console.WriteLine( + "Feed mapping with ID {0} and placeholderType {1} was saved for feed with ID {2}.", + savedFeedMapping.feedMappingId, savedFeedMapping.placeholderType, + savedFeedMapping.feedId); + } + } + + private static void createSiteLinksCampaignFeed(AdWordsUser user, + SiteLinksDataHolder siteLinksData, long campaignId) { + // Get the CampaignFeedService. + CampaignFeedService campaignFeedService = + (CampaignFeedService) user.GetService(AdWordsService.v201309.CampaignFeedService); + + // Map the feed item ids to the campaign using an IN operation. + RequestContextOperand feedItemRequestContextOperand = new RequestContextOperand(); + feedItemRequestContextOperand.contextType = RequestContextOperandContextType.FEED_ITEM_ID; + + List feedItemOperands = new List(); + foreach (long feedItemId in siteLinksData.SiteLinkFeedItemIds) { + ConstantOperand feedItemOperand = new ConstantOperand(); + feedItemOperand.longValue = feedItemId; + feedItemOperand.type = ConstantOperandConstantType.LONG; + feedItemOperands.Add(feedItemOperand); + } + + Function feedItemfunction = new Function(); + feedItemfunction.lhsOperand = new FunctionArgumentOperand[] {feedItemRequestContextOperand}; + feedItemfunction.@operator = FunctionOperator.IN; + feedItemfunction.rhsOperand = feedItemOperands.ToArray(); + + // Optional: to target to a platform, define a function and 'AND' it with + // the feed item ID link: + RequestContextOperand platformRequestContextOperand = new RequestContextOperand(); + platformRequestContextOperand.contextType = RequestContextOperandContextType.DEVICE_PLATFORM; + + ConstantOperand platformOperand = new ConstantOperand(); + platformOperand.stringValue = "Mobile"; + platformOperand.type = ConstantOperandConstantType.STRING; + + Function platformFunction = new Function(); + platformFunction.lhsOperand = new FunctionArgumentOperand[] {platformRequestContextOperand}; + platformFunction.@operator = FunctionOperator.EQUALS; + platformFunction.rhsOperand = new FunctionArgumentOperand[] {platformOperand}; + + // Combine the two functions using an AND operation. + FunctionOperand feedItemFunctionOperand = new FunctionOperand(); + feedItemFunctionOperand.value = feedItemfunction; + + FunctionOperand platformFunctionOperand = new FunctionOperand(); + platformFunctionOperand.value = platformFunction; + + Function combinedFunction = new Function(); + combinedFunction.@operator = FunctionOperator.AND; + combinedFunction.lhsOperand = new FunctionArgumentOperand[] { + feedItemFunctionOperand, platformFunctionOperand}; + + CampaignFeed campaignFeed = new CampaignFeed(); + campaignFeed.feedId = siteLinksData.SiteLinksFeedId; + campaignFeed.campaignId = campaignId; + campaignFeed.matchingFunction = combinedFunction; + // Specifying placeholder types on the CampaignFeed allows the same feed + // to be used for different placeholders in different Campaigns. + campaignFeed.placeholderTypes = new int[] {PLACEHOLDER_SITELINKS}; + + CampaignFeedOperation operation = new CampaignFeedOperation(); + operation.operand = campaignFeed; + operation.@operator = Operator.ADD; + CampaignFeedReturnValue result = + campaignFeedService.mutate(new CampaignFeedOperation[] {operation}); + foreach (CampaignFeed savedCampaignFeed in result.value) { + Console.WriteLine("Campaign with ID {0} was associated with feed with ID {1}", + savedCampaignFeed.campaignId, savedCampaignFeed.feedId); + } + } + + private static FeedItemOperation newSiteLinkFeedItemAddOperation( + SiteLinksDataHolder siteLinksData, String text, String url) { + // Create the FeedItemAttributeValues for our text values. + FeedItemAttributeValue linkTextAttributeValue = new FeedItemAttributeValue(); + linkTextAttributeValue.feedAttributeId = siteLinksData.LinkTextFeedAttributeId; + linkTextAttributeValue.stringValue = text; + FeedItemAttributeValue linkUrlAttributeValue = new FeedItemAttributeValue(); + linkUrlAttributeValue.feedAttributeId = siteLinksData.LinkUrlFeedAttributeId; + linkUrlAttributeValue.stringValue = url; + + // Create the feed item and operation. + FeedItem item = new FeedItem(); + item.feedId = siteLinksData.SiteLinksFeedId; + item.attributeValues = + new FeedItemAttributeValue[] {linkTextAttributeValue, linkUrlAttributeValue}; + FeedItemOperation operation = new FeedItemOperation(); + operation.operand = item; + operation.@operator = Operator.ADD; + return operation; + } + } +} diff --git a/examples/AdWords/CSharp/v201309/AdvancedOperations/GetAdGroupBidModifiers.cs b/examples/AdWords/CSharp/v201309/AdvancedOperations/GetAdGroupBidModifiers.cs new file mode 100644 index 00000000000..d7495e49651 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AdvancedOperations/GetAdGroupBidModifiers.cs @@ -0,0 +1,122 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example illustrates how to retrieve ad group level mobile bid + /// modifiers for a campaign. + /// + /// Tags: AdGroupBidModifierService.get + /// + public class GetAdGroupBidModifiers : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAdGroupBidModifiers codeExample = new GetAdGroupBidModifiers(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve ad group level mobile bid " + + "modifiers for a campaign."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which ads are added. + /// + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupAdService. + AdGroupBidModifierService adGroupBidModifierService = + (AdGroupBidModifierService) user.GetService( + AdWordsService.v201309.AdGroupBidModifierService); + + const int PAGE_SIZE = 500; + + // Get all ad group bid modifiers for the campaign. + Selector selector = new Selector(); + selector.fields = new String[] {"CampaignId", "AdGroupId", "BidModifier", "BidModifierSource", + "CriteriaType", "Id"}; + + Predicate predicate = new Predicate(); + predicate.field = "CampaignId"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] {campaignId.ToString()}; + selector.predicates = new Predicate[] {predicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = PAGE_SIZE; + + AdGroupBidModifierPage page = new AdGroupBidModifierPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the campaigns. + page = adGroupBidModifierService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroupBidModifier adGroupBidModifier in page.entries) { + string bidModifier = (adGroupBidModifier.bidModifierSpecified)? + adGroupBidModifier.bidModifier.ToString() : "UNSET"; + Console.WriteLine("{0}) Campaign ID {1}, AdGroup ID {2}, Criterion ID {3} has " + + "ad group level modifier: {4} and source = {5}.", + i + 1, adGroupBidModifier.campaignId, + adGroupBidModifier.adGroupId, adGroupBidModifier.criterion.id, bidModifier, + adGroupBidModifier.bidModifierSource); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of adgroup bid modifiers found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve adgroup bid modifiers.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/AdvancedOperations/UploadOfflineConversions.cs b/examples/AdWords/CSharp/v201309/AdvancedOperations/UploadOfflineConversions.cs new file mode 100644 index 00000000000..1f58f01f45a --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AdvancedOperations/UploadOfflineConversions.cs @@ -0,0 +1,139 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example imports offline conversion values for specific clicks to + /// your account. To get Google Click ID for a click, run + /// CLICK_PERFORMANCE_REPORT. + /// + /// Tags: ConversionTrackerService.mutate, OfflineConversionFeedService.mutate + /// + public class UploadOfflineConversions : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + string conversionName = "INSERT_CONVERSION_NAME_HERE"; + // GCLID needs to be newer than 30 days. + string gClId = "INSERT_GOOGLE_CLICK_ID_HERE"; + // The conversion time should be higher than the click time. + string conversionTime = "INSERT_CONVERSION_TIME_HERE"; + double conversionValue = double.Parse("INSERT_CONVERSION_VALUE_HERE"); + + UploadOfflineConversions codeExample = new UploadOfflineConversions(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser(), conversionName, gClId, conversionTime, conversionValue); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example imports offline conversion values for specific clicks to " + + "your account. To get Google Click ID for a click, run CLICK_PERFORMANCE_REPORT."; + } + } + + /// + /// Runs the specified user. + /// + /// The user. + /// The name of the upload conversion to be + /// created. + /// The Google Click ID of the click for which offline + /// conversions are uploaded. + /// The conversion value to be uploaded. + /// + /// The conversion time, in yyyymmdd hhmmss + /// format. + public void Run(AdWordsUser user, String conversionName, String gClid, String conversionTime, + double conversionValue) { + // Get the ConversionTrackerService. + ConversionTrackerService conversionTrackerService = + (ConversionTrackerService) user.GetService( + AdWordsService.v201309.ConversionTrackerService); + + // Get the OfflineConversionFeedService. + OfflineConversionFeedService offlineConversionFeedService = + (OfflineConversionFeedService) user.GetService( + AdWordsService.v201309.OfflineConversionFeedService); + + const int VIEWTHROUGH_LOOKBACK_WINDOW = 30; + const int CTC_LOOKBACK_WINDOW = 90; + + try { + // Create an upload conversion. Once created, this entry will be visible + // under Tools and Analysis->Conversion and will have "Source = Import". + UploadConversion uploadConversion = new UploadConversion(); + uploadConversion.category = ConversionTrackerCategory.PAGE_VIEW; + uploadConversion.name = conversionName; + uploadConversion.viewthroughLookbackWindow = VIEWTHROUGH_LOOKBACK_WINDOW; + uploadConversion.ctcLookbackWindow = CTC_LOOKBACK_WINDOW; + + ConversionTrackerOperation uploadConversionOperation = new ConversionTrackerOperation(); + uploadConversionOperation.@operator = Operator.ADD; + uploadConversionOperation.operand = uploadConversion; + + ConversionTrackerReturnValue conversionTrackerRetval = conversionTrackerService.mutate( + new ConversionTrackerOperation[] {uploadConversionOperation}); + + UploadConversion newUploadConversion = (UploadConversion) conversionTrackerRetval.value[0]; + + Console.WriteLine("New upload conversion type with name = '{0}' and id = {1} was created.", + newUploadConversion.name, newUploadConversion.id); + + // Associate offline conversions with the upload conversion we created. + OfflineConversionFeed feed = new OfflineConversionFeed(); + feed.conversionName = conversionName; + feed.conversionTime = conversionTime; + feed.conversionValue = conversionValue; + feed.googleClickId = gClid; + + OfflineConversionFeedOperation offlineConversionOperation = + new OfflineConversionFeedOperation(); + offlineConversionOperation.@operator = Operator.ADD; + offlineConversionOperation.operand = feed; + + OfflineConversionFeedReturnValue offlineConversionRetval = + offlineConversionFeedService.mutate( + new OfflineConversionFeedOperation[] {offlineConversionOperation}); + + OfflineConversionFeed newFeed = offlineConversionRetval.value[0]; + + Console.WriteLine("Uploaded offline conversion value of {0} for Google Click ID = " + + "'{1}' to '{2}'.", newFeed.conversionValue, newFeed.googleClickId, + newFeed.conversionName); + } catch (Exception ex) { + throw new System.ApplicationException("Failed upload offline conversions.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/AdvancedOperations/UseSharedBiddingStrategy.cs b/examples/AdWords/CSharp/v201309/AdvancedOperations/UseSharedBiddingStrategy.cs new file mode 100644 index 00000000000..e6445694e0b --- /dev/null +++ b/examples/AdWords/CSharp/v201309/AdvancedOperations/UseSharedBiddingStrategy.cs @@ -0,0 +1,208 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example adds a Shared Bidding Strategy and uses it to construct + /// a campaign. + /// + /// Tags: BiddingStrategyService.mutate + /// Tags: BudgetService.mutate, CampaignService.mutate + /// + public class UseSharedBiddingStrategy : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UseSharedBiddingStrategy codeExample = new UseSharedBiddingStrategy(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a Shared Bidding Strategy and uses it to construct " + + "a campaign."; + } + } + + /// + /// Runs the specified code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the services. + BiddingStrategyService biddingStrategyService = (BiddingStrategyService) user.GetService( + AdWordsService.v201309.BiddingStrategyService); + + BudgetService budgetService = (BudgetService) user.GetService( + AdWordsService.v201309.BudgetService); + + CampaignService campaignService = (CampaignService) user.GetService( + AdWordsService.v201309.CampaignService); + + String BIDDINGSTRATEGY_NAME = "Maximize Clicks " + ExampleUtilities.GetRandomString(); + const long BID_CEILING = 2000000; + const long SPEND_TARGET = 20000000; + + String BUDGET_NAME = "Shared Interplanetary Budget #" + ExampleUtilities.GetRandomString(); + const long BUDGET_AMOUNT = 30000000; + + String CAMPAIGN_NAME = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString(); + + try { + SharedBiddingStrategy sharedBiddingStrategy = CreateBiddingStrategy(biddingStrategyService, + BIDDINGSTRATEGY_NAME, BID_CEILING, SPEND_TARGET); + Console.WriteLine("Shared bidding strategy with name '{0}' and ID {1} of type {2} was " + + "created.", sharedBiddingStrategy.name, sharedBiddingStrategy.id, + sharedBiddingStrategy.biddingScheme.BiddingSchemeType); + + Budget sharedBudget = CreateSharedBudget(budgetService, BUDGET_NAME, BUDGET_AMOUNT); + + Campaign newCampaign = CreateCampaignWithBiddingStrategy(campaignService, CAMPAIGN_NAME, + sharedBiddingStrategy.id, sharedBudget.budgetId); + + Console.WriteLine("Campaign with name '{0}', ID {1} and bidding scheme ID {2} was " + + "created.", newCampaign.name, newCampaign.id, + newCampaign.biddingStrategyConfiguration.biddingStrategyId); + + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create campaign that uses shared " + + "bidding strategy.", ex); + } + } + + /// + /// Creates the shared bidding strategy. + /// + /// The bidding strategy service. + /// The bidding strategy name. + /// The bid ceiling. + /// The spend target. + /// The bidding strategy object. + private SharedBiddingStrategy CreateBiddingStrategy( + BiddingStrategyService biddingStrategyService, String name, long bidCeiling, + long spendTarget) { + // Create a shared bidding strategy. + SharedBiddingStrategy sharedBiddingStrategy = new SharedBiddingStrategy(); + sharedBiddingStrategy.name = name; + + TargetSpendBiddingScheme biddingScheme = new TargetSpendBiddingScheme(); + // Optionally set additional bidding scheme parameters. + biddingScheme.bidCeiling = new Money(); + biddingScheme.bidCeiling.microAmount = bidCeiling; + + biddingScheme.spendTarget = new Money(); + biddingScheme.spendTarget.microAmount = spendTarget; + + sharedBiddingStrategy.biddingScheme = biddingScheme; + + // Create operation. + BiddingStrategyOperation operation = new BiddingStrategyOperation(); + operation.@operator = Operator.ADD; + operation.operand = sharedBiddingStrategy; + + return biddingStrategyService.mutate(new BiddingStrategyOperation[] {operation}).value[0]; + } + + /// + /// Creates an explicit budget to be used only to create the Campaign. + /// + /// The budget service. + /// The budget name. + /// The budget amount. + /// The budget object. + private Budget CreateSharedBudget(BudgetService budgetService, String name, long amount) { + // Create a shared budget + Budget budget = new Budget(); + budget.name = name; + budget.period = BudgetBudgetPeriod.DAILY; + budget.amount = new Money(); + budget.amount.microAmount = amount; + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + budget.isExplicitlyShared = true; + + // Create operation. + BudgetOperation operation = new BudgetOperation(); + operation.operand = budget; + operation.@operator = Operator.ADD; + + // Make the mutate request. + return budgetService.mutate(new BudgetOperation[] {operation}).value[0]; + } + + /// + /// Creates the campaign with a shared bidding strategy. + /// + /// The campaign service. + /// The campaign name. + /// The bidding strategy id. + /// The shared budget id. + /// The campaign object. + private Campaign CreateCampaignWithBiddingStrategy(CampaignService campaignService, string name, + long biddingStrategyId, long sharedBudgetId) { + // Create campaign. + Campaign campaign = new Campaign(); + campaign.name = name; + + // Set the budget. + campaign.budget = new Budget(); + campaign.budget.budgetId = sharedBudgetId; + + // Set bidding strategy (required). + BiddingStrategyConfiguration biddingStrategyConfiguration = + new BiddingStrategyConfiguration(); + biddingStrategyConfiguration.biddingStrategyId = biddingStrategyId; + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration; + + // Set keyword matching setting (required). + KeywordMatchSetting keywordMatchSetting = new KeywordMatchSetting(); + keywordMatchSetting.optIn = true; + campaign.settings = new Setting[] {keywordMatchSetting}; + + // Set network targeting (recommended). + NetworkSetting networkSetting = new NetworkSetting(); + networkSetting.targetGoogleSearch = true; + networkSetting.targetSearchNetwork = true; + networkSetting.targetContentNetwork = true; + campaign.networkSetting = networkSetting; + + // Create operation. + CampaignOperation operation = new CampaignOperation(); + operation.operand = campaign; + operation.@operator = Operator.ADD; + + return campaignService.mutate(new CampaignOperation[] {operation}).value[0]; + } + } +} diff --git a/examples/AdWords/CSharp/v201309/BasicOperations/AddAdGroupDemographicCriteria.cs b/examples/AdWords/CSharp/v201309/BasicOperations/AddAdGroupDemographicCriteria.cs new file mode 100644 index 00000000000..f6250cea4d3 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/BasicOperations/AddAdGroupDemographicCriteria.cs @@ -0,0 +1,123 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example adds demographic target criteria to an ad group. To get + /// ad groups, run AddAdGroup.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class AddAdGroupDemographicCriteria : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAdGroupDemographicCriteria codeExample = new AddAdGroupDemographicCriteria(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds demographic target criteria to an ad group. To get ad " + + "groups, run AddAdGroup.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which criteria are + /// added. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201309.AdGroupCriterionService); + + // Create biddable ad group criterion for gender + Gender genderTarget = new Gender(); + // Criterion Id for male. The IDs can be found here + // https://developers.google.com/adwords/api/docs/appendix/genders + genderTarget.id = 10; + + BiddableAdGroupCriterion genderBiddableAdGroupCriterion = new BiddableAdGroupCriterion(); + genderBiddableAdGroupCriterion.adGroupId = adGroupId; + genderBiddableAdGroupCriterion.criterion = genderTarget; + + // Create negative ad group criterion for age range + AgeRange ageRangeNegative = new AgeRange(); + // Criterion Id for age 18 to 24. The IDs can be found here + // https://developers.google.com/adwords/api/docs/appendix/ages + + ageRangeNegative.id = 503001; + NegativeAdGroupCriterion ageRangeNegativeAdGroupCriterion = new NegativeAdGroupCriterion(); + ageRangeNegativeAdGroupCriterion.adGroupId = adGroupId; + ageRangeNegativeAdGroupCriterion.criterion = ageRangeNegative; + + // Create operations. + AdGroupCriterionOperation genderBiddableAdGroupCriterionOperation = + new AdGroupCriterionOperation(); + genderBiddableAdGroupCriterionOperation.operand = genderBiddableAdGroupCriterion; + genderBiddableAdGroupCriterionOperation.@operator = Operator.ADD; + + AdGroupCriterionOperation ageRangeNegativeAdGroupCriterionOperation = + new AdGroupCriterionOperation(); + ageRangeNegativeAdGroupCriterionOperation.operand = ageRangeNegativeAdGroupCriterion; + ageRangeNegativeAdGroupCriterionOperation.@operator = Operator.ADD; + + AdGroupCriterionOperation[] operations = new AdGroupCriterionOperation[] { + genderBiddableAdGroupCriterionOperation, ageRangeNegativeAdGroupCriterionOperation}; + + try { + // Add ad group criteria. + AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations); + + // Display ad group criteria. + if (result != null && result.value != null) { + foreach (AdGroupCriterion adGroupCriterionResult in result.value) { + Console.WriteLine("Ad group criterion with ad group id \"{0}\", criterion id " + + "\"{1}\", and type \"{2}\" was added.", adGroupCriterionResult.adGroupId, + adGroupCriterionResult.criterion.id, + adGroupCriterionResult.criterion.CriterionType); + } + } else { + Console.WriteLine("No ad group criteria were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create ad group criteria.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/BasicOperations/AddAdGroups.cs b/examples/AdWords/CSharp/v201309/BasicOperations/AddAdGroups.cs new file mode 100644 index 00000000000..16485cceb6c --- /dev/null +++ b/examples/AdWords/CSharp/v201309/BasicOperations/AddAdGroups.cs @@ -0,0 +1,141 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example illustrates how to create ad groups. To create + /// campaigns, run AddCampaigns.cs. + /// + /// Tags: AdGroupService.mutate + /// + public class AddAdGroups : ExampleBase { + /// + /// Number of items being added / updated in this code example. + /// + const int NUM_ITEMS = 5; + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAdGroups codeExample = new AddAdGroups(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create ad groups. To create campaigns, " + + "run AddCampaigns.cs"; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to which ad groups are + /// added. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201309.AdGroupService); + + List operations = new List(); + + for (int i = 0; i < NUM_ITEMS; i++) { + // Create the ad group. + AdGroup adGroup = new AdGroup(); + adGroup.name = string.Format("Earth to Mars Cruises #{0}", + ExampleUtilities.GetRandomString()); + adGroup.status = AdGroupStatus.ENABLED; + adGroup.campaignId = campaignId; + + // Set the ad group bids. + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + + CpcBid cpcBid = new CpcBid(); + cpcBid.bid = new Money(); + cpcBid.bid.microAmount = 10000000; + + // Optional: set the content bid. + cpcBid.contentBid = new Money(); + cpcBid.contentBid.microAmount = 2000000; + + biddingConfig.bids = new Bids[] {cpcBid}; + + adGroup.biddingStrategyConfiguration = biddingConfig; + + // Optional: Set targeting restrictions. + // These setting only affect serving for the Display Network. + TargetingSetting targetingSetting = new TargetingSetting(); + + TargetingSettingDetail placementDetail = new TargetingSettingDetail(); + placementDetail.criterionTypeGroup = CriterionTypeGroup.PLACEMENT; + placementDetail.targetAll = true; + + TargetingSettingDetail verticalDetail = new TargetingSettingDetail(); + verticalDetail.criterionTypeGroup = CriterionTypeGroup.VERTICAL; + verticalDetail.targetAll = false; + + targetingSetting.details = new TargetingSettingDetail[] {placementDetail, verticalDetail}; + + adGroup.settings = new Setting[] {targetingSetting}; + + // Create the operation. + AdGroupOperation operation = new AdGroupOperation(); + operation.@operator = Operator.ADD; + operation.operand = adGroup; + + operations.Add(operation); + } + + try { + // Create the ad group. + AdGroupReturnValue retVal = adGroupService.mutate(operations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + foreach (AdGroup newAdGroup in retVal.value) { + Console.WriteLine("Ad group with id = '{0}' and name = '{1}' was created.", + newAdGroup.id, newAdGroup.name); + } + } else { + Console.WriteLine("No ad groups were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create ad groups.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/BasicOperations/AddCampaigns.cs b/examples/AdWords/CSharp/v201309/BasicOperations/AddCampaigns.cs new file mode 100644 index 00000000000..56a7c934d14 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/BasicOperations/AddCampaigns.cs @@ -0,0 +1,173 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example adds campaigns. To get campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignService.mutate + /// + public class AddCampaigns : ExampleBase { + /// + /// Number of items being added / updated in this code example. + /// + const int NUM_ITEMS = 5; + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddCampaigns codeExample = new AddCampaigns(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds campaigns. To get campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the BudgetService. + BudgetService budgetService = + (BudgetService) user.GetService(AdWordsService.v201309.BudgetService); + + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201309.CampaignService); + + // Create the campaign budget. + Budget budget = new Budget(); + budget.name = "Interplanetary Cruise Budget #" + ExampleUtilities.GetRandomString(); + budget.period = BudgetBudgetPeriod.DAILY; + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + budget.amount = new Money(); + budget.amount.microAmount = 500000; + + BudgetOperation budgetOperation = new BudgetOperation(); + budgetOperation.@operator = Operator.ADD; + budgetOperation.operand = budget; + + try { + BudgetReturnValue budgetRetval = budgetService.mutate(new BudgetOperation[] {budgetOperation}); + budget = budgetRetval.value[0]; + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add shared budget.", ex); + } + + List operations = new List(); + + for (int i = 0; i < NUM_ITEMS; i++) { + // Create the campaign. + Campaign campaign = new Campaign(); + campaign.name = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString(); + campaign.status = CampaignStatus.PAUSED; + + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + biddingConfig.biddingStrategyType = BiddingStrategyType.MANUAL_CPC; + + // Optional: provide BiddingScheme. + ManualCpcBiddingScheme biddingScheme = new ManualCpcBiddingScheme(); + biddingScheme.enhancedCpcEnabled = true; + biddingConfig.biddingScheme = biddingScheme; + + campaign.biddingStrategyConfiguration = biddingConfig; + + campaign.budget = new Budget(); + campaign.budget.budgetId = budget.budgetId; + + // Set the campaign network options. + campaign.networkSetting = new NetworkSetting(); + campaign.networkSetting.targetGoogleSearch = true; + campaign.networkSetting.targetSearchNetwork = true; + campaign.networkSetting.targetContentNetwork = false; + campaign.networkSetting.targetPartnerSearchNetwork = false; + + // Set the campaign settings for Advanced location options. + GeoTargetTypeSetting geoSetting = new GeoTargetTypeSetting(); + geoSetting.positiveGeoTargetType = GeoTargetTypeSettingPositiveGeoTargetType.DONT_CARE; + geoSetting.negativeGeoTargetType = GeoTargetTypeSettingNegativeGeoTargetType.DONT_CARE; + + // Set the campaign settings for near-exact and near-phrase matches. + KeywordMatchSetting keywordSetting = new KeywordMatchSetting(); + keywordSetting.optIn = false; + + campaign.settings = new Setting[] {geoSetting, keywordSetting}; + + // Optional: Set the start date. + campaign.startDate = DateTime.Now.AddDays(1).ToString("yyyyMMdd"); + + // Optional: Set the end date. + campaign.endDate = DateTime.Now.AddYears(1).ToString("yyyyMMdd"); + + // Optional: Set the campaign ad serving optimization status. + campaign.adServingOptimizationStatus = AdServingOptimizationStatus.ROTATE; + + // Optional: Set the frequency cap. + FrequencyCap frequencyCap = new FrequencyCap(); + frequencyCap.impressions = 5; + frequencyCap.level = Level.ADGROUP; + frequencyCap.timeUnit = TimeUnit.DAY; + campaign.frequencyCap = frequencyCap; + + // Create the operation. + CampaignOperation operation = new CampaignOperation(); + operation.@operator = Operator.ADD; + operation.operand = campaign; + + operations.Add(operation); + } + + try { + // Add the campaign. + CampaignReturnValue retVal = campaignService.mutate(operations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + foreach (Campaign newCampaign in retVal.value) { + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was added.", + newCampaign.name, newCampaign.id); + } + } else { + Console.WriteLine("No campaigns were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add campaigns.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/BasicOperations/AddKeywords.cs b/examples/AdWords/CSharp/v201309/BasicOperations/AddKeywords.cs new file mode 100644 index 00000000000..6b771c490ca --- /dev/null +++ b/examples/AdWords/CSharp/v201309/BasicOperations/AddKeywords.cs @@ -0,0 +1,127 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example adds a keyword to an ad group. To get ad groups, run + /// GetAdGroups.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class AddKeywords : ExampleBase { + /// + /// Number of items being added / updated in this code example. + /// + const int NUM_ITEMS = 5; + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddKeywords codeExample = new AddKeywords(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a keyword to an ad group. To get ad groups, run " + + "GetAdGroups.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which keywords are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService( + AdWordsService.v201309.AdGroupCriterionService); + + List operations = new List(); + + for (int i = 0; i < NUM_ITEMS; i++) { + // Create the keyword. + Keyword keyword = new Keyword(); + keyword.text = "mars cruise"; + keyword.matchType = KeywordMatchType.BROAD; + + // Create the biddable ad group criterion. + BiddableAdGroupCriterion keywordCriterion = new BiddableAdGroupCriterion(); + keywordCriterion.adGroupId = adGroupId; + keywordCriterion.criterion = keyword; + + // Optional: Set the user status. + keywordCriterion.userStatus = UserStatus.PAUSED; + + // Optional: Set the keyword destination url. + keywordCriterion.destinationUrl = "http://example.com/mars/cruise/" + i; + + // Create the operations. + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.@operator = Operator.ADD; + operation.operand = keywordCriterion; + + operations.Add(operation); + } + try { + // Create the keywords. + AdGroupCriterionReturnValue retVal = adGroupCriterionService.mutate(operations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null) { + foreach (AdGroupCriterion adGroupCriterion in retVal.value) { + // If you are adding multiple type of criteria, then you may need to + // check for + // + // if (adGroupCriterion is Keyword) { ... } + // + // to identify the criterion type. + Console.WriteLine("Keyword with ad group id = '{0}', keyword id = '{1}', text = " + + "'{2}' and match type = '{3}' was created.", adGroupCriterion.adGroupId, + adGroupCriterion.criterion.id, (adGroupCriterion.criterion as Keyword).text, + (adGroupCriterion.criterion as Keyword).matchType); + } + } else { + Console.WriteLine("No keywords were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create keywords.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/BasicOperations/AddTextAds.cs b/examples/AdWords/CSharp/v201309/BasicOperations/AddTextAds.cs new file mode 100644 index 00000000000..5c24552e556 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/BasicOperations/AddTextAds.cs @@ -0,0 +1,129 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example adds text ads to a given ad group. To list ad groups, + /// run GetAdGroups.cs. To learn how to handle policy violations and add + /// exemption requests, see HandlePolicyViolationError.cs. + /// + /// Tags: AdGroupAdService.mutate + /// + public class AddTextAds : ExampleBase { + /// + /// Number of items being added / updated in this code example. + /// + const int NUM_ITEMS = 5; + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddTextAds codeExample = new AddTextAds(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds text ads to a given ad group. To list ad groups, run " + + "GetAdGroups.cs. To learn how to handle policy violations and add exemption " + + "requests, see HandlePolicyViolationError.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which ads are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201309.AdGroupAdService); + + List operations = new List(); + + for (int i = 0; i < NUM_ITEMS; i++) { + // Create the text ad. + TextAd textAd = new TextAd(); + textAd.headline = "Luxury Cruise to Mars"; + textAd.description1 = "Visit the Red Planet in style."; + textAd.description2 = "Low-gravity fun for everyone!"; + textAd.displayUrl = "www.example.com"; + textAd.url = "http://www.example.com/" + i; + + AdGroupAd textAdGroupAd = new AdGroupAd(); + textAdGroupAd.adGroupId = adGroupId; + textAdGroupAd.ad = textAd; + + // Optional: Set the status. + textAdGroupAd.status = AdGroupAdStatus.PAUSED; + + // Create the operation. + AdGroupAdOperation operation = new AdGroupAdOperation(); + operation.@operator = Operator.ADD; + operation.operand = textAdGroupAd; + + operations.Add(operation); + } + + AdGroupAdReturnValue retVal = null; + + try { + // Create the ads. + retVal = service.mutate(operations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null) { + // If you are adding multiple type of Ads, then you may need to check + // for + // + // if (adGroupAd.ad is TextAd) { ... } + // + // to identify the ad type. + foreach (AdGroupAd adGroupAd in retVal.value) { + Console.WriteLine("New text ad with id = \"{0}\" and displayUrl = \"{1}\" was created.", + adGroupAd.ad.id, adGroupAd.ad.displayUrl); + } + } else { + Console.WriteLine("No text ads were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create text ad.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/BasicOperations/DeleteAd.cs b/examples/AdWords/CSharp/v201309/BasicOperations/DeleteAd.cs new file mode 100644 index 00000000000..482a0af434d --- /dev/null +++ b/examples/AdWords/CSharp/v201309/BasicOperations/DeleteAd.cs @@ -0,0 +1,103 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example deletes an ad using the 'REMOVE' operator. To list ads, + /// run GetTextAds.cs. + /// + /// Tags: AdGroupAdService.mutate + /// + public class DeleteAd : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DeleteAd codeExample = new DeleteAd(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long adId = long.Parse("INSERT_AD_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, adId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deletes an ad using the 'REMOVE' operator. To list ads, " + + "run GetTextAds.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the ad. + /// Id of the ad being deleted. + public void Run(AdWordsUser user, long adGroupId, long adId) { + // Get the AdGroupAdService. + AdGroupAdService adGroupAdService = (AdGroupAdService) user.GetService( + AdWordsService.v201309.AdGroupAdService); + + // Since we do not need to update any ad-specific fields, it is enough to + // create the base type. + Ad ad = new Ad(); + ad.id = adId; + + // Create the ad group ad. + AdGroupAd adGroupAd = new AdGroupAd(); + adGroupAd.adGroupId = adGroupId; + + adGroupAd.ad = ad; + + // Create the operation. + AdGroupAdOperation operation = new AdGroupAdOperation(); + operation.operand = adGroupAd; + operation.@operator = Operator.REMOVE; + + try { + // Delete the ad. + AdGroupAdReturnValue retVal = adGroupAdService.mutate( + new AdGroupAdOperation[] {operation}); + + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupAd deletedAdGroupAd = retVal.value[0]; + Console.WriteLine("Ad with id = \"{0}\" and type = \"{1}\" was deleted.", + deletedAdGroupAd.ad.id, deletedAdGroupAd.ad.AdType); + } else { + Console.WriteLine("No ads were deleted."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to delete ad.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/BasicOperations/DeleteAdGroup.cs b/examples/AdWords/CSharp/v201309/BasicOperations/DeleteAdGroup.cs new file mode 100644 index 00000000000..8c2ae667295 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/BasicOperations/DeleteAdGroup.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example deletes an ad group by setting the status to 'DELETED'. + /// To get ad groups, run GetAdGroups.cs. + /// + /// Tags: AdGroupService.mutate + /// + public class DeleteAdGroup : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DeleteAdGroup codeExample = new DeleteAdGroup(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deletes an ad group by setting the status to 'DELETED'. " + + "To get ad groups, run GetAdGroups.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to be deleted. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupService. + AdGroupService adGroupService = (AdGroupService) user.GetService( + AdWordsService.v201309.AdGroupService); + + // Create ad group with DELETED status. + AdGroup adGroup = new AdGroup(); + adGroup.id = adGroupId; + + // When deleting an ad group, rename it to avoid name collisions with new + // adgroups. + adGroup.name = "Deleted AdGroup - " + ExampleUtilities.GetRandomString(); + adGroup.status = AdGroupStatus.DELETED; + + // Create the operation. + AdGroupOperation operation = new AdGroupOperation(); + operation.operand = adGroup; + operation.@operator = Operator.SET; + + try { + // Delete the ad group. + AdGroupReturnValue retVal = adGroupService.mutate(new AdGroupOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroup deletedAdGroup = retVal.value[0]; + Console.WriteLine("Ad group with id = \"{0}\" was renamed to \"{1}\" and deleted.", + deletedAdGroup.id, deletedAdGroup.name); + } else { + Console.WriteLine("No ad groups were deleted."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to delete ad group.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/BasicOperations/DeleteCampaign.cs b/examples/AdWords/CSharp/v201309/BasicOperations/DeleteCampaign.cs new file mode 100644 index 00000000000..198ef33ca82 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/BasicOperations/DeleteCampaign.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example deletes a campaign by setting the status to 'DELETED'. + /// To get campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignService.mutate + /// + public class DeleteCampaign : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DeleteCampaign codeExample = new DeleteCampaign(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deletes a campaign by setting the status to 'DELETED'. " + + "To get campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to be deleted. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignService. + CampaignService campaignService = (CampaignService) user.GetService( + AdWordsService.v201309.CampaignService); + + // Create campaign with DELETED status. + Campaign campaign = new Campaign(); + campaign.id = campaignId; + + // When deleting a campaign, rename it to avoid name collisions with new + // campaigns. + campaign.name = "Deleted Campaign - " + ExampleUtilities.GetRandomString(); + campaign.status = CampaignStatus.DELETED; + + // Create the operation. + CampaignOperation operation = new CampaignOperation(); + operation.operand = campaign; + operation.@operator = Operator.SET; + + try { + // Delete the campaign. + CampaignReturnValue retVal = campaignService.mutate(new CampaignOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + Campaign deletedCampaign = retVal.value[0]; + Console.WriteLine("Campaign with id = \"{0}\" was renamed to \"{1}\" and deleted.", + deletedCampaign.id, deletedCampaign.name); + } else { + Console.WriteLine("No campaigns were deleted."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to delete campaign.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/BasicOperations/DeleteKeyword.cs b/examples/AdWords/CSharp/v201309/BasicOperations/DeleteKeyword.cs new file mode 100644 index 00000000000..acb39a545a1 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/BasicOperations/DeleteKeyword.cs @@ -0,0 +1,103 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example deletes a keyword using the 'REMOVE' operator. To get + /// keywords, run GetKeywords.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class DeleteKeyword : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DeleteKeyword codeExample = new DeleteKeyword(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long keywordId = long.Parse("INSERT_KEYWORD_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, keywordId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deletes a keyword using the 'REMOVE' operator. To get " + + "keywords, run GetKeywords.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the keyword. + /// + /// Id of the keyword to be deleted. + public void Run(AdWordsUser user, long adGroupId, long keywordId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = (AdGroupCriterionService)user.GetService( + AdWordsService.v201309.AdGroupCriterionService); + + // Create base class criterion to avoid setting keyword-specific fields. + Criterion criterion = new Criterion(); + criterion.id = keywordId; + + // Create the ad group criterion. + BiddableAdGroupCriterion adGroupCriterion = new BiddableAdGroupCriterion(); + adGroupCriterion.adGroupId = adGroupId; + adGroupCriterion.criterion = criterion; + + // Create the operation. + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.operand = adGroupCriterion; + operation.@operator = Operator.REMOVE; + + try { + // Delete the keyword. + AdGroupCriterionReturnValue retVal = adGroupCriterionService.mutate( + new AdGroupCriterionOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupCriterion deletedKeyword = retVal.value[0]; + Console.WriteLine("Keyword with ad group id = \"{0}\" and id = \"{1}\" was deleted.", + deletedKeyword.adGroupId, deletedKeyword.criterion.id); + } else { + Console.WriteLine("No keywords were deleted."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to delete keyword.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/BasicOperations/GetAdGroups.cs b/examples/AdWords/CSharp/v201309/BasicOperations/GetAdGroups.cs new file mode 100644 index 00000000000..d82eda021a3 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/BasicOperations/GetAdGroups.cs @@ -0,0 +1,113 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example illustrates how to retrieve all the ad groups for a + /// campaign. To create an ad group, run AddAdGroup.cs. + /// + /// Tags: AdGroupService.get + /// + public class GetAdGroups : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAdGroups codeExample = new GetAdGroups(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve all the ad groups for a " + + "campaign. To create an ad group, run AddAdGroup.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign for which ad groups are + /// retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201309.AdGroupService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Name"}; + + // Create the filters. + Predicate predicate = new Predicate(); + predicate.field = "CampaignId"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] {campaignId.ToString()}; + selector.predicates = new Predicate[] {predicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupPage page = new AdGroupPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the ad groups. + page = adGroupService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroup adGroup in page.entries) { + Console.WriteLine("{0}) Ad group name is '{1}' and id is {2}.", i + 1, adGroup.name, + adGroup.id); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of ad groups found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve ad groups.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/BasicOperations/GetCampaigns.cs b/examples/AdWords/CSharp/v201309/BasicOperations/GetCampaigns.cs new file mode 100644 index 00000000000..e02a6043ae2 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/BasicOperations/GetCampaigns.cs @@ -0,0 +1,102 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example lists all campaigns. To add a campaign, run + /// AddCampaign.cs. + /// + /// Tags: CampaignService.get + /// + public class GetCampaigns : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetCampaigns codeExample = new GetCampaigns(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example lists all campaigns. To add a campaign, run AddCampaign.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201309.CampaignService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Name", "Status"}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + CampaignPage page = new CampaignPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the campaigns. + page = campaignService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (Campaign campaign in page.entries) { + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = '{3}'" + + " was found.", i + 1, campaign.id, campaign.name, campaign.status); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve campaigns", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/BasicOperations/GetCampaignsWithAwql.cs b/examples/AdWords/CSharp/v201309/BasicOperations/GetCampaignsWithAwql.cs new file mode 100644 index 00000000000..e7f463866bb --- /dev/null +++ b/examples/AdWords/CSharp/v201309/BasicOperations/GetCampaignsWithAwql.cs @@ -0,0 +1,100 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example lists all campaigns using an AWQL query. See + /// https://developers.google.com/adwords/api/docs/guides/awql for AWQL + /// documentation. To add a campaign, run AddCampaign.cs. + /// + /// Tags: CampaignService.get + /// + public class GetCampaignsWithAwql : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetCampaignsWithAwql codeExample = new GetCampaignsWithAwql(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example lists all campaigns using an AWQL query. See " + + "https://developers.google.com/adwords/api/docs/guides/awql for AWQL documentation. " + + "To add a campaign, run AddCampaign.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201309.CampaignService); + + // Create the query. + string query = "SELECT Id, Name, Status ORDER BY Name"; + + int offset = 0; + int pageSize = 500; + + CampaignPage page = new CampaignPage(); + + try { + do { + string queryWithPaging = string.Format("{0} LIMIT {1}, {2}", query, offset, pageSize); + + // Get the campaigns. + page = campaignService.query(queryWithPaging); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (Campaign campaign in page.entries) { + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = '{3}'" + + " was found.", i + 1, campaign.id, campaign.name, campaign.status); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve campaigns", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/BasicOperations/GetKeywords.cs b/examples/AdWords/CSharp/v201309/BasicOperations/GetKeywords.cs new file mode 100644 index 00000000000..0749c31801e --- /dev/null +++ b/examples/AdWords/CSharp/v201309/BasicOperations/GetKeywords.cs @@ -0,0 +1,127 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example gets all keywords in an account. To add keywords, run + /// AddKeywords.cs. + /// + /// Tags: AdGroupCriterionService.get + /// + public class GetKeywords : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetKeywords codeExample = new GetKeywords(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all keywords in an account. To add keywords, run " + + "AddKeywords.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201309.AdGroupCriterionService); + + // Create a selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "AdGroupId", "KeywordText"}; + + // Select only keywords. + Predicate predicate = new Predicate(); + predicate.field = "CriteriaType"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] {"KEYWORD"}; + selector.predicates = new Predicate[] {predicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupCriterionPage page = new AdGroupCriterionPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the keywords. + page = adGroupCriterionService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + + foreach (AdGroupCriterion adGroupCriterion in page.entries) { + bool isNegative = (adGroupCriterion is NegativeAdGroupCriterion); + + // If you are retrieving multiple type of criteria, then you may + // need to check for + // + // if (adGroupCriterion is Keyword) { ... } + // + // to identify the criterion type. + Keyword keyword = (Keyword) adGroupCriterion.criterion; + if (isNegative) { + Console.WriteLine("{0}) Negative keyword with ad group ID = '{1}', keyword ID " + + "= '{2}', and text = '{3}' was found.", i + 1, adGroupCriterion.adGroupId, + keyword.id, keyword.text); + } else { + Console.WriteLine("{0}) Keyword with ad group ID = '{1}', keyword ID = '{2}', " + + "text = '{3}' and matchType = '{4} was found.", i + 1, + adGroupCriterion.adGroupId, keyword.id, keyword.text, keyword.matchType); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of keywords found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve keywords.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/BasicOperations/GetTextAds.cs b/examples/AdWords/CSharp/v201309/BasicOperations/GetTextAds.cs new file mode 100644 index 00000000000..2570eafeaf7 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/BasicOperations/GetTextAds.cs @@ -0,0 +1,140 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example retrieves all text ads given an existing ad group. + /// To add text ads to an existing ad group, run AddTextAds.cs. + /// + /// Tags: AdGroupAdService.get + /// + public class GetTextAds : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetTextAds codeExample = new GetTextAds(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves all text ads given an existing ad group. To add " + + "text ads to an existing ad group, run AddTextAds.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group from which text ads are + /// retrieved. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201309.AdGroupAdService); + + // Create a selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Status", "Headline", "Description1", "Description2", + "DisplayUrl"}; + + // Set the sort order. + OrderBy orderBy = new OrderBy(); + orderBy.field = "Id"; + orderBy.sortOrder = SortOrder.ASCENDING; + selector.ordering = new OrderBy[] {orderBy}; + + // Restrict the fetch to only the selected ad group id. + Predicate adGroupPredicate = new Predicate(); + adGroupPredicate.field = "AdGroupId"; + adGroupPredicate.@operator = PredicateOperator.EQUALS; + adGroupPredicate.values = new string[] {adGroupId.ToString()}; + + // Retrieve only text ads. + Predicate typePredicate = new Predicate(); + typePredicate.field = "AdType"; + typePredicate.@operator = PredicateOperator.EQUALS; + typePredicate.values = new string[] {"TEXT_AD"}; + + // By default disabled ads aren't returned by the selector. To return + // them include the DISABLED status in the statuses field. + Predicate statusPredicate = new Predicate(); + statusPredicate.field = "Status"; + statusPredicate.@operator = PredicateOperator.IN; + + statusPredicate.values = new string[] {AdGroupAdStatus.ENABLED.ToString(), + AdGroupAdStatus.PAUSED.ToString(), AdGroupAdStatus.DISABLED.ToString()}; + + selector.predicates = new Predicate[] {adGroupPredicate, statusPredicate, typePredicate}; + + // Select the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupAdPage page = new AdGroupAdPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the text ads. + page = service.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + + foreach (AdGroupAd adGroupAd in page.entries) { + TextAd textAd = (TextAd) adGroupAd.ad; + Console.WriteLine("{0}) Ad id is {1} and status is {2}", i + 1, textAd.id, + adGroupAd.status); + Console.WriteLine(" {0}\n {1}\n {2}\n {3}", textAd.headline, + textAd.description1, textAd.description2, textAd.displayUrl); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of text ads found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get text ads", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/BasicOperations/PauseAd.cs b/examples/AdWords/CSharp/v201309/BasicOperations/PauseAd.cs new file mode 100644 index 00000000000..301d21e26a0 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/BasicOperations/PauseAd.cs @@ -0,0 +1,101 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example pauses a given ad. To list all ads, run GetTextAds.cs. + /// + /// Tags: AdGroupAdService.mutate + /// + public class PauseAd : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + PauseAd codeExample = new PauseAd(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long adId = long.Parse("INSERT_AD_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, adId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example pauses a given ad. To list all ads, run GetTextAds.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the ad. + /// + /// Id of the ad to be paused. + public void Run(AdWordsUser user, long adGroupId, long adId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201309.AdGroupAdService); + + AdGroupAdStatus status = AdGroupAdStatus.PAUSED; + + // Create the ad group ad. + AdGroupAd adGroupAd = new AdGroupAd(); + adGroupAd.status = status; + adGroupAd.adGroupId = adGroupId; + + adGroupAd.ad = new Ad(); + adGroupAd.ad.id = adId; + + // Create the operation. + AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation(); + adGroupAdOperation.@operator = Operator.SET; + adGroupAdOperation.operand = adGroupAd; + + try { + // Update the ad. + AdGroupAdReturnValue retVal = service.mutate(new AdGroupAdOperation[]{adGroupAdOperation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupAd pausedAdGroupAd = retVal.value[0]; + Console.WriteLine("Ad with id \"{0}\" and ad group id \"{1}\"was paused.", + pausedAdGroupAd.ad.id, pausedAdGroupAd.adGroupId); + } else { + Console.WriteLine("No ads were paused."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to pause ad.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/BasicOperations/UpdateAdGroup.cs b/examples/AdWords/CSharp/v201309/BasicOperations/UpdateAdGroup.cs new file mode 100644 index 00000000000..6d14b870347 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/BasicOperations/UpdateAdGroup.cs @@ -0,0 +1,95 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example illustrates how to update an ad group, setting its + /// status to 'PAUSED'. To create an ad group, run AddAdGroup.cs. + /// + /// Tags: AdGroupService.mutate + /// + public class UpdateAdGroup : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdateAdGroup codeExample = new UpdateAdGroup(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to update an ad group, setting its status to " + + "'PAUSED'. To create an ad group, run AddAdGroup.cs"; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to be updated. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201309.AdGroupService); + + // Create the ad group. + AdGroup adGroup = new AdGroup(); + adGroup.status = AdGroupStatus.PAUSED; + adGroup.id = adGroupId; + + // Create the operation. + AdGroupOperation operation = new AdGroupOperation(); + operation.@operator = Operator.SET; + operation.operand = adGroup; + + try { + // Update the ad group. + AdGroupReturnValue retVal = adGroupService.mutate(new AdGroupOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroup pausedAdGroup = retVal.value[0]; + Console.WriteLine("Ad group with id = '{0}' was successfully updated.", + pausedAdGroup.id); + } else { + Console.WriteLine("No ad groups were updated."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update ad group.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/BasicOperations/UpdateCampaign.cs b/examples/AdWords/CSharp/v201309/BasicOperations/UpdateCampaign.cs new file mode 100644 index 00000000000..89b26dd6912 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/BasicOperations/UpdateCampaign.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example updates a campaign. To get campaigns, run + /// GetCampaigns.cs. + /// + /// Tags: CampaignService.mutate + /// + public class UpdateCampaign : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdateCampaign codeExample = new UpdateCampaign(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a campaign. To get campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to be updated. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService)user.GetService(AdWordsService.v201309.CampaignService); + + // Create the campaign. + Campaign campaign = new Campaign(); + campaign.id = campaignId; + campaign.status = CampaignStatus.PAUSED; + + // Create the operation. + CampaignOperation operation = new CampaignOperation(); + operation.@operator = Operator.SET; + operation.operand = campaign; + + try { + // Update the campaign. + CampaignReturnValue retVal = campaignService.mutate((new CampaignOperation[] {operation})); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + Campaign updatedCampaign = retVal.value[0]; + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was updated.", + updatedCampaign.name, updatedCampaign.id); + } else { + Console.WriteLine("No campaigns were updated."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update campaign.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/BasicOperations/UpdateKeyword.cs b/examples/AdWords/CSharp/v201309/BasicOperations/UpdateKeyword.cs new file mode 100644 index 00000000000..4956bd86697 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/BasicOperations/UpdateKeyword.cs @@ -0,0 +1,123 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example updates the bid of a keyword. To get keyword, run + /// GetKeywords.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class UpdateKeyword : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdateKeyword codeExample = new UpdateKeyword(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long keywordId = long.Parse("INSERT_KEYWORD_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, keywordId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the bid of a keyword. To get keyword, run " + + "GetKeywords.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the keyword. + /// + /// Id of the keyword to be updated. + public void Run(AdWordsUser user, long adGroupId, long keywordId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201309.AdGroupCriterionService); + + // Since we are not updating any keyword-specific fields, it is enough to + // create a criterion object. + Criterion criterion = new Criterion(); + criterion.id = keywordId; + + // Create ad group criterion. + BiddableAdGroupCriterion biddableAdGroupCriterion = new BiddableAdGroupCriterion(); + biddableAdGroupCriterion.adGroupId = adGroupId; + biddableAdGroupCriterion.criterion = criterion; + + // Create the bids. + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + CpcBid cpcBid = new CpcBid(); + cpcBid.bid = new Money(); + cpcBid.bid.microAmount = 1000000; + biddingConfig.bids = new Bids[] {cpcBid}; + + biddableAdGroupCriterion.biddingStrategyConfiguration = biddingConfig; + + // Create the operation. + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.@operator = Operator.SET; + operation.operand = biddableAdGroupCriterion; + + try { + // Update the keyword. + AdGroupCriterionReturnValue retVal = + adGroupCriterionService.mutate(new AdGroupCriterionOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupCriterion adGroupCriterion = retVal.value[0]; + long bidAmount = 0; + foreach (Bids bids in (adGroupCriterion as BiddableAdGroupCriterion). + biddingStrategyConfiguration.bids) { + if (bids is CpcBid) { + bidAmount = (bids as CpcBid).bid.microAmount; + break; + } + } + + Console.WriteLine("Keyword with ad group id = '{0}', id = '{1}' was updated with " + + "bid amount = '{2}' micros.", adGroupCriterion.adGroupId, + adGroupCriterion.criterion.id, bidAmount); + } else { + Console.WriteLine("No keyword was updated."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update keyword.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/CampaignManagement/AddExperiment.cs b/examples/AdWords/CSharp/v201309/CampaignManagement/AddExperiment.cs new file mode 100644 index 00000000000..4a10896aac2 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/CampaignManagement/AddExperiment.cs @@ -0,0 +1,215 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example creates an experiment using a query percentage of 10, + /// which defines what fraction of auctions should go to the control split + /// (90%) vs. the experiment split (10%), then adds experimental bid changes + /// for criteria and ad groups. To get campaigns, run GetCampaigns.cs. + /// To get ad groups, run GetAdGroups.cs. To get criteria, run + /// GetKeywords.cs. + /// + /// Tags: ExperimentService.mutate + /// + public class AddExperiment : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddExperiment codeExample = new AddExperiment(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long criterionId = long.Parse("INSERT_CRITERION_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId, adGroupId, criterionId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates an experiment using a query percentage of 10, which " + + "defines what fraction of auctions should go to the control split (90%) vs. the " + + "experiment split (10%), then adds experimental bid changes for criteria and ad " + + "groups. To get campaigns, run GetCampaigns.cs. To get ad groups, run " + + "GetAdGroups.cs. To get criteria, run GetKeywords.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to which experiments are + /// added. + /// Id of the ad group to which experiments are + /// added. + /// Id of the criterion for which experiments + /// are added. + public void Run(AdWordsUser user, long campaignId, long adGroupId, long criterionId) { + // Get the ExperimentService. + ExperimentService experimentService = + (ExperimentService) user.GetService(AdWordsService.v201309.ExperimentService); + + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201309.AdGroupService); + + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201309.AdGroupCriterionService); + + // Create the experiment. + Experiment experiment = new Experiment(); + experiment.campaignId = campaignId; + experiment.name = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString(); + experiment.queryPercentage = 10; + experiment.startDateTime = DateTime.Now.AddDays(1).ToString("yyyyMMdd HHmmss"); + + // Optional: Set the end date. + experiment.endDateTime = DateTime.Now.AddDays(30).ToString("yyyyMMdd HHmmss"); + + // Optional: Set the status. + experiment.status = ExperimentStatus.ACTIVE; + + // Create the operation. + ExperimentOperation experimentOperation = new ExperimentOperation(); + experimentOperation.@operator = Operator.ADD; + experimentOperation.operand = experiment; + + try { + // Add the experiment. + ExperimentReturnValue experimentRetVal = experimentService.mutate( + new ExperimentOperation[] {experimentOperation}); + + // Display the results. + if (experimentRetVal != null && experimentRetVal.value != null && experimentRetVal.value. + Length > 0) { + long experimentId = 0; + + Experiment newExperiment = experimentRetVal.value[0]; + + Console.WriteLine("Experiment with name = \"{0}\" and id = \"{1}\" was added.\n", + newExperiment.name, newExperiment.id); + experimentId = newExperiment.id; + + // Set ad group for the experiment. + AdGroup adGroup = new AdGroup(); + adGroup.id = adGroupId; + + // Create experiment bid multiplier rule that will modify ad group bid + // for the experiment. + ManualCPCAdGroupExperimentBidMultipliers adGroupBidMultiplier = + new ManualCPCAdGroupExperimentBidMultipliers(); + adGroupBidMultiplier.maxCpcMultiplier = new BidMultiplier(); + adGroupBidMultiplier.maxCpcMultiplier.multiplier = 1.5; + + // Set experiment data to the ad group. + AdGroupExperimentData adGroupExperimentData = new AdGroupExperimentData(); + adGroupExperimentData.experimentId = experimentId; + adGroupExperimentData.experimentDeltaStatus = ExperimentDeltaStatus.MODIFIED; + adGroupExperimentData.experimentBidMultipliers = adGroupBidMultiplier; + + adGroup.experimentData = adGroupExperimentData; + + // Create the operation. + AdGroupOperation adGroupOperation = new AdGroupOperation(); + adGroupOperation.operand = adGroup; + adGroupOperation.@operator = Operator.SET; + + // Update the ad group. + AdGroupReturnValue adGroupRetVal = adGroupService.mutate(new AdGroupOperation[] { + adGroupOperation}); + + // Display the results. + if (adGroupRetVal != null && adGroupRetVal.value != null && + adGroupRetVal.value.Length > 0) { + AdGroup updatedAdGroup = adGroupRetVal.value[0]; + Console.WriteLine("Ad group with name = \"{0}\", id = \"{1}\" and status = \"{2}\" " + + "was updated for the experiment.\n", updatedAdGroup.name, updatedAdGroup.id, + updatedAdGroup.status); + } else { + Console.WriteLine("No ad groups were updated."); + } + + // Set ad group criteria for the experiment. + Criterion criterion = new Criterion(); + criterion.id = criterionId; + + BiddableAdGroupCriterion adGroupCriterion = new BiddableAdGroupCriterion(); + adGroupCriterion.adGroupId = adGroupId; + adGroupCriterion.criterion = criterion; + + // Create experiment bid multiplier rule that will modify criterion bid + // for the experiment. + ManualCPCAdGroupCriterionExperimentBidMultiplier bidMultiplier = + new ManualCPCAdGroupCriterionExperimentBidMultiplier(); + bidMultiplier.maxCpcMultiplier = new BidMultiplier(); + bidMultiplier.maxCpcMultiplier.multiplier = 1.5; + + // Set experiment data to the criterion. + BiddableAdGroupCriterionExperimentData adGroupCriterionExperimentData = + new BiddableAdGroupCriterionExperimentData(); + adGroupCriterionExperimentData.experimentId = experimentId; + adGroupCriterionExperimentData.experimentDeltaStatus = ExperimentDeltaStatus.MODIFIED; + adGroupCriterionExperimentData.experimentBidMultiplier = bidMultiplier; + + adGroupCriterion.experimentData = adGroupCriterionExperimentData; + + // Create the operation. + AdGroupCriterionOperation adGroupCriterionOperation = new AdGroupCriterionOperation(); + adGroupCriterionOperation.operand = adGroupCriterion; + adGroupCriterionOperation.@operator = Operator.SET; + + // Update the ad group criteria. + AdGroupCriterionReturnValue adGroupCriterionRetVal = adGroupCriterionService.mutate( + new AdGroupCriterionOperation[] {adGroupCriterionOperation}); + + // Display the results. + if (adGroupCriterionRetVal != null && adGroupCriterionRetVal.value != null && + adGroupCriterionRetVal.value.Length > 0) { + AdGroupCriterion updatedAdGroupCriterion = adGroupCriterionRetVal.value[0]; + Console.WriteLine("Ad group criterion with ad group id = \"{0}\", criterion id = " + + "\"{1}\" and type = \"{2}\" was updated for the experiment.\n", + updatedAdGroupCriterion.adGroupId, updatedAdGroupCriterion.criterion.id, + updatedAdGroupCriterion.criterion.CriterionType); + } else { + Console.WriteLine("No ad group criteria were updated."); + } + } else { + Console.WriteLine("No experiments were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add experiment.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/CampaignManagement/AddKeywordsInBulk.cs b/examples/AdWords/CSharp/v201309/CampaignManagement/AddKeywordsInBulk.cs new file mode 100644 index 00000000000..9277737cd90 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/CampaignManagement/AddKeywordsInBulk.cs @@ -0,0 +1,173 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.RegularExpressions; +using System.Threading; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example shows how to add keywords in bulk using the + /// MutateJobService. + /// + /// Tags: MutateJobService.mutate, MutateJobService.get + /// Tags: MutateJobService.getResult + /// + public class AddKeywordsInBulk : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddKeywordsInBulk codeExample = new AddKeywordsInBulk(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to add keywords in bulk using the MutateJobService."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad groups to which keywords are + /// added. + public void Run(AdWordsUser user, long adGroupId) { + // Get the MutateJobService. + MutateJobService mutateJobService = (MutateJobService) user.GetService( + AdWordsService.v201309.MutateJobService); + + const int RETRY_INTERVAL = 30; + const int RETRIES_COUNT = 30; + const int KEYWORD_NUMBER = 100; + const string INDEX_REGEX = "operations\\[(\\d+)\\].operand"; + + List operations = new List(); + + // Create AdGroupCriterionOperation to add keywords. + for (int i = 0; i < KEYWORD_NUMBER; i++) { + Keyword keyword = new Keyword(); + keyword.text = string.Format("mars cruise {0}", i); + keyword.matchType = KeywordMatchType.BROAD; + + BiddableAdGroupCriterion criterion = new BiddableAdGroupCriterion(); + criterion.adGroupId = adGroupId; + criterion.criterion = keyword; + + AdGroupCriterionOperation adGroupCriterionOperation = new AdGroupCriterionOperation(); + adGroupCriterionOperation.@operator = Operator.ADD; + adGroupCriterionOperation.operand = criterion; + + operations.Add(adGroupCriterionOperation); + } + + BulkMutateJobPolicy policy = new BulkMutateJobPolicy(); + // You can specify up to 3 job IDs that must successfully complete before + // this job can be processed. + policy.prerequisiteJobIds = new long[] {}; + + SimpleMutateJob job = mutateJobService.mutate(operations.ToArray(), policy); + + // Wait for the job to complete. + bool completed = false; + int retryCount = 0; + Console.WriteLine("Retrieving job status..."); + + while (completed == false && retryCount < RETRIES_COUNT) { + BulkMutateJobSelector selector = new BulkMutateJobSelector(); + selector.jobIds = new long[] {job.id}; + + try { + Job[] allJobs = mutateJobService.get(selector); + if (allJobs != null && allJobs.Length > 0) { + job = (SimpleMutateJob) allJobs[0]; + if (job.status == BasicJobStatus.COMPLETED || job.status == BasicJobStatus.FAILED) { + completed = true; + break; + } else { + Console.WriteLine("{0}: Current status is {1}, waiting {2} seconds to retry...", + retryCount, job.status, RETRY_INTERVAL); + Thread.Sleep(RETRY_INTERVAL * 1000); + retryCount++; + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to fetch simple mutate job with " + + "id = {0}.", ex); + } + } + + if (job.status == BasicJobStatus.COMPLETED) { + // Handle cases where the job completed. + + // Create the job selector. + BulkMutateJobSelector selector = new BulkMutateJobSelector(); + selector.jobIds = new long[] {job.id}; + + // Get the job results. + JobResult jobResult = mutateJobService.getResult(selector); + if (jobResult != null) { + SimpleMutateResult results = (SimpleMutateResult) jobResult.Item; + if (results != null) { + // Display the results. + if (results.results != null) { + for (int i = 0; i < results.results.Length; i++) { + Operand operand = results.results[i]; + Console.WriteLine("Operation {0} - {1}", i, (operand.Item is PlaceHolder) ? + "FAILED" : "SUCCEEDED"); + } + } + + // Display the errors. + if (results.errors != null) { + foreach (ApiError apiError in results.errors) { + Match match = Regex.Match(apiError.fieldPath, INDEX_REGEX, RegexOptions.IgnoreCase); + string index = (match.Success)? match.Groups[1].Value : "???"; + Console.WriteLine("Operation index {0} failed due to reason: '{1}', " + + "trigger: '{2}'", index, apiError.errorString, apiError.trigger); + } + } + } + } + Console.WriteLine("Job completed successfully!"); + } else if (job.status == BasicJobStatus.FAILED) { + // Handle the cases where job failed. + Console.WriteLine("Job failed with reason: " + job.failureReason); + } else if (job.status == BasicJobStatus.PROCESSING || job.status == BasicJobStatus.PENDING) { + // Handle the cases where job didn't complete after wait period. + Console.WriteLine("Job did not complete in {0} secconds.", RETRY_INTERVAL * RETRIES_COUNT); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/CampaignManagement/AddLocationExtension.cs b/examples/AdWords/CSharp/v201309/CampaignManagement/AddLocationExtension.cs new file mode 100644 index 00000000000..57b5a96d00c --- /dev/null +++ b/examples/AdWords/CSharp/v201309/CampaignManagement/AddLocationExtension.cs @@ -0,0 +1,148 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example shows how to add a location extension to an existing + /// campaign. To create a campaign, run AddCampaign.cs. + /// + /// Tags: GeoLocationService.get, CampaignAdExtensionService.mutate + /// + public class AddLocationExtension : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddLocationExtension codeExample = new AddLocationExtension(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to add a location extension to an existing " + + "campaign. To create a campaign, run AddCampaign.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to which location + /// extensions are added. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignAdExtensionService. + CampaignAdExtensionService campaignExtensionService = + (CampaignAdExtensionService) user.GetService(AdWordsService.v201309. + CampaignAdExtensionService); + + // Add location 1: 1600 Amphitheatre Pkwy, Mountain View, US. + Address address1 = new Address(); + address1.streetAddress = "1600 Amphitheatre Parkway"; + address1.cityName = "Mountain View"; + address1.provinceCode = "CA"; + address1.postalCode = "94043"; + address1.countryCode = "US"; + + // Add location 2: 38 avenue de l'Opéra, 75002 Paris, FR. + Address address2 = new Address(); + address2.streetAddress = "38 avenue de l'Opéra"; + address2.cityName = "Paris"; + address2.postalCode = "75002"; + address2.countryCode = "FR"; + + // Get the GeoLocationService. + GeoLocationService geoService = + (GeoLocationService) user.GetService(AdWordsService.v201309.GeoLocationService); + + // Create the selector. + GeoLocationSelector selector = new GeoLocationSelector(); + selector.addresses = new Address[] {address1, address2}; + + // Retrieve the locations. + GeoLocation[] locations = geoService.get(selector); + + List operations = new List(); + + // Phone numbers for US and FR offices. + string[] phoneNumbers = new string[] {"(650) 253-0000", "(0)1 42 68 53 00"}; + int index = 0; + + // Create a location extension for each geo location returned by the + // server. + foreach (GeoLocation location in locations) { + LocationExtension locationExtension = new LocationExtension(); + locationExtension.address = location.address; + locationExtension.geoPoint = location.geoPoint; + locationExtension.encodedLocation = location.encodedLocation; + locationExtension.source = LocationExtensionSource.ADWORDS_FRONTEND; + + // Optional: Set the company name. + locationExtension.companyName = "ACME Inc."; + + // Optional: Set the phone number. + locationExtension.phoneNumber = phoneNumbers[index]; + index++; + + CampaignAdExtension extension = new CampaignAdExtension(); + extension.campaignId = campaignId; + extension.status = CampaignAdExtensionStatus.ACTIVE; + extension.adExtension = locationExtension; + + CampaignAdExtensionOperation operation = new CampaignAdExtensionOperation(); + operation.@operator = Operator.ADD; + operation.operand = extension; + + operations.Add(operation); + } + + try { + CampaignAdExtensionReturnValue retVal = + campaignExtensionService.mutate(operations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + foreach (CampaignAdExtension campaignExtension in retVal.value) { + Console.WriteLine("Created a location extension with id = \"{0}\" and " + + "status = \"{1}\"", campaignExtension.adExtension.id, campaignExtension.status); + } + } else { + Console.WriteLine("No location extensions were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add location extension.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/CampaignManagement/GetAllDisapprovedAds.cs b/examples/AdWords/CSharp/v201309/CampaignManagement/GetAllDisapprovedAds.cs new file mode 100644 index 00000000000..30b375616ee --- /dev/null +++ b/examples/AdWords/CSharp/v201309/CampaignManagement/GetAllDisapprovedAds.cs @@ -0,0 +1,121 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example retrieves all the disapproved ads in a given campaign. + /// + /// Tags: AdGroupAdService.get + /// + public class GetAllDisapprovedAds : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAllDisapprovedAds codeExample = new GetAllDisapprovedAds(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves all the disapproved ads in a given campaign."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign for which disapproved ads + /// are retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201309.AdGroupAdService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "AdGroupCreativeApprovalStatus", + "AdGroupAdDisapprovalReasons"}; + + // Create the filter. + Predicate campaignPredicate = new Predicate(); + campaignPredicate.@operator = PredicateOperator.EQUALS; + campaignPredicate.field = "CampaignId"; + campaignPredicate.values = new string[] {campaignId.ToString()}; + + Predicate approvalPredicate = new Predicate(); + approvalPredicate.@operator = PredicateOperator.EQUALS; + approvalPredicate.field = "AdGroupCreativeApprovalStatus"; + approvalPredicate.values = new string[] {AdGroupAdApprovalStatus.DISAPPROVED.ToString()}; + + selector.predicates = new Predicate[] {campaignPredicate, approvalPredicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupAdPage page = new AdGroupAdPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the disapproved ads. + page = service.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroupAd adGroupAd in page.entries) { + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " + + "reason(s):", i, adGroupAd.ad.id); + foreach (string reason in adGroupAd.disapprovalReasons) { + Console.WriteLine(" {0}", reason); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get disapproved ads.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs b/examples/AdWords/CSharp/v201309/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs new file mode 100644 index 00000000000..ba45be8ad01 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs @@ -0,0 +1,108 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example retrieves all the disapproved ads in a given campaign + /// using AWQL. See https://developers.google.com/adwords/api/docs/guides/awql + /// for AWQL documentation. + /// + /// Tags: AdGroupAdService.get + /// + public class GetAllDisapprovedAdsWithAwql : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAllDisapprovedAdsWithAwql codeExample = new GetAllDisapprovedAdsWithAwql(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves all the disapproved ads in a given campaign using " + + "AWQL. See https://developers.google.com/adwords/api/docs/guides/awql for AWQL " + + "documentation."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign for which disapproved ads + /// are retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201309.AdGroupAdService); + + // Get all the disapproved ads for this campaign. + string query = string.Format("SELECT Id, AdGroupAdDisapprovalReasons WHERE " + + "CampaignId = {0} AND AdGroupCreativeApprovalStatus = DISAPPROVED ORDER BY Id", + campaignId); + + int offset = 0; + int pageSize = 500; + + AdGroupAdPage page = new AdGroupAdPage(); + + try { + do { + string queryWithPaging = string.Format("{0} LIMIT {1}, {2}", query, offset, pageSize); + + // Get the disapproved ads. + page = service.query(queryWithPaging); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroupAd adGroupAd in page.entries) { + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " + + "reason(s):", i, adGroupAd.ad.id); + foreach (string reason in adGroupAd.disapprovalReasons) { + Console.WriteLine(" {0}", reason); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get disapproved ads.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/CampaignManagement/PromoteExperiment.cs b/examples/AdWords/CSharp/v201309/CampaignManagement/PromoteExperiment.cs new file mode 100644 index 00000000000..d21ede66a86 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/CampaignManagement/PromoteExperiment.cs @@ -0,0 +1,98 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This example promotes an experiment, which permanently applies all the + /// experiment changes made to its related ad groups, criteria and ads. To + /// create an experiment, run AddExperiment.vb. + /// + /// Tags: ExperimentService.mutate + /// + public class PromoteExperiment : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + PromoteExperiment codeExample = new PromoteExperiment(); + Console.WriteLine(codeExample.Description); + try { + long experimentId = long.Parse("INSERT_EXPERIMENT_ID_HERE"); + codeExample.Run(new AdWordsUser(), experimentId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example promotes an experiment, which permanently applies all the experiment" + + " changes made to its related ad groups, criteria and ads. To create an experiment, " + + "run AddExperiment.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the experiment to be promoted. + public void Run(AdWordsUser user, long experimentId) { + // Get the ExperimentService. + ExperimentService experimentService = + (ExperimentService) user.GetService(AdWordsService.v201309.ExperimentService); + + // Set experiment's status to PROMOTED. + Experiment experiment = new Experiment(); + experiment.id = experimentId; + experiment.status = ExperimentStatus.PROMOTED; + + // Create the operation. + ExperimentOperation operation = new ExperimentOperation(); + operation.@operator = Operator.SET; + operation.operand = experiment; + + try { + // Update the experiment. + ExperimentReturnValue retVal = experimentService.mutate( + new ExperimentOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + Experiment promotedExperiment = retVal.value[0]; + Console.WriteLine("Experiment with name = \"{0}\" and id = \"{1}\" was promoted.\n", + promotedExperiment.name, promotedExperiment.id); + } else { + Console.WriteLine("No experiments were promoted."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to promote experiment.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/CampaignManagement/SetAdParameters.cs b/examples/AdWords/CSharp/v201309/CampaignManagement/SetAdParameters.cs new file mode 100644 index 00000000000..c105dab91ce --- /dev/null +++ b/examples/AdWords/CSharp/v201309/CampaignManagement/SetAdParameters.cs @@ -0,0 +1,152 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example illustrates how to create a text ad with ad parameters. + /// To add an ad group, run AddAdGroup.cs. To add a keyword, run + /// run AddKeyword.cs. + /// + /// Tags: AdGroupAdService.mutate, AdParamService.mutate + /// + public class SetAdParameters : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SetAdParameters codeExample = new SetAdParameters(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long criterionId = long.Parse("INSERT_CRITERION_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, criterionId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create a text ad with ad parameters." + + " To add an ad group, run AddAdGroup.cs. To add a keyword, run AddKeyword.vb."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the criterion. + /// + /// Id of the keyword for which the ad + /// parameters are set. + public void Run(AdWordsUser user, long adGroupId, long criterionId) { + // Get the AdGroupAdService. + AdGroupAdService adGroupAdService = (AdGroupAdService) user.GetService( + AdWordsService.v201309.AdGroupAdService); + + // Get the AdParamService. + AdParamService adParamService = (AdParamService) user.GetService( + AdWordsService.v201309.AdParamService); + + // Create the text ad. + TextAd textAd = new TextAd(); + textAd.url = "http://www.example.com"; + textAd.displayUrl = "example.com"; + textAd.headline = " Mars Cruises"; + textAd.description1 = "Low-gravity fun for {param1:cheap}."; + textAd.description2 = "Only {param2:a few} seats left!"; + + AdGroupAd adOperand = new AdGroupAd(); + adOperand.adGroupId = adGroupId; + adOperand.status = AdGroupAdStatus.ENABLED; + adOperand.ad = textAd; + + // Create the operation. + AdGroupAdOperation adOperation = new AdGroupAdOperation(); + adOperation.operand = adOperand; + adOperation.@operator = Operator.ADD; + + try { + // Create the text ad. + AdGroupAdReturnValue retVal = adGroupAdService.mutate( + new AdGroupAdOperation[] {adOperation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + Console.WriteLine("Text ad with id ='{0}' was successfully added.", + retVal.value[0].ad.id); + } else { + Console.WriteLine("No text ads were created."); + return; + } + } catch (Exception ex) { + Console.WriteLine("Failed to create text ads. Exception says \"{0}\"", ex.Message); + return; + } + + // Create the ad param for price. + AdParam priceParam = new AdParam(); + priceParam.adGroupId = adGroupId; + priceParam.criterionId = criterionId; + priceParam.paramIndex = 1; + priceParam.insertionText = "$100"; + + // Create the ad param for seats. + AdParam seatParam = new AdParam(); + seatParam.adGroupId = adGroupId; + seatParam.criterionId = criterionId; + seatParam.paramIndex = 2; + seatParam.insertionText = "50"; + + // Create the operations. + AdParamOperation priceOperation = new AdParamOperation(); + priceOperation.@operator = Operator.SET; + priceOperation.operand = priceParam; + + AdParamOperation seatOperation = new AdParamOperation(); + seatOperation.@operator = Operator.SET; + seatOperation.operand = seatParam; + + try { + // Set the ad parameters. + AdParam [] newAdParams = adParamService.mutate(new AdParamOperation[] + {priceOperation, seatOperation}); + + // Display the results. + if (newAdParams != null) { + Console.WriteLine("Ad parameters were successfully updated."); + } else { + Console.WriteLine("No ad parameters were set."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to set ad parameters.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/CampaignManagement/SetBidModifier.cs b/examples/AdWords/CSharp/v201309/CampaignManagement/SetBidModifier.cs new file mode 100644 index 00000000000..55c1abb5f80 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/CampaignManagement/SetBidModifier.cs @@ -0,0 +1,111 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example sets a bid modifier for the mobile platform on given + /// campaign. The campaign must be an enhanced type of campaign. To get + /// campaigns, run GetCampaigns.cs. To enhance a campaign, run + /// SetCampaignEnhanced.cs. + /// + /// Tags: CampaignCriterionService.mutate + /// + public class SetBidModifier : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SetBidModifier codeExample = new SetBidModifier(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + double bidModifier = double.Parse("INSERT_BID_MODIFIER_HERE"); + codeExample.Run(new AdWordsUser(), campaignId, bidModifier); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example sets a bid modifier for the mobile platform on given " + + "campaign. The campaign must be an enhanced type of campaign. To get campaigns, " + + "run GetCampaigns.cs. To enhance a campaign, run SetCampaignEnhanced.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign whose bid should be modified. + /// + /// The bid modifier. + public void Run(AdWordsUser user, long campaignId, double bidModifier) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201309.CampaignCriterionService); + + // Create mobile platform. The ID can be found in the documentation. + // https://developers.google.com/adwords/api/docs/appendix/platforms + Platform mobile = new Platform(); + mobile.id = 30001; + + // Create criterion with modified bid. + CampaignCriterion criterion = new CampaignCriterion(); + criterion.campaignId = campaignId; + criterion.criterion = mobile; + criterion.bidModifier = bidModifier; + + // Create SET operation. + CampaignCriterionOperation operation = new CampaignCriterionOperation(); + operation.@operator = Operator.SET; + operation.operand = criterion; + + try { + // Update campaign criteria. + CampaignCriterionReturnValue result = campaignCriterionService.mutate( + new CampaignCriterionOperation[] {operation}); + + // Display campaign criteria. + if (result.value != null) { + foreach (CampaignCriterion newCriterion in result.value) { + Console.WriteLine("Campaign criterion with campaign id '{0}', criterion id '{1}', " + + "and type '{2}' was modified with bid {3:F2}.", newCriterion.campaignId, + newCriterion.criterion.id, newCriterion.criterion.type, newCriterion.bidModifier); + } + } else { + Console.WriteLine("No campaign criteria were modified."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to set bid modifier for campaign.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/CampaignManagement/ValidateTextAd.cs b/examples/AdWords/CSharp/v201309/CampaignManagement/ValidateTextAd.cs new file mode 100644 index 00000000000..420a74af71a --- /dev/null +++ b/examples/AdWords/CSharp/v201309/CampaignManagement/ValidateTextAd.cs @@ -0,0 +1,109 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example shows how to use the validateOnly header to validate + /// a text ad. No objects will be created, but exceptions will still be + /// thrown. + /// + /// Tags: AdGroupAdService.mutate + /// + public class ValidateTextAd : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + ValidateTextAd codeExample = new ValidateTextAd(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to use the validateOnly header to validate a " + + "text ad. No objects will be created, but exceptions will still be thrown."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which text ads are + /// added. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService adGroupAdService = + (AdGroupAdService) user.GetService(AdWordsService.v201309.AdGroupAdService); + + // Set the validateOnly headers. + adGroupAdService.RequestHeader.validateOnly = true; + + // Create your text ad. + TextAd textAd = new TextAd(); + textAd.headline = "Luxury Cruise to Mars"; + textAd.description1 = "Visit the Red Planet in style."; + textAd.description2 = "Low-gravity fun for everyone!!"; + textAd.displayUrl = "www.example.com"; + textAd.url = "http://www.example.com"; + + AdGroupAd textAdGroupAd = new AdGroupAd(); + textAdGroupAd.adGroupId = adGroupId; + textAdGroupAd.ad = textAd; + + AdGroupAdOperation textAdOperation = new AdGroupAdOperation(); + textAdOperation.@operator = Operator.ADD; + textAdOperation.operand = textAdGroupAd; + + try { + AdGroupAdReturnValue retVal = adGroupAdService.mutate( + (new AdGroupAdOperation[] {textAdOperation})); + // Since validation is ON, result will be null. + Console.WriteLine("text ad validated successfully."); + } catch (AdWordsApiException ex) { + // This block will be hit if there is a validation error from the server. + Console.WriteLine("There were validation error(s) while adding text ad."); + + if (ex.ApiException != null) { + foreach (ApiError error in ((ApiException) ex.ApiException).errors) { + Console.WriteLine(" Error type is '{0}' and fieldPath is '{1}'.", + error.ApiErrorType, error.fieldPath); + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to validate text ad.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/ErrorHandling/HandlePartialFailures.cs b/examples/AdWords/CSharp/v201309/ErrorHandling/HandlePartialFailures.cs new file mode 100644 index 00000000000..3703b11c740 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/ErrorHandling/HandlePartialFailures.cs @@ -0,0 +1,136 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example demonstrates how to handle partial failures. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class HandlePartialFailures : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + HandlePartialFailures codeExample = new HandlePartialFailures(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example demonstrates how to handle partial failures."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which keywords are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201309.AdGroupCriterionService); + + // Set partial failure mode for the service. + adGroupCriterionService.RequestHeader.partialFailure = true; + + List operations = new List(); + + // Create the keywords. + string[] keywords = new String[] {"mars cruise", "inv@lid cruise", "venus cruise", + "b(a)d keyword cruise"}; + + foreach (String keywordText in keywords) { + Keyword keyword = new Keyword(); + keyword.text = keywordText; + keyword.matchType = KeywordMatchType.BROAD; + + // Create biddable ad group criterion. + BiddableAdGroupCriterion keywordBiddableAdGroupCriterion = new BiddableAdGroupCriterion(); + keywordBiddableAdGroupCriterion.adGroupId = adGroupId; + keywordBiddableAdGroupCriterion.criterion = keyword; + + // Create the operation. + AdGroupCriterionOperation keywordAdGroupCriterionOperation = + new AdGroupCriterionOperation(); + keywordAdGroupCriterionOperation.operand = keywordBiddableAdGroupCriterion; + keywordAdGroupCriterionOperation.@operator = Operator.ADD; + operations.Add(keywordAdGroupCriterionOperation); + } + + try { + // Create the keywords. + AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations.ToArray()); + + // Display the results. + if (result != null && result.value != null) { + foreach (AdGroupCriterion adGroupCriterionResult in result.value) { + if (adGroupCriterionResult.criterion != null) { + Console.WriteLine("Keyword with ad group id '{0}', criterion id '{1}', and " + + "text '{2}' was added.\n", adGroupCriterionResult.adGroupId, + adGroupCriterionResult.criterion.id, + ((Keyword) adGroupCriterionResult.criterion).text); + } + } + } else { + Console.WriteLine("No keywords were added."); + } + + // Display the partial failure errors. + if (result != null && result.partialFailureErrors != null) { + foreach (ApiError apiError in result.partialFailureErrors) { + int operationIndex = ErrorUtilities.GetOperationIndex(apiError.fieldPath); + if (operationIndex != -1) { + AdGroupCriterion adGroupCriterion = operations[operationIndex].operand; + Console.WriteLine("Keyword with ad group id '{0}' and text '{1}' " + + "triggered a failure for the following reason: '{2}'.\n", + adGroupCriterion.adGroupId, ((Keyword) adGroupCriterion.criterion).text, + apiError.errorString); + } else { + Console.WriteLine("A failure for the following reason: '{0}' has occurred.\n", + apiError.errorString); + } + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add keywords in partial failure mode.", + ex); + } + } + } +} + diff --git a/examples/AdWords/CSharp/v201309/ErrorHandling/HandlePolicyViolationError.cs b/examples/AdWords/CSharp/v201309/ErrorHandling/HandlePolicyViolationError.cs new file mode 100644 index 00000000000..06905a49f63 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/ErrorHandling/HandlePolicyViolationError.cs @@ -0,0 +1,173 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example adds a text ad, and shows how to handle a policy + /// violation. + /// + /// Tags: AdGroupAdService.mutate + /// + public class HandlePolicyViolationError : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + HandlePolicyViolationError codeExample = new HandlePolicyViolationError(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a text ad, and shows how to handle a policy violation."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which ads are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201309.AdGroupAdService); + + // Create the text ad. + TextAd textAd = new TextAd(); + textAd.headline = "Luxury Cruise to Mars"; + textAd.description1 = "Visit the Red Planet in style."; + textAd.description2 = "Low-gravity fun for everyone!!"; + textAd.displayUrl = "www.example.com"; + textAd.url = "http://www.example.com"; + + AdGroupAd textadGroupAd = new AdGroupAd(); + textadGroupAd.adGroupId = adGroupId; + textadGroupAd.ad = textAd; + + // Create the operations. + AdGroupAdOperation textAdOperation = new AdGroupAdOperation(); + textAdOperation.@operator = Operator.ADD; + textAdOperation.operand = textadGroupAd; + + try { + AdGroupAdReturnValue retVal = null; + + // Setup two arrays, one to hold the list of all operations to be + // validated, and another to hold the list of operations that cannot be + // fixed after validation. + List allOperations = new List(); + List operationsToBeRemoved = new List(); + + allOperations.Add(textAdOperation); + + try { + // Validate the operations. + service.RequestHeader.validateOnly = true; + retVal = service.mutate(allOperations.ToArray()); + } catch (AdWordsApiException ex) { + ApiException innerException = ex.ApiException as ApiException; + if (innerException == null) { + throw new Exception("Failed to retrieve ApiError. See inner exception for more " + + "details.", ex); + } + + // Examine each ApiError received from the server. + foreach (ApiError apiError in innerException.errors) { + int index = ErrorUtilities.GetOperationIndex(apiError.fieldPath); + if (index == -1) { + // This API error is not associated with an operand, so we cannot + // recover from this error by removing one or more operations. + // Rethrow the exception for manual inspection. + throw; + } + + // Handle policy violation errors. + if (apiError is PolicyViolationError) { + PolicyViolationError policyError = (PolicyViolationError) apiError; + + if (policyError.isExemptable) { + // If the policy violation error is exemptable, add an exemption + // request. + List exemptionRequests = new List(); + if (allOperations[index].exemptionRequests != null) { + exemptionRequests.AddRange(allOperations[index].exemptionRequests); + } + + ExemptionRequest exemptionRequest = new ExemptionRequest(); + exemptionRequest.key = policyError.key; + exemptionRequests.Add(exemptionRequest); + allOperations[index].exemptionRequests = exemptionRequests.ToArray(); + } else { + // Policy violation error is not exemptable, remove this + // operation from the list of operations. + operationsToBeRemoved.Add(allOperations[index]); + } + } else { + // This is not a policy violation error, remove this operation + // from the list of operations. + operationsToBeRemoved.Add(allOperations[index]); + } + } + // Remove all operations that aren't exemptable. + foreach (AdGroupAdOperation operation in operationsToBeRemoved) { + allOperations.Remove(operation); + } + } + + if (allOperations.Count > 0) { + // Perform the operations exemptible of a policy violation. + service.RequestHeader.validateOnly = false; + retVal = service.mutate(allOperations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + foreach (AdGroupAd newAdGroupAd in retVal.value) { + Console.WriteLine("New ad with id = \"{0}\" and displayUrl = \"{1}\" was created.", + newAdGroupAd.ad.id, newAdGroupAd.ad.displayUrl); + } + } else { + Console.WriteLine("No ads were created."); + } + } else { + Console.WriteLine("There are no ads to create after policy violation checks."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create ads.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/ErrorHandling/HandleRateExceededError.cs b/examples/AdWords/CSharp/v201309/ErrorHandling/HandleRateExceededError.cs new file mode 100644 index 00000000000..50d76d6d8d6 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/ErrorHandling/HandleRateExceededError.cs @@ -0,0 +1,204 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example shows how to handle RateExceededError in your + /// application. To trigger the rate exceeded error, this code example runs + /// 100 threads in parallel, each thread attempting to validate 100 keywords + /// in a single request. Note that spawning 100 parallel threads is for + /// illustrative purposes only, you shouldn't do this in your application. + /// + /// Tags: AdGroupAdService.mutate + /// + public class HandleRateExceededError: ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + HandleRateExceededError codeExample = new HandleRateExceededError(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to handle RateExceededError in your application. " + + "To trigger the rate exceeded error, this code example runs 100 threads in " + + "parallel, each thread attempting to validate 100 keywords in a single request. " + + "Note that spawning 100 parallel threads is for illustrative purposes only, you " + + "shouldn't do this in your application."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which keywords are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + const int NUM_THREADS = 100; + + // Increase the maximum number of parallel HTTP connections that .NET + // framework allows. By default, this is set to 2 by the .NET framework. + System.Net.ServicePointManager.DefaultConnectionLimit = NUM_THREADS; + + List threads = new List(); + + for (int i = 0; i < NUM_THREADS; i++) { + Thread thread = new Thread(new KeywordThread(user, i, adGroupId).Run); + threads.Add(thread); + } + + for (int i = 0; i < NUM_THREADS; i++) { + threads[i].Start(i); + } + + for (int i = 0; i < NUM_THREADS; i++) { + threads[i].Join(); + } + } + + /// + /// Thread class for validating keywords. + /// + class KeywordThread { + /// + /// Index of this thread, for identifying and debugging. + /// + int threadIndex; + + /// + /// The ad group id to which keywords are added. + /// + long adGroupId; + + /// + /// The AdWords user who owns this ad group. + /// + AdWordsUser user; + + /// + /// Number of keywords to be validated in each API call. + /// + const int NUM_KEYWORDS = 100; + + /// + /// Initializes a new instance of the class. + /// + /// Index of the thread. + /// The ad group id. + /// The AdWords user who owns the ad group. + public KeywordThread(AdWordsUser user, int threadIndex, long adGroupId) { + this.user = user; + this.threadIndex = threadIndex; + this.adGroupId = adGroupId; + } + + /// + /// Main method for the thread. + /// + /// The thread parameter. + public void Run(Object obj) { + // Create the operations. + List operations = new List(); + + for (int j = 0; j < NUM_KEYWORDS; j++) { + // Create the keyword. + Keyword keyword = new Keyword(); + keyword.text = "mars cruise thread " + threadIndex.ToString() + " seed " + j.ToString(); + keyword.matchType = KeywordMatchType.BROAD; + + // Create the biddable ad group criterion. + AdGroupCriterion keywordCriterion = new BiddableAdGroupCriterion(); + keywordCriterion.adGroupId = adGroupId; + keywordCriterion.criterion = keyword; + + // Create the operations. + AdGroupCriterionOperation keywordOperation = new AdGroupCriterionOperation(); + keywordOperation.@operator = Operator.ADD; + keywordOperation.operand = keywordCriterion; + + operations.Add(keywordOperation); + } + + // Get the AdGroupCriterionService. This should be done within the + // thread, since a service can only handle one outgoing HTTP request + // at a time. + AdGroupCriterionService service = (AdGroupCriterionService) user.GetService( + AdWordsService.v201309.AdGroupCriterionService); + service.RequestHeader.validateOnly = true; + int retryCount = 0; + const int NUM_RETRIES = 3; + try { + while (retryCount < NUM_RETRIES) { + try { + // Validate the keywords. + AdGroupCriterionReturnValue retval = service.mutate(operations.ToArray()); + break; + } catch (AdWordsApiException ex) { + // Handle API errors. + ApiException innerException = ex.ApiException as ApiException; + if (innerException == null) { + throw new Exception("Failed to retrieve ApiError. See inner exception for more " + + "details.", ex); + } + foreach (ApiError apiError in innerException.errors) { + if (!(apiError is RateExceededError)) { + // Rethrow any errors other than RateExceededError. + throw; + } + // Handle rate exceeded errors. + RateExceededError rateExceededError = (RateExceededError) apiError; + Console.WriteLine("Got Rate exceeded error - rate name = '{0}', scope = '{1}', " + + "retry After {2} seconds.", rateExceededError.rateScope, + rateExceededError.rateName, rateExceededError.retryAfterSeconds); + Thread.Sleep(rateExceededError.retryAfterSeconds * 1000); + retryCount = retryCount + 1; + } + } finally { + if (retryCount == NUM_RETRIES) { + throw new Exception(String.Format("Could not recover after making {0} attempts.", + retryCount)); + } + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to validate keywords.", ex); + } + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/ErrorHandling/HandleTwoFactorAuthorizationError.cs b/examples/AdWords/CSharp/v201309/ErrorHandling/HandleTwoFactorAuthorizationError.cs new file mode 100644 index 00000000000..b2e89a28b6b --- /dev/null +++ b/examples/AdWords/CSharp/v201309/ErrorHandling/HandleTwoFactorAuthorizationError.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example illustrates how to handle 2 factor authorization errors. + /// + /// Tags: CampaignService.get + /// + public class HandleTwoFactorAuthorizationError : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + HandleTwoFactorAuthorizationError codeExample = new HandleTwoFactorAuthorizationError(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to handle 2 factor authorization errors."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Use a test account for which 2 factor authentication has been enabled. + string loginEmail = "2steptester@gmail.com"; + string password = "testaccount"; + + AdWordsAppConfig config = new AdWordsAppConfig(); + config.Email = loginEmail; + config.Password = password; + AuthToken authToken = new AuthToken(config, "adwords"); + + try { + // Try to obtain an authToken. + string token = authToken.GetToken(); + Console.WriteLine("Retrieved an authToken = {0} for user {1}.", token, loginEmail); + } catch (AuthTokenException ex) { + // Since the test account has 2 factor authentication enabled, this block + // of code will be executed. + if (ex.ErrorCode == AuthTokenErrorCode.BadAuthentication) { + if (ex.Info == "InvalidSecondFactor") { + Console.WriteLine("The user has enabled two factor authentication in this " + + "account. Have the user generate an application-specific password to make " + + "calls against the AdWords API. See " + + "http://adwordsapi.blogspot.com/2011/02/authentication-changes-with-2-step.html" + + " for more details."); + } else { + Console.WriteLine("Invalid credentials."); + } + } else { + throw new System.ApplicationException(String.Format("The server raised an {0} error.", + ex.ErrorCode)); + } + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/Express/AddExpressBusinesses.cs b/examples/AdWords/CSharp/v201309/Express/AddExpressBusinesses.cs new file mode 100644 index 00000000000..1a056cc2cc3 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Express/AddExpressBusinesses.cs @@ -0,0 +1,114 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + + /// + /// This code example adds express businesses. To get express businesses, run + /// GetExpressBusinesses.cs. + /// + /// Tags: ExpressBusinessService.mutate + /// + public class AddExpressBusinesses : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds express businesses. To get express businesses, run " + + "GetExpressBusinesses.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddExpressBusinesses codeExample = new AddExpressBusinesses(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ExpressBusinessService. + ExpressBusinessService businessService = (ExpressBusinessService) + user.GetService(AdWordsService.v201309.ExpressBusinessService); + + ExpressBusiness business1 = new ExpressBusiness(); + business1.status = ExpressBusinessStatus.ACTIVE; + business1.name = "Express Interplanetary Cruise #" + ExampleUtilities.GetShortRandomString(); + + Address address1 = new Address(); + address1.streetAddress = "1600 Amphitheatre Pkwy"; + address1.cityName = "Mountain View"; + address1.provinceCode = "CA"; + address1.countryCode = "US"; + + business1.address = address1; + business1.website = "http://www.example.com/cruise1"; + + ExpressBusinessOperation operation1 = new ExpressBusinessOperation(); + operation1.@operator = Operator.ADD; + operation1.operand = business1; + + ExpressBusiness business2 = new ExpressBusiness(); + business2.status = (ExpressBusinessStatus.ACTIVE); + business2.name = "Express Interplanetary Cruise #" + ExampleUtilities.GetShortRandomString(); + + Address address2 = new Address(); + address2.streetAddress = "111 8th Ave"; + address2.cityName = "New York"; + address2.provinceCode = "NY"; + address2.countryCode = "US"; + + business2.address = address2; + business2.website = "http://www.example.com/cruise2"; + + ExpressBusinessOperation operation2 = new ExpressBusinessOperation(); + operation2.@operator = Operator.ADD; + operation2.operand = business2; + + try { + ExpressBusiness[] addedBusinesses = businessService.mutate( + new ExpressBusinessOperation[] {operation1, operation2}); + + Console.WriteLine("Added {0} express businesses", addedBusinesses.Length); + foreach (ExpressBusiness addedBusiness in addedBusinesses) { + Console.WriteLine("Added express business with ID = {0} and name '{1}'.", + addedBusiness.id, addedBusiness.name); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add express business.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201309/Express/AddPromotion.cs b/examples/AdWords/CSharp/v201309/Express/AddPromotion.cs new file mode 100644 index 00000000000..ff87e4b2b53 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Express/AddPromotion.cs @@ -0,0 +1,154 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + + /// + /// This code example adds a new promotion to an express business. To get + /// promotions, run GetPromotions.cs. + /// + /// Tags: ExpressBusinessService.get, PromotionService.mutate + /// + public class AddPromotion : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a new promotion to an express business. To get " + + "promotions, run GetPromotions.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddPromotion codeExample = new AddPromotion(); + Console.WriteLine(codeExample.Description); + try { + long businessId = long.Parse("INSERT_ADWORDS_EXPRESS_BUSINESS_ID_HERE"); + codeExample.Run(new AdWordsUser(), businessId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The AdWords Express business id. + public void Run(AdWordsUser user, long businessId) { + // Get the ExpressBusinessService. + ExpressBusinessService businessService = (ExpressBusinessService) + user.GetService(AdWordsService.v201309.ExpressBusinessService); + + // Get the PromotionService + PromotionService promotionService = (PromotionService) + user.GetService(AdWordsService.v201309.PromotionService); + + // Get the business for the businessId. We will need its geo point to + // create a Proximity criterion for the new Promotion. + Selector businessSelector = new Selector(); + + Predicate predicate = new Predicate(); + predicate.field = "Id"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] { businessId.ToString() }; + businessSelector.predicates = new Predicate[] { predicate }; + + businessSelector.fields = new string[] { "Id", "GeoPoint" }; + + ExpressBusinessPage businessPage = businessService.get(businessSelector); + + if (businessPage == null || businessPage.entries == null || + businessPage.entries.Length == 0) { + Console.WriteLine("No business was found."); + return; + } + + // Set the business ID to the service. + promotionService.RequestHeader.expressBusinessId = businessId; + + // First promotion + Promotion marsTourPromotion = new Promotion(); + Money budget = new Money(); + budget.microAmount = 1000000L; + marsTourPromotion.name = "Mars Tour Promotion " + ExampleUtilities.GetShortRandomString(); + marsTourPromotion.status = PromotionStatus.PAUSED; + marsTourPromotion.destinationUrl = "http://www.example.com"; + marsTourPromotion.budget = budget; + marsTourPromotion.callTrackingEnabled = true; + + // Criteria + + // Criterion - Travel Agency product service + ProductService productService = new ProductService(); + productService.text = "Travel Agency"; + + // Criterion - English language + // The ID can be found in the documentation: + // https://developers.google.com/adwords/api/docs/appendix/languagecodes + Language language = new Language(); + language.id = 1000L; + + // Criterion - Within 15 miles + Proximity proximity = new Proximity(); + proximity.geoPoint = businessPage.entries[0].geoPoint; + proximity.radiusDistanceUnits = ProximityDistanceUnits.MILES; + proximity.radiusInUnits = 15; + + marsTourPromotion.criteria = new Criterion[] { productService, language, proximity }; + + // Creatives + + Creative creative1 = new Creative(); + creative1.headline = "Standard Mars Trip"; + creative1.line1 = "Fly coach to Mars"; + creative1.line2 = "Free in-flight pretzels"; + + Creative creative2 = new Creative(); + creative2.headline = "Deluxe Mars Trip"; + creative2.line1 = "Fly first class to Mars"; + creative2.line2 = "Unlimited powdered orange drink"; + + marsTourPromotion.creatives = new Creative[] { creative1, creative2 }; + + PromotionOperation operation = new PromotionOperation(); + operation.@operator = Operator.ADD; + operation.operand = marsTourPromotion; + + try { + Promotion[] addedPromotions = promotionService.mutate( + new PromotionOperation[] { operation }); + + Console.WriteLine("Added promotion ID {0} with name {1} to business ID {2}.", + addedPromotions[0].id, addedPromotions[0].name, businessId); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add promotions.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201309/Express/GetExpressBusinesses.cs b/examples/AdWords/CSharp/v201309/Express/GetExpressBusinesses.cs new file mode 100644 index 00000000000..db2f48468f8 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Express/GetExpressBusinesses.cs @@ -0,0 +1,151 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Text; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + + /// + /// This code example gets all express businesses. To add an express + /// business, run AddExpressBusinesses.cs. + /// + /// Tags: ExpressBusinessService.get + /// + public class GetExpressBusinesses : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all express businesses. To add an express business, " + + "run AddExpressBusinesses.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetExpressBusinesses codeExample = new GetExpressBusinesses(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ExpressBusinessService. + ExpressBusinessService businessService = (ExpressBusinessService) + user.GetService(AdWordsService.v201309.ExpressBusinessService); + + Selector selector = new Selector(); + selector.fields = new String[] { "Id", "Name", "Website", "Address", "GeoPoint", "Status" }; + + // To get all express businesses owned by the current customer, + // simply skip the call to selector.setPredicates below. + Predicate predicate = new Predicate(); + predicate.field = "Status"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] { "ACTIVE" }; + + selector.predicates = new Predicate[] { predicate }; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + ExpressBusinessPage page = null; + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get all businesses. + page = businessService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (ExpressBusiness business in page.entries) { + Console.WriteLine("{0}) Express business found with name '{1}', id = {2}, " + + "website = {3} and status = {4}.\n", i + 1, business.name, business.id, + business.website, business.status); + Console.WriteLine("Address"); + Console.WriteLine("======="); + Console.WriteLine(FormatAddress(business.address)); + Console.WriteLine("Co-ordinates: {0}\n", FormatGeopoint(business.geoPoint)); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of businesses found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve express business.", ex); + } + } + + /// + /// Formats the address as a printable text. + /// + /// The address object. + /// The formatted text. + private static string FormatAddress(Address address) { + if (address == null) { + return "Not available."; + } + StringBuilder addressBuilder = new StringBuilder(); + + addressBuilder.AppendFormat("Line 1: {0}\n", address.streetAddress ?? ""); + addressBuilder.AppendFormat("Line 2: {0}\n", address.streetAddress2 ?? ""); + addressBuilder.AppendFormat("Province Name: {0}\n", address.provinceName ?? ""); + addressBuilder.AppendFormat("Province Code: {0}\n", address.provinceCode ?? ""); + addressBuilder.AppendFormat("City name: {0}\n", address.cityName ?? ""); + addressBuilder.AppendFormat("Postal code: {0}\n", address.postalCode ?? ""); + addressBuilder.AppendFormat("Country name: {0}\n", address.countryCode ?? ""); + + return addressBuilder.ToString(); + } + + /// + /// Formats the geopoint as a printable text. + /// + /// The geo point. + /// The formatted text. + private string FormatGeopoint(GeoPoint geoPoint) { + if (geoPoint == null) { + return "(Unknown, Unknown)"; + } + return string.Format("({0}, {1})", (decimal) geoPoint.latitudeInMicroDegrees / 1000000, + (decimal) geoPoint.longitudeInMicroDegrees / 1000000); + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201309/Express/GetProductServices.cs b/examples/AdWords/CSharp/v201309/Express/GetProductServices.cs new file mode 100644 index 00000000000..bb222ab4b3a --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Express/GetProductServices.cs @@ -0,0 +1,119 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + + /// + /// This code example shows how to retrieve AdWords Express product/service + /// objects related to specific criteria. + /// + /// Tags: ProductServiceService.get + /// + public class GetProductServices : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to retrieve AdWords Express product/service " + + "objects related to specific criteria."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetProductServices codeExample = new GetProductServices(); + Console.WriteLine(codeExample.Description); + try { + string productServiceSuggestion = "INSERT_PRODUCT_SERVICE_SUGGESTION_HERE"; + string localeText = "INSERT_LOCALE_TEXT_HERE"; + codeExample.Run(new AdWordsUser(), productServiceSuggestion, localeText); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The product/service suggestion. + /// + /// The locale text. + public void Run(AdWordsUser user, string productServiceSuggestion, string localeText) { + // Get the service, which loads the required classes. + ProductServiceService productServiceService = (ProductServiceService) user.GetService( + AdWordsService.v201309.ProductServiceService); + + // Create selector. + Selector selector = new Selector(); + selector.fields = new string[] {"ProductServiceText"}; + + // Create predicates. + Predicate textPredicate = new Predicate(); + textPredicate.field = "ProductServiceText"; + textPredicate.@operator = PredicateOperator.EQUALS; + textPredicate.values = new string[] {productServiceSuggestion}; + + Predicate localePredicate = new Predicate(); + localePredicate.field = "Locale"; + localePredicate.@operator = PredicateOperator.EQUALS; + localePredicate.values = new string[]{localeText}; + + selector.predicates = new Predicate[] {textPredicate, localePredicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + ProductServicePage page = null; + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Make the get request. + page = productServiceService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (ProductService productService in page.entries) { + Console.WriteLine("Product/service with text '{0}' found", productService.text); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of products/services found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve products/services.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201309/Express/GetPromotions.cs b/examples/AdWords/CSharp/v201309/Express/GetPromotions.cs new file mode 100644 index 00000000000..5997a9b8b33 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Express/GetPromotions.cs @@ -0,0 +1,110 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Text; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + + /// + /// This code example gets all express businesses. To add an express + /// business, run AddExpressBusinesses.cs. + /// + /// Tags: ExpressBusinessService.get + /// + public class GetPromotions : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all express businesses. To add an express business, " + + "run AddExpressBusinesses.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetPromotions codeExample = new GetPromotions(); + Console.WriteLine(codeExample.Description); + try { + long businessId = long.Parse("INSERT_ADWORDS_EXPRESS_BUSINESS_ID_HERE"); + codeExample.Run(new AdWordsUser(), businessId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The AdWords Express business id. + public void Run(AdWordsUser user, long businessId) { + // Get the PromotionService. + PromotionService promotionService = (PromotionService) + user.GetService(AdWordsService.v201309.PromotionService); + + // Set the business ID to the service. + promotionService.RequestHeader.expressBusinessId = businessId; + + Selector selector = new Selector(); + selector.fields = new String[] {"PromotionId", "Name", "Status", "DestinationUrl", + "StreetAddressVisible", "CallTrackingEnabled", "ContentNetworkOptedOut", "Budget", + "PromotionCriteria", "RemainingBudget", "Creatives", "CampaignIds" }; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + PromotionPage page = null; + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get all promotions for the business. + page = promotionService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (Promotion promotion in page.entries) { + // Summary. + Console.WriteLine("0) Express promotion with name = {1} and id = {2} was found.", + i + 1, promotion.id, promotion.name); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of promotions found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve promotions.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201309/Express/UpdateExpressBusiness.cs b/examples/AdWords/CSharp/v201309/Express/UpdateExpressBusiness.cs new file mode 100644 index 00000000000..52990629f48 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Express/UpdateExpressBusiness.cs @@ -0,0 +1,89 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + + /// + /// This code example updates an express business. To add an express + /// business, run AddExpressBusinesses.cs. + /// + /// Tags: ExpressBusinessService.mutate + /// + public class UpdateExpressBusiness : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates an express business. To add an express business, run " + + "AddExpressBusinesses.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdateExpressBusiness codeExample = new UpdateExpressBusiness(); + Console.WriteLine(codeExample.Description); + try { + long businessId = long.Parse("INSERT_ADWORDS_EXPRESS_BUSINESS_ID_HERE"); + codeExample.Run(new AdWordsUser(), businessId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The AdWords Express business id. + public void Run(AdWordsUser user, long businessId) { + // Get the ExpressBusinessService. + ExpressBusinessService businessService = (ExpressBusinessService) + user.GetService(AdWordsService.v201309.ExpressBusinessService); + + // Update the website and address for the business + ExpressBusiness business = new ExpressBusiness(); + business.id = businessId; + business.name = "Express Interplanetary Cruise #" + ExampleUtilities.GetShortRandomString(); + business.website = "http://www.example.com/?myParam=" + businessId; + + ExpressBusinessOperation operation = new ExpressBusinessOperation(); + operation.@operator = Operator.SET; + operation.operand = business; + + try { + ExpressBusiness[] updatedBusinesses = + businessService.mutate(new ExpressBusinessOperation[] { operation }); + + Console.WriteLine("Express business with ID {0} and name '{1}' was updated.", + updatedBusinesses[0].id, updatedBusinesses[0].name); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update express business.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201309/Express/UpdatePromotion.cs b/examples/AdWords/CSharp/v201309/Express/UpdatePromotion.cs new file mode 100644 index 00000000000..2b5b0434d0e --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Express/UpdatePromotion.cs @@ -0,0 +1,100 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + + /// + /// This code example updates a promotion for an express businesses. To add + /// a promotion, run UpdatePromotion.cs. + /// + /// Tags: PromotionService.mutate + /// + public class UpdatePromotion : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a promotion for an express businesses. To add a " + + "promotion, run UpdatePromotion.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdatePromotion codeExample = new UpdatePromotion(); + Console.WriteLine(codeExample.Description); + try { + long businessId = long.Parse("INSERT_ADWORDS_EXPRESS_BUSINESS_ID_HERE"); + long promotionId = long.Parse("INSERT_PROMOTION_ID_HERE"); + codeExample.Run(new AdWordsUser(), businessId, promotionId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The AdWords Express business id. + /// The promotion id. + public void Run(AdWordsUser user, long businessId, long promotionId) { + // Get the ExpressBusinessService. + ExpressBusinessService businessService = (ExpressBusinessService) + user.GetService(AdWordsService.v201309.ExpressBusinessService); + + // Get the PromotionService + PromotionService promotionService = (PromotionService) + user.GetService(AdWordsService.v201309.PromotionService); + + // Set the business ID to the service. + promotionService.RequestHeader.expressBusinessId = businessId; + + // Update the budget for the promotion + Promotion promotion = new Promotion(); + promotion.id = promotionId; + Money newBudget = new Money(); + newBudget.microAmount = 2000000; + promotion.budget = newBudget; + + PromotionOperation operation = new PromotionOperation(); + operation.@operator = Operator.SET; + operation.operand = promotion; + + try { + Promotion[] updatedPromotions = promotionService.mutate( + new PromotionOperation[] { operation }); + + Console.WriteLine("Promotion ID {0} for business ID {1} now has budget micro " + + "amount {2}.", promotionId, businessId, + updatedPromotions[0].budget.microAmount); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update promotions.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201309/Miscellaneous/GetAllVideosAndImages.cs b/examples/AdWords/CSharp/v201309/Miscellaneous/GetAllVideosAndImages.cs new file mode 100644 index 00000000000..06207c369e4 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Miscellaneous/GetAllVideosAndImages.cs @@ -0,0 +1,139 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example gets all videos and images. To upload video, see + /// http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. + /// To upload image, run UploadImage.cs. + /// + /// Tags: MediaService.get + /// + public class GetAllVideosAndImages : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAllVideosAndImages codeExample = new GetAllVideosAndImages(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all videos and images. To upload video, see " + + "http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. To " + + "upload image, run UploadImage.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the MediaService. + MediaService mediaService = (MediaService) user.GetService( + AdWordsService.v201309.MediaService); + + // Create a selector. + Selector selector = new Selector(); + selector.fields = new string[] {"MediaId", "Width", "Height", "MimeType"}; + + // Set the filter. + Predicate predicate = new Predicate(); + predicate.@operator = PredicateOperator.IN; + predicate.field = "Type"; + predicate.values = new string[] {MediaMediaType.VIDEO.ToString(), + MediaMediaType.IMAGE.ToString()}; + + selector.predicates = new Predicate[] {predicate}; + + // Set selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + MediaPage page = new MediaPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + page = mediaService.get(selector); + + if (page != null && page.entries != null) { + int i = offset; + + foreach (Media media in page.entries) { + if (media is Video) { + Video video = (Video) media; + Console.WriteLine("{0}) Video with id \"{1}\" and name \"{2}\" was found.", + i, video.mediaId, video.name); + } else if (media is Image) { + Image image = (Image) media; + Dictionary dimensions = + CreateMediaDimensionMap(image.dimensions); + Console.WriteLine("{0}) Image with id '{1}', dimensions '{2}x{3}', and MIME type " + + "'{4}' was found.", i, image.mediaId, dimensions[MediaSize.FULL].width, + dimensions[MediaSize.FULL].height, image.mimeType); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of images and videos found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get images and videos.", ex); + } + } + + /// + /// Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + /// + /// The array of Media_Size_DimensionsMapEntry to be + /// converted into a dictionary. + /// A dictionary with key as MediaSize, and value as Dimensions. + /// + private Dictionary CreateMediaDimensionMap( + Media_Size_DimensionsMapEntry[] dimensions) { + Dictionary mediaMap = new Dictionary(); + foreach (Media_Size_DimensionsMapEntry dimension in dimensions) { + mediaMap.Add(dimension.key, dimension.value); + } + return mediaMap; + } + } +} diff --git a/examples/AdWords/CSharp/v201309/Miscellaneous/UploadImage.cs b/examples/AdWords/CSharp/v201309/Miscellaneous/UploadImage.cs new file mode 100644 index 00000000000..b44ac5e2189 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Miscellaneous/UploadImage.cs @@ -0,0 +1,106 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example uploads an image. To get images, run GetAllVideosAndImages.cs. + /// + /// Tags: MediaService.upload + /// + public class UploadImage : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UploadImage codeExample = new UploadImage(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example uploads an image. To get images, run GetAllVideosAndImages.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the MediaService. + MediaService mediaService = (MediaService) user.GetService( + AdWordsService.v201309.MediaService); + + // Create the image. + Image image = new Image(); + image.data = MediaUtilities.GetAssetDataFromUrl("http://goo.gl/HJM3L"); + image.type = MediaMediaType.IMAGE; + + try { + // Upload the image. + Media[] result = mediaService.upload(new Media[] {image}); + + // Display the results. + if (result != null && result.Length > 0) { + Media newImage = result[0]; + Dictionary dimensions = + CreateMediaDimensionMap(newImage.dimensions); + Console.WriteLine("Image with id '{0}', dimensions '{1}x{2}', and MIME type '{3}'" + + " was uploaded.", newImage.mediaId, dimensions[MediaSize.FULL].width, + dimensions[MediaSize.FULL].height, newImage.mimeType); + } else { + Console.WriteLine("No images were uploaded."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to upload image.", ex); + } + } + + /// + /// Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + /// + /// The array of Media_Size_DimensionsMapEntry to be + /// converted into a dictionary. + /// A dictionary with key as MediaSize, and value as Dimensions. + /// + private Dictionary CreateMediaDimensionMap( + Media_Size_DimensionsMapEntry[] dimensions) { + Dictionary mediaMap = new Dictionary(); + foreach (Media_Size_DimensionsMapEntry dimension in dimensions) { + mediaMap.Add(dimension.key, dimension.value); + } + return mediaMap; + } + } +} diff --git a/examples/AdWords/CSharp/v201309/Optimization/EstimateKeywordTraffic.cs b/examples/AdWords/CSharp/v201309/Optimization/EstimateKeywordTraffic.cs new file mode 100644 index 00000000000..14cba2c2282 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Optimization/EstimateKeywordTraffic.cs @@ -0,0 +1,173 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example gets keyword traffic estimates. + /// + /// Tags: TrafficEstimatorService.get + /// + public class EstimateKeywordTraffic : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + EstimateKeywordTraffic codeExample = new EstimateKeywordTraffic(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets keyword traffic estimates."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the TrafficEstimatorService. + TrafficEstimatorService trafficEstimatorService = (TrafficEstimatorService) user.GetService( + AdWordsService.v201309.TrafficEstimatorService); + + // Create keywords. Up to 2000 keywords can be passed in a single request. + Keyword keyword1 = new Keyword(); + keyword1.text = "mars cruise"; + keyword1.matchType = KeywordMatchType.BROAD; + + Keyword keyword2 = new Keyword(); + keyword2.text = "cheap cruise"; + keyword2.matchType = KeywordMatchType.PHRASE; + + Keyword keyword3 = new Keyword(); + keyword3.text = "cruise"; + keyword3.matchType = KeywordMatchType.EXACT; + + Keyword[] keywords = new Keyword[] {keyword1, keyword2, keyword3}; + + // Create a keyword estimate request for each keyword. + List keywordEstimateRequests = new List(); + + foreach (Keyword keyword in keywords) { + KeywordEstimateRequest keywordEstimateRequest = new KeywordEstimateRequest(); + keywordEstimateRequest.keyword = keyword; + keywordEstimateRequests.Add(keywordEstimateRequest); + } + + // Create negative keywords. + Keyword negativeKeyword1 = new Keyword(); + negativeKeyword1.text = "moon walk"; + negativeKeyword1.matchType = KeywordMatchType.BROAD; + + KeywordEstimateRequest negativeKeywordEstimateRequest = new KeywordEstimateRequest(); + negativeKeywordEstimateRequest.keyword = negativeKeyword1; + negativeKeywordEstimateRequest.isNegative = true; + keywordEstimateRequests.Add(negativeKeywordEstimateRequest); + + // Create ad group estimate requests. + AdGroupEstimateRequest adGroupEstimateRequest = new AdGroupEstimateRequest(); + adGroupEstimateRequest.keywordEstimateRequests = keywordEstimateRequests.ToArray(); + adGroupEstimateRequest.maxCpc = new Money(); + adGroupEstimateRequest.maxCpc.microAmount = 1000000; + + // Create campaign estimate requests. + CampaignEstimateRequest campaignEstimateRequest = new CampaignEstimateRequest(); + campaignEstimateRequest.adGroupEstimateRequests = new AdGroupEstimateRequest[] { + adGroupEstimateRequest}; + + // See http://code.google.com/apis/adwords/docs/appendix/countrycodes.html + // for a detailed list of country codes. + Location countryCriterion = new Location(); + countryCriterion.id = 2840; //US + + // See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + // for a detailed list of language codes. + Language languageCriterion = new Language(); + languageCriterion.id = 1000; //en + + campaignEstimateRequest.criteria = new Criterion[] {countryCriterion, languageCriterion}; + + // Create the selector. + TrafficEstimatorSelector selector = new TrafficEstimatorSelector(); + selector.campaignEstimateRequests = new CampaignEstimateRequest[] {campaignEstimateRequest}; + + try { + // Get traffic estimates. + TrafficEstimatorResult result = trafficEstimatorService.get(selector); + + // Display traffic estimates. + if (result != null && result.campaignEstimates != null && + result.campaignEstimates.Length > 0) { + CampaignEstimate campaignEstimate = result.campaignEstimates[0]; + if (campaignEstimate.adGroupEstimates != null && + campaignEstimate.adGroupEstimates.Length > 0) { + AdGroupEstimate adGroupEstimate = campaignEstimate.adGroupEstimates[0]; + + if (adGroupEstimate.keywordEstimates != null) { + for (int i = 0; i < adGroupEstimate.keywordEstimates.Length; i++) { + Keyword keyword = keywordEstimateRequests[i].keyword; + KeywordEstimate keywordEstimate = adGroupEstimate.keywordEstimates[i]; + + if (keywordEstimateRequests[i].isNegative) { + continue; + } + + // Find the mean of the min and max values. + long meanAverageCpc = (keywordEstimate.min.averageCpc.microAmount + + keywordEstimate.max.averageCpc.microAmount) / 2; + double meanAveragePosition = (keywordEstimate.min.averagePosition + + keywordEstimate.max.averagePosition) / 2; + float meanClicks = (keywordEstimate.min.clicksPerDay + + keywordEstimate.max.clicksPerDay) / 2; + long meanTotalCost = (keywordEstimate.min.totalCost.microAmount + + keywordEstimate.max.totalCost.microAmount) / 2; + + Console.WriteLine("Results for the keyword with text = '{0}' and match type = " + + "'{1}':", keyword.text, keyword.matchType); + Console.WriteLine(" Estimated average CPC: {0}", meanAverageCpc); + Console.WriteLine(" Estimated ad position: {0:0.00}", meanAveragePosition); + Console.WriteLine(" Estimated daily clicks: {0}", meanClicks); + Console.WriteLine(" Estimated daily cost: {0}", meanTotalCost); + } + } + } + } else { + Console.WriteLine("No traffic estimates were returned.\n"); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve traffic estimates.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/Optimization/GetAdGroupBidSimulations.cs b/examples/AdWords/CSharp/v201309/Optimization/GetAdGroupBidSimulations.cs new file mode 100644 index 00000000000..beea298d33a --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Optimization/GetAdGroupBidSimulations.cs @@ -0,0 +1,105 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example gets bid landscapes for an ad group. To get ad groups, + /// run GetAdGroups.cs. + /// + /// Tags: DataService.getAdGroupBidLandscape + /// + public class GetAdGroupBidSimulations : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAdGroupBidSimulations codeExample = new GetAdGroupBidSimulations(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets bid landscapes for an ad group. To get ad groups, run " + + "GetAdGroups.cs"; + } + } + + /// + /// Runs the specified user. + /// + /// The user. + /// Id of the ad group for which bid simulations are + /// retrieved. + public void Run(AdWordsUser user, long adGroupId) { + // Get the DataService. + DataService dataService = (DataService) user.GetService(AdWordsService.v201309.DataService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"AdGroupId", "LandscapeType", "LandscapeCurrent", "StartDate", + "EndDate", "Bid", "LocalClicks", "LocalCost", "MarginalCpc", "LocalImpressions"}; + + // Set the filters. + Predicate adGroupPredicate = new Predicate(); + adGroupPredicate.field = "AdGroupId"; + adGroupPredicate.@operator = PredicateOperator.IN; + adGroupPredicate.values = new string[] {adGroupId.ToString()}; + + selector.predicates = new Predicate[] {adGroupPredicate}; + + try { + // Get bid landscape for ad group. + AdGroupBidLandscapePage page = dataService.getAdGroupBidLandscape(selector); + if (page != null && page.entries != null && page.entries.Length > 0) { + foreach (AdGroupBidLandscape bidLandscape in page.entries) { + Console.WriteLine("Found ad group bid landscape with ad group id '{0}', type '{1}', " + + "current: '{2}', start date '{3}', end date '{4}', and landscape points", + bidLandscape.adGroupId, bidLandscape.type, bidLandscape.landscapeCurrent, + bidLandscape.startDate, bidLandscape.endDate); + foreach (BidLandscapeLandscapePoint point in bidLandscape.landscapePoints) { + Console.WriteLine("- bid: {0} => clicks: {1}, cost: {2}, marginalCpc: {3}, " + + "impressions: {4}", point.bid.microAmount, point.bid.microAmount, + point.clicks, point.cost.microAmount, point.marginalCpc.microAmount, + point.impressions); + } + } + } else { + Console.WriteLine("No ad group bid landscapes were found."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get ad group bid landscapes.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/Optimization/GetKeywordBidSimulations.cs b/examples/AdWords/CSharp/v201309/Optimization/GetKeywordBidSimulations.cs new file mode 100644 index 00000000000..8399c00ab1a --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Optimization/GetKeywordBidSimulations.cs @@ -0,0 +1,133 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example gets a bid landscape for an ad group and a keyword. + /// To get ad groups, run GetAdGroups.cs. To get keywords, run + /// GetKeywords.cs. + /// + /// Tags: DataService.getCriterionBidLandscape + /// + public class GetKeywordBidSimulations : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetKeywordBidSimulations codeExample = new GetKeywordBidSimulations(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long keywordId = long.Parse("INSERT_KEYWORD_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, keywordId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a bid landscape for an ad group and a keyword. " + + "To get ad groups, run GetAdGroups.cs. To get keywords, run GetKeywords.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group for which keyword bid + /// simulations are retrieved. + /// Id of the keyword for which bid simulations are + /// retrieved. + public void Run(AdWordsUser user, long adGroupId, long keywordId) { + // Get the DataService. + DataService dataService = (DataService) user.GetService(AdWordsService.v201309.DataService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"AdGroupId", "CriterionId", "StartDate", "EndDate", "Bid", + "LocalClicks", "LocalCost", "MarginalCpc", "LocalImpressions"}; + + // Create the filters. + Predicate adGroupPredicate = new Predicate(); + adGroupPredicate.field = "AdGroupId"; + adGroupPredicate.@operator = PredicateOperator.IN; + adGroupPredicate.values = new string[] {adGroupId.ToString()}; + + Predicate keywordPredicate = new Predicate(); + keywordPredicate.field = "CriterionId"; + keywordPredicate.@operator = PredicateOperator.IN; + keywordPredicate.values = new string[] {keywordId.ToString()}; + + selector.predicates = new Predicate[] {adGroupPredicate, keywordPredicate}; + + // Set selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + CriterionBidLandscapePage page = new CriterionBidLandscapePage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get bid landscape for keywords. + page = dataService.getCriterionBidLandscape(selector); + + // Display bid landscapes. + if (page != null && page.entries != null) { + int i = offset; + + foreach (CriterionBidLandscape bidLandscape in page.entries) { + Console.WriteLine("{0}) Found criterion bid landscape with ad group id '{1}', " + + "keyword id '{2}', start date '{3}', end date '{4}', and landscape points:", + i, bidLandscape.adGroupId, bidLandscape.criterionId, bidLandscape.startDate, + bidLandscape.endDate); + foreach (BidLandscapeLandscapePoint bidLandscapePoint in + bidLandscape.landscapePoints) { + Console.WriteLine("- bid: {0} => clicks: {1}, cost: {2}, marginalCpc: {3}, " + + "impressions: {4}\n", bidLandscapePoint.bid.microAmount, + bidLandscapePoint.clicks, bidLandscapePoint.cost.microAmount, + bidLandscapePoint.marginalCpc.microAmount, bidLandscapePoint.impressions); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of keyword bid landscapes found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve keyword bid landscapes.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/Optimization/GetKeywordIdeas.cs b/examples/AdWords/CSharp/v201309/Optimization/GetKeywordIdeas.cs new file mode 100644 index 00000000000..fe8e2e421e2 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Optimization/GetKeywordIdeas.cs @@ -0,0 +1,150 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example retrieves keywords that are related to a given keyword. + /// + /// Tags: TargetingIdeaService.get + /// + public class GetKeywordIdeas : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetKeywordIdeas codeExample = new GetKeywordIdeas(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves keywords that are related to a given keyword."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the TargetingIdeaService. + TargetingIdeaService targetingIdeaService = + (TargetingIdeaService) user.GetService(AdWordsService.v201309.TargetingIdeaService); + + string keywordText = "mars cruise"; + + // Create selector. + TargetingIdeaSelector selector = new TargetingIdeaSelector(); + selector.requestType = RequestType.IDEAS; + selector.ideaType = IdeaType.KEYWORD; + selector.requestedAttributeTypes = new AttributeType[] { + AttributeType.KEYWORD_TEXT, + AttributeType.SEARCH_VOLUME, + AttributeType.CATEGORY_PRODUCTS_AND_SERVICES}; + + // Language setting (optional). + // The ID can be found in the documentation: + // https://developers.google.com/adwords/api/docs/appendix/languagecodes + // Note: As of v201302, only a single language parameter is allowed. + LanguageSearchParameter languageParameter = new LanguageSearchParameter(); + Language english = new Language(); + english.id = 1000; + languageParameter.languages = new Language[] {english}; + + // Create related to query search parameter. + RelatedToQuerySearchParameter relatedToQuerySearchParameter = + new RelatedToQuerySearchParameter(); + relatedToQuerySearchParameter.queries = new String[] {keywordText}; + selector.searchParameters = + new SearchParameter[] {relatedToQuerySearchParameter, languageParameter}; + + // Set selector paging (required for targeting idea service). + Paging paging = new Paging(); + paging.startIndex = 0; + paging.numberResults = 500; + selector.paging = paging; + + int offset = 0; + int pageSize = 500; + + TargetingIdeaPage page = new TargetingIdeaPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + // Get related keywords. + page = targetingIdeaService.get(selector); + + // Display related keywords. + if (page.entries != null && page.entries.Length > 0) { + int i = offset; + foreach (TargetingIdea targetingIdea in page.entries) { + string keyword = null; + string categories = null; + long averageMonthlySearches = 0; + + foreach (Type_AttributeMapEntry entry in targetingIdea.data) { + if (entry.key == AttributeType.KEYWORD_TEXT) { + keyword = (entry.value as StringAttribute).value; + } + if (entry.key == AttributeType.CATEGORY_PRODUCTS_AND_SERVICES) { + IntegerSetAttribute categorySet = entry.value as IntegerSetAttribute; + StringBuilder builder = new StringBuilder(); + if (categorySet.value != null) { + foreach (int value in categorySet.value) { + builder.AppendFormat("{0}, ", value); + } + categories = builder.ToString().Trim(new char[] {',', ' '}); + } + } + if (entry.key == AttributeType.SEARCH_VOLUME) { + averageMonthlySearches = (entry.value as LongAttribute).value; + } + } + Console.WriteLine("Keyword with text '{0}', and average monthly search volume " + + "'{1}' was found with categories: {2}", keyword, averageMonthlySearches, + categories); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of related keywords found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve related keywords.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/Optimization/GetPlacementIdeas.cs b/examples/AdWords/CSharp/v201309/Optimization/GetPlacementIdeas.cs new file mode 100644 index 00000000000..7b0462b0c67 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Optimization/GetPlacementIdeas.cs @@ -0,0 +1,122 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example retrieves urls that have content keywords related to a + /// given website. + /// + /// Tags: TargetingIdeaService.get + /// + public class GetPlacementIdeas : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetPlacementIdeas codeExample = new GetPlacementIdeas(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves urls that have content keywords related to a" + + " given website."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the TargetingIdeaService. + TargetingIdeaService targetingIdeaService = + (TargetingIdeaService) user.GetService(AdWordsService.v201309.TargetingIdeaService); + + // Create seed url. + string url = "mars.google.com"; + + // Create the selector. + TargetingIdeaSelector selector = new TargetingIdeaSelector(); + selector.requestType = RequestType.IDEAS; + selector.ideaType = IdeaType.PLACEMENT; + selector.requestedAttributeTypes = new AttributeType[] {AttributeType.CRITERION, + AttributeType.PLACEMENT_TYPE}; + + // Create related to url search parameter. + RelatedToUrlSearchParameter relatedToUrlSearchParameter = new RelatedToUrlSearchParameter(); + relatedToUrlSearchParameter.urls = new string[] {url}; + relatedToUrlSearchParameter.includeSubUrls = false; + selector.searchParameters = new SearchParameter[] {relatedToUrlSearchParameter}; + + // Set selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + TargetingIdeaPage page = new TargetingIdeaPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get placement ideas. + page = targetingIdeaService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + + foreach (TargetingIdea idea in page.entries) { + foreach (Type_AttributeMapEntry entry in idea.data) { + if (entry.key == AttributeType.CRITERION) { + CriterionAttribute placementAttribute = entry.value as CriterionAttribute; + Placement placement = (Placement) placementAttribute.value; + Console.WriteLine("Related placement urls were found at '{0}'.", + (placementAttribute.value as Placement).url); + } + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of related placements found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve related placements.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/Remarketing/AddAudience.cs b/examples/AdWords/CSharp/v201309/Remarketing/AddAudience.cs new file mode 100644 index 00000000000..c9a9c0ed1db --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Remarketing/AddAudience.cs @@ -0,0 +1,156 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example illustrates how to create a user list a.k.a. audience. + /// + /// Tags: UserListService.mutate + /// + public class AddAudience : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAudience codeExample = new AddAudience(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create a user list a.k.a. audience."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the UserListService. + AdwordsUserListService userListService = + (AdwordsUserListService) user.GetService(AdWordsService.v201309.AdwordsUserListService); + + // Get the ConversionTrackerService. + ConversionTrackerService conversionTrackerService = + (ConversionTrackerService)user.GetService(AdWordsService.v201309. + ConversionTrackerService); + + BasicUserList userList = new BasicUserList(); + userList.name = "Mars cruise customers #" + ExampleUtilities.GetRandomString(); + userList.description = "A list of mars cruise customers in the last year."; + userList.status = UserListMembershipStatus.OPEN; + userList.membershipLifeSpan = 365; + + UserListConversionType conversionType = new UserListConversionType(); + conversionType.name = userList.name; + userList.conversionTypes = new UserListConversionType[] {conversionType}; + + // Optional: Set the user list status. + userList.status = UserListMembershipStatus.OPEN; + + // Create the operation. + UserListOperation operation = new UserListOperation(); + operation.operand = userList; + operation.@operator = Operator.ADD; + + try { + // Add the user list. + UserListReturnValue retval = userListService.mutate(new UserListOperation[] {operation}); + + UserList[] userLists = null; + if (retval != null && retval.value != null) { + userLists = retval.value; + // Get all conversion snippets + List conversionIds = new List(); + foreach (BasicUserList newUserList in userLists) { + if (newUserList.conversionTypes != null) { + foreach (UserListConversionType newConversionType in newUserList.conversionTypes) { + conversionIds.Add(newConversionType.id.ToString()); + } + } + } + + Dictionary conversionsMap = + new Dictionary(); + + if (conversionIds.Count > 0) { + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id"}; + + Predicate conversionTypePredicate = new Predicate(); + conversionTypePredicate.field = "Id"; + conversionTypePredicate.@operator = PredicateOperator.IN; + conversionTypePredicate.values = conversionIds.ToArray(); + selector.predicates = new Predicate[] {conversionTypePredicate}; + + // Get all conversion trackers. + ConversionTrackerPage page = conversionTrackerService.get(selector); + + if (page != null && page.entries != null) { + foreach (ConversionTracker tracker in page.entries) { + conversionsMap[tracker.id] = tracker; + } + } + } + + // Display the results. + foreach (BasicUserList newUserList in userLists) { + Console.WriteLine("User list with name '{0}' and id '{1}' was added.", + newUserList.name, newUserList.id); + + // Display user list associated conversion code snippets. + if (newUserList.conversionTypes != null) { + foreach (UserListConversionType userListConversionType in + newUserList.conversionTypes) { + if (conversionsMap.ContainsKey(userListConversionType.id)) { + AdWordsConversionTracker conversionTracker = + (AdWordsConversionTracker) conversionsMap[userListConversionType.id]; + Console.WriteLine("Conversion type code snippet associated to the list:\n{0}\n", + conversionTracker.snippet); + } else { + throw new Exception("Failed to associate conversion type code snippet."); + } + } + } + } + } else { + Console.WriteLine("No user lists (a.k.a. audiences) were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add user lists (a.k.a. audiences).", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/Remarketing/AddConversionTracker.cs b/examples/AdWords/CSharp/v201309/Remarketing/AddConversionTracker.cs new file mode 100644 index 00000000000..ae939e71b0d --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Remarketing/AddConversionTracker.cs @@ -0,0 +1,106 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example adds an AdWords conversion tracker. + /// + /// Tags: ConversionTrackerService.mutate + /// + public class AddConversionTracker : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddConversionTracker codeExample = new AddConversionTracker(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds an AdWords conversion tracker."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ConversionTrackerService. + ConversionTrackerService conversionTrackerService = + (ConversionTrackerService)user.GetService(AdWordsService.v201309. + ConversionTrackerService); + + // Create Adwords conversion tracker. + AdWordsConversionTracker conversionTracker = new AdWordsConversionTracker(); + conversionTracker.name = "Earth to Mars Cruises Conversion #" + + ExampleUtilities.GetRandomString(); + conversionTracker.category = ConversionTrackerCategory.DEFAULT; + conversionTracker.markupLanguage = AdWordsConversionTrackerMarkupLanguage.HTML; + conversionTracker.textFormat = AdWordsConversionTrackerTextFormat.HIDDEN; + + // Set optional fields. + conversionTracker.status = ConversionTrackerStatus.ENABLED; + conversionTracker.viewthroughLookbackWindow = 15; + conversionTracker.isProductAdsChargeable = true; + conversionTracker.productAdsChargeableConversionWindow = 15; + conversionTracker.conversionPageLanguage = "en"; + conversionTracker.backgroundColor = "#0000FF"; + conversionTracker.userRevenueValue = "someJavascriptVariable"; + + // Create the operation. + ConversionTrackerOperation operation = new ConversionTrackerOperation(); + operation.@operator = Operator.ADD; + operation.operand = conversionTracker; + + try { + // Add conversion tracker. + ConversionTrackerReturnValue retval = conversionTrackerService.mutate( + new ConversionTrackerOperation[] {operation}); + + // Display the results. + if (retval != null && retval.value != null && retval.value.Length > 0) { + ConversionTracker newConversionTracker = retval.value[0]; + Console.WriteLine("Conversion tracker with id '{0}', name '{1}', status '{2}', " + + "category '{3}' was added.", newConversionTracker.id, newConversionTracker.name, + newConversionTracker.status, newConversionTracker.category); + } else { + Console.WriteLine("No conversion trackers were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add conversion tracker.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/Reporting/DownloadCriteriaReport.cs b/examples/AdWords/CSharp/v201309/Reporting/DownloadCriteriaReport.cs new file mode 100644 index 00000000000..ab5c7dbe9fa --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Reporting/DownloadCriteriaReport.cs @@ -0,0 +1,114 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util.Reports; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example gets and downloads a criteria Ad Hoc report from an XML + /// report definition. + /// + public class DownloadCriteriaReport : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DownloadCriteriaReport codeExample = new DownloadCriteriaReport(); + Console.WriteLine(codeExample.Description); + try { + string fileName = "INSERT_FILE_NAME_HERE"; + codeExample.Run(new AdWordsUser(), fileName); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets and downloads a criteria Ad Hoc report from an XML report " + + "definition."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The file to which the report is downloaded. + /// + public void Run(AdWordsUser user, string fileName) { + ReportDefinition definition = new ReportDefinition(); + + definition.reportName = "Last 7 days CRITERIA_PERFORMANCE_REPORT"; + definition.reportType = ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT; + definition.downloadFormat = DownloadFormat.GZIPPED_CSV; + definition.dateRangeType = ReportDefinitionDateRangeType.LAST_7_DAYS; + + // Create selector. + Selector selector = new Selector(); + selector.fields = new string[] {"CampaignId", "AdGroupId", "Id", "CriteriaType", "Criteria", + "CriteriaDestinationUrl", "Clicks", "Impressions", "Cost"}; + + Predicate predicate = new Predicate(); + predicate.field = "Status"; + predicate.@operator = PredicateOperator.IN; + predicate.values = new string[] {"ACTIVE", "PAUSED"}; + selector.predicates = new Predicate[] {predicate}; + + definition.selector = selector; + definition.includeZeroImpressions = true; + + string filePath = ExampleUtilities.GetHomeDir() + Path.DirectorySeparatorChar + fileName; + + try { + // If you know that your report is small enough to fit in memory, then + // you can instead use + // ReportUtilities utilities = new ReportUtilities(user); + // utilities.ReportVersion = "v201309"; + // ClientReport report = utilities.GetClientReport(definition); + // + // // Get the text report directly if you requested a text format + // // (e.g. xml) + // string reportText = report.Text; + // + // // Get the binary report if you requested a binary format + // // (e.g. gzip) + // byte[] reportBytes = report.Contents; + // + // // Deflate a zipped binary report for further processing. + // string deflatedReportText = Encoding.UTF8.GetString( + // MediaUtilities.DeflateGZipData(report.Contents)); + ReportUtilities utilities = new ReportUtilities(user); + utilities.ReportVersion = "v201309"; + utilities.DownloadClientReport(definition, filePath); + Console.WriteLine("Report was downloaded to '{0}'.", filePath); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to download report.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/Reporting/DownloadCriteriaReportWithAwql.cs b/examples/AdWords/CSharp/v201309/Reporting/DownloadCriteriaReportWithAwql.cs new file mode 100644 index 00000000000..1bb76a0ebe0 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Reporting/DownloadCriteriaReportWithAwql.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util.Reports; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example gets and downloads a criteria Ad Hoc report from an AWQL + /// query. See https://developers.google.com/adwords/api/docs/guides/awql for + /// AWQL documentation. + /// + public class DownloadCriteriaReportWithAwql : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DownloadCriteriaReportWithAwql codeExample = new DownloadCriteriaReportWithAwql(); + Console.WriteLine(codeExample.Description); + try { + string fileName = "INSERT_FILE_NAME_HERE"; + codeExample.Run(new AdWordsUser(), fileName); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets and downloads a criteria Ad Hoc report from an AWQL " + + "query. See https://developers.google.com/adwords/api/docs/guides/awql for AWQL " + + "documentation."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The file to which the report is downloaded. + /// + public void Run(AdWordsUser user, string fileName) { + string query = "SELECT CampaignId, AdGroupId, Id, Criteria, CriteriaType, Impressions, " + + "Clicks, Cost FROM CRITERIA_PERFORMANCE_REPORT WHERE Status IN [ACTIVE, PAUSED] " + + "DURING LAST_7_DAYS"; + + string filePath = ExampleUtilities.GetHomeDir() + Path.DirectorySeparatorChar + fileName; + + try { + // If you know that your report is small enough to fit in memory, then + // you can instead use + // ReportUtilities utilities = new ReportUtilities(user); + // utilities.ReportVersion = "v201309"; + // ClientReport report = utilities.GetClientReport(query, format); + // + // // Get the text report directly if you requested a text format + // // (e.g. xml) + // string reportText = report.Text; + // + // // Get the binary report if you requested a binary format + // // (e.g. gzip) + // byte[] reportBytes = report.Contents; + // + // // Deflate a zipped binary report for further processing. + // string deflatedReportText = Encoding.UTF8.GetString( + // MediaUtilities.DeflateGZipData(report.Contents)); + ReportUtilities utilities = new ReportUtilities(user); + utilities.ReportVersion = "v201309"; + utilities.DownloadClientReport(query, DownloadFormat.GZIPPED_CSV.ToString(), filePath); + Console.WriteLine("Report was downloaded to '{0}'.", filePath); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to download report.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/Reporting/GetReportFields.cs b/examples/AdWords/CSharp/v201309/Reporting/GetReportFields.cs new file mode 100644 index 00000000000..9cb43bdbe4f --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Reporting/GetReportFields.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example gets report fields. + /// + /// Tags: ReportDefinitionService.getReportFields + /// + public class GetReportFields : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetReportFields codeExample = new GetReportFields(); + Console.WriteLine(codeExample.Description); + try { + ReportDefinitionReportType reportType = (ReportDefinitionReportType) Enum.Parse( + typeof(ReportDefinitionReportType), "INSERT_REPORT_TYPE_HERE"); + codeExample.Run(new AdWordsUser(), reportType); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets report fields."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The report type to be run. + public void Run(AdWordsUser user, ReportDefinitionReportType reportType) { + // Get the ReportDefinitionService. + ReportDefinitionService reportDefinitionService = (ReportDefinitionService) user.GetService( + AdWordsService.v201309.ReportDefinitionService); + + try { + // Get the report fields. + ReportDefinitionField[] reportDefinitionFields = reportDefinitionService.getReportFields( + reportType); + if (reportDefinitionFields != null && reportDefinitionFields.Length > 0) { + // Display report fields. + Console.WriteLine("The report type '{0}' contains the following fields:", reportType); + + foreach (ReportDefinitionField reportDefinitionField in reportDefinitionFields) { + Console.Write("- {0} ({1})", reportDefinitionField.fieldName, + reportDefinitionField.fieldType); + if (reportDefinitionField.enumValues != null) { + Console.Write(" := [{0}]", String.Join(", ", reportDefinitionField.enumValues)); + } + Console.WriteLine(); + } + } else { + Console.WriteLine("This report type has no fields."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve fields for report type.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/Targeting/AddCampaignTargetingCriteria.cs b/examples/AdWords/CSharp/v201309/Targeting/AddCampaignTargetingCriteria.cs new file mode 100644 index 00000000000..7abd7d18d28 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Targeting/AddCampaignTargetingCriteria.cs @@ -0,0 +1,138 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example adds various types of targeting criteria to a campaign. + /// To get a list of campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignCriterionService.mutate + /// + public class AddCampaignTargetingCriteria : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddCampaignTargetingCriteria codeExample = new AddCampaignTargetingCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds various types of targeting criteria to a campaign. To " + + "get a list of campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to which targeting criteria + /// are added. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201309.CampaignCriterionService); + + // Create language criteria. + // See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + // for a detailed list of language codes. + Language language1 = new Language(); + language1.id = 1002; // French + CampaignCriterion languageCriterion1 = new CampaignCriterion(); + languageCriterion1.campaignId = campaignId; + languageCriterion1.criterion = language1; + + Language language2 = new Language(); + language2.id = 1005; // Japanese + CampaignCriterion languageCriterion2 = new CampaignCriterion(); + languageCriterion2.campaignId = campaignId; + languageCriterion2.criterion = language2; + + // Create location criteria. + // See http://code.google.com/apis/adwords/docs/appendix/countrycodes.html + // for a detailed list of country codes. + Location location1 = new Location(); + location1.id = 2840; // USA + CampaignCriterion locationCriterion1 = new CampaignCriterion(); + locationCriterion1.campaignId = campaignId; + locationCriterion1.criterion = location1; + + Location location2 = new Location(); + location2.id = 2392; // Japan + CampaignCriterion locationCriterion2 = new CampaignCriterion(); + locationCriterion2.campaignId = campaignId; + locationCriterion2.criterion = location2; + + // Add a negative campaign keyword. + NegativeCampaignCriterion negativeCriterion = new NegativeCampaignCriterion(); + negativeCriterion.campaignId = campaignId; + + Keyword keyword = new Keyword(); + keyword.matchType = KeywordMatchType.BROAD; + keyword.text = "jupiter cruise"; + + negativeCriterion.criterion = keyword; + + CampaignCriterion[] criteria = new CampaignCriterion[] {languageCriterion1, + languageCriterion2, locationCriterion1, locationCriterion2, negativeCriterion}; + + List operations = new List(); + + foreach (CampaignCriterion criterion in criteria) { + CampaignCriterionOperation operation = new CampaignCriterionOperation(); + operation.@operator = Operator.ADD; + operation.operand = criterion; + operations.Add(operation); + } + + try { + // Set the campaign targets. + CampaignCriterionReturnValue retVal = campaignCriterionService.mutate(operations.ToArray()); + + if (retVal != null && retVal.value != null) { + // Display campaign targets. + foreach (CampaignCriterion criterion in retVal.value) { + Console.WriteLine("Campaign criteria of type '{0}' was set to campaign with" + + " id = '{1}'.", criterion.criterion.CriterionType, criterion.campaignId); + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to set Campaign criteria.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/Targeting/GetCampaignTargetingCriteria.cs b/examples/AdWords/CSharp/v201309/Targeting/GetCampaignTargetingCriteria.cs new file mode 100644 index 00000000000..35354b997c3 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Targeting/GetCampaignTargetingCriteria.cs @@ -0,0 +1,119 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example gets all targeting criteria for a campaign. To set + /// campaign targeting criteria, run AddCampaignTargetingCriteria.cs. To get + /// campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignCriterionService.get + /// + public class GetCampaignTargetingCriteria : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetCampaignTargetingCriteria codeExample = new GetCampaignTargetingCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all targeting criteria for a campaign. To set campaign " + + "targeting criteria, run AddCampaignTargetingCriteria.cs. To get campaigns, run " + + "GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign from which targeting + /// criteria are retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201309.CampaignCriterionService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "CriteriaType", "CampaignId"}; + + // Set the filters. + Predicate predicate = new Predicate(); + predicate.field = "CampaignId"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] {campaignId.ToString()}; + + selector.predicates = new Predicate[] {predicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + CampaignCriterionPage page = new CampaignCriterionPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get all campaign targets. + page = campaignCriterionService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (CampaignCriterion campaignCriterion in page.entries) { + string negative = (campaignCriterion is NegativeCampaignCriterion) ? "Negative " : ""; + Console.WriteLine("{0}) {1}Campaign criterion with id = '{2}' and Type = {3} was " + + " found for campaign id '{4}'", i, negative, campaignCriterion.criterion.id, + campaignCriterion.criterion.type, campaignCriterion.campaignId); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of campaign targeting criteria found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get campaign targeting criteria.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/Targeting/GetTargetableLanguagesAndCarriers.cs b/examples/AdWords/CSharp/v201309/Targeting/GetTargetableLanguagesAndCarriers.cs new file mode 100644 index 00000000000..f384f9bc0ac --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Targeting/GetTargetableLanguagesAndCarriers.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example illustrates how to retrieve all carriers and languages + /// available for targeting. + /// + /// Tags: ConstantDataService.getCarrierCriterion + /// Tags: ConstantDataService.getLanguageCriterion + /// + public class GetTargetableLanguagesAndCarriers : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetTargetableLanguagesAndCarriers codeExample = new GetTargetableLanguagesAndCarriers(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve all carriers and languages " + + "available for targeting."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ConstantDataService. + ConstantDataService constantDataService = (ConstantDataService) user.GetService( + AdWordsService.v201309.ConstantDataService); + + try { + // Get all carriers. + Carrier[] carriers = constantDataService.getCarrierCriterion(); + + // Display the results. + if (carriers != null) { + foreach (Carrier carrier in carriers) { + Console.WriteLine("Carrier name is '{0}', ID is {1} and country code is '{2}'.", + carrier.name, carrier.id, carrier.countryCode); + } + } else { + Console.WriteLine("No carriers were retrieved."); + } + + // Get all languages. + Language[] languages = constantDataService.getLanguageCriterion(); + + // Display the results. + if (languages != null) { + foreach (Language language in languages) { + Console.WriteLine("Language name is '{0}', ID is {1} and code is '{2}'.", + language.name, language.id, language.code); + } + } else { + Console.WriteLine("No languages were found."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get targetable carriers and languages.", + ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201309/Targeting/LookupLocation.cs b/examples/AdWords/CSharp/v201309/Targeting/LookupLocation.cs new file mode 100644 index 00000000000..a3c320738a4 --- /dev/null +++ b/examples/AdWords/CSharp/v201309/Targeting/LookupLocation.cs @@ -0,0 +1,121 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example gets location criteria by name. + /// + /// Tags: LocationCriterionService.get + /// + public class LookupLocation : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + LookupLocation codeExample = new LookupLocation(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets location criteria by name."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the LocationCriterionService. + LocationCriterionService locationCriterionService = + (LocationCriterionService) user.GetService(AdWordsService.v201309. + LocationCriterionService); + + string[] locationNames = new string[] {"Paris", "Quebec", "Spain", "Deutschland"}; + + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "LocationName", "CanonicalName", "DisplayType", + "ParentLocations", "Reach", "TargetingStatus"}; + + // Location names must match exactly, only EQUALS and IN are supported. + Predicate predicate1 = new Predicate(); + predicate1.field = "LocationName"; + predicate1.@operator = PredicateOperator.IN; + predicate1.values = locationNames; + + // Set the locale of the returned location names. + Predicate predicate2 = new Predicate(); + predicate2.field = "Locale"; + predicate2.@operator = PredicateOperator.EQUALS; + predicate2.values = new string[] {"en"}; + + selector.predicates = new Predicate[] {predicate1, predicate2}; + + try { + // Make the get request. + LocationCriterion[] locationCriteria = locationCriterionService.get(selector); + + // Display the resulting location criteria. + foreach (LocationCriterion locationCriterion in locationCriteria) { + string parentLocations = ""; + if (locationCriterion.location != null && + locationCriterion.location.parentLocations != null) { + foreach (Location location in locationCriterion.location.parentLocations) { + parentLocations += GetLocationString(location) + ", "; + } + parentLocations.TrimEnd(',', ' '); + } else { + parentLocations = "N/A"; + } + Console.WriteLine("The search term '{0}' returned the location '{1}' of type '{2}' " + + "with parent locations '{3}', reach '{4}' and targeting status '{5}.", + locationCriterion.searchTerm, locationCriterion.location.locationName, + locationCriterion.location.displayType, parentLocations, locationCriterion.reach, + locationCriterion.location.targetingStatus); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get location criteria.", ex); + } + } + + /// + /// Gets a string representation for a location. + /// + /// The location + /// The string representation + public string GetLocationString(Location location) { + return string.Format("{0} ({1})", location.locationName, location.displayType); + } + } +} diff --git a/examples/AdWords/CSharp/v201402/AccountManagement/CreateAccount.cs b/examples/AdWords/CSharp/v201402/AccountManagement/CreateAccount.cs new file mode 100644 index 00000000000..81ca1d13535 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AccountManagement/CreateAccount.cs @@ -0,0 +1,95 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example illustrates how to create an account. Note by default, + /// this account will only be accessible via its parent MCC. + /// + /// Tags: ManagedCustomerService.mutate + /// + public class CreateAccount : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + CreateAccount codeExample = new CreateAccount(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create an account. Note by default " + + "this account will only be accessible via its parent MCC."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ManagedCustomerService. + ManagedCustomerService managedCustomerService = (ManagedCustomerService) user.GetService( + AdWordsService.v201402.ManagedCustomerService); + + // Create account. + ManagedCustomer customer = new ManagedCustomer(); + customer.name = "Customer created with ManagedCustomerService on " + + new DateTime().ToString(); + customer.currencyCode = "EUR"; + customer.dateTimeZone = "Europe/London"; + + // Create operations. + ManagedCustomerOperation operation = new ManagedCustomerOperation(); + operation.operand = customer; + operation.@operator = Operator.ADD; + try { + ManagedCustomerOperation[] operations = new ManagedCustomerOperation[] {operation}; + // Add account. + ManagedCustomerReturnValue result = managedCustomerService.mutate(operations); + + // Display accounts. + if (result.value != null && result.value.Length > 0) { + ManagedCustomer customerResult = result.value[0]; + Console.WriteLine("Account with customer ID \"{0}\" was created.", + customerResult.customerId); + } else { + Console.WriteLine("No accounts were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create accounts.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/AccountManagement/GetAccountAlerts.cs b/examples/AdWords/CSharp/v201402/AccountManagement/GetAccountAlerts.cs new file mode 100644 index 00000000000..c529ae4edab --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AccountManagement/GetAccountAlerts.cs @@ -0,0 +1,126 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example gets all alerts for all clients of an MCC account. + /// The effective user (ClientCustomerId or AuthToken) must be an MCC user + /// to get results. This code example won't work with Test Accounts. See + /// https://developers.google.com/adwords/api/docs/test-accounts + /// + /// Tags: AlertService.get + /// + public class GetAccountAlerts : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAccountAlerts codeExample = new GetAccountAlerts(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all alerts for all clients of an MCC account. The " + + "effective user (ClientCustomerId or AuthToken) must be an MCC user to get results. " + + "This code example won't work with Test Accounts. See " + + "https://developers.google.com/adwords/api/docs/test-accounts"; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the AlertService. + AlertService alertService = (AlertService) user.GetService( + AdWordsService.v201402.AlertService); + + // Create the selector. + AlertSelector selector = new AlertSelector(); + + // Create the alert query. + AlertQuery query = new AlertQuery(); + query.filterSpec = FilterSpec.ALL; + query.clientSpec = ClientSpec.ALL; + query.triggerTimeSpec = TriggerTimeSpec.ALL_TIME; + query.severities = new AlertSeverity[] {AlertSeverity.GREEN, AlertSeverity.YELLOW, + AlertSeverity.RED}; + + // Enter all possible values of AlertType to get all alerts. If you are + // interested only in specific alert types, then you may also do it as + // follows: + // query.types = new AlertType[] {AlertType.CAMPAIGN_ENDING, + // AlertType.CAMPAIGN_ENDED}; + query.types = (AlertType[]) Enum.GetValues(typeof(AlertType)); + selector.query = query; + + // Set paging for selector. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AlertPage page = new AlertPage(); + + try { + do { + // Get account alerts. + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + page = alertService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (Alert alert in page.entries) { + Console.WriteLine("{0}) Customer Id is {1:###-###-####}, Alert type is '{2}', " + + "Severity is {3}", i + 1, alert.clientCustomerId, alert.alertType, + alert.alertSeverity); + for (int j = 0; j < alert.details.Length; j++) { + Console.WriteLine(" - Triggered at {0}", alert.details[j].triggerTime); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of alerts found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve alerts.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/AccountManagement/GetAccountChanges.cs b/examples/AdWords/CSharp/v201402/AccountManagement/GetAccountChanges.cs new file mode 100644 index 00000000000..52051b76f7f --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AccountManagement/GetAccountChanges.cs @@ -0,0 +1,176 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example gets the changes in the account during the last 24 + /// hours. + /// + /// Tags: CustomerSyncService.get + /// + public class GetAccountChanges : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAccountChanges codeExample = new GetAccountChanges(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the changes in the account during the last 24 hours."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the CustomerSyncService. + CustomerSyncService customerSyncService = + (CustomerSyncService) user.GetService(AdWordsService.v201402. + CustomerSyncService); + + // The date time string should be of the form yyyyMMdd HHmmss zzz + string minDateTime = DateTime.Now.AddDays(-1).ToUniversalTime().ToString("yyyyMMdd HHmmss") + + " UTC"; + string maxDateTime = DateTime.Now.ToUniversalTime().ToString("yyyyMMdd HHmmss") + " UTC"; + + // Create date time range. + DateTimeRange dateTimeRange = new DateTimeRange(); + dateTimeRange.min = minDateTime; + dateTimeRange.max = maxDateTime; + + try { + // Create the selector. + CustomerSyncSelector selector = new CustomerSyncSelector(); + selector.dateTimeRange = dateTimeRange; + selector.campaignIds = GetAllCampaignIds(user); + + // Get all account changes for campaign. + CustomerChangeData accountChanges = customerSyncService.get(selector); + + // Display the changes. + if (accountChanges != null && accountChanges.changedCampaigns != null) { + Console.WriteLine("Displaying changes up to: {0}", accountChanges.lastChangeTimestamp); + foreach (CampaignChangeData campaignChanges in accountChanges.changedCampaigns) { + Console.WriteLine("Campaign with id \"{0}\" was changed:", campaignChanges.campaignId); + Console.WriteLine(" Campaign changed status: {0}", + campaignChanges.campaignChangeStatus); + if (campaignChanges.campaignChangeStatus != ChangeStatus.NEW) { + Console.WriteLine(" Added ad extensions: {0}", GetFormattedList( + campaignChanges.addedAdExtensions)); + Console.WriteLine(" Added campaign criteria: {0}", + GetFormattedList(campaignChanges.addedCampaignCriteria)); + Console.WriteLine(" Added campaign targeting: {0}", + campaignChanges.campaignTargetingChanged? "yes" : "no"); + Console.WriteLine(" Deleted ad extensions: {0}", + GetFormattedList(campaignChanges.deletedAdExtensions)); + Console.WriteLine(" Deleted campaign criteria: {0}", + GetFormattedList(campaignChanges.deletedCampaignCriteria)); + + if (campaignChanges.changedAdGroups != null) { + foreach (AdGroupChangeData adGroupChanges in campaignChanges.changedAdGroups) { + Console.WriteLine(" Ad group with id \"{0}\" was changed:", + adGroupChanges.adGroupId); + Console.WriteLine(" Ad group changed status: {0}", + adGroupChanges.adGroupChangeStatus); + if (adGroupChanges.adGroupChangeStatus != ChangeStatus.NEW) { + Console.WriteLine(" Ads changed: {0}", + GetFormattedList(adGroupChanges.changedAds)); + Console.WriteLine(" Criteria changed: {0}", + GetFormattedList(adGroupChanges.changedCriteria)); + Console.WriteLine(" Criteria deleted: {0}", + GetFormattedList(adGroupChanges.deletedCriteria)); + } + } + } + } + Console.WriteLine(); + } + } else { + Console.WriteLine("No account changes were found.");; + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get account changes.", ex); + } + } + + /// + /// Formats a list of ids as a comma separated string. + /// + /// The list of ids. + /// The comma separed formatted string, enclosed in square braces. + /// + private string GetFormattedList(long[] ids) { + StringBuilder builder = new StringBuilder(); + if (ids != null) { + foreach (long id in ids) { + builder.AppendFormat("{0}, ", id); + } + } + return "[" + builder.ToString().TrimEnd(',', ' ') + "]"; + } + + /// + /// Gets all campaign ids in the account. + /// + /// The user for which campaigns are retrieved. + /// The list of campaign ids. + private long[] GetAllCampaignIds(AdWordsUser user) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201402.CampaignService); + + List allCampaigns = new List(); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id"}; + + // Get all campaigns. + CampaignPage page = campaignService.get(selector); + + // Return the results. + if (page != null && page.entries != null) { + foreach (Campaign campaign in page.entries) { + allCampaigns.Add(campaign.id); + } + } + return allCampaigns.ToArray(); + } + } +} diff --git a/examples/AdWords/CSharp/v201402/AccountManagement/GetAccountHierarchy.cs b/examples/AdWords/CSharp/v201402/AccountManagement/GetAccountHierarchy.cs new file mode 100644 index 00000000000..bf3e46e19d5 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AccountManagement/GetAccountHierarchy.cs @@ -0,0 +1,196 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example illustrates how to retrieve the account hierarchy under + /// an account. This code example won't work with Test Accounts. See + /// https://developers.google.com/adwords/api/docs/test-accounts + /// + /// Tags: ManagedCustomerService.get + /// + public class GetAccountHierarchy : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAccountHierarchy codeExample = new GetAccountHierarchy(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve the account hierarchy under" + + " an account. This code example won't work with Test Accounts. See " + + "https://developers.google.com/adwords/api/docs/test-accounts"; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ManagedCustomerService. + ManagedCustomerService managedCustomerService = (ManagedCustomerService) user.GetService( + AdWordsService.v201402.ManagedCustomerService); + managedCustomerService.RequestHeader.clientCustomerId = null; + + // Create selector. + Selector selector = new Selector(); + selector.fields = new String[] {"Login", "CustomerId", "Name"}; + + try { + // Get results. + ManagedCustomerPage page = managedCustomerService.get(selector); + + // Display serviced account graph. + if (page.entries != null) { + // Create map from customerId to customer node. + Dictionary customerIdToCustomerNode = + new Dictionary(); + + // Create account tree nodes for each customer. + foreach (ManagedCustomer customer in page.entries) { + ManagedCustomerTreeNode node = new ManagedCustomerTreeNode(); + node.Account = customer; + customerIdToCustomerNode.Add(customer.customerId, node); + } + + // For each link, connect nodes in tree. + if (page.links != null) { + foreach (ManagedCustomerLink link in page.links) { + ManagedCustomerTreeNode managerNode = + customerIdToCustomerNode[link.managerCustomerId]; + ManagedCustomerTreeNode childNode = customerIdToCustomerNode[link.clientCustomerId]; + childNode.ParentNode = managerNode; + if (managerNode != null) { + managerNode.ChildAccounts.Add(childNode); + } + } + } + + // Find the root account node in the tree. + ManagedCustomerTreeNode rootNode = null; + foreach (ManagedCustomer account in page.entries) { + if (customerIdToCustomerNode[account.customerId].ParentNode == null) { + rootNode = customerIdToCustomerNode[account.customerId]; + break; + } + } + + // Display account tree. + Console.WriteLine("Login, CustomerId, Name"); + Console.WriteLine(rootNode.ToTreeString(0, new StringBuilder())); + } else { + Console.WriteLine("No serviced accounts were found."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create ad groups.", ex); + } + } + + /** + * Example implementation of a node that would exist in an account tree. + */ + class ManagedCustomerTreeNode { + /// + /// The parent node. + /// + private ManagedCustomerTreeNode parentNode; + + /// + /// The account associated with this node. + /// + private ManagedCustomer account; + + /// + /// The list of child accounts. + /// + private List childAccounts = new List(); + + /// + /// Gets or sets the parent node. + /// + public ManagedCustomerTreeNode ParentNode { + get { return parentNode; } + set { parentNode = value; } + } + + /// + /// Gets or sets the account. + /// + public ManagedCustomer Account { + get { return account; } + set { account = value; } + } + + /// + /// Gets the child accounts. + /// + public List ChildAccounts { + get { return childAccounts; } + } + + /// + /// Returns a that represents this instance. + /// + /// + /// A that represents this instance. + /// + public override String ToString() { + String login = String.IsNullOrEmpty(account.login) ? "(no login)" : account.login; + return String.Format("{0}, {1}, {2}", login, account.customerId, account.name); + } + + /// + /// Returns a string representation of the current level of the tree and + /// recursively returns the string representation of the levels below it. + /// + /// The depth of the node. + /// The String Builder containing the tree + /// representation. + /// The tree string representation. + public StringBuilder ToTreeString(int depth, StringBuilder sb) { + sb.Append(new String('-', depth * 2)); + sb.Append(this); + sb.Append("\n"); + foreach (ManagedCustomerTreeNode childAccount in childAccounts) { + childAccount.ToTreeString(depth + 1, sb); + } + return sb; + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201402/AdWordsForVideo/AddTargetingGroup.cs b/examples/AdWords/CSharp/v201402/AdWordsForVideo/AddTargetingGroup.cs new file mode 100644 index 00000000000..3c1d7e93208 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AdWordsForVideo/AddTargetingGroup.cs @@ -0,0 +1,95 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example illustrates how to create a targeting group. + /// + /// Tags: VideoTargetingGroupService.mutate + /// + /// AdWords for Video API is a Beta feature. + public class AddTargetingGroup : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create a targeting group."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddTargetingGroup codeExample = new AddTargetingGroup(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + string videoId = "INSERT_VIDEO_ID_HERE"; + codeExample.Run(new AdWordsUser(), campaignId, videoId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + /// The Youtube video ID. + public void Run(AdWordsUser user, long campaignId, string videoId) { + // Get the VideoTargetingGroupService. + VideoTargetingGroupService videoTargetingGroupService = + (VideoTargetingGroupService) user.GetService( + AdWordsService.v201402.VideoTargetingGroupService); + + TargetingGroup targetingGroup = new TargetingGroup(); + targetingGroup.campaignId = campaignId; + targetingGroup.name = "My Targeting Group " + ExampleUtilities.GetRandomString(); + + try { + TargetingGroupOperation operation = new TargetingGroupOperation(); + operation.operand = targetingGroup; + operation.@operator = Operator.ADD; + + TargetingGroupReturnValue retval = videoTargetingGroupService.mutate( + new TargetingGroupOperation[] { operation }); + + if (retval != null && retval.value != null && retval.value.Length > 0) { + TargetingGroup newTargetingGroup = retval.value[0]; + Console.WriteLine("New targeting group with id = {0}, name = {1} was created in " + + "campaign id {2}", newTargetingGroup.id, newTargetingGroup.name, + newTargetingGroup.campaignId); + } else { + Console.WriteLine("No targeting group was created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create targeting group.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201402/AdWordsForVideo/AddTargetingGroupCriteria.cs b/examples/AdWords/CSharp/v201402/AdWordsForVideo/AddTargetingGroupCriteria.cs new file mode 100644 index 00000000000..fd65314f53f --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AdWordsForVideo/AddTargetingGroupCriteria.cs @@ -0,0 +1,167 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example illustrates how to create targeting group criteria. + /// + /// Tags: VideoTargetingGroupCriterionService.mutate + /// + /// AdWords for Video API is a Beta feature. + public class AddTargetingGroupCriteria : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create targeting group criteria."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddTargetingGroupCriteria codeExample = new AddTargetingGroupCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + long targetingGroupId = long.Parse("INSERT_TARGETING_GROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId, targetingGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + /// The targeting group ID. + public void Run(AdWordsUser user, long campaignId, long targetingGroupId) { + // Get the VideoTargetingGroupCriterionService. + VideoTargetingGroupCriterionService videoTargetingGroupCriterionService = + (VideoTargetingGroupCriterionService) user.GetService( + AdWordsService.v201402.VideoTargetingGroupCriterionService); + + // Create age criteria. + TargetingGroupCriterion ageCriterion = new TargetingGroupCriterion(); + ageCriterion.campaignId = campaignId; + ageCriterion.targetingGroupId = targetingGroupId; + AudienceAge age = new AudienceAge(); + age.ageRange = AudienceAgeAgeRange.AGE_RANGE_18_24; + ageCriterion.criterion = age; + + TargetingGroupCriterionOperation addAgeCriterionOperation = + new TargetingGroupCriterionOperation(); + addAgeCriterionOperation.operand = ageCriterion; + addAgeCriterionOperation.@operator = Operator.ADD; + + // Create negative age criteria. + NegativeTargetingGroupCriterion negativeAgeCriterion = new NegativeTargetingGroupCriterion(); + negativeAgeCriterion.campaignId = campaignId; + negativeAgeCriterion.targetingGroupId = targetingGroupId; + AudienceAge negativeAge = new AudienceAge(); + negativeAge.ageRange = AudienceAgeAgeRange.AGE_RANGE_65_UP; + negativeAgeCriterion.criterion = negativeAge; + + TargetingGroupCriterionOperation addNegativeAgeCriterionOperation = + new TargetingGroupCriterionOperation(); + addNegativeAgeCriterionOperation.operand = negativeAgeCriterion; + addNegativeAgeCriterionOperation.@operator = Operator.ADD; + + // Create gender criteria. + TargetingGroupCriterion genderCriterion = new TargetingGroupCriterion(); + AudienceGender gender = new AudienceGender(); + gender.genderType = AudienceGenderGenderType.GENDER_MALE; + genderCriterion.campaignId = campaignId; + genderCriterion.targetingGroupId = targetingGroupId; + genderCriterion.criterion = gender; + + TargetingGroupCriterionOperation addGenderCriterionOperation = + new TargetingGroupCriterionOperation(); + addGenderCriterionOperation.operand = genderCriterion; + addGenderCriterionOperation.@operator = Operator.ADD; + + // Create topic criteria. + // See https://developers.google.com/adwords/api/docs/appendix/verticals + // for valid ids. + TargetingGroupCriterion topicCriterion = new TargetingGroupCriterion(); + Topic topic = new Topic(); + // Autos & Vehicles > Vehicle Brands > Buick + topic.verticalId = 1060L; + + topicCriterion.campaignId = campaignId; + topicCriterion.targetingGroupId = targetingGroupId; + topicCriterion.criterion = topic; + + TargetingGroupCriterionOperation addTopicCriterionOperation = + new TargetingGroupCriterionOperation(); + addTopicCriterionOperation.operand = topicCriterion; + addTopicCriterionOperation.@operator = Operator.ADD; + + // Add audience interest criteria. + // See https://developers.google.com/adwords/api/docs/appendix/verticals + // for valid ids. + TargetingGroupCriterion interestCriterion = new TargetingGroupCriterion(); + AudienceInterest interest = new AudienceInterest(); + // Computers & Electronics > Computer Hardware > Laptops & Notebooks > Tablet PCs + interest.interestId = 1277L; + + interestCriterion.campaignId = campaignId; + interestCriterion.targetingGroupId = targetingGroupId; + interestCriterion.criterion = topic; + + TargetingGroupCriterionOperation addUserInterestCriteriaOperation = + new TargetingGroupCriterionOperation(); + addUserInterestCriteriaOperation.operand = interestCriterion; + addUserInterestCriteriaOperation.@operator = Operator.ADD; + + try { + TargetingGroupCriterionReturnValue retval = videoTargetingGroupCriterionService.mutate( + new TargetingGroupCriterionOperation[] { + addAgeCriterionOperation, + addGenderCriterionOperation, + addNegativeAgeCriterionOperation, + addTopicCriterionOperation, + addUserInterestCriteriaOperation + }); + if (retval != null && retval.value != null) { + foreach (TargetingGroupCriterion newCriterion in retval.value) { + Console.WriteLine("Added targeting group criteria with id = {0} and type = {1} " + + "to campaign id {2}.", + newCriterion.criterion.id, newCriterion.criterion.BaseCriterionType, + newCriterion.campaignId); + } + } else { + Console.WriteLine("No new targeting group criteria were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add targeting group criteria.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201402/AdWordsForVideo/AddVideoAd.cs b/examples/AdWords/CSharp/v201402/AdWordsForVideo/AddVideoAd.cs new file mode 100644 index 00000000000..fd526c55dab --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AdWordsForVideo/AddVideoAd.cs @@ -0,0 +1,109 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example illustrates how to create a video ad. + /// + /// Tags: VideoAdService.mutate + /// + /// AdWords for Video API is a Beta feature. + public class AddVideoAd : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create a video ad."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddVideoAd codeExample = new AddVideoAd(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + string videoId = "INSERT_VIDEO_ID_HERE"; + codeExample.Run(new AdWordsUser(), campaignId, videoId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + /// The Youtube video ID. + public void Run(AdWordsUser user, long campaignId, string videoId) { + // Get the VideoAdService. + VideoAdService videoAdService = (VideoAdService) user.GetService( + AdWordsService.v201402.VideoAdService); + + VideoAd videoAd = new VideoAd(); + videoAd.campaignId = campaignId; + videoAd.name = "My first video ad"; + videoAd.status = VideoAdStatus.PAUSED; + + videoAd.headline = "Best headline ever"; + videoAd.destinationUrl = "http://www.example.com"; + videoAd.displayUrl = "www.example.com"; + videoAd.description1 = "My favorite line 1"; + videoAd.description2 = "My favorite line 2"; + + videoAd.videoId = videoId; + + VideoAdDisplayFormat_VideoAdStatusMapEntry statusByFormat = + new VideoAdDisplayFormat_VideoAdStatusMapEntry(); + statusByFormat.key = VideoAdDisplayFormat.TRUE_VIEW_IN_STREAM; + statusByFormat.value = VideoAdStatus.ENABLED; + + videoAd.statusByFormat = new VideoAdDisplayFormat_VideoAdStatusMapEntry[] { + statusByFormat + }; + + try { + VideoAdOperation operation = new VideoAdOperation(); + operation.operand = videoAd; + operation.@operator = Operator.ADD; + + VideoAdReturnValue retval = videoAdService.mutate(new VideoAdOperation[] { operation }); + if (retval != null && retval.value != null && retval.value.Length > 0) { + VideoAd newVideoAd = retval.value[0]; + Console.WriteLine("Ad with id = {0} was added to campaign id {1}.", newVideoAd.id, + newVideoAd.campaignId); + } else { + Console.WriteLine("No video ads were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add video ad.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201402/AdWordsForVideo/AddVideoCallToAction.cs b/examples/AdWords/CSharp/v201402/AdWordsForVideo/AddVideoCallToAction.cs new file mode 100644 index 00000000000..4e9873b7418 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AdWordsForVideo/AddVideoCallToAction.cs @@ -0,0 +1,109 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example illustrates how to create a video call to action + /// overlay. + /// + /// Tags: VideoService.mutateCallToAction + /// + /// AdWords for Video API is a Beta feature. + public class AddVideoCallToAction : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create a video call to action overlay"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddVideoCallToAction codeExample = new AddVideoCallToAction(); + Console.WriteLine(codeExample.Description); + try { + string videoId = "INSERT_VIDEO_ID_HERE"; + codeExample.Run(new AdWordsUser(), videoId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The video ID. + public void Run(AdWordsUser user, string videoId) { + // Get the VideoService. + VideoService videoService = (VideoService) user.GetService( + AdWordsService.v201402.VideoService); + + VideoCallToAction videoCallToAction = new VideoCallToAction(); + videoCallToAction.id = videoId; + + CallToAction callToAction = new CallToAction(); + + CallToActionCreative callToActionCreative = new CallToActionCreative(); + callToActionCreative.headline = "Mars cruise"; + callToActionCreative.descriptionLine1 = "Astonishing views"; + callToActionCreative.descriptionLine2 = "Mild climate"; + callToActionCreative.displayUrl = "www.example.com/mars"; + callToActionCreative.destinationUrl = "www.example.com/mars"; + + callToAction.creative = callToActionCreative; + videoCallToAction.callToAction = callToAction; + + try { + VideoCallToActionOperation operation = new VideoCallToActionOperation(); + operation.operand = videoCallToAction; + + // If this is a new Call to Action, use Operator.ADD + // If a Call to Action already exists, use Operator.SET + operation.@operator = Operator.SET; + + VideoCallToActionOperation[] operations = new VideoCallToActionOperation[] { operation }; + + // Add video call to action. + VideoReturnValue result = videoService.mutateCallToAction(operations); + + if (result != null && result.value != null && result.value.Length > 0) { + foreach (YouTubeVideo youTubeVideo in result.value) { + Console.WriteLine("CallToAction overlay was added to video ID {0}, headline {1}.", + youTubeVideo.id, youTubeVideo.callToAction.creative.headline); + } + } else { + Console.WriteLine("No call to action overlays were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add call to action overlay.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201402/AdWordsForVideo/AddVideoCampaign.cs b/examples/AdWords/CSharp/v201402/AdWordsForVideo/AddVideoCampaign.cs new file mode 100644 index 00000000000..f8cee11f1c2 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AdWordsForVideo/AddVideoCampaign.cs @@ -0,0 +1,122 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example illustrates how to create a video campaign. + /// + /// Tags: VideoCampaignService.mutate, BudgetService.mutate + /// + /// AdWords for Video API is a Beta feature. + public class AddVideoCampaign : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create a video campaign."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddVideoCampaign codeExample = new AddVideoCampaign(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the BudgetService. + BudgetService budgetService = + (BudgetService) user.GetService(AdWordsService.v201402.BudgetService); + + // Get the VideoCampaignService. + VideoCampaignService videoCampaignService = + (VideoCampaignService) user.GetService(AdWordsService.v201402.VideoCampaignService); + + // Create the campaign budget. + Budget budget = new Budget(); + budget.name = "Interplanetary Cruise Budget #" + ExampleUtilities.GetRandomString(); + budget.period = BudgetBudgetPeriod.DAILY; + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + budget.amount = new Money(); + budget.amount.microAmount = 500000; + + BudgetOperation budgetOperation = new BudgetOperation(); + budgetOperation.@operator = Operator.ADD; + budgetOperation.operand = budget; + + try { + BudgetReturnValue budgetRetval = budgetService.mutate(new BudgetOperation[] { budgetOperation }); + budget = budgetRetval.value[0]; + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add shared budget.", ex); + } + + // Create video campaign. + VideoCampaign videoCampaign = new VideoCampaign(); + videoCampaign.name = ("Interplanetary Cruise #" + ExampleUtilities.GetRandomString()); + videoCampaign.status = VideoCampaignStatus.PAUSED; + videoCampaign.budgetId = budget.budgetId; + + // You can optionally provide these field(s). The dates will be + // interpreted using the account's timezone. + videoCampaign.startDate = DateTime.Now.AddDays(1).ToString("yyyyMMdd"); + + try { + // Create operations. + VideoCampaignOperation operation = new VideoCampaignOperation(); + operation.operand = videoCampaign; + operation.@operator = Operator.ADD; + + VideoCampaignOperation[] operations = new VideoCampaignOperation[] { operation }; + + // Add video campaigns. + VideoCampaignReturnValue retval = videoCampaignService.mutate(operations); + + // Display video campaigns. + if (retval != null && retval.value != null && retval.value.Length > 0) { + VideoCampaign newVideoCampaign = retval.value[0]; + Console.WriteLine("Campaign with name '{0}' and id = {1} was added.", + newVideoCampaign.name, newVideoCampaign.id); + } else { + Console.WriteLine("No video campaigns were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add video campaign.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201402/AdWordsForVideo/AddVideoCampaignCriteria.cs b/examples/AdWords/CSharp/v201402/AdWordsForVideo/AddVideoCampaignCriteria.cs new file mode 100644 index 00000000000..9685abd033b --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AdWordsForVideo/AddVideoCampaignCriteria.cs @@ -0,0 +1,99 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example demonstrates how to add campaign-level criteria + /// targeting. + /// + /// Tags: VideoCampaignCriterionService.mutate + /// + /// AdWords for Video API is a Beta feature. + public class AddVideoCampaignCriteria : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example demonstrates how to add campaign-level criteria targeting."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddVideoCampaignCriteria codeExample = new AddVideoCampaignCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + public void Run(AdWordsUser user, long campaignId) { + // Get the VideoCampaignCriterionService. + VideoCampaignCriterionService service = + (VideoCampaignCriterionService) user.GetService( + AdWordsService.v201402.VideoCampaignCriterionService); + + try { + VideoCampaignCriterion criterion = new VideoCampaignCriterion(); + criterion.campaignId = campaignId; + + // for a list of languages, see + // https://devsite.googleplex.com/adwords/api/docs/appendix/languagecodes + LanguageVideoCriterion englishCriterion = new LanguageVideoCriterion(); + englishCriterion.id = 1001L; + criterion.criterion = englishCriterion; + + VideoCampaignCriterionOperation operation = new VideoCampaignCriterionOperation(); + operation.operand = criterion; + operation.@operator = Operator.ADD; + + VideoCampaignCriterionReturnValue retval = service.mutate( + new VideoCampaignCriterionOperation[] { operation }); + + if (retval != null && retval.value != null && retval.value.Length > 0) { + VideoCampaignCriterion newCriterion = retval.value[0]; + Console.WriteLine("Video campaign criterion with id = {0} and type = {1} was added " + + "to campaign id {2}", newCriterion.criterion.id, + newCriterion.criterion.BaseCriterionType, newCriterion.campaignId); + } else { + Console.WriteLine("No video campaign criteria were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add video campaign criteria.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201402/AdWordsForVideo/FindVideos.cs b/examples/AdWords/CSharp/v201402/AdWordsForVideo/FindVideos.cs new file mode 100644 index 00000000000..216cae5b3c3 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AdWordsForVideo/FindVideos.cs @@ -0,0 +1,100 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example illustrates how to find YouTube videos by a search + /// string. It retrieve details for the first 100 matching videos. + /// + /// Tags: VideoService.search + /// + /// AdWords for Video API is a Beta feature. + public class FindVideos : ExampleBase { + + /// + /// Maximum number of results to fetch. + /// + private const int PAGE_SIZE = 100; + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to find YouTube videos by a search " + + "string. It retrieve details for the first 100 matching videos."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + FindVideos codeExample = new FindVideos(); + Console.WriteLine(codeExample.Description); + try { + string queryString = "INSERT_QUERY_STRING_HERE"; + codeExample.Run(new AdWordsUser(), queryString); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The video search query text. + public void Run(AdWordsUser user, string queryString) { + // Get the VideoService. + VideoService videoService = (VideoService) user.GetService( + AdWordsService.v201402.VideoService); + + // Create a selector. + VideoSearchSelector selector = new VideoSearchSelector(); + selector.searchType = VideoSearchSelectorSearchType.VIDEO; + selector.query = queryString; + selector.paging = new Paging(); + selector.paging.startIndex = 0; + selector.paging.numberResults = PAGE_SIZE; + + try { + // Run the query. + VideoSearchPage page = videoService.search(selector); + + // Display videos. + if (page != null && page.totalNumEntries > 0) { + foreach (YouTubeVideo video in page.entries) { + Console.WriteLine("YouTube video ID {0} with title {1} found.", video.id, video.title); + } + Console.WriteLine("Total number of matching videos: {0}.", page.totalNumEntries); + } else { + Console.WriteLine("No videos matching {0} were found.", queryString); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to search for videos.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201402/AdWordsForVideo/GetKeywordCriteria.cs b/examples/AdWords/CSharp/v201402/AdWordsForVideo/GetKeywordCriteria.cs new file mode 100644 index 00000000000..55fa86aa235 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AdWordsForVideo/GetKeywordCriteria.cs @@ -0,0 +1,117 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example shows how to retrieve all keywords for a video + /// campaign. To get a list with all campaigns, run GetVideoCampaigns.cs. + /// + /// Tags: VideoTargetingGroupCriterionService.get + /// + /// AdWords for Video API is a Beta feature. + public class GetKeywordCriteria : ExampleBase { + + /// + /// Maximum number of results to fetch. + /// + private const int PAGE_SIZE = 100; + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to retrieve all keywords for a video campaign. " + + "To get a list with all campaigns, run GetVideoCampaigns.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetKeywordCriteria codeExample = new GetKeywordCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + public void Run(AdWordsUser user, long campaignId) { + // Get the VideoTargetingGroupCriterionService. + VideoTargetingGroupCriterionService videoTargetingGroupCriterionService = + (VideoTargetingGroupCriterionService) user.GetService( + AdWordsService.v201402.VideoTargetingGroupCriterionService); + + int offset = 0; + + TargetingGroupCriterionPage page = new TargetingGroupCriterionPage(); + + try { + // Create selector. + TargetingGroupCriterionSelector selector = new TargetingGroupCriterionSelector(); + + selector.criteriaDimension = CriteriaDimension.KEYWORD; + selector.campaignIds = new long[] { campaignId }; + + selector.paging = new Paging(); + + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = PAGE_SIZE; + + // Get all keywords. + page = videoTargetingGroupCriterionService.get(selector); + + // Display keywords. + if (page != null && page.entries != null) { + int i = offset; + foreach (TargetingGroupCriterion targetingGroupCriterion in page.entries) { + String negative = + (targetingGroupCriterion is NegativeTargetingGroupCriterion) ? + " (negative)" : ""; + BaseKeyword keyword = (BaseKeyword) targetingGroupCriterion.criterion; + Console.WriteLine("{0}) Criterion {1} ID {2}, targeting group ID {3} and " + + "text '{4}'\n", i, negative, keyword.id, + targetingGroupCriterion.targetingGroupId, keyword.text); + i++; + } + } + offset += PAGE_SIZE; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of keywords found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get keywords.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201402/AdWordsForVideo/GetTargetingGroups.cs b/examples/AdWords/CSharp/v201402/AdWordsForVideo/GetTargetingGroups.cs new file mode 100644 index 00000000000..fe483d3e9e4 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AdWordsForVideo/GetTargetingGroups.cs @@ -0,0 +1,112 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example shows how to retrieve all targeting groups for video + /// campaigns. + /// + /// Tags: VideoTargetingGroupService.get + /// + /// AdWords for Video API is a Beta feature. + public class GetTargetingGroups : ExampleBase { + + /// + /// Maximum number of results to fetch. + /// + private const int PAGE_SIZE = 100; + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to retrieve all targeting groups for " + + "video campaigns."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetTargetingGroups codeExample = new GetTargetingGroups(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + public void Run(AdWordsUser user, long campaignId) { + // Get the VideoTargetingGroupService. + VideoTargetingGroupService videoTargetingGroupService = (VideoTargetingGroupService) + user.GetService(AdWordsService.v201402.VideoTargetingGroupService); + + int offset = 0; + + TargetingGroupPage page = new TargetingGroupPage(); + + try { + // Create selector. + TargetingGroupSelector selector = new TargetingGroupSelector(); + selector.campaignIds = new long[] { campaignId }; + + selector.paging = new Paging(); + + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = PAGE_SIZE; + + // Get all targeting groups for this account. + page = videoTargetingGroupService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (TargetingGroup targetingGroup in page.entries) { + Console.WriteLine("{0}) Targeting group ID {1}, campaign ID {2} and name '{3}'", + (i + 1), targetingGroup.id, targetingGroup.campaignId, targetingGroup.name); + + i++; + } + } else { + Console.WriteLine("No targeting groups were found."); + } + offset += PAGE_SIZE; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of targeting groups found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get targeting groups.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201402/AdWordsForVideo/GetVideoCampaignCriteria.cs b/examples/AdWords/CSharp/v201402/AdWordsForVideo/GetVideoCampaignCriteria.cs new file mode 100644 index 00000000000..1fce972b39e --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AdWordsForVideo/GetVideoCampaignCriteria.cs @@ -0,0 +1,116 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example demonstrates how to retrieve all campaign-level + /// criteria in a campaign. + /// + /// Tags: VideoCampaignCriterionService.get + /// + /// AdWords for Video API is a Beta feature. + public class GetVideoCampaignCriteria : ExampleBase { + + /// + /// Maximum number of results to fetch. + /// + private const int PAGE_SIZE = 100; + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve all non-deleted video " + + "campaigns for an account."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetVideoCampaignCriteria codeExample = new GetVideoCampaignCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + public void Run(AdWordsUser user, long campaignId) { + // Get the VideoCampaignCriterionService. + VideoCampaignCriterionService videoCampaignCriterionService = + (VideoCampaignCriterionService) user.GetService( + AdWordsService.v201402.VideoCampaignCriterionService); + + int offset = 0; + + VideoCampaignCriterionPage page = new VideoCampaignCriterionPage(); + + try { + // Create selector. + VideoCampaignCriterionSelector selector = new VideoCampaignCriterionSelector(); + selector.campaignIds = new long[] { campaignId }; + + selector.paging = new Paging(); + + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = PAGE_SIZE; + + page = videoCampaignCriterionService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (VideoCampaignCriterion videoCampaignCriterion in page.entries) { + String negative = + (videoCampaignCriterion is NegativeVideoCampaignCriterion) ? " (negative)" + : ""; + Console.WriteLine("{0}) Video {1} criterion ID {2} of type '{3}'", (i + 1), + negative, + videoCampaignCriterion.criterion.id, + videoCampaignCriterion.criterion.BaseCriterionType); + i++; + } + } else { + Console.WriteLine("No video campaign criteria were found."); + } + offset += PAGE_SIZE; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of video campaign criteria found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get video campaign criteria.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201402/AdWordsForVideo/GetVideoCampaignStats.cs b/examples/AdWords/CSharp/v201402/AdWordsForVideo/GetVideoCampaignStats.cs new file mode 100644 index 00000000000..c904000aac0 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AdWordsForVideo/GetVideoCampaignStats.cs @@ -0,0 +1,160 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example illustrates how to retrieve stats for a video campaign. + /// + /// Tags: VideoCampaignService.get + /// + /// AdWords for Video API is a Beta feature. + public class GetVideoCampaignStats : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve stats for a video campaign."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetVideoCampaignStats codeExample = new GetVideoCampaignStats(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + public void Run(AdWordsUser user, long campaignId) { + // Get the VideoCampaignService. + VideoCampaignService videoCampaignService = (VideoCampaignService) user.GetService( + AdWordsService.v201402.VideoCampaignService); + + // The dates will be interpreted using the account's timezone. + String minDateTime = DateTime.Now.Year.ToString() + "0101"; + String maxDateTime = DateTime.Now.ToString("yyyyMMdd"); + + // Create selector. + StatsSelector statsSelector = new StatsSelector(); + DateRange dateRange = new DateRange(); + dateRange.min = minDateTime; + dateRange.max = maxDateTime; + + statsSelector.dateRange = dateRange; + statsSelector.segmentationDimensions = new SegmentationDimension[] { + SegmentationDimension.DATE_MONTH }; + statsSelector.metrics = new Metric[] { Metric.VIEWS, Metric.COST, Metric.AVERAGE_CPV }; + statsSelector.summaryTypes = new VideoEntityStatsSummaryType[] { + VideoEntityStatsSummaryType.ALL }; + statsSelector.segmentedSummaryType = VideoEntityStatsSummaryType.ALL; + + try { + // Create selector. + VideoCampaignSelector selector = new VideoCampaignSelector(); + selector.statsSelector = statsSelector; + selector.ids = new long[] { campaignId }; + + selector.paging = new Paging(); + + VideoCampaignPage page = videoCampaignService.get(selector); + + if (page != null) { + if (page.entries != null && page.entries.Length > 0) { + VideoCampaign videoCampaign = page.entries[0]; + + Console.WriteLine("Campaign ID {0}, name '{1}' and status '{2}'", videoCampaign.id, + videoCampaign.name, videoCampaign.status); + if (videoCampaign.stats != null) { + Console.WriteLine("\tCampaign stats:"); + Console.WriteLine("\t\t" + FormatStats(videoCampaign.stats)); + } + if (videoCampaign.segmentedStats != null) { + foreach (VideoEntityStats segment in videoCampaign.segmentedStats) { + Console.WriteLine("\tCampaign segmented stats for month of " + + ((DateKey) segment.segmentKey.Item).date); + Console.WriteLine("\t\t" + FormatStats(segment)); + } + } + } else { + Console.WriteLine("No campaigns were found."); + } + if (page.summaryStats != null) { + foreach (VideoEntityStats summary in page.summaryStats) { + Console.WriteLine("\tSummary of type " + summary.summaryType); + Console.WriteLine("\t\t" + FormatStats(summary)); + } + } else { + Console.WriteLine("No summary stats found."); + } + } else { + Console.WriteLine("No campaigns were found."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get campaigns.", ex); + } + } + + /// + /// Formats a money value for display purposes. + /// + /// The money value. + /// The formatted money value as text. + private static String Dashify(Money m) { + return m == null ? "--" : m.microAmount.ToString(); + } + + /// + /// Formats the stats for display. + /// + /// The stats. + /// Stats as formatted text. + private static String FormatStats(VideoEntityStats stats) { + return string.Format("Views: {0}, Cost: {1}, Avg. CPC: {2}, Avg. CPV: {3}, " + + "Avg. CPM: {4}, 25%: {5}, 50%: {6}, 75%: {7}, 100%: {8}", + stats.viewsSpecified? stats.views.ToString() : "--", + Dashify(stats.cost), + Dashify(stats.averageCpc), + Dashify(stats.averageCpv), + Dashify(stats.averageCpm), + stats.quartile25PercentsSpecified? stats.quartile25Percents.ToString() : "--", + stats.quartile50PercentsSpecified? stats.quartile50Percents.ToString() : "--", + stats.quartile75PercentsSpecified? stats.quartile75Percents.ToString() : "--", + stats.quartile100PercentsSpecified? stats.quartile100Percents.ToString() : "--" + ); + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201402/AdWordsForVideo/GetVideoCampaigns.cs b/examples/AdWords/CSharp/v201402/AdWordsForVideo/GetVideoCampaigns.cs new file mode 100644 index 00000000000..a095f66c560 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AdWordsForVideo/GetVideoCampaigns.cs @@ -0,0 +1,107 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example illustrates how to retrieve all non-deleted video + /// campaigns for an account. + /// + /// Tags: VideoCampaignService.get + /// + /// AdWords for Video API is a Beta feature. + public class GetVideoCampaigns : ExampleBase { + + /// + /// Maximum number of results to fetch. + /// + private const int PAGE_SIZE = 100; + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve all non-deleted video " + + "campaigns for an account."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetVideoCampaigns codeExample = new GetVideoCampaigns(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the VideoCampaignService. + VideoCampaignService videoCampaignService = (VideoCampaignService) user.GetService( + AdWordsService.v201402.VideoCampaignService); + + int offset = 0; + + VideoCampaignPage page = new VideoCampaignPage(); + + try { + // Create selector. + VideoCampaignSelector selector = new VideoCampaignSelector(); + + selector.paging = new Paging(); + + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = PAGE_SIZE; + + page = videoCampaignService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (VideoCampaign videoCampaign in page.entries) { + Console.WriteLine("{0}) Campaign ID {1}, name '{2}' and status '{3}'", + (i + 1), videoCampaign.id, videoCampaign.name, videoCampaign.status); + i++; + } + } else { + Console.WriteLine("No campaigns were found."); + } + offset += PAGE_SIZE; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get campaigns.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201402/AdvancedOperations/AddAdGroupBidModifier.cs b/examples/AdWords/CSharp/v201402/AdvancedOperations/AddAdGroupBidModifier.cs new file mode 100644 index 00000000000..c5acbbeeaab --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AdvancedOperations/AddAdGroupBidModifier.cs @@ -0,0 +1,111 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example illustrates how to add ad group level mobile bid + /// modifier override. + /// + /// Tags: AdGroupBidModifierService.mutate + /// + public class AddAdGroupBidModifier : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAdGroupBidModifier codeExample = new AddAdGroupBidModifier(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + double bidModifier = double.Parse("INSERT_ADGROUP_BID_MODIFIER_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, bidModifier); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to add ad group level mobile bid modifier " + + "override."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the adgroup for which bid modifier is + /// set. + /// The mobile bid modifier for adgroup + public void Run(AdWordsUser user, long adGroupId, double bidModifier) { + // Get the AdGroupAdService. + AdGroupBidModifierService adGroupBidModifierService = + (AdGroupBidModifierService) user.GetService( + AdWordsService.v201402.AdGroupBidModifierService); + + // Mobile criterion ID. + long criterionId = 30001; + + + // Create the adgroup bid modifier. + AdGroupBidModifier adGroupBidModifier = new AdGroupBidModifier(); + adGroupBidModifier.bidModifier = bidModifier; + adGroupBidModifier.adGroupId = adGroupId; + + Platform platform = new Platform(); + platform.id = criterionId; + + adGroupBidModifier.criterion = platform; + + AdGroupBidModifierOperation operation = new AdGroupBidModifierOperation(); + operation.@operator = Operator.ADD; + operation.operand = adGroupBidModifier; + + + try { + // Add ad group level mobile bid modifier. + AdGroupBidModifierReturnValue retval = adGroupBidModifierService.mutate( + new AdGroupBidModifierOperation[] {operation}); + + // Display the results. + if (retval != null && retval.value != null && retval.value.Length > 0) { + AdGroupBidModifier newBidModifier = retval.value[0]; + Console.WriteLine("AdGroup ID {0}, Criterion ID {1} was updated with ad group level " + + "modifier: {2}", newBidModifier.adGroupId, newBidModifier.criterion.id, + newBidModifier.bidModifier); + } else { + Console.WriteLine("No bid modifiers were added to the adgroup."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add bid modifiers to adgroup.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/AdvancedOperations/AddClickToDownloadAd.cs b/examples/AdWords/CSharp/v201402/AdvancedOperations/AddClickToDownloadAd.cs new file mode 100644 index 00000000000..ddc6080a610 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AdvancedOperations/AddClickToDownloadAd.cs @@ -0,0 +1,146 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example creates a click-to-download ad, also known as an + /// app promotion ad to a given ad group. To list ad groups, run + /// GetAdGroups.cs. + /// + /// Tags: AdGroupAdService.mutate + /// + public class AddClickToDownloadAd : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddClickToDownloadAd codeExample = new AddClickToDownloadAd(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a click-to-download ad, also known as an app " + + "promotion ad to a given ad group. To list ad groups, run GetAdGroups.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which ads are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService adGroupAdService = + (AdGroupAdService) user.GetService(AdWordsService.v201402.AdGroupAdService); + + // Create the template ad. + TemplateAd clickToDownloadAppAd = new TemplateAd(); + + clickToDownloadAppAd.name = "Ad for demo game"; + clickToDownloadAppAd.templateId = 353; + clickToDownloadAppAd.url = + "http://play.google.com/store/apps/details?id=com.example.demogame"; + clickToDownloadAppAd.displayUrl = "play.google.com"; + + // Create the template elements for the ad. You can refer to + // https://developers.google.com/adwords/api/docs/appendix/templateads + // for the list of avaliable template fields. + TemplateElementField headline = new TemplateElementField(); + headline.name = "headline"; + headline.fieldText = "Enjoy your drive in Mars"; + headline.type = TemplateElementFieldType.TEXT; + + TemplateElementField description1 = new TemplateElementField(); + description1.name = "description1"; + description1.fieldText = "Realistic physics simulation"; + description1.type = TemplateElementFieldType.TEXT; + + TemplateElementField description2 = new TemplateElementField(); + description2.name = "description2"; + description2.fieldText = "Race against players online"; + description2.type = TemplateElementFieldType.TEXT; + + TemplateElementField appId = new TemplateElementField(); + appId.name = "appId"; + appId.fieldText = "com.example.demogame"; + appId.type = TemplateElementFieldType.TEXT; + + TemplateElementField appStore = new TemplateElementField(); + appStore.name = "appStore"; + appStore.fieldText = "2"; + appStore.type = TemplateElementFieldType.ENUM; + + TemplateElement adData = new TemplateElement(); + adData.uniqueName = "adData"; + adData.fields = new TemplateElementField[] {headline, description1, description2, appId, + appStore}; + + clickToDownloadAppAd.templateElements = new TemplateElement[] {adData}; + + // Create the adgroupad. + AdGroupAd clickToDownloadAppAdGroupAd = new AdGroupAd(); + clickToDownloadAppAdGroupAd.adGroupId = adGroupId; + clickToDownloadAppAdGroupAd.ad = clickToDownloadAppAd; + + // Optional: Set the status. + clickToDownloadAppAdGroupAd.status = AdGroupAdStatus.PAUSED; + + // Create the operation. + AdGroupAdOperation operation = new AdGroupAdOperation(); + operation.@operator = Operator.ADD; + operation.operand = clickToDownloadAppAdGroupAd; + + try { + // Create the ads. + AdGroupAdReturnValue retval = adGroupAdService.mutate(new AdGroupAdOperation[] {operation}); + + // Display the results. + if (retval != null && retval.value != null) { + foreach (AdGroupAd adGroupAd in retval.value) { + Console.WriteLine("New click-to-download ad with id = \"{0}\" and url = \"{1}\" " + + "was created.", adGroupAd.ad.id, adGroupAd.ad.url); + } + } else { + Console.WriteLine("No click-to-download ads were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create click-to-download ad.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/AdvancedOperations/AddPlacesLocationExtension.cs b/examples/AdWords/CSharp/v201402/AdvancedOperations/AddPlacesLocationExtension.cs new file mode 100644 index 00000000000..5ee4480adc4 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AdvancedOperations/AddPlacesLocationExtension.cs @@ -0,0 +1,193 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; +using Google.Api.Ads.Common.Lib; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example adds a feed that syncs feed items from a Google + /// Places account and associates the feed with a customer. + /// + /// Tags: CustomerFeedService.mutate, FeedItemService.mutate + /// Tags: FeedMappingService.mutate, FeedService.mutate + /// + public class AddPlacesLocationExtension : ExampleBase { + + /// + /// The placeholder type for location extensions. See the Placeholder + /// reference page for a list of all the placeholder types and fields. + /// + /// https://developers.google.com/adwords/api/docs/appendix/placeholders + /// + private const int PLACEHOLDER_LOCATION = 7; + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a feed that syncs feed items from a Google Places " + + "account and associates the feed with a customer."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddPlacesLocationExtension codeExample = new AddPlacesLocationExtension(); + Console.WriteLine(codeExample.Description); + try { + string placesEmailAddress = "INSERT_PLACES_EMAIL_ADDRESS_HERE"; + // To obtain an access token for your Places account, run the + // OAuthTokenGenerator utility and capture the Credential's + // access token. + string placesAccessToken = "INSERT_PLACES_ACCESS_TOKEN_HERE"; + codeExample.Run(new AdWordsUser(), placesEmailAddress, placesAccessToken); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The email address for Google Places + /// account. + /// The OAuth2 access token for Google + /// Places account. + public void Run(AdWordsUser user, string placesEmailAddress, string placesAccessToken) { + FeedService feedService = (FeedService) user.GetService(AdWordsService.v201402.FeedService); + + CustomerFeedService customerFeedService = (CustomerFeedService) user.GetService( + AdWordsService.v201402.CustomerFeedService); + + // Create a feed that will sync to the Google Places account specified + // by placesEmailAddress. Do not add FeedAttributes to this object, + // as AdWords will add them automatically because this will be a + // system generated feed. + Feed placesFeed = new Feed(); + placesFeed.name = String.Format("Places feed #{0}", ExampleUtilities.GetRandomString()); + + PlacesLocationFeedData feedData = new PlacesLocationFeedData(); + feedData.emailAddress = placesEmailAddress; + OAuthInfo oAuthInfo = new OAuthInfo(); + oAuthInfo.httpMethod = "GET"; + oAuthInfo.httpRequestUrl = "https://www.google.com/local/add"; + oAuthInfo.httpAuthorizationHeader = string.Format("Bearer {0}", placesAccessToken); + feedData.oAuthInfo = oAuthInfo; + + placesFeed.systemFeedGenerationData = feedData; + + // Since this feed's feed items will be managed by AdWords, + // you must set its origin to ADWORDS. + placesFeed.origin = FeedOrigin.ADWORDS; + + // Create an operation to add the feed. + FeedOperation feedOperation = new FeedOperation(); + feedOperation.operand = placesFeed; + feedOperation.@operator = Operator.ADD; + + try { + // Add the feed. Since it is a system generated feed, AdWords will + // automatically: + // 1. Set up the FeedAttributes on the feed. + // 2. Set up a FeedMapping that associates the FeedAttributes of the + // feed with the placeholder fields of the LOCATION placeholder + // type. + FeedReturnValue addFeedResult = feedService.mutate(new FeedOperation[] { feedOperation }); + Feed addedFeed = addFeedResult.value[0]; + Console.WriteLine("Added places feed with ID {0}", addedFeed.id); + + // Add a CustomerFeed that associates the feed with this customer for + // the LOCATION placeholder type. + CustomerFeed customerFeed = new CustomerFeed(); + customerFeed.feedId = addedFeed.id; + customerFeed.placeholderTypes = new int[] { PLACEHOLDER_LOCATION }; + + // Create a matching function that will always evaluate to true. + Function customerMatchingFunction = new Function(); + ConstantOperand constOperand = new ConstantOperand(); + constOperand.type = ConstantOperandConstantType.BOOLEAN; + constOperand.booleanValue = true; + customerMatchingFunction.lhsOperand = new FunctionArgumentOperand[] { constOperand }; + customerMatchingFunction.@operator = FunctionOperator.IDENTITY; + customerFeed.matchingFunction = customerMatchingFunction; + + // Create an operation to add the customer feed. + CustomerFeedOperation customerFeedOperation = new CustomerFeedOperation(); + customerFeedOperation.operand = customerFeed; + customerFeedOperation.@operator = Operator.ADD; + + // After the completion of the Feed ADD operation above the added feed + // will not be available for usage in a CustomerFeed until the sync + // between the AdWords and Places accounts completes. The loop below + // will retry adding the CustomerFeed up to ten times with an + // exponential back-off policy. + CustomerFeed addedCustomerFeed = null; + + AdWordsAppConfig config = new AdWordsAppConfig(); + config.RetryCount = 10; + + ErrorHandler errorHandler = new ErrorHandler(config); + do { + try { + CustomerFeedReturnValue customerFeedResult = + customerFeedService.mutate(new CustomerFeedOperation[] { customerFeedOperation }); + addedCustomerFeed = customerFeedResult.value[0]; + + Console.WriteLine("Added CustomerFeed for feed ID {0} and placeholder type {1}", + addedCustomerFeed.feedId, addedCustomerFeed.placeholderTypes[0]); + break; + } catch (AdWordsApiException e) { + ApiException apiException = (ApiException) e.ApiException; + foreach (ApiError error in apiException.errors) { + if (error is CustomerFeedError) { + if ((error as CustomerFeedError).reason == + CustomerFeedErrorReason.MISSING_FEEDMAPPING_FOR_PLACEHOLDER_TYPE) { + errorHandler.DoExponentialBackoff(); + errorHandler.IncrementRetriedAttempts(); + } else { + throw; + } + } + } + + } + } while (errorHandler.HaveMoreRetryAttemptsLeft()); + + // OPTIONAL: Create a CampaignFeed to specify which FeedItems to use at + // the Campaign level. This will be similar to the CampaignFeed in the + // AddSiteLinks example, except you can also filter based on the + // business name and category of each FeedItem by using a + // FeedAttributeOperand in your matching function. + + // OPTIONAL: Create an AdGroupFeed for even more fine grained control + // over which feed items are used at the AdGroup level. + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create customer feed.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/AdvancedOperations/AddSiteLinks.cs b/examples/AdWords/CSharp/v201402/AdvancedOperations/AddSiteLinks.cs new file mode 100644 index 00000000000..9e44ba37251 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AdvancedOperations/AddSiteLinks.cs @@ -0,0 +1,322 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: thagikura@gmail.com (Takeshi Hagikura) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + class SiteLinksDataHolder { + long siteLinksFeedId; + long linkTextFeedAttributeId; + long linkUrlFeedAttributeId; + List siteLinkFeedItemIds = new List(); + + public long SiteLinksFeedId { + get { + return siteLinksFeedId; + } + set { + siteLinksFeedId = value; + } + } + + public long LinkTextFeedAttributeId { + get { + return linkTextFeedAttributeId; + } + set { + linkTextFeedAttributeId = value; + } + } + + public long LinkUrlFeedAttributeId { + get { + return linkUrlFeedAttributeId; + } + set { + linkUrlFeedAttributeId = value; + } + } + + public List SiteLinkFeedItemIds { + get { + return siteLinkFeedItemIds; + } + set { + siteLinkFeedItemIds = value; + } + } + } + + /// + /// This code example adds a sitelinks feed and associates it with a campaign. + /// To create a campaign, run AddCampaign.cs. + /// + /// Tags: CampaignFeedService.mutate, FeedService.mutate, FeedItemService.mutate, + /// Tags: FeedMappingService.mutate + /// + public class AddSiteLinks : ExampleBase { + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddSiteLinks codeExample = new AddSiteLinks(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a sitelinks feed and associates it with a campaign."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign with which sitelinks are associated. + /// + public void Run(AdWordsUser user, long campaignId) { + SiteLinksDataHolder siteLinksData = new SiteLinksDataHolder(); + createSiteLinksFeed(user, siteLinksData); + createSiteLinksFeedItems(user, siteLinksData); + createSiteLinksFeedMapping(user, siteLinksData); + createSiteLinksCampaignFeed(user, siteLinksData, campaignId); + } + + private static void createSiteLinksFeed( + AdWordsUser user, SiteLinksDataHolder siteLinksData) { + // Get the FeedService. + FeedService feedService = (FeedService) user.GetService(AdWordsService.v201402.FeedService); + + // Create attributes. + FeedAttribute textAttribute = new FeedAttribute(); + textAttribute.type = FeedAttributeType.STRING; + textAttribute.name = "Link Text"; + FeedAttribute urlAttribute = new FeedAttribute(); + urlAttribute.type = FeedAttributeType.URL; + urlAttribute.name = "Link URL"; + + // Create the feed. + Feed siteLinksFeed = new Feed(); + siteLinksFeed.name = "Feed For Site Links"; + siteLinksFeed.attributes = new FeedAttribute[] {textAttribute, urlAttribute}; + siteLinksFeed.origin = FeedOrigin.USER; + + // Create operation. + FeedOperation operation = new FeedOperation(); + operation.operand = siteLinksFeed; + operation.@operator = Operator.ADD; + + // Add the feed. + FeedReturnValue result = feedService.mutate(new FeedOperation[] {operation}); + + Feed savedFeed = result.value[0]; + siteLinksData.SiteLinksFeedId = savedFeed.id; + FeedAttribute[] savedAttributes = savedFeed.attributes; + siteLinksData.LinkTextFeedAttributeId = savedAttributes[0].id; + siteLinksData.LinkUrlFeedAttributeId = savedAttributes[1].id; + Console.WriteLine("Feed with name {0} and ID {1} with linkTextAttributeId {2}" + + " and linkUrlAttributeId {3} was created.", savedFeed.name, savedFeed.id, + savedAttributes[0].id, savedAttributes[1].id); + } + + private static void createSiteLinksFeedItems( + AdWordsUser user, SiteLinksDataHolder siteLinksData) { + // Get the FeedItemService. + FeedItemService feedItemService = + (FeedItemService) user.GetService(AdWordsService.v201402.FeedItemService); + + // Create operations to add FeedItems. + FeedItemOperation home = + newSiteLinkFeedItemAddOperation(siteLinksData, + "Home", "http://www.example.com"); + FeedItemOperation stores = + newSiteLinkFeedItemAddOperation(siteLinksData, + "Stores", "http://www.example.com/stores"); + FeedItemOperation onSale = + newSiteLinkFeedItemAddOperation(siteLinksData, + "On Sale", "http://www.example.com/sale"); + FeedItemOperation support = + newSiteLinkFeedItemAddOperation(siteLinksData, + "Support", "http://www.example.com/support"); + FeedItemOperation products = + newSiteLinkFeedItemAddOperation(siteLinksData, + "Products", "http://www.example.com/prods"); + FeedItemOperation aboutUs = + newSiteLinkFeedItemAddOperation(siteLinksData, + "About Us", "http://www.example.com/about"); + + FeedItemOperation[] operations = + new FeedItemOperation[] {home, stores, onSale, support, products, aboutUs}; + + FeedItemReturnValue result = feedItemService.mutate(operations); + foreach (FeedItem item in result.value) { + Console.WriteLine("FeedItem with feedItemId {0} was added.", item.feedItemId); + siteLinksData.SiteLinkFeedItemIds.Add(item.feedItemId); + } + } + + // See the Placeholder reference page for a list of all the placeholder types and fields. + // https://developers.google.com/adwords/api/docs/appendix/placeholders.html + private const int PLACEHOLDER_SITELINKS = 1; + + // See the Placeholder reference page for a list of all the placeholder types and fields. + private const int PLACEHOLDER_FIELD_SITELINK_LINK_TEXT = 1; + private const int PLACEHOLDER_FIELD_SITELINK_URL = 2; + + private static void createSiteLinksFeedMapping( + AdWordsUser user, SiteLinksDataHolder siteLinksData) { + // Get the FeedItemService. + FeedMappingService feedMappingService = + (FeedMappingService) user.GetService(AdWordsService.v201402.FeedMappingService); + + // Map the FeedAttributeIds to the fieldId constants. + AttributeFieldMapping linkTextFieldMapping = new AttributeFieldMapping(); + linkTextFieldMapping.feedAttributeId = siteLinksData.LinkTextFeedAttributeId; + linkTextFieldMapping.fieldId = PLACEHOLDER_FIELD_SITELINK_LINK_TEXT; + AttributeFieldMapping linkUrlFieldMapping = new AttributeFieldMapping(); + linkUrlFieldMapping.feedAttributeId = siteLinksData.LinkUrlFeedAttributeId; + linkUrlFieldMapping.fieldId = PLACEHOLDER_FIELD_SITELINK_URL; + + // Create the FieldMapping and operation. + FeedMapping feedMapping = new FeedMapping(); + feedMapping.placeholderType = PLACEHOLDER_SITELINKS; + feedMapping.feedId = siteLinksData.SiteLinksFeedId; + feedMapping.attributeFieldMappings = + new AttributeFieldMapping[] {linkTextFieldMapping, linkUrlFieldMapping}; + FeedMappingOperation operation = new FeedMappingOperation(); + operation.operand = feedMapping; + operation.@operator = Operator.ADD; + + // Save the field mapping. + FeedMappingReturnValue result = + feedMappingService.mutate(new FeedMappingOperation[] {operation}); + foreach (FeedMapping savedFeedMapping in result.value) { + Console.WriteLine( + "Feed mapping with ID {0} and placeholderType {1} was saved for feed with ID {2}.", + savedFeedMapping.feedMappingId, savedFeedMapping.placeholderType, + savedFeedMapping.feedId); + } + } + + private static void createSiteLinksCampaignFeed(AdWordsUser user, + SiteLinksDataHolder siteLinksData, long campaignId) { + // Get the CampaignFeedService. + CampaignFeedService campaignFeedService = + (CampaignFeedService) user.GetService(AdWordsService.v201402.CampaignFeedService); + + // Map the feed item ids to the campaign using an IN operation. + RequestContextOperand feedItemRequestContextOperand = new RequestContextOperand(); + feedItemRequestContextOperand.contextType = RequestContextOperandContextType.FEED_ITEM_ID; + + List feedItemOperands = new List(); + foreach (long feedItemId in siteLinksData.SiteLinkFeedItemIds) { + ConstantOperand feedItemOperand = new ConstantOperand(); + feedItemOperand.longValue = feedItemId; + feedItemOperand.type = ConstantOperandConstantType.LONG; + feedItemOperands.Add(feedItemOperand); + } + + Function feedItemfunction = new Function(); + feedItemfunction.lhsOperand = new FunctionArgumentOperand[] {feedItemRequestContextOperand}; + feedItemfunction.@operator = FunctionOperator.IN; + feedItemfunction.rhsOperand = feedItemOperands.ToArray(); + + // Optional: to target to a platform, define a function and 'AND' it with + // the feed item ID link: + RequestContextOperand platformRequestContextOperand = new RequestContextOperand(); + platformRequestContextOperand.contextType = RequestContextOperandContextType.DEVICE_PLATFORM; + + ConstantOperand platformOperand = new ConstantOperand(); + platformOperand.stringValue = "Mobile"; + platformOperand.type = ConstantOperandConstantType.STRING; + + Function platformFunction = new Function(); + platformFunction.lhsOperand = new FunctionArgumentOperand[] {platformRequestContextOperand}; + platformFunction.@operator = FunctionOperator.EQUALS; + platformFunction.rhsOperand = new FunctionArgumentOperand[] {platformOperand}; + + // Combine the two functions using an AND operation. + FunctionOperand feedItemFunctionOperand = new FunctionOperand(); + feedItemFunctionOperand.value = feedItemfunction; + + FunctionOperand platformFunctionOperand = new FunctionOperand(); + platformFunctionOperand.value = platformFunction; + + Function combinedFunction = new Function(); + combinedFunction.@operator = FunctionOperator.AND; + combinedFunction.lhsOperand = new FunctionArgumentOperand[] { + feedItemFunctionOperand, platformFunctionOperand}; + + CampaignFeed campaignFeed = new CampaignFeed(); + campaignFeed.feedId = siteLinksData.SiteLinksFeedId; + campaignFeed.campaignId = campaignId; + campaignFeed.matchingFunction = combinedFunction; + // Specifying placeholder types on the CampaignFeed allows the same feed + // to be used for different placeholders in different Campaigns. + campaignFeed.placeholderTypes = new int[] {PLACEHOLDER_SITELINKS}; + + CampaignFeedOperation operation = new CampaignFeedOperation(); + operation.operand = campaignFeed; + operation.@operator = Operator.ADD; + CampaignFeedReturnValue result = + campaignFeedService.mutate(new CampaignFeedOperation[] {operation}); + foreach (CampaignFeed savedCampaignFeed in result.value) { + Console.WriteLine("Campaign with ID {0} was associated with feed with ID {1}", + savedCampaignFeed.campaignId, savedCampaignFeed.feedId); + } + } + + private static FeedItemOperation newSiteLinkFeedItemAddOperation( + SiteLinksDataHolder siteLinksData, String text, String url) { + // Create the FeedItemAttributeValues for our text values. + FeedItemAttributeValue linkTextAttributeValue = new FeedItemAttributeValue(); + linkTextAttributeValue.feedAttributeId = siteLinksData.LinkTextFeedAttributeId; + linkTextAttributeValue.stringValue = text; + FeedItemAttributeValue linkUrlAttributeValue = new FeedItemAttributeValue(); + linkUrlAttributeValue.feedAttributeId = siteLinksData.LinkUrlFeedAttributeId; + linkUrlAttributeValue.stringValue = url; + + // Create the feed item and operation. + FeedItem item = new FeedItem(); + item.feedId = siteLinksData.SiteLinksFeedId; + item.attributeValues = + new FeedItemAttributeValue[] {linkTextAttributeValue, linkUrlAttributeValue}; + FeedItemOperation operation = new FeedItemOperation(); + operation.operand = item; + operation.@operator = Operator.ADD; + return operation; + } + } +} diff --git a/examples/AdWords/CSharp/v201402/AdvancedOperations/GetAdGroupBidModifiers.cs b/examples/AdWords/CSharp/v201402/AdvancedOperations/GetAdGroupBidModifiers.cs new file mode 100644 index 00000000000..3fc3a5b8376 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AdvancedOperations/GetAdGroupBidModifiers.cs @@ -0,0 +1,122 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example illustrates how to retrieve ad group level mobile bid + /// modifiers for a campaign. + /// + /// Tags: AdGroupBidModifierService.get + /// + public class GetAdGroupBidModifiers : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAdGroupBidModifiers codeExample = new GetAdGroupBidModifiers(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve ad group level mobile bid " + + "modifiers for a campaign."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which ads are added. + /// + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupAdService. + AdGroupBidModifierService adGroupBidModifierService = + (AdGroupBidModifierService) user.GetService( + AdWordsService.v201402.AdGroupBidModifierService); + + const int PAGE_SIZE = 500; + + // Get all ad group bid modifiers for the campaign. + Selector selector = new Selector(); + selector.fields = new String[] {"CampaignId", "AdGroupId", "BidModifier", "BidModifierSource", + "CriteriaType", "Id"}; + + Predicate predicate = new Predicate(); + predicate.field = "CampaignId"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] {campaignId.ToString()}; + selector.predicates = new Predicate[] {predicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = PAGE_SIZE; + + AdGroupBidModifierPage page = new AdGroupBidModifierPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the campaigns. + page = adGroupBidModifierService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroupBidModifier adGroupBidModifier in page.entries) { + string bidModifier = (adGroupBidModifier.bidModifierSpecified)? + adGroupBidModifier.bidModifier.ToString() : "UNSET"; + Console.WriteLine("{0}) Campaign ID {1}, AdGroup ID {2}, Criterion ID {3} has " + + "ad group level modifier: {4} and source = {5}.", + i + 1, adGroupBidModifier.campaignId, + adGroupBidModifier.adGroupId, adGroupBidModifier.criterion.id, bidModifier, + adGroupBidModifier.bidModifierSource); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of adgroup bid modifiers found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve adgroup bid modifiers.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/AdvancedOperations/UploadOfflineConversions.cs b/examples/AdWords/CSharp/v201402/AdvancedOperations/UploadOfflineConversions.cs new file mode 100644 index 00000000000..59b44c9beca --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AdvancedOperations/UploadOfflineConversions.cs @@ -0,0 +1,139 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example imports offline conversion values for specific clicks to + /// your account. To get Google Click ID for a click, run + /// CLICK_PERFORMANCE_REPORT. + /// + /// Tags: ConversionTrackerService.mutate, OfflineConversionFeedService.mutate + /// + public class UploadOfflineConversions : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + string conversionName = "INSERT_CONVERSION_NAME_HERE"; + // GCLID needs to be newer than 30 days. + string gClId = "INSERT_GOOGLE_CLICK_ID_HERE"; + // The conversion time should be higher than the click time. + string conversionTime = "INSERT_CONVERSION_TIME_HERE"; + double conversionValue = double.Parse("INSERT_CONVERSION_VALUE_HERE"); + + UploadOfflineConversions codeExample = new UploadOfflineConversions(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser(), conversionName, gClId, conversionTime, conversionValue); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example imports offline conversion values for specific clicks to " + + "your account. To get Google Click ID for a click, run CLICK_PERFORMANCE_REPORT."; + } + } + + /// + /// Runs the specified user. + /// + /// The user. + /// The name of the upload conversion to be + /// created. + /// The Google Click ID of the click for which offline + /// conversions are uploaded. + /// The conversion value to be uploaded. + /// + /// The conversion time, in yyyymmdd hhmmss + /// format. + public void Run(AdWordsUser user, String conversionName, String gClid, String conversionTime, + double conversionValue) { + // Get the ConversionTrackerService. + ConversionTrackerService conversionTrackerService = + (ConversionTrackerService) user.GetService( + AdWordsService.v201402.ConversionTrackerService); + + // Get the OfflineConversionFeedService. + OfflineConversionFeedService offlineConversionFeedService = + (OfflineConversionFeedService) user.GetService( + AdWordsService.v201402.OfflineConversionFeedService); + + const int VIEWTHROUGH_LOOKBACK_WINDOW = 30; + const int CTC_LOOKBACK_WINDOW = 90; + + try { + // Create an upload conversion. Once created, this entry will be visible + // under Tools and Analysis->Conversion and will have "Source = Import". + UploadConversion uploadConversion = new UploadConversion(); + uploadConversion.category = ConversionTrackerCategory.PAGE_VIEW; + uploadConversion.name = conversionName; + uploadConversion.viewthroughLookbackWindow = VIEWTHROUGH_LOOKBACK_WINDOW; + uploadConversion.ctcLookbackWindow = CTC_LOOKBACK_WINDOW; + + ConversionTrackerOperation uploadConversionOperation = new ConversionTrackerOperation(); + uploadConversionOperation.@operator = Operator.ADD; + uploadConversionOperation.operand = uploadConversion; + + ConversionTrackerReturnValue conversionTrackerRetval = conversionTrackerService.mutate( + new ConversionTrackerOperation[] {uploadConversionOperation}); + + UploadConversion newUploadConversion = (UploadConversion) conversionTrackerRetval.value[0]; + + Console.WriteLine("New upload conversion type with name = '{0}' and id = {1} was created.", + newUploadConversion.name, newUploadConversion.id); + + // Associate offline conversions with the upload conversion we created. + OfflineConversionFeed feed = new OfflineConversionFeed(); + feed.conversionName = conversionName; + feed.conversionTime = conversionTime; + feed.conversionValue = conversionValue; + feed.googleClickId = gClid; + + OfflineConversionFeedOperation offlineConversionOperation = + new OfflineConversionFeedOperation(); + offlineConversionOperation.@operator = Operator.ADD; + offlineConversionOperation.operand = feed; + + OfflineConversionFeedReturnValue offlineConversionRetval = + offlineConversionFeedService.mutate( + new OfflineConversionFeedOperation[] {offlineConversionOperation}); + + OfflineConversionFeed newFeed = offlineConversionRetval.value[0]; + + Console.WriteLine("Uploaded offline conversion value of {0} for Google Click ID = " + + "'{1}' to '{2}'.", newFeed.conversionValue, newFeed.googleClickId, + newFeed.conversionName); + } catch (Exception ex) { + throw new System.ApplicationException("Failed upload offline conversions.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/AdvancedOperations/UseSharedBiddingStrategy.cs b/examples/AdWords/CSharp/v201402/AdvancedOperations/UseSharedBiddingStrategy.cs new file mode 100644 index 00000000000..74ddf2398e8 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/AdvancedOperations/UseSharedBiddingStrategy.cs @@ -0,0 +1,209 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example adds a Shared Bidding Strategy and uses it to construct + /// a campaign. + /// + /// Tags: BiddingStrategyService.mutate + /// Tags: BudgetService.mutate, CampaignService.mutate + /// + public class UseSharedBiddingStrategy : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UseSharedBiddingStrategy codeExample = new UseSharedBiddingStrategy(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a Shared Bidding Strategy and uses it to construct " + + "a campaign."; + } + } + + /// + /// Runs the specified code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the services. + BiddingStrategyService biddingStrategyService = (BiddingStrategyService) user.GetService( + AdWordsService.v201402.BiddingStrategyService); + + BudgetService budgetService = (BudgetService) user.GetService( + AdWordsService.v201402.BudgetService); + + CampaignService campaignService = (CampaignService) user.GetService( + AdWordsService.v201402.CampaignService); + + String BIDDINGSTRATEGY_NAME = "Maximize Clicks " + ExampleUtilities.GetRandomString(); + const long BID_CEILING = 2000000; + const long SPEND_TARGET = 20000000; + + String BUDGET_NAME = "Shared Interplanetary Budget #" + ExampleUtilities.GetRandomString(); + const long BUDGET_AMOUNT = 30000000; + + String CAMPAIGN_NAME = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString(); + + try { + SharedBiddingStrategy sharedBiddingStrategy = CreateBiddingStrategy(biddingStrategyService, + BIDDINGSTRATEGY_NAME, BID_CEILING, SPEND_TARGET); + Console.WriteLine("Shared bidding strategy with name '{0}' and ID {1} of type {2} was " + + "created.", sharedBiddingStrategy.name, sharedBiddingStrategy.id, + sharedBiddingStrategy.biddingScheme.BiddingSchemeType); + + Budget sharedBudget = CreateSharedBudget(budgetService, BUDGET_NAME, BUDGET_AMOUNT); + + Campaign newCampaign = CreateCampaignWithBiddingStrategy(campaignService, CAMPAIGN_NAME, + sharedBiddingStrategy.id, sharedBudget.budgetId); + + Console.WriteLine("Campaign with name '{0}', ID {1} and bidding scheme ID {2} was " + + "created.", newCampaign.name, newCampaign.id, + newCampaign.biddingStrategyConfiguration.biddingStrategyId); + + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create campaign that uses shared " + + "bidding strategy.", ex); + } + } + + /// + /// Creates the shared bidding strategy. + /// + /// The bidding strategy service. + /// The bidding strategy name. + /// The bid ceiling. + /// The spend target. + /// The bidding strategy object. + private SharedBiddingStrategy CreateBiddingStrategy( + BiddingStrategyService biddingStrategyService, String name, long bidCeiling, + long spendTarget) { + // Create a shared bidding strategy. + SharedBiddingStrategy sharedBiddingStrategy = new SharedBiddingStrategy(); + sharedBiddingStrategy.name = name; + + TargetSpendBiddingScheme biddingScheme = new TargetSpendBiddingScheme(); + // Optionally set additional bidding scheme parameters. + biddingScheme.bidCeiling = new Money(); + biddingScheme.bidCeiling.microAmount = bidCeiling; + + biddingScheme.spendTarget = new Money(); + biddingScheme.spendTarget.microAmount = spendTarget; + + sharedBiddingStrategy.biddingScheme = biddingScheme; + + // Create operation. + BiddingStrategyOperation operation = new BiddingStrategyOperation(); + operation.@operator = Operator.ADD; + operation.operand = sharedBiddingStrategy; + + return biddingStrategyService.mutate(new BiddingStrategyOperation[] {operation}).value[0]; + } + + /// + /// Creates an explicit budget to be used only to create the Campaign. + /// + /// The budget service. + /// The budget name. + /// The budget amount. + /// The budget object. + private Budget CreateSharedBudget(BudgetService budgetService, String name, long amount) { + // Create a shared budget + Budget budget = new Budget(); + budget.name = name; + budget.period = BudgetBudgetPeriod.DAILY; + budget.amount = new Money(); + budget.amount.microAmount = amount; + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + budget.isExplicitlyShared = true; + + // Create operation. + BudgetOperation operation = new BudgetOperation(); + operation.operand = budget; + operation.@operator = Operator.ADD; + + // Make the mutate request. + return budgetService.mutate(new BudgetOperation[] {operation}).value[0]; + } + + /// + /// Creates the campaign with a shared bidding strategy. + /// + /// The campaign service. + /// The campaign name. + /// The bidding strategy id. + /// The shared budget id. + /// The campaign object. + private Campaign CreateCampaignWithBiddingStrategy(CampaignService campaignService, string name, + long biddingStrategyId, long sharedBudgetId) { + // Create campaign. + Campaign campaign = new Campaign(); + campaign.name = name; + campaign.advertisingChannelType = AdvertisingChannelType.SEARCH; + + // Set the budget. + campaign.budget = new Budget(); + campaign.budget.budgetId = sharedBudgetId; + + // Set bidding strategy (required). + BiddingStrategyConfiguration biddingStrategyConfiguration = + new BiddingStrategyConfiguration(); + biddingStrategyConfiguration.biddingStrategyId = biddingStrategyId; + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration; + + // Set keyword matching setting (required). + KeywordMatchSetting keywordMatchSetting = new KeywordMatchSetting(); + keywordMatchSetting.optIn = true; + campaign.settings = new Setting[] {keywordMatchSetting}; + + // Set network targeting (recommended). + NetworkSetting networkSetting = new NetworkSetting(); + networkSetting.targetGoogleSearch = true; + networkSetting.targetSearchNetwork = true; + networkSetting.targetContentNetwork = true; + campaign.networkSetting = networkSetting; + + // Create operation. + CampaignOperation operation = new CampaignOperation(); + operation.operand = campaign; + operation.@operator = Operator.ADD; + + return campaignService.mutate(new CampaignOperation[] {operation}).value[0]; + } + } +} diff --git a/examples/AdWords/CSharp/v201402/BasicOperations/AddAdGroupDemographicCriteria.cs b/examples/AdWords/CSharp/v201402/BasicOperations/AddAdGroupDemographicCriteria.cs new file mode 100644 index 00000000000..9c171b48ba7 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/BasicOperations/AddAdGroupDemographicCriteria.cs @@ -0,0 +1,123 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example adds demographic target criteria to an ad group. To get + /// ad groups, run AddAdGroup.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class AddAdGroupDemographicCriteria : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAdGroupDemographicCriteria codeExample = new AddAdGroupDemographicCriteria(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds demographic target criteria to an ad group. To get ad " + + "groups, run AddAdGroup.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which criteria are + /// added. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201402.AdGroupCriterionService); + + // Create biddable ad group criterion for gender + Gender genderTarget = new Gender(); + // Criterion Id for male. The IDs can be found here + // https://developers.google.com/adwords/api/docs/appendix/genders + genderTarget.id = 10; + + BiddableAdGroupCriterion genderBiddableAdGroupCriterion = new BiddableAdGroupCriterion(); + genderBiddableAdGroupCriterion.adGroupId = adGroupId; + genderBiddableAdGroupCriterion.criterion = genderTarget; + + // Create negative ad group criterion for age range + AgeRange ageRangeNegative = new AgeRange(); + // Criterion Id for age 18 to 24. The IDs can be found here + // https://developers.google.com/adwords/api/docs/appendix/ages + + ageRangeNegative.id = 503001; + NegativeAdGroupCriterion ageRangeNegativeAdGroupCriterion = new NegativeAdGroupCriterion(); + ageRangeNegativeAdGroupCriterion.adGroupId = adGroupId; + ageRangeNegativeAdGroupCriterion.criterion = ageRangeNegative; + + // Create operations. + AdGroupCriterionOperation genderBiddableAdGroupCriterionOperation = + new AdGroupCriterionOperation(); + genderBiddableAdGroupCriterionOperation.operand = genderBiddableAdGroupCriterion; + genderBiddableAdGroupCriterionOperation.@operator = Operator.ADD; + + AdGroupCriterionOperation ageRangeNegativeAdGroupCriterionOperation = + new AdGroupCriterionOperation(); + ageRangeNegativeAdGroupCriterionOperation.operand = ageRangeNegativeAdGroupCriterion; + ageRangeNegativeAdGroupCriterionOperation.@operator = Operator.ADD; + + AdGroupCriterionOperation[] operations = new AdGroupCriterionOperation[] { + genderBiddableAdGroupCriterionOperation, ageRangeNegativeAdGroupCriterionOperation}; + + try { + // Add ad group criteria. + AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations); + + // Display ad group criteria. + if (result != null && result.value != null) { + foreach (AdGroupCriterion adGroupCriterionResult in result.value) { + Console.WriteLine("Ad group criterion with ad group id \"{0}\", criterion id " + + "\"{1}\", and type \"{2}\" was added.", adGroupCriterionResult.adGroupId, + adGroupCriterionResult.criterion.id, + adGroupCriterionResult.criterion.CriterionType); + } + } else { + Console.WriteLine("No ad group criteria were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create ad group criteria.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/BasicOperations/AddAdGroups.cs b/examples/AdWords/CSharp/v201402/BasicOperations/AddAdGroups.cs new file mode 100644 index 00000000000..a6f215a7578 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/BasicOperations/AddAdGroups.cs @@ -0,0 +1,137 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example illustrates how to create ad groups. To create + /// campaigns, run AddCampaigns.cs. + /// + /// Tags: AdGroupService.mutate + /// + public class AddAdGroups : ExampleBase { + /// + /// Number of items being added / updated in this code example. + /// + const int NUM_ITEMS = 5; + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAdGroups codeExample = new AddAdGroups(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create ad groups. To create campaigns, " + + "run AddCampaigns.cs"; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to which ad groups are + /// added. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201402.AdGroupService); + + List operations = new List(); + + for (int i = 0; i < NUM_ITEMS; i++) { + // Create the ad group. + AdGroup adGroup = new AdGroup(); + adGroup.name = string.Format("Earth to Mars Cruises #{0}", + ExampleUtilities.GetRandomString()); + adGroup.status = AdGroupStatus.ENABLED; + adGroup.campaignId = campaignId; + + // Set the ad group bids. + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + + CpcBid cpcBid = new CpcBid(); + cpcBid.bid = new Money(); + cpcBid.bid.microAmount = 10000000; + + biddingConfig.bids = new Bids[] {cpcBid}; + + adGroup.biddingStrategyConfiguration = biddingConfig; + + // Optional: Set targeting restrictions. + // These setting only affect serving for the Display Network. + TargetingSetting targetingSetting = new TargetingSetting(); + + TargetingSettingDetail placementDetail = new TargetingSettingDetail(); + placementDetail.criterionTypeGroup = CriterionTypeGroup.PLACEMENT; + placementDetail.targetAll = true; + + TargetingSettingDetail verticalDetail = new TargetingSettingDetail(); + verticalDetail.criterionTypeGroup = CriterionTypeGroup.VERTICAL; + verticalDetail.targetAll = false; + + targetingSetting.details = new TargetingSettingDetail[] {placementDetail, verticalDetail}; + + adGroup.settings = new Setting[] {targetingSetting}; + + // Create the operation. + AdGroupOperation operation = new AdGroupOperation(); + operation.@operator = Operator.ADD; + operation.operand = adGroup; + + operations.Add(operation); + } + + try { + // Create the ad group. + AdGroupReturnValue retVal = adGroupService.mutate(operations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + foreach (AdGroup newAdGroup in retVal.value) { + Console.WriteLine("Ad group with id = '{0}' and name = '{1}' was created.", + newAdGroup.id, newAdGroup.name); + } + } else { + Console.WriteLine("No ad groups were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create ad groups.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/BasicOperations/AddCampaigns.cs b/examples/AdWords/CSharp/v201402/BasicOperations/AddCampaigns.cs new file mode 100644 index 00000000000..c51d9d27086 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/BasicOperations/AddCampaigns.cs @@ -0,0 +1,168 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example adds campaigns. To get campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignService.mutate + /// + public class AddCampaigns : ExampleBase { + /// + /// Number of items being added / updated in this code example. + /// + const int NUM_ITEMS = 5; + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddCampaigns codeExample = new AddCampaigns(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds campaigns. To get campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the BudgetService. + BudgetService budgetService = + (BudgetService) user.GetService(AdWordsService.v201402.BudgetService); + + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201402.CampaignService); + + // Create the campaign budget. + Budget budget = new Budget(); + budget.name = "Interplanetary Cruise Budget #" + ExampleUtilities.GetRandomString(); + budget.period = BudgetBudgetPeriod.DAILY; + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + budget.amount = new Money(); + budget.amount.microAmount = 500000; + + BudgetOperation budgetOperation = new BudgetOperation(); + budgetOperation.@operator = Operator.ADD; + budgetOperation.operand = budget; + + try { + BudgetReturnValue budgetRetval = budgetService.mutate(new BudgetOperation[] {budgetOperation}); + budget = budgetRetval.value[0]; + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add shared budget.", ex); + } + + List operations = new List(); + + for (int i = 0; i < NUM_ITEMS; i++) { + // Create the campaign. + Campaign campaign = new Campaign(); + campaign.name = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString(); + campaign.status = CampaignStatus.PAUSED; + campaign.advertisingChannelType = AdvertisingChannelType.SEARCH; + + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + biddingConfig.biddingStrategyType = BiddingStrategyType.MANUAL_CPC; + campaign.biddingStrategyConfiguration = biddingConfig; + + campaign.budget = new Budget(); + campaign.budget.budgetId = budget.budgetId; + + // Set the campaign network options. + campaign.networkSetting = new NetworkSetting(); + campaign.networkSetting.targetGoogleSearch = true; + campaign.networkSetting.targetSearchNetwork = true; + campaign.networkSetting.targetContentNetwork = false; + campaign.networkSetting.targetPartnerSearchNetwork = false; + + // Set the campaign settings for Advanced location options. + GeoTargetTypeSetting geoSetting = new GeoTargetTypeSetting(); + geoSetting.positiveGeoTargetType = GeoTargetTypeSettingPositiveGeoTargetType.DONT_CARE; + geoSetting.negativeGeoTargetType = GeoTargetTypeSettingNegativeGeoTargetType.DONT_CARE; + + // Set the campaign settings for near-exact and near-phrase matches. + KeywordMatchSetting keywordSetting = new KeywordMatchSetting(); + keywordSetting.optIn = false; + + campaign.settings = new Setting[] {geoSetting, keywordSetting}; + + // Optional: Set the start date. + campaign.startDate = DateTime.Now.AddDays(1).ToString("yyyyMMdd"); + + // Optional: Set the end date. + campaign.endDate = DateTime.Now.AddYears(1).ToString("yyyyMMdd"); + + // Optional: Set the campaign ad serving optimization status. + campaign.adServingOptimizationStatus = AdServingOptimizationStatus.ROTATE; + + // Optional: Set the frequency cap. + FrequencyCap frequencyCap = new FrequencyCap(); + frequencyCap.impressions = 5; + frequencyCap.level = Level.ADGROUP; + frequencyCap.timeUnit = TimeUnit.DAY; + campaign.frequencyCap = frequencyCap; + + // Create the operation. + CampaignOperation operation = new CampaignOperation(); + operation.@operator = Operator.ADD; + operation.operand = campaign; + + operations.Add(operation); + } + + try { + // Add the campaign. + CampaignReturnValue retVal = campaignService.mutate(operations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + foreach (Campaign newCampaign in retVal.value) { + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was added.", + newCampaign.name, newCampaign.id); + } + } else { + Console.WriteLine("No campaigns were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add campaigns.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/BasicOperations/AddKeywords.cs b/examples/AdWords/CSharp/v201402/BasicOperations/AddKeywords.cs new file mode 100644 index 00000000000..5e3e18a5168 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/BasicOperations/AddKeywords.cs @@ -0,0 +1,127 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example adds a keyword to an ad group. To get ad groups, run + /// GetAdGroups.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class AddKeywords : ExampleBase { + /// + /// Number of items being added / updated in this code example. + /// + const int NUM_ITEMS = 5; + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddKeywords codeExample = new AddKeywords(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a keyword to an ad group. To get ad groups, run " + + "GetAdGroups.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which keywords are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService( + AdWordsService.v201402.AdGroupCriterionService); + + List operations = new List(); + + for (int i = 0; i < NUM_ITEMS; i++) { + // Create the keyword. + Keyword keyword = new Keyword(); + keyword.text = "mars cruise"; + keyword.matchType = KeywordMatchType.BROAD; + + // Create the biddable ad group criterion. + BiddableAdGroupCriterion keywordCriterion = new BiddableAdGroupCriterion(); + keywordCriterion.adGroupId = adGroupId; + keywordCriterion.criterion = keyword; + + // Optional: Set the user status. + keywordCriterion.userStatus = UserStatus.PAUSED; + + // Optional: Set the keyword destination url. + keywordCriterion.destinationUrl = "http://example.com/mars/cruise/" + i; + + // Create the operations. + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.@operator = Operator.ADD; + operation.operand = keywordCriterion; + + operations.Add(operation); + } + try { + // Create the keywords. + AdGroupCriterionReturnValue retVal = adGroupCriterionService.mutate(operations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null) { + foreach (AdGroupCriterion adGroupCriterion in retVal.value) { + // If you are adding multiple type of criteria, then you may need to + // check for + // + // if (adGroupCriterion is Keyword) { ... } + // + // to identify the criterion type. + Console.WriteLine("Keyword with ad group id = '{0}', keyword id = '{1}', text = " + + "'{2}' and match type = '{3}' was created.", adGroupCriterion.adGroupId, + adGroupCriterion.criterion.id, (adGroupCriterion.criterion as Keyword).text, + (adGroupCriterion.criterion as Keyword).matchType); + } + } else { + Console.WriteLine("No keywords were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create keywords.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/BasicOperations/AddTextAds.cs b/examples/AdWords/CSharp/v201402/BasicOperations/AddTextAds.cs new file mode 100644 index 00000000000..a1eeaf9f9ca --- /dev/null +++ b/examples/AdWords/CSharp/v201402/BasicOperations/AddTextAds.cs @@ -0,0 +1,129 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example adds text ads to a given ad group. To list ad groups, + /// run GetAdGroups.cs. To learn how to handle policy violations and add + /// exemption requests, see HandlePolicyViolationError.cs. + /// + /// Tags: AdGroupAdService.mutate + /// + public class AddTextAds : ExampleBase { + /// + /// Number of items being added / updated in this code example. + /// + const int NUM_ITEMS = 5; + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddTextAds codeExample = new AddTextAds(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds text ads to a given ad group. To list ad groups, run " + + "GetAdGroups.cs. To learn how to handle policy violations and add exemption " + + "requests, see HandlePolicyViolationError.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which ads are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201402.AdGroupAdService); + + List operations = new List(); + + for (int i = 0; i < NUM_ITEMS; i++) { + // Create the text ad. + TextAd textAd = new TextAd(); + textAd.headline = "Luxury Cruise to Mars"; + textAd.description1 = "Visit the Red Planet in style."; + textAd.description2 = "Low-gravity fun for everyone!"; + textAd.displayUrl = "www.example.com"; + textAd.url = "http://www.example.com/" + i; + + AdGroupAd textAdGroupAd = new AdGroupAd(); + textAdGroupAd.adGroupId = adGroupId; + textAdGroupAd.ad = textAd; + + // Optional: Set the status. + textAdGroupAd.status = AdGroupAdStatus.PAUSED; + + // Create the operation. + AdGroupAdOperation operation = new AdGroupAdOperation(); + operation.@operator = Operator.ADD; + operation.operand = textAdGroupAd; + + operations.Add(operation); + } + + AdGroupAdReturnValue retVal = null; + + try { + // Create the ads. + retVal = service.mutate(operations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null) { + // If you are adding multiple type of Ads, then you may need to check + // for + // + // if (adGroupAd.ad is TextAd) { ... } + // + // to identify the ad type. + foreach (AdGroupAd adGroupAd in retVal.value) { + Console.WriteLine("New text ad with id = \"{0}\" and displayUrl = \"{1}\" was created.", + adGroupAd.ad.id, adGroupAd.ad.displayUrl); + } + } else { + Console.WriteLine("No text ads were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create text ad.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/BasicOperations/DeleteAd.cs b/examples/AdWords/CSharp/v201402/BasicOperations/DeleteAd.cs new file mode 100644 index 00000000000..c25e208901e --- /dev/null +++ b/examples/AdWords/CSharp/v201402/BasicOperations/DeleteAd.cs @@ -0,0 +1,103 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example deletes an ad using the 'REMOVE' operator. To list ads, + /// run GetTextAds.cs. + /// + /// Tags: AdGroupAdService.mutate + /// + public class DeleteAd : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DeleteAd codeExample = new DeleteAd(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long adId = long.Parse("INSERT_AD_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, adId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deletes an ad using the 'REMOVE' operator. To list ads, " + + "run GetTextAds.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the ad. + /// Id of the ad being deleted. + public void Run(AdWordsUser user, long adGroupId, long adId) { + // Get the AdGroupAdService. + AdGroupAdService adGroupAdService = (AdGroupAdService) user.GetService( + AdWordsService.v201402.AdGroupAdService); + + // Since we do not need to update any ad-specific fields, it is enough to + // create the base type. + Ad ad = new Ad(); + ad.id = adId; + + // Create the ad group ad. + AdGroupAd adGroupAd = new AdGroupAd(); + adGroupAd.adGroupId = adGroupId; + + adGroupAd.ad = ad; + + // Create the operation. + AdGroupAdOperation operation = new AdGroupAdOperation(); + operation.operand = adGroupAd; + operation.@operator = Operator.REMOVE; + + try { + // Delete the ad. + AdGroupAdReturnValue retVal = adGroupAdService.mutate( + new AdGroupAdOperation[] {operation}); + + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupAd deletedAdGroupAd = retVal.value[0]; + Console.WriteLine("Ad with id = \"{0}\" and type = \"{1}\" was deleted.", + deletedAdGroupAd.ad.id, deletedAdGroupAd.ad.AdType); + } else { + Console.WriteLine("No ads were deleted."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to delete ad.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/BasicOperations/DeleteAdGroup.cs b/examples/AdWords/CSharp/v201402/BasicOperations/DeleteAdGroup.cs new file mode 100644 index 00000000000..ecdec8a25db --- /dev/null +++ b/examples/AdWords/CSharp/v201402/BasicOperations/DeleteAdGroup.cs @@ -0,0 +1,99 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example deletes an ad group by setting the status to 'DELETED'. + /// To get ad groups, run GetAdGroups.cs. + /// + /// Tags: AdGroupService.mutate + /// + public class DeleteAdGroup : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DeleteAdGroup codeExample = new DeleteAdGroup(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deletes an ad group by setting the status to 'DELETED'. " + + "To get ad groups, run GetAdGroups.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to be deleted. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupService. + AdGroupService adGroupService = (AdGroupService) user.GetService( + AdWordsService.v201402.AdGroupService); + + // Create ad group with DELETED status. + AdGroup adGroup = new AdGroup(); + adGroup.id = adGroupId; + + // When deleting an ad group, rename it to avoid name collisions with new + // adgroups. + adGroup.name = "Deleted AdGroup - " + ExampleUtilities.GetRandomString(); + adGroup.status = AdGroupStatus.DELETED; + + // Create the operation. + AdGroupOperation operation = new AdGroupOperation(); + operation.operand = adGroup; + operation.@operator = Operator.SET; + + try { + // Delete the ad group. + AdGroupReturnValue retVal = adGroupService.mutate(new AdGroupOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroup deletedAdGroup = retVal.value[0]; + Console.WriteLine("Ad group with id = \"{0}\" was renamed to \"{1}\" and deleted.", + deletedAdGroup.id, deletedAdGroup.name); + } else { + Console.WriteLine("No ad groups were deleted."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to delete ad group.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/BasicOperations/DeleteCampaign.cs b/examples/AdWords/CSharp/v201402/BasicOperations/DeleteCampaign.cs new file mode 100644 index 00000000000..05f1b58c6f0 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/BasicOperations/DeleteCampaign.cs @@ -0,0 +1,99 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example deletes a campaign by setting the status to 'DELETED'. + /// To get campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignService.mutate + /// + public class DeleteCampaign : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DeleteCampaign codeExample = new DeleteCampaign(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deletes a campaign by setting the status to 'DELETED'. " + + "To get campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to be deleted. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignService. + CampaignService campaignService = (CampaignService) user.GetService( + AdWordsService.v201402.CampaignService); + + // Create campaign with DELETED status. + Campaign campaign = new Campaign(); + campaign.id = campaignId; + + // When deleting a campaign, rename it to avoid name collisions with new + // campaigns. + campaign.name = "Deleted Campaign - " + ExampleUtilities.GetRandomString(); + campaign.status = CampaignStatus.DELETED; + + // Create the operation. + CampaignOperation operation = new CampaignOperation(); + operation.operand = campaign; + operation.@operator = Operator.SET; + + try { + // Delete the campaign. + CampaignReturnValue retVal = campaignService.mutate(new CampaignOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + Campaign deletedCampaign = retVal.value[0]; + Console.WriteLine("Campaign with id = \"{0}\" was renamed to \"{1}\" and deleted.", + deletedCampaign.id, deletedCampaign.name); + } else { + Console.WriteLine("No campaigns were deleted."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to delete campaign.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/BasicOperations/DeleteKeyword.cs b/examples/AdWords/CSharp/v201402/BasicOperations/DeleteKeyword.cs new file mode 100644 index 00000000000..32a5ddbf669 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/BasicOperations/DeleteKeyword.cs @@ -0,0 +1,103 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example deletes a keyword using the 'REMOVE' operator. To get + /// keywords, run GetKeywords.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class DeleteKeyword : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DeleteKeyword codeExample = new DeleteKeyword(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long keywordId = long.Parse("INSERT_KEYWORD_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, keywordId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deletes a keyword using the 'REMOVE' operator. To get " + + "keywords, run GetKeywords.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the keyword. + /// + /// Id of the keyword to be deleted. + public void Run(AdWordsUser user, long adGroupId, long keywordId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = (AdGroupCriterionService)user.GetService( + AdWordsService.v201402.AdGroupCriterionService); + + // Create base class criterion to avoid setting keyword-specific fields. + Criterion criterion = new Criterion(); + criterion.id = keywordId; + + // Create the ad group criterion. + BiddableAdGroupCriterion adGroupCriterion = new BiddableAdGroupCriterion(); + adGroupCriterion.adGroupId = adGroupId; + adGroupCriterion.criterion = criterion; + + // Create the operation. + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.operand = adGroupCriterion; + operation.@operator = Operator.REMOVE; + + try { + // Delete the keyword. + AdGroupCriterionReturnValue retVal = adGroupCriterionService.mutate( + new AdGroupCriterionOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupCriterion deletedKeyword = retVal.value[0]; + Console.WriteLine("Keyword with ad group id = \"{0}\" and id = \"{1}\" was deleted.", + deletedKeyword.adGroupId, deletedKeyword.criterion.id); + } else { + Console.WriteLine("No keywords were deleted."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to delete keyword.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/BasicOperations/GetAdGroups.cs b/examples/AdWords/CSharp/v201402/BasicOperations/GetAdGroups.cs new file mode 100644 index 00000000000..951e5cfd23c --- /dev/null +++ b/examples/AdWords/CSharp/v201402/BasicOperations/GetAdGroups.cs @@ -0,0 +1,113 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example illustrates how to retrieve all the ad groups for a + /// campaign. To create an ad group, run AddAdGroup.cs. + /// + /// Tags: AdGroupService.get + /// + public class GetAdGroups : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAdGroups codeExample = new GetAdGroups(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve all the ad groups for a " + + "campaign. To create an ad group, run AddAdGroup.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign for which ad groups are + /// retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201402.AdGroupService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Name"}; + + // Create the filters. + Predicate predicate = new Predicate(); + predicate.field = "CampaignId"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] {campaignId.ToString()}; + selector.predicates = new Predicate[] {predicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupPage page = new AdGroupPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the ad groups. + page = adGroupService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroup adGroup in page.entries) { + Console.WriteLine("{0}) Ad group name is '{1}' and id is {2}.", i + 1, adGroup.name, + adGroup.id); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of ad groups found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve ad groups.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/BasicOperations/GetCampaigns.cs b/examples/AdWords/CSharp/v201402/BasicOperations/GetCampaigns.cs new file mode 100644 index 00000000000..3a484455ce0 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/BasicOperations/GetCampaigns.cs @@ -0,0 +1,102 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example lists all campaigns. To add a campaign, run + /// AddCampaign.cs. + /// + /// Tags: CampaignService.get + /// + public class GetCampaigns : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetCampaigns codeExample = new GetCampaigns(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example lists all campaigns. To add a campaign, run AddCampaign.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201402.CampaignService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Name", "Status"}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + CampaignPage page = new CampaignPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the campaigns. + page = campaignService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (Campaign campaign in page.entries) { + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = '{3}'" + + " was found.", i + 1, campaign.id, campaign.name, campaign.status); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve campaigns", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/BasicOperations/GetCampaignsWithAwql.cs b/examples/AdWords/CSharp/v201402/BasicOperations/GetCampaignsWithAwql.cs new file mode 100644 index 00000000000..78e8b058b28 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/BasicOperations/GetCampaignsWithAwql.cs @@ -0,0 +1,100 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example lists all campaigns using an AWQL query. See + /// https://developers.google.com/adwords/api/docs/guides/awql for AWQL + /// documentation. To add a campaign, run AddCampaign.cs. + /// + /// Tags: CampaignService.get + /// + public class GetCampaignsWithAwql : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetCampaignsWithAwql codeExample = new GetCampaignsWithAwql(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example lists all campaigns using an AWQL query. See " + + "https://developers.google.com/adwords/api/docs/guides/awql for AWQL documentation. " + + "To add a campaign, run AddCampaign.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201402.CampaignService); + + // Create the query. + string query = "SELECT Id, Name, Status ORDER BY Name"; + + int offset = 0; + int pageSize = 500; + + CampaignPage page = new CampaignPage(); + + try { + do { + string queryWithPaging = string.Format("{0} LIMIT {1}, {2}", query, offset, pageSize); + + // Get the campaigns. + page = campaignService.query(queryWithPaging); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (Campaign campaign in page.entries) { + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = '{3}'" + + " was found.", i + 1, campaign.id, campaign.name, campaign.status); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve campaigns", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/BasicOperations/GetKeywords.cs b/examples/AdWords/CSharp/v201402/BasicOperations/GetKeywords.cs new file mode 100644 index 00000000000..842c62696d5 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/BasicOperations/GetKeywords.cs @@ -0,0 +1,127 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example gets all keywords in an account. To add keywords, run + /// AddKeywords.cs. + /// + /// Tags: AdGroupCriterionService.get + /// + public class GetKeywords : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetKeywords codeExample = new GetKeywords(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all keywords in an account. To add keywords, run " + + "AddKeywords.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201402.AdGroupCriterionService); + + // Create a selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "AdGroupId", "KeywordText"}; + + // Select only keywords. + Predicate predicate = new Predicate(); + predicate.field = "CriteriaType"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] {"KEYWORD"}; + selector.predicates = new Predicate[] {predicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupCriterionPage page = new AdGroupCriterionPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the keywords. + page = adGroupCriterionService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + + foreach (AdGroupCriterion adGroupCriterion in page.entries) { + bool isNegative = (adGroupCriterion is NegativeAdGroupCriterion); + + // If you are retrieving multiple type of criteria, then you may + // need to check for + // + // if (adGroupCriterion is Keyword) { ... } + // + // to identify the criterion type. + Keyword keyword = (Keyword) adGroupCriterion.criterion; + if (isNegative) { + Console.WriteLine("{0}) Negative keyword with ad group ID = '{1}', keyword ID " + + "= '{2}', and text = '{3}' was found.", i + 1, adGroupCriterion.adGroupId, + keyword.id, keyword.text); + } else { + Console.WriteLine("{0}) Keyword with ad group ID = '{1}', keyword ID = '{2}', " + + "text = '{3}' and matchType = '{4} was found.", i + 1, + adGroupCriterion.adGroupId, keyword.id, keyword.text, keyword.matchType); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of keywords found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve keywords.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/BasicOperations/GetTextAds.cs b/examples/AdWords/CSharp/v201402/BasicOperations/GetTextAds.cs new file mode 100644 index 00000000000..b0121ef403c --- /dev/null +++ b/examples/AdWords/CSharp/v201402/BasicOperations/GetTextAds.cs @@ -0,0 +1,140 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example retrieves all text ads given an existing ad group. + /// To add text ads to an existing ad group, run AddTextAds.cs. + /// + /// Tags: AdGroupAdService.get + /// + public class GetTextAds : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetTextAds codeExample = new GetTextAds(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves all text ads given an existing ad group. To add " + + "text ads to an existing ad group, run AddTextAds.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group from which text ads are + /// retrieved. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201402.AdGroupAdService); + + // Create a selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Status", "Headline", "Description1", "Description2", + "DisplayUrl"}; + + // Set the sort order. + OrderBy orderBy = new OrderBy(); + orderBy.field = "Id"; + orderBy.sortOrder = SortOrder.ASCENDING; + selector.ordering = new OrderBy[] {orderBy}; + + // Restrict the fetch to only the selected ad group id. + Predicate adGroupPredicate = new Predicate(); + adGroupPredicate.field = "AdGroupId"; + adGroupPredicate.@operator = PredicateOperator.EQUALS; + adGroupPredicate.values = new string[] {adGroupId.ToString()}; + + // Retrieve only text ads. + Predicate typePredicate = new Predicate(); + typePredicate.field = "AdType"; + typePredicate.@operator = PredicateOperator.EQUALS; + typePredicate.values = new string[] {"TEXT_AD"}; + + // By default disabled ads aren't returned by the selector. To return + // them include the DISABLED status in the statuses field. + Predicate statusPredicate = new Predicate(); + statusPredicate.field = "Status"; + statusPredicate.@operator = PredicateOperator.IN; + + statusPredicate.values = new string[] {AdGroupAdStatus.ENABLED.ToString(), + AdGroupAdStatus.PAUSED.ToString(), AdGroupAdStatus.DISABLED.ToString()}; + + selector.predicates = new Predicate[] {adGroupPredicate, statusPredicate, typePredicate}; + + // Select the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupAdPage page = new AdGroupAdPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the text ads. + page = service.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + + foreach (AdGroupAd adGroupAd in page.entries) { + TextAd textAd = (TextAd) adGroupAd.ad; + Console.WriteLine("{0}) Ad id is {1} and status is {2}", i + 1, textAd.id, + adGroupAd.status); + Console.WriteLine(" {0}\n {1}\n {2}\n {3}", textAd.headline, + textAd.description1, textAd.description2, textAd.displayUrl); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of text ads found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get text ads", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/BasicOperations/PauseAd.cs b/examples/AdWords/CSharp/v201402/BasicOperations/PauseAd.cs new file mode 100644 index 00000000000..65d58ec169b --- /dev/null +++ b/examples/AdWords/CSharp/v201402/BasicOperations/PauseAd.cs @@ -0,0 +1,101 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example pauses a given ad. To list all ads, run GetTextAds.cs. + /// + /// Tags: AdGroupAdService.mutate + /// + public class PauseAd : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + PauseAd codeExample = new PauseAd(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long adId = long.Parse("INSERT_AD_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, adId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example pauses a given ad. To list all ads, run GetTextAds.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the ad. + /// + /// Id of the ad to be paused. + public void Run(AdWordsUser user, long adGroupId, long adId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201402.AdGroupAdService); + + AdGroupAdStatus status = AdGroupAdStatus.PAUSED; + + // Create the ad group ad. + AdGroupAd adGroupAd = new AdGroupAd(); + adGroupAd.status = status; + adGroupAd.adGroupId = adGroupId; + + adGroupAd.ad = new Ad(); + adGroupAd.ad.id = adId; + + // Create the operation. + AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation(); + adGroupAdOperation.@operator = Operator.SET; + adGroupAdOperation.operand = adGroupAd; + + try { + // Update the ad. + AdGroupAdReturnValue retVal = service.mutate(new AdGroupAdOperation[]{adGroupAdOperation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupAd pausedAdGroupAd = retVal.value[0]; + Console.WriteLine("Ad with id \"{0}\" and ad group id \"{1}\"was paused.", + pausedAdGroupAd.ad.id, pausedAdGroupAd.adGroupId); + } else { + Console.WriteLine("No ads were paused."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to pause ad.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/BasicOperations/UpdateAdGroup.cs b/examples/AdWords/CSharp/v201402/BasicOperations/UpdateAdGroup.cs new file mode 100644 index 00000000000..f86feff116e --- /dev/null +++ b/examples/AdWords/CSharp/v201402/BasicOperations/UpdateAdGroup.cs @@ -0,0 +1,95 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example illustrates how to update an ad group, setting its + /// status to 'PAUSED'. To create an ad group, run AddAdGroup.cs. + /// + /// Tags: AdGroupService.mutate + /// + public class UpdateAdGroup : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdateAdGroup codeExample = new UpdateAdGroup(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to update an ad group, setting its status to " + + "'PAUSED'. To create an ad group, run AddAdGroup.cs"; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to be updated. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201402.AdGroupService); + + // Create the ad group. + AdGroup adGroup = new AdGroup(); + adGroup.status = AdGroupStatus.PAUSED; + adGroup.id = adGroupId; + + // Create the operation. + AdGroupOperation operation = new AdGroupOperation(); + operation.@operator = Operator.SET; + operation.operand = adGroup; + + try { + // Update the ad group. + AdGroupReturnValue retVal = adGroupService.mutate(new AdGroupOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroup pausedAdGroup = retVal.value[0]; + Console.WriteLine("Ad group with id = '{0}' was successfully updated.", + pausedAdGroup.id); + } else { + Console.WriteLine("No ad groups were updated."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update ad group.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/BasicOperations/UpdateCampaign.cs b/examples/AdWords/CSharp/v201402/BasicOperations/UpdateCampaign.cs new file mode 100644 index 00000000000..13f48b566ad --- /dev/null +++ b/examples/AdWords/CSharp/v201402/BasicOperations/UpdateCampaign.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example updates a campaign. To get campaigns, run + /// GetCampaigns.cs. + /// + /// Tags: CampaignService.mutate + /// + public class UpdateCampaign : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdateCampaign codeExample = new UpdateCampaign(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a campaign. To get campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to be updated. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService)user.GetService(AdWordsService.v201402.CampaignService); + + // Create the campaign. + Campaign campaign = new Campaign(); + campaign.id = campaignId; + campaign.status = CampaignStatus.PAUSED; + + // Create the operation. + CampaignOperation operation = new CampaignOperation(); + operation.@operator = Operator.SET; + operation.operand = campaign; + + try { + // Update the campaign. + CampaignReturnValue retVal = campaignService.mutate((new CampaignOperation[] {operation})); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + Campaign updatedCampaign = retVal.value[0]; + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was updated.", + updatedCampaign.name, updatedCampaign.id); + } else { + Console.WriteLine("No campaigns were updated."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update campaign.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/BasicOperations/UpdateKeyword.cs b/examples/AdWords/CSharp/v201402/BasicOperations/UpdateKeyword.cs new file mode 100644 index 00000000000..c773dc42683 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/BasicOperations/UpdateKeyword.cs @@ -0,0 +1,123 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example updates the bid of a keyword. To get keyword, run + /// GetKeywords.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class UpdateKeyword : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdateKeyword codeExample = new UpdateKeyword(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long keywordId = long.Parse("INSERT_KEYWORD_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, keywordId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the bid of a keyword. To get keyword, run " + + "GetKeywords.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the keyword. + /// + /// Id of the keyword to be updated. + public void Run(AdWordsUser user, long adGroupId, long keywordId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201402.AdGroupCriterionService); + + // Since we are not updating any keyword-specific fields, it is enough to + // create a criterion object. + Criterion criterion = new Criterion(); + criterion.id = keywordId; + + // Create ad group criterion. + BiddableAdGroupCriterion biddableAdGroupCriterion = new BiddableAdGroupCriterion(); + biddableAdGroupCriterion.adGroupId = adGroupId; + biddableAdGroupCriterion.criterion = criterion; + + // Create the bids. + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + CpcBid cpcBid = new CpcBid(); + cpcBid.bid = new Money(); + cpcBid.bid.microAmount = 1000000; + biddingConfig.bids = new Bids[] {cpcBid}; + + biddableAdGroupCriterion.biddingStrategyConfiguration = biddingConfig; + + // Create the operation. + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.@operator = Operator.SET; + operation.operand = biddableAdGroupCriterion; + + try { + // Update the keyword. + AdGroupCriterionReturnValue retVal = + adGroupCriterionService.mutate(new AdGroupCriterionOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupCriterion adGroupCriterion = retVal.value[0]; + long bidAmount = 0; + foreach (Bids bids in (adGroupCriterion as BiddableAdGroupCriterion). + biddingStrategyConfiguration.bids) { + if (bids is CpcBid) { + bidAmount = (bids as CpcBid).bid.microAmount; + break; + } + } + + Console.WriteLine("Keyword with ad group id = '{0}', id = '{1}' was updated with " + + "bid amount = '{2}' micros.", adGroupCriterion.adGroupId, + adGroupCriterion.criterion.id, bidAmount); + } else { + Console.WriteLine("No keyword was updated."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update keyword.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/CampaignManagement/AddExperiment.cs b/examples/AdWords/CSharp/v201402/CampaignManagement/AddExperiment.cs new file mode 100644 index 00000000000..742d65f847c --- /dev/null +++ b/examples/AdWords/CSharp/v201402/CampaignManagement/AddExperiment.cs @@ -0,0 +1,215 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example creates an experiment using a query percentage of 10, + /// which defines what fraction of auctions should go to the control split + /// (90%) vs. the experiment split (10%), then adds experimental bid changes + /// for criteria and ad groups. To get campaigns, run GetCampaigns.cs. + /// To get ad groups, run GetAdGroups.cs. To get criteria, run + /// GetKeywords.cs. + /// + /// Tags: ExperimentService.mutate + /// + public class AddExperiment : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddExperiment codeExample = new AddExperiment(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long criterionId = long.Parse("INSERT_CRITERION_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId, adGroupId, criterionId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates an experiment using a query percentage of 10, which " + + "defines what fraction of auctions should go to the control split (90%) vs. the " + + "experiment split (10%), then adds experimental bid changes for criteria and ad " + + "groups. To get campaigns, run GetCampaigns.cs. To get ad groups, run " + + "GetAdGroups.cs. To get criteria, run GetKeywords.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to which experiments are + /// added. + /// Id of the ad group to which experiments are + /// added. + /// Id of the criterion for which experiments + /// are added. + public void Run(AdWordsUser user, long campaignId, long adGroupId, long criterionId) { + // Get the ExperimentService. + ExperimentService experimentService = + (ExperimentService) user.GetService(AdWordsService.v201402.ExperimentService); + + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201402.AdGroupService); + + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201402.AdGroupCriterionService); + + // Create the experiment. + Experiment experiment = new Experiment(); + experiment.campaignId = campaignId; + experiment.name = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString(); + experiment.queryPercentage = 10; + experiment.startDateTime = DateTime.Now.AddDays(1).ToString("yyyyMMdd HHmmss"); + + // Optional: Set the end date. + experiment.endDateTime = DateTime.Now.AddDays(30).ToString("yyyyMMdd HHmmss"); + + // Optional: Set the status. + experiment.status = ExperimentStatus.ACTIVE; + + // Create the operation. + ExperimentOperation experimentOperation = new ExperimentOperation(); + experimentOperation.@operator = Operator.ADD; + experimentOperation.operand = experiment; + + try { + // Add the experiment. + ExperimentReturnValue experimentRetVal = experimentService.mutate( + new ExperimentOperation[] {experimentOperation}); + + // Display the results. + if (experimentRetVal != null && experimentRetVal.value != null && experimentRetVal.value. + Length > 0) { + long experimentId = 0; + + Experiment newExperiment = experimentRetVal.value[0]; + + Console.WriteLine("Experiment with name = \"{0}\" and id = \"{1}\" was added.\n", + newExperiment.name, newExperiment.id); + experimentId = newExperiment.id; + + // Set ad group for the experiment. + AdGroup adGroup = new AdGroup(); + adGroup.id = adGroupId; + + // Create experiment bid multiplier rule that will modify ad group bid + // for the experiment. + ManualCPCAdGroupExperimentBidMultipliers adGroupBidMultiplier = + new ManualCPCAdGroupExperimentBidMultipliers(); + adGroupBidMultiplier.maxCpcMultiplier = new BidMultiplier(); + adGroupBidMultiplier.maxCpcMultiplier.multiplier = 1.5; + + // Set experiment data to the ad group. + AdGroupExperimentData adGroupExperimentData = new AdGroupExperimentData(); + adGroupExperimentData.experimentId = experimentId; + adGroupExperimentData.experimentDeltaStatus = ExperimentDeltaStatus.MODIFIED; + adGroupExperimentData.experimentBidMultipliers = adGroupBidMultiplier; + + adGroup.experimentData = adGroupExperimentData; + + // Create the operation. + AdGroupOperation adGroupOperation = new AdGroupOperation(); + adGroupOperation.operand = adGroup; + adGroupOperation.@operator = Operator.SET; + + // Update the ad group. + AdGroupReturnValue adGroupRetVal = adGroupService.mutate(new AdGroupOperation[] { + adGroupOperation}); + + // Display the results. + if (adGroupRetVal != null && adGroupRetVal.value != null && + adGroupRetVal.value.Length > 0) { + AdGroup updatedAdGroup = adGroupRetVal.value[0]; + Console.WriteLine("Ad group with name = \"{0}\", id = \"{1}\" and status = \"{2}\" " + + "was updated for the experiment.\n", updatedAdGroup.name, updatedAdGroup.id, + updatedAdGroup.status); + } else { + Console.WriteLine("No ad groups were updated."); + } + + // Set ad group criteria for the experiment. + Criterion criterion = new Criterion(); + criterion.id = criterionId; + + BiddableAdGroupCriterion adGroupCriterion = new BiddableAdGroupCriterion(); + adGroupCriterion.adGroupId = adGroupId; + adGroupCriterion.criterion = criterion; + + // Create experiment bid multiplier rule that will modify criterion bid + // for the experiment. + ManualCPCAdGroupCriterionExperimentBidMultiplier bidMultiplier = + new ManualCPCAdGroupCriterionExperimentBidMultiplier(); + bidMultiplier.maxCpcMultiplier = new BidMultiplier(); + bidMultiplier.maxCpcMultiplier.multiplier = 1.5; + + // Set experiment data to the criterion. + BiddableAdGroupCriterionExperimentData adGroupCriterionExperimentData = + new BiddableAdGroupCriterionExperimentData(); + adGroupCriterionExperimentData.experimentId = experimentId; + adGroupCriterionExperimentData.experimentDeltaStatus = ExperimentDeltaStatus.MODIFIED; + adGroupCriterionExperimentData.experimentBidMultiplier = bidMultiplier; + + adGroupCriterion.experimentData = adGroupCriterionExperimentData; + + // Create the operation. + AdGroupCriterionOperation adGroupCriterionOperation = new AdGroupCriterionOperation(); + adGroupCriterionOperation.operand = adGroupCriterion; + adGroupCriterionOperation.@operator = Operator.SET; + + // Update the ad group criteria. + AdGroupCriterionReturnValue adGroupCriterionRetVal = adGroupCriterionService.mutate( + new AdGroupCriterionOperation[] {adGroupCriterionOperation}); + + // Display the results. + if (adGroupCriterionRetVal != null && adGroupCriterionRetVal.value != null && + adGroupCriterionRetVal.value.Length > 0) { + AdGroupCriterion updatedAdGroupCriterion = adGroupCriterionRetVal.value[0]; + Console.WriteLine("Ad group criterion with ad group id = \"{0}\", criterion id = " + + "\"{1}\" and type = \"{2}\" was updated for the experiment.\n", + updatedAdGroupCriterion.adGroupId, updatedAdGroupCriterion.criterion.id, + updatedAdGroupCriterion.criterion.CriterionType); + } else { + Console.WriteLine("No ad group criteria were updated."); + } + } else { + Console.WriteLine("No experiments were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add experiment.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/CampaignManagement/AddKeywordsInBulk.cs b/examples/AdWords/CSharp/v201402/CampaignManagement/AddKeywordsInBulk.cs new file mode 100644 index 00000000000..57b2f5a2913 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/CampaignManagement/AddKeywordsInBulk.cs @@ -0,0 +1,173 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.RegularExpressions; +using System.Threading; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example shows how to add keywords in bulk using the + /// MutateJobService. + /// + /// Tags: MutateJobService.mutate, MutateJobService.get + /// Tags: MutateJobService.getResult + /// + public class AddKeywordsInBulk : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddKeywordsInBulk codeExample = new AddKeywordsInBulk(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to add keywords in bulk using the MutateJobService."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad groups to which keywords are + /// added. + public void Run(AdWordsUser user, long adGroupId) { + // Get the MutateJobService. + MutateJobService mutateJobService = (MutateJobService) user.GetService( + AdWordsService.v201402.MutateJobService); + + const int RETRY_INTERVAL = 30; + const int RETRIES_COUNT = 30; + const int KEYWORD_NUMBER = 100; + const string INDEX_REGEX = "operations\\[(\\d+)\\].operand"; + + List operations = new List(); + + // Create AdGroupCriterionOperation to add keywords. + for (int i = 0; i < KEYWORD_NUMBER; i++) { + Keyword keyword = new Keyword(); + keyword.text = string.Format("mars cruise {0}", i); + keyword.matchType = KeywordMatchType.BROAD; + + BiddableAdGroupCriterion criterion = new BiddableAdGroupCriterion(); + criterion.adGroupId = adGroupId; + criterion.criterion = keyword; + + AdGroupCriterionOperation adGroupCriterionOperation = new AdGroupCriterionOperation(); + adGroupCriterionOperation.@operator = Operator.ADD; + adGroupCriterionOperation.operand = criterion; + + operations.Add(adGroupCriterionOperation); + } + + BulkMutateJobPolicy policy = new BulkMutateJobPolicy(); + // You can specify up to 3 job IDs that must successfully complete before + // this job can be processed. + policy.prerequisiteJobIds = new long[] {}; + + SimpleMutateJob job = mutateJobService.mutate(operations.ToArray(), policy); + + // Wait for the job to complete. + bool completed = false; + int retryCount = 0; + Console.WriteLine("Retrieving job status..."); + + while (completed == false && retryCount < RETRIES_COUNT) { + BulkMutateJobSelector selector = new BulkMutateJobSelector(); + selector.jobIds = new long[] {job.id}; + + try { + Job[] allJobs = mutateJobService.get(selector); + if (allJobs != null && allJobs.Length > 0) { + job = (SimpleMutateJob) allJobs[0]; + if (job.status == BasicJobStatus.COMPLETED || job.status == BasicJobStatus.FAILED) { + completed = true; + break; + } else { + Console.WriteLine("{0}: Current status is {1}, waiting {2} seconds to retry...", + retryCount, job.status, RETRY_INTERVAL); + Thread.Sleep(RETRY_INTERVAL * 1000); + retryCount++; + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to fetch simple mutate job with " + + "id = {0}.", ex); + } + } + + if (job.status == BasicJobStatus.COMPLETED) { + // Handle cases where the job completed. + + // Create the job selector. + BulkMutateJobSelector selector = new BulkMutateJobSelector(); + selector.jobIds = new long[] {job.id}; + + // Get the job results. + JobResult jobResult = mutateJobService.getResult(selector); + if (jobResult != null) { + SimpleMutateResult results = (SimpleMutateResult) jobResult.Item; + if (results != null) { + // Display the results. + if (results.results != null) { + for (int i = 0; i < results.results.Length; i++) { + Operand operand = results.results[i]; + Console.WriteLine("Operation {0} - {1}", i, (operand.Item is PlaceHolder) ? + "FAILED" : "SUCCEEDED"); + } + } + + // Display the errors. + if (results.errors != null) { + foreach (ApiError apiError in results.errors) { + Match match = Regex.Match(apiError.fieldPath, INDEX_REGEX, RegexOptions.IgnoreCase); + string index = (match.Success)? match.Groups[1].Value : "???"; + Console.WriteLine("Operation index {0} failed due to reason: '{1}', " + + "trigger: '{2}'", index, apiError.errorString, apiError.trigger); + } + } + } + } + Console.WriteLine("Job completed successfully!"); + } else if (job.status == BasicJobStatus.FAILED) { + // Handle the cases where job failed. + Console.WriteLine("Job failed with reason: " + job.failureReason); + } else if (job.status == BasicJobStatus.PROCESSING || job.status == BasicJobStatus.PENDING) { + // Handle the cases where job didn't complete after wait period. + Console.WriteLine("Job did not complete in {0} secconds.", RETRY_INTERVAL * RETRIES_COUNT); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/CampaignManagement/AddLocationExtension.cs b/examples/AdWords/CSharp/v201402/CampaignManagement/AddLocationExtension.cs new file mode 100644 index 00000000000..9ba48c1d342 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/CampaignManagement/AddLocationExtension.cs @@ -0,0 +1,148 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example shows how to add a location extension to an existing + /// campaign. To create a campaign, run AddCampaign.cs. + /// + /// Tags: GeoLocationService.get, CampaignAdExtensionService.mutate + /// + public class AddLocationExtension : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddLocationExtension codeExample = new AddLocationExtension(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to add a location extension to an existing " + + "campaign. To create a campaign, run AddCampaign.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to which location + /// extensions are added. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignAdExtensionService. + CampaignAdExtensionService campaignExtensionService = + (CampaignAdExtensionService) user.GetService(AdWordsService.v201402. + CampaignAdExtensionService); + + // Add location 1: 1600 Amphitheatre Pkwy, Mountain View, US. + Address address1 = new Address(); + address1.streetAddress = "1600 Amphitheatre Parkway"; + address1.cityName = "Mountain View"; + address1.provinceCode = "CA"; + address1.postalCode = "94043"; + address1.countryCode = "US"; + + // Add location 2: 38 avenue de l'Opéra, 75002 Paris, FR. + Address address2 = new Address(); + address2.streetAddress = "38 avenue de l'Opéra"; + address2.cityName = "Paris"; + address2.postalCode = "75002"; + address2.countryCode = "FR"; + + // Get the GeoLocationService. + GeoLocationService geoService = + (GeoLocationService) user.GetService(AdWordsService.v201402.GeoLocationService); + + // Create the selector. + GeoLocationSelector selector = new GeoLocationSelector(); + selector.addresses = new Address[] {address1, address2}; + + // Retrieve the locations. + GeoLocation[] locations = geoService.get(selector); + + List operations = new List(); + + // Phone numbers for US and FR offices. + string[] phoneNumbers = new string[] {"(650) 253-0000", "(0)1 42 68 53 00"}; + int index = 0; + + // Create a location extension for each geo location returned by the + // server. + foreach (GeoLocation location in locations) { + LocationExtension locationExtension = new LocationExtension(); + locationExtension.address = location.address; + locationExtension.geoPoint = location.geoPoint; + locationExtension.encodedLocation = location.encodedLocation; + locationExtension.source = LocationExtensionSource.ADWORDS_FRONTEND; + + // Optional: Set the company name. + locationExtension.companyName = "ACME Inc."; + + // Optional: Set the phone number. + locationExtension.phoneNumber = phoneNumbers[index]; + index++; + + CampaignAdExtension extension = new CampaignAdExtension(); + extension.campaignId = campaignId; + extension.status = CampaignAdExtensionStatus.ACTIVE; + extension.adExtension = locationExtension; + + CampaignAdExtensionOperation operation = new CampaignAdExtensionOperation(); + operation.@operator = Operator.ADD; + operation.operand = extension; + + operations.Add(operation); + } + + try { + CampaignAdExtensionReturnValue retVal = + campaignExtensionService.mutate(operations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + foreach (CampaignAdExtension campaignExtension in retVal.value) { + Console.WriteLine("Created a location extension with id = \"{0}\" and " + + "status = \"{1}\"", campaignExtension.adExtension.id, campaignExtension.status); + } + } else { + Console.WriteLine("No location extensions were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add location extension.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/CampaignManagement/GetAllDisapprovedAds.cs b/examples/AdWords/CSharp/v201402/CampaignManagement/GetAllDisapprovedAds.cs new file mode 100644 index 00000000000..e018ed28fba --- /dev/null +++ b/examples/AdWords/CSharp/v201402/CampaignManagement/GetAllDisapprovedAds.cs @@ -0,0 +1,121 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example retrieves all the disapproved ads in a given campaign. + /// + /// Tags: AdGroupAdService.get + /// + public class GetAllDisapprovedAds : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAllDisapprovedAds codeExample = new GetAllDisapprovedAds(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves all the disapproved ads in a given campaign."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign for which disapproved ads + /// are retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201402.AdGroupAdService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "AdGroupCreativeApprovalStatus", + "AdGroupAdDisapprovalReasons"}; + + // Create the filter. + Predicate campaignPredicate = new Predicate(); + campaignPredicate.@operator = PredicateOperator.EQUALS; + campaignPredicate.field = "CampaignId"; + campaignPredicate.values = new string[] {campaignId.ToString()}; + + Predicate approvalPredicate = new Predicate(); + approvalPredicate.@operator = PredicateOperator.EQUALS; + approvalPredicate.field = "AdGroupCreativeApprovalStatus"; + approvalPredicate.values = new string[] {AdGroupAdApprovalStatus.DISAPPROVED.ToString()}; + + selector.predicates = new Predicate[] {campaignPredicate, approvalPredicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupAdPage page = new AdGroupAdPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the disapproved ads. + page = service.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroupAd adGroupAd in page.entries) { + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " + + "reason(s):", i, adGroupAd.ad.id); + foreach (string reason in adGroupAd.disapprovalReasons) { + Console.WriteLine(" {0}", reason); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get disapproved ads.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs b/examples/AdWords/CSharp/v201402/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs new file mode 100644 index 00000000000..617a8fcf562 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs @@ -0,0 +1,108 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example retrieves all the disapproved ads in a given campaign + /// using AWQL. See https://developers.google.com/adwords/api/docs/guides/awql + /// for AWQL documentation. + /// + /// Tags: AdGroupAdService.get + /// + public class GetAllDisapprovedAdsWithAwql : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAllDisapprovedAdsWithAwql codeExample = new GetAllDisapprovedAdsWithAwql(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves all the disapproved ads in a given campaign using " + + "AWQL. See https://developers.google.com/adwords/api/docs/guides/awql for AWQL " + + "documentation."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign for which disapproved ads + /// are retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201402.AdGroupAdService); + + // Get all the disapproved ads for this campaign. + string query = string.Format("SELECT Id, AdGroupAdDisapprovalReasons WHERE " + + "CampaignId = {0} AND AdGroupCreativeApprovalStatus = DISAPPROVED ORDER BY Id", + campaignId); + + int offset = 0; + int pageSize = 500; + + AdGroupAdPage page = new AdGroupAdPage(); + + try { + do { + string queryWithPaging = string.Format("{0} LIMIT {1}, {2}", query, offset, pageSize); + + // Get the disapproved ads. + page = service.query(queryWithPaging); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroupAd adGroupAd in page.entries) { + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " + + "reason(s):", i, adGroupAd.ad.id); + foreach (string reason in adGroupAd.disapprovalReasons) { + Console.WriteLine(" {0}", reason); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get disapproved ads.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/CampaignManagement/PromoteExperiment.cs b/examples/AdWords/CSharp/v201402/CampaignManagement/PromoteExperiment.cs new file mode 100644 index 00000000000..8f9a4d01f6e --- /dev/null +++ b/examples/AdWords/CSharp/v201402/CampaignManagement/PromoteExperiment.cs @@ -0,0 +1,98 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This example promotes an experiment, which permanently applies all the + /// experiment changes made to its related ad groups, criteria and ads. To + /// create an experiment, run AddExperiment.vb. + /// + /// Tags: ExperimentService.mutate + /// + public class PromoteExperiment : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + PromoteExperiment codeExample = new PromoteExperiment(); + Console.WriteLine(codeExample.Description); + try { + long experimentId = long.Parse("INSERT_EXPERIMENT_ID_HERE"); + codeExample.Run(new AdWordsUser(), experimentId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example promotes an experiment, which permanently applies all the experiment" + + " changes made to its related ad groups, criteria and ads. To create an experiment, " + + "run AddExperiment.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the experiment to be promoted. + public void Run(AdWordsUser user, long experimentId) { + // Get the ExperimentService. + ExperimentService experimentService = + (ExperimentService) user.GetService(AdWordsService.v201402.ExperimentService); + + // Set experiment's status to PROMOTED. + Experiment experiment = new Experiment(); + experiment.id = experimentId; + experiment.status = ExperimentStatus.PROMOTED; + + // Create the operation. + ExperimentOperation operation = new ExperimentOperation(); + operation.@operator = Operator.SET; + operation.operand = experiment; + + try { + // Update the experiment. + ExperimentReturnValue retVal = experimentService.mutate( + new ExperimentOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + Experiment promotedExperiment = retVal.value[0]; + Console.WriteLine("Experiment with name = \"{0}\" and id = \"{1}\" was promoted.\n", + promotedExperiment.name, promotedExperiment.id); + } else { + Console.WriteLine("No experiments were promoted."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to promote experiment.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/CampaignManagement/SetAdParameters.cs b/examples/AdWords/CSharp/v201402/CampaignManagement/SetAdParameters.cs new file mode 100644 index 00000000000..cb8af8c6559 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/CampaignManagement/SetAdParameters.cs @@ -0,0 +1,152 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example illustrates how to create a text ad with ad parameters. + /// To add an ad group, run AddAdGroup.cs. To add a keyword, run + /// run AddKeyword.cs. + /// + /// Tags: AdGroupAdService.mutate, AdParamService.mutate + /// + public class SetAdParameters : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SetAdParameters codeExample = new SetAdParameters(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long criterionId = long.Parse("INSERT_CRITERION_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, criterionId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create a text ad with ad parameters." + + " To add an ad group, run AddAdGroup.cs. To add a keyword, run AddKeyword.vb."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the criterion. + /// + /// Id of the keyword for which the ad + /// parameters are set. + public void Run(AdWordsUser user, long adGroupId, long criterionId) { + // Get the AdGroupAdService. + AdGroupAdService adGroupAdService = (AdGroupAdService) user.GetService( + AdWordsService.v201402.AdGroupAdService); + + // Get the AdParamService. + AdParamService adParamService = (AdParamService) user.GetService( + AdWordsService.v201402.AdParamService); + + // Create the text ad. + TextAd textAd = new TextAd(); + textAd.url = "http://www.example.com"; + textAd.displayUrl = "example.com"; + textAd.headline = " Mars Cruises"; + textAd.description1 = "Low-gravity fun for {param1:cheap}."; + textAd.description2 = "Only {param2:a few} seats left!"; + + AdGroupAd adOperand = new AdGroupAd(); + adOperand.adGroupId = adGroupId; + adOperand.status = AdGroupAdStatus.ENABLED; + adOperand.ad = textAd; + + // Create the operation. + AdGroupAdOperation adOperation = new AdGroupAdOperation(); + adOperation.operand = adOperand; + adOperation.@operator = Operator.ADD; + + try { + // Create the text ad. + AdGroupAdReturnValue retVal = adGroupAdService.mutate( + new AdGroupAdOperation[] {adOperation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + Console.WriteLine("Text ad with id ='{0}' was successfully added.", + retVal.value[0].ad.id); + } else { + Console.WriteLine("No text ads were created."); + return; + } + } catch (Exception ex) { + Console.WriteLine("Failed to create text ads. Exception says \"{0}\"", ex.Message); + return; + } + + // Create the ad param for price. + AdParam priceParam = new AdParam(); + priceParam.adGroupId = adGroupId; + priceParam.criterionId = criterionId; + priceParam.paramIndex = 1; + priceParam.insertionText = "$100"; + + // Create the ad param for seats. + AdParam seatParam = new AdParam(); + seatParam.adGroupId = adGroupId; + seatParam.criterionId = criterionId; + seatParam.paramIndex = 2; + seatParam.insertionText = "50"; + + // Create the operations. + AdParamOperation priceOperation = new AdParamOperation(); + priceOperation.@operator = Operator.SET; + priceOperation.operand = priceParam; + + AdParamOperation seatOperation = new AdParamOperation(); + seatOperation.@operator = Operator.SET; + seatOperation.operand = seatParam; + + try { + // Set the ad parameters. + AdParam [] newAdParams = adParamService.mutate(new AdParamOperation[] + {priceOperation, seatOperation}); + + // Display the results. + if (newAdParams != null) { + Console.WriteLine("Ad parameters were successfully updated."); + } else { + Console.WriteLine("No ad parameters were set."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to set ad parameters.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/CampaignManagement/SetBidModifier.cs b/examples/AdWords/CSharp/v201402/CampaignManagement/SetBidModifier.cs new file mode 100644 index 00000000000..fab4e0bc994 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/CampaignManagement/SetBidModifier.cs @@ -0,0 +1,111 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example sets a bid modifier for the mobile platform on given + /// campaign. The campaign must be an enhanced type of campaign. To get + /// campaigns, run GetCampaigns.cs. To enhance a campaign, run + /// SetCampaignEnhanced.cs. + /// + /// Tags: CampaignCriterionService.mutate + /// + public class SetBidModifier : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SetBidModifier codeExample = new SetBidModifier(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + double bidModifier = double.Parse("INSERT_BID_MODIFIER_HERE"); + codeExample.Run(new AdWordsUser(), campaignId, bidModifier); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example sets a bid modifier for the mobile platform on given " + + "campaign. The campaign must be an enhanced type of campaign. To get campaigns, " + + "run GetCampaigns.cs. To enhance a campaign, run SetCampaignEnhanced.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign whose bid should be modified. + /// + /// The bid modifier. + public void Run(AdWordsUser user, long campaignId, double bidModifier) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201402.CampaignCriterionService); + + // Create mobile platform. The ID can be found in the documentation. + // https://developers.google.com/adwords/api/docs/appendix/platforms + Platform mobile = new Platform(); + mobile.id = 30001; + + // Create criterion with modified bid. + CampaignCriterion criterion = new CampaignCriterion(); + criterion.campaignId = campaignId; + criterion.criterion = mobile; + criterion.bidModifier = bidModifier; + + // Create SET operation. + CampaignCriterionOperation operation = new CampaignCriterionOperation(); + operation.@operator = Operator.SET; + operation.operand = criterion; + + try { + // Update campaign criteria. + CampaignCriterionReturnValue result = campaignCriterionService.mutate( + new CampaignCriterionOperation[] {operation}); + + // Display campaign criteria. + if (result.value != null) { + foreach (CampaignCriterion newCriterion in result.value) { + Console.WriteLine("Campaign criterion with campaign id '{0}', criterion id '{1}', " + + "and type '{2}' was modified with bid {3:F2}.", newCriterion.campaignId, + newCriterion.criterion.id, newCriterion.criterion.type, newCriterion.bidModifier); + } + } else { + Console.WriteLine("No campaign criteria were modified."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to set bid modifier for campaign.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/CampaignManagement/ValidateTextAd.cs b/examples/AdWords/CSharp/v201402/CampaignManagement/ValidateTextAd.cs new file mode 100644 index 00000000000..a03d7cb156e --- /dev/null +++ b/examples/AdWords/CSharp/v201402/CampaignManagement/ValidateTextAd.cs @@ -0,0 +1,109 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example shows how to use the validateOnly header to validate + /// a text ad. No objects will be created, but exceptions will still be + /// thrown. + /// + /// Tags: AdGroupAdService.mutate + /// + public class ValidateTextAd : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + ValidateTextAd codeExample = new ValidateTextAd(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to use the validateOnly header to validate a " + + "text ad. No objects will be created, but exceptions will still be thrown."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which text ads are + /// added. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService adGroupAdService = + (AdGroupAdService) user.GetService(AdWordsService.v201402.AdGroupAdService); + + // Set the validateOnly headers. + adGroupAdService.RequestHeader.validateOnly = true; + + // Create your text ad. + TextAd textAd = new TextAd(); + textAd.headline = "Luxury Cruise to Mars"; + textAd.description1 = "Visit the Red Planet in style."; + textAd.description2 = "Low-gravity fun for everyone!!"; + textAd.displayUrl = "www.example.com"; + textAd.url = "http://www.example.com"; + + AdGroupAd textAdGroupAd = new AdGroupAd(); + textAdGroupAd.adGroupId = adGroupId; + textAdGroupAd.ad = textAd; + + AdGroupAdOperation textAdOperation = new AdGroupAdOperation(); + textAdOperation.@operator = Operator.ADD; + textAdOperation.operand = textAdGroupAd; + + try { + AdGroupAdReturnValue retVal = adGroupAdService.mutate( + (new AdGroupAdOperation[] {textAdOperation})); + // Since validation is ON, result will be null. + Console.WriteLine("text ad validated successfully."); + } catch (AdWordsApiException ex) { + // This block will be hit if there is a validation error from the server. + Console.WriteLine("There were validation error(s) while adding text ad."); + + if (ex.ApiException != null) { + foreach (ApiError error in ((ApiException) ex.ApiException).errors) { + Console.WriteLine(" Error type is '{0}' and fieldPath is '{1}'.", + error.ApiErrorType, error.fieldPath); + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to validate text ad.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/ErrorHandling/HandlePartialFailures.cs b/examples/AdWords/CSharp/v201402/ErrorHandling/HandlePartialFailures.cs new file mode 100644 index 00000000000..47ba3dc6de5 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/ErrorHandling/HandlePartialFailures.cs @@ -0,0 +1,136 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example demonstrates how to handle partial failures. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class HandlePartialFailures : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + HandlePartialFailures codeExample = new HandlePartialFailures(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example demonstrates how to handle partial failures."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which keywords are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201402.AdGroupCriterionService); + + // Set partial failure mode for the service. + adGroupCriterionService.RequestHeader.partialFailure = true; + + List operations = new List(); + + // Create the keywords. + string[] keywords = new String[] {"mars cruise", "inv@lid cruise", "venus cruise", + "b(a)d keyword cruise"}; + + foreach (String keywordText in keywords) { + Keyword keyword = new Keyword(); + keyword.text = keywordText; + keyword.matchType = KeywordMatchType.BROAD; + + // Create biddable ad group criterion. + BiddableAdGroupCriterion keywordBiddableAdGroupCriterion = new BiddableAdGroupCriterion(); + keywordBiddableAdGroupCriterion.adGroupId = adGroupId; + keywordBiddableAdGroupCriterion.criterion = keyword; + + // Create the operation. + AdGroupCriterionOperation keywordAdGroupCriterionOperation = + new AdGroupCriterionOperation(); + keywordAdGroupCriterionOperation.operand = keywordBiddableAdGroupCriterion; + keywordAdGroupCriterionOperation.@operator = Operator.ADD; + operations.Add(keywordAdGroupCriterionOperation); + } + + try { + // Create the keywords. + AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations.ToArray()); + + // Display the results. + if (result != null && result.value != null) { + foreach (AdGroupCriterion adGroupCriterionResult in result.value) { + if (adGroupCriterionResult.criterion != null) { + Console.WriteLine("Keyword with ad group id '{0}', criterion id '{1}', and " + + "text '{2}' was added.\n", adGroupCriterionResult.adGroupId, + adGroupCriterionResult.criterion.id, + ((Keyword) adGroupCriterionResult.criterion).text); + } + } + } else { + Console.WriteLine("No keywords were added."); + } + + // Display the partial failure errors. + if (result != null && result.partialFailureErrors != null) { + foreach (ApiError apiError in result.partialFailureErrors) { + int operationIndex = ErrorUtilities.GetOperationIndex(apiError.fieldPath); + if (operationIndex != -1) { + AdGroupCriterion adGroupCriterion = operations[operationIndex].operand; + Console.WriteLine("Keyword with ad group id '{0}' and text '{1}' " + + "triggered a failure for the following reason: '{2}'.\n", + adGroupCriterion.adGroupId, ((Keyword) adGroupCriterion.criterion).text, + apiError.errorString); + } else { + Console.WriteLine("A failure for the following reason: '{0}' has occurred.\n", + apiError.errorString); + } + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add keywords in partial failure mode.", + ex); + } + } + } +} + diff --git a/examples/AdWords/CSharp/v201402/ErrorHandling/HandlePolicyViolationError.cs b/examples/AdWords/CSharp/v201402/ErrorHandling/HandlePolicyViolationError.cs new file mode 100644 index 00000000000..8f4959109d3 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/ErrorHandling/HandlePolicyViolationError.cs @@ -0,0 +1,173 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example adds a text ad, and shows how to handle a policy + /// violation. + /// + /// Tags: AdGroupAdService.mutate + /// + public class HandlePolicyViolationError : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + HandlePolicyViolationError codeExample = new HandlePolicyViolationError(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a text ad, and shows how to handle a policy violation."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which ads are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201402.AdGroupAdService); + + // Create the text ad. + TextAd textAd = new TextAd(); + textAd.headline = "Luxury Cruise to Mars"; + textAd.description1 = "Visit the Red Planet in style."; + textAd.description2 = "Low-gravity fun for everyone!!"; + textAd.displayUrl = "www.example.com"; + textAd.url = "http://www.example.com"; + + AdGroupAd textadGroupAd = new AdGroupAd(); + textadGroupAd.adGroupId = adGroupId; + textadGroupAd.ad = textAd; + + // Create the operations. + AdGroupAdOperation textAdOperation = new AdGroupAdOperation(); + textAdOperation.@operator = Operator.ADD; + textAdOperation.operand = textadGroupAd; + + try { + AdGroupAdReturnValue retVal = null; + + // Setup two arrays, one to hold the list of all operations to be + // validated, and another to hold the list of operations that cannot be + // fixed after validation. + List allOperations = new List(); + List operationsToBeRemoved = new List(); + + allOperations.Add(textAdOperation); + + try { + // Validate the operations. + service.RequestHeader.validateOnly = true; + retVal = service.mutate(allOperations.ToArray()); + } catch (AdWordsApiException ex) { + ApiException innerException = ex.ApiException as ApiException; + if (innerException == null) { + throw new Exception("Failed to retrieve ApiError. See inner exception for more " + + "details.", ex); + } + + // Examine each ApiError received from the server. + foreach (ApiError apiError in innerException.errors) { + int index = ErrorUtilities.GetOperationIndex(apiError.fieldPath); + if (index == -1) { + // This API error is not associated with an operand, so we cannot + // recover from this error by removing one or more operations. + // Rethrow the exception for manual inspection. + throw; + } + + // Handle policy violation errors. + if (apiError is PolicyViolationError) { + PolicyViolationError policyError = (PolicyViolationError) apiError; + + if (policyError.isExemptable) { + // If the policy violation error is exemptable, add an exemption + // request. + List exemptionRequests = new List(); + if (allOperations[index].exemptionRequests != null) { + exemptionRequests.AddRange(allOperations[index].exemptionRequests); + } + + ExemptionRequest exemptionRequest = new ExemptionRequest(); + exemptionRequest.key = policyError.key; + exemptionRequests.Add(exemptionRequest); + allOperations[index].exemptionRequests = exemptionRequests.ToArray(); + } else { + // Policy violation error is not exemptable, remove this + // operation from the list of operations. + operationsToBeRemoved.Add(allOperations[index]); + } + } else { + // This is not a policy violation error, remove this operation + // from the list of operations. + operationsToBeRemoved.Add(allOperations[index]); + } + } + // Remove all operations that aren't exemptable. + foreach (AdGroupAdOperation operation in operationsToBeRemoved) { + allOperations.Remove(operation); + } + } + + if (allOperations.Count > 0) { + // Perform the operations exemptible of a policy violation. + service.RequestHeader.validateOnly = false; + retVal = service.mutate(allOperations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + foreach (AdGroupAd newAdGroupAd in retVal.value) { + Console.WriteLine("New ad with id = \"{0}\" and displayUrl = \"{1}\" was created.", + newAdGroupAd.ad.id, newAdGroupAd.ad.displayUrl); + } + } else { + Console.WriteLine("No ads were created."); + } + } else { + Console.WriteLine("There are no ads to create after policy violation checks."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create ads.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/ErrorHandling/HandleRateExceededError.cs b/examples/AdWords/CSharp/v201402/ErrorHandling/HandleRateExceededError.cs new file mode 100644 index 00000000000..86964d26d11 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/ErrorHandling/HandleRateExceededError.cs @@ -0,0 +1,204 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example shows how to handle RateExceededError in your + /// application. To trigger the rate exceeded error, this code example runs + /// 100 threads in parallel, each thread attempting to validate 100 keywords + /// in a single request. Note that spawning 100 parallel threads is for + /// illustrative purposes only, you shouldn't do this in your application. + /// + /// Tags: AdGroupAdService.mutate + /// + public class HandleRateExceededError: ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + HandleRateExceededError codeExample = new HandleRateExceededError(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to handle RateExceededError in your application. " + + "To trigger the rate exceeded error, this code example runs 100 threads in " + + "parallel, each thread attempting to validate 100 keywords in a single request. " + + "Note that spawning 100 parallel threads is for illustrative purposes only, you " + + "shouldn't do this in your application."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which keywords are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + const int NUM_THREADS = 100; + + // Increase the maximum number of parallel HTTP connections that .NET + // framework allows. By default, this is set to 2 by the .NET framework. + System.Net.ServicePointManager.DefaultConnectionLimit = NUM_THREADS; + + List threads = new List(); + + for (int i = 0; i < NUM_THREADS; i++) { + Thread thread = new Thread(new KeywordThread(user, i, adGroupId).Run); + threads.Add(thread); + } + + for (int i = 0; i < NUM_THREADS; i++) { + threads[i].Start(i); + } + + for (int i = 0; i < NUM_THREADS; i++) { + threads[i].Join(); + } + } + + /// + /// Thread class for validating keywords. + /// + class KeywordThread { + /// + /// Index of this thread, for identifying and debugging. + /// + int threadIndex; + + /// + /// The ad group id to which keywords are added. + /// + long adGroupId; + + /// + /// The AdWords user who owns this ad group. + /// + AdWordsUser user; + + /// + /// Number of keywords to be validated in each API call. + /// + const int NUM_KEYWORDS = 100; + + /// + /// Initializes a new instance of the class. + /// + /// Index of the thread. + /// The ad group id. + /// The AdWords user who owns the ad group. + public KeywordThread(AdWordsUser user, int threadIndex, long adGroupId) { + this.user = user; + this.threadIndex = threadIndex; + this.adGroupId = adGroupId; + } + + /// + /// Main method for the thread. + /// + /// The thread parameter. + public void Run(Object obj) { + // Create the operations. + List operations = new List(); + + for (int j = 0; j < NUM_KEYWORDS; j++) { + // Create the keyword. + Keyword keyword = new Keyword(); + keyword.text = "mars cruise thread " + threadIndex.ToString() + " seed " + j.ToString(); + keyword.matchType = KeywordMatchType.BROAD; + + // Create the biddable ad group criterion. + AdGroupCriterion keywordCriterion = new BiddableAdGroupCriterion(); + keywordCriterion.adGroupId = adGroupId; + keywordCriterion.criterion = keyword; + + // Create the operations. + AdGroupCriterionOperation keywordOperation = new AdGroupCriterionOperation(); + keywordOperation.@operator = Operator.ADD; + keywordOperation.operand = keywordCriterion; + + operations.Add(keywordOperation); + } + + // Get the AdGroupCriterionService. This should be done within the + // thread, since a service can only handle one outgoing HTTP request + // at a time. + AdGroupCriterionService service = (AdGroupCriterionService) user.GetService( + AdWordsService.v201402.AdGroupCriterionService); + service.RequestHeader.validateOnly = true; + int retryCount = 0; + const int NUM_RETRIES = 3; + try { + while (retryCount < NUM_RETRIES) { + try { + // Validate the keywords. + AdGroupCriterionReturnValue retval = service.mutate(operations.ToArray()); + break; + } catch (AdWordsApiException ex) { + // Handle API errors. + ApiException innerException = ex.ApiException as ApiException; + if (innerException == null) { + throw new Exception("Failed to retrieve ApiError. See inner exception for more " + + "details.", ex); + } + foreach (ApiError apiError in innerException.errors) { + if (!(apiError is RateExceededError)) { + // Rethrow any errors other than RateExceededError. + throw; + } + // Handle rate exceeded errors. + RateExceededError rateExceededError = (RateExceededError) apiError; + Console.WriteLine("Got Rate exceeded error - rate name = '{0}', scope = '{1}', " + + "retry After {2} seconds.", rateExceededError.rateScope, + rateExceededError.rateName, rateExceededError.retryAfterSeconds); + Thread.Sleep(rateExceededError.retryAfterSeconds * 1000); + retryCount = retryCount + 1; + } + } finally { + if (retryCount == NUM_RETRIES) { + throw new Exception(String.Format("Could not recover after making {0} attempts.", + retryCount)); + } + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to validate keywords.", ex); + } + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/Express/AddExpressBusinesses.cs b/examples/AdWords/CSharp/v201402/Express/AddExpressBusinesses.cs new file mode 100644 index 00000000000..88d7e6f8eff --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Express/AddExpressBusinesses.cs @@ -0,0 +1,114 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example adds express businesses. To get express businesses, run + /// GetExpressBusinesses.cs. + /// + /// Tags: ExpressBusinessService.mutate + /// + public class AddExpressBusinesses : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds express businesses. To get express businesses, run " + + "GetExpressBusinesses.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddExpressBusinesses codeExample = new AddExpressBusinesses(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ExpressBusinessService. + ExpressBusinessService businessService = (ExpressBusinessService) + user.GetService(AdWordsService.v201402.ExpressBusinessService); + + ExpressBusiness business1 = new ExpressBusiness(); + business1.status = ExpressBusinessStatus.ACTIVE; + business1.name = "Express Interplanetary Cruise #" + ExampleUtilities.GetShortRandomString(); + + Address address1 = new Address(); + address1.streetAddress = "1600 Amphitheatre Pkwy"; + address1.cityName = "Mountain View"; + address1.provinceCode = "CA"; + address1.countryCode = "US"; + + business1.address = address1; + business1.website = "http://www.example.com/cruise1"; + + ExpressBusinessOperation operation1 = new ExpressBusinessOperation(); + operation1.@operator = Operator.ADD; + operation1.operand = business1; + + ExpressBusiness business2 = new ExpressBusiness(); + business2.status = (ExpressBusinessStatus.ACTIVE); + business2.name = "Express Interplanetary Cruise #" + ExampleUtilities.GetShortRandomString(); + + Address address2 = new Address(); + address2.streetAddress = "111 8th Ave"; + address2.cityName = "New York"; + address2.provinceCode = "NY"; + address2.countryCode = "US"; + + business2.address = address2; + business2.website = "http://www.example.com/cruise2"; + + ExpressBusinessOperation operation2 = new ExpressBusinessOperation(); + operation2.@operator = Operator.ADD; + operation2.operand = business2; + + try { + ExpressBusiness[] addedBusinesses = businessService.mutate( + new ExpressBusinessOperation[] {operation1, operation2}); + + Console.WriteLine("Added {0} express businesses", addedBusinesses.Length); + foreach (ExpressBusiness addedBusiness in addedBusinesses) { + Console.WriteLine("Added express business with ID = {0} and name '{1}'.", + addedBusiness.id, addedBusiness.name); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add express business.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201402/Express/AddPromotion.cs b/examples/AdWords/CSharp/v201402/Express/AddPromotion.cs new file mode 100644 index 00000000000..a660d2d4f1c --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Express/AddPromotion.cs @@ -0,0 +1,154 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example adds a new promotion to an express business. To get + /// promotions, run GetPromotions.cs. + /// + /// Tags: ExpressBusinessService.get, PromotionService.mutate + /// + public class AddPromotion : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a new promotion to an express business. To get " + + "promotions, run GetPromotions.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddPromotion codeExample = new AddPromotion(); + Console.WriteLine(codeExample.Description); + try { + long businessId = long.Parse("INSERT_ADWORDS_EXPRESS_BUSINESS_ID_HERE"); + codeExample.Run(new AdWordsUser(), businessId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The AdWords Express business id. + public void Run(AdWordsUser user, long businessId) { + // Get the ExpressBusinessService. + ExpressBusinessService businessService = (ExpressBusinessService) + user.GetService(AdWordsService.v201402.ExpressBusinessService); + + // Get the PromotionService + PromotionService promotionService = (PromotionService) + user.GetService(AdWordsService.v201402.PromotionService); + + // Get the business for the businessId. We will need its geo point to + // create a Proximity criterion for the new Promotion. + Selector businessSelector = new Selector(); + + Predicate predicate = new Predicate(); + predicate.field = "Id"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] { businessId.ToString() }; + businessSelector.predicates = new Predicate[] { predicate }; + + businessSelector.fields = new string[] { "Id", "GeoPoint" }; + + ExpressBusinessPage businessPage = businessService.get(businessSelector); + + if (businessPage == null || businessPage.entries == null || + businessPage.entries.Length == 0) { + Console.WriteLine("No business was found."); + return; + } + + // Set the business ID to the service. + promotionService.RequestHeader.expressBusinessId = businessId; + + // First promotion + Promotion marsTourPromotion = new Promotion(); + Money budget = new Money(); + budget.microAmount = 1000000L; + marsTourPromotion.name = "Mars Tour Promotion " + ExampleUtilities.GetShortRandomString(); + marsTourPromotion.status = PromotionStatus.PAUSED; + marsTourPromotion.destinationUrl = "http://www.example.com"; + marsTourPromotion.budget = budget; + marsTourPromotion.callTrackingEnabled = true; + + // Criteria + + // Criterion - Travel Agency product service + ProductService productService = new ProductService(); + productService.text = "Travel Agency"; + + // Criterion - English language + // The ID can be found in the documentation: + // https://developers.google.com/adwords/api/docs/appendix/languagecodes + Language language = new Language(); + language.id = 1000L; + + // Criterion - Within 15 miles + Proximity proximity = new Proximity(); + proximity.geoPoint = businessPage.entries[0].geoPoint; + proximity.radiusDistanceUnits = ProximityDistanceUnits.MILES; + proximity.radiusInUnits = 15; + + marsTourPromotion.criteria = new Criterion[] { productService, language, proximity }; + + // Creatives + + Creative creative1 = new Creative(); + creative1.headline = "Standard Mars Trip"; + creative1.line1 = "Fly coach to Mars"; + creative1.line2 = "Free in-flight pretzels"; + + Creative creative2 = new Creative(); + creative2.headline = "Deluxe Mars Trip"; + creative2.line1 = "Fly first class to Mars"; + creative2.line2 = "Unlimited powdered orange drink"; + + marsTourPromotion.creatives = new Creative[] { creative1, creative2 }; + + PromotionOperation operation = new PromotionOperation(); + operation.@operator = Operator.ADD; + operation.operand = marsTourPromotion; + + try { + Promotion[] addedPromotions = promotionService.mutate( + new PromotionOperation[] { operation }); + + Console.WriteLine("Added promotion ID {0} with name {1} to business ID {2}.", + addedPromotions[0].id, addedPromotions[0].name, businessId); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add promotions.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201402/Express/GetExpressBusinesses.cs b/examples/AdWords/CSharp/v201402/Express/GetExpressBusinesses.cs new file mode 100644 index 00000000000..72ad2415473 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Express/GetExpressBusinesses.cs @@ -0,0 +1,151 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Text; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example gets all express businesses. To add an express + /// business, run AddExpressBusinesses.cs. + /// + /// Tags: ExpressBusinessService.get + /// + public class GetExpressBusinesses : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all express businesses. To add an express business, " + + "run AddExpressBusinesses.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetExpressBusinesses codeExample = new GetExpressBusinesses(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ExpressBusinessService. + ExpressBusinessService businessService = (ExpressBusinessService) + user.GetService(AdWordsService.v201402.ExpressBusinessService); + + Selector selector = new Selector(); + selector.fields = new String[] { "Id", "Name", "Website", "Address", "GeoPoint", "Status" }; + + // To get all express businesses owned by the current customer, + // simply skip the call to selector.setPredicates below. + Predicate predicate = new Predicate(); + predicate.field = "Status"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] { "ACTIVE" }; + + selector.predicates = new Predicate[] { predicate }; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + ExpressBusinessPage page = null; + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get all businesses. + page = businessService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (ExpressBusiness business in page.entries) { + Console.WriteLine("{0}) Express business found with name '{1}', id = {2}, " + + "website = {3} and status = {4}.\n", i + 1, business.name, business.id, + business.website, business.status); + Console.WriteLine("Address"); + Console.WriteLine("======="); + Console.WriteLine(FormatAddress(business.address)); + Console.WriteLine("Co-ordinates: {0}\n", FormatGeopoint(business.geoPoint)); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of businesses found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve express business.", ex); + } + } + + /// + /// Formats the address as a printable text. + /// + /// The address object. + /// The formatted text. + private static string FormatAddress(Address address) { + if (address == null) { + return "Not available."; + } + StringBuilder addressBuilder = new StringBuilder(); + + addressBuilder.AppendFormat("Line 1: {0}\n", address.streetAddress ?? ""); + addressBuilder.AppendFormat("Line 2: {0}\n", address.streetAddress2 ?? ""); + addressBuilder.AppendFormat("Province Name: {0}\n", address.provinceName ?? ""); + addressBuilder.AppendFormat("Province Code: {0}\n", address.provinceCode ?? ""); + addressBuilder.AppendFormat("City name: {0}\n", address.cityName ?? ""); + addressBuilder.AppendFormat("Postal code: {0}\n", address.postalCode ?? ""); + addressBuilder.AppendFormat("Country name: {0}\n", address.countryCode ?? ""); + + return addressBuilder.ToString(); + } + + /// + /// Formats the geopoint as a printable text. + /// + /// The geo point. + /// The formatted text. + private string FormatGeopoint(GeoPoint geoPoint) { + if (geoPoint == null) { + return "(Unknown, Unknown)"; + } + return string.Format("({0}, {1})", (decimal) geoPoint.latitudeInMicroDegrees / 1000000, + (decimal) geoPoint.longitudeInMicroDegrees / 1000000); + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201402/Express/GetProductServices.cs b/examples/AdWords/CSharp/v201402/Express/GetProductServices.cs new file mode 100644 index 00000000000..d6c4fd15853 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Express/GetProductServices.cs @@ -0,0 +1,119 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example shows how to retrieve AdWords Express product/service + /// objects related to specific criteria. + /// + /// Tags: ProductServiceService.get + /// + public class GetProductServices : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to retrieve AdWords Express product/service " + + "objects related to specific criteria."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetProductServices codeExample = new GetProductServices(); + Console.WriteLine(codeExample.Description); + try { + string productServiceSuggestion = "INSERT_PRODUCT_SERVICE_SUGGESTION_HERE"; + string localeText = "INSERT_LOCALE_TEXT_HERE"; + codeExample.Run(new AdWordsUser(), productServiceSuggestion, localeText); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The product/service suggestion. + /// + /// The locale text. + public void Run(AdWordsUser user, string productServiceSuggestion, string localeText) { + // Get the service, which loads the required classes. + ProductServiceService productServiceService = (ProductServiceService) user.GetService( + AdWordsService.v201402.ProductServiceService); + + // Create selector. + Selector selector = new Selector(); + selector.fields = new string[] {"ProductServiceText"}; + + // Create predicates. + Predicate textPredicate = new Predicate(); + textPredicate.field = "ProductServiceText"; + textPredicate.@operator = PredicateOperator.EQUALS; + textPredicate.values = new string[] {productServiceSuggestion}; + + Predicate localePredicate = new Predicate(); + localePredicate.field = "Locale"; + localePredicate.@operator = PredicateOperator.EQUALS; + localePredicate.values = new string[]{localeText}; + + selector.predicates = new Predicate[] {textPredicate, localePredicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + ProductServicePage page = null; + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Make the get request. + page = productServiceService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (ProductService productService in page.entries) { + Console.WriteLine("Product/service with text '{0}' found", productService.text); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of products/services found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve products/services.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201402/Express/GetPromotions.cs b/examples/AdWords/CSharp/v201402/Express/GetPromotions.cs new file mode 100644 index 00000000000..44ea456ef65 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Express/GetPromotions.cs @@ -0,0 +1,110 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Text; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example gets all express businesses. To add an express + /// business, run AddExpressBusinesses.cs. + /// + /// Tags: ExpressBusinessService.get + /// + public class GetPromotions : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all express businesses. To add an express business, " + + "run AddExpressBusinesses.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetPromotions codeExample = new GetPromotions(); + Console.WriteLine(codeExample.Description); + try { + long businessId = long.Parse("INSERT_ADWORDS_EXPRESS_BUSINESS_ID_HERE"); + codeExample.Run(new AdWordsUser(), businessId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The AdWords Express business id. + public void Run(AdWordsUser user, long businessId) { + // Get the PromotionService. + PromotionService promotionService = (PromotionService) + user.GetService(AdWordsService.v201402.PromotionService); + + // Set the business ID to the service. + promotionService.RequestHeader.expressBusinessId = businessId; + + Selector selector = new Selector(); + selector.fields = new String[] {"PromotionId", "Name", "Status", "DestinationUrl", + "StreetAddressVisible", "CallTrackingEnabled", "ContentNetworkOptedOut", "Budget", + "PromotionCriteria", "RemainingBudget", "Creatives", "CampaignIds" }; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + PromotionPage page = null; + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get all promotions for the business. + page = promotionService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (Promotion promotion in page.entries) { + // Summary. + Console.WriteLine("0) Express promotion with name = {1} and id = {2} was found.", + i + 1, promotion.id, promotion.name); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of promotions found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve promotions.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201402/Express/UpdateExpressBusiness.cs b/examples/AdWords/CSharp/v201402/Express/UpdateExpressBusiness.cs new file mode 100644 index 00000000000..852c77b4068 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Express/UpdateExpressBusiness.cs @@ -0,0 +1,89 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example updates an express business. To add an express + /// business, run AddExpressBusinesses.cs. + /// + /// Tags: ExpressBusinessService.mutate + /// + public class UpdateExpressBusiness : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates an express business. To add an express business, run " + + "AddExpressBusinesses.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdateExpressBusiness codeExample = new UpdateExpressBusiness(); + Console.WriteLine(codeExample.Description); + try { + long businessId = long.Parse("INSERT_ADWORDS_EXPRESS_BUSINESS_ID_HERE"); + codeExample.Run(new AdWordsUser(), businessId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The AdWords Express business id. + public void Run(AdWordsUser user, long businessId) { + // Get the ExpressBusinessService. + ExpressBusinessService businessService = (ExpressBusinessService) + user.GetService(AdWordsService.v201402.ExpressBusinessService); + + // Update the website and address for the business + ExpressBusiness business = new ExpressBusiness(); + business.id = businessId; + business.name = "Express Interplanetary Cruise #" + ExampleUtilities.GetShortRandomString(); + business.website = "http://www.example.com/?myParam=" + businessId; + + ExpressBusinessOperation operation = new ExpressBusinessOperation(); + operation.@operator = Operator.SET; + operation.operand = business; + + try { + ExpressBusiness[] updatedBusinesses = + businessService.mutate(new ExpressBusinessOperation[] { operation }); + + Console.WriteLine("Express business with ID {0} and name '{1}' was updated.", + updatedBusinesses[0].id, updatedBusinesses[0].name); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update express business.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201402/Express/UpdatePromotion.cs b/examples/AdWords/CSharp/v201402/Express/UpdatePromotion.cs new file mode 100644 index 00000000000..b3fc69b40e8 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Express/UpdatePromotion.cs @@ -0,0 +1,100 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example updates a promotion for an express businesses. To add + /// a promotion, run UpdatePromotion.cs. + /// + /// Tags: PromotionService.mutate + /// + public class UpdatePromotion : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a promotion for an express businesses. To add a " + + "promotion, run UpdatePromotion.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdatePromotion codeExample = new UpdatePromotion(); + Console.WriteLine(codeExample.Description); + try { + long businessId = long.Parse("INSERT_ADWORDS_EXPRESS_BUSINESS_ID_HERE"); + long promotionId = long.Parse("INSERT_PROMOTION_ID_HERE"); + codeExample.Run(new AdWordsUser(), businessId, promotionId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The AdWords Express business id. + /// The promotion id. + public void Run(AdWordsUser user, long businessId, long promotionId) { + // Get the ExpressBusinessService. + ExpressBusinessService businessService = (ExpressBusinessService) + user.GetService(AdWordsService.v201402.ExpressBusinessService); + + // Get the PromotionService + PromotionService promotionService = (PromotionService) + user.GetService(AdWordsService.v201402.PromotionService); + + // Set the business ID to the service. + promotionService.RequestHeader.expressBusinessId = businessId; + + // Update the budget for the promotion + Promotion promotion = new Promotion(); + promotion.id = promotionId; + Money newBudget = new Money(); + newBudget.microAmount = 2000000; + promotion.budget = newBudget; + + PromotionOperation operation = new PromotionOperation(); + operation.@operator = Operator.SET; + operation.operand = promotion; + + try { + Promotion[] updatedPromotions = promotionService.mutate( + new PromotionOperation[] { operation }); + + Console.WriteLine("Promotion ID {0} for business ID {1} now has budget micro " + + "amount {2}.", promotionId, businessId, + updatedPromotions[0].budget.microAmount); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update promotions.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201402/Miscellaneous/GetAllVideosAndImages.cs b/examples/AdWords/CSharp/v201402/Miscellaneous/GetAllVideosAndImages.cs new file mode 100644 index 00000000000..c7d5f8d9367 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Miscellaneous/GetAllVideosAndImages.cs @@ -0,0 +1,139 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example gets all videos and images. To upload video, see + /// http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. + /// To upload image, run UploadImage.cs. + /// + /// Tags: MediaService.get + /// + public class GetAllVideosAndImages : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAllVideosAndImages codeExample = new GetAllVideosAndImages(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all videos and images. To upload video, see " + + "http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. To " + + "upload image, run UploadImage.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the MediaService. + MediaService mediaService = (MediaService) user.GetService( + AdWordsService.v201402.MediaService); + + // Create a selector. + Selector selector = new Selector(); + selector.fields = new string[] {"MediaId", "Width", "Height", "MimeType"}; + + // Set the filter. + Predicate predicate = new Predicate(); + predicate.@operator = PredicateOperator.IN; + predicate.field = "Type"; + predicate.values = new string[] {MediaMediaType.VIDEO.ToString(), + MediaMediaType.IMAGE.ToString()}; + + selector.predicates = new Predicate[] {predicate}; + + // Set selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + MediaPage page = new MediaPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + page = mediaService.get(selector); + + if (page != null && page.entries != null) { + int i = offset; + + foreach (Media media in page.entries) { + if (media is Video) { + Video video = (Video) media; + Console.WriteLine("{0}) Video with id \"{1}\" and name \"{2}\" was found.", + i, video.mediaId, video.name); + } else if (media is Image) { + Image image = (Image) media; + Dictionary dimensions = + CreateMediaDimensionMap(image.dimensions); + Console.WriteLine("{0}) Image with id '{1}', dimensions '{2}x{3}', and MIME type " + + "'{4}' was found.", i, image.mediaId, dimensions[MediaSize.FULL].width, + dimensions[MediaSize.FULL].height, image.mimeType); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of images and videos found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get images and videos.", ex); + } + } + + /// + /// Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + /// + /// The array of Media_Size_DimensionsMapEntry to be + /// converted into a dictionary. + /// A dictionary with key as MediaSize, and value as Dimensions. + /// + private Dictionary CreateMediaDimensionMap( + Media_Size_DimensionsMapEntry[] dimensions) { + Dictionary mediaMap = new Dictionary(); + foreach (Media_Size_DimensionsMapEntry dimension in dimensions) { + mediaMap.Add(dimension.key, dimension.value); + } + return mediaMap; + } + } +} diff --git a/examples/AdWords/CSharp/v201402/Miscellaneous/UploadImage.cs b/examples/AdWords/CSharp/v201402/Miscellaneous/UploadImage.cs new file mode 100644 index 00000000000..4754f748d6e --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Miscellaneous/UploadImage.cs @@ -0,0 +1,106 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example uploads an image. To get images, run GetAllVideosAndImages.cs. + /// + /// Tags: MediaService.upload + /// + public class UploadImage : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UploadImage codeExample = new UploadImage(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example uploads an image. To get images, run GetAllVideosAndImages.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the MediaService. + MediaService mediaService = (MediaService) user.GetService( + AdWordsService.v201402.MediaService); + + // Create the image. + Image image = new Image(); + image.data = MediaUtilities.GetAssetDataFromUrl("http://goo.gl/HJM3L"); + image.type = MediaMediaType.IMAGE; + + try { + // Upload the image. + Media[] result = mediaService.upload(new Media[] {image}); + + // Display the results. + if (result != null && result.Length > 0) { + Media newImage = result[0]; + Dictionary dimensions = + CreateMediaDimensionMap(newImage.dimensions); + Console.WriteLine("Image with id '{0}', dimensions '{1}x{2}', and MIME type '{3}'" + + " was uploaded.", newImage.mediaId, dimensions[MediaSize.FULL].width, + dimensions[MediaSize.FULL].height, newImage.mimeType); + } else { + Console.WriteLine("No images were uploaded."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to upload image.", ex); + } + } + + /// + /// Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + /// + /// The array of Media_Size_DimensionsMapEntry to be + /// converted into a dictionary. + /// A dictionary with key as MediaSize, and value as Dimensions. + /// + private Dictionary CreateMediaDimensionMap( + Media_Size_DimensionsMapEntry[] dimensions) { + Dictionary mediaMap = new Dictionary(); + foreach (Media_Size_DimensionsMapEntry dimension in dimensions) { + mediaMap.Add(dimension.key, dimension.value); + } + return mediaMap; + } + } +} diff --git a/examples/AdWords/CSharp/v201402/Optimization/EstimateKeywordTraffic.cs b/examples/AdWords/CSharp/v201402/Optimization/EstimateKeywordTraffic.cs new file mode 100644 index 00000000000..bf988008a79 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Optimization/EstimateKeywordTraffic.cs @@ -0,0 +1,173 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example gets keyword traffic estimates. + /// + /// Tags: TrafficEstimatorService.get + /// + public class EstimateKeywordTraffic : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + EstimateKeywordTraffic codeExample = new EstimateKeywordTraffic(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets keyword traffic estimates."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the TrafficEstimatorService. + TrafficEstimatorService trafficEstimatorService = (TrafficEstimatorService) user.GetService( + AdWordsService.v201402.TrafficEstimatorService); + + // Create keywords. Up to 2000 keywords can be passed in a single request. + Keyword keyword1 = new Keyword(); + keyword1.text = "mars cruise"; + keyword1.matchType = KeywordMatchType.BROAD; + + Keyword keyword2 = new Keyword(); + keyword2.text = "cheap cruise"; + keyword2.matchType = KeywordMatchType.PHRASE; + + Keyword keyword3 = new Keyword(); + keyword3.text = "cruise"; + keyword3.matchType = KeywordMatchType.EXACT; + + Keyword[] keywords = new Keyword[] {keyword1, keyword2, keyword3}; + + // Create a keyword estimate request for each keyword. + List keywordEstimateRequests = new List(); + + foreach (Keyword keyword in keywords) { + KeywordEstimateRequest keywordEstimateRequest = new KeywordEstimateRequest(); + keywordEstimateRequest.keyword = keyword; + keywordEstimateRequests.Add(keywordEstimateRequest); + } + + // Create negative keywords. + Keyword negativeKeyword1 = new Keyword(); + negativeKeyword1.text = "moon walk"; + negativeKeyword1.matchType = KeywordMatchType.BROAD; + + KeywordEstimateRequest negativeKeywordEstimateRequest = new KeywordEstimateRequest(); + negativeKeywordEstimateRequest.keyword = negativeKeyword1; + negativeKeywordEstimateRequest.isNegative = true; + keywordEstimateRequests.Add(negativeKeywordEstimateRequest); + + // Create ad group estimate requests. + AdGroupEstimateRequest adGroupEstimateRequest = new AdGroupEstimateRequest(); + adGroupEstimateRequest.keywordEstimateRequests = keywordEstimateRequests.ToArray(); + adGroupEstimateRequest.maxCpc = new Money(); + adGroupEstimateRequest.maxCpc.microAmount = 1000000; + + // Create campaign estimate requests. + CampaignEstimateRequest campaignEstimateRequest = new CampaignEstimateRequest(); + campaignEstimateRequest.adGroupEstimateRequests = new AdGroupEstimateRequest[] { + adGroupEstimateRequest}; + + // See http://code.google.com/apis/adwords/docs/appendix/countrycodes.html + // for a detailed list of country codes. + Location countryCriterion = new Location(); + countryCriterion.id = 2840; //US + + // See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + // for a detailed list of language codes. + Language languageCriterion = new Language(); + languageCriterion.id = 1000; //en + + campaignEstimateRequest.criteria = new Criterion[] {countryCriterion, languageCriterion}; + + // Create the selector. + TrafficEstimatorSelector selector = new TrafficEstimatorSelector(); + selector.campaignEstimateRequests = new CampaignEstimateRequest[] {campaignEstimateRequest}; + + try { + // Get traffic estimates. + TrafficEstimatorResult result = trafficEstimatorService.get(selector); + + // Display traffic estimates. + if (result != null && result.campaignEstimates != null && + result.campaignEstimates.Length > 0) { + CampaignEstimate campaignEstimate = result.campaignEstimates[0]; + if (campaignEstimate.adGroupEstimates != null && + campaignEstimate.adGroupEstimates.Length > 0) { + AdGroupEstimate adGroupEstimate = campaignEstimate.adGroupEstimates[0]; + + if (adGroupEstimate.keywordEstimates != null) { + for (int i = 0; i < adGroupEstimate.keywordEstimates.Length; i++) { + Keyword keyword = keywordEstimateRequests[i].keyword; + KeywordEstimate keywordEstimate = adGroupEstimate.keywordEstimates[i]; + + if (keywordEstimateRequests[i].isNegative) { + continue; + } + + // Find the mean of the min and max values. + long meanAverageCpc = (keywordEstimate.min.averageCpc.microAmount + + keywordEstimate.max.averageCpc.microAmount) / 2; + double meanAveragePosition = (keywordEstimate.min.averagePosition + + keywordEstimate.max.averagePosition) / 2; + float meanClicks = (keywordEstimate.min.clicksPerDay + + keywordEstimate.max.clicksPerDay) / 2; + long meanTotalCost = (keywordEstimate.min.totalCost.microAmount + + keywordEstimate.max.totalCost.microAmount) / 2; + + Console.WriteLine("Results for the keyword with text = '{0}' and match type = " + + "'{1}':", keyword.text, keyword.matchType); + Console.WriteLine(" Estimated average CPC: {0}", meanAverageCpc); + Console.WriteLine(" Estimated ad position: {0:0.00}", meanAveragePosition); + Console.WriteLine(" Estimated daily clicks: {0}", meanClicks); + Console.WriteLine(" Estimated daily cost: {0}", meanTotalCost); + } + } + } + } else { + Console.WriteLine("No traffic estimates were returned.\n"); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve traffic estimates.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/Optimization/GetAdGroupBidSimulations.cs b/examples/AdWords/CSharp/v201402/Optimization/GetAdGroupBidSimulations.cs new file mode 100644 index 00000000000..a6d1feea8c7 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Optimization/GetAdGroupBidSimulations.cs @@ -0,0 +1,105 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example gets bid landscapes for an ad group. To get ad groups, + /// run GetAdGroups.cs. + /// + /// Tags: DataService.getAdGroupBidLandscape + /// + public class GetAdGroupBidSimulations : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAdGroupBidSimulations codeExample = new GetAdGroupBidSimulations(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets bid landscapes for an ad group. To get ad groups, run " + + "GetAdGroups.cs"; + } + } + + /// + /// Runs the specified user. + /// + /// The user. + /// Id of the ad group for which bid simulations are + /// retrieved. + public void Run(AdWordsUser user, long adGroupId) { + // Get the DataService. + DataService dataService = (DataService) user.GetService(AdWordsService.v201402.DataService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"AdGroupId", "LandscapeType", "LandscapeCurrent", "StartDate", + "EndDate", "Bid", "LocalClicks", "LocalCost", "MarginalCpc", "LocalImpressions"}; + + // Set the filters. + Predicate adGroupPredicate = new Predicate(); + adGroupPredicate.field = "AdGroupId"; + adGroupPredicate.@operator = PredicateOperator.IN; + adGroupPredicate.values = new string[] {adGroupId.ToString()}; + + selector.predicates = new Predicate[] {adGroupPredicate}; + + try { + // Get bid landscape for ad group. + AdGroupBidLandscapePage page = dataService.getAdGroupBidLandscape(selector); + if (page != null && page.entries != null && page.entries.Length > 0) { + foreach (AdGroupBidLandscape bidLandscape in page.entries) { + Console.WriteLine("Found ad group bid landscape with ad group id '{0}', type '{1}', " + + "current: '{2}', start date '{3}', end date '{4}', and landscape points", + bidLandscape.adGroupId, bidLandscape.type, bidLandscape.landscapeCurrent, + bidLandscape.startDate, bidLandscape.endDate); + foreach (BidLandscapeLandscapePoint point in bidLandscape.landscapePoints) { + Console.WriteLine("- bid: {0} => clicks: {1}, cost: {2}, marginalCpc: {3}, " + + "impressions: {4}", point.bid.microAmount, point.bid.microAmount, + point.clicks, point.cost.microAmount, point.marginalCpc.microAmount, + point.impressions); + } + } + } else { + Console.WriteLine("No ad group bid landscapes were found."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get ad group bid landscapes.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/Optimization/GetKeywordBidSimulations.cs b/examples/AdWords/CSharp/v201402/Optimization/GetKeywordBidSimulations.cs new file mode 100644 index 00000000000..8210cd46e68 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Optimization/GetKeywordBidSimulations.cs @@ -0,0 +1,133 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example gets a bid landscape for an ad group and a keyword. + /// To get ad groups, run GetAdGroups.cs. To get keywords, run + /// GetKeywords.cs. + /// + /// Tags: DataService.getCriterionBidLandscape + /// + public class GetKeywordBidSimulations : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetKeywordBidSimulations codeExample = new GetKeywordBidSimulations(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long keywordId = long.Parse("INSERT_KEYWORD_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, keywordId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a bid landscape for an ad group and a keyword. " + + "To get ad groups, run GetAdGroups.cs. To get keywords, run GetKeywords.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group for which keyword bid + /// simulations are retrieved. + /// Id of the keyword for which bid simulations are + /// retrieved. + public void Run(AdWordsUser user, long adGroupId, long keywordId) { + // Get the DataService. + DataService dataService = (DataService) user.GetService(AdWordsService.v201402.DataService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"AdGroupId", "CriterionId", "StartDate", "EndDate", "Bid", + "LocalClicks", "LocalCost", "MarginalCpc", "LocalImpressions"}; + + // Create the filters. + Predicate adGroupPredicate = new Predicate(); + adGroupPredicate.field = "AdGroupId"; + adGroupPredicate.@operator = PredicateOperator.IN; + adGroupPredicate.values = new string[] {adGroupId.ToString()}; + + Predicate keywordPredicate = new Predicate(); + keywordPredicate.field = "CriterionId"; + keywordPredicate.@operator = PredicateOperator.IN; + keywordPredicate.values = new string[] {keywordId.ToString()}; + + selector.predicates = new Predicate[] {adGroupPredicate, keywordPredicate}; + + // Set selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + CriterionBidLandscapePage page = new CriterionBidLandscapePage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get bid landscape for keywords. + page = dataService.getCriterionBidLandscape(selector); + + // Display bid landscapes. + if (page != null && page.entries != null) { + int i = offset; + + foreach (CriterionBidLandscape bidLandscape in page.entries) { + Console.WriteLine("{0}) Found criterion bid landscape with ad group id '{1}', " + + "keyword id '{2}', start date '{3}', end date '{4}', and landscape points:", + i, bidLandscape.adGroupId, bidLandscape.criterionId, bidLandscape.startDate, + bidLandscape.endDate); + foreach (BidLandscapeLandscapePoint bidLandscapePoint in + bidLandscape.landscapePoints) { + Console.WriteLine("- bid: {0} => clicks: {1}, cost: {2}, marginalCpc: {3}, " + + "impressions: {4}\n", bidLandscapePoint.bid.microAmount, + bidLandscapePoint.clicks, bidLandscapePoint.cost.microAmount, + bidLandscapePoint.marginalCpc.microAmount, bidLandscapePoint.impressions); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of keyword bid landscapes found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve keyword bid landscapes.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/Optimization/GetKeywordIdeas.cs b/examples/AdWords/CSharp/v201402/Optimization/GetKeywordIdeas.cs new file mode 100644 index 00000000000..7e94deb7509 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Optimization/GetKeywordIdeas.cs @@ -0,0 +1,150 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example retrieves keywords that are related to a given keyword. + /// + /// Tags: TargetingIdeaService.get + /// + public class GetKeywordIdeas : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetKeywordIdeas codeExample = new GetKeywordIdeas(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves keywords that are related to a given keyword."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the TargetingIdeaService. + TargetingIdeaService targetingIdeaService = + (TargetingIdeaService) user.GetService(AdWordsService.v201402.TargetingIdeaService); + + string keywordText = "mars cruise"; + + // Create selector. + TargetingIdeaSelector selector = new TargetingIdeaSelector(); + selector.requestType = RequestType.IDEAS; + selector.ideaType = IdeaType.KEYWORD; + selector.requestedAttributeTypes = new AttributeType[] { + AttributeType.KEYWORD_TEXT, + AttributeType.SEARCH_VOLUME, + AttributeType.CATEGORY_PRODUCTS_AND_SERVICES}; + + // Language setting (optional). + // The ID can be found in the documentation: + // https://developers.google.com/adwords/api/docs/appendix/languagecodes + // Note: As of v201302, only a single language parameter is allowed. + LanguageSearchParameter languageParameter = new LanguageSearchParameter(); + Language english = new Language(); + english.id = 1000; + languageParameter.languages = new Language[] {english}; + + // Create related to query search parameter. + RelatedToQuerySearchParameter relatedToQuerySearchParameter = + new RelatedToQuerySearchParameter(); + relatedToQuerySearchParameter.queries = new String[] {keywordText}; + selector.searchParameters = + new SearchParameter[] {relatedToQuerySearchParameter, languageParameter}; + + // Set selector paging (required for targeting idea service). + Paging paging = new Paging(); + paging.startIndex = 0; + paging.numberResults = 500; + selector.paging = paging; + + int offset = 0; + int pageSize = 500; + + TargetingIdeaPage page = new TargetingIdeaPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + // Get related keywords. + page = targetingIdeaService.get(selector); + + // Display related keywords. + if (page.entries != null && page.entries.Length > 0) { + int i = offset; + foreach (TargetingIdea targetingIdea in page.entries) { + string keyword = null; + string categories = null; + long averageMonthlySearches = 0; + + foreach (Type_AttributeMapEntry entry in targetingIdea.data) { + if (entry.key == AttributeType.KEYWORD_TEXT) { + keyword = (entry.value as StringAttribute).value; + } + if (entry.key == AttributeType.CATEGORY_PRODUCTS_AND_SERVICES) { + IntegerSetAttribute categorySet = entry.value as IntegerSetAttribute; + StringBuilder builder = new StringBuilder(); + if (categorySet.value != null) { + foreach (int value in categorySet.value) { + builder.AppendFormat("{0}, ", value); + } + categories = builder.ToString().Trim(new char[] {',', ' '}); + } + } + if (entry.key == AttributeType.SEARCH_VOLUME) { + averageMonthlySearches = (entry.value as LongAttribute).value; + } + } + Console.WriteLine("Keyword with text '{0}', and average monthly search volume " + + "'{1}' was found with categories: {2}", keyword, averageMonthlySearches, + categories); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of related keywords found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve related keywords.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/Optimization/GetPlacementIdeas.cs b/examples/AdWords/CSharp/v201402/Optimization/GetPlacementIdeas.cs new file mode 100644 index 00000000000..ccfc4419d19 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Optimization/GetPlacementIdeas.cs @@ -0,0 +1,122 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example retrieves urls that have content keywords related to a + /// given website. + /// + /// Tags: TargetingIdeaService.get + /// + public class GetPlacementIdeas : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetPlacementIdeas codeExample = new GetPlacementIdeas(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves urls that have content keywords related to a" + + " given website."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the TargetingIdeaService. + TargetingIdeaService targetingIdeaService = + (TargetingIdeaService) user.GetService(AdWordsService.v201402.TargetingIdeaService); + + // Create seed url. + string url = "mars.google.com"; + + // Create the selector. + TargetingIdeaSelector selector = new TargetingIdeaSelector(); + selector.requestType = RequestType.IDEAS; + selector.ideaType = IdeaType.PLACEMENT; + selector.requestedAttributeTypes = new AttributeType[] {AttributeType.CRITERION, + AttributeType.PLACEMENT_TYPE}; + + // Create related to url search parameter. + RelatedToUrlSearchParameter relatedToUrlSearchParameter = new RelatedToUrlSearchParameter(); + relatedToUrlSearchParameter.urls = new string[] {url}; + relatedToUrlSearchParameter.includeSubUrls = false; + selector.searchParameters = new SearchParameter[] {relatedToUrlSearchParameter}; + + // Set selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + TargetingIdeaPage page = new TargetingIdeaPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get placement ideas. + page = targetingIdeaService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + + foreach (TargetingIdea idea in page.entries) { + foreach (Type_AttributeMapEntry entry in idea.data) { + if (entry.key == AttributeType.CRITERION) { + CriterionAttribute placementAttribute = entry.value as CriterionAttribute; + Placement placement = (Placement) placementAttribute.value; + Console.WriteLine("Related placement urls were found at '{0}'.", + (placementAttribute.value as Placement).url); + } + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of related placements found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve related placements.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/Remarketing/AddAudience.cs b/examples/AdWords/CSharp/v201402/Remarketing/AddAudience.cs new file mode 100644 index 00000000000..21b2602d282 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Remarketing/AddAudience.cs @@ -0,0 +1,156 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example illustrates how to create a user list a.k.a. audience. + /// + /// Tags: UserListService.mutate + /// + public class AddAudience : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAudience codeExample = new AddAudience(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create a user list a.k.a. audience."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the UserListService. + AdwordsUserListService userListService = + (AdwordsUserListService) user.GetService(AdWordsService.v201402.AdwordsUserListService); + + // Get the ConversionTrackerService. + ConversionTrackerService conversionTrackerService = + (ConversionTrackerService)user.GetService(AdWordsService.v201402. + ConversionTrackerService); + + BasicUserList userList = new BasicUserList(); + userList.name = "Mars cruise customers #" + ExampleUtilities.GetRandomString(); + userList.description = "A list of mars cruise customers in the last year."; + userList.status = UserListMembershipStatus.OPEN; + userList.membershipLifeSpan = 365; + + UserListConversionType conversionType = new UserListConversionType(); + conversionType.name = userList.name; + userList.conversionTypes = new UserListConversionType[] {conversionType}; + + // Optional: Set the user list status. + userList.status = UserListMembershipStatus.OPEN; + + // Create the operation. + UserListOperation operation = new UserListOperation(); + operation.operand = userList; + operation.@operator = Operator.ADD; + + try { + // Add the user list. + UserListReturnValue retval = userListService.mutate(new UserListOperation[] {operation}); + + UserList[] userLists = null; + if (retval != null && retval.value != null) { + userLists = retval.value; + // Get all conversion snippets + List conversionIds = new List(); + foreach (BasicUserList newUserList in userLists) { + if (newUserList.conversionTypes != null) { + foreach (UserListConversionType newConversionType in newUserList.conversionTypes) { + conversionIds.Add(newConversionType.id.ToString()); + } + } + } + + Dictionary conversionsMap = + new Dictionary(); + + if (conversionIds.Count > 0) { + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id"}; + + Predicate conversionTypePredicate = new Predicate(); + conversionTypePredicate.field = "Id"; + conversionTypePredicate.@operator = PredicateOperator.IN; + conversionTypePredicate.values = conversionIds.ToArray(); + selector.predicates = new Predicate[] {conversionTypePredicate}; + + // Get all conversion trackers. + ConversionTrackerPage page = conversionTrackerService.get(selector); + + if (page != null && page.entries != null) { + foreach (ConversionTracker tracker in page.entries) { + conversionsMap[tracker.id] = tracker; + } + } + } + + // Display the results. + foreach (BasicUserList newUserList in userLists) { + Console.WriteLine("User list with name '{0}' and id '{1}' was added.", + newUserList.name, newUserList.id); + + // Display user list associated conversion code snippets. + if (newUserList.conversionTypes != null) { + foreach (UserListConversionType userListConversionType in + newUserList.conversionTypes) { + if (conversionsMap.ContainsKey(userListConversionType.id)) { + AdWordsConversionTracker conversionTracker = + (AdWordsConversionTracker) conversionsMap[userListConversionType.id]; + Console.WriteLine("Conversion type code snippet associated to the list:\n{0}\n", + conversionTracker.snippet); + } else { + throw new Exception("Failed to associate conversion type code snippet."); + } + } + } + } + } else { + Console.WriteLine("No user lists (a.k.a. audiences) were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add user lists (a.k.a. audiences).", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/Remarketing/AddConversionTracker.cs b/examples/AdWords/CSharp/v201402/Remarketing/AddConversionTracker.cs new file mode 100644 index 00000000000..694ae70990f --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Remarketing/AddConversionTracker.cs @@ -0,0 +1,107 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example adds an AdWords conversion tracker. + /// + /// Tags: ConversionTrackerService.mutate + /// + public class AddConversionTracker : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddConversionTracker codeExample = new AddConversionTracker(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds an AdWords conversion tracker."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ConversionTrackerService. + ConversionTrackerService conversionTrackerService = + (ConversionTrackerService)user.GetService(AdWordsService.v201402. + ConversionTrackerService); + + // Create Adwords conversion tracker. + AdWordsConversionTracker conversionTracker = new AdWordsConversionTracker(); + conversionTracker.name = "Earth to Mars Cruises Conversion #" + + ExampleUtilities.GetRandomString(); + conversionTracker.category = ConversionTrackerCategory.DEFAULT; + conversionTracker.markupLanguage = AdWordsConversionTrackerMarkupLanguage.HTML; + conversionTracker.textFormat = AdWordsConversionTrackerTextFormat.HIDDEN; + + // Set optional fields. + conversionTracker.status = ConversionTrackerStatus.ENABLED; + conversionTracker.viewthroughLookbackWindow = 15; + conversionTracker.isProductAdsChargeable = true; + conversionTracker.productAdsChargeableConversionWindow = 15; + conversionTracker.conversionPageLanguage = "en"; + conversionTracker.backgroundColor = "#0000FF"; + conversionTracker.defaultRevenueValue = 23.41; + conversionTracker.alwaysUseDefaultRevenueValue = true; + + // Create the operation. + ConversionTrackerOperation operation = new ConversionTrackerOperation(); + operation.@operator = Operator.ADD; + operation.operand = conversionTracker; + + try { + // Add conversion tracker. + ConversionTrackerReturnValue retval = conversionTrackerService.mutate( + new ConversionTrackerOperation[] {operation}); + + // Display the results. + if (retval != null && retval.value != null && retval.value.Length > 0) { + ConversionTracker newConversionTracker = retval.value[0]; + Console.WriteLine("Conversion tracker with id '{0}', name '{1}', status '{2}', " + + "category '{3}' was added.", newConversionTracker.id, newConversionTracker.name, + newConversionTracker.status, newConversionTracker.category); + } else { + Console.WriteLine("No conversion trackers were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add conversion tracker.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/Reporting/DownloadCriteriaReport.cs b/examples/AdWords/CSharp/v201402/Reporting/DownloadCriteriaReport.cs new file mode 100644 index 00000000000..a200189757e --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Reporting/DownloadCriteriaReport.cs @@ -0,0 +1,114 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util.Reports; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example gets and downloads a criteria Ad Hoc report from an XML + /// report definition. + /// + public class DownloadCriteriaReport : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DownloadCriteriaReport codeExample = new DownloadCriteriaReport(); + Console.WriteLine(codeExample.Description); + try { + string fileName = "INSERT_FILE_NAME_HERE"; + codeExample.Run(new AdWordsUser(), fileName); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets and downloads a criteria Ad Hoc report from an XML report " + + "definition."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The file to which the report is downloaded. + /// + public void Run(AdWordsUser user, string fileName) { + ReportDefinition definition = new ReportDefinition(); + + definition.reportName = "Last 7 days CRITERIA_PERFORMANCE_REPORT"; + definition.reportType = ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT; + definition.downloadFormat = DownloadFormat.GZIPPED_CSV; + definition.dateRangeType = ReportDefinitionDateRangeType.LAST_7_DAYS; + + // Create selector. + Selector selector = new Selector(); + selector.fields = new string[] {"CampaignId", "AdGroupId", "Id", "CriteriaType", "Criteria", + "CriteriaDestinationUrl", "Clicks", "Impressions", "Cost"}; + + Predicate predicate = new Predicate(); + predicate.field = "Status"; + predicate.@operator = PredicateOperator.IN; + predicate.values = new string[] {"ACTIVE", "PAUSED"}; + selector.predicates = new Predicate[] {predicate}; + + definition.selector = selector; + definition.includeZeroImpressions = true; + + string filePath = ExampleUtilities.GetHomeDir() + Path.DirectorySeparatorChar + fileName; + + try { + // If you know that your report is small enough to fit in memory, then + // you can instead use + // ReportUtilities utilities = new ReportUtilities(user); + // utilities.ReportVersion = "v201402"; + // ClientReport report = utilities.GetClientReport(definition); + // + // // Get the text report directly if you requested a text format + // // (e.g. xml) + // string reportText = report.Text; + // + // // Get the binary report if you requested a binary format + // // (e.g. gzip) + // byte[] reportBytes = report.Contents; + // + // // Deflate a zipped binary report for further processing. + // string deflatedReportText = Encoding.UTF8.GetString( + // MediaUtilities.DeflateGZipData(report.Contents)); + ReportUtilities utilities = new ReportUtilities(user); + utilities.ReportVersion = "v201402"; + utilities.DownloadClientReport(definition, filePath); + Console.WriteLine("Report was downloaded to '{0}'.", filePath); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to download report.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/Reporting/DownloadCriteriaReportWithAwql.cs b/examples/AdWords/CSharp/v201402/Reporting/DownloadCriteriaReportWithAwql.cs new file mode 100644 index 00000000000..153ca2f9abb --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Reporting/DownloadCriteriaReportWithAwql.cs @@ -0,0 +1,99 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util.Reports; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example gets and downloads a criteria Ad Hoc report from an AWQL + /// query. See https://developers.google.com/adwords/api/docs/guides/awql for + /// AWQL documentation. + /// + public class DownloadCriteriaReportWithAwql : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DownloadCriteriaReportWithAwql codeExample = new DownloadCriteriaReportWithAwql(); + Console.WriteLine(codeExample.Description); + try { + string fileName = "INSERT_FILE_NAME_HERE"; + codeExample.Run(new AdWordsUser(), fileName); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets and downloads a criteria Ad Hoc report from an AWQL " + + "query. See https://developers.google.com/adwords/api/docs/guides/awql for AWQL " + + "documentation."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The file to which the report is downloaded. + /// + public void Run(AdWordsUser user, string fileName) { + string query = "SELECT CampaignId, AdGroupId, Id, Criteria, CriteriaType, Impressions, " + + "Clicks, Cost FROM CRITERIA_PERFORMANCE_REPORT WHERE Status IN [ACTIVE, PAUSED] " + + "DURING LAST_7_DAYS"; + + string filePath = ExampleUtilities.GetHomeDir() + Path.DirectorySeparatorChar + fileName; + + try { + // If you know that your report is small enough to fit in memory, then + // you can instead use + // ReportUtilities utilities = new ReportUtilities(user); + // utilities.ReportVersion = "v201402"; + // ClientReport report = utilities.GetClientReport(query, format); + // + // // Get the text report directly if you requested a text format + // // (e.g. xml) + // string reportText = report.Text; + // + // // Get the binary report if you requested a binary format + // // (e.g. gzip) + // byte[] reportBytes = report.Contents; + // + // // Deflate a zipped binary report for further processing. + // string deflatedReportText = Encoding.UTF8.GetString( + // MediaUtilities.DeflateGZipData(report.Contents)); + ReportUtilities utilities = new ReportUtilities(user); + utilities.ReportVersion = "v201402"; + utilities.DownloadClientReport(query, DownloadFormat.GZIPPED_CSV.ToString(), filePath); + Console.WriteLine("Report was downloaded to '{0}'.", filePath); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to download report.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/Reporting/GetReportFields.cs b/examples/AdWords/CSharp/v201402/Reporting/GetReportFields.cs new file mode 100644 index 00000000000..900eb455aa7 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Reporting/GetReportFields.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example gets report fields. + /// + /// Tags: ReportDefinitionService.getReportFields + /// + public class GetReportFields : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetReportFields codeExample = new GetReportFields(); + Console.WriteLine(codeExample.Description); + try { + ReportDefinitionReportType reportType = (ReportDefinitionReportType) Enum.Parse( + typeof(ReportDefinitionReportType), "INSERT_REPORT_TYPE_HERE"); + codeExample.Run(new AdWordsUser(), reportType); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets report fields."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The report type to be run. + public void Run(AdWordsUser user, ReportDefinitionReportType reportType) { + // Get the ReportDefinitionService. + ReportDefinitionService reportDefinitionService = (ReportDefinitionService) user.GetService( + AdWordsService.v201402.ReportDefinitionService); + + try { + // Get the report fields. + ReportDefinitionField[] reportDefinitionFields = reportDefinitionService.getReportFields( + reportType); + if (reportDefinitionFields != null && reportDefinitionFields.Length > 0) { + // Display report fields. + Console.WriteLine("The report type '{0}' contains the following fields:", reportType); + + foreach (ReportDefinitionField reportDefinitionField in reportDefinitionFields) { + Console.Write("- {0} ({1})", reportDefinitionField.fieldName, + reportDefinitionField.fieldType); + if (reportDefinitionField.enumValues != null) { + Console.Write(" := [{0}]", String.Join(", ", reportDefinitionField.enumValues)); + } + Console.WriteLine(); + } + } else { + Console.WriteLine("This report type has no fields."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve fields for report type.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/ShoppingCampaigns/AddProductPartitionTree.cs b/examples/AdWords/CSharp/v201402/ShoppingCampaigns/AddProductPartitionTree.cs new file mode 100644 index 00000000000..2e7d71784dd --- /dev/null +++ b/examples/AdWords/CSharp/v201402/ShoppingCampaigns/AddProductPartitionTree.cs @@ -0,0 +1,313 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example creates a ProductPartition tree. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class AddProductPartitionTree : ExampleBase { + + /// + /// A helper class for creating ProductPartition trees. + /// + private class ProductPartitionHelper { + + /// + /// The ID of the AdGroup that we wish to attach the partition tree to. + /// + private long adGroupId; + + /// + /// The next temporary critertion ID to be used. + /// + /// When creating our tree we need to specify the parent-child + /// relationships between nodes. However, until a criterion has been + /// created on the server we do not have a criterionId with which to + /// refer to it. + /// + /// Instead we can specify temporary IDs that are specific to a single + /// mutate request. Once the criteria have been created they are assigned + /// an ID as normal and the temporary ID will no longer refer to it. + /// + /// A valid temporary ID is any negative integer. + /// + private long nextId = -1; + + /// + /// The set of mutate operations needed to create the current tree. + /// + private List operations = new List(); + + /// + /// Overloaded constructor. + /// + /// The ID of the AdGroup that we wish to attach + /// the partition tree to. + public ProductPartitionHelper(long adGroupId) { + this.adGroupId = adGroupId; + } + + public AdGroupCriterionOperation[] Operations { + get { + return operations.ToArray(); + } + } + + /// + /// Creates a subdivision node. + /// + /// The node that should be this node's parent. + /// + /// The value being paritioned on. + /// A new subdivision node. + public ProductPartition CreateSubdivision(ProductPartition parent, ProductDimension value) { + ProductPartition division = new ProductPartition(); + division.partitionType = ProductPartitionType.SUBDIVISION; + division.id = this.nextId--; + + // The root node has neither a parent nor a value. + if (parent != null) { + division.parentCriterionId = parent.id; + division.caseValue = value; + } + + BiddableAdGroupCriterion criterion = new BiddableAdGroupCriterion(); + criterion.adGroupId = this.adGroupId; + criterion.criterion = division; + + this.CreateAddOperation(criterion); + return division; + } + + /// + /// Creates the unit. + /// + /// The node that should be this node's parent. + /// + /// The value being paritioned on. + /// The amount to bid for matching products, + /// in micros. + /// True, if this is negative criterion, false + /// otherwise. + /// A new unit node. + public ProductPartition CreateUnit(ProductPartition parent, ProductDimension value, + long bidAmount, bool isNegative) { + ProductPartition unit = new ProductPartition(); + unit.partitionType = ProductPartitionType.UNIT; + + // The root node has neither a parent nor a value. + if (parent != null) { + unit.parentCriterionId = parent.id; + unit.caseValue = value; + } + + AdGroupCriterion criterion; + + if (isNegative) { + criterion = new NegativeAdGroupCriterion(); + } else { + BiddingStrategyConfiguration biddingStrategyConfiguration = + new BiddingStrategyConfiguration(); + + CpcBid cpcBid = new CpcBid(); + cpcBid.bid = new Money(); + cpcBid.bid.microAmount = bidAmount; + biddingStrategyConfiguration.bids = new Bids[] { cpcBid }; + + criterion = new BiddableAdGroupCriterion(); + (criterion as BiddableAdGroupCriterion).biddingStrategyConfiguration = + biddingStrategyConfiguration; + } + + criterion.adGroupId = this.adGroupId; + criterion.criterion = unit; + + this.CreateAddOperation(criterion); + + return unit; + } + + /// + /// Creates an AdGroupCriterionOperation for the given criterion + /// + /// The criterion we want to add + private void CreateAddOperation(AdGroupCriterion criterion) { + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.operand = criterion; + operation.@operator = Operator.ADD; + this.operations.Add(operation); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a ProductPartition tree."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddProductPartitionTree codeExample = new AddProductPartitionTree(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The ad group to which product partition is + /// added. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService( + AdWordsService.v201402.AdGroupCriterionService); + + ProductPartitionHelper helper = new ProductPartitionHelper(adGroupId); + + // The most trivial partition tree has only a unit node as the root: + // helper.createUnit(null, null, 100000); + + ProductPartition root = helper.CreateSubdivision(null, null); + + ProductCanonicalCondition newCondition = new ProductCanonicalCondition(); + newCondition.condition = ProductCanonicalConditionCondition.NEW; + ProductPartition newPartition = helper.CreateUnit(root, newCondition, 200000, false); + + ProductCanonicalCondition usedCondition = new ProductCanonicalCondition(); + usedCondition.condition = ProductCanonicalConditionCondition.USED; + ProductPartition usedPartition = helper.CreateUnit(root, usedCondition, 100000, false); + + ProductPartition otherCondition = helper.CreateSubdivision(root, + new ProductCanonicalCondition()); + + ProductBrand coolBrand = new ProductBrand(); + coolBrand.value = "CoolBrand"; + helper.CreateUnit(otherCondition, coolBrand, 900000, false); + + ProductBrand cheapBrand = new ProductBrand(); + cheapBrand.value = "CheapBrand"; + helper.CreateUnit(otherCondition, cheapBrand, 10000, false); + + ProductPartition otherBrand = + helper.CreateSubdivision(otherCondition, new ProductBrand()); + + // The value for the bidding category is a fixed ID for the 'Luggage & Bags' + // category. You can retrieve IDs for categories from the ConstantDataService. + // See the 'GetProductCategoryTaxonomy' example for more details. + + ProductBiddingCategory luggageAndBags = new ProductBiddingCategory(); + luggageAndBags.type = ProductDimensionType.BIDDING_CATEGORY_L1; + luggageAndBags.value = -5914235892932915235; + helper.CreateUnit(otherBrand, luggageAndBags, 750000, false); + + ProductBiddingCategory everythingElse = new ProductBiddingCategory(); + everythingElse.type = ProductDimensionType.BIDDING_CATEGORY_L1; + + helper.CreateUnit(otherBrand, everythingElse, 110000, false); + + try { + // Make the mutate request. + AdGroupCriterionReturnValue retval = adGroupCriterionService.mutate(helper.Operations); + + Dictionary> children = + new Dictionary>(); + ProductPartition rootNode = null; + // For each criterion, make an array containing each of its children + // We always create the parent before the child, so we can rely on that here. + foreach (AdGroupCriterion adGroupCriterion in retval.value) { + ProductPartition newCriterion = (ProductPartition) adGroupCriterion.criterion; + children[newCriterion.id] = new List(); + + if (newCriterion.parentCriterionIdSpecified) { + children[newCriterion.parentCriterionId].Add(newCriterion); + } else { + rootNode = (ProductPartition) adGroupCriterion.criterion; + } + } + + // Show the tree + StringWriter writer = new StringWriter(); + DisplayTree(rootNode, children, 0, writer); + Console.WriteLine(writer.ToString()); + + } catch (Exception ex) { + throw new System.ApplicationException("Failed to set shopping product partition.", ex); + } + } + + /// + /// Displays the product partition tree. + /// + /// The root node. + /// The child node. + /// The tree level. + /// The stream to write output to. + private void DisplayTree(ProductPartition node, Dictionary> children, int level, StringWriter writer) { + // Recursively display a node and each of its children. + object value = null; + string type = ""; + + if (node.caseValue != null) { + type = node.caseValue.ProductDimensionType; + switch (type) { + case "ProductCanonicalCondition": + value = (node.caseValue as ProductCanonicalCondition).condition.ToString(); + break; + + case "ProductBiddingCategory": + value = (node.caseValue as ProductBiddingCategory).type.ToString() + "(" + + (node.caseValue as ProductBiddingCategory).value + ")"; + break; + + default: + value = node.caseValue.GetType().GetProperty("value").GetValue(node.caseValue, null); + break; + } + } + + writer.WriteLine("{0}id: {1}, type: {2}, value: {3}", "".PadLeft(level, ' '), node.id, + type, value); + foreach (ProductPartition childNode in children[node.id]) { + DisplayTree(childNode, children, level + 1, writer); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/ShoppingCampaigns/AddProductScope.cs b/examples/AdWords/CSharp/v201402/ShoppingCampaigns/AddProductScope.cs new file mode 100644 index 00000000000..5b793758c64 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/ShoppingCampaigns/AddProductScope.cs @@ -0,0 +1,127 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example restricts the products that will be included in the + /// campaign by setting a ProductScope. + /// + /// Tags: CampaignCriterionService.mutate + /// + public class AddProductScope : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example restricts the products that will be included in the campaign " + + "by setting a ProductScope."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddProductScope codeExample = new AddProductScope(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign id to add product scope. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201402.CampaignCriterionService); + + ProductScope productScope = new ProductScope(); + // This set of dimensions is for demonstration purposes only. It would be + // extremely unlikely that you want to include so many dimensions in your + // product scope. + ProductBrand nexusBrand = new ProductBrand(); + nexusBrand.value = "Nexus"; + + ProductCanonicalCondition newProducts = new ProductCanonicalCondition(); + newProducts.condition = ProductCanonicalConditionCondition.NEW; + + ProductCustomAttribute customAttribute = new ProductCustomAttribute(); + customAttribute.type = ProductDimensionType.CUSTOM_ATTRIBUTE_0; + customAttribute.value = "my attribute value"; + + ProductOfferId bookOffer = new ProductOfferId(); + bookOffer.value = "book1"; + + ProductType mediaProducts = new ProductType(); + mediaProducts.type = ProductDimensionType.PRODUCT_TYPE_L1; + mediaProducts.value = "Media"; + + ProductType bookProducts = new ProductType(); + bookProducts.type = ProductDimensionType.PRODUCT_TYPE_L2; + bookProducts.value = "Books"; + + // The value for the bidding category is a fixed ID for the + // 'Luggage & Bags' category. You can retrieve IDs for categories from + // the ConstantDataService. See the 'GetProductCategoryTaxonomy' example + // for more details. + ProductBiddingCategory luggageBiddingCategory = new ProductBiddingCategory(); + luggageBiddingCategory.type = ProductDimensionType.BIDDING_CATEGORY_L1; + luggageBiddingCategory.value = -5914235892932915235; + + productScope.dimensions = new ProductDimension[] {nexusBrand, newProducts, bookOffer, + mediaProducts, luggageBiddingCategory}; + + CampaignCriterion campaignCriterion = new CampaignCriterion(); + campaignCriterion.campaignId = campaignId; + campaignCriterion.criterion = productScope; + + // Create operation. + CampaignCriterionOperation operation = new CampaignCriterionOperation(); + operation.operand = campaignCriterion; + operation.@operator = Operator.ADD; + + try { + // Make the mutate request. + CampaignCriterionReturnValue result = campaignCriterionService.mutate( + new CampaignCriterionOperation[] { operation }); + + Console.WriteLine("Created a ProductScope criterion with ID '{0}'", + result.value[0].criterion.id); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to set shopping product scope.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/ShoppingCampaigns/AddShoppingCampaign.cs b/examples/AdWords/CSharp/v201402/ShoppingCampaigns/AddShoppingCampaign.cs new file mode 100644 index 00000000000..05ff8d6bf72 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/ShoppingCampaigns/AddShoppingCampaign.cs @@ -0,0 +1,188 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example adds a Shopping campaign. + /// + /// Tags: CampaignService.mutate, AdGroupService.mutate + /// Tags: AdGroupAdService.mutate + /// + public class AddShoppingCampaign : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a Shopping campaign."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddShoppingCampaign codeExample = new AddShoppingCampaign(); + Console.WriteLine(codeExample.Description); + try { + long budgetId = long.Parse("INSERT_BUDGET_ID_HERE"); + long merchantId = long.Parse("INSERT_MERCHANT_ID_HERE"); + codeExample.Run(new AdWordsUser(), budgetId, merchantId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The budget id. + /// The Merchant Center account id. + public void Run(AdWordsUser user, long budgetId, long merchantId) { + // Get the required services. + CampaignService campaignService = (CampaignService) user.GetService( + AdWordsService.v201402.CampaignService); + AdGroupService adGroupService = (AdGroupService) user.GetService( + AdWordsService.v201402.AdGroupService); + AdGroupAdService adGroupAdService = (AdGroupAdService) user.GetService( + AdWordsService.v201402.AdGroupAdService); + + try { + Campaign campaign = CreateCampaign(budgetId, merchantId, campaignService); + Console.WriteLine("Campaign with name '{0}' and ID '{1}' was added.", campaign.name, + campaign.id); + + AdGroup adGroup = CreateAdGroup(adGroupService, campaign); + Console.WriteLine("Ad group with name '{0}' and ID '{1}' was added.", adGroup.name, + adGroup.id); + + AdGroupAd adGroupAd = CreateProductAd(adGroupAdService, adGroup); + Console.WriteLine("Product ad with ID {0}' was added.", adGroupAd.ad.id); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create shopping campaign.", ex); + } + } + + /// + /// Creates the Product Ad. + /// + /// The AdGroupAdService instance. + /// The ad group. + /// The Product Ad. + private static AdGroupAd CreateProductAd(AdGroupAdService adGroupAdService, AdGroup adGroup) { + // Create product ad. + ProductAd productAd = new ProductAd(); + + // Create ad group ad. + AdGroupAd adGroupAd = new AdGroupAd(); + adGroupAd.adGroupId = adGroup.id; + adGroupAd.ad = productAd; + + // Create operation. + AdGroupAdOperation operation = new AdGroupAdOperation(); + operation.operand = adGroupAd; + operation.@operator = Operator.ADD; + + // Make the mutate request. + AdGroupAdReturnValue retval = adGroupAdService.mutate( + new AdGroupAdOperation[] { operation }); + + return retval.value[0]; + } + + /// + /// Creates the ad group in a Shopping campaign. + /// + /// The AdGroupService instance. + /// The Shopping campaign. + /// The ad group. + private static AdGroup CreateAdGroup(AdGroupService adGroupService, Campaign campaign) { + // Create ad group. + AdGroup adGroup = new AdGroup(); + adGroup.campaignId = campaign.id; + adGroup.name = "Ad Group #" + ExampleUtilities.GetRandomString(); + + // Create operation. + AdGroupOperation operation = new AdGroupOperation(); + operation.operand = adGroup; + operation.@operator = Operator.ADD; + + // Make the mutate request. + AdGroupReturnValue retval = adGroupService.mutate(new AdGroupOperation[] { operation }); + return retval.value[0]; + } + + /// + /// Creates the shopping campaign. + /// + /// The budget id. + /// The Merchant Center id. + /// The CampaignService instance. + /// The Shopping campaign. + private static Campaign CreateCampaign(long budgetId, long merchantId, + CampaignService campaignService) { + // Create campaign. + Campaign campaign = new Campaign(); + campaign.name = "Shopping campaign #" + ExampleUtilities.GetRandomString(); + // The advertisingChannelType is what makes this a Shopping campaign. + campaign.advertisingChannelType = AdvertisingChannelType.SHOPPING; + + // Set shared budget (required). + campaign.budget = new Budget(); + campaign.budget.budgetId = budgetId; + + // Set bidding strategy (required). + BiddingStrategyConfiguration biddingStrategyConfiguration = + new BiddingStrategyConfiguration(); + biddingStrategyConfiguration.biddingStrategyType = BiddingStrategyType.MANUAL_CPC; + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration; + + // Set keyword matching setting (required). + KeywordMatchSetting keywordMatchSetting = new KeywordMatchSetting(); + keywordMatchSetting.optIn = false; + + // All Shopping campaigns need a ShoppingSetting. + ShoppingSetting shoppingSetting = new ShoppingSetting(); + shoppingSetting.salesCountry = "US"; + shoppingSetting.campaignPriority = 0; + shoppingSetting.merchantId = merchantId; + campaign.settings = new Setting[] { keywordMatchSetting, shoppingSetting }; + + // Create operation. + CampaignOperation campaignOperation = new CampaignOperation(); + campaignOperation.operand = campaign; + campaignOperation.@operator = Operator.ADD; + + // Make the mutate request. + CampaignReturnValue retval = campaignService.mutate( + new CampaignOperation[] { campaignOperation }); + + return retval.value[0]; + } + } +} diff --git a/examples/AdWords/CSharp/v201402/ShoppingCampaigns/GetProductCategoryTaxonomy.cs b/examples/AdWords/CSharp/v201402/ShoppingCampaigns/GetProductCategoryTaxonomy.cs new file mode 100644 index 00000000000..d7d335a774d --- /dev/null +++ b/examples/AdWords/CSharp/v201402/ShoppingCampaigns/GetProductCategoryTaxonomy.cs @@ -0,0 +1,180 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example fetches the set of valid ProductBiddingCategories. + /// + /// Tags: ConstantDataService.getProductBiddingCategoryData + /// + public class GetProductCategoryTaxonomy : ExampleBase { + + /// + /// Stores details about a product category and its hierarchy. + /// + class ProductCategory { + /// + /// The product category id. + /// + long id; + + /// + /// The product category name. + /// + string name; + + /// + /// The product category children. + /// + List children; + + /// + /// Gets or sets the product category id. + /// + public long Id { + get { + return id; + } + set { + id = value; + } + } + + /// + /// Gets or sets the product category name. + /// + public string Name { + get { + return name; + } + set { + name = value; + } + } + + /// + /// Gets or sets the product category children. + /// + public List Children { + get { + return children; + } + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example fetches the set of valid ProductBiddingCategories."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetProductCategoryTaxonomy codeExample = new GetProductCategoryTaxonomy(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ConstantDataService. + ConstantDataService constantDataService = (ConstantDataService) user.GetService( + AdWordsService.v201402.ConstantDataService); + + Selector selector = new Selector(); + Predicate predicate = new Predicate(); + predicate.field = "Country"; + predicate.@operator = PredicateOperator.IN; + predicate.values = new string[] { "US" }; + + try { + ProductBiddingCategoryData[] results = + constantDataService.getProductBiddingCategoryData(selector); + + Dictionary biddingCategories = + new Dictionary(); + List rootCategories = new List(); + + foreach (ProductBiddingCategoryData productBiddingCategory in results) { + long id = productBiddingCategory.dimensionValue.value; + long parentId = 0; + string name = productBiddingCategory.displayValue[0].value; + + if (productBiddingCategory.parentDimensionValue != null) { + parentId = productBiddingCategory.parentDimensionValue.value; + } + + if (biddingCategories.ContainsKey(id)) { + biddingCategories.Add(id, new ProductCategory()); + } + + ProductCategory category = biddingCategories[id]; + + if (parentId != 0) { + if (biddingCategories.ContainsKey(parentId)) { + biddingCategories.Add(parentId, new ProductCategory()); + } + ProductCategory parent = biddingCategories[parentId]; + parent.Children.Add(category); + } else { + rootCategories.Add(category); + } + + category.Id = id; + category.Name = name; + } + + DisplayProductCategories(rootCategories, ""); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to set shopping product category.", ex); + } + } + + /// + /// Displays the product categories. + /// + /// The product categories. + /// The prefix for display purposes. + void DisplayProductCategories(List categories, string prefix) { + foreach (ProductCategory category in categories) { + Console.WriteLine("{0}{1} [{2}]", prefix, category.Name, category.Id); + DisplayProductCategories(category.Children, string.Format("{0}{1} > ", + prefix, category.Name)); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/ShoppingCampaigns/SetProductSalesChannel.cs b/examples/AdWords/CSharp/v201402/ShoppingCampaigns/SetProductSalesChannel.cs new file mode 100644 index 00000000000..df65c80ae52 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/ShoppingCampaigns/SetProductSalesChannel.cs @@ -0,0 +1,101 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + + /// + /// This code example sets the product sales channel. + /// + /// Tags: CampaignCriterionService.mutate + /// + public class SetProductSalesChannel : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example sets the product sales channel."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SetProductSalesChannel codeExample = new SetProductSalesChannel(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign for which shopping channel + /// is set. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201402.CampaignCriterionService); + + // ProductSalesChannel is a fixed id criterion, with the possible values + // defined here. + // ONLINE: 200 + // LOCAL: 201 + ProductSalesChannel productSalesChannel = new ProductSalesChannel(); + productSalesChannel.id = 200; + + CampaignCriterion campaignCriterion = new CampaignCriterion(); + campaignCriterion.campaignId = campaignId; + campaignCriterion.criterion = productSalesChannel; + + // Create operation. + CampaignCriterionOperation operation = new CampaignCriterionOperation(); + operation.operand = campaignCriterion; + operation.@operator = Operator.ADD; + + try { + // Make the mutate request. + CampaignCriterionReturnValue retVal = campaignCriterionService.mutate( + new CampaignCriterionOperation[] { operation }); + + if (retVal != null && retVal.value != null) { + // Display campaign targets. + foreach (CampaignCriterion criterion in retVal.value) { + Console.WriteLine("Campaign criteria of type '{0}' was set to campaign with" + + " id = '{1}'.", criterion.criterion.CriterionType, criterion.campaignId); + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to set shopping product channel.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/Targeting/AddCampaignTargetingCriteria.cs b/examples/AdWords/CSharp/v201402/Targeting/AddCampaignTargetingCriteria.cs new file mode 100644 index 00000000000..92b921f4e9a --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Targeting/AddCampaignTargetingCriteria.cs @@ -0,0 +1,182 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example adds various types of targeting criteria to a campaign. + /// To get a list of campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignCriterionService.mutate + /// + public class AddCampaignTargetingCriteria : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddCampaignTargetingCriteria codeExample = new AddCampaignTargetingCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds various types of targeting criteria to a campaign. To " + + "get a list of campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to which targeting criteria + /// are added. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201402.CampaignCriterionService); + + // Create language criteria. + // See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + // for a detailed list of language codes. + Language language1 = new Language(); + language1.id = 1002; // French + CampaignCriterion languageCriterion1 = new CampaignCriterion(); + languageCriterion1.campaignId = campaignId; + languageCriterion1.criterion = language1; + + Language language2 = new Language(); + language2.id = 1005; // Japanese + CampaignCriterion languageCriterion2 = new CampaignCriterion(); + languageCriterion2.campaignId = campaignId; + languageCriterion2.criterion = language2; + + // Target Tier 3 income group near Miami, Florida. + LocationGroups incomeLocationGroups = new LocationGroups(); + + IncomeOperand incomeOperand = new IncomeOperand(); + // Tiers are numbered 1-10, and represent 10% segments of earners. + // For example, TIER_1 is the top 10%, TIER_2 is the 80-90%, etc. + // Tiers 6 through 10 are grouped into TIER_6_TO_10. + incomeOperand.tier = IncomeTier.TIER_3; + + GeoTargetOperand geoTargetOperand1 = new GeoTargetOperand(); + geoTargetOperand1.locations = new long[] {1015116}; // Miami, FL. + + incomeLocationGroups.matchingFunction = new Function(); + incomeLocationGroups.matchingFunction.lhsOperand = + new FunctionArgumentOperand[] {incomeOperand}; + incomeLocationGroups.matchingFunction.@operator = FunctionOperator.AND; + incomeLocationGroups.matchingFunction.rhsOperand = + new FunctionArgumentOperand[] {geoTargetOperand1}; + + CampaignCriterion locationGroupCriterion1 = new CampaignCriterion(); + locationGroupCriterion1.campaignId = campaignId; + locationGroupCriterion1.criterion = incomeLocationGroups; + + // Target places of interest near Downtown Miami, Florida. + LocationGroups interestLocationGroups = new LocationGroups(); + + PlacesOfInterestOperand placesOfInterestOperand = new PlacesOfInterestOperand(); + placesOfInterestOperand.category = PlacesOfInterestOperandCategory.DOWNTOWN; + + GeoTargetOperand geoTargetOperand2 = new GeoTargetOperand(); + geoTargetOperand2.locations = new long[] { 1015116 }; // Miami, FL. + + interestLocationGroups.matchingFunction = new Function(); + interestLocationGroups.matchingFunction.lhsOperand = + new FunctionArgumentOperand[] {placesOfInterestOperand}; + interestLocationGroups.matchingFunction.@operator = FunctionOperator.AND; + interestLocationGroups.matchingFunction.rhsOperand = + new FunctionArgumentOperand[] {geoTargetOperand2}; + + CampaignCriterion locationGroupCriterion2 = new CampaignCriterion(); + locationGroupCriterion2.campaignId = campaignId; + locationGroupCriterion2.criterion = interestLocationGroups; + + // Create location criteria. + // See http://code.google.com/apis/adwords/docs/appendix/countrycodes.html + // for a detailed list of country codes. + Location location1 = new Location(); + location1.id = 2840; // USA + CampaignCriterion locationCriterion1 = new CampaignCriterion(); + locationCriterion1.campaignId = campaignId; + locationCriterion1.criterion = location1; + + Location location2 = new Location(); + location2.id = 2392; // Japan + CampaignCriterion locationCriterion2 = new CampaignCriterion(); + locationCriterion2.campaignId = campaignId; + locationCriterion2.criterion = location2; + + // Add a negative campaign keyword. + NegativeCampaignCriterion negativeCriterion = new NegativeCampaignCriterion(); + negativeCriterion.campaignId = campaignId; + + Keyword keyword = new Keyword(); + keyword.matchType = KeywordMatchType.BROAD; + keyword.text = "jupiter cruise"; + + negativeCriterion.criterion = keyword; + + CampaignCriterion[] criteria = new CampaignCriterion[] {languageCriterion1, + languageCriterion2, locationCriterion1, locationCriterion2, negativeCriterion, + locationGroupCriterion1, locationGroupCriterion2}; + + List operations = new List(); + + foreach (CampaignCriterion criterion in criteria) { + CampaignCriterionOperation operation = new CampaignCriterionOperation(); + operation.@operator = Operator.ADD; + operation.operand = criterion; + operations.Add(operation); + } + + try { + // Set the campaign targets. + CampaignCriterionReturnValue retVal = campaignCriterionService.mutate(operations.ToArray()); + + if (retVal != null && retVal.value != null) { + // Display campaign targets. + foreach (CampaignCriterion criterion in retVal.value) { + Console.WriteLine("Campaign criteria of type '{0}' was set to campaign with" + + " id = '{1}'.", criterion.criterion.CriterionType, criterion.campaignId); + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to set Campaign criteria.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/Targeting/GetCampaignTargetingCriteria.cs b/examples/AdWords/CSharp/v201402/Targeting/GetCampaignTargetingCriteria.cs new file mode 100644 index 00000000000..82b3e1f5b52 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Targeting/GetCampaignTargetingCriteria.cs @@ -0,0 +1,119 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example gets all targeting criteria for a campaign. To set + /// campaign targeting criteria, run AddCampaignTargetingCriteria.cs. To get + /// campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignCriterionService.get + /// + public class GetCampaignTargetingCriteria : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetCampaignTargetingCriteria codeExample = new GetCampaignTargetingCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all targeting criteria for a campaign. To set campaign " + + "targeting criteria, run AddCampaignTargetingCriteria.cs. To get campaigns, run " + + "GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign from which targeting + /// criteria are retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201402.CampaignCriterionService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "CriteriaType", "CampaignId"}; + + // Set the filters. + Predicate predicate = new Predicate(); + predicate.field = "CampaignId"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] {campaignId.ToString()}; + + selector.predicates = new Predicate[] {predicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + CampaignCriterionPage page = new CampaignCriterionPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get all campaign targets. + page = campaignCriterionService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (CampaignCriterion campaignCriterion in page.entries) { + string negative = (campaignCriterion is NegativeCampaignCriterion) ? "Negative " : ""; + Console.WriteLine("{0}) {1}Campaign criterion with id = '{2}' and Type = {3} was " + + " found for campaign id '{4}'", i, negative, campaignCriterion.criterion.id, + campaignCriterion.criterion.type, campaignCriterion.campaignId); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of campaign targeting criteria found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get campaign targeting criteria.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/Targeting/GetTargetableLanguagesAndCarriers.cs b/examples/AdWords/CSharp/v201402/Targeting/GetTargetableLanguagesAndCarriers.cs new file mode 100644 index 00000000000..b3805f3e0de --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Targeting/GetTargetableLanguagesAndCarriers.cs @@ -0,0 +1,99 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example illustrates how to retrieve all carriers and languages + /// available for targeting. + /// + /// Tags: ConstantDataService.getCarrierCriterion + /// Tags: ConstantDataService.getLanguageCriterion + /// + public class GetTargetableLanguagesAndCarriers : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetTargetableLanguagesAndCarriers codeExample = new GetTargetableLanguagesAndCarriers(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve all carriers and languages " + + "available for targeting."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ConstantDataService. + ConstantDataService constantDataService = (ConstantDataService) user.GetService( + AdWordsService.v201402.ConstantDataService); + + try { + // Get all carriers. + Carrier[] carriers = constantDataService.getCarrierCriterion(); + + // Display the results. + if (carriers != null) { + foreach (Carrier carrier in carriers) { + Console.WriteLine("Carrier name is '{0}', ID is {1} and country code is '{2}'.", + carrier.name, carrier.id, carrier.countryCode); + } + } else { + Console.WriteLine("No carriers were retrieved."); + } + + // Get all languages. + Language[] languages = constantDataService.getLanguageCriterion(); + + // Display the results. + if (languages != null) { + foreach (Language language in languages) { + Console.WriteLine("Language name is '{0}', ID is {1} and code is '{2}'.", + language.name, language.id, language.code); + } + } else { + Console.WriteLine("No languages were found."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get targetable carriers and languages.", + ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201402/Targeting/LookupLocation.cs b/examples/AdWords/CSharp/v201402/Targeting/LookupLocation.cs new file mode 100644 index 00000000000..963e9a22212 --- /dev/null +++ b/examples/AdWords/CSharp/v201402/Targeting/LookupLocation.cs @@ -0,0 +1,121 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example gets location criteria by name. + /// + /// Tags: LocationCriterionService.get + /// + public class LookupLocation : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + LookupLocation codeExample = new LookupLocation(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets location criteria by name."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the LocationCriterionService. + LocationCriterionService locationCriterionService = + (LocationCriterionService) user.GetService(AdWordsService.v201402. + LocationCriterionService); + + string[] locationNames = new string[] {"Paris", "Quebec", "Spain", "Deutschland"}; + + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "LocationName", "CanonicalName", "DisplayType", + "ParentLocations", "Reach", "TargetingStatus"}; + + // Location names must match exactly, only EQUALS and IN are supported. + Predicate predicate1 = new Predicate(); + predicate1.field = "LocationName"; + predicate1.@operator = PredicateOperator.IN; + predicate1.values = locationNames; + + // Set the locale of the returned location names. + Predicate predicate2 = new Predicate(); + predicate2.field = "Locale"; + predicate2.@operator = PredicateOperator.EQUALS; + predicate2.values = new string[] {"en"}; + + selector.predicates = new Predicate[] {predicate1, predicate2}; + + try { + // Make the get request. + LocationCriterion[] locationCriteria = locationCriterionService.get(selector); + + // Display the resulting location criteria. + foreach (LocationCriterion locationCriterion in locationCriteria) { + string parentLocations = ""; + if (locationCriterion.location != null && + locationCriterion.location.parentLocations != null) { + foreach (Location location in locationCriterion.location.parentLocations) { + parentLocations += GetLocationString(location) + ", "; + } + parentLocations.TrimEnd(',', ' '); + } else { + parentLocations = "N/A"; + } + Console.WriteLine("The search term '{0}' returned the location '{1}' of type '{2}' " + + "with parent locations '{3}', reach '{4}' and targeting status '{5}.", + locationCriterion.searchTerm, locationCriterion.location.locationName, + locationCriterion.location.displayType, parentLocations, locationCriterion.reach, + locationCriterion.location.targetingStatus); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get location criteria.", ex); + } + } + + /// + /// Gets a string representation for a location. + /// + /// The location + /// The string representation + public string GetLocationString(Location location) { + return string.Format("{0} ({1})", location.locationName, location.displayType); + } + } +} diff --git a/examples/AdWords/CSharp/v201406/AccountManagement/CreateAccount.cs b/examples/AdWords/CSharp/v201406/AccountManagement/CreateAccount.cs new file mode 100644 index 00000000000..91fb644004e --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AccountManagement/CreateAccount.cs @@ -0,0 +1,95 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example illustrates how to create an account. Note by default, + /// this account will only be accessible via its parent MCC. + /// + /// Tags: ManagedCustomerService.mutate + /// + public class CreateAccount : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + CreateAccount codeExample = new CreateAccount(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create an account. Note by default " + + "this account will only be accessible via its parent MCC."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ManagedCustomerService. + ManagedCustomerService managedCustomerService = (ManagedCustomerService) user.GetService( + AdWordsService.v201406.ManagedCustomerService); + + // Create account. + ManagedCustomer customer = new ManagedCustomer(); + customer.name = "Customer created with ManagedCustomerService on " + + new DateTime().ToString(); + customer.currencyCode = "EUR"; + customer.dateTimeZone = "Europe/London"; + + // Create operations. + ManagedCustomerOperation operation = new ManagedCustomerOperation(); + operation.operand = customer; + operation.@operator = Operator.ADD; + try { + ManagedCustomerOperation[] operations = new ManagedCustomerOperation[] {operation}; + // Add account. + ManagedCustomerReturnValue result = managedCustomerService.mutate(operations); + + // Display accounts. + if (result.value != null && result.value.Length > 0) { + ManagedCustomer customerResult = result.value[0]; + Console.WriteLine("Account with customer ID \"{0}\" was created.", + customerResult.customerId); + } else { + Console.WriteLine("No accounts were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create accounts.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/AccountManagement/GetAccountAlerts.cs b/examples/AdWords/CSharp/v201406/AccountManagement/GetAccountAlerts.cs new file mode 100644 index 00000000000..3fc34ad5f04 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AccountManagement/GetAccountAlerts.cs @@ -0,0 +1,126 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example gets all alerts for all clients of an MCC account. + /// The effective user (ClientCustomerId or AuthToken) must be an MCC user + /// to get results. This code example won't work with Test Accounts. See + /// https://developers.google.com/adwords/api/docs/test-accounts + /// + /// Tags: AlertService.get + /// + public class GetAccountAlerts : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAccountAlerts codeExample = new GetAccountAlerts(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all alerts for all clients of an MCC account. The " + + "effective user (ClientCustomerId or AuthToken) must be an MCC user to get results. " + + "This code example won't work with Test Accounts. See " + + "https://developers.google.com/adwords/api/docs/test-accounts"; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the AlertService. + AlertService alertService = (AlertService) user.GetService( + AdWordsService.v201406.AlertService); + + // Create the selector. + AlertSelector selector = new AlertSelector(); + + // Create the alert query. + AlertQuery query = new AlertQuery(); + query.filterSpec = FilterSpec.ALL; + query.clientSpec = ClientSpec.ALL; + query.triggerTimeSpec = TriggerTimeSpec.ALL_TIME; + query.severities = new AlertSeverity[] {AlertSeverity.GREEN, AlertSeverity.YELLOW, + AlertSeverity.RED}; + + // Enter all possible values of AlertType to get all alerts. If you are + // interested only in specific alert types, then you may also do it as + // follows: + // query.types = new AlertType[] {AlertType.CAMPAIGN_ENDING, + // AlertType.CAMPAIGN_ENDED}; + query.types = (AlertType[]) Enum.GetValues(typeof(AlertType)); + selector.query = query; + + // Set paging for selector. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AlertPage page = new AlertPage(); + + try { + do { + // Get account alerts. + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + page = alertService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (Alert alert in page.entries) { + Console.WriteLine("{0}) Customer Id is {1:###-###-####}, Alert type is '{2}', " + + "Severity is {3}", i + 1, alert.clientCustomerId, alert.alertType, + alert.alertSeverity); + for (int j = 0; j < alert.details.Length; j++) { + Console.WriteLine(" - Triggered at {0}", alert.details[j].triggerTime); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of alerts found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve alerts.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/AccountManagement/GetAccountChanges.cs b/examples/AdWords/CSharp/v201406/AccountManagement/GetAccountChanges.cs new file mode 100644 index 00000000000..757dd42c631 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AccountManagement/GetAccountChanges.cs @@ -0,0 +1,176 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example gets the changes in the account during the last 24 + /// hours. + /// + /// Tags: CustomerSyncService.get + /// + public class GetAccountChanges : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAccountChanges codeExample = new GetAccountChanges(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the changes in the account during the last 24 hours."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the CustomerSyncService. + CustomerSyncService customerSyncService = + (CustomerSyncService) user.GetService(AdWordsService.v201406. + CustomerSyncService); + + // The date time string should be of the form yyyyMMdd HHmmss zzz + string minDateTime = DateTime.Now.AddDays(-1).ToUniversalTime().ToString("yyyyMMdd HHmmss") + + " UTC"; + string maxDateTime = DateTime.Now.ToUniversalTime().ToString("yyyyMMdd HHmmss") + " UTC"; + + // Create date time range. + DateTimeRange dateTimeRange = new DateTimeRange(); + dateTimeRange.min = minDateTime; + dateTimeRange.max = maxDateTime; + + try { + // Create the selector. + CustomerSyncSelector selector = new CustomerSyncSelector(); + selector.dateTimeRange = dateTimeRange; + selector.campaignIds = GetAllCampaignIds(user); + + // Get all account changes for campaign. + CustomerChangeData accountChanges = customerSyncService.get(selector); + + // Display the changes. + if (accountChanges != null && accountChanges.changedCampaigns != null) { + Console.WriteLine("Displaying changes up to: {0}", accountChanges.lastChangeTimestamp); + foreach (CampaignChangeData campaignChanges in accountChanges.changedCampaigns) { + Console.WriteLine("Campaign with id \"{0}\" was changed:", campaignChanges.campaignId); + Console.WriteLine(" Campaign changed status: {0}", + campaignChanges.campaignChangeStatus); + if (campaignChanges.campaignChangeStatus != ChangeStatus.NEW) { + Console.WriteLine(" Added ad extensions: {0}", GetFormattedList( + campaignChanges.addedAdExtensions)); + Console.WriteLine(" Added campaign criteria: {0}", + GetFormattedList(campaignChanges.addedCampaignCriteria)); + Console.WriteLine(" Added campaign targeting: {0}", + campaignChanges.campaignTargetingChanged? "yes" : "no"); + Console.WriteLine(" Removed ad extensions: {0}", + GetFormattedList(campaignChanges.removedAdExtensions)); + Console.WriteLine(" Removed campaign criteria: {0}", + GetFormattedList(campaignChanges.removedAdExtensions)); + + if (campaignChanges.changedAdGroups != null) { + foreach (AdGroupChangeData adGroupChanges in campaignChanges.changedAdGroups) { + Console.WriteLine(" Ad group with id \"{0}\" was changed:", + adGroupChanges.adGroupId); + Console.WriteLine(" Ad group changed status: {0}", + adGroupChanges.adGroupChangeStatus); + if (adGroupChanges.adGroupChangeStatus != ChangeStatus.NEW) { + Console.WriteLine(" Ads changed: {0}", + GetFormattedList(adGroupChanges.changedAds)); + Console.WriteLine(" Criteria changed: {0}", + GetFormattedList(adGroupChanges.changedCriteria)); + Console.WriteLine(" Criteria removed: {0}", + GetFormattedList(adGroupChanges.removedCriteria)); + } + } + } + } + Console.WriteLine(); + } + } else { + Console.WriteLine("No account changes were found.");; + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get account changes.", ex); + } + } + + /// + /// Formats a list of ids as a comma separated string. + /// + /// The list of ids. + /// The comma separed formatted string, enclosed in square braces. + /// + private string GetFormattedList(long[] ids) { + StringBuilder builder = new StringBuilder(); + if (ids != null) { + foreach (long id in ids) { + builder.AppendFormat("{0}, ", id); + } + } + return "[" + builder.ToString().TrimEnd(',', ' ') + "]"; + } + + /// + /// Gets all campaign ids in the account. + /// + /// The user for which campaigns are retrieved. + /// The list of campaign ids. + private long[] GetAllCampaignIds(AdWordsUser user) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201406.CampaignService); + + List allCampaigns = new List(); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id"}; + + // Get all campaigns. + CampaignPage page = campaignService.get(selector); + + // Return the results. + if (page != null && page.entries != null) { + foreach (Campaign campaign in page.entries) { + allCampaigns.Add(campaign.id); + } + } + return allCampaigns.ToArray(); + } + } +} diff --git a/examples/AdWords/CSharp/v201406/AccountManagement/GetAccountHierarchy.cs b/examples/AdWords/CSharp/v201406/AccountManagement/GetAccountHierarchy.cs new file mode 100644 index 00000000000..ddf9a7aa156 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AccountManagement/GetAccountHierarchy.cs @@ -0,0 +1,196 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example illustrates how to retrieve the account hierarchy under + /// an account. This code example won't work with Test Accounts. See + /// https://developers.google.com/adwords/api/docs/test-accounts + /// + /// Tags: ManagedCustomerService.get + /// + public class GetAccountHierarchy : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAccountHierarchy codeExample = new GetAccountHierarchy(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve the account hierarchy under" + + " an account. This code example won't work with Test Accounts. See " + + "https://developers.google.com/adwords/api/docs/test-accounts"; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ManagedCustomerService. + ManagedCustomerService managedCustomerService = (ManagedCustomerService) user.GetService( + AdWordsService.v201406.ManagedCustomerService); + managedCustomerService.RequestHeader.clientCustomerId = null; + + // Create selector. + Selector selector = new Selector(); + selector.fields = new String[] {"Login", "CustomerId", "Name"}; + + try { + // Get results. + ManagedCustomerPage page = managedCustomerService.get(selector); + + // Display serviced account graph. + if (page.entries != null) { + // Create map from customerId to customer node. + Dictionary customerIdToCustomerNode = + new Dictionary(); + + // Create account tree nodes for each customer. + foreach (ManagedCustomer customer in page.entries) { + ManagedCustomerTreeNode node = new ManagedCustomerTreeNode(); + node.Account = customer; + customerIdToCustomerNode.Add(customer.customerId, node); + } + + // For each link, connect nodes in tree. + if (page.links != null) { + foreach (ManagedCustomerLink link in page.links) { + ManagedCustomerTreeNode managerNode = + customerIdToCustomerNode[link.managerCustomerId]; + ManagedCustomerTreeNode childNode = customerIdToCustomerNode[link.clientCustomerId]; + childNode.ParentNode = managerNode; + if (managerNode != null) { + managerNode.ChildAccounts.Add(childNode); + } + } + } + + // Find the root account node in the tree. + ManagedCustomerTreeNode rootNode = null; + foreach (ManagedCustomer account in page.entries) { + if (customerIdToCustomerNode[account.customerId].ParentNode == null) { + rootNode = customerIdToCustomerNode[account.customerId]; + break; + } + } + + // Display account tree. + Console.WriteLine("Login, CustomerId, Name"); + Console.WriteLine(rootNode.ToTreeString(0, new StringBuilder())); + } else { + Console.WriteLine("No serviced accounts were found."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create ad groups.", ex); + } + } + + /** + * Example implementation of a node that would exist in an account tree. + */ + class ManagedCustomerTreeNode { + /// + /// The parent node. + /// + private ManagedCustomerTreeNode parentNode; + + /// + /// The account associated with this node. + /// + private ManagedCustomer account; + + /// + /// The list of child accounts. + /// + private List childAccounts = new List(); + + /// + /// Gets or sets the parent node. + /// + public ManagedCustomerTreeNode ParentNode { + get { return parentNode; } + set { parentNode = value; } + } + + /// + /// Gets or sets the account. + /// + public ManagedCustomer Account { + get { return account; } + set { account = value; } + } + + /// + /// Gets the child accounts. + /// + public List ChildAccounts { + get { return childAccounts; } + } + + /// + /// Returns a that represents this instance. + /// + /// + /// A that represents this instance. + /// + public override String ToString() { + String login = String.IsNullOrEmpty(account.login) ? "(no login)" : account.login; + return String.Format("{0}, {1}, {2}", login, account.customerId, account.name); + } + + /// + /// Returns a string representation of the current level of the tree and + /// recursively returns the string representation of the levels below it. + /// + /// The depth of the node. + /// The String Builder containing the tree + /// representation. + /// The tree string representation. + public StringBuilder ToTreeString(int depth, StringBuilder sb) { + sb.Append(new String('-', depth * 2)); + sb.Append(this); + sb.Append("\n"); + foreach (ManagedCustomerTreeNode childAccount in childAccounts) { + childAccount.ToTreeString(depth + 1, sb); + } + return sb; + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/AdWordsForVideo/AddTargetingGroup.cs b/examples/AdWords/CSharp/v201406/AdWordsForVideo/AddTargetingGroup.cs new file mode 100644 index 00000000000..7e2adfd784b --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AdWordsForVideo/AddTargetingGroup.cs @@ -0,0 +1,95 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example illustrates how to create a targeting group. + /// + /// Tags: VideoTargetingGroupService.mutate + /// + /// AdWords for Video API is a Beta feature. + public class AddTargetingGroup : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create a targeting group."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddTargetingGroup codeExample = new AddTargetingGroup(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + string videoId = "INSERT_VIDEO_ID_HERE"; + codeExample.Run(new AdWordsUser(), campaignId, videoId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + /// The Youtube video ID. + public void Run(AdWordsUser user, long campaignId, string videoId) { + // Get the VideoTargetingGroupService. + VideoTargetingGroupService videoTargetingGroupService = + (VideoTargetingGroupService) user.GetService( + AdWordsService.v201406.VideoTargetingGroupService); + + TargetingGroup targetingGroup = new TargetingGroup(); + targetingGroup.campaignId = campaignId; + targetingGroup.name = "My Targeting Group " + ExampleUtilities.GetRandomString(); + + try { + TargetingGroupOperation operation = new TargetingGroupOperation(); + operation.operand = targetingGroup; + operation.@operator = Operator.ADD; + + TargetingGroupReturnValue retval = videoTargetingGroupService.mutate( + new TargetingGroupOperation[] { operation }); + + if (retval != null && retval.value != null && retval.value.Length > 0) { + TargetingGroup newTargetingGroup = retval.value[0]; + Console.WriteLine("New targeting group with id = {0}, name = {1} was created in " + + "campaign id {2}", newTargetingGroup.id, newTargetingGroup.name, + newTargetingGroup.campaignId); + } else { + Console.WriteLine("No targeting group was created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create targeting group.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/AdWordsForVideo/AddTargetingGroupCriteria.cs b/examples/AdWords/CSharp/v201406/AdWordsForVideo/AddTargetingGroupCriteria.cs new file mode 100644 index 00000000000..6f24110d117 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AdWordsForVideo/AddTargetingGroupCriteria.cs @@ -0,0 +1,167 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example illustrates how to create targeting group criteria. + /// + /// Tags: VideoTargetingGroupCriterionService.mutate + /// + /// AdWords for Video API is a Beta feature. + public class AddTargetingGroupCriteria : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create targeting group criteria."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddTargetingGroupCriteria codeExample = new AddTargetingGroupCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + long targetingGroupId = long.Parse("INSERT_TARGETING_GROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId, targetingGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + /// The targeting group ID. + public void Run(AdWordsUser user, long campaignId, long targetingGroupId) { + // Get the VideoTargetingGroupCriterionService. + VideoTargetingGroupCriterionService videoTargetingGroupCriterionService = + (VideoTargetingGroupCriterionService) user.GetService( + AdWordsService.v201406.VideoTargetingGroupCriterionService); + + // Create age criteria. + TargetingGroupCriterion ageCriterion = new TargetingGroupCriterion(); + ageCriterion.campaignId = campaignId; + ageCriterion.targetingGroupId = targetingGroupId; + AudienceAge age = new AudienceAge(); + age.ageRange = AudienceAgeAgeRange.AGE_RANGE_18_24; + ageCriterion.criterion = age; + + TargetingGroupCriterionOperation addAgeCriterionOperation = + new TargetingGroupCriterionOperation(); + addAgeCriterionOperation.operand = ageCriterion; + addAgeCriterionOperation.@operator = Operator.ADD; + + // Create negative age criteria. + NegativeTargetingGroupCriterion negativeAgeCriterion = new NegativeTargetingGroupCriterion(); + negativeAgeCriterion.campaignId = campaignId; + negativeAgeCriterion.targetingGroupId = targetingGroupId; + AudienceAge negativeAge = new AudienceAge(); + negativeAge.ageRange = AudienceAgeAgeRange.AGE_RANGE_65_UP; + negativeAgeCriterion.criterion = negativeAge; + + TargetingGroupCriterionOperation addNegativeAgeCriterionOperation = + new TargetingGroupCriterionOperation(); + addNegativeAgeCriterionOperation.operand = negativeAgeCriterion; + addNegativeAgeCriterionOperation.@operator = Operator.ADD; + + // Create gender criteria. + TargetingGroupCriterion genderCriterion = new TargetingGroupCriterion(); + AudienceGender gender = new AudienceGender(); + gender.genderType = AudienceGenderGenderType.GENDER_MALE; + genderCriterion.campaignId = campaignId; + genderCriterion.targetingGroupId = targetingGroupId; + genderCriterion.criterion = gender; + + TargetingGroupCriterionOperation addGenderCriterionOperation = + new TargetingGroupCriterionOperation(); + addGenderCriterionOperation.operand = genderCriterion; + addGenderCriterionOperation.@operator = Operator.ADD; + + // Create topic criteria. + // See https://developers.google.com/adwords/api/docs/appendix/verticals + // for valid ids. + TargetingGroupCriterion topicCriterion = new TargetingGroupCriterion(); + Topic topic = new Topic(); + // Autos & Vehicles > Vehicle Brands > Buick + topic.verticalId = 1060L; + + topicCriterion.campaignId = campaignId; + topicCriterion.targetingGroupId = targetingGroupId; + topicCriterion.criterion = topic; + + TargetingGroupCriterionOperation addTopicCriterionOperation = + new TargetingGroupCriterionOperation(); + addTopicCriterionOperation.operand = topicCriterion; + addTopicCriterionOperation.@operator = Operator.ADD; + + // Add audience interest criteria. + // See https://developers.google.com/adwords/api/docs/appendix/verticals + // for valid ids. + TargetingGroupCriterion interestCriterion = new TargetingGroupCriterion(); + AudienceInterest interest = new AudienceInterest(); + // Computers & Electronics > Computer Hardware > Laptops & Notebooks > Tablet PCs + interest.interestId = 1277L; + + interestCriterion.campaignId = campaignId; + interestCriterion.targetingGroupId = targetingGroupId; + interestCriterion.criterion = topic; + + TargetingGroupCriterionOperation addUserInterestCriteriaOperation = + new TargetingGroupCriterionOperation(); + addUserInterestCriteriaOperation.operand = interestCriterion; + addUserInterestCriteriaOperation.@operator = Operator.ADD; + + try { + TargetingGroupCriterionReturnValue retval = videoTargetingGroupCriterionService.mutate( + new TargetingGroupCriterionOperation[] { + addAgeCriterionOperation, + addGenderCriterionOperation, + addNegativeAgeCriterionOperation, + addTopicCriterionOperation, + addUserInterestCriteriaOperation + }); + if (retval != null && retval.value != null) { + foreach (TargetingGroupCriterion newCriterion in retval.value) { + Console.WriteLine("Added targeting group criteria with id = {0} and type = {1} " + + "to campaign id {2}.", + newCriterion.criterion.id, newCriterion.criterion.BaseCriterionType, + newCriterion.campaignId); + } + } else { + Console.WriteLine("No new targeting group criteria were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add targeting group criteria.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/AdWordsForVideo/AddVideoAd.cs b/examples/AdWords/CSharp/v201406/AdWordsForVideo/AddVideoAd.cs new file mode 100644 index 00000000000..6db2c478fb2 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AdWordsForVideo/AddVideoAd.cs @@ -0,0 +1,109 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example illustrates how to create a video ad. + /// + /// Tags: VideoAdService.mutate + /// + /// AdWords for Video API is a Beta feature. + public class AddVideoAd : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create a video ad."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddVideoAd codeExample = new AddVideoAd(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + string videoId = "INSERT_VIDEO_ID_HERE"; + codeExample.Run(new AdWordsUser(), campaignId, videoId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + /// The Youtube video ID. + public void Run(AdWordsUser user, long campaignId, string videoId) { + // Get the VideoAdService. + VideoAdService videoAdService = (VideoAdService) user.GetService( + AdWordsService.v201406.VideoAdService); + + VideoAd videoAd = new VideoAd(); + videoAd.campaignId = campaignId; + videoAd.name = "My first video ad"; + videoAd.status = VideoAdStatus.PAUSED; + + videoAd.headline = "Best headline ever"; + videoAd.destinationUrl = "http://www.example.com"; + videoAd.displayUrl = "www.example.com"; + videoAd.description1 = "My favorite line 1"; + videoAd.description2 = "My favorite line 2"; + + videoAd.videoId = videoId; + + VideoAdDisplayFormat_VideoAdStatusMapEntry statusByFormat = + new VideoAdDisplayFormat_VideoAdStatusMapEntry(); + statusByFormat.key = VideoAdDisplayFormat.TRUE_VIEW_IN_STREAM; + statusByFormat.value = VideoAdStatus.ENABLED; + + videoAd.statusByFormat = new VideoAdDisplayFormat_VideoAdStatusMapEntry[] { + statusByFormat + }; + + try { + VideoAdOperation operation = new VideoAdOperation(); + operation.operand = videoAd; + operation.@operator = Operator.ADD; + + VideoAdReturnValue retval = videoAdService.mutate(new VideoAdOperation[] { operation }); + if (retval != null && retval.value != null && retval.value.Length > 0) { + VideoAd newVideoAd = retval.value[0]; + Console.WriteLine("Ad with id = {0} was added to campaign id {1}.", newVideoAd.id, + newVideoAd.campaignId); + } else { + Console.WriteLine("No video ads were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add video ad.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/AdWordsForVideo/AddVideoCallToAction.cs b/examples/AdWords/CSharp/v201406/AdWordsForVideo/AddVideoCallToAction.cs new file mode 100644 index 00000000000..db231979874 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AdWordsForVideo/AddVideoCallToAction.cs @@ -0,0 +1,107 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example illustrates how to create a video call to action + /// overlay. + /// + /// Tags: VideoService.mutateCallToAction + /// + /// AdWords for Video API is a Beta feature. + public class AddVideoCallToAction : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create a video call to action overlay"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddVideoCallToAction codeExample = new AddVideoCallToAction(); + Console.WriteLine(codeExample.Description); + try { + string videoId = "INSERT_VIDEO_ID_HERE"; + codeExample.Run(new AdWordsUser(), videoId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The video ID. + public void Run(AdWordsUser user, string videoId) { + // Get the VideoService. + VideoService videoService = (VideoService) user.GetService( + AdWordsService.v201406.VideoService); + + VideoCallToAction videoCallToAction = new VideoCallToAction(); + videoCallToAction.id = videoId; + + CallToAction callToAction = new CallToAction(); + + CallToActionCreative callToActionCreative = new CallToActionCreative(); + callToActionCreative.headline = "Mars cruise"; + callToActionCreative.displayUrl = "www.example.com/mars"; + callToActionCreative.destinationUrl = "www.example.com/mars"; + + callToAction.creative = callToActionCreative; + videoCallToAction.callToAction = callToAction; + + try { + VideoCallToActionOperation operation = new VideoCallToActionOperation(); + operation.operand = videoCallToAction; + + // If this is a new Call to Action, use Operator.ADD + // If a Call to Action already exists, use Operator.SET + operation.@operator = Operator.SET; + + VideoCallToActionOperation[] operations = new VideoCallToActionOperation[] { operation }; + + // Add video call to action. + VideoReturnValue result = videoService.mutateCallToAction(operations); + + if (result != null && result.value != null && result.value.Length > 0) { + foreach (YouTubeVideo youTubeVideo in result.value) { + Console.WriteLine("CallToAction overlay was added to video ID {0}, headline {1}.", + youTubeVideo.id, youTubeVideo.callToAction.creative.headline); + } + } else { + Console.WriteLine("No call to action overlays were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add call to action overlay.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/AdWordsForVideo/AddVideoCampaign.cs b/examples/AdWords/CSharp/v201406/AdWordsForVideo/AddVideoCampaign.cs new file mode 100644 index 00000000000..3f00c696e5f --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AdWordsForVideo/AddVideoCampaign.cs @@ -0,0 +1,122 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example illustrates how to create a video campaign. + /// + /// Tags: VideoCampaignService.mutate, BudgetService.mutate + /// + /// AdWords for Video API is a Beta feature. + public class AddVideoCampaign : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create a video campaign."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddVideoCampaign codeExample = new AddVideoCampaign(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the BudgetService. + BudgetService budgetService = + (BudgetService) user.GetService(AdWordsService.v201406.BudgetService); + + // Get the VideoCampaignService. + VideoCampaignService videoCampaignService = + (VideoCampaignService) user.GetService(AdWordsService.v201406.VideoCampaignService); + + // Create the campaign budget. + Budget budget = new Budget(); + budget.name = "Interplanetary Cruise Budget #" + ExampleUtilities.GetRandomString(); + budget.period = BudgetBudgetPeriod.DAILY; + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + budget.amount = new Money(); + budget.amount.microAmount = 500000; + + BudgetOperation budgetOperation = new BudgetOperation(); + budgetOperation.@operator = Operator.ADD; + budgetOperation.operand = budget; + + try { + BudgetReturnValue budgetRetval = budgetService.mutate(new BudgetOperation[] { budgetOperation }); + budget = budgetRetval.value[0]; + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add shared budget.", ex); + } + + // Create video campaign. + VideoCampaign videoCampaign = new VideoCampaign(); + videoCampaign.name = ("Interplanetary Cruise #" + ExampleUtilities.GetRandomString()); + videoCampaign.status = VideoCampaignStatus.PAUSED; + videoCampaign.budgetId = budget.budgetId; + + // You can optionally provide these field(s). The dates will be + // interpreted using the account's timezone. + videoCampaign.startDate = DateTime.Now.AddDays(1).ToString("yyyyMMdd"); + + try { + // Create operations. + VideoCampaignOperation operation = new VideoCampaignOperation(); + operation.operand = videoCampaign; + operation.@operator = Operator.ADD; + + VideoCampaignOperation[] operations = new VideoCampaignOperation[] { operation }; + + // Add video campaigns. + VideoCampaignReturnValue retval = videoCampaignService.mutate(operations); + + // Display video campaigns. + if (retval != null && retval.value != null && retval.value.Length > 0) { + VideoCampaign newVideoCampaign = retval.value[0]; + Console.WriteLine("Campaign with name '{0}' and id = {1} was added.", + newVideoCampaign.name, newVideoCampaign.id); + } else { + Console.WriteLine("No video campaigns were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add video campaign.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/AdWordsForVideo/AddVideoCampaignCriteria.cs b/examples/AdWords/CSharp/v201406/AdWordsForVideo/AddVideoCampaignCriteria.cs new file mode 100644 index 00000000000..5b692a5860a --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AdWordsForVideo/AddVideoCampaignCriteria.cs @@ -0,0 +1,99 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example demonstrates how to add campaign-level criteria + /// targeting. + /// + /// Tags: VideoCampaignCriterionService.mutate + /// + /// AdWords for Video API is a Beta feature. + public class AddVideoCampaignCriteria : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example demonstrates how to add campaign-level criteria targeting."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddVideoCampaignCriteria codeExample = new AddVideoCampaignCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + public void Run(AdWordsUser user, long campaignId) { + // Get the VideoCampaignCriterionService. + VideoCampaignCriterionService service = + (VideoCampaignCriterionService) user.GetService( + AdWordsService.v201406.VideoCampaignCriterionService); + + try { + VideoCampaignCriterion criterion = new VideoCampaignCriterion(); + criterion.campaignId = campaignId; + + // for a list of languages, see + // https://devsite.googleplex.com/adwords/api/docs/appendix/languagecodes + LanguageVideoCriterion englishCriterion = new LanguageVideoCriterion(); + englishCriterion.id = 1001L; + criterion.criterion = englishCriterion; + + VideoCampaignCriterionOperation operation = new VideoCampaignCriterionOperation(); + operation.operand = criterion; + operation.@operator = Operator.ADD; + + VideoCampaignCriterionReturnValue retval = service.mutate( + new VideoCampaignCriterionOperation[] { operation }); + + if (retval != null && retval.value != null && retval.value.Length > 0) { + VideoCampaignCriterion newCriterion = retval.value[0]; + Console.WriteLine("Video campaign criterion with id = {0} and type = {1} was added " + + "to campaign id {2}", newCriterion.criterion.id, + newCriterion.criterion.BaseCriterionType, newCriterion.campaignId); + } else { + Console.WriteLine("No video campaign criteria were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add video campaign criteria.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/AdWordsForVideo/FindVideos.cs b/examples/AdWords/CSharp/v201406/AdWordsForVideo/FindVideos.cs new file mode 100644 index 00000000000..ec0350c3c0e --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AdWordsForVideo/FindVideos.cs @@ -0,0 +1,100 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example illustrates how to find YouTube videos by a search + /// string. It retrieve details for the first 100 matching videos. + /// + /// Tags: VideoService.search + /// + /// AdWords for Video API is a Beta feature. + public class FindVideos : ExampleBase { + + /// + /// Maximum number of results to fetch. + /// + private const int PAGE_SIZE = 100; + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to find YouTube videos by a search " + + "string. It retrieve details for the first 100 matching videos."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + FindVideos codeExample = new FindVideos(); + Console.WriteLine(codeExample.Description); + try { + string queryString = "INSERT_QUERY_STRING_HERE"; + codeExample.Run(new AdWordsUser(), queryString); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The video search query text. + public void Run(AdWordsUser user, string queryString) { + // Get the VideoService. + VideoService videoService = (VideoService) user.GetService( + AdWordsService.v201406.VideoService); + + // Create a selector. + VideoSearchSelector selector = new VideoSearchSelector(); + selector.searchType = VideoSearchSelectorSearchType.VIDEO; + selector.query = queryString; + selector.paging = new Paging(); + selector.paging.startIndex = 0; + selector.paging.numberResults = PAGE_SIZE; + + try { + // Run the query. + VideoSearchPage page = videoService.search(selector); + + // Display videos. + if (page != null && page.totalNumEntries > 0) { + foreach (YouTubeVideo video in page.entries) { + Console.WriteLine("YouTube video ID {0} with title {1} found.", video.id, video.title); + } + Console.WriteLine("Total number of matching videos: {0}.", page.totalNumEntries); + } else { + Console.WriteLine("No videos matching {0} were found.", queryString); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to search for videos.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/AdWordsForVideo/GetKeywordCriteria.cs b/examples/AdWords/CSharp/v201406/AdWordsForVideo/GetKeywordCriteria.cs new file mode 100644 index 00000000000..ef1a2565b52 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AdWordsForVideo/GetKeywordCriteria.cs @@ -0,0 +1,117 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example shows how to retrieve all keywords for a video + /// campaign. To get a list with all campaigns, run GetVideoCampaigns.cs. + /// + /// Tags: VideoTargetingGroupCriterionService.get + /// + /// AdWords for Video API is a Beta feature. + public class GetKeywordCriteria : ExampleBase { + + /// + /// Maximum number of results to fetch. + /// + private const int PAGE_SIZE = 100; + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to retrieve all keywords for a video campaign. " + + "To get a list with all campaigns, run GetVideoCampaigns.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetKeywordCriteria codeExample = new GetKeywordCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + public void Run(AdWordsUser user, long campaignId) { + // Get the VideoTargetingGroupCriterionService. + VideoTargetingGroupCriterionService videoTargetingGroupCriterionService = + (VideoTargetingGroupCriterionService) user.GetService( + AdWordsService.v201406.VideoTargetingGroupCriterionService); + + int offset = 0; + + TargetingGroupCriterionPage page = new TargetingGroupCriterionPage(); + + try { + // Create selector. + TargetingGroupCriterionSelector selector = new TargetingGroupCriterionSelector(); + + selector.criteriaDimension = CriteriaDimension.KEYWORD; + selector.campaignIds = new long[] { campaignId }; + + selector.paging = new Paging(); + + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = PAGE_SIZE; + + // Get all keywords. + page = videoTargetingGroupCriterionService.get(selector); + + // Display keywords. + if (page != null && page.entries != null) { + int i = offset; + foreach (TargetingGroupCriterion targetingGroupCriterion in page.entries) { + String negative = + (targetingGroupCriterion is NegativeTargetingGroupCriterion) ? + " (negative)" : ""; + BaseKeyword keyword = (BaseKeyword) targetingGroupCriterion.criterion; + Console.WriteLine("{0}) Criterion {1} ID {2}, targeting group ID {3} and " + + "text '{4}'\n", i, negative, keyword.id, + targetingGroupCriterion.targetingGroupId, keyword.text); + i++; + } + } + offset += PAGE_SIZE; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of keywords found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get keywords.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/AdWordsForVideo/GetTargetingGroups.cs b/examples/AdWords/CSharp/v201406/AdWordsForVideo/GetTargetingGroups.cs new file mode 100644 index 00000000000..20e83a1eeb0 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AdWordsForVideo/GetTargetingGroups.cs @@ -0,0 +1,112 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example shows how to retrieve all targeting groups for video + /// campaigns. + /// + /// Tags: VideoTargetingGroupService.get + /// + /// AdWords for Video API is a Beta feature. + public class GetTargetingGroups : ExampleBase { + + /// + /// Maximum number of results to fetch. + /// + private const int PAGE_SIZE = 100; + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to retrieve all targeting groups for " + + "video campaigns."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetTargetingGroups codeExample = new GetTargetingGroups(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + public void Run(AdWordsUser user, long campaignId) { + // Get the VideoTargetingGroupService. + VideoTargetingGroupService videoTargetingGroupService = (VideoTargetingGroupService) + user.GetService(AdWordsService.v201406.VideoTargetingGroupService); + + int offset = 0; + + TargetingGroupPage page = new TargetingGroupPage(); + + try { + // Create selector. + TargetingGroupSelector selector = new TargetingGroupSelector(); + selector.campaignIds = new long[] { campaignId }; + + selector.paging = new Paging(); + + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = PAGE_SIZE; + + // Get all targeting groups for this account. + page = videoTargetingGroupService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (TargetingGroup targetingGroup in page.entries) { + Console.WriteLine("{0}) Targeting group ID {1}, campaign ID {2} and name '{3}'", + (i + 1), targetingGroup.id, targetingGroup.campaignId, targetingGroup.name); + + i++; + } + } else { + Console.WriteLine("No targeting groups were found."); + } + offset += PAGE_SIZE; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of targeting groups found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get targeting groups.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/AdWordsForVideo/GetVideoCampaignCriteria.cs b/examples/AdWords/CSharp/v201406/AdWordsForVideo/GetVideoCampaignCriteria.cs new file mode 100644 index 00000000000..f9e00ccb600 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AdWordsForVideo/GetVideoCampaignCriteria.cs @@ -0,0 +1,116 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example demonstrates how to retrieve all campaign-level + /// criteria in a campaign. + /// + /// Tags: VideoCampaignCriterionService.get + /// + /// AdWords for Video API is a Beta feature. + public class GetVideoCampaignCriteria : ExampleBase { + + /// + /// Maximum number of results to fetch. + /// + private const int PAGE_SIZE = 100; + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve all non-deleted video " + + "campaigns for an account."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetVideoCampaignCriteria codeExample = new GetVideoCampaignCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + public void Run(AdWordsUser user, long campaignId) { + // Get the VideoCampaignCriterionService. + VideoCampaignCriterionService videoCampaignCriterionService = + (VideoCampaignCriterionService) user.GetService( + AdWordsService.v201406.VideoCampaignCriterionService); + + int offset = 0; + + VideoCampaignCriterionPage page = new VideoCampaignCriterionPage(); + + try { + // Create selector. + VideoCampaignCriterionSelector selector = new VideoCampaignCriterionSelector(); + selector.campaignIds = new long[] { campaignId }; + + selector.paging = new Paging(); + + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = PAGE_SIZE; + + page = videoCampaignCriterionService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (VideoCampaignCriterion videoCampaignCriterion in page.entries) { + String negative = + (videoCampaignCriterion is NegativeVideoCampaignCriterion) ? " (negative)" + : ""; + Console.WriteLine("{0}) Video {1} criterion ID {2} of type '{3}'", (i + 1), + negative, + videoCampaignCriterion.criterion.id, + videoCampaignCriterion.criterion.BaseCriterionType); + i++; + } + } else { + Console.WriteLine("No video campaign criteria were found."); + } + offset += PAGE_SIZE; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of video campaign criteria found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get video campaign criteria.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/AdWordsForVideo/GetVideoCampaignStats.cs b/examples/AdWords/CSharp/v201406/AdWordsForVideo/GetVideoCampaignStats.cs new file mode 100644 index 00000000000..fadde54fd2d --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AdWordsForVideo/GetVideoCampaignStats.cs @@ -0,0 +1,160 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example illustrates how to retrieve stats for a video campaign. + /// + /// Tags: VideoCampaignService.get + /// + /// AdWords for Video API is a Beta feature. + public class GetVideoCampaignStats : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve stats for a video campaign."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetVideoCampaignStats codeExample = new GetVideoCampaignStats(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign ID. + public void Run(AdWordsUser user, long campaignId) { + // Get the VideoCampaignService. + VideoCampaignService videoCampaignService = (VideoCampaignService) user.GetService( + AdWordsService.v201406.VideoCampaignService); + + // The dates will be interpreted using the account's timezone. + String minDateTime = DateTime.Now.Year.ToString() + "0101"; + String maxDateTime = DateTime.Now.ToString("yyyyMMdd"); + + // Create selector. + StatsSelector statsSelector = new StatsSelector(); + DateRange dateRange = new DateRange(); + dateRange.min = minDateTime; + dateRange.max = maxDateTime; + + statsSelector.dateRange = dateRange; + statsSelector.segmentationDimensions = new SegmentationDimension[] { + SegmentationDimension.DATE_MONTH }; + statsSelector.metrics = new Metric[] { Metric.VIEWS, Metric.COST, Metric.AVERAGE_CPV }; + statsSelector.summaryTypes = new VideoEntityStatsSummaryType[] { + VideoEntityStatsSummaryType.ALL }; + statsSelector.segmentedSummaryType = VideoEntityStatsSummaryType.ALL; + + try { + // Create selector. + VideoCampaignSelector selector = new VideoCampaignSelector(); + selector.statsSelector = statsSelector; + selector.ids = new long[] { campaignId }; + + selector.paging = new Paging(); + + VideoCampaignPage page = videoCampaignService.get(selector); + + if (page != null) { + if (page.entries != null && page.entries.Length > 0) { + VideoCampaign videoCampaign = page.entries[0]; + + Console.WriteLine("Campaign ID {0}, name '{1}' and status '{2}'", videoCampaign.id, + videoCampaign.name, videoCampaign.status); + if (videoCampaign.stats != null) { + Console.WriteLine("\tCampaign stats:"); + Console.WriteLine("\t\t" + FormatStats(videoCampaign.stats)); + } + if (videoCampaign.segmentedStats != null) { + foreach (VideoEntityStats segment in videoCampaign.segmentedStats) { + Console.WriteLine("\tCampaign segmented stats for month of " + + ((DateKey) segment.segmentKey.Item).date); + Console.WriteLine("\t\t" + FormatStats(segment)); + } + } + } else { + Console.WriteLine("No campaigns were found."); + } + if (page.summaryStats != null) { + foreach (VideoEntityStats summary in page.summaryStats) { + Console.WriteLine("\tSummary of type " + summary.summaryType); + Console.WriteLine("\t\t" + FormatStats(summary)); + } + } else { + Console.WriteLine("No summary stats found."); + } + } else { + Console.WriteLine("No campaigns were found."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get campaigns.", ex); + } + } + + /// + /// Formats a money value for display purposes. + /// + /// The money value. + /// The formatted money value as text. + private static String Dashify(Money m) { + return m == null ? "--" : m.microAmount.ToString(); + } + + /// + /// Formats the stats for display. + /// + /// The stats. + /// Stats as formatted text. + private static String FormatStats(VideoEntityStats stats) { + return string.Format("Views: {0}, Cost: {1}, Avg. CPC: {2}, Avg. CPV: {3}, " + + "Avg. CPM: {4}, 25%: {5}, 50%: {6}, 75%: {7}, 100%: {8}", + stats.viewsSpecified? stats.views.ToString() : "--", + Dashify(stats.cost), + Dashify(stats.averageCpc), + Dashify(stats.averageCpv), + Dashify(stats.averageCpm), + stats.quartile25PercentsSpecified? stats.quartile25Percents.ToString() : "--", + stats.quartile50PercentsSpecified? stats.quartile50Percents.ToString() : "--", + stats.quartile75PercentsSpecified? stats.quartile75Percents.ToString() : "--", + stats.quartile100PercentsSpecified? stats.quartile100Percents.ToString() : "--" + ); + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/AdWordsForVideo/GetVideoCampaigns.cs b/examples/AdWords/CSharp/v201406/AdWordsForVideo/GetVideoCampaigns.cs new file mode 100644 index 00000000000..bb8f7efd4be --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AdWordsForVideo/GetVideoCampaigns.cs @@ -0,0 +1,107 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example illustrates how to retrieve all non-deleted video + /// campaigns for an account. + /// + /// Tags: VideoCampaignService.get + /// + /// AdWords for Video API is a Beta feature. + public class GetVideoCampaigns : ExampleBase { + + /// + /// Maximum number of results to fetch. + /// + private const int PAGE_SIZE = 100; + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve all non-deleted video " + + "campaigns for an account."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetVideoCampaigns codeExample = new GetVideoCampaigns(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the VideoCampaignService. + VideoCampaignService videoCampaignService = (VideoCampaignService) user.GetService( + AdWordsService.v201406.VideoCampaignService); + + int offset = 0; + + VideoCampaignPage page = new VideoCampaignPage(); + + try { + // Create selector. + VideoCampaignSelector selector = new VideoCampaignSelector(); + + selector.paging = new Paging(); + + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = PAGE_SIZE; + + page = videoCampaignService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (VideoCampaign videoCampaign in page.entries) { + Console.WriteLine("{0}) Campaign ID {1}, name '{2}' and status '{3}'", + (i + 1), videoCampaign.id, videoCampaign.name, videoCampaign.status); + i++; + } + } else { + Console.WriteLine("No campaigns were found."); + } + offset += PAGE_SIZE; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get campaigns.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/AdvancedOperations/AddAdGroupBidModifier.cs b/examples/AdWords/CSharp/v201406/AdvancedOperations/AddAdGroupBidModifier.cs new file mode 100644 index 00000000000..c8954aa1e16 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AdvancedOperations/AddAdGroupBidModifier.cs @@ -0,0 +1,111 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example illustrates how to add ad group level mobile bid + /// modifier override. + /// + /// Tags: AdGroupBidModifierService.mutate + /// + public class AddAdGroupBidModifier : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAdGroupBidModifier codeExample = new AddAdGroupBidModifier(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + double bidModifier = double.Parse("INSERT_ADGROUP_BID_MODIFIER_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, bidModifier); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to add ad group level mobile bid modifier " + + "override."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the adgroup for which bid modifier is + /// set. + /// The mobile bid modifier for adgroup + public void Run(AdWordsUser user, long adGroupId, double bidModifier) { + // Get the AdGroupAdService. + AdGroupBidModifierService adGroupBidModifierService = + (AdGroupBidModifierService) user.GetService( + AdWordsService.v201406.AdGroupBidModifierService); + + // Mobile criterion ID. + long criterionId = 30001; + + + // Create the adgroup bid modifier. + AdGroupBidModifier adGroupBidModifier = new AdGroupBidModifier(); + adGroupBidModifier.bidModifier = bidModifier; + adGroupBidModifier.adGroupId = adGroupId; + + Platform platform = new Platform(); + platform.id = criterionId; + + adGroupBidModifier.criterion = platform; + + AdGroupBidModifierOperation operation = new AdGroupBidModifierOperation(); + operation.@operator = Operator.ADD; + operation.operand = adGroupBidModifier; + + + try { + // Add ad group level mobile bid modifier. + AdGroupBidModifierReturnValue retval = adGroupBidModifierService.mutate( + new AdGroupBidModifierOperation[] {operation}); + + // Display the results. + if (retval != null && retval.value != null && retval.value.Length > 0) { + AdGroupBidModifier newBidModifier = retval.value[0]; + Console.WriteLine("AdGroup ID {0}, Criterion ID {1} was updated with ad group level " + + "modifier: {2}", newBidModifier.adGroupId, newBidModifier.criterion.id, + newBidModifier.bidModifier); + } else { + Console.WriteLine("No bid modifiers were added to the adgroup."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add bid modifiers to adgroup.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/AdvancedOperations/AddClickToDownloadAd.cs b/examples/AdWords/CSharp/v201406/AdvancedOperations/AddClickToDownloadAd.cs new file mode 100644 index 00000000000..f4cd365b21d --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AdvancedOperations/AddClickToDownloadAd.cs @@ -0,0 +1,146 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example creates a click-to-download ad, also known as an + /// app promotion ad to a given ad group. To list ad groups, run + /// GetAdGroups.cs. + /// + /// Tags: AdGroupAdService.mutate + /// + public class AddClickToDownloadAd : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddClickToDownloadAd codeExample = new AddClickToDownloadAd(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a click-to-download ad, also known as an app " + + "promotion ad to a given ad group. To list ad groups, run GetAdGroups.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which ads are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService adGroupAdService = + (AdGroupAdService) user.GetService(AdWordsService.v201406.AdGroupAdService); + + // Create the template ad. + TemplateAd clickToDownloadAppAd = new TemplateAd(); + + clickToDownloadAppAd.name = "Ad for demo game"; + clickToDownloadAppAd.templateId = 353; + clickToDownloadAppAd.url = + "http://play.google.com/store/apps/details?id=com.example.demogame"; + clickToDownloadAppAd.displayUrl = "play.google.com"; + + // Create the template elements for the ad. You can refer to + // https://developers.google.com/adwords/api/docs/appendix/templateads + // for the list of avaliable template fields. + TemplateElementField headline = new TemplateElementField(); + headline.name = "headline"; + headline.fieldText = "Enjoy your drive in Mars"; + headline.type = TemplateElementFieldType.TEXT; + + TemplateElementField description1 = new TemplateElementField(); + description1.name = "description1"; + description1.fieldText = "Realistic physics simulation"; + description1.type = TemplateElementFieldType.TEXT; + + TemplateElementField description2 = new TemplateElementField(); + description2.name = "description2"; + description2.fieldText = "Race against players online"; + description2.type = TemplateElementFieldType.TEXT; + + TemplateElementField appId = new TemplateElementField(); + appId.name = "appId"; + appId.fieldText = "com.example.demogame"; + appId.type = TemplateElementFieldType.TEXT; + + TemplateElementField appStore = new TemplateElementField(); + appStore.name = "appStore"; + appStore.fieldText = "2"; + appStore.type = TemplateElementFieldType.ENUM; + + TemplateElement adData = new TemplateElement(); + adData.uniqueName = "adData"; + adData.fields = new TemplateElementField[] {headline, description1, description2, appId, + appStore}; + + clickToDownloadAppAd.templateElements = new TemplateElement[] {adData}; + + // Create the adgroupad. + AdGroupAd clickToDownloadAppAdGroupAd = new AdGroupAd(); + clickToDownloadAppAdGroupAd.adGroupId = adGroupId; + clickToDownloadAppAdGroupAd.ad = clickToDownloadAppAd; + + // Optional: Set the status. + clickToDownloadAppAdGroupAd.status = AdGroupAdStatus.PAUSED; + + // Create the operation. + AdGroupAdOperation operation = new AdGroupAdOperation(); + operation.@operator = Operator.ADD; + operation.operand = clickToDownloadAppAdGroupAd; + + try { + // Create the ads. + AdGroupAdReturnValue retval = adGroupAdService.mutate(new AdGroupAdOperation[] {operation}); + + // Display the results. + if (retval != null && retval.value != null) { + foreach (AdGroupAd adGroupAd in retval.value) { + Console.WriteLine("New click-to-download ad with id = \"{0}\" and url = \"{1}\" " + + "was created.", adGroupAd.ad.id, adGroupAd.ad.url); + } + } else { + Console.WriteLine("No click-to-download ads were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create click-to-download ad.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/AdvancedOperations/AddPlacesLocationExtension.cs b/examples/AdWords/CSharp/v201406/AdvancedOperations/AddPlacesLocationExtension.cs new file mode 100644 index 00000000000..82aeb63d153 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AdvancedOperations/AddPlacesLocationExtension.cs @@ -0,0 +1,193 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; +using Google.Api.Ads.Common.Lib; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example adds a feed that syncs feed items from a Google + /// Places account and associates the feed with a customer. + /// + /// Tags: CustomerFeedService.mutate, FeedItemService.mutate + /// Tags: FeedMappingService.mutate, FeedService.mutate + /// + public class AddPlacesLocationExtension : ExampleBase { + + /// + /// The placeholder type for location extensions. See the Placeholder + /// reference page for a list of all the placeholder types and fields. + /// + /// https://developers.google.com/adwords/api/docs/appendix/placeholders + /// + private const int PLACEHOLDER_LOCATION = 7; + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a feed that syncs feed items from a Google Places " + + "account and associates the feed with a customer."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddPlacesLocationExtension codeExample = new AddPlacesLocationExtension(); + Console.WriteLine(codeExample.Description); + try { + string placesEmailAddress = "INSERT_PLACES_EMAIL_ADDRESS_HERE"; + // To obtain an access token for your Places account, run the + // OAuthTokenGenerator utility and capture the Credential's + // access token. + string placesAccessToken = "INSERT_PLACES_ACCESS_TOKEN_HERE"; + codeExample.Run(new AdWordsUser(), placesEmailAddress, placesAccessToken); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The email address for Google Places + /// account. + /// The OAuth2 access token for Google + /// Places account. + public void Run(AdWordsUser user, string placesEmailAddress, string placesAccessToken) { + FeedService feedService = (FeedService) user.GetService(AdWordsService.v201406.FeedService); + + CustomerFeedService customerFeedService = (CustomerFeedService) user.GetService( + AdWordsService.v201406.CustomerFeedService); + + // Create a feed that will sync to the Google Places account specified + // by placesEmailAddress. Do not add FeedAttributes to this object, + // as AdWords will add them automatically because this will be a + // system generated feed. + Feed placesFeed = new Feed(); + placesFeed.name = String.Format("Places feed #{0}", ExampleUtilities.GetRandomString()); + + PlacesLocationFeedData feedData = new PlacesLocationFeedData(); + feedData.emailAddress = placesEmailAddress; + OAuthInfo oAuthInfo = new OAuthInfo(); + oAuthInfo.httpMethod = "GET"; + oAuthInfo.httpRequestUrl = "https://www.google.com/local/add"; + oAuthInfo.httpAuthorizationHeader = string.Format("Bearer {0}", placesAccessToken); + feedData.oAuthInfo = oAuthInfo; + + placesFeed.systemFeedGenerationData = feedData; + + // Since this feed's feed items will be managed by AdWords, + // you must set its origin to ADWORDS. + placesFeed.origin = FeedOrigin.ADWORDS; + + // Create an operation to add the feed. + FeedOperation feedOperation = new FeedOperation(); + feedOperation.operand = placesFeed; + feedOperation.@operator = Operator.ADD; + + try { + // Add the feed. Since it is a system generated feed, AdWords will + // automatically: + // 1. Set up the FeedAttributes on the feed. + // 2. Set up a FeedMapping that associates the FeedAttributes of the + // feed with the placeholder fields of the LOCATION placeholder + // type. + FeedReturnValue addFeedResult = feedService.mutate(new FeedOperation[] { feedOperation }); + Feed addedFeed = addFeedResult.value[0]; + Console.WriteLine("Added places feed with ID {0}", addedFeed.id); + + // Add a CustomerFeed that associates the feed with this customer for + // the LOCATION placeholder type. + CustomerFeed customerFeed = new CustomerFeed(); + customerFeed.feedId = addedFeed.id; + customerFeed.placeholderTypes = new int[] { PLACEHOLDER_LOCATION }; + + // Create a matching function that will always evaluate to true. + Function customerMatchingFunction = new Function(); + ConstantOperand constOperand = new ConstantOperand(); + constOperand.type = ConstantOperandConstantType.BOOLEAN; + constOperand.booleanValue = true; + customerMatchingFunction.lhsOperand = new FunctionArgumentOperand[] { constOperand }; + customerMatchingFunction.@operator = FunctionOperator.IDENTITY; + customerFeed.matchingFunction = customerMatchingFunction; + + // Create an operation to add the customer feed. + CustomerFeedOperation customerFeedOperation = new CustomerFeedOperation(); + customerFeedOperation.operand = customerFeed; + customerFeedOperation.@operator = Operator.ADD; + + // After the completion of the Feed ADD operation above the added feed + // will not be available for usage in a CustomerFeed until the sync + // between the AdWords and Places accounts completes. The loop below + // will retry adding the CustomerFeed up to ten times with an + // exponential back-off policy. + CustomerFeed addedCustomerFeed = null; + + AdWordsAppConfig config = new AdWordsAppConfig(); + config.RetryCount = 10; + + ErrorHandler errorHandler = new ErrorHandler(config); + do { + try { + CustomerFeedReturnValue customerFeedResult = + customerFeedService.mutate(new CustomerFeedOperation[] { customerFeedOperation }); + addedCustomerFeed = customerFeedResult.value[0]; + + Console.WriteLine("Added CustomerFeed for feed ID {0} and placeholder type {1}", + addedCustomerFeed.feedId, addedCustomerFeed.placeholderTypes[0]); + break; + } catch (AdWordsApiException e) { + ApiException apiException = (ApiException) e.ApiException; + foreach (ApiError error in apiException.errors) { + if (error is CustomerFeedError) { + if ((error as CustomerFeedError).reason == + CustomerFeedErrorReason.MISSING_FEEDMAPPING_FOR_PLACEHOLDER_TYPE) { + errorHandler.DoExponentialBackoff(); + errorHandler.IncrementRetriedAttempts(); + } else { + throw; + } + } + } + + } + } while (errorHandler.HaveMoreRetryAttemptsLeft()); + + // OPTIONAL: Create a CampaignFeed to specify which FeedItems to use at + // the Campaign level. This will be similar to the CampaignFeed in the + // AddSiteLinks example, except you can also filter based on the + // business name and category of each FeedItem by using a + // FeedAttributeOperand in your matching function. + + // OPTIONAL: Create an AdGroupFeed for even more fine grained control + // over which feed items are used at the AdGroup level. + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create customer feed.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/AdvancedOperations/AddSiteLinks.cs b/examples/AdWords/CSharp/v201406/AdvancedOperations/AddSiteLinks.cs new file mode 100644 index 00000000000..313fcf09eaf --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AdvancedOperations/AddSiteLinks.cs @@ -0,0 +1,322 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: thagikura@gmail.com (Takeshi Hagikura) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + class SiteLinksDataHolder { + long siteLinksFeedId; + long linkTextFeedAttributeId; + long linkUrlFeedAttributeId; + List siteLinkFeedItemIds = new List(); + + public long SiteLinksFeedId { + get { + return siteLinksFeedId; + } + set { + siteLinksFeedId = value; + } + } + + public long LinkTextFeedAttributeId { + get { + return linkTextFeedAttributeId; + } + set { + linkTextFeedAttributeId = value; + } + } + + public long LinkUrlFeedAttributeId { + get { + return linkUrlFeedAttributeId; + } + set { + linkUrlFeedAttributeId = value; + } + } + + public List SiteLinkFeedItemIds { + get { + return siteLinkFeedItemIds; + } + set { + siteLinkFeedItemIds = value; + } + } + } + + /// + /// This code example adds a sitelinks feed and associates it with a campaign. + /// To create a campaign, run AddCampaign.cs. + /// + /// Tags: CampaignFeedService.mutate, FeedService.mutate, FeedItemService.mutate, + /// Tags: FeedMappingService.mutate + /// + public class AddSiteLinks : ExampleBase { + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddSiteLinks codeExample = new AddSiteLinks(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a sitelinks feed and associates it with a campaign."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign with which sitelinks are associated. + /// + public void Run(AdWordsUser user, long campaignId) { + SiteLinksDataHolder siteLinksData = new SiteLinksDataHolder(); + createSiteLinksFeed(user, siteLinksData); + createSiteLinksFeedItems(user, siteLinksData); + createSiteLinksFeedMapping(user, siteLinksData); + createSiteLinksCampaignFeed(user, siteLinksData, campaignId); + } + + private static void createSiteLinksFeed( + AdWordsUser user, SiteLinksDataHolder siteLinksData) { + // Get the FeedService. + FeedService feedService = (FeedService) user.GetService(AdWordsService.v201406.FeedService); + + // Create attributes. + FeedAttribute textAttribute = new FeedAttribute(); + textAttribute.type = FeedAttributeType.STRING; + textAttribute.name = "Link Text"; + FeedAttribute urlAttribute = new FeedAttribute(); + urlAttribute.type = FeedAttributeType.URL; + urlAttribute.name = "Link URL"; + + // Create the feed. + Feed siteLinksFeed = new Feed(); + siteLinksFeed.name = "Feed For Site Links"; + siteLinksFeed.attributes = new FeedAttribute[] {textAttribute, urlAttribute}; + siteLinksFeed.origin = FeedOrigin.USER; + + // Create operation. + FeedOperation operation = new FeedOperation(); + operation.operand = siteLinksFeed; + operation.@operator = Operator.ADD; + + // Add the feed. + FeedReturnValue result = feedService.mutate(new FeedOperation[] {operation}); + + Feed savedFeed = result.value[0]; + siteLinksData.SiteLinksFeedId = savedFeed.id; + FeedAttribute[] savedAttributes = savedFeed.attributes; + siteLinksData.LinkTextFeedAttributeId = savedAttributes[0].id; + siteLinksData.LinkUrlFeedAttributeId = savedAttributes[1].id; + Console.WriteLine("Feed with name {0} and ID {1} with linkTextAttributeId {2}" + + " and linkUrlAttributeId {3} was created.", savedFeed.name, savedFeed.id, + savedAttributes[0].id, savedAttributes[1].id); + } + + private static void createSiteLinksFeedItems( + AdWordsUser user, SiteLinksDataHolder siteLinksData) { + // Get the FeedItemService. + FeedItemService feedItemService = + (FeedItemService) user.GetService(AdWordsService.v201406.FeedItemService); + + // Create operations to add FeedItems. + FeedItemOperation home = + newSiteLinkFeedItemAddOperation(siteLinksData, + "Home", "http://www.example.com"); + FeedItemOperation stores = + newSiteLinkFeedItemAddOperation(siteLinksData, + "Stores", "http://www.example.com/stores"); + FeedItemOperation onSale = + newSiteLinkFeedItemAddOperation(siteLinksData, + "On Sale", "http://www.example.com/sale"); + FeedItemOperation support = + newSiteLinkFeedItemAddOperation(siteLinksData, + "Support", "http://www.example.com/support"); + FeedItemOperation products = + newSiteLinkFeedItemAddOperation(siteLinksData, + "Products", "http://www.example.com/prods"); + FeedItemOperation aboutUs = + newSiteLinkFeedItemAddOperation(siteLinksData, + "About Us", "http://www.example.com/about"); + + FeedItemOperation[] operations = + new FeedItemOperation[] {home, stores, onSale, support, products, aboutUs}; + + FeedItemReturnValue result = feedItemService.mutate(operations); + foreach (FeedItem item in result.value) { + Console.WriteLine("FeedItem with feedItemId {0} was added.", item.feedItemId); + siteLinksData.SiteLinkFeedItemIds.Add(item.feedItemId); + } + } + + // See the Placeholder reference page for a list of all the placeholder types and fields. + // https://developers.google.com/adwords/api/docs/appendix/placeholders.html + private const int PLACEHOLDER_SITELINKS = 1; + + // See the Placeholder reference page for a list of all the placeholder types and fields. + private const int PLACEHOLDER_FIELD_SITELINK_LINK_TEXT = 1; + private const int PLACEHOLDER_FIELD_SITELINK_URL = 2; + + private static void createSiteLinksFeedMapping( + AdWordsUser user, SiteLinksDataHolder siteLinksData) { + // Get the FeedItemService. + FeedMappingService feedMappingService = + (FeedMappingService) user.GetService(AdWordsService.v201406.FeedMappingService); + + // Map the FeedAttributeIds to the fieldId constants. + AttributeFieldMapping linkTextFieldMapping = new AttributeFieldMapping(); + linkTextFieldMapping.feedAttributeId = siteLinksData.LinkTextFeedAttributeId; + linkTextFieldMapping.fieldId = PLACEHOLDER_FIELD_SITELINK_LINK_TEXT; + AttributeFieldMapping linkUrlFieldMapping = new AttributeFieldMapping(); + linkUrlFieldMapping.feedAttributeId = siteLinksData.LinkUrlFeedAttributeId; + linkUrlFieldMapping.fieldId = PLACEHOLDER_FIELD_SITELINK_URL; + + // Create the FieldMapping and operation. + FeedMapping feedMapping = new FeedMapping(); + feedMapping.placeholderType = PLACEHOLDER_SITELINKS; + feedMapping.feedId = siteLinksData.SiteLinksFeedId; + feedMapping.attributeFieldMappings = + new AttributeFieldMapping[] {linkTextFieldMapping, linkUrlFieldMapping}; + FeedMappingOperation operation = new FeedMappingOperation(); + operation.operand = feedMapping; + operation.@operator = Operator.ADD; + + // Save the field mapping. + FeedMappingReturnValue result = + feedMappingService.mutate(new FeedMappingOperation[] {operation}); + foreach (FeedMapping savedFeedMapping in result.value) { + Console.WriteLine( + "Feed mapping with ID {0} and placeholderType {1} was saved for feed with ID {2}.", + savedFeedMapping.feedMappingId, savedFeedMapping.placeholderType, + savedFeedMapping.feedId); + } + } + + private static void createSiteLinksCampaignFeed(AdWordsUser user, + SiteLinksDataHolder siteLinksData, long campaignId) { + // Get the CampaignFeedService. + CampaignFeedService campaignFeedService = + (CampaignFeedService) user.GetService(AdWordsService.v201406.CampaignFeedService); + + // Map the feed item ids to the campaign using an IN operation. + RequestContextOperand feedItemRequestContextOperand = new RequestContextOperand(); + feedItemRequestContextOperand.contextType = RequestContextOperandContextType.FEED_ITEM_ID; + + List feedItemOperands = new List(); + foreach (long feedItemId in siteLinksData.SiteLinkFeedItemIds) { + ConstantOperand feedItemOperand = new ConstantOperand(); + feedItemOperand.longValue = feedItemId; + feedItemOperand.type = ConstantOperandConstantType.LONG; + feedItemOperands.Add(feedItemOperand); + } + + Function feedItemfunction = new Function(); + feedItemfunction.lhsOperand = new FunctionArgumentOperand[] {feedItemRequestContextOperand}; + feedItemfunction.@operator = FunctionOperator.IN; + feedItemfunction.rhsOperand = feedItemOperands.ToArray(); + + // Optional: to target to a platform, define a function and 'AND' it with + // the feed item ID link: + RequestContextOperand platformRequestContextOperand = new RequestContextOperand(); + platformRequestContextOperand.contextType = RequestContextOperandContextType.DEVICE_PLATFORM; + + ConstantOperand platformOperand = new ConstantOperand(); + platformOperand.stringValue = "Mobile"; + platformOperand.type = ConstantOperandConstantType.STRING; + + Function platformFunction = new Function(); + platformFunction.lhsOperand = new FunctionArgumentOperand[] {platformRequestContextOperand}; + platformFunction.@operator = FunctionOperator.EQUALS; + platformFunction.rhsOperand = new FunctionArgumentOperand[] {platformOperand}; + + // Combine the two functions using an AND operation. + FunctionOperand feedItemFunctionOperand = new FunctionOperand(); + feedItemFunctionOperand.value = feedItemfunction; + + FunctionOperand platformFunctionOperand = new FunctionOperand(); + platformFunctionOperand.value = platformFunction; + + Function combinedFunction = new Function(); + combinedFunction.@operator = FunctionOperator.AND; + combinedFunction.lhsOperand = new FunctionArgumentOperand[] { + feedItemFunctionOperand, platformFunctionOperand}; + + CampaignFeed campaignFeed = new CampaignFeed(); + campaignFeed.feedId = siteLinksData.SiteLinksFeedId; + campaignFeed.campaignId = campaignId; + campaignFeed.matchingFunction = combinedFunction; + // Specifying placeholder types on the CampaignFeed allows the same feed + // to be used for different placeholders in different Campaigns. + campaignFeed.placeholderTypes = new int[] {PLACEHOLDER_SITELINKS}; + + CampaignFeedOperation operation = new CampaignFeedOperation(); + operation.operand = campaignFeed; + operation.@operator = Operator.ADD; + CampaignFeedReturnValue result = + campaignFeedService.mutate(new CampaignFeedOperation[] {operation}); + foreach (CampaignFeed savedCampaignFeed in result.value) { + Console.WriteLine("Campaign with ID {0} was associated with feed with ID {1}", + savedCampaignFeed.campaignId, savedCampaignFeed.feedId); + } + } + + private static FeedItemOperation newSiteLinkFeedItemAddOperation( + SiteLinksDataHolder siteLinksData, String text, String url) { + // Create the FeedItemAttributeValues for our text values. + FeedItemAttributeValue linkTextAttributeValue = new FeedItemAttributeValue(); + linkTextAttributeValue.feedAttributeId = siteLinksData.LinkTextFeedAttributeId; + linkTextAttributeValue.stringValue = text; + FeedItemAttributeValue linkUrlAttributeValue = new FeedItemAttributeValue(); + linkUrlAttributeValue.feedAttributeId = siteLinksData.LinkUrlFeedAttributeId; + linkUrlAttributeValue.stringValue = url; + + // Create the feed item and operation. + FeedItem item = new FeedItem(); + item.feedId = siteLinksData.SiteLinksFeedId; + item.attributeValues = + new FeedItemAttributeValue[] {linkTextAttributeValue, linkUrlAttributeValue}; + FeedItemOperation operation = new FeedItemOperation(); + operation.operand = item; + operation.@operator = Operator.ADD; + return operation; + } + } +} diff --git a/examples/AdWords/CSharp/v201406/AdvancedOperations/AddTextAdWithUpgradedUrls.cs b/examples/AdWords/CSharp/v201406/AdvancedOperations/AddTextAdWithUpgradedUrls.cs new file mode 100644 index 00000000000..05c22ec2ecf --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AdvancedOperations/AddTextAdWithUpgradedUrls.cs @@ -0,0 +1,159 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example adds a text ad that uses upgraded URLs. This example + /// will only work if your account is a test account or is whitelisted for + /// this feature. + /// + /// Tags: AdGroupAdService.mutate + /// + public class AddTextAdWithUpgradedUrls : ExampleBase { + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddTextAdWithUpgradedUrls codeExample = new AddTextAdWithUpgradedUrls(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a text ad that uses upgraded URLs. This example will " + + "only work if your account is a test account or is whitelisted for this feature."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// ID of the ad group to which ad is added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201406.AdGroupAdService); + + // Create the text ad. + TextAd textAd = new TextAd(); + textAd.headline = "Luxury Cruise to Mars"; + textAd.description1 = "Visit the Red Planet in style."; + textAd.description2 = "Low-gravity fun for everyone!"; + textAd.displayUrl = "www.example.com"; + + // Specify a tracking URL for 3rd party tracking provider. You may + // specify one at customer, campaign, ad group, ad, criterion or + // feed item levels. + textAd.trackingUrlTemplate = + "http://tracker.example.com/?cid={_season}&promocode={_promocode}&u={lpurl}"; + + // Since your tracking URL has two custom parameters, provide their + // values too. This can be provided at campaign, ad group, ad, criterion + // or feed item levels. + CustomParameter seasonParameter = new CustomParameter(); + seasonParameter.key = "season"; + seasonParameter.value = "christmas"; + + CustomParameter promoCodeParameter = new CustomParameter(); + promoCodeParameter.key = "promocode"; + promoCodeParameter.value = "NYC123"; + + textAd.urlCustomParameters = new CustomParameters(); + textAd.urlCustomParameters.parameters = + new CustomParameter[] { seasonParameter, promoCodeParameter }; + + // Specify a list of final URLs. This field cannot be set if URL field is + // set. This may be specified at ad, criterion and feed item levels. + textAd.finalUrls = new string[] { + "http://www.example.com/cruise/space/", + "http://www.example.com/locations/mars/" + }; + + // Specify a list of final mobile URLs. This field cannot be set if URL + // field is set, or finalUrls is unset. This may be specified at ad, + // criterion and feed item levels. + textAd.finalMobileUrls = new string[] { + "http://mobile.example.com/cruise/space/", + "http://mobile.example.com/locations/mars/" + }; + + AdGroupAd textAdGroupAd = new AdGroupAd(); + textAdGroupAd.adGroupId = adGroupId; + textAdGroupAd.ad = textAd; + + // Optional: Set the status. + textAdGroupAd.status = AdGroupAdStatus.PAUSED; + + // Create the operation. + AdGroupAdOperation operation = new AdGroupAdOperation(); + operation.@operator = Operator.ADD; + operation.operand = textAdGroupAd; + + AdGroupAdReturnValue retVal = null; + + try { + // Create the ads. + retVal = service.mutate(new AdGroupAdOperation[] { operation }); + + // Display the results. + if (retVal != null && retVal.value != null) { + AdGroupAd newAdGroupAd = retVal.value[0]; + Console.WriteLine("New text ad with ID = {0} and display URL = \"{1}\" was " + + "created.", newAdGroupAd.ad.id, newAdGroupAd.ad.displayUrl); + Console.WriteLine("Upgraded URL properties:"); + TextAd newTextAd = (TextAd) newAdGroupAd.ad; + + Console.WriteLine(" Final URLs: {0}", string.Join(", ", newTextAd.finalUrls)); + Console.WriteLine(" Final Mobile URLs: {0}", + string.Join(", ", newTextAd.finalMobileUrls)); + Console.WriteLine(" Tracking URL template: {0}", newTextAd.trackingUrlTemplate); + + List parameters = new List(); + foreach (CustomParameter customParam in newTextAd.urlCustomParameters.parameters) { + parameters.Add(string.Format("{0}={1}", customParam.key, customParam.value)); + } + Console.WriteLine(" Custom parameters: {0}", string.Join(", ", parameters.ToArray())); + } else { + Console.WriteLine("No text ads were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create text ad.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/AdvancedOperations/GetAdGroupBidModifiers.cs b/examples/AdWords/CSharp/v201406/AdvancedOperations/GetAdGroupBidModifiers.cs new file mode 100644 index 00000000000..5d7f58676e7 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AdvancedOperations/GetAdGroupBidModifiers.cs @@ -0,0 +1,122 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example illustrates how to retrieve ad group level mobile bid + /// modifiers for a campaign. + /// + /// Tags: AdGroupBidModifierService.get + /// + public class GetAdGroupBidModifiers : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAdGroupBidModifiers codeExample = new GetAdGroupBidModifiers(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve ad group level mobile bid " + + "modifiers for a campaign."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which ads are added. + /// + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupAdService. + AdGroupBidModifierService adGroupBidModifierService = + (AdGroupBidModifierService) user.GetService( + AdWordsService.v201406.AdGroupBidModifierService); + + const int PAGE_SIZE = 500; + + // Get all ad group bid modifiers for the campaign. + Selector selector = new Selector(); + selector.fields = new String[] {"CampaignId", "AdGroupId", "BidModifier", "BidModifierSource", + "CriteriaType", "Id"}; + + Predicate predicate = new Predicate(); + predicate.field = "CampaignId"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] {campaignId.ToString()}; + selector.predicates = new Predicate[] {predicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = PAGE_SIZE; + + AdGroupBidModifierPage page = new AdGroupBidModifierPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the campaigns. + page = adGroupBidModifierService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroupBidModifier adGroupBidModifier in page.entries) { + string bidModifier = (adGroupBidModifier.bidModifierSpecified)? + adGroupBidModifier.bidModifier.ToString() : "UNSET"; + Console.WriteLine("{0}) Campaign ID {1}, AdGroup ID {2}, Criterion ID {3} has " + + "ad group level modifier: {4} and source = {5}.", + i + 1, adGroupBidModifier.campaignId, + adGroupBidModifier.adGroupId, adGroupBidModifier.criterion.id, bidModifier, + adGroupBidModifier.bidModifierSource); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of adgroup bid modifiers found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve adgroup bid modifiers.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/AdvancedOperations/UploadOfflineConversions.cs b/examples/AdWords/CSharp/v201406/AdvancedOperations/UploadOfflineConversions.cs new file mode 100644 index 00000000000..0b3098b4f7a --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AdvancedOperations/UploadOfflineConversions.cs @@ -0,0 +1,139 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example imports offline conversion values for specific clicks to + /// your account. To get Google Click ID for a click, run + /// CLICK_PERFORMANCE_REPORT. + /// + /// Tags: ConversionTrackerService.mutate, OfflineConversionFeedService.mutate + /// + public class UploadOfflineConversions : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + string conversionName = "INSERT_CONVERSION_NAME_HERE"; + // GCLID needs to be newer than 30 days. + string gClId = "INSERT_GOOGLE_CLICK_ID_HERE"; + // The conversion time should be higher than the click time. + string conversionTime = "INSERT_CONVERSION_TIME_HERE"; + double conversionValue = double.Parse("INSERT_CONVERSION_VALUE_HERE"); + + UploadOfflineConversions codeExample = new UploadOfflineConversions(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser(), conversionName, gClId, conversionTime, conversionValue); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example imports offline conversion values for specific clicks to " + + "your account. To get Google Click ID for a click, run CLICK_PERFORMANCE_REPORT."; + } + } + + /// + /// Runs the specified user. + /// + /// The user. + /// The name of the upload conversion to be + /// created. + /// The Google Click ID of the click for which offline + /// conversions are uploaded. + /// The conversion value to be uploaded. + /// + /// The conversion time, in yyyymmdd hhmmss + /// format. + public void Run(AdWordsUser user, String conversionName, String gClid, String conversionTime, + double conversionValue) { + // Get the ConversionTrackerService. + ConversionTrackerService conversionTrackerService = + (ConversionTrackerService) user.GetService( + AdWordsService.v201406.ConversionTrackerService); + + // Get the OfflineConversionFeedService. + OfflineConversionFeedService offlineConversionFeedService = + (OfflineConversionFeedService) user.GetService( + AdWordsService.v201406.OfflineConversionFeedService); + + const int VIEWTHROUGH_LOOKBACK_WINDOW = 30; + const int CTC_LOOKBACK_WINDOW = 90; + + try { + // Create an upload conversion. Once created, this entry will be visible + // under Tools and Analysis->Conversion and will have "Source = Import". + UploadConversion uploadConversion = new UploadConversion(); + uploadConversion.category = ConversionTrackerCategory.PAGE_VIEW; + uploadConversion.name = conversionName; + uploadConversion.viewthroughLookbackWindow = VIEWTHROUGH_LOOKBACK_WINDOW; + uploadConversion.ctcLookbackWindow = CTC_LOOKBACK_WINDOW; + + ConversionTrackerOperation uploadConversionOperation = new ConversionTrackerOperation(); + uploadConversionOperation.@operator = Operator.ADD; + uploadConversionOperation.operand = uploadConversion; + + ConversionTrackerReturnValue conversionTrackerRetval = conversionTrackerService.mutate( + new ConversionTrackerOperation[] {uploadConversionOperation}); + + UploadConversion newUploadConversion = (UploadConversion) conversionTrackerRetval.value[0]; + + Console.WriteLine("New upload conversion type with name = '{0}' and id = {1} was created.", + newUploadConversion.name, newUploadConversion.id); + + // Associate offline conversions with the upload conversion we created. + OfflineConversionFeed feed = new OfflineConversionFeed(); + feed.conversionName = conversionName; + feed.conversionTime = conversionTime; + feed.conversionValue = conversionValue; + feed.googleClickId = gClid; + + OfflineConversionFeedOperation offlineConversionOperation = + new OfflineConversionFeedOperation(); + offlineConversionOperation.@operator = Operator.ADD; + offlineConversionOperation.operand = feed; + + OfflineConversionFeedReturnValue offlineConversionRetval = + offlineConversionFeedService.mutate( + new OfflineConversionFeedOperation[] {offlineConversionOperation}); + + OfflineConversionFeed newFeed = offlineConversionRetval.value[0]; + + Console.WriteLine("Uploaded offline conversion value of {0} for Google Click ID = " + + "'{1}' to '{2}'.", newFeed.conversionValue, newFeed.googleClickId, + newFeed.conversionName); + } catch (Exception ex) { + throw new System.ApplicationException("Failed upload offline conversions.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/AdvancedOperations/UseSharedBiddingStrategy.cs b/examples/AdWords/CSharp/v201406/AdvancedOperations/UseSharedBiddingStrategy.cs new file mode 100644 index 00000000000..a2ee41e5a50 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/AdvancedOperations/UseSharedBiddingStrategy.cs @@ -0,0 +1,209 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example adds a Shared Bidding Strategy and uses it to construct + /// a campaign. + /// + /// Tags: BiddingStrategyService.mutate + /// Tags: BudgetService.mutate, CampaignService.mutate + /// + public class UseSharedBiddingStrategy : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UseSharedBiddingStrategy codeExample = new UseSharedBiddingStrategy(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a Shared Bidding Strategy and uses it to construct " + + "a campaign."; + } + } + + /// + /// Runs the specified code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the services. + BiddingStrategyService biddingStrategyService = (BiddingStrategyService) user.GetService( + AdWordsService.v201406.BiddingStrategyService); + + BudgetService budgetService = (BudgetService) user.GetService( + AdWordsService.v201406.BudgetService); + + CampaignService campaignService = (CampaignService) user.GetService( + AdWordsService.v201406.CampaignService); + + String BIDDINGSTRATEGY_NAME = "Maximize Clicks " + ExampleUtilities.GetRandomString(); + const long BID_CEILING = 2000000; + const long SPEND_TARGET = 20000000; + + String BUDGET_NAME = "Shared Interplanetary Budget #" + ExampleUtilities.GetRandomString(); + const long BUDGET_AMOUNT = 30000000; + + String CAMPAIGN_NAME = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString(); + + try { + SharedBiddingStrategy sharedBiddingStrategy = CreateBiddingStrategy(biddingStrategyService, + BIDDINGSTRATEGY_NAME, BID_CEILING, SPEND_TARGET); + Console.WriteLine("Shared bidding strategy with name '{0}' and ID {1} of type {2} was " + + "created.", sharedBiddingStrategy.name, sharedBiddingStrategy.id, + sharedBiddingStrategy.biddingScheme.BiddingSchemeType); + + Budget sharedBudget = CreateSharedBudget(budgetService, BUDGET_NAME, BUDGET_AMOUNT); + + Campaign newCampaign = CreateCampaignWithBiddingStrategy(campaignService, CAMPAIGN_NAME, + sharedBiddingStrategy.id, sharedBudget.budgetId); + + Console.WriteLine("Campaign with name '{0}', ID {1} and bidding scheme ID {2} was " + + "created.", newCampaign.name, newCampaign.id, + newCampaign.biddingStrategyConfiguration.biddingStrategyId); + + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create campaign that uses shared " + + "bidding strategy.", ex); + } + } + + /// + /// Creates the shared bidding strategy. + /// + /// The bidding strategy service. + /// The bidding strategy name. + /// The bid ceiling. + /// The spend target. + /// The bidding strategy object. + private SharedBiddingStrategy CreateBiddingStrategy( + BiddingStrategyService biddingStrategyService, String name, long bidCeiling, + long spendTarget) { + // Create a shared bidding strategy. + SharedBiddingStrategy sharedBiddingStrategy = new SharedBiddingStrategy(); + sharedBiddingStrategy.name = name; + + TargetSpendBiddingScheme biddingScheme = new TargetSpendBiddingScheme(); + // Optionally set additional bidding scheme parameters. + biddingScheme.bidCeiling = new Money(); + biddingScheme.bidCeiling.microAmount = bidCeiling; + + biddingScheme.spendTarget = new Money(); + biddingScheme.spendTarget.microAmount = spendTarget; + + sharedBiddingStrategy.biddingScheme = biddingScheme; + + // Create operation. + BiddingStrategyOperation operation = new BiddingStrategyOperation(); + operation.@operator = Operator.ADD; + operation.operand = sharedBiddingStrategy; + + return biddingStrategyService.mutate(new BiddingStrategyOperation[] {operation}).value[0]; + } + + /// + /// Creates an explicit budget to be used only to create the Campaign. + /// + /// The budget service. + /// The budget name. + /// The budget amount. + /// The budget object. + private Budget CreateSharedBudget(BudgetService budgetService, String name, long amount) { + // Create a shared budget + Budget budget = new Budget(); + budget.name = name; + budget.period = BudgetBudgetPeriod.DAILY; + budget.amount = new Money(); + budget.amount.microAmount = amount; + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + budget.isExplicitlyShared = true; + + // Create operation. + BudgetOperation operation = new BudgetOperation(); + operation.operand = budget; + operation.@operator = Operator.ADD; + + // Make the mutate request. + return budgetService.mutate(new BudgetOperation[] {operation}).value[0]; + } + + /// + /// Creates the campaign with a shared bidding strategy. + /// + /// The campaign service. + /// The campaign name. + /// The bidding strategy id. + /// The shared budget id. + /// The campaign object. + private Campaign CreateCampaignWithBiddingStrategy(CampaignService campaignService, string name, + long biddingStrategyId, long sharedBudgetId) { + // Create campaign. + Campaign campaign = new Campaign(); + campaign.name = name; + campaign.advertisingChannelType = AdvertisingChannelType.SEARCH; + + // Set the budget. + campaign.budget = new Budget(); + campaign.budget.budgetId = sharedBudgetId; + + // Set bidding strategy (required). + BiddingStrategyConfiguration biddingStrategyConfiguration = + new BiddingStrategyConfiguration(); + biddingStrategyConfiguration.biddingStrategyId = biddingStrategyId; + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration; + + // Set keyword matching setting (required). + KeywordMatchSetting keywordMatchSetting = new KeywordMatchSetting(); + keywordMatchSetting.optIn = true; + campaign.settings = new Setting[] {keywordMatchSetting}; + + // Set network targeting (recommended). + NetworkSetting networkSetting = new NetworkSetting(); + networkSetting.targetGoogleSearch = true; + networkSetting.targetSearchNetwork = true; + networkSetting.targetContentNetwork = true; + campaign.networkSetting = networkSetting; + + // Create operation. + CampaignOperation operation = new CampaignOperation(); + operation.operand = campaign; + operation.@operator = Operator.ADD; + + return campaignService.mutate(new CampaignOperation[] {operation}).value[0]; + } + } +} diff --git a/examples/AdWords/CSharp/v201406/BasicOperations/AddAdGroupDemographicCriteria.cs b/examples/AdWords/CSharp/v201406/BasicOperations/AddAdGroupDemographicCriteria.cs new file mode 100644 index 00000000000..913e8234cae --- /dev/null +++ b/examples/AdWords/CSharp/v201406/BasicOperations/AddAdGroupDemographicCriteria.cs @@ -0,0 +1,123 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example adds demographic target criteria to an ad group. To get + /// ad groups, run AddAdGroup.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class AddAdGroupDemographicCriteria : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAdGroupDemographicCriteria codeExample = new AddAdGroupDemographicCriteria(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds demographic target criteria to an ad group. To get ad " + + "groups, run AddAdGroup.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which criteria are + /// added. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201406.AdGroupCriterionService); + + // Create biddable ad group criterion for gender + Gender genderTarget = new Gender(); + // Criterion Id for male. The IDs can be found here + // https://developers.google.com/adwords/api/docs/appendix/genders + genderTarget.id = 10; + + BiddableAdGroupCriterion genderBiddableAdGroupCriterion = new BiddableAdGroupCriterion(); + genderBiddableAdGroupCriterion.adGroupId = adGroupId; + genderBiddableAdGroupCriterion.criterion = genderTarget; + + // Create negative ad group criterion for age range + AgeRange ageRangeNegative = new AgeRange(); + // Criterion Id for age 18 to 24. The IDs can be found here + // https://developers.google.com/adwords/api/docs/appendix/ages + + ageRangeNegative.id = 503001; + NegativeAdGroupCriterion ageRangeNegativeAdGroupCriterion = new NegativeAdGroupCriterion(); + ageRangeNegativeAdGroupCriterion.adGroupId = adGroupId; + ageRangeNegativeAdGroupCriterion.criterion = ageRangeNegative; + + // Create operations. + AdGroupCriterionOperation genderBiddableAdGroupCriterionOperation = + new AdGroupCriterionOperation(); + genderBiddableAdGroupCriterionOperation.operand = genderBiddableAdGroupCriterion; + genderBiddableAdGroupCriterionOperation.@operator = Operator.ADD; + + AdGroupCriterionOperation ageRangeNegativeAdGroupCriterionOperation = + new AdGroupCriterionOperation(); + ageRangeNegativeAdGroupCriterionOperation.operand = ageRangeNegativeAdGroupCriterion; + ageRangeNegativeAdGroupCriterionOperation.@operator = Operator.ADD; + + AdGroupCriterionOperation[] operations = new AdGroupCriterionOperation[] { + genderBiddableAdGroupCriterionOperation, ageRangeNegativeAdGroupCriterionOperation}; + + try { + // Add ad group criteria. + AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations); + + // Display ad group criteria. + if (result != null && result.value != null) { + foreach (AdGroupCriterion adGroupCriterionResult in result.value) { + Console.WriteLine("Ad group criterion with ad group id \"{0}\", criterion id " + + "\"{1}\", and type \"{2}\" was added.", adGroupCriterionResult.adGroupId, + adGroupCriterionResult.criterion.id, + adGroupCriterionResult.criterion.CriterionType); + } + } else { + Console.WriteLine("No ad group criteria were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create ad group criteria.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/BasicOperations/AddAdGroups.cs b/examples/AdWords/CSharp/v201406/BasicOperations/AddAdGroups.cs new file mode 100644 index 00000000000..4cbec6c7e90 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/BasicOperations/AddAdGroups.cs @@ -0,0 +1,137 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example illustrates how to create ad groups. To create + /// campaigns, run AddCampaigns.cs. + /// + /// Tags: AdGroupService.mutate + /// + public class AddAdGroups : ExampleBase { + /// + /// Number of items being added / updated in this code example. + /// + const int NUM_ITEMS = 5; + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAdGroups codeExample = new AddAdGroups(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create ad groups. To create campaigns, " + + "run AddCampaigns.cs"; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to which ad groups are + /// added. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201406.AdGroupService); + + List operations = new List(); + + for (int i = 0; i < NUM_ITEMS; i++) { + // Create the ad group. + AdGroup adGroup = new AdGroup(); + adGroup.name = string.Format("Earth to Mars Cruises #{0}", + ExampleUtilities.GetRandomString()); + adGroup.status = AdGroupStatus.ENABLED; + adGroup.campaignId = campaignId; + + // Set the ad group bids. + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + + CpcBid cpcBid = new CpcBid(); + cpcBid.bid = new Money(); + cpcBid.bid.microAmount = 10000000; + + biddingConfig.bids = new Bids[] {cpcBid}; + + adGroup.biddingStrategyConfiguration = biddingConfig; + + // Optional: Set targeting restrictions. + // These setting only affect serving for the Display Network. + TargetingSetting targetingSetting = new TargetingSetting(); + + TargetingSettingDetail placementDetail = new TargetingSettingDetail(); + placementDetail.criterionTypeGroup = CriterionTypeGroup.PLACEMENT; + placementDetail.targetAll = true; + + TargetingSettingDetail verticalDetail = new TargetingSettingDetail(); + verticalDetail.criterionTypeGroup = CriterionTypeGroup.VERTICAL; + verticalDetail.targetAll = false; + + targetingSetting.details = new TargetingSettingDetail[] {placementDetail, verticalDetail}; + + adGroup.settings = new Setting[] {targetingSetting}; + + // Create the operation. + AdGroupOperation operation = new AdGroupOperation(); + operation.@operator = Operator.ADD; + operation.operand = adGroup; + + operations.Add(operation); + } + + try { + // Create the ad group. + AdGroupReturnValue retVal = adGroupService.mutate(operations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + foreach (AdGroup newAdGroup in retVal.value) { + Console.WriteLine("Ad group with id = '{0}' and name = '{1}' was created.", + newAdGroup.id, newAdGroup.name); + } + } else { + Console.WriteLine("No ad groups were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create ad groups.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/BasicOperations/AddCampaigns.cs b/examples/AdWords/CSharp/v201406/BasicOperations/AddCampaigns.cs new file mode 100644 index 00000000000..75d09b49de3 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/BasicOperations/AddCampaigns.cs @@ -0,0 +1,168 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example adds campaigns. To get campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignService.mutate + /// + public class AddCampaigns : ExampleBase { + /// + /// Number of items being added / updated in this code example. + /// + const int NUM_ITEMS = 5; + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddCampaigns codeExample = new AddCampaigns(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds campaigns. To get campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the BudgetService. + BudgetService budgetService = + (BudgetService) user.GetService(AdWordsService.v201406.BudgetService); + + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201406.CampaignService); + + // Create the campaign budget. + Budget budget = new Budget(); + budget.name = "Interplanetary Cruise Budget #" + ExampleUtilities.GetRandomString(); + budget.period = BudgetBudgetPeriod.DAILY; + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + budget.amount = new Money(); + budget.amount.microAmount = 500000; + + BudgetOperation budgetOperation = new BudgetOperation(); + budgetOperation.@operator = Operator.ADD; + budgetOperation.operand = budget; + + try { + BudgetReturnValue budgetRetval = budgetService.mutate(new BudgetOperation[] {budgetOperation}); + budget = budgetRetval.value[0]; + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add shared budget.", ex); + } + + List operations = new List(); + + for (int i = 0; i < NUM_ITEMS; i++) { + // Create the campaign. + Campaign campaign = new Campaign(); + campaign.name = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString(); + campaign.status = CampaignStatus.PAUSED; + campaign.advertisingChannelType = AdvertisingChannelType.SEARCH; + + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + biddingConfig.biddingStrategyType = BiddingStrategyType.MANUAL_CPC; + campaign.biddingStrategyConfiguration = biddingConfig; + + campaign.budget = new Budget(); + campaign.budget.budgetId = budget.budgetId; + + // Set the campaign network options. + campaign.networkSetting = new NetworkSetting(); + campaign.networkSetting.targetGoogleSearch = true; + campaign.networkSetting.targetSearchNetwork = true; + campaign.networkSetting.targetContentNetwork = false; + campaign.networkSetting.targetPartnerSearchNetwork = false; + + // Set the campaign settings for Advanced location options. + GeoTargetTypeSetting geoSetting = new GeoTargetTypeSetting(); + geoSetting.positiveGeoTargetType = GeoTargetTypeSettingPositiveGeoTargetType.DONT_CARE; + geoSetting.negativeGeoTargetType = GeoTargetTypeSettingNegativeGeoTargetType.DONT_CARE; + + // Set the campaign settings for near-exact and near-phrase matches. + KeywordMatchSetting keywordSetting = new KeywordMatchSetting(); + keywordSetting.optIn = false; + + campaign.settings = new Setting[] {geoSetting, keywordSetting}; + + // Optional: Set the start date. + campaign.startDate = DateTime.Now.AddDays(1).ToString("yyyyMMdd"); + + // Optional: Set the end date. + campaign.endDate = DateTime.Now.AddYears(1).ToString("yyyyMMdd"); + + // Optional: Set the campaign ad serving optimization status. + campaign.adServingOptimizationStatus = AdServingOptimizationStatus.ROTATE; + + // Optional: Set the frequency cap. + FrequencyCap frequencyCap = new FrequencyCap(); + frequencyCap.impressions = 5; + frequencyCap.level = Level.ADGROUP; + frequencyCap.timeUnit = TimeUnit.DAY; + campaign.frequencyCap = frequencyCap; + + // Create the operation. + CampaignOperation operation = new CampaignOperation(); + operation.@operator = Operator.ADD; + operation.operand = campaign; + + operations.Add(operation); + } + + try { + // Add the campaign. + CampaignReturnValue retVal = campaignService.mutate(operations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + foreach (Campaign newCampaign in retVal.value) { + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was added.", + newCampaign.name, newCampaign.id); + } + } else { + Console.WriteLine("No campaigns were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add campaigns.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/BasicOperations/AddKeywords.cs b/examples/AdWords/CSharp/v201406/BasicOperations/AddKeywords.cs new file mode 100644 index 00000000000..a12ba9c13b1 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/BasicOperations/AddKeywords.cs @@ -0,0 +1,127 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example adds a keyword to an ad group. To get ad groups, run + /// GetAdGroups.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class AddKeywords : ExampleBase { + /// + /// Number of items being added / updated in this code example. + /// + const int NUM_ITEMS = 5; + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddKeywords codeExample = new AddKeywords(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a keyword to an ad group. To get ad groups, run " + + "GetAdGroups.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which keywords are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService( + AdWordsService.v201406.AdGroupCriterionService); + + List operations = new List(); + + for (int i = 0; i < NUM_ITEMS; i++) { + // Create the keyword. + Keyword keyword = new Keyword(); + keyword.text = "mars cruise"; + keyword.matchType = KeywordMatchType.BROAD; + + // Create the biddable ad group criterion. + BiddableAdGroupCriterion keywordCriterion = new BiddableAdGroupCriterion(); + keywordCriterion.adGroupId = adGroupId; + keywordCriterion.criterion = keyword; + + // Optional: Set the user status. + keywordCriterion.userStatus = UserStatus.PAUSED; + + // Optional: Set the keyword destination url. + keywordCriterion.destinationUrl = "http://example.com/mars/cruise/" + i; + + // Create the operations. + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.@operator = Operator.ADD; + operation.operand = keywordCriterion; + + operations.Add(operation); + } + try { + // Create the keywords. + AdGroupCriterionReturnValue retVal = adGroupCriterionService.mutate(operations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null) { + foreach (AdGroupCriterion adGroupCriterion in retVal.value) { + // If you are adding multiple type of criteria, then you may need to + // check for + // + // if (adGroupCriterion is Keyword) { ... } + // + // to identify the criterion type. + Console.WriteLine("Keyword with ad group id = '{0}', keyword id = '{1}', text = " + + "'{2}' and match type = '{3}' was created.", adGroupCriterion.adGroupId, + adGroupCriterion.criterion.id, (adGroupCriterion.criterion as Keyword).text, + (adGroupCriterion.criterion as Keyword).matchType); + } + } else { + Console.WriteLine("No keywords were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create keywords.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/BasicOperations/AddTextAds.cs b/examples/AdWords/CSharp/v201406/BasicOperations/AddTextAds.cs new file mode 100644 index 00000000000..92e7fd4d0ce --- /dev/null +++ b/examples/AdWords/CSharp/v201406/BasicOperations/AddTextAds.cs @@ -0,0 +1,129 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example adds text ads to a given ad group. To list ad groups, + /// run GetAdGroups.cs. To learn how to handle policy violations and add + /// exemption requests, see HandlePolicyViolationError.cs. + /// + /// Tags: AdGroupAdService.mutate + /// + public class AddTextAds : ExampleBase { + /// + /// Number of items being added / updated in this code example. + /// + const int NUM_ITEMS = 5; + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddTextAds codeExample = new AddTextAds(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds text ads to a given ad group. To list ad groups, run " + + "GetAdGroups.cs. To learn how to handle policy violations and add exemption " + + "requests, see HandlePolicyViolationError.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which ads are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201406.AdGroupAdService); + + List operations = new List(); + + for (int i = 0; i < NUM_ITEMS; i++) { + // Create the text ad. + TextAd textAd = new TextAd(); + textAd.headline = "Luxury Cruise to Mars"; + textAd.description1 = "Visit the Red Planet in style."; + textAd.description2 = "Low-gravity fun for everyone!"; + textAd.displayUrl = "www.example.com"; + textAd.url = "http://www.example.com/" + i; + + AdGroupAd textAdGroupAd = new AdGroupAd(); + textAdGroupAd.adGroupId = adGroupId; + textAdGroupAd.ad = textAd; + + // Optional: Set the status. + textAdGroupAd.status = AdGroupAdStatus.PAUSED; + + // Create the operation. + AdGroupAdOperation operation = new AdGroupAdOperation(); + operation.@operator = Operator.ADD; + operation.operand = textAdGroupAd; + + operations.Add(operation); + } + + AdGroupAdReturnValue retVal = null; + + try { + // Create the ads. + retVal = service.mutate(operations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null) { + // If you are adding multiple type of Ads, then you may need to check + // for + // + // if (adGroupAd.ad is TextAd) { ... } + // + // to identify the ad type. + foreach (AdGroupAd adGroupAd in retVal.value) { + Console.WriteLine("New text ad with id = \"{0}\" and displayUrl = \"{1}\" was created.", + adGroupAd.ad.id, adGroupAd.ad.displayUrl); + } + } else { + Console.WriteLine("No text ads were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create text ad.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/BasicOperations/GetAdGroups.cs b/examples/AdWords/CSharp/v201406/BasicOperations/GetAdGroups.cs new file mode 100644 index 00000000000..0349940c8ac --- /dev/null +++ b/examples/AdWords/CSharp/v201406/BasicOperations/GetAdGroups.cs @@ -0,0 +1,113 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example illustrates how to retrieve all the ad groups for a + /// campaign. To create an ad group, run AddAdGroup.cs. + /// + /// Tags: AdGroupService.get + /// + public class GetAdGroups : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAdGroups codeExample = new GetAdGroups(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve all the ad groups for a " + + "campaign. To create an ad group, run AddAdGroup.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign for which ad groups are + /// retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201406.AdGroupService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Name"}; + + // Create the filters. + Predicate predicate = new Predicate(); + predicate.field = "CampaignId"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] {campaignId.ToString()}; + selector.predicates = new Predicate[] {predicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupPage page = new AdGroupPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the ad groups. + page = adGroupService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroup adGroup in page.entries) { + Console.WriteLine("{0}) Ad group name is '{1}' and id is {2}.", i + 1, adGroup.name, + adGroup.id); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of ad groups found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve ad groups.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/BasicOperations/GetCampaigns.cs b/examples/AdWords/CSharp/v201406/BasicOperations/GetCampaigns.cs new file mode 100644 index 00000000000..f8a5fde1223 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/BasicOperations/GetCampaigns.cs @@ -0,0 +1,102 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example lists all campaigns. To add a campaign, run + /// AddCampaign.cs. + /// + /// Tags: CampaignService.get + /// + public class GetCampaigns : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetCampaigns codeExample = new GetCampaigns(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example lists all campaigns. To add a campaign, run AddCampaign.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201406.CampaignService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Name", "Status"}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + CampaignPage page = new CampaignPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the campaigns. + page = campaignService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (Campaign campaign in page.entries) { + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = '{3}'" + + " was found.", i + 1, campaign.id, campaign.name, campaign.status); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve campaigns", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/BasicOperations/GetCampaignsWithAwql.cs b/examples/AdWords/CSharp/v201406/BasicOperations/GetCampaignsWithAwql.cs new file mode 100644 index 00000000000..7e4ab157874 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/BasicOperations/GetCampaignsWithAwql.cs @@ -0,0 +1,100 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example lists all campaigns using an AWQL query. See + /// https://developers.google.com/adwords/api/docs/guides/awql for AWQL + /// documentation. To add a campaign, run AddCampaign.cs. + /// + /// Tags: CampaignService.get + /// + public class GetCampaignsWithAwql : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetCampaignsWithAwql codeExample = new GetCampaignsWithAwql(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example lists all campaigns using an AWQL query. See " + + "https://developers.google.com/adwords/api/docs/guides/awql for AWQL documentation. " + + "To add a campaign, run AddCampaign.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201406.CampaignService); + + // Create the query. + string query = "SELECT Id, Name, Status ORDER BY Name"; + + int offset = 0; + int pageSize = 500; + + CampaignPage page = new CampaignPage(); + + try { + do { + string queryWithPaging = string.Format("{0} LIMIT {1}, {2}", query, offset, pageSize); + + // Get the campaigns. + page = campaignService.query(queryWithPaging); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (Campaign campaign in page.entries) { + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = '{3}'" + + " was found.", i + 1, campaign.id, campaign.name, campaign.status); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve campaigns", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/BasicOperations/GetKeywords.cs b/examples/AdWords/CSharp/v201406/BasicOperations/GetKeywords.cs new file mode 100644 index 00000000000..b00be1981a9 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/BasicOperations/GetKeywords.cs @@ -0,0 +1,127 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example gets all keywords in an account. To add keywords, run + /// AddKeywords.cs. + /// + /// Tags: AdGroupCriterionService.get + /// + public class GetKeywords : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetKeywords codeExample = new GetKeywords(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all keywords in an account. To add keywords, run " + + "AddKeywords.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201406.AdGroupCriterionService); + + // Create a selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "AdGroupId", "KeywordText"}; + + // Select only keywords. + Predicate predicate = new Predicate(); + predicate.field = "CriteriaType"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] {"KEYWORD"}; + selector.predicates = new Predicate[] {predicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupCriterionPage page = new AdGroupCriterionPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the keywords. + page = adGroupCriterionService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + + foreach (AdGroupCriterion adGroupCriterion in page.entries) { + bool isNegative = (adGroupCriterion is NegativeAdGroupCriterion); + + // If you are retrieving multiple type of criteria, then you may + // need to check for + // + // if (adGroupCriterion is Keyword) { ... } + // + // to identify the criterion type. + Keyword keyword = (Keyword) adGroupCriterion.criterion; + if (isNegative) { + Console.WriteLine("{0}) Negative keyword with ad group ID = '{1}', keyword ID " + + "= '{2}', and text = '{3}' was found.", i + 1, adGroupCriterion.adGroupId, + keyword.id, keyword.text); + } else { + Console.WriteLine("{0}) Keyword with ad group ID = '{1}', keyword ID = '{2}', " + + "text = '{3}' and matchType = '{4} was found.", i + 1, + adGroupCriterion.adGroupId, keyword.id, keyword.text, keyword.matchType); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of keywords found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve keywords.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/BasicOperations/GetTextAds.cs b/examples/AdWords/CSharp/v201406/BasicOperations/GetTextAds.cs new file mode 100644 index 00000000000..3998c72f932 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/BasicOperations/GetTextAds.cs @@ -0,0 +1,140 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example retrieves all text ads given an existing ad group. + /// To add text ads to an existing ad group, run AddTextAds.cs. + /// + /// Tags: AdGroupAdService.get + /// + public class GetTextAds : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetTextAds codeExample = new GetTextAds(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves all text ads given an existing ad group. To add " + + "text ads to an existing ad group, run AddTextAds.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group from which text ads are + /// retrieved. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201406.AdGroupAdService); + + // Create a selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Status", "Headline", "Description1", "Description2", + "DisplayUrl"}; + + // Set the sort order. + OrderBy orderBy = new OrderBy(); + orderBy.field = "Id"; + orderBy.sortOrder = SortOrder.ASCENDING; + selector.ordering = new OrderBy[] {orderBy}; + + // Restrict the fetch to only the selected ad group id. + Predicate adGroupPredicate = new Predicate(); + adGroupPredicate.field = "AdGroupId"; + adGroupPredicate.@operator = PredicateOperator.EQUALS; + adGroupPredicate.values = new string[] {adGroupId.ToString()}; + + // Retrieve only text ads. + Predicate typePredicate = new Predicate(); + typePredicate.field = "AdType"; + typePredicate.@operator = PredicateOperator.EQUALS; + typePredicate.values = new string[] {"TEXT_AD"}; + + // By default disabled ads aren't returned by the selector. To return + // them include the DISABLED status in the statuses field. + Predicate statusPredicate = new Predicate(); + statusPredicate.field = "Status"; + statusPredicate.@operator = PredicateOperator.IN; + + statusPredicate.values = new string[] {AdGroupAdStatus.ENABLED.ToString(), + AdGroupAdStatus.PAUSED.ToString(), AdGroupAdStatus.DISABLED.ToString()}; + + selector.predicates = new Predicate[] {adGroupPredicate, statusPredicate, typePredicate}; + + // Select the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupAdPage page = new AdGroupAdPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the text ads. + page = service.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + + foreach (AdGroupAd adGroupAd in page.entries) { + TextAd textAd = (TextAd) adGroupAd.ad; + Console.WriteLine("{0}) Ad id is {1} and status is {2}", i + 1, textAd.id, + adGroupAd.status); + Console.WriteLine(" {0}\n {1}\n {2}\n {3}", textAd.headline, + textAd.description1, textAd.description2, textAd.displayUrl); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of text ads found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get text ads", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/BasicOperations/PauseAd.cs b/examples/AdWords/CSharp/v201406/BasicOperations/PauseAd.cs new file mode 100644 index 00000000000..59bc7e8cbf3 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/BasicOperations/PauseAd.cs @@ -0,0 +1,101 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example pauses a given ad. To list all ads, run GetTextAds.cs. + /// + /// Tags: AdGroupAdService.mutate + /// + public class PauseAd : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + PauseAd codeExample = new PauseAd(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long adId = long.Parse("INSERT_AD_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, adId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example pauses a given ad. To list all ads, run GetTextAds.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the ad. + /// + /// Id of the ad to be paused. + public void Run(AdWordsUser user, long adGroupId, long adId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201406.AdGroupAdService); + + AdGroupAdStatus status = AdGroupAdStatus.PAUSED; + + // Create the ad group ad. + AdGroupAd adGroupAd = new AdGroupAd(); + adGroupAd.status = status; + adGroupAd.adGroupId = adGroupId; + + adGroupAd.ad = new Ad(); + adGroupAd.ad.id = adId; + + // Create the operation. + AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation(); + adGroupAdOperation.@operator = Operator.SET; + adGroupAdOperation.operand = adGroupAd; + + try { + // Update the ad. + AdGroupAdReturnValue retVal = service.mutate(new AdGroupAdOperation[]{adGroupAdOperation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupAd pausedAdGroupAd = retVal.value[0]; + Console.WriteLine("Ad with id \"{0}\" and ad group id \"{1}\"was paused.", + pausedAdGroupAd.ad.id, pausedAdGroupAd.adGroupId); + } else { + Console.WriteLine("No ads were paused."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to pause ad.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/BasicOperations/RemoveAd.cs b/examples/AdWords/CSharp/v201406/BasicOperations/RemoveAd.cs new file mode 100644 index 00000000000..bc1eaf0494d --- /dev/null +++ b/examples/AdWords/CSharp/v201406/BasicOperations/RemoveAd.cs @@ -0,0 +1,103 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example removes an ad using the 'REMOVE' operator. To list ads, + /// run GetTextAds.cs. + /// + /// Tags: AdGroupAdService.mutate + /// + public class RemoveAd : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + RemoveAd codeExample = new RemoveAd(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long adId = long.Parse("INSERT_AD_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, adId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example removes an ad using the 'REMOVE' operator. To list ads, " + + "run GetTextAds.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the ad. + /// Id of the ad being removed. + public void Run(AdWordsUser user, long adGroupId, long adId) { + // Get the AdGroupAdService. + AdGroupAdService adGroupAdService = (AdGroupAdService) user.GetService( + AdWordsService.v201406.AdGroupAdService); + + // Since we do not need to update any ad-specific fields, it is enough to + // create the base type. + Ad ad = new Ad(); + ad.id = adId; + + // Create the ad group ad. + AdGroupAd adGroupAd = new AdGroupAd(); + adGroupAd.adGroupId = adGroupId; + + adGroupAd.ad = ad; + + // Create the operation. + AdGroupAdOperation operation = new AdGroupAdOperation(); + operation.operand = adGroupAd; + operation.@operator = Operator.REMOVE; + + try { + // Remove the ad. + AdGroupAdReturnValue retVal = adGroupAdService.mutate( + new AdGroupAdOperation[] {operation}); + + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupAd removedAdGroupAd = retVal.value[0]; + Console.WriteLine("Ad with id = \"{0}\" and type = \"{1}\" was removed.", + removedAdGroupAd.ad.id, removedAdGroupAd.ad.AdType); + } else { + Console.WriteLine("No ads were removed."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to remove ad.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/BasicOperations/RemoveAdGroup.cs b/examples/AdWords/CSharp/v201406/BasicOperations/RemoveAdGroup.cs new file mode 100644 index 00000000000..29ea835c342 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/BasicOperations/RemoveAdGroup.cs @@ -0,0 +1,99 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example removes an ad group by setting the status to 'REMOVED'. + /// To get ad groups, run GetAdGroups.cs. + /// + /// Tags: AdGroupService.mutate + /// + public class RemoveAdGroup : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + RemoveAdGroup codeExample = new RemoveAdGroup(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example removes an ad group by setting the status to 'REMOVED'. " + + "To get ad groups, run GetAdGroups.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to be removed. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupService. + AdGroupService adGroupService = (AdGroupService) user.GetService( + AdWordsService.v201406.AdGroupService); + + // Create ad group with REMOVED status. + AdGroup adGroup = new AdGroup(); + adGroup.id = adGroupId; + + // When deleting an ad group, rename it to avoid name collisions with new + // adgroups. + adGroup.name = "Removed AdGroup - " + ExampleUtilities.GetRandomString(); + adGroup.status = AdGroupStatus.REMOVED; + + // Create the operation. + AdGroupOperation operation = new AdGroupOperation(); + operation.operand = adGroup; + operation.@operator = Operator.SET; + + try { + // Remove the ad group. + AdGroupReturnValue retVal = adGroupService.mutate(new AdGroupOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroup removedAdGroup = retVal.value[0]; + Console.WriteLine("Ad group with id = \"{0}\" was renamed to \"{1}\" and removed.", + removedAdGroup.id, removedAdGroup.name); + } else { + Console.WriteLine("No ad groups were removed."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to remove ad group.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/BasicOperations/RemoveCampaign.cs b/examples/AdWords/CSharp/v201406/BasicOperations/RemoveCampaign.cs new file mode 100644 index 00000000000..e6a194bc105 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/BasicOperations/RemoveCampaign.cs @@ -0,0 +1,99 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example removes a campaign by setting the status to 'REMOVED'. + /// To get campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignService.mutate + /// + public class RemoveCampaign : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + RemoveCampaign codeExample = new RemoveCampaign(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example removes a campaign by setting the status to 'REMOVED'. " + + "To get campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to be removed. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignService. + CampaignService campaignService = (CampaignService) user.GetService( + AdWordsService.v201406.CampaignService); + + // Create campaign with REMOVED status. + Campaign campaign = new Campaign(); + campaign.id = campaignId; + + // When removing a campaign, rename it to avoid name collisions with new + // campaigns. + campaign.name = "Removed Campaign - " + ExampleUtilities.GetRandomString(); + campaign.status = CampaignStatus.REMOVED; + + // Create the operation. + CampaignOperation operation = new CampaignOperation(); + operation.operand = campaign; + operation.@operator = Operator.SET; + + try { + // Remove the campaign. + CampaignReturnValue retVal = campaignService.mutate(new CampaignOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + Campaign removedCampaign = retVal.value[0]; + Console.WriteLine("Campaign with id = \"{0}\" was renamed to \"{1}\" and removed.", + removedCampaign.id, removedCampaign.name); + } else { + Console.WriteLine("No campaigns were removed."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to remove campaign.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/BasicOperations/RemoveKeyword.cs b/examples/AdWords/CSharp/v201406/BasicOperations/RemoveKeyword.cs new file mode 100644 index 00000000000..e324ba23829 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/BasicOperations/RemoveKeyword.cs @@ -0,0 +1,103 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example removes a keyword using the 'REMOVE' operator. To get + /// keywords, run GetKeywords.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class RemoveKeyword : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + RemoveKeyword codeExample = new RemoveKeyword(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long keywordId = long.Parse("INSERT_KEYWORD_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, keywordId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example removes a keyword using the 'REMOVE' operator. To get " + + "keywords, run GetKeywords.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the keyword. + /// + /// Id of the keyword to be removed. + public void Run(AdWordsUser user, long adGroupId, long keywordId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = (AdGroupCriterionService)user.GetService( + AdWordsService.v201406.AdGroupCriterionService); + + // Create base class criterion to avoid setting keyword-specific fields. + Criterion criterion = new Criterion(); + criterion.id = keywordId; + + // Create the ad group criterion. + BiddableAdGroupCriterion adGroupCriterion = new BiddableAdGroupCriterion(); + adGroupCriterion.adGroupId = adGroupId; + adGroupCriterion.criterion = criterion; + + // Create the operation. + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.operand = adGroupCriterion; + operation.@operator = Operator.REMOVE; + + try { + // Remove the keyword. + AdGroupCriterionReturnValue retVal = adGroupCriterionService.mutate( + new AdGroupCriterionOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupCriterion removedKeyword = retVal.value[0]; + Console.WriteLine("Keyword with ad group id = \"{0}\" and id = \"{1}\" was removed.", + removedKeyword.adGroupId, removedKeyword.criterion.id); + } else { + Console.WriteLine("No keywords were removed."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to remove keyword.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/BasicOperations/UpdateAdGroup.cs b/examples/AdWords/CSharp/v201406/BasicOperations/UpdateAdGroup.cs new file mode 100644 index 00000000000..be77478e32c --- /dev/null +++ b/examples/AdWords/CSharp/v201406/BasicOperations/UpdateAdGroup.cs @@ -0,0 +1,95 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example illustrates how to update an ad group, setting its + /// status to 'PAUSED'. To create an ad group, run AddAdGroup.cs. + /// + /// Tags: AdGroupService.mutate + /// + public class UpdateAdGroup : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdateAdGroup codeExample = new UpdateAdGroup(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to update an ad group, setting its status to " + + "'PAUSED'. To create an ad group, run AddAdGroup.cs"; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to be updated. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201406.AdGroupService); + + // Create the ad group. + AdGroup adGroup = new AdGroup(); + adGroup.status = AdGroupStatus.PAUSED; + adGroup.id = adGroupId; + + // Create the operation. + AdGroupOperation operation = new AdGroupOperation(); + operation.@operator = Operator.SET; + operation.operand = adGroup; + + try { + // Update the ad group. + AdGroupReturnValue retVal = adGroupService.mutate(new AdGroupOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroup pausedAdGroup = retVal.value[0]; + Console.WriteLine("Ad group with id = '{0}' was successfully updated.", + pausedAdGroup.id); + } else { + Console.WriteLine("No ad groups were updated."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update ad group.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/BasicOperations/UpdateCampaign.cs b/examples/AdWords/CSharp/v201406/BasicOperations/UpdateCampaign.cs new file mode 100644 index 00000000000..f09876e07ed --- /dev/null +++ b/examples/AdWords/CSharp/v201406/BasicOperations/UpdateCampaign.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example updates a campaign. To get campaigns, run + /// GetCampaigns.cs. + /// + /// Tags: CampaignService.mutate + /// + public class UpdateCampaign : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdateCampaign codeExample = new UpdateCampaign(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a campaign. To get campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to be updated. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService)user.GetService(AdWordsService.v201406.CampaignService); + + // Create the campaign. + Campaign campaign = new Campaign(); + campaign.id = campaignId; + campaign.status = CampaignStatus.PAUSED; + + // Create the operation. + CampaignOperation operation = new CampaignOperation(); + operation.@operator = Operator.SET; + operation.operand = campaign; + + try { + // Update the campaign. + CampaignReturnValue retVal = campaignService.mutate((new CampaignOperation[] {operation})); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + Campaign updatedCampaign = retVal.value[0]; + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was updated.", + updatedCampaign.name, updatedCampaign.id); + } else { + Console.WriteLine("No campaigns were updated."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update campaign.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/BasicOperations/UpdateKeyword.cs b/examples/AdWords/CSharp/v201406/BasicOperations/UpdateKeyword.cs new file mode 100644 index 00000000000..f916caa4a20 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/BasicOperations/UpdateKeyword.cs @@ -0,0 +1,123 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example updates the bid of a keyword. To get keyword, run + /// GetKeywords.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class UpdateKeyword : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdateKeyword codeExample = new UpdateKeyword(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long keywordId = long.Parse("INSERT_KEYWORD_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, keywordId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the bid of a keyword. To get keyword, run " + + "GetKeywords.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the keyword. + /// + /// Id of the keyword to be updated. + public void Run(AdWordsUser user, long adGroupId, long keywordId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201406.AdGroupCriterionService); + + // Since we are not updating any keyword-specific fields, it is enough to + // create a criterion object. + Criterion criterion = new Criterion(); + criterion.id = keywordId; + + // Create ad group criterion. + BiddableAdGroupCriterion biddableAdGroupCriterion = new BiddableAdGroupCriterion(); + biddableAdGroupCriterion.adGroupId = adGroupId; + biddableAdGroupCriterion.criterion = criterion; + + // Create the bids. + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + CpcBid cpcBid = new CpcBid(); + cpcBid.bid = new Money(); + cpcBid.bid.microAmount = 1000000; + biddingConfig.bids = new Bids[] {cpcBid}; + + biddableAdGroupCriterion.biddingStrategyConfiguration = biddingConfig; + + // Create the operation. + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.@operator = Operator.SET; + operation.operand = biddableAdGroupCriterion; + + try { + // Update the keyword. + AdGroupCriterionReturnValue retVal = + adGroupCriterionService.mutate(new AdGroupCriterionOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupCriterion adGroupCriterion = retVal.value[0]; + long bidAmount = 0; + foreach (Bids bids in (adGroupCriterion as BiddableAdGroupCriterion). + biddingStrategyConfiguration.bids) { + if (bids is CpcBid) { + bidAmount = (bids as CpcBid).bid.microAmount; + break; + } + } + + Console.WriteLine("Keyword with ad group id = '{0}', id = '{1}' was updated with " + + "bid amount = '{2}' micros.", adGroupCriterion.adGroupId, + adGroupCriterion.criterion.id, bidAmount); + } else { + Console.WriteLine("No keyword was updated."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update keyword.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/CampaignManagement/AddCampaignLabels.cs b/examples/AdWords/CSharp/v201406/CampaignManagement/AddCampaignLabels.cs new file mode 100644 index 00000000000..4f37ea6aa96 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/CampaignManagement/AddCampaignLabels.cs @@ -0,0 +1,104 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example adds a label to multiple campaigns. + /// + /// Tags: CampaignService.mutateLabels + /// + public class AddCampaignLabels : ExampleBase { + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddCampaignLabels codeExample = new AddCampaignLabels(); + Console.WriteLine(codeExample.Description); + try { + long campaignId1 = long.Parse("INSERT_CAMPAIGN_ID1_HERE"); + long campaignId2 = long.Parse("INSERT_CAMPAIGN_ID2_HERE"); + long labelId = long.Parse("INSERT_LABEL_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId1, campaignId2, labelId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a label to multiple campaigns."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to which labels are + /// added. + /// Id of the campaign to which labels are + /// added. + /// ID of the label to apply. + public void Run(AdWordsUser user, long campaignId1, long campaignId2, long labelId) { + try { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201406.CampaignService); + + // Create label operations. + List operations = new List(); + + foreach (long campaignId in new long[] { campaignId1, campaignId2 }) { + CampaignLabel campaignLabel = new CampaignLabel(); + campaignLabel.campaignId = campaignId; + campaignLabel.labelId = labelId; + + CampaignLabelOperation operation = new CampaignLabelOperation(); + operation.operand = campaignLabel; + operation.@operator = Operator.ADD; + + operations.Add(operation); + } + CampaignLabelReturnValue retval = campaignService.mutateLabel( + operations.ToArray()); + + // Display campaign labels. + if (retval != null && retval.value != null) { + foreach (CampaignLabel newCampaignLabel in retval.value) { + Console.WriteLine("Campaign label for campaign ID {0} and label ID {1} was added.\n", + newCampaignLabel.campaignId, newCampaignLabel.labelId); + } + } else { + Console.WriteLine("No campaign labels were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add campaign label.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/CampaignManagement/AddExperiment.cs b/examples/AdWords/CSharp/v201406/CampaignManagement/AddExperiment.cs new file mode 100644 index 00000000000..7b66a6f8238 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/CampaignManagement/AddExperiment.cs @@ -0,0 +1,215 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example creates an experiment using a query percentage of 10, + /// which defines what fraction of auctions should go to the control split + /// (90%) vs. the experiment split (10%), then adds experimental bid changes + /// for criteria and ad groups. To get campaigns, run GetCampaigns.cs. + /// To get ad groups, run GetAdGroups.cs. To get criteria, run + /// GetKeywords.cs. + /// + /// Tags: ExperimentService.mutate + /// + public class AddExperiment : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddExperiment codeExample = new AddExperiment(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long criterionId = long.Parse("INSERT_CRITERION_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId, adGroupId, criterionId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates an experiment using a query percentage of 10, which " + + "defines what fraction of auctions should go to the control split (90%) vs. the " + + "experiment split (10%), then adds experimental bid changes for criteria and ad " + + "groups. To get campaigns, run GetCampaigns.cs. To get ad groups, run " + + "GetAdGroups.cs. To get criteria, run GetKeywords.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to which experiments are + /// added. + /// Id of the ad group to which experiments are + /// added. + /// Id of the criterion for which experiments + /// are added. + public void Run(AdWordsUser user, long campaignId, long adGroupId, long criterionId) { + // Get the ExperimentService. + ExperimentService experimentService = + (ExperimentService) user.GetService(AdWordsService.v201406.ExperimentService); + + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201406.AdGroupService); + + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201406.AdGroupCriterionService); + + // Create the experiment. + Experiment experiment = new Experiment(); + experiment.campaignId = campaignId; + experiment.name = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString(); + experiment.queryPercentage = 10; + experiment.startDateTime = DateTime.Now.AddDays(1).ToString("yyyyMMdd HHmmss"); + + // Optional: Set the end date. + experiment.endDateTime = DateTime.Now.AddDays(30).ToString("yyyyMMdd HHmmss"); + + // Optional: Set the status. + experiment.status = ExperimentStatus.ENABLED; + + // Create the operation. + ExperimentOperation experimentOperation = new ExperimentOperation(); + experimentOperation.@operator = Operator.ADD; + experimentOperation.operand = experiment; + + try { + // Add the experiment. + ExperimentReturnValue experimentRetVal = experimentService.mutate( + new ExperimentOperation[] {experimentOperation}); + + // Display the results. + if (experimentRetVal != null && experimentRetVal.value != null && experimentRetVal.value. + Length > 0) { + long experimentId = 0; + + Experiment newExperiment = experimentRetVal.value[0]; + + Console.WriteLine("Experiment with name = \"{0}\" and id = \"{1}\" was added.\n", + newExperiment.name, newExperiment.id); + experimentId = newExperiment.id; + + // Set ad group for the experiment. + AdGroup adGroup = new AdGroup(); + adGroup.id = adGroupId; + + // Create experiment bid multiplier rule that will modify ad group bid + // for the experiment. + ManualCPCAdGroupExperimentBidMultipliers adGroupBidMultiplier = + new ManualCPCAdGroupExperimentBidMultipliers(); + adGroupBidMultiplier.maxCpcMultiplier = new BidMultiplier(); + adGroupBidMultiplier.maxCpcMultiplier.multiplier = 1.5; + + // Set experiment data to the ad group. + AdGroupExperimentData adGroupExperimentData = new AdGroupExperimentData(); + adGroupExperimentData.experimentId = experimentId; + adGroupExperimentData.experimentDeltaStatus = ExperimentDeltaStatus.MODIFIED; + adGroupExperimentData.experimentBidMultipliers = adGroupBidMultiplier; + + adGroup.experimentData = adGroupExperimentData; + + // Create the operation. + AdGroupOperation adGroupOperation = new AdGroupOperation(); + adGroupOperation.operand = adGroup; + adGroupOperation.@operator = Operator.SET; + + // Update the ad group. + AdGroupReturnValue adGroupRetVal = adGroupService.mutate(new AdGroupOperation[] { + adGroupOperation}); + + // Display the results. + if (adGroupRetVal != null && adGroupRetVal.value != null && + adGroupRetVal.value.Length > 0) { + AdGroup updatedAdGroup = adGroupRetVal.value[0]; + Console.WriteLine("Ad group with name = \"{0}\", id = \"{1}\" and status = \"{2}\" " + + "was updated for the experiment.\n", updatedAdGroup.name, updatedAdGroup.id, + updatedAdGroup.status); + } else { + Console.WriteLine("No ad groups were updated."); + } + + // Set ad group criteria for the experiment. + Criterion criterion = new Criterion(); + criterion.id = criterionId; + + BiddableAdGroupCriterion adGroupCriterion = new BiddableAdGroupCriterion(); + adGroupCriterion.adGroupId = adGroupId; + adGroupCriterion.criterion = criterion; + + // Create experiment bid multiplier rule that will modify criterion bid + // for the experiment. + ManualCPCAdGroupCriterionExperimentBidMultiplier bidMultiplier = + new ManualCPCAdGroupCriterionExperimentBidMultiplier(); + bidMultiplier.maxCpcMultiplier = new BidMultiplier(); + bidMultiplier.maxCpcMultiplier.multiplier = 1.5; + + // Set experiment data to the criterion. + BiddableAdGroupCriterionExperimentData adGroupCriterionExperimentData = + new BiddableAdGroupCriterionExperimentData(); + adGroupCriterionExperimentData.experimentId = experimentId; + adGroupCriterionExperimentData.experimentDeltaStatus = ExperimentDeltaStatus.MODIFIED; + adGroupCriterionExperimentData.experimentBidMultiplier = bidMultiplier; + + adGroupCriterion.experimentData = adGroupCriterionExperimentData; + + // Create the operation. + AdGroupCriterionOperation adGroupCriterionOperation = new AdGroupCriterionOperation(); + adGroupCriterionOperation.operand = adGroupCriterion; + adGroupCriterionOperation.@operator = Operator.SET; + + // Update the ad group criteria. + AdGroupCriterionReturnValue adGroupCriterionRetVal = adGroupCriterionService.mutate( + new AdGroupCriterionOperation[] {adGroupCriterionOperation}); + + // Display the results. + if (adGroupCriterionRetVal != null && adGroupCriterionRetVal.value != null && + adGroupCriterionRetVal.value.Length > 0) { + AdGroupCriterion updatedAdGroupCriterion = adGroupCriterionRetVal.value[0]; + Console.WriteLine("Ad group criterion with ad group id = \"{0}\", criterion id = " + + "\"{1}\" and type = \"{2}\" was updated for the experiment.\n", + updatedAdGroupCriterion.adGroupId, updatedAdGroupCriterion.criterion.id, + updatedAdGroupCriterion.criterion.CriterionType); + } else { + Console.WriteLine("No ad group criteria were updated."); + } + } else { + Console.WriteLine("No experiments were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add experiment.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/CampaignManagement/AddKeywordsInBulk.cs b/examples/AdWords/CSharp/v201406/CampaignManagement/AddKeywordsInBulk.cs new file mode 100644 index 00000000000..88980ab03ae --- /dev/null +++ b/examples/AdWords/CSharp/v201406/CampaignManagement/AddKeywordsInBulk.cs @@ -0,0 +1,173 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.RegularExpressions; +using System.Threading; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example shows how to add keywords in bulk using the + /// MutateJobService. + /// + /// Tags: MutateJobService.mutate, MutateJobService.get + /// Tags: MutateJobService.getResult + /// + public class AddKeywordsInBulk : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddKeywordsInBulk codeExample = new AddKeywordsInBulk(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to add keywords in bulk using the MutateJobService."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad groups to which keywords are + /// added. + public void Run(AdWordsUser user, long adGroupId) { + // Get the MutateJobService. + MutateJobService mutateJobService = (MutateJobService) user.GetService( + AdWordsService.v201406.MutateJobService); + + const int RETRY_INTERVAL = 30; + const int RETRIES_COUNT = 30; + const int KEYWORD_NUMBER = 100; + const string INDEX_REGEX = "operations\\[(\\d+)\\].operand"; + + List operations = new List(); + + // Create AdGroupCriterionOperation to add keywords. + for (int i = 0; i < KEYWORD_NUMBER; i++) { + Keyword keyword = new Keyword(); + keyword.text = string.Format("mars cruise {0}", i); + keyword.matchType = KeywordMatchType.BROAD; + + BiddableAdGroupCriterion criterion = new BiddableAdGroupCriterion(); + criterion.adGroupId = adGroupId; + criterion.criterion = keyword; + + AdGroupCriterionOperation adGroupCriterionOperation = new AdGroupCriterionOperation(); + adGroupCriterionOperation.@operator = Operator.ADD; + adGroupCriterionOperation.operand = criterion; + + operations.Add(adGroupCriterionOperation); + } + + BulkMutateJobPolicy policy = new BulkMutateJobPolicy(); + // You can specify up to 3 job IDs that must successfully complete before + // this job can be processed. + policy.prerequisiteJobIds = new long[] {}; + + SimpleMutateJob job = mutateJobService.mutate(operations.ToArray(), policy); + + // Wait for the job to complete. + bool completed = false; + int retryCount = 0; + Console.WriteLine("Retrieving job status..."); + + while (completed == false && retryCount < RETRIES_COUNT) { + BulkMutateJobSelector selector = new BulkMutateJobSelector(); + selector.jobIds = new long[] {job.id}; + + try { + Job[] allJobs = mutateJobService.get(selector); + if (allJobs != null && allJobs.Length > 0) { + job = (SimpleMutateJob) allJobs[0]; + if (job.status == BasicJobStatus.COMPLETED || job.status == BasicJobStatus.FAILED) { + completed = true; + break; + } else { + Console.WriteLine("{0}: Current status is {1}, waiting {2} seconds to retry...", + retryCount, job.status, RETRY_INTERVAL); + Thread.Sleep(RETRY_INTERVAL * 1000); + retryCount++; + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to fetch simple mutate job with " + + "id = {0}.", ex); + } + } + + if (job.status == BasicJobStatus.COMPLETED) { + // Handle cases where the job completed. + + // Create the job selector. + BulkMutateJobSelector selector = new BulkMutateJobSelector(); + selector.jobIds = new long[] {job.id}; + + // Get the job results. + JobResult jobResult = mutateJobService.getResult(selector); + if (jobResult != null) { + SimpleMutateResult results = (SimpleMutateResult) jobResult.Item; + if (results != null) { + // Display the results. + if (results.results != null) { + for (int i = 0; i < results.results.Length; i++) { + Operand operand = results.results[i]; + Console.WriteLine("Operation {0} - {1}", i, (operand.Item is PlaceHolder) ? + "FAILED" : "SUCCEEDED"); + } + } + + // Display the errors. + if (results.errors != null) { + foreach (ApiError apiError in results.errors) { + Match match = Regex.Match(apiError.fieldPath, INDEX_REGEX, RegexOptions.IgnoreCase); + string index = (match.Success)? match.Groups[1].Value : "???"; + Console.WriteLine("Operation index {0} failed due to reason: '{1}', " + + "trigger: '{2}'", index, apiError.errorString, apiError.trigger); + } + } + } + } + Console.WriteLine("Job completed successfully!"); + } else if (job.status == BasicJobStatus.FAILED) { + // Handle the cases where job failed. + Console.WriteLine("Job failed with reason: " + job.failureReason); + } else if (job.status == BasicJobStatus.PROCESSING || job.status == BasicJobStatus.PENDING) { + // Handle the cases where job didn't complete after wait period. + Console.WriteLine("Job did not complete in {0} secconds.", RETRY_INTERVAL * RETRIES_COUNT); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/CampaignManagement/AddLocationExtension.cs b/examples/AdWords/CSharp/v201406/CampaignManagement/AddLocationExtension.cs new file mode 100644 index 00000000000..5510d5cca9d --- /dev/null +++ b/examples/AdWords/CSharp/v201406/CampaignManagement/AddLocationExtension.cs @@ -0,0 +1,148 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example shows how to add a location extension to an existing + /// campaign. To create a campaign, run AddCampaign.cs. + /// + /// Tags: GeoLocationService.get, CampaignAdExtensionService.mutate + /// + public class AddLocationExtension : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddLocationExtension codeExample = new AddLocationExtension(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to add a location extension to an existing " + + "campaign. To create a campaign, run AddCampaign.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to which location + /// extensions are added. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignAdExtensionService. + CampaignAdExtensionService campaignExtensionService = + (CampaignAdExtensionService) user.GetService(AdWordsService.v201406. + CampaignAdExtensionService); + + // Add location 1: 1600 Amphitheatre Pkwy, Mountain View, US. + Address address1 = new Address(); + address1.streetAddress = "1600 Amphitheatre Parkway"; + address1.cityName = "Mountain View"; + address1.provinceCode = "CA"; + address1.postalCode = "94043"; + address1.countryCode = "US"; + + // Add location 2: 38 avenue de l'Opéra, 75002 Paris, FR. + Address address2 = new Address(); + address2.streetAddress = "38 avenue de l'Opéra"; + address2.cityName = "Paris"; + address2.postalCode = "75002"; + address2.countryCode = "FR"; + + // Get the GeoLocationService. + GeoLocationService geoService = + (GeoLocationService) user.GetService(AdWordsService.v201406.GeoLocationService); + + // Create the selector. + GeoLocationSelector selector = new GeoLocationSelector(); + selector.addresses = new Address[] {address1, address2}; + + // Retrieve the locations. + GeoLocation[] locations = geoService.get(selector); + + List operations = new List(); + + // Phone numbers for US and FR offices. + string[] phoneNumbers = new string[] {"(650) 253-0000", "(0)1 42 68 53 00"}; + int index = 0; + + // Create a location extension for each geo location returned by the + // server. + foreach (GeoLocation location in locations) { + LocationExtension locationExtension = new LocationExtension(); + locationExtension.address = location.address; + locationExtension.geoPoint = location.geoPoint; + locationExtension.encodedLocation = location.encodedLocation; + locationExtension.source = LocationExtensionSource.ADWORDS_FRONTEND; + + // Optional: Set the company name. + locationExtension.companyName = "ACME Inc."; + + // Optional: Set the phone number. + locationExtension.phoneNumber = phoneNumbers[index]; + index++; + + CampaignAdExtension extension = new CampaignAdExtension(); + extension.campaignId = campaignId; + extension.status = CampaignAdExtensionStatus.ENABLED; + extension.adExtension = locationExtension; + + CampaignAdExtensionOperation operation = new CampaignAdExtensionOperation(); + operation.@operator = Operator.ADD; + operation.operand = extension; + + operations.Add(operation); + } + + try { + CampaignAdExtensionReturnValue retVal = + campaignExtensionService.mutate(operations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + foreach (CampaignAdExtension campaignExtension in retVal.value) { + Console.WriteLine("Created a location extension with id = \"{0}\" and " + + "status = \"{1}\"", campaignExtension.adExtension.id, campaignExtension.status); + } + } else { + Console.WriteLine("No location extensions were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add location extension.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/CampaignManagement/GetAllDisapprovedAds.cs b/examples/AdWords/CSharp/v201406/CampaignManagement/GetAllDisapprovedAds.cs new file mode 100644 index 00000000000..55593b706d0 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/CampaignManagement/GetAllDisapprovedAds.cs @@ -0,0 +1,121 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example retrieves all the disapproved ads in a given campaign. + /// + /// Tags: AdGroupAdService.get + /// + public class GetAllDisapprovedAds : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAllDisapprovedAds codeExample = new GetAllDisapprovedAds(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves all the disapproved ads in a given campaign."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign for which disapproved ads + /// are retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201406.AdGroupAdService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "AdGroupCreativeApprovalStatus", + "AdGroupAdDisapprovalReasons"}; + + // Create the filter. + Predicate campaignPredicate = new Predicate(); + campaignPredicate.@operator = PredicateOperator.EQUALS; + campaignPredicate.field = "CampaignId"; + campaignPredicate.values = new string[] {campaignId.ToString()}; + + Predicate approvalPredicate = new Predicate(); + approvalPredicate.@operator = PredicateOperator.EQUALS; + approvalPredicate.field = "AdGroupCreativeApprovalStatus"; + approvalPredicate.values = new string[] {AdGroupAdApprovalStatus.DISAPPROVED.ToString()}; + + selector.predicates = new Predicate[] {campaignPredicate, approvalPredicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupAdPage page = new AdGroupAdPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the disapproved ads. + page = service.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroupAd adGroupAd in page.entries) { + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " + + "reason(s):", i, adGroupAd.ad.id); + foreach (string reason in adGroupAd.disapprovalReasons) { + Console.WriteLine(" {0}", reason); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get disapproved ads.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs b/examples/AdWords/CSharp/v201406/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs new file mode 100644 index 00000000000..13484202918 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs @@ -0,0 +1,108 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example retrieves all the disapproved ads in a given campaign + /// using AWQL. See https://developers.google.com/adwords/api/docs/guides/awql + /// for AWQL documentation. + /// + /// Tags: AdGroupAdService.get + /// + public class GetAllDisapprovedAdsWithAwql : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAllDisapprovedAdsWithAwql codeExample = new GetAllDisapprovedAdsWithAwql(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves all the disapproved ads in a given campaign using " + + "AWQL. See https://developers.google.com/adwords/api/docs/guides/awql for AWQL " + + "documentation."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign for which disapproved ads + /// are retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201406.AdGroupAdService); + + // Get all the disapproved ads for this campaign. + string query = string.Format("SELECT Id, AdGroupAdDisapprovalReasons WHERE " + + "CampaignId = {0} AND AdGroupCreativeApprovalStatus = DISAPPROVED ORDER BY Id", + campaignId); + + int offset = 0; + int pageSize = 500; + + AdGroupAdPage page = new AdGroupAdPage(); + + try { + do { + string queryWithPaging = string.Format("{0} LIMIT {1}, {2}", query, offset, pageSize); + + // Get the disapproved ads. + page = service.query(queryWithPaging); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroupAd adGroupAd in page.entries) { + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " + + "reason(s):", i, adGroupAd.ad.id); + foreach (string reason in adGroupAd.disapprovalReasons) { + Console.WriteLine(" {0}", reason); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get disapproved ads.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/CampaignManagement/GetCampaignsByLabel.cs b/examples/AdWords/CSharp/v201406/CampaignManagement/GetCampaignsByLabel.cs new file mode 100644 index 00000000000..493b652cf7e --- /dev/null +++ b/examples/AdWords/CSharp/v201406/CampaignManagement/GetCampaignsByLabel.cs @@ -0,0 +1,121 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example gets all campaigns with a specific label. To add a + /// label to campaigns, run AddCampaignLabels.cs. + /// + /// Tags: CampaignService.get + /// + public class GetCampaignsByLabel : ExampleBase { + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetCampaignsByLabel codeExample = new GetCampaignsByLabel(); + Console.WriteLine(codeExample.Description); + try { + long labelId = long.Parse("INSERT_LABEL_ID_HERE"); + codeExample.Run(new AdWordsUser(), labelId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all campaigns with a specific label. To add a label " + + "to campaigns, run AddCampaignLabels.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// ID of the label. + public void Run(AdWordsUser user, long labelId) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201406.CampaignService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] { "Id", "Name", "Labels" }; + + // Labels filtering is performed by ID. You can use CONTAINS_ANY to + // select campaigns with any of the label IDs, CONTAINS_ALL to select + // campaigns with all of the label IDs, or CONTAINS_NONE to select + // campaigns with none of the label IDs. + Predicate predicate = new Predicate(); + predicate.@operator = PredicateOperator.CONTAINS_ANY; + predicate.field = "Labels"; + predicate.values = new string[] { labelId.ToString() }; + selector.predicates = new Predicate[] { predicate }; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + CampaignPage page = new CampaignPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the campaigns. + page = campaignService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (Campaign campaign in page.entries) { + List labelNames = new List(); + foreach (Label label in campaign.labels) { + labelNames.Add(label.name); + } + + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and labels = '{3}'" + + " was found.", i + 1, campaign.id, campaign.name, + string.Join(", ", labelNames.ToArray())); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve campaigns by label", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/CampaignManagement/PromoteExperiment.cs b/examples/AdWords/CSharp/v201406/CampaignManagement/PromoteExperiment.cs new file mode 100644 index 00000000000..03a7e933028 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/CampaignManagement/PromoteExperiment.cs @@ -0,0 +1,98 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This example promotes an experiment, which permanently applies all the + /// experiment changes made to its related ad groups, criteria and ads. To + /// create an experiment, run AddExperiment.vb. + /// + /// Tags: ExperimentService.mutate + /// + public class PromoteExperiment : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + PromoteExperiment codeExample = new PromoteExperiment(); + Console.WriteLine(codeExample.Description); + try { + long experimentId = long.Parse("INSERT_EXPERIMENT_ID_HERE"); + codeExample.Run(new AdWordsUser(), experimentId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example promotes an experiment, which permanently applies all the experiment" + + " changes made to its related ad groups, criteria and ads. To create an experiment, " + + "run AddExperiment.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the experiment to be promoted. + public void Run(AdWordsUser user, long experimentId) { + // Get the ExperimentService. + ExperimentService experimentService = + (ExperimentService) user.GetService(AdWordsService.v201406.ExperimentService); + + // Set experiment's status to PROMOTED. + Experiment experiment = new Experiment(); + experiment.id = experimentId; + experiment.status = ExperimentStatus.PROMOTED; + + // Create the operation. + ExperimentOperation operation = new ExperimentOperation(); + operation.@operator = Operator.SET; + operation.operand = experiment; + + try { + // Update the experiment. + ExperimentReturnValue retVal = experimentService.mutate( + new ExperimentOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + Experiment promotedExperiment = retVal.value[0]; + Console.WriteLine("Experiment with name = \"{0}\" and id = \"{1}\" was promoted.\n", + promotedExperiment.name, promotedExperiment.id); + } else { + Console.WriteLine("No experiments were promoted."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to promote experiment.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/CampaignManagement/SetAdParameters.cs b/examples/AdWords/CSharp/v201406/CampaignManagement/SetAdParameters.cs new file mode 100644 index 00000000000..d76eeb3795c --- /dev/null +++ b/examples/AdWords/CSharp/v201406/CampaignManagement/SetAdParameters.cs @@ -0,0 +1,152 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example illustrates how to create a text ad with ad parameters. + /// To add an ad group, run AddAdGroup.cs. To add a keyword, run + /// run AddKeyword.cs. + /// + /// Tags: AdGroupAdService.mutate, AdParamService.mutate + /// + public class SetAdParameters : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SetAdParameters codeExample = new SetAdParameters(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long criterionId = long.Parse("INSERT_CRITERION_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, criterionId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create a text ad with ad parameters." + + " To add an ad group, run AddAdGroup.cs. To add a keyword, run AddKeyword.vb."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the criterion. + /// + /// Id of the keyword for which the ad + /// parameters are set. + public void Run(AdWordsUser user, long adGroupId, long criterionId) { + // Get the AdGroupAdService. + AdGroupAdService adGroupAdService = (AdGroupAdService) user.GetService( + AdWordsService.v201406.AdGroupAdService); + + // Get the AdParamService. + AdParamService adParamService = (AdParamService) user.GetService( + AdWordsService.v201406.AdParamService); + + // Create the text ad. + TextAd textAd = new TextAd(); + textAd.url = "http://www.example.com"; + textAd.displayUrl = "example.com"; + textAd.headline = " Mars Cruises"; + textAd.description1 = "Low-gravity fun for {param1:cheap}."; + textAd.description2 = "Only {param2:a few} seats left!"; + + AdGroupAd adOperand = new AdGroupAd(); + adOperand.adGroupId = adGroupId; + adOperand.status = AdGroupAdStatus.ENABLED; + adOperand.ad = textAd; + + // Create the operation. + AdGroupAdOperation adOperation = new AdGroupAdOperation(); + adOperation.operand = adOperand; + adOperation.@operator = Operator.ADD; + + try { + // Create the text ad. + AdGroupAdReturnValue retVal = adGroupAdService.mutate( + new AdGroupAdOperation[] {adOperation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + Console.WriteLine("Text ad with id ='{0}' was successfully added.", + retVal.value[0].ad.id); + } else { + Console.WriteLine("No text ads were created."); + return; + } + } catch (Exception ex) { + Console.WriteLine("Failed to create text ads. Exception says \"{0}\"", ex.Message); + return; + } + + // Create the ad param for price. + AdParam priceParam = new AdParam(); + priceParam.adGroupId = adGroupId; + priceParam.criterionId = criterionId; + priceParam.paramIndex = 1; + priceParam.insertionText = "$100"; + + // Create the ad param for seats. + AdParam seatParam = new AdParam(); + seatParam.adGroupId = adGroupId; + seatParam.criterionId = criterionId; + seatParam.paramIndex = 2; + seatParam.insertionText = "50"; + + // Create the operations. + AdParamOperation priceOperation = new AdParamOperation(); + priceOperation.@operator = Operator.SET; + priceOperation.operand = priceParam; + + AdParamOperation seatOperation = new AdParamOperation(); + seatOperation.@operator = Operator.SET; + seatOperation.operand = seatParam; + + try { + // Set the ad parameters. + AdParam [] newAdParams = adParamService.mutate(new AdParamOperation[] + {priceOperation, seatOperation}); + + // Display the results. + if (newAdParams != null) { + Console.WriteLine("Ad parameters were successfully updated."); + } else { + Console.WriteLine("No ad parameters were set."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to set ad parameters.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/CampaignManagement/SetBidModifier.cs b/examples/AdWords/CSharp/v201406/CampaignManagement/SetBidModifier.cs new file mode 100644 index 00000000000..9c48d4d5fa9 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/CampaignManagement/SetBidModifier.cs @@ -0,0 +1,111 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example sets a bid modifier for the mobile platform on given + /// campaign. The campaign must be an enhanced type of campaign. To get + /// campaigns, run GetCampaigns.cs. To enhance a campaign, run + /// SetCampaignEnhanced.cs. + /// + /// Tags: CampaignCriterionService.mutate + /// + public class SetBidModifier : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SetBidModifier codeExample = new SetBidModifier(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + double bidModifier = double.Parse("INSERT_BID_MODIFIER_HERE"); + codeExample.Run(new AdWordsUser(), campaignId, bidModifier); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example sets a bid modifier for the mobile platform on given " + + "campaign. The campaign must be an enhanced type of campaign. To get campaigns, " + + "run GetCampaigns.cs. To enhance a campaign, run SetCampaignEnhanced.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign whose bid should be modified. + /// + /// The bid modifier. + public void Run(AdWordsUser user, long campaignId, double bidModifier) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201406.CampaignCriterionService); + + // Create mobile platform. The ID can be found in the documentation. + // https://developers.google.com/adwords/api/docs/appendix/platforms + Platform mobile = new Platform(); + mobile.id = 30001; + + // Create criterion with modified bid. + CampaignCriterion criterion = new CampaignCriterion(); + criterion.campaignId = campaignId; + criterion.criterion = mobile; + criterion.bidModifier = bidModifier; + + // Create SET operation. + CampaignCriterionOperation operation = new CampaignCriterionOperation(); + operation.@operator = Operator.SET; + operation.operand = criterion; + + try { + // Update campaign criteria. + CampaignCriterionReturnValue result = campaignCriterionService.mutate( + new CampaignCriterionOperation[] {operation}); + + // Display campaign criteria. + if (result.value != null) { + foreach (CampaignCriterion newCriterion in result.value) { + Console.WriteLine("Campaign criterion with campaign id '{0}', criterion id '{1}', " + + "and type '{2}' was modified with bid {3:F2}.", newCriterion.campaignId, + newCriterion.criterion.id, newCriterion.criterion.type, newCriterion.bidModifier); + } + } else { + Console.WriteLine("No campaign criteria were modified."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to set bid modifier for campaign.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/CampaignManagement/ValidateTextAd.cs b/examples/AdWords/CSharp/v201406/CampaignManagement/ValidateTextAd.cs new file mode 100644 index 00000000000..e0d1c3db52f --- /dev/null +++ b/examples/AdWords/CSharp/v201406/CampaignManagement/ValidateTextAd.cs @@ -0,0 +1,109 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example shows how to use the validateOnly header to validate + /// a text ad. No objects will be created, but exceptions will still be + /// thrown. + /// + /// Tags: AdGroupAdService.mutate + /// + public class ValidateTextAd : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + ValidateTextAd codeExample = new ValidateTextAd(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to use the validateOnly header to validate a " + + "text ad. No objects will be created, but exceptions will still be thrown."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which text ads are + /// added. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService adGroupAdService = + (AdGroupAdService) user.GetService(AdWordsService.v201406.AdGroupAdService); + + // Set the validateOnly headers. + adGroupAdService.RequestHeader.validateOnly = true; + + // Create your text ad. + TextAd textAd = new TextAd(); + textAd.headline = "Luxury Cruise to Mars"; + textAd.description1 = "Visit the Red Planet in style."; + textAd.description2 = "Low-gravity fun for everyone!!"; + textAd.displayUrl = "www.example.com"; + textAd.url = "http://www.example.com"; + + AdGroupAd textAdGroupAd = new AdGroupAd(); + textAdGroupAd.adGroupId = adGroupId; + textAdGroupAd.ad = textAd; + + AdGroupAdOperation textAdOperation = new AdGroupAdOperation(); + textAdOperation.@operator = Operator.ADD; + textAdOperation.operand = textAdGroupAd; + + try { + AdGroupAdReturnValue retVal = adGroupAdService.mutate( + (new AdGroupAdOperation[] {textAdOperation})); + // Since validation is ON, result will be null. + Console.WriteLine("text ad validated successfully."); + } catch (AdWordsApiException ex) { + // This block will be hit if there is a validation error from the server. + Console.WriteLine("There were validation error(s) while adding text ad."); + + if (ex.ApiException != null) { + foreach (ApiError error in ((ApiException) ex.ApiException).errors) { + Console.WriteLine(" Error type is '{0}' and fieldPath is '{1}'.", + error.ApiErrorType, error.fieldPath); + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to validate text ad.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/ErrorHandling/HandlePartialFailures.cs b/examples/AdWords/CSharp/v201406/ErrorHandling/HandlePartialFailures.cs new file mode 100644 index 00000000000..aa012ca3aea --- /dev/null +++ b/examples/AdWords/CSharp/v201406/ErrorHandling/HandlePartialFailures.cs @@ -0,0 +1,136 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example demonstrates how to handle partial failures. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class HandlePartialFailures : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + HandlePartialFailures codeExample = new HandlePartialFailures(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example demonstrates how to handle partial failures."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which keywords are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201406.AdGroupCriterionService); + + // Set partial failure mode for the service. + adGroupCriterionService.RequestHeader.partialFailure = true; + + List operations = new List(); + + // Create the keywords. + string[] keywords = new String[] {"mars cruise", "inv@lid cruise", "venus cruise", + "b(a)d keyword cruise"}; + + foreach (String keywordText in keywords) { + Keyword keyword = new Keyword(); + keyword.text = keywordText; + keyword.matchType = KeywordMatchType.BROAD; + + // Create biddable ad group criterion. + BiddableAdGroupCriterion keywordBiddableAdGroupCriterion = new BiddableAdGroupCriterion(); + keywordBiddableAdGroupCriterion.adGroupId = adGroupId; + keywordBiddableAdGroupCriterion.criterion = keyword; + + // Create the operation. + AdGroupCriterionOperation keywordAdGroupCriterionOperation = + new AdGroupCriterionOperation(); + keywordAdGroupCriterionOperation.operand = keywordBiddableAdGroupCriterion; + keywordAdGroupCriterionOperation.@operator = Operator.ADD; + operations.Add(keywordAdGroupCriterionOperation); + } + + try { + // Create the keywords. + AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations.ToArray()); + + // Display the results. + if (result != null && result.value != null) { + foreach (AdGroupCriterion adGroupCriterionResult in result.value) { + if (adGroupCriterionResult.criterion != null) { + Console.WriteLine("Keyword with ad group id '{0}', criterion id '{1}', and " + + "text '{2}' was added.\n", adGroupCriterionResult.adGroupId, + adGroupCriterionResult.criterion.id, + ((Keyword) adGroupCriterionResult.criterion).text); + } + } + } else { + Console.WriteLine("No keywords were added."); + } + + // Display the partial failure errors. + if (result != null && result.partialFailureErrors != null) { + foreach (ApiError apiError in result.partialFailureErrors) { + int operationIndex = ErrorUtilities.GetOperationIndex(apiError.fieldPath); + if (operationIndex != -1) { + AdGroupCriterion adGroupCriterion = operations[operationIndex].operand; + Console.WriteLine("Keyword with ad group id '{0}' and text '{1}' " + + "triggered a failure for the following reason: '{2}'.\n", + adGroupCriterion.adGroupId, ((Keyword) adGroupCriterion.criterion).text, + apiError.errorString); + } else { + Console.WriteLine("A failure for the following reason: '{0}' has occurred.\n", + apiError.errorString); + } + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add keywords in partial failure mode.", + ex); + } + } + } +} + diff --git a/examples/AdWords/CSharp/v201406/ErrorHandling/HandlePolicyViolationError.cs b/examples/AdWords/CSharp/v201406/ErrorHandling/HandlePolicyViolationError.cs new file mode 100644 index 00000000000..bcd6a374081 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/ErrorHandling/HandlePolicyViolationError.cs @@ -0,0 +1,173 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example adds a text ad, and shows how to handle a policy + /// violation. + /// + /// Tags: AdGroupAdService.mutate + /// + public class HandlePolicyViolationError : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + HandlePolicyViolationError codeExample = new HandlePolicyViolationError(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a text ad, and shows how to handle a policy violation."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which ads are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201406.AdGroupAdService); + + // Create the text ad. + TextAd textAd = new TextAd(); + textAd.headline = "Luxury Cruise to Mars"; + textAd.description1 = "Visit the Red Planet in style."; + textAd.description2 = "Low-gravity fun for everyone!!"; + textAd.displayUrl = "www.example.com"; + textAd.url = "http://www.example.com"; + + AdGroupAd textadGroupAd = new AdGroupAd(); + textadGroupAd.adGroupId = adGroupId; + textadGroupAd.ad = textAd; + + // Create the operations. + AdGroupAdOperation textAdOperation = new AdGroupAdOperation(); + textAdOperation.@operator = Operator.ADD; + textAdOperation.operand = textadGroupAd; + + try { + AdGroupAdReturnValue retVal = null; + + // Setup two arrays, one to hold the list of all operations to be + // validated, and another to hold the list of operations that cannot be + // fixed after validation. + List allOperations = new List(); + List operationsToBeRemoved = new List(); + + allOperations.Add(textAdOperation); + + try { + // Validate the operations. + service.RequestHeader.validateOnly = true; + retVal = service.mutate(allOperations.ToArray()); + } catch (AdWordsApiException ex) { + ApiException innerException = ex.ApiException as ApiException; + if (innerException == null) { + throw new Exception("Failed to retrieve ApiError. See inner exception for more " + + "details.", ex); + } + + // Examine each ApiError received from the server. + foreach (ApiError apiError in innerException.errors) { + int index = ErrorUtilities.GetOperationIndex(apiError.fieldPath); + if (index == -1) { + // This API error is not associated with an operand, so we cannot + // recover from this error by removing one or more operations. + // Rethrow the exception for manual inspection. + throw; + } + + // Handle policy violation errors. + if (apiError is PolicyViolationError) { + PolicyViolationError policyError = (PolicyViolationError) apiError; + + if (policyError.isExemptable) { + // If the policy violation error is exemptable, add an exemption + // request. + List exemptionRequests = new List(); + if (allOperations[index].exemptionRequests != null) { + exemptionRequests.AddRange(allOperations[index].exemptionRequests); + } + + ExemptionRequest exemptionRequest = new ExemptionRequest(); + exemptionRequest.key = policyError.key; + exemptionRequests.Add(exemptionRequest); + allOperations[index].exemptionRequests = exemptionRequests.ToArray(); + } else { + // Policy violation error is not exemptable, remove this + // operation from the list of operations. + operationsToBeRemoved.Add(allOperations[index]); + } + } else { + // This is not a policy violation error, remove this operation + // from the list of operations. + operationsToBeRemoved.Add(allOperations[index]); + } + } + // Remove all operations that aren't exemptable. + foreach (AdGroupAdOperation operation in operationsToBeRemoved) { + allOperations.Remove(operation); + } + } + + if (allOperations.Count > 0) { + // Perform the operations exemptible of a policy violation. + service.RequestHeader.validateOnly = false; + retVal = service.mutate(allOperations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + foreach (AdGroupAd newAdGroupAd in retVal.value) { + Console.WriteLine("New ad with id = \"{0}\" and displayUrl = \"{1}\" was created.", + newAdGroupAd.ad.id, newAdGroupAd.ad.displayUrl); + } + } else { + Console.WriteLine("No ads were created."); + } + } else { + Console.WriteLine("There are no ads to create after policy violation checks."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create ads.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/ErrorHandling/HandleRateExceededError.cs b/examples/AdWords/CSharp/v201406/ErrorHandling/HandleRateExceededError.cs new file mode 100644 index 00000000000..5926f48b284 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/ErrorHandling/HandleRateExceededError.cs @@ -0,0 +1,204 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example shows how to handle RateExceededError in your + /// application. To trigger the rate exceeded error, this code example runs + /// 100 threads in parallel, each thread attempting to validate 100 keywords + /// in a single request. Note that spawning 100 parallel threads is for + /// illustrative purposes only, you shouldn't do this in your application. + /// + /// Tags: AdGroupAdService.mutate + /// + public class HandleRateExceededError: ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + HandleRateExceededError codeExample = new HandleRateExceededError(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to handle RateExceededError in your application. " + + "To trigger the rate exceeded error, this code example runs 100 threads in " + + "parallel, each thread attempting to validate 100 keywords in a single request. " + + "Note that spawning 100 parallel threads is for illustrative purposes only, you " + + "shouldn't do this in your application."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which keywords are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + const int NUM_THREADS = 100; + + // Increase the maximum number of parallel HTTP connections that .NET + // framework allows. By default, this is set to 2 by the .NET framework. + System.Net.ServicePointManager.DefaultConnectionLimit = NUM_THREADS; + + List threads = new List(); + + for (int i = 0; i < NUM_THREADS; i++) { + Thread thread = new Thread(new KeywordThread(user, i, adGroupId).Run); + threads.Add(thread); + } + + for (int i = 0; i < NUM_THREADS; i++) { + threads[i].Start(i); + } + + for (int i = 0; i < NUM_THREADS; i++) { + threads[i].Join(); + } + } + + /// + /// Thread class for validating keywords. + /// + class KeywordThread { + /// + /// Index of this thread, for identifying and debugging. + /// + int threadIndex; + + /// + /// The ad group id to which keywords are added. + /// + long adGroupId; + + /// + /// The AdWords user who owns this ad group. + /// + AdWordsUser user; + + /// + /// Number of keywords to be validated in each API call. + /// + const int NUM_KEYWORDS = 100; + + /// + /// Initializes a new instance of the class. + /// + /// Index of the thread. + /// The ad group id. + /// The AdWords user who owns the ad group. + public KeywordThread(AdWordsUser user, int threadIndex, long adGroupId) { + this.user = user; + this.threadIndex = threadIndex; + this.adGroupId = adGroupId; + } + + /// + /// Main method for the thread. + /// + /// The thread parameter. + public void Run(Object obj) { + // Create the operations. + List operations = new List(); + + for (int j = 0; j < NUM_KEYWORDS; j++) { + // Create the keyword. + Keyword keyword = new Keyword(); + keyword.text = "mars cruise thread " + threadIndex.ToString() + " seed " + j.ToString(); + keyword.matchType = KeywordMatchType.BROAD; + + // Create the biddable ad group criterion. + AdGroupCriterion keywordCriterion = new BiddableAdGroupCriterion(); + keywordCriterion.adGroupId = adGroupId; + keywordCriterion.criterion = keyword; + + // Create the operations. + AdGroupCriterionOperation keywordOperation = new AdGroupCriterionOperation(); + keywordOperation.@operator = Operator.ADD; + keywordOperation.operand = keywordCriterion; + + operations.Add(keywordOperation); + } + + // Get the AdGroupCriterionService. This should be done within the + // thread, since a service can only handle one outgoing HTTP request + // at a time. + AdGroupCriterionService service = (AdGroupCriterionService) user.GetService( + AdWordsService.v201406.AdGroupCriterionService); + service.RequestHeader.validateOnly = true; + int retryCount = 0; + const int NUM_RETRIES = 3; + try { + while (retryCount < NUM_RETRIES) { + try { + // Validate the keywords. + AdGroupCriterionReturnValue retval = service.mutate(operations.ToArray()); + break; + } catch (AdWordsApiException ex) { + // Handle API errors. + ApiException innerException = ex.ApiException as ApiException; + if (innerException == null) { + throw new Exception("Failed to retrieve ApiError. See inner exception for more " + + "details.", ex); + } + foreach (ApiError apiError in innerException.errors) { + if (!(apiError is RateExceededError)) { + // Rethrow any errors other than RateExceededError. + throw; + } + // Handle rate exceeded errors. + RateExceededError rateExceededError = (RateExceededError) apiError; + Console.WriteLine("Got Rate exceeded error - rate name = '{0}', scope = '{1}', " + + "retry After {2} seconds.", rateExceededError.rateScope, + rateExceededError.rateName, rateExceededError.retryAfterSeconds); + Thread.Sleep(rateExceededError.retryAfterSeconds * 1000); + retryCount = retryCount + 1; + } + } finally { + if (retryCount == NUM_RETRIES) { + throw new Exception(String.Format("Could not recover after making {0} attempts.", + retryCount)); + } + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to validate keywords.", ex); + } + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/Express/AddExpressBusinesses.cs b/examples/AdWords/CSharp/v201406/Express/AddExpressBusinesses.cs new file mode 100644 index 00000000000..f984b6854c2 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Express/AddExpressBusinesses.cs @@ -0,0 +1,114 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example adds express businesses. To get express businesses, run + /// GetExpressBusinesses.cs. + /// + /// Tags: ExpressBusinessService.mutate + /// + public class AddExpressBusinesses : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds express businesses. To get express businesses, run " + + "GetExpressBusinesses.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddExpressBusinesses codeExample = new AddExpressBusinesses(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ExpressBusinessService. + ExpressBusinessService businessService = (ExpressBusinessService) + user.GetService(AdWordsService.v201406.ExpressBusinessService); + + ExpressBusiness business1 = new ExpressBusiness(); + business1.status = ExpressBusinessStatus.ENABLED; + business1.name = "Express Interplanetary Cruise #" + ExampleUtilities.GetShortRandomString(); + + Address address1 = new Address(); + address1.streetAddress = "1600 Amphitheatre Pkwy"; + address1.cityName = "Mountain View"; + address1.provinceCode = "CA"; + address1.countryCode = "US"; + + business1.address = address1; + business1.website = "http://www.example.com/cruise1"; + + ExpressBusinessOperation operation1 = new ExpressBusinessOperation(); + operation1.@operator = Operator.ADD; + operation1.operand = business1; + + ExpressBusiness business2 = new ExpressBusiness(); + business2.status = (ExpressBusinessStatus.ENABLED); + business2.name = "Express Interplanetary Cruise #" + ExampleUtilities.GetShortRandomString(); + + Address address2 = new Address(); + address2.streetAddress = "111 8th Ave"; + address2.cityName = "New York"; + address2.provinceCode = "NY"; + address2.countryCode = "US"; + + business2.address = address2; + business2.website = "http://www.example.com/cruise2"; + + ExpressBusinessOperation operation2 = new ExpressBusinessOperation(); + operation2.@operator = Operator.ADD; + operation2.operand = business2; + + try { + ExpressBusiness[] addedBusinesses = businessService.mutate( + new ExpressBusinessOperation[] {operation1, operation2}); + + Console.WriteLine("Added {0} express businesses", addedBusinesses.Length); + foreach (ExpressBusiness addedBusiness in addedBusinesses) { + Console.WriteLine("Added express business with ID = {0} and name '{1}'.", + addedBusiness.id, addedBusiness.name); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add express business.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/Express/AddPromotion.cs b/examples/AdWords/CSharp/v201406/Express/AddPromotion.cs new file mode 100644 index 00000000000..8ea1b558454 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Express/AddPromotion.cs @@ -0,0 +1,154 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example adds a new promotion to an express business. To get + /// promotions, run GetPromotions.cs. + /// + /// Tags: ExpressBusinessService.get, PromotionService.mutate + /// + public class AddPromotion : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a new promotion to an express business. To get " + + "promotions, run GetPromotions.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddPromotion codeExample = new AddPromotion(); + Console.WriteLine(codeExample.Description); + try { + long businessId = long.Parse("INSERT_ADWORDS_EXPRESS_BUSINESS_ID_HERE"); + codeExample.Run(new AdWordsUser(), businessId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The AdWords Express business id. + public void Run(AdWordsUser user, long businessId) { + // Get the ExpressBusinessService. + ExpressBusinessService businessService = (ExpressBusinessService) + user.GetService(AdWordsService.v201406.ExpressBusinessService); + + // Get the PromotionService + PromotionService promotionService = (PromotionService) + user.GetService(AdWordsService.v201406.PromotionService); + + // Get the business for the businessId. We will need its geo point to + // create a Proximity criterion for the new Promotion. + Selector businessSelector = new Selector(); + + Predicate predicate = new Predicate(); + predicate.field = "Id"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] { businessId.ToString() }; + businessSelector.predicates = new Predicate[] { predicate }; + + businessSelector.fields = new string[] { "Id", "GeoPoint" }; + + ExpressBusinessPage businessPage = businessService.get(businessSelector); + + if (businessPage == null || businessPage.entries == null || + businessPage.entries.Length == 0) { + Console.WriteLine("No business was found."); + return; + } + + // Set the business ID to the service. + promotionService.RequestHeader.expressBusinessId = businessId; + + // First promotion + Promotion marsTourPromotion = new Promotion(); + Money budget = new Money(); + budget.microAmount = 1000000L; + marsTourPromotion.name = "Mars Tour Promotion " + ExampleUtilities.GetShortRandomString(); + marsTourPromotion.status = PromotionStatus.PAUSED; + marsTourPromotion.destinationUrl = "http://www.example.com"; + marsTourPromotion.budget = budget; + marsTourPromotion.callTrackingEnabled = true; + + // Criteria + + // Criterion - Travel Agency product service + ProductService productService = new ProductService(); + productService.text = "Travel Agency"; + + // Criterion - English language + // The ID can be found in the documentation: + // https://developers.google.com/adwords/api/docs/appendix/languagecodes + Language language = new Language(); + language.id = 1000L; + + // Criterion - Within 15 miles + Proximity proximity = new Proximity(); + proximity.geoPoint = businessPage.entries[0].geoPoint; + proximity.radiusDistanceUnits = ProximityDistanceUnits.MILES; + proximity.radiusInUnits = 15; + + marsTourPromotion.criteria = new Criterion[] { productService, language, proximity }; + + // Creatives + + Creative creative1 = new Creative(); + creative1.headline = "Standard Mars Trip"; + creative1.line1 = "Fly coach to Mars"; + creative1.line2 = "Free in-flight pretzels"; + + Creative creative2 = new Creative(); + creative2.headline = "Deluxe Mars Trip"; + creative2.line1 = "Fly first class to Mars"; + creative2.line2 = "Unlimited powdered orange drink"; + + marsTourPromotion.creatives = new Creative[] { creative1, creative2 }; + + PromotionOperation operation = new PromotionOperation(); + operation.@operator = Operator.ADD; + operation.operand = marsTourPromotion; + + try { + Promotion[] addedPromotions = promotionService.mutate( + new PromotionOperation[] { operation }); + + Console.WriteLine("Added promotion ID {0} with name {1} to business ID {2}.", + addedPromotions[0].id, addedPromotions[0].name, businessId); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add promotions.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/Express/GetBudgetSuggestion.cs b/examples/AdWords/CSharp/v201406/Express/GetBudgetSuggestion.cs new file mode 100644 index 00000000000..692be1913cf --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Express/GetBudgetSuggestion.cs @@ -0,0 +1,125 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example shows how to retrieve an AdWords Express budget + /// suggestion. + /// + /// Tags: BudgetSuggestionService.mutate + /// + public class GetBudgetSuggestion : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to retrieve an AdWords Express budget suggestion."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetBudgetSuggestion codeExample = new GetBudgetSuggestion(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the BudgetSuggestionService. + BudgetSuggestionService budgetSuggestionService = (BudgetSuggestionService) + user.GetService(AdWordsService.v201406.BudgetSuggestionService); + + BudgetSuggestionSelector selector = new BudgetSuggestionSelector(); + + List criteria = new List(); + + // Criterion - Travel Agency product/service. See GetProductServices.cs for an example + // of how to get valid product/service settings. + ProductService productService = new ProductService(); + productService.text = "Travel Agency"; + productService.locale = "en_US"; + criteria.Add(productService); + + // Criterion - English language. + // The ID can be found in the documentation: + // https://developers.google.com/adwords/api/docs/appendix/languagecodes + Language language = new Language(); + language.id = 1000L; + criteria.Add(language); + + // Criterion - Mountain View, California location. + // The ID can be found in the documentation: + // https://developers.google.com/adwords/api/docs/appendix/geotargeting + // https://developers.google.com/adwords/api/docs/appendix/cities-DMAregions + Location location = new Location(); + location.id = 1014044L; + criteria.Add(location); + + selector.criteria = criteria.ToArray(); + + try { + BudgetSuggestion budgetSuggestion = budgetSuggestionService.get(selector); + + Console.WriteLine("Budget suggestion for criteria is:\n" + + " SuggestedBudget={0}\n" + + " Min/MaxBudget={1}/{2}\n" + + " Min/MaxCpc={3}/{4}\n" + + " CPM={5}\n" + + " CPC={6}\n" + + " Impressions={7}\n", + budgetSuggestion.suggestedBudget.microAmount, + budgetSuggestion.minBudget.microAmount, budgetSuggestion.maxBudget.microAmount, + budgetSuggestion.minCpc.microAmount, budgetSuggestion.maxCpc.microAmount, + budgetSuggestion.cpm.microAmount, + budgetSuggestion.cpc.microAmount, + budgetSuggestion.impressions); + + if (budgetSuggestion.budgetQuantiles != null + && budgetSuggestion.budgetQuantiles.Length > 0) { + int quantileCount = 0; + Console.WriteLine(" Budget quantiles:"); + foreach (Money budgetQuantile in budgetSuggestion.budgetQuantiles) { + Console.WriteLine(" {0}) {1}", ++quantileCount, budgetQuantile.microAmount); + } + } else { + Console.WriteLine(" No budget quantiles found on budget suggestion"); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get budget suggestion.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/Express/GetExpressBusinesses.cs b/examples/AdWords/CSharp/v201406/Express/GetExpressBusinesses.cs new file mode 100644 index 00000000000..8401e01ec80 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Express/GetExpressBusinesses.cs @@ -0,0 +1,151 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Text; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example gets all express businesses. To add an express + /// business, run AddExpressBusinesses.cs. + /// + /// Tags: ExpressBusinessService.get + /// + public class GetExpressBusinesses : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all express businesses. To add an express business, " + + "run AddExpressBusinesses.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetExpressBusinesses codeExample = new GetExpressBusinesses(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ExpressBusinessService. + ExpressBusinessService businessService = (ExpressBusinessService) + user.GetService(AdWordsService.v201406.ExpressBusinessService); + + Selector selector = new Selector(); + selector.fields = new String[] { "Id", "Name", "Website", "Address", "GeoPoint", "Status" }; + + // To get all express businesses owned by the current customer, + // simply skip the call to selector.setPredicates below. + Predicate predicate = new Predicate(); + predicate.field = "Status"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] { "ACTIVE" }; + + selector.predicates = new Predicate[] { predicate }; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + ExpressBusinessPage page = null; + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get all businesses. + page = businessService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (ExpressBusiness business in page.entries) { + Console.WriteLine("{0}) Express business found with name '{1}', id = {2}, " + + "website = {3} and status = {4}.\n", i + 1, business.name, business.id, + business.website, business.status); + Console.WriteLine("Address"); + Console.WriteLine("======="); + Console.WriteLine(FormatAddress(business.address)); + Console.WriteLine("Co-ordinates: {0}\n", FormatGeopoint(business.geoPoint)); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of businesses found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve express business.", ex); + } + } + + /// + /// Formats the address as a printable text. + /// + /// The address object. + /// The formatted text. + private static string FormatAddress(Address address) { + if (address == null) { + return "Not available."; + } + StringBuilder addressBuilder = new StringBuilder(); + + addressBuilder.AppendFormat("Line 1: {0}\n", address.streetAddress ?? ""); + addressBuilder.AppendFormat("Line 2: {0}\n", address.streetAddress2 ?? ""); + addressBuilder.AppendFormat("Province Name: {0}\n", address.provinceName ?? ""); + addressBuilder.AppendFormat("Province Code: {0}\n", address.provinceCode ?? ""); + addressBuilder.AppendFormat("City name: {0}\n", address.cityName ?? ""); + addressBuilder.AppendFormat("Postal code: {0}\n", address.postalCode ?? ""); + addressBuilder.AppendFormat("Country name: {0}\n", address.countryCode ?? ""); + + return addressBuilder.ToString(); + } + + /// + /// Formats the geopoint as a printable text. + /// + /// The geo point. + /// The formatted text. + private string FormatGeopoint(GeoPoint geoPoint) { + if (geoPoint == null) { + return "(Unknown, Unknown)"; + } + return string.Format("({0}, {1})", (decimal) geoPoint.latitudeInMicroDegrees / 1000000, + (decimal) geoPoint.longitudeInMicroDegrees / 1000000); + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/Express/GetProductServices.cs b/examples/AdWords/CSharp/v201406/Express/GetProductServices.cs new file mode 100644 index 00000000000..1304abcd8df --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Express/GetProductServices.cs @@ -0,0 +1,119 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example shows how to retrieve AdWords Express product/service + /// objects related to specific criteria. + /// + /// Tags: ProductServiceService.get + /// + public class GetProductServices : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to retrieve AdWords Express product/service " + + "objects related to specific criteria."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetProductServices codeExample = new GetProductServices(); + Console.WriteLine(codeExample.Description); + try { + string productServiceSuggestion = "INSERT_PRODUCT_SERVICE_SUGGESTION_HERE"; + string localeText = "INSERT_LOCALE_TEXT_HERE"; + codeExample.Run(new AdWordsUser(), productServiceSuggestion, localeText); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The product/service suggestion. + /// + /// The locale text. + public void Run(AdWordsUser user, string productServiceSuggestion, string localeText) { + // Get the service, which loads the required classes. + ProductServiceService productServiceService = (ProductServiceService) user.GetService( + AdWordsService.v201406.ProductServiceService); + + // Create selector. + Selector selector = new Selector(); + selector.fields = new string[] {"ProductServiceText"}; + + // Create predicates. + Predicate textPredicate = new Predicate(); + textPredicate.field = "ProductServiceText"; + textPredicate.@operator = PredicateOperator.EQUALS; + textPredicate.values = new string[] {productServiceSuggestion}; + + Predicate localePredicate = new Predicate(); + localePredicate.field = "Locale"; + localePredicate.@operator = PredicateOperator.EQUALS; + localePredicate.values = new string[]{localeText}; + + selector.predicates = new Predicate[] {textPredicate, localePredicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + ProductServicePage page = null; + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Make the get request. + page = productServiceService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (ProductService productService in page.entries) { + Console.WriteLine("Product/service with text '{0}' found", productService.text); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of products/services found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve products/services.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/Express/GetPromotions.cs b/examples/AdWords/CSharp/v201406/Express/GetPromotions.cs new file mode 100644 index 00000000000..cff8296c33d --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Express/GetPromotions.cs @@ -0,0 +1,110 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Text; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example gets all express businesses. To add an express + /// business, run AddExpressBusinesses.cs. + /// + /// Tags: ExpressBusinessService.get + /// + public class GetPromotions : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all express businesses. To add an express business, " + + "run AddExpressBusinesses.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetPromotions codeExample = new GetPromotions(); + Console.WriteLine(codeExample.Description); + try { + long businessId = long.Parse("INSERT_ADWORDS_EXPRESS_BUSINESS_ID_HERE"); + codeExample.Run(new AdWordsUser(), businessId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The AdWords Express business id. + public void Run(AdWordsUser user, long businessId) { + // Get the PromotionService. + PromotionService promotionService = (PromotionService) + user.GetService(AdWordsService.v201406.PromotionService); + + // Set the business ID to the service. + promotionService.RequestHeader.expressBusinessId = businessId; + + Selector selector = new Selector(); + selector.fields = new String[] {"PromotionId", "Name", "Status", "DestinationUrl", + "StreetAddressVisible", "CallTrackingEnabled", "ContentNetworkOptedOut", "Budget", + "PromotionCriteria", "RemainingBudget", "Creatives", "CampaignIds" }; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + PromotionPage page = null; + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get all promotions for the business. + page = promotionService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (Promotion promotion in page.entries) { + // Summary. + Console.WriteLine("0) Express promotion with name = {1} and id = {2} was found.", + i + 1, promotion.id, promotion.name); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of promotions found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve promotions.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/Express/UpdateExpressBusiness.cs b/examples/AdWords/CSharp/v201406/Express/UpdateExpressBusiness.cs new file mode 100644 index 00000000000..706cba8f6bd --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Express/UpdateExpressBusiness.cs @@ -0,0 +1,89 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example updates an express business. To add an express + /// business, run AddExpressBusinesses.cs. + /// + /// Tags: ExpressBusinessService.mutate + /// + public class UpdateExpressBusiness : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates an express business. To add an express business, run " + + "AddExpressBusinesses.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdateExpressBusiness codeExample = new UpdateExpressBusiness(); + Console.WriteLine(codeExample.Description); + try { + long businessId = long.Parse("INSERT_ADWORDS_EXPRESS_BUSINESS_ID_HERE"); + codeExample.Run(new AdWordsUser(), businessId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The AdWords Express business id. + public void Run(AdWordsUser user, long businessId) { + // Get the ExpressBusinessService. + ExpressBusinessService businessService = (ExpressBusinessService) + user.GetService(AdWordsService.v201406.ExpressBusinessService); + + // Update the website and address for the business + ExpressBusiness business = new ExpressBusiness(); + business.id = businessId; + business.name = "Express Interplanetary Cruise #" + ExampleUtilities.GetShortRandomString(); + business.website = "http://www.example.com/?myParam=" + businessId; + + ExpressBusinessOperation operation = new ExpressBusinessOperation(); + operation.@operator = Operator.SET; + operation.operand = business; + + try { + ExpressBusiness[] updatedBusinesses = + businessService.mutate(new ExpressBusinessOperation[] { operation }); + + Console.WriteLine("Express business with ID {0} and name '{1}' was updated.", + updatedBusinesses[0].id, updatedBusinesses[0].name); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update express business.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/Express/UpdatePromotion.cs b/examples/AdWords/CSharp/v201406/Express/UpdatePromotion.cs new file mode 100644 index 00000000000..fe0cf93cf83 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Express/UpdatePromotion.cs @@ -0,0 +1,100 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example updates a promotion for an express businesses. To add + /// a promotion, run UpdatePromotion.cs. + /// + /// Tags: PromotionService.mutate + /// + public class UpdatePromotion : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a promotion for an express businesses. To add a " + + "promotion, run UpdatePromotion.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdatePromotion codeExample = new UpdatePromotion(); + Console.WriteLine(codeExample.Description); + try { + long businessId = long.Parse("INSERT_ADWORDS_EXPRESS_BUSINESS_ID_HERE"); + long promotionId = long.Parse("INSERT_PROMOTION_ID_HERE"); + codeExample.Run(new AdWordsUser(), businessId, promotionId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The AdWords Express business id. + /// The promotion id. + public void Run(AdWordsUser user, long businessId, long promotionId) { + // Get the ExpressBusinessService. + ExpressBusinessService businessService = (ExpressBusinessService) + user.GetService(AdWordsService.v201406.ExpressBusinessService); + + // Get the PromotionService + PromotionService promotionService = (PromotionService) + user.GetService(AdWordsService.v201406.PromotionService); + + // Set the business ID to the service. + promotionService.RequestHeader.expressBusinessId = businessId; + + // Update the budget for the promotion + Promotion promotion = new Promotion(); + promotion.id = promotionId; + Money newBudget = new Money(); + newBudget.microAmount = 2000000; + promotion.budget = newBudget; + + PromotionOperation operation = new PromotionOperation(); + operation.@operator = Operator.SET; + operation.operand = promotion; + + try { + Promotion[] updatedPromotions = promotionService.mutate( + new PromotionOperation[] { operation }); + + Console.WriteLine("Promotion ID {0} for business ID {1} now has budget micro " + + "amount {2}.", promotionId, businessId, + updatedPromotions[0].budget.microAmount); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update promotions.", ex); + } + } + } +} \ No newline at end of file diff --git a/examples/AdWords/CSharp/v201406/Miscellaneous/GetAllVideosAndImages.cs b/examples/AdWords/CSharp/v201406/Miscellaneous/GetAllVideosAndImages.cs new file mode 100644 index 00000000000..306f82c9176 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Miscellaneous/GetAllVideosAndImages.cs @@ -0,0 +1,139 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example gets all videos and images. To upload video, see + /// http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. + /// To upload image, run UploadImage.cs. + /// + /// Tags: MediaService.get + /// + public class GetAllVideosAndImages : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAllVideosAndImages codeExample = new GetAllVideosAndImages(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all videos and images. To upload video, see " + + "http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. To " + + "upload image, run UploadImage.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the MediaService. + MediaService mediaService = (MediaService) user.GetService( + AdWordsService.v201406.MediaService); + + // Create a selector. + Selector selector = new Selector(); + selector.fields = new string[] {"MediaId", "Width", "Height", "MimeType"}; + + // Set the filter. + Predicate predicate = new Predicate(); + predicate.@operator = PredicateOperator.IN; + predicate.field = "Type"; + predicate.values = new string[] {MediaMediaType.VIDEO.ToString(), + MediaMediaType.IMAGE.ToString()}; + + selector.predicates = new Predicate[] {predicate}; + + // Set selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + MediaPage page = new MediaPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + page = mediaService.get(selector); + + if (page != null && page.entries != null) { + int i = offset; + + foreach (Media media in page.entries) { + if (media is Video) { + Video video = (Video) media; + Console.WriteLine("{0}) Video with id \"{1}\" and name \"{2}\" was found.", + i, video.mediaId, video.name); + } else if (media is Image) { + Image image = (Image) media; + Dictionary dimensions = + CreateMediaDimensionMap(image.dimensions); + Console.WriteLine("{0}) Image with id '{1}', dimensions '{2}x{3}', and MIME type " + + "'{4}' was found.", i, image.mediaId, dimensions[MediaSize.FULL].width, + dimensions[MediaSize.FULL].height, image.mimeType); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of images and videos found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get images and videos.", ex); + } + } + + /// + /// Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + /// + /// The array of Media_Size_DimensionsMapEntry to be + /// converted into a dictionary. + /// A dictionary with key as MediaSize, and value as Dimensions. + /// + private Dictionary CreateMediaDimensionMap( + Media_Size_DimensionsMapEntry[] dimensions) { + Dictionary mediaMap = new Dictionary(); + foreach (Media_Size_DimensionsMapEntry dimension in dimensions) { + mediaMap.Add(dimension.key, dimension.value); + } + return mediaMap; + } + } +} diff --git a/examples/AdWords/CSharp/v201406/Miscellaneous/UploadImage.cs b/examples/AdWords/CSharp/v201406/Miscellaneous/UploadImage.cs new file mode 100644 index 00000000000..334088635f8 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Miscellaneous/UploadImage.cs @@ -0,0 +1,106 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example uploads an image. To get images, run GetAllVideosAndImages.cs. + /// + /// Tags: MediaService.upload + /// + public class UploadImage : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UploadImage codeExample = new UploadImage(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example uploads an image. To get images, run GetAllVideosAndImages.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the MediaService. + MediaService mediaService = (MediaService) user.GetService( + AdWordsService.v201406.MediaService); + + // Create the image. + Image image = new Image(); + image.data = MediaUtilities.GetAssetDataFromUrl("http://goo.gl/HJM3L"); + image.type = MediaMediaType.IMAGE; + + try { + // Upload the image. + Media[] result = mediaService.upload(new Media[] {image}); + + // Display the results. + if (result != null && result.Length > 0) { + Media newImage = result[0]; + Dictionary dimensions = + CreateMediaDimensionMap(newImage.dimensions); + Console.WriteLine("Image with id '{0}', dimensions '{1}x{2}', and MIME type '{3}'" + + " was uploaded.", newImage.mediaId, dimensions[MediaSize.FULL].width, + dimensions[MediaSize.FULL].height, newImage.mimeType); + } else { + Console.WriteLine("No images were uploaded."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to upload image.", ex); + } + } + + /// + /// Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + /// + /// The array of Media_Size_DimensionsMapEntry to be + /// converted into a dictionary. + /// A dictionary with key as MediaSize, and value as Dimensions. + /// + private Dictionary CreateMediaDimensionMap( + Media_Size_DimensionsMapEntry[] dimensions) { + Dictionary mediaMap = new Dictionary(); + foreach (Media_Size_DimensionsMapEntry dimension in dimensions) { + mediaMap.Add(dimension.key, dimension.value); + } + return mediaMap; + } + } +} diff --git a/examples/AdWords/CSharp/v201406/Optimization/EstimateKeywordTraffic.cs b/examples/AdWords/CSharp/v201406/Optimization/EstimateKeywordTraffic.cs new file mode 100644 index 00000000000..29a342c3c1f --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Optimization/EstimateKeywordTraffic.cs @@ -0,0 +1,173 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example gets keyword traffic estimates. + /// + /// Tags: TrafficEstimatorService.get + /// + public class EstimateKeywordTraffic : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + EstimateKeywordTraffic codeExample = new EstimateKeywordTraffic(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets keyword traffic estimates."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the TrafficEstimatorService. + TrafficEstimatorService trafficEstimatorService = (TrafficEstimatorService) user.GetService( + AdWordsService.v201406.TrafficEstimatorService); + + // Create keywords. Up to 2000 keywords can be passed in a single request. + Keyword keyword1 = new Keyword(); + keyword1.text = "mars cruise"; + keyword1.matchType = KeywordMatchType.BROAD; + + Keyword keyword2 = new Keyword(); + keyword2.text = "cheap cruise"; + keyword2.matchType = KeywordMatchType.PHRASE; + + Keyword keyword3 = new Keyword(); + keyword3.text = "cruise"; + keyword3.matchType = KeywordMatchType.EXACT; + + Keyword[] keywords = new Keyword[] {keyword1, keyword2, keyword3}; + + // Create a keyword estimate request for each keyword. + List keywordEstimateRequests = new List(); + + foreach (Keyword keyword in keywords) { + KeywordEstimateRequest keywordEstimateRequest = new KeywordEstimateRequest(); + keywordEstimateRequest.keyword = keyword; + keywordEstimateRequests.Add(keywordEstimateRequest); + } + + // Create negative keywords. + Keyword negativeKeyword1 = new Keyword(); + negativeKeyword1.text = "moon walk"; + negativeKeyword1.matchType = KeywordMatchType.BROAD; + + KeywordEstimateRequest negativeKeywordEstimateRequest = new KeywordEstimateRequest(); + negativeKeywordEstimateRequest.keyword = negativeKeyword1; + negativeKeywordEstimateRequest.isNegative = true; + keywordEstimateRequests.Add(negativeKeywordEstimateRequest); + + // Create ad group estimate requests. + AdGroupEstimateRequest adGroupEstimateRequest = new AdGroupEstimateRequest(); + adGroupEstimateRequest.keywordEstimateRequests = keywordEstimateRequests.ToArray(); + adGroupEstimateRequest.maxCpc = new Money(); + adGroupEstimateRequest.maxCpc.microAmount = 1000000; + + // Create campaign estimate requests. + CampaignEstimateRequest campaignEstimateRequest = new CampaignEstimateRequest(); + campaignEstimateRequest.adGroupEstimateRequests = new AdGroupEstimateRequest[] { + adGroupEstimateRequest}; + + // See http://code.google.com/apis/adwords/docs/appendix/countrycodes.html + // for a detailed list of country codes. + Location countryCriterion = new Location(); + countryCriterion.id = 2840; //US + + // See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + // for a detailed list of language codes. + Language languageCriterion = new Language(); + languageCriterion.id = 1000; //en + + campaignEstimateRequest.criteria = new Criterion[] {countryCriterion, languageCriterion}; + + // Create the selector. + TrafficEstimatorSelector selector = new TrafficEstimatorSelector(); + selector.campaignEstimateRequests = new CampaignEstimateRequest[] {campaignEstimateRequest}; + + try { + // Get traffic estimates. + TrafficEstimatorResult result = trafficEstimatorService.get(selector); + + // Display traffic estimates. + if (result != null && result.campaignEstimates != null && + result.campaignEstimates.Length > 0) { + CampaignEstimate campaignEstimate = result.campaignEstimates[0]; + if (campaignEstimate.adGroupEstimates != null && + campaignEstimate.adGroupEstimates.Length > 0) { + AdGroupEstimate adGroupEstimate = campaignEstimate.adGroupEstimates[0]; + + if (adGroupEstimate.keywordEstimates != null) { + for (int i = 0; i < adGroupEstimate.keywordEstimates.Length; i++) { + Keyword keyword = keywordEstimateRequests[i].keyword; + KeywordEstimate keywordEstimate = adGroupEstimate.keywordEstimates[i]; + + if (keywordEstimateRequests[i].isNegative) { + continue; + } + + // Find the mean of the min and max values. + long meanAverageCpc = (keywordEstimate.min.averageCpc.microAmount + + keywordEstimate.max.averageCpc.microAmount) / 2; + double meanAveragePosition = (keywordEstimate.min.averagePosition + + keywordEstimate.max.averagePosition) / 2; + float meanClicks = (keywordEstimate.min.clicksPerDay + + keywordEstimate.max.clicksPerDay) / 2; + long meanTotalCost = (keywordEstimate.min.totalCost.microAmount + + keywordEstimate.max.totalCost.microAmount) / 2; + + Console.WriteLine("Results for the keyword with text = '{0}' and match type = " + + "'{1}':", keyword.text, keyword.matchType); + Console.WriteLine(" Estimated average CPC: {0}", meanAverageCpc); + Console.WriteLine(" Estimated ad position: {0:0.00}", meanAveragePosition); + Console.WriteLine(" Estimated daily clicks: {0}", meanClicks); + Console.WriteLine(" Estimated daily cost: {0}", meanTotalCost); + } + } + } + } else { + Console.WriteLine("No traffic estimates were returned.\n"); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve traffic estimates.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/Optimization/GetAdGroupBidSimulations.cs b/examples/AdWords/CSharp/v201406/Optimization/GetAdGroupBidSimulations.cs new file mode 100644 index 00000000000..5c89de372ad --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Optimization/GetAdGroupBidSimulations.cs @@ -0,0 +1,105 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example gets bid landscapes for an ad group. To get ad groups, + /// run GetAdGroups.cs. + /// + /// Tags: DataService.getAdGroupBidLandscape + /// + public class GetAdGroupBidSimulations : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAdGroupBidSimulations codeExample = new GetAdGroupBidSimulations(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets bid landscapes for an ad group. To get ad groups, run " + + "GetAdGroups.cs"; + } + } + + /// + /// Runs the specified user. + /// + /// The user. + /// Id of the ad group for which bid simulations are + /// retrieved. + public void Run(AdWordsUser user, long adGroupId) { + // Get the DataService. + DataService dataService = (DataService) user.GetService(AdWordsService.v201406.DataService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"AdGroupId", "LandscapeType", "LandscapeCurrent", "StartDate", + "EndDate", "Bid", "LocalClicks", "LocalCost", "MarginalCpc", "LocalImpressions"}; + + // Set the filters. + Predicate adGroupPredicate = new Predicate(); + adGroupPredicate.field = "AdGroupId"; + adGroupPredicate.@operator = PredicateOperator.IN; + adGroupPredicate.values = new string[] {adGroupId.ToString()}; + + selector.predicates = new Predicate[] {adGroupPredicate}; + + try { + // Get bid landscape for ad group. + AdGroupBidLandscapePage page = dataService.getAdGroupBidLandscape(selector); + if (page != null && page.entries != null && page.entries.Length > 0) { + foreach (AdGroupBidLandscape bidLandscape in page.entries) { + Console.WriteLine("Found ad group bid landscape with ad group id '{0}', type '{1}', " + + "current: '{2}', start date '{3}', end date '{4}', and landscape points", + bidLandscape.adGroupId, bidLandscape.type, bidLandscape.landscapeCurrent, + bidLandscape.startDate, bidLandscape.endDate); + foreach (BidLandscapeLandscapePoint point in bidLandscape.landscapePoints) { + Console.WriteLine("- bid: {0} => clicks: {1}, cost: {2}, marginalCpc: {3}, " + + "impressions: {4}", point.bid.microAmount, point.bid.microAmount, + point.clicks, point.cost.microAmount, point.marginalCpc.microAmount, + point.impressions); + } + } + } else { + Console.WriteLine("No ad group bid landscapes were found."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get ad group bid landscapes.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/Optimization/GetKeywordBidSimulations.cs b/examples/AdWords/CSharp/v201406/Optimization/GetKeywordBidSimulations.cs new file mode 100644 index 00000000000..1d013b99c90 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Optimization/GetKeywordBidSimulations.cs @@ -0,0 +1,133 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example gets a bid landscape for an ad group and a keyword. + /// To get ad groups, run GetAdGroups.cs. To get keywords, run + /// GetKeywords.cs. + /// + /// Tags: DataService.getCriterionBidLandscape + /// + public class GetKeywordBidSimulations : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetKeywordBidSimulations codeExample = new GetKeywordBidSimulations(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long keywordId = long.Parse("INSERT_KEYWORD_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, keywordId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a bid landscape for an ad group and a keyword. " + + "To get ad groups, run GetAdGroups.cs. To get keywords, run GetKeywords.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group for which keyword bid + /// simulations are retrieved. + /// Id of the keyword for which bid simulations are + /// retrieved. + public void Run(AdWordsUser user, long adGroupId, long keywordId) { + // Get the DataService. + DataService dataService = (DataService) user.GetService(AdWordsService.v201406.DataService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"AdGroupId", "CriterionId", "StartDate", "EndDate", "Bid", + "LocalClicks", "LocalCost", "MarginalCpc", "LocalImpressions"}; + + // Create the filters. + Predicate adGroupPredicate = new Predicate(); + adGroupPredicate.field = "AdGroupId"; + adGroupPredicate.@operator = PredicateOperator.IN; + adGroupPredicate.values = new string[] {adGroupId.ToString()}; + + Predicate keywordPredicate = new Predicate(); + keywordPredicate.field = "CriterionId"; + keywordPredicate.@operator = PredicateOperator.IN; + keywordPredicate.values = new string[] {keywordId.ToString()}; + + selector.predicates = new Predicate[] {adGroupPredicate, keywordPredicate}; + + // Set selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + CriterionBidLandscapePage page = new CriterionBidLandscapePage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get bid landscape for keywords. + page = dataService.getCriterionBidLandscape(selector); + + // Display bid landscapes. + if (page != null && page.entries != null) { + int i = offset; + + foreach (CriterionBidLandscape bidLandscape in page.entries) { + Console.WriteLine("{0}) Found criterion bid landscape with ad group id '{1}', " + + "keyword id '{2}', start date '{3}', end date '{4}', and landscape points:", + i, bidLandscape.adGroupId, bidLandscape.criterionId, bidLandscape.startDate, + bidLandscape.endDate); + foreach (BidLandscapeLandscapePoint bidLandscapePoint in + bidLandscape.landscapePoints) { + Console.WriteLine("- bid: {0} => clicks: {1}, cost: {2}, marginalCpc: {3}, " + + "impressions: {4}\n", bidLandscapePoint.bid.microAmount, + bidLandscapePoint.clicks, bidLandscapePoint.cost.microAmount, + bidLandscapePoint.marginalCpc.microAmount, bidLandscapePoint.impressions); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of keyword bid landscapes found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve keyword bid landscapes.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/Optimization/GetKeywordIdeas.cs b/examples/AdWords/CSharp/v201406/Optimization/GetKeywordIdeas.cs new file mode 100644 index 00000000000..8ff3047d207 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Optimization/GetKeywordIdeas.cs @@ -0,0 +1,150 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example retrieves keywords that are related to a given keyword. + /// + /// Tags: TargetingIdeaService.get + /// + public class GetKeywordIdeas : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetKeywordIdeas codeExample = new GetKeywordIdeas(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves keywords that are related to a given keyword."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the TargetingIdeaService. + TargetingIdeaService targetingIdeaService = + (TargetingIdeaService) user.GetService(AdWordsService.v201406.TargetingIdeaService); + + string keywordText = "mars cruise"; + + // Create selector. + TargetingIdeaSelector selector = new TargetingIdeaSelector(); + selector.requestType = RequestType.IDEAS; + selector.ideaType = IdeaType.KEYWORD; + selector.requestedAttributeTypes = new AttributeType[] { + AttributeType.KEYWORD_TEXT, + AttributeType.SEARCH_VOLUME, + AttributeType.CATEGORY_PRODUCTS_AND_SERVICES}; + + // Language setting (optional). + // The ID can be found in the documentation: + // https://developers.google.com/adwords/api/docs/appendix/languagecodes + // Note: As of v201302, only a single language parameter is allowed. + LanguageSearchParameter languageParameter = new LanguageSearchParameter(); + Language english = new Language(); + english.id = 1000; + languageParameter.languages = new Language[] {english}; + + // Create related to query search parameter. + RelatedToQuerySearchParameter relatedToQuerySearchParameter = + new RelatedToQuerySearchParameter(); + relatedToQuerySearchParameter.queries = new String[] {keywordText}; + selector.searchParameters = + new SearchParameter[] {relatedToQuerySearchParameter, languageParameter}; + + // Set selector paging (required for targeting idea service). + Paging paging = new Paging(); + paging.startIndex = 0; + paging.numberResults = 500; + selector.paging = paging; + + int offset = 0; + int pageSize = 500; + + TargetingIdeaPage page = new TargetingIdeaPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + // Get related keywords. + page = targetingIdeaService.get(selector); + + // Display related keywords. + if (page.entries != null && page.entries.Length > 0) { + int i = offset; + foreach (TargetingIdea targetingIdea in page.entries) { + string keyword = null; + string categories = null; + long averageMonthlySearches = 0; + + foreach (Type_AttributeMapEntry entry in targetingIdea.data) { + if (entry.key == AttributeType.KEYWORD_TEXT) { + keyword = (entry.value as StringAttribute).value; + } + if (entry.key == AttributeType.CATEGORY_PRODUCTS_AND_SERVICES) { + IntegerSetAttribute categorySet = entry.value as IntegerSetAttribute; + StringBuilder builder = new StringBuilder(); + if (categorySet.value != null) { + foreach (int value in categorySet.value) { + builder.AppendFormat("{0}, ", value); + } + categories = builder.ToString().Trim(new char[] {',', ' '}); + } + } + if (entry.key == AttributeType.SEARCH_VOLUME) { + averageMonthlySearches = (entry.value as LongAttribute).value; + } + } + Console.WriteLine("Keyword with text '{0}', and average monthly search volume " + + "'{1}' was found with categories: {2}", keyword, averageMonthlySearches, + categories); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of related keywords found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve related keywords.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/Optimization/GetPlacementIdeas.cs b/examples/AdWords/CSharp/v201406/Optimization/GetPlacementIdeas.cs new file mode 100644 index 00000000000..b5ff24a0bc8 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Optimization/GetPlacementIdeas.cs @@ -0,0 +1,122 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example retrieves urls that have content keywords related to a + /// given website. + /// + /// Tags: TargetingIdeaService.get + /// + public class GetPlacementIdeas : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetPlacementIdeas codeExample = new GetPlacementIdeas(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves urls that have content keywords related to a" + + " given website."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the TargetingIdeaService. + TargetingIdeaService targetingIdeaService = + (TargetingIdeaService) user.GetService(AdWordsService.v201406.TargetingIdeaService); + + // Create seed url. + string url = "mars.google.com"; + + // Create the selector. + TargetingIdeaSelector selector = new TargetingIdeaSelector(); + selector.requestType = RequestType.IDEAS; + selector.ideaType = IdeaType.PLACEMENT; + selector.requestedAttributeTypes = new AttributeType[] {AttributeType.CRITERION, + AttributeType.PLACEMENT_TYPE}; + + // Create related to url search parameter. + RelatedToUrlSearchParameter relatedToUrlSearchParameter = new RelatedToUrlSearchParameter(); + relatedToUrlSearchParameter.urls = new string[] {url}; + relatedToUrlSearchParameter.includeSubUrls = false; + selector.searchParameters = new SearchParameter[] {relatedToUrlSearchParameter}; + + // Set selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + TargetingIdeaPage page = new TargetingIdeaPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get placement ideas. + page = targetingIdeaService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + + foreach (TargetingIdea idea in page.entries) { + foreach (Type_AttributeMapEntry entry in idea.data) { + if (entry.key == AttributeType.CRITERION) { + CriterionAttribute placementAttribute = entry.value as CriterionAttribute; + Placement placement = (Placement) placementAttribute.value; + Console.WriteLine("Related placement urls were found at '{0}'.", + (placementAttribute.value as Placement).url); + } + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of related placements found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve related placements.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/Remarketing/AddAudience.cs b/examples/AdWords/CSharp/v201406/Remarketing/AddAudience.cs new file mode 100644 index 00000000000..fe4666f3f23 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Remarketing/AddAudience.cs @@ -0,0 +1,156 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example illustrates how to create a user list a.k.a. audience. + /// + /// Tags: UserListService.mutate + /// + public class AddAudience : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAudience codeExample = new AddAudience(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create a user list a.k.a. audience."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the UserListService. + AdwordsUserListService userListService = + (AdwordsUserListService) user.GetService(AdWordsService.v201406.AdwordsUserListService); + + // Get the ConversionTrackerService. + ConversionTrackerService conversionTrackerService = + (ConversionTrackerService)user.GetService(AdWordsService.v201406. + ConversionTrackerService); + + BasicUserList userList = new BasicUserList(); + userList.name = "Mars cruise customers #" + ExampleUtilities.GetRandomString(); + userList.description = "A list of mars cruise customers in the last year."; + userList.status = UserListMembershipStatus.OPEN; + userList.membershipLifeSpan = 365; + + UserListConversionType conversionType = new UserListConversionType(); + conversionType.name = userList.name; + userList.conversionTypes = new UserListConversionType[] {conversionType}; + + // Optional: Set the user list status. + userList.status = UserListMembershipStatus.OPEN; + + // Create the operation. + UserListOperation operation = new UserListOperation(); + operation.operand = userList; + operation.@operator = Operator.ADD; + + try { + // Add the user list. + UserListReturnValue retval = userListService.mutate(new UserListOperation[] {operation}); + + UserList[] userLists = null; + if (retval != null && retval.value != null) { + userLists = retval.value; + // Get all conversion snippets + List conversionIds = new List(); + foreach (BasicUserList newUserList in userLists) { + if (newUserList.conversionTypes != null) { + foreach (UserListConversionType newConversionType in newUserList.conversionTypes) { + conversionIds.Add(newConversionType.id.ToString()); + } + } + } + + Dictionary conversionsMap = + new Dictionary(); + + if (conversionIds.Count > 0) { + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id"}; + + Predicate conversionTypePredicate = new Predicate(); + conversionTypePredicate.field = "Id"; + conversionTypePredicate.@operator = PredicateOperator.IN; + conversionTypePredicate.values = conversionIds.ToArray(); + selector.predicates = new Predicate[] {conversionTypePredicate}; + + // Get all conversion trackers. + ConversionTrackerPage page = conversionTrackerService.get(selector); + + if (page != null && page.entries != null) { + foreach (ConversionTracker tracker in page.entries) { + conversionsMap[tracker.id] = tracker; + } + } + } + + // Display the results. + foreach (BasicUserList newUserList in userLists) { + Console.WriteLine("User list with name '{0}' and id '{1}' was added.", + newUserList.name, newUserList.id); + + // Display user list associated conversion code snippets. + if (newUserList.conversionTypes != null) { + foreach (UserListConversionType userListConversionType in + newUserList.conversionTypes) { + if (conversionsMap.ContainsKey(userListConversionType.id)) { + AdWordsConversionTracker conversionTracker = + (AdWordsConversionTracker) conversionsMap[userListConversionType.id]; + Console.WriteLine("Conversion type code snippet associated to the list:\n{0}\n", + conversionTracker.snippet); + } else { + throw new Exception("Failed to associate conversion type code snippet."); + } + } + } + } + } else { + Console.WriteLine("No user lists (a.k.a. audiences) were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add user lists (a.k.a. audiences).", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/Remarketing/AddConversionTracker.cs b/examples/AdWords/CSharp/v201406/Remarketing/AddConversionTracker.cs new file mode 100644 index 00000000000..1f29ea882af --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Remarketing/AddConversionTracker.cs @@ -0,0 +1,107 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example adds an AdWords conversion tracker. + /// + /// Tags: ConversionTrackerService.mutate + /// + public class AddConversionTracker : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddConversionTracker codeExample = new AddConversionTracker(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds an AdWords conversion tracker."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ConversionTrackerService. + ConversionTrackerService conversionTrackerService = + (ConversionTrackerService)user.GetService(AdWordsService.v201406. + ConversionTrackerService); + + // Create Adwords conversion tracker. + AdWordsConversionTracker conversionTracker = new AdWordsConversionTracker(); + conversionTracker.name = "Earth to Mars Cruises Conversion #" + + ExampleUtilities.GetRandomString(); + conversionTracker.category = ConversionTrackerCategory.DEFAULT; + conversionTracker.markupLanguage = AdWordsConversionTrackerMarkupLanguage.HTML; + conversionTracker.textFormat = AdWordsConversionTrackerTextFormat.HIDDEN; + + // Set optional fields. + conversionTracker.status = ConversionTrackerStatus.ENABLED; + conversionTracker.viewthroughLookbackWindow = 15; + conversionTracker.isProductAdsChargeable = true; + conversionTracker.productAdsChargeableConversionWindow = 15; + conversionTracker.conversionPageLanguage = "en"; + conversionTracker.backgroundColor = "#0000FF"; + conversionTracker.defaultRevenueValue = 23.41; + conversionTracker.alwaysUseDefaultRevenueValue = true; + + // Create the operation. + ConversionTrackerOperation operation = new ConversionTrackerOperation(); + operation.@operator = Operator.ADD; + operation.operand = conversionTracker; + + try { + // Add conversion tracker. + ConversionTrackerReturnValue retval = conversionTrackerService.mutate( + new ConversionTrackerOperation[] {operation}); + + // Display the results. + if (retval != null && retval.value != null && retval.value.Length > 0) { + ConversionTracker newConversionTracker = retval.value[0]; + Console.WriteLine("Conversion tracker with id '{0}', name '{1}', status '{2}', " + + "category '{3}' was added.", newConversionTracker.id, newConversionTracker.name, + newConversionTracker.status, newConversionTracker.category); + } else { + Console.WriteLine("No conversion trackers were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add conversion tracker.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/Reporting/DownloadCriteriaReport.cs b/examples/AdWords/CSharp/v201406/Reporting/DownloadCriteriaReport.cs new file mode 100644 index 00000000000..757bfed77ea --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Reporting/DownloadCriteriaReport.cs @@ -0,0 +1,114 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util.Reports; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example gets and downloads a criteria Ad Hoc report from an XML + /// report definition. + /// + public class DownloadCriteriaReport : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DownloadCriteriaReport codeExample = new DownloadCriteriaReport(); + Console.WriteLine(codeExample.Description); + try { + string fileName = "INSERT_FILE_NAME_HERE"; + codeExample.Run(new AdWordsUser(), fileName); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets and downloads a criteria Ad Hoc report from an XML report " + + "definition."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The file to which the report is downloaded. + /// + public void Run(AdWordsUser user, string fileName) { + ReportDefinition definition = new ReportDefinition(); + + definition.reportName = "Last 7 days CRITERIA_PERFORMANCE_REPORT"; + definition.reportType = ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT; + definition.downloadFormat = DownloadFormat.GZIPPED_CSV; + definition.dateRangeType = ReportDefinitionDateRangeType.LAST_7_DAYS; + + // Create selector. + Selector selector = new Selector(); + selector.fields = new string[] {"CampaignId", "AdGroupId", "Id", "CriteriaType", "Criteria", + "CriteriaDestinationUrl", "Clicks", "Impressions", "Cost"}; + + Predicate predicate = new Predicate(); + predicate.field = "Status"; + predicate.@operator = PredicateOperator.IN; + predicate.values = new string[] {"ENABLED", "PAUSED"}; + selector.predicates = new Predicate[] {predicate}; + + definition.selector = selector; + definition.includeZeroImpressions = true; + + string filePath = ExampleUtilities.GetHomeDir() + Path.DirectorySeparatorChar + fileName; + + try { + // If you know that your report is small enough to fit in memory, then + // you can instead use + // ReportUtilities utilities = new ReportUtilities(user); + // utilities.ReportVersion = "v201406"; + // ClientReport report = utilities.GetClientReport(definition); + // + // // Get the text report directly if you requested a text format + // // (e.g. xml) + // string reportText = report.Text; + // + // // Get the binary report if you requested a binary format + // // (e.g. gzip) + // byte[] reportBytes = report.Contents; + // + // // Deflate a zipped binary report for further processing. + // string deflatedReportText = Encoding.UTF8.GetString( + // MediaUtilities.DeflateGZipData(report.Contents)); + ReportUtilities utilities = new ReportUtilities(user); + utilities.ReportVersion = "v201406"; + utilities.DownloadClientReport(definition, filePath); + Console.WriteLine("Report was downloaded to '{0}'.", filePath); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to download report.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/Reporting/DownloadCriteriaReportWithAwql.cs b/examples/AdWords/CSharp/v201406/Reporting/DownloadCriteriaReportWithAwql.cs new file mode 100644 index 00000000000..4b079f6c82d --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Reporting/DownloadCriteriaReportWithAwql.cs @@ -0,0 +1,99 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util.Reports; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example gets and downloads a criteria Ad Hoc report from an AWQL + /// query. See https://developers.google.com/adwords/api/docs/guides/awql for + /// AWQL documentation. + /// + public class DownloadCriteriaReportWithAwql : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DownloadCriteriaReportWithAwql codeExample = new DownloadCriteriaReportWithAwql(); + Console.WriteLine(codeExample.Description); + try { + string fileName = "INSERT_FILE_NAME_HERE"; + codeExample.Run(new AdWordsUser(), fileName); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets and downloads a criteria Ad Hoc report from an AWQL " + + "query. See https://developers.google.com/adwords/api/docs/guides/awql for AWQL " + + "documentation."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The file to which the report is downloaded. + /// + public void Run(AdWordsUser user, string fileName) { + string query = "SELECT CampaignId, AdGroupId, Id, Criteria, CriteriaType, Impressions, " + + "Clicks, Cost FROM CRITERIA_PERFORMANCE_REPORT WHERE Status IN [ENABLED, PAUSED] " + + "DURING LAST_7_DAYS"; + + string filePath = ExampleUtilities.GetHomeDir() + Path.DirectorySeparatorChar + fileName; + + try { + // If you know that your report is small enough to fit in memory, then + // you can instead use + // ReportUtilities utilities = new ReportUtilities(user); + // utilities.ReportVersion = "v201406"; + // ClientReport report = utilities.GetClientReport(query, format); + // + // // Get the text report directly if you requested a text format + // // (e.g. xml) + // string reportText = report.Text; + // + // // Get the binary report if you requested a binary format + // // (e.g. gzip) + // byte[] reportBytes = report.Contents; + // + // // Deflate a zipped binary report for further processing. + // string deflatedReportText = Encoding.UTF8.GetString( + // MediaUtilities.DeflateGZipData(report.Contents)); + ReportUtilities utilities = new ReportUtilities(user); + utilities.ReportVersion = "v201406"; + utilities.DownloadClientReport(query, DownloadFormat.GZIPPED_CSV.ToString(), filePath); + Console.WriteLine("Report was downloaded to '{0}'.", filePath); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to download report.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/Reporting/GetReportFields.cs b/examples/AdWords/CSharp/v201406/Reporting/GetReportFields.cs new file mode 100644 index 00000000000..7c2d4155c2e --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Reporting/GetReportFields.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example gets report fields. + /// + /// Tags: ReportDefinitionService.getReportFields + /// + public class GetReportFields : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetReportFields codeExample = new GetReportFields(); + Console.WriteLine(codeExample.Description); + try { + ReportDefinitionReportType reportType = (ReportDefinitionReportType) Enum.Parse( + typeof(ReportDefinitionReportType), "INSERT_REPORT_TYPE_HERE"); + codeExample.Run(new AdWordsUser(), reportType); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets report fields."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The report type to be run. + public void Run(AdWordsUser user, ReportDefinitionReportType reportType) { + // Get the ReportDefinitionService. + ReportDefinitionService reportDefinitionService = (ReportDefinitionService) user.GetService( + AdWordsService.v201406.ReportDefinitionService); + + try { + // Get the report fields. + ReportDefinitionField[] reportDefinitionFields = reportDefinitionService.getReportFields( + reportType); + if (reportDefinitionFields != null && reportDefinitionFields.Length > 0) { + // Display report fields. + Console.WriteLine("The report type '{0}' contains the following fields:", reportType); + + foreach (ReportDefinitionField reportDefinitionField in reportDefinitionFields) { + Console.Write("- {0} ({1})", reportDefinitionField.fieldName, + reportDefinitionField.fieldType); + if (reportDefinitionField.enumValues != null) { + Console.Write(" := [{0}]", String.Join(", ", reportDefinitionField.enumValues)); + } + Console.WriteLine(); + } + } else { + Console.WriteLine("This report type has no fields."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve fields for report type.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/ShoppingCampaigns/AddProductPartitionTree.cs b/examples/AdWords/CSharp/v201406/ShoppingCampaigns/AddProductPartitionTree.cs new file mode 100644 index 00000000000..3214b7e2db3 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/ShoppingCampaigns/AddProductPartitionTree.cs @@ -0,0 +1,313 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example creates a ProductPartition tree. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class AddProductPartitionTree : ExampleBase { + + /// + /// A helper class for creating ProductPartition trees. + /// + private class ProductPartitionHelper { + + /// + /// The ID of the AdGroup that we wish to attach the partition tree to. + /// + private long adGroupId; + + /// + /// The next temporary critertion ID to be used. + /// + /// When creating our tree we need to specify the parent-child + /// relationships between nodes. However, until a criterion has been + /// created on the server we do not have a criterionId with which to + /// refer to it. + /// + /// Instead we can specify temporary IDs that are specific to a single + /// mutate request. Once the criteria have been created they are assigned + /// an ID as normal and the temporary ID will no longer refer to it. + /// + /// A valid temporary ID is any negative integer. + /// + private long nextId = -1; + + /// + /// The set of mutate operations needed to create the current tree. + /// + private List operations = new List(); + + /// + /// Overloaded constructor. + /// + /// The ID of the AdGroup that we wish to attach + /// the partition tree to. + public ProductPartitionHelper(long adGroupId) { + this.adGroupId = adGroupId; + } + + public AdGroupCriterionOperation[] Operations { + get { + return operations.ToArray(); + } + } + + /// + /// Creates a subdivision node. + /// + /// The node that should be this node's parent. + /// + /// The value being paritioned on. + /// A new subdivision node. + public ProductPartition CreateSubdivision(ProductPartition parent, ProductDimension value) { + ProductPartition division = new ProductPartition(); + division.partitionType = ProductPartitionType.SUBDIVISION; + division.id = this.nextId--; + + // The root node has neither a parent nor a value. + if (parent != null) { + division.parentCriterionId = parent.id; + division.caseValue = value; + } + + BiddableAdGroupCriterion criterion = new BiddableAdGroupCriterion(); + criterion.adGroupId = this.adGroupId; + criterion.criterion = division; + + this.CreateAddOperation(criterion); + return division; + } + + /// + /// Creates the unit. + /// + /// The node that should be this node's parent. + /// + /// The value being paritioned on. + /// The amount to bid for matching products, + /// in micros. + /// True, if this is negative criterion, false + /// otherwise. + /// A new unit node. + public ProductPartition CreateUnit(ProductPartition parent, ProductDimension value, + long bidAmount, bool isNegative) { + ProductPartition unit = new ProductPartition(); + unit.partitionType = ProductPartitionType.UNIT; + + // The root node has neither a parent nor a value. + if (parent != null) { + unit.parentCriterionId = parent.id; + unit.caseValue = value; + } + + AdGroupCriterion criterion; + + if (isNegative) { + criterion = new NegativeAdGroupCriterion(); + } else { + BiddingStrategyConfiguration biddingStrategyConfiguration = + new BiddingStrategyConfiguration(); + + CpcBid cpcBid = new CpcBid(); + cpcBid.bid = new Money(); + cpcBid.bid.microAmount = bidAmount; + biddingStrategyConfiguration.bids = new Bids[] { cpcBid }; + + criterion = new BiddableAdGroupCriterion(); + (criterion as BiddableAdGroupCriterion).biddingStrategyConfiguration = + biddingStrategyConfiguration; + } + + criterion.adGroupId = this.adGroupId; + criterion.criterion = unit; + + this.CreateAddOperation(criterion); + + return unit; + } + + /// + /// Creates an AdGroupCriterionOperation for the given criterion + /// + /// The criterion we want to add + private void CreateAddOperation(AdGroupCriterion criterion) { + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.operand = criterion; + operation.@operator = Operator.ADD; + this.operations.Add(operation); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a ProductPartition tree."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddProductPartitionTree codeExample = new AddProductPartitionTree(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The ad group to which product partition is + /// added. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService( + AdWordsService.v201406.AdGroupCriterionService); + + ProductPartitionHelper helper = new ProductPartitionHelper(adGroupId); + + // The most trivial partition tree has only a unit node as the root: + // helper.createUnit(null, null, 100000); + + ProductPartition root = helper.CreateSubdivision(null, null); + + ProductCanonicalCondition newCondition = new ProductCanonicalCondition(); + newCondition.condition = ProductCanonicalConditionCondition.NEW; + ProductPartition newPartition = helper.CreateUnit(root, newCondition, 200000, false); + + ProductCanonicalCondition usedCondition = new ProductCanonicalCondition(); + usedCondition.condition = ProductCanonicalConditionCondition.USED; + ProductPartition usedPartition = helper.CreateUnit(root, usedCondition, 100000, false); + + ProductPartition otherCondition = helper.CreateSubdivision(root, + new ProductCanonicalCondition()); + + ProductBrand coolBrand = new ProductBrand(); + coolBrand.value = "CoolBrand"; + helper.CreateUnit(otherCondition, coolBrand, 900000, false); + + ProductBrand cheapBrand = new ProductBrand(); + cheapBrand.value = "CheapBrand"; + helper.CreateUnit(otherCondition, cheapBrand, 10000, false); + + ProductPartition otherBrand = + helper.CreateSubdivision(otherCondition, new ProductBrand()); + + // The value for the bidding category is a fixed ID for the 'Luggage & Bags' + // category. You can retrieve IDs for categories from the ConstantDataService. + // See the 'GetProductCategoryTaxonomy' example for more details. + + ProductBiddingCategory luggageAndBags = new ProductBiddingCategory(); + luggageAndBags.type = ProductDimensionType.BIDDING_CATEGORY_L1; + luggageAndBags.value = -5914235892932915235; + helper.CreateUnit(otherBrand, luggageAndBags, 750000, false); + + ProductBiddingCategory everythingElse = new ProductBiddingCategory(); + everythingElse.type = ProductDimensionType.BIDDING_CATEGORY_L1; + + helper.CreateUnit(otherBrand, everythingElse, 110000, false); + + try { + // Make the mutate request. + AdGroupCriterionReturnValue retval = adGroupCriterionService.mutate(helper.Operations); + + Dictionary> children = + new Dictionary>(); + ProductPartition rootNode = null; + // For each criterion, make an array containing each of its children + // We always create the parent before the child, so we can rely on that here. + foreach (AdGroupCriterion adGroupCriterion in retval.value) { + ProductPartition newCriterion = (ProductPartition) adGroupCriterion.criterion; + children[newCriterion.id] = new List(); + + if (newCriterion.parentCriterionIdSpecified) { + children[newCriterion.parentCriterionId].Add(newCriterion); + } else { + rootNode = (ProductPartition) adGroupCriterion.criterion; + } + } + + // Show the tree + StringWriter writer = new StringWriter(); + DisplayTree(rootNode, children, 0, writer); + Console.WriteLine(writer.ToString()); + + } catch (Exception ex) { + throw new System.ApplicationException("Failed to set shopping product partition.", ex); + } + } + + /// + /// Displays the product partition tree. + /// + /// The root node. + /// The child node. + /// The tree level. + /// The stream to write output to. + private void DisplayTree(ProductPartition node, Dictionary> children, int level, StringWriter writer) { + // Recursively display a node and each of its children. + object value = null; + string type = ""; + + if (node.caseValue != null) { + type = node.caseValue.ProductDimensionType; + switch (type) { + case "ProductCanonicalCondition": + value = (node.caseValue as ProductCanonicalCondition).condition.ToString(); + break; + + case "ProductBiddingCategory": + value = (node.caseValue as ProductBiddingCategory).type.ToString() + "(" + + (node.caseValue as ProductBiddingCategory).value + ")"; + break; + + default: + value = node.caseValue.GetType().GetProperty("value").GetValue(node.caseValue, null); + break; + } + } + + writer.WriteLine("{0}id: {1}, type: {2}, value: {3}", "".PadLeft(level, ' '), node.id, + type, value); + foreach (ProductPartition childNode in children[node.id]) { + DisplayTree(childNode, children, level + 1, writer); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/ShoppingCampaigns/AddProductScope.cs b/examples/AdWords/CSharp/v201406/ShoppingCampaigns/AddProductScope.cs new file mode 100644 index 00000000000..f5fbb39e07d --- /dev/null +++ b/examples/AdWords/CSharp/v201406/ShoppingCampaigns/AddProductScope.cs @@ -0,0 +1,127 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example restricts the products that will be included in the + /// campaign by setting a ProductScope. + /// + /// Tags: CampaignCriterionService.mutate + /// + public class AddProductScope : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example restricts the products that will be included in the campaign " + + "by setting a ProductScope."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddProductScope codeExample = new AddProductScope(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The campaign id to add product scope. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201406.CampaignCriterionService); + + ProductScope productScope = new ProductScope(); + // This set of dimensions is for demonstration purposes only. It would be + // extremely unlikely that you want to include so many dimensions in your + // product scope. + ProductBrand nexusBrand = new ProductBrand(); + nexusBrand.value = "Nexus"; + + ProductCanonicalCondition newProducts = new ProductCanonicalCondition(); + newProducts.condition = ProductCanonicalConditionCondition.NEW; + + ProductCustomAttribute customAttribute = new ProductCustomAttribute(); + customAttribute.type = ProductDimensionType.CUSTOM_ATTRIBUTE_0; + customAttribute.value = "my attribute value"; + + ProductOfferId bookOffer = new ProductOfferId(); + bookOffer.value = "book1"; + + ProductType mediaProducts = new ProductType(); + mediaProducts.type = ProductDimensionType.PRODUCT_TYPE_L1; + mediaProducts.value = "Media"; + + ProductType bookProducts = new ProductType(); + bookProducts.type = ProductDimensionType.PRODUCT_TYPE_L2; + bookProducts.value = "Books"; + + // The value for the bidding category is a fixed ID for the + // 'Luggage & Bags' category. You can retrieve IDs for categories from + // the ConstantDataService. See the 'GetProductCategoryTaxonomy' example + // for more details. + ProductBiddingCategory luggageBiddingCategory = new ProductBiddingCategory(); + luggageBiddingCategory.type = ProductDimensionType.BIDDING_CATEGORY_L1; + luggageBiddingCategory.value = -5914235892932915235; + + productScope.dimensions = new ProductDimension[] {nexusBrand, newProducts, bookOffer, + mediaProducts, luggageBiddingCategory}; + + CampaignCriterion campaignCriterion = new CampaignCriterion(); + campaignCriterion.campaignId = campaignId; + campaignCriterion.criterion = productScope; + + // Create operation. + CampaignCriterionOperation operation = new CampaignCriterionOperation(); + operation.operand = campaignCriterion; + operation.@operator = Operator.ADD; + + try { + // Make the mutate request. + CampaignCriterionReturnValue result = campaignCriterionService.mutate( + new CampaignCriterionOperation[] { operation }); + + Console.WriteLine("Created a ProductScope criterion with ID '{0}'", + result.value[0].criterion.id); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to set shopping product scope.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/ShoppingCampaigns/AddShoppingCampaign.cs b/examples/AdWords/CSharp/v201406/ShoppingCampaigns/AddShoppingCampaign.cs new file mode 100644 index 00000000000..443d04fe68b --- /dev/null +++ b/examples/AdWords/CSharp/v201406/ShoppingCampaigns/AddShoppingCampaign.cs @@ -0,0 +1,188 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example adds a Shopping campaign. + /// + /// Tags: CampaignService.mutate, AdGroupService.mutate + /// Tags: AdGroupAdService.mutate + /// + public class AddShoppingCampaign : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a Shopping campaign."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddShoppingCampaign codeExample = new AddShoppingCampaign(); + Console.WriteLine(codeExample.Description); + try { + long budgetId = long.Parse("INSERT_BUDGET_ID_HERE"); + long merchantId = long.Parse("INSERT_MERCHANT_ID_HERE"); + codeExample.Run(new AdWordsUser(), budgetId, merchantId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The budget id. + /// The Merchant Center account id. + public void Run(AdWordsUser user, long budgetId, long merchantId) { + // Get the required services. + CampaignService campaignService = (CampaignService) user.GetService( + AdWordsService.v201406.CampaignService); + AdGroupService adGroupService = (AdGroupService) user.GetService( + AdWordsService.v201406.AdGroupService); + AdGroupAdService adGroupAdService = (AdGroupAdService) user.GetService( + AdWordsService.v201406.AdGroupAdService); + + try { + Campaign campaign = CreateCampaign(budgetId, merchantId, campaignService); + Console.WriteLine("Campaign with name '{0}' and ID '{1}' was added.", campaign.name, + campaign.id); + + AdGroup adGroup = CreateAdGroup(adGroupService, campaign); + Console.WriteLine("Ad group with name '{0}' and ID '{1}' was added.", adGroup.name, + adGroup.id); + + AdGroupAd adGroupAd = CreateProductAd(adGroupAdService, adGroup); + Console.WriteLine("Product ad with ID {0}' was added.", adGroupAd.ad.id); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create shopping campaign.", ex); + } + } + + /// + /// Creates the Product Ad. + /// + /// The AdGroupAdService instance. + /// The ad group. + /// The Product Ad. + private static AdGroupAd CreateProductAd(AdGroupAdService adGroupAdService, AdGroup adGroup) { + // Create product ad. + ProductAd productAd = new ProductAd(); + + // Create ad group ad. + AdGroupAd adGroupAd = new AdGroupAd(); + adGroupAd.adGroupId = adGroup.id; + adGroupAd.ad = productAd; + + // Create operation. + AdGroupAdOperation operation = new AdGroupAdOperation(); + operation.operand = adGroupAd; + operation.@operator = Operator.ADD; + + // Make the mutate request. + AdGroupAdReturnValue retval = adGroupAdService.mutate( + new AdGroupAdOperation[] { operation }); + + return retval.value[0]; + } + + /// + /// Creates the ad group in a Shopping campaign. + /// + /// The AdGroupService instance. + /// The Shopping campaign. + /// The ad group. + private static AdGroup CreateAdGroup(AdGroupService adGroupService, Campaign campaign) { + // Create ad group. + AdGroup adGroup = new AdGroup(); + adGroup.campaignId = campaign.id; + adGroup.name = "Ad Group #" + ExampleUtilities.GetRandomString(); + + // Create operation. + AdGroupOperation operation = new AdGroupOperation(); + operation.operand = adGroup; + operation.@operator = Operator.ADD; + + // Make the mutate request. + AdGroupReturnValue retval = adGroupService.mutate(new AdGroupOperation[] { operation }); + return retval.value[0]; + } + + /// + /// Creates the shopping campaign. + /// + /// The budget id. + /// The Merchant Center id. + /// The CampaignService instance. + /// The Shopping campaign. + private static Campaign CreateCampaign(long budgetId, long merchantId, + CampaignService campaignService) { + // Create campaign. + Campaign campaign = new Campaign(); + campaign.name = "Shopping campaign #" + ExampleUtilities.GetRandomString(); + // The advertisingChannelType is what makes this a Shopping campaign. + campaign.advertisingChannelType = AdvertisingChannelType.SHOPPING; + + // Set shared budget (required). + campaign.budget = new Budget(); + campaign.budget.budgetId = budgetId; + + // Set bidding strategy (required). + BiddingStrategyConfiguration biddingStrategyConfiguration = + new BiddingStrategyConfiguration(); + biddingStrategyConfiguration.biddingStrategyType = BiddingStrategyType.MANUAL_CPC; + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration; + + // Set keyword matching setting (required). + KeywordMatchSetting keywordMatchSetting = new KeywordMatchSetting(); + keywordMatchSetting.optIn = false; + + // All Shopping campaigns need a ShoppingSetting. + ShoppingSetting shoppingSetting = new ShoppingSetting(); + shoppingSetting.salesCountry = "US"; + shoppingSetting.campaignPriority = 0; + shoppingSetting.merchantId = merchantId; + campaign.settings = new Setting[] { keywordMatchSetting, shoppingSetting }; + + // Create operation. + CampaignOperation campaignOperation = new CampaignOperation(); + campaignOperation.operand = campaign; + campaignOperation.@operator = Operator.ADD; + + // Make the mutate request. + CampaignReturnValue retval = campaignService.mutate( + new CampaignOperation[] { campaignOperation }); + + return retval.value[0]; + } + } +} diff --git a/examples/AdWords/CSharp/v201406/ShoppingCampaigns/GetProductCategoryTaxonomy.cs b/examples/AdWords/CSharp/v201406/ShoppingCampaigns/GetProductCategoryTaxonomy.cs new file mode 100644 index 00000000000..75388b1d714 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/ShoppingCampaigns/GetProductCategoryTaxonomy.cs @@ -0,0 +1,180 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example fetches the set of valid ProductBiddingCategories. + /// + /// Tags: ConstantDataService.getProductBiddingCategoryData + /// + public class GetProductCategoryTaxonomy : ExampleBase { + + /// + /// Stores details about a product category and its hierarchy. + /// + class ProductCategory { + /// + /// The product category id. + /// + long id; + + /// + /// The product category name. + /// + string name; + + /// + /// The product category children. + /// + List children; + + /// + /// Gets or sets the product category id. + /// + public long Id { + get { + return id; + } + set { + id = value; + } + } + + /// + /// Gets or sets the product category name. + /// + public string Name { + get { + return name; + } + set { + name = value; + } + } + + /// + /// Gets or sets the product category children. + /// + public List Children { + get { + return children; + } + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example fetches the set of valid ProductBiddingCategories."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetProductCategoryTaxonomy codeExample = new GetProductCategoryTaxonomy(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ConstantDataService. + ConstantDataService constantDataService = (ConstantDataService) user.GetService( + AdWordsService.v201406.ConstantDataService); + + Selector selector = new Selector(); + Predicate predicate = new Predicate(); + predicate.field = "Country"; + predicate.@operator = PredicateOperator.IN; + predicate.values = new string[] { "US" }; + + try { + ProductBiddingCategoryData[] results = + constantDataService.getProductBiddingCategoryData(selector); + + Dictionary biddingCategories = + new Dictionary(); + List rootCategories = new List(); + + foreach (ProductBiddingCategoryData productBiddingCategory in results) { + long id = productBiddingCategory.dimensionValue.value; + long parentId = 0; + string name = productBiddingCategory.displayValue[0].value; + + if (productBiddingCategory.parentDimensionValue != null) { + parentId = productBiddingCategory.parentDimensionValue.value; + } + + if (biddingCategories.ContainsKey(id)) { + biddingCategories.Add(id, new ProductCategory()); + } + + ProductCategory category = biddingCategories[id]; + + if (parentId != 0) { + if (biddingCategories.ContainsKey(parentId)) { + biddingCategories.Add(parentId, new ProductCategory()); + } + ProductCategory parent = biddingCategories[parentId]; + parent.Children.Add(category); + } else { + rootCategories.Add(category); + } + + category.Id = id; + category.Name = name; + } + + DisplayProductCategories(rootCategories, ""); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to set shopping product category.", ex); + } + } + + /// + /// Displays the product categories. + /// + /// The product categories. + /// The prefix for display purposes. + void DisplayProductCategories(List categories, string prefix) { + foreach (ProductCategory category in categories) { + Console.WriteLine("{0}{1} [{2}]", prefix, category.Name, category.Id); + DisplayProductCategories(category.Children, string.Format("{0}{1} > ", + prefix, category.Name)); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/ShoppingCampaigns/SetProductSalesChannel.cs b/examples/AdWords/CSharp/v201406/ShoppingCampaigns/SetProductSalesChannel.cs new file mode 100644 index 00000000000..ac1c3c2f1ac --- /dev/null +++ b/examples/AdWords/CSharp/v201406/ShoppingCampaigns/SetProductSalesChannel.cs @@ -0,0 +1,101 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + + /// + /// This code example sets the product sales channel. + /// + /// Tags: CampaignCriterionService.mutate + /// + public class SetProductSalesChannel : ExampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example sets the product sales channel."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SetProductSalesChannel codeExample = new SetProductSalesChannel(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign for which shopping channel + /// is set. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201406.CampaignCriterionService); + + // ProductSalesChannel is a fixed id criterion, with the possible values + // defined here. + // ONLINE: 200 + // LOCAL: 201 + ProductSalesChannel productSalesChannel = new ProductSalesChannel(); + productSalesChannel.id = 200; + + CampaignCriterion campaignCriterion = new CampaignCriterion(); + campaignCriterion.campaignId = campaignId; + campaignCriterion.criterion = productSalesChannel; + + // Create operation. + CampaignCriterionOperation operation = new CampaignCriterionOperation(); + operation.operand = campaignCriterion; + operation.@operator = Operator.ADD; + + try { + // Make the mutate request. + CampaignCriterionReturnValue retVal = campaignCriterionService.mutate( + new CampaignCriterionOperation[] { operation }); + + if (retVal != null && retVal.value != null) { + // Display campaign targets. + foreach (CampaignCriterion criterion in retVal.value) { + Console.WriteLine("Campaign criteria of type '{0}' was set to campaign with" + + " id = '{1}'.", criterion.criterion.CriterionType, criterion.campaignId); + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to set shopping product channel.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/Targeting/AddCampaignTargetingCriteria.cs b/examples/AdWords/CSharp/v201406/Targeting/AddCampaignTargetingCriteria.cs new file mode 100644 index 00000000000..12cad8abc82 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Targeting/AddCampaignTargetingCriteria.cs @@ -0,0 +1,199 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example adds various types of targeting criteria to a campaign. + /// To get a list of campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignCriterionService.mutate + /// + public class AddCampaignTargetingCriteria : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddCampaignTargetingCriteria codeExample = new AddCampaignTargetingCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds various types of targeting criteria to a campaign. To " + + "get a list of campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to which targeting criteria + /// are added. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201406.CampaignCriterionService); + + // Create language criteria. + // See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + // for a detailed list of language codes. + Language language1 = new Language(); + language1.id = 1002; // French + CampaignCriterion languageCriterion1 = new CampaignCriterion(); + languageCriterion1.campaignId = campaignId; + languageCriterion1.criterion = language1; + + Language language2 = new Language(); + language2.id = 1005; // Japanese + CampaignCriterion languageCriterion2 = new CampaignCriterion(); + languageCriterion2.campaignId = campaignId; + languageCriterion2.criterion = language2; + + // Target Tier 3 income group near Miami, Florida. + LocationGroups incomeLocationGroups = new LocationGroups(); + + IncomeOperand incomeOperand = new IncomeOperand(); + // Tiers are numbered 1-10, and represent 10% segments of earners. + // For example, TIER_1 is the top 10%, TIER_2 is the 80-90%, etc. + // Tiers 6 through 10 are grouped into TIER_6_TO_10. + incomeOperand.tier = IncomeTier.TIER_3; + + GeoTargetOperand geoTargetOperand1 = new GeoTargetOperand(); + geoTargetOperand1.locations = new long[] {1015116}; // Miami, FL. + + incomeLocationGroups.matchingFunction = new Function(); + incomeLocationGroups.matchingFunction.lhsOperand = + new FunctionArgumentOperand[] {incomeOperand}; + incomeLocationGroups.matchingFunction.@operator = FunctionOperator.AND; + incomeLocationGroups.matchingFunction.rhsOperand = + new FunctionArgumentOperand[] {geoTargetOperand1}; + + CampaignCriterion locationGroupCriterion1 = new CampaignCriterion(); + locationGroupCriterion1.campaignId = campaignId; + locationGroupCriterion1.criterion = incomeLocationGroups; + + // Target places of interest near Downtown Miami, Florida. + LocationGroups interestLocationGroups = new LocationGroups(); + + PlacesOfInterestOperand placesOfInterestOperand = new PlacesOfInterestOperand(); + placesOfInterestOperand.category = PlacesOfInterestOperandCategory.DOWNTOWN; + + GeoTargetOperand geoTargetOperand2 = new GeoTargetOperand(); + geoTargetOperand2.locations = new long[] { 1015116 }; // Miami, FL. + + interestLocationGroups.matchingFunction = new Function(); + interestLocationGroups.matchingFunction.lhsOperand = + new FunctionArgumentOperand[] {placesOfInterestOperand}; + interestLocationGroups.matchingFunction.@operator = FunctionOperator.AND; + interestLocationGroups.matchingFunction.rhsOperand = + new FunctionArgumentOperand[] {geoTargetOperand2}; + + CampaignCriterion locationGroupCriterion2 = new CampaignCriterion(); + locationGroupCriterion2.campaignId = campaignId; + locationGroupCriterion2.criterion = interestLocationGroups; + + // Distance targeting. Area of 10 miles around targets above. + ConstantOperand radius = new ConstantOperand(); + radius.type = ConstantOperandConstantType.DOUBLE; + radius.unit = ConstantOperandUnit.MILES; + radius.doubleValue = 10.0; + LocationExtensionOperand distance = new LocationExtensionOperand(); + distance.radius = radius; + + LocationGroups radiusLocationGroups = new LocationGroups(); + radiusLocationGroups.matchingFunction = new Function(); + radiusLocationGroups.matchingFunction.@operator = FunctionOperator.IDENTITY; + radiusLocationGroups.matchingFunction.lhsOperand = new FunctionArgumentOperand[] { distance }; + + CampaignCriterion locationGroupCriterion3 = new CampaignCriterion(); + locationGroupCriterion3.campaignId = campaignId; + locationGroupCriterion3.criterion = radiusLocationGroups; + + // Create location criteria. + // See http://code.google.com/apis/adwords/docs/appendix/countrycodes.html + // for a detailed list of country codes. + Location location1 = new Location(); + location1.id = 2840; // USA + CampaignCriterion locationCriterion1 = new CampaignCriterion(); + locationCriterion1.campaignId = campaignId; + locationCriterion1.criterion = location1; + + Location location2 = new Location(); + location2.id = 2392; // Japan + CampaignCriterion locationCriterion2 = new CampaignCriterion(); + locationCriterion2.campaignId = campaignId; + locationCriterion2.criterion = location2; + + // Add a negative campaign keyword. + NegativeCampaignCriterion negativeCriterion = new NegativeCampaignCriterion(); + negativeCriterion.campaignId = campaignId; + + Keyword keyword = new Keyword(); + keyword.matchType = KeywordMatchType.BROAD; + keyword.text = "jupiter cruise"; + + negativeCriterion.criterion = keyword; + + CampaignCriterion[] criteria = new CampaignCriterion[] {languageCriterion1, + languageCriterion2, locationCriterion1, locationCriterion2, negativeCriterion, + locationGroupCriterion1, locationGroupCriterion2, locationGroupCriterion3}; + + List operations = new List(); + + foreach (CampaignCriterion criterion in criteria) { + CampaignCriterionOperation operation = new CampaignCriterionOperation(); + operation.@operator = Operator.ADD; + operation.operand = criterion; + operations.Add(operation); + } + + try { + // Set the campaign targets. + CampaignCriterionReturnValue retVal = campaignCriterionService.mutate(operations.ToArray()); + + if (retVal != null && retVal.value != null) { + // Display campaign targets. + foreach (CampaignCriterion criterion in retVal.value) { + Console.WriteLine("Campaign criteria of type '{0}' was set to campaign with" + + " id = '{1}'.", criterion.criterion.CriterionType, criterion.campaignId); + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to set Campaign criteria.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/Targeting/GetCampaignTargetingCriteria.cs b/examples/AdWords/CSharp/v201406/Targeting/GetCampaignTargetingCriteria.cs new file mode 100644 index 00000000000..2c0ee05240d --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Targeting/GetCampaignTargetingCriteria.cs @@ -0,0 +1,119 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example gets all targeting criteria for a campaign. To set + /// campaign targeting criteria, run AddCampaignTargetingCriteria.cs. To get + /// campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignCriterionService.get + /// + public class GetCampaignTargetingCriteria : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetCampaignTargetingCriteria codeExample = new GetCampaignTargetingCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all targeting criteria for a campaign. To set campaign " + + "targeting criteria, run AddCampaignTargetingCriteria.cs. To get campaigns, run " + + "GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign from which targeting + /// criteria are retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201406.CampaignCriterionService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "CriteriaType", "CampaignId"}; + + // Set the filters. + Predicate predicate = new Predicate(); + predicate.field = "CampaignId"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] {campaignId.ToString()}; + + selector.predicates = new Predicate[] {predicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + CampaignCriterionPage page = new CampaignCriterionPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get all campaign targets. + page = campaignCriterionService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (CampaignCriterion campaignCriterion in page.entries) { + string negative = (campaignCriterion is NegativeCampaignCriterion) ? "Negative " : ""; + Console.WriteLine("{0}) {1}Campaign criterion with id = '{2}' and Type = {3} was " + + " found for campaign id '{4}'", i, negative, campaignCriterion.criterion.id, + campaignCriterion.criterion.type, campaignCriterion.campaignId); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of campaign targeting criteria found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get campaign targeting criteria.", ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/Targeting/GetTargetableLanguagesAndCarriers.cs b/examples/AdWords/CSharp/v201406/Targeting/GetTargetableLanguagesAndCarriers.cs new file mode 100644 index 00000000000..df51d7b7a5d --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Targeting/GetTargetableLanguagesAndCarriers.cs @@ -0,0 +1,99 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example illustrates how to retrieve all carriers and languages + /// available for targeting. + /// + /// Tags: ConstantDataService.getCarrierCriterion + /// Tags: ConstantDataService.getLanguageCriterion + /// + public class GetTargetableLanguagesAndCarriers : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetTargetableLanguagesAndCarriers codeExample = new GetTargetableLanguagesAndCarriers(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve all carriers and languages " + + "available for targeting."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ConstantDataService. + ConstantDataService constantDataService = (ConstantDataService) user.GetService( + AdWordsService.v201406.ConstantDataService); + + try { + // Get all carriers. + Carrier[] carriers = constantDataService.getCarrierCriterion(); + + // Display the results. + if (carriers != null) { + foreach (Carrier carrier in carriers) { + Console.WriteLine("Carrier name is '{0}', ID is {1} and country code is '{2}'.", + carrier.name, carrier.id, carrier.countryCode); + } + } else { + Console.WriteLine("No carriers were retrieved."); + } + + // Get all languages. + Language[] languages = constantDataService.getLanguageCriterion(); + + // Display the results. + if (languages != null) { + foreach (Language language in languages) { + Console.WriteLine("Language name is '{0}', ID is {1} and code is '{2}'.", + language.name, language.id, language.code); + } + } else { + Console.WriteLine("No languages were found."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get targetable carriers and languages.", + ex); + } + } + } +} diff --git a/examples/AdWords/CSharp/v201406/Targeting/LookupLocation.cs b/examples/AdWords/CSharp/v201406/Targeting/LookupLocation.cs new file mode 100644 index 00000000000..1659b5e1da1 --- /dev/null +++ b/examples/AdWords/CSharp/v201406/Targeting/LookupLocation.cs @@ -0,0 +1,121 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example gets location criteria by name. + /// + /// Tags: LocationCriterionService.get + /// + public class LookupLocation : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + LookupLocation codeExample = new LookupLocation(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets location criteria by name."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the LocationCriterionService. + LocationCriterionService locationCriterionService = + (LocationCriterionService) user.GetService(AdWordsService.v201406. + LocationCriterionService); + + string[] locationNames = new string[] {"Paris", "Quebec", "Spain", "Deutschland"}; + + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "LocationName", "CanonicalName", "DisplayType", + "ParentLocations", "Reach", "TargetingStatus"}; + + // Location names must match exactly, only EQUALS and IN are supported. + Predicate predicate1 = new Predicate(); + predicate1.field = "LocationName"; + predicate1.@operator = PredicateOperator.IN; + predicate1.values = locationNames; + + // Set the locale of the returned location names. + Predicate predicate2 = new Predicate(); + predicate2.field = "Locale"; + predicate2.@operator = PredicateOperator.EQUALS; + predicate2.values = new string[] {"en"}; + + selector.predicates = new Predicate[] {predicate1, predicate2}; + + try { + // Make the get request. + LocationCriterion[] locationCriteria = locationCriterionService.get(selector); + + // Display the resulting location criteria. + foreach (LocationCriterion locationCriterion in locationCriteria) { + string parentLocations = ""; + if (locationCriterion.location != null && + locationCriterion.location.parentLocations != null) { + foreach (Location location in locationCriterion.location.parentLocations) { + parentLocations += GetLocationString(location) + ", "; + } + parentLocations.TrimEnd(',', ' '); + } else { + parentLocations = "N/A"; + } + Console.WriteLine("The search term '{0}' returned the location '{1}' of type '{2}' " + + "with parent locations '{3}', reach '{4}' and targeting status '{5}.", + locationCriterion.searchTerm, locationCriterion.location.locationName, + locationCriterion.location.displayType, parentLocations, locationCriterion.reach, + locationCriterion.location.targetingStatus); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get location criteria.", ex); + } + } + + /// + /// Gets a string representation for a location. + /// + /// The location + /// The string representation + public string GetLocationString(Location location) { + return string.Format("{0} ({1})", location.locationName, location.displayType); + } + } +} diff --git a/examples/AdWords/Vb/AdWords.Examples.VB.vbproj b/examples/AdWords/Vb/AdWords.Examples.VB.vbproj new file mode 100644 index 00000000000..7b13953257f --- /dev/null +++ b/examples/AdWords/Vb/AdWords.Examples.VB.vbproj @@ -0,0 +1,272 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {A4AE3724-C225-4F03-AC77-A71C1330D8DD} + Exe + Google.Api.Ads.AdWords.Examples.VB.Program + + + Google.AdWords.Examples.VB + 512 + Console + v4.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + AnyCPU + + + pdbonly + false + true + true + bin\Release\ + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + + + + + + + + + + + + + + + + + + + {277404DB-A439-4450-B3A5-186294CDF245} + Common + + + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745} + AdWords + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/AdWords/Vb/App.config b/examples/AdWords/Vb/App.config new file mode 100644 index 00000000000..1ee298baf62 --- /dev/null +++ b/examples/AdWords/Vb/App.config @@ -0,0 +1,192 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/AdWords/Vb/ExampleBase.vb b/examples/AdWords/Vb/ExampleBase.vb new file mode 100644 index 00000000000..bf0c13adad9 --- /dev/null +++ b/examples/AdWords/Vb/ExampleBase.vb @@ -0,0 +1,33 @@ +' Copyright 2011, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB + ''' + ''' This abstract class represents a code example. + ''' + Public MustInherit Class ExampleBase + ''' + ''' Returns a description about the code example. + ''' + Public MustOverride ReadOnly Property Description() As String + End Class +End Namespace diff --git a/examples/AdWords/Vb/ExampleUtilities.vb b/examples/AdWords/Vb/ExampleUtilities.vb new file mode 100644 index 00000000000..8f50ac531e1 --- /dev/null +++ b/examples/AdWords/Vb/ExampleUtilities.vb @@ -0,0 +1,109 @@ +' Copyright 2011, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports System +Imports System.Collections.Generic +Imports System.Reflection + +Namespace Google.Api.Ads.AdWords.Examples.VB + ''' + ''' Utility class for assisting in running code examples. + ''' + Public Class ExampleUtilities + ''' + ''' Gets the current user's home directory. + ''' + ''' The current user's home directory. + Public Shared Function GetHomeDir() As String + Return Environment.GetEnvironmentVariable("USERPROFILE") + End Function + + ''' + ''' Gets a random string. Used for generating unique strings for use with + ''' AdGroups, Campaigns, etc. + ''' + ''' The random string. + Public Shared Function GetRandomString() As String + Return String.Format("{0} - {1}", Guid.NewGuid, _ + DateTime.Now.ToString("yyyy-M-d H-m-s.ffffff")) + End Function + + ''' + ''' Gets the user inputs for running a code example in command line mode. + ''' + ''' The parameter names. + ''' A dictionary, with key as parameter name and value as + ''' parameter value. + Public Shared Function GetUserInputs(ByVal paramNames As String()) As _ + Dictionary(Of String, String) + Dim parameters As New Dictionary(Of String, String) + Dim paramName As String + For Each paramName In paramNames + Console.Write("Enter {0}: ", paramName) + parameters.Item(paramName) = Console.ReadLine + Next + Return parameters + End Function + + ''' + ''' Formats the exception as a printable message. + ''' + ''' The exception. + ''' The formatted exception string. + Public Shared Function FormatException(ByVal ex As Exception) As String + Dim messages As New List(Of String) + Dim rootEx As Exception = ex + Do While (Not rootEx Is Nothing) + messages.Add(String.Format("{0} ({1})\n\n{2}\n", rootEx.GetType.ToString, _ + rootEx.Message, rootEx.StackTrace)) + rootEx = rootEx.InnerException + Loop + Return String.Join("\nCaused by\n\n", messages.ToArray) + End Function + + ''' + ''' Gets the parameters required to run the code example. + ''' + ''' The method info for the code example's Run + ''' method. + ''' The list of parameters. + Public Shared Function GetParameters(ByVal methodInfo As MethodInfo) As List(Of Object) + Dim retval As New List(Of Object) + Dim paramInfos As ParameterInfo() = methodInfo.GetParameters + Dim i As Integer + For i = 1 To paramInfos.Length - 1 + Dim paramInfo As ParameterInfo = paramInfos(i) + Console.Write("Enter {0}: ", paramInfo.Name) + Dim value As String = Console.ReadLine + Dim objValue As Object = Nothing + If (paramInfo.ParameterType Is GetType(Long)) Then + objValue = Long.Parse(value) + ElseIf (paramInfo.ParameterType Is GetType(Double)) Then + objValue = Double.Parse(value) + ElseIf (paramInfo.ParameterType Is GetType(String)) Then + objValue = value + ElseIf (paramInfo.ParameterType.IsEnum) Then + objValue = [Enum].Parse(paramInfo.ParameterType, value) + Else + Throw New ApplicationException(("Unknown parameter type : " & _ + paramInfo.ParameterType.FullName)) + End If + retval.Add(objValue) + Next i + Return retval + End Function + End Class +End Namespace diff --git a/examples/AdWords/Vb/Program.vb b/examples/AdWords/Vb/Program.vb new file mode 100644 index 00000000000..2bcacbb1e63 --- /dev/null +++ b/examples/AdWords/Vb/Program.vb @@ -0,0 +1,169 @@ +' Copyright 2011, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Net +Imports System.Reflection + +Namespace Google.Api.Ads.AdWords.Examples.VB + ''' + ''' The Main class for this application. + ''' + Class Program + ''' + ''' A flag to keep track of whether help message was shown earlier. + ''' + Private Shared helpShown As Boolean = False + + ''' + ''' A map to hold the code examples to be executed. + ''' + Private Shared codeExampleMap As List(Of KeyValuePair(Of String, ExampleBase)) = _ + New List(Of KeyValuePair(Of String, ExampleBase)) + + ''' + ''' Registers the code example. + ''' + ''' The code example name. + ''' The code example instance. + Private Shared Sub RegisterCodeExample(ByVal key As String, ByVal value As ExampleBase) + codeExampleMap.Add(New KeyValuePair(Of String, ExampleBase)(key, value)) + End Sub + + ''' + ''' Static constructor to initialize the code example map. + ''' + Shared Sub New() + Dim types As Type() = Assembly.GetExecutingAssembly.GetTypes + For Each type As Type In types + If (type.BaseType Is GetType(ExampleBase)) Then + RegisterCodeExample(type.FullName.Replace((GetType(Program).Namespace & "."), ""), _ + TryCast(Activator.CreateInstance(type), ExampleBase)) + End If + Next + End Sub + + ''' + ''' The main method. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + If (args.Length = 0) Then + ShowUsage() + Else + Dim user As New AdWordsUser + + For Each cmdArgs As String In args + Dim found As Boolean = False + For Each pair As KeyValuePair(Of String, ExampleBase) In codeExampleMap + If String.Compare(pair.Key, cmdArgs, True) = 0 Then + found = True + RunACodeExample(user, pair.Value) + Exit For + End If + Next + If (Not found) Then + ShowUsage() + End If + Next + End If + End Sub + + ''' + ''' Invokes the Run method of code example. + ''' + ''' The code example. + ''' The user. + Private Shared Sub InvokeRun(ByVal codeExample As Object, ByVal user As AdWordsUser) + codeExample.GetType.GetMethod("Run").Invoke(codeExample, GetParameters(user, codeExample)) + End Sub + + ''' + ''' Gets the description of the code example. + ''' + ''' The code example. + ''' The description + Private Shared Function GetDescription(ByVal codeExample As Object) As Object + Return codeExample.GetType.GetProperty("Description").GetValue(codeExample, Nothing) + End Function + + ''' + ''' Gets the parameters for running a code example. + ''' + ''' The user. + ''' The code example. + ''' The list of parameters. + Private Shared Function GetParameters(ByVal user As AdWordsUser, ByVal codeExample As Object) _ + As Object() + Dim methodInfo As MethodInfo = codeExample.GetType.GetMethod("Run") + Dim parameters As New List(Of Object) + parameters.Add(user) + parameters.AddRange(ExampleUtilities.GetParameters(methodInfo)) + Return parameters.ToArray + End Function + + ''' + ''' Runs a code example. + ''' + ''' The user whose credentials should be used for + ''' running the code example. + ''' The code example to run. + Private Shared Sub RunACodeExample(ByVal user As AdWordsUser, ByVal codeExample As Object) + Try + Console.WriteLine(GetDescription(codeExample)) + Program.InvokeRun(codeExample, user) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + Finally + Console.WriteLine("Press [Enter] to continue") + Console.ReadLine() + End Try + End Sub + + ''' + ''' Prints program usage message. + ''' + Private Shared Sub ShowUsage() + If Not helpShown Then + helpShown = True + Dim exeName As String = Path.GetFileName(Assembly.GetExecutingAssembly.Location) + + Console.WriteLine("Runs AdWords API code examples") + Console.WriteLine("Usage : {0} [flags]\n", exeName) + Console.WriteLine("Available flags\n") + Console.WriteLine("--help\t\t : Prints this help message.", exeName) + Console.WriteLine("--all\t\t : Run all code examples.", exeName) + Console.WriteLine("--v13all: Runs all v13 code examples.") + Console.WriteLine("--v201008all: Runs all v201008 code examples.") + + Console.WriteLine("\nexamplename1 [examplename1 ...] : Run specific code examples. " & _ + "Example name can be one of the following:", exeName) + + For Each pair As KeyValuePair(Of String, ExampleBase) In codeExampleMap + Console.WriteLine("{0} : {1}", pair.Key, pair.Value.Description) + Next + + Console.WriteLine("Press [Enter] to continue") + Console.ReadLine() + End If + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/Properties/AssemblyInfo.vb b/examples/AdWords/Vb/Properties/AssemblyInfo.vb new file mode 100644 index 00000000000..d41f2f60f15 --- /dev/null +++ b/examples/AdWords/Vb/Properties/AssemblyInfo.vb @@ -0,0 +1,44 @@ +' Copyright 2011, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' General Information about an assembly is controlled through the following +' set of attributes. Change these attribute values to modify the information +' associated with an assembly. + + + + + + +' Setting ComVisible to false makes the types in this assembly not visible +' to COM components. If you need to access a type in this assembly from +' COM, set the ComVisible attribute to true on that type. + + +' The following GUID is for the ID of the typelib if this project is exposed to COM + + + + + + + + diff --git a/examples/AdWords/Vb/v201309/AccountManagement/CreateAccount.vb b/examples/AdWords/Vb/v201309/AccountManagement/CreateAccount.vb new file mode 100644 index 00000000000..5d63dacb4b7 --- /dev/null +++ b/examples/AdWords/Vb/v201309/AccountManagement/CreateAccount.vb @@ -0,0 +1,189 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Text + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example illustrates how to create an account. Note by default, + ''' this account will only be accessible via its parent MCC. + ''' + ''' Tags: ManagedCustomerService.mutate + ''' + Public Class CreateAccount + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New CreateAccount + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to create an account. Note by default," & _ + " this account will only be accessible via its parent MCC." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the ManagedCustomerService. + Dim managedCustomerService As ManagedCustomerService = user.GetService( _ + AdWordsService.v201309.ManagedCustomerService) + + ' Create account. + Dim customer As New ManagedCustomer() + customer.name = "Customer created with ManagedCustomerService on " & _ + New DateTime().ToString() + customer.currencyCode = "EUR" + customer.dateTimeZone = "Europe/London" + + ' Create operations. + Dim operation As New ManagedCustomerOperation() + operation.operand = customer + operation.operator = [Operator].ADD + Try + Dim operations As ManagedCustomerOperation() = New ManagedCustomerOperation() {operation} + ' Add account. + Dim result As ManagedCustomerReturnValue = managedCustomerService.mutate(operations) + + ' Display accounts. + If (Not result.value Is Nothing) AndAlso (result.value.Length > 0) Then + Dim customerResult As ManagedCustomer = result.value(0) + Console.WriteLine("Account with customer ID '{0}' was created.", _ + customerResult.customerId) + Else + Console.WriteLine("No accounts were created.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create accounts.", ex) + End Try + End Sub + End Class + + + ''' + '''Example implementation of a node that would exist in an account tree. + ''' + Class ManagedCustomerTreeNode + ''' + ''' The parent node. + ''' + Private _parentNode As ManagedCustomerTreeNode + + ''' + ''' The account associated with this node. + ''' + Private _account As ManagedCustomer + + ''' + ''' The list of child accounts. + ''' + Private _childAccounts As New List(Of ManagedCustomerTreeNode) + + ''' + ''' Gets or sets the parent node. + ''' + Public Property ParentNode() As ManagedCustomerTreeNode + Get + Return _parentNode + End Get + Set(ByVal value As ManagedCustomerTreeNode) + _parentNode = value + End Set + End Property + + + ''' + ''' Gets or sets the account. + ''' + Public Property Account() As ManagedCustomer + Get + Return _account + End Get + Set(ByVal value As ManagedCustomer) + _account = value + End Set + End Property + + ''' + ''' Gets or sets the child accounts. + ''' + Public Property ChildAccounts() As List(Of ManagedCustomerTreeNode) + Get + Return _childAccounts + End Get + Set(ByVal value As List(Of ManagedCustomerTreeNode)) + _childAccounts = value + End Set + End Property + + ''' + ''' Returns a that represents this instance. + ''' + ''' + ''' A that represents this instance. + ''' + Public Overrides Function ToString() As String + Dim login As String = "(no login)" + If (Not String.IsNullOrEmpty(_account.login)) Then + login = _account.login + End If + Return String.Format("{0}, {1}, {2}", login, _account.customerId, _account.name) + End Function + + ''' + ''' Returns a string representation of the current level of the tree and + ''' recursively returns the string representation of the levels below it. + ''' + ''' The depth of the node. + ''' The String Builder containing the tree + ''' representation. + ''' The tree string representation. + Public Function ToTreeString(ByVal depth As Integer, ByVal sb As StringBuilder) As StringBuilder + For i As Integer = 0 To depth * 2 + sb.Append("-") + Next + sb.Append(Me) + sb.Append("\n") + For Each childAccount As ManagedCustomerTreeNode In _childAccounts + childAccount.ToTreeString(depth + 1, sb) + Next + Return sb + End Function + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/AccountManagement/GetAccountAlerts.vb b/examples/AdWords/Vb/v201309/AccountManagement/GetAccountAlerts.vb new file mode 100644 index 00000000000..3c6cce0df4c --- /dev/null +++ b/examples/AdWords/Vb/v201309/AccountManagement/GetAccountAlerts.vb @@ -0,0 +1,126 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example gets all alerts for all clients of an MCC account. + ''' The effective user (ClientCustomerId or AuthToken) must be an MCC user + ''' to get results. This code example won't work with Test Accounts. See + ''' https://developers.google.com/adwords/api/docs/test-accounts. + ''' + ''' Tags: AlertService.get + ''' + Public Class GetAccountAlerts + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAccountAlerts + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all alerts for all clients of an MCC account. The " & _ + "effective user (ClientCustomerId or AuthToken) must be an MCC user to get " & _ + "results. This code example won't work with Test Accounts. See " & _ + "https://developers.google.com/adwords/api/docs/test-accounts" + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the AlertService. + Dim alertService As AlertService = user.GetService(AdWordsService.v201309.AlertService) + + ' Create the selector. + Dim selector As New AlertSelector + + ' Create the alert query. + Dim query As New AlertQuery + query.filterSpec = FilterSpec.ALL + query.clientSpec = ClientSpec.ALL + query.triggerTimeSpec = TriggerTimeSpec.ALL_TIME + query.severities = New AlertSeverity() {AlertSeverity.GREEN, AlertSeverity.YELLOW, _ + AlertSeverity.RED} + + ' Enter all possible values of AlertType to get all alerts. If you are + ' interested only in specific alert types, then you may also do it as + ' follows: + ' query.types = new AlertType() {AlertType.CAMPAIGN_ENDING, + ' AlertType.CAMPAIGN_ENDED} + query.types = [Enum].GetValues(GetType(AlertType)) + selector.query = query + + ' Set paging for selector. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AlertPage + + Try + Do + ' Get account alerts. + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + page = alertService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each alert As Alert In page.entries + Console.WriteLine("{0}) Customer Id is {1:###-###-####}, Alert type is '{2}', " & _ + "Severity is {3}", (i + 1), alert.clientCustomerId, alert.alertType, _ + alert.alertSeverity) + For j As Integer = 0 To alert.details.Length - 1 + Console.WriteLine(" - Triggered at {0}", alert.details(j).triggerTime) + Next j + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of alerts found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve alerts.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/AccountManagement/GetAccountChanges.vb b/examples/AdWords/Vb/v201309/AccountManagement/GetAccountChanges.vb new file mode 100644 index 00000000000..f8dc457353b --- /dev/null +++ b/examples/AdWords/Vb/v201309/AccountManagement/GetAccountChanges.vb @@ -0,0 +1,183 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Text + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example gets the changes in the account during the last 24 + ''' hours. + ''' + ''' Tags: CustomerSyncService.get + ''' + Public Class GetAccountChanges + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAccountChanges + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets the changes in the account during the last 24 hours." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the CustomerSyncService. + Dim customerSyncService As CustomerSyncService = user.GetService( _ + AdWordsService.v201309.CustomerSyncService) + + ' The date time string should be of the form yyyyMMdd HHmmss zzz. + Dim minDateTime As String = (DateTime.Now.AddDays(-1).ToUniversalTime.ToString( _ + "yyyyMMdd HHmmss") & " UTC") + Dim maxDateTime As String = (DateTime.Now.ToUniversalTime.ToString("yyyyMMdd HHmmss") & _ + " UTC") + + ' Create date time range. + Dim dateTimeRange As New DateTimeRange + dateTimeRange.min = minDateTime + dateTimeRange.max = maxDateTime + + Try + ' Create the selector. + Dim selector As New CustomerSyncSelector + selector.dateTimeRange = dateTimeRange + selector.campaignIds = GetAllCampaignIds(user) + + ' Get all account changes for campaign. + Dim accountChanges As CustomerChangeData = customerSyncService.get(selector) + + ' Display the changes. + If ((Not accountChanges Is Nothing) AndAlso _ + (Not accountChanges.changedCampaigns Is Nothing)) Then + Console.WriteLine("Displaying changes up to: {0}", accountChanges.lastChangeTimestamp) + + For Each campaignChanges As CampaignChangeData In accountChanges.changedCampaigns + Console.WriteLine("Campaign with id ""{0}"" was changed:", campaignChanges.campaignId) + Console.WriteLine(" Campaign changed status: {0}", _ + campaignChanges.campaignChangeStatus) + If (campaignChanges.campaignChangeStatus <> ChangeStatus.NEW) Then + Console.WriteLine(" Added ad extensions: {0}", _ + GetFormattedList(campaignChanges.addedAdExtensions)) + Console.WriteLine(" Added campaign criteria: {0}", _ + GetFormattedList(campaignChanges.addedCampaignCriteria)) + If (campaignChanges.campaignTargetingChanged) Then + Console.WriteLine(" Added campaign targeting: yes") + Else + Console.WriteLine(" Added campaign targeting: no") + End If + + Console.WriteLine(" Deleted ad extensions: {0}", _ + GetFormattedList(campaignChanges.deletedAdExtensions)) + Console.WriteLine(" Deleted campaign criteria: {0}", _ + GetFormattedList(campaignChanges.deletedCampaignCriteria)) + + If (Not campaignChanges.changedAdGroups Is Nothing) Then + For Each adGroupChanges As AdGroupChangeData In campaignChanges.changedAdGroups + Console.WriteLine(" Ad group with id ""{0}"" was changed:", _ + adGroupChanges.adGroupId) + Console.WriteLine(" Ad group changed status: {0}", _ + adGroupChanges.adGroupChangeStatus) + If (adGroupChanges.adGroupChangeStatus <> ChangeStatus.NEW) Then + Console.WriteLine(" Ads changed: {0}", _ + GetFormattedList(adGroupChanges.changedAds)) + Console.WriteLine(" Criteria changed: {0}", _ + GetFormattedList(adGroupChanges.changedCriteria)) + Console.WriteLine(" Criteria deleted: {0}", _ + GetFormattedList(adGroupChanges.deletedCriteria)) + End If + Next + End If + End If + Console.WriteLine() + Next + Else + Console.WriteLine("No account changes were found.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to get account changes.", ex) + End Try + End Sub + + ''' + ''' Formats a list of ids as a comma separated string. + ''' + ''' The list of ids. + ''' The comma separed formatted string, enclosed in square braces. + ''' + Private Function GetFormattedList(ByVal ids As Long()) As String + Dim builder As New StringBuilder + If (Not ids Is Nothing) Then + For Each id As Long In ids + builder.AppendFormat("{0}, ", id) + Next + End If + Return ("[" & builder.ToString.TrimEnd(New Char() {","c, " "c}) & "]") + End Function + + ''' + ''' Gets all campaign ids in the account. + ''' + ''' The user for which campaigns are retrieved. + ''' The list of campaign ids. + Private Function GetAllCampaignIds(ByVal user As AdWordsUser) As Long() + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201309.CampaignService) + + Dim allCampaigns As New List(Of Long) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id"} + + ' Get all campaigns. + Dim page As CampaignPage = campaignService.get(selector) + + ' Return the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + For Each campaign As Campaign In page.entries + allCampaigns.Add(campaign.id) + Next + End If + Return allCampaigns.ToArray + End Function + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/AccountManagement/GetAccountHierarchy.vb b/examples/AdWords/Vb/v201309/AccountManagement/GetAccountHierarchy.vb new file mode 100644 index 00000000000..282ba26bc3e --- /dev/null +++ b/examples/AdWords/Vb/v201309/AccountManagement/GetAccountHierarchy.vb @@ -0,0 +1,126 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Text + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example illustrates how to retrieve the account hierarchy under + ''' an account. This code example won't work with Test Accounts. See + ''' https://developers.google.com/adwords/api/docs/test-accounts + ''' + ''' Tags: ServicedAccountService.get + ''' + Public Class GetAccountHierarchy + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAccountHierarchy + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to retrieve the account hierarchy under " & _ + "an account. This code example won't work with Test Accounts. See " & _ + "https://developers.google.com/adwords/api/docs/test-accounts" + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the ManagedCustomerService. + Dim mcService As ManagedCustomerService = user.GetService( _ + AdWordsService.v201309.ManagedCustomerService) + mcService.RequestHeader.clientCustomerId = Nothing + + ' Create selector. + Dim selector As New Selector() + selector.fields = New String() {"Login", "CustomerId", "Name"} + + Try + ' Get results. + Dim page As ManagedCustomerPage = mcService.get(selector) + + ' Display serviced account graph. + If Not page.entries Is Nothing Then + ' Create map from customerId to customer node. + Dim customerIdToCustomerNode As Dictionary(Of Long, ManagedCustomerTreeNode) = _ + New Dictionary(Of Long, ManagedCustomerTreeNode)() + + ' Create account tree nodes for each customer. + For Each customer As ManagedCustomer In page.entries + Dim node As New ManagedCustomerTreeNode() + node.Account = customer + customerIdToCustomerNode.Add(customer.customerId, node) + Next + + ' For each link, connect nodes in tree. + If (Not page.links Is Nothing) Then + For Each link As ManagedCustomerLink In page.links + Dim managerNode As ManagedCustomerTreeNode = _ + customerIdToCustomerNode(link.managerCustomerId) + Dim childNode As ManagedCustomerTreeNode = _ + customerIdToCustomerNode(link.clientCustomerId) + childNode.ParentNode = managerNode + If (Not managerNode Is Nothing) Then + managerNode.ChildAccounts.Add(childNode) + End If + Next + End If + + ' Find the root account node in the tree. + Dim rootNode As ManagedCustomerTreeNode = Nothing + For Each account As ManagedCustomer In page.entries + If (customerIdToCustomerNode(account.customerId).ParentNode Is Nothing) Then + rootNode = customerIdToCustomerNode(account.customerId) + Exit For + End If + Next + + ' Display account tree. + Console.WriteLine("Login, CustomerId, Name") + Console.WriteLine(rootNode.ToTreeString(0, New StringBuilder())) + Else + Console.WriteLine("No accounts were found.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to get accounts.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/AdvancedOperations/AddAdGroupBidModifier.vb b/examples/AdWords/Vb/v201309/AdvancedOperations/AddAdGroupBidModifier.vb new file mode 100644 index 00000000000..ceaeb70039d --- /dev/null +++ b/examples/AdWords/Vb/v201309/AdvancedOperations/AddAdGroupBidModifier.vb @@ -0,0 +1,111 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: thagikura@gmail.com (Takeshi Hagikura) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example illustrates how to add ad group level mobile bid + ''' modifier override. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class AddAdGroupBidModifier + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAdGroupBidModifier + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim bidModifier As Double = Double.Parse("INSERT_ADGROUP_BID_MODIFIER_HERE") + codeExample.Run(New AdWordsUser, adGroupId, bidModifier) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to add ad group level mobile bid" & _ + " modifier override." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the adgroup for which bid modifier is + ''' set. + ''' The mobile bid modifier for adgroup + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal bidModifier As Double) + ' Get the AdGroupBidModifierService. + Dim adGroupBidModifierService As AdGroupBidModifierService = user.GetService( _ + AdWordsService.v201309.AdGroupBidModifierService) + + ' Mobile criterion ID. + Dim criterionId As Long = 30001 + + ' Create the adgroup bid modifier. + Dim adGroupBidModifier As New AdGroupBidModifier() + adGroupBidModifier.bidModifier = bidModifier + adGroupBidModifier.adGroupId = adGroupId + + Dim platform As New Platform() + platform.id = criterionId + + adGroupBidModifier.criterion = platform + + Dim operation As New AdGroupBidModifierOperation() + operation.operator = [Operator].ADD + operation.operand = adGroupBidModifier + + Try + ' Add ad group level mobile bid modifier. + Dim retval As AdGroupBidModifierReturnValue = adGroupBidModifierService.mutate( _ + New AdGroupBidModifierOperation() {operation}) + + ' Display the results. + If Not retval Is Nothing AndAlso Not retval.value Is Nothing AndAlso _ + retval.value.Length > 0 Then + Dim newBidModifier As AdGroupBidModifier = retval.value(0) + Console.WriteLine("AdGroup ID {1}, Criterion ID {2} was updated with ad group " & _ + "level modifier: {3}", newBidModifier.adGroupId, newBidModifier.criterion.id, _ + newBidModifier.bidModifier) + Else + Console.WriteLine("No bid modifiers were added to the adgroup.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add bid modifiers to adgroup.", ex) + End Try + End Sub + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201309/AdvancedOperations/AddClickToDownloadAd.vb b/examples/AdWords/Vb/v201309/AdvancedOperations/AddClickToDownloadAd.vb new file mode 100644 index 00000000000..86d5e42f90d --- /dev/null +++ b/examples/AdWords/Vb/v201309/AdvancedOperations/AddClickToDownloadAd.vb @@ -0,0 +1,149 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: thagikura@gmail.com (Takeshi Hagikura) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example creates a click-to-download ad, also known as an + ''' app promotion ad to a given ad group. To list ad groups, run + ''' GetAdGroups.vb. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class AddClickToDownloadAd + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddClickToDownloadAd + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example creates a click-to-download ad, also known as an app " & _ + "promotion ad to a given ad group. To list ad groups, run GetAdGroups.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which ads are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim adGroupAdService As AdGroupAdService = _ + user.GetService(AdWordsService.v201309.AdGroupAdService) + + ' Create the template ad. + Dim clickToDownloadAppAd As New TemplateAd() + + clickToDownloadAppAd.name = "Ad for demo game" + clickToDownloadAppAd.templateId = 353 + clickToDownloadAppAd.url = _ + "http://play.google.com/store/apps/details?id=com.example.demogame" + clickToDownloadAppAd.displayUrl = "play.google.com" + + ' Create the template elements for the ad. You can refer to + ' https://developers.google.com/adwords/api/docs/appendix/templateads + ' for the list of avaliable template fields. + Dim headline As New TemplateElementField() + headline.name = "headline" + headline.fieldText = "Enjoy your drive in Mars" + headline.type = TemplateElementFieldType.TEXT + + Dim description1 As New TemplateElementField() + description1.name = "description1" + description1.fieldText = "Realistic physics simulation" + description1.type = TemplateElementFieldType.TEXT + + Dim description2 As New TemplateElementField() + description2.name = "description2" + description2.fieldText = "Race against players online" + description2.type = TemplateElementFieldType.TEXT + + Dim appId As New TemplateElementField() + appId.name = "appId" + appId.fieldText = "com.example.demogame" + appId.type = TemplateElementFieldType.TEXT + + Dim appStore As New TemplateElementField() + appStore.name = "appStore" + appStore.fieldText = "2" + appStore.type = TemplateElementFieldType.ENUM + + Dim adData As New TemplateElement() + adData.uniqueName = "adData" + adData.fields = New TemplateElementField() {headline, description1, description2, appId, _ + appStore} + + clickToDownloadAppAd.templateElements = New TemplateElement() {adData} + + ' Create the adgroupad. + Dim clickToDownloadAppAdGroupAd As New AdGroupAd() + clickToDownloadAppAdGroupAd.adGroupId = adGroupId + clickToDownloadAppAdGroupAd.ad = clickToDownloadAppAd + + ' Optional: Set the status. + clickToDownloadAppAdGroupAd.status = AdGroupAdStatus.PAUSED + + ' Create the operation. + Dim operation As New AdGroupAdOperation() + operation.operator = [Operator].ADD + operation.operand = clickToDownloadAppAdGroupAd + + Try + ' Create the ads. + Dim retval As AdGroupAdReturnValue = adGroupAdService.mutate(New AdGroupAdOperation() _ + {operation}) + + ' Display the results. + If Not retval Is Nothing AndAlso Not retval.value Is Nothing Then + For Each adGroupAd As AdGroupAd In retval.value + Console.WriteLine("New click-to-download ad with id = '{0}' and url = '{1}' " & _ + "was created.", adGroupAd.ad.id, adGroupAd.ad.url) + Next + Else + Console.WriteLine("No click-to-download ads were created.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create click-to-download ad.", ex) + End Try + End Sub + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201309/AdvancedOperations/AddSiteLinks.vb b/examples/AdWords/Vb/v201309/AdvancedOperations/AddSiteLinks.vb new file mode 100644 index 00000000000..8fc0db4f02b --- /dev/null +++ b/examples/AdWords/Vb/v201309/AdvancedOperations/AddSiteLinks.vb @@ -0,0 +1,319 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: thagikura@gmail.com (Takeshi Hagikura) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + + Public Class SiteLinksDataHolder + Dim siteLinksFeedIdField As Long + Dim linkTextFeedAttributeIdField As Long + Dim linkUrlFeedAttributeIdField As Long + Dim siteLinkFeedItemIdsField As New List(Of Long) + + Public Property SiteLinksFeedId As Long + Get + Return siteLinksFeedIdField + End Get + Set(ByVal value As Long) + siteLinksFeedIdField = value + End Set + End Property + + Public Property LinkTextFeedAttributeId As Long + Get + Return linkTextFeedAttributeIdField + End Get + Set(ByVal value As Long) + linkTextFeedAttributeIdField = value + End Set + End Property + + Public Property LinkUrlFeedAttributeId As Long + Get + Return linkUrlFeedAttributeIdField + End Get + Set(ByVal value As Long) + linkUrlFeedAttributeIdField = value + End Set + End Property + + Public Property SiteLinkFeedItemIds As List(Of Long) + Get + Return siteLinkFeedItemIdsField + End Get + Set(ByVal value As List(Of Long)) + siteLinkFeedItemIdsField = value + End Set + End Property + End Class + + ''' + ''' This code example adds a sitelinks feed and associates it with a campaign. + ''' To create a campaign, run AddCampaign.cs. + ''' + ''' Tags: CampaignFeedService.mutate, FeedService.mutate, FeedItemService.mutate, + ''' Tags: FeedMappingService.mutate + ''' + Public Class AddSiteLinks + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddSiteLinks + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a sitelinks feed and associates it with a campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign with which sitelinks are associated. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + Dim siteLinksData As New SiteLinksDataHolder + createSiteLinksFeed(user, siteLinksData) + createSiteLinksFeedItems(user, siteLinksData) + createSiteLinksFeedMapping(user, siteLinksData) + createSiteLinksCampaignFeed(user, siteLinksData, campaignId) + End Sub + + Private Sub createSiteLinksFeed( _ + ByVal user As AdWordsUser, ByVal siteLinksData As SiteLinksDataHolder) + ' Get the FeedService. + Dim feedService As FeedService = user.GetService(AdWordsService.v201309.FeedService) + + ' Create attributes. + Dim textAttribute As New FeedAttribute + textAttribute.type = FeedAttributeType.STRING + textAttribute.name = "Link Text" + Dim urlAttribute As New FeedAttribute + urlAttribute.type = FeedAttributeType.URL + urlAttribute.name = "Link URL" + + ' Create the feed. + Dim siteLinksFeed As New Feed + siteLinksFeed.name = "Feed For Site Links" + siteLinksFeed.attributes = New FeedAttribute() {textAttribute, urlAttribute} + siteLinksFeed.origin = FeedOrigin.USER + + ' Create operation. + Dim operation As New FeedOperation + operation.operand = siteLinksFeed + operation.operator = [Operator].ADD + + ' Add the feed. + Dim result As FeedReturnValue = feedService.mutate(New FeedOperation() {operation}) + + Dim savedFeed As Feed = result.value(0) + + siteLinksData.SiteLinksFeedId = savedFeed.id + Dim savedAttributes As FeedAttribute() = savedFeed.attributes + siteLinksData.LinkTextFeedAttributeId = savedAttributes(0).id + siteLinksData.LinkUrlFeedAttributeId = savedAttributes(1).id + Console.WriteLine("Feed with name {0} and ID {1} with linkTextAttributeId {2}" & _ + "linkUrlAttributeId {3} was created.", savedFeed.name, savedFeed.id, _ + savedAttributes(0).id, savedAttributes(1).id) + End Sub + + Private Sub createSiteLinksFeedItems( _ + ByVal user As AdWordsUser, ByVal siteLinksData As SiteLinksDataHolder) + ' Get the FeedItemService. + Dim feedItemService As FeedItemService = _ + user.GetService(AdWordsService.v201309.FeedItemService) + + ' Create operations to add FeedItems. + Dim home As FeedItemOperation = _ + newSiteLinkFeedItemAddOperation(siteLinksData, "Home", "http://www.example.com") + Dim stores As FeedItemOperation = _ + newSiteLinkFeedItemAddOperation(siteLinksData, "Stores", "http://www.example.com/stores") + Dim onSale As FeedItemOperation = _ + newSiteLinkFeedItemAddOperation(siteLinksData, "On Sale", "http://www.example.com/sale") + Dim support As FeedItemOperation = _ + newSiteLinkFeedItemAddOperation(siteLinksData, "Support", _ + "http://www.example.com/support") + Dim products As FeedItemOperation = _ + newSiteLinkFeedItemAddOperation(siteLinksData, "Products", "http://www.example.com/prods") + Dim aboutUs As FeedItemOperation = _ + newSiteLinkFeedItemAddOperation(siteLinksData, "About Us", "http://www.example.com/about") + + Dim operations As FeedItemOperation() = _ + New FeedItemOperation() {home, stores, onSale, support, products, aboutUs} + + Dim result As FeedItemReturnValue = feedItemService.mutate(operations) + For Each item As FeedItem In result.value + Console.WriteLine("FeedItem with feedItemId {0} was added.", item.feedItemId) + siteLinksData.SiteLinkFeedItemIds.Add(item.feedItemId) + Next + End Sub + + ' See the Placeholder reference page for a list of all the placeholder types and fields. + ' https://developers.google.com/adwords/api/docs/appendix/placeholders.html + Private Const PLACEHOLDER_SITELINKS As Integer = 1 + + ' See the Placeholder reference page for a list of all the placeholder types and fields. + Private Const PLACEHOLDER_FIELD_SITELINK_LINK_TEXT As Integer = 1 + Private Const PLACEHOLDER_FIELD_SITELINK_URL As Integer = 2 + + Private Sub createSiteLinksFeedMapping( _ + ByVal user As AdWordsUser, ByVal siteLinksData As SiteLinksDataHolder) + ' Get the FeedItemService. + Dim feedMappingService As FeedMappingService = _ + user.GetService(AdWordsService.v201309.FeedMappingService) + + ' Map the FeedAttributeIds to the fieldId constants. + Dim linkTextFieldMapping As New AttributeFieldMapping + linkTextFieldMapping.feedAttributeId = siteLinksData.LinkTextFeedAttributeId + linkTextFieldMapping.fieldId = PLACEHOLDER_FIELD_SITELINK_LINK_TEXT + Dim linkUrlFieldMapping As New AttributeFieldMapping + linkUrlFieldMapping.feedAttributeId = siteLinksData.LinkUrlFeedAttributeId + linkUrlFieldMapping.fieldId = PLACEHOLDER_FIELD_SITELINK_URL + + ' Create the FieldMapping and operation. + Dim feedMapping As New FeedMapping + feedMapping.placeholderType = PLACEHOLDER_SITELINKS + feedMapping.feedId = siteLinksData.SiteLinksFeedId + feedMapping.attributeFieldMappings = _ + New AttributeFieldMapping() {linkTextFieldMapping, linkUrlFieldMapping} + Dim operation As New FeedMappingOperation + operation.operand = feedMapping + operation.operator = [Operator].ADD + + ' Save the field mapping. + Dim result As FeedMappingReturnValue = _ + feedMappingService.mutate(New FeedMappingOperation() {operation}) + For Each savedFeedMapping As FeedMapping In result.value + Console.WriteLine("Feed mapping with ID {0} and placeholderType {1} was saved for " & _ + "feed with ID {2}.", savedFeedMapping.feedMappingId, savedFeedMapping.placeholderType, _ + savedFeedMapping.feedId) + Next + End Sub + + Private Sub createSiteLinksCampaignFeed(ByVal user As AdWordsUser, _ + ByVal siteLinksData As SiteLinksDataHolder, ByVal campaignId As Long) + ' Get the CampaignFeedService. + Dim campaignFeedService As CampaignFeedService = _ + user.GetService(AdWordsService.v201309.CampaignFeedService) + + ' Map the feed item ids to the campaign using an IN operation. + Dim feedItemRequestContextOperand As New RequestContextOperand() + feedItemRequestContextOperand.contextType = RequestContextOperandContextType.FEED_ITEM_ID + + Dim feedItemOperands As New List(Of FunctionArgumentOperand)() + For Each feedItemId As Long In siteLinksData.SiteLinkFeedItemIds + Dim feedItemOperand As New ConstantOperand() + feedItemOperand.longValue = feedItemId + feedItemOperand.type = ConstantOperandConstantType.LONG + feedItemOperands.Add(feedItemOperand) + Next + + Dim feedItemfunction As New [Function]() + feedItemfunction.lhsOperand = New FunctionArgumentOperand() {feedItemRequestContextOperand} + feedItemfunction.operator = FunctionOperator.IN + feedItemfunction.rhsOperand = feedItemOperands.ToArray() + + ' Optional: to target to a platform, define a function and 'AND' it with + ' the feed item ID link: + Dim platformRequestContextOperand As New RequestContextOperand() + platformRequestContextOperand.contextType = RequestContextOperandContextType.DEVICE_PLATFORM + + Dim platformOperand As New ConstantOperand() + platformOperand.stringValue = "Mobile" + platformOperand.type = ConstantOperandConstantType.STRING + + Dim platformFunction As New [Function]() + platformFunction.lhsOperand = New FunctionArgumentOperand() {platformRequestContextOperand} + platformFunction.operator = FunctionOperator.EQUALS + platformFunction.rhsOperand = New FunctionArgumentOperand() {platformOperand} + + ' Combine the two functions using an AND operation. + Dim feedItemFunctionOperand As New FunctionOperand() + feedItemFunctionOperand.value = feedItemfunction + + Dim platformFunctionOperand As New FunctionOperand() + platformFunctionOperand.value = platformFunction + + Dim combinedFunction As New [Function]() + combinedFunction.operator = FunctionOperator.AND + combinedFunction.lhsOperand = New FunctionArgumentOperand() { _ + feedItemFunctionOperand, platformFunctionOperand} + + Dim campaignFeed As New CampaignFeed() + campaignFeed.feedId = siteLinksData.SiteLinksFeedId + campaignFeed.campaignId = campaignId + campaignFeed.matchingFunction = combinedFunction + ' Specifying placeholder types on the CampaignFeed allows the same feed + ' to be used for different placeholders in different Campaigns. + campaignFeed.placeholderTypes = New Integer() {PLACEHOLDER_SITELINKS} + + Dim operation As New CampaignFeedOperation + operation.operand = CampaignFeed + operation.operator = [Operator].ADD + Dim result As CampaignFeedReturnValue = _ + campaignFeedService.mutate(New CampaignFeedOperation() {operation}) + For Each savedCampaignFeed As CampaignFeed In result.value + Console.WriteLine("Campaign with ID {0} was associated with feed with ID {1}", _ + savedCampaignFeed.campaignId, savedCampaignFeed.feedId) + Next + End Sub + + Function newSiteLinkFeedItemAddOperation(ByVal siteLinksData As SiteLinksDataHolder, _ + ByVal text As String, ByVal url As String) As FeedItemOperation + ' Create the FeedItemAttributeValues for our text values. + Dim linkTextAttributeValue As New FeedItemAttributeValue + linkTextAttributeValue.feedAttributeId = siteLinksData.LinkTextFeedAttributeId + linkTextAttributeValue.stringValue = text + Dim linkUrlAttributeValue As New FeedItemAttributeValue + linkUrlAttributeValue.feedAttributeId = siteLinksData.LinkUrlFeedAttributeId + linkUrlAttributeValue.stringValue = url + + ' Create the feed item and operation. + Dim item As New FeedItem + item.feedId = siteLinksData.SiteLinksFeedId + item.attributeValues = _ + New FeedItemAttributeValue() {linkTextAttributeValue, linkUrlAttributeValue} + Dim Operation As New FeedItemOperation + Operation.operand = item + Operation.operator = [Operator].ADD + Return Operation + End Function + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201309/AdvancedOperations/GetAdGroupBidModifiers.vb b/examples/AdWords/Vb/v201309/AdvancedOperations/GetAdGroupBidModifiers.vb new file mode 100644 index 00000000000..08ced7dcca1 --- /dev/null +++ b/examples/AdWords/Vb/v201309/AdvancedOperations/GetAdGroupBidModifiers.vb @@ -0,0 +1,125 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example illustrates how to retrieve ad group level mobile bid + ''' modifiers for a campaign. + ''' + ''' AdGroupBidModifierService.get + ''' + Public Class GetAdGroupBidModifiers + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAdGroupBidModifiers + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to retrieve ad group level mobile bid" & _ + " modifiers for a campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which adgroup bid + ''' modifiers are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupBidModifierService. + Dim adGroupBidModifierService As AdGroupBidModifierService = user.GetService( _ + AdWordsService.v201309.AdGroupBidModifierService) + + Const PAGE_SIZE As Integer = 500 + + ' Get all ad group bid modifiers for the campaign. + Dim selector As New Selector() + selector.fields = New String() {"CampaignId", "AdGroupId", "BidModifier", _ + "BidModifierSource", "CriteriaType", "Id"} + + Dim predicate As New Predicate() + predicate.field = "CampaignId" + predicate.[operator] = PredicateOperator.EQUALS + predicate.values = New String() {campaignId.ToString()} + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging() + + Dim offset As Integer = 0 + Dim pageSize As Integer = PAGE_SIZE + + Dim page As New AdGroupBidModifierPage() + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the campaigns. + page = adGroupBidModifierService.get(selector) + + ' Display the results. + If (Not page Is Nothing) AndAlso (Not page.entries Is Nothing) Then + Dim i As Integer = offset + For Each adGroupBidModifier As AdGroupBidModifier In page.entries + Dim bidModifier As String = "" + If adGroupBidModifier.bidModifierSpecified Then + bidModifier = adGroupBidModifier.bidModifier.ToString() + Else + bidModifier = "UNSET" + End If + Console.WriteLine("{0}) Campaign ID {1}, AdGroup ID {2}, Criterion ID {3} has " & _ + "ad group level modifier: {4}, source = {5}.", _ + i + 1, adGroupBidModifier.campaignId, _ + adGroupBidModifier.adGroupId, adGroupBidModifier.criterion.id, _ + bidModifier, adGroupBidModifier.bidModifierSource) + i = i + 1 + Next + End If + offset += pageSize + Loop While offset < page.totalNumEntries + Console.WriteLine("Number of adgroup bid modifiers found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve adgroup bid modifiers.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/AdvancedOperations/UploadOfflineConversions.vb b/examples/AdWords/Vb/v201309/AdvancedOperations/UploadOfflineConversions.vb new file mode 100644 index 00000000000..7e8a174806b --- /dev/null +++ b/examples/AdWords/Vb/v201309/AdvancedOperations/UploadOfflineConversions.vb @@ -0,0 +1,245 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example adds a Shared Bidding Strategy and uses it to construct + ''' a campaign. + ''' + ''' Tags: BiddingStrategyService.mutate + ''' Tags: BudgetService.mutate, CampaignService.mutate + ''' + Public Class UploadOfflineConversions + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim conversionName As String = "INSERT_CONVERSION_NAME_HERE" + ' GCLID needs to be newer than 30 days. + Dim gClId As String = "INSERT_GOOGLE_CLICK_ID_HERE" + ' The conversion time should be higher than the click time. + Dim conversionTime As String = "INSERT_CONVERSION_TIME_HERE" + Dim conversionValue As Double = Double.Parse("INSERT_CONVERSION_VALUE_HERE") + + Dim codeExample As New UploadOfflineConversions + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser, conversionName, gClId, conversionTime, conversionValue) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a Shared Bidding Strategy and uses it to construct " & _ + "a campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The name of the upload conversion to be + ''' created. + ''' The Google Click ID of the click for which offline + ''' conversions are uploaded. + ''' The conversion value to be uploaded. + ''' + ''' The conversion time, in yyyymmdd hhmmss + ''' format. + Public Sub Run(ByVal user As AdWordsUser, ByVal conversionName As String, _ + ByVal gClid As String, ByVal conversionTime As String, ByVal conversionValue As Double) + ' Get the ConversionTrackerService. + Dim conversionTrackerService As ConversionTrackerService = user.GetService( _ + AdWordsService.v201309.ConversionTrackerService) + + ' Get the OfflineConversionFeedService. + Dim offlineConversionFeedService As OfflineConversionFeedService = user.GetService( _ + AdWordsService.v201309.OfflineConversionFeedService) + + Const VIEWTHROUGH_LOOKBACK_WINDOW As Integer = 30 + Const CTC_LOOKBACK_WINDOW As Integer = 90 + + Try + ' Create an upload conversion. Once created, this entry will be visible + ' under Tools and Analysis->Conversion and will have "Source = Import". + Dim uploadConversion As New UploadConversion() + uploadConversion.category = ConversionTrackerCategory.PAGE_VIEW + uploadConversion.name = conversionName + uploadConversion.viewthroughLookbackWindow = VIEWTHROUGH_LOOKBACK_WINDOW + uploadConversion.ctcLookbackWindow = CTC_LOOKBACK_WINDOW + + Dim uploadConversionOperation As New ConversionTrackerOperation() + uploadConversionOperation.operator = [Operator].ADD + uploadConversionOperation.operand = uploadConversion + + Dim conversionTrackerRetval As ConversionTrackerReturnValue = _ + conversionTrackerService.mutate(New ConversionTrackerOperation() { _ + uploadConversionOperation}) + + Dim newUploadConversion As UploadConversion = conversionTrackerRetval.value(0) + + Console.WriteLine("New upload conversion type with name = '{0}' and id = {1} was " & _ + "created.", newUploadConversion.name, newUploadConversion.id) + + ' Associate offline conversions with the upload conversion we created. + Dim feed As New OfflineConversionFeed() + feed.conversionName = conversionName + feed.conversionTime = conversionTime + feed.conversionValue = conversionValue + feed.googleClickId = gClid + + Dim offlineConversionOperation As New OfflineConversionFeedOperation() + offlineConversionOperation.operator = [Operator].ADD + offlineConversionOperation.operand = feed + + Dim offlineConversionRetval As OfflineConversionFeedReturnValue = _ + offlineConversionFeedService.mutate( _ + New OfflineConversionFeedOperation() {offlineConversionOperation}) + + Dim newFeed As OfflineConversionFeed = offlineConversionRetval.value(0) + + Console.WriteLine("Uploaded offline conversion value of {0} for Google Click ID = " & _ + "'{1}' to '{2}'.", newFeed.conversionValue, newFeed.googleClickId, _ + newFeed.conversionName) + Catch ex As Exception + Throw New System.ApplicationException("Failed to upload offline conversions.", ex) + End Try + End Sub + + + ''' + ''' Creates the shared bidding strategy. + ''' + ''' The bidding strategy service. + ''' The bidding strategy name. + ''' The bid ceiling. + ''' The spend target. + ''' The bidding strategy object. + Private Function CreateBiddingStrategy(ByVal biddingStrategyService As BiddingStrategyService, _ + ByVal name As String, ByVal bidCeiling As Long, ByVal spendTarget As Long) _ + As SharedBiddingStrategy + ' Create a shared bidding strategy. + Dim sharedBiddingStrategy As New SharedBiddingStrategy() + sharedBiddingStrategy.name = name + + Dim biddingScheme As New TargetSpendBiddingScheme() + ' Optionally set additional bidding scheme parameters. + biddingScheme.bidCeiling = New Money() + biddingScheme.bidCeiling.microAmount = bidCeiling + + biddingScheme.spendTarget = New Money() + biddingScheme.spendTarget.microAmount = spendTarget + + sharedBiddingStrategy.biddingScheme = biddingScheme + + ' Create operation. + Dim operation As New BiddingStrategyOperation() + operation.operator = [Operator].ADD + operation.operand = sharedBiddingStrategy + + Return biddingStrategyService.mutate(New BiddingStrategyOperation() {operation}).value(0) + End Function + + ''' + ''' Creates an explicit budget to be used only to create the Campaign. + ''' + ''' The budget service. + ''' The budget name. + ''' The budget amount. + ''' The budget object. + Private Function CreateSharedBudget(ByVal budgetService As BudgetService, _ + ByVal name As String, ByVal amount As Long) As Budget + ' Create a shared budget + Dim budget As New Budget() + budget.name = name + budget.period = BudgetBudgetPeriod.DAILY + budget.amount = New Money() + budget.amount.microAmount = amount + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD + budget.isExplicitlyShared = True + + ' Create operation. + Dim operation As New BudgetOperation() + operation.operand = budget + operation.operator = [Operator].ADD + + ' Make the mutate request. + Return budgetService.mutate(New BudgetOperation() {operation}).value(0) + End Function + + ''' + ''' Creates the campaign with a shared bidding strategy. + ''' + ''' The campaign service. + ''' The campaign name. + ''' The bidding strategy id. + ''' The shared budget id. + ''' The campaign object. + Private Function CreateCampaignWithBiddingStrategy(ByVal campaignService As CampaignService, _ + ByVal name As String, ByVal biddingStrategyId As Long, ByVal sharedBudgetId As Long) _ + As Campaign + ' Create campaign. + Dim campaign As New Campaign() + campaign.name = name + + ' Set the budget. + campaign.budget = New Budget() + campaign.budget.budgetId = sharedBudgetId + + ' Set bidding strategy (required). + Dim biddingStrategyConfiguration As New BiddingStrategyConfiguration() + biddingStrategyConfiguration.biddingStrategyId = biddingStrategyId + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration + + ' Set keyword matching setting (required). + Dim keywordMatchSetting As New KeywordMatchSetting() + keywordMatchSetting.optIn = True + campaign.settings = New Setting() {keywordMatchSetting} + + ' Set network targeting (recommended). + Dim networkSetting As New NetworkSetting() + networkSetting.targetGoogleSearch = True + networkSetting.targetSearchNetwork = True + networkSetting.targetContentNetwork = True + campaign.networkSetting = networkSetting + + ' Create operation. + Dim operation As New CampaignOperation() + operation.operand = campaign + operation.operator = [Operator].ADD + + Return campaignService.mutate(New CampaignOperation() {operation}).value(0) + End Function + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/AdvancedOperations/UseSharedBiddingStrategy.vb b/examples/AdWords/Vb/v201309/AdvancedOperations/UseSharedBiddingStrategy.vb new file mode 100644 index 00000000000..49508a7c618 --- /dev/null +++ b/examples/AdWords/Vb/v201309/AdvancedOperations/UseSharedBiddingStrategy.vb @@ -0,0 +1,212 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example adds a Shared Bidding Strategy and uses it to construct + ''' a campaign. + ''' + ''' Tags: BiddingStrategyService.mutate + ''' Tags: BudgetService.mutate, CampaignService.mutate + ''' + Public Class UseSharedBiddingStrategy + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UseSharedBiddingStrategy + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a Shared Bidding Strategy and uses it to construct " & _ + "a campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the services. + Dim biddingStrategyService As BiddingStrategyService = user.GetService( _ + AdWordsService.v201309.BiddingStrategyService) + + Dim budgetService As BudgetService = user.GetService(AdWordsService.v201309.BudgetService) + + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201309.CampaignService) + + Dim biddingStrategyName As String = "Maximize Clicks " & ExampleUtilities.GetRandomString() + Dim bidCeiling As Long = 2000000 + Dim spendTarget As Long = 20000000 + + Dim budgetName As String = "Shared Interplanetary Budget #" & _ + ExampleUtilities.GetRandomString() + Dim budgetAmount As Long = 30000000 + + Dim campaignName As String = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString() + + Try + Dim sharedBiddingStrategy As SharedBiddingStrategy = CreateBiddingStrategy( _ + biddingStrategyService, biddingStrategyName, bidCeiling, spendTarget) + Console.WriteLine("Shared bidding strategy with name '{0}' and ID {1} of type {2} " & _ + "was created.", sharedBiddingStrategy.name, sharedBiddingStrategy.id, _ + sharedBiddingStrategy.biddingScheme.BiddingSchemeType) + + Dim sharedBudget As Budget = CreateSharedBudget(budgetService, budgetName, budgetAmount) + + Dim newCampaign As Campaign = CreateCampaignWithBiddingStrategy(campaignService, _ + campaignName, sharedBiddingStrategy.id, sharedBudget.budgetId) + + Console.WriteLine("Campaign with name '{0}', ID {1} and bidding scheme ID {2} was " & _ + "created.", newCampaign.name, newCampaign.id, _ + newCampaign.biddingStrategyConfiguration.biddingStrategyId) + + Catch ex As Exception + Throw New System.ApplicationException("Failed to create campaign that uses shared " & _ + "bidding strategy.", ex) + End Try + End Sub + + + ''' + ''' Creates the shared bidding strategy. + ''' + ''' The bidding strategy service. + ''' The bidding strategy name. + ''' The bid ceiling. + ''' The spend target. + ''' The bidding strategy object. + Private Function CreateBiddingStrategy(ByVal biddingStrategyService As BiddingStrategyService, _ + ByVal name As String, ByVal bidCeiling As Long, ByVal spendTarget As Long) _ + As SharedBiddingStrategy + ' Create a shared bidding strategy. + Dim sharedBiddingStrategy As New SharedBiddingStrategy() + sharedBiddingStrategy.name = name + + Dim biddingScheme As New TargetSpendBiddingScheme() + ' Optionally set additional bidding scheme parameters. + biddingScheme.bidCeiling = New Money() + biddingScheme.bidCeiling.microAmount = bidCeiling + + biddingScheme.spendTarget = New Money() + biddingScheme.spendTarget.microAmount = spendTarget + + sharedBiddingStrategy.biddingScheme = biddingScheme + + ' Create operation. + Dim operation As New BiddingStrategyOperation() + operation.operator = [Operator].ADD + operation.operand = sharedBiddingStrategy + + Return biddingStrategyService.mutate(New BiddingStrategyOperation() {operation}).value(0) + End Function + + ''' + ''' Creates an explicit budget to be used only to create the Campaign. + ''' + ''' The budget service. + ''' The budget name. + ''' The budget amount. + ''' The budget object. + Private Function CreateSharedBudget(ByVal budgetService As BudgetService, _ + ByVal name As String, ByVal amount As Long) As Budget + ' Create a shared budget + Dim budget As New Budget() + budget.name = name + budget.period = BudgetBudgetPeriod.DAILY + budget.amount = New Money() + budget.amount.microAmount = amount + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD + budget.isExplicitlyShared = True + + ' Create operation. + Dim operation As New BudgetOperation() + operation.operand = budget + operation.operator = [Operator].ADD + + ' Make the mutate request. + Return budgetService.mutate(New BudgetOperation() {operation}).value(0) + End Function + + ''' + ''' Creates the campaign with a shared bidding strategy. + ''' + ''' The campaign service. + ''' The campaign name. + ''' The bidding strategy id. + ''' The shared budget id. + ''' The campaign object. + Private Function CreateCampaignWithBiddingStrategy(ByVal campaignService As CampaignService, _ + ByVal name As String, ByVal biddingStrategyId As Long, ByVal sharedBudgetId As Long) _ + As Campaign + ' Create campaign. + Dim campaign As New Campaign() + campaign.name = name + + ' Set the budget. + campaign.budget = New Budget() + campaign.budget.budgetId = sharedBudgetId + + ' Set bidding strategy (required). + Dim biddingStrategyConfiguration As New BiddingStrategyConfiguration() + biddingStrategyConfiguration.biddingStrategyId = biddingStrategyId + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration + + ' Set keyword matching setting (required). + Dim keywordMatchSetting As New KeywordMatchSetting() + keywordMatchSetting.optIn = True + campaign.settings = New Setting() {keywordMatchSetting} + + ' Set network targeting (recommended). + Dim networkSetting As New NetworkSetting() + networkSetting.targetGoogleSearch = True + networkSetting.targetSearchNetwork = True + networkSetting.targetContentNetwork = True + campaign.networkSetting = networkSetting + + ' Create operation. + Dim operation As New CampaignOperation() + operation.operand = campaign + operation.operator = [Operator].ADD + + Return campaignService.mutate(New CampaignOperation() {operation}).value(0) + End Function + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/BasicOperations/AddAdGroupDemographicCriteria.vb b/examples/AdWords/Vb/v201309/BasicOperations/AddAdGroupDemographicCriteria.vb new file mode 100644 index 00000000000..0fa257e2f74 --- /dev/null +++ b/examples/AdWords/Vb/v201309/BasicOperations/AddAdGroupDemographicCriteria.vb @@ -0,0 +1,124 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example adds demographic target criteria to an ad group. To get + ''' ad groups, run AddAdGroup.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class AddAdGroupDemographicCriteria + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAdGroupDemographicCriteria + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds demographic target criteria to an ad group. To get ad " & _ + "groups, run AddAdGroup.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which criteria are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = _ + user.GetService(AdWordsService.v201309.AdGroupCriterionService) + + ' Create biddable ad group criterion for gender + Dim genderTarget As New Gender() + ' Criterion Id for male. The IDs can be found here + ' https://developers.google.com/adwords/api/docs/appendix/genders + genderTarget.id = 10 + + Dim genderBiddableAdGroupCriterion As New BiddableAdGroupCriterion() + genderBiddableAdGroupCriterion.adGroupId = adGroupId + genderBiddableAdGroupCriterion.criterion = genderTarget + + ' Create negative ad group criterion for age range + Dim ageRangeNegative As New AgeRange() + ' Criterion Id for age 18 to 24. The IDs can be found here + ' https://developers.google.com/adwords/api/docs/appendix/ages + + ageRangeNegative.id = 503001 + Dim ageRangeNegativeAdGroupCriterion As New NegativeAdGroupCriterion() + ageRangeNegativeAdGroupCriterion.adGroupId = adGroupId + ageRangeNegativeAdGroupCriterion.criterion = ageRangeNegative + + ' Create operations. + Dim genderBiddableAdGroupCriterionOperation As New AdGroupCriterionOperation() + genderBiddableAdGroupCriterionOperation.operand = genderBiddableAdGroupCriterion + genderBiddableAdGroupCriterionOperation.operator = [Operator].ADD + + Dim ageRangeNegativeAdGroupCriterionOperation As New AdGroupCriterionOperation() + ageRangeNegativeAdGroupCriterionOperation.operand = ageRangeNegativeAdGroupCriterion + ageRangeNegativeAdGroupCriterionOperation.operator = [Operator].ADD + + Dim operations As New List(Of Operation) + operations.Add(genderBiddableAdGroupCriterionOperation) + operations.Add(ageRangeNegativeAdGroupCriterionOperation) + + Try + ' Add ad group criteria. + Dim result As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + operations.ToArray) + + ' Display ad group criteria. + If (Not result Is Nothing) AndAlso Not (result.value Is Nothing) Then + For Each adGroupCriterionResult As AdGroupCriterion In result.value + Console.WriteLine("Ad group criterion with ad group id '{0}', criterion id " & _ + "'{1}', and type '{2}' was added.", adGroupCriterionResult.adGroupId, _ + adGroupCriterionResult.criterion.id, _ + adGroupCriterionResult.criterion.CriterionType) + Next + Else + Console.WriteLine("No ad group criteria were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create ad group criteria.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/BasicOperations/AddAdGroups.vb b/examples/AdWords/Vb/v201309/BasicOperations/AddAdGroups.vb new file mode 100644 index 00000000000..2bea0684599 --- /dev/null +++ b/examples/AdWords/Vb/v201309/BasicOperations/AddAdGroups.vb @@ -0,0 +1,142 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example illustrates how to create ad groups. To create + ''' campaigns, run AddCampaigns.vb. + ''' + ''' Tags: AdGroupService.mutate + ''' + Public Class AddAdGroups + Inherits ExampleBase + ''' + ''' Number of items being added / updated in this code example. + ''' + Const NUM_ITEMS As Integer = 5 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAdGroups + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to create ad groups. To create campaigns," & _ + " run AddCampaigns.vb" + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to which ad groups are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService( _ + AdWordsService.v201309.AdGroupService) + + Dim operations As New List(Of AdGroupOperation) + + For i As Integer = 1 To NUM_ITEMS + ' Create the ad group. + Dim adGroup As New AdGroup + adGroup.name = String.Format("Earth to Mars Cruises #{0}", ExampleUtilities.GetRandomString) + adGroup.status = AdGroupStatus.ENABLED + adGroup.campaignId = campaignId + + ' Set the ad group bids. + Dim biddingConfig As New BiddingStrategyConfiguration() + + Dim cpcBid As New CpcBid() + cpcBid.bid = New Money() + cpcBid.bid.microAmount = 10000000 + + ' Optional: set the content bid. + cpcBid.contentBid = New Money() + cpcBid.contentBid.microAmount = 2000000 + + biddingConfig.bids = New Bids() {cpcBid} + + adGroup.biddingStrategyConfiguration = biddingConfig + + ' Optional: Set targeting restrictions. + ' These setting only affect serving for the Display Network. + Dim targetingSetting As New TargetingSetting() + + Dim placementDetail As New TargetingSettingDetail() + placementDetail.criterionTypeGroup = CriterionTypeGroup.PLACEMENT + placementDetail.targetAll = True + + Dim verticalDetail As New TargetingSettingDetail() + verticalDetail.criterionTypeGroup = CriterionTypeGroup.VERTICAL + verticalDetail.targetAll = False + + targetingSetting.details = New TargetingSettingDetail() {placementDetail, verticalDetail} + + adGroup.settings = New Setting() {targetingSetting} + + ' Create the operation. + Dim operation As New AdGroupOperation + operation.operator = [Operator].ADD + operation.operand = adGroup + + operations.Add(operation) + Next + + Try + ' Create the ad group. + Dim retVal As AdGroupReturnValue = adGroupService.mutate(operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + For Each newAdGroup As AdGroup In retVal.value + Console.WriteLine("Ad group with id = '{0}' and name = '{1}' was created.", _ + newAdGroup.id, newAdGroup.name) + Next + Else + Console.WriteLine("No ad groups were created.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create ad groups.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/BasicOperations/AddCampaigns.vb b/examples/AdWords/Vb/v201309/BasicOperations/AddCampaigns.vb new file mode 100644 index 00000000000..06e457e6968 --- /dev/null +++ b/examples/AdWords/Vb/v201309/BasicOperations/AddCampaigns.vb @@ -0,0 +1,174 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example adds campaigns. To get campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignService.mutate + ''' + Public Class AddCampaigns + Inherits ExampleBase + ''' + ''' Number of items being added / updated in this code example. + ''' + Const NUM_ITEMS As Integer = 5 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddCampaigns + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds campaigns. To get campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the BudgetService. + Dim budgetService As BudgetService = user.GetService( _ + AdWordsService.v201309.BudgetService) + + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201309.CampaignService) + + ' Create the campaign budget. + Dim budget As New Budget + budget.name = "Interplanetary Cruise Budget #" & ExampleUtilities.GetRandomString + budget.period = BudgetBudgetPeriod.DAILY + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD + budget.amount = New Money + budget.amount.microAmount = 50000000 + + Dim budgetOperation As New BudgetOperation + budgetOperation.operator = [Operator].ADD + budgetOperation.operand = budget + + Try + Dim budgetRetval As BudgetReturnValue = budgetService.mutate(New BudgetOperation() {budgetOperation}) + budget = budgetRetval.value(0) + Catch ex As Exception + Throw New System.ApplicationException("Failed to add shared budget.", ex) + End Try + + Dim operations As New List(Of CampaignOperation) + + For i As Integer = 1 To NUM_ITEMS + ' Create the campaign. + Dim campaign As New Campaign + campaign.name = "Interplanetary Cruise #" & ExampleUtilities.GetRandomString + campaign.status = CampaignStatus.PAUSED + + Dim biddingConfig As New BiddingStrategyConfiguration() + biddingConfig.biddingStrategyType = BiddingStrategyType.MANUAL_CPC + + ' Optional: provide BiddingScheme. + Dim biddingScheme As New ManualCpcBiddingScheme() + biddingScheme.enhancedCpcEnabled = True + biddingConfig.biddingScheme = biddingScheme + + campaign.biddingStrategyConfiguration = biddingConfig + + ' Set the campaign budget. + campaign.budget = New Budget + campaign.budget.budgetId = budget.budgetId + + ' Set the campaign network options. + campaign.networkSetting = New NetworkSetting + campaign.networkSetting.targetGoogleSearch = True + campaign.networkSetting.targetSearchNetwork = True + campaign.networkSetting.targetContentNetwork = False + campaign.networkSetting.targetPartnerSearchNetwork = False + + ' Set the campaign geo target and keyword match settings. + Dim geoSetting As New GeoTargetTypeSetting + geoSetting.positiveGeoTargetType = GeoTargetTypeSettingPositiveGeoTargetType.DONT_CARE + geoSetting.negativeGeoTargetType = GeoTargetTypeSettingNegativeGeoTargetType.DONT_CARE + + Dim keywordSetting As New KeywordMatchSetting + keywordSetting.optIn = False + + campaign.settings = New Setting() {geoSetting, keywordSetting} + + ' Optional: Set the start date. + campaign.startDate = DateTime.Now.AddDays(1).ToString("yyyyMMdd") + + ' Optional: Set the end date. + campaign.endDate = DateTime.Now.AddYears(1).ToString("yyyyMMdd") + + ' Optional: Set the campaign ad serving optimization status. + campaign.adServingOptimizationStatus = AdServingOptimizationStatus.ROTATE + + ' Optional: Set the frequency cap. + Dim frequencyCap As New FrequencyCap + frequencyCap.impressions = 5 + frequencyCap.level = Level.ADGROUP + frequencyCap.timeUnit = TimeUnit.DAY + campaign.frequencyCap = frequencyCap + + ' Create the operation. + Dim operation As New CampaignOperation + operation.operator = [Operator].ADD + operation.operand = campaign + operations.Add(operation) + Next + + Try + ' Add the campaign. + Dim retVal As CampaignReturnValue = campaignService.mutate(operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + For Each newCampaign As Campaign In retVal.value + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was added.", _ + newCampaign.name, newCampaign.id) + Next + Else + Console.WriteLine("No campaigns were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add campaigns.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/BasicOperations/AddKeywords.vb b/examples/AdWords/Vb/v201309/BasicOperations/AddKeywords.vb new file mode 100644 index 00000000000..6a7b4869a50 --- /dev/null +++ b/examples/AdWords/Vb/v201309/BasicOperations/AddKeywords.vb @@ -0,0 +1,129 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example adds a keyword to an ad group. To get ad groups, run + ''' GetAdGroups.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class AddKeywords + Inherits ExampleBase + ''' + ''' Number of items being added / updated in this code example. + ''' + Const NUM_ITEMS As Integer = 5 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddKeywords + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a keyword to an ad group. To get ad groups, run " & _ + "GetAdGroups.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which keywords are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201309.AdGroupCriterionService) + + Dim operations As New List(Of AdGroupCriterionOperation) + + For i As Integer = 1 To NUM_ITEMS + ' Create the keyword. + Dim keyword As New Keyword + keyword.text = "mars cruise" + keyword.matchType = KeywordMatchType.BROAD + + ' Create the biddable ad group criterion. + Dim keywordCriterion As New BiddableAdGroupCriterion + keywordCriterion.adGroupId = adGroupId + keywordCriterion.criterion = keyword + + ' Optional: Set the user status. + keywordCriterion.userStatus = UserStatus.PAUSED + + ' Optional: Set the keyword destination url. + keywordCriterion.destinationUrl = "http://example.com/mars/cruise/" & i + + ' Create the operations. + Dim operation As New AdGroupCriterionOperation + operation.operator = [Operator].ADD + operation.operand = keywordCriterion + + operations.Add(operation) + Next + + Try + ' Create the keywords. + Dim retVal As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing)) Then + For Each adGroupCriterion As AdGroupCriterion In retVal.value + ' If you are adding multiple type of criteria, then you may need to + ' check for + ' + ' if (adGroupCriterion is Keyword) { ... } + ' + ' to identify the criterion type. + Console.WriteLine("Keyword with ad group id = '{0}, keyword id = '{1}, text = " & _ + "'{2}' and match type = '{3}' was created.", adGroupCriterion.adGroupId, _ + adGroupCriterion.criterion.id, TryCast(adGroupCriterion.criterion, Keyword).text, _ + TryCast(adGroupCriterion.criterion, Keyword).matchType) + Next + Else + Console.WriteLine("No keywords were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create keywords.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/BasicOperations/AddTextAds.vb b/examples/AdWords/Vb/v201309/BasicOperations/AddTextAds.vb new file mode 100644 index 00000000000..cf66a0e138b --- /dev/null +++ b/examples/AdWords/Vb/v201309/BasicOperations/AddTextAds.vb @@ -0,0 +1,130 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 +Imports Google.Api.Ads.Common.Util + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example adds text ads to a given ad group. To list ad groups, + ''' run GetAdGroups.vb. To learn how to handle policy violations and add + ''' exemption requests, see HandlePolicyViolationError.vb. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class AddTextAds + Inherits ExampleBase + ''' + ''' Number of items being added / updated in this code example. + ''' + Const NUM_ITEMS As Integer = 5 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddTextAds + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds text ads to a given ad group. To list ad groups, run " & _ + "GetAdGroups.vb. To learn how to handle policy violations and add exemption " & _ + "requests, see HandlePolicyViolationError.cs." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which ads are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService( _ + AdWordsService.v201309.AdGroupAdService) + + Dim operations As New List(Of AdGroupAdOperation) + + For i As Integer = 1 To NUM_ITEMS + ' Create the text ad. + Dim textAd As New TextAd + textAd.headline = "Luxury Cruise to Mars" + textAd.description1 = "Visit the Red Planet in style." + textAd.description2 = "Low-gravity fun for everyone!" + textAd.displayUrl = "www.example.com" + textAd.url = "http://www.example.com/" & i + + Dim textAdGroupAd As New AdGroupAd + textAdGroupAd.adGroupId = adGroupId + textAdGroupAd.ad = textAd + + ' Optional: Set the status. + textAdGroupAd.status = AdGroupAdStatus.PAUSED + + ' Create the operations. + Dim operation As New AdGroupAdOperation + operation.operator = [Operator].ADD + operation.operand = textAdGroupAd + + operations.Add(operation) + Next + + Dim retVal As AdGroupAdReturnValue = Nothing + + Try + ' Create the ads. + retVal = service.mutate(operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing)) Then + ' If you are adding multiple type of Ads, then you may need to check + ' for + ' + ' if (adGroupAd.ad is TextAd) { ... } + ' + ' to identify the ad type. + For Each adGroupAd As AdGroupAd In retVal.value + Console.WriteLine("New text ad with id = ""{0}"" and displayUrl = ""{1}"" was " & _ + "created.", adGroupAd.ad.id, adGroupAd.ad.displayUrl) + Next + Else + Console.WriteLine("No text ads were created.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create text ads.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/BasicOperations/DeleteAd.vb b/examples/AdWords/Vb/v201309/BasicOperations/DeleteAd.vb new file mode 100644 index 00000000000..668b26ddf0d --- /dev/null +++ b/examples/AdWords/Vb/v201309/BasicOperations/DeleteAd.vb @@ -0,0 +1,105 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example deletes an ad using the 'REMOVE' operator. To list ads, + ''' run GetTextAds.vb. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class DeleteAd + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DeleteAd + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim adId As Long = Long.Parse("INSERT_AD_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, adId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example deletes an ad using the 'REMOVE' operator. To list ads, " & _ + "run GetTextAds.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the ad. + ''' Id of the ad being deleted. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal adId As Long) + ' Get the AdGroupAdService. + Dim adGroupAdService As AdGroupAdService = user.GetService( _ + AdWordsService.v201309.AdGroupAdService) + + ' Since we do not need to update any ad-specific fields, it is enough to + ' create the base type. + Dim ad As New Ad + ad.id = adId + + ' Create the ad group ad. + Dim adGroupAd As New AdGroupAd + adGroupAd.adGroupId = adGroupId + + adGroupAd.ad = ad + + ' Create the operation. + Dim operation As New AdGroupAdOperation + operation.operand = adGroupAd + operation.operator = [Operator].REMOVE + + Try + ' Delete the ad. + Dim retVal As AdGroupAdReturnValue = adGroupAdService.mutate( _ + New AdGroupAdOperation() {operation}) + + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim deletedAdGroupAd As AdGroupAd = retVal.value(0) + Console.WriteLine("Ad with id = ""{0}"" and type = ""{1}"" was deleted.", _ + deletedAdGroupAd.ad.id, deletedAdGroupAd.ad.AdType) + Else + Console.WriteLine("No ads were deleted.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to delete ad.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/BasicOperations/DeleteAdGroup.vb b/examples/AdWords/Vb/v201309/BasicOperations/DeleteAdGroup.vb new file mode 100644 index 00000000000..324759f0dca --- /dev/null +++ b/examples/AdWords/Vb/v201309/BasicOperations/DeleteAdGroup.vb @@ -0,0 +1,101 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example deletes an ad group by setting the status to 'DELETED'. + ''' To get ad groups, run GetAdGroups.vb. + ''' + ''' Tags: AdGroupService.mutate + ''' + Public Class DeleteAdGroup + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DeleteAdGroup + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example deletes an ad group by setting the status to 'DELETED'. " & _ + "To get ad groups, run GetAdGroups.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to be deleted. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService(AdWordsService.v201309.AdGroupService) + + ' Create ad group with DELETED status. + Dim adGroup As New AdGroup + adGroup.id = adGroupId + + ' When deleting an ad group, rename it to avoid name collisions with new + ' ad groups. + adGroup.name = "Deleted AdGroup - " + ExampleUtilities.GetRandomString + adGroup.status = AdGroupStatus.DELETED + + ' Create the operation. + Dim operation As New AdGroupOperation + operation.operand = adGroup + operation.operator = [Operator].SET + + Try + ' Delete the ad group. + Dim retVal As AdGroupReturnValue = adGroupService.mutate( _ + New AdGroupOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim deletedAdGroup As AdGroup = retVal.value(0) + Console.WriteLine("Ad group with id = ""{0}"" was renamed to ""{1}"" and deleted.", _ + deletedAdGroup.id, deletedAdGroup.name) + Else + Console.WriteLine("No ad groups were deleted.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to delete ad groups.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/BasicOperations/DeleteCampaign.vb b/examples/AdWords/Vb/v201309/BasicOperations/DeleteCampaign.vb new file mode 100644 index 00000000000..49a7a798159 --- /dev/null +++ b/examples/AdWords/Vb/v201309/BasicOperations/DeleteCampaign.vb @@ -0,0 +1,102 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example deletes a campaign by setting the status to 'DELETED'. + ''' To get campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignService.mutate + ''' + Public Class DeleteCampaign + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DeleteCampaign + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example deletes a campaign by setting the status to 'DELETED'. To " & _ + "get campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to be deleted. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201309.CampaignService) + + ' Create campaign with DELETED status. + Dim campaign As New Campaign + campaign.id = campaignId + + ' When deleting a campaign, rename it to avoid name collisions with new + ' campaigns. + campaign.name = "Deleted Campaign - " + ExampleUtilities.GetRandomString + campaign.status = CampaignStatus.DELETED + + ' Create the operation. + Dim operation As New CampaignOperation + operation.operand = campaign + operation.operator = [Operator].SET + + Try + ' Delete the campaign. + Dim retVal As CampaignReturnValue = campaignService.mutate( _ + New CampaignOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim deletedCampaign As Campaign = retVal.value(0) + Console.WriteLine("Campaign with id = ""{0}"" was renamed to ""{1}"" and deleted.", _ + deletedCampaign.id, deletedCampaign.name) + Else + Console.WriteLine("No campaigns were deleted.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to delete campaigns.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/BasicOperations/DeleteKeyword.vb b/examples/AdWords/Vb/v201309/BasicOperations/DeleteKeyword.vb new file mode 100644 index 00000000000..e041ab96f48 --- /dev/null +++ b/examples/AdWords/Vb/v201309/BasicOperations/DeleteKeyword.vb @@ -0,0 +1,106 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example deletes a keyword using the 'REMOVE' operator. To get + ''' keywords, run GetKeywords.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class DeleteKeyword + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DeleteKeyword + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim keywordId As Long = Long.Parse("INSERT_KEYWORD_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, keywordId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example deletes a keyword using the 'REMOVE' operator. To get " & _ + "keywords, run GetKeywords.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the keyword. + ''' + ''' Id of the keyword to be deleted. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal keywordId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201309.AdGroupCriterionService) + + ' Create base class criterion to avoid setting keyword-specific + ' fields. + Dim criterion As New Criterion + criterion.id = keywordId + + ' Create the ad group criterion. + Dim adGroupCriterion As New BiddableAdGroupCriterion + adGroupCriterion.adGroupId = adGroupId + adGroupCriterion.criterion = criterion + + ' Create the operation. + Dim operation As New AdGroupCriterionOperation + operation.operand = adGroupCriterion + operation.operator = [Operator].REMOVE + + Try + ' Delete the keyword. + Dim retVal As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + New AdGroupCriterionOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim deletedKeyword As AdGroupCriterion = retVal.value(0) + Console.WriteLine("Keyword with ad group id = ""{0}"" and id = ""{1}"" was " & _ + "deleted.", deletedKeyword.adGroupId, deletedKeyword.criterion.id) + Else + Console.WriteLine("No keywords were deleted.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to delete keywords.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/BasicOperations/GetAdGroups.vb b/examples/AdWords/Vb/v201309/BasicOperations/GetAdGroups.vb new file mode 100644 index 00000000000..5070a4920b8 --- /dev/null +++ b/examples/AdWords/Vb/v201309/BasicOperations/GetAdGroups.vb @@ -0,0 +1,114 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example illustrates how to retrieve all the ad groups for a + ''' campaign. To create an ad group, run AddAdGroup.vb. + ''' + ''' Tags: AdGroupService.get + ''' + Public Class GetAdGroups + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAdGroups + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to retrieve all the ad groups for a " & _ + "campaign. To create an ad group, run AddAdGroup.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which ad groups are + ''' retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService( _ + AdWordsService.v201309.AdGroupService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "Name"} + + ' Create the filters. + Dim predicate As New Predicate + predicate.field = "CampaignId" + predicate.operator = PredicateOperator.EQUALS + predicate.values = New String() {campaignId.ToString} + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the ad groups. + page = adGroupService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each adGroup As AdGroup In page.entries + Console.WriteLine("{0}) Ad group name is ""{1}"" and id is ""{2}"".", i, _ + adGroup.name, adGroup.id) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of ad groups found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve ad group(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/BasicOperations/GetCampaigns.vb b/examples/AdWords/Vb/v201309/BasicOperations/GetCampaigns.vb new file mode 100644 index 00000000000..9aea8a801ab --- /dev/null +++ b/examples/AdWords/Vb/v201309/BasicOperations/GetCampaigns.vb @@ -0,0 +1,103 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example lists all campaigns. To add a campaign, run + ''' AddCampaign.vb. + ''' + ''' Tags: CampaignService.get + ''' + Public Class GetCampaigns + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetCampaigns + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example lists all campaigns. To add a campaign, run AddCampaign.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201309.CampaignService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "Name", "Status"} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New CampaignPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the campaigns. + page = campaignService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each campaign As Campaign In page.entries + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = " & _ + "'{3}' was found.", i, campaign.id, campaign.name, campaign.status) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve campaign(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/BasicOperations/GetCampaignsWithAwql.vb b/examples/AdWords/Vb/v201309/BasicOperations/GetCampaignsWithAwql.vb new file mode 100644 index 00000000000..a29a8fa61a4 --- /dev/null +++ b/examples/AdWords/Vb/v201309/BasicOperations/GetCampaignsWithAwql.vb @@ -0,0 +1,102 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example lists all campaigns using an AWQL query. See + ''' https://developers.google.com/adwords/api/docs/guides/awql for AWQL + ''' documentation. To add a campaign, run AddCampaign.vb. + ''' + ''' Tags: CampaignService.get + ''' + Public Class GetCampaignsWithAwql + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetCampaignsWithAwql + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example lists all campaigns using an AWQL query. See " & _ + "https://developers.google.com/adwords/api/docs/guides/awql for AWQL " & _ + "documentation. To add a campaign, run AddCampaign.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201309.CampaignService) + + ' Create the query. + Dim query As String = "SELECT Id, Name, Status ORDER BY Name" + + Dim offset As Long = 0 + Dim pageSize As Long = 500 + + Dim page As New CampaignPage() + + Try + Do + Dim queryWithPaging As String = String.Format("{0} LIMIT {1}, {2}", query, offset, _ + pageSize) + + ' Get the campaigns. + page = campaignService.query(queryWithPaging) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each campaign As Campaign In page.entries + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = " & _ + "'{3}' was found.", i, campaign.id, campaign.name, campaign.status) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve campaign(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/BasicOperations/GetKeywords.vb b/examples/AdWords/Vb/v201309/BasicOperations/GetKeywords.vb new file mode 100644 index 00000000000..7f0cc959a01 --- /dev/null +++ b/examples/AdWords/Vb/v201309/BasicOperations/GetKeywords.vb @@ -0,0 +1,128 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example gets all keywords in an account. To add keywords, run + ''' AddKeywords.vb. + ''' + ''' Tags: AdGroupCriterionService.get + ''' + Public Class GetKeywords + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetKeywords + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all keywords in an account. To add keywords, run " & _ + "AddKeywords.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201309.AdGroupCriterionService) + + ' Create a selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "AdGroupId", "KeywordText"} + + ' Select only keywords. + Dim predicate As New Predicate + predicate.field = "CriteriaType" + predicate.operator = PredicateOperator.EQUALS + predicate.values = New String() {"KEYWORD"} + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupCriterionPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the keywords. + page = adGroupCriterionService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each adGroupCriterion As AdGroupCriterion In page.entries + Dim isNegative As Boolean = TypeOf adGroupCriterion Is NegativeAdGroupCriterion + + ' If you are retrieving multiple type of criteria, then you may + ' need to check for + ' + ' if (adGroupCriterion is Keyword) { ... } + ' + ' to identify the criterion type. + Dim keyword As Keyword = adGroupCriterion.criterion + If isNegative Then + Console.WriteLine("{0}) Negative keyword with ad group ID = '{1}', keyword ID " & _ + "= '{2}', and text = '{3}' was found.", i, adGroupCriterion.adGroupId, _ + keyword.id, keyword.text) + Else + Console.WriteLine("{0}) Keyword with ad group ID = '{1}', keyword ID = '{2}', " & _ + "text = '{3}' and matchType = '{4} was found.", i, adGroupCriterion.adGroupId, _ + keyword.id, keyword.text, keyword.matchType) + End If + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of keywords found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve keywords.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/BasicOperations/GetTextAds.vb b/examples/AdWords/Vb/v201309/BasicOperations/GetTextAds.vb new file mode 100644 index 00000000000..8732b343391 --- /dev/null +++ b/examples/AdWords/Vb/v201309/BasicOperations/GetTextAds.vb @@ -0,0 +1,140 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example retrieves all text ads given an existing ad group. To + ''' add ads to an existing ad group, run AddTextAds.vb. + ''' + ''' Tags: AdGroupAdService.get + ''' + Public Class GetTextAds + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetTextAds + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves all text ads given an existing ad group. To add " & _ + "text ads to an existing ad group, run AddTextAds.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group from which text ads are + ''' retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201309.AdGroupAdService) + + ' Create a selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "Status", "Headline", "Description1", _ + "Description2", "DisplayUrl"} + + ' Set the sort order. + Dim orderBy As New OrderBy + orderBy.field = "Id" + orderBy.sortOrder = SortOrder.ASCENDING + selector.ordering = New OrderBy() {orderBy} + + ' Restrict the fetch to only the selected ad group id. + Dim adGroupPredicate As New Predicate + adGroupPredicate.field = "AdGroupId" + adGroupPredicate.operator = PredicateOperator.EQUALS + adGroupPredicate.values = New String() {adGroupId.ToString} + + ' Retrieve only text ads. + Dim typePredicate As New Predicate + typePredicate.field = "AdType" + typePredicate.operator = PredicateOperator.EQUALS + typePredicate.values = New String() {"TEXT_AD"} + + ' By default disabled ads aren't returned by the selector. To return them + ' include the DISABLED status in the statuses field. + Dim statusPredicate As New Predicate + statusPredicate.field = "Status" + statusPredicate.operator = PredicateOperator.IN + + statusPredicate.values = New String() {AdGroupAdStatus.ENABLED.ToString, _ + AdGroupAdStatus.PAUSED.ToString, AdGroupAdStatus.DISABLED.ToString} + + selector.predicates = New Predicate() {adGroupPredicate, statusPredicate, typePredicate} + + ' Select the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupAdPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the text ads. + page = service.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each adGroupAd As AdGroupAd In page.entries + Dim textAd As TextAd = adGroupAd.ad + Console.WriteLine("{0}) Ad id is {1} and status is {2}", i, textAd.id, _ + adGroupAd.status) + Console.WriteLine(" {0}\n {1}\n {2}\n {3}", textAd.headline, _ + textAd.description1, textAd.description2, textAd.displayUrl) + Next + i += 1 + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of text ads found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get text ads.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/BasicOperations/PauseAd.vb b/examples/AdWords/Vb/v201309/BasicOperations/PauseAd.vb new file mode 100644 index 00000000000..612ca3f1891 --- /dev/null +++ b/examples/AdWords/Vb/v201309/BasicOperations/PauseAd.vb @@ -0,0 +1,102 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example pauses a given ad. To list all ads, run GetTextAds.cs. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class PauseAd + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New PauseAd + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim adId As Long = Long.Parse("INSERT_AD_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, adId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example pauses a given ad. To list all ads, run GetTextAds.cs." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the ad. + ''' + ''' Id of the ad to be paused. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal adId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201309.AdGroupAdService) + + Dim status As AdGroupAdStatus = AdGroupAdStatus.PAUSED + + ' Create the ad group ad. + Dim adGroupAd As New AdGroupAd + adGroupAd.status = status + adGroupAd.adGroupId = adGroupId + + adGroupAd.ad = New Ad + adGroupAd.ad.id = adId + + ' Create the operation. + Dim adGroupAdOperation As New AdGroupAdOperation + adGroupAdOperation.operator = [Operator].SET + adGroupAdOperation.operand = adGroupAd + + Try + ' Update the ad. + Dim retVal As AdGroupAdReturnValue = service.mutate( _ + New AdGroupAdOperation() {adGroupAdOperation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim pausedAdGroupAd As AdGroupAd = retVal.value(0) + Console.WriteLine("Ad with id ""{0}"" was paused.", pausedAdGroupAd.ad.id) + Else + Console.WriteLine("No ads were paused.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to pause ad.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/BasicOperations/UpdateAdGroup.vb b/examples/AdWords/Vb/v201309/BasicOperations/UpdateAdGroup.vb new file mode 100644 index 00000000000..4ae847f67f7 --- /dev/null +++ b/examples/AdWords/Vb/v201309/BasicOperations/UpdateAdGroup.vb @@ -0,0 +1,96 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example illustrates how to update an ad group, setting its + ''' status to 'PAUSED'. To create an ad group, run AddAdGroup.vb. + ''' + ''' Tags: AdGroupService.mutate + ''' + Public Class UpdateAdGroup + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UpdateAdGroup + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to update an ad group, setting its status " & _ + "to 'PAUSED'. To create an ad group, run AddAdGroup.vb" + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to be updated. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService(AdWordsService.v201309.AdGroupService) + + ' Create the ad group. + Dim adGroup As New AdGroup + adGroup.status = AdGroupStatus.PAUSED + adGroup.id = adGroupId + + ' Create the operation. + Dim operation As New AdGroupOperation + operation.operator = [Operator].SET + operation.operand = adGroup + + Try + ' Update the ad group. + Dim retVal As AdGroupReturnValue = adGroupService.mutate(New AdGroupOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim pausedAdGroup As AdGroup = retVal.value(0) + Console.WriteLine("Ad group with id = '{0}' was successfully updated.", _ + pausedAdGroup.id) + Else + Console.WriteLine("No ad groups were updated.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to update ad groups.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/BasicOperations/UpdateCampaign.vb b/examples/AdWords/Vb/v201309/BasicOperations/UpdateCampaign.vb new file mode 100644 index 00000000000..e1849fa4ab2 --- /dev/null +++ b/examples/AdWords/Vb/v201309/BasicOperations/UpdateCampaign.vb @@ -0,0 +1,97 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example updates a campaign. To get campaigns, run + ''' GetCampaigns.vb. + ''' + ''' Tags: CampaignService.mutate + ''' + Public Class UpdateCampaign + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UpdateCampaign + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example updates a campaign. To get campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to be updated. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201309.CampaignService) + + ' Create campaign with updated budget. + Dim campaign As New Campaign + campaign.id = campaignId + campaign.status = CampaignStatus.PAUSED + + ' Create the operations. + Dim operation As New CampaignOperation + operation.operator = [Operator].SET + operation.operand = campaign + + Try + ' Update the campaign. + Dim retVal As CampaignReturnValue = campaignService.mutate( _ + New CampaignOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim updatedCampaign As Campaign = retVal.value(0) + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was updated.", _ + updatedCampaign.name, updatedCampaign.id) + Else + Console.WriteLine("No campaigns were updated.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to update campaigns.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/BasicOperations/UpdateKeyword.vb b/examples/AdWords/Vb/v201309/BasicOperations/UpdateKeyword.vb new file mode 100644 index 00000000000..6d45d259030 --- /dev/null +++ b/examples/AdWords/Vb/v201309/BasicOperations/UpdateKeyword.vb @@ -0,0 +1,122 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example updates the bid of a keyword. To get keyword, run + ''' GetKeywords.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class UpdateKeyword + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UpdateKeyword + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim keywordId As Long = Long.Parse("INSERT_KEYWORD_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, keywordId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example updates the bid of a keyword. To get keyword, run GetKeywords.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the keyword. + ''' + ''' Id of the keyword to be updated. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal keywordId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201309.AdGroupCriterionService) + + ' Since we are not updating any keyword-specific fields, it is enough to + ' create a criterion object. + Dim criterion As New Criterion + criterion.id = keywordId + + ' Create ad group criterion. + Dim biddableAdGroupCriterion As New BiddableAdGroupCriterion + biddableAdGroupCriterion.adGroupId = adGroupId + biddableAdGroupCriterion.criterion = criterion + + ' Create the bids. + Dim biddingConfig As New BiddingStrategyConfiguration() + Dim cpcBid As New CpcBid() + cpcBid.bid = New Money() + cpcBid.bid.microAmount = 1000000 + biddingConfig.bids = New Bids() {cpcBid} + + biddableAdGroupCriterion.biddingStrategyConfiguration = biddingConfig + + ' Create the operation. + Dim operation As New AdGroupCriterionOperation + operation.operator = [Operator].SET + operation.operand = biddableAdGroupCriterion + + Try + ' Update the keyword. + Dim retVal As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + New AdGroupCriterionOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim adGroupCriterion As BiddableAdGroupCriterion = retVal.value(0) + Dim bidAmount As Long = 0L + For Each bids As Bids In adGroupCriterion.biddingStrategyConfiguration.bids + If TypeOf bids Is CpcBid Then + bidAmount = TryCast(bids, CpcBid).bid.microAmount + End If + Next + + Console.WriteLine("Keyword with ad group id = '{0}', id = '{1}' was updated with " & _ + "bid amount = '{2}' micros.", adGroupCriterion.adGroupId, _ + adGroupCriterion.criterion.id, bidAmount) + Else + Console.WriteLine("No keyword was updated.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to update keyword.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/CampaignManagement/AddExperiment.vb b/examples/AdWords/Vb/v201309/CampaignManagement/AddExperiment.vb new file mode 100644 index 00000000000..80afbd5a7b1 --- /dev/null +++ b/examples/AdWords/Vb/v201309/CampaignManagement/AddExperiment.vb @@ -0,0 +1,216 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example creates an experiment using a query percentage of 10, + ''' which defines what fraction of auctions should go to the control split + ''' (90%) vs. the experiment split (10%), then adds experimental bid changes + ''' for criteria and ad groups. To get campaigns, run GetCampaigns.vb. + ''' To get ad groups, run GetAdGroups.vb. To get criteria, run + ''' GetKeywords.vb. + ''' + ''' Tags: ExperimentService.mutate + ''' + Public Class AddExperiment + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddExperiment + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim criterionId As Long = Long.Parse("INSERT_CRITERION_ID_HERE") + + codeExample.Run(New AdWordsUser, campaignId, adGroupId, criterionId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example creates an experiment using a query percentage of 10, which " & _ + "defines what fraction of auctions should go to the control split (90%) vs. the " & _ + "experiment split (10%), then adds experimental bid changes for criteria and ad " & _ + "groups. To get campaigns, run GetCampaigns.vb. To get ad groups, run " & _ + "GetAdGroups.vb. To get criteria, run GetKeywords.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to which experiments are + ''' added. + ''' Id of the ad group to which experiments are + ''' added. + ''' Id of the criterion for which experiments + ''' are added. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long, ByVal adGroupId As Long, _ + ByVal criterionId As Long) + ' Get the ExperimentService. + Dim experimentService As ExperimentService = user.GetService( _ + AdWordsService.v201309.ExperimentService) + + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService(AdWordsService.v201309.AdGroupService) + + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201309.AdGroupCriterionService) + + ' Create the experiment. + Dim experiment As New Experiment + experiment.campaignId = campaignId + experiment.name = ("Interplanetary Cruise #" & ExampleUtilities.GetRandomString) + experiment.queryPercentage = 10 + experiment.startDateTime = DateTime.Now.AddDays(1).ToString("yyyyMMdd HHmmss") + + ' Optional: Set the end date. + experiment.endDateTime = DateTime.Now.AddDays(30).ToString("yyyyMMdd HHmmss") + + ' Optional: Set the status. + experiment.status = ExperimentStatus.ACTIVE + + ' Create the operation. + Dim experimentOperation As New ExperimentOperation + experimentOperation.operator = [Operator].ADD + experimentOperation.operand = experiment + + Try + ' Add the experiment. + Dim experimentRetVal As ExperimentReturnValue = experimentService.mutate( _ + New ExperimentOperation() {experimentOperation}) + + 'Display the results. + If ((Not experimentRetVal Is Nothing) AndAlso (Not experimentRetVal.value Is Nothing) _ + AndAlso (experimentRetVal.value.Length > 0)) Then + Dim experimentId As Long = 0 + + Dim newExperiment As Experiment = experimentRetVal.value(0) + + Console.WriteLine("Experiment with name = ""{0}"" and id = ""{1}"" was added.", _ + newExperiment.name, newExperiment.id) + experimentId = newExperiment.id + + ' Set ad group for the experiment. + Dim adGroup As New AdGroup + adGroup.id = adGroupId + + ' Create experiment bid multiplier rule that will modify ad group bid + ' for the experiment. + Dim adGroupBidMultiplier As New ManualCPCAdGroupExperimentBidMultipliers + adGroupBidMultiplier.maxCpcMultiplier = New BidMultiplier + adGroupBidMultiplier.maxCpcMultiplier.multiplier = 1.5 + + ' Set experiment data to the ad group. + Dim adGroupExperimentData As New AdGroupExperimentData + adGroupExperimentData.experimentId = experimentId + adGroupExperimentData.experimentDeltaStatus = ExperimentDeltaStatus.MODIFIED + adGroupExperimentData.experimentBidMultipliers = adGroupBidMultiplier + + adGroup.experimentData = adGroupExperimentData + + ' Create the operation. + Dim adGroupOperation As New AdGroupOperation + adGroupOperation.operand = adGroup + adGroupOperation.operator = [Operator].SET + + ' Update the ad group. + Dim adGroupRetVal As AdGroupReturnValue = adGroupService.mutate( _ + New AdGroupOperation() {adGroupOperation}) + + ' Display the results. + If ((Not adGroupRetVal Is Nothing) AndAlso (Not adGroupRetVal.value Is Nothing) _ + AndAlso (adGroupRetVal.value.Length > 0)) Then + Dim updatedAdGroup As AdGroup = adGroupRetVal.value(0) + Console.WriteLine("Ad group with name = ""{0}"", id = ""{1}"" and status = " & _ + """{2}"" was updated for the experiment.", updatedAdGroup.name, _ + updatedAdGroup.id, updatedAdGroup.status) + Else + Console.WriteLine("No ad groups were updated.") + End If + + ' Set ad group criteria for the experiment. + Dim criterion As New Criterion + criterion.id = criterionId + + Dim adGroupCriterion As New BiddableAdGroupCriterion + adGroupCriterion.adGroupId = adGroupId + adGroupCriterion.criterion = criterion + + ' Create experiment bid multiplier rule that will modify criterion bid + ' for the experiment. + Dim bidMultiplier As New ManualCPCAdGroupCriterionExperimentBidMultiplier + bidMultiplier.maxCpcMultiplier = New BidMultiplier + bidMultiplier.maxCpcMultiplier.multiplier = 1.5 + + ' Set experiment data to the criterion. + Dim adGroupCriterionExperimentData As New BiddableAdGroupCriterionExperimentData + adGroupCriterionExperimentData.experimentId = experimentId + adGroupCriterionExperimentData.experimentDeltaStatus = ExperimentDeltaStatus.MODIFIED + adGroupCriterionExperimentData.experimentBidMultiplier = bidMultiplier + + adGroupCriterion.experimentData = adGroupCriterionExperimentData + + ' Create the operation. + Dim adGroupCriterionOperation As New AdGroupCriterionOperation + adGroupCriterionOperation.operand = adGroupCriterion + adGroupCriterionOperation.operator = [Operator].SET + + ' Update the ad group criteria. + Dim adGroupCriterionRetVal As AdGroupCriterionReturnValue = _ + adGroupCriterionService.mutate(New AdGroupCriterionOperation() _ + {adGroupCriterionOperation}) + + ' Display the results. + If ((Not adGroupCriterionRetVal Is Nothing) AndAlso _ + (Not adGroupCriterionRetVal.value Is Nothing) AndAlso _ + (adGroupCriterionRetVal.value.Length > 0)) Then + Dim updatedAdGroupCriterion As AdGroupCriterion = adGroupCriterionRetVal.value(0) + Console.WriteLine("Ad group criterion with ad group id = ""{0}"", criterion id =" & _ + " ""{1}"" and type = ""{2}"" was updated for the experiment.", _ + updatedAdGroupCriterion.adGroupId, updatedAdGroupCriterion.criterion.id, _ + updatedAdGroupCriterion.criterion.CriterionType) + Else + Console.WriteLine("No ad group criteria were updated.") + End If + Else + Console.WriteLine("No experiments were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add experiment(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/CampaignManagement/AddKeywordsInBulk.vb b/examples/AdWords/Vb/v201309/CampaignManagement/AddKeywordsInBulk.vb new file mode 100644 index 00000000000..829629be41c --- /dev/null +++ b/examples/AdWords/Vb/v201309/CampaignManagement/AddKeywordsInBulk.vb @@ -0,0 +1,186 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Text.RegularExpressions +Imports System.Threading + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example shows how to add keywords in bulk using the + ''' MutateJobService. + ''' + ''' Tags: MutateJobService.mutate, MutateJobService.get + ''' Tags: MutateJobService.getResult + ''' + Public Class AddKeywordsInBulk + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddKeywordsInBulk + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example shows how to add keywords in bulk using the MutateJobService." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad groups to which keywords are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the MutateJobService. + Dim mutateJobService As MutateJobService = user.GetService( _ + AdWordsService.v201309.MutateJobService) + + Const RETRY_INTERVAL As Integer = 30 + Const RETRIES_COUNT As Integer = 30 + Const KEYWORD_NUMBER As Integer = 100 + Const INDEX_REGEX As String = "operations\[(\d+)\].operand" + + Dim operations As New List(Of Operation) + + ' Create AdGroupCriterionOperation to add keywords. + For i As Integer = 0 To KEYWORD_NUMBER + Dim keyword As New Keyword + keyword.text = String.Format("mars cruise {0}", i) + keyword.matchType = KeywordMatchType.BROAD + + Dim criterion As New BiddableAdGroupCriterion + criterion.adGroupId = adGroupId + criterion.criterion = keyword + + Dim adGroupCriterionOperation As New AdGroupCriterionOperation + adGroupCriterionOperation.operator = [Operator].ADD + adGroupCriterionOperation.operand = criterion + + operations.Add(adGroupCriterionOperation) + Next i + + Dim policy As New BulkMutateJobPolicy + ' You can specify up to 3 job IDs that must successfully complete before + ' this job can be processed. + policy.prerequisiteJobIds = New Long() {} + + Dim job As SimpleMutateJob = mutateJobService.mutate(operations.ToArray, policy) + + ' Wait for the job to complete. + Dim completed As Boolean = False + Dim retryCount As Integer = 0 + Console.WriteLine("Retrieving job status...") + + While (completed = False AndAlso retryCount < RETRIES_COUNT) + Dim selector As New BulkMutateJobSelector + selector.jobIds = New Long() {job.id} + + Try + Dim allJobs As Job() = mutateJobService.get(selector) + If ((Not allJobs Is Nothing) AndAlso (allJobs.Length > 0)) Then + job = allJobs(0) + If ((job.status = BasicJobStatus.COMPLETED) OrElse _ + (job.status = BasicJobStatus.FAILED)) Then + completed = True + Exit While + Else + Console.WriteLine("{0}: Current status is {1}, waiting {2} seconds to retry...", _ + retryCount, job.status, RETRY_INTERVAL) + Thread.Sleep(RETRY_INTERVAL * 1000) + retryCount = retryCount + 1 + End If + End If + Catch ex As Exception + Throw New System.ApplicationException(String.Format("Failed to fetch simple mutate " & _ + "job with id = {0}.", job.id), ex) + Return + End Try + End While + + If (job.status = BasicJobStatus.COMPLETED) Then + ' Handle cases where the job completed. + + ' Create the job selector. + Dim selector As New BulkMutateJobSelector + selector.jobIds = New Long() {job.id} + + ' Get the job results. + Dim jobResult As JobResult = mutateJobService.getResult(selector) + If Not jobResult Is Nothing Then + Dim results As SimpleMutateResult = jobResult.Item + If Not results Is Nothing Then + 'Display the results. + If Not results.results Is Nothing Then + For i As Integer = 0 To results.results.Length - 1 + Dim operand As Operand = results.results(i) + Dim status As String + If TypeOf operand.Item Is PlaceHolder Then + status = "FAILED" + Else + status = "SUCCEEDED" + End If + Console.WriteLine("Operation {0} - {1}", i, status) + Next i + End If + + ' Display the errors. + If Not results.errors Is Nothing Then + For Each apiError As ApiError In results.errors + Dim match As Match = Regex.Match(apiError.fieldPath, INDEX_REGEX, _ + RegexOptions.IgnoreCase) + Dim index As String = "???" + If (match.Success) Then + index = match.Groups(1).Value + End If + Console.WriteLine("Operation index {0} failed due to reason: '{1}', " & _ + "trigger: '{2}'", index, apiError.errorString, apiError.trigger) + Next + End If + End If + End If + Console.WriteLine("Job completed successfully!") + ElseIf (job.status = BasicJobStatus.FAILED) Then + ' Handle the cases where job failed. + Console.WriteLine("Job failed with reason: " & job.failureReason.ToString()) + ElseIf (job.status = BasicJobStatus.PROCESSING OrElse job.status = BasicJobStatus.PENDING) _ + Then + ' Handle the cases where job didn't complete after wait period. + Console.WriteLine("Job did not complete in {0} secconds.", RETRY_INTERVAL * RETRIES_COUNT) + End If + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/CampaignManagement/AddLocationExtension.vb b/examples/AdWords/Vb/v201309/CampaignManagement/AddLocationExtension.vb new file mode 100644 index 00000000000..92c0981913c --- /dev/null +++ b/examples/AdWords/Vb/v201309/CampaignManagement/AddLocationExtension.vb @@ -0,0 +1,150 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example shows how to add a location extension to an existing + ''' campaign. To create a campaign, run AddCampaign.vb. + ''' + ''' Tags: GeoLocationService.get, CampaignAdExtensionService.mutate + ''' + Public Class AddLocationExtension + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddLocationExtension + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example shows how to add a location extension to an existing" & _ + " campaign. To create a campaign, run AddCampaign.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to which location + ''' extensions are added. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignAdExtensionService. + Dim campaignExtensionService As CampaignAdExtensionService = user.GetService( _ + AdWordsService.v201309.CampaignAdExtensionService) + + ' Add location 1: 1600 Amphitheatre Pkwy, Mountain View, US. + Dim address1 As New Address + address1.streetAddress = "1600 Amphitheatre Parkway" + address1.cityName = "Mountain View" + address1.provinceCode = "CA" + address1.postalCode = "94043" + address1.countryCode = "US" + + ' Add location 2: 38 avenue de l'Opéra, 75002 Paris, FR. + Dim address2 As New Address + address2.streetAddress = "38 avenue de l'Opéra" + address2.cityName = "Paris" + address2.postalCode = "75002" + address2.countryCode = "FR" + + ' Get the GeoLocationService. + Dim geoService As GeoLocationService = user.GetService( _ + AdWordsService.v201309.GeoLocationService) + + ' Create the selector. + Dim selector As New GeoLocationSelector + selector.addresses = New Address() {address1, address2} + + ' Retrieve the locations. + Dim locations As GeoLocation() = geoService.get(selector) + + Dim operations As New List(Of CampaignAdExtensionOperation) + + ' Phone numbers for US and FR offices. + Dim phoneNumbers As String() = New String() {"(650) 253-0000", "(0)1 42 68 53 00"} + Dim index As Integer = 0 + + ' Create a location extension for each geo location returned by the + ' server. + For Each location As GeoLocation In locations + Dim locationExtension As New LocationExtension + locationExtension.address = location.address + locationExtension.geoPoint = location.geoPoint + locationExtension.encodedLocation = location.encodedLocation + locationExtension.source = LocationExtensionSource.ADWORDS_FRONTEND + + ' Optional: Set the company name. + locationExtension.companyName = "ACME Inc." + + ' Optional: Set the phone number. + locationExtension.phoneNumber = phoneNumbers(index) + index = index + 1 + + Dim extension As New CampaignAdExtension + extension.campaignId = campaignId + extension.status = CampaignAdExtensionStatus.ACTIVE + extension.adExtension = locationExtension + + Dim operation As New CampaignAdExtensionOperation + operation.operator = [Operator].ADD + operation.operand = extension + + operations.Add(operation) + Next + + Try + ' Create the location extensions. + Dim retVal As CampaignAdExtensionReturnValue = campaignExtensionService.mutate( _ + operations.ToArray) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + For Each campaignExtension As CampaignAdExtension In retVal.value + Console.WriteLine("Created a location extension with id = ""{0}"" and status " & _ + "= ""{1}""", campaignExtension.adExtension.id, campaignExtension.status) + Next + Else + Console.WriteLine("No location extensions were created.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add location extensions.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/CampaignManagement/GetAllDisapprovedAds.vb b/examples/AdWords/Vb/v201309/CampaignManagement/GetAllDisapprovedAds.vb new file mode 100644 index 00000000000..bf964f293a4 --- /dev/null +++ b/examples/AdWords/Vb/v201309/CampaignManagement/GetAllDisapprovedAds.vb @@ -0,0 +1,121 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example retrieves all the disapproved ads in a given campaign. + ''' + ''' Tags: AdGroupAdService.get + ''' + Public Class GetAllDisapprovedAds + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAllDisapprovedAds + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves all the disapproved ads in a given campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which disapproved ads + ''' are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201309.AdGroupAdService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "AdGroupCreativeApprovalStatus", _ + "AdGroupAdDisapprovalReasons"} + + ' Set the filters. + Dim campaignPredicate As New Predicate + campaignPredicate.operator = PredicateOperator.EQUALS + campaignPredicate.field = "CampaignId" + campaignPredicate.values = New String() {campaignId.ToString} + + Dim approvalPredicate As New Predicate + approvalPredicate.operator = PredicateOperator.EQUALS + approvalPredicate.field = "AdGroupCreativeApprovalStatus" + approvalPredicate.values = New String() {AdGroupAdApprovalStatus.DISAPPROVED.ToString()} + + selector.predicates = New Predicate() {campaignPredicate, approvalPredicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupAdPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the disapproved ads. + page = service.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each adGroupAd As AdGroupAd In page.entries + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " & _ + "reason(s):", i, adGroupAd.ad.id) + For Each reason As String In adGroupAd.disapprovalReasons + Console.WriteLine(" {0}", reason) + Next + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get disapproved ads.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb b/examples/AdWords/Vb/v201309/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb new file mode 100644 index 00000000000..3ea88a32da8 --- /dev/null +++ b/examples/AdWords/Vb/v201309/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb @@ -0,0 +1,111 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example retrieves all the disapproved ads in a given campaign + ''' using an AWQL query. See + ''' https://developers.google.com/adwords/api/docs/guides/awql for AWQL + ''' documentation. + ''' + ''' Tags: AdGroupAdService.get + ''' + Public Class GetAllDisapprovedAdsWithAwql + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAllDisapprovedAdsWithAwql + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves all the disapproved ads in a given campaign using " & _ + "an AWQL query. See https://developers.google.com/adwords/api/docs/guides/awql for " & _ + "AWQL documentation." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which disapproved ads + ''' are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201309.AdGroupAdService) + + ' Get all the disapproved ads for this campaign. + Dim query As String = String.Format("SELECT Id, AdGroupAdDisapprovalReasons WHERE " & _ + "CampaignId = {0} AND AdGroupCreativeApprovalStatus = DISAPPROVED ORDER BY Id", _ + campaignId) + + Dim offset As Long = 0 + Dim pageSize As Long = 500 + + Dim page As New AdGroupAdPage() + + Try + Do + Dim queryWithPaging As String = String.Format("{0} LIMIT {1}, {2}", query, offset, _ + pageSize) + + ' Get the disapproved ads. + page = service.query(queryWithPaging) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each adGroupAd As AdGroupAd In page.entries + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " & _ + "reason(s):", i, adGroupAd.ad.id) + For Each reason As String In adGroupAd.disapprovalReasons + Console.WriteLine(" {0}", reason) + Next + i = i + 1 + Next + End If + + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get disapproved ads.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/CampaignManagement/PromoteExperiment.vb b/examples/AdWords/Vb/v201309/CampaignManagement/PromoteExperiment.vb new file mode 100644 index 00000000000..4e9e22372ea --- /dev/null +++ b/examples/AdWords/Vb/v201309/CampaignManagement/PromoteExperiment.vb @@ -0,0 +1,100 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This example promotes an experiment, which permanently applies all the + ''' experiment changes made to its related ad groups, criteria and ads. To + ''' create an experiment, run AddExperiment.vb. + ''' + ''' Tags: ExperimentService.mutate + ''' + Public Class PromoteExperiment + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New PromoteExperiment + Console.WriteLine(codeExample.Description) + Try + Dim experimentId As Long = Long.Parse("INSERT_EXPERIMENT_ID_HERE") + codeExample.Run(New AdWordsUser, experimentId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This example promotes an experiment, which permanently applies all the " & _ + "experiment changes made to its related ad groups, criteria and ads. To create an " & _ + "experiment, run AddExperiment.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the experiment to be promoted. + Public Sub Run(ByVal user As AdWordsUser, ByVal experimentId As Long) + ' Get the ExperimentService. + Dim experimentService As ExperimentService = user.GetService( _ + AdWordsService.v201309.ExperimentService) + + ' Set experiment's status to PROMOTED. + Dim experiment As New Experiment + experiment.id = experimentId + experiment.status = ExperimentStatus.PROMOTED + + ' Create the operation. + Dim operation As New ExperimentOperation + operation.operator = [Operator].SET + operation.operand = experiment + + Try + ' Update the experiment. + Dim retVal As ExperimentReturnValue = experimentService.mutate( _ + New ExperimentOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim promotedExperiment As Experiment = retVal.value(0) + Console.WriteLine("Experiment with name = ""{0}"" and id = ""{1}"" was promoted.", _ + promotedExperiment.name, promotedExperiment.id) + Else + Console.WriteLine("No experiments were promoted.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to promote experiment(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/CampaignManagement/SetAdParameters.vb b/examples/AdWords/Vb/v201309/CampaignManagement/SetAdParameters.vb new file mode 100644 index 00000000000..6263da03fa5 --- /dev/null +++ b/examples/AdWords/Vb/v201309/CampaignManagement/SetAdParameters.vb @@ -0,0 +1,155 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example illustrates how to create a text ad with ad parameters. + ''' To add an ad group, run AddAdGroup.vb. To add a keyword, run + ''' AddKeyword.vb. + ''' + ''' Tags: AdGroupAdService.mutate, AdParamService.mutate + ''' + Public Class SetAdParameters + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New SetAdParameters + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim criterionId As Long = Long.Parse("INSERT_CRITERION_ID_HERE") + + codeExample.Run(New AdWordsUser, adGroupId, criterionId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to create a text ad with ad parameters. To " & _ + "add an ad group, run AddAdGroup.vb. To add a keyword, run AddKeyword.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the criterion. + ''' + ''' Id of the keyword for which the ad + ''' parameters are set. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal criterionId As Long) + ' Get the AdGroupAdService. + Dim adGroupAdService As AdGroupAdService = user.GetService( _ + AdWordsService.v201309.AdGroupAdService) + + ' Get the AdParamService. + Dim adParamService As AdParamService = user.GetService( _ + AdWordsService.v201309.AdParamService) + + ' Create the text ad. + Dim textAd As New TextAd + textAd.url = "http://www.example.com" + textAd.displayUrl = "example.com" + textAd.headline = " Mars Cruises" + textAd.description1 = "Low-gravity fun for {param1:cheap}." + textAd.description2 = "Only {param2:a few} seats left!" + + Dim adOperand As New AdGroupAd + adOperand.adGroupId = adGroupId + adOperand.status = AdGroupAdStatus.ENABLED + adOperand.ad = textAd + + ' Create the operation. + Dim adOperation As New AdGroupAdOperation + adOperation.operand = adOperand + adOperation.operator = [Operator].ADD + + Try + ' Create the text ad. + Dim retVal As AdGroupAdReturnValue = adGroupAdService.mutate( _ + New AdGroupAdOperation() {adOperation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) _ + AndAlso (retVal.value.Length > 0)) Then + Console.WriteLine("Text ad with id = ""{0}"" was successfully added.", _ + retVal.value(0).ad.id) + Else + Console.WriteLine("No text ads were created.") + Return + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create text ads.", ex) + Return + End Try + + ' Create the ad param for price. + Dim priceParam As New AdParam + priceParam.adGroupId = adGroupId + priceParam.criterionId = criterionId + priceParam.paramIndex = 1 + priceParam.insertionText = "$100" + + ' Create the ad param for seats. + Dim seatParam As New AdParam + seatParam.adGroupId = adGroupId + seatParam.criterionId = criterionId + seatParam.paramIndex = 2 + seatParam.insertionText = "50" + + ' Create the operations. + Dim priceOperation As New AdParamOperation + priceOperation.operator = [Operator].SET + priceOperation.operand = priceParam + + Dim seatOperation As New AdParamOperation + seatOperation.operator = [Operator].SET + seatOperation.operand = seatParam + + Try + ' Set the ad parameters. + Dim newAdParams As AdParam() = adParamService.mutate(New AdParamOperation() _ + {priceOperation, seatOperation}) + + 'Display the results. + If (Not newAdParams Is Nothing) Then + Console.WriteLine("Ad parameters were successfully updated.") + Else + Console.WriteLine("No ad parameters were set.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to set ad parameter(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/CampaignManagement/SetBidModifier.vb b/examples/AdWords/Vb/v201309/CampaignManagement/SetBidModifier.vb new file mode 100644 index 00000000000..42df16a0db4 --- /dev/null +++ b/examples/AdWords/Vb/v201309/CampaignManagement/SetBidModifier.vb @@ -0,0 +1,112 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example sets a bid modifier for the mobile platform on given + ''' campaign. The campaign must be an enhanced type of campaign. To get + ''' campaigns, run GetCampaigns.vb. To enhance a campaign, run + ''' SetCampaignEnhanced.vb. + ''' + ''' Tags: CampaignCriterionService.mutate + ''' + Public Class SetBidModifier + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New SetBidModifier + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + Dim bidModifier As Double = Double.Parse("INSERT_BID_MODIFIER_HERE") + codeExample.Run(New AdWordsUser, campaignId, bidModifier) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example sets a bid modifier for the mobile platform on given " & _ + "campaign. The campaign must be an enhanced type of campaign. To get campaigns, " & _ + "run GetCampaigns.vb. To enhance a campaign, run SetCampaignEnhanced.vb." + End Get + End Property + + ''' + ''' Runs the specified user. + ''' + ''' The AdWords user. + ''' Id of the campaign whose bid should be modified. + ''' + ''' The bid modifier. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long, ByVal bidModifier As Double) + ' Get the CampaignCriterionService. + Dim campaignCriterionService As CampaignCriterionService = user.GetService( _ + AdWordsService.v201309.CampaignCriterionService) + + ' Create mobile platform. The ID can be found in the documentation. + ' https://developers.google.com/adwords/api/docs/appendix/platforms + Dim mobile As New Platform() + mobile.id = 30001 + + ' Create criterion with modified bid. + Dim criterion As New CampaignCriterion() + criterion.campaignId = campaignId + criterion.criterion = mobile + criterion.bidModifier = bidModifier + + ' Create SET operation. + Dim operation As New CampaignCriterionOperation() + operation.operator = [Operator].SET + operation.operand = criterion + + Try + ' Update campaign criteria. + Dim result As CampaignCriterionReturnValue = campaignCriterionService.mutate( _ + New CampaignCriterionOperation() {operation}) + + ' Display campaign criteria. + If Not result.value Is Nothing Then + For Each newCriterion As CampaignCriterion In result.value + Console.WriteLine("Campaign criterion with campaign id '{0}', criterion id '{1}' " & _ + "and type '{2}' was modified with bid {3:F2}.", newCriterion.campaignId, _ + newCriterion.criterion.id, newCriterion.criterion.type, newCriterion.bidModifier) + Next + Else + Console.WriteLine("No campaigns were modified.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to set bid modifier.", ex) + End Try + End Sub + End Class +End Namespace \ No newline at end of file diff --git a/examples/AdWords/Vb/v201309/CampaignManagement/ValidateTextAd.vb b/examples/AdWords/Vb/v201309/CampaignManagement/ValidateTextAd.vb new file mode 100644 index 00000000000..e5c723d0afe --- /dev/null +++ b/examples/AdWords/Vb/v201309/CampaignManagement/ValidateTextAd.vb @@ -0,0 +1,110 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example shows how to use the validateOnly header to validate + ''' a text ad. No objects will be created, but exceptions will still be + ''' thrown. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class ValidateTextAd + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New ValidateTextAd + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example shows how to use the validateOnly header to validate a text " & _ + "ad. No objects will be created, but exceptions will still be thrown." + End Get + End Property + + ''' + ''' Runs the specified user. + ''' + ''' The AdWords user. + ''' Id of the ad group to which text ads are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim adGroupAdService As AdGroupAdService = user.GetService( _ + AdWordsService.v201309.AdGroupAdService) + + ' Set the validateOnly headers. + adGroupAdService.RequestHeader.validateOnly = True + + ' Create your text ad. + Dim textAd As New TextAd + textAd.headline = "Luxury Cruise to Mars" + textAd.description1 = "Visit the Red Planet in style." + textAd.description2 = "Low-gravity fun for everyone!!" + textAd.displayUrl = "www.example.com" + textAd.url = "http://www.example.com" + + Dim textAdGroupAd As New AdGroupAd + textAdGroupAd.adGroupId = adGroupId + textAdGroupAd.ad = textAd + + Dim textAdOperation As New AdGroupAdOperation + textAdOperation.operator = [Operator].ADD + textAdOperation.operand = textAdGroupAd + Try + Dim retVal As AdGroupAdReturnValue = adGroupAdService.mutate( _ + New AdGroupAdOperation() {textAdOperation}) + ' Since validation is ON, result will be null. + Console.WriteLine("text ad validated successfully.") + Catch ex As AdWordsApiException + ' This block will be hit if there is a validation error from the server. + Console.WriteLine("There were validation error(s) while adding text ad.") + + If (Not ex.ApiException Is Nothing) Then + For Each apiError As ApiError In DirectCast(ex.ApiException, ApiException).errors + Console.WriteLine(" Error type is '{0}' and fieldPath is '{1}'.", _ + apiError.ApiErrorType, apiError.fieldPath) + Next + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to validate text ad.", ex) + End Try + End Sub + End Class +End Namespace \ No newline at end of file diff --git a/examples/AdWords/Vb/v201309/ErrorHandling/HandlePartialFailures.vb b/examples/AdWords/Vb/v201309/ErrorHandling/HandlePartialFailures.vb new file mode 100644 index 00000000000..56fe60c105a --- /dev/null +++ b/examples/AdWords/Vb/v201309/ErrorHandling/HandlePartialFailures.vb @@ -0,0 +1,137 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example demonstrates how to handle partial failures. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class HandlePartialFailures + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandlePartialFailures + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example demonstrates how to handle partial failures." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which keywords are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201309.AdGroupCriterionService) + + ' Set partial failure mode for the service. + adGroupCriterionService.RequestHeader.partialFailure = True + + Dim operations As New List(Of AdGroupCriterionOperation) + + ' Create the keywords. + Dim keywords As String() = New String() {"mars cruise", "inv@lid cruise", "venus cruise", _ + "b(a)d keyword cruise"} + + For Each keywordText As String In keywords + Dim keyword As New Keyword + keyword.text = keywordText + keyword.matchType = KeywordMatchType.BROAD + + ' Create biddable ad group criterion. + Dim keywordBiddableAdGroupCriterion As New BiddableAdGroupCriterion + keywordBiddableAdGroupCriterion.adGroupId = adGroupId + keywordBiddableAdGroupCriterion.criterion = keyword + + ' Create the operation. + Dim keywordAdGroupCriterionOperation As New AdGroupCriterionOperation + keywordAdGroupCriterionOperation.operand = keywordBiddableAdGroupCriterion + keywordAdGroupCriterionOperation.operator = [Operator].ADD + operations.Add(keywordAdGroupCriterionOperation) + Next + + Try + ' Create the keywords. + Dim result As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + operations.ToArray) + + ' Display the results. + If ((Not result Is Nothing) AndAlso (Not result.value Is Nothing)) Then + For Each adGroupCriterionResult As AdGroupCriterion In result.value + If (Not adGroupCriterionResult.criterion Is Nothing) Then + Console.WriteLine("Keyword with ad group id '{0}', and criterion id " & _ + "'{1}', and text '{2}' was added.\n", adGroupCriterionResult.adGroupId, _ + adGroupCriterionResult.criterion.id, _ + DirectCast(adGroupCriterionResult.criterion, Keyword).text) + End If + Next + Else + Console.WriteLine("No keywords were added.") + End If + + ' Display the partial failure errors. + If ((Not result Is Nothing) AndAlso (Not result.partialFailureErrors Is Nothing)) Then + For Each apiError As ApiError In result.partialFailureErrors + Dim operationIndex As Integer = ErrorUtilities.GetOperationIndex(apiError.fieldPath) + If (operationIndex <> -1) Then + Dim adGroupCriterion As AdGroupCriterion = operations(operationIndex).operand + Console.WriteLine("Keyword with ad group id '{0}' and text '{1}' " & _ + "triggered a failure for the following reason: '{2}'.\n", _ + adGroupCriterion.adGroupId, _ + DirectCast(adGroupCriterion.criterion, Keyword).text, _ + apiError.errorString) + Else + Console.WriteLine("A failure for the following reason: '{0}' has occurred.\n", _ + apiError.errorString) + End If + Next + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add keyword(s) in partial failure mode.", _ + ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/ErrorHandling/HandlePolicyViolationError.vb b/examples/AdWords/Vb/v201309/ErrorHandling/HandlePolicyViolationError.vb new file mode 100644 index 00000000000..60b53be22d4 --- /dev/null +++ b/examples/AdWords/Vb/v201309/ErrorHandling/HandlePolicyViolationError.vb @@ -0,0 +1,175 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example adds a text ad, and shows how to handle a policy + ''' violation. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class HandlePolicyViolationError + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandlePolicyViolationError + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a text ad, and shows how to handle a policy violation." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which ads are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService( _ + AdWordsService.v201309.AdGroupAdService) + + ' Create the text ad. + Dim textAd As New TextAd + textAd.headline = "Luxury Cruise to Mars" + textAd.description1 = "Visit the Red Planet in style." + textAd.description2 = "Low-gravity fun for everyone!!" + textAd.displayUrl = "www.example.com" + textAd.url = "http://www.example.com" + + Dim textadGroupAd As New AdGroupAd + textadGroupAd.adGroupId = adGroupId + textadGroupAd.ad = textAd + + ' Create the operations. + Dim textAdOperation As New AdGroupAdOperation + textAdOperation.operator = [Operator].ADD + textAdOperation.operand = textadGroupAd + + Try + Dim retVal As AdGroupAdReturnValue = Nothing + + ' Setup two arrays, one to hold the list of all operations to be + ' validated, and another to hold the list of operations that cannot be + ' fixed after validation. + Dim allOperations As New List(Of AdGroupAdOperation) + Dim operationsToBeRemoved As New List(Of AdGroupAdOperation) + + allOperations.Add(textAdOperation) + + Try + ' Validate the operations. + service.RequestHeader.validateOnly = True + retVal = service.mutate(allOperations.ToArray) + Catch ex As AdWordsApiException + Dim innerException As ApiException = TryCast(ex.ApiException, ApiException) + If (innerException Is Nothing) Then + Throw New Exception("Failed to retrieve ApiError. See inner exception for more " & _ + "details.", ex) + End If + + ' Examine each ApiError received from the server. + For Each apiError As ApiError In innerException.errors + Dim index As Integer = ErrorUtilities.GetOperationIndex(apiError.fieldPath) + If (index = -1) Then + ' This API error is not associated with an operand, so we cannot + ' recover from this error by removing one or more operations. + ' Rethrow the exception for manual inspection. + Throw + End If + + ' Handle policy violation errors. + If TypeOf apiError Is PolicyViolationError Then + Dim policyError As PolicyViolationError = apiError + + If policyError.isExemptable Then + ' If the policy violation error is exemptable, add an exemption + ' request. + Dim exemptionRequests As New List(Of ExemptionRequest) + If (Not allOperations.Item(index).exemptionRequests Is Nothing) Then + exemptionRequests.AddRange(allOperations.Item(index).exemptionRequests) + End If + + Dim exemptionRequest As New ExemptionRequest + exemptionRequest.key = policyError.key + exemptionRequests.Add(exemptionRequest) + allOperations.Item(index).exemptionRequests = exemptionRequests.ToArray + Else + ' Policy violation error is not exemptable, remove this + ' operation from the list of operations. + operationsToBeRemoved.Add(allOperations.Item(index)) + End If + Else + ' This is not a policy violation error, remove this operation + ' from the list of operations. + operationsToBeRemoved.Add(allOperations.Item(index)) + End If + Next + + ' Remove all operations that aren't exemptable. + For Each operation As AdGroupAdOperation In operationsToBeRemoved + allOperations.Remove(operation) + Next + End Try + If (allOperations.Count > 0) Then + ' Perform the operations exemptible of a policy violation. + service.RequestHeader.validateOnly = False + retVal = service.mutate(allOperations.ToArray) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) _ + AndAlso (retVal.value.Length > 0)) Then + For Each newAdGroupAd As AdGroupAd In retVal.value + Console.WriteLine("New ad with id = ""{0}"" and displayUrl = ""{1}"" was created.", _ + newAdGroupAd.ad.id, newAdGroupAd.ad.displayUrl) + Next + Else + Console.WriteLine("No ads were created.") + End If + Else + Console.WriteLine("There are no ads to create after policy violation checks.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create Ad(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/ErrorHandling/HandleRateExceededError.vb b/examples/AdWords/Vb/v201309/ErrorHandling/HandleRateExceededError.vb new file mode 100644 index 00000000000..965d10420ee --- /dev/null +++ b/examples/AdWords/Vb/v201309/ErrorHandling/HandleRateExceededError.vb @@ -0,0 +1,206 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Net +Imports System.Threading + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example shows how to handle RateExceededError in your + ''' application. To trigger the rate exceeded error, this code example runs + ''' 100 threads in parallel, each thread attempting to validate 100 keywords + ''' in a single request. Note that spawning 100 parallel threads is for + ''' illustrative purposes only, you shouldn't do this in your application. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class HandleRateExceededError + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandleRateExceededError + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example shows how to handle RateExceededError in your application. " & _ + "To trigger the rate exceeded error, this code example runs 100 threads in " & _ + "parallel, each thread attempting to validate 100 keywords in a single request. " & _ + "Note that spawning 100 parallel threads is for illustrative purposes only, you " & _ + "shouldn't do this in your application." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which keywords are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + Const NUM_THREADS As Integer = 100 + + ' Increase the maximum number of parallel HTTP connections that .NET + ' framework allows. By default, this is set to 2 by the .NET framework. + ServicePointManager.DefaultConnectionLimit = NUM_THREADS + + Dim threads As New List(Of Thread) + + For i As Integer = 0 To NUM_THREADS + Dim thread As New Thread(AddressOf New KeywordThread(user, i, adGroupId).Run) + threads.Add(thread) + Next i + + For i As Integer = 0 To threads.Count - 1 + threads.Item(i).Start(i) + Next i + + For i As Integer = 0 To threads.Count - 1 + threads.Item(i).Join() + Next i + End Sub + + ''' + ''' Thread class for validating keywords. + ''' + Public Class KeywordThread + ''' + ''' Index of this thread, for identifying and debugging. + ''' + Dim threadIndex As Integer + + ''' + ''' The ad group id to which keywords are added. + ''' + Dim adGroupId As Long + + ''' + ''' The AdWords user who owns this ad group. + ''' + Dim user As AdWordsUser + + ''' + ''' Number of keywords to be validated in each API call. + ''' + Const NUM_KEYWORDS As Integer = 100 + + ''' + ''' Initializes a new instance of the class. + ''' + ''' Index of the thread. + ''' The ad group id. + ''' The AdWords user who owns the ad group. + Public Sub New(ByVal user As AdWordsUser, ByVal threadIndex As Integer, _ + ByVal adGroupId As Long) + Me.user = user + Me.threadIndex = threadIndex + Me.adGroupId = adGroupId + End Sub + + ''' + ''' Main method for the thread. + ''' + ''' The thread parameter. + Public Sub Run(ByVal obj As Object) + ' Create the operations. + Dim operations As New List(Of AdGroupCriterionOperation) + For j As Integer = 0 To NUM_KEYWORDS + ' Create the keyword. + Dim keyword As New Keyword + keyword.text = "mars cruise thread " & threadIndex.ToString & " seed " & j.ToString + keyword.matchType = KeywordMatchType.BROAD + + ' Create the biddable ad group criterion. + Dim keywordCriterion As AdGroupCriterion = New BiddableAdGroupCriterion + keywordCriterion.adGroupId = adGroupId + keywordCriterion.criterion = keyword + + ' Create the operations. + Dim keywordOperation As New AdGroupCriterionOperation + keywordOperation.operator = [Operator].ADD + keywordOperation.operand = keywordCriterion + + operations.Add(keywordOperation) + Next j + + ' Get the AdGroupCriterionService. This should be done within the + ' thread, since a service can only handle one outgoing HTTP request + ' at a time. + Dim service As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201309.AdGroupCriterionService) + service.RequestHeader.validateOnly = True + Dim retryCount As Integer = 0 + Const NUM_RETRIES As Integer = 3 + Try + While (retryCount < NUM_RETRIES) + Try + ' Validate the keywords. + Dim retval As AdGroupCriterionReturnValue = service.mutate(operations.ToArray) + Exit While + Catch ex As AdWordsApiException + ' Handle API errors. + Dim innerException As ApiException = TryCast(ex.ApiException, ApiException) + If (innerException Is Nothing) Then + Throw New Exception("Failed to retrieve ApiError. See inner exception for more " & _ + "details.", ex) + End If + For Each apiError As ApiError In innerException.errors + If Not TypeOf apiError Is RateExceededError Then + ' Rethrow any errors other than RateExceededError. + Throw + End If + ' Handle rate exceeded errors. + Dim rateExceededError As RateExceededError = DirectCast(apiError, RateExceededError) + Console.WriteLine("Got Rate exceeded error - rate name = '{0}', scope = '{1}', " & _ + "retry After {2} seconds.", rateExceededError.rateScope, _ + rateExceededError.rateName, rateExceededError.retryAfterSeconds) + Thread.Sleep(rateExceededError.retryAfterSeconds) + retryCount = retryCount + 1 + Next + Finally + If (retryCount = NUM_RETRIES) Then + Throw New Exception(String.Format("Could not recover after making {0} attempts.", _ + retryCount)) + End If + End Try + End While + Catch ex As Exception + Throw New System.ApplicationException("Failed to validate keywords.", ex) + End Try + End Sub + End Class + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/ErrorHandling/HandleTwoFactorAuthorizationError.vb b/examples/AdWords/Vb/v201309/ErrorHandling/HandleTwoFactorAuthorizationError.vb new file mode 100644 index 00000000000..4292db476db --- /dev/null +++ b/examples/AdWords/Vb/v201309/ErrorHandling/HandleTwoFactorAuthorizationError.vb @@ -0,0 +1,95 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.Common.Lib + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example illustrates how to handle 2 factor authorization errors. + ''' + ''' Tags: CampaignService.get + ''' + Public Class HandleTwoFactorAuthorizationError + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandleTwoFactorAuthorizationError + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to handle 2 factor authorization errors." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Use a test account for which 2 factor authentication has been enabled. + Dim loginEmail As String = "2steptester@gmail.com" + Dim password As String = "testaccount" + + Dim config As New AdWordsAppConfig + config.Email = loginEmail + config.Password = password + Dim authToken As New AuthToken(config, "adwords") + + Try + ' Try to obtain an authToken. + Dim token As String = authToken.GetToken + Console.WriteLine("Retrieved an authToken = {0} for user {1}.", token, loginEmail) + Catch ex As AuthTokenException + ' Since the test account has 2 factor authentication enabled, this block + ' of code will be executed. + If (ex.ErrorCode = AuthTokenErrorCode.BadAuthentication) Then + If (ex.Info = "InvalidSecondFactor") Then + Console.WriteLine("The user has enabled two factor authentication in this " & _ + "account. Have the user generate an application-specific password to make " & _ + "calls against the AdWords API. See " & _ + "http://adwordsapi.blogspot.com/2011/02/authentication-changes-with-2-step.html" & _ + "for more details.") + Else + Console.WriteLine("Invalid credentials.") + End If + Else + Throw New System.ApplicationException(String.Format("The server raised an {0} error.", _ + ex.ErrorCode), ex) + End If + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/Miscellaneous/GetAllVideosAndImages.vb b/examples/AdWords/Vb/v201309/Miscellaneous/GetAllVideosAndImages.vb new file mode 100644 index 00000000000..a6ca8b9422c --- /dev/null +++ b/examples/AdWords/Vb/v201309/Miscellaneous/GetAllVideosAndImages.vb @@ -0,0 +1,139 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example gets all videos and images. To upload video, see + ''' http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. + ''' To upload image, run UploadImage.vb. + ''' + ''' Tags: MediaService.get + ''' + Public Class GetAllVideosAndImages + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAllVideosAndImages + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all videos and images. To upload video, see " & _ + "http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. To " & _ + "upload image, run UploadImage.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the MediaService. + Dim mediaService As MediaService = user.GetService(AdWordsService.v201309.MediaService) + + ' Create the video selector. + Dim selector As New Selector + selector.fields = New String() {"MediaId", "Width", "Height", "MimeType"} + + ' Set the filter. + Dim predicate As New Predicate + predicate.operator = PredicateOperator.IN + predicate.field = "Type" + predicate.values = New String() {MediaMediaType.VIDEO.ToString(), _ + MediaMediaType.IMAGE.ToString()} + + selector.predicates = New Predicate() {predicate} + + ' Select selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New MediaPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + page = mediaService.get(selector) + + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each media As Media In page.entries + If TypeOf media Is Video Then + Dim video As Video = media + Console.WriteLine("{0}) Video with id '{1}' and name '{2}' was found.", _ + i, video.mediaId, video.name) + ElseIf TypeOf media Is Image Then + Dim image As Image = media + Dim dimensions As Dictionary(Of MediaSize, Dimensions) = _ + CreateMediaDimensionMap(image.dimensions) + Console.WriteLine("{0}) Image with id '{1}', dimensions '{2}x{3}', and MIME " & _ + "type '{4}' was found.", i, image.mediaId, dimensions(MediaSize.FULL).width, _ + dimensions(MediaSize.FULL).height, image.mimeType) + End If + i = i + 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of images and videos found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get images and videos.", ex) + End Try + End Sub + + ''' + ''' Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + ''' + ''' The array of Media_Size_DimensionsMapEntry to be + ''' converted into a dictionary. + ''' A dictionary with key as MediaSize, and value as Dimensions. + ''' + Private Function CreateMediaDimensionMap(ByVal dimensions As Media_Size_DimensionsMapEntry()) _ + As Dictionary(Of MediaSize, Dimensions) + Dim mediaMap As New Dictionary(Of MediaSize, Dimensions) + For Each dimension As Media_Size_DimensionsMapEntry In dimensions + mediaMap.Add(dimension.key, dimension.value) + Next + Return mediaMap + End Function + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/Miscellaneous/UploadImage.vb b/examples/AdWords/Vb/v201309/Miscellaneous/UploadImage.vb new file mode 100644 index 00000000000..3c9d5aa3396 --- /dev/null +++ b/examples/AdWords/Vb/v201309/Miscellaneous/UploadImage.vb @@ -0,0 +1,107 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 +Imports Google.Api.Ads.Common.Util + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example uploads an image. To get images, run GetAllVideosAndImages.vb. + ''' + ''' Tags: MediaService.upload + ''' + Public Class UploadImage + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UploadImage + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example uploads an image. To get images, run GetAllVideosAndImages.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the MediaService. + Dim mediaService As MediaService = user.GetService( _ + AdWordsService.v201309.MediaService) + + ' Create the image. + Dim image As New Image + image.data = MediaUtilities.GetAssetDataFromUrl("http://goo.gl/HJM3L") + image.type = MediaMediaType.IMAGE + + Try + ' Upload the image. + Dim result As Media() = mediaService.upload(New Media() {image}) + + ' Display the results. + If ((Not result Is Nothing) AndAlso (result.Length > 0)) Then + Dim newImage As Media = result(0) + Dim dimensions As Dictionary(Of MediaSize, Dimensions) = _ + CreateMediaDimensionMap(newImage.dimensions) + Console.WriteLine("Image with id '{0}', dimensions '{1}x{2}', and MIME type '{3}'" & _ + " was uploaded.", newImage.mediaId, dimensions.Item(MediaSize.FULL).width, _ + dimensions.Item(MediaSize.FULL).height, newImage.mimeType) + Else + Console.WriteLine("No images were uploaded.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to upload images.", ex) + End Try + End Sub + + ''' + ''' Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + ''' + ''' The array of Media_Size_DimensionsMapEntry to + ''' be converted into a dictionary. + ''' A dictionary with key as MediaSize, and value as Dimensions. + ''' + Private Function CreateMediaDimensionMap(ByVal dimensions As Media_Size_DimensionsMapEntry()) _ + As Dictionary(Of MediaSize, Dimensions) + Dim mediaMap As New Dictionary(Of MediaSize, Dimensions) + For Each dimension As Media_Size_DimensionsMapEntry In dimensions + mediaMap.Add(dimension.key, dimension.value) + Next + Return mediaMap + End Function + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/Optimization/EstimateKeywordTraffic.vb b/examples/AdWords/Vb/v201309/Optimization/EstimateKeywordTraffic.vb new file mode 100644 index 00000000000..670709a6067 --- /dev/null +++ b/examples/AdWords/Vb/v201309/Optimization/EstimateKeywordTraffic.vb @@ -0,0 +1,174 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example gets keyword traffic estimates. + ''' + ''' Tags: TrafficEstimatorService.get + ''' + Public Class EstimateKeywordTraffic + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New EstimateKeywordTraffic + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets keyword traffic estimates." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the TrafficEstimatorService. + Dim trafficEstimatorService As TrafficEstimatorService = user.GetService( _ + AdWordsService.v201309.TrafficEstimatorService) + + ' Create keywords. Up to 2000 keywords can be passed in a single request. + Dim keyword1 As New Keyword + keyword1.text = "mars cruise" + keyword1.matchType = KeywordMatchType.BROAD + + Dim keyword2 As New Keyword + keyword2.text = "cheap cruise" + keyword2.matchType = KeywordMatchType.PHRASE + + Dim keyword3 As New Keyword + keyword3.text = "cruise" + keyword3.matchType = KeywordMatchType.EXACT + + Dim keywords As Keyword() = New Keyword() {keyword1, keyword2, keyword3} + + ' Create a keyword estimate request for each keyword. + Dim keywordEstimateRequests As New List(Of KeywordEstimateRequest) + + For Each keyword As Keyword In keywords + Dim keywordEstimateRequest As New KeywordEstimateRequest + keywordEstimateRequest.keyword = keyword + keywordEstimateRequests.Add(keywordEstimateRequest) + Next + + ' Create negative keywords. + Dim negativeKeyword1 As New Keyword + negativeKeyword1.text = "moon walk" + negativeKeyword1.matchType = KeywordMatchType.BROAD + + Dim negativeKeywordEstimateRequest As New KeywordEstimateRequest + negativeKeywordEstimateRequest.keyword = negativeKeyword1 + negativeKeywordEstimateRequest.isNegative = True + keywordEstimateRequests.Add(negativeKeywordEstimateRequest) + + ' Create ad group estimate requests. + Dim adGroupEstimateRequest As New AdGroupEstimateRequest + adGroupEstimateRequest.keywordEstimateRequests = keywordEstimateRequests.ToArray + adGroupEstimateRequest.maxCpc = New Money + adGroupEstimateRequest.maxCpc.microAmount = 1000000 + + ' Create campaign estimate requests. + Dim campaignEstimateRequest As New CampaignEstimateRequest + campaignEstimateRequest.adGroupEstimateRequests = New AdGroupEstimateRequest() _ + {adGroupEstimateRequest} + + ' See http://code.google.com/apis/adwords/docs/appendix/countrycodes.html + ' for a detailed list of country codes. + Dim countryCriterion As New Location + countryCriterion.id = 2840 'US + + ' See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + ' for a detailed list of language codes. + Dim languageCriterion As New Language + languageCriterion.id = 1000 'en + + campaignEstimateRequest.criteria = New Criterion() {countryCriterion, languageCriterion} + + ' Create the selector. + Dim selector As New TrafficEstimatorSelector + selector.campaignEstimateRequests = New CampaignEstimateRequest() {campaignEstimateRequest} + + Try + ' Get traffic estimates. + Dim result As TrafficEstimatorResult = trafficEstimatorService.get(selector) + + ' Display the results. + If ((Not result Is Nothing) AndAlso (Not result.campaignEstimates Is Nothing) _ + AndAlso (result.campaignEstimates.Length > 0)) Then + Dim campaignEstimate As CampaignEstimate = result.campaignEstimates(0) + If ((Not campaignEstimate.adGroupEstimates Is Nothing) AndAlso _ + (campaignEstimate.adGroupEstimates.Length > 0)) Then + Dim adGroupEstimate As AdGroupEstimate = campaignEstimate.adGroupEstimates(0) + + If (Not adGroupEstimate.keywordEstimates Is Nothing) Then + For i As Integer = 0 To adGroupEstimate.keywordEstimates.Length - 1 + Dim keyword As Keyword = keywordEstimateRequests.Item(i).keyword + Dim keywordEstimate As KeywordEstimate = adGroupEstimate.keywordEstimates(i) + + If keywordEstimateRequests.Item(i).isNegative Then + Continue For + End If + + ' Find the mean of the min and max values. + Dim meanAverageCpc As Long = ((keywordEstimate.min.averageCpc.microAmount + _ + keywordEstimate.max.averageCpc.microAmount) / 2) + Dim meanAveragePosition As Double = ((keywordEstimate.min.averagePosition + _ + keywordEstimate.max.averagePosition) / 2) + Dim meanClicks As Single = ((keywordEstimate.min.clicksPerDay + _ + keywordEstimate.max.clicksPerDay) / 2) + Dim meanTotalCost As Long = ((keywordEstimate.min.totalCost.microAmount + _ + keywordEstimate.max.totalCost.microAmount) / 2) + + Console.WriteLine("Results for the keyword with text = '{0}' and match type " & _ + "= '{1}':", keyword.text, keyword.matchType) + Console.WriteLine(" Estimated average CPC: {0}", meanAverageCpc) + Console.WriteLine(" Estimated ad position: {0:0.00}", meanAveragePosition) + Console.WriteLine(" Estimated daily clicks: {0}", meanClicks) + Console.WriteLine(" Estimated daily cost: {0}", meanTotalCost) + Next i + End If + End If + Else + Console.WriteLine("No traffic estimates were returned.\n") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve traffic estimates.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/Optimization/GetAdGroupBidSimulations.vb b/examples/AdWords/Vb/v201309/Optimization/GetAdGroupBidSimulations.vb new file mode 100644 index 00000000000..0ec0fcbfaa8 --- /dev/null +++ b/examples/AdWords/Vb/v201309/Optimization/GetAdGroupBidSimulations.vb @@ -0,0 +1,109 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example gets bid landscapes for an ad group. To get ad groups, + ''' run GetAdGroups.vb. + ''' + ''' Tags: DataService.getAdGroupBidLandscape + ''' + Public Class GetAdGroupBidSimulations + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAdGroupBidSimulations + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets bid landscapes for an ad group. To get ad groups, run " & _ + "GetAdGroups.vb" + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group for which bid simulations are + ''' retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the DataService. + Dim dataService As DataService = user.GetService(AdWordsService.v201309.DataService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"AdGroupId", "LandscapeType", "LandscapeCurrent", _ + "StartDate", "EndDate", "Bid", "LocalClicks", "LocalCost", "MarginalCpc", _ + "LocalImpressions"} + + ' Set the filters. + Dim adGroupPredicate As New Predicate + adGroupPredicate.field = "AdGroupId" + adGroupPredicate.operator = PredicateOperator.IN + adGroupPredicate.values = New String() {adGroupId.ToString} + + selector.predicates = New Predicate() {adGroupPredicate} + + Try + ' Get bid landscape for ad group. + Dim page As AdGroupBidLandscapePage = dataService.getAdGroupBidLandscape(selector) + If (((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) AndAlso _ + (page.entries.Length > 0)) Then + For Each bidLandscape As AdGroupBidLandscape In page.entries + Console.WriteLine("Found ad group bid landscape with ad group id '{0}', " & _ + "type '{1}', current: '{2}', start date '{3}', end date '{4}', and " & _ + "landscape points", bidLandscape.adGroupId, bidLandscape.type, _ + bidLandscape.landscapeCurrent, bidLandscape.startDate, bidLandscape.endDate) + Dim point As BidLandscapeLandscapePoint + For Each point In bidLandscape.landscapePoints + Console.WriteLine("- bid: {0} => clicks: {1}, cost: {2}, marginalCpc: {3}, " & _ + "impressions: {4}", point.bid.microAmount, point.bid.microAmount, _ + point.clicks, point.cost.microAmount, point.marginalCpc.microAmount, _ + point.impressions) + Next + Next + Else + Console.WriteLine("No ad group bid landscapes were found.\n") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to get ad group bid landscapes.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/Optimization/GetKeywordBidSimulations.vb b/examples/AdWords/Vb/v201309/Optimization/GetKeywordBidSimulations.vb new file mode 100644 index 00000000000..87ca732e60e --- /dev/null +++ b/examples/AdWords/Vb/v201309/Optimization/GetKeywordBidSimulations.vb @@ -0,0 +1,134 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example gets a bid landscape for an ad group and a keyword. + ''' To get ad groups, run GetAdGroups.vb. To get keywords, run + ''' GetKeywords.vb. + ''' + ''' Tags: DataService.getCriterionBidLandscape + ''' + Public Class GetKeywordBidSimulations + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetKeywordBidSimulations + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim keywordId As Long = Long.Parse("INSERT_KEYWORD_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, keywordId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets a bid landscape for an ad group and a keyword. To " & _ + "get ad groups, run GetAdGroups.vb. To get keywords, run GetKeywords.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group for which keyword bid + ''' simulations are retrieved. + ''' Id of the keyword for which bid simulations are + ''' retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal keywordId As Long) + ' Get the DataService. + Dim dataService As DataService = user.GetService(AdWordsService.v201309.DataService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"AdGroupId", "CriterionId", "StartDate", "EndDate", _ + "Bid", "LocalClicks", "LocalCost", "MarginalCpc", "LocalImpressions"} + + ' Set the filters. + Dim adGroupPredicate As New Predicate + adGroupPredicate.field = "AdGroupId" + adGroupPredicate.operator = PredicateOperator.IN + adGroupPredicate.values = New String() {adGroupId.ToString} + + Dim keywordPredicate As New Predicate + keywordPredicate.field = "CriterionId" + keywordPredicate.operator = PredicateOperator.IN + keywordPredicate.values = New String() {keywordId.ToString} + + selector.predicates = New Predicate() {adGroupPredicate, keywordPredicate} + + ' Select selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New CriterionBidLandscapePage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get bid landscape for keywords. + page = dataService.getCriterionBidLandscape(selector) + + ' Display bid landscapes. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each bidLandscape As CriterionBidLandscape In page.entries + Console.WriteLine("{0}) Found keyword bid landscape with ad group id ""{1}"", " & _ + "keyword id ""{2}"", start date ""{3}"", end date ""{4}"", and " & _ + "landscape points:", i, bidLandscape.adGroupId, bidLandscape.criterionId, _ + bidLandscape.startDate, bidLandscape.endDate) + For Each bidLandscapePoint As BidLandscapeLandscapePoint _ + In bidLandscape.landscapePoints + Console.WriteLine("- bid: {0} => clicks: {1}, cost: {2}, marginalCpc: {3}, " & _ + "impressions: {4}", bidLandscapePoint.bid.microAmount, _ + bidLandscapePoint.clicks, bidLandscapePoint.cost.microAmount, _ + bidLandscapePoint.marginalCpc.microAmount, bidLandscapePoint.impressions) + Next + Next + i += 1 + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of keyword bid landscapes found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve keyword bid landscapes.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/Optimization/GetKeywordIdeas.vb b/examples/AdWords/Vb/v201309/Optimization/GetKeywordIdeas.vb new file mode 100644 index 00000000000..b6c05bd2730 --- /dev/null +++ b/examples/AdWords/Vb/v201309/Optimization/GetKeywordIdeas.vb @@ -0,0 +1,150 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Text + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example retrieves keywords that are related to a given keyword. + ''' + ''' Tags: TargetingIdeaService.get + ''' + Public Class GetKeywordIdeas + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetKeywordIdeas + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves keywords that are related to a given keyword." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the TargetingIdeaService. + Dim targetingIdeaService As TargetingIdeaService = user.GetService( _ + AdWordsService.v201309.TargetingIdeaService) + + Dim keywordText As String = "mars cruise" + + ' Create selector. + Dim selector As New TargetingIdeaSelector() + selector.requestType = RequestType.IDEAS + selector.ideaType = IdeaType.KEYWORD + selector.requestedAttributeTypes = New AttributeType() { _ + AttributeType.KEYWORD_TEXT, AttributeType.SEARCH_VOLUME, _ + AttributeType.CATEGORY_PRODUCTS_AND_SERVICES} + + ' Language setting (optional). + ' The ID can be found in the documentation: + ' https://developers.google.com/adwords/api/docs/appendix/languagecodes + ' Note: As of v201302, only a single language parameter is allowed. + Dim languageParameter As New LanguageSearchParameter() + Dim english As New Language() + english.id = 1000 + languageParameter.languages = New Language() {english} + + ' Create related to query search parameter. + Dim relatedToQuerySearchParameter As New RelatedToQuerySearchParameter() + relatedToQuerySearchParameter.queries = New String() {keywordText} + selector.searchParameters = New SearchParameter() {relatedToQuerySearchParameter, _ + languageParameter} + + ' Set selector paging (required for targeting idea service). + Dim paging As New Paging() + paging.startIndex = 0 + paging.numberResults = 500 + selector.paging = paging + + Dim offset As Long = 0 + Dim pageSize As Long = 500 + + Dim page As New TargetingIdeaPage() + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get related keywords. + page = targetingIdeaService.get(selector) + + 'Display the results. + + If Not page.entries Is Nothing AndAlso page.entries.Length > 0 Then + Dim i As Integer = offset + For Each targetingIdea As TargetingIdea In page.entries + Dim keyword As String = Nothing + Dim categories As String = Nothing + Dim averageMonthlySearches As Long = 0 + + For Each entry As Type_AttributeMapEntry In targetingIdea.data + If entry.key = AttributeType.KEYWORD_TEXT Then + keyword = DirectCast(entry.value, StringAttribute).value + End If + If entry.key = AttributeType.CATEGORY_PRODUCTS_AND_SERVICES Then + Dim categorySet As IntegerSetAttribute = entry.value + Dim builder As New StringBuilder() + For Each value As Integer In categorySet.value + builder.AppendFormat("{0}, ", value) + Next + Dim trimChars As Char() = New Char() {",", " "} + categories = builder.ToString().Trim(trimChars) + End If + If entry.key = AttributeType.SEARCH_VOLUME Then + averageMonthlySearches = DirectCast(entry.value, LongAttribute).value + End If + Next + Console.WriteLine("Keyword with text '{0}', and average monthly search volume " & _ + "'{1}' was found with categories: {2}", keyword, averageMonthlySearches, _ + categories) + i = i + 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of related keywords found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve related keywords.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/Optimization/GetPlacementIdeas.vb b/examples/AdWords/Vb/v201309/Optimization/GetPlacementIdeas.vb new file mode 100644 index 00000000000..e8e83649ada --- /dev/null +++ b/examples/AdWords/Vb/v201309/Optimization/GetPlacementIdeas.vb @@ -0,0 +1,123 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example retrieves urls that have content keywords related to a + ''' given website. + ''' + ''' Tags: TargetingIdeaService.get + ''' + Public Class GetPlacementIdeas + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetPlacementIdeas + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves urls that have content keywords related to a " & _ + "given website." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the TargetingIdeaService. + Dim targetingIdeaService As TargetingIdeaService = user.GetService( _ + AdWordsService.v201309.TargetingIdeaService) + + ' Create seed url. + Dim url As String = "mars.google.com" + + ' Create the selector. + Dim selector As New TargetingIdeaSelector + selector.requestType = RequestType.IDEAS + selector.ideaType = IdeaType.PLACEMENT + selector.requestedAttributeTypes = New AttributeType() {AttributeType.CRITERION, _ + AttributeType.PLACEMENT_TYPE} + + ' Create related to url search parameter. + Dim relatedToUrlSearchParameter As New RelatedToUrlSearchParameter + relatedToUrlSearchParameter.urls = New String() {url} + relatedToUrlSearchParameter.includeSubUrls = False + selector.searchParameters = New SearchParameter() {relatedToUrlSearchParameter} + + ' Select selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New TargetingIdeaPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get placement ideas. + page = targetingIdeaService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each idea As TargetingIdea In page.entries + For Each entry As Type_AttributeMapEntry In idea.data + If (entry.key = AttributeType.CRITERION) Then + Dim placementAttribute As CriterionAttribute = entry.value + Dim placement As Placement = placementAttribute.value + Console.WriteLine("{0}) Related placement urls were found at '{1}'.", _ + i, placement.url) + End If + Next + Next + i += 1 + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of related placements found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve related placements.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/Remarketing/AddAudience.vb b/examples/AdWords/Vb/v201309/Remarketing/AddAudience.vb new file mode 100644 index 00000000000..fe73d130d76 --- /dev/null +++ b/examples/AdWords/Vb/v201309/Remarketing/AddAudience.vb @@ -0,0 +1,154 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example illustrates how to create a user list a.k.a. audience. + ''' + ''' Tags: UserListService.mutate + ''' + Public Class AddAudience + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAudience + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to create a user list a.k.a. audience." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the UserListService. + Dim userListService As AdwordsUserListService = user.GetService( _ + AdWordsService.v201309.AdwordsUserListService) + + ' Get the ConversionTrackerService. + Dim conversionTrackerService As ConversionTrackerService = user.GetService( _ + AdWordsService.v201309.ConversionTrackerService) + + Dim userList As New BasicUserList + + userList.name = ("Mars cruise customers #" & ExampleUtilities.GetRandomString) + userList.description = "A list of mars cruise customers in the last year." + userList.status = UserListMembershipStatus.OPEN + userList.membershipLifeSpan = 365 + + Dim conversionType As New UserListConversionType + conversionType.name = userList.name + userList.conversionTypes = New UserListConversionType() {conversionType} + + ' Optional: Set the user list status. + userList.status = UserListMembershipStatus.OPEN + + ' Create the operation. + Dim operation As New UserListOperation + operation.operand = userList + operation.operator = [Operator].ADD + + Try + ' Add the user list. + Dim retval As UserListReturnValue = userListService.mutate(New UserListOperation() _ + {operation}) + + Dim userLists As UserList() = Nothing + If ((Not retval Is Nothing) AndAlso (Not retval.value Is Nothing)) Then + userLists = retval.value + ' Get all conversion snippets. + Dim conversionIds As New List(Of String) + For Each newUserList As BasicUserList In userLists + If (Not newUserList.conversionTypes Is Nothing) Then + For Each newConversionType As UserListConversionType In _ + newUserList.conversionTypes + conversionIds.Add(newConversionType.id.ToString) + Next + End If + Next + + Dim conversionsMap As New Dictionary(Of Long, ConversionTracker) + + If (conversionIds.Count > 0) Then + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id"} + + Dim conversionTypePredicate As New Predicate + conversionTypePredicate.field = "Id" + conversionTypePredicate.operator = PredicateOperator.IN + conversionTypePredicate.values = conversionIds.ToArray + selector.predicates = New Predicate() {conversionTypePredicate} + + ' Get all conversion trackers. + Dim page As ConversionTrackerPage = conversionTrackerService.get(selector) + + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + For Each tracker As ConversionTracker In page.entries + conversionsMap.Item(tracker.id) = tracker + Next + End If + End If + + ' Display the results. + For Each newUserList As BasicUserList In userLists + Console.WriteLine("User list with name '{0}' and id '{1}' was added.", _ + newUserList.name, newUserList.id) + + ' Display user list associated conversion code snippets. + If (Not newUserList.conversionTypes Is Nothing) Then + For Each newConversionType As UserListConversionType In newUserList.conversionTypes + Dim conversionTracker As AdWordsConversionTracker = _ + DirectCast(conversionsMap.Item(newConversionType.id), _ + AdWordsConversionTracker) + Console.WriteLine("Conversion type code snippet associated to the list:\n{0}", _ + conversionTracker.snippet) + Next + End If + Next + Else + Console.WriteLine("No user lists (a.k.a. audiences) were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add user lists (a.k.a. audiences).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/Remarketing/AddConversionTracker.vb b/examples/AdWords/Vb/v201309/Remarketing/AddConversionTracker.vb new file mode 100644 index 00000000000..b41a35d0655 --- /dev/null +++ b/examples/AdWords/Vb/v201309/Remarketing/AddConversionTracker.vb @@ -0,0 +1,108 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example adds an AdWords conversion tracker. + ''' + ''' Tags: ConversionTrackerService.mutate + ''' + Public Class AddConversionTracker + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddConversionTracker + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds an AdWords conversion tracker." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the ConversionTrackerService. + Dim conversionTrackerService As ConversionTrackerService = user.GetService( _ + AdWordsService.v201309.ConversionTrackerService) + + ' Create AdWords conversion tracker. + Dim conversionTracker As New AdWordsConversionTracker + conversionTracker.name = "Earth to Mars Cruises Conversion #" & _ + ExampleUtilities.GetRandomString + conversionTracker.category = ConversionTrackerCategory.DEFAULT + conversionTracker.markupLanguage = AdWordsConversionTrackerMarkupLanguage.HTML + conversionTracker.textFormat = AdWordsConversionTrackerTextFormat.HIDDEN + + ' Set optional fields. + conversionTracker.status = ConversionTrackerStatus.ENABLED + conversionTracker.viewthroughLookbackWindow = 15 + conversionTracker.isProductAdsChargeable = True + conversionTracker.productAdsChargeableConversionWindow = 15 + conversionTracker.conversionPageLanguage = "en" + conversionTracker.backgroundColor = "#0000FF" + conversionTracker.userRevenueValue = "someJavascriptVariable" + + ' Create the operation. + Dim operation As New ConversionTrackerOperation + operation.operator = [Operator].ADD + operation.operand = conversionTracker + + Try + ' Add conversion tracker. + Dim retval As ConversionTrackerReturnValue = conversionTrackerService.mutate( _ + New ConversionTrackerOperation() {operation}) + + ' Display the results. + If ((Not retval Is Nothing) AndAlso (Not retval.value Is Nothing) AndAlso _ + retval.value.Length > 0) Then + Dim newConversionTracker As ConversionTracker = retval.value(0) + Console.WriteLine("Conversion tracker with id '{0}', name '{1}', status '{2}', " & _ + "category '{3}' was added.", newConversionTracker.id, newConversionTracker.name, _ + newConversionTracker.status, newConversionTracker.category) + Else + Console.WriteLine("No conversion trackers were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add conversion tracker.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/Reporting/DownloadCriteriaReport.vb b/examples/AdWords/Vb/v201309/Reporting/DownloadCriteriaReport.vb new file mode 100644 index 00000000000..6d8782131a5 --- /dev/null +++ b/examples/AdWords/Vb/v201309/Reporting/DownloadCriteriaReport.vb @@ -0,0 +1,118 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util.Reports +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example gets and downloads a criteria Ad Hoc report from an XML + ''' report definition. + ''' + Public Class DownloadCriteriaReport + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DownloadCriteriaReport + Console.WriteLine(codeExample.Description) + Try + Dim fileName As String = "INSERT_OUTPUT_FILE_NAME" + codeExample.Run(New AdWordsUser, fileName) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets and downloads a criteria Ad Hoc report from an XML report" & _ + " definition." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The file to which the report is downloaded. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal fileName As String) + Dim definition As New ReportDefinition + + definition.reportName = "Last 7 days CRITERIA_PERFORMANCE_REPORT" + definition.reportType = ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT + definition.downloadFormat = DownloadFormat.GZIPPED_CSV + definition.dateRangeType = ReportDefinitionDateRangeType.LAST_7_DAYS + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"CampaignId", "AdGroupId", "Id", "CriteriaType", "Criteria", _ + "CriteriaDestinationUrl", "Clicks", "Impressions", "Cost"} + + Dim predicate As New Predicate + predicate.field = "Status" + predicate.operator = PredicateOperator.IN + predicate.values = New String() {"ACTIVE", "PAUSED"} + selector.predicates = New Predicate() {predicate} + + definition.selector = selector + definition.includeZeroImpressions = True + + Dim filePath As String = ExampleUtilities.GetHomeDir() & Path.DirectorySeparatorChar & _ + fileName + + Try + ' If you know that your report is small enough to fit in memory, then + ' you can instead use + ' Dim utilities As New ReportUtilities(user) + ' utilities.ReportVersion = "v201309" + ' Dim report As ClientReport = utilities.GetClientReport( _ + ' Of ReportDefinition)(definition) + ' + ' ' Get the text report directly if you requested a text format + ' ' (e.g. xml) + ' Dim reportText As String = report.Text + ' + ' ' Get the binary report if you requested a binary format + ' ' (e.g. gzip) + ' Dim reportBytes As Byte() = report.Contents + ' + ' ' Deflate a zipped binary report for further processing. + ' Dim deflatedReportText As String = Encoding.UTF8.GetString( _ + ' MediaUtilities.DeflateGZipData(report.Contents)) + Dim utilities As New ReportUtilities(user) + utilities.ReportVersion = "v201309" + utilities.DownloadClientReport(Of ReportDefinition)(definition, filePath) + Console.WriteLine("Report was downloaded to '{0}'.", filePath) + Catch ex As Exception + Throw New System.ApplicationException("Failed to download report.", ex) + End Try + + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/Reporting/DownloadCriteriaReportWithAwql.vb b/examples/AdWords/Vb/v201309/Reporting/DownloadCriteriaReportWithAwql.vb new file mode 100644 index 00000000000..d27e738908b --- /dev/null +++ b/examples/AdWords/Vb/v201309/Reporting/DownloadCriteriaReportWithAwql.vb @@ -0,0 +1,102 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util.Reports +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example gets and downloads a criteria Ad Hoc report from an AWQL + ''' query. See https://developers.google.com/adwords/api/docs/guides/awql for + ''' AWQL documentation. + ''' + Public Class DownloadCriteriaReportWithAwql + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DownloadCriteriaReportWithAwql + Console.WriteLine(codeExample.Description) + Try + Dim fileName As String = "INSERT_OUTPUT_FILE_NAME" + codeExample.Run(New AdWordsUser, fileName) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets and downloads a criteria Ad Hoc report from an AWQL" & _ + " query. See https://developers.google.com/adwords/api/docs/guides/awql for" & _ + " AWQL documentation." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The file to which the report is downloaded. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal fileName As String) + Dim query As String = "SELECT CampaignId, AdGroupId, Id, Criteria, CriteriaType, " & _ + "Impressions, Clicks, Cost FROM CRITERIA_PERFORMANCE_REPORT WHERE Status IN " & _ + "[ACTIVE, PAUSED] DURING LAST_7_DAYS" + + Dim filePath As String = ExampleUtilities.GetHomeDir() + Path.DirectorySeparatorChar & _ + fileName + + Try + ' If you know that your report is small enough to fit in memory, then + ' you can instead use + ' Dim utilities As New ReportUtilities(user) + ' utilities.ReportVersion = "v201309" + ' Dim report As ClientReport = utilities.GetClientReport(query, format) + ' + ' ' Get the text report directly if you requested a text format + ' ' (e.g. xml) + ' Dim reportText As String = report.Text + ' + ' ' Get the binary report if you requested a binary format + ' ' (e.g. gzip) + ' Dim reportBytes As Byte() = report.Contents + ' + ' ' Deflate a zipped binary report for further processing. + ' Dim deflatedReportText As String = Encoding.UTF8.GetString( _ + ' MediaUtilities.DeflateGZipData(report.Contents)) + Dim utilities As New ReportUtilities(user) + utilities.ReportVersion = "v201309" + utilities.DownloadClientReport(query, DownloadFormat.GZIPPED_CSV.ToString(), filePath) + Console.WriteLine("Report was downloaded to '{0}'.", filePath) + Catch ex As Exception + Throw New System.ApplicationException("Failed to download report.", ex) + End Try + + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/Reporting/GetReportFields.vb b/examples/AdWords/Vb/v201309/Reporting/GetReportFields.vb new file mode 100644 index 00000000000..43ceb9dd060 --- /dev/null +++ b/examples/AdWords/Vb/v201309/Reporting/GetReportFields.vb @@ -0,0 +1,97 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example gets report fields. + ''' + ''' Tags: ReportDefinitionService.getReportFields + ''' + Public Class GetReportFields + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetReportFields + Console.WriteLine(codeExample.Description) + Try + Dim reportType As ReportDefinitionReportType = [Enum].Parse( _ + GetType(ReportDefinitionReportType), "INSERT_REPORT_TYPE_HERE") + codeExample.Run(New AdWordsUser, reportType) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets report fields." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The report type to be run. + Public Sub Run(ByVal user As AdWordsUser, ByVal reportType As ReportDefinitionReportType) + ' Get the ReportDefinitionService. + Dim reportDefinitionService As ReportDefinitionService = user.GetService( _ + AdWordsService.v201309.ReportDefinitionService) + + ' The type of the report to get fields for. + ' E.g.: KEYWORDS_PERFORMANCE_REPORT + + Try + ' Get the report fields. + Dim reportDefinitionFields As ReportDefinitionField() = _ + reportDefinitionService.getReportFields(reportType) + + If ((Not reportDefinitionFields Is Nothing) AndAlso _ + (reportDefinitionFields.Length > 0)) Then + ' Display report fields. + Console.WriteLine("The report type '{0}' contains the following fields:", reportType) + + For Each reportDefinitionField As ReportDefinitionField In reportDefinitionFields + Console.Write("- {0} ({1})", reportDefinitionField.fieldName, _ + reportDefinitionField.fieldType) + If (Not reportDefinitionField.enumValues Is Nothing) Then + Console.Write(" := [{0}]", String.Join(", ", reportDefinitionField.enumValues)) + End If + Console.WriteLine() + Next + Else + Console.WriteLine("This report type has no fields.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve fields for report type.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/Targeting/AddCampaignTargetingCriteria.vb b/examples/AdWords/Vb/v201309/Targeting/AddCampaignTargetingCriteria.vb new file mode 100644 index 00000000000..83e1ab51bff --- /dev/null +++ b/examples/AdWords/Vb/v201309/Targeting/AddCampaignTargetingCriteria.vb @@ -0,0 +1,139 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example adds various types of targeting criteria to a campaign. + ''' To get a list of campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignCriterionService.mutate + ''' + Public Class AddCampaignTargetingCriteria + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddCampaignTargetingCriteria + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds various types of targeting criteria to a campaign. To " & _ + "get a list of campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to which targeting criteria + ''' are added. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignCriterionService. + Dim campaignCriterionService As CampaignCriterionService = user.GetService( _ + AdWordsService.v201309.CampaignCriterionService) + + ' Create language criteria. + ' See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + ' for a detailed list of language codes. + Dim language1 As New Language + language1.id = 1002 ' French + Dim languageCriterion1 As New CampaignCriterion + languageCriterion1.campaignId = campaignId + languageCriterion1.criterion = language1 + + Dim language2 As New Language + language2.id = 1005 ' Japanese + Dim languageCriterion2 As New CampaignCriterion + languageCriterion2.campaignId = campaignId + languageCriterion2.criterion = language2 + + ' Create location criteria. + ' See http://code.google.com/apis/adwords/docs/appendix/countrycodes.html + ' for a detailed list of country codes. + Dim location1 As New Location + location1.id = 2840 ' USA + Dim locationCriterion1 As New CampaignCriterion + locationCriterion1.campaignId = campaignId + locationCriterion1.criterion = location1 + + Dim location2 As New Location + location2.id = 2392 ' Japan + Dim locationCriterion2 As New CampaignCriterion + locationCriterion2.campaignId = campaignId + locationCriterion2.criterion = location2 + + ' Add a negative campaign keyword. + Dim negativeCriterion As New NegativeCampaignCriterion() + negativeCriterion.campaignId = campaignId + + Dim keyword As New Keyword() + keyword.matchType = KeywordMatchType.BROAD + keyword.text = "jupiter cruise" + + negativeCriterion.criterion = keyword + + Dim criteria() As CampaignCriterion = {languageCriterion1, languageCriterion2, _ + locationCriterion1, locationCriterion2, negativeCriterion} + + Dim operations As New List(Of CampaignCriterionOperation) + + For Each criterion As CampaignCriterion In criteria + Dim operation As New CampaignCriterionOperation + operation.operator = [Operator].ADD + operation.operand = criterion + operations.Add(operation) + Next + + Try + ' Set the campaign targets. + Dim retVal As CampaignCriterionReturnValue = campaignCriterionService.mutate( _ + operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing)) Then + For Each criterion As CampaignCriterion In retVal.value + Console.WriteLine("Campaign criterion of type '{0}' was set to campaign with id " & _ + "= '{1}'.", criterion.criterion.CriterionType, criterion.campaignId) + Next + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to set campaign criteria.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/Targeting/GetCampaignTargetingCriteria.vb b/examples/AdWords/Vb/v201309/Targeting/GetCampaignTargetingCriteria.vb new file mode 100644 index 00000000000..bd65aeec16e --- /dev/null +++ b/examples/AdWords/Vb/v201309/Targeting/GetCampaignTargetingCriteria.vb @@ -0,0 +1,123 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example gets all targeting criteria for a campaign. To set + ''' campaign targeting criteria, run AddCampaignTargetingCriteria.vb. To get + ''' campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignCriterionService.get + ''' + Public Class GetCampaignTargetingCriteria + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetCampaignTargetingCriteria + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all targeting criteria for a campaign. To set campaign " & _ + "targeting criteria, run AddCampaignTargetingCriteria.vb. To get campaigns, run " & _ + "GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign from which targeting + ''' criteria are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignCriterionService. + Dim campaignCriterionService As CampaignCriterionService = user.GetService( _ + AdWordsService.v201309.CampaignCriterionService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "CriteriaType", "CampaignId"} + + ' Set the filters. + Dim predicate As New Predicate + predicate.field = "CampaignId" + predicate.operator = PredicateOperator.EQUALS + predicate.values = New String() {campaignId.ToString} + + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New CampaignCriterionPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get all campaign targets. + page = campaignCriterionService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each campaignCriterion As CampaignCriterion In page.entries + Dim negative As String = "" + If (TypeOf campaignCriterion Is NegativeCampaignCriterion) Then + negative = "Negative " + End If + Console.WriteLine("{0}) {1}Campaign targeting criterion with id = '{2}' and " & _ + "Type = {3} was found for campaign id '{4}'", i, negative, _ + campaignCriterion.criterion.id, campaignCriterion.criterion.type, _ + campaignCriterion.campaignId) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of campaign targeting criteria found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get campaign targeting criteria.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/Targeting/GetTargetableLanguagesAndCarriers.vb b/examples/AdWords/Vb/v201309/Targeting/GetTargetableLanguagesAndCarriers.vb new file mode 100644 index 00000000000..2c6b08eeb80 --- /dev/null +++ b/examples/AdWords/Vb/v201309/Targeting/GetTargetableLanguagesAndCarriers.vb @@ -0,0 +1,100 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example illustrates how to retrieve all carriers and languages + ''' available for targeting. + ''' + ''' Tags: ConstantDataService.getCarrierCriterion + ''' Tags: ConstantDataService.getLanguageCriterion + ''' + Public Class GetTargetableLanguagesAndCarriers + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetTargetableLanguagesAndCarriers + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to retrieve all carriers and languages" & _ + "available for targeting." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the ConstantDataService. + Dim constantDataService As ConstantDataService = user.GetService( _ + AdWordsService.v201309.ConstantDataService) + + Try + ' Get all carriers. + Dim carriers As Carrier() = constantDataService.getCarrierCriterion + + ' Display the results. + If (Not carriers Is Nothing) Then + For Each carrier As Carrier In carriers + Console.WriteLine("Carrier name is '{0}', ID is {1} and country code is '{2}'.", _ + carrier.name, carrier.id, carrier.countryCode) + Next + Else + Console.WriteLine("No carriers were retrieved.") + End If + + ' Get all languages. + Dim languages As Language() = constantDataService.getLanguageCriterion + + ' Display the results. + If (Not languages Is Nothing) Then + For Each language As Language In languages + Console.WriteLine("Language name is '{0}', ID is {1} and code is '{2}'.", _ + language.name, language.id, language.code) + Next + Else + Console.WriteLine("No languages were found.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to get targetable carriers and languages.", _ + ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201309/Targeting/LookupLocation.vb b/examples/AdWords/Vb/v201309/Targeting/LookupLocation.vb new file mode 100644 index 00000000000..d0e5d9faf9f --- /dev/null +++ b/examples/AdWords/Vb/v201309/Targeting/LookupLocation.vb @@ -0,0 +1,121 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example gets location criteria by name. + ''' + ''' Tags: LocationCriterionService.get + ''' + Public Class LookupLocation + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New LookupLocation + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets location criteria by name." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the LocationCriterionService. + Dim locationCriterionService As LocationCriterionService = user.GetService( _ + AdWordsService.v201309.LocationCriterionService) + + Dim locationNames As String() = New String() {"Paris", "Quebec", "Spain", "Deutschland"} + + Dim selector As New Selector + selector.fields = New String() {"Id", "LocationName", "CanonicalName", "DisplayType", _ + "ParentLocations", "Reach", "TargetingStatus"} + + ' Location names must match exactly, only EQUALS and IN are supported. + Dim predicate1 As New Predicate + predicate1.field = "LocationName" + predicate1.operator = PredicateOperator.IN + predicate1.values = locationNames + + ' Set the locale of the returned location names. + Dim predicate2 As New Predicate + predicate2.field = "Locale" + predicate2.operator = PredicateOperator.EQUALS + predicate2.values = New String() {"en"} + + selector.predicates = New Predicate() {predicate1, predicate2} + + Try + ' Make the get request. + Dim locationCriteria As LocationCriterion() = locationCriterionService.get(selector) + + ' Display the resulting location criteria. + For Each locationCriterion As LocationCriterion In locationCriteria + Dim parentLocations As String = "" + If ((Not locationCriterion.location Is Nothing) AndAlso ( _ + Not locationCriterion.location.parentLocations Is Nothing)) Then + For Each location As Location In locationCriterion.location.parentLocations + parentLocations = (parentLocations & Me.GetLocationString(location) & ", ") + Next + parentLocations.TrimEnd(New Char() {","c, " "c}) + Else + parentLocations = "N/A" + End If + Console.WriteLine("The search term '{0}' returned the location '{1}' of type '{2}' " & _ + "with parent locations '{3}', reach '{4}' and targeting status '{5}.", _ + locationCriterion.searchTerm, locationCriterion.location.locationName, _ + locationCriterion.location.displayType, parentLocations, locationCriterion.reach, _ + locationCriterion.location.targetingStatus) + Next + Catch ex As Exception + Throw New System.ApplicationException("Failed to get location criteria.", ex) + End Try + End Sub + + ''' + ''' Gets a string representation for a location. + ''' + ''' The location + ''' + Public Function GetLocationString(ByVal location As Location) As String + Return String.Format("{0} ({1})", location.locationName, location.displayType) + End Function + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/AccountManagement/CreateAccount.vb b/examples/AdWords/Vb/v201402/AccountManagement/CreateAccount.vb new file mode 100644 index 00000000000..ba60223f205 --- /dev/null +++ b/examples/AdWords/Vb/v201402/AccountManagement/CreateAccount.vb @@ -0,0 +1,189 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Text + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example illustrates how to create an account. Note by default, + ''' this account will only be accessible via its parent MCC. + ''' + ''' Tags: ManagedCustomerService.mutate + ''' + Public Class CreateAccount + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New CreateAccount + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to create an account. Note by default," & _ + " this account will only be accessible via its parent MCC." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the ManagedCustomerService. + Dim managedCustomerService As ManagedCustomerService = user.GetService( _ + AdWordsService.v201402.ManagedCustomerService) + + ' Create account. + Dim customer As New ManagedCustomer() + customer.name = "Customer created with ManagedCustomerService on " & _ + New DateTime().ToString() + customer.currencyCode = "EUR" + customer.dateTimeZone = "Europe/London" + + ' Create operations. + Dim operation As New ManagedCustomerOperation() + operation.operand = customer + operation.operator = [Operator].ADD + Try + Dim operations As ManagedCustomerOperation() = New ManagedCustomerOperation() {operation} + ' Add account. + Dim result As ManagedCustomerReturnValue = managedCustomerService.mutate(operations) + + ' Display accounts. + If (Not result.value Is Nothing) AndAlso (result.value.Length > 0) Then + Dim customerResult As ManagedCustomer = result.value(0) + Console.WriteLine("Account with customer ID '{0}' was created.", _ + customerResult.customerId) + Else + Console.WriteLine("No accounts were created.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create accounts.", ex) + End Try + End Sub + End Class + + + ''' + '''Example implementation of a node that would exist in an account tree. + ''' + Class ManagedCustomerTreeNode + ''' + ''' The parent node. + ''' + Private _parentNode As ManagedCustomerTreeNode + + ''' + ''' The account associated with this node. + ''' + Private _account As ManagedCustomer + + ''' + ''' The list of child accounts. + ''' + Private _childAccounts As New List(Of ManagedCustomerTreeNode) + + ''' + ''' Gets or sets the parent node. + ''' + Public Property ParentNode() As ManagedCustomerTreeNode + Get + Return _parentNode + End Get + Set(ByVal value As ManagedCustomerTreeNode) + _parentNode = value + End Set + End Property + + + ''' + ''' Gets or sets the account. + ''' + Public Property Account() As ManagedCustomer + Get + Return _account + End Get + Set(ByVal value As ManagedCustomer) + _account = value + End Set + End Property + + ''' + ''' Gets or sets the child accounts. + ''' + Public Property ChildAccounts() As List(Of ManagedCustomerTreeNode) + Get + Return _childAccounts + End Get + Set(ByVal value As List(Of ManagedCustomerTreeNode)) + _childAccounts = value + End Set + End Property + + ''' + ''' Returns a that represents this instance. + ''' + ''' + ''' A that represents this instance. + ''' + Public Overrides Function ToString() As String + Dim login As String = "(no login)" + If (Not String.IsNullOrEmpty(_account.login)) Then + login = _account.login + End If + Return String.Format("{0}, {1}, {2}", login, _account.customerId, _account.name) + End Function + + ''' + ''' Returns a string representation of the current level of the tree and + ''' recursively returns the string representation of the levels below it. + ''' + ''' The depth of the node. + ''' The String Builder containing the tree + ''' representation. + ''' The tree string representation. + Public Function ToTreeString(ByVal depth As Integer, ByVal sb As StringBuilder) As StringBuilder + For i As Integer = 0 To depth * 2 + sb.Append("-") + Next + sb.Append(Me) + sb.Append("\n") + For Each childAccount As ManagedCustomerTreeNode In _childAccounts + childAccount.ToTreeString(depth + 1, sb) + Next + Return sb + End Function + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/AccountManagement/GetAccountAlerts.vb b/examples/AdWords/Vb/v201402/AccountManagement/GetAccountAlerts.vb new file mode 100644 index 00000000000..ab0b2ef77e9 --- /dev/null +++ b/examples/AdWords/Vb/v201402/AccountManagement/GetAccountAlerts.vb @@ -0,0 +1,126 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example gets all alerts for all clients of an MCC account. + ''' The effective user (ClientCustomerId or AuthToken) must be an MCC user + ''' to get results. This code example won't work with Test Accounts. See + ''' https://developers.google.com/adwords/api/docs/test-accounts. + ''' + ''' Tags: AlertService.get + ''' + Public Class GetAccountAlerts + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAccountAlerts + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all alerts for all clients of an MCC account. The " & _ + "effective user (ClientCustomerId or AuthToken) must be an MCC user to get " & _ + "results. This code example won't work with Test Accounts. See " & _ + "https://developers.google.com/adwords/api/docs/test-accounts" + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the AlertService. + Dim alertService As AlertService = user.GetService(AdWordsService.v201402.AlertService) + + ' Create the selector. + Dim selector As New AlertSelector + + ' Create the alert query. + Dim query As New AlertQuery + query.filterSpec = FilterSpec.ALL + query.clientSpec = ClientSpec.ALL + query.triggerTimeSpec = TriggerTimeSpec.ALL_TIME + query.severities = New AlertSeverity() {AlertSeverity.GREEN, AlertSeverity.YELLOW, _ + AlertSeverity.RED} + + ' Enter all possible values of AlertType to get all alerts. If you are + ' interested only in specific alert types, then you may also do it as + ' follows: + ' query.types = new AlertType() {AlertType.CAMPAIGN_ENDING, + ' AlertType.CAMPAIGN_ENDED} + query.types = [Enum].GetValues(GetType(AlertType)) + selector.query = query + + ' Set paging for selector. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AlertPage + + Try + Do + ' Get account alerts. + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + page = alertService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each alert As Alert In page.entries + Console.WriteLine("{0}) Customer Id is {1:###-###-####}, Alert type is '{2}', " & _ + "Severity is {3}", (i + 1), alert.clientCustomerId, alert.alertType, _ + alert.alertSeverity) + For j As Integer = 0 To alert.details.Length - 1 + Console.WriteLine(" - Triggered at {0}", alert.details(j).triggerTime) + Next j + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of alerts found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve alerts.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/AccountManagement/GetAccountChanges.vb b/examples/AdWords/Vb/v201402/AccountManagement/GetAccountChanges.vb new file mode 100644 index 00000000000..998630832e3 --- /dev/null +++ b/examples/AdWords/Vb/v201402/AccountManagement/GetAccountChanges.vb @@ -0,0 +1,183 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Text + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example gets the changes in the account during the last 24 + ''' hours. + ''' + ''' Tags: CustomerSyncService.get + ''' + Public Class GetAccountChanges + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAccountChanges + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets the changes in the account during the last 24 hours." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the CustomerSyncService. + Dim customerSyncService As CustomerSyncService = user.GetService( _ + AdWordsService.v201402.CustomerSyncService) + + ' The date time string should be of the form yyyyMMdd HHmmss zzz. + Dim minDateTime As String = (DateTime.Now.AddDays(-1).ToUniversalTime.ToString( _ + "yyyyMMdd HHmmss") & " UTC") + Dim maxDateTime As String = (DateTime.Now.ToUniversalTime.ToString("yyyyMMdd HHmmss") & _ + " UTC") + + ' Create date time range. + Dim dateTimeRange As New DateTimeRange + dateTimeRange.min = minDateTime + dateTimeRange.max = maxDateTime + + Try + ' Create the selector. + Dim selector As New CustomerSyncSelector + selector.dateTimeRange = dateTimeRange + selector.campaignIds = GetAllCampaignIds(user) + + ' Get all account changes for campaign. + Dim accountChanges As CustomerChangeData = customerSyncService.get(selector) + + ' Display the changes. + If ((Not accountChanges Is Nothing) AndAlso _ + (Not accountChanges.changedCampaigns Is Nothing)) Then + Console.WriteLine("Displaying changes up to: {0}", accountChanges.lastChangeTimestamp) + + For Each campaignChanges As CampaignChangeData In accountChanges.changedCampaigns + Console.WriteLine("Campaign with id ""{0}"" was changed:", campaignChanges.campaignId) + Console.WriteLine(" Campaign changed status: {0}", _ + campaignChanges.campaignChangeStatus) + If (campaignChanges.campaignChangeStatus <> ChangeStatus.NEW) Then + Console.WriteLine(" Added ad extensions: {0}", _ + GetFormattedList(campaignChanges.addedAdExtensions)) + Console.WriteLine(" Added campaign criteria: {0}", _ + GetFormattedList(campaignChanges.addedCampaignCriteria)) + If (campaignChanges.campaignTargetingChanged) Then + Console.WriteLine(" Added campaign targeting: yes") + Else + Console.WriteLine(" Added campaign targeting: no") + End If + + Console.WriteLine(" Deleted ad extensions: {0}", _ + GetFormattedList(campaignChanges.deletedAdExtensions)) + Console.WriteLine(" Deleted campaign criteria: {0}", _ + GetFormattedList(campaignChanges.deletedCampaignCriteria)) + + If (Not campaignChanges.changedAdGroups Is Nothing) Then + For Each adGroupChanges As AdGroupChangeData In campaignChanges.changedAdGroups + Console.WriteLine(" Ad group with id ""{0}"" was changed:", _ + adGroupChanges.adGroupId) + Console.WriteLine(" Ad group changed status: {0}", _ + adGroupChanges.adGroupChangeStatus) + If (adGroupChanges.adGroupChangeStatus <> ChangeStatus.NEW) Then + Console.WriteLine(" Ads changed: {0}", _ + GetFormattedList(adGroupChanges.changedAds)) + Console.WriteLine(" Criteria changed: {0}", _ + GetFormattedList(adGroupChanges.changedCriteria)) + Console.WriteLine(" Criteria deleted: {0}", _ + GetFormattedList(adGroupChanges.deletedCriteria)) + End If + Next + End If + End If + Console.WriteLine() + Next + Else + Console.WriteLine("No account changes were found.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to get account changes.", ex) + End Try + End Sub + + ''' + ''' Formats a list of ids as a comma separated string. + ''' + ''' The list of ids. + ''' The comma separed formatted string, enclosed in square braces. + ''' + Private Function GetFormattedList(ByVal ids As Long()) As String + Dim builder As New StringBuilder + If (Not ids Is Nothing) Then + For Each id As Long In ids + builder.AppendFormat("{0}, ", id) + Next + End If + Return ("[" & builder.ToString.TrimEnd(New Char() {","c, " "c}) & "]") + End Function + + ''' + ''' Gets all campaign ids in the account. + ''' + ''' The user for which campaigns are retrieved. + ''' The list of campaign ids. + Private Function GetAllCampaignIds(ByVal user As AdWordsUser) As Long() + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201402.CampaignService) + + Dim allCampaigns As New List(Of Long) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id"} + + ' Get all campaigns. + Dim page As CampaignPage = campaignService.get(selector) + + ' Return the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + For Each campaign As Campaign In page.entries + allCampaigns.Add(campaign.id) + Next + End If + Return allCampaigns.ToArray + End Function + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/AccountManagement/GetAccountHierarchy.vb b/examples/AdWords/Vb/v201402/AccountManagement/GetAccountHierarchy.vb new file mode 100644 index 00000000000..31dc072ebc4 --- /dev/null +++ b/examples/AdWords/Vb/v201402/AccountManagement/GetAccountHierarchy.vb @@ -0,0 +1,126 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Text + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example illustrates how to retrieve the account hierarchy under + ''' an account. This code example won't work with Test Accounts. See + ''' https://developers.google.com/adwords/api/docs/test-accounts + ''' + ''' Tags: ServicedAccountService.get + ''' + Public Class GetAccountHierarchy + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAccountHierarchy + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to retrieve the account hierarchy under " & _ + "an account. This code example won't work with Test Accounts. See " & _ + "https://developers.google.com/adwords/api/docs/test-accounts" + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the ManagedCustomerService. + Dim mcService As ManagedCustomerService = user.GetService( _ + AdWordsService.v201402.ManagedCustomerService) + mcService.RequestHeader.clientCustomerId = Nothing + + ' Create selector. + Dim selector As New Selector() + selector.fields = New String() {"Login", "CustomerId", "Name"} + + Try + ' Get results. + Dim page As ManagedCustomerPage = mcService.get(selector) + + ' Display serviced account graph. + If Not page.entries Is Nothing Then + ' Create map from customerId to customer node. + Dim customerIdToCustomerNode As Dictionary(Of Long, ManagedCustomerTreeNode) = _ + New Dictionary(Of Long, ManagedCustomerTreeNode)() + + ' Create account tree nodes for each customer. + For Each customer As ManagedCustomer In page.entries + Dim node As New ManagedCustomerTreeNode() + node.Account = customer + customerIdToCustomerNode.Add(customer.customerId, node) + Next + + ' For each link, connect nodes in tree. + If (Not page.links Is Nothing) Then + For Each link As ManagedCustomerLink In page.links + Dim managerNode As ManagedCustomerTreeNode = _ + customerIdToCustomerNode(link.managerCustomerId) + Dim childNode As ManagedCustomerTreeNode = _ + customerIdToCustomerNode(link.clientCustomerId) + childNode.ParentNode = managerNode + If (Not managerNode Is Nothing) Then + managerNode.ChildAccounts.Add(childNode) + End If + Next + End If + + ' Find the root account node in the tree. + Dim rootNode As ManagedCustomerTreeNode = Nothing + For Each account As ManagedCustomer In page.entries + If (customerIdToCustomerNode(account.customerId).ParentNode Is Nothing) Then + rootNode = customerIdToCustomerNode(account.customerId) + Exit For + End If + Next + + ' Display account tree. + Console.WriteLine("Login, CustomerId, Name") + Console.WriteLine(rootNode.ToTreeString(0, New StringBuilder())) + Else + Console.WriteLine("No accounts were found.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to get accounts.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/AdvancedOperations/AddAdGroupBidModifier.vb b/examples/AdWords/Vb/v201402/AdvancedOperations/AddAdGroupBidModifier.vb new file mode 100644 index 00000000000..5852c75e472 --- /dev/null +++ b/examples/AdWords/Vb/v201402/AdvancedOperations/AddAdGroupBidModifier.vb @@ -0,0 +1,111 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: thagikura@gmail.com (Takeshi Hagikura) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example illustrates how to add ad group level mobile bid + ''' modifier override. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class AddAdGroupBidModifier + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAdGroupBidModifier + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim bidModifier As Double = Double.Parse("INSERT_ADGROUP_BID_MODIFIER_HERE") + codeExample.Run(New AdWordsUser, adGroupId, bidModifier) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to add ad group level mobile bid" & _ + " modifier override." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the adgroup for which bid modifier is + ''' set. + ''' The mobile bid modifier for adgroup + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal bidModifier As Double) + ' Get the AdGroupBidModifierService. + Dim adGroupBidModifierService As AdGroupBidModifierService = user.GetService( _ + AdWordsService.v201402.AdGroupBidModifierService) + + ' Mobile criterion ID. + Dim criterionId As Long = 30001 + + ' Create the adgroup bid modifier. + Dim adGroupBidModifier As New AdGroupBidModifier() + adGroupBidModifier.bidModifier = bidModifier + adGroupBidModifier.adGroupId = adGroupId + + Dim platform As New Platform() + platform.id = criterionId + + adGroupBidModifier.criterion = platform + + Dim operation As New AdGroupBidModifierOperation() + operation.operator = [Operator].ADD + operation.operand = adGroupBidModifier + + Try + ' Add ad group level mobile bid modifier. + Dim retval As AdGroupBidModifierReturnValue = adGroupBidModifierService.mutate( _ + New AdGroupBidModifierOperation() {operation}) + + ' Display the results. + If Not retval Is Nothing AndAlso Not retval.value Is Nothing AndAlso _ + retval.value.Length > 0 Then + Dim newBidModifier As AdGroupBidModifier = retval.value(0) + Console.WriteLine("AdGroup ID {0}, Criterion ID {1} was updated with ad group " & _ + "level modifier: {2}", newBidModifier.adGroupId, newBidModifier.criterion.id, _ + newBidModifier.bidModifier) + Else + Console.WriteLine("No bid modifiers were added to the adgroup.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add bid modifiers to adgroup.", ex) + End Try + End Sub + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201402/AdvancedOperations/AddClickToDownloadAd.vb b/examples/AdWords/Vb/v201402/AdvancedOperations/AddClickToDownloadAd.vb new file mode 100644 index 00000000000..9b2dd0bb383 --- /dev/null +++ b/examples/AdWords/Vb/v201402/AdvancedOperations/AddClickToDownloadAd.vb @@ -0,0 +1,149 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: thagikura@gmail.com (Takeshi Hagikura) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example creates a click-to-download ad, also known as an + ''' app promotion ad to a given ad group. To list ad groups, run + ''' GetAdGroups.vb. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class AddClickToDownloadAd + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddClickToDownloadAd + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example creates a click-to-download ad, also known as an app " & _ + "promotion ad to a given ad group. To list ad groups, run GetAdGroups.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which ads are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim adGroupAdService As AdGroupAdService = _ + user.GetService(AdWordsService.v201402.AdGroupAdService) + + ' Create the template ad. + Dim clickToDownloadAppAd As New TemplateAd() + + clickToDownloadAppAd.name = "Ad for demo game" + clickToDownloadAppAd.templateId = 353 + clickToDownloadAppAd.url = _ + "http://play.google.com/store/apps/details?id=com.example.demogame" + clickToDownloadAppAd.displayUrl = "play.google.com" + + ' Create the template elements for the ad. You can refer to + ' https://developers.google.com/adwords/api/docs/appendix/templateads + ' for the list of avaliable template fields. + Dim headline As New TemplateElementField() + headline.name = "headline" + headline.fieldText = "Enjoy your drive in Mars" + headline.type = TemplateElementFieldType.TEXT + + Dim description1 As New TemplateElementField() + description1.name = "description1" + description1.fieldText = "Realistic physics simulation" + description1.type = TemplateElementFieldType.TEXT + + Dim description2 As New TemplateElementField() + description2.name = "description2" + description2.fieldText = "Race against players online" + description2.type = TemplateElementFieldType.TEXT + + Dim appId As New TemplateElementField() + appId.name = "appId" + appId.fieldText = "com.example.demogame" + appId.type = TemplateElementFieldType.TEXT + + Dim appStore As New TemplateElementField() + appStore.name = "appStore" + appStore.fieldText = "2" + appStore.type = TemplateElementFieldType.ENUM + + Dim adData As New TemplateElement() + adData.uniqueName = "adData" + adData.fields = New TemplateElementField() {headline, description1, description2, appId, _ + appStore} + + clickToDownloadAppAd.templateElements = New TemplateElement() {adData} + + ' Create the adgroupad. + Dim clickToDownloadAppAdGroupAd As New AdGroupAd() + clickToDownloadAppAdGroupAd.adGroupId = adGroupId + clickToDownloadAppAdGroupAd.ad = clickToDownloadAppAd + + ' Optional: Set the status. + clickToDownloadAppAdGroupAd.status = AdGroupAdStatus.PAUSED + + ' Create the operation. + Dim operation As New AdGroupAdOperation() + operation.operator = [Operator].ADD + operation.operand = clickToDownloadAppAdGroupAd + + Try + ' Create the ads. + Dim retval As AdGroupAdReturnValue = adGroupAdService.mutate(New AdGroupAdOperation() _ + {operation}) + + ' Display the results. + If Not retval Is Nothing AndAlso Not retval.value Is Nothing Then + For Each adGroupAd As AdGroupAd In retval.value + Console.WriteLine("New click-to-download ad with id = '{0}' and url = '{1}' " & _ + "was created.", adGroupAd.ad.id, adGroupAd.ad.url) + Next + Else + Console.WriteLine("No click-to-download ads were created.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create click-to-download ad.", ex) + End Try + End Sub + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201402/AdvancedOperations/AddPlacesLocationExtension.vb b/examples/AdWords/Vb/v201402/AdvancedOperations/AddPlacesLocationExtension.vb new file mode 100644 index 00000000000..b24892fa05c --- /dev/null +++ b/examples/AdWords/Vb/v201402/AdvancedOperations/AddPlacesLocationExtension.vb @@ -0,0 +1,198 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 +Imports Google.Api.Ads.Common.Lib + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example adds a feed that syncs feed items from a Google + ''' Places account and associates the feed with a customer. + ''' + ''' Tags: CustomerFeedService.mutate, FeedItemService.mutate + ''' Tags: FeedMappingService.mutate, FeedService.mutate + ''' + Public Class AddPlacesLocationExtension + Inherits ExampleBase + + ''' + ''' The placeholder type for location extensions. See the Placeholder + ''' reference page for a list of all the placeholder types and fields. + ''' + ''' https://developers.google.com/adwords/api/docs/appendix/placeholders + ''' + Private Const PLACEHOLDER_LOCATION As Integer = 7 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddPlacesLocationExtension + Console.WriteLine(codeExample.Description) + Try + Dim placesEmailAddress As String = "INSERT_PLACES_EMAIL_ADDRESS_HERE" + Dim placesAccessToken As String = "INSERT_PLACES_ACCESS_TOKEN_HERE" + + codeExample.Run(New AdWordsUser, placesEmailAddress, placesAccessToken) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a feed that syncs feed items from a Google Places " & _ + "account and associates the feed with a customer." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The email address for Google Places + ''' account. + ''' The OAuth2 access token for Google + ''' Places account. + Public Sub Run(ByVal user As AdWordsUser, ByVal placesEmailAddress As String, _ + ByVal placesAccessToken As String) + ' Get the FeedService. + Dim feedService As FeedService = user.GetService(AdWordsService.v201402.FeedService) + + ' Get the CustomerFeedService. + Dim customerFeedService As CustomerFeedService = user.GetService( _ + AdWordsService.v201402.CustomerFeedService) + + ' Create a feed that will sync to the Google Places account specified + ' by placesEmailAddress. Do not add FeedAttributes to this object, + ' as AdWords will add them automatically because this will be a + ' system generated feed. + Dim placesFeed As New Feed() + placesFeed.name = String.Format("Places feed #{0}", ExampleUtilities.GetRandomString()) + + Dim feedData As New PlacesLocationFeedData() + feedData.emailAddress = placesEmailAddress + + Dim oAuthInfo As New OAuthInfo() + oAuthInfo.httpMethod = "GET" + oAuthInfo.httpRequestUrl = "https://www.google.com/local/add" + oAuthInfo.httpAuthorizationHeader = String.Format("Bearer {0}", placesAccessToken) + feedData.oAuthInfo = oAuthInfo + + placesFeed.systemFeedGenerationData = feedData + + ' Since this feed's feed items will be managed by AdWords, + ' you must set its origin to ADWORDS. + placesFeed.origin = FeedOrigin.ADWORDS + + ' Create an operation to add the feed. + Dim feedOperation As New FeedOperation() + feedOperation.operand = placesFeed + feedOperation.operator = [Operator].ADD + + Try + ' Add the feed. Since it is a system generated feed, AdWords will + ' automatically: + ' 1. Set up the FeedAttributes on the feed. + ' 2. Set up a FeedMapping that associates the FeedAttributes of the + ' Feed with the placeholder fields of the LOCATION placeholder type. + Dim addFeedResult As FeedReturnValue = feedService.mutate( _ + New FeedOperation() {feedOperation}) + Dim addedFeed As Feed = addFeedResult.value(0) + Console.WriteLine("Added places feed with ID {0}", addedFeed.id) + + ' Add a CustomerFeed that associates the feed with this customer for + ' the LOCATION placeholder type. + Dim customerFeed As New CustomerFeed() + customerFeed.feedId = addedFeed.id + customerFeed.placeholderTypes = New Integer() {PLACEHOLDER_LOCATION} + + ' Create a matching function that will always evaluate to true. + Dim customerMatchingFunction As New [Function]() + Dim constOperand As New ConstantOperand() + constOperand.type = ConstantOperandConstantType.BOOLEAN + constOperand.booleanValue = True + customerMatchingFunction.lhsOperand = New FunctionArgumentOperand() {constOperand} + customerMatchingFunction.operator = FunctionOperator.IDENTITY + customerFeed.matchingFunction = customerMatchingFunction + + ' Create an operation to add the customer feed. + Dim customerFeedOperation As New CustomerFeedOperation() + customerFeedOperation.operand = customerFeed + customerFeedOperation.operator = [Operator].ADD + + ' After the completion of the Feed ADD operation above the added feed + ' will not be available for usage in a CustomerFeed until the sync + ' between the AdWords and Places accounts completes. The loop below + ' will retry adding the CustomerFeed up to ten times with an + ' exponential back-off policy. + Dim addedCustomerFeed As CustomerFeed = Nothing + + Dim config As New AdWordsAppConfig() + config.RetryCount = 10 + + Dim errorHandler As New ErrorHandler(config) + Do + Try + Dim customerFeedResult As CustomerFeedReturnValue = _ + customerFeedService.mutate(New CustomerFeedOperation() {customerFeedOperation}) + addedCustomerFeed = customerFeedResult.value(0) + + Console.WriteLine("Added CustomerFeed for feed ID {0} and placeholder type {1}", _ + addedCustomerFeed.feedId, addedCustomerFeed.placeholderTypes(0)) + Exit Try + Catch e As AdWordsApiException + Dim apiException As ApiException = e.ApiException + For Each apiError As ApiError In apiException.errors + If TypeOf apiError Is CustomerFeedError Then + If (DirectCast(apiError, CustomerFeedError).reason = _ + CustomerFeedErrorReason.MISSING_FEEDMAPPING_FOR_PLACEHOLDER_TYPE) Then + errorHandler.DoExponentialBackoff() + errorHandler.IncrementRetriedAttempts() + Else + Throw + End If + End If + Next + + End Try + Loop While (errorHandler.HaveMoreRetryAttemptsLeft()) + + ' OPTIONAL: Create a CampaignFeed to specify which FeedItems to use at + ' the Campaign level. This will be similar to the CampaignFeed in the + ' AddSiteLinks example, except you can also filter based on the + ' business name and category of each FeedItem by using a + ' FeedAttributeOperand in your matching function. + + ' OPTIONAL: Create an AdGroupFeed for even more fine grained control + ' over which feed items are used at the AdGroup level. + Catch ex As Exception + Throw New System.ApplicationException("Failed to create customer feed.", ex) + End Try + End Sub + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201402/AdvancedOperations/AddSiteLinks.vb b/examples/AdWords/Vb/v201402/AdvancedOperations/AddSiteLinks.vb new file mode 100644 index 00000000000..0a8cc54191e --- /dev/null +++ b/examples/AdWords/Vb/v201402/AdvancedOperations/AddSiteLinks.vb @@ -0,0 +1,319 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: thagikura@gmail.com (Takeshi Hagikura) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + + Public Class SiteLinksDataHolder + Dim siteLinksFeedIdField As Long + Dim linkTextFeedAttributeIdField As Long + Dim linkUrlFeedAttributeIdField As Long + Dim siteLinkFeedItemIdsField As New List(Of Long) + + Public Property SiteLinksFeedId As Long + Get + Return siteLinksFeedIdField + End Get + Set(ByVal value As Long) + siteLinksFeedIdField = value + End Set + End Property + + Public Property LinkTextFeedAttributeId As Long + Get + Return linkTextFeedAttributeIdField + End Get + Set(ByVal value As Long) + linkTextFeedAttributeIdField = value + End Set + End Property + + Public Property LinkUrlFeedAttributeId As Long + Get + Return linkUrlFeedAttributeIdField + End Get + Set(ByVal value As Long) + linkUrlFeedAttributeIdField = value + End Set + End Property + + Public Property SiteLinkFeedItemIds As List(Of Long) + Get + Return siteLinkFeedItemIdsField + End Get + Set(ByVal value As List(Of Long)) + siteLinkFeedItemIdsField = value + End Set + End Property + End Class + + ''' + ''' This code example adds a sitelinks feed and associates it with a campaign. + ''' To create a campaign, run AddCampaign.cs. + ''' + ''' Tags: CampaignFeedService.mutate, FeedService.mutate, FeedItemService.mutate, + ''' Tags: FeedMappingService.mutate + ''' + Public Class AddSiteLinks + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddSiteLinks + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a sitelinks feed and associates it with a campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign with which sitelinks are associated. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + Dim siteLinksData As New SiteLinksDataHolder + createSiteLinksFeed(user, siteLinksData) + createSiteLinksFeedItems(user, siteLinksData) + createSiteLinksFeedMapping(user, siteLinksData) + createSiteLinksCampaignFeed(user, siteLinksData, campaignId) + End Sub + + Private Sub createSiteLinksFeed( _ + ByVal user As AdWordsUser, ByVal siteLinksData As SiteLinksDataHolder) + ' Get the FeedService. + Dim feedService As FeedService = user.GetService(AdWordsService.v201402.FeedService) + + ' Create attributes. + Dim textAttribute As New FeedAttribute + textAttribute.type = FeedAttributeType.STRING + textAttribute.name = "Link Text" + Dim urlAttribute As New FeedAttribute + urlAttribute.type = FeedAttributeType.URL + urlAttribute.name = "Link URL" + + ' Create the feed. + Dim siteLinksFeed As New Feed + siteLinksFeed.name = "Feed For Site Links" + siteLinksFeed.attributes = New FeedAttribute() {textAttribute, urlAttribute} + siteLinksFeed.origin = FeedOrigin.USER + + ' Create operation. + Dim operation As New FeedOperation + operation.operand = siteLinksFeed + operation.operator = [Operator].ADD + + ' Add the feed. + Dim result As FeedReturnValue = feedService.mutate(New FeedOperation() {operation}) + + Dim savedFeed As Feed = result.value(0) + + siteLinksData.SiteLinksFeedId = savedFeed.id + Dim savedAttributes As FeedAttribute() = savedFeed.attributes + siteLinksData.LinkTextFeedAttributeId = savedAttributes(0).id + siteLinksData.LinkUrlFeedAttributeId = savedAttributes(1).id + Console.WriteLine("Feed with name {0} and ID {1} with linkTextAttributeId {2}" & _ + "linkUrlAttributeId {3} was created.", savedFeed.name, savedFeed.id, _ + savedAttributes(0).id, savedAttributes(1).id) + End Sub + + Private Sub createSiteLinksFeedItems( _ + ByVal user As AdWordsUser, ByVal siteLinksData As SiteLinksDataHolder) + ' Get the FeedItemService. + Dim feedItemService As FeedItemService = _ + user.GetService(AdWordsService.v201402.FeedItemService) + + ' Create operations to add FeedItems. + Dim home As FeedItemOperation = _ + newSiteLinkFeedItemAddOperation(siteLinksData, "Home", "http://www.example.com") + Dim stores As FeedItemOperation = _ + newSiteLinkFeedItemAddOperation(siteLinksData, "Stores", "http://www.example.com/stores") + Dim onSale As FeedItemOperation = _ + newSiteLinkFeedItemAddOperation(siteLinksData, "On Sale", "http://www.example.com/sale") + Dim support As FeedItemOperation = _ + newSiteLinkFeedItemAddOperation(siteLinksData, "Support", _ + "http://www.example.com/support") + Dim products As FeedItemOperation = _ + newSiteLinkFeedItemAddOperation(siteLinksData, "Products", "http://www.example.com/prods") + Dim aboutUs As FeedItemOperation = _ + newSiteLinkFeedItemAddOperation(siteLinksData, "About Us", "http://www.example.com/about") + + Dim operations As FeedItemOperation() = _ + New FeedItemOperation() {home, stores, onSale, support, products, aboutUs} + + Dim result As FeedItemReturnValue = feedItemService.mutate(operations) + For Each item As FeedItem In result.value + Console.WriteLine("FeedItem with feedItemId {0} was added.", item.feedItemId) + siteLinksData.SiteLinkFeedItemIds.Add(item.feedItemId) + Next + End Sub + + ' See the Placeholder reference page for a list of all the placeholder types and fields. + ' https://developers.google.com/adwords/api/docs/appendix/placeholders.html + Private Const PLACEHOLDER_SITELINKS As Integer = 1 + + ' See the Placeholder reference page for a list of all the placeholder types and fields. + Private Const PLACEHOLDER_FIELD_SITELINK_LINK_TEXT As Integer = 1 + Private Const PLACEHOLDER_FIELD_SITELINK_URL As Integer = 2 + + Private Sub createSiteLinksFeedMapping( _ + ByVal user As AdWordsUser, ByVal siteLinksData As SiteLinksDataHolder) + ' Get the FeedItemService. + Dim feedMappingService As FeedMappingService = _ + user.GetService(AdWordsService.v201402.FeedMappingService) + + ' Map the FeedAttributeIds to the fieldId constants. + Dim linkTextFieldMapping As New AttributeFieldMapping + linkTextFieldMapping.feedAttributeId = siteLinksData.LinkTextFeedAttributeId + linkTextFieldMapping.fieldId = PLACEHOLDER_FIELD_SITELINK_LINK_TEXT + Dim linkUrlFieldMapping As New AttributeFieldMapping + linkUrlFieldMapping.feedAttributeId = siteLinksData.LinkUrlFeedAttributeId + linkUrlFieldMapping.fieldId = PLACEHOLDER_FIELD_SITELINK_URL + + ' Create the FieldMapping and operation. + Dim feedMapping As New FeedMapping + feedMapping.placeholderType = PLACEHOLDER_SITELINKS + feedMapping.feedId = siteLinksData.SiteLinksFeedId + feedMapping.attributeFieldMappings = _ + New AttributeFieldMapping() {linkTextFieldMapping, linkUrlFieldMapping} + Dim operation As New FeedMappingOperation + operation.operand = feedMapping + operation.operator = [Operator].ADD + + ' Save the field mapping. + Dim result As FeedMappingReturnValue = _ + feedMappingService.mutate(New FeedMappingOperation() {operation}) + For Each savedFeedMapping As FeedMapping In result.value + Console.WriteLine("Feed mapping with ID {0} and placeholderType {1} was saved for " & _ + "feed with ID {2}.", savedFeedMapping.feedMappingId, savedFeedMapping.placeholderType, _ + savedFeedMapping.feedId) + Next + End Sub + + Private Sub createSiteLinksCampaignFeed(ByVal user As AdWordsUser, _ + ByVal siteLinksData As SiteLinksDataHolder, ByVal campaignId As Long) + ' Get the CampaignFeedService. + Dim campaignFeedService As CampaignFeedService = _ + user.GetService(AdWordsService.v201402.CampaignFeedService) + + ' Map the feed item ids to the campaign using an IN operation. + Dim feedItemRequestContextOperand As New RequestContextOperand() + feedItemRequestContextOperand.contextType = RequestContextOperandContextType.FEED_ITEM_ID + + Dim feedItemOperands As New List(Of FunctionArgumentOperand)() + For Each feedItemId As Long In siteLinksData.SiteLinkFeedItemIds + Dim feedItemOperand As New ConstantOperand() + feedItemOperand.longValue = feedItemId + feedItemOperand.type = ConstantOperandConstantType.LONG + feedItemOperands.Add(feedItemOperand) + Next + + Dim feedItemfunction As New [Function]() + feedItemfunction.lhsOperand = New FunctionArgumentOperand() {feedItemRequestContextOperand} + feedItemfunction.operator = FunctionOperator.IN + feedItemfunction.rhsOperand = feedItemOperands.ToArray() + + ' Optional: to target to a platform, define a function and 'AND' it with + ' the feed item ID link: + Dim platformRequestContextOperand As New RequestContextOperand() + platformRequestContextOperand.contextType = RequestContextOperandContextType.DEVICE_PLATFORM + + Dim platformOperand As New ConstantOperand() + platformOperand.stringValue = "Mobile" + platformOperand.type = ConstantOperandConstantType.STRING + + Dim platformFunction As New [Function]() + platformFunction.lhsOperand = New FunctionArgumentOperand() {platformRequestContextOperand} + platformFunction.operator = FunctionOperator.EQUALS + platformFunction.rhsOperand = New FunctionArgumentOperand() {platformOperand} + + ' Combine the two functions using an AND operation. + Dim feedItemFunctionOperand As New FunctionOperand() + feedItemFunctionOperand.value = feedItemfunction + + Dim platformFunctionOperand As New FunctionOperand() + platformFunctionOperand.value = platformFunction + + Dim combinedFunction As New [Function]() + combinedFunction.operator = FunctionOperator.AND + combinedFunction.lhsOperand = New FunctionArgumentOperand() { _ + feedItemFunctionOperand, platformFunctionOperand} + + Dim campaignFeed As New CampaignFeed() + campaignFeed.feedId = siteLinksData.SiteLinksFeedId + campaignFeed.campaignId = campaignId + campaignFeed.matchingFunction = combinedFunction + ' Specifying placeholder types on the CampaignFeed allows the same feed + ' to be used for different placeholders in different Campaigns. + campaignFeed.placeholderTypes = New Integer() {PLACEHOLDER_SITELINKS} + + Dim operation As New CampaignFeedOperation + operation.operand = CampaignFeed + operation.operator = [Operator].ADD + Dim result As CampaignFeedReturnValue = _ + campaignFeedService.mutate(New CampaignFeedOperation() {operation}) + For Each savedCampaignFeed As CampaignFeed In result.value + Console.WriteLine("Campaign with ID {0} was associated with feed with ID {1}", _ + savedCampaignFeed.campaignId, savedCampaignFeed.feedId) + Next + End Sub + + Function newSiteLinkFeedItemAddOperation(ByVal siteLinksData As SiteLinksDataHolder, _ + ByVal text As String, ByVal url As String) As FeedItemOperation + ' Create the FeedItemAttributeValues for our text values. + Dim linkTextAttributeValue As New FeedItemAttributeValue + linkTextAttributeValue.feedAttributeId = siteLinksData.LinkTextFeedAttributeId + linkTextAttributeValue.stringValue = text + Dim linkUrlAttributeValue As New FeedItemAttributeValue + linkUrlAttributeValue.feedAttributeId = siteLinksData.LinkUrlFeedAttributeId + linkUrlAttributeValue.stringValue = url + + ' Create the feed item and operation. + Dim item As New FeedItem + item.feedId = siteLinksData.SiteLinksFeedId + item.attributeValues = _ + New FeedItemAttributeValue() {linkTextAttributeValue, linkUrlAttributeValue} + Dim Operation As New FeedItemOperation + Operation.operand = item + Operation.operator = [Operator].ADD + Return Operation + End Function + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201402/AdvancedOperations/GetAdGroupBidModifiers.vb b/examples/AdWords/Vb/v201402/AdvancedOperations/GetAdGroupBidModifiers.vb new file mode 100644 index 00000000000..a60a776a6c8 --- /dev/null +++ b/examples/AdWords/Vb/v201402/AdvancedOperations/GetAdGroupBidModifiers.vb @@ -0,0 +1,125 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example illustrates how to retrieve ad group level mobile bid + ''' modifiers for a campaign. + ''' + ''' AdGroupBidModifierService.get + ''' + Public Class GetAdGroupBidModifiers + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAdGroupBidModifiers + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to retrieve ad group level mobile bid" & _ + " modifiers for a campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which adgroup bid + ''' modifiers are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupBidModifierService. + Dim adGroupBidModifierService As AdGroupBidModifierService = user.GetService( _ + AdWordsService.v201402.AdGroupBidModifierService) + + Const PAGE_SIZE As Integer = 500 + + ' Get all ad group bid modifiers for the campaign. + Dim selector As New Selector() + selector.fields = New String() {"CampaignId", "AdGroupId", "BidModifier", _ + "BidModifierSource", "CriteriaType", "Id"} + + Dim predicate As New Predicate() + predicate.field = "CampaignId" + predicate.[operator] = PredicateOperator.EQUALS + predicate.values = New String() {campaignId.ToString()} + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging() + + Dim offset As Integer = 0 + Dim pageSize As Integer = PAGE_SIZE + + Dim page As New AdGroupBidModifierPage() + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the campaigns. + page = adGroupBidModifierService.get(selector) + + ' Display the results. + If (Not page Is Nothing) AndAlso (Not page.entries Is Nothing) Then + Dim i As Integer = offset + For Each adGroupBidModifier As AdGroupBidModifier In page.entries + Dim bidModifier As String = "" + If adGroupBidModifier.bidModifierSpecified Then + bidModifier = adGroupBidModifier.bidModifier.ToString() + Else + bidModifier = "UNSET" + End If + Console.WriteLine("{0}) Campaign ID {1}, AdGroup ID {2}, Criterion ID {3} has " & _ + "ad group level modifier: {4}, source = {5}.", _ + i + 1, adGroupBidModifier.campaignId, _ + adGroupBidModifier.adGroupId, adGroupBidModifier.criterion.id, _ + bidModifier, adGroupBidModifier.bidModifierSource) + i = i + 1 + Next + End If + offset += pageSize + Loop While offset < page.totalNumEntries + Console.WriteLine("Number of adgroup bid modifiers found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve adgroup bid modifiers.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/AdvancedOperations/UploadOfflineConversions.vb b/examples/AdWords/Vb/v201402/AdvancedOperations/UploadOfflineConversions.vb new file mode 100644 index 00000000000..529b8d8f07f --- /dev/null +++ b/examples/AdWords/Vb/v201402/AdvancedOperations/UploadOfflineConversions.vb @@ -0,0 +1,245 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example adds a Shared Bidding Strategy and uses it to construct + ''' a campaign. + ''' + ''' Tags: BiddingStrategyService.mutate + ''' Tags: BudgetService.mutate, CampaignService.mutate + ''' + Public Class UploadOfflineConversions + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim conversionName As String = "INSERT_CONVERSION_NAME_HERE" + ' GCLID needs to be newer than 30 days. + Dim gClId As String = "INSERT_GOOGLE_CLICK_ID_HERE" + ' The conversion time should be higher than the click time. + Dim conversionTime As String = "INSERT_CONVERSION_TIME_HERE" + Dim conversionValue As Double = Double.Parse("INSERT_CONVERSION_VALUE_HERE") + + Dim codeExample As New UploadOfflineConversions + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser, conversionName, gClId, conversionTime, conversionValue) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a Shared Bidding Strategy and uses it to construct " & _ + "a campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The name of the upload conversion to be + ''' created. + ''' The Google Click ID of the click for which offline + ''' conversions are uploaded. + ''' The conversion value to be uploaded. + ''' + ''' The conversion time, in yyyymmdd hhmmss + ''' format. + Public Sub Run(ByVal user As AdWordsUser, ByVal conversionName As String, _ + ByVal gClid As String, ByVal conversionTime As String, ByVal conversionValue As Double) + ' Get the ConversionTrackerService. + Dim conversionTrackerService As ConversionTrackerService = user.GetService( _ + AdWordsService.v201402.ConversionTrackerService) + + ' Get the OfflineConversionFeedService. + Dim offlineConversionFeedService As OfflineConversionFeedService = user.GetService( _ + AdWordsService.v201402.OfflineConversionFeedService) + + Const VIEWTHROUGH_LOOKBACK_WINDOW As Integer = 30 + Const CTC_LOOKBACK_WINDOW As Integer = 90 + + Try + ' Create an upload conversion. Once created, this entry will be visible + ' under Tools and Analysis->Conversion and will have "Source = Import". + Dim uploadConversion As New UploadConversion() + uploadConversion.category = ConversionTrackerCategory.PAGE_VIEW + uploadConversion.name = conversionName + uploadConversion.viewthroughLookbackWindow = VIEWTHROUGH_LOOKBACK_WINDOW + uploadConversion.ctcLookbackWindow = CTC_LOOKBACK_WINDOW + + Dim uploadConversionOperation As New ConversionTrackerOperation() + uploadConversionOperation.operator = [Operator].ADD + uploadConversionOperation.operand = uploadConversion + + Dim conversionTrackerRetval As ConversionTrackerReturnValue = _ + conversionTrackerService.mutate(New ConversionTrackerOperation() { _ + uploadConversionOperation}) + + Dim newUploadConversion As UploadConversion = conversionTrackerRetval.value(0) + + Console.WriteLine("New upload conversion type with name = '{0}' and id = {1} was " & _ + "created.", newUploadConversion.name, newUploadConversion.id) + + ' Associate offline conversions with the upload conversion we created. + Dim feed As New OfflineConversionFeed() + feed.conversionName = conversionName + feed.conversionTime = conversionTime + feed.conversionValue = conversionValue + feed.googleClickId = gClid + + Dim offlineConversionOperation As New OfflineConversionFeedOperation() + offlineConversionOperation.operator = [Operator].ADD + offlineConversionOperation.operand = feed + + Dim offlineConversionRetval As OfflineConversionFeedReturnValue = _ + offlineConversionFeedService.mutate( _ + New OfflineConversionFeedOperation() {offlineConversionOperation}) + + Dim newFeed As OfflineConversionFeed = offlineConversionRetval.value(0) + + Console.WriteLine("Uploaded offline conversion value of {0} for Google Click ID = " & _ + "'{1}' to '{2}'.", newFeed.conversionValue, newFeed.googleClickId, _ + newFeed.conversionName) + Catch ex As Exception + Throw New System.ApplicationException("Failed to upload offline conversions.", ex) + End Try + End Sub + + + ''' + ''' Creates the shared bidding strategy. + ''' + ''' The bidding strategy service. + ''' The bidding strategy name. + ''' The bid ceiling. + ''' The spend target. + ''' The bidding strategy object. + Private Function CreateBiddingStrategy(ByVal biddingStrategyService As BiddingStrategyService, _ + ByVal name As String, ByVal bidCeiling As Long, ByVal spendTarget As Long) _ + As SharedBiddingStrategy + ' Create a shared bidding strategy. + Dim sharedBiddingStrategy As New SharedBiddingStrategy() + sharedBiddingStrategy.name = name + + Dim biddingScheme As New TargetSpendBiddingScheme() + ' Optionally set additional bidding scheme parameters. + biddingScheme.bidCeiling = New Money() + biddingScheme.bidCeiling.microAmount = bidCeiling + + biddingScheme.spendTarget = New Money() + biddingScheme.spendTarget.microAmount = spendTarget + + sharedBiddingStrategy.biddingScheme = biddingScheme + + ' Create operation. + Dim operation As New BiddingStrategyOperation() + operation.operator = [Operator].ADD + operation.operand = sharedBiddingStrategy + + Return biddingStrategyService.mutate(New BiddingStrategyOperation() {operation}).value(0) + End Function + + ''' + ''' Creates an explicit budget to be used only to create the Campaign. + ''' + ''' The budget service. + ''' The budget name. + ''' The budget amount. + ''' The budget object. + Private Function CreateSharedBudget(ByVal budgetService As BudgetService, _ + ByVal name As String, ByVal amount As Long) As Budget + ' Create a shared budget + Dim budget As New Budget() + budget.name = name + budget.period = BudgetBudgetPeriod.DAILY + budget.amount = New Money() + budget.amount.microAmount = amount + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD + budget.isExplicitlyShared = True + + ' Create operation. + Dim operation As New BudgetOperation() + operation.operand = budget + operation.operator = [Operator].ADD + + ' Make the mutate request. + Return budgetService.mutate(New BudgetOperation() {operation}).value(0) + End Function + + ''' + ''' Creates the campaign with a shared bidding strategy. + ''' + ''' The campaign service. + ''' The campaign name. + ''' The bidding strategy id. + ''' The shared budget id. + ''' The campaign object. + Private Function CreateCampaignWithBiddingStrategy(ByVal campaignService As CampaignService, _ + ByVal name As String, ByVal biddingStrategyId As Long, ByVal sharedBudgetId As Long) _ + As Campaign + ' Create campaign. + Dim campaign As New Campaign() + campaign.name = name + + ' Set the budget. + campaign.budget = New Budget() + campaign.budget.budgetId = sharedBudgetId + + ' Set bidding strategy (required). + Dim biddingStrategyConfiguration As New BiddingStrategyConfiguration() + biddingStrategyConfiguration.biddingStrategyId = biddingStrategyId + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration + + ' Set keyword matching setting (required). + Dim keywordMatchSetting As New KeywordMatchSetting() + keywordMatchSetting.optIn = True + campaign.settings = New Setting() {keywordMatchSetting} + + ' Set network targeting (recommended). + Dim networkSetting As New NetworkSetting() + networkSetting.targetGoogleSearch = True + networkSetting.targetSearchNetwork = True + networkSetting.targetContentNetwork = True + campaign.networkSetting = networkSetting + + ' Create operation. + Dim operation As New CampaignOperation() + operation.operand = campaign + operation.operator = [Operator].ADD + + Return campaignService.mutate(New CampaignOperation() {operation}).value(0) + End Function + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/AdvancedOperations/UseSharedBiddingStrategy.vb b/examples/AdWords/Vb/v201402/AdvancedOperations/UseSharedBiddingStrategy.vb new file mode 100644 index 00000000000..68ef47febd6 --- /dev/null +++ b/examples/AdWords/Vb/v201402/AdvancedOperations/UseSharedBiddingStrategy.vb @@ -0,0 +1,213 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example adds a Shared Bidding Strategy and uses it to construct + ''' a campaign. + ''' + ''' Tags: BiddingStrategyService.mutate + ''' Tags: BudgetService.mutate, CampaignService.mutate + ''' + Public Class UseSharedBiddingStrategy + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UseSharedBiddingStrategy + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a Shared Bidding Strategy and uses it to construct " & _ + "a campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the services. + Dim biddingStrategyService As BiddingStrategyService = user.GetService( _ + AdWordsService.v201402.BiddingStrategyService) + + Dim budgetService As BudgetService = user.GetService(AdWordsService.v201402.BudgetService) + + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201402.CampaignService) + + Dim biddingStrategyName As String = "Maximize Clicks " & ExampleUtilities.GetRandomString() + Dim bidCeiling As Long = 2000000 + Dim spendTarget As Long = 20000000 + + Dim budgetName As String = "Shared Interplanetary Budget #" & _ + ExampleUtilities.GetRandomString() + Dim budgetAmount As Long = 30000000 + + Dim campaignName As String = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString() + + Try + Dim sharedBiddingStrategy As SharedBiddingStrategy = CreateBiddingStrategy( _ + biddingStrategyService, biddingStrategyName, bidCeiling, spendTarget) + Console.WriteLine("Shared bidding strategy with name '{0}' and ID {1} of type {2} " & _ + "was created.", sharedBiddingStrategy.name, sharedBiddingStrategy.id, _ + sharedBiddingStrategy.biddingScheme.BiddingSchemeType) + + Dim sharedBudget As Budget = CreateSharedBudget(budgetService, budgetName, budgetAmount) + + Dim newCampaign As Campaign = CreateCampaignWithBiddingStrategy(campaignService, _ + campaignName, sharedBiddingStrategy.id, sharedBudget.budgetId) + + Console.WriteLine("Campaign with name '{0}', ID {1} and bidding scheme ID {2} was " & _ + "created.", newCampaign.name, newCampaign.id, _ + newCampaign.biddingStrategyConfiguration.biddingStrategyId) + + Catch ex As Exception + Throw New System.ApplicationException("Failed to create campaign that uses shared " & _ + "bidding strategy.", ex) + End Try + End Sub + + + ''' + ''' Creates the shared bidding strategy. + ''' + ''' The bidding strategy service. + ''' The bidding strategy name. + ''' The bid ceiling. + ''' The spend target. + ''' The bidding strategy object. + Private Function CreateBiddingStrategy(ByVal biddingStrategyService As BiddingStrategyService, _ + ByVal name As String, ByVal bidCeiling As Long, ByVal spendTarget As Long) _ + As SharedBiddingStrategy + ' Create a shared bidding strategy. + Dim sharedBiddingStrategy As New SharedBiddingStrategy() + sharedBiddingStrategy.name = name + + Dim biddingScheme As New TargetSpendBiddingScheme() + ' Optionally set additional bidding scheme parameters. + biddingScheme.bidCeiling = New Money() + biddingScheme.bidCeiling.microAmount = bidCeiling + + biddingScheme.spendTarget = New Money() + biddingScheme.spendTarget.microAmount = spendTarget + + sharedBiddingStrategy.biddingScheme = biddingScheme + + ' Create operation. + Dim operation As New BiddingStrategyOperation() + operation.operator = [Operator].ADD + operation.operand = sharedBiddingStrategy + + Return biddingStrategyService.mutate(New BiddingStrategyOperation() {operation}).value(0) + End Function + + ''' + ''' Creates an explicit budget to be used only to create the Campaign. + ''' + ''' The budget service. + ''' The budget name. + ''' The budget amount. + ''' The budget object. + Private Function CreateSharedBudget(ByVal budgetService As BudgetService, _ + ByVal name As String, ByVal amount As Long) As Budget + ' Create a shared budget + Dim budget As New Budget() + budget.name = name + budget.period = BudgetBudgetPeriod.DAILY + budget.amount = New Money() + budget.amount.microAmount = amount + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD + budget.isExplicitlyShared = True + + ' Create operation. + Dim operation As New BudgetOperation() + operation.operand = budget + operation.operator = [Operator].ADD + + ' Make the mutate request. + Return budgetService.mutate(New BudgetOperation() {operation}).value(0) + End Function + + ''' + ''' Creates the campaign with a shared bidding strategy. + ''' + ''' The campaign service. + ''' The campaign name. + ''' The bidding strategy id. + ''' The shared budget id. + ''' The campaign object. + Private Function CreateCampaignWithBiddingStrategy(ByVal campaignService As CampaignService, _ + ByVal name As String, ByVal biddingStrategyId As Long, ByVal sharedBudgetId As Long) _ + As Campaign + ' Create campaign. + Dim campaign As New Campaign() + campaign.name = name + campaign.advertisingChannelType = AdvertisingChannelType.SEARCH + + ' Set the budget. + campaign.budget = New Budget() + campaign.budget.budgetId = sharedBudgetId + + ' Set bidding strategy (required). + Dim biddingStrategyConfiguration As New BiddingStrategyConfiguration() + biddingStrategyConfiguration.biddingStrategyId = biddingStrategyId + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration + + ' Set keyword matching setting (required). + Dim keywordMatchSetting As New KeywordMatchSetting() + keywordMatchSetting.optIn = True + campaign.settings = New Setting() {keywordMatchSetting} + + ' Set network targeting (recommended). + Dim networkSetting As New NetworkSetting() + networkSetting.targetGoogleSearch = True + networkSetting.targetSearchNetwork = True + networkSetting.targetContentNetwork = True + campaign.networkSetting = networkSetting + + ' Create operation. + Dim operation As New CampaignOperation() + operation.operand = campaign + operation.operator = [Operator].ADD + + Return campaignService.mutate(New CampaignOperation() {operation}).value(0) + End Function + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/BasicOperations/AddAdGroupDemographicCriteria.vb b/examples/AdWords/Vb/v201402/BasicOperations/AddAdGroupDemographicCriteria.vb new file mode 100644 index 00000000000..5c4d5514db5 --- /dev/null +++ b/examples/AdWords/Vb/v201402/BasicOperations/AddAdGroupDemographicCriteria.vb @@ -0,0 +1,124 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example adds demographic target criteria to an ad group. To get + ''' ad groups, run AddAdGroup.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class AddAdGroupDemographicCriteria + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAdGroupDemographicCriteria + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds demographic target criteria to an ad group. To get ad " & _ + "groups, run AddAdGroup.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which criteria are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = _ + user.GetService(AdWordsService.v201402.AdGroupCriterionService) + + ' Create biddable ad group criterion for gender + Dim genderTarget As New Gender() + ' Criterion Id for male. The IDs can be found here + ' https://developers.google.com/adwords/api/docs/appendix/genders + genderTarget.id = 10 + + Dim genderBiddableAdGroupCriterion As New BiddableAdGroupCriterion() + genderBiddableAdGroupCriterion.adGroupId = adGroupId + genderBiddableAdGroupCriterion.criterion = genderTarget + + ' Create negative ad group criterion for age range + Dim ageRangeNegative As New AgeRange() + ' Criterion Id for age 18 to 24. The IDs can be found here + ' https://developers.google.com/adwords/api/docs/appendix/ages + + ageRangeNegative.id = 503001 + Dim ageRangeNegativeAdGroupCriterion As New NegativeAdGroupCriterion() + ageRangeNegativeAdGroupCriterion.adGroupId = adGroupId + ageRangeNegativeAdGroupCriterion.criterion = ageRangeNegative + + ' Create operations. + Dim genderBiddableAdGroupCriterionOperation As New AdGroupCriterionOperation() + genderBiddableAdGroupCriterionOperation.operand = genderBiddableAdGroupCriterion + genderBiddableAdGroupCriterionOperation.operator = [Operator].ADD + + Dim ageRangeNegativeAdGroupCriterionOperation As New AdGroupCriterionOperation() + ageRangeNegativeAdGroupCriterionOperation.operand = ageRangeNegativeAdGroupCriterion + ageRangeNegativeAdGroupCriterionOperation.operator = [Operator].ADD + + Dim operations As New List(Of Operation) + operations.Add(genderBiddableAdGroupCriterionOperation) + operations.Add(ageRangeNegativeAdGroupCriterionOperation) + + Try + ' Add ad group criteria. + Dim result As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + operations.ToArray) + + ' Display ad group criteria. + If (Not result Is Nothing) AndAlso Not (result.value Is Nothing) Then + For Each adGroupCriterionResult As AdGroupCriterion In result.value + Console.WriteLine("Ad group criterion with ad group id '{0}', criterion id " & _ + "'{1}', and type '{2}' was added.", adGroupCriterionResult.adGroupId, _ + adGroupCriterionResult.criterion.id, _ + adGroupCriterionResult.criterion.CriterionType) + Next + Else + Console.WriteLine("No ad group criteria were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create ad group criteria.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/BasicOperations/AddAdGroups.vb b/examples/AdWords/Vb/v201402/BasicOperations/AddAdGroups.vb new file mode 100644 index 00000000000..5d7e512400e --- /dev/null +++ b/examples/AdWords/Vb/v201402/BasicOperations/AddAdGroups.vb @@ -0,0 +1,138 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example illustrates how to create ad groups. To create + ''' campaigns, run AddCampaigns.vb. + ''' + ''' Tags: AdGroupService.mutate + ''' + Public Class AddAdGroups + Inherits ExampleBase + ''' + ''' Number of items being added / updated in this code example. + ''' + Const NUM_ITEMS As Integer = 5 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAdGroups + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to create ad groups. To create campaigns," & _ + " run AddCampaigns.vb" + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to which ad groups are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService( _ + AdWordsService.v201402.AdGroupService) + + Dim operations As New List(Of AdGroupOperation) + + For i As Integer = 1 To NUM_ITEMS + ' Create the ad group. + Dim adGroup As New AdGroup + adGroup.name = String.Format("Earth to Mars Cruises #{0}", ExampleUtilities.GetRandomString) + adGroup.status = AdGroupStatus.ENABLED + adGroup.campaignId = campaignId + + ' Set the ad group bids. + Dim biddingConfig As New BiddingStrategyConfiguration() + + Dim cpcBid As New CpcBid() + cpcBid.bid = New Money() + cpcBid.bid.microAmount = 10000000 + + biddingConfig.bids = New Bids() {cpcBid} + + adGroup.biddingStrategyConfiguration = biddingConfig + + ' Optional: Set targeting restrictions. + ' These setting only affect serving for the Display Network. + Dim targetingSetting As New TargetingSetting() + + Dim placementDetail As New TargetingSettingDetail() + placementDetail.criterionTypeGroup = CriterionTypeGroup.PLACEMENT + placementDetail.targetAll = True + + Dim verticalDetail As New TargetingSettingDetail() + verticalDetail.criterionTypeGroup = CriterionTypeGroup.VERTICAL + verticalDetail.targetAll = False + + targetingSetting.details = New TargetingSettingDetail() {placementDetail, verticalDetail} + + adGroup.settings = New Setting() {targetingSetting} + + ' Create the operation. + Dim operation As New AdGroupOperation + operation.operator = [Operator].ADD + operation.operand = adGroup + + operations.Add(operation) + Next + + Try + ' Create the ad group. + Dim retVal As AdGroupReturnValue = adGroupService.mutate(operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + For Each newAdGroup As AdGroup In retVal.value + Console.WriteLine("Ad group with id = '{0}' and name = '{1}' was created.", _ + newAdGroup.id, newAdGroup.name) + Next + Else + Console.WriteLine("No ad groups were created.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create ad groups.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/BasicOperations/AddCampaigns.vb b/examples/AdWords/Vb/v201402/BasicOperations/AddCampaigns.vb new file mode 100644 index 00000000000..a751a0bac55 --- /dev/null +++ b/examples/AdWords/Vb/v201402/BasicOperations/AddCampaigns.vb @@ -0,0 +1,169 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example adds campaigns. To get campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignService.mutate + ''' + Public Class AddCampaigns + Inherits ExampleBase + ''' + ''' Number of items being added / updated in this code example. + ''' + Const NUM_ITEMS As Integer = 5 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddCampaigns + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds campaigns. To get campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the BudgetService. + Dim budgetService As BudgetService = user.GetService( _ + AdWordsService.v201402.BudgetService) + + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201402.CampaignService) + + ' Create the campaign budget. + Dim budget As New Budget + budget.name = "Interplanetary Cruise Budget #" & ExampleUtilities.GetRandomString + budget.period = BudgetBudgetPeriod.DAILY + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD + budget.amount = New Money + budget.amount.microAmount = 50000000 + + Dim budgetOperation As New BudgetOperation + budgetOperation.operator = [Operator].ADD + budgetOperation.operand = budget + + Try + Dim budgetRetval As BudgetReturnValue = budgetService.mutate(New BudgetOperation() {budgetOperation}) + budget = budgetRetval.value(0) + Catch ex As Exception + Throw New System.ApplicationException("Failed to add shared budget.", ex) + End Try + + Dim operations As New List(Of CampaignOperation) + + For i As Integer = 1 To NUM_ITEMS + ' Create the campaign. + Dim campaign As New Campaign + campaign.name = "Interplanetary Cruise #" & ExampleUtilities.GetRandomString + campaign.status = CampaignStatus.PAUSED + campaign.advertisingChannelType = AdvertisingChannelType.SEARCH + + Dim biddingConfig As New BiddingStrategyConfiguration() + biddingConfig.biddingStrategyType = BiddingStrategyType.MANUAL_CPC + campaign.biddingStrategyConfiguration = biddingConfig + + ' Set the campaign budget. + campaign.budget = New Budget + campaign.budget.budgetId = budget.budgetId + + ' Set the campaign network options. + campaign.networkSetting = New NetworkSetting + campaign.networkSetting.targetGoogleSearch = True + campaign.networkSetting.targetSearchNetwork = True + campaign.networkSetting.targetContentNetwork = False + campaign.networkSetting.targetPartnerSearchNetwork = False + + ' Set the campaign geo target and keyword match settings. + Dim geoSetting As New GeoTargetTypeSetting + geoSetting.positiveGeoTargetType = GeoTargetTypeSettingPositiveGeoTargetType.DONT_CARE + geoSetting.negativeGeoTargetType = GeoTargetTypeSettingNegativeGeoTargetType.DONT_CARE + + Dim keywordSetting As New KeywordMatchSetting + keywordSetting.optIn = False + + campaign.settings = New Setting() {geoSetting, keywordSetting} + + ' Optional: Set the start date. + campaign.startDate = DateTime.Now.AddDays(1).ToString("yyyyMMdd") + + ' Optional: Set the end date. + campaign.endDate = DateTime.Now.AddYears(1).ToString("yyyyMMdd") + + ' Optional: Set the campaign ad serving optimization status. + campaign.adServingOptimizationStatus = AdServingOptimizationStatus.ROTATE + + ' Optional: Set the frequency cap. + Dim frequencyCap As New FrequencyCap + frequencyCap.impressions = 5 + frequencyCap.level = Level.ADGROUP + frequencyCap.timeUnit = TimeUnit.DAY + campaign.frequencyCap = frequencyCap + + ' Create the operation. + Dim operation As New CampaignOperation + operation.operator = [Operator].ADD + operation.operand = campaign + operations.Add(operation) + Next + + Try + ' Add the campaign. + Dim retVal As CampaignReturnValue = campaignService.mutate(operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + For Each newCampaign As Campaign In retVal.value + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was added.", _ + newCampaign.name, newCampaign.id) + Next + Else + Console.WriteLine("No campaigns were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add campaigns.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/BasicOperations/AddKeywords.vb b/examples/AdWords/Vb/v201402/BasicOperations/AddKeywords.vb new file mode 100644 index 00000000000..e742c69c901 --- /dev/null +++ b/examples/AdWords/Vb/v201402/BasicOperations/AddKeywords.vb @@ -0,0 +1,129 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example adds a keyword to an ad group. To get ad groups, run + ''' GetAdGroups.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class AddKeywords + Inherits ExampleBase + ''' + ''' Number of items being added / updated in this code example. + ''' + Const NUM_ITEMS As Integer = 5 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddKeywords + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a keyword to an ad group. To get ad groups, run " & _ + "GetAdGroups.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which keywords are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201402.AdGroupCriterionService) + + Dim operations As New List(Of AdGroupCriterionOperation) + + For i As Integer = 1 To NUM_ITEMS + ' Create the keyword. + Dim keyword As New Keyword + keyword.text = "mars cruise" + keyword.matchType = KeywordMatchType.BROAD + + ' Create the biddable ad group criterion. + Dim keywordCriterion As New BiddableAdGroupCriterion + keywordCriterion.adGroupId = adGroupId + keywordCriterion.criterion = keyword + + ' Optional: Set the user status. + keywordCriterion.userStatus = UserStatus.PAUSED + + ' Optional: Set the keyword destination url. + keywordCriterion.destinationUrl = "http://example.com/mars/cruise/" & i + + ' Create the operations. + Dim operation As New AdGroupCriterionOperation + operation.operator = [Operator].ADD + operation.operand = keywordCriterion + + operations.Add(operation) + Next + + Try + ' Create the keywords. + Dim retVal As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing)) Then + For Each adGroupCriterion As AdGroupCriterion In retVal.value + ' If you are adding multiple type of criteria, then you may need to + ' check for + ' + ' if (adGroupCriterion is Keyword) { ... } + ' + ' to identify the criterion type. + Console.WriteLine("Keyword with ad group id = '{0}, keyword id = '{1}, text = " & _ + "'{2}' and match type = '{3}' was created.", adGroupCriterion.adGroupId, _ + adGroupCriterion.criterion.id, TryCast(adGroupCriterion.criterion, Keyword).text, _ + TryCast(adGroupCriterion.criterion, Keyword).matchType) + Next + Else + Console.WriteLine("No keywords were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create keywords.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/BasicOperations/AddTextAds.vb b/examples/AdWords/Vb/v201402/BasicOperations/AddTextAds.vb new file mode 100644 index 00000000000..85391120fe3 --- /dev/null +++ b/examples/AdWords/Vb/v201402/BasicOperations/AddTextAds.vb @@ -0,0 +1,130 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 +Imports Google.Api.Ads.Common.Util + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example adds text ads to a given ad group. To list ad groups, + ''' run GetAdGroups.vb. To learn how to handle policy violations and add + ''' exemption requests, see HandlePolicyViolationError.vb. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class AddTextAds + Inherits ExampleBase + ''' + ''' Number of items being added / updated in this code example. + ''' + Const NUM_ITEMS As Integer = 5 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddTextAds + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds text ads to a given ad group. To list ad groups, run " & _ + "GetAdGroups.vb. To learn how to handle policy violations and add exemption " & _ + "requests, see HandlePolicyViolationError.cs." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which ads are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService( _ + AdWordsService.v201402.AdGroupAdService) + + Dim operations As New List(Of AdGroupAdOperation) + + For i As Integer = 1 To NUM_ITEMS + ' Create the text ad. + Dim textAd As New TextAd + textAd.headline = "Luxury Cruise to Mars" + textAd.description1 = "Visit the Red Planet in style." + textAd.description2 = "Low-gravity fun for everyone!" + textAd.displayUrl = "www.example.com" + textAd.url = "http://www.example.com/" & i + + Dim textAdGroupAd As New AdGroupAd + textAdGroupAd.adGroupId = adGroupId + textAdGroupAd.ad = textAd + + ' Optional: Set the status. + textAdGroupAd.status = AdGroupAdStatus.PAUSED + + ' Create the operations. + Dim operation As New AdGroupAdOperation + operation.operator = [Operator].ADD + operation.operand = textAdGroupAd + + operations.Add(operation) + Next + + Dim retVal As AdGroupAdReturnValue = Nothing + + Try + ' Create the ads. + retVal = service.mutate(operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing)) Then + ' If you are adding multiple type of Ads, then you may need to check + ' for + ' + ' if (adGroupAd.ad is TextAd) { ... } + ' + ' to identify the ad type. + For Each adGroupAd As AdGroupAd In retVal.value + Console.WriteLine("New text ad with id = ""{0}"" and displayUrl = ""{1}"" was " & _ + "created.", adGroupAd.ad.id, adGroupAd.ad.displayUrl) + Next + Else + Console.WriteLine("No text ads were created.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create text ads.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/BasicOperations/DeleteAd.vb b/examples/AdWords/Vb/v201402/BasicOperations/DeleteAd.vb new file mode 100644 index 00000000000..a765c391dbc --- /dev/null +++ b/examples/AdWords/Vb/v201402/BasicOperations/DeleteAd.vb @@ -0,0 +1,105 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example deletes an ad using the 'REMOVE' operator. To list ads, + ''' run GetTextAds.vb. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class DeleteAd + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DeleteAd + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim adId As Long = Long.Parse("INSERT_AD_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, adId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example deletes an ad using the 'REMOVE' operator. To list ads, " & _ + "run GetTextAds.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the ad. + ''' Id of the ad being deleted. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal adId As Long) + ' Get the AdGroupAdService. + Dim adGroupAdService As AdGroupAdService = user.GetService( _ + AdWordsService.v201402.AdGroupAdService) + + ' Since we do not need to update any ad-specific fields, it is enough to + ' create the base type. + Dim ad As New Ad + ad.id = adId + + ' Create the ad group ad. + Dim adGroupAd As New AdGroupAd + adGroupAd.adGroupId = adGroupId + + adGroupAd.ad = ad + + ' Create the operation. + Dim operation As New AdGroupAdOperation + operation.operand = adGroupAd + operation.operator = [Operator].REMOVE + + Try + ' Delete the ad. + Dim retVal As AdGroupAdReturnValue = adGroupAdService.mutate( _ + New AdGroupAdOperation() {operation}) + + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim deletedAdGroupAd As AdGroupAd = retVal.value(0) + Console.WriteLine("Ad with id = ""{0}"" and type = ""{1}"" was deleted.", _ + deletedAdGroupAd.ad.id, deletedAdGroupAd.ad.AdType) + Else + Console.WriteLine("No ads were deleted.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to delete ad.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/BasicOperations/DeleteAdGroup.vb b/examples/AdWords/Vb/v201402/BasicOperations/DeleteAdGroup.vb new file mode 100644 index 00000000000..4f693c365cc --- /dev/null +++ b/examples/AdWords/Vb/v201402/BasicOperations/DeleteAdGroup.vb @@ -0,0 +1,101 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example deletes an ad group by setting the status to 'DELETED'. + ''' To get ad groups, run GetAdGroups.vb. + ''' + ''' Tags: AdGroupService.mutate + ''' + Public Class DeleteAdGroup + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DeleteAdGroup + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example deletes an ad group by setting the status to 'DELETED'. " & _ + "To get ad groups, run GetAdGroups.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to be deleted. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService(AdWordsService.v201402.AdGroupService) + + ' Create ad group with DELETED status. + Dim adGroup As New AdGroup + adGroup.id = adGroupId + + ' When deleting an ad group, rename it to avoid name collisions with new + ' ad groups. + adGroup.name = "Deleted AdGroup - " + ExampleUtilities.GetRandomString + adGroup.status = AdGroupStatus.DELETED + + ' Create the operation. + Dim operation As New AdGroupOperation + operation.operand = adGroup + operation.operator = [Operator].SET + + Try + ' Delete the ad group. + Dim retVal As AdGroupReturnValue = adGroupService.mutate( _ + New AdGroupOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim deletedAdGroup As AdGroup = retVal.value(0) + Console.WriteLine("Ad group with id = ""{0}"" was renamed to ""{1}"" and deleted.", _ + deletedAdGroup.id, deletedAdGroup.name) + Else + Console.WriteLine("No ad groups were deleted.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to delete ad groups.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/BasicOperations/DeleteCampaign.vb b/examples/AdWords/Vb/v201402/BasicOperations/DeleteCampaign.vb new file mode 100644 index 00000000000..0cec143fcfb --- /dev/null +++ b/examples/AdWords/Vb/v201402/BasicOperations/DeleteCampaign.vb @@ -0,0 +1,102 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example deletes a campaign by setting the status to 'DELETED'. + ''' To get campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignService.mutate + ''' + Public Class DeleteCampaign + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DeleteCampaign + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example deletes a campaign by setting the status to 'DELETED'. To " & _ + "get campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to be deleted. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201402.CampaignService) + + ' Create campaign with DELETED status. + Dim campaign As New Campaign + campaign.id = campaignId + + ' When deleting a campaign, rename it to avoid name collisions with new + ' campaigns. + campaign.name = "Deleted Campaign - " + ExampleUtilities.GetRandomString + campaign.status = CampaignStatus.DELETED + + ' Create the operation. + Dim operation As New CampaignOperation + operation.operand = campaign + operation.operator = [Operator].SET + + Try + ' Delete the campaign. + Dim retVal As CampaignReturnValue = campaignService.mutate( _ + New CampaignOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim deletedCampaign As Campaign = retVal.value(0) + Console.WriteLine("Campaign with id = ""{0}"" was renamed to ""{1}"" and deleted.", _ + deletedCampaign.id, deletedCampaign.name) + Else + Console.WriteLine("No campaigns were deleted.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to delete campaigns.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/BasicOperations/DeleteKeyword.vb b/examples/AdWords/Vb/v201402/BasicOperations/DeleteKeyword.vb new file mode 100644 index 00000000000..a3206df6aa3 --- /dev/null +++ b/examples/AdWords/Vb/v201402/BasicOperations/DeleteKeyword.vb @@ -0,0 +1,106 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example deletes a keyword using the 'REMOVE' operator. To get + ''' keywords, run GetKeywords.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class DeleteKeyword + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DeleteKeyword + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim keywordId As Long = Long.Parse("INSERT_KEYWORD_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, keywordId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example deletes a keyword using the 'REMOVE' operator. To get " & _ + "keywords, run GetKeywords.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the keyword. + ''' + ''' Id of the keyword to be deleted. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal keywordId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201402.AdGroupCriterionService) + + ' Create base class criterion to avoid setting keyword-specific + ' fields. + Dim criterion As New Criterion + criterion.id = keywordId + + ' Create the ad group criterion. + Dim adGroupCriterion As New BiddableAdGroupCriterion + adGroupCriterion.adGroupId = adGroupId + adGroupCriterion.criterion = criterion + + ' Create the operation. + Dim operation As New AdGroupCriterionOperation + operation.operand = adGroupCriterion + operation.operator = [Operator].REMOVE + + Try + ' Delete the keyword. + Dim retVal As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + New AdGroupCriterionOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim deletedKeyword As AdGroupCriterion = retVal.value(0) + Console.WriteLine("Keyword with ad group id = ""{0}"" and id = ""{1}"" was " & _ + "deleted.", deletedKeyword.adGroupId, deletedKeyword.criterion.id) + Else + Console.WriteLine("No keywords were deleted.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to delete keywords.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/BasicOperations/GetAdGroups.vb b/examples/AdWords/Vb/v201402/BasicOperations/GetAdGroups.vb new file mode 100644 index 00000000000..c2e4466cf17 --- /dev/null +++ b/examples/AdWords/Vb/v201402/BasicOperations/GetAdGroups.vb @@ -0,0 +1,114 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example illustrates how to retrieve all the ad groups for a + ''' campaign. To create an ad group, run AddAdGroup.vb. + ''' + ''' Tags: AdGroupService.get + ''' + Public Class GetAdGroups + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAdGroups + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to retrieve all the ad groups for a " & _ + "campaign. To create an ad group, run AddAdGroup.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which ad groups are + ''' retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService( _ + AdWordsService.v201402.AdGroupService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "Name"} + + ' Create the filters. + Dim predicate As New Predicate + predicate.field = "CampaignId" + predicate.operator = PredicateOperator.EQUALS + predicate.values = New String() {campaignId.ToString} + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the ad groups. + page = adGroupService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each adGroup As AdGroup In page.entries + Console.WriteLine("{0}) Ad group name is ""{1}"" and id is ""{2}"".", i, _ + adGroup.name, adGroup.id) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of ad groups found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve ad group(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/BasicOperations/GetCampaigns.vb b/examples/AdWords/Vb/v201402/BasicOperations/GetCampaigns.vb new file mode 100644 index 00000000000..6d18af301fe --- /dev/null +++ b/examples/AdWords/Vb/v201402/BasicOperations/GetCampaigns.vb @@ -0,0 +1,103 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example lists all campaigns. To add a campaign, run + ''' AddCampaign.vb. + ''' + ''' Tags: CampaignService.get + ''' + Public Class GetCampaigns + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetCampaigns + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example lists all campaigns. To add a campaign, run AddCampaign.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201402.CampaignService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "Name", "Status"} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New CampaignPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the campaigns. + page = campaignService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each campaign As Campaign In page.entries + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = " & _ + "'{3}' was found.", i, campaign.id, campaign.name, campaign.status) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve campaign(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/BasicOperations/GetCampaignsWithAwql.vb b/examples/AdWords/Vb/v201402/BasicOperations/GetCampaignsWithAwql.vb new file mode 100644 index 00000000000..2b9838ba786 --- /dev/null +++ b/examples/AdWords/Vb/v201402/BasicOperations/GetCampaignsWithAwql.vb @@ -0,0 +1,102 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example lists all campaigns using an AWQL query. See + ''' https://developers.google.com/adwords/api/docs/guides/awql for AWQL + ''' documentation. To add a campaign, run AddCampaign.vb. + ''' + ''' Tags: CampaignService.get + ''' + Public Class GetCampaignsWithAwql + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetCampaignsWithAwql + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example lists all campaigns using an AWQL query. See " & _ + "https://developers.google.com/adwords/api/docs/guides/awql for AWQL " & _ + "documentation. To add a campaign, run AddCampaign.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201402.CampaignService) + + ' Create the query. + Dim query As String = "SELECT Id, Name, Status ORDER BY Name" + + Dim offset As Long = 0 + Dim pageSize As Long = 500 + + Dim page As New CampaignPage() + + Try + Do + Dim queryWithPaging As String = String.Format("{0} LIMIT {1}, {2}", query, offset, _ + pageSize) + + ' Get the campaigns. + page = campaignService.query(queryWithPaging) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each campaign As Campaign In page.entries + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = " & _ + "'{3}' was found.", i, campaign.id, campaign.name, campaign.status) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve campaign(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/BasicOperations/GetKeywords.vb b/examples/AdWords/Vb/v201402/BasicOperations/GetKeywords.vb new file mode 100644 index 00000000000..02e0da0ef1d --- /dev/null +++ b/examples/AdWords/Vb/v201402/BasicOperations/GetKeywords.vb @@ -0,0 +1,128 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example gets all keywords in an account. To add keywords, run + ''' AddKeywords.vb. + ''' + ''' Tags: AdGroupCriterionService.get + ''' + Public Class GetKeywords + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetKeywords + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all keywords in an account. To add keywords, run " & _ + "AddKeywords.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201402.AdGroupCriterionService) + + ' Create a selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "AdGroupId", "KeywordText"} + + ' Select only keywords. + Dim predicate As New Predicate + predicate.field = "CriteriaType" + predicate.operator = PredicateOperator.EQUALS + predicate.values = New String() {"KEYWORD"} + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupCriterionPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the keywords. + page = adGroupCriterionService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each adGroupCriterion As AdGroupCriterion In page.entries + Dim isNegative As Boolean = TypeOf adGroupCriterion Is NegativeAdGroupCriterion + + ' If you are retrieving multiple type of criteria, then you may + ' need to check for + ' + ' if (adGroupCriterion is Keyword) { ... } + ' + ' to identify the criterion type. + Dim keyword As Keyword = adGroupCriterion.criterion + If isNegative Then + Console.WriteLine("{0}) Negative keyword with ad group ID = '{1}', keyword ID " & _ + "= '{2}', and text = '{3}' was found.", i, adGroupCriterion.adGroupId, _ + keyword.id, keyword.text) + Else + Console.WriteLine("{0}) Keyword with ad group ID = '{1}', keyword ID = '{2}', " & _ + "text = '{3}' and matchType = '{4} was found.", i, adGroupCriterion.adGroupId, _ + keyword.id, keyword.text, keyword.matchType) + End If + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of keywords found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve keywords.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/BasicOperations/GetTextAds.vb b/examples/AdWords/Vb/v201402/BasicOperations/GetTextAds.vb new file mode 100644 index 00000000000..e30e707a872 --- /dev/null +++ b/examples/AdWords/Vb/v201402/BasicOperations/GetTextAds.vb @@ -0,0 +1,140 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example retrieves all text ads given an existing ad group. To + ''' add ads to an existing ad group, run AddTextAds.vb. + ''' + ''' Tags: AdGroupAdService.get + ''' + Public Class GetTextAds + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetTextAds + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves all text ads given an existing ad group. To add " & _ + "text ads to an existing ad group, run AddTextAds.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group from which text ads are + ''' retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201402.AdGroupAdService) + + ' Create a selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "Status", "Headline", "Description1", _ + "Description2", "DisplayUrl"} + + ' Set the sort order. + Dim orderBy As New OrderBy + orderBy.field = "Id" + orderBy.sortOrder = SortOrder.ASCENDING + selector.ordering = New OrderBy() {orderBy} + + ' Restrict the fetch to only the selected ad group id. + Dim adGroupPredicate As New Predicate + adGroupPredicate.field = "AdGroupId" + adGroupPredicate.operator = PredicateOperator.EQUALS + adGroupPredicate.values = New String() {adGroupId.ToString} + + ' Retrieve only text ads. + Dim typePredicate As New Predicate + typePredicate.field = "AdType" + typePredicate.operator = PredicateOperator.EQUALS + typePredicate.values = New String() {"TEXT_AD"} + + ' By default disabled ads aren't returned by the selector. To return them + ' include the DISABLED status in the statuses field. + Dim statusPredicate As New Predicate + statusPredicate.field = "Status" + statusPredicate.operator = PredicateOperator.IN + + statusPredicate.values = New String() {AdGroupAdStatus.ENABLED.ToString, _ + AdGroupAdStatus.PAUSED.ToString, AdGroupAdStatus.DISABLED.ToString} + + selector.predicates = New Predicate() {adGroupPredicate, statusPredicate, typePredicate} + + ' Select the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupAdPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the text ads. + page = service.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each adGroupAd As AdGroupAd In page.entries + Dim textAd As TextAd = adGroupAd.ad + Console.WriteLine("{0}) Ad id is {1} and status is {2}", i, textAd.id, _ + adGroupAd.status) + Console.WriteLine(" {0}\n {1}\n {2}\n {3}", textAd.headline, _ + textAd.description1, textAd.description2, textAd.displayUrl) + Next + i += 1 + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of text ads found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get text ads.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/BasicOperations/PauseAd.vb b/examples/AdWords/Vb/v201402/BasicOperations/PauseAd.vb new file mode 100644 index 00000000000..ac42b4aa2b2 --- /dev/null +++ b/examples/AdWords/Vb/v201402/BasicOperations/PauseAd.vb @@ -0,0 +1,102 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example pauses a given ad. To list all ads, run GetTextAds.cs. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class PauseAd + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New PauseAd + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim adId As Long = Long.Parse("INSERT_AD_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, adId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example pauses a given ad. To list all ads, run GetTextAds.cs." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the ad. + ''' + ''' Id of the ad to be paused. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal adId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201402.AdGroupAdService) + + Dim status As AdGroupAdStatus = AdGroupAdStatus.PAUSED + + ' Create the ad group ad. + Dim adGroupAd As New AdGroupAd + adGroupAd.status = status + adGroupAd.adGroupId = adGroupId + + adGroupAd.ad = New Ad + adGroupAd.ad.id = adId + + ' Create the operation. + Dim adGroupAdOperation As New AdGroupAdOperation + adGroupAdOperation.operator = [Operator].SET + adGroupAdOperation.operand = adGroupAd + + Try + ' Update the ad. + Dim retVal As AdGroupAdReturnValue = service.mutate( _ + New AdGroupAdOperation() {adGroupAdOperation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim pausedAdGroupAd As AdGroupAd = retVal.value(0) + Console.WriteLine("Ad with id ""{0}"" was paused.", pausedAdGroupAd.ad.id) + Else + Console.WriteLine("No ads were paused.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to pause ad.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/BasicOperations/UpdateAdGroup.vb b/examples/AdWords/Vb/v201402/BasicOperations/UpdateAdGroup.vb new file mode 100644 index 00000000000..9cc52cc7bc6 --- /dev/null +++ b/examples/AdWords/Vb/v201402/BasicOperations/UpdateAdGroup.vb @@ -0,0 +1,96 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example illustrates how to update an ad group, setting its + ''' status to 'PAUSED'. To create an ad group, run AddAdGroup.vb. + ''' + ''' Tags: AdGroupService.mutate + ''' + Public Class UpdateAdGroup + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UpdateAdGroup + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to update an ad group, setting its status " & _ + "to 'PAUSED'. To create an ad group, run AddAdGroup.vb" + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to be updated. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService(AdWordsService.v201402.AdGroupService) + + ' Create the ad group. + Dim adGroup As New AdGroup + adGroup.status = AdGroupStatus.PAUSED + adGroup.id = adGroupId + + ' Create the operation. + Dim operation As New AdGroupOperation + operation.operator = [Operator].SET + operation.operand = adGroup + + Try + ' Update the ad group. + Dim retVal As AdGroupReturnValue = adGroupService.mutate(New AdGroupOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim pausedAdGroup As AdGroup = retVal.value(0) + Console.WriteLine("Ad group with id = '{0}' was successfully updated.", _ + pausedAdGroup.id) + Else + Console.WriteLine("No ad groups were updated.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to update ad groups.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/BasicOperations/UpdateCampaign.vb b/examples/AdWords/Vb/v201402/BasicOperations/UpdateCampaign.vb new file mode 100644 index 00000000000..1d590e63bc2 --- /dev/null +++ b/examples/AdWords/Vb/v201402/BasicOperations/UpdateCampaign.vb @@ -0,0 +1,97 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example updates a campaign. To get campaigns, run + ''' GetCampaigns.vb. + ''' + ''' Tags: CampaignService.mutate + ''' + Public Class UpdateCampaign + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UpdateCampaign + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example updates a campaign. To get campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to be updated. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201402.CampaignService) + + ' Create campaign with updated budget. + Dim campaign As New Campaign + campaign.id = campaignId + campaign.status = CampaignStatus.PAUSED + + ' Create the operations. + Dim operation As New CampaignOperation + operation.operator = [Operator].SET + operation.operand = campaign + + Try + ' Update the campaign. + Dim retVal As CampaignReturnValue = campaignService.mutate( _ + New CampaignOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim updatedCampaign As Campaign = retVal.value(0) + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was updated.", _ + updatedCampaign.name, updatedCampaign.id) + Else + Console.WriteLine("No campaigns were updated.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to update campaigns.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/BasicOperations/UpdateKeyword.vb b/examples/AdWords/Vb/v201402/BasicOperations/UpdateKeyword.vb new file mode 100644 index 00000000000..c22f3cd0947 --- /dev/null +++ b/examples/AdWords/Vb/v201402/BasicOperations/UpdateKeyword.vb @@ -0,0 +1,122 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example updates the bid of a keyword. To get keyword, run + ''' GetKeywords.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class UpdateKeyword + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UpdateKeyword + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim keywordId As Long = Long.Parse("INSERT_KEYWORD_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, keywordId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example updates the bid of a keyword. To get keyword, run GetKeywords.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the keyword. + ''' + ''' Id of the keyword to be updated. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal keywordId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201402.AdGroupCriterionService) + + ' Since we are not updating any keyword-specific fields, it is enough to + ' create a criterion object. + Dim criterion As New Criterion + criterion.id = keywordId + + ' Create ad group criterion. + Dim biddableAdGroupCriterion As New BiddableAdGroupCriterion + biddableAdGroupCriterion.adGroupId = adGroupId + biddableAdGroupCriterion.criterion = criterion + + ' Create the bids. + Dim biddingConfig As New BiddingStrategyConfiguration() + Dim cpcBid As New CpcBid() + cpcBid.bid = New Money() + cpcBid.bid.microAmount = 1000000 + biddingConfig.bids = New Bids() {cpcBid} + + biddableAdGroupCriterion.biddingStrategyConfiguration = biddingConfig + + ' Create the operation. + Dim operation As New AdGroupCriterionOperation + operation.operator = [Operator].SET + operation.operand = biddableAdGroupCriterion + + Try + ' Update the keyword. + Dim retVal As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + New AdGroupCriterionOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim adGroupCriterion As BiddableAdGroupCriterion = retVal.value(0) + Dim bidAmount As Long = 0L + For Each bids As Bids In adGroupCriterion.biddingStrategyConfiguration.bids + If TypeOf bids Is CpcBid Then + bidAmount = TryCast(bids, CpcBid).bid.microAmount + End If + Next + + Console.WriteLine("Keyword with ad group id = '{0}', id = '{1}' was updated with " & _ + "bid amount = '{2}' micros.", adGroupCriterion.adGroupId, _ + adGroupCriterion.criterion.id, bidAmount) + Else + Console.WriteLine("No keyword was updated.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to update keyword.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/CampaignManagement/AddExperiment.vb b/examples/AdWords/Vb/v201402/CampaignManagement/AddExperiment.vb new file mode 100644 index 00000000000..544d796ad62 --- /dev/null +++ b/examples/AdWords/Vb/v201402/CampaignManagement/AddExperiment.vb @@ -0,0 +1,216 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example creates an experiment using a query percentage of 10, + ''' which defines what fraction of auctions should go to the control split + ''' (90%) vs. the experiment split (10%), then adds experimental bid changes + ''' for criteria and ad groups. To get campaigns, run GetCampaigns.vb. + ''' To get ad groups, run GetAdGroups.vb. To get criteria, run + ''' GetKeywords.vb. + ''' + ''' Tags: ExperimentService.mutate + ''' + Public Class AddExperiment + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddExperiment + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim criterionId As Long = Long.Parse("INSERT_CRITERION_ID_HERE") + + codeExample.Run(New AdWordsUser, campaignId, adGroupId, criterionId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example creates an experiment using a query percentage of 10, which " & _ + "defines what fraction of auctions should go to the control split (90%) vs. the " & _ + "experiment split (10%), then adds experimental bid changes for criteria and ad " & _ + "groups. To get campaigns, run GetCampaigns.vb. To get ad groups, run " & _ + "GetAdGroups.vb. To get criteria, run GetKeywords.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to which experiments are + ''' added. + ''' Id of the ad group to which experiments are + ''' added. + ''' Id of the criterion for which experiments + ''' are added. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long, ByVal adGroupId As Long, _ + ByVal criterionId As Long) + ' Get the ExperimentService. + Dim experimentService As ExperimentService = user.GetService( _ + AdWordsService.v201402.ExperimentService) + + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService(AdWordsService.v201402.AdGroupService) + + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201402.AdGroupCriterionService) + + ' Create the experiment. + Dim experiment As New Experiment + experiment.campaignId = campaignId + experiment.name = ("Interplanetary Cruise #" & ExampleUtilities.GetRandomString) + experiment.queryPercentage = 10 + experiment.startDateTime = DateTime.Now.AddDays(1).ToString("yyyyMMdd HHmmss") + + ' Optional: Set the end date. + experiment.endDateTime = DateTime.Now.AddDays(30).ToString("yyyyMMdd HHmmss") + + ' Optional: Set the status. + experiment.status = ExperimentStatus.ACTIVE + + ' Create the operation. + Dim experimentOperation As New ExperimentOperation + experimentOperation.operator = [Operator].ADD + experimentOperation.operand = experiment + + Try + ' Add the experiment. + Dim experimentRetVal As ExperimentReturnValue = experimentService.mutate( _ + New ExperimentOperation() {experimentOperation}) + + 'Display the results. + If ((Not experimentRetVal Is Nothing) AndAlso (Not experimentRetVal.value Is Nothing) _ + AndAlso (experimentRetVal.value.Length > 0)) Then + Dim experimentId As Long = 0 + + Dim newExperiment As Experiment = experimentRetVal.value(0) + + Console.WriteLine("Experiment with name = ""{0}"" and id = ""{1}"" was added.", _ + newExperiment.name, newExperiment.id) + experimentId = newExperiment.id + + ' Set ad group for the experiment. + Dim adGroup As New AdGroup + adGroup.id = adGroupId + + ' Create experiment bid multiplier rule that will modify ad group bid + ' for the experiment. + Dim adGroupBidMultiplier As New ManualCPCAdGroupExperimentBidMultipliers + adGroupBidMultiplier.maxCpcMultiplier = New BidMultiplier + adGroupBidMultiplier.maxCpcMultiplier.multiplier = 1.5 + + ' Set experiment data to the ad group. + Dim adGroupExperimentData As New AdGroupExperimentData + adGroupExperimentData.experimentId = experimentId + adGroupExperimentData.experimentDeltaStatus = ExperimentDeltaStatus.MODIFIED + adGroupExperimentData.experimentBidMultipliers = adGroupBidMultiplier + + adGroup.experimentData = adGroupExperimentData + + ' Create the operation. + Dim adGroupOperation As New AdGroupOperation + adGroupOperation.operand = adGroup + adGroupOperation.operator = [Operator].SET + + ' Update the ad group. + Dim adGroupRetVal As AdGroupReturnValue = adGroupService.mutate( _ + New AdGroupOperation() {adGroupOperation}) + + ' Display the results. + If ((Not adGroupRetVal Is Nothing) AndAlso (Not adGroupRetVal.value Is Nothing) _ + AndAlso (adGroupRetVal.value.Length > 0)) Then + Dim updatedAdGroup As AdGroup = adGroupRetVal.value(0) + Console.WriteLine("Ad group with name = ""{0}"", id = ""{1}"" and status = " & _ + """{2}"" was updated for the experiment.", updatedAdGroup.name, _ + updatedAdGroup.id, updatedAdGroup.status) + Else + Console.WriteLine("No ad groups were updated.") + End If + + ' Set ad group criteria for the experiment. + Dim criterion As New Criterion + criterion.id = criterionId + + Dim adGroupCriterion As New BiddableAdGroupCriterion + adGroupCriterion.adGroupId = adGroupId + adGroupCriterion.criterion = criterion + + ' Create experiment bid multiplier rule that will modify criterion bid + ' for the experiment. + Dim bidMultiplier As New ManualCPCAdGroupCriterionExperimentBidMultiplier + bidMultiplier.maxCpcMultiplier = New BidMultiplier + bidMultiplier.maxCpcMultiplier.multiplier = 1.5 + + ' Set experiment data to the criterion. + Dim adGroupCriterionExperimentData As New BiddableAdGroupCriterionExperimentData + adGroupCriterionExperimentData.experimentId = experimentId + adGroupCriterionExperimentData.experimentDeltaStatus = ExperimentDeltaStatus.MODIFIED + adGroupCriterionExperimentData.experimentBidMultiplier = bidMultiplier + + adGroupCriterion.experimentData = adGroupCriterionExperimentData + + ' Create the operation. + Dim adGroupCriterionOperation As New AdGroupCriterionOperation + adGroupCriterionOperation.operand = adGroupCriterion + adGroupCriterionOperation.operator = [Operator].SET + + ' Update the ad group criteria. + Dim adGroupCriterionRetVal As AdGroupCriterionReturnValue = _ + adGroupCriterionService.mutate(New AdGroupCriterionOperation() _ + {adGroupCriterionOperation}) + + ' Display the results. + If ((Not adGroupCriterionRetVal Is Nothing) AndAlso _ + (Not adGroupCriterionRetVal.value Is Nothing) AndAlso _ + (adGroupCriterionRetVal.value.Length > 0)) Then + Dim updatedAdGroupCriterion As AdGroupCriterion = adGroupCriterionRetVal.value(0) + Console.WriteLine("Ad group criterion with ad group id = ""{0}"", criterion id =" & _ + " ""{1}"" and type = ""{2}"" was updated for the experiment.", _ + updatedAdGroupCriterion.adGroupId, updatedAdGroupCriterion.criterion.id, _ + updatedAdGroupCriterion.criterion.CriterionType) + Else + Console.WriteLine("No ad group criteria were updated.") + End If + Else + Console.WriteLine("No experiments were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add experiment(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/CampaignManagement/AddKeywordsInBulk.vb b/examples/AdWords/Vb/v201402/CampaignManagement/AddKeywordsInBulk.vb new file mode 100644 index 00000000000..4dee09f89a3 --- /dev/null +++ b/examples/AdWords/Vb/v201402/CampaignManagement/AddKeywordsInBulk.vb @@ -0,0 +1,186 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Text.RegularExpressions +Imports System.Threading + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example shows how to add keywords in bulk using the + ''' MutateJobService. + ''' + ''' Tags: MutateJobService.mutate, MutateJobService.get + ''' Tags: MutateJobService.getResult + ''' + Public Class AddKeywordsInBulk + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddKeywordsInBulk + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example shows how to add keywords in bulk using the MutateJobService." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad groups to which keywords are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the MutateJobService. + Dim mutateJobService As MutateJobService = user.GetService( _ + AdWordsService.v201402.MutateJobService) + + Const RETRY_INTERVAL As Integer = 30 + Const RETRIES_COUNT As Integer = 30 + Const KEYWORD_NUMBER As Integer = 100 + Const INDEX_REGEX As String = "operations\[(\d+)\].operand" + + Dim operations As New List(Of Operation) + + ' Create AdGroupCriterionOperation to add keywords. + For i As Integer = 0 To KEYWORD_NUMBER + Dim keyword As New Keyword + keyword.text = String.Format("mars cruise {0}", i) + keyword.matchType = KeywordMatchType.BROAD + + Dim criterion As New BiddableAdGroupCriterion + criterion.adGroupId = adGroupId + criterion.criterion = keyword + + Dim adGroupCriterionOperation As New AdGroupCriterionOperation + adGroupCriterionOperation.operator = [Operator].ADD + adGroupCriterionOperation.operand = criterion + + operations.Add(adGroupCriterionOperation) + Next i + + Dim policy As New BulkMutateJobPolicy + ' You can specify up to 3 job IDs that must successfully complete before + ' this job can be processed. + policy.prerequisiteJobIds = New Long() {} + + Dim job As SimpleMutateJob = mutateJobService.mutate(operations.ToArray, policy) + + ' Wait for the job to complete. + Dim completed As Boolean = False + Dim retryCount As Integer = 0 + Console.WriteLine("Retrieving job status...") + + While (completed = False AndAlso retryCount < RETRIES_COUNT) + Dim selector As New BulkMutateJobSelector + selector.jobIds = New Long() {job.id} + + Try + Dim allJobs As Job() = mutateJobService.get(selector) + If ((Not allJobs Is Nothing) AndAlso (allJobs.Length > 0)) Then + job = allJobs(0) + If ((job.status = BasicJobStatus.COMPLETED) OrElse _ + (job.status = BasicJobStatus.FAILED)) Then + completed = True + Exit While + Else + Console.WriteLine("{0}: Current status is {1}, waiting {2} seconds to retry...", _ + retryCount, job.status, RETRY_INTERVAL) + Thread.Sleep(RETRY_INTERVAL * 1000) + retryCount = retryCount + 1 + End If + End If + Catch ex As Exception + Throw New System.ApplicationException(String.Format("Failed to fetch simple mutate " & _ + "job with id = {0}.", job.id), ex) + Return + End Try + End While + + If (job.status = BasicJobStatus.COMPLETED) Then + ' Handle cases where the job completed. + + ' Create the job selector. + Dim selector As New BulkMutateJobSelector + selector.jobIds = New Long() {job.id} + + ' Get the job results. + Dim jobResult As JobResult = mutateJobService.getResult(selector) + If Not jobResult Is Nothing Then + Dim results As SimpleMutateResult = jobResult.Item + If Not results Is Nothing Then + 'Display the results. + If Not results.results Is Nothing Then + For i As Integer = 0 To results.results.Length - 1 + Dim operand As Operand = results.results(i) + Dim status As String + If TypeOf operand.Item Is PlaceHolder Then + status = "FAILED" + Else + status = "SUCCEEDED" + End If + Console.WriteLine("Operation {0} - {1}", i, status) + Next i + End If + + ' Display the errors. + If Not results.errors Is Nothing Then + For Each apiError As ApiError In results.errors + Dim match As Match = Regex.Match(apiError.fieldPath, INDEX_REGEX, _ + RegexOptions.IgnoreCase) + Dim index As String = "???" + If (match.Success) Then + index = match.Groups(1).Value + End If + Console.WriteLine("Operation index {0} failed due to reason: '{1}', " & _ + "trigger: '{2}'", index, apiError.errorString, apiError.trigger) + Next + End If + End If + End If + Console.WriteLine("Job completed successfully!") + ElseIf (job.status = BasicJobStatus.FAILED) Then + ' Handle the cases where job failed. + Console.WriteLine("Job failed with reason: " & job.failureReason.ToString()) + ElseIf (job.status = BasicJobStatus.PROCESSING OrElse job.status = BasicJobStatus.PENDING) _ + Then + ' Handle the cases where job didn't complete after wait period. + Console.WriteLine("Job did not complete in {0} secconds.", RETRY_INTERVAL * RETRIES_COUNT) + End If + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/CampaignManagement/AddLocationExtension.vb b/examples/AdWords/Vb/v201402/CampaignManagement/AddLocationExtension.vb new file mode 100644 index 00000000000..81603c62dc7 --- /dev/null +++ b/examples/AdWords/Vb/v201402/CampaignManagement/AddLocationExtension.vb @@ -0,0 +1,150 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example shows how to add a location extension to an existing + ''' campaign. To create a campaign, run AddCampaign.vb. + ''' + ''' Tags: GeoLocationService.get, CampaignAdExtensionService.mutate + ''' + Public Class AddLocationExtension + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddLocationExtension + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example shows how to add a location extension to an existing" & _ + " campaign. To create a campaign, run AddCampaign.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to which location + ''' extensions are added. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignAdExtensionService. + Dim campaignExtensionService As CampaignAdExtensionService = user.GetService( _ + AdWordsService.v201402.CampaignAdExtensionService) + + ' Add location 1: 1600 Amphitheatre Pkwy, Mountain View, US. + Dim address1 As New Address + address1.streetAddress = "1600 Amphitheatre Parkway" + address1.cityName = "Mountain View" + address1.provinceCode = "CA" + address1.postalCode = "94043" + address1.countryCode = "US" + + ' Add location 2: 38 avenue de l'Opéra, 75002 Paris, FR. + Dim address2 As New Address + address2.streetAddress = "38 avenue de l'Opéra" + address2.cityName = "Paris" + address2.postalCode = "75002" + address2.countryCode = "FR" + + ' Get the GeoLocationService. + Dim geoService As GeoLocationService = user.GetService( _ + AdWordsService.v201402.GeoLocationService) + + ' Create the selector. + Dim selector As New GeoLocationSelector + selector.addresses = New Address() {address1, address2} + + ' Retrieve the locations. + Dim locations As GeoLocation() = geoService.get(selector) + + Dim operations As New List(Of CampaignAdExtensionOperation) + + ' Phone numbers for US and FR offices. + Dim phoneNumbers As String() = New String() {"(650) 253-0000", "(0)1 42 68 53 00"} + Dim index As Integer = 0 + + ' Create a location extension for each geo location returned by the + ' server. + For Each location As GeoLocation In locations + Dim locationExtension As New LocationExtension + locationExtension.address = location.address + locationExtension.geoPoint = location.geoPoint + locationExtension.encodedLocation = location.encodedLocation + locationExtension.source = LocationExtensionSource.ADWORDS_FRONTEND + + ' Optional: Set the company name. + locationExtension.companyName = "ACME Inc." + + ' Optional: Set the phone number. + locationExtension.phoneNumber = phoneNumbers(index) + index = index + 1 + + Dim extension As New CampaignAdExtension + extension.campaignId = campaignId + extension.status = CampaignAdExtensionStatus.ACTIVE + extension.adExtension = locationExtension + + Dim operation As New CampaignAdExtensionOperation + operation.operator = [Operator].ADD + operation.operand = extension + + operations.Add(operation) + Next + + Try + ' Create the location extensions. + Dim retVal As CampaignAdExtensionReturnValue = campaignExtensionService.mutate( _ + operations.ToArray) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + For Each campaignExtension As CampaignAdExtension In retVal.value + Console.WriteLine("Created a location extension with id = ""{0}"" and status " & _ + "= ""{1}""", campaignExtension.adExtension.id, campaignExtension.status) + Next + Else + Console.WriteLine("No location extensions were created.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add location extensions.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/CampaignManagement/GetAllDisapprovedAds.vb b/examples/AdWords/Vb/v201402/CampaignManagement/GetAllDisapprovedAds.vb new file mode 100644 index 00000000000..7c21dbc2b68 --- /dev/null +++ b/examples/AdWords/Vb/v201402/CampaignManagement/GetAllDisapprovedAds.vb @@ -0,0 +1,121 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example retrieves all the disapproved ads in a given campaign. + ''' + ''' Tags: AdGroupAdService.get + ''' + Public Class GetAllDisapprovedAds + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAllDisapprovedAds + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves all the disapproved ads in a given campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which disapproved ads + ''' are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201402.AdGroupAdService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "AdGroupCreativeApprovalStatus", _ + "AdGroupAdDisapprovalReasons"} + + ' Set the filters. + Dim campaignPredicate As New Predicate + campaignPredicate.operator = PredicateOperator.EQUALS + campaignPredicate.field = "CampaignId" + campaignPredicate.values = New String() {campaignId.ToString} + + Dim approvalPredicate As New Predicate + approvalPredicate.operator = PredicateOperator.EQUALS + approvalPredicate.field = "AdGroupCreativeApprovalStatus" + approvalPredicate.values = New String() {AdGroupAdApprovalStatus.DISAPPROVED.ToString()} + + selector.predicates = New Predicate() {campaignPredicate, approvalPredicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupAdPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the disapproved ads. + page = service.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each adGroupAd As AdGroupAd In page.entries + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " & _ + "reason(s):", i, adGroupAd.ad.id) + For Each reason As String In adGroupAd.disapprovalReasons + Console.WriteLine(" {0}", reason) + Next + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get disapproved ads.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb b/examples/AdWords/Vb/v201402/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb new file mode 100644 index 00000000000..7efa20cc336 --- /dev/null +++ b/examples/AdWords/Vb/v201402/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb @@ -0,0 +1,111 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example retrieves all the disapproved ads in a given campaign + ''' using an AWQL query. See + ''' https://developers.google.com/adwords/api/docs/guides/awql for AWQL + ''' documentation. + ''' + ''' Tags: AdGroupAdService.get + ''' + Public Class GetAllDisapprovedAdsWithAwql + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAllDisapprovedAdsWithAwql + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves all the disapproved ads in a given campaign using " & _ + "an AWQL query. See https://developers.google.com/adwords/api/docs/guides/awql for " & _ + "AWQL documentation." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which disapproved ads + ''' are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201402.AdGroupAdService) + + ' Get all the disapproved ads for this campaign. + Dim query As String = String.Format("SELECT Id, AdGroupAdDisapprovalReasons WHERE " & _ + "CampaignId = {0} AND AdGroupCreativeApprovalStatus = DISAPPROVED ORDER BY Id", _ + campaignId) + + Dim offset As Long = 0 + Dim pageSize As Long = 500 + + Dim page As New AdGroupAdPage() + + Try + Do + Dim queryWithPaging As String = String.Format("{0} LIMIT {1}, {2}", query, offset, _ + pageSize) + + ' Get the disapproved ads. + page = service.query(queryWithPaging) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each adGroupAd As AdGroupAd In page.entries + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " & _ + "reason(s):", i, adGroupAd.ad.id) + For Each reason As String In adGroupAd.disapprovalReasons + Console.WriteLine(" {0}", reason) + Next + i = i + 1 + Next + End If + + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get disapproved ads.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/CampaignManagement/PromoteExperiment.vb b/examples/AdWords/Vb/v201402/CampaignManagement/PromoteExperiment.vb new file mode 100644 index 00000000000..c6d2127b4f0 --- /dev/null +++ b/examples/AdWords/Vb/v201402/CampaignManagement/PromoteExperiment.vb @@ -0,0 +1,100 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This example promotes an experiment, which permanently applies all the + ''' experiment changes made to its related ad groups, criteria and ads. To + ''' create an experiment, run AddExperiment.vb. + ''' + ''' Tags: ExperimentService.mutate + ''' + Public Class PromoteExperiment + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New PromoteExperiment + Console.WriteLine(codeExample.Description) + Try + Dim experimentId As Long = Long.Parse("INSERT_EXPERIMENT_ID_HERE") + codeExample.Run(New AdWordsUser, experimentId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This example promotes an experiment, which permanently applies all the " & _ + "experiment changes made to its related ad groups, criteria and ads. To create an " & _ + "experiment, run AddExperiment.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the experiment to be promoted. + Public Sub Run(ByVal user As AdWordsUser, ByVal experimentId As Long) + ' Get the ExperimentService. + Dim experimentService As ExperimentService = user.GetService( _ + AdWordsService.v201402.ExperimentService) + + ' Set experiment's status to PROMOTED. + Dim experiment As New Experiment + experiment.id = experimentId + experiment.status = ExperimentStatus.PROMOTED + + ' Create the operation. + Dim operation As New ExperimentOperation + operation.operator = [Operator].SET + operation.operand = experiment + + Try + ' Update the experiment. + Dim retVal As ExperimentReturnValue = experimentService.mutate( _ + New ExperimentOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim promotedExperiment As Experiment = retVal.value(0) + Console.WriteLine("Experiment with name = ""{0}"" and id = ""{1}"" was promoted.", _ + promotedExperiment.name, promotedExperiment.id) + Else + Console.WriteLine("No experiments were promoted.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to promote experiment(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/CampaignManagement/SetAdParameters.vb b/examples/AdWords/Vb/v201402/CampaignManagement/SetAdParameters.vb new file mode 100644 index 00000000000..fab1dc4df9c --- /dev/null +++ b/examples/AdWords/Vb/v201402/CampaignManagement/SetAdParameters.vb @@ -0,0 +1,155 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example illustrates how to create a text ad with ad parameters. + ''' To add an ad group, run AddAdGroup.vb. To add a keyword, run + ''' AddKeyword.vb. + ''' + ''' Tags: AdGroupAdService.mutate, AdParamService.mutate + ''' + Public Class SetAdParameters + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New SetAdParameters + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim criterionId As Long = Long.Parse("INSERT_CRITERION_ID_HERE") + + codeExample.Run(New AdWordsUser, adGroupId, criterionId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to create a text ad with ad parameters. To " & _ + "add an ad group, run AddAdGroup.vb. To add a keyword, run AddKeyword.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the criterion. + ''' + ''' Id of the keyword for which the ad + ''' parameters are set. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal criterionId As Long) + ' Get the AdGroupAdService. + Dim adGroupAdService As AdGroupAdService = user.GetService( _ + AdWordsService.v201402.AdGroupAdService) + + ' Get the AdParamService. + Dim adParamService As AdParamService = user.GetService( _ + AdWordsService.v201402.AdParamService) + + ' Create the text ad. + Dim textAd As New TextAd + textAd.url = "http://www.example.com" + textAd.displayUrl = "example.com" + textAd.headline = " Mars Cruises" + textAd.description1 = "Low-gravity fun for {param1:cheap}." + textAd.description2 = "Only {param2:a few} seats left!" + + Dim adOperand As New AdGroupAd + adOperand.adGroupId = adGroupId + adOperand.status = AdGroupAdStatus.ENABLED + adOperand.ad = textAd + + ' Create the operation. + Dim adOperation As New AdGroupAdOperation + adOperation.operand = adOperand + adOperation.operator = [Operator].ADD + + Try + ' Create the text ad. + Dim retVal As AdGroupAdReturnValue = adGroupAdService.mutate( _ + New AdGroupAdOperation() {adOperation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) _ + AndAlso (retVal.value.Length > 0)) Then + Console.WriteLine("Text ad with id = ""{0}"" was successfully added.", _ + retVal.value(0).ad.id) + Else + Console.WriteLine("No text ads were created.") + Return + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create text ads.", ex) + Return + End Try + + ' Create the ad param for price. + Dim priceParam As New AdParam + priceParam.adGroupId = adGroupId + priceParam.criterionId = criterionId + priceParam.paramIndex = 1 + priceParam.insertionText = "$100" + + ' Create the ad param for seats. + Dim seatParam As New AdParam + seatParam.adGroupId = adGroupId + seatParam.criterionId = criterionId + seatParam.paramIndex = 2 + seatParam.insertionText = "50" + + ' Create the operations. + Dim priceOperation As New AdParamOperation + priceOperation.operator = [Operator].SET + priceOperation.operand = priceParam + + Dim seatOperation As New AdParamOperation + seatOperation.operator = [Operator].SET + seatOperation.operand = seatParam + + Try + ' Set the ad parameters. + Dim newAdParams As AdParam() = adParamService.mutate(New AdParamOperation() _ + {priceOperation, seatOperation}) + + 'Display the results. + If (Not newAdParams Is Nothing) Then + Console.WriteLine("Ad parameters were successfully updated.") + Else + Console.WriteLine("No ad parameters were set.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to set ad parameter(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/CampaignManagement/SetBidModifier.vb b/examples/AdWords/Vb/v201402/CampaignManagement/SetBidModifier.vb new file mode 100644 index 00000000000..fdfaec70684 --- /dev/null +++ b/examples/AdWords/Vb/v201402/CampaignManagement/SetBidModifier.vb @@ -0,0 +1,112 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example sets a bid modifier for the mobile platform on given + ''' campaign. The campaign must be an enhanced type of campaign. To get + ''' campaigns, run GetCampaigns.vb. To enhance a campaign, run + ''' SetCampaignEnhanced.vb. + ''' + ''' Tags: CampaignCriterionService.mutate + ''' + Public Class SetBidModifier + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New SetBidModifier + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + Dim bidModifier As Double = Double.Parse("INSERT_BID_MODIFIER_HERE") + codeExample.Run(New AdWordsUser, campaignId, bidModifier) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example sets a bid modifier for the mobile platform on given " & _ + "campaign. The campaign must be an enhanced type of campaign. To get campaigns, " & _ + "run GetCampaigns.vb. To enhance a campaign, run SetCampaignEnhanced.vb." + End Get + End Property + + ''' + ''' Runs the specified user. + ''' + ''' The AdWords user. + ''' Id of the campaign whose bid should be modified. + ''' + ''' The bid modifier. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long, ByVal bidModifier As Double) + ' Get the CampaignCriterionService. + Dim campaignCriterionService As CampaignCriterionService = user.GetService( _ + AdWordsService.v201402.CampaignCriterionService) + + ' Create mobile platform. The ID can be found in the documentation. + ' https://developers.google.com/adwords/api/docs/appendix/platforms + Dim mobile As New Platform() + mobile.id = 30001 + + ' Create criterion with modified bid. + Dim criterion As New CampaignCriterion() + criterion.campaignId = campaignId + criterion.criterion = mobile + criterion.bidModifier = bidModifier + + ' Create SET operation. + Dim operation As New CampaignCriterionOperation() + operation.operator = [Operator].SET + operation.operand = criterion + + Try + ' Update campaign criteria. + Dim result As CampaignCriterionReturnValue = campaignCriterionService.mutate( _ + New CampaignCriterionOperation() {operation}) + + ' Display campaign criteria. + If Not result.value Is Nothing Then + For Each newCriterion As CampaignCriterion In result.value + Console.WriteLine("Campaign criterion with campaign id '{0}', criterion id '{1}' " & _ + "and type '{2}' was modified with bid {3:F2}.", newCriterion.campaignId, _ + newCriterion.criterion.id, newCriterion.criterion.type, newCriterion.bidModifier) + Next + Else + Console.WriteLine("No campaigns were modified.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to set bid modifier.", ex) + End Try + End Sub + End Class +End Namespace \ No newline at end of file diff --git a/examples/AdWords/Vb/v201402/CampaignManagement/ValidateTextAd.vb b/examples/AdWords/Vb/v201402/CampaignManagement/ValidateTextAd.vb new file mode 100644 index 00000000000..c3d67c0eff7 --- /dev/null +++ b/examples/AdWords/Vb/v201402/CampaignManagement/ValidateTextAd.vb @@ -0,0 +1,110 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example shows how to use the validateOnly header to validate + ''' a text ad. No objects will be created, but exceptions will still be + ''' thrown. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class ValidateTextAd + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New ValidateTextAd + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example shows how to use the validateOnly header to validate a text " & _ + "ad. No objects will be created, but exceptions will still be thrown." + End Get + End Property + + ''' + ''' Runs the specified user. + ''' + ''' The AdWords user. + ''' Id of the ad group to which text ads are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim adGroupAdService As AdGroupAdService = user.GetService( _ + AdWordsService.v201402.AdGroupAdService) + + ' Set the validateOnly headers. + adGroupAdService.RequestHeader.validateOnly = True + + ' Create your text ad. + Dim textAd As New TextAd + textAd.headline = "Luxury Cruise to Mars" + textAd.description1 = "Visit the Red Planet in style." + textAd.description2 = "Low-gravity fun for everyone!!" + textAd.displayUrl = "www.example.com" + textAd.url = "http://www.example.com" + + Dim textAdGroupAd As New AdGroupAd + textAdGroupAd.adGroupId = adGroupId + textAdGroupAd.ad = textAd + + Dim textAdOperation As New AdGroupAdOperation + textAdOperation.operator = [Operator].ADD + textAdOperation.operand = textAdGroupAd + Try + Dim retVal As AdGroupAdReturnValue = adGroupAdService.mutate( _ + New AdGroupAdOperation() {textAdOperation}) + ' Since validation is ON, result will be null. + Console.WriteLine("text ad validated successfully.") + Catch ex As AdWordsApiException + ' This block will be hit if there is a validation error from the server. + Console.WriteLine("There were validation error(s) while adding text ad.") + + If (Not ex.ApiException Is Nothing) Then + For Each apiError As ApiError In DirectCast(ex.ApiException, ApiException).errors + Console.WriteLine(" Error type is '{0}' and fieldPath is '{1}'.", _ + apiError.ApiErrorType, apiError.fieldPath) + Next + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to validate text ad.", ex) + End Try + End Sub + End Class +End Namespace \ No newline at end of file diff --git a/examples/AdWords/Vb/v201402/ErrorHandling/HandlePartialFailures.vb b/examples/AdWords/Vb/v201402/ErrorHandling/HandlePartialFailures.vb new file mode 100644 index 00000000000..3cc56a36db8 --- /dev/null +++ b/examples/AdWords/Vb/v201402/ErrorHandling/HandlePartialFailures.vb @@ -0,0 +1,137 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example demonstrates how to handle partial failures. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class HandlePartialFailures + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandlePartialFailures + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example demonstrates how to handle partial failures." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which keywords are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201402.AdGroupCriterionService) + + ' Set partial failure mode for the service. + adGroupCriterionService.RequestHeader.partialFailure = True + + Dim operations As New List(Of AdGroupCriterionOperation) + + ' Create the keywords. + Dim keywords As String() = New String() {"mars cruise", "inv@lid cruise", "venus cruise", _ + "b(a)d keyword cruise"} + + For Each keywordText As String In keywords + Dim keyword As New Keyword + keyword.text = keywordText + keyword.matchType = KeywordMatchType.BROAD + + ' Create biddable ad group criterion. + Dim keywordBiddableAdGroupCriterion As New BiddableAdGroupCriterion + keywordBiddableAdGroupCriterion.adGroupId = adGroupId + keywordBiddableAdGroupCriterion.criterion = keyword + + ' Create the operation. + Dim keywordAdGroupCriterionOperation As New AdGroupCriterionOperation + keywordAdGroupCriterionOperation.operand = keywordBiddableAdGroupCriterion + keywordAdGroupCriterionOperation.operator = [Operator].ADD + operations.Add(keywordAdGroupCriterionOperation) + Next + + Try + ' Create the keywords. + Dim result As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + operations.ToArray) + + ' Display the results. + If ((Not result Is Nothing) AndAlso (Not result.value Is Nothing)) Then + For Each adGroupCriterionResult As AdGroupCriterion In result.value + If (Not adGroupCriterionResult.criterion Is Nothing) Then + Console.WriteLine("Keyword with ad group id '{0}', and criterion id " & _ + "'{1}', and text '{2}' was added.\n", adGroupCriterionResult.adGroupId, _ + adGroupCriterionResult.criterion.id, _ + DirectCast(adGroupCriterionResult.criterion, Keyword).text) + End If + Next + Else + Console.WriteLine("No keywords were added.") + End If + + ' Display the partial failure errors. + If ((Not result Is Nothing) AndAlso (Not result.partialFailureErrors Is Nothing)) Then + For Each apiError As ApiError In result.partialFailureErrors + Dim operationIndex As Integer = ErrorUtilities.GetOperationIndex(apiError.fieldPath) + If (operationIndex <> -1) Then + Dim adGroupCriterion As AdGroupCriterion = operations(operationIndex).operand + Console.WriteLine("Keyword with ad group id '{0}' and text '{1}' " & _ + "triggered a failure for the following reason: '{2}'.\n", _ + adGroupCriterion.adGroupId, _ + DirectCast(adGroupCriterion.criterion, Keyword).text, _ + apiError.errorString) + Else + Console.WriteLine("A failure for the following reason: '{0}' has occurred.\n", _ + apiError.errorString) + End If + Next + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add keyword(s) in partial failure mode.", _ + ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/ErrorHandling/HandlePolicyViolationError.vb b/examples/AdWords/Vb/v201402/ErrorHandling/HandlePolicyViolationError.vb new file mode 100644 index 00000000000..85a5c0b9488 --- /dev/null +++ b/examples/AdWords/Vb/v201402/ErrorHandling/HandlePolicyViolationError.vb @@ -0,0 +1,175 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example adds a text ad, and shows how to handle a policy + ''' violation. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class HandlePolicyViolationError + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandlePolicyViolationError + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a text ad, and shows how to handle a policy violation." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which ads are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService( _ + AdWordsService.v201402.AdGroupAdService) + + ' Create the text ad. + Dim textAd As New TextAd + textAd.headline = "Luxury Cruise to Mars" + textAd.description1 = "Visit the Red Planet in style." + textAd.description2 = "Low-gravity fun for everyone!!" + textAd.displayUrl = "www.example.com" + textAd.url = "http://www.example.com" + + Dim textadGroupAd As New AdGroupAd + textadGroupAd.adGroupId = adGroupId + textadGroupAd.ad = textAd + + ' Create the operations. + Dim textAdOperation As New AdGroupAdOperation + textAdOperation.operator = [Operator].ADD + textAdOperation.operand = textadGroupAd + + Try + Dim retVal As AdGroupAdReturnValue = Nothing + + ' Setup two arrays, one to hold the list of all operations to be + ' validated, and another to hold the list of operations that cannot be + ' fixed after validation. + Dim allOperations As New List(Of AdGroupAdOperation) + Dim operationsToBeRemoved As New List(Of AdGroupAdOperation) + + allOperations.Add(textAdOperation) + + Try + ' Validate the operations. + service.RequestHeader.validateOnly = True + retVal = service.mutate(allOperations.ToArray) + Catch ex As AdWordsApiException + Dim innerException As ApiException = TryCast(ex.ApiException, ApiException) + If (innerException Is Nothing) Then + Throw New Exception("Failed to retrieve ApiError. See inner exception for more " & _ + "details.", ex) + End If + + ' Examine each ApiError received from the server. + For Each apiError As ApiError In innerException.errors + Dim index As Integer = ErrorUtilities.GetOperationIndex(apiError.fieldPath) + If (index = -1) Then + ' This API error is not associated with an operand, so we cannot + ' recover from this error by removing one or more operations. + ' Rethrow the exception for manual inspection. + Throw + End If + + ' Handle policy violation errors. + If TypeOf apiError Is PolicyViolationError Then + Dim policyError As PolicyViolationError = apiError + + If policyError.isExemptable Then + ' If the policy violation error is exemptable, add an exemption + ' request. + Dim exemptionRequests As New List(Of ExemptionRequest) + If (Not allOperations.Item(index).exemptionRequests Is Nothing) Then + exemptionRequests.AddRange(allOperations.Item(index).exemptionRequests) + End If + + Dim exemptionRequest As New ExemptionRequest + exemptionRequest.key = policyError.key + exemptionRequests.Add(exemptionRequest) + allOperations.Item(index).exemptionRequests = exemptionRequests.ToArray + Else + ' Policy violation error is not exemptable, remove this + ' operation from the list of operations. + operationsToBeRemoved.Add(allOperations.Item(index)) + End If + Else + ' This is not a policy violation error, remove this operation + ' from the list of operations. + operationsToBeRemoved.Add(allOperations.Item(index)) + End If + Next + + ' Remove all operations that aren't exemptable. + For Each operation As AdGroupAdOperation In operationsToBeRemoved + allOperations.Remove(operation) + Next + End Try + If (allOperations.Count > 0) Then + ' Perform the operations exemptible of a policy violation. + service.RequestHeader.validateOnly = False + retVal = service.mutate(allOperations.ToArray) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) _ + AndAlso (retVal.value.Length > 0)) Then + For Each newAdGroupAd As AdGroupAd In retVal.value + Console.WriteLine("New ad with id = ""{0}"" and displayUrl = ""{1}"" was created.", _ + newAdGroupAd.ad.id, newAdGroupAd.ad.displayUrl) + Next + Else + Console.WriteLine("No ads were created.") + End If + Else + Console.WriteLine("There are no ads to create after policy violation checks.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create Ad(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/ErrorHandling/HandleRateExceededError.vb b/examples/AdWords/Vb/v201402/ErrorHandling/HandleRateExceededError.vb new file mode 100644 index 00000000000..bd3b6402e28 --- /dev/null +++ b/examples/AdWords/Vb/v201402/ErrorHandling/HandleRateExceededError.vb @@ -0,0 +1,206 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Net +Imports System.Threading + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example shows how to handle RateExceededError in your + ''' application. To trigger the rate exceeded error, this code example runs + ''' 100 threads in parallel, each thread attempting to validate 100 keywords + ''' in a single request. Note that spawning 100 parallel threads is for + ''' illustrative purposes only, you shouldn't do this in your application. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class HandleRateExceededError + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandleRateExceededError + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example shows how to handle RateExceededError in your application. " & _ + "To trigger the rate exceeded error, this code example runs 100 threads in " & _ + "parallel, each thread attempting to validate 100 keywords in a single request. " & _ + "Note that spawning 100 parallel threads is for illustrative purposes only, you " & _ + "shouldn't do this in your application." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which keywords are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + Const NUM_THREADS As Integer = 100 + + ' Increase the maximum number of parallel HTTP connections that .NET + ' framework allows. By default, this is set to 2 by the .NET framework. + ServicePointManager.DefaultConnectionLimit = NUM_THREADS + + Dim threads As New List(Of Thread) + + For i As Integer = 0 To NUM_THREADS + Dim thread As New Thread(AddressOf New KeywordThread(user, i, adGroupId).Run) + threads.Add(thread) + Next i + + For i As Integer = 0 To threads.Count - 1 + threads.Item(i).Start(i) + Next i + + For i As Integer = 0 To threads.Count - 1 + threads.Item(i).Join() + Next i + End Sub + + ''' + ''' Thread class for validating keywords. + ''' + Public Class KeywordThread + ''' + ''' Index of this thread, for identifying and debugging. + ''' + Dim threadIndex As Integer + + ''' + ''' The ad group id to which keywords are added. + ''' + Dim adGroupId As Long + + ''' + ''' The AdWords user who owns this ad group. + ''' + Dim user As AdWordsUser + + ''' + ''' Number of keywords to be validated in each API call. + ''' + Const NUM_KEYWORDS As Integer = 100 + + ''' + ''' Initializes a new instance of the class. + ''' + ''' Index of the thread. + ''' The ad group id. + ''' The AdWords user who owns the ad group. + Public Sub New(ByVal user As AdWordsUser, ByVal threadIndex As Integer, _ + ByVal adGroupId As Long) + Me.user = user + Me.threadIndex = threadIndex + Me.adGroupId = adGroupId + End Sub + + ''' + ''' Main method for the thread. + ''' + ''' The thread parameter. + Public Sub Run(ByVal obj As Object) + ' Create the operations. + Dim operations As New List(Of AdGroupCriterionOperation) + For j As Integer = 0 To NUM_KEYWORDS + ' Create the keyword. + Dim keyword As New Keyword + keyword.text = "mars cruise thread " & threadIndex.ToString & " seed " & j.ToString + keyword.matchType = KeywordMatchType.BROAD + + ' Create the biddable ad group criterion. + Dim keywordCriterion As AdGroupCriterion = New BiddableAdGroupCriterion + keywordCriterion.adGroupId = adGroupId + keywordCriterion.criterion = keyword + + ' Create the operations. + Dim keywordOperation As New AdGroupCriterionOperation + keywordOperation.operator = [Operator].ADD + keywordOperation.operand = keywordCriterion + + operations.Add(keywordOperation) + Next j + + ' Get the AdGroupCriterionService. This should be done within the + ' thread, since a service can only handle one outgoing HTTP request + ' at a time. + Dim service As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201402.AdGroupCriterionService) + service.RequestHeader.validateOnly = True + Dim retryCount As Integer = 0 + Const NUM_RETRIES As Integer = 3 + Try + While (retryCount < NUM_RETRIES) + Try + ' Validate the keywords. + Dim retval As AdGroupCriterionReturnValue = service.mutate(operations.ToArray) + Exit While + Catch ex As AdWordsApiException + ' Handle API errors. + Dim innerException As ApiException = TryCast(ex.ApiException, ApiException) + If (innerException Is Nothing) Then + Throw New Exception("Failed to retrieve ApiError. See inner exception for more " & _ + "details.", ex) + End If + For Each apiError As ApiError In innerException.errors + If Not TypeOf apiError Is RateExceededError Then + ' Rethrow any errors other than RateExceededError. + Throw + End If + ' Handle rate exceeded errors. + Dim rateExceededError As RateExceededError = DirectCast(apiError, RateExceededError) + Console.WriteLine("Got Rate exceeded error - rate name = '{0}', scope = '{1}', " & _ + "retry After {2} seconds.", rateExceededError.rateScope, _ + rateExceededError.rateName, rateExceededError.retryAfterSeconds) + Thread.Sleep(rateExceededError.retryAfterSeconds) + retryCount = retryCount + 1 + Next + Finally + If (retryCount = NUM_RETRIES) Then + Throw New Exception(String.Format("Could not recover after making {0} attempts.", _ + retryCount)) + End If + End Try + End While + Catch ex As Exception + Throw New System.ApplicationException("Failed to validate keywords.", ex) + End Try + End Sub + End Class + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/ErrorHandling/HandleTwoFactorAuthorizationError.vb b/examples/AdWords/Vb/v201402/ErrorHandling/HandleTwoFactorAuthorizationError.vb new file mode 100644 index 00000000000..132fef4177e --- /dev/null +++ b/examples/AdWords/Vb/v201402/ErrorHandling/HandleTwoFactorAuthorizationError.vb @@ -0,0 +1,95 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.Common.Lib + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example illustrates how to handle 2 factor authorization errors. + ''' + ''' Tags: CampaignService.get + ''' + Public Class HandleTwoFactorAuthorizationError + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandleTwoFactorAuthorizationError + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to handle 2 factor authorization errors." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Use a test account for which 2 factor authentication has been enabled. + Dim loginEmail As String = "2steptester@gmail.com" + Dim password As String = "testaccount" + + Dim config As New AdWordsAppConfig + config.Email = loginEmail + config.Password = password + Dim authToken As New AuthToken(config, "adwords") + + Try + ' Try to obtain an authToken. + Dim token As String = authToken.GetToken + Console.WriteLine("Retrieved an authToken = {0} for user {1}.", token, loginEmail) + Catch ex As AuthTokenException + ' Since the test account has 2 factor authentication enabled, this block + ' of code will be executed. + If (ex.ErrorCode = AuthTokenErrorCode.BadAuthentication) Then + If (ex.Info = "InvalidSecondFactor") Then + Console.WriteLine("The user has enabled two factor authentication in this " & _ + "account. Have the user generate an application-specific password to make " & _ + "calls against the AdWords API. See " & _ + "http://adwordsapi.blogspot.com/2011/02/authentication-changes-with-2-step.html" & _ + "for more details.") + Else + Console.WriteLine("Invalid credentials.") + End If + Else + Throw New System.ApplicationException(String.Format("The server raised an {0} error.", _ + ex.ErrorCode), ex) + End If + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/Miscellaneous/GetAllVideosAndImages.vb b/examples/AdWords/Vb/v201402/Miscellaneous/GetAllVideosAndImages.vb new file mode 100644 index 00000000000..c60c34b3e85 --- /dev/null +++ b/examples/AdWords/Vb/v201402/Miscellaneous/GetAllVideosAndImages.vb @@ -0,0 +1,139 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example gets all videos and images. To upload video, see + ''' http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. + ''' To upload image, run UploadImage.vb. + ''' + ''' Tags: MediaService.get + ''' + Public Class GetAllVideosAndImages + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAllVideosAndImages + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all videos and images. To upload video, see " & _ + "http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. To " & _ + "upload image, run UploadImage.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the MediaService. + Dim mediaService As MediaService = user.GetService(AdWordsService.v201402.MediaService) + + ' Create the video selector. + Dim selector As New Selector + selector.fields = New String() {"MediaId", "Width", "Height", "MimeType"} + + ' Set the filter. + Dim predicate As New Predicate + predicate.operator = PredicateOperator.IN + predicate.field = "Type" + predicate.values = New String() {MediaMediaType.VIDEO.ToString(), _ + MediaMediaType.IMAGE.ToString()} + + selector.predicates = New Predicate() {predicate} + + ' Select selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New MediaPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + page = mediaService.get(selector) + + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each media As Media In page.entries + If TypeOf media Is Video Then + Dim video As Video = media + Console.WriteLine("{0}) Video with id '{1}' and name '{2}' was found.", _ + i, video.mediaId, video.name) + ElseIf TypeOf media Is Image Then + Dim image As Image = media + Dim dimensions As Dictionary(Of MediaSize, Dimensions) = _ + CreateMediaDimensionMap(image.dimensions) + Console.WriteLine("{0}) Image with id '{1}', dimensions '{2}x{3}', and MIME " & _ + "type '{4}' was found.", i, image.mediaId, dimensions(MediaSize.FULL).width, _ + dimensions(MediaSize.FULL).height, image.mimeType) + End If + i = i + 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of images and videos found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get images and videos.", ex) + End Try + End Sub + + ''' + ''' Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + ''' + ''' The array of Media_Size_DimensionsMapEntry to be + ''' converted into a dictionary. + ''' A dictionary with key as MediaSize, and value as Dimensions. + ''' + Private Function CreateMediaDimensionMap(ByVal dimensions As Media_Size_DimensionsMapEntry()) _ + As Dictionary(Of MediaSize, Dimensions) + Dim mediaMap As New Dictionary(Of MediaSize, Dimensions) + For Each dimension As Media_Size_DimensionsMapEntry In dimensions + mediaMap.Add(dimension.key, dimension.value) + Next + Return mediaMap + End Function + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/Miscellaneous/UploadImage.vb b/examples/AdWords/Vb/v201402/Miscellaneous/UploadImage.vb new file mode 100644 index 00000000000..69431a0d28a --- /dev/null +++ b/examples/AdWords/Vb/v201402/Miscellaneous/UploadImage.vb @@ -0,0 +1,107 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 +Imports Google.Api.Ads.Common.Util + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example uploads an image. To get images, run GetAllVideosAndImages.vb. + ''' + ''' Tags: MediaService.upload + ''' + Public Class UploadImage + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UploadImage + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example uploads an image. To get images, run GetAllVideosAndImages.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the MediaService. + Dim mediaService As MediaService = user.GetService( _ + AdWordsService.v201402.MediaService) + + ' Create the image. + Dim image As New Image + image.data = MediaUtilities.GetAssetDataFromUrl("http://goo.gl/HJM3L") + image.type = MediaMediaType.IMAGE + + Try + ' Upload the image. + Dim result As Media() = mediaService.upload(New Media() {image}) + + ' Display the results. + If ((Not result Is Nothing) AndAlso (result.Length > 0)) Then + Dim newImage As Media = result(0) + Dim dimensions As Dictionary(Of MediaSize, Dimensions) = _ + CreateMediaDimensionMap(newImage.dimensions) + Console.WriteLine("Image with id '{0}', dimensions '{1}x{2}', and MIME type '{3}'" & _ + " was uploaded.", newImage.mediaId, dimensions.Item(MediaSize.FULL).width, _ + dimensions.Item(MediaSize.FULL).height, newImage.mimeType) + Else + Console.WriteLine("No images were uploaded.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to upload images.", ex) + End Try + End Sub + + ''' + ''' Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + ''' + ''' The array of Media_Size_DimensionsMapEntry to + ''' be converted into a dictionary. + ''' A dictionary with key as MediaSize, and value as Dimensions. + ''' + Private Function CreateMediaDimensionMap(ByVal dimensions As Media_Size_DimensionsMapEntry()) _ + As Dictionary(Of MediaSize, Dimensions) + Dim mediaMap As New Dictionary(Of MediaSize, Dimensions) + For Each dimension As Media_Size_DimensionsMapEntry In dimensions + mediaMap.Add(dimension.key, dimension.value) + Next + Return mediaMap + End Function + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/Optimization/EstimateKeywordTraffic.vb b/examples/AdWords/Vb/v201402/Optimization/EstimateKeywordTraffic.vb new file mode 100644 index 00000000000..9ef161fa752 --- /dev/null +++ b/examples/AdWords/Vb/v201402/Optimization/EstimateKeywordTraffic.vb @@ -0,0 +1,174 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example gets keyword traffic estimates. + ''' + ''' Tags: TrafficEstimatorService.get + ''' + Public Class EstimateKeywordTraffic + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New EstimateKeywordTraffic + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets keyword traffic estimates." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the TrafficEstimatorService. + Dim trafficEstimatorService As TrafficEstimatorService = user.GetService( _ + AdWordsService.v201402.TrafficEstimatorService) + + ' Create keywords. Up to 2000 keywords can be passed in a single request. + Dim keyword1 As New Keyword + keyword1.text = "mars cruise" + keyword1.matchType = KeywordMatchType.BROAD + + Dim keyword2 As New Keyword + keyword2.text = "cheap cruise" + keyword2.matchType = KeywordMatchType.PHRASE + + Dim keyword3 As New Keyword + keyword3.text = "cruise" + keyword3.matchType = KeywordMatchType.EXACT + + Dim keywords As Keyword() = New Keyword() {keyword1, keyword2, keyword3} + + ' Create a keyword estimate request for each keyword. + Dim keywordEstimateRequests As New List(Of KeywordEstimateRequest) + + For Each keyword As Keyword In keywords + Dim keywordEstimateRequest As New KeywordEstimateRequest + keywordEstimateRequest.keyword = keyword + keywordEstimateRequests.Add(keywordEstimateRequest) + Next + + ' Create negative keywords. + Dim negativeKeyword1 As New Keyword + negativeKeyword1.text = "moon walk" + negativeKeyword1.matchType = KeywordMatchType.BROAD + + Dim negativeKeywordEstimateRequest As New KeywordEstimateRequest + negativeKeywordEstimateRequest.keyword = negativeKeyword1 + negativeKeywordEstimateRequest.isNegative = True + keywordEstimateRequests.Add(negativeKeywordEstimateRequest) + + ' Create ad group estimate requests. + Dim adGroupEstimateRequest As New AdGroupEstimateRequest + adGroupEstimateRequest.keywordEstimateRequests = keywordEstimateRequests.ToArray + adGroupEstimateRequest.maxCpc = New Money + adGroupEstimateRequest.maxCpc.microAmount = 1000000 + + ' Create campaign estimate requests. + Dim campaignEstimateRequest As New CampaignEstimateRequest + campaignEstimateRequest.adGroupEstimateRequests = New AdGroupEstimateRequest() _ + {adGroupEstimateRequest} + + ' See http://code.google.com/apis/adwords/docs/appendix/countrycodes.html + ' for a detailed list of country codes. + Dim countryCriterion As New Location + countryCriterion.id = 2840 'US + + ' See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + ' for a detailed list of language codes. + Dim languageCriterion As New Language + languageCriterion.id = 1000 'en + + campaignEstimateRequest.criteria = New Criterion() {countryCriterion, languageCriterion} + + ' Create the selector. + Dim selector As New TrafficEstimatorSelector + selector.campaignEstimateRequests = New CampaignEstimateRequest() {campaignEstimateRequest} + + Try + ' Get traffic estimates. + Dim result As TrafficEstimatorResult = trafficEstimatorService.get(selector) + + ' Display the results. + If ((Not result Is Nothing) AndAlso (Not result.campaignEstimates Is Nothing) _ + AndAlso (result.campaignEstimates.Length > 0)) Then + Dim campaignEstimate As CampaignEstimate = result.campaignEstimates(0) + If ((Not campaignEstimate.adGroupEstimates Is Nothing) AndAlso _ + (campaignEstimate.adGroupEstimates.Length > 0)) Then + Dim adGroupEstimate As AdGroupEstimate = campaignEstimate.adGroupEstimates(0) + + If (Not adGroupEstimate.keywordEstimates Is Nothing) Then + For i As Integer = 0 To adGroupEstimate.keywordEstimates.Length - 1 + Dim keyword As Keyword = keywordEstimateRequests.Item(i).keyword + Dim keywordEstimate As KeywordEstimate = adGroupEstimate.keywordEstimates(i) + + If keywordEstimateRequests.Item(i).isNegative Then + Continue For + End If + + ' Find the mean of the min and max values. + Dim meanAverageCpc As Long = ((keywordEstimate.min.averageCpc.microAmount + _ + keywordEstimate.max.averageCpc.microAmount) / 2) + Dim meanAveragePosition As Double = ((keywordEstimate.min.averagePosition + _ + keywordEstimate.max.averagePosition) / 2) + Dim meanClicks As Single = ((keywordEstimate.min.clicksPerDay + _ + keywordEstimate.max.clicksPerDay) / 2) + Dim meanTotalCost As Long = ((keywordEstimate.min.totalCost.microAmount + _ + keywordEstimate.max.totalCost.microAmount) / 2) + + Console.WriteLine("Results for the keyword with text = '{0}' and match type " & _ + "= '{1}':", keyword.text, keyword.matchType) + Console.WriteLine(" Estimated average CPC: {0}", meanAverageCpc) + Console.WriteLine(" Estimated ad position: {0:0.00}", meanAveragePosition) + Console.WriteLine(" Estimated daily clicks: {0}", meanClicks) + Console.WriteLine(" Estimated daily cost: {0}", meanTotalCost) + Next i + End If + End If + Else + Console.WriteLine("No traffic estimates were returned.\n") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve traffic estimates.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/Optimization/GetAdGroupBidSimulations.vb b/examples/AdWords/Vb/v201402/Optimization/GetAdGroupBidSimulations.vb new file mode 100644 index 00000000000..1aa341a20b3 --- /dev/null +++ b/examples/AdWords/Vb/v201402/Optimization/GetAdGroupBidSimulations.vb @@ -0,0 +1,109 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example gets bid landscapes for an ad group. To get ad groups, + ''' run GetAdGroups.vb. + ''' + ''' Tags: DataService.getAdGroupBidLandscape + ''' + Public Class GetAdGroupBidSimulations + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAdGroupBidSimulations + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets bid landscapes for an ad group. To get ad groups, run " & _ + "GetAdGroups.vb" + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group for which bid simulations are + ''' retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the DataService. + Dim dataService As DataService = user.GetService(AdWordsService.v201402.DataService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"AdGroupId", "LandscapeType", "LandscapeCurrent", _ + "StartDate", "EndDate", "Bid", "LocalClicks", "LocalCost", "MarginalCpc", _ + "LocalImpressions"} + + ' Set the filters. + Dim adGroupPredicate As New Predicate + adGroupPredicate.field = "AdGroupId" + adGroupPredicate.operator = PredicateOperator.IN + adGroupPredicate.values = New String() {adGroupId.ToString} + + selector.predicates = New Predicate() {adGroupPredicate} + + Try + ' Get bid landscape for ad group. + Dim page As AdGroupBidLandscapePage = dataService.getAdGroupBidLandscape(selector) + If (((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) AndAlso _ + (page.entries.Length > 0)) Then + For Each bidLandscape As AdGroupBidLandscape In page.entries + Console.WriteLine("Found ad group bid landscape with ad group id '{0}', " & _ + "type '{1}', current: '{2}', start date '{3}', end date '{4}', and " & _ + "landscape points", bidLandscape.adGroupId, bidLandscape.type, _ + bidLandscape.landscapeCurrent, bidLandscape.startDate, bidLandscape.endDate) + Dim point As BidLandscapeLandscapePoint + For Each point In bidLandscape.landscapePoints + Console.WriteLine("- bid: {0} => clicks: {1}, cost: {2}, marginalCpc: {3}, " & _ + "impressions: {4}", point.bid.microAmount, point.bid.microAmount, _ + point.clicks, point.cost.microAmount, point.marginalCpc.microAmount, _ + point.impressions) + Next + Next + Else + Console.WriteLine("No ad group bid landscapes were found.\n") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to get ad group bid landscapes.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/Optimization/GetKeywordBidSimulations.vb b/examples/AdWords/Vb/v201402/Optimization/GetKeywordBidSimulations.vb new file mode 100644 index 00000000000..62c9810c0d5 --- /dev/null +++ b/examples/AdWords/Vb/v201402/Optimization/GetKeywordBidSimulations.vb @@ -0,0 +1,134 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example gets a bid landscape for an ad group and a keyword. + ''' To get ad groups, run GetAdGroups.vb. To get keywords, run + ''' GetKeywords.vb. + ''' + ''' Tags: DataService.getCriterionBidLandscape + ''' + Public Class GetKeywordBidSimulations + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetKeywordBidSimulations + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim keywordId As Long = Long.Parse("INSERT_KEYWORD_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, keywordId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets a bid landscape for an ad group and a keyword. To " & _ + "get ad groups, run GetAdGroups.vb. To get keywords, run GetKeywords.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group for which keyword bid + ''' simulations are retrieved. + ''' Id of the keyword for which bid simulations are + ''' retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal keywordId As Long) + ' Get the DataService. + Dim dataService As DataService = user.GetService(AdWordsService.v201402.DataService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"AdGroupId", "CriterionId", "StartDate", "EndDate", _ + "Bid", "LocalClicks", "LocalCost", "MarginalCpc", "LocalImpressions"} + + ' Set the filters. + Dim adGroupPredicate As New Predicate + adGroupPredicate.field = "AdGroupId" + adGroupPredicate.operator = PredicateOperator.IN + adGroupPredicate.values = New String() {adGroupId.ToString} + + Dim keywordPredicate As New Predicate + keywordPredicate.field = "CriterionId" + keywordPredicate.operator = PredicateOperator.IN + keywordPredicate.values = New String() {keywordId.ToString} + + selector.predicates = New Predicate() {adGroupPredicate, keywordPredicate} + + ' Select selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New CriterionBidLandscapePage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get bid landscape for keywords. + page = dataService.getCriterionBidLandscape(selector) + + ' Display bid landscapes. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each bidLandscape As CriterionBidLandscape In page.entries + Console.WriteLine("{0}) Found keyword bid landscape with ad group id ""{1}"", " & _ + "keyword id ""{2}"", start date ""{3}"", end date ""{4}"", and " & _ + "landscape points:", i, bidLandscape.adGroupId, bidLandscape.criterionId, _ + bidLandscape.startDate, bidLandscape.endDate) + For Each bidLandscapePoint As BidLandscapeLandscapePoint _ + In bidLandscape.landscapePoints + Console.WriteLine("- bid: {0} => clicks: {1}, cost: {2}, marginalCpc: {3}, " & _ + "impressions: {4}", bidLandscapePoint.bid.microAmount, _ + bidLandscapePoint.clicks, bidLandscapePoint.cost.microAmount, _ + bidLandscapePoint.marginalCpc.microAmount, bidLandscapePoint.impressions) + Next + Next + i += 1 + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of keyword bid landscapes found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve keyword bid landscapes.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/Optimization/GetKeywordIdeas.vb b/examples/AdWords/Vb/v201402/Optimization/GetKeywordIdeas.vb new file mode 100644 index 00000000000..20d383d75f2 --- /dev/null +++ b/examples/AdWords/Vb/v201402/Optimization/GetKeywordIdeas.vb @@ -0,0 +1,150 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Text + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example retrieves keywords that are related to a given keyword. + ''' + ''' Tags: TargetingIdeaService.get + ''' + Public Class GetKeywordIdeas + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetKeywordIdeas + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves keywords that are related to a given keyword." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the TargetingIdeaService. + Dim targetingIdeaService As TargetingIdeaService = user.GetService( _ + AdWordsService.v201402.TargetingIdeaService) + + Dim keywordText As String = "mars cruise" + + ' Create selector. + Dim selector As New TargetingIdeaSelector() + selector.requestType = RequestType.IDEAS + selector.ideaType = IdeaType.KEYWORD + selector.requestedAttributeTypes = New AttributeType() { _ + AttributeType.KEYWORD_TEXT, AttributeType.SEARCH_VOLUME, _ + AttributeType.CATEGORY_PRODUCTS_AND_SERVICES} + + ' Language setting (optional). + ' The ID can be found in the documentation: + ' https://developers.google.com/adwords/api/docs/appendix/languagecodes + ' Note: As of v201302, only a single language parameter is allowed. + Dim languageParameter As New LanguageSearchParameter() + Dim english As New Language() + english.id = 1000 + languageParameter.languages = New Language() {english} + + ' Create related to query search parameter. + Dim relatedToQuerySearchParameter As New RelatedToQuerySearchParameter() + relatedToQuerySearchParameter.queries = New String() {keywordText} + selector.searchParameters = New SearchParameter() {relatedToQuerySearchParameter, _ + languageParameter} + + ' Set selector paging (required for targeting idea service). + Dim paging As New Paging() + paging.startIndex = 0 + paging.numberResults = 500 + selector.paging = paging + + Dim offset As Long = 0 + Dim pageSize As Long = 500 + + Dim page As New TargetingIdeaPage() + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get related keywords. + page = targetingIdeaService.get(selector) + + 'Display the results. + + If Not page.entries Is Nothing AndAlso page.entries.Length > 0 Then + Dim i As Integer = offset + For Each targetingIdea As TargetingIdea In page.entries + Dim keyword As String = Nothing + Dim categories As String = Nothing + Dim averageMonthlySearches As Long = 0 + + For Each entry As Type_AttributeMapEntry In targetingIdea.data + If entry.key = AttributeType.KEYWORD_TEXT Then + keyword = DirectCast(entry.value, StringAttribute).value + End If + If entry.key = AttributeType.CATEGORY_PRODUCTS_AND_SERVICES Then + Dim categorySet As IntegerSetAttribute = entry.value + Dim builder As New StringBuilder() + For Each value As Integer In categorySet.value + builder.AppendFormat("{0}, ", value) + Next + Dim trimChars As Char() = New Char() {",", " "} + categories = builder.ToString().Trim(trimChars) + End If + If entry.key = AttributeType.SEARCH_VOLUME Then + averageMonthlySearches = DirectCast(entry.value, LongAttribute).value + End If + Next + Console.WriteLine("Keyword with text '{0}', and average monthly search volume " & _ + "'{1}' was found with categories: {2}", keyword, averageMonthlySearches, _ + categories) + i = i + 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of related keywords found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve related keywords.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/Optimization/GetPlacementIdeas.vb b/examples/AdWords/Vb/v201402/Optimization/GetPlacementIdeas.vb new file mode 100644 index 00000000000..43d7f4dc247 --- /dev/null +++ b/examples/AdWords/Vb/v201402/Optimization/GetPlacementIdeas.vb @@ -0,0 +1,123 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example retrieves urls that have content keywords related to a + ''' given website. + ''' + ''' Tags: TargetingIdeaService.get + ''' + Public Class GetPlacementIdeas + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetPlacementIdeas + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves urls that have content keywords related to a " & _ + "given website." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the TargetingIdeaService. + Dim targetingIdeaService As TargetingIdeaService = user.GetService( _ + AdWordsService.v201402.TargetingIdeaService) + + ' Create seed url. + Dim url As String = "mars.google.com" + + ' Create the selector. + Dim selector As New TargetingIdeaSelector + selector.requestType = RequestType.IDEAS + selector.ideaType = IdeaType.PLACEMENT + selector.requestedAttributeTypes = New AttributeType() {AttributeType.CRITERION, _ + AttributeType.PLACEMENT_TYPE} + + ' Create related to url search parameter. + Dim relatedToUrlSearchParameter As New RelatedToUrlSearchParameter + relatedToUrlSearchParameter.urls = New String() {url} + relatedToUrlSearchParameter.includeSubUrls = False + selector.searchParameters = New SearchParameter() {relatedToUrlSearchParameter} + + ' Select selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New TargetingIdeaPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get placement ideas. + page = targetingIdeaService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each idea As TargetingIdea In page.entries + For Each entry As Type_AttributeMapEntry In idea.data + If (entry.key = AttributeType.CRITERION) Then + Dim placementAttribute As CriterionAttribute = entry.value + Dim placement As Placement = placementAttribute.value + Console.WriteLine("{0}) Related placement urls were found at '{1}'.", _ + i, placement.url) + End If + Next + Next + i += 1 + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of related placements found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve related placements.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/Remarketing/AddAudience.vb b/examples/AdWords/Vb/v201402/Remarketing/AddAudience.vb new file mode 100644 index 00000000000..3bcd54d6377 --- /dev/null +++ b/examples/AdWords/Vb/v201402/Remarketing/AddAudience.vb @@ -0,0 +1,154 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example illustrates how to create a user list a.k.a. audience. + ''' + ''' Tags: UserListService.mutate + ''' + Public Class AddAudience + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAudience + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to create a user list a.k.a. audience." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the UserListService. + Dim userListService As AdwordsUserListService = user.GetService( _ + AdWordsService.v201402.AdwordsUserListService) + + ' Get the ConversionTrackerService. + Dim conversionTrackerService As ConversionTrackerService = user.GetService( _ + AdWordsService.v201402.ConversionTrackerService) + + Dim userList As New BasicUserList + + userList.name = ("Mars cruise customers #" & ExampleUtilities.GetRandomString) + userList.description = "A list of mars cruise customers in the last year." + userList.status = UserListMembershipStatus.OPEN + userList.membershipLifeSpan = 365 + + Dim conversionType As New UserListConversionType + conversionType.name = userList.name + userList.conversionTypes = New UserListConversionType() {conversionType} + + ' Optional: Set the user list status. + userList.status = UserListMembershipStatus.OPEN + + ' Create the operation. + Dim operation As New UserListOperation + operation.operand = userList + operation.operator = [Operator].ADD + + Try + ' Add the user list. + Dim retval As UserListReturnValue = userListService.mutate(New UserListOperation() _ + {operation}) + + Dim userLists As UserList() = Nothing + If ((Not retval Is Nothing) AndAlso (Not retval.value Is Nothing)) Then + userLists = retval.value + ' Get all conversion snippets. + Dim conversionIds As New List(Of String) + For Each newUserList As BasicUserList In userLists + If (Not newUserList.conversionTypes Is Nothing) Then + For Each newConversionType As UserListConversionType In _ + newUserList.conversionTypes + conversionIds.Add(newConversionType.id.ToString) + Next + End If + Next + + Dim conversionsMap As New Dictionary(Of Long, ConversionTracker) + + If (conversionIds.Count > 0) Then + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id"} + + Dim conversionTypePredicate As New Predicate + conversionTypePredicate.field = "Id" + conversionTypePredicate.operator = PredicateOperator.IN + conversionTypePredicate.values = conversionIds.ToArray + selector.predicates = New Predicate() {conversionTypePredicate} + + ' Get all conversion trackers. + Dim page As ConversionTrackerPage = conversionTrackerService.get(selector) + + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + For Each tracker As ConversionTracker In page.entries + conversionsMap.Item(tracker.id) = tracker + Next + End If + End If + + ' Display the results. + For Each newUserList As BasicUserList In userLists + Console.WriteLine("User list with name '{0}' and id '{1}' was added.", _ + newUserList.name, newUserList.id) + + ' Display user list associated conversion code snippets. + If (Not newUserList.conversionTypes Is Nothing) Then + For Each newConversionType As UserListConversionType In newUserList.conversionTypes + Dim conversionTracker As AdWordsConversionTracker = _ + DirectCast(conversionsMap.Item(newConversionType.id), _ + AdWordsConversionTracker) + Console.WriteLine("Conversion type code snippet associated to the list:\n{0}", _ + conversionTracker.snippet) + Next + End If + Next + Else + Console.WriteLine("No user lists (a.k.a. audiences) were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add user lists (a.k.a. audiences).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/Remarketing/AddConversionTracker.vb b/examples/AdWords/Vb/v201402/Remarketing/AddConversionTracker.vb new file mode 100644 index 00000000000..8796d5eda4a --- /dev/null +++ b/examples/AdWords/Vb/v201402/Remarketing/AddConversionTracker.vb @@ -0,0 +1,109 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example adds an AdWords conversion tracker. + ''' + ''' Tags: ConversionTrackerService.mutate + ''' + Public Class AddConversionTracker + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddConversionTracker + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds an AdWords conversion tracker." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the ConversionTrackerService. + Dim conversionTrackerService As ConversionTrackerService = user.GetService( _ + AdWordsService.v201402.ConversionTrackerService) + + ' Create AdWords conversion tracker. + Dim conversionTracker As New AdWordsConversionTracker + conversionTracker.name = "Earth to Mars Cruises Conversion #" & _ + ExampleUtilities.GetRandomString + conversionTracker.category = ConversionTrackerCategory.DEFAULT + conversionTracker.markupLanguage = AdWordsConversionTrackerMarkupLanguage.HTML + conversionTracker.textFormat = AdWordsConversionTrackerTextFormat.HIDDEN + + ' Set optional fields. + conversionTracker.status = ConversionTrackerStatus.ENABLED + conversionTracker.viewthroughLookbackWindow = 15 + conversionTracker.isProductAdsChargeable = True + conversionTracker.productAdsChargeableConversionWindow = 15 + conversionTracker.conversionPageLanguage = "en" + conversionTracker.backgroundColor = "#0000FF" + conversionTracker.defaultRevenueValue = 12.34 + conversionTracker.alwaysUseDefaultRevenueValue = True + + ' Create the operation. + Dim operation As New ConversionTrackerOperation + operation.operator = [Operator].ADD + operation.operand = conversionTracker + + Try + ' Add conversion tracker. + Dim retval As ConversionTrackerReturnValue = conversionTrackerService.mutate( _ + New ConversionTrackerOperation() {operation}) + + ' Display the results. + If ((Not retval Is Nothing) AndAlso (Not retval.value Is Nothing) AndAlso _ + retval.value.Length > 0) Then + Dim newConversionTracker As ConversionTracker = retval.value(0) + Console.WriteLine("Conversion tracker with id '{0}', name '{1}', status '{2}', " & _ + "category '{3}' was added.", newConversionTracker.id, newConversionTracker.name, _ + newConversionTracker.status, newConversionTracker.category) + Else + Console.WriteLine("No conversion trackers were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add conversion tracker.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/Reporting/DownloadCriteriaReport.vb b/examples/AdWords/Vb/v201402/Reporting/DownloadCriteriaReport.vb new file mode 100644 index 00000000000..e4060d0b939 --- /dev/null +++ b/examples/AdWords/Vb/v201402/Reporting/DownloadCriteriaReport.vb @@ -0,0 +1,118 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util.Reports +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example gets and downloads a criteria Ad Hoc report from an XML + ''' report definition. + ''' + Public Class DownloadCriteriaReport + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DownloadCriteriaReport + Console.WriteLine(codeExample.Description) + Try + Dim fileName As String = "INSERT_OUTPUT_FILE_NAME" + codeExample.Run(New AdWordsUser, fileName) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets and downloads a criteria Ad Hoc report from an XML report" & _ + " definition." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The file to which the report is downloaded. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal fileName As String) + Dim definition As New ReportDefinition + + definition.reportName = "Last 7 days CRITERIA_PERFORMANCE_REPORT" + definition.reportType = ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT + definition.downloadFormat = DownloadFormat.GZIPPED_CSV + definition.dateRangeType = ReportDefinitionDateRangeType.LAST_7_DAYS + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"CampaignId", "AdGroupId", "Id", "CriteriaType", "Criteria", _ + "CriteriaDestinationUrl", "Clicks", "Impressions", "Cost"} + + Dim predicate As New Predicate + predicate.field = "Status" + predicate.operator = PredicateOperator.IN + predicate.values = New String() {"ACTIVE", "PAUSED"} + selector.predicates = New Predicate() {predicate} + + definition.selector = selector + definition.includeZeroImpressions = True + + Dim filePath As String = ExampleUtilities.GetHomeDir() & Path.DirectorySeparatorChar & _ + fileName + + Try + ' If you know that your report is small enough to fit in memory, then + ' you can instead use + ' Dim utilities As New ReportUtilities(user) + ' utilities.ReportVersion = "v201402" + ' Dim report As ClientReport = utilities.GetClientReport( _ + ' Of ReportDefinition)(definition) + ' + ' ' Get the text report directly if you requested a text format + ' ' (e.g. xml) + ' Dim reportText As String = report.Text + ' + ' ' Get the binary report if you requested a binary format + ' ' (e.g. gzip) + ' Dim reportBytes As Byte() = report.Contents + ' + ' ' Deflate a zipped binary report for further processing. + ' Dim deflatedReportText As String = Encoding.UTF8.GetString( _ + ' MediaUtilities.DeflateGZipData(report.Contents)) + Dim utilities As New ReportUtilities(user) + utilities.ReportVersion = "v201402" + utilities.DownloadClientReport(Of ReportDefinition)(definition, filePath) + Console.WriteLine("Report was downloaded to '{0}'.", filePath) + Catch ex As Exception + Throw New System.ApplicationException("Failed to download report.", ex) + End Try + + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/Reporting/DownloadCriteriaReportWithAwql.vb b/examples/AdWords/Vb/v201402/Reporting/DownloadCriteriaReportWithAwql.vb new file mode 100644 index 00000000000..cc83198f74f --- /dev/null +++ b/examples/AdWords/Vb/v201402/Reporting/DownloadCriteriaReportWithAwql.vb @@ -0,0 +1,102 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util.Reports +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example gets and downloads a criteria Ad Hoc report from an AWQL + ''' query. See https://developers.google.com/adwords/api/docs/guides/awql for + ''' AWQL documentation. + ''' + Public Class DownloadCriteriaReportWithAwql + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DownloadCriteriaReportWithAwql + Console.WriteLine(codeExample.Description) + Try + Dim fileName As String = "INSERT_OUTPUT_FILE_NAME" + codeExample.Run(New AdWordsUser, fileName) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets and downloads a criteria Ad Hoc report from an AWQL" & _ + " query. See https://developers.google.com/adwords/api/docs/guides/awql for" & _ + " AWQL documentation." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The file to which the report is downloaded. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal fileName As String) + Dim query As String = "SELECT CampaignId, AdGroupId, Id, Criteria, CriteriaType, " & _ + "Impressions, Clicks, Cost FROM CRITERIA_PERFORMANCE_REPORT WHERE Status IN " & _ + "[ACTIVE, PAUSED] DURING LAST_7_DAYS" + + Dim filePath As String = ExampleUtilities.GetHomeDir() + Path.DirectorySeparatorChar & _ + fileName + + Try + ' If you know that your report is small enough to fit in memory, then + ' you can instead use + ' Dim utilities As New ReportUtilities(user) + ' utilities.ReportVersion = "v201402" + ' Dim report As ClientReport = utilities.GetClientReport(query, format) + ' + ' ' Get the text report directly if you requested a text format + ' ' (e.g. xml) + ' Dim reportText As String = report.Text + ' + ' ' Get the binary report if you requested a binary format + ' ' (e.g. gzip) + ' Dim reportBytes As Byte() = report.Contents + ' + ' ' Deflate a zipped binary report for further processing. + ' Dim deflatedReportText As String = Encoding.UTF8.GetString( _ + ' MediaUtilities.DeflateGZipData(report.Contents)) + Dim utilities As New ReportUtilities(user) + utilities.ReportVersion = "v201402" + utilities.DownloadClientReport(query, DownloadFormat.GZIPPED_CSV.ToString(), filePath) + Console.WriteLine("Report was downloaded to '{0}'.", filePath) + Catch ex As Exception + Throw New System.ApplicationException("Failed to download report.", ex) + End Try + + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/Reporting/GetReportFields.vb b/examples/AdWords/Vb/v201402/Reporting/GetReportFields.vb new file mode 100644 index 00000000000..6be19656881 --- /dev/null +++ b/examples/AdWords/Vb/v201402/Reporting/GetReportFields.vb @@ -0,0 +1,97 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example gets report fields. + ''' + ''' Tags: ReportDefinitionService.getReportFields + ''' + Public Class GetReportFields + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetReportFields + Console.WriteLine(codeExample.Description) + Try + Dim reportType As ReportDefinitionReportType = [Enum].Parse( _ + GetType(ReportDefinitionReportType), "INSERT_REPORT_TYPE_HERE") + codeExample.Run(New AdWordsUser, reportType) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets report fields." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The report type to be run. + Public Sub Run(ByVal user As AdWordsUser, ByVal reportType As ReportDefinitionReportType) + ' Get the ReportDefinitionService. + Dim reportDefinitionService As ReportDefinitionService = user.GetService( _ + AdWordsService.v201402.ReportDefinitionService) + + ' The type of the report to get fields for. + ' E.g.: KEYWORDS_PERFORMANCE_REPORT + + Try + ' Get the report fields. + Dim reportDefinitionFields As ReportDefinitionField() = _ + reportDefinitionService.getReportFields(reportType) + + If ((Not reportDefinitionFields Is Nothing) AndAlso _ + (reportDefinitionFields.Length > 0)) Then + ' Display report fields. + Console.WriteLine("The report type '{0}' contains the following fields:", reportType) + + For Each reportDefinitionField As ReportDefinitionField In reportDefinitionFields + Console.Write("- {0} ({1})", reportDefinitionField.fieldName, _ + reportDefinitionField.fieldType) + If (Not reportDefinitionField.enumValues Is Nothing) Then + Console.Write(" := [{0}]", String.Join(", ", reportDefinitionField.enumValues)) + End If + Console.WriteLine() + Next + Else + Console.WriteLine("This report type has no fields.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve fields for report type.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/ShoppingCampaigns/AddProductPartitionTree.vb b/examples/AdWords/Vb/v201402/ShoppingCampaigns/AddProductPartitionTree.vb new file mode 100644 index 00000000000..f33e6130d9c --- /dev/null +++ b/examples/AdWords/Vb/v201402/ShoppingCampaigns/AddProductPartitionTree.vb @@ -0,0 +1,318 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example creates a ProductPartition tree. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class AddProductPartitionTree + Inherits ExampleBase + + ''' + ''' A helper class for creating ProductPartition trees. + ''' + Private Class ProductPartitionHelper + + ''' + ''' The ID of the AdGroup that we wish to attach the partition tree to. + ''' + Private adGroupId As Long + + ''' + ''' The next temporary critertion ID to be used. + ''' + ''' When creating our tree we need to specify the parent-child + ''' relationships between nodes. However, until a criterion has been + ''' created on the server we do not have a criterionId with which to + ''' refer to it. + ''' + ''' Instead we can specify temporary IDs that are specific to a single + ''' mutate request. Once the criteria have been created they are assigned + ''' an ID as normal and the temporary ID will no longer refer to it. + ''' + ''' A valid temporary ID is any negative integer. + ''' + Private nextId As Long = -1 + + ''' + ''' The set of mutate operations needed to create the current tree. + ''' + Private operationsField As New List(Of AdGroupCriterionOperation) + + ''' + ''' Overloaded constructor. + ''' + ''' The ID of the AdGroup that we wish to attach + ''' the partition tree to. + Public Sub New(ByVal adGroupId As Long) + Me.adGroupId = adGroupId + End Sub + + Public ReadOnly Property Operations() As AdGroupCriterionOperation() + Get + Return operationsField.ToArray + End Get + End Property + + ''' + ''' Creates a subdivision node. + ''' + ''' The node that should be this node's parent. + ''' + ''' The value being paritioned on. + ''' A new subdivision node. + Public Function CreateSubdivision(ByVal parent As ProductPartition, _ + ByVal value As ProductDimension) As ProductPartition + Dim division As New ProductPartition() + division.partitionType = ProductPartitionType.SUBDIVISION + division.id = Me.nextId + Me.nextId = Me.nextId - 1 + + ' The root node has neither a parent nor a value. + If Not (parent Is Nothing) Then + division.parentCriterionId = parent.id + division.caseValue = value + End If + + Dim criterion As New BiddableAdGroupCriterion() + criterion.adGroupId = Me.adGroupId + criterion.criterion = division + + Me.CreateAddOperation(criterion) + Return division + End Function + + ''' + ''' Creates the unit. + ''' + ''' The node that should be this node's parent. + ''' + ''' The value being paritioned on. + ''' The amount to bid for matching products, + ''' in micros. + ''' True, if this is negative criterion, false + ''' otherwise. + ''' A new unit node. + Public Function CreateUnit(ByVal parent As ProductPartition, _ + ByVal value As ProductDimension, _ + ByVal bidAmount As Long, _ + ByVal isNegative As Boolean) As ProductPartition + Dim unit As New ProductPartition() + unit.partitionType = ProductPartitionType.UNIT + + ' The root node has neither a parent nor a value. + If Not (parent Is Nothing) Then + unit.parentCriterionId = parent.id + unit.caseValue = value + End If + + Dim criterion As AdGroupCriterion = Nothing + + If (isNegative) Then + Dim biddingStrategyConfiguration As New BiddingStrategyConfiguration() + + Dim cpcBid As New CpcBid() + cpcBid.bid = New Money() + cpcBid.bid.microAmount = bidAmount + biddingStrategyConfiguration.bids = New Bids() {cpcBid} + + criterion = New BiddableAdGroupCriterion() + DirectCast(criterion, BiddableAdGroupCriterion).biddingStrategyConfiguration = _ + biddingStrategyConfiguration + Else + criterion = New NegativeAdGroupCriterion() + End If + + criterion.adGroupId = Me.adGroupId + criterion.criterion = unit + + Me.CreateAddOperation(criterion) + + Return unit + End Function + + ''' + ''' Creates an AdGroupCriterionOperation for the given criterion + ''' + ''' The criterion we want to add + Private Sub CreateAddOperation(ByVal criterion As AdGroupCriterion) + Dim operation As New AdGroupCriterionOperation() + operation.operand = criterion + operation.operator = [Operator].ADD + Me.operationsField.Add(operation) + End Sub + End Class + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddProductPartitionTree + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example creates a ProductPartition tree." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The ad group to which product partition is + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201402.AdGroupCriterionService) + + Dim helper As New ProductPartitionHelper(adGroupId) + + ' The most trivial partition tree has only a unit node as the root: + ' helper.createUnit(null, null, 100000); + + Dim root As ProductPartition = helper.CreateSubdivision(Nothing, Nothing) + + Dim newCondition As New ProductCanonicalCondition() + newCondition.condition = ProductCanonicalConditionCondition.NEW + Dim newPartition As ProductPartition = helper.CreateUnit(root, newCondition, 200000, False) + + Dim usedCondition As New ProductCanonicalCondition() + usedCondition.condition = ProductCanonicalConditionCondition.USED + Dim usedPartition As ProductPartition = helper.CreateUnit(root, usedCondition, 100000, False) + + Dim otherCondition As ProductPartition = helper.CreateSubdivision(root, _ + New ProductCanonicalCondition()) + + Dim coolBrand As New ProductBrand() + coolBrand.value = "CoolBrand" + helper.CreateUnit(otherCondition, coolBrand, 900000, False) + + Dim cheapBrand As New ProductBrand() + cheapBrand.value = "CheapBrand" + helper.CreateUnit(otherCondition, cheapBrand, 10000, False) + + Dim otherBrand As ProductPartition = helper.CreateSubdivision( _ + otherCondition, New ProductBrand()) + + ' The value for the bidding category is a fixed ID for the + ' Luggage & Bags' category. You can retrieve IDs for categories from the + ' ConstantDataService. See the 'GetProductCategoryTaxonomy' example for + ' more details. + + Dim luggageAndBags As New ProductBiddingCategory() + luggageAndBags.type = ProductDimensionType.BIDDING_CATEGORY_L1 + luggageAndBags.value = -5914235892932915235 + helper.CreateUnit(otherBrand, luggageAndBags, 750000, False) + + Dim everythingElse As New ProductBiddingCategory() + everythingElse.type = ProductDimensionType.BIDDING_CATEGORY_L1 + + helper.CreateUnit(otherBrand, everythingElse, 110000, False) + + Try + ' Make the mutate request. + Dim retval As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + helper.Operations) + + Dim children As New Dictionary(Of Long, List(Of ProductPartition)) + Dim rootNode As ProductPartition = Nothing + ' For each criterion, make an array containing each of its children + ' We always create the parent before the child, so we can rely on that + ' here. + For Each adGroupCriterion As AdGroupCriterion In retval.value + Dim newCriterion As ProductPartition = adGroupCriterion.criterion + children(newCriterion.id) = New List(Of ProductPartition) + + If (newCriterion.parentCriterionIdSpecified) Then + children(newCriterion.parentCriterionId).Add(newCriterion) + Else + rootNode = DirectCast(adGroupCriterion.criterion, ProductPartition) + End If + Next + + Dim writer As New StringWriter() + ' Show the tree + DisplayTree(rootNode, children, 0, writer) + Console.WriteLine(writer.ToString()) + Catch ex As Exception + Throw New System.ApplicationException("Failed to add bid modifiers to adgroup.", ex) + End Try + End Sub + + ''' + ''' Displays the product partition tree. + ''' + ''' The root node. + ''' The child node. + ''' The tree level. + ''' The stream to write output to. + Private Sub DisplayTree(ByVal node As ProductPartition, _ + ByVal children As Dictionary(Of Long, List(Of ProductPartition)), _ + ByVal level As Integer, ByVal writer As StringWriter) + ' Recursively display a node and each of its children + Dim value As Object = Nothing + Dim type As String = "" + + If Not (node.caseValue Is Nothing) Then + type = node.caseValue.ProductDimensionType + Select Case (type) + Case "ProductCanonicalCondition" + value = DirectCast(node.caseValue, ProductCanonicalCondition).condition.ToString() + Exit Select + + Case "ProductBiddingCategory" + value = DirectCast(node.caseValue, ProductBiddingCategory).type.ToString() & _ + "(" & DirectCast(node.caseValue, ProductBiddingCategory).value & ")" + Exit Select + + Case Else + value = node.caseValue.GetType().GetProperty("value").GetValue(node.caseValue, Nothing) + Exit Select + End Select + End If + + Console.WriteLine("{0}id: {1}, type: {2}, value: {3}", "".PadLeft(level, " "), _ + node.id, type, value) + For Each childNode As ProductPartition In children(node.id) + DisplayTree(childNode, children, level + 1, writer) + Next + End Sub + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201402/ShoppingCampaigns/AddProductScope.vb b/examples/AdWords/Vb/v201402/ShoppingCampaigns/AddProductScope.vb new file mode 100644 index 00000000000..2dfbecb37d8 --- /dev/null +++ b/examples/AdWords/Vb/v201402/ShoppingCampaigns/AddProductScope.vb @@ -0,0 +1,127 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example restricts the products that will be included in the + ''' campaign by setting a ProductScope. + ''' + ''' Tags: CampaignCriterionService.mutate + ''' + Public Class AddProductScope + Inherits ExampleBase + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example restricts the products that will be included in the " & _ + "campaign by setting a ProductScope." + End Get + End Property + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddProductScope + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The campaign id to add product scope. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignCriterionService. + Dim campaignCriterionService As CampaignCriterionService = user.GetService( _ + AdWordsService.v201402.CampaignCriterionService) + + Dim productScope As New ProductScope() + ' This set of dimensions is for demonstration purposes only. It would be + ' extremely unlikely that you want to include so many dimensions in your + ' product scope. + Dim nexusBrand As New ProductBrand() + nexusBrand.value = "Nexus" + + Dim newProducts As New ProductCanonicalCondition() + newProducts.condition = ProductCanonicalConditionCondition.NEW + + Dim customAttribute As New ProductCustomAttribute() + customAttribute.type = ProductDimensionType.CUSTOM_ATTRIBUTE_0 + customAttribute.value = "my attribute value" + + Dim bookOffer As New ProductOfferId() + bookOffer.value = "book1" + + Dim mediaProducts As New ProductType() + mediaProducts.type = ProductDimensionType.PRODUCT_TYPE_L1 + mediaProducts.value = "Media" + + Dim bookProducts As New ProductType() + bookProducts.type = ProductDimensionType.PRODUCT_TYPE_L2 + bookProducts.value = "Books" + + ' The value for the bidding category is a fixed ID for the + ' 'Luggage & Bags' category. You can retrieve IDs for categories from + ' the ConstantDataService. See the 'GetProductCategoryTaxonomy' example + ' for more details. + Dim luggageBiddingCategory As New ProductBiddingCategory() + luggageBiddingCategory.type = ProductDimensionType.BIDDING_CATEGORY_L1 + luggageBiddingCategory.value = -5914235892932915235 + + productScope.dimensions = New ProductDimension() {nexusBrand, newProducts, bookOffer, _ + mediaProducts, luggageBiddingCategory} + + Dim campaignCriterion As New CampaignCriterion() + campaignCriterion.campaignId = campaignId + campaignCriterion.criterion = productScope + + ' Create operation. + Dim operation As New CampaignCriterionOperation() + operation.operand = campaignCriterion + operation.operator = [Operator].ADD + + Try + ' Make the mutate request. + Dim result As CampaignCriterionReturnValue = campaignCriterionService.mutate( _ + New CampaignCriterionOperation() {operation}) + + Console.WriteLine("Created a ProductScope criterion with ID '{0}'", _ + result.value(0).criterion.id) + Catch ex As Exception + Throw New System.ApplicationException("Failed to set shopping product scope.", ex) + End Try + End Sub + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201402/ShoppingCampaigns/AddShoppingCampaign.vb b/examples/AdWords/Vb/v201402/ShoppingCampaigns/AddShoppingCampaign.vb new file mode 100644 index 00000000000..cd4d4b5fd01 --- /dev/null +++ b/examples/AdWords/Vb/v201402/ShoppingCampaigns/AddShoppingCampaign.vb @@ -0,0 +1,191 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example adds a Shopping campaign. + ''' + ''' Tags: CampaignService.mutate, AdGroupService.mutate + ''' Tags: AdGroupAdService.mutate + ''' + Public Class AddShoppingCampaign + Inherits ExampleBase + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a Shopping campaign." + End Get + End Property + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddShoppingCampaign + Console.WriteLine(codeExample.Description) + Try + Dim budgetId As Long = Long.Parse("INSERT_BUDGET_ID_HERE") + Dim merchantId As Long = Long.Parse("INSERT_MERCHANT_ID_HERE") + codeExample.Run(New AdWordsUser, budgetId, merchantId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The budget id. + ''' The Merchant Center account id. + Public Sub Run(ByVal user As AdWordsUser, ByVal budgetId As Long, ByVal merchantId As Long) + ' Get the required services. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201402.CampaignService) + Dim adGroupService As AdGroupService = user.GetService( _ + AdWordsService.v201402.AdGroupService) + Dim adGroupAdService As AdGroupAdService = user.GetService( _ + AdWordsService.v201402.AdGroupAdService) + + Try + Dim campaign As Campaign = CreateCampaign(budgetId, merchantId, campaignService) + Console.WriteLine("Campaign with name '{0}' and ID '{1}' was added.", campaign.name, _ + campaign.id) + + Dim adGroup As AdGroup = CreateAdGroup(adGroupService, campaign) + Console.WriteLine("Ad group with name '{0}' and ID '{1}' was added.", adGroup.name, _ + adGroup.id) + + Dim adGroupAd As AdGroupAd = CreateProductAd(adGroupAdService, adGroup) + Console.WriteLine("Product ad with ID {0}' was added.", adGroupAd.ad.id) + Catch ex As Exception + Throw New System.ApplicationException("Failed to create shopping campaign.", ex) + End Try + End Sub + + ''' + ''' Creates the Product Ad. + ''' + ''' The AdGroupAdService instance. + ''' The ad group. + ''' The Product Ad. + Private Function CreateProductAd(ByVal adGroupAdService As AdGroupAdService, _ + ByVal adGroup As AdGroup) As AdGroupAd + ' Create product ad. + Dim productAd As New ProductAd() + + ' Create ad group ad. + Dim adGroupAd As New AdGroupAd() + adGroupAd.adGroupId = adGroup.id + adGroupAd.ad = productAd + + ' Create operation. + Dim operation As New AdGroupAdOperation() + operation.operand = adGroupAd + operation.operator = [Operator].ADD + + ' Make the mutate request. + Dim retval As AdGroupAdReturnValue = adGroupAdService.mutate( _ + New AdGroupAdOperation() {operation}) + + Return retval.value(0) + End Function + + ''' + ''' Creates the ad group in a Shopping campaign. + ''' + ''' The AdGroupService instance. + ''' The Shopping campaign. + ''' The ad group. + Private Function CreateAdGroup(ByVal adGroupService As AdGroupService, _ + ByVal campaign As Campaign) As AdGroup + ' Create ad group. + Dim adGroup As New AdGroup() + adGroup.campaignId = campaign.id + adGroup.name = "Ad Group #" & ExampleUtilities.GetRandomString() + + ' Create operation. + Dim operation As New AdGroupOperation() + operation.operand = adGroup + operation.operator = [Operator].ADD + + ' Make the mutate request. + Dim retval As AdGroupReturnValue = adGroupService.mutate( _ + New AdGroupOperation() {operation}) + Return retval.value(0) + End Function + + ''' + ''' Creates the shopping campaign. + ''' + ''' The budget id. + ''' The Merchant Center id. + ''' The CampaignService instance. + ''' The Shopping campaign. + Private Function CreateCampaign(ByVal budgetId As Long, ByVal merchantId As Long, _ + ByVal campaignService As CampaignService) As Campaign + ' Create campaign. + Dim campaign As New Campaign() + campaign.name = "Shopping campaign #" & ExampleUtilities.GetRandomString() + ' The advertisingChannelType is what makes this a Shopping campaign. + campaign.advertisingChannelType = AdvertisingChannelType.SHOPPING + + ' Set shared budget (required). + campaign.budget = New Budget() + campaign.budget.budgetId = budgetId + + ' Set bidding strategy (required). + Dim biddingStrategyConfiguration As New BiddingStrategyConfiguration() + biddingStrategyConfiguration.biddingStrategyType = BiddingStrategyType.MANUAL_CPC + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration + + ' Set keyword matching setting (required). + Dim keywordMatchSetting As New KeywordMatchSetting() + keywordMatchSetting.optIn = False + + ' All Shopping campaigns need a ShoppingSetting. + Dim shoppingSetting As New ShoppingSetting() + shoppingSetting.salesCountry = "US" + shoppingSetting.campaignPriority = 0 + shoppingSetting.merchantId = merchantId + campaign.settings = New Setting() {keywordMatchSetting, shoppingSetting} + + ' Create operation. + Dim campaignOperation As New CampaignOperation() + campaignOperation.operand = campaign + campaignOperation.operator = [Operator].ADD + + ' Make the mutate request. + Dim retval As CampaignReturnValue = campaignService.mutate( _ + New CampaignOperation() {campaignOperation}) + + Return retval.value(0) + End Function + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201402/ShoppingCampaigns/GetProductCategoryTaxonomy.vb b/examples/AdWords/Vb/v201402/ShoppingCampaigns/GetProductCategoryTaxonomy.vb new file mode 100644 index 00000000000..e9a02122688 --- /dev/null +++ b/examples/AdWords/Vb/v201402/ShoppingCampaigns/GetProductCategoryTaxonomy.vb @@ -0,0 +1,183 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example fetches the set of valid ProductBiddingCategories. + ''' + ''' Tags: ConstantDataService.getProductBiddingCategoryData + ''' + Public Class GetProductCategoryTaxonomy + Inherits ExampleBase + + ''' + ''' Stores details about a product category and its hierarchy. + ''' + Class ProductCategory + ''' + ''' The product category id. + ''' + Private idField As Long + + ''' + ''' The product category name. + ''' + Private nameField As String + + ''' + ''' The product category children. + ''' + Private childrenField As New List(Of ProductCategory) + + ''' + ''' Gets or sets the product category id. + ''' + Public Property Id() As Long + Get + Return idField + End Get + Set(ByVal value As Long) + idField = value + End Set + End Property + + ''' + ''' Gets or sets the product category name. + ''' + Public Property Name() As String + Get + Return nameField + End Get + Set(ByVal value As String) + nameField = value + End Set + End Property + + ''' + ''' Gets or sets the product category children. + ''' + Public ReadOnly Property Children() As List(Of ProductCategory) + Get + Return childrenField + End Get + End Property + End Class + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example fetches the set of valid ProductBiddingCategories." + End Get + End Property + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetProductCategoryTaxonomy + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the ConstantDataService. + Dim constantDataService As ConstantDataService = user.GetService( _ + AdWordsService.v201402.ConstantDataService) + + Dim selector As New Selector() + + Dim predicate As New Predicate() + predicate.field = "Country" + predicate.operator = PredicateOperator.IN + predicate.values = New String() {"US"} + + Try + Dim results As ProductBiddingCategoryData() = _ + constantDataService.getProductBiddingCategoryData(selector) + + Dim biddingCategories As New Dictionary(Of Long, ProductCategory)() + Dim rootCategories As New List(Of ProductCategory)() + + For Each productBiddingCategory As ProductBiddingCategoryData In results + Dim id As Long = productBiddingCategory.dimensionValue.value + Dim parentId As Long = 0 + Dim name As String = productBiddingCategory.displayValue(0).value + + If Not (productBiddingCategory.parentDimensionValue Is Nothing) Then + parentId = productBiddingCategory.parentDimensionValue.value + End If + + If (biddingCategories.ContainsKey(id)) Then + biddingCategories.Add(id, New ProductCategory()) + End If + + Dim category As ProductCategory = biddingCategories(id) + + If (parentId <> 0) Then + If (biddingCategories.ContainsKey(parentId)) Then + biddingCategories.Add(parentId, New ProductCategory()) + End If + Dim parent As ProductCategory = biddingCategories(parentId) + parent.Children.Add(category) + Else + rootCategories.Add(category) + End If + + category.Id = id + category.Name = name + Next + + DisplayProductCategories(rootCategories, "") + Catch ex As Exception + Throw New System.ApplicationException("Failed to create shopping campaign.", ex) + End Try + End Sub + + ''' + ''' Displays the product categories. + ''' + ''' The product categories. + ''' The prefix for display purposes. + Sub DisplayProductCategories(ByVal categories As List(Of ProductCategory), _ + ByVal prefix As String) + For Each category As ProductCategory In categories + Console.WriteLine("{0}{1} [{2}]", prefix, category.Name, category.Id) + DisplayProductCategories(category.Children, String.Format("{0}{1} > ", _ + prefix, category.Name)) + Next + End Sub + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201402/ShoppingCampaigns/SetProductSalesChannel.vb b/examples/AdWords/Vb/v201402/ShoppingCampaigns/SetProductSalesChannel.vb new file mode 100644 index 00000000000..3ba8e53eb94 --- /dev/null +++ b/examples/AdWords/Vb/v201402/ShoppingCampaigns/SetProductSalesChannel.vb @@ -0,0 +1,104 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example sets the product sales channel. + ''' + ''' Tags: CampaignCriterionService.mutate + ''' + Public Class SetProductSalesChannel + Inherits ExampleBase + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example sets the product sales channel." + End Get + End Property + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New SetProductSalesChannel + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which shopping channel + ''' is set. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignCriterionService. + Dim campaignCriterionService As CampaignCriterionService = user.GetService( _ + AdWordsService.v201402.CampaignCriterionService) + + ' ProductSalesChannel is a fixed id criterion, with the possible values + ' defined here. + ' ONLINE: 200 + ' LOCAL: 201 + Dim productSalesChannel As New ProductSalesChannel() + productSalesChannel.id = 200 + + Dim campaignCriterion As New CampaignCriterion() + campaignCriterion.campaignId = campaignId + campaignCriterion.criterion = productSalesChannel + + ' Create operation. + Dim operation As New CampaignCriterionOperation() + operation.operand = campaignCriterion + operation.operator = [Operator].ADD + + Try + ' Make the mutate request. + Dim retVal As CampaignCriterionReturnValue = campaignCriterionService.mutate( _ + New CampaignCriterionOperation() {operation}) + + If ((Not (retVal Is Nothing)) AndAlso (Not (retVal.value Is Nothing))) Then + ' Display campaign targets. + For Each criterion As CampaignCriterion In retVal.value + Console.WriteLine("Campaign criteria of type '{0}' was set to campaign with" & _ + " id = '{1}'.", criterion.criterion.CriterionType, criterion.campaignId) + Next + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create shopping campaign.", ex) + End Try + End Sub + + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201402/Targeting/AddCampaignTargetingCriteria.vb b/examples/AdWords/Vb/v201402/Targeting/AddCampaignTargetingCriteria.vb new file mode 100644 index 00000000000..addda1fefaf --- /dev/null +++ b/examples/AdWords/Vb/v201402/Targeting/AddCampaignTargetingCriteria.vb @@ -0,0 +1,183 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example adds various types of targeting criteria to a campaign. + ''' To get a list of campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignCriterionService.mutate + ''' + Public Class AddCampaignTargetingCriteria + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddCampaignTargetingCriteria + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds various types of targeting criteria to a campaign. To " & _ + "get a list of campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to which targeting criteria + ''' are added. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignCriterionService. + Dim campaignCriterionService As CampaignCriterionService = user.GetService( _ + AdWordsService.v201402.CampaignCriterionService) + + ' Create language criteria. + ' See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + ' for a detailed list of language codes. + Dim language1 As New Language + language1.id = 1002 ' French + Dim languageCriterion1 As New CampaignCriterion + languageCriterion1.campaignId = campaignId + languageCriterion1.criterion = language1 + + Dim language2 As New Language + language2.id = 1005 ' Japanese + Dim languageCriterion2 As New CampaignCriterion + languageCriterion2.campaignId = campaignId + languageCriterion2.criterion = language2 + + ' Target Tier 3 income group near Miami, Florida. + Dim incomeLocationGroups As New LocationGroups + + Dim incomeOperand As New IncomeOperand + ' Tiers are numbered 1-10, and represent 10% segments of earners. + ' For example, TIER_1 is the top 10%, TIER_2 is the 80-90%, etc. + ' Tiers 6 through 10 are grouped into TIER_6_TO_10. + incomeOperand.tier = IncomeTier.TIER_3 + + Dim geoTargetOperand1 As New GeoTargetOperand + geoTargetOperand1.locations = New Long() {1015116} ' Miami, FL. + + incomeLocationGroups.matchingFunction = New [Function] + incomeLocationGroups.matchingFunction.lhsOperand = _ + New FunctionArgumentOperand() {incomeOperand} + incomeLocationGroups.matchingFunction.operator = FunctionOperator.AND + incomeLocationGroups.matchingFunction.rhsOperand = _ + New FunctionArgumentOperand() {geoTargetOperand1} + + Dim locationGroupCriterion1 As New CampaignCriterion + locationGroupCriterion1.campaignId = campaignId + locationGroupCriterion1.criterion = incomeLocationGroups + + ' Target places of interest near Downtown Miami, Florida. + Dim interestLocationGroups As New LocationGroups + + Dim placesOfInterestOperand As New PlacesOfInterestOperand() + placesOfInterestOperand.category = PlacesOfInterestOperandCategory.DOWNTOWN + + Dim geoTargetOperand2 As New GeoTargetOperand + geoTargetOperand2.locations = New Long() {1015116} ' Miami, FL. + + interestLocationGroups.matchingFunction = New [Function] + interestLocationGroups.matchingFunction.lhsOperand = _ + New FunctionArgumentOperand() {placesOfInterestOperand} + interestLocationGroups.matchingFunction.operator = FunctionOperator.AND + interestLocationGroups.matchingFunction.rhsOperand = _ + New FunctionArgumentOperand() {geoTargetOperand2} + + Dim locationGroupCriterion2 As New CampaignCriterion + locationGroupCriterion2.campaignId = campaignId + locationGroupCriterion2.criterion = interestLocationGroups + + ' Create location criteria. + ' See http://code.google.com/apis/adwords/docs/appendix/countrycodes.html + ' for a detailed list of country codes. + Dim location1 As New Location + location1.id = 2840 ' USA + Dim locationCriterion1 As New CampaignCriterion + locationCriterion1.campaignId = campaignId + locationCriterion1.criterion = location1 + + Dim location2 As New Location + location2.id = 2392 ' Japan + Dim locationCriterion2 As New CampaignCriterion + locationCriterion2.campaignId = campaignId + locationCriterion2.criterion = location2 + + ' Add a negative campaign keyword. + Dim negativeCriterion As New NegativeCampaignCriterion() + negativeCriterion.campaignId = campaignId + + Dim keyword As New Keyword() + keyword.matchType = KeywordMatchType.BROAD + keyword.text = "jupiter cruise" + + negativeCriterion.criterion = keyword + + Dim criteria() As CampaignCriterion = {languageCriterion1, languageCriterion2, _ + locationCriterion1, locationCriterion2, negativeCriterion, locationGroupCriterion1, _ + locationGroupCriterion2} + + Dim operations As New List(Of CampaignCriterionOperation) + + For Each criterion As CampaignCriterion In criteria + Dim operation As New CampaignCriterionOperation + operation.operator = [Operator].ADD + operation.operand = criterion + operations.Add(operation) + Next + + Try + ' Set the campaign targets. + Dim retVal As CampaignCriterionReturnValue = campaignCriterionService.mutate( _ + operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing)) Then + For Each criterion As CampaignCriterion In retVal.value + Console.WriteLine("Campaign criterion of type '{0}' was set to campaign with id " & _ + "= '{1}'.", criterion.criterion.CriterionType, criterion.campaignId) + Next + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to set campaign criteria.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/Targeting/GetCampaignTargetingCriteria.vb b/examples/AdWords/Vb/v201402/Targeting/GetCampaignTargetingCriteria.vb new file mode 100644 index 00000000000..30c8816dbb7 --- /dev/null +++ b/examples/AdWords/Vb/v201402/Targeting/GetCampaignTargetingCriteria.vb @@ -0,0 +1,123 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example gets all targeting criteria for a campaign. To set + ''' campaign targeting criteria, run AddCampaignTargetingCriteria.vb. To get + ''' campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignCriterionService.get + ''' + Public Class GetCampaignTargetingCriteria + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetCampaignTargetingCriteria + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all targeting criteria for a campaign. To set campaign " & _ + "targeting criteria, run AddCampaignTargetingCriteria.vb. To get campaigns, run " & _ + "GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign from which targeting + ''' criteria are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignCriterionService. + Dim campaignCriterionService As CampaignCriterionService = user.GetService( _ + AdWordsService.v201402.CampaignCriterionService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "CriteriaType", "CampaignId"} + + ' Set the filters. + Dim predicate As New Predicate + predicate.field = "CampaignId" + predicate.operator = PredicateOperator.EQUALS + predicate.values = New String() {campaignId.ToString} + + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New CampaignCriterionPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get all campaign targets. + page = campaignCriterionService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each campaignCriterion As CampaignCriterion In page.entries + Dim negative As String = "" + If (TypeOf campaignCriterion Is NegativeCampaignCriterion) Then + negative = "Negative " + End If + Console.WriteLine("{0}) {1}Campaign targeting criterion with id = '{2}' and " & _ + "Type = {3} was found for campaign id '{4}'", i, negative, _ + campaignCriterion.criterion.id, campaignCriterion.criterion.type, _ + campaignCriterion.campaignId) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of campaign targeting criteria found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get campaign targeting criteria.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/Targeting/GetTargetableLanguagesAndCarriers.vb b/examples/AdWords/Vb/v201402/Targeting/GetTargetableLanguagesAndCarriers.vb new file mode 100644 index 00000000000..aff5dd07865 --- /dev/null +++ b/examples/AdWords/Vb/v201402/Targeting/GetTargetableLanguagesAndCarriers.vb @@ -0,0 +1,100 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example illustrates how to retrieve all carriers and languages + ''' available for targeting. + ''' + ''' Tags: ConstantDataService.getCarrierCriterion + ''' Tags: ConstantDataService.getLanguageCriterion + ''' + Public Class GetTargetableLanguagesAndCarriers + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetTargetableLanguagesAndCarriers + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to retrieve all carriers and languages" & _ + "available for targeting." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the ConstantDataService. + Dim constantDataService As ConstantDataService = user.GetService( _ + AdWordsService.v201402.ConstantDataService) + + Try + ' Get all carriers. + Dim carriers As Carrier() = constantDataService.getCarrierCriterion + + ' Display the results. + If (Not carriers Is Nothing) Then + For Each carrier As Carrier In carriers + Console.WriteLine("Carrier name is '{0}', ID is {1} and country code is '{2}'.", _ + carrier.name, carrier.id, carrier.countryCode) + Next + Else + Console.WriteLine("No carriers were retrieved.") + End If + + ' Get all languages. + Dim languages As Language() = constantDataService.getLanguageCriterion + + ' Display the results. + If (Not languages Is Nothing) Then + For Each language As Language In languages + Console.WriteLine("Language name is '{0}', ID is {1} and code is '{2}'.", _ + language.name, language.id, language.code) + Next + Else + Console.WriteLine("No languages were found.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to get targetable carriers and languages.", _ + ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201402/Targeting/LookupLocation.vb b/examples/AdWords/Vb/v201402/Targeting/LookupLocation.vb new file mode 100644 index 00000000000..11e62fd259d --- /dev/null +++ b/examples/AdWords/Vb/v201402/Targeting/LookupLocation.vb @@ -0,0 +1,121 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example gets location criteria by name. + ''' + ''' Tags: LocationCriterionService.get + ''' + Public Class LookupLocation + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New LookupLocation + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets location criteria by name." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the LocationCriterionService. + Dim locationCriterionService As LocationCriterionService = user.GetService( _ + AdWordsService.v201402.LocationCriterionService) + + Dim locationNames As String() = New String() {"Paris", "Quebec", "Spain", "Deutschland"} + + Dim selector As New Selector + selector.fields = New String() {"Id", "LocationName", "CanonicalName", "DisplayType", _ + "ParentLocations", "Reach", "TargetingStatus"} + + ' Location names must match exactly, only EQUALS and IN are supported. + Dim predicate1 As New Predicate + predicate1.field = "LocationName" + predicate1.operator = PredicateOperator.IN + predicate1.values = locationNames + + ' Set the locale of the returned location names. + Dim predicate2 As New Predicate + predicate2.field = "Locale" + predicate2.operator = PredicateOperator.EQUALS + predicate2.values = New String() {"en"} + + selector.predicates = New Predicate() {predicate1, predicate2} + + Try + ' Make the get request. + Dim locationCriteria As LocationCriterion() = locationCriterionService.get(selector) + + ' Display the resulting location criteria. + For Each locationCriterion As LocationCriterion In locationCriteria + Dim parentLocations As String = "" + If ((Not locationCriterion.location Is Nothing) AndAlso ( _ + Not locationCriterion.location.parentLocations Is Nothing)) Then + For Each location As Location In locationCriterion.location.parentLocations + parentLocations = (parentLocations & Me.GetLocationString(location) & ", ") + Next + parentLocations.TrimEnd(New Char() {","c, " "c}) + Else + parentLocations = "N/A" + End If + Console.WriteLine("The search term '{0}' returned the location '{1}' of type '{2}' " & _ + "with parent locations '{3}', reach '{4}' and targeting status '{5}.", _ + locationCriterion.searchTerm, locationCriterion.location.locationName, _ + locationCriterion.location.displayType, parentLocations, locationCriterion.reach, _ + locationCriterion.location.targetingStatus) + Next + Catch ex As Exception + Throw New System.ApplicationException("Failed to get location criteria.", ex) + End Try + End Sub + + ''' + ''' Gets a string representation for a location. + ''' + ''' The location + ''' + Public Function GetLocationString(ByVal location As Location) As String + Return String.Format("{0} ({1})", location.locationName, location.displayType) + End Function + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/AccountManagement/CreateAccount.vb b/examples/AdWords/Vb/v201406/AccountManagement/CreateAccount.vb new file mode 100644 index 00000000000..6beb93c4901 --- /dev/null +++ b/examples/AdWords/Vb/v201406/AccountManagement/CreateAccount.vb @@ -0,0 +1,189 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Text + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example illustrates how to create an account. Note by default, + ''' this account will only be accessible via its parent MCC. + ''' + ''' Tags: ManagedCustomerService.mutate + ''' + Public Class CreateAccount + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New CreateAccount + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to create an account. Note by default," & _ + " this account will only be accessible via its parent MCC." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the ManagedCustomerService. + Dim managedCustomerService As ManagedCustomerService = user.GetService( _ + AdWordsService.v201406.ManagedCustomerService) + + ' Create account. + Dim customer As New ManagedCustomer() + customer.name = "Customer created with ManagedCustomerService on " & _ + New DateTime().ToString() + customer.currencyCode = "EUR" + customer.dateTimeZone = "Europe/London" + + ' Create operations. + Dim operation As New ManagedCustomerOperation() + operation.operand = customer + operation.operator = [Operator].ADD + Try + Dim operations As ManagedCustomerOperation() = New ManagedCustomerOperation() {operation} + ' Add account. + Dim result As ManagedCustomerReturnValue = managedCustomerService.mutate(operations) + + ' Display accounts. + If (Not result.value Is Nothing) AndAlso (result.value.Length > 0) Then + Dim customerResult As ManagedCustomer = result.value(0) + Console.WriteLine("Account with customer ID '{0}' was created.", _ + customerResult.customerId) + Else + Console.WriteLine("No accounts were created.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create accounts.", ex) + End Try + End Sub + End Class + + + ''' + '''Example implementation of a node that would exist in an account tree. + ''' + Class ManagedCustomerTreeNode + ''' + ''' The parent node. + ''' + Private _parentNode As ManagedCustomerTreeNode + + ''' + ''' The account associated with this node. + ''' + Private _account As ManagedCustomer + + ''' + ''' The list of child accounts. + ''' + Private _childAccounts As New List(Of ManagedCustomerTreeNode) + + ''' + ''' Gets or sets the parent node. + ''' + Public Property ParentNode() As ManagedCustomerTreeNode + Get + Return _parentNode + End Get + Set(ByVal value As ManagedCustomerTreeNode) + _parentNode = value + End Set + End Property + + + ''' + ''' Gets or sets the account. + ''' + Public Property Account() As ManagedCustomer + Get + Return _account + End Get + Set(ByVal value As ManagedCustomer) + _account = value + End Set + End Property + + ''' + ''' Gets or sets the child accounts. + ''' + Public Property ChildAccounts() As List(Of ManagedCustomerTreeNode) + Get + Return _childAccounts + End Get + Set(ByVal value As List(Of ManagedCustomerTreeNode)) + _childAccounts = value + End Set + End Property + + ''' + ''' Returns a that represents this instance. + ''' + ''' + ''' A that represents this instance. + ''' + Public Overrides Function ToString() As String + Dim login As String = "(no login)" + If (Not String.IsNullOrEmpty(_account.login)) Then + login = _account.login + End If + Return String.Format("{0}, {1}, {2}", login, _account.customerId, _account.name) + End Function + + ''' + ''' Returns a string representation of the current level of the tree and + ''' recursively returns the string representation of the levels below it. + ''' + ''' The depth of the node. + ''' The String Builder containing the tree + ''' representation. + ''' The tree string representation. + Public Function ToTreeString(ByVal depth As Integer, ByVal sb As StringBuilder) As StringBuilder + For i As Integer = 0 To depth * 2 + sb.Append("-") + Next + sb.Append(Me) + sb.Append("\n") + For Each childAccount As ManagedCustomerTreeNode In _childAccounts + childAccount.ToTreeString(depth + 1, sb) + Next + Return sb + End Function + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/AccountManagement/GetAccountAlerts.vb b/examples/AdWords/Vb/v201406/AccountManagement/GetAccountAlerts.vb new file mode 100644 index 00000000000..8b632a18b78 --- /dev/null +++ b/examples/AdWords/Vb/v201406/AccountManagement/GetAccountAlerts.vb @@ -0,0 +1,126 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example gets all alerts for all clients of an MCC account. + ''' The effective user (ClientCustomerId or AuthToken) must be an MCC user + ''' to get results. This code example won't work with Test Accounts. See + ''' https://developers.google.com/adwords/api/docs/test-accounts. + ''' + ''' Tags: AlertService.get + ''' + Public Class GetAccountAlerts + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAccountAlerts + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all alerts for all clients of an MCC account. The " & _ + "effective user (ClientCustomerId or AuthToken) must be an MCC user to get " & _ + "results. This code example won't work with Test Accounts. See " & _ + "https://developers.google.com/adwords/api/docs/test-accounts" + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the AlertService. + Dim alertService As AlertService = user.GetService(AdWordsService.v201406.AlertService) + + ' Create the selector. + Dim selector As New AlertSelector + + ' Create the alert query. + Dim query As New AlertQuery + query.filterSpec = FilterSpec.ALL + query.clientSpec = ClientSpec.ALL + query.triggerTimeSpec = TriggerTimeSpec.ALL_TIME + query.severities = New AlertSeverity() {AlertSeverity.GREEN, AlertSeverity.YELLOW, _ + AlertSeverity.RED} + + ' Enter all possible values of AlertType to get all alerts. If you are + ' interested only in specific alert types, then you may also do it as + ' follows: + ' query.types = new AlertType() {AlertType.CAMPAIGN_ENDING, + ' AlertType.CAMPAIGN_ENDED} + query.types = [Enum].GetValues(GetType(AlertType)) + selector.query = query + + ' Set paging for selector. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AlertPage + + Try + Do + ' Get account alerts. + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + page = alertService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each alert As Alert In page.entries + Console.WriteLine("{0}) Customer Id is {1:###-###-####}, Alert type is '{2}', " & _ + "Severity is {3}", (i + 1), alert.clientCustomerId, alert.alertType, _ + alert.alertSeverity) + For j As Integer = 0 To alert.details.Length - 1 + Console.WriteLine(" - Triggered at {0}", alert.details(j).triggerTime) + Next j + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of alerts found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve alerts.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/AccountManagement/GetAccountChanges.vb b/examples/AdWords/Vb/v201406/AccountManagement/GetAccountChanges.vb new file mode 100644 index 00000000000..bc597ec7474 --- /dev/null +++ b/examples/AdWords/Vb/v201406/AccountManagement/GetAccountChanges.vb @@ -0,0 +1,183 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Text + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example gets the changes in the account during the last 24 + ''' hours. + ''' + ''' Tags: CustomerSyncService.get + ''' + Public Class GetAccountChanges + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAccountChanges + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets the changes in the account during the last 24 hours." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the CustomerSyncService. + Dim customerSyncService As CustomerSyncService = user.GetService( _ + AdWordsService.v201406.CustomerSyncService) + + ' The date time string should be of the form yyyyMMdd HHmmss zzz. + Dim minDateTime As String = (DateTime.Now.AddDays(-1).ToUniversalTime.ToString( _ + "yyyyMMdd HHmmss") & " UTC") + Dim maxDateTime As String = (DateTime.Now.ToUniversalTime.ToString("yyyyMMdd HHmmss") & _ + " UTC") + + ' Create date time range. + Dim dateTimeRange As New DateTimeRange + dateTimeRange.min = minDateTime + dateTimeRange.max = maxDateTime + + Try + ' Create the selector. + Dim selector As New CustomerSyncSelector + selector.dateTimeRange = dateTimeRange + selector.campaignIds = GetAllCampaignIds(user) + + ' Get all account changes for campaign. + Dim accountChanges As CustomerChangeData = customerSyncService.get(selector) + + ' Display the changes. + If ((Not accountChanges Is Nothing) AndAlso _ + (Not accountChanges.changedCampaigns Is Nothing)) Then + Console.WriteLine("Displaying changes up to: {0}", accountChanges.lastChangeTimestamp) + + For Each campaignChanges As CampaignChangeData In accountChanges.changedCampaigns + Console.WriteLine("Campaign with id ""{0}"" was changed:", campaignChanges.campaignId) + Console.WriteLine(" Campaign changed status: {0}", _ + campaignChanges.campaignChangeStatus) + If (campaignChanges.campaignChangeStatus <> ChangeStatus.NEW) Then + Console.WriteLine(" Added ad extensions: {0}", _ + GetFormattedList(campaignChanges.addedAdExtensions)) + Console.WriteLine(" Added campaign criteria: {0}", _ + GetFormattedList(campaignChanges.addedCampaignCriteria)) + If (campaignChanges.campaignTargetingChanged) Then + Console.WriteLine(" Added campaign targeting: yes") + Else + Console.WriteLine(" Added campaign targeting: no") + End If + + Console.WriteLine(" Removed ad extensions: {0}", _ + GetFormattedList(campaignChanges.removedAdExtensions)) + Console.WriteLine(" Removed campaign criteria: {0}", _ + GetFormattedList(campaignChanges.removedCampaignCriteria)) + + If (Not campaignChanges.changedAdGroups Is Nothing) Then + For Each adGroupChanges As AdGroupChangeData In campaignChanges.changedAdGroups + Console.WriteLine(" Ad group with id ""{0}"" was changed:", _ + adGroupChanges.adGroupId) + Console.WriteLine(" Ad group changed status: {0}", _ + adGroupChanges.adGroupChangeStatus) + If (adGroupChanges.adGroupChangeStatus <> ChangeStatus.NEW) Then + Console.WriteLine(" Ads changed: {0}", _ + GetFormattedList(adGroupChanges.changedAds)) + Console.WriteLine(" Criteria changed: {0}", _ + GetFormattedList(adGroupChanges.changedCriteria)) + Console.WriteLine(" Criteria removed: {0}", _ + GetFormattedList(adGroupChanges.removedCriteria)) + End If + Next + End If + End If + Console.WriteLine() + Next + Else + Console.WriteLine("No account changes were found.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to get account changes.", ex) + End Try + End Sub + + ''' + ''' Formats a list of ids as a comma separated string. + ''' + ''' The list of ids. + ''' The comma separed formatted string, enclosed in square braces. + ''' + Private Function GetFormattedList(ByVal ids As Long()) As String + Dim builder As New StringBuilder + If (Not ids Is Nothing) Then + For Each id As Long In ids + builder.AppendFormat("{0}, ", id) + Next + End If + Return ("[" & builder.ToString.TrimEnd(New Char() {","c, " "c}) & "]") + End Function + + ''' + ''' Gets all campaign ids in the account. + ''' + ''' The user for which campaigns are retrieved. + ''' The list of campaign ids. + Private Function GetAllCampaignIds(ByVal user As AdWordsUser) As Long() + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201406.CampaignService) + + Dim allCampaigns As New List(Of Long) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id"} + + ' Get all campaigns. + Dim page As CampaignPage = campaignService.get(selector) + + ' Return the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + For Each campaign As Campaign In page.entries + allCampaigns.Add(campaign.id) + Next + End If + Return allCampaigns.ToArray + End Function + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/AccountManagement/GetAccountHierarchy.vb b/examples/AdWords/Vb/v201406/AccountManagement/GetAccountHierarchy.vb new file mode 100644 index 00000000000..61cddefba78 --- /dev/null +++ b/examples/AdWords/Vb/v201406/AccountManagement/GetAccountHierarchy.vb @@ -0,0 +1,126 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Text + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example illustrates how to retrieve the account hierarchy under + ''' an account. This code example won't work with Test Accounts. See + ''' https://developers.google.com/adwords/api/docs/test-accounts + ''' + ''' Tags: ServicedAccountService.get + ''' + Public Class GetAccountHierarchy + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAccountHierarchy + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to retrieve the account hierarchy under " & _ + "an account. This code example won't work with Test Accounts. See " & _ + "https://developers.google.com/adwords/api/docs/test-accounts" + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the ManagedCustomerService. + Dim mcService As ManagedCustomerService = user.GetService( _ + AdWordsService.v201406.ManagedCustomerService) + mcService.RequestHeader.clientCustomerId = Nothing + + ' Create selector. + Dim selector As New Selector() + selector.fields = New String() {"Login", "CustomerId", "Name"} + + Try + ' Get results. + Dim page As ManagedCustomerPage = mcService.get(selector) + + ' Display serviced account graph. + If Not page.entries Is Nothing Then + ' Create map from customerId to customer node. + Dim customerIdToCustomerNode As Dictionary(Of Long, ManagedCustomerTreeNode) = _ + New Dictionary(Of Long, ManagedCustomerTreeNode)() + + ' Create account tree nodes for each customer. + For Each customer As ManagedCustomer In page.entries + Dim node As New ManagedCustomerTreeNode() + node.Account = customer + customerIdToCustomerNode.Add(customer.customerId, node) + Next + + ' For each link, connect nodes in tree. + If (Not page.links Is Nothing) Then + For Each link As ManagedCustomerLink In page.links + Dim managerNode As ManagedCustomerTreeNode = _ + customerIdToCustomerNode(link.managerCustomerId) + Dim childNode As ManagedCustomerTreeNode = _ + customerIdToCustomerNode(link.clientCustomerId) + childNode.ParentNode = managerNode + If (Not managerNode Is Nothing) Then + managerNode.ChildAccounts.Add(childNode) + End If + Next + End If + + ' Find the root account node in the tree. + Dim rootNode As ManagedCustomerTreeNode = Nothing + For Each account As ManagedCustomer In page.entries + If (customerIdToCustomerNode(account.customerId).ParentNode Is Nothing) Then + rootNode = customerIdToCustomerNode(account.customerId) + Exit For + End If + Next + + ' Display account tree. + Console.WriteLine("Login, CustomerId, Name") + Console.WriteLine(rootNode.ToTreeString(0, New StringBuilder())) + Else + Console.WriteLine("No accounts were found.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to get accounts.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/AdvancedOperations/AddAdGroupBidModifier.vb b/examples/AdWords/Vb/v201406/AdvancedOperations/AddAdGroupBidModifier.vb new file mode 100644 index 00000000000..eb3fe125a5e --- /dev/null +++ b/examples/AdWords/Vb/v201406/AdvancedOperations/AddAdGroupBidModifier.vb @@ -0,0 +1,111 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: thagikura@gmail.com (Takeshi Hagikura) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example illustrates how to add ad group level mobile bid + ''' modifier override. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class AddAdGroupBidModifier + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAdGroupBidModifier + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim bidModifier As Double = Double.Parse("INSERT_ADGROUP_BID_MODIFIER_HERE") + codeExample.Run(New AdWordsUser, adGroupId, bidModifier) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to add ad group level mobile bid" & _ + " modifier override." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the adgroup for which bid modifier is + ''' set. + ''' The mobile bid modifier for adgroup + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal bidModifier As Double) + ' Get the AdGroupBidModifierService. + Dim adGroupBidModifierService As AdGroupBidModifierService = user.GetService( _ + AdWordsService.v201406.AdGroupBidModifierService) + + ' Mobile criterion ID. + Dim criterionId As Long = 30001 + + ' Create the adgroup bid modifier. + Dim adGroupBidModifier As New AdGroupBidModifier() + adGroupBidModifier.bidModifier = bidModifier + adGroupBidModifier.adGroupId = adGroupId + + Dim platform As New Platform() + platform.id = criterionId + + adGroupBidModifier.criterion = platform + + Dim operation As New AdGroupBidModifierOperation() + operation.operator = [Operator].ADD + operation.operand = adGroupBidModifier + + Try + ' Add ad group level mobile bid modifier. + Dim retval As AdGroupBidModifierReturnValue = adGroupBidModifierService.mutate( _ + New AdGroupBidModifierOperation() {operation}) + + ' Display the results. + If Not retval Is Nothing AndAlso Not retval.value Is Nothing AndAlso _ + retval.value.Length > 0 Then + Dim newBidModifier As AdGroupBidModifier = retval.value(0) + Console.WriteLine("AdGroup ID {0}, Criterion ID {1} was updated with ad group " & _ + "level modifier: {2}", newBidModifier.adGroupId, newBidModifier.criterion.id, _ + newBidModifier.bidModifier) + Else + Console.WriteLine("No bid modifiers were added to the adgroup.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add bid modifiers to adgroup.", ex) + End Try + End Sub + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201406/AdvancedOperations/AddClickToDownloadAd.vb b/examples/AdWords/Vb/v201406/AdvancedOperations/AddClickToDownloadAd.vb new file mode 100644 index 00000000000..f702b8e1e43 --- /dev/null +++ b/examples/AdWords/Vb/v201406/AdvancedOperations/AddClickToDownloadAd.vb @@ -0,0 +1,149 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: thagikura@gmail.com (Takeshi Hagikura) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example creates a click-to-download ad, also known as an + ''' app promotion ad to a given ad group. To list ad groups, run + ''' GetAdGroups.vb. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class AddClickToDownloadAd + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddClickToDownloadAd + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example creates a click-to-download ad, also known as an app " & _ + "promotion ad to a given ad group. To list ad groups, run GetAdGroups.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which ads are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim adGroupAdService As AdGroupAdService = _ + user.GetService(AdWordsService.v201406.AdGroupAdService) + + ' Create the template ad. + Dim clickToDownloadAppAd As New TemplateAd() + + clickToDownloadAppAd.name = "Ad for demo game" + clickToDownloadAppAd.templateId = 353 + clickToDownloadAppAd.url = _ + "http://play.google.com/store/apps/details?id=com.example.demogame" + clickToDownloadAppAd.displayUrl = "play.google.com" + + ' Create the template elements for the ad. You can refer to + ' https://developers.google.com/adwords/api/docs/appendix/templateads + ' for the list of avaliable template fields. + Dim headline As New TemplateElementField() + headline.name = "headline" + headline.fieldText = "Enjoy your drive in Mars" + headline.type = TemplateElementFieldType.TEXT + + Dim description1 As New TemplateElementField() + description1.name = "description1" + description1.fieldText = "Realistic physics simulation" + description1.type = TemplateElementFieldType.TEXT + + Dim description2 As New TemplateElementField() + description2.name = "description2" + description2.fieldText = "Race against players online" + description2.type = TemplateElementFieldType.TEXT + + Dim appId As New TemplateElementField() + appId.name = "appId" + appId.fieldText = "com.example.demogame" + appId.type = TemplateElementFieldType.TEXT + + Dim appStore As New TemplateElementField() + appStore.name = "appStore" + appStore.fieldText = "2" + appStore.type = TemplateElementFieldType.ENUM + + Dim adData As New TemplateElement() + adData.uniqueName = "adData" + adData.fields = New TemplateElementField() {headline, description1, description2, appId, _ + appStore} + + clickToDownloadAppAd.templateElements = New TemplateElement() {adData} + + ' Create the adgroupad. + Dim clickToDownloadAppAdGroupAd As New AdGroupAd() + clickToDownloadAppAdGroupAd.adGroupId = adGroupId + clickToDownloadAppAdGroupAd.ad = clickToDownloadAppAd + + ' Optional: Set the status. + clickToDownloadAppAdGroupAd.status = AdGroupAdStatus.PAUSED + + ' Create the operation. + Dim operation As New AdGroupAdOperation() + operation.operator = [Operator].ADD + operation.operand = clickToDownloadAppAdGroupAd + + Try + ' Create the ads. + Dim retval As AdGroupAdReturnValue = adGroupAdService.mutate(New AdGroupAdOperation() _ + {operation}) + + ' Display the results. + If Not retval Is Nothing AndAlso Not retval.value Is Nothing Then + For Each adGroupAd As AdGroupAd In retval.value + Console.WriteLine("New click-to-download ad with id = '{0}' and url = '{1}' " & _ + "was created.", adGroupAd.ad.id, adGroupAd.ad.url) + Next + Else + Console.WriteLine("No click-to-download ads were created.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create click-to-download ad.", ex) + End Try + End Sub + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201406/AdvancedOperations/AddPlacesLocationExtension.vb b/examples/AdWords/Vb/v201406/AdvancedOperations/AddPlacesLocationExtension.vb new file mode 100644 index 00000000000..112bd4831cc --- /dev/null +++ b/examples/AdWords/Vb/v201406/AdvancedOperations/AddPlacesLocationExtension.vb @@ -0,0 +1,198 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 +Imports Google.Api.Ads.Common.Lib + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds a feed that syncs feed items from a Google + ''' Places account and associates the feed with a customer. + ''' + ''' Tags: CustomerFeedService.mutate, FeedItemService.mutate + ''' Tags: FeedMappingService.mutate, FeedService.mutate + ''' + Public Class AddPlacesLocationExtension + Inherits ExampleBase + + ''' + ''' The placeholder type for location extensions. See the Placeholder + ''' reference page for a list of all the placeholder types and fields. + ''' + ''' https://developers.google.com/adwords/api/docs/appendix/placeholders + ''' + Private Const PLACEHOLDER_LOCATION As Integer = 7 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddPlacesLocationExtension + Console.WriteLine(codeExample.Description) + Try + Dim placesEmailAddress As String = "INSERT_PLACES_EMAIL_ADDRESS_HERE" + Dim placesAccessToken As String = "INSERT_PLACES_ACCESS_TOKEN_HERE" + + codeExample.Run(New AdWordsUser, placesEmailAddress, placesAccessToken) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a feed that syncs feed items from a Google Places " & _ + "account and associates the feed with a customer." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The email address for Google Places + ''' account. + ''' The OAuth2 access token for Google + ''' Places account. + Public Sub Run(ByVal user As AdWordsUser, ByVal placesEmailAddress As String, _ + ByVal placesAccessToken As String) + ' Get the FeedService. + Dim feedService As FeedService = user.GetService(AdWordsService.v201406.FeedService) + + ' Get the CustomerFeedService. + Dim customerFeedService As CustomerFeedService = user.GetService( _ + AdWordsService.v201406.CustomerFeedService) + + ' Create a feed that will sync to the Google Places account specified + ' by placesEmailAddress. Do not add FeedAttributes to this object, + ' as AdWords will add them automatically because this will be a + ' system generated feed. + Dim placesFeed As New Feed() + placesFeed.name = String.Format("Places feed #{0}", ExampleUtilities.GetRandomString()) + + Dim feedData As New PlacesLocationFeedData() + feedData.emailAddress = placesEmailAddress + + Dim oAuthInfo As New OAuthInfo() + oAuthInfo.httpMethod = "GET" + oAuthInfo.httpRequestUrl = "https://www.google.com/local/add" + oAuthInfo.httpAuthorizationHeader = String.Format("Bearer {0}", placesAccessToken) + feedData.oAuthInfo = oAuthInfo + + placesFeed.systemFeedGenerationData = feedData + + ' Since this feed's feed items will be managed by AdWords, + ' you must set its origin to ADWORDS. + placesFeed.origin = FeedOrigin.ADWORDS + + ' Create an operation to add the feed. + Dim feedOperation As New FeedOperation() + feedOperation.operand = placesFeed + feedOperation.operator = [Operator].ADD + + Try + ' Add the feed. Since it is a system generated feed, AdWords will + ' automatically: + ' 1. Set up the FeedAttributes on the feed. + ' 2. Set up a FeedMapping that associates the FeedAttributes of the + ' Feed with the placeholder fields of the LOCATION placeholder type. + Dim addFeedResult As FeedReturnValue = feedService.mutate( _ + New FeedOperation() {feedOperation}) + Dim addedFeed As Feed = addFeedResult.value(0) + Console.WriteLine("Added places feed with ID {0}", addedFeed.id) + + ' Add a CustomerFeed that associates the feed with this customer for + ' the LOCATION placeholder type. + Dim customerFeed As New CustomerFeed() + customerFeed.feedId = addedFeed.id + customerFeed.placeholderTypes = New Integer() {PLACEHOLDER_LOCATION} + + ' Create a matching function that will always evaluate to true. + Dim customerMatchingFunction As New [Function]() + Dim constOperand As New ConstantOperand() + constOperand.type = ConstantOperandConstantType.BOOLEAN + constOperand.booleanValue = True + customerMatchingFunction.lhsOperand = New FunctionArgumentOperand() {constOperand} + customerMatchingFunction.operator = FunctionOperator.IDENTITY + customerFeed.matchingFunction = customerMatchingFunction + + ' Create an operation to add the customer feed. + Dim customerFeedOperation As New CustomerFeedOperation() + customerFeedOperation.operand = customerFeed + customerFeedOperation.operator = [Operator].ADD + + ' After the completion of the Feed ADD operation above the added feed + ' will not be available for usage in a CustomerFeed until the sync + ' between the AdWords and Places accounts completes. The loop below + ' will retry adding the CustomerFeed up to ten times with an + ' exponential back-off policy. + Dim addedCustomerFeed As CustomerFeed = Nothing + + Dim config As New AdWordsAppConfig() + config.RetryCount = 10 + + Dim errorHandler As New ErrorHandler(config) + Do + Try + Dim customerFeedResult As CustomerFeedReturnValue = _ + customerFeedService.mutate(New CustomerFeedOperation() {customerFeedOperation}) + addedCustomerFeed = customerFeedResult.value(0) + + Console.WriteLine("Added CustomerFeed for feed ID {0} and placeholder type {1}", _ + addedCustomerFeed.feedId, addedCustomerFeed.placeholderTypes(0)) + Exit Try + Catch e As AdWordsApiException + Dim apiException As ApiException = e.ApiException + For Each apiError As ApiError In apiException.errors + If TypeOf apiError Is CustomerFeedError Then + If (DirectCast(apiError, CustomerFeedError).reason = _ + CustomerFeedErrorReason.MISSING_FEEDMAPPING_FOR_PLACEHOLDER_TYPE) Then + errorHandler.DoExponentialBackoff() + errorHandler.IncrementRetriedAttempts() + Else + Throw + End If + End If + Next + + End Try + Loop While (errorHandler.HaveMoreRetryAttemptsLeft()) + + ' OPTIONAL: Create a CampaignFeed to specify which FeedItems to use at + ' the Campaign level. This will be similar to the CampaignFeed in the + ' AddSiteLinks example, except you can also filter based on the + ' business name and category of each FeedItem by using a + ' FeedAttributeOperand in your matching function. + + ' OPTIONAL: Create an AdGroupFeed for even more fine grained control + ' over which feed items are used at the AdGroup level. + Catch ex As Exception + Throw New System.ApplicationException("Failed to create customer feed.", ex) + End Try + End Sub + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201406/AdvancedOperations/AddSiteLinks.vb b/examples/AdWords/Vb/v201406/AdvancedOperations/AddSiteLinks.vb new file mode 100644 index 00000000000..f1c0ad0ec59 --- /dev/null +++ b/examples/AdWords/Vb/v201406/AdvancedOperations/AddSiteLinks.vb @@ -0,0 +1,319 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: thagikura@gmail.com (Takeshi Hagikura) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + + Public Class SiteLinksDataHolder + Dim siteLinksFeedIdField As Long + Dim linkTextFeedAttributeIdField As Long + Dim linkUrlFeedAttributeIdField As Long + Dim siteLinkFeedItemIdsField As New List(Of Long) + + Public Property SiteLinksFeedId As Long + Get + Return siteLinksFeedIdField + End Get + Set(ByVal value As Long) + siteLinksFeedIdField = value + End Set + End Property + + Public Property LinkTextFeedAttributeId As Long + Get + Return linkTextFeedAttributeIdField + End Get + Set(ByVal value As Long) + linkTextFeedAttributeIdField = value + End Set + End Property + + Public Property LinkUrlFeedAttributeId As Long + Get + Return linkUrlFeedAttributeIdField + End Get + Set(ByVal value As Long) + linkUrlFeedAttributeIdField = value + End Set + End Property + + Public Property SiteLinkFeedItemIds As List(Of Long) + Get + Return siteLinkFeedItemIdsField + End Get + Set(ByVal value As List(Of Long)) + siteLinkFeedItemIdsField = value + End Set + End Property + End Class + + ''' + ''' This code example adds a sitelinks feed and associates it with a campaign. + ''' To create a campaign, run AddCampaign.cs. + ''' + ''' Tags: CampaignFeedService.mutate, FeedService.mutate, FeedItemService.mutate, + ''' Tags: FeedMappingService.mutate + ''' + Public Class AddSiteLinks + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddSiteLinks + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a sitelinks feed and associates it with a campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign with which sitelinks are associated. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + Dim siteLinksData As New SiteLinksDataHolder + createSiteLinksFeed(user, siteLinksData) + createSiteLinksFeedItems(user, siteLinksData) + createSiteLinksFeedMapping(user, siteLinksData) + createSiteLinksCampaignFeed(user, siteLinksData, campaignId) + End Sub + + Private Sub createSiteLinksFeed( _ + ByVal user As AdWordsUser, ByVal siteLinksData As SiteLinksDataHolder) + ' Get the FeedService. + Dim feedService As FeedService = user.GetService(AdWordsService.v201406.FeedService) + + ' Create attributes. + Dim textAttribute As New FeedAttribute + textAttribute.type = FeedAttributeType.STRING + textAttribute.name = "Link Text" + Dim urlAttribute As New FeedAttribute + urlAttribute.type = FeedAttributeType.URL + urlAttribute.name = "Link URL" + + ' Create the feed. + Dim siteLinksFeed As New Feed + siteLinksFeed.name = "Feed For Site Links" + siteLinksFeed.attributes = New FeedAttribute() {textAttribute, urlAttribute} + siteLinksFeed.origin = FeedOrigin.USER + + ' Create operation. + Dim operation As New FeedOperation + operation.operand = siteLinksFeed + operation.operator = [Operator].ADD + + ' Add the feed. + Dim result As FeedReturnValue = feedService.mutate(New FeedOperation() {operation}) + + Dim savedFeed As Feed = result.value(0) + + siteLinksData.SiteLinksFeedId = savedFeed.id + Dim savedAttributes As FeedAttribute() = savedFeed.attributes + siteLinksData.LinkTextFeedAttributeId = savedAttributes(0).id + siteLinksData.LinkUrlFeedAttributeId = savedAttributes(1).id + Console.WriteLine("Feed with name {0} and ID {1} with linkTextAttributeId {2}" & _ + "linkUrlAttributeId {3} was created.", savedFeed.name, savedFeed.id, _ + savedAttributes(0).id, savedAttributes(1).id) + End Sub + + Private Sub createSiteLinksFeedItems( _ + ByVal user As AdWordsUser, ByVal siteLinksData As SiteLinksDataHolder) + ' Get the FeedItemService. + Dim feedItemService As FeedItemService = _ + user.GetService(AdWordsService.v201406.FeedItemService) + + ' Create operations to add FeedItems. + Dim home As FeedItemOperation = _ + newSiteLinkFeedItemAddOperation(siteLinksData, "Home", "http://www.example.com") + Dim stores As FeedItemOperation = _ + newSiteLinkFeedItemAddOperation(siteLinksData, "Stores", "http://www.example.com/stores") + Dim onSale As FeedItemOperation = _ + newSiteLinkFeedItemAddOperation(siteLinksData, "On Sale", "http://www.example.com/sale") + Dim support As FeedItemOperation = _ + newSiteLinkFeedItemAddOperation(siteLinksData, "Support", _ + "http://www.example.com/support") + Dim products As FeedItemOperation = _ + newSiteLinkFeedItemAddOperation(siteLinksData, "Products", "http://www.example.com/prods") + Dim aboutUs As FeedItemOperation = _ + newSiteLinkFeedItemAddOperation(siteLinksData, "About Us", "http://www.example.com/about") + + Dim operations As FeedItemOperation() = _ + New FeedItemOperation() {home, stores, onSale, support, products, aboutUs} + + Dim result As FeedItemReturnValue = feedItemService.mutate(operations) + For Each item As FeedItem In result.value + Console.WriteLine("FeedItem with feedItemId {0} was added.", item.feedItemId) + siteLinksData.SiteLinkFeedItemIds.Add(item.feedItemId) + Next + End Sub + + ' See the Placeholder reference page for a list of all the placeholder types and fields. + ' https://developers.google.com/adwords/api/docs/appendix/placeholders.html + Private Const PLACEHOLDER_SITELINKS As Integer = 1 + + ' See the Placeholder reference page for a list of all the placeholder types and fields. + Private Const PLACEHOLDER_FIELD_SITELINK_LINK_TEXT As Integer = 1 + Private Const PLACEHOLDER_FIELD_SITELINK_URL As Integer = 2 + + Private Sub createSiteLinksFeedMapping( _ + ByVal user As AdWordsUser, ByVal siteLinksData As SiteLinksDataHolder) + ' Get the FeedItemService. + Dim feedMappingService As FeedMappingService = _ + user.GetService(AdWordsService.v201406.FeedMappingService) + + ' Map the FeedAttributeIds to the fieldId constants. + Dim linkTextFieldMapping As New AttributeFieldMapping + linkTextFieldMapping.feedAttributeId = siteLinksData.LinkTextFeedAttributeId + linkTextFieldMapping.fieldId = PLACEHOLDER_FIELD_SITELINK_LINK_TEXT + Dim linkUrlFieldMapping As New AttributeFieldMapping + linkUrlFieldMapping.feedAttributeId = siteLinksData.LinkUrlFeedAttributeId + linkUrlFieldMapping.fieldId = PLACEHOLDER_FIELD_SITELINK_URL + + ' Create the FieldMapping and operation. + Dim feedMapping As New FeedMapping + feedMapping.placeholderType = PLACEHOLDER_SITELINKS + feedMapping.feedId = siteLinksData.SiteLinksFeedId + feedMapping.attributeFieldMappings = _ + New AttributeFieldMapping() {linkTextFieldMapping, linkUrlFieldMapping} + Dim operation As New FeedMappingOperation + operation.operand = feedMapping + operation.operator = [Operator].ADD + + ' Save the field mapping. + Dim result As FeedMappingReturnValue = _ + feedMappingService.mutate(New FeedMappingOperation() {operation}) + For Each savedFeedMapping As FeedMapping In result.value + Console.WriteLine("Feed mapping with ID {0} and placeholderType {1} was saved for " & _ + "feed with ID {2}.", savedFeedMapping.feedMappingId, savedFeedMapping.placeholderType, _ + savedFeedMapping.feedId) + Next + End Sub + + Private Sub createSiteLinksCampaignFeed(ByVal user As AdWordsUser, _ + ByVal siteLinksData As SiteLinksDataHolder, ByVal campaignId As Long) + ' Get the CampaignFeedService. + Dim campaignFeedService As CampaignFeedService = _ + user.GetService(AdWordsService.v201406.CampaignFeedService) + + ' Map the feed item ids to the campaign using an IN operation. + Dim feedItemRequestContextOperand As New RequestContextOperand() + feedItemRequestContextOperand.contextType = RequestContextOperandContextType.FEED_ITEM_ID + + Dim feedItemOperands As New List(Of FunctionArgumentOperand)() + For Each feedItemId As Long In siteLinksData.SiteLinkFeedItemIds + Dim feedItemOperand As New ConstantOperand() + feedItemOperand.longValue = feedItemId + feedItemOperand.type = ConstantOperandConstantType.LONG + feedItemOperands.Add(feedItemOperand) + Next + + Dim feedItemfunction As New [Function]() + feedItemfunction.lhsOperand = New FunctionArgumentOperand() {feedItemRequestContextOperand} + feedItemfunction.operator = FunctionOperator.IN + feedItemfunction.rhsOperand = feedItemOperands.ToArray() + + ' Optional: to target to a platform, define a function and 'AND' it with + ' the feed item ID link: + Dim platformRequestContextOperand As New RequestContextOperand() + platformRequestContextOperand.contextType = RequestContextOperandContextType.DEVICE_PLATFORM + + Dim platformOperand As New ConstantOperand() + platformOperand.stringValue = "Mobile" + platformOperand.type = ConstantOperandConstantType.STRING + + Dim platformFunction As New [Function]() + platformFunction.lhsOperand = New FunctionArgumentOperand() {platformRequestContextOperand} + platformFunction.operator = FunctionOperator.EQUALS + platformFunction.rhsOperand = New FunctionArgumentOperand() {platformOperand} + + ' Combine the two functions using an AND operation. + Dim feedItemFunctionOperand As New FunctionOperand() + feedItemFunctionOperand.value = feedItemfunction + + Dim platformFunctionOperand As New FunctionOperand() + platformFunctionOperand.value = platformFunction + + Dim combinedFunction As New [Function]() + combinedFunction.operator = FunctionOperator.AND + combinedFunction.lhsOperand = New FunctionArgumentOperand() { _ + feedItemFunctionOperand, platformFunctionOperand} + + Dim campaignFeed As New CampaignFeed() + campaignFeed.feedId = siteLinksData.SiteLinksFeedId + campaignFeed.campaignId = campaignId + campaignFeed.matchingFunction = combinedFunction + ' Specifying placeholder types on the CampaignFeed allows the same feed + ' to be used for different placeholders in different Campaigns. + campaignFeed.placeholderTypes = New Integer() {PLACEHOLDER_SITELINKS} + + Dim operation As New CampaignFeedOperation + operation.operand = CampaignFeed + operation.operator = [Operator].ADD + Dim result As CampaignFeedReturnValue = _ + campaignFeedService.mutate(New CampaignFeedOperation() {operation}) + For Each savedCampaignFeed As CampaignFeed In result.value + Console.WriteLine("Campaign with ID {0} was associated with feed with ID {1}", _ + savedCampaignFeed.campaignId, savedCampaignFeed.feedId) + Next + End Sub + + Function newSiteLinkFeedItemAddOperation(ByVal siteLinksData As SiteLinksDataHolder, _ + ByVal text As String, ByVal url As String) As FeedItemOperation + ' Create the FeedItemAttributeValues for our text values. + Dim linkTextAttributeValue As New FeedItemAttributeValue + linkTextAttributeValue.feedAttributeId = siteLinksData.LinkTextFeedAttributeId + linkTextAttributeValue.stringValue = text + Dim linkUrlAttributeValue As New FeedItemAttributeValue + linkUrlAttributeValue.feedAttributeId = siteLinksData.LinkUrlFeedAttributeId + linkUrlAttributeValue.stringValue = url + + ' Create the feed item and operation. + Dim item As New FeedItem + item.feedId = siteLinksData.SiteLinksFeedId + item.attributeValues = _ + New FeedItemAttributeValue() {linkTextAttributeValue, linkUrlAttributeValue} + Dim Operation As New FeedItemOperation + Operation.operand = item + Operation.operator = [Operator].ADD + Return Operation + End Function + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201406/AdvancedOperations/AddTextAdWithUpgradedUrls.vb b/examples/AdWords/Vb/v201406/AdvancedOperations/AddTextAdWithUpgradedUrls.vb new file mode 100644 index 00000000000..2e46ac2e2e5 --- /dev/null +++ b/examples/AdWords/Vb/v201406/AdvancedOperations/AddTextAdWithUpgradedUrls.vb @@ -0,0 +1,159 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: thagikura@gmail.com (Takeshi Hagikura) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds a text ad that uses upgraded URLs. This example + ''' will only work if your account is a test account or is whitelisted for + ''' this feature. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class AddTextAdWithUpgradedUrls + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddTextAdWithUpgradedUrls + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a text ad that uses upgraded URLs. This example " & _ + " will only work if your account is a test account or is whitelisted for" & _ + " this feature." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' ID of the adgroup to which ad is added. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201406.AdGroupAdService) + + ' Create the text ad. + Dim textAd As New TextAd + textAd.headline = "Luxury Cruise to Mars" + textAd.description1 = "Visit the Red Planet in style." + textAd.description2 = "Low-gravity fun for everyone!" + textAd.displayUrl = "www.example.com" + + ' Specify a tracking URL for 3rd party tracking provider. You may + ' specify one at customer, campaign, ad group, ad, criterion or + ' feed item levels. + textAd.trackingUrlTemplate = _ + "http://tracker.example.com/?cid={_season}&promocode={_promocode}&u={lpurl}" + + ' Since your tracking URL has two custom parameters, provide their + ' values too. This can be provided at campaign, ad group, ad, criterion + ' or feed item levels. + Dim seasonParameter As New CustomParameter + seasonParameter.key = "season" + seasonParameter.value = "christmas" + + Dim promoCodeParameter As New CustomParameter + promoCodeParameter.key = "promocode" + promoCodeParameter.value = "NYC123" + + textAd.urlCustomParameters = New CustomParameters + textAd.urlCustomParameters.parameters = _ + New CustomParameter() {seasonParameter, promoCodeParameter} + + ' Specify a list of final URLs. This field cannot be set if URL field is + ' set. This may be specified at ad, criterion and feed item levels. + textAd.finalUrls = New String() { _ + "http://www.example.com/cruise/space/", _ + "http://www.example.com/locations/mars/" _ + } + + ' Specify a list of final mobile URLs. This field cannot be set if URL + ' field is set, or finalUrls is unset. This may be specified at ad, + ' criterion and feed item levels. + textAd.finalMobileUrls = New String() { _ + "http://mobile.example.com/cruise/space/", _ + "http://mobile.example.com/locations/mars/" _ + } + + Dim textAdGroupAd As New AdGroupAd + textAdGroupAd.adGroupId = adGroupId + textAdGroupAd.ad = textAd + + ' Optional: Set the status. + textAdGroupAd.status = AdGroupAdStatus.PAUSED + + ' Create the operation. + Dim operation As New AdGroupAdOperation + operation.operator = [Operator].ADD + operation.operand = textAdGroupAd + + Dim retVal As AdGroupAdReturnValue = Nothing + + Try + ' Create the ads. + retVal = service.mutate(New AdGroupAdOperation() {operation}) + + ' Display the results. + If Not (retVal Is Nothing) AndAlso Not (retVal.value Is Nothing) Then + Dim newAdGroupAd As AdGroupAd = retVal.value(0) + Console.WriteLine("New text ad with ID = {0} and display URL = '{1}' was " & _ + "created.", newAdGroupAd.ad.id, newAdGroupAd.ad.displayUrl) + Console.WriteLine("Upgraded URL properties:") + Dim newTextAd As TextAd = newAdGroupAd.ad + + Console.WriteLine(" Final URLs: {0}", String.Join(", ", newTextAd.finalUrls)) + Console.WriteLine(" Final Mobile URLS: {0}", _ + String.Join(", ", newTextAd.finalMobileUrls)) + Console.WriteLine(" Tracking URL template: {0}", newTextAd.trackingUrlTemplate) + + Dim parameters As New List(Of String) + For Each customParam As CustomParameter In newTextAd.urlCustomParameters.parameters + parameters.Add(String.Format("{0}={1}", customParam.key, customParam.value)) + Next + Console.WriteLine(" Custom parameters: {0}", String.Join(", ", parameters.ToArray())) + Else + Console.WriteLine("No text ads were created.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add ad to adgroup.", ex) + End Try + End Sub + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201406/AdvancedOperations/GetAdGroupBidModifiers.vb b/examples/AdWords/Vb/v201406/AdvancedOperations/GetAdGroupBidModifiers.vb new file mode 100644 index 00000000000..b10323ee2e8 --- /dev/null +++ b/examples/AdWords/Vb/v201406/AdvancedOperations/GetAdGroupBidModifiers.vb @@ -0,0 +1,125 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example illustrates how to retrieve ad group level mobile bid + ''' modifiers for a campaign. + ''' + ''' AdGroupBidModifierService.get + ''' + Public Class GetAdGroupBidModifiers + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAdGroupBidModifiers + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to retrieve ad group level mobile bid" & _ + " modifiers for a campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which adgroup bid + ''' modifiers are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupBidModifierService. + Dim adGroupBidModifierService As AdGroupBidModifierService = user.GetService( _ + AdWordsService.v201406.AdGroupBidModifierService) + + Const PAGE_SIZE As Integer = 500 + + ' Get all ad group bid modifiers for the campaign. + Dim selector As New Selector() + selector.fields = New String() {"CampaignId", "AdGroupId", "BidModifier", _ + "BidModifierSource", "CriteriaType", "Id"} + + Dim predicate As New Predicate() + predicate.field = "CampaignId" + predicate.[operator] = PredicateOperator.EQUALS + predicate.values = New String() {campaignId.ToString()} + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging() + + Dim offset As Integer = 0 + Dim pageSize As Integer = PAGE_SIZE + + Dim page As New AdGroupBidModifierPage() + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the campaigns. + page = adGroupBidModifierService.get(selector) + + ' Display the results. + If (Not page Is Nothing) AndAlso (Not page.entries Is Nothing) Then + Dim i As Integer = offset + For Each adGroupBidModifier As AdGroupBidModifier In page.entries + Dim bidModifier As String = "" + If adGroupBidModifier.bidModifierSpecified Then + bidModifier = adGroupBidModifier.bidModifier.ToString() + Else + bidModifier = "UNSET" + End If + Console.WriteLine("{0}) Campaign ID {1}, AdGroup ID {2}, Criterion ID {3} has " & _ + "ad group level modifier: {4}, source = {5}.", _ + i + 1, adGroupBidModifier.campaignId, _ + adGroupBidModifier.adGroupId, adGroupBidModifier.criterion.id, _ + bidModifier, adGroupBidModifier.bidModifierSource) + i = i + 1 + Next + End If + offset += pageSize + Loop While offset < page.totalNumEntries + Console.WriteLine("Number of adgroup bid modifiers found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve adgroup bid modifiers.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/AdvancedOperations/UploadOfflineConversions.vb b/examples/AdWords/Vb/v201406/AdvancedOperations/UploadOfflineConversions.vb new file mode 100644 index 00000000000..595bd70e08b --- /dev/null +++ b/examples/AdWords/Vb/v201406/AdvancedOperations/UploadOfflineConversions.vb @@ -0,0 +1,245 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds a Shared Bidding Strategy and uses it to construct + ''' a campaign. + ''' + ''' Tags: BiddingStrategyService.mutate + ''' Tags: BudgetService.mutate, CampaignService.mutate + ''' + Public Class UploadOfflineConversions + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim conversionName As String = "INSERT_CONVERSION_NAME_HERE" + ' GCLID needs to be newer than 30 days. + Dim gClId As String = "INSERT_GOOGLE_CLICK_ID_HERE" + ' The conversion time should be higher than the click time. + Dim conversionTime As String = "INSERT_CONVERSION_TIME_HERE" + Dim conversionValue As Double = Double.Parse("INSERT_CONVERSION_VALUE_HERE") + + Dim codeExample As New UploadOfflineConversions + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser, conversionName, gClId, conversionTime, conversionValue) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a Shared Bidding Strategy and uses it to construct " & _ + "a campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The name of the upload conversion to be + ''' created. + ''' The Google Click ID of the click for which offline + ''' conversions are uploaded. + ''' The conversion value to be uploaded. + ''' + ''' The conversion time, in yyyymmdd hhmmss + ''' format. + Public Sub Run(ByVal user As AdWordsUser, ByVal conversionName As String, _ + ByVal gClid As String, ByVal conversionTime As String, ByVal conversionValue As Double) + ' Get the ConversionTrackerService. + Dim conversionTrackerService As ConversionTrackerService = user.GetService( _ + AdWordsService.v201406.ConversionTrackerService) + + ' Get the OfflineConversionFeedService. + Dim offlineConversionFeedService As OfflineConversionFeedService = user.GetService( _ + AdWordsService.v201406.OfflineConversionFeedService) + + Const VIEWTHROUGH_LOOKBACK_WINDOW As Integer = 30 + Const CTC_LOOKBACK_WINDOW As Integer = 90 + + Try + ' Create an upload conversion. Once created, this entry will be visible + ' under Tools and Analysis->Conversion and will have "Source = Import". + Dim uploadConversion As New UploadConversion() + uploadConversion.category = ConversionTrackerCategory.PAGE_VIEW + uploadConversion.name = conversionName + uploadConversion.viewthroughLookbackWindow = VIEWTHROUGH_LOOKBACK_WINDOW + uploadConversion.ctcLookbackWindow = CTC_LOOKBACK_WINDOW + + Dim uploadConversionOperation As New ConversionTrackerOperation() + uploadConversionOperation.operator = [Operator].ADD + uploadConversionOperation.operand = uploadConversion + + Dim conversionTrackerRetval As ConversionTrackerReturnValue = _ + conversionTrackerService.mutate(New ConversionTrackerOperation() { _ + uploadConversionOperation}) + + Dim newUploadConversion As UploadConversion = conversionTrackerRetval.value(0) + + Console.WriteLine("New upload conversion type with name = '{0}' and id = {1} was " & _ + "created.", newUploadConversion.name, newUploadConversion.id) + + ' Associate offline conversions with the upload conversion we created. + Dim feed As New OfflineConversionFeed() + feed.conversionName = conversionName + feed.conversionTime = conversionTime + feed.conversionValue = conversionValue + feed.googleClickId = gClid + + Dim offlineConversionOperation As New OfflineConversionFeedOperation() + offlineConversionOperation.operator = [Operator].ADD + offlineConversionOperation.operand = feed + + Dim offlineConversionRetval As OfflineConversionFeedReturnValue = _ + offlineConversionFeedService.mutate( _ + New OfflineConversionFeedOperation() {offlineConversionOperation}) + + Dim newFeed As OfflineConversionFeed = offlineConversionRetval.value(0) + + Console.WriteLine("Uploaded offline conversion value of {0} for Google Click ID = " & _ + "'{1}' to '{2}'.", newFeed.conversionValue, newFeed.googleClickId, _ + newFeed.conversionName) + Catch ex As Exception + Throw New System.ApplicationException("Failed to upload offline conversions.", ex) + End Try + End Sub + + + ''' + ''' Creates the shared bidding strategy. + ''' + ''' The bidding strategy service. + ''' The bidding strategy name. + ''' The bid ceiling. + ''' The spend target. + ''' The bidding strategy object. + Private Function CreateBiddingStrategy(ByVal biddingStrategyService As BiddingStrategyService, _ + ByVal name As String, ByVal bidCeiling As Long, ByVal spendTarget As Long) _ + As SharedBiddingStrategy + ' Create a shared bidding strategy. + Dim sharedBiddingStrategy As New SharedBiddingStrategy() + sharedBiddingStrategy.name = name + + Dim biddingScheme As New TargetSpendBiddingScheme() + ' Optionally set additional bidding scheme parameters. + biddingScheme.bidCeiling = New Money() + biddingScheme.bidCeiling.microAmount = bidCeiling + + biddingScheme.spendTarget = New Money() + biddingScheme.spendTarget.microAmount = spendTarget + + sharedBiddingStrategy.biddingScheme = biddingScheme + + ' Create operation. + Dim operation As New BiddingStrategyOperation() + operation.operator = [Operator].ADD + operation.operand = sharedBiddingStrategy + + Return biddingStrategyService.mutate(New BiddingStrategyOperation() {operation}).value(0) + End Function + + ''' + ''' Creates an explicit budget to be used only to create the Campaign. + ''' + ''' The budget service. + ''' The budget name. + ''' The budget amount. + ''' The budget object. + Private Function CreateSharedBudget(ByVal budgetService As BudgetService, _ + ByVal name As String, ByVal amount As Long) As Budget + ' Create a shared budget + Dim budget As New Budget() + budget.name = name + budget.period = BudgetBudgetPeriod.DAILY + budget.amount = New Money() + budget.amount.microAmount = amount + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD + budget.isExplicitlyShared = True + + ' Create operation. + Dim operation As New BudgetOperation() + operation.operand = budget + operation.operator = [Operator].ADD + + ' Make the mutate request. + Return budgetService.mutate(New BudgetOperation() {operation}).value(0) + End Function + + ''' + ''' Creates the campaign with a shared bidding strategy. + ''' + ''' The campaign service. + ''' The campaign name. + ''' The bidding strategy id. + ''' The shared budget id. + ''' The campaign object. + Private Function CreateCampaignWithBiddingStrategy(ByVal campaignService As CampaignService, _ + ByVal name As String, ByVal biddingStrategyId As Long, ByVal sharedBudgetId As Long) _ + As Campaign + ' Create campaign. + Dim campaign As New Campaign() + campaign.name = name + + ' Set the budget. + campaign.budget = New Budget() + campaign.budget.budgetId = sharedBudgetId + + ' Set bidding strategy (required). + Dim biddingStrategyConfiguration As New BiddingStrategyConfiguration() + biddingStrategyConfiguration.biddingStrategyId = biddingStrategyId + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration + + ' Set keyword matching setting (required). + Dim keywordMatchSetting As New KeywordMatchSetting() + keywordMatchSetting.optIn = True + campaign.settings = New Setting() {keywordMatchSetting} + + ' Set network targeting (recommended). + Dim networkSetting As New NetworkSetting() + networkSetting.targetGoogleSearch = True + networkSetting.targetSearchNetwork = True + networkSetting.targetContentNetwork = True + campaign.networkSetting = networkSetting + + ' Create operation. + Dim operation As New CampaignOperation() + operation.operand = campaign + operation.operator = [Operator].ADD + + Return campaignService.mutate(New CampaignOperation() {operation}).value(0) + End Function + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/AdvancedOperations/UseSharedBiddingStrategy.vb b/examples/AdWords/Vb/v201406/AdvancedOperations/UseSharedBiddingStrategy.vb new file mode 100644 index 00000000000..e999d252402 --- /dev/null +++ b/examples/AdWords/Vb/v201406/AdvancedOperations/UseSharedBiddingStrategy.vb @@ -0,0 +1,213 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds a Shared Bidding Strategy and uses it to construct + ''' a campaign. + ''' + ''' Tags: BiddingStrategyService.mutate + ''' Tags: BudgetService.mutate, CampaignService.mutate + ''' + Public Class UseSharedBiddingStrategy + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UseSharedBiddingStrategy + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a Shared Bidding Strategy and uses it to construct " & _ + "a campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the services. + Dim biddingStrategyService As BiddingStrategyService = user.GetService( _ + AdWordsService.v201406.BiddingStrategyService) + + Dim budgetService As BudgetService = user.GetService(AdWordsService.v201406.BudgetService) + + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201406.CampaignService) + + Dim biddingStrategyName As String = "Maximize Clicks " & ExampleUtilities.GetRandomString() + Dim bidCeiling As Long = 2000000 + Dim spendTarget As Long = 20000000 + + Dim budgetName As String = "Shared Interplanetary Budget #" & _ + ExampleUtilities.GetRandomString() + Dim budgetAmount As Long = 30000000 + + Dim campaignName As String = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString() + + Try + Dim sharedBiddingStrategy As SharedBiddingStrategy = CreateBiddingStrategy( _ + biddingStrategyService, biddingStrategyName, bidCeiling, spendTarget) + Console.WriteLine("Shared bidding strategy with name '{0}' and ID {1} of type {2} " & _ + "was created.", sharedBiddingStrategy.name, sharedBiddingStrategy.id, _ + sharedBiddingStrategy.biddingScheme.BiddingSchemeType) + + Dim sharedBudget As Budget = CreateSharedBudget(budgetService, budgetName, budgetAmount) + + Dim newCampaign As Campaign = CreateCampaignWithBiddingStrategy(campaignService, _ + campaignName, sharedBiddingStrategy.id, sharedBudget.budgetId) + + Console.WriteLine("Campaign with name '{0}', ID {1} and bidding scheme ID {2} was " & _ + "created.", newCampaign.name, newCampaign.id, _ + newCampaign.biddingStrategyConfiguration.biddingStrategyId) + + Catch ex As Exception + Throw New System.ApplicationException("Failed to create campaign that uses shared " & _ + "bidding strategy.", ex) + End Try + End Sub + + + ''' + ''' Creates the shared bidding strategy. + ''' + ''' The bidding strategy service. + ''' The bidding strategy name. + ''' The bid ceiling. + ''' The spend target. + ''' The bidding strategy object. + Private Function CreateBiddingStrategy(ByVal biddingStrategyService As BiddingStrategyService, _ + ByVal name As String, ByVal bidCeiling As Long, ByVal spendTarget As Long) _ + As SharedBiddingStrategy + ' Create a shared bidding strategy. + Dim sharedBiddingStrategy As New SharedBiddingStrategy() + sharedBiddingStrategy.name = name + + Dim biddingScheme As New TargetSpendBiddingScheme() + ' Optionally set additional bidding scheme parameters. + biddingScheme.bidCeiling = New Money() + biddingScheme.bidCeiling.microAmount = bidCeiling + + biddingScheme.spendTarget = New Money() + biddingScheme.spendTarget.microAmount = spendTarget + + sharedBiddingStrategy.biddingScheme = biddingScheme + + ' Create operation. + Dim operation As New BiddingStrategyOperation() + operation.operator = [Operator].ADD + operation.operand = sharedBiddingStrategy + + Return biddingStrategyService.mutate(New BiddingStrategyOperation() {operation}).value(0) + End Function + + ''' + ''' Creates an explicit budget to be used only to create the Campaign. + ''' + ''' The budget service. + ''' The budget name. + ''' The budget amount. + ''' The budget object. + Private Function CreateSharedBudget(ByVal budgetService As BudgetService, _ + ByVal name As String, ByVal amount As Long) As Budget + ' Create a shared budget + Dim budget As New Budget() + budget.name = name + budget.period = BudgetBudgetPeriod.DAILY + budget.amount = New Money() + budget.amount.microAmount = amount + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD + budget.isExplicitlyShared = True + + ' Create operation. + Dim operation As New BudgetOperation() + operation.operand = budget + operation.operator = [Operator].ADD + + ' Make the mutate request. + Return budgetService.mutate(New BudgetOperation() {operation}).value(0) + End Function + + ''' + ''' Creates the campaign with a shared bidding strategy. + ''' + ''' The campaign service. + ''' The campaign name. + ''' The bidding strategy id. + ''' The shared budget id. + ''' The campaign object. + Private Function CreateCampaignWithBiddingStrategy(ByVal campaignService As CampaignService, _ + ByVal name As String, ByVal biddingStrategyId As Long, ByVal sharedBudgetId As Long) _ + As Campaign + ' Create campaign. + Dim campaign As New Campaign() + campaign.name = name + campaign.advertisingChannelType = AdvertisingChannelType.SEARCH + + ' Set the budget. + campaign.budget = New Budget() + campaign.budget.budgetId = sharedBudgetId + + ' Set bidding strategy (required). + Dim biddingStrategyConfiguration As New BiddingStrategyConfiguration() + biddingStrategyConfiguration.biddingStrategyId = biddingStrategyId + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration + + ' Set keyword matching setting (required). + Dim keywordMatchSetting As New KeywordMatchSetting() + keywordMatchSetting.optIn = True + campaign.settings = New Setting() {keywordMatchSetting} + + ' Set network targeting (recommended). + Dim networkSetting As New NetworkSetting() + networkSetting.targetGoogleSearch = True + networkSetting.targetSearchNetwork = True + networkSetting.targetContentNetwork = True + campaign.networkSetting = networkSetting + + ' Create operation. + Dim operation As New CampaignOperation() + operation.operand = campaign + operation.operator = [Operator].ADD + + Return campaignService.mutate(New CampaignOperation() {operation}).value(0) + End Function + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/BasicOperations/AddAdGroupDemographicCriteria.vb b/examples/AdWords/Vb/v201406/BasicOperations/AddAdGroupDemographicCriteria.vb new file mode 100644 index 00000000000..055466b49ac --- /dev/null +++ b/examples/AdWords/Vb/v201406/BasicOperations/AddAdGroupDemographicCriteria.vb @@ -0,0 +1,124 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds demographic target criteria to an ad group. To get + ''' ad groups, run AddAdGroup.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class AddAdGroupDemographicCriteria + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAdGroupDemographicCriteria + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds demographic target criteria to an ad group. To get ad " & _ + "groups, run AddAdGroup.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which criteria are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = _ + user.GetService(AdWordsService.v201406.AdGroupCriterionService) + + ' Create biddable ad group criterion for gender + Dim genderTarget As New Gender() + ' Criterion Id for male. The IDs can be found here + ' https://developers.google.com/adwords/api/docs/appendix/genders + genderTarget.id = 10 + + Dim genderBiddableAdGroupCriterion As New BiddableAdGroupCriterion() + genderBiddableAdGroupCriterion.adGroupId = adGroupId + genderBiddableAdGroupCriterion.criterion = genderTarget + + ' Create negative ad group criterion for age range + Dim ageRangeNegative As New AgeRange() + ' Criterion Id for age 18 to 24. The IDs can be found here + ' https://developers.google.com/adwords/api/docs/appendix/ages + + ageRangeNegative.id = 503001 + Dim ageRangeNegativeAdGroupCriterion As New NegativeAdGroupCriterion() + ageRangeNegativeAdGroupCriterion.adGroupId = adGroupId + ageRangeNegativeAdGroupCriterion.criterion = ageRangeNegative + + ' Create operations. + Dim genderBiddableAdGroupCriterionOperation As New AdGroupCriterionOperation() + genderBiddableAdGroupCriterionOperation.operand = genderBiddableAdGroupCriterion + genderBiddableAdGroupCriterionOperation.operator = [Operator].ADD + + Dim ageRangeNegativeAdGroupCriterionOperation As New AdGroupCriterionOperation() + ageRangeNegativeAdGroupCriterionOperation.operand = ageRangeNegativeAdGroupCriterion + ageRangeNegativeAdGroupCriterionOperation.operator = [Operator].ADD + + Dim operations As New List(Of Operation) + operations.Add(genderBiddableAdGroupCriterionOperation) + operations.Add(ageRangeNegativeAdGroupCriterionOperation) + + Try + ' Add ad group criteria. + Dim result As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + operations.ToArray) + + ' Display ad group criteria. + If (Not result Is Nothing) AndAlso Not (result.value Is Nothing) Then + For Each adGroupCriterionResult As AdGroupCriterion In result.value + Console.WriteLine("Ad group criterion with ad group id '{0}', criterion id " & _ + "'{1}', and type '{2}' was added.", adGroupCriterionResult.adGroupId, _ + adGroupCriterionResult.criterion.id, _ + adGroupCriterionResult.criterion.CriterionType) + Next + Else + Console.WriteLine("No ad group criteria were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create ad group criteria.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/BasicOperations/AddAdGroups.vb b/examples/AdWords/Vb/v201406/BasicOperations/AddAdGroups.vb new file mode 100644 index 00000000000..3f414abb3e6 --- /dev/null +++ b/examples/AdWords/Vb/v201406/BasicOperations/AddAdGroups.vb @@ -0,0 +1,138 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example illustrates how to create ad groups. To create + ''' campaigns, run AddCampaigns.vb. + ''' + ''' Tags: AdGroupService.mutate + ''' + Public Class AddAdGroups + Inherits ExampleBase + ''' + ''' Number of items being added / updated in this code example. + ''' + Const NUM_ITEMS As Integer = 5 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAdGroups + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to create ad groups. To create campaigns," & _ + " run AddCampaigns.vb" + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to which ad groups are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService( _ + AdWordsService.v201406.AdGroupService) + + Dim operations As New List(Of AdGroupOperation) + + For i As Integer = 1 To NUM_ITEMS + ' Create the ad group. + Dim adGroup As New AdGroup + adGroup.name = String.Format("Earth to Mars Cruises #{0}", ExampleUtilities.GetRandomString) + adGroup.status = AdGroupStatus.ENABLED + adGroup.campaignId = campaignId + + ' Set the ad group bids. + Dim biddingConfig As New BiddingStrategyConfiguration() + + Dim cpcBid As New CpcBid() + cpcBid.bid = New Money() + cpcBid.bid.microAmount = 10000000 + + biddingConfig.bids = New Bids() {cpcBid} + + adGroup.biddingStrategyConfiguration = biddingConfig + + ' Optional: Set targeting restrictions. + ' These setting only affect serving for the Display Network. + Dim targetingSetting As New TargetingSetting() + + Dim placementDetail As New TargetingSettingDetail() + placementDetail.criterionTypeGroup = CriterionTypeGroup.PLACEMENT + placementDetail.targetAll = True + + Dim verticalDetail As New TargetingSettingDetail() + verticalDetail.criterionTypeGroup = CriterionTypeGroup.VERTICAL + verticalDetail.targetAll = False + + targetingSetting.details = New TargetingSettingDetail() {placementDetail, verticalDetail} + + adGroup.settings = New Setting() {targetingSetting} + + ' Create the operation. + Dim operation As New AdGroupOperation + operation.operator = [Operator].ADD + operation.operand = adGroup + + operations.Add(operation) + Next + + Try + ' Create the ad group. + Dim retVal As AdGroupReturnValue = adGroupService.mutate(operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + For Each newAdGroup As AdGroup In retVal.value + Console.WriteLine("Ad group with id = '{0}' and name = '{1}' was created.", _ + newAdGroup.id, newAdGroup.name) + Next + Else + Console.WriteLine("No ad groups were created.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create ad groups.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/BasicOperations/AddCampaigns.vb b/examples/AdWords/Vb/v201406/BasicOperations/AddCampaigns.vb new file mode 100644 index 00000000000..d7270f8c242 --- /dev/null +++ b/examples/AdWords/Vb/v201406/BasicOperations/AddCampaigns.vb @@ -0,0 +1,169 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds campaigns. To get campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignService.mutate + ''' + Public Class AddCampaigns + Inherits ExampleBase + ''' + ''' Number of items being added / updated in this code example. + ''' + Const NUM_ITEMS As Integer = 5 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddCampaigns + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds campaigns. To get campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the BudgetService. + Dim budgetService As BudgetService = user.GetService( _ + AdWordsService.v201406.BudgetService) + + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201406.CampaignService) + + ' Create the campaign budget. + Dim budget As New Budget + budget.name = "Interplanetary Cruise Budget #" & ExampleUtilities.GetRandomString + budget.period = BudgetBudgetPeriod.DAILY + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD + budget.amount = New Money + budget.amount.microAmount = 50000000 + + Dim budgetOperation As New BudgetOperation + budgetOperation.operator = [Operator].ADD + budgetOperation.operand = budget + + Try + Dim budgetRetval As BudgetReturnValue = budgetService.mutate(New BudgetOperation() {budgetOperation}) + budget = budgetRetval.value(0) + Catch ex As Exception + Throw New System.ApplicationException("Failed to add shared budget.", ex) + End Try + + Dim operations As New List(Of CampaignOperation) + + For i As Integer = 1 To NUM_ITEMS + ' Create the campaign. + Dim campaign As New Campaign + campaign.name = "Interplanetary Cruise #" & ExampleUtilities.GetRandomString + campaign.status = CampaignStatus.PAUSED + campaign.advertisingChannelType = AdvertisingChannelType.SEARCH + + Dim biddingConfig As New BiddingStrategyConfiguration() + biddingConfig.biddingStrategyType = BiddingStrategyType.MANUAL_CPC + campaign.biddingStrategyConfiguration = biddingConfig + + ' Set the campaign budget. + campaign.budget = New Budget + campaign.budget.budgetId = budget.budgetId + + ' Set the campaign network options. + campaign.networkSetting = New NetworkSetting + campaign.networkSetting.targetGoogleSearch = True + campaign.networkSetting.targetSearchNetwork = True + campaign.networkSetting.targetContentNetwork = False + campaign.networkSetting.targetPartnerSearchNetwork = False + + ' Set the campaign geo target and keyword match settings. + Dim geoSetting As New GeoTargetTypeSetting + geoSetting.positiveGeoTargetType = GeoTargetTypeSettingPositiveGeoTargetType.DONT_CARE + geoSetting.negativeGeoTargetType = GeoTargetTypeSettingNegativeGeoTargetType.DONT_CARE + + Dim keywordSetting As New KeywordMatchSetting + keywordSetting.optIn = False + + campaign.settings = New Setting() {geoSetting, keywordSetting} + + ' Optional: Set the start date. + campaign.startDate = DateTime.Now.AddDays(1).ToString("yyyyMMdd") + + ' Optional: Set the end date. + campaign.endDate = DateTime.Now.AddYears(1).ToString("yyyyMMdd") + + ' Optional: Set the campaign ad serving optimization status. + campaign.adServingOptimizationStatus = AdServingOptimizationStatus.ROTATE + + ' Optional: Set the frequency cap. + Dim frequencyCap As New FrequencyCap + frequencyCap.impressions = 5 + frequencyCap.level = Level.ADGROUP + frequencyCap.timeUnit = TimeUnit.DAY + campaign.frequencyCap = frequencyCap + + ' Create the operation. + Dim operation As New CampaignOperation + operation.operator = [Operator].ADD + operation.operand = campaign + operations.Add(operation) + Next + + Try + ' Add the campaign. + Dim retVal As CampaignReturnValue = campaignService.mutate(operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + For Each newCampaign As Campaign In retVal.value + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was added.", _ + newCampaign.name, newCampaign.id) + Next + Else + Console.WriteLine("No campaigns were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add campaigns.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/BasicOperations/AddKeywords.vb b/examples/AdWords/Vb/v201406/BasicOperations/AddKeywords.vb new file mode 100644 index 00000000000..079115901b6 --- /dev/null +++ b/examples/AdWords/Vb/v201406/BasicOperations/AddKeywords.vb @@ -0,0 +1,129 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds a keyword to an ad group. To get ad groups, run + ''' GetAdGroups.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class AddKeywords + Inherits ExampleBase + ''' + ''' Number of items being added / updated in this code example. + ''' + Const NUM_ITEMS As Integer = 5 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddKeywords + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a keyword to an ad group. To get ad groups, run " & _ + "GetAdGroups.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which keywords are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201406.AdGroupCriterionService) + + Dim operations As New List(Of AdGroupCriterionOperation) + + For i As Integer = 1 To NUM_ITEMS + ' Create the keyword. + Dim keyword As New Keyword + keyword.text = "mars cruise" + keyword.matchType = KeywordMatchType.BROAD + + ' Create the biddable ad group criterion. + Dim keywordCriterion As New BiddableAdGroupCriterion + keywordCriterion.adGroupId = adGroupId + keywordCriterion.criterion = keyword + + ' Optional: Set the user status. + keywordCriterion.userStatus = UserStatus.PAUSED + + ' Optional: Set the keyword destination url. + keywordCriterion.destinationUrl = "http://example.com/mars/cruise/" & i + + ' Create the operations. + Dim operation As New AdGroupCriterionOperation + operation.operator = [Operator].ADD + operation.operand = keywordCriterion + + operations.Add(operation) + Next + + Try + ' Create the keywords. + Dim retVal As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing)) Then + For Each adGroupCriterion As AdGroupCriterion In retVal.value + ' If you are adding multiple type of criteria, then you may need to + ' check for + ' + ' if (adGroupCriterion is Keyword) { ... } + ' + ' to identify the criterion type. + Console.WriteLine("Keyword with ad group id = '{0}, keyword id = '{1}, text = " & _ + "'{2}' and match type = '{3}' was created.", adGroupCriterion.adGroupId, _ + adGroupCriterion.criterion.id, TryCast(adGroupCriterion.criterion, Keyword).text, _ + TryCast(adGroupCriterion.criterion, Keyword).matchType) + Next + Else + Console.WriteLine("No keywords were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create keywords.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/BasicOperations/AddTextAds.vb b/examples/AdWords/Vb/v201406/BasicOperations/AddTextAds.vb new file mode 100644 index 00000000000..f0db376a134 --- /dev/null +++ b/examples/AdWords/Vb/v201406/BasicOperations/AddTextAds.vb @@ -0,0 +1,130 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 +Imports Google.Api.Ads.Common.Util + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds text ads to a given ad group. To list ad groups, + ''' run GetAdGroups.vb. To learn how to handle policy violations and add + ''' exemption requests, see HandlePolicyViolationError.vb. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class AddTextAds + Inherits ExampleBase + ''' + ''' Number of items being added / updated in this code example. + ''' + Const NUM_ITEMS As Integer = 5 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddTextAds + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds text ads to a given ad group. To list ad groups, run " & _ + "GetAdGroups.vb. To learn how to handle policy violations and add exemption " & _ + "requests, see HandlePolicyViolationError.cs." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which ads are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService( _ + AdWordsService.v201406.AdGroupAdService) + + Dim operations As New List(Of AdGroupAdOperation) + + For i As Integer = 1 To NUM_ITEMS + ' Create the text ad. + Dim textAd As New TextAd + textAd.headline = "Luxury Cruise to Mars" + textAd.description1 = "Visit the Red Planet in style." + textAd.description2 = "Low-gravity fun for everyone!" + textAd.displayUrl = "www.example.com" + textAd.url = "http://www.example.com/" & i + + Dim textAdGroupAd As New AdGroupAd + textAdGroupAd.adGroupId = adGroupId + textAdGroupAd.ad = textAd + + ' Optional: Set the status. + textAdGroupAd.status = AdGroupAdStatus.PAUSED + + ' Create the operations. + Dim operation As New AdGroupAdOperation + operation.operator = [Operator].ADD + operation.operand = textAdGroupAd + + operations.Add(operation) + Next + + Dim retVal As AdGroupAdReturnValue = Nothing + + Try + ' Create the ads. + retVal = service.mutate(operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing)) Then + ' If you are adding multiple type of Ads, then you may need to check + ' for + ' + ' if (adGroupAd.ad is TextAd) { ... } + ' + ' to identify the ad type. + For Each adGroupAd As AdGroupAd In retVal.value + Console.WriteLine("New text ad with id = ""{0}"" and displayUrl = ""{1}"" was " & _ + "created.", adGroupAd.ad.id, adGroupAd.ad.displayUrl) + Next + Else + Console.WriteLine("No text ads were created.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create text ads.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/BasicOperations/GetAdGroups.vb b/examples/AdWords/Vb/v201406/BasicOperations/GetAdGroups.vb new file mode 100644 index 00000000000..b945c6b4994 --- /dev/null +++ b/examples/AdWords/Vb/v201406/BasicOperations/GetAdGroups.vb @@ -0,0 +1,114 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example illustrates how to retrieve all the ad groups for a + ''' campaign. To create an ad group, run AddAdGroup.vb. + ''' + ''' Tags: AdGroupService.get + ''' + Public Class GetAdGroups + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAdGroups + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to retrieve all the ad groups for a " & _ + "campaign. To create an ad group, run AddAdGroup.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which ad groups are + ''' retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService( _ + AdWordsService.v201406.AdGroupService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "Name"} + + ' Create the filters. + Dim predicate As New Predicate + predicate.field = "CampaignId" + predicate.operator = PredicateOperator.EQUALS + predicate.values = New String() {campaignId.ToString} + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the ad groups. + page = adGroupService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each adGroup As AdGroup In page.entries + Console.WriteLine("{0}) Ad group name is ""{1}"" and id is ""{2}"".", i, _ + adGroup.name, adGroup.id) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of ad groups found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve ad group(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/BasicOperations/GetCampaigns.vb b/examples/AdWords/Vb/v201406/BasicOperations/GetCampaigns.vb new file mode 100644 index 00000000000..1b82616abda --- /dev/null +++ b/examples/AdWords/Vb/v201406/BasicOperations/GetCampaigns.vb @@ -0,0 +1,103 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example lists all campaigns. To add a campaign, run + ''' AddCampaign.vb. + ''' + ''' Tags: CampaignService.get + ''' + Public Class GetCampaigns + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetCampaigns + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example lists all campaigns. To add a campaign, run AddCampaign.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201406.CampaignService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "Name", "Status"} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New CampaignPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the campaigns. + page = campaignService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each campaign As Campaign In page.entries + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = " & _ + "'{3}' was found.", i, campaign.id, campaign.name, campaign.status) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve campaign(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/BasicOperations/GetCampaignsWithAwql.vb b/examples/AdWords/Vb/v201406/BasicOperations/GetCampaignsWithAwql.vb new file mode 100644 index 00000000000..9c31e951ed3 --- /dev/null +++ b/examples/AdWords/Vb/v201406/BasicOperations/GetCampaignsWithAwql.vb @@ -0,0 +1,102 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example lists all campaigns using an AWQL query. See + ''' https://developers.google.com/adwords/api/docs/guides/awql for AWQL + ''' documentation. To add a campaign, run AddCampaign.vb. + ''' + ''' Tags: CampaignService.get + ''' + Public Class GetCampaignsWithAwql + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetCampaignsWithAwql + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example lists all campaigns using an AWQL query. See " & _ + "https://developers.google.com/adwords/api/docs/guides/awql for AWQL " & _ + "documentation. To add a campaign, run AddCampaign.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201406.CampaignService) + + ' Create the query. + Dim query As String = "SELECT Id, Name, Status ORDER BY Name" + + Dim offset As Long = 0 + Dim pageSize As Long = 500 + + Dim page As New CampaignPage() + + Try + Do + Dim queryWithPaging As String = String.Format("{0} LIMIT {1}, {2}", query, offset, _ + pageSize) + + ' Get the campaigns. + page = campaignService.query(queryWithPaging) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each campaign As Campaign In page.entries + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = " & _ + "'{3}' was found.", i, campaign.id, campaign.name, campaign.status) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve campaign(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/BasicOperations/GetKeywords.vb b/examples/AdWords/Vb/v201406/BasicOperations/GetKeywords.vb new file mode 100644 index 00000000000..ed5441ae3b3 --- /dev/null +++ b/examples/AdWords/Vb/v201406/BasicOperations/GetKeywords.vb @@ -0,0 +1,128 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example gets all keywords in an account. To add keywords, run + ''' AddKeywords.vb. + ''' + ''' Tags: AdGroupCriterionService.get + ''' + Public Class GetKeywords + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetKeywords + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all keywords in an account. To add keywords, run " & _ + "AddKeywords.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201406.AdGroupCriterionService) + + ' Create a selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "AdGroupId", "KeywordText"} + + ' Select only keywords. + Dim predicate As New Predicate + predicate.field = "CriteriaType" + predicate.operator = PredicateOperator.EQUALS + predicate.values = New String() {"KEYWORD"} + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupCriterionPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the keywords. + page = adGroupCriterionService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each adGroupCriterion As AdGroupCriterion In page.entries + Dim isNegative As Boolean = TypeOf adGroupCriterion Is NegativeAdGroupCriterion + + ' If you are retrieving multiple type of criteria, then you may + ' need to check for + ' + ' if (adGroupCriterion is Keyword) { ... } + ' + ' to identify the criterion type. + Dim keyword As Keyword = adGroupCriterion.criterion + If isNegative Then + Console.WriteLine("{0}) Negative keyword with ad group ID = '{1}', keyword ID " & _ + "= '{2}', and text = '{3}' was found.", i, adGroupCriterion.adGroupId, _ + keyword.id, keyword.text) + Else + Console.WriteLine("{0}) Keyword with ad group ID = '{1}', keyword ID = '{2}', " & _ + "text = '{3}' and matchType = '{4} was found.", i, adGroupCriterion.adGroupId, _ + keyword.id, keyword.text, keyword.matchType) + End If + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of keywords found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve keywords.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/BasicOperations/GetTextAds.vb b/examples/AdWords/Vb/v201406/BasicOperations/GetTextAds.vb new file mode 100644 index 00000000000..36b64c24a1a --- /dev/null +++ b/examples/AdWords/Vb/v201406/BasicOperations/GetTextAds.vb @@ -0,0 +1,140 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example retrieves all text ads given an existing ad group. To + ''' add ads to an existing ad group, run AddTextAds.vb. + ''' + ''' Tags: AdGroupAdService.get + ''' + Public Class GetTextAds + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetTextAds + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves all text ads given an existing ad group. To add " & _ + "text ads to an existing ad group, run AddTextAds.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group from which text ads are + ''' retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201406.AdGroupAdService) + + ' Create a selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "Status", "Headline", "Description1", _ + "Description2", "DisplayUrl"} + + ' Set the sort order. + Dim orderBy As New OrderBy + orderBy.field = "Id" + orderBy.sortOrder = SortOrder.ASCENDING + selector.ordering = New OrderBy() {orderBy} + + ' Restrict the fetch to only the selected ad group id. + Dim adGroupPredicate As New Predicate + adGroupPredicate.field = "AdGroupId" + adGroupPredicate.operator = PredicateOperator.EQUALS + adGroupPredicate.values = New String() {adGroupId.ToString} + + ' Retrieve only text ads. + Dim typePredicate As New Predicate + typePredicate.field = "AdType" + typePredicate.operator = PredicateOperator.EQUALS + typePredicate.values = New String() {"TEXT_AD"} + + ' By default disabled ads aren't returned by the selector. To return them + ' include the DISABLED status in the statuses field. + Dim statusPredicate As New Predicate + statusPredicate.field = "Status" + statusPredicate.operator = PredicateOperator.IN + + statusPredicate.values = New String() {AdGroupAdStatus.ENABLED.ToString, _ + AdGroupAdStatus.PAUSED.ToString, AdGroupAdStatus.DISABLED.ToString} + + selector.predicates = New Predicate() {adGroupPredicate, statusPredicate, typePredicate} + + ' Select the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupAdPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the text ads. + page = service.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each adGroupAd As AdGroupAd In page.entries + Dim textAd As TextAd = adGroupAd.ad + Console.WriteLine("{0}) Ad id is {1} and status is {2}", i, textAd.id, _ + adGroupAd.status) + Console.WriteLine(" {0}\n {1}\n {2}\n {3}", textAd.headline, _ + textAd.description1, textAd.description2, textAd.displayUrl) + Next + i += 1 + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of text ads found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get text ads.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/BasicOperations/PauseAd.vb b/examples/AdWords/Vb/v201406/BasicOperations/PauseAd.vb new file mode 100644 index 00000000000..2f419e2398e --- /dev/null +++ b/examples/AdWords/Vb/v201406/BasicOperations/PauseAd.vb @@ -0,0 +1,102 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example pauses a given ad. To list all ads, run GetTextAds.cs. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class PauseAd + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New PauseAd + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim adId As Long = Long.Parse("INSERT_AD_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, adId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example pauses a given ad. To list all ads, run GetTextAds.cs." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the ad. + ''' + ''' Id of the ad to be paused. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal adId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201406.AdGroupAdService) + + Dim status As AdGroupAdStatus = AdGroupAdStatus.PAUSED + + ' Create the ad group ad. + Dim adGroupAd As New AdGroupAd + adGroupAd.status = status + adGroupAd.adGroupId = adGroupId + + adGroupAd.ad = New Ad + adGroupAd.ad.id = adId + + ' Create the operation. + Dim adGroupAdOperation As New AdGroupAdOperation + adGroupAdOperation.operator = [Operator].SET + adGroupAdOperation.operand = adGroupAd + + Try + ' Update the ad. + Dim retVal As AdGroupAdReturnValue = service.mutate( _ + New AdGroupAdOperation() {adGroupAdOperation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim pausedAdGroupAd As AdGroupAd = retVal.value(0) + Console.WriteLine("Ad with id ""{0}"" was paused.", pausedAdGroupAd.ad.id) + Else + Console.WriteLine("No ads were paused.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to pause ad.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/BasicOperations/RemoveAd.vb b/examples/AdWords/Vb/v201406/BasicOperations/RemoveAd.vb new file mode 100644 index 00000000000..de3811f65b5 --- /dev/null +++ b/examples/AdWords/Vb/v201406/BasicOperations/RemoveAd.vb @@ -0,0 +1,105 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example removes an ad using the 'REMOVE' operator. To list ads, + ''' run GetTextAds.vb. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class RemoveAd + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New RemoveAd + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim adId As Long = Long.Parse("INSERT_AD_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, adId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example removes an ad using the 'REMOVE' operator. To list ads, " & _ + "run GetTextAds.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the ad. + ''' Id of the ad being removed. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal adId As Long) + ' Get the AdGroupAdService. + Dim adGroupAdService As AdGroupAdService = user.GetService( _ + AdWordsService.v201406.AdGroupAdService) + + ' Since we do not need to update any ad-specific fields, it is enough to + ' create the base type. + Dim ad As New Ad + ad.id = adId + + ' Create the ad group ad. + Dim adGroupAd As New AdGroupAd + adGroupAd.adGroupId = adGroupId + + adGroupAd.ad = ad + + ' Create the operation. + Dim operation As New AdGroupAdOperation + operation.operand = adGroupAd + operation.operator = [Operator].REMOVE + + Try + ' Remove the ad. + Dim retVal As AdGroupAdReturnValue = adGroupAdService.mutate( _ + New AdGroupAdOperation() {operation}) + + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim removedAdGroupAd As AdGroupAd = retVal.value(0) + Console.WriteLine("Ad with id = ""{0}"" and type = ""{1}"" was removed.", _ + removedAdGroupAd.ad.id, removedAdGroupAd.ad.AdType) + Else + Console.WriteLine("No ads were removed.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to remove ad.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/BasicOperations/RemoveAdGroup.vb b/examples/AdWords/Vb/v201406/BasicOperations/RemoveAdGroup.vb new file mode 100644 index 00000000000..934b4c96e76 --- /dev/null +++ b/examples/AdWords/Vb/v201406/BasicOperations/RemoveAdGroup.vb @@ -0,0 +1,101 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example removes an ad group by setting the status to 'REMOVED'. + ''' To get ad groups, run GetAdGroups.vb. + ''' + ''' Tags: AdGroupService.mutate + ''' + Public Class RemoveAdGroup + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New RemoveAdGroup + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example removes an ad group by setting the status to 'REMOVED'. " & _ + "To get ad groups, run GetAdGroups.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to be removed. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService(AdWordsService.v201406.AdGroupService) + + ' Create ad group with REMOVED status. + Dim adGroup As New AdGroup + adGroup.id = adGroupId + + ' When removing an ad group, rename it to avoid name collisions with new + ' ad groups. + adGroup.name = "Removed AdGroup - " + ExampleUtilities.GetRandomString + adGroup.status = AdGroupStatus.REMOVED + + ' Create the operation. + Dim operation As New AdGroupOperation + operation.operand = adGroup + operation.operator = [Operator].SET + + Try + ' Remove the ad group. + Dim retVal As AdGroupReturnValue = adGroupService.mutate( _ + New AdGroupOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim removedAdGroup As AdGroup = retVal.value(0) + Console.WriteLine("Ad group with id = ""{0}"" was renamed to ""{1}"" and removed.", _ + removedAdGroup.id, removedAdGroup.name) + Else + Console.WriteLine("No ad groups were removed.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to remove ad groups.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/BasicOperations/RemoveCampaign.vb b/examples/AdWords/Vb/v201406/BasicOperations/RemoveCampaign.vb new file mode 100644 index 00000000000..cb4c0275337 --- /dev/null +++ b/examples/AdWords/Vb/v201406/BasicOperations/RemoveCampaign.vb @@ -0,0 +1,102 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example removes a campaign by setting the status to 'REMOVED'. + ''' To get campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignService.mutate + ''' + Public Class RemoveCampaign + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New RemoveCampaign + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example removes a campaign by setting the status to 'REMOVED'. To " & _ + "get campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to be removed. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201406.CampaignService) + + ' Create campaign with REMOVED status. + Dim campaign As New Campaign + campaign.id = campaignId + + ' When removing a campaign, rename it to avoid name collisions with new + ' campaigns. + campaign.name = "Removed Campaign - " + ExampleUtilities.GetRandomString + campaign.status = CampaignStatus.REMOVED + + ' Create the operation. + Dim operation As New CampaignOperation + operation.operand = campaign + operation.operator = [Operator].SET + + Try + ' Remove the campaign. + Dim retVal As CampaignReturnValue = campaignService.mutate( _ + New CampaignOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim removedCampaign As Campaign = retVal.value(0) + Console.WriteLine("Campaign with id = ""{0}"" was renamed to ""{1}"" and removed.", _ + removedCampaign.id, removedCampaign.name) + Else + Console.WriteLine("No campaigns were removed.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to remove campaigns.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/BasicOperations/RemoveKeyword.vb b/examples/AdWords/Vb/v201406/BasicOperations/RemoveKeyword.vb new file mode 100644 index 00000000000..b62e5dbede6 --- /dev/null +++ b/examples/AdWords/Vb/v201406/BasicOperations/RemoveKeyword.vb @@ -0,0 +1,106 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example removes a keyword using the 'REMOVE' operator. To get + ''' keywords, run GetKeywords.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class RemoveKeyword + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New RemoveKeyword + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim keywordId As Long = Long.Parse("INSERT_KEYWORD_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, keywordId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example removes a keyword using the 'REMOVE' operator. To get " & _ + "keywords, run GetKeywords.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the keyword. + ''' + ''' Id of the keyword to be removed. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal keywordId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201406.AdGroupCriterionService) + + ' Create base class criterion to avoid setting keyword-specific + ' fields. + Dim criterion As New Criterion + criterion.id = keywordId + + ' Create the ad group criterion. + Dim adGroupCriterion As New BiddableAdGroupCriterion + adGroupCriterion.adGroupId = adGroupId + adGroupCriterion.criterion = criterion + + ' Create the operation. + Dim operation As New AdGroupCriterionOperation + operation.operand = adGroupCriterion + operation.operator = [Operator].REMOVE + + Try + ' Remove the keyword. + Dim retVal As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + New AdGroupCriterionOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim removedKeyword As AdGroupCriterion = retVal.value(0) + Console.WriteLine("Keyword with ad group id = ""{0}"" and id = ""{1}"" was " & _ + "removed.", removedKeyword.adGroupId, removedKeyword.criterion.id) + Else + Console.WriteLine("No keywords were removed.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to remove keywords.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/BasicOperations/UpdateAdGroup.vb b/examples/AdWords/Vb/v201406/BasicOperations/UpdateAdGroup.vb new file mode 100644 index 00000000000..60c25879f70 --- /dev/null +++ b/examples/AdWords/Vb/v201406/BasicOperations/UpdateAdGroup.vb @@ -0,0 +1,96 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example illustrates how to update an ad group, setting its + ''' status to 'PAUSED'. To create an ad group, run AddAdGroup.vb. + ''' + ''' Tags: AdGroupService.mutate + ''' + Public Class UpdateAdGroup + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UpdateAdGroup + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to update an ad group, setting its status " & _ + "to 'PAUSED'. To create an ad group, run AddAdGroup.vb" + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to be updated. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService(AdWordsService.v201406.AdGroupService) + + ' Create the ad group. + Dim adGroup As New AdGroup + adGroup.status = AdGroupStatus.PAUSED + adGroup.id = adGroupId + + ' Create the operation. + Dim operation As New AdGroupOperation + operation.operator = [Operator].SET + operation.operand = adGroup + + Try + ' Update the ad group. + Dim retVal As AdGroupReturnValue = adGroupService.mutate(New AdGroupOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim pausedAdGroup As AdGroup = retVal.value(0) + Console.WriteLine("Ad group with id = '{0}' was successfully updated.", _ + pausedAdGroup.id) + Else + Console.WriteLine("No ad groups were updated.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to update ad groups.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/BasicOperations/UpdateCampaign.vb b/examples/AdWords/Vb/v201406/BasicOperations/UpdateCampaign.vb new file mode 100644 index 00000000000..c42016d8b02 --- /dev/null +++ b/examples/AdWords/Vb/v201406/BasicOperations/UpdateCampaign.vb @@ -0,0 +1,97 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example updates a campaign. To get campaigns, run + ''' GetCampaigns.vb. + ''' + ''' Tags: CampaignService.mutate + ''' + Public Class UpdateCampaign + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UpdateCampaign + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example updates a campaign. To get campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to be updated. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201406.CampaignService) + + ' Create campaign with updated budget. + Dim campaign As New Campaign + campaign.id = campaignId + campaign.status = CampaignStatus.PAUSED + + ' Create the operations. + Dim operation As New CampaignOperation + operation.operator = [Operator].SET + operation.operand = campaign + + Try + ' Update the campaign. + Dim retVal As CampaignReturnValue = campaignService.mutate( _ + New CampaignOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim updatedCampaign As Campaign = retVal.value(0) + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was updated.", _ + updatedCampaign.name, updatedCampaign.id) + Else + Console.WriteLine("No campaigns were updated.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to update campaigns.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/BasicOperations/UpdateKeyword.vb b/examples/AdWords/Vb/v201406/BasicOperations/UpdateKeyword.vb new file mode 100644 index 00000000000..7ece04f77ce --- /dev/null +++ b/examples/AdWords/Vb/v201406/BasicOperations/UpdateKeyword.vb @@ -0,0 +1,122 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example updates the bid of a keyword. To get keyword, run + ''' GetKeywords.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class UpdateKeyword + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UpdateKeyword + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim keywordId As Long = Long.Parse("INSERT_KEYWORD_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, keywordId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example updates the bid of a keyword. To get keyword, run GetKeywords.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the keyword. + ''' + ''' Id of the keyword to be updated. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal keywordId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201406.AdGroupCriterionService) + + ' Since we are not updating any keyword-specific fields, it is enough to + ' create a criterion object. + Dim criterion As New Criterion + criterion.id = keywordId + + ' Create ad group criterion. + Dim biddableAdGroupCriterion As New BiddableAdGroupCriterion + biddableAdGroupCriterion.adGroupId = adGroupId + biddableAdGroupCriterion.criterion = criterion + + ' Create the bids. + Dim biddingConfig As New BiddingStrategyConfiguration() + Dim cpcBid As New CpcBid() + cpcBid.bid = New Money() + cpcBid.bid.microAmount = 1000000 + biddingConfig.bids = New Bids() {cpcBid} + + biddableAdGroupCriterion.biddingStrategyConfiguration = biddingConfig + + ' Create the operation. + Dim operation As New AdGroupCriterionOperation + operation.operator = [Operator].SET + operation.operand = biddableAdGroupCriterion + + Try + ' Update the keyword. + Dim retVal As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + New AdGroupCriterionOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim adGroupCriterion As BiddableAdGroupCriterion = retVal.value(0) + Dim bidAmount As Long = 0L + For Each bids As Bids In adGroupCriterion.biddingStrategyConfiguration.bids + If TypeOf bids Is CpcBid Then + bidAmount = TryCast(bids, CpcBid).bid.microAmount + End If + Next + + Console.WriteLine("Keyword with ad group id = '{0}', id = '{1}' was updated with " & _ + "bid amount = '{2}' micros.", adGroupCriterion.adGroupId, _ + adGroupCriterion.criterion.id, bidAmount) + Else + Console.WriteLine("No keyword was updated.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to update keyword.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/CampaignManagement/AddCampaignLabels.vb b/examples/AdWords/Vb/v201406/CampaignManagement/AddCampaignLabels.vb new file mode 100644 index 00000000000..97a8fd65587 --- /dev/null +++ b/examples/AdWords/Vb/v201406/CampaignManagement/AddCampaignLabels.vb @@ -0,0 +1,108 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds a label to multiple campaigns. + ''' + ''' Tags: CampaignService.mutateLabels + ''' + Public Class AddCampaignLabels + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddCampaignLabels + Console.WriteLine(codeExample.Description) + Try + Dim campaignId1 As Long = Long.Parse("INSERT_CAMPAIGN_ID1_HERE") + Dim campaignId2 As Long = Long.Parse("INSERT_CAMPAIGN_ID2_HERE") + Dim labelId As Long = Long.Parse("INSERT_LABEL_ID_HERE") + + codeExample.Run(New AdWordsUser, campaignId1, campaignId2, labelId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a label to multiple campaigns." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to which labels are + ''' added. + ''' Id of the ad group to which labels are + ''' added. + ''' ID of the label to apply. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId1 As Long, _ + ByVal campaignId2 As Long, ByVal labelId As Long) + Try + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201406.CampaignService) + + ' Create label operations. + Dim operations As New List(Of CampaignLabelOperation) + + For Each campaignId As Long In New Long() {campaignId1, campaignId2} + Dim campaignLabel As New CampaignLabel + campaignLabel.campaignId = campaignId + campaignLabel.labelId = labelId + + Dim operation As New CampaignLabelOperation + operation.operand = campaignLabel + operation.operator = [Operator].ADD + + operations.Add(operation) + Next + + Dim retval As CampaignLabelReturnValue = campaignService.mutateLabel( _ + operations.ToArray()) + + ' Display campaign labels. + If Not (retval Is Nothing) AndAlso Not (retval.value Is Nothing) Then + For Each newCampaignLabel As CampaignLabel In retval.value + Console.WriteLine("Campaign label for campaign ID {0} and label ID {1} was added.\n", _ + newCampaignLabel.campaignId, newCampaignLabel.labelId) + Next + Else + Console.WriteLine("No campaign labels were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add campaign labels.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/CampaignManagement/AddExperiment.vb b/examples/AdWords/Vb/v201406/CampaignManagement/AddExperiment.vb new file mode 100644 index 00000000000..f2fe7ac3051 --- /dev/null +++ b/examples/AdWords/Vb/v201406/CampaignManagement/AddExperiment.vb @@ -0,0 +1,216 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example creates an experiment using a query percentage of 10, + ''' which defines what fraction of auctions should go to the control split + ''' (90%) vs. the experiment split (10%), then adds experimental bid changes + ''' for criteria and ad groups. To get campaigns, run GetCampaigns.vb. + ''' To get ad groups, run GetAdGroups.vb. To get criteria, run + ''' GetKeywords.vb. + ''' + ''' Tags: ExperimentService.mutate + ''' + Public Class AddExperiment + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddExperiment + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim criterionId As Long = Long.Parse("INSERT_CRITERION_ID_HERE") + + codeExample.Run(New AdWordsUser, campaignId, adGroupId, criterionId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example creates an experiment using a query percentage of 10, which " & _ + "defines what fraction of auctions should go to the control split (90%) vs. the " & _ + "experiment split (10%), then adds experimental bid changes for criteria and ad " & _ + "groups. To get campaigns, run GetCampaigns.vb. To get ad groups, run " & _ + "GetAdGroups.vb. To get criteria, run GetKeywords.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to which experiments are + ''' added. + ''' Id of the ad group to which experiments are + ''' added. + ''' Id of the criterion for which experiments + ''' are added. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long, ByVal adGroupId As Long, _ + ByVal criterionId As Long) + ' Get the ExperimentService. + Dim experimentService As ExperimentService = user.GetService( _ + AdWordsService.v201406.ExperimentService) + + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService(AdWordsService.v201406.AdGroupService) + + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201406.AdGroupCriterionService) + + ' Create the experiment. + Dim experiment As New Experiment + experiment.campaignId = campaignId + experiment.name = ("Interplanetary Cruise #" & ExampleUtilities.GetRandomString) + experiment.queryPercentage = 10 + experiment.startDateTime = DateTime.Now.AddDays(1).ToString("yyyyMMdd HHmmss") + + ' Optional: Set the end date. + experiment.endDateTime = DateTime.Now.AddDays(30).ToString("yyyyMMdd HHmmss") + + ' Optional: Set the status. + experiment.status = ExperimentStatus.ENABLED + + ' Create the operation. + Dim experimentOperation As New ExperimentOperation + experimentOperation.operator = [Operator].ADD + experimentOperation.operand = experiment + + Try + ' Add the experiment. + Dim experimentRetVal As ExperimentReturnValue = experimentService.mutate( _ + New ExperimentOperation() {experimentOperation}) + + 'Display the results. + If ((Not experimentRetVal Is Nothing) AndAlso (Not experimentRetVal.value Is Nothing) _ + AndAlso (experimentRetVal.value.Length > 0)) Then + Dim experimentId As Long = 0 + + Dim newExperiment As Experiment = experimentRetVal.value(0) + + Console.WriteLine("Experiment with name = ""{0}"" and id = ""{1}"" was added.", _ + newExperiment.name, newExperiment.id) + experimentId = newExperiment.id + + ' Set ad group for the experiment. + Dim adGroup As New AdGroup + adGroup.id = adGroupId + + ' Create experiment bid multiplier rule that will modify ad group bid + ' for the experiment. + Dim adGroupBidMultiplier As New ManualCPCAdGroupExperimentBidMultipliers + adGroupBidMultiplier.maxCpcMultiplier = New BidMultiplier + adGroupBidMultiplier.maxCpcMultiplier.multiplier = 1.5 + + ' Set experiment data to the ad group. + Dim adGroupExperimentData As New AdGroupExperimentData + adGroupExperimentData.experimentId = experimentId + adGroupExperimentData.experimentDeltaStatus = ExperimentDeltaStatus.MODIFIED + adGroupExperimentData.experimentBidMultipliers = adGroupBidMultiplier + + adGroup.experimentData = adGroupExperimentData + + ' Create the operation. + Dim adGroupOperation As New AdGroupOperation + adGroupOperation.operand = adGroup + adGroupOperation.operator = [Operator].SET + + ' Update the ad group. + Dim adGroupRetVal As AdGroupReturnValue = adGroupService.mutate( _ + New AdGroupOperation() {adGroupOperation}) + + ' Display the results. + If ((Not adGroupRetVal Is Nothing) AndAlso (Not adGroupRetVal.value Is Nothing) _ + AndAlso (adGroupRetVal.value.Length > 0)) Then + Dim updatedAdGroup As AdGroup = adGroupRetVal.value(0) + Console.WriteLine("Ad group with name = ""{0}"", id = ""{1}"" and status = " & _ + """{2}"" was updated for the experiment.", updatedAdGroup.name, _ + updatedAdGroup.id, updatedAdGroup.status) + Else + Console.WriteLine("No ad groups were updated.") + End If + + ' Set ad group criteria for the experiment. + Dim criterion As New Criterion + criterion.id = criterionId + + Dim adGroupCriterion As New BiddableAdGroupCriterion + adGroupCriterion.adGroupId = adGroupId + adGroupCriterion.criterion = criterion + + ' Create experiment bid multiplier rule that will modify criterion bid + ' for the experiment. + Dim bidMultiplier As New ManualCPCAdGroupCriterionExperimentBidMultiplier + bidMultiplier.maxCpcMultiplier = New BidMultiplier + bidMultiplier.maxCpcMultiplier.multiplier = 1.5 + + ' Set experiment data to the criterion. + Dim adGroupCriterionExperimentData As New BiddableAdGroupCriterionExperimentData + adGroupCriterionExperimentData.experimentId = experimentId + adGroupCriterionExperimentData.experimentDeltaStatus = ExperimentDeltaStatus.MODIFIED + adGroupCriterionExperimentData.experimentBidMultiplier = bidMultiplier + + adGroupCriterion.experimentData = adGroupCriterionExperimentData + + ' Create the operation. + Dim adGroupCriterionOperation As New AdGroupCriterionOperation + adGroupCriterionOperation.operand = adGroupCriterion + adGroupCriterionOperation.operator = [Operator].SET + + ' Update the ad group criteria. + Dim adGroupCriterionRetVal As AdGroupCriterionReturnValue = _ + adGroupCriterionService.mutate(New AdGroupCriterionOperation() _ + {adGroupCriterionOperation}) + + ' Display the results. + If ((Not adGroupCriterionRetVal Is Nothing) AndAlso _ + (Not adGroupCriterionRetVal.value Is Nothing) AndAlso _ + (adGroupCriterionRetVal.value.Length > 0)) Then + Dim updatedAdGroupCriterion As AdGroupCriterion = adGroupCriterionRetVal.value(0) + Console.WriteLine("Ad group criterion with ad group id = ""{0}"", criterion id =" & _ + " ""{1}"" and type = ""{2}"" was updated for the experiment.", _ + updatedAdGroupCriterion.adGroupId, updatedAdGroupCriterion.criterion.id, _ + updatedAdGroupCriterion.criterion.CriterionType) + Else + Console.WriteLine("No ad group criteria were updated.") + End If + Else + Console.WriteLine("No experiments were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add experiment(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/CampaignManagement/AddKeywordsInBulk.vb b/examples/AdWords/Vb/v201406/CampaignManagement/AddKeywordsInBulk.vb new file mode 100644 index 00000000000..e5c5cb57925 --- /dev/null +++ b/examples/AdWords/Vb/v201406/CampaignManagement/AddKeywordsInBulk.vb @@ -0,0 +1,186 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Text.RegularExpressions +Imports System.Threading + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example shows how to add keywords in bulk using the + ''' MutateJobService. + ''' + ''' Tags: MutateJobService.mutate, MutateJobService.get + ''' Tags: MutateJobService.getResult + ''' + Public Class AddKeywordsInBulk + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddKeywordsInBulk + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example shows how to add keywords in bulk using the MutateJobService." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad groups to which keywords are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the MutateJobService. + Dim mutateJobService As MutateJobService = user.GetService( _ + AdWordsService.v201406.MutateJobService) + + Const RETRY_INTERVAL As Integer = 30 + Const RETRIES_COUNT As Integer = 30 + Const KEYWORD_NUMBER As Integer = 100 + Const INDEX_REGEX As String = "operations\[(\d+)\].operand" + + Dim operations As New List(Of Operation) + + ' Create AdGroupCriterionOperation to add keywords. + For i As Integer = 0 To KEYWORD_NUMBER + Dim keyword As New Keyword + keyword.text = String.Format("mars cruise {0}", i) + keyword.matchType = KeywordMatchType.BROAD + + Dim criterion As New BiddableAdGroupCriterion + criterion.adGroupId = adGroupId + criterion.criterion = keyword + + Dim adGroupCriterionOperation As New AdGroupCriterionOperation + adGroupCriterionOperation.operator = [Operator].ADD + adGroupCriterionOperation.operand = criterion + + operations.Add(adGroupCriterionOperation) + Next i + + Dim policy As New BulkMutateJobPolicy + ' You can specify up to 3 job IDs that must successfully complete before + ' this job can be processed. + policy.prerequisiteJobIds = New Long() {} + + Dim job As SimpleMutateJob = mutateJobService.mutate(operations.ToArray, policy) + + ' Wait for the job to complete. + Dim completed As Boolean = False + Dim retryCount As Integer = 0 + Console.WriteLine("Retrieving job status...") + + While (completed = False AndAlso retryCount < RETRIES_COUNT) + Dim selector As New BulkMutateJobSelector + selector.jobIds = New Long() {job.id} + + Try + Dim allJobs As Job() = mutateJobService.get(selector) + If ((Not allJobs Is Nothing) AndAlso (allJobs.Length > 0)) Then + job = allJobs(0) + If ((job.status = BasicJobStatus.COMPLETED) OrElse _ + (job.status = BasicJobStatus.FAILED)) Then + completed = True + Exit While + Else + Console.WriteLine("{0}: Current status is {1}, waiting {2} seconds to retry...", _ + retryCount, job.status, RETRY_INTERVAL) + Thread.Sleep(RETRY_INTERVAL * 1000) + retryCount = retryCount + 1 + End If + End If + Catch ex As Exception + Throw New System.ApplicationException(String.Format("Failed to fetch simple mutate " & _ + "job with id = {0}.", job.id), ex) + Return + End Try + End While + + If (job.status = BasicJobStatus.COMPLETED) Then + ' Handle cases where the job completed. + + ' Create the job selector. + Dim selector As New BulkMutateJobSelector + selector.jobIds = New Long() {job.id} + + ' Get the job results. + Dim jobResult As JobResult = mutateJobService.getResult(selector) + If Not jobResult Is Nothing Then + Dim results As SimpleMutateResult = jobResult.Item + If Not results Is Nothing Then + 'Display the results. + If Not results.results Is Nothing Then + For i As Integer = 0 To results.results.Length - 1 + Dim operand As Operand = results.results(i) + Dim status As String + If TypeOf operand.Item Is PlaceHolder Then + status = "FAILED" + Else + status = "SUCCEEDED" + End If + Console.WriteLine("Operation {0} - {1}", i, status) + Next i + End If + + ' Display the errors. + If Not results.errors Is Nothing Then + For Each apiError As ApiError In results.errors + Dim match As Match = Regex.Match(apiError.fieldPath, INDEX_REGEX, _ + RegexOptions.IgnoreCase) + Dim index As String = "???" + If (match.Success) Then + index = match.Groups(1).Value + End If + Console.WriteLine("Operation index {0} failed due to reason: '{1}', " & _ + "trigger: '{2}'", index, apiError.errorString, apiError.trigger) + Next + End If + End If + End If + Console.WriteLine("Job completed successfully!") + ElseIf (job.status = BasicJobStatus.FAILED) Then + ' Handle the cases where job failed. + Console.WriteLine("Job failed with reason: " & job.failureReason.ToString()) + ElseIf (job.status = BasicJobStatus.PROCESSING OrElse job.status = BasicJobStatus.PENDING) _ + Then + ' Handle the cases where job didn't complete after wait period. + Console.WriteLine("Job did not complete in {0} secconds.", RETRY_INTERVAL * RETRIES_COUNT) + End If + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/CampaignManagement/AddLocationExtension.vb b/examples/AdWords/Vb/v201406/CampaignManagement/AddLocationExtension.vb new file mode 100644 index 00000000000..dc494a6e208 --- /dev/null +++ b/examples/AdWords/Vb/v201406/CampaignManagement/AddLocationExtension.vb @@ -0,0 +1,150 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example shows how to add a location extension to an existing + ''' campaign. To create a campaign, run AddCampaign.vb. + ''' + ''' Tags: GeoLocationService.get, CampaignAdExtensionService.mutate + ''' + Public Class AddLocationExtension + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddLocationExtension + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example shows how to add a location extension to an existing" & _ + " campaign. To create a campaign, run AddCampaign.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to which location + ''' extensions are added. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignAdExtensionService. + Dim campaignExtensionService As CampaignAdExtensionService = user.GetService( _ + AdWordsService.v201406.CampaignAdExtensionService) + + ' Add location 1: 1600 Amphitheatre Pkwy, Mountain View, US. + Dim address1 As New Address + address1.streetAddress = "1600 Amphitheatre Parkway" + address1.cityName = "Mountain View" + address1.provinceCode = "CA" + address1.postalCode = "94043" + address1.countryCode = "US" + + ' Add location 2: 38 avenue de l'Opéra, 75002 Paris, FR. + Dim address2 As New Address + address2.streetAddress = "38 avenue de l'Opéra" + address2.cityName = "Paris" + address2.postalCode = "75002" + address2.countryCode = "FR" + + ' Get the GeoLocationService. + Dim geoService As GeoLocationService = user.GetService( _ + AdWordsService.v201406.GeoLocationService) + + ' Create the selector. + Dim selector As New GeoLocationSelector + selector.addresses = New Address() {address1, address2} + + ' Retrieve the locations. + Dim locations As GeoLocation() = geoService.get(selector) + + Dim operations As New List(Of CampaignAdExtensionOperation) + + ' Phone numbers for US and FR offices. + Dim phoneNumbers As String() = New String() {"(650) 253-0000", "(0)1 42 68 53 00"} + Dim index As Integer = 0 + + ' Create a location extension for each geo location returned by the + ' server. + For Each location As GeoLocation In locations + Dim locationExtension As New LocationExtension + locationExtension.address = location.address + locationExtension.geoPoint = location.geoPoint + locationExtension.encodedLocation = location.encodedLocation + locationExtension.source = LocationExtensionSource.ADWORDS_FRONTEND + + ' Optional: Set the company name. + locationExtension.companyName = "ACME Inc." + + ' Optional: Set the phone number. + locationExtension.phoneNumber = phoneNumbers(index) + index = index + 1 + + Dim extension As New CampaignAdExtension + extension.campaignId = campaignId + extension.status = CampaignAdExtensionStatus.ENABLED + extension.adExtension = locationExtension + + Dim operation As New CampaignAdExtensionOperation + operation.operator = [Operator].ADD + operation.operand = extension + + operations.Add(operation) + Next + + Try + ' Create the location extensions. + Dim retVal As CampaignAdExtensionReturnValue = campaignExtensionService.mutate( _ + operations.ToArray) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + For Each campaignExtension As CampaignAdExtension In retVal.value + Console.WriteLine("Created a location extension with id = ""{0}"" and status " & _ + "= ""{1}""", campaignExtension.adExtension.id, campaignExtension.status) + Next + Else + Console.WriteLine("No location extensions were created.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add location extensions.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/CampaignManagement/GetAllDisapprovedAds.vb b/examples/AdWords/Vb/v201406/CampaignManagement/GetAllDisapprovedAds.vb new file mode 100644 index 00000000000..8ffbecc6a66 --- /dev/null +++ b/examples/AdWords/Vb/v201406/CampaignManagement/GetAllDisapprovedAds.vb @@ -0,0 +1,121 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example retrieves all the disapproved ads in a given campaign. + ''' + ''' Tags: AdGroupAdService.get + ''' + Public Class GetAllDisapprovedAds + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAllDisapprovedAds + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves all the disapproved ads in a given campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which disapproved ads + ''' are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201406.AdGroupAdService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "AdGroupCreativeApprovalStatus", _ + "AdGroupAdDisapprovalReasons"} + + ' Set the filters. + Dim campaignPredicate As New Predicate + campaignPredicate.operator = PredicateOperator.EQUALS + campaignPredicate.field = "CampaignId" + campaignPredicate.values = New String() {campaignId.ToString} + + Dim approvalPredicate As New Predicate + approvalPredicate.operator = PredicateOperator.EQUALS + approvalPredicate.field = "AdGroupCreativeApprovalStatus" + approvalPredicate.values = New String() {AdGroupAdApprovalStatus.DISAPPROVED.ToString()} + + selector.predicates = New Predicate() {campaignPredicate, approvalPredicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupAdPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the disapproved ads. + page = service.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each adGroupAd As AdGroupAd In page.entries + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " & _ + "reason(s):", i, adGroupAd.ad.id) + For Each reason As String In adGroupAd.disapprovalReasons + Console.WriteLine(" {0}", reason) + Next + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get disapproved ads.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb b/examples/AdWords/Vb/v201406/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb new file mode 100644 index 00000000000..f0afebc0a75 --- /dev/null +++ b/examples/AdWords/Vb/v201406/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb @@ -0,0 +1,111 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example retrieves all the disapproved ads in a given campaign + ''' using an AWQL query. See + ''' https://developers.google.com/adwords/api/docs/guides/awql for AWQL + ''' documentation. + ''' + ''' Tags: AdGroupAdService.get + ''' + Public Class GetAllDisapprovedAdsWithAwql + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAllDisapprovedAdsWithAwql + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves all the disapproved ads in a given campaign using " & _ + "an AWQL query. See https://developers.google.com/adwords/api/docs/guides/awql for " & _ + "AWQL documentation." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which disapproved ads + ''' are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201406.AdGroupAdService) + + ' Get all the disapproved ads for this campaign. + Dim query As String = String.Format("SELECT Id, AdGroupAdDisapprovalReasons WHERE " & _ + "CampaignId = {0} AND AdGroupCreativeApprovalStatus = DISAPPROVED ORDER BY Id", _ + campaignId) + + Dim offset As Long = 0 + Dim pageSize As Long = 500 + + Dim page As New AdGroupAdPage() + + Try + Do + Dim queryWithPaging As String = String.Format("{0} LIMIT {1}, {2}", query, offset, _ + pageSize) + + ' Get the disapproved ads. + page = service.query(queryWithPaging) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each adGroupAd As AdGroupAd In page.entries + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " & _ + "reason(s):", i, adGroupAd.ad.id) + For Each reason As String In adGroupAd.disapprovalReasons + Console.WriteLine(" {0}", reason) + Next + i = i + 1 + Next + End If + + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get disapproved ads.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/CampaignManagement/GetCampaignsByLabel.vb b/examples/AdWords/Vb/v201406/CampaignManagement/GetCampaignsByLabel.vb new file mode 100644 index 00000000000..142e6f83202 --- /dev/null +++ b/examples/AdWords/Vb/v201406/CampaignManagement/GetCampaignsByLabel.vb @@ -0,0 +1,123 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example gets all campaigns with a specific label. To add a + ''' label to campaigns, run AddCampaignLabels.vb. + ''' + ''' Tags: CampaignService.get + ''' + Public Class GetCampaignsByLabel + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetCampaignsByLabel + Console.WriteLine(codeExample.Description) + Dim labelId As Long = Long.Parse("INSERT_LABEL_ID_HERE") + + Try + codeExample.Run(New AdWordsUser, labelId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all campaigns with a specific label. To add a" & _ + " label to campaigns, run AddCampaignLabels.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' ID of the label. + Public Sub Run(ByVal user As AdWordsUser, ByVal labelId As Long) + ' Get the CampaignService. + Dim campaignService As CampaignService = _ + user.GetService(AdWordsService.v201406.CampaignService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "Name", "Labels"} + + ' Labels filtering is performed by ID. You can use CONTAINS_ANY to + ' select campaigns with any of the label IDs, CONTAINS_ALL to select + ' campaigns with all of the label IDs, or CONTAINS_NONE to select + ' campaigns with none of the label IDs. + Dim predicate As New Predicate + predicate.operator = PredicateOperator.CONTAINS_ANY + predicate.field = "Labels" + predicate.values = New String() {labelId.ToString()} + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New CampaignPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the campaigns. + page = campaignService.get(selector) + + ' Display the results. + If Not (page Is Nothing) AndAlso Not (page.entries Is Nothing) Then + Dim i As Integer = offset + For Each campaign As Campaign In page.entries + Dim labelNames As New List(Of String) + For Each label As Label In campaign.labels + labelNames.Add(label.name) + Next + + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and labels = " & _ + "'{3}' was found.", i + 1, campaign.id, campaign.name, _ + String.Join(", ", labelNames.ToArray())) + i = i + 1 + Next + End If + offset += pageSize + Loop While offset < page.totalNumEntries + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve campaigns by label.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/CampaignManagement/PromoteExperiment.vb b/examples/AdWords/Vb/v201406/CampaignManagement/PromoteExperiment.vb new file mode 100644 index 00000000000..ffe5b7e91c9 --- /dev/null +++ b/examples/AdWords/Vb/v201406/CampaignManagement/PromoteExperiment.vb @@ -0,0 +1,100 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This example promotes an experiment, which permanently applies all the + ''' experiment changes made to its related ad groups, criteria and ads. To + ''' create an experiment, run AddExperiment.vb. + ''' + ''' Tags: ExperimentService.mutate + ''' + Public Class PromoteExperiment + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New PromoteExperiment + Console.WriteLine(codeExample.Description) + Try + Dim experimentId As Long = Long.Parse("INSERT_EXPERIMENT_ID_HERE") + codeExample.Run(New AdWordsUser, experimentId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This example promotes an experiment, which permanently applies all the " & _ + "experiment changes made to its related ad groups, criteria and ads. To create an " & _ + "experiment, run AddExperiment.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the experiment to be promoted. + Public Sub Run(ByVal user As AdWordsUser, ByVal experimentId As Long) + ' Get the ExperimentService. + Dim experimentService As ExperimentService = user.GetService( _ + AdWordsService.v201406.ExperimentService) + + ' Set experiment's status to PROMOTED. + Dim experiment As New Experiment + experiment.id = experimentId + experiment.status = ExperimentStatus.PROMOTED + + ' Create the operation. + Dim operation As New ExperimentOperation + operation.operator = [Operator].SET + operation.operand = experiment + + Try + ' Update the experiment. + Dim retVal As ExperimentReturnValue = experimentService.mutate( _ + New ExperimentOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim promotedExperiment As Experiment = retVal.value(0) + Console.WriteLine("Experiment with name = ""{0}"" and id = ""{1}"" was promoted.", _ + promotedExperiment.name, promotedExperiment.id) + Else + Console.WriteLine("No experiments were promoted.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to promote experiment(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/CampaignManagement/SetAdParameters.vb b/examples/AdWords/Vb/v201406/CampaignManagement/SetAdParameters.vb new file mode 100644 index 00000000000..83e57bc9fd2 --- /dev/null +++ b/examples/AdWords/Vb/v201406/CampaignManagement/SetAdParameters.vb @@ -0,0 +1,155 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example illustrates how to create a text ad with ad parameters. + ''' To add an ad group, run AddAdGroup.vb. To add a keyword, run + ''' AddKeyword.vb. + ''' + ''' Tags: AdGroupAdService.mutate, AdParamService.mutate + ''' + Public Class SetAdParameters + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New SetAdParameters + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim criterionId As Long = Long.Parse("INSERT_CRITERION_ID_HERE") + + codeExample.Run(New AdWordsUser, adGroupId, criterionId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to create a text ad with ad parameters. To " & _ + "add an ad group, run AddAdGroup.vb. To add a keyword, run AddKeyword.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the criterion. + ''' + ''' Id of the keyword for which the ad + ''' parameters are set. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal criterionId As Long) + ' Get the AdGroupAdService. + Dim adGroupAdService As AdGroupAdService = user.GetService( _ + AdWordsService.v201406.AdGroupAdService) + + ' Get the AdParamService. + Dim adParamService As AdParamService = user.GetService( _ + AdWordsService.v201406.AdParamService) + + ' Create the text ad. + Dim textAd As New TextAd + textAd.url = "http://www.example.com" + textAd.displayUrl = "example.com" + textAd.headline = " Mars Cruises" + textAd.description1 = "Low-gravity fun for {param1:cheap}." + textAd.description2 = "Only {param2:a few} seats left!" + + Dim adOperand As New AdGroupAd + adOperand.adGroupId = adGroupId + adOperand.status = AdGroupAdStatus.ENABLED + adOperand.ad = textAd + + ' Create the operation. + Dim adOperation As New AdGroupAdOperation + adOperation.operand = adOperand + adOperation.operator = [Operator].ADD + + Try + ' Create the text ad. + Dim retVal As AdGroupAdReturnValue = adGroupAdService.mutate( _ + New AdGroupAdOperation() {adOperation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) _ + AndAlso (retVal.value.Length > 0)) Then + Console.WriteLine("Text ad with id = ""{0}"" was successfully added.", _ + retVal.value(0).ad.id) + Else + Console.WriteLine("No text ads were created.") + Return + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create text ads.", ex) + Return + End Try + + ' Create the ad param for price. + Dim priceParam As New AdParam + priceParam.adGroupId = adGroupId + priceParam.criterionId = criterionId + priceParam.paramIndex = 1 + priceParam.insertionText = "$100" + + ' Create the ad param for seats. + Dim seatParam As New AdParam + seatParam.adGroupId = adGroupId + seatParam.criterionId = criterionId + seatParam.paramIndex = 2 + seatParam.insertionText = "50" + + ' Create the operations. + Dim priceOperation As New AdParamOperation + priceOperation.operator = [Operator].SET + priceOperation.operand = priceParam + + Dim seatOperation As New AdParamOperation + seatOperation.operator = [Operator].SET + seatOperation.operand = seatParam + + Try + ' Set the ad parameters. + Dim newAdParams As AdParam() = adParamService.mutate(New AdParamOperation() _ + {priceOperation, seatOperation}) + + 'Display the results. + If (Not newAdParams Is Nothing) Then + Console.WriteLine("Ad parameters were successfully updated.") + Else + Console.WriteLine("No ad parameters were set.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to set ad parameter(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/CampaignManagement/SetBidModifier.vb b/examples/AdWords/Vb/v201406/CampaignManagement/SetBidModifier.vb new file mode 100644 index 00000000000..f3dabdf8962 --- /dev/null +++ b/examples/AdWords/Vb/v201406/CampaignManagement/SetBidModifier.vb @@ -0,0 +1,112 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example sets a bid modifier for the mobile platform on given + ''' campaign. The campaign must be an enhanced type of campaign. To get + ''' campaigns, run GetCampaigns.vb. To enhance a campaign, run + ''' SetCampaignEnhanced.vb. + ''' + ''' Tags: CampaignCriterionService.mutate + ''' + Public Class SetBidModifier + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New SetBidModifier + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + Dim bidModifier As Double = Double.Parse("INSERT_BID_MODIFIER_HERE") + codeExample.Run(New AdWordsUser, campaignId, bidModifier) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example sets a bid modifier for the mobile platform on given " & _ + "campaign. The campaign must be an enhanced type of campaign. To get campaigns, " & _ + "run GetCampaigns.vb. To enhance a campaign, run SetCampaignEnhanced.vb." + End Get + End Property + + ''' + ''' Runs the specified user. + ''' + ''' The AdWords user. + ''' Id of the campaign whose bid should be modified. + ''' + ''' The bid modifier. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long, ByVal bidModifier As Double) + ' Get the CampaignCriterionService. + Dim campaignCriterionService As CampaignCriterionService = user.GetService( _ + AdWordsService.v201406.CampaignCriterionService) + + ' Create mobile platform. The ID can be found in the documentation. + ' https://developers.google.com/adwords/api/docs/appendix/platforms + Dim mobile As New Platform() + mobile.id = 30001 + + ' Create criterion with modified bid. + Dim criterion As New CampaignCriterion() + criterion.campaignId = campaignId + criterion.criterion = mobile + criterion.bidModifier = bidModifier + + ' Create SET operation. + Dim operation As New CampaignCriterionOperation() + operation.operator = [Operator].SET + operation.operand = criterion + + Try + ' Update campaign criteria. + Dim result As CampaignCriterionReturnValue = campaignCriterionService.mutate( _ + New CampaignCriterionOperation() {operation}) + + ' Display campaign criteria. + If Not result.value Is Nothing Then + For Each newCriterion As CampaignCriterion In result.value + Console.WriteLine("Campaign criterion with campaign id '{0}', criterion id '{1}' " & _ + "and type '{2}' was modified with bid {3:F2}.", newCriterion.campaignId, _ + newCriterion.criterion.id, newCriterion.criterion.type, newCriterion.bidModifier) + Next + Else + Console.WriteLine("No campaigns were modified.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to set bid modifier.", ex) + End Try + End Sub + End Class +End Namespace \ No newline at end of file diff --git a/examples/AdWords/Vb/v201406/CampaignManagement/ValidateTextAd.vb b/examples/AdWords/Vb/v201406/CampaignManagement/ValidateTextAd.vb new file mode 100644 index 00000000000..553abb2a087 --- /dev/null +++ b/examples/AdWords/Vb/v201406/CampaignManagement/ValidateTextAd.vb @@ -0,0 +1,110 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example shows how to use the validateOnly header to validate + ''' a text ad. No objects will be created, but exceptions will still be + ''' thrown. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class ValidateTextAd + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New ValidateTextAd + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example shows how to use the validateOnly header to validate a text " & _ + "ad. No objects will be created, but exceptions will still be thrown." + End Get + End Property + + ''' + ''' Runs the specified user. + ''' + ''' The AdWords user. + ''' Id of the ad group to which text ads are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim adGroupAdService As AdGroupAdService = user.GetService( _ + AdWordsService.v201406.AdGroupAdService) + + ' Set the validateOnly headers. + adGroupAdService.RequestHeader.validateOnly = True + + ' Create your text ad. + Dim textAd As New TextAd + textAd.headline = "Luxury Cruise to Mars" + textAd.description1 = "Visit the Red Planet in style." + textAd.description2 = "Low-gravity fun for everyone!!" + textAd.displayUrl = "www.example.com" + textAd.url = "http://www.example.com" + + Dim textAdGroupAd As New AdGroupAd + textAdGroupAd.adGroupId = adGroupId + textAdGroupAd.ad = textAd + + Dim textAdOperation As New AdGroupAdOperation + textAdOperation.operator = [Operator].ADD + textAdOperation.operand = textAdGroupAd + Try + Dim retVal As AdGroupAdReturnValue = adGroupAdService.mutate( _ + New AdGroupAdOperation() {textAdOperation}) + ' Since validation is ON, result will be null. + Console.WriteLine("text ad validated successfully.") + Catch ex As AdWordsApiException + ' This block will be hit if there is a validation error from the server. + Console.WriteLine("There were validation error(s) while adding text ad.") + + If (Not ex.ApiException Is Nothing) Then + For Each apiError As ApiError In DirectCast(ex.ApiException, ApiException).errors + Console.WriteLine(" Error type is '{0}' and fieldPath is '{1}'.", _ + apiError.ApiErrorType, apiError.fieldPath) + Next + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to validate text ad.", ex) + End Try + End Sub + End Class +End Namespace \ No newline at end of file diff --git a/examples/AdWords/Vb/v201406/ErrorHandling/HandlePartialFailures.vb b/examples/AdWords/Vb/v201406/ErrorHandling/HandlePartialFailures.vb new file mode 100644 index 00000000000..93cb50d79e1 --- /dev/null +++ b/examples/AdWords/Vb/v201406/ErrorHandling/HandlePartialFailures.vb @@ -0,0 +1,137 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example demonstrates how to handle partial failures. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class HandlePartialFailures + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandlePartialFailures + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example demonstrates how to handle partial failures." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which keywords are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201406.AdGroupCriterionService) + + ' Set partial failure mode for the service. + adGroupCriterionService.RequestHeader.partialFailure = True + + Dim operations As New List(Of AdGroupCriterionOperation) + + ' Create the keywords. + Dim keywords As String() = New String() {"mars cruise", "inv@lid cruise", "venus cruise", _ + "b(a)d keyword cruise"} + + For Each keywordText As String In keywords + Dim keyword As New Keyword + keyword.text = keywordText + keyword.matchType = KeywordMatchType.BROAD + + ' Create biddable ad group criterion. + Dim keywordBiddableAdGroupCriterion As New BiddableAdGroupCriterion + keywordBiddableAdGroupCriterion.adGroupId = adGroupId + keywordBiddableAdGroupCriterion.criterion = keyword + + ' Create the operation. + Dim keywordAdGroupCriterionOperation As New AdGroupCriterionOperation + keywordAdGroupCriterionOperation.operand = keywordBiddableAdGroupCriterion + keywordAdGroupCriterionOperation.operator = [Operator].ADD + operations.Add(keywordAdGroupCriterionOperation) + Next + + Try + ' Create the keywords. + Dim result As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + operations.ToArray) + + ' Display the results. + If ((Not result Is Nothing) AndAlso (Not result.value Is Nothing)) Then + For Each adGroupCriterionResult As AdGroupCriterion In result.value + If (Not adGroupCriterionResult.criterion Is Nothing) Then + Console.WriteLine("Keyword with ad group id '{0}', and criterion id " & _ + "'{1}', and text '{2}' was added.\n", adGroupCriterionResult.adGroupId, _ + adGroupCriterionResult.criterion.id, _ + DirectCast(adGroupCriterionResult.criterion, Keyword).text) + End If + Next + Else + Console.WriteLine("No keywords were added.") + End If + + ' Display the partial failure errors. + If ((Not result Is Nothing) AndAlso (Not result.partialFailureErrors Is Nothing)) Then + For Each apiError As ApiError In result.partialFailureErrors + Dim operationIndex As Integer = ErrorUtilities.GetOperationIndex(apiError.fieldPath) + If (operationIndex <> -1) Then + Dim adGroupCriterion As AdGroupCriterion = operations(operationIndex).operand + Console.WriteLine("Keyword with ad group id '{0}' and text '{1}' " & _ + "triggered a failure for the following reason: '{2}'.\n", _ + adGroupCriterion.adGroupId, _ + DirectCast(adGroupCriterion.criterion, Keyword).text, _ + apiError.errorString) + Else + Console.WriteLine("A failure for the following reason: '{0}' has occurred.\n", _ + apiError.errorString) + End If + Next + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add keyword(s) in partial failure mode.", _ + ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/ErrorHandling/HandlePolicyViolationError.vb b/examples/AdWords/Vb/v201406/ErrorHandling/HandlePolicyViolationError.vb new file mode 100644 index 00000000000..6d9c32c4217 --- /dev/null +++ b/examples/AdWords/Vb/v201406/ErrorHandling/HandlePolicyViolationError.vb @@ -0,0 +1,175 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds a text ad, and shows how to handle a policy + ''' violation. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class HandlePolicyViolationError + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandlePolicyViolationError + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a text ad, and shows how to handle a policy violation." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which ads are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService( _ + AdWordsService.v201406.AdGroupAdService) + + ' Create the text ad. + Dim textAd As New TextAd + textAd.headline = "Luxury Cruise to Mars" + textAd.description1 = "Visit the Red Planet in style." + textAd.description2 = "Low-gravity fun for everyone!!" + textAd.displayUrl = "www.example.com" + textAd.url = "http://www.example.com" + + Dim textadGroupAd As New AdGroupAd + textadGroupAd.adGroupId = adGroupId + textadGroupAd.ad = textAd + + ' Create the operations. + Dim textAdOperation As New AdGroupAdOperation + textAdOperation.operator = [Operator].ADD + textAdOperation.operand = textadGroupAd + + Try + Dim retVal As AdGroupAdReturnValue = Nothing + + ' Setup two arrays, one to hold the list of all operations to be + ' validated, and another to hold the list of operations that cannot be + ' fixed after validation. + Dim allOperations As New List(Of AdGroupAdOperation) + Dim operationsToBeRemoved As New List(Of AdGroupAdOperation) + + allOperations.Add(textAdOperation) + + Try + ' Validate the operations. + service.RequestHeader.validateOnly = True + retVal = service.mutate(allOperations.ToArray) + Catch ex As AdWordsApiException + Dim innerException As ApiException = TryCast(ex.ApiException, ApiException) + If (innerException Is Nothing) Then + Throw New Exception("Failed to retrieve ApiError. See inner exception for more " & _ + "details.", ex) + End If + + ' Examine each ApiError received from the server. + For Each apiError As ApiError In innerException.errors + Dim index As Integer = ErrorUtilities.GetOperationIndex(apiError.fieldPath) + If (index = -1) Then + ' This API error is not associated with an operand, so we cannot + ' recover from this error by removing one or more operations. + ' Rethrow the exception for manual inspection. + Throw + End If + + ' Handle policy violation errors. + If TypeOf apiError Is PolicyViolationError Then + Dim policyError As PolicyViolationError = apiError + + If policyError.isExemptable Then + ' If the policy violation error is exemptable, add an exemption + ' request. + Dim exemptionRequests As New List(Of ExemptionRequest) + If (Not allOperations.Item(index).exemptionRequests Is Nothing) Then + exemptionRequests.AddRange(allOperations.Item(index).exemptionRequests) + End If + + Dim exemptionRequest As New ExemptionRequest + exemptionRequest.key = policyError.key + exemptionRequests.Add(exemptionRequest) + allOperations.Item(index).exemptionRequests = exemptionRequests.ToArray + Else + ' Policy violation error is not exemptable, remove this + ' operation from the list of operations. + operationsToBeRemoved.Add(allOperations.Item(index)) + End If + Else + ' This is not a policy violation error, remove this operation + ' from the list of operations. + operationsToBeRemoved.Add(allOperations.Item(index)) + End If + Next + + ' Remove all operations that aren't exemptable. + For Each operation As AdGroupAdOperation In operationsToBeRemoved + allOperations.Remove(operation) + Next + End Try + If (allOperations.Count > 0) Then + ' Perform the operations exemptible of a policy violation. + service.RequestHeader.validateOnly = False + retVal = service.mutate(allOperations.ToArray) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) _ + AndAlso (retVal.value.Length > 0)) Then + For Each newAdGroupAd As AdGroupAd In retVal.value + Console.WriteLine("New ad with id = ""{0}"" and displayUrl = ""{1}"" was created.", _ + newAdGroupAd.ad.id, newAdGroupAd.ad.displayUrl) + Next + Else + Console.WriteLine("No ads were created.") + End If + Else + Console.WriteLine("There are no ads to create after policy violation checks.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create Ad(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/ErrorHandling/HandleRateExceededError.vb b/examples/AdWords/Vb/v201406/ErrorHandling/HandleRateExceededError.vb new file mode 100644 index 00000000000..06be1ff6f03 --- /dev/null +++ b/examples/AdWords/Vb/v201406/ErrorHandling/HandleRateExceededError.vb @@ -0,0 +1,206 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Net +Imports System.Threading + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example shows how to handle RateExceededError in your + ''' application. To trigger the rate exceeded error, this code example runs + ''' 100 threads in parallel, each thread attempting to validate 100 keywords + ''' in a single request. Note that spawning 100 parallel threads is for + ''' illustrative purposes only, you shouldn't do this in your application. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class HandleRateExceededError + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandleRateExceededError + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example shows how to handle RateExceededError in your application. " & _ + "To trigger the rate exceeded error, this code example runs 100 threads in " & _ + "parallel, each thread attempting to validate 100 keywords in a single request. " & _ + "Note that spawning 100 parallel threads is for illustrative purposes only, you " & _ + "shouldn't do this in your application." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which keywords are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + Const NUM_THREADS As Integer = 100 + + ' Increase the maximum number of parallel HTTP connections that .NET + ' framework allows. By default, this is set to 2 by the .NET framework. + ServicePointManager.DefaultConnectionLimit = NUM_THREADS + + Dim threads As New List(Of Thread) + + For i As Integer = 0 To NUM_THREADS + Dim thread As New Thread(AddressOf New KeywordThread(user, i, adGroupId).Run) + threads.Add(thread) + Next i + + For i As Integer = 0 To threads.Count - 1 + threads.Item(i).Start(i) + Next i + + For i As Integer = 0 To threads.Count - 1 + threads.Item(i).Join() + Next i + End Sub + + ''' + ''' Thread class for validating keywords. + ''' + Public Class KeywordThread + ''' + ''' Index of this thread, for identifying and debugging. + ''' + Dim threadIndex As Integer + + ''' + ''' The ad group id to which keywords are added. + ''' + Dim adGroupId As Long + + ''' + ''' The AdWords user who owns this ad group. + ''' + Dim user As AdWordsUser + + ''' + ''' Number of keywords to be validated in each API call. + ''' + Const NUM_KEYWORDS As Integer = 100 + + ''' + ''' Initializes a new instance of the class. + ''' + ''' Index of the thread. + ''' The ad group id. + ''' The AdWords user who owns the ad group. + Public Sub New(ByVal user As AdWordsUser, ByVal threadIndex As Integer, _ + ByVal adGroupId As Long) + Me.user = user + Me.threadIndex = threadIndex + Me.adGroupId = adGroupId + End Sub + + ''' + ''' Main method for the thread. + ''' + ''' The thread parameter. + Public Sub Run(ByVal obj As Object) + ' Create the operations. + Dim operations As New List(Of AdGroupCriterionOperation) + For j As Integer = 0 To NUM_KEYWORDS + ' Create the keyword. + Dim keyword As New Keyword + keyword.text = "mars cruise thread " & threadIndex.ToString & " seed " & j.ToString + keyword.matchType = KeywordMatchType.BROAD + + ' Create the biddable ad group criterion. + Dim keywordCriterion As AdGroupCriterion = New BiddableAdGroupCriterion + keywordCriterion.adGroupId = adGroupId + keywordCriterion.criterion = keyword + + ' Create the operations. + Dim keywordOperation As New AdGroupCriterionOperation + keywordOperation.operator = [Operator].ADD + keywordOperation.operand = keywordCriterion + + operations.Add(keywordOperation) + Next j + + ' Get the AdGroupCriterionService. This should be done within the + ' thread, since a service can only handle one outgoing HTTP request + ' at a time. + Dim service As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201406.AdGroupCriterionService) + service.RequestHeader.validateOnly = True + Dim retryCount As Integer = 0 + Const NUM_RETRIES As Integer = 3 + Try + While (retryCount < NUM_RETRIES) + Try + ' Validate the keywords. + Dim retval As AdGroupCriterionReturnValue = service.mutate(operations.ToArray) + Exit While + Catch ex As AdWordsApiException + ' Handle API errors. + Dim innerException As ApiException = TryCast(ex.ApiException, ApiException) + If (innerException Is Nothing) Then + Throw New Exception("Failed to retrieve ApiError. See inner exception for more " & _ + "details.", ex) + End If + For Each apiError As ApiError In innerException.errors + If Not TypeOf apiError Is RateExceededError Then + ' Rethrow any errors other than RateExceededError. + Throw + End If + ' Handle rate exceeded errors. + Dim rateExceededError As RateExceededError = DirectCast(apiError, RateExceededError) + Console.WriteLine("Got Rate exceeded error - rate name = '{0}', scope = '{1}', " & _ + "retry After {2} seconds.", rateExceededError.rateScope, _ + rateExceededError.rateName, rateExceededError.retryAfterSeconds) + Thread.Sleep(rateExceededError.retryAfterSeconds) + retryCount = retryCount + 1 + Next + Finally + If (retryCount = NUM_RETRIES) Then + Throw New Exception(String.Format("Could not recover after making {0} attempts.", _ + retryCount)) + End If + End Try + End While + Catch ex As Exception + Throw New System.ApplicationException("Failed to validate keywords.", ex) + End Try + End Sub + End Class + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/ErrorHandling/HandleTwoFactorAuthorizationError.vb b/examples/AdWords/Vb/v201406/ErrorHandling/HandleTwoFactorAuthorizationError.vb new file mode 100644 index 00000000000..da6465d50c3 --- /dev/null +++ b/examples/AdWords/Vb/v201406/ErrorHandling/HandleTwoFactorAuthorizationError.vb @@ -0,0 +1,95 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.Common.Lib + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example illustrates how to handle 2 factor authorization errors. + ''' + ''' Tags: CampaignService.get + ''' + Public Class HandleTwoFactorAuthorizationError + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandleTwoFactorAuthorizationError + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to handle 2 factor authorization errors." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Use a test account for which 2 factor authentication has been enabled. + Dim loginEmail As String = "2steptester@gmail.com" + Dim password As String = "testaccount" + + Dim config As New AdWordsAppConfig + config.Email = loginEmail + config.Password = password + Dim authToken As New AuthToken(config, "adwords") + + Try + ' Try to obtain an authToken. + Dim token As String = authToken.GetToken + Console.WriteLine("Retrieved an authToken = {0} for user {1}.", token, loginEmail) + Catch ex As AuthTokenException + ' Since the test account has 2 factor authentication enabled, this block + ' of code will be executed. + If (ex.ErrorCode = AuthTokenErrorCode.BadAuthentication) Then + If (ex.Info = "InvalidSecondFactor") Then + Console.WriteLine("The user has enabled two factor authentication in this " & _ + "account. Have the user generate an application-specific password to make " & _ + "calls against the AdWords API. See " & _ + "http://adwordsapi.blogspot.com/2011/02/authentication-changes-with-2-step.html" & _ + "for more details.") + Else + Console.WriteLine("Invalid credentials.") + End If + Else + Throw New System.ApplicationException(String.Format("The server raised an {0} error.", _ + ex.ErrorCode), ex) + End If + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/Miscellaneous/GetAllVideosAndImages.vb b/examples/AdWords/Vb/v201406/Miscellaneous/GetAllVideosAndImages.vb new file mode 100644 index 00000000000..9ba9490f833 --- /dev/null +++ b/examples/AdWords/Vb/v201406/Miscellaneous/GetAllVideosAndImages.vb @@ -0,0 +1,139 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example gets all videos and images. To upload video, see + ''' http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. + ''' To upload image, run UploadImage.vb. + ''' + ''' Tags: MediaService.get + ''' + Public Class GetAllVideosAndImages + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAllVideosAndImages + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all videos and images. To upload video, see " & _ + "http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. To " & _ + "upload image, run UploadImage.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the MediaService. + Dim mediaService As MediaService = user.GetService(AdWordsService.v201406.MediaService) + + ' Create the video selector. + Dim selector As New Selector + selector.fields = New String() {"MediaId", "Width", "Height", "MimeType"} + + ' Set the filter. + Dim predicate As New Predicate + predicate.operator = PredicateOperator.IN + predicate.field = "Type" + predicate.values = New String() {MediaMediaType.VIDEO.ToString(), _ + MediaMediaType.IMAGE.ToString()} + + selector.predicates = New Predicate() {predicate} + + ' Select selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New MediaPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + page = mediaService.get(selector) + + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each media As Media In page.entries + If TypeOf media Is Video Then + Dim video As Video = media + Console.WriteLine("{0}) Video with id '{1}' and name '{2}' was found.", _ + i, video.mediaId, video.name) + ElseIf TypeOf media Is Image Then + Dim image As Image = media + Dim dimensions As Dictionary(Of MediaSize, Dimensions) = _ + CreateMediaDimensionMap(image.dimensions) + Console.WriteLine("{0}) Image with id '{1}', dimensions '{2}x{3}', and MIME " & _ + "type '{4}' was found.", i, image.mediaId, dimensions(MediaSize.FULL).width, _ + dimensions(MediaSize.FULL).height, image.mimeType) + End If + i = i + 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of images and videos found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get images and videos.", ex) + End Try + End Sub + + ''' + ''' Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + ''' + ''' The array of Media_Size_DimensionsMapEntry to be + ''' converted into a dictionary. + ''' A dictionary with key as MediaSize, and value as Dimensions. + ''' + Private Function CreateMediaDimensionMap(ByVal dimensions As Media_Size_DimensionsMapEntry()) _ + As Dictionary(Of MediaSize, Dimensions) + Dim mediaMap As New Dictionary(Of MediaSize, Dimensions) + For Each dimension As Media_Size_DimensionsMapEntry In dimensions + mediaMap.Add(dimension.key, dimension.value) + Next + Return mediaMap + End Function + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/Miscellaneous/UploadImage.vb b/examples/AdWords/Vb/v201406/Miscellaneous/UploadImage.vb new file mode 100644 index 00000000000..3e562a6a786 --- /dev/null +++ b/examples/AdWords/Vb/v201406/Miscellaneous/UploadImage.vb @@ -0,0 +1,107 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 +Imports Google.Api.Ads.Common.Util + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example uploads an image. To get images, run GetAllVideosAndImages.vb. + ''' + ''' Tags: MediaService.upload + ''' + Public Class UploadImage + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UploadImage + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example uploads an image. To get images, run GetAllVideosAndImages.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the MediaService. + Dim mediaService As MediaService = user.GetService( _ + AdWordsService.v201406.MediaService) + + ' Create the image. + Dim image As New Image + image.data = MediaUtilities.GetAssetDataFromUrl("http://goo.gl/HJM3L") + image.type = MediaMediaType.IMAGE + + Try + ' Upload the image. + Dim result As Media() = mediaService.upload(New Media() {image}) + + ' Display the results. + If ((Not result Is Nothing) AndAlso (result.Length > 0)) Then + Dim newImage As Media = result(0) + Dim dimensions As Dictionary(Of MediaSize, Dimensions) = _ + CreateMediaDimensionMap(newImage.dimensions) + Console.WriteLine("Image with id '{0}', dimensions '{1}x{2}', and MIME type '{3}'" & _ + " was uploaded.", newImage.mediaId, dimensions.Item(MediaSize.FULL).width, _ + dimensions.Item(MediaSize.FULL).height, newImage.mimeType) + Else + Console.WriteLine("No images were uploaded.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to upload images.", ex) + End Try + End Sub + + ''' + ''' Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + ''' + ''' The array of Media_Size_DimensionsMapEntry to + ''' be converted into a dictionary. + ''' A dictionary with key as MediaSize, and value as Dimensions. + ''' + Private Function CreateMediaDimensionMap(ByVal dimensions As Media_Size_DimensionsMapEntry()) _ + As Dictionary(Of MediaSize, Dimensions) + Dim mediaMap As New Dictionary(Of MediaSize, Dimensions) + For Each dimension As Media_Size_DimensionsMapEntry In dimensions + mediaMap.Add(dimension.key, dimension.value) + Next + Return mediaMap + End Function + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/Optimization/EstimateKeywordTraffic.vb b/examples/AdWords/Vb/v201406/Optimization/EstimateKeywordTraffic.vb new file mode 100644 index 00000000000..f21fac6aa4b --- /dev/null +++ b/examples/AdWords/Vb/v201406/Optimization/EstimateKeywordTraffic.vb @@ -0,0 +1,174 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example gets keyword traffic estimates. + ''' + ''' Tags: TrafficEstimatorService.get + ''' + Public Class EstimateKeywordTraffic + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New EstimateKeywordTraffic + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets keyword traffic estimates." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the TrafficEstimatorService. + Dim trafficEstimatorService As TrafficEstimatorService = user.GetService( _ + AdWordsService.v201406.TrafficEstimatorService) + + ' Create keywords. Up to 2000 keywords can be passed in a single request. + Dim keyword1 As New Keyword + keyword1.text = "mars cruise" + keyword1.matchType = KeywordMatchType.BROAD + + Dim keyword2 As New Keyword + keyword2.text = "cheap cruise" + keyword2.matchType = KeywordMatchType.PHRASE + + Dim keyword3 As New Keyword + keyword3.text = "cruise" + keyword3.matchType = KeywordMatchType.EXACT + + Dim keywords As Keyword() = New Keyword() {keyword1, keyword2, keyword3} + + ' Create a keyword estimate request for each keyword. + Dim keywordEstimateRequests As New List(Of KeywordEstimateRequest) + + For Each keyword As Keyword In keywords + Dim keywordEstimateRequest As New KeywordEstimateRequest + keywordEstimateRequest.keyword = keyword + keywordEstimateRequests.Add(keywordEstimateRequest) + Next + + ' Create negative keywords. + Dim negativeKeyword1 As New Keyword + negativeKeyword1.text = "moon walk" + negativeKeyword1.matchType = KeywordMatchType.BROAD + + Dim negativeKeywordEstimateRequest As New KeywordEstimateRequest + negativeKeywordEstimateRequest.keyword = negativeKeyword1 + negativeKeywordEstimateRequest.isNegative = True + keywordEstimateRequests.Add(negativeKeywordEstimateRequest) + + ' Create ad group estimate requests. + Dim adGroupEstimateRequest As New AdGroupEstimateRequest + adGroupEstimateRequest.keywordEstimateRequests = keywordEstimateRequests.ToArray + adGroupEstimateRequest.maxCpc = New Money + adGroupEstimateRequest.maxCpc.microAmount = 1000000 + + ' Create campaign estimate requests. + Dim campaignEstimateRequest As New CampaignEstimateRequest + campaignEstimateRequest.adGroupEstimateRequests = New AdGroupEstimateRequest() _ + {adGroupEstimateRequest} + + ' See http://code.google.com/apis/adwords/docs/appendix/countrycodes.html + ' for a detailed list of country codes. + Dim countryCriterion As New Location + countryCriterion.id = 2840 'US + + ' See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + ' for a detailed list of language codes. + Dim languageCriterion As New Language + languageCriterion.id = 1000 'en + + campaignEstimateRequest.criteria = New Criterion() {countryCriterion, languageCriterion} + + ' Create the selector. + Dim selector As New TrafficEstimatorSelector + selector.campaignEstimateRequests = New CampaignEstimateRequest() {campaignEstimateRequest} + + Try + ' Get traffic estimates. + Dim result As TrafficEstimatorResult = trafficEstimatorService.get(selector) + + ' Display the results. + If ((Not result Is Nothing) AndAlso (Not result.campaignEstimates Is Nothing) _ + AndAlso (result.campaignEstimates.Length > 0)) Then + Dim campaignEstimate As CampaignEstimate = result.campaignEstimates(0) + If ((Not campaignEstimate.adGroupEstimates Is Nothing) AndAlso _ + (campaignEstimate.adGroupEstimates.Length > 0)) Then + Dim adGroupEstimate As AdGroupEstimate = campaignEstimate.adGroupEstimates(0) + + If (Not adGroupEstimate.keywordEstimates Is Nothing) Then + For i As Integer = 0 To adGroupEstimate.keywordEstimates.Length - 1 + Dim keyword As Keyword = keywordEstimateRequests.Item(i).keyword + Dim keywordEstimate As KeywordEstimate = adGroupEstimate.keywordEstimates(i) + + If keywordEstimateRequests.Item(i).isNegative Then + Continue For + End If + + ' Find the mean of the min and max values. + Dim meanAverageCpc As Long = ((keywordEstimate.min.averageCpc.microAmount + _ + keywordEstimate.max.averageCpc.microAmount) / 2) + Dim meanAveragePosition As Double = ((keywordEstimate.min.averagePosition + _ + keywordEstimate.max.averagePosition) / 2) + Dim meanClicks As Single = ((keywordEstimate.min.clicksPerDay + _ + keywordEstimate.max.clicksPerDay) / 2) + Dim meanTotalCost As Long = ((keywordEstimate.min.totalCost.microAmount + _ + keywordEstimate.max.totalCost.microAmount) / 2) + + Console.WriteLine("Results for the keyword with text = '{0}' and match type " & _ + "= '{1}':", keyword.text, keyword.matchType) + Console.WriteLine(" Estimated average CPC: {0}", meanAverageCpc) + Console.WriteLine(" Estimated ad position: {0:0.00}", meanAveragePosition) + Console.WriteLine(" Estimated daily clicks: {0}", meanClicks) + Console.WriteLine(" Estimated daily cost: {0}", meanTotalCost) + Next i + End If + End If + Else + Console.WriteLine("No traffic estimates were returned.\n") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve traffic estimates.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/Optimization/GetAdGroupBidSimulations.vb b/examples/AdWords/Vb/v201406/Optimization/GetAdGroupBidSimulations.vb new file mode 100644 index 00000000000..40fa76bf80e --- /dev/null +++ b/examples/AdWords/Vb/v201406/Optimization/GetAdGroupBidSimulations.vb @@ -0,0 +1,109 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example gets bid landscapes for an ad group. To get ad groups, + ''' run GetAdGroups.vb. + ''' + ''' Tags: DataService.getAdGroupBidLandscape + ''' + Public Class GetAdGroupBidSimulations + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAdGroupBidSimulations + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets bid landscapes for an ad group. To get ad groups, run " & _ + "GetAdGroups.vb" + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group for which bid simulations are + ''' retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the DataService. + Dim dataService As DataService = user.GetService(AdWordsService.v201406.DataService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"AdGroupId", "LandscapeType", "LandscapeCurrent", _ + "StartDate", "EndDate", "Bid", "LocalClicks", "LocalCost", "MarginalCpc", _ + "LocalImpressions"} + + ' Set the filters. + Dim adGroupPredicate As New Predicate + adGroupPredicate.field = "AdGroupId" + adGroupPredicate.operator = PredicateOperator.IN + adGroupPredicate.values = New String() {adGroupId.ToString} + + selector.predicates = New Predicate() {adGroupPredicate} + + Try + ' Get bid landscape for ad group. + Dim page As AdGroupBidLandscapePage = dataService.getAdGroupBidLandscape(selector) + If (((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) AndAlso _ + (page.entries.Length > 0)) Then + For Each bidLandscape As AdGroupBidLandscape In page.entries + Console.WriteLine("Found ad group bid landscape with ad group id '{0}', " & _ + "type '{1}', current: '{2}', start date '{3}', end date '{4}', and " & _ + "landscape points", bidLandscape.adGroupId, bidLandscape.type, _ + bidLandscape.landscapeCurrent, bidLandscape.startDate, bidLandscape.endDate) + Dim point As BidLandscapeLandscapePoint + For Each point In bidLandscape.landscapePoints + Console.WriteLine("- bid: {0} => clicks: {1}, cost: {2}, marginalCpc: {3}, " & _ + "impressions: {4}", point.bid.microAmount, point.bid.microAmount, _ + point.clicks, point.cost.microAmount, point.marginalCpc.microAmount, _ + point.impressions) + Next + Next + Else + Console.WriteLine("No ad group bid landscapes were found.\n") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to get ad group bid landscapes.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/Optimization/GetKeywordBidSimulations.vb b/examples/AdWords/Vb/v201406/Optimization/GetKeywordBidSimulations.vb new file mode 100644 index 00000000000..731f0843b17 --- /dev/null +++ b/examples/AdWords/Vb/v201406/Optimization/GetKeywordBidSimulations.vb @@ -0,0 +1,134 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example gets a bid landscape for an ad group and a keyword. + ''' To get ad groups, run GetAdGroups.vb. To get keywords, run + ''' GetKeywords.vb. + ''' + ''' Tags: DataService.getCriterionBidLandscape + ''' + Public Class GetKeywordBidSimulations + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetKeywordBidSimulations + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim keywordId As Long = Long.Parse("INSERT_KEYWORD_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, keywordId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets a bid landscape for an ad group and a keyword. To " & _ + "get ad groups, run GetAdGroups.vb. To get keywords, run GetKeywords.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group for which keyword bid + ''' simulations are retrieved. + ''' Id of the keyword for which bid simulations are + ''' retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal keywordId As Long) + ' Get the DataService. + Dim dataService As DataService = user.GetService(AdWordsService.v201406.DataService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"AdGroupId", "CriterionId", "StartDate", "EndDate", _ + "Bid", "LocalClicks", "LocalCost", "MarginalCpc", "LocalImpressions"} + + ' Set the filters. + Dim adGroupPredicate As New Predicate + adGroupPredicate.field = "AdGroupId" + adGroupPredicate.operator = PredicateOperator.IN + adGroupPredicate.values = New String() {adGroupId.ToString} + + Dim keywordPredicate As New Predicate + keywordPredicate.field = "CriterionId" + keywordPredicate.operator = PredicateOperator.IN + keywordPredicate.values = New String() {keywordId.ToString} + + selector.predicates = New Predicate() {adGroupPredicate, keywordPredicate} + + ' Select selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New CriterionBidLandscapePage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get bid landscape for keywords. + page = dataService.getCriterionBidLandscape(selector) + + ' Display bid landscapes. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each bidLandscape As CriterionBidLandscape In page.entries + Console.WriteLine("{0}) Found keyword bid landscape with ad group id ""{1}"", " & _ + "keyword id ""{2}"", start date ""{3}"", end date ""{4}"", and " & _ + "landscape points:", i, bidLandscape.adGroupId, bidLandscape.criterionId, _ + bidLandscape.startDate, bidLandscape.endDate) + For Each bidLandscapePoint As BidLandscapeLandscapePoint _ + In bidLandscape.landscapePoints + Console.WriteLine("- bid: {0} => clicks: {1}, cost: {2}, marginalCpc: {3}, " & _ + "impressions: {4}", bidLandscapePoint.bid.microAmount, _ + bidLandscapePoint.clicks, bidLandscapePoint.cost.microAmount, _ + bidLandscapePoint.marginalCpc.microAmount, bidLandscapePoint.impressions) + Next + Next + i += 1 + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of keyword bid landscapes found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve keyword bid landscapes.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/Optimization/GetKeywordIdeas.vb b/examples/AdWords/Vb/v201406/Optimization/GetKeywordIdeas.vb new file mode 100644 index 00000000000..09fdc697738 --- /dev/null +++ b/examples/AdWords/Vb/v201406/Optimization/GetKeywordIdeas.vb @@ -0,0 +1,150 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Text + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example retrieves keywords that are related to a given keyword. + ''' + ''' Tags: TargetingIdeaService.get + ''' + Public Class GetKeywordIdeas + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetKeywordIdeas + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves keywords that are related to a given keyword." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the TargetingIdeaService. + Dim targetingIdeaService As TargetingIdeaService = user.GetService( _ + AdWordsService.v201406.TargetingIdeaService) + + Dim keywordText As String = "mars cruise" + + ' Create selector. + Dim selector As New TargetingIdeaSelector() + selector.requestType = RequestType.IDEAS + selector.ideaType = IdeaType.KEYWORD + selector.requestedAttributeTypes = New AttributeType() { _ + AttributeType.KEYWORD_TEXT, AttributeType.SEARCH_VOLUME, _ + AttributeType.CATEGORY_PRODUCTS_AND_SERVICES} + + ' Language setting (optional). + ' The ID can be found in the documentation: + ' https://developers.google.com/adwords/api/docs/appendix/languagecodes + ' Note: As of v201302, only a single language parameter is allowed. + Dim languageParameter As New LanguageSearchParameter() + Dim english As New Language() + english.id = 1000 + languageParameter.languages = New Language() {english} + + ' Create related to query search parameter. + Dim relatedToQuerySearchParameter As New RelatedToQuerySearchParameter() + relatedToQuerySearchParameter.queries = New String() {keywordText} + selector.searchParameters = New SearchParameter() {relatedToQuerySearchParameter, _ + languageParameter} + + ' Set selector paging (required for targeting idea service). + Dim paging As New Paging() + paging.startIndex = 0 + paging.numberResults = 500 + selector.paging = paging + + Dim offset As Long = 0 + Dim pageSize As Long = 500 + + Dim page As New TargetingIdeaPage() + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get related keywords. + page = targetingIdeaService.get(selector) + + 'Display the results. + + If Not page.entries Is Nothing AndAlso page.entries.Length > 0 Then + Dim i As Integer = offset + For Each targetingIdea As TargetingIdea In page.entries + Dim keyword As String = Nothing + Dim categories As String = Nothing + Dim averageMonthlySearches As Long = 0 + + For Each entry As Type_AttributeMapEntry In targetingIdea.data + If entry.key = AttributeType.KEYWORD_TEXT Then + keyword = DirectCast(entry.value, StringAttribute).value + End If + If entry.key = AttributeType.CATEGORY_PRODUCTS_AND_SERVICES Then + Dim categorySet As IntegerSetAttribute = entry.value + Dim builder As New StringBuilder() + For Each value As Integer In categorySet.value + builder.AppendFormat("{0}, ", value) + Next + Dim trimChars As Char() = New Char() {",", " "} + categories = builder.ToString().Trim(trimChars) + End If + If entry.key = AttributeType.SEARCH_VOLUME Then + averageMonthlySearches = DirectCast(entry.value, LongAttribute).value + End If + Next + Console.WriteLine("Keyword with text '{0}', and average monthly search volume " & _ + "'{1}' was found with categories: {2}", keyword, averageMonthlySearches, _ + categories) + i = i + 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of related keywords found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve related keywords.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/Optimization/GetPlacementIdeas.vb b/examples/AdWords/Vb/v201406/Optimization/GetPlacementIdeas.vb new file mode 100644 index 00000000000..267895900d3 --- /dev/null +++ b/examples/AdWords/Vb/v201406/Optimization/GetPlacementIdeas.vb @@ -0,0 +1,123 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example retrieves urls that have content keywords related to a + ''' given website. + ''' + ''' Tags: TargetingIdeaService.get + ''' + Public Class GetPlacementIdeas + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetPlacementIdeas + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves urls that have content keywords related to a " & _ + "given website." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the TargetingIdeaService. + Dim targetingIdeaService As TargetingIdeaService = user.GetService( _ + AdWordsService.v201406.TargetingIdeaService) + + ' Create seed url. + Dim url As String = "mars.google.com" + + ' Create the selector. + Dim selector As New TargetingIdeaSelector + selector.requestType = RequestType.IDEAS + selector.ideaType = IdeaType.PLACEMENT + selector.requestedAttributeTypes = New AttributeType() {AttributeType.CRITERION, _ + AttributeType.PLACEMENT_TYPE} + + ' Create related to url search parameter. + Dim relatedToUrlSearchParameter As New RelatedToUrlSearchParameter + relatedToUrlSearchParameter.urls = New String() {url} + relatedToUrlSearchParameter.includeSubUrls = False + selector.searchParameters = New SearchParameter() {relatedToUrlSearchParameter} + + ' Select selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New TargetingIdeaPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get placement ideas. + page = targetingIdeaService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each idea As TargetingIdea In page.entries + For Each entry As Type_AttributeMapEntry In idea.data + If (entry.key = AttributeType.CRITERION) Then + Dim placementAttribute As CriterionAttribute = entry.value + Dim placement As Placement = placementAttribute.value + Console.WriteLine("{0}) Related placement urls were found at '{1}'.", _ + i, placement.url) + End If + Next + Next + i += 1 + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of related placements found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve related placements.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/Remarketing/AddAudience.vb b/examples/AdWords/Vb/v201406/Remarketing/AddAudience.vb new file mode 100644 index 00000000000..dc44e60870d --- /dev/null +++ b/examples/AdWords/Vb/v201406/Remarketing/AddAudience.vb @@ -0,0 +1,154 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example illustrates how to create a user list a.k.a. audience. + ''' + ''' Tags: UserListService.mutate + ''' + Public Class AddAudience + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAudience + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to create a user list a.k.a. audience." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the UserListService. + Dim userListService As AdwordsUserListService = user.GetService( _ + AdWordsService.v201406.AdwordsUserListService) + + ' Get the ConversionTrackerService. + Dim conversionTrackerService As ConversionTrackerService = user.GetService( _ + AdWordsService.v201406.ConversionTrackerService) + + Dim userList As New BasicUserList + + userList.name = ("Mars cruise customers #" & ExampleUtilities.GetRandomString) + userList.description = "A list of mars cruise customers in the last year." + userList.status = UserListMembershipStatus.OPEN + userList.membershipLifeSpan = 365 + + Dim conversionType As New UserListConversionType + conversionType.name = userList.name + userList.conversionTypes = New UserListConversionType() {conversionType} + + ' Optional: Set the user list status. + userList.status = UserListMembershipStatus.OPEN + + ' Create the operation. + Dim operation As New UserListOperation + operation.operand = userList + operation.operator = [Operator].ADD + + Try + ' Add the user list. + Dim retval As UserListReturnValue = userListService.mutate(New UserListOperation() _ + {operation}) + + Dim userLists As UserList() = Nothing + If ((Not retval Is Nothing) AndAlso (Not retval.value Is Nothing)) Then + userLists = retval.value + ' Get all conversion snippets. + Dim conversionIds As New List(Of String) + For Each newUserList As BasicUserList In userLists + If (Not newUserList.conversionTypes Is Nothing) Then + For Each newConversionType As UserListConversionType In _ + newUserList.conversionTypes + conversionIds.Add(newConversionType.id.ToString) + Next + End If + Next + + Dim conversionsMap As New Dictionary(Of Long, ConversionTracker) + + If (conversionIds.Count > 0) Then + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id"} + + Dim conversionTypePredicate As New Predicate + conversionTypePredicate.field = "Id" + conversionTypePredicate.operator = PredicateOperator.IN + conversionTypePredicate.values = conversionIds.ToArray + selector.predicates = New Predicate() {conversionTypePredicate} + + ' Get all conversion trackers. + Dim page As ConversionTrackerPage = conversionTrackerService.get(selector) + + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + For Each tracker As ConversionTracker In page.entries + conversionsMap.Item(tracker.id) = tracker + Next + End If + End If + + ' Display the results. + For Each newUserList As BasicUserList In userLists + Console.WriteLine("User list with name '{0}' and id '{1}' was added.", _ + newUserList.name, newUserList.id) + + ' Display user list associated conversion code snippets. + If (Not newUserList.conversionTypes Is Nothing) Then + For Each newConversionType As UserListConversionType In newUserList.conversionTypes + Dim conversionTracker As AdWordsConversionTracker = _ + DirectCast(conversionsMap.Item(newConversionType.id), _ + AdWordsConversionTracker) + Console.WriteLine("Conversion type code snippet associated to the list:\n{0}", _ + conversionTracker.snippet) + Next + End If + Next + Else + Console.WriteLine("No user lists (a.k.a. audiences) were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add user lists (a.k.a. audiences).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/Remarketing/AddConversionTracker.vb b/examples/AdWords/Vb/v201406/Remarketing/AddConversionTracker.vb new file mode 100644 index 00000000000..899be7f8e7e --- /dev/null +++ b/examples/AdWords/Vb/v201406/Remarketing/AddConversionTracker.vb @@ -0,0 +1,109 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds an AdWords conversion tracker. + ''' + ''' Tags: ConversionTrackerService.mutate + ''' + Public Class AddConversionTracker + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddConversionTracker + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds an AdWords conversion tracker." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the ConversionTrackerService. + Dim conversionTrackerService As ConversionTrackerService = user.GetService( _ + AdWordsService.v201406.ConversionTrackerService) + + ' Create AdWords conversion tracker. + Dim conversionTracker As New AdWordsConversionTracker + conversionTracker.name = "Earth to Mars Cruises Conversion #" & _ + ExampleUtilities.GetRandomString + conversionTracker.category = ConversionTrackerCategory.DEFAULT + conversionTracker.markupLanguage = AdWordsConversionTrackerMarkupLanguage.HTML + conversionTracker.textFormat = AdWordsConversionTrackerTextFormat.HIDDEN + + ' Set optional fields. + conversionTracker.status = ConversionTrackerStatus.ENABLED + conversionTracker.viewthroughLookbackWindow = 15 + conversionTracker.isProductAdsChargeable = True + conversionTracker.productAdsChargeableConversionWindow = 15 + conversionTracker.conversionPageLanguage = "en" + conversionTracker.backgroundColor = "#0000FF" + conversionTracker.defaultRevenueValue = 12.34 + conversionTracker.alwaysUseDefaultRevenueValue = True + + ' Create the operation. + Dim operation As New ConversionTrackerOperation + operation.operator = [Operator].ADD + operation.operand = conversionTracker + + Try + ' Add conversion tracker. + Dim retval As ConversionTrackerReturnValue = conversionTrackerService.mutate( _ + New ConversionTrackerOperation() {operation}) + + ' Display the results. + If ((Not retval Is Nothing) AndAlso (Not retval.value Is Nothing) AndAlso _ + retval.value.Length > 0) Then + Dim newConversionTracker As ConversionTracker = retval.value(0) + Console.WriteLine("Conversion tracker with id '{0}', name '{1}', status '{2}', " & _ + "category '{3}' was added.", newConversionTracker.id, newConversionTracker.name, _ + newConversionTracker.status, newConversionTracker.category) + Else + Console.WriteLine("No conversion trackers were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add conversion tracker.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/Reporting/DownloadCriteriaReport.vb b/examples/AdWords/Vb/v201406/Reporting/DownloadCriteriaReport.vb new file mode 100644 index 00000000000..112424b31a9 --- /dev/null +++ b/examples/AdWords/Vb/v201406/Reporting/DownloadCriteriaReport.vb @@ -0,0 +1,118 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util.Reports +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example gets and downloads a criteria Ad Hoc report from an XML + ''' report definition. + ''' + Public Class DownloadCriteriaReport + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DownloadCriteriaReport + Console.WriteLine(codeExample.Description) + Try + Dim fileName As String = "INSERT_OUTPUT_FILE_NAME" + codeExample.Run(New AdWordsUser, fileName) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets and downloads a criteria Ad Hoc report from an XML report" & _ + " definition." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The file to which the report is downloaded. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal fileName As String) + Dim definition As New ReportDefinition + + definition.reportName = "Last 7 days CRITERIA_PERFORMANCE_REPORT" + definition.reportType = ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT + definition.downloadFormat = DownloadFormat.GZIPPED_CSV + definition.dateRangeType = ReportDefinitionDateRangeType.LAST_7_DAYS + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"CampaignId", "AdGroupId", "Id", "CriteriaType", "Criteria", _ + "CriteriaDestinationUrl", "Clicks", "Impressions", "Cost"} + + Dim predicate As New Predicate + predicate.field = "Status" + predicate.operator = PredicateOperator.IN + predicate.values = New String() {"ACTIVE", "PAUSED"} + selector.predicates = New Predicate() {predicate} + + definition.selector = selector + definition.includeZeroImpressions = True + + Dim filePath As String = ExampleUtilities.GetHomeDir() & Path.DirectorySeparatorChar & _ + fileName + + Try + ' If you know that your report is small enough to fit in memory, then + ' you can instead use + ' Dim utilities As New ReportUtilities(user) + ' utilities.ReportVersion = "v201406" + ' Dim report As ClientReport = utilities.GetClientReport( _ + ' Of ReportDefinition)(definition) + ' + ' ' Get the text report directly if you requested a text format + ' ' (e.g. xml) + ' Dim reportText As String = report.Text + ' + ' ' Get the binary report if you requested a binary format + ' ' (e.g. gzip) + ' Dim reportBytes As Byte() = report.Contents + ' + ' ' Deflate a zipped binary report for further processing. + ' Dim deflatedReportText As String = Encoding.UTF8.GetString( _ + ' MediaUtilities.DeflateGZipData(report.Contents)) + Dim utilities As New ReportUtilities(user) + utilities.ReportVersion = "v201406" + utilities.DownloadClientReport(Of ReportDefinition)(definition, filePath) + Console.WriteLine("Report was downloaded to '{0}'.", filePath) + Catch ex As Exception + Throw New System.ApplicationException("Failed to download report.", ex) + End Try + + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/Reporting/DownloadCriteriaReportWithAwql.vb b/examples/AdWords/Vb/v201406/Reporting/DownloadCriteriaReportWithAwql.vb new file mode 100644 index 00000000000..fa114556701 --- /dev/null +++ b/examples/AdWords/Vb/v201406/Reporting/DownloadCriteriaReportWithAwql.vb @@ -0,0 +1,102 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util.Reports +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example gets and downloads a criteria Ad Hoc report from an AWQL + ''' query. See https://developers.google.com/adwords/api/docs/guides/awql for + ''' AWQL documentation. + ''' + Public Class DownloadCriteriaReportWithAwql + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DownloadCriteriaReportWithAwql + Console.WriteLine(codeExample.Description) + Try + Dim fileName As String = "INSERT_OUTPUT_FILE_NAME" + codeExample.Run(New AdWordsUser, fileName) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets and downloads a criteria Ad Hoc report from an AWQL" & _ + " query. See https://developers.google.com/adwords/api/docs/guides/awql for" & _ + " AWQL documentation." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The file to which the report is downloaded. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal fileName As String) + Dim query As String = "SELECT CampaignId, AdGroupId, Id, Criteria, CriteriaType, " & _ + "Impressions, Clicks, Cost FROM CRITERIA_PERFORMANCE_REPORT WHERE Status IN " & _ + "[ACTIVE, PAUSED] DURING LAST_7_DAYS" + + Dim filePath As String = ExampleUtilities.GetHomeDir() + Path.DirectorySeparatorChar & _ + fileName + + Try + ' If you know that your report is small enough to fit in memory, then + ' you can instead use + ' Dim utilities As New ReportUtilities(user) + ' utilities.ReportVersion = "v201406" + ' Dim report As ClientReport = utilities.GetClientReport(query, format) + ' + ' ' Get the text report directly if you requested a text format + ' ' (e.g. xml) + ' Dim reportText As String = report.Text + ' + ' ' Get the binary report if you requested a binary format + ' ' (e.g. gzip) + ' Dim reportBytes As Byte() = report.Contents + ' + ' ' Deflate a zipped binary report for further processing. + ' Dim deflatedReportText As String = Encoding.UTF8.GetString( _ + ' MediaUtilities.DeflateGZipData(report.Contents)) + Dim utilities As New ReportUtilities(user) + utilities.ReportVersion = "v201406" + utilities.DownloadClientReport(query, DownloadFormat.GZIPPED_CSV.ToString(), filePath) + Console.WriteLine("Report was downloaded to '{0}'.", filePath) + Catch ex As Exception + Throw New System.ApplicationException("Failed to download report.", ex) + End Try + + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/Reporting/GetReportFields.vb b/examples/AdWords/Vb/v201406/Reporting/GetReportFields.vb new file mode 100644 index 00000000000..c7568b1dead --- /dev/null +++ b/examples/AdWords/Vb/v201406/Reporting/GetReportFields.vb @@ -0,0 +1,97 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example gets report fields. + ''' + ''' Tags: ReportDefinitionService.getReportFields + ''' + Public Class GetReportFields + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetReportFields + Console.WriteLine(codeExample.Description) + Try + Dim reportType As ReportDefinitionReportType = [Enum].Parse( _ + GetType(ReportDefinitionReportType), "INSERT_REPORT_TYPE_HERE") + codeExample.Run(New AdWordsUser, reportType) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets report fields." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The report type to be run. + Public Sub Run(ByVal user As AdWordsUser, ByVal reportType As ReportDefinitionReportType) + ' Get the ReportDefinitionService. + Dim reportDefinitionService As ReportDefinitionService = user.GetService( _ + AdWordsService.v201406.ReportDefinitionService) + + ' The type of the report to get fields for. + ' E.g.: KEYWORDS_PERFORMANCE_REPORT + + Try + ' Get the report fields. + Dim reportDefinitionFields As ReportDefinitionField() = _ + reportDefinitionService.getReportFields(reportType) + + If ((Not reportDefinitionFields Is Nothing) AndAlso _ + (reportDefinitionFields.Length > 0)) Then + ' Display report fields. + Console.WriteLine("The report type '{0}' contains the following fields:", reportType) + + For Each reportDefinitionField As ReportDefinitionField In reportDefinitionFields + Console.Write("- {0} ({1})", reportDefinitionField.fieldName, _ + reportDefinitionField.fieldType) + If (Not reportDefinitionField.enumValues Is Nothing) Then + Console.Write(" := [{0}]", String.Join(", ", reportDefinitionField.enumValues)) + End If + Console.WriteLine() + Next + Else + Console.WriteLine("This report type has no fields.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve fields for report type.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/ShoppingCampaigns/AddProductPartitionTree.vb b/examples/AdWords/Vb/v201406/ShoppingCampaigns/AddProductPartitionTree.vb new file mode 100644 index 00000000000..f853aac50ff --- /dev/null +++ b/examples/AdWords/Vb/v201406/ShoppingCampaigns/AddProductPartitionTree.vb @@ -0,0 +1,318 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example creates a ProductPartition tree. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class AddProductPartitionTree + Inherits ExampleBase + + ''' + ''' A helper class for creating ProductPartition trees. + ''' + Private Class ProductPartitionHelper + + ''' + ''' The ID of the AdGroup that we wish to attach the partition tree to. + ''' + Private adGroupId As Long + + ''' + ''' The next temporary critertion ID to be used. + ''' + ''' When creating our tree we need to specify the parent-child + ''' relationships between nodes. However, until a criterion has been + ''' created on the server we do not have a criterionId with which to + ''' refer to it. + ''' + ''' Instead we can specify temporary IDs that are specific to a single + ''' mutate request. Once the criteria have been created they are assigned + ''' an ID as normal and the temporary ID will no longer refer to it. + ''' + ''' A valid temporary ID is any negative integer. + ''' + Private nextId As Long = -1 + + ''' + ''' The set of mutate operations needed to create the current tree. + ''' + Private operationsField As New List(Of AdGroupCriterionOperation) + + ''' + ''' Overloaded constructor. + ''' + ''' The ID of the AdGroup that we wish to attach + ''' the partition tree to. + Public Sub New(ByVal adGroupId As Long) + Me.adGroupId = adGroupId + End Sub + + Public ReadOnly Property Operations() As AdGroupCriterionOperation() + Get + Return operationsField.ToArray + End Get + End Property + + ''' + ''' Creates a subdivision node. + ''' + ''' The node that should be this node's parent. + ''' + ''' The value being paritioned on. + ''' A new subdivision node. + Public Function CreateSubdivision(ByVal parent As ProductPartition, _ + ByVal value As ProductDimension) As ProductPartition + Dim division As New ProductPartition() + division.partitionType = ProductPartitionType.SUBDIVISION + division.id = Me.nextId + Me.nextId = Me.nextId - 1 + + ' The root node has neither a parent nor a value. + If Not (parent Is Nothing) Then + division.parentCriterionId = parent.id + division.caseValue = value + End If + + Dim criterion As New BiddableAdGroupCriterion() + criterion.adGroupId = Me.adGroupId + criterion.criterion = division + + Me.CreateAddOperation(criterion) + Return division + End Function + + ''' + ''' Creates the unit. + ''' + ''' The node that should be this node's parent. + ''' + ''' The value being paritioned on. + ''' The amount to bid for matching products, + ''' in micros. + ''' True, if this is negative criterion, false + ''' otherwise. + ''' A new unit node. + Public Function CreateUnit(ByVal parent As ProductPartition, _ + ByVal value As ProductDimension, _ + ByVal bidAmount As Long, _ + ByVal isNegative As Boolean) As ProductPartition + Dim unit As New ProductPartition() + unit.partitionType = ProductPartitionType.UNIT + + ' The root node has neither a parent nor a value. + If Not (parent Is Nothing) Then + unit.parentCriterionId = parent.id + unit.caseValue = value + End If + + Dim criterion As AdGroupCriterion = Nothing + + If (isNegative) Then + Dim biddingStrategyConfiguration As New BiddingStrategyConfiguration() + + Dim cpcBid As New CpcBid() + cpcBid.bid = New Money() + cpcBid.bid.microAmount = bidAmount + biddingStrategyConfiguration.bids = New Bids() {cpcBid} + + criterion = New BiddableAdGroupCriterion() + DirectCast(criterion, BiddableAdGroupCriterion).biddingStrategyConfiguration = _ + biddingStrategyConfiguration + Else + criterion = New NegativeAdGroupCriterion() + End If + + criterion.adGroupId = Me.adGroupId + criterion.criterion = unit + + Me.CreateAddOperation(criterion) + + Return unit + End Function + + ''' + ''' Creates an AdGroupCriterionOperation for the given criterion + ''' + ''' The criterion we want to add + Private Sub CreateAddOperation(ByVal criterion As AdGroupCriterion) + Dim operation As New AdGroupCriterionOperation() + operation.operand = criterion + operation.operator = [Operator].ADD + Me.operationsField.Add(operation) + End Sub + End Class + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddProductPartitionTree + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example creates a ProductPartition tree." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The ad group to which product partition is + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201406.AdGroupCriterionService) + + Dim helper As New ProductPartitionHelper(adGroupId) + + ' The most trivial partition tree has only a unit node as the root: + ' helper.createUnit(null, null, 100000); + + Dim root As ProductPartition = helper.CreateSubdivision(Nothing, Nothing) + + Dim newCondition As New ProductCanonicalCondition() + newCondition.condition = ProductCanonicalConditionCondition.NEW + Dim newPartition As ProductPartition = helper.CreateUnit(root, newCondition, 200000, False) + + Dim usedCondition As New ProductCanonicalCondition() + usedCondition.condition = ProductCanonicalConditionCondition.USED + Dim usedPartition As ProductPartition = helper.CreateUnit(root, usedCondition, 100000, False) + + Dim otherCondition As ProductPartition = helper.CreateSubdivision(root, _ + New ProductCanonicalCondition()) + + Dim coolBrand As New ProductBrand() + coolBrand.value = "CoolBrand" + helper.CreateUnit(otherCondition, coolBrand, 900000, False) + + Dim cheapBrand As New ProductBrand() + cheapBrand.value = "CheapBrand" + helper.CreateUnit(otherCondition, cheapBrand, 10000, False) + + Dim otherBrand As ProductPartition = helper.CreateSubdivision( _ + otherCondition, New ProductBrand()) + + ' The value for the bidding category is a fixed ID for the + ' Luggage & Bags' category. You can retrieve IDs for categories from the + ' ConstantDataService. See the 'GetProductCategoryTaxonomy' example for + ' more details. + + Dim luggageAndBags As New ProductBiddingCategory() + luggageAndBags.type = ProductDimensionType.BIDDING_CATEGORY_L1 + luggageAndBags.value = -5914235892932915235 + helper.CreateUnit(otherBrand, luggageAndBags, 750000, False) + + Dim everythingElse As New ProductBiddingCategory() + everythingElse.type = ProductDimensionType.BIDDING_CATEGORY_L1 + + helper.CreateUnit(otherBrand, everythingElse, 110000, False) + + Try + ' Make the mutate request. + Dim retval As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + helper.Operations) + + Dim children As New Dictionary(Of Long, List(Of ProductPartition)) + Dim rootNode As ProductPartition = Nothing + ' For each criterion, make an array containing each of its children + ' We always create the parent before the child, so we can rely on that + ' here. + For Each adGroupCriterion As AdGroupCriterion In retval.value + Dim newCriterion As ProductPartition = adGroupCriterion.criterion + children(newCriterion.id) = New List(Of ProductPartition) + + If (newCriterion.parentCriterionIdSpecified) Then + children(newCriterion.parentCriterionId).Add(newCriterion) + Else + rootNode = DirectCast(adGroupCriterion.criterion, ProductPartition) + End If + Next + + Dim writer As New StringWriter() + ' Show the tree + DisplayTree(rootNode, children, 0, writer) + Console.WriteLine(writer.ToString()) + Catch ex As Exception + Throw New System.ApplicationException("Failed to add bid modifiers to adgroup.", ex) + End Try + End Sub + + ''' + ''' Displays the product partition tree. + ''' + ''' The root node. + ''' The child node. + ''' The tree level. + ''' The stream to write output to. + Private Sub DisplayTree(ByVal node As ProductPartition, _ + ByVal children As Dictionary(Of Long, List(Of ProductPartition)), _ + ByVal level As Integer, ByVal writer As StringWriter) + ' Recursively display a node and each of its children + Dim value As Object = Nothing + Dim type As String = "" + + If Not (node.caseValue Is Nothing) Then + type = node.caseValue.ProductDimensionType + Select Case (type) + Case "ProductCanonicalCondition" + value = DirectCast(node.caseValue, ProductCanonicalCondition).condition.ToString() + Exit Select + + Case "ProductBiddingCategory" + value = DirectCast(node.caseValue, ProductBiddingCategory).type.ToString() & _ + "(" & DirectCast(node.caseValue, ProductBiddingCategory).value & ")" + Exit Select + + Case Else + value = node.caseValue.GetType().GetProperty("value").GetValue(node.caseValue, Nothing) + Exit Select + End Select + End If + + Console.WriteLine("{0}id: {1}, type: {2}, value: {3}", "".PadLeft(level, " "), _ + node.id, type, value) + For Each childNode As ProductPartition In children(node.id) + DisplayTree(childNode, children, level + 1, writer) + Next + End Sub + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201406/ShoppingCampaigns/AddProductScope.vb b/examples/AdWords/Vb/v201406/ShoppingCampaigns/AddProductScope.vb new file mode 100644 index 00000000000..7ba5103ab24 --- /dev/null +++ b/examples/AdWords/Vb/v201406/ShoppingCampaigns/AddProductScope.vb @@ -0,0 +1,127 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example restricts the products that will be included in the + ''' campaign by setting a ProductScope. + ''' + ''' Tags: CampaignCriterionService.mutate + ''' + Public Class AddProductScope + Inherits ExampleBase + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example restricts the products that will be included in the " & _ + "campaign by setting a ProductScope." + End Get + End Property + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddProductScope + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The campaign id to add product scope. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignCriterionService. + Dim campaignCriterionService As CampaignCriterionService = user.GetService( _ + AdWordsService.v201406.CampaignCriterionService) + + Dim productScope As New ProductScope() + ' This set of dimensions is for demonstration purposes only. It would be + ' extremely unlikely that you want to include so many dimensions in your + ' product scope. + Dim nexusBrand As New ProductBrand() + nexusBrand.value = "Nexus" + + Dim newProducts As New ProductCanonicalCondition() + newProducts.condition = ProductCanonicalConditionCondition.NEW + + Dim customAttribute As New ProductCustomAttribute() + customAttribute.type = ProductDimensionType.CUSTOM_ATTRIBUTE_0 + customAttribute.value = "my attribute value" + + Dim bookOffer As New ProductOfferId() + bookOffer.value = "book1" + + Dim mediaProducts As New ProductType() + mediaProducts.type = ProductDimensionType.PRODUCT_TYPE_L1 + mediaProducts.value = "Media" + + Dim bookProducts As New ProductType() + bookProducts.type = ProductDimensionType.PRODUCT_TYPE_L2 + bookProducts.value = "Books" + + ' The value for the bidding category is a fixed ID for the + ' 'Luggage & Bags' category. You can retrieve IDs for categories from + ' the ConstantDataService. See the 'GetProductCategoryTaxonomy' example + ' for more details. + Dim luggageBiddingCategory As New ProductBiddingCategory() + luggageBiddingCategory.type = ProductDimensionType.BIDDING_CATEGORY_L1 + luggageBiddingCategory.value = -5914235892932915235 + + productScope.dimensions = New ProductDimension() {nexusBrand, newProducts, bookOffer, _ + mediaProducts, luggageBiddingCategory} + + Dim campaignCriterion As New CampaignCriterion() + campaignCriterion.campaignId = campaignId + campaignCriterion.criterion = productScope + + ' Create operation. + Dim operation As New CampaignCriterionOperation() + operation.operand = campaignCriterion + operation.operator = [Operator].ADD + + Try + ' Make the mutate request. + Dim result As CampaignCriterionReturnValue = campaignCriterionService.mutate( _ + New CampaignCriterionOperation() {operation}) + + Console.WriteLine("Created a ProductScope criterion with ID '{0}'", _ + result.value(0).criterion.id) + Catch ex As Exception + Throw New System.ApplicationException("Failed to set shopping product scope.", ex) + End Try + End Sub + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201406/ShoppingCampaigns/AddShoppingCampaign.vb b/examples/AdWords/Vb/v201406/ShoppingCampaigns/AddShoppingCampaign.vb new file mode 100644 index 00000000000..d2aa80c6d76 --- /dev/null +++ b/examples/AdWords/Vb/v201406/ShoppingCampaigns/AddShoppingCampaign.vb @@ -0,0 +1,191 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds a Shopping campaign. + ''' + ''' Tags: CampaignService.mutate, AdGroupService.mutate + ''' Tags: AdGroupAdService.mutate + ''' + Public Class AddShoppingCampaign + Inherits ExampleBase + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a Shopping campaign." + End Get + End Property + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddShoppingCampaign + Console.WriteLine(codeExample.Description) + Try + Dim budgetId As Long = Long.Parse("INSERT_BUDGET_ID_HERE") + Dim merchantId As Long = Long.Parse("INSERT_MERCHANT_ID_HERE") + codeExample.Run(New AdWordsUser, budgetId, merchantId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The budget id. + ''' The Merchant Center account id. + Public Sub Run(ByVal user As AdWordsUser, ByVal budgetId As Long, ByVal merchantId As Long) + ' Get the required services. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201406.CampaignService) + Dim adGroupService As AdGroupService = user.GetService( _ + AdWordsService.v201406.AdGroupService) + Dim adGroupAdService As AdGroupAdService = user.GetService( _ + AdWordsService.v201406.AdGroupAdService) + + Try + Dim campaign As Campaign = CreateCampaign(budgetId, merchantId, campaignService) + Console.WriteLine("Campaign with name '{0}' and ID '{1}' was added.", campaign.name, _ + campaign.id) + + Dim adGroup As AdGroup = CreateAdGroup(adGroupService, campaign) + Console.WriteLine("Ad group with name '{0}' and ID '{1}' was added.", adGroup.name, _ + adGroup.id) + + Dim adGroupAd As AdGroupAd = CreateProductAd(adGroupAdService, adGroup) + Console.WriteLine("Product ad with ID {0}' was added.", adGroupAd.ad.id) + Catch ex As Exception + Throw New System.ApplicationException("Failed to create shopping campaign.", ex) + End Try + End Sub + + ''' + ''' Creates the Product Ad. + ''' + ''' The AdGroupAdService instance. + ''' The ad group. + ''' The Product Ad. + Private Function CreateProductAd(ByVal adGroupAdService As AdGroupAdService, _ + ByVal adGroup As AdGroup) As AdGroupAd + ' Create product ad. + Dim productAd As New ProductAd() + + ' Create ad group ad. + Dim adGroupAd As New AdGroupAd() + adGroupAd.adGroupId = adGroup.id + adGroupAd.ad = productAd + + ' Create operation. + Dim operation As New AdGroupAdOperation() + operation.operand = adGroupAd + operation.operator = [Operator].ADD + + ' Make the mutate request. + Dim retval As AdGroupAdReturnValue = adGroupAdService.mutate( _ + New AdGroupAdOperation() {operation}) + + Return retval.value(0) + End Function + + ''' + ''' Creates the ad group in a Shopping campaign. + ''' + ''' The AdGroupService instance. + ''' The Shopping campaign. + ''' The ad group. + Private Function CreateAdGroup(ByVal adGroupService As AdGroupService, _ + ByVal campaign As Campaign) As AdGroup + ' Create ad group. + Dim adGroup As New AdGroup() + adGroup.campaignId = campaign.id + adGroup.name = "Ad Group #" & ExampleUtilities.GetRandomString() + + ' Create operation. + Dim operation As New AdGroupOperation() + operation.operand = adGroup + operation.operator = [Operator].ADD + + ' Make the mutate request. + Dim retval As AdGroupReturnValue = adGroupService.mutate( _ + New AdGroupOperation() {operation}) + Return retval.value(0) + End Function + + ''' + ''' Creates the shopping campaign. + ''' + ''' The budget id. + ''' The Merchant Center id. + ''' The CampaignService instance. + ''' The Shopping campaign. + Private Function CreateCampaign(ByVal budgetId As Long, ByVal merchantId As Long, _ + ByVal campaignService As CampaignService) As Campaign + ' Create campaign. + Dim campaign As New Campaign() + campaign.name = "Shopping campaign #" & ExampleUtilities.GetRandomString() + ' The advertisingChannelType is what makes this a Shopping campaign. + campaign.advertisingChannelType = AdvertisingChannelType.SHOPPING + + ' Set shared budget (required). + campaign.budget = New Budget() + campaign.budget.budgetId = budgetId + + ' Set bidding strategy (required). + Dim biddingStrategyConfiguration As New BiddingStrategyConfiguration() + biddingStrategyConfiguration.biddingStrategyType = BiddingStrategyType.MANUAL_CPC + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration + + ' Set keyword matching setting (required). + Dim keywordMatchSetting As New KeywordMatchSetting() + keywordMatchSetting.optIn = False + + ' All Shopping campaigns need a ShoppingSetting. + Dim shoppingSetting As New ShoppingSetting() + shoppingSetting.salesCountry = "US" + shoppingSetting.campaignPriority = 0 + shoppingSetting.merchantId = merchantId + campaign.settings = New Setting() {keywordMatchSetting, shoppingSetting} + + ' Create operation. + Dim campaignOperation As New CampaignOperation() + campaignOperation.operand = campaign + campaignOperation.operator = [Operator].ADD + + ' Make the mutate request. + Dim retval As CampaignReturnValue = campaignService.mutate( _ + New CampaignOperation() {campaignOperation}) + + Return retval.value(0) + End Function + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201406/ShoppingCampaigns/GetProductCategoryTaxonomy.vb b/examples/AdWords/Vb/v201406/ShoppingCampaigns/GetProductCategoryTaxonomy.vb new file mode 100644 index 00000000000..9b6563fbbe1 --- /dev/null +++ b/examples/AdWords/Vb/v201406/ShoppingCampaigns/GetProductCategoryTaxonomy.vb @@ -0,0 +1,183 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example fetches the set of valid ProductBiddingCategories. + ''' + ''' Tags: ConstantDataService.getProductBiddingCategoryData + ''' + Public Class GetProductCategoryTaxonomy + Inherits ExampleBase + + ''' + ''' Stores details about a product category and its hierarchy. + ''' + Class ProductCategory + ''' + ''' The product category id. + ''' + Private idField As Long + + ''' + ''' The product category name. + ''' + Private nameField As String + + ''' + ''' The product category children. + ''' + Private childrenField As New List(Of ProductCategory) + + ''' + ''' Gets or sets the product category id. + ''' + Public Property Id() As Long + Get + Return idField + End Get + Set(ByVal value As Long) + idField = value + End Set + End Property + + ''' + ''' Gets or sets the product category name. + ''' + Public Property Name() As String + Get + Return nameField + End Get + Set(ByVal value As String) + nameField = value + End Set + End Property + + ''' + ''' Gets or sets the product category children. + ''' + Public ReadOnly Property Children() As List(Of ProductCategory) + Get + Return childrenField + End Get + End Property + End Class + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example fetches the set of valid ProductBiddingCategories." + End Get + End Property + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetProductCategoryTaxonomy + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the ConstantDataService. + Dim constantDataService As ConstantDataService = user.GetService( _ + AdWordsService.v201406.ConstantDataService) + + Dim selector As New Selector() + + Dim predicate As New Predicate() + predicate.field = "Country" + predicate.operator = PredicateOperator.IN + predicate.values = New String() {"US"} + + Try + Dim results As ProductBiddingCategoryData() = _ + constantDataService.getProductBiddingCategoryData(selector) + + Dim biddingCategories As New Dictionary(Of Long, ProductCategory)() + Dim rootCategories As New List(Of ProductCategory)() + + For Each productBiddingCategory As ProductBiddingCategoryData In results + Dim id As Long = productBiddingCategory.dimensionValue.value + Dim parentId As Long = 0 + Dim name As String = productBiddingCategory.displayValue(0).value + + If Not (productBiddingCategory.parentDimensionValue Is Nothing) Then + parentId = productBiddingCategory.parentDimensionValue.value + End If + + If (biddingCategories.ContainsKey(id)) Then + biddingCategories.Add(id, New ProductCategory()) + End If + + Dim category As ProductCategory = biddingCategories(id) + + If (parentId <> 0) Then + If (biddingCategories.ContainsKey(parentId)) Then + biddingCategories.Add(parentId, New ProductCategory()) + End If + Dim parent As ProductCategory = biddingCategories(parentId) + parent.Children.Add(category) + Else + rootCategories.Add(category) + End If + + category.Id = id + category.Name = name + Next + + DisplayProductCategories(rootCategories, "") + Catch ex As Exception + Throw New System.ApplicationException("Failed to create shopping campaign.", ex) + End Try + End Sub + + ''' + ''' Displays the product categories. + ''' + ''' The product categories. + ''' The prefix for display purposes. + Sub DisplayProductCategories(ByVal categories As List(Of ProductCategory), _ + ByVal prefix As String) + For Each category As ProductCategory In categories + Console.WriteLine("{0}{1} [{2}]", prefix, category.Name, category.Id) + DisplayProductCategories(category.Children, String.Format("{0}{1} > ", _ + prefix, category.Name)) + Next + End Sub + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201406/ShoppingCampaigns/SetProductSalesChannel.vb b/examples/AdWords/Vb/v201406/ShoppingCampaigns/SetProductSalesChannel.vb new file mode 100644 index 00000000000..5016e6f26aa --- /dev/null +++ b/examples/AdWords/Vb/v201406/ShoppingCampaigns/SetProductSalesChannel.vb @@ -0,0 +1,104 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example sets the product sales channel. + ''' + ''' Tags: CampaignCriterionService.mutate + ''' + Public Class SetProductSalesChannel + Inherits ExampleBase + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example sets the product sales channel." + End Get + End Property + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New SetProductSalesChannel + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which shopping channel + ''' is set. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignCriterionService. + Dim campaignCriterionService As CampaignCriterionService = user.GetService( _ + AdWordsService.v201406.CampaignCriterionService) + + ' ProductSalesChannel is a fixed id criterion, with the possible values + ' defined here. + ' ONLINE: 200 + ' LOCAL: 201 + Dim productSalesChannel As New ProductSalesChannel() + productSalesChannel.id = 200 + + Dim campaignCriterion As New CampaignCriterion() + campaignCriterion.campaignId = campaignId + campaignCriterion.criterion = productSalesChannel + + ' Create operation. + Dim operation As New CampaignCriterionOperation() + operation.operand = campaignCriterion + operation.operator = [Operator].ADD + + Try + ' Make the mutate request. + Dim retVal As CampaignCriterionReturnValue = campaignCriterionService.mutate( _ + New CampaignCriterionOperation() {operation}) + + If ((Not (retVal Is Nothing)) AndAlso (Not (retVal.value Is Nothing))) Then + ' Display campaign targets. + For Each criterion As CampaignCriterion In retVal.value + Console.WriteLine("Campaign criteria of type '{0}' was set to campaign with" & _ + " id = '{1}'.", criterion.criterion.CriterionType, criterion.campaignId) + Next + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create shopping campaign.", ex) + End Try + End Sub + + End Class + +End Namespace diff --git a/examples/AdWords/Vb/v201406/Targeting/AddCampaignTargetingCriteria.vb b/examples/AdWords/Vb/v201406/Targeting/AddCampaignTargetingCriteria.vb new file mode 100644 index 00000000000..70fc7e95f54 --- /dev/null +++ b/examples/AdWords/Vb/v201406/Targeting/AddCampaignTargetingCriteria.vb @@ -0,0 +1,200 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds various types of targeting criteria to a campaign. + ''' To get a list of campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignCriterionService.mutate + ''' + Public Class AddCampaignTargetingCriteria + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddCampaignTargetingCriteria + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds various types of targeting criteria to a campaign. To " & _ + "get a list of campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to which targeting criteria + ''' are added. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignCriterionService. + Dim campaignCriterionService As CampaignCriterionService = user.GetService( _ + AdWordsService.v201406.CampaignCriterionService) + + ' Create language criteria. + ' See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + ' for a detailed list of language codes. + Dim language1 As New Language + language1.id = 1002 ' French + Dim languageCriterion1 As New CampaignCriterion + languageCriterion1.campaignId = campaignId + languageCriterion1.criterion = language1 + + Dim language2 As New Language + language2.id = 1005 ' Japanese + Dim languageCriterion2 As New CampaignCriterion + languageCriterion2.campaignId = campaignId + languageCriterion2.criterion = language2 + + ' Target Tier 3 income group near Miami, Florida. + Dim incomeLocationGroups As New LocationGroups + + Dim incomeOperand As New IncomeOperand + ' Tiers are numbered 1-10, and represent 10% segments of earners. + ' For example, TIER_1 is the top 10%, TIER_2 is the 80-90%, etc. + ' Tiers 6 through 10 are grouped into TIER_6_TO_10. + incomeOperand.tier = IncomeTier.TIER_3 + + Dim geoTargetOperand1 As New GeoTargetOperand + geoTargetOperand1.locations = New Long() {1015116} ' Miami, FL. + + incomeLocationGroups.matchingFunction = New [Function] + incomeLocationGroups.matchingFunction.lhsOperand = _ + New FunctionArgumentOperand() {incomeOperand} + incomeLocationGroups.matchingFunction.operator = FunctionOperator.AND + incomeLocationGroups.matchingFunction.rhsOperand = _ + New FunctionArgumentOperand() {geoTargetOperand1} + + Dim locationGroupCriterion1 As New CampaignCriterion + locationGroupCriterion1.campaignId = campaignId + locationGroupCriterion1.criterion = incomeLocationGroups + + ' Target places of interest near Downtown Miami, Florida. + Dim interestLocationGroups As New LocationGroups + + Dim placesOfInterestOperand As New PlacesOfInterestOperand() + placesOfInterestOperand.category = PlacesOfInterestOperandCategory.DOWNTOWN + + Dim geoTargetOperand2 As New GeoTargetOperand + geoTargetOperand2.locations = New Long() {1015116} ' Miami, FL. + + interestLocationGroups.matchingFunction = New [Function] + interestLocationGroups.matchingFunction.lhsOperand = _ + New FunctionArgumentOperand() {placesOfInterestOperand} + interestLocationGroups.matchingFunction.operator = FunctionOperator.AND + interestLocationGroups.matchingFunction.rhsOperand = _ + New FunctionArgumentOperand() {geoTargetOperand2} + + Dim locationGroupCriterion2 As New CampaignCriterion + locationGroupCriterion2.campaignId = campaignId + locationGroupCriterion2.criterion = interestLocationGroups + + ' Distance targeting. Area of 10 miles around targets above. + Dim radius As New ConstantOperand + radius.type = ConstantOperandConstantType.DOUBLE + radius.unit = ConstantOperandUnit.MILES + radius.doubleValue = 10.0 + Dim distance As New LocationExtensionOperand + distance.radius = radius + + Dim radiusLocationGroups As New LocationGroups + radiusLocationGroups.matchingFunction = New [Function] + radiusLocationGroups.matchingFunction.operator = FunctionOperator.IDENTITY + radiusLocationGroups.matchingFunction.lhsOperand = New FunctionArgumentOperand() {distance} + + Dim locationGroupCriterion3 As New CampaignCriterion + locationGroupCriterion3.campaignId = campaignId + locationGroupCriterion3.criterion = radiusLocationGroups + + ' Create location criteria. + ' See http://code.google.com/apis/adwords/docs/appendix/countrycodes.html + ' for a detailed list of country codes. + Dim location1 As New Location + location1.id = 2840 ' USA + Dim locationCriterion1 As New CampaignCriterion + locationCriterion1.campaignId = campaignId + locationCriterion1.criterion = location1 + + Dim location2 As New Location + location2.id = 2392 ' Japan + Dim locationCriterion2 As New CampaignCriterion + locationCriterion2.campaignId = campaignId + locationCriterion2.criterion = location2 + + ' Add a negative campaign keyword. + Dim negativeCriterion As New NegativeCampaignCriterion() + negativeCriterion.campaignId = campaignId + + Dim keyword As New Keyword() + keyword.matchType = KeywordMatchType.BROAD + keyword.text = "jupiter cruise" + + negativeCriterion.criterion = keyword + + Dim criteria() As CampaignCriterion = {languageCriterion1, languageCriterion2, _ + locationCriterion1, locationCriterion2, negativeCriterion, locationGroupCriterion1, _ + locationGroupCriterion2, locationGroupCriterion3} + + Dim operations As New List(Of CampaignCriterionOperation) + + For Each criterion As CampaignCriterion In criteria + Dim operation As New CampaignCriterionOperation + operation.operator = [Operator].ADD + operation.operand = criterion + operations.Add(operation) + Next + + Try + ' Set the campaign targets. + Dim retVal As CampaignCriterionReturnValue = campaignCriterionService.mutate( _ + operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing)) Then + For Each criterion As CampaignCriterion In retVal.value + Console.WriteLine("Campaign criterion of type '{0}' was set to campaign with id " & _ + "= '{1}'.", criterion.criterion.CriterionType, criterion.campaignId) + Next + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to set campaign criteria.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/Targeting/GetCampaignTargetingCriteria.vb b/examples/AdWords/Vb/v201406/Targeting/GetCampaignTargetingCriteria.vb new file mode 100644 index 00000000000..5a59b45697a --- /dev/null +++ b/examples/AdWords/Vb/v201406/Targeting/GetCampaignTargetingCriteria.vb @@ -0,0 +1,123 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example gets all targeting criteria for a campaign. To set + ''' campaign targeting criteria, run AddCampaignTargetingCriteria.vb. To get + ''' campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignCriterionService.get + ''' + Public Class GetCampaignTargetingCriteria + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetCampaignTargetingCriteria + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all targeting criteria for a campaign. To set campaign " & _ + "targeting criteria, run AddCampaignTargetingCriteria.vb. To get campaigns, run " & _ + "GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign from which targeting + ''' criteria are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignCriterionService. + Dim campaignCriterionService As CampaignCriterionService = user.GetService( _ + AdWordsService.v201406.CampaignCriterionService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "CriteriaType", "CampaignId"} + + ' Set the filters. + Dim predicate As New Predicate + predicate.field = "CampaignId" + predicate.operator = PredicateOperator.EQUALS + predicate.values = New String() {campaignId.ToString} + + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New CampaignCriterionPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get all campaign targets. + page = campaignCriterionService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each campaignCriterion As CampaignCriterion In page.entries + Dim negative As String = "" + If (TypeOf campaignCriterion Is NegativeCampaignCriterion) Then + negative = "Negative " + End If + Console.WriteLine("{0}) {1}Campaign targeting criterion with id = '{2}' and " & _ + "Type = {3} was found for campaign id '{4}'", i, negative, _ + campaignCriterion.criterion.id, campaignCriterion.criterion.type, _ + campaignCriterion.campaignId) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of campaign targeting criteria found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get campaign targeting criteria.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/Targeting/GetTargetableLanguagesAndCarriers.vb b/examples/AdWords/Vb/v201406/Targeting/GetTargetableLanguagesAndCarriers.vb new file mode 100644 index 00000000000..a65c1503d7f --- /dev/null +++ b/examples/AdWords/Vb/v201406/Targeting/GetTargetableLanguagesAndCarriers.vb @@ -0,0 +1,100 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example illustrates how to retrieve all carriers and languages + ''' available for targeting. + ''' + ''' Tags: ConstantDataService.getCarrierCriterion + ''' Tags: ConstantDataService.getLanguageCriterion + ''' + Public Class GetTargetableLanguagesAndCarriers + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetTargetableLanguagesAndCarriers + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to retrieve all carriers and languages" & _ + "available for targeting." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the ConstantDataService. + Dim constantDataService As ConstantDataService = user.GetService( _ + AdWordsService.v201406.ConstantDataService) + + Try + ' Get all carriers. + Dim carriers As Carrier() = constantDataService.getCarrierCriterion + + ' Display the results. + If (Not carriers Is Nothing) Then + For Each carrier As Carrier In carriers + Console.WriteLine("Carrier name is '{0}', ID is {1} and country code is '{2}'.", _ + carrier.name, carrier.id, carrier.countryCode) + Next + Else + Console.WriteLine("No carriers were retrieved.") + End If + + ' Get all languages. + Dim languages As Language() = constantDataService.getLanguageCriterion + + ' Display the results. + If (Not languages Is Nothing) Then + For Each language As Language In languages + Console.WriteLine("Language name is '{0}', ID is {1} and code is '{2}'.", _ + language.name, language.id, language.code) + Next + Else + Console.WriteLine("No languages were found.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to get targetable carriers and languages.", _ + ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdWords/Vb/v201406/Targeting/LookupLocation.vb b/examples/AdWords/Vb/v201406/Targeting/LookupLocation.vb new file mode 100644 index 00000000000..4da22a66694 --- /dev/null +++ b/examples/AdWords/Vb/v201406/Targeting/LookupLocation.vb @@ -0,0 +1,121 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example gets location criteria by name. + ''' + ''' Tags: LocationCriterionService.get + ''' + Public Class LookupLocation + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New LookupLocation + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets location criteria by name." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the LocationCriterionService. + Dim locationCriterionService As LocationCriterionService = user.GetService( _ + AdWordsService.v201406.LocationCriterionService) + + Dim locationNames As String() = New String() {"Paris", "Quebec", "Spain", "Deutschland"} + + Dim selector As New Selector + selector.fields = New String() {"Id", "LocationName", "CanonicalName", "DisplayType", _ + "ParentLocations", "Reach", "TargetingStatus"} + + ' Location names must match exactly, only EQUALS and IN are supported. + Dim predicate1 As New Predicate + predicate1.field = "LocationName" + predicate1.operator = PredicateOperator.IN + predicate1.values = locationNames + + ' Set the locale of the returned location names. + Dim predicate2 As New Predicate + predicate2.field = "Locale" + predicate2.operator = PredicateOperator.EQUALS + predicate2.values = New String() {"en"} + + selector.predicates = New Predicate() {predicate1, predicate2} + + Try + ' Make the get request. + Dim locationCriteria As LocationCriterion() = locationCriterionService.get(selector) + + ' Display the resulting location criteria. + For Each locationCriterion As LocationCriterion In locationCriteria + Dim parentLocations As String = "" + If ((Not locationCriterion.location Is Nothing) AndAlso ( _ + Not locationCriterion.location.parentLocations Is Nothing)) Then + For Each location As Location In locationCriterion.location.parentLocations + parentLocations = (parentLocations & Me.GetLocationString(location) & ", ") + Next + parentLocations.TrimEnd(New Char() {","c, " "c}) + Else + parentLocations = "N/A" + End If + Console.WriteLine("The search term '{0}' returned the location '{1}' of type '{2}' " & _ + "with parent locations '{3}', reach '{4}' and targeting status '{5}.", _ + locationCriterion.searchTerm, locationCriterion.location.locationName, _ + locationCriterion.location.displayType, parentLocations, locationCriterion.reach, _ + locationCriterion.location.targetingStatus) + Next + Catch ex As Exception + Throw New System.ApplicationException("Failed to get location criteria.", ex) + End Try + End Sub + + ''' + ''' Gets a string representation for a location. + ''' + ''' The location + ''' + Public Function GetLocationString(ByVal location As Location) As String + Return String.Format("{0} ({1})", location.locationName, location.displayType) + End Function + End Class +End Namespace diff --git a/examples/AdXBuyer/CSharp/AdWords.Examples.CSharp.csproj b/examples/AdXBuyer/CSharp/AdWords.Examples.CSharp.csproj new file mode 100644 index 00000000000..d0ce19e5d52 --- /dev/null +++ b/examples/AdXBuyer/CSharp/AdWords.Examples.CSharp.csproj @@ -0,0 +1,196 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {01EF0848-0412-4AA5-9360-033E2060447F} + Exe + Properties + Google.Api.Ads.AdWords.Examples.CSharp + Google.AdWords.Examples.CSharp + Google.Api.Ads.AdWords.Examples.CSharp.Program + v4.0 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AnyCPU + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + {277404DB-A439-4450-B3A5-186294CDF245} + Common + + + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745} + AdWords + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/AdXBuyer/CSharp/App.config b/examples/AdXBuyer/CSharp/App.config new file mode 100644 index 00000000000..1ee298baf62 --- /dev/null +++ b/examples/AdXBuyer/CSharp/App.config @@ -0,0 +1,192 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/AdXBuyer/CSharp/ExampleBase.cs b/examples/AdXBuyer/CSharp/ExampleBase.cs new file mode 100644 index 00000000000..e31850d2eee --- /dev/null +++ b/examples/AdXBuyer/CSharp/ExampleBase.cs @@ -0,0 +1,35 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp { + /// + /// This abstract class represents a code example. + /// + public abstract class ExampleBase { + /// + /// Returns a description about the code example. + /// + public abstract string Description { + get; + } + } +} diff --git a/examples/AdXBuyer/CSharp/ExampleUtilities.cs b/examples/AdXBuyer/CSharp/ExampleUtilities.cs new file mode 100644 index 00000000000..abbd9ae4c59 --- /dev/null +++ b/examples/AdXBuyer/CSharp/ExampleUtilities.cs @@ -0,0 +1,100 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.Reflection; + +namespace Google.Api.Ads.AdWords.Examples.CSharp { + /// + /// Utility class for assisting in running code examples. + /// + public class ExampleUtilities { + /// + /// Gets a random string. Useful for generating unique names for campaigns, + /// ad groups, etc. + /// + /// The current timestamp as a string. + public static string GetRandomString() { + return string.Format("{0} - {1}", Guid.NewGuid(), + DateTime.Now.ToString("yyyy-M-d H-m-s.ffffff")); + } + + /// + /// Gets a random string. Useful for generating unique names for campaigns, + /// ad groups, etc. + /// + /// The current timestamp as a string. + public static string GetShortRandomString() { + return Guid.NewGuid().ToString().Substring(0, 8); + } + + /// + /// Formats the exception as a printable message. + /// + /// The exception. + /// The formatted exception string. + public static string FormatException(Exception ex) { + List messages = new List(); + Exception rootEx = ex; + while (rootEx != null) { + messages.Add(String.Format("{0} ({1})\n\n{2}\n", rootEx.GetType().ToString(), + rootEx.Message, rootEx.StackTrace)); + rootEx = rootEx.InnerException; + } + return String.Join("\nCaused by\n\n", messages.ToArray()); + } + + /// + /// Gets the current user's home directory. + /// + /// The current user's home directory. + public static String GetHomeDir() { + return Environment.GetEnvironmentVariable("USERPROFILE"); + } + + /// + /// Gets the parameters for running the code example. + /// + /// The method info for Run method in code + /// example. + /// An array of parameters for running the code example. + public static List GetParameters(MethodInfo methodInfo) { + List retval = new List(); + ParameterInfo[] paramInfos = methodInfo.GetParameters(); + for (int i = 1; i < paramInfos.Length; i++) { + ParameterInfo paramInfo = paramInfos[i]; + Console.Write("Enter {0}: ", paramInfo.Name); + string value = Console.ReadLine(); + object objValue = null; + if (paramInfo.ParameterType == typeof(long)) { + objValue = long.Parse(value); + } else if (paramInfo.ParameterType == typeof(double)) { + objValue = double.Parse(value); + } else if (paramInfo.ParameterType == typeof(string)) { + objValue = value; + } else if (paramInfo.ParameterType.IsEnum) { + objValue = Enum.Parse(paramInfo.ParameterType, value); + } else { + throw new ApplicationException("Unknown parameter type : " + + paramInfo.ParameterType.FullName); + } + retval.Add(objValue); + } + return retval; + } + } +} diff --git a/examples/AdXBuyer/CSharp/OAuth/AdWords.Examples.CSharp.OAuth.csproj b/examples/AdXBuyer/CSharp/OAuth/AdWords.Examples.CSharp.OAuth.csproj new file mode 100644 index 00000000000..85eb0ca4b68 --- /dev/null +++ b/examples/AdXBuyer/CSharp/OAuth/AdWords.Examples.CSharp.OAuth.csproj @@ -0,0 +1,96 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {4641ADD7-0D1F-473D-B713-2830C5029367} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Google.Api.Ads.AdWords.Examples.CSharp.OAuth + Google.AdWords.Examples.CSharp.OAuth + v4.0 + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + AnyCPU + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + + + + + + + + + + + {277404DB-A439-4450-B3A5-186294CDF245} + Common + + + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745} + AdWords + + + + + + + + + + False + True + 63329 + / + + + False + False + + + False + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/AdXBuyer/CSharp/OAuth/ConsoleExample.cs b/examples/AdXBuyer/CSharp/OAuth/ConsoleExample.cs new file mode 100644 index 00000000000..0a0330df5f4 --- /dev/null +++ b/examples/AdXBuyer/CSharp/OAuth/ConsoleExample.cs @@ -0,0 +1,140 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; +using Google.Api.Ads.Common.Lib; + +using System; +using System.Data; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.OAuth { + /// + /// This code example shows how to run an AdWords API command line application + /// while incorporating the OAuth2 installed application flow into your + /// application. If your application uses a single MCC login to make calls to + /// all your accounts, you shouldn't use this code example. Instead, you + /// should run Common\Util\OAuth2TokenGenerator.cs to generate a refresh token + /// and set that in user.Config.OAuth2RefreshToken field, or set + /// OAuth2RefreshToken key in your App.config / Web.config. + /// + /// This code example depends on Console environment only for reading and + /// writing values, you may use this code example in other environments like + /// Windows Form applications with minimial modifications. + /// + /// To run this application, + /// + /// 1. You should create a new Console Application project. + /// 2. Add reference to the following assemblies: + /// + /// Google.Ads.Common.dll + /// Google.Ads.OAuth.dll + /// Google.AdWords.dll + /// System.Web + /// System.Configuration + /// + /// 3. Replace the Main() method with this class's method. + /// 4. Copy App.config from AdWords.Examples.CSharp project, and configure + /// it as shown in ths project's Web.config. + /// 5. Compile and run this example. + /// + public class ConsoleExample { + /// + /// The main method. + /// + /// Command line arguments. + static void Main(string[] args) { + AdWordsUser user = new AdWordsUser(); + AdWordsAppConfig config = (user.Config as AdWordsAppConfig); + if (config.AuthorizationMethod == AdWordsAuthorizationMethod.OAuth2) { + if (config.OAuth2Mode == OAuth2Flow.APPLICATION && + string.IsNullOrEmpty(config.OAuth2RefreshToken)) { + DoAuth2Authorization(user); + } + } else { + throw new Exception("Authorization mode is not OAuth."); + } + + Console.Write("Enter the customer id: "); + string customerId = Console.ReadLine(); + config.ClientCustomerId = customerId; + + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201309.CampaignService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Name", "Status"}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + CampaignPage page = new CampaignPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the campaigns. + page = campaignService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (Campaign campaign in page.entries) { + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = '{3}'" + + " was found.", i + 1, campaign.id, campaign.name, campaign.status); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve campaigns", ex); + } + } + + /// + /// Does the OAuth2 authorization for installed applications. + /// + /// The AdWords user. + private static void DoAuth2Authorization(AdWordsUser user) { + // Since we are using a console application, set the callback url to null. + user.Config.OAuth2RedirectUri = null; + AdsOAuthProviderForApplications oAuth2Provider = + (user.OAuthProvider as AdsOAuthProviderForApplications); + // Get the authorization url. + string authorizationUrl = oAuth2Provider.GetAuthorizationUrl(); + Console.WriteLine("Open a fresh web browser and navigate to \n\n{0}\n\n. You will be " + + "prompted to login and then authorize this application to make calls to the " + + "AdWords API. Once approved, you will be presented with an authorization code.", + authorizationUrl); + + // Accept the OAuth2 authorization code from the user. + Console.Write("Enter the authorization code :"); + string authorizationCode = Console.ReadLine(); + + // Fetch the access and refresh tokens. + oAuth2Provider.FetchAccessAndRefreshTokens(authorizationCode); + } + } +} diff --git a/examples/AdXBuyer/CSharp/OAuth/Default.aspx b/examples/AdXBuyer/CSharp/OAuth/Default.aspx new file mode 100644 index 00000000000..093d0fb4324 --- /dev/null +++ b/examples/AdXBuyer/CSharp/OAuth/Default.aspx @@ -0,0 +1,53 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" + Inherits="Google.Api.Ads.AdWords.Examples.CSharp.OAuth.Default" %> + + + + + + AdWords API - OAuth demo + + +
+

AdWords API OAuth demo

+

+ This code example uses OAuth to retrieve the list all campaigns in your account. +

+ +

+ + + + +
+
+ + + + + + + diff --git a/examples/AdXBuyer/CSharp/OAuth/Default.aspx.cs b/examples/AdXBuyer/CSharp/OAuth/Default.aspx.cs new file mode 100644 index 00000000000..0b81b03ece1 --- /dev/null +++ b/examples/AdXBuyer/CSharp/OAuth/Default.aspx.cs @@ -0,0 +1,232 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util.Reports; +using Google.Api.Ads.AdWords.v201309; +using Google.Api.Ads.Common.Lib; + +using System; +using System.Data; +using System.IO; +using System.Web.UI.WebControls; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.OAuth { + /// + /// Code-behind class for Default.aspx. + /// + public partial class Default : System.Web.UI.Page { + /// + /// The user for creating services and making AdWords API calls. + /// + AdWordsUser user; + + /// + /// Handles the Load event of the Page control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + void Page_Load(object sender, EventArgs e) { + user = new AdWordsUser(); + } + + /// + /// Handles the Click event of the btnAuthorize control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + protected void OnAuthorizeButtonClick(object sender, EventArgs e) { + // This code example shows how to run an AdWords API web application + // while incorporating the OAuth2 web application flow into your + // application. If your application uses a single MCC login to make calls + // to all your accounts, you shouldn't use this code example. Instead, you + // should run Common\Util\OAuth2TokenGenerator.cs to generate a refresh + // token and set that in user.Config.OAuth2RefreshToken field, or set + // OAuth2RefreshToken key in your App.config / Web.config. + AdWordsAppConfig config = user.Config as AdWordsAppConfig; + if (config.AuthorizationMethod == AdWordsAuthorizationMethod.OAuth2) { + if (user.Config.OAuth2Mode == OAuth2Flow.APPLICATION && + string.IsNullOrEmpty(config.OAuth2RefreshToken)) { + Response.Redirect("OAuthLogin.aspx"); + } + } else { + throw new Exception("Authorization mode is not OAuth."); + } + } + + /// + /// Handles the Click event of the btnDownloadReport control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + protected void OnDownloadReportButtonClick(object sender, EventArgs e) { + ConfigureUserForOAuth(); + ReportDefinition definition = new ReportDefinition(); + + definition.reportName = "Last 7 days CRITERIA_PERFORMANCE_REPORT"; + definition.reportType = ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT; + definition.downloadFormat = DownloadFormat.GZIPPED_CSV; + definition.dateRangeType = ReportDefinitionDateRangeType.LAST_7_DAYS; + + // Create selector. + Selector selector = new Selector(); + selector.fields = new string[] {"CampaignId", "AdGroupId", "Id", "CriteriaType", "Criteria", + "CriteriaDestinationUrl", "Clicks", "Impressions", "Cost"}; + + Predicate predicate = new Predicate(); + predicate.field = "Status"; + predicate.@operator = PredicateOperator.IN; + predicate.values = new string[] {"ACTIVE", "PAUSED"}; + selector.predicates = new Predicate[] {predicate}; + + definition.selector = selector; + definition.includeZeroImpressions = true; + + string filePath = Path.GetTempFileName(); + + try { + // If you know that your report is small enough to fit in memory, then + // you can instead use + // ReportUtilities utilities = new ReportUtilities(user); + // utilities.ReportVersion = "v201309"; + // ClientReport report = utilities.GetClientReport(definition); + // + // // Get the text report directly if you requested a text format + // // (e.g. xml) + // string reportText = report.Text; + // + // // Get the binary report if you requested a binary format + // // (e.g. gzip) + // byte[] reportBytes = report.Contents; + // + // // Deflate a zipped binary report for further processing. + // string deflatedReportText = Encoding.UTF8.GetString( + // MediaUtilities.DeflateGZipData(report.Contents)); + + // Set the customer id. + (user.Config as AdWordsAppConfig).ClientCustomerId = txtCustomerId.Text; + ReportUtilities utilities = new ReportUtilities(user); + utilities.ReportVersion = "v201309"; + utilities.DownloadClientReport(definition, filePath); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to download report.", ex); + } + Response.AddHeader("content-disposition", "attachment;filename=report.gzip"); + Response.WriteFile(filePath); + Response.End(); + } + + /// + /// Handles the Click event of the btnGetCampaigns control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + protected void OnGetCampaignsButtonClick(object sender, EventArgs e) { + ConfigureUserForOAuth(); + + // Now proceed to make your API calls as usual. + // Create a selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Name", "Status"}; + + OrderBy orderByName = new OrderBy(); + orderByName.field = "Name"; + orderByName.sortOrder = SortOrder.ASCENDING; + + selector.ordering = new OrderBy[] {orderByName}; + (user.Config as AdWordsAppConfig).ClientCustomerId = txtCustomerId.Text; + + try { + CampaignService service = + (CampaignService) user.GetService(AdWordsService.v201309.CampaignService); + + CampaignPage page = service.get(selector); + + // Display campaigns. + if (page != null && page.entries != null && page.entries.Length > 0) { + DataTable dataTable = new DataTable(); + dataTable.Columns.AddRange(new DataColumn[] { + new DataColumn("Serial No.", typeof(int)), + new DataColumn("Campaign Id", typeof(long)), + new DataColumn("Campaign Name", typeof(string)), + new DataColumn("Status", typeof(string)) + }); + for (int i = 0; i < page.entries.Length; i++) { + Campaign campaign = page.entries[i]; + DataRow dataRow = dataTable.NewRow(); + dataRow.ItemArray = new object[] {i + 1, campaign.id, campaign.name, + campaign.status.ToString() + }; + dataTable.Rows.Add(dataRow); + } + CampaignGrid.DataSource = dataTable; + CampaignGrid.DataBind(); + } else { + Response.Write("No campaigns were found."); + } + } catch (Exception ex) { + Response.Write(string.Format("Failed to get campaigns. Exception says \"{0}\"", + ex.Message)); + } + } + + /// + /// Configures the AdWords user for OAuth. + /// + private void ConfigureUserForOAuth() { + AdWordsAppConfig config = (user.Config as AdWordsAppConfig); + if (config.AuthorizationMethod == AdWordsAuthorizationMethod.OAuth2) { + user.OAuthProvider = (OAuth2ProviderForApplications) Session["OAuthProvider"]; + if (config.OAuth2Mode == OAuth2Flow.APPLICATION && + string.IsNullOrEmpty(config.OAuth2RefreshToken)) { + user.OAuthProvider = (OAuth2ProviderForApplications) Session["OAuthProvider"]; + } + } else { + throw new Exception("Authorization mode is not OAuth."); + } + } + + /// + /// Handles the Click event of the btnLogout control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + protected void OnLogoutButtonClick(object sender, EventArgs e) { + Session.Clear(); + } + + /// + /// Handles the RowDataBound event of the CampaignGrid control. + /// + /// The source of the event. + /// The + /// instance + /// containing the event data. + protected void CampaignGrid_RowDataBound(object sender, GridViewRowEventArgs e) { + if (e.Row.DataItemIndex >= 0) { + e.Row.Cells[0].HorizontalAlign = HorizontalAlign.Center; + e.Row.Cells[1].HorizontalAlign = HorizontalAlign.Center; + e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Left; + e.Row.Cells[3].HorizontalAlign = HorizontalAlign.Center; + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/OAuth/Default.aspx.designer.cs b/examples/AdXBuyer/CSharp/OAuth/Default.aspx.designer.cs new file mode 100644 index 00000000000..eeedbb506e8 --- /dev/null +++ b/examples/AdXBuyer/CSharp/OAuth/Default.aspx.designer.cs @@ -0,0 +1,86 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.5456 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Google.Api.Ads.AdWords.Examples.CSharp.OAuth { + public partial class Default { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// btnAuthorize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAuthorize; + + /// + /// btnLogout control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnLogout; + + /// + /// lblCustomerId control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblCustomerId; + + /// + /// txtCustomerId control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtCustomerId; + + /// + /// btnGetCampaigns control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnGetCampaigns; + + /// + /// btnDownloadReport control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnDownloadReport; + + /// + /// CampaignGrid control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView CampaignGrid; + } +} diff --git a/examples/AdXBuyer/CSharp/OAuth/OAuthLogin.aspx b/examples/AdXBuyer/CSharp/OAuth/OAuthLogin.aspx new file mode 100644 index 00000000000..2cdcc9cdb1a --- /dev/null +++ b/examples/AdXBuyer/CSharp/OAuth/OAuthLogin.aspx @@ -0,0 +1,34 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OAuthLogin.aspx.cs" + Inherits="Google.Api.Ads.AdWords.Examples.CSharp.OAuth.OAuthLogin" %> + + + + + + Untitled Page + + +
+
+ +
+
+ + diff --git a/examples/AdXBuyer/CSharp/OAuth/OAuthLogin.aspx.cs b/examples/AdXBuyer/CSharp/OAuth/OAuthLogin.aspx.cs new file mode 100644 index 00000000000..86ed1938f65 --- /dev/null +++ b/examples/AdXBuyer/CSharp/OAuth/OAuthLogin.aspx.cs @@ -0,0 +1,111 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections; +using System.Configuration; +using System.Data; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.HtmlControls; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.OAuth { + /// + /// Login and callback page for handling OAuth2 authentication. + /// + public partial class OAuthLogin : Page { + /// + /// Handles the Load event of the Page control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + protected void Page_Load(object sender, EventArgs e) { + // Create an AdWordsAppConfig object with the default settings in + // App.config. + AdWordsAppConfig config = new AdWordsAppConfig(); + if (config.AuthorizationMethod == AdWordsAuthorizationMethod.OAuth2) { + if (config.OAuth2Mode == OAuth2Flow.APPLICATION && + string.IsNullOrEmpty(config.OAuth2RefreshToken)) { + DoAuth2Configuration(config); + } + } + } + + private void DoAuth2Configuration(AdWordsAppConfig config) { + // Since we use this page for OAuth callback also, we set the callback + // url as the current page. For a non-web application, this will be null. + config.OAuth2RedirectUri = Request.Url.GetLeftPart(UriPartial.Path); + + // Create an OAuth2 object for handling OAuth2 flow. + OAuth2ProviderForApplications oAuth = new OAuth2ProviderForApplications(config); + + if (Request.Params["state"] == null) { + // This is the first time this page is being loaded. + // Set the state variable to any value that helps you recognize + // when this url will be called by the OAuth2 server. + oAuth.State = "callback"; + + // Create an authorization url and redirect the user to that page. + Response.Redirect(oAuth.GetAuthorizationUrl()); + } else if (Request.Params["state"] == "callback") { + // This page was loaded because OAuth server did a callback. + // Retrieve the authorization code from the url and use it to fetch + // the access token. This call will also fetch the refresh token if + // your mode is offline. + oAuth.FetchAccessAndRefreshTokens(Request.Params["code"]); + + // Save the OAuth2 provider for future use. If you wish to save only + // the values and restore the object later, then save + // oAuth.RefreshToken, oAuth.AccessToken, oAuth.UpdatedOn and + // oAuth.ExpiresIn. + // + // You can later restore the values as + // AdWordsUser user = new AdWordsUser(); + // user.Config.OAuth2Mode = OAuth2Flow.APPLICATION; + // OAuth2ProviderForApplications oAuth = + // (user.OAuthProvider as OAuth2ProviderForApplications); + // oAuth.RefreshToken = xxx; + // oAuth.AccessToken = xxx; + // oAuth.UpdatedOn = xxx; + // oAuth.ExpiresIn = xxx; + // + // Note that only oAuth.RefreshToken is mandatory. If you leave + // oAuth.AccessToken as empty, or if oAuth.UpdatedOn + oAuth.ExpiresIn + // is in the past, the access token will be refreshed by the library. + // You can listen to this event as + // + // oAuth.OnOAuthTokensObtained += delegate(AdsOAuthProvider provider) { + // OAuth2ProviderForApplications oAuth = + // (provider as OAuth2ProviderForApplications); + // // Save oAuth.RefreshToken, oAuth.AccessToken, oAuth.UpdatedOn and + // // oAuth.ExpiresIn. + //}; + Session["OAuthProvider"] = oAuth; + // Redirect the user to the main page. + Response.Redirect("Default.aspx"); + } else { + throw new Exception("Unknown state for OAuth callback."); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/OAuth/OAuthLogin.aspx.designer.cs b/examples/AdXBuyer/CSharp/OAuth/OAuthLogin.aspx.designer.cs new file mode 100644 index 00000000000..3b527d3b084 --- /dev/null +++ b/examples/AdXBuyer/CSharp/OAuth/OAuthLogin.aspx.designer.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.5456 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Google.Api.Ads.AdWords.Examples.CSharp.OAuth { + + + public partial class OAuthLogin { + + /// + /// Head1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlHead Head1; + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + } +} diff --git a/examples/AdXBuyer/CSharp/OAuth/Properties/AssemblyInfo.cs b/examples/AdXBuyer/CSharp/OAuth/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..bc021b24663 --- /dev/null +++ b/examples/AdXBuyer/CSharp/OAuth/Properties/AssemblyInfo.cs @@ -0,0 +1,38 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("DoubleClick Ad Exchange Buyer API DotNet Client Library OAuth Samples")] +[assembly: AssemblyDescription("This application contains code examples that shows how to use " + + "DoubleClick Ad Exchange Buyer API DotNet Client Library with OAuth as authentication " + + "mechanism.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("ccc25b61-18d8-49d5-993c-5fd838a03438")] diff --git a/examples/AdXBuyer/CSharp/OAuth/Properties/Properties.cs b/examples/AdXBuyer/CSharp/OAuth/Properties/Properties.cs new file mode 100644 index 00000000000..de944c8264a --- /dev/null +++ b/examples/AdXBuyer/CSharp/OAuth/Properties/Properties.cs @@ -0,0 +1,24 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; + +[assembly: AssemblyCompany("Google")] +[assembly: AssemblyProduct("AdWords API DotNet Client Library")] +[assembly: AssemblyCopyright("Copyright 2011, Google Inc. All Rights Reserved.")] + +[assembly: AssemblyVersion("18.0.0.0")] +[assembly: AssemblyFileVersion("18.0.0.0")] diff --git a/examples/AdXBuyer/CSharp/OAuth/Web.config b/examples/AdXBuyer/CSharp/OAuth/Web.config new file mode 100644 index 00000000000..c140a7e5e84 --- /dev/null +++ b/examples/AdXBuyer/CSharp/OAuth/Web.config @@ -0,0 +1,196 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/AdXBuyer/CSharp/OAuth/css/main.css b/examples/AdXBuyer/CSharp/OAuth/css/main.css new file mode 100644 index 00000000000..e2a5949ccfb --- /dev/null +++ b/examples/AdXBuyer/CSharp/OAuth/css/main.css @@ -0,0 +1,26 @@ +/** + * Copyright 2011, Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http: *www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + + * Author: api.anash@gmail.com (Anash P. Oommen) + */ + +body { + font-family: Verdana; + font-size:10pt; +} +h1 { + font-family: Arial; + font-size:20pt; +} diff --git a/examples/AdXBuyer/CSharp/Program.cs b/examples/AdXBuyer/CSharp/Program.cs new file mode 100644 index 00000000000..ce0903c0c94 --- /dev/null +++ b/examples/AdXBuyer/CSharp/Program.cs @@ -0,0 +1,167 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; + +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Reflection; + +using ExamplePair = System.Collections.Generic.KeyValuePair; +using System.Threading; + +namespace Google.Api.Ads.AdWords.Examples.CSharp { + /// + /// The Main class for this application. + /// + class Program { + /// + /// A map to hold the code examples to be executed. + /// + static List codeExampleMap = new List(); + + /// + /// A flag to keep track of whether help message was shown earlier. + /// + private static bool helpShown = false; + + /// + /// Registers the code example. + /// + /// The code example name. + /// The code example instance. + static void RegisterCodeExample(string key, object value) { + codeExampleMap.Add(new ExamplePair(key, value)); + } + + /// + /// Static constructor to initialize the sample map. + /// + static Program() { + Type[] types = Assembly.GetExecutingAssembly().GetTypes(); + + foreach (Type type in types) { + if (type.IsSubclassOf(typeof(ExampleBase))) { + RegisterCodeExample(type.FullName.Replace(typeof(Program).Namespace + ".", ""), + Activator.CreateInstance(type)); + } + } + } + + /// + /// The main method. + /// + /// The command line arguments. + public static void Main(string[] args) { + if (args.Length == 0) { + ShowUsage(); + return; + } + + AdWordsUser user = new AdWordsUser(); + foreach (string cmdArgs in args) { + ExamplePair matchingPair = codeExampleMap.Find(delegate(ExamplePair pair) { + return string.Compare(pair.Key, cmdArgs, true) == 0; + }); + + if (matchingPair.Key != null) { + RunACodeExample(user, matchingPair.Value); + } else { + ShowUsage(); + } + } + } + + /// + /// Runs a code example. + /// + /// The user whose credentials should be used for + /// running the code example. + /// The code example to run. + private static void RunACodeExample(AdWordsUser user, object codeExample) { + try { + Console.WriteLine(GetDescription(codeExample)); + InvokeRun(codeExample, user); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } finally { + Console.WriteLine("Press [Enter] to continue"); + Console.ReadLine(); + } + } + + /// + /// Gets the description for the code example. + /// + /// The code example. + /// The description. + private static object GetDescription(object codeExample) { + Type exampleType = codeExample.GetType(); + return exampleType.GetProperty("Description").GetValue(codeExample, null); + } + + /// + /// Gets the parameters for running a code example. + /// + /// The user. + /// The code example. + /// The list of parameters. + private static object[] GetParameters(AdWordsUser user, object codeExample) { + MethodInfo methodInfo = codeExample.GetType().GetMethod("Run"); + List parameters = new List(); + parameters.Add(user); + parameters.AddRange(ExampleUtilities.GetParameters(methodInfo)); + return parameters.ToArray(); + } + + /// + /// Invokes the run method. + /// + /// The code example. + /// The user. + private static void InvokeRun(object codeExample, AdWordsUser user) { + MethodInfo methodInfo = codeExample.GetType().GetMethod("Run"); + methodInfo.Invoke(codeExample, GetParameters(user, codeExample)); + } + + /// + /// Prints program usage message. + /// + private static void ShowUsage() { + if (helpShown) { + return; + } else { + helpShown = true; + } + string exeName = Path.GetFileName(Assembly.GetExecutingAssembly().Location); + Console.WriteLine("Runs AdWords API code examples"); + Console.WriteLine("Usage : {0} [flags]\n", exeName); + Console.WriteLine("Available flags\n"); + Console.WriteLine("--help\t\t : Prints this help message.", exeName); + Console.WriteLine("--all\t\t : Run all code examples.", exeName); + Console.WriteLine("examplename1 [examplename1 ...] : " + + "Run specific code examples. Example name can be one of the following:\n", exeName); + foreach (ExamplePair pair in codeExampleMap) { + Console.WriteLine("{0} : {1}", pair.Key, GetDescription(pair.Value)); + } + Console.WriteLine("Press [Enter] to continue"); + Console.ReadLine(); + } + } +} diff --git a/examples/AdXBuyer/CSharp/Properties/AssemblyInfo.cs b/examples/AdXBuyer/CSharp/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..c0ab69b2ea5 --- /dev/null +++ b/examples/AdXBuyer/CSharp/Properties/AssemblyInfo.cs @@ -0,0 +1,37 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("DoubleClick Ad Exchange Buyer API DotNet Client Library Samples")] +[assembly: AssemblyDescription("This application contains code examples that shows how to use " + + "DoubleClick Ad Exchange Buyer API DotNet Client Library.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("ccc25b61-18d8-49d5-993c-5fd838a03438")] diff --git a/examples/AdXBuyer/CSharp/Properties/Properties.cs b/examples/AdXBuyer/CSharp/Properties/Properties.cs new file mode 100644 index 00000000000..de944c8264a --- /dev/null +++ b/examples/AdXBuyer/CSharp/Properties/Properties.cs @@ -0,0 +1,24 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; + +[assembly: AssemblyCompany("Google")] +[assembly: AssemblyProduct("AdWords API DotNet Client Library")] +[assembly: AssemblyCopyright("Copyright 2011, Google Inc. All Rights Reserved.")] + +[assembly: AssemblyVersion("18.0.0.0")] +[assembly: AssemblyFileVersion("18.0.0.0")] diff --git a/examples/AdXBuyer/CSharp/v201309/AccountManagement/GetAccountChanges.cs b/examples/AdXBuyer/CSharp/v201309/AccountManagement/GetAccountChanges.cs new file mode 100644 index 00000000000..eb87a055512 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/AccountManagement/GetAccountChanges.cs @@ -0,0 +1,176 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example gets the changes in the account during the last 24 + /// hours. + /// + /// Tags: CustomerSyncService.get + /// + public class GetAccountChanges : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAccountChanges codeExample = new GetAccountChanges(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the changes in the account during the last 24 hours."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the CustomerSyncService. + CustomerSyncService customerSyncService = + (CustomerSyncService) user.GetService(AdWordsService.v201309. + CustomerSyncService); + + // The date time string should be of the form yyyyMMdd HHmmss zzz + string minDateTime = DateTime.Now.AddDays(-1).ToUniversalTime().ToString("yyyyMMdd HHmmss") + + " UTC"; + string maxDateTime = DateTime.Now.ToUniversalTime().ToString("yyyyMMdd HHmmss") + " UTC"; + + // Create date time range. + DateTimeRange dateTimeRange = new DateTimeRange(); + dateTimeRange.min = minDateTime; + dateTimeRange.max = maxDateTime; + + try { + // Create the selector. + CustomerSyncSelector selector = new CustomerSyncSelector(); + selector.dateTimeRange = dateTimeRange; + selector.campaignIds = GetAllCampaignIds(user); + + // Get all account changes for campaign. + CustomerChangeData accountChanges = customerSyncService.get(selector); + + // Display the changes. + if (accountChanges != null && accountChanges.changedCampaigns != null) { + Console.WriteLine("Displaying changes up to: {0}", accountChanges.lastChangeTimestamp); + foreach (CampaignChangeData campaignChanges in accountChanges.changedCampaigns) { + Console.WriteLine("Campaign with id \"{0}\" was changed:", campaignChanges.campaignId); + Console.WriteLine(" Campaign changed status: {0}", + campaignChanges.campaignChangeStatus); + if (campaignChanges.campaignChangeStatus != ChangeStatus.NEW) { + Console.WriteLine(" Added ad extensions: {0}", GetFormattedList( + campaignChanges.addedAdExtensions)); + Console.WriteLine(" Added campaign criteria: {0}", + GetFormattedList(campaignChanges.addedCampaignCriteria)); + Console.WriteLine(" Added campaign targeting: {0}", + campaignChanges.campaignTargetingChanged? "yes" : "no"); + Console.WriteLine(" Deleted ad extensions: {0}", + GetFormattedList(campaignChanges.deletedAdExtensions)); + Console.WriteLine(" Deleted campaign criteria: {0}", + GetFormattedList(campaignChanges.deletedCampaignCriteria)); + + if (campaignChanges.changedAdGroups != null) { + foreach (AdGroupChangeData adGroupChanges in campaignChanges.changedAdGroups) { + Console.WriteLine(" Ad group with id \"{0}\" was changed:", + adGroupChanges.adGroupId); + Console.WriteLine(" Ad group changed status: {0}", + adGroupChanges.adGroupChangeStatus); + if (adGroupChanges.adGroupChangeStatus != ChangeStatus.NEW) { + Console.WriteLine(" Ads changed: {0}", + GetFormattedList(adGroupChanges.changedAds)); + Console.WriteLine(" Criteria changed: {0}", + GetFormattedList(adGroupChanges.changedCriteria)); + Console.WriteLine(" Criteria deleted: {0}", + GetFormattedList(adGroupChanges.deletedCriteria)); + } + } + } + } + Console.WriteLine(); + } + } else { + Console.WriteLine("No account changes were found.");; + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get account changes.", ex); + } + } + + /// + /// Formats a list of ids as a comma separated string. + /// + /// The list of ids. + /// The comma separed formatted string, enclosed in square braces. + /// + private string GetFormattedList(long[] ids) { + StringBuilder builder = new StringBuilder(); + if (ids != null) { + foreach (long id in ids) { + builder.AppendFormat("{0}, ", id); + } + } + return "[" + builder.ToString().TrimEnd(',', ' ') + "]"; + } + + /// + /// Gets all campaign ids in the account. + /// + /// The user for which campaigns are retrieved. + /// The list of campaign ids. + private long[] GetAllCampaignIds(AdWordsUser user) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201309.CampaignService); + + List allCampaigns = new List(); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id"}; + + // Get all campaigns. + CampaignPage page = campaignService.get(selector); + + // Return the results. + if (page != null && page.entries != null) { + foreach (Campaign campaign in page.entries) { + allCampaigns.Add(campaign.id); + } + } + return allCampaigns.ToArray(); + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/AdvancedOperations/AddAdGroupBidModifier.cs b/examples/AdXBuyer/CSharp/v201309/AdvancedOperations/AddAdGroupBidModifier.cs new file mode 100644 index 00000000000..8f14ccf109b --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/AdvancedOperations/AddAdGroupBidModifier.cs @@ -0,0 +1,111 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example illustrates how to add ad group level mobile bid + /// modifier override. + /// + /// Tags: AdGroupBidModifierService.mutate + /// + public class AddAdGroupBidModifier : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAdGroupBidModifier codeExample = new AddAdGroupBidModifier(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + double bidModifier = double.Parse("INSERT_ADGROUP_BID_MODIFIER_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, bidModifier); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to add ad group level mobile bid modifier " + + "override."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the adgroup for which bid modifier is + /// set. + /// The mobile bid modifier for adgroup + public void Run(AdWordsUser user, long adGroupId, double bidModifier) { + // Get the AdGroupAdService. + AdGroupBidModifierService adGroupBidModifierService = + (AdGroupBidModifierService) user.GetService( + AdWordsService.v201309.AdGroupBidModifierService); + + // Mobile criterion ID. + long criterionId = 30001; + + + // Create the adgroup bid modifier. + AdGroupBidModifier adGroupBidModifier = new AdGroupBidModifier(); + adGroupBidModifier.bidModifier = bidModifier; + adGroupBidModifier.adGroupId = adGroupId; + + Platform platform = new Platform(); + platform.id = criterionId; + + adGroupBidModifier.criterion = platform; + + AdGroupBidModifierOperation operation = new AdGroupBidModifierOperation(); + operation.@operator = Operator.ADD; + operation.operand = adGroupBidModifier; + + + try { + // Add ad group level mobile bid modifier. + AdGroupBidModifierReturnValue retval = adGroupBidModifierService.mutate( + new AdGroupBidModifierOperation[] {operation}); + + // Display the results. + if (retval != null && retval.value != null && retval.value.Length > 0) { + AdGroupBidModifier newBidModifier = retval.value[0]; + Console.WriteLine("AdGroup ID {0}, Criterion ID {1} was updated with ad group level " + + "modifier: {2}", newBidModifier.adGroupId, newBidModifier.criterion.id, + newBidModifier.bidModifier); + } else { + Console.WriteLine("No bid modifiers were added to the adgroup."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add bid modifiers to adgroup.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/AdvancedOperations/GetAdGroupBidModifiers.cs b/examples/AdXBuyer/CSharp/v201309/AdvancedOperations/GetAdGroupBidModifiers.cs new file mode 100644 index 00000000000..d7495e49651 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/AdvancedOperations/GetAdGroupBidModifiers.cs @@ -0,0 +1,122 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example illustrates how to retrieve ad group level mobile bid + /// modifiers for a campaign. + /// + /// Tags: AdGroupBidModifierService.get + /// + public class GetAdGroupBidModifiers : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAdGroupBidModifiers codeExample = new GetAdGroupBidModifiers(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve ad group level mobile bid " + + "modifiers for a campaign."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which ads are added. + /// + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupAdService. + AdGroupBidModifierService adGroupBidModifierService = + (AdGroupBidModifierService) user.GetService( + AdWordsService.v201309.AdGroupBidModifierService); + + const int PAGE_SIZE = 500; + + // Get all ad group bid modifiers for the campaign. + Selector selector = new Selector(); + selector.fields = new String[] {"CampaignId", "AdGroupId", "BidModifier", "BidModifierSource", + "CriteriaType", "Id"}; + + Predicate predicate = new Predicate(); + predicate.field = "CampaignId"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] {campaignId.ToString()}; + selector.predicates = new Predicate[] {predicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = PAGE_SIZE; + + AdGroupBidModifierPage page = new AdGroupBidModifierPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the campaigns. + page = adGroupBidModifierService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroupBidModifier adGroupBidModifier in page.entries) { + string bidModifier = (adGroupBidModifier.bidModifierSpecified)? + adGroupBidModifier.bidModifier.ToString() : "UNSET"; + Console.WriteLine("{0}) Campaign ID {1}, AdGroup ID {2}, Criterion ID {3} has " + + "ad group level modifier: {4} and source = {5}.", + i + 1, adGroupBidModifier.campaignId, + adGroupBidModifier.adGroupId, adGroupBidModifier.criterion.id, bidModifier, + adGroupBidModifier.bidModifierSource); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of adgroup bid modifiers found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve adgroup bid modifiers.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/AdvancedOperations/UploadOfflineConversions.cs b/examples/AdXBuyer/CSharp/v201309/AdvancedOperations/UploadOfflineConversions.cs new file mode 100644 index 00000000000..1f58f01f45a --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/AdvancedOperations/UploadOfflineConversions.cs @@ -0,0 +1,139 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example imports offline conversion values for specific clicks to + /// your account. To get Google Click ID for a click, run + /// CLICK_PERFORMANCE_REPORT. + /// + /// Tags: ConversionTrackerService.mutate, OfflineConversionFeedService.mutate + /// + public class UploadOfflineConversions : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + string conversionName = "INSERT_CONVERSION_NAME_HERE"; + // GCLID needs to be newer than 30 days. + string gClId = "INSERT_GOOGLE_CLICK_ID_HERE"; + // The conversion time should be higher than the click time. + string conversionTime = "INSERT_CONVERSION_TIME_HERE"; + double conversionValue = double.Parse("INSERT_CONVERSION_VALUE_HERE"); + + UploadOfflineConversions codeExample = new UploadOfflineConversions(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser(), conversionName, gClId, conversionTime, conversionValue); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example imports offline conversion values for specific clicks to " + + "your account. To get Google Click ID for a click, run CLICK_PERFORMANCE_REPORT."; + } + } + + /// + /// Runs the specified user. + /// + /// The user. + /// The name of the upload conversion to be + /// created. + /// The Google Click ID of the click for which offline + /// conversions are uploaded. + /// The conversion value to be uploaded. + /// + /// The conversion time, in yyyymmdd hhmmss + /// format. + public void Run(AdWordsUser user, String conversionName, String gClid, String conversionTime, + double conversionValue) { + // Get the ConversionTrackerService. + ConversionTrackerService conversionTrackerService = + (ConversionTrackerService) user.GetService( + AdWordsService.v201309.ConversionTrackerService); + + // Get the OfflineConversionFeedService. + OfflineConversionFeedService offlineConversionFeedService = + (OfflineConversionFeedService) user.GetService( + AdWordsService.v201309.OfflineConversionFeedService); + + const int VIEWTHROUGH_LOOKBACK_WINDOW = 30; + const int CTC_LOOKBACK_WINDOW = 90; + + try { + // Create an upload conversion. Once created, this entry will be visible + // under Tools and Analysis->Conversion and will have "Source = Import". + UploadConversion uploadConversion = new UploadConversion(); + uploadConversion.category = ConversionTrackerCategory.PAGE_VIEW; + uploadConversion.name = conversionName; + uploadConversion.viewthroughLookbackWindow = VIEWTHROUGH_LOOKBACK_WINDOW; + uploadConversion.ctcLookbackWindow = CTC_LOOKBACK_WINDOW; + + ConversionTrackerOperation uploadConversionOperation = new ConversionTrackerOperation(); + uploadConversionOperation.@operator = Operator.ADD; + uploadConversionOperation.operand = uploadConversion; + + ConversionTrackerReturnValue conversionTrackerRetval = conversionTrackerService.mutate( + new ConversionTrackerOperation[] {uploadConversionOperation}); + + UploadConversion newUploadConversion = (UploadConversion) conversionTrackerRetval.value[0]; + + Console.WriteLine("New upload conversion type with name = '{0}' and id = {1} was created.", + newUploadConversion.name, newUploadConversion.id); + + // Associate offline conversions with the upload conversion we created. + OfflineConversionFeed feed = new OfflineConversionFeed(); + feed.conversionName = conversionName; + feed.conversionTime = conversionTime; + feed.conversionValue = conversionValue; + feed.googleClickId = gClid; + + OfflineConversionFeedOperation offlineConversionOperation = + new OfflineConversionFeedOperation(); + offlineConversionOperation.@operator = Operator.ADD; + offlineConversionOperation.operand = feed; + + OfflineConversionFeedReturnValue offlineConversionRetval = + offlineConversionFeedService.mutate( + new OfflineConversionFeedOperation[] {offlineConversionOperation}); + + OfflineConversionFeed newFeed = offlineConversionRetval.value[0]; + + Console.WriteLine("Uploaded offline conversion value of {0} for Google Click ID = " + + "'{1}' to '{2}'.", newFeed.conversionValue, newFeed.googleClickId, + newFeed.conversionName); + } catch (Exception ex) { + throw new System.ApplicationException("Failed upload offline conversions.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/AdvancedOperations/UseSharedBiddingStrategy.cs b/examples/AdXBuyer/CSharp/v201309/AdvancedOperations/UseSharedBiddingStrategy.cs new file mode 100644 index 00000000000..e6445694e0b --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/AdvancedOperations/UseSharedBiddingStrategy.cs @@ -0,0 +1,208 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example adds a Shared Bidding Strategy and uses it to construct + /// a campaign. + /// + /// Tags: BiddingStrategyService.mutate + /// Tags: BudgetService.mutate, CampaignService.mutate + /// + public class UseSharedBiddingStrategy : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UseSharedBiddingStrategy codeExample = new UseSharedBiddingStrategy(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a Shared Bidding Strategy and uses it to construct " + + "a campaign."; + } + } + + /// + /// Runs the specified code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the services. + BiddingStrategyService biddingStrategyService = (BiddingStrategyService) user.GetService( + AdWordsService.v201309.BiddingStrategyService); + + BudgetService budgetService = (BudgetService) user.GetService( + AdWordsService.v201309.BudgetService); + + CampaignService campaignService = (CampaignService) user.GetService( + AdWordsService.v201309.CampaignService); + + String BIDDINGSTRATEGY_NAME = "Maximize Clicks " + ExampleUtilities.GetRandomString(); + const long BID_CEILING = 2000000; + const long SPEND_TARGET = 20000000; + + String BUDGET_NAME = "Shared Interplanetary Budget #" + ExampleUtilities.GetRandomString(); + const long BUDGET_AMOUNT = 30000000; + + String CAMPAIGN_NAME = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString(); + + try { + SharedBiddingStrategy sharedBiddingStrategy = CreateBiddingStrategy(biddingStrategyService, + BIDDINGSTRATEGY_NAME, BID_CEILING, SPEND_TARGET); + Console.WriteLine("Shared bidding strategy with name '{0}' and ID {1} of type {2} was " + + "created.", sharedBiddingStrategy.name, sharedBiddingStrategy.id, + sharedBiddingStrategy.biddingScheme.BiddingSchemeType); + + Budget sharedBudget = CreateSharedBudget(budgetService, BUDGET_NAME, BUDGET_AMOUNT); + + Campaign newCampaign = CreateCampaignWithBiddingStrategy(campaignService, CAMPAIGN_NAME, + sharedBiddingStrategy.id, sharedBudget.budgetId); + + Console.WriteLine("Campaign with name '{0}', ID {1} and bidding scheme ID {2} was " + + "created.", newCampaign.name, newCampaign.id, + newCampaign.biddingStrategyConfiguration.biddingStrategyId); + + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create campaign that uses shared " + + "bidding strategy.", ex); + } + } + + /// + /// Creates the shared bidding strategy. + /// + /// The bidding strategy service. + /// The bidding strategy name. + /// The bid ceiling. + /// The spend target. + /// The bidding strategy object. + private SharedBiddingStrategy CreateBiddingStrategy( + BiddingStrategyService biddingStrategyService, String name, long bidCeiling, + long spendTarget) { + // Create a shared bidding strategy. + SharedBiddingStrategy sharedBiddingStrategy = new SharedBiddingStrategy(); + sharedBiddingStrategy.name = name; + + TargetSpendBiddingScheme biddingScheme = new TargetSpendBiddingScheme(); + // Optionally set additional bidding scheme parameters. + biddingScheme.bidCeiling = new Money(); + biddingScheme.bidCeiling.microAmount = bidCeiling; + + biddingScheme.spendTarget = new Money(); + biddingScheme.spendTarget.microAmount = spendTarget; + + sharedBiddingStrategy.biddingScheme = biddingScheme; + + // Create operation. + BiddingStrategyOperation operation = new BiddingStrategyOperation(); + operation.@operator = Operator.ADD; + operation.operand = sharedBiddingStrategy; + + return biddingStrategyService.mutate(new BiddingStrategyOperation[] {operation}).value[0]; + } + + /// + /// Creates an explicit budget to be used only to create the Campaign. + /// + /// The budget service. + /// The budget name. + /// The budget amount. + /// The budget object. + private Budget CreateSharedBudget(BudgetService budgetService, String name, long amount) { + // Create a shared budget + Budget budget = new Budget(); + budget.name = name; + budget.period = BudgetBudgetPeriod.DAILY; + budget.amount = new Money(); + budget.amount.microAmount = amount; + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + budget.isExplicitlyShared = true; + + // Create operation. + BudgetOperation operation = new BudgetOperation(); + operation.operand = budget; + operation.@operator = Operator.ADD; + + // Make the mutate request. + return budgetService.mutate(new BudgetOperation[] {operation}).value[0]; + } + + /// + /// Creates the campaign with a shared bidding strategy. + /// + /// The campaign service. + /// The campaign name. + /// The bidding strategy id. + /// The shared budget id. + /// The campaign object. + private Campaign CreateCampaignWithBiddingStrategy(CampaignService campaignService, string name, + long biddingStrategyId, long sharedBudgetId) { + // Create campaign. + Campaign campaign = new Campaign(); + campaign.name = name; + + // Set the budget. + campaign.budget = new Budget(); + campaign.budget.budgetId = sharedBudgetId; + + // Set bidding strategy (required). + BiddingStrategyConfiguration biddingStrategyConfiguration = + new BiddingStrategyConfiguration(); + biddingStrategyConfiguration.biddingStrategyId = biddingStrategyId; + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration; + + // Set keyword matching setting (required). + KeywordMatchSetting keywordMatchSetting = new KeywordMatchSetting(); + keywordMatchSetting.optIn = true; + campaign.settings = new Setting[] {keywordMatchSetting}; + + // Set network targeting (recommended). + NetworkSetting networkSetting = new NetworkSetting(); + networkSetting.targetGoogleSearch = true; + networkSetting.targetSearchNetwork = true; + networkSetting.targetContentNetwork = true; + campaign.networkSetting = networkSetting; + + // Create operation. + CampaignOperation operation = new CampaignOperation(); + operation.operand = campaign; + operation.@operator = Operator.ADD; + + return campaignService.mutate(new CampaignOperation[] {operation}).value[0]; + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/BasicOperations/AddAdGroupDemographicCriteria.cs b/examples/AdXBuyer/CSharp/v201309/BasicOperations/AddAdGroupDemographicCriteria.cs new file mode 100644 index 00000000000..f6250cea4d3 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/BasicOperations/AddAdGroupDemographicCriteria.cs @@ -0,0 +1,123 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example adds demographic target criteria to an ad group. To get + /// ad groups, run AddAdGroup.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class AddAdGroupDemographicCriteria : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAdGroupDemographicCriteria codeExample = new AddAdGroupDemographicCriteria(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds demographic target criteria to an ad group. To get ad " + + "groups, run AddAdGroup.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which criteria are + /// added. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201309.AdGroupCriterionService); + + // Create biddable ad group criterion for gender + Gender genderTarget = new Gender(); + // Criterion Id for male. The IDs can be found here + // https://developers.google.com/adwords/api/docs/appendix/genders + genderTarget.id = 10; + + BiddableAdGroupCriterion genderBiddableAdGroupCriterion = new BiddableAdGroupCriterion(); + genderBiddableAdGroupCriterion.adGroupId = adGroupId; + genderBiddableAdGroupCriterion.criterion = genderTarget; + + // Create negative ad group criterion for age range + AgeRange ageRangeNegative = new AgeRange(); + // Criterion Id for age 18 to 24. The IDs can be found here + // https://developers.google.com/adwords/api/docs/appendix/ages + + ageRangeNegative.id = 503001; + NegativeAdGroupCriterion ageRangeNegativeAdGroupCriterion = new NegativeAdGroupCriterion(); + ageRangeNegativeAdGroupCriterion.adGroupId = adGroupId; + ageRangeNegativeAdGroupCriterion.criterion = ageRangeNegative; + + // Create operations. + AdGroupCriterionOperation genderBiddableAdGroupCriterionOperation = + new AdGroupCriterionOperation(); + genderBiddableAdGroupCriterionOperation.operand = genderBiddableAdGroupCriterion; + genderBiddableAdGroupCriterionOperation.@operator = Operator.ADD; + + AdGroupCriterionOperation ageRangeNegativeAdGroupCriterionOperation = + new AdGroupCriterionOperation(); + ageRangeNegativeAdGroupCriterionOperation.operand = ageRangeNegativeAdGroupCriterion; + ageRangeNegativeAdGroupCriterionOperation.@operator = Operator.ADD; + + AdGroupCriterionOperation[] operations = new AdGroupCriterionOperation[] { + genderBiddableAdGroupCriterionOperation, ageRangeNegativeAdGroupCriterionOperation}; + + try { + // Add ad group criteria. + AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations); + + // Display ad group criteria. + if (result != null && result.value != null) { + foreach (AdGroupCriterion adGroupCriterionResult in result.value) { + Console.WriteLine("Ad group criterion with ad group id \"{0}\", criterion id " + + "\"{1}\", and type \"{2}\" was added.", adGroupCriterionResult.adGroupId, + adGroupCriterionResult.criterion.id, + adGroupCriterionResult.criterion.CriterionType); + } + } else { + Console.WriteLine("No ad group criteria were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create ad group criteria.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/BasicOperations/AddAdGroups.cs b/examples/AdXBuyer/CSharp/v201309/BasicOperations/AddAdGroups.cs new file mode 100644 index 00000000000..b5c282b095c --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/BasicOperations/AddAdGroups.cs @@ -0,0 +1,137 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example illustrates how to create ad groups. To create + /// campaigns, run AddCampaigns.cs. + /// + /// Tags: AdGroupService.mutate + /// + public class AddAdGroups : ExampleBase { + /// + /// Number of items being added / updated in this code example. + /// + const int NUM_ITEMS = 5; + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAdGroups codeExample = new AddAdGroups(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create ad groups. To create campaigns, " + + "run AddCampaigns.cs"; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to which ad groups are + /// added. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201309.AdGroupService); + + List operations = new List(); + + for (int i = 0; i < NUM_ITEMS; i++) { + // Create the ad group. + AdGroup adGroup = new AdGroup(); + adGroup.name = string.Format("Earth to Mars Cruises #{0}", + ExampleUtilities.GetRandomString()); + adGroup.status = AdGroupStatus.ENABLED; + adGroup.campaignId = campaignId; + + // Set the ad group bids. + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + + CpmBid cpmBid = new CpmBid(); + cpmBid.bid = new Money(); + cpmBid.bid.microAmount = 10000000; + + biddingConfig.bids = new Bids[] {cpmBid}; + + adGroup.biddingStrategyConfiguration = biddingConfig; + + // Optional: Set targeting restrictions. + // These setting only affect serving for the Display Network. + TargetingSetting targetingSetting = new TargetingSetting(); + + TargetingSettingDetail placementDetail = new TargetingSettingDetail(); + placementDetail.criterionTypeGroup = CriterionTypeGroup.PLACEMENT; + placementDetail.targetAll = true; + + TargetingSettingDetail verticalDetail = new TargetingSettingDetail(); + verticalDetail.criterionTypeGroup = CriterionTypeGroup.VERTICAL; + verticalDetail.targetAll = false; + + targetingSetting.details = new TargetingSettingDetail[] {placementDetail, verticalDetail}; + + adGroup.settings = new Setting[] {targetingSetting}; + + // Create the operation. + AdGroupOperation operation = new AdGroupOperation(); + operation.@operator = Operator.ADD; + operation.operand = adGroup; + + operations.Add(operation); + } + + try { + // Create the ad group. + AdGroupReturnValue retVal = adGroupService.mutate(operations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + foreach (AdGroup newAdGroup in retVal.value) { + Console.WriteLine("Ad group with id = '{0}' and name = '{1}' was created.", + newAdGroup.id, newAdGroup.name); + } + } else { + Console.WriteLine("No ad groups were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create ad groups.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/BasicOperations/AddCampaigns.cs b/examples/AdXBuyer/CSharp/v201309/BasicOperations/AddCampaigns.cs new file mode 100644 index 00000000000..ed67c22a913 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/BasicOperations/AddCampaigns.cs @@ -0,0 +1,168 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example adds campaigns. To get campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignService.mutate + /// + public class AddCampaigns : ExampleBase { + /// + /// Number of items being added / updated in this code example. + /// + const int NUM_ITEMS = 5; + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddCampaigns codeExample = new AddCampaigns(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds campaigns. To get campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the CampaignService. + BudgetService budgetService = + (BudgetService) user.GetService(AdWordsService.v201309.BudgetService); + + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201309.CampaignService); + + // Create the campaign budget. + Budget budget = new Budget(); + budget.name = "Interplanetary Cruise Budget #" + ExampleUtilities.GetRandomString(); + budget.period = BudgetBudgetPeriod.DAILY; + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + budget.amount = new Money(); + budget.amount.microAmount = 500000; + + BudgetOperation budgetOperation = new BudgetOperation(); + budgetOperation.@operator = Operator.ADD; + budgetOperation.operand = budget; + + try { + BudgetReturnValue budgetRetval = budgetService.mutate(new BudgetOperation[] {budgetOperation}); + budget = budgetRetval.value[0]; + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add shared budget.", ex); + } + + List operations = new List(); + + for (int i = 0; i < NUM_ITEMS; i++) { + // Create the campaign. + Campaign campaign = new Campaign(); + campaign.name = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString(); + campaign.status = CampaignStatus.PAUSED; + + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + biddingConfig.biddingStrategyType = BiddingStrategyType.MANUAL_CPM; + + // Optional: also provide matching bidding scheme. + biddingConfig.biddingScheme = new ManualCpmBiddingScheme(); + + campaign.biddingStrategyConfiguration = biddingConfig; + + // Set the campaign budget. + campaign.budget = new Budget(); + campaign.budget.budgetId = budget.budgetId; + + // Set targetContentNetwork true. Other network targeting is not available + // for Ad Exchange Buyers. + campaign.networkSetting = new NetworkSetting(); + campaign.networkSetting.targetGoogleSearch = false; + campaign.networkSetting.targetSearchNetwork = false; + campaign.networkSetting.targetContentNetwork = true; + campaign.networkSetting.targetPartnerSearchNetwork = false; + + // Enable campaign for Real-time bidding. + RealTimeBiddingSetting rtbSetting = new RealTimeBiddingSetting(); + rtbSetting.optIn = true; + + campaign.settings = new Setting[] {rtbSetting}; + + // Optional: Set the start date. + campaign.startDate = DateTime.Now.AddDays(1).ToString("yyyyMMdd"); + + // Optional: Set the end date. + campaign.endDate = DateTime.Now.AddYears(1).ToString("yyyyMMdd"); + + // Optional: Set the campaign ad serving optimization status. + campaign.adServingOptimizationStatus = AdServingOptimizationStatus.ROTATE; + + // Optional: Set the frequency cap. + FrequencyCap frequencyCap = new FrequencyCap(); + frequencyCap.impressions = 5; + frequencyCap.level = Level.ADGROUP; + frequencyCap.timeUnit = TimeUnit.DAY; + campaign.frequencyCap = frequencyCap; + + // Create the operation. + CampaignOperation operation = new CampaignOperation(); + operation.@operator = Operator.ADD; + operation.operand = campaign; + + operations.Add(operation); + } + + try { + // Add the campaign. + CampaignReturnValue retVal = campaignService.mutate(operations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + foreach (Campaign newCampaign in retVal.value) { + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was added.", + newCampaign.name, newCampaign.id); + } + } else { + Console.WriteLine("No campaigns were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add campaigns.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/BasicOperations/AddPlacements.cs b/examples/AdXBuyer/CSharp/v201309/BasicOperations/AddPlacements.cs new file mode 100644 index 00000000000..499b908217c --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/BasicOperations/AddPlacements.cs @@ -0,0 +1,122 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example adds placements to an ad group. To get ad groups, run + /// GetAdGroups.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class AddPlacements : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddPlacements codeExample = new AddPlacements(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds placements to an ad group. To get ad groups, run " + + "GetAdGroups.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which placements are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201309.AdGroupCriterionService); + + // Create the placement. + Placement placement1 = new Placement(); + placement1.url = "http://mars.google.com"; + + // Create biddable ad group criterion. + AdGroupCriterion placementCriterion1 = new BiddableAdGroupCriterion(); + placementCriterion1.adGroupId = adGroupId; + placementCriterion1.criterion = placement1; + + // Create the placement. + Placement placement2 = new Placement(); + placement2.url = "http://venus.google.com"; + + // Create biddable ad group criterion. + AdGroupCriterion placementCriterion2 = new BiddableAdGroupCriterion(); + placementCriterion2.adGroupId = adGroupId; + placementCriterion2.criterion = placement2; + + // Create the operations. + AdGroupCriterionOperation placementOperation1 = new AdGroupCriterionOperation(); + placementOperation1.@operator = Operator.ADD; + placementOperation1.operand = placementCriterion1; + + AdGroupCriterionOperation placementOperation2 = new AdGroupCriterionOperation(); + placementOperation2.@operator = Operator.ADD; + placementOperation2.operand = placementCriterion2; + + try { + // Create the placements. + AdGroupCriterionReturnValue retVal = adGroupCriterionService.mutate( + new AdGroupCriterionOperation[] {placementOperation1, placementOperation2}); + + // Display the results. + if (retVal != null && retVal.value != null) { + foreach (AdGroupCriterion adGroupCriterion in retVal.value) { + // If you are adding multiple type of criteria, then you may need to + // check for + // + // if (adGroupCriterion is Placement) { ... } + // + // to identify the criterion type. + Console.WriteLine("Placement with ad group id = '{0}, placement id = '{1}, url = " + + "'{2}' was created.", adGroupCriterion.adGroupId, + adGroupCriterion.criterion.id, (adGroupCriterion.criterion as Placement).url); + } + } else { + Console.WriteLine("No placements were added."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create placements.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/BasicOperations/AddThirdPartyRedirectAds.cs b/examples/AdXBuyer/CSharp/v201309/BasicOperations/AddThirdPartyRedirectAds.cs new file mode 100644 index 00000000000..3fc1b52a585 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/BasicOperations/AddThirdPartyRedirectAds.cs @@ -0,0 +1,155 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example adds third party redirect ads to an ad group. To get + /// ad groups, run GetAdGroups.cs. + /// + /// Tags: AdGroupAdService.mutate + /// + public class AddThirdPartyRedirectAds : ExampleBase { + /// + /// Number of items being added / updated in this code example. + /// + const int NUM_ITEMS = 5; + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddThirdPartyRedirectAds codeExample = new AddThirdPartyRedirectAds(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds third party redirect ads to an ad group. To get ad " + + "groups, run GetAdGroups.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which ads are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201309.AdGroupAdService); + + // Create standard third party redirect ad. + ThirdPartyRedirectAd standardAd = new ThirdPartyRedirectAd(); + standardAd.name = String.Format("Example third party ad #{0}", + ExampleUtilities.GetRandomString()); + standardAd.url = "http://www.example.com"; + + standardAd.dimensions = new Dimensions(); + standardAd.dimensions.height = 250; + standardAd.dimensions.width = 300; + + standardAd.snippet = ""; + + // DoubleClick Rich Media Expandable format ID. + standardAd.certifiedVendorFormatId = 232; + standardAd.isCookieTargeted = false; + standardAd.isUserInterestTargeted = false; + standardAd.isTagged = false; + standardAd.richMediaAdType = RichMediaAdRichMediaAdType.STANDARD; + + // Expandable Ad properties. + standardAd.expandingDirections = new ThirdPartyRedirectAdExpandingDirection[] { + ThirdPartyRedirectAdExpandingDirection.EXPANDING_UP, + ThirdPartyRedirectAdExpandingDirection.EXPANDING_DOWN + }; + + standardAd.adAttributes = new RichMediaAdAdAttribute[] { + RichMediaAdAdAttribute.ROLL_OVER_TO_EXPAND}; + + // Create in-stream third party redirect ad. + ThirdPartyRedirectAd inStreamAd = new ThirdPartyRedirectAd(); + inStreamAd.name = String.Format("Example third party ad #{0}", + ExampleUtilities.GetRandomString()); + inStreamAd.url = "http://www.example.com"; + // Set the duration to 15 secs. + inStreamAd.adDuration = 15000; + inStreamAd.sourceUrl = "http://ad.doubleclick.net/pfadx/N270.126913.6102203221521/B3876671.21;dcadv=2215309;sz=0x0;ord=%5btimestamp%5d;dcmt=text/xml"; + inStreamAd.certifiedVendorFormatId = 303; + inStreamAd.richMediaAdType = RichMediaAdRichMediaAdType.IN_STREAM_VIDEO; + + List operations = new List(); + + foreach (ThirdPartyRedirectAd redirectAd in new + ThirdPartyRedirectAd[] {standardAd, inStreamAd}) { + // Set the ad group id. + AdGroupAd adGroupAd = new AdGroupAd(); + adGroupAd.adGroupId = adGroupId; + adGroupAd.ad = redirectAd; + + // Create the operation. + AdGroupAdOperation operation = new AdGroupAdOperation(); + operation.@operator = Operator.ADD; + operation.operand = adGroupAd; + + operations.Add(operation); + } + + AdGroupAdReturnValue retVal = null; + + try { + // Create the ads + retVal = service.mutate(operations.ToArray()); + if (retVal != null && retVal.value != null) { + // If you are adding multiple type of Ads, then you may need to check + // for + // + // if (adGroupAd.ad is ThirdPartyRedirectAd) { ... } + // + // to identify the ad type. + foreach (AdGroupAd newAdGroupAd in retVal.value) { + Console.WriteLine("New third party redirect ad with url = \"{0}\" and id = {1}" + + " was created.", ((ThirdPartyRedirectAd) newAdGroupAd.ad).url, + newAdGroupAd.ad.id); + } + } else { + Console.WriteLine("No third party redirect ads were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create third party redirect ads.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/BasicOperations/DeleteAd.cs b/examples/AdXBuyer/CSharp/v201309/BasicOperations/DeleteAd.cs new file mode 100644 index 00000000000..482a0af434d --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/BasicOperations/DeleteAd.cs @@ -0,0 +1,103 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example deletes an ad using the 'REMOVE' operator. To list ads, + /// run GetTextAds.cs. + /// + /// Tags: AdGroupAdService.mutate + /// + public class DeleteAd : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DeleteAd codeExample = new DeleteAd(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long adId = long.Parse("INSERT_AD_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, adId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deletes an ad using the 'REMOVE' operator. To list ads, " + + "run GetTextAds.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the ad. + /// Id of the ad being deleted. + public void Run(AdWordsUser user, long adGroupId, long adId) { + // Get the AdGroupAdService. + AdGroupAdService adGroupAdService = (AdGroupAdService) user.GetService( + AdWordsService.v201309.AdGroupAdService); + + // Since we do not need to update any ad-specific fields, it is enough to + // create the base type. + Ad ad = new Ad(); + ad.id = adId; + + // Create the ad group ad. + AdGroupAd adGroupAd = new AdGroupAd(); + adGroupAd.adGroupId = adGroupId; + + adGroupAd.ad = ad; + + // Create the operation. + AdGroupAdOperation operation = new AdGroupAdOperation(); + operation.operand = adGroupAd; + operation.@operator = Operator.REMOVE; + + try { + // Delete the ad. + AdGroupAdReturnValue retVal = adGroupAdService.mutate( + new AdGroupAdOperation[] {operation}); + + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupAd deletedAdGroupAd = retVal.value[0]; + Console.WriteLine("Ad with id = \"{0}\" and type = \"{1}\" was deleted.", + deletedAdGroupAd.ad.id, deletedAdGroupAd.ad.AdType); + } else { + Console.WriteLine("No ads were deleted."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to delete ad.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/BasicOperations/DeleteAdGroup.cs b/examples/AdXBuyer/CSharp/v201309/BasicOperations/DeleteAdGroup.cs new file mode 100644 index 00000000000..8c2ae667295 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/BasicOperations/DeleteAdGroup.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example deletes an ad group by setting the status to 'DELETED'. + /// To get ad groups, run GetAdGroups.cs. + /// + /// Tags: AdGroupService.mutate + /// + public class DeleteAdGroup : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DeleteAdGroup codeExample = new DeleteAdGroup(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deletes an ad group by setting the status to 'DELETED'. " + + "To get ad groups, run GetAdGroups.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to be deleted. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupService. + AdGroupService adGroupService = (AdGroupService) user.GetService( + AdWordsService.v201309.AdGroupService); + + // Create ad group with DELETED status. + AdGroup adGroup = new AdGroup(); + adGroup.id = adGroupId; + + // When deleting an ad group, rename it to avoid name collisions with new + // adgroups. + adGroup.name = "Deleted AdGroup - " + ExampleUtilities.GetRandomString(); + adGroup.status = AdGroupStatus.DELETED; + + // Create the operation. + AdGroupOperation operation = new AdGroupOperation(); + operation.operand = adGroup; + operation.@operator = Operator.SET; + + try { + // Delete the ad group. + AdGroupReturnValue retVal = adGroupService.mutate(new AdGroupOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroup deletedAdGroup = retVal.value[0]; + Console.WriteLine("Ad group with id = \"{0}\" was renamed to \"{1}\" and deleted.", + deletedAdGroup.id, deletedAdGroup.name); + } else { + Console.WriteLine("No ad groups were deleted."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to delete ad group.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/BasicOperations/DeleteCampaign.cs b/examples/AdXBuyer/CSharp/v201309/BasicOperations/DeleteCampaign.cs new file mode 100644 index 00000000000..198ef33ca82 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/BasicOperations/DeleteCampaign.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example deletes a campaign by setting the status to 'DELETED'. + /// To get campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignService.mutate + /// + public class DeleteCampaign : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DeleteCampaign codeExample = new DeleteCampaign(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deletes a campaign by setting the status to 'DELETED'. " + + "To get campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to be deleted. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignService. + CampaignService campaignService = (CampaignService) user.GetService( + AdWordsService.v201309.CampaignService); + + // Create campaign with DELETED status. + Campaign campaign = new Campaign(); + campaign.id = campaignId; + + // When deleting a campaign, rename it to avoid name collisions with new + // campaigns. + campaign.name = "Deleted Campaign - " + ExampleUtilities.GetRandomString(); + campaign.status = CampaignStatus.DELETED; + + // Create the operation. + CampaignOperation operation = new CampaignOperation(); + operation.operand = campaign; + operation.@operator = Operator.SET; + + try { + // Delete the campaign. + CampaignReturnValue retVal = campaignService.mutate(new CampaignOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + Campaign deletedCampaign = retVal.value[0]; + Console.WriteLine("Campaign with id = \"{0}\" was renamed to \"{1}\" and deleted.", + deletedCampaign.id, deletedCampaign.name); + } else { + Console.WriteLine("No campaigns were deleted."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to delete campaign.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/BasicOperations/DeletePlacement.cs b/examples/AdXBuyer/CSharp/v201309/BasicOperations/DeletePlacement.cs new file mode 100644 index 00000000000..839210d2e3b --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/BasicOperations/DeletePlacement.cs @@ -0,0 +1,103 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example deletes a placement using the 'REMOVE' operator. To get + /// placements, run GetPlacements.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class DeletePlacement : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DeletePlacement codeExample = new DeletePlacement(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long placementId = long.Parse("INSERT_PLACEMENT_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, placementId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deletes a placement using the 'REMOVE' operator. To get " + + "placements, run GetPlacements.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the placement. + /// + /// Id of the placement to be deleted. + public void Run(AdWordsUser user, long adGroupId, long placementId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = (AdGroupCriterionService)user.GetService( + AdWordsService.v201309.AdGroupCriterionService); + + // Create base class criterion to avoid setting placement-specific fields. + Criterion criterion = new Criterion(); + criterion.id = placementId; + + // Create the ad group criterion. + BiddableAdGroupCriterion adGroupCriterion = new BiddableAdGroupCriterion(); + adGroupCriterion.adGroupId = adGroupId; + adGroupCriterion.criterion = criterion; + + // Create the operation. + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.operand = adGroupCriterion; + operation.@operator = Operator.REMOVE; + + try { + // Delete the placement. + AdGroupCriterionReturnValue retVal = adGroupCriterionService.mutate( + new AdGroupCriterionOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupCriterion deletedPlacement = retVal.value[0]; + Console.WriteLine("Placement with ad group id = \"{0}\" and id = \"{1}\" was deleted.", + deletedPlacement.adGroupId, deletedPlacement.criterion.id); + } else { + Console.WriteLine("No placement was deleted."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to delete placement.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/BasicOperations/GetAdGroups.cs b/examples/AdXBuyer/CSharp/v201309/BasicOperations/GetAdGroups.cs new file mode 100644 index 00000000000..d82eda021a3 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/BasicOperations/GetAdGroups.cs @@ -0,0 +1,113 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example illustrates how to retrieve all the ad groups for a + /// campaign. To create an ad group, run AddAdGroup.cs. + /// + /// Tags: AdGroupService.get + /// + public class GetAdGroups : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAdGroups codeExample = new GetAdGroups(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve all the ad groups for a " + + "campaign. To create an ad group, run AddAdGroup.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign for which ad groups are + /// retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201309.AdGroupService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Name"}; + + // Create the filters. + Predicate predicate = new Predicate(); + predicate.field = "CampaignId"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] {campaignId.ToString()}; + selector.predicates = new Predicate[] {predicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupPage page = new AdGroupPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the ad groups. + page = adGroupService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroup adGroup in page.entries) { + Console.WriteLine("{0}) Ad group name is '{1}' and id is {2}.", i + 1, adGroup.name, + adGroup.id); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of ad groups found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve ad groups.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/BasicOperations/GetCampaigns.cs b/examples/AdXBuyer/CSharp/v201309/BasicOperations/GetCampaigns.cs new file mode 100644 index 00000000000..e02a6043ae2 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/BasicOperations/GetCampaigns.cs @@ -0,0 +1,102 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example lists all campaigns. To add a campaign, run + /// AddCampaign.cs. + /// + /// Tags: CampaignService.get + /// + public class GetCampaigns : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetCampaigns codeExample = new GetCampaigns(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example lists all campaigns. To add a campaign, run AddCampaign.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201309.CampaignService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Name", "Status"}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + CampaignPage page = new CampaignPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the campaigns. + page = campaignService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (Campaign campaign in page.entries) { + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = '{3}'" + + " was found.", i + 1, campaign.id, campaign.name, campaign.status); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve campaigns", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/BasicOperations/GetCampaignsWithAwql.cs b/examples/AdXBuyer/CSharp/v201309/BasicOperations/GetCampaignsWithAwql.cs new file mode 100644 index 00000000000..e7f463866bb --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/BasicOperations/GetCampaignsWithAwql.cs @@ -0,0 +1,100 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example lists all campaigns using an AWQL query. See + /// https://developers.google.com/adwords/api/docs/guides/awql for AWQL + /// documentation. To add a campaign, run AddCampaign.cs. + /// + /// Tags: CampaignService.get + /// + public class GetCampaignsWithAwql : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetCampaignsWithAwql codeExample = new GetCampaignsWithAwql(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example lists all campaigns using an AWQL query. See " + + "https://developers.google.com/adwords/api/docs/guides/awql for AWQL documentation. " + + "To add a campaign, run AddCampaign.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201309.CampaignService); + + // Create the query. + string query = "SELECT Id, Name, Status ORDER BY Name"; + + int offset = 0; + int pageSize = 500; + + CampaignPage page = new CampaignPage(); + + try { + do { + string queryWithPaging = string.Format("{0} LIMIT {1}, {2}", query, offset, pageSize); + + // Get the campaigns. + page = campaignService.query(queryWithPaging); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (Campaign campaign in page.entries) { + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = '{3}'" + + " was found.", i + 1, campaign.id, campaign.name, campaign.status); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve campaigns", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/BasicOperations/GetPlacements.cs b/examples/AdXBuyer/CSharp/v201309/BasicOperations/GetPlacements.cs new file mode 100644 index 00000000000..c20e7801a31 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/BasicOperations/GetPlacements.cs @@ -0,0 +1,128 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example gets all placements in an account. To add placements, + /// run AddPlacements.cs. + /// + /// Tags: AdGroupCriterionService.get + /// + public class GetPlacements : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetPlacements codeExample = new GetPlacements(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all placements in an account. To add placements, run " + + "AddPlacements.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService( + AdWordsService.v201309.AdGroupCriterionService); + + // Create a selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "AdGroupId", "PlacementUrl"}; + + // Select only keywords. + Predicate predicate = new Predicate(); + predicate.field = "CriteriaType"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] {"PLACEMENT"}; + selector.predicates = new Predicate[] {predicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupCriterionPage page = new AdGroupCriterionPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the keywords. + page = adGroupCriterionService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + + foreach (AdGroupCriterion adGroupCriterion in page.entries) { + bool isNegative = (adGroupCriterion is NegativeAdGroupCriterion); + + // If you are retrieving multiple type of criteria, then you may + // need to check for + // + // if (adGroupCriterion is Placement) { ... } + // + // to identify the criterion type. + Placement placement = (Placement) adGroupCriterion.criterion; + if (isNegative) { + Console.WriteLine("{0}) Negative placement with ad group ID = '{1}', placement " + + "ID = '{2}', and url = '{3}' was found.", i, adGroupCriterion.adGroupId, + placement.id, placement.url); + } else { + Console.WriteLine("{0}) Placement with ad group ID = '{1}', placement ID = '{2}' " + + "and url = '{3}' was found.", i, adGroupCriterion.adGroupId, + placement.id, placement.url); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of placements found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve placements."); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/BasicOperations/GetThirdPartyRedirectAds.cs b/examples/AdXBuyer/CSharp/v201309/BasicOperations/GetThirdPartyRedirectAds.cs new file mode 100644 index 00000000000..3e25531d7cb --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/BasicOperations/GetThirdPartyRedirectAds.cs @@ -0,0 +1,142 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example retrieves all third party redirect ads given an existing + /// ad group. To add third party redirect ads to an existing ad group, run + /// AddThirdPartyRedirectAd.cs. + /// + /// Tags: AdGroupAdService.get + /// + public class GetThirdPartyRedirectAds : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetThirdPartyRedirectAds codeExample = new GetThirdPartyRedirectAds(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves all third party redirect ads given an existing ad " + + "group. To add third party redirect ads to an existing ad group, run " + + "AddThirdPartyRedirectAd.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group from which third party + /// redirect ads are retrieved. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201309.AdGroupAdService); + + // Create a selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Status", "Url", "DisplayUrl", "RichMediaAdSnippet"}; + + // Set the sort order. + OrderBy orderBy = new OrderBy(); + orderBy.field = "Id"; + orderBy.sortOrder = SortOrder.ASCENDING; + selector.ordering = new OrderBy[] {orderBy}; + + // Restrict the fetch to only the selected ad group id. + Predicate adGroupPredicate = new Predicate(); + adGroupPredicate.field = "AdGroupId"; + adGroupPredicate.@operator = PredicateOperator.EQUALS; + adGroupPredicate.values = new string[] {adGroupId.ToString()}; + + // Retrieve only third party redirect ads. + Predicate typePredicate = new Predicate(); + typePredicate.field = "AdType"; + typePredicate.@operator = PredicateOperator.EQUALS; + typePredicate.values = new string[] {"THIRD_PARTY_REDIRECT_AD"}; + + // By default disabled ads aren't returned by the selector. To return + // them include the DISABLED status in the statuses field. + Predicate statusPredicate = new Predicate(); + statusPredicate.field = "Status"; + statusPredicate.@operator = PredicateOperator.IN; + + statusPredicate.values = new string[] {AdGroupAdStatus.ENABLED.ToString(), + AdGroupAdStatus.PAUSED.ToString(), AdGroupAdStatus.DISABLED.ToString()}; + + selector.predicates = new Predicate[] {adGroupPredicate, statusPredicate, typePredicate}; + + // Select the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupAdPage page = new AdGroupAdPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the third party redirect ads. + page = service.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + + foreach (AdGroupAd adGroupAd in page.entries) { + ThirdPartyRedirectAd thirdPartyRedirectAd = (ThirdPartyRedirectAd) adGroupAd.ad; + Console.WriteLine("{0}) Ad id is {1} and status is {2}", i, thirdPartyRedirectAd.id, + adGroupAd.status); + Console.WriteLine(" Url: {0}\n Display Url: {1}\n Snippet:{2}", + thirdPartyRedirectAd.url, thirdPartyRedirectAd.displayUrl, + thirdPartyRedirectAd.snippet); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of third party redirect ads found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get third party redirect ad(s).", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/BasicOperations/PauseAd.cs b/examples/AdXBuyer/CSharp/v201309/BasicOperations/PauseAd.cs new file mode 100644 index 00000000000..301d21e26a0 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/BasicOperations/PauseAd.cs @@ -0,0 +1,101 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example pauses a given ad. To list all ads, run GetTextAds.cs. + /// + /// Tags: AdGroupAdService.mutate + /// + public class PauseAd : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + PauseAd codeExample = new PauseAd(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long adId = long.Parse("INSERT_AD_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, adId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example pauses a given ad. To list all ads, run GetTextAds.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the ad. + /// + /// Id of the ad to be paused. + public void Run(AdWordsUser user, long adGroupId, long adId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201309.AdGroupAdService); + + AdGroupAdStatus status = AdGroupAdStatus.PAUSED; + + // Create the ad group ad. + AdGroupAd adGroupAd = new AdGroupAd(); + adGroupAd.status = status; + adGroupAd.adGroupId = adGroupId; + + adGroupAd.ad = new Ad(); + adGroupAd.ad.id = adId; + + // Create the operation. + AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation(); + adGroupAdOperation.@operator = Operator.SET; + adGroupAdOperation.operand = adGroupAd; + + try { + // Update the ad. + AdGroupAdReturnValue retVal = service.mutate(new AdGroupAdOperation[]{adGroupAdOperation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupAd pausedAdGroupAd = retVal.value[0]; + Console.WriteLine("Ad with id \"{0}\" and ad group id \"{1}\"was paused.", + pausedAdGroupAd.ad.id, pausedAdGroupAd.adGroupId); + } else { + Console.WriteLine("No ads were paused."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to pause ad.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/BasicOperations/UpdateAdGroup.cs b/examples/AdXBuyer/CSharp/v201309/BasicOperations/UpdateAdGroup.cs new file mode 100644 index 00000000000..6d14b870347 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/BasicOperations/UpdateAdGroup.cs @@ -0,0 +1,95 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example illustrates how to update an ad group, setting its + /// status to 'PAUSED'. To create an ad group, run AddAdGroup.cs. + /// + /// Tags: AdGroupService.mutate + /// + public class UpdateAdGroup : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdateAdGroup codeExample = new UpdateAdGroup(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to update an ad group, setting its status to " + + "'PAUSED'. To create an ad group, run AddAdGroup.cs"; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to be updated. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201309.AdGroupService); + + // Create the ad group. + AdGroup adGroup = new AdGroup(); + adGroup.status = AdGroupStatus.PAUSED; + adGroup.id = adGroupId; + + // Create the operation. + AdGroupOperation operation = new AdGroupOperation(); + operation.@operator = Operator.SET; + operation.operand = adGroup; + + try { + // Update the ad group. + AdGroupReturnValue retVal = adGroupService.mutate(new AdGroupOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroup pausedAdGroup = retVal.value[0]; + Console.WriteLine("Ad group with id = '{0}' was successfully updated.", + pausedAdGroup.id); + } else { + Console.WriteLine("No ad groups were updated."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update ad group.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/BasicOperations/UpdateCampaign.cs b/examples/AdXBuyer/CSharp/v201309/BasicOperations/UpdateCampaign.cs new file mode 100644 index 00000000000..89b26dd6912 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/BasicOperations/UpdateCampaign.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example updates a campaign. To get campaigns, run + /// GetCampaigns.cs. + /// + /// Tags: CampaignService.mutate + /// + public class UpdateCampaign : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdateCampaign codeExample = new UpdateCampaign(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a campaign. To get campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to be updated. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService)user.GetService(AdWordsService.v201309.CampaignService); + + // Create the campaign. + Campaign campaign = new Campaign(); + campaign.id = campaignId; + campaign.status = CampaignStatus.PAUSED; + + // Create the operation. + CampaignOperation operation = new CampaignOperation(); + operation.@operator = Operator.SET; + operation.operand = campaign; + + try { + // Update the campaign. + CampaignReturnValue retVal = campaignService.mutate((new CampaignOperation[] {operation})); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + Campaign updatedCampaign = retVal.value[0]; + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was updated.", + updatedCampaign.name, updatedCampaign.id); + } else { + Console.WriteLine("No campaigns were updated."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update campaign.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/BasicOperations/UpdatePlacement.cs b/examples/AdXBuyer/CSharp/v201309/BasicOperations/UpdatePlacement.cs new file mode 100644 index 00000000000..4de416a2f41 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/BasicOperations/UpdatePlacement.cs @@ -0,0 +1,122 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example updates the bid of a placement. To get placement, run + /// GetPlacements.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class UpdatePlacement : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdatePlacement codeExample = new UpdatePlacement(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long placementId = long.Parse("INSERT_PLACEMENT_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, placementId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the bid of a placement. To get placement, run " + + "GetPlacements.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the placement. + /// + /// Id of the placement to be updated. + public void Run(AdWordsUser user, long adGroupId, long placementId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201309.AdGroupCriterionService); + + // Since we are not updating any placement-specific fields, it is enough to + // create a criterion object. + Criterion criterion = new Criterion(); + criterion.id = placementId; + + // Create ad group criterion. + BiddableAdGroupCriterion biddableAdGroupCriterion = new BiddableAdGroupCriterion(); + biddableAdGroupCriterion.adGroupId = adGroupId; + biddableAdGroupCriterion.criterion = criterion; + + // Create the bids. + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + CpmBid cpmBid = new CpmBid(); + cpmBid.bid = new Money(); + cpmBid.bid.microAmount = 1000000; + biddingConfig.bids = new Bids[] {cpmBid}; + + biddableAdGroupCriterion.biddingStrategyConfiguration = biddingConfig; + + // Create the operation. + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.@operator = Operator.SET; + operation.operand = biddableAdGroupCriterion; + + try { + // Update the placement. + AdGroupCriterionReturnValue retVal = + adGroupCriterionService.mutate(new AdGroupCriterionOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupCriterion adGroupCriterion = retVal.value[0]; + long bidAmount = 0; + foreach (Bids bids in (adGroupCriterion as BiddableAdGroupCriterion). + biddingStrategyConfiguration.bids) { + if (bids is CpmBid) { + bidAmount = (bids as CpmBid).bid.microAmount; + break; + } + } + Console.WriteLine("Placement with ad group id = '{0}', id = '{1}' was updated with " + + "bid amount = '{2}' micros.", adGroupCriterion.adGroupId, + adGroupCriterion.criterion.id, bidAmount); + } else { + Console.WriteLine("No placement was updated."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update placement.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/CampaignManagement/AddPlacementsInBulk.cs b/examples/AdXBuyer/CSharp/v201309/CampaignManagement/AddPlacementsInBulk.cs new file mode 100644 index 00000000000..4c9ab83fd80 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/CampaignManagement/AddPlacementsInBulk.cs @@ -0,0 +1,172 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.RegularExpressions; +using System.Threading; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example shows how to add placements in bulk using the + /// MutateJobService. + /// + /// Tags: MutateJobService.mutate, MutateJobService.get + /// Tags: MutateJobService.getResult + /// + public class AddPlacementsInBulk : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddPlacementsInBulk codeExample = new AddPlacementsInBulk(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to add placements in bulk using the MutateJobService."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad groups to which placements are + /// added. + public void Run(AdWordsUser user, long adGroupId) { + // Get the MutateJobService. + MutateJobService mutateJobService = (MutateJobService) user.GetService( + AdWordsService.v201309.MutateJobService); + + const int RETRY_INTERVAL = 30; + const int RETRIES_COUNT = 30; + const int PLACEMENT_NUMBER = 100; + const string INDEX_REGEX = "operations\\[(\\d+)\\].operand"; + + List operations = new List(); + + // Create AdGroupCriterionOperation to add placements. + for (int i = 0; i < PLACEMENT_NUMBER; i++) { + Placement placement = new Placement(); + placement.url = "http://mars.google.com/" + i.ToString(); + + BiddableAdGroupCriterion criterion = new BiddableAdGroupCriterion(); + criterion.adGroupId = adGroupId; + criterion.criterion = placement; + + AdGroupCriterionOperation adGroupCriterionOperation = new AdGroupCriterionOperation(); + adGroupCriterionOperation.@operator = Operator.ADD; + adGroupCriterionOperation.operand = criterion; + + operations.Add(adGroupCriterionOperation); + } + + BulkMutateJobPolicy policy = new BulkMutateJobPolicy(); + // You can specify up to 3 job IDs that must successfully complete before + // this job can be processed. + policy.prerequisiteJobIds = new long[] {}; + + SimpleMutateJob job = mutateJobService.mutate(operations.ToArray(), policy); + + // Wait for the job to complete. + bool completed = false; + int retryCount = 0; + Console.WriteLine("Retrieving job status..."); + + while (completed == false && retryCount < RETRIES_COUNT) { + BulkMutateJobSelector selector = new BulkMutateJobSelector(); + selector.jobIds = new long[] {job.id}; + + try { + Job[] allJobs = mutateJobService.get(selector); + if (allJobs != null && allJobs.Length > 0) { + job = (SimpleMutateJob) allJobs[0]; + if (job.status == BasicJobStatus.COMPLETED || job.status == BasicJobStatus.FAILED) { + completed = true; + break; + } else { + Console.WriteLine("{0}: Current status is {1}, waiting {2} seconds to retry...", + retryCount, job.status, RETRY_INTERVAL); + Thread.Sleep(RETRY_INTERVAL * 1000); + retryCount++; + } + } + } catch (Exception ex) { + throw new System.ApplicationException(string.Format("Failed to fetch simple mutate " + + "job with id = {0}.", job.id), ex); + } + } + + if (job.status == BasicJobStatus.COMPLETED) { + // Handle cases where the job completed. + + // Create the job selector. + BulkMutateJobSelector selector = new BulkMutateJobSelector(); + selector.jobIds = new long[] {job.id}; + + // Get the job results. + JobResult jobResult = mutateJobService.getResult(selector); + if (jobResult != null) { + SimpleMutateResult results = (SimpleMutateResult) jobResult.Item; + if (results != null) { + // Display the results. + if (results.results != null) { + for (int i = 0; i < results.results.Length; i++) { + Operand operand = results.results[i]; + Console.WriteLine("Operation {0} - {1}", i, (operand.Item is PlaceHolder) ? + "FAILED" : "SUCCEEDED"); + } + } + + // Display the errors. + if (results.errors != null) { + foreach (ApiError apiError in results.errors) { + Match match = Regex.Match(apiError.fieldPath, INDEX_REGEX, RegexOptions.IgnoreCase); + string index = (match.Success)? match.Groups[1].Value : "???"; + Console.WriteLine("Operation index {0} failed due to reason: '{1}', " + + "trigger: '{2}'", index, apiError.errorString, apiError.trigger); + } + } + } + } + Console.WriteLine("Job completed successfully!"); + } else if (job.status == BasicJobStatus.FAILED) { + // Handle the cases where job failed. + Console.WriteLine("Job failed with reason: " + job.failureReason); + } else if (job.status == BasicJobStatus.PROCESSING || job.status == BasicJobStatus.PENDING) { + // Handle the cases where job didn't complete after wait period. + Console.WriteLine("Job did not complete in {0} secconds.", RETRY_INTERVAL * RETRIES_COUNT); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/CampaignManagement/GetAllDisapprovedAds.cs b/examples/AdXBuyer/CSharp/v201309/CampaignManagement/GetAllDisapprovedAds.cs new file mode 100644 index 00000000000..30b375616ee --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/CampaignManagement/GetAllDisapprovedAds.cs @@ -0,0 +1,121 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example retrieves all the disapproved ads in a given campaign. + /// + /// Tags: AdGroupAdService.get + /// + public class GetAllDisapprovedAds : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAllDisapprovedAds codeExample = new GetAllDisapprovedAds(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves all the disapproved ads in a given campaign."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign for which disapproved ads + /// are retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201309.AdGroupAdService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "AdGroupCreativeApprovalStatus", + "AdGroupAdDisapprovalReasons"}; + + // Create the filter. + Predicate campaignPredicate = new Predicate(); + campaignPredicate.@operator = PredicateOperator.EQUALS; + campaignPredicate.field = "CampaignId"; + campaignPredicate.values = new string[] {campaignId.ToString()}; + + Predicate approvalPredicate = new Predicate(); + approvalPredicate.@operator = PredicateOperator.EQUALS; + approvalPredicate.field = "AdGroupCreativeApprovalStatus"; + approvalPredicate.values = new string[] {AdGroupAdApprovalStatus.DISAPPROVED.ToString()}; + + selector.predicates = new Predicate[] {campaignPredicate, approvalPredicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupAdPage page = new AdGroupAdPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the disapproved ads. + page = service.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroupAd adGroupAd in page.entries) { + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " + + "reason(s):", i, adGroupAd.ad.id); + foreach (string reason in adGroupAd.disapprovalReasons) { + Console.WriteLine(" {0}", reason); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get disapproved ads.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs b/examples/AdXBuyer/CSharp/v201309/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs new file mode 100644 index 00000000000..ba45be8ad01 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs @@ -0,0 +1,108 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example retrieves all the disapproved ads in a given campaign + /// using AWQL. See https://developers.google.com/adwords/api/docs/guides/awql + /// for AWQL documentation. + /// + /// Tags: AdGroupAdService.get + /// + public class GetAllDisapprovedAdsWithAwql : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAllDisapprovedAdsWithAwql codeExample = new GetAllDisapprovedAdsWithAwql(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves all the disapproved ads in a given campaign using " + + "AWQL. See https://developers.google.com/adwords/api/docs/guides/awql for AWQL " + + "documentation."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign for which disapproved ads + /// are retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201309.AdGroupAdService); + + // Get all the disapproved ads for this campaign. + string query = string.Format("SELECT Id, AdGroupAdDisapprovalReasons WHERE " + + "CampaignId = {0} AND AdGroupCreativeApprovalStatus = DISAPPROVED ORDER BY Id", + campaignId); + + int offset = 0; + int pageSize = 500; + + AdGroupAdPage page = new AdGroupAdPage(); + + try { + do { + string queryWithPaging = string.Format("{0} LIMIT {1}, {2}", query, offset, pageSize); + + // Get the disapproved ads. + page = service.query(queryWithPaging); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroupAd adGroupAd in page.entries) { + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " + + "reason(s):", i, adGroupAd.ad.id); + foreach (string reason in adGroupAd.disapprovalReasons) { + Console.WriteLine(" {0}", reason); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get disapproved ads.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/ErrorHandling/HandlePartialFailures.cs b/examples/AdXBuyer/CSharp/v201309/ErrorHandling/HandlePartialFailures.cs new file mode 100644 index 00000000000..2de890bd27f --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/ErrorHandling/HandlePartialFailures.cs @@ -0,0 +1,135 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example demonstrates how to handle partial failures. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class HandlePartialFailures : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + HandlePartialFailures codeExample = new HandlePartialFailures(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example demonstrates how to handle partial failures."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which keywords are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201309.AdGroupCriterionService); + + // Set partial failure mode for the service. + adGroupCriterionService.RequestHeader.partialFailure = true; + + List operations = new List(); + + // Create the placements. + string[] urls = new String[] {"http://mars.google.com", "http:/mars.google.com", + "mars.google.com"}; + + foreach (String url in urls) { + Placement placement = new Placement(); + placement.url = url; + + // Create biddable ad group criterion. + BiddableAdGroupCriterion placementBiddableAdGroupCriterion = new BiddableAdGroupCriterion(); + placementBiddableAdGroupCriterion.adGroupId = adGroupId; + placementBiddableAdGroupCriterion.criterion = placement; + + // Create the operation. + AdGroupCriterionOperation placementAdGroupCriterionOperation = + new AdGroupCriterionOperation(); + placementAdGroupCriterionOperation.operand = placementBiddableAdGroupCriterion; + placementAdGroupCriterionOperation.@operator = Operator.ADD; + operations.Add(placementAdGroupCriterionOperation); + } + + try { + // Create the placements. + AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations.ToArray()); + + // Display the results. + if (result != null && result.value != null) { + foreach (AdGroupCriterion adGroupCriterionResult in result.value) { + if (adGroupCriterionResult.criterion != null) { + Console.WriteLine("Placement with ad group id '{0}', and criterion " + + "id '{1}', and url '{2}' was added.\n", adGroupCriterionResult.adGroupId, + adGroupCriterionResult.criterion.id, + ((Placement) adGroupCriterionResult.criterion).url); + } + } + } else { + Console.WriteLine("No placements were added."); + } + + // Display the partial failure errors. + if (result != null && result.partialFailureErrors != null) { + foreach (ApiError apiError in result.partialFailureErrors) { + int operationIndex = ErrorUtilities.GetOperationIndex(apiError.fieldPath); + if (operationIndex != -1) { + AdGroupCriterion adGroupCriterion = operations[operationIndex].operand; + Console.WriteLine("Placement with ad group id '{0}' and url '{1}' " + + "triggered a failure for the following reason: '{2}'.\n", + adGroupCriterion.adGroupId, ((Placement) adGroupCriterion.criterion).url, + apiError.errorString); + } else { + Console.WriteLine("A failure for the following reason: '{0}' has occurred.\n", + apiError.errorString); + } + } + } + } catch (Exception e) { + throw new System.ApplicationException("Failed to add placements in partial failure mode.", + e); + } + } + } +} + diff --git a/examples/AdXBuyer/CSharp/v201309/ErrorHandling/HandlePolicyViolationError.cs b/examples/AdXBuyer/CSharp/v201309/ErrorHandling/HandlePolicyViolationError.cs new file mode 100644 index 00000000000..e6dfb17da4e --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/ErrorHandling/HandlePolicyViolationError.cs @@ -0,0 +1,180 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example adds a text ad, and shows how to handle a policy + /// violation. + /// + /// Tags: AdGroupAdService.mutate + /// + public class HandlePolicyViolationError : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + HandlePolicyViolationError codeExample = new HandlePolicyViolationError(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a text ad, and shows how to handle a policy violation."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which ads are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201309.AdGroupAdService); + + // Create the third party redirect ad that violates a policy. + ThirdPartyRedirectAd redirectAd = new ThirdPartyRedirectAd(); + redirectAd.name = "Policy violation demo ad " + ExampleUtilities.GetRandomString(); + redirectAd.url = "gopher://gopher.google.com"; + redirectAd.dimensions = new Dimensions(); + redirectAd.dimensions.width = 300; + redirectAd.dimensions.height = 250; + + redirectAd.snippet = ""; + redirectAd.impressionBeaconUrl = "http://www.examples.com/beacon1"; + redirectAd.certifiedVendorFormatId = 119; + redirectAd.isCookieTargeted = false; + redirectAd.isUserInterestTargeted = false; + redirectAd.isTagged = false; + + AdGroupAd redirectAdGroupAd = new AdGroupAd(); + redirectAdGroupAd.adGroupId = adGroupId; + redirectAdGroupAd.ad = redirectAd; + + // Create the operations. + AdGroupAdOperation redirectAdOperation = new AdGroupAdOperation(); + redirectAdOperation.@operator = Operator.ADD; + redirectAdOperation.operand = redirectAdGroupAd; + + try { + AdGroupAdReturnValue retVal = null; + + // Setup two arrays, one to hold the list of all operations to be + // validated, and another to hold the list of operations that cannot be + // fixed after validation. + List allOperations = new List(); + List operationsToBeRemoved = new List(); + + allOperations.Add(redirectAdOperation); + + try { + // Validate the operations. + service.RequestHeader.validateOnly = true; + retVal = service.mutate(allOperations.ToArray()); + } catch (AdWordsApiException ex) { + ApiException innerException = ex.ApiException as ApiException; + if (innerException == null) { + throw new Exception("Failed to retrieve ApiError. See inner exception for more " + + "details.", ex); + } + + // Examine each ApiError received from the server. + foreach (ApiError apiError in innerException.errors) { + int index = ErrorUtilities.GetOperationIndex(apiError.fieldPath); + if (index == -1) { + // This API error is not associated with an operand, so we cannot + // recover from this error by removing one or more operations. + // Rethrow the exception for manual inspection. + throw; + } + + // Handle policy violation errors. + if (apiError is PolicyViolationError) { + PolicyViolationError policyError = (PolicyViolationError) apiError; + + if (policyError.isExemptable) { + // If the policy violation error is exemptable, add an exemption + // request. + List exemptionRequests = new List(); + if (allOperations[index].exemptionRequests != null) { + exemptionRequests.AddRange(allOperations[index].exemptionRequests); + } + + ExemptionRequest exemptionRequest = new ExemptionRequest(); + exemptionRequest.key = policyError.key; + exemptionRequests.Add(exemptionRequest); + allOperations[index].exemptionRequests = exemptionRequests.ToArray(); + } else { + // Policy violation error is not exemptable, remove this + // operation from the list of operations. + operationsToBeRemoved.Add(allOperations[index]); + } + } else { + // This is not a policy violation error, remove this operation + // from the list of operations. + operationsToBeRemoved.Add(allOperations[index]); + } + } + // Remove all operations that aren't exemptable. + foreach (AdGroupAdOperation operation in operationsToBeRemoved) { + allOperations.Remove(operation); + } + } + + if (allOperations.Count > 0) { + // Perform the operations exemptible of a policy violation. + service.RequestHeader.validateOnly = false; + retVal = service.mutate(allOperations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + foreach (AdGroupAd newAdGroupAd in retVal.value) { + Console.WriteLine("New ad with id = \"{0}\" and displayUrl = \"{1}\" was created.", + newAdGroupAd.ad.id, newAdGroupAd.ad.displayUrl); + } + } else { + Console.WriteLine("No ads were created."); + } + } else { + Console.WriteLine("There are no ads to create after policy violation checks."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create ads.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/ErrorHandling/HandleRateExceededError.cs b/examples/AdXBuyer/CSharp/v201309/ErrorHandling/HandleRateExceededError.cs new file mode 100644 index 00000000000..50d76d6d8d6 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/ErrorHandling/HandleRateExceededError.cs @@ -0,0 +1,204 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example shows how to handle RateExceededError in your + /// application. To trigger the rate exceeded error, this code example runs + /// 100 threads in parallel, each thread attempting to validate 100 keywords + /// in a single request. Note that spawning 100 parallel threads is for + /// illustrative purposes only, you shouldn't do this in your application. + /// + /// Tags: AdGroupAdService.mutate + /// + public class HandleRateExceededError: ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + HandleRateExceededError codeExample = new HandleRateExceededError(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to handle RateExceededError in your application. " + + "To trigger the rate exceeded error, this code example runs 100 threads in " + + "parallel, each thread attempting to validate 100 keywords in a single request. " + + "Note that spawning 100 parallel threads is for illustrative purposes only, you " + + "shouldn't do this in your application."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which keywords are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + const int NUM_THREADS = 100; + + // Increase the maximum number of parallel HTTP connections that .NET + // framework allows. By default, this is set to 2 by the .NET framework. + System.Net.ServicePointManager.DefaultConnectionLimit = NUM_THREADS; + + List threads = new List(); + + for (int i = 0; i < NUM_THREADS; i++) { + Thread thread = new Thread(new KeywordThread(user, i, adGroupId).Run); + threads.Add(thread); + } + + for (int i = 0; i < NUM_THREADS; i++) { + threads[i].Start(i); + } + + for (int i = 0; i < NUM_THREADS; i++) { + threads[i].Join(); + } + } + + /// + /// Thread class for validating keywords. + /// + class KeywordThread { + /// + /// Index of this thread, for identifying and debugging. + /// + int threadIndex; + + /// + /// The ad group id to which keywords are added. + /// + long adGroupId; + + /// + /// The AdWords user who owns this ad group. + /// + AdWordsUser user; + + /// + /// Number of keywords to be validated in each API call. + /// + const int NUM_KEYWORDS = 100; + + /// + /// Initializes a new instance of the class. + /// + /// Index of the thread. + /// The ad group id. + /// The AdWords user who owns the ad group. + public KeywordThread(AdWordsUser user, int threadIndex, long adGroupId) { + this.user = user; + this.threadIndex = threadIndex; + this.adGroupId = adGroupId; + } + + /// + /// Main method for the thread. + /// + /// The thread parameter. + public void Run(Object obj) { + // Create the operations. + List operations = new List(); + + for (int j = 0; j < NUM_KEYWORDS; j++) { + // Create the keyword. + Keyword keyword = new Keyword(); + keyword.text = "mars cruise thread " + threadIndex.ToString() + " seed " + j.ToString(); + keyword.matchType = KeywordMatchType.BROAD; + + // Create the biddable ad group criterion. + AdGroupCriterion keywordCriterion = new BiddableAdGroupCriterion(); + keywordCriterion.adGroupId = adGroupId; + keywordCriterion.criterion = keyword; + + // Create the operations. + AdGroupCriterionOperation keywordOperation = new AdGroupCriterionOperation(); + keywordOperation.@operator = Operator.ADD; + keywordOperation.operand = keywordCriterion; + + operations.Add(keywordOperation); + } + + // Get the AdGroupCriterionService. This should be done within the + // thread, since a service can only handle one outgoing HTTP request + // at a time. + AdGroupCriterionService service = (AdGroupCriterionService) user.GetService( + AdWordsService.v201309.AdGroupCriterionService); + service.RequestHeader.validateOnly = true; + int retryCount = 0; + const int NUM_RETRIES = 3; + try { + while (retryCount < NUM_RETRIES) { + try { + // Validate the keywords. + AdGroupCriterionReturnValue retval = service.mutate(operations.ToArray()); + break; + } catch (AdWordsApiException ex) { + // Handle API errors. + ApiException innerException = ex.ApiException as ApiException; + if (innerException == null) { + throw new Exception("Failed to retrieve ApiError. See inner exception for more " + + "details.", ex); + } + foreach (ApiError apiError in innerException.errors) { + if (!(apiError is RateExceededError)) { + // Rethrow any errors other than RateExceededError. + throw; + } + // Handle rate exceeded errors. + RateExceededError rateExceededError = (RateExceededError) apiError; + Console.WriteLine("Got Rate exceeded error - rate name = '{0}', scope = '{1}', " + + "retry After {2} seconds.", rateExceededError.rateScope, + rateExceededError.rateName, rateExceededError.retryAfterSeconds); + Thread.Sleep(rateExceededError.retryAfterSeconds * 1000); + retryCount = retryCount + 1; + } + } finally { + if (retryCount == NUM_RETRIES) { + throw new Exception(String.Format("Could not recover after making {0} attempts.", + retryCount)); + } + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to validate keywords.", ex); + } + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/ErrorHandling/HandleTwoFactorAuthorizationError.cs b/examples/AdXBuyer/CSharp/v201309/ErrorHandling/HandleTwoFactorAuthorizationError.cs new file mode 100644 index 00000000000..b2e89a28b6b --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/ErrorHandling/HandleTwoFactorAuthorizationError.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example illustrates how to handle 2 factor authorization errors. + /// + /// Tags: CampaignService.get + /// + public class HandleTwoFactorAuthorizationError : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + HandleTwoFactorAuthorizationError codeExample = new HandleTwoFactorAuthorizationError(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to handle 2 factor authorization errors."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Use a test account for which 2 factor authentication has been enabled. + string loginEmail = "2steptester@gmail.com"; + string password = "testaccount"; + + AdWordsAppConfig config = new AdWordsAppConfig(); + config.Email = loginEmail; + config.Password = password; + AuthToken authToken = new AuthToken(config, "adwords"); + + try { + // Try to obtain an authToken. + string token = authToken.GetToken(); + Console.WriteLine("Retrieved an authToken = {0} for user {1}.", token, loginEmail); + } catch (AuthTokenException ex) { + // Since the test account has 2 factor authentication enabled, this block + // of code will be executed. + if (ex.ErrorCode == AuthTokenErrorCode.BadAuthentication) { + if (ex.Info == "InvalidSecondFactor") { + Console.WriteLine("The user has enabled two factor authentication in this " + + "account. Have the user generate an application-specific password to make " + + "calls against the AdWords API. See " + + "http://adwordsapi.blogspot.com/2011/02/authentication-changes-with-2-step.html" + + " for more details."); + } else { + Console.WriteLine("Invalid credentials."); + } + } else { + throw new System.ApplicationException(String.Format("The server raised an {0} error.", + ex.ErrorCode)); + } + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/Miscellaneous/GetAllVideosAndImages.cs b/examples/AdXBuyer/CSharp/v201309/Miscellaneous/GetAllVideosAndImages.cs new file mode 100644 index 00000000000..06207c369e4 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/Miscellaneous/GetAllVideosAndImages.cs @@ -0,0 +1,139 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example gets all videos and images. To upload video, see + /// http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. + /// To upload image, run UploadImage.cs. + /// + /// Tags: MediaService.get + /// + public class GetAllVideosAndImages : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAllVideosAndImages codeExample = new GetAllVideosAndImages(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all videos and images. To upload video, see " + + "http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. To " + + "upload image, run UploadImage.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the MediaService. + MediaService mediaService = (MediaService) user.GetService( + AdWordsService.v201309.MediaService); + + // Create a selector. + Selector selector = new Selector(); + selector.fields = new string[] {"MediaId", "Width", "Height", "MimeType"}; + + // Set the filter. + Predicate predicate = new Predicate(); + predicate.@operator = PredicateOperator.IN; + predicate.field = "Type"; + predicate.values = new string[] {MediaMediaType.VIDEO.ToString(), + MediaMediaType.IMAGE.ToString()}; + + selector.predicates = new Predicate[] {predicate}; + + // Set selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + MediaPage page = new MediaPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + page = mediaService.get(selector); + + if (page != null && page.entries != null) { + int i = offset; + + foreach (Media media in page.entries) { + if (media is Video) { + Video video = (Video) media; + Console.WriteLine("{0}) Video with id \"{1}\" and name \"{2}\" was found.", + i, video.mediaId, video.name); + } else if (media is Image) { + Image image = (Image) media; + Dictionary dimensions = + CreateMediaDimensionMap(image.dimensions); + Console.WriteLine("{0}) Image with id '{1}', dimensions '{2}x{3}', and MIME type " + + "'{4}' was found.", i, image.mediaId, dimensions[MediaSize.FULL].width, + dimensions[MediaSize.FULL].height, image.mimeType); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of images and videos found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get images and videos.", ex); + } + } + + /// + /// Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + /// + /// The array of Media_Size_DimensionsMapEntry to be + /// converted into a dictionary. + /// A dictionary with key as MediaSize, and value as Dimensions. + /// + private Dictionary CreateMediaDimensionMap( + Media_Size_DimensionsMapEntry[] dimensions) { + Dictionary mediaMap = new Dictionary(); + foreach (Media_Size_DimensionsMapEntry dimension in dimensions) { + mediaMap.Add(dimension.key, dimension.value); + } + return mediaMap; + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/Miscellaneous/UploadImage.cs b/examples/AdXBuyer/CSharp/v201309/Miscellaneous/UploadImage.cs new file mode 100644 index 00000000000..b44ac5e2189 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/Miscellaneous/UploadImage.cs @@ -0,0 +1,106 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example uploads an image. To get images, run GetAllVideosAndImages.cs. + /// + /// Tags: MediaService.upload + /// + public class UploadImage : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UploadImage codeExample = new UploadImage(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example uploads an image. To get images, run GetAllVideosAndImages.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the MediaService. + MediaService mediaService = (MediaService) user.GetService( + AdWordsService.v201309.MediaService); + + // Create the image. + Image image = new Image(); + image.data = MediaUtilities.GetAssetDataFromUrl("http://goo.gl/HJM3L"); + image.type = MediaMediaType.IMAGE; + + try { + // Upload the image. + Media[] result = mediaService.upload(new Media[] {image}); + + // Display the results. + if (result != null && result.Length > 0) { + Media newImage = result[0]; + Dictionary dimensions = + CreateMediaDimensionMap(newImage.dimensions); + Console.WriteLine("Image with id '{0}', dimensions '{1}x{2}', and MIME type '{3}'" + + " was uploaded.", newImage.mediaId, dimensions[MediaSize.FULL].width, + dimensions[MediaSize.FULL].height, newImage.mimeType); + } else { + Console.WriteLine("No images were uploaded."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to upload image.", ex); + } + } + + /// + /// Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + /// + /// The array of Media_Size_DimensionsMapEntry to be + /// converted into a dictionary. + /// A dictionary with key as MediaSize, and value as Dimensions. + /// + private Dictionary CreateMediaDimensionMap( + Media_Size_DimensionsMapEntry[] dimensions) { + Dictionary mediaMap = new Dictionary(); + foreach (Media_Size_DimensionsMapEntry dimension in dimensions) { + mediaMap.Add(dimension.key, dimension.value); + } + return mediaMap; + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/Optimization/GetPlacementIdeas.cs b/examples/AdXBuyer/CSharp/v201309/Optimization/GetPlacementIdeas.cs new file mode 100644 index 00000000000..7b0462b0c67 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/Optimization/GetPlacementIdeas.cs @@ -0,0 +1,122 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example retrieves urls that have content keywords related to a + /// given website. + /// + /// Tags: TargetingIdeaService.get + /// + public class GetPlacementIdeas : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetPlacementIdeas codeExample = new GetPlacementIdeas(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves urls that have content keywords related to a" + + " given website."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the TargetingIdeaService. + TargetingIdeaService targetingIdeaService = + (TargetingIdeaService) user.GetService(AdWordsService.v201309.TargetingIdeaService); + + // Create seed url. + string url = "mars.google.com"; + + // Create the selector. + TargetingIdeaSelector selector = new TargetingIdeaSelector(); + selector.requestType = RequestType.IDEAS; + selector.ideaType = IdeaType.PLACEMENT; + selector.requestedAttributeTypes = new AttributeType[] {AttributeType.CRITERION, + AttributeType.PLACEMENT_TYPE}; + + // Create related to url search parameter. + RelatedToUrlSearchParameter relatedToUrlSearchParameter = new RelatedToUrlSearchParameter(); + relatedToUrlSearchParameter.urls = new string[] {url}; + relatedToUrlSearchParameter.includeSubUrls = false; + selector.searchParameters = new SearchParameter[] {relatedToUrlSearchParameter}; + + // Set selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + TargetingIdeaPage page = new TargetingIdeaPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get placement ideas. + page = targetingIdeaService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + + foreach (TargetingIdea idea in page.entries) { + foreach (Type_AttributeMapEntry entry in idea.data) { + if (entry.key == AttributeType.CRITERION) { + CriterionAttribute placementAttribute = entry.value as CriterionAttribute; + Placement placement = (Placement) placementAttribute.value; + Console.WriteLine("Related placement urls were found at '{0}'.", + (placementAttribute.value as Placement).url); + } + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of related placements found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve related placements.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/Remarketing/AddAudience.cs b/examples/AdXBuyer/CSharp/v201309/Remarketing/AddAudience.cs new file mode 100644 index 00000000000..c9a9c0ed1db --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/Remarketing/AddAudience.cs @@ -0,0 +1,156 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example illustrates how to create a user list a.k.a. audience. + /// + /// Tags: UserListService.mutate + /// + public class AddAudience : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAudience codeExample = new AddAudience(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create a user list a.k.a. audience."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the UserListService. + AdwordsUserListService userListService = + (AdwordsUserListService) user.GetService(AdWordsService.v201309.AdwordsUserListService); + + // Get the ConversionTrackerService. + ConversionTrackerService conversionTrackerService = + (ConversionTrackerService)user.GetService(AdWordsService.v201309. + ConversionTrackerService); + + BasicUserList userList = new BasicUserList(); + userList.name = "Mars cruise customers #" + ExampleUtilities.GetRandomString(); + userList.description = "A list of mars cruise customers in the last year."; + userList.status = UserListMembershipStatus.OPEN; + userList.membershipLifeSpan = 365; + + UserListConversionType conversionType = new UserListConversionType(); + conversionType.name = userList.name; + userList.conversionTypes = new UserListConversionType[] {conversionType}; + + // Optional: Set the user list status. + userList.status = UserListMembershipStatus.OPEN; + + // Create the operation. + UserListOperation operation = new UserListOperation(); + operation.operand = userList; + operation.@operator = Operator.ADD; + + try { + // Add the user list. + UserListReturnValue retval = userListService.mutate(new UserListOperation[] {operation}); + + UserList[] userLists = null; + if (retval != null && retval.value != null) { + userLists = retval.value; + // Get all conversion snippets + List conversionIds = new List(); + foreach (BasicUserList newUserList in userLists) { + if (newUserList.conversionTypes != null) { + foreach (UserListConversionType newConversionType in newUserList.conversionTypes) { + conversionIds.Add(newConversionType.id.ToString()); + } + } + } + + Dictionary conversionsMap = + new Dictionary(); + + if (conversionIds.Count > 0) { + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id"}; + + Predicate conversionTypePredicate = new Predicate(); + conversionTypePredicate.field = "Id"; + conversionTypePredicate.@operator = PredicateOperator.IN; + conversionTypePredicate.values = conversionIds.ToArray(); + selector.predicates = new Predicate[] {conversionTypePredicate}; + + // Get all conversion trackers. + ConversionTrackerPage page = conversionTrackerService.get(selector); + + if (page != null && page.entries != null) { + foreach (ConversionTracker tracker in page.entries) { + conversionsMap[tracker.id] = tracker; + } + } + } + + // Display the results. + foreach (BasicUserList newUserList in userLists) { + Console.WriteLine("User list with name '{0}' and id '{1}' was added.", + newUserList.name, newUserList.id); + + // Display user list associated conversion code snippets. + if (newUserList.conversionTypes != null) { + foreach (UserListConversionType userListConversionType in + newUserList.conversionTypes) { + if (conversionsMap.ContainsKey(userListConversionType.id)) { + AdWordsConversionTracker conversionTracker = + (AdWordsConversionTracker) conversionsMap[userListConversionType.id]; + Console.WriteLine("Conversion type code snippet associated to the list:\n{0}\n", + conversionTracker.snippet); + } else { + throw new Exception("Failed to associate conversion type code snippet."); + } + } + } + } + } else { + Console.WriteLine("No user lists (a.k.a. audiences) were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add user lists (a.k.a. audiences).", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/Remarketing/AddConversionTracker.cs b/examples/AdXBuyer/CSharp/v201309/Remarketing/AddConversionTracker.cs new file mode 100644 index 00000000000..ae939e71b0d --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/Remarketing/AddConversionTracker.cs @@ -0,0 +1,106 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example adds an AdWords conversion tracker. + /// + /// Tags: ConversionTrackerService.mutate + /// + public class AddConversionTracker : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddConversionTracker codeExample = new AddConversionTracker(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds an AdWords conversion tracker."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ConversionTrackerService. + ConversionTrackerService conversionTrackerService = + (ConversionTrackerService)user.GetService(AdWordsService.v201309. + ConversionTrackerService); + + // Create Adwords conversion tracker. + AdWordsConversionTracker conversionTracker = new AdWordsConversionTracker(); + conversionTracker.name = "Earth to Mars Cruises Conversion #" + + ExampleUtilities.GetRandomString(); + conversionTracker.category = ConversionTrackerCategory.DEFAULT; + conversionTracker.markupLanguage = AdWordsConversionTrackerMarkupLanguage.HTML; + conversionTracker.textFormat = AdWordsConversionTrackerTextFormat.HIDDEN; + + // Set optional fields. + conversionTracker.status = ConversionTrackerStatus.ENABLED; + conversionTracker.viewthroughLookbackWindow = 15; + conversionTracker.isProductAdsChargeable = true; + conversionTracker.productAdsChargeableConversionWindow = 15; + conversionTracker.conversionPageLanguage = "en"; + conversionTracker.backgroundColor = "#0000FF"; + conversionTracker.userRevenueValue = "someJavascriptVariable"; + + // Create the operation. + ConversionTrackerOperation operation = new ConversionTrackerOperation(); + operation.@operator = Operator.ADD; + operation.operand = conversionTracker; + + try { + // Add conversion tracker. + ConversionTrackerReturnValue retval = conversionTrackerService.mutate( + new ConversionTrackerOperation[] {operation}); + + // Display the results. + if (retval != null && retval.value != null && retval.value.Length > 0) { + ConversionTracker newConversionTracker = retval.value[0]; + Console.WriteLine("Conversion tracker with id '{0}', name '{1}', status '{2}', " + + "category '{3}' was added.", newConversionTracker.id, newConversionTracker.name, + newConversionTracker.status, newConversionTracker.category); + } else { + Console.WriteLine("No conversion trackers were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add conversion tracker.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/Reporting/DownloadCriteriaReport.cs b/examples/AdXBuyer/CSharp/v201309/Reporting/DownloadCriteriaReport.cs new file mode 100644 index 00000000000..ab5c7dbe9fa --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/Reporting/DownloadCriteriaReport.cs @@ -0,0 +1,114 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util.Reports; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example gets and downloads a criteria Ad Hoc report from an XML + /// report definition. + /// + public class DownloadCriteriaReport : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DownloadCriteriaReport codeExample = new DownloadCriteriaReport(); + Console.WriteLine(codeExample.Description); + try { + string fileName = "INSERT_FILE_NAME_HERE"; + codeExample.Run(new AdWordsUser(), fileName); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets and downloads a criteria Ad Hoc report from an XML report " + + "definition."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The file to which the report is downloaded. + /// + public void Run(AdWordsUser user, string fileName) { + ReportDefinition definition = new ReportDefinition(); + + definition.reportName = "Last 7 days CRITERIA_PERFORMANCE_REPORT"; + definition.reportType = ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT; + definition.downloadFormat = DownloadFormat.GZIPPED_CSV; + definition.dateRangeType = ReportDefinitionDateRangeType.LAST_7_DAYS; + + // Create selector. + Selector selector = new Selector(); + selector.fields = new string[] {"CampaignId", "AdGroupId", "Id", "CriteriaType", "Criteria", + "CriteriaDestinationUrl", "Clicks", "Impressions", "Cost"}; + + Predicate predicate = new Predicate(); + predicate.field = "Status"; + predicate.@operator = PredicateOperator.IN; + predicate.values = new string[] {"ACTIVE", "PAUSED"}; + selector.predicates = new Predicate[] {predicate}; + + definition.selector = selector; + definition.includeZeroImpressions = true; + + string filePath = ExampleUtilities.GetHomeDir() + Path.DirectorySeparatorChar + fileName; + + try { + // If you know that your report is small enough to fit in memory, then + // you can instead use + // ReportUtilities utilities = new ReportUtilities(user); + // utilities.ReportVersion = "v201309"; + // ClientReport report = utilities.GetClientReport(definition); + // + // // Get the text report directly if you requested a text format + // // (e.g. xml) + // string reportText = report.Text; + // + // // Get the binary report if you requested a binary format + // // (e.g. gzip) + // byte[] reportBytes = report.Contents; + // + // // Deflate a zipped binary report for further processing. + // string deflatedReportText = Encoding.UTF8.GetString( + // MediaUtilities.DeflateGZipData(report.Contents)); + ReportUtilities utilities = new ReportUtilities(user); + utilities.ReportVersion = "v201309"; + utilities.DownloadClientReport(definition, filePath); + Console.WriteLine("Report was downloaded to '{0}'.", filePath); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to download report.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/Reporting/DownloadCriteriaReportWithAwql.cs b/examples/AdXBuyer/CSharp/v201309/Reporting/DownloadCriteriaReportWithAwql.cs new file mode 100644 index 00000000000..1bb76a0ebe0 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/Reporting/DownloadCriteriaReportWithAwql.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util.Reports; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example gets and downloads a criteria Ad Hoc report from an AWQL + /// query. See https://developers.google.com/adwords/api/docs/guides/awql for + /// AWQL documentation. + /// + public class DownloadCriteriaReportWithAwql : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DownloadCriteriaReportWithAwql codeExample = new DownloadCriteriaReportWithAwql(); + Console.WriteLine(codeExample.Description); + try { + string fileName = "INSERT_FILE_NAME_HERE"; + codeExample.Run(new AdWordsUser(), fileName); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets and downloads a criteria Ad Hoc report from an AWQL " + + "query. See https://developers.google.com/adwords/api/docs/guides/awql for AWQL " + + "documentation."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The file to which the report is downloaded. + /// + public void Run(AdWordsUser user, string fileName) { + string query = "SELECT CampaignId, AdGroupId, Id, Criteria, CriteriaType, Impressions, " + + "Clicks, Cost FROM CRITERIA_PERFORMANCE_REPORT WHERE Status IN [ACTIVE, PAUSED] " + + "DURING LAST_7_DAYS"; + + string filePath = ExampleUtilities.GetHomeDir() + Path.DirectorySeparatorChar + fileName; + + try { + // If you know that your report is small enough to fit in memory, then + // you can instead use + // ReportUtilities utilities = new ReportUtilities(user); + // utilities.ReportVersion = "v201309"; + // ClientReport report = utilities.GetClientReport(query, format); + // + // // Get the text report directly if you requested a text format + // // (e.g. xml) + // string reportText = report.Text; + // + // // Get the binary report if you requested a binary format + // // (e.g. gzip) + // byte[] reportBytes = report.Contents; + // + // // Deflate a zipped binary report for further processing. + // string deflatedReportText = Encoding.UTF8.GetString( + // MediaUtilities.DeflateGZipData(report.Contents)); + ReportUtilities utilities = new ReportUtilities(user); + utilities.ReportVersion = "v201309"; + utilities.DownloadClientReport(query, DownloadFormat.GZIPPED_CSV.ToString(), filePath); + Console.WriteLine("Report was downloaded to '{0}'.", filePath); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to download report.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/Reporting/GetReportFields.cs b/examples/AdXBuyer/CSharp/v201309/Reporting/GetReportFields.cs new file mode 100644 index 00000000000..9cb43bdbe4f --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/Reporting/GetReportFields.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example gets report fields. + /// + /// Tags: ReportDefinitionService.getReportFields + /// + public class GetReportFields : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetReportFields codeExample = new GetReportFields(); + Console.WriteLine(codeExample.Description); + try { + ReportDefinitionReportType reportType = (ReportDefinitionReportType) Enum.Parse( + typeof(ReportDefinitionReportType), "INSERT_REPORT_TYPE_HERE"); + codeExample.Run(new AdWordsUser(), reportType); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets report fields."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The report type to be run. + public void Run(AdWordsUser user, ReportDefinitionReportType reportType) { + // Get the ReportDefinitionService. + ReportDefinitionService reportDefinitionService = (ReportDefinitionService) user.GetService( + AdWordsService.v201309.ReportDefinitionService); + + try { + // Get the report fields. + ReportDefinitionField[] reportDefinitionFields = reportDefinitionService.getReportFields( + reportType); + if (reportDefinitionFields != null && reportDefinitionFields.Length > 0) { + // Display report fields. + Console.WriteLine("The report type '{0}' contains the following fields:", reportType); + + foreach (ReportDefinitionField reportDefinitionField in reportDefinitionFields) { + Console.Write("- {0} ({1})", reportDefinitionField.fieldName, + reportDefinitionField.fieldType); + if (reportDefinitionField.enumValues != null) { + Console.Write(" := [{0}]", String.Join(", ", reportDefinitionField.enumValues)); + } + Console.WriteLine(); + } + } else { + Console.WriteLine("This report type has no fields."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve fields for report type.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/Targeting/AddCampaignTargetingCriteria.cs b/examples/AdXBuyer/CSharp/v201309/Targeting/AddCampaignTargetingCriteria.cs new file mode 100644 index 00000000000..1f81056a64e --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/Targeting/AddCampaignTargetingCriteria.cs @@ -0,0 +1,137 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example adds various types of targeting criteria to a campaign. + /// To get a list of campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignCriterionService.mutate + /// + public class AddCampaignTargetingCriteria : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddCampaignTargetingCriteria codeExample = new AddCampaignTargetingCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds various types of targeting criteria to a campaign. To " + + "get a list of campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to which targeting criteria + /// are added. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201309.CampaignCriterionService); + + // Create language criteria. + // See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + // for a detailed list of language codes. + Language language1 = new Language(); + language1.id = 1002; // French + CampaignCriterion languageCriterion1 = new CampaignCriterion(); + languageCriterion1.campaignId = campaignId; + languageCriterion1.criterion = language1; + + Language language2 = new Language(); + language2.id = 1005; // Japanese + CampaignCriterion languageCriterion2 = new CampaignCriterion(); + languageCriterion2.campaignId = campaignId; + languageCriterion2.criterion = language2; + + // Create location criteria. + // See http://code.google.com/apis/adwords/docs/appendix/countrycodes.html + // for a detailed list of country codes. + Location location1 = new Location(); + location1.id = 2840; // USA + CampaignCriterion locationCriterion1 = new CampaignCriterion(); + locationCriterion1.campaignId = campaignId; + locationCriterion1.criterion = location1; + + Location location2 = new Location(); + location2.id = 2392; // Japan + CampaignCriterion locationCriterion2 = new CampaignCriterion(); + locationCriterion2.campaignId = campaignId; + locationCriterion2.criterion = location2; + + // Add a negative campaign placement. + NegativeCampaignCriterion negativeCriterion = new NegativeCampaignCriterion(); + negativeCriterion.campaignId = campaignId; + + Placement placement = new Placement(); + placement.url = "http://mars.google.com"; + + negativeCriterion.criterion = placement; + + CampaignCriterion[] criteria = new CampaignCriterion[] {languageCriterion1, + languageCriterion2, locationCriterion1, locationCriterion2, negativeCriterion}; + + List operations = new List(); + + foreach (CampaignCriterion criterion in criteria) { + CampaignCriterionOperation operation = new CampaignCriterionOperation(); + operation.@operator = Operator.ADD; + operation.operand = criterion; + operations.Add(operation); + } + + try { + // Set the campaign targets. + CampaignCriterionReturnValue retVal = campaignCriterionService.mutate(operations.ToArray()); + + if (retVal != null && retVal.value != null) { + // Display campaign targets. + foreach (CampaignCriterion criterion in retVal.value) { + Console.WriteLine("Campaign criteria of type '{0}' was set to campaign with" + + " id = '{1}'.", criterion.criterion.CriterionType, criterion.campaignId); + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to set Campaign criteria.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/Targeting/GetCampaignTargetingCriteria.cs b/examples/AdXBuyer/CSharp/v201309/Targeting/GetCampaignTargetingCriteria.cs new file mode 100644 index 00000000000..94cdde18240 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/Targeting/GetCampaignTargetingCriteria.cs @@ -0,0 +1,124 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example gets all targeting criteria for a campaign. To set + /// campaign targeting criteria, run AddCampaignTargetingCriteria.cs. To get + /// campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignCriterionService.get + /// + public class GetCampaignTargetingCriteria : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetCampaignTargetingCriteria codeExample = new GetCampaignTargetingCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all targeting criteria for a campaign. To set campaign " + + "targeting criteria, run AddCampaignTargetingCriteria.cs. To get campaigns, run " + + "GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign from which targeting + /// criteria are retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201309.CampaignCriterionService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "CriteriaType", "PlacementUrl"}; + + // Set the filters. + Predicate campaignPredicate = new Predicate(); + campaignPredicate.field = "CampaignId"; + campaignPredicate.@operator = PredicateOperator.EQUALS; + campaignPredicate.values = new string[] {campaignId.ToString()}; + + Predicate placementPredicate = new Predicate(); + placementPredicate.field = "CriteriaType"; + placementPredicate.@operator = PredicateOperator.EQUALS; + placementPredicate.values = new string[] {"PLACEMENT"}; + + selector.predicates = new Predicate[] {campaignPredicate, placementPredicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + CampaignCriterionPage page = new CampaignCriterionPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get all campaign targets. + page = campaignCriterionService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (CampaignCriterion campaignCriterion in page.entries) { + Placement placement = campaignCriterion.criterion as Placement; + + Console.WriteLine("{0}) Placement with ID {1} and url {2} was found.", i, + placement.id, placement.url); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of placements found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get campaign targeting criteria.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/Targeting/GetTargetableLanguagesAndCarriers.cs b/examples/AdXBuyer/CSharp/v201309/Targeting/GetTargetableLanguagesAndCarriers.cs new file mode 100644 index 00000000000..f384f9bc0ac --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/Targeting/GetTargetableLanguagesAndCarriers.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example illustrates how to retrieve all carriers and languages + /// available for targeting. + /// + /// Tags: ConstantDataService.getCarrierCriterion + /// Tags: ConstantDataService.getLanguageCriterion + /// + public class GetTargetableLanguagesAndCarriers : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetTargetableLanguagesAndCarriers codeExample = new GetTargetableLanguagesAndCarriers(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve all carriers and languages " + + "available for targeting."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ConstantDataService. + ConstantDataService constantDataService = (ConstantDataService) user.GetService( + AdWordsService.v201309.ConstantDataService); + + try { + // Get all carriers. + Carrier[] carriers = constantDataService.getCarrierCriterion(); + + // Display the results. + if (carriers != null) { + foreach (Carrier carrier in carriers) { + Console.WriteLine("Carrier name is '{0}', ID is {1} and country code is '{2}'.", + carrier.name, carrier.id, carrier.countryCode); + } + } else { + Console.WriteLine("No carriers were retrieved."); + } + + // Get all languages. + Language[] languages = constantDataService.getLanguageCriterion(); + + // Display the results. + if (languages != null) { + foreach (Language language in languages) { + Console.WriteLine("Language name is '{0}', ID is {1} and code is '{2}'.", + language.name, language.id, language.code); + } + } else { + Console.WriteLine("No languages were found."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get targetable carriers and languages.", + ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201309/Targeting/LookupLocation.cs b/examples/AdXBuyer/CSharp/v201309/Targeting/LookupLocation.cs new file mode 100644 index 00000000000..a3c320738a4 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201309/Targeting/LookupLocation.cs @@ -0,0 +1,121 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201309 { + /// + /// This code example gets location criteria by name. + /// + /// Tags: LocationCriterionService.get + /// + public class LookupLocation : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + LookupLocation codeExample = new LookupLocation(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets location criteria by name."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the LocationCriterionService. + LocationCriterionService locationCriterionService = + (LocationCriterionService) user.GetService(AdWordsService.v201309. + LocationCriterionService); + + string[] locationNames = new string[] {"Paris", "Quebec", "Spain", "Deutschland"}; + + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "LocationName", "CanonicalName", "DisplayType", + "ParentLocations", "Reach", "TargetingStatus"}; + + // Location names must match exactly, only EQUALS and IN are supported. + Predicate predicate1 = new Predicate(); + predicate1.field = "LocationName"; + predicate1.@operator = PredicateOperator.IN; + predicate1.values = locationNames; + + // Set the locale of the returned location names. + Predicate predicate2 = new Predicate(); + predicate2.field = "Locale"; + predicate2.@operator = PredicateOperator.EQUALS; + predicate2.values = new string[] {"en"}; + + selector.predicates = new Predicate[] {predicate1, predicate2}; + + try { + // Make the get request. + LocationCriterion[] locationCriteria = locationCriterionService.get(selector); + + // Display the resulting location criteria. + foreach (LocationCriterion locationCriterion in locationCriteria) { + string parentLocations = ""; + if (locationCriterion.location != null && + locationCriterion.location.parentLocations != null) { + foreach (Location location in locationCriterion.location.parentLocations) { + parentLocations += GetLocationString(location) + ", "; + } + parentLocations.TrimEnd(',', ' '); + } else { + parentLocations = "N/A"; + } + Console.WriteLine("The search term '{0}' returned the location '{1}' of type '{2}' " + + "with parent locations '{3}', reach '{4}' and targeting status '{5}.", + locationCriterion.searchTerm, locationCriterion.location.locationName, + locationCriterion.location.displayType, parentLocations, locationCriterion.reach, + locationCriterion.location.targetingStatus); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get location criteria.", ex); + } + } + + /// + /// Gets a string representation for a location. + /// + /// The location + /// The string representation + public string GetLocationString(Location location) { + return string.Format("{0} ({1})", location.locationName, location.displayType); + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/AccountManagement/GetAccountChanges.cs b/examples/AdXBuyer/CSharp/v201402/AccountManagement/GetAccountChanges.cs new file mode 100644 index 00000000000..52051b76f7f --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/AccountManagement/GetAccountChanges.cs @@ -0,0 +1,176 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example gets the changes in the account during the last 24 + /// hours. + /// + /// Tags: CustomerSyncService.get + /// + public class GetAccountChanges : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAccountChanges codeExample = new GetAccountChanges(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the changes in the account during the last 24 hours."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the CustomerSyncService. + CustomerSyncService customerSyncService = + (CustomerSyncService) user.GetService(AdWordsService.v201402. + CustomerSyncService); + + // The date time string should be of the form yyyyMMdd HHmmss zzz + string minDateTime = DateTime.Now.AddDays(-1).ToUniversalTime().ToString("yyyyMMdd HHmmss") + + " UTC"; + string maxDateTime = DateTime.Now.ToUniversalTime().ToString("yyyyMMdd HHmmss") + " UTC"; + + // Create date time range. + DateTimeRange dateTimeRange = new DateTimeRange(); + dateTimeRange.min = minDateTime; + dateTimeRange.max = maxDateTime; + + try { + // Create the selector. + CustomerSyncSelector selector = new CustomerSyncSelector(); + selector.dateTimeRange = dateTimeRange; + selector.campaignIds = GetAllCampaignIds(user); + + // Get all account changes for campaign. + CustomerChangeData accountChanges = customerSyncService.get(selector); + + // Display the changes. + if (accountChanges != null && accountChanges.changedCampaigns != null) { + Console.WriteLine("Displaying changes up to: {0}", accountChanges.lastChangeTimestamp); + foreach (CampaignChangeData campaignChanges in accountChanges.changedCampaigns) { + Console.WriteLine("Campaign with id \"{0}\" was changed:", campaignChanges.campaignId); + Console.WriteLine(" Campaign changed status: {0}", + campaignChanges.campaignChangeStatus); + if (campaignChanges.campaignChangeStatus != ChangeStatus.NEW) { + Console.WriteLine(" Added ad extensions: {0}", GetFormattedList( + campaignChanges.addedAdExtensions)); + Console.WriteLine(" Added campaign criteria: {0}", + GetFormattedList(campaignChanges.addedCampaignCriteria)); + Console.WriteLine(" Added campaign targeting: {0}", + campaignChanges.campaignTargetingChanged? "yes" : "no"); + Console.WriteLine(" Deleted ad extensions: {0}", + GetFormattedList(campaignChanges.deletedAdExtensions)); + Console.WriteLine(" Deleted campaign criteria: {0}", + GetFormattedList(campaignChanges.deletedCampaignCriteria)); + + if (campaignChanges.changedAdGroups != null) { + foreach (AdGroupChangeData adGroupChanges in campaignChanges.changedAdGroups) { + Console.WriteLine(" Ad group with id \"{0}\" was changed:", + adGroupChanges.adGroupId); + Console.WriteLine(" Ad group changed status: {0}", + adGroupChanges.adGroupChangeStatus); + if (adGroupChanges.adGroupChangeStatus != ChangeStatus.NEW) { + Console.WriteLine(" Ads changed: {0}", + GetFormattedList(adGroupChanges.changedAds)); + Console.WriteLine(" Criteria changed: {0}", + GetFormattedList(adGroupChanges.changedCriteria)); + Console.WriteLine(" Criteria deleted: {0}", + GetFormattedList(adGroupChanges.deletedCriteria)); + } + } + } + } + Console.WriteLine(); + } + } else { + Console.WriteLine("No account changes were found.");; + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get account changes.", ex); + } + } + + /// + /// Formats a list of ids as a comma separated string. + /// + /// The list of ids. + /// The comma separed formatted string, enclosed in square braces. + /// + private string GetFormattedList(long[] ids) { + StringBuilder builder = new StringBuilder(); + if (ids != null) { + foreach (long id in ids) { + builder.AppendFormat("{0}, ", id); + } + } + return "[" + builder.ToString().TrimEnd(',', ' ') + "]"; + } + + /// + /// Gets all campaign ids in the account. + /// + /// The user for which campaigns are retrieved. + /// The list of campaign ids. + private long[] GetAllCampaignIds(AdWordsUser user) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201402.CampaignService); + + List allCampaigns = new List(); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id"}; + + // Get all campaigns. + CampaignPage page = campaignService.get(selector); + + // Return the results. + if (page != null && page.entries != null) { + foreach (Campaign campaign in page.entries) { + allCampaigns.Add(campaign.id); + } + } + return allCampaigns.ToArray(); + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/AdvancedOperations/AddAdGroupBidModifier.cs b/examples/AdXBuyer/CSharp/v201402/AdvancedOperations/AddAdGroupBidModifier.cs new file mode 100644 index 00000000000..c5acbbeeaab --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/AdvancedOperations/AddAdGroupBidModifier.cs @@ -0,0 +1,111 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example illustrates how to add ad group level mobile bid + /// modifier override. + /// + /// Tags: AdGroupBidModifierService.mutate + /// + public class AddAdGroupBidModifier : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAdGroupBidModifier codeExample = new AddAdGroupBidModifier(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + double bidModifier = double.Parse("INSERT_ADGROUP_BID_MODIFIER_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, bidModifier); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to add ad group level mobile bid modifier " + + "override."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the adgroup for which bid modifier is + /// set. + /// The mobile bid modifier for adgroup + public void Run(AdWordsUser user, long adGroupId, double bidModifier) { + // Get the AdGroupAdService. + AdGroupBidModifierService adGroupBidModifierService = + (AdGroupBidModifierService) user.GetService( + AdWordsService.v201402.AdGroupBidModifierService); + + // Mobile criterion ID. + long criterionId = 30001; + + + // Create the adgroup bid modifier. + AdGroupBidModifier adGroupBidModifier = new AdGroupBidModifier(); + adGroupBidModifier.bidModifier = bidModifier; + adGroupBidModifier.adGroupId = adGroupId; + + Platform platform = new Platform(); + platform.id = criterionId; + + adGroupBidModifier.criterion = platform; + + AdGroupBidModifierOperation operation = new AdGroupBidModifierOperation(); + operation.@operator = Operator.ADD; + operation.operand = adGroupBidModifier; + + + try { + // Add ad group level mobile bid modifier. + AdGroupBidModifierReturnValue retval = adGroupBidModifierService.mutate( + new AdGroupBidModifierOperation[] {operation}); + + // Display the results. + if (retval != null && retval.value != null && retval.value.Length > 0) { + AdGroupBidModifier newBidModifier = retval.value[0]; + Console.WriteLine("AdGroup ID {0}, Criterion ID {1} was updated with ad group level " + + "modifier: {2}", newBidModifier.adGroupId, newBidModifier.criterion.id, + newBidModifier.bidModifier); + } else { + Console.WriteLine("No bid modifiers were added to the adgroup."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add bid modifiers to adgroup.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/AdvancedOperations/GetAdGroupBidModifiers.cs b/examples/AdXBuyer/CSharp/v201402/AdvancedOperations/GetAdGroupBidModifiers.cs new file mode 100644 index 00000000000..3fc3a5b8376 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/AdvancedOperations/GetAdGroupBidModifiers.cs @@ -0,0 +1,122 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example illustrates how to retrieve ad group level mobile bid + /// modifiers for a campaign. + /// + /// Tags: AdGroupBidModifierService.get + /// + public class GetAdGroupBidModifiers : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAdGroupBidModifiers codeExample = new GetAdGroupBidModifiers(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve ad group level mobile bid " + + "modifiers for a campaign."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which ads are added. + /// + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupAdService. + AdGroupBidModifierService adGroupBidModifierService = + (AdGroupBidModifierService) user.GetService( + AdWordsService.v201402.AdGroupBidModifierService); + + const int PAGE_SIZE = 500; + + // Get all ad group bid modifiers for the campaign. + Selector selector = new Selector(); + selector.fields = new String[] {"CampaignId", "AdGroupId", "BidModifier", "BidModifierSource", + "CriteriaType", "Id"}; + + Predicate predicate = new Predicate(); + predicate.field = "CampaignId"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] {campaignId.ToString()}; + selector.predicates = new Predicate[] {predicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = PAGE_SIZE; + + AdGroupBidModifierPage page = new AdGroupBidModifierPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the campaigns. + page = adGroupBidModifierService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroupBidModifier adGroupBidModifier in page.entries) { + string bidModifier = (adGroupBidModifier.bidModifierSpecified)? + adGroupBidModifier.bidModifier.ToString() : "UNSET"; + Console.WriteLine("{0}) Campaign ID {1}, AdGroup ID {2}, Criterion ID {3} has " + + "ad group level modifier: {4} and source = {5}.", + i + 1, adGroupBidModifier.campaignId, + adGroupBidModifier.adGroupId, adGroupBidModifier.criterion.id, bidModifier, + adGroupBidModifier.bidModifierSource); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of adgroup bid modifiers found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve adgroup bid modifiers.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/AdvancedOperations/UploadOfflineConversions.cs b/examples/AdXBuyer/CSharp/v201402/AdvancedOperations/UploadOfflineConversions.cs new file mode 100644 index 00000000000..59b44c9beca --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/AdvancedOperations/UploadOfflineConversions.cs @@ -0,0 +1,139 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example imports offline conversion values for specific clicks to + /// your account. To get Google Click ID for a click, run + /// CLICK_PERFORMANCE_REPORT. + /// + /// Tags: ConversionTrackerService.mutate, OfflineConversionFeedService.mutate + /// + public class UploadOfflineConversions : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + string conversionName = "INSERT_CONVERSION_NAME_HERE"; + // GCLID needs to be newer than 30 days. + string gClId = "INSERT_GOOGLE_CLICK_ID_HERE"; + // The conversion time should be higher than the click time. + string conversionTime = "INSERT_CONVERSION_TIME_HERE"; + double conversionValue = double.Parse("INSERT_CONVERSION_VALUE_HERE"); + + UploadOfflineConversions codeExample = new UploadOfflineConversions(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser(), conversionName, gClId, conversionTime, conversionValue); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example imports offline conversion values for specific clicks to " + + "your account. To get Google Click ID for a click, run CLICK_PERFORMANCE_REPORT."; + } + } + + /// + /// Runs the specified user. + /// + /// The user. + /// The name of the upload conversion to be + /// created. + /// The Google Click ID of the click for which offline + /// conversions are uploaded. + /// The conversion value to be uploaded. + /// + /// The conversion time, in yyyymmdd hhmmss + /// format. + public void Run(AdWordsUser user, String conversionName, String gClid, String conversionTime, + double conversionValue) { + // Get the ConversionTrackerService. + ConversionTrackerService conversionTrackerService = + (ConversionTrackerService) user.GetService( + AdWordsService.v201402.ConversionTrackerService); + + // Get the OfflineConversionFeedService. + OfflineConversionFeedService offlineConversionFeedService = + (OfflineConversionFeedService) user.GetService( + AdWordsService.v201402.OfflineConversionFeedService); + + const int VIEWTHROUGH_LOOKBACK_WINDOW = 30; + const int CTC_LOOKBACK_WINDOW = 90; + + try { + // Create an upload conversion. Once created, this entry will be visible + // under Tools and Analysis->Conversion and will have "Source = Import". + UploadConversion uploadConversion = new UploadConversion(); + uploadConversion.category = ConversionTrackerCategory.PAGE_VIEW; + uploadConversion.name = conversionName; + uploadConversion.viewthroughLookbackWindow = VIEWTHROUGH_LOOKBACK_WINDOW; + uploadConversion.ctcLookbackWindow = CTC_LOOKBACK_WINDOW; + + ConversionTrackerOperation uploadConversionOperation = new ConversionTrackerOperation(); + uploadConversionOperation.@operator = Operator.ADD; + uploadConversionOperation.operand = uploadConversion; + + ConversionTrackerReturnValue conversionTrackerRetval = conversionTrackerService.mutate( + new ConversionTrackerOperation[] {uploadConversionOperation}); + + UploadConversion newUploadConversion = (UploadConversion) conversionTrackerRetval.value[0]; + + Console.WriteLine("New upload conversion type with name = '{0}' and id = {1} was created.", + newUploadConversion.name, newUploadConversion.id); + + // Associate offline conversions with the upload conversion we created. + OfflineConversionFeed feed = new OfflineConversionFeed(); + feed.conversionName = conversionName; + feed.conversionTime = conversionTime; + feed.conversionValue = conversionValue; + feed.googleClickId = gClid; + + OfflineConversionFeedOperation offlineConversionOperation = + new OfflineConversionFeedOperation(); + offlineConversionOperation.@operator = Operator.ADD; + offlineConversionOperation.operand = feed; + + OfflineConversionFeedReturnValue offlineConversionRetval = + offlineConversionFeedService.mutate( + new OfflineConversionFeedOperation[] {offlineConversionOperation}); + + OfflineConversionFeed newFeed = offlineConversionRetval.value[0]; + + Console.WriteLine("Uploaded offline conversion value of {0} for Google Click ID = " + + "'{1}' to '{2}'.", newFeed.conversionValue, newFeed.googleClickId, + newFeed.conversionName); + } catch (Exception ex) { + throw new System.ApplicationException("Failed upload offline conversions.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/AdvancedOperations/UseSharedBiddingStrategy.cs b/examples/AdXBuyer/CSharp/v201402/AdvancedOperations/UseSharedBiddingStrategy.cs new file mode 100644 index 00000000000..74ddf2398e8 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/AdvancedOperations/UseSharedBiddingStrategy.cs @@ -0,0 +1,209 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example adds a Shared Bidding Strategy and uses it to construct + /// a campaign. + /// + /// Tags: BiddingStrategyService.mutate + /// Tags: BudgetService.mutate, CampaignService.mutate + /// + public class UseSharedBiddingStrategy : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UseSharedBiddingStrategy codeExample = new UseSharedBiddingStrategy(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a Shared Bidding Strategy and uses it to construct " + + "a campaign."; + } + } + + /// + /// Runs the specified code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the services. + BiddingStrategyService biddingStrategyService = (BiddingStrategyService) user.GetService( + AdWordsService.v201402.BiddingStrategyService); + + BudgetService budgetService = (BudgetService) user.GetService( + AdWordsService.v201402.BudgetService); + + CampaignService campaignService = (CampaignService) user.GetService( + AdWordsService.v201402.CampaignService); + + String BIDDINGSTRATEGY_NAME = "Maximize Clicks " + ExampleUtilities.GetRandomString(); + const long BID_CEILING = 2000000; + const long SPEND_TARGET = 20000000; + + String BUDGET_NAME = "Shared Interplanetary Budget #" + ExampleUtilities.GetRandomString(); + const long BUDGET_AMOUNT = 30000000; + + String CAMPAIGN_NAME = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString(); + + try { + SharedBiddingStrategy sharedBiddingStrategy = CreateBiddingStrategy(biddingStrategyService, + BIDDINGSTRATEGY_NAME, BID_CEILING, SPEND_TARGET); + Console.WriteLine("Shared bidding strategy with name '{0}' and ID {1} of type {2} was " + + "created.", sharedBiddingStrategy.name, sharedBiddingStrategy.id, + sharedBiddingStrategy.biddingScheme.BiddingSchemeType); + + Budget sharedBudget = CreateSharedBudget(budgetService, BUDGET_NAME, BUDGET_AMOUNT); + + Campaign newCampaign = CreateCampaignWithBiddingStrategy(campaignService, CAMPAIGN_NAME, + sharedBiddingStrategy.id, sharedBudget.budgetId); + + Console.WriteLine("Campaign with name '{0}', ID {1} and bidding scheme ID {2} was " + + "created.", newCampaign.name, newCampaign.id, + newCampaign.biddingStrategyConfiguration.biddingStrategyId); + + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create campaign that uses shared " + + "bidding strategy.", ex); + } + } + + /// + /// Creates the shared bidding strategy. + /// + /// The bidding strategy service. + /// The bidding strategy name. + /// The bid ceiling. + /// The spend target. + /// The bidding strategy object. + private SharedBiddingStrategy CreateBiddingStrategy( + BiddingStrategyService biddingStrategyService, String name, long bidCeiling, + long spendTarget) { + // Create a shared bidding strategy. + SharedBiddingStrategy sharedBiddingStrategy = new SharedBiddingStrategy(); + sharedBiddingStrategy.name = name; + + TargetSpendBiddingScheme biddingScheme = new TargetSpendBiddingScheme(); + // Optionally set additional bidding scheme parameters. + biddingScheme.bidCeiling = new Money(); + biddingScheme.bidCeiling.microAmount = bidCeiling; + + biddingScheme.spendTarget = new Money(); + biddingScheme.spendTarget.microAmount = spendTarget; + + sharedBiddingStrategy.biddingScheme = biddingScheme; + + // Create operation. + BiddingStrategyOperation operation = new BiddingStrategyOperation(); + operation.@operator = Operator.ADD; + operation.operand = sharedBiddingStrategy; + + return biddingStrategyService.mutate(new BiddingStrategyOperation[] {operation}).value[0]; + } + + /// + /// Creates an explicit budget to be used only to create the Campaign. + /// + /// The budget service. + /// The budget name. + /// The budget amount. + /// The budget object. + private Budget CreateSharedBudget(BudgetService budgetService, String name, long amount) { + // Create a shared budget + Budget budget = new Budget(); + budget.name = name; + budget.period = BudgetBudgetPeriod.DAILY; + budget.amount = new Money(); + budget.amount.microAmount = amount; + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + budget.isExplicitlyShared = true; + + // Create operation. + BudgetOperation operation = new BudgetOperation(); + operation.operand = budget; + operation.@operator = Operator.ADD; + + // Make the mutate request. + return budgetService.mutate(new BudgetOperation[] {operation}).value[0]; + } + + /// + /// Creates the campaign with a shared bidding strategy. + /// + /// The campaign service. + /// The campaign name. + /// The bidding strategy id. + /// The shared budget id. + /// The campaign object. + private Campaign CreateCampaignWithBiddingStrategy(CampaignService campaignService, string name, + long biddingStrategyId, long sharedBudgetId) { + // Create campaign. + Campaign campaign = new Campaign(); + campaign.name = name; + campaign.advertisingChannelType = AdvertisingChannelType.SEARCH; + + // Set the budget. + campaign.budget = new Budget(); + campaign.budget.budgetId = sharedBudgetId; + + // Set bidding strategy (required). + BiddingStrategyConfiguration biddingStrategyConfiguration = + new BiddingStrategyConfiguration(); + biddingStrategyConfiguration.biddingStrategyId = biddingStrategyId; + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration; + + // Set keyword matching setting (required). + KeywordMatchSetting keywordMatchSetting = new KeywordMatchSetting(); + keywordMatchSetting.optIn = true; + campaign.settings = new Setting[] {keywordMatchSetting}; + + // Set network targeting (recommended). + NetworkSetting networkSetting = new NetworkSetting(); + networkSetting.targetGoogleSearch = true; + networkSetting.targetSearchNetwork = true; + networkSetting.targetContentNetwork = true; + campaign.networkSetting = networkSetting; + + // Create operation. + CampaignOperation operation = new CampaignOperation(); + operation.operand = campaign; + operation.@operator = Operator.ADD; + + return campaignService.mutate(new CampaignOperation[] {operation}).value[0]; + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/BasicOperations/AddAdGroupDemographicCriteria.cs b/examples/AdXBuyer/CSharp/v201402/BasicOperations/AddAdGroupDemographicCriteria.cs new file mode 100644 index 00000000000..9c171b48ba7 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/BasicOperations/AddAdGroupDemographicCriteria.cs @@ -0,0 +1,123 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example adds demographic target criteria to an ad group. To get + /// ad groups, run AddAdGroup.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class AddAdGroupDemographicCriteria : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAdGroupDemographicCriteria codeExample = new AddAdGroupDemographicCriteria(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds demographic target criteria to an ad group. To get ad " + + "groups, run AddAdGroup.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which criteria are + /// added. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201402.AdGroupCriterionService); + + // Create biddable ad group criterion for gender + Gender genderTarget = new Gender(); + // Criterion Id for male. The IDs can be found here + // https://developers.google.com/adwords/api/docs/appendix/genders + genderTarget.id = 10; + + BiddableAdGroupCriterion genderBiddableAdGroupCriterion = new BiddableAdGroupCriterion(); + genderBiddableAdGroupCriterion.adGroupId = adGroupId; + genderBiddableAdGroupCriterion.criterion = genderTarget; + + // Create negative ad group criterion for age range + AgeRange ageRangeNegative = new AgeRange(); + // Criterion Id for age 18 to 24. The IDs can be found here + // https://developers.google.com/adwords/api/docs/appendix/ages + + ageRangeNegative.id = 503001; + NegativeAdGroupCriterion ageRangeNegativeAdGroupCriterion = new NegativeAdGroupCriterion(); + ageRangeNegativeAdGroupCriterion.adGroupId = adGroupId; + ageRangeNegativeAdGroupCriterion.criterion = ageRangeNegative; + + // Create operations. + AdGroupCriterionOperation genderBiddableAdGroupCriterionOperation = + new AdGroupCriterionOperation(); + genderBiddableAdGroupCriterionOperation.operand = genderBiddableAdGroupCriterion; + genderBiddableAdGroupCriterionOperation.@operator = Operator.ADD; + + AdGroupCriterionOperation ageRangeNegativeAdGroupCriterionOperation = + new AdGroupCriterionOperation(); + ageRangeNegativeAdGroupCriterionOperation.operand = ageRangeNegativeAdGroupCriterion; + ageRangeNegativeAdGroupCriterionOperation.@operator = Operator.ADD; + + AdGroupCriterionOperation[] operations = new AdGroupCriterionOperation[] { + genderBiddableAdGroupCriterionOperation, ageRangeNegativeAdGroupCriterionOperation}; + + try { + // Add ad group criteria. + AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations); + + // Display ad group criteria. + if (result != null && result.value != null) { + foreach (AdGroupCriterion adGroupCriterionResult in result.value) { + Console.WriteLine("Ad group criterion with ad group id \"{0}\", criterion id " + + "\"{1}\", and type \"{2}\" was added.", adGroupCriterionResult.adGroupId, + adGroupCriterionResult.criterion.id, + adGroupCriterionResult.criterion.CriterionType); + } + } else { + Console.WriteLine("No ad group criteria were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create ad group criteria.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/BasicOperations/AddAdGroups.cs b/examples/AdXBuyer/CSharp/v201402/BasicOperations/AddAdGroups.cs new file mode 100644 index 00000000000..ffea7df9dfd --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/BasicOperations/AddAdGroups.cs @@ -0,0 +1,137 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example illustrates how to create ad groups. To create + /// campaigns, run AddCampaigns.cs. + /// + /// Tags: AdGroupService.mutate + /// + public class AddAdGroups : ExampleBase { + /// + /// Number of items being added / updated in this code example. + /// + const int NUM_ITEMS = 5; + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAdGroups codeExample = new AddAdGroups(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create ad groups. To create campaigns, " + + "run AddCampaigns.cs"; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to which ad groups are + /// added. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201402.AdGroupService); + + List operations = new List(); + + for (int i = 0; i < NUM_ITEMS; i++) { + // Create the ad group. + AdGroup adGroup = new AdGroup(); + adGroup.name = string.Format("Earth to Mars Cruises #{0}", + ExampleUtilities.GetRandomString()); + adGroup.status = AdGroupStatus.ENABLED; + adGroup.campaignId = campaignId; + + // Set the ad group bids. + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + + CpmBid cpmBid = new CpmBid(); + cpmBid.bid = new Money(); + cpmBid.bid.microAmount = 10000000; + + biddingConfig.bids = new Bids[] {cpmBid}; + + adGroup.biddingStrategyConfiguration = biddingConfig; + + // Optional: Set targeting restrictions. + // These setting only affect serving for the Display Network. + TargetingSetting targetingSetting = new TargetingSetting(); + + TargetingSettingDetail placementDetail = new TargetingSettingDetail(); + placementDetail.criterionTypeGroup = CriterionTypeGroup.PLACEMENT; + placementDetail.targetAll = true; + + TargetingSettingDetail verticalDetail = new TargetingSettingDetail(); + verticalDetail.criterionTypeGroup = CriterionTypeGroup.VERTICAL; + verticalDetail.targetAll = false; + + targetingSetting.details = new TargetingSettingDetail[] {placementDetail, verticalDetail}; + + adGroup.settings = new Setting[] {targetingSetting}; + + // Create the operation. + AdGroupOperation operation = new AdGroupOperation(); + operation.@operator = Operator.ADD; + operation.operand = adGroup; + + operations.Add(operation); + } + + try { + // Create the ad group. + AdGroupReturnValue retVal = adGroupService.mutate(operations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + foreach (AdGroup newAdGroup in retVal.value) { + Console.WriteLine("Ad group with id = '{0}' and name = '{1}' was created.", + newAdGroup.id, newAdGroup.name); + } + } else { + Console.WriteLine("No ad groups were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create ad groups.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/BasicOperations/AddCampaigns.cs b/examples/AdXBuyer/CSharp/v201402/BasicOperations/AddCampaigns.cs new file mode 100644 index 00000000000..801b6275e6b --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/BasicOperations/AddCampaigns.cs @@ -0,0 +1,173 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example adds campaigns. To get campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignService.mutate + /// + public class AddCampaigns : ExampleBase { + /// + /// Number of items being added / updated in this code example. + /// + const int NUM_ITEMS = 5; + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddCampaigns codeExample = new AddCampaigns(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds campaigns. To get campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the CampaignService. + BudgetService budgetService = + (BudgetService) user.GetService(AdWordsService.v201402.BudgetService); + + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201402.CampaignService); + + // Create the campaign budget. + Budget budget = new Budget(); + budget.name = "Interplanetary Cruise Budget #" + ExampleUtilities.GetRandomString(); + budget.period = BudgetBudgetPeriod.DAILY; + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + budget.amount = new Money(); + budget.amount.microAmount = 500000; + + BudgetOperation budgetOperation = new BudgetOperation(); + budgetOperation.@operator = Operator.ADD; + budgetOperation.operand = budget; + + try { + BudgetReturnValue budgetRetval = budgetService.mutate(new BudgetOperation[] {budgetOperation}); + budget = budgetRetval.value[0]; + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add shared budget.", ex); + } + + List operations = new List(); + + for (int i = 0; i < NUM_ITEMS; i++) { + // Create the campaign. + Campaign campaign = new Campaign(); + campaign.name = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString(); + campaign.status = CampaignStatus.PAUSED; + campaign.advertisingChannelType = AdvertisingChannelType.SEARCH; + + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + biddingConfig.biddingStrategyType = BiddingStrategyType.MANUAL_CPM; + + // Optional: also provide matching bidding scheme. + biddingConfig.biddingScheme = new ManualCpmBiddingScheme(); + + campaign.biddingStrategyConfiguration = biddingConfig; + + // Set the campaign budget. + campaign.budget = new Budget(); + campaign.budget.budgetId = budget.budgetId; + + // Set targetContentNetwork true. Other network targeting is not available + // for Ad Exchange Buyers. + campaign.networkSetting = new NetworkSetting(); + campaign.networkSetting.targetGoogleSearch = false; + campaign.networkSetting.targetSearchNetwork = false; + campaign.networkSetting.targetContentNetwork = true; + campaign.networkSetting.targetPartnerSearchNetwork = false; + + // Enable campaign for Real-time bidding. + RealTimeBiddingSetting rtbSetting = new RealTimeBiddingSetting(); + rtbSetting.optIn = true; + + // Set the campaign settings for near-exact and near-phrase matches. + KeywordMatchSetting keywordSetting = new KeywordMatchSetting(); + keywordSetting.optIn = false; + + campaign.settings = new Setting[] {rtbSetting, keywordSetting}; + + // Optional: Set the start date. + campaign.startDate = DateTime.Now.AddDays(1).ToString("yyyyMMdd"); + + // Optional: Set the end date. + campaign.endDate = DateTime.Now.AddYears(1).ToString("yyyyMMdd"); + + // Optional: Set the campaign ad serving optimization status. + campaign.adServingOptimizationStatus = AdServingOptimizationStatus.ROTATE; + + // Optional: Set the frequency cap. + FrequencyCap frequencyCap = new FrequencyCap(); + frequencyCap.impressions = 5; + frequencyCap.level = Level.ADGROUP; + frequencyCap.timeUnit = TimeUnit.DAY; + campaign.frequencyCap = frequencyCap; + + // Create the operation. + CampaignOperation operation = new CampaignOperation(); + operation.@operator = Operator.ADD; + operation.operand = campaign; + + operations.Add(operation); + } + + try { + // Add the campaign. + CampaignReturnValue retVal = campaignService.mutate(operations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + foreach (Campaign newCampaign in retVal.value) { + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was added.", + newCampaign.name, newCampaign.id); + } + } else { + Console.WriteLine("No campaigns were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add campaigns.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/BasicOperations/AddPlacements.cs b/examples/AdXBuyer/CSharp/v201402/BasicOperations/AddPlacements.cs new file mode 100644 index 00000000000..de59e62e6ff --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/BasicOperations/AddPlacements.cs @@ -0,0 +1,122 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example adds placements to an ad group. To get ad groups, run + /// GetAdGroups.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class AddPlacements : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddPlacements codeExample = new AddPlacements(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds placements to an ad group. To get ad groups, run " + + "GetAdGroups.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which placements are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201402.AdGroupCriterionService); + + // Create the placement. + Placement placement1 = new Placement(); + placement1.url = "http://mars.google.com"; + + // Create biddable ad group criterion. + AdGroupCriterion placementCriterion1 = new BiddableAdGroupCriterion(); + placementCriterion1.adGroupId = adGroupId; + placementCriterion1.criterion = placement1; + + // Create the placement. + Placement placement2 = new Placement(); + placement2.url = "http://venus.google.com"; + + // Create biddable ad group criterion. + AdGroupCriterion placementCriterion2 = new BiddableAdGroupCriterion(); + placementCriterion2.adGroupId = adGroupId; + placementCriterion2.criterion = placement2; + + // Create the operations. + AdGroupCriterionOperation placementOperation1 = new AdGroupCriterionOperation(); + placementOperation1.@operator = Operator.ADD; + placementOperation1.operand = placementCriterion1; + + AdGroupCriterionOperation placementOperation2 = new AdGroupCriterionOperation(); + placementOperation2.@operator = Operator.ADD; + placementOperation2.operand = placementCriterion2; + + try { + // Create the placements. + AdGroupCriterionReturnValue retVal = adGroupCriterionService.mutate( + new AdGroupCriterionOperation[] {placementOperation1, placementOperation2}); + + // Display the results. + if (retVal != null && retVal.value != null) { + foreach (AdGroupCriterion adGroupCriterion in retVal.value) { + // If you are adding multiple type of criteria, then you may need to + // check for + // + // if (adGroupCriterion is Placement) { ... } + // + // to identify the criterion type. + Console.WriteLine("Placement with ad group id = '{0}, placement id = '{1}, url = " + + "'{2}' was created.", adGroupCriterion.adGroupId, + adGroupCriterion.criterion.id, (adGroupCriterion.criterion as Placement).url); + } + } else { + Console.WriteLine("No placements were added."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create placements.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/BasicOperations/AddThirdPartyRedirectAds.cs b/examples/AdXBuyer/CSharp/v201402/BasicOperations/AddThirdPartyRedirectAds.cs new file mode 100644 index 00000000000..79397fb2556 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/BasicOperations/AddThirdPartyRedirectAds.cs @@ -0,0 +1,155 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example adds third party redirect ads to an ad group. To get + /// ad groups, run GetAdGroups.cs. + /// + /// Tags: AdGroupAdService.mutate + /// + public class AddThirdPartyRedirectAds : ExampleBase { + /// + /// Number of items being added / updated in this code example. + /// + const int NUM_ITEMS = 5; + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddThirdPartyRedirectAds codeExample = new AddThirdPartyRedirectAds(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds third party redirect ads to an ad group. To get ad " + + "groups, run GetAdGroups.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which ads are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201402.AdGroupAdService); + + // Create standard third party redirect ad. + ThirdPartyRedirectAd standardAd = new ThirdPartyRedirectAd(); + standardAd.name = String.Format("Example third party ad #{0}", + ExampleUtilities.GetRandomString()); + standardAd.url = "http://www.example.com"; + + standardAd.dimensions = new Dimensions(); + standardAd.dimensions.height = 250; + standardAd.dimensions.width = 300; + + standardAd.snippet = ""; + + // DoubleClick Rich Media Expandable format ID. + standardAd.certifiedVendorFormatId = 232; + standardAd.isCookieTargeted = false; + standardAd.isUserInterestTargeted = false; + standardAd.isTagged = false; + standardAd.richMediaAdType = RichMediaAdRichMediaAdType.STANDARD; + + // Expandable Ad properties. + standardAd.expandingDirections = new ThirdPartyRedirectAdExpandingDirection[] { + ThirdPartyRedirectAdExpandingDirection.EXPANDING_UP, + ThirdPartyRedirectAdExpandingDirection.EXPANDING_DOWN + }; + + standardAd.adAttributes = new RichMediaAdAdAttribute[] { + RichMediaAdAdAttribute.ROLL_OVER_TO_EXPAND}; + + // Create in-stream third party redirect ad. + ThirdPartyRedirectAd inStreamAd = new ThirdPartyRedirectAd(); + inStreamAd.name = String.Format("Example third party ad #{0}", + ExampleUtilities.GetRandomString()); + inStreamAd.url = "http://www.example.com"; + // Set the duration to 15 secs. + inStreamAd.adDuration = 15000; + inStreamAd.sourceUrl = "http://ad.doubleclick.net/pfadx/N270.126913.6102203221521/B3876671.21;dcadv=2215309;sz=0x0;ord=%5btimestamp%5d;dcmt=text/xml"; + inStreamAd.certifiedVendorFormatId = 303; + inStreamAd.richMediaAdType = RichMediaAdRichMediaAdType.IN_STREAM_VIDEO; + + List operations = new List(); + + foreach (ThirdPartyRedirectAd redirectAd in new + ThirdPartyRedirectAd[] {standardAd, inStreamAd}) { + // Set the ad group id. + AdGroupAd adGroupAd = new AdGroupAd(); + adGroupAd.adGroupId = adGroupId; + adGroupAd.ad = redirectAd; + + // Create the operation. + AdGroupAdOperation operation = new AdGroupAdOperation(); + operation.@operator = Operator.ADD; + operation.operand = adGroupAd; + + operations.Add(operation); + } + + AdGroupAdReturnValue retVal = null; + + try { + // Create the ads + retVal = service.mutate(operations.ToArray()); + if (retVal != null && retVal.value != null) { + // If you are adding multiple type of Ads, then you may need to check + // for + // + // if (adGroupAd.ad is ThirdPartyRedirectAd) { ... } + // + // to identify the ad type. + foreach (AdGroupAd newAdGroupAd in retVal.value) { + Console.WriteLine("New third party redirect ad with url = \"{0}\" and id = {1}" + + " was created.", ((ThirdPartyRedirectAd) newAdGroupAd.ad).url, + newAdGroupAd.ad.id); + } + } else { + Console.WriteLine("No third party redirect ads were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create third party redirect ads.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/BasicOperations/DeleteAd.cs b/examples/AdXBuyer/CSharp/v201402/BasicOperations/DeleteAd.cs new file mode 100644 index 00000000000..c25e208901e --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/BasicOperations/DeleteAd.cs @@ -0,0 +1,103 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example deletes an ad using the 'REMOVE' operator. To list ads, + /// run GetTextAds.cs. + /// + /// Tags: AdGroupAdService.mutate + /// + public class DeleteAd : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DeleteAd codeExample = new DeleteAd(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long adId = long.Parse("INSERT_AD_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, adId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deletes an ad using the 'REMOVE' operator. To list ads, " + + "run GetTextAds.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the ad. + /// Id of the ad being deleted. + public void Run(AdWordsUser user, long adGroupId, long adId) { + // Get the AdGroupAdService. + AdGroupAdService adGroupAdService = (AdGroupAdService) user.GetService( + AdWordsService.v201402.AdGroupAdService); + + // Since we do not need to update any ad-specific fields, it is enough to + // create the base type. + Ad ad = new Ad(); + ad.id = adId; + + // Create the ad group ad. + AdGroupAd adGroupAd = new AdGroupAd(); + adGroupAd.adGroupId = adGroupId; + + adGroupAd.ad = ad; + + // Create the operation. + AdGroupAdOperation operation = new AdGroupAdOperation(); + operation.operand = adGroupAd; + operation.@operator = Operator.REMOVE; + + try { + // Delete the ad. + AdGroupAdReturnValue retVal = adGroupAdService.mutate( + new AdGroupAdOperation[] {operation}); + + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupAd deletedAdGroupAd = retVal.value[0]; + Console.WriteLine("Ad with id = \"{0}\" and type = \"{1}\" was deleted.", + deletedAdGroupAd.ad.id, deletedAdGroupAd.ad.AdType); + } else { + Console.WriteLine("No ads were deleted."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to delete ad.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/BasicOperations/DeleteAdGroup.cs b/examples/AdXBuyer/CSharp/v201402/BasicOperations/DeleteAdGroup.cs new file mode 100644 index 00000000000..ecdec8a25db --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/BasicOperations/DeleteAdGroup.cs @@ -0,0 +1,99 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example deletes an ad group by setting the status to 'DELETED'. + /// To get ad groups, run GetAdGroups.cs. + /// + /// Tags: AdGroupService.mutate + /// + public class DeleteAdGroup : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DeleteAdGroup codeExample = new DeleteAdGroup(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deletes an ad group by setting the status to 'DELETED'. " + + "To get ad groups, run GetAdGroups.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to be deleted. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupService. + AdGroupService adGroupService = (AdGroupService) user.GetService( + AdWordsService.v201402.AdGroupService); + + // Create ad group with DELETED status. + AdGroup adGroup = new AdGroup(); + adGroup.id = adGroupId; + + // When deleting an ad group, rename it to avoid name collisions with new + // adgroups. + adGroup.name = "Deleted AdGroup - " + ExampleUtilities.GetRandomString(); + adGroup.status = AdGroupStatus.DELETED; + + // Create the operation. + AdGroupOperation operation = new AdGroupOperation(); + operation.operand = adGroup; + operation.@operator = Operator.SET; + + try { + // Delete the ad group. + AdGroupReturnValue retVal = adGroupService.mutate(new AdGroupOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroup deletedAdGroup = retVal.value[0]; + Console.WriteLine("Ad group with id = \"{0}\" was renamed to \"{1}\" and deleted.", + deletedAdGroup.id, deletedAdGroup.name); + } else { + Console.WriteLine("No ad groups were deleted."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to delete ad group.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/BasicOperations/DeleteCampaign.cs b/examples/AdXBuyer/CSharp/v201402/BasicOperations/DeleteCampaign.cs new file mode 100644 index 00000000000..05f1b58c6f0 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/BasicOperations/DeleteCampaign.cs @@ -0,0 +1,99 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example deletes a campaign by setting the status to 'DELETED'. + /// To get campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignService.mutate + /// + public class DeleteCampaign : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DeleteCampaign codeExample = new DeleteCampaign(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deletes a campaign by setting the status to 'DELETED'. " + + "To get campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to be deleted. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignService. + CampaignService campaignService = (CampaignService) user.GetService( + AdWordsService.v201402.CampaignService); + + // Create campaign with DELETED status. + Campaign campaign = new Campaign(); + campaign.id = campaignId; + + // When deleting a campaign, rename it to avoid name collisions with new + // campaigns. + campaign.name = "Deleted Campaign - " + ExampleUtilities.GetRandomString(); + campaign.status = CampaignStatus.DELETED; + + // Create the operation. + CampaignOperation operation = new CampaignOperation(); + operation.operand = campaign; + operation.@operator = Operator.SET; + + try { + // Delete the campaign. + CampaignReturnValue retVal = campaignService.mutate(new CampaignOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + Campaign deletedCampaign = retVal.value[0]; + Console.WriteLine("Campaign with id = \"{0}\" was renamed to \"{1}\" and deleted.", + deletedCampaign.id, deletedCampaign.name); + } else { + Console.WriteLine("No campaigns were deleted."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to delete campaign.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/BasicOperations/DeletePlacement.cs b/examples/AdXBuyer/CSharp/v201402/BasicOperations/DeletePlacement.cs new file mode 100644 index 00000000000..812f7472216 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/BasicOperations/DeletePlacement.cs @@ -0,0 +1,103 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example deletes a placement using the 'REMOVE' operator. To get + /// placements, run GetPlacements.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class DeletePlacement : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DeletePlacement codeExample = new DeletePlacement(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long placementId = long.Parse("INSERT_PLACEMENT_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, placementId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deletes a placement using the 'REMOVE' operator. To get " + + "placements, run GetPlacements.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the placement. + /// + /// Id of the placement to be deleted. + public void Run(AdWordsUser user, long adGroupId, long placementId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = (AdGroupCriterionService)user.GetService( + AdWordsService.v201402.AdGroupCriterionService); + + // Create base class criterion to avoid setting placement-specific fields. + Criterion criterion = new Criterion(); + criterion.id = placementId; + + // Create the ad group criterion. + BiddableAdGroupCriterion adGroupCriterion = new BiddableAdGroupCriterion(); + adGroupCriterion.adGroupId = adGroupId; + adGroupCriterion.criterion = criterion; + + // Create the operation. + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.operand = adGroupCriterion; + operation.@operator = Operator.REMOVE; + + try { + // Delete the placement. + AdGroupCriterionReturnValue retVal = adGroupCriterionService.mutate( + new AdGroupCriterionOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupCriterion deletedPlacement = retVal.value[0]; + Console.WriteLine("Placement with ad group id = \"{0}\" and id = \"{1}\" was deleted.", + deletedPlacement.adGroupId, deletedPlacement.criterion.id); + } else { + Console.WriteLine("No placement was deleted."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to delete placement.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/BasicOperations/GetAdGroups.cs b/examples/AdXBuyer/CSharp/v201402/BasicOperations/GetAdGroups.cs new file mode 100644 index 00000000000..951e5cfd23c --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/BasicOperations/GetAdGroups.cs @@ -0,0 +1,113 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example illustrates how to retrieve all the ad groups for a + /// campaign. To create an ad group, run AddAdGroup.cs. + /// + /// Tags: AdGroupService.get + /// + public class GetAdGroups : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAdGroups codeExample = new GetAdGroups(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve all the ad groups for a " + + "campaign. To create an ad group, run AddAdGroup.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign for which ad groups are + /// retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201402.AdGroupService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Name"}; + + // Create the filters. + Predicate predicate = new Predicate(); + predicate.field = "CampaignId"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] {campaignId.ToString()}; + selector.predicates = new Predicate[] {predicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupPage page = new AdGroupPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the ad groups. + page = adGroupService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroup adGroup in page.entries) { + Console.WriteLine("{0}) Ad group name is '{1}' and id is {2}.", i + 1, adGroup.name, + adGroup.id); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of ad groups found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve ad groups.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/BasicOperations/GetCampaigns.cs b/examples/AdXBuyer/CSharp/v201402/BasicOperations/GetCampaigns.cs new file mode 100644 index 00000000000..3a484455ce0 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/BasicOperations/GetCampaigns.cs @@ -0,0 +1,102 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example lists all campaigns. To add a campaign, run + /// AddCampaign.cs. + /// + /// Tags: CampaignService.get + /// + public class GetCampaigns : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetCampaigns codeExample = new GetCampaigns(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example lists all campaigns. To add a campaign, run AddCampaign.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201402.CampaignService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Name", "Status"}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + CampaignPage page = new CampaignPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the campaigns. + page = campaignService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (Campaign campaign in page.entries) { + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = '{3}'" + + " was found.", i + 1, campaign.id, campaign.name, campaign.status); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve campaigns", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/BasicOperations/GetCampaignsWithAwql.cs b/examples/AdXBuyer/CSharp/v201402/BasicOperations/GetCampaignsWithAwql.cs new file mode 100644 index 00000000000..78e8b058b28 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/BasicOperations/GetCampaignsWithAwql.cs @@ -0,0 +1,100 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example lists all campaigns using an AWQL query. See + /// https://developers.google.com/adwords/api/docs/guides/awql for AWQL + /// documentation. To add a campaign, run AddCampaign.cs. + /// + /// Tags: CampaignService.get + /// + public class GetCampaignsWithAwql : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetCampaignsWithAwql codeExample = new GetCampaignsWithAwql(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example lists all campaigns using an AWQL query. See " + + "https://developers.google.com/adwords/api/docs/guides/awql for AWQL documentation. " + + "To add a campaign, run AddCampaign.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201402.CampaignService); + + // Create the query. + string query = "SELECT Id, Name, Status ORDER BY Name"; + + int offset = 0; + int pageSize = 500; + + CampaignPage page = new CampaignPage(); + + try { + do { + string queryWithPaging = string.Format("{0} LIMIT {1}, {2}", query, offset, pageSize); + + // Get the campaigns. + page = campaignService.query(queryWithPaging); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (Campaign campaign in page.entries) { + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = '{3}'" + + " was found.", i + 1, campaign.id, campaign.name, campaign.status); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve campaigns", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/BasicOperations/GetPlacements.cs b/examples/AdXBuyer/CSharp/v201402/BasicOperations/GetPlacements.cs new file mode 100644 index 00000000000..cb06a3b6f22 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/BasicOperations/GetPlacements.cs @@ -0,0 +1,128 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example gets all placements in an account. To add placements, + /// run AddPlacements.cs. + /// + /// Tags: AdGroupCriterionService.get + /// + public class GetPlacements : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetPlacements codeExample = new GetPlacements(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all placements in an account. To add placements, run " + + "AddPlacements.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService( + AdWordsService.v201402.AdGroupCriterionService); + + // Create a selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "AdGroupId", "PlacementUrl"}; + + // Select only keywords. + Predicate predicate = new Predicate(); + predicate.field = "CriteriaType"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] {"PLACEMENT"}; + selector.predicates = new Predicate[] {predicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupCriterionPage page = new AdGroupCriterionPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the keywords. + page = adGroupCriterionService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + + foreach (AdGroupCriterion adGroupCriterion in page.entries) { + bool isNegative = (adGroupCriterion is NegativeAdGroupCriterion); + + // If you are retrieving multiple type of criteria, then you may + // need to check for + // + // if (adGroupCriterion is Placement) { ... } + // + // to identify the criterion type. + Placement placement = (Placement) adGroupCriterion.criterion; + if (isNegative) { + Console.WriteLine("{0}) Negative placement with ad group ID = '{1}', placement " + + "ID = '{2}', and url = '{3}' was found.", i, adGroupCriterion.adGroupId, + placement.id, placement.url); + } else { + Console.WriteLine("{0}) Placement with ad group ID = '{1}', placement ID = '{2}' " + + "and url = '{3}' was found.", i, adGroupCriterion.adGroupId, + placement.id, placement.url); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of placements found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve placements."); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/BasicOperations/GetThirdPartyRedirectAds.cs b/examples/AdXBuyer/CSharp/v201402/BasicOperations/GetThirdPartyRedirectAds.cs new file mode 100644 index 00000000000..a858d47c3ca --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/BasicOperations/GetThirdPartyRedirectAds.cs @@ -0,0 +1,142 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example retrieves all third party redirect ads given an existing + /// ad group. To add third party redirect ads to an existing ad group, run + /// AddThirdPartyRedirectAd.cs. + /// + /// Tags: AdGroupAdService.get + /// + public class GetThirdPartyRedirectAds : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetThirdPartyRedirectAds codeExample = new GetThirdPartyRedirectAds(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves all third party redirect ads given an existing ad " + + "group. To add third party redirect ads to an existing ad group, run " + + "AddThirdPartyRedirectAd.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group from which third party + /// redirect ads are retrieved. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201402.AdGroupAdService); + + // Create a selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Status", "Url", "DisplayUrl", "RichMediaAdSnippet"}; + + // Set the sort order. + OrderBy orderBy = new OrderBy(); + orderBy.field = "Id"; + orderBy.sortOrder = SortOrder.ASCENDING; + selector.ordering = new OrderBy[] {orderBy}; + + // Restrict the fetch to only the selected ad group id. + Predicate adGroupPredicate = new Predicate(); + adGroupPredicate.field = "AdGroupId"; + adGroupPredicate.@operator = PredicateOperator.EQUALS; + adGroupPredicate.values = new string[] {adGroupId.ToString()}; + + // Retrieve only third party redirect ads. + Predicate typePredicate = new Predicate(); + typePredicate.field = "AdType"; + typePredicate.@operator = PredicateOperator.EQUALS; + typePredicate.values = new string[] {"THIRD_PARTY_REDIRECT_AD"}; + + // By default disabled ads aren't returned by the selector. To return + // them include the DISABLED status in the statuses field. + Predicate statusPredicate = new Predicate(); + statusPredicate.field = "Status"; + statusPredicate.@operator = PredicateOperator.IN; + + statusPredicate.values = new string[] {AdGroupAdStatus.ENABLED.ToString(), + AdGroupAdStatus.PAUSED.ToString(), AdGroupAdStatus.DISABLED.ToString()}; + + selector.predicates = new Predicate[] {adGroupPredicate, statusPredicate, typePredicate}; + + // Select the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupAdPage page = new AdGroupAdPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the third party redirect ads. + page = service.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + + foreach (AdGroupAd adGroupAd in page.entries) { + ThirdPartyRedirectAd thirdPartyRedirectAd = (ThirdPartyRedirectAd) adGroupAd.ad; + Console.WriteLine("{0}) Ad id is {1} and status is {2}", i, thirdPartyRedirectAd.id, + adGroupAd.status); + Console.WriteLine(" Url: {0}\n Display Url: {1}\n Snippet:{2}", + thirdPartyRedirectAd.url, thirdPartyRedirectAd.displayUrl, + thirdPartyRedirectAd.snippet); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of third party redirect ads found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get third party redirect ad(s).", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/BasicOperations/PauseAd.cs b/examples/AdXBuyer/CSharp/v201402/BasicOperations/PauseAd.cs new file mode 100644 index 00000000000..65d58ec169b --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/BasicOperations/PauseAd.cs @@ -0,0 +1,101 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example pauses a given ad. To list all ads, run GetTextAds.cs. + /// + /// Tags: AdGroupAdService.mutate + /// + public class PauseAd : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + PauseAd codeExample = new PauseAd(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long adId = long.Parse("INSERT_AD_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, adId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example pauses a given ad. To list all ads, run GetTextAds.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the ad. + /// + /// Id of the ad to be paused. + public void Run(AdWordsUser user, long adGroupId, long adId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201402.AdGroupAdService); + + AdGroupAdStatus status = AdGroupAdStatus.PAUSED; + + // Create the ad group ad. + AdGroupAd adGroupAd = new AdGroupAd(); + adGroupAd.status = status; + adGroupAd.adGroupId = adGroupId; + + adGroupAd.ad = new Ad(); + adGroupAd.ad.id = adId; + + // Create the operation. + AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation(); + adGroupAdOperation.@operator = Operator.SET; + adGroupAdOperation.operand = adGroupAd; + + try { + // Update the ad. + AdGroupAdReturnValue retVal = service.mutate(new AdGroupAdOperation[]{adGroupAdOperation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupAd pausedAdGroupAd = retVal.value[0]; + Console.WriteLine("Ad with id \"{0}\" and ad group id \"{1}\"was paused.", + pausedAdGroupAd.ad.id, pausedAdGroupAd.adGroupId); + } else { + Console.WriteLine("No ads were paused."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to pause ad.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/BasicOperations/UpdateAdGroup.cs b/examples/AdXBuyer/CSharp/v201402/BasicOperations/UpdateAdGroup.cs new file mode 100644 index 00000000000..f86feff116e --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/BasicOperations/UpdateAdGroup.cs @@ -0,0 +1,95 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example illustrates how to update an ad group, setting its + /// status to 'PAUSED'. To create an ad group, run AddAdGroup.cs. + /// + /// Tags: AdGroupService.mutate + /// + public class UpdateAdGroup : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdateAdGroup codeExample = new UpdateAdGroup(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to update an ad group, setting its status to " + + "'PAUSED'. To create an ad group, run AddAdGroup.cs"; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to be updated. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201402.AdGroupService); + + // Create the ad group. + AdGroup adGroup = new AdGroup(); + adGroup.status = AdGroupStatus.PAUSED; + adGroup.id = adGroupId; + + // Create the operation. + AdGroupOperation operation = new AdGroupOperation(); + operation.@operator = Operator.SET; + operation.operand = adGroup; + + try { + // Update the ad group. + AdGroupReturnValue retVal = adGroupService.mutate(new AdGroupOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroup pausedAdGroup = retVal.value[0]; + Console.WriteLine("Ad group with id = '{0}' was successfully updated.", + pausedAdGroup.id); + } else { + Console.WriteLine("No ad groups were updated."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update ad group.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/BasicOperations/UpdateCampaign.cs b/examples/AdXBuyer/CSharp/v201402/BasicOperations/UpdateCampaign.cs new file mode 100644 index 00000000000..13f48b566ad --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/BasicOperations/UpdateCampaign.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example updates a campaign. To get campaigns, run + /// GetCampaigns.cs. + /// + /// Tags: CampaignService.mutate + /// + public class UpdateCampaign : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdateCampaign codeExample = new UpdateCampaign(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a campaign. To get campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to be updated. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService)user.GetService(AdWordsService.v201402.CampaignService); + + // Create the campaign. + Campaign campaign = new Campaign(); + campaign.id = campaignId; + campaign.status = CampaignStatus.PAUSED; + + // Create the operation. + CampaignOperation operation = new CampaignOperation(); + operation.@operator = Operator.SET; + operation.operand = campaign; + + try { + // Update the campaign. + CampaignReturnValue retVal = campaignService.mutate((new CampaignOperation[] {operation})); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + Campaign updatedCampaign = retVal.value[0]; + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was updated.", + updatedCampaign.name, updatedCampaign.id); + } else { + Console.WriteLine("No campaigns were updated."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update campaign.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/BasicOperations/UpdatePlacement.cs b/examples/AdXBuyer/CSharp/v201402/BasicOperations/UpdatePlacement.cs new file mode 100644 index 00000000000..20325445709 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/BasicOperations/UpdatePlacement.cs @@ -0,0 +1,122 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example updates the bid of a placement. To get placement, run + /// GetPlacements.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class UpdatePlacement : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdatePlacement codeExample = new UpdatePlacement(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long placementId = long.Parse("INSERT_PLACEMENT_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, placementId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the bid of a placement. To get placement, run " + + "GetPlacements.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the placement. + /// + /// Id of the placement to be updated. + public void Run(AdWordsUser user, long adGroupId, long placementId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201402.AdGroupCriterionService); + + // Since we are not updating any placement-specific fields, it is enough to + // create a criterion object. + Criterion criterion = new Criterion(); + criterion.id = placementId; + + // Create ad group criterion. + BiddableAdGroupCriterion biddableAdGroupCriterion = new BiddableAdGroupCriterion(); + biddableAdGroupCriterion.adGroupId = adGroupId; + biddableAdGroupCriterion.criterion = criterion; + + // Create the bids. + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + CpmBid cpmBid = new CpmBid(); + cpmBid.bid = new Money(); + cpmBid.bid.microAmount = 1000000; + biddingConfig.bids = new Bids[] {cpmBid}; + + biddableAdGroupCriterion.biddingStrategyConfiguration = biddingConfig; + + // Create the operation. + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.@operator = Operator.SET; + operation.operand = biddableAdGroupCriterion; + + try { + // Update the placement. + AdGroupCriterionReturnValue retVal = + adGroupCriterionService.mutate(new AdGroupCriterionOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupCriterion adGroupCriterion = retVal.value[0]; + long bidAmount = 0; + foreach (Bids bids in (adGroupCriterion as BiddableAdGroupCriterion). + biddingStrategyConfiguration.bids) { + if (bids is CpmBid) { + bidAmount = (bids as CpmBid).bid.microAmount; + break; + } + } + Console.WriteLine("Placement with ad group id = '{0}', id = '{1}' was updated with " + + "bid amount = '{2}' micros.", adGroupCriterion.adGroupId, + adGroupCriterion.criterion.id, bidAmount); + } else { + Console.WriteLine("No placement was updated."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update placement.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/CampaignManagement/AddPlacementsInBulk.cs b/examples/AdXBuyer/CSharp/v201402/CampaignManagement/AddPlacementsInBulk.cs new file mode 100644 index 00000000000..881565e3da6 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/CampaignManagement/AddPlacementsInBulk.cs @@ -0,0 +1,172 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.RegularExpressions; +using System.Threading; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example shows how to add placements in bulk using the + /// MutateJobService. + /// + /// Tags: MutateJobService.mutate, MutateJobService.get + /// Tags: MutateJobService.getResult + /// + public class AddPlacementsInBulk : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddPlacementsInBulk codeExample = new AddPlacementsInBulk(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to add placements in bulk using the MutateJobService."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad groups to which placements are + /// added. + public void Run(AdWordsUser user, long adGroupId) { + // Get the MutateJobService. + MutateJobService mutateJobService = (MutateJobService) user.GetService( + AdWordsService.v201402.MutateJobService); + + const int RETRY_INTERVAL = 30; + const int RETRIES_COUNT = 30; + const int PLACEMENT_NUMBER = 100; + const string INDEX_REGEX = "operations\\[(\\d+)\\].operand"; + + List operations = new List(); + + // Create AdGroupCriterionOperation to add placements. + for (int i = 0; i < PLACEMENT_NUMBER; i++) { + Placement placement = new Placement(); + placement.url = "http://mars.google.com/" + i.ToString(); + + BiddableAdGroupCriterion criterion = new BiddableAdGroupCriterion(); + criterion.adGroupId = adGroupId; + criterion.criterion = placement; + + AdGroupCriterionOperation adGroupCriterionOperation = new AdGroupCriterionOperation(); + adGroupCriterionOperation.@operator = Operator.ADD; + adGroupCriterionOperation.operand = criterion; + + operations.Add(adGroupCriterionOperation); + } + + BulkMutateJobPolicy policy = new BulkMutateJobPolicy(); + // You can specify up to 3 job IDs that must successfully complete before + // this job can be processed. + policy.prerequisiteJobIds = new long[] {}; + + SimpleMutateJob job = mutateJobService.mutate(operations.ToArray(), policy); + + // Wait for the job to complete. + bool completed = false; + int retryCount = 0; + Console.WriteLine("Retrieving job status..."); + + while (completed == false && retryCount < RETRIES_COUNT) { + BulkMutateJobSelector selector = new BulkMutateJobSelector(); + selector.jobIds = new long[] {job.id}; + + try { + Job[] allJobs = mutateJobService.get(selector); + if (allJobs != null && allJobs.Length > 0) { + job = (SimpleMutateJob) allJobs[0]; + if (job.status == BasicJobStatus.COMPLETED || job.status == BasicJobStatus.FAILED) { + completed = true; + break; + } else { + Console.WriteLine("{0}: Current status is {1}, waiting {2} seconds to retry...", + retryCount, job.status, RETRY_INTERVAL); + Thread.Sleep(RETRY_INTERVAL * 1000); + retryCount++; + } + } + } catch (Exception ex) { + throw new System.ApplicationException(string.Format("Failed to fetch simple mutate " + + "job with id = {0}.", job.id), ex); + } + } + + if (job.status == BasicJobStatus.COMPLETED) { + // Handle cases where the job completed. + + // Create the job selector. + BulkMutateJobSelector selector = new BulkMutateJobSelector(); + selector.jobIds = new long[] {job.id}; + + // Get the job results. + JobResult jobResult = mutateJobService.getResult(selector); + if (jobResult != null) { + SimpleMutateResult results = (SimpleMutateResult) jobResult.Item; + if (results != null) { + // Display the results. + if (results.results != null) { + for (int i = 0; i < results.results.Length; i++) { + Operand operand = results.results[i]; + Console.WriteLine("Operation {0} - {1}", i, (operand.Item is PlaceHolder) ? + "FAILED" : "SUCCEEDED"); + } + } + + // Display the errors. + if (results.errors != null) { + foreach (ApiError apiError in results.errors) { + Match match = Regex.Match(apiError.fieldPath, INDEX_REGEX, RegexOptions.IgnoreCase); + string index = (match.Success)? match.Groups[1].Value : "???"; + Console.WriteLine("Operation index {0} failed due to reason: '{1}', " + + "trigger: '{2}'", index, apiError.errorString, apiError.trigger); + } + } + } + } + Console.WriteLine("Job completed successfully!"); + } else if (job.status == BasicJobStatus.FAILED) { + // Handle the cases where job failed. + Console.WriteLine("Job failed with reason: " + job.failureReason); + } else if (job.status == BasicJobStatus.PROCESSING || job.status == BasicJobStatus.PENDING) { + // Handle the cases where job didn't complete after wait period. + Console.WriteLine("Job did not complete in {0} secconds.", RETRY_INTERVAL * RETRIES_COUNT); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/CampaignManagement/GetAllDisapprovedAds.cs b/examples/AdXBuyer/CSharp/v201402/CampaignManagement/GetAllDisapprovedAds.cs new file mode 100644 index 00000000000..e018ed28fba --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/CampaignManagement/GetAllDisapprovedAds.cs @@ -0,0 +1,121 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example retrieves all the disapproved ads in a given campaign. + /// + /// Tags: AdGroupAdService.get + /// + public class GetAllDisapprovedAds : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAllDisapprovedAds codeExample = new GetAllDisapprovedAds(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves all the disapproved ads in a given campaign."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign for which disapproved ads + /// are retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201402.AdGroupAdService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "AdGroupCreativeApprovalStatus", + "AdGroupAdDisapprovalReasons"}; + + // Create the filter. + Predicate campaignPredicate = new Predicate(); + campaignPredicate.@operator = PredicateOperator.EQUALS; + campaignPredicate.field = "CampaignId"; + campaignPredicate.values = new string[] {campaignId.ToString()}; + + Predicate approvalPredicate = new Predicate(); + approvalPredicate.@operator = PredicateOperator.EQUALS; + approvalPredicate.field = "AdGroupCreativeApprovalStatus"; + approvalPredicate.values = new string[] {AdGroupAdApprovalStatus.DISAPPROVED.ToString()}; + + selector.predicates = new Predicate[] {campaignPredicate, approvalPredicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupAdPage page = new AdGroupAdPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the disapproved ads. + page = service.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroupAd adGroupAd in page.entries) { + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " + + "reason(s):", i, adGroupAd.ad.id); + foreach (string reason in adGroupAd.disapprovalReasons) { + Console.WriteLine(" {0}", reason); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get disapproved ads.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs b/examples/AdXBuyer/CSharp/v201402/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs new file mode 100644 index 00000000000..617a8fcf562 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs @@ -0,0 +1,108 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example retrieves all the disapproved ads in a given campaign + /// using AWQL. See https://developers.google.com/adwords/api/docs/guides/awql + /// for AWQL documentation. + /// + /// Tags: AdGroupAdService.get + /// + public class GetAllDisapprovedAdsWithAwql : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAllDisapprovedAdsWithAwql codeExample = new GetAllDisapprovedAdsWithAwql(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves all the disapproved ads in a given campaign using " + + "AWQL. See https://developers.google.com/adwords/api/docs/guides/awql for AWQL " + + "documentation."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign for which disapproved ads + /// are retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201402.AdGroupAdService); + + // Get all the disapproved ads for this campaign. + string query = string.Format("SELECT Id, AdGroupAdDisapprovalReasons WHERE " + + "CampaignId = {0} AND AdGroupCreativeApprovalStatus = DISAPPROVED ORDER BY Id", + campaignId); + + int offset = 0; + int pageSize = 500; + + AdGroupAdPage page = new AdGroupAdPage(); + + try { + do { + string queryWithPaging = string.Format("{0} LIMIT {1}, {2}", query, offset, pageSize); + + // Get the disapproved ads. + page = service.query(queryWithPaging); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroupAd adGroupAd in page.entries) { + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " + + "reason(s):", i, adGroupAd.ad.id); + foreach (string reason in adGroupAd.disapprovalReasons) { + Console.WriteLine(" {0}", reason); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get disapproved ads.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/ErrorHandling/HandlePartialFailures.cs b/examples/AdXBuyer/CSharp/v201402/ErrorHandling/HandlePartialFailures.cs new file mode 100644 index 00000000000..f101213baae --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/ErrorHandling/HandlePartialFailures.cs @@ -0,0 +1,135 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example demonstrates how to handle partial failures. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class HandlePartialFailures : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + HandlePartialFailures codeExample = new HandlePartialFailures(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example demonstrates how to handle partial failures."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which keywords are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201402.AdGroupCriterionService); + + // Set partial failure mode for the service. + adGroupCriterionService.RequestHeader.partialFailure = true; + + List operations = new List(); + + // Create the placements. + string[] urls = new String[] {"http://mars.google.com", "http:/mars.google.com", + "mars.google.com"}; + + foreach (String url in urls) { + Placement placement = new Placement(); + placement.url = url; + + // Create biddable ad group criterion. + BiddableAdGroupCriterion placementBiddableAdGroupCriterion = new BiddableAdGroupCriterion(); + placementBiddableAdGroupCriterion.adGroupId = adGroupId; + placementBiddableAdGroupCriterion.criterion = placement; + + // Create the operation. + AdGroupCriterionOperation placementAdGroupCriterionOperation = + new AdGroupCriterionOperation(); + placementAdGroupCriterionOperation.operand = placementBiddableAdGroupCriterion; + placementAdGroupCriterionOperation.@operator = Operator.ADD; + operations.Add(placementAdGroupCriterionOperation); + } + + try { + // Create the placements. + AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations.ToArray()); + + // Display the results. + if (result != null && result.value != null) { + foreach (AdGroupCriterion adGroupCriterionResult in result.value) { + if (adGroupCriterionResult.criterion != null) { + Console.WriteLine("Placement with ad group id '{0}', and criterion " + + "id '{1}', and url '{2}' was added.\n", adGroupCriterionResult.adGroupId, + adGroupCriterionResult.criterion.id, + ((Placement) adGroupCriterionResult.criterion).url); + } + } + } else { + Console.WriteLine("No placements were added."); + } + + // Display the partial failure errors. + if (result != null && result.partialFailureErrors != null) { + foreach (ApiError apiError in result.partialFailureErrors) { + int operationIndex = ErrorUtilities.GetOperationIndex(apiError.fieldPath); + if (operationIndex != -1) { + AdGroupCriterion adGroupCriterion = operations[operationIndex].operand; + Console.WriteLine("Placement with ad group id '{0}' and url '{1}' " + + "triggered a failure for the following reason: '{2}'.\n", + adGroupCriterion.adGroupId, ((Placement) adGroupCriterion.criterion).url, + apiError.errorString); + } else { + Console.WriteLine("A failure for the following reason: '{0}' has occurred.\n", + apiError.errorString); + } + } + } + } catch (Exception e) { + throw new System.ApplicationException("Failed to add placements in partial failure mode.", + e); + } + } + } +} + diff --git a/examples/AdXBuyer/CSharp/v201402/ErrorHandling/HandlePolicyViolationError.cs b/examples/AdXBuyer/CSharp/v201402/ErrorHandling/HandlePolicyViolationError.cs new file mode 100644 index 00000000000..74949743c69 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/ErrorHandling/HandlePolicyViolationError.cs @@ -0,0 +1,180 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example adds a text ad, and shows how to handle a policy + /// violation. + /// + /// Tags: AdGroupAdService.mutate + /// + public class HandlePolicyViolationError : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + HandlePolicyViolationError codeExample = new HandlePolicyViolationError(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a text ad, and shows how to handle a policy violation."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which ads are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201402.AdGroupAdService); + + // Create the third party redirect ad that violates a policy. + ThirdPartyRedirectAd redirectAd = new ThirdPartyRedirectAd(); + redirectAd.name = "Policy violation demo ad " + ExampleUtilities.GetRandomString(); + redirectAd.url = "gopher://gopher.google.com"; + redirectAd.dimensions = new Dimensions(); + redirectAd.dimensions.width = 300; + redirectAd.dimensions.height = 250; + + redirectAd.snippet = ""; + redirectAd.impressionBeaconUrl = "http://www.examples.com/beacon1"; + redirectAd.certifiedVendorFormatId = 119; + redirectAd.isCookieTargeted = false; + redirectAd.isUserInterestTargeted = false; + redirectAd.isTagged = false; + + AdGroupAd redirectAdGroupAd = new AdGroupAd(); + redirectAdGroupAd.adGroupId = adGroupId; + redirectAdGroupAd.ad = redirectAd; + + // Create the operations. + AdGroupAdOperation redirectAdOperation = new AdGroupAdOperation(); + redirectAdOperation.@operator = Operator.ADD; + redirectAdOperation.operand = redirectAdGroupAd; + + try { + AdGroupAdReturnValue retVal = null; + + // Setup two arrays, one to hold the list of all operations to be + // validated, and another to hold the list of operations that cannot be + // fixed after validation. + List allOperations = new List(); + List operationsToBeRemoved = new List(); + + allOperations.Add(redirectAdOperation); + + try { + // Validate the operations. + service.RequestHeader.validateOnly = true; + retVal = service.mutate(allOperations.ToArray()); + } catch (AdWordsApiException ex) { + ApiException innerException = ex.ApiException as ApiException; + if (innerException == null) { + throw new Exception("Failed to retrieve ApiError. See inner exception for more " + + "details.", ex); + } + + // Examine each ApiError received from the server. + foreach (ApiError apiError in innerException.errors) { + int index = ErrorUtilities.GetOperationIndex(apiError.fieldPath); + if (index == -1) { + // This API error is not associated with an operand, so we cannot + // recover from this error by removing one or more operations. + // Rethrow the exception for manual inspection. + throw; + } + + // Handle policy violation errors. + if (apiError is PolicyViolationError) { + PolicyViolationError policyError = (PolicyViolationError) apiError; + + if (policyError.isExemptable) { + // If the policy violation error is exemptable, add an exemption + // request. + List exemptionRequests = new List(); + if (allOperations[index].exemptionRequests != null) { + exemptionRequests.AddRange(allOperations[index].exemptionRequests); + } + + ExemptionRequest exemptionRequest = new ExemptionRequest(); + exemptionRequest.key = policyError.key; + exemptionRequests.Add(exemptionRequest); + allOperations[index].exemptionRequests = exemptionRequests.ToArray(); + } else { + // Policy violation error is not exemptable, remove this + // operation from the list of operations. + operationsToBeRemoved.Add(allOperations[index]); + } + } else { + // This is not a policy violation error, remove this operation + // from the list of operations. + operationsToBeRemoved.Add(allOperations[index]); + } + } + // Remove all operations that aren't exemptable. + foreach (AdGroupAdOperation operation in operationsToBeRemoved) { + allOperations.Remove(operation); + } + } + + if (allOperations.Count > 0) { + // Perform the operations exemptible of a policy violation. + service.RequestHeader.validateOnly = false; + retVal = service.mutate(allOperations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + foreach (AdGroupAd newAdGroupAd in retVal.value) { + Console.WriteLine("New ad with id = \"{0}\" and displayUrl = \"{1}\" was created.", + newAdGroupAd.ad.id, newAdGroupAd.ad.displayUrl); + } + } else { + Console.WriteLine("No ads were created."); + } + } else { + Console.WriteLine("There are no ads to create after policy violation checks."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create ads.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/ErrorHandling/HandleRateExceededError.cs b/examples/AdXBuyer/CSharp/v201402/ErrorHandling/HandleRateExceededError.cs new file mode 100644 index 00000000000..86964d26d11 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/ErrorHandling/HandleRateExceededError.cs @@ -0,0 +1,204 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example shows how to handle RateExceededError in your + /// application. To trigger the rate exceeded error, this code example runs + /// 100 threads in parallel, each thread attempting to validate 100 keywords + /// in a single request. Note that spawning 100 parallel threads is for + /// illustrative purposes only, you shouldn't do this in your application. + /// + /// Tags: AdGroupAdService.mutate + /// + public class HandleRateExceededError: ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + HandleRateExceededError codeExample = new HandleRateExceededError(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to handle RateExceededError in your application. " + + "To trigger the rate exceeded error, this code example runs 100 threads in " + + "parallel, each thread attempting to validate 100 keywords in a single request. " + + "Note that spawning 100 parallel threads is for illustrative purposes only, you " + + "shouldn't do this in your application."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which keywords are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + const int NUM_THREADS = 100; + + // Increase the maximum number of parallel HTTP connections that .NET + // framework allows. By default, this is set to 2 by the .NET framework. + System.Net.ServicePointManager.DefaultConnectionLimit = NUM_THREADS; + + List threads = new List(); + + for (int i = 0; i < NUM_THREADS; i++) { + Thread thread = new Thread(new KeywordThread(user, i, adGroupId).Run); + threads.Add(thread); + } + + for (int i = 0; i < NUM_THREADS; i++) { + threads[i].Start(i); + } + + for (int i = 0; i < NUM_THREADS; i++) { + threads[i].Join(); + } + } + + /// + /// Thread class for validating keywords. + /// + class KeywordThread { + /// + /// Index of this thread, for identifying and debugging. + /// + int threadIndex; + + /// + /// The ad group id to which keywords are added. + /// + long adGroupId; + + /// + /// The AdWords user who owns this ad group. + /// + AdWordsUser user; + + /// + /// Number of keywords to be validated in each API call. + /// + const int NUM_KEYWORDS = 100; + + /// + /// Initializes a new instance of the class. + /// + /// Index of the thread. + /// The ad group id. + /// The AdWords user who owns the ad group. + public KeywordThread(AdWordsUser user, int threadIndex, long adGroupId) { + this.user = user; + this.threadIndex = threadIndex; + this.adGroupId = adGroupId; + } + + /// + /// Main method for the thread. + /// + /// The thread parameter. + public void Run(Object obj) { + // Create the operations. + List operations = new List(); + + for (int j = 0; j < NUM_KEYWORDS; j++) { + // Create the keyword. + Keyword keyword = new Keyword(); + keyword.text = "mars cruise thread " + threadIndex.ToString() + " seed " + j.ToString(); + keyword.matchType = KeywordMatchType.BROAD; + + // Create the biddable ad group criterion. + AdGroupCriterion keywordCriterion = new BiddableAdGroupCriterion(); + keywordCriterion.adGroupId = adGroupId; + keywordCriterion.criterion = keyword; + + // Create the operations. + AdGroupCriterionOperation keywordOperation = new AdGroupCriterionOperation(); + keywordOperation.@operator = Operator.ADD; + keywordOperation.operand = keywordCriterion; + + operations.Add(keywordOperation); + } + + // Get the AdGroupCriterionService. This should be done within the + // thread, since a service can only handle one outgoing HTTP request + // at a time. + AdGroupCriterionService service = (AdGroupCriterionService) user.GetService( + AdWordsService.v201402.AdGroupCriterionService); + service.RequestHeader.validateOnly = true; + int retryCount = 0; + const int NUM_RETRIES = 3; + try { + while (retryCount < NUM_RETRIES) { + try { + // Validate the keywords. + AdGroupCriterionReturnValue retval = service.mutate(operations.ToArray()); + break; + } catch (AdWordsApiException ex) { + // Handle API errors. + ApiException innerException = ex.ApiException as ApiException; + if (innerException == null) { + throw new Exception("Failed to retrieve ApiError. See inner exception for more " + + "details.", ex); + } + foreach (ApiError apiError in innerException.errors) { + if (!(apiError is RateExceededError)) { + // Rethrow any errors other than RateExceededError. + throw; + } + // Handle rate exceeded errors. + RateExceededError rateExceededError = (RateExceededError) apiError; + Console.WriteLine("Got Rate exceeded error - rate name = '{0}', scope = '{1}', " + + "retry After {2} seconds.", rateExceededError.rateScope, + rateExceededError.rateName, rateExceededError.retryAfterSeconds); + Thread.Sleep(rateExceededError.retryAfterSeconds * 1000); + retryCount = retryCount + 1; + } + } finally { + if (retryCount == NUM_RETRIES) { + throw new Exception(String.Format("Could not recover after making {0} attempts.", + retryCount)); + } + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to validate keywords.", ex); + } + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/Miscellaneous/GetAllVideosAndImages.cs b/examples/AdXBuyer/CSharp/v201402/Miscellaneous/GetAllVideosAndImages.cs new file mode 100644 index 00000000000..c7d5f8d9367 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/Miscellaneous/GetAllVideosAndImages.cs @@ -0,0 +1,139 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example gets all videos and images. To upload video, see + /// http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. + /// To upload image, run UploadImage.cs. + /// + /// Tags: MediaService.get + /// + public class GetAllVideosAndImages : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAllVideosAndImages codeExample = new GetAllVideosAndImages(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all videos and images. To upload video, see " + + "http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. To " + + "upload image, run UploadImage.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the MediaService. + MediaService mediaService = (MediaService) user.GetService( + AdWordsService.v201402.MediaService); + + // Create a selector. + Selector selector = new Selector(); + selector.fields = new string[] {"MediaId", "Width", "Height", "MimeType"}; + + // Set the filter. + Predicate predicate = new Predicate(); + predicate.@operator = PredicateOperator.IN; + predicate.field = "Type"; + predicate.values = new string[] {MediaMediaType.VIDEO.ToString(), + MediaMediaType.IMAGE.ToString()}; + + selector.predicates = new Predicate[] {predicate}; + + // Set selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + MediaPage page = new MediaPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + page = mediaService.get(selector); + + if (page != null && page.entries != null) { + int i = offset; + + foreach (Media media in page.entries) { + if (media is Video) { + Video video = (Video) media; + Console.WriteLine("{0}) Video with id \"{1}\" and name \"{2}\" was found.", + i, video.mediaId, video.name); + } else if (media is Image) { + Image image = (Image) media; + Dictionary dimensions = + CreateMediaDimensionMap(image.dimensions); + Console.WriteLine("{0}) Image with id '{1}', dimensions '{2}x{3}', and MIME type " + + "'{4}' was found.", i, image.mediaId, dimensions[MediaSize.FULL].width, + dimensions[MediaSize.FULL].height, image.mimeType); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of images and videos found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get images and videos.", ex); + } + } + + /// + /// Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + /// + /// The array of Media_Size_DimensionsMapEntry to be + /// converted into a dictionary. + /// A dictionary with key as MediaSize, and value as Dimensions. + /// + private Dictionary CreateMediaDimensionMap( + Media_Size_DimensionsMapEntry[] dimensions) { + Dictionary mediaMap = new Dictionary(); + foreach (Media_Size_DimensionsMapEntry dimension in dimensions) { + mediaMap.Add(dimension.key, dimension.value); + } + return mediaMap; + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/Miscellaneous/UploadImage.cs b/examples/AdXBuyer/CSharp/v201402/Miscellaneous/UploadImage.cs new file mode 100644 index 00000000000..4754f748d6e --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/Miscellaneous/UploadImage.cs @@ -0,0 +1,106 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example uploads an image. To get images, run GetAllVideosAndImages.cs. + /// + /// Tags: MediaService.upload + /// + public class UploadImage : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UploadImage codeExample = new UploadImage(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example uploads an image. To get images, run GetAllVideosAndImages.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the MediaService. + MediaService mediaService = (MediaService) user.GetService( + AdWordsService.v201402.MediaService); + + // Create the image. + Image image = new Image(); + image.data = MediaUtilities.GetAssetDataFromUrl("http://goo.gl/HJM3L"); + image.type = MediaMediaType.IMAGE; + + try { + // Upload the image. + Media[] result = mediaService.upload(new Media[] {image}); + + // Display the results. + if (result != null && result.Length > 0) { + Media newImage = result[0]; + Dictionary dimensions = + CreateMediaDimensionMap(newImage.dimensions); + Console.WriteLine("Image with id '{0}', dimensions '{1}x{2}', and MIME type '{3}'" + + " was uploaded.", newImage.mediaId, dimensions[MediaSize.FULL].width, + dimensions[MediaSize.FULL].height, newImage.mimeType); + } else { + Console.WriteLine("No images were uploaded."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to upload image.", ex); + } + } + + /// + /// Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + /// + /// The array of Media_Size_DimensionsMapEntry to be + /// converted into a dictionary. + /// A dictionary with key as MediaSize, and value as Dimensions. + /// + private Dictionary CreateMediaDimensionMap( + Media_Size_DimensionsMapEntry[] dimensions) { + Dictionary mediaMap = new Dictionary(); + foreach (Media_Size_DimensionsMapEntry dimension in dimensions) { + mediaMap.Add(dimension.key, dimension.value); + } + return mediaMap; + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/Optimization/GetPlacementIdeas.cs b/examples/AdXBuyer/CSharp/v201402/Optimization/GetPlacementIdeas.cs new file mode 100644 index 00000000000..ccfc4419d19 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/Optimization/GetPlacementIdeas.cs @@ -0,0 +1,122 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example retrieves urls that have content keywords related to a + /// given website. + /// + /// Tags: TargetingIdeaService.get + /// + public class GetPlacementIdeas : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetPlacementIdeas codeExample = new GetPlacementIdeas(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves urls that have content keywords related to a" + + " given website."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the TargetingIdeaService. + TargetingIdeaService targetingIdeaService = + (TargetingIdeaService) user.GetService(AdWordsService.v201402.TargetingIdeaService); + + // Create seed url. + string url = "mars.google.com"; + + // Create the selector. + TargetingIdeaSelector selector = new TargetingIdeaSelector(); + selector.requestType = RequestType.IDEAS; + selector.ideaType = IdeaType.PLACEMENT; + selector.requestedAttributeTypes = new AttributeType[] {AttributeType.CRITERION, + AttributeType.PLACEMENT_TYPE}; + + // Create related to url search parameter. + RelatedToUrlSearchParameter relatedToUrlSearchParameter = new RelatedToUrlSearchParameter(); + relatedToUrlSearchParameter.urls = new string[] {url}; + relatedToUrlSearchParameter.includeSubUrls = false; + selector.searchParameters = new SearchParameter[] {relatedToUrlSearchParameter}; + + // Set selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + TargetingIdeaPage page = new TargetingIdeaPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get placement ideas. + page = targetingIdeaService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + + foreach (TargetingIdea idea in page.entries) { + foreach (Type_AttributeMapEntry entry in idea.data) { + if (entry.key == AttributeType.CRITERION) { + CriterionAttribute placementAttribute = entry.value as CriterionAttribute; + Placement placement = (Placement) placementAttribute.value; + Console.WriteLine("Related placement urls were found at '{0}'.", + (placementAttribute.value as Placement).url); + } + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of related placements found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve related placements.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/Remarketing/AddAudience.cs b/examples/AdXBuyer/CSharp/v201402/Remarketing/AddAudience.cs new file mode 100644 index 00000000000..21b2602d282 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/Remarketing/AddAudience.cs @@ -0,0 +1,156 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example illustrates how to create a user list a.k.a. audience. + /// + /// Tags: UserListService.mutate + /// + public class AddAudience : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAudience codeExample = new AddAudience(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create a user list a.k.a. audience."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the UserListService. + AdwordsUserListService userListService = + (AdwordsUserListService) user.GetService(AdWordsService.v201402.AdwordsUserListService); + + // Get the ConversionTrackerService. + ConversionTrackerService conversionTrackerService = + (ConversionTrackerService)user.GetService(AdWordsService.v201402. + ConversionTrackerService); + + BasicUserList userList = new BasicUserList(); + userList.name = "Mars cruise customers #" + ExampleUtilities.GetRandomString(); + userList.description = "A list of mars cruise customers in the last year."; + userList.status = UserListMembershipStatus.OPEN; + userList.membershipLifeSpan = 365; + + UserListConversionType conversionType = new UserListConversionType(); + conversionType.name = userList.name; + userList.conversionTypes = new UserListConversionType[] {conversionType}; + + // Optional: Set the user list status. + userList.status = UserListMembershipStatus.OPEN; + + // Create the operation. + UserListOperation operation = new UserListOperation(); + operation.operand = userList; + operation.@operator = Operator.ADD; + + try { + // Add the user list. + UserListReturnValue retval = userListService.mutate(new UserListOperation[] {operation}); + + UserList[] userLists = null; + if (retval != null && retval.value != null) { + userLists = retval.value; + // Get all conversion snippets + List conversionIds = new List(); + foreach (BasicUserList newUserList in userLists) { + if (newUserList.conversionTypes != null) { + foreach (UserListConversionType newConversionType in newUserList.conversionTypes) { + conversionIds.Add(newConversionType.id.ToString()); + } + } + } + + Dictionary conversionsMap = + new Dictionary(); + + if (conversionIds.Count > 0) { + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id"}; + + Predicate conversionTypePredicate = new Predicate(); + conversionTypePredicate.field = "Id"; + conversionTypePredicate.@operator = PredicateOperator.IN; + conversionTypePredicate.values = conversionIds.ToArray(); + selector.predicates = new Predicate[] {conversionTypePredicate}; + + // Get all conversion trackers. + ConversionTrackerPage page = conversionTrackerService.get(selector); + + if (page != null && page.entries != null) { + foreach (ConversionTracker tracker in page.entries) { + conversionsMap[tracker.id] = tracker; + } + } + } + + // Display the results. + foreach (BasicUserList newUserList in userLists) { + Console.WriteLine("User list with name '{0}' and id '{1}' was added.", + newUserList.name, newUserList.id); + + // Display user list associated conversion code snippets. + if (newUserList.conversionTypes != null) { + foreach (UserListConversionType userListConversionType in + newUserList.conversionTypes) { + if (conversionsMap.ContainsKey(userListConversionType.id)) { + AdWordsConversionTracker conversionTracker = + (AdWordsConversionTracker) conversionsMap[userListConversionType.id]; + Console.WriteLine("Conversion type code snippet associated to the list:\n{0}\n", + conversionTracker.snippet); + } else { + throw new Exception("Failed to associate conversion type code snippet."); + } + } + } + } + } else { + Console.WriteLine("No user lists (a.k.a. audiences) were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add user lists (a.k.a. audiences).", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/Remarketing/AddConversionTracker.cs b/examples/AdXBuyer/CSharp/v201402/Remarketing/AddConversionTracker.cs new file mode 100644 index 00000000000..694ae70990f --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/Remarketing/AddConversionTracker.cs @@ -0,0 +1,107 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example adds an AdWords conversion tracker. + /// + /// Tags: ConversionTrackerService.mutate + /// + public class AddConversionTracker : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddConversionTracker codeExample = new AddConversionTracker(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds an AdWords conversion tracker."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ConversionTrackerService. + ConversionTrackerService conversionTrackerService = + (ConversionTrackerService)user.GetService(AdWordsService.v201402. + ConversionTrackerService); + + // Create Adwords conversion tracker. + AdWordsConversionTracker conversionTracker = new AdWordsConversionTracker(); + conversionTracker.name = "Earth to Mars Cruises Conversion #" + + ExampleUtilities.GetRandomString(); + conversionTracker.category = ConversionTrackerCategory.DEFAULT; + conversionTracker.markupLanguage = AdWordsConversionTrackerMarkupLanguage.HTML; + conversionTracker.textFormat = AdWordsConversionTrackerTextFormat.HIDDEN; + + // Set optional fields. + conversionTracker.status = ConversionTrackerStatus.ENABLED; + conversionTracker.viewthroughLookbackWindow = 15; + conversionTracker.isProductAdsChargeable = true; + conversionTracker.productAdsChargeableConversionWindow = 15; + conversionTracker.conversionPageLanguage = "en"; + conversionTracker.backgroundColor = "#0000FF"; + conversionTracker.defaultRevenueValue = 23.41; + conversionTracker.alwaysUseDefaultRevenueValue = true; + + // Create the operation. + ConversionTrackerOperation operation = new ConversionTrackerOperation(); + operation.@operator = Operator.ADD; + operation.operand = conversionTracker; + + try { + // Add conversion tracker. + ConversionTrackerReturnValue retval = conversionTrackerService.mutate( + new ConversionTrackerOperation[] {operation}); + + // Display the results. + if (retval != null && retval.value != null && retval.value.Length > 0) { + ConversionTracker newConversionTracker = retval.value[0]; + Console.WriteLine("Conversion tracker with id '{0}', name '{1}', status '{2}', " + + "category '{3}' was added.", newConversionTracker.id, newConversionTracker.name, + newConversionTracker.status, newConversionTracker.category); + } else { + Console.WriteLine("No conversion trackers were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add conversion tracker.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/Reporting/DownloadCriteriaReport.cs b/examples/AdXBuyer/CSharp/v201402/Reporting/DownloadCriteriaReport.cs new file mode 100644 index 00000000000..a200189757e --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/Reporting/DownloadCriteriaReport.cs @@ -0,0 +1,114 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util.Reports; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example gets and downloads a criteria Ad Hoc report from an XML + /// report definition. + /// + public class DownloadCriteriaReport : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DownloadCriteriaReport codeExample = new DownloadCriteriaReport(); + Console.WriteLine(codeExample.Description); + try { + string fileName = "INSERT_FILE_NAME_HERE"; + codeExample.Run(new AdWordsUser(), fileName); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets and downloads a criteria Ad Hoc report from an XML report " + + "definition."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The file to which the report is downloaded. + /// + public void Run(AdWordsUser user, string fileName) { + ReportDefinition definition = new ReportDefinition(); + + definition.reportName = "Last 7 days CRITERIA_PERFORMANCE_REPORT"; + definition.reportType = ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT; + definition.downloadFormat = DownloadFormat.GZIPPED_CSV; + definition.dateRangeType = ReportDefinitionDateRangeType.LAST_7_DAYS; + + // Create selector. + Selector selector = new Selector(); + selector.fields = new string[] {"CampaignId", "AdGroupId", "Id", "CriteriaType", "Criteria", + "CriteriaDestinationUrl", "Clicks", "Impressions", "Cost"}; + + Predicate predicate = new Predicate(); + predicate.field = "Status"; + predicate.@operator = PredicateOperator.IN; + predicate.values = new string[] {"ACTIVE", "PAUSED"}; + selector.predicates = new Predicate[] {predicate}; + + definition.selector = selector; + definition.includeZeroImpressions = true; + + string filePath = ExampleUtilities.GetHomeDir() + Path.DirectorySeparatorChar + fileName; + + try { + // If you know that your report is small enough to fit in memory, then + // you can instead use + // ReportUtilities utilities = new ReportUtilities(user); + // utilities.ReportVersion = "v201402"; + // ClientReport report = utilities.GetClientReport(definition); + // + // // Get the text report directly if you requested a text format + // // (e.g. xml) + // string reportText = report.Text; + // + // // Get the binary report if you requested a binary format + // // (e.g. gzip) + // byte[] reportBytes = report.Contents; + // + // // Deflate a zipped binary report for further processing. + // string deflatedReportText = Encoding.UTF8.GetString( + // MediaUtilities.DeflateGZipData(report.Contents)); + ReportUtilities utilities = new ReportUtilities(user); + utilities.ReportVersion = "v201402"; + utilities.DownloadClientReport(definition, filePath); + Console.WriteLine("Report was downloaded to '{0}'.", filePath); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to download report.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/Reporting/DownloadCriteriaReportWithAwql.cs b/examples/AdXBuyer/CSharp/v201402/Reporting/DownloadCriteriaReportWithAwql.cs new file mode 100644 index 00000000000..153ca2f9abb --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/Reporting/DownloadCriteriaReportWithAwql.cs @@ -0,0 +1,99 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util.Reports; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example gets and downloads a criteria Ad Hoc report from an AWQL + /// query. See https://developers.google.com/adwords/api/docs/guides/awql for + /// AWQL documentation. + /// + public class DownloadCriteriaReportWithAwql : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DownloadCriteriaReportWithAwql codeExample = new DownloadCriteriaReportWithAwql(); + Console.WriteLine(codeExample.Description); + try { + string fileName = "INSERT_FILE_NAME_HERE"; + codeExample.Run(new AdWordsUser(), fileName); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets and downloads a criteria Ad Hoc report from an AWQL " + + "query. See https://developers.google.com/adwords/api/docs/guides/awql for AWQL " + + "documentation."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The file to which the report is downloaded. + /// + public void Run(AdWordsUser user, string fileName) { + string query = "SELECT CampaignId, AdGroupId, Id, Criteria, CriteriaType, Impressions, " + + "Clicks, Cost FROM CRITERIA_PERFORMANCE_REPORT WHERE Status IN [ACTIVE, PAUSED] " + + "DURING LAST_7_DAYS"; + + string filePath = ExampleUtilities.GetHomeDir() + Path.DirectorySeparatorChar + fileName; + + try { + // If you know that your report is small enough to fit in memory, then + // you can instead use + // ReportUtilities utilities = new ReportUtilities(user); + // utilities.ReportVersion = "v201402"; + // ClientReport report = utilities.GetClientReport(query, format); + // + // // Get the text report directly if you requested a text format + // // (e.g. xml) + // string reportText = report.Text; + // + // // Get the binary report if you requested a binary format + // // (e.g. gzip) + // byte[] reportBytes = report.Contents; + // + // // Deflate a zipped binary report for further processing. + // string deflatedReportText = Encoding.UTF8.GetString( + // MediaUtilities.DeflateGZipData(report.Contents)); + ReportUtilities utilities = new ReportUtilities(user); + utilities.ReportVersion = "v201402"; + utilities.DownloadClientReport(query, DownloadFormat.GZIPPED_CSV.ToString(), filePath); + Console.WriteLine("Report was downloaded to '{0}'.", filePath); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to download report.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/Reporting/GetReportFields.cs b/examples/AdXBuyer/CSharp/v201402/Reporting/GetReportFields.cs new file mode 100644 index 00000000000..900eb455aa7 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/Reporting/GetReportFields.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example gets report fields. + /// + /// Tags: ReportDefinitionService.getReportFields + /// + public class GetReportFields : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetReportFields codeExample = new GetReportFields(); + Console.WriteLine(codeExample.Description); + try { + ReportDefinitionReportType reportType = (ReportDefinitionReportType) Enum.Parse( + typeof(ReportDefinitionReportType), "INSERT_REPORT_TYPE_HERE"); + codeExample.Run(new AdWordsUser(), reportType); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets report fields."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The report type to be run. + public void Run(AdWordsUser user, ReportDefinitionReportType reportType) { + // Get the ReportDefinitionService. + ReportDefinitionService reportDefinitionService = (ReportDefinitionService) user.GetService( + AdWordsService.v201402.ReportDefinitionService); + + try { + // Get the report fields. + ReportDefinitionField[] reportDefinitionFields = reportDefinitionService.getReportFields( + reportType); + if (reportDefinitionFields != null && reportDefinitionFields.Length > 0) { + // Display report fields. + Console.WriteLine("The report type '{0}' contains the following fields:", reportType); + + foreach (ReportDefinitionField reportDefinitionField in reportDefinitionFields) { + Console.Write("- {0} ({1})", reportDefinitionField.fieldName, + reportDefinitionField.fieldType); + if (reportDefinitionField.enumValues != null) { + Console.Write(" := [{0}]", String.Join(", ", reportDefinitionField.enumValues)); + } + Console.WriteLine(); + } + } else { + Console.WriteLine("This report type has no fields."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve fields for report type.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/Targeting/AddCampaignTargetingCriteria.cs b/examples/AdXBuyer/CSharp/v201402/Targeting/AddCampaignTargetingCriteria.cs new file mode 100644 index 00000000000..5feb72cacc8 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/Targeting/AddCampaignTargetingCriteria.cs @@ -0,0 +1,137 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example adds various types of targeting criteria to a campaign. + /// To get a list of campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignCriterionService.mutate + /// + public class AddCampaignTargetingCriteria : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddCampaignTargetingCriteria codeExample = new AddCampaignTargetingCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds various types of targeting criteria to a campaign. To " + + "get a list of campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to which targeting criteria + /// are added. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201402.CampaignCriterionService); + + // Create language criteria. + // See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + // for a detailed list of language codes. + Language language1 = new Language(); + language1.id = 1002; // French + CampaignCriterion languageCriterion1 = new CampaignCriterion(); + languageCriterion1.campaignId = campaignId; + languageCriterion1.criterion = language1; + + Language language2 = new Language(); + language2.id = 1005; // Japanese + CampaignCriterion languageCriterion2 = new CampaignCriterion(); + languageCriterion2.campaignId = campaignId; + languageCriterion2.criterion = language2; + + // Create location criteria. + // See http://code.google.com/apis/adwords/docs/appendix/countrycodes.html + // for a detailed list of country codes. + Location location1 = new Location(); + location1.id = 2840; // USA + CampaignCriterion locationCriterion1 = new CampaignCriterion(); + locationCriterion1.campaignId = campaignId; + locationCriterion1.criterion = location1; + + Location location2 = new Location(); + location2.id = 2392; // Japan + CampaignCriterion locationCriterion2 = new CampaignCriterion(); + locationCriterion2.campaignId = campaignId; + locationCriterion2.criterion = location2; + + // Add a negative campaign placement. + NegativeCampaignCriterion negativeCriterion = new NegativeCampaignCriterion(); + negativeCriterion.campaignId = campaignId; + + Placement placement = new Placement(); + placement.url = "http://mars.google.com"; + + negativeCriterion.criterion = placement; + + CampaignCriterion[] criteria = new CampaignCriterion[] {languageCriterion1, + languageCriterion2, locationCriterion1, locationCriterion2, negativeCriterion}; + + List operations = new List(); + + foreach (CampaignCriterion criterion in criteria) { + CampaignCriterionOperation operation = new CampaignCriterionOperation(); + operation.@operator = Operator.ADD; + operation.operand = criterion; + operations.Add(operation); + } + + try { + // Set the campaign targets. + CampaignCriterionReturnValue retVal = campaignCriterionService.mutate(operations.ToArray()); + + if (retVal != null && retVal.value != null) { + // Display campaign targets. + foreach (CampaignCriterion criterion in retVal.value) { + Console.WriteLine("Campaign criteria of type '{0}' was set to campaign with" + + " id = '{1}'.", criterion.criterion.CriterionType, criterion.campaignId); + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to set Campaign criteria.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/Targeting/GetCampaignTargetingCriteria.cs b/examples/AdXBuyer/CSharp/v201402/Targeting/GetCampaignTargetingCriteria.cs new file mode 100644 index 00000000000..67fd68d0507 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/Targeting/GetCampaignTargetingCriteria.cs @@ -0,0 +1,124 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example gets all targeting criteria for a campaign. To set + /// campaign targeting criteria, run AddCampaignTargetingCriteria.cs. To get + /// campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignCriterionService.get + /// + public class GetCampaignTargetingCriteria : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetCampaignTargetingCriteria codeExample = new GetCampaignTargetingCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all targeting criteria for a campaign. To set campaign " + + "targeting criteria, run AddCampaignTargetingCriteria.cs. To get campaigns, run " + + "GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign from which targeting + /// criteria are retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201402.CampaignCriterionService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "CriteriaType", "PlacementUrl"}; + + // Set the filters. + Predicate campaignPredicate = new Predicate(); + campaignPredicate.field = "CampaignId"; + campaignPredicate.@operator = PredicateOperator.EQUALS; + campaignPredicate.values = new string[] {campaignId.ToString()}; + + Predicate placementPredicate = new Predicate(); + placementPredicate.field = "CriteriaType"; + placementPredicate.@operator = PredicateOperator.EQUALS; + placementPredicate.values = new string[] {"PLACEMENT"}; + + selector.predicates = new Predicate[] {campaignPredicate, placementPredicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + CampaignCriterionPage page = new CampaignCriterionPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get all campaign targets. + page = campaignCriterionService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (CampaignCriterion campaignCriterion in page.entries) { + Placement placement = campaignCriterion.criterion as Placement; + + Console.WriteLine("{0}) Placement with ID {1} and url {2} was found.", i, + placement.id, placement.url); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of placements found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get campaign targeting criteria.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/Targeting/GetTargetableLanguagesAndCarriers.cs b/examples/AdXBuyer/CSharp/v201402/Targeting/GetTargetableLanguagesAndCarriers.cs new file mode 100644 index 00000000000..b3805f3e0de --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/Targeting/GetTargetableLanguagesAndCarriers.cs @@ -0,0 +1,99 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example illustrates how to retrieve all carriers and languages + /// available for targeting. + /// + /// Tags: ConstantDataService.getCarrierCriterion + /// Tags: ConstantDataService.getLanguageCriterion + /// + public class GetTargetableLanguagesAndCarriers : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetTargetableLanguagesAndCarriers codeExample = new GetTargetableLanguagesAndCarriers(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve all carriers and languages " + + "available for targeting."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ConstantDataService. + ConstantDataService constantDataService = (ConstantDataService) user.GetService( + AdWordsService.v201402.ConstantDataService); + + try { + // Get all carriers. + Carrier[] carriers = constantDataService.getCarrierCriterion(); + + // Display the results. + if (carriers != null) { + foreach (Carrier carrier in carriers) { + Console.WriteLine("Carrier name is '{0}', ID is {1} and country code is '{2}'.", + carrier.name, carrier.id, carrier.countryCode); + } + } else { + Console.WriteLine("No carriers were retrieved."); + } + + // Get all languages. + Language[] languages = constantDataService.getLanguageCriterion(); + + // Display the results. + if (languages != null) { + foreach (Language language in languages) { + Console.WriteLine("Language name is '{0}', ID is {1} and code is '{2}'.", + language.name, language.id, language.code); + } + } else { + Console.WriteLine("No languages were found."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get targetable carriers and languages.", + ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201402/Targeting/LookupLocation.cs b/examples/AdXBuyer/CSharp/v201402/Targeting/LookupLocation.cs new file mode 100644 index 00000000000..963e9a22212 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201402/Targeting/LookupLocation.cs @@ -0,0 +1,121 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 { + /// + /// This code example gets location criteria by name. + /// + /// Tags: LocationCriterionService.get + /// + public class LookupLocation : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + LookupLocation codeExample = new LookupLocation(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets location criteria by name."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the LocationCriterionService. + LocationCriterionService locationCriterionService = + (LocationCriterionService) user.GetService(AdWordsService.v201402. + LocationCriterionService); + + string[] locationNames = new string[] {"Paris", "Quebec", "Spain", "Deutschland"}; + + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "LocationName", "CanonicalName", "DisplayType", + "ParentLocations", "Reach", "TargetingStatus"}; + + // Location names must match exactly, only EQUALS and IN are supported. + Predicate predicate1 = new Predicate(); + predicate1.field = "LocationName"; + predicate1.@operator = PredicateOperator.IN; + predicate1.values = locationNames; + + // Set the locale of the returned location names. + Predicate predicate2 = new Predicate(); + predicate2.field = "Locale"; + predicate2.@operator = PredicateOperator.EQUALS; + predicate2.values = new string[] {"en"}; + + selector.predicates = new Predicate[] {predicate1, predicate2}; + + try { + // Make the get request. + LocationCriterion[] locationCriteria = locationCriterionService.get(selector); + + // Display the resulting location criteria. + foreach (LocationCriterion locationCriterion in locationCriteria) { + string parentLocations = ""; + if (locationCriterion.location != null && + locationCriterion.location.parentLocations != null) { + foreach (Location location in locationCriterion.location.parentLocations) { + parentLocations += GetLocationString(location) + ", "; + } + parentLocations.TrimEnd(',', ' '); + } else { + parentLocations = "N/A"; + } + Console.WriteLine("The search term '{0}' returned the location '{1}' of type '{2}' " + + "with parent locations '{3}', reach '{4}' and targeting status '{5}.", + locationCriterion.searchTerm, locationCriterion.location.locationName, + locationCriterion.location.displayType, parentLocations, locationCriterion.reach, + locationCriterion.location.targetingStatus); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get location criteria.", ex); + } + } + + /// + /// Gets a string representation for a location. + /// + /// The location + /// The string representation + public string GetLocationString(Location location) { + return string.Format("{0} ({1})", location.locationName, location.displayType); + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/AccountManagement/GetAccountChanges.cs b/examples/AdXBuyer/CSharp/v201406/AccountManagement/GetAccountChanges.cs new file mode 100644 index 00000000000..757dd42c631 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/AccountManagement/GetAccountChanges.cs @@ -0,0 +1,176 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example gets the changes in the account during the last 24 + /// hours. + /// + /// Tags: CustomerSyncService.get + /// + public class GetAccountChanges : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAccountChanges codeExample = new GetAccountChanges(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the changes in the account during the last 24 hours."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the CustomerSyncService. + CustomerSyncService customerSyncService = + (CustomerSyncService) user.GetService(AdWordsService.v201406. + CustomerSyncService); + + // The date time string should be of the form yyyyMMdd HHmmss zzz + string minDateTime = DateTime.Now.AddDays(-1).ToUniversalTime().ToString("yyyyMMdd HHmmss") + + " UTC"; + string maxDateTime = DateTime.Now.ToUniversalTime().ToString("yyyyMMdd HHmmss") + " UTC"; + + // Create date time range. + DateTimeRange dateTimeRange = new DateTimeRange(); + dateTimeRange.min = minDateTime; + dateTimeRange.max = maxDateTime; + + try { + // Create the selector. + CustomerSyncSelector selector = new CustomerSyncSelector(); + selector.dateTimeRange = dateTimeRange; + selector.campaignIds = GetAllCampaignIds(user); + + // Get all account changes for campaign. + CustomerChangeData accountChanges = customerSyncService.get(selector); + + // Display the changes. + if (accountChanges != null && accountChanges.changedCampaigns != null) { + Console.WriteLine("Displaying changes up to: {0}", accountChanges.lastChangeTimestamp); + foreach (CampaignChangeData campaignChanges in accountChanges.changedCampaigns) { + Console.WriteLine("Campaign with id \"{0}\" was changed:", campaignChanges.campaignId); + Console.WriteLine(" Campaign changed status: {0}", + campaignChanges.campaignChangeStatus); + if (campaignChanges.campaignChangeStatus != ChangeStatus.NEW) { + Console.WriteLine(" Added ad extensions: {0}", GetFormattedList( + campaignChanges.addedAdExtensions)); + Console.WriteLine(" Added campaign criteria: {0}", + GetFormattedList(campaignChanges.addedCampaignCriteria)); + Console.WriteLine(" Added campaign targeting: {0}", + campaignChanges.campaignTargetingChanged? "yes" : "no"); + Console.WriteLine(" Removed ad extensions: {0}", + GetFormattedList(campaignChanges.removedAdExtensions)); + Console.WriteLine(" Removed campaign criteria: {0}", + GetFormattedList(campaignChanges.removedAdExtensions)); + + if (campaignChanges.changedAdGroups != null) { + foreach (AdGroupChangeData adGroupChanges in campaignChanges.changedAdGroups) { + Console.WriteLine(" Ad group with id \"{0}\" was changed:", + adGroupChanges.adGroupId); + Console.WriteLine(" Ad group changed status: {0}", + adGroupChanges.adGroupChangeStatus); + if (adGroupChanges.adGroupChangeStatus != ChangeStatus.NEW) { + Console.WriteLine(" Ads changed: {0}", + GetFormattedList(adGroupChanges.changedAds)); + Console.WriteLine(" Criteria changed: {0}", + GetFormattedList(adGroupChanges.changedCriteria)); + Console.WriteLine(" Criteria removed: {0}", + GetFormattedList(adGroupChanges.removedCriteria)); + } + } + } + } + Console.WriteLine(); + } + } else { + Console.WriteLine("No account changes were found.");; + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get account changes.", ex); + } + } + + /// + /// Formats a list of ids as a comma separated string. + /// + /// The list of ids. + /// The comma separed formatted string, enclosed in square braces. + /// + private string GetFormattedList(long[] ids) { + StringBuilder builder = new StringBuilder(); + if (ids != null) { + foreach (long id in ids) { + builder.AppendFormat("{0}, ", id); + } + } + return "[" + builder.ToString().TrimEnd(',', ' ') + "]"; + } + + /// + /// Gets all campaign ids in the account. + /// + /// The user for which campaigns are retrieved. + /// The list of campaign ids. + private long[] GetAllCampaignIds(AdWordsUser user) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201406.CampaignService); + + List allCampaigns = new List(); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id"}; + + // Get all campaigns. + CampaignPage page = campaignService.get(selector); + + // Return the results. + if (page != null && page.entries != null) { + foreach (Campaign campaign in page.entries) { + allCampaigns.Add(campaign.id); + } + } + return allCampaigns.ToArray(); + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/AdvancedOperations/AddAdGroupBidModifier.cs b/examples/AdXBuyer/CSharp/v201406/AdvancedOperations/AddAdGroupBidModifier.cs new file mode 100644 index 00000000000..c8954aa1e16 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/AdvancedOperations/AddAdGroupBidModifier.cs @@ -0,0 +1,111 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example illustrates how to add ad group level mobile bid + /// modifier override. + /// + /// Tags: AdGroupBidModifierService.mutate + /// + public class AddAdGroupBidModifier : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAdGroupBidModifier codeExample = new AddAdGroupBidModifier(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + double bidModifier = double.Parse("INSERT_ADGROUP_BID_MODIFIER_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, bidModifier); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to add ad group level mobile bid modifier " + + "override."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the adgroup for which bid modifier is + /// set. + /// The mobile bid modifier for adgroup + public void Run(AdWordsUser user, long adGroupId, double bidModifier) { + // Get the AdGroupAdService. + AdGroupBidModifierService adGroupBidModifierService = + (AdGroupBidModifierService) user.GetService( + AdWordsService.v201406.AdGroupBidModifierService); + + // Mobile criterion ID. + long criterionId = 30001; + + + // Create the adgroup bid modifier. + AdGroupBidModifier adGroupBidModifier = new AdGroupBidModifier(); + adGroupBidModifier.bidModifier = bidModifier; + adGroupBidModifier.adGroupId = adGroupId; + + Platform platform = new Platform(); + platform.id = criterionId; + + adGroupBidModifier.criterion = platform; + + AdGroupBidModifierOperation operation = new AdGroupBidModifierOperation(); + operation.@operator = Operator.ADD; + operation.operand = adGroupBidModifier; + + + try { + // Add ad group level mobile bid modifier. + AdGroupBidModifierReturnValue retval = adGroupBidModifierService.mutate( + new AdGroupBidModifierOperation[] {operation}); + + // Display the results. + if (retval != null && retval.value != null && retval.value.Length > 0) { + AdGroupBidModifier newBidModifier = retval.value[0]; + Console.WriteLine("AdGroup ID {0}, Criterion ID {1} was updated with ad group level " + + "modifier: {2}", newBidModifier.adGroupId, newBidModifier.criterion.id, + newBidModifier.bidModifier); + } else { + Console.WriteLine("No bid modifiers were added to the adgroup."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add bid modifiers to adgroup.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/AdvancedOperations/GetAdGroupBidModifiers.cs b/examples/AdXBuyer/CSharp/v201406/AdvancedOperations/GetAdGroupBidModifiers.cs new file mode 100644 index 00000000000..5d7f58676e7 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/AdvancedOperations/GetAdGroupBidModifiers.cs @@ -0,0 +1,122 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example illustrates how to retrieve ad group level mobile bid + /// modifiers for a campaign. + /// + /// Tags: AdGroupBidModifierService.get + /// + public class GetAdGroupBidModifiers : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAdGroupBidModifiers codeExample = new GetAdGroupBidModifiers(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve ad group level mobile bid " + + "modifiers for a campaign."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which ads are added. + /// + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupAdService. + AdGroupBidModifierService adGroupBidModifierService = + (AdGroupBidModifierService) user.GetService( + AdWordsService.v201406.AdGroupBidModifierService); + + const int PAGE_SIZE = 500; + + // Get all ad group bid modifiers for the campaign. + Selector selector = new Selector(); + selector.fields = new String[] {"CampaignId", "AdGroupId", "BidModifier", "BidModifierSource", + "CriteriaType", "Id"}; + + Predicate predicate = new Predicate(); + predicate.field = "CampaignId"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] {campaignId.ToString()}; + selector.predicates = new Predicate[] {predicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = PAGE_SIZE; + + AdGroupBidModifierPage page = new AdGroupBidModifierPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the campaigns. + page = adGroupBidModifierService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroupBidModifier adGroupBidModifier in page.entries) { + string bidModifier = (adGroupBidModifier.bidModifierSpecified)? + adGroupBidModifier.bidModifier.ToString() : "UNSET"; + Console.WriteLine("{0}) Campaign ID {1}, AdGroup ID {2}, Criterion ID {3} has " + + "ad group level modifier: {4} and source = {5}.", + i + 1, adGroupBidModifier.campaignId, + adGroupBidModifier.adGroupId, adGroupBidModifier.criterion.id, bidModifier, + adGroupBidModifier.bidModifierSource); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of adgroup bid modifiers found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve adgroup bid modifiers.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/AdvancedOperations/UploadOfflineConversions.cs b/examples/AdXBuyer/CSharp/v201406/AdvancedOperations/UploadOfflineConversions.cs new file mode 100644 index 00000000000..0b3098b4f7a --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/AdvancedOperations/UploadOfflineConversions.cs @@ -0,0 +1,139 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example imports offline conversion values for specific clicks to + /// your account. To get Google Click ID for a click, run + /// CLICK_PERFORMANCE_REPORT. + /// + /// Tags: ConversionTrackerService.mutate, OfflineConversionFeedService.mutate + /// + public class UploadOfflineConversions : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + string conversionName = "INSERT_CONVERSION_NAME_HERE"; + // GCLID needs to be newer than 30 days. + string gClId = "INSERT_GOOGLE_CLICK_ID_HERE"; + // The conversion time should be higher than the click time. + string conversionTime = "INSERT_CONVERSION_TIME_HERE"; + double conversionValue = double.Parse("INSERT_CONVERSION_VALUE_HERE"); + + UploadOfflineConversions codeExample = new UploadOfflineConversions(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser(), conversionName, gClId, conversionTime, conversionValue); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example imports offline conversion values for specific clicks to " + + "your account. To get Google Click ID for a click, run CLICK_PERFORMANCE_REPORT."; + } + } + + /// + /// Runs the specified user. + /// + /// The user. + /// The name of the upload conversion to be + /// created. + /// The Google Click ID of the click for which offline + /// conversions are uploaded. + /// The conversion value to be uploaded. + /// + /// The conversion time, in yyyymmdd hhmmss + /// format. + public void Run(AdWordsUser user, String conversionName, String gClid, String conversionTime, + double conversionValue) { + // Get the ConversionTrackerService. + ConversionTrackerService conversionTrackerService = + (ConversionTrackerService) user.GetService( + AdWordsService.v201406.ConversionTrackerService); + + // Get the OfflineConversionFeedService. + OfflineConversionFeedService offlineConversionFeedService = + (OfflineConversionFeedService) user.GetService( + AdWordsService.v201406.OfflineConversionFeedService); + + const int VIEWTHROUGH_LOOKBACK_WINDOW = 30; + const int CTC_LOOKBACK_WINDOW = 90; + + try { + // Create an upload conversion. Once created, this entry will be visible + // under Tools and Analysis->Conversion and will have "Source = Import". + UploadConversion uploadConversion = new UploadConversion(); + uploadConversion.category = ConversionTrackerCategory.PAGE_VIEW; + uploadConversion.name = conversionName; + uploadConversion.viewthroughLookbackWindow = VIEWTHROUGH_LOOKBACK_WINDOW; + uploadConversion.ctcLookbackWindow = CTC_LOOKBACK_WINDOW; + + ConversionTrackerOperation uploadConversionOperation = new ConversionTrackerOperation(); + uploadConversionOperation.@operator = Operator.ADD; + uploadConversionOperation.operand = uploadConversion; + + ConversionTrackerReturnValue conversionTrackerRetval = conversionTrackerService.mutate( + new ConversionTrackerOperation[] {uploadConversionOperation}); + + UploadConversion newUploadConversion = (UploadConversion) conversionTrackerRetval.value[0]; + + Console.WriteLine("New upload conversion type with name = '{0}' and id = {1} was created.", + newUploadConversion.name, newUploadConversion.id); + + // Associate offline conversions with the upload conversion we created. + OfflineConversionFeed feed = new OfflineConversionFeed(); + feed.conversionName = conversionName; + feed.conversionTime = conversionTime; + feed.conversionValue = conversionValue; + feed.googleClickId = gClid; + + OfflineConversionFeedOperation offlineConversionOperation = + new OfflineConversionFeedOperation(); + offlineConversionOperation.@operator = Operator.ADD; + offlineConversionOperation.operand = feed; + + OfflineConversionFeedReturnValue offlineConversionRetval = + offlineConversionFeedService.mutate( + new OfflineConversionFeedOperation[] {offlineConversionOperation}); + + OfflineConversionFeed newFeed = offlineConversionRetval.value[0]; + + Console.WriteLine("Uploaded offline conversion value of {0} for Google Click ID = " + + "'{1}' to '{2}'.", newFeed.conversionValue, newFeed.googleClickId, + newFeed.conversionName); + } catch (Exception ex) { + throw new System.ApplicationException("Failed upload offline conversions.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/AdvancedOperations/UseSharedBiddingStrategy.cs b/examples/AdXBuyer/CSharp/v201406/AdvancedOperations/UseSharedBiddingStrategy.cs new file mode 100644 index 00000000000..a2ee41e5a50 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/AdvancedOperations/UseSharedBiddingStrategy.cs @@ -0,0 +1,209 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example adds a Shared Bidding Strategy and uses it to construct + /// a campaign. + /// + /// Tags: BiddingStrategyService.mutate + /// Tags: BudgetService.mutate, CampaignService.mutate + /// + public class UseSharedBiddingStrategy : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UseSharedBiddingStrategy codeExample = new UseSharedBiddingStrategy(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a Shared Bidding Strategy and uses it to construct " + + "a campaign."; + } + } + + /// + /// Runs the specified code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the services. + BiddingStrategyService biddingStrategyService = (BiddingStrategyService) user.GetService( + AdWordsService.v201406.BiddingStrategyService); + + BudgetService budgetService = (BudgetService) user.GetService( + AdWordsService.v201406.BudgetService); + + CampaignService campaignService = (CampaignService) user.GetService( + AdWordsService.v201406.CampaignService); + + String BIDDINGSTRATEGY_NAME = "Maximize Clicks " + ExampleUtilities.GetRandomString(); + const long BID_CEILING = 2000000; + const long SPEND_TARGET = 20000000; + + String BUDGET_NAME = "Shared Interplanetary Budget #" + ExampleUtilities.GetRandomString(); + const long BUDGET_AMOUNT = 30000000; + + String CAMPAIGN_NAME = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString(); + + try { + SharedBiddingStrategy sharedBiddingStrategy = CreateBiddingStrategy(biddingStrategyService, + BIDDINGSTRATEGY_NAME, BID_CEILING, SPEND_TARGET); + Console.WriteLine("Shared bidding strategy with name '{0}' and ID {1} of type {2} was " + + "created.", sharedBiddingStrategy.name, sharedBiddingStrategy.id, + sharedBiddingStrategy.biddingScheme.BiddingSchemeType); + + Budget sharedBudget = CreateSharedBudget(budgetService, BUDGET_NAME, BUDGET_AMOUNT); + + Campaign newCampaign = CreateCampaignWithBiddingStrategy(campaignService, CAMPAIGN_NAME, + sharedBiddingStrategy.id, sharedBudget.budgetId); + + Console.WriteLine("Campaign with name '{0}', ID {1} and bidding scheme ID {2} was " + + "created.", newCampaign.name, newCampaign.id, + newCampaign.biddingStrategyConfiguration.biddingStrategyId); + + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create campaign that uses shared " + + "bidding strategy.", ex); + } + } + + /// + /// Creates the shared bidding strategy. + /// + /// The bidding strategy service. + /// The bidding strategy name. + /// The bid ceiling. + /// The spend target. + /// The bidding strategy object. + private SharedBiddingStrategy CreateBiddingStrategy( + BiddingStrategyService biddingStrategyService, String name, long bidCeiling, + long spendTarget) { + // Create a shared bidding strategy. + SharedBiddingStrategy sharedBiddingStrategy = new SharedBiddingStrategy(); + sharedBiddingStrategy.name = name; + + TargetSpendBiddingScheme biddingScheme = new TargetSpendBiddingScheme(); + // Optionally set additional bidding scheme parameters. + biddingScheme.bidCeiling = new Money(); + biddingScheme.bidCeiling.microAmount = bidCeiling; + + biddingScheme.spendTarget = new Money(); + biddingScheme.spendTarget.microAmount = spendTarget; + + sharedBiddingStrategy.biddingScheme = biddingScheme; + + // Create operation. + BiddingStrategyOperation operation = new BiddingStrategyOperation(); + operation.@operator = Operator.ADD; + operation.operand = sharedBiddingStrategy; + + return biddingStrategyService.mutate(new BiddingStrategyOperation[] {operation}).value[0]; + } + + /// + /// Creates an explicit budget to be used only to create the Campaign. + /// + /// The budget service. + /// The budget name. + /// The budget amount. + /// The budget object. + private Budget CreateSharedBudget(BudgetService budgetService, String name, long amount) { + // Create a shared budget + Budget budget = new Budget(); + budget.name = name; + budget.period = BudgetBudgetPeriod.DAILY; + budget.amount = new Money(); + budget.amount.microAmount = amount; + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + budget.isExplicitlyShared = true; + + // Create operation. + BudgetOperation operation = new BudgetOperation(); + operation.operand = budget; + operation.@operator = Operator.ADD; + + // Make the mutate request. + return budgetService.mutate(new BudgetOperation[] {operation}).value[0]; + } + + /// + /// Creates the campaign with a shared bidding strategy. + /// + /// The campaign service. + /// The campaign name. + /// The bidding strategy id. + /// The shared budget id. + /// The campaign object. + private Campaign CreateCampaignWithBiddingStrategy(CampaignService campaignService, string name, + long biddingStrategyId, long sharedBudgetId) { + // Create campaign. + Campaign campaign = new Campaign(); + campaign.name = name; + campaign.advertisingChannelType = AdvertisingChannelType.SEARCH; + + // Set the budget. + campaign.budget = new Budget(); + campaign.budget.budgetId = sharedBudgetId; + + // Set bidding strategy (required). + BiddingStrategyConfiguration biddingStrategyConfiguration = + new BiddingStrategyConfiguration(); + biddingStrategyConfiguration.biddingStrategyId = biddingStrategyId; + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration; + + // Set keyword matching setting (required). + KeywordMatchSetting keywordMatchSetting = new KeywordMatchSetting(); + keywordMatchSetting.optIn = true; + campaign.settings = new Setting[] {keywordMatchSetting}; + + // Set network targeting (recommended). + NetworkSetting networkSetting = new NetworkSetting(); + networkSetting.targetGoogleSearch = true; + networkSetting.targetSearchNetwork = true; + networkSetting.targetContentNetwork = true; + campaign.networkSetting = networkSetting; + + // Create operation. + CampaignOperation operation = new CampaignOperation(); + operation.operand = campaign; + operation.@operator = Operator.ADD; + + return campaignService.mutate(new CampaignOperation[] {operation}).value[0]; + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/BasicOperations/AddAdGroupDemographicCriteria.cs b/examples/AdXBuyer/CSharp/v201406/BasicOperations/AddAdGroupDemographicCriteria.cs new file mode 100644 index 00000000000..913e8234cae --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/BasicOperations/AddAdGroupDemographicCriteria.cs @@ -0,0 +1,123 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example adds demographic target criteria to an ad group. To get + /// ad groups, run AddAdGroup.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class AddAdGroupDemographicCriteria : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAdGroupDemographicCriteria codeExample = new AddAdGroupDemographicCriteria(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds demographic target criteria to an ad group. To get ad " + + "groups, run AddAdGroup.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which criteria are + /// added. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201406.AdGroupCriterionService); + + // Create biddable ad group criterion for gender + Gender genderTarget = new Gender(); + // Criterion Id for male. The IDs can be found here + // https://developers.google.com/adwords/api/docs/appendix/genders + genderTarget.id = 10; + + BiddableAdGroupCriterion genderBiddableAdGroupCriterion = new BiddableAdGroupCriterion(); + genderBiddableAdGroupCriterion.adGroupId = adGroupId; + genderBiddableAdGroupCriterion.criterion = genderTarget; + + // Create negative ad group criterion for age range + AgeRange ageRangeNegative = new AgeRange(); + // Criterion Id for age 18 to 24. The IDs can be found here + // https://developers.google.com/adwords/api/docs/appendix/ages + + ageRangeNegative.id = 503001; + NegativeAdGroupCriterion ageRangeNegativeAdGroupCriterion = new NegativeAdGroupCriterion(); + ageRangeNegativeAdGroupCriterion.adGroupId = adGroupId; + ageRangeNegativeAdGroupCriterion.criterion = ageRangeNegative; + + // Create operations. + AdGroupCriterionOperation genderBiddableAdGroupCriterionOperation = + new AdGroupCriterionOperation(); + genderBiddableAdGroupCriterionOperation.operand = genderBiddableAdGroupCriterion; + genderBiddableAdGroupCriterionOperation.@operator = Operator.ADD; + + AdGroupCriterionOperation ageRangeNegativeAdGroupCriterionOperation = + new AdGroupCriterionOperation(); + ageRangeNegativeAdGroupCriterionOperation.operand = ageRangeNegativeAdGroupCriterion; + ageRangeNegativeAdGroupCriterionOperation.@operator = Operator.ADD; + + AdGroupCriterionOperation[] operations = new AdGroupCriterionOperation[] { + genderBiddableAdGroupCriterionOperation, ageRangeNegativeAdGroupCriterionOperation}; + + try { + // Add ad group criteria. + AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations); + + // Display ad group criteria. + if (result != null && result.value != null) { + foreach (AdGroupCriterion adGroupCriterionResult in result.value) { + Console.WriteLine("Ad group criterion with ad group id \"{0}\", criterion id " + + "\"{1}\", and type \"{2}\" was added.", adGroupCriterionResult.adGroupId, + adGroupCriterionResult.criterion.id, + adGroupCriterionResult.criterion.CriterionType); + } + } else { + Console.WriteLine("No ad group criteria were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create ad group criteria.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/BasicOperations/AddAdGroups.cs b/examples/AdXBuyer/CSharp/v201406/BasicOperations/AddAdGroups.cs new file mode 100644 index 00000000000..e269091d763 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/BasicOperations/AddAdGroups.cs @@ -0,0 +1,137 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example illustrates how to create ad groups. To create + /// campaigns, run AddCampaigns.cs. + /// + /// Tags: AdGroupService.mutate + /// + public class AddAdGroups : ExampleBase { + /// + /// Number of items being added / updated in this code example. + /// + const int NUM_ITEMS = 5; + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAdGroups codeExample = new AddAdGroups(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create ad groups. To create campaigns, " + + "run AddCampaigns.cs"; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to which ad groups are + /// added. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201406.AdGroupService); + + List operations = new List(); + + for (int i = 0; i < NUM_ITEMS; i++) { + // Create the ad group. + AdGroup adGroup = new AdGroup(); + adGroup.name = string.Format("Earth to Mars Cruises #{0}", + ExampleUtilities.GetRandomString()); + adGroup.status = AdGroupStatus.ENABLED; + adGroup.campaignId = campaignId; + + // Set the ad group bids. + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + + CpmBid cpmBid = new CpmBid(); + cpmBid.bid = new Money(); + cpmBid.bid.microAmount = 10000000; + + biddingConfig.bids = new Bids[] {cpmBid}; + + adGroup.biddingStrategyConfiguration = biddingConfig; + + // Optional: Set targeting restrictions. + // These setting only affect serving for the Display Network. + TargetingSetting targetingSetting = new TargetingSetting(); + + TargetingSettingDetail placementDetail = new TargetingSettingDetail(); + placementDetail.criterionTypeGroup = CriterionTypeGroup.PLACEMENT; + placementDetail.targetAll = true; + + TargetingSettingDetail verticalDetail = new TargetingSettingDetail(); + verticalDetail.criterionTypeGroup = CriterionTypeGroup.VERTICAL; + verticalDetail.targetAll = false; + + targetingSetting.details = new TargetingSettingDetail[] {placementDetail, verticalDetail}; + + adGroup.settings = new Setting[] {targetingSetting}; + + // Create the operation. + AdGroupOperation operation = new AdGroupOperation(); + operation.@operator = Operator.ADD; + operation.operand = adGroup; + + operations.Add(operation); + } + + try { + // Create the ad group. + AdGroupReturnValue retVal = adGroupService.mutate(operations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + foreach (AdGroup newAdGroup in retVal.value) { + Console.WriteLine("Ad group with id = '{0}' and name = '{1}' was created.", + newAdGroup.id, newAdGroup.name); + } + } else { + Console.WriteLine("No ad groups were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create ad groups.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/BasicOperations/AddCampaigns.cs b/examples/AdXBuyer/CSharp/v201406/BasicOperations/AddCampaigns.cs new file mode 100644 index 00000000000..091317239f6 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/BasicOperations/AddCampaigns.cs @@ -0,0 +1,173 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example adds campaigns. To get campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignService.mutate + /// + public class AddCampaigns : ExampleBase { + /// + /// Number of items being added / updated in this code example. + /// + const int NUM_ITEMS = 5; + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddCampaigns codeExample = new AddCampaigns(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds campaigns. To get campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the CampaignService. + BudgetService budgetService = + (BudgetService) user.GetService(AdWordsService.v201406.BudgetService); + + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201406.CampaignService); + + // Create the campaign budget. + Budget budget = new Budget(); + budget.name = "Interplanetary Cruise Budget #" + ExampleUtilities.GetRandomString(); + budget.period = BudgetBudgetPeriod.DAILY; + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + budget.amount = new Money(); + budget.amount.microAmount = 500000; + + BudgetOperation budgetOperation = new BudgetOperation(); + budgetOperation.@operator = Operator.ADD; + budgetOperation.operand = budget; + + try { + BudgetReturnValue budgetRetval = budgetService.mutate(new BudgetOperation[] {budgetOperation}); + budget = budgetRetval.value[0]; + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add shared budget.", ex); + } + + List operations = new List(); + + for (int i = 0; i < NUM_ITEMS; i++) { + // Create the campaign. + Campaign campaign = new Campaign(); + campaign.name = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString(); + campaign.status = CampaignStatus.PAUSED; + campaign.advertisingChannelType = AdvertisingChannelType.SEARCH; + + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + biddingConfig.biddingStrategyType = BiddingStrategyType.MANUAL_CPM; + + // Optional: also provide matching bidding scheme. + biddingConfig.biddingScheme = new ManualCpmBiddingScheme(); + + campaign.biddingStrategyConfiguration = biddingConfig; + + // Set the campaign budget. + campaign.budget = new Budget(); + campaign.budget.budgetId = budget.budgetId; + + // Set targetContentNetwork true. Other network targeting is not available + // for Ad Exchange Buyers. + campaign.networkSetting = new NetworkSetting(); + campaign.networkSetting.targetGoogleSearch = false; + campaign.networkSetting.targetSearchNetwork = false; + campaign.networkSetting.targetContentNetwork = true; + campaign.networkSetting.targetPartnerSearchNetwork = false; + + // Enable campaign for Real-time bidding. + RealTimeBiddingSetting rtbSetting = new RealTimeBiddingSetting(); + rtbSetting.optIn = true; + + // Set the campaign settings for near-exact and near-phrase matches. + KeywordMatchSetting keywordSetting = new KeywordMatchSetting(); + keywordSetting.optIn = false; + + campaign.settings = new Setting[] {rtbSetting, keywordSetting}; + + // Optional: Set the start date. + campaign.startDate = DateTime.Now.AddDays(1).ToString("yyyyMMdd"); + + // Optional: Set the end date. + campaign.endDate = DateTime.Now.AddYears(1).ToString("yyyyMMdd"); + + // Optional: Set the campaign ad serving optimization status. + campaign.adServingOptimizationStatus = AdServingOptimizationStatus.ROTATE; + + // Optional: Set the frequency cap. + FrequencyCap frequencyCap = new FrequencyCap(); + frequencyCap.impressions = 5; + frequencyCap.level = Level.ADGROUP; + frequencyCap.timeUnit = TimeUnit.DAY; + campaign.frequencyCap = frequencyCap; + + // Create the operation. + CampaignOperation operation = new CampaignOperation(); + operation.@operator = Operator.ADD; + operation.operand = campaign; + + operations.Add(operation); + } + + try { + // Add the campaign. + CampaignReturnValue retVal = campaignService.mutate(operations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + foreach (Campaign newCampaign in retVal.value) { + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was added.", + newCampaign.name, newCampaign.id); + } + } else { + Console.WriteLine("No campaigns were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add campaigns.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/BasicOperations/AddPlacements.cs b/examples/AdXBuyer/CSharp/v201406/BasicOperations/AddPlacements.cs new file mode 100644 index 00000000000..43cb93dd721 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/BasicOperations/AddPlacements.cs @@ -0,0 +1,122 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example adds placements to an ad group. To get ad groups, run + /// GetAdGroups.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class AddPlacements : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddPlacements codeExample = new AddPlacements(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds placements to an ad group. To get ad groups, run " + + "GetAdGroups.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which placements are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201406.AdGroupCriterionService); + + // Create the placement. + Placement placement1 = new Placement(); + placement1.url = "http://mars.google.com"; + + // Create biddable ad group criterion. + AdGroupCriterion placementCriterion1 = new BiddableAdGroupCriterion(); + placementCriterion1.adGroupId = adGroupId; + placementCriterion1.criterion = placement1; + + // Create the placement. + Placement placement2 = new Placement(); + placement2.url = "http://venus.google.com"; + + // Create biddable ad group criterion. + AdGroupCriterion placementCriterion2 = new BiddableAdGroupCriterion(); + placementCriterion2.adGroupId = adGroupId; + placementCriterion2.criterion = placement2; + + // Create the operations. + AdGroupCriterionOperation placementOperation1 = new AdGroupCriterionOperation(); + placementOperation1.@operator = Operator.ADD; + placementOperation1.operand = placementCriterion1; + + AdGroupCriterionOperation placementOperation2 = new AdGroupCriterionOperation(); + placementOperation2.@operator = Operator.ADD; + placementOperation2.operand = placementCriterion2; + + try { + // Create the placements. + AdGroupCriterionReturnValue retVal = adGroupCriterionService.mutate( + new AdGroupCriterionOperation[] {placementOperation1, placementOperation2}); + + // Display the results. + if (retVal != null && retVal.value != null) { + foreach (AdGroupCriterion adGroupCriterion in retVal.value) { + // If you are adding multiple type of criteria, then you may need to + // check for + // + // if (adGroupCriterion is Placement) { ... } + // + // to identify the criterion type. + Console.WriteLine("Placement with ad group id = '{0}, placement id = '{1}, url = " + + "'{2}' was created.", adGroupCriterion.adGroupId, + adGroupCriterion.criterion.id, (adGroupCriterion.criterion as Placement).url); + } + } else { + Console.WriteLine("No placements were added."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create placements.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/BasicOperations/AddThirdPartyRedirectAds.cs b/examples/AdXBuyer/CSharp/v201406/BasicOperations/AddThirdPartyRedirectAds.cs new file mode 100644 index 00000000000..283ad371a66 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/BasicOperations/AddThirdPartyRedirectAds.cs @@ -0,0 +1,155 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example adds third party redirect ads to an ad group. To get + /// ad groups, run GetAdGroups.cs. + /// + /// Tags: AdGroupAdService.mutate + /// + public class AddThirdPartyRedirectAds : ExampleBase { + /// + /// Number of items being added / updated in this code example. + /// + const int NUM_ITEMS = 5; + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddThirdPartyRedirectAds codeExample = new AddThirdPartyRedirectAds(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds third party redirect ads to an ad group. To get ad " + + "groups, run GetAdGroups.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which ads are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201406.AdGroupAdService); + + // Create standard third party redirect ad. + ThirdPartyRedirectAd standardAd = new ThirdPartyRedirectAd(); + standardAd.name = String.Format("Example third party ad #{0}", + ExampleUtilities.GetRandomString()); + standardAd.url = "http://www.example.com"; + + standardAd.dimensions = new Dimensions(); + standardAd.dimensions.height = 250; + standardAd.dimensions.width = 300; + + standardAd.snippet = ""; + + // DoubleClick Rich Media Expandable format ID. + standardAd.certifiedVendorFormatId = 232; + standardAd.isCookieTargeted = false; + standardAd.isUserInterestTargeted = false; + standardAd.isTagged = false; + standardAd.richMediaAdType = RichMediaAdRichMediaAdType.STANDARD; + + // Expandable Ad properties. + standardAd.expandingDirections = new ThirdPartyRedirectAdExpandingDirection[] { + ThirdPartyRedirectAdExpandingDirection.EXPANDING_UP, + ThirdPartyRedirectAdExpandingDirection.EXPANDING_DOWN + }; + + standardAd.adAttributes = new RichMediaAdAdAttribute[] { + RichMediaAdAdAttribute.ROLL_OVER_TO_EXPAND}; + + // Create in-stream third party redirect ad. + ThirdPartyRedirectAd inStreamAd = new ThirdPartyRedirectAd(); + inStreamAd.name = String.Format("Example third party ad #{0}", + ExampleUtilities.GetRandomString()); + inStreamAd.url = "http://www.example.com"; + // Set the duration to 15 secs. + inStreamAd.adDuration = 15000; + inStreamAd.sourceUrl = "http://ad.doubleclick.net/pfadx/N270.126913.6102203221521/B3876671.21;dcadv=2215309;sz=0x0;ord=%5btimestamp%5d;dcmt=text/xml"; + inStreamAd.certifiedVendorFormatId = 303; + inStreamAd.richMediaAdType = RichMediaAdRichMediaAdType.IN_STREAM_VIDEO; + + List operations = new List(); + + foreach (ThirdPartyRedirectAd redirectAd in new + ThirdPartyRedirectAd[] {standardAd, inStreamAd}) { + // Set the ad group id. + AdGroupAd adGroupAd = new AdGroupAd(); + adGroupAd.adGroupId = adGroupId; + adGroupAd.ad = redirectAd; + + // Create the operation. + AdGroupAdOperation operation = new AdGroupAdOperation(); + operation.@operator = Operator.ADD; + operation.operand = adGroupAd; + + operations.Add(operation); + } + + AdGroupAdReturnValue retVal = null; + + try { + // Create the ads + retVal = service.mutate(operations.ToArray()); + if (retVal != null && retVal.value != null) { + // If you are adding multiple type of Ads, then you may need to check + // for + // + // if (adGroupAd.ad is ThirdPartyRedirectAd) { ... } + // + // to identify the ad type. + foreach (AdGroupAd newAdGroupAd in retVal.value) { + Console.WriteLine("New third party redirect ad with url = \"{0}\" and id = {1}" + + " was created.", ((ThirdPartyRedirectAd) newAdGroupAd.ad).url, + newAdGroupAd.ad.id); + } + } else { + Console.WriteLine("No third party redirect ads were created."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create third party redirect ads.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/BasicOperations/GetAdGroups.cs b/examples/AdXBuyer/CSharp/v201406/BasicOperations/GetAdGroups.cs new file mode 100644 index 00000000000..0349940c8ac --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/BasicOperations/GetAdGroups.cs @@ -0,0 +1,113 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example illustrates how to retrieve all the ad groups for a + /// campaign. To create an ad group, run AddAdGroup.cs. + /// + /// Tags: AdGroupService.get + /// + public class GetAdGroups : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAdGroups codeExample = new GetAdGroups(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve all the ad groups for a " + + "campaign. To create an ad group, run AddAdGroup.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign for which ad groups are + /// retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201406.AdGroupService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Name"}; + + // Create the filters. + Predicate predicate = new Predicate(); + predicate.field = "CampaignId"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] {campaignId.ToString()}; + selector.predicates = new Predicate[] {predicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupPage page = new AdGroupPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the ad groups. + page = adGroupService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroup adGroup in page.entries) { + Console.WriteLine("{0}) Ad group name is '{1}' and id is {2}.", i + 1, adGroup.name, + adGroup.id); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of ad groups found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve ad groups.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/BasicOperations/GetCampaigns.cs b/examples/AdXBuyer/CSharp/v201406/BasicOperations/GetCampaigns.cs new file mode 100644 index 00000000000..f8a5fde1223 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/BasicOperations/GetCampaigns.cs @@ -0,0 +1,102 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example lists all campaigns. To add a campaign, run + /// AddCampaign.cs. + /// + /// Tags: CampaignService.get + /// + public class GetCampaigns : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetCampaigns codeExample = new GetCampaigns(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example lists all campaigns. To add a campaign, run AddCampaign.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201406.CampaignService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Name", "Status"}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + CampaignPage page = new CampaignPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the campaigns. + page = campaignService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (Campaign campaign in page.entries) { + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = '{3}'" + + " was found.", i + 1, campaign.id, campaign.name, campaign.status); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve campaigns", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/BasicOperations/GetCampaignsWithAwql.cs b/examples/AdXBuyer/CSharp/v201406/BasicOperations/GetCampaignsWithAwql.cs new file mode 100644 index 00000000000..7e4ab157874 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/BasicOperations/GetCampaignsWithAwql.cs @@ -0,0 +1,100 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example lists all campaigns using an AWQL query. See + /// https://developers.google.com/adwords/api/docs/guides/awql for AWQL + /// documentation. To add a campaign, run AddCampaign.cs. + /// + /// Tags: CampaignService.get + /// + public class GetCampaignsWithAwql : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetCampaignsWithAwql codeExample = new GetCampaignsWithAwql(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example lists all campaigns using an AWQL query. See " + + "https://developers.google.com/adwords/api/docs/guides/awql for AWQL documentation. " + + "To add a campaign, run AddCampaign.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201406.CampaignService); + + // Create the query. + string query = "SELECT Id, Name, Status ORDER BY Name"; + + int offset = 0; + int pageSize = 500; + + CampaignPage page = new CampaignPage(); + + try { + do { + string queryWithPaging = string.Format("{0} LIMIT {1}, {2}", query, offset, pageSize); + + // Get the campaigns. + page = campaignService.query(queryWithPaging); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (Campaign campaign in page.entries) { + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = '{3}'" + + " was found.", i + 1, campaign.id, campaign.name, campaign.status); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve campaigns", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/BasicOperations/GetPlacements.cs b/examples/AdXBuyer/CSharp/v201406/BasicOperations/GetPlacements.cs new file mode 100644 index 00000000000..f515195d843 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/BasicOperations/GetPlacements.cs @@ -0,0 +1,128 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example gets all placements in an account. To add placements, + /// run AddPlacements.cs. + /// + /// Tags: AdGroupCriterionService.get + /// + public class GetPlacements : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetPlacements codeExample = new GetPlacements(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all placements in an account. To add placements, run " + + "AddPlacements.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService( + AdWordsService.v201406.AdGroupCriterionService); + + // Create a selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "AdGroupId", "PlacementUrl"}; + + // Select only keywords. + Predicate predicate = new Predicate(); + predicate.field = "CriteriaType"; + predicate.@operator = PredicateOperator.EQUALS; + predicate.values = new string[] {"PLACEMENT"}; + selector.predicates = new Predicate[] {predicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupCriterionPage page = new AdGroupCriterionPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the keywords. + page = adGroupCriterionService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + + foreach (AdGroupCriterion adGroupCriterion in page.entries) { + bool isNegative = (adGroupCriterion is NegativeAdGroupCriterion); + + // If you are retrieving multiple type of criteria, then you may + // need to check for + // + // if (adGroupCriterion is Placement) { ... } + // + // to identify the criterion type. + Placement placement = (Placement) adGroupCriterion.criterion; + if (isNegative) { + Console.WriteLine("{0}) Negative placement with ad group ID = '{1}', placement " + + "ID = '{2}', and url = '{3}' was found.", i, adGroupCriterion.adGroupId, + placement.id, placement.url); + } else { + Console.WriteLine("{0}) Placement with ad group ID = '{1}', placement ID = '{2}' " + + "and url = '{3}' was found.", i, adGroupCriterion.adGroupId, + placement.id, placement.url); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of placements found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve placements."); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/BasicOperations/GetThirdPartyRedirectAds.cs b/examples/AdXBuyer/CSharp/v201406/BasicOperations/GetThirdPartyRedirectAds.cs new file mode 100644 index 00000000000..ded53834744 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/BasicOperations/GetThirdPartyRedirectAds.cs @@ -0,0 +1,142 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example retrieves all third party redirect ads given an existing + /// ad group. To add third party redirect ads to an existing ad group, run + /// AddThirdPartyRedirectAd.cs. + /// + /// Tags: AdGroupAdService.get + /// + public class GetThirdPartyRedirectAds : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetThirdPartyRedirectAds codeExample = new GetThirdPartyRedirectAds(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves all third party redirect ads given an existing ad " + + "group. To add third party redirect ads to an existing ad group, run " + + "AddThirdPartyRedirectAd.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group from which third party + /// redirect ads are retrieved. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201406.AdGroupAdService); + + // Create a selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "Status", "Url", "DisplayUrl", "RichMediaAdSnippet"}; + + // Set the sort order. + OrderBy orderBy = new OrderBy(); + orderBy.field = "Id"; + orderBy.sortOrder = SortOrder.ASCENDING; + selector.ordering = new OrderBy[] {orderBy}; + + // Restrict the fetch to only the selected ad group id. + Predicate adGroupPredicate = new Predicate(); + adGroupPredicate.field = "AdGroupId"; + adGroupPredicate.@operator = PredicateOperator.EQUALS; + adGroupPredicate.values = new string[] {adGroupId.ToString()}; + + // Retrieve only third party redirect ads. + Predicate typePredicate = new Predicate(); + typePredicate.field = "AdType"; + typePredicate.@operator = PredicateOperator.EQUALS; + typePredicate.values = new string[] {"THIRD_PARTY_REDIRECT_AD"}; + + // By default disabled ads aren't returned by the selector. To return + // them include the DISABLED status in the statuses field. + Predicate statusPredicate = new Predicate(); + statusPredicate.field = "Status"; + statusPredicate.@operator = PredicateOperator.IN; + + statusPredicate.values = new string[] {AdGroupAdStatus.ENABLED.ToString(), + AdGroupAdStatus.PAUSED.ToString(), AdGroupAdStatus.DISABLED.ToString()}; + + selector.predicates = new Predicate[] {adGroupPredicate, statusPredicate, typePredicate}; + + // Select the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupAdPage page = new AdGroupAdPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the third party redirect ads. + page = service.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + + foreach (AdGroupAd adGroupAd in page.entries) { + ThirdPartyRedirectAd thirdPartyRedirectAd = (ThirdPartyRedirectAd) adGroupAd.ad; + Console.WriteLine("{0}) Ad id is {1} and status is {2}", i, thirdPartyRedirectAd.id, + adGroupAd.status); + Console.WriteLine(" Url: {0}\n Display Url: {1}\n Snippet:{2}", + thirdPartyRedirectAd.url, thirdPartyRedirectAd.displayUrl, + thirdPartyRedirectAd.snippet); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of third party redirect ads found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get third party redirect ad(s).", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/BasicOperations/PauseAd.cs b/examples/AdXBuyer/CSharp/v201406/BasicOperations/PauseAd.cs new file mode 100644 index 00000000000..59bc7e8cbf3 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/BasicOperations/PauseAd.cs @@ -0,0 +1,101 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example pauses a given ad. To list all ads, run GetTextAds.cs. + /// + /// Tags: AdGroupAdService.mutate + /// + public class PauseAd : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + PauseAd codeExample = new PauseAd(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long adId = long.Parse("INSERT_AD_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, adId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example pauses a given ad. To list all ads, run GetTextAds.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the ad. + /// + /// Id of the ad to be paused. + public void Run(AdWordsUser user, long adGroupId, long adId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201406.AdGroupAdService); + + AdGroupAdStatus status = AdGroupAdStatus.PAUSED; + + // Create the ad group ad. + AdGroupAd adGroupAd = new AdGroupAd(); + adGroupAd.status = status; + adGroupAd.adGroupId = adGroupId; + + adGroupAd.ad = new Ad(); + adGroupAd.ad.id = adId; + + // Create the operation. + AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation(); + adGroupAdOperation.@operator = Operator.SET; + adGroupAdOperation.operand = adGroupAd; + + try { + // Update the ad. + AdGroupAdReturnValue retVal = service.mutate(new AdGroupAdOperation[]{adGroupAdOperation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupAd pausedAdGroupAd = retVal.value[0]; + Console.WriteLine("Ad with id \"{0}\" and ad group id \"{1}\"was paused.", + pausedAdGroupAd.ad.id, pausedAdGroupAd.adGroupId); + } else { + Console.WriteLine("No ads were paused."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to pause ad.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/BasicOperations/RemoveAd.cs b/examples/AdXBuyer/CSharp/v201406/BasicOperations/RemoveAd.cs new file mode 100644 index 00000000000..bc1eaf0494d --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/BasicOperations/RemoveAd.cs @@ -0,0 +1,103 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example removes an ad using the 'REMOVE' operator. To list ads, + /// run GetTextAds.cs. + /// + /// Tags: AdGroupAdService.mutate + /// + public class RemoveAd : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + RemoveAd codeExample = new RemoveAd(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long adId = long.Parse("INSERT_AD_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, adId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example removes an ad using the 'REMOVE' operator. To list ads, " + + "run GetTextAds.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the ad. + /// Id of the ad being removed. + public void Run(AdWordsUser user, long adGroupId, long adId) { + // Get the AdGroupAdService. + AdGroupAdService adGroupAdService = (AdGroupAdService) user.GetService( + AdWordsService.v201406.AdGroupAdService); + + // Since we do not need to update any ad-specific fields, it is enough to + // create the base type. + Ad ad = new Ad(); + ad.id = adId; + + // Create the ad group ad. + AdGroupAd adGroupAd = new AdGroupAd(); + adGroupAd.adGroupId = adGroupId; + + adGroupAd.ad = ad; + + // Create the operation. + AdGroupAdOperation operation = new AdGroupAdOperation(); + operation.operand = adGroupAd; + operation.@operator = Operator.REMOVE; + + try { + // Remove the ad. + AdGroupAdReturnValue retVal = adGroupAdService.mutate( + new AdGroupAdOperation[] {operation}); + + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupAd removedAdGroupAd = retVal.value[0]; + Console.WriteLine("Ad with id = \"{0}\" and type = \"{1}\" was removed.", + removedAdGroupAd.ad.id, removedAdGroupAd.ad.AdType); + } else { + Console.WriteLine("No ads were removed."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to remove ad.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/BasicOperations/RemoveAdGroup.cs b/examples/AdXBuyer/CSharp/v201406/BasicOperations/RemoveAdGroup.cs new file mode 100644 index 00000000000..29ea835c342 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/BasicOperations/RemoveAdGroup.cs @@ -0,0 +1,99 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example removes an ad group by setting the status to 'REMOVED'. + /// To get ad groups, run GetAdGroups.cs. + /// + /// Tags: AdGroupService.mutate + /// + public class RemoveAdGroup : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + RemoveAdGroup codeExample = new RemoveAdGroup(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example removes an ad group by setting the status to 'REMOVED'. " + + "To get ad groups, run GetAdGroups.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to be removed. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupService. + AdGroupService adGroupService = (AdGroupService) user.GetService( + AdWordsService.v201406.AdGroupService); + + // Create ad group with REMOVED status. + AdGroup adGroup = new AdGroup(); + adGroup.id = adGroupId; + + // When deleting an ad group, rename it to avoid name collisions with new + // adgroups. + adGroup.name = "Removed AdGroup - " + ExampleUtilities.GetRandomString(); + adGroup.status = AdGroupStatus.REMOVED; + + // Create the operation. + AdGroupOperation operation = new AdGroupOperation(); + operation.operand = adGroup; + operation.@operator = Operator.SET; + + try { + // Remove the ad group. + AdGroupReturnValue retVal = adGroupService.mutate(new AdGroupOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroup removedAdGroup = retVal.value[0]; + Console.WriteLine("Ad group with id = \"{0}\" was renamed to \"{1}\" and removed.", + removedAdGroup.id, removedAdGroup.name); + } else { + Console.WriteLine("No ad groups were removed."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to remove ad group.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/BasicOperations/RemoveCampaign.cs b/examples/AdXBuyer/CSharp/v201406/BasicOperations/RemoveCampaign.cs new file mode 100644 index 00000000000..e6a194bc105 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/BasicOperations/RemoveCampaign.cs @@ -0,0 +1,99 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example removes a campaign by setting the status to 'REMOVED'. + /// To get campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignService.mutate + /// + public class RemoveCampaign : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + RemoveCampaign codeExample = new RemoveCampaign(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example removes a campaign by setting the status to 'REMOVED'. " + + "To get campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to be removed. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignService. + CampaignService campaignService = (CampaignService) user.GetService( + AdWordsService.v201406.CampaignService); + + // Create campaign with REMOVED status. + Campaign campaign = new Campaign(); + campaign.id = campaignId; + + // When removing a campaign, rename it to avoid name collisions with new + // campaigns. + campaign.name = "Removed Campaign - " + ExampleUtilities.GetRandomString(); + campaign.status = CampaignStatus.REMOVED; + + // Create the operation. + CampaignOperation operation = new CampaignOperation(); + operation.operand = campaign; + operation.@operator = Operator.SET; + + try { + // Remove the campaign. + CampaignReturnValue retVal = campaignService.mutate(new CampaignOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + Campaign removedCampaign = retVal.value[0]; + Console.WriteLine("Campaign with id = \"{0}\" was renamed to \"{1}\" and removed.", + removedCampaign.id, removedCampaign.name); + } else { + Console.WriteLine("No campaigns were removed."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to remove campaign.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/BasicOperations/RemovePlacement.cs b/examples/AdXBuyer/CSharp/v201406/BasicOperations/RemovePlacement.cs new file mode 100644 index 00000000000..9b83f8361e1 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/BasicOperations/RemovePlacement.cs @@ -0,0 +1,103 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example deletes a placement using the 'REMOVE' operator. To get + /// placements, run GetPlacements.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class RemovePlacement : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + RemovePlacement codeExample = new RemovePlacement(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long placementId = long.Parse("INSERT_PLACEMENT_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, placementId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deletes a placement using the 'REMOVE' operator. To get " + + "placements, run GetPlacements.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the placement. + /// + /// Id of the placement to be deleted. + public void Run(AdWordsUser user, long adGroupId, long placementId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = (AdGroupCriterionService)user.GetService( + AdWordsService.v201406.AdGroupCriterionService); + + // Create base class criterion to avoid setting placement-specific fields. + Criterion criterion = new Criterion(); + criterion.id = placementId; + + // Create the ad group criterion. + BiddableAdGroupCriterion adGroupCriterion = new BiddableAdGroupCriterion(); + adGroupCriterion.adGroupId = adGroupId; + adGroupCriterion.criterion = criterion; + + // Create the operation. + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.operand = adGroupCriterion; + operation.@operator = Operator.REMOVE; + + try { + // Delete the placement. + AdGroupCriterionReturnValue retVal = adGroupCriterionService.mutate( + new AdGroupCriterionOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupCriterion deletedPlacement = retVal.value[0]; + Console.WriteLine("Placement with ad group id = \"{0}\" and id = \"{1}\" was deleted.", + deletedPlacement.adGroupId, deletedPlacement.criterion.id); + } else { + Console.WriteLine("No placement was deleted."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to delete placement.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/BasicOperations/UpdateAdGroup.cs b/examples/AdXBuyer/CSharp/v201406/BasicOperations/UpdateAdGroup.cs new file mode 100644 index 00000000000..be77478e32c --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/BasicOperations/UpdateAdGroup.cs @@ -0,0 +1,95 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example illustrates how to update an ad group, setting its + /// status to 'PAUSED'. To create an ad group, run AddAdGroup.cs. + /// + /// Tags: AdGroupService.mutate + /// + public class UpdateAdGroup : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdateAdGroup codeExample = new UpdateAdGroup(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to update an ad group, setting its status to " + + "'PAUSED'. To create an ad group, run AddAdGroup.cs"; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to be updated. + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201406.AdGroupService); + + // Create the ad group. + AdGroup adGroup = new AdGroup(); + adGroup.status = AdGroupStatus.PAUSED; + adGroup.id = adGroupId; + + // Create the operation. + AdGroupOperation operation = new AdGroupOperation(); + operation.@operator = Operator.SET; + operation.operand = adGroup; + + try { + // Update the ad group. + AdGroupReturnValue retVal = adGroupService.mutate(new AdGroupOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroup pausedAdGroup = retVal.value[0]; + Console.WriteLine("Ad group with id = '{0}' was successfully updated.", + pausedAdGroup.id); + } else { + Console.WriteLine("No ad groups were updated."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update ad group.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/BasicOperations/UpdateCampaign.cs b/examples/AdXBuyer/CSharp/v201406/BasicOperations/UpdateCampaign.cs new file mode 100644 index 00000000000..f09876e07ed --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/BasicOperations/UpdateCampaign.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example updates a campaign. To get campaigns, run + /// GetCampaigns.cs. + /// + /// Tags: CampaignService.mutate + /// + public class UpdateCampaign : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdateCampaign codeExample = new UpdateCampaign(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a campaign. To get campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to be updated. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignService. + CampaignService campaignService = + (CampaignService)user.GetService(AdWordsService.v201406.CampaignService); + + // Create the campaign. + Campaign campaign = new Campaign(); + campaign.id = campaignId; + campaign.status = CampaignStatus.PAUSED; + + // Create the operation. + CampaignOperation operation = new CampaignOperation(); + operation.@operator = Operator.SET; + operation.operand = campaign; + + try { + // Update the campaign. + CampaignReturnValue retVal = campaignService.mutate((new CampaignOperation[] {operation})); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + Campaign updatedCampaign = retVal.value[0]; + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was updated.", + updatedCampaign.name, updatedCampaign.id); + } else { + Console.WriteLine("No campaigns were updated."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update campaign.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/BasicOperations/UpdatePlacement.cs b/examples/AdXBuyer/CSharp/v201406/BasicOperations/UpdatePlacement.cs new file mode 100644 index 00000000000..babcccfc1f4 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/BasicOperations/UpdatePlacement.cs @@ -0,0 +1,122 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example updates the bid of a placement. To get placement, run + /// GetPlacements.cs. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class UpdatePlacement : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UpdatePlacement codeExample = new UpdatePlacement(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + long placementId = long.Parse("INSERT_PLACEMENT_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId, placementId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the bid of a placement. To get placement, run " + + "GetPlacements.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group that contains the placement. + /// + /// Id of the placement to be updated. + public void Run(AdWordsUser user, long adGroupId, long placementId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201406.AdGroupCriterionService); + + // Since we are not updating any placement-specific fields, it is enough to + // create a criterion object. + Criterion criterion = new Criterion(); + criterion.id = placementId; + + // Create ad group criterion. + BiddableAdGroupCriterion biddableAdGroupCriterion = new BiddableAdGroupCriterion(); + biddableAdGroupCriterion.adGroupId = adGroupId; + biddableAdGroupCriterion.criterion = criterion; + + // Create the bids. + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + CpmBid cpmBid = new CpmBid(); + cpmBid.bid = new Money(); + cpmBid.bid.microAmount = 1000000; + biddingConfig.bids = new Bids[] {cpmBid}; + + biddableAdGroupCriterion.biddingStrategyConfiguration = biddingConfig; + + // Create the operation. + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.@operator = Operator.SET; + operation.operand = biddableAdGroupCriterion; + + try { + // Update the placement. + AdGroupCriterionReturnValue retVal = + adGroupCriterionService.mutate(new AdGroupCriterionOperation[] {operation}); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + AdGroupCriterion adGroupCriterion = retVal.value[0]; + long bidAmount = 0; + foreach (Bids bids in (adGroupCriterion as BiddableAdGroupCriterion). + biddingStrategyConfiguration.bids) { + if (bids is CpmBid) { + bidAmount = (bids as CpmBid).bid.microAmount; + break; + } + } + Console.WriteLine("Placement with ad group id = '{0}', id = '{1}' was updated with " + + "bid amount = '{2}' micros.", adGroupCriterion.adGroupId, + adGroupCriterion.criterion.id, bidAmount); + } else { + Console.WriteLine("No placement was updated."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to update placement.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/CampaignManagement/AddPlacementsInBulk.cs b/examples/AdXBuyer/CSharp/v201406/CampaignManagement/AddPlacementsInBulk.cs new file mode 100644 index 00000000000..447f8415fd0 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/CampaignManagement/AddPlacementsInBulk.cs @@ -0,0 +1,172 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.RegularExpressions; +using System.Threading; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example shows how to add placements in bulk using the + /// MutateJobService. + /// + /// Tags: MutateJobService.mutate, MutateJobService.get + /// Tags: MutateJobService.getResult + /// + public class AddPlacementsInBulk : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddPlacementsInBulk codeExample = new AddPlacementsInBulk(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to add placements in bulk using the MutateJobService."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad groups to which placements are + /// added. + public void Run(AdWordsUser user, long adGroupId) { + // Get the MutateJobService. + MutateJobService mutateJobService = (MutateJobService) user.GetService( + AdWordsService.v201406.MutateJobService); + + const int RETRY_INTERVAL = 30; + const int RETRIES_COUNT = 30; + const int PLACEMENT_NUMBER = 100; + const string INDEX_REGEX = "operations\\[(\\d+)\\].operand"; + + List operations = new List(); + + // Create AdGroupCriterionOperation to add placements. + for (int i = 0; i < PLACEMENT_NUMBER; i++) { + Placement placement = new Placement(); + placement.url = "http://mars.google.com/" + i.ToString(); + + BiddableAdGroupCriterion criterion = new BiddableAdGroupCriterion(); + criterion.adGroupId = adGroupId; + criterion.criterion = placement; + + AdGroupCriterionOperation adGroupCriterionOperation = new AdGroupCriterionOperation(); + adGroupCriterionOperation.@operator = Operator.ADD; + adGroupCriterionOperation.operand = criterion; + + operations.Add(adGroupCriterionOperation); + } + + BulkMutateJobPolicy policy = new BulkMutateJobPolicy(); + // You can specify up to 3 job IDs that must successfully complete before + // this job can be processed. + policy.prerequisiteJobIds = new long[] {}; + + SimpleMutateJob job = mutateJobService.mutate(operations.ToArray(), policy); + + // Wait for the job to complete. + bool completed = false; + int retryCount = 0; + Console.WriteLine("Retrieving job status..."); + + while (completed == false && retryCount < RETRIES_COUNT) { + BulkMutateJobSelector selector = new BulkMutateJobSelector(); + selector.jobIds = new long[] {job.id}; + + try { + Job[] allJobs = mutateJobService.get(selector); + if (allJobs != null && allJobs.Length > 0) { + job = (SimpleMutateJob) allJobs[0]; + if (job.status == BasicJobStatus.COMPLETED || job.status == BasicJobStatus.FAILED) { + completed = true; + break; + } else { + Console.WriteLine("{0}: Current status is {1}, waiting {2} seconds to retry...", + retryCount, job.status, RETRY_INTERVAL); + Thread.Sleep(RETRY_INTERVAL * 1000); + retryCount++; + } + } + } catch (Exception ex) { + throw new System.ApplicationException(string.Format("Failed to fetch simple mutate " + + "job with id = {0}.", job.id), ex); + } + } + + if (job.status == BasicJobStatus.COMPLETED) { + // Handle cases where the job completed. + + // Create the job selector. + BulkMutateJobSelector selector = new BulkMutateJobSelector(); + selector.jobIds = new long[] {job.id}; + + // Get the job results. + JobResult jobResult = mutateJobService.getResult(selector); + if (jobResult != null) { + SimpleMutateResult results = (SimpleMutateResult) jobResult.Item; + if (results != null) { + // Display the results. + if (results.results != null) { + for (int i = 0; i < results.results.Length; i++) { + Operand operand = results.results[i]; + Console.WriteLine("Operation {0} - {1}", i, (operand.Item is PlaceHolder) ? + "FAILED" : "SUCCEEDED"); + } + } + + // Display the errors. + if (results.errors != null) { + foreach (ApiError apiError in results.errors) { + Match match = Regex.Match(apiError.fieldPath, INDEX_REGEX, RegexOptions.IgnoreCase); + string index = (match.Success)? match.Groups[1].Value : "???"; + Console.WriteLine("Operation index {0} failed due to reason: '{1}', " + + "trigger: '{2}'", index, apiError.errorString, apiError.trigger); + } + } + } + } + Console.WriteLine("Job completed successfully!"); + } else if (job.status == BasicJobStatus.FAILED) { + // Handle the cases where job failed. + Console.WriteLine("Job failed with reason: " + job.failureReason); + } else if (job.status == BasicJobStatus.PROCESSING || job.status == BasicJobStatus.PENDING) { + // Handle the cases where job didn't complete after wait period. + Console.WriteLine("Job did not complete in {0} secconds.", RETRY_INTERVAL * RETRIES_COUNT); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/CampaignManagement/GetAllDisapprovedAds.cs b/examples/AdXBuyer/CSharp/v201406/CampaignManagement/GetAllDisapprovedAds.cs new file mode 100644 index 00000000000..55593b706d0 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/CampaignManagement/GetAllDisapprovedAds.cs @@ -0,0 +1,121 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example retrieves all the disapproved ads in a given campaign. + /// + /// Tags: AdGroupAdService.get + /// + public class GetAllDisapprovedAds : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAllDisapprovedAds codeExample = new GetAllDisapprovedAds(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves all the disapproved ads in a given campaign."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign for which disapproved ads + /// are retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201406.AdGroupAdService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "AdGroupCreativeApprovalStatus", + "AdGroupAdDisapprovalReasons"}; + + // Create the filter. + Predicate campaignPredicate = new Predicate(); + campaignPredicate.@operator = PredicateOperator.EQUALS; + campaignPredicate.field = "CampaignId"; + campaignPredicate.values = new string[] {campaignId.ToString()}; + + Predicate approvalPredicate = new Predicate(); + approvalPredicate.@operator = PredicateOperator.EQUALS; + approvalPredicate.field = "AdGroupCreativeApprovalStatus"; + approvalPredicate.values = new string[] {AdGroupAdApprovalStatus.DISAPPROVED.ToString()}; + + selector.predicates = new Predicate[] {campaignPredicate, approvalPredicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + AdGroupAdPage page = new AdGroupAdPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get the disapproved ads. + page = service.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroupAd adGroupAd in page.entries) { + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " + + "reason(s):", i, adGroupAd.ad.id); + foreach (string reason in adGroupAd.disapprovalReasons) { + Console.WriteLine(" {0}", reason); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get disapproved ads.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs b/examples/AdXBuyer/CSharp/v201406/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs new file mode 100644 index 00000000000..13484202918 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/CampaignManagement/GetAllDisapprovedAdsWihAwql.cs @@ -0,0 +1,108 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example retrieves all the disapproved ads in a given campaign + /// using AWQL. See https://developers.google.com/adwords/api/docs/guides/awql + /// for AWQL documentation. + /// + /// Tags: AdGroupAdService.get + /// + public class GetAllDisapprovedAdsWithAwql : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAllDisapprovedAdsWithAwql codeExample = new GetAllDisapprovedAdsWithAwql(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves all the disapproved ads in a given campaign using " + + "AWQL. See https://developers.google.com/adwords/api/docs/guides/awql for AWQL " + + "documentation."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign for which disapproved ads + /// are retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201406.AdGroupAdService); + + // Get all the disapproved ads for this campaign. + string query = string.Format("SELECT Id, AdGroupAdDisapprovalReasons WHERE " + + "CampaignId = {0} AND AdGroupCreativeApprovalStatus = DISAPPROVED ORDER BY Id", + campaignId); + + int offset = 0; + int pageSize = 500; + + AdGroupAdPage page = new AdGroupAdPage(); + + try { + do { + string queryWithPaging = string.Format("{0} LIMIT {1}, {2}", query, offset, pageSize); + + // Get the disapproved ads. + page = service.query(queryWithPaging); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (AdGroupAd adGroupAd in page.entries) { + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " + + "reason(s):", i, adGroupAd.ad.id); + foreach (string reason in adGroupAd.disapprovalReasons) { + Console.WriteLine(" {0}", reason); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get disapproved ads.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/ErrorHandling/HandlePartialFailures.cs b/examples/AdXBuyer/CSharp/v201406/ErrorHandling/HandlePartialFailures.cs new file mode 100644 index 00000000000..de4181eda28 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/ErrorHandling/HandlePartialFailures.cs @@ -0,0 +1,135 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example demonstrates how to handle partial failures. + /// + /// Tags: AdGroupCriterionService.mutate + /// + public class HandlePartialFailures : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + HandlePartialFailures codeExample = new HandlePartialFailures(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example demonstrates how to handle partial failures."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which keywords are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201406.AdGroupCriterionService); + + // Set partial failure mode for the service. + adGroupCriterionService.RequestHeader.partialFailure = true; + + List operations = new List(); + + // Create the placements. + string[] urls = new String[] {"http://mars.google.com", "http:/mars.google.com", + "mars.google.com"}; + + foreach (String url in urls) { + Placement placement = new Placement(); + placement.url = url; + + // Create biddable ad group criterion. + BiddableAdGroupCriterion placementBiddableAdGroupCriterion = new BiddableAdGroupCriterion(); + placementBiddableAdGroupCriterion.adGroupId = adGroupId; + placementBiddableAdGroupCriterion.criterion = placement; + + // Create the operation. + AdGroupCriterionOperation placementAdGroupCriterionOperation = + new AdGroupCriterionOperation(); + placementAdGroupCriterionOperation.operand = placementBiddableAdGroupCriterion; + placementAdGroupCriterionOperation.@operator = Operator.ADD; + operations.Add(placementAdGroupCriterionOperation); + } + + try { + // Create the placements. + AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations.ToArray()); + + // Display the results. + if (result != null && result.value != null) { + foreach (AdGroupCriterion adGroupCriterionResult in result.value) { + if (adGroupCriterionResult.criterion != null) { + Console.WriteLine("Placement with ad group id '{0}', and criterion " + + "id '{1}', and url '{2}' was added.\n", adGroupCriterionResult.adGroupId, + adGroupCriterionResult.criterion.id, + ((Placement) adGroupCriterionResult.criterion).url); + } + } + } else { + Console.WriteLine("No placements were added."); + } + + // Display the partial failure errors. + if (result != null && result.partialFailureErrors != null) { + foreach (ApiError apiError in result.partialFailureErrors) { + int operationIndex = ErrorUtilities.GetOperationIndex(apiError.fieldPath); + if (operationIndex != -1) { + AdGroupCriterion adGroupCriterion = operations[operationIndex].operand; + Console.WriteLine("Placement with ad group id '{0}' and url '{1}' " + + "triggered a failure for the following reason: '{2}'.\n", + adGroupCriterion.adGroupId, ((Placement) adGroupCriterion.criterion).url, + apiError.errorString); + } else { + Console.WriteLine("A failure for the following reason: '{0}' has occurred.\n", + apiError.errorString); + } + } + } + } catch (Exception e) { + throw new System.ApplicationException("Failed to add placements in partial failure mode.", + e); + } + } + } +} + diff --git a/examples/AdXBuyer/CSharp/v201406/ErrorHandling/HandlePolicyViolationError.cs b/examples/AdXBuyer/CSharp/v201406/ErrorHandling/HandlePolicyViolationError.cs new file mode 100644 index 00000000000..9d6cbb05ce8 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/ErrorHandling/HandlePolicyViolationError.cs @@ -0,0 +1,180 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example adds a text ad, and shows how to handle a policy + /// violation. + /// + /// Tags: AdGroupAdService.mutate + /// + public class HandlePolicyViolationError : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + HandlePolicyViolationError codeExample = new HandlePolicyViolationError(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a text ad, and shows how to handle a policy violation."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which ads are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + // Get the AdGroupAdService. + AdGroupAdService service = + (AdGroupAdService) user.GetService(AdWordsService.v201406.AdGroupAdService); + + // Create the third party redirect ad that violates a policy. + ThirdPartyRedirectAd redirectAd = new ThirdPartyRedirectAd(); + redirectAd.name = "Policy violation demo ad " + ExampleUtilities.GetRandomString(); + redirectAd.url = "gopher://gopher.google.com"; + redirectAd.dimensions = new Dimensions(); + redirectAd.dimensions.width = 300; + redirectAd.dimensions.height = 250; + + redirectAd.snippet = ""; + redirectAd.impressionBeaconUrl = "http://www.examples.com/beacon1"; + redirectAd.certifiedVendorFormatId = 119; + redirectAd.isCookieTargeted = false; + redirectAd.isUserInterestTargeted = false; + redirectAd.isTagged = false; + + AdGroupAd redirectAdGroupAd = new AdGroupAd(); + redirectAdGroupAd.adGroupId = adGroupId; + redirectAdGroupAd.ad = redirectAd; + + // Create the operations. + AdGroupAdOperation redirectAdOperation = new AdGroupAdOperation(); + redirectAdOperation.@operator = Operator.ADD; + redirectAdOperation.operand = redirectAdGroupAd; + + try { + AdGroupAdReturnValue retVal = null; + + // Setup two arrays, one to hold the list of all operations to be + // validated, and another to hold the list of operations that cannot be + // fixed after validation. + List allOperations = new List(); + List operationsToBeRemoved = new List(); + + allOperations.Add(redirectAdOperation); + + try { + // Validate the operations. + service.RequestHeader.validateOnly = true; + retVal = service.mutate(allOperations.ToArray()); + } catch (AdWordsApiException ex) { + ApiException innerException = ex.ApiException as ApiException; + if (innerException == null) { + throw new Exception("Failed to retrieve ApiError. See inner exception for more " + + "details.", ex); + } + + // Examine each ApiError received from the server. + foreach (ApiError apiError in innerException.errors) { + int index = ErrorUtilities.GetOperationIndex(apiError.fieldPath); + if (index == -1) { + // This API error is not associated with an operand, so we cannot + // recover from this error by removing one or more operations. + // Rethrow the exception for manual inspection. + throw; + } + + // Handle policy violation errors. + if (apiError is PolicyViolationError) { + PolicyViolationError policyError = (PolicyViolationError) apiError; + + if (policyError.isExemptable) { + // If the policy violation error is exemptable, add an exemption + // request. + List exemptionRequests = new List(); + if (allOperations[index].exemptionRequests != null) { + exemptionRequests.AddRange(allOperations[index].exemptionRequests); + } + + ExemptionRequest exemptionRequest = new ExemptionRequest(); + exemptionRequest.key = policyError.key; + exemptionRequests.Add(exemptionRequest); + allOperations[index].exemptionRequests = exemptionRequests.ToArray(); + } else { + // Policy violation error is not exemptable, remove this + // operation from the list of operations. + operationsToBeRemoved.Add(allOperations[index]); + } + } else { + // This is not a policy violation error, remove this operation + // from the list of operations. + operationsToBeRemoved.Add(allOperations[index]); + } + } + // Remove all operations that aren't exemptable. + foreach (AdGroupAdOperation operation in operationsToBeRemoved) { + allOperations.Remove(operation); + } + } + + if (allOperations.Count > 0) { + // Perform the operations exemptible of a policy violation. + service.RequestHeader.validateOnly = false; + retVal = service.mutate(allOperations.ToArray()); + + // Display the results. + if (retVal != null && retVal.value != null && retVal.value.Length > 0) { + foreach (AdGroupAd newAdGroupAd in retVal.value) { + Console.WriteLine("New ad with id = \"{0}\" and displayUrl = \"{1}\" was created.", + newAdGroupAd.ad.id, newAdGroupAd.ad.displayUrl); + } + } else { + Console.WriteLine("No ads were created."); + } + } else { + Console.WriteLine("There are no ads to create after policy violation checks."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to create ads.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/ErrorHandling/HandleRateExceededError.cs b/examples/AdXBuyer/CSharp/v201406/ErrorHandling/HandleRateExceededError.cs new file mode 100644 index 00000000000..5926f48b284 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/ErrorHandling/HandleRateExceededError.cs @@ -0,0 +1,204 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example shows how to handle RateExceededError in your + /// application. To trigger the rate exceeded error, this code example runs + /// 100 threads in parallel, each thread attempting to validate 100 keywords + /// in a single request. Note that spawning 100 parallel threads is for + /// illustrative purposes only, you shouldn't do this in your application. + /// + /// Tags: AdGroupAdService.mutate + /// + public class HandleRateExceededError: ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + HandleRateExceededError codeExample = new HandleRateExceededError(); + Console.WriteLine(codeExample.Description); + try { + long adGroupId = long.Parse("INSERT_ADGROUP_ID_HERE"); + codeExample.Run(new AdWordsUser(), adGroupId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to handle RateExceededError in your application. " + + "To trigger the rate exceeded error, this code example runs 100 threads in " + + "parallel, each thread attempting to validate 100 keywords in a single request. " + + "Note that spawning 100 parallel threads is for illustrative purposes only, you " + + "shouldn't do this in your application."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the ad group to which keywords are added. + /// + public void Run(AdWordsUser user, long adGroupId) { + const int NUM_THREADS = 100; + + // Increase the maximum number of parallel HTTP connections that .NET + // framework allows. By default, this is set to 2 by the .NET framework. + System.Net.ServicePointManager.DefaultConnectionLimit = NUM_THREADS; + + List threads = new List(); + + for (int i = 0; i < NUM_THREADS; i++) { + Thread thread = new Thread(new KeywordThread(user, i, adGroupId).Run); + threads.Add(thread); + } + + for (int i = 0; i < NUM_THREADS; i++) { + threads[i].Start(i); + } + + for (int i = 0; i < NUM_THREADS; i++) { + threads[i].Join(); + } + } + + /// + /// Thread class for validating keywords. + /// + class KeywordThread { + /// + /// Index of this thread, for identifying and debugging. + /// + int threadIndex; + + /// + /// The ad group id to which keywords are added. + /// + long adGroupId; + + /// + /// The AdWords user who owns this ad group. + /// + AdWordsUser user; + + /// + /// Number of keywords to be validated in each API call. + /// + const int NUM_KEYWORDS = 100; + + /// + /// Initializes a new instance of the class. + /// + /// Index of the thread. + /// The ad group id. + /// The AdWords user who owns the ad group. + public KeywordThread(AdWordsUser user, int threadIndex, long adGroupId) { + this.user = user; + this.threadIndex = threadIndex; + this.adGroupId = adGroupId; + } + + /// + /// Main method for the thread. + /// + /// The thread parameter. + public void Run(Object obj) { + // Create the operations. + List operations = new List(); + + for (int j = 0; j < NUM_KEYWORDS; j++) { + // Create the keyword. + Keyword keyword = new Keyword(); + keyword.text = "mars cruise thread " + threadIndex.ToString() + " seed " + j.ToString(); + keyword.matchType = KeywordMatchType.BROAD; + + // Create the biddable ad group criterion. + AdGroupCriterion keywordCriterion = new BiddableAdGroupCriterion(); + keywordCriterion.adGroupId = adGroupId; + keywordCriterion.criterion = keyword; + + // Create the operations. + AdGroupCriterionOperation keywordOperation = new AdGroupCriterionOperation(); + keywordOperation.@operator = Operator.ADD; + keywordOperation.operand = keywordCriterion; + + operations.Add(keywordOperation); + } + + // Get the AdGroupCriterionService. This should be done within the + // thread, since a service can only handle one outgoing HTTP request + // at a time. + AdGroupCriterionService service = (AdGroupCriterionService) user.GetService( + AdWordsService.v201406.AdGroupCriterionService); + service.RequestHeader.validateOnly = true; + int retryCount = 0; + const int NUM_RETRIES = 3; + try { + while (retryCount < NUM_RETRIES) { + try { + // Validate the keywords. + AdGroupCriterionReturnValue retval = service.mutate(operations.ToArray()); + break; + } catch (AdWordsApiException ex) { + // Handle API errors. + ApiException innerException = ex.ApiException as ApiException; + if (innerException == null) { + throw new Exception("Failed to retrieve ApiError. See inner exception for more " + + "details.", ex); + } + foreach (ApiError apiError in innerException.errors) { + if (!(apiError is RateExceededError)) { + // Rethrow any errors other than RateExceededError. + throw; + } + // Handle rate exceeded errors. + RateExceededError rateExceededError = (RateExceededError) apiError; + Console.WriteLine("Got Rate exceeded error - rate name = '{0}', scope = '{1}', " + + "retry After {2} seconds.", rateExceededError.rateScope, + rateExceededError.rateName, rateExceededError.retryAfterSeconds); + Thread.Sleep(rateExceededError.retryAfterSeconds * 1000); + retryCount = retryCount + 1; + } + } finally { + if (retryCount == NUM_RETRIES) { + throw new Exception(String.Format("Could not recover after making {0} attempts.", + retryCount)); + } + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to validate keywords.", ex); + } + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/Miscellaneous/GetAllVideosAndImages.cs b/examples/AdXBuyer/CSharp/v201406/Miscellaneous/GetAllVideosAndImages.cs new file mode 100644 index 00000000000..306f82c9176 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/Miscellaneous/GetAllVideosAndImages.cs @@ -0,0 +1,139 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example gets all videos and images. To upload video, see + /// http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. + /// To upload image, run UploadImage.cs. + /// + /// Tags: MediaService.get + /// + public class GetAllVideosAndImages : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetAllVideosAndImages codeExample = new GetAllVideosAndImages(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all videos and images. To upload video, see " + + "http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. To " + + "upload image, run UploadImage.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the MediaService. + MediaService mediaService = (MediaService) user.GetService( + AdWordsService.v201406.MediaService); + + // Create a selector. + Selector selector = new Selector(); + selector.fields = new string[] {"MediaId", "Width", "Height", "MimeType"}; + + // Set the filter. + Predicate predicate = new Predicate(); + predicate.@operator = PredicateOperator.IN; + predicate.field = "Type"; + predicate.values = new string[] {MediaMediaType.VIDEO.ToString(), + MediaMediaType.IMAGE.ToString()}; + + selector.predicates = new Predicate[] {predicate}; + + // Set selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + MediaPage page = new MediaPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + page = mediaService.get(selector); + + if (page != null && page.entries != null) { + int i = offset; + + foreach (Media media in page.entries) { + if (media is Video) { + Video video = (Video) media; + Console.WriteLine("{0}) Video with id \"{1}\" and name \"{2}\" was found.", + i, video.mediaId, video.name); + } else if (media is Image) { + Image image = (Image) media; + Dictionary dimensions = + CreateMediaDimensionMap(image.dimensions); + Console.WriteLine("{0}) Image with id '{1}', dimensions '{2}x{3}', and MIME type " + + "'{4}' was found.", i, image.mediaId, dimensions[MediaSize.FULL].width, + dimensions[MediaSize.FULL].height, image.mimeType); + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of images and videos found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get images and videos.", ex); + } + } + + /// + /// Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + /// + /// The array of Media_Size_DimensionsMapEntry to be + /// converted into a dictionary. + /// A dictionary with key as MediaSize, and value as Dimensions. + /// + private Dictionary CreateMediaDimensionMap( + Media_Size_DimensionsMapEntry[] dimensions) { + Dictionary mediaMap = new Dictionary(); + foreach (Media_Size_DimensionsMapEntry dimension in dimensions) { + mediaMap.Add(dimension.key, dimension.value); + } + return mediaMap; + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/Miscellaneous/UploadImage.cs b/examples/AdXBuyer/CSharp/v201406/Miscellaneous/UploadImage.cs new file mode 100644 index 00000000000..334088635f8 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/Miscellaneous/UploadImage.cs @@ -0,0 +1,106 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example uploads an image. To get images, run GetAllVideosAndImages.cs. + /// + /// Tags: MediaService.upload + /// + public class UploadImage : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + UploadImage codeExample = new UploadImage(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example uploads an image. To get images, run GetAllVideosAndImages.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the MediaService. + MediaService mediaService = (MediaService) user.GetService( + AdWordsService.v201406.MediaService); + + // Create the image. + Image image = new Image(); + image.data = MediaUtilities.GetAssetDataFromUrl("http://goo.gl/HJM3L"); + image.type = MediaMediaType.IMAGE; + + try { + // Upload the image. + Media[] result = mediaService.upload(new Media[] {image}); + + // Display the results. + if (result != null && result.Length > 0) { + Media newImage = result[0]; + Dictionary dimensions = + CreateMediaDimensionMap(newImage.dimensions); + Console.WriteLine("Image with id '{0}', dimensions '{1}x{2}', and MIME type '{3}'" + + " was uploaded.", newImage.mediaId, dimensions[MediaSize.FULL].width, + dimensions[MediaSize.FULL].height, newImage.mimeType); + } else { + Console.WriteLine("No images were uploaded."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to upload image.", ex); + } + } + + /// + /// Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + /// + /// The array of Media_Size_DimensionsMapEntry to be + /// converted into a dictionary. + /// A dictionary with key as MediaSize, and value as Dimensions. + /// + private Dictionary CreateMediaDimensionMap( + Media_Size_DimensionsMapEntry[] dimensions) { + Dictionary mediaMap = new Dictionary(); + foreach (Media_Size_DimensionsMapEntry dimension in dimensions) { + mediaMap.Add(dimension.key, dimension.value); + } + return mediaMap; + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/Optimization/GetPlacementIdeas.cs b/examples/AdXBuyer/CSharp/v201406/Optimization/GetPlacementIdeas.cs new file mode 100644 index 00000000000..b5ff24a0bc8 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/Optimization/GetPlacementIdeas.cs @@ -0,0 +1,122 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example retrieves urls that have content keywords related to a + /// given website. + /// + /// Tags: TargetingIdeaService.get + /// + public class GetPlacementIdeas : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetPlacementIdeas codeExample = new GetPlacementIdeas(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves urls that have content keywords related to a" + + " given website."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the TargetingIdeaService. + TargetingIdeaService targetingIdeaService = + (TargetingIdeaService) user.GetService(AdWordsService.v201406.TargetingIdeaService); + + // Create seed url. + string url = "mars.google.com"; + + // Create the selector. + TargetingIdeaSelector selector = new TargetingIdeaSelector(); + selector.requestType = RequestType.IDEAS; + selector.ideaType = IdeaType.PLACEMENT; + selector.requestedAttributeTypes = new AttributeType[] {AttributeType.CRITERION, + AttributeType.PLACEMENT_TYPE}; + + // Create related to url search parameter. + RelatedToUrlSearchParameter relatedToUrlSearchParameter = new RelatedToUrlSearchParameter(); + relatedToUrlSearchParameter.urls = new string[] {url}; + relatedToUrlSearchParameter.includeSubUrls = false; + selector.searchParameters = new SearchParameter[] {relatedToUrlSearchParameter}; + + // Set selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + TargetingIdeaPage page = new TargetingIdeaPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get placement ideas. + page = targetingIdeaService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + + foreach (TargetingIdea idea in page.entries) { + foreach (Type_AttributeMapEntry entry in idea.data) { + if (entry.key == AttributeType.CRITERION) { + CriterionAttribute placementAttribute = entry.value as CriterionAttribute; + Placement placement = (Placement) placementAttribute.value; + Console.WriteLine("Related placement urls were found at '{0}'.", + (placementAttribute.value as Placement).url); + } + } + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of related placements found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve related placements.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/Remarketing/AddAudience.cs b/examples/AdXBuyer/CSharp/v201406/Remarketing/AddAudience.cs new file mode 100644 index 00000000000..fe4666f3f23 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/Remarketing/AddAudience.cs @@ -0,0 +1,156 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example illustrates how to create a user list a.k.a. audience. + /// + /// Tags: UserListService.mutate + /// + public class AddAudience : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddAudience codeExample = new AddAudience(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to create a user list a.k.a. audience."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the UserListService. + AdwordsUserListService userListService = + (AdwordsUserListService) user.GetService(AdWordsService.v201406.AdwordsUserListService); + + // Get the ConversionTrackerService. + ConversionTrackerService conversionTrackerService = + (ConversionTrackerService)user.GetService(AdWordsService.v201406. + ConversionTrackerService); + + BasicUserList userList = new BasicUserList(); + userList.name = "Mars cruise customers #" + ExampleUtilities.GetRandomString(); + userList.description = "A list of mars cruise customers in the last year."; + userList.status = UserListMembershipStatus.OPEN; + userList.membershipLifeSpan = 365; + + UserListConversionType conversionType = new UserListConversionType(); + conversionType.name = userList.name; + userList.conversionTypes = new UserListConversionType[] {conversionType}; + + // Optional: Set the user list status. + userList.status = UserListMembershipStatus.OPEN; + + // Create the operation. + UserListOperation operation = new UserListOperation(); + operation.operand = userList; + operation.@operator = Operator.ADD; + + try { + // Add the user list. + UserListReturnValue retval = userListService.mutate(new UserListOperation[] {operation}); + + UserList[] userLists = null; + if (retval != null && retval.value != null) { + userLists = retval.value; + // Get all conversion snippets + List conversionIds = new List(); + foreach (BasicUserList newUserList in userLists) { + if (newUserList.conversionTypes != null) { + foreach (UserListConversionType newConversionType in newUserList.conversionTypes) { + conversionIds.Add(newConversionType.id.ToString()); + } + } + } + + Dictionary conversionsMap = + new Dictionary(); + + if (conversionIds.Count > 0) { + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id"}; + + Predicate conversionTypePredicate = new Predicate(); + conversionTypePredicate.field = "Id"; + conversionTypePredicate.@operator = PredicateOperator.IN; + conversionTypePredicate.values = conversionIds.ToArray(); + selector.predicates = new Predicate[] {conversionTypePredicate}; + + // Get all conversion trackers. + ConversionTrackerPage page = conversionTrackerService.get(selector); + + if (page != null && page.entries != null) { + foreach (ConversionTracker tracker in page.entries) { + conversionsMap[tracker.id] = tracker; + } + } + } + + // Display the results. + foreach (BasicUserList newUserList in userLists) { + Console.WriteLine("User list with name '{0}' and id '{1}' was added.", + newUserList.name, newUserList.id); + + // Display user list associated conversion code snippets. + if (newUserList.conversionTypes != null) { + foreach (UserListConversionType userListConversionType in + newUserList.conversionTypes) { + if (conversionsMap.ContainsKey(userListConversionType.id)) { + AdWordsConversionTracker conversionTracker = + (AdWordsConversionTracker) conversionsMap[userListConversionType.id]; + Console.WriteLine("Conversion type code snippet associated to the list:\n{0}\n", + conversionTracker.snippet); + } else { + throw new Exception("Failed to associate conversion type code snippet."); + } + } + } + } + } else { + Console.WriteLine("No user lists (a.k.a. audiences) were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add user lists (a.k.a. audiences).", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/Remarketing/AddConversionTracker.cs b/examples/AdXBuyer/CSharp/v201406/Remarketing/AddConversionTracker.cs new file mode 100644 index 00000000000..1f29ea882af --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/Remarketing/AddConversionTracker.cs @@ -0,0 +1,107 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example adds an AdWords conversion tracker. + /// + /// Tags: ConversionTrackerService.mutate + /// + public class AddConversionTracker : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddConversionTracker codeExample = new AddConversionTracker(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds an AdWords conversion tracker."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ConversionTrackerService. + ConversionTrackerService conversionTrackerService = + (ConversionTrackerService)user.GetService(AdWordsService.v201406. + ConversionTrackerService); + + // Create Adwords conversion tracker. + AdWordsConversionTracker conversionTracker = new AdWordsConversionTracker(); + conversionTracker.name = "Earth to Mars Cruises Conversion #" + + ExampleUtilities.GetRandomString(); + conversionTracker.category = ConversionTrackerCategory.DEFAULT; + conversionTracker.markupLanguage = AdWordsConversionTrackerMarkupLanguage.HTML; + conversionTracker.textFormat = AdWordsConversionTrackerTextFormat.HIDDEN; + + // Set optional fields. + conversionTracker.status = ConversionTrackerStatus.ENABLED; + conversionTracker.viewthroughLookbackWindow = 15; + conversionTracker.isProductAdsChargeable = true; + conversionTracker.productAdsChargeableConversionWindow = 15; + conversionTracker.conversionPageLanguage = "en"; + conversionTracker.backgroundColor = "#0000FF"; + conversionTracker.defaultRevenueValue = 23.41; + conversionTracker.alwaysUseDefaultRevenueValue = true; + + // Create the operation. + ConversionTrackerOperation operation = new ConversionTrackerOperation(); + operation.@operator = Operator.ADD; + operation.operand = conversionTracker; + + try { + // Add conversion tracker. + ConversionTrackerReturnValue retval = conversionTrackerService.mutate( + new ConversionTrackerOperation[] {operation}); + + // Display the results. + if (retval != null && retval.value != null && retval.value.Length > 0) { + ConversionTracker newConversionTracker = retval.value[0]; + Console.WriteLine("Conversion tracker with id '{0}', name '{1}', status '{2}', " + + "category '{3}' was added.", newConversionTracker.id, newConversionTracker.name, + newConversionTracker.status, newConversionTracker.category); + } else { + Console.WriteLine("No conversion trackers were added."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to add conversion tracker.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/Reporting/DownloadCriteriaReport.cs b/examples/AdXBuyer/CSharp/v201406/Reporting/DownloadCriteriaReport.cs new file mode 100644 index 00000000000..757bfed77ea --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/Reporting/DownloadCriteriaReport.cs @@ -0,0 +1,114 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util.Reports; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example gets and downloads a criteria Ad Hoc report from an XML + /// report definition. + /// + public class DownloadCriteriaReport : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DownloadCriteriaReport codeExample = new DownloadCriteriaReport(); + Console.WriteLine(codeExample.Description); + try { + string fileName = "INSERT_FILE_NAME_HERE"; + codeExample.Run(new AdWordsUser(), fileName); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets and downloads a criteria Ad Hoc report from an XML report " + + "definition."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The file to which the report is downloaded. + /// + public void Run(AdWordsUser user, string fileName) { + ReportDefinition definition = new ReportDefinition(); + + definition.reportName = "Last 7 days CRITERIA_PERFORMANCE_REPORT"; + definition.reportType = ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT; + definition.downloadFormat = DownloadFormat.GZIPPED_CSV; + definition.dateRangeType = ReportDefinitionDateRangeType.LAST_7_DAYS; + + // Create selector. + Selector selector = new Selector(); + selector.fields = new string[] {"CampaignId", "AdGroupId", "Id", "CriteriaType", "Criteria", + "CriteriaDestinationUrl", "Clicks", "Impressions", "Cost"}; + + Predicate predicate = new Predicate(); + predicate.field = "Status"; + predicate.@operator = PredicateOperator.IN; + predicate.values = new string[] {"ENABLED", "PAUSED"}; + selector.predicates = new Predicate[] {predicate}; + + definition.selector = selector; + definition.includeZeroImpressions = true; + + string filePath = ExampleUtilities.GetHomeDir() + Path.DirectorySeparatorChar + fileName; + + try { + // If you know that your report is small enough to fit in memory, then + // you can instead use + // ReportUtilities utilities = new ReportUtilities(user); + // utilities.ReportVersion = "v201406"; + // ClientReport report = utilities.GetClientReport(definition); + // + // // Get the text report directly if you requested a text format + // // (e.g. xml) + // string reportText = report.Text; + // + // // Get the binary report if you requested a binary format + // // (e.g. gzip) + // byte[] reportBytes = report.Contents; + // + // // Deflate a zipped binary report for further processing. + // string deflatedReportText = Encoding.UTF8.GetString( + // MediaUtilities.DeflateGZipData(report.Contents)); + ReportUtilities utilities = new ReportUtilities(user); + utilities.ReportVersion = "v201406"; + utilities.DownloadClientReport(definition, filePath); + Console.WriteLine("Report was downloaded to '{0}'.", filePath); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to download report.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/Reporting/DownloadCriteriaReportWithAwql.cs b/examples/AdXBuyer/CSharp/v201406/Reporting/DownloadCriteriaReportWithAwql.cs new file mode 100644 index 00000000000..4b079f6c82d --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/Reporting/DownloadCriteriaReportWithAwql.cs @@ -0,0 +1,99 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util.Reports; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example gets and downloads a criteria Ad Hoc report from an AWQL + /// query. See https://developers.google.com/adwords/api/docs/guides/awql for + /// AWQL documentation. + /// + public class DownloadCriteriaReportWithAwql : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + DownloadCriteriaReportWithAwql codeExample = new DownloadCriteriaReportWithAwql(); + Console.WriteLine(codeExample.Description); + try { + string fileName = "INSERT_FILE_NAME_HERE"; + codeExample.Run(new AdWordsUser(), fileName); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets and downloads a criteria Ad Hoc report from an AWQL " + + "query. See https://developers.google.com/adwords/api/docs/guides/awql for AWQL " + + "documentation."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The file to which the report is downloaded. + /// + public void Run(AdWordsUser user, string fileName) { + string query = "SELECT CampaignId, AdGroupId, Id, Criteria, CriteriaType, Impressions, " + + "Clicks, Cost FROM CRITERIA_PERFORMANCE_REPORT WHERE Status IN [ENABLED, PAUSED] " + + "DURING LAST_7_DAYS"; + + string filePath = ExampleUtilities.GetHomeDir() + Path.DirectorySeparatorChar + fileName; + + try { + // If you know that your report is small enough to fit in memory, then + // you can instead use + // ReportUtilities utilities = new ReportUtilities(user); + // utilities.ReportVersion = "v201406"; + // ClientReport report = utilities.GetClientReport(query, format); + // + // // Get the text report directly if you requested a text format + // // (e.g. xml) + // string reportText = report.Text; + // + // // Get the binary report if you requested a binary format + // // (e.g. gzip) + // byte[] reportBytes = report.Contents; + // + // // Deflate a zipped binary report for further processing. + // string deflatedReportText = Encoding.UTF8.GetString( + // MediaUtilities.DeflateGZipData(report.Contents)); + ReportUtilities utilities = new ReportUtilities(user); + utilities.ReportVersion = "v201406"; + utilities.DownloadClientReport(query, DownloadFormat.GZIPPED_CSV.ToString(), filePath); + Console.WriteLine("Report was downloaded to '{0}'.", filePath); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to download report.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/Reporting/GetReportFields.cs b/examples/AdXBuyer/CSharp/v201406/Reporting/GetReportFields.cs new file mode 100644 index 00000000000..7c2d4155c2e --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/Reporting/GetReportFields.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example gets report fields. + /// + /// Tags: ReportDefinitionService.getReportFields + /// + public class GetReportFields : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetReportFields codeExample = new GetReportFields(); + Console.WriteLine(codeExample.Description); + try { + ReportDefinitionReportType reportType = (ReportDefinitionReportType) Enum.Parse( + typeof(ReportDefinitionReportType), "INSERT_REPORT_TYPE_HERE"); + codeExample.Run(new AdWordsUser(), reportType); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets report fields."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// The report type to be run. + public void Run(AdWordsUser user, ReportDefinitionReportType reportType) { + // Get the ReportDefinitionService. + ReportDefinitionService reportDefinitionService = (ReportDefinitionService) user.GetService( + AdWordsService.v201406.ReportDefinitionService); + + try { + // Get the report fields. + ReportDefinitionField[] reportDefinitionFields = reportDefinitionService.getReportFields( + reportType); + if (reportDefinitionFields != null && reportDefinitionFields.Length > 0) { + // Display report fields. + Console.WriteLine("The report type '{0}' contains the following fields:", reportType); + + foreach (ReportDefinitionField reportDefinitionField in reportDefinitionFields) { + Console.Write("- {0} ({1})", reportDefinitionField.fieldName, + reportDefinitionField.fieldType); + if (reportDefinitionField.enumValues != null) { + Console.Write(" := [{0}]", String.Join(", ", reportDefinitionField.enumValues)); + } + Console.WriteLine(); + } + } else { + Console.WriteLine("This report type has no fields."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to retrieve fields for report type.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/Targeting/AddCampaignTargetingCriteria.cs b/examples/AdXBuyer/CSharp/v201406/Targeting/AddCampaignTargetingCriteria.cs new file mode 100644 index 00000000000..685ed2cbdd4 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/Targeting/AddCampaignTargetingCriteria.cs @@ -0,0 +1,137 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example adds various types of targeting criteria to a campaign. + /// To get a list of campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignCriterionService.mutate + /// + public class AddCampaignTargetingCriteria : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + AddCampaignTargetingCriteria codeExample = new AddCampaignTargetingCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds various types of targeting criteria to a campaign. To " + + "get a list of campaigns, run GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign to which targeting criteria + /// are added. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201406.CampaignCriterionService); + + // Create language criteria. + // See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + // for a detailed list of language codes. + Language language1 = new Language(); + language1.id = 1002; // French + CampaignCriterion languageCriterion1 = new CampaignCriterion(); + languageCriterion1.campaignId = campaignId; + languageCriterion1.criterion = language1; + + Language language2 = new Language(); + language2.id = 1005; // Japanese + CampaignCriterion languageCriterion2 = new CampaignCriterion(); + languageCriterion2.campaignId = campaignId; + languageCriterion2.criterion = language2; + + // Create location criteria. + // See http://code.google.com/apis/adwords/docs/appendix/countrycodes.html + // for a detailed list of country codes. + Location location1 = new Location(); + location1.id = 2840; // USA + CampaignCriterion locationCriterion1 = new CampaignCriterion(); + locationCriterion1.campaignId = campaignId; + locationCriterion1.criterion = location1; + + Location location2 = new Location(); + location2.id = 2392; // Japan + CampaignCriterion locationCriterion2 = new CampaignCriterion(); + locationCriterion2.campaignId = campaignId; + locationCriterion2.criterion = location2; + + // Add a negative campaign placement. + NegativeCampaignCriterion negativeCriterion = new NegativeCampaignCriterion(); + negativeCriterion.campaignId = campaignId; + + Placement placement = new Placement(); + placement.url = "http://mars.google.com"; + + negativeCriterion.criterion = placement; + + CampaignCriterion[] criteria = new CampaignCriterion[] {languageCriterion1, + languageCriterion2, locationCriterion1, locationCriterion2, negativeCriterion}; + + List operations = new List(); + + foreach (CampaignCriterion criterion in criteria) { + CampaignCriterionOperation operation = new CampaignCriterionOperation(); + operation.@operator = Operator.ADD; + operation.operand = criterion; + operations.Add(operation); + } + + try { + // Set the campaign targets. + CampaignCriterionReturnValue retVal = campaignCriterionService.mutate(operations.ToArray()); + + if (retVal != null && retVal.value != null) { + // Display campaign targets. + foreach (CampaignCriterion criterion in retVal.value) { + Console.WriteLine("Campaign criteria of type '{0}' was set to campaign with" + + " id = '{1}'.", criterion.criterion.CriterionType, criterion.campaignId); + } + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to set Campaign criteria.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/Targeting/GetCampaignTargetingCriteria.cs b/examples/AdXBuyer/CSharp/v201406/Targeting/GetCampaignTargetingCriteria.cs new file mode 100644 index 00000000000..fcca2a0cdf9 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/Targeting/GetCampaignTargetingCriteria.cs @@ -0,0 +1,124 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example gets all targeting criteria for a campaign. To set + /// campaign targeting criteria, run AddCampaignTargetingCriteria.cs. To get + /// campaigns, run GetCampaigns.cs. + /// + /// Tags: CampaignCriterionService.get + /// + public class GetCampaignTargetingCriteria : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetCampaignTargetingCriteria codeExample = new GetCampaignTargetingCriteria(); + Console.WriteLine(codeExample.Description); + try { + long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE"); + codeExample.Run(new AdWordsUser(), campaignId); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all targeting criteria for a campaign. To set campaign " + + "targeting criteria, run AddCampaignTargetingCriteria.cs. To get campaigns, run " + + "GetCampaigns.cs."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + /// Id of the campaign from which targeting + /// criteria are retrieved. + public void Run(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201406.CampaignCriterionService); + + // Create the selector. + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "CriteriaType", "PlacementUrl"}; + + // Set the filters. + Predicate campaignPredicate = new Predicate(); + campaignPredicate.field = "CampaignId"; + campaignPredicate.@operator = PredicateOperator.EQUALS; + campaignPredicate.values = new string[] {campaignId.ToString()}; + + Predicate placementPredicate = new Predicate(); + placementPredicate.field = "CriteriaType"; + placementPredicate.@operator = PredicateOperator.EQUALS; + placementPredicate.values = new string[] {"PLACEMENT"}; + + selector.predicates = new Predicate[] {campaignPredicate, placementPredicate}; + + // Set the selector paging. + selector.paging = new Paging(); + + int offset = 0; + int pageSize = 500; + + CampaignCriterionPage page = new CampaignCriterionPage(); + + try { + do { + selector.paging.startIndex = offset; + selector.paging.numberResults = pageSize; + + // Get all campaign targets. + page = campaignCriterionService.get(selector); + + // Display the results. + if (page != null && page.entries != null) { + int i = offset; + foreach (CampaignCriterion campaignCriterion in page.entries) { + Placement placement = campaignCriterion.criterion as Placement; + + Console.WriteLine("{0}) Placement with ID {1} and url {2} was found.", i, + placement.id, placement.url); + i++; + } + } + offset += pageSize; + } while (offset < page.totalNumEntries); + Console.WriteLine("Number of placements found: {0}", page.totalNumEntries); + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get campaign targeting criteria.", ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/Targeting/GetTargetableLanguagesAndCarriers.cs b/examples/AdXBuyer/CSharp/v201406/Targeting/GetTargetableLanguagesAndCarriers.cs new file mode 100644 index 00000000000..df51d7b7a5d --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/Targeting/GetTargetableLanguagesAndCarriers.cs @@ -0,0 +1,99 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example illustrates how to retrieve all carriers and languages + /// available for targeting. + /// + /// Tags: ConstantDataService.getCarrierCriterion + /// Tags: ConstantDataService.getLanguageCriterion + /// + public class GetTargetableLanguagesAndCarriers : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + GetTargetableLanguagesAndCarriers codeExample = new GetTargetableLanguagesAndCarriers(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example illustrates how to retrieve all carriers and languages " + + "available for targeting."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the ConstantDataService. + ConstantDataService constantDataService = (ConstantDataService) user.GetService( + AdWordsService.v201406.ConstantDataService); + + try { + // Get all carriers. + Carrier[] carriers = constantDataService.getCarrierCriterion(); + + // Display the results. + if (carriers != null) { + foreach (Carrier carrier in carriers) { + Console.WriteLine("Carrier name is '{0}', ID is {1} and country code is '{2}'.", + carrier.name, carrier.id, carrier.countryCode); + } + } else { + Console.WriteLine("No carriers were retrieved."); + } + + // Get all languages. + Language[] languages = constantDataService.getLanguageCriterion(); + + // Display the results. + if (languages != null) { + foreach (Language language in languages) { + Console.WriteLine("Language name is '{0}', ID is {1} and code is '{2}'.", + language.name, language.id, language.code); + } + } else { + Console.WriteLine("No languages were found."); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get targetable carriers and languages.", + ex); + } + } + } +} diff --git a/examples/AdXBuyer/CSharp/v201406/Targeting/LookupLocation.cs b/examples/AdXBuyer/CSharp/v201406/Targeting/LookupLocation.cs new file mode 100644 index 00000000000..1659b5e1da1 --- /dev/null +++ b/examples/AdXBuyer/CSharp/v201406/Targeting/LookupLocation.cs @@ -0,0 +1,121 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 { + /// + /// This code example gets location criteria by name. + /// + /// Tags: LocationCriterionService.get + /// + public class LookupLocation : ExampleBase { + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + LookupLocation codeExample = new LookupLocation(); + Console.WriteLine(codeExample.Description); + try { + codeExample.Run(new AdWordsUser()); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example. {0}", + ExampleUtilities.FormatException(ex)); + } + } + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets location criteria by name."; + } + } + + /// + /// Runs the code example. + /// + /// The AdWords user. + public void Run(AdWordsUser user) { + // Get the LocationCriterionService. + LocationCriterionService locationCriterionService = + (LocationCriterionService) user.GetService(AdWordsService.v201406. + LocationCriterionService); + + string[] locationNames = new string[] {"Paris", "Quebec", "Spain", "Deutschland"}; + + Selector selector = new Selector(); + selector.fields = new string[] {"Id", "LocationName", "CanonicalName", "DisplayType", + "ParentLocations", "Reach", "TargetingStatus"}; + + // Location names must match exactly, only EQUALS and IN are supported. + Predicate predicate1 = new Predicate(); + predicate1.field = "LocationName"; + predicate1.@operator = PredicateOperator.IN; + predicate1.values = locationNames; + + // Set the locale of the returned location names. + Predicate predicate2 = new Predicate(); + predicate2.field = "Locale"; + predicate2.@operator = PredicateOperator.EQUALS; + predicate2.values = new string[] {"en"}; + + selector.predicates = new Predicate[] {predicate1, predicate2}; + + try { + // Make the get request. + LocationCriterion[] locationCriteria = locationCriterionService.get(selector); + + // Display the resulting location criteria. + foreach (LocationCriterion locationCriterion in locationCriteria) { + string parentLocations = ""; + if (locationCriterion.location != null && + locationCriterion.location.parentLocations != null) { + foreach (Location location in locationCriterion.location.parentLocations) { + parentLocations += GetLocationString(location) + ", "; + } + parentLocations.TrimEnd(',', ' '); + } else { + parentLocations = "N/A"; + } + Console.WriteLine("The search term '{0}' returned the location '{1}' of type '{2}' " + + "with parent locations '{3}', reach '{4}' and targeting status '{5}.", + locationCriterion.searchTerm, locationCriterion.location.locationName, + locationCriterion.location.displayType, parentLocations, locationCriterion.reach, + locationCriterion.location.targetingStatus); + } + } catch (Exception ex) { + throw new System.ApplicationException("Failed to get location criteria.", ex); + } + } + + /// + /// Gets a string representation for a location. + /// + /// The location + /// The string representation + public string GetLocationString(Location location) { + return string.Format("{0} ({1})", location.locationName, location.displayType); + } + } +} diff --git a/examples/AdXBuyer/Vb/AdWords.Examples.VB.vbproj b/examples/AdXBuyer/Vb/AdWords.Examples.VB.vbproj new file mode 100644 index 00000000000..c5d11bb9d23 --- /dev/null +++ b/examples/AdXBuyer/Vb/AdWords.Examples.VB.vbproj @@ -0,0 +1,209 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {D64BB23B-38E7-4E7D-88AD-2D608C713F1C} + Exe + Google.Api.Ads.AdWords.Examples.VB.Program + + + Google.AdWords.Examples.VB + 512 + Console + v4.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + AnyCPU + + + pdbonly + false + true + true + bin\Release\ + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + + + + + + + + + + + + + + + + + + + {277404DB-A439-4450-B3A5-186294CDF245} + Common + + + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745} + AdWords + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/AdXBuyer/Vb/App.config b/examples/AdXBuyer/Vb/App.config new file mode 100644 index 00000000000..1ee298baf62 --- /dev/null +++ b/examples/AdXBuyer/Vb/App.config @@ -0,0 +1,192 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/AdXBuyer/Vb/ExampleBase.vb b/examples/AdXBuyer/Vb/ExampleBase.vb new file mode 100644 index 00000000000..bf0c13adad9 --- /dev/null +++ b/examples/AdXBuyer/Vb/ExampleBase.vb @@ -0,0 +1,33 @@ +' Copyright 2011, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB + ''' + ''' This abstract class represents a code example. + ''' + Public MustInherit Class ExampleBase + ''' + ''' Returns a description about the code example. + ''' + Public MustOverride ReadOnly Property Description() As String + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/ExampleUtilities.vb b/examples/AdXBuyer/Vb/ExampleUtilities.vb new file mode 100644 index 00000000000..8f50ac531e1 --- /dev/null +++ b/examples/AdXBuyer/Vb/ExampleUtilities.vb @@ -0,0 +1,109 @@ +' Copyright 2011, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports System +Imports System.Collections.Generic +Imports System.Reflection + +Namespace Google.Api.Ads.AdWords.Examples.VB + ''' + ''' Utility class for assisting in running code examples. + ''' + Public Class ExampleUtilities + ''' + ''' Gets the current user's home directory. + ''' + ''' The current user's home directory. + Public Shared Function GetHomeDir() As String + Return Environment.GetEnvironmentVariable("USERPROFILE") + End Function + + ''' + ''' Gets a random string. Used for generating unique strings for use with + ''' AdGroups, Campaigns, etc. + ''' + ''' The random string. + Public Shared Function GetRandomString() As String + Return String.Format("{0} - {1}", Guid.NewGuid, _ + DateTime.Now.ToString("yyyy-M-d H-m-s.ffffff")) + End Function + + ''' + ''' Gets the user inputs for running a code example in command line mode. + ''' + ''' The parameter names. + ''' A dictionary, with key as parameter name and value as + ''' parameter value. + Public Shared Function GetUserInputs(ByVal paramNames As String()) As _ + Dictionary(Of String, String) + Dim parameters As New Dictionary(Of String, String) + Dim paramName As String + For Each paramName In paramNames + Console.Write("Enter {0}: ", paramName) + parameters.Item(paramName) = Console.ReadLine + Next + Return parameters + End Function + + ''' + ''' Formats the exception as a printable message. + ''' + ''' The exception. + ''' The formatted exception string. + Public Shared Function FormatException(ByVal ex As Exception) As String + Dim messages As New List(Of String) + Dim rootEx As Exception = ex + Do While (Not rootEx Is Nothing) + messages.Add(String.Format("{0} ({1})\n\n{2}\n", rootEx.GetType.ToString, _ + rootEx.Message, rootEx.StackTrace)) + rootEx = rootEx.InnerException + Loop + Return String.Join("\nCaused by\n\n", messages.ToArray) + End Function + + ''' + ''' Gets the parameters required to run the code example. + ''' + ''' The method info for the code example's Run + ''' method. + ''' The list of parameters. + Public Shared Function GetParameters(ByVal methodInfo As MethodInfo) As List(Of Object) + Dim retval As New List(Of Object) + Dim paramInfos As ParameterInfo() = methodInfo.GetParameters + Dim i As Integer + For i = 1 To paramInfos.Length - 1 + Dim paramInfo As ParameterInfo = paramInfos(i) + Console.Write("Enter {0}: ", paramInfo.Name) + Dim value As String = Console.ReadLine + Dim objValue As Object = Nothing + If (paramInfo.ParameterType Is GetType(Long)) Then + objValue = Long.Parse(value) + ElseIf (paramInfo.ParameterType Is GetType(Double)) Then + objValue = Double.Parse(value) + ElseIf (paramInfo.ParameterType Is GetType(String)) Then + objValue = value + ElseIf (paramInfo.ParameterType.IsEnum) Then + objValue = [Enum].Parse(paramInfo.ParameterType, value) + Else + Throw New ApplicationException(("Unknown parameter type : " & _ + paramInfo.ParameterType.FullName)) + End If + retval.Add(objValue) + Next i + Return retval + End Function + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/Program.vb b/examples/AdXBuyer/Vb/Program.vb new file mode 100644 index 00000000000..2bcacbb1e63 --- /dev/null +++ b/examples/AdXBuyer/Vb/Program.vb @@ -0,0 +1,169 @@ +' Copyright 2011, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Net +Imports System.Reflection + +Namespace Google.Api.Ads.AdWords.Examples.VB + ''' + ''' The Main class for this application. + ''' + Class Program + ''' + ''' A flag to keep track of whether help message was shown earlier. + ''' + Private Shared helpShown As Boolean = False + + ''' + ''' A map to hold the code examples to be executed. + ''' + Private Shared codeExampleMap As List(Of KeyValuePair(Of String, ExampleBase)) = _ + New List(Of KeyValuePair(Of String, ExampleBase)) + + ''' + ''' Registers the code example. + ''' + ''' The code example name. + ''' The code example instance. + Private Shared Sub RegisterCodeExample(ByVal key As String, ByVal value As ExampleBase) + codeExampleMap.Add(New KeyValuePair(Of String, ExampleBase)(key, value)) + End Sub + + ''' + ''' Static constructor to initialize the code example map. + ''' + Shared Sub New() + Dim types As Type() = Assembly.GetExecutingAssembly.GetTypes + For Each type As Type In types + If (type.BaseType Is GetType(ExampleBase)) Then + RegisterCodeExample(type.FullName.Replace((GetType(Program).Namespace & "."), ""), _ + TryCast(Activator.CreateInstance(type), ExampleBase)) + End If + Next + End Sub + + ''' + ''' The main method. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + If (args.Length = 0) Then + ShowUsage() + Else + Dim user As New AdWordsUser + + For Each cmdArgs As String In args + Dim found As Boolean = False + For Each pair As KeyValuePair(Of String, ExampleBase) In codeExampleMap + If String.Compare(pair.Key, cmdArgs, True) = 0 Then + found = True + RunACodeExample(user, pair.Value) + Exit For + End If + Next + If (Not found) Then + ShowUsage() + End If + Next + End If + End Sub + + ''' + ''' Invokes the Run method of code example. + ''' + ''' The code example. + ''' The user. + Private Shared Sub InvokeRun(ByVal codeExample As Object, ByVal user As AdWordsUser) + codeExample.GetType.GetMethod("Run").Invoke(codeExample, GetParameters(user, codeExample)) + End Sub + + ''' + ''' Gets the description of the code example. + ''' + ''' The code example. + ''' The description + Private Shared Function GetDescription(ByVal codeExample As Object) As Object + Return codeExample.GetType.GetProperty("Description").GetValue(codeExample, Nothing) + End Function + + ''' + ''' Gets the parameters for running a code example. + ''' + ''' The user. + ''' The code example. + ''' The list of parameters. + Private Shared Function GetParameters(ByVal user As AdWordsUser, ByVal codeExample As Object) _ + As Object() + Dim methodInfo As MethodInfo = codeExample.GetType.GetMethod("Run") + Dim parameters As New List(Of Object) + parameters.Add(user) + parameters.AddRange(ExampleUtilities.GetParameters(methodInfo)) + Return parameters.ToArray + End Function + + ''' + ''' Runs a code example. + ''' + ''' The user whose credentials should be used for + ''' running the code example. + ''' The code example to run. + Private Shared Sub RunACodeExample(ByVal user As AdWordsUser, ByVal codeExample As Object) + Try + Console.WriteLine(GetDescription(codeExample)) + Program.InvokeRun(codeExample, user) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + Finally + Console.WriteLine("Press [Enter] to continue") + Console.ReadLine() + End Try + End Sub + + ''' + ''' Prints program usage message. + ''' + Private Shared Sub ShowUsage() + If Not helpShown Then + helpShown = True + Dim exeName As String = Path.GetFileName(Assembly.GetExecutingAssembly.Location) + + Console.WriteLine("Runs AdWords API code examples") + Console.WriteLine("Usage : {0} [flags]\n", exeName) + Console.WriteLine("Available flags\n") + Console.WriteLine("--help\t\t : Prints this help message.", exeName) + Console.WriteLine("--all\t\t : Run all code examples.", exeName) + Console.WriteLine("--v13all: Runs all v13 code examples.") + Console.WriteLine("--v201008all: Runs all v201008 code examples.") + + Console.WriteLine("\nexamplename1 [examplename1 ...] : Run specific code examples. " & _ + "Example name can be one of the following:", exeName) + + For Each pair As KeyValuePair(Of String, ExampleBase) In codeExampleMap + Console.WriteLine("{0} : {1}", pair.Key, pair.Value.Description) + Next + + Console.WriteLine("Press [Enter] to continue") + Console.ReadLine() + End If + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/AccountManagement/GetAccountChanges.vb b/examples/AdXBuyer/Vb/v201309/AccountManagement/GetAccountChanges.vb new file mode 100644 index 00000000000..f8dc457353b --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/AccountManagement/GetAccountChanges.vb @@ -0,0 +1,183 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Text + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example gets the changes in the account during the last 24 + ''' hours. + ''' + ''' Tags: CustomerSyncService.get + ''' + Public Class GetAccountChanges + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAccountChanges + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets the changes in the account during the last 24 hours." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the CustomerSyncService. + Dim customerSyncService As CustomerSyncService = user.GetService( _ + AdWordsService.v201309.CustomerSyncService) + + ' The date time string should be of the form yyyyMMdd HHmmss zzz. + Dim minDateTime As String = (DateTime.Now.AddDays(-1).ToUniversalTime.ToString( _ + "yyyyMMdd HHmmss") & " UTC") + Dim maxDateTime As String = (DateTime.Now.ToUniversalTime.ToString("yyyyMMdd HHmmss") & _ + " UTC") + + ' Create date time range. + Dim dateTimeRange As New DateTimeRange + dateTimeRange.min = minDateTime + dateTimeRange.max = maxDateTime + + Try + ' Create the selector. + Dim selector As New CustomerSyncSelector + selector.dateTimeRange = dateTimeRange + selector.campaignIds = GetAllCampaignIds(user) + + ' Get all account changes for campaign. + Dim accountChanges As CustomerChangeData = customerSyncService.get(selector) + + ' Display the changes. + If ((Not accountChanges Is Nothing) AndAlso _ + (Not accountChanges.changedCampaigns Is Nothing)) Then + Console.WriteLine("Displaying changes up to: {0}", accountChanges.lastChangeTimestamp) + + For Each campaignChanges As CampaignChangeData In accountChanges.changedCampaigns + Console.WriteLine("Campaign with id ""{0}"" was changed:", campaignChanges.campaignId) + Console.WriteLine(" Campaign changed status: {0}", _ + campaignChanges.campaignChangeStatus) + If (campaignChanges.campaignChangeStatus <> ChangeStatus.NEW) Then + Console.WriteLine(" Added ad extensions: {0}", _ + GetFormattedList(campaignChanges.addedAdExtensions)) + Console.WriteLine(" Added campaign criteria: {0}", _ + GetFormattedList(campaignChanges.addedCampaignCriteria)) + If (campaignChanges.campaignTargetingChanged) Then + Console.WriteLine(" Added campaign targeting: yes") + Else + Console.WriteLine(" Added campaign targeting: no") + End If + + Console.WriteLine(" Deleted ad extensions: {0}", _ + GetFormattedList(campaignChanges.deletedAdExtensions)) + Console.WriteLine(" Deleted campaign criteria: {0}", _ + GetFormattedList(campaignChanges.deletedCampaignCriteria)) + + If (Not campaignChanges.changedAdGroups Is Nothing) Then + For Each adGroupChanges As AdGroupChangeData In campaignChanges.changedAdGroups + Console.WriteLine(" Ad group with id ""{0}"" was changed:", _ + adGroupChanges.adGroupId) + Console.WriteLine(" Ad group changed status: {0}", _ + adGroupChanges.adGroupChangeStatus) + If (adGroupChanges.adGroupChangeStatus <> ChangeStatus.NEW) Then + Console.WriteLine(" Ads changed: {0}", _ + GetFormattedList(adGroupChanges.changedAds)) + Console.WriteLine(" Criteria changed: {0}", _ + GetFormattedList(adGroupChanges.changedCriteria)) + Console.WriteLine(" Criteria deleted: {0}", _ + GetFormattedList(adGroupChanges.deletedCriteria)) + End If + Next + End If + End If + Console.WriteLine() + Next + Else + Console.WriteLine("No account changes were found.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to get account changes.", ex) + End Try + End Sub + + ''' + ''' Formats a list of ids as a comma separated string. + ''' + ''' The list of ids. + ''' The comma separed formatted string, enclosed in square braces. + ''' + Private Function GetFormattedList(ByVal ids As Long()) As String + Dim builder As New StringBuilder + If (Not ids Is Nothing) Then + For Each id As Long In ids + builder.AppendFormat("{0}, ", id) + Next + End If + Return ("[" & builder.ToString.TrimEnd(New Char() {","c, " "c}) & "]") + End Function + + ''' + ''' Gets all campaign ids in the account. + ''' + ''' The user for which campaigns are retrieved. + ''' The list of campaign ids. + Private Function GetAllCampaignIds(ByVal user As AdWordsUser) As Long() + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201309.CampaignService) + + Dim allCampaigns As New List(Of Long) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id"} + + ' Get all campaigns. + Dim page As CampaignPage = campaignService.get(selector) + + ' Return the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + For Each campaign As Campaign In page.entries + allCampaigns.Add(campaign.id) + Next + End If + Return allCampaigns.ToArray + End Function + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/AdvancedOperations/AddAdGroupBidModifier.vb b/examples/AdXBuyer/Vb/v201309/AdvancedOperations/AddAdGroupBidModifier.vb new file mode 100644 index 00000000000..ceaeb70039d --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/AdvancedOperations/AddAdGroupBidModifier.vb @@ -0,0 +1,111 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: thagikura@gmail.com (Takeshi Hagikura) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example illustrates how to add ad group level mobile bid + ''' modifier override. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class AddAdGroupBidModifier + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAdGroupBidModifier + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim bidModifier As Double = Double.Parse("INSERT_ADGROUP_BID_MODIFIER_HERE") + codeExample.Run(New AdWordsUser, adGroupId, bidModifier) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to add ad group level mobile bid" & _ + " modifier override." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the adgroup for which bid modifier is + ''' set. + ''' The mobile bid modifier for adgroup + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal bidModifier As Double) + ' Get the AdGroupBidModifierService. + Dim adGroupBidModifierService As AdGroupBidModifierService = user.GetService( _ + AdWordsService.v201309.AdGroupBidModifierService) + + ' Mobile criterion ID. + Dim criterionId As Long = 30001 + + ' Create the adgroup bid modifier. + Dim adGroupBidModifier As New AdGroupBidModifier() + adGroupBidModifier.bidModifier = bidModifier + adGroupBidModifier.adGroupId = adGroupId + + Dim platform As New Platform() + platform.id = criterionId + + adGroupBidModifier.criterion = platform + + Dim operation As New AdGroupBidModifierOperation() + operation.operator = [Operator].ADD + operation.operand = adGroupBidModifier + + Try + ' Add ad group level mobile bid modifier. + Dim retval As AdGroupBidModifierReturnValue = adGroupBidModifierService.mutate( _ + New AdGroupBidModifierOperation() {operation}) + + ' Display the results. + If Not retval Is Nothing AndAlso Not retval.value Is Nothing AndAlso _ + retval.value.Length > 0 Then + Dim newBidModifier As AdGroupBidModifier = retval.value(0) + Console.WriteLine("AdGroup ID {1}, Criterion ID {2} was updated with ad group " & _ + "level modifier: {3}", newBidModifier.adGroupId, newBidModifier.criterion.id, _ + newBidModifier.bidModifier) + Else + Console.WriteLine("No bid modifiers were added to the adgroup.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add bid modifiers to adgroup.", ex) + End Try + End Sub + End Class + +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/AdvancedOperations/GetAdGroupBidModifiers.vb b/examples/AdXBuyer/Vb/v201309/AdvancedOperations/GetAdGroupBidModifiers.vb new file mode 100644 index 00000000000..08ced7dcca1 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/AdvancedOperations/GetAdGroupBidModifiers.vb @@ -0,0 +1,125 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example illustrates how to retrieve ad group level mobile bid + ''' modifiers for a campaign. + ''' + ''' AdGroupBidModifierService.get + ''' + Public Class GetAdGroupBidModifiers + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAdGroupBidModifiers + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to retrieve ad group level mobile bid" & _ + " modifiers for a campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which adgroup bid + ''' modifiers are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupBidModifierService. + Dim adGroupBidModifierService As AdGroupBidModifierService = user.GetService( _ + AdWordsService.v201309.AdGroupBidModifierService) + + Const PAGE_SIZE As Integer = 500 + + ' Get all ad group bid modifiers for the campaign. + Dim selector As New Selector() + selector.fields = New String() {"CampaignId", "AdGroupId", "BidModifier", _ + "BidModifierSource", "CriteriaType", "Id"} + + Dim predicate As New Predicate() + predicate.field = "CampaignId" + predicate.[operator] = PredicateOperator.EQUALS + predicate.values = New String() {campaignId.ToString()} + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging() + + Dim offset As Integer = 0 + Dim pageSize As Integer = PAGE_SIZE + + Dim page As New AdGroupBidModifierPage() + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the campaigns. + page = adGroupBidModifierService.get(selector) + + ' Display the results. + If (Not page Is Nothing) AndAlso (Not page.entries Is Nothing) Then + Dim i As Integer = offset + For Each adGroupBidModifier As AdGroupBidModifier In page.entries + Dim bidModifier As String = "" + If adGroupBidModifier.bidModifierSpecified Then + bidModifier = adGroupBidModifier.bidModifier.ToString() + Else + bidModifier = "UNSET" + End If + Console.WriteLine("{0}) Campaign ID {1}, AdGroup ID {2}, Criterion ID {3} has " & _ + "ad group level modifier: {4}, source = {5}.", _ + i + 1, adGroupBidModifier.campaignId, _ + adGroupBidModifier.adGroupId, adGroupBidModifier.criterion.id, _ + bidModifier, adGroupBidModifier.bidModifierSource) + i = i + 1 + Next + End If + offset += pageSize + Loop While offset < page.totalNumEntries + Console.WriteLine("Number of adgroup bid modifiers found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve adgroup bid modifiers.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/AdvancedOperations/UploadOfflineConversions.vb b/examples/AdXBuyer/Vb/v201309/AdvancedOperations/UploadOfflineConversions.vb new file mode 100644 index 00000000000..7e8a174806b --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/AdvancedOperations/UploadOfflineConversions.vb @@ -0,0 +1,245 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example adds a Shared Bidding Strategy and uses it to construct + ''' a campaign. + ''' + ''' Tags: BiddingStrategyService.mutate + ''' Tags: BudgetService.mutate, CampaignService.mutate + ''' + Public Class UploadOfflineConversions + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim conversionName As String = "INSERT_CONVERSION_NAME_HERE" + ' GCLID needs to be newer than 30 days. + Dim gClId As String = "INSERT_GOOGLE_CLICK_ID_HERE" + ' The conversion time should be higher than the click time. + Dim conversionTime As String = "INSERT_CONVERSION_TIME_HERE" + Dim conversionValue As Double = Double.Parse("INSERT_CONVERSION_VALUE_HERE") + + Dim codeExample As New UploadOfflineConversions + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser, conversionName, gClId, conversionTime, conversionValue) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a Shared Bidding Strategy and uses it to construct " & _ + "a campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The name of the upload conversion to be + ''' created. + ''' The Google Click ID of the click for which offline + ''' conversions are uploaded. + ''' The conversion value to be uploaded. + ''' + ''' The conversion time, in yyyymmdd hhmmss + ''' format. + Public Sub Run(ByVal user As AdWordsUser, ByVal conversionName As String, _ + ByVal gClid As String, ByVal conversionTime As String, ByVal conversionValue As Double) + ' Get the ConversionTrackerService. + Dim conversionTrackerService As ConversionTrackerService = user.GetService( _ + AdWordsService.v201309.ConversionTrackerService) + + ' Get the OfflineConversionFeedService. + Dim offlineConversionFeedService As OfflineConversionFeedService = user.GetService( _ + AdWordsService.v201309.OfflineConversionFeedService) + + Const VIEWTHROUGH_LOOKBACK_WINDOW As Integer = 30 + Const CTC_LOOKBACK_WINDOW As Integer = 90 + + Try + ' Create an upload conversion. Once created, this entry will be visible + ' under Tools and Analysis->Conversion and will have "Source = Import". + Dim uploadConversion As New UploadConversion() + uploadConversion.category = ConversionTrackerCategory.PAGE_VIEW + uploadConversion.name = conversionName + uploadConversion.viewthroughLookbackWindow = VIEWTHROUGH_LOOKBACK_WINDOW + uploadConversion.ctcLookbackWindow = CTC_LOOKBACK_WINDOW + + Dim uploadConversionOperation As New ConversionTrackerOperation() + uploadConversionOperation.operator = [Operator].ADD + uploadConversionOperation.operand = uploadConversion + + Dim conversionTrackerRetval As ConversionTrackerReturnValue = _ + conversionTrackerService.mutate(New ConversionTrackerOperation() { _ + uploadConversionOperation}) + + Dim newUploadConversion As UploadConversion = conversionTrackerRetval.value(0) + + Console.WriteLine("New upload conversion type with name = '{0}' and id = {1} was " & _ + "created.", newUploadConversion.name, newUploadConversion.id) + + ' Associate offline conversions with the upload conversion we created. + Dim feed As New OfflineConversionFeed() + feed.conversionName = conversionName + feed.conversionTime = conversionTime + feed.conversionValue = conversionValue + feed.googleClickId = gClid + + Dim offlineConversionOperation As New OfflineConversionFeedOperation() + offlineConversionOperation.operator = [Operator].ADD + offlineConversionOperation.operand = feed + + Dim offlineConversionRetval As OfflineConversionFeedReturnValue = _ + offlineConversionFeedService.mutate( _ + New OfflineConversionFeedOperation() {offlineConversionOperation}) + + Dim newFeed As OfflineConversionFeed = offlineConversionRetval.value(0) + + Console.WriteLine("Uploaded offline conversion value of {0} for Google Click ID = " & _ + "'{1}' to '{2}'.", newFeed.conversionValue, newFeed.googleClickId, _ + newFeed.conversionName) + Catch ex As Exception + Throw New System.ApplicationException("Failed to upload offline conversions.", ex) + End Try + End Sub + + + ''' + ''' Creates the shared bidding strategy. + ''' + ''' The bidding strategy service. + ''' The bidding strategy name. + ''' The bid ceiling. + ''' The spend target. + ''' The bidding strategy object. + Private Function CreateBiddingStrategy(ByVal biddingStrategyService As BiddingStrategyService, _ + ByVal name As String, ByVal bidCeiling As Long, ByVal spendTarget As Long) _ + As SharedBiddingStrategy + ' Create a shared bidding strategy. + Dim sharedBiddingStrategy As New SharedBiddingStrategy() + sharedBiddingStrategy.name = name + + Dim biddingScheme As New TargetSpendBiddingScheme() + ' Optionally set additional bidding scheme parameters. + biddingScheme.bidCeiling = New Money() + biddingScheme.bidCeiling.microAmount = bidCeiling + + biddingScheme.spendTarget = New Money() + biddingScheme.spendTarget.microAmount = spendTarget + + sharedBiddingStrategy.biddingScheme = biddingScheme + + ' Create operation. + Dim operation As New BiddingStrategyOperation() + operation.operator = [Operator].ADD + operation.operand = sharedBiddingStrategy + + Return biddingStrategyService.mutate(New BiddingStrategyOperation() {operation}).value(0) + End Function + + ''' + ''' Creates an explicit budget to be used only to create the Campaign. + ''' + ''' The budget service. + ''' The budget name. + ''' The budget amount. + ''' The budget object. + Private Function CreateSharedBudget(ByVal budgetService As BudgetService, _ + ByVal name As String, ByVal amount As Long) As Budget + ' Create a shared budget + Dim budget As New Budget() + budget.name = name + budget.period = BudgetBudgetPeriod.DAILY + budget.amount = New Money() + budget.amount.microAmount = amount + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD + budget.isExplicitlyShared = True + + ' Create operation. + Dim operation As New BudgetOperation() + operation.operand = budget + operation.operator = [Operator].ADD + + ' Make the mutate request. + Return budgetService.mutate(New BudgetOperation() {operation}).value(0) + End Function + + ''' + ''' Creates the campaign with a shared bidding strategy. + ''' + ''' The campaign service. + ''' The campaign name. + ''' The bidding strategy id. + ''' The shared budget id. + ''' The campaign object. + Private Function CreateCampaignWithBiddingStrategy(ByVal campaignService As CampaignService, _ + ByVal name As String, ByVal biddingStrategyId As Long, ByVal sharedBudgetId As Long) _ + As Campaign + ' Create campaign. + Dim campaign As New Campaign() + campaign.name = name + + ' Set the budget. + campaign.budget = New Budget() + campaign.budget.budgetId = sharedBudgetId + + ' Set bidding strategy (required). + Dim biddingStrategyConfiguration As New BiddingStrategyConfiguration() + biddingStrategyConfiguration.biddingStrategyId = biddingStrategyId + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration + + ' Set keyword matching setting (required). + Dim keywordMatchSetting As New KeywordMatchSetting() + keywordMatchSetting.optIn = True + campaign.settings = New Setting() {keywordMatchSetting} + + ' Set network targeting (recommended). + Dim networkSetting As New NetworkSetting() + networkSetting.targetGoogleSearch = True + networkSetting.targetSearchNetwork = True + networkSetting.targetContentNetwork = True + campaign.networkSetting = networkSetting + + ' Create operation. + Dim operation As New CampaignOperation() + operation.operand = campaign + operation.operator = [Operator].ADD + + Return campaignService.mutate(New CampaignOperation() {operation}).value(0) + End Function + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/AdvancedOperations/UseSharedBiddingStrategy.vb b/examples/AdXBuyer/Vb/v201309/AdvancedOperations/UseSharedBiddingStrategy.vb new file mode 100644 index 00000000000..49508a7c618 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/AdvancedOperations/UseSharedBiddingStrategy.vb @@ -0,0 +1,212 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example adds a Shared Bidding Strategy and uses it to construct + ''' a campaign. + ''' + ''' Tags: BiddingStrategyService.mutate + ''' Tags: BudgetService.mutate, CampaignService.mutate + ''' + Public Class UseSharedBiddingStrategy + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UseSharedBiddingStrategy + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a Shared Bidding Strategy and uses it to construct " & _ + "a campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the services. + Dim biddingStrategyService As BiddingStrategyService = user.GetService( _ + AdWordsService.v201309.BiddingStrategyService) + + Dim budgetService As BudgetService = user.GetService(AdWordsService.v201309.BudgetService) + + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201309.CampaignService) + + Dim biddingStrategyName As String = "Maximize Clicks " & ExampleUtilities.GetRandomString() + Dim bidCeiling As Long = 2000000 + Dim spendTarget As Long = 20000000 + + Dim budgetName As String = "Shared Interplanetary Budget #" & _ + ExampleUtilities.GetRandomString() + Dim budgetAmount As Long = 30000000 + + Dim campaignName As String = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString() + + Try + Dim sharedBiddingStrategy As SharedBiddingStrategy = CreateBiddingStrategy( _ + biddingStrategyService, biddingStrategyName, bidCeiling, spendTarget) + Console.WriteLine("Shared bidding strategy with name '{0}' and ID {1} of type {2} " & _ + "was created.", sharedBiddingStrategy.name, sharedBiddingStrategy.id, _ + sharedBiddingStrategy.biddingScheme.BiddingSchemeType) + + Dim sharedBudget As Budget = CreateSharedBudget(budgetService, budgetName, budgetAmount) + + Dim newCampaign As Campaign = CreateCampaignWithBiddingStrategy(campaignService, _ + campaignName, sharedBiddingStrategy.id, sharedBudget.budgetId) + + Console.WriteLine("Campaign with name '{0}', ID {1} and bidding scheme ID {2} was " & _ + "created.", newCampaign.name, newCampaign.id, _ + newCampaign.biddingStrategyConfiguration.biddingStrategyId) + + Catch ex As Exception + Throw New System.ApplicationException("Failed to create campaign that uses shared " & _ + "bidding strategy.", ex) + End Try + End Sub + + + ''' + ''' Creates the shared bidding strategy. + ''' + ''' The bidding strategy service. + ''' The bidding strategy name. + ''' The bid ceiling. + ''' The spend target. + ''' The bidding strategy object. + Private Function CreateBiddingStrategy(ByVal biddingStrategyService As BiddingStrategyService, _ + ByVal name As String, ByVal bidCeiling As Long, ByVal spendTarget As Long) _ + As SharedBiddingStrategy + ' Create a shared bidding strategy. + Dim sharedBiddingStrategy As New SharedBiddingStrategy() + sharedBiddingStrategy.name = name + + Dim biddingScheme As New TargetSpendBiddingScheme() + ' Optionally set additional bidding scheme parameters. + biddingScheme.bidCeiling = New Money() + biddingScheme.bidCeiling.microAmount = bidCeiling + + biddingScheme.spendTarget = New Money() + biddingScheme.spendTarget.microAmount = spendTarget + + sharedBiddingStrategy.biddingScheme = biddingScheme + + ' Create operation. + Dim operation As New BiddingStrategyOperation() + operation.operator = [Operator].ADD + operation.operand = sharedBiddingStrategy + + Return biddingStrategyService.mutate(New BiddingStrategyOperation() {operation}).value(0) + End Function + + ''' + ''' Creates an explicit budget to be used only to create the Campaign. + ''' + ''' The budget service. + ''' The budget name. + ''' The budget amount. + ''' The budget object. + Private Function CreateSharedBudget(ByVal budgetService As BudgetService, _ + ByVal name As String, ByVal amount As Long) As Budget + ' Create a shared budget + Dim budget As New Budget() + budget.name = name + budget.period = BudgetBudgetPeriod.DAILY + budget.amount = New Money() + budget.amount.microAmount = amount + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD + budget.isExplicitlyShared = True + + ' Create operation. + Dim operation As New BudgetOperation() + operation.operand = budget + operation.operator = [Operator].ADD + + ' Make the mutate request. + Return budgetService.mutate(New BudgetOperation() {operation}).value(0) + End Function + + ''' + ''' Creates the campaign with a shared bidding strategy. + ''' + ''' The campaign service. + ''' The campaign name. + ''' The bidding strategy id. + ''' The shared budget id. + ''' The campaign object. + Private Function CreateCampaignWithBiddingStrategy(ByVal campaignService As CampaignService, _ + ByVal name As String, ByVal biddingStrategyId As Long, ByVal sharedBudgetId As Long) _ + As Campaign + ' Create campaign. + Dim campaign As New Campaign() + campaign.name = name + + ' Set the budget. + campaign.budget = New Budget() + campaign.budget.budgetId = sharedBudgetId + + ' Set bidding strategy (required). + Dim biddingStrategyConfiguration As New BiddingStrategyConfiguration() + biddingStrategyConfiguration.biddingStrategyId = biddingStrategyId + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration + + ' Set keyword matching setting (required). + Dim keywordMatchSetting As New KeywordMatchSetting() + keywordMatchSetting.optIn = True + campaign.settings = New Setting() {keywordMatchSetting} + + ' Set network targeting (recommended). + Dim networkSetting As New NetworkSetting() + networkSetting.targetGoogleSearch = True + networkSetting.targetSearchNetwork = True + networkSetting.targetContentNetwork = True + campaign.networkSetting = networkSetting + + ' Create operation. + Dim operation As New CampaignOperation() + operation.operand = campaign + operation.operator = [Operator].ADD + + Return campaignService.mutate(New CampaignOperation() {operation}).value(0) + End Function + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/BasicOperations/AddAdGroupDemographicCriteria.vb b/examples/AdXBuyer/Vb/v201309/BasicOperations/AddAdGroupDemographicCriteria.vb new file mode 100644 index 00000000000..0fa257e2f74 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/BasicOperations/AddAdGroupDemographicCriteria.vb @@ -0,0 +1,124 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example adds demographic target criteria to an ad group. To get + ''' ad groups, run AddAdGroup.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class AddAdGroupDemographicCriteria + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAdGroupDemographicCriteria + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds demographic target criteria to an ad group. To get ad " & _ + "groups, run AddAdGroup.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which criteria are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = _ + user.GetService(AdWordsService.v201309.AdGroupCriterionService) + + ' Create biddable ad group criterion for gender + Dim genderTarget As New Gender() + ' Criterion Id for male. The IDs can be found here + ' https://developers.google.com/adwords/api/docs/appendix/genders + genderTarget.id = 10 + + Dim genderBiddableAdGroupCriterion As New BiddableAdGroupCriterion() + genderBiddableAdGroupCriterion.adGroupId = adGroupId + genderBiddableAdGroupCriterion.criterion = genderTarget + + ' Create negative ad group criterion for age range + Dim ageRangeNegative As New AgeRange() + ' Criterion Id for age 18 to 24. The IDs can be found here + ' https://developers.google.com/adwords/api/docs/appendix/ages + + ageRangeNegative.id = 503001 + Dim ageRangeNegativeAdGroupCriterion As New NegativeAdGroupCriterion() + ageRangeNegativeAdGroupCriterion.adGroupId = adGroupId + ageRangeNegativeAdGroupCriterion.criterion = ageRangeNegative + + ' Create operations. + Dim genderBiddableAdGroupCriterionOperation As New AdGroupCriterionOperation() + genderBiddableAdGroupCriterionOperation.operand = genderBiddableAdGroupCriterion + genderBiddableAdGroupCriterionOperation.operator = [Operator].ADD + + Dim ageRangeNegativeAdGroupCriterionOperation As New AdGroupCriterionOperation() + ageRangeNegativeAdGroupCriterionOperation.operand = ageRangeNegativeAdGroupCriterion + ageRangeNegativeAdGroupCriterionOperation.operator = [Operator].ADD + + Dim operations As New List(Of Operation) + operations.Add(genderBiddableAdGroupCriterionOperation) + operations.Add(ageRangeNegativeAdGroupCriterionOperation) + + Try + ' Add ad group criteria. + Dim result As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + operations.ToArray) + + ' Display ad group criteria. + If (Not result Is Nothing) AndAlso Not (result.value Is Nothing) Then + For Each adGroupCriterionResult As AdGroupCriterion In result.value + Console.WriteLine("Ad group criterion with ad group id '{0}', criterion id " & _ + "'{1}', and type '{2}' was added.", adGroupCriterionResult.adGroupId, _ + adGroupCriterionResult.criterion.id, _ + adGroupCriterionResult.criterion.CriterionType) + Next + Else + Console.WriteLine("No ad group criteria were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create ad group criteria.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/BasicOperations/AddAdGroups.vb b/examples/AdXBuyer/Vb/v201309/BasicOperations/AddAdGroups.vb new file mode 100644 index 00000000000..dedad97283a --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/BasicOperations/AddAdGroups.vb @@ -0,0 +1,138 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example illustrates how to create ad groups. To create + ''' campaigns, run AddCampaigns.vb. + ''' + ''' Tags: AdGroupService.mutate + ''' + Public Class AddAdGroups + Inherits ExampleBase + ''' + ''' Number of items being added / updated in this code example. + ''' + Const NUM_ITEMS As Integer = 5 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAdGroups + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to create ad groups. To create campaigns," & _ + " run AddCampaigns.vb" + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to which ad groups are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService( _ + AdWordsService.v201309.AdGroupService) + + Dim operations As New List(Of AdGroupOperation) + + For i As Integer = 1 To NUM_ITEMS + ' Create the ad group. + Dim adGroup As New AdGroup + adGroup.name = String.Format("Earth to Mars Cruises #{0}", ExampleUtilities.GetRandomString) + adGroup.status = AdGroupStatus.ENABLED + adGroup.campaignId = campaignId + + ' Set the ad group bids. + Dim biddingConfig As New BiddingStrategyConfiguration() + + Dim cpmBid As New CpmBid() + cpmBid.bid = New Money() + cpmBid.bid.microAmount = 10000000 + + biddingConfig.bids = New Bids() {cpmBid} + + adGroup.biddingStrategyConfiguration = biddingConfig + + ' Optional: Set targeting restrictions. + ' These setting only affect serving for the Display Network. + Dim targetingSetting As New TargetingSetting() + + Dim placementDetail As New TargetingSettingDetail() + placementDetail.criterionTypeGroup = CriterionTypeGroup.PLACEMENT + placementDetail.targetAll = True + + Dim verticalDetail As New TargetingSettingDetail() + verticalDetail.criterionTypeGroup = CriterionTypeGroup.VERTICAL + verticalDetail.targetAll = False + + targetingSetting.details = New TargetingSettingDetail() {placementDetail, verticalDetail} + + adGroup.settings = New Setting() {targetingSetting} + + ' Create the operation. + Dim operation1 As New AdGroupOperation + operation1.operator = [Operator].ADD + operation1.operand = adGroup + + operations.Add(operation1) + Next + + Try + ' Create the ad group. + Dim retVal As AdGroupReturnValue = adGroupService.mutate(operations.ToArray) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + For Each newAdGroup As AdGroup In retVal.value + Console.WriteLine("Ad group with id = '{0}' and name = '{1}' was created.", _ + newAdGroup.id, newAdGroup.name) + Next + Else + Console.WriteLine("No ad groups were created.") + End If + Catch ex As Exception + Console.WriteLine("Failed to create ad groups. Exception says ""{0}""", ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/BasicOperations/AddCampaigns.vb b/examples/AdXBuyer/Vb/v201309/BasicOperations/AddCampaigns.vb new file mode 100644 index 00000000000..6cbc674b617 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/BasicOperations/AddCampaigns.vb @@ -0,0 +1,169 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example adds campaigns. To get campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignService.mutate + ''' + Public Class AddCampaigns + Inherits ExampleBase + ''' + ''' Number of items being added / updated in this code example. + ''' + Const NUM_ITEMS As Integer = 5 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddCampaigns + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds campaigns. To get campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the BudgetService. + Dim budgetService As BudgetService = user.GetService( _ + AdWordsService.v201309.BudgetService) + + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201309.CampaignService) + + ' Create the campaign budget. + Dim budget As New Budget + budget.name = "Interplanetary Cruise Budget #" & ExampleUtilities.GetRandomString + budget.period = BudgetBudgetPeriod.DAILY + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD + budget.amount = New Money + budget.amount.microAmount = 50000000 + + Dim budgetOperation As New BudgetOperation + budgetOperation.operator = [Operator].ADD + budgetOperation.operand = budget + + Try + Dim budgetRetval As BudgetReturnValue = budgetService.mutate(New BudgetOperation() _ + {budgetOperation}) + budget = budgetRetval.value(0) + Catch ex As Exception + Throw New System.ApplicationException("Failed to add shared budget.", ex) + End Try + + Dim operations As New List(Of CampaignOperation) + + For i As Integer = 1 To NUM_ITEMS + ' Create the campaign. + Dim campaign As New Campaign + campaign.name = "Interplanetary Cruise #" & ExampleUtilities.GetRandomString + + campaign.status = CampaignStatus.PAUSED + + Dim biddingConfig As New BiddingStrategyConfiguration() + biddingConfig.biddingStrategyType = BiddingStrategyType.MANUAL_CPM + + ' Optional: also provide matching bidding scheme. + biddingConfig.biddingScheme = New ManualCpmBiddingScheme() + + campaign.biddingStrategyConfiguration = biddingConfig + + ' Set the campaign budget. + campaign.budget = New Budget + campaign.budget.budgetId = budget.budgetId + + ' Set targetContentNetwork true. Other network targeting is not available + ' for Ad Exchange Buyers. + campaign.networkSetting = New NetworkSetting + campaign.networkSetting.targetGoogleSearch = False + campaign.networkSetting.targetSearchNetwork = False + campaign.networkSetting.targetContentNetwork = True + campaign.networkSetting.targetPartnerSearchNetwork = False + + ' Set real time bidding settings. + Dim rtbSetting As New RealTimeBiddingSetting + rtbSetting.optIn = True + + campaign.settings = New Setting() {rtbSetting} + + ' Optional: Set the start date. + campaign.startDate = DateTime.Now.AddDays(1).ToString("yyyyMMdd") + + ' Optional: Set the end date. + campaign.endDate = DateTime.Now.AddYears(1).ToString("yyyyMMdd") + + ' Optional: Set the frequency cap. + Dim frequencyCap As New FrequencyCap + frequencyCap.impressions = 5 + frequencyCap.level = Level.ADGROUP + frequencyCap.timeUnit = TimeUnit.DAY + campaign.frequencyCap = frequencyCap + + ' Create the operation. + Dim operation As New CampaignOperation + operation.operator = [Operator].ADD + operation.operand = campaign + + operations.Add(operation) + Next + + Try + ' Add the campaign. + Dim retVal As CampaignReturnValue = campaignService.mutate(operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + For Each newCampaign As Campaign In retVal.value + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was added.", _ + newCampaign.name, newCampaign.id) + Next + Else + Console.WriteLine("No campaigns were added.") + End If + Catch ex As Exception + Console.WriteLine("Failed to add campaigns. Exception says ""{0}""", ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/BasicOperations/AddPlacements.vb b/examples/AdXBuyer/Vb/v201309/BasicOperations/AddPlacements.vb new file mode 100644 index 00000000000..ccba6ef7dba --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/BasicOperations/AddPlacements.vb @@ -0,0 +1,121 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example adds placements to an ad group. To get ad groups, run + ''' GetAdGroups.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class AddPlacements + Inherits ExampleBase + ''' + ''' Number of items being added / updated in this code example. + ''' + Const NUM_ITEMS As Integer = 5 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddPlacements + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds placements to an ad group. To get ad groups, run " & _ + "GetAdGroups.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which keywords are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201309.AdGroupCriterionService) + + Dim operations As New List(Of AdGroupCriterionOperation) + + For i As Integer = 1 To NUM_ITEMS + + ' Create the placement. + Dim placement As New Placement + placement.url = "http://mars.google.com/" + i.ToString() + + ' Create the biddable ad group criterion. + Dim placementCriterion As AdGroupCriterion = New BiddableAdGroupCriterion + placementCriterion.adGroupId = adGroupId + placementCriterion.criterion = placement + + ' Create the operations. + Dim operation As New AdGroupCriterionOperation + operation.operator = [Operator].ADD + operation.operand = placementCriterion + + operations.Add(operation) + Next + Try + ' Create the placements. + Dim retVal As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + operations.ToArray) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing)) Then + For Each adGroupCriterion As AdGroupCriterion In retVal.value + ' If you are adding multiple type of criteria, then you may need to + ' check for + ' + ' if (adGroupCriterion is Placement) { ... } + ' + ' to identify the criterion type. + Console.WriteLine("Placement with ad group id = '{0}, placement id = '{1} and url " & _ + "= '{2}' was created.", adGroupCriterion.adGroupId, _ + adGroupCriterion.criterion.id, TryCast(adGroupCriterion.criterion, Placement).url) + Next + Else + Console.WriteLine("No placements were added.") + End If + Catch ex As Exception + Console.WriteLine("Failed to create placements. Exception says ""{0}""", ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/BasicOperations/AddThirdPartyRedirectAds.vb b/examples/AdXBuyer/Vb/v201309/BasicOperations/AddThirdPartyRedirectAds.vb new file mode 100644 index 00000000000..e7fc146c978 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/BasicOperations/AddThirdPartyRedirectAds.vb @@ -0,0 +1,151 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 +Imports Google.Api.Ads.Common.Util + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example adds third party redirect ads to a given ad group. To + ''' list ad groups, run GetAdGroups.vb. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class AddThirdPartyRedirectAds + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddThirdPartyRedirectAds + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds third party redirect ads to a given ad group. To list " & _ + "ad groups, run GetAdGroups.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which ads are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService( _ + AdWordsService.v201309.AdGroupAdService) + + ' Create standard third party redirect ad. + Dim standardAd As New ThirdPartyRedirectAd + standardAd.name = String.Format("Example third party ad #{0}", ExampleUtilities.GetRandomString) + standardAd.url = "http://www.example.com" + + standardAd.dimensions = New Dimensions + standardAd.dimensions.height = 250 + standardAd.dimensions.width = 300 + + standardAd.snippet = "" + + ' DoubleClick Rich Media Expandable format ID. + standardAd.certifiedVendorFormatId = 232 + standardAd.isCookieTargeted = False + standardAd.isUserInterestTargeted = False + standardAd.isTagged = False + standardAd.richMediaAdType = RichMediaAdRichMediaAdType.STANDARD + + ' Expandable Ad properties. + standardAd.expandingDirections = New ThirdPartyRedirectAdExpandingDirection() { _ + ThirdPartyRedirectAdExpandingDirection.EXPANDING_UP, _ + ThirdPartyRedirectAdExpandingDirection.EXPANDING_DOWN _ + } + + standardAd.adAttributes = New RichMediaAdAdAttribute() { _ + RichMediaAdAdAttribute.ROLL_OVER_TO_EXPAND} + + ' Create in-stream third party redirect ad. + Dim inStreamAd As New ThirdPartyRedirectAd() + inStreamAd.name = String.Format("Example third party ad #{0}", ExampleUtilities.GetRandomString) + inStreamAd.url = "http://www.example.com" + ' Set the duration to 15 secs. + inStreamAd.adDuration = 15000 + inStreamAd.sourceUrl = "http://ad.doubleclick.net/pfadx/N270.126913.6102203221521/B3876671.21;dcadv=2215309;sz=0x0;ord=%5btimestamp%5d;dcmt=text/xml" + inStreamAd.certifiedVendorFormatId = 303 + inStreamAd.richMediaAdType = RichMediaAdRichMediaAdType.IN_STREAM_VIDEO + + Dim operations As New List(Of AdGroupAdOperation) + Dim ads As ThirdPartyRedirectAd() = New ThirdPartyRedirectAd() {standardAd, inStreamAd} + For Each redirectAd As ThirdPartyRedirectAd In ads + Dim thirdPartyRedirectAdGroupAd As New AdGroupAd + thirdPartyRedirectAdGroupAd.adGroupId = adGroupId + thirdPartyRedirectAdGroupAd.ad = redirectAd + + ' Optional: Set the status. + thirdPartyRedirectAdGroupAd.status = AdGroupAdStatus.PAUSED + + ' Create the operations. + Dim operation As New AdGroupAdOperation + operation.operator = [Operator].ADD + operation.operand = thirdPartyRedirectAdGroupAd + + operations.Add(operation) + Next + + Try + ' Create the ads. + Dim retVal As AdGroupAdReturnValue = service.mutate(operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing)) Then + ' If you are adding multiple type of Ads, then you may need to check + ' for + ' + ' if (adGroupAd.ad is ThirdPartyRedirectAd) { ... } + ' + ' to identify the ad type. + For Each adGroupAd As AdGroupAd In retVal.value + Console.WriteLine("New third party redirect ad with id = ""{0}"" and url = ""{1}"" " & _ + "was created.", adGroupAd.ad.id, DirectCast(adGroupAd.ad, ThirdPartyRedirectAd).url) + Next + Else + Console.WriteLine("No third party redirect ads were created.") + End If + Catch ex As Exception + Console.WriteLine("Failed to create third party redirect ad. Exception says ""{0}""", _ + ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/BasicOperations/DeleteAd.vb b/examples/AdXBuyer/Vb/v201309/BasicOperations/DeleteAd.vb new file mode 100644 index 00000000000..668b26ddf0d --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/BasicOperations/DeleteAd.vb @@ -0,0 +1,105 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example deletes an ad using the 'REMOVE' operator. To list ads, + ''' run GetTextAds.vb. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class DeleteAd + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DeleteAd + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim adId As Long = Long.Parse("INSERT_AD_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, adId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example deletes an ad using the 'REMOVE' operator. To list ads, " & _ + "run GetTextAds.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the ad. + ''' Id of the ad being deleted. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal adId As Long) + ' Get the AdGroupAdService. + Dim adGroupAdService As AdGroupAdService = user.GetService( _ + AdWordsService.v201309.AdGroupAdService) + + ' Since we do not need to update any ad-specific fields, it is enough to + ' create the base type. + Dim ad As New Ad + ad.id = adId + + ' Create the ad group ad. + Dim adGroupAd As New AdGroupAd + adGroupAd.adGroupId = adGroupId + + adGroupAd.ad = ad + + ' Create the operation. + Dim operation As New AdGroupAdOperation + operation.operand = adGroupAd + operation.operator = [Operator].REMOVE + + Try + ' Delete the ad. + Dim retVal As AdGroupAdReturnValue = adGroupAdService.mutate( _ + New AdGroupAdOperation() {operation}) + + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim deletedAdGroupAd As AdGroupAd = retVal.value(0) + Console.WriteLine("Ad with id = ""{0}"" and type = ""{1}"" was deleted.", _ + deletedAdGroupAd.ad.id, deletedAdGroupAd.ad.AdType) + Else + Console.WriteLine("No ads were deleted.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to delete ad.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/BasicOperations/DeleteAdGroup.vb b/examples/AdXBuyer/Vb/v201309/BasicOperations/DeleteAdGroup.vb new file mode 100644 index 00000000000..324759f0dca --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/BasicOperations/DeleteAdGroup.vb @@ -0,0 +1,101 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example deletes an ad group by setting the status to 'DELETED'. + ''' To get ad groups, run GetAdGroups.vb. + ''' + ''' Tags: AdGroupService.mutate + ''' + Public Class DeleteAdGroup + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DeleteAdGroup + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example deletes an ad group by setting the status to 'DELETED'. " & _ + "To get ad groups, run GetAdGroups.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to be deleted. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService(AdWordsService.v201309.AdGroupService) + + ' Create ad group with DELETED status. + Dim adGroup As New AdGroup + adGroup.id = adGroupId + + ' When deleting an ad group, rename it to avoid name collisions with new + ' ad groups. + adGroup.name = "Deleted AdGroup - " + ExampleUtilities.GetRandomString + adGroup.status = AdGroupStatus.DELETED + + ' Create the operation. + Dim operation As New AdGroupOperation + operation.operand = adGroup + operation.operator = [Operator].SET + + Try + ' Delete the ad group. + Dim retVal As AdGroupReturnValue = adGroupService.mutate( _ + New AdGroupOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim deletedAdGroup As AdGroup = retVal.value(0) + Console.WriteLine("Ad group with id = ""{0}"" was renamed to ""{1}"" and deleted.", _ + deletedAdGroup.id, deletedAdGroup.name) + Else + Console.WriteLine("No ad groups were deleted.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to delete ad groups.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/BasicOperations/DeleteCampaign.vb b/examples/AdXBuyer/Vb/v201309/BasicOperations/DeleteCampaign.vb new file mode 100644 index 00000000000..49a7a798159 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/BasicOperations/DeleteCampaign.vb @@ -0,0 +1,102 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example deletes a campaign by setting the status to 'DELETED'. + ''' To get campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignService.mutate + ''' + Public Class DeleteCampaign + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DeleteCampaign + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example deletes a campaign by setting the status to 'DELETED'. To " & _ + "get campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to be deleted. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201309.CampaignService) + + ' Create campaign with DELETED status. + Dim campaign As New Campaign + campaign.id = campaignId + + ' When deleting a campaign, rename it to avoid name collisions with new + ' campaigns. + campaign.name = "Deleted Campaign - " + ExampleUtilities.GetRandomString + campaign.status = CampaignStatus.DELETED + + ' Create the operation. + Dim operation As New CampaignOperation + operation.operand = campaign + operation.operator = [Operator].SET + + Try + ' Delete the campaign. + Dim retVal As CampaignReturnValue = campaignService.mutate( _ + New CampaignOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim deletedCampaign As Campaign = retVal.value(0) + Console.WriteLine("Campaign with id = ""{0}"" was renamed to ""{1}"" and deleted.", _ + deletedCampaign.id, deletedCampaign.name) + Else + Console.WriteLine("No campaigns were deleted.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to delete campaigns.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/BasicOperations/DeletePlacement.vb b/examples/AdXBuyer/Vb/v201309/BasicOperations/DeletePlacement.vb new file mode 100644 index 00000000000..6882f5bdb20 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/BasicOperations/DeletePlacement.vb @@ -0,0 +1,106 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example deletes a placement using the 'REMOVE' operator. To get + ''' placements, run GetPlacements.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class DeletePlacement + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DeletePlacement + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim placementId As Long = Long.Parse("INSERT_PLACEMENT_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, placementId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example deletes a placement using the 'REMOVE' operator. To get " & _ + "placements, run GetPlacements.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the keyword. + ''' + ''' Id of the placement to be deleted. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal placementId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201309.AdGroupCriterionService) + + ' Create base class criterion to avoid setting placement-specific + ' fields. + Dim criterion As New Criterion + criterion.id = placementId + + ' Create the ad group criterion. + Dim adGroupCriterion As New BiddableAdGroupCriterion + adGroupCriterion.adGroupId = adGroupId + adGroupCriterion.criterion = criterion + + ' Create the operation. + Dim operation As New AdGroupCriterionOperation + operation.operand = adGroupCriterion + operation.operator = [Operator].REMOVE + + Try + ' Delete the placement. + Dim retVal As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + New AdGroupCriterionOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim deletedPlacement As AdGroupCriterion = retVal.value(0) + Console.WriteLine("Placement with ad group id = ""{0}"" and id = ""{1}"" was " & _ + "deleted.", deletedPlacement.adGroupId, deletedPlacement.criterion.id) + Else + Console.WriteLine("No placement was deleted.") + End If + Catch ex As Exception + Console.WriteLine("Failed to delete placement. Exception says ""{0}""", ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/BasicOperations/GetAdGroups.vb b/examples/AdXBuyer/Vb/v201309/BasicOperations/GetAdGroups.vb new file mode 100644 index 00000000000..5070a4920b8 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/BasicOperations/GetAdGroups.vb @@ -0,0 +1,114 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example illustrates how to retrieve all the ad groups for a + ''' campaign. To create an ad group, run AddAdGroup.vb. + ''' + ''' Tags: AdGroupService.get + ''' + Public Class GetAdGroups + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAdGroups + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to retrieve all the ad groups for a " & _ + "campaign. To create an ad group, run AddAdGroup.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which ad groups are + ''' retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService( _ + AdWordsService.v201309.AdGroupService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "Name"} + + ' Create the filters. + Dim predicate As New Predicate + predicate.field = "CampaignId" + predicate.operator = PredicateOperator.EQUALS + predicate.values = New String() {campaignId.ToString} + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the ad groups. + page = adGroupService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each adGroup As AdGroup In page.entries + Console.WriteLine("{0}) Ad group name is ""{1}"" and id is ""{2}"".", i, _ + adGroup.name, adGroup.id) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of ad groups found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve ad group(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/BasicOperations/GetCampaigns.vb b/examples/AdXBuyer/Vb/v201309/BasicOperations/GetCampaigns.vb new file mode 100644 index 00000000000..9aea8a801ab --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/BasicOperations/GetCampaigns.vb @@ -0,0 +1,103 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example lists all campaigns. To add a campaign, run + ''' AddCampaign.vb. + ''' + ''' Tags: CampaignService.get + ''' + Public Class GetCampaigns + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetCampaigns + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example lists all campaigns. To add a campaign, run AddCampaign.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201309.CampaignService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "Name", "Status"} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New CampaignPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the campaigns. + page = campaignService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each campaign As Campaign In page.entries + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = " & _ + "'{3}' was found.", i, campaign.id, campaign.name, campaign.status) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve campaign(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/BasicOperations/GetCampaignsWithAwql.vb b/examples/AdXBuyer/Vb/v201309/BasicOperations/GetCampaignsWithAwql.vb new file mode 100644 index 00000000000..a29a8fa61a4 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/BasicOperations/GetCampaignsWithAwql.vb @@ -0,0 +1,102 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example lists all campaigns using an AWQL query. See + ''' https://developers.google.com/adwords/api/docs/guides/awql for AWQL + ''' documentation. To add a campaign, run AddCampaign.vb. + ''' + ''' Tags: CampaignService.get + ''' + Public Class GetCampaignsWithAwql + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetCampaignsWithAwql + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example lists all campaigns using an AWQL query. See " & _ + "https://developers.google.com/adwords/api/docs/guides/awql for AWQL " & _ + "documentation. To add a campaign, run AddCampaign.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201309.CampaignService) + + ' Create the query. + Dim query As String = "SELECT Id, Name, Status ORDER BY Name" + + Dim offset As Long = 0 + Dim pageSize As Long = 500 + + Dim page As New CampaignPage() + + Try + Do + Dim queryWithPaging As String = String.Format("{0} LIMIT {1}, {2}", query, offset, _ + pageSize) + + ' Get the campaigns. + page = campaignService.query(queryWithPaging) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each campaign As Campaign In page.entries + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = " & _ + "'{3}' was found.", i, campaign.id, campaign.name, campaign.status) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve campaign(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/BasicOperations/GetPlacements.vb b/examples/AdXBuyer/Vb/v201309/BasicOperations/GetPlacements.vb new file mode 100644 index 00000000000..278551073cc --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/BasicOperations/GetPlacements.vb @@ -0,0 +1,128 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example gets all placements in an account. To add placements, run + ''' AddPlacements.vb. + ''' + ''' Tags: AdGroupCriterionService.get + ''' + Public Class GetPlacements + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetPlacements + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all placements in an account. To add placements, run " & _ + "AddPlacements.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201309.AdGroupCriterionService) + + ' Create a selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "AdGroupId", "PlacementUrl"} + + ' Select only placements. + Dim predicate As New Predicate + predicate.field = "CriteriaType" + predicate.operator = PredicateOperator.EQUALS + predicate.values = New String() {"PLACEMENT"} + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupCriterionPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the placements. + page = adGroupCriterionService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each adGroupCriterion As AdGroupCriterion In page.entries + Dim isNegative As Boolean = TypeOf adGroupCriterion Is NegativeAdGroupCriterion + + ' If you are retrieving multiple type of criteria, then you may + ' need to check for + ' + ' if (adGroupCriterion is Placement) { ... } + ' + ' to identify the criterion type. + Dim placement As Placement = adGroupCriterion.criterion + If isNegative Then + Console.WriteLine("{0}) Negative placement with ad group ID = '{1}', placement " & _ + "ID = '{2}', and url = '{3}' was found.", i, adGroupCriterion.adGroupId, _ + placement.id, placement.url) + Else + Console.WriteLine("{0}) Placement with ad group ID = '{1}', placement ID = " & _ + "'{2}' and url = '{3}' was found.", i, adGroupCriterion.adGroupId, _ + placement.id, placement.url) + End If + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of placements found: {0}", page.totalNumEntries) + Catch ex As Exception + Console.WriteLine("Failed to retrieve placements. Exception says ""{0}""", ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/BasicOperations/GetThirdPartyRedirectAds.vb b/examples/AdXBuyer/Vb/v201309/BasicOperations/GetThirdPartyRedirectAds.vb new file mode 100644 index 00000000000..73087e49137 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/BasicOperations/GetThirdPartyRedirectAds.vb @@ -0,0 +1,143 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example retrieves all third party redirect ads given an existing + ''' ad group. To add ads to an existing ad group, run + ''' AddThirdPartyRedirectAd.vb. + ''' + ''' Tags: AdGroupAdService.get + ''' + Public Class GetThirdPartyRedirectAds + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetThirdPartyRedirectAds + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves all third party redirect ads given an existing ad " & _ + "group. To add third party redirect ads to an existing ad group, run " & _ + "AddThirdPartyRedirectAd.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group from which text ads are + ''' retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201309.AdGroupAdService) + + ' Create a selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "Status", "Url", "DisplayUrl", "RichMediaAdSnippet"} + + ' Set the sort order. + Dim orderBy As New OrderBy + orderBy.field = "Id" + orderBy.sortOrder = SortOrder.ASCENDING + selector.ordering = New OrderBy() {orderBy} + + ' Restrict the fetch to only the selected ad group id. + Dim adGroupPredicate As New Predicate + adGroupPredicate.field = "AdGroupId" + adGroupPredicate.operator = PredicateOperator.EQUALS + adGroupPredicate.values = New String() {adGroupId.ToString} + + ' Retrieve only third party redirect ads. + Dim typePredicate As New Predicate + typePredicate.field = "AdType" + typePredicate.operator = PredicateOperator.EQUALS + typePredicate.values = New String() {"THIRD_PARTY_REDIRECT_AD"} + + ' By default disabled ads aren't returned by the selector. To return them + ' include the DISABLED status in the statuses field. + Dim statusPredicate As New Predicate + statusPredicate.field = "Status" + statusPredicate.operator = PredicateOperator.IN + + statusPredicate.values = New String() {AdGroupAdStatus.ENABLED.ToString, _ + AdGroupAdStatus.PAUSED.ToString, AdGroupAdStatus.DISABLED.ToString} + + selector.predicates = New Predicate() {adGroupPredicate, statusPredicate, typePredicate} + + ' Select the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupAdPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the third party redirect ads. + page = service.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each adGroupAd As AdGroupAd In page.entries + Dim thirdPartyRedirectAd As ThirdPartyRedirectAd = adGroupAd.ad + Console.WriteLine("{0}) Ad id is {1} and status is {2}", i, thirdPartyRedirectAd.id, _ + adGroupAd.status) + Console.WriteLine(" Url: {0}\n Display Url: {1}\n Snippet:{2}", _ + thirdPartyRedirectAd.url, thirdPartyRedirectAd.displayUrl, _ + thirdPartyRedirectAd.snippet) + Next + i += 1 + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of third party redirect ads found: {0}", page.totalNumEntries) + Catch ex As Exception + Console.WriteLine("Failed to get third party redirect ads. Exception says ""{0}""", _ + ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/BasicOperations/PauseAd.vb b/examples/AdXBuyer/Vb/v201309/BasicOperations/PauseAd.vb new file mode 100644 index 00000000000..612ca3f1891 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/BasicOperations/PauseAd.vb @@ -0,0 +1,102 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example pauses a given ad. To list all ads, run GetTextAds.cs. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class PauseAd + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New PauseAd + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim adId As Long = Long.Parse("INSERT_AD_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, adId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example pauses a given ad. To list all ads, run GetTextAds.cs." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the ad. + ''' + ''' Id of the ad to be paused. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal adId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201309.AdGroupAdService) + + Dim status As AdGroupAdStatus = AdGroupAdStatus.PAUSED + + ' Create the ad group ad. + Dim adGroupAd As New AdGroupAd + adGroupAd.status = status + adGroupAd.adGroupId = adGroupId + + adGroupAd.ad = New Ad + adGroupAd.ad.id = adId + + ' Create the operation. + Dim adGroupAdOperation As New AdGroupAdOperation + adGroupAdOperation.operator = [Operator].SET + adGroupAdOperation.operand = adGroupAd + + Try + ' Update the ad. + Dim retVal As AdGroupAdReturnValue = service.mutate( _ + New AdGroupAdOperation() {adGroupAdOperation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim pausedAdGroupAd As AdGroupAd = retVal.value(0) + Console.WriteLine("Ad with id ""{0}"" was paused.", pausedAdGroupAd.ad.id) + Else + Console.WriteLine("No ads were paused.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to pause ad.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/BasicOperations/UpdateAdGroup.vb b/examples/AdXBuyer/Vb/v201309/BasicOperations/UpdateAdGroup.vb new file mode 100644 index 00000000000..4ae847f67f7 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/BasicOperations/UpdateAdGroup.vb @@ -0,0 +1,96 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example illustrates how to update an ad group, setting its + ''' status to 'PAUSED'. To create an ad group, run AddAdGroup.vb. + ''' + ''' Tags: AdGroupService.mutate + ''' + Public Class UpdateAdGroup + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UpdateAdGroup + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to update an ad group, setting its status " & _ + "to 'PAUSED'. To create an ad group, run AddAdGroup.vb" + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to be updated. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService(AdWordsService.v201309.AdGroupService) + + ' Create the ad group. + Dim adGroup As New AdGroup + adGroup.status = AdGroupStatus.PAUSED + adGroup.id = adGroupId + + ' Create the operation. + Dim operation As New AdGroupOperation + operation.operator = [Operator].SET + operation.operand = adGroup + + Try + ' Update the ad group. + Dim retVal As AdGroupReturnValue = adGroupService.mutate(New AdGroupOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim pausedAdGroup As AdGroup = retVal.value(0) + Console.WriteLine("Ad group with id = '{0}' was successfully updated.", _ + pausedAdGroup.id) + Else + Console.WriteLine("No ad groups were updated.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to update ad groups.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/BasicOperations/UpdateCampaign.vb b/examples/AdXBuyer/Vb/v201309/BasicOperations/UpdateCampaign.vb new file mode 100644 index 00000000000..e1849fa4ab2 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/BasicOperations/UpdateCampaign.vb @@ -0,0 +1,97 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example updates a campaign. To get campaigns, run + ''' GetCampaigns.vb. + ''' + ''' Tags: CampaignService.mutate + ''' + Public Class UpdateCampaign + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UpdateCampaign + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example updates a campaign. To get campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to be updated. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201309.CampaignService) + + ' Create campaign with updated budget. + Dim campaign As New Campaign + campaign.id = campaignId + campaign.status = CampaignStatus.PAUSED + + ' Create the operations. + Dim operation As New CampaignOperation + operation.operator = [Operator].SET + operation.operand = campaign + + Try + ' Update the campaign. + Dim retVal As CampaignReturnValue = campaignService.mutate( _ + New CampaignOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim updatedCampaign As Campaign = retVal.value(0) + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was updated.", _ + updatedCampaign.name, updatedCampaign.id) + Else + Console.WriteLine("No campaigns were updated.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to update campaigns.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/BasicOperations/UpdatePlacement.vb b/examples/AdXBuyer/Vb/v201309/BasicOperations/UpdatePlacement.vb new file mode 100644 index 00000000000..1487f979fe0 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/BasicOperations/UpdatePlacement.vb @@ -0,0 +1,123 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example updates the bid of a placement. To get placement, run + ''' GetPlacements.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class UpdatePlacement + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UpdatePlacement + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim placementId As Long = Long.Parse("INSERT_PLACEMENT_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, placementId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example updates the bid of a placement. To get placement, run " & _ + "GetPlacements.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the keyword. + ''' + ''' Id of the placement to be updated. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal placementId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201309.AdGroupCriterionService) + + ' Since we are not updating any placement-specific fields, it is enough to + ' create a criterion object. + Dim criterion As New Criterion + criterion.id = placementId + + ' Create ad group criterion. + Dim biddableAdGroupCriterion As New BiddableAdGroupCriterion + biddableAdGroupCriterion.adGroupId = adGroupId + biddableAdGroupCriterion.criterion = criterion + + ' Create the bids. + Dim biddingConfig As New BiddingStrategyConfiguration() + Dim cpmBid As New CpmBid() + cpmBid.bid = New Money() + cpmBid.bid.microAmount = 1000000 + biddingConfig.bids = New Bids() {cpmBid} + + biddableAdGroupCriterion.biddingStrategyConfiguration = biddingConfig + + ' Create the operation. + Dim operation As New AdGroupCriterionOperation + operation.operator = [Operator].SET + operation.operand = biddableAdGroupCriterion + + Try + ' Update the placement. + Dim retVal As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + New AdGroupCriterionOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim adGroupCriterion As BiddableAdGroupCriterion = retVal.value(0) + Dim bidAmount As Long = 0L + For Each bids As Bids In adGroupCriterion.biddingStrategyConfiguration.bids + If TypeOf bids Is CpmBid Then + bidAmount = TryCast(bids, CpmBid).bid.microAmount + End If + Next + + Console.WriteLine("Placement with ad group id = '{0}', id = '{1}' was updated with " & _ + "bid amount = '{2}' micros.", adGroupCriterion.adGroupId, _ + adGroupCriterion.criterion.id, bidAmount) + Else + Console.WriteLine("No placements were updated.") + End If + Catch ex As Exception + Console.WriteLine("Failed to update placement. Exception says ""{0}""", ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/CampaignManagement/AddPlacementsInBulk.vb b/examples/AdXBuyer/Vb/v201309/CampaignManagement/AddPlacementsInBulk.vb new file mode 100644 index 00000000000..042fd70f9d8 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/CampaignManagement/AddPlacementsInBulk.vb @@ -0,0 +1,185 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Text.RegularExpressions +Imports System.Threading + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example shows how to add placements in bulk using the + ''' MutateJobService. + ''' + ''' Tags: MutateJobService.mutate, MutateJobService.get + ''' Tags: MutateJobService.getResult + ''' + Public Class AddPlacementsInBulk + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddPlacementsInBulk + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example shows how to add placements in bulk using the MutateJobService." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad groups to which placements are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the MutateJobService. + Dim mutateJobService As MutateJobService = user.GetService( _ + AdWordsService.v201309.MutateJobService) + + Const RETRY_INTERVAL As Integer = 30 + Const RETRIES_COUNT As Integer = 30 + Const PLACEMENT_NUMBER As Integer = 100 + Const INDEX_REGEX As String = "operations\[(\d+)\].operand" + + Dim operations As New List(Of Operation) + + ' Create AdGroupCriterionOperation to add placements. + For i As Integer = 0 To PLACEMENT_NUMBER + Dim placement As New Placement + placement.url = ("http://mars.google.com/" & i.ToString) + + Dim criterion As New BiddableAdGroupCriterion + criterion.adGroupId = adGroupId + criterion.criterion = placement + + Dim adGroupCriterionOperation As New AdGroupCriterionOperation + adGroupCriterionOperation.operator = [Operator].ADD + adGroupCriterionOperation.operand = criterion + + operations.Add(adGroupCriterionOperation) + Next i + + Dim policy As New BulkMutateJobPolicy + ' You can specify up to 3 job IDs that must successfully complete before + ' this job can be processed. + policy.prerequisiteJobIds = New Long() {} + + Dim job As SimpleMutateJob = mutateJobService.mutate(operations.ToArray, policy) + + ' Wait for the job to complete. + Dim completed As Boolean = False + Dim retryCount As Integer = 0 + Console.WriteLine("Retrieving job status...") + + While (completed = False AndAlso retryCount < RETRIES_COUNT) + Dim selector As New BulkMutateJobSelector + selector.jobIds = New Long() {job.id} + + Try + Dim allJobs As Job() = mutateJobService.get(selector) + If ((Not allJobs Is Nothing) AndAlso (allJobs.Length > 0)) Then + job = allJobs(0) + If ((job.status = BasicJobStatus.COMPLETED) OrElse _ + (job.status = BasicJobStatus.FAILED)) Then + completed = True + Exit While + Else + Console.WriteLine("{0}: Current status is {1}, waiting {2} seconds to retry...", _ + retryCount, job.status, RETRY_INTERVAL) + Thread.Sleep(RETRY_INTERVAL * 1000) + retryCount = retryCount + 1 + End If + End If + Catch ex As Exception + Console.WriteLine("Failed to fetch simple mutate job with id = {0}. Exception " & _ + "says ""{1}"".", job.id, ex.Message) + Return + End Try + End While + + If (job.status = BasicJobStatus.COMPLETED) Then + ' Handle cases where the job completed. + + ' Create the job selector. + Dim selector As New BulkMutateJobSelector + selector.jobIds = New Long() {job.id} + + ' Get the job results. + Dim jobResult As JobResult = mutateJobService.getResult(selector) + If Not jobResult Is Nothing Then + Dim results As SimpleMutateResult = jobResult.Item + If Not results Is Nothing Then + 'Display the results. + If Not results.results Is Nothing Then + For i As Integer = 0 To results.results.Length - 1 + Dim operand As Operand = results.results(i) + Dim status As String + If TypeOf operand.Item Is PlaceHolder Then + status = "FAILED" + Else + status = "SUCCEEDED" + End If + Console.WriteLine("Operation {0} - {1}", i, status) + Next i + End If + + ' Display the errors. + If Not results.errors Is Nothing Then + For Each apiError As ApiError In results.errors + Dim match As Match = Regex.Match(apiError.fieldPath, INDEX_REGEX, _ + RegexOptions.IgnoreCase) + Dim index As String = "???" + If (match.Success) Then + index = match.Groups(1).Value + End If + Console.WriteLine("Operation index {0} failed due to reason: '{1}', " & _ + "trigger: '{2}'", index, apiError.errorString, apiError.trigger) + Next + End If + End If + End If + Console.WriteLine("Job completed successfully!") + ElseIf (job.status = BasicJobStatus.FAILED) Then + ' Handle the cases where job failed. + Console.WriteLine("Job failed with reason: " & job.failureReason.ToString()) + ElseIf (job.status = BasicJobStatus.PROCESSING OrElse job.status = BasicJobStatus.PENDING) _ + Then + ' Handle the cases where job didn't complete after wait period. + Console.WriteLine("Job did not complete in {0} secconds.", RETRY_INTERVAL * RETRIES_COUNT) + End If + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/CampaignManagement/GetAllDisapprovedAds.vb b/examples/AdXBuyer/Vb/v201309/CampaignManagement/GetAllDisapprovedAds.vb new file mode 100644 index 00000000000..bf964f293a4 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/CampaignManagement/GetAllDisapprovedAds.vb @@ -0,0 +1,121 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example retrieves all the disapproved ads in a given campaign. + ''' + ''' Tags: AdGroupAdService.get + ''' + Public Class GetAllDisapprovedAds + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAllDisapprovedAds + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves all the disapproved ads in a given campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which disapproved ads + ''' are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201309.AdGroupAdService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "AdGroupCreativeApprovalStatus", _ + "AdGroupAdDisapprovalReasons"} + + ' Set the filters. + Dim campaignPredicate As New Predicate + campaignPredicate.operator = PredicateOperator.EQUALS + campaignPredicate.field = "CampaignId" + campaignPredicate.values = New String() {campaignId.ToString} + + Dim approvalPredicate As New Predicate + approvalPredicate.operator = PredicateOperator.EQUALS + approvalPredicate.field = "AdGroupCreativeApprovalStatus" + approvalPredicate.values = New String() {AdGroupAdApprovalStatus.DISAPPROVED.ToString()} + + selector.predicates = New Predicate() {campaignPredicate, approvalPredicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupAdPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the disapproved ads. + page = service.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each adGroupAd As AdGroupAd In page.entries + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " & _ + "reason(s):", i, adGroupAd.ad.id) + For Each reason As String In adGroupAd.disapprovalReasons + Console.WriteLine(" {0}", reason) + Next + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get disapproved ads.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb b/examples/AdXBuyer/Vb/v201309/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb new file mode 100644 index 00000000000..3ea88a32da8 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb @@ -0,0 +1,111 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example retrieves all the disapproved ads in a given campaign + ''' using an AWQL query. See + ''' https://developers.google.com/adwords/api/docs/guides/awql for AWQL + ''' documentation. + ''' + ''' Tags: AdGroupAdService.get + ''' + Public Class GetAllDisapprovedAdsWithAwql + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAllDisapprovedAdsWithAwql + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves all the disapproved ads in a given campaign using " & _ + "an AWQL query. See https://developers.google.com/adwords/api/docs/guides/awql for " & _ + "AWQL documentation." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which disapproved ads + ''' are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201309.AdGroupAdService) + + ' Get all the disapproved ads for this campaign. + Dim query As String = String.Format("SELECT Id, AdGroupAdDisapprovalReasons WHERE " & _ + "CampaignId = {0} AND AdGroupCreativeApprovalStatus = DISAPPROVED ORDER BY Id", _ + campaignId) + + Dim offset As Long = 0 + Dim pageSize As Long = 500 + + Dim page As New AdGroupAdPage() + + Try + Do + Dim queryWithPaging As String = String.Format("{0} LIMIT {1}, {2}", query, offset, _ + pageSize) + + ' Get the disapproved ads. + page = service.query(queryWithPaging) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each adGroupAd As AdGroupAd In page.entries + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " & _ + "reason(s):", i, adGroupAd.ad.id) + For Each reason As String In adGroupAd.disapprovalReasons + Console.WriteLine(" {0}", reason) + Next + i = i + 1 + Next + End If + + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get disapproved ads.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/ErrorHandling/HandlePartialFailures.vb b/examples/AdXBuyer/Vb/v201309/ErrorHandling/HandlePartialFailures.vb new file mode 100644 index 00000000000..54133ebe8d9 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/ErrorHandling/HandlePartialFailures.vb @@ -0,0 +1,136 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example demonstrates how to handle partial failures. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class HandlePartialFailures + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandlePartialFailures + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example demonstrates how to handle partial failures." + End Get + End Property + + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which placements are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201309.AdGroupCriterionService) + + ' Set partial failure mode for the service. + adGroupCriterionService.RequestHeader.partialFailure = True + + Dim operations As New List(Of AdGroupCriterionOperation) + + ' Create the placements. + Dim urls As String() = New String() {"http://mars.google.com", "http:/mars.google.com", _ + "mars.google.com"} + For Each url As String In urls + Dim placement As New Placement + placement.url = url + + ' Create biddable ad group criterion. + Dim placementBiddableAdGroupCriterion As New BiddableAdGroupCriterion + placementBiddableAdGroupCriterion.adGroupId = adGroupId + placementBiddableAdGroupCriterion.criterion = placement + + ' Create the operation. + Dim placementAdGroupCriterionOperation As New AdGroupCriterionOperation + placementAdGroupCriterionOperation.operand = placementBiddableAdGroupCriterion + placementAdGroupCriterionOperation.operator = [Operator].ADD + operations.Add(placementAdGroupCriterionOperation) + Next + + Try + ' Create the placements. + Dim result As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + operations.ToArray) + + ' Display the results. + If ((Not result Is Nothing) AndAlso (Not result.value Is Nothing)) Then + For Each adGroupCriterionResult As AdGroupCriterion In result.value + If (Not adGroupCriterionResult.criterion Is Nothing) Then + Console.WriteLine("Placement with ad group id '{0}', criterion id " & _ + "'{1}', and url '{2}' was added.\n", adGroupCriterionResult.adGroupId, _ + adGroupCriterionResult.criterion.id, _ + DirectCast(adGroupCriterionResult.criterion, Placement).url) + End If + Next + Else + Console.WriteLine("No placements were added.") + End If + + ' Display the partial failure errors. + If ((Not result Is Nothing) AndAlso (Not result.partialFailureErrors Is Nothing)) Then + For Each apiError As ApiError In result.partialFailureErrors + Dim operationIndex As Integer = ErrorUtilities.GetOperationIndex(apiError.fieldPath) + If (operationIndex <> -1) Then + Dim adGroupCriterion As AdGroupCriterion = operations(operationIndex).operand + Console.WriteLine("Placement with ad group id '{0}' and url '{1}' " & _ + "triggered a failure for the following reason: '{2}'.\n", _ + adGroupCriterion.adGroupId, _ + DirectCast(adGroupCriterion.criterion, Placement).url, _ + apiError.errorString) + Else + Console.WriteLine("A failure for the following reason: '{0}' has occurred.\n", _ + apiError.errorString) + End If + Next + End If + Catch e As Exception + Console.WriteLine("Failed to add placement(s) in partial failure mode. Exception " & _ + "says '{0}'", e.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/ErrorHandling/HandlePolicyViolationError.vb b/examples/AdXBuyer/Vb/v201309/ErrorHandling/HandlePolicyViolationError.vb new file mode 100644 index 00000000000..bcdb78a69a4 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/ErrorHandling/HandlePolicyViolationError.vb @@ -0,0 +1,184 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example adds a text ad, and shows how to handle a policy + ''' violation. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class HandlePolicyViolationError + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandlePolicyViolationError + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a text ad, and shows how to handle a policy violation." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which ads are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService( _ + AdWordsService.v201309.AdGroupAdService) + + ' Create a third party redirect ad that violates a policy. + ' Create the third party redirect ad. + Dim redirectAd As New ThirdPartyRedirectAd + redirectAd.name = String.Format("Policy violation demo ad ", ExampleUtilities.GetRandomString) + redirectAd.url = "gopher://gopher.google.com" + + redirectAd.dimensions = New Dimensions + redirectAd.dimensions.height = 250 + redirectAd.dimensions.width = 300 + + redirectAd.snippet = "" + redirectAd.impressionBeaconUrl = "http://www.examples.com/beacon" + redirectAd.certifiedVendorFormatId = 119 + redirectAd.isCookieTargeted = False + redirectAd.isUserInterestTargeted = False + redirectAd.isTagged = False + + Dim redirectAdGroupAd As New AdGroupAd + redirectAdGroupAd.adGroupId = adGroupId + redirectAdGroupAd.ad = redirectAd + + ' Create the operations. + Dim redirectAdOperation As New AdGroupAdOperation + redirectAdOperation.operator = [Operator].ADD + redirectAdOperation.operand = redirectAdGroupAd + + Try + Dim retVal As AdGroupAdReturnValue = Nothing + + ' Setup two arrays, one to hold the list of all operations to be + ' validated, and another to hold the list of operations that cannot be + ' fixed after validation. + Dim allOperations As New List(Of AdGroupAdOperation) + Dim operationsToBeRemoved As New List(Of AdGroupAdOperation) + + allOperations.Add(redirectAdOperation) + + Try + ' Validate the operations. + service.RequestHeader.validateOnly = True + retVal = service.mutate(allOperations.ToArray) + Catch ex As AdWordsApiException + Dim innerException As ApiException = TryCast(ex.ApiException, ApiException) + If (innerException Is Nothing) Then + Throw New Exception("Failed to retrieve ApiError. See inner exception for more " & _ + "details.", ex) + End If + + ' Examine each ApiError received from the server. + For Each apiError As ApiError In innerException.errors + Dim index As Integer = ErrorUtilities.GetOperationIndex(apiError.fieldPath) + If (index = -1) Then + ' This API error is not associated with an operand, so we cannot + ' recover from this error by removing one or more operations. + ' Rethrow the exception for manual inspection. + Throw + End If + + ' Handle policy violation errors. + If TypeOf apiError Is PolicyViolationError Then + Dim policyError As PolicyViolationError = apiError + + If policyError.isExemptable Then + ' If the policy violation error is exemptable, add an exemption + ' request. + Dim exemptionRequests As New List(Of ExemptionRequest) + If (Not allOperations.Item(index).exemptionRequests Is Nothing) Then + exemptionRequests.AddRange(allOperations.Item(index).exemptionRequests) + End If + + Dim exemptionRequest As New ExemptionRequest + exemptionRequest.key = policyError.key + exemptionRequests.Add(exemptionRequest) + allOperations.Item(index).exemptionRequests = exemptionRequests.ToArray + Else + ' Policy violation error is not exemptable, remove this + ' operation from the list of operations. + operationsToBeRemoved.Add(allOperations.Item(index)) + End If + Else + ' This is not a policy violation error, remove this operation + ' from the list of operations. + operationsToBeRemoved.Add(allOperations.Item(index)) + End If + Next + + ' Remove all operations that aren't exemptable. + For Each operation As AdGroupAdOperation In operationsToBeRemoved + allOperations.Remove(operation) + Next + End Try + If (allOperations.Count > 0) Then + ' Perform the operations exemptible of a policy violation. + service.RequestHeader.validateOnly = False + retVal = service.mutate(allOperations.ToArray) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) _ + AndAlso (retVal.value.Length > 0)) Then + For Each newAdGroupAd As AdGroupAd In retVal.value + Console.WriteLine("New ad with id = ""{0}"" and displayUrl = ""{1}"" was created.", _ + newAdGroupAd.ad.id, newAdGroupAd.ad.displayUrl) + Next + Else + Console.WriteLine("No ads were created.") + End If + Else + Console.WriteLine("There are no ads to create after policy violation checks.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create Ad(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/ErrorHandling/HandleRateExceededError.vb b/examples/AdXBuyer/Vb/v201309/ErrorHandling/HandleRateExceededError.vb new file mode 100644 index 00000000000..965d10420ee --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/ErrorHandling/HandleRateExceededError.vb @@ -0,0 +1,206 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Net +Imports System.Threading + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example shows how to handle RateExceededError in your + ''' application. To trigger the rate exceeded error, this code example runs + ''' 100 threads in parallel, each thread attempting to validate 100 keywords + ''' in a single request. Note that spawning 100 parallel threads is for + ''' illustrative purposes only, you shouldn't do this in your application. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class HandleRateExceededError + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandleRateExceededError + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example shows how to handle RateExceededError in your application. " & _ + "To trigger the rate exceeded error, this code example runs 100 threads in " & _ + "parallel, each thread attempting to validate 100 keywords in a single request. " & _ + "Note that spawning 100 parallel threads is for illustrative purposes only, you " & _ + "shouldn't do this in your application." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which keywords are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + Const NUM_THREADS As Integer = 100 + + ' Increase the maximum number of parallel HTTP connections that .NET + ' framework allows. By default, this is set to 2 by the .NET framework. + ServicePointManager.DefaultConnectionLimit = NUM_THREADS + + Dim threads As New List(Of Thread) + + For i As Integer = 0 To NUM_THREADS + Dim thread As New Thread(AddressOf New KeywordThread(user, i, adGroupId).Run) + threads.Add(thread) + Next i + + For i As Integer = 0 To threads.Count - 1 + threads.Item(i).Start(i) + Next i + + For i As Integer = 0 To threads.Count - 1 + threads.Item(i).Join() + Next i + End Sub + + ''' + ''' Thread class for validating keywords. + ''' + Public Class KeywordThread + ''' + ''' Index of this thread, for identifying and debugging. + ''' + Dim threadIndex As Integer + + ''' + ''' The ad group id to which keywords are added. + ''' + Dim adGroupId As Long + + ''' + ''' The AdWords user who owns this ad group. + ''' + Dim user As AdWordsUser + + ''' + ''' Number of keywords to be validated in each API call. + ''' + Const NUM_KEYWORDS As Integer = 100 + + ''' + ''' Initializes a new instance of the class. + ''' + ''' Index of the thread. + ''' The ad group id. + ''' The AdWords user who owns the ad group. + Public Sub New(ByVal user As AdWordsUser, ByVal threadIndex As Integer, _ + ByVal adGroupId As Long) + Me.user = user + Me.threadIndex = threadIndex + Me.adGroupId = adGroupId + End Sub + + ''' + ''' Main method for the thread. + ''' + ''' The thread parameter. + Public Sub Run(ByVal obj As Object) + ' Create the operations. + Dim operations As New List(Of AdGroupCriterionOperation) + For j As Integer = 0 To NUM_KEYWORDS + ' Create the keyword. + Dim keyword As New Keyword + keyword.text = "mars cruise thread " & threadIndex.ToString & " seed " & j.ToString + keyword.matchType = KeywordMatchType.BROAD + + ' Create the biddable ad group criterion. + Dim keywordCriterion As AdGroupCriterion = New BiddableAdGroupCriterion + keywordCriterion.adGroupId = adGroupId + keywordCriterion.criterion = keyword + + ' Create the operations. + Dim keywordOperation As New AdGroupCriterionOperation + keywordOperation.operator = [Operator].ADD + keywordOperation.operand = keywordCriterion + + operations.Add(keywordOperation) + Next j + + ' Get the AdGroupCriterionService. This should be done within the + ' thread, since a service can only handle one outgoing HTTP request + ' at a time. + Dim service As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201309.AdGroupCriterionService) + service.RequestHeader.validateOnly = True + Dim retryCount As Integer = 0 + Const NUM_RETRIES As Integer = 3 + Try + While (retryCount < NUM_RETRIES) + Try + ' Validate the keywords. + Dim retval As AdGroupCriterionReturnValue = service.mutate(operations.ToArray) + Exit While + Catch ex As AdWordsApiException + ' Handle API errors. + Dim innerException As ApiException = TryCast(ex.ApiException, ApiException) + If (innerException Is Nothing) Then + Throw New Exception("Failed to retrieve ApiError. See inner exception for more " & _ + "details.", ex) + End If + For Each apiError As ApiError In innerException.errors + If Not TypeOf apiError Is RateExceededError Then + ' Rethrow any errors other than RateExceededError. + Throw + End If + ' Handle rate exceeded errors. + Dim rateExceededError As RateExceededError = DirectCast(apiError, RateExceededError) + Console.WriteLine("Got Rate exceeded error - rate name = '{0}', scope = '{1}', " & _ + "retry After {2} seconds.", rateExceededError.rateScope, _ + rateExceededError.rateName, rateExceededError.retryAfterSeconds) + Thread.Sleep(rateExceededError.retryAfterSeconds) + retryCount = retryCount + 1 + Next + Finally + If (retryCount = NUM_RETRIES) Then + Throw New Exception(String.Format("Could not recover after making {0} attempts.", _ + retryCount)) + End If + End Try + End While + Catch ex As Exception + Throw New System.ApplicationException("Failed to validate keywords.", ex) + End Try + End Sub + End Class + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/ErrorHandling/HandleTwoFactorAuthorizationError.vb b/examples/AdXBuyer/Vb/v201309/ErrorHandling/HandleTwoFactorAuthorizationError.vb new file mode 100644 index 00000000000..4292db476db --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/ErrorHandling/HandleTwoFactorAuthorizationError.vb @@ -0,0 +1,95 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.Common.Lib + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example illustrates how to handle 2 factor authorization errors. + ''' + ''' Tags: CampaignService.get + ''' + Public Class HandleTwoFactorAuthorizationError + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandleTwoFactorAuthorizationError + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to handle 2 factor authorization errors." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Use a test account for which 2 factor authentication has been enabled. + Dim loginEmail As String = "2steptester@gmail.com" + Dim password As String = "testaccount" + + Dim config As New AdWordsAppConfig + config.Email = loginEmail + config.Password = password + Dim authToken As New AuthToken(config, "adwords") + + Try + ' Try to obtain an authToken. + Dim token As String = authToken.GetToken + Console.WriteLine("Retrieved an authToken = {0} for user {1}.", token, loginEmail) + Catch ex As AuthTokenException + ' Since the test account has 2 factor authentication enabled, this block + ' of code will be executed. + If (ex.ErrorCode = AuthTokenErrorCode.BadAuthentication) Then + If (ex.Info = "InvalidSecondFactor") Then + Console.WriteLine("The user has enabled two factor authentication in this " & _ + "account. Have the user generate an application-specific password to make " & _ + "calls against the AdWords API. See " & _ + "http://adwordsapi.blogspot.com/2011/02/authentication-changes-with-2-step.html" & _ + "for more details.") + Else + Console.WriteLine("Invalid credentials.") + End If + Else + Throw New System.ApplicationException(String.Format("The server raised an {0} error.", _ + ex.ErrorCode), ex) + End If + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/Miscellaneous/GetAllVideosAndImages.vb b/examples/AdXBuyer/Vb/v201309/Miscellaneous/GetAllVideosAndImages.vb new file mode 100644 index 00000000000..a6ca8b9422c --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/Miscellaneous/GetAllVideosAndImages.vb @@ -0,0 +1,139 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example gets all videos and images. To upload video, see + ''' http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. + ''' To upload image, run UploadImage.vb. + ''' + ''' Tags: MediaService.get + ''' + Public Class GetAllVideosAndImages + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAllVideosAndImages + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all videos and images. To upload video, see " & _ + "http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. To " & _ + "upload image, run UploadImage.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the MediaService. + Dim mediaService As MediaService = user.GetService(AdWordsService.v201309.MediaService) + + ' Create the video selector. + Dim selector As New Selector + selector.fields = New String() {"MediaId", "Width", "Height", "MimeType"} + + ' Set the filter. + Dim predicate As New Predicate + predicate.operator = PredicateOperator.IN + predicate.field = "Type" + predicate.values = New String() {MediaMediaType.VIDEO.ToString(), _ + MediaMediaType.IMAGE.ToString()} + + selector.predicates = New Predicate() {predicate} + + ' Select selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New MediaPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + page = mediaService.get(selector) + + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each media As Media In page.entries + If TypeOf media Is Video Then + Dim video As Video = media + Console.WriteLine("{0}) Video with id '{1}' and name '{2}' was found.", _ + i, video.mediaId, video.name) + ElseIf TypeOf media Is Image Then + Dim image As Image = media + Dim dimensions As Dictionary(Of MediaSize, Dimensions) = _ + CreateMediaDimensionMap(image.dimensions) + Console.WriteLine("{0}) Image with id '{1}', dimensions '{2}x{3}', and MIME " & _ + "type '{4}' was found.", i, image.mediaId, dimensions(MediaSize.FULL).width, _ + dimensions(MediaSize.FULL).height, image.mimeType) + End If + i = i + 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of images and videos found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get images and videos.", ex) + End Try + End Sub + + ''' + ''' Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + ''' + ''' The array of Media_Size_DimensionsMapEntry to be + ''' converted into a dictionary. + ''' A dictionary with key as MediaSize, and value as Dimensions. + ''' + Private Function CreateMediaDimensionMap(ByVal dimensions As Media_Size_DimensionsMapEntry()) _ + As Dictionary(Of MediaSize, Dimensions) + Dim mediaMap As New Dictionary(Of MediaSize, Dimensions) + For Each dimension As Media_Size_DimensionsMapEntry In dimensions + mediaMap.Add(dimension.key, dimension.value) + Next + Return mediaMap + End Function + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/Miscellaneous/UploadImage.vb b/examples/AdXBuyer/Vb/v201309/Miscellaneous/UploadImage.vb new file mode 100644 index 00000000000..3c9d5aa3396 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/Miscellaneous/UploadImage.vb @@ -0,0 +1,107 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 +Imports Google.Api.Ads.Common.Util + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example uploads an image. To get images, run GetAllVideosAndImages.vb. + ''' + ''' Tags: MediaService.upload + ''' + Public Class UploadImage + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UploadImage + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example uploads an image. To get images, run GetAllVideosAndImages.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the MediaService. + Dim mediaService As MediaService = user.GetService( _ + AdWordsService.v201309.MediaService) + + ' Create the image. + Dim image As New Image + image.data = MediaUtilities.GetAssetDataFromUrl("http://goo.gl/HJM3L") + image.type = MediaMediaType.IMAGE + + Try + ' Upload the image. + Dim result As Media() = mediaService.upload(New Media() {image}) + + ' Display the results. + If ((Not result Is Nothing) AndAlso (result.Length > 0)) Then + Dim newImage As Media = result(0) + Dim dimensions As Dictionary(Of MediaSize, Dimensions) = _ + CreateMediaDimensionMap(newImage.dimensions) + Console.WriteLine("Image with id '{0}', dimensions '{1}x{2}', and MIME type '{3}'" & _ + " was uploaded.", newImage.mediaId, dimensions.Item(MediaSize.FULL).width, _ + dimensions.Item(MediaSize.FULL).height, newImage.mimeType) + Else + Console.WriteLine("No images were uploaded.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to upload images.", ex) + End Try + End Sub + + ''' + ''' Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + ''' + ''' The array of Media_Size_DimensionsMapEntry to + ''' be converted into a dictionary. + ''' A dictionary with key as MediaSize, and value as Dimensions. + ''' + Private Function CreateMediaDimensionMap(ByVal dimensions As Media_Size_DimensionsMapEntry()) _ + As Dictionary(Of MediaSize, Dimensions) + Dim mediaMap As New Dictionary(Of MediaSize, Dimensions) + For Each dimension As Media_Size_DimensionsMapEntry In dimensions + mediaMap.Add(dimension.key, dimension.value) + Next + Return mediaMap + End Function + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/Optimization/GetPlacementIdeas.vb b/examples/AdXBuyer/Vb/v201309/Optimization/GetPlacementIdeas.vb new file mode 100644 index 00000000000..e8e83649ada --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/Optimization/GetPlacementIdeas.vb @@ -0,0 +1,123 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example retrieves urls that have content keywords related to a + ''' given website. + ''' + ''' Tags: TargetingIdeaService.get + ''' + Public Class GetPlacementIdeas + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetPlacementIdeas + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves urls that have content keywords related to a " & _ + "given website." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the TargetingIdeaService. + Dim targetingIdeaService As TargetingIdeaService = user.GetService( _ + AdWordsService.v201309.TargetingIdeaService) + + ' Create seed url. + Dim url As String = "mars.google.com" + + ' Create the selector. + Dim selector As New TargetingIdeaSelector + selector.requestType = RequestType.IDEAS + selector.ideaType = IdeaType.PLACEMENT + selector.requestedAttributeTypes = New AttributeType() {AttributeType.CRITERION, _ + AttributeType.PLACEMENT_TYPE} + + ' Create related to url search parameter. + Dim relatedToUrlSearchParameter As New RelatedToUrlSearchParameter + relatedToUrlSearchParameter.urls = New String() {url} + relatedToUrlSearchParameter.includeSubUrls = False + selector.searchParameters = New SearchParameter() {relatedToUrlSearchParameter} + + ' Select selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New TargetingIdeaPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get placement ideas. + page = targetingIdeaService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each idea As TargetingIdea In page.entries + For Each entry As Type_AttributeMapEntry In idea.data + If (entry.key = AttributeType.CRITERION) Then + Dim placementAttribute As CriterionAttribute = entry.value + Dim placement As Placement = placementAttribute.value + Console.WriteLine("{0}) Related placement urls were found at '{1}'.", _ + i, placement.url) + End If + Next + Next + i += 1 + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of related placements found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve related placements.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/Remarketing/AddAudience.vb b/examples/AdXBuyer/Vb/v201309/Remarketing/AddAudience.vb new file mode 100644 index 00000000000..fe73d130d76 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/Remarketing/AddAudience.vb @@ -0,0 +1,154 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example illustrates how to create a user list a.k.a. audience. + ''' + ''' Tags: UserListService.mutate + ''' + Public Class AddAudience + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAudience + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to create a user list a.k.a. audience." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the UserListService. + Dim userListService As AdwordsUserListService = user.GetService( _ + AdWordsService.v201309.AdwordsUserListService) + + ' Get the ConversionTrackerService. + Dim conversionTrackerService As ConversionTrackerService = user.GetService( _ + AdWordsService.v201309.ConversionTrackerService) + + Dim userList As New BasicUserList + + userList.name = ("Mars cruise customers #" & ExampleUtilities.GetRandomString) + userList.description = "A list of mars cruise customers in the last year." + userList.status = UserListMembershipStatus.OPEN + userList.membershipLifeSpan = 365 + + Dim conversionType As New UserListConversionType + conversionType.name = userList.name + userList.conversionTypes = New UserListConversionType() {conversionType} + + ' Optional: Set the user list status. + userList.status = UserListMembershipStatus.OPEN + + ' Create the operation. + Dim operation As New UserListOperation + operation.operand = userList + operation.operator = [Operator].ADD + + Try + ' Add the user list. + Dim retval As UserListReturnValue = userListService.mutate(New UserListOperation() _ + {operation}) + + Dim userLists As UserList() = Nothing + If ((Not retval Is Nothing) AndAlso (Not retval.value Is Nothing)) Then + userLists = retval.value + ' Get all conversion snippets. + Dim conversionIds As New List(Of String) + For Each newUserList As BasicUserList In userLists + If (Not newUserList.conversionTypes Is Nothing) Then + For Each newConversionType As UserListConversionType In _ + newUserList.conversionTypes + conversionIds.Add(newConversionType.id.ToString) + Next + End If + Next + + Dim conversionsMap As New Dictionary(Of Long, ConversionTracker) + + If (conversionIds.Count > 0) Then + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id"} + + Dim conversionTypePredicate As New Predicate + conversionTypePredicate.field = "Id" + conversionTypePredicate.operator = PredicateOperator.IN + conversionTypePredicate.values = conversionIds.ToArray + selector.predicates = New Predicate() {conversionTypePredicate} + + ' Get all conversion trackers. + Dim page As ConversionTrackerPage = conversionTrackerService.get(selector) + + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + For Each tracker As ConversionTracker In page.entries + conversionsMap.Item(tracker.id) = tracker + Next + End If + End If + + ' Display the results. + For Each newUserList As BasicUserList In userLists + Console.WriteLine("User list with name '{0}' and id '{1}' was added.", _ + newUserList.name, newUserList.id) + + ' Display user list associated conversion code snippets. + If (Not newUserList.conversionTypes Is Nothing) Then + For Each newConversionType As UserListConversionType In newUserList.conversionTypes + Dim conversionTracker As AdWordsConversionTracker = _ + DirectCast(conversionsMap.Item(newConversionType.id), _ + AdWordsConversionTracker) + Console.WriteLine("Conversion type code snippet associated to the list:\n{0}", _ + conversionTracker.snippet) + Next + End If + Next + Else + Console.WriteLine("No user lists (a.k.a. audiences) were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add user lists (a.k.a. audiences).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/Remarketing/AddConversionTracker.vb b/examples/AdXBuyer/Vb/v201309/Remarketing/AddConversionTracker.vb new file mode 100644 index 00000000000..b41a35d0655 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/Remarketing/AddConversionTracker.vb @@ -0,0 +1,108 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example adds an AdWords conversion tracker. + ''' + ''' Tags: ConversionTrackerService.mutate + ''' + Public Class AddConversionTracker + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddConversionTracker + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds an AdWords conversion tracker." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the ConversionTrackerService. + Dim conversionTrackerService As ConversionTrackerService = user.GetService( _ + AdWordsService.v201309.ConversionTrackerService) + + ' Create AdWords conversion tracker. + Dim conversionTracker As New AdWordsConversionTracker + conversionTracker.name = "Earth to Mars Cruises Conversion #" & _ + ExampleUtilities.GetRandomString + conversionTracker.category = ConversionTrackerCategory.DEFAULT + conversionTracker.markupLanguage = AdWordsConversionTrackerMarkupLanguage.HTML + conversionTracker.textFormat = AdWordsConversionTrackerTextFormat.HIDDEN + + ' Set optional fields. + conversionTracker.status = ConversionTrackerStatus.ENABLED + conversionTracker.viewthroughLookbackWindow = 15 + conversionTracker.isProductAdsChargeable = True + conversionTracker.productAdsChargeableConversionWindow = 15 + conversionTracker.conversionPageLanguage = "en" + conversionTracker.backgroundColor = "#0000FF" + conversionTracker.userRevenueValue = "someJavascriptVariable" + + ' Create the operation. + Dim operation As New ConversionTrackerOperation + operation.operator = [Operator].ADD + operation.operand = conversionTracker + + Try + ' Add conversion tracker. + Dim retval As ConversionTrackerReturnValue = conversionTrackerService.mutate( _ + New ConversionTrackerOperation() {operation}) + + ' Display the results. + If ((Not retval Is Nothing) AndAlso (Not retval.value Is Nothing) AndAlso _ + retval.value.Length > 0) Then + Dim newConversionTracker As ConversionTracker = retval.value(0) + Console.WriteLine("Conversion tracker with id '{0}', name '{1}', status '{2}', " & _ + "category '{3}' was added.", newConversionTracker.id, newConversionTracker.name, _ + newConversionTracker.status, newConversionTracker.category) + Else + Console.WriteLine("No conversion trackers were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add conversion tracker.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/Reporting/DownloadCriteriaReport.vb b/examples/AdXBuyer/Vb/v201309/Reporting/DownloadCriteriaReport.vb new file mode 100644 index 00000000000..6d8782131a5 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/Reporting/DownloadCriteriaReport.vb @@ -0,0 +1,118 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util.Reports +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example gets and downloads a criteria Ad Hoc report from an XML + ''' report definition. + ''' + Public Class DownloadCriteriaReport + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DownloadCriteriaReport + Console.WriteLine(codeExample.Description) + Try + Dim fileName As String = "INSERT_OUTPUT_FILE_NAME" + codeExample.Run(New AdWordsUser, fileName) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets and downloads a criteria Ad Hoc report from an XML report" & _ + " definition." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The file to which the report is downloaded. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal fileName As String) + Dim definition As New ReportDefinition + + definition.reportName = "Last 7 days CRITERIA_PERFORMANCE_REPORT" + definition.reportType = ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT + definition.downloadFormat = DownloadFormat.GZIPPED_CSV + definition.dateRangeType = ReportDefinitionDateRangeType.LAST_7_DAYS + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"CampaignId", "AdGroupId", "Id", "CriteriaType", "Criteria", _ + "CriteriaDestinationUrl", "Clicks", "Impressions", "Cost"} + + Dim predicate As New Predicate + predicate.field = "Status" + predicate.operator = PredicateOperator.IN + predicate.values = New String() {"ACTIVE", "PAUSED"} + selector.predicates = New Predicate() {predicate} + + definition.selector = selector + definition.includeZeroImpressions = True + + Dim filePath As String = ExampleUtilities.GetHomeDir() & Path.DirectorySeparatorChar & _ + fileName + + Try + ' If you know that your report is small enough to fit in memory, then + ' you can instead use + ' Dim utilities As New ReportUtilities(user) + ' utilities.ReportVersion = "v201309" + ' Dim report As ClientReport = utilities.GetClientReport( _ + ' Of ReportDefinition)(definition) + ' + ' ' Get the text report directly if you requested a text format + ' ' (e.g. xml) + ' Dim reportText As String = report.Text + ' + ' ' Get the binary report if you requested a binary format + ' ' (e.g. gzip) + ' Dim reportBytes As Byte() = report.Contents + ' + ' ' Deflate a zipped binary report for further processing. + ' Dim deflatedReportText As String = Encoding.UTF8.GetString( _ + ' MediaUtilities.DeflateGZipData(report.Contents)) + Dim utilities As New ReportUtilities(user) + utilities.ReportVersion = "v201309" + utilities.DownloadClientReport(Of ReportDefinition)(definition, filePath) + Console.WriteLine("Report was downloaded to '{0}'.", filePath) + Catch ex As Exception + Throw New System.ApplicationException("Failed to download report.", ex) + End Try + + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/Reporting/DownloadCriteriaReportWithAwql.vb b/examples/AdXBuyer/Vb/v201309/Reporting/DownloadCriteriaReportWithAwql.vb new file mode 100644 index 00000000000..d27e738908b --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/Reporting/DownloadCriteriaReportWithAwql.vb @@ -0,0 +1,102 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util.Reports +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example gets and downloads a criteria Ad Hoc report from an AWQL + ''' query. See https://developers.google.com/adwords/api/docs/guides/awql for + ''' AWQL documentation. + ''' + Public Class DownloadCriteriaReportWithAwql + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DownloadCriteriaReportWithAwql + Console.WriteLine(codeExample.Description) + Try + Dim fileName As String = "INSERT_OUTPUT_FILE_NAME" + codeExample.Run(New AdWordsUser, fileName) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets and downloads a criteria Ad Hoc report from an AWQL" & _ + " query. See https://developers.google.com/adwords/api/docs/guides/awql for" & _ + " AWQL documentation." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The file to which the report is downloaded. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal fileName As String) + Dim query As String = "SELECT CampaignId, AdGroupId, Id, Criteria, CriteriaType, " & _ + "Impressions, Clicks, Cost FROM CRITERIA_PERFORMANCE_REPORT WHERE Status IN " & _ + "[ACTIVE, PAUSED] DURING LAST_7_DAYS" + + Dim filePath As String = ExampleUtilities.GetHomeDir() + Path.DirectorySeparatorChar & _ + fileName + + Try + ' If you know that your report is small enough to fit in memory, then + ' you can instead use + ' Dim utilities As New ReportUtilities(user) + ' utilities.ReportVersion = "v201309" + ' Dim report As ClientReport = utilities.GetClientReport(query, format) + ' + ' ' Get the text report directly if you requested a text format + ' ' (e.g. xml) + ' Dim reportText As String = report.Text + ' + ' ' Get the binary report if you requested a binary format + ' ' (e.g. gzip) + ' Dim reportBytes As Byte() = report.Contents + ' + ' ' Deflate a zipped binary report for further processing. + ' Dim deflatedReportText As String = Encoding.UTF8.GetString( _ + ' MediaUtilities.DeflateGZipData(report.Contents)) + Dim utilities As New ReportUtilities(user) + utilities.ReportVersion = "v201309" + utilities.DownloadClientReport(query, DownloadFormat.GZIPPED_CSV.ToString(), filePath) + Console.WriteLine("Report was downloaded to '{0}'.", filePath) + Catch ex As Exception + Throw New System.ApplicationException("Failed to download report.", ex) + End Try + + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/Reporting/GetReportFields.vb b/examples/AdXBuyer/Vb/v201309/Reporting/GetReportFields.vb new file mode 100644 index 00000000000..43ceb9dd060 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/Reporting/GetReportFields.vb @@ -0,0 +1,97 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example gets report fields. + ''' + ''' Tags: ReportDefinitionService.getReportFields + ''' + Public Class GetReportFields + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetReportFields + Console.WriteLine(codeExample.Description) + Try + Dim reportType As ReportDefinitionReportType = [Enum].Parse( _ + GetType(ReportDefinitionReportType), "INSERT_REPORT_TYPE_HERE") + codeExample.Run(New AdWordsUser, reportType) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets report fields." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The report type to be run. + Public Sub Run(ByVal user As AdWordsUser, ByVal reportType As ReportDefinitionReportType) + ' Get the ReportDefinitionService. + Dim reportDefinitionService As ReportDefinitionService = user.GetService( _ + AdWordsService.v201309.ReportDefinitionService) + + ' The type of the report to get fields for. + ' E.g.: KEYWORDS_PERFORMANCE_REPORT + + Try + ' Get the report fields. + Dim reportDefinitionFields As ReportDefinitionField() = _ + reportDefinitionService.getReportFields(reportType) + + If ((Not reportDefinitionFields Is Nothing) AndAlso _ + (reportDefinitionFields.Length > 0)) Then + ' Display report fields. + Console.WriteLine("The report type '{0}' contains the following fields:", reportType) + + For Each reportDefinitionField As ReportDefinitionField In reportDefinitionFields + Console.Write("- {0} ({1})", reportDefinitionField.fieldName, _ + reportDefinitionField.fieldType) + If (Not reportDefinitionField.enumValues Is Nothing) Then + Console.Write(" := [{0}]", String.Join(", ", reportDefinitionField.enumValues)) + End If + Console.WriteLine() + Next + Else + Console.WriteLine("This report type has no fields.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve fields for report type.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/Targeting/AddCampaignTargetingCriteria.vb b/examples/AdXBuyer/Vb/v201309/Targeting/AddCampaignTargetingCriteria.vb new file mode 100644 index 00000000000..53f2d3d8c5a --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/Targeting/AddCampaignTargetingCriteria.vb @@ -0,0 +1,138 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example adds various types of targeting criteria to a campaign. + ''' To get a list of campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignCriterionService.mutate + ''' + Public Class AddCampaignTargetingCriteria + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddCampaignTargetingCriteria + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds various types of targeting criteria to a campaign. To " & _ + "get a list of campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to which targeting criteria + ''' are added. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignCriterionService. + Dim campaignCriterionService As CampaignCriterionService = user.GetService( _ + AdWordsService.v201309.CampaignCriterionService) + + ' Create language criteria. + ' See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + ' for a detailed list of language codes. + Dim language1 As New Language + language1.id = 1002 ' French + Dim languageCriterion1 As New CampaignCriterion + languageCriterion1.campaignId = campaignId + languageCriterion1.criterion = language1 + + Dim language2 As New Language + language2.id = 1005 ' Japanese + Dim languageCriterion2 As New CampaignCriterion + languageCriterion2.campaignId = campaignId + languageCriterion2.criterion = language2 + + ' Create location criteria. + ' See http://code.google.com/apis/adwords/docs/appendix/countrycodes.html + ' for a detailed list of country codes. + Dim location1 As New Location + location1.id = 2840 ' USA + Dim locationCriterion1 As New CampaignCriterion + locationCriterion1.campaignId = campaignId + locationCriterion1.criterion = location1 + + Dim location2 As New Location + location2.id = 2392 ' Japan + Dim locationCriterion2 As New CampaignCriterion + locationCriterion2.campaignId = campaignId + locationCriterion2.criterion = location2 + + ' Add a negative campaign placement. + Dim negativeCriterion As New NegativeCampaignCriterion() + negativeCriterion.campaignId = campaignId + + Dim placement As New Placement() + placement.url = "http://mars.google.com" + + negativeCriterion.criterion = placement + + Dim criteria() As CampaignCriterion = {languageCriterion1, languageCriterion2, _ + locationCriterion1, locationCriterion2, negativeCriterion} + + Dim operations As New List(Of CampaignCriterionOperation) + + For Each criterion As CampaignCriterion In criteria + Dim operation As New CampaignCriterionOperation + operation.operator = [Operator].ADD + operation.operand = criterion + operations.Add(operation) + Next + + Try + ' Set the campaign targets. + Dim retVal As CampaignCriterionReturnValue = campaignCriterionService.mutate( _ + operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing)) Then + For Each criterion As CampaignCriterion In retVal.value + Console.WriteLine("Campaign criterion of type '{0}' was set to campaign with id " & _ + "= '{1}'.", criterion.criterion.CriterionType, criterion.campaignId) + Next + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to set campaign criteria.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/Targeting/GetCampaignTargetingCriteria.vb b/examples/AdXBuyer/Vb/v201309/Targeting/GetCampaignTargetingCriteria.vb new file mode 100644 index 00000000000..e5337c59f33 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/Targeting/GetCampaignTargetingCriteria.vb @@ -0,0 +1,123 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example gets all targeting criteria for a campaign. To set + ''' campaign targeting criteria, run AddCampaignTargetingCriteria.vb. To get + ''' campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignCriterionService.get + ''' + Public Class GetCampaignTargetingCriteria + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetCampaignTargetingCriteria + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all targeting criteria for a campaign. To set campaign " & _ + "targeting criteria, run AddCampaignTargetingCriteria.vb. To get campaigns, run " & _ + "GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign from which targeting + ''' criteria are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignCriterionService. + Dim campaignCriterionService As CampaignCriterionService = user.GetService( _ + AdWordsService.v201309.CampaignCriterionService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "CriteriaType", "PlacementUrl"} + + ' Set the filters. + Dim campaignPredicate As New Predicate + campaignPredicate.field = "CampaignId" + campaignPredicate.operator = PredicateOperator.EQUALS + campaignPredicate.values = New String() {campaignId.ToString} + + Dim placementPredicate As New Predicate + placementPredicate.field = "CriteriaType" + placementPredicate.operator = PredicateOperator.EQUALS + placementPredicate.values = New String() {"PLACEMENT"} + + selector.predicates = New Predicate() {campaignPredicate, placementPredicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New CampaignCriterionPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get all campaign targets. + page = campaignCriterionService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each campaignCriterion As CampaignCriterion In page.entries + Dim placement As Placement = campaignCriterion.criterion + Console.WriteLine("{0}) Placement with ID {1} and url {2} was found.", i, _ + placement.id, placement.url) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of placements found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get placements.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/Targeting/GetTargetableLanguagesAndCarriers.vb b/examples/AdXBuyer/Vb/v201309/Targeting/GetTargetableLanguagesAndCarriers.vb new file mode 100644 index 00000000000..2c6b08eeb80 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/Targeting/GetTargetableLanguagesAndCarriers.vb @@ -0,0 +1,100 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example illustrates how to retrieve all carriers and languages + ''' available for targeting. + ''' + ''' Tags: ConstantDataService.getCarrierCriterion + ''' Tags: ConstantDataService.getLanguageCriterion + ''' + Public Class GetTargetableLanguagesAndCarriers + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetTargetableLanguagesAndCarriers + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to retrieve all carriers and languages" & _ + "available for targeting." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the ConstantDataService. + Dim constantDataService As ConstantDataService = user.GetService( _ + AdWordsService.v201309.ConstantDataService) + + Try + ' Get all carriers. + Dim carriers As Carrier() = constantDataService.getCarrierCriterion + + ' Display the results. + If (Not carriers Is Nothing) Then + For Each carrier As Carrier In carriers + Console.WriteLine("Carrier name is '{0}', ID is {1} and country code is '{2}'.", _ + carrier.name, carrier.id, carrier.countryCode) + Next + Else + Console.WriteLine("No carriers were retrieved.") + End If + + ' Get all languages. + Dim languages As Language() = constantDataService.getLanguageCriterion + + ' Display the results. + If (Not languages Is Nothing) Then + For Each language As Language In languages + Console.WriteLine("Language name is '{0}', ID is {1} and code is '{2}'.", _ + language.name, language.id, language.code) + Next + Else + Console.WriteLine("No languages were found.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to get targetable carriers and languages.", _ + ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201309/Targeting/LookupLocation.vb b/examples/AdXBuyer/Vb/v201309/Targeting/LookupLocation.vb new file mode 100644 index 00000000000..d0e5d9faf9f --- /dev/null +++ b/examples/AdXBuyer/Vb/v201309/Targeting/LookupLocation.vb @@ -0,0 +1,121 @@ +' Copyright 2013, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201309 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201309 + ''' + ''' This code example gets location criteria by name. + ''' + ''' Tags: LocationCriterionService.get + ''' + Public Class LookupLocation + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New LookupLocation + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets location criteria by name." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the LocationCriterionService. + Dim locationCriterionService As LocationCriterionService = user.GetService( _ + AdWordsService.v201309.LocationCriterionService) + + Dim locationNames As String() = New String() {"Paris", "Quebec", "Spain", "Deutschland"} + + Dim selector As New Selector + selector.fields = New String() {"Id", "LocationName", "CanonicalName", "DisplayType", _ + "ParentLocations", "Reach", "TargetingStatus"} + + ' Location names must match exactly, only EQUALS and IN are supported. + Dim predicate1 As New Predicate + predicate1.field = "LocationName" + predicate1.operator = PredicateOperator.IN + predicate1.values = locationNames + + ' Set the locale of the returned location names. + Dim predicate2 As New Predicate + predicate2.field = "Locale" + predicate2.operator = PredicateOperator.EQUALS + predicate2.values = New String() {"en"} + + selector.predicates = New Predicate() {predicate1, predicate2} + + Try + ' Make the get request. + Dim locationCriteria As LocationCriterion() = locationCriterionService.get(selector) + + ' Display the resulting location criteria. + For Each locationCriterion As LocationCriterion In locationCriteria + Dim parentLocations As String = "" + If ((Not locationCriterion.location Is Nothing) AndAlso ( _ + Not locationCriterion.location.parentLocations Is Nothing)) Then + For Each location As Location In locationCriterion.location.parentLocations + parentLocations = (parentLocations & Me.GetLocationString(location) & ", ") + Next + parentLocations.TrimEnd(New Char() {","c, " "c}) + Else + parentLocations = "N/A" + End If + Console.WriteLine("The search term '{0}' returned the location '{1}' of type '{2}' " & _ + "with parent locations '{3}', reach '{4}' and targeting status '{5}.", _ + locationCriterion.searchTerm, locationCriterion.location.locationName, _ + locationCriterion.location.displayType, parentLocations, locationCriterion.reach, _ + locationCriterion.location.targetingStatus) + Next + Catch ex As Exception + Throw New System.ApplicationException("Failed to get location criteria.", ex) + End Try + End Sub + + ''' + ''' Gets a string representation for a location. + ''' + ''' The location + ''' + Public Function GetLocationString(ByVal location As Location) As String + Return String.Format("{0} ({1})", location.locationName, location.displayType) + End Function + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/AccountManagement/GetAccountChanges.vb b/examples/AdXBuyer/Vb/v201402/AccountManagement/GetAccountChanges.vb new file mode 100644 index 00000000000..998630832e3 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/AccountManagement/GetAccountChanges.vb @@ -0,0 +1,183 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Text + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example gets the changes in the account during the last 24 + ''' hours. + ''' + ''' Tags: CustomerSyncService.get + ''' + Public Class GetAccountChanges + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAccountChanges + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets the changes in the account during the last 24 hours." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the CustomerSyncService. + Dim customerSyncService As CustomerSyncService = user.GetService( _ + AdWordsService.v201402.CustomerSyncService) + + ' The date time string should be of the form yyyyMMdd HHmmss zzz. + Dim minDateTime As String = (DateTime.Now.AddDays(-1).ToUniversalTime.ToString( _ + "yyyyMMdd HHmmss") & " UTC") + Dim maxDateTime As String = (DateTime.Now.ToUniversalTime.ToString("yyyyMMdd HHmmss") & _ + " UTC") + + ' Create date time range. + Dim dateTimeRange As New DateTimeRange + dateTimeRange.min = minDateTime + dateTimeRange.max = maxDateTime + + Try + ' Create the selector. + Dim selector As New CustomerSyncSelector + selector.dateTimeRange = dateTimeRange + selector.campaignIds = GetAllCampaignIds(user) + + ' Get all account changes for campaign. + Dim accountChanges As CustomerChangeData = customerSyncService.get(selector) + + ' Display the changes. + If ((Not accountChanges Is Nothing) AndAlso _ + (Not accountChanges.changedCampaigns Is Nothing)) Then + Console.WriteLine("Displaying changes up to: {0}", accountChanges.lastChangeTimestamp) + + For Each campaignChanges As CampaignChangeData In accountChanges.changedCampaigns + Console.WriteLine("Campaign with id ""{0}"" was changed:", campaignChanges.campaignId) + Console.WriteLine(" Campaign changed status: {0}", _ + campaignChanges.campaignChangeStatus) + If (campaignChanges.campaignChangeStatus <> ChangeStatus.NEW) Then + Console.WriteLine(" Added ad extensions: {0}", _ + GetFormattedList(campaignChanges.addedAdExtensions)) + Console.WriteLine(" Added campaign criteria: {0}", _ + GetFormattedList(campaignChanges.addedCampaignCriteria)) + If (campaignChanges.campaignTargetingChanged) Then + Console.WriteLine(" Added campaign targeting: yes") + Else + Console.WriteLine(" Added campaign targeting: no") + End If + + Console.WriteLine(" Deleted ad extensions: {0}", _ + GetFormattedList(campaignChanges.deletedAdExtensions)) + Console.WriteLine(" Deleted campaign criteria: {0}", _ + GetFormattedList(campaignChanges.deletedCampaignCriteria)) + + If (Not campaignChanges.changedAdGroups Is Nothing) Then + For Each adGroupChanges As AdGroupChangeData In campaignChanges.changedAdGroups + Console.WriteLine(" Ad group with id ""{0}"" was changed:", _ + adGroupChanges.adGroupId) + Console.WriteLine(" Ad group changed status: {0}", _ + adGroupChanges.adGroupChangeStatus) + If (adGroupChanges.adGroupChangeStatus <> ChangeStatus.NEW) Then + Console.WriteLine(" Ads changed: {0}", _ + GetFormattedList(adGroupChanges.changedAds)) + Console.WriteLine(" Criteria changed: {0}", _ + GetFormattedList(adGroupChanges.changedCriteria)) + Console.WriteLine(" Criteria deleted: {0}", _ + GetFormattedList(adGroupChanges.deletedCriteria)) + End If + Next + End If + End If + Console.WriteLine() + Next + Else + Console.WriteLine("No account changes were found.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to get account changes.", ex) + End Try + End Sub + + ''' + ''' Formats a list of ids as a comma separated string. + ''' + ''' The list of ids. + ''' The comma separed formatted string, enclosed in square braces. + ''' + Private Function GetFormattedList(ByVal ids As Long()) As String + Dim builder As New StringBuilder + If (Not ids Is Nothing) Then + For Each id As Long In ids + builder.AppendFormat("{0}, ", id) + Next + End If + Return ("[" & builder.ToString.TrimEnd(New Char() {","c, " "c}) & "]") + End Function + + ''' + ''' Gets all campaign ids in the account. + ''' + ''' The user for which campaigns are retrieved. + ''' The list of campaign ids. + Private Function GetAllCampaignIds(ByVal user As AdWordsUser) As Long() + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201402.CampaignService) + + Dim allCampaigns As New List(Of Long) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id"} + + ' Get all campaigns. + Dim page As CampaignPage = campaignService.get(selector) + + ' Return the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + For Each campaign As Campaign In page.entries + allCampaigns.Add(campaign.id) + Next + End If + Return allCampaigns.ToArray + End Function + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/AdvancedOperations/AddAdGroupBidModifier.vb b/examples/AdXBuyer/Vb/v201402/AdvancedOperations/AddAdGroupBidModifier.vb new file mode 100644 index 00000000000..5852c75e472 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/AdvancedOperations/AddAdGroupBidModifier.vb @@ -0,0 +1,111 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: thagikura@gmail.com (Takeshi Hagikura) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example illustrates how to add ad group level mobile bid + ''' modifier override. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class AddAdGroupBidModifier + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAdGroupBidModifier + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim bidModifier As Double = Double.Parse("INSERT_ADGROUP_BID_MODIFIER_HERE") + codeExample.Run(New AdWordsUser, adGroupId, bidModifier) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to add ad group level mobile bid" & _ + " modifier override." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the adgroup for which bid modifier is + ''' set. + ''' The mobile bid modifier for adgroup + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal bidModifier As Double) + ' Get the AdGroupBidModifierService. + Dim adGroupBidModifierService As AdGroupBidModifierService = user.GetService( _ + AdWordsService.v201402.AdGroupBidModifierService) + + ' Mobile criterion ID. + Dim criterionId As Long = 30001 + + ' Create the adgroup bid modifier. + Dim adGroupBidModifier As New AdGroupBidModifier() + adGroupBidModifier.bidModifier = bidModifier + adGroupBidModifier.adGroupId = adGroupId + + Dim platform As New Platform() + platform.id = criterionId + + adGroupBidModifier.criterion = platform + + Dim operation As New AdGroupBidModifierOperation() + operation.operator = [Operator].ADD + operation.operand = adGroupBidModifier + + Try + ' Add ad group level mobile bid modifier. + Dim retval As AdGroupBidModifierReturnValue = adGroupBidModifierService.mutate( _ + New AdGroupBidModifierOperation() {operation}) + + ' Display the results. + If Not retval Is Nothing AndAlso Not retval.value Is Nothing AndAlso _ + retval.value.Length > 0 Then + Dim newBidModifier As AdGroupBidModifier = retval.value(0) + Console.WriteLine("AdGroup ID {0}, Criterion ID {1} was updated with ad group " & _ + "level modifier: {2}", newBidModifier.adGroupId, newBidModifier.criterion.id, _ + newBidModifier.bidModifier) + Else + Console.WriteLine("No bid modifiers were added to the adgroup.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add bid modifiers to adgroup.", ex) + End Try + End Sub + End Class + +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/AdvancedOperations/GetAdGroupBidModifiers.vb b/examples/AdXBuyer/Vb/v201402/AdvancedOperations/GetAdGroupBidModifiers.vb new file mode 100644 index 00000000000..a60a776a6c8 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/AdvancedOperations/GetAdGroupBidModifiers.vb @@ -0,0 +1,125 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example illustrates how to retrieve ad group level mobile bid + ''' modifiers for a campaign. + ''' + ''' AdGroupBidModifierService.get + ''' + Public Class GetAdGroupBidModifiers + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAdGroupBidModifiers + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to retrieve ad group level mobile bid" & _ + " modifiers for a campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which adgroup bid + ''' modifiers are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupBidModifierService. + Dim adGroupBidModifierService As AdGroupBidModifierService = user.GetService( _ + AdWordsService.v201402.AdGroupBidModifierService) + + Const PAGE_SIZE As Integer = 500 + + ' Get all ad group bid modifiers for the campaign. + Dim selector As New Selector() + selector.fields = New String() {"CampaignId", "AdGroupId", "BidModifier", _ + "BidModifierSource", "CriteriaType", "Id"} + + Dim predicate As New Predicate() + predicate.field = "CampaignId" + predicate.[operator] = PredicateOperator.EQUALS + predicate.values = New String() {campaignId.ToString()} + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging() + + Dim offset As Integer = 0 + Dim pageSize As Integer = PAGE_SIZE + + Dim page As New AdGroupBidModifierPage() + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the campaigns. + page = adGroupBidModifierService.get(selector) + + ' Display the results. + If (Not page Is Nothing) AndAlso (Not page.entries Is Nothing) Then + Dim i As Integer = offset + For Each adGroupBidModifier As AdGroupBidModifier In page.entries + Dim bidModifier As String = "" + If adGroupBidModifier.bidModifierSpecified Then + bidModifier = adGroupBidModifier.bidModifier.ToString() + Else + bidModifier = "UNSET" + End If + Console.WriteLine("{0}) Campaign ID {1}, AdGroup ID {2}, Criterion ID {3} has " & _ + "ad group level modifier: {4}, source = {5}.", _ + i + 1, adGroupBidModifier.campaignId, _ + adGroupBidModifier.adGroupId, adGroupBidModifier.criterion.id, _ + bidModifier, adGroupBidModifier.bidModifierSource) + i = i + 1 + Next + End If + offset += pageSize + Loop While offset < page.totalNumEntries + Console.WriteLine("Number of adgroup bid modifiers found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve adgroup bid modifiers.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/AdvancedOperations/UploadOfflineConversions.vb b/examples/AdXBuyer/Vb/v201402/AdvancedOperations/UploadOfflineConversions.vb new file mode 100644 index 00000000000..529b8d8f07f --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/AdvancedOperations/UploadOfflineConversions.vb @@ -0,0 +1,245 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example adds a Shared Bidding Strategy and uses it to construct + ''' a campaign. + ''' + ''' Tags: BiddingStrategyService.mutate + ''' Tags: BudgetService.mutate, CampaignService.mutate + ''' + Public Class UploadOfflineConversions + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim conversionName As String = "INSERT_CONVERSION_NAME_HERE" + ' GCLID needs to be newer than 30 days. + Dim gClId As String = "INSERT_GOOGLE_CLICK_ID_HERE" + ' The conversion time should be higher than the click time. + Dim conversionTime As String = "INSERT_CONVERSION_TIME_HERE" + Dim conversionValue As Double = Double.Parse("INSERT_CONVERSION_VALUE_HERE") + + Dim codeExample As New UploadOfflineConversions + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser, conversionName, gClId, conversionTime, conversionValue) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a Shared Bidding Strategy and uses it to construct " & _ + "a campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The name of the upload conversion to be + ''' created. + ''' The Google Click ID of the click for which offline + ''' conversions are uploaded. + ''' The conversion value to be uploaded. + ''' + ''' The conversion time, in yyyymmdd hhmmss + ''' format. + Public Sub Run(ByVal user As AdWordsUser, ByVal conversionName As String, _ + ByVal gClid As String, ByVal conversionTime As String, ByVal conversionValue As Double) + ' Get the ConversionTrackerService. + Dim conversionTrackerService As ConversionTrackerService = user.GetService( _ + AdWordsService.v201402.ConversionTrackerService) + + ' Get the OfflineConversionFeedService. + Dim offlineConversionFeedService As OfflineConversionFeedService = user.GetService( _ + AdWordsService.v201402.OfflineConversionFeedService) + + Const VIEWTHROUGH_LOOKBACK_WINDOW As Integer = 30 + Const CTC_LOOKBACK_WINDOW As Integer = 90 + + Try + ' Create an upload conversion. Once created, this entry will be visible + ' under Tools and Analysis->Conversion and will have "Source = Import". + Dim uploadConversion As New UploadConversion() + uploadConversion.category = ConversionTrackerCategory.PAGE_VIEW + uploadConversion.name = conversionName + uploadConversion.viewthroughLookbackWindow = VIEWTHROUGH_LOOKBACK_WINDOW + uploadConversion.ctcLookbackWindow = CTC_LOOKBACK_WINDOW + + Dim uploadConversionOperation As New ConversionTrackerOperation() + uploadConversionOperation.operator = [Operator].ADD + uploadConversionOperation.operand = uploadConversion + + Dim conversionTrackerRetval As ConversionTrackerReturnValue = _ + conversionTrackerService.mutate(New ConversionTrackerOperation() { _ + uploadConversionOperation}) + + Dim newUploadConversion As UploadConversion = conversionTrackerRetval.value(0) + + Console.WriteLine("New upload conversion type with name = '{0}' and id = {1} was " & _ + "created.", newUploadConversion.name, newUploadConversion.id) + + ' Associate offline conversions with the upload conversion we created. + Dim feed As New OfflineConversionFeed() + feed.conversionName = conversionName + feed.conversionTime = conversionTime + feed.conversionValue = conversionValue + feed.googleClickId = gClid + + Dim offlineConversionOperation As New OfflineConversionFeedOperation() + offlineConversionOperation.operator = [Operator].ADD + offlineConversionOperation.operand = feed + + Dim offlineConversionRetval As OfflineConversionFeedReturnValue = _ + offlineConversionFeedService.mutate( _ + New OfflineConversionFeedOperation() {offlineConversionOperation}) + + Dim newFeed As OfflineConversionFeed = offlineConversionRetval.value(0) + + Console.WriteLine("Uploaded offline conversion value of {0} for Google Click ID = " & _ + "'{1}' to '{2}'.", newFeed.conversionValue, newFeed.googleClickId, _ + newFeed.conversionName) + Catch ex As Exception + Throw New System.ApplicationException("Failed to upload offline conversions.", ex) + End Try + End Sub + + + ''' + ''' Creates the shared bidding strategy. + ''' + ''' The bidding strategy service. + ''' The bidding strategy name. + ''' The bid ceiling. + ''' The spend target. + ''' The bidding strategy object. + Private Function CreateBiddingStrategy(ByVal biddingStrategyService As BiddingStrategyService, _ + ByVal name As String, ByVal bidCeiling As Long, ByVal spendTarget As Long) _ + As SharedBiddingStrategy + ' Create a shared bidding strategy. + Dim sharedBiddingStrategy As New SharedBiddingStrategy() + sharedBiddingStrategy.name = name + + Dim biddingScheme As New TargetSpendBiddingScheme() + ' Optionally set additional bidding scheme parameters. + biddingScheme.bidCeiling = New Money() + biddingScheme.bidCeiling.microAmount = bidCeiling + + biddingScheme.spendTarget = New Money() + biddingScheme.spendTarget.microAmount = spendTarget + + sharedBiddingStrategy.biddingScheme = biddingScheme + + ' Create operation. + Dim operation As New BiddingStrategyOperation() + operation.operator = [Operator].ADD + operation.operand = sharedBiddingStrategy + + Return biddingStrategyService.mutate(New BiddingStrategyOperation() {operation}).value(0) + End Function + + ''' + ''' Creates an explicit budget to be used only to create the Campaign. + ''' + ''' The budget service. + ''' The budget name. + ''' The budget amount. + ''' The budget object. + Private Function CreateSharedBudget(ByVal budgetService As BudgetService, _ + ByVal name As String, ByVal amount As Long) As Budget + ' Create a shared budget + Dim budget As New Budget() + budget.name = name + budget.period = BudgetBudgetPeriod.DAILY + budget.amount = New Money() + budget.amount.microAmount = amount + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD + budget.isExplicitlyShared = True + + ' Create operation. + Dim operation As New BudgetOperation() + operation.operand = budget + operation.operator = [Operator].ADD + + ' Make the mutate request. + Return budgetService.mutate(New BudgetOperation() {operation}).value(0) + End Function + + ''' + ''' Creates the campaign with a shared bidding strategy. + ''' + ''' The campaign service. + ''' The campaign name. + ''' The bidding strategy id. + ''' The shared budget id. + ''' The campaign object. + Private Function CreateCampaignWithBiddingStrategy(ByVal campaignService As CampaignService, _ + ByVal name As String, ByVal biddingStrategyId As Long, ByVal sharedBudgetId As Long) _ + As Campaign + ' Create campaign. + Dim campaign As New Campaign() + campaign.name = name + + ' Set the budget. + campaign.budget = New Budget() + campaign.budget.budgetId = sharedBudgetId + + ' Set bidding strategy (required). + Dim biddingStrategyConfiguration As New BiddingStrategyConfiguration() + biddingStrategyConfiguration.biddingStrategyId = biddingStrategyId + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration + + ' Set keyword matching setting (required). + Dim keywordMatchSetting As New KeywordMatchSetting() + keywordMatchSetting.optIn = True + campaign.settings = New Setting() {keywordMatchSetting} + + ' Set network targeting (recommended). + Dim networkSetting As New NetworkSetting() + networkSetting.targetGoogleSearch = True + networkSetting.targetSearchNetwork = True + networkSetting.targetContentNetwork = True + campaign.networkSetting = networkSetting + + ' Create operation. + Dim operation As New CampaignOperation() + operation.operand = campaign + operation.operator = [Operator].ADD + + Return campaignService.mutate(New CampaignOperation() {operation}).value(0) + End Function + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/AdvancedOperations/UseSharedBiddingStrategy.vb b/examples/AdXBuyer/Vb/v201402/AdvancedOperations/UseSharedBiddingStrategy.vb new file mode 100644 index 00000000000..68ef47febd6 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/AdvancedOperations/UseSharedBiddingStrategy.vb @@ -0,0 +1,213 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example adds a Shared Bidding Strategy and uses it to construct + ''' a campaign. + ''' + ''' Tags: BiddingStrategyService.mutate + ''' Tags: BudgetService.mutate, CampaignService.mutate + ''' + Public Class UseSharedBiddingStrategy + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UseSharedBiddingStrategy + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a Shared Bidding Strategy and uses it to construct " & _ + "a campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the services. + Dim biddingStrategyService As BiddingStrategyService = user.GetService( _ + AdWordsService.v201402.BiddingStrategyService) + + Dim budgetService As BudgetService = user.GetService(AdWordsService.v201402.BudgetService) + + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201402.CampaignService) + + Dim biddingStrategyName As String = "Maximize Clicks " & ExampleUtilities.GetRandomString() + Dim bidCeiling As Long = 2000000 + Dim spendTarget As Long = 20000000 + + Dim budgetName As String = "Shared Interplanetary Budget #" & _ + ExampleUtilities.GetRandomString() + Dim budgetAmount As Long = 30000000 + + Dim campaignName As String = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString() + + Try + Dim sharedBiddingStrategy As SharedBiddingStrategy = CreateBiddingStrategy( _ + biddingStrategyService, biddingStrategyName, bidCeiling, spendTarget) + Console.WriteLine("Shared bidding strategy with name '{0}' and ID {1} of type {2} " & _ + "was created.", sharedBiddingStrategy.name, sharedBiddingStrategy.id, _ + sharedBiddingStrategy.biddingScheme.BiddingSchemeType) + + Dim sharedBudget As Budget = CreateSharedBudget(budgetService, budgetName, budgetAmount) + + Dim newCampaign As Campaign = CreateCampaignWithBiddingStrategy(campaignService, _ + campaignName, sharedBiddingStrategy.id, sharedBudget.budgetId) + + Console.WriteLine("Campaign with name '{0}', ID {1} and bidding scheme ID {2} was " & _ + "created.", newCampaign.name, newCampaign.id, _ + newCampaign.biddingStrategyConfiguration.biddingStrategyId) + + Catch ex As Exception + Throw New System.ApplicationException("Failed to create campaign that uses shared " & _ + "bidding strategy.", ex) + End Try + End Sub + + + ''' + ''' Creates the shared bidding strategy. + ''' + ''' The bidding strategy service. + ''' The bidding strategy name. + ''' The bid ceiling. + ''' The spend target. + ''' The bidding strategy object. + Private Function CreateBiddingStrategy(ByVal biddingStrategyService As BiddingStrategyService, _ + ByVal name As String, ByVal bidCeiling As Long, ByVal spendTarget As Long) _ + As SharedBiddingStrategy + ' Create a shared bidding strategy. + Dim sharedBiddingStrategy As New SharedBiddingStrategy() + sharedBiddingStrategy.name = name + + Dim biddingScheme As New TargetSpendBiddingScheme() + ' Optionally set additional bidding scheme parameters. + biddingScheme.bidCeiling = New Money() + biddingScheme.bidCeiling.microAmount = bidCeiling + + biddingScheme.spendTarget = New Money() + biddingScheme.spendTarget.microAmount = spendTarget + + sharedBiddingStrategy.biddingScheme = biddingScheme + + ' Create operation. + Dim operation As New BiddingStrategyOperation() + operation.operator = [Operator].ADD + operation.operand = sharedBiddingStrategy + + Return biddingStrategyService.mutate(New BiddingStrategyOperation() {operation}).value(0) + End Function + + ''' + ''' Creates an explicit budget to be used only to create the Campaign. + ''' + ''' The budget service. + ''' The budget name. + ''' The budget amount. + ''' The budget object. + Private Function CreateSharedBudget(ByVal budgetService As BudgetService, _ + ByVal name As String, ByVal amount As Long) As Budget + ' Create a shared budget + Dim budget As New Budget() + budget.name = name + budget.period = BudgetBudgetPeriod.DAILY + budget.amount = New Money() + budget.amount.microAmount = amount + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD + budget.isExplicitlyShared = True + + ' Create operation. + Dim operation As New BudgetOperation() + operation.operand = budget + operation.operator = [Operator].ADD + + ' Make the mutate request. + Return budgetService.mutate(New BudgetOperation() {operation}).value(0) + End Function + + ''' + ''' Creates the campaign with a shared bidding strategy. + ''' + ''' The campaign service. + ''' The campaign name. + ''' The bidding strategy id. + ''' The shared budget id. + ''' The campaign object. + Private Function CreateCampaignWithBiddingStrategy(ByVal campaignService As CampaignService, _ + ByVal name As String, ByVal biddingStrategyId As Long, ByVal sharedBudgetId As Long) _ + As Campaign + ' Create campaign. + Dim campaign As New Campaign() + campaign.name = name + campaign.advertisingChannelType = AdvertisingChannelType.SEARCH + + ' Set the budget. + campaign.budget = New Budget() + campaign.budget.budgetId = sharedBudgetId + + ' Set bidding strategy (required). + Dim biddingStrategyConfiguration As New BiddingStrategyConfiguration() + biddingStrategyConfiguration.biddingStrategyId = biddingStrategyId + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration + + ' Set keyword matching setting (required). + Dim keywordMatchSetting As New KeywordMatchSetting() + keywordMatchSetting.optIn = True + campaign.settings = New Setting() {keywordMatchSetting} + + ' Set network targeting (recommended). + Dim networkSetting As New NetworkSetting() + networkSetting.targetGoogleSearch = True + networkSetting.targetSearchNetwork = True + networkSetting.targetContentNetwork = True + campaign.networkSetting = networkSetting + + ' Create operation. + Dim operation As New CampaignOperation() + operation.operand = campaign + operation.operator = [Operator].ADD + + Return campaignService.mutate(New CampaignOperation() {operation}).value(0) + End Function + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/BasicOperations/AddAdGroupDemographicCriteria.vb b/examples/AdXBuyer/Vb/v201402/BasicOperations/AddAdGroupDemographicCriteria.vb new file mode 100644 index 00000000000..5c4d5514db5 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/BasicOperations/AddAdGroupDemographicCriteria.vb @@ -0,0 +1,124 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example adds demographic target criteria to an ad group. To get + ''' ad groups, run AddAdGroup.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class AddAdGroupDemographicCriteria + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAdGroupDemographicCriteria + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds demographic target criteria to an ad group. To get ad " & _ + "groups, run AddAdGroup.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which criteria are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = _ + user.GetService(AdWordsService.v201402.AdGroupCriterionService) + + ' Create biddable ad group criterion for gender + Dim genderTarget As New Gender() + ' Criterion Id for male. The IDs can be found here + ' https://developers.google.com/adwords/api/docs/appendix/genders + genderTarget.id = 10 + + Dim genderBiddableAdGroupCriterion As New BiddableAdGroupCriterion() + genderBiddableAdGroupCriterion.adGroupId = adGroupId + genderBiddableAdGroupCriterion.criterion = genderTarget + + ' Create negative ad group criterion for age range + Dim ageRangeNegative As New AgeRange() + ' Criterion Id for age 18 to 24. The IDs can be found here + ' https://developers.google.com/adwords/api/docs/appendix/ages + + ageRangeNegative.id = 503001 + Dim ageRangeNegativeAdGroupCriterion As New NegativeAdGroupCriterion() + ageRangeNegativeAdGroupCriterion.adGroupId = adGroupId + ageRangeNegativeAdGroupCriterion.criterion = ageRangeNegative + + ' Create operations. + Dim genderBiddableAdGroupCriterionOperation As New AdGroupCriterionOperation() + genderBiddableAdGroupCriterionOperation.operand = genderBiddableAdGroupCriterion + genderBiddableAdGroupCriterionOperation.operator = [Operator].ADD + + Dim ageRangeNegativeAdGroupCriterionOperation As New AdGroupCriterionOperation() + ageRangeNegativeAdGroupCriterionOperation.operand = ageRangeNegativeAdGroupCriterion + ageRangeNegativeAdGroupCriterionOperation.operator = [Operator].ADD + + Dim operations As New List(Of Operation) + operations.Add(genderBiddableAdGroupCriterionOperation) + operations.Add(ageRangeNegativeAdGroupCriterionOperation) + + Try + ' Add ad group criteria. + Dim result As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + operations.ToArray) + + ' Display ad group criteria. + If (Not result Is Nothing) AndAlso Not (result.value Is Nothing) Then + For Each adGroupCriterionResult As AdGroupCriterion In result.value + Console.WriteLine("Ad group criterion with ad group id '{0}', criterion id " & _ + "'{1}', and type '{2}' was added.", adGroupCriterionResult.adGroupId, _ + adGroupCriterionResult.criterion.id, _ + adGroupCriterionResult.criterion.CriterionType) + Next + Else + Console.WriteLine("No ad group criteria were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create ad group criteria.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/BasicOperations/AddAdGroups.vb b/examples/AdXBuyer/Vb/v201402/BasicOperations/AddAdGroups.vb new file mode 100644 index 00000000000..53d4a656426 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/BasicOperations/AddAdGroups.vb @@ -0,0 +1,138 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example illustrates how to create ad groups. To create + ''' campaigns, run AddCampaigns.vb. + ''' + ''' Tags: AdGroupService.mutate + ''' + Public Class AddAdGroups + Inherits ExampleBase + ''' + ''' Number of items being added / updated in this code example. + ''' + Const NUM_ITEMS As Integer = 5 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAdGroups + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to create ad groups. To create campaigns," & _ + " run AddCampaigns.vb" + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to which ad groups are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService( _ + AdWordsService.v201402.AdGroupService) + + Dim operations As New List(Of AdGroupOperation) + + For i As Integer = 1 To NUM_ITEMS + ' Create the ad group. + Dim adGroup As New AdGroup + adGroup.name = String.Format("Earth to Mars Cruises #{0}", ExampleUtilities.GetRandomString) + adGroup.status = AdGroupStatus.ENABLED + adGroup.campaignId = campaignId + + ' Set the ad group bids. + Dim biddingConfig As New BiddingStrategyConfiguration() + + Dim cpmBid As New CpmBid() + cpmBid.bid = New Money() + cpmBid.bid.microAmount = 10000000 + + biddingConfig.bids = New Bids() {cpmBid} + + adGroup.biddingStrategyConfiguration = biddingConfig + + ' Optional: Set targeting restrictions. + ' These setting only affect serving for the Display Network. + Dim targetingSetting As New TargetingSetting() + + Dim placementDetail As New TargetingSettingDetail() + placementDetail.criterionTypeGroup = CriterionTypeGroup.PLACEMENT + placementDetail.targetAll = True + + Dim verticalDetail As New TargetingSettingDetail() + verticalDetail.criterionTypeGroup = CriterionTypeGroup.VERTICAL + verticalDetail.targetAll = False + + targetingSetting.details = New TargetingSettingDetail() {placementDetail, verticalDetail} + + adGroup.settings = New Setting() {targetingSetting} + + ' Create the operation. + Dim operation1 As New AdGroupOperation + operation1.operator = [Operator].ADD + operation1.operand = adGroup + + operations.Add(operation1) + Next + + Try + ' Create the ad group. + Dim retVal As AdGroupReturnValue = adGroupService.mutate(operations.ToArray) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + For Each newAdGroup As AdGroup In retVal.value + Console.WriteLine("Ad group with id = '{0}' and name = '{1}' was created.", _ + newAdGroup.id, newAdGroup.name) + Next + Else + Console.WriteLine("No ad groups were created.") + End If + Catch ex As Exception + Console.WriteLine("Failed to create ad groups. Exception says ""{0}""", ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/BasicOperations/AddCampaigns.vb b/examples/AdXBuyer/Vb/v201402/BasicOperations/AddCampaigns.vb new file mode 100644 index 00000000000..c8d4a9200cb --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/BasicOperations/AddCampaigns.vb @@ -0,0 +1,174 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example adds campaigns. To get campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignService.mutate + ''' + Public Class AddCampaigns + Inherits ExampleBase + ''' + ''' Number of items being added / updated in this code example. + ''' + Const NUM_ITEMS As Integer = 5 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddCampaigns + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds campaigns. To get campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the BudgetService. + Dim budgetService As BudgetService = user.GetService( _ + AdWordsService.v201402.BudgetService) + + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201402.CampaignService) + + ' Create the campaign budget. + Dim budget As New Budget + budget.name = "Interplanetary Cruise Budget #" & ExampleUtilities.GetRandomString + budget.period = BudgetBudgetPeriod.DAILY + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD + budget.amount = New Money + budget.amount.microAmount = 50000000 + + Dim budgetOperation As New BudgetOperation + budgetOperation.operator = [Operator].ADD + budgetOperation.operand = budget + + Try + Dim budgetRetval As BudgetReturnValue = budgetService.mutate(New BudgetOperation() _ + {budgetOperation}) + budget = budgetRetval.value(0) + Catch ex As Exception + Throw New System.ApplicationException("Failed to add shared budget.", ex) + End Try + + Dim operations As New List(Of CampaignOperation) + + For i As Integer = 1 To NUM_ITEMS + ' Create the campaign. + Dim campaign As New Campaign + campaign.name = "Interplanetary Cruise #" & ExampleUtilities.GetRandomString + + campaign.status = CampaignStatus.PAUSED + + Dim biddingConfig As New BiddingStrategyConfiguration() + biddingConfig.biddingStrategyType = BiddingStrategyType.MANUAL_CPM + + ' Optional: also provide matching bidding scheme. + biddingConfig.biddingScheme = New ManualCpmBiddingScheme() + + campaign.biddingStrategyConfiguration = biddingConfig + + ' Set the campaign budget. + campaign.budget = New Budget + campaign.budget.budgetId = budget.budgetId + campaign.advertisingChannelType = AdvertisingChannelType.SEARCH + + ' Set targetContentNetwork true. Other network targeting is not available + ' for Ad Exchange Buyers. + campaign.networkSetting = New NetworkSetting + campaign.networkSetting.targetGoogleSearch = False + campaign.networkSetting.targetSearchNetwork = False + campaign.networkSetting.targetContentNetwork = True + campaign.networkSetting.targetPartnerSearchNetwork = False + + ' Set real time bidding settings. + Dim rtbSetting As New RealTimeBiddingSetting + rtbSetting.optIn = True + + ' Set the campaign settings for near-exact and near-phrase matches. + Dim keywordSetting As New KeywordMatchSetting + keywordSetting.optIn = False + + campaign.settings = New Setting() {rtbSetting, keywordSetting} + + ' Optional: Set the start date. + campaign.startDate = DateTime.Now.AddDays(1).ToString("yyyyMMdd") + + ' Optional: Set the end date. + campaign.endDate = DateTime.Now.AddYears(1).ToString("yyyyMMdd") + + ' Optional: Set the frequency cap. + Dim frequencyCap As New FrequencyCap + frequencyCap.impressions = 5 + frequencyCap.level = Level.ADGROUP + frequencyCap.timeUnit = TimeUnit.DAY + campaign.frequencyCap = frequencyCap + + ' Create the operation. + Dim operation As New CampaignOperation + operation.operator = [Operator].ADD + operation.operand = campaign + + operations.Add(operation) + Next + + Try + ' Add the campaign. + Dim retVal As CampaignReturnValue = campaignService.mutate(operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + For Each newCampaign As Campaign In retVal.value + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was added.", _ + newCampaign.name, newCampaign.id) + Next + Else + Console.WriteLine("No campaigns were added.") + End If + Catch ex As Exception + Console.WriteLine("Failed to add campaigns. Exception says ""{0}""", ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/BasicOperations/AddPlacements.vb b/examples/AdXBuyer/Vb/v201402/BasicOperations/AddPlacements.vb new file mode 100644 index 00000000000..c9cf097e7a8 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/BasicOperations/AddPlacements.vb @@ -0,0 +1,121 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example adds placements to an ad group. To get ad groups, run + ''' GetAdGroups.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class AddPlacements + Inherits ExampleBase + ''' + ''' Number of items being added / updated in this code example. + ''' + Const NUM_ITEMS As Integer = 5 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddPlacements + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds placements to an ad group. To get ad groups, run " & _ + "GetAdGroups.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which keywords are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201402.AdGroupCriterionService) + + Dim operations As New List(Of AdGroupCriterionOperation) + + For i As Integer = 1 To NUM_ITEMS + + ' Create the placement. + Dim placement As New Placement + placement.url = "http://mars.google.com/" + i.ToString() + + ' Create the biddable ad group criterion. + Dim placementCriterion As AdGroupCriterion = New BiddableAdGroupCriterion + placementCriterion.adGroupId = adGroupId + placementCriterion.criterion = placement + + ' Create the operations. + Dim operation As New AdGroupCriterionOperation + operation.operator = [Operator].ADD + operation.operand = placementCriterion + + operations.Add(operation) + Next + Try + ' Create the placements. + Dim retVal As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + operations.ToArray) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing)) Then + For Each adGroupCriterion As AdGroupCriterion In retVal.value + ' If you are adding multiple type of criteria, then you may need to + ' check for + ' + ' if (adGroupCriterion is Placement) { ... } + ' + ' to identify the criterion type. + Console.WriteLine("Placement with ad group id = '{0}, placement id = '{1} and url " & _ + "= '{2}' was created.", adGroupCriterion.adGroupId, _ + adGroupCriterion.criterion.id, TryCast(adGroupCriterion.criterion, Placement).url) + Next + Else + Console.WriteLine("No placements were added.") + End If + Catch ex As Exception + Console.WriteLine("Failed to create placements. Exception says ""{0}""", ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/BasicOperations/AddThirdPartyRedirectAds.vb b/examples/AdXBuyer/Vb/v201402/BasicOperations/AddThirdPartyRedirectAds.vb new file mode 100644 index 00000000000..cdb26c4f3b0 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/BasicOperations/AddThirdPartyRedirectAds.vb @@ -0,0 +1,151 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 +Imports Google.Api.Ads.Common.Util + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example adds third party redirect ads to a given ad group. To + ''' list ad groups, run GetAdGroups.vb. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class AddThirdPartyRedirectAds + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddThirdPartyRedirectAds + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds third party redirect ads to a given ad group. To list " & _ + "ad groups, run GetAdGroups.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which ads are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService( _ + AdWordsService.v201402.AdGroupAdService) + + ' Create standard third party redirect ad. + Dim standardAd As New ThirdPartyRedirectAd + standardAd.name = String.Format("Example third party ad #{0}", ExampleUtilities.GetRandomString) + standardAd.url = "http://www.example.com" + + standardAd.dimensions = New Dimensions + standardAd.dimensions.height = 250 + standardAd.dimensions.width = 300 + + standardAd.snippet = "" + + ' DoubleClick Rich Media Expandable format ID. + standardAd.certifiedVendorFormatId = 232 + standardAd.isCookieTargeted = False + standardAd.isUserInterestTargeted = False + standardAd.isTagged = False + standardAd.richMediaAdType = RichMediaAdRichMediaAdType.STANDARD + + ' Expandable Ad properties. + standardAd.expandingDirections = New ThirdPartyRedirectAdExpandingDirection() { _ + ThirdPartyRedirectAdExpandingDirection.EXPANDING_UP, _ + ThirdPartyRedirectAdExpandingDirection.EXPANDING_DOWN _ + } + + standardAd.adAttributes = New RichMediaAdAdAttribute() { _ + RichMediaAdAdAttribute.ROLL_OVER_TO_EXPAND} + + ' Create in-stream third party redirect ad. + Dim inStreamAd As New ThirdPartyRedirectAd() + inStreamAd.name = String.Format("Example third party ad #{0}", ExampleUtilities.GetRandomString) + inStreamAd.url = "http://www.example.com" + ' Set the duration to 15 secs. + inStreamAd.adDuration = 15000 + inStreamAd.sourceUrl = "http://ad.doubleclick.net/pfadx/N270.126913.6102203221521/B3876671.21;dcadv=2215309;sz=0x0;ord=%5btimestamp%5d;dcmt=text/xml" + inStreamAd.certifiedVendorFormatId = 303 + inStreamAd.richMediaAdType = RichMediaAdRichMediaAdType.IN_STREAM_VIDEO + + Dim operations As New List(Of AdGroupAdOperation) + Dim ads As ThirdPartyRedirectAd() = New ThirdPartyRedirectAd() {standardAd, inStreamAd} + For Each redirectAd As ThirdPartyRedirectAd In ads + Dim thirdPartyRedirectAdGroupAd As New AdGroupAd + thirdPartyRedirectAdGroupAd.adGroupId = adGroupId + thirdPartyRedirectAdGroupAd.ad = redirectAd + + ' Optional: Set the status. + thirdPartyRedirectAdGroupAd.status = AdGroupAdStatus.PAUSED + + ' Create the operations. + Dim operation As New AdGroupAdOperation + operation.operator = [Operator].ADD + operation.operand = thirdPartyRedirectAdGroupAd + + operations.Add(operation) + Next + + Try + ' Create the ads. + Dim retVal As AdGroupAdReturnValue = service.mutate(operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing)) Then + ' If you are adding multiple type of Ads, then you may need to check + ' for + ' + ' if (adGroupAd.ad is ThirdPartyRedirectAd) { ... } + ' + ' to identify the ad type. + For Each adGroupAd As AdGroupAd In retVal.value + Console.WriteLine("New third party redirect ad with id = ""{0}"" and url = ""{1}"" " & _ + "was created.", adGroupAd.ad.id, DirectCast(adGroupAd.ad, ThirdPartyRedirectAd).url) + Next + Else + Console.WriteLine("No third party redirect ads were created.") + End If + Catch ex As Exception + Console.WriteLine("Failed to create third party redirect ad. Exception says ""{0}""", _ + ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/BasicOperations/DeleteAd.vb b/examples/AdXBuyer/Vb/v201402/BasicOperations/DeleteAd.vb new file mode 100644 index 00000000000..a765c391dbc --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/BasicOperations/DeleteAd.vb @@ -0,0 +1,105 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example deletes an ad using the 'REMOVE' operator. To list ads, + ''' run GetTextAds.vb. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class DeleteAd + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DeleteAd + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim adId As Long = Long.Parse("INSERT_AD_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, adId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example deletes an ad using the 'REMOVE' operator. To list ads, " & _ + "run GetTextAds.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the ad. + ''' Id of the ad being deleted. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal adId As Long) + ' Get the AdGroupAdService. + Dim adGroupAdService As AdGroupAdService = user.GetService( _ + AdWordsService.v201402.AdGroupAdService) + + ' Since we do not need to update any ad-specific fields, it is enough to + ' create the base type. + Dim ad As New Ad + ad.id = adId + + ' Create the ad group ad. + Dim adGroupAd As New AdGroupAd + adGroupAd.adGroupId = adGroupId + + adGroupAd.ad = ad + + ' Create the operation. + Dim operation As New AdGroupAdOperation + operation.operand = adGroupAd + operation.operator = [Operator].REMOVE + + Try + ' Delete the ad. + Dim retVal As AdGroupAdReturnValue = adGroupAdService.mutate( _ + New AdGroupAdOperation() {operation}) + + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim deletedAdGroupAd As AdGroupAd = retVal.value(0) + Console.WriteLine("Ad with id = ""{0}"" and type = ""{1}"" was deleted.", _ + deletedAdGroupAd.ad.id, deletedAdGroupAd.ad.AdType) + Else + Console.WriteLine("No ads were deleted.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to delete ad.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/BasicOperations/DeleteAdGroup.vb b/examples/AdXBuyer/Vb/v201402/BasicOperations/DeleteAdGroup.vb new file mode 100644 index 00000000000..4f693c365cc --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/BasicOperations/DeleteAdGroup.vb @@ -0,0 +1,101 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example deletes an ad group by setting the status to 'DELETED'. + ''' To get ad groups, run GetAdGroups.vb. + ''' + ''' Tags: AdGroupService.mutate + ''' + Public Class DeleteAdGroup + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DeleteAdGroup + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example deletes an ad group by setting the status to 'DELETED'. " & _ + "To get ad groups, run GetAdGroups.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to be deleted. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService(AdWordsService.v201402.AdGroupService) + + ' Create ad group with DELETED status. + Dim adGroup As New AdGroup + adGroup.id = adGroupId + + ' When deleting an ad group, rename it to avoid name collisions with new + ' ad groups. + adGroup.name = "Deleted AdGroup - " + ExampleUtilities.GetRandomString + adGroup.status = AdGroupStatus.DELETED + + ' Create the operation. + Dim operation As New AdGroupOperation + operation.operand = adGroup + operation.operator = [Operator].SET + + Try + ' Delete the ad group. + Dim retVal As AdGroupReturnValue = adGroupService.mutate( _ + New AdGroupOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim deletedAdGroup As AdGroup = retVal.value(0) + Console.WriteLine("Ad group with id = ""{0}"" was renamed to ""{1}"" and deleted.", _ + deletedAdGroup.id, deletedAdGroup.name) + Else + Console.WriteLine("No ad groups were deleted.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to delete ad groups.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/BasicOperations/DeleteCampaign.vb b/examples/AdXBuyer/Vb/v201402/BasicOperations/DeleteCampaign.vb new file mode 100644 index 00000000000..0cec143fcfb --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/BasicOperations/DeleteCampaign.vb @@ -0,0 +1,102 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example deletes a campaign by setting the status to 'DELETED'. + ''' To get campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignService.mutate + ''' + Public Class DeleteCampaign + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DeleteCampaign + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example deletes a campaign by setting the status to 'DELETED'. To " & _ + "get campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to be deleted. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201402.CampaignService) + + ' Create campaign with DELETED status. + Dim campaign As New Campaign + campaign.id = campaignId + + ' When deleting a campaign, rename it to avoid name collisions with new + ' campaigns. + campaign.name = "Deleted Campaign - " + ExampleUtilities.GetRandomString + campaign.status = CampaignStatus.DELETED + + ' Create the operation. + Dim operation As New CampaignOperation + operation.operand = campaign + operation.operator = [Operator].SET + + Try + ' Delete the campaign. + Dim retVal As CampaignReturnValue = campaignService.mutate( _ + New CampaignOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim deletedCampaign As Campaign = retVal.value(0) + Console.WriteLine("Campaign with id = ""{0}"" was renamed to ""{1}"" and deleted.", _ + deletedCampaign.id, deletedCampaign.name) + Else + Console.WriteLine("No campaigns were deleted.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to delete campaigns.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/BasicOperations/DeletePlacement.vb b/examples/AdXBuyer/Vb/v201402/BasicOperations/DeletePlacement.vb new file mode 100644 index 00000000000..6de168924b3 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/BasicOperations/DeletePlacement.vb @@ -0,0 +1,106 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example deletes a placement using the 'REMOVE' operator. To get + ''' placements, run GetPlacements.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class DeletePlacement + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DeletePlacement + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim placementId As Long = Long.Parse("INSERT_PLACEMENT_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, placementId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example deletes a placement using the 'REMOVE' operator. To get " & _ + "placements, run GetPlacements.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the keyword. + ''' + ''' Id of the placement to be deleted. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal placementId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201402.AdGroupCriterionService) + + ' Create base class criterion to avoid setting placement-specific + ' fields. + Dim criterion As New Criterion + criterion.id = placementId + + ' Create the ad group criterion. + Dim adGroupCriterion As New BiddableAdGroupCriterion + adGroupCriterion.adGroupId = adGroupId + adGroupCriterion.criterion = criterion + + ' Create the operation. + Dim operation As New AdGroupCriterionOperation + operation.operand = adGroupCriterion + operation.operator = [Operator].REMOVE + + Try + ' Delete the placement. + Dim retVal As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + New AdGroupCriterionOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim deletedPlacement As AdGroupCriterion = retVal.value(0) + Console.WriteLine("Placement with ad group id = ""{0}"" and id = ""{1}"" was " & _ + "deleted.", deletedPlacement.adGroupId, deletedPlacement.criterion.id) + Else + Console.WriteLine("No placement was deleted.") + End If + Catch ex As Exception + Console.WriteLine("Failed to delete placement. Exception says ""{0}""", ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/BasicOperations/GetAdGroups.vb b/examples/AdXBuyer/Vb/v201402/BasicOperations/GetAdGroups.vb new file mode 100644 index 00000000000..c2e4466cf17 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/BasicOperations/GetAdGroups.vb @@ -0,0 +1,114 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example illustrates how to retrieve all the ad groups for a + ''' campaign. To create an ad group, run AddAdGroup.vb. + ''' + ''' Tags: AdGroupService.get + ''' + Public Class GetAdGroups + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAdGroups + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to retrieve all the ad groups for a " & _ + "campaign. To create an ad group, run AddAdGroup.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which ad groups are + ''' retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService( _ + AdWordsService.v201402.AdGroupService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "Name"} + + ' Create the filters. + Dim predicate As New Predicate + predicate.field = "CampaignId" + predicate.operator = PredicateOperator.EQUALS + predicate.values = New String() {campaignId.ToString} + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the ad groups. + page = adGroupService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each adGroup As AdGroup In page.entries + Console.WriteLine("{0}) Ad group name is ""{1}"" and id is ""{2}"".", i, _ + adGroup.name, adGroup.id) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of ad groups found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve ad group(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/BasicOperations/GetCampaigns.vb b/examples/AdXBuyer/Vb/v201402/BasicOperations/GetCampaigns.vb new file mode 100644 index 00000000000..6d18af301fe --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/BasicOperations/GetCampaigns.vb @@ -0,0 +1,103 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example lists all campaigns. To add a campaign, run + ''' AddCampaign.vb. + ''' + ''' Tags: CampaignService.get + ''' + Public Class GetCampaigns + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetCampaigns + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example lists all campaigns. To add a campaign, run AddCampaign.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201402.CampaignService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "Name", "Status"} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New CampaignPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the campaigns. + page = campaignService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each campaign As Campaign In page.entries + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = " & _ + "'{3}' was found.", i, campaign.id, campaign.name, campaign.status) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve campaign(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/BasicOperations/GetCampaignsWithAwql.vb b/examples/AdXBuyer/Vb/v201402/BasicOperations/GetCampaignsWithAwql.vb new file mode 100644 index 00000000000..2b9838ba786 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/BasicOperations/GetCampaignsWithAwql.vb @@ -0,0 +1,102 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example lists all campaigns using an AWQL query. See + ''' https://developers.google.com/adwords/api/docs/guides/awql for AWQL + ''' documentation. To add a campaign, run AddCampaign.vb. + ''' + ''' Tags: CampaignService.get + ''' + Public Class GetCampaignsWithAwql + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetCampaignsWithAwql + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example lists all campaigns using an AWQL query. See " & _ + "https://developers.google.com/adwords/api/docs/guides/awql for AWQL " & _ + "documentation. To add a campaign, run AddCampaign.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201402.CampaignService) + + ' Create the query. + Dim query As String = "SELECT Id, Name, Status ORDER BY Name" + + Dim offset As Long = 0 + Dim pageSize As Long = 500 + + Dim page As New CampaignPage() + + Try + Do + Dim queryWithPaging As String = String.Format("{0} LIMIT {1}, {2}", query, offset, _ + pageSize) + + ' Get the campaigns. + page = campaignService.query(queryWithPaging) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each campaign As Campaign In page.entries + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = " & _ + "'{3}' was found.", i, campaign.id, campaign.name, campaign.status) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve campaign(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/BasicOperations/GetPlacements.vb b/examples/AdXBuyer/Vb/v201402/BasicOperations/GetPlacements.vb new file mode 100644 index 00000000000..17e3a902e65 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/BasicOperations/GetPlacements.vb @@ -0,0 +1,128 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example gets all placements in an account. To add placements, run + ''' AddPlacements.vb. + ''' + ''' Tags: AdGroupCriterionService.get + ''' + Public Class GetPlacements + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetPlacements + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all placements in an account. To add placements, run " & _ + "AddPlacements.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201402.AdGroupCriterionService) + + ' Create a selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "AdGroupId", "PlacementUrl"} + + ' Select only placements. + Dim predicate As New Predicate + predicate.field = "CriteriaType" + predicate.operator = PredicateOperator.EQUALS + predicate.values = New String() {"PLACEMENT"} + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupCriterionPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the placements. + page = adGroupCriterionService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each adGroupCriterion As AdGroupCriterion In page.entries + Dim isNegative As Boolean = TypeOf adGroupCriterion Is NegativeAdGroupCriterion + + ' If you are retrieving multiple type of criteria, then you may + ' need to check for + ' + ' if (adGroupCriterion is Placement) { ... } + ' + ' to identify the criterion type. + Dim placement As Placement = adGroupCriterion.criterion + If isNegative Then + Console.WriteLine("{0}) Negative placement with ad group ID = '{1}', placement " & _ + "ID = '{2}', and url = '{3}' was found.", i, adGroupCriterion.adGroupId, _ + placement.id, placement.url) + Else + Console.WriteLine("{0}) Placement with ad group ID = '{1}', placement ID = " & _ + "'{2}' and url = '{3}' was found.", i, adGroupCriterion.adGroupId, _ + placement.id, placement.url) + End If + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of placements found: {0}", page.totalNumEntries) + Catch ex As Exception + Console.WriteLine("Failed to retrieve placements. Exception says ""{0}""", ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/BasicOperations/GetThirdPartyRedirectAds.vb b/examples/AdXBuyer/Vb/v201402/BasicOperations/GetThirdPartyRedirectAds.vb new file mode 100644 index 00000000000..ebea2fa8b4b --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/BasicOperations/GetThirdPartyRedirectAds.vb @@ -0,0 +1,143 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example retrieves all third party redirect ads given an existing + ''' ad group. To add ads to an existing ad group, run + ''' AddThirdPartyRedirectAd.vb. + ''' + ''' Tags: AdGroupAdService.get + ''' + Public Class GetThirdPartyRedirectAds + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetThirdPartyRedirectAds + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves all third party redirect ads given an existing ad " & _ + "group. To add third party redirect ads to an existing ad group, run " & _ + "AddThirdPartyRedirectAd.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group from which text ads are + ''' retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201402.AdGroupAdService) + + ' Create a selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "Status", "Url", "DisplayUrl", "RichMediaAdSnippet"} + + ' Set the sort order. + Dim orderBy As New OrderBy + orderBy.field = "Id" + orderBy.sortOrder = SortOrder.ASCENDING + selector.ordering = New OrderBy() {orderBy} + + ' Restrict the fetch to only the selected ad group id. + Dim adGroupPredicate As New Predicate + adGroupPredicate.field = "AdGroupId" + adGroupPredicate.operator = PredicateOperator.EQUALS + adGroupPredicate.values = New String() {adGroupId.ToString} + + ' Retrieve only third party redirect ads. + Dim typePredicate As New Predicate + typePredicate.field = "AdType" + typePredicate.operator = PredicateOperator.EQUALS + typePredicate.values = New String() {"THIRD_PARTY_REDIRECT_AD"} + + ' By default disabled ads aren't returned by the selector. To return them + ' include the DISABLED status in the statuses field. + Dim statusPredicate As New Predicate + statusPredicate.field = "Status" + statusPredicate.operator = PredicateOperator.IN + + statusPredicate.values = New String() {AdGroupAdStatus.ENABLED.ToString, _ + AdGroupAdStatus.PAUSED.ToString, AdGroupAdStatus.DISABLED.ToString} + + selector.predicates = New Predicate() {adGroupPredicate, statusPredicate, typePredicate} + + ' Select the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupAdPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the third party redirect ads. + page = service.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each adGroupAd As AdGroupAd In page.entries + Dim thirdPartyRedirectAd As ThirdPartyRedirectAd = adGroupAd.ad + Console.WriteLine("{0}) Ad id is {1} and status is {2}", i, thirdPartyRedirectAd.id, _ + adGroupAd.status) + Console.WriteLine(" Url: {0}\n Display Url: {1}\n Snippet:{2}", _ + thirdPartyRedirectAd.url, thirdPartyRedirectAd.displayUrl, _ + thirdPartyRedirectAd.snippet) + Next + i += 1 + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of third party redirect ads found: {0}", page.totalNumEntries) + Catch ex As Exception + Console.WriteLine("Failed to get third party redirect ads. Exception says ""{0}""", _ + ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/BasicOperations/PauseAd.vb b/examples/AdXBuyer/Vb/v201402/BasicOperations/PauseAd.vb new file mode 100644 index 00000000000..ac42b4aa2b2 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/BasicOperations/PauseAd.vb @@ -0,0 +1,102 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example pauses a given ad. To list all ads, run GetTextAds.cs. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class PauseAd + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New PauseAd + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim adId As Long = Long.Parse("INSERT_AD_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, adId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example pauses a given ad. To list all ads, run GetTextAds.cs." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the ad. + ''' + ''' Id of the ad to be paused. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal adId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201402.AdGroupAdService) + + Dim status As AdGroupAdStatus = AdGroupAdStatus.PAUSED + + ' Create the ad group ad. + Dim adGroupAd As New AdGroupAd + adGroupAd.status = status + adGroupAd.adGroupId = adGroupId + + adGroupAd.ad = New Ad + adGroupAd.ad.id = adId + + ' Create the operation. + Dim adGroupAdOperation As New AdGroupAdOperation + adGroupAdOperation.operator = [Operator].SET + adGroupAdOperation.operand = adGroupAd + + Try + ' Update the ad. + Dim retVal As AdGroupAdReturnValue = service.mutate( _ + New AdGroupAdOperation() {adGroupAdOperation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim pausedAdGroupAd As AdGroupAd = retVal.value(0) + Console.WriteLine("Ad with id ""{0}"" was paused.", pausedAdGroupAd.ad.id) + Else + Console.WriteLine("No ads were paused.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to pause ad.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/BasicOperations/UpdateAdGroup.vb b/examples/AdXBuyer/Vb/v201402/BasicOperations/UpdateAdGroup.vb new file mode 100644 index 00000000000..9cc52cc7bc6 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/BasicOperations/UpdateAdGroup.vb @@ -0,0 +1,96 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example illustrates how to update an ad group, setting its + ''' status to 'PAUSED'. To create an ad group, run AddAdGroup.vb. + ''' + ''' Tags: AdGroupService.mutate + ''' + Public Class UpdateAdGroup + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UpdateAdGroup + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to update an ad group, setting its status " & _ + "to 'PAUSED'. To create an ad group, run AddAdGroup.vb" + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to be updated. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService(AdWordsService.v201402.AdGroupService) + + ' Create the ad group. + Dim adGroup As New AdGroup + adGroup.status = AdGroupStatus.PAUSED + adGroup.id = adGroupId + + ' Create the operation. + Dim operation As New AdGroupOperation + operation.operator = [Operator].SET + operation.operand = adGroup + + Try + ' Update the ad group. + Dim retVal As AdGroupReturnValue = adGroupService.mutate(New AdGroupOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim pausedAdGroup As AdGroup = retVal.value(0) + Console.WriteLine("Ad group with id = '{0}' was successfully updated.", _ + pausedAdGroup.id) + Else + Console.WriteLine("No ad groups were updated.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to update ad groups.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/BasicOperations/UpdateCampaign.vb b/examples/AdXBuyer/Vb/v201402/BasicOperations/UpdateCampaign.vb new file mode 100644 index 00000000000..1d590e63bc2 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/BasicOperations/UpdateCampaign.vb @@ -0,0 +1,97 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example updates a campaign. To get campaigns, run + ''' GetCampaigns.vb. + ''' + ''' Tags: CampaignService.mutate + ''' + Public Class UpdateCampaign + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UpdateCampaign + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example updates a campaign. To get campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to be updated. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201402.CampaignService) + + ' Create campaign with updated budget. + Dim campaign As New Campaign + campaign.id = campaignId + campaign.status = CampaignStatus.PAUSED + + ' Create the operations. + Dim operation As New CampaignOperation + operation.operator = [Operator].SET + operation.operand = campaign + + Try + ' Update the campaign. + Dim retVal As CampaignReturnValue = campaignService.mutate( _ + New CampaignOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim updatedCampaign As Campaign = retVal.value(0) + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was updated.", _ + updatedCampaign.name, updatedCampaign.id) + Else + Console.WriteLine("No campaigns were updated.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to update campaigns.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/BasicOperations/UpdatePlacement.vb b/examples/AdXBuyer/Vb/v201402/BasicOperations/UpdatePlacement.vb new file mode 100644 index 00000000000..45e29ec9a8d --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/BasicOperations/UpdatePlacement.vb @@ -0,0 +1,123 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example updates the bid of a placement. To get placement, run + ''' GetPlacements.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class UpdatePlacement + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UpdatePlacement + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim placementId As Long = Long.Parse("INSERT_PLACEMENT_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, placementId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example updates the bid of a placement. To get placement, run " & _ + "GetPlacements.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the keyword. + ''' + ''' Id of the placement to be updated. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal placementId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201402.AdGroupCriterionService) + + ' Since we are not updating any placement-specific fields, it is enough to + ' create a criterion object. + Dim criterion As New Criterion + criterion.id = placementId + + ' Create ad group criterion. + Dim biddableAdGroupCriterion As New BiddableAdGroupCriterion + biddableAdGroupCriterion.adGroupId = adGroupId + biddableAdGroupCriterion.criterion = criterion + + ' Create the bids. + Dim biddingConfig As New BiddingStrategyConfiguration() + Dim cpmBid As New CpmBid() + cpmBid.bid = New Money() + cpmBid.bid.microAmount = 1000000 + biddingConfig.bids = New Bids() {cpmBid} + + biddableAdGroupCriterion.biddingStrategyConfiguration = biddingConfig + + ' Create the operation. + Dim operation As New AdGroupCriterionOperation + operation.operator = [Operator].SET + operation.operand = biddableAdGroupCriterion + + Try + ' Update the placement. + Dim retVal As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + New AdGroupCriterionOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim adGroupCriterion As BiddableAdGroupCriterion = retVal.value(0) + Dim bidAmount As Long = 0L + For Each bids As Bids In adGroupCriterion.biddingStrategyConfiguration.bids + If TypeOf bids Is CpmBid Then + bidAmount = TryCast(bids, CpmBid).bid.microAmount + End If + Next + + Console.WriteLine("Placement with ad group id = '{0}', id = '{1}' was updated with " & _ + "bid amount = '{2}' micros.", adGroupCriterion.adGroupId, _ + adGroupCriterion.criterion.id, bidAmount) + Else + Console.WriteLine("No placements were updated.") + End If + Catch ex As Exception + Console.WriteLine("Failed to update placement. Exception says ""{0}""", ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/CampaignManagement/AddPlacementsInBulk.vb b/examples/AdXBuyer/Vb/v201402/CampaignManagement/AddPlacementsInBulk.vb new file mode 100644 index 00000000000..67eb31dc809 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/CampaignManagement/AddPlacementsInBulk.vb @@ -0,0 +1,185 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Text.RegularExpressions +Imports System.Threading + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example shows how to add placements in bulk using the + ''' MutateJobService. + ''' + ''' Tags: MutateJobService.mutate, MutateJobService.get + ''' Tags: MutateJobService.getResult + ''' + Public Class AddPlacementsInBulk + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddPlacementsInBulk + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example shows how to add placements in bulk using the MutateJobService." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad groups to which placements are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the MutateJobService. + Dim mutateJobService As MutateJobService = user.GetService( _ + AdWordsService.v201402.MutateJobService) + + Const RETRY_INTERVAL As Integer = 30 + Const RETRIES_COUNT As Integer = 30 + Const PLACEMENT_NUMBER As Integer = 100 + Const INDEX_REGEX As String = "operations\[(\d+)\].operand" + + Dim operations As New List(Of Operation) + + ' Create AdGroupCriterionOperation to add placements. + For i As Integer = 0 To PLACEMENT_NUMBER + Dim placement As New Placement + placement.url = ("http://mars.google.com/" & i.ToString) + + Dim criterion As New BiddableAdGroupCriterion + criterion.adGroupId = adGroupId + criterion.criterion = placement + + Dim adGroupCriterionOperation As New AdGroupCriterionOperation + adGroupCriterionOperation.operator = [Operator].ADD + adGroupCriterionOperation.operand = criterion + + operations.Add(adGroupCriterionOperation) + Next i + + Dim policy As New BulkMutateJobPolicy + ' You can specify up to 3 job IDs that must successfully complete before + ' this job can be processed. + policy.prerequisiteJobIds = New Long() {} + + Dim job As SimpleMutateJob = mutateJobService.mutate(operations.ToArray, policy) + + ' Wait for the job to complete. + Dim completed As Boolean = False + Dim retryCount As Integer = 0 + Console.WriteLine("Retrieving job status...") + + While (completed = False AndAlso retryCount < RETRIES_COUNT) + Dim selector As New BulkMutateJobSelector + selector.jobIds = New Long() {job.id} + + Try + Dim allJobs As Job() = mutateJobService.get(selector) + If ((Not allJobs Is Nothing) AndAlso (allJobs.Length > 0)) Then + job = allJobs(0) + If ((job.status = BasicJobStatus.COMPLETED) OrElse _ + (job.status = BasicJobStatus.FAILED)) Then + completed = True + Exit While + Else + Console.WriteLine("{0}: Current status is {1}, waiting {2} seconds to retry...", _ + retryCount, job.status, RETRY_INTERVAL) + Thread.Sleep(RETRY_INTERVAL * 1000) + retryCount = retryCount + 1 + End If + End If + Catch ex As Exception + Console.WriteLine("Failed to fetch simple mutate job with id = {0}. Exception " & _ + "says ""{1}"".", job.id, ex.Message) + Return + End Try + End While + + If (job.status = BasicJobStatus.COMPLETED) Then + ' Handle cases where the job completed. + + ' Create the job selector. + Dim selector As New BulkMutateJobSelector + selector.jobIds = New Long() {job.id} + + ' Get the job results. + Dim jobResult As JobResult = mutateJobService.getResult(selector) + If Not jobResult Is Nothing Then + Dim results As SimpleMutateResult = jobResult.Item + If Not results Is Nothing Then + 'Display the results. + If Not results.results Is Nothing Then + For i As Integer = 0 To results.results.Length - 1 + Dim operand As Operand = results.results(i) + Dim status As String + If TypeOf operand.Item Is PlaceHolder Then + status = "FAILED" + Else + status = "SUCCEEDED" + End If + Console.WriteLine("Operation {0} - {1}", i, status) + Next i + End If + + ' Display the errors. + If Not results.errors Is Nothing Then + For Each apiError As ApiError In results.errors + Dim match As Match = Regex.Match(apiError.fieldPath, INDEX_REGEX, _ + RegexOptions.IgnoreCase) + Dim index As String = "???" + If (match.Success) Then + index = match.Groups(1).Value + End If + Console.WriteLine("Operation index {0} failed due to reason: '{1}', " & _ + "trigger: '{2}'", index, apiError.errorString, apiError.trigger) + Next + End If + End If + End If + Console.WriteLine("Job completed successfully!") + ElseIf (job.status = BasicJobStatus.FAILED) Then + ' Handle the cases where job failed. + Console.WriteLine("Job failed with reason: " & job.failureReason.ToString()) + ElseIf (job.status = BasicJobStatus.PROCESSING OrElse job.status = BasicJobStatus.PENDING) _ + Then + ' Handle the cases where job didn't complete after wait period. + Console.WriteLine("Job did not complete in {0} secconds.", RETRY_INTERVAL * RETRIES_COUNT) + End If + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/CampaignManagement/GetAllDisapprovedAds.vb b/examples/AdXBuyer/Vb/v201402/CampaignManagement/GetAllDisapprovedAds.vb new file mode 100644 index 00000000000..7c21dbc2b68 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/CampaignManagement/GetAllDisapprovedAds.vb @@ -0,0 +1,121 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example retrieves all the disapproved ads in a given campaign. + ''' + ''' Tags: AdGroupAdService.get + ''' + Public Class GetAllDisapprovedAds + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAllDisapprovedAds + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves all the disapproved ads in a given campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which disapproved ads + ''' are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201402.AdGroupAdService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "AdGroupCreativeApprovalStatus", _ + "AdGroupAdDisapprovalReasons"} + + ' Set the filters. + Dim campaignPredicate As New Predicate + campaignPredicate.operator = PredicateOperator.EQUALS + campaignPredicate.field = "CampaignId" + campaignPredicate.values = New String() {campaignId.ToString} + + Dim approvalPredicate As New Predicate + approvalPredicate.operator = PredicateOperator.EQUALS + approvalPredicate.field = "AdGroupCreativeApprovalStatus" + approvalPredicate.values = New String() {AdGroupAdApprovalStatus.DISAPPROVED.ToString()} + + selector.predicates = New Predicate() {campaignPredicate, approvalPredicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupAdPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the disapproved ads. + page = service.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each adGroupAd As AdGroupAd In page.entries + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " & _ + "reason(s):", i, adGroupAd.ad.id) + For Each reason As String In adGroupAd.disapprovalReasons + Console.WriteLine(" {0}", reason) + Next + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get disapproved ads.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb b/examples/AdXBuyer/Vb/v201402/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb new file mode 100644 index 00000000000..7efa20cc336 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb @@ -0,0 +1,111 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example retrieves all the disapproved ads in a given campaign + ''' using an AWQL query. See + ''' https://developers.google.com/adwords/api/docs/guides/awql for AWQL + ''' documentation. + ''' + ''' Tags: AdGroupAdService.get + ''' + Public Class GetAllDisapprovedAdsWithAwql + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAllDisapprovedAdsWithAwql + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves all the disapproved ads in a given campaign using " & _ + "an AWQL query. See https://developers.google.com/adwords/api/docs/guides/awql for " & _ + "AWQL documentation." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which disapproved ads + ''' are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201402.AdGroupAdService) + + ' Get all the disapproved ads for this campaign. + Dim query As String = String.Format("SELECT Id, AdGroupAdDisapprovalReasons WHERE " & _ + "CampaignId = {0} AND AdGroupCreativeApprovalStatus = DISAPPROVED ORDER BY Id", _ + campaignId) + + Dim offset As Long = 0 + Dim pageSize As Long = 500 + + Dim page As New AdGroupAdPage() + + Try + Do + Dim queryWithPaging As String = String.Format("{0} LIMIT {1}, {2}", query, offset, _ + pageSize) + + ' Get the disapproved ads. + page = service.query(queryWithPaging) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each adGroupAd As AdGroupAd In page.entries + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " & _ + "reason(s):", i, adGroupAd.ad.id) + For Each reason As String In adGroupAd.disapprovalReasons + Console.WriteLine(" {0}", reason) + Next + i = i + 1 + Next + End If + + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get disapproved ads.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/ErrorHandling/HandlePartialFailures.vb b/examples/AdXBuyer/Vb/v201402/ErrorHandling/HandlePartialFailures.vb new file mode 100644 index 00000000000..22482e24eb3 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/ErrorHandling/HandlePartialFailures.vb @@ -0,0 +1,136 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example demonstrates how to handle partial failures. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class HandlePartialFailures + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandlePartialFailures + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example demonstrates how to handle partial failures." + End Get + End Property + + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which placements are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201402.AdGroupCriterionService) + + ' Set partial failure mode for the service. + adGroupCriterionService.RequestHeader.partialFailure = True + + Dim operations As New List(Of AdGroupCriterionOperation) + + ' Create the placements. + Dim urls As String() = New String() {"http://mars.google.com", "http:/mars.google.com", _ + "mars.google.com"} + For Each url As String In urls + Dim placement As New Placement + placement.url = url + + ' Create biddable ad group criterion. + Dim placementBiddableAdGroupCriterion As New BiddableAdGroupCriterion + placementBiddableAdGroupCriterion.adGroupId = adGroupId + placementBiddableAdGroupCriterion.criterion = placement + + ' Create the operation. + Dim placementAdGroupCriterionOperation As New AdGroupCriterionOperation + placementAdGroupCriterionOperation.operand = placementBiddableAdGroupCriterion + placementAdGroupCriterionOperation.operator = [Operator].ADD + operations.Add(placementAdGroupCriterionOperation) + Next + + Try + ' Create the placements. + Dim result As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + operations.ToArray) + + ' Display the results. + If ((Not result Is Nothing) AndAlso (Not result.value Is Nothing)) Then + For Each adGroupCriterionResult As AdGroupCriterion In result.value + If (Not adGroupCriterionResult.criterion Is Nothing) Then + Console.WriteLine("Placement with ad group id '{0}', criterion id " & _ + "'{1}', and url '{2}' was added.\n", adGroupCriterionResult.adGroupId, _ + adGroupCriterionResult.criterion.id, _ + DirectCast(adGroupCriterionResult.criterion, Placement).url) + End If + Next + Else + Console.WriteLine("No placements were added.") + End If + + ' Display the partial failure errors. + If ((Not result Is Nothing) AndAlso (Not result.partialFailureErrors Is Nothing)) Then + For Each apiError As ApiError In result.partialFailureErrors + Dim operationIndex As Integer = ErrorUtilities.GetOperationIndex(apiError.fieldPath) + If (operationIndex <> -1) Then + Dim adGroupCriterion As AdGroupCriterion = operations(operationIndex).operand + Console.WriteLine("Placement with ad group id '{0}' and url '{1}' " & _ + "triggered a failure for the following reason: '{2}'.\n", _ + adGroupCriterion.adGroupId, _ + DirectCast(adGroupCriterion.criterion, Placement).url, _ + apiError.errorString) + Else + Console.WriteLine("A failure for the following reason: '{0}' has occurred.\n", _ + apiError.errorString) + End If + Next + End If + Catch e As Exception + Console.WriteLine("Failed to add placement(s) in partial failure mode. Exception " & _ + "says '{0}'", e.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/ErrorHandling/HandlePolicyViolationError.vb b/examples/AdXBuyer/Vb/v201402/ErrorHandling/HandlePolicyViolationError.vb new file mode 100644 index 00000000000..860409562a8 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/ErrorHandling/HandlePolicyViolationError.vb @@ -0,0 +1,184 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example adds a text ad, and shows how to handle a policy + ''' violation. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class HandlePolicyViolationError + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandlePolicyViolationError + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a text ad, and shows how to handle a policy violation." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which ads are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService( _ + AdWordsService.v201402.AdGroupAdService) + + ' Create a third party redirect ad that violates a policy. + ' Create the third party redirect ad. + Dim redirectAd As New ThirdPartyRedirectAd + redirectAd.name = String.Format("Policy violation demo ad ", ExampleUtilities.GetRandomString) + redirectAd.url = "gopher://gopher.google.com" + + redirectAd.dimensions = New Dimensions + redirectAd.dimensions.height = 250 + redirectAd.dimensions.width = 300 + + redirectAd.snippet = "" + redirectAd.impressionBeaconUrl = "http://www.examples.com/beacon" + redirectAd.certifiedVendorFormatId = 119 + redirectAd.isCookieTargeted = False + redirectAd.isUserInterestTargeted = False + redirectAd.isTagged = False + + Dim redirectAdGroupAd As New AdGroupAd + redirectAdGroupAd.adGroupId = adGroupId + redirectAdGroupAd.ad = redirectAd + + ' Create the operations. + Dim redirectAdOperation As New AdGroupAdOperation + redirectAdOperation.operator = [Operator].ADD + redirectAdOperation.operand = redirectAdGroupAd + + Try + Dim retVal As AdGroupAdReturnValue = Nothing + + ' Setup two arrays, one to hold the list of all operations to be + ' validated, and another to hold the list of operations that cannot be + ' fixed after validation. + Dim allOperations As New List(Of AdGroupAdOperation) + Dim operationsToBeRemoved As New List(Of AdGroupAdOperation) + + allOperations.Add(redirectAdOperation) + + Try + ' Validate the operations. + service.RequestHeader.validateOnly = True + retVal = service.mutate(allOperations.ToArray) + Catch ex As AdWordsApiException + Dim innerException As ApiException = TryCast(ex.ApiException, ApiException) + If (innerException Is Nothing) Then + Throw New Exception("Failed to retrieve ApiError. See inner exception for more " & _ + "details.", ex) + End If + + ' Examine each ApiError received from the server. + For Each apiError As ApiError In innerException.errors + Dim index As Integer = ErrorUtilities.GetOperationIndex(apiError.fieldPath) + If (index = -1) Then + ' This API error is not associated with an operand, so we cannot + ' recover from this error by removing one or more operations. + ' Rethrow the exception for manual inspection. + Throw + End If + + ' Handle policy violation errors. + If TypeOf apiError Is PolicyViolationError Then + Dim policyError As PolicyViolationError = apiError + + If policyError.isExemptable Then + ' If the policy violation error is exemptable, add an exemption + ' request. + Dim exemptionRequests As New List(Of ExemptionRequest) + If (Not allOperations.Item(index).exemptionRequests Is Nothing) Then + exemptionRequests.AddRange(allOperations.Item(index).exemptionRequests) + End If + + Dim exemptionRequest As New ExemptionRequest + exemptionRequest.key = policyError.key + exemptionRequests.Add(exemptionRequest) + allOperations.Item(index).exemptionRequests = exemptionRequests.ToArray + Else + ' Policy violation error is not exemptable, remove this + ' operation from the list of operations. + operationsToBeRemoved.Add(allOperations.Item(index)) + End If + Else + ' This is not a policy violation error, remove this operation + ' from the list of operations. + operationsToBeRemoved.Add(allOperations.Item(index)) + End If + Next + + ' Remove all operations that aren't exemptable. + For Each operation As AdGroupAdOperation In operationsToBeRemoved + allOperations.Remove(operation) + Next + End Try + If (allOperations.Count > 0) Then + ' Perform the operations exemptible of a policy violation. + service.RequestHeader.validateOnly = False + retVal = service.mutate(allOperations.ToArray) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) _ + AndAlso (retVal.value.Length > 0)) Then + For Each newAdGroupAd As AdGroupAd In retVal.value + Console.WriteLine("New ad with id = ""{0}"" and displayUrl = ""{1}"" was created.", _ + newAdGroupAd.ad.id, newAdGroupAd.ad.displayUrl) + Next + Else + Console.WriteLine("No ads were created.") + End If + Else + Console.WriteLine("There are no ads to create after policy violation checks.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create Ad(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/ErrorHandling/HandleRateExceededError.vb b/examples/AdXBuyer/Vb/v201402/ErrorHandling/HandleRateExceededError.vb new file mode 100644 index 00000000000..bd3b6402e28 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/ErrorHandling/HandleRateExceededError.vb @@ -0,0 +1,206 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Net +Imports System.Threading + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example shows how to handle RateExceededError in your + ''' application. To trigger the rate exceeded error, this code example runs + ''' 100 threads in parallel, each thread attempting to validate 100 keywords + ''' in a single request. Note that spawning 100 parallel threads is for + ''' illustrative purposes only, you shouldn't do this in your application. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class HandleRateExceededError + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandleRateExceededError + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example shows how to handle RateExceededError in your application. " & _ + "To trigger the rate exceeded error, this code example runs 100 threads in " & _ + "parallel, each thread attempting to validate 100 keywords in a single request. " & _ + "Note that spawning 100 parallel threads is for illustrative purposes only, you " & _ + "shouldn't do this in your application." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which keywords are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + Const NUM_THREADS As Integer = 100 + + ' Increase the maximum number of parallel HTTP connections that .NET + ' framework allows. By default, this is set to 2 by the .NET framework. + ServicePointManager.DefaultConnectionLimit = NUM_THREADS + + Dim threads As New List(Of Thread) + + For i As Integer = 0 To NUM_THREADS + Dim thread As New Thread(AddressOf New KeywordThread(user, i, adGroupId).Run) + threads.Add(thread) + Next i + + For i As Integer = 0 To threads.Count - 1 + threads.Item(i).Start(i) + Next i + + For i As Integer = 0 To threads.Count - 1 + threads.Item(i).Join() + Next i + End Sub + + ''' + ''' Thread class for validating keywords. + ''' + Public Class KeywordThread + ''' + ''' Index of this thread, for identifying and debugging. + ''' + Dim threadIndex As Integer + + ''' + ''' The ad group id to which keywords are added. + ''' + Dim adGroupId As Long + + ''' + ''' The AdWords user who owns this ad group. + ''' + Dim user As AdWordsUser + + ''' + ''' Number of keywords to be validated in each API call. + ''' + Const NUM_KEYWORDS As Integer = 100 + + ''' + ''' Initializes a new instance of the class. + ''' + ''' Index of the thread. + ''' The ad group id. + ''' The AdWords user who owns the ad group. + Public Sub New(ByVal user As AdWordsUser, ByVal threadIndex As Integer, _ + ByVal adGroupId As Long) + Me.user = user + Me.threadIndex = threadIndex + Me.adGroupId = adGroupId + End Sub + + ''' + ''' Main method for the thread. + ''' + ''' The thread parameter. + Public Sub Run(ByVal obj As Object) + ' Create the operations. + Dim operations As New List(Of AdGroupCriterionOperation) + For j As Integer = 0 To NUM_KEYWORDS + ' Create the keyword. + Dim keyword As New Keyword + keyword.text = "mars cruise thread " & threadIndex.ToString & " seed " & j.ToString + keyword.matchType = KeywordMatchType.BROAD + + ' Create the biddable ad group criterion. + Dim keywordCriterion As AdGroupCriterion = New BiddableAdGroupCriterion + keywordCriterion.adGroupId = adGroupId + keywordCriterion.criterion = keyword + + ' Create the operations. + Dim keywordOperation As New AdGroupCriterionOperation + keywordOperation.operator = [Operator].ADD + keywordOperation.operand = keywordCriterion + + operations.Add(keywordOperation) + Next j + + ' Get the AdGroupCriterionService. This should be done within the + ' thread, since a service can only handle one outgoing HTTP request + ' at a time. + Dim service As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201402.AdGroupCriterionService) + service.RequestHeader.validateOnly = True + Dim retryCount As Integer = 0 + Const NUM_RETRIES As Integer = 3 + Try + While (retryCount < NUM_RETRIES) + Try + ' Validate the keywords. + Dim retval As AdGroupCriterionReturnValue = service.mutate(operations.ToArray) + Exit While + Catch ex As AdWordsApiException + ' Handle API errors. + Dim innerException As ApiException = TryCast(ex.ApiException, ApiException) + If (innerException Is Nothing) Then + Throw New Exception("Failed to retrieve ApiError. See inner exception for more " & _ + "details.", ex) + End If + For Each apiError As ApiError In innerException.errors + If Not TypeOf apiError Is RateExceededError Then + ' Rethrow any errors other than RateExceededError. + Throw + End If + ' Handle rate exceeded errors. + Dim rateExceededError As RateExceededError = DirectCast(apiError, RateExceededError) + Console.WriteLine("Got Rate exceeded error - rate name = '{0}', scope = '{1}', " & _ + "retry After {2} seconds.", rateExceededError.rateScope, _ + rateExceededError.rateName, rateExceededError.retryAfterSeconds) + Thread.Sleep(rateExceededError.retryAfterSeconds) + retryCount = retryCount + 1 + Next + Finally + If (retryCount = NUM_RETRIES) Then + Throw New Exception(String.Format("Could not recover after making {0} attempts.", _ + retryCount)) + End If + End Try + End While + Catch ex As Exception + Throw New System.ApplicationException("Failed to validate keywords.", ex) + End Try + End Sub + End Class + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/Miscellaneous/GetAllVideosAndImages.vb b/examples/AdXBuyer/Vb/v201402/Miscellaneous/GetAllVideosAndImages.vb new file mode 100644 index 00000000000..c60c34b3e85 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/Miscellaneous/GetAllVideosAndImages.vb @@ -0,0 +1,139 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example gets all videos and images. To upload video, see + ''' http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. + ''' To upload image, run UploadImage.vb. + ''' + ''' Tags: MediaService.get + ''' + Public Class GetAllVideosAndImages + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAllVideosAndImages + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all videos and images. To upload video, see " & _ + "http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. To " & _ + "upload image, run UploadImage.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the MediaService. + Dim mediaService As MediaService = user.GetService(AdWordsService.v201402.MediaService) + + ' Create the video selector. + Dim selector As New Selector + selector.fields = New String() {"MediaId", "Width", "Height", "MimeType"} + + ' Set the filter. + Dim predicate As New Predicate + predicate.operator = PredicateOperator.IN + predicate.field = "Type" + predicate.values = New String() {MediaMediaType.VIDEO.ToString(), _ + MediaMediaType.IMAGE.ToString()} + + selector.predicates = New Predicate() {predicate} + + ' Select selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New MediaPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + page = mediaService.get(selector) + + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each media As Media In page.entries + If TypeOf media Is Video Then + Dim video As Video = media + Console.WriteLine("{0}) Video with id '{1}' and name '{2}' was found.", _ + i, video.mediaId, video.name) + ElseIf TypeOf media Is Image Then + Dim image As Image = media + Dim dimensions As Dictionary(Of MediaSize, Dimensions) = _ + CreateMediaDimensionMap(image.dimensions) + Console.WriteLine("{0}) Image with id '{1}', dimensions '{2}x{3}', and MIME " & _ + "type '{4}' was found.", i, image.mediaId, dimensions(MediaSize.FULL).width, _ + dimensions(MediaSize.FULL).height, image.mimeType) + End If + i = i + 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of images and videos found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get images and videos.", ex) + End Try + End Sub + + ''' + ''' Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + ''' + ''' The array of Media_Size_DimensionsMapEntry to be + ''' converted into a dictionary. + ''' A dictionary with key as MediaSize, and value as Dimensions. + ''' + Private Function CreateMediaDimensionMap(ByVal dimensions As Media_Size_DimensionsMapEntry()) _ + As Dictionary(Of MediaSize, Dimensions) + Dim mediaMap As New Dictionary(Of MediaSize, Dimensions) + For Each dimension As Media_Size_DimensionsMapEntry In dimensions + mediaMap.Add(dimension.key, dimension.value) + Next + Return mediaMap + End Function + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/Miscellaneous/UploadImage.vb b/examples/AdXBuyer/Vb/v201402/Miscellaneous/UploadImage.vb new file mode 100644 index 00000000000..69431a0d28a --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/Miscellaneous/UploadImage.vb @@ -0,0 +1,107 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 +Imports Google.Api.Ads.Common.Util + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example uploads an image. To get images, run GetAllVideosAndImages.vb. + ''' + ''' Tags: MediaService.upload + ''' + Public Class UploadImage + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UploadImage + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example uploads an image. To get images, run GetAllVideosAndImages.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the MediaService. + Dim mediaService As MediaService = user.GetService( _ + AdWordsService.v201402.MediaService) + + ' Create the image. + Dim image As New Image + image.data = MediaUtilities.GetAssetDataFromUrl("http://goo.gl/HJM3L") + image.type = MediaMediaType.IMAGE + + Try + ' Upload the image. + Dim result As Media() = mediaService.upload(New Media() {image}) + + ' Display the results. + If ((Not result Is Nothing) AndAlso (result.Length > 0)) Then + Dim newImage As Media = result(0) + Dim dimensions As Dictionary(Of MediaSize, Dimensions) = _ + CreateMediaDimensionMap(newImage.dimensions) + Console.WriteLine("Image with id '{0}', dimensions '{1}x{2}', and MIME type '{3}'" & _ + " was uploaded.", newImage.mediaId, dimensions.Item(MediaSize.FULL).width, _ + dimensions.Item(MediaSize.FULL).height, newImage.mimeType) + Else + Console.WriteLine("No images were uploaded.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to upload images.", ex) + End Try + End Sub + + ''' + ''' Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + ''' + ''' The array of Media_Size_DimensionsMapEntry to + ''' be converted into a dictionary. + ''' A dictionary with key as MediaSize, and value as Dimensions. + ''' + Private Function CreateMediaDimensionMap(ByVal dimensions As Media_Size_DimensionsMapEntry()) _ + As Dictionary(Of MediaSize, Dimensions) + Dim mediaMap As New Dictionary(Of MediaSize, Dimensions) + For Each dimension As Media_Size_DimensionsMapEntry In dimensions + mediaMap.Add(dimension.key, dimension.value) + Next + Return mediaMap + End Function + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/Optimization/GetPlacementIdeas.vb b/examples/AdXBuyer/Vb/v201402/Optimization/GetPlacementIdeas.vb new file mode 100644 index 00000000000..43d7f4dc247 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/Optimization/GetPlacementIdeas.vb @@ -0,0 +1,123 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example retrieves urls that have content keywords related to a + ''' given website. + ''' + ''' Tags: TargetingIdeaService.get + ''' + Public Class GetPlacementIdeas + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetPlacementIdeas + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves urls that have content keywords related to a " & _ + "given website." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the TargetingIdeaService. + Dim targetingIdeaService As TargetingIdeaService = user.GetService( _ + AdWordsService.v201402.TargetingIdeaService) + + ' Create seed url. + Dim url As String = "mars.google.com" + + ' Create the selector. + Dim selector As New TargetingIdeaSelector + selector.requestType = RequestType.IDEAS + selector.ideaType = IdeaType.PLACEMENT + selector.requestedAttributeTypes = New AttributeType() {AttributeType.CRITERION, _ + AttributeType.PLACEMENT_TYPE} + + ' Create related to url search parameter. + Dim relatedToUrlSearchParameter As New RelatedToUrlSearchParameter + relatedToUrlSearchParameter.urls = New String() {url} + relatedToUrlSearchParameter.includeSubUrls = False + selector.searchParameters = New SearchParameter() {relatedToUrlSearchParameter} + + ' Select selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New TargetingIdeaPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get placement ideas. + page = targetingIdeaService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each idea As TargetingIdea In page.entries + For Each entry As Type_AttributeMapEntry In idea.data + If (entry.key = AttributeType.CRITERION) Then + Dim placementAttribute As CriterionAttribute = entry.value + Dim placement As Placement = placementAttribute.value + Console.WriteLine("{0}) Related placement urls were found at '{1}'.", _ + i, placement.url) + End If + Next + Next + i += 1 + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of related placements found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve related placements.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/Remarketing/AddAudience.vb b/examples/AdXBuyer/Vb/v201402/Remarketing/AddAudience.vb new file mode 100644 index 00000000000..3bcd54d6377 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/Remarketing/AddAudience.vb @@ -0,0 +1,154 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example illustrates how to create a user list a.k.a. audience. + ''' + ''' Tags: UserListService.mutate + ''' + Public Class AddAudience + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAudience + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to create a user list a.k.a. audience." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the UserListService. + Dim userListService As AdwordsUserListService = user.GetService( _ + AdWordsService.v201402.AdwordsUserListService) + + ' Get the ConversionTrackerService. + Dim conversionTrackerService As ConversionTrackerService = user.GetService( _ + AdWordsService.v201402.ConversionTrackerService) + + Dim userList As New BasicUserList + + userList.name = ("Mars cruise customers #" & ExampleUtilities.GetRandomString) + userList.description = "A list of mars cruise customers in the last year." + userList.status = UserListMembershipStatus.OPEN + userList.membershipLifeSpan = 365 + + Dim conversionType As New UserListConversionType + conversionType.name = userList.name + userList.conversionTypes = New UserListConversionType() {conversionType} + + ' Optional: Set the user list status. + userList.status = UserListMembershipStatus.OPEN + + ' Create the operation. + Dim operation As New UserListOperation + operation.operand = userList + operation.operator = [Operator].ADD + + Try + ' Add the user list. + Dim retval As UserListReturnValue = userListService.mutate(New UserListOperation() _ + {operation}) + + Dim userLists As UserList() = Nothing + If ((Not retval Is Nothing) AndAlso (Not retval.value Is Nothing)) Then + userLists = retval.value + ' Get all conversion snippets. + Dim conversionIds As New List(Of String) + For Each newUserList As BasicUserList In userLists + If (Not newUserList.conversionTypes Is Nothing) Then + For Each newConversionType As UserListConversionType In _ + newUserList.conversionTypes + conversionIds.Add(newConversionType.id.ToString) + Next + End If + Next + + Dim conversionsMap As New Dictionary(Of Long, ConversionTracker) + + If (conversionIds.Count > 0) Then + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id"} + + Dim conversionTypePredicate As New Predicate + conversionTypePredicate.field = "Id" + conversionTypePredicate.operator = PredicateOperator.IN + conversionTypePredicate.values = conversionIds.ToArray + selector.predicates = New Predicate() {conversionTypePredicate} + + ' Get all conversion trackers. + Dim page As ConversionTrackerPage = conversionTrackerService.get(selector) + + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + For Each tracker As ConversionTracker In page.entries + conversionsMap.Item(tracker.id) = tracker + Next + End If + End If + + ' Display the results. + For Each newUserList As BasicUserList In userLists + Console.WriteLine("User list with name '{0}' and id '{1}' was added.", _ + newUserList.name, newUserList.id) + + ' Display user list associated conversion code snippets. + If (Not newUserList.conversionTypes Is Nothing) Then + For Each newConversionType As UserListConversionType In newUserList.conversionTypes + Dim conversionTracker As AdWordsConversionTracker = _ + DirectCast(conversionsMap.Item(newConversionType.id), _ + AdWordsConversionTracker) + Console.WriteLine("Conversion type code snippet associated to the list:\n{0}", _ + conversionTracker.snippet) + Next + End If + Next + Else + Console.WriteLine("No user lists (a.k.a. audiences) were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add user lists (a.k.a. audiences).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/Remarketing/AddConversionTracker.vb b/examples/AdXBuyer/Vb/v201402/Remarketing/AddConversionTracker.vb new file mode 100644 index 00000000000..8796d5eda4a --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/Remarketing/AddConversionTracker.vb @@ -0,0 +1,109 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example adds an AdWords conversion tracker. + ''' + ''' Tags: ConversionTrackerService.mutate + ''' + Public Class AddConversionTracker + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddConversionTracker + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds an AdWords conversion tracker." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the ConversionTrackerService. + Dim conversionTrackerService As ConversionTrackerService = user.GetService( _ + AdWordsService.v201402.ConversionTrackerService) + + ' Create AdWords conversion tracker. + Dim conversionTracker As New AdWordsConversionTracker + conversionTracker.name = "Earth to Mars Cruises Conversion #" & _ + ExampleUtilities.GetRandomString + conversionTracker.category = ConversionTrackerCategory.DEFAULT + conversionTracker.markupLanguage = AdWordsConversionTrackerMarkupLanguage.HTML + conversionTracker.textFormat = AdWordsConversionTrackerTextFormat.HIDDEN + + ' Set optional fields. + conversionTracker.status = ConversionTrackerStatus.ENABLED + conversionTracker.viewthroughLookbackWindow = 15 + conversionTracker.isProductAdsChargeable = True + conversionTracker.productAdsChargeableConversionWindow = 15 + conversionTracker.conversionPageLanguage = "en" + conversionTracker.backgroundColor = "#0000FF" + conversionTracker.defaultRevenueValue = 12.34 + conversionTracker.alwaysUseDefaultRevenueValue = True + + ' Create the operation. + Dim operation As New ConversionTrackerOperation + operation.operator = [Operator].ADD + operation.operand = conversionTracker + + Try + ' Add conversion tracker. + Dim retval As ConversionTrackerReturnValue = conversionTrackerService.mutate( _ + New ConversionTrackerOperation() {operation}) + + ' Display the results. + If ((Not retval Is Nothing) AndAlso (Not retval.value Is Nothing) AndAlso _ + retval.value.Length > 0) Then + Dim newConversionTracker As ConversionTracker = retval.value(0) + Console.WriteLine("Conversion tracker with id '{0}', name '{1}', status '{2}', " & _ + "category '{3}' was added.", newConversionTracker.id, newConversionTracker.name, _ + newConversionTracker.status, newConversionTracker.category) + Else + Console.WriteLine("No conversion trackers were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add conversion tracker.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/Reporting/DownloadCriteriaReport.vb b/examples/AdXBuyer/Vb/v201402/Reporting/DownloadCriteriaReport.vb new file mode 100644 index 00000000000..e4060d0b939 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/Reporting/DownloadCriteriaReport.vb @@ -0,0 +1,118 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util.Reports +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example gets and downloads a criteria Ad Hoc report from an XML + ''' report definition. + ''' + Public Class DownloadCriteriaReport + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DownloadCriteriaReport + Console.WriteLine(codeExample.Description) + Try + Dim fileName As String = "INSERT_OUTPUT_FILE_NAME" + codeExample.Run(New AdWordsUser, fileName) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets and downloads a criteria Ad Hoc report from an XML report" & _ + " definition." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The file to which the report is downloaded. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal fileName As String) + Dim definition As New ReportDefinition + + definition.reportName = "Last 7 days CRITERIA_PERFORMANCE_REPORT" + definition.reportType = ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT + definition.downloadFormat = DownloadFormat.GZIPPED_CSV + definition.dateRangeType = ReportDefinitionDateRangeType.LAST_7_DAYS + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"CampaignId", "AdGroupId", "Id", "CriteriaType", "Criteria", _ + "CriteriaDestinationUrl", "Clicks", "Impressions", "Cost"} + + Dim predicate As New Predicate + predicate.field = "Status" + predicate.operator = PredicateOperator.IN + predicate.values = New String() {"ACTIVE", "PAUSED"} + selector.predicates = New Predicate() {predicate} + + definition.selector = selector + definition.includeZeroImpressions = True + + Dim filePath As String = ExampleUtilities.GetHomeDir() & Path.DirectorySeparatorChar & _ + fileName + + Try + ' If you know that your report is small enough to fit in memory, then + ' you can instead use + ' Dim utilities As New ReportUtilities(user) + ' utilities.ReportVersion = "v201402" + ' Dim report As ClientReport = utilities.GetClientReport( _ + ' Of ReportDefinition)(definition) + ' + ' ' Get the text report directly if you requested a text format + ' ' (e.g. xml) + ' Dim reportText As String = report.Text + ' + ' ' Get the binary report if you requested a binary format + ' ' (e.g. gzip) + ' Dim reportBytes As Byte() = report.Contents + ' + ' ' Deflate a zipped binary report for further processing. + ' Dim deflatedReportText As String = Encoding.UTF8.GetString( _ + ' MediaUtilities.DeflateGZipData(report.Contents)) + Dim utilities As New ReportUtilities(user) + utilities.ReportVersion = "v201402" + utilities.DownloadClientReport(Of ReportDefinition)(definition, filePath) + Console.WriteLine("Report was downloaded to '{0}'.", filePath) + Catch ex As Exception + Throw New System.ApplicationException("Failed to download report.", ex) + End Try + + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/Reporting/DownloadCriteriaReportWithAwql.vb b/examples/AdXBuyer/Vb/v201402/Reporting/DownloadCriteriaReportWithAwql.vb new file mode 100644 index 00000000000..cc83198f74f --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/Reporting/DownloadCriteriaReportWithAwql.vb @@ -0,0 +1,102 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util.Reports +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example gets and downloads a criteria Ad Hoc report from an AWQL + ''' query. See https://developers.google.com/adwords/api/docs/guides/awql for + ''' AWQL documentation. + ''' + Public Class DownloadCriteriaReportWithAwql + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DownloadCriteriaReportWithAwql + Console.WriteLine(codeExample.Description) + Try + Dim fileName As String = "INSERT_OUTPUT_FILE_NAME" + codeExample.Run(New AdWordsUser, fileName) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets and downloads a criteria Ad Hoc report from an AWQL" & _ + " query. See https://developers.google.com/adwords/api/docs/guides/awql for" & _ + " AWQL documentation." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The file to which the report is downloaded. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal fileName As String) + Dim query As String = "SELECT CampaignId, AdGroupId, Id, Criteria, CriteriaType, " & _ + "Impressions, Clicks, Cost FROM CRITERIA_PERFORMANCE_REPORT WHERE Status IN " & _ + "[ACTIVE, PAUSED] DURING LAST_7_DAYS" + + Dim filePath As String = ExampleUtilities.GetHomeDir() + Path.DirectorySeparatorChar & _ + fileName + + Try + ' If you know that your report is small enough to fit in memory, then + ' you can instead use + ' Dim utilities As New ReportUtilities(user) + ' utilities.ReportVersion = "v201402" + ' Dim report As ClientReport = utilities.GetClientReport(query, format) + ' + ' ' Get the text report directly if you requested a text format + ' ' (e.g. xml) + ' Dim reportText As String = report.Text + ' + ' ' Get the binary report if you requested a binary format + ' ' (e.g. gzip) + ' Dim reportBytes As Byte() = report.Contents + ' + ' ' Deflate a zipped binary report for further processing. + ' Dim deflatedReportText As String = Encoding.UTF8.GetString( _ + ' MediaUtilities.DeflateGZipData(report.Contents)) + Dim utilities As New ReportUtilities(user) + utilities.ReportVersion = "v201402" + utilities.DownloadClientReport(query, DownloadFormat.GZIPPED_CSV.ToString(), filePath) + Console.WriteLine("Report was downloaded to '{0}'.", filePath) + Catch ex As Exception + Throw New System.ApplicationException("Failed to download report.", ex) + End Try + + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/Reporting/GetReportFields.vb b/examples/AdXBuyer/Vb/v201402/Reporting/GetReportFields.vb new file mode 100644 index 00000000000..6be19656881 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/Reporting/GetReportFields.vb @@ -0,0 +1,97 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example gets report fields. + ''' + ''' Tags: ReportDefinitionService.getReportFields + ''' + Public Class GetReportFields + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetReportFields + Console.WriteLine(codeExample.Description) + Try + Dim reportType As ReportDefinitionReportType = [Enum].Parse( _ + GetType(ReportDefinitionReportType), "INSERT_REPORT_TYPE_HERE") + codeExample.Run(New AdWordsUser, reportType) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets report fields." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The report type to be run. + Public Sub Run(ByVal user As AdWordsUser, ByVal reportType As ReportDefinitionReportType) + ' Get the ReportDefinitionService. + Dim reportDefinitionService As ReportDefinitionService = user.GetService( _ + AdWordsService.v201402.ReportDefinitionService) + + ' The type of the report to get fields for. + ' E.g.: KEYWORDS_PERFORMANCE_REPORT + + Try + ' Get the report fields. + Dim reportDefinitionFields As ReportDefinitionField() = _ + reportDefinitionService.getReportFields(reportType) + + If ((Not reportDefinitionFields Is Nothing) AndAlso _ + (reportDefinitionFields.Length > 0)) Then + ' Display report fields. + Console.WriteLine("The report type '{0}' contains the following fields:", reportType) + + For Each reportDefinitionField As ReportDefinitionField In reportDefinitionFields + Console.Write("- {0} ({1})", reportDefinitionField.fieldName, _ + reportDefinitionField.fieldType) + If (Not reportDefinitionField.enumValues Is Nothing) Then + Console.Write(" := [{0}]", String.Join(", ", reportDefinitionField.enumValues)) + End If + Console.WriteLine() + Next + Else + Console.WriteLine("This report type has no fields.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve fields for report type.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/Targeting/AddCampaignTargetingCriteria.vb b/examples/AdXBuyer/Vb/v201402/Targeting/AddCampaignTargetingCriteria.vb new file mode 100644 index 00000000000..e4fd8002869 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/Targeting/AddCampaignTargetingCriteria.vb @@ -0,0 +1,138 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example adds various types of targeting criteria to a campaign. + ''' To get a list of campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignCriterionService.mutate + ''' + Public Class AddCampaignTargetingCriteria + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddCampaignTargetingCriteria + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds various types of targeting criteria to a campaign. To " & _ + "get a list of campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to which targeting criteria + ''' are added. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignCriterionService. + Dim campaignCriterionService As CampaignCriterionService = user.GetService( _ + AdWordsService.v201402.CampaignCriterionService) + + ' Create language criteria. + ' See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + ' for a detailed list of language codes. + Dim language1 As New Language + language1.id = 1002 ' French + Dim languageCriterion1 As New CampaignCriterion + languageCriterion1.campaignId = campaignId + languageCriterion1.criterion = language1 + + Dim language2 As New Language + language2.id = 1005 ' Japanese + Dim languageCriterion2 As New CampaignCriterion + languageCriterion2.campaignId = campaignId + languageCriterion2.criterion = language2 + + ' Create location criteria. + ' See http://code.google.com/apis/adwords/docs/appendix/countrycodes.html + ' for a detailed list of country codes. + Dim location1 As New Location + location1.id = 2840 ' USA + Dim locationCriterion1 As New CampaignCriterion + locationCriterion1.campaignId = campaignId + locationCriterion1.criterion = location1 + + Dim location2 As New Location + location2.id = 2392 ' Japan + Dim locationCriterion2 As New CampaignCriterion + locationCriterion2.campaignId = campaignId + locationCriterion2.criterion = location2 + + ' Add a negative campaign placement. + Dim negativeCriterion As New NegativeCampaignCriterion() + negativeCriterion.campaignId = campaignId + + Dim placement As New Placement() + placement.url = "http://mars.google.com" + + negativeCriterion.criterion = placement + + Dim criteria() As CampaignCriterion = {languageCriterion1, languageCriterion2, _ + locationCriterion1, locationCriterion2, negativeCriterion} + + Dim operations As New List(Of CampaignCriterionOperation) + + For Each criterion As CampaignCriterion In criteria + Dim operation As New CampaignCriterionOperation + operation.operator = [Operator].ADD + operation.operand = criterion + operations.Add(operation) + Next + + Try + ' Set the campaign targets. + Dim retVal As CampaignCriterionReturnValue = campaignCriterionService.mutate( _ + operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing)) Then + For Each criterion As CampaignCriterion In retVal.value + Console.WriteLine("Campaign criterion of type '{0}' was set to campaign with id " & _ + "= '{1}'.", criterion.criterion.CriterionType, criterion.campaignId) + Next + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to set campaign criteria.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/Targeting/GetCampaignTargetingCriteria.vb b/examples/AdXBuyer/Vb/v201402/Targeting/GetCampaignTargetingCriteria.vb new file mode 100644 index 00000000000..d7ab15c27ae --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/Targeting/GetCampaignTargetingCriteria.vb @@ -0,0 +1,123 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example gets all targeting criteria for a campaign. To set + ''' campaign targeting criteria, run AddCampaignTargetingCriteria.vb. To get + ''' campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignCriterionService.get + ''' + Public Class GetCampaignTargetingCriteria + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetCampaignTargetingCriteria + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all targeting criteria for a campaign. To set campaign " & _ + "targeting criteria, run AddCampaignTargetingCriteria.vb. To get campaigns, run " & _ + "GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign from which targeting + ''' criteria are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignCriterionService. + Dim campaignCriterionService As CampaignCriterionService = user.GetService( _ + AdWordsService.v201402.CampaignCriterionService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "CriteriaType", "PlacementUrl"} + + ' Set the filters. + Dim campaignPredicate As New Predicate + campaignPredicate.field = "CampaignId" + campaignPredicate.operator = PredicateOperator.EQUALS + campaignPredicate.values = New String() {campaignId.ToString} + + Dim placementPredicate As New Predicate + placementPredicate.field = "CriteriaType" + placementPredicate.operator = PredicateOperator.EQUALS + placementPredicate.values = New String() {"PLACEMENT"} + + selector.predicates = New Predicate() {campaignPredicate, placementPredicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New CampaignCriterionPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get all campaign targets. + page = campaignCriterionService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each campaignCriterion As CampaignCriterion In page.entries + Dim placement As Placement = campaignCriterion.criterion + Console.WriteLine("{0}) Placement with ID {1} and url {2} was found.", i, _ + placement.id, placement.url) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of placements found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get placements.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/Targeting/GetTargetableLanguagesAndCarriers.vb b/examples/AdXBuyer/Vb/v201402/Targeting/GetTargetableLanguagesAndCarriers.vb new file mode 100644 index 00000000000..aff5dd07865 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/Targeting/GetTargetableLanguagesAndCarriers.vb @@ -0,0 +1,100 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example illustrates how to retrieve all carriers and languages + ''' available for targeting. + ''' + ''' Tags: ConstantDataService.getCarrierCriterion + ''' Tags: ConstantDataService.getLanguageCriterion + ''' + Public Class GetTargetableLanguagesAndCarriers + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetTargetableLanguagesAndCarriers + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to retrieve all carriers and languages" & _ + "available for targeting." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the ConstantDataService. + Dim constantDataService As ConstantDataService = user.GetService( _ + AdWordsService.v201402.ConstantDataService) + + Try + ' Get all carriers. + Dim carriers As Carrier() = constantDataService.getCarrierCriterion + + ' Display the results. + If (Not carriers Is Nothing) Then + For Each carrier As Carrier In carriers + Console.WriteLine("Carrier name is '{0}', ID is {1} and country code is '{2}'.", _ + carrier.name, carrier.id, carrier.countryCode) + Next + Else + Console.WriteLine("No carriers were retrieved.") + End If + + ' Get all languages. + Dim languages As Language() = constantDataService.getLanguageCriterion + + ' Display the results. + If (Not languages Is Nothing) Then + For Each language As Language In languages + Console.WriteLine("Language name is '{0}', ID is {1} and code is '{2}'.", _ + language.name, language.id, language.code) + Next + Else + Console.WriteLine("No languages were found.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to get targetable carriers and languages.", _ + ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201402/Targeting/LookupLocation.vb b/examples/AdXBuyer/Vb/v201402/Targeting/LookupLocation.vb new file mode 100644 index 00000000000..11e62fd259d --- /dev/null +++ b/examples/AdXBuyer/Vb/v201402/Targeting/LookupLocation.vb @@ -0,0 +1,121 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201402 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201402 + ''' + ''' This code example gets location criteria by name. + ''' + ''' Tags: LocationCriterionService.get + ''' + Public Class LookupLocation + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New LookupLocation + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets location criteria by name." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the LocationCriterionService. + Dim locationCriterionService As LocationCriterionService = user.GetService( _ + AdWordsService.v201402.LocationCriterionService) + + Dim locationNames As String() = New String() {"Paris", "Quebec", "Spain", "Deutschland"} + + Dim selector As New Selector + selector.fields = New String() {"Id", "LocationName", "CanonicalName", "DisplayType", _ + "ParentLocations", "Reach", "TargetingStatus"} + + ' Location names must match exactly, only EQUALS and IN are supported. + Dim predicate1 As New Predicate + predicate1.field = "LocationName" + predicate1.operator = PredicateOperator.IN + predicate1.values = locationNames + + ' Set the locale of the returned location names. + Dim predicate2 As New Predicate + predicate2.field = "Locale" + predicate2.operator = PredicateOperator.EQUALS + predicate2.values = New String() {"en"} + + selector.predicates = New Predicate() {predicate1, predicate2} + + Try + ' Make the get request. + Dim locationCriteria As LocationCriterion() = locationCriterionService.get(selector) + + ' Display the resulting location criteria. + For Each locationCriterion As LocationCriterion In locationCriteria + Dim parentLocations As String = "" + If ((Not locationCriterion.location Is Nothing) AndAlso ( _ + Not locationCriterion.location.parentLocations Is Nothing)) Then + For Each location As Location In locationCriterion.location.parentLocations + parentLocations = (parentLocations & Me.GetLocationString(location) & ", ") + Next + parentLocations.TrimEnd(New Char() {","c, " "c}) + Else + parentLocations = "N/A" + End If + Console.WriteLine("The search term '{0}' returned the location '{1}' of type '{2}' " & _ + "with parent locations '{3}', reach '{4}' and targeting status '{5}.", _ + locationCriterion.searchTerm, locationCriterion.location.locationName, _ + locationCriterion.location.displayType, parentLocations, locationCriterion.reach, _ + locationCriterion.location.targetingStatus) + Next + Catch ex As Exception + Throw New System.ApplicationException("Failed to get location criteria.", ex) + End Try + End Sub + + ''' + ''' Gets a string representation for a location. + ''' + ''' The location + ''' + Public Function GetLocationString(ByVal location As Location) As String + Return String.Format("{0} ({1})", location.locationName, location.displayType) + End Function + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/AccountManagement/GetAccountChanges.vb b/examples/AdXBuyer/Vb/v201406/AccountManagement/GetAccountChanges.vb new file mode 100644 index 00000000000..bc597ec7474 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/AccountManagement/GetAccountChanges.vb @@ -0,0 +1,183 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Text + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example gets the changes in the account during the last 24 + ''' hours. + ''' + ''' Tags: CustomerSyncService.get + ''' + Public Class GetAccountChanges + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAccountChanges + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets the changes in the account during the last 24 hours." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the CustomerSyncService. + Dim customerSyncService As CustomerSyncService = user.GetService( _ + AdWordsService.v201406.CustomerSyncService) + + ' The date time string should be of the form yyyyMMdd HHmmss zzz. + Dim minDateTime As String = (DateTime.Now.AddDays(-1).ToUniversalTime.ToString( _ + "yyyyMMdd HHmmss") & " UTC") + Dim maxDateTime As String = (DateTime.Now.ToUniversalTime.ToString("yyyyMMdd HHmmss") & _ + " UTC") + + ' Create date time range. + Dim dateTimeRange As New DateTimeRange + dateTimeRange.min = minDateTime + dateTimeRange.max = maxDateTime + + Try + ' Create the selector. + Dim selector As New CustomerSyncSelector + selector.dateTimeRange = dateTimeRange + selector.campaignIds = GetAllCampaignIds(user) + + ' Get all account changes for campaign. + Dim accountChanges As CustomerChangeData = customerSyncService.get(selector) + + ' Display the changes. + If ((Not accountChanges Is Nothing) AndAlso _ + (Not accountChanges.changedCampaigns Is Nothing)) Then + Console.WriteLine("Displaying changes up to: {0}", accountChanges.lastChangeTimestamp) + + For Each campaignChanges As CampaignChangeData In accountChanges.changedCampaigns + Console.WriteLine("Campaign with id ""{0}"" was changed:", campaignChanges.campaignId) + Console.WriteLine(" Campaign changed status: {0}", _ + campaignChanges.campaignChangeStatus) + If (campaignChanges.campaignChangeStatus <> ChangeStatus.NEW) Then + Console.WriteLine(" Added ad extensions: {0}", _ + GetFormattedList(campaignChanges.addedAdExtensions)) + Console.WriteLine(" Added campaign criteria: {0}", _ + GetFormattedList(campaignChanges.addedCampaignCriteria)) + If (campaignChanges.campaignTargetingChanged) Then + Console.WriteLine(" Added campaign targeting: yes") + Else + Console.WriteLine(" Added campaign targeting: no") + End If + + Console.WriteLine(" Removed ad extensions: {0}", _ + GetFormattedList(campaignChanges.removedAdExtensions)) + Console.WriteLine(" Removed campaign criteria: {0}", _ + GetFormattedList(campaignChanges.removedCampaignCriteria)) + + If (Not campaignChanges.changedAdGroups Is Nothing) Then + For Each adGroupChanges As AdGroupChangeData In campaignChanges.changedAdGroups + Console.WriteLine(" Ad group with id ""{0}"" was changed:", _ + adGroupChanges.adGroupId) + Console.WriteLine(" Ad group changed status: {0}", _ + adGroupChanges.adGroupChangeStatus) + If (adGroupChanges.adGroupChangeStatus <> ChangeStatus.NEW) Then + Console.WriteLine(" Ads changed: {0}", _ + GetFormattedList(adGroupChanges.changedAds)) + Console.WriteLine(" Criteria changed: {0}", _ + GetFormattedList(adGroupChanges.changedCriteria)) + Console.WriteLine(" Criteria removed: {0}", _ + GetFormattedList(adGroupChanges.removedCriteria)) + End If + Next + End If + End If + Console.WriteLine() + Next + Else + Console.WriteLine("No account changes were found.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to get account changes.", ex) + End Try + End Sub + + ''' + ''' Formats a list of ids as a comma separated string. + ''' + ''' The list of ids. + ''' The comma separed formatted string, enclosed in square braces. + ''' + Private Function GetFormattedList(ByVal ids As Long()) As String + Dim builder As New StringBuilder + If (Not ids Is Nothing) Then + For Each id As Long In ids + builder.AppendFormat("{0}, ", id) + Next + End If + Return ("[" & builder.ToString.TrimEnd(New Char() {","c, " "c}) & "]") + End Function + + ''' + ''' Gets all campaign ids in the account. + ''' + ''' The user for which campaigns are retrieved. + ''' The list of campaign ids. + Private Function GetAllCampaignIds(ByVal user As AdWordsUser) As Long() + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201406.CampaignService) + + Dim allCampaigns As New List(Of Long) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id"} + + ' Get all campaigns. + Dim page As CampaignPage = campaignService.get(selector) + + ' Return the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + For Each campaign As Campaign In page.entries + allCampaigns.Add(campaign.id) + Next + End If + Return allCampaigns.ToArray + End Function + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/AdvancedOperations/AddAdGroupBidModifier.vb b/examples/AdXBuyer/Vb/v201406/AdvancedOperations/AddAdGroupBidModifier.vb new file mode 100644 index 00000000000..eb3fe125a5e --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/AdvancedOperations/AddAdGroupBidModifier.vb @@ -0,0 +1,111 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: thagikura@gmail.com (Takeshi Hagikura) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example illustrates how to add ad group level mobile bid + ''' modifier override. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class AddAdGroupBidModifier + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAdGroupBidModifier + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim bidModifier As Double = Double.Parse("INSERT_ADGROUP_BID_MODIFIER_HERE") + codeExample.Run(New AdWordsUser, adGroupId, bidModifier) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to add ad group level mobile bid" & _ + " modifier override." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the adgroup for which bid modifier is + ''' set. + ''' The mobile bid modifier for adgroup + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal bidModifier As Double) + ' Get the AdGroupBidModifierService. + Dim adGroupBidModifierService As AdGroupBidModifierService = user.GetService( _ + AdWordsService.v201406.AdGroupBidModifierService) + + ' Mobile criterion ID. + Dim criterionId As Long = 30001 + + ' Create the adgroup bid modifier. + Dim adGroupBidModifier As New AdGroupBidModifier() + adGroupBidModifier.bidModifier = bidModifier + adGroupBidModifier.adGroupId = adGroupId + + Dim platform As New Platform() + platform.id = criterionId + + adGroupBidModifier.criterion = platform + + Dim operation As New AdGroupBidModifierOperation() + operation.operator = [Operator].ADD + operation.operand = adGroupBidModifier + + Try + ' Add ad group level mobile bid modifier. + Dim retval As AdGroupBidModifierReturnValue = adGroupBidModifierService.mutate( _ + New AdGroupBidModifierOperation() {operation}) + + ' Display the results. + If Not retval Is Nothing AndAlso Not retval.value Is Nothing AndAlso _ + retval.value.Length > 0 Then + Dim newBidModifier As AdGroupBidModifier = retval.value(0) + Console.WriteLine("AdGroup ID {0}, Criterion ID {1} was updated with ad group " & _ + "level modifier: {2}", newBidModifier.adGroupId, newBidModifier.criterion.id, _ + newBidModifier.bidModifier) + Else + Console.WriteLine("No bid modifiers were added to the adgroup.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add bid modifiers to adgroup.", ex) + End Try + End Sub + End Class + +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/AdvancedOperations/GetAdGroupBidModifiers.vb b/examples/AdXBuyer/Vb/v201406/AdvancedOperations/GetAdGroupBidModifiers.vb new file mode 100644 index 00000000000..b10323ee2e8 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/AdvancedOperations/GetAdGroupBidModifiers.vb @@ -0,0 +1,125 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example illustrates how to retrieve ad group level mobile bid + ''' modifiers for a campaign. + ''' + ''' AdGroupBidModifierService.get + ''' + Public Class GetAdGroupBidModifiers + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAdGroupBidModifiers + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to retrieve ad group level mobile bid" & _ + " modifiers for a campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which adgroup bid + ''' modifiers are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupBidModifierService. + Dim adGroupBidModifierService As AdGroupBidModifierService = user.GetService( _ + AdWordsService.v201406.AdGroupBidModifierService) + + Const PAGE_SIZE As Integer = 500 + + ' Get all ad group bid modifiers for the campaign. + Dim selector As New Selector() + selector.fields = New String() {"CampaignId", "AdGroupId", "BidModifier", _ + "BidModifierSource", "CriteriaType", "Id"} + + Dim predicate As New Predicate() + predicate.field = "CampaignId" + predicate.[operator] = PredicateOperator.EQUALS + predicate.values = New String() {campaignId.ToString()} + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging() + + Dim offset As Integer = 0 + Dim pageSize As Integer = PAGE_SIZE + + Dim page As New AdGroupBidModifierPage() + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the campaigns. + page = adGroupBidModifierService.get(selector) + + ' Display the results. + If (Not page Is Nothing) AndAlso (Not page.entries Is Nothing) Then + Dim i As Integer = offset + For Each adGroupBidModifier As AdGroupBidModifier In page.entries + Dim bidModifier As String = "" + If adGroupBidModifier.bidModifierSpecified Then + bidModifier = adGroupBidModifier.bidModifier.ToString() + Else + bidModifier = "UNSET" + End If + Console.WriteLine("{0}) Campaign ID {1}, AdGroup ID {2}, Criterion ID {3} has " & _ + "ad group level modifier: {4}, source = {5}.", _ + i + 1, adGroupBidModifier.campaignId, _ + adGroupBidModifier.adGroupId, adGroupBidModifier.criterion.id, _ + bidModifier, adGroupBidModifier.bidModifierSource) + i = i + 1 + Next + End If + offset += pageSize + Loop While offset < page.totalNumEntries + Console.WriteLine("Number of adgroup bid modifiers found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve adgroup bid modifiers.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/AdvancedOperations/UploadOfflineConversions.vb b/examples/AdXBuyer/Vb/v201406/AdvancedOperations/UploadOfflineConversions.vb new file mode 100644 index 00000000000..595bd70e08b --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/AdvancedOperations/UploadOfflineConversions.vb @@ -0,0 +1,245 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds a Shared Bidding Strategy and uses it to construct + ''' a campaign. + ''' + ''' Tags: BiddingStrategyService.mutate + ''' Tags: BudgetService.mutate, CampaignService.mutate + ''' + Public Class UploadOfflineConversions + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim conversionName As String = "INSERT_CONVERSION_NAME_HERE" + ' GCLID needs to be newer than 30 days. + Dim gClId As String = "INSERT_GOOGLE_CLICK_ID_HERE" + ' The conversion time should be higher than the click time. + Dim conversionTime As String = "INSERT_CONVERSION_TIME_HERE" + Dim conversionValue As Double = Double.Parse("INSERT_CONVERSION_VALUE_HERE") + + Dim codeExample As New UploadOfflineConversions + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser, conversionName, gClId, conversionTime, conversionValue) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a Shared Bidding Strategy and uses it to construct " & _ + "a campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The name of the upload conversion to be + ''' created. + ''' The Google Click ID of the click for which offline + ''' conversions are uploaded. + ''' The conversion value to be uploaded. + ''' + ''' The conversion time, in yyyymmdd hhmmss + ''' format. + Public Sub Run(ByVal user As AdWordsUser, ByVal conversionName As String, _ + ByVal gClid As String, ByVal conversionTime As String, ByVal conversionValue As Double) + ' Get the ConversionTrackerService. + Dim conversionTrackerService As ConversionTrackerService = user.GetService( _ + AdWordsService.v201406.ConversionTrackerService) + + ' Get the OfflineConversionFeedService. + Dim offlineConversionFeedService As OfflineConversionFeedService = user.GetService( _ + AdWordsService.v201406.OfflineConversionFeedService) + + Const VIEWTHROUGH_LOOKBACK_WINDOW As Integer = 30 + Const CTC_LOOKBACK_WINDOW As Integer = 90 + + Try + ' Create an upload conversion. Once created, this entry will be visible + ' under Tools and Analysis->Conversion and will have "Source = Import". + Dim uploadConversion As New UploadConversion() + uploadConversion.category = ConversionTrackerCategory.PAGE_VIEW + uploadConversion.name = conversionName + uploadConversion.viewthroughLookbackWindow = VIEWTHROUGH_LOOKBACK_WINDOW + uploadConversion.ctcLookbackWindow = CTC_LOOKBACK_WINDOW + + Dim uploadConversionOperation As New ConversionTrackerOperation() + uploadConversionOperation.operator = [Operator].ADD + uploadConversionOperation.operand = uploadConversion + + Dim conversionTrackerRetval As ConversionTrackerReturnValue = _ + conversionTrackerService.mutate(New ConversionTrackerOperation() { _ + uploadConversionOperation}) + + Dim newUploadConversion As UploadConversion = conversionTrackerRetval.value(0) + + Console.WriteLine("New upload conversion type with name = '{0}' and id = {1} was " & _ + "created.", newUploadConversion.name, newUploadConversion.id) + + ' Associate offline conversions with the upload conversion we created. + Dim feed As New OfflineConversionFeed() + feed.conversionName = conversionName + feed.conversionTime = conversionTime + feed.conversionValue = conversionValue + feed.googleClickId = gClid + + Dim offlineConversionOperation As New OfflineConversionFeedOperation() + offlineConversionOperation.operator = [Operator].ADD + offlineConversionOperation.operand = feed + + Dim offlineConversionRetval As OfflineConversionFeedReturnValue = _ + offlineConversionFeedService.mutate( _ + New OfflineConversionFeedOperation() {offlineConversionOperation}) + + Dim newFeed As OfflineConversionFeed = offlineConversionRetval.value(0) + + Console.WriteLine("Uploaded offline conversion value of {0} for Google Click ID = " & _ + "'{1}' to '{2}'.", newFeed.conversionValue, newFeed.googleClickId, _ + newFeed.conversionName) + Catch ex As Exception + Throw New System.ApplicationException("Failed to upload offline conversions.", ex) + End Try + End Sub + + + ''' + ''' Creates the shared bidding strategy. + ''' + ''' The bidding strategy service. + ''' The bidding strategy name. + ''' The bid ceiling. + ''' The spend target. + ''' The bidding strategy object. + Private Function CreateBiddingStrategy(ByVal biddingStrategyService As BiddingStrategyService, _ + ByVal name As String, ByVal bidCeiling As Long, ByVal spendTarget As Long) _ + As SharedBiddingStrategy + ' Create a shared bidding strategy. + Dim sharedBiddingStrategy As New SharedBiddingStrategy() + sharedBiddingStrategy.name = name + + Dim biddingScheme As New TargetSpendBiddingScheme() + ' Optionally set additional bidding scheme parameters. + biddingScheme.bidCeiling = New Money() + biddingScheme.bidCeiling.microAmount = bidCeiling + + biddingScheme.spendTarget = New Money() + biddingScheme.spendTarget.microAmount = spendTarget + + sharedBiddingStrategy.biddingScheme = biddingScheme + + ' Create operation. + Dim operation As New BiddingStrategyOperation() + operation.operator = [Operator].ADD + operation.operand = sharedBiddingStrategy + + Return biddingStrategyService.mutate(New BiddingStrategyOperation() {operation}).value(0) + End Function + + ''' + ''' Creates an explicit budget to be used only to create the Campaign. + ''' + ''' The budget service. + ''' The budget name. + ''' The budget amount. + ''' The budget object. + Private Function CreateSharedBudget(ByVal budgetService As BudgetService, _ + ByVal name As String, ByVal amount As Long) As Budget + ' Create a shared budget + Dim budget As New Budget() + budget.name = name + budget.period = BudgetBudgetPeriod.DAILY + budget.amount = New Money() + budget.amount.microAmount = amount + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD + budget.isExplicitlyShared = True + + ' Create operation. + Dim operation As New BudgetOperation() + operation.operand = budget + operation.operator = [Operator].ADD + + ' Make the mutate request. + Return budgetService.mutate(New BudgetOperation() {operation}).value(0) + End Function + + ''' + ''' Creates the campaign with a shared bidding strategy. + ''' + ''' The campaign service. + ''' The campaign name. + ''' The bidding strategy id. + ''' The shared budget id. + ''' The campaign object. + Private Function CreateCampaignWithBiddingStrategy(ByVal campaignService As CampaignService, _ + ByVal name As String, ByVal biddingStrategyId As Long, ByVal sharedBudgetId As Long) _ + As Campaign + ' Create campaign. + Dim campaign As New Campaign() + campaign.name = name + + ' Set the budget. + campaign.budget = New Budget() + campaign.budget.budgetId = sharedBudgetId + + ' Set bidding strategy (required). + Dim biddingStrategyConfiguration As New BiddingStrategyConfiguration() + biddingStrategyConfiguration.biddingStrategyId = biddingStrategyId + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration + + ' Set keyword matching setting (required). + Dim keywordMatchSetting As New KeywordMatchSetting() + keywordMatchSetting.optIn = True + campaign.settings = New Setting() {keywordMatchSetting} + + ' Set network targeting (recommended). + Dim networkSetting As New NetworkSetting() + networkSetting.targetGoogleSearch = True + networkSetting.targetSearchNetwork = True + networkSetting.targetContentNetwork = True + campaign.networkSetting = networkSetting + + ' Create operation. + Dim operation As New CampaignOperation() + operation.operand = campaign + operation.operator = [Operator].ADD + + Return campaignService.mutate(New CampaignOperation() {operation}).value(0) + End Function + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/AdvancedOperations/UseSharedBiddingStrategy.vb b/examples/AdXBuyer/Vb/v201406/AdvancedOperations/UseSharedBiddingStrategy.vb new file mode 100644 index 00000000000..e999d252402 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/AdvancedOperations/UseSharedBiddingStrategy.vb @@ -0,0 +1,213 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License") +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http:'www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds a Shared Bidding Strategy and uses it to construct + ''' a campaign. + ''' + ''' Tags: BiddingStrategyService.mutate + ''' Tags: BudgetService.mutate, CampaignService.mutate + ''' + Public Class UseSharedBiddingStrategy + Inherits ExampleBase + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UseSharedBiddingStrategy + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a Shared Bidding Strategy and uses it to construct " & _ + "a campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the services. + Dim biddingStrategyService As BiddingStrategyService = user.GetService( _ + AdWordsService.v201406.BiddingStrategyService) + + Dim budgetService As BudgetService = user.GetService(AdWordsService.v201406.BudgetService) + + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201406.CampaignService) + + Dim biddingStrategyName As String = "Maximize Clicks " & ExampleUtilities.GetRandomString() + Dim bidCeiling As Long = 2000000 + Dim spendTarget As Long = 20000000 + + Dim budgetName As String = "Shared Interplanetary Budget #" & _ + ExampleUtilities.GetRandomString() + Dim budgetAmount As Long = 30000000 + + Dim campaignName As String = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString() + + Try + Dim sharedBiddingStrategy As SharedBiddingStrategy = CreateBiddingStrategy( _ + biddingStrategyService, biddingStrategyName, bidCeiling, spendTarget) + Console.WriteLine("Shared bidding strategy with name '{0}' and ID {1} of type {2} " & _ + "was created.", sharedBiddingStrategy.name, sharedBiddingStrategy.id, _ + sharedBiddingStrategy.biddingScheme.BiddingSchemeType) + + Dim sharedBudget As Budget = CreateSharedBudget(budgetService, budgetName, budgetAmount) + + Dim newCampaign As Campaign = CreateCampaignWithBiddingStrategy(campaignService, _ + campaignName, sharedBiddingStrategy.id, sharedBudget.budgetId) + + Console.WriteLine("Campaign with name '{0}', ID {1} and bidding scheme ID {2} was " & _ + "created.", newCampaign.name, newCampaign.id, _ + newCampaign.biddingStrategyConfiguration.biddingStrategyId) + + Catch ex As Exception + Throw New System.ApplicationException("Failed to create campaign that uses shared " & _ + "bidding strategy.", ex) + End Try + End Sub + + + ''' + ''' Creates the shared bidding strategy. + ''' + ''' The bidding strategy service. + ''' The bidding strategy name. + ''' The bid ceiling. + ''' The spend target. + ''' The bidding strategy object. + Private Function CreateBiddingStrategy(ByVal biddingStrategyService As BiddingStrategyService, _ + ByVal name As String, ByVal bidCeiling As Long, ByVal spendTarget As Long) _ + As SharedBiddingStrategy + ' Create a shared bidding strategy. + Dim sharedBiddingStrategy As New SharedBiddingStrategy() + sharedBiddingStrategy.name = name + + Dim biddingScheme As New TargetSpendBiddingScheme() + ' Optionally set additional bidding scheme parameters. + biddingScheme.bidCeiling = New Money() + biddingScheme.bidCeiling.microAmount = bidCeiling + + biddingScheme.spendTarget = New Money() + biddingScheme.spendTarget.microAmount = spendTarget + + sharedBiddingStrategy.biddingScheme = biddingScheme + + ' Create operation. + Dim operation As New BiddingStrategyOperation() + operation.operator = [Operator].ADD + operation.operand = sharedBiddingStrategy + + Return biddingStrategyService.mutate(New BiddingStrategyOperation() {operation}).value(0) + End Function + + ''' + ''' Creates an explicit budget to be used only to create the Campaign. + ''' + ''' The budget service. + ''' The budget name. + ''' The budget amount. + ''' The budget object. + Private Function CreateSharedBudget(ByVal budgetService As BudgetService, _ + ByVal name As String, ByVal amount As Long) As Budget + ' Create a shared budget + Dim budget As New Budget() + budget.name = name + budget.period = BudgetBudgetPeriod.DAILY + budget.amount = New Money() + budget.amount.microAmount = amount + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD + budget.isExplicitlyShared = True + + ' Create operation. + Dim operation As New BudgetOperation() + operation.operand = budget + operation.operator = [Operator].ADD + + ' Make the mutate request. + Return budgetService.mutate(New BudgetOperation() {operation}).value(0) + End Function + + ''' + ''' Creates the campaign with a shared bidding strategy. + ''' + ''' The campaign service. + ''' The campaign name. + ''' The bidding strategy id. + ''' The shared budget id. + ''' The campaign object. + Private Function CreateCampaignWithBiddingStrategy(ByVal campaignService As CampaignService, _ + ByVal name As String, ByVal biddingStrategyId As Long, ByVal sharedBudgetId As Long) _ + As Campaign + ' Create campaign. + Dim campaign As New Campaign() + campaign.name = name + campaign.advertisingChannelType = AdvertisingChannelType.SEARCH + + ' Set the budget. + campaign.budget = New Budget() + campaign.budget.budgetId = sharedBudgetId + + ' Set bidding strategy (required). + Dim biddingStrategyConfiguration As New BiddingStrategyConfiguration() + biddingStrategyConfiguration.biddingStrategyId = biddingStrategyId + + campaign.biddingStrategyConfiguration = biddingStrategyConfiguration + + ' Set keyword matching setting (required). + Dim keywordMatchSetting As New KeywordMatchSetting() + keywordMatchSetting.optIn = True + campaign.settings = New Setting() {keywordMatchSetting} + + ' Set network targeting (recommended). + Dim networkSetting As New NetworkSetting() + networkSetting.targetGoogleSearch = True + networkSetting.targetSearchNetwork = True + networkSetting.targetContentNetwork = True + campaign.networkSetting = networkSetting + + ' Create operation. + Dim operation As New CampaignOperation() + operation.operand = campaign + operation.operator = [Operator].ADD + + Return campaignService.mutate(New CampaignOperation() {operation}).value(0) + End Function + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/BasicOperations/AddAdGroupDemographicCriteria.vb b/examples/AdXBuyer/Vb/v201406/BasicOperations/AddAdGroupDemographicCriteria.vb new file mode 100644 index 00000000000..055466b49ac --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/BasicOperations/AddAdGroupDemographicCriteria.vb @@ -0,0 +1,124 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds demographic target criteria to an ad group. To get + ''' ad groups, run AddAdGroup.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class AddAdGroupDemographicCriteria + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAdGroupDemographicCriteria + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds demographic target criteria to an ad group. To get ad " & _ + "groups, run AddAdGroup.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which criteria are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = _ + user.GetService(AdWordsService.v201406.AdGroupCriterionService) + + ' Create biddable ad group criterion for gender + Dim genderTarget As New Gender() + ' Criterion Id for male. The IDs can be found here + ' https://developers.google.com/adwords/api/docs/appendix/genders + genderTarget.id = 10 + + Dim genderBiddableAdGroupCriterion As New BiddableAdGroupCriterion() + genderBiddableAdGroupCriterion.adGroupId = adGroupId + genderBiddableAdGroupCriterion.criterion = genderTarget + + ' Create negative ad group criterion for age range + Dim ageRangeNegative As New AgeRange() + ' Criterion Id for age 18 to 24. The IDs can be found here + ' https://developers.google.com/adwords/api/docs/appendix/ages + + ageRangeNegative.id = 503001 + Dim ageRangeNegativeAdGroupCriterion As New NegativeAdGroupCriterion() + ageRangeNegativeAdGroupCriterion.adGroupId = adGroupId + ageRangeNegativeAdGroupCriterion.criterion = ageRangeNegative + + ' Create operations. + Dim genderBiddableAdGroupCriterionOperation As New AdGroupCriterionOperation() + genderBiddableAdGroupCriterionOperation.operand = genderBiddableAdGroupCriterion + genderBiddableAdGroupCriterionOperation.operator = [Operator].ADD + + Dim ageRangeNegativeAdGroupCriterionOperation As New AdGroupCriterionOperation() + ageRangeNegativeAdGroupCriterionOperation.operand = ageRangeNegativeAdGroupCriterion + ageRangeNegativeAdGroupCriterionOperation.operator = [Operator].ADD + + Dim operations As New List(Of Operation) + operations.Add(genderBiddableAdGroupCriterionOperation) + operations.Add(ageRangeNegativeAdGroupCriterionOperation) + + Try + ' Add ad group criteria. + Dim result As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + operations.ToArray) + + ' Display ad group criteria. + If (Not result Is Nothing) AndAlso Not (result.value Is Nothing) Then + For Each adGroupCriterionResult As AdGroupCriterion In result.value + Console.WriteLine("Ad group criterion with ad group id '{0}', criterion id " & _ + "'{1}', and type '{2}' was added.", adGroupCriterionResult.adGroupId, _ + adGroupCriterionResult.criterion.id, _ + adGroupCriterionResult.criterion.CriterionType) + Next + Else + Console.WriteLine("No ad group criteria were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create ad group criteria.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/BasicOperations/AddAdGroups.vb b/examples/AdXBuyer/Vb/v201406/BasicOperations/AddAdGroups.vb new file mode 100644 index 00000000000..78fa07ba242 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/BasicOperations/AddAdGroups.vb @@ -0,0 +1,138 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example illustrates how to create ad groups. To create + ''' campaigns, run AddCampaigns.vb. + ''' + ''' Tags: AdGroupService.mutate + ''' + Public Class AddAdGroups + Inherits ExampleBase + ''' + ''' Number of items being added / updated in this code example. + ''' + Const NUM_ITEMS As Integer = 5 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAdGroups + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to create ad groups. To create campaigns," & _ + " run AddCampaigns.vb" + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to which ad groups are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService( _ + AdWordsService.v201406.AdGroupService) + + Dim operations As New List(Of AdGroupOperation) + + For i As Integer = 1 To NUM_ITEMS + ' Create the ad group. + Dim adGroup As New AdGroup + adGroup.name = String.Format("Earth to Mars Cruises #{0}", ExampleUtilities.GetRandomString) + adGroup.status = AdGroupStatus.ENABLED + adGroup.campaignId = campaignId + + ' Set the ad group bids. + Dim biddingConfig As New BiddingStrategyConfiguration() + + Dim cpmBid As New CpmBid() + cpmBid.bid = New Money() + cpmBid.bid.microAmount = 10000000 + + biddingConfig.bids = New Bids() {cpmBid} + + adGroup.biddingStrategyConfiguration = biddingConfig + + ' Optional: Set targeting restrictions. + ' These setting only affect serving for the Display Network. + Dim targetingSetting As New TargetingSetting() + + Dim placementDetail As New TargetingSettingDetail() + placementDetail.criterionTypeGroup = CriterionTypeGroup.PLACEMENT + placementDetail.targetAll = True + + Dim verticalDetail As New TargetingSettingDetail() + verticalDetail.criterionTypeGroup = CriterionTypeGroup.VERTICAL + verticalDetail.targetAll = False + + targetingSetting.details = New TargetingSettingDetail() {placementDetail, verticalDetail} + + adGroup.settings = New Setting() {targetingSetting} + + ' Create the operation. + Dim operation1 As New AdGroupOperation + operation1.operator = [Operator].ADD + operation1.operand = adGroup + + operations.Add(operation1) + Next + + Try + ' Create the ad group. + Dim retVal As AdGroupReturnValue = adGroupService.mutate(operations.ToArray) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + For Each newAdGroup As AdGroup In retVal.value + Console.WriteLine("Ad group with id = '{0}' and name = '{1}' was created.", _ + newAdGroup.id, newAdGroup.name) + Next + Else + Console.WriteLine("No ad groups were created.") + End If + Catch ex As Exception + Console.WriteLine("Failed to create ad groups. Exception says ""{0}""", ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/BasicOperations/AddCampaigns.vb b/examples/AdXBuyer/Vb/v201406/BasicOperations/AddCampaigns.vb new file mode 100644 index 00000000000..152ff03914a --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/BasicOperations/AddCampaigns.vb @@ -0,0 +1,174 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds campaigns. To get campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignService.mutate + ''' + Public Class AddCampaigns + Inherits ExampleBase + ''' + ''' Number of items being added / updated in this code example. + ''' + Const NUM_ITEMS As Integer = 5 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddCampaigns + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds campaigns. To get campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the BudgetService. + Dim budgetService As BudgetService = user.GetService( _ + AdWordsService.v201406.BudgetService) + + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201406.CampaignService) + + ' Create the campaign budget. + Dim budget As New Budget + budget.name = "Interplanetary Cruise Budget #" & ExampleUtilities.GetRandomString + budget.period = BudgetBudgetPeriod.DAILY + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD + budget.amount = New Money + budget.amount.microAmount = 50000000 + + Dim budgetOperation As New BudgetOperation + budgetOperation.operator = [Operator].ADD + budgetOperation.operand = budget + + Try + Dim budgetRetval As BudgetReturnValue = budgetService.mutate(New BudgetOperation() _ + {budgetOperation}) + budget = budgetRetval.value(0) + Catch ex As Exception + Throw New System.ApplicationException("Failed to add shared budget.", ex) + End Try + + Dim operations As New List(Of CampaignOperation) + + For i As Integer = 1 To NUM_ITEMS + ' Create the campaign. + Dim campaign As New Campaign + campaign.name = "Interplanetary Cruise #" & ExampleUtilities.GetRandomString + + campaign.status = CampaignStatus.PAUSED + + Dim biddingConfig As New BiddingStrategyConfiguration() + biddingConfig.biddingStrategyType = BiddingStrategyType.MANUAL_CPM + + ' Optional: also provide matching bidding scheme. + biddingConfig.biddingScheme = New ManualCpmBiddingScheme() + + campaign.biddingStrategyConfiguration = biddingConfig + + ' Set the campaign budget. + campaign.budget = New Budget + campaign.budget.budgetId = budget.budgetId + campaign.advertisingChannelType = AdvertisingChannelType.SEARCH + + ' Set targetContentNetwork true. Other network targeting is not available + ' for Ad Exchange Buyers. + campaign.networkSetting = New NetworkSetting + campaign.networkSetting.targetGoogleSearch = False + campaign.networkSetting.targetSearchNetwork = False + campaign.networkSetting.targetContentNetwork = True + campaign.networkSetting.targetPartnerSearchNetwork = False + + ' Set real time bidding settings. + Dim rtbSetting As New RealTimeBiddingSetting + rtbSetting.optIn = True + + ' Set the campaign settings for near-exact and near-phrase matches. + Dim keywordSetting As New KeywordMatchSetting + keywordSetting.optIn = False + + campaign.settings = New Setting() {rtbSetting, keywordSetting} + + ' Optional: Set the start date. + campaign.startDate = DateTime.Now.AddDays(1).ToString("yyyyMMdd") + + ' Optional: Set the end date. + campaign.endDate = DateTime.Now.AddYears(1).ToString("yyyyMMdd") + + ' Optional: Set the frequency cap. + Dim frequencyCap As New FrequencyCap + frequencyCap.impressions = 5 + frequencyCap.level = Level.ADGROUP + frequencyCap.timeUnit = TimeUnit.DAY + campaign.frequencyCap = frequencyCap + + ' Create the operation. + Dim operation As New CampaignOperation + operation.operator = [Operator].ADD + operation.operand = campaign + + operations.Add(operation) + Next + + Try + ' Add the campaign. + Dim retVal As CampaignReturnValue = campaignService.mutate(operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + For Each newCampaign As Campaign In retVal.value + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was added.", _ + newCampaign.name, newCampaign.id) + Next + Else + Console.WriteLine("No campaigns were added.") + End If + Catch ex As Exception + Console.WriteLine("Failed to add campaigns. Exception says ""{0}""", ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/BasicOperations/AddPlacements.vb b/examples/AdXBuyer/Vb/v201406/BasicOperations/AddPlacements.vb new file mode 100644 index 00000000000..66c6f6a78a8 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/BasicOperations/AddPlacements.vb @@ -0,0 +1,121 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds placements to an ad group. To get ad groups, run + ''' GetAdGroups.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class AddPlacements + Inherits ExampleBase + ''' + ''' Number of items being added / updated in this code example. + ''' + Const NUM_ITEMS As Integer = 5 + + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddPlacements + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds placements to an ad group. To get ad groups, run " & _ + "GetAdGroups.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which keywords are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201406.AdGroupCriterionService) + + Dim operations As New List(Of AdGroupCriterionOperation) + + For i As Integer = 1 To NUM_ITEMS + + ' Create the placement. + Dim placement As New Placement + placement.url = "http://mars.google.com/" + i.ToString() + + ' Create the biddable ad group criterion. + Dim placementCriterion As AdGroupCriterion = New BiddableAdGroupCriterion + placementCriterion.adGroupId = adGroupId + placementCriterion.criterion = placement + + ' Create the operations. + Dim operation As New AdGroupCriterionOperation + operation.operator = [Operator].ADD + operation.operand = placementCriterion + + operations.Add(operation) + Next + Try + ' Create the placements. + Dim retVal As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + operations.ToArray) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing)) Then + For Each adGroupCriterion As AdGroupCriterion In retVal.value + ' If you are adding multiple type of criteria, then you may need to + ' check for + ' + ' if (adGroupCriterion is Placement) { ... } + ' + ' to identify the criterion type. + Console.WriteLine("Placement with ad group id = '{0}, placement id = '{1} and url " & _ + "= '{2}' was created.", adGroupCriterion.adGroupId, _ + adGroupCriterion.criterion.id, TryCast(adGroupCriterion.criterion, Placement).url) + Next + Else + Console.WriteLine("No placements were added.") + End If + Catch ex As Exception + Console.WriteLine("Failed to create placements. Exception says ""{0}""", ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/BasicOperations/AddThirdPartyRedirectAds.vb b/examples/AdXBuyer/Vb/v201406/BasicOperations/AddThirdPartyRedirectAds.vb new file mode 100644 index 00000000000..3f743b327eb --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/BasicOperations/AddThirdPartyRedirectAds.vb @@ -0,0 +1,151 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 +Imports Google.Api.Ads.Common.Util + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds third party redirect ads to a given ad group. To + ''' list ad groups, run GetAdGroups.vb. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class AddThirdPartyRedirectAds + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddThirdPartyRedirectAds + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds third party redirect ads to a given ad group. To list " & _ + "ad groups, run GetAdGroups.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which ads are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService( _ + AdWordsService.v201406.AdGroupAdService) + + ' Create standard third party redirect ad. + Dim standardAd As New ThirdPartyRedirectAd + standardAd.name = String.Format("Example third party ad #{0}", ExampleUtilities.GetRandomString) + standardAd.url = "http://www.example.com" + + standardAd.dimensions = New Dimensions + standardAd.dimensions.height = 250 + standardAd.dimensions.width = 300 + + standardAd.snippet = "" + + ' DoubleClick Rich Media Expandable format ID. + standardAd.certifiedVendorFormatId = 232 + standardAd.isCookieTargeted = False + standardAd.isUserInterestTargeted = False + standardAd.isTagged = False + standardAd.richMediaAdType = RichMediaAdRichMediaAdType.STANDARD + + ' Expandable Ad properties. + standardAd.expandingDirections = New ThirdPartyRedirectAdExpandingDirection() { _ + ThirdPartyRedirectAdExpandingDirection.EXPANDING_UP, _ + ThirdPartyRedirectAdExpandingDirection.EXPANDING_DOWN _ + } + + standardAd.adAttributes = New RichMediaAdAdAttribute() { _ + RichMediaAdAdAttribute.ROLL_OVER_TO_EXPAND} + + ' Create in-stream third party redirect ad. + Dim inStreamAd As New ThirdPartyRedirectAd() + inStreamAd.name = String.Format("Example third party ad #{0}", ExampleUtilities.GetRandomString) + inStreamAd.url = "http://www.example.com" + ' Set the duration to 15 secs. + inStreamAd.adDuration = 15000 + inStreamAd.sourceUrl = "http://ad.doubleclick.net/pfadx/N270.126913.6102203221521/B3876671.21;dcadv=2215309;sz=0x0;ord=%5btimestamp%5d;dcmt=text/xml" + inStreamAd.certifiedVendorFormatId = 303 + inStreamAd.richMediaAdType = RichMediaAdRichMediaAdType.IN_STREAM_VIDEO + + Dim operations As New List(Of AdGroupAdOperation) + Dim ads As ThirdPartyRedirectAd() = New ThirdPartyRedirectAd() {standardAd, inStreamAd} + For Each redirectAd As ThirdPartyRedirectAd In ads + Dim thirdPartyRedirectAdGroupAd As New AdGroupAd + thirdPartyRedirectAdGroupAd.adGroupId = adGroupId + thirdPartyRedirectAdGroupAd.ad = redirectAd + + ' Optional: Set the status. + thirdPartyRedirectAdGroupAd.status = AdGroupAdStatus.PAUSED + + ' Create the operations. + Dim operation As New AdGroupAdOperation + operation.operator = [Operator].ADD + operation.operand = thirdPartyRedirectAdGroupAd + + operations.Add(operation) + Next + + Try + ' Create the ads. + Dim retVal As AdGroupAdReturnValue = service.mutate(operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing)) Then + ' If you are adding multiple type of Ads, then you may need to check + ' for + ' + ' if (adGroupAd.ad is ThirdPartyRedirectAd) { ... } + ' + ' to identify the ad type. + For Each adGroupAd As AdGroupAd In retVal.value + Console.WriteLine("New third party redirect ad with id = ""{0}"" and url = ""{1}"" " & _ + "was created.", adGroupAd.ad.id, DirectCast(adGroupAd.ad, ThirdPartyRedirectAd).url) + Next + Else + Console.WriteLine("No third party redirect ads were created.") + End If + Catch ex As Exception + Console.WriteLine("Failed to create third party redirect ad. Exception says ""{0}""", _ + ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/BasicOperations/GetAdGroups.vb b/examples/AdXBuyer/Vb/v201406/BasicOperations/GetAdGroups.vb new file mode 100644 index 00000000000..b945c6b4994 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/BasicOperations/GetAdGroups.vb @@ -0,0 +1,114 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example illustrates how to retrieve all the ad groups for a + ''' campaign. To create an ad group, run AddAdGroup.vb. + ''' + ''' Tags: AdGroupService.get + ''' + Public Class GetAdGroups + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAdGroups + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to retrieve all the ad groups for a " & _ + "campaign. To create an ad group, run AddAdGroup.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which ad groups are + ''' retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService( _ + AdWordsService.v201406.AdGroupService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "Name"} + + ' Create the filters. + Dim predicate As New Predicate + predicate.field = "CampaignId" + predicate.operator = PredicateOperator.EQUALS + predicate.values = New String() {campaignId.ToString} + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the ad groups. + page = adGroupService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each adGroup As AdGroup In page.entries + Console.WriteLine("{0}) Ad group name is ""{1}"" and id is ""{2}"".", i, _ + adGroup.name, adGroup.id) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of ad groups found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve ad group(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/BasicOperations/GetCampaigns.vb b/examples/AdXBuyer/Vb/v201406/BasicOperations/GetCampaigns.vb new file mode 100644 index 00000000000..1b82616abda --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/BasicOperations/GetCampaigns.vb @@ -0,0 +1,103 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example lists all campaigns. To add a campaign, run + ''' AddCampaign.vb. + ''' + ''' Tags: CampaignService.get + ''' + Public Class GetCampaigns + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetCampaigns + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example lists all campaigns. To add a campaign, run AddCampaign.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201406.CampaignService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "Name", "Status"} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New CampaignPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the campaigns. + page = campaignService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each campaign As Campaign In page.entries + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = " & _ + "'{3}' was found.", i, campaign.id, campaign.name, campaign.status) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve campaign(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/BasicOperations/GetCampaignsWithAwql.vb b/examples/AdXBuyer/Vb/v201406/BasicOperations/GetCampaignsWithAwql.vb new file mode 100644 index 00000000000..9c31e951ed3 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/BasicOperations/GetCampaignsWithAwql.vb @@ -0,0 +1,102 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example lists all campaigns using an AWQL query. See + ''' https://developers.google.com/adwords/api/docs/guides/awql for AWQL + ''' documentation. To add a campaign, run AddCampaign.vb. + ''' + ''' Tags: CampaignService.get + ''' + Public Class GetCampaignsWithAwql + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetCampaignsWithAwql + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example lists all campaigns using an AWQL query. See " & _ + "https://developers.google.com/adwords/api/docs/guides/awql for AWQL " & _ + "documentation. To add a campaign, run AddCampaign.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201406.CampaignService) + + ' Create the query. + Dim query As String = "SELECT Id, Name, Status ORDER BY Name" + + Dim offset As Long = 0 + Dim pageSize As Long = 500 + + Dim page As New CampaignPage() + + Try + Do + Dim queryWithPaging As String = String.Format("{0} LIMIT {1}, {2}", query, offset, _ + pageSize) + + ' Get the campaigns. + page = campaignService.query(queryWithPaging) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each campaign As Campaign In page.entries + Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' and status = " & _ + "'{3}' was found.", i, campaign.id, campaign.name, campaign.status) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve campaign(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/BasicOperations/GetPlacements.vb b/examples/AdXBuyer/Vb/v201406/BasicOperations/GetPlacements.vb new file mode 100644 index 00000000000..d795d9b22b2 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/BasicOperations/GetPlacements.vb @@ -0,0 +1,128 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example gets all placements in an account. To add placements, run + ''' AddPlacements.vb. + ''' + ''' Tags: AdGroupCriterionService.get + ''' + Public Class GetPlacements + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetPlacements + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all placements in an account. To add placements, run " & _ + "AddPlacements.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201406.AdGroupCriterionService) + + ' Create a selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "AdGroupId", "PlacementUrl"} + + ' Select only placements. + Dim predicate As New Predicate + predicate.field = "CriteriaType" + predicate.operator = PredicateOperator.EQUALS + predicate.values = New String() {"PLACEMENT"} + selector.predicates = New Predicate() {predicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupCriterionPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the placements. + page = adGroupCriterionService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each adGroupCriterion As AdGroupCriterion In page.entries + Dim isNegative As Boolean = TypeOf adGroupCriterion Is NegativeAdGroupCriterion + + ' If you are retrieving multiple type of criteria, then you may + ' need to check for + ' + ' if (adGroupCriterion is Placement) { ... } + ' + ' to identify the criterion type. + Dim placement As Placement = adGroupCriterion.criterion + If isNegative Then + Console.WriteLine("{0}) Negative placement with ad group ID = '{1}', placement " & _ + "ID = '{2}', and url = '{3}' was found.", i, adGroupCriterion.adGroupId, _ + placement.id, placement.url) + Else + Console.WriteLine("{0}) Placement with ad group ID = '{1}', placement ID = " & _ + "'{2}' and url = '{3}' was found.", i, adGroupCriterion.adGroupId, _ + placement.id, placement.url) + End If + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of placements found: {0}", page.totalNumEntries) + Catch ex As Exception + Console.WriteLine("Failed to retrieve placements. Exception says ""{0}""", ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/BasicOperations/GetThirdPartyRedirectAds.vb b/examples/AdXBuyer/Vb/v201406/BasicOperations/GetThirdPartyRedirectAds.vb new file mode 100644 index 00000000000..7ca881f4f6e --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/BasicOperations/GetThirdPartyRedirectAds.vb @@ -0,0 +1,143 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example retrieves all third party redirect ads given an existing + ''' ad group. To add ads to an existing ad group, run + ''' AddThirdPartyRedirectAd.vb. + ''' + ''' Tags: AdGroupAdService.get + ''' + Public Class GetThirdPartyRedirectAds + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetThirdPartyRedirectAds + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves all third party redirect ads given an existing ad " & _ + "group. To add third party redirect ads to an existing ad group, run " & _ + "AddThirdPartyRedirectAd.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group from which text ads are + ''' retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201406.AdGroupAdService) + + ' Create a selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "Status", "Url", "DisplayUrl", "RichMediaAdSnippet"} + + ' Set the sort order. + Dim orderBy As New OrderBy + orderBy.field = "Id" + orderBy.sortOrder = SortOrder.ASCENDING + selector.ordering = New OrderBy() {orderBy} + + ' Restrict the fetch to only the selected ad group id. + Dim adGroupPredicate As New Predicate + adGroupPredicate.field = "AdGroupId" + adGroupPredicate.operator = PredicateOperator.EQUALS + adGroupPredicate.values = New String() {adGroupId.ToString} + + ' Retrieve only third party redirect ads. + Dim typePredicate As New Predicate + typePredicate.field = "AdType" + typePredicate.operator = PredicateOperator.EQUALS + typePredicate.values = New String() {"THIRD_PARTY_REDIRECT_AD"} + + ' By default disabled ads aren't returned by the selector. To return them + ' include the DISABLED status in the statuses field. + Dim statusPredicate As New Predicate + statusPredicate.field = "Status" + statusPredicate.operator = PredicateOperator.IN + + statusPredicate.values = New String() {AdGroupAdStatus.ENABLED.ToString, _ + AdGroupAdStatus.PAUSED.ToString, AdGroupAdStatus.DISABLED.ToString} + + selector.predicates = New Predicate() {adGroupPredicate, statusPredicate, typePredicate} + + ' Select the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupAdPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the third party redirect ads. + page = service.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each adGroupAd As AdGroupAd In page.entries + Dim thirdPartyRedirectAd As ThirdPartyRedirectAd = adGroupAd.ad + Console.WriteLine("{0}) Ad id is {1} and status is {2}", i, thirdPartyRedirectAd.id, _ + adGroupAd.status) + Console.WriteLine(" Url: {0}\n Display Url: {1}\n Snippet:{2}", _ + thirdPartyRedirectAd.url, thirdPartyRedirectAd.displayUrl, _ + thirdPartyRedirectAd.snippet) + Next + i += 1 + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of third party redirect ads found: {0}", page.totalNumEntries) + Catch ex As Exception + Console.WriteLine("Failed to get third party redirect ads. Exception says ""{0}""", _ + ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/BasicOperations/PauseAd.vb b/examples/AdXBuyer/Vb/v201406/BasicOperations/PauseAd.vb new file mode 100644 index 00000000000..2f419e2398e --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/BasicOperations/PauseAd.vb @@ -0,0 +1,102 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example pauses a given ad. To list all ads, run GetTextAds.cs. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class PauseAd + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New PauseAd + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim adId As Long = Long.Parse("INSERT_AD_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, adId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example pauses a given ad. To list all ads, run GetTextAds.cs." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the ad. + ''' + ''' Id of the ad to be paused. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal adId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201406.AdGroupAdService) + + Dim status As AdGroupAdStatus = AdGroupAdStatus.PAUSED + + ' Create the ad group ad. + Dim adGroupAd As New AdGroupAd + adGroupAd.status = status + adGroupAd.adGroupId = adGroupId + + adGroupAd.ad = New Ad + adGroupAd.ad.id = adId + + ' Create the operation. + Dim adGroupAdOperation As New AdGroupAdOperation + adGroupAdOperation.operator = [Operator].SET + adGroupAdOperation.operand = adGroupAd + + Try + ' Update the ad. + Dim retVal As AdGroupAdReturnValue = service.mutate( _ + New AdGroupAdOperation() {adGroupAdOperation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim pausedAdGroupAd As AdGroupAd = retVal.value(0) + Console.WriteLine("Ad with id ""{0}"" was paused.", pausedAdGroupAd.ad.id) + Else + Console.WriteLine("No ads were paused.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to pause ad.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/BasicOperations/RemoveAd.vb b/examples/AdXBuyer/Vb/v201406/BasicOperations/RemoveAd.vb new file mode 100644 index 00000000000..de3811f65b5 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/BasicOperations/RemoveAd.vb @@ -0,0 +1,105 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example removes an ad using the 'REMOVE' operator. To list ads, + ''' run GetTextAds.vb. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class RemoveAd + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New RemoveAd + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim adId As Long = Long.Parse("INSERT_AD_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, adId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example removes an ad using the 'REMOVE' operator. To list ads, " & _ + "run GetTextAds.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the ad. + ''' Id of the ad being removed. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal adId As Long) + ' Get the AdGroupAdService. + Dim adGroupAdService As AdGroupAdService = user.GetService( _ + AdWordsService.v201406.AdGroupAdService) + + ' Since we do not need to update any ad-specific fields, it is enough to + ' create the base type. + Dim ad As New Ad + ad.id = adId + + ' Create the ad group ad. + Dim adGroupAd As New AdGroupAd + adGroupAd.adGroupId = adGroupId + + adGroupAd.ad = ad + + ' Create the operation. + Dim operation As New AdGroupAdOperation + operation.operand = adGroupAd + operation.operator = [Operator].REMOVE + + Try + ' Remove the ad. + Dim retVal As AdGroupAdReturnValue = adGroupAdService.mutate( _ + New AdGroupAdOperation() {operation}) + + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim removedAdGroupAd As AdGroupAd = retVal.value(0) + Console.WriteLine("Ad with id = ""{0}"" and type = ""{1}"" was removed.", _ + removedAdGroupAd.ad.id, removedAdGroupAd.ad.AdType) + Else + Console.WriteLine("No ads were removed.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to remove ad.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/BasicOperations/RemoveAdGroup.vb b/examples/AdXBuyer/Vb/v201406/BasicOperations/RemoveAdGroup.vb new file mode 100644 index 00000000000..934b4c96e76 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/BasicOperations/RemoveAdGroup.vb @@ -0,0 +1,101 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example removes an ad group by setting the status to 'REMOVED'. + ''' To get ad groups, run GetAdGroups.vb. + ''' + ''' Tags: AdGroupService.mutate + ''' + Public Class RemoveAdGroup + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New RemoveAdGroup + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example removes an ad group by setting the status to 'REMOVED'. " & _ + "To get ad groups, run GetAdGroups.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to be removed. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService(AdWordsService.v201406.AdGroupService) + + ' Create ad group with REMOVED status. + Dim adGroup As New AdGroup + adGroup.id = adGroupId + + ' When removing an ad group, rename it to avoid name collisions with new + ' ad groups. + adGroup.name = "Removed AdGroup - " + ExampleUtilities.GetRandomString + adGroup.status = AdGroupStatus.REMOVED + + ' Create the operation. + Dim operation As New AdGroupOperation + operation.operand = adGroup + operation.operator = [Operator].SET + + Try + ' Remove the ad group. + Dim retVal As AdGroupReturnValue = adGroupService.mutate( _ + New AdGroupOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim removedAdGroup As AdGroup = retVal.value(0) + Console.WriteLine("Ad group with id = ""{0}"" was renamed to ""{1}"" and removed.", _ + removedAdGroup.id, removedAdGroup.name) + Else + Console.WriteLine("No ad groups were removed.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to remove ad groups.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/BasicOperations/RemoveCampaign.vb b/examples/AdXBuyer/Vb/v201406/BasicOperations/RemoveCampaign.vb new file mode 100644 index 00000000000..cb4c0275337 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/BasicOperations/RemoveCampaign.vb @@ -0,0 +1,102 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example removes a campaign by setting the status to 'REMOVED'. + ''' To get campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignService.mutate + ''' + Public Class RemoveCampaign + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New RemoveCampaign + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example removes a campaign by setting the status to 'REMOVED'. To " & _ + "get campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to be removed. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201406.CampaignService) + + ' Create campaign with REMOVED status. + Dim campaign As New Campaign + campaign.id = campaignId + + ' When removing a campaign, rename it to avoid name collisions with new + ' campaigns. + campaign.name = "Removed Campaign - " + ExampleUtilities.GetRandomString + campaign.status = CampaignStatus.REMOVED + + ' Create the operation. + Dim operation As New CampaignOperation + operation.operand = campaign + operation.operator = [Operator].SET + + Try + ' Remove the campaign. + Dim retVal As CampaignReturnValue = campaignService.mutate( _ + New CampaignOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim removedCampaign As Campaign = retVal.value(0) + Console.WriteLine("Campaign with id = ""{0}"" was renamed to ""{1}"" and removed.", _ + removedCampaign.id, removedCampaign.name) + Else + Console.WriteLine("No campaigns were removed.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to remove campaigns.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/BasicOperations/RemovePlacement.vb b/examples/AdXBuyer/Vb/v201406/BasicOperations/RemovePlacement.vb new file mode 100644 index 00000000000..cbb013b7b51 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/BasicOperations/RemovePlacement.vb @@ -0,0 +1,106 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example deletes a placement using the 'REMOVE' operator. To get + ''' placements, run GetPlacements.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class RemovePlacement + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New RemovePlacement + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim placementId As Long = Long.Parse("INSERT_PLACEMENT_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, placementId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example deletes a placement using the 'REMOVE' operator. To get " & _ + "placements, run GetPlacements.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the keyword. + ''' + ''' Id of the placement to be deleted. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal placementId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201406.AdGroupCriterionService) + + ' Create base class criterion to avoid setting placement-specific + ' fields. + Dim criterion As New Criterion + criterion.id = placementId + + ' Create the ad group criterion. + Dim adGroupCriterion As New BiddableAdGroupCriterion + adGroupCriterion.adGroupId = adGroupId + adGroupCriterion.criterion = criterion + + ' Create the operation. + Dim operation As New AdGroupCriterionOperation + operation.operand = adGroupCriterion + operation.operator = [Operator].REMOVE + + Try + ' Delete the placement. + Dim retVal As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + New AdGroupCriterionOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim deletedPlacement As AdGroupCriterion = retVal.value(0) + Console.WriteLine("Placement with ad group id = ""{0}"" and id = ""{1}"" was " & _ + "deleted.", deletedPlacement.adGroupId, deletedPlacement.criterion.id) + Else + Console.WriteLine("No placement was deleted.") + End If + Catch ex As Exception + Console.WriteLine("Failed to delete placement. Exception says ""{0}""", ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/BasicOperations/UpdateAdGroup.vb b/examples/AdXBuyer/Vb/v201406/BasicOperations/UpdateAdGroup.vb new file mode 100644 index 00000000000..60c25879f70 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/BasicOperations/UpdateAdGroup.vb @@ -0,0 +1,96 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example illustrates how to update an ad group, setting its + ''' status to 'PAUSED'. To create an ad group, run AddAdGroup.vb. + ''' + ''' Tags: AdGroupService.mutate + ''' + Public Class UpdateAdGroup + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UpdateAdGroup + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to update an ad group, setting its status " & _ + "to 'PAUSED'. To create an ad group, run AddAdGroup.vb" + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to be updated. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupService. + Dim adGroupService As AdGroupService = user.GetService(AdWordsService.v201406.AdGroupService) + + ' Create the ad group. + Dim adGroup As New AdGroup + adGroup.status = AdGroupStatus.PAUSED + adGroup.id = adGroupId + + ' Create the operation. + Dim operation As New AdGroupOperation + operation.operator = [Operator].SET + operation.operand = adGroup + + Try + ' Update the ad group. + Dim retVal As AdGroupReturnValue = adGroupService.mutate(New AdGroupOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim pausedAdGroup As AdGroup = retVal.value(0) + Console.WriteLine("Ad group with id = '{0}' was successfully updated.", _ + pausedAdGroup.id) + Else + Console.WriteLine("No ad groups were updated.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to update ad groups.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/BasicOperations/UpdateCampaign.vb b/examples/AdXBuyer/Vb/v201406/BasicOperations/UpdateCampaign.vb new file mode 100644 index 00000000000..c42016d8b02 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/BasicOperations/UpdateCampaign.vb @@ -0,0 +1,97 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example updates a campaign. To get campaigns, run + ''' GetCampaigns.vb. + ''' + ''' Tags: CampaignService.mutate + ''' + Public Class UpdateCampaign + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UpdateCampaign + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example updates a campaign. To get campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to be updated. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignService. + Dim campaignService As CampaignService = user.GetService( _ + AdWordsService.v201406.CampaignService) + + ' Create campaign with updated budget. + Dim campaign As New Campaign + campaign.id = campaignId + campaign.status = CampaignStatus.PAUSED + + ' Create the operations. + Dim operation As New CampaignOperation + operation.operator = [Operator].SET + operation.operand = campaign + + Try + ' Update the campaign. + Dim retVal As CampaignReturnValue = campaignService.mutate( _ + New CampaignOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim updatedCampaign As Campaign = retVal.value(0) + Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was updated.", _ + updatedCampaign.name, updatedCampaign.id) + Else + Console.WriteLine("No campaigns were updated.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to update campaigns.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/BasicOperations/UpdatePlacement.vb b/examples/AdXBuyer/Vb/v201406/BasicOperations/UpdatePlacement.vb new file mode 100644 index 00000000000..61c7cd479c6 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/BasicOperations/UpdatePlacement.vb @@ -0,0 +1,123 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example updates the bid of a placement. To get placement, run + ''' GetPlacements.vb. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class UpdatePlacement + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UpdatePlacement + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + Dim placementId As Long = Long.Parse("INSERT_PLACEMENT_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId, placementId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example updates the bid of a placement. To get placement, run " & _ + "GetPlacements.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group that contains the keyword. + ''' + ''' Id of the placement to be updated. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long, ByVal placementId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201402.AdGroupCriterionService) + + ' Since we are not updating any placement-specific fields, it is enough to + ' create a criterion object. + Dim criterion As New Criterion + criterion.id = placementId + + ' Create ad group criterion. + Dim biddableAdGroupCriterion As New BiddableAdGroupCriterion + biddableAdGroupCriterion.adGroupId = adGroupId + biddableAdGroupCriterion.criterion = criterion + + ' Create the bids. + Dim biddingConfig As New BiddingStrategyConfiguration() + Dim cpmBid As New CpmBid() + cpmBid.bid = New Money() + cpmBid.bid.microAmount = 1000000 + biddingConfig.bids = New Bids() {cpmBid} + + biddableAdGroupCriterion.biddingStrategyConfiguration = biddingConfig + + ' Create the operation. + Dim operation As New AdGroupCriterionOperation + operation.operator = [Operator].SET + operation.operand = biddableAdGroupCriterion + + Try + ' Update the placement. + Dim retVal As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + New AdGroupCriterionOperation() {operation}) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) AndAlso _ + (retVal.value.Length > 0)) Then + Dim adGroupCriterion As BiddableAdGroupCriterion = retVal.value(0) + Dim bidAmount As Long = 0L + For Each bids As Bids In adGroupCriterion.biddingStrategyConfiguration.bids + If TypeOf bids Is CpmBid Then + bidAmount = TryCast(bids, CpmBid).bid.microAmount + End If + Next + + Console.WriteLine("Placement with ad group id = '{0}', id = '{1}' was updated with " & _ + "bid amount = '{2}' micros.", adGroupCriterion.adGroupId, _ + adGroupCriterion.criterion.id, bidAmount) + Else + Console.WriteLine("No placements were updated.") + End If + Catch ex As Exception + Console.WriteLine("Failed to update placement. Exception says ""{0}""", ex.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/CampaignManagement/AddPlacementsInBulk.vb b/examples/AdXBuyer/Vb/v201406/CampaignManagement/AddPlacementsInBulk.vb new file mode 100644 index 00000000000..9435cd25758 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/CampaignManagement/AddPlacementsInBulk.vb @@ -0,0 +1,185 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Text.RegularExpressions +Imports System.Threading + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example shows how to add placements in bulk using the + ''' MutateJobService. + ''' + ''' Tags: MutateJobService.mutate, MutateJobService.get + ''' Tags: MutateJobService.getResult + ''' + Public Class AddPlacementsInBulk + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddPlacementsInBulk + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example shows how to add placements in bulk using the MutateJobService." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad groups to which placements are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the MutateJobService. + Dim mutateJobService As MutateJobService = user.GetService( _ + AdWordsService.v201406.MutateJobService) + + Const RETRY_INTERVAL As Integer = 30 + Const RETRIES_COUNT As Integer = 30 + Const PLACEMENT_NUMBER As Integer = 100 + Const INDEX_REGEX As String = "operations\[(\d+)\].operand" + + Dim operations As New List(Of Operation) + + ' Create AdGroupCriterionOperation to add placements. + For i As Integer = 0 To PLACEMENT_NUMBER + Dim placement As New Placement + placement.url = ("http://mars.google.com/" & i.ToString) + + Dim criterion As New BiddableAdGroupCriterion + criterion.adGroupId = adGroupId + criterion.criterion = placement + + Dim adGroupCriterionOperation As New AdGroupCriterionOperation + adGroupCriterionOperation.operator = [Operator].ADD + adGroupCriterionOperation.operand = criterion + + operations.Add(adGroupCriterionOperation) + Next i + + Dim policy As New BulkMutateJobPolicy + ' You can specify up to 3 job IDs that must successfully complete before + ' this job can be processed. + policy.prerequisiteJobIds = New Long() {} + + Dim job As SimpleMutateJob = mutateJobService.mutate(operations.ToArray, policy) + + ' Wait for the job to complete. + Dim completed As Boolean = False + Dim retryCount As Integer = 0 + Console.WriteLine("Retrieving job status...") + + While (completed = False AndAlso retryCount < RETRIES_COUNT) + Dim selector As New BulkMutateJobSelector + selector.jobIds = New Long() {job.id} + + Try + Dim allJobs As Job() = mutateJobService.get(selector) + If ((Not allJobs Is Nothing) AndAlso (allJobs.Length > 0)) Then + job = allJobs(0) + If ((job.status = BasicJobStatus.COMPLETED) OrElse _ + (job.status = BasicJobStatus.FAILED)) Then + completed = True + Exit While + Else + Console.WriteLine("{0}: Current status is {1}, waiting {2} seconds to retry...", _ + retryCount, job.status, RETRY_INTERVAL) + Thread.Sleep(RETRY_INTERVAL * 1000) + retryCount = retryCount + 1 + End If + End If + Catch ex As Exception + Console.WriteLine("Failed to fetch simple mutate job with id = {0}. Exception " & _ + "says ""{1}"".", job.id, ex.Message) + Return + End Try + End While + + If (job.status = BasicJobStatus.COMPLETED) Then + ' Handle cases where the job completed. + + ' Create the job selector. + Dim selector As New BulkMutateJobSelector + selector.jobIds = New Long() {job.id} + + ' Get the job results. + Dim jobResult As JobResult = mutateJobService.getResult(selector) + If Not jobResult Is Nothing Then + Dim results As SimpleMutateResult = jobResult.Item + If Not results Is Nothing Then + 'Display the results. + If Not results.results Is Nothing Then + For i As Integer = 0 To results.results.Length - 1 + Dim operand As Operand = results.results(i) + Dim status As String + If TypeOf operand.Item Is PlaceHolder Then + status = "FAILED" + Else + status = "SUCCEEDED" + End If + Console.WriteLine("Operation {0} - {1}", i, status) + Next i + End If + + ' Display the errors. + If Not results.errors Is Nothing Then + For Each apiError As ApiError In results.errors + Dim match As Match = Regex.Match(apiError.fieldPath, INDEX_REGEX, _ + RegexOptions.IgnoreCase) + Dim index As String = "???" + If (match.Success) Then + index = match.Groups(1).Value + End If + Console.WriteLine("Operation index {0} failed due to reason: '{1}', " & _ + "trigger: '{2}'", index, apiError.errorString, apiError.trigger) + Next + End If + End If + End If + Console.WriteLine("Job completed successfully!") + ElseIf (job.status = BasicJobStatus.FAILED) Then + ' Handle the cases where job failed. + Console.WriteLine("Job failed with reason: " & job.failureReason.ToString()) + ElseIf (job.status = BasicJobStatus.PROCESSING OrElse job.status = BasicJobStatus.PENDING) _ + Then + ' Handle the cases where job didn't complete after wait period. + Console.WriteLine("Job did not complete in {0} secconds.", RETRY_INTERVAL * RETRIES_COUNT) + End If + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/CampaignManagement/GetAllDisapprovedAds.vb b/examples/AdXBuyer/Vb/v201406/CampaignManagement/GetAllDisapprovedAds.vb new file mode 100644 index 00000000000..8ffbecc6a66 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/CampaignManagement/GetAllDisapprovedAds.vb @@ -0,0 +1,121 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example retrieves all the disapproved ads in a given campaign. + ''' + ''' Tags: AdGroupAdService.get + ''' + Public Class GetAllDisapprovedAds + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAllDisapprovedAds + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves all the disapproved ads in a given campaign." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which disapproved ads + ''' are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201406.AdGroupAdService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "AdGroupCreativeApprovalStatus", _ + "AdGroupAdDisapprovalReasons"} + + ' Set the filters. + Dim campaignPredicate As New Predicate + campaignPredicate.operator = PredicateOperator.EQUALS + campaignPredicate.field = "CampaignId" + campaignPredicate.values = New String() {campaignId.ToString} + + Dim approvalPredicate As New Predicate + approvalPredicate.operator = PredicateOperator.EQUALS + approvalPredicate.field = "AdGroupCreativeApprovalStatus" + approvalPredicate.values = New String() {AdGroupAdApprovalStatus.DISAPPROVED.ToString()} + + selector.predicates = New Predicate() {campaignPredicate, approvalPredicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New AdGroupAdPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get the disapproved ads. + page = service.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each adGroupAd As AdGroupAd In page.entries + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " & _ + "reason(s):", i, adGroupAd.ad.id) + For Each reason As String In adGroupAd.disapprovalReasons + Console.WriteLine(" {0}", reason) + Next + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get disapproved ads.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb b/examples/AdXBuyer/Vb/v201406/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb new file mode 100644 index 00000000000..f0afebc0a75 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/CampaignManagement/GetAllDisapprovedAdsWithAwql.vb @@ -0,0 +1,111 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example retrieves all the disapproved ads in a given campaign + ''' using an AWQL query. See + ''' https://developers.google.com/adwords/api/docs/guides/awql for AWQL + ''' documentation. + ''' + ''' Tags: AdGroupAdService.get + ''' + Public Class GetAllDisapprovedAdsWithAwql + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAllDisapprovedAdsWithAwql + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves all the disapproved ads in a given campaign using " & _ + "an AWQL query. See https://developers.google.com/adwords/api/docs/guides/awql for " & _ + "AWQL documentation." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign for which disapproved ads + ''' are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService(AdWordsService.v201406.AdGroupAdService) + + ' Get all the disapproved ads for this campaign. + Dim query As String = String.Format("SELECT Id, AdGroupAdDisapprovalReasons WHERE " & _ + "CampaignId = {0} AND AdGroupCreativeApprovalStatus = DISAPPROVED ORDER BY Id", _ + campaignId) + + Dim offset As Long = 0 + Dim pageSize As Long = 500 + + Dim page As New AdGroupAdPage() + + Try + Do + Dim queryWithPaging As String = String.Format("{0} LIMIT {1}, {2}", query, offset, _ + pageSize) + + ' Get the disapproved ads. + page = service.query(queryWithPaging) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each adGroupAd As AdGroupAd In page.entries + Console.WriteLine("{0}) Ad id {1} has been disapproved for the following " & _ + "reason(s):", i, adGroupAd.ad.id) + For Each reason As String In adGroupAd.disapprovalReasons + Console.WriteLine(" {0}", reason) + Next + i = i + 1 + Next + End If + + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of disapproved ads found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get disapproved ads.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/ErrorHandling/HandlePartialFailures.vb b/examples/AdXBuyer/Vb/v201406/ErrorHandling/HandlePartialFailures.vb new file mode 100644 index 00000000000..879af3f68b9 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/ErrorHandling/HandlePartialFailures.vb @@ -0,0 +1,136 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example demonstrates how to handle partial failures. + ''' + ''' Tags: AdGroupCriterionService.mutate + ''' + Public Class HandlePartialFailures + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandlePartialFailures + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example demonstrates how to handle partial failures." + End Get + End Property + + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which placements are + ''' added. + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupCriterionService. + Dim adGroupCriterionService As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201406.AdGroupCriterionService) + + ' Set partial failure mode for the service. + adGroupCriterionService.RequestHeader.partialFailure = True + + Dim operations As New List(Of AdGroupCriterionOperation) + + ' Create the placements. + Dim urls As String() = New String() {"http://mars.google.com", "http:/mars.google.com", _ + "mars.google.com"} + For Each url As String In urls + Dim placement As New Placement + placement.url = url + + ' Create biddable ad group criterion. + Dim placementBiddableAdGroupCriterion As New BiddableAdGroupCriterion + placementBiddableAdGroupCriterion.adGroupId = adGroupId + placementBiddableAdGroupCriterion.criterion = placement + + ' Create the operation. + Dim placementAdGroupCriterionOperation As New AdGroupCriterionOperation + placementAdGroupCriterionOperation.operand = placementBiddableAdGroupCriterion + placementAdGroupCriterionOperation.operator = [Operator].ADD + operations.Add(placementAdGroupCriterionOperation) + Next + + Try + ' Create the placements. + Dim result As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( _ + operations.ToArray) + + ' Display the results. + If ((Not result Is Nothing) AndAlso (Not result.value Is Nothing)) Then + For Each adGroupCriterionResult As AdGroupCriterion In result.value + If (Not adGroupCriterionResult.criterion Is Nothing) Then + Console.WriteLine("Placement with ad group id '{0}', criterion id " & _ + "'{1}', and url '{2}' was added.\n", adGroupCriterionResult.adGroupId, _ + adGroupCriterionResult.criterion.id, _ + DirectCast(adGroupCriterionResult.criterion, Placement).url) + End If + Next + Else + Console.WriteLine("No placements were added.") + End If + + ' Display the partial failure errors. + If ((Not result Is Nothing) AndAlso (Not result.partialFailureErrors Is Nothing)) Then + For Each apiError As ApiError In result.partialFailureErrors + Dim operationIndex As Integer = ErrorUtilities.GetOperationIndex(apiError.fieldPath) + If (operationIndex <> -1) Then + Dim adGroupCriterion As AdGroupCriterion = operations(operationIndex).operand + Console.WriteLine("Placement with ad group id '{0}' and url '{1}' " & _ + "triggered a failure for the following reason: '{2}'.\n", _ + adGroupCriterion.adGroupId, _ + DirectCast(adGroupCriterion.criterion, Placement).url, _ + apiError.errorString) + Else + Console.WriteLine("A failure for the following reason: '{0}' has occurred.\n", _ + apiError.errorString) + End If + Next + End If + Catch e As Exception + Console.WriteLine("Failed to add placement(s) in partial failure mode. Exception " & _ + "says '{0}'", e.Message) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/ErrorHandling/HandlePolicyViolationError.vb b/examples/AdXBuyer/Vb/v201406/ErrorHandling/HandlePolicyViolationError.vb new file mode 100644 index 00000000000..b649d482e41 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/ErrorHandling/HandlePolicyViolationError.vb @@ -0,0 +1,184 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds a text ad, and shows how to handle a policy + ''' violation. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class HandlePolicyViolationError + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandlePolicyViolationError + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds a text ad, and shows how to handle a policy violation." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which ads are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + ' Get the AdGroupAdService. + Dim service As AdGroupAdService = user.GetService( _ + AdWordsService.v201406.AdGroupAdService) + + ' Create a third party redirect ad that violates a policy. + ' Create the third party redirect ad. + Dim redirectAd As New ThirdPartyRedirectAd + redirectAd.name = String.Format("Policy violation demo ad ", ExampleUtilities.GetRandomString) + redirectAd.url = "gopher://gopher.google.com" + + redirectAd.dimensions = New Dimensions + redirectAd.dimensions.height = 250 + redirectAd.dimensions.width = 300 + + redirectAd.snippet = "" + redirectAd.impressionBeaconUrl = "http://www.examples.com/beacon" + redirectAd.certifiedVendorFormatId = 119 + redirectAd.isCookieTargeted = False + redirectAd.isUserInterestTargeted = False + redirectAd.isTagged = False + + Dim redirectAdGroupAd As New AdGroupAd + redirectAdGroupAd.adGroupId = adGroupId + redirectAdGroupAd.ad = redirectAd + + ' Create the operations. + Dim redirectAdOperation As New AdGroupAdOperation + redirectAdOperation.operator = [Operator].ADD + redirectAdOperation.operand = redirectAdGroupAd + + Try + Dim retVal As AdGroupAdReturnValue = Nothing + + ' Setup two arrays, one to hold the list of all operations to be + ' validated, and another to hold the list of operations that cannot be + ' fixed after validation. + Dim allOperations As New List(Of AdGroupAdOperation) + Dim operationsToBeRemoved As New List(Of AdGroupAdOperation) + + allOperations.Add(redirectAdOperation) + + Try + ' Validate the operations. + service.RequestHeader.validateOnly = True + retVal = service.mutate(allOperations.ToArray) + Catch ex As AdWordsApiException + Dim innerException As ApiException = TryCast(ex.ApiException, ApiException) + If (innerException Is Nothing) Then + Throw New Exception("Failed to retrieve ApiError. See inner exception for more " & _ + "details.", ex) + End If + + ' Examine each ApiError received from the server. + For Each apiError As ApiError In innerException.errors + Dim index As Integer = ErrorUtilities.GetOperationIndex(apiError.fieldPath) + If (index = -1) Then + ' This API error is not associated with an operand, so we cannot + ' recover from this error by removing one or more operations. + ' Rethrow the exception for manual inspection. + Throw + End If + + ' Handle policy violation errors. + If TypeOf apiError Is PolicyViolationError Then + Dim policyError As PolicyViolationError = apiError + + If policyError.isExemptable Then + ' If the policy violation error is exemptable, add an exemption + ' request. + Dim exemptionRequests As New List(Of ExemptionRequest) + If (Not allOperations.Item(index).exemptionRequests Is Nothing) Then + exemptionRequests.AddRange(allOperations.Item(index).exemptionRequests) + End If + + Dim exemptionRequest As New ExemptionRequest + exemptionRequest.key = policyError.key + exemptionRequests.Add(exemptionRequest) + allOperations.Item(index).exemptionRequests = exemptionRequests.ToArray + Else + ' Policy violation error is not exemptable, remove this + ' operation from the list of operations. + operationsToBeRemoved.Add(allOperations.Item(index)) + End If + Else + ' This is not a policy violation error, remove this operation + ' from the list of operations. + operationsToBeRemoved.Add(allOperations.Item(index)) + End If + Next + + ' Remove all operations that aren't exemptable. + For Each operation As AdGroupAdOperation In operationsToBeRemoved + allOperations.Remove(operation) + Next + End Try + If (allOperations.Count > 0) Then + ' Perform the operations exemptible of a policy violation. + service.RequestHeader.validateOnly = False + retVal = service.mutate(allOperations.ToArray) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing) _ + AndAlso (retVal.value.Length > 0)) Then + For Each newAdGroupAd As AdGroupAd In retVal.value + Console.WriteLine("New ad with id = ""{0}"" and displayUrl = ""{1}"" was created.", _ + newAdGroupAd.ad.id, newAdGroupAd.ad.displayUrl) + Next + Else + Console.WriteLine("No ads were created.") + End If + Else + Console.WriteLine("There are no ads to create after policy violation checks.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to create Ad(s).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/ErrorHandling/HandleRateExceededError.vb b/examples/AdXBuyer/Vb/v201406/ErrorHandling/HandleRateExceededError.vb new file mode 100644 index 00000000000..06be1ff6f03 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/ErrorHandling/HandleRateExceededError.vb @@ -0,0 +1,206 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO +Imports System.Net +Imports System.Threading + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example shows how to handle RateExceededError in your + ''' application. To trigger the rate exceeded error, this code example runs + ''' 100 threads in parallel, each thread attempting to validate 100 keywords + ''' in a single request. Note that spawning 100 parallel threads is for + ''' illustrative purposes only, you shouldn't do this in your application. + ''' + ''' Tags: AdGroupAdService.mutate + ''' + Public Class HandleRateExceededError + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New HandleRateExceededError + Console.WriteLine(codeExample.Description) + Try + Dim adGroupId As Long = Long.Parse("INSERT_ADGROUP_ID_HERE") + codeExample.Run(New AdWordsUser, adGroupId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example shows how to handle RateExceededError in your application. " & _ + "To trigger the rate exceeded error, this code example runs 100 threads in " & _ + "parallel, each thread attempting to validate 100 keywords in a single request. " & _ + "Note that spawning 100 parallel threads is for illustrative purposes only, you " & _ + "shouldn't do this in your application." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the ad group to which keywords are added. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal adGroupId As Long) + Const NUM_THREADS As Integer = 100 + + ' Increase the maximum number of parallel HTTP connections that .NET + ' framework allows. By default, this is set to 2 by the .NET framework. + ServicePointManager.DefaultConnectionLimit = NUM_THREADS + + Dim threads As New List(Of Thread) + + For i As Integer = 0 To NUM_THREADS + Dim thread As New Thread(AddressOf New KeywordThread(user, i, adGroupId).Run) + threads.Add(thread) + Next i + + For i As Integer = 0 To threads.Count - 1 + threads.Item(i).Start(i) + Next i + + For i As Integer = 0 To threads.Count - 1 + threads.Item(i).Join() + Next i + End Sub + + ''' + ''' Thread class for validating keywords. + ''' + Public Class KeywordThread + ''' + ''' Index of this thread, for identifying and debugging. + ''' + Dim threadIndex As Integer + + ''' + ''' The ad group id to which keywords are added. + ''' + Dim adGroupId As Long + + ''' + ''' The AdWords user who owns this ad group. + ''' + Dim user As AdWordsUser + + ''' + ''' Number of keywords to be validated in each API call. + ''' + Const NUM_KEYWORDS As Integer = 100 + + ''' + ''' Initializes a new instance of the class. + ''' + ''' Index of the thread. + ''' The ad group id. + ''' The AdWords user who owns the ad group. + Public Sub New(ByVal user As AdWordsUser, ByVal threadIndex As Integer, _ + ByVal adGroupId As Long) + Me.user = user + Me.threadIndex = threadIndex + Me.adGroupId = adGroupId + End Sub + + ''' + ''' Main method for the thread. + ''' + ''' The thread parameter. + Public Sub Run(ByVal obj As Object) + ' Create the operations. + Dim operations As New List(Of AdGroupCriterionOperation) + For j As Integer = 0 To NUM_KEYWORDS + ' Create the keyword. + Dim keyword As New Keyword + keyword.text = "mars cruise thread " & threadIndex.ToString & " seed " & j.ToString + keyword.matchType = KeywordMatchType.BROAD + + ' Create the biddable ad group criterion. + Dim keywordCriterion As AdGroupCriterion = New BiddableAdGroupCriterion + keywordCriterion.adGroupId = adGroupId + keywordCriterion.criterion = keyword + + ' Create the operations. + Dim keywordOperation As New AdGroupCriterionOperation + keywordOperation.operator = [Operator].ADD + keywordOperation.operand = keywordCriterion + + operations.Add(keywordOperation) + Next j + + ' Get the AdGroupCriterionService. This should be done within the + ' thread, since a service can only handle one outgoing HTTP request + ' at a time. + Dim service As AdGroupCriterionService = user.GetService( _ + AdWordsService.v201406.AdGroupCriterionService) + service.RequestHeader.validateOnly = True + Dim retryCount As Integer = 0 + Const NUM_RETRIES As Integer = 3 + Try + While (retryCount < NUM_RETRIES) + Try + ' Validate the keywords. + Dim retval As AdGroupCriterionReturnValue = service.mutate(operations.ToArray) + Exit While + Catch ex As AdWordsApiException + ' Handle API errors. + Dim innerException As ApiException = TryCast(ex.ApiException, ApiException) + If (innerException Is Nothing) Then + Throw New Exception("Failed to retrieve ApiError. See inner exception for more " & _ + "details.", ex) + End If + For Each apiError As ApiError In innerException.errors + If Not TypeOf apiError Is RateExceededError Then + ' Rethrow any errors other than RateExceededError. + Throw + End If + ' Handle rate exceeded errors. + Dim rateExceededError As RateExceededError = DirectCast(apiError, RateExceededError) + Console.WriteLine("Got Rate exceeded error - rate name = '{0}', scope = '{1}', " & _ + "retry After {2} seconds.", rateExceededError.rateScope, _ + rateExceededError.rateName, rateExceededError.retryAfterSeconds) + Thread.Sleep(rateExceededError.retryAfterSeconds) + retryCount = retryCount + 1 + Next + Finally + If (retryCount = NUM_RETRIES) Then + Throw New Exception(String.Format("Could not recover after making {0} attempts.", _ + retryCount)) + End If + End Try + End While + Catch ex As Exception + Throw New System.ApplicationException("Failed to validate keywords.", ex) + End Try + End Sub + End Class + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/Miscellaneous/GetAllVideosAndImages.vb b/examples/AdXBuyer/Vb/v201406/Miscellaneous/GetAllVideosAndImages.vb new file mode 100644 index 00000000000..9ba9490f833 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/Miscellaneous/GetAllVideosAndImages.vb @@ -0,0 +1,139 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example gets all videos and images. To upload video, see + ''' http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. + ''' To upload image, run UploadImage.vb. + ''' + ''' Tags: MediaService.get + ''' + Public Class GetAllVideosAndImages + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetAllVideosAndImages + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all videos and images. To upload video, see " & _ + "http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. To " & _ + "upload image, run UploadImage.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the MediaService. + Dim mediaService As MediaService = user.GetService(AdWordsService.v201406.MediaService) + + ' Create the video selector. + Dim selector As New Selector + selector.fields = New String() {"MediaId", "Width", "Height", "MimeType"} + + ' Set the filter. + Dim predicate As New Predicate + predicate.operator = PredicateOperator.IN + predicate.field = "Type" + predicate.values = New String() {MediaMediaType.VIDEO.ToString(), _ + MediaMediaType.IMAGE.ToString()} + + selector.predicates = New Predicate() {predicate} + + ' Select selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New MediaPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + page = mediaService.get(selector) + + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each media As Media In page.entries + If TypeOf media Is Video Then + Dim video As Video = media + Console.WriteLine("{0}) Video with id '{1}' and name '{2}' was found.", _ + i, video.mediaId, video.name) + ElseIf TypeOf media Is Image Then + Dim image As Image = media + Dim dimensions As Dictionary(Of MediaSize, Dimensions) = _ + CreateMediaDimensionMap(image.dimensions) + Console.WriteLine("{0}) Image with id '{1}', dimensions '{2}x{3}', and MIME " & _ + "type '{4}' was found.", i, image.mediaId, dimensions(MediaSize.FULL).width, _ + dimensions(MediaSize.FULL).height, image.mimeType) + End If + i = i + 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of images and videos found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get images and videos.", ex) + End Try + End Sub + + ''' + ''' Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + ''' + ''' The array of Media_Size_DimensionsMapEntry to be + ''' converted into a dictionary. + ''' A dictionary with key as MediaSize, and value as Dimensions. + ''' + Private Function CreateMediaDimensionMap(ByVal dimensions As Media_Size_DimensionsMapEntry()) _ + As Dictionary(Of MediaSize, Dimensions) + Dim mediaMap As New Dictionary(Of MediaSize, Dimensions) + For Each dimension As Media_Size_DimensionsMapEntry In dimensions + mediaMap.Add(dimension.key, dimension.value) + Next + Return mediaMap + End Function + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/Miscellaneous/UploadImage.vb b/examples/AdXBuyer/Vb/v201406/Miscellaneous/UploadImage.vb new file mode 100644 index 00000000000..3e562a6a786 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/Miscellaneous/UploadImage.vb @@ -0,0 +1,107 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 +Imports Google.Api.Ads.Common.Util + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example uploads an image. To get images, run GetAllVideosAndImages.vb. + ''' + ''' Tags: MediaService.upload + ''' + Public Class UploadImage + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New UploadImage + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example uploads an image. To get images, run GetAllVideosAndImages.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the MediaService. + Dim mediaService As MediaService = user.GetService( _ + AdWordsService.v201406.MediaService) + + ' Create the image. + Dim image As New Image + image.data = MediaUtilities.GetAssetDataFromUrl("http://goo.gl/HJM3L") + image.type = MediaMediaType.IMAGE + + Try + ' Upload the image. + Dim result As Media() = mediaService.upload(New Media() {image}) + + ' Display the results. + If ((Not result Is Nothing) AndAlso (result.Length > 0)) Then + Dim newImage As Media = result(0) + Dim dimensions As Dictionary(Of MediaSize, Dimensions) = _ + CreateMediaDimensionMap(newImage.dimensions) + Console.WriteLine("Image with id '{0}', dimensions '{1}x{2}', and MIME type '{3}'" & _ + " was uploaded.", newImage.mediaId, dimensions.Item(MediaSize.FULL).width, _ + dimensions.Item(MediaSize.FULL).height, newImage.mimeType) + Else + Console.WriteLine("No images were uploaded.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to upload images.", ex) + End Try + End Sub + + ''' + ''' Converts an array of Media_Size_DimensionsMapEntry into a dictionary. + ''' + ''' The array of Media_Size_DimensionsMapEntry to + ''' be converted into a dictionary. + ''' A dictionary with key as MediaSize, and value as Dimensions. + ''' + Private Function CreateMediaDimensionMap(ByVal dimensions As Media_Size_DimensionsMapEntry()) _ + As Dictionary(Of MediaSize, Dimensions) + Dim mediaMap As New Dictionary(Of MediaSize, Dimensions) + For Each dimension As Media_Size_DimensionsMapEntry In dimensions + mediaMap.Add(dimension.key, dimension.value) + Next + Return mediaMap + End Function + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/Optimization/GetPlacementIdeas.vb b/examples/AdXBuyer/Vb/v201406/Optimization/GetPlacementIdeas.vb new file mode 100644 index 00000000000..267895900d3 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/Optimization/GetPlacementIdeas.vb @@ -0,0 +1,123 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example retrieves urls that have content keywords related to a + ''' given website. + ''' + ''' Tags: TargetingIdeaService.get + ''' + Public Class GetPlacementIdeas + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetPlacementIdeas + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example retrieves urls that have content keywords related to a " & _ + "given website." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the TargetingIdeaService. + Dim targetingIdeaService As TargetingIdeaService = user.GetService( _ + AdWordsService.v201406.TargetingIdeaService) + + ' Create seed url. + Dim url As String = "mars.google.com" + + ' Create the selector. + Dim selector As New TargetingIdeaSelector + selector.requestType = RequestType.IDEAS + selector.ideaType = IdeaType.PLACEMENT + selector.requestedAttributeTypes = New AttributeType() {AttributeType.CRITERION, _ + AttributeType.PLACEMENT_TYPE} + + ' Create related to url search parameter. + Dim relatedToUrlSearchParameter As New RelatedToUrlSearchParameter + relatedToUrlSearchParameter.urls = New String() {url} + relatedToUrlSearchParameter.includeSubUrls = False + selector.searchParameters = New SearchParameter() {relatedToUrlSearchParameter} + + ' Select selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New TargetingIdeaPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get placement ideas. + page = targetingIdeaService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + + For Each idea As TargetingIdea In page.entries + For Each entry As Type_AttributeMapEntry In idea.data + If (entry.key = AttributeType.CRITERION) Then + Dim placementAttribute As CriterionAttribute = entry.value + Dim placement As Placement = placementAttribute.value + Console.WriteLine("{0}) Related placement urls were found at '{1}'.", _ + i, placement.url) + End If + Next + Next + i += 1 + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of related placements found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve related placements.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/Remarketing/AddAudience.vb b/examples/AdXBuyer/Vb/v201406/Remarketing/AddAudience.vb new file mode 100644 index 00000000000..dc44e60870d --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/Remarketing/AddAudience.vb @@ -0,0 +1,154 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example illustrates how to create a user list a.k.a. audience. + ''' + ''' Tags: UserListService.mutate + ''' + Public Class AddAudience + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddAudience + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to create a user list a.k.a. audience." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the UserListService. + Dim userListService As AdwordsUserListService = user.GetService( _ + AdWordsService.v201406.AdwordsUserListService) + + ' Get the ConversionTrackerService. + Dim conversionTrackerService As ConversionTrackerService = user.GetService( _ + AdWordsService.v201406.ConversionTrackerService) + + Dim userList As New BasicUserList + + userList.name = ("Mars cruise customers #" & ExampleUtilities.GetRandomString) + userList.description = "A list of mars cruise customers in the last year." + userList.status = UserListMembershipStatus.OPEN + userList.membershipLifeSpan = 365 + + Dim conversionType As New UserListConversionType + conversionType.name = userList.name + userList.conversionTypes = New UserListConversionType() {conversionType} + + ' Optional: Set the user list status. + userList.status = UserListMembershipStatus.OPEN + + ' Create the operation. + Dim operation As New UserListOperation + operation.operand = userList + operation.operator = [Operator].ADD + + Try + ' Add the user list. + Dim retval As UserListReturnValue = userListService.mutate(New UserListOperation() _ + {operation}) + + Dim userLists As UserList() = Nothing + If ((Not retval Is Nothing) AndAlso (Not retval.value Is Nothing)) Then + userLists = retval.value + ' Get all conversion snippets. + Dim conversionIds As New List(Of String) + For Each newUserList As BasicUserList In userLists + If (Not newUserList.conversionTypes Is Nothing) Then + For Each newConversionType As UserListConversionType In _ + newUserList.conversionTypes + conversionIds.Add(newConversionType.id.ToString) + Next + End If + Next + + Dim conversionsMap As New Dictionary(Of Long, ConversionTracker) + + If (conversionIds.Count > 0) Then + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id"} + + Dim conversionTypePredicate As New Predicate + conversionTypePredicate.field = "Id" + conversionTypePredicate.operator = PredicateOperator.IN + conversionTypePredicate.values = conversionIds.ToArray + selector.predicates = New Predicate() {conversionTypePredicate} + + ' Get all conversion trackers. + Dim page As ConversionTrackerPage = conversionTrackerService.get(selector) + + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + For Each tracker As ConversionTracker In page.entries + conversionsMap.Item(tracker.id) = tracker + Next + End If + End If + + ' Display the results. + For Each newUserList As BasicUserList In userLists + Console.WriteLine("User list with name '{0}' and id '{1}' was added.", _ + newUserList.name, newUserList.id) + + ' Display user list associated conversion code snippets. + If (Not newUserList.conversionTypes Is Nothing) Then + For Each newConversionType As UserListConversionType In newUserList.conversionTypes + Dim conversionTracker As AdWordsConversionTracker = _ + DirectCast(conversionsMap.Item(newConversionType.id), _ + AdWordsConversionTracker) + Console.WriteLine("Conversion type code snippet associated to the list:\n{0}", _ + conversionTracker.snippet) + Next + End If + Next + Else + Console.WriteLine("No user lists (a.k.a. audiences) were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add user lists (a.k.a. audiences).", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/Remarketing/AddConversionTracker.vb b/examples/AdXBuyer/Vb/v201406/Remarketing/AddConversionTracker.vb new file mode 100644 index 00000000000..899be7f8e7e --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/Remarketing/AddConversionTracker.vb @@ -0,0 +1,109 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds an AdWords conversion tracker. + ''' + ''' Tags: ConversionTrackerService.mutate + ''' + Public Class AddConversionTracker + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddConversionTracker + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds an AdWords conversion tracker." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the ConversionTrackerService. + Dim conversionTrackerService As ConversionTrackerService = user.GetService( _ + AdWordsService.v201406.ConversionTrackerService) + + ' Create AdWords conversion tracker. + Dim conversionTracker As New AdWordsConversionTracker + conversionTracker.name = "Earth to Mars Cruises Conversion #" & _ + ExampleUtilities.GetRandomString + conversionTracker.category = ConversionTrackerCategory.DEFAULT + conversionTracker.markupLanguage = AdWordsConversionTrackerMarkupLanguage.HTML + conversionTracker.textFormat = AdWordsConversionTrackerTextFormat.HIDDEN + + ' Set optional fields. + conversionTracker.status = ConversionTrackerStatus.ENABLED + conversionTracker.viewthroughLookbackWindow = 15 + conversionTracker.isProductAdsChargeable = True + conversionTracker.productAdsChargeableConversionWindow = 15 + conversionTracker.conversionPageLanguage = "en" + conversionTracker.backgroundColor = "#0000FF" + conversionTracker.defaultRevenueValue = 12.34 + conversionTracker.alwaysUseDefaultRevenueValue = True + + ' Create the operation. + Dim operation As New ConversionTrackerOperation + operation.operator = [Operator].ADD + operation.operand = conversionTracker + + Try + ' Add conversion tracker. + Dim retval As ConversionTrackerReturnValue = conversionTrackerService.mutate( _ + New ConversionTrackerOperation() {operation}) + + ' Display the results. + If ((Not retval Is Nothing) AndAlso (Not retval.value Is Nothing) AndAlso _ + retval.value.Length > 0) Then + Dim newConversionTracker As ConversionTracker = retval.value(0) + Console.WriteLine("Conversion tracker with id '{0}', name '{1}', status '{2}', " & _ + "category '{3}' was added.", newConversionTracker.id, newConversionTracker.name, _ + newConversionTracker.status, newConversionTracker.category) + Else + Console.WriteLine("No conversion trackers were added.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to add conversion tracker.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/Reporting/DownloadCriteriaReport.vb b/examples/AdXBuyer/Vb/v201406/Reporting/DownloadCriteriaReport.vb new file mode 100644 index 00000000000..112424b31a9 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/Reporting/DownloadCriteriaReport.vb @@ -0,0 +1,118 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util.Reports +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example gets and downloads a criteria Ad Hoc report from an XML + ''' report definition. + ''' + Public Class DownloadCriteriaReport + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DownloadCriteriaReport + Console.WriteLine(codeExample.Description) + Try + Dim fileName As String = "INSERT_OUTPUT_FILE_NAME" + codeExample.Run(New AdWordsUser, fileName) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets and downloads a criteria Ad Hoc report from an XML report" & _ + " definition." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The file to which the report is downloaded. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal fileName As String) + Dim definition As New ReportDefinition + + definition.reportName = "Last 7 days CRITERIA_PERFORMANCE_REPORT" + definition.reportType = ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT + definition.downloadFormat = DownloadFormat.GZIPPED_CSV + definition.dateRangeType = ReportDefinitionDateRangeType.LAST_7_DAYS + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"CampaignId", "AdGroupId", "Id", "CriteriaType", "Criteria", _ + "CriteriaDestinationUrl", "Clicks", "Impressions", "Cost"} + + Dim predicate As New Predicate + predicate.field = "Status" + predicate.operator = PredicateOperator.IN + predicate.values = New String() {"ACTIVE", "PAUSED"} + selector.predicates = New Predicate() {predicate} + + definition.selector = selector + definition.includeZeroImpressions = True + + Dim filePath As String = ExampleUtilities.GetHomeDir() & Path.DirectorySeparatorChar & _ + fileName + + Try + ' If you know that your report is small enough to fit in memory, then + ' you can instead use + ' Dim utilities As New ReportUtilities(user) + ' utilities.ReportVersion = "v201406" + ' Dim report As ClientReport = utilities.GetClientReport( _ + ' Of ReportDefinition)(definition) + ' + ' ' Get the text report directly if you requested a text format + ' ' (e.g. xml) + ' Dim reportText As String = report.Text + ' + ' ' Get the binary report if you requested a binary format + ' ' (e.g. gzip) + ' Dim reportBytes As Byte() = report.Contents + ' + ' ' Deflate a zipped binary report for further processing. + ' Dim deflatedReportText As String = Encoding.UTF8.GetString( _ + ' MediaUtilities.DeflateGZipData(report.Contents)) + Dim utilities As New ReportUtilities(user) + utilities.ReportVersion = "v201406" + utilities.DownloadClientReport(Of ReportDefinition)(definition, filePath) + Console.WriteLine("Report was downloaded to '{0}'.", filePath) + Catch ex As Exception + Throw New System.ApplicationException("Failed to download report.", ex) + End Try + + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/Reporting/DownloadCriteriaReportWithAwql.vb b/examples/AdXBuyer/Vb/v201406/Reporting/DownloadCriteriaReportWithAwql.vb new file mode 100644 index 00000000000..fa114556701 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/Reporting/DownloadCriteriaReportWithAwql.vb @@ -0,0 +1,102 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.Util.Reports +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example gets and downloads a criteria Ad Hoc report from an AWQL + ''' query. See https://developers.google.com/adwords/api/docs/guides/awql for + ''' AWQL documentation. + ''' + Public Class DownloadCriteriaReportWithAwql + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New DownloadCriteriaReportWithAwql + Console.WriteLine(codeExample.Description) + Try + Dim fileName As String = "INSERT_OUTPUT_FILE_NAME" + codeExample.Run(New AdWordsUser, fileName) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets and downloads a criteria Ad Hoc report from an AWQL" & _ + " query. See https://developers.google.com/adwords/api/docs/guides/awql for" & _ + " AWQL documentation." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The file to which the report is downloaded. + ''' + Public Sub Run(ByVal user As AdWordsUser, ByVal fileName As String) + Dim query As String = "SELECT CampaignId, AdGroupId, Id, Criteria, CriteriaType, " & _ + "Impressions, Clicks, Cost FROM CRITERIA_PERFORMANCE_REPORT WHERE Status IN " & _ + "[ACTIVE, PAUSED] DURING LAST_7_DAYS" + + Dim filePath As String = ExampleUtilities.GetHomeDir() + Path.DirectorySeparatorChar & _ + fileName + + Try + ' If you know that your report is small enough to fit in memory, then + ' you can instead use + ' Dim utilities As New ReportUtilities(user) + ' utilities.ReportVersion = "v201406" + ' Dim report As ClientReport = utilities.GetClientReport(query, format) + ' + ' ' Get the text report directly if you requested a text format + ' ' (e.g. xml) + ' Dim reportText As String = report.Text + ' + ' ' Get the binary report if you requested a binary format + ' ' (e.g. gzip) + ' Dim reportBytes As Byte() = report.Contents + ' + ' ' Deflate a zipped binary report for further processing. + ' Dim deflatedReportText As String = Encoding.UTF8.GetString( _ + ' MediaUtilities.DeflateGZipData(report.Contents)) + Dim utilities As New ReportUtilities(user) + utilities.ReportVersion = "v201406" + utilities.DownloadClientReport(query, DownloadFormat.GZIPPED_CSV.ToString(), filePath) + Console.WriteLine("Report was downloaded to '{0}'.", filePath) + Catch ex As Exception + Throw New System.ApplicationException("Failed to download report.", ex) + End Try + + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/Reporting/GetReportFields.vb b/examples/AdXBuyer/Vb/v201406/Reporting/GetReportFields.vb new file mode 100644 index 00000000000..c7568b1dead --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/Reporting/GetReportFields.vb @@ -0,0 +1,97 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example gets report fields. + ''' + ''' Tags: ReportDefinitionService.getReportFields + ''' + Public Class GetReportFields + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetReportFields + Console.WriteLine(codeExample.Description) + Try + Dim reportType As ReportDefinitionReportType = [Enum].Parse( _ + GetType(ReportDefinitionReportType), "INSERT_REPORT_TYPE_HERE") + codeExample.Run(New AdWordsUser, reportType) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets report fields." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' The report type to be run. + Public Sub Run(ByVal user As AdWordsUser, ByVal reportType As ReportDefinitionReportType) + ' Get the ReportDefinitionService. + Dim reportDefinitionService As ReportDefinitionService = user.GetService( _ + AdWordsService.v201406.ReportDefinitionService) + + ' The type of the report to get fields for. + ' E.g.: KEYWORDS_PERFORMANCE_REPORT + + Try + ' Get the report fields. + Dim reportDefinitionFields As ReportDefinitionField() = _ + reportDefinitionService.getReportFields(reportType) + + If ((Not reportDefinitionFields Is Nothing) AndAlso _ + (reportDefinitionFields.Length > 0)) Then + ' Display report fields. + Console.WriteLine("The report type '{0}' contains the following fields:", reportType) + + For Each reportDefinitionField As ReportDefinitionField In reportDefinitionFields + Console.Write("- {0} ({1})", reportDefinitionField.fieldName, _ + reportDefinitionField.fieldType) + If (Not reportDefinitionField.enumValues Is Nothing) Then + Console.Write(" := [{0}]", String.Join(", ", reportDefinitionField.enumValues)) + End If + Console.WriteLine() + Next + Else + Console.WriteLine("This report type has no fields.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to retrieve fields for report type.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/Targeting/AddCampaignTargetingCriteria.vb b/examples/AdXBuyer/Vb/v201406/Targeting/AddCampaignTargetingCriteria.vb new file mode 100644 index 00000000000..a9951723f9d --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/Targeting/AddCampaignTargetingCriteria.vb @@ -0,0 +1,138 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example adds various types of targeting criteria to a campaign. + ''' To get a list of campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignCriterionService.mutate + ''' + Public Class AddCampaignTargetingCriteria + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New AddCampaignTargetingCriteria + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example adds various types of targeting criteria to a campaign. To " & _ + "get a list of campaigns, run GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign to which targeting criteria + ''' are added. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignCriterionService. + Dim campaignCriterionService As CampaignCriterionService = user.GetService( _ + AdWordsService.v201406.CampaignCriterionService) + + ' Create language criteria. + ' See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + ' for a detailed list of language codes. + Dim language1 As New Language + language1.id = 1002 ' French + Dim languageCriterion1 As New CampaignCriterion + languageCriterion1.campaignId = campaignId + languageCriterion1.criterion = language1 + + Dim language2 As New Language + language2.id = 1005 ' Japanese + Dim languageCriterion2 As New CampaignCriterion + languageCriterion2.campaignId = campaignId + languageCriterion2.criterion = language2 + + ' Create location criteria. + ' See http://code.google.com/apis/adwords/docs/appendix/countrycodes.html + ' for a detailed list of country codes. + Dim location1 As New Location + location1.id = 2840 ' USA + Dim locationCriterion1 As New CampaignCriterion + locationCriterion1.campaignId = campaignId + locationCriterion1.criterion = location1 + + Dim location2 As New Location + location2.id = 2392 ' Japan + Dim locationCriterion2 As New CampaignCriterion + locationCriterion2.campaignId = campaignId + locationCriterion2.criterion = location2 + + ' Add a negative campaign placement. + Dim negativeCriterion As New NegativeCampaignCriterion() + negativeCriterion.campaignId = campaignId + + Dim placement As New Placement() + placement.url = "http://mars.google.com" + + negativeCriterion.criterion = placement + + Dim criteria() As CampaignCriterion = {languageCriterion1, languageCriterion2, _ + locationCriterion1, locationCriterion2, negativeCriterion} + + Dim operations As New List(Of CampaignCriterionOperation) + + For Each criterion As CampaignCriterion In criteria + Dim operation As New CampaignCriterionOperation + operation.operator = [Operator].ADD + operation.operand = criterion + operations.Add(operation) + Next + + Try + ' Set the campaign targets. + Dim retVal As CampaignCriterionReturnValue = campaignCriterionService.mutate( _ + operations.ToArray()) + + ' Display the results. + If ((Not retVal Is Nothing) AndAlso (Not retVal.value Is Nothing)) Then + For Each criterion As CampaignCriterion In retVal.value + Console.WriteLine("Campaign criterion of type '{0}' was set to campaign with id " & _ + "= '{1}'.", criterion.criterion.CriterionType, criterion.campaignId) + Next + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to set campaign criteria.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/Targeting/GetCampaignTargetingCriteria.vb b/examples/AdXBuyer/Vb/v201406/Targeting/GetCampaignTargetingCriteria.vb new file mode 100644 index 00000000000..3edeba1b103 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/Targeting/GetCampaignTargetingCriteria.vb @@ -0,0 +1,123 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example gets all targeting criteria for a campaign. To set + ''' campaign targeting criteria, run AddCampaignTargetingCriteria.vb. To get + ''' campaigns, run GetCampaigns.vb. + ''' + ''' Tags: CampaignCriterionService.get + ''' + Public Class GetCampaignTargetingCriteria + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetCampaignTargetingCriteria + Console.WriteLine(codeExample.Description) + Try + Dim campaignId As Long = Long.Parse("INSERT_CAMPAIGN_ID_HERE") + codeExample.Run(New AdWordsUser, campaignId) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets all targeting criteria for a campaign. To set campaign " & _ + "targeting criteria, run AddCampaignTargetingCriteria.vb. To get campaigns, run " & _ + "GetCampaigns.vb." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + ''' Id of the campaign from which targeting + ''' criteria are retrieved. + Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long) + ' Get the CampaignCriterionService. + Dim campaignCriterionService As CampaignCriterionService = user.GetService( _ + AdWordsService.v201406.CampaignCriterionService) + + ' Create the selector. + Dim selector As New Selector + selector.fields = New String() {"Id", "CriteriaType", "PlacementUrl"} + + ' Set the filters. + Dim campaignPredicate As New Predicate + campaignPredicate.field = "CampaignId" + campaignPredicate.operator = PredicateOperator.EQUALS + campaignPredicate.values = New String() {campaignId.ToString} + + Dim placementPredicate As New Predicate + placementPredicate.field = "CriteriaType" + placementPredicate.operator = PredicateOperator.EQUALS + placementPredicate.values = New String() {"PLACEMENT"} + + selector.predicates = New Predicate() {campaignPredicate, placementPredicate} + + ' Set the selector paging. + selector.paging = New Paging + + Dim offset As Integer = 0 + Dim pageSize As Integer = 500 + + Dim page As New CampaignCriterionPage + + Try + Do + selector.paging.startIndex = offset + selector.paging.numberResults = pageSize + + ' Get all campaign targets. + page = campaignCriterionService.get(selector) + + ' Display the results. + If ((Not page Is Nothing) AndAlso (Not page.entries Is Nothing)) Then + Dim i As Integer = offset + For Each campaignCriterion As CampaignCriterion In page.entries + Dim placement As Placement = campaignCriterion.criterion + Console.WriteLine("{0}) Placement with ID {1} and url {2} was found.", i, _ + placement.id, placement.url) + i += 1 + Next + End If + offset = offset + pageSize + Loop While (offset < page.totalNumEntries) + Console.WriteLine("Number of placements found: {0}", page.totalNumEntries) + Catch ex As Exception + Throw New System.ApplicationException("Failed to get placements.", ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/Targeting/GetTargetableLanguagesAndCarriers.vb b/examples/AdXBuyer/Vb/v201406/Targeting/GetTargetableLanguagesAndCarriers.vb new file mode 100644 index 00000000000..a65c1503d7f --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/Targeting/GetTargetableLanguagesAndCarriers.vb @@ -0,0 +1,100 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example illustrates how to retrieve all carriers and languages + ''' available for targeting. + ''' + ''' Tags: ConstantDataService.getCarrierCriterion + ''' Tags: ConstantDataService.getLanguageCriterion + ''' + Public Class GetTargetableLanguagesAndCarriers + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New GetTargetableLanguagesAndCarriers + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example illustrates how to retrieve all carriers and languages" & _ + "available for targeting." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the ConstantDataService. + Dim constantDataService As ConstantDataService = user.GetService( _ + AdWordsService.v201406.ConstantDataService) + + Try + ' Get all carriers. + Dim carriers As Carrier() = constantDataService.getCarrierCriterion + + ' Display the results. + If (Not carriers Is Nothing) Then + For Each carrier As Carrier In carriers + Console.WriteLine("Carrier name is '{0}', ID is {1} and country code is '{2}'.", _ + carrier.name, carrier.id, carrier.countryCode) + Next + Else + Console.WriteLine("No carriers were retrieved.") + End If + + ' Get all languages. + Dim languages As Language() = constantDataService.getLanguageCriterion + + ' Display the results. + If (Not languages Is Nothing) Then + For Each language As Language In languages + Console.WriteLine("Language name is '{0}', ID is {1} and code is '{2}'.", _ + language.name, language.id, language.code) + Next + Else + Console.WriteLine("No languages were found.") + End If + Catch ex As Exception + Throw New System.ApplicationException("Failed to get targetable carriers and languages.", _ + ex) + End Try + End Sub + End Class +End Namespace diff --git a/examples/AdXBuyer/Vb/v201406/Targeting/LookupLocation.vb b/examples/AdXBuyer/Vb/v201406/Targeting/LookupLocation.vb new file mode 100644 index 00000000000..4da22a66694 --- /dev/null +++ b/examples/AdXBuyer/Vb/v201406/Targeting/LookupLocation.vb @@ -0,0 +1,121 @@ +' Copyright 2014, Google Inc. All Rights Reserved. +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. + +' Author: api.anash@gmail.com (Anash P. Oommen) + +Imports Google.Api.Ads.AdWords.Lib +Imports Google.Api.Ads.AdWords.v201406 + +Imports System +Imports System.Collections.Generic +Imports System.IO + +Namespace Google.Api.Ads.AdWords.Examples.VB.v201406 + ''' + ''' This code example gets location criteria by name. + ''' + ''' Tags: LocationCriterionService.get + ''' + Public Class LookupLocation + Inherits ExampleBase + ''' + ''' Main method, to run this code example as a standalone application. + ''' + ''' The command line arguments. + Public Shared Sub Main(ByVal args As String()) + Dim codeExample As New LookupLocation + Console.WriteLine(codeExample.Description) + Try + codeExample.Run(New AdWordsUser) + Catch ex As Exception + Console.WriteLine("An exception occurred while running this code example. {0}", _ + ExampleUtilities.FormatException(ex)) + End Try + End Sub + + ''' + ''' Returns a description about the code example. + ''' + Public Overrides ReadOnly Property Description() As String + Get + Return "This code example gets location criteria by name." + End Get + End Property + + ''' + ''' Runs the code example. + ''' + ''' The AdWords user. + Public Sub Run(ByVal user As AdWordsUser) + ' Get the LocationCriterionService. + Dim locationCriterionService As LocationCriterionService = user.GetService( _ + AdWordsService.v201406.LocationCriterionService) + + Dim locationNames As String() = New String() {"Paris", "Quebec", "Spain", "Deutschland"} + + Dim selector As New Selector + selector.fields = New String() {"Id", "LocationName", "CanonicalName", "DisplayType", _ + "ParentLocations", "Reach", "TargetingStatus"} + + ' Location names must match exactly, only EQUALS and IN are supported. + Dim predicate1 As New Predicate + predicate1.field = "LocationName" + predicate1.operator = PredicateOperator.IN + predicate1.values = locationNames + + ' Set the locale of the returned location names. + Dim predicate2 As New Predicate + predicate2.field = "Locale" + predicate2.operator = PredicateOperator.EQUALS + predicate2.values = New String() {"en"} + + selector.predicates = New Predicate() {predicate1, predicate2} + + Try + ' Make the get request. + Dim locationCriteria As LocationCriterion() = locationCriterionService.get(selector) + + ' Display the resulting location criteria. + For Each locationCriterion As LocationCriterion In locationCriteria + Dim parentLocations As String = "" + If ((Not locationCriterion.location Is Nothing) AndAlso ( _ + Not locationCriterion.location.parentLocations Is Nothing)) Then + For Each location As Location In locationCriterion.location.parentLocations + parentLocations = (parentLocations & Me.GetLocationString(location) & ", ") + Next + parentLocations.TrimEnd(New Char() {","c, " "c}) + Else + parentLocations = "N/A" + End If + Console.WriteLine("The search term '{0}' returned the location '{1}' of type '{2}' " & _ + "with parent locations '{3}', reach '{4}' and targeting status '{5}.", _ + locationCriterion.searchTerm, locationCriterion.location.locationName, _ + locationCriterion.location.displayType, parentLocations, locationCriterion.reach, _ + locationCriterion.location.targetingStatus) + Next + Catch ex As Exception + Throw New System.ApplicationException("Failed to get location criteria.", ex) + End Try + End Sub + + ''' + ''' Gets a string representation for a location. + ''' + ''' The location + ''' + Public Function GetLocationString(ByVal location As Location) As String + Return String.Format("{0} ({1})", location.locationName, location.displayType) + End Function + End Class +End Namespace diff --git a/examples/Dfa/CSharp/App.config b/examples/Dfa/CSharp/App.config new file mode 100644 index 00000000000..3a6bc204c19 --- /dev/null +++ b/examples/Dfa/CSharp/App.config @@ -0,0 +1,189 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/Dfa/CSharp/Dfa.Examples.CSharp.csproj b/examples/Dfa/CSharp/Dfa.Examples.CSharp.csproj new file mode 100644 index 00000000000..516edee54fe --- /dev/null +++ b/examples/Dfa/CSharp/Dfa.Examples.CSharp.csproj @@ -0,0 +1,189 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954} + Exe + Properties + Google.Api.Ads.Dfa.Examples.CSharp + Dfa.Examples.CSharp + Google.Api.Ads.Dfa.Examples.CSharp.Program + v4.0 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AnyCPU + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {277404DB-A439-4450-B3A5-186294CDF245} + Common + + + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB} + Dfa + + + + + + + + + + \ No newline at end of file diff --git a/examples/Dfa/CSharp/OAuth/ConsoleExample.cs b/examples/Dfa/CSharp/OAuth/ConsoleExample.cs new file mode 100644 index 00000000000..8e56f4d9179 --- /dev/null +++ b/examples/Dfa/CSharp/OAuth/ConsoleExample.cs @@ -0,0 +1,120 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.v1_19; +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Common.Lib; + +using System; +using System.Data; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.OAuth { + /// + /// This code example shows how to run an DFA API command line application + /// while incorporating the OAuth2 installed application flow into your + /// application. If your application uses a single MCC login to make calls to + /// all your accounts, you shouldn't use this code example. Instead, you + /// should run Common\Util\OAuth2TokenGenerator.cs to generate a refresh token + /// and set that in user.Config.OAuth2RefreshToken field, or set + /// OAuth2RefreshToken key in your App.config / Web.config. + /// + /// This code example depends on Console environment only for reading and + /// writing values, you may use this code example in other environments like + /// Windows Form applications with minimial modifications. + /// + /// To run this application, + /// + /// 1. You should create a new Console Application project. + /// 2. Add reference to the following assemblies: + /// + /// Google.Ads.Common.dll + /// Google.Ads.OAuth.dll + /// Google.Dfa.dll + /// System.Web + /// System.Configuration + /// + /// 3. Replace the Main() method with this class's method. + /// 4. Copy App.config from Dfa.Examples.CSharp project, and configure + /// it as shown in this project's Web.config. + /// 5. Compile and run this example. + /// + public class ConsoleExample { + /// + /// The main method. + /// + /// Command line arguments. + static void Main(string[] args) { + DfaUser user = new DfaUser(); + DfaAppConfig config = (user.Config as DfaAppConfig); + if (config.AuthorizationMethod == DfaAuthorizationMethod.OAuth2) { + if (config.OAuth2Mode == OAuth2Flow.APPLICATION && + string.IsNullOrEmpty(config.OAuth2RefreshToken)) { + DoAuth2Authorization(user); + } + } else { + throw new Exception("Authorization mode is not OAuth."); + } + + // Set the username. This is required for the LoginService to work + // correctly when authenticating using OAuth2. + Console.Write("Enter the user name: "); + string userName = Console.ReadLine(); + (user.Config as DfaAppConfig).DfaUserName = userName; + + // Create AdRemoteService instance. + AdRemoteService service = (AdRemoteService) user.GetService( + DfaService.v1_19.AdRemoteService); + + try { + // Get ad types. + AdType[] adTypes = service.getAdTypes(); + + // Display ad type and its id. + foreach (AdType result in adTypes) { + Console.WriteLine("Ad type with name \"{0}\" and id \"{1}\" was found.", result.name, + result.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve ad types. Exception says \"{0}\"", + ex.Message); + } + } + + /// + /// Does the OAuth2 authorization for installed applications. + /// + /// The Dfa user. + private static void DoAuth2Authorization(DfaUser user) { + // Since we are using a console application, set the callback url to null. + user.Config.OAuth2RedirectUri = null; + AdsOAuthProviderForApplications oAuth2Provider = + (user.OAuthProvider as AdsOAuthProviderForApplications); + // Get the authorization url. + string authorizationUrl = oAuth2Provider.GetAuthorizationUrl(); + Console.WriteLine("Open a fresh web browser and navigate to \n\n{0}\n\n. You will be " + + "prompted to login and then authorize this application to make calls to the " + + "DFA API. Once approved, you will be presented with an authorization code.", + authorizationUrl); + + // Accept the OAuth2 authorization code from the user. + Console.Write("Enter the authorization code :"); + string authorizationCode = Console.ReadLine(); + + // Fetch the access and refresh tokens. + oAuth2Provider.FetchAccessAndRefreshTokens(authorizationCode); + } + } +} diff --git a/examples/Dfa/CSharp/OAuth/Default.aspx b/examples/Dfa/CSharp/OAuth/Default.aspx new file mode 100644 index 00000000000..322180a6610 --- /dev/null +++ b/examples/Dfa/CSharp/OAuth/Default.aspx @@ -0,0 +1,51 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" + Inherits="Google.Api.Ads.Dfa.Examples.CSharp.OAuth.Default" %> + + + + + + DFA API - OAuth demo + + +
+

DFA API OAuth demo

+

+ This code example uses OAuth to retrieve the list all ad types. +

+ +

+ + + +
+
+ + + + + + + diff --git a/examples/Dfa/CSharp/OAuth/Default.aspx.cs b/examples/Dfa/CSharp/OAuth/Default.aspx.cs new file mode 100644 index 00000000000..137a1f02bbe --- /dev/null +++ b/examples/Dfa/CSharp/OAuth/Default.aspx.cs @@ -0,0 +1,164 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Data; +using System.IO; +using System.Web.UI.WebControls; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.OAuth { + /// + /// Code-behind class for Default.aspx. + /// + public partial class Default : System.Web.UI.Page { + /// + /// The user for creating services and making DFA API calls. + /// + DfaUser user; + + /// + /// Handles the Load event of the Page control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + void Page_Load(object sender, EventArgs e) { + user = new DfaUser(); + } + + /// + /// Handles the Click event of the btnAuthorize control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + protected void OnAuthorizeButtonClick(object sender, EventArgs e) { + // This code example shows how to run an DFA API web application + // while incorporating the OAuth2 web application flow into your + // application. If your application uses a single Google login to make calls + // to all your accounts, you shouldn't use this code example. Instead, you + // should run Common\Util\OAuth2TokenGenerator.cs to generate a refresh + // token and set that in user.Config.OAuth2RefreshToken field, or set + // OAuth2RefreshToken key in your App.config / Web.config. + DfaAppConfig config = user.Config as DfaAppConfig; + if (config.AuthorizationMethod ==DfaAuthorizationMethod.OAuth2) { + if (user.Config.OAuth2Mode == OAuth2Flow.APPLICATION && + string.IsNullOrEmpty(config.OAuth2RefreshToken)) { + Response.Redirect("OAuthLogin.aspx"); + } + } else { + throw new Exception("Authorization mode is not OAuth."); + } + } + + /// + /// Handles the Click event of the btnAdTypes control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + protected void OnGetAdTypesButtonClick(object sender, EventArgs e) { + ConfigureUserForOAuth(); + + try { + // Set the username. This is required for the LoginService to work + // correctly when authenticating using OAuth2. + (user.Config as DfaAppConfig).DfaUserName = txtUserName.Text; + + // Create AdRemoteService instance. + AdRemoteService service = (AdRemoteService) user.GetService( + DfaService.v1_19.AdRemoteService); + + // Get ad types. + AdType[] adTypes = service.getAdTypes(); + + // Display ad type and its id. + foreach (AdType result in adTypes) { + Console.WriteLine("Ad type with name \"{0}\" and id \"{1}\" was found.", result.name, + result.id); + } + + // Display ad types. + if (adTypes != null && adTypes.Length > 0) { + DataTable dataTable = new DataTable(); + dataTable.Columns.AddRange(new DataColumn[] { + new DataColumn("Serial No.", typeof(int)), + new DataColumn("Id", typeof(long)), + new DataColumn("Ad Type", typeof(string)), + }); + for (int i = 0; i < adTypes.Length; i++) { + AdType result = adTypes[i]; + DataRow dataRow = dataTable.NewRow(); + dataRow.ItemArray = new object[] {i + 1, result.id, result.name}; + dataTable.Rows.Add(dataRow); + } + + AdTypeGrid.DataSource = dataTable; + AdTypeGrid.DataBind(); + } else { + Response.Write("No ad types were found."); + } + } catch (Exception ex) { + Response.Write(string.Format("Failed to get ad types. Exception says \"{0}\"", + ex.Message)); + } + } + + /// + /// Configures the DFA user for OAuth. + /// + private void ConfigureUserForOAuth() { + DfaAppConfig config = (user.Config as DfaAppConfig); + if (config.AuthorizationMethod == DfaAuthorizationMethod.OAuth2) { + if (config.OAuth2Mode == OAuth2Flow.APPLICATION && + string.IsNullOrEmpty(config.OAuth2RefreshToken)) { + user.OAuthProvider = (OAuth2ProviderForApplications) Session["OAuthProvider"]; + } + } else { + throw new Exception("Authorization mode is not OAuth."); + } + } + + /// + /// Handles the Click event of the btnLogout control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + protected void OnLogoutButtonClick(object sender, EventArgs e) { + Session.Clear(); + } + + /// + /// Handles the RowDataBound event of the AdTypeGrid control. + /// + /// The source of the event. + /// The + /// instance + /// containing the event data. + protected void AdTypeGrid_RowDataBound(object sender, GridViewRowEventArgs e) { + if (e.Row.DataItemIndex >= 0) { + e.Row.Cells[0].HorizontalAlign = HorizontalAlign.Center; + e.Row.Cells[1].HorizontalAlign = HorizontalAlign.Center; + e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Left; + } + } + } +} diff --git a/examples/Dfa/CSharp/OAuth/Default.aspx.designer.cs b/examples/Dfa/CSharp/OAuth/Default.aspx.designer.cs new file mode 100644 index 00000000000..f3dfd540ce1 --- /dev/null +++ b/examples/Dfa/CSharp/OAuth/Default.aspx.designer.cs @@ -0,0 +1,78 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Google.Api.Ads.Dfa.Examples.CSharp.OAuth { + + + public partial class Default { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// btnAuthorize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAuthorize; + + /// + /// btnLogout control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnLogout; + + /// + /// lblUserName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblUserName; + + /// + /// txtUserName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtUserName; + + /// + /// btnGetAdTypes control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnGetAdTypes; + + /// + /// AdTypeGrid control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView AdTypeGrid; + } +} diff --git a/examples/Dfa/CSharp/OAuth/Dfa.Examples.CSharp.OAuth.csproj b/examples/Dfa/CSharp/OAuth/Dfa.Examples.CSharp.OAuth.csproj new file mode 100644 index 00000000000..06aec575b02 --- /dev/null +++ b/examples/Dfa/CSharp/OAuth/Dfa.Examples.CSharp.OAuth.csproj @@ -0,0 +1,100 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {4641ADD7-0D1F-473D-B713-2830C5029367} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Google.Api.Ads.AdWords.Examples.CSharp.OAuth + Google.AdWords.Examples.CSharp.OAuth + v4.0 + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + AnyCPU + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + + + + + + + + + + + Properties\Properties.cs + + + Code + + + Default.aspx + ASPXCodeBehind + + + Default.aspx + + + OAuthLogin.aspx + ASPXCodeBehind + + + OAuthLogin.aspx + + + + + + {277404DB-A439-4450-B3A5-186294CDF245} + Common + + + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB} + Dfa + + + + + + + + + + True + + + + + + + + + + \ No newline at end of file diff --git a/examples/Dfa/CSharp/OAuth/OAuthLogin.aspx b/examples/Dfa/CSharp/OAuth/OAuthLogin.aspx new file mode 100644 index 00000000000..b0cf3f8de31 --- /dev/null +++ b/examples/Dfa/CSharp/OAuth/OAuthLogin.aspx @@ -0,0 +1,34 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OAuthLogin.aspx.cs" + Inherits="Google.Api.Ads.Dfa.Examples.CSharp.OAuth.OAuthLogin" %> + + + + + + Untitled Page + + +
+
+ +
+
+ + diff --git a/examples/Dfa/CSharp/OAuth/OAuthLogin.aspx.cs b/examples/Dfa/CSharp/OAuth/OAuthLogin.aspx.cs new file mode 100644 index 00000000000..b1302b3a441 --- /dev/null +++ b/examples/Dfa/CSharp/OAuth/OAuthLogin.aspx.cs @@ -0,0 +1,111 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Dfa.Lib; + +using System; +using System.Collections; +using System.Configuration; +using System.Data; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.HtmlControls; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.OAuth { + /// + /// Login and callback page for handling OAuth2 authentication. + /// + public partial class OAuthLogin : Page { + /// + /// Handles the Load event of the Page control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + protected void Page_Load(object sender, EventArgs e) { + // Create an DfaAppConfig object with the default settings in + // App.config. + DfaAppConfig config = new DfaAppConfig(); + if (config.AuthorizationMethod == DfaAuthorizationMethod.OAuth2) { + if (config.OAuth2Mode == OAuth2Flow.APPLICATION && + string.IsNullOrEmpty(config.OAuth2RefreshToken)) { + DoAuth2Configuration(config); + } + } + } + + private void DoAuth2Configuration(DfaAppConfig config) { + // Since we use this page for OAuth callback also, we set the callback + // url as the current page. For a non-web application, this will be null. + config.OAuth2RedirectUri = Request.Url.GetLeftPart(UriPartial.Path); + + // Create an OAuth2 object for handling OAuth2 flow. + OAuth2ProviderForApplications oAuth = new OAuth2ProviderForApplications(config); + + if (Request.Params["state"] == null) { + // This is the first time this page is being loaded. + // Set the state variable to any value that helps you recognize + // when this url will be called by the OAuth2 server. + oAuth.State = "callback"; + + // Create an authorization url and redirect the user to that page. + Response.Redirect(oAuth.GetAuthorizationUrl()); + } else if (Request.Params["state"] == "callback") { + // This page was loaded because OAuth server did a callback. + // Retrieve the authorization code from the url and use it to fetch + // the access token. This call will also fetch the refresh token if + // your mode is offline. + oAuth.FetchAccessAndRefreshTokens(Request.Params["code"]); + + // Save the OAuth2 provider for future use. If you wish to save only + // the values and restore the object later, then save + // oAuth.RefreshToken, oAuth.AccessToken, oAuth.UpdatedOn and + // oAuth.ExpiresIn. + // + // You can later restore the values as + // DfaUser user = new AdWordsUser(); + // user.Config.OAuth2Mode = OAuth2Flow.APPLICATION; + // OAuth2ProviderForApplications oAuth = + // (user.OAuthProvider as OAuth2ProviderForApplications); + // oAuth.RefreshToken = xxx; + // oAuth.AccessToken = xxx; + // oAuth.UpdatedOn = xxx; + // oAuth.ExpiresIn = xxx; + // + // Note that only oAuth.RefreshToken is mandatory. If you leave + // oAuth.AccessToken as empty, or if oAuth.UpdatedOn + oAuth.ExpiresIn + // is in the past, the access token will be refreshed by the library. + // You can listen to this event as + // + // oAuth.OnOAuthTokensObtained += delegate(AdsOAuthProvider provider) { + // OAuth2ProviderForApplications oAuth = + // (provider as OAuth2ProviderForApplications); + // // Save oAuth.RefreshToken, oAuth.AccessToken, oAuth.UpdatedOn and + // // oAuth.ExpiresIn. + //}; + Session["OAuthProvider"] = oAuth; + // Redirect the user to the main page. + Response.Redirect("Default.aspx"); + } else { + throw new Exception("Unknown state for OAuth callback."); + } + } + } +} diff --git a/examples/Dfa/CSharp/OAuth/OAuthLogin.aspx.designer.cs b/examples/Dfa/CSharp/OAuth/OAuthLogin.aspx.designer.cs new file mode 100644 index 00000000000..fffeaab5c25 --- /dev/null +++ b/examples/Dfa/CSharp/OAuth/OAuthLogin.aspx.designer.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Google.Api.Ads.Dfa.Examples.CSharp.OAuth { + + + public partial class OAuthLogin { + + /// + /// Head1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlHead Head1; + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + } +} diff --git a/examples/Dfa/CSharp/OAuth/Properties/AssemblyInfo.cs b/examples/Dfa/CSharp/OAuth/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..c60b48b0adb --- /dev/null +++ b/examples/Dfa/CSharp/OAuth/Properties/AssemblyInfo.cs @@ -0,0 +1,38 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("DoubleClick for Advertisers API DotNet Client Library OAuth Samples")] +[assembly: AssemblyDescription("This application contains samples that shows how to use " + + "DoubleClick for Advertisers API using the client library and OAuth as " + + "authentication mechanism.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")] diff --git a/examples/Dfa/CSharp/OAuth/Properties/Properties.cs b/examples/Dfa/CSharp/OAuth/Properties/Properties.cs new file mode 100644 index 00000000000..e227e002fbb --- /dev/null +++ b/examples/Dfa/CSharp/OAuth/Properties/Properties.cs @@ -0,0 +1,24 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; + +[assembly: AssemblyCompany("Google")] +[assembly: AssemblyProduct("DoubleClick for Advertisers API DotNet Client Library")] +[assembly: AssemblyCopyright("Copyright 2011, Google Inc. All Rights Reserved.")] + +[assembly: AssemblyVersion("18.0.0.0")] +[assembly: AssemblyFileVersion("18.0.0.0")] diff --git a/examples/Dfa/CSharp/OAuth/Web.config b/examples/Dfa/CSharp/OAuth/Web.config new file mode 100644 index 00000000000..744bbb97f83 --- /dev/null +++ b/examples/Dfa/CSharp/OAuth/Web.config @@ -0,0 +1,175 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/Dfa/CSharp/OAuth/css/main.css b/examples/Dfa/CSharp/OAuth/css/main.css new file mode 100644 index 00000000000..e52bb7f52ee --- /dev/null +++ b/examples/Dfa/CSharp/OAuth/css/main.css @@ -0,0 +1,27 @@ +/** + * Copyright 2011, Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http: *www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + + * Author: api.anash@gmail.com (Anash P. Oommen) + */ + +body { + font-family: Verdana; + font-size:10pt; +} + +h1 { + font-family: Arial; + font-size:20pt; +} diff --git a/examples/Dfa/CSharp/Program.cs b/examples/Dfa/CSharp/Program.cs new file mode 100644 index 00000000000..443a92c72b6 --- /dev/null +++ b/examples/Dfa/CSharp/Program.cs @@ -0,0 +1,127 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; + +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Reflection; + +using SamplePair = System.Collections.Generic.KeyValuePair; + +namespace Google.Api.Ads.Dfa.Examples.CSharp { + /// + /// The Main class for this application. + /// + class Program { + /// + /// A map to hold the code examples to be executed. + /// + static List sampleMap = new List(); + + /// + /// A flag to keep track of whether help message was shown earlier. + /// + private static bool helpShown = false; + + static void RegisterSample(string key, SampleBase value) { + sampleMap.Add(new SamplePair(key, value)); + } + /// + /// Static constructor to initialize the sample map. + /// + static Program() { + Type[] types = Assembly.GetExecutingAssembly().GetTypes(); + + foreach (Type type in types) { + if (type.BaseType == typeof(SampleBase)) { + RegisterSample(type.FullName.Replace(typeof(Program).Namespace + ".", ""), + Activator.CreateInstance(type) as SampleBase); + } + } + } + + /// + /// The main method. + /// + /// + public static void Main(string[] args) { + if (args.Length == 0) { + ShowUsage(); + return; + } + + DfaUser user = new DfaUser(); + + foreach (string cmdArgs in args) { + SamplePair matchingPair = sampleMap.Find(delegate(SamplePair pair) { + return string.Compare(pair.Key, cmdArgs, true) == 0; + }); + + if (matchingPair.Key != null) { + RunASample(user, matchingPair.Value); + } else { + ShowUsage(); + } + } + } + + /// + /// Runs a code sample. + /// + /// The user whose credentials should be used for + /// running the sample. + /// The code sample to run. + private static void RunASample(DfaUser user, SampleBase sample) { + try { + Console.WriteLine(sample.Description); + sample.Run(user); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code example.\n{0} at\n{1}", + ex.Message, ex.StackTrace); + } finally { + Console.WriteLine("Press [Enter] to continue"); + Console.ReadLine(); + } + } + + /// + /// Prints program usage message. + /// + private static void ShowUsage() { + if (helpShown) { + return; + } else { + helpShown = true; + } + string exeName = Path.GetFileName(Assembly.GetExecutingAssembly().Location); + Console.WriteLine("Runs DFA API code examples"); + Console.WriteLine("Usage : {0} [flags]\n", exeName); + Console.WriteLine("Available flags\n"); + Console.WriteLine("--help\t\t : Prints this help message.", exeName); + Console.WriteLine("examplename1 [examplename1 ...] : " + + "Run specific code examples. Example name can be one of the following:\n", exeName); + foreach (SamplePair pair in sampleMap) { + Console.WriteLine("{0} : {1}", pair.Key, pair.Value.Description); + } + Console.WriteLine("Press [Enter] to continue"); + Console.ReadLine(); + } + } +} diff --git a/examples/Dfa/CSharp/Properties/AssemblyInfo.cs b/examples/Dfa/CSharp/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..fb9a3e15be9 --- /dev/null +++ b/examples/Dfa/CSharp/Properties/AssemblyInfo.cs @@ -0,0 +1,38 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("DoubleClick for Advertisers API Client Library Code Examples")] +[assembly: AssemblyDescription( + "This application contains code examples that shows how to DoubleClick for Advertisers API " + + "using the client library.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("65b1581e-2d6e-4888-8bba-9b59a814733b")] diff --git a/examples/Dfa/CSharp/Properties/Properties.cs b/examples/Dfa/CSharp/Properties/Properties.cs new file mode 100644 index 00000000000..e227e002fbb --- /dev/null +++ b/examples/Dfa/CSharp/Properties/Properties.cs @@ -0,0 +1,24 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; + +[assembly: AssemblyCompany("Google")] +[assembly: AssemblyProduct("DoubleClick for Advertisers API DotNet Client Library")] +[assembly: AssemblyCopyright("Copyright 2011, Google Inc. All Rights Reserved.")] + +[assembly: AssemblyVersion("18.0.0.0")] +[assembly: AssemblyFileVersion("18.0.0.0")] diff --git a/examples/Dfa/CSharp/SampleBase.cs b/examples/Dfa/CSharp/SampleBase.cs new file mode 100644 index 00000000000..06eb6c9d54e --- /dev/null +++ b/examples/Dfa/CSharp/SampleBase.cs @@ -0,0 +1,71 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +// Uncomment this key and recompile to make all the samples interactive +// instead of manually replacing the INSERT_XXX fields in samples. + +#define INTERACTIVE + +using Google.Api.Ads.Dfa.Lib; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfa.Examples.CSharp { + /// + /// This abstract class represents a code example. + /// + abstract class SampleBase { + /// + /// Returns a description about the code example. + /// + public abstract string Description { + get; + } + + /// + /// Run the code example. + /// + /// Dfa user running the code example. + public abstract void Run(DfaUser user); + + protected string _T(string prompt) { +#if INTERACTIVE + Console.Write(prompt + " : "); + return Console.ReadLine(); +#else + return prompt; +#endif + } + + /// + /// Gets the current timestamp as a string. + /// + /// The current timestamp as a string. + protected string GetTimeStamp() { + Thread.Sleep(100); + return (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalMilliseconds.ToString(); + } + + /// + /// Gets the current user's home directory. + /// + /// The current user's home directory. + protected String GetHomeDir() { + return Environment.GetEnvironmentVariable("USERPROFILE"); + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/AddAdvertiserUserFilter.cs b/examples/Dfa/CSharp/v1_19/AddAdvertiserUserFilter.cs new file mode 100644 index 00000000000..d6d85dad6a3 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/AddAdvertiserUserFilter.cs @@ -0,0 +1,117 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example locates a user profile by id number and adds a filter + /// to it, limiting the user profile's access to certain advertisers. To get + /// user ids, run GetUsers.cs. To get advertiser ids, run GetAdvertisers.cs. + /// + /// A similar pattern can be applied to set filters limiting site, user role, + /// and/or campaign access for any user. To get the Filter Criteria Type ID, + /// run GetUserFilterTypes.cs. + /// + /// Tags: user.getUser, user.saveUser + /// + class AddAdvertiserUserFilter : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example locates a user profile by id number and adds a filter to it," + + " limiting the user profile's access to certain advertisers. To get user ids, " + + "run GetUsers.cs. To get advertiser ids, run GetAdvertisers.cs.\n\nA similar " + + "pattern can be applied to set filters limiting site, user role, and/or campaign " + + "access for any user. To get the Filter Criteria Type ID, run GetUserFilterTypes.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new AddAdvertiserUserFilter(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create UserRemoteService instance. + UserRemoteService service = (UserRemoteService) user.GetService( + DfaService.v1_19.UserRemoteService); + + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + + // Create and configure a user filter. + UserFilter filterToAdd = new UserFilter(); + + // The following field has been filled in to make a filter that allows a + // user to access only the assigned objects. This value was determined + // using GetUserFilterTypes.cs. + filterToAdd.userFilterCriteriaId = 2; + + // Because this filter used the criteria type "Assigned" it is necessary + // to specify what advertisers this user has access to. This next step + // would be skipped for the criteria types "All" and "None". + + // Create an object filter to represent each object the user has access + // to. Since this is an advertiser filter, an object filter represents an + // advertiser. The total of object filter objects will need to match the + // total of advertisers the user is assigned. + ObjectFilter allowedObject = new ObjectFilter(); + + // Insert the advertiser id of an advertiser assigned to this user. + allowedObject.id = advertiserId; + + // Create any additional object filters that are needed, then add these + // settings to the user filter + filterToAdd.objectFilters = new ObjectFilter[] {allowedObject}; + + try { + // Retrieve the user who is to be modified. + User userToModify = service.getUser(userId); + + // Add the filter to the user. The following method is specific to + // advertiser filters. See the User class documentation for the names of + // methods for other filters. + userToModify.advertiserUserFilter = filterToAdd; + + // Save the changes made and display a success message. + UserSaveResult userSaveResult = service.saveUser(userToModify); + Console.WriteLine("User with id \"{0}\" was modified.", userSaveResult.id); + } catch (Exception ex) { + Console.WriteLine("Failed to add advertiser user filter. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/AssignAdvertisersToAdvertiserGroup.cs b/examples/Dfa/CSharp/v1_19/AssignAdvertisersToAdvertiserGroup.cs new file mode 100644 index 00000000000..2fe360252d2 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/AssignAdvertisersToAdvertiserGroup.cs @@ -0,0 +1,84 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example assigns a list of advertisers to an advertiser group. + /// + /// CAUTION: An advertiser that has campaigns associated with it cannot be + /// removed from an advertiser group once assigned. + /// + /// Tags: advertisergroup.assignAdvertisersToAdvertiserGroup + /// + class AssignAdvertisersToAdvertiserGroup : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example assigns a list of advertisers to an advertiser group. \n\n" + + "CAUTION: An advertiser that has campaigns associated with it cannot be removed " + + "from an advertiser group once assigned."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new AssignAdvertisersToAdvertiserGroup(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create AdvertiserGroupRemoteService instance. + AdvertiserGroupRemoteService service = (AdvertiserGroupRemoteService) user.GetService( + DfaService.v1_19.AdvertiserGroupRemoteService); + + long[] advertiserIds = new long[] { + long.Parse(_T("INSERT_ADVERTISER_ID1_HERE")), + long.Parse(_T("INSERT_ADVERTISER_ID2_HERE")) + }; + + long advertiserGroupId = long.Parse(_T("INSERT_ADVERTISER_GROUP_ID_HERE")); + + try { + // Assign the advertisers to the advertiser group. + service.assignAdvertisersToAdvertiserGroup(advertiserGroupId, advertiserIds); + + Console.WriteLine("Assigned advertisers to advertiser group successfully."); + } catch (Exception ex) { + Console.WriteLine("Failed to add advertisers to advertiser group. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/AssignCreativesToPlacements.cs b/examples/Dfa/CSharp/v1_19/AssignCreativesToPlacements.cs new file mode 100644 index 00000000000..a9eafa1f864 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/AssignCreativesToPlacements.cs @@ -0,0 +1,91 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example assigns creatives to placements and creates a unique ad + /// for each assignment. To get creatives, run GetCreatives.cs. To get + /// placements, run GetPlacement.cs. + /// + /// Tags: creative.assignCreativesToPlacements + /// + class AssignCreativesToPlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example assigns creatives to placements and creates a unique ad for " + + "each assignment. To get creatives, run GetCreatives.cs. To get placements, run " + + "GetPlacement.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new AssignCreativesToPlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeRemoteService instance. + CreativeRemoteService service = (CreativeRemoteService) user.GetService( + DfaService.v1_19.CreativeRemoteService); + + long creativeId = long.Parse(_T("INSERT_CREATIVE_ID")); + long placementId = long.Parse(_T("INSERT_PLACEMENT_ID")); + + // Create creative placement assignment structure. + CreativePlacementAssignment creativePlacementAssignment = + new CreativePlacementAssignment(); + creativePlacementAssignment.creativeId = creativeId; + creativePlacementAssignment.placementId = placementId; + creativePlacementAssignment.placementIds = new long[] {placementId}; + + try { + // Assign creatives to placements. + CreativePlacementAssignmentResult[] results = + service.assignCreativesToPlacements( + new CreativePlacementAssignment[] {creativePlacementAssignment}); + // Display new ads that resulted from the assignment. + foreach (CreativePlacementAssignmentResult result in results) { + Console.WriteLine("Ad with name \"{0}\" and id \"{1}\" was created.", result.adName, + result.adId); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create ad. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/Authenticate.cs b/examples/Dfa/CSharp/v1_19/Authenticate.cs new file mode 100644 index 00000000000..f7aad2798fc --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/Authenticate.cs @@ -0,0 +1,94 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example authenticates using your DFA user name and password, + /// and displays the user profile token, DFA account name and id. If you are + /// setting username and password in your application's app.config and + /// creating a DfaUser using the default constructor, then you don't need to + /// obtain an authToken; the DfaUser does it for you at runtime based on your + /// app.config settings. If you wish to set authToken in your app.config or + /// create DfaUser using custom configuration, then you can run this example + /// to obtain an authToken. See GetAdTypesNoConfig.cs to see how to construct + /// a DfaUser with custom configuration. + /// + /// Tags: login.authenticate + /// + class Authenticate : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example authenticates using your DFA user name and password, and" + + " displays the user profile token, DFA account name and id. If you are setting" + + " username and password in your application's app.config and creating a DfaUser" + + " using the default constructor, then you don't need to obtain an authToken; the" + + " DfaUser does it for you at runtime based on your app.config settings. If you wish" + + " to set authToken in your app.config or create DfaUser using custom configuration," + + " then you can run this example to obtain an authToken. See GetAdTypesNoConfig.cs" + + " to see how to construct a DfaUser with custom configuration."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new Authenticate(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create LoginRemoteService instance. + LoginRemoteService service = (LoginRemoteService) user.GetService( + DfaService.v1_19.LoginRemoteService); + + // Provide user name and password. + String username = _T("INSERT_USER_NAME_HERE"); + String password = _T("INSERT_PASSWORD_HERE"); + + try { + // Authenticate. + UserProfile userProfile = service.authenticate(username, password); + + // Display user profile token, DFA account name and id. + Console.WriteLine("User profile token is \"{0}\", DFA account name is \"{1}\", and " + + "DFA account id is \"{2}\".", userProfile.token, userProfile.networkName, + userProfile.networkId); + } catch (Exception ex) { + Console.WriteLine("Failed to authenticate user. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/CreateAdvertiser.cs b/examples/Dfa/CSharp/v1_19/CreateAdvertiser.cs new file mode 100644 index 00000000000..63eb55557a8 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/CreateAdvertiser.cs @@ -0,0 +1,89 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example creates an advertiser in a given DFA network. To get + /// the network id, run Authenticate.cs. + /// + /// Tags: advertiser.saveAdvertiser + /// + class CreateAdvertiser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates an advertiser in a given DFA network. To get the " + + "network id, run Authenticate.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateAdvertiser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create AdvertiserRemoteService instance. + AdvertiserRemoteService service = (AdvertiserRemoteService) user.GetService( + DfaService.v1_19.AdvertiserRemoteService); + + long networkId = long.Parse(_T("INSERT_NETWORK_ID_HERE")); + string advertiserName = _T("INSERT_ADVERTISER_NAME_HERE"); + + // Create advertiser structure. + Advertiser advertiser = new Advertiser(); + advertiser.name = advertiserName; + advertiser.networkId = networkId; + advertiser.id = 0; + advertiser.advertiserGroupId = 0; + advertiser.approved = true; + + try { + // Create advertiser. + AdvertiserSaveResult result = service.saveAdvertiser(advertiser); + if (result != null) { + // Display advertiser id. + Console.WriteLine("Advertiser with id \"{0}\" was created.", result.id); + } else { + Console.WriteLine("Could not create advertiser for the specified network id."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create advertiser. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/CreateAdvertiserGroup.cs b/examples/Dfa/CSharp/v1_19/CreateAdvertiserGroup.cs new file mode 100644 index 00000000000..baa7d835521 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/CreateAdvertiserGroup.cs @@ -0,0 +1,83 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example creates an advertiser group. + /// + /// Tags: advertisergroup.saveAdvertiserGroup + /// + class CreateAdvertiserGroup : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates an advertiser group."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateAdvertiserGroup(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create AdvertiserGroupRemoteService instance. + AdvertiserGroupRemoteService service = (AdvertiserGroupRemoteService) user.GetService( + DfaService.v1_19.AdvertiserGroupRemoteService); + + string advertiserGroupName = _T("INSERT_ADVERTISER_GROUP_NAME_HERE"); + + // Create advertiser group structure. + AdvertiserGroup advertiserGroup = new AdvertiserGroup(); + advertiserGroup.id = 0; + advertiserGroup.name = advertiserGroupName; + + try { + // Create advertiser group. + AdvertiserGroupSaveResult advertiserGroupSaveResult = + service.saveAdvertiserGroup(advertiserGroup); + + // Display advertiser group id. + Console.WriteLine("Advertiser Group with id \"{0}\" was created.", + advertiserGroupSaveResult.id); + + } catch (Exception ex) { + Console.WriteLine("Failed to create advertiser group. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/CreateCampaign.cs b/examples/Dfa/CSharp/v1_19/CreateCampaign.cs new file mode 100644 index 00000000000..b6c3cc50c10 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/CreateCampaign.cs @@ -0,0 +1,97 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example creates a campaign in a given advertiser. To create an + /// advertiser, run CreateAdvertiser.cs. + /// + /// Tags: campaign.saveCampaign + /// + class CreateCampaign : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a campaign in a given advertiser. To create an " + + "advertiser, run CreateAdvertiser.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCampaign(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CampaignRemoteService instance. + CampaignRemoteService service = (CampaignRemoteService) user.GetService( + DfaService.v1_19.CampaignRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + string campaignName = _T("INSERT_CAMPAIGN_NAME_HERE"); + string url = _T("INSERT_LANDING_PAGE_URL_HERE"); + string landingPageName = _T("INSERT_LANDING_PAGE_NAME_HERE"); + + // Create campaign structure. + Campaign campaign = new Campaign(); + campaign.advertiserId = advertiserId; + campaign.id = 0; + campaign.name = campaignName; + + campaign.startDate = DateTime.Now; + campaign.endDate = DateTime.Now.AddMonths(1); + + // Create & set default landing page. + LandingPage defaultLandingPage = new LandingPage(); + defaultLandingPage.id = 0; + defaultLandingPage.name = landingPageName; + defaultLandingPage.url = url; + + try { + campaign.defaultLandingPageId = service.saveLandingPage(defaultLandingPage).id; + + // Create campaign. + CampaignSaveResult result = service.saveCampaign(campaign); + + // Display new campaign id. + Console.WriteLine("Campaign with id \"{0}\" was created.", result.id); + } catch (Exception ex) { + Console.WriteLine("Failed to create campaign. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/CreateContentCategory.cs b/examples/Dfa/CSharp/v1_19/CreateContentCategory.cs new file mode 100644 index 00000000000..d1d65d0cefa --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/CreateContentCategory.cs @@ -0,0 +1,83 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example creates a content category with the given name and + /// description. + /// + /// Tags: contentcategory.saveContentCategory + /// + class CreateContentCategory : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a content category with the given name and description."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateContentCategory(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create ContentCategoryRemoteService instance. + ContentCategoryRemoteService service = (ContentCategoryRemoteService) user.GetService( + DfaService.v1_19.ContentCategoryRemoteService); + + string contentCategoryName = _T("INSERT_CONTENT_CATEGORY_NAME_HERE"); + + // Create content category structure. + ContentCategory contentCategory = new ContentCategory(); + contentCategory.id = 0; + contentCategory.name = contentCategoryName; + + try { + // Create content category. + ContentCategorySaveResult contentCategorySaveResult = + service.saveContentCategory(contentCategory); + + // Display content category id. + Console.WriteLine("Content category with id \"{0}\" was created.", + contentCategorySaveResult.id); + } catch (Exception ex) { + Console.WriteLine("Failed to add content category. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/CreateCreativeField.cs b/examples/Dfa/CSharp/v1_19/CreateCreativeField.cs new file mode 100644 index 00000000000..3612c8951f4 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/CreateCreativeField.cs @@ -0,0 +1,85 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example creates a creative field associated with a given + /// advertiser. To get an advertiser id, run GetAdvertisers.cs. + /// + /// Tags: creativefield.saveCreativeField + /// + class CreateCreativeField : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a creative field associated with a given advertiser. " + + "To get an advertiser id, run GetAdvertisers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreativeField(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeFieldRemoteService instance. + CreativeFieldRemoteService service = (CreativeFieldRemoteService) user.GetService( + DfaService.v1_19.CreativeFieldRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + string creativeFieldName = _T("INSERT_CREATIVE_FIELD_NAME_HERE"); + + // Create creative field structure. + CreativeField creativeField = new CreativeField(); + creativeField.id = -1; + creativeField.name = creativeFieldName; + creativeField.advertiserId = advertiserId; + + try { + // Create creative field. + CreativeFieldSaveResult creativeFieldSaveResult = service.saveCreativeField(creativeField); + + // Display creative field id. + Console.WriteLine("Creative field with id \"{0}\" was created.", + creativeFieldSaveResult.id); + } catch (Exception ex) { + Console.WriteLine("Failed to add creative field. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/CreateCreativeFieldValue.cs b/examples/Dfa/CSharp/v1_19/CreateCreativeFieldValue.cs new file mode 100644 index 00000000000..60f886acf46 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/CreateCreativeFieldValue.cs @@ -0,0 +1,86 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example creates a creative field value associated with a given + /// creative field. To get the creative field id, run GetCreativeFields.cs. + /// + /// Tags: creativefield.saveCreativeFieldValue + /// + class CreateCreativeFieldValue : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a creative field value associated with a given " + + "creative field. To get the creative field id, run GetCreativeFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreativeFieldValue(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeFieldRemoteService instance. + CreativeFieldRemoteService service = (CreativeFieldRemoteService) user.GetService( + DfaService.v1_19.CreativeFieldRemoteService); + + long creativeFieldId = long.Parse(_T("INSERT_CREATIVE_FIELD_ID_HERE")); + String creativeFieldValueName = _T("INSERT_CREATIVE_FIELD_VALUE_NAME_HERE"); + + // Create creative field value structure. + CreativeFieldValue creativeFieldValue = new CreativeFieldValue(); + creativeFieldValue.id = -1; + creativeFieldValue.name = creativeFieldValueName; + creativeFieldValue.creativeFieldId = creativeFieldId; + + try { + // Create creative field value. + CreativeFieldValueSaveResult creativeFieldValueSaveResult = + service.saveCreativeFieldValue(creativeFieldValue); + + // Display creative field value id. + Console.WriteLine("Creative field value with id \"{0}\" was created.", + creativeFieldValueSaveResult.id); + } catch (Exception ex) { + Console.WriteLine("Failed to add creative field value. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/CreateCreativeGroup.cs b/examples/Dfa/CSharp/v1_19/CreateCreativeGroup.cs new file mode 100644 index 00000000000..e89eb15b7bc --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/CreateCreativeGroup.cs @@ -0,0 +1,89 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example creates a creative group associated with a given + /// advertiser. To get an advertiser id, run getAdvertisers.cs. Valid group + /// numbers are limited to 1 or 2. + /// + /// Tags: creativegroup.saveCreativeGroup + /// + class CreateCreativeGroup : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a creative group associated with a given advertiser. " + + "To get an advertiser id, run getAdvertisers.cs. Valid group numbers are limited to" + + " 1 or 2."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreativeGroup(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeGroupRemoteService instance. + CreativeGroupRemoteService service = (CreativeGroupRemoteService) user.GetService( + DfaService.v1_19.CreativeGroupRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + int groupNumber = int.Parse(_T("INSERT_GROUP_NUMBER_HERE")); + string creativeGroupName = _T("INSERT_CREATIVE_GROUP_NAME_HERE"); + + // Create creative group structure. + CreativeGroup creativeGroup = new CreativeGroup(); + creativeGroup.id = -1; + creativeGroup.name = creativeGroupName; + creativeGroup.groupNumber = groupNumber; + creativeGroup.advertiserId = advertiserId; + + try { + // Create creative group. + CreativeGroupSaveResult creativeGroupSaveResult = service.saveCreativeGroup(creativeGroup); + + // Display new creative group id. + Console.WriteLine("Creative group with id \"{0}\" was created.", + creativeGroupSaveResult.id); + } catch (Exception ex) { + Console.WriteLine("Failed to create creative group. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/CreateFlashInpageCreative.cs b/examples/Dfa/CSharp/v1_19/CreateFlashInpageCreative.cs new file mode 100644 index 00000000000..28d12df4656 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/CreateFlashInpageCreative.cs @@ -0,0 +1,114 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example creates a "Flash InPage" creative in a given advertiser + /// or campaign. If no campaign is specified then the creative is created in + /// the advertiser provided. To get assets file names, run CreateHTMLAsset.cs + /// and CreateImageAsset.cs. To get a size id, run GetSize.cs. To get a + /// creative type id, run GetCreativeType.cs. + /// + /// Tags: creative.saveCreative + /// + class CreateFlashInpageCreative : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a 'Flash InPage' creative in a given advertiser " + + "or campaign. If no campaign is specified then the creative is created in the " + + "advertiser provided. To get assets file names, run CreateHTMLAsset.cs and " + + "CreateImageAsset.cs. To get a size id, run GetSize.cs. To get a creative type id, " + + "run GetCreativeType.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateFlashInpageCreative(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeRemoteService instance. + CreativeRemoteService service = (CreativeRemoteService) user.GetService( + DfaService.v1_19.CreativeRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + String creativeName = _T("INSERT_CREATIVE_NAME_HERE"); + String swfAssetFileName = _T("INSERT_SWF_ASSET_FILE_NAME_HERE"); + String imgAssetFileName = _T("INSERT_IMG_ASSET_FILE_NAME_HERE"); + long sizeId = long.Parse(_T("INSERT_SIZE_ID_HERE")); + long typeId = long.Parse(_T("INSERT_TYPE_ID_HERE")); + + // Create flash inpage structure. + FlashInpageCreative flashInpage = new FlashInpageCreative(); + flashInpage.typeId = typeId; + flashInpage.id = 0; + flashInpage.name = creativeName; + flashInpage.advertiserId = advertiserId; + flashInpage.active = true; + flashInpage.codeLocked = true; + flashInpage.sizeId = sizeId; + + // Set parent flash asset structure. + HTMLCreativeFlashAsset parentFlashAsset = new HTMLCreativeFlashAsset(); + parentFlashAsset.assetFilename = swfAssetFileName; + flashInpage.parentFlashAsset = parentFlashAsset; + flashInpage.wmode = "opaque"; + + // Set backup image asset. + HTMLCreativeAsset backupImageAsset = new HTMLCreativeAsset(); + backupImageAsset.assetFilename = imgAssetFileName; + flashInpage.backupImageAsset = backupImageAsset; + + // Set target window for backup image. + TargetWindow backupImageTargetWindow = new TargetWindow(); + backupImageTargetWindow.option = "_blank"; + flashInpage.backupImageTargetWindow = backupImageTargetWindow; + + try { + // Create flash inpage creative. + CreativeSaveResult result = service.saveCreative(flashInpage, 0); + + // Display new creative id. + Console.WriteLine("Flash inpage creative with id \"{0}\" was created.", result.id); + } catch (Exception ex) { + Console.WriteLine("Failed to create advertiser. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/CreateHTMLAsset.cs b/examples/Dfa/CSharp/v1_19/CreateHTMLAsset.cs new file mode 100644 index 00000000000..d5fed602fd1 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/CreateHTMLAsset.cs @@ -0,0 +1,87 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example creates a HTML creative asset in a given advertiser. To + /// create an advertiser, run CreateAdvertiser.cs. + /// + /// Tags: creative.saveCreativeAsset + /// + class CreateHTMLAsset : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a HTML creative asset in a given advertiser. To create " + + "an advertiser, run CreateAdvertiser.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateHTMLAsset(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeRemoteService instance. + CreativeRemoteService service = (CreativeRemoteService) user.GetService( + DfaService.v1_19.CreativeRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + string assetName = _T("INSERT_SWF_ASSET_NAME_HERE"); + string pathToFile = _T("INSERT_PATH_TO_SWF_FILE_HERE"); + + // Set HTML asset Structure. + CreativeAsset swfAsset = new CreativeAsset(); + // Set it to true if this asset is being used for HTML creative. + swfAsset.forHTMLCreatives = true; + swfAsset.advertiserId = advertiserId; + swfAsset.content = MediaUtilities.GetAssetDataFromUrl(new Uri(pathToFile)); + swfAsset.name = assetName; + + try { + //Create asset. + CreativeAssetSaveResult result = service.saveCreativeAsset(swfAsset); + + // Display asset file name. + Console.WriteLine("Asset was saved with file name of \"{0}\".", result.savedFilename); + } catch (Exception ex) { + Console.WriteLine("Failed to create html asset. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/CreateImageAsset.cs b/examples/Dfa/CSharp/v1_19/CreateImageAsset.cs new file mode 100644 index 00000000000..cf42a24b98f --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/CreateImageAsset.cs @@ -0,0 +1,85 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This example creates an image creative asset in a given advertiser. To + /// create an advertiser, run CreateAdvertiser.cs. + /// + /// Tags: creative.saveCreativeAsset + /// + class CreateImageAsset : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example creates an image creative asset in a given advertiser. To create an" + + " advertiser, run CreateAdvertiser.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateImageAsset(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreateRemoteService instance. + CreativeRemoteService service = (CreativeRemoteService) user.GetService( + DfaService.v1_19.CreativeRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + string assetName = _T("INSERT_IMAGE_ASSET_NAME_HERE"); + string pathToFile = _T("INSERT_PATH_TO_IMAGE_ASSET_HERE"); + + // Set image asset structure. + CreativeAsset imgAsset = new CreativeAsset(); + imgAsset.forHTMLCreatives = false; + imgAsset.advertiserId = advertiserId; + imgAsset.content = MediaUtilities.GetAssetDataFromUrl(new Uri(pathToFile)); + imgAsset.name = assetName; + + try { + // Create image asset. + CreativeAssetSaveResult result = service.saveCreativeAsset(imgAsset); + + // Display asset file name. + Console.WriteLine("Asset was saved with file name of \"{0}\".", result.savedFilename); + } catch (Exception ex) { + Console.WriteLine("Failed to create image asset. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/CreateInStreamVideoCreative.cs b/examples/Dfa/CSharp/v1_19/CreateInStreamVideoCreative.cs new file mode 100644 index 00000000000..af0dd9b69c9 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/CreateInStreamVideoCreative.cs @@ -0,0 +1,106 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example creates an In-Stream video creative associated with a + /// given advertiser. If a campaign is specified, the creative is also + /// associated with that campaign. To associate In-Stream assets with an + /// In-Stream video creative, first create the creative and then run + /// UploadInStreamAsset.cs. + /// + /// Tags: creative.saveCreative + /// + class CreateInStreamVideoCreative : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates an In-Stream video creative associated with a given " + + "advertiser. If a campaign is specified, the creative is also associated with that " + + "campaign. To associate In-Stream assets with an In-Stream video creative, first " + + "create the creative and then run UploadInStreamAsset.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateInStreamVideoCreative(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Request the creative service from the service client factory. + CreativeRemoteService creativeService = (CreativeRemoteService) user.GetService( + DfaService.v1_19.CreativeRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + long campaignId = 0; + float videoDuration = float.Parse(_T("INSERT_VIDEO_DURATION_HERE")); + string adId = _T("INSERT_VAST_AD_ID_HERE"); + string surveyUrl = _T("INSERT_VAST_SURVEY_URL_HERE"); + string clickThroughUrl = _T("INSERT_VAST_CLICK_THROUGH_URL_HERE"); + + // Create the In-Stream video creative. + InStreamVideoCreative inStreamVideoCreative = new InStreamVideoCreative(); + inStreamVideoCreative.advertiserId = advertiserId; + inStreamVideoCreative.name = "In-Stream Video Creative #" + GetTimeStamp(); + inStreamVideoCreative.videoDuration = videoDuration; + // In-Stream video creatives have to be created inactive. One can only be + // set active after at least one media file has been added to it or the API + // will return an error message. + inStreamVideoCreative.active = false; + + // Set the video details based on the Video Ad Serving Template (VAST) + // specification. + inStreamVideoCreative.adId = adId; + inStreamVideoCreative.description = "You are viewing an In-Stream Video Creative"; + inStreamVideoCreative.surveyUrl = surveyUrl; + inStreamVideoCreative.clickThroughUrl = clickThroughUrl; + + try { + // Save the In-Stream video creative. + CreativeSaveResult creativeSaveResult = creativeService.saveCreative(inStreamVideoCreative, + campaignId); + + // Display the new creative ID. + Console.WriteLine("In-Stream video creative with ID \"{0}\" was created.", + creativeSaveResult.id); + } catch (Exception ex) { + Console.WriteLine("Failed to create in-stream video creative. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/CreateMobileAsset.cs b/examples/Dfa/CSharp/v1_19/CreateMobileAsset.cs new file mode 100644 index 00000000000..5c0df5c6e46 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/CreateMobileAsset.cs @@ -0,0 +1,87 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example creates a mobile creative asset in a given advertiser. + /// Currently only gif, jpg, jpeg, png and wbmp files are supported as mobile + /// assets. To create an advertiser, run CreateAdvertiser.cs. + /// + /// Tags: creative.saveCreativeAsset + /// + class CreateMobileAsset : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a mobile creative asset in a given advertiser. " + + "Currently only gif, jpg, jpeg, png and wbmp files are supported as mobile assets. " + + "To create an advertiser, run CreateAdvertiser.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateMobileAsset(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreateRemoteService instance. + CreativeRemoteService service = (CreativeRemoteService) user.GetService( + DfaService.v1_19.CreativeRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + string assetName = _T("INSERT_MOBILE_ASSET_NAME_HERE"); + string pathToFile = _T("INSERT_PATH_TO_MOBILE_ASSET_HERE"); + + // Set mobile asset structure. + CreativeAsset mobileAsset = new CreativeAsset(); + mobileAsset.forHTMLCreatives = true; + mobileAsset.advertiserId = advertiserId; + mobileAsset.content = MediaUtilities.GetAssetDataFromUrl(new Uri(pathToFile)); + mobileAsset.name = assetName; + + try { + // Create mobile asset. + CreativeAssetSaveResult result = service.saveCreativeAsset(mobileAsset); + + // Display asset file name. + Console.WriteLine("Asset was saved with file name of \"{0}\".", result.savedFilename); + } catch (Exception ex) { + Console.WriteLine("Failed to create mobile asset. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/CreateMobileCreative.cs b/examples/Dfa/CSharp/v1_19/CreateMobileCreative.cs new file mode 100644 index 00000000000..7ad3c0251a8 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/CreateMobileCreative.cs @@ -0,0 +1,99 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example creates a mobile display creative in a given advertiser + /// or campaign. If no campaign is specified then the creative is created in + /// the advertiser provided. To get assets file names, run CreateHTMLAsset.cs + /// and CreateImageAsset.cs. To get a size id, run GetSize.cs. To get a + /// creative type id, run GetCreativeType.cs. + /// + /// Tags: creative.saveCreative + /// + class CreateMobileCreative : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a mobile display creative in a given advertiser or " + + "campaign. If no campaign is specified then the creative is created in the " + + "advertiser provided. To get assets file names, run CreateHTMLAsset.cs and " + + "CreateImageAsset.cs. To get a size id, run GetSize.cs. To get a creative type " + + "id, run GetCreativeType.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateMobileCreative(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeRemoteService instance. + CreativeRemoteService service = (CreativeRemoteService) user.GetService( + DfaService.v1_19.CreativeRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + String creativeName = _T("INSERT_CREATIVE_NAME_HERE"); + String mobileAssetFileName = _T("INSERT_MOBILE_ASSET_FILE_NAME_HERE"); + long typeId = long.Parse(_T("INSERT_TYPE_ID_HERE")); + + // Set mobile display creative structure. + MobileDisplayCreative mobileDisplayCreative = new MobileDisplayCreative(); + mobileDisplayCreative.advertiserId = advertiserId; + mobileDisplayCreative.name = creativeName; + mobileDisplayCreative.typeId = typeId; + mobileDisplayCreative.archived = false; + + // Set mobile creative asset. + HTMLCreativeAsset htmlCreativeAsset = new MobileDisplayCreativeAsset(); + htmlCreativeAsset.assetFilename = mobileAssetFileName; + mobileDisplayCreative.creativeAssets = new HTMLCreativeAsset[] {htmlCreativeAsset}; + + try { + // Create mobile display creative. + CreativeSaveResult creativeSaveResult = service.saveCreative(mobileDisplayCreative, 0); + + // Display new creative id. + Console.WriteLine("Mobile display creative with id \"{0}\" was created.", + creativeSaveResult.id); + } catch (Exception ex) { + Console.WriteLine("Failed to create display creative. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/CreatePlacement.cs b/examples/Dfa/CSharp/v1_19/CreatePlacement.cs new file mode 100644 index 00000000000..9e7a15ede4e --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/CreatePlacement.cs @@ -0,0 +1,116 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example creates a placement in a given campaign. This code + /// example requires the DFA site id and campaign id in which the placement + /// will be created into. To create a campaign, run CreateCampaign.cs. + /// To get DFA site id, run GetDfaSite.cs. To get a size id, run + /// GetSize.cs. To get placement types, run GetPlacementTypes.cs. To get + /// pricing types, run GetPricingTypes.cs. + /// + /// Tags: placement.savePlacement + /// + class CreatePlacement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a placement in a given campaign. This code example " + + "requires the DFA site id and campaign id in which the placement will be created " + + "into. To create a campaign, run CreateCampaign.cs. To get DFA site id, run " + + "GetDfaSite.cs. To get a size id, run GetSize.cs. To get placement types, run " + + "GetPlacementTypes.cs. To get pricing types, run GetPricingTypes.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreatePlacement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create PlacementRemoteService instance. + PlacementRemoteService service = (PlacementRemoteService) user.GetService( + DfaService.v1_19.PlacementRemoteService); + string placementName = _T("INSERT_PLACEMENT_NAME_HERE"); + long dfaSiteId = long.Parse(_T("INSERT_DFA_SITE_ID_HERE")); + long campaignId = long.Parse(_T("INSERT_CAMPAIGN_ID_HERE")); + int pricingType = int.Parse(_T("INSERT_PRICING_TYPE_HERE")); + int placementType = int.Parse(_T("INSERT_PLACEMENT_TYPE_HERE")); + long sizeId = long.Parse(_T("INSERT_SIZE_ID_HERE")); + + // Create placement structure. + Placement placement = new Placement(); + placement.id = 0; + placement.name = placementName; + placement.campaignId = campaignId; + placement.dfaSiteId = dfaSiteId; + placement.sizeId = sizeId; + + // Set pricing schedule for placement. + PricingSchedule pricingSchedule = new PricingSchedule(); + pricingSchedule.startDate = DateTime.Now; + pricingSchedule.endDate = DateTime.Now.AddMonths(1); + pricingSchedule.pricingType = pricingType; + placement.pricingSchedule = pricingSchedule; + + // Set placement type. + placement.placementType = placementType; + + try { + // Set placement tag settings. + TagSettings tagSettings = new TagSettings(); + PlacementTagOption[] placementTagOptions = service.getRegularPlacementTagOptions(); + int[] tagTypes = new int[placementTagOptions.Length]; + + for (int i = 0; i < placementTagOptions.Length; i++) { + tagTypes[i] = (int) placementTagOptions[i].id; + } + + tagSettings.tagTypes = tagTypes; + placement.tagSettings = tagSettings; + + // Create the placement. + PlacementSaveResult placementSaveResult = service.savePlacement(placement); + + // Display new placment id. + Console.WriteLine("Placment with id \"{0}\" was created.", placementSaveResult.id); + } catch (Exception ex) { + Console.WriteLine("Failed to create placement. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/CreatePlacementStrategy.cs b/examples/Dfa/CSharp/v1_19/CreatePlacementStrategy.cs new file mode 100644 index 00000000000..158f6903b51 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/CreatePlacementStrategy.cs @@ -0,0 +1,84 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example creates a placement strategy with the given name. + /// + /// Tags: strategy.savePlacementStrategy + /// + class CreatePlacementStrategy : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a placement strategy with the given name."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreatePlacementStrategy(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create PlacementStrategyRemoteService instance. + PlacementStrategyRemoteService service = (PlacementStrategyRemoteService) user.GetService( + DfaService.v1_19.PlacementStrategyRemoteService); + + String placementStrategyName = _T("INSERT_PLACEMENT_STRATEGY_NAME_HERE"); + + // Create placement strategy structure. + PlacementStrategy placementStrategy = new PlacementStrategy(); + placementStrategy.id = 0; + placementStrategy.name = placementStrategyName; + + try { + // Create placement strategy. + PlacementStrategySaveResult placementStrategySaveResult = + service.savePlacementStrategy(placementStrategy); + + if (placementStrategySaveResult != null) { + // Display placement strategy id. + Console.WriteLine("Placement Strategy with id \"{0}\" was created.", + placementStrategySaveResult.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create placement strategy. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/CreateRotationGroup.cs b/examples/Dfa/CSharp/v1_19/CreateRotationGroup.cs new file mode 100644 index 00000000000..b55b0fc943d --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/CreateRotationGroup.cs @@ -0,0 +1,123 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example creates a rotation group ad in a given campaign. To get + /// ad types run GetAdTypes.cs. Start and end date for the ad must be within + /// campaign start and end dates. To create creatives, run + /// CreateCreatives.cs. To get available placements, run GetPlacement.cs. + /// To get a size id, run GetSize.cs. + /// + /// Tags: ad.saveAd + /// + class CreateRotationGroup : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a rotation group ad in a given campaign. To get ad " + + "types run GetAdTypes.cs. Start and end date for the ad must be within campaign " + + "start and end dates. To create creatives, run CreateCreatives.cs. To get " + + "available placements, run GetPlacement.cs. To get a size id, run GetSize.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateRotationGroup(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create AdRemoteService instance. + AdRemoteService service = (AdRemoteService) user.GetService( + DfaService.v1_19.AdRemoteService); + + long campaignId = long.Parse(_T("INSERT_CAMPAIGN_ID_HERE")); + long sizeId = long.Parse(_T("INSERT_SIZE_ID_HERE")); + long creativeId = long.Parse(_T("INSERT_CREATIVE_ID_HERE")); + long placementId = long.Parse(_T("INSERT_PLACEMENT_ID_HERE")); + String adName = _T("INSERT_AD_NAME_HERE"); + long typeId = long.Parse(_T("INSERT_AD_TYPEID_HERE")); + + // Create rotation group structure. + RotationGroup rotationGroup = new RotationGroup(); + rotationGroup.id = 0; + rotationGroup.name = adName; + rotationGroup.active = true; + rotationGroup.archived = false; + rotationGroup.campaignId = campaignId; + rotationGroup.sizeId = sizeId; + rotationGroup.typeId = typeId; + rotationGroup.priority = 12; + rotationGroup.ratio = 1; + + // Set ad start and end dates. + rotationGroup.startTime = DateTime.Today.AddDays(1); + rotationGroup.endTime = DateTime.Today.AddMonths(1); + + // Add creatives to the ad. + CreativeAssignment creativeAssignment = new CreativeAssignment(); + creativeAssignment.active = true; + creativeAssignment.creativeId = creativeId; + + // Create click through url. + ClickThroughUrl clickThroughUrl = new ClickThroughUrl(); + clickThroughUrl.defaultLandingPageUsed = true; + clickThroughUrl.landingPageId = 0; + creativeAssignment.clickThroughUrl = clickThroughUrl; + + // Create creative assigments. + rotationGroup.creativeAssignments = new CreativeAssignment[] {creativeAssignment}; + rotationGroup.rotationType = 1; + + // Assign ad to placement. + PlacementAssignment placementAssignment = new PlacementAssignment(); + placementAssignment.active = true; + placementAssignment.placementId = placementId; + rotationGroup.placementAssignments = new PlacementAssignment[] {placementAssignment}; + + try { + // Create rotation group. + AdSaveResult result = service.saveAd(rotationGroup); + + // Display new ad id. + Console.WriteLine("Ad with id \"{0}\" was created.", result.id); + } catch (Exception ex) { + Console.WriteLine("Failed to create rotation group. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/CreateSpotlightActivity.cs b/examples/Dfa/CSharp/v1_19/CreateSpotlightActivity.cs new file mode 100644 index 00000000000..c7e65c57dda --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/CreateSpotlightActivity.cs @@ -0,0 +1,98 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example creates a spotlight activity in a given activity group. + /// To create an activity group, run CreateSpotlightActivityGroup.cs. To get + /// tag methods types, run GetTagMethodTypes.cs. To get activity type ids, + /// run GetActivityTypes.cs. To get available countries, run GetCountries.cs. + /// + /// Tags: spotlight.saveSpotlightActivity + /// + class CreateSpotlightActivity : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a spotlight activity in a given activity group. To " + + "create an activity group, run CreateSpotlightActivityGroup.cs. To get tag methods " + + "types, run GetTagMethodTypes.cs. To get activity type ids, run GetActivityTypes.cs" + + ". To get available countries, run GetCountries.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateSpotlightActivity(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create SpotlightRemoteService instance. + SpotlightRemoteService service = (SpotlightRemoteService) user.GetService( + DfaService.v1_19.SpotlightRemoteService); + + long activityGroupId = long.Parse(_T("INSERT_ACTIVITY_GROUP_ID_HERE")); + long activityTypeId = long.Parse(_T("INSERT_ACTIVITY_TYPE_ID_HERE")); + long tagMethodTypeId = long.Parse(_T("INSERT_TAG_METHOD_TYPE_ID_HERE")); + long countryId = long.Parse(_T("INSERT_COUNTRY_ID_HERE")); + string url = _T("INSERT_EXPECTED_URL_HERE"); + string activityName = _T("INSERT_ACTIVITY_NAME_HERE"); + + // Set spotlight activity structure. + SpotlightActivity spotActivity = new SpotlightActivity(); + spotActivity.id = 0; + spotActivity.activityGroupId = activityGroupId; + spotActivity.activityTypeId = activityTypeId; + spotActivity.tagMethodTypeId = tagMethodTypeId; + spotActivity.name = activityName; + spotActivity.expectedUrl = url; + spotActivity.countryId = countryId; + + try { + // Create the spotlight tag activity. + SpotlightActivitySaveResult result = service.saveSpotlightActivity(spotActivity); + + // Display new spotlight activity id. + if (result != null) { + Console.WriteLine("Spotlight activity with id \"{0}\" was created.", result.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create spotlight activity. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/CreateSpotlightActivityGroup.cs b/examples/Dfa/CSharp/v1_19/CreateSpotlightActivityGroup.cs new file mode 100644 index 00000000000..9d13a85d904 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/CreateSpotlightActivityGroup.cs @@ -0,0 +1,91 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example creates a new activity group for a given spotlight + /// configuration. To get spotLight tag configuration, run GetAdvertisers.cs. + /// To get activity types, run GetActivityTypes.cs. + /// + /// Tags: spotlight.saveSpotlightActivityGroup + /// + class CreateSpotlightActivityGroup : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new activity group for a given spotlight " + + "configuration. To get spotLight tag configuration, run GetAdvertisers.cs. To get " + + "activity types, run GetActivityTypes.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateSpotlightActivityGroup(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create SpotlightRemoteService instance. + SpotlightRemoteService service = (SpotlightRemoteService) user.GetService( + DfaService.v1_19.SpotlightRemoteService); + + long spotlightConfigurationId = long.Parse(_T("INSERT_SPOTLIGHT_CONFIGURATION_ID_HERE")); + int activityType = int.Parse(_T("INSERT_ACTIVITY_TYPE_HERE")); + string groupName = _T("INSERT_GROUP_NAME_HERE"); + + // Set spotlight activity group structure. + SpotlightActivityGroup spotlightActivityGroup = new SpotlightActivityGroup(); + spotlightActivityGroup.id = 0; + spotlightActivityGroup.spotlightConfigurationId = spotlightConfigurationId; + spotlightActivityGroup.groupType = activityType; + spotlightActivityGroup.name = groupName; + + try { + // Create the activity group. + SpotlightActivityGroupSaveResult result = service.saveSpotlightActivityGroup( + spotlightActivityGroup); + + // Display activity group id. + if (result != null) { + Console.WriteLine("Activity group with id \"{0}\" was created.", result.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create spotlight activity group. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/CreateSubnetwork.cs b/examples/Dfa/CSharp/v1_19/CreateSubnetwork.cs new file mode 100644 index 00000000000..b9398d81303 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/CreateSubnetwork.cs @@ -0,0 +1,92 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example creates a subnetwork in a given DFA network. To get + /// the network id, run Authenticate.cs. To get the available permissions, + /// run GetAvailablePermissions.cs. + /// + /// Tags: subnetwork.saveSubnetwork + /// + class CreateSubnetwork : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a subnetwork in a given DFA network. To get the " + + "network id, run Authenticate.cs. To get the available permissions, run " + + "GetAvailablePermissions.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateSubnetwork(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create SubnetworkRemoteService instance. + SubnetworkRemoteService service = (SubnetworkRemoteService) user.GetService( + DfaService.v1_19.SubnetworkRemoteService); + + long networkId = long.Parse(_T("INSERT_NETWORK_ID_HERE")); + String subnetworkName = _T("INSERT_SUBNETWORK_NAME_HERE"); + long permission1 = long.Parse(_T("INSERT_FIRST_PERMISSION_ID_HERE")); + long permission2 = long.Parse(_T("INSERT_SECOND_PERMISSION_ID_HERE")); + + // Create subnetwork structure. + Subnetwork subnetwork = new Subnetwork(); + subnetwork.id = 0; + subnetwork.name = subnetworkName; + subnetwork.networkId = networkId; + + // Create an array of all permissions assigned to this subnetwork and add + // it to the subnetwork structure. To get list of available permissions, + // run GetAvailablePermissions.cs. + subnetwork.availablePermissions = new long[] {permission1, permission2}; + + try { + // Create subnetwork. + SubnetworkSaveResult subnetworkSaveResult = service.saveSubnetwork(subnetwork); + + // Display subnetwork id. + Console.WriteLine("Subnetwork with id \"{0}\" was created.", subnetworkSaveResult.id); + } catch (Exception ex) { + Console.WriteLine("Failed to create subnetwork. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/CreateUserRole.cs b/examples/Dfa/CSharp/v1_19/CreateUserRole.cs new file mode 100644 index 00000000000..01674320d36 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/CreateUserRole.cs @@ -0,0 +1,102 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example creates a user role in a given DFA subnetwork. To get + /// the subnetwork id, run GetSubnetworks.cs. To get the available + /// permissions, run GetAvailablePermissions.cs. To get the parent user role + /// id, run GetUserRoles.cs. + /// + /// Tags: userrole.saveUserRole + /// + class CreateUserRole : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a user role in a given DFA subnetwork. To get the " + + "subnetwork id, run GetSubnetworks.cs. To get the available permissions, run " + + "GetAvailablePermissions.cs. To get the parent user role id, run GetUserRoles.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateUserRole(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create UserRoleRemoteService instance. + UserRoleRemoteService service = (UserRoleRemoteService) user.GetService( + DfaService.v1_19.UserRoleRemoteService); + + String userRoleName = _T("INSERT_USER_ROLE_NAME_HERE"); + long subnetworkId = long.Parse(_T("INSERT_SUBNETWORK_ID_HERE")); + long parentUserRoleId = long.Parse(_T("INSERT_PARENT_USER_ROLE_ID_HERE")); + long permission1Id = long.Parse(_T("INSERT_FIRST_PERMISSION_ID_HERE")); + long permission2Id = long.Parse(_T("INSERT_SECOND_PERMISSION_ID_HERE")); + + // Create user role structure. + UserRole userRole = new UserRole(); + userRole.id = 0; + userRole.name = userRoleName; + userRole.subnetworkId = subnetworkId; + userRole.parentUserRoleId = parentUserRoleId; + + // Create a permission object to represent each permission this user role + // has. + Permission permission1 = new Permission(); + permission1.id = permission1Id; + Permission permission2 = new Permission(); + permission2.id = permission2Id; + + // Add the permissions to the user role. + userRole.permissions = new Permission[] {permission1, permission2}; + + try { + // Create user role. + UserRoleSaveResult userRoleResult = service.saveUserRole(userRole); + + if (userRoleResult != null) { + // Display user role id. + Console.WriteLine("User role with id \"{0} was created.", userRoleResult.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create user role. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/DownloadTags.cs b/examples/Dfa/CSharp/v1_19/DownloadTags.cs new file mode 100644 index 00000000000..376fac2b500 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/DownloadTags.cs @@ -0,0 +1,99 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example downloads HTML Tags for a given campaign and placement + /// id. To create campaigns, run CreateCampaigns.cs. To create placements, + /// run GetPlacements.cs. + /// + /// Tags: placement.getPlacementTagData + /// + class DownloadTags : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example downloads HTML Tags for a given campaign and placement id. To " + + "create campaigns, run CreateCampaigns.cs. To create placements, run GetPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DownloadTags(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create PlacementRemoteService instance. + PlacementRemoteService service = (PlacementRemoteService) user.GetService( + DfaService.v1_19.PlacementRemoteService); + + long campaignId = long.Parse(_T("INSERT_CAMPAIGN_ID_HERE")); + long placementId = long.Parse(_T("INSERT_PLACEMENT_ID_HERE")); + + // Set placement tag search criteria. + PlacementTagCriteria placementTagCriteria = new PlacementTagCriteria(); + placementTagCriteria.id = placementId; + + try { + // Get placement tag options. + PlacementTagOption[] placementTagOptions = service.getRegularPlacementTagOptions(); + + long[] tagOptionIds = new long[placementTagOptions.Length]; + + // Add all types of tags to the tag option structure. + for (int i = 0; i < placementTagOptions.Length; i++) { + tagOptionIds[i] = placementTagOptions[i].id; + } + + placementTagCriteria.tagOptionIds = tagOptionIds; + + // Get HTML tags for the placements. + PlacementTagData placementTagData = service.getPlacementTagData(campaignId, + new PlacementTagCriteria[] {placementTagCriteria}); + + // Display tags for the placement id used as criteria. + PlacementTagInfo temp = placementTagData.placementTagInfos[0]; + Console.WriteLine("Placement name : {0}\nIframe/JavaScript tag : {1}\nStandard tag : {2}" + + "\nInternal Redirect tag : {3}", temp.placement.name, temp.iframeJavaScriptTag, + temp.javaScriptTag, temp.internalRedirectTag); + } catch (Exception ex) { + Console.WriteLine("Failed to download tags. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetActivityGroups.cs b/examples/Dfa/CSharp/v1_19/GetActivityGroups.cs new file mode 100644 index 00000000000..fef436f6990 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetActivityGroups.cs @@ -0,0 +1,91 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example displays activity groups names and ids for a given + /// advertiser. To create an advertiser, run CreateAdvertiser.cs. + /// + /// Tags: spotlight.getSpotlightActivityGroups + /// + class GetActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays activity groups names and ids for a given advertiser. " + + "To create an advertiser, run CreateAdvertiser.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create SpotlightRemoteService instance. + SpotlightRemoteService service = (SpotlightRemoteService) user.GetService( + DfaService.v1_19.SpotlightRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + + // Set activity group search criteria structure and + // use advertiser id as search criteria. + SpotlightActivityGroupSearchCriteria activityGroupSearchCriteria = + new SpotlightActivityGroupSearchCriteria(); + activityGroupSearchCriteria.advertiserId = advertiserId; + + try { + // Get activity group. + SpotlightActivityGroupRecordSet recordSet = + service.getSpotlightActivityGroups(activityGroupSearchCriteria); + + // Display activity group names and ids. + if (recordSet.records != null) { + foreach (SpotlightActivityGroup result in recordSet.records) { + Console.WriteLine("Activity group with name \"{0}\" and id \"{1}\" was found.", + result.name, result.id); + } + } else { + Console.WriteLine("No activity groups found for your criteria."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve activity groups. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetActivityTypes.cs b/examples/Dfa/CSharp/v1_19/GetActivityTypes.cs new file mode 100644 index 00000000000..14bb9626158 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetActivityTypes.cs @@ -0,0 +1,76 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example displays activity type names and ids. + /// + /// Tags: spotlight.getSpotlightActivityTypes + /// + class GetActivityTypes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays activity type names and ids."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActivityTypes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create SpotlightRemoteService instance. + SpotlightRemoteService service = (SpotlightRemoteService) user.GetService( + DfaService.v1_19.SpotlightRemoteService); + + try { + // Get activity types. + SpotlightActivityType[] spotlightActivityTypes = service.getSpotlightActivityTypes(); + + // Display activity type names and ids. + foreach (SpotlightActivityType result in spotlightActivityTypes) { + Console.WriteLine("Activity type with name \"{0}\" and id \"{1}\" was found.", + result.name, result.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve activity types. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetAdTypes.cs b/examples/Dfa/CSharp/v1_19/GetAdTypes.cs new file mode 100644 index 00000000000..208355b5edf --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetAdTypes.cs @@ -0,0 +1,78 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example retrieves available ad types and displays the name and + /// id for each type. + /// + /// Tags: ad.getAdTypes + /// + class GetAdTypes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves available ad types and displays the name and id for " + + "each type."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdTypes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create AdRemoteService instance. + AdRemoteService service = (AdRemoteService) user.GetService( + DfaService.v1_19.AdRemoteService); + + try { + // Get ad types. + AdType[] adTypes = service.getAdTypes(); + + // Display ad type and its id. + foreach (AdType result in adTypes) { + Console.WriteLine("Ad type with name \"{0}\" and id \"{1}\" was found.", result.name, + result.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve ad types. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetAdTypesNoConfig.cs b/examples/Dfa/CSharp/v1_19/GetAdTypesNoConfig.cs new file mode 100644 index 00000000000..6c256b18cfb --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetAdTypesNoConfig.cs @@ -0,0 +1,100 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example retrieves available ad types and displays the name and + /// id for each type. This also shows how you can set the DfaUser + /// configuration at runtime instead of reading the settings from app.config. + /// To get an authToken, run Authenticate.cs. + /// + /// Tags: ad.getAdTypes + /// + class GetAdTypesNoConfig : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves available ad types and displays the name and id for " + + "each type. This also shows how you can set the DfaUser configuration at runtime " + + "instead of reading the settings from app.config."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdTypesNoConfig(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + Dictionary headers = new Dictionary(); + + string userName = _T("INSERT_USERNAME_HERE"); + string password = _T("INSERT_PASSWORD_HERE"); + string applicationName = _T("INSERT_APPLICATION_NAME_HERE"); + + headers.Add("userName", userName); + headers.Add("password", password); + headers.Add("applicationName", applicationName); + + // If you have already used LoginRemoteService to obtain your token, then + // you can set the authToken header instead of the password header like: + // string authToken = _T("INSERT_AUTH_TOKEN_HERE"); + // headers.Add("authToken", authToken); + + // Since we are creating a custom DfaUser, we don't use the user passed + // as a method argument. + DfaUser user1 = new DfaUser(headers); + + // Create AdRemoteService instance. + AdRemoteService service = (AdRemoteService) user1.GetService( + DfaService.v1_19.AdRemoteService); + + try { + // Get ad types. + AdType[] adTypes = service.getAdTypes(); + + // Display ad type and its id. + foreach (AdType result in adTypes) { + Console.WriteLine("Ad type with name \"{0} and id \"{1}\" was found.", result.name, + result.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve ad types. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetAdvertiserGroups.cs b/examples/Dfa/CSharp/v1_19/GetAdvertiserGroups.cs new file mode 100644 index 00000000000..2935c405748 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetAdvertiserGroups.cs @@ -0,0 +1,92 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example displays advertiser group name, id, and advertiser + /// count for the given search criteria. Results are limited to the first 10 + /// records. + /// + /// Tags: advertisergroup.getAdvertiserGroups + /// + class GetAdvertiserGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays advertiser group name, id, and advertiser count for " + + "the given search criteria. Results are limited to the first 10 records."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdvertiserGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create AdvertiserGroupRemoteService instance. + AdvertiserGroupRemoteService service = (AdvertiserGroupRemoteService) user.GetService( + DfaService.v1_19.AdvertiserGroupRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Create advertiser group search criteria structure. + AdvertiserGroupSearchCriteria advGroupSearchCriteria = new AdvertiserGroupSearchCriteria(); + advGroupSearchCriteria.pageSize = 10; + advGroupSearchCriteria.searchString = searchString; + + try { + // Get advertiser group record set. + AdvertiserGroupRecordSet advertiserGroupRecordSet = + service.getAdvertiserGroups(advGroupSearchCriteria); + + // Display advertiser group names, ids and advertiser count. + if (advertiserGroupRecordSet != null && advertiserGroupRecordSet.records != null) { + foreach (AdvertiserGroup advertiserGroup in advertiserGroupRecordSet.records) { + Console.WriteLine("Advertiser Group with name \"{0}\", id \"{1}\", containing \"{2}\"" + + " advertisers was found.", advertiserGroup.name, advertiserGroup.id, + advertiserGroup.advertiserCount); + } + } else { + Console.WriteLine("No advertiser groups found for your search criteria."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve advertiser groups. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetAdvertisers.cs b/examples/Dfa/CSharp/v1_19/GetAdvertisers.cs new file mode 100644 index 00000000000..e590a4fefbe --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetAdvertisers.cs @@ -0,0 +1,89 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example displays advertiser name, id and spotlight + /// configuration id for the given search criteria. Results are limited to + /// first 10 records. + /// + /// Tags: advertiser.getAdvertisers + /// + class GetAdvertisers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays advertiser name, id and spotlight configuration" + + " id for the given search criteria. Results are limited to first 10 records."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdvertisers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create AdvertiserRemoteService instance. + AdvertiserRemoteService service = (AdvertiserRemoteService) user.GetService( + DfaService.v1_19.AdvertiserRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Create advertiser search criteria structure. + AdvertiserSearchCriteria advSearchCriteria = new AdvertiserSearchCriteria(); + advSearchCriteria.pageSize = 10; + advSearchCriteria.searchString = searchString; + + try { + // Get advertiser record set. + AdvertiserRecordSet recordSet = service.getAdvertisers(advSearchCriteria); + + // Display advertiser names, ids and spotlight configuration ids. + if (recordSet.records != null) { + foreach (Advertiser result in recordSet.records) { + Console.WriteLine("Advertiser with name \"{0}\", id \"{1}\", and spotlight " + + "configuration id \"{2}\" was found.", result.name, result.id, result.spotId); + } + } else { + Console.WriteLine("No advertisers found for your criteria."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve advertisers. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetAvailablePermissions.cs b/examples/Dfa/CSharp/v1_19/GetAvailablePermissions.cs new file mode 100644 index 00000000000..735e05f407a --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetAvailablePermissions.cs @@ -0,0 +1,91 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example displays all of the available permissions that a user + /// role or subnetwork may be endowed with. To get a subnetwork id, run + /// GetSubnetworks.cs. + /// + /// A user role may not be set with more permissions than the subnetwork it + /// belongs to. You may enter a subnetwork id to see the maximum permissions a + /// user role belonging to it can have, or enter "0" as the subnetwork id to + /// see all possible permissions. + /// + /// Tags: userrole.getAvailablePermissions + /// + class GetAvailablePermissions : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays all of the available permissions that a user role " + + "or subnetwork may be endowed with. To get a subnetwork id, run GetSubnetworks.cs.\n\n" + + "A user role may not be set with more permissions than the subnetwork it belongs to. " + + "You may enter a subnetwork id to see the maximum permissions a user role belonging to " + + "it can have, or enter '0' as the subnetwork id to see all possible permissions."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAvailablePermissions(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create UserRoleRemoteService instance. + UserRoleRemoteService service = (UserRoleRemoteService) user.GetService( + DfaService.v1_19.UserRoleRemoteService); + + long subnetworkId = long.Parse(_T("INSERT_SUBNETWORK_ID_HERE")); + + try { + // Get available permissions. + Permission[] permissions = service.getAvailablePermissions(subnetworkId); + + // Display permission name and its id. + if (permissions != null) { + foreach (Permission permission in permissions) { + Console.WriteLine("Permission with name \"{0}\" and id \"{1}\" was found.", + permission.name, permission.id); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to get permission. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetCampaigns.cs b/examples/Dfa/CSharp/v1_19/GetCampaigns.cs new file mode 100644 index 00000000000..9dfdcbd64e2 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetCampaigns.cs @@ -0,0 +1,88 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example gets existing campaigns based on a given search + /// criteria. Results are limited to the first 10. + /// + /// Tags: campaign.getCampaignsByCriteria + /// + class GetCampaigns : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets existing campaigns based on a given search criteria. " + + "Results are limited to the first 10."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCampaigns(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CampaignRemoteService instance. + CampaignRemoteService service = (CampaignRemoteService) user.GetService( + DfaService.v1_19.CampaignRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Create campaign search criteria structure. + CampaignSearchCriteria searchCriteria = new CampaignSearchCriteria(); + searchCriteria.pageSize = 10; + searchCriteria.searchString = searchString; + + try { + // Get the campaigns. + CampaignRecordSet recordSet = service.getCampaignsByCriteria(searchCriteria); + + // Display campaign names and ids. + if (recordSet.records != null) { + foreach (Campaign result in recordSet.records) { + Console.WriteLine("Campaign with name \"{0}\" and id \"{1}\" was found.", + result.name, result.id); + } + } else { + Console.WriteLine("No campaigns found for your search criteria."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve campaigns. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetChangeLogForAdvertiser.cs b/examples/Dfa/CSharp/v1_19/GetChangeLogForAdvertiser.cs new file mode 100644 index 00000000000..a36f3266f79 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetChangeLogForAdvertiser.cs @@ -0,0 +1,104 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example displays the change logs of a specified advertiser + /// object. Results are limited to the first 10 records. + /// + /// A similar pattern can be applied to get change logs for many other object + /// types. Run GetChangeLogObjectTypes.cs for a list of other supported object + /// types and their id numbers. + /// + /// Tags: changelog.getChangeLogRecords + /// + class GetChangeLogForAdvertiser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays the change logs of a specified advertiser object. " + + "Results are limited to the first 10 records.\n\nA similar pattern can be applied " + + "to get change logs for many other object types. Run GetChangeLogObjectTypes.cs " + + "for a list of other supported object types and their id numbers."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetChangeLogForAdvertiser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create ChangeLogRemoteService instance. + ChangeLogRemoteService service = (ChangeLogRemoteService) user.GetService( + DfaService.v1_19.ChangeLogRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + + // Create change log search criteria structure. + ChangeLogRecordSearchCriteria searchCritera = new ChangeLogRecordSearchCriteria(); + searchCritera.pageSize = 10; + searchCritera.objectId = advertiserId; + // The following field has been filled in to choose advertiser change + // logs. This values was determined using GetChangeLogObjectTypes.cs. + searchCritera.objectTypeId = 1; + + try { + // Get change log record set. + ChangeLogRecordSet changeLogRecordSet = service.getChangeLogRecords(searchCritera); + + // Set up a formatter to make the change log timestamps human-readable. + string dateFormat = "yyyy-M-d H:m:s"; + + // Display the contents of each change log record + if (changeLogRecordSet != null && changeLogRecordSet.records != null) { + foreach (ChangeLogRecord changeLogRecord in changeLogRecordSet.records) { + Console.WriteLine("Action \"{0}\", Context \"{1}\", Change Date \"{2}\", New Value " + + "\"{3}\", Old Value \"{4}\", Profile Name \"{5}\" was found.", + changeLogRecord.action, changeLogRecord.context, + changeLogRecord.changeDate.Value.ToString(dateFormat), changeLogRecord.newValue, + changeLogRecord.oldValue, changeLogRecord.username); + } + } else { + Console.WriteLine("No change logs found for your search criteria."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve change logs. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetChangeLogObjectTypes.cs b/examples/Dfa/CSharp/v1_19/GetChangeLogObjectTypes.cs new file mode 100644 index 00000000000..b6015311c19 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetChangeLogObjectTypes.cs @@ -0,0 +1,76 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example displays change log object type names and ids. + /// + /// Tags: changelog.getChangeLogObjectTypes + /// + class GetChangeLogObjectTypes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays change log object type names and ids."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetChangeLogObjectTypes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create ChangeLogRemoteService instance. + ChangeLogRemoteService service = (ChangeLogRemoteService) user.GetService( + DfaService.v1_19.ChangeLogRemoteService); + + try { + // Get change log object types + ChangeLogObjectType[] changeLogObjectTypes = service.getChangeLogObjectTypes(); + + // Display change log object type names and ids. + foreach (ChangeLogObjectType changeLogObjectType in changeLogObjectTypes) { + Console.WriteLine("Change Log Object type with name \"{0}\" and id \"{1}\" was found.", + changeLogObjectType.name, changeLogObjectType.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get change log types. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetContentCategories.cs b/examples/Dfa/CSharp/v1_19/GetContentCategories.cs new file mode 100644 index 00000000000..78b27471211 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetContentCategories.cs @@ -0,0 +1,90 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example displays available content categories for a given search + /// string. Results are limited to 10. + /// + /// Tags: contentcategory.getContentCategories + /// + class GetContentCategories : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays available content categories for a given search " + + "string. Results are limited to 10."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetContentCategories(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeRemoteService instance. + ContentCategoryRemoteService service = (ContentCategoryRemoteService) user.GetService( + DfaService.v1_19.ContentCategoryRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Create content category search criteria structure. + ContentCategorySearchCriteria searchCriteria = new ContentCategorySearchCriteria(); + searchCriteria.pageSize = 10; + searchCriteria.searchString = searchString; + + try { + // Get content category record set. + ContentCategoryRecordSet contentCategoryRecordSet = + service.getContentCategories(searchCriteria); + + // Display content category names, ids and descriptions. + if (contentCategoryRecordSet != null && contentCategoryRecordSet.records != null) { + foreach (ContentCategory contentCategory in contentCategoryRecordSet.records) { + Console.WriteLine("Content category with name \"{0}\" and id \"{1}\" was found.", + contentCategory.name, contentCategory.id); + } + } else { + Console.WriteLine("No content categories found for your search criteria."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get content categories. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetCountries.cs b/examples/Dfa/CSharp/v1_19/GetCountries.cs new file mode 100644 index 00000000000..a6515273762 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetCountries.cs @@ -0,0 +1,83 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example displays the country names, country codes and + /// information whether country supports secure server. + /// + /// Tags: creativefield.getCreativeFields + /// + class GetCountries : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays the country names, country codes and information " + + "whether country supports secure server."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCountries(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create SpotlightRemoteService instance. + SpotlightRemoteService service = (SpotlightRemoteService) user.GetService( + DfaService.v1_19.SpotlightRemoteService); + + // Set search criteria. + CountrySearchCriteria countrySearchCriteria = new CountrySearchCriteria(); + countrySearchCriteria.secure = false; + + try { + // Get countries. + Country[] countries = service.getCountriesByCriteria(countrySearchCriteria); + + // Display country names, codes and secure server support information. + if (countries != null) { + foreach (Country result in countries) { + Console.WriteLine("Country name \"{0}\", country code \"{1}\", supports a secure " + + "server? \"{2}\".", result.name, result.id, result.secure); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve countries. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetCreativeField.cs b/examples/Dfa/CSharp/v1_19/GetCreativeField.cs new file mode 100644 index 00000000000..bc43d8e3b57 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetCreativeField.cs @@ -0,0 +1,94 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example retrieves available creative fields for a given string + /// and displays the name, id, advertiser id, and number of values. Results + /// are limited to the first 10. + /// + /// Tags: creativefield.getCreativeFields + /// + class GetCreativeField : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves available creative fields for a given string and " + + "displays the name, id, advertiser id, and number of values. Results are limited " + + "to the first 10."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeField(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeFieldRemoteService instance. + CreativeFieldRemoteService service = (CreativeFieldRemoteService) user.GetService( + DfaService.v1_19.CreativeFieldRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Set up creative field search criteria structure. + CreativeFieldSearchCriteria creativeFieldSearchCriteria = new CreativeFieldSearchCriteria(); + creativeFieldSearchCriteria.pageSize = 10; + creativeFieldSearchCriteria.searchString = searchString; + + + try { + // Get creative fields for the selected criteria. + CreativeFieldRecordSet creativeFields = + service.getCreativeFields(creativeFieldSearchCriteria); + + // Display creative field names, ids, advertiser ids, and number of values. + if (creativeFields != null && creativeFields.records != null) { + foreach (CreativeField creativeField in creativeFields.records) { + Console.WriteLine("Creative field with name \"{0}\", id \"{1}\", Advertiser id " + + "\"{2}\", and containing \"{3}\" values was found.", creativeField.name, + creativeField.id, creativeField.advertiserId, creativeField.totalNumberOfValues); + } + } else { + Console.WriteLine("No creative fields found for your search criteria"); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve creative fields. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetCreativeFieldValues.cs b/examples/Dfa/CSharp/v1_19/GetCreativeFieldValues.cs new file mode 100644 index 00000000000..cd6a0392f13 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetCreativeFieldValues.cs @@ -0,0 +1,91 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example retrieves available creative field values for a given + /// string and displays the names and ids. + /// + /// Tags: creativefield.getCreativeFieldValues + /// + class GetCreativeFieldValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves available creative field values for a given string " + + "and displays the names and ids."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeFieldValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeFieldRemoteService instance. + CreativeFieldRemoteService service = (CreativeFieldRemoteService) user.GetService( + DfaService.v1_19.CreativeFieldRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Set up creative field value search criteria structure. + CreativeFieldValueSearchCriteria creativeValueSearchCriteria = + new CreativeFieldValueSearchCriteria(); + creativeValueSearchCriteria.pageSize = 10; + creativeValueSearchCriteria.searchString = searchString; + + try { + // Get creative field values for the selected criteria. + CreativeFieldValueRecordSet creativeFieldValues = + service.getCreativeFieldValues(creativeValueSearchCriteria); + + // Display creative field value names and ids. + if (creativeFieldValues != null && creativeFieldValues.records != null) { + foreach (CreativeFieldValue creativeFieldValue in creativeFieldValues.records) { + Console.WriteLine("Creative field value with name \"{0}\" and id \"{1}\" was found.", + creativeFieldValue.name, creativeFieldValue.id); + } + } else { + Console.WriteLine("No creative field values found for your criteria"); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve creative field values. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetCreativeGroups.cs b/examples/Dfa/CSharp/v1_19/GetCreativeGroups.cs new file mode 100644 index 00000000000..1b8bd2ac24e --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetCreativeGroups.cs @@ -0,0 +1,93 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example retrieves available creative groups for a given + /// advertiser and displays the name, id, advertiser id, and group number. + /// To get an advertiser id, run GetAdvertisers.cs. Results are limited + /// to the first 10. + /// + /// Tags: creativegroup.getCreativeGroups + /// + class GetCreativeGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves available creative groups for a given advertiser " + + "and displays the name, id, advertiser id, and group number. To get an advertiser id," + + " run GetAdvertisers.cs. Results are limited to the first 10."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeGroupRemoteService instance. + CreativeGroupRemoteService service = (CreativeGroupRemoteService) user.GetService( + DfaService.v1_19.CreativeGroupRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + + // Set up creative group search criteria structure. + CreativeGroupSearchCriteria creativeGroupSearchCriteria = new CreativeGroupSearchCriteria(); + creativeGroupSearchCriteria.advertiserIds = new long[] {advertiserId}; + + try { + // Get creatives groups for the selected criteria. + CreativeGroupRecordSet creativeGroups = + service.getCreativeGroups(creativeGroupSearchCriteria); + + // Display creative group names, ids, advertiser ids, and group numbers. + if (creativeGroups != null && creativeGroups.records != null) { + foreach (CreativeGroup creativeGroup in creativeGroups.records) { + Console.WriteLine("Creative group with name \"{0}\" , id \"{1}\", advertiser id " + + "\"{2}\" and group number \"{3}\" was found.", creativeGroup.name, + creativeGroup.id, creativeGroup.advertiserId, creativeGroup.groupNumber); + } + } else { + Console.WriteLine("No creative groups found for your search criteria"); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve creative groups. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetCreativeTypes.cs b/examples/Dfa/CSharp/v1_19/GetCreativeTypes.cs new file mode 100644 index 00000000000..c110cf8d658 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetCreativeTypes.cs @@ -0,0 +1,77 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example gets available creative types and displays the name and + /// id for each type. + /// + /// Tags: creative.getCreativeTypes + /// + class GetCreativeTypes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets available creative types and displays the name and id " + + "for each type."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeTypes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeRemoteService instance. + CreativeRemoteService service = (CreativeRemoteService) user.GetService( + DfaService.v1_19.CreativeRemoteService); + + try { + // Get creative types. + CreativeType[] creativeTypes = service.getCreativeTypes(); + + // Display creative types and ids. + foreach (CreativeType result in creativeTypes) { + Console.WriteLine("Creative type name \"{0}\" with id \"{1}\" was found.", + result.name, result.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve creative types. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetCreatives.cs b/examples/Dfa/CSharp/v1_19/GetCreatives.cs new file mode 100644 index 00000000000..6bb80bbbad6 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetCreatives.cs @@ -0,0 +1,90 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example retrieves available creatives for a given advertiser + /// and displays the name and id. To create an advertiser, run + /// CreateAdvertiser.cs. Results are limited to the first 10. + /// + /// Tags: creative.getCreatives + /// + class GetCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves available creatives for a given advertiser and " + + "displays the name and id. To create an advertiser, run CreateAdvertiser.cs. " + + "Results are limited to the first 10."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeRemoteService instance. + CreativeRemoteService service = (CreativeRemoteService) user.GetService( + DfaService.v1_19.CreativeRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + + // Set up creative search criteria structure. + CreativeSearchCriteria creativeSearchCriteria = new CreativeSearchCriteria(); + creativeSearchCriteria.pageSize = 10; + creativeSearchCriteria.advertiserId = advertiserId; + + try { + // Get creatives for the selected criteria. + CreativeRecordSet creatives = service.getCreatives(creativeSearchCriteria); + + // Display creative name and its id. + if (creatives != null && creatives.records != null) { + foreach (CreativeBase result in creatives.records) { + Console.WriteLine("Creative with name \"{0}\" and id \"{1}\" was found.", + result.name, result.id); + } + } else { + Console.WriteLine("No creatives found for your criteria"); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetDFASite.cs b/examples/Dfa/CSharp/v1_19/GetDFASite.cs new file mode 100644 index 00000000000..d122435d855 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetDFASite.cs @@ -0,0 +1,91 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example gets existing DFA sites based on a given search + /// criteria. Results are limited to the first 10. + /// + /// Tags: site.getDfaSites + /// + class GetDFASite : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets existing DFA sites based on a given search criteria. " + + "Results are limited to the first 10."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetDFASite(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create SiteRemoteService instance. + SiteRemoteService service = (SiteRemoteService) user.GetService( + DfaService.v1_19.SiteRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Create DFA site search criteria structure. + DfaSiteSearchCriteria searchCriteria = new DfaSiteSearchCriteria(); + searchCriteria.pageSize = 10; + searchCriteria.searchString = searchString; + + try { + // Get the sites. + + DfaSiteRecordSet dfaSiteRecordSet = service.getDfaSites(searchCriteria); + + // Display DFA site names and ids. + if (dfaSiteRecordSet != null && dfaSiteRecordSet.records != null) { + foreach (DfaSite dfaSite in dfaSiteRecordSet.records) { + Console.WriteLine("DFA site with name \"{0}\" and id \"{1}\" was found.", + dfaSite.name, dfaSite.id); + } + } else { + Console.WriteLine("No DFA sites found for your search criteria."); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve DFA sites. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetPlacementStrategies.cs b/examples/Dfa/CSharp/v1_19/GetPlacementStrategies.cs new file mode 100644 index 00000000000..83a8d484674 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetPlacementStrategies.cs @@ -0,0 +1,91 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example displays available placement strategies for a given + /// search string. Results are limited to 10. + /// + /// Tags: strategy.getPlacementStrategiesByCriteria + /// + class GetPlacementStrategies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays available placement strategies for a given search " + + "string. Results are limited to 10."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPlacementStrategies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create PlacementStrategyRemoteService instance. + PlacementStrategyRemoteService service = (PlacementStrategyRemoteService) user.GetService( + DfaService.v1_19.PlacementStrategyRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Create placement strategy search criteria structure. + PlacementStrategySearchCriteria placementStrategySearchCriteria = + new PlacementStrategySearchCriteria(); + placementStrategySearchCriteria.pageSize = 10; + placementStrategySearchCriteria.searchString = searchString; + + try { + // Get placement strategy record set. + PlacementStrategyRecordSet placementStrategyRecordSet = + service.getPlacementStrategiesByCriteria(placementStrategySearchCriteria); + + // Display placement strategy names, ids and descriptions. + if (placementStrategyRecordSet != null && placementStrategyRecordSet.records != null) { + foreach (PlacementStrategy strategy in placementStrategyRecordSet.records) { + Console.WriteLine("Placement Strategy with name \"{0}\" and id \"{1}\" was found.", + strategy.name, strategy.id); + } + } else { + Console.WriteLine("No placement strategies found for your criteria."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve placement strategies. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetPlacementTypes.cs b/examples/Dfa/CSharp/v1_19/GetPlacementTypes.cs new file mode 100644 index 00000000000..92f8368f656 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetPlacementTypes.cs @@ -0,0 +1,77 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example displays placement type names and ids. + /// + /// Tags: placement.getPlacementTypes + /// + class GetPlacementTypes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays placement type names and ids."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPlacementTypes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create PlacementRemoteService instance. + PlacementRemoteService service = (PlacementRemoteService) user.GetService( + DfaService.v1_19.PlacementRemoteService); + + try { + // Get placement types. + PlacementType[] placements = service.getPlacementTypes(); + + // Display placement type names and ids. + if (placements != null) { + foreach (PlacementType result in placements) { + Console.WriteLine("Placment type with name \"{0}\" and id \"{1}\" was found.", + result.name, result.id); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve placement types. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetPlacements.cs b/examples/Dfa/CSharp/v1_19/GetPlacements.cs new file mode 100644 index 00000000000..336ac53573a --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetPlacements.cs @@ -0,0 +1,88 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example displays available placements for a given search string. + /// Results are limited to 10. + /// + /// Tags: placement.getPlacementsByCriteria + /// + class GetPlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays available placements for a given search string. " + + "Results are limited to 10."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create PlacementRemoteService instance. + PlacementRemoteService service = (PlacementRemoteService) user.GetService( + DfaService.v1_19.PlacementRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_HERE"); + + // Set placement search criteria. + PlacementSearchCriteria searchCriteria = new PlacementSearchCriteria(); + searchCriteria.pageSize = 10; + searchCriteria.searchString = searchString; + + try { + // Get placements. + PlacementRecordSet placements = service.getPlacementsByCriteria(searchCriteria); + + // Display placment names and ids. + if (placements.records != null) { + foreach (Placement result in placements.records) { + Console.WriteLine("Placment with name \"{0}\" and id \"{1}\" was found.", + result.name, result.id); + } + } else { + Console.WriteLine("No placements found for your criteria"); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve placements. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetPricingTypes.cs b/examples/Dfa/CSharp/v1_19/GetPricingTypes.cs new file mode 100644 index 00000000000..cca49d83c5c --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetPricingTypes.cs @@ -0,0 +1,77 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example displays placement pricing type names and ids. + /// + /// Tags: placement.getPricingTypes + /// + class GetPricingTypes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays placement pricing type names and ids."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPricingTypes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create PlacementRemoteService instance. + PlacementRemoteService service = (PlacementRemoteService) user.GetService( + DfaService.v1_19.PlacementRemoteService); + + try { + // Get pricing types. + PricingType[] pricingTypes = service.getPricingTypes(); + + // Display placement type names and ids. + if (pricingTypes != null) { + foreach (PricingType result in pricingTypes) { + Console.WriteLine("Pricing type with name \"{0}\" and id \"{1}\" was found.", + result.name, result.id); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve pricing types. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetReport.cs b/examples/Dfa/CSharp/v1_19/GetReport.cs new file mode 100644 index 00000000000..f930d0e88f4 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetReport.cs @@ -0,0 +1,82 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example fetches information about a report, including its + /// status (pending, running, complete, etc.) and a URL where it can be + /// downloaded if completed. To get a report ID, run RunDeferredReport.cs. + /// + /// Tags: report.getReport + /// + class GetReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example fetches information about a report, including its status " + + "(pending, running, complete, etc.) and a URL where it can be downloaded if " + + "completed. To get a report ID, run RunDeferredReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create ReportRemoteService instance. + ReportRemoteService service = (ReportRemoteService) user.GetService( + DfaService.v1_19.ReportRemoteService); + + long reportId = long.Parse(_T("INSERT_REPORT_ID_HERE")); + + // Create report request object. + ReportRequest reportRequest = new ReportRequest(); + reportRequest.reportId = reportId; + + try { + // Get report information. + ReportInfo reportInfo = service.getReport(reportRequest); + // Display information on the report. + Console.WriteLine("Report with ID '{0}', status of '{1}', and URL of '{2}' was found.", + reportInfo.reportId, reportInfo.status.name, reportInfo.url); + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve report. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetReports.cs b/examples/Dfa/CSharp/v1_19/GetReports.cs new file mode 100644 index 00000000000..3ba98c43b78 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetReports.cs @@ -0,0 +1,94 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example fetches information about all reports generated from + /// the same query, including their status (pending, running, complete, etc.) + /// and URLs where they can be downloaded if completed. There is currently no + /// way to get a query ID through the DFA API; you must use the website + /// interface or the Java DART API instead. + /// + /// Tags: report.getReportsByCriteria + /// + class GetReports : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example fetches information about all reports generated from the " + + "same query, including their status (pending, running, complete, etc.) and URLs " + + "where they can be downloaded if completed. There is currently no way to get a " + + "query ID through the DFA API; you must use the website interface or the Java DART " + + "API instead."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetReports(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create ReportRemoteService instance. + ReportRemoteService service = (ReportRemoteService) user.GetService( + DfaService.v1_19.ReportRemoteService); + + long queryId = long.Parse(_T("INSERT_QUERY_ID_HERE")); + + // Create report search criteria object. + ReportSearchCriteria reportSearchCriteria = new ReportSearchCriteria(); + reportSearchCriteria.queryId = queryId; + + try { + // Get report information. + ReportInfoRecordSet reportInfoRecordSet = + service.getReportsByCriteria(reportSearchCriteria); + + // Display information on reports. + if (reportInfoRecordSet.records != null && reportInfoRecordSet.records.Length > 0) { + foreach (ReportInfo report in reportInfoRecordSet.records) { + Console.WriteLine("Report with ID '{0}', status of '{1}' and URL of '{2}' was found.", + report.reportId, report.status, report.url); + } + } else { + Console.WriteLine("No reports found for your query ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve all reports. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetSize.cs b/examples/Dfa/CSharp/v1_19/GetSize.cs new file mode 100644 index 00000000000..6335ed27287 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetSize.cs @@ -0,0 +1,84 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example gets the size id for a given width and height. + /// + /// Tags: size.getSize + /// + class GetSize : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the size id for a given width and height."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetSize(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create SizeRemoteService instance. + SizeRemoteService service = (SizeRemoteService) user.GetService( + DfaService.v1_19.SizeRemoteService); + + int width = int.Parse(_T("INSERT_WIDTH_HERE")); + int height = int.Parse(_T("INSERT_HEIGHT_HERE")); + + SizeSearchCriteria criteria = new SizeSearchCriteria(); + criteria.width = width; + criteria.height = height; + + try { + // Get size. + SizeRecordSet sizeRecords = service.getSizes(criteria); + + if (sizeRecords.records != null) { + foreach (Size size in sizeRecords.records) { + // Display size id. + Console.WriteLine("Size id for \"{0}\" width and \"{1}\" height is \"{2}\".", + size.width, size.height, size.id); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve size. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetSubnetworks.cs b/examples/Dfa/CSharp/v1_19/GetSubnetworks.cs new file mode 100644 index 00000000000..d7723dea724 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetSubnetworks.cs @@ -0,0 +1,88 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example displays subnetwork names, ids, and subnetwork ids for + /// a given search string. Results are limited to 10. + /// + /// Tags: subnetwork.getSubnetworks + /// + class GetSubnetworks : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays subnetwork names, ids, and subnetwork ids for a given " + + "search string. Results are limited to 10."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetSubnetworks(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create SubnetworkRemoteService instance. + SubnetworkRemoteService service = (SubnetworkRemoteService) user.GetService( + DfaService.v1_19.SubnetworkRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Set subnetwork search criteria. + SubnetworkSearchCriteria searchCriteria = new SubnetworkSearchCriteria(); + searchCriteria.pageSize = 10; + searchCriteria.searchString = searchString; + + try { + // Get subnetworks. + SubnetworkRecordSet subnetworks = service.getSubnetworks(searchCriteria); + + // Display subnetwork names, ids, and subnetwork ids. + if (subnetworks != null && subnetworks.records != null) { + foreach (Subnetwork subNetwork in subnetworks.records) { + Console.WriteLine("Subnetwork with name \"{0}\", id \"{1}\", and Subnetwork id " + + "\"{2}\" was found.", subNetwork.name, subNetwork.id, subNetwork.networkId); + } + } else { + Console.WriteLine("No subnetworks found for your criteria."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve subnetworks. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetTagMethodTypes.cs b/examples/Dfa/CSharp/v1_19/GetTagMethodTypes.cs new file mode 100644 index 00000000000..ba4d1ddce02 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetTagMethodTypes.cs @@ -0,0 +1,76 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example displays activity method type names and ids. + /// + /// Tags: spotlight.getSpotlightTagMethodTypes + /// + class GetTagMethodTypes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays activity method type names and ids."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetTagMethodTypes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create SpotlightRemoteService instance. + SpotlightRemoteService service = (SpotlightRemoteService) user.GetService( + DfaService.v1_19.SpotlightRemoteService); + + try { + // Get method types. + SpotlightTagMethodType[] spotlightTagMethodTypes = service.getSpotlightTagMethodTypes(); + + //Display method type names and ids. + foreach (SpotlightTagMethodType result in spotlightTagMethodTypes) { + Console.WriteLine("Method type with name \"{0}\" and id \"{1}\" was found.", + result.name, result.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve tag method types. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetUserFilterTypes.cs b/examples/Dfa/CSharp/v1_19/GetUserFilterTypes.cs new file mode 100644 index 00000000000..fece5bc1d0c --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetUserFilterTypes.cs @@ -0,0 +1,79 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example displays user filter criteria type names and ids. + /// + /// Tags: user.getAvailableUserFilterCriteriaTypes + /// + class GetUserFilterTypes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays user filter criteria type names and ids."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUserFilterTypes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create UserRemoteService instance. + UserRemoteService service = (UserRemoteService) user.GetService( + DfaService.v1_19.UserRemoteService); + + try { + // Get user filter criteria types. + UserFilterCriteriaType[] userFilterCriteriaTypes = + service.getAvailableUserFilterCriteriaTypes(); + + // Display user filter criteria types. + if (userFilterCriteriaTypes != null) { + foreach (UserFilterCriteriaType userFilterCriteriaType in userFilterCriteriaTypes) { + Console.WriteLine("User Filter Criteria type with name \"{0}\" and id \"{1}\" " + + "was found.", userFilterCriteriaType.name, userFilterCriteriaType.id); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve user filter and criteria types. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetUserRoles.cs b/examples/Dfa/CSharp/v1_19/GetUserRoles.cs new file mode 100644 index 00000000000..884f3512ada --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetUserRoles.cs @@ -0,0 +1,102 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example displays user role name, id, subnetwork id, number of + /// assigned users, and assigned permissions for the given search criteria. + /// Results are limited to the first 10 records. + /// + /// Tags: userrole.getUserRoles + /// + class GetUserRoles : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example displays user role name, id, subnetwork id, number of assigned users" + + ", and assigned permissions for the given search criteria. Results are limited to the" + + " first 10 records."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUserRoles(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create UserRoleRemoteService instance. + UserRoleRemoteService service = (UserRoleRemoteService) user.GetService( + DfaService.v1_19.UserRoleRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Set user role search criteria. + UserRoleSearchCriteria userRoleSearchCriteria = new UserRoleSearchCriteria(); + userRoleSearchCriteria.pageSize = 10; + userRoleSearchCriteria.searchString = searchString; + + try { + // Get user roles that match the search criteria. + UserRoleRecordSet result = service.getUserRoles(userRoleSearchCriteria); + + // Display user role names, ids, subnetwork ids, number of assigned users, + // and assigned permissions. + if (result != null && result.userRoles != null) { + foreach (UserRole userRole in result.userRoles) { + Console.WriteLine("User role with name \"{0}\", id \"{1}\", subnetwork id \"{2}\", " + + "and assigned to \"{3}\" users was found.", userRole.name, userRole.id, + userRole.subnetworkId, userRole.totalAssignedUsers); + + if (userRole.permissions != null && userRole.permissions.Length != 0) { + Console.WriteLine(" The above user role has the following permissions:"); + foreach (Permission permission in userRole.permissions) { + Console.WriteLine(" Permission with name \"{0}\" and id \"{1}\".", + permission.name, permission.id); + } + } else { + Console.WriteLine(" The above user role has no permissions assigned."); + } + } + } else { + Console.WriteLine("No user roles found for your criteria."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve user roles. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/GetUsers.cs b/examples/Dfa/CSharp/v1_19/GetUsers.cs new file mode 100644 index 00000000000..e86e09ba25c --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/GetUsers.cs @@ -0,0 +1,90 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example displays user name, id, network id, subnetwork id, + /// and user group id for the given search criteria. Results are limited + /// to the first 10 records. + /// + /// Tags: user.getUsersByCriteria + /// + class GetUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays user name, id, network id, subnetwork id, and user " + + "group id for the given search criteria. Results are limited to the first 10 records."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create UserRemoteService instance. + UserRemoteService service = (UserRemoteService) user.GetService( + DfaService.v1_19.UserRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Set user search criteria. + UserSearchCriteria searchCriteria = new UserSearchCriteria(); + searchCriteria.pageSize = 10; + searchCriteria.searchString = searchString; + + try { + // Get users that match the search criteria. + UserRecordSet users = service.getUsersByCriteria(searchCriteria); + + // Display user names, ids, network ids, subnetwork ids, and group ids. + if (users != null && users.records != null) { + foreach (User userResult in users.records) { + Console.WriteLine("User with name \"{0}\", id \"{1}\", network id \"{2}\", subnetwork" + + " id \"{3}\", and user group id \"{4}\" was found.", userResult.name, userResult.id, + userResult.networkId, userResult.subnetworkId, userResult.userGroupId); + } + } else { + Console.WriteLine("No users found for your search criteria."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve users. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/ModifyInStreamMediaFilesAndAds.cs b/examples/Dfa/CSharp/v1_19/ModifyInStreamMediaFilesAndAds.cs new file mode 100644 index 00000000000..222d218ebad --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/ModifyInStreamMediaFilesAndAds.cs @@ -0,0 +1,118 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example retrieves an In-Stream video creative and modifies its + /// media files, companion ads, and non-linear ads. You are not given the + /// opportunity to set the fields on these components when they are created by + /// uploading creative assets. Therefore, you must upload the assets first and + /// then set any additional fields in a second request. + /// + /// To create an In-Stream video creative, run CreateInStreamVideoCreative.cs. + /// To add an In-Stream asset to an In-Stream video creative, run + /// UploadInStreamAsset.cs. + /// + /// Tags: creative.saveCreative + /// + class ModifyInStreamMediaFilesAndAds : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves an In-Stream video creative and modifies its media " + + "files, companion ads, and non-linear ads. You are not given the opportunity to " + + "set the fields on these components when they are created by uploading creative " + + "assets. Therefore, you must upload the assets first and then set any additional " + + "fields in a second request.\nTo create an In-Stream video creative, run " + + "CreateInStreamVideoCreative.cs. To add an In-Stream asset to an In-Stream video " + + "creative, run UploadInStreamAsset.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ModifyInStreamMediaFilesAndAds(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Request the creative service from the service client factory. + CreativeRemoteService creativeService = (CreativeRemoteService) user.GetService( + DfaService.v1_19.CreativeRemoteService); + + long creativeId = long.Parse(_T("INSERT_IN_STREAM_VIDEO_CREATIVE_ID_HERE")); + + try { + // Fetch the In-Stream video creative which contains the asset to modify. + CreativeBase rawCreative = creativeService.getCreative(creativeId); + + if (!(rawCreative is InStreamVideoCreative)) { + Console.WriteLine("Unable to update creative with ID \"{0}\": not an In-Stream video " + + "creative.", creativeId); + } else { + InStreamVideoCreative inStreamVideoCreative = (InStreamVideoCreative) rawCreative; + + // Modify the media files, companion ads, and/or non-linear ads. + if (inStreamVideoCreative.mediaFiles != null) { + foreach (InStreamMediaFile mediaFile in inStreamVideoCreative.mediaFiles) { + mediaFile.pickedToServe = !mediaFile.pickedToServe; + } + } + + if (inStreamVideoCreative.companionAds != null) { + foreach (InStreamCompanionAd companionAd in inStreamVideoCreative.companionAds) { + companionAd.altText = companionAd.altText + " Updated."; + } + } + + if (inStreamVideoCreative.nonLinearAds != null) { + foreach (InStreamNonLinearAd nonLinearAd in inStreamVideoCreative.nonLinearAds) { + nonLinearAd.scalable = !nonLinearAd.scalable; + } + } + + CreativeSaveResult creativeSaveResult = + creativeService.saveCreative(inStreamVideoCreative, 0); + + Console.WriteLine("Updated the In-Stream assets of In-Stream video creative with ID " + + "\"{0}\".", creativeSaveResult.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update in-stream assets of in-stream video creative. " + + "Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/RCReport.cs b/examples/Dfa/CSharp/v1_19/RCReport.cs new file mode 100644 index 00000000000..1dad2f03bbd --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/RCReport.cs @@ -0,0 +1,158 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; +using System.Threading; +using System.IO; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example mimics the RCRunner file "RCReport" but uses the DFA + /// API instead of the Java DART API. It shows how to request the generation + /// of a deferred report, how to check to see when it is done, and how to + /// download it when it is completed. + /// + /// Tags: report.getReport, report.runDeferredReport + /// + class RCReport : SampleBase { + /// + /// Time to wait between checks for report status. + /// + private const int TIME_BETWEEN_CHECKS = 10 * 60 * 1000; + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example mimics the RCRunner file 'RCReport' but uses the DFA API " + + "instead of the Java DART API. It shows how to request the generation of a " + + "deferred report, how to check to see when it is done, and how to download it " + + "when it is completed."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + if (args.Length != 4) { + Console.WriteLine("This program requires 4 command line arguments:"); + Console.WriteLine("\t1. DFA username\n\t2. DFA password\n" + + "\t3. Query ID number\n\t4. Output filename."); + Console.WriteLine("Example usage: RCReport.exe username@dfa password456 " + + "12345 report.zip"); + } + + RCReport codeExample = new RCReport(); + Console.WriteLine(codeExample.Description); + DfaUser user = new DfaUser(); + ReportRemoteService reportService = (ReportRemoteService) user.GetService( + DfaService.v1_19.ReportRemoteService); + LoginRemoteService loginService = (LoginRemoteService) user.GetService( + DfaService.v1_19.LoginRemoteService); + + codeExample.ScheduleAndDownloadReport(loginService, reportService, args[0], args[1], + long.Parse(args[2]), args[3]); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + string userName = _T("INSERT_USERNAME_HERE"); + string password = _T("INSERT_PASSWORD_HERE"); + long queryId = long.Parse(_T("INSERT_QUERY_ID_HERE")); + string filePath = _T("INSERT_PATH_TO_SAVE_REPORT_HERE"); + + ReportRemoteService reportService = (ReportRemoteService) user.GetService( + DfaService.v1_19.ReportRemoteService); + LoginRemoteService loginService = (LoginRemoteService) user.GetService( + DfaService.v1_19.LoginRemoteService); + + ScheduleAndDownloadReport(loginService, reportService, userName, password, queryId, filePath); + } + + /// + /// Schedules and downloads a report. + /// + /// The login service instance. + /// The report service instance. + /// The user name to be used for authentication + /// purposes. + /// The password to be used for authentication + /// purposes. + /// The query id to be used for generating reports. + /// + /// The file path to which the downloaded report + /// should be saved. + public void ScheduleAndDownloadReport(LoginRemoteService loginService, + ReportRemoteService reportService, string userName, string password, long queryId, + string filePath) { + + // Override the credentials in App.config with the ones the user + // provided. + string authToken = loginService.authenticate(userName, password).token; + + reportService.Token.Username = userName; + reportService.Token.Password = authToken; + + // Create report request and submit it to the server. + ReportRequest reportRequest = new ReportRequest(); + reportRequest.queryId = queryId; + + try { + ReportInfo reportInfo = reportService.runDeferredReport(reportRequest); + long reportId = reportInfo.reportId; + Console.WriteLine("Report with ID '{0}' has been scheduled.", reportId); + + reportRequest.reportId = reportId; + + while (reportInfo.status.name != "COMPLETE") { + Console.WriteLine("Still waiting for report with ID '{0}', current status is '{1}'.", + reportId, reportInfo.status.name); + Console.WriteLine("Waiting 10 minutes before checking on report status."); + // Wait 10 minutes. + Thread.Sleep(TIME_BETWEEN_CHECKS); + reportInfo = reportService.getReport(reportRequest); + if (reportInfo.status.name == "ERROR") { + throw new Exception("Deferred report failed with errors. Run in the UI to " + + "troubleshoot."); + } + } + + using (FileStream fs = File.OpenWrite(filePath)) { + byte[] bytes = MediaUtilities.GetAssetDataFromUrl(reportInfo.url); + fs.Write(bytes, 0, bytes.Length); + } + + Console.WriteLine("Report successfully downloaded to '{0}'.", filePath); + } catch (Exception ex) { + Console.WriteLine("Failed to schedule and download report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/ReplaceInStreamAsset.cs b/examples/Dfa/CSharp/v1_19/ReplaceInStreamAsset.cs new file mode 100644 index 00000000000..1eebc562a45 --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/ReplaceInStreamAsset.cs @@ -0,0 +1,111 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example replaces an In-Stream asset in an existing In-Stream + /// video creative with a new In-Stream asset. To create an In-Stream video + /// creative, run CreateInStreamVideoCreative.cs. To add an In-Stream asset to + /// an In-Stream video creative, run UploadInStreamAsset.cs. + /// + /// This code example replaces a companion ad asset in the target creative + /// because the companion flag on the + /// InStreamAssetUploadRequest was set to true. + /// You can use the same workflow to replace a non-linear ad by setting the + /// nonLinear flag instead. You may not use this method to swap + /// out media files (a.k.a. video assets). + /// + /// Tags: creative.replaceInStreamAsset + /// + class ReplaceInStreamAsset : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example replaces an In-Stream asset in an existing In-Stream video " + + "creative with a new In-Stream asset. To create an In-Stream video creative, " + + "run CreateInStreamVideoCreative.cs. To add an In-Stream asset to an In-Stream " + + "video creative, run UploadInStreamAsset.cs.\nThis code example replaces a " + + "companion ad asset in the target creative because the companion flag on the " + + "InStreamAssetUploadRequest was set to true. You can use the same workflow to " + + "replace a non-linear ad by setting the nonLinear flag instead. You may not use " + + "this method to swap out media files (a.k.a. video assets)."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ReplaceInStreamAsset(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Request the creative service from the service client factory. + CreativeRemoteService creativeService = (CreativeRemoteService) user.GetService( + DfaService.v1_19.CreativeRemoteService); + + string assetName = _T("INSERT_ASSET_NAME_HERE"); + string pathToFile = _T("INSERT_PATH_TO_FILE_HERE"); + long creativeId = long.Parse(_T("INSERT_IN_STREAM_VIDEO_CREATIVE_ID_HERE")); + string assetToReplace = _T("INSERT_ASSET_TO_REPLACE_HERE"); + + // Create the In-Stream creative asset. + CreativeAsset inStreamVideoAsset = new CreativeAsset(); + inStreamVideoAsset.name = assetName; + inStreamVideoAsset.content = MediaUtilities.GetAssetDataFromUrl( + new Uri(pathToFile).AbsoluteUri); + + // Create an upload request to make this asset a companion ad file for an + // existing In-Stream video creative. + InStreamAssetUploadRequest inStreamAssetUploadRequest = new InStreamAssetUploadRequest(); + inStreamAssetUploadRequest.companion = true; + inStreamAssetUploadRequest.inStreamAsset = inStreamVideoAsset; + inStreamAssetUploadRequest.creativeId = creativeId; + + try { + // Replace the existing asset with a newly uploaded asset. + InStreamVideoCreative inStreamVideoCreative = + creativeService.replaceInStreamAsset(assetToReplace, inStreamAssetUploadRequest); + + // Display a success message. + Console.WriteLine("Replaced companion ad asset \"{0}\" in In-Stream video creative " + + "with ID \"{1}\".%n", assetToReplace, inStreamVideoCreative.id); + + } catch (Exception ex) { + Console.WriteLine("Failed to replace companion ad asset in in-stream video creative. " + + "Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/RunDeferredReport.cs b/examples/Dfa/CSharp/v1_19/RunDeferredReport.cs new file mode 100644 index 00000000000..a320276d49f --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/RunDeferredReport.cs @@ -0,0 +1,86 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example requests the generation of a report. Once the report + /// has been requested, you can continually get updates on the status of the + /// report until it is completed. There is currently no way to get a query ID + /// through the DFA API; you must use the website interface or the Java DART + /// API instead. To request an update on a report's status, run GetReport.cs. + /// + /// Tags: report.runDeferredReport + /// + class RunDeferredReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example requests the generation of a report. Once the report has been " + + "requested, you can continually get updates on the status of the report until it " + + "is completed. There is currently no way to get a query ID through the DFA API; " + + "you must use the website interface or the Java DART API instead. To request an " + + "update on a report's status, run GetReport.cs"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunDeferredReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create ReportRemoteService instance. + ReportRemoteService service = (ReportRemoteService) user.GetService( + DfaService.v1_19.ReportRemoteService); + + long queryId = long.Parse(_T("INSERT_QUERY_ID_HERE")); + + // Create report request object. + ReportRequest reportRequest = new ReportRequest(); + reportRequest.queryId = queryId; + + try { + // Request generation of a report for your query. + ReportInfo reportInfo = service.runDeferredReport(reportRequest); + + // Display success message. + Console.WriteLine("Report with ID '{0}' has been scheduled.", reportInfo.reportId); + } catch (Exception ex) { + Console.WriteLine("Failed to schedule report. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_19/UploadInStreamAsset.cs b/examples/Dfa/CSharp/v1_19/UploadInStreamAsset.cs new file mode 100644 index 00000000000..d12a617b5bc --- /dev/null +++ b/examples/Dfa/CSharp/v1_19/UploadInStreamAsset.cs @@ -0,0 +1,107 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_19 { + /// + /// This code example uploads an In-Stream video asset into an existing + /// In-Stream video creative. To create an In-Stream video creative, run + /// CreateInStreamVideoCreative.cs. + /// + /// This code example creates a media file in the target creative because the + /// mediaFile flag on the InStreamAssetUploadRequest + /// was set to true. You can use the same workflow to upload + /// companion ads or non-linear ads to your creative by setting the + /// companion or nonLinear flags instead, + /// respectively. Only one flag may be set per upload request. + /// + /// Tags: creative.uploadInStreamAsset + /// + class UploadInStreamAsset : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example uploads an In-Stream video asset into an existing In-Stream " + + "video creative. To create an In-Stream video creative, run " + + "CreateInStreamVideoCreative.cs.\nThis code example creates a media file in the " + + "target creative because the mediaFile flag on the InStreamAssetUploadRequest was " + + "set to true. You can use the same workflow to upload companion ads or non-linear " + + "ads to your creative by setting the companion or nonLinear flags instead, " + + "respectively. Only one flag may be set per upload request."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UploadInStreamAsset(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Request the creative service from the service client factory. + CreativeRemoteService creativeService = (CreativeRemoteService) user.GetService( + DfaService.v1_19.CreativeRemoteService); + + string assetName = _T("INSERT_ASSET_NAME_HERE"); + string pathToFile = _T("INSERT_PATH_TO_FILE_HERE"); + long creativeId = long.Parse(_T("INSERT_IN_STREAM_VIDEO_CREATIVE_ID_HERE")); + + // Create the In-Stream video creative asset. + CreativeAsset inStreamVideoAsset = new CreativeAsset(); + inStreamVideoAsset.name = assetName; + inStreamVideoAsset.content = MediaUtilities.GetAssetDataFromUrl( + new Uri(pathToFile).AbsolutePath); + + // Create an upload request to make this asset a media file for an existing + // In-Stream creative. + InStreamAssetUploadRequest inStreamAssetUploadRequest = new InStreamAssetUploadRequest(); + inStreamAssetUploadRequest.mediaFile = true; + inStreamAssetUploadRequest.inStreamAsset = inStreamVideoAsset; + inStreamAssetUploadRequest.creativeId = creativeId; + + try { + // Save the media file. + InStreamVideoCreative inStreamVideoCreative = + creativeService.uploadInStreamAsset(inStreamAssetUploadRequest); + + // Display a success message. + Console.WriteLine("Added a media file to In-Stream video creative with ID \"{0}\".", + inStreamVideoCreative.id); + } catch (Exception ex) { + Console.WriteLine("Failed to add a media file to in-stream video creative. " + + "Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/AddAdvertiserUserFilter.cs b/examples/Dfa/CSharp/v1_20/AddAdvertiserUserFilter.cs new file mode 100644 index 00000000000..89dce3ba5b4 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/AddAdvertiserUserFilter.cs @@ -0,0 +1,117 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example locates a user profile by id number and adds a filter + /// to it, limiting the user profile's access to certain advertisers. To get + /// user ids, run GetUsers.cs. To get advertiser ids, run GetAdvertisers.cs. + /// + /// A similar pattern can be applied to set filters limiting site, user role, + /// and/or campaign access for any user. To get the Filter Criteria Type ID, + /// run GetUserFilterTypes.cs. + /// + /// Tags: user.getUser, user.saveUser + /// + class AddAdvertiserUserFilter : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example locates a user profile by id number and adds a filter to it," + + " limiting the user profile's access to certain advertisers. To get user ids, " + + "run GetUsers.cs. To get advertiser ids, run GetAdvertisers.cs.\n\nA similar " + + "pattern can be applied to set filters limiting site, user role, and/or campaign " + + "access for any user. To get the Filter Criteria Type ID, run GetUserFilterTypes.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new AddAdvertiserUserFilter(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create UserRemoteService instance. + UserRemoteService service = (UserRemoteService) user.GetService( + DfaService.v1_20.UserRemoteService); + + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + + // Create and configure a user filter. + UserFilter filterToAdd = new UserFilter(); + + // The following field has been filled in to make a filter that allows a + // user to access only the assigned objects. This value was determined + // using GetUserFilterTypes.cs. + filterToAdd.userFilterCriteriaId = 2; + + // Because this filter used the criteria type "Assigned" it is necessary + // to specify what advertisers this user has access to. This next step + // would be skipped for the criteria types "All" and "None". + + // Create an object filter to represent each object the user has access + // to. Since this is an advertiser filter, an object filter represents an + // advertiser. The total of object filter objects will need to match the + // total of advertisers the user is assigned. + ObjectFilter allowedObject = new ObjectFilter(); + + // Insert the advertiser id of an advertiser assigned to this user. + allowedObject.id = advertiserId; + + // Create any additional object filters that are needed, then add these + // settings to the user filter + filterToAdd.objectFilters = new ObjectFilter[] {allowedObject}; + + try { + // Retrieve the user who is to be modified. + User userToModify = service.getUser(userId); + + // Add the filter to the user. The following method is specific to + // advertiser filters. See the User class documentation for the names of + // methods for other filters. + userToModify.advertiserUserFilter = filterToAdd; + + // Save the changes made and display a success message. + UserSaveResult userSaveResult = service.saveUser(userToModify); + Console.WriteLine("User with id \"{0}\" was modified.", userSaveResult.id); + } catch (Exception ex) { + Console.WriteLine("Failed to add advertiser user filter. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/AssignAdvertisersToAdvertiserGroup.cs b/examples/Dfa/CSharp/v1_20/AssignAdvertisersToAdvertiserGroup.cs new file mode 100644 index 00000000000..170a556a7d8 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/AssignAdvertisersToAdvertiserGroup.cs @@ -0,0 +1,84 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example assigns a list of advertisers to an advertiser group. + /// + /// CAUTION: An advertiser that has campaigns associated with it cannot be + /// removed from an advertiser group once assigned. + /// + /// Tags: advertisergroup.assignAdvertisersToAdvertiserGroup + /// + class AssignAdvertisersToAdvertiserGroup : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example assigns a list of advertisers to an advertiser group. \n\n" + + "CAUTION: An advertiser that has campaigns associated with it cannot be removed " + + "from an advertiser group once assigned."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new AssignAdvertisersToAdvertiserGroup(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create AdvertiserGroupRemoteService instance. + AdvertiserGroupRemoteService service = (AdvertiserGroupRemoteService) user.GetService( + DfaService.v1_20.AdvertiserGroupRemoteService); + + long[] advertiserIds = new long[] { + long.Parse(_T("INSERT_ADVERTISER_ID1_HERE")), + long.Parse(_T("INSERT_ADVERTISER_ID2_HERE")) + }; + + long advertiserGroupId = long.Parse(_T("INSERT_ADVERTISER_GROUP_ID_HERE")); + + try { + // Assign the advertisers to the advertiser group. + service.assignAdvertisersToAdvertiserGroup(advertiserGroupId, advertiserIds); + + Console.WriteLine("Assigned advertisers to advertiser group successfully."); + } catch (Exception ex) { + Console.WriteLine("Failed to add advertisers to advertiser group. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/AssignCreativesToPlacements.cs b/examples/Dfa/CSharp/v1_20/AssignCreativesToPlacements.cs new file mode 100644 index 00000000000..f6defe33beb --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/AssignCreativesToPlacements.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example assigns creatives to placements and creates a unique ad + /// for each assignment. To get creatives, run GetCreatives.cs. To get + /// placements, run GetPlacement.cs. + /// + /// Tags: creative.assignCreativesToPlacements + /// + class AssignCreativesToPlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example assigns creatives to placements and creates a unique ad for " + + "each assignment. To get creatives, run GetCreatives.cs. To get placements, run " + + "GetPlacement.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new AssignCreativesToPlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeRemoteService instance. + CreativeRemoteService service = (CreativeRemoteService) user.GetService( + DfaService.v1_20.CreativeRemoteService); + + long creativeId = long.Parse(_T("INSERT_CREATIVE_ID")); + long placementId = long.Parse(_T("INSERT_PLACEMENT_ID")); + + // Create creative placement assignment structure. + CreativePlacementAssignment creativePlacementAssignment = + new CreativePlacementAssignment(); + creativePlacementAssignment.creativeId = creativeId; + creativePlacementAssignment.placementId = placementId; + creativePlacementAssignment.placementIds = new long[] {placementId}; + + try { + // Assign creatives to placements. + CreativePlacementAssignmentResult[] results = + service.assignCreativesToPlacements( + new CreativePlacementAssignment[] {creativePlacementAssignment}); + // Display new ads that resulted from the assignment. + foreach (CreativePlacementAssignmentResult result in results) { + Console.WriteLine("Ad with name \"{0}\" and id \"{1}\" was created.", result.adName, + result.adId); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create ad. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/Authenticate.cs b/examples/Dfa/CSharp/v1_20/Authenticate.cs new file mode 100644 index 00000000000..75a9e1d1170 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/Authenticate.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example authenticates using your DFA user name and password, + /// and displays the user profile token, DFA account name and id. If you are + /// setting username and password in your application's app.config and + /// creating a DfaUser using the default constructor, then you don't need to + /// obtain an authToken; the DfaUser does it for you at runtime based on your + /// app.config settings. If you wish to set authToken in your app.config or + /// create DfaUser using custom configuration, then you can run this example + /// to obtain an authToken. See GetAdTypesNoConfig.cs to see how to construct + /// a DfaUser with custom configuration. + /// + /// Tags: login.authenticate + /// + class Authenticate : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example authenticates using your DFA user name and password, and" + + " displays the user profile token, DFA account name and id. If you are setting" + + " username and password in your application's app.config and creating a DfaUser" + + " using the default constructor, then you don't need to obtain an authToken; the" + + " DfaUser does it for you at runtime based on your app.config settings. If you wish" + + " to set authToken in your app.config or create DfaUser using custom configuration," + + " then you can run this example to obtain an authToken. See GetAdTypesNoConfig.cs" + + " to see how to construct a DfaUser with custom configuration."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new Authenticate(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create LoginRemoteService instance. + LoginRemoteService service = (LoginRemoteService) user.GetService( + DfaService.v1_20.LoginRemoteService); + + // Provide user name and password. + String username = _T("INSERT_USER_NAME_HERE"); + String password = _T("INSERT_PASSWORD_HERE"); + + try { + // Authenticate. + UserProfile userProfile = service.authenticate(username, password); + + // Display user profile token, DFA account name and id. + Console.WriteLine("User profile token is \"{0}\", DFA account name is \"{1}\", and " + + "DFA account id is \"{2}\".", userProfile.token, userProfile.networkName, + userProfile.networkId); + } catch (Exception ex) { + Console.WriteLine("Failed to authenticate user. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/CreateAdvertiser.cs b/examples/Dfa/CSharp/v1_20/CreateAdvertiser.cs new file mode 100644 index 00000000000..0ab1d357229 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/CreateAdvertiser.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example creates an advertiser in a given DFA network. To get + /// the network id, run Authenticate.cs. + /// + /// Tags: advertiser.saveAdvertiser + /// + class CreateAdvertiser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates an advertiser in a given DFA network. To get the " + + "network id, run Authenticate.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateAdvertiser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create AdvertiserRemoteService instance. + AdvertiserRemoteService service = (AdvertiserRemoteService) user.GetService( + DfaService.v1_20.AdvertiserRemoteService); + + long networkId = long.Parse(_T("INSERT_NETWORK_ID_HERE")); + string advertiserName = _T("INSERT_ADVERTISER_NAME_HERE"); + + // Create advertiser structure. + Advertiser advertiser = new Advertiser(); + advertiser.name = advertiserName; + advertiser.networkId = networkId; + advertiser.id = 0; + advertiser.advertiserGroupId = 0; + advertiser.approved = true; + + try { + // Create advertiser. + AdvertiserSaveResult result = service.saveAdvertiser(advertiser); + if (result != null) { + // Display advertiser id. + Console.WriteLine("Advertiser with id \"{0}\" was created.", result.id); + } else { + Console.WriteLine("Could not create advertiser for the specified network id."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create advertiser. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/CreateAdvertiserGroup.cs b/examples/Dfa/CSharp/v1_20/CreateAdvertiserGroup.cs new file mode 100644 index 00000000000..fe918d5b2de --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/CreateAdvertiserGroup.cs @@ -0,0 +1,83 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example creates an advertiser group. + /// + /// Tags: advertisergroup.saveAdvertiserGroup + /// + class CreateAdvertiserGroup : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates an advertiser group."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateAdvertiserGroup(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create AdvertiserGroupRemoteService instance. + AdvertiserGroupRemoteService service = (AdvertiserGroupRemoteService) user.GetService( + DfaService.v1_20.AdvertiserGroupRemoteService); + + string advertiserGroupName = _T("INSERT_ADVERTISER_GROUP_NAME_HERE"); + + // Create advertiser group structure. + AdvertiserGroup advertiserGroup = new AdvertiserGroup(); + advertiserGroup.id = 0; + advertiserGroup.name = advertiserGroupName; + + try { + // Create advertiser group. + AdvertiserGroupSaveResult advertiserGroupSaveResult = + service.saveAdvertiserGroup(advertiserGroup); + + // Display advertiser group id. + Console.WriteLine("Advertiser Group with id \"{0}\" was created.", + advertiserGroupSaveResult.id); + + } catch (Exception ex) { + Console.WriteLine("Failed to create advertiser group. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/CreateCampaign.cs b/examples/Dfa/CSharp/v1_20/CreateCampaign.cs new file mode 100644 index 00000000000..2b78b17295d --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/CreateCampaign.cs @@ -0,0 +1,97 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example creates a campaign in a given advertiser. To create an + /// advertiser, run CreateAdvertiser.cs. + /// + /// Tags: campaign.saveCampaign + /// + class CreateCampaign : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a campaign in a given advertiser. To create an " + + "advertiser, run CreateAdvertiser.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCampaign(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CampaignRemoteService instance. + CampaignRemoteService service = (CampaignRemoteService) user.GetService( + DfaService.v1_20.CampaignRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + string campaignName = _T("INSERT_CAMPAIGN_NAME_HERE"); + string url = _T("INSERT_LANDING_PAGE_URL_HERE"); + string landingPageName = _T("INSERT_LANDING_PAGE_NAME_HERE"); + + // Create campaign structure. + Campaign campaign = new Campaign(); + campaign.advertiserId = advertiserId; + campaign.id = 0; + campaign.name = campaignName; + + campaign.startDate = DateTime.Now; + campaign.endDate = DateTime.Now.AddMonths(1); + + // Create & set default landing page. + LandingPage defaultLandingPage = new LandingPage(); + defaultLandingPage.id = 0; + defaultLandingPage.name = landingPageName; + defaultLandingPage.url = url; + + try { + campaign.defaultLandingPageId = service.saveLandingPage(defaultLandingPage).id; + + // Create campaign. + CampaignSaveResult result = service.saveCampaign(campaign); + + // Display new campaign id. + Console.WriteLine("Campaign with id \"{0}\" was created.", result.id); + } catch (Exception ex) { + Console.WriteLine("Failed to create campaign. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/CreateContentCategory.cs b/examples/Dfa/CSharp/v1_20/CreateContentCategory.cs new file mode 100644 index 00000000000..9662c1d805e --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/CreateContentCategory.cs @@ -0,0 +1,83 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example creates a content category with the given name and + /// description. + /// + /// Tags: contentcategory.saveContentCategory + /// + class CreateContentCategory : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a content category with the given name and description."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateContentCategory(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create ContentCategoryRemoteService instance. + ContentCategoryRemoteService service = (ContentCategoryRemoteService) user.GetService( + DfaService.v1_20.ContentCategoryRemoteService); + + string contentCategoryName = _T("INSERT_CONTENT_CATEGORY_NAME_HERE"); + + // Create content category structure. + ContentCategory contentCategory = new ContentCategory(); + contentCategory.id = 0; + contentCategory.name = contentCategoryName; + + try { + // Create content category. + ContentCategorySaveResult contentCategorySaveResult = + service.saveContentCategory(contentCategory); + + // Display content category id. + Console.WriteLine("Content category with id \"{0}\" was created.", + contentCategorySaveResult.id); + } catch (Exception ex) { + Console.WriteLine("Failed to add content category. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/CreateCreativeField.cs b/examples/Dfa/CSharp/v1_20/CreateCreativeField.cs new file mode 100644 index 00000000000..e351d77a652 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/CreateCreativeField.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example creates a creative field associated with a given + /// advertiser. To get an advertiser id, run GetAdvertisers.cs. + /// + /// Tags: creativefield.saveCreativeField + /// + class CreateCreativeField : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a creative field associated with a given advertiser. " + + "To get an advertiser id, run GetAdvertisers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreativeField(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeFieldRemoteService instance. + CreativeFieldRemoteService service = (CreativeFieldRemoteService) user.GetService( + DfaService.v1_20.CreativeFieldRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + string creativeFieldName = _T("INSERT_CREATIVE_FIELD_NAME_HERE"); + + // Create creative field structure. + CreativeField creativeField = new CreativeField(); + creativeField.id = -1; + creativeField.name = creativeFieldName; + creativeField.advertiserId = advertiserId; + + try { + // Create creative field. + CreativeFieldSaveResult creativeFieldSaveResult = service.saveCreativeField(creativeField); + + // Display creative field id. + Console.WriteLine("Creative field with id \"{0}\" was created.", + creativeFieldSaveResult.id); + } catch (Exception ex) { + Console.WriteLine("Failed to add creative field. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/CreateCreativeFieldValue.cs b/examples/Dfa/CSharp/v1_20/CreateCreativeFieldValue.cs new file mode 100644 index 00000000000..36dfcc96d6f --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/CreateCreativeFieldValue.cs @@ -0,0 +1,86 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example creates a creative field value associated with a given + /// creative field. To get the creative field id, run GetCreativeFields.cs. + /// + /// Tags: creativefield.saveCreativeFieldValue + /// + class CreateCreativeFieldValue : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a creative field value associated with a given " + + "creative field. To get the creative field id, run GetCreativeFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreativeFieldValue(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeFieldRemoteService instance. + CreativeFieldRemoteService service = (CreativeFieldRemoteService) user.GetService( + DfaService.v1_20.CreativeFieldRemoteService); + + long creativeFieldId = long.Parse(_T("INSERT_CREATIVE_FIELD_ID_HERE")); + String creativeFieldValueName = _T("INSERT_CREATIVE_FIELD_VALUE_NAME_HERE"); + + // Create creative field value structure. + CreativeFieldValue creativeFieldValue = new CreativeFieldValue(); + creativeFieldValue.id = -1; + creativeFieldValue.name = creativeFieldValueName; + creativeFieldValue.creativeFieldId = creativeFieldId; + + try { + // Create creative field value. + CreativeFieldValueSaveResult creativeFieldValueSaveResult = + service.saveCreativeFieldValue(creativeFieldValue); + + // Display creative field value id. + Console.WriteLine("Creative field value with id \"{0}\" was created.", + creativeFieldValueSaveResult.id); + } catch (Exception ex) { + Console.WriteLine("Failed to add creative field value. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/CreateCreativeGroup.cs b/examples/Dfa/CSharp/v1_20/CreateCreativeGroup.cs new file mode 100644 index 00000000000..0d584ca5c28 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/CreateCreativeGroup.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example creates a creative group associated with a given + /// advertiser. To get an advertiser id, run getAdvertisers.cs. Valid group + /// numbers are limited to 1 or 2. + /// + /// Tags: creativegroup.saveCreativeGroup + /// + class CreateCreativeGroup : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a creative group associated with a given advertiser. " + + "To get an advertiser id, run getAdvertisers.cs. Valid group numbers are limited to" + + " 1 or 2."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreativeGroup(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeGroupRemoteService instance. + CreativeGroupRemoteService service = (CreativeGroupRemoteService) user.GetService( + DfaService.v1_20.CreativeGroupRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + int groupNumber = int.Parse(_T("INSERT_GROUP_NUMBER_HERE")); + string creativeGroupName = _T("INSERT_CREATIVE_GROUP_NAME_HERE"); + + // Create creative group structure. + CreativeGroup creativeGroup = new CreativeGroup(); + creativeGroup.id = -1; + creativeGroup.name = creativeGroupName; + creativeGroup.groupNumber = groupNumber; + creativeGroup.advertiserId = advertiserId; + + try { + // Create creative group. + CreativeGroupSaveResult creativeGroupSaveResult = service.saveCreativeGroup(creativeGroup); + + // Display new creative group id. + Console.WriteLine("Creative group with id \"{0}\" was created.", + creativeGroupSaveResult.id); + } catch (Exception ex) { + Console.WriteLine("Failed to create creative group. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/CreateFlashInpageCreative.cs b/examples/Dfa/CSharp/v1_20/CreateFlashInpageCreative.cs new file mode 100644 index 00000000000..b58fa980f12 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/CreateFlashInpageCreative.cs @@ -0,0 +1,114 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example creates a "Flash InPage" creative in a given advertiser + /// or campaign. If no campaign is specified then the creative is created in + /// the advertiser provided. To get assets file names, run CreateHTMLAsset.cs + /// and CreateImageAsset.cs. To get a size id, run GetSize.cs. To get a + /// creative type id, run GetCreativeType.cs. + /// + /// Tags: creative.saveCreative + /// + class CreateFlashInpageCreative : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a 'Flash InPage' creative in a given advertiser " + + "or campaign. If no campaign is specified then the creative is created in the " + + "advertiser provided. To get assets file names, run CreateHTMLAsset.cs and " + + "CreateImageAsset.cs. To get a size id, run GetSize.cs. To get a creative type id, " + + "run GetCreativeType.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateFlashInpageCreative(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeRemoteService instance. + CreativeRemoteService service = (CreativeRemoteService) user.GetService( + DfaService.v1_20.CreativeRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + String creativeName = _T("INSERT_CREATIVE_NAME_HERE"); + String swfAssetFileName = _T("INSERT_SWF_ASSET_FILE_NAME_HERE"); + String imgAssetFileName = _T("INSERT_IMG_ASSET_FILE_NAME_HERE"); + long sizeId = long.Parse(_T("INSERT_SIZE_ID_HERE")); + long typeId = long.Parse(_T("INSERT_TYPE_ID_HERE")); + + // Create flash inpage structure. + FlashInpageCreative flashInpage = new FlashInpageCreative(); + flashInpage.typeId = typeId; + flashInpage.id = 0; + flashInpage.name = creativeName; + flashInpage.advertiserId = advertiserId; + flashInpage.active = true; + flashInpage.codeLocked = true; + flashInpage.sizeId = sizeId; + + // Set parent flash asset structure. + HTMLCreativeFlashAsset parentFlashAsset = new HTMLCreativeFlashAsset(); + parentFlashAsset.assetFilename = swfAssetFileName; + flashInpage.parentFlashAsset = parentFlashAsset; + flashInpage.wmode = "opaque"; + + // Set backup image asset. + HTMLCreativeAsset backupImageAsset = new HTMLCreativeAsset(); + backupImageAsset.assetFilename = imgAssetFileName; + flashInpage.backupImageAsset = backupImageAsset; + + // Set target window for backup image. + TargetWindow backupImageTargetWindow = new TargetWindow(); + backupImageTargetWindow.option = "_blank"; + flashInpage.backupImageTargetWindow = backupImageTargetWindow; + + try { + // Create flash inpage creative. + CreativeSaveResult result = service.saveCreative(flashInpage, 0); + + // Display new creative id. + Console.WriteLine("Flash inpage creative with id \"{0}\" was created.", result.id); + } catch (Exception ex) { + Console.WriteLine("Failed to create advertiser. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/CreateHTMLAsset.cs b/examples/Dfa/CSharp/v1_20/CreateHTMLAsset.cs new file mode 100644 index 00000000000..141ea359ba9 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/CreateHTMLAsset.cs @@ -0,0 +1,87 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example creates a HTML creative asset in a given advertiser. To + /// create an advertiser, run CreateAdvertiser.cs. + /// + /// Tags: creative.saveCreativeAsset + /// + class CreateHTMLAsset : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a HTML creative asset in a given advertiser. To create " + + "an advertiser, run CreateAdvertiser.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateHTMLAsset(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeRemoteService instance. + CreativeRemoteService service = (CreativeRemoteService) user.GetService( + DfaService.v1_20.CreativeRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + string assetName = _T("INSERT_SWF_ASSET_NAME_HERE"); + string pathToFile = _T("INSERT_PATH_TO_SWF_FILE_HERE"); + + // Set HTML asset Structure. + CreativeAsset swfAsset = new CreativeAsset(); + // Set it to true if this asset is being used for HTML creative. + swfAsset.forHTMLCreatives = true; + swfAsset.advertiserId = advertiserId; + swfAsset.content = MediaUtilities.GetAssetDataFromUrl(new Uri(pathToFile)); + swfAsset.name = assetName; + + try { + //Create asset. + CreativeAssetSaveResult result = service.saveCreativeAsset(swfAsset); + + // Display asset file name. + Console.WriteLine("Asset was saved with file name of \"{0}\".", result.savedFilename); + } catch (Exception ex) { + Console.WriteLine("Failed to create html asset. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/CreateImageAsset.cs b/examples/Dfa/CSharp/v1_20/CreateImageAsset.cs new file mode 100644 index 00000000000..eea2e0ad6ac --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/CreateImageAsset.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This example creates an image creative asset in a given advertiser. To + /// create an advertiser, run CreateAdvertiser.cs. + /// + /// Tags: creative.saveCreativeAsset + /// + class CreateImageAsset : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example creates an image creative asset in a given advertiser. To create an" + + " advertiser, run CreateAdvertiser.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateImageAsset(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreateRemoteService instance. + CreativeRemoteService service = (CreativeRemoteService) user.GetService( + DfaService.v1_20.CreativeRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + string assetName = _T("INSERT_IMAGE_ASSET_NAME_HERE"); + string pathToFile = _T("INSERT_PATH_TO_IMAGE_ASSET_HERE"); + + // Set image asset structure. + CreativeAsset imgAsset = new CreativeAsset(); + imgAsset.forHTMLCreatives = false; + imgAsset.advertiserId = advertiserId; + imgAsset.content = MediaUtilities.GetAssetDataFromUrl(new Uri(pathToFile)); + imgAsset.name = assetName; + + try { + // Create image asset. + CreativeAssetSaveResult result = service.saveCreativeAsset(imgAsset); + + // Display asset file name. + Console.WriteLine("Asset was saved with file name of \"{0}\".", result.savedFilename); + } catch (Exception ex) { + Console.WriteLine("Failed to create image asset. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/CreateInStreamVideoCreative.cs b/examples/Dfa/CSharp/v1_20/CreateInStreamVideoCreative.cs new file mode 100644 index 00000000000..c9fdbb4890f --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/CreateInStreamVideoCreative.cs @@ -0,0 +1,106 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example creates an In-Stream video creative associated with a + /// given advertiser. If a campaign is specified, the creative is also + /// associated with that campaign. To associate In-Stream assets with an + /// In-Stream video creative, first create the creative and then run + /// UploadInStreamAsset.cs. + /// + /// Tags: creative.saveCreative + /// + class CreateInStreamVideoCreative : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates an In-Stream video creative associated with a given " + + "advertiser. If a campaign is specified, the creative is also associated with that " + + "campaign. To associate In-Stream assets with an In-Stream video creative, first " + + "create the creative and then run UploadInStreamAsset.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateInStreamVideoCreative(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Request the creative service from the service client factory. + CreativeRemoteService creativeService = (CreativeRemoteService) user.GetService( + DfaService.v1_20.CreativeRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + long campaignId = 0; + float videoDuration = float.Parse(_T("INSERT_VIDEO_DURATION_HERE")); + string adId = _T("INSERT_VAST_AD_ID_HERE"); + string surveyUrl = _T("INSERT_VAST_SURVEY_URL_HERE"); + string clickThroughUrl = _T("INSERT_VAST_CLICK_THROUGH_URL_HERE"); + + // Create the In-Stream video creative. + InStreamVideoCreative inStreamVideoCreative = new InStreamVideoCreative(); + inStreamVideoCreative.advertiserId = advertiserId; + inStreamVideoCreative.name = "In-Stream Video Creative #" + GetTimeStamp(); + inStreamVideoCreative.videoDuration = videoDuration; + // In-Stream video creatives have to be created inactive. One can only be + // set active after at least one media file has been added to it or the API + // will return an error message. + inStreamVideoCreative.active = false; + + // Set the video details based on the Video Ad Serving Template (VAST) + // specification. + inStreamVideoCreative.adId = adId; + inStreamVideoCreative.description = "You are viewing an In-Stream Video Creative"; + inStreamVideoCreative.surveyUrl = surveyUrl; + inStreamVideoCreative.clickThroughUrl = clickThroughUrl; + + try { + // Save the In-Stream video creative. + CreativeSaveResult creativeSaveResult = creativeService.saveCreative(inStreamVideoCreative, + campaignId); + + // Display the new creative ID. + Console.WriteLine("In-Stream video creative with ID \"{0}\" was created.", + creativeSaveResult.id); + } catch (Exception ex) { + Console.WriteLine("Failed to create in-stream video creative. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/CreateMobileAsset.cs b/examples/Dfa/CSharp/v1_20/CreateMobileAsset.cs new file mode 100644 index 00000000000..6182a368c38 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/CreateMobileAsset.cs @@ -0,0 +1,87 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example creates a mobile creative asset in a given advertiser. + /// Currently only gif, jpg, jpeg, png and wbmp files are supported as mobile + /// assets. To create an advertiser, run CreateAdvertiser.cs. + /// + /// Tags: creative.saveCreativeAsset + /// + class CreateMobileAsset : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a mobile creative asset in a given advertiser. " + + "Currently only gif, jpg, jpeg, png and wbmp files are supported as mobile assets. " + + "To create an advertiser, run CreateAdvertiser.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateMobileAsset(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreateRemoteService instance. + CreativeRemoteService service = (CreativeRemoteService) user.GetService( + DfaService.v1_20.CreativeRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + string assetName = _T("INSERT_MOBILE_ASSET_NAME_HERE"); + string pathToFile = _T("INSERT_PATH_TO_MOBILE_ASSET_HERE"); + + // Set mobile asset structure. + CreativeAsset mobileAsset = new CreativeAsset(); + mobileAsset.forHTMLCreatives = true; + mobileAsset.advertiserId = advertiserId; + mobileAsset.content = MediaUtilities.GetAssetDataFromUrl(new Uri(pathToFile)); + mobileAsset.name = assetName; + + try { + // Create mobile asset. + CreativeAssetSaveResult result = service.saveCreativeAsset(mobileAsset); + + // Display asset file name. + Console.WriteLine("Asset was saved with file name of \"{0}\".", result.savedFilename); + } catch (Exception ex) { + Console.WriteLine("Failed to create mobile asset. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/CreateMobileCreative.cs b/examples/Dfa/CSharp/v1_20/CreateMobileCreative.cs new file mode 100644 index 00000000000..67009c32063 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/CreateMobileCreative.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example creates a mobile display creative in a given advertiser + /// or campaign. If no campaign is specified then the creative is created in + /// the advertiser provided. To get assets file names, run CreateHTMLAsset.cs + /// and CreateImageAsset.cs. To get a size id, run GetSize.cs. To get a + /// creative type id, run GetCreativeType.cs. + /// + /// Tags: creative.saveCreative + /// + class CreateMobileCreative : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a mobile display creative in a given advertiser or " + + "campaign. If no campaign is specified then the creative is created in the " + + "advertiser provided. To get assets file names, run CreateHTMLAsset.cs and " + + "CreateImageAsset.cs. To get a size id, run GetSize.cs. To get a creative type " + + "id, run GetCreativeType.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateMobileCreative(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeRemoteService instance. + CreativeRemoteService service = (CreativeRemoteService) user.GetService( + DfaService.v1_20.CreativeRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + String creativeName = _T("INSERT_CREATIVE_NAME_HERE"); + String mobileAssetFileName = _T("INSERT_MOBILE_ASSET_FILE_NAME_HERE"); + long typeId = long.Parse(_T("INSERT_TYPE_ID_HERE")); + + // Set mobile display creative structure. + MobileDisplayCreative mobileDisplayCreative = new MobileDisplayCreative(); + mobileDisplayCreative.advertiserId = advertiserId; + mobileDisplayCreative.name = creativeName; + mobileDisplayCreative.typeId = typeId; + mobileDisplayCreative.archived = false; + + // Set mobile creative asset. + HTMLCreativeAsset htmlCreativeAsset = new MobileDisplayCreativeAsset(); + htmlCreativeAsset.assetFilename = mobileAssetFileName; + mobileDisplayCreative.creativeAssets = new HTMLCreativeAsset[] {htmlCreativeAsset}; + + try { + // Create mobile display creative. + CreativeSaveResult creativeSaveResult = service.saveCreative(mobileDisplayCreative, 0); + + // Display new creative id. + Console.WriteLine("Mobile display creative with id \"{0}\" was created.", + creativeSaveResult.id); + } catch (Exception ex) { + Console.WriteLine("Failed to create display creative. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/CreatePlacement.cs b/examples/Dfa/CSharp/v1_20/CreatePlacement.cs new file mode 100644 index 00000000000..da4b758dba8 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/CreatePlacement.cs @@ -0,0 +1,116 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example creates a placement in a given campaign. This code + /// example requires the DFA site id and campaign id in which the placement + /// will be created into. To create a campaign, run CreateCampaign.cs. + /// To get DFA site id, run GetDfaSite.cs. To get a size id, run + /// GetSize.cs. To get placement types, run GetPlacementTypes.cs. To get + /// pricing types, run GetPricingTypes.cs. + /// + /// Tags: placement.savePlacement + /// + class CreatePlacement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a placement in a given campaign. This code example " + + "requires the DFA site id and campaign id in which the placement will be created " + + "into. To create a campaign, run CreateCampaign.cs. To get DFA site id, run " + + "GetDfaSite.cs. To get a size id, run GetSize.cs. To get placement types, run " + + "GetPlacementTypes.cs. To get pricing types, run GetPricingTypes.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreatePlacement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create PlacementRemoteService instance. + PlacementRemoteService service = (PlacementRemoteService) user.GetService( + DfaService.v1_20.PlacementRemoteService); + string placementName = _T("INSERT_PLACEMENT_NAME_HERE"); + long dfaSiteId = long.Parse(_T("INSERT_DFA_SITE_ID_HERE")); + long campaignId = long.Parse(_T("INSERT_CAMPAIGN_ID_HERE")); + int pricingType = int.Parse(_T("INSERT_PRICING_TYPE_HERE")); + int placementType = int.Parse(_T("INSERT_PLACEMENT_TYPE_HERE")); + long sizeId = long.Parse(_T("INSERT_SIZE_ID_HERE")); + + // Create placement structure. + Placement placement = new Placement(); + placement.id = 0; + placement.name = placementName; + placement.campaignId = campaignId; + placement.dfaSiteId = dfaSiteId; + placement.sizeId = sizeId; + + // Set pricing schedule for placement. + PricingSchedule pricingSchedule = new PricingSchedule(); + pricingSchedule.startDate = DateTime.Now; + pricingSchedule.endDate = DateTime.Now.AddMonths(1); + pricingSchedule.pricingType = pricingType; + placement.pricingSchedule = pricingSchedule; + + // Set placement type. + placement.placementType = placementType; + + try { + // Set placement tag settings. + TagSettings tagSettings = new TagSettings(); + PlacementTagOption[] placementTagOptions = service.getRegularPlacementTagOptions(); + int[] tagTypes = new int[placementTagOptions.Length]; + + for (int i = 0; i < placementTagOptions.Length; i++) { + tagTypes[i] = (int) placementTagOptions[i].id; + } + + tagSettings.tagTypes = tagTypes; + placement.tagSettings = tagSettings; + + // Create the placement. + PlacementSaveResult placementSaveResult = service.savePlacement(placement); + + // Display new placment id. + Console.WriteLine("Placment with id \"{0}\" was created.", placementSaveResult.id); + } catch (Exception ex) { + Console.WriteLine("Failed to create placement. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/CreatePlacementStrategy.cs b/examples/Dfa/CSharp/v1_20/CreatePlacementStrategy.cs new file mode 100644 index 00000000000..1f5a44a8445 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/CreatePlacementStrategy.cs @@ -0,0 +1,84 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example creates a placement strategy with the given name. + /// + /// Tags: strategy.savePlacementStrategy + /// + class CreatePlacementStrategy : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a placement strategy with the given name."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreatePlacementStrategy(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create PlacementStrategyRemoteService instance. + PlacementStrategyRemoteService service = (PlacementStrategyRemoteService) user.GetService( + DfaService.v1_20.PlacementStrategyRemoteService); + + String placementStrategyName = _T("INSERT_PLACEMENT_STRATEGY_NAME_HERE"); + + // Create placement strategy structure. + PlacementStrategy placementStrategy = new PlacementStrategy(); + placementStrategy.id = 0; + placementStrategy.name = placementStrategyName; + + try { + // Create placement strategy. + PlacementStrategySaveResult placementStrategySaveResult = + service.savePlacementStrategy(placementStrategy); + + if (placementStrategySaveResult != null) { + // Display placement strategy id. + Console.WriteLine("Placement Strategy with id \"{0}\" was created.", + placementStrategySaveResult.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create placement strategy. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/CreateRotationGroup.cs b/examples/Dfa/CSharp/v1_20/CreateRotationGroup.cs new file mode 100644 index 00000000000..fdc7bd38f93 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/CreateRotationGroup.cs @@ -0,0 +1,123 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example creates a rotation group ad in a given campaign. To get + /// ad types run GetAdTypes.cs. Start and end date for the ad must be within + /// campaign start and end dates. To create creatives, run + /// CreateCreatives.cs. To get available placements, run GetPlacement.cs. + /// To get a size id, run GetSize.cs. + /// + /// Tags: ad.saveAd + /// + class CreateRotationGroup : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a rotation group ad in a given campaign. To get ad " + + "types run GetAdTypes.cs. Start and end date for the ad must be within campaign " + + "start and end dates. To create creatives, run CreateCreatives.cs. To get " + + "available placements, run GetPlacement.cs. To get a size id, run GetSize.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateRotationGroup(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create AdRemoteService instance. + AdRemoteService service = (AdRemoteService) user.GetService( + DfaService.v1_20.AdRemoteService); + + long campaignId = long.Parse(_T("INSERT_CAMPAIGN_ID_HERE")); + long sizeId = long.Parse(_T("INSERT_SIZE_ID_HERE")); + long creativeId = long.Parse(_T("INSERT_CREATIVE_ID_HERE")); + long placementId = long.Parse(_T("INSERT_PLACEMENT_ID_HERE")); + String adName = _T("INSERT_AD_NAME_HERE"); + long typeId = long.Parse(_T("INSERT_AD_TYPEID_HERE")); + + // Create rotation group structure. + RotationGroup rotationGroup = new RotationGroup(); + rotationGroup.id = 0; + rotationGroup.name = adName; + rotationGroup.active = true; + rotationGroup.archived = false; + rotationGroup.campaignId = campaignId; + rotationGroup.sizeId = sizeId; + rotationGroup.typeId = typeId; + rotationGroup.priority = 12; + rotationGroup.ratio = 1; + + // Set ad start and end dates. + rotationGroup.startTime = DateTime.Today.AddDays(1); + rotationGroup.endTime = DateTime.Today.AddMonths(1); + + // Add creatives to the ad. + CreativeAssignment creativeAssignment = new CreativeAssignment(); + creativeAssignment.active = true; + creativeAssignment.creativeId = creativeId; + + // Create click through url. + ClickThroughUrl clickThroughUrl = new ClickThroughUrl(); + clickThroughUrl.defaultLandingPageUsed = true; + clickThroughUrl.landingPageId = 0; + creativeAssignment.clickThroughUrl = clickThroughUrl; + + // Create creative assigments. + rotationGroup.creativeAssignments = new CreativeAssignment[] {creativeAssignment}; + rotationGroup.rotationType = 1; + + // Assign ad to placement. + PlacementAssignment placementAssignment = new PlacementAssignment(); + placementAssignment.active = true; + placementAssignment.placementId = placementId; + rotationGroup.placementAssignments = new PlacementAssignment[] {placementAssignment}; + + try { + // Create rotation group. + AdSaveResult result = service.saveAd(rotationGroup); + + // Display new ad id. + Console.WriteLine("Ad with id \"{0}\" was created.", result.id); + } catch (Exception ex) { + Console.WriteLine("Failed to create rotation group. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/CreateSpotlightActivity.cs b/examples/Dfa/CSharp/v1_20/CreateSpotlightActivity.cs new file mode 100644 index 00000000000..f5366a8ddef --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/CreateSpotlightActivity.cs @@ -0,0 +1,98 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example creates a spotlight activity in a given activity group. + /// To create an activity group, run CreateSpotlightActivityGroup.cs. To get + /// tag methods types, run GetTagMethodTypes.cs. To get activity type ids, + /// run GetActivityTypes.cs. To get available countries, run GetCountries.cs. + /// + /// Tags: spotlight.saveSpotlightActivity + /// + class CreateSpotlightActivity : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a spotlight activity in a given activity group. To " + + "create an activity group, run CreateSpotlightActivityGroup.cs. To get tag methods " + + "types, run GetTagMethodTypes.cs. To get activity type ids, run GetActivityTypes.cs" + + ". To get available countries, run GetCountries.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateSpotlightActivity(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create SpotlightRemoteService instance. + SpotlightRemoteService service = (SpotlightRemoteService) user.GetService( + DfaService.v1_20.SpotlightRemoteService); + + long activityGroupId = long.Parse(_T("INSERT_ACTIVITY_GROUP_ID_HERE")); + long activityTypeId = long.Parse(_T("INSERT_ACTIVITY_TYPE_ID_HERE")); + long tagMethodTypeId = long.Parse(_T("INSERT_TAG_METHOD_TYPE_ID_HERE")); + long countryId = long.Parse(_T("INSERT_COUNTRY_ID_HERE")); + string url = _T("INSERT_EXPECTED_URL_HERE"); + string activityName = _T("INSERT_ACTIVITY_NAME_HERE"); + + // Set spotlight activity structure. + SpotlightActivity spotActivity = new SpotlightActivity(); + spotActivity.id = 0; + spotActivity.activityGroupId = activityGroupId; + spotActivity.activityTypeId = activityTypeId; + spotActivity.tagMethodTypeId = tagMethodTypeId; + spotActivity.name = activityName; + spotActivity.expectedUrl = url; + spotActivity.countryId = countryId; + + try { + // Create the spotlight tag activity. + SpotlightActivitySaveResult result = service.saveSpotlightActivity(spotActivity); + + // Display new spotlight activity id. + if (result != null) { + Console.WriteLine("Spotlight activity with id \"{0}\" was created.", result.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create spotlight activity. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/CreateSpotlightActivityGroup.cs b/examples/Dfa/CSharp/v1_20/CreateSpotlightActivityGroup.cs new file mode 100644 index 00000000000..b42640a5873 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/CreateSpotlightActivityGroup.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example creates a new activity group for a given spotlight + /// configuration. To get spotLight tag configuration, run GetAdvertisers.cs. + /// To get activity types, run GetActivityTypes.cs. + /// + /// Tags: spotlight.saveSpotlightActivityGroup + /// + class CreateSpotlightActivityGroup : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new activity group for a given spotlight " + + "configuration. To get spotLight tag configuration, run GetAdvertisers.cs. To get " + + "activity types, run GetActivityTypes.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateSpotlightActivityGroup(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create SpotlightRemoteService instance. + SpotlightRemoteService service = (SpotlightRemoteService) user.GetService( + DfaService.v1_20.SpotlightRemoteService); + + long spotlightConfigurationId = long.Parse(_T("INSERT_SPOTLIGHT_CONFIGURATION_ID_HERE")); + int activityType = int.Parse(_T("INSERT_ACTIVITY_TYPE_HERE")); + string groupName = _T("INSERT_GROUP_NAME_HERE"); + + // Set spotlight activity group structure. + SpotlightActivityGroup spotlightActivityGroup = new SpotlightActivityGroup(); + spotlightActivityGroup.id = 0; + spotlightActivityGroup.spotlightConfigurationId = spotlightConfigurationId; + spotlightActivityGroup.groupType = activityType; + spotlightActivityGroup.name = groupName; + + try { + // Create the activity group. + SpotlightActivityGroupSaveResult result = service.saveSpotlightActivityGroup( + spotlightActivityGroup); + + // Display activity group id. + if (result != null) { + Console.WriteLine("Activity group with id \"{0}\" was created.", result.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create spotlight activity group. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/CreateSubnetwork.cs b/examples/Dfa/CSharp/v1_20/CreateSubnetwork.cs new file mode 100644 index 00000000000..e9d98f812f3 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/CreateSubnetwork.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example creates a subnetwork in a given DFA network. To get + /// the network id, run Authenticate.cs. To get the available permissions, + /// run GetAvailablePermissions.cs. + /// + /// Tags: subnetwork.saveSubnetwork + /// + class CreateSubnetwork : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a subnetwork in a given DFA network. To get the " + + "network id, run Authenticate.cs. To get the available permissions, run " + + "GetAvailablePermissions.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateSubnetwork(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create SubnetworkRemoteService instance. + SubnetworkRemoteService service = (SubnetworkRemoteService) user.GetService( + DfaService.v1_20.SubnetworkRemoteService); + + long networkId = long.Parse(_T("INSERT_NETWORK_ID_HERE")); + String subnetworkName = _T("INSERT_SUBNETWORK_NAME_HERE"); + long permission1 = long.Parse(_T("INSERT_FIRST_PERMISSION_ID_HERE")); + long permission2 = long.Parse(_T("INSERT_SECOND_PERMISSION_ID_HERE")); + + // Create subnetwork structure. + Subnetwork subnetwork = new Subnetwork(); + subnetwork.id = 0; + subnetwork.name = subnetworkName; + subnetwork.networkId = networkId; + + // Create an array of all permissions assigned to this subnetwork and add + // it to the subnetwork structure. To get list of available permissions, + // run GetAvailablePermissions.cs. + subnetwork.availablePermissions = new long[] {permission1, permission2}; + + try { + // Create subnetwork. + SubnetworkSaveResult subnetworkSaveResult = service.saveSubnetwork(subnetwork); + + // Display subnetwork id. + Console.WriteLine("Subnetwork with id \"{0}\" was created.", subnetworkSaveResult.id); + } catch (Exception ex) { + Console.WriteLine("Failed to create subnetwork. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/CreateUserRole.cs b/examples/Dfa/CSharp/v1_20/CreateUserRole.cs new file mode 100644 index 00000000000..136c92a2ead --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/CreateUserRole.cs @@ -0,0 +1,102 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example creates a user role in a given DFA subnetwork. To get + /// the subnetwork id, run GetSubnetworks.cs. To get the available + /// permissions, run GetAvailablePermissions.cs. To get the parent user role + /// id, run GetUserRoles.cs. + /// + /// Tags: userrole.saveUserRole + /// + class CreateUserRole : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a user role in a given DFA subnetwork. To get the " + + "subnetwork id, run GetSubnetworks.cs. To get the available permissions, run " + + "GetAvailablePermissions.cs. To get the parent user role id, run GetUserRoles.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateUserRole(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create UserRoleRemoteService instance. + UserRoleRemoteService service = (UserRoleRemoteService) user.GetService( + DfaService.v1_20.UserRoleRemoteService); + + String userRoleName = _T("INSERT_USER_ROLE_NAME_HERE"); + long subnetworkId = long.Parse(_T("INSERT_SUBNETWORK_ID_HERE")); + long parentUserRoleId = long.Parse(_T("INSERT_PARENT_USER_ROLE_ID_HERE")); + long permission1Id = long.Parse(_T("INSERT_FIRST_PERMISSION_ID_HERE")); + long permission2Id = long.Parse(_T("INSERT_SECOND_PERMISSION_ID_HERE")); + + // Create user role structure. + UserRole userRole = new UserRole(); + userRole.id = 0; + userRole.name = userRoleName; + userRole.subnetworkId = subnetworkId; + userRole.parentUserRoleId = parentUserRoleId; + + // Create a permission object to represent each permission this user role + // has. + Permission permission1 = new Permission(); + permission1.id = permission1Id; + Permission permission2 = new Permission(); + permission2.id = permission2Id; + + // Add the permissions to the user role. + userRole.permissions = new Permission[] {permission1, permission2}; + + try { + // Create user role. + UserRoleSaveResult userRoleResult = service.saveUserRole(userRole); + + if (userRoleResult != null) { + // Display user role id. + Console.WriteLine("User role with id \"{0} was created.", userRoleResult.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create user role. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/DownloadTags.cs b/examples/Dfa/CSharp/v1_20/DownloadTags.cs new file mode 100644 index 00000000000..d1df9be1947 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/DownloadTags.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example downloads HTML Tags for a given campaign and placement + /// id. To create campaigns, run CreateCampaigns.cs. To create placements, + /// run GetPlacements.cs. + /// + /// Tags: placement.getPlacementTagData + /// + class DownloadTags : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example downloads HTML Tags for a given campaign and placement id. To " + + "create campaigns, run CreateCampaigns.cs. To create placements, run GetPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DownloadTags(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create PlacementRemoteService instance. + PlacementRemoteService service = (PlacementRemoteService) user.GetService( + DfaService.v1_20.PlacementRemoteService); + + long campaignId = long.Parse(_T("INSERT_CAMPAIGN_ID_HERE")); + long placementId = long.Parse(_T("INSERT_PLACEMENT_ID_HERE")); + + // Set placement tag search criteria. + PlacementTagCriteria placementTagCriteria = new PlacementTagCriteria(); + placementTagCriteria.id = placementId; + + try { + // Get placement tag options. + PlacementTagOption[] placementTagOptions = service.getRegularPlacementTagOptions(); + + long[] tagOptionIds = new long[placementTagOptions.Length]; + + // Add all types of tags to the tag option structure. + for (int i = 0; i < placementTagOptions.Length; i++) { + tagOptionIds[i] = placementTagOptions[i].id; + } + + placementTagCriteria.tagOptionIds = tagOptionIds; + + // Get HTML tags for the placements. + PlacementTagData placementTagData = service.getPlacementTagData(campaignId, + new PlacementTagCriteria[] {placementTagCriteria}); + + // Display tags for the placement id used as criteria. + PlacementTagInfo temp = placementTagData.placementTagInfos[0]; + Console.WriteLine("Placement name : {0}\nIframe/JavaScript tag : {1}\nStandard tag : {2}" + + "\nInternal Redirect tag : {3}", temp.placement.name, temp.iframeJavaScriptTag, + temp.javaScriptTag, temp.internalRedirectTag); + } catch (Exception ex) { + Console.WriteLine("Failed to download tags. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetActivityGroups.cs b/examples/Dfa/CSharp/v1_20/GetActivityGroups.cs new file mode 100644 index 00000000000..43ae6fdcfba --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetActivityGroups.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example displays activity groups names and ids for a given + /// advertiser. To create an advertiser, run CreateAdvertiser.cs. + /// + /// Tags: spotlight.getSpotlightActivityGroups + /// + class GetActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays activity groups names and ids for a given advertiser. " + + "To create an advertiser, run CreateAdvertiser.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create SpotlightRemoteService instance. + SpotlightRemoteService service = (SpotlightRemoteService) user.GetService( + DfaService.v1_20.SpotlightRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + + // Set activity group search criteria structure and + // use advertiser id as search criteria. + SpotlightActivityGroupSearchCriteria activityGroupSearchCriteria = + new SpotlightActivityGroupSearchCriteria(); + activityGroupSearchCriteria.advertiserId = advertiserId; + + try { + // Get activity group. + SpotlightActivityGroupRecordSet recordSet = + service.getSpotlightActivityGroups(activityGroupSearchCriteria); + + // Display activity group names and ids. + if (recordSet.records != null) { + foreach (SpotlightActivityGroup result in recordSet.records) { + Console.WriteLine("Activity group with name \"{0}\" and id \"{1}\" was found.", + result.name, result.id); + } + } else { + Console.WriteLine("No activity groups found for your criteria."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve activity groups. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetActivityTypes.cs b/examples/Dfa/CSharp/v1_20/GetActivityTypes.cs new file mode 100644 index 00000000000..8f39cf9e089 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetActivityTypes.cs @@ -0,0 +1,76 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example displays activity type names and ids. + /// + /// Tags: spotlight.getSpotlightActivityTypes + /// + class GetActivityTypes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays activity type names and ids."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActivityTypes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create SpotlightRemoteService instance. + SpotlightRemoteService service = (SpotlightRemoteService) user.GetService( + DfaService.v1_20.SpotlightRemoteService); + + try { + // Get activity types. + SpotlightActivityType[] spotlightActivityTypes = service.getSpotlightActivityTypes(); + + // Display activity type names and ids. + foreach (SpotlightActivityType result in spotlightActivityTypes) { + Console.WriteLine("Activity type with name \"{0}\" and id \"{1}\" was found.", + result.name, result.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve activity types. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetAdTypes.cs b/examples/Dfa/CSharp/v1_20/GetAdTypes.cs new file mode 100644 index 00000000000..d9bdb028bbe --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetAdTypes.cs @@ -0,0 +1,78 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example retrieves available ad types and displays the name and + /// id for each type. + /// + /// Tags: ad.getAdTypes + /// + class GetAdTypes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves available ad types and displays the name and id for " + + "each type."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdTypes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create AdRemoteService instance. + AdRemoteService service = (AdRemoteService) user.GetService( + DfaService.v1_20.AdRemoteService); + + try { + // Get ad types. + AdType[] adTypes = service.getAdTypes(); + + // Display ad type and its id. + foreach (AdType result in adTypes) { + Console.WriteLine("Ad type with name \"{0}\" and id \"{1}\" was found.", result.name, + result.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve ad types. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetAdTypesNoConfig.cs b/examples/Dfa/CSharp/v1_20/GetAdTypesNoConfig.cs new file mode 100644 index 00000000000..a0aebd2e144 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetAdTypesNoConfig.cs @@ -0,0 +1,100 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example retrieves available ad types and displays the name and + /// id for each type. This also shows how you can set the DfaUser + /// configuration at runtime instead of reading the settings from app.config. + /// To get an authToken, run Authenticate.cs. + /// + /// Tags: ad.getAdTypes + /// + class GetAdTypesNoConfig : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves available ad types and displays the name and id for " + + "each type. This also shows how you can set the DfaUser configuration at runtime " + + "instead of reading the settings from app.config."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdTypesNoConfig(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + Dictionary headers = new Dictionary(); + + string userName = _T("INSERT_USERNAME_HERE"); + string password = _T("INSERT_PASSWORD_HERE"); + string applicationName = _T("INSERT_APPLICATION_NAME_HERE"); + + headers.Add("userName", userName); + headers.Add("password", password); + headers.Add("applicationName", applicationName); + + // If you have already used LoginRemoteService to obtain your token, then + // you can set the authToken header instead of the password header like: + // string authToken = _T("INSERT_AUTH_TOKEN_HERE"); + // headers.Add("authToken", authToken); + + // Since we are creating a custom DfaUser, we don't use the user passed + // as a method argument. + DfaUser user1 = new DfaUser(headers); + + // Create AdRemoteService instance. + AdRemoteService service = (AdRemoteService) user1.GetService( + DfaService.v1_20.AdRemoteService); + + try { + // Get ad types. + AdType[] adTypes = service.getAdTypes(); + + // Display ad type and its id. + foreach (AdType result in adTypes) { + Console.WriteLine("Ad type with name \"{0} and id \"{1}\" was found.", result.name, + result.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve ad types. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetAdvertiserGroups.cs b/examples/Dfa/CSharp/v1_20/GetAdvertiserGroups.cs new file mode 100644 index 00000000000..0a47c060e78 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetAdvertiserGroups.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example displays advertiser group name, id, and advertiser + /// count for the given search criteria. Results are limited to the first 10 + /// records. + /// + /// Tags: advertisergroup.getAdvertiserGroups + /// + class GetAdvertiserGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays advertiser group name, id, and advertiser count for " + + "the given search criteria. Results are limited to the first 10 records."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdvertiserGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create AdvertiserGroupRemoteService instance. + AdvertiserGroupRemoteService service = (AdvertiserGroupRemoteService) user.GetService( + DfaService.v1_20.AdvertiserGroupRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Create advertiser group search criteria structure. + AdvertiserGroupSearchCriteria advGroupSearchCriteria = new AdvertiserGroupSearchCriteria(); + advGroupSearchCriteria.pageSize = 10; + advGroupSearchCriteria.searchString = searchString; + + try { + // Get advertiser group record set. + AdvertiserGroupRecordSet advertiserGroupRecordSet = + service.getAdvertiserGroups(advGroupSearchCriteria); + + // Display advertiser group names, ids and advertiser count. + if (advertiserGroupRecordSet != null && advertiserGroupRecordSet.records != null) { + foreach (AdvertiserGroup advertiserGroup in advertiserGroupRecordSet.records) { + Console.WriteLine("Advertiser Group with name \"{0}\", id \"{1}\", containing \"{2}\"" + + " advertisers was found.", advertiserGroup.name, advertiserGroup.id, + advertiserGroup.advertiserCount); + } + } else { + Console.WriteLine("No advertiser groups found for your search criteria."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve advertiser groups. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetAdvertisers.cs b/examples/Dfa/CSharp/v1_20/GetAdvertisers.cs new file mode 100644 index 00000000000..af0dcfb719c --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetAdvertisers.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example displays advertiser name, id and spotlight + /// configuration id for the given search criteria. Results are limited to + /// first 10 records. + /// + /// Tags: advertiser.getAdvertisers + /// + class GetAdvertisers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays advertiser name, id and spotlight configuration" + + " id for the given search criteria. Results are limited to first 10 records."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdvertisers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create AdvertiserRemoteService instance. + AdvertiserRemoteService service = (AdvertiserRemoteService) user.GetService( + DfaService.v1_20.AdvertiserRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Create advertiser search criteria structure. + AdvertiserSearchCriteria advSearchCriteria = new AdvertiserSearchCriteria(); + advSearchCriteria.pageSize = 10; + advSearchCriteria.searchString = searchString; + + try { + // Get advertiser record set. + AdvertiserRecordSet recordSet = service.getAdvertisers(advSearchCriteria); + + // Display advertiser names, ids and spotlight configuration ids. + if (recordSet.records != null) { + foreach (Advertiser result in recordSet.records) { + Console.WriteLine("Advertiser with name \"{0}\", id \"{1}\", and spotlight " + + "configuration id \"{2}\" was found.", result.name, result.id, result.spotId); + } + } else { + Console.WriteLine("No advertisers found for your criteria."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve advertisers. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetAvailablePermissions.cs b/examples/Dfa/CSharp/v1_20/GetAvailablePermissions.cs new file mode 100644 index 00000000000..826d3d46277 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetAvailablePermissions.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example displays all of the available permissions that a user + /// role or subnetwork may be endowed with. To get a subnetwork id, run + /// GetSubnetworks.cs. + /// + /// A user role may not be set with more permissions than the subnetwork it + /// belongs to. You may enter a subnetwork id to see the maximum permissions a + /// user role belonging to it can have, or enter "0" as the subnetwork id to + /// see all possible permissions. + /// + /// Tags: userrole.getAvailablePermissions + /// + class GetAvailablePermissions : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays all of the available permissions that a user role " + + "or subnetwork may be endowed with. To get a subnetwork id, run GetSubnetworks.cs.\n\n" + + "A user role may not be set with more permissions than the subnetwork it belongs to. " + + "You may enter a subnetwork id to see the maximum permissions a user role belonging to " + + "it can have, or enter '0' as the subnetwork id to see all possible permissions."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAvailablePermissions(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create UserRoleRemoteService instance. + UserRoleRemoteService service = (UserRoleRemoteService) user.GetService( + DfaService.v1_20.UserRoleRemoteService); + + long subnetworkId = long.Parse(_T("INSERT_SUBNETWORK_ID_HERE")); + + try { + // Get available permissions. + Permission[] permissions = service.getAvailablePermissions(subnetworkId); + + // Display permission name and its id. + if (permissions != null) { + foreach (Permission permission in permissions) { + Console.WriteLine("Permission with name \"{0}\" and id \"{1}\" was found.", + permission.name, permission.id); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to get permission. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetCampaigns.cs b/examples/Dfa/CSharp/v1_20/GetCampaigns.cs new file mode 100644 index 00000000000..1c06c24530e --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetCampaigns.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example gets existing campaigns based on a given search + /// criteria. Results are limited to the first 10. + /// + /// Tags: campaign.getCampaignsByCriteria + /// + class GetCampaigns : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets existing campaigns based on a given search criteria. " + + "Results are limited to the first 10."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCampaigns(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CampaignRemoteService instance. + CampaignRemoteService service = (CampaignRemoteService) user.GetService( + DfaService.v1_20.CampaignRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Create campaign search criteria structure. + CampaignSearchCriteria searchCriteria = new CampaignSearchCriteria(); + searchCriteria.pageSize = 10; + searchCriteria.searchString = searchString; + + try { + // Get the campaigns. + CampaignRecordSet recordSet = service.getCampaignsByCriteria(searchCriteria); + + // Display campaign names and ids. + if (recordSet.records != null) { + foreach (Campaign result in recordSet.records) { + Console.WriteLine("Campaign with name \"{0}\" and id \"{1}\" was found.", + result.name, result.id); + } + } else { + Console.WriteLine("No campaigns found for your search criteria."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve campaigns. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetChangeLogForAdvertiser.cs b/examples/Dfa/CSharp/v1_20/GetChangeLogForAdvertiser.cs new file mode 100644 index 00000000000..56240102d12 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetChangeLogForAdvertiser.cs @@ -0,0 +1,104 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example displays the change logs of a specified advertiser + /// object. Results are limited to the first 10 records. + /// + /// A similar pattern can be applied to get change logs for many other object + /// types. Run GetChangeLogObjectTypes.cs for a list of other supported object + /// types and their id numbers. + /// + /// Tags: changelog.getChangeLogRecords + /// + class GetChangeLogForAdvertiser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays the change logs of a specified advertiser object. " + + "Results are limited to the first 10 records.\n\nA similar pattern can be applied " + + "to get change logs for many other object types. Run GetChangeLogObjectTypes.cs " + + "for a list of other supported object types and their id numbers."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetChangeLogForAdvertiser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create ChangeLogRemoteService instance. + ChangeLogRemoteService service = (ChangeLogRemoteService) user.GetService( + DfaService.v1_20.ChangeLogRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + + // Create change log search criteria structure. + ChangeLogRecordSearchCriteria searchCritera = new ChangeLogRecordSearchCriteria(); + searchCritera.pageSize = 10; + searchCritera.objectId = advertiserId; + // The following field has been filled in to choose advertiser change + // logs. This values was determined using GetChangeLogObjectTypes.cs. + searchCritera.objectTypeId = 1; + + try { + // Get change log record set. + ChangeLogRecordSet changeLogRecordSet = service.getChangeLogRecords(searchCritera); + + // Set up a formatter to make the change log timestamps human-readable. + string dateFormat = "yyyy-M-d H:m:s"; + + // Display the contents of each change log record + if (changeLogRecordSet != null && changeLogRecordSet.records != null) { + foreach (ChangeLogRecord changeLogRecord in changeLogRecordSet.records) { + Console.WriteLine("Action \"{0}\", Context \"{1}\", Change Date \"{2}\", New Value " + + "\"{3}\", Old Value \"{4}\", Profile Name \"{5}\" was found.", + changeLogRecord.action, changeLogRecord.context, + changeLogRecord.changeDate.Value.ToString(dateFormat), changeLogRecord.newValue, + changeLogRecord.oldValue, changeLogRecord.username); + } + } else { + Console.WriteLine("No change logs found for your search criteria."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve change logs. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetChangeLogObjectTypes.cs b/examples/Dfa/CSharp/v1_20/GetChangeLogObjectTypes.cs new file mode 100644 index 00000000000..c491090dd4a --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetChangeLogObjectTypes.cs @@ -0,0 +1,76 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example displays change log object type names and ids. + /// + /// Tags: changelog.getChangeLogObjectTypes + /// + class GetChangeLogObjectTypes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays change log object type names and ids."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetChangeLogObjectTypes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create ChangeLogRemoteService instance. + ChangeLogRemoteService service = (ChangeLogRemoteService) user.GetService( + DfaService.v1_20.ChangeLogRemoteService); + + try { + // Get change log object types + ChangeLogObjectType[] changeLogObjectTypes = service.getChangeLogObjectTypes(); + + // Display change log object type names and ids. + foreach (ChangeLogObjectType changeLogObjectType in changeLogObjectTypes) { + Console.WriteLine("Change Log Object type with name \"{0}\" and id \"{1}\" was found.", + changeLogObjectType.name, changeLogObjectType.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get change log types. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetContentCategories.cs b/examples/Dfa/CSharp/v1_20/GetContentCategories.cs new file mode 100644 index 00000000000..475b45addc7 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetContentCategories.cs @@ -0,0 +1,90 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example displays available content categories for a given search + /// string. Results are limited to 10. + /// + /// Tags: contentcategory.getContentCategories + /// + class GetContentCategories : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays available content categories for a given search " + + "string. Results are limited to 10."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetContentCategories(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeRemoteService instance. + ContentCategoryRemoteService service = (ContentCategoryRemoteService) user.GetService( + DfaService.v1_20.ContentCategoryRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Create content category search criteria structure. + ContentCategorySearchCriteria searchCriteria = new ContentCategorySearchCriteria(); + searchCriteria.pageSize = 10; + searchCriteria.searchString = searchString; + + try { + // Get content category record set. + ContentCategoryRecordSet contentCategoryRecordSet = + service.getContentCategories(searchCriteria); + + // Display content category names, ids and descriptions. + if (contentCategoryRecordSet != null && contentCategoryRecordSet.records != null) { + foreach (ContentCategory contentCategory in contentCategoryRecordSet.records) { + Console.WriteLine("Content category with name \"{0}\" and id \"{1}\" was found.", + contentCategory.name, contentCategory.id); + } + } else { + Console.WriteLine("No content categories found for your search criteria."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get content categories. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetCountries.cs b/examples/Dfa/CSharp/v1_20/GetCountries.cs new file mode 100644 index 00000000000..91b90488b03 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetCountries.cs @@ -0,0 +1,83 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example displays the country names, country codes and + /// information whether country supports secure server. + /// + /// Tags: creativefield.getCreativeFields + /// + class GetCountries : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays the country names, country codes and information " + + "whether country supports secure server."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCountries(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create SpotlightRemoteService instance. + SpotlightRemoteService service = (SpotlightRemoteService) user.GetService( + DfaService.v1_20.SpotlightRemoteService); + + // Set search criteria. + CountrySearchCriteria countrySearchCriteria = new CountrySearchCriteria(); + countrySearchCriteria.secure = false; + + try { + // Get countries. + Country[] countries = service.getCountriesByCriteria(countrySearchCriteria); + + // Display country names, codes and secure server support information. + if (countries != null) { + foreach (Country result in countries) { + Console.WriteLine("Country name \"{0}\", country code \"{1}\", supports a secure " + + "server? \"{2}\".", result.name, result.id, result.secure); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve countries. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetCreativeField.cs b/examples/Dfa/CSharp/v1_20/GetCreativeField.cs new file mode 100644 index 00000000000..76bc4f709e9 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetCreativeField.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example retrieves available creative fields for a given string + /// and displays the name, id, advertiser id, and number of values. Results + /// are limited to the first 10. + /// + /// Tags: creativefield.getCreativeFields + /// + class GetCreativeField : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves available creative fields for a given string and " + + "displays the name, id, advertiser id, and number of values. Results are limited " + + "to the first 10."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeField(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeFieldRemoteService instance. + CreativeFieldRemoteService service = (CreativeFieldRemoteService) user.GetService( + DfaService.v1_20.CreativeFieldRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Set up creative field search criteria structure. + CreativeFieldSearchCriteria creativeFieldSearchCriteria = new CreativeFieldSearchCriteria(); + creativeFieldSearchCriteria.pageSize = 10; + creativeFieldSearchCriteria.searchString = searchString; + + + try { + // Get creative fields for the selected criteria. + CreativeFieldRecordSet creativeFields = + service.getCreativeFields(creativeFieldSearchCriteria); + + // Display creative field names, ids, advertiser ids, and number of values. + if (creativeFields != null && creativeFields.records != null) { + foreach (CreativeField creativeField in creativeFields.records) { + Console.WriteLine("Creative field with name \"{0}\", id \"{1}\", Advertiser id " + + "\"{2}\", and containing \"{3}\" values was found.", creativeField.name, + creativeField.id, creativeField.advertiserId, creativeField.totalNumberOfValues); + } + } else { + Console.WriteLine("No creative fields found for your search criteria"); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve creative fields. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetCreativeFieldValues.cs b/examples/Dfa/CSharp/v1_20/GetCreativeFieldValues.cs new file mode 100644 index 00000000000..86f3f2d625a --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetCreativeFieldValues.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example retrieves available creative field values for a given + /// string and displays the names and ids. + /// + /// Tags: creativefield.getCreativeFieldValues + /// + class GetCreativeFieldValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves available creative field values for a given string " + + "and displays the names and ids."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeFieldValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeFieldRemoteService instance. + CreativeFieldRemoteService service = (CreativeFieldRemoteService) user.GetService( + DfaService.v1_20.CreativeFieldRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Set up creative field value search criteria structure. + CreativeFieldValueSearchCriteria creativeValueSearchCriteria = + new CreativeFieldValueSearchCriteria(); + creativeValueSearchCriteria.pageSize = 10; + creativeValueSearchCriteria.searchString = searchString; + + try { + // Get creative field values for the selected criteria. + CreativeFieldValueRecordSet creativeFieldValues = + service.getCreativeFieldValues(creativeValueSearchCriteria); + + // Display creative field value names and ids. + if (creativeFieldValues != null && creativeFieldValues.records != null) { + foreach (CreativeFieldValue creativeFieldValue in creativeFieldValues.records) { + Console.WriteLine("Creative field value with name \"{0}\" and id \"{1}\" was found.", + creativeFieldValue.name, creativeFieldValue.id); + } + } else { + Console.WriteLine("No creative field values found for your criteria"); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve creative field values. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetCreativeGroups.cs b/examples/Dfa/CSharp/v1_20/GetCreativeGroups.cs new file mode 100644 index 00000000000..25edcc2802d --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetCreativeGroups.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example retrieves available creative groups for a given + /// advertiser and displays the name, id, advertiser id, and group number. + /// To get an advertiser id, run GetAdvertisers.cs. Results are limited + /// to the first 10. + /// + /// Tags: creativegroup.getCreativeGroups + /// + class GetCreativeGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves available creative groups for a given advertiser " + + "and displays the name, id, advertiser id, and group number. To get an advertiser id," + + " run GetAdvertisers.cs. Results are limited to the first 10."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeGroupRemoteService instance. + CreativeGroupRemoteService service = (CreativeGroupRemoteService) user.GetService( + DfaService.v1_20.CreativeGroupRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + + // Set up creative group search criteria structure. + CreativeGroupSearchCriteria creativeGroupSearchCriteria = new CreativeGroupSearchCriteria(); + creativeGroupSearchCriteria.advertiserIds = new long[] {advertiserId}; + + try { + // Get creatives groups for the selected criteria. + CreativeGroupRecordSet creativeGroups = + service.getCreativeGroups(creativeGroupSearchCriteria); + + // Display creative group names, ids, advertiser ids, and group numbers. + if (creativeGroups != null && creativeGroups.records != null) { + foreach (CreativeGroup creativeGroup in creativeGroups.records) { + Console.WriteLine("Creative group with name \"{0}\" , id \"{1}\", advertiser id " + + "\"{2}\" and group number \"{3}\" was found.", creativeGroup.name, + creativeGroup.id, creativeGroup.advertiserId, creativeGroup.groupNumber); + } + } else { + Console.WriteLine("No creative groups found for your search criteria"); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve creative groups. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetCreativeTypes.cs b/examples/Dfa/CSharp/v1_20/GetCreativeTypes.cs new file mode 100644 index 00000000000..3303853ef10 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetCreativeTypes.cs @@ -0,0 +1,77 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example gets available creative types and displays the name and + /// id for each type. + /// + /// Tags: creative.getCreativeTypes + /// + class GetCreativeTypes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets available creative types and displays the name and id " + + "for each type."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeTypes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeRemoteService instance. + CreativeRemoteService service = (CreativeRemoteService) user.GetService( + DfaService.v1_20.CreativeRemoteService); + + try { + // Get creative types. + CreativeType[] creativeTypes = service.getCreativeTypes(); + + // Display creative types and ids. + foreach (CreativeType result in creativeTypes) { + Console.WriteLine("Creative type name \"{0}\" with id \"{1}\" was found.", + result.name, result.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve creative types. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetCreatives.cs b/examples/Dfa/CSharp/v1_20/GetCreatives.cs new file mode 100644 index 00000000000..75a7d619edc --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetCreatives.cs @@ -0,0 +1,90 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example retrieves available creatives for a given advertiser + /// and displays the name and id. To create an advertiser, run + /// CreateAdvertiser.cs. Results are limited to the first 10. + /// + /// Tags: creative.getCreatives + /// + class GetCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves available creatives for a given advertiser and " + + "displays the name and id. To create an advertiser, run CreateAdvertiser.cs. " + + "Results are limited to the first 10."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create CreativeRemoteService instance. + CreativeRemoteService service = (CreativeRemoteService) user.GetService( + DfaService.v1_20.CreativeRemoteService); + + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + + // Set up creative search criteria structure. + CreativeSearchCriteria creativeSearchCriteria = new CreativeSearchCriteria(); + creativeSearchCriteria.pageSize = 10; + creativeSearchCriteria.advertiserId = advertiserId; + + try { + // Get creatives for the selected criteria. + CreativeRecordSet creatives = service.getCreatives(creativeSearchCriteria); + + // Display creative name and its id. + if (creatives != null && creatives.records != null) { + foreach (CreativeBase result in creatives.records) { + Console.WriteLine("Creative with name \"{0}\" and id \"{1}\" was found.", + result.name, result.id); + } + } else { + Console.WriteLine("No creatives found for your criteria"); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetDFASite.cs b/examples/Dfa/CSharp/v1_20/GetDFASite.cs new file mode 100644 index 00000000000..dae148bb373 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetDFASite.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example gets existing DFA sites based on a given search + /// criteria. Results are limited to the first 10. + /// + /// Tags: site.getDfaSites + /// + class GetDFASite : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets existing DFA sites based on a given search criteria. " + + "Results are limited to the first 10."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetDFASite(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create SiteRemoteService instance. + SiteRemoteService service = (SiteRemoteService) user.GetService( + DfaService.v1_20.SiteRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Create DFA site search criteria structure. + DfaSiteSearchCriteria searchCriteria = new DfaSiteSearchCriteria(); + searchCriteria.pageSize = 10; + searchCriteria.searchString = searchString; + + try { + // Get the sites. + + DfaSiteRecordSet dfaSiteRecordSet = service.getDfaSites(searchCriteria); + + // Display DFA site names and ids. + if (dfaSiteRecordSet != null && dfaSiteRecordSet.records != null) { + foreach (DfaSite dfaSite in dfaSiteRecordSet.records) { + Console.WriteLine("DFA site with name \"{0}\" and id \"{1}\" was found.", + dfaSite.name, dfaSite.id); + } + } else { + Console.WriteLine("No DFA sites found for your search criteria."); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve DFA sites. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetPlacementStrategies.cs b/examples/Dfa/CSharp/v1_20/GetPlacementStrategies.cs new file mode 100644 index 00000000000..a749da413fb --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetPlacementStrategies.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example displays available placement strategies for a given + /// search string. Results are limited to 10. + /// + /// Tags: strategy.getPlacementStrategiesByCriteria + /// + class GetPlacementStrategies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays available placement strategies for a given search " + + "string. Results are limited to 10."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPlacementStrategies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create PlacementStrategyRemoteService instance. + PlacementStrategyRemoteService service = (PlacementStrategyRemoteService) user.GetService( + DfaService.v1_20.PlacementStrategyRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Create placement strategy search criteria structure. + PlacementStrategySearchCriteria placementStrategySearchCriteria = + new PlacementStrategySearchCriteria(); + placementStrategySearchCriteria.pageSize = 10; + placementStrategySearchCriteria.searchString = searchString; + + try { + // Get placement strategy record set. + PlacementStrategyRecordSet placementStrategyRecordSet = + service.getPlacementStrategiesByCriteria(placementStrategySearchCriteria); + + // Display placement strategy names, ids and descriptions. + if (placementStrategyRecordSet != null && placementStrategyRecordSet.records != null) { + foreach (PlacementStrategy strategy in placementStrategyRecordSet.records) { + Console.WriteLine("Placement Strategy with name \"{0}\" and id \"{1}\" was found.", + strategy.name, strategy.id); + } + } else { + Console.WriteLine("No placement strategies found for your criteria."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve placement strategies. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetPlacementTypes.cs b/examples/Dfa/CSharp/v1_20/GetPlacementTypes.cs new file mode 100644 index 00000000000..8e7ae8137ff --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetPlacementTypes.cs @@ -0,0 +1,77 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example displays placement type names and ids. + /// + /// Tags: placement.getPlacementTypes + /// + class GetPlacementTypes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays placement type names and ids."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPlacementTypes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create PlacementRemoteService instance. + PlacementRemoteService service = (PlacementRemoteService) user.GetService( + DfaService.v1_20.PlacementRemoteService); + + try { + // Get placement types. + PlacementType[] placements = service.getPlacementTypes(); + + // Display placement type names and ids. + if (placements != null) { + foreach (PlacementType result in placements) { + Console.WriteLine("Placment type with name \"{0}\" and id \"{1}\" was found.", + result.name, result.id); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve placement types. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetPlacements.cs b/examples/Dfa/CSharp/v1_20/GetPlacements.cs new file mode 100644 index 00000000000..f1fcd5b57b7 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetPlacements.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example displays available placements for a given search string. + /// Results are limited to 10. + /// + /// Tags: placement.getPlacementsByCriteria + /// + class GetPlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays available placements for a given search string. " + + "Results are limited to 10."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create PlacementRemoteService instance. + PlacementRemoteService service = (PlacementRemoteService) user.GetService( + DfaService.v1_20.PlacementRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_HERE"); + + // Set placement search criteria. + PlacementSearchCriteria searchCriteria = new PlacementSearchCriteria(); + searchCriteria.pageSize = 10; + searchCriteria.searchString = searchString; + + try { + // Get placements. + PlacementRecordSet placements = service.getPlacementsByCriteria(searchCriteria); + + // Display placment names and ids. + if (placements.records != null) { + foreach (Placement result in placements.records) { + Console.WriteLine("Placment with name \"{0}\" and id \"{1}\" was found.", + result.name, result.id); + } + } else { + Console.WriteLine("No placements found for your criteria"); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve placements. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetPricingTypes.cs b/examples/Dfa/CSharp/v1_20/GetPricingTypes.cs new file mode 100644 index 00000000000..38492d4757d --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetPricingTypes.cs @@ -0,0 +1,77 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example displays placement pricing type names and ids. + /// + /// Tags: placement.getPricingTypes + /// + class GetPricingTypes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays placement pricing type names and ids."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPricingTypes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create PlacementRemoteService instance. + PlacementRemoteService service = (PlacementRemoteService) user.GetService( + DfaService.v1_20.PlacementRemoteService); + + try { + // Get pricing types. + PricingType[] pricingTypes = service.getPricingTypes(); + + // Display placement type names and ids. + if (pricingTypes != null) { + foreach (PricingType result in pricingTypes) { + Console.WriteLine("Pricing type with name \"{0}\" and id \"{1}\" was found.", + result.name, result.id); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve pricing types. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetReport.cs b/examples/Dfa/CSharp/v1_20/GetReport.cs new file mode 100644 index 00000000000..64a9151b830 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetReport.cs @@ -0,0 +1,82 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example fetches information about a report, including its + /// status (pending, running, complete, etc.) and a URL where it can be + /// downloaded if completed. To get a report ID, run RunDeferredReport.cs. + /// + /// Tags: report.getReport + /// + class GetReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example fetches information about a report, including its status " + + "(pending, running, complete, etc.) and a URL where it can be downloaded if " + + "completed. To get a report ID, run RunDeferredReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create ReportRemoteService instance. + ReportRemoteService service = (ReportRemoteService) user.GetService( + DfaService.v1_20.ReportRemoteService); + + long reportId = long.Parse(_T("INSERT_REPORT_ID_HERE")); + + // Create report request object. + ReportRequest reportRequest = new ReportRequest(); + reportRequest.reportId = reportId; + + try { + // Get report information. + ReportInfo reportInfo = service.getReport(reportRequest); + // Display information on the report. + Console.WriteLine("Report with ID '{0}', status of '{1}', and URL of '{2}' was found.", + reportInfo.reportId, reportInfo.status.name, reportInfo.url); + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve report. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetReports.cs b/examples/Dfa/CSharp/v1_20/GetReports.cs new file mode 100644 index 00000000000..1fd103ffaf6 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetReports.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example fetches information about all reports generated from + /// the same query, including their status (pending, running, complete, etc.) + /// and URLs where they can be downloaded if completed. There is currently no + /// way to get a query ID through the DFA API; you must use the website + /// interface or the Java DART API instead. + /// + /// Tags: report.getReportsByCriteria + /// + class GetReports : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example fetches information about all reports generated from the " + + "same query, including their status (pending, running, complete, etc.) and URLs " + + "where they can be downloaded if completed. There is currently no way to get a " + + "query ID through the DFA API; you must use the website interface or the Java DART " + + "API instead."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetReports(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create ReportRemoteService instance. + ReportRemoteService service = (ReportRemoteService) user.GetService( + DfaService.v1_20.ReportRemoteService); + + long queryId = long.Parse(_T("INSERT_QUERY_ID_HERE")); + + // Create report search criteria object. + ReportSearchCriteria reportSearchCriteria = new ReportSearchCriteria(); + reportSearchCriteria.queryId = queryId; + + try { + // Get report information. + ReportInfoRecordSet reportInfoRecordSet = + service.getReportsByCriteria(reportSearchCriteria); + + // Display information on reports. + if (reportInfoRecordSet.records != null && reportInfoRecordSet.records.Length > 0) { + foreach (ReportInfo report in reportInfoRecordSet.records) { + Console.WriteLine("Report with ID '{0}', status of '{1}' and URL of '{2}' was found.", + report.reportId, report.status, report.url); + } + } else { + Console.WriteLine("No reports found for your query ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve all reports. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetSize.cs b/examples/Dfa/CSharp/v1_20/GetSize.cs new file mode 100644 index 00000000000..9d2baee4aea --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetSize.cs @@ -0,0 +1,84 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example gets the size id for a given width and height. + /// + /// Tags: size.getSize + /// + class GetSize : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the size id for a given width and height."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetSize(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create SizeRemoteService instance. + SizeRemoteService service = (SizeRemoteService) user.GetService( + DfaService.v1_20.SizeRemoteService); + + int width = int.Parse(_T("INSERT_WIDTH_HERE")); + int height = int.Parse(_T("INSERT_HEIGHT_HERE")); + + SizeSearchCriteria criteria = new SizeSearchCriteria(); + criteria.width = width; + criteria.height = height; + + try { + // Get size. + SizeRecordSet sizeRecords = service.getSizes(criteria); + + if (sizeRecords.records != null) { + foreach (Size size in sizeRecords.records) { + // Display size id. + Console.WriteLine("Size id for \"{0}\" width and \"{1}\" height is \"{2}\".", + size.width, size.height, size.id); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve size. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetSubnetworks.cs b/examples/Dfa/CSharp/v1_20/GetSubnetworks.cs new file mode 100644 index 00000000000..3ce53f2b2a7 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetSubnetworks.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example displays subnetwork names, ids, and subnetwork ids for + /// a given search string. Results are limited to 10. + /// + /// Tags: subnetwork.getSubnetworks + /// + class GetSubnetworks : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays subnetwork names, ids, and subnetwork ids for a given " + + "search string. Results are limited to 10."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetSubnetworks(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create SubnetworkRemoteService instance. + SubnetworkRemoteService service = (SubnetworkRemoteService) user.GetService( + DfaService.v1_20.SubnetworkRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Set subnetwork search criteria. + SubnetworkSearchCriteria searchCriteria = new SubnetworkSearchCriteria(); + searchCriteria.pageSize = 10; + searchCriteria.searchString = searchString; + + try { + // Get subnetworks. + SubnetworkRecordSet subnetworks = service.getSubnetworks(searchCriteria); + + // Display subnetwork names, ids, and subnetwork ids. + if (subnetworks != null && subnetworks.records != null) { + foreach (Subnetwork subNetwork in subnetworks.records) { + Console.WriteLine("Subnetwork with name \"{0}\", id \"{1}\", and Subnetwork id " + + "\"{2}\" was found.", subNetwork.name, subNetwork.id, subNetwork.networkId); + } + } else { + Console.WriteLine("No subnetworks found for your criteria."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve subnetworks. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetTagMethodTypes.cs b/examples/Dfa/CSharp/v1_20/GetTagMethodTypes.cs new file mode 100644 index 00000000000..a6b8aec59bb --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetTagMethodTypes.cs @@ -0,0 +1,76 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example displays activity method type names and ids. + /// + /// Tags: spotlight.getSpotlightTagMethodTypes + /// + class GetTagMethodTypes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays activity method type names and ids."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetTagMethodTypes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create SpotlightRemoteService instance. + SpotlightRemoteService service = (SpotlightRemoteService) user.GetService( + DfaService.v1_20.SpotlightRemoteService); + + try { + // Get method types. + SpotlightTagMethodType[] spotlightTagMethodTypes = service.getSpotlightTagMethodTypes(); + + //Display method type names and ids. + foreach (SpotlightTagMethodType result in spotlightTagMethodTypes) { + Console.WriteLine("Method type with name \"{0}\" and id \"{1}\" was found.", + result.name, result.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve tag method types. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetUserFilterTypes.cs b/examples/Dfa/CSharp/v1_20/GetUserFilterTypes.cs new file mode 100644 index 00000000000..22bfb1ff1c7 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetUserFilterTypes.cs @@ -0,0 +1,79 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example displays user filter criteria type names and ids. + /// + /// Tags: user.getAvailableUserFilterCriteriaTypes + /// + class GetUserFilterTypes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays user filter criteria type names and ids."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUserFilterTypes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create UserRemoteService instance. + UserRemoteService service = (UserRemoteService) user.GetService( + DfaService.v1_20.UserRemoteService); + + try { + // Get user filter criteria types. + UserFilterCriteriaType[] userFilterCriteriaTypes = + service.getAvailableUserFilterCriteriaTypes(); + + // Display user filter criteria types. + if (userFilterCriteriaTypes != null) { + foreach (UserFilterCriteriaType userFilterCriteriaType in userFilterCriteriaTypes) { + Console.WriteLine("User Filter Criteria type with name \"{0}\" and id \"{1}\" " + + "was found.", userFilterCriteriaType.name, userFilterCriteriaType.id); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve user filter and criteria types. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetUserRoles.cs b/examples/Dfa/CSharp/v1_20/GetUserRoles.cs new file mode 100644 index 00000000000..90fd28b3d34 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetUserRoles.cs @@ -0,0 +1,102 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example displays user role name, id, subnetwork id, number of + /// assigned users, and assigned permissions for the given search criteria. + /// Results are limited to the first 10 records. + /// + /// Tags: userrole.getUserRoles + /// + class GetUserRoles : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example displays user role name, id, subnetwork id, number of assigned users" + + ", and assigned permissions for the given search criteria. Results are limited to the" + + " first 10 records."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUserRoles(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create UserRoleRemoteService instance. + UserRoleRemoteService service = (UserRoleRemoteService) user.GetService( + DfaService.v1_20.UserRoleRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Set user role search criteria. + UserRoleSearchCriteria userRoleSearchCriteria = new UserRoleSearchCriteria(); + userRoleSearchCriteria.pageSize = 10; + userRoleSearchCriteria.searchString = searchString; + + try { + // Get user roles that match the search criteria. + UserRoleRecordSet result = service.getUserRoles(userRoleSearchCriteria); + + // Display user role names, ids, subnetwork ids, number of assigned users, + // and assigned permissions. + if (result != null && result.userRoles != null) { + foreach (UserRole userRole in result.userRoles) { + Console.WriteLine("User role with name \"{0}\", id \"{1}\", subnetwork id \"{2}\", " + + "and assigned to \"{3}\" users was found.", userRole.name, userRole.id, + userRole.subnetworkId, userRole.totalAssignedUsers); + + if (userRole.permissions != null && userRole.permissions.Length != 0) { + Console.WriteLine(" The above user role has the following permissions:"); + foreach (Permission permission in userRole.permissions) { + Console.WriteLine(" Permission with name \"{0}\" and id \"{1}\".", + permission.name, permission.id); + } + } else { + Console.WriteLine(" The above user role has no permissions assigned."); + } + } + } else { + Console.WriteLine("No user roles found for your criteria."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve user roles. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/GetUsers.cs b/examples/Dfa/CSharp/v1_20/GetUsers.cs new file mode 100644 index 00000000000..143b3ad47e0 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/GetUsers.cs @@ -0,0 +1,90 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example displays user name, id, network id, subnetwork id, + /// and user group id for the given search criteria. Results are limited + /// to the first 10 records. + /// + /// Tags: user.getUsersByCriteria + /// + class GetUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example displays user name, id, network id, subnetwork id, and user " + + "group id for the given search criteria. Results are limited to the first 10 records."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create UserRemoteService instance. + UserRemoteService service = (UserRemoteService) user.GetService( + DfaService.v1_20.UserRemoteService); + + String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE"); + + // Set user search criteria. + UserSearchCriteria searchCriteria = new UserSearchCriteria(); + searchCriteria.pageSize = 10; + searchCriteria.searchString = searchString; + + try { + // Get users that match the search criteria. + UserRecordSet users = service.getUsersByCriteria(searchCriteria); + + // Display user names, ids, network ids, subnetwork ids, and group ids. + if (users != null && users.records != null) { + foreach (User userResult in users.records) { + Console.WriteLine("User with name \"{0}\", id \"{1}\", network id \"{2}\", subnetwork" + + " id \"{3}\", and user group id \"{4}\" was found.", userResult.name, userResult.id, + userResult.networkId, userResult.subnetworkId, userResult.userGroupId); + } + } else { + Console.WriteLine("No users found for your search criteria."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to retrieve users. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/ModifyInStreamMediaFilesAndAds.cs b/examples/Dfa/CSharp/v1_20/ModifyInStreamMediaFilesAndAds.cs new file mode 100644 index 00000000000..7ea1114cc18 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/ModifyInStreamMediaFilesAndAds.cs @@ -0,0 +1,118 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example retrieves an In-Stream video creative and modifies its + /// media files, companion ads, and non-linear ads. You are not given the + /// opportunity to set the fields on these components when they are created by + /// uploading creative assets. Therefore, you must upload the assets first and + /// then set any additional fields in a second request. + /// + /// To create an In-Stream video creative, run CreateInStreamVideoCreative.cs. + /// To add an In-Stream asset to an In-Stream video creative, run + /// UploadInStreamAsset.cs. + /// + /// Tags: creative.saveCreative + /// + class ModifyInStreamMediaFilesAndAds : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves an In-Stream video creative and modifies its media " + + "files, companion ads, and non-linear ads. You are not given the opportunity to " + + "set the fields on these components when they are created by uploading creative " + + "assets. Therefore, you must upload the assets first and then set any additional " + + "fields in a second request.\nTo create an In-Stream video creative, run " + + "CreateInStreamVideoCreative.cs. To add an In-Stream asset to an In-Stream video " + + "creative, run UploadInStreamAsset.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ModifyInStreamMediaFilesAndAds(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Request the creative service from the service client factory. + CreativeRemoteService creativeService = (CreativeRemoteService) user.GetService( + DfaService.v1_20.CreativeRemoteService); + + long creativeId = long.Parse(_T("INSERT_IN_STREAM_VIDEO_CREATIVE_ID_HERE")); + + try { + // Fetch the In-Stream video creative which contains the asset to modify. + CreativeBase rawCreative = creativeService.getCreative(creativeId); + + if (!(rawCreative is InStreamVideoCreative)) { + Console.WriteLine("Unable to update creative with ID \"{0}\": not an In-Stream video " + + "creative.", creativeId); + } else { + InStreamVideoCreative inStreamVideoCreative = (InStreamVideoCreative) rawCreative; + + // Modify the media files, companion ads, and/or non-linear ads. + if (inStreamVideoCreative.mediaFiles != null) { + foreach (InStreamMediaFile mediaFile in inStreamVideoCreative.mediaFiles) { + mediaFile.pickedToServe = !mediaFile.pickedToServe; + } + } + + if (inStreamVideoCreative.companionAds != null) { + foreach (InStreamCompanionAd companionAd in inStreamVideoCreative.companionAds) { + companionAd.altText = companionAd.altText + " Updated."; + } + } + + if (inStreamVideoCreative.nonLinearAds != null) { + foreach (InStreamNonLinearAd nonLinearAd in inStreamVideoCreative.nonLinearAds) { + nonLinearAd.scalable = !nonLinearAd.scalable; + } + } + + CreativeSaveResult creativeSaveResult = + creativeService.saveCreative(inStreamVideoCreative, 0); + + Console.WriteLine("Updated the In-Stream assets of In-Stream video creative with ID " + + "\"{0}\".", creativeSaveResult.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update in-stream assets of in-stream video creative. " + + "Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/RCReport.cs b/examples/Dfa/CSharp/v1_20/RCReport.cs new file mode 100644 index 00000000000..78bda781646 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/RCReport.cs @@ -0,0 +1,158 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; +using System.Threading; +using System.IO; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example mimics the RCRunner file "RCReport" but uses the DFA + /// API instead of the Java DART API. It shows how to request the generation + /// of a deferred report, how to check to see when it is done, and how to + /// download it when it is completed. + /// + /// Tags: report.getReport, report.runDeferredReport + /// + class RCReport : SampleBase { + /// + /// Time to wait between checks for report status. + /// + private const int TIME_BETWEEN_CHECKS = 10 * 60 * 1000; + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example mimics the RCRunner file 'RCReport' but uses the DFA API " + + "instead of the Java DART API. It shows how to request the generation of a " + + "deferred report, how to check to see when it is done, and how to download it " + + "when it is completed."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + if (args.Length != 4) { + Console.WriteLine("This program requires 4 command line arguments:"); + Console.WriteLine("\t1. DFA username\n\t2. DFA password\n" + + "\t3. Query ID number\n\t4. Output filename."); + Console.WriteLine("Example usage: RCReport.exe username@dfa password456 " + + "12345 report.zip"); + } + + RCReport codeExample = new RCReport(); + Console.WriteLine(codeExample.Description); + DfaUser user = new DfaUser(); + ReportRemoteService reportService = (ReportRemoteService) user.GetService( + DfaService.v1_20.ReportRemoteService); + LoginRemoteService loginService = (LoginRemoteService) user.GetService( + DfaService.v1_20.LoginRemoteService); + + codeExample.ScheduleAndDownloadReport(loginService, reportService, args[0], args[1], + long.Parse(args[2]), args[3]); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + string userName = _T("INSERT_USERNAME_HERE"); + string password = _T("INSERT_PASSWORD_HERE"); + long queryId = long.Parse(_T("INSERT_QUERY_ID_HERE")); + string filePath = _T("INSERT_PATH_TO_SAVE_REPORT_HERE"); + + ReportRemoteService reportService = (ReportRemoteService) user.GetService( + DfaService.v1_20.ReportRemoteService); + LoginRemoteService loginService = (LoginRemoteService) user.GetService( + DfaService.v1_20.LoginRemoteService); + + ScheduleAndDownloadReport(loginService, reportService, userName, password, queryId, filePath); + } + + /// + /// Schedules and downloads a report. + /// + /// The login service instance. + /// The report service instance. + /// The user name to be used for authentication + /// purposes. + /// The password to be used for authentication + /// purposes. + /// The query id to be used for generating reports. + /// + /// The file path to which the downloaded report + /// should be saved. + public void ScheduleAndDownloadReport(LoginRemoteService loginService, + ReportRemoteService reportService, string userName, string password, long queryId, + string filePath) { + + // Override the credentials in App.config with the ones the user + // provided. + string authToken = loginService.authenticate(userName, password).token; + + reportService.Token.Username = userName; + reportService.Token.Password = authToken; + + // Create report request and submit it to the server. + ReportRequest reportRequest = new ReportRequest(); + reportRequest.queryId = queryId; + + try { + ReportInfo reportInfo = reportService.runDeferredReport(reportRequest); + long reportId = reportInfo.reportId; + Console.WriteLine("Report with ID '{0}' has been scheduled.", reportId); + + reportRequest.reportId = reportId; + + while (reportInfo.status.name != "COMPLETE") { + Console.WriteLine("Still waiting for report with ID '{0}', current status is '{1}'.", + reportId, reportInfo.status.name); + Console.WriteLine("Waiting 10 minutes before checking on report status."); + // Wait 10 minutes. + Thread.Sleep(TIME_BETWEEN_CHECKS); + reportInfo = reportService.getReport(reportRequest); + if (reportInfo.status.name == "ERROR") { + throw new Exception("Deferred report failed with errors. Run in the UI to " + + "troubleshoot."); + } + } + + using (FileStream fs = File.OpenWrite(filePath)) { + byte[] bytes = MediaUtilities.GetAssetDataFromUrl(reportInfo.url); + fs.Write(bytes, 0, bytes.Length); + } + + Console.WriteLine("Report successfully downloaded to '{0}'.", filePath); + } catch (Exception ex) { + Console.WriteLine("Failed to schedule and download report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/ReplaceInStreamAsset.cs b/examples/Dfa/CSharp/v1_20/ReplaceInStreamAsset.cs new file mode 100644 index 00000000000..1f33e0d8197 --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/ReplaceInStreamAsset.cs @@ -0,0 +1,111 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example replaces an In-Stream asset in an existing In-Stream + /// video creative with a new In-Stream asset. To create an In-Stream video + /// creative, run CreateInStreamVideoCreative.cs. To add an In-Stream asset to + /// an In-Stream video creative, run UploadInStreamAsset.cs. + /// + /// This code example replaces a companion ad asset in the target creative + /// because the companion flag on the + /// InStreamAssetUploadRequest was set to true. + /// You can use the same workflow to replace a non-linear ad by setting the + /// nonLinear flag instead. You may not use this method to swap + /// out media files (a.k.a. video assets). + /// + /// Tags: creative.replaceInStreamAsset + /// + class ReplaceInStreamAsset : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example replaces an In-Stream asset in an existing In-Stream video " + + "creative with a new In-Stream asset. To create an In-Stream video creative, " + + "run CreateInStreamVideoCreative.cs. To add an In-Stream asset to an In-Stream " + + "video creative, run UploadInStreamAsset.cs.\nThis code example replaces a " + + "companion ad asset in the target creative because the companion flag on the " + + "InStreamAssetUploadRequest was set to true. You can use the same workflow to " + + "replace a non-linear ad by setting the nonLinear flag instead. You may not use " + + "this method to swap out media files (a.k.a. video assets)."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ReplaceInStreamAsset(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Request the creative service from the service client factory. + CreativeRemoteService creativeService = (CreativeRemoteService) user.GetService( + DfaService.v1_20.CreativeRemoteService); + + string assetName = _T("INSERT_ASSET_NAME_HERE"); + string pathToFile = _T("INSERT_PATH_TO_FILE_HERE"); + long creativeId = long.Parse(_T("INSERT_IN_STREAM_VIDEO_CREATIVE_ID_HERE")); + string assetToReplace = _T("INSERT_ASSET_TO_REPLACE_HERE"); + + // Create the In-Stream creative asset. + CreativeAsset inStreamVideoAsset = new CreativeAsset(); + inStreamVideoAsset.name = assetName; + inStreamVideoAsset.content = MediaUtilities.GetAssetDataFromUrl( + new Uri(pathToFile).AbsoluteUri); + + // Create an upload request to make this asset a companion ad file for an + // existing In-Stream video creative. + InStreamAssetUploadRequest inStreamAssetUploadRequest = new InStreamAssetUploadRequest(); + inStreamAssetUploadRequest.companion = true; + inStreamAssetUploadRequest.inStreamAsset = inStreamVideoAsset; + inStreamAssetUploadRequest.creativeId = creativeId; + + try { + // Replace the existing asset with a newly uploaded asset. + InStreamVideoCreative inStreamVideoCreative = + creativeService.replaceInStreamAsset(assetToReplace, inStreamAssetUploadRequest); + + // Display a success message. + Console.WriteLine("Replaced companion ad asset \"{0}\" in In-Stream video creative " + + "with ID \"{1}\".%n", assetToReplace, inStreamVideoCreative.id); + + } catch (Exception ex) { + Console.WriteLine("Failed to replace companion ad asset in in-stream video creative. " + + "Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/RunDeferredReport.cs b/examples/Dfa/CSharp/v1_20/RunDeferredReport.cs new file mode 100644 index 00000000000..9b90d0db1dc --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/RunDeferredReport.cs @@ -0,0 +1,86 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example requests the generation of a report. Once the report + /// has been requested, you can continually get updates on the status of the + /// report until it is completed. There is currently no way to get a query ID + /// through the DFA API; you must use the website interface or the Java DART + /// API instead. To request an update on a report's status, run GetReport.cs. + /// + /// Tags: report.runDeferredReport + /// + class RunDeferredReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example requests the generation of a report. Once the report has been " + + "requested, you can continually get updates on the status of the report until it " + + "is completed. There is currently no way to get a query ID through the DFA API; " + + "you must use the website interface or the Java DART API instead. To request an " + + "update on a report's status, run GetReport.cs"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunDeferredReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Create ReportRemoteService instance. + ReportRemoteService service = (ReportRemoteService) user.GetService( + DfaService.v1_20.ReportRemoteService); + + long queryId = long.Parse(_T("INSERT_QUERY_ID_HERE")); + + // Create report request object. + ReportRequest reportRequest = new ReportRequest(); + reportRequest.queryId = queryId; + + try { + // Request generation of a report for your query. + ReportInfo reportInfo = service.runDeferredReport(reportRequest); + + // Display success message. + Console.WriteLine("Report with ID '{0}' has been scheduled.", reportInfo.reportId); + } catch (Exception ex) { + Console.WriteLine("Failed to schedule report. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/CSharp/v1_20/UploadInStreamAsset.cs b/examples/Dfa/CSharp/v1_20/UploadInStreamAsset.cs new file mode 100644 index 00000000000..8bc766b241b --- /dev/null +++ b/examples/Dfa/CSharp/v1_20/UploadInStreamAsset.cs @@ -0,0 +1,107 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Util; + +namespace Google.Api.Ads.Dfa.Examples.CSharp.v1_20 { + /// + /// This code example uploads an In-Stream video asset into an existing + /// In-Stream video creative. To create an In-Stream video creative, run + /// CreateInStreamVideoCreative.cs. + /// + /// This code example creates a media file in the target creative because the + /// mediaFile flag on the InStreamAssetUploadRequest + /// was set to true. You can use the same workflow to upload + /// companion ads or non-linear ads to your creative by setting the + /// companion or nonLinear flags instead, + /// respectively. Only one flag may be set per upload request. + /// + /// Tags: creative.uploadInStreamAsset + /// + class UploadInStreamAsset : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example uploads an In-Stream video asset into an existing In-Stream " + + "video creative. To create an In-Stream video creative, run " + + "CreateInStreamVideoCreative.cs.\nThis code example creates a media file in the " + + "target creative because the mediaFile flag on the InStreamAssetUploadRequest was " + + "set to true. You can use the same workflow to upload companion ads or non-linear " + + "ads to your creative by setting the companion or nonLinear flags instead, " + + "respectively. Only one flag may be set per upload request."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UploadInStreamAsset(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfaUser()); + } + + /// + /// Run the code example. + /// + /// The Dfa user object running the code example. + /// + public override void Run(DfaUser user) { + // Request the creative service from the service client factory. + CreativeRemoteService creativeService = (CreativeRemoteService) user.GetService( + DfaService.v1_20.CreativeRemoteService); + + string assetName = _T("INSERT_ASSET_NAME_HERE"); + string pathToFile = _T("INSERT_PATH_TO_FILE_HERE"); + long creativeId = long.Parse(_T("INSERT_IN_STREAM_VIDEO_CREATIVE_ID_HERE")); + + // Create the In-Stream video creative asset. + CreativeAsset inStreamVideoAsset = new CreativeAsset(); + inStreamVideoAsset.name = assetName; + inStreamVideoAsset.content = MediaUtilities.GetAssetDataFromUrl( + new Uri(pathToFile).AbsolutePath); + + // Create an upload request to make this asset a media file for an existing + // In-Stream creative. + InStreamAssetUploadRequest inStreamAssetUploadRequest = new InStreamAssetUploadRequest(); + inStreamAssetUploadRequest.mediaFile = true; + inStreamAssetUploadRequest.inStreamAsset = inStreamVideoAsset; + inStreamAssetUploadRequest.creativeId = creativeId; + + try { + // Save the media file. + InStreamVideoCreative inStreamVideoCreative = + creativeService.uploadInStreamAsset(inStreamAssetUploadRequest); + + // Display a success message. + Console.WriteLine("Added a media file to In-Stream video creative with ID \"{0}\".", + inStreamVideoCreative.id); + } catch (Exception ex) { + Console.WriteLine("Failed to add a media file to in-stream video creative. " + + "Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfa/Wcf/WcfService/AdTypeContract.cs b/examples/Dfa/Wcf/WcfService/AdTypeContract.cs new file mode 100644 index 00000000000..460d19dad1c --- /dev/null +++ b/examples/Dfa/Wcf/WcfService/AdTypeContract.cs @@ -0,0 +1,49 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Runtime.Serialization; + +namespace Google.Api.Ads.Dfa.Examples.Wcf { + /// + /// Defines a data contract for IWcfService.GetAdTypesUsingContract. + /// + [DataContract] + public class AdTypeContract { + /// + /// List of ad types. + /// + AdType[] adTypes; + + /// + /// Gets or sets the ad types. + /// + /// + /// The ad types. + /// + [DataMember] + public AdType[] AdTypes { + get { + return adTypes; + } + set { + adTypes = value; + } + } + } +} diff --git a/examples/Dfa/Wcf/WcfService/Dfa.Examples.WcfService.csproj b/examples/Dfa/Wcf/WcfService/Dfa.Examples.WcfService.csproj new file mode 100644 index 00000000000..b2d69a06ac8 --- /dev/null +++ b/examples/Dfa/Wcf/WcfService/Dfa.Examples.WcfService.csproj @@ -0,0 +1,110 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {B7569E63-95A3-46B1-A6BB-5ABBBA542BF5} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Google.Api.Ads.Dfa.Examples.Wcf + WcfServiceExample + v4.0 + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + + + 3.5 + + + + + + 3.0 + + + 3.0 + + + + 3.5 + + + + + + 3.5 + + + + + + + + + {277404DB-A439-4450-B3A5-186294CDF245} + Common + + + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB} + Dfa + + + + + + + + + + False + True + 49193 + / + + + False + False + + + False + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/Dfa/Wcf/WcfService/DfaClient.cs b/examples/Dfa/Wcf/WcfService/DfaClient.cs new file mode 100644 index 00000000000..4544839a719 --- /dev/null +++ b/examples/Dfa/Wcf/WcfService/DfaClient.cs @@ -0,0 +1,113 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +namespace Google.Api.Ads.Dfa.Examples.Wcf { + /// + /// A class that makes calls to DFA API. + /// + public class DfaClient { + /// + /// Time to wait between checks for report status. + /// + private const int TIME_BETWEEN_CHECKS = 10 * 60 * 1000; + + /// + /// The dfa user making calls. + /// + DfaUser user = new DfaUser(); + + /// + /// Gets the ad types. + /// + /// + internal AdType[] GetAdTypes() { + // Create AdRemoteService instance. + AdRemoteService service = (AdRemoteService) user.GetService( + DfaService.v1_19.AdRemoteService); + + // Get ad types. + return service.getAdTypes(); + } + + /// + /// Schedules and downloads a report given a query id. + /// + /// The query id. + /// The path to which the report should be + /// downloaded. + /// True, if the report was downloaded successfully, false + /// otherwise. + internal bool GetReport(long queryId, string reportFilePath) { + // Create ReportRemoteService instance. + ReportRemoteService service = (ReportRemoteService)user.GetService( + DfaService.v1_19.ReportRemoteService); + return ScheduleAndDownloadReport(service, queryId, reportFilePath); + } + + /// + /// Schedules and downloads a report. + /// + /// The report service instance. + /// The query id to be used for generating reports. + /// + /// The file path to which the downloaded report + /// should be saved. + private bool ScheduleAndDownloadReport(ReportRemoteService service, long queryId, + string reportFilePath) { + // Create report request and submit it to the server. + ReportRequest reportRequest = new ReportRequest(); + reportRequest.queryId = queryId; + + ReportInfo reportInfo = service.runDeferredReport(reportRequest); + long reportId = reportInfo.reportId; + reportRequest.reportId = reportId; + + while (reportInfo.status.name != "COMPLETE") { + Thread.Sleep(TIME_BETWEEN_CHECKS); + reportInfo = service.getReport(reportRequest); + if (reportInfo.status.name == "ERROR") { + throw new Exception("Deferred report failed with errors. Run in the UI to " + + "troubleshoot."); + } + } + + FileStream fs = null; + try { + fs = File.OpenWrite(reportFilePath); + byte[] data = MediaUtilities.GetAssetDataFromUrl(reportInfo.url); + fs.Write(data, 0, data.Length); + return true; + } catch { + return false; + } finally { + if (fs != null) { + fs.Close(); + } + } + } + } +} diff --git a/examples/Dfa/Wcf/WcfService/IWcfService.cs b/examples/Dfa/Wcf/WcfService/IWcfService.cs new file mode 100644 index 00000000000..afb926c7ab8 --- /dev/null +++ b/examples/Dfa/Wcf/WcfService/IWcfService.cs @@ -0,0 +1,62 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.v1_19; + +using System; +using System.ServiceModel; + +namespace Google.Api.Ads.Dfa.Examples.Wcf { + /// + /// A public interface for calling the methods exposed by this service. + /// + [ServiceContract] + public interface IWcfService { + /// + /// Schedules and downloads a report given a query id. + /// + /// The query id. + /// The path to which the report should be + /// downloaded. + /// True, if the report was downloaded successfully, false + /// otherwise. + [OperationContract] + bool GetReport(long queryId, string reportFilePath); + + /// + /// Schedules and downloads a report given a query id. + /// + /// The report contract. + /// The report contract, with report contents populated. + [OperationContract] + ReportContract GetReportUsingContract(ReportContract contract); + + /// + /// Gets the ad types supported by DFA. + /// + /// A list of ad types. + [OperationContract] + AdType[] GetAdTypes(); + + /// + /// Gets the ad types supported by DFA. + /// + /// The adtype contract. + /// The adtype contract, with ad types popupated. + [OperationContract] + AdTypeContract GetAdTypesUsingContract(AdTypeContract contract); + } +} diff --git a/examples/Dfa/Wcf/WcfService/Properties/AssemblyInfo.cs b/examples/Dfa/Wcf/WcfService/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..fca40409eb5 --- /dev/null +++ b/examples/Dfa/Wcf/WcfService/Properties/AssemblyInfo.cs @@ -0,0 +1,38 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("DoubleClick for Advertisers API Client Library Code Examples")] +[assembly: AssemblyDescription( + "This application contains code examples that shows how to DoubleClick for Advertisers API " + + "using the client library.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("65b1581e-2d6e-4888-8bba-9b59a814734a")] diff --git a/examples/Dfa/Wcf/WcfService/Properties/Properties.cs b/examples/Dfa/Wcf/WcfService/Properties/Properties.cs new file mode 100644 index 00000000000..e227e002fbb --- /dev/null +++ b/examples/Dfa/Wcf/WcfService/Properties/Properties.cs @@ -0,0 +1,24 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; + +[assembly: AssemblyCompany("Google")] +[assembly: AssemblyProduct("DoubleClick for Advertisers API DotNet Client Library")] +[assembly: AssemblyCopyright("Copyright 2011, Google Inc. All Rights Reserved.")] + +[assembly: AssemblyVersion("18.0.0.0")] +[assembly: AssemblyFileVersion("18.0.0.0")] diff --git a/examples/Dfa/Wcf/WcfService/ReportContract.cs b/examples/Dfa/Wcf/WcfService/ReportContract.cs new file mode 100644 index 00000000000..86236591796 --- /dev/null +++ b/examples/Dfa/Wcf/WcfService/ReportContract.cs @@ -0,0 +1,80 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Runtime.Serialization; + +namespace Google.Api.Ads.Dfa.Examples.Wcf { + /// + /// Defines a data contract for IWcfService.GetReportUsingContract. + /// + [DataContract] + public class ReportContract { + /// + /// The query id for which report should be generated. + /// + long queryId; + + /// + /// The path to which report should be saved. + /// + string reportFilePath; + + /// + /// True, if the download was successful, false otherwise. + /// + Boolean isSuccess; + + /// + /// Gets or sets if the download was successful or not. + /// + [DataMember] + public Boolean IsSuccess { + get { + return isSuccess; + } + set { + isSuccess = value; + } + } + + /// + /// Gets or sets the query id for which report should be generated. + /// + [DataMember] + public long QueryId { + get { + return queryId; + } + set { + queryId = value; + } + } + + /// + /// Gets or sets the path to which report should be saved. + /// + [DataMember] + public string ReportFilePath { + get { + return reportFilePath; + } + set { + reportFilePath = value; + } + } + } +} diff --git a/examples/Dfa/Wcf/WcfService/WcfService.svc b/examples/Dfa/Wcf/WcfService/WcfService.svc new file mode 100644 index 00000000000..9e7a528f9af --- /dev/null +++ b/examples/Dfa/Wcf/WcfService/WcfService.svc @@ -0,0 +1 @@ +<%@ ServiceHost Language="C#" Debug="true" Service="Google.Api.Ads.Dfa.Examples.Wcf.WcfService" CodeBehind="WcfService.svc.cs" %> \ No newline at end of file diff --git a/examples/Dfa/Wcf/WcfService/WcfService.svc.cs b/examples/Dfa/Wcf/WcfService/WcfService.svc.cs new file mode 100644 index 00000000000..4a8e5e428fc --- /dev/null +++ b/examples/Dfa/Wcf/WcfService/WcfService.svc.cs @@ -0,0 +1,75 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.v1_19; + +namespace Google.Api.Ads.Dfa.Examples.Wcf { + /// + /// Implements the service functionalities. + /// + public class WcfService : IWcfService { + /// + /// The DFA client that makes calls to the server. + /// + DfaClient client = new DfaClient(); + + /// + /// Schedules and downloads a report given a query id. + /// + /// The query id. + /// The path to which the report should be + /// downloaded. + /// True, if the report was downloaded successfully, false + /// otherwise. + public bool GetReport(long queryId, string reportFilePath) { + return client.GetReport(queryId, reportFilePath); + } + + /// + /// Schedules and downloads a report given a query id. + /// + /// The report contract. + /// + /// The report contract, with report contents populated. + /// + public ReportContract GetReportUsingContract(ReportContract contract) { + contract.IsSuccess = GetReport(contract.QueryId, contract.ReportFilePath); + return contract; + } + + /// + /// Gets the ad types supported by DFA. + /// + /// + /// A list of ad types. + /// + public AdType[] GetAdTypes() { + return client.GetAdTypes(); + } + + /// + /// Gets the ad types supported by DFA. + /// + /// The adtype contract. + /// + /// The adtype contract, with ad types popupated. + /// + public AdTypeContract GetAdTypesUsingContract(AdTypeContract contract) { + contract.AdTypes = GetAdTypes(); + return contract; + } + } +} diff --git a/examples/Dfa/Wcf/WcfService/Web.config b/examples/Dfa/Wcf/WcfService/Web.config new file mode 100644 index 00000000000..b63143b29fc --- /dev/null +++ b/examples/Dfa/Wcf/WcfService/Web.config @@ -0,0 +1,258 @@ + + + + + +
+ +
+
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/Dfa.Examples.WcfServiceConsumer.csproj b/examples/Dfa/Wcf/WcfServiceConsumer/Dfa.Examples.WcfServiceConsumer.csproj new file mode 100644 index 00000000000..d7ec9b7b882 --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/Dfa.Examples.WcfServiceConsumer.csproj @@ -0,0 +1,101 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {038AFADE-3AEE-44C9-AF5A-E210FD08452C} + WinExe + Properties + Google.Api.Ads.Dfa.Examples.Wcf + WcfServiceConsumerExample + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + 3.5 + + + 3.0 + + + 3.0 + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + + + + + + + + Reference.svcmap + + + Reference.svcmap + + + Reference.svcmap + + + WCF Proxy Generator + Reference.cs + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/MainForm.Designer.cs b/examples/Dfa/Wcf/WcfServiceConsumer/MainForm.Designer.cs new file mode 100644 index 00000000000..4f7d78f3fa5 --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/MainForm.Designer.cs @@ -0,0 +1,60 @@ +namespace Google.Api.Ads.Dfa.Examples.Wcf { + partial class MainForm { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) { + if (disposing && (components != null)) { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() { + this.btnGetAdTypes = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // btnGetAdTypes + // + this.btnGetAdTypes.Location = new System.Drawing.Point(76, 23); + this.btnGetAdTypes.Name = "btnGetAdTypes"; + this.btnGetAdTypes.Size = new System.Drawing.Size(160, 33); + this.btnGetAdTypes.TabIndex = 0; + this.btnGetAdTypes.Text = "Get Ad Types"; + this.btnGetAdTypes.UseVisualStyleBackColor = true; + this.btnGetAdTypes.Click += new System.EventHandler(this.btnGetAdTypes_Click); + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(317, 88); + this.Controls.Add(this.btnGetAdTypes); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "MainForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "WCF Service Consumer"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button btnGetAdTypes; + } +} + diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/MainForm.cs b/examples/Dfa/Wcf/WcfServiceConsumer/MainForm.cs new file mode 100644 index 00000000000..45a2bd881dc --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/MainForm.cs @@ -0,0 +1,53 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Text; +using System.Windows.Forms; + +using Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference; + +namespace Google.Api.Ads.Dfa.Examples.Wcf { + /// + /// Main form for this application. + /// + public partial class MainForm : Form { + /// + /// Initializes a new instance of the class. + /// + public MainForm() { + InitializeComponent(); + } + + /// + /// Handles the Click event of the btnGetAdTypes control. + /// + /// The source of the event. + /// The + /// instance containing the event data. + private void btnGetAdTypes_Click(object sender, EventArgs e) { + IWcfService service = new WcfServiceClient(); + AdType[] adTypes = service.GetAdTypes(); + + StringBuilder builder = new StringBuilder(); + foreach (AdType adType in adTypes) { + builder.AppendFormat("Ad type name is '{0}' and id is {1}.\n", adType.idField, + adType.nameField); + } + MessageBox.Show(builder.ToString()); + } + } +} diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/MainForm.resx b/examples/Dfa/Wcf/WcfServiceConsumer/MainForm.resx new file mode 100644 index 00000000000..d58980a38d7 --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/MainForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/Program.cs b/examples/Dfa/Wcf/WcfServiceConsumer/Program.cs new file mode 100644 index 00000000000..9fa200ffb57 --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/Program.cs @@ -0,0 +1,36 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace Google.Api.Ads.Dfa.Examples.Wcf { + /// + /// Main class for this application. + /// + static class Program { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); + } + } +} diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/Properties/AssemblyInfo.cs b/examples/Dfa/Wcf/WcfServiceConsumer/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..214185f760b --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/Properties/AssemblyInfo.cs @@ -0,0 +1,38 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("DoubleClick for Advertisers API Client Library Code Examples")] +[assembly: AssemblyDescription( + "This application contains code examples that shows how to DoubleClick for Advertisers API " + + "using the client library.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("65b1581e-2d6e-4888-8bba-9b59a814734b")] diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/Properties/Properties.cs b/examples/Dfa/Wcf/WcfServiceConsumer/Properties/Properties.cs new file mode 100644 index 00000000000..e227e002fbb --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/Properties/Properties.cs @@ -0,0 +1,24 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; + +[assembly: AssemblyCompany("Google")] +[assembly: AssemblyProduct("DoubleClick for Advertisers API DotNet Client Library")] +[assembly: AssemblyCopyright("Copyright 2011, Google Inc. All Rights Reserved.")] + +[assembly: AssemblyVersion("18.0.0.0")] +[assembly: AssemblyFileVersion("18.0.0.0")] diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/Properties/Resources.Designer.cs b/examples/Dfa/Wcf/WcfServiceConsumer/Properties/Resources.Designer.cs new file mode 100644 index 00000000000..a797b9960c7 --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.269 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Google.Api.Ads.Dfa.Examples.Wcf.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Google.Api.Ads.Dfa.Examples.Wcf.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/Properties/Resources.resx b/examples/Dfa/Wcf/WcfServiceConsumer/Properties/Resources.resx new file mode 100644 index 00000000000..5931345ebb4 --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/Properties/Settings.Designer.cs b/examples/Dfa/Wcf/WcfServiceConsumer/Properties/Settings.Designer.cs new file mode 100644 index 00000000000..c182d75c7cb --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.269 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Google.Api.Ads.Dfa.Examples.Wcf.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/Properties/Settings.settings b/examples/Dfa/Wcf/WcfServiceConsumer/Properties/Settings.settings new file mode 100644 index 00000000000..39645652af6 --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.AdType.datasource b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.AdType.datasource new file mode 100644 index 00000000000..077ea32e9a3 --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.AdType.datasource @@ -0,0 +1,10 @@ + + + + Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.AdType, ServiceReferences.WcfServiceReference.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.AdTypeContract.datasource b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.AdTypeContract.datasource new file mode 100644 index 00000000000..9c30164f48b --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.AdTypeContract.datasource @@ -0,0 +1,10 @@ + + + + Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.AdTypeContract, ServiceReferences.WcfServiceReference.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.ReportContract.datasource b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.ReportContract.datasource new file mode 100644 index 00000000000..3c13285f8fb --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.ReportContract.datasource @@ -0,0 +1,10 @@ + + + + Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.ReportContract, ServiceReferences.WcfServiceReference.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/Reference.cs b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/Reference.cs new file mode 100644 index 00000000000..3fbf90fcf5f --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/Reference.cs @@ -0,0 +1,354 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.269 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference { + using System.Runtime.Serialization; + using System; + + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] + [System.Runtime.Serialization.DataContractAttribute(Name="ReportContract", Namespace="http://schemas.datacontract.org/2004/07/Google.Api.Ads.Dfa.Examples.Wcf")] + [System.SerializableAttribute()] + public partial class ReportContract : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged { + + [System.NonSerializedAttribute()] + private System.Runtime.Serialization.ExtensionDataObject extensionDataField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private bool IsSuccessField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private long QueryIdField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string ReportFilePathField; + + [global::System.ComponentModel.BrowsableAttribute(false)] + public System.Runtime.Serialization.ExtensionDataObject ExtensionData { + get { + return this.extensionDataField; + } + set { + this.extensionDataField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public bool IsSuccess { + get { + return this.IsSuccessField; + } + set { + if ((this.IsSuccessField.Equals(value) != true)) { + this.IsSuccessField = value; + this.RaisePropertyChanged("IsSuccess"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public long QueryId { + get { + return this.QueryIdField; + } + set { + if ((this.QueryIdField.Equals(value) != true)) { + this.QueryIdField = value; + this.RaisePropertyChanged("QueryId"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string ReportFilePath { + get { + return this.ReportFilePathField; + } + set { + if ((object.ReferenceEquals(this.ReportFilePathField, value) != true)) { + this.ReportFilePathField = value; + this.RaisePropertyChanged("ReportFilePath"); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] + [System.Runtime.Serialization.DataContractAttribute(Name="AdType", Namespace="http://schemas.datacontract.org/2004/07/Google.Api.Ads.Dfa.v1_13")] + [System.SerializableAttribute()] + public partial class AdType : Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.Base { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] + [System.Runtime.Serialization.DataContractAttribute(Name="Base", Namespace="http://schemas.datacontract.org/2004/07/Google.Api.Ads.Dfa.v1_13")] + [System.SerializableAttribute()] + [System.Runtime.Serialization.KnownTypeAttribute(typeof(Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.AdType))] + public partial class Base : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged { + + [System.NonSerializedAttribute()] + private System.Runtime.Serialization.ExtensionDataObject extensionDataField; + + private Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.ApiException dummyExceptionFieldField; + + private long idFieldField; + + private string nameFieldField; + + [global::System.ComponentModel.BrowsableAttribute(false)] + public System.Runtime.Serialization.ExtensionDataObject ExtensionData { + get { + return this.extensionDataField; + } + set { + this.extensionDataField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)] + public Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.ApiException dummyExceptionField { + get { + return this.dummyExceptionFieldField; + } + set { + if ((object.ReferenceEquals(this.dummyExceptionFieldField, value) != true)) { + this.dummyExceptionFieldField = value; + this.RaisePropertyChanged("dummyExceptionField"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)] + public long idField { + get { + return this.idFieldField; + } + set { + if ((this.idFieldField.Equals(value) != true)) { + this.idFieldField = value; + this.RaisePropertyChanged("idField"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)] + public string nameField { + get { + return this.nameFieldField; + } + set { + if ((object.ReferenceEquals(this.nameFieldField, value) != true)) { + this.nameFieldField = value; + this.RaisePropertyChanged("nameField"); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] + [System.Runtime.Serialization.DataContractAttribute(Name="ApiException", Namespace="http://schemas.datacontract.org/2004/07/Google.Api.Ads.Dfa.v1_13")] + [System.SerializableAttribute()] + public partial class ApiException : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged { + + [System.NonSerializedAttribute()] + private System.Runtime.Serialization.ExtensionDataObject extensionDataField; + + private long errorCodeFieldField; + + private string errorMessageFieldField; + + private string messageFieldField; + + [global::System.ComponentModel.BrowsableAttribute(false)] + public System.Runtime.Serialization.ExtensionDataObject ExtensionData { + get { + return this.extensionDataField; + } + set { + this.extensionDataField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)] + public long errorCodeField { + get { + return this.errorCodeFieldField; + } + set { + if ((this.errorCodeFieldField.Equals(value) != true)) { + this.errorCodeFieldField = value; + this.RaisePropertyChanged("errorCodeField"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)] + public string errorMessageField { + get { + return this.errorMessageFieldField; + } + set { + if ((object.ReferenceEquals(this.errorMessageFieldField, value) != true)) { + this.errorMessageFieldField = value; + this.RaisePropertyChanged("errorMessageField"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)] + public string messageField { + get { + return this.messageFieldField; + } + set { + if ((object.ReferenceEquals(this.messageFieldField, value) != true)) { + this.messageFieldField = value; + this.RaisePropertyChanged("messageField"); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] + [System.Runtime.Serialization.DataContractAttribute(Name="AdTypeContract", Namespace="http://schemas.datacontract.org/2004/07/Google.Api.Ads.Dfa.Examples.Wcf")] + [System.SerializableAttribute()] + public partial class AdTypeContract : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged { + + [System.NonSerializedAttribute()] + private System.Runtime.Serialization.ExtensionDataObject extensionDataField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.AdType[] AdTypesField; + + [global::System.ComponentModel.BrowsableAttribute(false)] + public System.Runtime.Serialization.ExtensionDataObject ExtensionData { + get { + return this.extensionDataField; + } + set { + this.extensionDataField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.AdType[] AdTypes { + get { + return this.AdTypesField; + } + set { + if ((object.ReferenceEquals(this.AdTypesField, value) != true)) { + this.AdTypesField = value; + this.RaisePropertyChanged("AdTypes"); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ServiceModel.ServiceContractAttribute(ConfigurationName="WcfServiceReference.IWcfService")] + public interface IWcfService { + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWcfService/GetReport", ReplyAction="http://tempuri.org/IWcfService/GetReportResponse")] + bool GetReport(long queryId, string reportFilePath); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWcfService/GetReportUsingContract", ReplyAction="http://tempuri.org/IWcfService/GetReportUsingContractResponse")] + Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.ReportContract GetReportUsingContract(Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.ReportContract contract); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWcfService/GetAdTypes", ReplyAction="http://tempuri.org/IWcfService/GetAdTypesResponse")] + Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.AdType[] GetAdTypes(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWcfService/GetAdTypesUsingContract", ReplyAction="http://tempuri.org/IWcfService/GetAdTypesUsingContractResponse")] + Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.AdTypeContract GetAdTypesUsingContract(Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.AdTypeContract contract); + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public interface IWcfServiceChannel : Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.IWcfService, System.ServiceModel.IClientChannel { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public partial class WcfServiceClient : System.ServiceModel.ClientBase, Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.IWcfService { + + public WcfServiceClient() { + } + + public WcfServiceClient(string endpointConfigurationName) : + base(endpointConfigurationName) { + } + + public WcfServiceClient(string endpointConfigurationName, string remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public WcfServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public WcfServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) { + } + + public bool GetReport(long queryId, string reportFilePath) { + return base.Channel.GetReport(queryId, reportFilePath); + } + + public Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.ReportContract GetReportUsingContract(Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.ReportContract contract) { + return base.Channel.GetReportUsingContract(contract); + } + + public Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.AdType[] GetAdTypes() { + return base.Channel.GetAdTypes(); + } + + public Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.AdTypeContract GetAdTypesUsingContract(Google.Api.Ads.Dfa.Examples.Wcf.WcfServiceReference.AdTypeContract contract) { + return base.Channel.GetAdTypesUsingContract(contract); + } + } +} diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/Reference.svcmap b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/Reference.svcmap new file mode 100644 index 00000000000..cfb788c5355 --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/Reference.svcmap @@ -0,0 +1,33 @@ + + + + false + true + + false + false + false + + + true + Auto + true + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService.disco b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService.disco new file mode 100644 index 00000000000..ff21b8f4c98 --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService.disco @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService.wsdl b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService.wsdl new file mode 100644 index 00000000000..63e184e33ed --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService.wsdl @@ -0,0 +1,370 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://localhost:49193/WcfService.svc + + localhost + + + + + \ No newline at end of file diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService.xsd b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService.xsd new file mode 100644 index 00000000000..a61bc32a4ef --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService.xsd @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService1.xsd b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService1.xsd new file mode 100644 index 00000000000..ee946ff77bf --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService1.xsd @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService2.xsd b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService2.xsd new file mode 100644 index 00000000000..d58e7f39cfb --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService2.xsd @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService3.xsd b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService3.xsd new file mode 100644 index 00000000000..d7cd744dd13 --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/WcfService3.xsd @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/configuration.svcinfo b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/configuration.svcinfo new file mode 100644 index 00000000000..1b858ab819e --- /dev/null +++ b/examples/Dfa/Wcf/WcfServiceConsumer/ServiceReferences/WcfServiceReference/configuration.svcinfo @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/examples/Dfp/CSharp/App.config b/examples/Dfp/CSharp/App.config new file mode 100644 index 00000000000..95e79456764 --- /dev/null +++ b/examples/Dfp/CSharp/App.config @@ -0,0 +1,190 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/Dfp/CSharp/Dfp.Examples.CSharp.csproj b/examples/Dfp/CSharp/Dfp.Examples.CSharp.csproj new file mode 100644 index 00000000000..ff54f926ced --- /dev/null +++ b/examples/Dfp/CSharp/Dfp.Examples.CSharp.csproj @@ -0,0 +1,1145 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {65E3CAA4-8EE5-414A-AC88-02E4F33EC954} + Exe + Properties + Google.Api.Ads.Dfp.Examples.CSharp + Dfp.Examples.CSharp + Google.Api.Ads.Dfp.Examples.CSharp.Program + + + 2.0 + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + v4.0 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AnyCPU + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + {277404DB-A439-4450-B3A5-186294CDF245} + Common + + + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB} + Dfp + + + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/Dfp/CSharp/OAuth/ConsoleExample.cs b/examples/Dfp/CSharp/OAuth/ConsoleExample.cs new file mode 100644 index 00000000000..23f7269ffc1 --- /dev/null +++ b/examples/Dfp/CSharp/OAuth/ConsoleExample.cs @@ -0,0 +1,129 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; +using Google.Api.Ads.Common.Lib; + +using System; +using System.Data; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.OAuth { + /// + /// This code example shows how to run an DFP API command line application + /// while incorporating the OAuth2 installed application flow into your + /// application. If your application uses a single Google login to make calls + /// to all your accounts, you shouldn't use this code example. Instead, you + /// should run Common\Util\OAuth2TokenGenerator.cs to generate a refresh token + /// and set that in user.Config.OAuth2RefreshToken field, or set + /// OAuth2RefreshToken key in your App.config / Web.config. + /// + /// This code example depends on Console environment only for reading and + /// writing values, you may use this code example in other environments like + /// Windows Form applications with minimial modifications. + /// + /// To run this application, + /// + /// 1. You should create a new Console Application project. + /// 2. Add reference to the following assemblies: + /// + /// Google.Ads.Common.dll + /// Google.Ads.OAuth.dll + /// Google.Dfp.dll + /// System.Web + /// System.Configuration + /// + /// 3. Replace the Main() method with this class's method. + /// 4. Copy App.config from Dfp.Examples project, and configure + /// it as shown in this project's Web.config. + /// 5. Compile and run this example. + /// + public class ConsoleExample { + /// + /// The main method. + /// + /// Command line arguments. + static void Main(string[] args) { + DfpUser user = new DfpUser(); + DfpAppConfig config = (user.Config as DfpAppConfig); + if (config.AuthorizationMethod == DfpAuthorizationMethod.OAuth2) { + if (config.OAuth2Mode == OAuth2Flow.APPLICATION && + string.IsNullOrEmpty(config.OAuth2RefreshToken)) { + DoAuth2Authorization(user); + } + } else { + throw new Exception("Authorization mode is not OAuth."); + } + + // Get the UserService. + UserService userService = (UserService)user.GetService(DfpService.v201208.UserService); + + // Sets defaults for page and Statement. + UserPage page = new UserPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all users. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get users by Statement. + page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User usr in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and role = '{3}'" + + " was found.", i, usr.id, usr.email, usr.roleName); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all users. Exception says \"{0}\"", + ex.Message); + } + } + + /// + /// Does the OAuth2 authorization for installed applications. + /// + /// The DFP user. + private static void DoAuth2Authorization(DfpUser user) { + // Since we are using a console application, set the callback url to null. + user.Config.OAuth2RedirectUri = null; + AdsOAuthProviderForApplications oAuth2Provider = + (user.OAuthProvider as AdsOAuthProviderForApplications); + // Get the authorization url. + string authorizationUrl = oAuth2Provider.GetAuthorizationUrl(); + Console.WriteLine("Open a fresh web browser and navigate to \n\n{0}\n\n. You will be " + + "prompted to login and then authorize this application to make calls to the " + + "DFP API. Once approved, you will be presented with an authorization code.", + authorizationUrl); + + // Accept the OAuth2 authorization code from the user. + Console.Write("Enter the authorization code :"); + string authorizationCode = Console.ReadLine(); + + // Fetch the access and refresh tokens. + oAuth2Provider.FetchAccessAndRefreshTokens(authorizationCode); + } + } +} diff --git a/examples/Dfp/CSharp/OAuth/Default.aspx b/examples/Dfp/CSharp/OAuth/Default.aspx new file mode 100644 index 00000000000..362b9f2fab2 --- /dev/null +++ b/examples/Dfp/CSharp/OAuth/Default.aspx @@ -0,0 +1,49 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" + Inherits="Google.Api.Ads.Dfp.Examples.OAuth.Default" %> + + + + + + DFP API - OAuth demo + + +
+

DFP API OAuth demo

+

+ This code example uses OAuth to retrieve the users. +

+ +

+ +
+
+ + + + + + + diff --git a/examples/Dfp/CSharp/OAuth/Default.aspx.cs b/examples/Dfp/CSharp/OAuth/Default.aspx.cs new file mode 100644 index 00000000000..a159b68d24b --- /dev/null +++ b/examples/Dfp/CSharp/OAuth/Default.aspx.cs @@ -0,0 +1,167 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; +using Google.Api.Ads.Common.Lib; + +using System; +using System.Data; +using System.IO; +using System.Web.UI.WebControls; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.OAuth { + /// + /// Code-behind class for Default.aspx. + /// + public partial class Default : System.Web.UI.Page { + /// + /// The user for creating services and making DFP API calls. + /// + DfpUser user; + + /// + /// Handles the Load event of the Page control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + void Page_Load(object sender, EventArgs e) { + user = new DfpUser(); + } + + /// + /// Handles the Click event of the btnAuthorize control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + protected void OnAuthorizeButtonClick(object sender, EventArgs e) { + // This code example shows how to run an DFP API web application + // while incorporating the OAuth2 web application flow into your + // application. If your application uses a single Google login to make calls + // to all your accounts, you shouldn't use this code example. Instead, you + // should run Common\Util\OAuth2TokenGenerator.cs to generate a refresh + // token and set that in user.Config.OAuth2RefreshToken field, or set + // OAuth2RefreshToken key in your App.config / Web.config. + DfpAppConfig config = user.Config as DfpAppConfig; + if (config.AuthorizationMethod == DfpAuthorizationMethod.OAuth2) { + if (user.Config.OAuth2Mode == OAuth2Flow.APPLICATION && + string.IsNullOrEmpty(config.OAuth2RefreshToken)) { + Response.Redirect("OAuthLogin.aspx"); + } + } else { + throw new Exception("Authorization mode is not OAuth."); + } + } + + /// + /// Handles the Click event of the btnGetUsers control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + protected void OnGetUsersButtonClick(object sender, EventArgs e) { + ConfigureUserForOAuth(); + + try { + // Get the UserService. + UserService userService = (UserService)user.GetService(DfpService.v201208.UserService); + + // Sets defaults for page and Statement. + UserPage page = new UserPage(); + Statement statement = new Statement(); + int offset = 0; + + DataTable dataTable = new DataTable(); + dataTable.Columns.AddRange(new DataColumn[] { + new DataColumn("Serial No.", typeof(int)), + new DataColumn("User Id", typeof(long)), + new DataColumn("Email", typeof(string)), + new DataColumn("Role", typeof(string)) + }); + do { + // Create a Statement to get all users. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get users by Statement. + page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User usr in page.results) { + DataRow dataRow = dataTable.NewRow(); + dataRow.ItemArray = new object[] {i + 1, usr.id, usr.email, usr.roleName}; + dataTable.Rows.Add(dataRow); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + if (dataTable.Rows.Count > 0) { + UserGrid.DataSource = dataTable; + UserGrid.DataBind(); + } else { + Response.Write("No users were found."); + } + } catch (Exception ex) { + Response.Write(string.Format("Failed to get users. Exception says \"{0}\"", + ex.Message)); + } + } + + /// + /// Configures the DFP user for OAuth. + /// + private void ConfigureUserForOAuth() { + DfpAppConfig config = (user.Config as DfpAppConfig); + if (config.AuthorizationMethod == DfpAuthorizationMethod.OAuth2) { + if (config.OAuth2Mode == OAuth2Flow.APPLICATION && + string.IsNullOrEmpty(config.OAuth2RefreshToken)) { + user.OAuthProvider = (OAuth2ProviderForApplications) Session["OAuthProvider"]; + } + } else { + throw new Exception("Authorization mode is not OAuth."); + } + } + + /// + /// Handles the Click event of the btnLogout control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + protected void OnLogoutButtonClick(object sender, EventArgs e) { + Session.Clear(); + } + + /// + /// Handles the RowDataBound event of the UserGrid control. + /// + /// The source of the event. + /// The + /// instance + /// containing the event data. + protected void UserGrid_RowDataBound(object sender, GridViewRowEventArgs e) { + if (e.Row.DataItemIndex >= 0) { + e.Row.Cells[0].HorizontalAlign = HorizontalAlign.Center; + e.Row.Cells[1].HorizontalAlign = HorizontalAlign.Center; + e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Left; + e.Row.Cells[3].HorizontalAlign = HorizontalAlign.Center; + } + } + } +} diff --git a/examples/Dfp/CSharp/OAuth/Default.aspx.designer.cs b/examples/Dfp/CSharp/OAuth/Default.aspx.designer.cs new file mode 100644 index 00000000000..17da6b1de90 --- /dev/null +++ b/examples/Dfp/CSharp/OAuth/Default.aspx.designer.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.5456 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Google.Api.Ads.Dfp.Examples.CSharp.OAuth { + + + public partial class Default { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// btnAuthorize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAuthorize; + + /// + /// btnLogout control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnLogout; + + /// + /// btnGetUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnGetUsers; + + /// + /// UserGrid control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView UserGrid; + } +} diff --git a/examples/Dfp/CSharp/OAuth/Dfp.Examples.CSharp.OAuth.csproj b/examples/Dfp/CSharp/OAuth/Dfp.Examples.CSharp.OAuth.csproj new file mode 100644 index 00000000000..facad6f1e9e --- /dev/null +++ b/examples/Dfp/CSharp/OAuth/Dfp.Examples.CSharp.OAuth.csproj @@ -0,0 +1,89 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {4641ADD7-0D1F-473D-B713-2830C5029367} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Google.Api.Ads.Dfp.Examples.CSharp.OAuth + AdWords.Examples.CSharp.OAuth + v4.0 + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + AnyCPU + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + + + + + + + + + + + {277404DB-A439-4450-B3A5-186294CDF245} + Common + + + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB} + Dfp + + + + + + + + + + + + + True + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/Dfp/CSharp/OAuth/OAuthLogin.aspx b/examples/Dfp/CSharp/OAuth/OAuthLogin.aspx new file mode 100644 index 00000000000..66345fcc29a --- /dev/null +++ b/examples/Dfp/CSharp/OAuth/OAuthLogin.aspx @@ -0,0 +1,34 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OAuthLogin.aspx.cs" + Inherits="Google.Api.Ads.Dfp.Examples.OAuth.OAuthLogin" %> + + + + + + Untitled Page + + +
+
+ +
+
+ + diff --git a/examples/Dfp/CSharp/OAuth/OAuthLogin.aspx.cs b/examples/Dfp/CSharp/OAuth/OAuthLogin.aspx.cs new file mode 100644 index 00000000000..00cf6da0d86 --- /dev/null +++ b/examples/Dfp/CSharp/OAuth/OAuthLogin.aspx.cs @@ -0,0 +1,111 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Dfp.Lib; + +using System; +using System.Collections; +using System.Configuration; +using System.Data; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.HtmlControls; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.OAuth { + /// + /// Login and callback page for handling OAuth2 authentication. + /// + public partial class OAuthLogin : Page { + /// + /// Handles the Load event of the Page control. + /// + /// The source of the event. + /// The instance containing + /// the event data. + protected void Page_Load(object sender, EventArgs e) { + // Create an DfpAppConfig object with the default settings in + // App.config. + DfpAppConfig config = new DfpAppConfig(); + if (config.AuthorizationMethod == DfpAuthorizationMethod.OAuth2) { + if (config.OAuth2Mode == OAuth2Flow.APPLICATION && + string.IsNullOrEmpty(config.OAuth2RefreshToken)) { + DoAuth2Configuration(config); + } + } + } + + private void DoAuth2Configuration(DfpAppConfig config) { + // Since we use this page for OAuth callback also, we set the callback + // url as the current page. For a non-web application, this will be null. + config.OAuth2RedirectUri = Request.Url.GetLeftPart(UriPartial.Path); + + // Create an OAuth2 object for handling OAuth2 flow. + OAuth2ProviderForApplications oAuth = new OAuth2ProviderForApplications(config); + + if (Request.Params["state"] == null) { + // This is the first time this page is being loaded. + // Set the state variable to any value that helps you recognize + // when this url will be called by the OAuth2 server. + oAuth.State = "callback"; + + // Create an authorization url and redirect the user to that page. + Response.Redirect(oAuth.GetAuthorizationUrl()); + } else if (Request.Params["state"] == "callback") { + // This page was loaded because OAuth server did a callback. + // Retrieve the authorization code from the url and use it to fetch + // the access token. This call will also fetch the refresh token if + // your mode is offline. + oAuth.FetchAccessAndRefreshTokens(Request.Params["code"]); + + // Save the OAuth2 provider for future use. If you wish to save only + // the values and restore the object later, then save + // oAuth.RefreshToken, oAuth.AccessToken, oAuth.UpdatedOn and + // oAuth.ExpiresIn. + // + // You can later restore the values as + // DfpUser user = new DfpUser(); + // user.Config.OAuth2Mode = OAuth2Flow.APPLICATION; + // OAuth2ProviderForApplications oAuth = + // (user.OAuthProvider as OAuth2ProviderForApplications); + // oAuth.RefreshToken = xxx; + // oAuth.AccessToken = xxx; + // oAuth.UpdatedOn = xxx; + // oAuth.ExpiresIn = xxx; + // + // Note that only oAuth.RefreshToken is mandatory. If you leave + // oAuth.AccessToken as empty, or if oAuth.UpdatedOn + oAuth.ExpiresIn + // is in the past, the access token will be refreshed by the library. + // You can listen to this event as + // + // oAuth.OnOAuthTokensObtained += delegate(AdsOAuthProvider provider) { + // OAuth2ProviderForApplications oAuth = + // (provider as OAuth2ProviderForApplications); + // // Save oAuth.RefreshToken, oAuth.AccessToken, oAuth.UpdatedOn and + // // oAuth.ExpiresIn. + //}; + Session["OAuthProvider"] = oAuth; + // Redirect the user to the main page. + Response.Redirect("Default.aspx"); + } else { + throw new Exception("Unknown state for OAuth callback."); + } + } + } +} diff --git a/examples/Dfp/CSharp/OAuth/OAuthLogin.aspx.designer.cs b/examples/Dfp/CSharp/OAuth/OAuthLogin.aspx.designer.cs new file mode 100644 index 00000000000..4e834cac049 --- /dev/null +++ b/examples/Dfp/CSharp/OAuth/OAuthLogin.aspx.designer.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.5456 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Google.Api.Ads.Dfp.Examples.CSharp.OAuth { + + + public partial class OAuthLogin { + + /// + /// Head1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlHead Head1; + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + } +} diff --git a/examples/Dfp/CSharp/OAuth/Properties/AssemblyInfo.cs b/examples/Dfp/CSharp/OAuth/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..c7e33249850 --- /dev/null +++ b/examples/Dfp/CSharp/OAuth/Properties/AssemblyInfo.cs @@ -0,0 +1,39 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Google's DoubleClick for Publishers API DotNet Library OAuth Code " + + "Examples")] +[assembly: AssemblyDescription("This application contains code examples that shows how to " + + "use Google's DoubleClick for Publishers API using the client library and OAuth as " + + "authentication mechanism.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")] diff --git a/examples/Dfp/CSharp/OAuth/Properties/Properties.cs b/examples/Dfp/CSharp/OAuth/Properties/Properties.cs new file mode 100644 index 00000000000..0d4995b8074 --- /dev/null +++ b/examples/Dfp/CSharp/OAuth/Properties/Properties.cs @@ -0,0 +1,24 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; + +[assembly: AssemblyCompany("Google")] +[assembly: AssemblyProduct("Google's DoubleClick for Publishers API DotNet Client Library")] +[assembly: AssemblyCopyright("Copyright 2011, Google Inc. All Rights Reserved.")] + +[assembly: AssemblyVersion("18.0.0.0")] +[assembly: AssemblyFileVersion("18.0.0.0")] diff --git a/examples/Dfp/CSharp/OAuth/Web.config b/examples/Dfp/CSharp/OAuth/Web.config new file mode 100644 index 00000000000..f8777ae3d95 --- /dev/null +++ b/examples/Dfp/CSharp/OAuth/Web.config @@ -0,0 +1,191 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/Dfp/CSharp/OAuth/css/main.css b/examples/Dfp/CSharp/OAuth/css/main.css new file mode 100644 index 00000000000..e52bb7f52ee --- /dev/null +++ b/examples/Dfp/CSharp/OAuth/css/main.css @@ -0,0 +1,27 @@ +/** + * Copyright 2011, Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http: *www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + + * Author: api.anash@gmail.com (Anash P. Oommen) + */ + +body { + font-family: Verdana; + font-size:10pt; +} + +h1 { + font-family: Arial; + font-size:20pt; +} diff --git a/examples/Dfp/CSharp/Program.cs b/examples/Dfp/CSharp/Program.cs new file mode 100644 index 00000000000..1ae6e0b03bd --- /dev/null +++ b/examples/Dfp/CSharp/Program.cs @@ -0,0 +1,127 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; + +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Reflection; + +using SamplePair = System.Collections.Generic.KeyValuePair; + +namespace Google.Api.Ads.Dfp.Examples.CSharp { + /// + /// The Main class for this application. + /// + class Program { + /// + /// A map to hold the code examples to be executed. + /// + static List sampleMap = new List(); + + /// + /// A flag to keep track of whether help message was shown earlier. + /// + private static bool helpShown = false; + + static void RegisterSample(string key, SampleBase value) { + sampleMap.Add(new SamplePair(key, value)); + } + /// + /// Static constructor to initialize the code example map. + /// + static Program() { + Type[] types = Assembly.GetExecutingAssembly().GetTypes(); + + foreach (Type type in types) { + if (type.BaseType == typeof(SampleBase)) { + RegisterSample(type.FullName.Replace(typeof(Program).Namespace + ".", ""), + Activator.CreateInstance(type) as SampleBase); + } + } + } + + /// + /// The main method. + /// + /// + public static void Main(string[] args) { + if (args.Length == 0) { + ShowUsage(); + return; + } + + DfpUser user = new DfpUser(); + foreach (string cmdArgs in args) { + SamplePair matchingPair = sampleMap.Find(delegate(SamplePair pair) { + return string.Compare(pair.Key, cmdArgs, true) == 0; + }); + + if (matchingPair.Key != null) { + RunASample(user, matchingPair.Value); + } else { + ShowUsage(); + } + } + } + + /// + /// Runs a code example. + /// + /// The user whose credentials should be used for + /// running the code example. + /// The code example to run. + private static void RunASample(DfpUser user, SampleBase example) { + try { + Console.WriteLine(example.Description); + example.Run(user); + } catch (Exception ex) { + Console.WriteLine("An exception occurred while running this code sample.\n{0} at\n{1}", + ex.Message, ex.StackTrace); + } finally { + Console.WriteLine("Press [Enter] to continue"); + Console.ReadLine(); + } + } + + /// + /// Prints program usage message. + /// + private static void ShowUsage() { + if (helpShown) { + return; + } else { + helpShown = true; + } + string exeName = Path.GetFileName(Assembly.GetExecutingAssembly().Location); + Console.WriteLine("Runs DFP API code examples"); + Console.WriteLine("Usage : {0} [flags]\n", exeName); + Console.WriteLine("Available flags\n"); + Console.WriteLine("--help\t\t : Prints this help message.", exeName); + Console.WriteLine("--all\t\t : Run all code examples.", exeName); + Console.WriteLine("examplename1 [examplename1 ...] : " + + "Run specific code examples. Example name can be one of the following:\n", exeName); + foreach (SamplePair pair in sampleMap) { + Console.WriteLine("{0} : {1}", pair.Key, pair.Value.Description); + } + Console.WriteLine("Press [Enter] to continue"); + Console.ReadLine(); + } + } +} diff --git a/examples/Dfp/CSharp/Properties/AssemblyInfo.cs b/examples/Dfp/CSharp/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..aae67e15ba5 --- /dev/null +++ b/examples/Dfp/CSharp/Properties/AssemblyInfo.cs @@ -0,0 +1,38 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Google's DoubleClick for Publishers API Client Library Samples")] +[assembly: AssemblyDescription( + "This application contains code examples that shows how to use Google's DoubleClick for " + + "Publishers API using the client library.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("65b1581e-2d6e-4888-8bba-9b59a814733b")] diff --git a/examples/Dfp/CSharp/Properties/Properties.cs b/examples/Dfp/CSharp/Properties/Properties.cs new file mode 100644 index 00000000000..0d4995b8074 --- /dev/null +++ b/examples/Dfp/CSharp/Properties/Properties.cs @@ -0,0 +1,24 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; + +[assembly: AssemblyCompany("Google")] +[assembly: AssemblyProduct("Google's DoubleClick for Publishers API DotNet Client Library")] +[assembly: AssemblyCopyright("Copyright 2011, Google Inc. All Rights Reserved.")] + +[assembly: AssemblyVersion("18.0.0.0")] +[assembly: AssemblyFileVersion("18.0.0.0")] diff --git a/examples/Dfp/CSharp/SampleBase.cs b/examples/Dfp/CSharp/SampleBase.cs new file mode 100644 index 00000000000..464b9548a78 --- /dev/null +++ b/examples/Dfp/CSharp/SampleBase.cs @@ -0,0 +1,67 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +// Uncomment this key and recompile to make all the samples interactive +// instead of manually replacing the INSERT_XXX fields in samples. + +#define INTERACTIVE + +using Google.Api.Ads.Dfp.Lib; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp { + /// + /// This abstract class represents a code example. + /// + abstract class SampleBase { + /// + /// Returns a description about the code example. + /// + public abstract string Description { + get; + } + + /// + /// Run the code example. + /// + /// DFP user object running the code example. + public abstract void Run(DfpUser user); + + protected string _T(string prompt) { +#if INTERACTIVE + Console.Write(prompt + " : "); + return Console.ReadLine(); +#else + return prompt; +#endif + } + + /// + /// Gets the current time stamp. + /// + /// The current timestamp as a string. + /// You can use this method to generate a random string for use + /// with various entities that need a unique name. The method adds a 100ms + /// delay to prevent closely placed calls from generating the same + /// timestamp. + protected string GetTimeStamp() { + Thread.Sleep(100); + return (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalMilliseconds.ToString(); + } + } +} diff --git a/examples/Dfp/CSharp/v201208/AudienceSegmentService/GetAllAudienceSegments.cs b/examples/Dfp/CSharp/v201208/AudienceSegmentService/GetAllAudienceSegments.cs new file mode 100644 index 00000000000..5dd30b23b56 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/AudienceSegmentService/GetAllAudienceSegments.cs @@ -0,0 +1,88 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all audience segments. + /// + /// Tags: AudienceSegmentService.getAudienceSegmentsByStatement + /// + class GetAllAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all audience segments."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = + (AudienceSegmentService) user.GetService(DfpService.v201208.AudienceSegmentService); + + // Set defaults for page and Statement. + AudienceSegmentPage page = new AudienceSegmentPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all creatives. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get audience segment by Statement. + page = audienceSegmentService.getAudienceSegmentsByStatement(statement); + + // Display results. + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AudienceSegment segment in page.results) { + Console.WriteLine("{0}) 'Audience segment with id \"{1}\" and name \"{2}\" was " + + "found.", i, segment.id, segment.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get audience segment. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CompanyService/CreateCompanies.cs b/examples/Dfp/CSharp/v201208/CompanyService/CreateCompanies.cs new file mode 100644 index 00000000000..ee554c149e1 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CompanyService/CreateCompanies.cs @@ -0,0 +1,86 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example creates new companies. To determine which companies + /// exist, run GetAllCompanies.cs. + /// + /// Tags: CompanyService.createCompanies + /// + class CreateCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new companies. To determine which companies exist, " + + "run GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201208.CompanyService); + + // Create an array to store local company objects. + Company[] companies = new Company[5]; + + for (int i = 0; i < 5; i++) { + Company company = new Company(); + company.name = string.Format("Advertiser #{0}", i); + company.type = CompanyType.ADVERTISER; + companies[i] = company; + } + + try { + // Create the companies on the server. + companies = companyService.createCompanies(companies); + + if (companies != null && companies.Length > 0) { + foreach (Company company in companies) { + Console.WriteLine("A company with ID = '{0}', name = '{1}' and type = '{2}' was" + + " created.", company.id, company.name, company.type); + } + } else { + Console.WriteLine("No companies created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create company. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CompanyService/GetAllCompanies.cs b/examples/Dfp/CSharp/v201208/CompanyService/GetAllCompanies.cs new file mode 100644 index 00000000000..2228cd43f2e --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CompanyService/GetAllCompanies.cs @@ -0,0 +1,88 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all companies. To create companies, run + /// CreateCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement + /// + class GetAllCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all companies. To create companies, run CreateCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201208.CompanyService); + + // Set defaults for page and Statement. + CompanyPage page = new CompanyPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all companies. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get companies by Statement. + page = companyService.getCompaniesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Company company in page.results) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", + i, company.id, company.name, company.type); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CompanyService/GetCompaniesByStatement.cs b/examples/Dfp/CSharp/v201208/CompanyService/GetCompaniesByStatement.cs new file mode 100644 index 00000000000..b5f92e523c0 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CompanyService/GetCompaniesByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all companies that are advertisers. The Statement + /// retrieves up to the maximum page size limit of 500. To create companies, + /// run CreateCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement + /// + class GetCompaniesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all companies that are advertisers. The Statement " + + "retrieves up to the maximum page size limit of 500. To create companies, run " + + "CreateCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCompaniesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201208.CompanyService); + + // Create a Statement to only select companies that are advertisers sorted + // by name. + Statement statement = new StatementBuilder("WHERE type = :advertiser ORDER BY name " + + "LIMIT 500").AddValue("advertiser", CompanyType.ADVERTISER.ToString()).ToStatement(); + + try { + // Get companies by Statement. + CompanyPage page = companyService.getCompaniesByStatement(statement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Company company in page.results) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", + i, company.id, company.name, company.type); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CompanyService/GetCompany.cs b/examples/Dfp/CSharp/v201208/CompanyService/GetCompany.cs new file mode 100644 index 00000000000..5516a7cbe4c --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CompanyService/GetCompany.cs @@ -0,0 +1,77 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets a company by its ID. To determine which companies + /// exist, run GetAllCompanies.cs. + /// + /// Tags: CompanyService.getCompany + /// + class GetCompany : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a company by its ID. To determine which companies " + + "exist, run GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCompany(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201208.CompanyService); + + // Set the ID of the company to get. + long companyId = long.Parse(_T("INSERT_COMPANY_ID_HERE")); + + try { + // Get the company. + Company company = companyService.getCompany(companyId); + + if (company != null) { + Console.WriteLine("Company with ID = {0}, name = {1} and type = {2} was found", + company.id, company.name, company.type); + } else { + Console.WriteLine("No company found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get company. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CompanyService/UpdateCompanies.cs b/examples/Dfp/CSharp/v201208/CompanyService/UpdateCompanies.cs new file mode 100644 index 00000000000..604bbed96e1 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CompanyService/UpdateCompanies.cs @@ -0,0 +1,99 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example updates the names of all companies that are advertisers + /// by appending "LLC." up to the first 500. To determine which companies + /// exist, run GetAllCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement, CompanyService.updateCompanies + /// + class UpdateCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the names of all companies that are advertisers by " + + "appending 'LLC.' up to the first 500. To determine which companies exist, run " + + "GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201208.CompanyService); + + // Create a Statement to only select companies that are advertisers. + Statement statement = new StatementBuilder("WHERE type = :advertiser LIMIT 500").AddValue( + "advertiser", CompanyType.ADVERTISER.ToString()).ToStatement(); + + try { + // Get the companies by Statement. + CompanyPage page = companyService.getCompaniesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + Company[] companies = page.results; + + // Update each local company object by appending LLC. to its name. + foreach (Company company in companies) { + company.name = company.name + " LLC."; + } + + // Update the companies on the server. + companies = companyService.updateCompanies(companies); + + if (companies != null && companies.Length > 0) { + int i = 0; + foreach (Company company in companies) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} was updated", + i, company.id, company.name, company.type); + i++; + } + } else { + Console.WriteLine("No companies updated."); + } + } else { + Console.WriteLine("No companies found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/ContentService/GetAllContent.cs b/examples/Dfp/CSharp/v201208/ContentService/GetAllContent.cs new file mode 100644 index 00000000000..b230a6bac60 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/ContentService/GetAllContent.cs @@ -0,0 +1,89 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all content. This feature is only available to DFP + /// premium solution networks. + /// + /// Tags: ContentService.getContentByStatement + /// + class GetAllContent : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all content. This feature is only available to DFP " + + "premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllContent(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContentService. + ContentService contentService = + (ContentService) user.GetService(DfpService.v201208.ContentService); + + // Set defaults for page and filterStatement. + ContentPage page = new ContentPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all content. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get content by statement. + page = contentService.getContentByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Content content in page.results) { + Console.WriteLine("{0}) Content with ID \"{1}\", name \"{2}\", and status \"{3}\" " + + "was found.", i, content.id, content.name, content.status); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all content. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/ContentService/GetContentByCategory.cs b/examples/Dfp/CSharp/v201208/ContentService/GetContentByCategory.cs new file mode 100644 index 00000000000..5f768a7d276 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/ContentService/GetContentByCategory.cs @@ -0,0 +1,123 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using Google.Api.Ads.Dfp.Util.v201208; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all active content categorized as "comedy" using + /// the network's content browse custom targeting key. This feature is only + /// available to DFP video publishers. + /// + /// Tags: NetworkService.getCurrentNetwork + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// Tags: ContentService.getContentByStatementAndCustomTargetingValue + /// /// + class GetContentByCategory : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active content categorized as 'comedy' using the " + + "network's content browse custom targeting key. This feature is only available to " + + "DFP video publishers."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetContentByCategory(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContentService. + ContentService contentService = + (ContentService) user.GetService(DfpService.v201208.ContentService); + + // Get the NetworkService. + NetworkService networkService = (NetworkService) user.GetService( + DfpService.v201208.NetworkService); + + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = (CustomTargetingService) user.GetService( + DfpService.v201208.CustomTargetingService); + + try { + // Get content browse custom targeting key ID. + long contentBrowseCustomTargetingKeyId = + networkService.getCurrentNetwork().contentBrowseCustomTargetingKeyId; + + // Create a statement to select the categories matching the name comedy. + Statement categoryFilterStatement = new StatementBuilder( + "WHERE customTargetingKeyId = :contentBrowseCustomTargetingKeyId " + + " and name = :category LIMIT 1") + .AddValue("contentBrowseCustomTargetingKeyId", contentBrowseCustomTargetingKeyId) + .AddValue("category", "comedy").ToStatement(); + + // Get categories matching the filter statement. + CustomTargetingValuePage customTargetingValuePage = + customTargetingService.getCustomTargetingValuesByStatement(categoryFilterStatement); + + if (customTargetingValuePage.results != null) { + // Get the custom targeting value ID for the comedy category. + long categoryCustomTargetingValueId = customTargetingValuePage.results[0].id; + + // Set defaults for page and filterStatement. + ContentPage page = new ContentPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + do { + // Create a statement to get all active content. + filterStatement.query = "WHERE status = 'ACTIVE' LIMIT 500 OFFSET " + offset.ToString(); + + // Get content by statement. + page = contentService.getContentByStatementAndCustomTargetingValue(filterStatement, + categoryCustomTargetingValueId); + + if (page.results != null) { + int i = page.startIndex; + foreach (Content content in page.results) { + Console.WriteLine("{0}) Content with ID \"{1}\", name \"{2}\", and status " + + "\"{3}\" was found.", i, content.id, content.name, content.status); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get content by category. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CreativeService/CopyImageCreatives.cs b/examples/Dfp/CSharp/v201208/CreativeService/CopyImageCreatives.cs new file mode 100644 index 00000000000..1283ffb9490 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CreativeService/CopyImageCreatives.cs @@ -0,0 +1,119 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example copies a given set of image creatives. This would + /// typically be done to reuse creatives in a small business network. To + /// determine which creatives exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// Tags: CreativeService.createCreatives + /// + class CopyImageCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example copies a given set of image creatives. This would typically be" + + " done to reuse creatives in a small business network. To determine which creatives " + + "exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CopyImageCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201208.CreativeService); + + long[] creativeIds = new long[] {long.Parse(_T("INSERT_IMAGE_CREATIVE_ID_HERE"))}; + + // Build a comma separated list of creativeIds. Note that if you are using + // .NET 4.0 or above, you could use the newly introduced + // String.Join(string separator, IEnumerable values) method to + // perform this task. + string[] creativeIdTexts = new string[creativeIds.Length]; + for (int i = 0; i < creativeIdTexts.Length; i++) { + creativeIdTexts[i] = creativeIds[i].ToString(); + } + + string commaSeparatedCreativeIds = string.Join(",", creativeIdTexts); + + // Create the statement to filter image creatives by id. + Statement statement = new StatementBuilder( + string.Format("WHERE id IN ({0}) and creativeType = :creativeType LIMIT 500", + commaSeparatedCreativeIds)).AddValue("creativeType", "ImageCreative"). + ToStatement(); + + try { + // Retrieve all creatives which match. + CreativePage page = creativeService.getCreativesByStatement(statement); + + if (page.results != null) { + Creative[] creatives = page.results; + long[] oldIds = new long[creatives.Length]; + for (int i = 0; i < creatives.Length; i++) { + ImageCreative imageCreative = (ImageCreative) creatives[i]; + oldIds[i] = imageCreative.id; + // Since we cannot set id to null, we mark it as not specified. + imageCreative.idSpecified = false; + + imageCreative.advertiserId = imageCreative.advertiserId; + imageCreative.name = imageCreative.name + " (Copy #" + GetTimeStamp() + ")"; + imageCreative.imageByteArray = MediaUtilities.GetAssetDataFromUrl( + imageCreative.imageUrl); + creatives[i] = imageCreative; + } + + // Create the copied creative. + creatives = creativeService.createCreatives(creatives); + + // Display copied creatives. + for (int i = 0; i < creatives.Length; i++) { + Console.WriteLine("Image creative with ID \"{0}\" copied to ID \"{1}\".", oldIds[i], + creatives[i].id); + } + } else { + Console.WriteLine("No creatives were copied."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to copy creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CreativeService/CreateCreativeFromTemplate.cs b/examples/Dfp/CSharp/v201208/CreativeService/CreateCreativeFromTemplate.cs new file mode 100644 index 00000000000..2c88a3d901f --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CreativeService/CreateCreativeFromTemplate.cs @@ -0,0 +1,138 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example creates a new template creative for a given advertiser. + /// To determine which companies are advertisers, run + /// GetCompaniesByStatement.cs. To determine which creatives already exist, + /// run GetAllCreatives.cs. To determine which creative templates exist, run + /// GetAllCreativeTemplates.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCreativeFromTemplate : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new template creative for a given advertiser. To " + + "determine which companies are advertisers, run GetCompaniesByStatement.cs. To " + + "determine which creatives already exist, run GetAllCreatives.cs. To determine " + + "which creative templates exist, run GetAllCreativeTemplates.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreativeFromTemplate(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201208.CreativeService); + + // Set the ID of the advertiser (company) that all creative will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Use the image banner with optional third party tracking template. + long creativeTemplateId = 10000680L; + + // Create the local custom creative object. + TemplateCreative templateCreative = new TemplateCreative(); + templateCreative.name = "Template creative"; + templateCreative.advertiserId = advertiserId; + templateCreative.creativeTemplateId = creativeTemplateId; + + // Set the creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + templateCreative.size = size; + + // Create the asset variable value. + AssetCreativeTemplateVariableValue assetVariableValue = + new AssetCreativeTemplateVariableValue(); + assetVariableValue.uniqueName = "Imagefile"; + assetVariableValue.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + assetVariableValue.fileName = String.Format("image{0}.jpg", this.GetTimeStamp()); + + // Create the image width variable value. + LongCreativeTemplateVariableValue imageWidthVariableValue = + new LongCreativeTemplateVariableValue(); + imageWidthVariableValue.uniqueName = "Imagewidth"; + imageWidthVariableValue.value = 300; + + // Create the image height variable value. + LongCreativeTemplateVariableValue imageHeightVariableValue = + new LongCreativeTemplateVariableValue(); + imageHeightVariableValue.uniqueName = "Imageheight"; + imageHeightVariableValue.value = 250; + + // Create the URL variable value. + UrlCreativeTemplateVariableValue urlVariableValue = new UrlCreativeTemplateVariableValue(); + urlVariableValue.uniqueName = "ClickthroughURL"; + urlVariableValue.value = "www.google.com"; + + // Create the target window variable value. + StringCreativeTemplateVariableValue targetWindowVariableValue = + new StringCreativeTemplateVariableValue(); + targetWindowVariableValue.uniqueName = "Targetwindow"; + targetWindowVariableValue.value = "_blank"; + + templateCreative.creativeTemplateVariableValues = new BaseCreativeTemplateVariableValue[] { + assetVariableValue, imageWidthVariableValue, imageHeightVariableValue, urlVariableValue, + targetWindowVariableValue}; + + try { + // Create the template creative on the server. + templateCreative = (TemplateCreative) creativeService.createCreative(templateCreative); + + if (templateCreative != null) { + Console.WriteLine("A template creative with ID \"{0}\", name \"{1}\", and type \"{2}\" " + + "was created and can be previewed at {3}", templateCreative.id, templateCreative.name, + templateCreative.CreativeType, templateCreative.previewUrl); + } else { + Console.WriteLine("No creatives were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CreativeService/CreateCreatives.cs b/examples/Dfp/CSharp/v201208/CreativeService/CreateCreatives.cs new file mode 100644 index 00000000000..ec72380c2b8 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CreativeService/CreateCreatives.cs @@ -0,0 +1,113 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example creates new image creatives for a given advertiser. To + /// determine which companies are advertisers, run GetCompaniesByStatement.cs. + /// To determine which creatives already exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new image creatives for a given advertiser. To " + + "determine which companies are advertisers, run GetCompaniesByStatement.cs. " + + "To determine which creatives already exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201208.CreativeService); + + // Set the ID of the advertiser (company) that all creatives will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Create an array to store local image creative objects. + Creative[] imageCreatives = new ImageCreative[5]; + + for (int i = 0; i < 5; i++) { + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", i); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.imageName = "image.jpg"; + imageCreative.imageByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + + Size imageSize = new Size(); + imageSize.width = 300; + imageSize.height = 250; + + imageCreative.size = imageSize; + imageCreatives[i] = imageCreative; + } + + try { + // Create the image creatives on the server. + imageCreatives = creativeService.createCreatives(imageCreatives); + + if (imageCreatives != null) { + foreach (Creative creative in imageCreatives) { + // Use "is" operator to determine what type of creative was + // returned. + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + Console.WriteLine("An image creative with ID ='{0}', name ='{1}' and size = " + + "({2},{3}) was created and can be previewed at: {4}", imageCreative.id, + imageCreative.name, imageCreative.size.width, imageCreative.size.height, + imageCreative.previewUrl); + } else { + Console.WriteLine("A creative with ID ='{0}', name='{1}' and type='{2}' was created.", + creative.id, creative.name, creative.CreativeType); + } + } + } else { + Console.WriteLine("No creatives created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CreativeService/CreateCustomCreative.cs b/examples/Dfp/CSharp/v201208/CreativeService/CreateCustomCreative.cs new file mode 100644 index 00000000000..c2a9588a682 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CreativeService/CreateCustomCreative.cs @@ -0,0 +1,111 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example creates a custom creative for a given advertiser. To + /// determine which companies are advertisers, run GetCompaniesByStatement.cs. + /// To determine which creatives already exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCustomCreative : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a custom creative for a given advertiser. To determine " + + "which companies are advertisers, run GetCompaniesByStatement.cs. To determine which " + + "creatives already exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomCreative(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201208.CreativeService); + + // Set the ID of the advertiser (company) that all creatives will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + + // Create the local custom creative object. + CustomCreative customCreative = new CustomCreative(); + customCreative.name = "Custom creative " + GetTimeStamp(); + customCreative.advertiserId = advertiserId; + customCreative.destinationUrl = "http://google.com"; + + // Set the custom creative image asset. + CustomCreativeAsset customCreativeAsset = new CustomCreativeAsset(); + customCreativeAsset.macroName = "IMAGE_ASSET"; + customCreativeAsset.fileName = string.Format("inline{0}.jpg", GetTimeStamp()); + customCreativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + customCreative.customCreativeAssets = new CustomCreativeAsset[] {customCreativeAsset}; + + // Set the HTML snippet using the custom creative asset macro. + customCreative.htmlSnippet = "" + + "" + + "
Click above for great deals!"; + + // Set the creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + customCreative.size = size; + + try { + // Create the custom creative on the server. + customCreative = (CustomCreative) creativeService.createCreative(customCreative); + + if (customCreative != null) { + Console.WriteLine("A custom creative with ID \"{0}\", name \"{1}\", and size ({2}, " + + "{3}) was created and can be previewed at {4}", customCreative.id, + customCreative.name, customCreative.size.width, customCreative.size.height, + customCreative.previewUrl); + } else { + Console.WriteLine("No creative created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CreativeService/GetAllCreatives.cs b/examples/Dfp/CSharp/v201208/CreativeService/GetAllCreatives.cs new file mode 100644 index 00000000000..7dfb4ce2f78 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CreativeService/GetAllCreatives.cs @@ -0,0 +1,89 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all creatives. To create creatives, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// + class GetAllCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all creatives. To create creatives, run CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201208.CreativeService); + + // Set defaults for page and Statement. + CreativePage page = new CreativePage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all creatives. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get creatives by Statement. + page = creativeService.getCreativesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Creative creative in page.results) { + Console.WriteLine("{0}) Creative with ID ='{1}', name ='{2}' and type ='{3}' " + + "was found.", i, creative.id, creative.name, creative.CreativeType); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CreativeService/GetCreative.cs b/examples/Dfp/CSharp/v201208/CreativeService/GetCreative.cs new file mode 100644 index 00000000000..104b7c81c18 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CreativeService/GetCreative.cs @@ -0,0 +1,77 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets a creative by its ID. To determine which creatives + /// exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.getCreative + /// + class GetCreative : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a creative by its ID. To determine which creatives " + + "exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code sample as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreative(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201208.CreativeService); + + // Set the ID of the creative to get. + long creativeId = long.Parse(_T("INSERT_CREATIVE_ID_HERE")); + + try { + // Get the creative. + Creative creative = creativeService.getCreative(creativeId); + + if (creative != null) { + Console.WriteLine("Creative with ID ='{0}', name ='{1}' and type ='{2}' " + + "was found.", creative.id, creative.name, creative.CreativeType); + } else { + Console.WriteLine("No creative found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get creative. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CreativeService/GetCreativesByStatement.cs b/examples/Dfp/CSharp/v201208/CreativeService/GetCreativesByStatement.cs new file mode 100644 index 00000000000..91bf24aa4e4 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CreativeService/GetCreativesByStatement.cs @@ -0,0 +1,86 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all image creatives. The Statement retrieves up to + /// the maximum page size limit of 500. To create an image creative, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// + class GetCreativesByStatement : SampleBase { + /// + /// Returns a description about the sample code. + /// + public override string Description { + get { + return "This code example gets all image creatives. The Statement retrieves up to the " + + "maximum page size limit of 500. To create an image creative, run " + + "CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201208.CreativeService); + + // Create a Statement to only select image creatives. + Statement statement = new StatementBuilder("WHERE creativeType = :creativeType LIMIT 500"). + AddValue("creativeType", "ImageCreative").ToStatement(); + + try { + // Get creatives by Statement. + CreativePage page = creativeService.getCreativesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Creative creative in page.results) { + Console.WriteLine("{0}) Creative with ID ='{1}', name ='{2}' and type ='{3}' " + + "was found.", i, creative.id, creative.name, creative.CreativeType); + i++; + } + } + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get creatives by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CreativeService/UpdateCreatives.cs b/examples/Dfp/CSharp/v201208/CreativeService/UpdateCreatives.cs new file mode 100644 index 00000000000..d9e686a4765 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CreativeService/UpdateCreatives.cs @@ -0,0 +1,104 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all image creatives. The Statement retrieves up to + /// the maximum page size limit of 500. To create an image creative, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// Tags: CreativeService.updateCreatives + /// + class UpdateCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all image creatives. The Statement retrieves up to the " + + "maximum page size limit of 500. To create an image creative, run " + + "CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201208.CreativeService); + + // Create a Statement to get all image creatives. + Statement statement = new StatementBuilder("WHERE creativeType = :creativeType LIMIT 500"). + AddValue("creativeType", "ImageCreative").ToStatement(); + + try { + // Get creatives by Statement. + CreativePage page = creativeService.getCreativesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + Creative[] creatives = page.results; + + // Update each local creative object by changing its destination URL. + foreach (Creative creative in creatives) { + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + imageCreative.destinationUrl = "http://news.google.com"; + } + } + + // Update the creatives on the server. + creatives = creativeService.updateCreatives(creatives); + + if (creatives != null) { + foreach (Creative creative in creatives) { + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + Console.WriteLine("An image creative with ID = '{0}' and destination URL ='{1}' " + + "was updated.", imageCreative.id, imageCreative.destinationUrl); + } + } + } else { + Console.WriteLine("No creatives updated."); + } + } else { + Console.WriteLine("No creatives found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CreativeTemplateService/GetAllCreativeTemplates.cs b/examples/Dfp/CSharp/v201208/CreativeTemplateService/GetAllCreativeTemplates.cs new file mode 100644 index 00000000000..fdf60fceb84 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CreativeTemplateService/GetAllCreativeTemplates.cs @@ -0,0 +1,92 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all creative templates. + /// + /// Tags: CreativeTemplateService.getCreativeTemplatesByStatement + /// + class GetAllCreativeTemplates : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all creative templates."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreativeTemplates(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201208.CreativeTemplateService); + + // Set defaults for page and filterStatement. + CreativeTemplatePage page = new CreativeTemplatePage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all creative templates. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get creative templates by statement. + page = creativeTemplateService.getCreativeTemplatesByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CreativeTemplate creativeTemplate in page.results) { + Console.WriteLine("{0}) Creative template with ID \"{1}\", name \"{2}\", and type " + + "\"{3}\" was found.", i, creativeTemplate.id, creativeTemplate.name, + creativeTemplate.type); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CreativeTemplateService/GetCreativeTemplate.cs b/examples/Dfp/CSharp/v201208/CreativeTemplateService/GetCreativeTemplate.cs new file mode 100644 index 00000000000..6d709a8710c --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CreativeTemplateService/GetCreativeTemplate.cs @@ -0,0 +1,87 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets a creative by its ID. To determine which creative + /// templates exist, run GetAllCreativeTemplates.cs. + /// + /// Tags: CreativeTemplateService.getCreativeTemplate + /// + class GetCreativeTemplate : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a creative by its ID. To determine which creative " + + "templates exist, run GetAllCreativeTemplates.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeTemplate(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201208.CreativeTemplateService); + + // Set the ID of the creative template to get. + long creativeTemplateId = long.Parse(_T("INSERT_CREATIVE_TEMPLATE_ID_HERE")); + + try { + // Get the creative template. + CreativeTemplate creativeTemplate = creativeTemplateService.getCreativeTemplate( + creativeTemplateId); + + if (creativeTemplate != null) { + Console.WriteLine("Creative template with ID \"{0}\", name \"{1}\", and type \"{2}\" " + + "was found.", creativeTemplate.id, creativeTemplate.name, creativeTemplate.type); + if (creativeTemplate.variables != null) { + foreach (CreativeTemplateVariable variable in creativeTemplate.variables) { + Console.WriteLine("Variable with name \"{0}\" is {1}.", variable.uniqueName, + variable.isRequired ? "required." : "optional."); + } + } + } else { + Console.WriteLine("No creative template found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CreativeTemplateService/GetCreativeTemplatesByStatement.cs b/examples/Dfp/CSharp/v201208/CreativeTemplateService/GetCreativeTemplatesByStatement.cs new file mode 100644 index 00000000000..b26cb3869b0 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CreativeTemplateService/GetCreativeTemplatesByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets up to 500 system defined creative templates. + /// + /// Tags: CreativeTemplateService.getCreativeTemplatesByStatement + /// + class GetCreativeTemplatesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets up to 500 system defined creative templates."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeTemplatesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201208.CreativeTemplateService); + + // Create a statement to only select system defined creative templates. + Statement filterStatement = + new StatementBuilder("WHERE type = :creativeTemplateType LIMIT 500").AddValue( + "creativeTemplateType", CreativeTemplateType.SYSTEM_DEFINED.ToString()).ToStatement(); + + try { + // Get creative templates by statement. + CreativeTemplatePage page = creativeTemplateService.getCreativeTemplatesByStatement( + filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CreativeTemplate creativeTemplate in page.results) { + Console.WriteLine("{0}) Creative template with ID \"{1}\", name \"{2}\", and type " + + "\"{3}\" was found.", i, creativeTemplate.id, creativeTemplate.name, + creativeTemplate.type); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CustomFieldService/CreateCustomFieldOptions.cs b/examples/Dfp/CSharp/v201208/CustomFieldService/CreateCustomFieldOptions.cs new file mode 100644 index 00000000000..c676a768cc6 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CustomFieldService/CreateCustomFieldOptions.cs @@ -0,0 +1,97 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example creates custom field options for a drop-down custom + /// field. Once created, custom field options can be found under the options + /// fields of the drop-down custom field and they cannot be deleted. To + /// determine which custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.createCustomFieldOptions + /// + class CreateCustomFieldOptions : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates custom field options for a drop-down custom field. " + + "Once created, custom field options can be found under the options fields of the " + + "drop-down custom field and they cannot be deleted. To determine which custom " + + "fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomFieldOptions(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = + (CustomFieldService) user.GetService(DfpService.v201208.CustomFieldService); + + // Set the ID of the drop-down custom field to create options for. + long customFieldId = long.Parse(_T("INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE")); + + // Create custom field options. + CustomFieldOption customFieldOption1 = new CustomFieldOption(); + customFieldOption1.displayName = "Approved"; + customFieldOption1.customFieldId = customFieldId; + + CustomFieldOption customFieldOption2 = new CustomFieldOption(); + customFieldOption2.displayName = "Unapproved"; + customFieldOption2.customFieldId = customFieldId; + + try { + // Add custom field options. + CustomFieldOption[] customFieldOptions = + customFieldService.createCustomFieldOptions(new CustomFieldOption[] {customFieldOption1, + customFieldOption2}); + + // Display results. + if (customFieldOptions != null) { + foreach (CustomFieldOption customFieldOption in customFieldOptions) { + Console.WriteLine("Custom field option with ID \"{0}\" and name \"{1}\" was created.", + customFieldOption.id, customFieldOption.displayName); + } + } else { + Console.WriteLine("No custom field options created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom field options. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CustomFieldService/CreateCustomFields.cs b/examples/Dfp/CSharp/v201208/CustomFieldService/CreateCustomFields.cs new file mode 100644 index 00000000000..7342f4b926e --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CustomFieldService/CreateCustomFields.cs @@ -0,0 +1,92 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example creates custom fields. To determine which custom fields + /// exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.createCustomFields + /// + class CreateCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates custom fields. To determine which custom fields exist" + + ", run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201208.CustomFieldService); + + // Create custom fields. + CustomField customField1 = new CustomField(); + customField1.name = "Customer comments #" + GetTimeStamp(); + customField1.entityType = CustomFieldEntityType.LINE_ITEM; + customField1.dataType = CustomFieldDataType.STRING; + customField1.visibility = CustomFieldVisibility.FULL; + + CustomField customField2 = new CustomField(); + customField2.name = "Internal approval status #" + GetTimeStamp(); + customField2.entityType = CustomFieldEntityType.LINE_ITEM; + customField2.dataType = CustomFieldDataType.DROP_DOWN; + customField2.visibility = CustomFieldVisibility.FULL; + + try { + // Add custom fields. + CustomField[] customFields = + customFieldService.createCustomFields(new CustomField[] {customField1, customField2}); + + // Display results. + if (customFields != null) { + foreach (CustomField customField in customFields) { + Console.WriteLine("Custom field with ID \"{0}\" and name \"{1}\" was created.", + customField.id, customField.name); + } + } else { + Console.WriteLine("No custom fields created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CustomFieldService/DeactivateAllLineItemCustomFields.cs b/examples/Dfp/CSharp/v201208/CustomFieldService/DeactivateAllLineItemCustomFields.cs new file mode 100644 index 00000000000..7c63dc22662 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CustomFieldService/DeactivateAllLineItemCustomFields.cs @@ -0,0 +1,122 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using Google.Api.Ads.Dfp.Util.v201208; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example deactivates all active line item custom fields. To + /// determine which custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// Tags: CustomFieldService.performCustomFieldAction + /// + class DeactivateAllLineItemCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active line item custom fields. To determine " + + "which custom fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateAllLineItemCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201208.CustomFieldService); + + // Create statement to select only active custom fields that apply to + // line items. + String statementText = "WHERE entityType = :entityType and isActive = :isActive LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText) + .AddValue("entityType", CustomFieldEntityType.LINE_ITEM.ToString()) + .AddValue("isActive", true) + .ToStatement(); + + // Set defaults for page and offset. + CustomFieldPage page = new CustomFieldPage(); + int offset = 0; + int i = 0; + List customFieldIds = new List(); + + try { + do { + // Create a statement to page through custom fields. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(filterStatement); + + if (page.results != null) { + foreach (CustomField customField in page.results) { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" will be " + + "deactivated.", i, customField.id, customField.name); + customFieldIds.Add(customField.id.ToString()); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of custom fields to be deactivated: " + customFieldIds.Count); + + if (customFieldIds.Count > 0) { + // Modify statement for action. + filterStatement.query = "WHERE id IN (" + string.Join(", ", customFieldIds.ToArray()) + + ")"; + + // Create action. + DeactivateCustomFields action = new DeactivateCustomFields(); + + // Perform action. + UpdateResult result = customFieldService.performCustomFieldAction( + action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of custom fields deactivated: " + result.numChanges); + } else { + Console.WriteLine("No custom fields were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CustomFieldService/GetAllCustomFields.cs b/examples/Dfp/CSharp/v201208/CustomFieldService/GetAllCustomFields.cs new file mode 100644 index 00000000000..25102176fae --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CustomFieldService/GetAllCustomFields.cs @@ -0,0 +1,107 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using Google.Api.Ads.Dfp.Util.v201208; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all custom fields. To create custom fields, run + /// CreateCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// Tags: CustomFieldService.performCustomFieldAction + /// + class GetAllCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom fields. To create custom fields, run " + + "CreateCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201208.CustomFieldService); + + // Sets defaults for page and filter. + CustomFieldPage page = new CustomFieldPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all custom fields. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomField customField in page.results) { + if (customField is DropDownCustomField) { + List dropDownCustomFieldStrings = new List(); + DropDownCustomField dropDownCustomField = (DropDownCustomField) customField; + if (dropDownCustomField.options != null) { + foreach (CustomFieldOption customFieldOption in dropDownCustomField.options) { + dropDownCustomFieldStrings.Add(customFieldOption.displayName); + } + } + Console.WriteLine("{0}) Drop-down custom field with ID \"{1}\", name \"{2}\", " + + "and options {{{3}}} was found.", i, customField.id, customField.name, + string.Join(", ", dropDownCustomFieldStrings.ToArray())); + } else { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" was found.", + i, customField.id, customField.name); + } + i++; + } + } + + offset += 500; + } while (page.results != null && page.results.Length == 500); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CustomFieldService/GetAllLineItemCustomFields.cs b/examples/Dfp/CSharp/v201208/CustomFieldService/GetAllLineItemCustomFields.cs new file mode 100644 index 00000000000..2bcc609b9eb --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CustomFieldService/GetAllLineItemCustomFields.cs @@ -0,0 +1,97 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using Google.Api.Ads.Dfp.Util.v201208; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all custom fields that apply to line items. To + /// create custom fields, run CreateCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// + class GetAllLineItemCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom fields that apply to line items. To create " + + "custom fields, run CreateCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLineItemCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201208.CustomFieldService); + + // Create statement to select only custom fields that apply to line items. + String statementText = "WHERE entityType = :entityType LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText) + .AddValue("entityType", CustomFieldEntityType.LINE_ITEM.ToString()) + .ToStatement(); + + // Set defaults for page and offset. + CustomFieldPage page = new CustomFieldPage(); + int offset = 0; + int i = 0; + + try { + do { + // Create a statement to page through custom fields. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(filterStatement); + + if (page.results != null) { + foreach (CustomField customField in page.results) { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" was found.", i, + customField.id, customField.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all line item custom fields. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CustomFieldService/SetLineItemCustomFieldValue.cs b/examples/Dfp/CSharp/v201208/CustomFieldService/SetLineItemCustomFieldValue.cs new file mode 100644 index 00000000000..e8183d53c2e --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CustomFieldService/SetLineItemCustomFieldValue.cs @@ -0,0 +1,148 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using Google.Api.Ads.Dfp.Util.v201208; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example sets custom field values on a line item. To determine + /// which custom fields exist, run GetAllCustomFields.cs. To create custom + /// field options, run CreateCustomFieldOptions.cs. To determine which line + /// items exist, run GetAllLineItems.cs. + /// + /// Tags: CustomFieldService.getCustomField + /// Tags: LineItemService.getLineItem + /// Tags: LineItemService.updateLineItems + /// + class SetLineItemCustomFieldValue : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example sets custom field values on a line item. To determine which " + + "custom fields exist, run GetAllCustomFields.cs. To create custom field options, " + + "run CreateCustomFieldOptions.cs. To determine which line items exist, run " + + "GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new SetLineItemCustomFieldValue(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201208.CustomFieldService); + + // Get the LineItemService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201208.LineItemService); + + // Set the IDs of the custom fields, custom field option, and line item. + long customFieldId = long.Parse(_T("INSERT_STRING_CUSTOM_FIELD_ID_HERE")); + long dropDownCustomFieldId = long.Parse(_T("INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE")); + long customFieldOptionId = long.Parse(_T("INSERT_CUSTOM_FIELD_OPTION_ID_HERE")); + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get the custom field. + CustomField customField = customFieldService.getCustomField(customFieldId); + + // Get the drop-down custom field. + DropDownCustomField dropDownCustomField = + (DropDownCustomField) customFieldService.getCustomField(dropDownCustomFieldId); + + // Get the line item. + LineItem lineItem = lineItemService.getLineItem(lineItemId); + + // Create custom field values. + List customFieldValues = new List(); + TextValue textValue = new TextValue(); + textValue.value = "Custom field value"; + + CustomFieldValue customFieldValue = new CustomFieldValue(); + customFieldValue.customFieldId = customFieldId; + customFieldValue.value = textValue; + customFieldValues.Add(customFieldValue); + + DropDownCustomFieldValue dropDownCustomFieldValue = new DropDownCustomFieldValue(); + dropDownCustomFieldValue.customFieldId = dropDownCustomFieldId; + dropDownCustomFieldValue.customFieldOptionId = customFieldOptionId; + customFieldValues.Add(dropDownCustomFieldValue); + + // Only add existing custom field values for different custom fields than + // the ones you are setting. + if (lineItem.customFieldValues != null) { + foreach (BaseCustomFieldValue oldCustomFieldValue in lineItem.customFieldValues) { + if (!(oldCustomFieldValue.customFieldId == customFieldId) + && !(oldCustomFieldValue.customFieldId == dropDownCustomFieldId)) { + customFieldValues.Add(oldCustomFieldValue); + } + } + } + + lineItem.customFieldValues = customFieldValues.ToArray(); + + // Update the line item on the server. + LineItem[] lineItems = lineItemService.updateLineItems(new LineItem[] {lineItem}); + + if (lineItems != null) { + foreach (LineItem updatedLineItem in lineItems) { + List customFieldValueStrings = new List(); + foreach (BaseCustomFieldValue baseCustomFieldValue in lineItem.customFieldValues) { + if (baseCustomFieldValue is CustomFieldValue + && ((CustomFieldValue) baseCustomFieldValue).value is TextValue) { + customFieldValueStrings.Add("{ID: '" + baseCustomFieldValue.customFieldId + + "', value: '" + + ((TextValue) ((CustomFieldValue) baseCustomFieldValue).value).value + + "'}"); + } else if (baseCustomFieldValue is DropDownCustomFieldValue) { + customFieldValueStrings.Add("{ID: '" + baseCustomFieldValue.customFieldId + + "', custom field option ID: '" + + ((DropDownCustomFieldValue) baseCustomFieldValue).customFieldOptionId + + "'}"); + } + } + Console.WriteLine("A line item with ID \"{0}\" set with custom field values \"{1}\".", + updatedLineItem.id, string.Join(", ", customFieldValueStrings.ToArray())); + } + } else { + Console.WriteLine("No line items were updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CustomFieldService/UpdateCustomFields.cs b/examples/Dfp/CSharp/v201208/CustomFieldService/UpdateCustomFields.cs new file mode 100644 index 00000000000..97842cf890e --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CustomFieldService/UpdateCustomFields.cs @@ -0,0 +1,95 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using Google.Api.Ads.Dfp.Util.v201208; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example updates custom field descriptions. To determine which + /// custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.updateCustomFields + /// + class UpdateCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates custom field descriptions. To determine which custom " + + "fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201208.CustomFieldService); + + // Set the ID of the custom field to update. + long customFieldId = long.Parse(_T("INSERT_CUSTOM_FIELD_ID_HERE")); + + try { + // Get the custom field. + CustomField customField = customFieldService.getCustomField(customFieldId); + + if (customField != null) { + customField.description = + (customField.description == null ? "" : customField.description + " Updated"); + + // Update the custom field on the server. + CustomField[] customFields = + customFieldService.updateCustomFields(new CustomField[] {customField}); + + // Display results + if (customFields != null) { + foreach (CustomField updatedCustomField in customFields) { + Console.WriteLine("Custom field with ID \"{0}\", name \"{1}\", and description " + + "\"{2}\" was updated.", updatedCustomField.id, updatedCustomField.name, + updatedCustomField.description); + } + } else { + Console.WriteLine("No custom fields were updated."); + } + } else { + Console.WriteLine("No custom fields found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs b/examples/Dfp/CSharp/v201208/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs new file mode 100644 index 00000000000..4d76a2040d6 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs @@ -0,0 +1,158 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example creates new custom targeting keys and values. To + /// determine which custom targeting keys and values exist, run + /// GetAllCustomTargetingKeysAndValues.cs. To target these custom targeting + /// keys and values, run TargetCustomCriteria.cs. + /// + /// Tags: CustomTargetingService.createCustomTargetingKeys + /// Tags: CustomTargetingService.createCustomTargetingValues + /// + class CreateCustomTargetingKeysAndValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new custom targeting keys and values. To determine " + + "which custom targeting keys and values exist, run " + + "GetAllCustomTargetingKeysAndValues.cs. To target these custom targeting keys and " + + "values, run TargetCustomCriteria.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomTargetingKeysAndValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201208.CustomTargetingService); + + // Create predefined key. + CustomTargetingKey genderKey = new CustomTargetingKey(); + genderKey.displayName = "gender"; + genderKey.name = "g"; + genderKey.type = CustomTargetingKeyType.PREDEFINED; + + // Create predefined key that may be used for content targeting. + CustomTargetingKey genreKey = new CustomTargetingKey(); + genreKey.displayName = "genre"; + genreKey.name = "genre"; + genreKey.type = CustomTargetingKeyType.PREDEFINED; + + // Create free-form key. + CustomTargetingKey carModelKey = new CustomTargetingKey(); + carModelKey.displayName = "car model"; + carModelKey.name = "c"; + carModelKey.type = CustomTargetingKeyType.FREEFORM; + + try { + // Create the custom targeting keys on the server. + CustomTargetingKey[] keys = customTargetingService.createCustomTargetingKeys( + new CustomTargetingKey[] {genderKey, genreKey, carModelKey}); + + if (keys != null) { + foreach (CustomTargetingKey key in keys) { + Console.WriteLine("A custom targeting key with ID \"{0}\", name \"{1}\", and display " + + "name \"{2}\" was created.", key.id, key.name, key.displayName); + } + } else { + Console.WriteLine("No keys were created."); + } + + // Create custom targeting value for the predefined gender key. + CustomTargetingValue genderMaleValue = new CustomTargetingValue(); + genderMaleValue.customTargetingKeyId = keys[0].id; + genderMaleValue.displayName = "male"; + // Name is set to 1 so that the actual name can be hidden from website + // users. + genderMaleValue.name = "1"; + genderMaleValue.matchType = CustomTargetingValueMatchType.EXACT; + + CustomTargetingValue genderFemaleValue = new CustomTargetingValue(); + genderFemaleValue.customTargetingKeyId = keys[0].id; + genderFemaleValue.displayName = "female"; + // Name is set to 2 so that the actual name can be hidden from website + // users. + genderFemaleValue.name = "2"; + genderFemaleValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create custom targeting value for the predefined genre key. + CustomTargetingValue genreComedyValue = new CustomTargetingValue(); + genreComedyValue.customTargetingKeyId = keys[1].id; + genreComedyValue.displayName = "comedy"; + genreComedyValue.name = "comedy"; + genreComedyValue.matchType = CustomTargetingValueMatchType.EXACT; + + CustomTargetingValue genreDramaValue = new CustomTargetingValue(); + genreDramaValue.customTargetingKeyId = keys[1].id; + genreDramaValue.displayName = "drama"; + genreDramaValue.name = "drama"; + genreDramaValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create custom targeting value for the free-form age key. These are + // values that would be suggested in the UI or can be used when + // targeting with a FreeFormCustomCriteria. + CustomTargetingValue carModelHondaCivicValue = new CustomTargetingValue(); + carModelHondaCivicValue.customTargetingKeyId = keys[2].id; + carModelHondaCivicValue.displayName = "honda civic"; + carModelHondaCivicValue.name = "honda civic"; + // Setting match type to exact will match exactly "honda civic". + carModelHondaCivicValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create the custom targeting values on the server. + CustomTargetingValue[] returnValues = customTargetingService.createCustomTargetingValues( + new CustomTargetingValue[] {genderMaleValue, genderFemaleValue, genreComedyValue, + genreDramaValue, carModelHondaCivicValue}); + + if (returnValues != null) { + foreach (CustomTargetingValue value in returnValues) { + Console.WriteLine("A custom targeting value with ID \"{0}\", belonging to key with " + + "ID \"{1}\", name \"{2}\", and display name \"{3}\" was created.", value.id, + value.customTargetingKeyId, value.name, value.displayName); + } + } else { + Console.WriteLine("No values were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom targeting keys and values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs b/examples/Dfp/CSharp/v201208/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs new file mode 100644 index 00000000000..51022d3cfb6 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs @@ -0,0 +1,122 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all custom targeting keys and the values. To create + /// custom targeting keys and values, run + /// CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// + class GetAllCustomTargetingKeysAndValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom targeting keys and the values. To create " + + "custom targeting keys and values, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCustomTargetingKeysAndValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201208.CustomTargetingService); + + // Sets defaults for page and filter. + CustomTargetingKeyPage keyPage = new CustomTargetingKeyPage(); + Statement keyFilterStatement = new Statement(); + int keyOffset = 0; + + try { + do { + // Create a statement to get all custom targeting keys. + keyFilterStatement.query = "LIMIT 500 OFFSET " + keyOffset; + + // Get custom targeting keys by statement. + keyPage = customTargetingService.getCustomTargetingKeysByStatement(keyFilterStatement); + + if (keyPage.results != null) { + int i = keyPage.startIndex; + foreach (CustomTargetingKey key in keyPage.results) { + Console.WriteLine("{0}) Custom targeting key with ID \"{1}\", name \"{2}\", " + + "display name \"{3}\", and type \"{4}\" was found.", i, key.id, key.name, + key.displayName, key.type); + + + // Sets defaults for page and filter. + CustomTargetingValuePage valuePage = new CustomTargetingValuePage(); + Statement valueFilterStatement = new Statement(); + int valueOffset = 0; + + do { + // Create a statement to get all custom targeting values for a + // custom targeting key (required) by its ID. + valueFilterStatement.query = string.Format("WHERE customTargetingKeyId = {0} " + + "LIMIT 500 OFFSET {1}", key.id, valueOffset); + + // Get custom targeting values by statement. + valuePage = customTargetingService.getCustomTargetingValuesByStatement( + valueFilterStatement); + + if (valuePage.results != null) { + int j = valuePage.startIndex; + foreach (CustomTargetingValue value in valuePage.results) { + Console.WriteLine("\t{0}) Custom targeting value with ID \"{1}\", name " + + "\"{2}\", and display name \"{3}\" was found.", j, value.id, value.name, + value.displayName); + j++; + } + } + valueOffset += 500; + } while (valuePage.results != null && valuePage.results.Length == 500); + i++; + } + } + keyOffset += 500; + } while (keyPage.results != null && keyPage.results.Length == 500); + Console.WriteLine("Number of results found: {0}", keyPage.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get custom targeting keys and the values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CustomTargetingService/GetCustomTargetingKeysByStatement.cs b/examples/Dfp/CSharp/v201208/CustomTargetingService/GetCustomTargetingKeysByStatement.cs new file mode 100644 index 00000000000..e80b94a3625 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CustomTargetingService/GetCustomTargetingKeysByStatement.cs @@ -0,0 +1,88 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all predefined custom targeting keys. The statement + /// retrieves up to the maximum page size limit of 500. To create custom + /// targeting keys, run CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// + class GetCustomTargetingKeysByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all predefined custom targeting keys. The statement " + + "retrieves up to the maximum page size limit of 500. To create custom " + + "targeting keys, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCustomTargetingKeysByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201208.CustomTargetingService); + + try { + // Create a statement to only select predefined custom targeting keys. + Statement filterStatement = new StatementBuilder("WHERE type = :type LIMIT 500").AddValue( + "type", CustomTargetingKeyType.PREDEFINED.ToString()).ToStatement(); + + // Get custom targeting keys by statement. + CustomTargetingKeyPage page = + customTargetingService.getCustomTargetingKeysByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomTargetingKey customTargetingKey in page.results) { + Console.WriteLine("{0}) Custom targeting key with ID \"{1}\", name \"{2}\", and " + + "display name \"{3}\" was found.", i, customTargetingKey.id, + customTargetingKey.name, customTargetingKey.displayName); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get predefined custom targeting keys. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CustomTargetingService/GetCustomTargetingValuesByStatement.cs b/examples/Dfp/CSharp/v201208/CustomTargetingService/GetCustomTargetingValuesByStatement.cs new file mode 100644 index 00000000000..5ae807511f2 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CustomTargetingService/GetCustomTargetingValuesByStatement.cs @@ -0,0 +1,99 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets custom targeting values for the given predefined + /// custom targeting key. The statement retrieves up to the maximum page size + /// limit of 500. To create custom targeting values, run + /// CreateCustomTargetingKeysAndValues.cs. To determine which custom + /// targeting keys exist, run GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// + class GetCustomTargetingValuesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets custom targeting values for the given predefined custom " + + "targeting key. The statement retrieves up to the maximum page size limit of 500. " + + "To create custom targeting values, run CreateCustomTargetingKeysAndValues.cs. To " + + "determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCustomTargetingValuesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201208.CustomTargetingService); + + // Set the ID of the custom targeting key to get custom targeting values + // for. + long customTargetingKeyId = long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + + // Create a statement to only select custom targeting values for a given + // key. + Statement filterStatement = + new StatementBuilder("WHERE customTargetingKeyId = :customTargetingKeyId LIMIT 500") + .AddValue("customTargetingKeyId", customTargetingKeyId).ToStatement(); + + try { + // Get custom targeting values by statement. + CustomTargetingValuePage page = + customTargetingService.getCustomTargetingValuesByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomTargetingValue customTargetingValue in page.results) { + Console.WriteLine("{0}) Custom targeting value with ID \"{1}\", name \"{2}\", and " + + "display name \"{3}\" was found.", i, customTargetingValue.id, + customTargetingValue.name, customTargetingValue.displayName); + i++; + } + } + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get custom targeting values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CustomTargetingService/UpdateCustomTargetingKeys.cs b/examples/Dfp/CSharp/v201208/CustomTargetingService/UpdateCustomTargetingKeys.cs new file mode 100644 index 00000000000..ba065d6c965 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CustomTargetingService/UpdateCustomTargetingKeys.cs @@ -0,0 +1,107 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example updates the display name of each custom targeting key up + /// to the first 500. To determine which custom targeting keys exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// Tags: CustomTargetingService.updateCustomTargetingKeys + /// + class UpdateCustomTargetingKeys : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the display name of each custom targeting key up " + + "to the first 500. To determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomTargetingKeys(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201208.CustomTargetingService); + + // Create a statement to get all custom targeting keys. + Statement filterStatement = new Statement(); + filterStatement.query = "LIMIT 500"; + + try { + // Get custom targeting keys by statement. + CustomTargetingKeyPage page = + customTargetingService.getCustomTargetingKeysByStatement(filterStatement); + + if (page.results != null) { + CustomTargetingKey[] customTargetingKeys = page.results; + + // Update each local custom targeting key object by changing its display + // name. + foreach (CustomTargetingKey customTargetingKey in customTargetingKeys) { + if (customTargetingKey.displayName == null) { + customTargetingKey.displayName = customTargetingKey.name; + } + customTargetingKey.displayName = customTargetingKey.displayName + " (Deprecated)"; + } + + // Update the custom targeting keys on the server. + customTargetingKeys = + customTargetingService.updateCustomTargetingKeys(customTargetingKeys); + + if (customTargetingKeys != null) { + foreach (CustomTargetingKey customTargetingKey in customTargetingKeys) { + Console.WriteLine("Custom targeting key with ID \"{0}\", name \"{1}\", and " + + "display name \"{2}\" was updated.", customTargetingKey.id, + customTargetingKey.name, customTargetingKey.displayName); + } + } else { + Console.WriteLine("No custom targeting keys updated."); + } + } else { + Console.WriteLine("No custom targeting keys found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update display name of custom targeting keys. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/CustomTargetingService/UpdateCustomTargetingValues.cs b/examples/Dfp/CSharp/v201208/CustomTargetingService/UpdateCustomTargetingValues.cs new file mode 100644 index 00000000000..38ae0e1681d --- /dev/null +++ b/examples/Dfp/CSharp/v201208/CustomTargetingService/UpdateCustomTargetingValues.cs @@ -0,0 +1,113 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example updates the display name of each custom targeting value + /// up to the first 500. To determine which custom targeting keys exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// Tags: CustomTargetingService.updateCustomTargetingValues + /// + class UpdateCustomTargetingValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the display name of each custom targeting value up to " + + "the first 500. To determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomTargetingValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201208.CustomTargetingService); + + // Set the ID of the predefined custom targeting key to get custom + // targeting values for. + long customTargetingKeyId = long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + + // Create a statement to only select predefined custom targeting values + // for a given key. + Statement filterStatement = + new StatementBuilder("WHERE customTargetingKeyId = :customTargetingKeyId LIMIT 500") + .AddValue("customTargetingKeyId", customTargetingKeyId).ToStatement(); + + try { + // Get custom targeting values by statement. + CustomTargetingValuePage page = + customTargetingService.getCustomTargetingValuesByStatement(filterStatement); + + if (page.results != null) { + CustomTargetingValue[] customTargetingValues = page.results; + + // Update each local custom targeting value object by changing its + // display name. + foreach (CustomTargetingValue customTargetingValue in customTargetingValues) { + if (customTargetingValue.displayName == null) { + customTargetingValue.displayName = customTargetingValue.displayName; + } + customTargetingValue.displayName = customTargetingValue.displayName + " (Deprecated)"; + } + + // Update the custom targeting values on the server. + customTargetingValues = + customTargetingService.updateCustomTargetingValues(customTargetingValues); + + if (customTargetingValues != null) { + foreach (CustomTargetingValue customTargetingValue in customTargetingValues) { + Console.WriteLine("Custom targeting value with ID \"{0}\", name \"{1}\", and " + + "display name \"{2}\" was updated.", customTargetingValue.id, + customTargetingValue.name, customTargetingValue.displayName); + } + } else { + Console.WriteLine("No custom targeting values updated."); + } + } else { + Console.WriteLine("No custom targeting values found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update display names of custom targeting values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/ForecastService/GetForecast.cs b/examples/Dfp/CSharp/v201208/ForecastService/GetForecast.cs new file mode 100644 index 00000000000..4e7b2503f38 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/ForecastService/GetForecast.cs @@ -0,0 +1,111 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets a forecast for a prospective line item. To + /// determine which placements exist, run GetAllPlacements.cs. + /// + /// Tags: ForecastService.getForecast + /// + class GetForecast : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a forecast for a prospective line item. To determine " + + "which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetForecast(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ForecastService. + ForecastService forecastService = + (ForecastService)user.GetService(DfpService.v201208.ForecastService); + + // Set the placement that the prospective line item will target. + long[] targetPlacementIds = new long[] {long.Parse(_T("INSERT_PLACEMENT_ID_HERE"))}; + + // Set the end date time to have the line line item run till. + string endDateTime = "INSERT_END_DATE_TIME_HERE (yyyyMMdd HH:mm:ss)"; + + // Create prospective line item. + LineItem lineItem = new LineItem(); + + lineItem.targeting = new Targeting(); + lineItem.targeting.inventoryTargeting = new InventoryTargeting(); + lineItem.targeting.inventoryTargeting.targetedPlacementIds = targetPlacementIds; + + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + lineItem.lineItemType = LineItemType.SPONSORSHIP; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + + lineItem.endDateTime = DateTimeUtilities.FromString(endDateTime); + + // Set the cost type to match the unit type. + lineItem.costType = CostType.CPM; + + try { + // Get forecast. + Forecast forecast = forecastService.getForecast(lineItem); + + // Display results. + long matched = forecast.matchedUnits; + double availablePercent = (double) (forecast.availableUnits / (matched * 1.0)) * 100; + String unitType = forecast.unitType.ToString().ToLower(); + Console.WriteLine("{0} {1} matched.\n{2}% available.", matched, unitType, + availablePercent, unitType); + + if (forecast.possibleUnitsSpecified) { + double possiblePercent = (double) (forecast.possibleUnits / (matched * 1.0)) * 100; + Console.WriteLine("{0}% {1} possible.\n", possiblePercent, unitType); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get forecast. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/ForecastService/GetForecastById.cs b/examples/Dfp/CSharp/v201208/ForecastService/GetForecastById.cs new file mode 100644 index 00000000000..11f96f1c710 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/ForecastService/GetForecastById.cs @@ -0,0 +1,82 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets a forecast for an existing line item. To determine + /// which line items exist, run GetAllLineItems.cs. + /// + /// Tags: ForecastService.getForecastById + /// + class GetForecastById : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a forecast for an existing line item. To determine which " + + "line items exist, run GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetForecastById(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ForecastService. + ForecastService forecastService = + (ForecastService) user.GetService(DfpService.v201208.ForecastService); + + // Set the line item to get a forecast for. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get forecast for line item. + Forecast forecast = forecastService.getForecastById(lineItemId); + + // Display results. + long matched = forecast.matchedUnits; + double availablePercent = (double) (forecast.availableUnits / (matched * 1.0)) * 100; + String unitType = forecast.unitType.ToString().ToLower(); + + Console.WriteLine("{0} {1} matched.\n{2} % {3} available.", matched, unitType, + availablePercent, unitType); + if (forecast.possibleUnitsSpecified) { + double possiblePercent = (double) (forecast.possibleUnits / (matched * 1.0)) * 100; + Console.WriteLine(possiblePercent + "% " + unitType + " possible.\n"); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get forecast by id. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/InventoryService/CreateAdUnits.cs b/examples/Dfp/CSharp/v201208/InventoryService/CreateAdUnits.cs new file mode 100644 index 00000000000..dd415cc80ac --- /dev/null +++ b/examples/Dfp/CSharp/v201208/InventoryService/CreateAdUnits.cs @@ -0,0 +1,108 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example creates new ad units under the effective root ad unit. + /// To determine which ad units exist, run GetAdUnitTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.createAdUnits, NetworkService.getCurrentNetwork + /// + class CreateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new ad units under the effective root ad unit. To " + + "determine which ad units exist, run GetAdUnitTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201208.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201208.NetworkService); + + string effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create an array to store local ad unit objects. + AdUnit[] adUnits = new AdUnit[5]; + + for (int i = 0; i < 5; i++) { + AdUnit adUnit = new AdUnit(); + adUnit.name = string.Format("Ad_Unit_{0}", i); + adUnit.parentId = effectiveRootAdUnitId; + + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + + // Set the size of possible creatives that can match this ad unit. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + adUnits[i] = adUnit; + } + + try { + // Create the ad units on the server. + adUnits = inventoryService.createAdUnits(adUnits); + + if (adUnits != null) { + foreach (AdUnit adUnit in adUnits) { + Console.WriteLine("An ad unit with ID = '{0}' was created under parent with " + + "ID = '{1}'.", adUnit.id, adUnit.parentId); + } + } else { + Console.WriteLine("No ad units created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/InventoryService/CreateMobileAdUnit.cs b/examples/Dfp/CSharp/v201208/InventoryService/CreateMobileAdUnit.cs new file mode 100644 index 00000000000..b38d6f9f4c1 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/InventoryService/CreateMobileAdUnit.cs @@ -0,0 +1,104 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example creates a new mobile ad unit under the effective root + /// ad unit. Mobile features need to be enabled on your account to use mobile + /// targeting. To determine which ad units exist, run GetInventoryTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.createAdUnits, NetworkService.getCurrentNetwork + /// + class CreateMobileAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new mobile ad unit under the effective ad unit. " + + "Mobile features need to be enabled on your account to use mobile targeting. To " + + "determine which ad units exist, run GetInventoryTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateMobileAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201208.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201208.NetworkService); + + // Set the parent ad unit's ID for all ad units to be created under. + String effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create local ad unit object. + AdUnit adUnit = new AdUnit(); + adUnit.name = "Mobile_Ad_Unit"; + adUnit.parentId = effectiveRootAdUnitId; + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + adUnit.targetPlatform = TargetPlatform.MOBILE; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + Size size = new Size(); + size.width = 400; + size.height = 300; + size.isAspectRatio = false; + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + // Set the size of possible creatives that can match this ad unit. + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + + try { + // Create the ad unit on the server. + adUnit = inventoryService.createAdUnit(adUnit); + + if (adUnit != null) { + Console.WriteLine("An ad unit with ID \"{0}\" was created under parent with ID \"{1}\".", + adUnit.id, adUnit.parentId); + } else { + Console.WriteLine("No ad units created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/InventoryService/CreateVideoAdUnit.cs b/examples/Dfp/CSharp/v201208/InventoryService/CreateVideoAdUnit.cs new file mode 100644 index 00000000000..612a05b9a5a --- /dev/null +++ b/examples/Dfp/CSharp/v201208/InventoryService/CreateVideoAdUnit.cs @@ -0,0 +1,123 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example creates a new video ad unit under the effective root + /// ad unit. To determine which ad units exist, run GetInventoryTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.CreateVideoAdUnit, NetworkService.getCurrentNetwork + /// + class CreateVideoAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new ad units under the effective root ad unit. To " + + "determine which ad units exist, run GetAdUnitTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateVideoAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201208.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201208.NetworkService); + + // Set the parent ad unit's ID for all ad units to be created under. + String effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create local ad unit object. + AdUnit adUnit = new AdUnit(); + adUnit.name = "Video_Ad_Unit"; + adUnit.parentId = effectiveRootAdUnitId; + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + adUnit.explicitlyTargeted = true; + adUnit.targetPlatform = TargetPlatform.WEB; + + // Create master ad unit size. + AdUnitSize masterAdUnitSize = new AdUnitSize(); + Size size1 = new Size(); + size1.width = 400; + size1.height = 300; + size1.isAspectRatio = false; + masterAdUnitSize.size = size1; + masterAdUnitSize.environmentType = EnvironmentType.VIDEO_PLAYER; + + // Create companion sizes. + AdUnitSize companionAdUnitSize1 = new AdUnitSize(); + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + size2.isAspectRatio = false; + companionAdUnitSize1.size = size2; + companionAdUnitSize1.environmentType = EnvironmentType.BROWSER; + + AdUnitSize companionAdUnitSize2 = new AdUnitSize(); + Size size3 = new Size(); + size3.width = 728; + size3.height = 90; + size3.isAspectRatio = false; + companionAdUnitSize2.size = size3; + companionAdUnitSize2.environmentType = EnvironmentType.BROWSER; + + // Add companions to master ad unit size. + masterAdUnitSize.companions = new AdUnitSize[] {companionAdUnitSize1, companionAdUnitSize2}; + + // Set the size of possible creatives that can match this ad unit. + adUnit.adUnitSizes = new AdUnitSize[] {masterAdUnitSize}; + + try { + // Create the ad unit on the server. + adUnit = inventoryService.createAdUnit(adUnit); + + if (adUnit != null) { + Console.WriteLine("A video ad unit with ID \"{0}\" was created under parent with ID " + + "\"{1}\".", adUnit.id, adUnit.parentId); + } else { + Console.WriteLine("No video ad units created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create video ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/InventoryService/DeActivateAdUnits.cs b/examples/Dfp/CSharp/v201208/InventoryService/DeActivateAdUnits.cs new file mode 100644 index 00000000000..3eaa01172f8 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/InventoryService/DeActivateAdUnits.cs @@ -0,0 +1,120 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example deactivates all active ad units. To determine which ad + /// units exist, run GetAllAdUnits.cs or GetInventoryTree.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: InventoryService.performAdUnitAction + /// + class DeActivateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active ad units. To determine which ad units " + + "exist, run GetAllAdUnits.cs or GetInventoryTree.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeActivateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201208.InventoryService); + + // Create Statement text to select active ad units. + string statementText = "WHERE status = :status LIMIT 500"; + + Statement statement = new StatementBuilder("").AddValue("status", + InventoryStatus.ACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + AdUnitPage page = new AdUnitPage(); + int offset = 0; + List adUnitIds = new List(); + + try { + do { + // Create a Statement to page through active ad units. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID ='{1}', name = {2} and status = {3} will" + + " be deactivated.", i, adUnit.id, adUnit.name, adUnit.status); + adUnitIds.Add(adUnit.id); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of ad units to be deactivated: {0}", adUnitIds.Count); + + if (adUnitIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", adUnitIds.ToArray()))). + ToStatement(); + + // Create action. + DeactivateAdUnits action = new DeactivateAdUnits(); + + // Perform action. + UpdateResult result = inventoryService.performAdUnitAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of ad units deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No ad units were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/InventoryService/GetAdUnit.cs b/examples/Dfp/CSharp/v201208/InventoryService/GetAdUnit.cs new file mode 100644 index 00000000000..cd877166614 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/InventoryService/GetAdUnit.cs @@ -0,0 +1,77 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets an ad unit by its ID. To determine which ad units + /// exist, run GetInventoryTree.cs or GetAllAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnit + /// + class GetAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets an ad unit by its ID. To determine which ad units " + + "exist, run GetInventoryTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201208.InventoryService); + + // Set the ID of the ad unit to get. + String adUnitId = _T("INSERT_AD_UNIT_ID_HERE"); + + try { + // Get the ad unit. + AdUnit adUnit = inventoryService.getAdUnit(adUnitId); + + if (adUnit != null) { + Console.WriteLine("Ad unit with ID = '{0}', name = '{1}' and status = '{2}' was found.", + adUnit.id, adUnit.name, adUnit.status); + } else { + Console.WriteLine("No ad unit found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/InventoryService/GetAdUnitSizes.cs b/examples/Dfp/CSharp/v201208/InventoryService/GetAdUnitSizes.cs new file mode 100644 index 00000000000..9fa43ef0c62 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/InventoryService/GetAdUnitSizes.cs @@ -0,0 +1,80 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; +using Google.Api.Ads.Dfp.Util.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all web target platform ad unit sizes. + /// + /// Tags: InventoryService.getAdUnitSizesByStatement + /// + class GetAdUnitSizes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all web target platform ad unit sizes."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnitSizes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201208.InventoryService); + + Statement filterStatement = new StatementBuilder("WHERE targetPlatform = :targetPlatform"). + AddValue("targetPlatform", "WEB").ToStatement(); + + try { + // Get all ad unit sizes. + AdUnitSize[] adUnitSizes = inventoryService.getAdUnitSizesByStatement(filterStatement); + + // Display results. + if (adUnitSizes != null) { + for (int i = 0; i < adUnitSizes.Length; i++) { + AdUnitSize adUnitSize = adUnitSizes[i]; + Console.WriteLine("{0}) Ad unit size ({1}x{2}) was found.\n", i, + adUnitSize.size.width, adUnitSize.size.height); + } + } else { + Console.WriteLine("No ad unit sizes found."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit sizes. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/InventoryService/GetAdUnitsByStatement.cs b/examples/Dfp/CSharp/v201208/InventoryService/GetAdUnitsByStatement.cs new file mode 100644 index 00000000000..8cab1dd2520 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/InventoryService/GetAdUnitsByStatement.cs @@ -0,0 +1,93 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets the root ad unit. To create an ad unit, run + /// CreateAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: NetworkService.getCurrentNetwork + /// + class GetAdUnitsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the root ad unit. To create an ad unit, run " + + "CreateAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnitsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201208.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201208.NetworkService); + + // Get the effective root ad unit ID of the network. + string effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create a statement to select the children of the effective root ad + // unit. + Statement statement = new StatementBuilder("WHERE parentId = :id LIMIT 1").AddValue( + "id", effectiveRootAdUnitId).ToStatement(); + + try { + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID = '{1}', name = '{2}' and status = '{3}' " + + "was found.", i, adUnit.id, adUnit.name, adUnit.status); + i++; + } + } + + // The number of results should always be 1 for this code example. + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/InventoryService/GetAllAdUnits.cs b/examples/Dfp/CSharp/v201208/InventoryService/GetAllAdUnits.cs new file mode 100644 index 00000000000..6d31dcac85a --- /dev/null +++ b/examples/Dfp/CSharp/v201208/InventoryService/GetAllAdUnits.cs @@ -0,0 +1,88 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all ad units. To create ad units, run + /// CreateAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// + class GetAllAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all ad units. To create ad units, run CreateAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201208.InventoryService); + + // Sets defaults for page and statement. + AdUnitPage page = new AdUnitPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all ad units. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID = '{1}', name = '{2}' and status = '{3}' " + + "was found.", i, adUnit.id, adUnit.name, adUnit.status); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/InventoryService/GetInventoryTree.cs b/examples/Dfp/CSharp/v201208/InventoryService/GetInventoryTree.cs new file mode 100644 index 00000000000..7cedf2834d2 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/InventoryService/GetInventoryTree.cs @@ -0,0 +1,203 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example retrieves a previously created ad units and creates + /// a tree. + /// + /// Tags: InventoryService.getAdUnit, InventoryService.getAdUnitsByStatement + /// + class GetInventoryTree : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves a previously created ad units and creates a tree."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetInventoryTree(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + try { + // Get all ad units. + AdUnit[] allAdUnits = GetAllAdUnits(user); + + // Find the root ad unit. rootAdUnit can also be set to child unit to + // only build and display a portion of the tree. + // i.e. AdUnit adUnit = + // inventoryService.getAdUnit("INSERT_AD_UNIT_HERE") + AdUnit rootAdUnit = FindRootAdUnit(user); + + if (rootAdUnit == null) { + Console.WriteLine("Could not build tree. No root ad unit found."); + } else { + BuildAndDisplayAdUnitTree(rootAdUnit, allAdUnits); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + + /// + /// Gets all ad units for this user. + /// + /// The DfpUser to get the ad units for. + /// All ad units for this user. + private static AdUnit[] GetAllAdUnits(DfpUser user) { + // Create list to hold all ad units. + List adUnits = new List(); + + // Get InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201208.InventoryService); + + // Sets defaults for page and Statement. + AdUnitPage page = new AdUnitPage(); + Statement statement = new Statement(); + int offset = 0; + + do { + // Create a Statement to get all ad units. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + adUnits.AddRange(page.results); + } + offset += 500; + } while (page.results != null && page.results.Length == 500); + return adUnits.ToArray(); + } + + /// + /// Finds the root ad unit for the user. + /// + /// The DfpUser to get the root ad unit for. + /// The ad unit representing the root ad unit or null if one + /// is not found. + private static AdUnit FindRootAdUnit(DfpUser user) { + // Get InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201208.InventoryService); + + // Create a Statement to only select the root ad unit. + Statement statement = new Statement(); + statement.query = "WHERE parentId IS NULL LIMIT 500"; + + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + return page.results[0]; + } + return null; + } + + /// + /// Builds and displays an ad unit tree from an array of ad units underneath + /// the root ad unit. + /// + /// The root ad unit to build the tree under. + /// The array of ad units. + private static void BuildAndDisplayAdUnitTree(AdUnit root, AdUnit[] units) { + Dictionary> treeMap = new Dictionary>(); + + foreach (AdUnit unit in units) { + if (unit.parentId != null) { + if (treeMap.ContainsKey(unit.parentId) == false) { + treeMap.Add(unit.parentId, new List()); + } + treeMap[unit.parentId].Add(unit); + } + } + + if (root != null) { + DisplayInventoryTree(root, treeMap); + } else { + Console.WriteLine("No root unit found."); + } + } + + /// + /// Displays the ad unit tree beginning at the root ad unit. + /// + /// The root ad unit + /// The map of id to list of ad units + private static void DisplayInventoryTree(AdUnit root, Dictionary> treeMap) { + DisplayInventoryTreeHelper(root, treeMap, 0); + } + + /// + /// Helper for displaying inventory units. + /// + /// The root inventory unit. + /// The map of id to List of inventory units. + /// The depth the tree has reached. + private static void DisplayInventoryTreeHelper(AdUnit root, + Dictionary> treeMap, int depth) { + Console.WriteLine(GenerateTab(depth) + root.name + " (" + root.id + ")"); + + if (treeMap.ContainsKey(root.id)) { + foreach (AdUnit child in treeMap[root.id]) { + DisplayInventoryTreeHelper(child, treeMap, depth + 1); + } + } + } + + /// + /// Generates a String of tabs to represent branching to children. + /// + /// A depth from 0 to max(depth). + /// A string to insert in front of the root unit. + private static String GenerateTab(int depth) { + StringBuilder builder = new StringBuilder(); + if (depth != 0) { + builder.Append(" "); + } + + for (int i = 1; i < depth; i++) { + builder.Append("| "); + } + builder.Append("+--"); + return builder.ToString(); + } + } +} diff --git a/examples/Dfp/CSharp/v201208/InventoryService/UpdateAdUnits.cs b/examples/Dfp/CSharp/v201208/InventoryService/UpdateAdUnits.cs new file mode 100644 index 00000000000..03c0fffa9fb --- /dev/null +++ b/examples/Dfp/CSharp/v201208/InventoryService/UpdateAdUnits.cs @@ -0,0 +1,92 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example updates an ad unit by enabling AdSense to the first + /// 500. To determine which ad units exist, run GetAllAdUnits.cs or + /// GetInventoryTree.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement, InventoryService.updateAdUnits + /// + class UpdateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates an ad unit by enabling AdSense to the first 500. To " + + "determine which ad units exist, run GetAllAdUnits.cs or GetInventoryTree.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the sample code. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201208.InventoryService); + + // Create a statement to get all ad units. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get ad units by statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null) { + // Update each local ad unit object by enabling AdSense. + foreach (AdUnit adUnit in page.results) { + adUnit.inheritedAdSenseSettings.value.adSenseEnabled = true; + } + + // Update the ad units on the server. + AdUnit[] updatedAdUnits = inventoryService.updateAdUnits(page.results); + + if (updatedAdUnits != null) { + foreach (AdUnit adUnit in updatedAdUnits) { + Console.WriteLine("Ad unit with ID \"{0}\", name \"{1}\", and is AdSense enabled " + + "\"{2}\" was updated.", adUnit.id, adUnit.name, + adUnit.inheritedAdSenseSettings.value.adSenseEnabled); + } + } else { + Console.WriteLine("No ad units updated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to update ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LabelService/CreateLabels.cs b/examples/Dfp/CSharp/v201208/LabelService/CreateLabels.cs new file mode 100644 index 00000000000..f67187293a6 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LabelService/CreateLabels.cs @@ -0,0 +1,93 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example creates new labels. To determine which labels exist, run + /// GetAllLabels.cs. This feature is only available to DFP premium solution + /// networks. + /// + /// Tags: LabelService.createLabels + /// + class CreateLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new labels. To determine which labels exist, run " + + "GetAllLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201208.LabelService); + + try { + // Create an array to store local label objects. + Label[] labels = new Label[5]; + + for (int i = 0; i < 5; i++) { + Label label = new Label(); + label.name = "Label #" + GetTimeStamp(); + label.types = new LabelType[] {LabelType.COMPETITIVE_EXCLUSION}; + labels[i] = label; + } + + // Create the labels on the server. + labels = labelService.createLabels(labels); + + if (labels != null) { + foreach (Label label in labels) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("A label with ID '{0}', name '{1}', and type '{2}' was created.", + label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + } + } else { + Console.WriteLine("No labels created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LabelService/DeactivateActiveLabels.cs b/examples/Dfp/CSharp/v201208/LabelService/DeactivateActiveLabels.cs new file mode 100644 index 00000000000..fdbbf75486e --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LabelService/DeactivateActiveLabels.cs @@ -0,0 +1,116 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example deactivates all active labels. To determine which labels + /// exist, run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement, LabelService.performLabelAction + /// + class DeactivateActiveLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active labels. To determine which labels exist," + + " run GetAllLabels.cs. This feature is only available to DFP premium solution " + + "networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateActiveLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201208.LabelService); + + // Create statement text to select active labels. + String statementText = "WHERE isActive = :isActive LIMIT 500"; + Statement filterStatement = new StatementBuilder("").AddValue("isActive", true).ToStatement(); + + // Set defaults for page and offset. + LabelPage page = new LabelPage(); + int offset = 0; + List labelIds = new List(); + + try { + do { + // Create a statement to page through active labels. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get labels by statement. + page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + Console.WriteLine("{0}) Label with ID '{1}', name '{2}' will be deactivated.", + i, label.id, label.name); + labelIds.Add(label.id.ToString()); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of labels to be deactivated: " + labelIds.Count); + + if (labelIds.Count > 0) { + // Modify statement for action. + filterStatement.query = "WHERE id IN (" + string.Join(", ", labelIds.ToArray()) + ")"; + + // Create action. + DeactivateLabels action = new DeactivateLabels(); + + // Perform action. + UpdateResult result = labelService.performLabelAction(action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of labels deactivated: " + result.numChanges); + } else { + Console.WriteLine("No labels were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LabelService/GetAllLabels.cs b/examples/Dfp/CSharp/v201208/LabelService/GetAllLabels.cs new file mode 100644 index 00000000000..bf3e44be455 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LabelService/GetAllLabels.cs @@ -0,0 +1,93 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all labels. To create labels, run CreateLabels.cs. + /// This feature is only available to DFP premium solution networks. + /// + /// Tags: LabelService.getLabelsByStatement + /// + class GetAllLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all labels. To create labels, run CreateLabels.cs. This " + + "feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201208.LabelService); + + // Set defaults for page and filterStatement. + LabelPage page = new LabelPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all labels. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get labels by statement. + page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("{0}) Label with ID '{1}', name '{2}' and type '{3}' was found.", + i, label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LabelService/GetLabel.cs b/examples/Dfp/CSharp/v201208/LabelService/GetLabel.cs new file mode 100644 index 00000000000..fa82273d721 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LabelService/GetLabel.cs @@ -0,0 +1,83 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets a label by its ID. To determine which labels exist, + /// run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabel + /// + class GetLabel : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a label by its ID. To determine which labels exist, " + + "run GetAllLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLabel(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201208.LabelService); + + // Set the ID of the label to get. + long labelId = long.Parse(_T("INSERT_LABEL_ID_HERE")); + + try { + // Get the label. + Label label = labelService.getLabel(labelId); + + if (label != null) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + Console.WriteLine("Label with ID '{0}, name '{1}' and type '{2}' was found.", + label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + } else { + Console.WriteLine("No label found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get label. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LabelService/GetLabelsByStatement.cs b/examples/Dfp/CSharp/v201208/LabelService/GetLabelsByStatement.cs new file mode 100644 index 00000000000..32f7982c62c --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LabelService/GetLabelsByStatement.cs @@ -0,0 +1,92 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all labels that are competitively excluded. The + /// statement retrieves up to the maximum page size limit of 500. To create + /// labels, run CreateLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement + /// + class GetLabelsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all labels that are competitively excluded. The statement " + + "retrieves up to the maximum page size limit of 500. To create labels, run " + + "CreateLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLabelsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201208.LabelService); + + // Create a statement to only select labels that are competitive + // sorted by name. + Statement filterStatement = new StatementBuilder("WHERE type = :type ORDER BY name LIMIT 500") + .AddValue("type", LabelType.COMPETITIVE_EXCLUSION.ToString()).ToStatement(); + + try { + // Get labels by statement. + LabelPage page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("{0}) Label with ID '{1}', name '{2}'and type '{3}' was found.", + i, label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LabelService/UpdateLabels.cs b/examples/Dfp/CSharp/v201208/LabelService/UpdateLabels.cs new file mode 100644 index 00000000000..ac83662fe59 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LabelService/UpdateLabels.cs @@ -0,0 +1,99 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example updates the descriptions of all active labels by + /// updating its description up to the first 500. To determine which labels + /// exist, run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement, LabelService.updateLabels + /// + class UpdateLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the descriptions of all active labels by updating " + + "its description up to the first 500. To determine which labels exist, run " + + "GetAllLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201208.LabelService); + + // Create a statement to only select labels that are competitive + // exclusion. + Statement filterStatement = new StatementBuilder("WHERE isActive = :isActive LIMIT 500"). + AddValue("isActive", true).ToStatement(); + + try { + // Get the labels by statement. + LabelPage page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + Label[] labels = page.results; + + // Update each local label object by updating its description. + foreach (Label label in labels) { + label.description = "These labels are still competiting with each other."; + } + + // Update the labels on the server. + labels = labelService.updateLabels(labels); + + if (labels != null) { + foreach (Label label in labels) { + Console.WriteLine("A label with ID '{0}' and name '{1}' was updated.", + label.id, label.name); + } + } else { + Console.WriteLine("No labels updated."); + } + } else { + Console.WriteLine("No labels found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/ActivateLicas.cs b/examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/ActivateLicas.cs new file mode 100644 index 00000000000..deb484ce1fb --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/ActivateLicas.cs @@ -0,0 +1,125 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example activates all deactivated LICAs for the line item. To + /// determine which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.performLineItemCreativeAssociationAction + /// + class ActivateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example activates all deactivated LICAs for the line item. To " + + "determine which LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ActivateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201208.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + String statementText = "WHERE lineItemId = :lineItemId and status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("lineItemId", lineItemId). + AddValue("status", LineItemCreativeAssociationStatus.INACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + int offset = 0; + List creativeIds = new List(); + + try { + do { + // Create a Statement to page through active LICAs. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' will be activated.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + creativeIds.Add(lica.creativeId.ToString()); + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of LICAs to be activated: {0}", creativeIds.Count); + + if (creativeIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE lineItemId = :lineItemId and creativeId IN ({0})", + string.Join(",", creativeIds.ToArray()))). + AddValue("lineItemId", lineItemId).ToStatement(); + + // Create action. + ActivateLineItemCreativeAssociations action = + new ActivateLineItemCreativeAssociations(); + + // Perform action. + UpdateResult result = + licaService.performLineItemCreativeAssociationAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of LICAs activated: {0}", result.numChanges); + } else { + Console.WriteLine("No LICAs were activated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to activate LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/CreateLicas.cs b/examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/CreateLicas.cs new file mode 100644 index 00000000000..1adc738d846 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/CreateLicas.cs @@ -0,0 +1,108 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example creates new line item creative associations (LICAs) for + /// an existing line item and a set of creative ids. For small business + /// networks, the creative ids must represent new or copied creatives as + /// creatives cannot be used for more than one line item. For premium + /// solution networks, the creative ids can represent any creative. To copy + /// creatives, run CopyImageCreatives.cs. To determine which LICAs exist, run + /// GetAllLicasExample.cs. + /// + /// Tags: LineItemCreativeAssociationService.createLineItemCreativeAssociations + /// + class CreateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new line item creative associations (LICAs) for an " + + "existing line item and a set of creative ids. For small business networks, the " + + "creative ids must represent new or copied creatives as creatives cannot be used " + + "for more than one line item. For premium solution networks, the creative ids can " + + "represent any creative. To copy creatives, run CopyImageCreatives.cs. To determine " + + "which LICAs exist, run GetAllLicasExample.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = + (LineItemCreativeAssociationService) user.GetService( + DfpService.v201208.LineItemCreativeAssociationService); + + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201208.CreativeService); + + // Set the line item ID and creative IDs to associate. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long[] creativeIds = new long[] {long.Parse(_T("INSERT_CREATIVE_ID_HERE"))}; + + // Create an array to store local LICA objects. + LineItemCreativeAssociation[] licas = new LineItemCreativeAssociation[creativeIds.Length]; + + // For each line item, associate it with the given creative. + int i = 0; + foreach (long creativeId in creativeIds) { + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId; + lica.lineItemId = lineItemId; + licas[i++] = lica; + } + + try { + // Create the LICAs on the server. + licas = licaService.createLineItemCreativeAssociations(licas); + + if (licas != null) { + foreach (LineItemCreativeAssociation lica in licas) { + Console.WriteLine("A LICA with line item ID \"{0}\", creative ID \"{1}\", and status " + + "\"{2}\" was created.", lica.lineItemId, lica.creativeId, lica.status); + } + } else { + Console.WriteLine("No LICAs created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to associate creative with line item. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/DeactivateLicas.cs b/examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/DeactivateLicas.cs new file mode 100644 index 00000000000..8fe191e065f --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/DeactivateLicas.cs @@ -0,0 +1,125 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example deactivates all LICAs for the line item. To determine + /// which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.performLineItemCreativeAssociationAction + /// + class DeactivateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all LICAs for the line item. To determine which " + + "LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201208.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + String statementText = "WHERE lineItemId = :lineItemId and status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("lineItemId", lineItemId). + AddValue("status", LineItemCreativeAssociationStatus.ACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + int offset = 0; + List creativeIds = new List(); + + try { + do { + // Create a Statement to page through active LICAs. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' will be deactivated.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + creativeIds.Add(lica.creativeId.ToString()); + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of LICAs to be deactivated: {0}", creativeIds.Count); + + if (creativeIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE lineItemId = :lineItemId and creativeId IN ({0})", + string.Join(",", creativeIds.ToArray()))). + AddValue("lineItemId", lineItemId).ToStatement(); + + // Create action. + DeactivateLineItemCreativeAssociations action = + new DeactivateLineItemCreativeAssociations(); + + // Perform action. + UpdateResult result = + licaService.performLineItemCreativeAssociationAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of LICAs deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No LICAs were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/GetAllLicas.cs b/examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/GetAllLicas.cs new file mode 100644 index 00000000000..0b185e3eb8d --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/GetAllLicas.cs @@ -0,0 +1,91 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all line item creative associations (LICA). To + /// create LICAs, run CreateLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// + class GetAllLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line item creative associations (LICA). To create " + + "LICAs, run CreateLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201208.LineItemCreativeAssociationService); + + // Sets defaults for page and Statement. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all LICAs. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' was found.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + } + } + + offset += 500; + } while (page.results != null && page.results.Length == 500); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/GetLica.cs b/examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/GetLica.cs new file mode 100644 index 00000000000..1b50706d7cf --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/GetLica.cs @@ -0,0 +1,81 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets a line item creative association (LICA) by the line + /// item and creative ID. To determine which line items exist, run + /// GetAllLineItems.cs. To determine which creatives exit, run + /// GetAllCreatives.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociation + /// + class GetLica : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a line item creative association (LICA) by the line " + + "item and creative ID. To determine which line items exist, run " + + "GetAllLineItems.cs. To determine which creatives exit, run " + + "GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + new GetLica().Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201208.LineItemCreativeAssociationService); + + // Set the line item and creative ID to use to retrieve the LICA. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long creativeId = long.Parse(_T("INSERT_CREATIVE_ID_HERE")); + + try { + // Get the LICA. + LineItemCreativeAssociation lica = + licaService.getLineItemCreativeAssociation(lineItemId, creativeId); + + if (lica != null) { + Console.WriteLine("LICA with line item ID = {0}, creative ID = '{1}' and status = " + + "'{2}' was found", lica.lineItemId, lica.creativeId, lica.status); + } else { + Console.WriteLine("No LICA found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get LICA. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/GetLicasByStatement.cs b/examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/GetLicasByStatement.cs new file mode 100644 index 00000000000..b5c773e5756 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/GetLicasByStatement.cs @@ -0,0 +1,89 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all line item creative associations for a given + /// line item ID. The Statement retrieves up to the maximum page size limit of + /// 500. To create LICAs, run CreateLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// + class GetLicasByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line item creative associations for a given line " + + "item ID. The Statement retrieves up to the maximum page size limit of 500. To " + + "create LICAs, run CreateLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLicasByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201208.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + // Create a Statement to only select LICAs for the given lineItem ID. + Statement statement = new StatementBuilder("WHERE lineItemId = :lineItemId LIMIT 500"). + AddValue("lineItemId", lineItemId).ToStatement(); + + try { + // Get LICAs by Statement. + LineItemCreativeAssociationPage page = + licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' was found.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/UpdateLicas.cs b/examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/UpdateLicas.cs new file mode 100644 index 00000000000..aed900281a2 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LineItemCreativeAssociationService/UpdateLicas.cs @@ -0,0 +1,97 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example updates the destination URL of all LICAs up to the first + /// 500. To determine which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.updateLineItemCreativeAssociations + /// + class UpdateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the destination URL of all LICAs up to the first " + + "500. To determine which LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201208.LineItemCreativeAssociationService); + + // Create a Statement to get all LICAs. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get LICAs by Statement. + LineItemCreativeAssociationPage page = + licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + LineItemCreativeAssociation[] licas = page.results; + + // Update each local LICA object by changing its destination URL. + foreach (LineItemCreativeAssociation lica in licas) { + lica.destinationUrl = "http://news.google.com"; + } + + // Update the LICAs on the server. + licas = licaService.updateLineItemCreativeAssociations(licas); + + if (licas != null) { + foreach (LineItemCreativeAssociation lica in licas) { + Console.WriteLine("LICA with line item ID = '{0}, creative ID ='{1}' and " + + "destination URL '{2}' was updated.", lica.lineItemId, lica.creativeId, + lica.destinationUrl); + } + } else { + Console.WriteLine("No LICAs updated."); + } + } else { + Console.WriteLine("No LICAs found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LineItemService/ActivateLineItem.cs b/examples/Dfp/CSharp/v201208/LineItemService/ActivateLineItem.cs new file mode 100644 index 00000000000..a6484bb9ccb --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LineItemService/ActivateLineItem.cs @@ -0,0 +1,134 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example activates all line items for the given order. To be + /// activated, line items need to be in the approved (needs creatives) state + /// and have at least one creative associated with them. To approve line + /// items, approve the order to which they belong by running ApproveOrders.cs. + /// To create LICAs, run CreateLicas.cs. To determine which line items exist, + /// run GetAllLineItem.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.performLineItemAction + /// + class ActivateLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example activates all line items for the given order. To be activated," + + " line items need to be in the approved (needs creatives) state and have at least one" + + " creative associated with them. To approve line items, approve the order to which" + + " they belong by running ApproveOrders.cs. To create LICAs, run CreateLicas.cs." + + " To determine which line items exist, run GetAllLineItem.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ActivateLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201208.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create Statement text to select approved line items from a given order. + string statementText = "WHERE orderId = :orderId and status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("orderId", orderId). + AddValue("status", ComputedStatus.NEEDS_CREATIVES.ToString()).ToStatement(); + + // Set defaults for page and offset. + LineItemPage page = new LineItemPage(); + int offset = 0; + int i = 0; + List lineItemIds = new List(); + + try { + do { + // Create a Statement to page through approved line items. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get line items by Statement. + page = lineItemService.getLineItemsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + foreach (LineItemSummary lineItem in page.results) { + // Archived line items cannot be activated. + if (!lineItem.isArchived) { + Console.WriteLine("{0}) Line item with ID ='{1}', belonging to order ID ='{2}' " + + "and name ='{2}' will be activated.", i, lineItem.id, lineItem.orderId, + lineItem.name); + lineItemIds.Add(lineItem.id.ToString()); + i++; + } + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of line items to be activated: {0}", lineItemIds.Count); + + if (lineItemIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", lineItemIds.ToArray()))). + ToStatement(); + + // Create action. + ActivateLineItems action = new ActivateLineItems(); + + // Perform action. + UpdateResult result = lineItemService.performLineItemAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of line items activated: {0}", result.numChanges); + } else { + Console.WriteLine("No line items were activated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to activate line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LineItemService/CreateLineItems.cs b/examples/Dfp/CSharp/v201208/LineItemService/CreateLineItems.cs new file mode 100644 index 00000000000..6fddb717435 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LineItemService/CreateLineItems.cs @@ -0,0 +1,217 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example creates new line items. To determine which line items + /// exist, run GetAllLineItems.cs. To determine which orders exist, run + /// GetAllOrders.cs. To determine which placements exist, run + /// GetAllPlacements.cs. To determine the IDs for locations, run + /// GetAllCities.cs, GetAllCountries.cs, GetAllMetros.cs, GetAllRegions.cs and + /// GetAllPostalCodes. + /// + /// Tags: LineItemService.createLineItems + /// + class CreateLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new line items. To determine which line items " + + "exist, run GetAllLineItems.cs. To determine which orders exist, run GetAllOrders.cs" + + ". To determine which placements exist, run GetAllPlacements.cs. To determine the " + + "IDs for locations, run GetAllCities.cs, GetAllCountries.cs, GetAllMetros.cs, " + + "GetAllRegions.cs and GetAllPostalCodes."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code examples. + /// + /// The DFP user object running the code examples. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201208.LineItemService); + + // Set the order that all created line items will belong to and the + // placement ID to target. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + long[] targetPlacementIds = new long[] {long.Parse(_T("INSERT_PLACEMENT_ID_HERE"))}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = targetPlacementIds; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + PostalCodeLocation postalCodeLocation = new PostalCodeLocation(); + postalCodeLocation.id = 9000093; + postalCodeLocation.postalCode = "B3P"; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201208.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201208.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + // Create an array to store local line item objects. + LineItem[] lineItems = new LineItem[5]; + + for (int i = 0; i < 5; i++) { + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + i; + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + lineItems[i] = lineItem; + } + + try { + // Create the line items on the server. + lineItems = lineItemService.createLineItems(lineItems); + + if (lineItems != null) { + foreach (LineItem lineItem in lineItems) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and" + + " named \"{2}\" was created.", lineItem.id, lineItem.orderId, lineItem.name); + } + } else { + Console.WriteLine("No line items created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LineItemService/CreateMobileLineItem.cs b/examples/Dfp/CSharp/v201208/LineItemService/CreateMobileLineItem.cs new file mode 100644 index 00000000000..d39fc493ecd --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LineItemService/CreateMobileLineItem.cs @@ -0,0 +1,172 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example creates a new line item to serve to the mobile platform. + /// Mobile features needs to be enabled in your account to use mobile + /// targeting. To determine which line items exist, run GetAllLineItems.cs. To + /// determine which orders exist, run GetAllOrders.cs. To determine + /// which placements exist, run GetAllPlacements.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.performLineItemAction + /// + class CreateMobileLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new line item to serve to the mobile platform. Mobile" + + " features needs to be enabled in your account to use mobile targeting. To determine " + + "which line items exist, run GetAllLineItems.cs. To determine which orders exist, " + + "run GetAllOrders.cs. To determine which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateMobileLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201208.LineItemService); + + // Set the order that all created line items will belong to and the + // placement containing ad units with a mobile target platform. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + long[] targetedPlacementIds = new long[] {long.Parse(_T("INSERT_MOBILE_PLACEMENT_ID_HERE"))}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = targetedPlacementIds; + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create device manufacturer targeting. + DeviceManufacturerTargeting deviceManufacturerTargeting = new DeviceManufacturerTargeting(); + deviceManufacturerTargeting.isTargeted = true; + + // Target the Google device manufacturer (40100). + Technology deviceManufacturerTechnology = new Technology(); + deviceManufacturerTechnology.id = 40100L; + deviceManufacturerTargeting.deviceManufacturers = + new Technology[] {deviceManufacturerTechnology}; + technologyTargeting.deviceManufacturerTargeting = deviceManufacturerTargeting; + + // Create mobile device targeting. + MobileDeviceTargeting mobileDeviceTargeting = new MobileDeviceTargeting(); + + // Exclude the Nexus One device (604046). + Technology mobileDeviceTechnology = new Technology(); + mobileDeviceTechnology.id = 604046L; + mobileDeviceTargeting.targetedMobileDevices = new Technology[] {mobileDeviceTechnology}; + technologyTargeting.mobileDeviceTargeting = mobileDeviceTargeting; + + // Create mobile device submodel targeting. + MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargeting = + new MobileDeviceSubmodelTargeting(); + + // Target the iPhone 4 device submodel (640003). + Technology mobileDeviceSubmodelTechnology = new Technology(); + mobileDeviceSubmodelTechnology.id = 640003L; + mobileDeviceSubmodelTargeting.targetedMobileDeviceSubmodels = + new Technology[] {mobileDeviceSubmodelTechnology}; + technologyTargeting.mobileDeviceSubmodelTargeting = mobileDeviceSubmodelTargeting; + + // Create targeting. + Targeting targeting = new Targeting(); + targeting.inventoryTargeting = inventoryTargeting; + targeting.technologyTargeting = technologyTargeting; + + // Create local line item object. + LineItem lineItem = new LineItem(); + lineItem.name = "Mobile line item"; + lineItem.orderId = orderId; + lineItem.targeting = targeting; + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the target platform to mobile. + lineItem.targetPlatform = TargetPlatform.MOBILE; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + creativePlaceholder.size = size; + + // Set the size of creatives that can be associated with this line item. + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromString("20120901 00:00:00"); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + Money money = new Money(); + money.currencyCode = "USD"; + money.microAmount = 2000000L; + lineItem.costPerUnit = money; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + try { + // Create the line item on the server. + lineItem = lineItemService.createLineItem(lineItem); + + if (lineItem != null) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and " + + "named \"{2}\" was created.", lineItem.id, lineItem.orderId, lineItem.name); + } else { + Console.WriteLine("No line item created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LineItemService/CreateVideoLineItem.cs b/examples/Dfp/CSharp/v201208/LineItemService/CreateVideoLineItem.cs new file mode 100644 index 00000000000..598e396dc50 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LineItemService/CreateVideoLineItem.cs @@ -0,0 +1,184 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example creates a new line item to serve to video content. To + /// determine which line items exist, run GetAllLineItems.cs. To determine + /// which orders exist, run GetAllOrders.cs. To create a video ad unit, run + /// CreateVideoAdUnit.cs. To create criteria for categories, run + /// CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: LineItemService.createLineItem + /// + class CreateVideoLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new line item to serve to video content. To determine" + + " which line items exist, run GetAllLineItems.cs. To determine which orders exist, " + + "run GetAllOrders.cs. To create a video ad unit, run CreateVideoAdUnit.cs. To " + + "create criteria for categories, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateVideoLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201208.LineItemService); + + // Set the order that all created line items will belong to and the + // video ad unit ID to target. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + string targetedVideoAdUnitId = _T("INSERT_TARGETED_VIDEO_AD_UNIT_ID_HERE"); + + // Set the custom targeting key ID and value ID representing the metadata + // on the content to target. This would typically be a key representing + // a "genre" and a value representing something like "comedy". + long contentCustomTargetingKeyId = + long.Parse(_T("INSERT_CONTENT_CUSTOM_TARGETING_KEY_ID_HERE")); + long contentCustomTargetingValueId = + long.Parse(_T("INSERT_CONTENT_CUSTOM_TARGETING_VALUE_ID_HERE")); + + // Create custom criteria for the content metadata targeting. + CustomCriteria contentCustomCriteria = new CustomCriteria(); + contentCustomCriteria.keyId = contentCustomTargetingKeyId; + contentCustomCriteria.valueIds = new long[] {contentCustomTargetingValueId}; + contentCustomCriteria.@operator = CustomCriteriaComparisonOperator.IS; + + // Create custom criteria set. + CustomCriteriaSet customCriteriaSet = new CustomCriteriaSet(); + customCriteriaSet.children = new CustomCriteriaNode[] {contentCustomCriteria}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + AdUnitTargeting adUnitTargeting = new AdUnitTargeting(); + adUnitTargeting.adUnitId = targetedVideoAdUnitId; + adUnitTargeting.includeDescendants = true; + inventoryTargeting.targetedAdUnits = new AdUnitTargeting[] {adUnitTargeting}; + + // Create video position targeting. + VideoPositionTargeting videoPositionTargeting = new VideoPositionTargeting(); + videoPositionTargeting.targetedVideoPositions = + new VideoPositionTargetingType[] {VideoPositionTargetingType.PREROLL}; + + // Create targeting. + Targeting targeting = new Targeting(); + targeting.customTargeting = customCriteriaSet; + targeting.inventoryTargeting = inventoryTargeting; + targeting.videoPositionTargeting = videoPositionTargeting; + + // Create local line item object. + LineItem lineItem = new LineItem(); + lineItem.name = "Video line item"; + lineItem.orderId = orderId; + lineItem.targeting = targeting; + lineItem.lineItemType = LineItemType.SPONSORSHIP; + lineItem.allowOverbook = true; + + // Set the environment type to video. + lineItem.environmentType = EnvironmentType.VIDEO_PLAYER; + + // Set the creative rotation type to optimized. + lineItem.creativeRotationType = CreativeRotationType.OPTIMIZED; + + // Create the master creative placeholder. + CreativePlaceholder creativeMasterPlaceholder = new CreativePlaceholder(); + Size size1 = new Size(); + size1.width = 400; + size1.height = 300; + size1.isAspectRatio = false; + creativeMasterPlaceholder.size = size1; + + // Create companion creative placeholders. + CreativePlaceholder companionCreativePlaceholder1 = new CreativePlaceholder(); + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + size2.isAspectRatio = false; + companionCreativePlaceholder1.size = size2; + + CreativePlaceholder companionCreativePlaceholder2 = new CreativePlaceholder(); + Size size3 = new Size(); + size3.width = 728; + size3.height = 90; + size3.isAspectRatio = false; + companionCreativePlaceholder2.size = size3; + + // Set companion creative placeholders. + creativeMasterPlaceholder.companions = new CreativePlaceholder[] { + companionCreativePlaceholder1, companionCreativePlaceholder2}; + + // Set the size of creatives that can be associated with this line item. + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativeMasterPlaceholder}; + + // Set delivery of video companions to optional. + lineItem.companionDeliveryOption = CompanionDeliveryOption.OPTIONAL; + + // Set the length of the line item to run. + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromString("20120901 00:00:00"); + + // Set the cost per day to $1. + lineItem.costType = CostType.CPD; + Money money = new Money(); + money.currencyCode = "USD"; + money.microAmount = 1000000L; + lineItem.costPerUnit = money; + + // Set the percentage to be 100%. + lineItem.unitsBought = 100; + + try { + // Create the line item on the server. + lineItem = lineItemService.createLineItem(lineItem); + + if (lineItem != null) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and " + + "named \"{2}\" was created.", lineItem.id, lineItem.orderId, lineItem.name); + } else { + Console.WriteLine("No line item created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LineItemService/GetAllLineItems.cs b/examples/Dfp/CSharp/v201208/LineItemService/GetAllLineItems.cs new file mode 100644 index 00000000000..b7a6238091c --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LineItemService/GetAllLineItems.cs @@ -0,0 +1,91 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all line items. To create line items, run + /// CreateLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// + class GetAllLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items. To create line items, run " + + "CreateLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201208.LineItemService); + + // Sets defaults for page and Statement. + LineItemPage page = new LineItemPage(); + Statement statement = new Statement(); + int offset = 0; + try { + do { + // Create a Statement to get all line items. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get line items by Statement. + page = lineItemService.getLineItemsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemSummary lineItem in page.results) { + Console.WriteLine("{0}) Line item with ID = '{1}', belonging to order ID ='{2}'" + + " , and named '{3}' was found.", i, lineItem.id, lineItem.orderId, + lineItem.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LineItemService/GetLineItem.cs b/examples/Dfp/CSharp/v201208/LineItemService/GetLineItem.cs new file mode 100644 index 00000000000..70f63e3e0c3 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LineItemService/GetLineItem.cs @@ -0,0 +1,78 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets a line item by its ID. To determine which line + /// items exist, run GetAllLineItems.cs. + /// + /// Tags: LineItemService.getLineItem + /// + class GetLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a line item by its ID. To determine which line items " + + "exist, run GetAllLineItems.cs"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201208.LineItemService); + + // Set the ID of the line item to get. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get the line item. + LineItem lineItem = lineItemService.getLineItem(lineItemId); + + if (lineItem != null) { + Console.WriteLine("Line item with ID ='{0}', belonging to order ID ='{1}', and named " + + "'{2}' was found.", lineItem.id, lineItem.orderId, lineItem.name); + } else { + Console.WriteLine("No line item found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get line item by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LineItemService/GetLineItemsByStatement.cs b/examples/Dfp/CSharp/v201208/LineItemService/GetLineItemsByStatement.cs new file mode 100644 index 00000000000..5d114005b01 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LineItemService/GetLineItemsByStatement.cs @@ -0,0 +1,92 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all line items for the given order. The Statement + /// retrieves up to the maximum page size limit of 500. To create line items, + /// run CreateLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// + class GetLineItemsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items for the given order. The Statement " + + "retrieves up to the maximum page size limit of 500. To create line items, " + + "run CreateLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLineItemsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201208.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create a statement to only select line items that need creatives from a + // given order. + Statement filterStatement = + new StatementBuilder("WHERE orderId = :orderId AND status = :status LIMIT 500") + .AddValue("orderId", orderId) + .AddValue("status", ComputedStatus.NEEDS_CREATIVES.ToString()) + .ToStatement(); + + try { + // Get line items by Statement. + LineItemPage page = lineItemService.getLineItemsByStatement(filterStatement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItem lineItem in page.results) { + Console.WriteLine("{0}) Line item with ID ='{1}', belonging to order ID = '{2}' and " + + "named '{3}' was found.", i, lineItem.id, lineItem.orderId, lineItem.name); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get line item by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LineItemService/GetRecentlyUpdatedLineItems.cs b/examples/Dfp/CSharp/v201208/LineItemService/GetRecentlyUpdatedLineItems.cs new file mode 100644 index 00000000000..cb1a1e50a5e --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LineItemService/GetRecentlyUpdatedLineItems.cs @@ -0,0 +1,92 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; +using Google.Api.Ads.Dfp.Util.v201208; + +using System; + +using DateTime = Google.Api.Ads.Dfp.v201208.DateTime; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example shows how to get recently updated line items. To create + /// line items, run CreateLineItems.cs. + /// + /// Tags: LineItemService.GetRecentlyUpdatedLineItems + /// + class GetRecentlyUpdatedLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a line item by its ID. To determine which line items " + + "exist, run GetAllLineItems.cs"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetRecentlyUpdatedLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201208.LineItemService); + + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + try { + // Create statement to only select line items for the given order that + // have been modified in the last 3 days. + DateTime threeDaysAgo = DateTimeUtilities.FromDateTime(System.DateTime.Now.AddDays(-3)); + Statement filterStatement = new StatementBuilder( + "WHERE lastModifiedDateTime >= :lastModifiedDateTime AND orderId = :orderId LIMIT 500"). + AddValue("lastModifiedDateTime", threeDaysAgo). + AddValue("orderId", orderId).ToStatement(); + + + // Get line items by statement. + LineItemPage page = lineItemService.getLineItemsByStatement(filterStatement); + + // Display results. + if (page != null && page.results != null) { + foreach (LineItem lineItem in page.results) { + Console.WriteLine("Line item with id \"{0}\", belonging to order id \"{1}\" and " + + "named \"{2}\" was found.", lineItem.id, lineItem.orderId, lineItem.name); + } + Console.WriteLine("Number of results found: {1}.", page.totalResultSetSize); + } else { + Console.WriteLine("No line items were found."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LineItemService/TargetCustomCriteria.cs b/examples/Dfp/CSharp/v201208/LineItemService/TargetCustomCriteria.cs new file mode 100644 index 00000000000..c78c9559e28 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LineItemService/TargetCustomCriteria.cs @@ -0,0 +1,167 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example updates a line item to add custom criteria targeting. To + /// determine which line items exist, run GetAllLineItems.cs. To determine + /// which custom targeting keys and values exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: LineItemService.getLineItem, LineItemService.updateLineItem + /// + class TargetCustomCriteria : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a line item to add custom criteria targeting. To " + + "determine which line items exist, run GetAllLineItems.cs. To determine which custom " + + "targeting keys and values exist, run GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new TargetCustomCriteria(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201208.LineItemService); + + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = (CustomTargetingService) user.GetService( + DfpService.v201208.CustomTargetingService); + + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long[] customCriteriaIds1 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + long[] customCriteriaIds2 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + long[] customCriteriaIds3 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + + // Create custom criteria. + CustomCriteria customCriteria1 = new CustomCriteria(); + customCriteria1.keyId = customCriteriaIds1[0]; + customCriteria1.valueIds = new long[] {customCriteriaIds1[1]}; + customCriteria1.@operator = CustomCriteriaComparisonOperator.IS; + + CustomCriteria customCriteria2 = new CustomCriteria(); + customCriteria2.keyId = customCriteriaIds2[0]; + customCriteria2.valueIds = new long[] {customCriteriaIds2[1]}; + customCriteria2.@operator = CustomCriteriaComparisonOperator.IS_NOT; + + CustomCriteria customCriteria3 = new CustomCriteria(); + customCriteria3.keyId = customCriteriaIds3[0]; + customCriteria3.valueIds = new long[] {customCriteriaIds3[1]}; + customCriteria3.@operator = CustomCriteriaComparisonOperator.IS; + + // Create the custom criteria set that will resemble: + // + // (customCriteria1.key == customCriteria1.value OR + // (customCriteria2.key != customCriteria2.value AND + // customCriteria3.key == customCriteria3.value)) + CustomCriteriaSet topCustomCriteriaSet = new CustomCriteriaSet(); + topCustomCriteriaSet.logicalOperator = CustomCriteriaSetLogicalOperator.OR; + + CustomCriteriaSet subCustomCriteriaSet = new CustomCriteriaSet(); + subCustomCriteriaSet.logicalOperator = CustomCriteriaSetLogicalOperator.AND; + subCustomCriteriaSet.children = + new CustomCriteriaNode[] {customCriteria2, customCriteria3}; + topCustomCriteriaSet.children = + new CustomCriteriaNode[] {customCriteria1, subCustomCriteriaSet}; + + try { + // Set the custom criteria targeting on the line item. + LineItem lineItem = lineItemService.getLineItem(lineItemId); + lineItem.targeting.customTargeting = topCustomCriteriaSet; + + // Update the line items on the server. + lineItem = lineItemService.updateLineItem(lineItem); + + // Display the updated line item. + Console.WriteLine("Line item with ID {0} updated with custom criteria targeting \n{1}\n", + lineItem.id, getCustomCriteriaSetString(lineItem.targeting.customTargeting, 0)); + } catch (Exception ex) { + Console.WriteLine("Failed to add custom target criteria. Exception says \"{0}\"", + ex.Message); + } + } + + /// + /// Gets a string representation of the custom criteria node. If it has + /// children, each child will be appended to the string recursively. + /// + /// The root custom criteria node. + /// The level of the custom criteria tree. + /// + /// A string representation of the custom criteria node and its + /// children + /// + private static string getCustomCriteriaSetString(CustomCriteriaNode root, int level) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < level; i++) { + sb.Append("\t"); + } + + if (root is CustomCriteria) { + CustomCriteria customCriteria = (CustomCriteria) root; + StringBuilder ids = new StringBuilder(); + for (int j = 0; j < customCriteria.valueIds.Length; j++) { + ids.Append(customCriteria.valueIds[j] + ", "); + } + + sb.AppendFormat("Custom criteria: operator: [{0}] key: [{1}] values: [{2}]\n", + customCriteria.@operator, customCriteria.keyId, ids.ToString().TrimEnd(',', ' ')); + return sb.ToString(); + } else if (root is CustomCriteriaSet) { + CustomCriteriaSet customCriteriaSet = (CustomCriteriaSet) root; + sb.AppendFormat("Custom criteria set: operator: [{0}] children: \n", + customCriteriaSet.logicalOperator); + foreach (CustomCriteriaNode node in customCriteriaSet.children) { + sb.Append(getCustomCriteriaSetString(node, level + 1)); + } + return sb.Append("\n").ToString(); + } else { + throw new Exception("Unexpected node: " + root.CustomCriteriaNodeType); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/LineItemService/UpdateLineItems.cs b/examples/Dfp/CSharp/v201208/LineItemService/UpdateLineItems.cs new file mode 100644 index 00000000000..5d9bb78a068 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/LineItemService/UpdateLineItems.cs @@ -0,0 +1,108 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example updates the delivery rate of all line items up to the + /// first 500. To determine which line items exist, run GetAllLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.updateLineItems + /// + class UpdateLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the delivery rate of all line items up to the first " + + "500. To determine which line items exist, run GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201208.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create a Statement to get line items with even delivery rates. + Statement statement = new StatementBuilder("WHERE deliveryRateType = :deliveryRateType and " + + "orderId = :orderId LIMIT 500").AddValue("deliveryRateType", + DeliveryRateType.EVENLY.ToString()).AddValue("orderId", orderId).ToStatement(); + + try { + // Get line items by Statement. + LineItemPage page = lineItemService.getLineItemsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + LineItem[] lineItems = page.results; + List lineItemsToUpdate = new List(); + + // Update each local line item object by changing its delivery rate. + foreach (LineItem lineItem in lineItems) { + // Archived line items cannot be updated. + if (!lineItem.isArchived) { + lineItem.deliveryRateType = DeliveryRateType.AS_FAST_AS_POSSIBLE; + lineItemsToUpdate.Add(lineItem); + } + } + + // Update the line items on the server. + lineItems = lineItemService.updateLineItems(lineItemsToUpdate.ToArray()); + + if (lineItems != null) { + foreach (LineItem lineItem in lineItems) { + Console.WriteLine("A line item with ID = '{0}', belonging to order ID = '{1}', " + + "named '{2}', and having delivery rate = '{3}' was updated.", + lineItem.id, lineItem.orderId, lineItem.name, lineItem.deliveryRateType); + } + } else { + Console.WriteLine("No line items updated."); + } + } else { + Console.WriteLine("No line items found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/NetworkService/GetAllNetworks.cs b/examples/Dfp/CSharp/v201208/NetworkService/GetAllNetworks.cs new file mode 100644 index 00000000000..fba3f41d443 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/NetworkService/GetAllNetworks.cs @@ -0,0 +1,81 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all networks that you have access to with the + /// current login credentials. A networkCode should be left out for this + /// request. + /// + /// Tags: NetworkService.getAllNetworks + /// + class GetAllNetworks : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all networks that you have access to with the current " + + "login credentials. A networkCode should be left out for this request."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllNetworks(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201208.NetworkService); + // Set the networkCode field to null to retrieve all networks you have + // access to. + networkService.RequestHeader.networkCode = null; + + try { + // Get all networks that you have access to with the current login + // credentials. + Network[] networks = networkService.getAllNetworks(); + + int i = 0; + foreach (Network network in networks) { + Console.WriteLine("{0} ) Network with network code \"{1}\" and display name \"{2}\" " + + "was found.", i + 1, network.networkCode, network.displayName); + i++; + } + Console.WriteLine("Number of networks found: {0}", i); + } catch (Exception ex) { + Console.WriteLine("Failed to get all networks. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/NetworkService/GetCurrentNetwork.cs b/examples/Dfp/CSharp/v201208/NetworkService/GetCurrentNetwork.cs new file mode 100644 index 00000000000..43ef518a3e8 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/NetworkService/GetCurrentNetwork.cs @@ -0,0 +1,70 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets the current network that you can make requests + /// against. + /// + /// Tags: NetworkService.getCurrentNetwork + /// + class GetCurrentNetwork : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the current network that you can make requests against."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCurrentNetwork(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201208.NetworkService); + + try { + // Get the current network. + Network network = networkService.getCurrentNetwork(); + + Console.WriteLine("Current network has network code \"{0}\" and display name \"{1}\".", + network.networkCode, network.displayName); + } catch (Exception ex) { + Console.WriteLine("Failed to get current network. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/NetworkService/MakeTestNetwork.cs b/examples/Dfp/CSharp/v201208/NetworkService/MakeTestNetwork.cs new file mode 100644 index 00000000000..b3d21e5eb4d --- /dev/null +++ b/examples/Dfp/CSharp/v201208/NetworkService/MakeTestNetwork.cs @@ -0,0 +1,85 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example creates a test network. You do not need to have a DFP + /// account to run this example, but you do need to have a new Google account + /// (created at http://www.google.com/accounts/newaccount) that is not + /// associated with any other DFP networks (including old sandbox networks). + /// Once this network is created, you can supply the network code in your + /// settings to make calls to other services. + /// + /// Please see the following URL for more information: + /// https://developers.google.com/doubleclick-publishers/docs/signup + /// + /// Tags: NetworkService.makeTestNetwork + /// + class MakeTestNetwork : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a test network. You do not need to have a DFP" + + " account to run this example, but you do need to have a new Google account" + + " (created at http://www.google.com/accounts/newaccount) that is not associated " + + "with any other DFP networks (including old sandbox networks). Once this network " + + "is created, you can supply the network code in your settings to make calls to " + + "other services.\n\n Please see the following URL for more information:" + + " https://developers.google.com/doubleclick-publishers/docs/signup"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new MakeTestNetwork(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201208.NetworkService); + // Set the networkCode field to null. + networkService.RequestHeader.networkCode = null; + + try { + Network network = networkService.makeTestNetwork(); + + Console.WriteLine("Test network with network code \"{0}\" and display name \"{1}\" " + + "created.\nYou may now sign in at http://www.google.com/dfp/main?networkCode={0}", + network.networkCode, network.displayName); + } catch (Exception ex) { + Console.WriteLine("Failed to make test network. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/OrderService/ApproveOrder.cs b/examples/Dfp/CSharp/v201208/OrderService/ApproveOrder.cs new file mode 100644 index 00000000000..e0bf3f34a60 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/OrderService/ApproveOrder.cs @@ -0,0 +1,121 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example approves and overbooks all eligible draft and pending + /// orders. To determine which orders exist, run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement, OrderService.performOrderAction + /// + class ApproveOrder : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example approves and overbooks all draft orders. To determine which " + + "orders exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ApproveOrder(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = + (OrderService) user.GetService(DfpService.v201208.OrderService); + + // Create Statement text to select all draft orders. + string statementText = "WHERE status IN (:status1, :status2) and endDateTime >= :today " + + "AND isArchived = FALSE LIMIT 500"; + Statement statement = new StatementBuilder(""). + AddValue("status1", OrderStatus.DRAFT.ToString()). + AddValue("status2", OrderStatus.PENDING_APPROVAL.ToString()). + AddValue("today", System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss")).ToStatement(); + + // Set defaults for page and offset. + OrderPage page = new OrderPage(); + int i = 0; + int offset = 0; + List orderIds = new List(); + + try { + do { + // Create a Statement to page through draft orders. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + // Get orders by Statement. + page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and status ='{3}' " + + "will be approved.", i, order.id, order.name, order.status); + orderIds.Add(order.id.ToString()); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of orders to be approved: {0}", orderIds.Count); + + if (orderIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", orderIds.ToArray()))). + ToStatement(); + + // Create action. + ApproveAndOverbookOrders action = new ApproveAndOverbookOrders(); + + // Perform action. + UpdateResult result = orderService.performOrderAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of orders approved: {0}", result.numChanges); + } else { + Console.WriteLine("No orders were approved."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to approve orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/OrderService/CreateOrders.cs b/examples/Dfp/CSharp/v201208/OrderService/CreateOrders.cs new file mode 100644 index 00000000000..e1d88de3c5b --- /dev/null +++ b/examples/Dfp/CSharp/v201208/OrderService/CreateOrders.cs @@ -0,0 +1,96 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example creates new orders. To determine which orders exist, + /// run GetAllOrders.cs. + /// + /// Tags: OrderService.createOrders + /// + class CreateOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new orders. To determine which orders exist, " + + "run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = + (OrderService) user.GetService(DfpService.v201208.OrderService); + + // Set the advertiser, salesperson, and trafficker to assign to each + // order. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + long salespersonId = long.Parse(_T("INSERT_SALESPERSON_ID_HERE")); + long traffickerId = long.Parse(_T("INSERT_TRAFFICKER_ID_HERE")); + + // Create an array to store local order objects. + Order[] orders = new Order[5]; + + for (int i = 0; i < 5; i++) { + Order order = new Order(); + order.name = string.Format("Order #{0}", i); + order.advertiserId = advertiserId; + order.salespersonId = salespersonId; + order.traffickerId = traffickerId; + + orders[i] = order; + } + + try { + // Create the orders on the server. + orders = orderService.createOrders(orders); + + if (orders != null) { + foreach (Order order in orders) { + Console.WriteLine("An order with ID ='{0}' and named '{1}' was created.", + order.id, order.name); + } + } else { + Console.WriteLine("No orders created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/OrderService/GetAllOrders.cs b/examples/Dfp/CSharp/v201208/OrderService/GetAllOrders.cs new file mode 100644 index 00000000000..bf8555cf7c0 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/OrderService/GetAllOrders.cs @@ -0,0 +1,88 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all orders. To create orders, run CreateOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement + /// + class GetAllOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets all orders. To create orders, run CreateOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201208.OrderService); + + // Sets defaults for page and Statement. + OrderPage page = new OrderPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all orders. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get orders by Statement. + page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and advertiser " + + "ID = '{3}' was found.", i, order.id, order.name, order.advertiserId); + i++; + } + } + + offset += 500; + } while (page.results != null && page.results.Length == 500); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/OrderService/GetOrder.cs b/examples/Dfp/CSharp/v201208/OrderService/GetOrder.cs new file mode 100644 index 00000000000..98667b13133 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/OrderService/GetOrder.cs @@ -0,0 +1,75 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets an order by its ID. To determine which orders + /// exist, run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrder + /// + class GetOrder : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets an order by its ID. To determine which orders " + + "exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + new GetOrder().Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201208.OrderService); + + // Set the ID of the order to get. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + try { + // Get the order. + Order order = orderService.getOrder(orderId); + + if (order != null) { + Console.WriteLine("An order with ID = {0}', name = '{1}', and advertiser ID = '{2}' " + + " was found.", order.id, order.name, order.advertiserId); + } else { + Console.WriteLine("No order found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get orders by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/OrderService/GetOrdersByStatement.cs b/examples/Dfp/CSharp/v201208/OrderService/GetOrdersByStatement.cs new file mode 100644 index 00000000000..f72ed7eb748 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/OrderService/GetOrdersByStatement.cs @@ -0,0 +1,89 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all orders for a given advertiser. The Statement + /// retrieves up to the maximum page size limit of 500. To create orders, run + /// CreateOrders.cs. To determine which companies are advertisers, + /// run GetCompaniesByStatement.cs. + /// + /// Tags: OrderService.getOrdersByStatement + /// + class GetOrdersByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all orders for a given advertiser. The Statement " + + "retrieves up to the maximum page size limit of 500. To create orders, run " + + "CreateOrders.cs. To determine which companies are advertisers,run " + + "GetCompaniesByStatement.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetOrdersByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201208.OrderService); + + // Set the name of the advertiser (company) to get orders for. + String advertiserId = _T("INSERT_ADVERTISER_COMPANY_ID_HERE"); + + // Create a Statement to only select orders for a given advertiser. + Statement statement = new StatementBuilder("WHERE advertiserId = :advertiserId LIMIT 500"). + AddValue("advertiserId", advertiserId).ToStatement(); + + try { + // Get orders by Statement. + OrderPage page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and advertiser " + + "ID = '{3}' was found.", i, order.id, order.name, order.advertiserId); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get orders by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/OrderService/UpdateOrders.cs b/examples/Dfp/CSharp/v201208/OrderService/UpdateOrders.cs new file mode 100644 index 00000000000..ec49cd96396 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/OrderService/UpdateOrders.cs @@ -0,0 +1,100 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example updates the notes of each order up to the first 500. + /// To determine which orders exist, run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement, OrderService.updateOrders + /// + class UpdateOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the notes of each order up to the first 500. " + + "To determine which orders exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201208.OrderService); + + // Create a Statement to get all orders. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get orders by Statement. + OrderPage page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + Order[] orders = page.results; + List ordersToUpdate = new List(); + + // Update each local order object by changing its notes. + foreach (Order order in orders) { + if (!order.isArchived) { + order.notes = "Spoke to advertiser. All is well."; + ordersToUpdate.Add(order); + } + } + + // Update the orders on the server. + orders = orderService.updateOrders(ordersToUpdate.ToArray()); + + if (orders != null) { + foreach (Order order in orders) { + Console.WriteLine("Order with ID = '{0}', name = '{1}', advertiser ID = '{2}', " + + "and notes = '{3}' was updated.", order.id, order.name, order.advertiserId, + order.notes); + } + } else { + Console.WriteLine("No orders updated."); + } + } else { + Console.WriteLine("No orders found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/PlacementService/CreatePlacements.cs b/examples/Dfp/CSharp/v201208/PlacementService/CreatePlacements.cs new file mode 100644 index 00000000000..7632ee60efb --- /dev/null +++ b/examples/Dfp/CSharp/v201208/PlacementService/CreatePlacements.cs @@ -0,0 +1,164 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example creates new placements for various ad unit sizes. To + /// determine which placements exist, run GetAllPlacements.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: PlacementService.createPlacements + /// + class CreatePlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new placements for various ad unit sizes. To determine " + + "which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreatePlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201208.InventoryService); + + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201208.PlacementService); + + // Create local placement object to store skyscraper ad units. + Placement skyscraperAdUnitPlacement = new Placement(); + skyscraperAdUnitPlacement.name = string.Format("Skyscraper AdUnit Placement #{0}", + this.GetTimeStamp()); + skyscraperAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 120x600"; + + // Create local placement object to store medium square ad units. + Placement mediumSquareAdUnitPlacement = new Placement(); + mediumSquareAdUnitPlacement.name = string.Format("Medium Square AdUnit Placement #{0}", + this.GetTimeStamp()); + mediumSquareAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 300x250"; + + // Create local placement object to store banner ad units. + Placement bannerAdUnitPlacement = new Placement(); + bannerAdUnitPlacement.name = string.Format("Banner AdUnit Placement #{0}", + this.GetTimeStamp()); + bannerAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 468x60"; + + List placementList = new List(); + + // Get the first 500 ad units. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + List mediumSquareTargetedUnitIds = new List(); + List skyscraperTargetedUnitIds = new List(); + List bannerTargetedUnitIds = new List(); + + try { + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + // Separate the ad units by size. + if (page.results != null) { + foreach (AdUnit adUnit in page.results) { + if (adUnit.parentId != null && adUnit.adUnitSizes != null) { + foreach (AdUnitSize adUnitSize in adUnit.adUnitSizes) { + Size size = adUnitSize.size; + if (size.width == 300 && size.height == 250) { + if (!mediumSquareTargetedUnitIds.Contains(adUnit.id)) { + mediumSquareTargetedUnitIds.Add(adUnit.id); + } + } else if (size.width == 120 && size.height == 600) { + if (!skyscraperTargetedUnitIds.Contains(adUnit.id)) { + skyscraperTargetedUnitIds.Add(adUnit.id); + } + } else if (size.width == 468 && size.height == 60) { + if (!bannerTargetedUnitIds.Contains(adUnit.id)) { + bannerTargetedUnitIds.Add(adUnit.id); + } + } + } + } + } + } + mediumSquareAdUnitPlacement.targetedAdUnitIds = mediumSquareTargetedUnitIds.ToArray(); + skyscraperAdUnitPlacement.targetedAdUnitIds = skyscraperTargetedUnitIds.ToArray(); + bannerAdUnitPlacement.targetedAdUnitIds = bannerTargetedUnitIds.ToArray(); + + + // Only create placements with one or more ad unit. + if (mediumSquareAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(mediumSquareAdUnitPlacement); + } + + if (skyscraperAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(skyscraperAdUnitPlacement); + } + + if (bannerAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(bannerAdUnitPlacement); + } + + Placement[] placements = + placementService.createPlacements(placementList.ToArray()); + + // Display results. + if (placements != null) { + foreach (Placement placement in placements) { + Console.Write("A placement with ID = '{0}', name ='{1}', and containing " + + "ad units {{", placement.id, placement.name); + + foreach (string adUnitId in placement.targetedAdUnitIds) { + Console.Write("{0}, ", adUnitId); + } + Console.WriteLine("} was created."); + } + } else { + Console.WriteLine("No placements created."); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to create placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/PlacementService/DeactivatePlacement.cs b/examples/Dfp/CSharp/v201208/PlacementService/DeactivatePlacement.cs new file mode 100644 index 00000000000..1884467b642 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/PlacementService/DeactivatePlacement.cs @@ -0,0 +1,120 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example deactivates all active placements. To determine which + /// placements exist, run GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// Tags: PlacementService.performPlacementAction + /// + class DeactivatePlacement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active placements. To determine which " + + "placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivatePlacement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201208.PlacementService); + + // Create Statement text to select active placements. + String statementText = "WHERE status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("status", + InventoryStatus.ACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + PlacementPage page = new PlacementPage(); + int offset = 0; + List placementIds = new List(); + + try { + do { + // Create a Statement to page through active placements. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get placements by Statement. + page = placementService.getPlacementsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID ='{1}', name ='{2}', and status ='{3}'" + + " will be deactivated.", i, placement.id, placement.name, placement.status); + placementIds.Add(placement.id.ToString()); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of placements to be deactivated: {0}", placementIds.Count); + + if (placementIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", placementIds.ToArray()))). + ToStatement(); + + // Create action. + DeactivatePlacements action = new DeactivatePlacements(); + + // Perform action. + UpdateResult result = placementService.performPlacementAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of placements deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No placements were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/PlacementService/GetAllPlacements.cs b/examples/Dfp/CSharp/v201208/PlacementService/GetAllPlacements.cs new file mode 100644 index 00000000000..97e5acbe966 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/PlacementService/GetAllPlacements.cs @@ -0,0 +1,91 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all placements. To create placements, run + /// CreatePlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// + class GetAllPlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all placements. To create placements, run " + + "CreatePlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllPlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201208.PlacementService); + + // Sets defaults for page and Statement. + PlacementPage page = new PlacementPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all ad units. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get ad units by Statement. + page = placementService.getPlacementsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID = '{1}' and name = '{2}' was found.", + i, placement.id, placement.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}" + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/PlacementService/GetPlacement.cs b/examples/Dfp/CSharp/v201208/PlacementService/GetPlacement.cs new file mode 100644 index 00000000000..7a61ff0db33 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/PlacementService/GetPlacement.cs @@ -0,0 +1,79 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets a placement by its ID. To determine which + /// placements exist, run GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacement + /// + class GetPlacement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a placement by its ID. To determine which placements " + + "exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPlacement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201208.PlacementService); + + // Set the ID of the placement to get. + long placementId = long.Parse(_T("INSERT_PLACEMENT_ID_HERE")); + + try { + // Get the placement. + Placement placement = placementService.getPlacement(placementId); + + if (placement != null) { + Console.WriteLine("Placement with ID = '{0}', name = '{1}', and status = '{2}' " + + "was found.", placement.id, placement.name, placement.status); + } else { + Console.WriteLine("No placement found for this ID."); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to get placement by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/PlacementService/GetPlacementsByStatement.cs b/examples/Dfp/CSharp/v201208/PlacementService/GetPlacementsByStatement.cs new file mode 100644 index 00000000000..6d24bfebfbb --- /dev/null +++ b/examples/Dfp/CSharp/v201208/PlacementService/GetPlacementsByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all active placements by using a Statement. To + /// create a placement, run CreatePlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// + class GetPlacementsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active placements by using a Statement. To create a " + + "placement, run CreatePlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPlacementsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201208.PlacementService); + + // Create a Statement to only select active placements. + Statement statement = new StatementBuilder("WHERE status = :status LIMIT 500").AddValue( + "status", InventoryStatus.ACTIVE.ToString()).ToStatement(); + + try { + // Get placements by Statement. + PlacementPage page = placementService.getPlacementsByStatement(statement); + + // Display results. + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID = '{1}', name ='{2}', and status = '{3}' " + + "was found.", i, placement.id, placement.name, placement.status); + i++; + } + } + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get placement by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/PlacementService/UpdatePlacements.cs b/examples/Dfp/CSharp/v201208/PlacementService/UpdatePlacements.cs new file mode 100644 index 00000000000..c8fd3a59b6c --- /dev/null +++ b/examples/Dfp/CSharp/v201208/PlacementService/UpdatePlacements.cs @@ -0,0 +1,105 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example updates all placements to allow for AdSense targeting + /// up to the first 500. To determine which placements exist, run + /// GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// Tags: PlacementService.updatePlacements + /// + class UpdatePlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates all placements to allow for AdSense targeting up to " + + "the first 500. To determine which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdatePlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201208.PlacementService); + + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201208.InventoryService); + + // Create a statement to select first 500 placements. + Statement filterStatement = new Statement(); + filterStatement.query = "LIMIT 500"; + + try { + // Get placements by statement. + PlacementPage page = placementService.getPlacementsByStatement(filterStatement); + + if (page.results != null) { + Placement[] placements = page.results; + + // Update each local placement object by enabling AdSense targeting. + foreach (Placement placement in placements) { + placement.targetingDescription = (string.IsNullOrEmpty(placement.description))? + "Generic description" : placement.description; + placement.targetingAdLocation = "All images on sports pages."; + placement.targetingSiteName = "http://code.google.com"; + placement.isAdSenseTargetingEnabled = true; + } + + // Update the placements on the server. + placements = placementService.updatePlacements(placements); + + // Display results. + if (placements != null) { + foreach (Placement placement in placements) { + Console.WriteLine("A placement with ID \"{0}\", name \"{1}\", and AdSense targeting" + + " enabled \"{2}\" was updated.", placement.id, placement.name, + placement.isAdSenseTargetingEnabled); + } + } else { + Console.WriteLine("No placements updated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to update placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/PublisherQueryLanguageService/GetAllCities.cs b/examples/Dfp/CSharp/v201208/PublisherQueryLanguageService/GetAllCities.cs new file mode 100644 index 00000000000..c5047346959 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/PublisherQueryLanguageService/GetAllCities.cs @@ -0,0 +1,85 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201208; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all cities available to target. A full list of + /// available tables can be found at + /// http://code.google.com/apis/dfp/docs/reference/v201208/PublisherQueryLanguageService.html. + /// + /// Tags: PublisherQueryLanguageService.select + /// + class GetAllCities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all cities available to target. A full list of available " + + "tables can be found at " + + "http://code.google.com/apis/dfp/docs/reference/v201208/" + + "PublisherQueryLanguageService.html."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + PublisherQueryLanguageService pqlService = + (PublisherQueryLanguageService) user.GetService( + DfpService.v201208.PublisherQueryLanguageService); + + // Create statement to select all targetable cities. + // A limit of 500 is set here. You may want to page through such a large + // result set. For criteria that do not have a "targetable" property, that + // predicate may be left off, i.e. just "SELECT * FROM Browser_Groups + // LIMIT 500" + StatementBuilder statementBuilder = + new StatementBuilder("SELECT * FROM City WHERE targetable = true LIMIT 500"); + + try { + // Get all cities. + ResultSet resultSet = pqlService.select(statementBuilder.ToStatement()); + + // Display results. + Console.WriteLine(PqlUtilities.ResultSetToString(resultSet)); + } catch (Exception ex) { + Console.WriteLine("Failed to get all cities. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/ReportService/DownloadReport.cs b/examples/Dfp/CSharp/v201208/ReportService/DownloadReport.cs new file mode 100644 index 00000000000..c98e8e70959 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/ReportService/DownloadReport.cs @@ -0,0 +1,83 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.IO; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example downloads a completed report. To run a report, run + /// RunDeliveryReport.cs. + /// + /// Tags: ReportService.getReportDownloadURL + /// + class DownloadReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example downloads a completed report. To run a report, run " + + "RunDeliveryReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DownloadReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201208.ReportService); + + // Set the id of the completed report. + long reportJobId = long.Parse(_T("INSERT_REPORT_JOB_ID_HERE")); + String fileName = _T("INSERT_FILE_PATH_HERE"); + + try { + // Download report data. + string url = reportService.getReportDownloadURL(reportJobId, ExportFormat.CSV_EXCEL); + byte[] gzipReport = MediaUtilities.GetAssetDataFromUrl(url); + string reportContents = Encoding.UTF8.GetString(MediaUtilities.DeflateGZipData(gzipReport)); + + using (StreamWriter writer = new StreamWriter(fileName)) { + writer.Write(reportContents); + } + + // Display results. + Console.WriteLine("Report job with id '{0}' was downloaded to '{1}'.", reportJobId, + fileName); + } catch (Exception ex) { + Console.WriteLine("Failed to download report. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/ReportService/RunDeliveryReport.cs b/examples/Dfp/CSharp/v201208/ReportService/RunDeliveryReport.cs new file mode 100644 index 00000000000..0e22772ae07 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/ReportService/RunDeliveryReport.cs @@ -0,0 +1,104 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Threading; +using Google.Api.Ads.Dfp.Util.v201208; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example runs a report similar to the "Orders report" on the DFP + /// website with additional attributes and can filter to include just one + /// order. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunDeliveryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report similar to the \"Orders report\" on the DFP " + + "website with additional attributes and can filter to include just one order. To " + + "download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunDeliveryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201208.ReportService); + + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create statement object to filter for an order. + Statement filterStatement = new StatementBuilder("WHERE ORDER_ID = :id").AddValue( + "id", orderId).ToStatement(); + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER}; + reportJob.reportQuery.dimensionAttributes = new DimensionAttribute[] { + DimensionAttribute.ORDER_TRAFFICKER, DimensionAttribute.ORDER_START_DATE_TIME, + DimensionAttribute.ORDER_END_DATE_TIME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportJob.reportQuery.statement = filterStatement; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/ReportService/RunInventoryReport.cs b/examples/Dfp/CSharp/v201208/ReportService/RunInventoryReport.cs new file mode 100644 index 00000000000..237a78483c2 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/ReportService/RunInventoryReport.cs @@ -0,0 +1,97 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example runs a report equal to the "Whole network report" on the + /// DFP website. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunInventoryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Whole network report\" on the " + + "DFP website. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunInventoryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201208.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.DATE}; + reportJob.reportQuery.columns = new Column[] { + Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, + Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + Column.TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + Column.TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE + }; + reportJob.reportQuery.adUnitView = ReportQueryAdUnitView.HIERARCHICAL; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_WEEK; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run inventory report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/ReportService/RunMergedDeliveryReport.cs b/examples/Dfp/CSharp/v201208/ReportService/RunMergedDeliveryReport.cs new file mode 100644 index 00000000000..1d935bf4838 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/ReportService/RunMergedDeliveryReport.cs @@ -0,0 +1,96 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example runs a report that an upgraded publisher would use to + /// include statistics before the upgrade. To download the report see + /// DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunMergedDeliveryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Orders report\" on the DFP " + + "website with additional attributes. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunMergedDeliveryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201208.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportQuery.dimensions = new Dimension[] {Dimension.ORDER}; + reportQuery.columns = new Column[] {Column.MERGED_AD_SERVER_IMPRESSIONS, + Column.MERGED_AD_SERVER_CLICKS, Column.MERGED_AD_SERVER_CTR, + Column.MERGED_AD_SERVER_CPM_AND_CPC_REVENUE, + Column.MERGED_AD_SERVER_AVERAGE_ECPM}; + reportJob.reportQuery = reportQuery; + + try { + // Run report job. + reportJob = reportService.runReportJob(reportJob); + + do { + Console.WriteLine("Report with ID '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS); + + if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with ID '{0}' failed to finish successfully.", + reportJob.id); + } else { + Console.WriteLine("Report job with ID '{0}' completed successfully.", reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/ReportService/RunReportWithCustomFields.cs b/examples/Dfp/CSharp/v201208/ReportService/RunReportWithCustomFields.cs new file mode 100644 index 00000000000..67925a589bc --- /dev/null +++ b/examples/Dfp/CSharp/v201208/ReportService/RunReportWithCustomFields.cs @@ -0,0 +1,145 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; +using Google.Api.Ads.Dfp.Util.v201208; + +using System; +using System.Threading; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example runs a report that includes custom fields found in the + /// line items of an order. To download the report see DownloadReport.cs. + /// + /// Tag: ReportService.runReportJob + /// Tag: ReportService.getReportJob + /// Tag: LineItemService.getLineItemsByStatement + /// + class RunReportWithCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report that includes custom fields found in the " + + "line items of an order. To download the report see DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunReportWithCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201208.LineItemService); + // Get the ReportService. + ReportService reportService = + (ReportService) user.GetService(DfpService.v201208.ReportService); + + try { + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Sets defaults for page and filterStatement. + LineItemPage page = new LineItemPage(); + int offset = 0; + + // Create a statement to only select line items from a given order. + String filterText = "WHERE orderId = :orderId LIMIT 500"; + Statement filterStatement = + new StatementBuilder(filterText).AddValue("orderId", orderId).ToStatement(); + + + // Collect all line item custom field IDs for an order. + List customFieldIds = new List(); + do { + filterStatement.query = filterText + " OFFSET " + offset; + + // Get line items by statement. + page = lineItemService.getLineItemsByStatement(filterStatement); + + // Get custom field IDs from the line items of an order. + if (page.results != null) { + foreach (LineItem lineItem in page.results) { + if (lineItem.customFieldValues != null) { + foreach (BaseCustomFieldValue customFieldValue in lineItem.customFieldValues) { + if (!customFieldIds.Contains(customFieldValue.customFieldId)) { + customFieldIds.Add(customFieldValue.customFieldId); + } + } + } + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + + // Create statement to filter for an order. + filterStatement = + new StatementBuilder("WHERE ORDER_ID = :orderId").AddValue("orderId", orderId) + .ToStatement(); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportQuery.dimensions = new Dimension[] {Dimension.LINE_ITEM_ID, Dimension.LINE_ITEM_NAME}; + reportQuery.statement = filterStatement; + reportQuery.customFieldIds = customFieldIds.ToArray(); + reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS}; + reportJob.reportQuery = reportQuery; + + // Run report job. + reportJob = reportService.runReportJob(reportJob); + + do { + Console.WriteLine("Report with ID '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS); + + if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with ID '{0}' failed to finish successfully.", + reportJob.id); + } else { + Console.WriteLine("Report job with ID '{0}' completed successfully.", reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run cusom fields report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/ReportService/RunSalesReport.cs b/examples/Dfp/CSharp/v201208/ReportService/RunSalesReport.cs new file mode 100644 index 00000000000..84d50dc9fb7 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/ReportService/RunSalesReport.cs @@ -0,0 +1,93 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example runs a report equal to the "Sales by salespersons + /// report" on the DFP website. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunSalesReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Sales by salespersons report\" on" + + "the DFP website. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunSalesReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201208.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.SALESPERSON}; + reportJob.reportQuery.columns = new Column[] { + Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_AVERAGE_ECPM + }; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run sales report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs b/examples/Dfp/CSharp/v201208/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs new file mode 100644 index 00000000000..ec9ac5ff56d --- /dev/null +++ b/examples/Dfp/CSharp/v201208/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs @@ -0,0 +1,105 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201208; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example approves all suggested ad units with 50 or more + /// requests. This feature is only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// Tags: SuggestedAdUnitService.performSuggestedAdUnitAction + /// + class ApproveSuggestedAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example approves all suggested ad units with 50 or more requests. " + + "This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ApproveSuggestedAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201208.SuggestedAdUnitService); + + // Create statement to select all suggested ad units with 50 or more + // requests. + string statementText = "WHERE numRequests >= 50"; + Statement filterStatement = new StatementBuilder(statementText).ToStatement(); + + try { + // Get suggested ad units by statement. + SuggestedAdUnitPage page = + suggestedAdUnitService.getSuggestedAdUnitsByStatement(filterStatement); + + int i = 0; + if (page != null && page.results != null) { + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and \"{2}\" will be " + + "approved.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + + Console.WriteLine("Number of suggested ad units to be approved: " + + page.totalResultSetSize); + + // Create action. + ApproveSuggestedAdUnit action = new ApproveSuggestedAdUnit(); + + // Perform action. + SuggestedAdUnitUpdateResult result = suggestedAdUnitService.performSuggestedAdUnitAction( + action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of suggested ad units approved: " + result.numChanges); + } else { + Console.WriteLine("No suggested ad units were approved."); + } + } else { + Console.WriteLine("No suggested ad units were approved."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to approve suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs b/examples/Dfp/CSharp/v201208/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs new file mode 100644 index 00000000000..9bb2325af0c --- /dev/null +++ b/examples/Dfp/CSharp/v201208/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs @@ -0,0 +1,94 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201208; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all suggested ad units. To approve suggested ad + /// units, run ApproveSuggestedAdUnits.cs. This feature is only available to + /// DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// + class GetAllSuggestedAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all suggested ad units. To approve suggested ad units, " + + "run ApproveSuggestedAdUnits.cs. This feature is only available to DFP premium " + + "solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllSuggestedAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201208.SuggestedAdUnitService); + + // Set defaults for page and filterStatement. + SuggestedAdUnitPage page = new SuggestedAdUnitPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all suggested ad units. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get suggested ad units by statement. + page = suggestedAdUnitService.getSuggestedAdUnitsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and number of requests " + + "\"{2}\" was found.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/SuggestedAdUnitService/GetSuggestedAdUnit.cs b/examples/Dfp/CSharp/v201208/SuggestedAdUnitService/GetSuggestedAdUnit.cs new file mode 100644 index 00000000000..524d4d74d9d --- /dev/null +++ b/examples/Dfp/CSharp/v201208/SuggestedAdUnitService/GetSuggestedAdUnit.cs @@ -0,0 +1,83 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201208; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets a suggested ad unit by its ID. To determine which + /// suggested ad units exist, run GetAllSuggestedAdUnits.cs. This feature is + /// only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnit + /// + class GetSuggestedAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a suggested ad unit by its ID. To determine which " + + "suggested ad units exist, run GetAllSuggestedAdUnits.cs. This feature is only " + + "available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetSuggestedAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201208.SuggestedAdUnitService); + + // Set the ID of the suggested ad unit to get. + String suggestedAdUnitId = _T("INSERT_SUGGESTED_AD_UNIT_ID_HERE"); + + try { + // Get the suggested ad unit. + SuggestedAdUnit suggestedAdUnit = suggestedAdUnitService.getSuggestedAdUnit( + suggestedAdUnitId); + + if (suggestedAdUnit != null) { + Console.WriteLine("Suggested ad unit with ID \"{0}\", and number of requests \"{1}\" " + + "was found.", suggestedAdUnit.id, suggestedAdUnit.numRequests); + } else { + Console.WriteLine("No suggested ad unit found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs b/examples/Dfp/CSharp/v201208/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs new file mode 100644 index 00000000000..b36c66d9f71 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs @@ -0,0 +1,90 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201208; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets suggested ad units that have more than 50 requests. + /// The statement retrieves up to the maximum page size limit of 500. This + /// feature is only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// + class GetSuggestedUnitByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets suggested ad units that have more than 50 requests. The " + + "statement retrieves up to the maximum page size limit of 500. This feature is " + + "only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetSuggestedUnitByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201208.SuggestedAdUnitService); + + // Set the number of requests to 50 or more. + long NUMBER_OF_REQUESTS = 50L; + + // Create a statement to only select suggested ad units that have more + // than 50 requests. + Statement filterStatement = new StatementBuilder("WHERE numRequests > :numRequests LIMIT 500") + .AddValue("numRequests", NUMBER_OF_REQUESTS).ToStatement(); + + try { + // Get suggested ad units by statement. + SuggestedAdUnitPage page = suggestedAdUnitService.getSuggestedAdUnitsByStatement( + filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and number of requests " + + "\"{2}\" was found.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/TeamService/CreateTeams.cs b/examples/Dfp/CSharp/v201208/TeamService/CreateTeams.cs new file mode 100644 index 00000000000..b964785d180 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/TeamService/CreateTeams.cs @@ -0,0 +1,88 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using Google.Api.Ads.Dfp.Util.v201208; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example creates new teams. To determine which teams exist, run + /// GetAllTeams.cs. + /// + /// Tags: TeamService.createTeams + /// + class CreateTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new teams. To determine which teams exist, run " + + "GetAllTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201208.TeamService); + + try { + // Create an array to store local team objects. + Team[] teams = new Team[5]; + + for (int i = 0; i < 5; i++) { + Team team = new Team(); + team.name = "Team #" + i; + team.hasAllCompanies = false; + team.hasAllInventory = false; + teams[i] = team; + } + + // Create the teams on the server. + teams = teamService.createTeams(teams); + + if (teams != null && teams.Length > 0) { + foreach (Team newTeam in teams) { + Console.WriteLine("A team with ID \"{0}\", and name \"{1}\" was created.", + newTeam.id, newTeam.name); + } + } else { + Console.WriteLine("No teams created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create teams. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/TeamService/GetAllTeams.cs b/examples/Dfp/CSharp/v201208/TeamService/GetAllTeams.cs new file mode 100644 index 00000000000..86b9355934f --- /dev/null +++ b/examples/Dfp/CSharp/v201208/TeamService/GetAllTeams.cs @@ -0,0 +1,89 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using Google.Api.Ads.Dfp.Util.v201208; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all teams. To create teams, run CreateTeams.cs. + /// + /// Tags: TeamService.getTeamsByStatement + /// + class GetAllTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams. To create teams, run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201208.TeamService); + + // Set defaults for page and filterStatement. + TeamPage page = new TeamPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all teams. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get teams by statement. + page = teamService.getTeamsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Team team in page.results) { + Console.WriteLine("{0}) Team with ID \"{1}\", name \"{2}\" was found.", + i, team.id, team.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all teams. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/TeamService/GetTeam.cs b/examples/Dfp/CSharp/v201208/TeamService/GetTeam.cs new file mode 100644 index 00000000000..ea765a920d0 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/TeamService/GetTeam.cs @@ -0,0 +1,78 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using Google.Api.Ads.Dfp.Util.v201208; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets a team by its ID. To determine which teams exist, + /// run GetAllTeams.cs. + /// + /// Tags: TeamService.getTeam + /// + class GetTeam : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a team by its ID. To determine which teams exist, run " + + "GetAllTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetTeam(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201208.TeamService); + + // Set the ID of the team to get. + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + + try { + // Get the team. + Team team = teamService.getTeam(teamId); + + if (team != null) { + Console.WriteLine("Team with ID \"{0}\"and name \"{1}\" was found.", team.id, team.name); + } else { + Console.WriteLine("No team found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get team by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/TeamService/GetTeamsByStatement.cs b/examples/Dfp/CSharp/v201208/TeamService/GetTeamsByStatement.cs new file mode 100644 index 00000000000..790f4bdb31f --- /dev/null +++ b/examples/Dfp/CSharp/v201208/TeamService/GetTeamsByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using Google.Api.Ads.Dfp.Util.v201208; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all teams ordered by name. The statement retrieves + /// up to the maximum page size limit of 500. To create teams, + /// run CreateTeams.cs. + /// + /// Tags: TeamService.getTeamsByStatement + /// + class GetTeamsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams ordered by name. The statement retrieves up to " + + "the maximum page size limit of 500. To create teams, run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetTeamsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201208.TeamService); + + // Create a statement to order teams by name. + Statement filterStatement = new StatementBuilder("ORDER BY name LIMIT 500").ToStatement(); + + try { + // Get teams by statement. + TeamPage page = teamService.getTeamsByStatement(filterStatement); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (Team team in page.results) { + Console.WriteLine("{0}) Team with ID \"{1}\" and name \"{2}\" was found.", + i, team.id, team.name); + i++; + } + } + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get teams by statement. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/TeamService/UpdateTeams.cs b/examples/Dfp/CSharp/v201208/TeamService/UpdateTeams.cs new file mode 100644 index 00000000000..1978edffa5f --- /dev/null +++ b/examples/Dfp/CSharp/v201208/TeamService/UpdateTeams.cs @@ -0,0 +1,107 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using Google.Api.Ads.Dfp.Util.v201208; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example updates teams by adding an ad unit to the first 5. To + /// determine which teams exist, run GetAllTeams.cs. To determine which ad + /// units exist, run GetAllAdUnits.cs. + /// + /// Tags: TeamService.getTeamsByStatement, TeamService.updateTeams + /// + class UpdateTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates teams by adding an ad unit to the first 5. To " + + "determine which teams exist, run GetAllTeams.cs. To determine which ad units " + + "exist, run GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201208.TeamService); + + // Set the ID of the ad unit to add to the teams. + String adUnitId = _T("INSERT_AD_UNIT_ID_HERE"); + + // Create a statement to select first 5 teams that aren't built-in. + Statement filterStatement = new StatementBuilder("WHERE id > 0 LIMIT 5").ToStatement(); + + try { + // Get the teams by statement. + TeamPage page = teamService.getTeamsByStatement(filterStatement); + + if (page.results != null) { + Team[] teams = page.results; + + // Update each local team object by adding the ad unit to it. + foreach (Team team in teams) { + // Don't add ad unit if the team has all inventory already. + if (!team.hasAllInventory) { + List adUnitIds = new List(); + if (team.adUnitIds != null) { + adUnitIds.AddRange(team.adUnitIds); + } + adUnitIds.Add(adUnitId); + team.adUnitIds = adUnitIds.ToArray(); + } + } + + // Update the teams on the server. + teams = teamService.updateTeams(teams); + + if (teams != null) { + foreach (Team team in teams) { + Console.WriteLine("A team with ID \"{0}\" and name \"{1}\" was updated.", + team.id, team.name); + } + } else { + Console.WriteLine("No teams updated."); + } + } else { + Console.WriteLine("No teams found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update teams. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/ThirdPartySlotService/ArchiveThirdPartySlots.cs b/examples/Dfp/CSharp/v201208/ThirdPartySlotService/ArchiveThirdPartySlots.cs new file mode 100644 index 00000000000..94a2418595c --- /dev/null +++ b/examples/Dfp/CSharp/v201208/ThirdPartySlotService/ArchiveThirdPartySlots.cs @@ -0,0 +1,120 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using Google.Api.Ads.Dfp.Util.v201208; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example archives all active third party slots for a company. To + /// determine which third party slots exist, run GetAllThirdPartySlots.cs. + /// + /// Tags: ThirdPartSlotsService.getThirdPartySlotsByStatement + /// Tags: ThirdPartSlotsService.performThirdPartySlotsAction + /// + class ArchiveThirdPartySlot : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example archives all active third party slots for a company. To " + + "determine which third party slots exist, run GetAllThirdPartySlots.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ArchiveThirdPartySlot(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ThirdpartySlotService. + ThirdPartySlotService thirdPartySlotService = + (ThirdPartySlotService) user.GetService(DfpService.v201208.ThirdPartySlotService); + + //Set the company that the third party slots to archive belong to. + long companyId = long.Parse(_T("INSERT_COMPANY_ID_HERE")); + + // Create a statement to only select active third party slots. + String statementText = "WHERE status = :status AND companyId = :companyId LIMIT 500"; + Statement filterStatement = new StatementBuilder("").AddValue("status", + ThirdPartySlotStatus.ACTIVE.ToString()).AddValue("companyId", companyId).ToStatement(); + + // Set defaults for page and offset. + ThirdPartySlotPage page = new ThirdPartySlotPage(); + int offset = 0; + List thirdPartySlotIds = new List(); + + try { + do { + // Create a statement to page through active third party slots. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get third party slots by statement. + page = thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement); + + if (page.results != null) { + foreach (ThirdPartySlot thirdPartySlot in page.results) { + Console.WriteLine("Third party slot with ID \"{0}\" will be archived.", + thirdPartySlot.id); + thirdPartySlotIds.Add(thirdPartySlot.id.ToString()); + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of third party slots to be archived: " + thirdPartySlotIds.Count); + + if (thirdPartySlotIds.Count > 0) { + // Modify statement for action. + filterStatement.query = "WHERE id IN (" + string.Join(",", thirdPartySlotIds.ToArray()) + + ")"; + + // Create action. + ArchiveThirdPartySlots action = new ArchiveThirdPartySlots(); + + // Perform action. + UpdateResult result = thirdPartySlotService.performThirdPartySlotAction(action, + filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of third party slots archived: " + result.numChanges); + } else { + Console.WriteLine("No third party slots were archived."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to archive slots. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/ThirdPartySlotService/CreateThirdPartySlot.cs b/examples/Dfp/CSharp/v201208/ThirdPartySlotService/CreateThirdPartySlot.cs new file mode 100644 index 00000000000..568f53a8b96 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/ThirdPartySlotService/CreateThirdPartySlot.cs @@ -0,0 +1,98 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using Google.Api.Ads.Dfp.Util.v201208; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example creates a new third party slot. To determine which + /// third party slots exist, run GetAllThirdPartySlots.cs. + /// + /// Tags: ThirdPartySlotsService.createThirdPartySlot + /// + class CreateThirdPartySlot : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new third party slot. To determine which third " + + "party slots exist, run GetAllThirdPartySlots.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateThirdPartySlot(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ThirdpartySlotService. + ThirdPartySlotService thirdPartySlotService = + (ThirdPartySlotService) user.GetService(DfpService.v201208.ThirdPartySlotService); + + // Set the company ID to associate with this third party slot. + long companyId = long.Parse(_T("INSERT_COMPANY_ID_HERE")); + + // Set the external unique ID to associate with this third party slot. + string externalUniqueId = _T("INSERT_EXTERNAL_UNIQUE_ID_HERE"); + + // Set the external unique name to associate with this third party slot. + string externalUniqueName = _T("INSERT_EXTERNAL_UNIQUE_NAME_HERE"); + + // Set the creative IDs to associate with this third party slot. + long[] creativeIds = new long[] {long.Parse(_T("INSERT_CREATIVE_ID_HERE"))}; + + // Create the ThirdPartySlot object. + ThirdPartySlot thirdPartySlot = new ThirdPartySlot(); + thirdPartySlot.companyId = companyId; + thirdPartySlot.description = "Third party slot description."; + thirdPartySlot.externalUniqueId = externalUniqueId; + thirdPartySlot.externalUniqueName = externalUniqueName; + + // Set the creatives that the third party slots will represent. + thirdPartySlot.creativeIds = creativeIds; + + try { + // Create the third party slot. + thirdPartySlot = thirdPartySlotService.createThirdPartySlot(thirdPartySlot); + + if (thirdPartySlot != null) { + Console.WriteLine("A third party slot with ID \"{0}\" and named \"{1}\" was created.", + thirdPartySlot.id, thirdPartySlot.externalUniqueName); + } else { + Console.WriteLine("No third party slot created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create third party slots. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/ThirdPartySlotService/GetAllThirdPartySlots.cs b/examples/Dfp/CSharp/v201208/ThirdPartySlotService/GetAllThirdPartySlots.cs new file mode 100644 index 00000000000..e9794e6cfed --- /dev/null +++ b/examples/Dfp/CSharp/v201208/ThirdPartySlotService/GetAllThirdPartySlots.cs @@ -0,0 +1,90 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using Google.Api.Ads.Dfp.Util.v201208; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all third party slots. To create third party slots, + /// run CreateThirdPartySlot.cs. + /// + /// Tags: ThirdPartSlotsService.getThirdPartySlotsByStatement + /// + class GetAllThirdPartySlots : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all third party slots. To create third party slots, " + + "run CreateThirdPartySlot.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllThirdPartySlots(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ThirdpartySlotService. + ThirdPartySlotService thirdPartySlotService = + (ThirdPartySlotService) user.GetService(DfpService.v201208.ThirdPartySlotService); + + // Sets defaults for page and filterStatement. + ThirdPartySlotPage page = new ThirdPartySlotPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get third party slots. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get third party slots by statement. + page = thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (ThirdPartySlot slot in page.results) { + Console.WriteLine("{0}) Third party slot with ID \"{1}\" was found.", i, slot.id); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + } catch (Exception ex) { + Console.WriteLine("Failed to get all third party slots. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/ThirdPartySlotService/GetThirdPartySlotsByStatement.cs b/examples/Dfp/CSharp/v201208/ThirdPartySlotService/GetThirdPartySlotsByStatement.cs new file mode 100644 index 00000000000..b55624d1c7b --- /dev/null +++ b/examples/Dfp/CSharp/v201208/ThirdPartySlotService/GetThirdPartySlotsByStatement.cs @@ -0,0 +1,87 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using Google.Api.Ads.Dfp.Util.v201208; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets archived third party slots. The statement retrieves + /// up to the maximum page size limit of 500. To create third party slots, run + /// CreateThirdPartySlot.cs. + /// + /// Tags: ThirdPartySlotService.getThirdPartySlotsByStatement + /// + class GetThirdPartySlotsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets archived third party slots. The statement retrieves up " + + "to the maximum page size limit of 500. To create third party slots, run " + + "CreateThirdPartySlot.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetThirdPartySlotsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ThirdpartySlotService. + ThirdPartySlotService thirdPartySlotService = + (ThirdPartySlotService) user.GetService(DfpService.v201208.ThirdPartySlotService); + + // Sets defaults for page and filterStatement. + ThirdPartySlotPage page = new ThirdPartySlotPage(); + Statement filterStatement = new StatementBuilder("WHERE status = :status LIMIT 500 ") + .AddValue("status", ThirdPartySlotStatus.ARCHIVED.ToString()).ToStatement(); + + try { + // Get third party slots by statement. + page = thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (ThirdPartySlot thirdPartySlot in page.results) { + Console.WriteLine("{0}) Third party slot with ID \"{1}\" was found.", + i, thirdPartySlot.id); + i++; + } + } + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get third party slots. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/ThirdPartySlotService/UpdateThirdPartySlots.cs b/examples/Dfp/CSharp/v201208/ThirdPartySlotService/UpdateThirdPartySlots.cs new file mode 100644 index 00000000000..7cc758d37f3 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/ThirdPartySlotService/UpdateThirdPartySlots.cs @@ -0,0 +1,93 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using Google.Api.Ads.Dfp.Util.v201208; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example updates the first third party slot description. + /// + /// Tags: ThirdPartySlotsService.getThirdPartySlotsByStatement + /// Tags:, ThirdPartySlotsService.updateThirdPartySlots + /// + class UpdateThirdPartySlots : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the first third party slot description."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateThirdPartySlots(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ThirdpartySlotService. + ThirdPartySlotService thirdPartySlotService = + (ThirdPartySlotService) user.GetService(DfpService.v201208.ThirdPartySlotService); + + // Create a statement to get one active third party slot. + Statement filterStatement = new StatementBuilder("WHERE status = :status LIMIT 1").AddValue( + "status", ThirdPartySlotStatus.ACTIVE.ToString()).ToStatement(); + + try { + // Get third party slot by statement. + ThirdPartySlotPage page = + thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement); + + if (page.results != null) { + // Update each third party slot by changing its description. + foreach (ThirdPartySlot slot in page.results) { + slot.description = "Updated description"; + + // Update the third party slot on the server. + ThirdPartySlot updatedSlot = thirdPartySlotService.updateThirdPartySlot(slot); + + // Display results. + if (updatedSlot != null) { + Console.WriteLine("A third party slot with ID \"{0}\" and description \"{1}\" " + + "was updated.", updatedSlot.id, updatedSlot.description); + } else { + Console.WriteLine("No third party slot was updated."); + } + } + } else { + Console.WriteLine("No third party slots found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update third party slots. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/UserService/CreateUsers.cs b/examples/Dfp/CSharp/v201208/UserService/CreateUsers.cs new file mode 100644 index 00000000000..54e8b60d2ef --- /dev/null +++ b/examples/Dfp/CSharp/v201208/UserService/CreateUsers.cs @@ -0,0 +1,100 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example creates new users. To determine which users + /// exist, run GetAllUsers.cs. + /// + /// Tags: UserService.createUsers + /// + class CreateUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new users. To determine which users " + + "exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201208.UserService); + + // Set the user's email addresses and names. + List emailAndNames = new List(); + emailAndNames.Add(new String[] {_T("INSERT_EMAIL_ADDRESS_HERE"), _T("INSERT_NAME_HERE")}); + emailAndNames.Add(new String[] {_T("INSERT_ANOTHER_EMAIL_ADDRESS_HERE"), + _T("INSERT_ANOTHER_NAME_HERE")}); + + // Roles can be obtained by running GetAllRoles.cs. + long roleId = long.Parse(_T("INSERT_ROLE_ID_HERE")); + + // Create an array to store local user objects. + User[] users = new User[emailAndNames.Count]; + + for (int i = 0; i < users.Length; i++) { + // Create the new user structure. + User newUser = new User(); + newUser.email = emailAndNames[i][0]; + newUser.name = emailAndNames[i][1]; + newUser.roleId = roleId; + newUser.preferredLocale = "en_US"; + + users[i] = newUser; + } + + try { + // Create the users. + users = userService.createUsers(users); + + if (users != null) { + foreach (User newUser in users) { + Console.WriteLine("A user with ID = '{0}', email = '{1}', and role = '{2}' " + + "was created.", newUser.id, newUser.email, newUser.roleName); + } + } else { + Console.WriteLine("No users created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/UserService/DeactivateUser.cs b/examples/Dfp/CSharp/v201208/UserService/DeactivateUser.cs new file mode 100644 index 00000000000..a1db4979523 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/UserService/DeactivateUser.cs @@ -0,0 +1,123 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example deactivates a user. Deactivated users can no longer make + /// requests to the API. The user making the request cannot deactivate itself. + /// To determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserService.getUsersByStatement, UserService.performUserAction + /// + class DeactivateUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates a user. Deactivated users can no longer make " + + "requests to the API. The user making the request cannot deactivate itself. " + + "To determine which users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201208.UserService); + + // Set the ID of the user to deactivate + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create Statement text to select user by id. + string statementText = "WHERE id = :userId LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("userId", userId).ToStatement(); + + // Sets defaults for page and offset. + UserPage page = new UserPage(); + int offset = 0; + List userIds = new List(); + + try { + do { + // Create a Statement to page through users. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get users by Statement. + page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User userResult in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and status = '{3}'" + + " will be deactivated.", i, userResult.id, userResult.email, + userResult.isActive ? "ACTIVE" : "INACTIVE"); + userIds.Add(userResult.id.ToString()); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of users to be deactivated: {0}", page.totalResultSetSize); + + if (userIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", userIds.ToArray()))). + ToStatement(); + + // Create action. + DeactivateUsers action = new DeactivateUsers(); + + // Perform action. + UpdateResult result = userService.performUserAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of users deactivated: {0}" + result.numChanges); + } else { + Console.WriteLine("No users were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/UserService/GetAllRoles.cs b/examples/Dfp/CSharp/v201208/UserService/GetAllRoles.cs new file mode 100644 index 00000000000..613dfbdfe06 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/UserService/GetAllRoles.cs @@ -0,0 +1,77 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all roles. This example can be used to determine + /// which role ID is needed when getting and creating users. + /// + /// Tags: UserService.getAllRoles + /// + class GetAllRoles : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all roles. This example can be used to determine which " + + "role ID is needed when getting and creating users."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllRoles(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201208.UserService); + + try { + // Get all roles. + Role[] roles = userService.getAllRoles(); + int numRoles = 0; + if (roles != null && roles.Length > 0) { + foreach (Role role in roles) { + Console.WriteLine("Role with ID = '{0}' and name ='{1}' was found.", role.id, + role.name); + } + numRoles = roles.Length; + } + + Console.WriteLine("Number of results found: " + numRoles); + } catch (Exception ex) { + Console.WriteLine("Failed to get all roles. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/UserService/GetAllUsers.cs b/examples/Dfp/CSharp/v201208/UserService/GetAllUsers.cs new file mode 100644 index 00000000000..6022451750c --- /dev/null +++ b/examples/Dfp/CSharp/v201208/UserService/GetAllUsers.cs @@ -0,0 +1,87 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all users. To create users, run CreateUsers.cs. + /// + /// Tags: UserService.getUsersByStatement + /// + class GetAllUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all users. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201208.UserService); + + // Sets defaults for page and Statement. + UserPage page = new UserPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all users. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get users by Statement. + page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User usr in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and role = '{3}'" + + " was found.", i, usr.id, usr.email, usr.roleName); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/UserService/GetCurrentUser.cs b/examples/Dfp/CSharp/v201208/UserService/GetCurrentUser.cs new file mode 100644 index 00000000000..80a7c29a813 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/UserService/GetCurrentUser.cs @@ -0,0 +1,71 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets current user. To create users, run CreateUsers.cs. + /// + /// Tags: UserService.getCurrentUser + /// + class GetCurrentUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets current user. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCurrentUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201208.UserService); + + try { + // Get the current user. + User usr = userService.getCurrentUser(); + + if (usr != null) { + Console.WriteLine("User with ID = '{0}', email = '{1}', and role = '{2}' is the " + + "current user.", usr.id, usr.email, usr.roleName); + } else { + Console.WriteLine("The current user could not be retrieved."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get current user. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/UserService/GetUser.cs b/examples/Dfp/CSharp/v201208/UserService/GetUser.cs new file mode 100644 index 00000000000..fe3800eb705 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/UserService/GetUser.cs @@ -0,0 +1,76 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets a user by its ID. To create users, run + /// CreateUsers.cs. + /// + /// Tags: UserService.getUser + /// + class GetUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets a user by its ID. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201208.UserService); + + // Set the ID of the user to get. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + try { + // Get the user. + User usr = userService.getUser(userId); + + if (usr != null) { + Console.WriteLine("User with ID = '{0}', email = '{1}', and role = '{2}' was found.", + usr.id, usr.email, usr.roleName); + } else { + Console.WriteLine("No user found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/UserService/GetUsersByStatement.cs b/examples/Dfp/CSharp/v201208/UserService/GetUsersByStatement.cs new file mode 100644 index 00000000000..145262b9ee9 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/UserService/GetUsersByStatement.cs @@ -0,0 +1,82 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all users sorted by name. The Statement retrieves + /// up to the maximum page size limit of 500. To create new users, + /// run CreateUsers.cs. + /// + /// Tags: UserService.getUsersByStatement + /// + class GetUsersByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return " This code example gets all users sorted by name. The Statement retrieves " + + "up to the maximum page size limit of 500. To create new users, " + + "run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUsersByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201208.UserService); + + // Create a Statement to get all users sorted by name. + Statement statement = new Statement(); + statement.query = "ORDER BY name LIMIT 500"; + + try { + // Get users by Statement. + UserPage page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User usr in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and role = '{3}'" + + " was found.", i, usr.id, usr.email, usr.roleName); + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/UserService/UpdateUsers.cs b/examples/Dfp/CSharp/v201208/UserService/UpdateUsers.cs new file mode 100644 index 00000000000..566bea806b2 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/UserService/UpdateUsers.cs @@ -0,0 +1,96 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example updates all users by adding "Sr." to the end of each + /// name (after a very large baby boom and lack of creativity). To + /// determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserService.getUsersByStatement, UserService.updateUsers + /// + class UpdateUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates all users by adding 'Sr.' to the end of each " + + "name (after a very large baby boom and lack of creativity). To " + + "determine which users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserService. + UserService userService = (UserService) dfpUser.GetService(DfpService.v201208.UserService); + + // Create a Statement to get all users. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get users by Statement. + UserPage page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + User[] users = page.results; + + // Update each local users object by changing its name. + foreach (User user in users) { + user.name = user.name + " Sr."; + } + + // Update the users on the server. + users = userService.updateUsers(users); + + if (users != null) { + foreach (User user in users) { + Console.WriteLine("A user with ID = '{0}', name ='{1}', and role = '{2}'" + + " was updated.", user.id, user.name, user.roleName); + } + } else { + Console.WriteLine("No users updated."); + } + } else { + Console.WriteLine("No users found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/UserTeamAssociationService/CreateUserTeamAssociations.cs b/examples/Dfp/CSharp/v201208/UserTeamAssociationService/CreateUserTeamAssociations.cs new file mode 100644 index 00000000000..51ee8d97a06 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/UserTeamAssociationService/CreateUserTeamAssociations.cs @@ -0,0 +1,98 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example adds a user to a team by creating an association + /// between the two. To determine which teams exist, run GetAllTeams.cs. To + /// determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.createUserTeamAssociations + /// + class CreateUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a user to a team by creating an association between the " + + "two. To determine which teams exist, run GetAllTeams.cs. To determine which users " + + "exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201208.UserTeamAssociationService); + + // Set the users and team to add them to. + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + long[] userIds = new long[] {long.Parse(_T("INSERT_USER_ID_HERE"))}; + + // Create an array to store local user team association objects. + UserTeamAssociation[] userTeamAssociations = new UserTeamAssociation[userIds.Length]; + + // For each user, associate it with the given team. + int i = 0; + + foreach (long userId in userIds) { + UserTeamAssociation userTeamAssociation = new UserTeamAssociation(); + userTeamAssociation.userId = userId; + userTeamAssociation.teamId = teamId; + userTeamAssociations[i++] = userTeamAssociation; + } + + try { + // Create the user team associations on the server. + userTeamAssociations = + userTeamAssociationService.createUserTeamAssociations(userTeamAssociations); + + if (userTeamAssociations != null) { + foreach (UserTeamAssociation userTeamAssociation in userTeamAssociations) { + Console.WriteLine("A user team association between user with ID \"{0}\" and team " + + "with ID \"{1}\" was created.", userTeamAssociation.userId, + userTeamAssociation.teamId); + } + } else { + Console.WriteLine("No user team associations created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/UserTeamAssociationService/DeleteUserTeamAssociations.cs b/examples/Dfp/CSharp/v201208/UserTeamAssociationService/DeleteUserTeamAssociations.cs new file mode 100644 index 00000000000..696ad14e78b --- /dev/null +++ b/examples/Dfp/CSharp/v201208/UserTeamAssociationService/DeleteUserTeamAssociations.cs @@ -0,0 +1,121 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example removes the user from all its teams. To determine which + /// users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.performUserTeamAssociationAction + /// + class DeleteUserTeamAssociation : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example removes the user from all its teams. To determine which " + + "users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeleteUserTeamAssociation(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201208.UserTeamAssociationService); + + // Set the user to remove from its teams. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create filter text to select user team associations by the user ID. + String statementText = "WHERE userId = :userId LIMIT 500"; + Statement filterStatement = new StatementBuilder("").AddValue("userId", userId). + ToStatement(); + + // Set defaults for page and offset. + UserTeamAssociationPage page = new UserTeamAssociationPage(); + int offset = 0; + + try { + do { + // Create a statement to page through user team associations. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get user team associations by statement. + page = userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and " + + "team with ID \"{2}\" will be deleted.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of teams that the user will be removed from: " + + page.totalResultSetSize); + + if (page.totalResultSetSize > 0) { + // Modify statement for action. + filterStatement.query = "WHERE userId = :userId"; + + // Create action. + DeleteUserTeamAssociations action = new DeleteUserTeamAssociations(); + + // Perform action. + UpdateResult result = + userTeamAssociationService.performUserTeamAssociationAction(action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of teams that the user was removed from: " + + result.numChanges); + } else { + Console.WriteLine("No user team associations were deleted."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to delete user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/UserTeamAssociationService/GetAllUserTeamAssociations.cs b/examples/Dfp/CSharp/v201208/UserTeamAssociationService/GetAllUserTeamAssociations.cs new file mode 100644 index 00000000000..63bdcf53e5d --- /dev/null +++ b/examples/Dfp/CSharp/v201208/UserTeamAssociationService/GetAllUserTeamAssociations.cs @@ -0,0 +1,93 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all user team associations. To create user team + /// associations, run CreateUserTeamAssociations.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// + class GetAllUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all user team associations. To create user team " + + "associations, run CreateUserTeamAssociations.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201208.UserTeamAssociationService); + + // Set defaults for page and filterStatement. + UserTeamAssociationPage page = new UserTeamAssociationPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all user team associations. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get user team associations by statement. + page = userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and " + + "team with ID \"{2}\" was found.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}." + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/UserTeamAssociationService/GetUserTeamAssociation.cs b/examples/Dfp/CSharp/v201208/UserTeamAssociationService/GetUserTeamAssociation.cs new file mode 100644 index 00000000000..98c905fd0ed --- /dev/null +++ b/examples/Dfp/CSharp/v201208/UserTeamAssociationService/GetUserTeamAssociation.cs @@ -0,0 +1,84 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets a user team association by the user and team ID. + /// To determine which teams exist, run GetAllTeams.cs. To determine which + /// users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociation + /// + class GetUserTeamAssociation : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a user team association by the user and team ID. To " + + "determine which teams exist, run GetAllTeams.cs. To determine which users exist, " + + "run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUserTeamAssociation(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201208.UserTeamAssociationService); + + // Set the IDs of the user and team to get the association for. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + + try { + // Get the user team association. + UserTeamAssociation userTeamAssociation = userTeamAssociationService.getUserTeamAssociation( + teamId, userId); + + if (userTeamAssociation != null) { + Console.WriteLine("User team association between user with ID \"{0}\" and team with " + + "ID \"{1}\" was found.", userTeamAssociation.userId, userTeamAssociation.teamId); + } else { + Console.WriteLine("No user team association found."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs b/examples/Dfp/CSharp/v201208/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs new file mode 100644 index 00000000000..03dca57a133 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs @@ -0,0 +1,98 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example gets all teams that the current user belongs to. The + /// statement retrieves up to the maximum page size limit of 500. To create + /// teams, run CreateTeams.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// Tags: UserService.getCurrentUser + /// + class GetUserTeamAssociationsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams that the current user belongs to. The " + + "statement retrieves up to the maximum page size limit of 500. To create teams, " + + "run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUserTeamAssociationsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201208.UserTeamAssociationService); + + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201208.UserService); + + try { + // Get the current user. + long currentUserId = userService.getCurrentUser().id; + + // Create filter text to select user team associations by the user ID. + String statementText = "WHERE userId = :userId LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText). + AddValue("userId", currentUserId).ToStatement(); + + // Get user team associations by statement. + UserTeamAssociationPage page = + userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and team " + + "with ID \"{2}\" was found.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201208/UserTeamAssociationService/UpdateUserTeamAssociations.cs b/examples/Dfp/CSharp/v201208/UserTeamAssociationService/UpdateUserTeamAssociations.cs new file mode 100644 index 00000000000..f58915682a8 --- /dev/null +++ b/examples/Dfp/CSharp/v201208/UserTeamAssociationService/UpdateUserTeamAssociations.cs @@ -0,0 +1,107 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201208 { + /// + /// This code example updates user team associations by setting the + /// overridden access type to read only for all teams that the user belongs + /// to. To determine which users exists, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// Tags: UserTeamAssociationService.updateUserTeamAssociations + /// + class UpdateUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates user team associations by setting the overridden " + + "access type to read only for all teams that the user belongs to. To determine " + + "which users exists, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201208.UserTeamAssociationService); + + // Set the user to set to read only access within its teams. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create filter text to select user team associations by the user ID. + String statementText = "WHERE userId = :userId LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText). + AddValue("userId", userId).ToStatement(); + + try { + // Get user team associations by statement. + UserTeamAssociationPage page = + userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + if (page.results != null) { + UserTeamAssociation[] userTeamAssociations = page.results; + + // Update each local user team association to read only access. + foreach (UserTeamAssociation userTeamAssociation in userTeamAssociations) { + userTeamAssociation.overriddenTeamAccessType = TeamAccessType.READ_ONLY; + } + + // Update the user team associations on the server. + userTeamAssociations = + userTeamAssociationService.updateUserTeamAssociations(userTeamAssociations); + + if (userTeamAssociations != null) { + foreach (UserTeamAssociation userTeamAssociation in userTeamAssociations) { + Console.WriteLine("User team association between user with ID \"{0}\" and team " + + "with ID \"{1}\" was updated to access type \"{2}\".", userTeamAssociation.userId, + userTeamAssociation.teamId, userTeamAssociation.overriddenTeamAccessType); + } + } else { + Console.WriteLine("No user team associations updated."); + } + } else { + Console.WriteLine("No user team associations found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/AudienceSegmentService/GetAllAudienceSegments.cs b/examples/Dfp/CSharp/v201211/AudienceSegmentService/GetAllAudienceSegments.cs new file mode 100644 index 00000000000..d13061b1d19 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/AudienceSegmentService/GetAllAudienceSegments.cs @@ -0,0 +1,88 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all audience segments. + /// + /// Tags: AudienceSegmentService.getAudienceSegmentsByStatement + /// + class GetAllAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all audience segments."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = + (AudienceSegmentService) user.GetService(DfpService.v201211.AudienceSegmentService); + + // Set defaults for page and Statement. + AudienceSegmentPage page = new AudienceSegmentPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all creatives. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get audience segment by Statement. + page = audienceSegmentService.getAudienceSegmentsByStatement(statement); + + // Display results. + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AudienceSegment segment in page.results) { + Console.WriteLine("{0}) 'Audience segment with id \"{1}\" and name \"{2}\" was " + + "found.", i, segment.id, segment.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get audience segment. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CompanyService/CreateCompanies.cs b/examples/Dfp/CSharp/v201211/CompanyService/CreateCompanies.cs new file mode 100644 index 00000000000..071cb1e3dc5 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CompanyService/CreateCompanies.cs @@ -0,0 +1,86 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates new companies. To determine which companies + /// exist, run GetAllCompanies.cs. + /// + /// Tags: CompanyService.createCompanies + /// + class CreateCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new companies. To determine which companies exist, " + + "run GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201211.CompanyService); + + // Create an array to store local company objects. + Company[] companies = new Company[5]; + + for (int i = 0; i < 5; i++) { + Company company = new Company(); + company.name = string.Format("Advertiser #{0}", i); + company.type = CompanyType.ADVERTISER; + companies[i] = company; + } + + try { + // Create the companies on the server. + companies = companyService.createCompanies(companies); + + if (companies != null && companies.Length > 0) { + foreach (Company company in companies) { + Console.WriteLine("A company with ID = '{0}', name = '{1}' and type = '{2}' was" + + " created.", company.id, company.name, company.type); + } + } else { + Console.WriteLine("No companies created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create company. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CompanyService/GetAllCompanies.cs b/examples/Dfp/CSharp/v201211/CompanyService/GetAllCompanies.cs new file mode 100644 index 00000000000..bdf0598f565 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CompanyService/GetAllCompanies.cs @@ -0,0 +1,88 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all companies. To create companies, run + /// CreateCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement + /// + class GetAllCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all companies. To create companies, run CreateCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201211.CompanyService); + + // Set defaults for page and Statement. + CompanyPage page = new CompanyPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all companies. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get companies by Statement. + page = companyService.getCompaniesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Company company in page.results) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", + i, company.id, company.name, company.type); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CompanyService/GetCompaniesByStatement.cs b/examples/Dfp/CSharp/v201211/CompanyService/GetCompaniesByStatement.cs new file mode 100644 index 00000000000..d3fe5105f69 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CompanyService/GetCompaniesByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all companies that are advertisers. The Statement + /// retrieves up to the maximum page size limit of 500. To create companies, + /// run CreateCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement + /// + class GetCompaniesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all companies that are advertisers. The Statement " + + "retrieves up to the maximum page size limit of 500. To create companies, run " + + "CreateCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCompaniesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201211.CompanyService); + + // Create a Statement to only select companies that are advertisers sorted + // by name. + Statement statement = new StatementBuilder("WHERE type = :advertiser ORDER BY name " + + "LIMIT 500").AddValue("advertiser", CompanyType.ADVERTISER.ToString()).ToStatement(); + + try { + // Get companies by Statement. + CompanyPage page = companyService.getCompaniesByStatement(statement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Company company in page.results) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", + i, company.id, company.name, company.type); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CompanyService/GetCompany.cs b/examples/Dfp/CSharp/v201211/CompanyService/GetCompany.cs new file mode 100644 index 00000000000..e18db53d3f6 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CompanyService/GetCompany.cs @@ -0,0 +1,77 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets a company by its ID. To determine which companies + /// exist, run GetAllCompanies.cs. + /// + /// Tags: CompanyService.getCompany + /// + class GetCompany : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a company by its ID. To determine which companies " + + "exist, run GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCompany(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201211.CompanyService); + + // Set the ID of the company to get. + long companyId = long.Parse(_T("INSERT_COMPANY_ID_HERE")); + + try { + // Get the company. + Company company = companyService.getCompany(companyId); + + if (company != null) { + Console.WriteLine("Company with ID = {0}, name = {1} and type = {2} was found", + company.id, company.name, company.type); + } else { + Console.WriteLine("No company found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get company. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CompanyService/UpdateCompanies.cs b/examples/Dfp/CSharp/v201211/CompanyService/UpdateCompanies.cs new file mode 100644 index 00000000000..be02e110f10 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CompanyService/UpdateCompanies.cs @@ -0,0 +1,99 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example updates the names of all companies that are advertisers + /// by appending "LLC." up to the first 500. To determine which companies + /// exist, run GetAllCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement, CompanyService.updateCompanies + /// + class UpdateCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the names of all companies that are advertisers by " + + "appending 'LLC.' up to the first 500. To determine which companies exist, run " + + "GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201211.CompanyService); + + // Create a Statement to only select companies that are advertisers. + Statement statement = new StatementBuilder("WHERE type = :advertiser LIMIT 500").AddValue( + "advertiser", CompanyType.ADVERTISER.ToString()).ToStatement(); + + try { + // Get the companies by Statement. + CompanyPage page = companyService.getCompaniesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + Company[] companies = page.results; + + // Update each local company object by appending LLC. to its name. + foreach (Company company in companies) { + company.name = company.name + " LLC."; + } + + // Update the companies on the server. + companies = companyService.updateCompanies(companies); + + if (companies != null && companies.Length > 0) { + int i = 0; + foreach (Company company in companies) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} was updated", + i, company.id, company.name, company.type); + i++; + } + } else { + Console.WriteLine("No companies updated."); + } + } else { + Console.WriteLine("No companies found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/ContentService/GetAllContent.cs b/examples/Dfp/CSharp/v201211/ContentService/GetAllContent.cs new file mode 100644 index 00000000000..40e579f9319 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/ContentService/GetAllContent.cs @@ -0,0 +1,89 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all content. This feature is only available to DFP + /// premium solution networks. + /// + /// Tags: ContentService.getContentByStatement + /// + class GetAllContent : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all content. This feature is only available to DFP " + + "premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllContent(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContentService. + ContentService contentService = + (ContentService) user.GetService(DfpService.v201211.ContentService); + + // Set defaults for page and filterStatement. + ContentPage page = new ContentPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all content. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get content by statement. + page = contentService.getContentByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Content content in page.results) { + Console.WriteLine("{0}) Content with ID \"{1}\", name \"{2}\", and status \"{3}\" " + + "was found.", i, content.id, content.name, content.status); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all content. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/ContentService/GetContentByCategory.cs b/examples/Dfp/CSharp/v201211/ContentService/GetContentByCategory.cs new file mode 100644 index 00000000000..6390c9be6ab --- /dev/null +++ b/examples/Dfp/CSharp/v201211/ContentService/GetContentByCategory.cs @@ -0,0 +1,123 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using Google.Api.Ads.Dfp.Util.v201211; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all active content categorized as "comedy" using + /// the network's content browse custom targeting key. This feature is only + /// available to DFP video publishers. + /// + /// Tags: NetworkService.getCurrentNetwork + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// Tags: ContentService.getContentByStatementAndCustomTargetingValue + /// /// + class GetContentByCategory : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active content categorized as 'comedy' using the " + + "network's content browse custom targeting key. This feature is only available to " + + "DFP video publishers."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetContentByCategory(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContentService. + ContentService contentService = + (ContentService) user.GetService(DfpService.v201211.ContentService); + + // Get the NetworkService. + NetworkService networkService = (NetworkService) user.GetService( + DfpService.v201211.NetworkService); + + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = (CustomTargetingService) user.GetService( + DfpService.v201211.CustomTargetingService); + + try { + // Get content browse custom targeting key ID. + long contentBrowseCustomTargetingKeyId = + networkService.getCurrentNetwork().contentBrowseCustomTargetingKeyId; + + // Create a statement to select the categories matching the name comedy. + Statement categoryFilterStatement = new StatementBuilder( + "WHERE customTargetingKeyId = :contentBrowseCustomTargetingKeyId " + + " and name = :category LIMIT 1") + .AddValue("contentBrowseCustomTargetingKeyId", contentBrowseCustomTargetingKeyId) + .AddValue("category", "comedy").ToStatement(); + + // Get categories matching the filter statement. + CustomTargetingValuePage customTargetingValuePage = + customTargetingService.getCustomTargetingValuesByStatement(categoryFilterStatement); + + if (customTargetingValuePage.results != null) { + // Get the custom targeting value ID for the comedy category. + long categoryCustomTargetingValueId = customTargetingValuePage.results[0].id; + + // Set defaults for page and filterStatement. + ContentPage page = new ContentPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + do { + // Create a statement to get all active content. + filterStatement.query = "WHERE status = 'ACTIVE' LIMIT 500 OFFSET " + offset.ToString(); + + // Get content by statement. + page = contentService.getContentByStatementAndCustomTargetingValue(filterStatement, + categoryCustomTargetingValueId); + + if (page.results != null) { + int i = page.startIndex; + foreach (Content content in page.results) { + Console.WriteLine("{0}) Content with ID \"{1}\", name \"{2}\", and status " + + "\"{3}\" was found.", i, content.id, content.name, content.status); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get content by category. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CreativeService/CopyImageCreatives.cs b/examples/Dfp/CSharp/v201211/CreativeService/CopyImageCreatives.cs new file mode 100644 index 00000000000..ed2d6f6454b --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CreativeService/CopyImageCreatives.cs @@ -0,0 +1,119 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example copies a given set of image creatives. This would + /// typically be done to reuse creatives in a small business network. To + /// determine which creatives exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// Tags: CreativeService.createCreatives + /// + class CopyImageCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example copies a given set of image creatives. This would typically be" + + " done to reuse creatives in a small business network. To determine which creatives " + + "exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CopyImageCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201211.CreativeService); + + long[] creativeIds = new long[] {long.Parse(_T("INSERT_IMAGE_CREATIVE_ID_HERE"))}; + + // Build a comma separated list of creativeIds. Note that if you are using + // .NET 4.0 or above, you could use the newly introduced + // String.Join(string separator, IEnumerable values) method to + // perform this task. + string[] creativeIdTexts = new string[creativeIds.Length]; + for (int i = 0; i < creativeIdTexts.Length; i++) { + creativeIdTexts[i] = creativeIds[i].ToString(); + } + + string commaSeparatedCreativeIds = string.Join(",", creativeIdTexts); + + // Create the statement to filter image creatives by id. + Statement statement = new StatementBuilder( + string.Format("WHERE id IN ({0}) and creativeType = :creativeType LIMIT 500", + commaSeparatedCreativeIds)).AddValue("creativeType", "ImageCreative"). + ToStatement(); + + try { + // Retrieve all creatives which match. + CreativePage page = creativeService.getCreativesByStatement(statement); + + if (page.results != null) { + Creative[] creatives = page.results; + long[] oldIds = new long[creatives.Length]; + for (int i = 0; i < creatives.Length; i++) { + ImageCreative imageCreative = (ImageCreative) creatives[i]; + oldIds[i] = imageCreative.id; + // Since we cannot set id to null, we mark it as not specified. + imageCreative.idSpecified = false; + + imageCreative.advertiserId = imageCreative.advertiserId; + imageCreative.name = imageCreative.name + " (Copy #" + GetTimeStamp() + ")"; + imageCreative.imageByteArray = MediaUtilities.GetAssetDataFromUrl( + imageCreative.imageUrl); + creatives[i] = imageCreative; + } + + // Create the copied creative. + creatives = creativeService.createCreatives(creatives); + + // Display copied creatives. + for (int i = 0; i < creatives.Length; i++) { + Console.WriteLine("Image creative with ID \"{0}\" copied to ID \"{1}\".", oldIds[i], + creatives[i].id); + } + } else { + Console.WriteLine("No creatives were copied."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to copy creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CreativeService/CreateCreativeFromTemplate.cs b/examples/Dfp/CSharp/v201211/CreativeService/CreateCreativeFromTemplate.cs new file mode 100644 index 00000000000..609e54fecfd --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CreativeService/CreateCreativeFromTemplate.cs @@ -0,0 +1,138 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates a new template creative for a given advertiser. + /// To determine which companies are advertisers, run + /// GetCompaniesByStatement.cs. To determine which creatives already exist, + /// run GetAllCreatives.cs. To determine which creative templates exist, run + /// GetAllCreativeTemplates.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCreativeFromTemplate : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new template creative for a given advertiser. To " + + "determine which companies are advertisers, run GetCompaniesByStatement.cs. To " + + "determine which creatives already exist, run GetAllCreatives.cs. To determine " + + "which creative templates exist, run GetAllCreativeTemplates.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreativeFromTemplate(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201211.CreativeService); + + // Set the ID of the advertiser (company) that all creative will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Use the image banner with optional third party tracking template. + long creativeTemplateId = 10000680L; + + // Create the local custom creative object. + TemplateCreative templateCreative = new TemplateCreative(); + templateCreative.name = "Template creative"; + templateCreative.advertiserId = advertiserId; + templateCreative.creativeTemplateId = creativeTemplateId; + + // Set the creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + templateCreative.size = size; + + // Create the asset variable value. + AssetCreativeTemplateVariableValue assetVariableValue = + new AssetCreativeTemplateVariableValue(); + assetVariableValue.uniqueName = "Imagefile"; + assetVariableValue.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + assetVariableValue.fileName = String.Format("image{0}.jpg", this.GetTimeStamp()); + + // Create the image width variable value. + LongCreativeTemplateVariableValue imageWidthVariableValue = + new LongCreativeTemplateVariableValue(); + imageWidthVariableValue.uniqueName = "Imagewidth"; + imageWidthVariableValue.value = 300; + + // Create the image height variable value. + LongCreativeTemplateVariableValue imageHeightVariableValue = + new LongCreativeTemplateVariableValue(); + imageHeightVariableValue.uniqueName = "Imageheight"; + imageHeightVariableValue.value = 250; + + // Create the URL variable value. + UrlCreativeTemplateVariableValue urlVariableValue = new UrlCreativeTemplateVariableValue(); + urlVariableValue.uniqueName = "ClickthroughURL"; + urlVariableValue.value = "www.google.com"; + + // Create the target window variable value. + StringCreativeTemplateVariableValue targetWindowVariableValue = + new StringCreativeTemplateVariableValue(); + targetWindowVariableValue.uniqueName = "Targetwindow"; + targetWindowVariableValue.value = "_blank"; + + templateCreative.creativeTemplateVariableValues = new BaseCreativeTemplateVariableValue[] { + assetVariableValue, imageWidthVariableValue, imageHeightVariableValue, urlVariableValue, + targetWindowVariableValue}; + + try { + // Create the template creative on the server. + templateCreative = (TemplateCreative) creativeService.createCreative(templateCreative); + + if (templateCreative != null) { + Console.WriteLine("A template creative with ID \"{0}\", name \"{1}\", and type \"{2}\" " + + "was created and can be previewed at {3}", templateCreative.id, templateCreative.name, + templateCreative.CreativeType, templateCreative.previewUrl); + } else { + Console.WriteLine("No creatives were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CreativeService/CreateCreatives.cs b/examples/Dfp/CSharp/v201211/CreativeService/CreateCreatives.cs new file mode 100644 index 00000000000..a74d3a1c43a --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CreativeService/CreateCreatives.cs @@ -0,0 +1,113 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates new image creatives for a given advertiser. To + /// determine which companies are advertisers, run GetCompaniesByStatement.cs. + /// To determine which creatives already exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new image creatives for a given advertiser. To " + + "determine which companies are advertisers, run GetCompaniesByStatement.cs. " + + "To determine which creatives already exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201211.CreativeService); + + // Set the ID of the advertiser (company) that all creatives will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Create an array to store local image creative objects. + Creative[] imageCreatives = new ImageCreative[5]; + + for (int i = 0; i < 5; i++) { + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", i); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.imageName = "image.jpg"; + imageCreative.imageByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + + Size imageSize = new Size(); + imageSize.width = 300; + imageSize.height = 250; + + imageCreative.size = imageSize; + imageCreatives[i] = imageCreative; + } + + try { + // Create the image creatives on the server. + imageCreatives = creativeService.createCreatives(imageCreatives); + + if (imageCreatives != null) { + foreach (Creative creative in imageCreatives) { + // Use "is" operator to determine what type of creative was + // returned. + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + Console.WriteLine("An image creative with ID ='{0}', name ='{1}' and size = " + + "({2},{3}) was created and can be previewed at: {4}", imageCreative.id, + imageCreative.name, imageCreative.size.width, imageCreative.size.height, + imageCreative.previewUrl); + } else { + Console.WriteLine("A creative with ID ='{0}', name='{1}' and type='{2}' was created.", + creative.id, creative.name, creative.CreativeType); + } + } + } else { + Console.WriteLine("No creatives created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CreativeService/CreateCustomCreative.cs b/examples/Dfp/CSharp/v201211/CreativeService/CreateCustomCreative.cs new file mode 100644 index 00000000000..eaf3d28daa8 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CreativeService/CreateCustomCreative.cs @@ -0,0 +1,111 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates a custom creative for a given advertiser. To + /// determine which companies are advertisers, run GetCompaniesByStatement.cs. + /// To determine which creatives already exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCustomCreative : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a custom creative for a given advertiser. To determine " + + "which companies are advertisers, run GetCompaniesByStatement.cs. To determine which " + + "creatives already exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomCreative(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201211.CreativeService); + + // Set the ID of the advertiser (company) that all creatives will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + + // Create the local custom creative object. + CustomCreative customCreative = new CustomCreative(); + customCreative.name = "Custom creative " + GetTimeStamp(); + customCreative.advertiserId = advertiserId; + customCreative.destinationUrl = "http://google.com"; + + // Set the custom creative image asset. + CustomCreativeAsset customCreativeAsset = new CustomCreativeAsset(); + customCreativeAsset.macroName = "IMAGE_ASSET"; + customCreativeAsset.fileName = string.Format("inline{0}.jpg", GetTimeStamp()); + customCreativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + customCreative.customCreativeAssets = new CustomCreativeAsset[] {customCreativeAsset}; + + // Set the HTML snippet using the custom creative asset macro. + customCreative.htmlSnippet = "" + + "" + + "
Click above for great deals!"; + + // Set the creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + customCreative.size = size; + + try { + // Create the custom creative on the server. + customCreative = (CustomCreative) creativeService.createCreative(customCreative); + + if (customCreative != null) { + Console.WriteLine("A custom creative with ID \"{0}\", name \"{1}\", and size ({2}, " + + "{3}) was created and can be previewed at {4}", customCreative.id, + customCreative.name, customCreative.size.width, customCreative.size.height, + customCreative.previewUrl); + } else { + Console.WriteLine("No creative created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CreativeService/GetAllCreatives.cs b/examples/Dfp/CSharp/v201211/CreativeService/GetAllCreatives.cs new file mode 100644 index 00000000000..5ef4c1a3213 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CreativeService/GetAllCreatives.cs @@ -0,0 +1,89 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all creatives. To create creatives, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// + class GetAllCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all creatives. To create creatives, run CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201211.CreativeService); + + // Set defaults for page and Statement. + CreativePage page = new CreativePage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all creatives. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get creatives by Statement. + page = creativeService.getCreativesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Creative creative in page.results) { + Console.WriteLine("{0}) Creative with ID ='{1}', name ='{2}' and type ='{3}' " + + "was found.", i, creative.id, creative.name, creative.CreativeType); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CreativeService/GetCreative.cs b/examples/Dfp/CSharp/v201211/CreativeService/GetCreative.cs new file mode 100644 index 00000000000..c49e5334b16 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CreativeService/GetCreative.cs @@ -0,0 +1,77 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets a creative by its ID. To determine which creatives + /// exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.getCreative + /// + class GetCreative : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a creative by its ID. To determine which creatives " + + "exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code sample as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreative(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201211.CreativeService); + + // Set the ID of the creative to get. + long creativeId = long.Parse(_T("INSERT_CREATIVE_ID_HERE")); + + try { + // Get the creative. + Creative creative = creativeService.getCreative(creativeId); + + if (creative != null) { + Console.WriteLine("Creative with ID ='{0}', name ='{1}' and type ='{2}' " + + "was found.", creative.id, creative.name, creative.CreativeType); + } else { + Console.WriteLine("No creative found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get creative. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CreativeService/GetCreativesByStatement.cs b/examples/Dfp/CSharp/v201211/CreativeService/GetCreativesByStatement.cs new file mode 100644 index 00000000000..ccca6d19c01 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CreativeService/GetCreativesByStatement.cs @@ -0,0 +1,86 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all image creatives. The Statement retrieves up to + /// the maximum page size limit of 500. To create an image creative, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// + class GetCreativesByStatement : SampleBase { + /// + /// Returns a description about the sample code. + /// + public override string Description { + get { + return "This code example gets all image creatives. The Statement retrieves up to the " + + "maximum page size limit of 500. To create an image creative, run " + + "CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201211.CreativeService); + + // Create a Statement to only select image creatives. + Statement statement = new StatementBuilder("WHERE creativeType = :creativeType LIMIT 500"). + AddValue("creativeType", "ImageCreative").ToStatement(); + + try { + // Get creatives by Statement. + CreativePage page = creativeService.getCreativesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Creative creative in page.results) { + Console.WriteLine("{0}) Creative with ID ='{1}', name ='{2}' and type ='{3}' " + + "was found.", i, creative.id, creative.name, creative.CreativeType); + i++; + } + } + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get creatives by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CreativeService/UpdateCreatives.cs b/examples/Dfp/CSharp/v201211/CreativeService/UpdateCreatives.cs new file mode 100644 index 00000000000..f99a0607f78 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CreativeService/UpdateCreatives.cs @@ -0,0 +1,104 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all image creatives. The Statement retrieves up to + /// the maximum page size limit of 500. To create an image creative, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// Tags: CreativeService.updateCreatives + /// + class UpdateCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all image creatives. The Statement retrieves up to the " + + "maximum page size limit of 500. To create an image creative, run " + + "CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201211.CreativeService); + + // Create a Statement to get all image creatives. + Statement statement = new StatementBuilder("WHERE creativeType = :creativeType LIMIT 500"). + AddValue("creativeType", "ImageCreative").ToStatement(); + + try { + // Get creatives by Statement. + CreativePage page = creativeService.getCreativesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + Creative[] creatives = page.results; + + // Update each local creative object by changing its destination URL. + foreach (Creative creative in creatives) { + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + imageCreative.destinationUrl = "http://news.google.com"; + } + } + + // Update the creatives on the server. + creatives = creativeService.updateCreatives(creatives); + + if (creatives != null) { + foreach (Creative creative in creatives) { + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + Console.WriteLine("An image creative with ID = '{0}' and destination URL ='{1}' " + + "was updated.", imageCreative.id, imageCreative.destinationUrl); + } + } + } else { + Console.WriteLine("No creatives updated."); + } + } else { + Console.WriteLine("No creatives found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CreativeTemplateService/GetAllCreativeTemplates.cs b/examples/Dfp/CSharp/v201211/CreativeTemplateService/GetAllCreativeTemplates.cs new file mode 100644 index 00000000000..32d32647b2d --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CreativeTemplateService/GetAllCreativeTemplates.cs @@ -0,0 +1,92 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all creative templates. + /// + /// Tags: CreativeTemplateService.getCreativeTemplatesByStatement + /// + class GetAllCreativeTemplates : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all creative templates."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreativeTemplates(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201211.CreativeTemplateService); + + // Set defaults for page and filterStatement. + CreativeTemplatePage page = new CreativeTemplatePage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all creative templates. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get creative templates by statement. + page = creativeTemplateService.getCreativeTemplatesByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CreativeTemplate creativeTemplate in page.results) { + Console.WriteLine("{0}) Creative template with ID \"{1}\", name \"{2}\", and type " + + "\"{3}\" was found.", i, creativeTemplate.id, creativeTemplate.name, + creativeTemplate.type); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CreativeTemplateService/GetCreativeTemplate.cs b/examples/Dfp/CSharp/v201211/CreativeTemplateService/GetCreativeTemplate.cs new file mode 100644 index 00000000000..007a947ce5a --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CreativeTemplateService/GetCreativeTemplate.cs @@ -0,0 +1,87 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets a creative by its ID. To determine which creative + /// templates exist, run GetAllCreativeTemplates.cs. + /// + /// Tags: CreativeTemplateService.getCreativeTemplate + /// + class GetCreativeTemplate : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a creative by its ID. To determine which creative " + + "templates exist, run GetAllCreativeTemplates.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeTemplate(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201211.CreativeTemplateService); + + // Set the ID of the creative template to get. + long creativeTemplateId = long.Parse(_T("INSERT_CREATIVE_TEMPLATE_ID_HERE")); + + try { + // Get the creative template. + CreativeTemplate creativeTemplate = creativeTemplateService.getCreativeTemplate( + creativeTemplateId); + + if (creativeTemplate != null) { + Console.WriteLine("Creative template with ID \"{0}\", name \"{1}\", and type \"{2}\" " + + "was found.", creativeTemplate.id, creativeTemplate.name, creativeTemplate.type); + if (creativeTemplate.variables != null) { + foreach (CreativeTemplateVariable variable in creativeTemplate.variables) { + Console.WriteLine("Variable with name \"{0}\" is {1}.", variable.uniqueName, + variable.isRequired ? "required." : "optional."); + } + } + } else { + Console.WriteLine("No creative template found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CreativeTemplateService/GetCreativeTemplatesByStatement.cs b/examples/Dfp/CSharp/v201211/CreativeTemplateService/GetCreativeTemplatesByStatement.cs new file mode 100644 index 00000000000..2ca99a2db94 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CreativeTemplateService/GetCreativeTemplatesByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets up to 500 system defined creative templates. + /// + /// Tags: CreativeTemplateService.getCreativeTemplatesByStatement + /// + class GetCreativeTemplatesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets up to 500 system defined creative templates."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeTemplatesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201211.CreativeTemplateService); + + // Create a statement to only select system defined creative templates. + Statement filterStatement = + new StatementBuilder("WHERE type = :creativeTemplateType LIMIT 500").AddValue( + "creativeTemplateType", CreativeTemplateType.SYSTEM_DEFINED.ToString()).ToStatement(); + + try { + // Get creative templates by statement. + CreativeTemplatePage page = creativeTemplateService.getCreativeTemplatesByStatement( + filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CreativeTemplate creativeTemplate in page.results) { + Console.WriteLine("{0}) Creative template with ID \"{1}\", name \"{2}\", and type " + + "\"{3}\" was found.", i, creativeTemplate.id, creativeTemplate.name, + creativeTemplate.type); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CreativeWrapperService/CreateCreativeWrappers.cs b/examples/Dfp/CSharp/v201211/CreativeWrapperService/CreateCreativeWrappers.cs new file mode 100644 index 00000000000..0db1efb62b2 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CreativeWrapperService/CreateCreativeWrappers.cs @@ -0,0 +1,89 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates a new creative wrapper. Creative wrappers must + /// be associated with a LabelType.CREATIVE_WRAPPER label and applied to ad + /// units by AdUnit.appliedLabels. To determine which creative wrappers exist, + /// run GetAllCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.createCreativeWrappers + /// + class CreateCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new creative wrapper. Creative wrappers must be " + + "associated with a LabelType.CREATIVE_WRAPPER label and applied to ad units by " + + "AdUnit.appliedLabels. To determine which creative wrappers exist, run " + + "GetAllCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201211.CreativeWrapperService); + + long labelId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE")); + + // Create creative wrapper objects. + CreativeWrapper creativeWrapper = new CreativeWrapper(); + creativeWrapper.labelId = labelId; + creativeWrapper.ordering = CreativeWrapperOrdering.INNER; + creativeWrapper.header = new CreativeWrapperHtmlSnippet(); + creativeWrapper.header.htmlSnippet = "My creative wrapper header"; + creativeWrapper.footer = new CreativeWrapperHtmlSnippet(); + creativeWrapper.footer.htmlSnippet = "My creative wrapper footer"; + + try { + // Add creative wrapper. + CreativeWrapper[] creativeWrappers = creativeWrapperService.createCreativeWrappers( + new CreativeWrapper[] {creativeWrapper}); + + // Display results. + foreach (CreativeWrapper wrapper in creativeWrappers) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' was " + + "created.", wrapper.id, wrapper.labelId); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creative wrappers. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CreativeWrapperService/DeactivateCreativeWrappers.cs b/examples/Dfp/CSharp/v201211/CreativeWrapperService/DeactivateCreativeWrappers.cs new file mode 100644 index 00000000000..1751a9c8624 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CreativeWrapperService/DeactivateCreativeWrappers.cs @@ -0,0 +1,95 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using Google.Api.Ads.Dfp.Util.v201211; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example deactivates a creative wrapper belonging to a label. + /// + /// Tags: CreativeWrapperService.getCreativeWrapperByStatement + /// Tags: CreativeWrapperService.performCreativeWrapperAction + /// + class DeActivateCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates a creative wrapper belonging to a label."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeActivateCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201211.CreativeWrapperService); + + long labelId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE")); + + try { + // Create a query to select the active creative wrapper for the given + // label. + Statement statement = new StatementBuilder("WHERE status = :status AND labelId = :labelId") + .AddValue("labelId", labelId) + .AddValue("status", CreativeWrapperStatus.ACTIVE.ToString()) + .ToStatement(); + CreativeWrapperPage page = creativeWrapperService.getCreativeWrappersByStatement(statement); + CreativeWrapper[] creativeWrappers = page.results; + if (creativeWrappers != null) { + foreach (CreativeWrapper wrapper in creativeWrappers) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' with " + + "status \'{2}\' will be deactivated.", wrapper.id, wrapper.labelId, wrapper.status); + } + Console.WriteLine("Number of creative wrappers to be deactivated: {0}", + creativeWrappers.Length); + + // Perform action. + CreativeWrapperAction action = new DeactivateCreativeWrappers(); + UpdateResult result = + creativeWrapperService.performCreativeWrapperAction(action, statement); + + // Display results. + if (result.numChanges > 0) { + Console.WriteLine("Number of creative wrappers deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No creative wrappers were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creative wrappers. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CreativeWrapperService/GetActiveCreativeWrappers.cs b/examples/Dfp/CSharp/v201211/CreativeWrapperService/GetActiveCreativeWrappers.cs new file mode 100644 index 00000000000..036eb53f93e --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CreativeWrapperService/GetActiveCreativeWrappers.cs @@ -0,0 +1,94 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using Google.Api.Ads.Dfp.Util.v201211; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all active creative wrappers. To create + /// creative wrappers, run CreateCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.getCreativeWrapperByStatement + /// + class GetActiveCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active creative wrappers. To create creative " + + "wrappers, run CreateCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActiveCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201211.CreativeWrapperService); + + // Set defaults for page and Statement. + CreativeWrapperPage page = new CreativeWrapperPage(); + Statement statement = new StatementBuilder("") + .AddValue("status", CreativeWrapperStatus.ACTIVE.ToString()) + .ToStatement(); + int offset = 0; + + try { + do { + // Create a Statement to get all active creative wrappers. + statement.query = string.Format("WHERE status = :status LIMIT 500 OFFSET {0}", offset); + + // Get creative wrappers by Statement. + page = creativeWrapperService.getCreativeWrappersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (CreativeWrapper wrapper in page.results) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' with " + + "status \'{2}\' was found.", wrapper.id, wrapper.labelId, wrapper.status); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get active creative wrappers. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CreativeWrapperService/GetAllCreativeWrappers.cs b/examples/Dfp/CSharp/v201211/CreativeWrapperService/GetAllCreativeWrappers.cs new file mode 100644 index 00000000000..08656c7682c --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CreativeWrapperService/GetAllCreativeWrappers.cs @@ -0,0 +1,92 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using Google.Api.Ads.Dfp.Util.v201211; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all creative wrappers. To create creative wrappers, + /// run CreateCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.getCreativeWrapperByStatement + /// + class GetAllCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active creative wrappers. To create creative " + + "wrappers, run CreateCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201211.CreativeWrapperService); + + // Set defaults for page and Statement. + CreativeWrapperPage page = new CreativeWrapperPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all creative wrappers. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get creative wrappers by Statement. + page = creativeWrapperService.getCreativeWrappersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (CreativeWrapper wrapper in page.results) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' with " + + "status \'{2}\' was found.", wrapper.id, wrapper.labelId, wrapper.status); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get active creative wrappers. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CreativeWrapperService/UpdateCreativeWrappers.cs b/examples/Dfp/CSharp/v201211/CreativeWrapperService/UpdateCreativeWrappers.cs new file mode 100644 index 00000000000..10407e45651 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CreativeWrapperService/UpdateCreativeWrappers.cs @@ -0,0 +1,84 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using Google.Api.Ads.Dfp.Util.v201211; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example updates a creative wrapper to the 'OUTER' wrapping + /// order. To determine which creative wrappers exist, run + /// GetAllCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.getCreativeWrapper + /// Tags: CreativeWrapperService.updateCreativeWrappers + /// + class UpdateCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active creative wrappers. To create creative " + + "wrappers, run CreateCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201211.CreativeWrapperService); + + long creativeWrapperId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_ID_HERE")); + + try { + CreativeWrapper wrapper = creativeWrapperService.getCreativeWrapper(creativeWrapperId); + if (wrapper != null) { + wrapper.ordering = CreativeWrapperOrdering.OUTER; + // Update the creative wrappers on the server. + CreativeWrapper[] creativeWrappers = creativeWrapperService.updateCreativeWrappers( + new CreativeWrapper[] {wrapper}); + + // Display results. + Console.WriteLine("Creative wrapper with ID '{0}' and wrapping order '{1}' was " + + "updated.", creativeWrappers[0].id, creativeWrappers[0].ordering); + } else { + Console.WriteLine("No creative wrappers found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update creative wrappers. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CustomFieldService/CreateCustomFieldOptions.cs b/examples/Dfp/CSharp/v201211/CustomFieldService/CreateCustomFieldOptions.cs new file mode 100644 index 00000000000..90514e0cab6 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CustomFieldService/CreateCustomFieldOptions.cs @@ -0,0 +1,97 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates custom field options for a drop-down custom + /// field. Once created, custom field options can be found under the options + /// fields of the drop-down custom field and they cannot be deleted. To + /// determine which custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.createCustomFieldOptions + /// + class CreateCustomFieldOptions : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates custom field options for a drop-down custom field. " + + "Once created, custom field options can be found under the options fields of the " + + "drop-down custom field and they cannot be deleted. To determine which custom " + + "fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomFieldOptions(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = + (CustomFieldService) user.GetService(DfpService.v201211.CustomFieldService); + + // Set the ID of the drop-down custom field to create options for. + long customFieldId = long.Parse(_T("INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE")); + + // Create custom field options. + CustomFieldOption customFieldOption1 = new CustomFieldOption(); + customFieldOption1.displayName = "Approved"; + customFieldOption1.customFieldId = customFieldId; + + CustomFieldOption customFieldOption2 = new CustomFieldOption(); + customFieldOption2.displayName = "Unapproved"; + customFieldOption2.customFieldId = customFieldId; + + try { + // Add custom field options. + CustomFieldOption[] customFieldOptions = + customFieldService.createCustomFieldOptions(new CustomFieldOption[] {customFieldOption1, + customFieldOption2}); + + // Display results. + if (customFieldOptions != null) { + foreach (CustomFieldOption customFieldOption in customFieldOptions) { + Console.WriteLine("Custom field option with ID \"{0}\" and name \"{1}\" was created.", + customFieldOption.id, customFieldOption.displayName); + } + } else { + Console.WriteLine("No custom field options created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom field options. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CustomFieldService/CreateCustomFields.cs b/examples/Dfp/CSharp/v201211/CustomFieldService/CreateCustomFields.cs new file mode 100644 index 00000000000..799bbb2e44b --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CustomFieldService/CreateCustomFields.cs @@ -0,0 +1,92 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates custom fields. To determine which custom fields + /// exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.createCustomFields + /// + class CreateCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates custom fields. To determine which custom fields exist" + + ", run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201211.CustomFieldService); + + // Create custom fields. + CustomField customField1 = new CustomField(); + customField1.name = "Customer comments #" + GetTimeStamp(); + customField1.entityType = CustomFieldEntityType.LINE_ITEM; + customField1.dataType = CustomFieldDataType.STRING; + customField1.visibility = CustomFieldVisibility.FULL; + + CustomField customField2 = new CustomField(); + customField2.name = "Internal approval status #" + GetTimeStamp(); + customField2.entityType = CustomFieldEntityType.LINE_ITEM; + customField2.dataType = CustomFieldDataType.DROP_DOWN; + customField2.visibility = CustomFieldVisibility.FULL; + + try { + // Add custom fields. + CustomField[] customFields = + customFieldService.createCustomFields(new CustomField[] {customField1, customField2}); + + // Display results. + if (customFields != null) { + foreach (CustomField customField in customFields) { + Console.WriteLine("Custom field with ID \"{0}\" and name \"{1}\" was created.", + customField.id, customField.name); + } + } else { + Console.WriteLine("No custom fields created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CustomFieldService/DeactivateAllLineItemCustomFields.cs b/examples/Dfp/CSharp/v201211/CustomFieldService/DeactivateAllLineItemCustomFields.cs new file mode 100644 index 00000000000..4a7840ff214 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CustomFieldService/DeactivateAllLineItemCustomFields.cs @@ -0,0 +1,122 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using Google.Api.Ads.Dfp.Util.v201211; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example deactivates all active line item custom fields. To + /// determine which custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// Tags: CustomFieldService.performCustomFieldAction + /// + class DeactivateAllLineItemCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active line item custom fields. To determine " + + "which custom fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateAllLineItemCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201211.CustomFieldService); + + // Create statement to select only active custom fields that apply to + // line items. + String statementText = "WHERE entityType = :entityType and isActive = :isActive LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText) + .AddValue("entityType", CustomFieldEntityType.LINE_ITEM.ToString()) + .AddValue("isActive", true) + .ToStatement(); + + // Set defaults for page and offset. + CustomFieldPage page = new CustomFieldPage(); + int offset = 0; + int i = 0; + List customFieldIds = new List(); + + try { + do { + // Create a statement to page through custom fields. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(filterStatement); + + if (page.results != null) { + foreach (CustomField customField in page.results) { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" will be " + + "deactivated.", i, customField.id, customField.name); + customFieldIds.Add(customField.id.ToString()); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of custom fields to be deactivated: " + customFieldIds.Count); + + if (customFieldIds.Count > 0) { + // Modify statement for action. + filterStatement.query = "WHERE id IN (" + string.Join(", ", customFieldIds.ToArray()) + + ")"; + + // Create action. + DeactivateCustomFields action = new DeactivateCustomFields(); + + // Perform action. + UpdateResult result = customFieldService.performCustomFieldAction( + action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of custom fields deactivated: " + result.numChanges); + } else { + Console.WriteLine("No custom fields were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CustomFieldService/GetAllCustomFields.cs b/examples/Dfp/CSharp/v201211/CustomFieldService/GetAllCustomFields.cs new file mode 100644 index 00000000000..f601116fbe1 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CustomFieldService/GetAllCustomFields.cs @@ -0,0 +1,107 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using Google.Api.Ads.Dfp.Util.v201211; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all custom fields. To create custom fields, run + /// CreateCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// Tags: CustomFieldService.performCustomFieldAction + /// + class GetAllCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom fields. To create custom fields, run " + + "CreateCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201211.CustomFieldService); + + // Sets defaults for page and filter. + CustomFieldPage page = new CustomFieldPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all custom fields. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomField customField in page.results) { + if (customField is DropDownCustomField) { + List dropDownCustomFieldStrings = new List(); + DropDownCustomField dropDownCustomField = (DropDownCustomField) customField; + if (dropDownCustomField.options != null) { + foreach (CustomFieldOption customFieldOption in dropDownCustomField.options) { + dropDownCustomFieldStrings.Add(customFieldOption.displayName); + } + } + Console.WriteLine("{0}) Drop-down custom field with ID \"{1}\", name \"{2}\", " + + "and options {{{3}}} was found.", i, customField.id, customField.name, + string.Join(", ", dropDownCustomFieldStrings.ToArray())); + } else { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" was found.", + i, customField.id, customField.name); + } + i++; + } + } + + offset += 500; + } while (page.results != null && page.results.Length == 500); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CustomFieldService/GetAllLineItemCustomFields.cs b/examples/Dfp/CSharp/v201211/CustomFieldService/GetAllLineItemCustomFields.cs new file mode 100644 index 00000000000..8379cd17f8d --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CustomFieldService/GetAllLineItemCustomFields.cs @@ -0,0 +1,97 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using Google.Api.Ads.Dfp.Util.v201211; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all custom fields that apply to line items. To + /// create custom fields, run CreateCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// + class GetAllLineItemCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom fields that apply to line items. To create " + + "custom fields, run CreateCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLineItemCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201211.CustomFieldService); + + // Create statement to select only custom fields that apply to line items. + String statementText = "WHERE entityType = :entityType LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText) + .AddValue("entityType", CustomFieldEntityType.LINE_ITEM.ToString()) + .ToStatement(); + + // Set defaults for page and offset. + CustomFieldPage page = new CustomFieldPage(); + int offset = 0; + int i = 0; + + try { + do { + // Create a statement to page through custom fields. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(filterStatement); + + if (page.results != null) { + foreach (CustomField customField in page.results) { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" was found.", i, + customField.id, customField.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all line item custom fields. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CustomFieldService/SetLineItemCustomFieldValue.cs b/examples/Dfp/CSharp/v201211/CustomFieldService/SetLineItemCustomFieldValue.cs new file mode 100644 index 00000000000..ca822c50148 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CustomFieldService/SetLineItemCustomFieldValue.cs @@ -0,0 +1,148 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using Google.Api.Ads.Dfp.Util.v201211; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example sets custom field values on a line item. To determine + /// which custom fields exist, run GetAllCustomFields.cs. To create custom + /// field options, run CreateCustomFieldOptions.cs. To determine which line + /// items exist, run GetAllLineItems.cs. + /// + /// Tags: CustomFieldService.getCustomField + /// Tags: LineItemService.getLineItem + /// Tags: LineItemService.updateLineItems + /// + class SetLineItemCustomFieldValue : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example sets custom field values on a line item. To determine which " + + "custom fields exist, run GetAllCustomFields.cs. To create custom field options, " + + "run CreateCustomFieldOptions.cs. To determine which line items exist, run " + + "GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new SetLineItemCustomFieldValue(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201211.CustomFieldService); + + // Get the LineItemService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201211.LineItemService); + + // Set the IDs of the custom fields, custom field option, and line item. + long customFieldId = long.Parse(_T("INSERT_STRING_CUSTOM_FIELD_ID_HERE")); + long dropDownCustomFieldId = long.Parse(_T("INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE")); + long customFieldOptionId = long.Parse(_T("INSERT_CUSTOM_FIELD_OPTION_ID_HERE")); + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get the custom field. + CustomField customField = customFieldService.getCustomField(customFieldId); + + // Get the drop-down custom field. + DropDownCustomField dropDownCustomField = + (DropDownCustomField) customFieldService.getCustomField(dropDownCustomFieldId); + + // Get the line item. + LineItem lineItem = lineItemService.getLineItem(lineItemId); + + // Create custom field values. + List customFieldValues = new List(); + TextValue textValue = new TextValue(); + textValue.value = "Custom field value"; + + CustomFieldValue customFieldValue = new CustomFieldValue(); + customFieldValue.customFieldId = customFieldId; + customFieldValue.value = textValue; + customFieldValues.Add(customFieldValue); + + DropDownCustomFieldValue dropDownCustomFieldValue = new DropDownCustomFieldValue(); + dropDownCustomFieldValue.customFieldId = dropDownCustomFieldId; + dropDownCustomFieldValue.customFieldOptionId = customFieldOptionId; + customFieldValues.Add(dropDownCustomFieldValue); + + // Only add existing custom field values for different custom fields than + // the ones you are setting. + if (lineItem.customFieldValues != null) { + foreach (BaseCustomFieldValue oldCustomFieldValue in lineItem.customFieldValues) { + if (!(oldCustomFieldValue.customFieldId == customFieldId) + && !(oldCustomFieldValue.customFieldId == dropDownCustomFieldId)) { + customFieldValues.Add(oldCustomFieldValue); + } + } + } + + lineItem.customFieldValues = customFieldValues.ToArray(); + + // Update the line item on the server. + LineItem[] lineItems = lineItemService.updateLineItems(new LineItem[] {lineItem}); + + if (lineItems != null) { + foreach (LineItem updatedLineItem in lineItems) { + List customFieldValueStrings = new List(); + foreach (BaseCustomFieldValue baseCustomFieldValue in lineItem.customFieldValues) { + if (baseCustomFieldValue is CustomFieldValue + && ((CustomFieldValue) baseCustomFieldValue).value is TextValue) { + customFieldValueStrings.Add("{ID: '" + baseCustomFieldValue.customFieldId + + "', value: '" + + ((TextValue) ((CustomFieldValue) baseCustomFieldValue).value).value + + "'}"); + } else if (baseCustomFieldValue is DropDownCustomFieldValue) { + customFieldValueStrings.Add("{ID: '" + baseCustomFieldValue.customFieldId + + "', custom field option ID: '" + + ((DropDownCustomFieldValue) baseCustomFieldValue).customFieldOptionId + + "'}"); + } + } + Console.WriteLine("A line item with ID \"{0}\" set with custom field values \"{1}\".", + updatedLineItem.id, string.Join(", ", customFieldValueStrings.ToArray())); + } + } else { + Console.WriteLine("No line items were updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CustomFieldService/UpdateCustomFields.cs b/examples/Dfp/CSharp/v201211/CustomFieldService/UpdateCustomFields.cs new file mode 100644 index 00000000000..f7deaa2224b --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CustomFieldService/UpdateCustomFields.cs @@ -0,0 +1,95 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using Google.Api.Ads.Dfp.Util.v201211; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example updates custom field descriptions. To determine which + /// custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.updateCustomFields + /// + class UpdateCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates custom field descriptions. To determine which custom " + + "fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201211.CustomFieldService); + + // Set the ID of the custom field to update. + long customFieldId = long.Parse(_T("INSERT_CUSTOM_FIELD_ID_HERE")); + + try { + // Get the custom field. + CustomField customField = customFieldService.getCustomField(customFieldId); + + if (customField != null) { + customField.description = + (customField.description == null ? "" : customField.description + " Updated"); + + // Update the custom field on the server. + CustomField[] customFields = + customFieldService.updateCustomFields(new CustomField[] {customField}); + + // Display results + if (customFields != null) { + foreach (CustomField updatedCustomField in customFields) { + Console.WriteLine("Custom field with ID \"{0}\", name \"{1}\", and description " + + "\"{2}\" was updated.", updatedCustomField.id, updatedCustomField.name, + updatedCustomField.description); + } + } else { + Console.WriteLine("No custom fields were updated."); + } + } else { + Console.WriteLine("No custom fields found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs b/examples/Dfp/CSharp/v201211/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs new file mode 100644 index 00000000000..34de8620ef5 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs @@ -0,0 +1,158 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates new custom targeting keys and values. To + /// determine which custom targeting keys and values exist, run + /// GetAllCustomTargetingKeysAndValues.cs. To target these custom targeting + /// keys and values, run TargetCustomCriteria.cs. + /// + /// Tags: CustomTargetingService.createCustomTargetingKeys + /// Tags: CustomTargetingService.createCustomTargetingValues + /// + class CreateCustomTargetingKeysAndValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new custom targeting keys and values. To determine " + + "which custom targeting keys and values exist, run " + + "GetAllCustomTargetingKeysAndValues.cs. To target these custom targeting keys and " + + "values, run TargetCustomCriteria.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomTargetingKeysAndValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201211.CustomTargetingService); + + // Create predefined key. + CustomTargetingKey genderKey = new CustomTargetingKey(); + genderKey.displayName = "gender"; + genderKey.name = "g"; + genderKey.type = CustomTargetingKeyType.PREDEFINED; + + // Create predefined key that may be used for content targeting. + CustomTargetingKey genreKey = new CustomTargetingKey(); + genreKey.displayName = "genre"; + genreKey.name = "genre"; + genreKey.type = CustomTargetingKeyType.PREDEFINED; + + // Create free-form key. + CustomTargetingKey carModelKey = new CustomTargetingKey(); + carModelKey.displayName = "car model"; + carModelKey.name = "c"; + carModelKey.type = CustomTargetingKeyType.FREEFORM; + + try { + // Create the custom targeting keys on the server. + CustomTargetingKey[] keys = customTargetingService.createCustomTargetingKeys( + new CustomTargetingKey[] {genderKey, genreKey, carModelKey}); + + if (keys != null) { + foreach (CustomTargetingKey key in keys) { + Console.WriteLine("A custom targeting key with ID \"{0}\", name \"{1}\", and display " + + "name \"{2}\" was created.", key.id, key.name, key.displayName); + } + } else { + Console.WriteLine("No keys were created."); + } + + // Create custom targeting value for the predefined gender key. + CustomTargetingValue genderMaleValue = new CustomTargetingValue(); + genderMaleValue.customTargetingKeyId = keys[0].id; + genderMaleValue.displayName = "male"; + // Name is set to 1 so that the actual name can be hidden from website + // users. + genderMaleValue.name = "1"; + genderMaleValue.matchType = CustomTargetingValueMatchType.EXACT; + + CustomTargetingValue genderFemaleValue = new CustomTargetingValue(); + genderFemaleValue.customTargetingKeyId = keys[0].id; + genderFemaleValue.displayName = "female"; + // Name is set to 2 so that the actual name can be hidden from website + // users. + genderFemaleValue.name = "2"; + genderFemaleValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create custom targeting value for the predefined genre key. + CustomTargetingValue genreComedyValue = new CustomTargetingValue(); + genreComedyValue.customTargetingKeyId = keys[1].id; + genreComedyValue.displayName = "comedy"; + genreComedyValue.name = "comedy"; + genreComedyValue.matchType = CustomTargetingValueMatchType.EXACT; + + CustomTargetingValue genreDramaValue = new CustomTargetingValue(); + genreDramaValue.customTargetingKeyId = keys[1].id; + genreDramaValue.displayName = "drama"; + genreDramaValue.name = "drama"; + genreDramaValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create custom targeting value for the free-form age key. These are + // values that would be suggested in the UI or can be used when + // targeting with a FreeFormCustomCriteria. + CustomTargetingValue carModelHondaCivicValue = new CustomTargetingValue(); + carModelHondaCivicValue.customTargetingKeyId = keys[2].id; + carModelHondaCivicValue.displayName = "honda civic"; + carModelHondaCivicValue.name = "honda civic"; + // Setting match type to exact will match exactly "honda civic". + carModelHondaCivicValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create the custom targeting values on the server. + CustomTargetingValue[] returnValues = customTargetingService.createCustomTargetingValues( + new CustomTargetingValue[] {genderMaleValue, genderFemaleValue, genreComedyValue, + genreDramaValue, carModelHondaCivicValue}); + + if (returnValues != null) { + foreach (CustomTargetingValue value in returnValues) { + Console.WriteLine("A custom targeting value with ID \"{0}\", belonging to key with " + + "ID \"{1}\", name \"{2}\", and display name \"{3}\" was created.", value.id, + value.customTargetingKeyId, value.name, value.displayName); + } + } else { + Console.WriteLine("No values were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom targeting keys and values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs b/examples/Dfp/CSharp/v201211/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs new file mode 100644 index 00000000000..60ece73d4de --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs @@ -0,0 +1,122 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all custom targeting keys and the values. To create + /// custom targeting keys and values, run + /// CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// + class GetAllCustomTargetingKeysAndValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom targeting keys and the values. To create " + + "custom targeting keys and values, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCustomTargetingKeysAndValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201211.CustomTargetingService); + + // Sets defaults for page and filter. + CustomTargetingKeyPage keyPage = new CustomTargetingKeyPage(); + Statement keyFilterStatement = new Statement(); + int keyOffset = 0; + + try { + do { + // Create a statement to get all custom targeting keys. + keyFilterStatement.query = "LIMIT 500 OFFSET " + keyOffset; + + // Get custom targeting keys by statement. + keyPage = customTargetingService.getCustomTargetingKeysByStatement(keyFilterStatement); + + if (keyPage.results != null) { + int i = keyPage.startIndex; + foreach (CustomTargetingKey key in keyPage.results) { + Console.WriteLine("{0}) Custom targeting key with ID \"{1}\", name \"{2}\", " + + "display name \"{3}\", and type \"{4}\" was found.", i, key.id, key.name, + key.displayName, key.type); + + + // Sets defaults for page and filter. + CustomTargetingValuePage valuePage = new CustomTargetingValuePage(); + Statement valueFilterStatement = new Statement(); + int valueOffset = 0; + + do { + // Create a statement to get all custom targeting values for a + // custom targeting key (required) by its ID. + valueFilterStatement.query = string.Format("WHERE customTargetingKeyId = {0} " + + "LIMIT 500 OFFSET {1}", key.id, valueOffset); + + // Get custom targeting values by statement. + valuePage = customTargetingService.getCustomTargetingValuesByStatement( + valueFilterStatement); + + if (valuePage.results != null) { + int j = valuePage.startIndex; + foreach (CustomTargetingValue value in valuePage.results) { + Console.WriteLine("\t{0}) Custom targeting value with ID \"{1}\", name " + + "\"{2}\", and display name \"{3}\" was found.", j, value.id, value.name, + value.displayName); + j++; + } + } + valueOffset += 500; + } while (valuePage.results != null && valuePage.results.Length == 500); + i++; + } + } + keyOffset += 500; + } while (keyPage.results != null && keyPage.results.Length == 500); + Console.WriteLine("Number of results found: {0}", keyPage.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get custom targeting keys and the values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CustomTargetingService/GetCustomTargetingKeysByStatement.cs b/examples/Dfp/CSharp/v201211/CustomTargetingService/GetCustomTargetingKeysByStatement.cs new file mode 100644 index 00000000000..ed88cccc09d --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CustomTargetingService/GetCustomTargetingKeysByStatement.cs @@ -0,0 +1,88 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all predefined custom targeting keys. The statement + /// retrieves up to the maximum page size limit of 500. To create custom + /// targeting keys, run CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// + class GetCustomTargetingKeysByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all predefined custom targeting keys. The statement " + + "retrieves up to the maximum page size limit of 500. To create custom " + + "targeting keys, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCustomTargetingKeysByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201211.CustomTargetingService); + + try { + // Create a statement to only select predefined custom targeting keys. + Statement filterStatement = new StatementBuilder("WHERE type = :type LIMIT 500").AddValue( + "type", CustomTargetingKeyType.PREDEFINED.ToString()).ToStatement(); + + // Get custom targeting keys by statement. + CustomTargetingKeyPage page = + customTargetingService.getCustomTargetingKeysByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomTargetingKey customTargetingKey in page.results) { + Console.WriteLine("{0}) Custom targeting key with ID \"{1}\", name \"{2}\", and " + + "display name \"{3}\" was found.", i, customTargetingKey.id, + customTargetingKey.name, customTargetingKey.displayName); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get predefined custom targeting keys. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CustomTargetingService/GetCustomTargetingValuesByStatement.cs b/examples/Dfp/CSharp/v201211/CustomTargetingService/GetCustomTargetingValuesByStatement.cs new file mode 100644 index 00000000000..409d50b944c --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CustomTargetingService/GetCustomTargetingValuesByStatement.cs @@ -0,0 +1,99 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets custom targeting values for the given predefined + /// custom targeting key. The statement retrieves up to the maximum page size + /// limit of 500. To create custom targeting values, run + /// CreateCustomTargetingKeysAndValues.cs. To determine which custom + /// targeting keys exist, run GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// + class GetCustomTargetingValuesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets custom targeting values for the given predefined custom " + + "targeting key. The statement retrieves up to the maximum page size limit of 500. " + + "To create custom targeting values, run CreateCustomTargetingKeysAndValues.cs. To " + + "determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCustomTargetingValuesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201211.CustomTargetingService); + + // Set the ID of the custom targeting key to get custom targeting values + // for. + long customTargetingKeyId = long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + + // Create a statement to only select custom targeting values for a given + // key. + Statement filterStatement = + new StatementBuilder("WHERE customTargetingKeyId = :customTargetingKeyId LIMIT 500") + .AddValue("customTargetingKeyId", customTargetingKeyId).ToStatement(); + + try { + // Get custom targeting values by statement. + CustomTargetingValuePage page = + customTargetingService.getCustomTargetingValuesByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomTargetingValue customTargetingValue in page.results) { + Console.WriteLine("{0}) Custom targeting value with ID \"{1}\", name \"{2}\", and " + + "display name \"{3}\" was found.", i, customTargetingValue.id, + customTargetingValue.name, customTargetingValue.displayName); + i++; + } + } + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get custom targeting values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CustomTargetingService/UpdateCustomTargetingKeys.cs b/examples/Dfp/CSharp/v201211/CustomTargetingService/UpdateCustomTargetingKeys.cs new file mode 100644 index 00000000000..05a224dba6d --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CustomTargetingService/UpdateCustomTargetingKeys.cs @@ -0,0 +1,107 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example updates the display name of each custom targeting key up + /// to the first 500. To determine which custom targeting keys exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// Tags: CustomTargetingService.updateCustomTargetingKeys + /// + class UpdateCustomTargetingKeys : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the display name of each custom targeting key up " + + "to the first 500. To determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomTargetingKeys(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201211.CustomTargetingService); + + // Create a statement to get all custom targeting keys. + Statement filterStatement = new Statement(); + filterStatement.query = "LIMIT 500"; + + try { + // Get custom targeting keys by statement. + CustomTargetingKeyPage page = + customTargetingService.getCustomTargetingKeysByStatement(filterStatement); + + if (page.results != null) { + CustomTargetingKey[] customTargetingKeys = page.results; + + // Update each local custom targeting key object by changing its display + // name. + foreach (CustomTargetingKey customTargetingKey in customTargetingKeys) { + if (customTargetingKey.displayName == null) { + customTargetingKey.displayName = customTargetingKey.name; + } + customTargetingKey.displayName = customTargetingKey.displayName + " (Deprecated)"; + } + + // Update the custom targeting keys on the server. + customTargetingKeys = + customTargetingService.updateCustomTargetingKeys(customTargetingKeys); + + if (customTargetingKeys != null) { + foreach (CustomTargetingKey customTargetingKey in customTargetingKeys) { + Console.WriteLine("Custom targeting key with ID \"{0}\", name \"{1}\", and " + + "display name \"{2}\" was updated.", customTargetingKey.id, + customTargetingKey.name, customTargetingKey.displayName); + } + } else { + Console.WriteLine("No custom targeting keys updated."); + } + } else { + Console.WriteLine("No custom targeting keys found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update display name of custom targeting keys. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/CustomTargetingService/UpdateCustomTargetingValues.cs b/examples/Dfp/CSharp/v201211/CustomTargetingService/UpdateCustomTargetingValues.cs new file mode 100644 index 00000000000..17e7a5a4c72 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/CustomTargetingService/UpdateCustomTargetingValues.cs @@ -0,0 +1,113 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example updates the display name of each custom targeting value + /// up to the first 500. To determine which custom targeting keys exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// Tags: CustomTargetingService.updateCustomTargetingValues + /// + class UpdateCustomTargetingValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the display name of each custom targeting value up to " + + "the first 500. To determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomTargetingValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201211.CustomTargetingService); + + // Set the ID of the predefined custom targeting key to get custom + // targeting values for. + long customTargetingKeyId = long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + + // Create a statement to only select predefined custom targeting values + // for a given key. + Statement filterStatement = + new StatementBuilder("WHERE customTargetingKeyId = :customTargetingKeyId LIMIT 500") + .AddValue("customTargetingKeyId", customTargetingKeyId).ToStatement(); + + try { + // Get custom targeting values by statement. + CustomTargetingValuePage page = + customTargetingService.getCustomTargetingValuesByStatement(filterStatement); + + if (page.results != null) { + CustomTargetingValue[] customTargetingValues = page.results; + + // Update each local custom targeting value object by changing its + // display name. + foreach (CustomTargetingValue customTargetingValue in customTargetingValues) { + if (customTargetingValue.displayName == null) { + customTargetingValue.displayName = customTargetingValue.displayName; + } + customTargetingValue.displayName = customTargetingValue.displayName + " (Deprecated)"; + } + + // Update the custom targeting values on the server. + customTargetingValues = + customTargetingService.updateCustomTargetingValues(customTargetingValues); + + if (customTargetingValues != null) { + foreach (CustomTargetingValue customTargetingValue in customTargetingValues) { + Console.WriteLine("Custom targeting value with ID \"{0}\", name \"{1}\", and " + + "display name \"{2}\" was updated.", customTargetingValue.id, + customTargetingValue.name, customTargetingValue.displayName); + } + } else { + Console.WriteLine("No custom targeting values updated."); + } + } else { + Console.WriteLine("No custom targeting values found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update display names of custom targeting values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/ForecastService/GetForecast.cs b/examples/Dfp/CSharp/v201211/ForecastService/GetForecast.cs new file mode 100644 index 00000000000..69c71d55ba0 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/ForecastService/GetForecast.cs @@ -0,0 +1,111 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets a forecast for a prospective line item. To + /// determine which placements exist, run GetAllPlacements.cs. + /// + /// Tags: ForecastService.getForecast + /// + class GetForecast : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a forecast for a prospective line item. To determine " + + "which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetForecast(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ForecastService. + ForecastService forecastService = + (ForecastService)user.GetService(DfpService.v201211.ForecastService); + + // Set the placement that the prospective line item will target. + long[] targetPlacementIds = new long[] {long.Parse(_T("INSERT_PLACEMENT_ID_HERE"))}; + + // Set the end date time to have the line line item run till. + string endDateTime = "INSERT_END_DATE_TIME_HERE (yyyyMMdd HH:mm:ss)"; + + // Create prospective line item. + LineItem lineItem = new LineItem(); + + lineItem.targeting = new Targeting(); + lineItem.targeting.inventoryTargeting = new InventoryTargeting(); + lineItem.targeting.inventoryTargeting.targetedPlacementIds = targetPlacementIds; + + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + lineItem.lineItemType = LineItemType.SPONSORSHIP; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + + lineItem.endDateTime = DateTimeUtilities.FromString(endDateTime); + + // Set the cost type to match the unit type. + lineItem.costType = CostType.CPM; + + try { + // Get forecast. + Forecast forecast = forecastService.getForecast(lineItem); + + // Display results. + long matched = forecast.matchedUnits; + double availablePercent = (double) (forecast.availableUnits / (matched * 1.0)) * 100; + String unitType = forecast.unitType.ToString().ToLower(); + Console.WriteLine("{0} {1} matched.\n{2}% available.", matched, unitType, + availablePercent, unitType); + + if (forecast.possibleUnitsSpecified) { + double possiblePercent = (double) (forecast.possibleUnits / (matched * 1.0)) * 100; + Console.WriteLine("{0}% {1} possible.\n", possiblePercent, unitType); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get forecast. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/ForecastService/GetForecastById.cs b/examples/Dfp/CSharp/v201211/ForecastService/GetForecastById.cs new file mode 100644 index 00000000000..3874a3b5233 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/ForecastService/GetForecastById.cs @@ -0,0 +1,82 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets a forecast for an existing line item. To determine + /// which line items exist, run GetAllLineItems.cs. + /// + /// Tags: ForecastService.getForecastById + /// + class GetForecastById : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a forecast for an existing line item. To determine which " + + "line items exist, run GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetForecastById(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ForecastService. + ForecastService forecastService = + (ForecastService) user.GetService(DfpService.v201211.ForecastService); + + // Set the line item to get a forecast for. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get forecast for line item. + Forecast forecast = forecastService.getForecastById(lineItemId); + + // Display results. + long matched = forecast.matchedUnits; + double availablePercent = (double) (forecast.availableUnits / (matched * 1.0)) * 100; + String unitType = forecast.unitType.ToString().ToLower(); + + Console.WriteLine("{0} {1} matched.\n{2} % {3} available.", matched, unitType, + availablePercent, unitType); + if (forecast.possibleUnitsSpecified) { + double possiblePercent = (double) (forecast.possibleUnits / (matched * 1.0)) * 100; + Console.WriteLine(possiblePercent + "% " + unitType + " possible.\n"); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get forecast by id. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/InventoryService/CreateAdUnits.cs b/examples/Dfp/CSharp/v201211/InventoryService/CreateAdUnits.cs new file mode 100644 index 00000000000..b6635a13d04 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/InventoryService/CreateAdUnits.cs @@ -0,0 +1,108 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates new ad units under the effective root ad unit. + /// To determine which ad units exist, run GetAdUnitTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.createAdUnits, NetworkService.getCurrentNetwork + /// + class CreateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new ad units under the effective root ad unit. To " + + "determine which ad units exist, run GetAdUnitTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201211.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201211.NetworkService); + + string effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create an array to store local ad unit objects. + AdUnit[] adUnits = new AdUnit[5]; + + for (int i = 0; i < 5; i++) { + AdUnit adUnit = new AdUnit(); + adUnit.name = string.Format("Ad_Unit_{0}", i); + adUnit.parentId = effectiveRootAdUnitId; + + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + + // Set the size of possible creatives that can match this ad unit. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + adUnits[i] = adUnit; + } + + try { + // Create the ad units on the server. + adUnits = inventoryService.createAdUnits(adUnits); + + if (adUnits != null) { + foreach (AdUnit adUnit in adUnits) { + Console.WriteLine("An ad unit with ID = '{0}' was created under parent with " + + "ID = '{1}'.", adUnit.id, adUnit.parentId); + } + } else { + Console.WriteLine("No ad units created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/InventoryService/CreateMobileAdUnit.cs b/examples/Dfp/CSharp/v201211/InventoryService/CreateMobileAdUnit.cs new file mode 100644 index 00000000000..97e9ac388a5 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/InventoryService/CreateMobileAdUnit.cs @@ -0,0 +1,104 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates a new mobile ad unit under the effective root + /// ad unit. Mobile features need to be enabled on your account to use mobile + /// targeting. To determine which ad units exist, run GetInventoryTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.createAdUnits, NetworkService.getCurrentNetwork + /// + class CreateMobileAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new mobile ad unit under the effective ad unit. " + + "Mobile features need to be enabled on your account to use mobile targeting. To " + + "determine which ad units exist, run GetInventoryTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateMobileAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201211.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201211.NetworkService); + + // Set the parent ad unit's ID for all ad units to be created under. + String effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create local ad unit object. + AdUnit adUnit = new AdUnit(); + adUnit.name = "Mobile_Ad_Unit"; + adUnit.parentId = effectiveRootAdUnitId; + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + adUnit.targetPlatform = TargetPlatform.MOBILE; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + Size size = new Size(); + size.width = 400; + size.height = 300; + size.isAspectRatio = false; + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + // Set the size of possible creatives that can match this ad unit. + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + + try { + // Create the ad unit on the server. + adUnit = inventoryService.createAdUnit(adUnit); + + if (adUnit != null) { + Console.WriteLine("An ad unit with ID \"{0}\" was created under parent with ID \"{1}\".", + adUnit.id, adUnit.parentId); + } else { + Console.WriteLine("No ad units created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/InventoryService/CreateVideoAdUnit.cs b/examples/Dfp/CSharp/v201211/InventoryService/CreateVideoAdUnit.cs new file mode 100644 index 00000000000..0cd9c714cce --- /dev/null +++ b/examples/Dfp/CSharp/v201211/InventoryService/CreateVideoAdUnit.cs @@ -0,0 +1,123 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates a new video ad unit under the effective root + /// ad unit. To determine which ad units exist, run GetInventoryTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.CreateVideoAdUnit, NetworkService.getCurrentNetwork + /// + class CreateVideoAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new ad units under the effective root ad unit. To " + + "determine which ad units exist, run GetAdUnitTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateVideoAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201211.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201211.NetworkService); + + // Set the parent ad unit's ID for all ad units to be created under. + String effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create local ad unit object. + AdUnit adUnit = new AdUnit(); + adUnit.name = "Video_Ad_Unit"; + adUnit.parentId = effectiveRootAdUnitId; + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + adUnit.explicitlyTargeted = true; + adUnit.targetPlatform = TargetPlatform.WEB; + + // Create master ad unit size. + AdUnitSize masterAdUnitSize = new AdUnitSize(); + Size size1 = new Size(); + size1.width = 400; + size1.height = 300; + size1.isAspectRatio = false; + masterAdUnitSize.size = size1; + masterAdUnitSize.environmentType = EnvironmentType.VIDEO_PLAYER; + + // Create companion sizes. + AdUnitSize companionAdUnitSize1 = new AdUnitSize(); + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + size2.isAspectRatio = false; + companionAdUnitSize1.size = size2; + companionAdUnitSize1.environmentType = EnvironmentType.BROWSER; + + AdUnitSize companionAdUnitSize2 = new AdUnitSize(); + Size size3 = new Size(); + size3.width = 728; + size3.height = 90; + size3.isAspectRatio = false; + companionAdUnitSize2.size = size3; + companionAdUnitSize2.environmentType = EnvironmentType.BROWSER; + + // Add companions to master ad unit size. + masterAdUnitSize.companions = new AdUnitSize[] {companionAdUnitSize1, companionAdUnitSize2}; + + // Set the size of possible creatives that can match this ad unit. + adUnit.adUnitSizes = new AdUnitSize[] {masterAdUnitSize}; + + try { + // Create the ad unit on the server. + adUnit = inventoryService.createAdUnit(adUnit); + + if (adUnit != null) { + Console.WriteLine("A video ad unit with ID \"{0}\" was created under parent with ID " + + "\"{1}\".", adUnit.id, adUnit.parentId); + } else { + Console.WriteLine("No video ad units created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create video ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/InventoryService/DeActivateAdUnits.cs b/examples/Dfp/CSharp/v201211/InventoryService/DeActivateAdUnits.cs new file mode 100644 index 00000000000..8324f3f181f --- /dev/null +++ b/examples/Dfp/CSharp/v201211/InventoryService/DeActivateAdUnits.cs @@ -0,0 +1,120 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example deactivates all active ad units. To determine which ad + /// units exist, run GetAllAdUnits.cs or GetInventoryTree.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: InventoryService.performAdUnitAction + /// + class DeActivateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active ad units. To determine which ad units " + + "exist, run GetAllAdUnits.cs or GetInventoryTree.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeActivateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201211.InventoryService); + + // Create Statement text to select active ad units. + string statementText = "WHERE status = :status LIMIT 500"; + + Statement statement = new StatementBuilder("").AddValue("status", + InventoryStatus.ACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + AdUnitPage page = new AdUnitPage(); + int offset = 0; + List adUnitIds = new List(); + + try { + do { + // Create a Statement to page through active ad units. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID ='{1}', name = {2} and status = {3} will" + + " be deactivated.", i, adUnit.id, adUnit.name, adUnit.status); + adUnitIds.Add(adUnit.id); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of ad units to be deactivated: {0}", adUnitIds.Count); + + if (adUnitIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", adUnitIds.ToArray()))). + ToStatement(); + + // Create action. + DeactivateAdUnits action = new DeactivateAdUnits(); + + // Perform action. + UpdateResult result = inventoryService.performAdUnitAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of ad units deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No ad units were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/InventoryService/GetAdUnit.cs b/examples/Dfp/CSharp/v201211/InventoryService/GetAdUnit.cs new file mode 100644 index 00000000000..004f2412cc4 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/InventoryService/GetAdUnit.cs @@ -0,0 +1,77 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets an ad unit by its ID. To determine which ad units + /// exist, run GetInventoryTree.cs or GetAllAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnit + /// + class GetAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets an ad unit by its ID. To determine which ad units " + + "exist, run GetInventoryTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201211.InventoryService); + + // Set the ID of the ad unit to get. + String adUnitId = _T("INSERT_AD_UNIT_ID_HERE"); + + try { + // Get the ad unit. + AdUnit adUnit = inventoryService.getAdUnit(adUnitId); + + if (adUnit != null) { + Console.WriteLine("Ad unit with ID = '{0}', name = '{1}' and status = '{2}' was found.", + adUnit.id, adUnit.name, adUnit.status); + } else { + Console.WriteLine("No ad unit found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/InventoryService/GetAdUnitSizes.cs b/examples/Dfp/CSharp/v201211/InventoryService/GetAdUnitSizes.cs new file mode 100644 index 00000000000..9f907755384 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/InventoryService/GetAdUnitSizes.cs @@ -0,0 +1,80 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; +using Google.Api.Ads.Dfp.Util.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all web target platform ad unit sizes. + /// + /// Tags: InventoryService.getAdUnitSizesByStatement + /// + class GetAdUnitSizes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all web target platform ad unit sizes."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnitSizes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201211.InventoryService); + + Statement filterStatement = new StatementBuilder("WHERE targetPlatform = :targetPlatform"). + AddValue("targetPlatform", "WEB").ToStatement(); + + try { + // Get all ad unit sizes. + AdUnitSize[] adUnitSizes = inventoryService.getAdUnitSizesByStatement(filterStatement); + + // Display results. + if (adUnitSizes != null) { + for (int i = 0; i < adUnitSizes.Length; i++) { + AdUnitSize adUnitSize = adUnitSizes[i]; + Console.WriteLine("{0}) Ad unit size ({1}x{2}) was found.\n", i, + adUnitSize.size.width, adUnitSize.size.height); + } + } else { + Console.WriteLine("No ad unit sizes found."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit sizes. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/InventoryService/GetAdUnitsByStatement.cs b/examples/Dfp/CSharp/v201211/InventoryService/GetAdUnitsByStatement.cs new file mode 100644 index 00000000000..83bbcc04640 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/InventoryService/GetAdUnitsByStatement.cs @@ -0,0 +1,93 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets the root ad unit. To create an ad unit, run + /// CreateAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: NetworkService.getCurrentNetwork + /// + class GetAdUnitsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the root ad unit. To create an ad unit, run " + + "CreateAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnitsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201211.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201211.NetworkService); + + // Get the effective root ad unit ID of the network. + string effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create a statement to select the children of the effective root ad + // unit. + Statement statement = new StatementBuilder("WHERE parentId = :id LIMIT 1").AddValue( + "id", effectiveRootAdUnitId).ToStatement(); + + try { + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID = '{1}', name = '{2}' and status = '{3}' " + + "was found.", i, adUnit.id, adUnit.name, adUnit.status); + i++; + } + } + + // The number of results should always be 1 for this code example. + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/InventoryService/GetAllAdUnits.cs b/examples/Dfp/CSharp/v201211/InventoryService/GetAllAdUnits.cs new file mode 100644 index 00000000000..651e15f0a39 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/InventoryService/GetAllAdUnits.cs @@ -0,0 +1,88 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all ad units. To create ad units, run + /// CreateAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// + class GetAllAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all ad units. To create ad units, run CreateAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201211.InventoryService); + + // Sets defaults for page and statement. + AdUnitPage page = new AdUnitPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all ad units. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID = '{1}', name = '{2}' and status = '{3}' " + + "was found.", i, adUnit.id, adUnit.name, adUnit.status); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/InventoryService/GetInventoryTree.cs b/examples/Dfp/CSharp/v201211/InventoryService/GetInventoryTree.cs new file mode 100644 index 00000000000..de298b4e86a --- /dev/null +++ b/examples/Dfp/CSharp/v201211/InventoryService/GetInventoryTree.cs @@ -0,0 +1,203 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example retrieves a previously created ad units and creates + /// a tree. + /// + /// Tags: InventoryService.getAdUnit, InventoryService.getAdUnitsByStatement + /// + class GetInventoryTree : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves a previously created ad units and creates a tree."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetInventoryTree(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + try { + // Get all ad units. + AdUnit[] allAdUnits = GetAllAdUnits(user); + + // Find the root ad unit. rootAdUnit can also be set to child unit to + // only build and display a portion of the tree. + // i.e. AdUnit adUnit = + // inventoryService.getAdUnit("INSERT_AD_UNIT_HERE") + AdUnit rootAdUnit = FindRootAdUnit(user); + + if (rootAdUnit == null) { + Console.WriteLine("Could not build tree. No root ad unit found."); + } else { + BuildAndDisplayAdUnitTree(rootAdUnit, allAdUnits); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + + /// + /// Gets all ad units for this user. + /// + /// The DfpUser to get the ad units for. + /// All ad units for this user. + private static AdUnit[] GetAllAdUnits(DfpUser user) { + // Create list to hold all ad units. + List adUnits = new List(); + + // Get InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201211.InventoryService); + + // Sets defaults for page and Statement. + AdUnitPage page = new AdUnitPage(); + Statement statement = new Statement(); + int offset = 0; + + do { + // Create a Statement to get all ad units. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + adUnits.AddRange(page.results); + } + offset += 500; + } while (page.results != null && page.results.Length == 500); + return adUnits.ToArray(); + } + + /// + /// Finds the root ad unit for the user. + /// + /// The DfpUser to get the root ad unit for. + /// The ad unit representing the root ad unit or null if one + /// is not found. + private static AdUnit FindRootAdUnit(DfpUser user) { + // Get InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201211.InventoryService); + + // Create a Statement to only select the root ad unit. + Statement statement = new Statement(); + statement.query = "WHERE parentId IS NULL LIMIT 500"; + + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + return page.results[0]; + } + return null; + } + + /// + /// Builds and displays an ad unit tree from an array of ad units underneath + /// the root ad unit. + /// + /// The root ad unit to build the tree under. + /// The array of ad units. + private static void BuildAndDisplayAdUnitTree(AdUnit root, AdUnit[] units) { + Dictionary> treeMap = new Dictionary>(); + + foreach (AdUnit unit in units) { + if (unit.parentId != null) { + if (treeMap.ContainsKey(unit.parentId) == false) { + treeMap.Add(unit.parentId, new List()); + } + treeMap[unit.parentId].Add(unit); + } + } + + if (root != null) { + DisplayInventoryTree(root, treeMap); + } else { + Console.WriteLine("No root unit found."); + } + } + + /// + /// Displays the ad unit tree beginning at the root ad unit. + /// + /// The root ad unit + /// The map of id to list of ad units + private static void DisplayInventoryTree(AdUnit root, Dictionary> treeMap) { + DisplayInventoryTreeHelper(root, treeMap, 0); + } + + /// + /// Helper for displaying inventory units. + /// + /// The root inventory unit. + /// The map of id to List of inventory units. + /// The depth the tree has reached. + private static void DisplayInventoryTreeHelper(AdUnit root, + Dictionary> treeMap, int depth) { + Console.WriteLine(GenerateTab(depth) + root.name + " (" + root.id + ")"); + + if (treeMap.ContainsKey(root.id)) { + foreach (AdUnit child in treeMap[root.id]) { + DisplayInventoryTreeHelper(child, treeMap, depth + 1); + } + } + } + + /// + /// Generates a String of tabs to represent branching to children. + /// + /// A depth from 0 to max(depth). + /// A string to insert in front of the root unit. + private static String GenerateTab(int depth) { + StringBuilder builder = new StringBuilder(); + if (depth != 0) { + builder.Append(" "); + } + + for (int i = 1; i < depth; i++) { + builder.Append("| "); + } + builder.Append("+--"); + return builder.ToString(); + } + } +} diff --git a/examples/Dfp/CSharp/v201211/InventoryService/UpdateAdUnits.cs b/examples/Dfp/CSharp/v201211/InventoryService/UpdateAdUnits.cs new file mode 100644 index 00000000000..ef15e69caeb --- /dev/null +++ b/examples/Dfp/CSharp/v201211/InventoryService/UpdateAdUnits.cs @@ -0,0 +1,92 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example updates an ad unit by enabling AdSense to the first + /// 500. To determine which ad units exist, run GetAllAdUnits.cs or + /// GetInventoryTree.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement, InventoryService.updateAdUnits + /// + class UpdateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates an ad unit by enabling AdSense to the first 500. To " + + "determine which ad units exist, run GetAllAdUnits.cs or GetInventoryTree.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the sample code. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201211.InventoryService); + + // Create a statement to get all ad units. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get ad units by statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null) { + // Update each local ad unit object by enabling AdSense. + foreach (AdUnit adUnit in page.results) { + adUnit.inheritedAdSenseSettings.value.adSenseEnabled = true; + } + + // Update the ad units on the server. + AdUnit[] updatedAdUnits = inventoryService.updateAdUnits(page.results); + + if (updatedAdUnits != null) { + foreach (AdUnit adUnit in updatedAdUnits) { + Console.WriteLine("Ad unit with ID \"{0}\", name \"{1}\", and is AdSense enabled " + + "\"{2}\" was updated.", adUnit.id, adUnit.name, + adUnit.inheritedAdSenseSettings.value.adSenseEnabled); + } + } else { + Console.WriteLine("No ad units updated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to update ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LabelService/CreateLabels.cs b/examples/Dfp/CSharp/v201211/LabelService/CreateLabels.cs new file mode 100644 index 00000000000..14db20e91a2 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LabelService/CreateLabels.cs @@ -0,0 +1,93 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates new labels. To determine which labels exist, run + /// GetAllLabels.cs. This feature is only available to DFP premium solution + /// networks. + /// + /// Tags: LabelService.createLabels + /// + class CreateLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new labels. To determine which labels exist, run " + + "GetAllLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201211.LabelService); + + try { + // Create an array to store local label objects. + Label[] labels = new Label[5]; + + for (int i = 0; i < 5; i++) { + Label label = new Label(); + label.name = "Label #" + GetTimeStamp(); + label.types = new LabelType[] {LabelType.COMPETITIVE_EXCLUSION}; + labels[i] = label; + } + + // Create the labels on the server. + labels = labelService.createLabels(labels); + + if (labels != null) { + foreach (Label label in labels) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("A label with ID '{0}', name '{1}', and type '{2}' was created.", + label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + } + } else { + Console.WriteLine("No labels created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LabelService/DeactivateActiveLabels.cs b/examples/Dfp/CSharp/v201211/LabelService/DeactivateActiveLabels.cs new file mode 100644 index 00000000000..b9224910115 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LabelService/DeactivateActiveLabels.cs @@ -0,0 +1,116 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example deactivates all active labels. To determine which labels + /// exist, run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement, LabelService.performLabelAction + /// + class DeactivateActiveLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active labels. To determine which labels exist," + + " run GetAllLabels.cs. This feature is only available to DFP premium solution " + + "networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateActiveLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201211.LabelService); + + // Create statement text to select active labels. + String statementText = "WHERE isActive = :isActive LIMIT 500"; + Statement filterStatement = new StatementBuilder("").AddValue("isActive", true).ToStatement(); + + // Set defaults for page and offset. + LabelPage page = new LabelPage(); + int offset = 0; + List labelIds = new List(); + + try { + do { + // Create a statement to page through active labels. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get labels by statement. + page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + Console.WriteLine("{0}) Label with ID '{1}', name '{2}' will be deactivated.", + i, label.id, label.name); + labelIds.Add(label.id.ToString()); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of labels to be deactivated: " + labelIds.Count); + + if (labelIds.Count > 0) { + // Modify statement for action. + filterStatement.query = "WHERE id IN (" + string.Join(", ", labelIds.ToArray()) + ")"; + + // Create action. + DeactivateLabels action = new DeactivateLabels(); + + // Perform action. + UpdateResult result = labelService.performLabelAction(action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of labels deactivated: " + result.numChanges); + } else { + Console.WriteLine("No labels were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LabelService/GetAllLabels.cs b/examples/Dfp/CSharp/v201211/LabelService/GetAllLabels.cs new file mode 100644 index 00000000000..c2b82349a67 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LabelService/GetAllLabels.cs @@ -0,0 +1,93 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all labels. To create labels, run CreateLabels.cs. + /// This feature is only available to DFP premium solution networks. + /// + /// Tags: LabelService.getLabelsByStatement + /// + class GetAllLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all labels. To create labels, run CreateLabels.cs. This " + + "feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201211.LabelService); + + // Set defaults for page and filterStatement. + LabelPage page = new LabelPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all labels. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get labels by statement. + page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("{0}) Label with ID '{1}', name '{2}' and type '{3}' was found.", + i, label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LabelService/GetLabel.cs b/examples/Dfp/CSharp/v201211/LabelService/GetLabel.cs new file mode 100644 index 00000000000..393d7770363 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LabelService/GetLabel.cs @@ -0,0 +1,83 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets a label by its ID. To determine which labels exist, + /// run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabel + /// + class GetLabel : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a label by its ID. To determine which labels exist, " + + "run GetAllLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLabel(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201211.LabelService); + + // Set the ID of the label to get. + long labelId = long.Parse(_T("INSERT_LABEL_ID_HERE")); + + try { + // Get the label. + Label label = labelService.getLabel(labelId); + + if (label != null) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + Console.WriteLine("Label with ID '{0}, name '{1}' and type '{2}' was found.", + label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + } else { + Console.WriteLine("No label found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get label. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LabelService/GetLabelsByStatement.cs b/examples/Dfp/CSharp/v201211/LabelService/GetLabelsByStatement.cs new file mode 100644 index 00000000000..a66c2ea47b7 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LabelService/GetLabelsByStatement.cs @@ -0,0 +1,92 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all labels that are competitively excluded. The + /// statement retrieves up to the maximum page size limit of 500. To create + /// labels, run CreateLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement + /// + class GetLabelsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all labels that are competitively excluded. The statement " + + "retrieves up to the maximum page size limit of 500. To create labels, run " + + "CreateLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLabelsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201211.LabelService); + + // Create a statement to only select labels that are competitive + // sorted by name. + Statement filterStatement = new StatementBuilder("WHERE type = :type ORDER BY name LIMIT 500") + .AddValue("type", LabelType.COMPETITIVE_EXCLUSION.ToString()).ToStatement(); + + try { + // Get labels by statement. + LabelPage page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("{0}) Label with ID '{1}', name '{2}'and type '{3}' was found.", + i, label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LabelService/UpdateLabels.cs b/examples/Dfp/CSharp/v201211/LabelService/UpdateLabels.cs new file mode 100644 index 00000000000..51b752d79d2 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LabelService/UpdateLabels.cs @@ -0,0 +1,99 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example updates the descriptions of all active labels by + /// updating its description up to the first 500. To determine which labels + /// exist, run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement, LabelService.updateLabels + /// + class UpdateLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the descriptions of all active labels by updating " + + "its description up to the first 500. To determine which labels exist, run " + + "GetAllLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201211.LabelService); + + // Create a statement to only select labels that are competitive + // exclusion. + Statement filterStatement = new StatementBuilder("WHERE isActive = :isActive LIMIT 500"). + AddValue("isActive", true).ToStatement(); + + try { + // Get the labels by statement. + LabelPage page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + Label[] labels = page.results; + + // Update each local label object by updating its description. + foreach (Label label in labels) { + label.description = "These labels are still competiting with each other."; + } + + // Update the labels on the server. + labels = labelService.updateLabels(labels); + + if (labels != null) { + foreach (Label label in labels) { + Console.WriteLine("A label with ID '{0}' and name '{1}' was updated.", + label.id, label.name); + } + } else { + Console.WriteLine("No labels updated."); + } + } else { + Console.WriteLine("No labels found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/ActivateLicas.cs b/examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/ActivateLicas.cs new file mode 100644 index 00000000000..280964981ee --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/ActivateLicas.cs @@ -0,0 +1,125 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example activates all deactivated LICAs for the line item. To + /// determine which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.performLineItemCreativeAssociationAction + /// + class ActivateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example activates all deactivated LICAs for the line item. To " + + "determine which LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ActivateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201211.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + String statementText = "WHERE lineItemId = :lineItemId and status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("lineItemId", lineItemId). + AddValue("status", LineItemCreativeAssociationStatus.INACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + int offset = 0; + List creativeIds = new List(); + + try { + do { + // Create a Statement to page through active LICAs. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' will be activated.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + creativeIds.Add(lica.creativeId.ToString()); + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of LICAs to be activated: {0}", creativeIds.Count); + + if (creativeIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE lineItemId = :lineItemId and creativeId IN ({0})", + string.Join(",", creativeIds.ToArray()))). + AddValue("lineItemId", lineItemId).ToStatement(); + + // Create action. + ActivateLineItemCreativeAssociations action = + new ActivateLineItemCreativeAssociations(); + + // Perform action. + UpdateResult result = + licaService.performLineItemCreativeAssociationAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of LICAs activated: {0}", result.numChanges); + } else { + Console.WriteLine("No LICAs were activated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to activate LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/CreateLicas.cs b/examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/CreateLicas.cs new file mode 100644 index 00000000000..e0a004ebed1 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/CreateLicas.cs @@ -0,0 +1,108 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates new line item creative associations (LICAs) for + /// an existing line item and a set of creative ids. For small business + /// networks, the creative ids must represent new or copied creatives as + /// creatives cannot be used for more than one line item. For premium + /// solution networks, the creative ids can represent any creative. To copy + /// creatives, run CopyImageCreatives.cs. To determine which LICAs exist, run + /// GetAllLicasExample.cs. + /// + /// Tags: LineItemCreativeAssociationService.createLineItemCreativeAssociations + /// + class CreateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new line item creative associations (LICAs) for an " + + "existing line item and a set of creative ids. For small business networks, the " + + "creative ids must represent new or copied creatives as creatives cannot be used " + + "for more than one line item. For premium solution networks, the creative ids can " + + "represent any creative. To copy creatives, run CopyImageCreatives.cs. To determine " + + "which LICAs exist, run GetAllLicasExample.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = + (LineItemCreativeAssociationService) user.GetService( + DfpService.v201211.LineItemCreativeAssociationService); + + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201211.CreativeService); + + // Set the line item ID and creative IDs to associate. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long[] creativeIds = new long[] {long.Parse(_T("INSERT_CREATIVE_ID_HERE"))}; + + // Create an array to store local LICA objects. + LineItemCreativeAssociation[] licas = new LineItemCreativeAssociation[creativeIds.Length]; + + // For each line item, associate it with the given creative. + int i = 0; + foreach (long creativeId in creativeIds) { + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId; + lica.lineItemId = lineItemId; + licas[i++] = lica; + } + + try { + // Create the LICAs on the server. + licas = licaService.createLineItemCreativeAssociations(licas); + + if (licas != null) { + foreach (LineItemCreativeAssociation lica in licas) { + Console.WriteLine("A LICA with line item ID \"{0}\", creative ID \"{1}\", and status " + + "\"{2}\" was created.", lica.lineItemId, lica.creativeId, lica.status); + } + } else { + Console.WriteLine("No LICAs created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to associate creative with line item. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/DeactivateLicas.cs b/examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/DeactivateLicas.cs new file mode 100644 index 00000000000..de599233145 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/DeactivateLicas.cs @@ -0,0 +1,125 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example deactivates all LICAs for the line item. To determine + /// which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.performLineItemCreativeAssociationAction + /// + class DeactivateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all LICAs for the line item. To determine which " + + "LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201211.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + String statementText = "WHERE lineItemId = :lineItemId and status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("lineItemId", lineItemId). + AddValue("status", LineItemCreativeAssociationStatus.ACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + int offset = 0; + List creativeIds = new List(); + + try { + do { + // Create a Statement to page through active LICAs. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' will be deactivated.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + creativeIds.Add(lica.creativeId.ToString()); + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of LICAs to be deactivated: {0}", creativeIds.Count); + + if (creativeIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE lineItemId = :lineItemId and creativeId IN ({0})", + string.Join(",", creativeIds.ToArray()))). + AddValue("lineItemId", lineItemId).ToStatement(); + + // Create action. + DeactivateLineItemCreativeAssociations action = + new DeactivateLineItemCreativeAssociations(); + + // Perform action. + UpdateResult result = + licaService.performLineItemCreativeAssociationAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of LICAs deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No LICAs were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/GetAllLicas.cs b/examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/GetAllLicas.cs new file mode 100644 index 00000000000..375e3350c6e --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/GetAllLicas.cs @@ -0,0 +1,91 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all line item creative associations (LICA). To + /// create LICAs, run CreateLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// + class GetAllLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line item creative associations (LICA). To create " + + "LICAs, run CreateLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201211.LineItemCreativeAssociationService); + + // Sets defaults for page and Statement. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all LICAs. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' was found.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + } + } + + offset += 500; + } while (page.results != null && page.results.Length == 500); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/GetLica.cs b/examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/GetLica.cs new file mode 100644 index 00000000000..2dd49cd3157 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/GetLica.cs @@ -0,0 +1,81 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets a line item creative association (LICA) by the line + /// item and creative ID. To determine which line items exist, run + /// GetAllLineItems.cs. To determine which creatives exit, run + /// GetAllCreatives.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociation + /// + class GetLica : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a line item creative association (LICA) by the line " + + "item and creative ID. To determine which line items exist, run " + + "GetAllLineItems.cs. To determine which creatives exit, run " + + "GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + new GetLica().Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201211.LineItemCreativeAssociationService); + + // Set the line item and creative ID to use to retrieve the LICA. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long creativeId = long.Parse(_T("INSERT_CREATIVE_ID_HERE")); + + try { + // Get the LICA. + LineItemCreativeAssociation lica = + licaService.getLineItemCreativeAssociation(lineItemId, creativeId); + + if (lica != null) { + Console.WriteLine("LICA with line item ID = {0}, creative ID = '{1}' and status = " + + "'{2}' was found", lica.lineItemId, lica.creativeId, lica.status); + } else { + Console.WriteLine("No LICA found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get LICA. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/GetLicasByStatement.cs b/examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/GetLicasByStatement.cs new file mode 100644 index 00000000000..1b68d1b9309 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/GetLicasByStatement.cs @@ -0,0 +1,89 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all line item creative associations for a given + /// line item ID. The Statement retrieves up to the maximum page size limit of + /// 500. To create LICAs, run CreateLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// + class GetLicasByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line item creative associations for a given line " + + "item ID. The Statement retrieves up to the maximum page size limit of 500. To " + + "create LICAs, run CreateLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLicasByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201211.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + // Create a Statement to only select LICAs for the given lineItem ID. + Statement statement = new StatementBuilder("WHERE lineItemId = :lineItemId LIMIT 500"). + AddValue("lineItemId", lineItemId).ToStatement(); + + try { + // Get LICAs by Statement. + LineItemCreativeAssociationPage page = + licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' was found.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/UpdateLicas.cs b/examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/UpdateLicas.cs new file mode 100644 index 00000000000..82ed6b18d05 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LineItemCreativeAssociationService/UpdateLicas.cs @@ -0,0 +1,97 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example updates the destination URL of all LICAs up to the first + /// 500. To determine which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.updateLineItemCreativeAssociations + /// + class UpdateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the destination URL of all LICAs up to the first " + + "500. To determine which LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201211.LineItemCreativeAssociationService); + + // Create a Statement to get all LICAs. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get LICAs by Statement. + LineItemCreativeAssociationPage page = + licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + LineItemCreativeAssociation[] licas = page.results; + + // Update each local LICA object by changing its destination URL. + foreach (LineItemCreativeAssociation lica in licas) { + lica.destinationUrl = "http://news.google.com"; + } + + // Update the LICAs on the server. + licas = licaService.updateLineItemCreativeAssociations(licas); + + if (licas != null) { + foreach (LineItemCreativeAssociation lica in licas) { + Console.WriteLine("LICA with line item ID = '{0}, creative ID ='{1}' and " + + "destination URL '{2}' was updated.", lica.lineItemId, lica.creativeId, + lica.destinationUrl); + } + } else { + Console.WriteLine("No LICAs updated."); + } + } else { + Console.WriteLine("No LICAs found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LineItemService/ActivateLineItem.cs b/examples/Dfp/CSharp/v201211/LineItemService/ActivateLineItem.cs new file mode 100644 index 00000000000..3be39adafd5 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LineItemService/ActivateLineItem.cs @@ -0,0 +1,134 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example activates all line items for the given order. To be + /// activated, line items need to be in the approved (needs creatives) state + /// and have at least one creative associated with them. To approve line + /// items, approve the order to which they belong by running ApproveOrders.cs. + /// To create LICAs, run CreateLicas.cs. To determine which line items exist, + /// run GetAllLineItem.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.performLineItemAction + /// + class ActivateLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example activates all line items for the given order. To be activated," + + " line items need to be in the approved (needs creatives) state and have at least one" + + " creative associated with them. To approve line items, approve the order to which" + + " they belong by running ApproveOrders.cs. To create LICAs, run CreateLicas.cs." + + " To determine which line items exist, run GetAllLineItem.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ActivateLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201211.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create Statement text to select approved line items from a given order. + string statementText = "WHERE orderId = :orderId and status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("orderId", orderId). + AddValue("status", ComputedStatus.NEEDS_CREATIVES.ToString()).ToStatement(); + + // Set defaults for page and offset. + LineItemPage page = new LineItemPage(); + int offset = 0; + int i = 0; + List lineItemIds = new List(); + + try { + do { + // Create a Statement to page through approved line items. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get line items by Statement. + page = lineItemService.getLineItemsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + foreach (LineItemSummary lineItem in page.results) { + // Archived line items cannot be activated. + if (!lineItem.isArchived) { + Console.WriteLine("{0}) Line item with ID ='{1}', belonging to order ID ='{2}' " + + "and name ='{2}' will be activated.", i, lineItem.id, lineItem.orderId, + lineItem.name); + lineItemIds.Add(lineItem.id.ToString()); + i++; + } + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of line items to be activated: {0}", lineItemIds.Count); + + if (lineItemIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", lineItemIds.ToArray()))). + ToStatement(); + + // Create action. + ActivateLineItems action = new ActivateLineItems(); + + // Perform action. + UpdateResult result = lineItemService.performLineItemAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of line items activated: {0}", result.numChanges); + } else { + Console.WriteLine("No line items were activated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to activate line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LineItemService/CreateLineItems.cs b/examples/Dfp/CSharp/v201211/LineItemService/CreateLineItems.cs new file mode 100644 index 00000000000..fc6c67c3dad --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LineItemService/CreateLineItems.cs @@ -0,0 +1,217 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates new line items. To determine which line items + /// exist, run GetAllLineItems.cs. To determine which orders exist, run + /// GetAllOrders.cs. To determine which placements exist, run + /// GetAllPlacements.cs. To determine the IDs for locations, run + /// GetAllCities.cs, GetAllCountries.cs, GetAllMetros.cs, GetAllRegions.cs and + /// GetAllPostalCodes. + /// + /// Tags: LineItemService.createLineItems + /// + class CreateLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new line items. To determine which line items " + + "exist, run GetAllLineItems.cs. To determine which orders exist, run GetAllOrders.cs" + + ". To determine which placements exist, run GetAllPlacements.cs. To determine the " + + "IDs for locations, run GetAllCities.cs, GetAllCountries.cs, GetAllMetros.cs, " + + "GetAllRegions.cs and GetAllPostalCodes."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code examples. + /// + /// The DFP user object running the code examples. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201211.LineItemService); + + // Set the order that all created line items will belong to and the + // placement ID to target. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + long[] targetPlacementIds = new long[] {long.Parse(_T("INSERT_PLACEMENT_ID_HERE"))}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = targetPlacementIds; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + PostalCodeLocation postalCodeLocation = new PostalCodeLocation(); + postalCodeLocation.id = 9000093; + postalCodeLocation.postalCode = "B3P"; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201211.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201211.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + // Create an array to store local line item objects. + LineItem[] lineItems = new LineItem[5]; + + for (int i = 0; i < 5; i++) { + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + i; + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + lineItems[i] = lineItem; + } + + try { + // Create the line items on the server. + lineItems = lineItemService.createLineItems(lineItems); + + if (lineItems != null) { + foreach (LineItem lineItem in lineItems) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and" + + " named \"{2}\" was created.", lineItem.id, lineItem.orderId, lineItem.name); + } + } else { + Console.WriteLine("No line items created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LineItemService/CreateMobileLineItem.cs b/examples/Dfp/CSharp/v201211/LineItemService/CreateMobileLineItem.cs new file mode 100644 index 00000000000..162f5610dfa --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LineItemService/CreateMobileLineItem.cs @@ -0,0 +1,172 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates a new line item to serve to the mobile platform. + /// Mobile features needs to be enabled in your account to use mobile + /// targeting. To determine which line items exist, run GetAllLineItems.cs. To + /// determine which orders exist, run GetAllOrders.cs. To determine + /// which placements exist, run GetAllPlacements.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.performLineItemAction + /// + class CreateMobileLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new line item to serve to the mobile platform. Mobile" + + " features needs to be enabled in your account to use mobile targeting. To determine " + + "which line items exist, run GetAllLineItems.cs. To determine which orders exist, " + + "run GetAllOrders.cs. To determine which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateMobileLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201211.LineItemService); + + // Set the order that all created line items will belong to and the + // placement containing ad units with a mobile target platform. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + long[] targetedPlacementIds = new long[] {long.Parse(_T("INSERT_MOBILE_PLACEMENT_ID_HERE"))}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = targetedPlacementIds; + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create device manufacturer targeting. + DeviceManufacturerTargeting deviceManufacturerTargeting = new DeviceManufacturerTargeting(); + deviceManufacturerTargeting.isTargeted = true; + + // Target the Google device manufacturer (40100). + Technology deviceManufacturerTechnology = new Technology(); + deviceManufacturerTechnology.id = 40100L; + deviceManufacturerTargeting.deviceManufacturers = + new Technology[] {deviceManufacturerTechnology}; + technologyTargeting.deviceManufacturerTargeting = deviceManufacturerTargeting; + + // Create mobile device targeting. + MobileDeviceTargeting mobileDeviceTargeting = new MobileDeviceTargeting(); + + // Exclude the Nexus One device (604046). + Technology mobileDeviceTechnology = new Technology(); + mobileDeviceTechnology.id = 604046L; + mobileDeviceTargeting.targetedMobileDevices = new Technology[] {mobileDeviceTechnology}; + technologyTargeting.mobileDeviceTargeting = mobileDeviceTargeting; + + // Create mobile device submodel targeting. + MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargeting = + new MobileDeviceSubmodelTargeting(); + + // Target the iPhone 4 device submodel (640003). + Technology mobileDeviceSubmodelTechnology = new Technology(); + mobileDeviceSubmodelTechnology.id = 640003L; + mobileDeviceSubmodelTargeting.targetedMobileDeviceSubmodels = + new Technology[] {mobileDeviceSubmodelTechnology}; + technologyTargeting.mobileDeviceSubmodelTargeting = mobileDeviceSubmodelTargeting; + + // Create targeting. + Targeting targeting = new Targeting(); + targeting.inventoryTargeting = inventoryTargeting; + targeting.technologyTargeting = technologyTargeting; + + // Create local line item object. + LineItem lineItem = new LineItem(); + lineItem.name = "Mobile line item"; + lineItem.orderId = orderId; + lineItem.targeting = targeting; + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the target platform to mobile. + lineItem.targetPlatform = TargetPlatform.MOBILE; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + creativePlaceholder.size = size; + + // Set the size of creatives that can be associated with this line item. + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromString("20120901 00:00:00"); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + Money money = new Money(); + money.currencyCode = "USD"; + money.microAmount = 2000000L; + lineItem.costPerUnit = money; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + try { + // Create the line item on the server. + lineItem = lineItemService.createLineItem(lineItem); + + if (lineItem != null) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and " + + "named \"{2}\" was created.", lineItem.id, lineItem.orderId, lineItem.name); + } else { + Console.WriteLine("No line item created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LineItemService/CreateVideoLineItem.cs b/examples/Dfp/CSharp/v201211/LineItemService/CreateVideoLineItem.cs new file mode 100644 index 00000000000..0a454e7d959 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LineItemService/CreateVideoLineItem.cs @@ -0,0 +1,184 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates a new line item to serve to video content. To + /// determine which line items exist, run GetAllLineItems.cs. To determine + /// which orders exist, run GetAllOrders.cs. To create a video ad unit, run + /// CreateVideoAdUnit.cs. To create criteria for categories, run + /// CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: LineItemService.createLineItem + /// + class CreateVideoLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new line item to serve to video content. To determine" + + " which line items exist, run GetAllLineItems.cs. To determine which orders exist, " + + "run GetAllOrders.cs. To create a video ad unit, run CreateVideoAdUnit.cs. To " + + "create criteria for categories, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateVideoLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201211.LineItemService); + + // Set the order that all created line items will belong to and the + // video ad unit ID to target. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + string targetedVideoAdUnitId = _T("INSERT_TARGETED_VIDEO_AD_UNIT_ID_HERE"); + + // Set the custom targeting key ID and value ID representing the metadata + // on the content to target. This would typically be a key representing + // a "genre" and a value representing something like "comedy". + long contentCustomTargetingKeyId = + long.Parse(_T("INSERT_CONTENT_CUSTOM_TARGETING_KEY_ID_HERE")); + long contentCustomTargetingValueId = + long.Parse(_T("INSERT_CONTENT_CUSTOM_TARGETING_VALUE_ID_HERE")); + + // Create custom criteria for the content metadata targeting. + CustomCriteria contentCustomCriteria = new CustomCriteria(); + contentCustomCriteria.keyId = contentCustomTargetingKeyId; + contentCustomCriteria.valueIds = new long[] {contentCustomTargetingValueId}; + contentCustomCriteria.@operator = CustomCriteriaComparisonOperator.IS; + + // Create custom criteria set. + CustomCriteriaSet customCriteriaSet = new CustomCriteriaSet(); + customCriteriaSet.children = new CustomCriteriaNode[] {contentCustomCriteria}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + AdUnitTargeting adUnitTargeting = new AdUnitTargeting(); + adUnitTargeting.adUnitId = targetedVideoAdUnitId; + adUnitTargeting.includeDescendants = true; + inventoryTargeting.targetedAdUnits = new AdUnitTargeting[] {adUnitTargeting}; + + // Create video position targeting. + VideoPositionTargeting videoPositionTargeting = new VideoPositionTargeting(); + videoPositionTargeting.targetedVideoPositions = + new VideoPositionTargetingType[] {VideoPositionTargetingType.PREROLL}; + + // Create targeting. + Targeting targeting = new Targeting(); + targeting.customTargeting = customCriteriaSet; + targeting.inventoryTargeting = inventoryTargeting; + targeting.videoPositionTargeting = videoPositionTargeting; + + // Create local line item object. + LineItem lineItem = new LineItem(); + lineItem.name = "Video line item"; + lineItem.orderId = orderId; + lineItem.targeting = targeting; + lineItem.lineItemType = LineItemType.SPONSORSHIP; + lineItem.allowOverbook = true; + + // Set the environment type to video. + lineItem.environmentType = EnvironmentType.VIDEO_PLAYER; + + // Set the creative rotation type to optimized. + lineItem.creativeRotationType = CreativeRotationType.OPTIMIZED; + + // Create the master creative placeholder. + CreativePlaceholder creativeMasterPlaceholder = new CreativePlaceholder(); + Size size1 = new Size(); + size1.width = 400; + size1.height = 300; + size1.isAspectRatio = false; + creativeMasterPlaceholder.size = size1; + + // Create companion creative placeholders. + CreativePlaceholder companionCreativePlaceholder1 = new CreativePlaceholder(); + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + size2.isAspectRatio = false; + companionCreativePlaceholder1.size = size2; + + CreativePlaceholder companionCreativePlaceholder2 = new CreativePlaceholder(); + Size size3 = new Size(); + size3.width = 728; + size3.height = 90; + size3.isAspectRatio = false; + companionCreativePlaceholder2.size = size3; + + // Set companion creative placeholders. + creativeMasterPlaceholder.companions = new CreativePlaceholder[] { + companionCreativePlaceholder1, companionCreativePlaceholder2}; + + // Set the size of creatives that can be associated with this line item. + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativeMasterPlaceholder}; + + // Set delivery of video companions to optional. + lineItem.companionDeliveryOption = CompanionDeliveryOption.OPTIONAL; + + // Set the length of the line item to run. + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromString("20120901 00:00:00"); + + // Set the cost per day to $1. + lineItem.costType = CostType.CPD; + Money money = new Money(); + money.currencyCode = "USD"; + money.microAmount = 1000000L; + lineItem.costPerUnit = money; + + // Set the percentage to be 100%. + lineItem.unitsBought = 100; + + try { + // Create the line item on the server. + lineItem = lineItemService.createLineItem(lineItem); + + if (lineItem != null) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and " + + "named \"{2}\" was created.", lineItem.id, lineItem.orderId, lineItem.name); + } else { + Console.WriteLine("No line item created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LineItemService/GetAllLineItems.cs b/examples/Dfp/CSharp/v201211/LineItemService/GetAllLineItems.cs new file mode 100644 index 00000000000..6052e1d2d81 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LineItemService/GetAllLineItems.cs @@ -0,0 +1,91 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all line items. To create line items, run + /// CreateLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// + class GetAllLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items. To create line items, run " + + "CreateLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201211.LineItemService); + + // Sets defaults for page and Statement. + LineItemPage page = new LineItemPage(); + Statement statement = new Statement(); + int offset = 0; + try { + do { + // Create a Statement to get all line items. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get line items by Statement. + page = lineItemService.getLineItemsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemSummary lineItem in page.results) { + Console.WriteLine("{0}) Line item with ID = '{1}', belonging to order ID ='{2}'" + + " , and named '{3}' was found.", i, lineItem.id, lineItem.orderId, + lineItem.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LineItemService/GetLineItem.cs b/examples/Dfp/CSharp/v201211/LineItemService/GetLineItem.cs new file mode 100644 index 00000000000..b8df814122d --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LineItemService/GetLineItem.cs @@ -0,0 +1,78 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets a line item by its ID. To determine which line + /// items exist, run GetAllLineItems.cs. + /// + /// Tags: LineItemService.getLineItem + /// + class GetLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a line item by its ID. To determine which line items " + + "exist, run GetAllLineItems.cs"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201211.LineItemService); + + // Set the ID of the line item to get. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get the line item. + LineItem lineItem = lineItemService.getLineItem(lineItemId); + + if (lineItem != null) { + Console.WriteLine("Line item with ID ='{0}', belonging to order ID ='{1}', and named " + + "'{2}' was found.", lineItem.id, lineItem.orderId, lineItem.name); + } else { + Console.WriteLine("No line item found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get line item by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LineItemService/GetLineItemsByStatement.cs b/examples/Dfp/CSharp/v201211/LineItemService/GetLineItemsByStatement.cs new file mode 100644 index 00000000000..434dcf8b371 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LineItemService/GetLineItemsByStatement.cs @@ -0,0 +1,92 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all line items for the given order. The Statement + /// retrieves up to the maximum page size limit of 500. To create line items, + /// run CreateLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// + class GetLineItemsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items for the given order. The Statement " + + "retrieves up to the maximum page size limit of 500. To create line items, " + + "run CreateLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLineItemsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201211.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create a statement to only select line items that need creatives from a + // given order. + Statement filterStatement = + new StatementBuilder("WHERE orderId = :orderId AND status = :status LIMIT 500") + .AddValue("orderId", orderId) + .AddValue("status", ComputedStatus.NEEDS_CREATIVES.ToString()) + .ToStatement(); + + try { + // Get line items by Statement. + LineItemPage page = lineItemService.getLineItemsByStatement(filterStatement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItem lineItem in page.results) { + Console.WriteLine("{0}) Line item with ID ='{1}', belonging to order ID = '{2}' and " + + "named '{3}' was found.", i, lineItem.id, lineItem.orderId, lineItem.name); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get line item by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LineItemService/GetRecentlyUpdatedLineItems.cs b/examples/Dfp/CSharp/v201211/LineItemService/GetRecentlyUpdatedLineItems.cs new file mode 100644 index 00000000000..1c102497f06 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LineItemService/GetRecentlyUpdatedLineItems.cs @@ -0,0 +1,92 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; +using Google.Api.Ads.Dfp.Util.v201211; + +using System; + +using DateTime = Google.Api.Ads.Dfp.v201211.DateTime; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example shows how to get recently updated line items. To create + /// line items, run CreateLineItems.cs. + /// + /// Tags: LineItemService.GetRecentlyUpdatedLineItems + /// + class GetRecentlyUpdatedLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a line item by its ID. To determine which line items " + + "exist, run GetAllLineItems.cs"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetRecentlyUpdatedLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201211.LineItemService); + + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + try { + // Create statement to only select line items for the given order that + // have been modified in the last 3 days. + DateTime threeDaysAgo = DateTimeUtilities.FromDateTime(System.DateTime.Now.AddDays(-3)); + Statement filterStatement = new StatementBuilder( + "WHERE lastModifiedDateTime >= :lastModifiedDateTime AND orderId = :orderId LIMIT 500"). + AddValue("lastModifiedDateTime", threeDaysAgo). + AddValue("orderId", orderId).ToStatement(); + + + // Get line items by statement. + LineItemPage page = lineItemService.getLineItemsByStatement(filterStatement); + + // Display results. + if (page != null && page.results != null) { + foreach (LineItem lineItem in page.results) { + Console.WriteLine("Line item with id \"{0}\", belonging to order id \"{1}\" and " + + "named \"{2}\" was found.", lineItem.id, lineItem.orderId, lineItem.name); + } + Console.WriteLine("Number of results found: {1}.", page.totalResultSetSize); + } else { + Console.WriteLine("No line items were found."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LineItemService/TargetCustomCriteria.cs b/examples/Dfp/CSharp/v201211/LineItemService/TargetCustomCriteria.cs new file mode 100644 index 00000000000..970f8786ac1 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LineItemService/TargetCustomCriteria.cs @@ -0,0 +1,167 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example updates a line item to add custom criteria targeting. To + /// determine which line items exist, run GetAllLineItems.cs. To determine + /// which custom targeting keys and values exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: LineItemService.getLineItem, LineItemService.updateLineItem + /// + class TargetCustomCriteria : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a line item to add custom criteria targeting. To " + + "determine which line items exist, run GetAllLineItems.cs. To determine which custom " + + "targeting keys and values exist, run GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new TargetCustomCriteria(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201211.LineItemService); + + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = (CustomTargetingService) user.GetService( + DfpService.v201211.CustomTargetingService); + + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long[] customCriteriaIds1 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + long[] customCriteriaIds2 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + long[] customCriteriaIds3 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + + // Create custom criteria. + CustomCriteria customCriteria1 = new CustomCriteria(); + customCriteria1.keyId = customCriteriaIds1[0]; + customCriteria1.valueIds = new long[] {customCriteriaIds1[1]}; + customCriteria1.@operator = CustomCriteriaComparisonOperator.IS; + + CustomCriteria customCriteria2 = new CustomCriteria(); + customCriteria2.keyId = customCriteriaIds2[0]; + customCriteria2.valueIds = new long[] {customCriteriaIds2[1]}; + customCriteria2.@operator = CustomCriteriaComparisonOperator.IS_NOT; + + CustomCriteria customCriteria3 = new CustomCriteria(); + customCriteria3.keyId = customCriteriaIds3[0]; + customCriteria3.valueIds = new long[] {customCriteriaIds3[1]}; + customCriteria3.@operator = CustomCriteriaComparisonOperator.IS; + + // Create the custom criteria set that will resemble: + // + // (customCriteria1.key == customCriteria1.value OR + // (customCriteria2.key != customCriteria2.value AND + // customCriteria3.key == customCriteria3.value)) + CustomCriteriaSet topCustomCriteriaSet = new CustomCriteriaSet(); + topCustomCriteriaSet.logicalOperator = CustomCriteriaSetLogicalOperator.OR; + + CustomCriteriaSet subCustomCriteriaSet = new CustomCriteriaSet(); + subCustomCriteriaSet.logicalOperator = CustomCriteriaSetLogicalOperator.AND; + subCustomCriteriaSet.children = + new CustomCriteriaNode[] {customCriteria2, customCriteria3}; + topCustomCriteriaSet.children = + new CustomCriteriaNode[] {customCriteria1, subCustomCriteriaSet}; + + try { + // Set the custom criteria targeting on the line item. + LineItem lineItem = lineItemService.getLineItem(lineItemId); + lineItem.targeting.customTargeting = topCustomCriteriaSet; + + // Update the line items on the server. + lineItem = lineItemService.updateLineItem(lineItem); + + // Display the updated line item. + Console.WriteLine("Line item with ID {0} updated with custom criteria targeting \n{1}\n", + lineItem.id, getCustomCriteriaSetString(lineItem.targeting.customTargeting, 0)); + } catch (Exception ex) { + Console.WriteLine("Failed to add custom target criteria. Exception says \"{0}\"", + ex.Message); + } + } + + /// + /// Gets a string representation of the custom criteria node. If it has + /// children, each child will be appended to the string recursively. + /// + /// The root custom criteria node. + /// The level of the custom criteria tree. + /// + /// A string representation of the custom criteria node and its + /// children + /// + private static string getCustomCriteriaSetString(CustomCriteriaNode root, int level) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < level; i++) { + sb.Append("\t"); + } + + if (root is CustomCriteria) { + CustomCriteria customCriteria = (CustomCriteria) root; + StringBuilder ids = new StringBuilder(); + for (int j = 0; j < customCriteria.valueIds.Length; j++) { + ids.Append(customCriteria.valueIds[j] + ", "); + } + + sb.AppendFormat("Custom criteria: operator: [{0}] key: [{1}] values: [{2}]\n", + customCriteria.@operator, customCriteria.keyId, ids.ToString().TrimEnd(',', ' ')); + return sb.ToString(); + } else if (root is CustomCriteriaSet) { + CustomCriteriaSet customCriteriaSet = (CustomCriteriaSet) root; + sb.AppendFormat("Custom criteria set: operator: [{0}] children: \n", + customCriteriaSet.logicalOperator); + foreach (CustomCriteriaNode node in customCriteriaSet.children) { + sb.Append(getCustomCriteriaSetString(node, level + 1)); + } + return sb.Append("\n").ToString(); + } else { + throw new Exception("Unexpected node: " + root.CustomCriteriaNodeType); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/LineItemService/UpdateLineItems.cs b/examples/Dfp/CSharp/v201211/LineItemService/UpdateLineItems.cs new file mode 100644 index 00000000000..a390f5c9b32 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/LineItemService/UpdateLineItems.cs @@ -0,0 +1,108 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example updates the delivery rate of all line items up to the + /// first 500. To determine which line items exist, run GetAllLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.updateLineItems + /// + class UpdateLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the delivery rate of all line items up to the first " + + "500. To determine which line items exist, run GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201211.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create a Statement to get line items with even delivery rates. + Statement statement = new StatementBuilder("WHERE deliveryRateType = :deliveryRateType and " + + "orderId = :orderId LIMIT 500").AddValue("deliveryRateType", + DeliveryRateType.EVENLY.ToString()).AddValue("orderId", orderId).ToStatement(); + + try { + // Get line items by Statement. + LineItemPage page = lineItemService.getLineItemsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + LineItem[] lineItems = page.results; + List lineItemsToUpdate = new List(); + + // Update each local line item object by changing its delivery rate. + foreach (LineItem lineItem in lineItems) { + // Archived line items cannot be updated. + if (!lineItem.isArchived) { + lineItem.deliveryRateType = DeliveryRateType.AS_FAST_AS_POSSIBLE; + lineItemsToUpdate.Add(lineItem); + } + } + + // Update the line items on the server. + lineItems = lineItemService.updateLineItems(lineItemsToUpdate.ToArray()); + + if (lineItems != null) { + foreach (LineItem lineItem in lineItems) { + Console.WriteLine("A line item with ID = '{0}', belonging to order ID = '{1}', " + + "named '{2}', and having delivery rate = '{3}' was updated.", + lineItem.id, lineItem.orderId, lineItem.name, lineItem.deliveryRateType); + } + } else { + Console.WriteLine("No line items updated."); + } + } else { + Console.WriteLine("No line items found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/NetworkService/GetAllNetworks.cs b/examples/Dfp/CSharp/v201211/NetworkService/GetAllNetworks.cs new file mode 100644 index 00000000000..87c9bc6359d --- /dev/null +++ b/examples/Dfp/CSharp/v201211/NetworkService/GetAllNetworks.cs @@ -0,0 +1,81 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all networks that you have access to with the + /// current login credentials. A networkCode should be left out for this + /// request. + /// + /// Tags: NetworkService.getAllNetworks + /// + class GetAllNetworks : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all networks that you have access to with the current " + + "login credentials. A networkCode should be left out for this request."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllNetworks(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201211.NetworkService); + // Set the networkCode field to null to retrieve all networks you have + // access to. + networkService.RequestHeader.networkCode = null; + + try { + // Get all networks that you have access to with the current login + // credentials. + Network[] networks = networkService.getAllNetworks(); + + int i = 0; + foreach (Network network in networks) { + Console.WriteLine("{0} ) Network with network code \"{1}\" and display name \"{2}\" " + + "was found.", i + 1, network.networkCode, network.displayName); + i++; + } + Console.WriteLine("Number of networks found: {0}", i); + } catch (Exception ex) { + Console.WriteLine("Failed to get all networks. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/NetworkService/GetCurrentNetwork.cs b/examples/Dfp/CSharp/v201211/NetworkService/GetCurrentNetwork.cs new file mode 100644 index 00000000000..499a182238a --- /dev/null +++ b/examples/Dfp/CSharp/v201211/NetworkService/GetCurrentNetwork.cs @@ -0,0 +1,70 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets the current network that you can make requests + /// against. + /// + /// Tags: NetworkService.getCurrentNetwork + /// + class GetCurrentNetwork : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the current network that you can make requests against."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCurrentNetwork(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201211.NetworkService); + + try { + // Get the current network. + Network network = networkService.getCurrentNetwork(); + + Console.WriteLine("Current network has network code \"{0}\" and display name \"{1}\".", + network.networkCode, network.displayName); + } catch (Exception ex) { + Console.WriteLine("Failed to get current network. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/NetworkService/MakeTestNetwork.cs b/examples/Dfp/CSharp/v201211/NetworkService/MakeTestNetwork.cs new file mode 100644 index 00000000000..db7596543b4 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/NetworkService/MakeTestNetwork.cs @@ -0,0 +1,85 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates a test network. You do not need to have a DFP + /// account to run this example, but you do need to have a new Google account + /// (created at http://www.google.com/accounts/newaccount) that is not + /// associated with any other DFP networks (including old sandbox networks). + /// Once this network is created, you can supply the network code in your + /// settings to make calls to other services. + /// + /// Please see the following URL for more information: + /// https://developers.google.com/doubleclick-publishers/docs/signup + /// + /// Tags: NetworkService.makeTestNetwork + /// + class MakeTestNetwork : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a test network. You do not need to have a DFP" + + " account to run this example, but you do need to have a new Google account" + + " (created at http://www.google.com/accounts/newaccount) that is not associated " + + "with any other DFP networks (including old sandbox networks). Once this network " + + "is created, you can supply the network code in your settings to make calls to " + + "other services.\n\n Please see the following URL for more information:" + + " https://developers.google.com/doubleclick-publishers/docs/signup"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new MakeTestNetwork(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201211.NetworkService); + // Set the networkCode field to null. + networkService.RequestHeader.networkCode = null; + + try { + Network network = networkService.makeTestNetwork(); + + Console.WriteLine("Test network with network code \"{0}\" and display name \"{1}\" " + + "created.\nYou may now sign in at http://www.google.com/dfp/main?networkCode={0}", + network.networkCode, network.displayName); + } catch (Exception ex) { + Console.WriteLine("Failed to make test network. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/OrderService/ApproveOrder.cs b/examples/Dfp/CSharp/v201211/OrderService/ApproveOrder.cs new file mode 100644 index 00000000000..7d82cc6f4f3 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/OrderService/ApproveOrder.cs @@ -0,0 +1,121 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example approves and overbooks all eligible draft and pending + /// orders. To determine which orders exist, run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement, OrderService.performOrderAction + /// + class ApproveOrder : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example approves and overbooks all draft orders. To determine which " + + "orders exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ApproveOrder(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = + (OrderService) user.GetService(DfpService.v201211.OrderService); + + // Create Statement text to select all draft orders. + string statementText = "WHERE status IN (:status1, :status2) and endDateTime >= :today " + + "AND isArchived = FALSE LIMIT 500"; + Statement statement = new StatementBuilder(""). + AddValue("status1", OrderStatus.DRAFT.ToString()). + AddValue("status2", OrderStatus.PENDING_APPROVAL.ToString()). + AddValue("today", System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss")).ToStatement(); + + // Set defaults for page and offset. + OrderPage page = new OrderPage(); + int i = 0; + int offset = 0; + List orderIds = new List(); + + try { + do { + // Create a Statement to page through draft orders. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + // Get orders by Statement. + page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and status ='{3}' " + + "will be approved.", i, order.id, order.name, order.status); + orderIds.Add(order.id.ToString()); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of orders to be approved: {0}", orderIds.Count); + + if (orderIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", orderIds.ToArray()))). + ToStatement(); + + // Create action. + ApproveAndOverbookOrders action = new ApproveAndOverbookOrders(); + + // Perform action. + UpdateResult result = orderService.performOrderAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of orders approved: {0}", result.numChanges); + } else { + Console.WriteLine("No orders were approved."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to approve orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/OrderService/CreateOrders.cs b/examples/Dfp/CSharp/v201211/OrderService/CreateOrders.cs new file mode 100644 index 00000000000..d015df60f24 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/OrderService/CreateOrders.cs @@ -0,0 +1,96 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates new orders. To determine which orders exist, + /// run GetAllOrders.cs. + /// + /// Tags: OrderService.createOrders + /// + class CreateOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new orders. To determine which orders exist, " + + "run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = + (OrderService) user.GetService(DfpService.v201211.OrderService); + + // Set the advertiser, salesperson, and trafficker to assign to each + // order. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + long salespersonId = long.Parse(_T("INSERT_SALESPERSON_ID_HERE")); + long traffickerId = long.Parse(_T("INSERT_TRAFFICKER_ID_HERE")); + + // Create an array to store local order objects. + Order[] orders = new Order[5]; + + for (int i = 0; i < 5; i++) { + Order order = new Order(); + order.name = string.Format("Order #{0}", i); + order.advertiserId = advertiserId; + order.salespersonId = salespersonId; + order.traffickerId = traffickerId; + + orders[i] = order; + } + + try { + // Create the orders on the server. + orders = orderService.createOrders(orders); + + if (orders != null) { + foreach (Order order in orders) { + Console.WriteLine("An order with ID ='{0}' and named '{1}' was created.", + order.id, order.name); + } + } else { + Console.WriteLine("No orders created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/OrderService/GetAllOrders.cs b/examples/Dfp/CSharp/v201211/OrderService/GetAllOrders.cs new file mode 100644 index 00000000000..6e3280c5283 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/OrderService/GetAllOrders.cs @@ -0,0 +1,88 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all orders. To create orders, run CreateOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement + /// + class GetAllOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets all orders. To create orders, run CreateOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201211.OrderService); + + // Sets defaults for page and Statement. + OrderPage page = new OrderPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all orders. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get orders by Statement. + page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and advertiser " + + "ID = '{3}' was found.", i, order.id, order.name, order.advertiserId); + i++; + } + } + + offset += 500; + } while (page.results != null && page.results.Length == 500); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/OrderService/GetOrder.cs b/examples/Dfp/CSharp/v201211/OrderService/GetOrder.cs new file mode 100644 index 00000000000..e6578acf297 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/OrderService/GetOrder.cs @@ -0,0 +1,75 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets an order by its ID. To determine which orders + /// exist, run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrder + /// + class GetOrder : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets an order by its ID. To determine which orders " + + "exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + new GetOrder().Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201211.OrderService); + + // Set the ID of the order to get. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + try { + // Get the order. + Order order = orderService.getOrder(orderId); + + if (order != null) { + Console.WriteLine("An order with ID = {0}', name = '{1}', and advertiser ID = '{2}' " + + " was found.", order.id, order.name, order.advertiserId); + } else { + Console.WriteLine("No order found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get orders by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/OrderService/GetOrdersByStatement.cs b/examples/Dfp/CSharp/v201211/OrderService/GetOrdersByStatement.cs new file mode 100644 index 00000000000..a2e26585a29 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/OrderService/GetOrdersByStatement.cs @@ -0,0 +1,89 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all orders for a given advertiser. The Statement + /// retrieves up to the maximum page size limit of 500. To create orders, run + /// CreateOrders.cs. To determine which companies are advertisers, + /// run GetCompaniesByStatement.cs. + /// + /// Tags: OrderService.getOrdersByStatement + /// + class GetOrdersByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all orders for a given advertiser. The Statement " + + "retrieves up to the maximum page size limit of 500. To create orders, run " + + "CreateOrders.cs. To determine which companies are advertisers,run " + + "GetCompaniesByStatement.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetOrdersByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201211.OrderService); + + // Set the name of the advertiser (company) to get orders for. + String advertiserId = _T("INSERT_ADVERTISER_COMPANY_ID_HERE"); + + // Create a Statement to only select orders for a given advertiser. + Statement statement = new StatementBuilder("WHERE advertiserId = :advertiserId LIMIT 500"). + AddValue("advertiserId", advertiserId).ToStatement(); + + try { + // Get orders by Statement. + OrderPage page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and advertiser " + + "ID = '{3}' was found.", i, order.id, order.name, order.advertiserId); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get orders by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/OrderService/UpdateOrders.cs b/examples/Dfp/CSharp/v201211/OrderService/UpdateOrders.cs new file mode 100644 index 00000000000..835109d6619 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/OrderService/UpdateOrders.cs @@ -0,0 +1,100 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example updates the notes of each order up to the first 500. + /// To determine which orders exist, run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement, OrderService.updateOrders + /// + class UpdateOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the notes of each order up to the first 500. " + + "To determine which orders exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201211.OrderService); + + // Create a Statement to get all orders. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get orders by Statement. + OrderPage page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + Order[] orders = page.results; + List ordersToUpdate = new List(); + + // Update each local order object by changing its notes. + foreach (Order order in orders) { + if (!order.isArchived) { + order.notes = "Spoke to advertiser. All is well."; + ordersToUpdate.Add(order); + } + } + + // Update the orders on the server. + orders = orderService.updateOrders(ordersToUpdate.ToArray()); + + if (orders != null) { + foreach (Order order in orders) { + Console.WriteLine("Order with ID = '{0}', name = '{1}', advertiser ID = '{2}', " + + "and notes = '{3}' was updated.", order.id, order.name, order.advertiserId, + order.notes); + } + } else { + Console.WriteLine("No orders updated."); + } + } else { + Console.WriteLine("No orders found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/PlacementService/CreatePlacements.cs b/examples/Dfp/CSharp/v201211/PlacementService/CreatePlacements.cs new file mode 100644 index 00000000000..d2366283344 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/PlacementService/CreatePlacements.cs @@ -0,0 +1,164 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates new placements for various ad unit sizes. To + /// determine which placements exist, run GetAllPlacements.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: PlacementService.createPlacements + /// + class CreatePlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new placements for various ad unit sizes. To determine " + + "which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreatePlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201211.InventoryService); + + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201211.PlacementService); + + // Create local placement object to store skyscraper ad units. + Placement skyscraperAdUnitPlacement = new Placement(); + skyscraperAdUnitPlacement.name = string.Format("Skyscraper AdUnit Placement #{0}", + this.GetTimeStamp()); + skyscraperAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 120x600"; + + // Create local placement object to store medium square ad units. + Placement mediumSquareAdUnitPlacement = new Placement(); + mediumSquareAdUnitPlacement.name = string.Format("Medium Square AdUnit Placement #{0}", + this.GetTimeStamp()); + mediumSquareAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 300x250"; + + // Create local placement object to store banner ad units. + Placement bannerAdUnitPlacement = new Placement(); + bannerAdUnitPlacement.name = string.Format("Banner AdUnit Placement #{0}", + this.GetTimeStamp()); + bannerAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 468x60"; + + List placementList = new List(); + + // Get the first 500 ad units. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + List mediumSquareTargetedUnitIds = new List(); + List skyscraperTargetedUnitIds = new List(); + List bannerTargetedUnitIds = new List(); + + try { + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + // Separate the ad units by size. + if (page.results != null) { + foreach (AdUnit adUnit in page.results) { + if (adUnit.parentId != null && adUnit.adUnitSizes != null) { + foreach (AdUnitSize adUnitSize in adUnit.adUnitSizes) { + Size size = adUnitSize.size; + if (size.width == 300 && size.height == 250) { + if (!mediumSquareTargetedUnitIds.Contains(adUnit.id)) { + mediumSquareTargetedUnitIds.Add(adUnit.id); + } + } else if (size.width == 120 && size.height == 600) { + if (!skyscraperTargetedUnitIds.Contains(adUnit.id)) { + skyscraperTargetedUnitIds.Add(adUnit.id); + } + } else if (size.width == 468 && size.height == 60) { + if (!bannerTargetedUnitIds.Contains(adUnit.id)) { + bannerTargetedUnitIds.Add(adUnit.id); + } + } + } + } + } + } + mediumSquareAdUnitPlacement.targetedAdUnitIds = mediumSquareTargetedUnitIds.ToArray(); + skyscraperAdUnitPlacement.targetedAdUnitIds = skyscraperTargetedUnitIds.ToArray(); + bannerAdUnitPlacement.targetedAdUnitIds = bannerTargetedUnitIds.ToArray(); + + + // Only create placements with one or more ad unit. + if (mediumSquareAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(mediumSquareAdUnitPlacement); + } + + if (skyscraperAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(skyscraperAdUnitPlacement); + } + + if (bannerAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(bannerAdUnitPlacement); + } + + Placement[] placements = + placementService.createPlacements(placementList.ToArray()); + + // Display results. + if (placements != null) { + foreach (Placement placement in placements) { + Console.Write("A placement with ID = '{0}', name ='{1}', and containing " + + "ad units {{", placement.id, placement.name); + + foreach (string adUnitId in placement.targetedAdUnitIds) { + Console.Write("{0}, ", adUnitId); + } + Console.WriteLine("} was created."); + } + } else { + Console.WriteLine("No placements created."); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to create placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/PlacementService/DeactivatePlacement.cs b/examples/Dfp/CSharp/v201211/PlacementService/DeactivatePlacement.cs new file mode 100644 index 00000000000..38ff2870b18 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/PlacementService/DeactivatePlacement.cs @@ -0,0 +1,120 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example deactivates all active placements. To determine which + /// placements exist, run GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// Tags: PlacementService.performPlacementAction + /// + class DeactivatePlacement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active placements. To determine which " + + "placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivatePlacement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201211.PlacementService); + + // Create Statement text to select active placements. + String statementText = "WHERE status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("status", + InventoryStatus.ACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + PlacementPage page = new PlacementPage(); + int offset = 0; + List placementIds = new List(); + + try { + do { + // Create a Statement to page through active placements. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get placements by Statement. + page = placementService.getPlacementsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID ='{1}', name ='{2}', and status ='{3}'" + + " will be deactivated.", i, placement.id, placement.name, placement.status); + placementIds.Add(placement.id.ToString()); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of placements to be deactivated: {0}", placementIds.Count); + + if (placementIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", placementIds.ToArray()))). + ToStatement(); + + // Create action. + DeactivatePlacements action = new DeactivatePlacements(); + + // Perform action. + UpdateResult result = placementService.performPlacementAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of placements deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No placements were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/PlacementService/GetAllPlacements.cs b/examples/Dfp/CSharp/v201211/PlacementService/GetAllPlacements.cs new file mode 100644 index 00000000000..5ee93f76784 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/PlacementService/GetAllPlacements.cs @@ -0,0 +1,91 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all placements. To create placements, run + /// CreatePlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// + class GetAllPlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all placements. To create placements, run " + + "CreatePlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllPlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201211.PlacementService); + + // Sets defaults for page and Statement. + PlacementPage page = new PlacementPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all ad units. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get ad units by Statement. + page = placementService.getPlacementsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID = '{1}' and name = '{2}' was found.", + i, placement.id, placement.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}" + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/PlacementService/GetPlacement.cs b/examples/Dfp/CSharp/v201211/PlacementService/GetPlacement.cs new file mode 100644 index 00000000000..dc908003a64 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/PlacementService/GetPlacement.cs @@ -0,0 +1,79 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets a placement by its ID. To determine which + /// placements exist, run GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacement + /// + class GetPlacement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a placement by its ID. To determine which placements " + + "exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPlacement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201211.PlacementService); + + // Set the ID of the placement to get. + long placementId = long.Parse(_T("INSERT_PLACEMENT_ID_HERE")); + + try { + // Get the placement. + Placement placement = placementService.getPlacement(placementId); + + if (placement != null) { + Console.WriteLine("Placement with ID = '{0}', name = '{1}', and status = '{2}' " + + "was found.", placement.id, placement.name, placement.status); + } else { + Console.WriteLine("No placement found for this ID."); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to get placement by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/PlacementService/GetPlacementsByStatement.cs b/examples/Dfp/CSharp/v201211/PlacementService/GetPlacementsByStatement.cs new file mode 100644 index 00000000000..cbc8d6fb415 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/PlacementService/GetPlacementsByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all active placements by using a Statement. To + /// create a placement, run CreatePlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// + class GetPlacementsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active placements by using a Statement. To create a " + + "placement, run CreatePlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPlacementsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201211.PlacementService); + + // Create a Statement to only select active placements. + Statement statement = new StatementBuilder("WHERE status = :status LIMIT 500").AddValue( + "status", InventoryStatus.ACTIVE.ToString()).ToStatement(); + + try { + // Get placements by Statement. + PlacementPage page = placementService.getPlacementsByStatement(statement); + + // Display results. + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID = '{1}', name ='{2}', and status = '{3}' " + + "was found.", i, placement.id, placement.name, placement.status); + i++; + } + } + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get placement by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/PlacementService/UpdatePlacements.cs b/examples/Dfp/CSharp/v201211/PlacementService/UpdatePlacements.cs new file mode 100644 index 00000000000..d45b7be1d44 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/PlacementService/UpdatePlacements.cs @@ -0,0 +1,105 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example updates all placements to allow for AdSense targeting + /// up to the first 500. To determine which placements exist, run + /// GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// Tags: PlacementService.updatePlacements + /// + class UpdatePlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates all placements to allow for AdSense targeting up to " + + "the first 500. To determine which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdatePlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201211.PlacementService); + + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201211.InventoryService); + + // Create a statement to select first 500 placements. + Statement filterStatement = new Statement(); + filterStatement.query = "LIMIT 500"; + + try { + // Get placements by statement. + PlacementPage page = placementService.getPlacementsByStatement(filterStatement); + + if (page.results != null) { + Placement[] placements = page.results; + + // Update each local placement object by enabling AdSense targeting. + foreach (Placement placement in placements) { + placement.targetingDescription = (string.IsNullOrEmpty(placement.description))? + "Generic description" : placement.description; + placement.targetingAdLocation = "All images on sports pages."; + placement.targetingSiteName = "http://code.google.com"; + placement.isAdSenseTargetingEnabled = true; + } + + // Update the placements on the server. + placements = placementService.updatePlacements(placements); + + // Display results. + if (placements != null) { + foreach (Placement placement in placements) { + Console.WriteLine("A placement with ID \"{0}\", name \"{1}\", and AdSense targeting" + + " enabled \"{2}\" was updated.", placement.id, placement.name, + placement.isAdSenseTargetingEnabled); + } + } else { + Console.WriteLine("No placements updated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to update placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/PublisherQueryLanguageService/GetAllCities.cs b/examples/Dfp/CSharp/v201211/PublisherQueryLanguageService/GetAllCities.cs new file mode 100644 index 00000000000..6c39b1657b4 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/PublisherQueryLanguageService/GetAllCities.cs @@ -0,0 +1,111 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all cities available to target. A full list of + /// available tables can be found at + /// http://code.google.com/apis/dfp/docs/reference/v201211/PublisherQueryLanguageService.html. + /// + /// Tags: PublisherQueryLanguageService.select + /// + class GetAllCities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all cities available to target. A full list of available " + + "tables can be found at " + + "http://code.google.com/apis/dfp/docs/reference/v201211/" + + "PublisherQueryLanguageService.html."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + PublisherQueryLanguageService pqlService = + (PublisherQueryLanguageService) user.GetService( + DfpService.v201211.PublisherQueryLanguageService); + + int pageSize = 500; + // Create statement to select all targetable cities. + String selectStatement = "SELECT * FROM City WHERE targetable = true LIMIT " + pageSize; + int offset = 0; + int resultSetSize = 0; + List allRows = new List(); + ResultSet resultSet; + + try { + do { + // For criteria that do not have a "targetable" property, that predicate + // may be left off, i.e. just "SELECT * FROM Browser_Groups LIMIT 500" + StatementBuilder statementBuilder = + new StatementBuilder(selectStatement + " OFFSET " + offset); + + // Get all cities. + resultSet = pqlService.select(statementBuilder.ToStatement()); + + // Collect all cities from each page. + allRows.AddRange(resultSet.rows); + + // Display results. + Console.WriteLine(PqlUtilities.ResultSetToString(resultSet)); + + offset += pageSize; + resultSetSize = resultSet.rows == null ? 0 : resultSet.rows.Length; + } while (resultSetSize == pageSize); + + Console.WriteLine("Number of results found: " + allRows.Count); + + // Optionally, save all rows to a CSV. + // Get a string array representation of the data rows. + resultSet.rows = allRows.ToArray(); + List rows = PqlUtilities.ResultSetToStringArrayList(resultSet); + + // Write the contents to a csv file. + CsvFile file = new CsvFile(); + file.Headers.AddRange(rows[0]); + file.Records.AddRange(rows.GetRange(1, rows.Count - 1).ToArray()); + file.Write("cities.csv"); + } catch (Exception ex) { + Console.WriteLine("Failed to get all cities. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/ReportService/DownloadReport.cs b/examples/Dfp/CSharp/v201211/ReportService/DownloadReport.cs new file mode 100644 index 00000000000..800784f6c22 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/ReportService/DownloadReport.cs @@ -0,0 +1,83 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.IO; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example downloads a completed report. To run a report, run + /// RunDeliveryReport.cs. + /// + /// Tags: ReportService.getReportDownloadURL + /// + class DownloadReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example downloads a completed report. To run a report, run " + + "RunDeliveryReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DownloadReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201211.ReportService); + + // Set the id of the completed report. + long reportJobId = long.Parse(_T("INSERT_REPORT_JOB_ID_HERE")); + String fileName = _T("INSERT_FILE_PATH_HERE"); + + try { + // Download report data. + string url = reportService.getReportDownloadURL(reportJobId, ExportFormat.CSV_EXCEL); + byte[] gzipReport = MediaUtilities.GetAssetDataFromUrl(url); + string reportContents = Encoding.UTF8.GetString(MediaUtilities.DeflateGZipData(gzipReport)); + + using (StreamWriter writer = new StreamWriter(fileName)) { + writer.Write(reportContents); + } + + // Display results. + Console.WriteLine("Report job with id '{0}' was downloaded to '{1}'.", reportJobId, + fileName); + } catch (Exception ex) { + Console.WriteLine("Failed to download report. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/ReportService/RunDeliveryReport.cs b/examples/Dfp/CSharp/v201211/ReportService/RunDeliveryReport.cs new file mode 100644 index 00000000000..42ce13e4ac4 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/ReportService/RunDeliveryReport.cs @@ -0,0 +1,104 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Threading; +using Google.Api.Ads.Dfp.Util.v201211; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example runs a report similar to the "Orders report" on the DFP + /// website with additional attributes and can filter to include just one + /// order. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunDeliveryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report similar to the \"Orders report\" on the DFP " + + "website with additional attributes and can filter to include just one order. To " + + "download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunDeliveryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201211.ReportService); + + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create statement object to filter for an order. + Statement filterStatement = new StatementBuilder("WHERE ORDER_ID = :id").AddValue( + "id", orderId).ToStatement(); + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER}; + reportJob.reportQuery.dimensionAttributes = new DimensionAttribute[] { + DimensionAttribute.ORDER_TRAFFICKER, DimensionAttribute.ORDER_START_DATE_TIME, + DimensionAttribute.ORDER_END_DATE_TIME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportJob.reportQuery.statement = filterStatement; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/ReportService/RunInventoryReport.cs b/examples/Dfp/CSharp/v201211/ReportService/RunInventoryReport.cs new file mode 100644 index 00000000000..40c76156a43 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/ReportService/RunInventoryReport.cs @@ -0,0 +1,97 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example runs a report equal to the "Whole network report" on the + /// DFP website. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunInventoryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Whole network report\" on the " + + "DFP website. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunInventoryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201211.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.DATE}; + reportJob.reportQuery.columns = new Column[] { + Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, + Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + Column.TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + Column.TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE + }; + reportJob.reportQuery.adUnitView = ReportQueryAdUnitView.HIERARCHICAL; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_WEEK; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run inventory report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/ReportService/RunMergedDeliveryReport.cs b/examples/Dfp/CSharp/v201211/ReportService/RunMergedDeliveryReport.cs new file mode 100644 index 00000000000..a79367edec5 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/ReportService/RunMergedDeliveryReport.cs @@ -0,0 +1,96 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example runs a report that an upgraded publisher would use to + /// include statistics before the upgrade. To download the report see + /// DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunMergedDeliveryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Orders report\" on the DFP " + + "website with additional attributes. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunMergedDeliveryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201211.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportQuery.dimensions = new Dimension[] {Dimension.ORDER}; + reportQuery.columns = new Column[] {Column.MERGED_AD_SERVER_IMPRESSIONS, + Column.MERGED_AD_SERVER_CLICKS, Column.MERGED_AD_SERVER_CTR, + Column.MERGED_AD_SERVER_CPM_AND_CPC_REVENUE, + Column.MERGED_AD_SERVER_AVERAGE_ECPM}; + reportJob.reportQuery = reportQuery; + + try { + // Run report job. + reportJob = reportService.runReportJob(reportJob); + + do { + Console.WriteLine("Report with ID '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS); + + if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with ID '{0}' failed to finish successfully.", + reportJob.id); + } else { + Console.WriteLine("Report job with ID '{0}' completed successfully.", reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/ReportService/RunReportWithCustomFields.cs b/examples/Dfp/CSharp/v201211/ReportService/RunReportWithCustomFields.cs new file mode 100644 index 00000000000..d3220cc3568 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/ReportService/RunReportWithCustomFields.cs @@ -0,0 +1,145 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; +using Google.Api.Ads.Dfp.Util.v201211; + +using System; +using System.Threading; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example runs a report that includes custom fields found in the + /// line items of an order. To download the report see DownloadReport.cs. + /// + /// Tag: ReportService.runReportJob + /// Tag: ReportService.getReportJob + /// Tag: LineItemService.getLineItemsByStatement + /// + class RunReportWithCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report that includes custom fields found in the " + + "line items of an order. To download the report see DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunReportWithCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201211.LineItemService); + // Get the ReportService. + ReportService reportService = + (ReportService) user.GetService(DfpService.v201211.ReportService); + + try { + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Sets defaults for page and filterStatement. + LineItemPage page = new LineItemPage(); + int offset = 0; + + // Create a statement to only select line items from a given order. + String filterText = "WHERE orderId = :orderId LIMIT 500"; + Statement filterStatement = + new StatementBuilder(filterText).AddValue("orderId", orderId).ToStatement(); + + + // Collect all line item custom field IDs for an order. + List customFieldIds = new List(); + do { + filterStatement.query = filterText + " OFFSET " + offset; + + // Get line items by statement. + page = lineItemService.getLineItemsByStatement(filterStatement); + + // Get custom field IDs from the line items of an order. + if (page.results != null) { + foreach (LineItem lineItem in page.results) { + if (lineItem.customFieldValues != null) { + foreach (BaseCustomFieldValue customFieldValue in lineItem.customFieldValues) { + if (!customFieldIds.Contains(customFieldValue.customFieldId)) { + customFieldIds.Add(customFieldValue.customFieldId); + } + } + } + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + + // Create statement to filter for an order. + filterStatement = + new StatementBuilder("WHERE ORDER_ID = :orderId").AddValue("orderId", orderId) + .ToStatement(); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportQuery.dimensions = new Dimension[] {Dimension.LINE_ITEM_ID, Dimension.LINE_ITEM_NAME}; + reportQuery.statement = filterStatement; + reportQuery.customFieldIds = customFieldIds.ToArray(); + reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS}; + reportJob.reportQuery = reportQuery; + + // Run report job. + reportJob = reportService.runReportJob(reportJob); + + do { + Console.WriteLine("Report with ID '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS); + + if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with ID '{0}' failed to finish successfully.", + reportJob.id); + } else { + Console.WriteLine("Report job with ID '{0}' completed successfully.", reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run cusom fields report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/ReportService/RunSalesReport.cs b/examples/Dfp/CSharp/v201211/ReportService/RunSalesReport.cs new file mode 100644 index 00000000000..486f7670050 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/ReportService/RunSalesReport.cs @@ -0,0 +1,93 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example runs a report equal to the "Sales by salespersons + /// report" on the DFP website. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunSalesReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Sales by salespersons report\" on" + + "the DFP website. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunSalesReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201211.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.SALESPERSON}; + reportJob.reportQuery.columns = new Column[] { + Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_AVERAGE_ECPM + }; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run sales report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs b/examples/Dfp/CSharp/v201211/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs new file mode 100644 index 00000000000..980ea549353 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs @@ -0,0 +1,105 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201211; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example approves all suggested ad units with 50 or more + /// requests. This feature is only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// Tags: SuggestedAdUnitService.performSuggestedAdUnitAction + /// + class ApproveSuggestedAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example approves all suggested ad units with 50 or more requests. " + + "This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ApproveSuggestedAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201211.SuggestedAdUnitService); + + // Create statement to select all suggested ad units with 50 or more + // requests. + string statementText = "WHERE numRequests >= 50"; + Statement filterStatement = new StatementBuilder(statementText).ToStatement(); + + try { + // Get suggested ad units by statement. + SuggestedAdUnitPage page = + suggestedAdUnitService.getSuggestedAdUnitsByStatement(filterStatement); + + int i = 0; + if (page != null && page.results != null) { + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and \"{2}\" will be " + + "approved.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + + Console.WriteLine("Number of suggested ad units to be approved: " + + page.totalResultSetSize); + + // Create action. + ApproveSuggestedAdUnit action = new ApproveSuggestedAdUnit(); + + // Perform action. + SuggestedAdUnitUpdateResult result = suggestedAdUnitService.performSuggestedAdUnitAction( + action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of suggested ad units approved: " + result.numChanges); + } else { + Console.WriteLine("No suggested ad units were approved."); + } + } else { + Console.WriteLine("No suggested ad units were approved."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to approve suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs b/examples/Dfp/CSharp/v201211/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs new file mode 100644 index 00000000000..34d13c2a58a --- /dev/null +++ b/examples/Dfp/CSharp/v201211/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs @@ -0,0 +1,94 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201211; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all suggested ad units. To approve suggested ad + /// units, run ApproveSuggestedAdUnits.cs. This feature is only available to + /// DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// + class GetAllSuggestedAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all suggested ad units. To approve suggested ad units, " + + "run ApproveSuggestedAdUnits.cs. This feature is only available to DFP premium " + + "solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllSuggestedAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201211.SuggestedAdUnitService); + + // Set defaults for page and filterStatement. + SuggestedAdUnitPage page = new SuggestedAdUnitPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all suggested ad units. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get suggested ad units by statement. + page = suggestedAdUnitService.getSuggestedAdUnitsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and number of requests " + + "\"{2}\" was found.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/SuggestedAdUnitService/GetSuggestedAdUnit.cs b/examples/Dfp/CSharp/v201211/SuggestedAdUnitService/GetSuggestedAdUnit.cs new file mode 100644 index 00000000000..28bd7d0cf52 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/SuggestedAdUnitService/GetSuggestedAdUnit.cs @@ -0,0 +1,83 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201211; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets a suggested ad unit by its ID. To determine which + /// suggested ad units exist, run GetAllSuggestedAdUnits.cs. This feature is + /// only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnit + /// + class GetSuggestedAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a suggested ad unit by its ID. To determine which " + + "suggested ad units exist, run GetAllSuggestedAdUnits.cs. This feature is only " + + "available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetSuggestedAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201211.SuggestedAdUnitService); + + // Set the ID of the suggested ad unit to get. + String suggestedAdUnitId = _T("INSERT_SUGGESTED_AD_UNIT_ID_HERE"); + + try { + // Get the suggested ad unit. + SuggestedAdUnit suggestedAdUnit = suggestedAdUnitService.getSuggestedAdUnit( + suggestedAdUnitId); + + if (suggestedAdUnit != null) { + Console.WriteLine("Suggested ad unit with ID \"{0}\", and number of requests \"{1}\" " + + "was found.", suggestedAdUnit.id, suggestedAdUnit.numRequests); + } else { + Console.WriteLine("No suggested ad unit found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs b/examples/Dfp/CSharp/v201211/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs new file mode 100644 index 00000000000..410be8ec2d5 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs @@ -0,0 +1,90 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201211; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets suggested ad units that have more than 50 requests. + /// The statement retrieves up to the maximum page size limit of 500. This + /// feature is only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// + class GetSuggestedUnitByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets suggested ad units that have more than 50 requests. The " + + "statement retrieves up to the maximum page size limit of 500. This feature is " + + "only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetSuggestedUnitByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201211.SuggestedAdUnitService); + + // Set the number of requests to 50 or more. + long NUMBER_OF_REQUESTS = 50L; + + // Create a statement to only select suggested ad units that have more + // than 50 requests. + Statement filterStatement = new StatementBuilder("WHERE numRequests > :numRequests LIMIT 500") + .AddValue("numRequests", NUMBER_OF_REQUESTS).ToStatement(); + + try { + // Get suggested ad units by statement. + SuggestedAdUnitPage page = suggestedAdUnitService.getSuggestedAdUnitsByStatement( + filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and number of requests " + + "\"{2}\" was found.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/TeamService/CreateTeams.cs b/examples/Dfp/CSharp/v201211/TeamService/CreateTeams.cs new file mode 100644 index 00000000000..78ebdb6ed49 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/TeamService/CreateTeams.cs @@ -0,0 +1,88 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using Google.Api.Ads.Dfp.Util.v201211; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates new teams. To determine which teams exist, run + /// GetAllTeams.cs. + /// + /// Tags: TeamService.createTeams + /// + class CreateTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new teams. To determine which teams exist, run " + + "GetAllTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201211.TeamService); + + try { + // Create an array to store local team objects. + Team[] teams = new Team[5]; + + for (int i = 0; i < 5; i++) { + Team team = new Team(); + team.name = "Team #" + i; + team.hasAllCompanies = false; + team.hasAllInventory = false; + teams[i] = team; + } + + // Create the teams on the server. + teams = teamService.createTeams(teams); + + if (teams != null && teams.Length > 0) { + foreach (Team newTeam in teams) { + Console.WriteLine("A team with ID \"{0}\", and name \"{1}\" was created.", + newTeam.id, newTeam.name); + } + } else { + Console.WriteLine("No teams created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create teams. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/TeamService/GetAllTeams.cs b/examples/Dfp/CSharp/v201211/TeamService/GetAllTeams.cs new file mode 100644 index 00000000000..fb6e1426b6a --- /dev/null +++ b/examples/Dfp/CSharp/v201211/TeamService/GetAllTeams.cs @@ -0,0 +1,89 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using Google.Api.Ads.Dfp.Util.v201211; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all teams. To create teams, run CreateTeams.cs. + /// + /// Tags: TeamService.getTeamsByStatement + /// + class GetAllTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams. To create teams, run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201211.TeamService); + + // Set defaults for page and filterStatement. + TeamPage page = new TeamPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all teams. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get teams by statement. + page = teamService.getTeamsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Team team in page.results) { + Console.WriteLine("{0}) Team with ID \"{1}\", name \"{2}\" was found.", + i, team.id, team.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all teams. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/TeamService/GetTeam.cs b/examples/Dfp/CSharp/v201211/TeamService/GetTeam.cs new file mode 100644 index 00000000000..ba002bad19f --- /dev/null +++ b/examples/Dfp/CSharp/v201211/TeamService/GetTeam.cs @@ -0,0 +1,78 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using Google.Api.Ads.Dfp.Util.v201211; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets a team by its ID. To determine which teams exist, + /// run GetAllTeams.cs. + /// + /// Tags: TeamService.getTeam + /// + class GetTeam : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a team by its ID. To determine which teams exist, run " + + "GetAllTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetTeam(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201211.TeamService); + + // Set the ID of the team to get. + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + + try { + // Get the team. + Team team = teamService.getTeam(teamId); + + if (team != null) { + Console.WriteLine("Team with ID \"{0}\"and name \"{1}\" was found.", team.id, team.name); + } else { + Console.WriteLine("No team found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get team by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/TeamService/GetTeamsByStatement.cs b/examples/Dfp/CSharp/v201211/TeamService/GetTeamsByStatement.cs new file mode 100644 index 00000000000..e052539d641 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/TeamService/GetTeamsByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using Google.Api.Ads.Dfp.Util.v201211; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all teams ordered by name. The statement retrieves + /// up to the maximum page size limit of 500. To create teams, + /// run CreateTeams.cs. + /// + /// Tags: TeamService.getTeamsByStatement + /// + class GetTeamsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams ordered by name. The statement retrieves up to " + + "the maximum page size limit of 500. To create teams, run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetTeamsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201211.TeamService); + + // Create a statement to order teams by name. + Statement filterStatement = new StatementBuilder("ORDER BY name LIMIT 500").ToStatement(); + + try { + // Get teams by statement. + TeamPage page = teamService.getTeamsByStatement(filterStatement); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (Team team in page.results) { + Console.WriteLine("{0}) Team with ID \"{1}\" and name \"{2}\" was found.", + i, team.id, team.name); + i++; + } + } + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get teams by statement. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/TeamService/UpdateTeams.cs b/examples/Dfp/CSharp/v201211/TeamService/UpdateTeams.cs new file mode 100644 index 00000000000..8dd584b96e0 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/TeamService/UpdateTeams.cs @@ -0,0 +1,107 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using Google.Api.Ads.Dfp.Util.v201211; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example updates teams by adding an ad unit to the first 5. To + /// determine which teams exist, run GetAllTeams.cs. To determine which ad + /// units exist, run GetAllAdUnits.cs. + /// + /// Tags: TeamService.getTeamsByStatement, TeamService.updateTeams + /// + class UpdateTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates teams by adding an ad unit to the first 5. To " + + "determine which teams exist, run GetAllTeams.cs. To determine which ad units " + + "exist, run GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201211.TeamService); + + // Set the ID of the ad unit to add to the teams. + String adUnitId = _T("INSERT_AD_UNIT_ID_HERE"); + + // Create a statement to select first 5 teams that aren't built-in. + Statement filterStatement = new StatementBuilder("WHERE id > 0 LIMIT 5").ToStatement(); + + try { + // Get the teams by statement. + TeamPage page = teamService.getTeamsByStatement(filterStatement); + + if (page.results != null) { + Team[] teams = page.results; + + // Update each local team object by adding the ad unit to it. + foreach (Team team in teams) { + // Don't add ad unit if the team has all inventory already. + if (!team.hasAllInventory) { + List adUnitIds = new List(); + if (team.adUnitIds != null) { + adUnitIds.AddRange(team.adUnitIds); + } + adUnitIds.Add(adUnitId); + team.adUnitIds = adUnitIds.ToArray(); + } + } + + // Update the teams on the server. + teams = teamService.updateTeams(teams); + + if (teams != null) { + foreach (Team team in teams) { + Console.WriteLine("A team with ID \"{0}\" and name \"{1}\" was updated.", + team.id, team.name); + } + } else { + Console.WriteLine("No teams updated."); + } + } else { + Console.WriteLine("No teams found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update teams. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/ThirdPartySlotService/ArchiveThirdPartySlots.cs b/examples/Dfp/CSharp/v201211/ThirdPartySlotService/ArchiveThirdPartySlots.cs new file mode 100644 index 00000000000..ec3419176cb --- /dev/null +++ b/examples/Dfp/CSharp/v201211/ThirdPartySlotService/ArchiveThirdPartySlots.cs @@ -0,0 +1,120 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using Google.Api.Ads.Dfp.Util.v201211; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example archives all active third party slots for a company. To + /// determine which third party slots exist, run GetAllThirdPartySlots.cs. + /// + /// Tags: ThirdPartSlotsService.getThirdPartySlotsByStatement + /// Tags: ThirdPartSlotsService.performThirdPartySlotsAction + /// + class ArchiveThirdPartySlot : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example archives all active third party slots for a company. To " + + "determine which third party slots exist, run GetAllThirdPartySlots.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ArchiveThirdPartySlot(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ThirdpartySlotService. + ThirdPartySlotService thirdPartySlotService = + (ThirdPartySlotService) user.GetService(DfpService.v201211.ThirdPartySlotService); + + //Set the company that the third party slots to archive belong to. + long companyId = long.Parse(_T("INSERT_COMPANY_ID_HERE")); + + // Create a statement to only select active third party slots. + String statementText = "WHERE status = :status AND companyId = :companyId LIMIT 500"; + Statement filterStatement = new StatementBuilder("").AddValue("status", + ThirdPartySlotStatus.ACTIVE.ToString()).AddValue("companyId", companyId).ToStatement(); + + // Set defaults for page and offset. + ThirdPartySlotPage page = new ThirdPartySlotPage(); + int offset = 0; + List thirdPartySlotIds = new List(); + + try { + do { + // Create a statement to page through active third party slots. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get third party slots by statement. + page = thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement); + + if (page.results != null) { + foreach (ThirdPartySlot thirdPartySlot in page.results) { + Console.WriteLine("Third party slot with ID \"{0}\" will be archived.", + thirdPartySlot.id); + thirdPartySlotIds.Add(thirdPartySlot.id.ToString()); + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of third party slots to be archived: " + thirdPartySlotIds.Count); + + if (thirdPartySlotIds.Count > 0) { + // Modify statement for action. + filterStatement.query = "WHERE id IN (" + string.Join(",", thirdPartySlotIds.ToArray()) + + ")"; + + // Create action. + ArchiveThirdPartySlots action = new ArchiveThirdPartySlots(); + + // Perform action. + UpdateResult result = thirdPartySlotService.performThirdPartySlotAction(action, + filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of third party slots archived: " + result.numChanges); + } else { + Console.WriteLine("No third party slots were archived."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to archive slots. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/ThirdPartySlotService/CreateThirdPartySlot.cs b/examples/Dfp/CSharp/v201211/ThirdPartySlotService/CreateThirdPartySlot.cs new file mode 100644 index 00000000000..3c5eb3997d9 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/ThirdPartySlotService/CreateThirdPartySlot.cs @@ -0,0 +1,98 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using Google.Api.Ads.Dfp.Util.v201211; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates a new third party slot. To determine which + /// third party slots exist, run GetAllThirdPartySlots.cs. + /// + /// Tags: ThirdPartySlotsService.createThirdPartySlot + /// + class CreateThirdPartySlot : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new third party slot. To determine which third " + + "party slots exist, run GetAllThirdPartySlots.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateThirdPartySlot(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ThirdpartySlotService. + ThirdPartySlotService thirdPartySlotService = + (ThirdPartySlotService) user.GetService(DfpService.v201211.ThirdPartySlotService); + + // Set the company ID to associate with this third party slot. + long companyId = long.Parse(_T("INSERT_COMPANY_ID_HERE")); + + // Set the external unique ID to associate with this third party slot. + string externalUniqueId = _T("INSERT_EXTERNAL_UNIQUE_ID_HERE"); + + // Set the external unique name to associate with this third party slot. + string externalUniqueName = _T("INSERT_EXTERNAL_UNIQUE_NAME_HERE"); + + // Set the creative IDs to associate with this third party slot. + long[] creativeIds = new long[] {long.Parse(_T("INSERT_CREATIVE_ID_HERE"))}; + + // Create the ThirdPartySlot object. + ThirdPartySlot thirdPartySlot = new ThirdPartySlot(); + thirdPartySlot.companyId = companyId; + thirdPartySlot.description = "Third party slot description."; + thirdPartySlot.externalUniqueId = externalUniqueId; + thirdPartySlot.externalUniqueName = externalUniqueName; + + // Set the creatives that the third party slots will represent. + thirdPartySlot.creativeIds = creativeIds; + + try { + // Create the third party slot. + thirdPartySlot = thirdPartySlotService.createThirdPartySlot(thirdPartySlot); + + if (thirdPartySlot != null) { + Console.WriteLine("A third party slot with ID \"{0}\" and named \"{1}\" was created.", + thirdPartySlot.id, thirdPartySlot.externalUniqueName); + } else { + Console.WriteLine("No third party slot created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create third party slots. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/ThirdPartySlotService/GetAllThirdPartySlots.cs b/examples/Dfp/CSharp/v201211/ThirdPartySlotService/GetAllThirdPartySlots.cs new file mode 100644 index 00000000000..8552037f1b2 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/ThirdPartySlotService/GetAllThirdPartySlots.cs @@ -0,0 +1,90 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using Google.Api.Ads.Dfp.Util.v201211; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all third party slots. To create third party slots, + /// run CreateThirdPartySlot.cs. + /// + /// Tags: ThirdPartSlotsService.getThirdPartySlotsByStatement + /// + class GetAllThirdPartySlots : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all third party slots. To create third party slots, " + + "run CreateThirdPartySlot.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllThirdPartySlots(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ThirdpartySlotService. + ThirdPartySlotService thirdPartySlotService = + (ThirdPartySlotService) user.GetService(DfpService.v201211.ThirdPartySlotService); + + // Sets defaults for page and filterStatement. + ThirdPartySlotPage page = new ThirdPartySlotPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get third party slots. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get third party slots by statement. + page = thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (ThirdPartySlot slot in page.results) { + Console.WriteLine("{0}) Third party slot with ID \"{1}\" was found.", i, slot.id); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + } catch (Exception ex) { + Console.WriteLine("Failed to get all third party slots. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/ThirdPartySlotService/GetThirdPartySlotsByStatement.cs b/examples/Dfp/CSharp/v201211/ThirdPartySlotService/GetThirdPartySlotsByStatement.cs new file mode 100644 index 00000000000..e35204131ae --- /dev/null +++ b/examples/Dfp/CSharp/v201211/ThirdPartySlotService/GetThirdPartySlotsByStatement.cs @@ -0,0 +1,87 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using Google.Api.Ads.Dfp.Util.v201211; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets archived third party slots. The statement retrieves + /// up to the maximum page size limit of 500. To create third party slots, run + /// CreateThirdPartySlot.cs. + /// + /// Tags: ThirdPartySlotService.getThirdPartySlotsByStatement + /// + class GetThirdPartySlotsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets archived third party slots. The statement retrieves up " + + "to the maximum page size limit of 500. To create third party slots, run " + + "CreateThirdPartySlot.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetThirdPartySlotsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ThirdpartySlotService. + ThirdPartySlotService thirdPartySlotService = + (ThirdPartySlotService) user.GetService(DfpService.v201211.ThirdPartySlotService); + + // Sets defaults for page and filterStatement. + ThirdPartySlotPage page = new ThirdPartySlotPage(); + Statement filterStatement = new StatementBuilder("WHERE status = :status LIMIT 500 ") + .AddValue("status", ThirdPartySlotStatus.ARCHIVED.ToString()).ToStatement(); + + try { + // Get third party slots by statement. + page = thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (ThirdPartySlot thirdPartySlot in page.results) { + Console.WriteLine("{0}) Third party slot with ID \"{1}\" was found.", + i, thirdPartySlot.id); + i++; + } + } + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get third party slots. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/ThirdPartySlotService/UpdateThirdPartySlots.cs b/examples/Dfp/CSharp/v201211/ThirdPartySlotService/UpdateThirdPartySlots.cs new file mode 100644 index 00000000000..5157c1938d4 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/ThirdPartySlotService/UpdateThirdPartySlots.cs @@ -0,0 +1,93 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using Google.Api.Ads.Dfp.Util.v201211; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example updates the first third party slot description. + /// + /// Tags: ThirdPartySlotsService.getThirdPartySlotsByStatement + /// Tags:, ThirdPartySlotsService.updateThirdPartySlots + /// + class UpdateThirdPartySlots : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the first third party slot description."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateThirdPartySlots(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ThirdpartySlotService. + ThirdPartySlotService thirdPartySlotService = + (ThirdPartySlotService) user.GetService(DfpService.v201211.ThirdPartySlotService); + + // Create a statement to get one active third party slot. + Statement filterStatement = new StatementBuilder("WHERE status = :status LIMIT 1").AddValue( + "status", ThirdPartySlotStatus.ACTIVE.ToString()).ToStatement(); + + try { + // Get third party slot by statement. + ThirdPartySlotPage page = + thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement); + + if (page.results != null) { + // Update each third party slot by changing its description. + foreach (ThirdPartySlot slot in page.results) { + slot.description = "Updated description"; + + // Update the third party slot on the server. + ThirdPartySlot updatedSlot = thirdPartySlotService.updateThirdPartySlot(slot); + + // Display results. + if (updatedSlot != null) { + Console.WriteLine("A third party slot with ID \"{0}\" and description \"{1}\" " + + "was updated.", updatedSlot.id, updatedSlot.description); + } else { + Console.WriteLine("No third party slot was updated."); + } + } + } else { + Console.WriteLine("No third party slots found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update third party slots. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/UserService/CreateUsers.cs b/examples/Dfp/CSharp/v201211/UserService/CreateUsers.cs new file mode 100644 index 00000000000..f3865fc665a --- /dev/null +++ b/examples/Dfp/CSharp/v201211/UserService/CreateUsers.cs @@ -0,0 +1,100 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example creates new users. To determine which users + /// exist, run GetAllUsers.cs. + /// + /// Tags: UserService.createUsers + /// + class CreateUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new users. To determine which users " + + "exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201211.UserService); + + // Set the user's email addresses and names. + List emailAndNames = new List(); + emailAndNames.Add(new String[] {_T("INSERT_EMAIL_ADDRESS_HERE"), _T("INSERT_NAME_HERE")}); + emailAndNames.Add(new String[] {_T("INSERT_ANOTHER_EMAIL_ADDRESS_HERE"), + _T("INSERT_ANOTHER_NAME_HERE")}); + + // Roles can be obtained by running GetAllRoles.cs. + long roleId = long.Parse(_T("INSERT_ROLE_ID_HERE")); + + // Create an array to store local user objects. + User[] users = new User[emailAndNames.Count]; + + for (int i = 0; i < users.Length; i++) { + // Create the new user structure. + User newUser = new User(); + newUser.email = emailAndNames[i][0]; + newUser.name = emailAndNames[i][1]; + newUser.roleId = roleId; + newUser.preferredLocale = "en_US"; + + users[i] = newUser; + } + + try { + // Create the users. + users = userService.createUsers(users); + + if (users != null) { + foreach (User newUser in users) { + Console.WriteLine("A user with ID = '{0}', email = '{1}', and role = '{2}' " + + "was created.", newUser.id, newUser.email, newUser.roleName); + } + } else { + Console.WriteLine("No users created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/UserService/DeactivateUser.cs b/examples/Dfp/CSharp/v201211/UserService/DeactivateUser.cs new file mode 100644 index 00000000000..fc6b5ccf1e9 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/UserService/DeactivateUser.cs @@ -0,0 +1,123 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example deactivates a user. Deactivated users can no longer make + /// requests to the API. The user making the request cannot deactivate itself. + /// To determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserService.getUsersByStatement, UserService.performUserAction + /// + class DeactivateUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates a user. Deactivated users can no longer make " + + "requests to the API. The user making the request cannot deactivate itself. " + + "To determine which users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201211.UserService); + + // Set the ID of the user to deactivate + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create Statement text to select user by id. + string statementText = "WHERE id = :userId LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("userId", userId).ToStatement(); + + // Sets defaults for page and offset. + UserPage page = new UserPage(); + int offset = 0; + List userIds = new List(); + + try { + do { + // Create a Statement to page through users. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get users by Statement. + page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User userResult in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and status = '{3}'" + + " will be deactivated.", i, userResult.id, userResult.email, + userResult.isActive ? "ACTIVE" : "INACTIVE"); + userIds.Add(userResult.id.ToString()); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of users to be deactivated: {0}", page.totalResultSetSize); + + if (userIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", userIds.ToArray()))). + ToStatement(); + + // Create action. + DeactivateUsers action = new DeactivateUsers(); + + // Perform action. + UpdateResult result = userService.performUserAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of users deactivated: {0}" + result.numChanges); + } else { + Console.WriteLine("No users were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/UserService/GetAllRoles.cs b/examples/Dfp/CSharp/v201211/UserService/GetAllRoles.cs new file mode 100644 index 00000000000..38b858c77a5 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/UserService/GetAllRoles.cs @@ -0,0 +1,77 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all roles. This example can be used to determine + /// which role ID is needed when getting and creating users. + /// + /// Tags: UserService.getAllRoles + /// + class GetAllRoles : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all roles. This example can be used to determine which " + + "role ID is needed when getting and creating users."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllRoles(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201211.UserService); + + try { + // Get all roles. + Role[] roles = userService.getAllRoles(); + int numRoles = 0; + if (roles != null && roles.Length > 0) { + foreach (Role role in roles) { + Console.WriteLine("Role with ID = '{0}' and name ='{1}' was found.", role.id, + role.name); + } + numRoles = roles.Length; + } + + Console.WriteLine("Number of results found: " + numRoles); + } catch (Exception ex) { + Console.WriteLine("Failed to get all roles. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/UserService/GetAllUsers.cs b/examples/Dfp/CSharp/v201211/UserService/GetAllUsers.cs new file mode 100644 index 00000000000..cb1b4b7bb3e --- /dev/null +++ b/examples/Dfp/CSharp/v201211/UserService/GetAllUsers.cs @@ -0,0 +1,87 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all users. To create users, run CreateUsers.cs. + /// + /// Tags: UserService.getUsersByStatement + /// + class GetAllUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all users. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201211.UserService); + + // Sets defaults for page and Statement. + UserPage page = new UserPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all users. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get users by Statement. + page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User usr in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and role = '{3}'" + + " was found.", i, usr.id, usr.email, usr.roleName); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/UserService/GetCurrentUser.cs b/examples/Dfp/CSharp/v201211/UserService/GetCurrentUser.cs new file mode 100644 index 00000000000..7058ef6cea5 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/UserService/GetCurrentUser.cs @@ -0,0 +1,71 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets current user. To create users, run CreateUsers.cs. + /// + /// Tags: UserService.getCurrentUser + /// + class GetCurrentUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets current user. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCurrentUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201211.UserService); + + try { + // Get the current user. + User usr = userService.getCurrentUser(); + + if (usr != null) { + Console.WriteLine("User with ID = '{0}', email = '{1}', and role = '{2}' is the " + + "current user.", usr.id, usr.email, usr.roleName); + } else { + Console.WriteLine("The current user could not be retrieved."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get current user. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/UserService/GetUser.cs b/examples/Dfp/CSharp/v201211/UserService/GetUser.cs new file mode 100644 index 00000000000..7ea5f323885 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/UserService/GetUser.cs @@ -0,0 +1,76 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets a user by its ID. To create users, run + /// CreateUsers.cs. + /// + /// Tags: UserService.getUser + /// + class GetUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets a user by its ID. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201211.UserService); + + // Set the ID of the user to get. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + try { + // Get the user. + User usr = userService.getUser(userId); + + if (usr != null) { + Console.WriteLine("User with ID = '{0}', email = '{1}', and role = '{2}' was found.", + usr.id, usr.email, usr.roleName); + } else { + Console.WriteLine("No user found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/UserService/GetUsersByStatement.cs b/examples/Dfp/CSharp/v201211/UserService/GetUsersByStatement.cs new file mode 100644 index 00000000000..459feca0ee5 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/UserService/GetUsersByStatement.cs @@ -0,0 +1,82 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all users sorted by name. The Statement retrieves + /// up to the maximum page size limit of 500. To create new users, + /// run CreateUsers.cs. + /// + /// Tags: UserService.getUsersByStatement + /// + class GetUsersByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return " This code example gets all users sorted by name. The Statement retrieves " + + "up to the maximum page size limit of 500. To create new users, " + + "run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUsersByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201211.UserService); + + // Create a Statement to get all users sorted by name. + Statement statement = new Statement(); + statement.query = "ORDER BY name LIMIT 500"; + + try { + // Get users by Statement. + UserPage page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User usr in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and role = '{3}'" + + " was found.", i, usr.id, usr.email, usr.roleName); + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/UserService/UpdateUsers.cs b/examples/Dfp/CSharp/v201211/UserService/UpdateUsers.cs new file mode 100644 index 00000000000..5cc81457b63 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/UserService/UpdateUsers.cs @@ -0,0 +1,96 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example updates all users by adding "Sr." to the end of each + /// name (after a very large baby boom and lack of creativity). To + /// determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserService.getUsersByStatement, UserService.updateUsers + /// + class UpdateUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates all users by adding 'Sr.' to the end of each " + + "name (after a very large baby boom and lack of creativity). To " + + "determine which users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserService. + UserService userService = (UserService) dfpUser.GetService(DfpService.v201211.UserService); + + // Create a Statement to get all users. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get users by Statement. + UserPage page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + User[] users = page.results; + + // Update each local users object by changing its name. + foreach (User user in users) { + user.name = user.name + " Sr."; + } + + // Update the users on the server. + users = userService.updateUsers(users); + + if (users != null) { + foreach (User user in users) { + Console.WriteLine("A user with ID = '{0}', name ='{1}', and role = '{2}'" + + " was updated.", user.id, user.name, user.roleName); + } + } else { + Console.WriteLine("No users updated."); + } + } else { + Console.WriteLine("No users found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/UserTeamAssociationService/CreateUserTeamAssociations.cs b/examples/Dfp/CSharp/v201211/UserTeamAssociationService/CreateUserTeamAssociations.cs new file mode 100644 index 00000000000..c5edb376b72 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/UserTeamAssociationService/CreateUserTeamAssociations.cs @@ -0,0 +1,98 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example adds a user to a team by creating an association + /// between the two. To determine which teams exist, run GetAllTeams.cs. To + /// determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.createUserTeamAssociations + /// + class CreateUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a user to a team by creating an association between the " + + "two. To determine which teams exist, run GetAllTeams.cs. To determine which users " + + "exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201211.UserTeamAssociationService); + + // Set the users and team to add them to. + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + long[] userIds = new long[] {long.Parse(_T("INSERT_USER_ID_HERE"))}; + + // Create an array to store local user team association objects. + UserTeamAssociation[] userTeamAssociations = new UserTeamAssociation[userIds.Length]; + + // For each user, associate it with the given team. + int i = 0; + + foreach (long userId in userIds) { + UserTeamAssociation userTeamAssociation = new UserTeamAssociation(); + userTeamAssociation.userId = userId; + userTeamAssociation.teamId = teamId; + userTeamAssociations[i++] = userTeamAssociation; + } + + try { + // Create the user team associations on the server. + userTeamAssociations = + userTeamAssociationService.createUserTeamAssociations(userTeamAssociations); + + if (userTeamAssociations != null) { + foreach (UserTeamAssociation userTeamAssociation in userTeamAssociations) { + Console.WriteLine("A user team association between user with ID \"{0}\" and team " + + "with ID \"{1}\" was created.", userTeamAssociation.userId, + userTeamAssociation.teamId); + } + } else { + Console.WriteLine("No user team associations created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/UserTeamAssociationService/DeleteUserTeamAssociations.cs b/examples/Dfp/CSharp/v201211/UserTeamAssociationService/DeleteUserTeamAssociations.cs new file mode 100644 index 00000000000..c12bced48ca --- /dev/null +++ b/examples/Dfp/CSharp/v201211/UserTeamAssociationService/DeleteUserTeamAssociations.cs @@ -0,0 +1,121 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example removes the user from all its teams. To determine which + /// users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.performUserTeamAssociationAction + /// + class DeleteUserTeamAssociation : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example removes the user from all its teams. To determine which " + + "users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeleteUserTeamAssociation(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201211.UserTeamAssociationService); + + // Set the user to remove from its teams. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create filter text to select user team associations by the user ID. + String statementText = "WHERE userId = :userId LIMIT 500"; + Statement filterStatement = new StatementBuilder("").AddValue("userId", userId). + ToStatement(); + + // Set defaults for page and offset. + UserTeamAssociationPage page = new UserTeamAssociationPage(); + int offset = 0; + + try { + do { + // Create a statement to page through user team associations. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get user team associations by statement. + page = userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and " + + "team with ID \"{2}\" will be deleted.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of teams that the user will be removed from: " + + page.totalResultSetSize); + + if (page.totalResultSetSize > 0) { + // Modify statement for action. + filterStatement.query = "WHERE userId = :userId"; + + // Create action. + DeleteUserTeamAssociations action = new DeleteUserTeamAssociations(); + + // Perform action. + UpdateResult result = + userTeamAssociationService.performUserTeamAssociationAction(action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of teams that the user was removed from: " + + result.numChanges); + } else { + Console.WriteLine("No user team associations were deleted."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to delete user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/UserTeamAssociationService/GetAllUserTeamAssociations.cs b/examples/Dfp/CSharp/v201211/UserTeamAssociationService/GetAllUserTeamAssociations.cs new file mode 100644 index 00000000000..c2bbd5fa776 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/UserTeamAssociationService/GetAllUserTeamAssociations.cs @@ -0,0 +1,93 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all user team associations. To create user team + /// associations, run CreateUserTeamAssociations.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// + class GetAllUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all user team associations. To create user team " + + "associations, run CreateUserTeamAssociations.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201211.UserTeamAssociationService); + + // Set defaults for page and filterStatement. + UserTeamAssociationPage page = new UserTeamAssociationPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all user team associations. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get user team associations by statement. + page = userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and " + + "team with ID \"{2}\" was found.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}." + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/UserTeamAssociationService/GetUserTeamAssociation.cs b/examples/Dfp/CSharp/v201211/UserTeamAssociationService/GetUserTeamAssociation.cs new file mode 100644 index 00000000000..41943d545a5 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/UserTeamAssociationService/GetUserTeamAssociation.cs @@ -0,0 +1,84 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets a user team association by the user and team ID. + /// To determine which teams exist, run GetAllTeams.cs. To determine which + /// users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociation + /// + class GetUserTeamAssociation : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a user team association by the user and team ID. To " + + "determine which teams exist, run GetAllTeams.cs. To determine which users exist, " + + "run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUserTeamAssociation(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201211.UserTeamAssociationService); + + // Set the IDs of the user and team to get the association for. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + + try { + // Get the user team association. + UserTeamAssociation userTeamAssociation = userTeamAssociationService.getUserTeamAssociation( + teamId, userId); + + if (userTeamAssociation != null) { + Console.WriteLine("User team association between user with ID \"{0}\" and team with " + + "ID \"{1}\" was found.", userTeamAssociation.userId, userTeamAssociation.teamId); + } else { + Console.WriteLine("No user team association found."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs b/examples/Dfp/CSharp/v201211/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs new file mode 100644 index 00000000000..e0b496e10b2 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs @@ -0,0 +1,98 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example gets all teams that the current user belongs to. The + /// statement retrieves up to the maximum page size limit of 500. To create + /// teams, run CreateTeams.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// Tags: UserService.getCurrentUser + /// + class GetUserTeamAssociationsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams that the current user belongs to. The " + + "statement retrieves up to the maximum page size limit of 500. To create teams, " + + "run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUserTeamAssociationsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201211.UserTeamAssociationService); + + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201211.UserService); + + try { + // Get the current user. + long currentUserId = userService.getCurrentUser().id; + + // Create filter text to select user team associations by the user ID. + String statementText = "WHERE userId = :userId LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText). + AddValue("userId", currentUserId).ToStatement(); + + // Get user team associations by statement. + UserTeamAssociationPage page = + userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and team " + + "with ID \"{2}\" was found.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201211/UserTeamAssociationService/UpdateUserTeamAssociations.cs b/examples/Dfp/CSharp/v201211/UserTeamAssociationService/UpdateUserTeamAssociations.cs new file mode 100644 index 00000000000..8846ab64e92 --- /dev/null +++ b/examples/Dfp/CSharp/v201211/UserTeamAssociationService/UpdateUserTeamAssociations.cs @@ -0,0 +1,107 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201211 { + /// + /// This code example updates user team associations by setting the + /// overridden access type to read only for all teams that the user belongs + /// to. To determine which users exists, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// Tags: UserTeamAssociationService.updateUserTeamAssociations + /// + class UpdateUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates user team associations by setting the overridden " + + "access type to read only for all teams that the user belongs to. To determine " + + "which users exists, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201211.UserTeamAssociationService); + + // Set the user to set to read only access within its teams. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create filter text to select user team associations by the user ID. + String statementText = "WHERE userId = :userId LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText). + AddValue("userId", userId).ToStatement(); + + try { + // Get user team associations by statement. + UserTeamAssociationPage page = + userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + if (page.results != null) { + UserTeamAssociation[] userTeamAssociations = page.results; + + // Update each local user team association to read only access. + foreach (UserTeamAssociation userTeamAssociation in userTeamAssociations) { + userTeamAssociation.overriddenTeamAccessType = TeamAccessType.READ_ONLY; + } + + // Update the user team associations on the server. + userTeamAssociations = + userTeamAssociationService.updateUserTeamAssociations(userTeamAssociations); + + if (userTeamAssociations != null) { + foreach (UserTeamAssociation userTeamAssociation in userTeamAssociations) { + Console.WriteLine("User team association between user with ID \"{0}\" and team " + + "with ID \"{1}\" was updated to access type \"{2}\".", userTeamAssociation.userId, + userTeamAssociation.teamId, userTeamAssociation.overriddenTeamAccessType); + } + } else { + Console.WriteLine("No user team associations updated."); + } + } else { + Console.WriteLine("No user team associations found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ActivityGroupService/CreateActivityGroups.cs b/examples/Dfp/CSharp/v201302/ActivityGroupService/CreateActivityGroups.cs new file mode 100644 index 00000000000..198ddfaf173 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ActivityGroupService/CreateActivityGroups.cs @@ -0,0 +1,96 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates new activity groups. To determine which activity + /// groups exist, run GetAllActivityGroups.cs. + /// + /// Tags: ActivityGroupService.createActivityGroups + /// + class CreateActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new activity groups. To determine which activity " + + "groups exist, run GetAllActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201302.ActivityGroupService); + + // Set the ID of the advertiser company this activity group is associated + // with. + long advertiserCompanyId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Create a short-term activity group. + ActivityGroup shortTermActivityGroup = new ActivityGroup(); + shortTermActivityGroup.name = "Short-term activity group #" + GetTimeStamp(); + shortTermActivityGroup.companyIds = new long[] {advertiserCompanyId}; + shortTermActivityGroup.clicksLookback = 1; + shortTermActivityGroup.impressionsLookback = 1; + + // Create a long-term activity group. + ActivityGroup longTermActivityGroup = new ActivityGroup(); + longTermActivityGroup.name = "Long-term activity group #" + GetTimeStamp(); + longTermActivityGroup.companyIds = new long[] {advertiserCompanyId}; + longTermActivityGroup.clicksLookback = 30; + longTermActivityGroup.impressionsLookback = 30; + + try { + // Create the activity groups on the server. + ActivityGroup[] activityGroups = activityGroupService.createActivityGroups( + new ActivityGroup[] {shortTermActivityGroup, longTermActivityGroup}); + + // Display results. + if (activityGroups != null) { + foreach (ActivityGroup activityGroup in activityGroups) { + Console.WriteLine("An activity group with ID \"{0}\" and name \"{1}\" was created.", + activityGroup.id, activityGroup.name); + } + } else { + Console.WriteLine("No activity groups were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ActivityGroupService/GetActiveActivityGroups.cs b/examples/Dfp/CSharp/v201302/ActivityGroupService/GetActiveActivityGroups.cs new file mode 100644 index 00000000000..2916ee17f09 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ActivityGroupService/GetActiveActivityGroups.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; +using Google.Api.Ads.Dfp.Util.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all active activity groups. To create activity + /// groups, run CreateActivityGroups.cs. + /// + /// Tags: ContactService.getContactsByStatement + /// + class GetActiveActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active activity groups. To create activity groups, " + + "run CreateActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActiveActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201302.ActivityGroupService); + + Statement filterStatement = new StatementBuilder("").AddValue( + "status", ActivityGroupStatus.ACTIVE.ToString()).ToStatement(); + + // Set defaults for page and filterStatement. + ActivityGroupPage page; + int offset = 0; + + try { + do { + // Create a statement to get all content. + filterStatement.query = "WHERE status = :status ORDER BY id LIMIT 500 OFFSET " + + offset.ToString(); + + + // Get contacts by statement. + page = activityGroupService.getActivityGroupsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (ActivityGroup activityGroup in page.results) { + Console.WriteLine("{0}) Activity group with ID \"{1}\" and name \"{2}\" was found.", + i, activityGroup.id, activityGroup.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ActivityGroupService/GetAllActivityGroups.cs b/examples/Dfp/CSharp/v201302/ActivityGroupService/GetAllActivityGroups.cs new file mode 100644 index 00000000000..525268d6a52 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ActivityGroupService/GetAllActivityGroups.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; +using Google.Api.Ads.Dfp.Util.v201302; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all activity groups. To create activity groups, run + /// CreateActivityGroups.cs. + /// + /// Tags: ActivityGroupService.getActivityGroupsByStatement + /// + class GetAllActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all activity groups. To create activity groups, run " + + "CreateActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201302.ActivityGroupService); + + ActivityGroupPage page; + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + filterStatement.query = "ORDER BY id LIMIT 500 OFFSET " + offset.ToString(); + // Get activity groups by statement. + page = activityGroupService.getActivityGroupsByStatement(filterStatement); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + + foreach (ActivityGroup activityGroup in page.results) { + Console.WriteLine("{0}) Activity group with ID \"{1}\" and name \"{2}\" was " + + "found.", i, activityGroup.id, activityGroup.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ActivityGroupService/UpdateActivityGroups.cs b/examples/Dfp/CSharp/v201302/ActivityGroupService/UpdateActivityGroups.cs new file mode 100644 index 00000000000..1b7866ce8cf --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ActivityGroupService/UpdateActivityGroups.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; +using Google.Api.Ads.Dfp.Util.v201302; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example updates activity groups by adding a company. To + /// determine which activity groups exist, run GetAllActivityGroups.cs. + /// + /// Tags: ActivityGroupService.getActivityGroup + /// Tags: ActivityGroupService.updateActivityGroups + /// + class UpdateActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates activity groups by adding a company. To determine " + + "which activity groups exist, run GetAllActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201302.ActivityGroupService); + + // Set the ID of the activity group and the company to update it with. + int activityGroupId = int.Parse(_T("INSERT_ACTIVITY_GROUP_ID_HERE")); + long advertiserCompanyId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + try { + // Get the activity group. + ActivityGroup activityGroup = activityGroupService.getActivityGroup(activityGroupId); + + // Update the companies. + List companyIds = new List(activityGroup.companyIds); + companyIds.Add(advertiserCompanyId); + activityGroup.companyIds = companyIds.ToArray(); + + // Update the activity groups on the server. + ActivityGroup[] activityGroups = activityGroupService.updateActivityGroups( + new ActivityGroup[] {activityGroup}); + + // Display results. + if (activityGroups != null) { + foreach (ActivityGroup updatedActivityGroup in activityGroups) { + Console.WriteLine("Activity group with ID \"{0}\" and name \"{1}\" was updated.", + updatedActivityGroup.id, updatedActivityGroup.name); + } + } else { + Console.WriteLine("No activity groups were updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ActivityService/CreateActivities.cs b/examples/Dfp/CSharp/v201302/ActivityService/CreateActivities.cs new file mode 100644 index 00000000000..11ff978f2e5 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ActivityService/CreateActivities.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates new activities. To determine which activities + /// exist, run GetAllActivities.cs. + /// + /// Tags: ActivityService.createActivities + /// + class CreateActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new activities. To determine which activities exist, " + + "run GetAllActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201302.ActivityService); + + // Set the ID of the activity group this activity is associated with. + int activityGroupId = int.Parse(_T("INSERT_ACTIVITY_GROUP_ID_HERE")); + + // Create a daily visits activity. + Activity dailyVisitsActivity = new Activity(); + dailyVisitsActivity.name = "Activity #" + GetTimeStamp(); + dailyVisitsActivity.activityGroupId = activityGroupId; + dailyVisitsActivity.type = ActivityType.DAILY_VISITS; + + // Create a custom activity. + Activity customActivity = new Activity(); + customActivity.name = "Activity #" + GetTimeStamp(); + customActivity.activityGroupId = activityGroupId; + customActivity.type = ActivityType.CUSTOM; + + try { + // Create the activities on the server. + Activity[] activities = activityService.createActivities( + new Activity[] {dailyVisitsActivity, customActivity}); + + // Display results. + if (activities != null) { + foreach (Activity newActivity in activities) { + Console.WriteLine("An activity with ID \"{0}\", name \"{1}\", and type \"{2}\" was " + + "created.\n", newActivity.id, newActivity.name, newActivity.type); + } + } else { + Console.WriteLine("No activities were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create activities. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ActivityService/GetActiveActivities.cs b/examples/Dfp/CSharp/v201302/ActivityService/GetActiveActivities.cs new file mode 100644 index 00000000000..fa5fdb10be4 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ActivityService/GetActiveActivities.cs @@ -0,0 +1,100 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; +using Google.Api.Ads.Dfp.Util.v201302; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all active activities. To create activities, + /// run CreateActivities.cs. + /// + /// Tags: ActivityService.getActivitiesByStatement + /// + class GetActiveActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active activities. To create activities, run " + + "CreateActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActiveActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201302.ActivityService); + + // Set the ID of the activity group these activities are associated with. + long activityGroupId = long.Parse(_T("INSERT_ACTIVITY_GROUP_ID_HERE")); + + // Statement parts to help build a statement that only selects active + // activities. + Statement filterStatement = new StatementBuilder(""). + AddValue("activityGroupId", activityGroupId). + AddValue("status", ActivityStatus.ACTIVE.ToString()). + ToStatement(); + + int offset = 0; + ActivityPage page; + + try { + do { + filterStatement.query = "WHERE activityGroupId = :activityGroupId and status = :status " + + "ORDER BY id LIMIT 500 OFFSET " + offset; + + page = activityService.getActivitiesByStatement(filterStatement); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (Activity activity in page.results) { + Console.WriteLine("{0}) Activity with ID \"{1}\", name \"{2}\", and type \"{3}\" " + + "was found.", i, activity.id, activity.name, activity.type); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}.", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get activities. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ActivityService/GetAllActivities.cs b/examples/Dfp/CSharp/v201302/ActivityService/GetAllActivities.cs new file mode 100644 index 00000000000..f81c931e19b --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ActivityService/GetAllActivities.cs @@ -0,0 +1,132 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; +using Google.Api.Ads.Dfp.Util.v201302; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all activities. To create activities, run + /// CreateActivities.cs. + /// + /// Tags: ActivityService.getActivitiesByStatement + /// Tags: ActivityGroupService.getActivityGroupsByStatement + /// + class GetAllActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all activities. To create activities, run " + + "CreateActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201302.ActivityService); + + int totalResultsCounter = 0; + + try { + long[] activityGroupIds = getAllActivityGroupIds(user); + + foreach (long activityGroupId in activityGroupIds) { + Statement filterStatement = new StatementBuilder("").AddValue( + "activityGroupId", activityGroupId).ToStatement(); + + ActivityPage page = new ActivityPage(); + int offset = 0; + + do { + filterStatement.query = "WHERE activityGroupId = :activityGroupId ORDER BY id " + + "LIMIT 500 OFFSET " + offset; + // Get activities by statement. + page = activityService.getActivitiesByStatement(filterStatement); + + // Display results. + if (page.results != null) { + foreach (Activity activity in page.results) { + Console.WriteLine("{0}) Activity with ID \"{1}\", name \"{2}\", type \"{3}\", " + + "and activity group ID \"{4}\" was found.\n", totalResultsCounter, + activity.id, activity.name, activity.type, activityGroupId); + totalResultsCounter++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + } + Console.WriteLine("Number of results found: {0}.", totalResultsCounter); + } catch (Exception ex) { + Console.WriteLine("Failed to get contacts. Exception says \"{0}\"", ex.Message); + } + } + + /// + /// Get the list of all activity group ids. + /// + /// The DfpUser. + /// A list of ids for all the activity groups. + private long[] getAllActivityGroupIds(DfpUser user) { + List activityGroupIds = new List(); + + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201302.ActivityGroupService); + + ActivityGroupPage page; + Statement filterStatement = new Statement(); + int offset = 0; + + do { + // Create a statement to get all activity groups. + filterStatement.query = "ORDER BY id LIMIT 500 OFFSET " + offset.ToString(); + + // Get activity groups by statement. + page = activityGroupService.getActivityGroupsByStatement(filterStatement); + if (page.results != null) { + foreach (ActivityGroup activityGroup in page.results) { + activityGroupIds.Add(activityGroup.id); + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + return activityGroupIds.ToArray(); + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ActivityService/UpdateActivities.cs b/examples/Dfp/CSharp/v201302/ActivityService/UpdateActivities.cs new file mode 100644 index 00000000000..1a58baf7574 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ActivityService/UpdateActivities.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; +using Google.Api.Ads.Dfp.Util.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example updates activity expected URLs. To determine which + /// activities exist, run GetAllActivities.cs. + /// + /// Tags: ActivityService.getActivity + /// Tags: ActivityService.updateActivities + /// + class UpdateActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates activity expected URLs. To determine which activities " + + "exist, run GetAllActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201302.ActivityService); + + // Set the ID of the activity to update. + int activityId = int.Parse(_T("INSERT_ACTIVITY_ID_HERE")); + + try { + // Get the activity. + Activity activity = activityService.getActivity(activityId); + + // Update the expected URL. + activity.expectedURL = "https://www.google.com"; + + // Update the activity on the server. + Activity[] activities = activityService.updateActivities(new Activity[] {activity}); + + // Display results. + if (activities != null) { + foreach (Activity updatedActivity in activities) { + Console.WriteLine("Activity with ID \"{0}\" and name \"{1}\" was updated.", + updatedActivity.id, updatedActivity.name); + } + } else { + Console.WriteLine("No activities were updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update activities. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/AudienceSegmentService/GetAllAudienceSegments.cs b/examples/Dfp/CSharp/v201302/AudienceSegmentService/GetAllAudienceSegments.cs new file mode 100644 index 00000000000..b534ba81d8c --- /dev/null +++ b/examples/Dfp/CSharp/v201302/AudienceSegmentService/GetAllAudienceSegments.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all audience segments. + /// + /// Tags: AudienceSegmentService.getAudienceSegmentsByStatement + /// + class GetAllAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all audience segments."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = + (AudienceSegmentService) user.GetService(DfpService.v201302.AudienceSegmentService); + + // Set defaults for page and Statement. + AudienceSegmentPage page = new AudienceSegmentPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all creatives. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get audience segment by Statement. + page = audienceSegmentService.getAudienceSegmentsByStatement(statement); + + // Display results. + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AudienceSegment segment in page.results) { + Console.WriteLine("{0}) 'Audience segment with id \"{1}\" and name \"{2}\" was " + + "found.", i, segment.id, segment.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get audience segment. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CompanyService/CreateCompanies.cs b/examples/Dfp/CSharp/v201302/CompanyService/CreateCompanies.cs new file mode 100644 index 00000000000..4a0b27df84e --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CompanyService/CreateCompanies.cs @@ -0,0 +1,86 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates new companies. To determine which companies + /// exist, run GetAllCompanies.cs. + /// + /// Tags: CompanyService.createCompanies + /// + class CreateCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new companies. To determine which companies exist, " + + "run GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201302.CompanyService); + + // Create an array to store local company objects. + Company[] companies = new Company[5]; + + for (int i = 0; i < 5; i++) { + Company company = new Company(); + company.name = string.Format("Advertiser #{0}", i); + company.type = CompanyType.ADVERTISER; + companies[i] = company; + } + + try { + // Create the companies on the server. + companies = companyService.createCompanies(companies); + + if (companies != null && companies.Length > 0) { + foreach (Company company in companies) { + Console.WriteLine("A company with ID = '{0}', name = '{1}' and type = '{2}' was" + + " created.", company.id, company.name, company.type); + } + } else { + Console.WriteLine("No companies created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create company. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CompanyService/GetAllCompanies.cs b/examples/Dfp/CSharp/v201302/CompanyService/GetAllCompanies.cs new file mode 100644 index 00000000000..c6e32c399e5 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CompanyService/GetAllCompanies.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all companies. To create companies, run + /// CreateCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement + /// + class GetAllCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all companies. To create companies, run CreateCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201302.CompanyService); + + // Set defaults for page and Statement. + CompanyPage page = new CompanyPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all companies. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get companies by Statement. + page = companyService.getCompaniesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Company company in page.results) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", + i, company.id, company.name, company.type); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CompanyService/GetCompaniesByStatement.cs b/examples/Dfp/CSharp/v201302/CompanyService/GetCompaniesByStatement.cs new file mode 100644 index 00000000000..3fe9d3e98f2 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CompanyService/GetCompaniesByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all companies that are advertisers. The Statement + /// retrieves up to the maximum page size limit of 500. To create companies, + /// run CreateCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement + /// + class GetCompaniesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all companies that are advertisers. The Statement " + + "retrieves up to the maximum page size limit of 500. To create companies, run " + + "CreateCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCompaniesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201302.CompanyService); + + // Create a Statement to only select companies that are advertisers sorted + // by name. + Statement statement = new StatementBuilder("WHERE type = :advertiser ORDER BY name " + + "LIMIT 500").AddValue("advertiser", CompanyType.ADVERTISER.ToString()).ToStatement(); + + try { + // Get companies by Statement. + CompanyPage page = companyService.getCompaniesByStatement(statement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Company company in page.results) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", + i, company.id, company.name, company.type); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CompanyService/GetCompany.cs b/examples/Dfp/CSharp/v201302/CompanyService/GetCompany.cs new file mode 100644 index 00000000000..fbab373b2ef --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CompanyService/GetCompany.cs @@ -0,0 +1,77 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets a company by its ID. To determine which companies + /// exist, run GetAllCompanies.cs. + /// + /// Tags: CompanyService.getCompany + /// + class GetCompany : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a company by its ID. To determine which companies " + + "exist, run GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCompany(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201302.CompanyService); + + // Set the ID of the company to get. + long companyId = long.Parse(_T("INSERT_COMPANY_ID_HERE")); + + try { + // Get the company. + Company company = companyService.getCompany(companyId); + + if (company != null) { + Console.WriteLine("Company with ID = {0}, name = {1} and type = {2} was found", + company.id, company.name, company.type); + } else { + Console.WriteLine("No company found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get company. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CompanyService/UpdateCompanies.cs b/examples/Dfp/CSharp/v201302/CompanyService/UpdateCompanies.cs new file mode 100644 index 00000000000..6a3ec38c511 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CompanyService/UpdateCompanies.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example updates the names of all companies that are advertisers + /// by appending "LLC." up to the first 500. To determine which companies + /// exist, run GetAllCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement, CompanyService.updateCompanies + /// + class UpdateCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the names of all companies that are advertisers by " + + "appending 'LLC.' up to the first 500. To determine which companies exist, run " + + "GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201302.CompanyService); + + // Create a Statement to only select companies that are advertisers. + Statement statement = new StatementBuilder("WHERE type = :advertiser LIMIT 500").AddValue( + "advertiser", CompanyType.ADVERTISER.ToString()).ToStatement(); + + try { + // Get the companies by Statement. + CompanyPage page = companyService.getCompaniesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + Company[] companies = page.results; + + // Update each local company object by appending LLC. to its name. + foreach (Company company in companies) { + company.name = company.name + " LLC."; + } + + // Update the companies on the server. + companies = companyService.updateCompanies(companies); + + if (companies != null && companies.Length > 0) { + int i = 0; + foreach (Company company in companies) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} was updated", + i, company.id, company.name, company.type); + i++; + } + } else { + Console.WriteLine("No companies updated."); + } + } else { + Console.WriteLine("No companies found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ContactService/CreateContacts.cs b/examples/Dfp/CSharp/v201302/ContactService/CreateContacts.cs new file mode 100644 index 00000000000..10f4ffa325f --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ContactService/CreateContacts.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates new contacts. To determine which contacts exist, + /// run GetAllContacts.cs. + /// + /// Tags: ContactService.createContacts + /// + class CreateContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new contacts. To determine which contacts exist, " + + "run GetAllContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201302.ContactService); + + // Set the IDs of the companies for the contacts. + long advertiserCompanyId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + long agencyCompanyId = long.Parse(_T("INSERT_AGENCY_COMPANY_ID_HERE")); + + // Create an advertiser contact. + Contact advertiserContact = new Contact(); + advertiserContact.name = "Mr. Advertiser #" + GetTimeStamp(); + advertiserContact.email = "advertiser@advertising.com"; + advertiserContact.companyId = advertiserCompanyId; + + // Create an agency contact. + Contact agencyContact = new Contact(); + agencyContact.name = "Ms. Agency #" + GetTimeStamp(); + agencyContact.email = "agency@agencies.com"; + agencyContact.companyId = agencyCompanyId; + + try { + // Create the contacts on the server. + Contact[] contacts = + contactService.createContacts(new Contact[] {advertiserContact, agencyContact}); + + foreach (Contact contact in contacts) { + Console.WriteLine("A contact with ID \"{0}\" and name \"{1}\" was created.", + contact.id, contact.name); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ContactService/GetAllContacts.cs b/examples/Dfp/CSharp/v201302/ContactService/GetAllContacts.cs new file mode 100644 index 00000000000..9e3ae4959cf --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ContactService/GetAllContacts.cs @@ -0,0 +1,90 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; +using Google.Api.Ads.Dfp.Util.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all contacts. To create contacts, run + /// CreateContacts.cs. + /// + /// Tags: ContactService.getContactsByStatement + /// + class GetAllContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all contacts. To create contacts, run CreateContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201302.ContactService); + + Statement filterStatement = new Statement(); + + // Set defaults for page and filterStatement. + ContactPage page = new ContactPage(); + int offset = 0; + + try { + do { + // Create a statement to get all contacts. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get contacts by statement. + page = contactService.getContactsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Contact contact in page.results) { + Console.WriteLine("{0}) Contact with ID \"{1}\" and name \"{2}\" was found.", + i, contact.id, contact.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ContactService/GetUninvitedContacts.cs b/examples/Dfp/CSharp/v201302/ContactService/GetUninvitedContacts.cs new file mode 100644 index 00000000000..25e6ff5c6e7 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ContactService/GetUninvitedContacts.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; +using Google.Api.Ads.Dfp.Util.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all contacts that aren't invited yet. To create + /// contacts, run CreateContacts.cs. + /// + /// Tags: ContactService.getContactsByStatement + /// + class GetUninvitedContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all contacts that aren't invited yet. To create " + + "contacts, run CreateContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUninvitedContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201302.ContactService); + + Statement filterStatement = new StatementBuilder("").AddValue( + "status", ContactStatus.UNINVITED.ToString()).ToStatement(); + + // Set defaults for page and filterStatement. + ContactPage page = new ContactPage(); + int offset = 0; + + try { + do { + // Create a statement to get all contacts. + filterStatement.query = "where status = :status LIMIT 500 OFFSET " + offset.ToString(); + + // Get contacts by statement. + page = contactService.getContactsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Contact contact in page.results) { + Console.WriteLine("{0}) Contact with ID \"{1}\" and name \"{2}\" was found.", + i, contact.id, contact.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ContactService/UpdateContacts.cs b/examples/Dfp/CSharp/v201302/ContactService/UpdateContacts.cs new file mode 100644 index 00000000000..36aa8e1b115 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ContactService/UpdateContacts.cs @@ -0,0 +1,83 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; +using Google.Api.Ads.Dfp.Util.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example updates contact addresses. To determine which contacts + /// exist, run GetAllContacts.cs. + /// + /// Tags: ContactService.updateContacts + /// + class UpdateContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates contact comments. To determine which contacts " + + "exist, run GetAllContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201302.ContactService); + + // Set the ID of the contact to update. + long contactId = long.Parse(_T("INSERT_CONTACT_ID_HERE")); + + try { + // Get the contact. + Contact contact = contactService.getContact(contactId); + + // Update the address of the contact. + contact.address = "123 New Street, New York, NY, 10011"; + + // Update the contact on the server. + Contact[] contacts = contactService.updateContacts(new Contact[] {contact}); + + // Display results. + foreach (Contact updatedContact in contacts) { + Console.WriteLine("Contact with ID \"{0}\", name \"{1}\", and comment \"{2}\" was " + + "updated.", updatedContact.id, updatedContact.name, updatedContact.comment); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ContentService/GetAllContent.cs b/examples/Dfp/CSharp/v201302/ContentService/GetAllContent.cs new file mode 100644 index 00000000000..478b4fb958e --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ContentService/GetAllContent.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all content. This feature is only available to DFP + /// premium solution networks. + /// + /// Tags: ContentService.getContentByStatement + /// + class GetAllContent : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all content. This feature is only available to DFP " + + "premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllContent(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContentService. + ContentService contentService = + (ContentService) user.GetService(DfpService.v201302.ContentService); + + // Set defaults for page and filterStatement. + ContentPage page = new ContentPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all content. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get content by statement. + page = contentService.getContentByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Content content in page.results) { + Console.WriteLine("{0}) Content with ID \"{1}\", name \"{2}\", and status \"{3}\" " + + "was found.", i, content.id, content.name, content.status); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all content. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ContentService/GetContentByCategory.cs b/examples/Dfp/CSharp/v201302/ContentService/GetContentByCategory.cs new file mode 100644 index 00000000000..9e5e725e09f --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ContentService/GetContentByCategory.cs @@ -0,0 +1,123 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using Google.Api.Ads.Dfp.Util.v201302; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all active content categorized as "comedy" using + /// the network's content browse custom targeting key. This feature is only + /// available to DFP video publishers. + /// + /// Tags: NetworkService.getCurrentNetwork + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// Tags: ContentService.getContentByStatementAndCustomTargetingValue + /// /// + class GetContentByCategory : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active content categorized as 'comedy' using the " + + "network's content browse custom targeting key. This feature is only available to " + + "DFP video publishers."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetContentByCategory(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContentService. + ContentService contentService = + (ContentService) user.GetService(DfpService.v201302.ContentService); + + // Get the NetworkService. + NetworkService networkService = (NetworkService) user.GetService( + DfpService.v201302.NetworkService); + + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = (CustomTargetingService) user.GetService( + DfpService.v201302.CustomTargetingService); + + try { + // Get content browse custom targeting key ID. + long contentBrowseCustomTargetingKeyId = + networkService.getCurrentNetwork().contentBrowseCustomTargetingKeyId; + + // Create a statement to select the categories matching the name comedy. + Statement categoryFilterStatement = new StatementBuilder( + "WHERE customTargetingKeyId = :contentBrowseCustomTargetingKeyId " + + " and name = :category LIMIT 1") + .AddValue("contentBrowseCustomTargetingKeyId", contentBrowseCustomTargetingKeyId) + .AddValue("category", "comedy").ToStatement(); + + // Get categories matching the filter statement. + CustomTargetingValuePage customTargetingValuePage = + customTargetingService.getCustomTargetingValuesByStatement(categoryFilterStatement); + + if (customTargetingValuePage.results != null) { + // Get the custom targeting value ID for the comedy category. + long categoryCustomTargetingValueId = customTargetingValuePage.results[0].id; + + // Set defaults for page and filterStatement. + ContentPage page = new ContentPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + do { + // Create a statement to get all active content. + filterStatement.query = "WHERE status = 'ACTIVE' LIMIT 500 OFFSET " + offset.ToString(); + + // Get content by statement. + page = contentService.getContentByStatementAndCustomTargetingValue(filterStatement, + categoryCustomTargetingValueId); + + if (page.results != null) { + int i = page.startIndex; + foreach (Content content in page.results) { + Console.WriteLine("{0}) Content with ID \"{1}\", name \"{2}\", and status " + + "\"{3}\" was found.", i, content.id, content.name, content.status); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get content by category. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CreativeService/CopyImageCreatives.cs b/examples/Dfp/CSharp/v201302/CreativeService/CopyImageCreatives.cs new file mode 100644 index 00000000000..d8676cae417 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CreativeService/CopyImageCreatives.cs @@ -0,0 +1,127 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example copies a given set of image creatives. This would + /// typically be done to reuse creatives in a small business network. To + /// determine which creatives exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// Tags: CreativeService.createCreatives + /// + class CopyImageCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example copies a given set of image creatives. This would typically be" + + " done to reuse creatives in a small business network. To determine which creatives " + + "exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CopyImageCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201302.CreativeService); + + long[] creativeIds = new long[] {long.Parse(_T("INSERT_IMAGE_CREATIVE_ID_HERE"))}; + + // Build a comma separated list of creativeIds. Note that if you are using + // .NET 4.0 or above, you could use the newly introduced + // String.Join(string separator, IEnumerable values) method to + // perform this task. + string[] creativeIdTexts = new string[creativeIds.Length]; + for (int i = 0; i < creativeIdTexts.Length; i++) { + creativeIdTexts[i] = creativeIds[i].ToString(); + } + + string commaSeparatedCreativeIds = string.Join(",", creativeIdTexts); + + // Create the statement to filter image creatives by id. + Statement statement = new StatementBuilder( + string.Format("WHERE id IN ({0}) and creativeType = :creativeType LIMIT 500", + commaSeparatedCreativeIds)).AddValue("creativeType", "ImageCreative"). + ToStatement(); + + try { + // Retrieve all creatives which match. + CreativePage page = creativeService.getCreativesByStatement(statement); + + if (page.results != null) { + Creative[] creatives = page.results; + long[] oldIds = new long[creatives.Length]; + for (int i = 0; i < creatives.Length; i++) { + ImageCreative imageCreative = (ImageCreative) creatives[i]; + oldIds[i] = imageCreative.id; + // Since we cannot set id to null, we mark it as not specified. + imageCreative.idSpecified = false; + + imageCreative.advertiserId = imageCreative.advertiserId; + imageCreative.name = imageCreative.name + " (Copy #" + GetTimeStamp() + ")"; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + imageCreative.primaryImageAsset.assetUrl); + + creativeAsset.size = imageCreative.primaryImageAsset.size; + imageCreative.primaryImageAsset = creativeAsset; + + creatives[i] = imageCreative; + } + + // Create the copied creative. + creatives = creativeService.createCreatives(creatives); + + // Display copied creatives. + for (int i = 0; i < creatives.Length; i++) { + Console.WriteLine("Image creative with ID \"{0}\" copied to ID \"{1}\".", oldIds[i], + creatives[i].id); + } + } else { + Console.WriteLine("No creatives were copied."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to copy creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CreativeService/CreateCreativeFromTemplate.cs b/examples/Dfp/CSharp/v201302/CreativeService/CreateCreativeFromTemplate.cs new file mode 100644 index 00000000000..22b3fe7cbb5 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CreativeService/CreateCreativeFromTemplate.cs @@ -0,0 +1,138 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates a new template creative for a given advertiser. + /// To determine which companies are advertisers, run + /// GetCompaniesByStatement.cs. To determine which creatives already exist, + /// run GetAllCreatives.cs. To determine which creative templates exist, run + /// GetAllCreativeTemplates.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCreativeFromTemplate : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new template creative for a given advertiser. To " + + "determine which companies are advertisers, run GetCompaniesByStatement.cs. To " + + "determine which creatives already exist, run GetAllCreatives.cs. To determine " + + "which creative templates exist, run GetAllCreativeTemplates.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreativeFromTemplate(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201302.CreativeService); + + // Set the ID of the advertiser (company) that all creative will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Use the image banner with optional third party tracking template. + long creativeTemplateId = 10000680L; + + // Create the local custom creative object. + TemplateCreative templateCreative = new TemplateCreative(); + templateCreative.name = "Template creative"; + templateCreative.advertiserId = advertiserId; + templateCreative.creativeTemplateId = creativeTemplateId; + + // Set the creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + templateCreative.size = size; + + // Create the asset variable value. + AssetCreativeTemplateVariableValue assetVariableValue = + new AssetCreativeTemplateVariableValue(); + assetVariableValue.uniqueName = "Imagefile"; + assetVariableValue.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + assetVariableValue.fileName = String.Format("image{0}.jpg", this.GetTimeStamp()); + + // Create the image width variable value. + LongCreativeTemplateVariableValue imageWidthVariableValue = + new LongCreativeTemplateVariableValue(); + imageWidthVariableValue.uniqueName = "Imagewidth"; + imageWidthVariableValue.value = 300; + + // Create the image height variable value. + LongCreativeTemplateVariableValue imageHeightVariableValue = + new LongCreativeTemplateVariableValue(); + imageHeightVariableValue.uniqueName = "Imageheight"; + imageHeightVariableValue.value = 250; + + // Create the URL variable value. + UrlCreativeTemplateVariableValue urlVariableValue = new UrlCreativeTemplateVariableValue(); + urlVariableValue.uniqueName = "ClickthroughURL"; + urlVariableValue.value = "www.google.com"; + + // Create the target window variable value. + StringCreativeTemplateVariableValue targetWindowVariableValue = + new StringCreativeTemplateVariableValue(); + targetWindowVariableValue.uniqueName = "Targetwindow"; + targetWindowVariableValue.value = "_blank"; + + templateCreative.creativeTemplateVariableValues = new BaseCreativeTemplateVariableValue[] { + assetVariableValue, imageWidthVariableValue, imageHeightVariableValue, urlVariableValue, + targetWindowVariableValue}; + + try { + // Create the template creative on the server. + templateCreative = (TemplateCreative) creativeService.createCreative(templateCreative); + + if (templateCreative != null) { + Console.WriteLine("A template creative with ID \"{0}\", name \"{1}\", and type \"{2}\" " + + "was created and can be previewed at {3}", templateCreative.id, templateCreative.name, + templateCreative.CreativeType, templateCreative.previewUrl); + } else { + Console.WriteLine("No creatives were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CreativeService/CreateCreatives.cs b/examples/Dfp/CSharp/v201302/CreativeService/CreateCreatives.cs new file mode 100644 index 00000000000..36c7f962db3 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CreativeService/CreateCreatives.cs @@ -0,0 +1,120 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates new image creatives for a given advertiser. To + /// determine which companies are advertisers, run GetCompaniesByStatement.cs. + /// To determine which creatives already exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new image creatives for a given advertiser. To " + + "determine which companies are advertisers, run GetCompaniesByStatement.cs. " + + "To determine which creatives already exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201302.CreativeService); + + // Set the ID of the advertiser (company) that all creatives will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Create an array to store local image creative objects. + Creative[] imageCreatives = new ImageCreative[5]; + + for (int i = 0; i < 5; i++) { + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", i); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + imageCreatives[i] = imageCreative; + } + + try { + // Create the image creatives on the server. + imageCreatives = creativeService.createCreatives(imageCreatives); + + if (imageCreatives != null) { + foreach (Creative creative in imageCreatives) { + // Use "is" operator to determine what type of creative was + // returned. + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + Console.WriteLine("An image creative with ID ='{0}', name ='{1}' and size = " + + "({2},{3}) was created and can be previewed at: {4}", imageCreative.id, + imageCreative.name, imageCreative.size.width, imageCreative.size.height, + imageCreative.previewUrl); + } else { + Console.WriteLine("A creative with ID ='{0}', name='{1}' and type='{2}' was created.", + creative.id, creative.name, creative.CreativeType); + } + } + } else { + Console.WriteLine("No creatives created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CreativeService/CreateCustomCreative.cs b/examples/Dfp/CSharp/v201302/CreativeService/CreateCustomCreative.cs new file mode 100644 index 00000000000..78c64480fe4 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CreativeService/CreateCustomCreative.cs @@ -0,0 +1,111 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates a custom creative for a given advertiser. To + /// determine which companies are advertisers, run GetCompaniesByStatement.cs. + /// To determine which creatives already exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCustomCreative : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a custom creative for a given advertiser. To determine " + + "which companies are advertisers, run GetCompaniesByStatement.cs. To determine which " + + "creatives already exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomCreative(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201302.CreativeService); + + // Set the ID of the advertiser (company) that all creatives will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + + // Create the local custom creative object. + CustomCreative customCreative = new CustomCreative(); + customCreative.name = "Custom creative " + GetTimeStamp(); + customCreative.advertiserId = advertiserId; + customCreative.destinationUrl = "http://google.com"; + + // Set the custom creative image asset. + CustomCreativeAsset customCreativeAsset = new CustomCreativeAsset(); + customCreativeAsset.macroName = "IMAGE_ASSET"; + customCreativeAsset.fileName = string.Format("inline{0}.jpg", GetTimeStamp()); + customCreativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + customCreative.customCreativeAssets = new CustomCreativeAsset[] {customCreativeAsset}; + + // Set the HTML snippet using the custom creative asset macro. + customCreative.htmlSnippet = "" + + "" + + "
Click above for great deals!"; + + // Set the creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + customCreative.size = size; + + try { + // Create the custom creative on the server. + customCreative = (CustomCreative) creativeService.createCreative(customCreative); + + if (customCreative != null) { + Console.WriteLine("A custom creative with ID \"{0}\", name \"{1}\", and size ({2}, " + + "{3}) was created and can be previewed at {4}", customCreative.id, + customCreative.name, customCreative.size.width, customCreative.size.height, + customCreative.previewUrl); + } else { + Console.WriteLine("No creative created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CreativeService/GetAllCreatives.cs b/examples/Dfp/CSharp/v201302/CreativeService/GetAllCreatives.cs new file mode 100644 index 00000000000..4739633eb16 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CreativeService/GetAllCreatives.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all creatives. To create creatives, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// + class GetAllCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all creatives. To create creatives, run CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201302.CreativeService); + + // Set defaults for page and Statement. + CreativePage page = new CreativePage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all creatives. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get creatives by Statement. + page = creativeService.getCreativesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Creative creative in page.results) { + Console.WriteLine("{0}) Creative with ID ='{1}', name ='{2}' and type ='{3}' " + + "was found.", i, creative.id, creative.name, creative.CreativeType); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CreativeService/GetCreative.cs b/examples/Dfp/CSharp/v201302/CreativeService/GetCreative.cs new file mode 100644 index 00000000000..fd9c666cba5 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CreativeService/GetCreative.cs @@ -0,0 +1,77 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets a creative by its ID. To determine which creatives + /// exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.getCreative + /// + class GetCreative : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a creative by its ID. To determine which creatives " + + "exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code sample as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreative(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201302.CreativeService); + + // Set the ID of the creative to get. + long creativeId = long.Parse(_T("INSERT_CREATIVE_ID_HERE")); + + try { + // Get the creative. + Creative creative = creativeService.getCreative(creativeId); + + if (creative != null) { + Console.WriteLine("Creative with ID ='{0}', name ='{1}' and type ='{2}' " + + "was found.", creative.id, creative.name, creative.CreativeType); + } else { + Console.WriteLine("No creative found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get creative. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CreativeService/GetCreativesByStatement.cs b/examples/Dfp/CSharp/v201302/CreativeService/GetCreativesByStatement.cs new file mode 100644 index 00000000000..05b411ba727 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CreativeService/GetCreativesByStatement.cs @@ -0,0 +1,86 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all image creatives. The Statement retrieves up to + /// the maximum page size limit of 500. To create an image creative, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// + class GetCreativesByStatement : SampleBase { + /// + /// Returns a description about the sample code. + /// + public override string Description { + get { + return "This code example gets all image creatives. The Statement retrieves up to the " + + "maximum page size limit of 500. To create an image creative, run " + + "CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201302.CreativeService); + + // Create a Statement to only select image creatives. + Statement statement = new StatementBuilder("WHERE creativeType = :creativeType LIMIT 500"). + AddValue("creativeType", "ImageCreative").ToStatement(); + + try { + // Get creatives by Statement. + CreativePage page = creativeService.getCreativesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Creative creative in page.results) { + Console.WriteLine("{0}) Creative with ID ='{1}', name ='{2}' and type ='{3}' " + + "was found.", i, creative.id, creative.name, creative.CreativeType); + i++; + } + } + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get creatives by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CreativeService/UpdateCreatives.cs b/examples/Dfp/CSharp/v201302/CreativeService/UpdateCreatives.cs new file mode 100644 index 00000000000..15a06bba7e0 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CreativeService/UpdateCreatives.cs @@ -0,0 +1,104 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all image creatives. The Statement retrieves up to + /// the maximum page size limit of 500. To create an image creative, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// Tags: CreativeService.updateCreatives + /// + class UpdateCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all image creatives. The Statement retrieves up to the " + + "maximum page size limit of 500. To create an image creative, run " + + "CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201302.CreativeService); + + // Create a Statement to get all image creatives. + Statement statement = new StatementBuilder("WHERE creativeType = :creativeType LIMIT 500"). + AddValue("creativeType", "ImageCreative").ToStatement(); + + try { + // Get creatives by Statement. + CreativePage page = creativeService.getCreativesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + Creative[] creatives = page.results; + + // Update each local creative object by changing its destination URL. + foreach (Creative creative in creatives) { + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + imageCreative.destinationUrl = "http://news.google.com"; + } + } + + // Update the creatives on the server. + creatives = creativeService.updateCreatives(creatives); + + if (creatives != null) { + foreach (Creative creative in creatives) { + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + Console.WriteLine("An image creative with ID = '{0}' and destination URL ='{1}' " + + "was updated.", imageCreative.id, imageCreative.destinationUrl); + } + } + } else { + Console.WriteLine("No creatives updated."); + } + } else { + Console.WriteLine("No creatives found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CreativeTemplateService/GetAllCreativeTemplates.cs b/examples/Dfp/CSharp/v201302/CreativeTemplateService/GetAllCreativeTemplates.cs new file mode 100644 index 00000000000..dbd233c8a9c --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CreativeTemplateService/GetAllCreativeTemplates.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all creative templates. + /// + /// Tags: CreativeTemplateService.getCreativeTemplatesByStatement + /// + class GetAllCreativeTemplates : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all creative templates."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreativeTemplates(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201302.CreativeTemplateService); + + // Set defaults for page and filterStatement. + CreativeTemplatePage page = new CreativeTemplatePage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all creative templates. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get creative templates by statement. + page = creativeTemplateService.getCreativeTemplatesByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CreativeTemplate creativeTemplate in page.results) { + Console.WriteLine("{0}) Creative template with ID \"{1}\", name \"{2}\", and type " + + "\"{3}\" was found.", i, creativeTemplate.id, creativeTemplate.name, + creativeTemplate.type); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CreativeTemplateService/GetCreativeTemplate.cs b/examples/Dfp/CSharp/v201302/CreativeTemplateService/GetCreativeTemplate.cs new file mode 100644 index 00000000000..29d656ab306 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CreativeTemplateService/GetCreativeTemplate.cs @@ -0,0 +1,87 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets a creative by its ID. To determine which creative + /// templates exist, run GetAllCreativeTemplates.cs. + /// + /// Tags: CreativeTemplateService.getCreativeTemplate + /// + class GetCreativeTemplate : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a creative by its ID. To determine which creative " + + "templates exist, run GetAllCreativeTemplates.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeTemplate(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201302.CreativeTemplateService); + + // Set the ID of the creative template to get. + long creativeTemplateId = long.Parse(_T("INSERT_CREATIVE_TEMPLATE_ID_HERE")); + + try { + // Get the creative template. + CreativeTemplate creativeTemplate = creativeTemplateService.getCreativeTemplate( + creativeTemplateId); + + if (creativeTemplate != null) { + Console.WriteLine("Creative template with ID \"{0}\", name \"{1}\", and type \"{2}\" " + + "was found.", creativeTemplate.id, creativeTemplate.name, creativeTemplate.type); + if (creativeTemplate.variables != null) { + foreach (CreativeTemplateVariable variable in creativeTemplate.variables) { + Console.WriteLine("Variable with name \"{0}\" is {1}.", variable.uniqueName, + variable.isRequired ? "required." : "optional."); + } + } + } else { + Console.WriteLine("No creative template found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CreativeTemplateService/GetCreativeTemplatesByStatement.cs b/examples/Dfp/CSharp/v201302/CreativeTemplateService/GetCreativeTemplatesByStatement.cs new file mode 100644 index 00000000000..2d1dc683a56 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CreativeTemplateService/GetCreativeTemplatesByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets up to 500 system defined creative templates. + /// + /// Tags: CreativeTemplateService.getCreativeTemplatesByStatement + /// + class GetCreativeTemplatesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets up to 500 system defined creative templates."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeTemplatesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201302.CreativeTemplateService); + + // Create a statement to only select system defined creative templates. + Statement filterStatement = + new StatementBuilder("WHERE type = :creativeTemplateType LIMIT 500").AddValue( + "creativeTemplateType", CreativeTemplateType.SYSTEM_DEFINED.ToString()).ToStatement(); + + try { + // Get creative templates by statement. + CreativeTemplatePage page = creativeTemplateService.getCreativeTemplatesByStatement( + filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CreativeTemplate creativeTemplate in page.results) { + Console.WriteLine("{0}) Creative template with ID \"{1}\", name \"{2}\", and type " + + "\"{3}\" was found.", i, creativeTemplate.id, creativeTemplate.name, + creativeTemplate.type); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CreativeWrapperService/CreateCreativeWrappers.cs b/examples/Dfp/CSharp/v201302/CreativeWrapperService/CreateCreativeWrappers.cs new file mode 100644 index 00000000000..668b580d00c --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CreativeWrapperService/CreateCreativeWrappers.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates a new creative wrapper. Creative wrappers must + /// be associated with a LabelType.CREATIVE_WRAPPER label and applied to ad + /// units by AdUnit.appliedLabels. To determine which creative wrappers exist, + /// run GetAllCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.createCreativeWrappers + /// + class CreateCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new creative wrapper. Creative wrappers must be " + + "associated with a LabelType.CREATIVE_WRAPPER label and applied to ad units by " + + "AdUnit.appliedLabels. To determine which creative wrappers exist, run " + + "GetAllCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201302.CreativeWrapperService); + + long labelId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE")); + + // Create creative wrapper objects. + CreativeWrapper creativeWrapper = new CreativeWrapper(); + creativeWrapper.labelId = labelId; + creativeWrapper.ordering = CreativeWrapperOrdering.INNER; + creativeWrapper.header = new CreativeWrapperHtmlSnippet(); + creativeWrapper.header.htmlSnippet = "My creative wrapper header"; + creativeWrapper.footer = new CreativeWrapperHtmlSnippet(); + creativeWrapper.footer.htmlSnippet = "My creative wrapper footer"; + + try { + // Add creative wrapper. + CreativeWrapper[] creativeWrappers = creativeWrapperService.createCreativeWrappers( + new CreativeWrapper[] {creativeWrapper}); + + // Display results. + foreach (CreativeWrapper wrapper in creativeWrappers) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' was " + + "created.", wrapper.id, wrapper.labelId); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creative wrappers. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CreativeWrapperService/DeactivateCreativeWrappers.cs b/examples/Dfp/CSharp/v201302/CreativeWrapperService/DeactivateCreativeWrappers.cs new file mode 100644 index 00000000000..85c148ae80a --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CreativeWrapperService/DeactivateCreativeWrappers.cs @@ -0,0 +1,95 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using Google.Api.Ads.Dfp.Util.v201302; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example deactivates a creative wrapper belonging to a label. + /// + /// Tags: CreativeWrapperService.getCreativeWrapperByStatement + /// Tags: CreativeWrapperService.performCreativeWrapperAction + /// + class DeActivateCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates a creative wrapper belonging to a label."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeActivateCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201302.CreativeWrapperService); + + long labelId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE")); + + try { + // Create a query to select the active creative wrapper for the given + // label. + Statement statement = new StatementBuilder("WHERE status = :status AND labelId = :labelId") + .AddValue("labelId", labelId) + .AddValue("status", CreativeWrapperStatus.ACTIVE.ToString()) + .ToStatement(); + CreativeWrapperPage page = creativeWrapperService.getCreativeWrappersByStatement(statement); + CreativeWrapper[] creativeWrappers = page.results; + if (creativeWrappers != null) { + foreach (CreativeWrapper wrapper in creativeWrappers) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' with " + + "status \'{2}\' will be deactivated.", wrapper.id, wrapper.labelId, wrapper.status); + } + Console.WriteLine("Number of creative wrappers to be deactivated: {0}", + creativeWrappers.Length); + + // Perform action. + CreativeWrapperAction action = new DeactivateCreativeWrappers(); + UpdateResult result = + creativeWrapperService.performCreativeWrapperAction(action, statement); + + // Display results. + if (result.numChanges > 0) { + Console.WriteLine("Number of creative wrappers deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No creative wrappers were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creative wrappers. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CreativeWrapperService/GetActiveCreativeWrappers.cs b/examples/Dfp/CSharp/v201302/CreativeWrapperService/GetActiveCreativeWrappers.cs new file mode 100644 index 00000000000..2c5b9f5e763 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CreativeWrapperService/GetActiveCreativeWrappers.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using Google.Api.Ads.Dfp.Util.v201302; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all active creative wrappers. To create + /// creative wrappers, run CreateCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.getCreativeWrapperByStatement + /// + class GetActiveCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active creative wrappers. To create creative " + + "wrappers, run CreateCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActiveCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201302.CreativeWrapperService); + + // Set defaults for page and Statement. + CreativeWrapperPage page = new CreativeWrapperPage(); + Statement statement = new StatementBuilder("") + .AddValue("status", CreativeWrapperStatus.ACTIVE.ToString()) + .ToStatement(); + int offset = 0; + + try { + do { + // Create a Statement to get all active creative wrappers. + statement.query = string.Format("WHERE status = :status LIMIT 500 OFFSET {0}", offset); + + // Get creative wrappers by Statement. + page = creativeWrapperService.getCreativeWrappersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (CreativeWrapper wrapper in page.results) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' with " + + "status \'{2}\' was found.", wrapper.id, wrapper.labelId, wrapper.status); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get active creative wrappers. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CreativeWrapperService/GetAllCreativeWrappers.cs b/examples/Dfp/CSharp/v201302/CreativeWrapperService/GetAllCreativeWrappers.cs new file mode 100644 index 00000000000..f7e018e4215 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CreativeWrapperService/GetAllCreativeWrappers.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using Google.Api.Ads.Dfp.Util.v201302; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all creative wrappers. To create creative wrappers, + /// run CreateCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.getCreativeWrapperByStatement + /// + class GetAllCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active creative wrappers. To create creative " + + "wrappers, run CreateCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201302.CreativeWrapperService); + + // Set defaults for page and Statement. + CreativeWrapperPage page = new CreativeWrapperPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all creative wrappers. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get creative wrappers by Statement. + page = creativeWrapperService.getCreativeWrappersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (CreativeWrapper wrapper in page.results) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' with " + + "status \'{2}\' was found.", wrapper.id, wrapper.labelId, wrapper.status); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get active creative wrappers. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CreativeWrapperService/UpdateCreativeWrappers.cs b/examples/Dfp/CSharp/v201302/CreativeWrapperService/UpdateCreativeWrappers.cs new file mode 100644 index 00000000000..cf11088600a --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CreativeWrapperService/UpdateCreativeWrappers.cs @@ -0,0 +1,84 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using Google.Api.Ads.Dfp.Util.v201302; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example updates a creative wrapper to the 'OUTER' wrapping + /// order. To determine which creative wrappers exist, run + /// GetAllCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.getCreativeWrapper + /// Tags: CreativeWrapperService.updateCreativeWrappers + /// + class UpdateCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active creative wrappers. To create creative " + + "wrappers, run CreateCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201302.CreativeWrapperService); + + long creativeWrapperId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_ID_HERE")); + + try { + CreativeWrapper wrapper = creativeWrapperService.getCreativeWrapper(creativeWrapperId); + if (wrapper != null) { + wrapper.ordering = CreativeWrapperOrdering.OUTER; + // Update the creative wrappers on the server. + CreativeWrapper[] creativeWrappers = creativeWrapperService.updateCreativeWrappers( + new CreativeWrapper[] {wrapper}); + + // Display results. + Console.WriteLine("Creative wrapper with ID '{0}' and wrapping order '{1}' was " + + "updated.", creativeWrappers[0].id, creativeWrappers[0].ordering); + } else { + Console.WriteLine("No creative wrappers found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update creative wrappers. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CustomFieldService/CreateCustomFieldOptions.cs b/examples/Dfp/CSharp/v201302/CustomFieldService/CreateCustomFieldOptions.cs new file mode 100644 index 00000000000..a5c8372fc3b --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CustomFieldService/CreateCustomFieldOptions.cs @@ -0,0 +1,97 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates custom field options for a drop-down custom + /// field. Once created, custom field options can be found under the options + /// fields of the drop-down custom field and they cannot be deleted. To + /// determine which custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.createCustomFieldOptions + /// + class CreateCustomFieldOptions : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates custom field options for a drop-down custom field. " + + "Once created, custom field options can be found under the options fields of the " + + "drop-down custom field and they cannot be deleted. To determine which custom " + + "fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomFieldOptions(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = + (CustomFieldService) user.GetService(DfpService.v201302.CustomFieldService); + + // Set the ID of the drop-down custom field to create options for. + long customFieldId = long.Parse(_T("INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE")); + + // Create custom field options. + CustomFieldOption customFieldOption1 = new CustomFieldOption(); + customFieldOption1.displayName = "Approved"; + customFieldOption1.customFieldId = customFieldId; + + CustomFieldOption customFieldOption2 = new CustomFieldOption(); + customFieldOption2.displayName = "Unapproved"; + customFieldOption2.customFieldId = customFieldId; + + try { + // Add custom field options. + CustomFieldOption[] customFieldOptions = + customFieldService.createCustomFieldOptions(new CustomFieldOption[] {customFieldOption1, + customFieldOption2}); + + // Display results. + if (customFieldOptions != null) { + foreach (CustomFieldOption customFieldOption in customFieldOptions) { + Console.WriteLine("Custom field option with ID \"{0}\" and name \"{1}\" was created.", + customFieldOption.id, customFieldOption.displayName); + } + } else { + Console.WriteLine("No custom field options created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom field options. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CustomFieldService/CreateCustomFields.cs b/examples/Dfp/CSharp/v201302/CustomFieldService/CreateCustomFields.cs new file mode 100644 index 00000000000..bf8c582060d --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CustomFieldService/CreateCustomFields.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates custom fields. To determine which custom fields + /// exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.createCustomFields + /// + class CreateCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates custom fields. To determine which custom fields exist" + + ", run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201302.CustomFieldService); + + // Create custom fields. + CustomField customField1 = new CustomField(); + customField1.name = "Customer comments #" + GetTimeStamp(); + customField1.entityType = CustomFieldEntityType.LINE_ITEM; + customField1.dataType = CustomFieldDataType.STRING; + customField1.visibility = CustomFieldVisibility.FULL; + + CustomField customField2 = new CustomField(); + customField2.name = "Internal approval status #" + GetTimeStamp(); + customField2.entityType = CustomFieldEntityType.LINE_ITEM; + customField2.dataType = CustomFieldDataType.DROP_DOWN; + customField2.visibility = CustomFieldVisibility.FULL; + + try { + // Add custom fields. + CustomField[] customFields = + customFieldService.createCustomFields(new CustomField[] {customField1, customField2}); + + // Display results. + if (customFields != null) { + foreach (CustomField customField in customFields) { + Console.WriteLine("Custom field with ID \"{0}\" and name \"{1}\" was created.", + customField.id, customField.name); + } + } else { + Console.WriteLine("No custom fields created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CustomFieldService/DeactivateAllLineItemCustomFields.cs b/examples/Dfp/CSharp/v201302/CustomFieldService/DeactivateAllLineItemCustomFields.cs new file mode 100644 index 00000000000..f942f890eaf --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CustomFieldService/DeactivateAllLineItemCustomFields.cs @@ -0,0 +1,122 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using Google.Api.Ads.Dfp.Util.v201302; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example deactivates all active line item custom fields. To + /// determine which custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// Tags: CustomFieldService.performCustomFieldAction + /// + class DeactivateAllLineItemCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active line item custom fields. To determine " + + "which custom fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateAllLineItemCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201302.CustomFieldService); + + // Create statement to select only active custom fields that apply to + // line items. + String statementText = "WHERE entityType = :entityType and isActive = :isActive LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText) + .AddValue("entityType", CustomFieldEntityType.LINE_ITEM.ToString()) + .AddValue("isActive", true) + .ToStatement(); + + // Set defaults for page and offset. + CustomFieldPage page = new CustomFieldPage(); + int offset = 0; + int i = 0; + List customFieldIds = new List(); + + try { + do { + // Create a statement to page through custom fields. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(filterStatement); + + if (page.results != null) { + foreach (CustomField customField in page.results) { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" will be " + + "deactivated.", i, customField.id, customField.name); + customFieldIds.Add(customField.id.ToString()); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of custom fields to be deactivated: " + customFieldIds.Count); + + if (customFieldIds.Count > 0) { + // Modify statement for action. + filterStatement.query = "WHERE id IN (" + string.Join(", ", customFieldIds.ToArray()) + + ")"; + + // Create action. + DeactivateCustomFields action = new DeactivateCustomFields(); + + // Perform action. + UpdateResult result = customFieldService.performCustomFieldAction( + action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of custom fields deactivated: " + result.numChanges); + } else { + Console.WriteLine("No custom fields were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CustomFieldService/GetAllCustomFields.cs b/examples/Dfp/CSharp/v201302/CustomFieldService/GetAllCustomFields.cs new file mode 100644 index 00000000000..e5cc3063cd0 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CustomFieldService/GetAllCustomFields.cs @@ -0,0 +1,107 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using Google.Api.Ads.Dfp.Util.v201302; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all custom fields. To create custom fields, run + /// CreateCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// Tags: CustomFieldService.performCustomFieldAction + /// + class GetAllCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom fields. To create custom fields, run " + + "CreateCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201302.CustomFieldService); + + // Sets defaults for page and filter. + CustomFieldPage page = new CustomFieldPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all custom fields. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomField customField in page.results) { + if (customField is DropDownCustomField) { + List dropDownCustomFieldStrings = new List(); + DropDownCustomField dropDownCustomField = (DropDownCustomField) customField; + if (dropDownCustomField.options != null) { + foreach (CustomFieldOption customFieldOption in dropDownCustomField.options) { + dropDownCustomFieldStrings.Add(customFieldOption.displayName); + } + } + Console.WriteLine("{0}) Drop-down custom field with ID \"{1}\", name \"{2}\", " + + "and options {{{3}}} was found.", i, customField.id, customField.name, + string.Join(", ", dropDownCustomFieldStrings.ToArray())); + } else { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" was found.", + i, customField.id, customField.name); + } + i++; + } + } + + offset += 500; + } while (page.results != null && page.results.Length == 500); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CustomFieldService/GetAllLineItemCustomFields.cs b/examples/Dfp/CSharp/v201302/CustomFieldService/GetAllLineItemCustomFields.cs new file mode 100644 index 00000000000..53c0664c8c6 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CustomFieldService/GetAllLineItemCustomFields.cs @@ -0,0 +1,97 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using Google.Api.Ads.Dfp.Util.v201302; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all custom fields that apply to line items. To + /// create custom fields, run CreateCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// + class GetAllLineItemCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom fields that apply to line items. To create " + + "custom fields, run CreateCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLineItemCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201302.CustomFieldService); + + // Create statement to select only custom fields that apply to line items. + String statementText = "WHERE entityType = :entityType LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText) + .AddValue("entityType", CustomFieldEntityType.LINE_ITEM.ToString()) + .ToStatement(); + + // Set defaults for page and offset. + CustomFieldPage page = new CustomFieldPage(); + int offset = 0; + int i = 0; + + try { + do { + // Create a statement to page through custom fields. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(filterStatement); + + if (page.results != null) { + foreach (CustomField customField in page.results) { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" was found.", i, + customField.id, customField.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all line item custom fields. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CustomFieldService/SetLineItemCustomFieldValue.cs b/examples/Dfp/CSharp/v201302/CustomFieldService/SetLineItemCustomFieldValue.cs new file mode 100644 index 00000000000..eb14745e342 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CustomFieldService/SetLineItemCustomFieldValue.cs @@ -0,0 +1,148 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using Google.Api.Ads.Dfp.Util.v201302; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example sets custom field values on a line item. To determine + /// which custom fields exist, run GetAllCustomFields.cs. To create custom + /// field options, run CreateCustomFieldOptions.cs. To determine which line + /// items exist, run GetAllLineItems.cs. + /// + /// Tags: CustomFieldService.getCustomField + /// Tags: LineItemService.getLineItem + /// Tags: LineItemService.updateLineItems + /// + class SetLineItemCustomFieldValue : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example sets custom field values on a line item. To determine which " + + "custom fields exist, run GetAllCustomFields.cs. To create custom field options, " + + "run CreateCustomFieldOptions.cs. To determine which line items exist, run " + + "GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new SetLineItemCustomFieldValue(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201302.CustomFieldService); + + // Get the LineItemService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201302.LineItemService); + + // Set the IDs of the custom fields, custom field option, and line item. + long customFieldId = long.Parse(_T("INSERT_STRING_CUSTOM_FIELD_ID_HERE")); + long dropDownCustomFieldId = long.Parse(_T("INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE")); + long customFieldOptionId = long.Parse(_T("INSERT_CUSTOM_FIELD_OPTION_ID_HERE")); + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get the custom field. + CustomField customField = customFieldService.getCustomField(customFieldId); + + // Get the drop-down custom field. + DropDownCustomField dropDownCustomField = + (DropDownCustomField) customFieldService.getCustomField(dropDownCustomFieldId); + + // Get the line item. + LineItem lineItem = lineItemService.getLineItem(lineItemId); + + // Create custom field values. + List customFieldValues = new List(); + TextValue textValue = new TextValue(); + textValue.value = "Custom field value"; + + CustomFieldValue customFieldValue = new CustomFieldValue(); + customFieldValue.customFieldId = customFieldId; + customFieldValue.value = textValue; + customFieldValues.Add(customFieldValue); + + DropDownCustomFieldValue dropDownCustomFieldValue = new DropDownCustomFieldValue(); + dropDownCustomFieldValue.customFieldId = dropDownCustomFieldId; + dropDownCustomFieldValue.customFieldOptionId = customFieldOptionId; + customFieldValues.Add(dropDownCustomFieldValue); + + // Only add existing custom field values for different custom fields than + // the ones you are setting. + if (lineItem.customFieldValues != null) { + foreach (BaseCustomFieldValue oldCustomFieldValue in lineItem.customFieldValues) { + if (!(oldCustomFieldValue.customFieldId == customFieldId) + && !(oldCustomFieldValue.customFieldId == dropDownCustomFieldId)) { + customFieldValues.Add(oldCustomFieldValue); + } + } + } + + lineItem.customFieldValues = customFieldValues.ToArray(); + + // Update the line item on the server. + LineItem[] lineItems = lineItemService.updateLineItems(new LineItem[] {lineItem}); + + if (lineItems != null) { + foreach (LineItem updatedLineItem in lineItems) { + List customFieldValueStrings = new List(); + foreach (BaseCustomFieldValue baseCustomFieldValue in lineItem.customFieldValues) { + if (baseCustomFieldValue is CustomFieldValue + && ((CustomFieldValue) baseCustomFieldValue).value is TextValue) { + customFieldValueStrings.Add("{ID: '" + baseCustomFieldValue.customFieldId + + "', value: '" + + ((TextValue) ((CustomFieldValue) baseCustomFieldValue).value).value + + "'}"); + } else if (baseCustomFieldValue is DropDownCustomFieldValue) { + customFieldValueStrings.Add("{ID: '" + baseCustomFieldValue.customFieldId + + "', custom field option ID: '" + + ((DropDownCustomFieldValue) baseCustomFieldValue).customFieldOptionId + + "'}"); + } + } + Console.WriteLine("A line item with ID \"{0}\" set with custom field values \"{1}\".", + updatedLineItem.id, string.Join(", ", customFieldValueStrings.ToArray())); + } + } else { + Console.WriteLine("No line items were updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CustomFieldService/UpdateCustomFields.cs b/examples/Dfp/CSharp/v201302/CustomFieldService/UpdateCustomFields.cs new file mode 100644 index 00000000000..6be6d506215 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CustomFieldService/UpdateCustomFields.cs @@ -0,0 +1,95 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using Google.Api.Ads.Dfp.Util.v201302; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example updates custom field descriptions. To determine which + /// custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.updateCustomFields + /// + class UpdateCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates custom field descriptions. To determine which custom " + + "fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201302.CustomFieldService); + + // Set the ID of the custom field to update. + long customFieldId = long.Parse(_T("INSERT_CUSTOM_FIELD_ID_HERE")); + + try { + // Get the custom field. + CustomField customField = customFieldService.getCustomField(customFieldId); + + if (customField != null) { + customField.description = + (customField.description == null ? "" : customField.description + " Updated"); + + // Update the custom field on the server. + CustomField[] customFields = + customFieldService.updateCustomFields(new CustomField[] {customField}); + + // Display results + if (customFields != null) { + foreach (CustomField updatedCustomField in customFields) { + Console.WriteLine("Custom field with ID \"{0}\", name \"{1}\", and description " + + "\"{2}\" was updated.", updatedCustomField.id, updatedCustomField.name, + updatedCustomField.description); + } + } else { + Console.WriteLine("No custom fields were updated."); + } + } else { + Console.WriteLine("No custom fields found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs b/examples/Dfp/CSharp/v201302/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs new file mode 100644 index 00000000000..3c9ba76fea9 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs @@ -0,0 +1,158 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates new custom targeting keys and values. To + /// determine which custom targeting keys and values exist, run + /// GetAllCustomTargetingKeysAndValues.cs. To target these custom targeting + /// keys and values, run TargetCustomCriteria.cs. + /// + /// Tags: CustomTargetingService.createCustomTargetingKeys + /// Tags: CustomTargetingService.createCustomTargetingValues + /// + class CreateCustomTargetingKeysAndValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new custom targeting keys and values. To determine " + + "which custom targeting keys and values exist, run " + + "GetAllCustomTargetingKeysAndValues.cs. To target these custom targeting keys and " + + "values, run TargetCustomCriteria.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomTargetingKeysAndValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201302.CustomTargetingService); + + // Create predefined key. + CustomTargetingKey genderKey = new CustomTargetingKey(); + genderKey.displayName = "gender"; + genderKey.name = "g"; + genderKey.type = CustomTargetingKeyType.PREDEFINED; + + // Create predefined key that may be used for content targeting. + CustomTargetingKey genreKey = new CustomTargetingKey(); + genreKey.displayName = "genre"; + genreKey.name = "genre"; + genreKey.type = CustomTargetingKeyType.PREDEFINED; + + // Create free-form key. + CustomTargetingKey carModelKey = new CustomTargetingKey(); + carModelKey.displayName = "car model"; + carModelKey.name = "c"; + carModelKey.type = CustomTargetingKeyType.FREEFORM; + + try { + // Create the custom targeting keys on the server. + CustomTargetingKey[] keys = customTargetingService.createCustomTargetingKeys( + new CustomTargetingKey[] {genderKey, genreKey, carModelKey}); + + if (keys != null) { + foreach (CustomTargetingKey key in keys) { + Console.WriteLine("A custom targeting key with ID \"{0}\", name \"{1}\", and display " + + "name \"{2}\" was created.", key.id, key.name, key.displayName); + } + } else { + Console.WriteLine("No keys were created."); + } + + // Create custom targeting value for the predefined gender key. + CustomTargetingValue genderMaleValue = new CustomTargetingValue(); + genderMaleValue.customTargetingKeyId = keys[0].id; + genderMaleValue.displayName = "male"; + // Name is set to 1 so that the actual name can be hidden from website + // users. + genderMaleValue.name = "1"; + genderMaleValue.matchType = CustomTargetingValueMatchType.EXACT; + + CustomTargetingValue genderFemaleValue = new CustomTargetingValue(); + genderFemaleValue.customTargetingKeyId = keys[0].id; + genderFemaleValue.displayName = "female"; + // Name is set to 2 so that the actual name can be hidden from website + // users. + genderFemaleValue.name = "2"; + genderFemaleValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create custom targeting value for the predefined genre key. + CustomTargetingValue genreComedyValue = new CustomTargetingValue(); + genreComedyValue.customTargetingKeyId = keys[1].id; + genreComedyValue.displayName = "comedy"; + genreComedyValue.name = "comedy"; + genreComedyValue.matchType = CustomTargetingValueMatchType.EXACT; + + CustomTargetingValue genreDramaValue = new CustomTargetingValue(); + genreDramaValue.customTargetingKeyId = keys[1].id; + genreDramaValue.displayName = "drama"; + genreDramaValue.name = "drama"; + genreDramaValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create custom targeting value for the free-form age key. These are + // values that would be suggested in the UI or can be used when + // targeting with a FreeFormCustomCriteria. + CustomTargetingValue carModelHondaCivicValue = new CustomTargetingValue(); + carModelHondaCivicValue.customTargetingKeyId = keys[2].id; + carModelHondaCivicValue.displayName = "honda civic"; + carModelHondaCivicValue.name = "honda civic"; + // Setting match type to exact will match exactly "honda civic". + carModelHondaCivicValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create the custom targeting values on the server. + CustomTargetingValue[] returnValues = customTargetingService.createCustomTargetingValues( + new CustomTargetingValue[] {genderMaleValue, genderFemaleValue, genreComedyValue, + genreDramaValue, carModelHondaCivicValue}); + + if (returnValues != null) { + foreach (CustomTargetingValue value in returnValues) { + Console.WriteLine("A custom targeting value with ID \"{0}\", belonging to key with " + + "ID \"{1}\", name \"{2}\", and display name \"{3}\" was created.", value.id, + value.customTargetingKeyId, value.name, value.displayName); + } + } else { + Console.WriteLine("No values were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom targeting keys and values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs b/examples/Dfp/CSharp/v201302/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs new file mode 100644 index 00000000000..02fbfb25ecd --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs @@ -0,0 +1,122 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all custom targeting keys and the values. To create + /// custom targeting keys and values, run + /// CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// + class GetAllCustomTargetingKeysAndValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom targeting keys and the values. To create " + + "custom targeting keys and values, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCustomTargetingKeysAndValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201302.CustomTargetingService); + + // Sets defaults for page and filter. + CustomTargetingKeyPage keyPage = new CustomTargetingKeyPage(); + Statement keyFilterStatement = new Statement(); + int keyOffset = 0; + + try { + do { + // Create a statement to get all custom targeting keys. + keyFilterStatement.query = "LIMIT 500 OFFSET " + keyOffset; + + // Get custom targeting keys by statement. + keyPage = customTargetingService.getCustomTargetingKeysByStatement(keyFilterStatement); + + if (keyPage.results != null) { + int i = keyPage.startIndex; + foreach (CustomTargetingKey key in keyPage.results) { + Console.WriteLine("{0}) Custom targeting key with ID \"{1}\", name \"{2}\", " + + "display name \"{3}\", and type \"{4}\" was found.", i, key.id, key.name, + key.displayName, key.type); + + + // Sets defaults for page and filter. + CustomTargetingValuePage valuePage = new CustomTargetingValuePage(); + Statement valueFilterStatement = new Statement(); + int valueOffset = 0; + + do { + // Create a statement to get all custom targeting values for a + // custom targeting key (required) by its ID. + valueFilterStatement.query = string.Format("WHERE customTargetingKeyId = {0} " + + "LIMIT 500 OFFSET {1}", key.id, valueOffset); + + // Get custom targeting values by statement. + valuePage = customTargetingService.getCustomTargetingValuesByStatement( + valueFilterStatement); + + if (valuePage.results != null) { + int j = valuePage.startIndex; + foreach (CustomTargetingValue value in valuePage.results) { + Console.WriteLine("\t{0}) Custom targeting value with ID \"{1}\", name " + + "\"{2}\", and display name \"{3}\" was found.", j, value.id, value.name, + value.displayName); + j++; + } + } + valueOffset += 500; + } while (valuePage.results != null && valuePage.results.Length == 500); + i++; + } + } + keyOffset += 500; + } while (keyPage.results != null && keyPage.results.Length == 500); + Console.WriteLine("Number of results found: {0}", keyPage.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get custom targeting keys and the values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CustomTargetingService/GetCustomTargetingKeysByStatement.cs b/examples/Dfp/CSharp/v201302/CustomTargetingService/GetCustomTargetingKeysByStatement.cs new file mode 100644 index 00000000000..f17cae7137d --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CustomTargetingService/GetCustomTargetingKeysByStatement.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all predefined custom targeting keys. The statement + /// retrieves up to the maximum page size limit of 500. To create custom + /// targeting keys, run CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// + class GetCustomTargetingKeysByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all predefined custom targeting keys. The statement " + + "retrieves up to the maximum page size limit of 500. To create custom " + + "targeting keys, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCustomTargetingKeysByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201302.CustomTargetingService); + + try { + // Create a statement to only select predefined custom targeting keys. + Statement filterStatement = new StatementBuilder("WHERE type = :type LIMIT 500").AddValue( + "type", CustomTargetingKeyType.PREDEFINED.ToString()).ToStatement(); + + // Get custom targeting keys by statement. + CustomTargetingKeyPage page = + customTargetingService.getCustomTargetingKeysByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomTargetingKey customTargetingKey in page.results) { + Console.WriteLine("{0}) Custom targeting key with ID \"{1}\", name \"{2}\", and " + + "display name \"{3}\" was found.", i, customTargetingKey.id, + customTargetingKey.name, customTargetingKey.displayName); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get predefined custom targeting keys. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CustomTargetingService/GetCustomTargetingValuesByStatement.cs b/examples/Dfp/CSharp/v201302/CustomTargetingService/GetCustomTargetingValuesByStatement.cs new file mode 100644 index 00000000000..00c3a15a541 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CustomTargetingService/GetCustomTargetingValuesByStatement.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets custom targeting values for the given predefined + /// custom targeting key. The statement retrieves up to the maximum page size + /// limit of 500. To create custom targeting values, run + /// CreateCustomTargetingKeysAndValues.cs. To determine which custom + /// targeting keys exist, run GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// + class GetCustomTargetingValuesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets custom targeting values for the given predefined custom " + + "targeting key. The statement retrieves up to the maximum page size limit of 500. " + + "To create custom targeting values, run CreateCustomTargetingKeysAndValues.cs. To " + + "determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCustomTargetingValuesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201302.CustomTargetingService); + + // Set the ID of the custom targeting key to get custom targeting values + // for. + long customTargetingKeyId = long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + + // Create a statement to only select custom targeting values for a given + // key. + Statement filterStatement = + new StatementBuilder("WHERE customTargetingKeyId = :customTargetingKeyId LIMIT 500") + .AddValue("customTargetingKeyId", customTargetingKeyId).ToStatement(); + + try { + // Get custom targeting values by statement. + CustomTargetingValuePage page = + customTargetingService.getCustomTargetingValuesByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomTargetingValue customTargetingValue in page.results) { + Console.WriteLine("{0}) Custom targeting value with ID \"{1}\", name \"{2}\", and " + + "display name \"{3}\" was found.", i, customTargetingValue.id, + customTargetingValue.name, customTargetingValue.displayName); + i++; + } + } + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get custom targeting values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CustomTargetingService/UpdateCustomTargetingKeys.cs b/examples/Dfp/CSharp/v201302/CustomTargetingService/UpdateCustomTargetingKeys.cs new file mode 100644 index 00000000000..9c7fedb3b80 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CustomTargetingService/UpdateCustomTargetingKeys.cs @@ -0,0 +1,107 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example updates the display name of each custom targeting key up + /// to the first 500. To determine which custom targeting keys exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// Tags: CustomTargetingService.updateCustomTargetingKeys + /// + class UpdateCustomTargetingKeys : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the display name of each custom targeting key up " + + "to the first 500. To determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomTargetingKeys(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201302.CustomTargetingService); + + // Create a statement to get all custom targeting keys. + Statement filterStatement = new Statement(); + filterStatement.query = "LIMIT 500"; + + try { + // Get custom targeting keys by statement. + CustomTargetingKeyPage page = + customTargetingService.getCustomTargetingKeysByStatement(filterStatement); + + if (page.results != null) { + CustomTargetingKey[] customTargetingKeys = page.results; + + // Update each local custom targeting key object by changing its display + // name. + foreach (CustomTargetingKey customTargetingKey in customTargetingKeys) { + if (customTargetingKey.displayName == null) { + customTargetingKey.displayName = customTargetingKey.name; + } + customTargetingKey.displayName = customTargetingKey.displayName + " (Deprecated)"; + } + + // Update the custom targeting keys on the server. + customTargetingKeys = + customTargetingService.updateCustomTargetingKeys(customTargetingKeys); + + if (customTargetingKeys != null) { + foreach (CustomTargetingKey customTargetingKey in customTargetingKeys) { + Console.WriteLine("Custom targeting key with ID \"{0}\", name \"{1}\", and " + + "display name \"{2}\" was updated.", customTargetingKey.id, + customTargetingKey.name, customTargetingKey.displayName); + } + } else { + Console.WriteLine("No custom targeting keys updated."); + } + } else { + Console.WriteLine("No custom targeting keys found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update display name of custom targeting keys. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/CustomTargetingService/UpdateCustomTargetingValues.cs b/examples/Dfp/CSharp/v201302/CustomTargetingService/UpdateCustomTargetingValues.cs new file mode 100644 index 00000000000..9e9a33d4f40 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/CustomTargetingService/UpdateCustomTargetingValues.cs @@ -0,0 +1,113 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example updates the display name of each custom targeting value + /// up to the first 500. To determine which custom targeting keys exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// Tags: CustomTargetingService.updateCustomTargetingValues + /// + class UpdateCustomTargetingValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the display name of each custom targeting value up to " + + "the first 500. To determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomTargetingValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201302.CustomTargetingService); + + // Set the ID of the predefined custom targeting key to get custom + // targeting values for. + long customTargetingKeyId = long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + + // Create a statement to only select predefined custom targeting values + // for a given key. + Statement filterStatement = + new StatementBuilder("WHERE customTargetingKeyId = :customTargetingKeyId LIMIT 500") + .AddValue("customTargetingKeyId", customTargetingKeyId).ToStatement(); + + try { + // Get custom targeting values by statement. + CustomTargetingValuePage page = + customTargetingService.getCustomTargetingValuesByStatement(filterStatement); + + if (page.results != null) { + CustomTargetingValue[] customTargetingValues = page.results; + + // Update each local custom targeting value object by changing its + // display name. + foreach (CustomTargetingValue customTargetingValue in customTargetingValues) { + if (customTargetingValue.displayName == null) { + customTargetingValue.displayName = customTargetingValue.displayName; + } + customTargetingValue.displayName = customTargetingValue.displayName + " (Deprecated)"; + } + + // Update the custom targeting values on the server. + customTargetingValues = + customTargetingService.updateCustomTargetingValues(customTargetingValues); + + if (customTargetingValues != null) { + foreach (CustomTargetingValue customTargetingValue in customTargetingValues) { + Console.WriteLine("Custom targeting value with ID \"{0}\", name \"{1}\", and " + + "display name \"{2}\" was updated.", customTargetingValue.id, + customTargetingValue.name, customTargetingValue.displayName); + } + } else { + Console.WriteLine("No custom targeting values updated."); + } + } else { + Console.WriteLine("No custom targeting values found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update display names of custom targeting values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ForecastService/GetForecast.cs b/examples/Dfp/CSharp/v201302/ForecastService/GetForecast.cs new file mode 100644 index 00000000000..d747b4c58f1 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ForecastService/GetForecast.cs @@ -0,0 +1,111 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets a forecast for a prospective line item. To + /// determine which placements exist, run GetAllPlacements.cs. + /// + /// Tags: ForecastService.getForecast + /// + class GetForecast : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a forecast for a prospective line item. To determine " + + "which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetForecast(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ForecastService. + ForecastService forecastService = + (ForecastService)user.GetService(DfpService.v201302.ForecastService); + + // Set the placement that the prospective line item will target. + long[] targetPlacementIds = new long[] {long.Parse(_T("INSERT_PLACEMENT_ID_HERE"))}; + + // Set the end date time to have the line line item run till. + string endDateTime = "INSERT_END_DATE_TIME_HERE (yyyyMMdd HH:mm:ss)"; + + // Create prospective line item. + LineItem lineItem = new LineItem(); + + lineItem.targeting = new Targeting(); + lineItem.targeting.inventoryTargeting = new InventoryTargeting(); + lineItem.targeting.inventoryTargeting.targetedPlacementIds = targetPlacementIds; + + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + lineItem.lineItemType = LineItemType.SPONSORSHIP; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + + lineItem.endDateTime = DateTimeUtilities.FromString(endDateTime); + + // Set the cost type to match the unit type. + lineItem.costType = CostType.CPM; + + try { + // Get forecast. + Forecast forecast = forecastService.getForecast(lineItem); + + // Display results. + long matched = forecast.matchedUnits; + double availablePercent = (double) (forecast.availableUnits / (matched * 1.0)) * 100; + String unitType = forecast.unitType.ToString().ToLower(); + Console.WriteLine("{0} {1} matched.\n{2}% available.", matched, unitType, + availablePercent, unitType); + + if (forecast.possibleUnitsSpecified) { + double possiblePercent = (double) (forecast.possibleUnits / (matched * 1.0)) * 100; + Console.WriteLine("{0}% {1} possible.\n", possiblePercent, unitType); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get forecast. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ForecastService/GetForecastById.cs b/examples/Dfp/CSharp/v201302/ForecastService/GetForecastById.cs new file mode 100644 index 00000000000..715f2475fde --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ForecastService/GetForecastById.cs @@ -0,0 +1,82 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets a forecast for an existing line item. To determine + /// which line items exist, run GetAllLineItems.cs. + /// + /// Tags: ForecastService.getForecastById + /// + class GetForecastById : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a forecast for an existing line item. To determine which " + + "line items exist, run GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetForecastById(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ForecastService. + ForecastService forecastService = + (ForecastService) user.GetService(DfpService.v201302.ForecastService); + + // Set the line item to get a forecast for. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get forecast for line item. + Forecast forecast = forecastService.getForecastById(lineItemId); + + // Display results. + long matched = forecast.matchedUnits; + double availablePercent = (double) (forecast.availableUnits / (matched * 1.0)) * 100; + String unitType = forecast.unitType.ToString().ToLower(); + + Console.WriteLine("{0} {1} matched.\n{2} % {3} available.", matched, unitType, + availablePercent, unitType); + if (forecast.possibleUnitsSpecified) { + double possiblePercent = (double) (forecast.possibleUnits / (matched * 1.0)) * 100; + Console.WriteLine(possiblePercent + "% " + unitType + " possible.\n"); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get forecast by id. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/InventoryService/CreateAdUnits.cs b/examples/Dfp/CSharp/v201302/InventoryService/CreateAdUnits.cs new file mode 100644 index 00000000000..2b6dec39877 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/InventoryService/CreateAdUnits.cs @@ -0,0 +1,108 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates new ad units under the effective root ad unit. + /// To determine which ad units exist, run GetAdUnitTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.createAdUnits, NetworkService.getCurrentNetwork + /// + class CreateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new ad units under the effective root ad unit. To " + + "determine which ad units exist, run GetAdUnitTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201302.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201302.NetworkService); + + string effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create an array to store local ad unit objects. + AdUnit[] adUnits = new AdUnit[5]; + + for (int i = 0; i < 5; i++) { + AdUnit adUnit = new AdUnit(); + adUnit.name = string.Format("Ad_Unit_{0}", i); + adUnit.parentId = effectiveRootAdUnitId; + + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + + // Set the size of possible creatives that can match this ad unit. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + adUnits[i] = adUnit; + } + + try { + // Create the ad units on the server. + adUnits = inventoryService.createAdUnits(adUnits); + + if (adUnits != null) { + foreach (AdUnit adUnit in adUnits) { + Console.WriteLine("An ad unit with ID = '{0}' was created under parent with " + + "ID = '{1}'.", adUnit.id, adUnit.parentId); + } + } else { + Console.WriteLine("No ad units created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/InventoryService/CreateMobileAdUnit.cs b/examples/Dfp/CSharp/v201302/InventoryService/CreateMobileAdUnit.cs new file mode 100644 index 00000000000..4962cef690b --- /dev/null +++ b/examples/Dfp/CSharp/v201302/InventoryService/CreateMobileAdUnit.cs @@ -0,0 +1,104 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates a new mobile ad unit under the effective root + /// ad unit. Mobile features need to be enabled on your account to use mobile + /// targeting. To determine which ad units exist, run GetInventoryTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.createAdUnits, NetworkService.getCurrentNetwork + /// + class CreateMobileAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new mobile ad unit under the effective ad unit. " + + "Mobile features need to be enabled on your account to use mobile targeting. To " + + "determine which ad units exist, run GetInventoryTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateMobileAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201302.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201302.NetworkService); + + // Set the parent ad unit's ID for all ad units to be created under. + String effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create local ad unit object. + AdUnit adUnit = new AdUnit(); + adUnit.name = "Mobile_Ad_Unit"; + adUnit.parentId = effectiveRootAdUnitId; + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + adUnit.targetPlatform = TargetPlatform.MOBILE; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + Size size = new Size(); + size.width = 400; + size.height = 300; + size.isAspectRatio = false; + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + // Set the size of possible creatives that can match this ad unit. + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + + try { + // Create the ad unit on the server. + adUnit = inventoryService.createAdUnit(adUnit); + + if (adUnit != null) { + Console.WriteLine("An ad unit with ID \"{0}\" was created under parent with ID \"{1}\".", + adUnit.id, adUnit.parentId); + } else { + Console.WriteLine("No ad units created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/InventoryService/CreateVideoAdUnit.cs b/examples/Dfp/CSharp/v201302/InventoryService/CreateVideoAdUnit.cs new file mode 100644 index 00000000000..abb0cc323e7 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/InventoryService/CreateVideoAdUnit.cs @@ -0,0 +1,123 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates a new video ad unit under the effective root + /// ad unit. To determine which ad units exist, run GetInventoryTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.CreateVideoAdUnit, NetworkService.getCurrentNetwork + /// + class CreateVideoAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new ad units under the effective root ad unit. To " + + "determine which ad units exist, run GetAdUnitTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateVideoAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201302.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201302.NetworkService); + + // Set the parent ad unit's ID for all ad units to be created under. + String effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create local ad unit object. + AdUnit adUnit = new AdUnit(); + adUnit.name = "Video_Ad_Unit"; + adUnit.parentId = effectiveRootAdUnitId; + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + adUnit.explicitlyTargeted = true; + adUnit.targetPlatform = TargetPlatform.WEB; + + // Create master ad unit size. + AdUnitSize masterAdUnitSize = new AdUnitSize(); + Size size1 = new Size(); + size1.width = 400; + size1.height = 300; + size1.isAspectRatio = false; + masterAdUnitSize.size = size1; + masterAdUnitSize.environmentType = EnvironmentType.VIDEO_PLAYER; + + // Create companion sizes. + AdUnitSize companionAdUnitSize1 = new AdUnitSize(); + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + size2.isAspectRatio = false; + companionAdUnitSize1.size = size2; + companionAdUnitSize1.environmentType = EnvironmentType.BROWSER; + + AdUnitSize companionAdUnitSize2 = new AdUnitSize(); + Size size3 = new Size(); + size3.width = 728; + size3.height = 90; + size3.isAspectRatio = false; + companionAdUnitSize2.size = size3; + companionAdUnitSize2.environmentType = EnvironmentType.BROWSER; + + // Add companions to master ad unit size. + masterAdUnitSize.companions = new AdUnitSize[] {companionAdUnitSize1, companionAdUnitSize2}; + + // Set the size of possible creatives that can match this ad unit. + adUnit.adUnitSizes = new AdUnitSize[] {masterAdUnitSize}; + + try { + // Create the ad unit on the server. + adUnit = inventoryService.createAdUnit(adUnit); + + if (adUnit != null) { + Console.WriteLine("A video ad unit with ID \"{0}\" was created under parent with ID " + + "\"{1}\".", adUnit.id, adUnit.parentId); + } else { + Console.WriteLine("No video ad units created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create video ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/InventoryService/DeActivateAdUnits.cs b/examples/Dfp/CSharp/v201302/InventoryService/DeActivateAdUnits.cs new file mode 100644 index 00000000000..6daec180547 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/InventoryService/DeActivateAdUnits.cs @@ -0,0 +1,120 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example deactivates all active ad units. To determine which ad + /// units exist, run GetAllAdUnits.cs or GetInventoryTree.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: InventoryService.performAdUnitAction + /// + class DeActivateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active ad units. To determine which ad units " + + "exist, run GetAllAdUnits.cs or GetInventoryTree.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeActivateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201302.InventoryService); + + // Create Statement text to select active ad units. + string statementText = "WHERE status = :status LIMIT 500"; + + Statement statement = new StatementBuilder("").AddValue("status", + InventoryStatus.ACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + AdUnitPage page = new AdUnitPage(); + int offset = 0; + List adUnitIds = new List(); + + try { + do { + // Create a Statement to page through active ad units. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID ='{1}', name = {2} and status = {3} will" + + " be deactivated.", i, adUnit.id, adUnit.name, adUnit.status); + adUnitIds.Add(adUnit.id); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of ad units to be deactivated: {0}", adUnitIds.Count); + + if (adUnitIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", adUnitIds.ToArray()))). + ToStatement(); + + // Create action. + DeactivateAdUnits action = new DeactivateAdUnits(); + + // Perform action. + UpdateResult result = inventoryService.performAdUnitAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of ad units deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No ad units were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/InventoryService/GetAdUnit.cs b/examples/Dfp/CSharp/v201302/InventoryService/GetAdUnit.cs new file mode 100644 index 00000000000..92b24c6cf29 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/InventoryService/GetAdUnit.cs @@ -0,0 +1,77 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets an ad unit by its ID. To determine which ad units + /// exist, run GetInventoryTree.cs or GetAllAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnit + /// + class GetAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets an ad unit by its ID. To determine which ad units " + + "exist, run GetInventoryTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201302.InventoryService); + + // Set the ID of the ad unit to get. + String adUnitId = _T("INSERT_AD_UNIT_ID_HERE"); + + try { + // Get the ad unit. + AdUnit adUnit = inventoryService.getAdUnit(adUnitId); + + if (adUnit != null) { + Console.WriteLine("Ad unit with ID = '{0}', name = '{1}' and status = '{2}' was found.", + adUnit.id, adUnit.name, adUnit.status); + } else { + Console.WriteLine("No ad unit found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/InventoryService/GetAdUnitSizes.cs b/examples/Dfp/CSharp/v201302/InventoryService/GetAdUnitSizes.cs new file mode 100644 index 00000000000..ff9d03d1d8d --- /dev/null +++ b/examples/Dfp/CSharp/v201302/InventoryService/GetAdUnitSizes.cs @@ -0,0 +1,80 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; +using Google.Api.Ads.Dfp.Util.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all web target platform ad unit sizes. + /// + /// Tags: InventoryService.getAdUnitSizesByStatement + /// + class GetAdUnitSizes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all web target platform ad unit sizes."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnitSizes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201302.InventoryService); + + Statement filterStatement = new StatementBuilder("WHERE targetPlatform = :targetPlatform"). + AddValue("targetPlatform", "WEB").ToStatement(); + + try { + // Get all ad unit sizes. + AdUnitSize[] adUnitSizes = inventoryService.getAdUnitSizesByStatement(filterStatement); + + // Display results. + if (adUnitSizes != null) { + for (int i = 0; i < adUnitSizes.Length; i++) { + AdUnitSize adUnitSize = adUnitSizes[i]; + Console.WriteLine("{0}) Ad unit size ({1}x{2}) was found.\n", i, + adUnitSize.size.width, adUnitSize.size.height); + } + } else { + Console.WriteLine("No ad unit sizes found."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit sizes. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/InventoryService/GetAdUnitsByStatement.cs b/examples/Dfp/CSharp/v201302/InventoryService/GetAdUnitsByStatement.cs new file mode 100644 index 00000000000..d72dfe53553 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/InventoryService/GetAdUnitsByStatement.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets the root ad unit. To create an ad unit, run + /// CreateAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: NetworkService.getCurrentNetwork + /// + class GetAdUnitsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the root ad unit. To create an ad unit, run " + + "CreateAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnitsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201302.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201302.NetworkService); + + // Get the effective root ad unit ID of the network. + string effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create a statement to select the children of the effective root ad + // unit. + Statement statement = new StatementBuilder("WHERE parentId = :id LIMIT 1").AddValue( + "id", effectiveRootAdUnitId).ToStatement(); + + try { + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID = '{1}', name = '{2}' and status = '{3}' " + + "was found.", i, adUnit.id, adUnit.name, adUnit.status); + i++; + } + } + + // The number of results should always be 1 for this code example. + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/InventoryService/GetAllAdUnits.cs b/examples/Dfp/CSharp/v201302/InventoryService/GetAllAdUnits.cs new file mode 100644 index 00000000000..48ecf753a8e --- /dev/null +++ b/examples/Dfp/CSharp/v201302/InventoryService/GetAllAdUnits.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all ad units. To create ad units, run + /// CreateAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// + class GetAllAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all ad units. To create ad units, run CreateAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201302.InventoryService); + + // Sets defaults for page and statement. + AdUnitPage page = new AdUnitPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all ad units. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID = '{1}', name = '{2}' and status = '{3}' " + + "was found.", i, adUnit.id, adUnit.name, adUnit.status); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/InventoryService/GetInventoryTree.cs b/examples/Dfp/CSharp/v201302/InventoryService/GetInventoryTree.cs new file mode 100644 index 00000000000..f85e1d04dda --- /dev/null +++ b/examples/Dfp/CSharp/v201302/InventoryService/GetInventoryTree.cs @@ -0,0 +1,203 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example retrieves a previously created ad units and creates + /// a tree. + /// + /// Tags: InventoryService.getAdUnit, InventoryService.getAdUnitsByStatement + /// + class GetInventoryTree : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves a previously created ad units and creates a tree."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetInventoryTree(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + try { + // Get all ad units. + AdUnit[] allAdUnits = GetAllAdUnits(user); + + // Find the root ad unit. rootAdUnit can also be set to child unit to + // only build and display a portion of the tree. + // i.e. AdUnit adUnit = + // inventoryService.getAdUnit("INSERT_AD_UNIT_HERE") + AdUnit rootAdUnit = FindRootAdUnit(user); + + if (rootAdUnit == null) { + Console.WriteLine("Could not build tree. No root ad unit found."); + } else { + BuildAndDisplayAdUnitTree(rootAdUnit, allAdUnits); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + + /// + /// Gets all ad units for this user. + /// + /// The DfpUser to get the ad units for. + /// All ad units for this user. + private static AdUnit[] GetAllAdUnits(DfpUser user) { + // Create list to hold all ad units. + List adUnits = new List(); + + // Get InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201302.InventoryService); + + // Sets defaults for page and Statement. + AdUnitPage page = new AdUnitPage(); + Statement statement = new Statement(); + int offset = 0; + + do { + // Create a Statement to get all ad units. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + adUnits.AddRange(page.results); + } + offset += 500; + } while (page.results != null && page.results.Length == 500); + return adUnits.ToArray(); + } + + /// + /// Finds the root ad unit for the user. + /// + /// The DfpUser to get the root ad unit for. + /// The ad unit representing the root ad unit or null if one + /// is not found. + private static AdUnit FindRootAdUnit(DfpUser user) { + // Get InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201302.InventoryService); + + // Create a Statement to only select the root ad unit. + Statement statement = new Statement(); + statement.query = "WHERE parentId IS NULL LIMIT 500"; + + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + return page.results[0]; + } + return null; + } + + /// + /// Builds and displays an ad unit tree from an array of ad units underneath + /// the root ad unit. + /// + /// The root ad unit to build the tree under. + /// The array of ad units. + private static void BuildAndDisplayAdUnitTree(AdUnit root, AdUnit[] units) { + Dictionary> treeMap = new Dictionary>(); + + foreach (AdUnit unit in units) { + if (unit.parentId != null) { + if (treeMap.ContainsKey(unit.parentId) == false) { + treeMap.Add(unit.parentId, new List()); + } + treeMap[unit.parentId].Add(unit); + } + } + + if (root != null) { + DisplayInventoryTree(root, treeMap); + } else { + Console.WriteLine("No root unit found."); + } + } + + /// + /// Displays the ad unit tree beginning at the root ad unit. + /// + /// The root ad unit + /// The map of id to list of ad units + private static void DisplayInventoryTree(AdUnit root, Dictionary> treeMap) { + DisplayInventoryTreeHelper(root, treeMap, 0); + } + + /// + /// Helper for displaying inventory units. + /// + /// The root inventory unit. + /// The map of id to List of inventory units. + /// The depth the tree has reached. + private static void DisplayInventoryTreeHelper(AdUnit root, + Dictionary> treeMap, int depth) { + Console.WriteLine(GenerateTab(depth) + root.name + " (" + root.id + ")"); + + if (treeMap.ContainsKey(root.id)) { + foreach (AdUnit child in treeMap[root.id]) { + DisplayInventoryTreeHelper(child, treeMap, depth + 1); + } + } + } + + /// + /// Generates a String of tabs to represent branching to children. + /// + /// A depth from 0 to max(depth). + /// A string to insert in front of the root unit. + private static String GenerateTab(int depth) { + StringBuilder builder = new StringBuilder(); + if (depth != 0) { + builder.Append(" "); + } + + for (int i = 1; i < depth; i++) { + builder.Append("| "); + } + builder.Append("+--"); + return builder.ToString(); + } + } +} diff --git a/examples/Dfp/CSharp/v201302/InventoryService/UpdateAdUnits.cs b/examples/Dfp/CSharp/v201302/InventoryService/UpdateAdUnits.cs new file mode 100644 index 00000000000..f3aee5eee0c --- /dev/null +++ b/examples/Dfp/CSharp/v201302/InventoryService/UpdateAdUnits.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example updates an ad unit by enabling AdSense to the first + /// 500. To determine which ad units exist, run GetAllAdUnits.cs or + /// GetInventoryTree.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement, InventoryService.updateAdUnits + /// + class UpdateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates an ad unit by enabling AdSense to the first 500. To " + + "determine which ad units exist, run GetAllAdUnits.cs or GetInventoryTree.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the sample code. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201302.InventoryService); + + // Create a statement to get all ad units. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get ad units by statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null) { + // Update each local ad unit object by enabling AdSense. + foreach (AdUnit adUnit in page.results) { + adUnit.inheritedAdSenseSettings.value.adSenseEnabled = true; + } + + // Update the ad units on the server. + AdUnit[] updatedAdUnits = inventoryService.updateAdUnits(page.results); + + if (updatedAdUnits != null) { + foreach (AdUnit adUnit in updatedAdUnits) { + Console.WriteLine("Ad unit with ID \"{0}\", name \"{1}\", and is AdSense enabled " + + "\"{2}\" was updated.", adUnit.id, adUnit.name, + adUnit.inheritedAdSenseSettings.value.adSenseEnabled); + } + } else { + Console.WriteLine("No ad units updated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to update ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LabelService/CreateLabels.cs b/examples/Dfp/CSharp/v201302/LabelService/CreateLabels.cs new file mode 100644 index 00000000000..971a2701fbe --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LabelService/CreateLabels.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates new labels. To determine which labels exist, run + /// GetAllLabels.cs. This feature is only available to DFP premium solution + /// networks. + /// + /// Tags: LabelService.createLabels + /// + class CreateLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new labels. To determine which labels exist, run " + + "GetAllLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201302.LabelService); + + try { + // Create an array to store local label objects. + Label[] labels = new Label[5]; + + for (int i = 0; i < 5; i++) { + Label label = new Label(); + label.name = "Label #" + GetTimeStamp(); + label.types = new LabelType[] {LabelType.COMPETITIVE_EXCLUSION}; + labels[i] = label; + } + + // Create the labels on the server. + labels = labelService.createLabels(labels); + + if (labels != null) { + foreach (Label label in labels) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("A label with ID '{0}', name '{1}', and type '{2}' was created.", + label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + } + } else { + Console.WriteLine("No labels created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LabelService/DeactivateActiveLabels.cs b/examples/Dfp/CSharp/v201302/LabelService/DeactivateActiveLabels.cs new file mode 100644 index 00000000000..f62514bd2a6 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LabelService/DeactivateActiveLabels.cs @@ -0,0 +1,116 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example deactivates all active labels. To determine which labels + /// exist, run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement, LabelService.performLabelAction + /// + class DeactivateActiveLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active labels. To determine which labels exist," + + " run GetAllLabels.cs. This feature is only available to DFP premium solution " + + "networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateActiveLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201302.LabelService); + + // Create statement text to select active labels. + String statementText = "WHERE isActive = :isActive LIMIT 500"; + Statement filterStatement = new StatementBuilder("").AddValue("isActive", true).ToStatement(); + + // Set defaults for page and offset. + LabelPage page = new LabelPage(); + int offset = 0; + List labelIds = new List(); + + try { + do { + // Create a statement to page through active labels. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get labels by statement. + page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + Console.WriteLine("{0}) Label with ID '{1}', name '{2}' will be deactivated.", + i, label.id, label.name); + labelIds.Add(label.id.ToString()); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of labels to be deactivated: " + labelIds.Count); + + if (labelIds.Count > 0) { + // Modify statement for action. + filterStatement.query = "WHERE id IN (" + string.Join(", ", labelIds.ToArray()) + ")"; + + // Create action. + DeactivateLabels action = new DeactivateLabels(); + + // Perform action. + UpdateResult result = labelService.performLabelAction(action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of labels deactivated: " + result.numChanges); + } else { + Console.WriteLine("No labels were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LabelService/GetAllLabels.cs b/examples/Dfp/CSharp/v201302/LabelService/GetAllLabels.cs new file mode 100644 index 00000000000..72bdb3e24bb --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LabelService/GetAllLabels.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all labels. To create labels, run CreateLabels.cs. + /// This feature is only available to DFP premium solution networks. + /// + /// Tags: LabelService.getLabelsByStatement + /// + class GetAllLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all labels. To create labels, run CreateLabels.cs. This " + + "feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201302.LabelService); + + // Set defaults for page and filterStatement. + LabelPage page = new LabelPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all labels. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get labels by statement. + page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("{0}) Label with ID '{1}', name '{2}' and type '{3}' was found.", + i, label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LabelService/GetLabel.cs b/examples/Dfp/CSharp/v201302/LabelService/GetLabel.cs new file mode 100644 index 00000000000..b247cdf5b24 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LabelService/GetLabel.cs @@ -0,0 +1,83 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets a label by its ID. To determine which labels exist, + /// run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabel + /// + class GetLabel : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a label by its ID. To determine which labels exist, " + + "run GetAllLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLabel(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201302.LabelService); + + // Set the ID of the label to get. + long labelId = long.Parse(_T("INSERT_LABEL_ID_HERE")); + + try { + // Get the label. + Label label = labelService.getLabel(labelId); + + if (label != null) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + Console.WriteLine("Label with ID '{0}, name '{1}' and type '{2}' was found.", + label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + } else { + Console.WriteLine("No label found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get label. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LabelService/GetLabelsByStatement.cs b/examples/Dfp/CSharp/v201302/LabelService/GetLabelsByStatement.cs new file mode 100644 index 00000000000..2589db4279a --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LabelService/GetLabelsByStatement.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all labels that are competitively excluded. The + /// statement retrieves up to the maximum page size limit of 500. To create + /// labels, run CreateLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement + /// + class GetLabelsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all labels that are competitively excluded. The statement " + + "retrieves up to the maximum page size limit of 500. To create labels, run " + + "CreateLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLabelsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201302.LabelService); + + // Create a statement to only select labels that are competitive + // sorted by name. + Statement filterStatement = new StatementBuilder("WHERE type = :type ORDER BY name LIMIT 500") + .AddValue("type", LabelType.COMPETITIVE_EXCLUSION.ToString()).ToStatement(); + + try { + // Get labels by statement. + LabelPage page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("{0}) Label with ID '{1}', name '{2}'and type '{3}' was found.", + i, label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LabelService/UpdateLabels.cs b/examples/Dfp/CSharp/v201302/LabelService/UpdateLabels.cs new file mode 100644 index 00000000000..e30727cab1c --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LabelService/UpdateLabels.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example updates the descriptions of all active labels by + /// updating its description up to the first 500. To determine which labels + /// exist, run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement, LabelService.updateLabels + /// + class UpdateLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the descriptions of all active labels by updating " + + "its description up to the first 500. To determine which labels exist, run " + + "GetAllLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201302.LabelService); + + // Create a statement to only select labels that are competitive + // exclusion. + Statement filterStatement = new StatementBuilder("WHERE isActive = :isActive LIMIT 500"). + AddValue("isActive", true).ToStatement(); + + try { + // Get the labels by statement. + LabelPage page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + Label[] labels = page.results; + + // Update each local label object by updating its description. + foreach (Label label in labels) { + label.description = "These labels are still competiting with each other."; + } + + // Update the labels on the server. + labels = labelService.updateLabels(labels); + + if (labels != null) { + foreach (Label label in labels) { + Console.WriteLine("A label with ID '{0}' and name '{1}' was updated.", + label.id, label.name); + } + } else { + Console.WriteLine("No labels updated."); + } + } else { + Console.WriteLine("No labels found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/ActivateLicas.cs b/examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/ActivateLicas.cs new file mode 100644 index 00000000000..062b617e766 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/ActivateLicas.cs @@ -0,0 +1,125 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example activates all deactivated LICAs for the line item. To + /// determine which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.performLineItemCreativeAssociationAction + /// + class ActivateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example activates all deactivated LICAs for the line item. To " + + "determine which LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ActivateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201302.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + String statementText = "WHERE lineItemId = :lineItemId and status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("lineItemId", lineItemId). + AddValue("status", LineItemCreativeAssociationStatus.INACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + int offset = 0; + List creativeIds = new List(); + + try { + do { + // Create a Statement to page through active LICAs. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' will be activated.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + creativeIds.Add(lica.creativeId.ToString()); + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of LICAs to be activated: {0}", creativeIds.Count); + + if (creativeIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE lineItemId = :lineItemId and creativeId IN ({0})", + string.Join(",", creativeIds.ToArray()))). + AddValue("lineItemId", lineItemId).ToStatement(); + + // Create action. + ActivateLineItemCreativeAssociations action = + new ActivateLineItemCreativeAssociations(); + + // Perform action. + UpdateResult result = + licaService.performLineItemCreativeAssociationAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of LICAs activated: {0}", result.numChanges); + } else { + Console.WriteLine("No LICAs were activated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to activate LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/CreateLicas.cs b/examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/CreateLicas.cs new file mode 100644 index 00000000000..b77df86d4c1 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/CreateLicas.cs @@ -0,0 +1,108 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates new line item creative associations (LICAs) for + /// an existing line item and a set of creative ids. For small business + /// networks, the creative ids must represent new or copied creatives as + /// creatives cannot be used for more than one line item. For premium + /// solution networks, the creative ids can represent any creative. To copy + /// creatives, run CopyImageCreatives.cs. To determine which LICAs exist, run + /// GetAllLicasExample.cs. + /// + /// Tags: LineItemCreativeAssociationService.createLineItemCreativeAssociations + /// + class CreateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new line item creative associations (LICAs) for an " + + "existing line item and a set of creative ids. For small business networks, the " + + "creative ids must represent new or copied creatives as creatives cannot be used " + + "for more than one line item. For premium solution networks, the creative ids can " + + "represent any creative. To copy creatives, run CopyImageCreatives.cs. To determine " + + "which LICAs exist, run GetAllLicasExample.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = + (LineItemCreativeAssociationService) user.GetService( + DfpService.v201302.LineItemCreativeAssociationService); + + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201302.CreativeService); + + // Set the line item ID and creative IDs to associate. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long[] creativeIds = new long[] {long.Parse(_T("INSERT_CREATIVE_ID_HERE"))}; + + // Create an array to store local LICA objects. + LineItemCreativeAssociation[] licas = new LineItemCreativeAssociation[creativeIds.Length]; + + // For each line item, associate it with the given creative. + int i = 0; + foreach (long creativeId in creativeIds) { + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId; + lica.lineItemId = lineItemId; + licas[i++] = lica; + } + + try { + // Create the LICAs on the server. + licas = licaService.createLineItemCreativeAssociations(licas); + + if (licas != null) { + foreach (LineItemCreativeAssociation lica in licas) { + Console.WriteLine("A LICA with line item ID \"{0}\", creative ID \"{1}\", and status " + + "\"{2}\" was created.", lica.lineItemId, lica.creativeId, lica.status); + } + } else { + Console.WriteLine("No LICAs created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to associate creative with line item. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/DeactivateLicas.cs b/examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/DeactivateLicas.cs new file mode 100644 index 00000000000..ed8765b5832 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/DeactivateLicas.cs @@ -0,0 +1,125 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example deactivates all LICAs for the line item. To determine + /// which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.performLineItemCreativeAssociationAction + /// + class DeactivateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all LICAs for the line item. To determine which " + + "LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201302.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + String statementText = "WHERE lineItemId = :lineItemId and status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("lineItemId", lineItemId). + AddValue("status", LineItemCreativeAssociationStatus.ACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + int offset = 0; + List creativeIds = new List(); + + try { + do { + // Create a Statement to page through active LICAs. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' will be deactivated.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + creativeIds.Add(lica.creativeId.ToString()); + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of LICAs to be deactivated: {0}", creativeIds.Count); + + if (creativeIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE lineItemId = :lineItemId and creativeId IN ({0})", + string.Join(",", creativeIds.ToArray()))). + AddValue("lineItemId", lineItemId).ToStatement(); + + // Create action. + DeactivateLineItemCreativeAssociations action = + new DeactivateLineItemCreativeAssociations(); + + // Perform action. + UpdateResult result = + licaService.performLineItemCreativeAssociationAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of LICAs deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No LICAs were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/GetAllLicas.cs b/examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/GetAllLicas.cs new file mode 100644 index 00000000000..e569c3671b8 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/GetAllLicas.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all line item creative associations (LICA). To + /// create LICAs, run CreateLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// + class GetAllLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line item creative associations (LICA). To create " + + "LICAs, run CreateLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201302.LineItemCreativeAssociationService); + + // Sets defaults for page and Statement. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all LICAs. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' was found.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + } + } + + offset += 500; + } while (page.results != null && page.results.Length == 500); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/GetLica.cs b/examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/GetLica.cs new file mode 100644 index 00000000000..7fc953c02c2 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/GetLica.cs @@ -0,0 +1,81 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets a line item creative association (LICA) by the line + /// item and creative ID. To determine which line items exist, run + /// GetAllLineItems.cs. To determine which creatives exit, run + /// GetAllCreatives.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociation + /// + class GetLica : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a line item creative association (LICA) by the line " + + "item and creative ID. To determine which line items exist, run " + + "GetAllLineItems.cs. To determine which creatives exit, run " + + "GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + new GetLica().Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201302.LineItemCreativeAssociationService); + + // Set the line item and creative ID to use to retrieve the LICA. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long creativeId = long.Parse(_T("INSERT_CREATIVE_ID_HERE")); + + try { + // Get the LICA. + LineItemCreativeAssociation lica = + licaService.getLineItemCreativeAssociation(lineItemId, creativeId); + + if (lica != null) { + Console.WriteLine("LICA with line item ID = {0}, creative ID = '{1}' and status = " + + "'{2}' was found", lica.lineItemId, lica.creativeId, lica.status); + } else { + Console.WriteLine("No LICA found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get LICA. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/GetLicasByStatement.cs b/examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/GetLicasByStatement.cs new file mode 100644 index 00000000000..74d7626b856 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/GetLicasByStatement.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all line item creative associations for a given + /// line item ID. The Statement retrieves up to the maximum page size limit of + /// 500. To create LICAs, run CreateLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// + class GetLicasByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line item creative associations for a given line " + + "item ID. The Statement retrieves up to the maximum page size limit of 500. To " + + "create LICAs, run CreateLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLicasByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201302.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + // Create a Statement to only select LICAs for the given lineItem ID. + Statement statement = new StatementBuilder("WHERE lineItemId = :lineItemId LIMIT 500"). + AddValue("lineItemId", lineItemId).ToStatement(); + + try { + // Get LICAs by Statement. + LineItemCreativeAssociationPage page = + licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' was found.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/UpdateLicas.cs b/examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/UpdateLicas.cs new file mode 100644 index 00000000000..95744909571 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LineItemCreativeAssociationService/UpdateLicas.cs @@ -0,0 +1,97 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example updates the destination URL of all LICAs up to the first + /// 500. To determine which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.updateLineItemCreativeAssociations + /// + class UpdateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the destination URL of all LICAs up to the first " + + "500. To determine which LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201302.LineItemCreativeAssociationService); + + // Create a Statement to get all LICAs. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get LICAs by Statement. + LineItemCreativeAssociationPage page = + licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + LineItemCreativeAssociation[] licas = page.results; + + // Update each local LICA object by changing its destination URL. + foreach (LineItemCreativeAssociation lica in licas) { + lica.destinationUrl = "http://news.google.com"; + } + + // Update the LICAs on the server. + licas = licaService.updateLineItemCreativeAssociations(licas); + + if (licas != null) { + foreach (LineItemCreativeAssociation lica in licas) { + Console.WriteLine("LICA with line item ID = '{0}, creative ID ='{1}' and " + + "destination URL '{2}' was updated.", lica.lineItemId, lica.creativeId, + lica.destinationUrl); + } + } else { + Console.WriteLine("No LICAs updated."); + } + } else { + Console.WriteLine("No LICAs found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LineItemService/ActivateLineItem.cs b/examples/Dfp/CSharp/v201302/LineItemService/ActivateLineItem.cs new file mode 100644 index 00000000000..05963f9161d --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LineItemService/ActivateLineItem.cs @@ -0,0 +1,134 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example activates all line items for the given order. To be + /// activated, line items need to be in the approved (needs creatives) state + /// and have at least one creative associated with them. To approve line + /// items, approve the order to which they belong by running ApproveOrders.cs. + /// To create LICAs, run CreateLicas.cs. To determine which line items exist, + /// run GetAllLineItem.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.performLineItemAction + /// + class ActivateLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example activates all line items for the given order. To be activated," + + " line items need to be in the approved (needs creatives) state and have at least one" + + " creative associated with them. To approve line items, approve the order to which" + + " they belong by running ApproveOrders.cs. To create LICAs, run CreateLicas.cs." + + " To determine which line items exist, run GetAllLineItem.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ActivateLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201302.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create Statement text to select approved line items from a given order. + string statementText = "WHERE orderId = :orderId and status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("orderId", orderId). + AddValue("status", ComputedStatus.NEEDS_CREATIVES.ToString()).ToStatement(); + + // Set defaults for page and offset. + LineItemPage page = new LineItemPage(); + int offset = 0; + int i = 0; + List lineItemIds = new List(); + + try { + do { + // Create a Statement to page through approved line items. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get line items by Statement. + page = lineItemService.getLineItemsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + foreach (LineItemSummary lineItem in page.results) { + // Archived line items cannot be activated. + if (!lineItem.isArchived) { + Console.WriteLine("{0}) Line item with ID ='{1}', belonging to order ID ='{2}' " + + "and name ='{2}' will be activated.", i, lineItem.id, lineItem.orderId, + lineItem.name); + lineItemIds.Add(lineItem.id.ToString()); + i++; + } + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of line items to be activated: {0}", lineItemIds.Count); + + if (lineItemIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", lineItemIds.ToArray()))). + ToStatement(); + + // Create action. + ActivateLineItems action = new ActivateLineItems(); + + // Perform action. + UpdateResult result = lineItemService.performLineItemAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of line items activated: {0}", result.numChanges); + } else { + Console.WriteLine("No line items were activated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to activate line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LineItemService/CreateLineItems.cs b/examples/Dfp/CSharp/v201302/LineItemService/CreateLineItems.cs new file mode 100644 index 00000000000..8da9d38a122 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LineItemService/CreateLineItems.cs @@ -0,0 +1,217 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates new line items. To determine which line items + /// exist, run GetAllLineItems.cs. To determine which orders exist, run + /// GetAllOrders.cs. To determine which placements exist, run + /// GetAllPlacements.cs. To determine the IDs for locations, run + /// GetAllCities.cs, GetAllCountries.cs, GetAllMetros.cs, GetAllRegions.cs and + /// GetAllPostalCodes. + /// + /// Tags: LineItemService.createLineItems + /// + class CreateLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new line items. To determine which line items " + + "exist, run GetAllLineItems.cs. To determine which orders exist, run GetAllOrders.cs" + + ". To determine which placements exist, run GetAllPlacements.cs. To determine the " + + "IDs for locations, run GetAllCities.cs, GetAllCountries.cs, GetAllMetros.cs, " + + "GetAllRegions.cs and GetAllPostalCodes."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code examples. + /// + /// The DFP user object running the code examples. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201302.LineItemService); + + // Set the order that all created line items will belong to and the + // placement ID to target. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + long[] targetPlacementIds = new long[] {long.Parse(_T("INSERT_PLACEMENT_ID_HERE"))}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = targetPlacementIds; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + PostalCodeLocation postalCodeLocation = new PostalCodeLocation(); + postalCodeLocation.id = 9000093; + postalCodeLocation.postalCode = "B3P"; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201302.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201302.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + // Create an array to store local line item objects. + LineItem[] lineItems = new LineItem[5]; + + for (int i = 0; i < 5; i++) { + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + i; + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + lineItems[i] = lineItem; + } + + try { + // Create the line items on the server. + lineItems = lineItemService.createLineItems(lineItems); + + if (lineItems != null) { + foreach (LineItem lineItem in lineItems) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and" + + " named \"{2}\" was created.", lineItem.id, lineItem.orderId, lineItem.name); + } + } else { + Console.WriteLine("No line items created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LineItemService/CreateMobileLineItem.cs b/examples/Dfp/CSharp/v201302/LineItemService/CreateMobileLineItem.cs new file mode 100644 index 00000000000..17f18c3405a --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LineItemService/CreateMobileLineItem.cs @@ -0,0 +1,172 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates a new line item to serve to the mobile platform. + /// Mobile features needs to be enabled in your account to use mobile + /// targeting. To determine which line items exist, run GetAllLineItems.cs. To + /// determine which orders exist, run GetAllOrders.cs. To determine + /// which placements exist, run GetAllPlacements.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.performLineItemAction + /// + class CreateMobileLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new line item to serve to the mobile platform. Mobile" + + " features needs to be enabled in your account to use mobile targeting. To determine " + + "which line items exist, run GetAllLineItems.cs. To determine which orders exist, " + + "run GetAllOrders.cs. To determine which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateMobileLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201302.LineItemService); + + // Set the order that all created line items will belong to and the + // placement containing ad units with a mobile target platform. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + long[] targetedPlacementIds = new long[] {long.Parse(_T("INSERT_MOBILE_PLACEMENT_ID_HERE"))}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = targetedPlacementIds; + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create device manufacturer targeting. + DeviceManufacturerTargeting deviceManufacturerTargeting = new DeviceManufacturerTargeting(); + deviceManufacturerTargeting.isTargeted = true; + + // Target the Google device manufacturer (40100). + Technology deviceManufacturerTechnology = new Technology(); + deviceManufacturerTechnology.id = 40100L; + deviceManufacturerTargeting.deviceManufacturers = + new Technology[] {deviceManufacturerTechnology}; + technologyTargeting.deviceManufacturerTargeting = deviceManufacturerTargeting; + + // Create mobile device targeting. + MobileDeviceTargeting mobileDeviceTargeting = new MobileDeviceTargeting(); + + // Exclude the Nexus One device (604046). + Technology mobileDeviceTechnology = new Technology(); + mobileDeviceTechnology.id = 604046L; + mobileDeviceTargeting.targetedMobileDevices = new Technology[] {mobileDeviceTechnology}; + technologyTargeting.mobileDeviceTargeting = mobileDeviceTargeting; + + // Create mobile device submodel targeting. + MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargeting = + new MobileDeviceSubmodelTargeting(); + + // Target the iPhone 4 device submodel (640003). + Technology mobileDeviceSubmodelTechnology = new Technology(); + mobileDeviceSubmodelTechnology.id = 640003L; + mobileDeviceSubmodelTargeting.targetedMobileDeviceSubmodels = + new Technology[] {mobileDeviceSubmodelTechnology}; + technologyTargeting.mobileDeviceSubmodelTargeting = mobileDeviceSubmodelTargeting; + + // Create targeting. + Targeting targeting = new Targeting(); + targeting.inventoryTargeting = inventoryTargeting; + targeting.technologyTargeting = technologyTargeting; + + // Create local line item object. + LineItem lineItem = new LineItem(); + lineItem.name = "Mobile line item"; + lineItem.orderId = orderId; + lineItem.targeting = targeting; + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the target platform to mobile. + lineItem.targetPlatform = TargetPlatform.MOBILE; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + creativePlaceholder.size = size; + + // Set the size of creatives that can be associated with this line item. + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromString("20120901 00:00:00"); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + Money money = new Money(); + money.currencyCode = "USD"; + money.microAmount = 2000000L; + lineItem.costPerUnit = money; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + try { + // Create the line item on the server. + lineItem = lineItemService.createLineItem(lineItem); + + if (lineItem != null) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and " + + "named \"{2}\" was created.", lineItem.id, lineItem.orderId, lineItem.name); + } else { + Console.WriteLine("No line item created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LineItemService/CreateVideoLineItem.cs b/examples/Dfp/CSharp/v201302/LineItemService/CreateVideoLineItem.cs new file mode 100644 index 00000000000..d540390c835 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LineItemService/CreateVideoLineItem.cs @@ -0,0 +1,187 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates a new line item to serve to video content. To + /// determine which line items exist, run GetAllLineItems.cs. To determine + /// which orders exist, run GetAllOrders.cs. To create a video ad unit, run + /// CreateVideoAdUnit.cs. To create criteria for categories, run + /// CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: LineItemService.createLineItem + /// + class CreateVideoLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new line item to serve to video content. To determine" + + " which line items exist, run GetAllLineItems.cs. To determine which orders exist, " + + "run GetAllOrders.cs. To create a video ad unit, run CreateVideoAdUnit.cs. To " + + "create criteria for categories, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateVideoLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201302.LineItemService); + + // Set the order that all created line items will belong to and the + // video ad unit ID to target. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + string targetedVideoAdUnitId = _T("INSERT_TARGETED_VIDEO_AD_UNIT_ID_HERE"); + + // Set the custom targeting key ID and value ID representing the metadata + // on the content to target. This would typically be a key representing + // a "genre" and a value representing something like "comedy". + long contentCustomTargetingKeyId = + long.Parse(_T("INSERT_CONTENT_CUSTOM_TARGETING_KEY_ID_HERE")); + long contentCustomTargetingValueId = + long.Parse(_T("INSERT_CONTENT_CUSTOM_TARGETING_VALUE_ID_HERE")); + + // Create custom criteria for the content metadata targeting. + CustomCriteria contentCustomCriteria = new CustomCriteria(); + contentCustomCriteria.keyId = contentCustomTargetingKeyId; + contentCustomCriteria.valueIds = new long[] {contentCustomTargetingValueId}; + contentCustomCriteria.@operator = CustomCriteriaComparisonOperator.IS; + + // Create custom criteria set. + CustomCriteriaSet customCriteriaSet = new CustomCriteriaSet(); + customCriteriaSet.children = new CustomCriteriaNode[] {contentCustomCriteria}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + AdUnitTargeting adUnitTargeting = new AdUnitTargeting(); + adUnitTargeting.adUnitId = targetedVideoAdUnitId; + adUnitTargeting.includeDescendants = true; + inventoryTargeting.targetedAdUnits = new AdUnitTargeting[] {adUnitTargeting}; + + // Create video position targeting. + VideoPosition videoPosition = new VideoPosition(); + videoPosition.positionType = VideoPositionType.PREROLL; + VideoPositionTarget videoPositionTarget = new VideoPositionTarget(); + videoPositionTarget.videoPosition = videoPosition; + VideoPositionTargeting videoPositionTargeting = new VideoPositionTargeting(); + videoPositionTargeting.targetedPositions = new VideoPositionTarget[] {videoPositionTarget}; + + // Create targeting. + Targeting targeting = new Targeting(); + targeting.customTargeting = customCriteriaSet; + targeting.inventoryTargeting = inventoryTargeting; + targeting.videoPositionTargeting = videoPositionTargeting; + + // Create local line item object. + LineItem lineItem = new LineItem(); + lineItem.name = "Video line item - " + this.GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = targeting; + lineItem.lineItemType = LineItemType.SPONSORSHIP; + lineItem.allowOverbook = true; + + // Set the environment type to video. + lineItem.environmentType = EnvironmentType.VIDEO_PLAYER; + + // Set the creative rotation type to optimized. + lineItem.creativeRotationType = CreativeRotationType.OPTIMIZED; + + // Create the master creative placeholder. + CreativePlaceholder creativeMasterPlaceholder = new CreativePlaceholder(); + Size size1 = new Size(); + size1.width = 400; + size1.height = 300; + size1.isAspectRatio = false; + creativeMasterPlaceholder.size = size1; + + // Create companion creative placeholders. + CreativePlaceholder companionCreativePlaceholder1 = new CreativePlaceholder(); + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + size2.isAspectRatio = false; + companionCreativePlaceholder1.size = size2; + + CreativePlaceholder companionCreativePlaceholder2 = new CreativePlaceholder(); + Size size3 = new Size(); + size3.width = 728; + size3.height = 90; + size3.isAspectRatio = false; + companionCreativePlaceholder2.size = size3; + + // Set companion creative placeholders. + creativeMasterPlaceholder.companions = new CreativePlaceholder[] { + companionCreativePlaceholder1, companionCreativePlaceholder2}; + + // Set the size of creatives that can be associated with this line item. + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativeMasterPlaceholder}; + + // Set delivery of video companions to optional. + lineItem.companionDeliveryOption = CompanionDeliveryOption.OPTIONAL; + + // Set the length of the line item to run. + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromString("20120901 00:00:00"); + + // Set the cost per day to $1. + lineItem.costType = CostType.CPD; + Money money = new Money(); + money.currencyCode = "USD"; + money.microAmount = 1000000L; + lineItem.costPerUnit = money; + + // Set the percentage to be 100%. + lineItem.unitsBought = 100; + + try { + // Create the line item on the server. + lineItem = lineItemService.createLineItem(lineItem); + + if (lineItem != null) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and " + + "named \"{2}\" was created.", lineItem.id, lineItem.orderId, lineItem.name); + } else { + Console.WriteLine("No line item created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LineItemService/GetAllLineItems.cs b/examples/Dfp/CSharp/v201302/LineItemService/GetAllLineItems.cs new file mode 100644 index 00000000000..0ea4c25e4f6 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LineItemService/GetAllLineItems.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all line items. To create line items, run + /// CreateLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// + class GetAllLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items. To create line items, run " + + "CreateLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201302.LineItemService); + + // Sets defaults for page and Statement. + LineItemPage page = new LineItemPage(); + Statement statement = new Statement(); + int offset = 0; + try { + do { + // Create a Statement to get all line items. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get line items by Statement. + page = lineItemService.getLineItemsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemSummary lineItem in page.results) { + Console.WriteLine("{0}) Line item with ID = '{1}', belonging to order ID ='{2}'" + + " , and named '{3}' was found.", i, lineItem.id, lineItem.orderId, + lineItem.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LineItemService/GetLineItem.cs b/examples/Dfp/CSharp/v201302/LineItemService/GetLineItem.cs new file mode 100644 index 00000000000..354dc4edd34 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LineItemService/GetLineItem.cs @@ -0,0 +1,78 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets a line item by its ID. To determine which line + /// items exist, run GetAllLineItems.cs. + /// + /// Tags: LineItemService.getLineItem + /// + class GetLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a line item by its ID. To determine which line items " + + "exist, run GetAllLineItems.cs"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201302.LineItemService); + + // Set the ID of the line item to get. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get the line item. + LineItem lineItem = lineItemService.getLineItem(lineItemId); + + if (lineItem != null) { + Console.WriteLine("Line item with ID ='{0}', belonging to order ID ='{1}', and named " + + "'{2}' was found.", lineItem.id, lineItem.orderId, lineItem.name); + } else { + Console.WriteLine("No line item found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get line item by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LineItemService/GetLineItemsByStatement.cs b/examples/Dfp/CSharp/v201302/LineItemService/GetLineItemsByStatement.cs new file mode 100644 index 00000000000..5080e2abfa8 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LineItemService/GetLineItemsByStatement.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all line items for the given order. The Statement + /// retrieves up to the maximum page size limit of 500. To create line items, + /// run CreateLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// + class GetLineItemsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items for the given order. The Statement " + + "retrieves up to the maximum page size limit of 500. To create line items, " + + "run CreateLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLineItemsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201302.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create a statement to only select line items that need creatives from a + // given order. + Statement filterStatement = + new StatementBuilder("WHERE orderId = :orderId AND status = :status LIMIT 500") + .AddValue("orderId", orderId) + .AddValue("status", ComputedStatus.NEEDS_CREATIVES.ToString()) + .ToStatement(); + + try { + // Get line items by Statement. + LineItemPage page = lineItemService.getLineItemsByStatement(filterStatement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItem lineItem in page.results) { + Console.WriteLine("{0}) Line item with ID ='{1}', belonging to order ID = '{2}' and " + + "named '{3}' was found.", i, lineItem.id, lineItem.orderId, lineItem.name); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get line item by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LineItemService/GetRecentlyUpdatedLineItems.cs b/examples/Dfp/CSharp/v201302/LineItemService/GetRecentlyUpdatedLineItems.cs new file mode 100644 index 00000000000..3234f3cacac --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LineItemService/GetRecentlyUpdatedLineItems.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; +using Google.Api.Ads.Dfp.Util.v201302; + +using System; + +using DateTime = Google.Api.Ads.Dfp.v201302.DateTime; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example shows how to get recently updated line items. To create + /// line items, run CreateLineItems.cs. + /// + /// Tags: LineItemService.GetRecentlyUpdatedLineItems + /// + class GetRecentlyUpdatedLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a line item by its ID. To determine which line items " + + "exist, run GetAllLineItems.cs"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetRecentlyUpdatedLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201302.LineItemService); + + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + try { + // Create statement to only select line items for the given order that + // have been modified in the last 3 days. + DateTime threeDaysAgo = DateTimeUtilities.FromDateTime(System.DateTime.Now.AddDays(-3)); + Statement filterStatement = new StatementBuilder( + "WHERE lastModifiedDateTime >= :lastModifiedDateTime AND orderId = :orderId LIMIT 500"). + AddValue("lastModifiedDateTime", threeDaysAgo). + AddValue("orderId", orderId).ToStatement(); + + + // Get line items by statement. + LineItemPage page = lineItemService.getLineItemsByStatement(filterStatement); + + // Display results. + if (page != null && page.results != null) { + foreach (LineItem lineItem in page.results) { + Console.WriteLine("Line item with id \"{0}\", belonging to order id \"{1}\" and " + + "named \"{2}\" was found.", lineItem.id, lineItem.orderId, lineItem.name); + } + Console.WriteLine("Number of results found: {1}.", page.totalResultSetSize); + } else { + Console.WriteLine("No line items were found."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LineItemService/TargetCustomCriteria.cs b/examples/Dfp/CSharp/v201302/LineItemService/TargetCustomCriteria.cs new file mode 100644 index 00000000000..e6b3e9230c0 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LineItemService/TargetCustomCriteria.cs @@ -0,0 +1,167 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example updates a line item to add custom criteria targeting. To + /// determine which line items exist, run GetAllLineItems.cs. To determine + /// which custom targeting keys and values exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: LineItemService.getLineItem, LineItemService.updateLineItem + /// + class TargetCustomCriteria : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a line item to add custom criteria targeting. To " + + "determine which line items exist, run GetAllLineItems.cs. To determine which custom " + + "targeting keys and values exist, run GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new TargetCustomCriteria(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201302.LineItemService); + + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = (CustomTargetingService) user.GetService( + DfpService.v201302.CustomTargetingService); + + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long[] customCriteriaIds1 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + long[] customCriteriaIds2 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + long[] customCriteriaIds3 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + + // Create custom criteria. + CustomCriteria customCriteria1 = new CustomCriteria(); + customCriteria1.keyId = customCriteriaIds1[0]; + customCriteria1.valueIds = new long[] {customCriteriaIds1[1]}; + customCriteria1.@operator = CustomCriteriaComparisonOperator.IS; + + CustomCriteria customCriteria2 = new CustomCriteria(); + customCriteria2.keyId = customCriteriaIds2[0]; + customCriteria2.valueIds = new long[] {customCriteriaIds2[1]}; + customCriteria2.@operator = CustomCriteriaComparisonOperator.IS_NOT; + + CustomCriteria customCriteria3 = new CustomCriteria(); + customCriteria3.keyId = customCriteriaIds3[0]; + customCriteria3.valueIds = new long[] {customCriteriaIds3[1]}; + customCriteria3.@operator = CustomCriteriaComparisonOperator.IS; + + // Create the custom criteria set that will resemble: + // + // (customCriteria1.key == customCriteria1.value OR + // (customCriteria2.key != customCriteria2.value AND + // customCriteria3.key == customCriteria3.value)) + CustomCriteriaSet topCustomCriteriaSet = new CustomCriteriaSet(); + topCustomCriteriaSet.logicalOperator = CustomCriteriaSetLogicalOperator.OR; + + CustomCriteriaSet subCustomCriteriaSet = new CustomCriteriaSet(); + subCustomCriteriaSet.logicalOperator = CustomCriteriaSetLogicalOperator.AND; + subCustomCriteriaSet.children = + new CustomCriteriaNode[] {customCriteria2, customCriteria3}; + topCustomCriteriaSet.children = + new CustomCriteriaNode[] {customCriteria1, subCustomCriteriaSet}; + + try { + // Set the custom criteria targeting on the line item. + LineItem lineItem = lineItemService.getLineItem(lineItemId); + lineItem.targeting.customTargeting = topCustomCriteriaSet; + + // Update the line items on the server. + lineItem = lineItemService.updateLineItem(lineItem); + + // Display the updated line item. + Console.WriteLine("Line item with ID {0} updated with custom criteria targeting \n{1}\n", + lineItem.id, getCustomCriteriaSetString(lineItem.targeting.customTargeting, 0)); + } catch (Exception ex) { + Console.WriteLine("Failed to add custom target criteria. Exception says \"{0}\"", + ex.Message); + } + } + + /// + /// Gets a string representation of the custom criteria node. If it has + /// children, each child will be appended to the string recursively. + /// + /// The root custom criteria node. + /// The level of the custom criteria tree. + /// + /// A string representation of the custom criteria node and its + /// children + /// + private static string getCustomCriteriaSetString(CustomCriteriaNode root, int level) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < level; i++) { + sb.Append("\t"); + } + + if (root is CustomCriteria) { + CustomCriteria customCriteria = (CustomCriteria) root; + StringBuilder ids = new StringBuilder(); + for (int j = 0; j < customCriteria.valueIds.Length; j++) { + ids.Append(customCriteria.valueIds[j] + ", "); + } + + sb.AppendFormat("Custom criteria: operator: [{0}] key: [{1}] values: [{2}]\n", + customCriteria.@operator, customCriteria.keyId, ids.ToString().TrimEnd(',', ' ')); + return sb.ToString(); + } else if (root is CustomCriteriaSet) { + CustomCriteriaSet customCriteriaSet = (CustomCriteriaSet) root; + sb.AppendFormat("Custom criteria set: operator: [{0}] children: \n", + customCriteriaSet.logicalOperator); + foreach (CustomCriteriaNode node in customCriteriaSet.children) { + sb.Append(getCustomCriteriaSetString(node, level + 1)); + } + return sb.Append("\n").ToString(); + } else { + throw new Exception("Unexpected node: " + root.CustomCriteriaNodeType); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/LineItemService/UpdateLineItems.cs b/examples/Dfp/CSharp/v201302/LineItemService/UpdateLineItems.cs new file mode 100644 index 00000000000..0056e19e735 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/LineItemService/UpdateLineItems.cs @@ -0,0 +1,108 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example updates the delivery rate of all line items up to the + /// first 500. To determine which line items exist, run GetAllLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.updateLineItems + /// + class UpdateLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the delivery rate of all line items up to the first " + + "500. To determine which line items exist, run GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201302.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create a Statement to get line items with even delivery rates. + Statement statement = new StatementBuilder("WHERE deliveryRateType = :deliveryRateType and " + + "orderId = :orderId LIMIT 500").AddValue("deliveryRateType", + DeliveryRateType.EVENLY.ToString()).AddValue("orderId", orderId).ToStatement(); + + try { + // Get line items by Statement. + LineItemPage page = lineItemService.getLineItemsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + LineItem[] lineItems = page.results; + List lineItemsToUpdate = new List(); + + // Update each local line item object by changing its delivery rate. + foreach (LineItem lineItem in lineItems) { + // Archived line items cannot be updated. + if (!lineItem.isArchived) { + lineItem.deliveryRateType = DeliveryRateType.AS_FAST_AS_POSSIBLE; + lineItemsToUpdate.Add(lineItem); + } + } + + // Update the line items on the server. + lineItems = lineItemService.updateLineItems(lineItemsToUpdate.ToArray()); + + if (lineItems != null) { + foreach (LineItem lineItem in lineItems) { + Console.WriteLine("A line item with ID = '{0}', belonging to order ID = '{1}', " + + "named '{2}', and having delivery rate = '{3}' was updated.", + lineItem.id, lineItem.orderId, lineItem.name, lineItem.deliveryRateType); + } + } else { + Console.WriteLine("No line items updated."); + } + } else { + Console.WriteLine("No line items found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/NetworkService/GetAllNetworks.cs b/examples/Dfp/CSharp/v201302/NetworkService/GetAllNetworks.cs new file mode 100644 index 00000000000..c90b1ca7145 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/NetworkService/GetAllNetworks.cs @@ -0,0 +1,81 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all networks that you have access to with the + /// current login credentials. A networkCode should be left out for this + /// request. + /// + /// Tags: NetworkService.getAllNetworks + /// + class GetAllNetworks : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all networks that you have access to with the current " + + "login credentials. A networkCode should be left out for this request."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllNetworks(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201302.NetworkService); + // Set the networkCode field to null to retrieve all networks you have + // access to. + networkService.RequestHeader.networkCode = null; + + try { + // Get all networks that you have access to with the current login + // credentials. + Network[] networks = networkService.getAllNetworks(); + + int i = 0; + foreach (Network network in networks) { + Console.WriteLine("{0} ) Network with network code \"{1}\" and display name \"{2}\" " + + "was found.", i + 1, network.networkCode, network.displayName); + i++; + } + Console.WriteLine("Number of networks found: {0}", i); + } catch (Exception ex) { + Console.WriteLine("Failed to get all networks. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/NetworkService/GetCurrentNetwork.cs b/examples/Dfp/CSharp/v201302/NetworkService/GetCurrentNetwork.cs new file mode 100644 index 00000000000..dbc2fb87da5 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/NetworkService/GetCurrentNetwork.cs @@ -0,0 +1,70 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets the current network that you can make requests + /// against. + /// + /// Tags: NetworkService.getCurrentNetwork + /// + class GetCurrentNetwork : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the current network that you can make requests against."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCurrentNetwork(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201302.NetworkService); + + try { + // Get the current network. + Network network = networkService.getCurrentNetwork(); + + Console.WriteLine("Current network has network code \"{0}\" and display name \"{1}\".", + network.networkCode, network.displayName); + } catch (Exception ex) { + Console.WriteLine("Failed to get current network. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/NetworkService/MakeTestNetwork.cs b/examples/Dfp/CSharp/v201302/NetworkService/MakeTestNetwork.cs new file mode 100644 index 00000000000..bdc6c557ba5 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/NetworkService/MakeTestNetwork.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates a test network. You do not need to have a DFP + /// account to run this example, but you do need to have a new Google account + /// (created at http://www.google.com/accounts/newaccount) that is not + /// associated with any other DFP networks (including old sandbox networks). + /// Once this network is created, you can supply the network code in your + /// settings to make calls to other services. + /// + /// Please see the following URL for more information: + /// https://developers.google.com/doubleclick-publishers/docs/signup + /// + /// Tags: NetworkService.makeTestNetwork + /// + class MakeTestNetwork : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a test network. You do not need to have a DFP" + + " account to run this example, but you do need to have a new Google account" + + " (created at http://www.google.com/accounts/newaccount) that is not associated " + + "with any other DFP networks (including old sandbox networks). Once this network " + + "is created, you can supply the network code in your settings to make calls to " + + "other services.\n\n Please see the following URL for more information:" + + " https://developers.google.com/doubleclick-publishers/docs/signup"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new MakeTestNetwork(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201302.NetworkService); + // Set the networkCode field to null. + networkService.RequestHeader.networkCode = null; + + try { + Network network = networkService.makeTestNetwork(); + + Console.WriteLine("Test network with network code \"{0}\" and display name \"{1}\" " + + "created.\nYou may now sign in at http://www.google.com/dfp/main?networkCode={0}", + network.networkCode, network.displayName); + } catch (Exception ex) { + Console.WriteLine("Failed to make test network. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/OrderService/ApproveOrder.cs b/examples/Dfp/CSharp/v201302/OrderService/ApproveOrder.cs new file mode 100644 index 00000000000..edfebd738d7 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/OrderService/ApproveOrder.cs @@ -0,0 +1,121 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example approves and overbooks all eligible draft and pending + /// orders. To determine which orders exist, run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement, OrderService.performOrderAction + /// + class ApproveOrder : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example approves and overbooks all draft orders. To determine which " + + "orders exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ApproveOrder(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = + (OrderService) user.GetService(DfpService.v201302.OrderService); + + // Create Statement text to select all draft orders. + string statementText = "WHERE status IN (:status1, :status2) and endDateTime >= :today " + + "AND isArchived = FALSE LIMIT 500"; + Statement statement = new StatementBuilder(""). + AddValue("status1", OrderStatus.DRAFT.ToString()). + AddValue("status2", OrderStatus.PENDING_APPROVAL.ToString()). + AddValue("today", System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss")).ToStatement(); + + // Set defaults for page and offset. + OrderPage page = new OrderPage(); + int i = 0; + int offset = 0; + List orderIds = new List(); + + try { + do { + // Create a Statement to page through draft orders. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + // Get orders by Statement. + page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and status ='{3}' " + + "will be approved.", i, order.id, order.name, order.status); + orderIds.Add(order.id.ToString()); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of orders to be approved: {0}", orderIds.Count); + + if (orderIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", orderIds.ToArray()))). + ToStatement(); + + // Create action. + ApproveAndOverbookOrders action = new ApproveAndOverbookOrders(); + + // Perform action. + UpdateResult result = orderService.performOrderAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of orders approved: {0}", result.numChanges); + } else { + Console.WriteLine("No orders were approved."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to approve orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/OrderService/CreateOrders.cs b/examples/Dfp/CSharp/v201302/OrderService/CreateOrders.cs new file mode 100644 index 00000000000..5902b6983b0 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/OrderService/CreateOrders.cs @@ -0,0 +1,96 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates new orders. To determine which orders exist, + /// run GetAllOrders.cs. + /// + /// Tags: OrderService.createOrders + /// + class CreateOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new orders. To determine which orders exist, " + + "run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = + (OrderService) user.GetService(DfpService.v201302.OrderService); + + // Set the advertiser, salesperson, and trafficker to assign to each + // order. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + long salespersonId = long.Parse(_T("INSERT_SALESPERSON_ID_HERE")); + long traffickerId = long.Parse(_T("INSERT_TRAFFICKER_ID_HERE")); + + // Create an array to store local order objects. + Order[] orders = new Order[5]; + + for (int i = 0; i < 5; i++) { + Order order = new Order(); + order.name = string.Format("Order #{0}", i); + order.advertiserId = advertiserId; + order.salespersonId = salespersonId; + order.traffickerId = traffickerId; + + orders[i] = order; + } + + try { + // Create the orders on the server. + orders = orderService.createOrders(orders); + + if (orders != null) { + foreach (Order order in orders) { + Console.WriteLine("An order with ID ='{0}' and named '{1}' was created.", + order.id, order.name); + } + } else { + Console.WriteLine("No orders created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/OrderService/GetAllOrders.cs b/examples/Dfp/CSharp/v201302/OrderService/GetAllOrders.cs new file mode 100644 index 00000000000..98ddf28bd58 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/OrderService/GetAllOrders.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all orders. To create orders, run CreateOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement + /// + class GetAllOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets all orders. To create orders, run CreateOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201302.OrderService); + + // Sets defaults for page and Statement. + OrderPage page = new OrderPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all orders. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get orders by Statement. + page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and advertiser " + + "ID = '{3}' was found.", i, order.id, order.name, order.advertiserId); + i++; + } + } + + offset += 500; + } while (page.results != null && page.results.Length == 500); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/OrderService/GetOrder.cs b/examples/Dfp/CSharp/v201302/OrderService/GetOrder.cs new file mode 100644 index 00000000000..2c719c74575 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/OrderService/GetOrder.cs @@ -0,0 +1,75 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets an order by its ID. To determine which orders + /// exist, run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrder + /// + class GetOrder : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets an order by its ID. To determine which orders " + + "exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + new GetOrder().Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201302.OrderService); + + // Set the ID of the order to get. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + try { + // Get the order. + Order order = orderService.getOrder(orderId); + + if (order != null) { + Console.WriteLine("An order with ID = {0}', name = '{1}', and advertiser ID = '{2}' " + + " was found.", order.id, order.name, order.advertiserId); + } else { + Console.WriteLine("No order found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get orders by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/OrderService/GetOrdersByStatement.cs b/examples/Dfp/CSharp/v201302/OrderService/GetOrdersByStatement.cs new file mode 100644 index 00000000000..0805b167dd3 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/OrderService/GetOrdersByStatement.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all orders for a given advertiser. The Statement + /// retrieves up to the maximum page size limit of 500. To create orders, run + /// CreateOrders.cs. To determine which companies are advertisers, + /// run GetCompaniesByStatement.cs. + /// + /// Tags: OrderService.getOrdersByStatement + /// + class GetOrdersByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all orders for a given advertiser. The Statement " + + "retrieves up to the maximum page size limit of 500. To create orders, run " + + "CreateOrders.cs. To determine which companies are advertisers,run " + + "GetCompaniesByStatement.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetOrdersByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201302.OrderService); + + // Set the name of the advertiser (company) to get orders for. + String advertiserId = _T("INSERT_ADVERTISER_COMPANY_ID_HERE"); + + // Create a Statement to only select orders for a given advertiser. + Statement statement = new StatementBuilder("WHERE advertiserId = :advertiserId LIMIT 500"). + AddValue("advertiserId", advertiserId).ToStatement(); + + try { + // Get orders by Statement. + OrderPage page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and advertiser " + + "ID = '{3}' was found.", i, order.id, order.name, order.advertiserId); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get orders by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/OrderService/UpdateOrders.cs b/examples/Dfp/CSharp/v201302/OrderService/UpdateOrders.cs new file mode 100644 index 00000000000..ba6a698ab81 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/OrderService/UpdateOrders.cs @@ -0,0 +1,100 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example updates the notes of each order up to the first 500. + /// To determine which orders exist, run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement, OrderService.updateOrders + /// + class UpdateOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the notes of each order up to the first 500. " + + "To determine which orders exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201302.OrderService); + + // Create a Statement to get all orders. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get orders by Statement. + OrderPage page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + Order[] orders = page.results; + List ordersToUpdate = new List(); + + // Update each local order object by changing its notes. + foreach (Order order in orders) { + if (!order.isArchived) { + order.notes = "Spoke to advertiser. All is well."; + ordersToUpdate.Add(order); + } + } + + // Update the orders on the server. + orders = orderService.updateOrders(ordersToUpdate.ToArray()); + + if (orders != null) { + foreach (Order order in orders) { + Console.WriteLine("Order with ID = '{0}', name = '{1}', advertiser ID = '{2}', " + + "and notes = '{3}' was updated.", order.id, order.name, order.advertiserId, + order.notes); + } + } else { + Console.WriteLine("No orders updated."); + } + } else { + Console.WriteLine("No orders found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/PlacementService/CreatePlacements.cs b/examples/Dfp/CSharp/v201302/PlacementService/CreatePlacements.cs new file mode 100644 index 00000000000..c5be6e4bde8 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/PlacementService/CreatePlacements.cs @@ -0,0 +1,164 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates new placements for various ad unit sizes. To + /// determine which placements exist, run GetAllPlacements.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: PlacementService.createPlacements + /// + class CreatePlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new placements for various ad unit sizes. To determine " + + "which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreatePlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201302.InventoryService); + + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201302.PlacementService); + + // Create local placement object to store skyscraper ad units. + Placement skyscraperAdUnitPlacement = new Placement(); + skyscraperAdUnitPlacement.name = string.Format("Skyscraper AdUnit Placement #{0}", + this.GetTimeStamp()); + skyscraperAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 120x600"; + + // Create local placement object to store medium square ad units. + Placement mediumSquareAdUnitPlacement = new Placement(); + mediumSquareAdUnitPlacement.name = string.Format("Medium Square AdUnit Placement #{0}", + this.GetTimeStamp()); + mediumSquareAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 300x250"; + + // Create local placement object to store banner ad units. + Placement bannerAdUnitPlacement = new Placement(); + bannerAdUnitPlacement.name = string.Format("Banner AdUnit Placement #{0}", + this.GetTimeStamp()); + bannerAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 468x60"; + + List placementList = new List(); + + // Get the first 500 ad units. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + List mediumSquareTargetedUnitIds = new List(); + List skyscraperTargetedUnitIds = new List(); + List bannerTargetedUnitIds = new List(); + + try { + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + // Separate the ad units by size. + if (page.results != null) { + foreach (AdUnit adUnit in page.results) { + if (adUnit.parentId != null && adUnit.adUnitSizes != null) { + foreach (AdUnitSize adUnitSize in adUnit.adUnitSizes) { + Size size = adUnitSize.size; + if (size.width == 300 && size.height == 250) { + if (!mediumSquareTargetedUnitIds.Contains(adUnit.id)) { + mediumSquareTargetedUnitIds.Add(adUnit.id); + } + } else if (size.width == 120 && size.height == 600) { + if (!skyscraperTargetedUnitIds.Contains(adUnit.id)) { + skyscraperTargetedUnitIds.Add(adUnit.id); + } + } else if (size.width == 468 && size.height == 60) { + if (!bannerTargetedUnitIds.Contains(adUnit.id)) { + bannerTargetedUnitIds.Add(adUnit.id); + } + } + } + } + } + } + mediumSquareAdUnitPlacement.targetedAdUnitIds = mediumSquareTargetedUnitIds.ToArray(); + skyscraperAdUnitPlacement.targetedAdUnitIds = skyscraperTargetedUnitIds.ToArray(); + bannerAdUnitPlacement.targetedAdUnitIds = bannerTargetedUnitIds.ToArray(); + + + // Only create placements with one or more ad unit. + if (mediumSquareAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(mediumSquareAdUnitPlacement); + } + + if (skyscraperAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(skyscraperAdUnitPlacement); + } + + if (bannerAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(bannerAdUnitPlacement); + } + + Placement[] placements = + placementService.createPlacements(placementList.ToArray()); + + // Display results. + if (placements != null) { + foreach (Placement placement in placements) { + Console.Write("A placement with ID = '{0}', name ='{1}', and containing " + + "ad units {{", placement.id, placement.name); + + foreach (string adUnitId in placement.targetedAdUnitIds) { + Console.Write("{0}, ", adUnitId); + } + Console.WriteLine("} was created."); + } + } else { + Console.WriteLine("No placements created."); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to create placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/PlacementService/DeactivatePlacement.cs b/examples/Dfp/CSharp/v201302/PlacementService/DeactivatePlacement.cs new file mode 100644 index 00000000000..57d97f67801 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/PlacementService/DeactivatePlacement.cs @@ -0,0 +1,120 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example deactivates all active placements. To determine which + /// placements exist, run GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// Tags: PlacementService.performPlacementAction + /// + class DeactivatePlacement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active placements. To determine which " + + "placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivatePlacement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201302.PlacementService); + + // Create Statement text to select active placements. + String statementText = "WHERE status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("status", + InventoryStatus.ACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + PlacementPage page = new PlacementPage(); + int offset = 0; + List placementIds = new List(); + + try { + do { + // Create a Statement to page through active placements. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get placements by Statement. + page = placementService.getPlacementsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID ='{1}', name ='{2}', and status ='{3}'" + + " will be deactivated.", i, placement.id, placement.name, placement.status); + placementIds.Add(placement.id.ToString()); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of placements to be deactivated: {0}", placementIds.Count); + + if (placementIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", placementIds.ToArray()))). + ToStatement(); + + // Create action. + DeactivatePlacements action = new DeactivatePlacements(); + + // Perform action. + UpdateResult result = placementService.performPlacementAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of placements deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No placements were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/PlacementService/GetAllPlacements.cs b/examples/Dfp/CSharp/v201302/PlacementService/GetAllPlacements.cs new file mode 100644 index 00000000000..6932dbe342c --- /dev/null +++ b/examples/Dfp/CSharp/v201302/PlacementService/GetAllPlacements.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all placements. To create placements, run + /// CreatePlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// + class GetAllPlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all placements. To create placements, run " + + "CreatePlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllPlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201302.PlacementService); + + // Sets defaults for page and Statement. + PlacementPage page = new PlacementPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all ad units. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get ad units by Statement. + page = placementService.getPlacementsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID = '{1}' and name = '{2}' was found.", + i, placement.id, placement.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}" + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/PlacementService/GetPlacement.cs b/examples/Dfp/CSharp/v201302/PlacementService/GetPlacement.cs new file mode 100644 index 00000000000..ebb5d7db962 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/PlacementService/GetPlacement.cs @@ -0,0 +1,79 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets a placement by its ID. To determine which + /// placements exist, run GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacement + /// + class GetPlacement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a placement by its ID. To determine which placements " + + "exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPlacement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201302.PlacementService); + + // Set the ID of the placement to get. + long placementId = long.Parse(_T("INSERT_PLACEMENT_ID_HERE")); + + try { + // Get the placement. + Placement placement = placementService.getPlacement(placementId); + + if (placement != null) { + Console.WriteLine("Placement with ID = '{0}', name = '{1}', and status = '{2}' " + + "was found.", placement.id, placement.name, placement.status); + } else { + Console.WriteLine("No placement found for this ID."); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to get placement by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/PlacementService/GetPlacementsByStatement.cs b/examples/Dfp/CSharp/v201302/PlacementService/GetPlacementsByStatement.cs new file mode 100644 index 00000000000..0f72fcb6122 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/PlacementService/GetPlacementsByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all active placements by using a Statement. To + /// create a placement, run CreatePlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// + class GetPlacementsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active placements by using a Statement. To create a " + + "placement, run CreatePlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPlacementsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201302.PlacementService); + + // Create a Statement to only select active placements. + Statement statement = new StatementBuilder("WHERE status = :status LIMIT 500").AddValue( + "status", InventoryStatus.ACTIVE.ToString()).ToStatement(); + + try { + // Get placements by Statement. + PlacementPage page = placementService.getPlacementsByStatement(statement); + + // Display results. + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID = '{1}', name ='{2}', and status = '{3}' " + + "was found.", i, placement.id, placement.name, placement.status); + i++; + } + } + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get placement by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/PlacementService/UpdatePlacements.cs b/examples/Dfp/CSharp/v201302/PlacementService/UpdatePlacements.cs new file mode 100644 index 00000000000..b24a42f5ec5 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/PlacementService/UpdatePlacements.cs @@ -0,0 +1,105 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example updates all placements to allow for AdSense targeting + /// up to the first 500. To determine which placements exist, run + /// GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// Tags: PlacementService.updatePlacements + /// + class UpdatePlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates all placements to allow for AdSense targeting up to " + + "the first 500. To determine which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdatePlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201302.PlacementService); + + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201302.InventoryService); + + // Create a statement to select first 500 placements. + Statement filterStatement = new Statement(); + filterStatement.query = "LIMIT 500"; + + try { + // Get placements by statement. + PlacementPage page = placementService.getPlacementsByStatement(filterStatement); + + if (page.results != null) { + Placement[] placements = page.results; + + // Update each local placement object by enabling AdSense targeting. + foreach (Placement placement in placements) { + placement.targetingDescription = (string.IsNullOrEmpty(placement.description))? + "Generic description" : placement.description; + placement.targetingAdLocation = "All images on sports pages."; + placement.targetingSiteName = "http://code.google.com"; + placement.isAdSenseTargetingEnabled = true; + } + + // Update the placements on the server. + placements = placementService.updatePlacements(placements); + + // Display results. + if (placements != null) { + foreach (Placement placement in placements) { + Console.WriteLine("A placement with ID \"{0}\", name \"{1}\", and AdSense targeting" + + " enabled \"{2}\" was updated.", placement.id, placement.name, + placement.isAdSenseTargetingEnabled); + } + } else { + Console.WriteLine("No placements updated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to update placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/PublisherQueryLanguageService/GetAllCities.cs b/examples/Dfp/CSharp/v201302/PublisherQueryLanguageService/GetAllCities.cs new file mode 100644 index 00000000000..0349ee16f5e --- /dev/null +++ b/examples/Dfp/CSharp/v201302/PublisherQueryLanguageService/GetAllCities.cs @@ -0,0 +1,111 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all cities available to target. A full list of + /// available tables can be found at + /// http://code.google.com/apis/dfp/docs/reference/v201302/PublisherQueryLanguageService.html. + /// + /// Tags: PublisherQueryLanguageService.select + /// + class GetAllCities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all cities available to target. A full list of available " + + "tables can be found at " + + "http://code.google.com/apis/dfp/docs/reference/v201302/" + + "PublisherQueryLanguageService.html."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + PublisherQueryLanguageService pqlService = + (PublisherQueryLanguageService) user.GetService( + DfpService.v201302.PublisherQueryLanguageService); + + int pageSize = 500; + // Create statement to select all targetable cities. + String selectStatement = "SELECT * FROM City WHERE targetable = true LIMIT " + pageSize; + int offset = 0; + int resultSetSize = 0; + List allRows = new List(); + ResultSet resultSet; + + try { + do { + // For criteria that do not have a "targetable" property, that predicate + // may be left off, i.e. just "SELECT * FROM Browser_Groups LIMIT 500" + StatementBuilder statementBuilder = + new StatementBuilder(selectStatement + " OFFSET " + offset); + + // Get all cities. + resultSet = pqlService.select(statementBuilder.ToStatement()); + + // Collect all cities from each page. + allRows.AddRange(resultSet.rows); + + // Display results. + Console.WriteLine(PqlUtilities.ResultSetToString(resultSet)); + + offset += pageSize; + resultSetSize = resultSet.rows == null ? 0 : resultSet.rows.Length; + } while (resultSetSize == pageSize); + + Console.WriteLine("Number of results found: " + allRows.Count); + + // Optionally, save all rows to a CSV. + // Get a string array representation of the data rows. + resultSet.rows = allRows.ToArray(); + List rows = PqlUtilities.ResultSetToStringArrayList(resultSet); + + // Write the contents to a csv file. + CsvFile file = new CsvFile(); + file.Headers.AddRange(rows[0]); + file.Records.AddRange(rows.GetRange(1, rows.Count - 1).ToArray()); + file.Write("cities.csv"); + } catch (Exception ex) { + Console.WriteLine("Failed to get all cities. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ReportService/DisplayReport.cs b/examples/Dfp/CSharp/v201302/ReportService/DisplayReport.cs new file mode 100644 index 00000000000..bc626e0a7cd --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ReportService/DisplayReport.cs @@ -0,0 +1,87 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example downloads a completed report and prints out its + /// contents. To download a completed report to a file, run DownloadReport.cs. + /// To run a report, run RunDeliveryReport.cs. + /// + /// Tags: ReportService.getReportDownloadUrlWithOptions + /// + class DisplayReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example downloads a completed report and prints out its contents. " + + "To download a completed report to a file, run DownloadReport.cs. To run a report, " + + "run RunDeliveryReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DisplayReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201302.ReportService); + + // Set the id of the completed report. + long reportJobId = long.Parse(_T("INSERT_REPORT_JOB_ID_HERE")); + ExportFormat exportFormat = (ExportFormat) Enum.Parse(typeof(ExportFormat), + _T("INSERT_EXPORT_FORMAT_HERE")); + + // Set the format of the report (e.g., CSV_DUMP) and download without + // compression so we can print it. + ReportDownloadOptions reportDownloadOptions = new ReportDownloadOptions(); + reportDownloadOptions.exportFormat = exportFormat; + reportDownloadOptions.useGzipCompression = false; + + try { + // Download report data. + string downloadUrl = reportService.getReportDownloadUrlWithOptions(reportJobId, + reportDownloadOptions); + byte[] rawReport = MediaUtilities.GetAssetDataFromUrl(downloadUrl); + string reportContents = Encoding.UTF8.GetString(rawReport); + + // Display results. + Console.WriteLine("Data for report job with id '{0}\':\n{1}", reportJobId, reportContents); + } catch (Exception ex) { + Console.WriteLine("Failed to download report. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ReportService/DownloadReport.cs b/examples/Dfp/CSharp/v201302/ReportService/DownloadReport.cs new file mode 100644 index 00000000000..c72f22ec51b --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ReportService/DownloadReport.cs @@ -0,0 +1,83 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Text; +using System.IO; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example downloads a completed report. To run a report, run + /// RunDeliveryReport.cs. + /// + /// Tags: ReportService.getReportDownloadURL + /// + class DownloadReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example downloads a completed report. To run a report, run " + + "RunDeliveryReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DownloadReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201302.ReportService); + + // Set the id of the completed report. + long reportJobId = long.Parse(_T("INSERT_REPORT_JOB_ID_HERE")); + String fileName = _T("INSERT_FILE_PATH_HERE"); + + try { + // Download report data. + string url = reportService.getReportDownloadURL(reportJobId, ExportFormat.CSV_EXCEL); + byte[] gzipReport = MediaUtilities.GetAssetDataFromUrl(url); + string reportContents = Encoding.UTF8.GetString(MediaUtilities.DeflateGZipData(gzipReport)); + + using (StreamWriter writer = new StreamWriter(fileName)) { + writer.Write(reportContents); + } + + // Display results. + Console.WriteLine("Report job with id '{0}' was downloaded to '{1}'.", reportJobId, + fileName); + } catch (Exception ex) { + Console.WriteLine("Failed to download report. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ReportService/RunDeliveryReport.cs b/examples/Dfp/CSharp/v201302/ReportService/RunDeliveryReport.cs new file mode 100644 index 00000000000..237b043750a --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ReportService/RunDeliveryReport.cs @@ -0,0 +1,104 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Threading; +using Google.Api.Ads.Dfp.Util.v201302; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example runs a report similar to the "Orders report" on the DFP + /// website with additional attributes and can filter to include just one + /// order. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunDeliveryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report similar to the \"Orders report\" on the DFP " + + "website with additional attributes and can filter to include just one order. To " + + "download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunDeliveryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201302.ReportService); + + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create statement object to filter for an order. + Statement filterStatement = new StatementBuilder("WHERE ORDER_ID = :id").AddValue( + "id", orderId).ToStatement(); + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportJob.reportQuery.dimensionAttributes = new DimensionAttribute[] { + DimensionAttribute.ORDER_TRAFFICKER, DimensionAttribute.ORDER_START_DATE_TIME, + DimensionAttribute.ORDER_END_DATE_TIME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportJob.reportQuery.statement = filterStatement; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ReportService/RunInventoryReport.cs b/examples/Dfp/CSharp/v201302/ReportService/RunInventoryReport.cs new file mode 100644 index 00000000000..afcc6dffc1b --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ReportService/RunInventoryReport.cs @@ -0,0 +1,97 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example runs a report equal to the "Whole network report" on the + /// DFP website. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunInventoryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Whole network report\" on the " + + "DFP website. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunInventoryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201302.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.DATE}; + reportJob.reportQuery.columns = new Column[] { + Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, + Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + Column.TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + Column.TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE + }; + reportJob.reportQuery.adUnitView = ReportQueryAdUnitView.HIERARCHICAL; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_WEEK; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run inventory report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ReportService/RunMergedDeliveryReport.cs b/examples/Dfp/CSharp/v201302/ReportService/RunMergedDeliveryReport.cs new file mode 100644 index 00000000000..078122c5a3e --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ReportService/RunMergedDeliveryReport.cs @@ -0,0 +1,96 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example runs a report that an upgraded publisher would use to + /// include statistics before the upgrade. To download the report see + /// DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunMergedDeliveryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Orders report\" on the DFP " + + "website with additional attributes. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunMergedDeliveryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201302.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportQuery.columns = new Column[] {Column.MERGED_AD_SERVER_IMPRESSIONS, + Column.MERGED_AD_SERVER_CLICKS, Column.MERGED_AD_SERVER_CTR, + Column.MERGED_AD_SERVER_CPM_AND_CPC_REVENUE, + Column.MERGED_AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery = reportQuery; + + try { + // Run report job. + reportJob = reportService.runReportJob(reportJob); + + do { + Console.WriteLine("Report with ID '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS); + + if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with ID '{0}' failed to finish successfully.", + reportJob.id); + } else { + Console.WriteLine("Report job with ID '{0}' completed successfully.", reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ReportService/RunReachReport.cs b/examples/Dfp/CSharp/v201302/ReportService/RunReachReport.cs new file mode 100644 index 00000000000..16de0a886ab --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ReportService/RunReachReport.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Threading; +using Google.Api.Ads.Dfp.Util.v201302; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example runs a reach report. To download the report see + /// DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunReachReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a reach report. To download the report see " + + "DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunReachReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201302.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.REACH_LIFETIME; + reportQuery.dimensions = new Dimension[] {Dimension.LINE_ITEM_ID, Dimension.LINE_ITEM_NAME}; + reportQuery.columns = new Column[] {Column.REACH_FREQUENCY, Column.REACH_AVERAGE_REVENUE, + Column.REACH}; + reportJob.reportQuery = reportQuery; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ReportService/RunReportWithCustomFields.cs b/examples/Dfp/CSharp/v201302/ReportService/RunReportWithCustomFields.cs new file mode 100644 index 00000000000..18c21bb6464 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ReportService/RunReportWithCustomFields.cs @@ -0,0 +1,145 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; +using Google.Api.Ads.Dfp.Util.v201302; + +using System; +using System.Threading; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example runs a report that includes custom fields found in the + /// line items of an order. To download the report see DownloadReport.cs. + /// + /// Tag: ReportService.runReportJob + /// Tag: ReportService.getReportJob + /// Tag: LineItemService.getLineItemsByStatement + /// + class RunReportWithCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report that includes custom fields found in the " + + "line items of an order. To download the report see DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunReportWithCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201302.LineItemService); + // Get the ReportService. + ReportService reportService = + (ReportService) user.GetService(DfpService.v201302.ReportService); + + try { + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Sets defaults for page and filterStatement. + LineItemPage page = new LineItemPage(); + int offset = 0; + + // Create a statement to only select line items from a given order. + String filterText = "WHERE orderId = :orderId LIMIT 500"; + Statement filterStatement = + new StatementBuilder(filterText).AddValue("orderId", orderId).ToStatement(); + + + // Collect all line item custom field IDs for an order. + List customFieldIds = new List(); + do { + filterStatement.query = filterText + " OFFSET " + offset; + + // Get line items by statement. + page = lineItemService.getLineItemsByStatement(filterStatement); + + // Get custom field IDs from the line items of an order. + if (page.results != null) { + foreach (LineItem lineItem in page.results) { + if (lineItem.customFieldValues != null) { + foreach (BaseCustomFieldValue customFieldValue in lineItem.customFieldValues) { + if (!customFieldIds.Contains(customFieldValue.customFieldId)) { + customFieldIds.Add(customFieldValue.customFieldId); + } + } + } + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + + // Create statement to filter for an order. + filterStatement = + new StatementBuilder("WHERE ORDER_ID = :orderId").AddValue("orderId", orderId) + .ToStatement(); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportQuery.dimensions = new Dimension[] {Dimension.LINE_ITEM_ID, Dimension.LINE_ITEM_NAME}; + reportQuery.statement = filterStatement; + reportQuery.customFieldIds = customFieldIds.ToArray(); + reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS}; + reportJob.reportQuery = reportQuery; + + // Run report job. + reportJob = reportService.runReportJob(reportJob); + + do { + Console.WriteLine("Report with ID '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS); + + if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with ID '{0}' failed to finish successfully.", + reportJob.id); + } else { + Console.WriteLine("Report job with ID '{0}' completed successfully.", reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run cusom fields report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ReportService/RunSalesReport.cs b/examples/Dfp/CSharp/v201302/ReportService/RunSalesReport.cs new file mode 100644 index 00000000000..d979c3ad4c8 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ReportService/RunSalesReport.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example runs a report equal to the "Sales by salespersons + /// report" on the DFP website. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunSalesReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Sales by salespersons report\" on" + + "the DFP website. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunSalesReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201302.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.SALESPERSON_ID, + Dimension.SALESPERSON_NAME}; + reportJob.reportQuery.columns = new Column[] { + Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM + }; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run sales report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs b/examples/Dfp/CSharp/v201302/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs new file mode 100644 index 00000000000..aa3f772ad62 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs @@ -0,0 +1,105 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201302; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example approves all suggested ad units with 50 or more + /// requests. This feature is only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// Tags: SuggestedAdUnitService.performSuggestedAdUnitAction + /// + class ApproveSuggestedAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example approves all suggested ad units with 50 or more requests. " + + "This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ApproveSuggestedAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201302.SuggestedAdUnitService); + + // Create statement to select all suggested ad units with 50 or more + // requests. + string statementText = "WHERE numRequests >= 50"; + Statement filterStatement = new StatementBuilder(statementText).ToStatement(); + + try { + // Get suggested ad units by statement. + SuggestedAdUnitPage page = + suggestedAdUnitService.getSuggestedAdUnitsByStatement(filterStatement); + + int i = 0; + if (page != null && page.results != null) { + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and \"{2}\" will be " + + "approved.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + + Console.WriteLine("Number of suggested ad units to be approved: " + + page.totalResultSetSize); + + // Create action. + ApproveSuggestedAdUnit action = new ApproveSuggestedAdUnit(); + + // Perform action. + SuggestedAdUnitUpdateResult result = suggestedAdUnitService.performSuggestedAdUnitAction( + action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of suggested ad units approved: " + result.numChanges); + } else { + Console.WriteLine("No suggested ad units were approved."); + } + } else { + Console.WriteLine("No suggested ad units were approved."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to approve suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs b/examples/Dfp/CSharp/v201302/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs new file mode 100644 index 00000000000..28ee70d2ad3 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201302; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all suggested ad units. To approve suggested ad + /// units, run ApproveSuggestedAdUnits.cs. This feature is only available to + /// DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// + class GetAllSuggestedAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all suggested ad units. To approve suggested ad units, " + + "run ApproveSuggestedAdUnits.cs. This feature is only available to DFP premium " + + "solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllSuggestedAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201302.SuggestedAdUnitService); + + // Set defaults for page and filterStatement. + SuggestedAdUnitPage page = new SuggestedAdUnitPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all suggested ad units. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get suggested ad units by statement. + page = suggestedAdUnitService.getSuggestedAdUnitsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and number of requests " + + "\"{2}\" was found.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/SuggestedAdUnitService/GetSuggestedAdUnit.cs b/examples/Dfp/CSharp/v201302/SuggestedAdUnitService/GetSuggestedAdUnit.cs new file mode 100644 index 00000000000..0ad9afd9366 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/SuggestedAdUnitService/GetSuggestedAdUnit.cs @@ -0,0 +1,83 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201302; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets a suggested ad unit by its ID. To determine which + /// suggested ad units exist, run GetAllSuggestedAdUnits.cs. This feature is + /// only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnit + /// + class GetSuggestedAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a suggested ad unit by its ID. To determine which " + + "suggested ad units exist, run GetAllSuggestedAdUnits.cs. This feature is only " + + "available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetSuggestedAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201302.SuggestedAdUnitService); + + // Set the ID of the suggested ad unit to get. + String suggestedAdUnitId = _T("INSERT_SUGGESTED_AD_UNIT_ID_HERE"); + + try { + // Get the suggested ad unit. + SuggestedAdUnit suggestedAdUnit = suggestedAdUnitService.getSuggestedAdUnit( + suggestedAdUnitId); + + if (suggestedAdUnit != null) { + Console.WriteLine("Suggested ad unit with ID \"{0}\", and number of requests \"{1}\" " + + "was found.", suggestedAdUnit.id, suggestedAdUnit.numRequests); + } else { + Console.WriteLine("No suggested ad unit found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs b/examples/Dfp/CSharp/v201302/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs new file mode 100644 index 00000000000..d449f32b69c --- /dev/null +++ b/examples/Dfp/CSharp/v201302/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs @@ -0,0 +1,90 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201302; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets suggested ad units that have more than 50 requests. + /// The statement retrieves up to the maximum page size limit of 500. This + /// feature is only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// + class GetSuggestedUnitByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets suggested ad units that have more than 50 requests. The " + + "statement retrieves up to the maximum page size limit of 500. This feature is " + + "only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetSuggestedUnitByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201302.SuggestedAdUnitService); + + // Set the number of requests to 50 or more. + long NUMBER_OF_REQUESTS = 50L; + + // Create a statement to only select suggested ad units that have more + // than 50 requests. + Statement filterStatement = new StatementBuilder("WHERE numRequests > :numRequests LIMIT 500") + .AddValue("numRequests", NUMBER_OF_REQUESTS).ToStatement(); + + try { + // Get suggested ad units by statement. + SuggestedAdUnitPage page = suggestedAdUnitService.getSuggestedAdUnitsByStatement( + filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and number of requests " + + "\"{2}\" was found.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/TeamService/CreateTeams.cs b/examples/Dfp/CSharp/v201302/TeamService/CreateTeams.cs new file mode 100644 index 00000000000..d673a0c1dcc --- /dev/null +++ b/examples/Dfp/CSharp/v201302/TeamService/CreateTeams.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using Google.Api.Ads.Dfp.Util.v201302; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates new teams. To determine which teams exist, run + /// GetAllTeams.cs. + /// + /// Tags: TeamService.createTeams + /// + class CreateTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new teams. To determine which teams exist, run " + + "GetAllTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201302.TeamService); + + try { + // Create an array to store local team objects. + Team[] teams = new Team[5]; + + for (int i = 0; i < 5; i++) { + Team team = new Team(); + team.name = "Team #" + i; + team.hasAllCompanies = false; + team.hasAllInventory = false; + teams[i] = team; + } + + // Create the teams on the server. + teams = teamService.createTeams(teams); + + if (teams != null && teams.Length > 0) { + foreach (Team newTeam in teams) { + Console.WriteLine("A team with ID \"{0}\", and name \"{1}\" was created.", + newTeam.id, newTeam.name); + } + } else { + Console.WriteLine("No teams created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create teams. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/TeamService/GetAllTeams.cs b/examples/Dfp/CSharp/v201302/TeamService/GetAllTeams.cs new file mode 100644 index 00000000000..82e4953cd42 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/TeamService/GetAllTeams.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using Google.Api.Ads.Dfp.Util.v201302; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all teams. To create teams, run CreateTeams.cs. + /// + /// Tags: TeamService.getTeamsByStatement + /// + class GetAllTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams. To create teams, run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201302.TeamService); + + // Set defaults for page and filterStatement. + TeamPage page = new TeamPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all teams. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get teams by statement. + page = teamService.getTeamsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Team team in page.results) { + Console.WriteLine("{0}) Team with ID \"{1}\", name \"{2}\" was found.", + i, team.id, team.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all teams. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/TeamService/GetTeam.cs b/examples/Dfp/CSharp/v201302/TeamService/GetTeam.cs new file mode 100644 index 00000000000..be27df848b8 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/TeamService/GetTeam.cs @@ -0,0 +1,78 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using Google.Api.Ads.Dfp.Util.v201302; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets a team by its ID. To determine which teams exist, + /// run GetAllTeams.cs. + /// + /// Tags: TeamService.getTeam + /// + class GetTeam : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a team by its ID. To determine which teams exist, run " + + "GetAllTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetTeam(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201302.TeamService); + + // Set the ID of the team to get. + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + + try { + // Get the team. + Team team = teamService.getTeam(teamId); + + if (team != null) { + Console.WriteLine("Team with ID \"{0}\"and name \"{1}\" was found.", team.id, team.name); + } else { + Console.WriteLine("No team found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get team by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/TeamService/GetTeamsByStatement.cs b/examples/Dfp/CSharp/v201302/TeamService/GetTeamsByStatement.cs new file mode 100644 index 00000000000..71d4d8fb428 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/TeamService/GetTeamsByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using Google.Api.Ads.Dfp.Util.v201302; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all teams ordered by name. The statement retrieves + /// up to the maximum page size limit of 500. To create teams, + /// run CreateTeams.cs. + /// + /// Tags: TeamService.getTeamsByStatement + /// + class GetTeamsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams ordered by name. The statement retrieves up to " + + "the maximum page size limit of 500. To create teams, run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetTeamsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201302.TeamService); + + // Create a statement to order teams by name. + Statement filterStatement = new StatementBuilder("ORDER BY name LIMIT 500").ToStatement(); + + try { + // Get teams by statement. + TeamPage page = teamService.getTeamsByStatement(filterStatement); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (Team team in page.results) { + Console.WriteLine("{0}) Team with ID \"{1}\" and name \"{2}\" was found.", + i, team.id, team.name); + i++; + } + } + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get teams by statement. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/TeamService/UpdateTeams.cs b/examples/Dfp/CSharp/v201302/TeamService/UpdateTeams.cs new file mode 100644 index 00000000000..37d540a5245 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/TeamService/UpdateTeams.cs @@ -0,0 +1,107 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using Google.Api.Ads.Dfp.Util.v201302; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example updates teams by adding an ad unit to the first 5. To + /// determine which teams exist, run GetAllTeams.cs. To determine which ad + /// units exist, run GetAllAdUnits.cs. + /// + /// Tags: TeamService.getTeamsByStatement, TeamService.updateTeams + /// + class UpdateTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates teams by adding an ad unit to the first 5. To " + + "determine which teams exist, run GetAllTeams.cs. To determine which ad units " + + "exist, run GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201302.TeamService); + + // Set the ID of the ad unit to add to the teams. + String adUnitId = _T("INSERT_AD_UNIT_ID_HERE"); + + // Create a statement to select first 5 teams that aren't built-in. + Statement filterStatement = new StatementBuilder("WHERE id > 0 LIMIT 5").ToStatement(); + + try { + // Get the teams by statement. + TeamPage page = teamService.getTeamsByStatement(filterStatement); + + if (page.results != null) { + Team[] teams = page.results; + + // Update each local team object by adding the ad unit to it. + foreach (Team team in teams) { + // Don't add ad unit if the team has all inventory already. + if (!team.hasAllInventory) { + List adUnitIds = new List(); + if (team.adUnitIds != null) { + adUnitIds.AddRange(team.adUnitIds); + } + adUnitIds.Add(adUnitId); + team.adUnitIds = adUnitIds.ToArray(); + } + } + + // Update the teams on the server. + teams = teamService.updateTeams(teams); + + if (teams != null) { + foreach (Team team in teams) { + Console.WriteLine("A team with ID \"{0}\" and name \"{1}\" was updated.", + team.id, team.name); + } + } else { + Console.WriteLine("No teams updated."); + } + } else { + Console.WriteLine("No teams found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update teams. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ThirdPartySlotService/ArchiveThirdPartySlots.cs b/examples/Dfp/CSharp/v201302/ThirdPartySlotService/ArchiveThirdPartySlots.cs new file mode 100644 index 00000000000..6a503443e6c --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ThirdPartySlotService/ArchiveThirdPartySlots.cs @@ -0,0 +1,120 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using Google.Api.Ads.Dfp.Util.v201302; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example archives all active third party slots for a company. To + /// determine which third party slots exist, run GetAllThirdPartySlots.cs. + /// + /// Tags: ThirdPartSlotsService.getThirdPartySlotsByStatement + /// Tags: ThirdPartSlotsService.performThirdPartySlotsAction + /// + class ArchiveThirdPartySlot : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example archives all active third party slots for a company. To " + + "determine which third party slots exist, run GetAllThirdPartySlots.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ArchiveThirdPartySlot(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ThirdpartySlotService. + ThirdPartySlotService thirdPartySlotService = + (ThirdPartySlotService) user.GetService(DfpService.v201302.ThirdPartySlotService); + + //Set the company that the third party slots to archive belong to. + long companyId = long.Parse(_T("INSERT_COMPANY_ID_HERE")); + + // Create a statement to only select active third party slots. + String statementText = "WHERE status = :status AND companyId = :companyId LIMIT 500"; + Statement filterStatement = new StatementBuilder("").AddValue("status", + ThirdPartySlotStatus.ACTIVE.ToString()).AddValue("companyId", companyId).ToStatement(); + + // Set defaults for page and offset. + ThirdPartySlotPage page = new ThirdPartySlotPage(); + int offset = 0; + List thirdPartySlotIds = new List(); + + try { + do { + // Create a statement to page through active third party slots. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get third party slots by statement. + page = thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement); + + if (page.results != null) { + foreach (ThirdPartySlot thirdPartySlot in page.results) { + Console.WriteLine("Third party slot with ID \"{0}\" will be archived.", + thirdPartySlot.id); + thirdPartySlotIds.Add(thirdPartySlot.id.ToString()); + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of third party slots to be archived: " + thirdPartySlotIds.Count); + + if (thirdPartySlotIds.Count > 0) { + // Modify statement for action. + filterStatement.query = "WHERE id IN (" + string.Join(",", thirdPartySlotIds.ToArray()) + + ")"; + + // Create action. + ArchiveThirdPartySlots action = new ArchiveThirdPartySlots(); + + // Perform action. + UpdateResult result = thirdPartySlotService.performThirdPartySlotAction(action, + filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of third party slots archived: " + result.numChanges); + } else { + Console.WriteLine("No third party slots were archived."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to archive slots. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ThirdPartySlotService/CreateThirdPartySlot.cs b/examples/Dfp/CSharp/v201302/ThirdPartySlotService/CreateThirdPartySlot.cs new file mode 100644 index 00000000000..16750c4f878 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ThirdPartySlotService/CreateThirdPartySlot.cs @@ -0,0 +1,98 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using Google.Api.Ads.Dfp.Util.v201302; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates a new third party slot. To determine which + /// third party slots exist, run GetAllThirdPartySlots.cs. + /// + /// Tags: ThirdPartySlotsService.createThirdPartySlot + /// + class CreateThirdPartySlot : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new third party slot. To determine which third " + + "party slots exist, run GetAllThirdPartySlots.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateThirdPartySlot(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ThirdpartySlotService. + ThirdPartySlotService thirdPartySlotService = + (ThirdPartySlotService) user.GetService(DfpService.v201302.ThirdPartySlotService); + + // Set the company ID to associate with this third party slot. + long companyId = long.Parse(_T("INSERT_COMPANY_ID_HERE")); + + // Set the external unique ID to associate with this third party slot. + string externalUniqueId = _T("INSERT_EXTERNAL_UNIQUE_ID_HERE"); + + // Set the external unique name to associate with this third party slot. + string externalUniqueName = _T("INSERT_EXTERNAL_UNIQUE_NAME_HERE"); + + // Set the creative IDs to associate with this third party slot. + long[] creativeIds = new long[] {long.Parse(_T("INSERT_CREATIVE_ID_HERE"))}; + + // Create the ThirdPartySlot object. + ThirdPartySlot thirdPartySlot = new ThirdPartySlot(); + thirdPartySlot.companyId = companyId; + thirdPartySlot.description = "Third party slot description."; + thirdPartySlot.externalUniqueId = externalUniqueId; + thirdPartySlot.externalUniqueName = externalUniqueName; + + // Set the creatives that the third party slots will represent. + thirdPartySlot.creativeIds = creativeIds; + + try { + // Create the third party slot. + thirdPartySlot = thirdPartySlotService.createThirdPartySlot(thirdPartySlot); + + if (thirdPartySlot != null) { + Console.WriteLine("A third party slot with ID \"{0}\" and named \"{1}\" was created.", + thirdPartySlot.id, thirdPartySlot.externalUniqueName); + } else { + Console.WriteLine("No third party slot created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create third party slots. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ThirdPartySlotService/GetAllThirdPartySlots.cs b/examples/Dfp/CSharp/v201302/ThirdPartySlotService/GetAllThirdPartySlots.cs new file mode 100644 index 00000000000..82417774c09 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ThirdPartySlotService/GetAllThirdPartySlots.cs @@ -0,0 +1,90 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using Google.Api.Ads.Dfp.Util.v201302; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all third party slots. To create third party slots, + /// run CreateThirdPartySlot.cs. + /// + /// Tags: ThirdPartSlotsService.getThirdPartySlotsByStatement + /// + class GetAllThirdPartySlots : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all third party slots. To create third party slots, " + + "run CreateThirdPartySlot.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllThirdPartySlots(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ThirdpartySlotService. + ThirdPartySlotService thirdPartySlotService = + (ThirdPartySlotService) user.GetService(DfpService.v201302.ThirdPartySlotService); + + // Sets defaults for page and filterStatement. + ThirdPartySlotPage page = new ThirdPartySlotPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get third party slots. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get third party slots by statement. + page = thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (ThirdPartySlot slot in page.results) { + Console.WriteLine("{0}) Third party slot with ID \"{1}\" was found.", i, slot.id); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + } catch (Exception ex) { + Console.WriteLine("Failed to get all third party slots. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ThirdPartySlotService/GetThirdPartySlotsByStatement.cs b/examples/Dfp/CSharp/v201302/ThirdPartySlotService/GetThirdPartySlotsByStatement.cs new file mode 100644 index 00000000000..93b63e254b4 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ThirdPartySlotService/GetThirdPartySlotsByStatement.cs @@ -0,0 +1,87 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using Google.Api.Ads.Dfp.Util.v201302; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets archived third party slots. The statement retrieves + /// up to the maximum page size limit of 500. To create third party slots, run + /// CreateThirdPartySlot.cs. + /// + /// Tags: ThirdPartySlotService.getThirdPartySlotsByStatement + /// + class GetThirdPartySlotsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets archived third party slots. The statement retrieves up " + + "to the maximum page size limit of 500. To create third party slots, run " + + "CreateThirdPartySlot.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetThirdPartySlotsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ThirdpartySlotService. + ThirdPartySlotService thirdPartySlotService = + (ThirdPartySlotService) user.GetService(DfpService.v201302.ThirdPartySlotService); + + // Sets defaults for page and filterStatement. + ThirdPartySlotPage page = new ThirdPartySlotPage(); + Statement filterStatement = new StatementBuilder("WHERE status = :status LIMIT 500 ") + .AddValue("status", ThirdPartySlotStatus.ARCHIVED.ToString()).ToStatement(); + + try { + // Get third party slots by statement. + page = thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (ThirdPartySlot thirdPartySlot in page.results) { + Console.WriteLine("{0}) Third party slot with ID \"{1}\" was found.", + i, thirdPartySlot.id); + i++; + } + } + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get third party slots. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/ThirdPartySlotService/UpdateThirdPartySlots.cs b/examples/Dfp/CSharp/v201302/ThirdPartySlotService/UpdateThirdPartySlots.cs new file mode 100644 index 00000000000..f215e6894cc --- /dev/null +++ b/examples/Dfp/CSharp/v201302/ThirdPartySlotService/UpdateThirdPartySlots.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using Google.Api.Ads.Dfp.Util.v201302; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example updates the first third party slot description. + /// + /// Tags: ThirdPartySlotsService.getThirdPartySlotsByStatement + /// Tags:, ThirdPartySlotsService.updateThirdPartySlots + /// + class UpdateThirdPartySlots : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the first third party slot description."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateThirdPartySlots(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ThirdpartySlotService. + ThirdPartySlotService thirdPartySlotService = + (ThirdPartySlotService) user.GetService(DfpService.v201302.ThirdPartySlotService); + + // Create a statement to get one active third party slot. + Statement filterStatement = new StatementBuilder("WHERE status = :status LIMIT 1").AddValue( + "status", ThirdPartySlotStatus.ACTIVE.ToString()).ToStatement(); + + try { + // Get third party slot by statement. + ThirdPartySlotPage page = + thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement); + + if (page.results != null) { + // Update each third party slot by changing its description. + foreach (ThirdPartySlot slot in page.results) { + slot.description = "Updated description"; + + // Update the third party slot on the server. + ThirdPartySlot updatedSlot = thirdPartySlotService.updateThirdPartySlot(slot); + + // Display results. + if (updatedSlot != null) { + Console.WriteLine("A third party slot with ID \"{0}\" and description \"{1}\" " + + "was updated.", updatedSlot.id, updatedSlot.description); + } else { + Console.WriteLine("No third party slot was updated."); + } + } + } else { + Console.WriteLine("No third party slots found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update third party slots. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/UserService/CreateUsers.cs b/examples/Dfp/CSharp/v201302/UserService/CreateUsers.cs new file mode 100644 index 00000000000..51db1d3a23d --- /dev/null +++ b/examples/Dfp/CSharp/v201302/UserService/CreateUsers.cs @@ -0,0 +1,100 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example creates new users. To determine which users + /// exist, run GetAllUsers.cs. + /// + /// Tags: UserService.createUsers + /// + class CreateUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new users. To determine which users " + + "exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201302.UserService); + + // Set the user's email addresses and names. + List emailAndNames = new List(); + emailAndNames.Add(new String[] {_T("INSERT_EMAIL_ADDRESS_HERE"), _T("INSERT_NAME_HERE")}); + emailAndNames.Add(new String[] {_T("INSERT_ANOTHER_EMAIL_ADDRESS_HERE"), + _T("INSERT_ANOTHER_NAME_HERE")}); + + // Roles can be obtained by running GetAllRoles.cs. + long roleId = long.Parse(_T("INSERT_ROLE_ID_HERE")); + + // Create an array to store local user objects. + User[] users = new User[emailAndNames.Count]; + + for (int i = 0; i < users.Length; i++) { + // Create the new user structure. + User newUser = new User(); + newUser.email = emailAndNames[i][0]; + newUser.name = emailAndNames[i][1]; + newUser.roleId = roleId; + newUser.preferredLocale = "en_US"; + + users[i] = newUser; + } + + try { + // Create the users. + users = userService.createUsers(users); + + if (users != null) { + foreach (User newUser in users) { + Console.WriteLine("A user with ID = '{0}', email = '{1}', and role = '{2}' " + + "was created.", newUser.id, newUser.email, newUser.roleName); + } + } else { + Console.WriteLine("No users created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/UserService/DeactivateUser.cs b/examples/Dfp/CSharp/v201302/UserService/DeactivateUser.cs new file mode 100644 index 00000000000..d32588d6a28 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/UserService/DeactivateUser.cs @@ -0,0 +1,123 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example deactivates a user. Deactivated users can no longer make + /// requests to the API. The user making the request cannot deactivate itself. + /// To determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserService.getUsersByStatement, UserService.performUserAction + /// + class DeactivateUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates a user. Deactivated users can no longer make " + + "requests to the API. The user making the request cannot deactivate itself. " + + "To determine which users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201302.UserService); + + // Set the ID of the user to deactivate + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create Statement text to select user by id. + string statementText = "WHERE id = :userId LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("userId", userId).ToStatement(); + + // Sets defaults for page and offset. + UserPage page = new UserPage(); + int offset = 0; + List userIds = new List(); + + try { + do { + // Create a Statement to page through users. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get users by Statement. + page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User userResult in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and status = '{3}'" + + " will be deactivated.", i, userResult.id, userResult.email, + userResult.isActive ? "ACTIVE" : "INACTIVE"); + userIds.Add(userResult.id.ToString()); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of users to be deactivated: {0}", page.totalResultSetSize); + + if (userIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", userIds.ToArray()))). + ToStatement(); + + // Create action. + DeactivateUsers action = new DeactivateUsers(); + + // Perform action. + UpdateResult result = userService.performUserAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of users deactivated: {0}" + result.numChanges); + } else { + Console.WriteLine("No users were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/UserService/GetAllRoles.cs b/examples/Dfp/CSharp/v201302/UserService/GetAllRoles.cs new file mode 100644 index 00000000000..226a8123af6 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/UserService/GetAllRoles.cs @@ -0,0 +1,77 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all roles. This example can be used to determine + /// which role ID is needed when getting and creating users. + /// + /// Tags: UserService.getAllRoles + /// + class GetAllRoles : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all roles. This example can be used to determine which " + + "role ID is needed when getting and creating users."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllRoles(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201302.UserService); + + try { + // Get all roles. + Role[] roles = userService.getAllRoles(); + int numRoles = 0; + if (roles != null && roles.Length > 0) { + foreach (Role role in roles) { + Console.WriteLine("Role with ID = '{0}' and name ='{1}' was found.", role.id, + role.name); + } + numRoles = roles.Length; + } + + Console.WriteLine("Number of results found: " + numRoles); + } catch (Exception ex) { + Console.WriteLine("Failed to get all roles. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/UserService/GetAllUsers.cs b/examples/Dfp/CSharp/v201302/UserService/GetAllUsers.cs new file mode 100644 index 00000000000..e97bc05c255 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/UserService/GetAllUsers.cs @@ -0,0 +1,87 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all users. To create users, run CreateUsers.cs. + /// + /// Tags: UserService.getUsersByStatement + /// + class GetAllUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all users. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201302.UserService); + + // Sets defaults for page and Statement. + UserPage page = new UserPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all users. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get users by Statement. + page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User usr in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and role = '{3}'" + + " was found.", i, usr.id, usr.email, usr.roleName); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/UserService/GetCurrentUser.cs b/examples/Dfp/CSharp/v201302/UserService/GetCurrentUser.cs new file mode 100644 index 00000000000..1bb37113027 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/UserService/GetCurrentUser.cs @@ -0,0 +1,71 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets current user. To create users, run CreateUsers.cs. + /// + /// Tags: UserService.getCurrentUser + /// + class GetCurrentUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets current user. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCurrentUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201302.UserService); + + try { + // Get the current user. + User usr = userService.getCurrentUser(); + + if (usr != null) { + Console.WriteLine("User with ID = '{0}', email = '{1}', and role = '{2}' is the " + + "current user.", usr.id, usr.email, usr.roleName); + } else { + Console.WriteLine("The current user could not be retrieved."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get current user. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/UserService/GetUser.cs b/examples/Dfp/CSharp/v201302/UserService/GetUser.cs new file mode 100644 index 00000000000..9313bf0f6d9 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/UserService/GetUser.cs @@ -0,0 +1,76 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets a user by its ID. To create users, run + /// CreateUsers.cs. + /// + /// Tags: UserService.getUser + /// + class GetUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets a user by its ID. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201302.UserService); + + // Set the ID of the user to get. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + try { + // Get the user. + User usr = userService.getUser(userId); + + if (usr != null) { + Console.WriteLine("User with ID = '{0}', email = '{1}', and role = '{2}' was found.", + usr.id, usr.email, usr.roleName); + } else { + Console.WriteLine("No user found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/UserService/GetUsersByStatement.cs b/examples/Dfp/CSharp/v201302/UserService/GetUsersByStatement.cs new file mode 100644 index 00000000000..d5bd32f8ba0 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/UserService/GetUsersByStatement.cs @@ -0,0 +1,82 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all users sorted by name. The Statement retrieves + /// up to the maximum page size limit of 500. To create new users, + /// run CreateUsers.cs. + /// + /// Tags: UserService.getUsersByStatement + /// + class GetUsersByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return " This code example gets all users sorted by name. The Statement retrieves " + + "up to the maximum page size limit of 500. To create new users, " + + "run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUsersByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201302.UserService); + + // Create a Statement to get all users sorted by name. + Statement statement = new Statement(); + statement.query = "ORDER BY name LIMIT 500"; + + try { + // Get users by Statement. + UserPage page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User usr in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and role = '{3}'" + + " was found.", i, usr.id, usr.email, usr.roleName); + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/UserService/UpdateUsers.cs b/examples/Dfp/CSharp/v201302/UserService/UpdateUsers.cs new file mode 100644 index 00000000000..e6891830f60 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/UserService/UpdateUsers.cs @@ -0,0 +1,96 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example updates all users by adding "Sr." to the end of each + /// name (after a very large baby boom and lack of creativity). To + /// determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserService.getUsersByStatement, UserService.updateUsers + /// + class UpdateUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates all users by adding 'Sr.' to the end of each " + + "name (after a very large baby boom and lack of creativity). To " + + "determine which users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserService. + UserService userService = (UserService) dfpUser.GetService(DfpService.v201302.UserService); + + // Create a Statement to get all users. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get users by Statement. + UserPage page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + User[] users = page.results; + + // Update each local users object by changing its name. + foreach (User user in users) { + user.name = user.name + " Sr."; + } + + // Update the users on the server. + users = userService.updateUsers(users); + + if (users != null) { + foreach (User user in users) { + Console.WriteLine("A user with ID = '{0}', name ='{1}', and role = '{2}'" + + " was updated.", user.id, user.name, user.roleName); + } + } else { + Console.WriteLine("No users updated."); + } + } else { + Console.WriteLine("No users found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/UserTeamAssociationService/CreateUserTeamAssociations.cs b/examples/Dfp/CSharp/v201302/UserTeamAssociationService/CreateUserTeamAssociations.cs new file mode 100644 index 00000000000..f6009ae30e8 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/UserTeamAssociationService/CreateUserTeamAssociations.cs @@ -0,0 +1,98 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example adds a user to a team by creating an association + /// between the two. To determine which teams exist, run GetAllTeams.cs. To + /// determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.createUserTeamAssociations + /// + class CreateUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a user to a team by creating an association between the " + + "two. To determine which teams exist, run GetAllTeams.cs. To determine which users " + + "exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201302.UserTeamAssociationService); + + // Set the users and team to add them to. + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + long[] userIds = new long[] {long.Parse(_T("INSERT_USER_ID_HERE"))}; + + // Create an array to store local user team association objects. + UserTeamAssociation[] userTeamAssociations = new UserTeamAssociation[userIds.Length]; + + // For each user, associate it with the given team. + int i = 0; + + foreach (long userId in userIds) { + UserTeamAssociation userTeamAssociation = new UserTeamAssociation(); + userTeamAssociation.userId = userId; + userTeamAssociation.teamId = teamId; + userTeamAssociations[i++] = userTeamAssociation; + } + + try { + // Create the user team associations on the server. + userTeamAssociations = + userTeamAssociationService.createUserTeamAssociations(userTeamAssociations); + + if (userTeamAssociations != null) { + foreach (UserTeamAssociation userTeamAssociation in userTeamAssociations) { + Console.WriteLine("A user team association between user with ID \"{0}\" and team " + + "with ID \"{1}\" was created.", userTeamAssociation.userId, + userTeamAssociation.teamId); + } + } else { + Console.WriteLine("No user team associations created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/UserTeamAssociationService/DeleteUserTeamAssociations.cs b/examples/Dfp/CSharp/v201302/UserTeamAssociationService/DeleteUserTeamAssociations.cs new file mode 100644 index 00000000000..ca54dac13e1 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/UserTeamAssociationService/DeleteUserTeamAssociations.cs @@ -0,0 +1,121 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example removes the user from all its teams. To determine which + /// users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.performUserTeamAssociationAction + /// + class DeleteUserTeamAssociation : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example removes the user from all its teams. To determine which " + + "users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeleteUserTeamAssociation(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201302.UserTeamAssociationService); + + // Set the user to remove from its teams. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create filter text to select user team associations by the user ID. + String statementText = "WHERE userId = :userId LIMIT 500"; + Statement filterStatement = new StatementBuilder("").AddValue("userId", userId). + ToStatement(); + + // Set defaults for page and offset. + UserTeamAssociationPage page = new UserTeamAssociationPage(); + int offset = 0; + + try { + do { + // Create a statement to page through user team associations. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get user team associations by statement. + page = userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and " + + "team with ID \"{2}\" will be deleted.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of teams that the user will be removed from: " + + page.totalResultSetSize); + + if (page.totalResultSetSize > 0) { + // Modify statement for action. + filterStatement.query = "WHERE userId = :userId"; + + // Create action. + DeleteUserTeamAssociations action = new DeleteUserTeamAssociations(); + + // Perform action. + UpdateResult result = + userTeamAssociationService.performUserTeamAssociationAction(action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of teams that the user was removed from: " + + result.numChanges); + } else { + Console.WriteLine("No user team associations were deleted."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to delete user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/UserTeamAssociationService/GetAllUserTeamAssociations.cs b/examples/Dfp/CSharp/v201302/UserTeamAssociationService/GetAllUserTeamAssociations.cs new file mode 100644 index 00000000000..5ec859b8c9d --- /dev/null +++ b/examples/Dfp/CSharp/v201302/UserTeamAssociationService/GetAllUserTeamAssociations.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all user team associations. To create user team + /// associations, run CreateUserTeamAssociations.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// + class GetAllUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all user team associations. To create user team " + + "associations, run CreateUserTeamAssociations.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201302.UserTeamAssociationService); + + // Set defaults for page and filterStatement. + UserTeamAssociationPage page = new UserTeamAssociationPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all user team associations. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get user team associations by statement. + page = userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and " + + "team with ID \"{2}\" was found.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}." + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/UserTeamAssociationService/GetUserTeamAssociation.cs b/examples/Dfp/CSharp/v201302/UserTeamAssociationService/GetUserTeamAssociation.cs new file mode 100644 index 00000000000..53ebe4004c1 --- /dev/null +++ b/examples/Dfp/CSharp/v201302/UserTeamAssociationService/GetUserTeamAssociation.cs @@ -0,0 +1,84 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets a user team association by the user and team ID. + /// To determine which teams exist, run GetAllTeams.cs. To determine which + /// users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociation + /// + class GetUserTeamAssociation : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a user team association by the user and team ID. To " + + "determine which teams exist, run GetAllTeams.cs. To determine which users exist, " + + "run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUserTeamAssociation(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201302.UserTeamAssociationService); + + // Set the IDs of the user and team to get the association for. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + + try { + // Get the user team association. + UserTeamAssociation userTeamAssociation = userTeamAssociationService.getUserTeamAssociation( + teamId, userId); + + if (userTeamAssociation != null) { + Console.WriteLine("User team association between user with ID \"{0}\" and team with " + + "ID \"{1}\" was found.", userTeamAssociation.userId, userTeamAssociation.teamId); + } else { + Console.WriteLine("No user team association found."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs b/examples/Dfp/CSharp/v201302/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs new file mode 100644 index 00000000000..d5122bd102d --- /dev/null +++ b/examples/Dfp/CSharp/v201302/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs @@ -0,0 +1,98 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example gets all teams that the current user belongs to. The + /// statement retrieves up to the maximum page size limit of 500. To create + /// teams, run CreateTeams.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// Tags: UserService.getCurrentUser + /// + class GetUserTeamAssociationsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams that the current user belongs to. The " + + "statement retrieves up to the maximum page size limit of 500. To create teams, " + + "run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUserTeamAssociationsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201302.UserTeamAssociationService); + + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201302.UserService); + + try { + // Get the current user. + long currentUserId = userService.getCurrentUser().id; + + // Create filter text to select user team associations by the user ID. + String statementText = "WHERE userId = :userId LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText). + AddValue("userId", currentUserId).ToStatement(); + + // Get user team associations by statement. + UserTeamAssociationPage page = + userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and team " + + "with ID \"{2}\" was found.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201302/UserTeamAssociationService/UpdateUserTeamAssociations.cs b/examples/Dfp/CSharp/v201302/UserTeamAssociationService/UpdateUserTeamAssociations.cs new file mode 100644 index 00000000000..8937c769d3a --- /dev/null +++ b/examples/Dfp/CSharp/v201302/UserTeamAssociationService/UpdateUserTeamAssociations.cs @@ -0,0 +1,107 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201302 { + /// + /// This code example updates user team associations by setting the + /// overridden access type to read only for all teams that the user belongs + /// to. To determine which users exists, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// Tags: UserTeamAssociationService.updateUserTeamAssociations + /// + class UpdateUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates user team associations by setting the overridden " + + "access type to read only for all teams that the user belongs to. To determine " + + "which users exists, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201302.UserTeamAssociationService); + + // Set the user to set to read only access within its teams. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create filter text to select user team associations by the user ID. + String statementText = "WHERE userId = :userId LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText). + AddValue("userId", userId).ToStatement(); + + try { + // Get user team associations by statement. + UserTeamAssociationPage page = + userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + if (page.results != null) { + UserTeamAssociation[] userTeamAssociations = page.results; + + // Update each local user team association to read only access. + foreach (UserTeamAssociation userTeamAssociation in userTeamAssociations) { + userTeamAssociation.overriddenTeamAccessType = TeamAccessType.READ_ONLY; + } + + // Update the user team associations on the server. + userTeamAssociations = + userTeamAssociationService.updateUserTeamAssociations(userTeamAssociations); + + if (userTeamAssociations != null) { + foreach (UserTeamAssociation userTeamAssociation in userTeamAssociations) { + Console.WriteLine("User team association between user with ID \"{0}\" and team " + + "with ID \"{1}\" was updated to access type \"{2}\".", userTeamAssociation.userId, + userTeamAssociation.teamId, userTeamAssociation.overriddenTeamAccessType); + } + } else { + Console.WriteLine("No user team associations updated."); + } + } else { + Console.WriteLine("No user team associations found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ActivityGroupService/CreateActivityGroups.cs b/examples/Dfp/CSharp/v201306/ActivityGroupService/CreateActivityGroups.cs new file mode 100644 index 00000000000..e00323a3bef --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ActivityGroupService/CreateActivityGroups.cs @@ -0,0 +1,96 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates new activity groups. To determine which activity + /// groups exist, run GetAllActivityGroups.cs. + /// + /// Tags: ActivityGroupService.createActivityGroups + /// + class CreateActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new activity groups. To determine which activity " + + "groups exist, run GetAllActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201306.ActivityGroupService); + + // Set the ID of the advertiser company this activity group is associated + // with. + long advertiserCompanyId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Create a short-term activity group. + ActivityGroup shortTermActivityGroup = new ActivityGroup(); + shortTermActivityGroup.name = "Short-term activity group #" + GetTimeStamp(); + shortTermActivityGroup.companyIds = new long[] {advertiserCompanyId}; + shortTermActivityGroup.clicksLookback = 1; + shortTermActivityGroup.impressionsLookback = 1; + + // Create a long-term activity group. + ActivityGroup longTermActivityGroup = new ActivityGroup(); + longTermActivityGroup.name = "Long-term activity group #" + GetTimeStamp(); + longTermActivityGroup.companyIds = new long[] {advertiserCompanyId}; + longTermActivityGroup.clicksLookback = 30; + longTermActivityGroup.impressionsLookback = 30; + + try { + // Create the activity groups on the server. + ActivityGroup[] activityGroups = activityGroupService.createActivityGroups( + new ActivityGroup[] {shortTermActivityGroup, longTermActivityGroup}); + + // Display results. + if (activityGroups != null) { + foreach (ActivityGroup activityGroup in activityGroups) { + Console.WriteLine("An activity group with ID \"{0}\" and name \"{1}\" was created.", + activityGroup.id, activityGroup.name); + } + } else { + Console.WriteLine("No activity groups were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ActivityGroupService/GetActiveActivityGroups.cs b/examples/Dfp/CSharp/v201306/ActivityGroupService/GetActiveActivityGroups.cs new file mode 100644 index 00000000000..b38aa2794d9 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ActivityGroupService/GetActiveActivityGroups.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; +using Google.Api.Ads.Dfp.Util.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all active activity groups. To create activity + /// groups, run CreateActivityGroups.cs. + /// + /// Tags: ContactService.getContactsByStatement + /// + class GetActiveActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active activity groups. To create activity groups, " + + "run CreateActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActiveActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201306.ActivityGroupService); + + Statement filterStatement = new StatementBuilder("").AddValue( + "status", ActivityGroupStatus.ACTIVE.ToString()).ToStatement(); + + // Set defaults for page and filterStatement. + ActivityGroupPage page; + int offset = 0; + + try { + do { + // Create a statement to get all content. + filterStatement.query = "WHERE status = :status ORDER BY id LIMIT 500 OFFSET " + + offset.ToString(); + + + // Get contacts by statement. + page = activityGroupService.getActivityGroupsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (ActivityGroup activityGroup in page.results) { + Console.WriteLine("{0}) Activity group with ID \"{1}\" and name \"{2}\" was found.", + i, activityGroup.id, activityGroup.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ActivityGroupService/GetAllActivityGroups.cs b/examples/Dfp/CSharp/v201306/ActivityGroupService/GetAllActivityGroups.cs new file mode 100644 index 00000000000..abd70d6c019 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ActivityGroupService/GetAllActivityGroups.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; +using Google.Api.Ads.Dfp.Util.v201306; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all activity groups. To create activity groups, run + /// CreateActivityGroups.cs. + /// + /// Tags: ActivityGroupService.getActivityGroupsByStatement + /// + class GetAllActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all activity groups. To create activity groups, run " + + "CreateActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201306.ActivityGroupService); + + ActivityGroupPage page; + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + filterStatement.query = "ORDER BY id LIMIT 500 OFFSET " + offset.ToString(); + // Get activity groups by statement. + page = activityGroupService.getActivityGroupsByStatement(filterStatement); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + + foreach (ActivityGroup activityGroup in page.results) { + Console.WriteLine("{0}) Activity group with ID \"{1}\" and name \"{2}\" was " + + "found.", i, activityGroup.id, activityGroup.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ActivityGroupService/UpdateActivityGroups.cs b/examples/Dfp/CSharp/v201306/ActivityGroupService/UpdateActivityGroups.cs new file mode 100644 index 00000000000..8429ede2c4c --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ActivityGroupService/UpdateActivityGroups.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; +using Google.Api.Ads.Dfp.Util.v201306; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example updates activity groups by adding a company. To + /// determine which activity groups exist, run GetAllActivityGroups.cs. + /// + /// Tags: ActivityGroupService.getActivityGroup + /// Tags: ActivityGroupService.updateActivityGroups + /// + class UpdateActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates activity groups by adding a company. To determine " + + "which activity groups exist, run GetAllActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201306.ActivityGroupService); + + // Set the ID of the activity group and the company to update it with. + int activityGroupId = int.Parse(_T("INSERT_ACTIVITY_GROUP_ID_HERE")); + long advertiserCompanyId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + try { + // Get the activity group. + ActivityGroup activityGroup = activityGroupService.getActivityGroup(activityGroupId); + + // Update the companies. + List companyIds = new List(activityGroup.companyIds); + companyIds.Add(advertiserCompanyId); + activityGroup.companyIds = companyIds.ToArray(); + + // Update the activity groups on the server. + ActivityGroup[] activityGroups = activityGroupService.updateActivityGroups( + new ActivityGroup[] {activityGroup}); + + // Display results. + if (activityGroups != null) { + foreach (ActivityGroup updatedActivityGroup in activityGroups) { + Console.WriteLine("Activity group with ID \"{0}\" and name \"{1}\" was updated.", + updatedActivityGroup.id, updatedActivityGroup.name); + } + } else { + Console.WriteLine("No activity groups were updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ActivityService/CreateActivities.cs b/examples/Dfp/CSharp/v201306/ActivityService/CreateActivities.cs new file mode 100644 index 00000000000..5228d5a323e --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ActivityService/CreateActivities.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates new activities. To determine which activities + /// exist, run GetAllActivities.cs. + /// + /// Tags: ActivityService.createActivities + /// + class CreateActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new activities. To determine which activities exist, " + + "run GetAllActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201306.ActivityService); + + // Set the ID of the activity group this activity is associated with. + int activityGroupId = int.Parse(_T("INSERT_ACTIVITY_GROUP_ID_HERE")); + + // Create a daily visits activity. + Activity dailyVisitsActivity = new Activity(); + dailyVisitsActivity.name = "Activity #" + GetTimeStamp(); + dailyVisitsActivity.activityGroupId = activityGroupId; + dailyVisitsActivity.type = ActivityType.DAILY_VISITS; + + // Create a custom activity. + Activity customActivity = new Activity(); + customActivity.name = "Activity #" + GetTimeStamp(); + customActivity.activityGroupId = activityGroupId; + customActivity.type = ActivityType.CUSTOM; + + try { + // Create the activities on the server. + Activity[] activities = activityService.createActivities( + new Activity[] {dailyVisitsActivity, customActivity}); + + // Display results. + if (activities != null) { + foreach (Activity newActivity in activities) { + Console.WriteLine("An activity with ID \"{0}\", name \"{1}\", and type \"{2}\" was " + + "created.\n", newActivity.id, newActivity.name, newActivity.type); + } + } else { + Console.WriteLine("No activities were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create activities. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ActivityService/GetActiveActivities.cs b/examples/Dfp/CSharp/v201306/ActivityService/GetActiveActivities.cs new file mode 100644 index 00000000000..c4775dc524e --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ActivityService/GetActiveActivities.cs @@ -0,0 +1,100 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; +using Google.Api.Ads.Dfp.Util.v201306; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all active activities. To create activities, + /// run CreateActivities.cs. + /// + /// Tags: ActivityService.getActivitiesByStatement + /// + class GetActiveActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active activities. To create activities, run " + + "CreateActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActiveActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201306.ActivityService); + + // Set the ID of the activity group these activities are associated with. + long activityGroupId = long.Parse(_T("INSERT_ACTIVITY_GROUP_ID_HERE")); + + // Statement parts to help build a statement that only selects active + // activities. + Statement filterStatement = new StatementBuilder(""). + AddValue("activityGroupId", activityGroupId). + AddValue("status", ActivityStatus.ACTIVE.ToString()). + ToStatement(); + + int offset = 0; + ActivityPage page; + + try { + do { + filterStatement.query = "WHERE activityGroupId = :activityGroupId and status = :status " + + "ORDER BY id LIMIT 500 OFFSET " + offset; + + page = activityService.getActivitiesByStatement(filterStatement); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (Activity activity in page.results) { + Console.WriteLine("{0}) Activity with ID \"{1}\", name \"{2}\", and type \"{3}\" " + + "was found.", i, activity.id, activity.name, activity.type); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}.", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get activities. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ActivityService/GetAllActivities.cs b/examples/Dfp/CSharp/v201306/ActivityService/GetAllActivities.cs new file mode 100644 index 00000000000..a20a6c3e533 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ActivityService/GetAllActivities.cs @@ -0,0 +1,132 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; +using Google.Api.Ads.Dfp.Util.v201306; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all activities. To create activities, run + /// CreateActivities.cs. + /// + /// Tags: ActivityService.getActivitiesByStatement + /// Tags: ActivityGroupService.getActivityGroupsByStatement + /// + class GetAllActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all activities. To create activities, run " + + "CreateActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201306.ActivityService); + + int totalResultsCounter = 0; + + try { + long[] activityGroupIds = getAllActivityGroupIds(user); + + foreach (long activityGroupId in activityGroupIds) { + Statement filterStatement = new StatementBuilder("").AddValue( + "activityGroupId", activityGroupId).ToStatement(); + + ActivityPage page = new ActivityPage(); + int offset = 0; + + do { + filterStatement.query = "WHERE activityGroupId = :activityGroupId ORDER BY id " + + "LIMIT 500 OFFSET " + offset; + // Get activities by statement. + page = activityService.getActivitiesByStatement(filterStatement); + + // Display results. + if (page.results != null) { + foreach (Activity activity in page.results) { + Console.WriteLine("{0}) Activity with ID \"{1}\", name \"{2}\", type \"{3}\", " + + "and activity group ID \"{4}\" was found.\n", totalResultsCounter, + activity.id, activity.name, activity.type, activityGroupId); + totalResultsCounter++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + } + Console.WriteLine("Number of results found: {0}.", totalResultsCounter); + } catch (Exception ex) { + Console.WriteLine("Failed to get contacts. Exception says \"{0}\"", ex.Message); + } + } + + /// + /// Get the list of all activity group ids. + /// + /// The DfpUser. + /// A list of ids for all the activity groups. + private long[] getAllActivityGroupIds(DfpUser user) { + List activityGroupIds = new List(); + + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201306.ActivityGroupService); + + ActivityGroupPage page; + Statement filterStatement = new Statement(); + int offset = 0; + + do { + // Create a statement to get all activity groups. + filterStatement.query = "ORDER BY id LIMIT 500 OFFSET " + offset.ToString(); + + // Get activity groups by statement. + page = activityGroupService.getActivityGroupsByStatement(filterStatement); + if (page.results != null) { + foreach (ActivityGroup activityGroup in page.results) { + activityGroupIds.Add(activityGroup.id); + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + return activityGroupIds.ToArray(); + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ActivityService/UpdateActivities.cs b/examples/Dfp/CSharp/v201306/ActivityService/UpdateActivities.cs new file mode 100644 index 00000000000..44919b4140b --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ActivityService/UpdateActivities.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; +using Google.Api.Ads.Dfp.Util.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example updates activity expected URLs. To determine which + /// activities exist, run GetAllActivities.cs. + /// + /// Tags: ActivityService.getActivity + /// Tags: ActivityService.updateActivities + /// + class UpdateActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates activity expected URLs. To determine which activities " + + "exist, run GetAllActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201306.ActivityService); + + // Set the ID of the activity to update. + int activityId = int.Parse(_T("INSERT_ACTIVITY_ID_HERE")); + + try { + // Get the activity. + Activity activity = activityService.getActivity(activityId); + + // Update the expected URL. + activity.expectedURL = "https://www.google.com"; + + // Update the activity on the server. + Activity[] activities = activityService.updateActivities(new Activity[] {activity}); + + // Display results. + if (activities != null) { + foreach (Activity updatedActivity in activities) { + Console.WriteLine("Activity with ID \"{0}\" and name \"{1}\" was updated.", + updatedActivity.id, updatedActivity.name); + } + } else { + Console.WriteLine("No activities were updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update activities. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/AudienceSegmentService/GetAllAudienceSegments.cs b/examples/Dfp/CSharp/v201306/AudienceSegmentService/GetAllAudienceSegments.cs new file mode 100644 index 00000000000..b18504ec880 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/AudienceSegmentService/GetAllAudienceSegments.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all audience segments. + /// + /// Tags: AudienceSegmentService.getAudienceSegmentsByStatement + /// + class GetAllAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all audience segments."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = + (AudienceSegmentService) user.GetService(DfpService.v201306.AudienceSegmentService); + + // Set defaults for page and Statement. + AudienceSegmentPage page = new AudienceSegmentPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all creatives. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get audience segment by Statement. + page = audienceSegmentService.getAudienceSegmentsByStatement(statement); + + // Display results. + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AudienceSegment segment in page.results) { + Console.WriteLine("{0}) 'Audience segment with id \"{1}\" and name \"{2}\" was " + + "found.", i, segment.id, segment.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get audience segment. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CompanyService/CreateCompanies.cs b/examples/Dfp/CSharp/v201306/CompanyService/CreateCompanies.cs new file mode 100644 index 00000000000..2bf552c8a99 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CompanyService/CreateCompanies.cs @@ -0,0 +1,86 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates new companies. To determine which companies + /// exist, run GetAllCompanies.cs. + /// + /// Tags: CompanyService.createCompanies + /// + class CreateCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new companies. To determine which companies exist, " + + "run GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201306.CompanyService); + + // Create an array to store local company objects. + Company[] companies = new Company[5]; + + for (int i = 0; i < 5; i++) { + Company company = new Company(); + company.name = string.Format("Advertiser #{0}", i); + company.type = CompanyType.ADVERTISER; + companies[i] = company; + } + + try { + // Create the companies on the server. + companies = companyService.createCompanies(companies); + + if (companies != null && companies.Length > 0) { + foreach (Company company in companies) { + Console.WriteLine("A company with ID = '{0}', name = '{1}' and type = '{2}' was" + + " created.", company.id, company.name, company.type); + } + } else { + Console.WriteLine("No companies created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create company. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CompanyService/GetAllCompanies.cs b/examples/Dfp/CSharp/v201306/CompanyService/GetAllCompanies.cs new file mode 100644 index 00000000000..97e9d021c18 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CompanyService/GetAllCompanies.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all companies. To create companies, run + /// CreateCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement + /// + class GetAllCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all companies. To create companies, run CreateCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201306.CompanyService); + + // Set defaults for page and Statement. + CompanyPage page = new CompanyPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all companies. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get companies by Statement. + page = companyService.getCompaniesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Company company in page.results) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", + i, company.id, company.name, company.type); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CompanyService/GetCompaniesByStatement.cs b/examples/Dfp/CSharp/v201306/CompanyService/GetCompaniesByStatement.cs new file mode 100644 index 00000000000..76bdec1c19c --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CompanyService/GetCompaniesByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all companies that are advertisers. The Statement + /// retrieves up to the maximum page size limit of 500. To create companies, + /// run CreateCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement + /// + class GetCompaniesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all companies that are advertisers. The Statement " + + "retrieves up to the maximum page size limit of 500. To create companies, run " + + "CreateCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCompaniesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201306.CompanyService); + + // Create a Statement to only select companies that are advertisers sorted + // by name. + Statement statement = new StatementBuilder("WHERE type = :advertiser ORDER BY name " + + "LIMIT 500").AddValue("advertiser", CompanyType.ADVERTISER.ToString()).ToStatement(); + + try { + // Get companies by Statement. + CompanyPage page = companyService.getCompaniesByStatement(statement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Company company in page.results) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", + i, company.id, company.name, company.type); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CompanyService/GetCompany.cs b/examples/Dfp/CSharp/v201306/CompanyService/GetCompany.cs new file mode 100644 index 00000000000..8db0088aac8 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CompanyService/GetCompany.cs @@ -0,0 +1,77 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets a company by its ID. To determine which companies + /// exist, run GetAllCompanies.cs. + /// + /// Tags: CompanyService.getCompany + /// + class GetCompany : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a company by its ID. To determine which companies " + + "exist, run GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCompany(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201306.CompanyService); + + // Set the ID of the company to get. + long companyId = long.Parse(_T("INSERT_COMPANY_ID_HERE")); + + try { + // Get the company. + Company company = companyService.getCompany(companyId); + + if (company != null) { + Console.WriteLine("Company with ID = {0}, name = {1} and type = {2} was found", + company.id, company.name, company.type); + } else { + Console.WriteLine("No company found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get company. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CompanyService/UpdateCompanies.cs b/examples/Dfp/CSharp/v201306/CompanyService/UpdateCompanies.cs new file mode 100644 index 00000000000..58819fcf147 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CompanyService/UpdateCompanies.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example updates the names of all companies that are advertisers + /// by appending "LLC." up to the first 500. To determine which companies + /// exist, run GetAllCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement, CompanyService.updateCompanies + /// + class UpdateCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the names of all companies that are advertisers by " + + "appending 'LLC.' up to the first 500. To determine which companies exist, run " + + "GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201306.CompanyService); + + // Create a Statement to only select companies that are advertisers. + Statement statement = new StatementBuilder("WHERE type = :advertiser LIMIT 500").AddValue( + "advertiser", CompanyType.ADVERTISER.ToString()).ToStatement(); + + try { + // Get the companies by Statement. + CompanyPage page = companyService.getCompaniesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + Company[] companies = page.results; + + // Update each local company object by appending LLC. to its name. + foreach (Company company in companies) { + company.name = company.name + " LLC."; + } + + // Update the companies on the server. + companies = companyService.updateCompanies(companies); + + if (companies != null && companies.Length > 0) { + int i = 0; + foreach (Company company in companies) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} was updated", + i, company.id, company.name, company.type); + i++; + } + } else { + Console.WriteLine("No companies updated."); + } + } else { + Console.WriteLine("No companies found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ContactService/CreateContacts.cs b/examples/Dfp/CSharp/v201306/ContactService/CreateContacts.cs new file mode 100644 index 00000000000..3894afd6f45 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ContactService/CreateContacts.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates new contacts. To determine which contacts exist, + /// run GetAllContacts.cs. + /// + /// Tags: ContactService.createContacts + /// + class CreateContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new contacts. To determine which contacts exist, " + + "run GetAllContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201306.ContactService); + + // Set the IDs of the companies for the contacts. + long advertiserCompanyId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + long agencyCompanyId = long.Parse(_T("INSERT_AGENCY_COMPANY_ID_HERE")); + + // Create an advertiser contact. + Contact advertiserContact = new Contact(); + advertiserContact.name = "Mr. Advertiser #" + GetTimeStamp(); + advertiserContact.email = "advertiser@advertising.com"; + advertiserContact.companyId = advertiserCompanyId; + + // Create an agency contact. + Contact agencyContact = new Contact(); + agencyContact.name = "Ms. Agency #" + GetTimeStamp(); + agencyContact.email = "agency@agencies.com"; + agencyContact.companyId = agencyCompanyId; + + try { + // Create the contacts on the server. + Contact[] contacts = + contactService.createContacts(new Contact[] {advertiserContact, agencyContact}); + + foreach (Contact contact in contacts) { + Console.WriteLine("A contact with ID \"{0}\" and name \"{1}\" was created.", + contact.id, contact.name); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ContactService/GetAllContacts.cs b/examples/Dfp/CSharp/v201306/ContactService/GetAllContacts.cs new file mode 100644 index 00000000000..8b16a1e9486 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ContactService/GetAllContacts.cs @@ -0,0 +1,90 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; +using Google.Api.Ads.Dfp.Util.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all contacts. To create contacts, run + /// CreateContacts.cs. + /// + /// Tags: ContactService.getContactsByStatement + /// + class GetAllContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all contacts. To create contacts, run CreateContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201306.ContactService); + + Statement filterStatement = new Statement(); + + // Set defaults for page and filterStatement. + ContactPage page = new ContactPage(); + int offset = 0; + + try { + do { + // Create a statement to get all contacts. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get contacts by statement. + page = contactService.getContactsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Contact contact in page.results) { + Console.WriteLine("{0}) Contact with ID \"{1}\" and name \"{2}\" was found.", + i, contact.id, contact.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ContactService/GetUninvitedContacts.cs b/examples/Dfp/CSharp/v201306/ContactService/GetUninvitedContacts.cs new file mode 100644 index 00000000000..314e42c71e8 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ContactService/GetUninvitedContacts.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; +using Google.Api.Ads.Dfp.Util.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all contacts that aren't invited yet. To create + /// contacts, run CreateContacts.cs. + /// + /// Tags: ContactService.getContactsByStatement + /// + class GetUninvitedContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all contacts that aren't invited yet. To create " + + "contacts, run CreateContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUninvitedContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201306.ContactService); + + Statement filterStatement = new StatementBuilder("").AddValue( + "status", ContactStatus.UNINVITED.ToString()).ToStatement(); + + // Set defaults for page and filterStatement. + ContactPage page = new ContactPage(); + int offset = 0; + + try { + do { + // Create a statement to get all contacts. + filterStatement.query = "where status = :status LIMIT 500 OFFSET " + offset.ToString(); + + // Get contacts by statement. + page = contactService.getContactsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Contact contact in page.results) { + Console.WriteLine("{0}) Contact with ID \"{1}\" and name \"{2}\" was found.", + i, contact.id, contact.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ContactService/UpdateContacts.cs b/examples/Dfp/CSharp/v201306/ContactService/UpdateContacts.cs new file mode 100644 index 00000000000..0576bd5f419 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ContactService/UpdateContacts.cs @@ -0,0 +1,83 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; +using Google.Api.Ads.Dfp.Util.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example updates contact addresses. To determine which contacts + /// exist, run GetAllContacts.cs. + /// + /// Tags: ContactService.updateContacts + /// + class UpdateContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates contact comments. To determine which contacts " + + "exist, run GetAllContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201306.ContactService); + + // Set the ID of the contact to update. + long contactId = long.Parse(_T("INSERT_CONTACT_ID_HERE")); + + try { + // Get the contact. + Contact contact = contactService.getContact(contactId); + + // Update the address of the contact. + contact.address = "123 New Street, New York, NY, 10011"; + + // Update the contact on the server. + Contact[] contacts = contactService.updateContacts(new Contact[] {contact}); + + // Display results. + foreach (Contact updatedContact in contacts) { + Console.WriteLine("Contact with ID \"{0}\", name \"{1}\", and comment \"{2}\" was " + + "updated.", updatedContact.id, updatedContact.name, updatedContact.comment); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ContentService/GetAllContent.cs b/examples/Dfp/CSharp/v201306/ContentService/GetAllContent.cs new file mode 100644 index 00000000000..8e74e9e2e09 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ContentService/GetAllContent.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all content. This feature is only available to DFP + /// premium solution networks. + /// + /// Tags: ContentService.getContentByStatement + /// + class GetAllContent : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all content. This feature is only available to DFP " + + "premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllContent(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContentService. + ContentService contentService = + (ContentService) user.GetService(DfpService.v201306.ContentService); + + // Set defaults for page and filterStatement. + ContentPage page = new ContentPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all content. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get content by statement. + page = contentService.getContentByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Content content in page.results) { + Console.WriteLine("{0}) Content with ID \"{1}\", name \"{2}\", and status \"{3}\" " + + "was found.", i, content.id, content.name, content.status); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all content. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ContentService/GetContentByCategory.cs b/examples/Dfp/CSharp/v201306/ContentService/GetContentByCategory.cs new file mode 100644 index 00000000000..25b2a06d4ad --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ContentService/GetContentByCategory.cs @@ -0,0 +1,123 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using Google.Api.Ads.Dfp.Util.v201306; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all active content categorized as "comedy" using + /// the network's content browse custom targeting key. This feature is only + /// available to DFP video publishers. + /// + /// Tags: NetworkService.getCurrentNetwork + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// Tags: ContentService.getContentByStatementAndCustomTargetingValue + /// /// + class GetContentByCategory : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active content categorized as 'comedy' using the " + + "network's content browse custom targeting key. This feature is only available to " + + "DFP video publishers."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetContentByCategory(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContentService. + ContentService contentService = + (ContentService) user.GetService(DfpService.v201306.ContentService); + + // Get the NetworkService. + NetworkService networkService = (NetworkService) user.GetService( + DfpService.v201306.NetworkService); + + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = (CustomTargetingService) user.GetService( + DfpService.v201306.CustomTargetingService); + + try { + // Get content browse custom targeting key ID. + long contentBrowseCustomTargetingKeyId = + networkService.getCurrentNetwork().contentBrowseCustomTargetingKeyId; + + // Create a statement to select the categories matching the name comedy. + Statement categoryFilterStatement = new StatementBuilder( + "WHERE customTargetingKeyId = :contentBrowseCustomTargetingKeyId " + + " and name = :category LIMIT 1") + .AddValue("contentBrowseCustomTargetingKeyId", contentBrowseCustomTargetingKeyId) + .AddValue("category", "comedy").ToStatement(); + + // Get categories matching the filter statement. + CustomTargetingValuePage customTargetingValuePage = + customTargetingService.getCustomTargetingValuesByStatement(categoryFilterStatement); + + if (customTargetingValuePage.results != null) { + // Get the custom targeting value ID for the comedy category. + long categoryCustomTargetingValueId = customTargetingValuePage.results[0].id; + + // Set defaults for page and filterStatement. + ContentPage page = new ContentPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + do { + // Create a statement to get all active content. + filterStatement.query = "WHERE status = 'ACTIVE' LIMIT 500 OFFSET " + offset.ToString(); + + // Get content by statement. + page = contentService.getContentByStatementAndCustomTargetingValue(filterStatement, + categoryCustomTargetingValueId); + + if (page.results != null) { + int i = page.startIndex; + foreach (Content content in page.results) { + Console.WriteLine("{0}) Content with ID \"{1}\", name \"{2}\", and status " + + "\"{3}\" was found.", i, content.id, content.name, content.status); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get content by category. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CreativeService/CopyImageCreatives.cs b/examples/Dfp/CSharp/v201306/CreativeService/CopyImageCreatives.cs new file mode 100644 index 00000000000..1b2a2bf94ea --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CreativeService/CopyImageCreatives.cs @@ -0,0 +1,127 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example copies a given set of image creatives. This would + /// typically be done to reuse creatives in a small business network. To + /// determine which creatives exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// Tags: CreativeService.createCreatives + /// + class CopyImageCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example copies a given set of image creatives. This would typically be" + + " done to reuse creatives in a small business network. To determine which creatives " + + "exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CopyImageCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201306.CreativeService); + + long[] creativeIds = new long[] {long.Parse(_T("INSERT_IMAGE_CREATIVE_ID_HERE"))}; + + // Build a comma separated list of creativeIds. Note that if you are using + // .NET 4.0 or above, you could use the newly introduced + // String.Join(string separator, IEnumerable values) method to + // perform this task. + string[] creativeIdTexts = new string[creativeIds.Length]; + for (int i = 0; i < creativeIdTexts.Length; i++) { + creativeIdTexts[i] = creativeIds[i].ToString(); + } + + string commaSeparatedCreativeIds = string.Join(",", creativeIdTexts); + + // Create the statement to filter image creatives by id. + Statement statement = new StatementBuilder( + string.Format("WHERE id IN ({0}) and creativeType = :creativeType LIMIT 500", + commaSeparatedCreativeIds)).AddValue("creativeType", "ImageCreative"). + ToStatement(); + + try { + // Retrieve all creatives which match. + CreativePage page = creativeService.getCreativesByStatement(statement); + + if (page.results != null) { + Creative[] creatives = page.results; + long[] oldIds = new long[creatives.Length]; + for (int i = 0; i < creatives.Length; i++) { + ImageCreative imageCreative = (ImageCreative) creatives[i]; + oldIds[i] = imageCreative.id; + // Since we cannot set id to null, we mark it as not specified. + imageCreative.idSpecified = false; + + imageCreative.advertiserId = imageCreative.advertiserId; + imageCreative.name = imageCreative.name + " (Copy #" + GetTimeStamp() + ")"; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + imageCreative.primaryImageAsset.assetUrl); + + creativeAsset.size = imageCreative.primaryImageAsset.size; + imageCreative.primaryImageAsset = creativeAsset; + + creatives[i] = imageCreative; + } + + // Create the copied creative. + creatives = creativeService.createCreatives(creatives); + + // Display copied creatives. + for (int i = 0; i < creatives.Length; i++) { + Console.WriteLine("Image creative with ID \"{0}\" copied to ID \"{1}\".", oldIds[i], + creatives[i].id); + } + } else { + Console.WriteLine("No creatives were copied."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to copy creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CreativeService/CreateCreativeFromTemplate.cs b/examples/Dfp/CSharp/v201306/CreativeService/CreateCreativeFromTemplate.cs new file mode 100644 index 00000000000..a7e4977b304 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CreativeService/CreateCreativeFromTemplate.cs @@ -0,0 +1,138 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates a new template creative for a given advertiser. + /// To determine which companies are advertisers, run + /// GetCompaniesByStatement.cs. To determine which creatives already exist, + /// run GetAllCreatives.cs. To determine which creative templates exist, run + /// GetAllCreativeTemplates.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCreativeFromTemplate : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new template creative for a given advertiser. To " + + "determine which companies are advertisers, run GetCompaniesByStatement.cs. To " + + "determine which creatives already exist, run GetAllCreatives.cs. To determine " + + "which creative templates exist, run GetAllCreativeTemplates.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreativeFromTemplate(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201306.CreativeService); + + // Set the ID of the advertiser (company) that all creative will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Use the image banner with optional third party tracking template. + long creativeTemplateId = 10000680L; + + // Create the local custom creative object. + TemplateCreative templateCreative = new TemplateCreative(); + templateCreative.name = "Template creative"; + templateCreative.advertiserId = advertiserId; + templateCreative.creativeTemplateId = creativeTemplateId; + + // Set the creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + templateCreative.size = size; + + // Create the asset variable value. + AssetCreativeTemplateVariableValue assetVariableValue = + new AssetCreativeTemplateVariableValue(); + assetVariableValue.uniqueName = "Imagefile"; + assetVariableValue.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + assetVariableValue.fileName = String.Format("image{0}.jpg", this.GetTimeStamp()); + + // Create the image width variable value. + LongCreativeTemplateVariableValue imageWidthVariableValue = + new LongCreativeTemplateVariableValue(); + imageWidthVariableValue.uniqueName = "Imagewidth"; + imageWidthVariableValue.value = 300; + + // Create the image height variable value. + LongCreativeTemplateVariableValue imageHeightVariableValue = + new LongCreativeTemplateVariableValue(); + imageHeightVariableValue.uniqueName = "Imageheight"; + imageHeightVariableValue.value = 250; + + // Create the URL variable value. + UrlCreativeTemplateVariableValue urlVariableValue = new UrlCreativeTemplateVariableValue(); + urlVariableValue.uniqueName = "ClickthroughURL"; + urlVariableValue.value = "www.google.com"; + + // Create the target window variable value. + StringCreativeTemplateVariableValue targetWindowVariableValue = + new StringCreativeTemplateVariableValue(); + targetWindowVariableValue.uniqueName = "Targetwindow"; + targetWindowVariableValue.value = "_blank"; + + templateCreative.creativeTemplateVariableValues = new BaseCreativeTemplateVariableValue[] { + assetVariableValue, imageWidthVariableValue, imageHeightVariableValue, urlVariableValue, + targetWindowVariableValue}; + + try { + // Create the template creative on the server. + templateCreative = (TemplateCreative) creativeService.createCreative(templateCreative); + + if (templateCreative != null) { + Console.WriteLine("A template creative with ID \"{0}\", name \"{1}\", and type \"{2}\" " + + "was created and can be previewed at {3}", templateCreative.id, templateCreative.name, + templateCreative.CreativeType, templateCreative.previewUrl); + } else { + Console.WriteLine("No creatives were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CreativeService/CreateCreatives.cs b/examples/Dfp/CSharp/v201306/CreativeService/CreateCreatives.cs new file mode 100644 index 00000000000..7fb054aa93d --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CreativeService/CreateCreatives.cs @@ -0,0 +1,120 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates new image creatives for a given advertiser. To + /// determine which companies are advertisers, run GetCompaniesByStatement.cs. + /// To determine which creatives already exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new image creatives for a given advertiser. To " + + "determine which companies are advertisers, run GetCompaniesByStatement.cs. " + + "To determine which creatives already exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201306.CreativeService); + + // Set the ID of the advertiser (company) that all creatives will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Create an array to store local image creative objects. + Creative[] imageCreatives = new ImageCreative[5]; + + for (int i = 0; i < 5; i++) { + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", i); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + imageCreatives[i] = imageCreative; + } + + try { + // Create the image creatives on the server. + imageCreatives = creativeService.createCreatives(imageCreatives); + + if (imageCreatives != null) { + foreach (Creative creative in imageCreatives) { + // Use "is" operator to determine what type of creative was + // returned. + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + Console.WriteLine("An image creative with ID ='{0}', name ='{1}' and size = " + + "({2},{3}) was created and can be previewed at: {4}", imageCreative.id, + imageCreative.name, imageCreative.size.width, imageCreative.size.height, + imageCreative.previewUrl); + } else { + Console.WriteLine("A creative with ID ='{0}', name='{1}' and type='{2}' was created.", + creative.id, creative.name, creative.CreativeType); + } + } + } else { + Console.WriteLine("No creatives created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CreativeService/CreateCustomCreative.cs b/examples/Dfp/CSharp/v201306/CreativeService/CreateCustomCreative.cs new file mode 100644 index 00000000000..32d9784ac07 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CreativeService/CreateCustomCreative.cs @@ -0,0 +1,111 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates a custom creative for a given advertiser. To + /// determine which companies are advertisers, run GetCompaniesByStatement.cs. + /// To determine which creatives already exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCustomCreative : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a custom creative for a given advertiser. To determine " + + "which companies are advertisers, run GetCompaniesByStatement.cs. To determine which " + + "creatives already exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomCreative(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201306.CreativeService); + + // Set the ID of the advertiser (company) that all creatives will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + + // Create the local custom creative object. + CustomCreative customCreative = new CustomCreative(); + customCreative.name = "Custom creative " + GetTimeStamp(); + customCreative.advertiserId = advertiserId; + customCreative.destinationUrl = "http://google.com"; + + // Set the custom creative image asset. + CustomCreativeAsset customCreativeAsset = new CustomCreativeAsset(); + customCreativeAsset.macroName = "IMAGE_ASSET"; + customCreativeAsset.fileName = string.Format("inline{0}.jpg", GetTimeStamp()); + customCreativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + customCreative.customCreativeAssets = new CustomCreativeAsset[] {customCreativeAsset}; + + // Set the HTML snippet using the custom creative asset macro. + customCreative.htmlSnippet = "" + + "" + + "
Click above for great deals!"; + + // Set the creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + customCreative.size = size; + + try { + // Create the custom creative on the server. + customCreative = (CustomCreative) creativeService.createCreative(customCreative); + + if (customCreative != null) { + Console.WriteLine("A custom creative with ID \"{0}\", name \"{1}\", and size ({2}, " + + "{3}) was created and can be previewed at {4}", customCreative.id, + customCreative.name, customCreative.size.width, customCreative.size.height, + customCreative.previewUrl); + } else { + Console.WriteLine("No creative created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CreativeService/GetAllCreatives.cs b/examples/Dfp/CSharp/v201306/CreativeService/GetAllCreatives.cs new file mode 100644 index 00000000000..074d5c337ed --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CreativeService/GetAllCreatives.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all creatives. To create creatives, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// + class GetAllCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all creatives. To create creatives, run CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201306.CreativeService); + + // Set defaults for page and Statement. + CreativePage page = new CreativePage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all creatives. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get creatives by Statement. + page = creativeService.getCreativesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Creative creative in page.results) { + Console.WriteLine("{0}) Creative with ID ='{1}', name ='{2}' and type ='{3}' " + + "was found.", i, creative.id, creative.name, creative.CreativeType); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CreativeService/GetCreative.cs b/examples/Dfp/CSharp/v201306/CreativeService/GetCreative.cs new file mode 100644 index 00000000000..20bc24c45fa --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CreativeService/GetCreative.cs @@ -0,0 +1,77 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets a creative by its ID. To determine which creatives + /// exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.getCreative + /// + class GetCreative : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a creative by its ID. To determine which creatives " + + "exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code sample as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreative(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201306.CreativeService); + + // Set the ID of the creative to get. + long creativeId = long.Parse(_T("INSERT_CREATIVE_ID_HERE")); + + try { + // Get the creative. + Creative creative = creativeService.getCreative(creativeId); + + if (creative != null) { + Console.WriteLine("Creative with ID ='{0}', name ='{1}' and type ='{2}' " + + "was found.", creative.id, creative.name, creative.CreativeType); + } else { + Console.WriteLine("No creative found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get creative. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CreativeService/GetCreativesByStatement.cs b/examples/Dfp/CSharp/v201306/CreativeService/GetCreativesByStatement.cs new file mode 100644 index 00000000000..457ee39f80b --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CreativeService/GetCreativesByStatement.cs @@ -0,0 +1,86 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all image creatives. The Statement retrieves up to + /// the maximum page size limit of 500. To create an image creative, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// + class GetCreativesByStatement : SampleBase { + /// + /// Returns a description about the sample code. + /// + public override string Description { + get { + return "This code example gets all image creatives. The Statement retrieves up to the " + + "maximum page size limit of 500. To create an image creative, run " + + "CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201306.CreativeService); + + // Create a Statement to only select image creatives. + Statement statement = new StatementBuilder("WHERE creativeType = :creativeType LIMIT 500"). + AddValue("creativeType", "ImageCreative").ToStatement(); + + try { + // Get creatives by Statement. + CreativePage page = creativeService.getCreativesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Creative creative in page.results) { + Console.WriteLine("{0}) Creative with ID ='{1}', name ='{2}' and type ='{3}' " + + "was found.", i, creative.id, creative.name, creative.CreativeType); + i++; + } + } + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get creatives by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CreativeService/UpdateCreatives.cs b/examples/Dfp/CSharp/v201306/CreativeService/UpdateCreatives.cs new file mode 100644 index 00000000000..6252cf1a61b --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CreativeService/UpdateCreatives.cs @@ -0,0 +1,104 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all image creatives. The Statement retrieves up to + /// the maximum page size limit of 500. To create an image creative, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// Tags: CreativeService.updateCreatives + /// + class UpdateCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all image creatives. The Statement retrieves up to the " + + "maximum page size limit of 500. To create an image creative, run " + + "CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201306.CreativeService); + + // Create a Statement to get all image creatives. + Statement statement = new StatementBuilder("WHERE creativeType = :creativeType LIMIT 500"). + AddValue("creativeType", "ImageCreative").ToStatement(); + + try { + // Get creatives by Statement. + CreativePage page = creativeService.getCreativesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + Creative[] creatives = page.results; + + // Update each local creative object by changing its destination URL. + foreach (Creative creative in creatives) { + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + imageCreative.destinationUrl = "http://news.google.com"; + } + } + + // Update the creatives on the server. + creatives = creativeService.updateCreatives(creatives); + + if (creatives != null) { + foreach (Creative creative in creatives) { + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + Console.WriteLine("An image creative with ID = '{0}' and destination URL ='{1}' " + + "was updated.", imageCreative.id, imageCreative.destinationUrl); + } + } + } else { + Console.WriteLine("No creatives updated."); + } + } else { + Console.WriteLine("No creatives found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CreativeTemplateService/GetAllCreativeTemplates.cs b/examples/Dfp/CSharp/v201306/CreativeTemplateService/GetAllCreativeTemplates.cs new file mode 100644 index 00000000000..984664fd137 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CreativeTemplateService/GetAllCreativeTemplates.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all creative templates. + /// + /// Tags: CreativeTemplateService.getCreativeTemplatesByStatement + /// + class GetAllCreativeTemplates : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all creative templates."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreativeTemplates(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201306.CreativeTemplateService); + + // Set defaults for page and filterStatement. + CreativeTemplatePage page = new CreativeTemplatePage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all creative templates. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get creative templates by statement. + page = creativeTemplateService.getCreativeTemplatesByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CreativeTemplate creativeTemplate in page.results) { + Console.WriteLine("{0}) Creative template with ID \"{1}\", name \"{2}\", and type " + + "\"{3}\" was found.", i, creativeTemplate.id, creativeTemplate.name, + creativeTemplate.type); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CreativeTemplateService/GetCreativeTemplate.cs b/examples/Dfp/CSharp/v201306/CreativeTemplateService/GetCreativeTemplate.cs new file mode 100644 index 00000000000..daa7ed5d29c --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CreativeTemplateService/GetCreativeTemplate.cs @@ -0,0 +1,87 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets a creative by its ID. To determine which creative + /// templates exist, run GetAllCreativeTemplates.cs. + /// + /// Tags: CreativeTemplateService.getCreativeTemplate + /// + class GetCreativeTemplate : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a creative by its ID. To determine which creative " + + "templates exist, run GetAllCreativeTemplates.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeTemplate(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201306.CreativeTemplateService); + + // Set the ID of the creative template to get. + long creativeTemplateId = long.Parse(_T("INSERT_CREATIVE_TEMPLATE_ID_HERE")); + + try { + // Get the creative template. + CreativeTemplate creativeTemplate = creativeTemplateService.getCreativeTemplate( + creativeTemplateId); + + if (creativeTemplate != null) { + Console.WriteLine("Creative template with ID \"{0}\", name \"{1}\", and type \"{2}\" " + + "was found.", creativeTemplate.id, creativeTemplate.name, creativeTemplate.type); + if (creativeTemplate.variables != null) { + foreach (CreativeTemplateVariable variable in creativeTemplate.variables) { + Console.WriteLine("Variable with name \"{0}\" is {1}.", variable.uniqueName, + variable.isRequired ? "required." : "optional."); + } + } + } else { + Console.WriteLine("No creative template found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CreativeTemplateService/GetCreativeTemplatesByStatement.cs b/examples/Dfp/CSharp/v201306/CreativeTemplateService/GetCreativeTemplatesByStatement.cs new file mode 100644 index 00000000000..1c9d267f870 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CreativeTemplateService/GetCreativeTemplatesByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets up to 500 system defined creative templates. + /// + /// Tags: CreativeTemplateService.getCreativeTemplatesByStatement + /// + class GetCreativeTemplatesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets up to 500 system defined creative templates."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeTemplatesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201306.CreativeTemplateService); + + // Create a statement to only select system defined creative templates. + Statement filterStatement = + new StatementBuilder("WHERE type = :creativeTemplateType LIMIT 500").AddValue( + "creativeTemplateType", CreativeTemplateType.SYSTEM_DEFINED.ToString()).ToStatement(); + + try { + // Get creative templates by statement. + CreativeTemplatePage page = creativeTemplateService.getCreativeTemplatesByStatement( + filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CreativeTemplate creativeTemplate in page.results) { + Console.WriteLine("{0}) Creative template with ID \"{1}\", name \"{2}\", and type " + + "\"{3}\" was found.", i, creativeTemplate.id, creativeTemplate.name, + creativeTemplate.type); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CreativeWrapperService/CreateCreativeWrappers.cs b/examples/Dfp/CSharp/v201306/CreativeWrapperService/CreateCreativeWrappers.cs new file mode 100644 index 00000000000..619cc530c94 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CreativeWrapperService/CreateCreativeWrappers.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates a new creative wrapper. Creative wrappers must + /// be associated with a LabelType.CREATIVE_WRAPPER label and applied to ad + /// units by AdUnit.appliedLabels. To determine which creative wrappers exist, + /// run GetAllCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.createCreativeWrappers + /// + class CreateCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new creative wrapper. Creative wrappers must be " + + "associated with a LabelType.CREATIVE_WRAPPER label and applied to ad units by " + + "AdUnit.appliedLabels. To determine which creative wrappers exist, run " + + "GetAllCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201306.CreativeWrapperService); + + long labelId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE")); + + // Create creative wrapper objects. + CreativeWrapper creativeWrapper = new CreativeWrapper(); + creativeWrapper.labelId = labelId; + creativeWrapper.ordering = CreativeWrapperOrdering.INNER; + creativeWrapper.header = new CreativeWrapperHtmlSnippet(); + creativeWrapper.header.htmlSnippet = "My creative wrapper header"; + creativeWrapper.footer = new CreativeWrapperHtmlSnippet(); + creativeWrapper.footer.htmlSnippet = "My creative wrapper footer"; + + try { + // Add creative wrapper. + CreativeWrapper[] creativeWrappers = creativeWrapperService.createCreativeWrappers( + new CreativeWrapper[] {creativeWrapper}); + + // Display results. + foreach (CreativeWrapper wrapper in creativeWrappers) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' was " + + "created.", wrapper.id, wrapper.labelId); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creative wrappers. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CreativeWrapperService/DeactivateCreativeWrappers.cs b/examples/Dfp/CSharp/v201306/CreativeWrapperService/DeactivateCreativeWrappers.cs new file mode 100644 index 00000000000..dd798c7dfc0 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CreativeWrapperService/DeactivateCreativeWrappers.cs @@ -0,0 +1,95 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using Google.Api.Ads.Dfp.Util.v201306; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example deactivates a creative wrapper belonging to a label. + /// + /// Tags: CreativeWrapperService.getCreativeWrapperByStatement + /// Tags: CreativeWrapperService.performCreativeWrapperAction + /// + class DeActivateCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates a creative wrapper belonging to a label."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeActivateCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201306.CreativeWrapperService); + + long labelId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE")); + + try { + // Create a query to select the active creative wrapper for the given + // label. + Statement statement = new StatementBuilder("WHERE status = :status AND labelId = :labelId") + .AddValue("labelId", labelId) + .AddValue("status", CreativeWrapperStatus.ACTIVE.ToString()) + .ToStatement(); + CreativeWrapperPage page = creativeWrapperService.getCreativeWrappersByStatement(statement); + CreativeWrapper[] creativeWrappers = page.results; + if (creativeWrappers != null) { + foreach (CreativeWrapper wrapper in creativeWrappers) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' with " + + "status \'{2}\' will be deactivated.", wrapper.id, wrapper.labelId, wrapper.status); + } + Console.WriteLine("Number of creative wrappers to be deactivated: {0}", + creativeWrappers.Length); + + // Perform action. + CreativeWrapperAction action = new DeactivateCreativeWrappers(); + UpdateResult result = + creativeWrapperService.performCreativeWrapperAction(action, statement); + + // Display results. + if (result.numChanges > 0) { + Console.WriteLine("Number of creative wrappers deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No creative wrappers were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creative wrappers. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CreativeWrapperService/GetActiveCreativeWrappers.cs b/examples/Dfp/CSharp/v201306/CreativeWrapperService/GetActiveCreativeWrappers.cs new file mode 100644 index 00000000000..d13b8a20a3e --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CreativeWrapperService/GetActiveCreativeWrappers.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using Google.Api.Ads.Dfp.Util.v201306; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all active creative wrappers. To create + /// creative wrappers, run CreateCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.getCreativeWrapperByStatement + /// + class GetActiveCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active creative wrappers. To create creative " + + "wrappers, run CreateCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActiveCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201306.CreativeWrapperService); + + // Set defaults for page and Statement. + CreativeWrapperPage page = new CreativeWrapperPage(); + Statement statement = new StatementBuilder("") + .AddValue("status", CreativeWrapperStatus.ACTIVE.ToString()) + .ToStatement(); + int offset = 0; + + try { + do { + // Create a Statement to get all active creative wrappers. + statement.query = string.Format("WHERE status = :status LIMIT 500 OFFSET {0}", offset); + + // Get creative wrappers by Statement. + page = creativeWrapperService.getCreativeWrappersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (CreativeWrapper wrapper in page.results) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' with " + + "status \'{2}\' was found.", wrapper.id, wrapper.labelId, wrapper.status); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get active creative wrappers. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CreativeWrapperService/GetAllCreativeWrappers.cs b/examples/Dfp/CSharp/v201306/CreativeWrapperService/GetAllCreativeWrappers.cs new file mode 100644 index 00000000000..9064cb0c445 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CreativeWrapperService/GetAllCreativeWrappers.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using Google.Api.Ads.Dfp.Util.v201306; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all creative wrappers. To create creative wrappers, + /// run CreateCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.getCreativeWrapperByStatement + /// + class GetAllCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active creative wrappers. To create creative " + + "wrappers, run CreateCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201306.CreativeWrapperService); + + // Set defaults for page and Statement. + CreativeWrapperPage page = new CreativeWrapperPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all creative wrappers. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get creative wrappers by Statement. + page = creativeWrapperService.getCreativeWrappersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (CreativeWrapper wrapper in page.results) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' with " + + "status \'{2}\' was found.", wrapper.id, wrapper.labelId, wrapper.status); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get active creative wrappers. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CreativeWrapperService/UpdateCreativeWrappers.cs b/examples/Dfp/CSharp/v201306/CreativeWrapperService/UpdateCreativeWrappers.cs new file mode 100644 index 00000000000..48f66cfdc75 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CreativeWrapperService/UpdateCreativeWrappers.cs @@ -0,0 +1,84 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using Google.Api.Ads.Dfp.Util.v201306; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example updates a creative wrapper to the 'OUTER' wrapping + /// order. To determine which creative wrappers exist, run + /// GetAllCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.getCreativeWrapper + /// Tags: CreativeWrapperService.updateCreativeWrappers + /// + class UpdateCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active creative wrappers. To create creative " + + "wrappers, run CreateCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201306.CreativeWrapperService); + + long creativeWrapperId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_ID_HERE")); + + try { + CreativeWrapper wrapper = creativeWrapperService.getCreativeWrapper(creativeWrapperId); + if (wrapper != null) { + wrapper.ordering = CreativeWrapperOrdering.OUTER; + // Update the creative wrappers on the server. + CreativeWrapper[] creativeWrappers = creativeWrapperService.updateCreativeWrappers( + new CreativeWrapper[] {wrapper}); + + // Display results. + Console.WriteLine("Creative wrapper with ID '{0}' and wrapping order '{1}' was " + + "updated.", creativeWrappers[0].id, creativeWrappers[0].ordering); + } else { + Console.WriteLine("No creative wrappers found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update creative wrappers. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CustomFieldService/CreateCustomFieldOptions.cs b/examples/Dfp/CSharp/v201306/CustomFieldService/CreateCustomFieldOptions.cs new file mode 100644 index 00000000000..1c0e68f1030 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CustomFieldService/CreateCustomFieldOptions.cs @@ -0,0 +1,97 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates custom field options for a drop-down custom + /// field. Once created, custom field options can be found under the options + /// fields of the drop-down custom field and they cannot be deleted. To + /// determine which custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.createCustomFieldOptions + /// + class CreateCustomFieldOptions : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates custom field options for a drop-down custom field. " + + "Once created, custom field options can be found under the options fields of the " + + "drop-down custom field and they cannot be deleted. To determine which custom " + + "fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomFieldOptions(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = + (CustomFieldService) user.GetService(DfpService.v201306.CustomFieldService); + + // Set the ID of the drop-down custom field to create options for. + long customFieldId = long.Parse(_T("INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE")); + + // Create custom field options. + CustomFieldOption customFieldOption1 = new CustomFieldOption(); + customFieldOption1.displayName = "Approved"; + customFieldOption1.customFieldId = customFieldId; + + CustomFieldOption customFieldOption2 = new CustomFieldOption(); + customFieldOption2.displayName = "Unapproved"; + customFieldOption2.customFieldId = customFieldId; + + try { + // Add custom field options. + CustomFieldOption[] customFieldOptions = + customFieldService.createCustomFieldOptions(new CustomFieldOption[] {customFieldOption1, + customFieldOption2}); + + // Display results. + if (customFieldOptions != null) { + foreach (CustomFieldOption customFieldOption in customFieldOptions) { + Console.WriteLine("Custom field option with ID \"{0}\" and name \"{1}\" was created.", + customFieldOption.id, customFieldOption.displayName); + } + } else { + Console.WriteLine("No custom field options created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom field options. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CustomFieldService/CreateCustomFields.cs b/examples/Dfp/CSharp/v201306/CustomFieldService/CreateCustomFields.cs new file mode 100644 index 00000000000..023fae95245 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CustomFieldService/CreateCustomFields.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates custom fields. To determine which custom fields + /// exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.createCustomFields + /// + class CreateCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates custom fields. To determine which custom fields exist" + + ", run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201306.CustomFieldService); + + // Create custom fields. + CustomField customField1 = new CustomField(); + customField1.name = "Customer comments #" + GetTimeStamp(); + customField1.entityType = CustomFieldEntityType.LINE_ITEM; + customField1.dataType = CustomFieldDataType.STRING; + customField1.visibility = CustomFieldVisibility.FULL; + + CustomField customField2 = new CustomField(); + customField2.name = "Internal approval status #" + GetTimeStamp(); + customField2.entityType = CustomFieldEntityType.LINE_ITEM; + customField2.dataType = CustomFieldDataType.DROP_DOWN; + customField2.visibility = CustomFieldVisibility.FULL; + + try { + // Add custom fields. + CustomField[] customFields = + customFieldService.createCustomFields(new CustomField[] {customField1, customField2}); + + // Display results. + if (customFields != null) { + foreach (CustomField customField in customFields) { + Console.WriteLine("Custom field with ID \"{0}\" and name \"{1}\" was created.", + customField.id, customField.name); + } + } else { + Console.WriteLine("No custom fields created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CustomFieldService/DeactivateAllLineItemCustomFields.cs b/examples/Dfp/CSharp/v201306/CustomFieldService/DeactivateAllLineItemCustomFields.cs new file mode 100644 index 00000000000..4f880f40b09 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CustomFieldService/DeactivateAllLineItemCustomFields.cs @@ -0,0 +1,122 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using Google.Api.Ads.Dfp.Util.v201306; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example deactivates all active line item custom fields. To + /// determine which custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// Tags: CustomFieldService.performCustomFieldAction + /// + class DeactivateAllLineItemCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active line item custom fields. To determine " + + "which custom fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateAllLineItemCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201306.CustomFieldService); + + // Create statement to select only active custom fields that apply to + // line items. + String statementText = "WHERE entityType = :entityType and isActive = :isActive LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText) + .AddValue("entityType", CustomFieldEntityType.LINE_ITEM.ToString()) + .AddValue("isActive", true) + .ToStatement(); + + // Set defaults for page and offset. + CustomFieldPage page = new CustomFieldPage(); + int offset = 0; + int i = 0; + List customFieldIds = new List(); + + try { + do { + // Create a statement to page through custom fields. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(filterStatement); + + if (page.results != null) { + foreach (CustomField customField in page.results) { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" will be " + + "deactivated.", i, customField.id, customField.name); + customFieldIds.Add(customField.id.ToString()); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of custom fields to be deactivated: " + customFieldIds.Count); + + if (customFieldIds.Count > 0) { + // Modify statement for action. + filterStatement.query = "WHERE id IN (" + string.Join(", ", customFieldIds.ToArray()) + + ")"; + + // Create action. + DeactivateCustomFields action = new DeactivateCustomFields(); + + // Perform action. + UpdateResult result = customFieldService.performCustomFieldAction( + action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of custom fields deactivated: " + result.numChanges); + } else { + Console.WriteLine("No custom fields were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CustomFieldService/GetAllCustomFields.cs b/examples/Dfp/CSharp/v201306/CustomFieldService/GetAllCustomFields.cs new file mode 100644 index 00000000000..117d576f12d --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CustomFieldService/GetAllCustomFields.cs @@ -0,0 +1,107 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using Google.Api.Ads.Dfp.Util.v201306; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all custom fields. To create custom fields, run + /// CreateCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// Tags: CustomFieldService.performCustomFieldAction + /// + class GetAllCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom fields. To create custom fields, run " + + "CreateCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201306.CustomFieldService); + + // Sets defaults for page and filter. + CustomFieldPage page = new CustomFieldPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all custom fields. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomField customField in page.results) { + if (customField is DropDownCustomField) { + List dropDownCustomFieldStrings = new List(); + DropDownCustomField dropDownCustomField = (DropDownCustomField) customField; + if (dropDownCustomField.options != null) { + foreach (CustomFieldOption customFieldOption in dropDownCustomField.options) { + dropDownCustomFieldStrings.Add(customFieldOption.displayName); + } + } + Console.WriteLine("{0}) Drop-down custom field with ID \"{1}\", name \"{2}\", " + + "and options {{{3}}} was found.", i, customField.id, customField.name, + string.Join(", ", dropDownCustomFieldStrings.ToArray())); + } else { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" was found.", + i, customField.id, customField.name); + } + i++; + } + } + + offset += 500; + } while (page.results != null && page.results.Length == 500); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CustomFieldService/GetAllLineItemCustomFields.cs b/examples/Dfp/CSharp/v201306/CustomFieldService/GetAllLineItemCustomFields.cs new file mode 100644 index 00000000000..2d311c3a166 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CustomFieldService/GetAllLineItemCustomFields.cs @@ -0,0 +1,97 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using Google.Api.Ads.Dfp.Util.v201306; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all custom fields that apply to line items. To + /// create custom fields, run CreateCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// + class GetAllLineItemCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom fields that apply to line items. To create " + + "custom fields, run CreateCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLineItemCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201306.CustomFieldService); + + // Create statement to select only custom fields that apply to line items. + String statementText = "WHERE entityType = :entityType LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText) + .AddValue("entityType", CustomFieldEntityType.LINE_ITEM.ToString()) + .ToStatement(); + + // Set defaults for page and offset. + CustomFieldPage page = new CustomFieldPage(); + int offset = 0; + int i = 0; + + try { + do { + // Create a statement to page through custom fields. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(filterStatement); + + if (page.results != null) { + foreach (CustomField customField in page.results) { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" was found.", i, + customField.id, customField.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all line item custom fields. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CustomFieldService/SetLineItemCustomFieldValue.cs b/examples/Dfp/CSharp/v201306/CustomFieldService/SetLineItemCustomFieldValue.cs new file mode 100644 index 00000000000..0bc5e45b67d --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CustomFieldService/SetLineItemCustomFieldValue.cs @@ -0,0 +1,148 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using Google.Api.Ads.Dfp.Util.v201306; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example sets custom field values on a line item. To determine + /// which custom fields exist, run GetAllCustomFields.cs. To create custom + /// field options, run CreateCustomFieldOptions.cs. To determine which line + /// items exist, run GetAllLineItems.cs. + /// + /// Tags: CustomFieldService.getCustomField + /// Tags: LineItemService.getLineItem + /// Tags: LineItemService.updateLineItems + /// + class SetLineItemCustomFieldValue : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example sets custom field values on a line item. To determine which " + + "custom fields exist, run GetAllCustomFields.cs. To create custom field options, " + + "run CreateCustomFieldOptions.cs. To determine which line items exist, run " + + "GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new SetLineItemCustomFieldValue(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201306.CustomFieldService); + + // Get the LineItemService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201306.LineItemService); + + // Set the IDs of the custom fields, custom field option, and line item. + long customFieldId = long.Parse(_T("INSERT_STRING_CUSTOM_FIELD_ID_HERE")); + long dropDownCustomFieldId = long.Parse(_T("INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE")); + long customFieldOptionId = long.Parse(_T("INSERT_CUSTOM_FIELD_OPTION_ID_HERE")); + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get the custom field. + CustomField customField = customFieldService.getCustomField(customFieldId); + + // Get the drop-down custom field. + DropDownCustomField dropDownCustomField = + (DropDownCustomField) customFieldService.getCustomField(dropDownCustomFieldId); + + // Get the line item. + LineItem lineItem = lineItemService.getLineItem(lineItemId); + + // Create custom field values. + List customFieldValues = new List(); + TextValue textValue = new TextValue(); + textValue.value = "Custom field value"; + + CustomFieldValue customFieldValue = new CustomFieldValue(); + customFieldValue.customFieldId = customFieldId; + customFieldValue.value = textValue; + customFieldValues.Add(customFieldValue); + + DropDownCustomFieldValue dropDownCustomFieldValue = new DropDownCustomFieldValue(); + dropDownCustomFieldValue.customFieldId = dropDownCustomFieldId; + dropDownCustomFieldValue.customFieldOptionId = customFieldOptionId; + customFieldValues.Add(dropDownCustomFieldValue); + + // Only add existing custom field values for different custom fields than + // the ones you are setting. + if (lineItem.customFieldValues != null) { + foreach (BaseCustomFieldValue oldCustomFieldValue in lineItem.customFieldValues) { + if (!(oldCustomFieldValue.customFieldId == customFieldId) + && !(oldCustomFieldValue.customFieldId == dropDownCustomFieldId)) { + customFieldValues.Add(oldCustomFieldValue); + } + } + } + + lineItem.customFieldValues = customFieldValues.ToArray(); + + // Update the line item on the server. + LineItem[] lineItems = lineItemService.updateLineItems(new LineItem[] {lineItem}); + + if (lineItems != null) { + foreach (LineItem updatedLineItem in lineItems) { + List customFieldValueStrings = new List(); + foreach (BaseCustomFieldValue baseCustomFieldValue in lineItem.customFieldValues) { + if (baseCustomFieldValue is CustomFieldValue + && ((CustomFieldValue) baseCustomFieldValue).value is TextValue) { + customFieldValueStrings.Add("{ID: '" + baseCustomFieldValue.customFieldId + + "', value: '" + + ((TextValue) ((CustomFieldValue) baseCustomFieldValue).value).value + + "'}"); + } else if (baseCustomFieldValue is DropDownCustomFieldValue) { + customFieldValueStrings.Add("{ID: '" + baseCustomFieldValue.customFieldId + + "', custom field option ID: '" + + ((DropDownCustomFieldValue) baseCustomFieldValue).customFieldOptionId + + "'}"); + } + } + Console.WriteLine("A line item with ID \"{0}\" set with custom field values \"{1}\".", + updatedLineItem.id, string.Join(", ", customFieldValueStrings.ToArray())); + } + } else { + Console.WriteLine("No line items were updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CustomFieldService/UpdateCustomFields.cs b/examples/Dfp/CSharp/v201306/CustomFieldService/UpdateCustomFields.cs new file mode 100644 index 00000000000..e885ce1e771 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CustomFieldService/UpdateCustomFields.cs @@ -0,0 +1,95 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using Google.Api.Ads.Dfp.Util.v201306; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example updates custom field descriptions. To determine which + /// custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.updateCustomFields + /// + class UpdateCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates custom field descriptions. To determine which custom " + + "fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201306.CustomFieldService); + + // Set the ID of the custom field to update. + long customFieldId = long.Parse(_T("INSERT_CUSTOM_FIELD_ID_HERE")); + + try { + // Get the custom field. + CustomField customField = customFieldService.getCustomField(customFieldId); + + if (customField != null) { + customField.description = + (customField.description == null ? "" : customField.description + " Updated"); + + // Update the custom field on the server. + CustomField[] customFields = + customFieldService.updateCustomFields(new CustomField[] {customField}); + + // Display results + if (customFields != null) { + foreach (CustomField updatedCustomField in customFields) { + Console.WriteLine("Custom field with ID \"{0}\", name \"{1}\", and description " + + "\"{2}\" was updated.", updatedCustomField.id, updatedCustomField.name, + updatedCustomField.description); + } + } else { + Console.WriteLine("No custom fields were updated."); + } + } else { + Console.WriteLine("No custom fields found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs b/examples/Dfp/CSharp/v201306/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs new file mode 100644 index 00000000000..f1708069ac9 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs @@ -0,0 +1,158 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates new custom targeting keys and values. To + /// determine which custom targeting keys and values exist, run + /// GetAllCustomTargetingKeysAndValues.cs. To target these custom targeting + /// keys and values, run TargetCustomCriteria.cs. + /// + /// Tags: CustomTargetingService.createCustomTargetingKeys + /// Tags: CustomTargetingService.createCustomTargetingValues + /// + class CreateCustomTargetingKeysAndValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new custom targeting keys and values. To determine " + + "which custom targeting keys and values exist, run " + + "GetAllCustomTargetingKeysAndValues.cs. To target these custom targeting keys and " + + "values, run TargetCustomCriteria.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomTargetingKeysAndValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201306.CustomTargetingService); + + // Create predefined key. + CustomTargetingKey genderKey = new CustomTargetingKey(); + genderKey.displayName = "gender"; + genderKey.name = "g"; + genderKey.type = CustomTargetingKeyType.PREDEFINED; + + // Create predefined key that may be used for content targeting. + CustomTargetingKey genreKey = new CustomTargetingKey(); + genreKey.displayName = "genre"; + genreKey.name = "genre"; + genreKey.type = CustomTargetingKeyType.PREDEFINED; + + // Create free-form key. + CustomTargetingKey carModelKey = new CustomTargetingKey(); + carModelKey.displayName = "car model"; + carModelKey.name = "c"; + carModelKey.type = CustomTargetingKeyType.FREEFORM; + + try { + // Create the custom targeting keys on the server. + CustomTargetingKey[] keys = customTargetingService.createCustomTargetingKeys( + new CustomTargetingKey[] {genderKey, genreKey, carModelKey}); + + if (keys != null) { + foreach (CustomTargetingKey key in keys) { + Console.WriteLine("A custom targeting key with ID \"{0}\", name \"{1}\", and display " + + "name \"{2}\" was created.", key.id, key.name, key.displayName); + } + } else { + Console.WriteLine("No keys were created."); + } + + // Create custom targeting value for the predefined gender key. + CustomTargetingValue genderMaleValue = new CustomTargetingValue(); + genderMaleValue.customTargetingKeyId = keys[0].id; + genderMaleValue.displayName = "male"; + // Name is set to 1 so that the actual name can be hidden from website + // users. + genderMaleValue.name = "1"; + genderMaleValue.matchType = CustomTargetingValueMatchType.EXACT; + + CustomTargetingValue genderFemaleValue = new CustomTargetingValue(); + genderFemaleValue.customTargetingKeyId = keys[0].id; + genderFemaleValue.displayName = "female"; + // Name is set to 2 so that the actual name can be hidden from website + // users. + genderFemaleValue.name = "2"; + genderFemaleValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create custom targeting value for the predefined genre key. + CustomTargetingValue genreComedyValue = new CustomTargetingValue(); + genreComedyValue.customTargetingKeyId = keys[1].id; + genreComedyValue.displayName = "comedy"; + genreComedyValue.name = "comedy"; + genreComedyValue.matchType = CustomTargetingValueMatchType.EXACT; + + CustomTargetingValue genreDramaValue = new CustomTargetingValue(); + genreDramaValue.customTargetingKeyId = keys[1].id; + genreDramaValue.displayName = "drama"; + genreDramaValue.name = "drama"; + genreDramaValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create custom targeting value for the free-form age key. These are + // values that would be suggested in the UI or can be used when + // targeting with a FreeFormCustomCriteria. + CustomTargetingValue carModelHondaCivicValue = new CustomTargetingValue(); + carModelHondaCivicValue.customTargetingKeyId = keys[2].id; + carModelHondaCivicValue.displayName = "honda civic"; + carModelHondaCivicValue.name = "honda civic"; + // Setting match type to exact will match exactly "honda civic". + carModelHondaCivicValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create the custom targeting values on the server. + CustomTargetingValue[] returnValues = customTargetingService.createCustomTargetingValues( + new CustomTargetingValue[] {genderMaleValue, genderFemaleValue, genreComedyValue, + genreDramaValue, carModelHondaCivicValue}); + + if (returnValues != null) { + foreach (CustomTargetingValue value in returnValues) { + Console.WriteLine("A custom targeting value with ID \"{0}\", belonging to key with " + + "ID \"{1}\", name \"{2}\", and display name \"{3}\" was created.", value.id, + value.customTargetingKeyId, value.name, value.displayName); + } + } else { + Console.WriteLine("No values were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom targeting keys and values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs b/examples/Dfp/CSharp/v201306/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs new file mode 100644 index 00000000000..65bd74cafb2 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs @@ -0,0 +1,122 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all custom targeting keys and the values. To create + /// custom targeting keys and values, run + /// CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// + class GetAllCustomTargetingKeysAndValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom targeting keys and the values. To create " + + "custom targeting keys and values, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCustomTargetingKeysAndValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201306.CustomTargetingService); + + // Sets defaults for page and filter. + CustomTargetingKeyPage keyPage = new CustomTargetingKeyPage(); + Statement keyFilterStatement = new Statement(); + int keyOffset = 0; + + try { + do { + // Create a statement to get all custom targeting keys. + keyFilterStatement.query = "LIMIT 500 OFFSET " + keyOffset; + + // Get custom targeting keys by statement. + keyPage = customTargetingService.getCustomTargetingKeysByStatement(keyFilterStatement); + + if (keyPage.results != null) { + int i = keyPage.startIndex; + foreach (CustomTargetingKey key in keyPage.results) { + Console.WriteLine("{0}) Custom targeting key with ID \"{1}\", name \"{2}\", " + + "display name \"{3}\", and type \"{4}\" was found.", i, key.id, key.name, + key.displayName, key.type); + + + // Sets defaults for page and filter. + CustomTargetingValuePage valuePage = new CustomTargetingValuePage(); + Statement valueFilterStatement = new Statement(); + int valueOffset = 0; + + do { + // Create a statement to get all custom targeting values for a + // custom targeting key (required) by its ID. + valueFilterStatement.query = string.Format("WHERE customTargetingKeyId = {0} " + + "LIMIT 500 OFFSET {1}", key.id, valueOffset); + + // Get custom targeting values by statement. + valuePage = customTargetingService.getCustomTargetingValuesByStatement( + valueFilterStatement); + + if (valuePage.results != null) { + int j = valuePage.startIndex; + foreach (CustomTargetingValue value in valuePage.results) { + Console.WriteLine("\t{0}) Custom targeting value with ID \"{1}\", name " + + "\"{2}\", and display name \"{3}\" was found.", j, value.id, value.name, + value.displayName); + j++; + } + } + valueOffset += 500; + } while (valuePage.results != null && valuePage.results.Length == 500); + i++; + } + } + keyOffset += 500; + } while (keyPage.results != null && keyPage.results.Length == 500); + Console.WriteLine("Number of results found: {0}", keyPage.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get custom targeting keys and the values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CustomTargetingService/GetCustomTargetingKeysByStatement.cs b/examples/Dfp/CSharp/v201306/CustomTargetingService/GetCustomTargetingKeysByStatement.cs new file mode 100644 index 00000000000..b4202b985c0 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CustomTargetingService/GetCustomTargetingKeysByStatement.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all predefined custom targeting keys. The statement + /// retrieves up to the maximum page size limit of 500. To create custom + /// targeting keys, run CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// + class GetCustomTargetingKeysByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all predefined custom targeting keys. The statement " + + "retrieves up to the maximum page size limit of 500. To create custom " + + "targeting keys, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCustomTargetingKeysByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201306.CustomTargetingService); + + try { + // Create a statement to only select predefined custom targeting keys. + Statement filterStatement = new StatementBuilder("WHERE type = :type LIMIT 500").AddValue( + "type", CustomTargetingKeyType.PREDEFINED.ToString()).ToStatement(); + + // Get custom targeting keys by statement. + CustomTargetingKeyPage page = + customTargetingService.getCustomTargetingKeysByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomTargetingKey customTargetingKey in page.results) { + Console.WriteLine("{0}) Custom targeting key with ID \"{1}\", name \"{2}\", and " + + "display name \"{3}\" was found.", i, customTargetingKey.id, + customTargetingKey.name, customTargetingKey.displayName); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get predefined custom targeting keys. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CustomTargetingService/GetCustomTargetingValuesByStatement.cs b/examples/Dfp/CSharp/v201306/CustomTargetingService/GetCustomTargetingValuesByStatement.cs new file mode 100644 index 00000000000..2b151a28d62 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CustomTargetingService/GetCustomTargetingValuesByStatement.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets custom targeting values for the given predefined + /// custom targeting key. The statement retrieves up to the maximum page size + /// limit of 500. To create custom targeting values, run + /// CreateCustomTargetingKeysAndValues.cs. To determine which custom + /// targeting keys exist, run GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// + class GetCustomTargetingValuesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets custom targeting values for the given predefined custom " + + "targeting key. The statement retrieves up to the maximum page size limit of 500. " + + "To create custom targeting values, run CreateCustomTargetingKeysAndValues.cs. To " + + "determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCustomTargetingValuesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201306.CustomTargetingService); + + // Set the ID of the custom targeting key to get custom targeting values + // for. + long customTargetingKeyId = long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + + // Create a statement to only select custom targeting values for a given + // key. + Statement filterStatement = + new StatementBuilder("WHERE customTargetingKeyId = :customTargetingKeyId LIMIT 500") + .AddValue("customTargetingKeyId", customTargetingKeyId).ToStatement(); + + try { + // Get custom targeting values by statement. + CustomTargetingValuePage page = + customTargetingService.getCustomTargetingValuesByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomTargetingValue customTargetingValue in page.results) { + Console.WriteLine("{0}) Custom targeting value with ID \"{1}\", name \"{2}\", and " + + "display name \"{3}\" was found.", i, customTargetingValue.id, + customTargetingValue.name, customTargetingValue.displayName); + i++; + } + } + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get custom targeting values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CustomTargetingService/UpdateCustomTargetingKeys.cs b/examples/Dfp/CSharp/v201306/CustomTargetingService/UpdateCustomTargetingKeys.cs new file mode 100644 index 00000000000..97706e752ab --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CustomTargetingService/UpdateCustomTargetingKeys.cs @@ -0,0 +1,107 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example updates the display name of each custom targeting key up + /// to the first 500. To determine which custom targeting keys exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// Tags: CustomTargetingService.updateCustomTargetingKeys + /// + class UpdateCustomTargetingKeys : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the display name of each custom targeting key up " + + "to the first 500. To determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomTargetingKeys(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201306.CustomTargetingService); + + // Create a statement to get all custom targeting keys. + Statement filterStatement = new Statement(); + filterStatement.query = "LIMIT 500"; + + try { + // Get custom targeting keys by statement. + CustomTargetingKeyPage page = + customTargetingService.getCustomTargetingKeysByStatement(filterStatement); + + if (page.results != null) { + CustomTargetingKey[] customTargetingKeys = page.results; + + // Update each local custom targeting key object by changing its display + // name. + foreach (CustomTargetingKey customTargetingKey in customTargetingKeys) { + if (customTargetingKey.displayName == null) { + customTargetingKey.displayName = customTargetingKey.name; + } + customTargetingKey.displayName = customTargetingKey.displayName + " (Deprecated)"; + } + + // Update the custom targeting keys on the server. + customTargetingKeys = + customTargetingService.updateCustomTargetingKeys(customTargetingKeys); + + if (customTargetingKeys != null) { + foreach (CustomTargetingKey customTargetingKey in customTargetingKeys) { + Console.WriteLine("Custom targeting key with ID \"{0}\", name \"{1}\", and " + + "display name \"{2}\" was updated.", customTargetingKey.id, + customTargetingKey.name, customTargetingKey.displayName); + } + } else { + Console.WriteLine("No custom targeting keys updated."); + } + } else { + Console.WriteLine("No custom targeting keys found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update display name of custom targeting keys. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/CustomTargetingService/UpdateCustomTargetingValues.cs b/examples/Dfp/CSharp/v201306/CustomTargetingService/UpdateCustomTargetingValues.cs new file mode 100644 index 00000000000..407ea889a51 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/CustomTargetingService/UpdateCustomTargetingValues.cs @@ -0,0 +1,113 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example updates the display name of each custom targeting value + /// up to the first 500. To determine which custom targeting keys exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// Tags: CustomTargetingService.updateCustomTargetingValues + /// + class UpdateCustomTargetingValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the display name of each custom targeting value up to " + + "the first 500. To determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomTargetingValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201306.CustomTargetingService); + + // Set the ID of the predefined custom targeting key to get custom + // targeting values for. + long customTargetingKeyId = long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + + // Create a statement to only select predefined custom targeting values + // for a given key. + Statement filterStatement = + new StatementBuilder("WHERE customTargetingKeyId = :customTargetingKeyId LIMIT 500") + .AddValue("customTargetingKeyId", customTargetingKeyId).ToStatement(); + + try { + // Get custom targeting values by statement. + CustomTargetingValuePage page = + customTargetingService.getCustomTargetingValuesByStatement(filterStatement); + + if (page.results != null) { + CustomTargetingValue[] customTargetingValues = page.results; + + // Update each local custom targeting value object by changing its + // display name. + foreach (CustomTargetingValue customTargetingValue in customTargetingValues) { + if (customTargetingValue.displayName == null) { + customTargetingValue.displayName = customTargetingValue.displayName; + } + customTargetingValue.displayName = customTargetingValue.displayName + " (Deprecated)"; + } + + // Update the custom targeting values on the server. + customTargetingValues = + customTargetingService.updateCustomTargetingValues(customTargetingValues); + + if (customTargetingValues != null) { + foreach (CustomTargetingValue customTargetingValue in customTargetingValues) { + Console.WriteLine("Custom targeting value with ID \"{0}\", name \"{1}\", and " + + "display name \"{2}\" was updated.", customTargetingValue.id, + customTargetingValue.name, customTargetingValue.displayName); + } + } else { + Console.WriteLine("No custom targeting values updated."); + } + } else { + Console.WriteLine("No custom targeting values found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update display names of custom targeting values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ForecastService/GetForecast.cs b/examples/Dfp/CSharp/v201306/ForecastService/GetForecast.cs new file mode 100644 index 00000000000..ebc2080ee41 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ForecastService/GetForecast.cs @@ -0,0 +1,111 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets a forecast for a prospective line item. To + /// determine which placements exist, run GetAllPlacements.cs. + /// + /// Tags: ForecastService.getForecast + /// + class GetForecast : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a forecast for a prospective line item. To determine " + + "which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetForecast(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ForecastService. + ForecastService forecastService = + (ForecastService)user.GetService(DfpService.v201306.ForecastService); + + // Set the placement that the prospective line item will target. + long[] targetPlacementIds = new long[] {long.Parse(_T("INSERT_PLACEMENT_ID_HERE"))}; + + // Set the end date time to have the line line item run till. + string endDateTime = "INSERT_END_DATE_TIME_HERE (yyyyMMdd HH:mm:ss)"; + + // Create prospective line item. + LineItem lineItem = new LineItem(); + + lineItem.targeting = new Targeting(); + lineItem.targeting.inventoryTargeting = new InventoryTargeting(); + lineItem.targeting.inventoryTargeting.targetedPlacementIds = targetPlacementIds; + + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + lineItem.lineItemType = LineItemType.SPONSORSHIP; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + + lineItem.endDateTime = DateTimeUtilities.FromString(endDateTime); + + // Set the cost type to match the unit type. + lineItem.costType = CostType.CPM; + + try { + // Get forecast. + Forecast forecast = forecastService.getForecast(lineItem); + + // Display results. + long matched = forecast.matchedUnits; + double availablePercent = (double) (forecast.availableUnits / (matched * 1.0)) * 100; + String unitType = forecast.unitType.ToString().ToLower(); + Console.WriteLine("{0} {1} matched.\n{2}% available.", matched, unitType, + availablePercent, unitType); + + if (forecast.possibleUnitsSpecified) { + double possiblePercent = (double) (forecast.possibleUnits / (matched * 1.0)) * 100; + Console.WriteLine("{0}% {1} possible.\n", possiblePercent, unitType); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get forecast. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ForecastService/GetForecastById.cs b/examples/Dfp/CSharp/v201306/ForecastService/GetForecastById.cs new file mode 100644 index 00000000000..e0d4f4d676c --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ForecastService/GetForecastById.cs @@ -0,0 +1,82 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets a forecast for an existing line item. To determine + /// which line items exist, run GetAllLineItems.cs. + /// + /// Tags: ForecastService.getForecastById + /// + class GetForecastById : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a forecast for an existing line item. To determine which " + + "line items exist, run GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetForecastById(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ForecastService. + ForecastService forecastService = + (ForecastService) user.GetService(DfpService.v201306.ForecastService); + + // Set the line item to get a forecast for. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get forecast for line item. + Forecast forecast = forecastService.getForecastById(lineItemId); + + // Display results. + long matched = forecast.matchedUnits; + double availablePercent = (double) (forecast.availableUnits / (matched * 1.0)) * 100; + String unitType = forecast.unitType.ToString().ToLower(); + + Console.WriteLine("{0} {1} matched.\n{2} % {3} available.", matched, unitType, + availablePercent, unitType); + if (forecast.possibleUnitsSpecified) { + double possiblePercent = (double) (forecast.possibleUnits / (matched * 1.0)) * 100; + Console.WriteLine(possiblePercent + "% " + unitType + " possible.\n"); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get forecast by id. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/InventoryService/CreateAdUnits.cs b/examples/Dfp/CSharp/v201306/InventoryService/CreateAdUnits.cs new file mode 100644 index 00000000000..6389a4afd75 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/InventoryService/CreateAdUnits.cs @@ -0,0 +1,108 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates new ad units under the effective root ad unit. + /// To determine which ad units exist, run GetAdUnitTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.createAdUnits, NetworkService.getCurrentNetwork + /// + class CreateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new ad units under the effective root ad unit. To " + + "determine which ad units exist, run GetAdUnitTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201306.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201306.NetworkService); + + string effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create an array to store local ad unit objects. + AdUnit[] adUnits = new AdUnit[5]; + + for (int i = 0; i < 5; i++) { + AdUnit adUnit = new AdUnit(); + adUnit.name = string.Format("Ad_Unit_{0}", i); + adUnit.parentId = effectiveRootAdUnitId; + + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + + // Set the size of possible creatives that can match this ad unit. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + adUnits[i] = adUnit; + } + + try { + // Create the ad units on the server. + adUnits = inventoryService.createAdUnits(adUnits); + + if (adUnits != null) { + foreach (AdUnit adUnit in adUnits) { + Console.WriteLine("An ad unit with ID = '{0}' was created under parent with " + + "ID = '{1}'.", adUnit.id, adUnit.parentId); + } + } else { + Console.WriteLine("No ad units created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/InventoryService/CreateMobileAdUnit.cs b/examples/Dfp/CSharp/v201306/InventoryService/CreateMobileAdUnit.cs new file mode 100644 index 00000000000..3fe95f69f1a --- /dev/null +++ b/examples/Dfp/CSharp/v201306/InventoryService/CreateMobileAdUnit.cs @@ -0,0 +1,104 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates a new mobile ad unit under the effective root + /// ad unit. Mobile features need to be enabled on your account to use mobile + /// targeting. To determine which ad units exist, run GetInventoryTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.createAdUnits, NetworkService.getCurrentNetwork + /// + class CreateMobileAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new mobile ad unit under the effective ad unit. " + + "Mobile features need to be enabled on your account to use mobile targeting. To " + + "determine which ad units exist, run GetInventoryTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateMobileAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201306.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201306.NetworkService); + + // Set the parent ad unit's ID for all ad units to be created under. + String effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create local ad unit object. + AdUnit adUnit = new AdUnit(); + adUnit.name = "Mobile_Ad_Unit"; + adUnit.parentId = effectiveRootAdUnitId; + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + adUnit.targetPlatform = TargetPlatform.MOBILE; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + Size size = new Size(); + size.width = 400; + size.height = 300; + size.isAspectRatio = false; + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + // Set the size of possible creatives that can match this ad unit. + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + + try { + // Create the ad unit on the server. + adUnit = inventoryService.createAdUnit(adUnit); + + if (adUnit != null) { + Console.WriteLine("An ad unit with ID \"{0}\" was created under parent with ID \"{1}\".", + adUnit.id, adUnit.parentId); + } else { + Console.WriteLine("No ad units created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/InventoryService/CreateVideoAdUnit.cs b/examples/Dfp/CSharp/v201306/InventoryService/CreateVideoAdUnit.cs new file mode 100644 index 00000000000..7808c02e5e9 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/InventoryService/CreateVideoAdUnit.cs @@ -0,0 +1,123 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates a new video ad unit under the effective root + /// ad unit. To determine which ad units exist, run GetInventoryTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.CreateVideoAdUnit, NetworkService.getCurrentNetwork + /// + class CreateVideoAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new ad units under the effective root ad unit. To " + + "determine which ad units exist, run GetAdUnitTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateVideoAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201306.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201306.NetworkService); + + // Set the parent ad unit's ID for all ad units to be created under. + String effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create local ad unit object. + AdUnit adUnit = new AdUnit(); + adUnit.name = "Video_Ad_Unit"; + adUnit.parentId = effectiveRootAdUnitId; + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + adUnit.explicitlyTargeted = true; + adUnit.targetPlatform = TargetPlatform.WEB; + + // Create master ad unit size. + AdUnitSize masterAdUnitSize = new AdUnitSize(); + Size size1 = new Size(); + size1.width = 400; + size1.height = 300; + size1.isAspectRatio = false; + masterAdUnitSize.size = size1; + masterAdUnitSize.environmentType = EnvironmentType.VIDEO_PLAYER; + + // Create companion sizes. + AdUnitSize companionAdUnitSize1 = new AdUnitSize(); + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + size2.isAspectRatio = false; + companionAdUnitSize1.size = size2; + companionAdUnitSize1.environmentType = EnvironmentType.BROWSER; + + AdUnitSize companionAdUnitSize2 = new AdUnitSize(); + Size size3 = new Size(); + size3.width = 728; + size3.height = 90; + size3.isAspectRatio = false; + companionAdUnitSize2.size = size3; + companionAdUnitSize2.environmentType = EnvironmentType.BROWSER; + + // Add companions to master ad unit size. + masterAdUnitSize.companions = new AdUnitSize[] {companionAdUnitSize1, companionAdUnitSize2}; + + // Set the size of possible creatives that can match this ad unit. + adUnit.adUnitSizes = new AdUnitSize[] {masterAdUnitSize}; + + try { + // Create the ad unit on the server. + adUnit = inventoryService.createAdUnit(adUnit); + + if (adUnit != null) { + Console.WriteLine("A video ad unit with ID \"{0}\" was created under parent with ID " + + "\"{1}\".", adUnit.id, adUnit.parentId); + } else { + Console.WriteLine("No video ad units created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create video ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/InventoryService/DeActivateAdUnits.cs b/examples/Dfp/CSharp/v201306/InventoryService/DeActivateAdUnits.cs new file mode 100644 index 00000000000..e69d7bb0616 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/InventoryService/DeActivateAdUnits.cs @@ -0,0 +1,120 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example deactivates all active ad units. To determine which ad + /// units exist, run GetAllAdUnits.cs or GetInventoryTree.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: InventoryService.performAdUnitAction + /// + class DeActivateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active ad units. To determine which ad units " + + "exist, run GetAllAdUnits.cs or GetInventoryTree.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeActivateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201306.InventoryService); + + // Create Statement text to select active ad units. + string statementText = "WHERE status = :status LIMIT 500"; + + Statement statement = new StatementBuilder("").AddValue("status", + InventoryStatus.ACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + AdUnitPage page = new AdUnitPage(); + int offset = 0; + List adUnitIds = new List(); + + try { + do { + // Create a Statement to page through active ad units. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID ='{1}', name = {2} and status = {3} will" + + " be deactivated.", i, adUnit.id, adUnit.name, adUnit.status); + adUnitIds.Add(adUnit.id); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of ad units to be deactivated: {0}", adUnitIds.Count); + + if (adUnitIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", adUnitIds.ToArray()))). + ToStatement(); + + // Create action. + DeactivateAdUnits action = new DeactivateAdUnits(); + + // Perform action. + UpdateResult result = inventoryService.performAdUnitAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of ad units deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No ad units were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/InventoryService/GetAdUnit.cs b/examples/Dfp/CSharp/v201306/InventoryService/GetAdUnit.cs new file mode 100644 index 00000000000..b5eaefc5805 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/InventoryService/GetAdUnit.cs @@ -0,0 +1,77 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets an ad unit by its ID. To determine which ad units + /// exist, run GetInventoryTree.cs or GetAllAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnit + /// + class GetAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets an ad unit by its ID. To determine which ad units " + + "exist, run GetInventoryTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201306.InventoryService); + + // Set the ID of the ad unit to get. + String adUnitId = _T("INSERT_AD_UNIT_ID_HERE"); + + try { + // Get the ad unit. + AdUnit adUnit = inventoryService.getAdUnit(adUnitId); + + if (adUnit != null) { + Console.WriteLine("Ad unit with ID = '{0}', name = '{1}' and status = '{2}' was found.", + adUnit.id, adUnit.name, adUnit.status); + } else { + Console.WriteLine("No ad unit found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/InventoryService/GetAdUnitSizes.cs b/examples/Dfp/CSharp/v201306/InventoryService/GetAdUnitSizes.cs new file mode 100644 index 00000000000..3199b6a2f79 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/InventoryService/GetAdUnitSizes.cs @@ -0,0 +1,80 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; +using Google.Api.Ads.Dfp.Util.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all web target platform ad unit sizes. + /// + /// Tags: InventoryService.getAdUnitSizesByStatement + /// + class GetAdUnitSizes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all web target platform ad unit sizes."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnitSizes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201306.InventoryService); + + Statement filterStatement = new StatementBuilder("WHERE targetPlatform = :targetPlatform"). + AddValue("targetPlatform", "WEB").ToStatement(); + + try { + // Get all ad unit sizes. + AdUnitSize[] adUnitSizes = inventoryService.getAdUnitSizesByStatement(filterStatement); + + // Display results. + if (adUnitSizes != null) { + for (int i = 0; i < adUnitSizes.Length; i++) { + AdUnitSize adUnitSize = adUnitSizes[i]; + Console.WriteLine("{0}) Ad unit size ({1}x{2}) was found.\n", i, + adUnitSize.size.width, adUnitSize.size.height); + } + } else { + Console.WriteLine("No ad unit sizes found."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit sizes. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/InventoryService/GetAdUnitsByStatement.cs b/examples/Dfp/CSharp/v201306/InventoryService/GetAdUnitsByStatement.cs new file mode 100644 index 00000000000..6f6a991ba20 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/InventoryService/GetAdUnitsByStatement.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets the root ad unit. To create an ad unit, run + /// CreateAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: NetworkService.getCurrentNetwork + /// + class GetAdUnitsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the root ad unit. To create an ad unit, run " + + "CreateAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnitsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201306.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201306.NetworkService); + + // Get the effective root ad unit ID of the network. + string effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create a statement to select the children of the effective root ad + // unit. + Statement statement = new StatementBuilder("WHERE parentId = :id LIMIT 1").AddValue( + "id", effectiveRootAdUnitId).ToStatement(); + + try { + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID = '{1}', name = '{2}' and status = '{3}' " + + "was found.", i, adUnit.id, adUnit.name, adUnit.status); + i++; + } + } + + // The number of results should always be 1 for this code example. + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/InventoryService/GetAllAdUnits.cs b/examples/Dfp/CSharp/v201306/InventoryService/GetAllAdUnits.cs new file mode 100644 index 00000000000..bf9032f962c --- /dev/null +++ b/examples/Dfp/CSharp/v201306/InventoryService/GetAllAdUnits.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all ad units. To create ad units, run + /// CreateAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// + class GetAllAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all ad units. To create ad units, run CreateAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201306.InventoryService); + + // Sets defaults for page and statement. + AdUnitPage page = new AdUnitPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all ad units. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID = '{1}', name = '{2}' and status = '{3}' " + + "was found.", i, adUnit.id, adUnit.name, adUnit.status); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/InventoryService/GetInventoryTree.cs b/examples/Dfp/CSharp/v201306/InventoryService/GetInventoryTree.cs new file mode 100644 index 00000000000..189fe37a94d --- /dev/null +++ b/examples/Dfp/CSharp/v201306/InventoryService/GetInventoryTree.cs @@ -0,0 +1,203 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example retrieves a previously created ad units and creates + /// a tree. + /// + /// Tags: InventoryService.getAdUnit, InventoryService.getAdUnitsByStatement + /// + class GetInventoryTree : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves a previously created ad units and creates a tree."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetInventoryTree(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + try { + // Get all ad units. + AdUnit[] allAdUnits = GetAllAdUnits(user); + + // Find the root ad unit. rootAdUnit can also be set to child unit to + // only build and display a portion of the tree. + // i.e. AdUnit adUnit = + // inventoryService.getAdUnit("INSERT_AD_UNIT_HERE") + AdUnit rootAdUnit = FindRootAdUnit(user); + + if (rootAdUnit == null) { + Console.WriteLine("Could not build tree. No root ad unit found."); + } else { + BuildAndDisplayAdUnitTree(rootAdUnit, allAdUnits); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + + /// + /// Gets all ad units for this user. + /// + /// The DfpUser to get the ad units for. + /// All ad units for this user. + private static AdUnit[] GetAllAdUnits(DfpUser user) { + // Create list to hold all ad units. + List adUnits = new List(); + + // Get InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201306.InventoryService); + + // Sets defaults for page and Statement. + AdUnitPage page = new AdUnitPage(); + Statement statement = new Statement(); + int offset = 0; + + do { + // Create a Statement to get all ad units. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + adUnits.AddRange(page.results); + } + offset += 500; + } while (page.results != null && page.results.Length == 500); + return adUnits.ToArray(); + } + + /// + /// Finds the root ad unit for the user. + /// + /// The DfpUser to get the root ad unit for. + /// The ad unit representing the root ad unit or null if one + /// is not found. + private static AdUnit FindRootAdUnit(DfpUser user) { + // Get InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201306.InventoryService); + + // Create a Statement to only select the root ad unit. + Statement statement = new Statement(); + statement.query = "WHERE parentId IS NULL LIMIT 500"; + + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + return page.results[0]; + } + return null; + } + + /// + /// Builds and displays an ad unit tree from an array of ad units underneath + /// the root ad unit. + /// + /// The root ad unit to build the tree under. + /// The array of ad units. + private static void BuildAndDisplayAdUnitTree(AdUnit root, AdUnit[] units) { + Dictionary> treeMap = new Dictionary>(); + + foreach (AdUnit unit in units) { + if (unit.parentId != null) { + if (treeMap.ContainsKey(unit.parentId) == false) { + treeMap.Add(unit.parentId, new List()); + } + treeMap[unit.parentId].Add(unit); + } + } + + if (root != null) { + DisplayInventoryTree(root, treeMap); + } else { + Console.WriteLine("No root unit found."); + } + } + + /// + /// Displays the ad unit tree beginning at the root ad unit. + /// + /// The root ad unit + /// The map of id to list of ad units + private static void DisplayInventoryTree(AdUnit root, Dictionary> treeMap) { + DisplayInventoryTreeHelper(root, treeMap, 0); + } + + /// + /// Helper for displaying inventory units. + /// + /// The root inventory unit. + /// The map of id to List of inventory units. + /// The depth the tree has reached. + private static void DisplayInventoryTreeHelper(AdUnit root, + Dictionary> treeMap, int depth) { + Console.WriteLine(GenerateTab(depth) + root.name + " (" + root.id + ")"); + + if (treeMap.ContainsKey(root.id)) { + foreach (AdUnit child in treeMap[root.id]) { + DisplayInventoryTreeHelper(child, treeMap, depth + 1); + } + } + } + + /// + /// Generates a String of tabs to represent branching to children. + /// + /// A depth from 0 to max(depth). + /// A string to insert in front of the root unit. + private static String GenerateTab(int depth) { + StringBuilder builder = new StringBuilder(); + if (depth != 0) { + builder.Append(" "); + } + + for (int i = 1; i < depth; i++) { + builder.Append("| "); + } + builder.Append("+--"); + return builder.ToString(); + } + } +} diff --git a/examples/Dfp/CSharp/v201306/InventoryService/UpdateAdUnits.cs b/examples/Dfp/CSharp/v201306/InventoryService/UpdateAdUnits.cs new file mode 100644 index 00000000000..7a550987be7 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/InventoryService/UpdateAdUnits.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example updates an ad unit by enabling AdSense to the first + /// 500. To determine which ad units exist, run GetAllAdUnits.cs or + /// GetInventoryTree.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement, InventoryService.updateAdUnits + /// + class UpdateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates an ad unit by enabling AdSense to the first 500. To " + + "determine which ad units exist, run GetAllAdUnits.cs or GetInventoryTree.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the sample code. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201306.InventoryService); + + // Create a statement to get all ad units. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get ad units by statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null) { + // Update each local ad unit object by enabling AdSense. + foreach (AdUnit adUnit in page.results) { + adUnit.inheritedAdSenseSettings.value.adSenseEnabled = true; + } + + // Update the ad units on the server. + AdUnit[] updatedAdUnits = inventoryService.updateAdUnits(page.results); + + if (updatedAdUnits != null) { + foreach (AdUnit adUnit in updatedAdUnits) { + Console.WriteLine("Ad unit with ID \"{0}\", name \"{1}\", and is AdSense enabled " + + "\"{2}\" was updated.", adUnit.id, adUnit.name, + adUnit.inheritedAdSenseSettings.value.adSenseEnabled); + } + } else { + Console.WriteLine("No ad units updated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to update ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LabelService/CreateLabels.cs b/examples/Dfp/CSharp/v201306/LabelService/CreateLabels.cs new file mode 100644 index 00000000000..7addef05b8a --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LabelService/CreateLabels.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates new labels. To determine which labels exist, run + /// GetAllLabels.cs. This feature is only available to DFP premium solution + /// networks. + /// + /// Tags: LabelService.createLabels + /// + class CreateLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new labels. To determine which labels exist, run " + + "GetAllLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201306.LabelService); + + try { + // Create an array to store local label objects. + Label[] labels = new Label[5]; + + for (int i = 0; i < 5; i++) { + Label label = new Label(); + label.name = "Label #" + GetTimeStamp(); + label.types = new LabelType[] {LabelType.COMPETITIVE_EXCLUSION}; + labels[i] = label; + } + + // Create the labels on the server. + labels = labelService.createLabels(labels); + + if (labels != null) { + foreach (Label label in labels) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("A label with ID '{0}', name '{1}', and type '{2}' was created.", + label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + } + } else { + Console.WriteLine("No labels created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LabelService/DeactivateActiveLabels.cs b/examples/Dfp/CSharp/v201306/LabelService/DeactivateActiveLabels.cs new file mode 100644 index 00000000000..7774ccf493d --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LabelService/DeactivateActiveLabels.cs @@ -0,0 +1,116 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example deactivates all active labels. To determine which labels + /// exist, run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement, LabelService.performLabelAction + /// + class DeactivateActiveLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active labels. To determine which labels exist," + + " run GetAllLabels.cs. This feature is only available to DFP premium solution " + + "networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateActiveLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201306.LabelService); + + // Create statement text to select active labels. + String statementText = "WHERE isActive = :isActive LIMIT 500"; + Statement filterStatement = new StatementBuilder("").AddValue("isActive", true).ToStatement(); + + // Set defaults for page and offset. + LabelPage page = new LabelPage(); + int offset = 0; + List labelIds = new List(); + + try { + do { + // Create a statement to page through active labels. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get labels by statement. + page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + Console.WriteLine("{0}) Label with ID '{1}', name '{2}' will be deactivated.", + i, label.id, label.name); + labelIds.Add(label.id.ToString()); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of labels to be deactivated: " + labelIds.Count); + + if (labelIds.Count > 0) { + // Modify statement for action. + filterStatement.query = "WHERE id IN (" + string.Join(", ", labelIds.ToArray()) + ")"; + + // Create action. + DeactivateLabels action = new DeactivateLabels(); + + // Perform action. + UpdateResult result = labelService.performLabelAction(action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of labels deactivated: " + result.numChanges); + } else { + Console.WriteLine("No labels were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LabelService/GetAllLabels.cs b/examples/Dfp/CSharp/v201306/LabelService/GetAllLabels.cs new file mode 100644 index 00000000000..d3cea79a92f --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LabelService/GetAllLabels.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all labels. To create labels, run CreateLabels.cs. + /// This feature is only available to DFP premium solution networks. + /// + /// Tags: LabelService.getLabelsByStatement + /// + class GetAllLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all labels. To create labels, run CreateLabels.cs. This " + + "feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201306.LabelService); + + // Set defaults for page and filterStatement. + LabelPage page = new LabelPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all labels. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get labels by statement. + page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("{0}) Label with ID '{1}', name '{2}' and type '{3}' was found.", + i, label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LabelService/GetLabel.cs b/examples/Dfp/CSharp/v201306/LabelService/GetLabel.cs new file mode 100644 index 00000000000..268e7f0482f --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LabelService/GetLabel.cs @@ -0,0 +1,83 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets a label by its ID. To determine which labels exist, + /// run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabel + /// + class GetLabel : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a label by its ID. To determine which labels exist, " + + "run GetAllLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLabel(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201306.LabelService); + + // Set the ID of the label to get. + long labelId = long.Parse(_T("INSERT_LABEL_ID_HERE")); + + try { + // Get the label. + Label label = labelService.getLabel(labelId); + + if (label != null) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + Console.WriteLine("Label with ID '{0}, name '{1}' and type '{2}' was found.", + label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + } else { + Console.WriteLine("No label found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get label. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LabelService/GetLabelsByStatement.cs b/examples/Dfp/CSharp/v201306/LabelService/GetLabelsByStatement.cs new file mode 100644 index 00000000000..e5bca531ed5 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LabelService/GetLabelsByStatement.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all labels that are competitively excluded. The + /// statement retrieves up to the maximum page size limit of 500. To create + /// labels, run CreateLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement + /// + class GetLabelsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all labels that are competitively excluded. The statement " + + "retrieves up to the maximum page size limit of 500. To create labels, run " + + "CreateLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLabelsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201306.LabelService); + + // Create a statement to only select labels that are competitive + // sorted by name. + Statement filterStatement = new StatementBuilder("WHERE type = :type ORDER BY name LIMIT 500") + .AddValue("type", LabelType.COMPETITIVE_EXCLUSION.ToString()).ToStatement(); + + try { + // Get labels by statement. + LabelPage page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("{0}) Label with ID '{1}', name '{2}'and type '{3}' was found.", + i, label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LabelService/UpdateLabels.cs b/examples/Dfp/CSharp/v201306/LabelService/UpdateLabels.cs new file mode 100644 index 00000000000..64016e3a4a2 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LabelService/UpdateLabels.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example updates the descriptions of all active labels by + /// updating its description up to the first 500. To determine which labels + /// exist, run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement, LabelService.updateLabels + /// + class UpdateLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the descriptions of all active labels by updating " + + "its description up to the first 500. To determine which labels exist, run " + + "GetAllLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201306.LabelService); + + // Create a statement to only select labels that are competitive + // exclusion. + Statement filterStatement = new StatementBuilder("WHERE isActive = :isActive LIMIT 500"). + AddValue("isActive", true).ToStatement(); + + try { + // Get the labels by statement. + LabelPage page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + Label[] labels = page.results; + + // Update each local label object by updating its description. + foreach (Label label in labels) { + label.description = "These labels are still competiting with each other."; + } + + // Update the labels on the server. + labels = labelService.updateLabels(labels); + + if (labels != null) { + foreach (Label label in labels) { + Console.WriteLine("A label with ID '{0}' and name '{1}' was updated.", + label.id, label.name); + } + } else { + Console.WriteLine("No labels updated."); + } + } else { + Console.WriteLine("No labels found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/ActivateLicas.cs b/examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/ActivateLicas.cs new file mode 100644 index 00000000000..47923c72f3f --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/ActivateLicas.cs @@ -0,0 +1,125 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example activates all deactivated LICAs for the line item. To + /// determine which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.performLineItemCreativeAssociationAction + /// + class ActivateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example activates all deactivated LICAs for the line item. To " + + "determine which LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ActivateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201306.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + String statementText = "WHERE lineItemId = :lineItemId and status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("lineItemId", lineItemId). + AddValue("status", LineItemCreativeAssociationStatus.INACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + int offset = 0; + List creativeIds = new List(); + + try { + do { + // Create a Statement to page through active LICAs. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' will be activated.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + creativeIds.Add(lica.creativeId.ToString()); + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of LICAs to be activated: {0}", creativeIds.Count); + + if (creativeIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE lineItemId = :lineItemId and creativeId IN ({0})", + string.Join(",", creativeIds.ToArray()))). + AddValue("lineItemId", lineItemId).ToStatement(); + + // Create action. + ActivateLineItemCreativeAssociations action = + new ActivateLineItemCreativeAssociations(); + + // Perform action. + UpdateResult result = + licaService.performLineItemCreativeAssociationAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of LICAs activated: {0}", result.numChanges); + } else { + Console.WriteLine("No LICAs were activated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to activate LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/CreateLicas.cs b/examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/CreateLicas.cs new file mode 100644 index 00000000000..a50966aef7b --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/CreateLicas.cs @@ -0,0 +1,108 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates new line item creative associations (LICAs) for + /// an existing line item and a set of creative ids. For small business + /// networks, the creative ids must represent new or copied creatives as + /// creatives cannot be used for more than one line item. For premium + /// solution networks, the creative ids can represent any creative. To copy + /// creatives, run CopyImageCreatives.cs. To determine which LICAs exist, run + /// GetAllLicasExample.cs. + /// + /// Tags: LineItemCreativeAssociationService.createLineItemCreativeAssociations + /// + class CreateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new line item creative associations (LICAs) for an " + + "existing line item and a set of creative ids. For small business networks, the " + + "creative ids must represent new or copied creatives as creatives cannot be used " + + "for more than one line item. For premium solution networks, the creative ids can " + + "represent any creative. To copy creatives, run CopyImageCreatives.cs. To determine " + + "which LICAs exist, run GetAllLicasExample.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = + (LineItemCreativeAssociationService) user.GetService( + DfpService.v201306.LineItemCreativeAssociationService); + + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201306.CreativeService); + + // Set the line item ID and creative IDs to associate. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long[] creativeIds = new long[] {long.Parse(_T("INSERT_CREATIVE_ID_HERE"))}; + + // Create an array to store local LICA objects. + LineItemCreativeAssociation[] licas = new LineItemCreativeAssociation[creativeIds.Length]; + + // For each line item, associate it with the given creative. + int i = 0; + foreach (long creativeId in creativeIds) { + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId; + lica.lineItemId = lineItemId; + licas[i++] = lica; + } + + try { + // Create the LICAs on the server. + licas = licaService.createLineItemCreativeAssociations(licas); + + if (licas != null) { + foreach (LineItemCreativeAssociation lica in licas) { + Console.WriteLine("A LICA with line item ID \"{0}\", creative ID \"{1}\", and status " + + "\"{2}\" was created.", lica.lineItemId, lica.creativeId, lica.status); + } + } else { + Console.WriteLine("No LICAs created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to associate creative with line item. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/DeactivateLicas.cs b/examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/DeactivateLicas.cs new file mode 100644 index 00000000000..660f768b654 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/DeactivateLicas.cs @@ -0,0 +1,125 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example deactivates all LICAs for the line item. To determine + /// which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.performLineItemCreativeAssociationAction + /// + class DeactivateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all LICAs for the line item. To determine which " + + "LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201306.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + String statementText = "WHERE lineItemId = :lineItemId and status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("lineItemId", lineItemId). + AddValue("status", LineItemCreativeAssociationStatus.ACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + int offset = 0; + List creativeIds = new List(); + + try { + do { + // Create a Statement to page through active LICAs. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' will be deactivated.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + creativeIds.Add(lica.creativeId.ToString()); + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of LICAs to be deactivated: {0}", creativeIds.Count); + + if (creativeIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE lineItemId = :lineItemId and creativeId IN ({0})", + string.Join(",", creativeIds.ToArray()))). + AddValue("lineItemId", lineItemId).ToStatement(); + + // Create action. + DeactivateLineItemCreativeAssociations action = + new DeactivateLineItemCreativeAssociations(); + + // Perform action. + UpdateResult result = + licaService.performLineItemCreativeAssociationAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of LICAs deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No LICAs were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/GetAllLicas.cs b/examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/GetAllLicas.cs new file mode 100644 index 00000000000..378789d0b12 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/GetAllLicas.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all line item creative associations (LICA). To + /// create LICAs, run CreateLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// + class GetAllLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line item creative associations (LICA). To create " + + "LICAs, run CreateLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201306.LineItemCreativeAssociationService); + + // Sets defaults for page and Statement. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all LICAs. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' was found.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + } + } + + offset += 500; + } while (page.results != null && page.results.Length == 500); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/GetLica.cs b/examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/GetLica.cs new file mode 100644 index 00000000000..b62cc0adcc6 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/GetLica.cs @@ -0,0 +1,81 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets a line item creative association (LICA) by the line + /// item and creative ID. To determine which line items exist, run + /// GetAllLineItems.cs. To determine which creatives exit, run + /// GetAllCreatives.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociation + /// + class GetLica : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a line item creative association (LICA) by the line " + + "item and creative ID. To determine which line items exist, run " + + "GetAllLineItems.cs. To determine which creatives exit, run " + + "GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + new GetLica().Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201306.LineItemCreativeAssociationService); + + // Set the line item and creative ID to use to retrieve the LICA. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long creativeId = long.Parse(_T("INSERT_CREATIVE_ID_HERE")); + + try { + // Get the LICA. + LineItemCreativeAssociation lica = + licaService.getLineItemCreativeAssociation(lineItemId, creativeId); + + if (lica != null) { + Console.WriteLine("LICA with line item ID = {0}, creative ID = '{1}' and status = " + + "'{2}' was found", lica.lineItemId, lica.creativeId, lica.status); + } else { + Console.WriteLine("No LICA found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get LICA. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/GetLicasByStatement.cs b/examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/GetLicasByStatement.cs new file mode 100644 index 00000000000..4c9b758101b --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/GetLicasByStatement.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all line item creative associations for a given + /// line item ID. The Statement retrieves up to the maximum page size limit of + /// 500. To create LICAs, run CreateLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// + class GetLicasByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line item creative associations for a given line " + + "item ID. The Statement retrieves up to the maximum page size limit of 500. To " + + "create LICAs, run CreateLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLicasByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201306.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + // Create a Statement to only select LICAs for the given lineItem ID. + Statement statement = new StatementBuilder("WHERE lineItemId = :lineItemId LIMIT 500"). + AddValue("lineItemId", lineItemId).ToStatement(); + + try { + // Get LICAs by Statement. + LineItemCreativeAssociationPage page = + licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' was found.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/UpdateLicas.cs b/examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/UpdateLicas.cs new file mode 100644 index 00000000000..a91aaf70bea --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LineItemCreativeAssociationService/UpdateLicas.cs @@ -0,0 +1,97 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example updates the destination URL of all LICAs up to the first + /// 500. To determine which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.updateLineItemCreativeAssociations + /// + class UpdateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the destination URL of all LICAs up to the first " + + "500. To determine which LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201306.LineItemCreativeAssociationService); + + // Create a Statement to get all LICAs. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get LICAs by Statement. + LineItemCreativeAssociationPage page = + licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + LineItemCreativeAssociation[] licas = page.results; + + // Update each local LICA object by changing its destination URL. + foreach (LineItemCreativeAssociation lica in licas) { + lica.destinationUrl = "http://news.google.com"; + } + + // Update the LICAs on the server. + licas = licaService.updateLineItemCreativeAssociations(licas); + + if (licas != null) { + foreach (LineItemCreativeAssociation lica in licas) { + Console.WriteLine("LICA with line item ID = '{0}, creative ID ='{1}' and " + + "destination URL '{2}' was updated.", lica.lineItemId, lica.creativeId, + lica.destinationUrl); + } + } else { + Console.WriteLine("No LICAs updated."); + } + } else { + Console.WriteLine("No LICAs found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LineItemService/ActivateLineItem.cs b/examples/Dfp/CSharp/v201306/LineItemService/ActivateLineItem.cs new file mode 100644 index 00000000000..7c8bd474036 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LineItemService/ActivateLineItem.cs @@ -0,0 +1,134 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example activates all line items for the given order. To be + /// activated, line items need to be in the approved (needs creatives) state + /// and have at least one creative associated with them. To approve line + /// items, approve the order to which they belong by running ApproveOrders.cs. + /// To create LICAs, run CreateLicas.cs. To determine which line items exist, + /// run GetAllLineItem.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.performLineItemAction + /// + class ActivateLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example activates all line items for the given order. To be activated," + + " line items need to be in the approved (needs creatives) state and have at least one" + + " creative associated with them. To approve line items, approve the order to which" + + " they belong by running ApproveOrders.cs. To create LICAs, run CreateLicas.cs." + + " To determine which line items exist, run GetAllLineItem.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ActivateLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201306.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create Statement text to select approved line items from a given order. + string statementText = "WHERE orderId = :orderId and status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("orderId", orderId). + AddValue("status", ComputedStatus.NEEDS_CREATIVES.ToString()).ToStatement(); + + // Set defaults for page and offset. + LineItemPage page = new LineItemPage(); + int offset = 0; + int i = 0; + List lineItemIds = new List(); + + try { + do { + // Create a Statement to page through approved line items. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get line items by Statement. + page = lineItemService.getLineItemsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + foreach (LineItemSummary lineItem in page.results) { + // Archived line items cannot be activated. + if (!lineItem.isArchived) { + Console.WriteLine("{0}) Line item with ID ='{1}', belonging to order ID ='{2}' " + + "and name ='{2}' will be activated.", i, lineItem.id, lineItem.orderId, + lineItem.name); + lineItemIds.Add(lineItem.id.ToString()); + i++; + } + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of line items to be activated: {0}", lineItemIds.Count); + + if (lineItemIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", lineItemIds.ToArray()))). + ToStatement(); + + // Create action. + ActivateLineItems action = new ActivateLineItems(); + + // Perform action. + UpdateResult result = lineItemService.performLineItemAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of line items activated: {0}", result.numChanges); + } else { + Console.WriteLine("No line items were activated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to activate line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LineItemService/CreateLineItems.cs b/examples/Dfp/CSharp/v201306/LineItemService/CreateLineItems.cs new file mode 100644 index 00000000000..7567fc12c34 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LineItemService/CreateLineItems.cs @@ -0,0 +1,217 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates new line items. To determine which line items + /// exist, run GetAllLineItems.cs. To determine which orders exist, run + /// GetAllOrders.cs. To determine which placements exist, run + /// GetAllPlacements.cs. To determine the IDs for locations, run + /// GetAllCities.cs, GetAllCountries.cs, GetAllMetros.cs, GetAllRegions.cs and + /// GetAllPostalCodes. + /// + /// Tags: LineItemService.createLineItems + /// + class CreateLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new line items. To determine which line items " + + "exist, run GetAllLineItems.cs. To determine which orders exist, run GetAllOrders.cs" + + ". To determine which placements exist, run GetAllPlacements.cs. To determine the " + + "IDs for locations, run GetAllCities.cs, GetAllCountries.cs, GetAllMetros.cs, " + + "GetAllRegions.cs and GetAllPostalCodes."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code examples. + /// + /// The DFP user object running the code examples. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201306.LineItemService); + + // Set the order that all created line items will belong to and the + // placement ID to target. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + long[] targetPlacementIds = new long[] {long.Parse(_T("INSERT_PLACEMENT_ID_HERE"))}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = targetPlacementIds; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + PostalCodeLocation postalCodeLocation = new PostalCodeLocation(); + postalCodeLocation.id = 9000093; + postalCodeLocation.postalCode = "B3P"; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201306.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201306.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + // Create an array to store local line item objects. + LineItem[] lineItems = new LineItem[5]; + + for (int i = 0; i < 5; i++) { + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + i; + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + lineItems[i] = lineItem; + } + + try { + // Create the line items on the server. + lineItems = lineItemService.createLineItems(lineItems); + + if (lineItems != null) { + foreach (LineItem lineItem in lineItems) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and" + + " named \"{2}\" was created.", lineItem.id, lineItem.orderId, lineItem.name); + } + } else { + Console.WriteLine("No line items created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LineItemService/CreateMobileLineItem.cs b/examples/Dfp/CSharp/v201306/LineItemService/CreateMobileLineItem.cs new file mode 100644 index 00000000000..41cbe49d028 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LineItemService/CreateMobileLineItem.cs @@ -0,0 +1,172 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates a new line item to serve to the mobile platform. + /// Mobile features needs to be enabled in your account to use mobile + /// targeting. To determine which line items exist, run GetAllLineItems.cs. To + /// determine which orders exist, run GetAllOrders.cs. To determine + /// which placements exist, run GetAllPlacements.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.performLineItemAction + /// + class CreateMobileLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new line item to serve to the mobile platform. Mobile" + + " features needs to be enabled in your account to use mobile targeting. To determine " + + "which line items exist, run GetAllLineItems.cs. To determine which orders exist, " + + "run GetAllOrders.cs. To determine which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateMobileLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201306.LineItemService); + + // Set the order that all created line items will belong to and the + // placement containing ad units with a mobile target platform. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + long[] targetedPlacementIds = new long[] {long.Parse(_T("INSERT_MOBILE_PLACEMENT_ID_HERE"))}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = targetedPlacementIds; + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create device manufacturer targeting. + DeviceManufacturerTargeting deviceManufacturerTargeting = new DeviceManufacturerTargeting(); + deviceManufacturerTargeting.isTargeted = true; + + // Target the Google device manufacturer (40100). + Technology deviceManufacturerTechnology = new Technology(); + deviceManufacturerTechnology.id = 40100L; + deviceManufacturerTargeting.deviceManufacturers = + new Technology[] {deviceManufacturerTechnology}; + technologyTargeting.deviceManufacturerTargeting = deviceManufacturerTargeting; + + // Create mobile device targeting. + MobileDeviceTargeting mobileDeviceTargeting = new MobileDeviceTargeting(); + + // Exclude the Nexus One device (604046). + Technology mobileDeviceTechnology = new Technology(); + mobileDeviceTechnology.id = 604046L; + mobileDeviceTargeting.targetedMobileDevices = new Technology[] {mobileDeviceTechnology}; + technologyTargeting.mobileDeviceTargeting = mobileDeviceTargeting; + + // Create mobile device submodel targeting. + MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargeting = + new MobileDeviceSubmodelTargeting(); + + // Target the iPhone 4 device submodel (640003). + Technology mobileDeviceSubmodelTechnology = new Technology(); + mobileDeviceSubmodelTechnology.id = 640003L; + mobileDeviceSubmodelTargeting.targetedMobileDeviceSubmodels = + new Technology[] {mobileDeviceSubmodelTechnology}; + technologyTargeting.mobileDeviceSubmodelTargeting = mobileDeviceSubmodelTargeting; + + // Create targeting. + Targeting targeting = new Targeting(); + targeting.inventoryTargeting = inventoryTargeting; + targeting.technologyTargeting = technologyTargeting; + + // Create local line item object. + LineItem lineItem = new LineItem(); + lineItem.name = "Mobile line item"; + lineItem.orderId = orderId; + lineItem.targeting = targeting; + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the target platform to mobile. + lineItem.targetPlatform = TargetPlatform.MOBILE; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + creativePlaceholder.size = size; + + // Set the size of creatives that can be associated with this line item. + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromString("20120901 00:00:00"); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + Money money = new Money(); + money.currencyCode = "USD"; + money.microAmount = 2000000L; + lineItem.costPerUnit = money; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + try { + // Create the line item on the server. + lineItem = lineItemService.createLineItem(lineItem); + + if (lineItem != null) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and " + + "named \"{2}\" was created.", lineItem.id, lineItem.orderId, lineItem.name); + } else { + Console.WriteLine("No line item created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LineItemService/CreateVideoLineItem.cs b/examples/Dfp/CSharp/v201306/LineItemService/CreateVideoLineItem.cs new file mode 100644 index 00000000000..48429bb8746 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LineItemService/CreateVideoLineItem.cs @@ -0,0 +1,187 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates a new line item to serve to video content. To + /// determine which line items exist, run GetAllLineItems.cs. To determine + /// which orders exist, run GetAllOrders.cs. To create a video ad unit, run + /// CreateVideoAdUnit.cs. To create criteria for categories, run + /// CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: LineItemService.createLineItem + /// + class CreateVideoLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new line item to serve to video content. To determine" + + " which line items exist, run GetAllLineItems.cs. To determine which orders exist, " + + "run GetAllOrders.cs. To create a video ad unit, run CreateVideoAdUnit.cs. To " + + "create criteria for categories, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateVideoLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201306.LineItemService); + + // Set the order that all created line items will belong to and the + // video ad unit ID to target. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + string targetedVideoAdUnitId = _T("INSERT_TARGETED_VIDEO_AD_UNIT_ID_HERE"); + + // Set the custom targeting key ID and value ID representing the metadata + // on the content to target. This would typically be a key representing + // a "genre" and a value representing something like "comedy". + long contentCustomTargetingKeyId = + long.Parse(_T("INSERT_CONTENT_CUSTOM_TARGETING_KEY_ID_HERE")); + long contentCustomTargetingValueId = + long.Parse(_T("INSERT_CONTENT_CUSTOM_TARGETING_VALUE_ID_HERE")); + + // Create custom criteria for the content metadata targeting. + CustomCriteria contentCustomCriteria = new CustomCriteria(); + contentCustomCriteria.keyId = contentCustomTargetingKeyId; + contentCustomCriteria.valueIds = new long[] {contentCustomTargetingValueId}; + contentCustomCriteria.@operator = CustomCriteriaComparisonOperator.IS; + + // Create custom criteria set. + CustomCriteriaSet customCriteriaSet = new CustomCriteriaSet(); + customCriteriaSet.children = new CustomCriteriaNode[] {contentCustomCriteria}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + AdUnitTargeting adUnitTargeting = new AdUnitTargeting(); + adUnitTargeting.adUnitId = targetedVideoAdUnitId; + adUnitTargeting.includeDescendants = true; + inventoryTargeting.targetedAdUnits = new AdUnitTargeting[] {adUnitTargeting}; + + // Create video position targeting. + VideoPosition videoPosition = new VideoPosition(); + videoPosition.positionType = VideoPositionType.PREROLL; + VideoPositionTarget videoPositionTarget = new VideoPositionTarget(); + videoPositionTarget.videoPosition = videoPosition; + VideoPositionTargeting videoPositionTargeting = new VideoPositionTargeting(); + videoPositionTargeting.targetedPositions = new VideoPositionTarget[] {videoPositionTarget}; + + // Create targeting. + Targeting targeting = new Targeting(); + targeting.customTargeting = customCriteriaSet; + targeting.inventoryTargeting = inventoryTargeting; + targeting.videoPositionTargeting = videoPositionTargeting; + + // Create local line item object. + LineItem lineItem = new LineItem(); + lineItem.name = "Video line item - " + this.GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = targeting; + lineItem.lineItemType = LineItemType.SPONSORSHIP; + lineItem.allowOverbook = true; + + // Set the environment type to video. + lineItem.environmentType = EnvironmentType.VIDEO_PLAYER; + + // Set the creative rotation type to optimized. + lineItem.creativeRotationType = CreativeRotationType.OPTIMIZED; + + // Create the master creative placeholder. + CreativePlaceholder creativeMasterPlaceholder = new CreativePlaceholder(); + Size size1 = new Size(); + size1.width = 400; + size1.height = 300; + size1.isAspectRatio = false; + creativeMasterPlaceholder.size = size1; + + // Create companion creative placeholders. + CreativePlaceholder companionCreativePlaceholder1 = new CreativePlaceholder(); + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + size2.isAspectRatio = false; + companionCreativePlaceholder1.size = size2; + + CreativePlaceholder companionCreativePlaceholder2 = new CreativePlaceholder(); + Size size3 = new Size(); + size3.width = 728; + size3.height = 90; + size3.isAspectRatio = false; + companionCreativePlaceholder2.size = size3; + + // Set companion creative placeholders. + creativeMasterPlaceholder.companions = new CreativePlaceholder[] { + companionCreativePlaceholder1, companionCreativePlaceholder2}; + + // Set the size of creatives that can be associated with this line item. + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativeMasterPlaceholder}; + + // Set delivery of video companions to optional. + lineItem.companionDeliveryOption = CompanionDeliveryOption.OPTIONAL; + + // Set the length of the line item to run. + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromString("20120901 00:00:00"); + + // Set the cost per day to $1. + lineItem.costType = CostType.CPD; + Money money = new Money(); + money.currencyCode = "USD"; + money.microAmount = 1000000L; + lineItem.costPerUnit = money; + + // Set the percentage to be 100%. + lineItem.unitsBought = 100; + + try { + // Create the line item on the server. + lineItem = lineItemService.createLineItem(lineItem); + + if (lineItem != null) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and " + + "named \"{2}\" was created.", lineItem.id, lineItem.orderId, lineItem.name); + } else { + Console.WriteLine("No line item created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LineItemService/GetAllLineItems.cs b/examples/Dfp/CSharp/v201306/LineItemService/GetAllLineItems.cs new file mode 100644 index 00000000000..33d5f6c633c --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LineItemService/GetAllLineItems.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all line items. To create line items, run + /// CreateLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// + class GetAllLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items. To create line items, run " + + "CreateLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201306.LineItemService); + + // Sets defaults for page and Statement. + LineItemPage page = new LineItemPage(); + Statement statement = new Statement(); + int offset = 0; + try { + do { + // Create a Statement to get all line items. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get line items by Statement. + page = lineItemService.getLineItemsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemSummary lineItem in page.results) { + Console.WriteLine("{0}) Line item with ID = '{1}', belonging to order ID ='{2}'" + + " , and named '{3}' was found.", i, lineItem.id, lineItem.orderId, + lineItem.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LineItemService/GetLineItem.cs b/examples/Dfp/CSharp/v201306/LineItemService/GetLineItem.cs new file mode 100644 index 00000000000..2c079482d70 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LineItemService/GetLineItem.cs @@ -0,0 +1,78 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets a line item by its ID. To determine which line + /// items exist, run GetAllLineItems.cs. + /// + /// Tags: LineItemService.getLineItem + /// + class GetLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a line item by its ID. To determine which line items " + + "exist, run GetAllLineItems.cs"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201306.LineItemService); + + // Set the ID of the line item to get. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get the line item. + LineItem lineItem = lineItemService.getLineItem(lineItemId); + + if (lineItem != null) { + Console.WriteLine("Line item with ID ='{0}', belonging to order ID ='{1}', and named " + + "'{2}' was found.", lineItem.id, lineItem.orderId, lineItem.name); + } else { + Console.WriteLine("No line item found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get line item by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LineItemService/GetLineItemsByStatement.cs b/examples/Dfp/CSharp/v201306/LineItemService/GetLineItemsByStatement.cs new file mode 100644 index 00000000000..3e978762ee9 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LineItemService/GetLineItemsByStatement.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all line items for the given order. The Statement + /// retrieves up to the maximum page size limit of 500. To create line items, + /// run CreateLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// + class GetLineItemsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items for the given order. The Statement " + + "retrieves up to the maximum page size limit of 500. To create line items, " + + "run CreateLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLineItemsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201306.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create a statement to only select line items that need creatives from a + // given order. + Statement filterStatement = + new StatementBuilder("WHERE orderId = :orderId AND status = :status LIMIT 500") + .AddValue("orderId", orderId) + .AddValue("status", ComputedStatus.NEEDS_CREATIVES.ToString()) + .ToStatement(); + + try { + // Get line items by Statement. + LineItemPage page = lineItemService.getLineItemsByStatement(filterStatement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItem lineItem in page.results) { + Console.WriteLine("{0}) Line item with ID ='{1}', belonging to order ID = '{2}' and " + + "named '{3}' was found.", i, lineItem.id, lineItem.orderId, lineItem.name); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get line item by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LineItemService/GetRecentlyUpdatedLineItems.cs b/examples/Dfp/CSharp/v201306/LineItemService/GetRecentlyUpdatedLineItems.cs new file mode 100644 index 00000000000..ecab4caaf1a --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LineItemService/GetRecentlyUpdatedLineItems.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; +using Google.Api.Ads.Dfp.Util.v201306; + +using System; + +using DateTime = Google.Api.Ads.Dfp.v201306.DateTime; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example shows how to get recently updated line items. To create + /// line items, run CreateLineItems.cs. + /// + /// Tags: LineItemService.GetRecentlyUpdatedLineItems + /// + class GetRecentlyUpdatedLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a line item by its ID. To determine which line items " + + "exist, run GetAllLineItems.cs"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetRecentlyUpdatedLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201306.LineItemService); + + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + try { + // Create statement to only select line items for the given order that + // have been modified in the last 3 days. + DateTime threeDaysAgo = DateTimeUtilities.FromDateTime(System.DateTime.Now.AddDays(-3)); + Statement filterStatement = new StatementBuilder( + "WHERE lastModifiedDateTime >= :lastModifiedDateTime AND orderId = :orderId LIMIT 500"). + AddValue("lastModifiedDateTime", threeDaysAgo). + AddValue("orderId", orderId).ToStatement(); + + + // Get line items by statement. + LineItemPage page = lineItemService.getLineItemsByStatement(filterStatement); + + // Display results. + if (page != null && page.results != null) { + foreach (LineItem lineItem in page.results) { + Console.WriteLine("Line item with id \"{0}\", belonging to order id \"{1}\" and " + + "named \"{2}\" was found.", lineItem.id, lineItem.orderId, lineItem.name); + } + Console.WriteLine("Number of results found: {1}.", page.totalResultSetSize); + } else { + Console.WriteLine("No line items were found."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LineItemService/TargetCustomCriteria.cs b/examples/Dfp/CSharp/v201306/LineItemService/TargetCustomCriteria.cs new file mode 100644 index 00000000000..b709df72321 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LineItemService/TargetCustomCriteria.cs @@ -0,0 +1,167 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example updates a line item to add custom criteria targeting. To + /// determine which line items exist, run GetAllLineItems.cs. To determine + /// which custom targeting keys and values exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: LineItemService.getLineItem, LineItemService.updateLineItem + /// + class TargetCustomCriteria : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a line item to add custom criteria targeting. To " + + "determine which line items exist, run GetAllLineItems.cs. To determine which custom " + + "targeting keys and values exist, run GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new TargetCustomCriteria(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201306.LineItemService); + + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = (CustomTargetingService) user.GetService( + DfpService.v201306.CustomTargetingService); + + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long[] customCriteriaIds1 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + long[] customCriteriaIds2 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + long[] customCriteriaIds3 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + + // Create custom criteria. + CustomCriteria customCriteria1 = new CustomCriteria(); + customCriteria1.keyId = customCriteriaIds1[0]; + customCriteria1.valueIds = new long[] {customCriteriaIds1[1]}; + customCriteria1.@operator = CustomCriteriaComparisonOperator.IS; + + CustomCriteria customCriteria2 = new CustomCriteria(); + customCriteria2.keyId = customCriteriaIds2[0]; + customCriteria2.valueIds = new long[] {customCriteriaIds2[1]}; + customCriteria2.@operator = CustomCriteriaComparisonOperator.IS_NOT; + + CustomCriteria customCriteria3 = new CustomCriteria(); + customCriteria3.keyId = customCriteriaIds3[0]; + customCriteria3.valueIds = new long[] {customCriteriaIds3[1]}; + customCriteria3.@operator = CustomCriteriaComparisonOperator.IS; + + // Create the custom criteria set that will resemble: + // + // (customCriteria1.key == customCriteria1.value OR + // (customCriteria2.key != customCriteria2.value AND + // customCriteria3.key == customCriteria3.value)) + CustomCriteriaSet topCustomCriteriaSet = new CustomCriteriaSet(); + topCustomCriteriaSet.logicalOperator = CustomCriteriaSetLogicalOperator.OR; + + CustomCriteriaSet subCustomCriteriaSet = new CustomCriteriaSet(); + subCustomCriteriaSet.logicalOperator = CustomCriteriaSetLogicalOperator.AND; + subCustomCriteriaSet.children = + new CustomCriteriaNode[] {customCriteria2, customCriteria3}; + topCustomCriteriaSet.children = + new CustomCriteriaNode[] {customCriteria1, subCustomCriteriaSet}; + + try { + // Set the custom criteria targeting on the line item. + LineItem lineItem = lineItemService.getLineItem(lineItemId); + lineItem.targeting.customTargeting = topCustomCriteriaSet; + + // Update the line items on the server. + lineItem = lineItemService.updateLineItem(lineItem); + + // Display the updated line item. + Console.WriteLine("Line item with ID {0} updated with custom criteria targeting \n{1}\n", + lineItem.id, getCustomCriteriaSetString(lineItem.targeting.customTargeting, 0)); + } catch (Exception ex) { + Console.WriteLine("Failed to add custom target criteria. Exception says \"{0}\"", + ex.Message); + } + } + + /// + /// Gets a string representation of the custom criteria node. If it has + /// children, each child will be appended to the string recursively. + /// + /// The root custom criteria node. + /// The level of the custom criteria tree. + /// + /// A string representation of the custom criteria node and its + /// children + /// + private static string getCustomCriteriaSetString(CustomCriteriaNode root, int level) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < level; i++) { + sb.Append("\t"); + } + + if (root is CustomCriteria) { + CustomCriteria customCriteria = (CustomCriteria) root; + StringBuilder ids = new StringBuilder(); + for (int j = 0; j < customCriteria.valueIds.Length; j++) { + ids.Append(customCriteria.valueIds[j] + ", "); + } + + sb.AppendFormat("Custom criteria: operator: [{0}] key: [{1}] values: [{2}]\n", + customCriteria.@operator, customCriteria.keyId, ids.ToString().TrimEnd(',', ' ')); + return sb.ToString(); + } else if (root is CustomCriteriaSet) { + CustomCriteriaSet customCriteriaSet = (CustomCriteriaSet) root; + sb.AppendFormat("Custom criteria set: operator: [{0}] children: \n", + customCriteriaSet.logicalOperator); + foreach (CustomCriteriaNode node in customCriteriaSet.children) { + sb.Append(getCustomCriteriaSetString(node, level + 1)); + } + return sb.Append("\n").ToString(); + } else { + throw new Exception("Unexpected node: " + root.CustomCriteriaNodeType); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/LineItemService/UpdateLineItems.cs b/examples/Dfp/CSharp/v201306/LineItemService/UpdateLineItems.cs new file mode 100644 index 00000000000..b5af0fbed8c --- /dev/null +++ b/examples/Dfp/CSharp/v201306/LineItemService/UpdateLineItems.cs @@ -0,0 +1,108 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example updates the delivery rate of all line items up to the + /// first 500. To determine which line items exist, run GetAllLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.updateLineItems + /// + class UpdateLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the delivery rate of all line items up to the first " + + "500. To determine which line items exist, run GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201306.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create a Statement to get line items with even delivery rates. + Statement statement = new StatementBuilder("WHERE deliveryRateType = :deliveryRateType and " + + "orderId = :orderId LIMIT 500").AddValue("deliveryRateType", + DeliveryRateType.EVENLY.ToString()).AddValue("orderId", orderId).ToStatement(); + + try { + // Get line items by Statement. + LineItemPage page = lineItemService.getLineItemsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + LineItem[] lineItems = page.results; + List lineItemsToUpdate = new List(); + + // Update each local line item object by changing its delivery rate. + foreach (LineItem lineItem in lineItems) { + // Archived line items cannot be updated. + if (!lineItem.isArchived) { + lineItem.deliveryRateType = DeliveryRateType.AS_FAST_AS_POSSIBLE; + lineItemsToUpdate.Add(lineItem); + } + } + + // Update the line items on the server. + lineItems = lineItemService.updateLineItems(lineItemsToUpdate.ToArray()); + + if (lineItems != null) { + foreach (LineItem lineItem in lineItems) { + Console.WriteLine("A line item with ID = '{0}', belonging to order ID = '{1}', " + + "named '{2}', and having delivery rate = '{3}' was updated.", + lineItem.id, lineItem.orderId, lineItem.name, lineItem.deliveryRateType); + } + } else { + Console.WriteLine("No line items updated."); + } + } else { + Console.WriteLine("No line items found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/NetworkService/GetAllNetworks.cs b/examples/Dfp/CSharp/v201306/NetworkService/GetAllNetworks.cs new file mode 100644 index 00000000000..1981ec6d30d --- /dev/null +++ b/examples/Dfp/CSharp/v201306/NetworkService/GetAllNetworks.cs @@ -0,0 +1,81 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all networks that you have access to with the + /// current login credentials. A networkCode should be left out for this + /// request. + /// + /// Tags: NetworkService.getAllNetworks + /// + class GetAllNetworks : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all networks that you have access to with the current " + + "login credentials. A networkCode should be left out for this request."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllNetworks(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201306.NetworkService); + // Set the networkCode field to null to retrieve all networks you have + // access to. + networkService.RequestHeader.networkCode = null; + + try { + // Get all networks that you have access to with the current login + // credentials. + Network[] networks = networkService.getAllNetworks(); + + int i = 0; + foreach (Network network in networks) { + Console.WriteLine("{0} ) Network with network code \"{1}\" and display name \"{2}\" " + + "was found.", i + 1, network.networkCode, network.displayName); + i++; + } + Console.WriteLine("Number of networks found: {0}", i); + } catch (Exception ex) { + Console.WriteLine("Failed to get all networks. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/NetworkService/GetCurrentNetwork.cs b/examples/Dfp/CSharp/v201306/NetworkService/GetCurrentNetwork.cs new file mode 100644 index 00000000000..d04b5b4d86f --- /dev/null +++ b/examples/Dfp/CSharp/v201306/NetworkService/GetCurrentNetwork.cs @@ -0,0 +1,70 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets the current network that you can make requests + /// against. + /// + /// Tags: NetworkService.getCurrentNetwork + /// + class GetCurrentNetwork : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the current network that you can make requests against."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCurrentNetwork(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201306.NetworkService); + + try { + // Get the current network. + Network network = networkService.getCurrentNetwork(); + + Console.WriteLine("Current network has network code \"{0}\" and display name \"{1}\".", + network.networkCode, network.displayName); + } catch (Exception ex) { + Console.WriteLine("Failed to get current network. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/NetworkService/MakeTestNetwork.cs b/examples/Dfp/CSharp/v201306/NetworkService/MakeTestNetwork.cs new file mode 100644 index 00000000000..d3f310c87ee --- /dev/null +++ b/examples/Dfp/CSharp/v201306/NetworkService/MakeTestNetwork.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates a test network. You do not need to have a DFP + /// account to run this example, but you do need to have a new Google account + /// (created at http://www.google.com/accounts/newaccount) that is not + /// associated with any other DFP networks (including old sandbox networks). + /// Once this network is created, you can supply the network code in your + /// settings to make calls to other services. + /// + /// Please see the following URL for more information: + /// https://developers.google.com/doubleclick-publishers/docs/signup + /// + /// Tags: NetworkService.makeTestNetwork + /// + class MakeTestNetwork : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a test network. You do not need to have a DFP" + + " account to run this example, but you do need to have a new Google account" + + " (created at http://www.google.com/accounts/newaccount) that is not associated " + + "with any other DFP networks (including old sandbox networks). Once this network " + + "is created, you can supply the network code in your settings to make calls to " + + "other services.\n\n Please see the following URL for more information:" + + " https://developers.google.com/doubleclick-publishers/docs/signup"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new MakeTestNetwork(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201306.NetworkService); + // Set the networkCode field to null. + networkService.RequestHeader.networkCode = null; + + try { + Network network = networkService.makeTestNetwork(); + + Console.WriteLine("Test network with network code \"{0}\" and display name \"{1}\" " + + "created.\nYou may now sign in at http://www.google.com/dfp/main?networkCode={0}", + network.networkCode, network.displayName); + } catch (Exception ex) { + Console.WriteLine("Failed to make test network. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/OrderService/ApproveOrder.cs b/examples/Dfp/CSharp/v201306/OrderService/ApproveOrder.cs new file mode 100644 index 00000000000..12b94335693 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/OrderService/ApproveOrder.cs @@ -0,0 +1,121 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example approves and overbooks all eligible draft and pending + /// orders. To determine which orders exist, run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement, OrderService.performOrderAction + /// + class ApproveOrder : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example approves and overbooks all draft orders. To determine which " + + "orders exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ApproveOrder(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = + (OrderService) user.GetService(DfpService.v201306.OrderService); + + // Create Statement text to select all draft orders. + string statementText = "WHERE status IN (:status1, :status2) and endDateTime >= :today " + + "AND isArchived = FALSE LIMIT 500"; + Statement statement = new StatementBuilder(""). + AddValue("status1", OrderStatus.DRAFT.ToString()). + AddValue("status2", OrderStatus.PENDING_APPROVAL.ToString()). + AddValue("today", System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss")).ToStatement(); + + // Set defaults for page and offset. + OrderPage page = new OrderPage(); + int i = 0; + int offset = 0; + List orderIds = new List(); + + try { + do { + // Create a Statement to page through draft orders. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + // Get orders by Statement. + page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and status ='{3}' " + + "will be approved.", i, order.id, order.name, order.status); + orderIds.Add(order.id.ToString()); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of orders to be approved: {0}", orderIds.Count); + + if (orderIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", orderIds.ToArray()))). + ToStatement(); + + // Create action. + ApproveAndOverbookOrders action = new ApproveAndOverbookOrders(); + + // Perform action. + UpdateResult result = orderService.performOrderAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of orders approved: {0}", result.numChanges); + } else { + Console.WriteLine("No orders were approved."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to approve orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/OrderService/CreateOrders.cs b/examples/Dfp/CSharp/v201306/OrderService/CreateOrders.cs new file mode 100644 index 00000000000..044fb77a7ac --- /dev/null +++ b/examples/Dfp/CSharp/v201306/OrderService/CreateOrders.cs @@ -0,0 +1,96 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates new orders. To determine which orders exist, + /// run GetAllOrders.cs. + /// + /// Tags: OrderService.createOrders + /// + class CreateOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new orders. To determine which orders exist, " + + "run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = + (OrderService) user.GetService(DfpService.v201306.OrderService); + + // Set the advertiser, salesperson, and trafficker to assign to each + // order. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + long salespersonId = long.Parse(_T("INSERT_SALESPERSON_ID_HERE")); + long traffickerId = long.Parse(_T("INSERT_TRAFFICKER_ID_HERE")); + + // Create an array to store local order objects. + Order[] orders = new Order[5]; + + for (int i = 0; i < 5; i++) { + Order order = new Order(); + order.name = string.Format("Order #{0}", i); + order.advertiserId = advertiserId; + order.salespersonId = salespersonId; + order.traffickerId = traffickerId; + + orders[i] = order; + } + + try { + // Create the orders on the server. + orders = orderService.createOrders(orders); + + if (orders != null) { + foreach (Order order in orders) { + Console.WriteLine("An order with ID ='{0}' and named '{1}' was created.", + order.id, order.name); + } + } else { + Console.WriteLine("No orders created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/OrderService/GetAllOrders.cs b/examples/Dfp/CSharp/v201306/OrderService/GetAllOrders.cs new file mode 100644 index 00000000000..f931f6279bb --- /dev/null +++ b/examples/Dfp/CSharp/v201306/OrderService/GetAllOrders.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all orders. To create orders, run CreateOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement + /// + class GetAllOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets all orders. To create orders, run CreateOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201306.OrderService); + + // Sets defaults for page and Statement. + OrderPage page = new OrderPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all orders. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get orders by Statement. + page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and advertiser " + + "ID = '{3}' was found.", i, order.id, order.name, order.advertiserId); + i++; + } + } + + offset += 500; + } while (page.results != null && page.results.Length == 500); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/OrderService/GetOrder.cs b/examples/Dfp/CSharp/v201306/OrderService/GetOrder.cs new file mode 100644 index 00000000000..861f3aa1d17 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/OrderService/GetOrder.cs @@ -0,0 +1,75 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets an order by its ID. To determine which orders + /// exist, run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrder + /// + class GetOrder : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets an order by its ID. To determine which orders " + + "exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + new GetOrder().Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201306.OrderService); + + // Set the ID of the order to get. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + try { + // Get the order. + Order order = orderService.getOrder(orderId); + + if (order != null) { + Console.WriteLine("An order with ID = {0}', name = '{1}', and advertiser ID = '{2}' " + + " was found.", order.id, order.name, order.advertiserId); + } else { + Console.WriteLine("No order found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get orders by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/OrderService/GetOrdersByStatement.cs b/examples/Dfp/CSharp/v201306/OrderService/GetOrdersByStatement.cs new file mode 100644 index 00000000000..a7fd690d816 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/OrderService/GetOrdersByStatement.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all orders for a given advertiser. The Statement + /// retrieves up to the maximum page size limit of 500. To create orders, run + /// CreateOrders.cs. To determine which companies are advertisers, + /// run GetCompaniesByStatement.cs. + /// + /// Tags: OrderService.getOrdersByStatement + /// + class GetOrdersByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all orders for a given advertiser. The Statement " + + "retrieves up to the maximum page size limit of 500. To create orders, run " + + "CreateOrders.cs. To determine which companies are advertisers,run " + + "GetCompaniesByStatement.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetOrdersByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201306.OrderService); + + // Set the name of the advertiser (company) to get orders for. + String advertiserId = _T("INSERT_ADVERTISER_COMPANY_ID_HERE"); + + // Create a Statement to only select orders for a given advertiser. + Statement statement = new StatementBuilder("WHERE advertiserId = :advertiserId LIMIT 500"). + AddValue("advertiserId", advertiserId).ToStatement(); + + try { + // Get orders by Statement. + OrderPage page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and advertiser " + + "ID = '{3}' was found.", i, order.id, order.name, order.advertiserId); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get orders by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/OrderService/UpdateOrders.cs b/examples/Dfp/CSharp/v201306/OrderService/UpdateOrders.cs new file mode 100644 index 00000000000..9befb251d03 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/OrderService/UpdateOrders.cs @@ -0,0 +1,100 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example updates the notes of each order up to the first 500. + /// To determine which orders exist, run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement, OrderService.updateOrders + /// + class UpdateOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the notes of each order up to the first 500. " + + "To determine which orders exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201306.OrderService); + + // Create a Statement to get all orders. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get orders by Statement. + OrderPage page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + Order[] orders = page.results; + List ordersToUpdate = new List(); + + // Update each local order object by changing its notes. + foreach (Order order in orders) { + if (!order.isArchived) { + order.notes = "Spoke to advertiser. All is well."; + ordersToUpdate.Add(order); + } + } + + // Update the orders on the server. + orders = orderService.updateOrders(ordersToUpdate.ToArray()); + + if (orders != null) { + foreach (Order order in orders) { + Console.WriteLine("Order with ID = '{0}', name = '{1}', advertiser ID = '{2}', " + + "and notes = '{3}' was updated.", order.id, order.name, order.advertiserId, + order.notes); + } + } else { + Console.WriteLine("No orders updated."); + } + } else { + Console.WriteLine("No orders found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/PlacementService/CreatePlacements.cs b/examples/Dfp/CSharp/v201306/PlacementService/CreatePlacements.cs new file mode 100644 index 00000000000..3842df27208 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/PlacementService/CreatePlacements.cs @@ -0,0 +1,164 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates new placements for various ad unit sizes. To + /// determine which placements exist, run GetAllPlacements.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: PlacementService.createPlacements + /// + class CreatePlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new placements for various ad unit sizes. To determine " + + "which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreatePlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201306.InventoryService); + + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201306.PlacementService); + + // Create local placement object to store skyscraper ad units. + Placement skyscraperAdUnitPlacement = new Placement(); + skyscraperAdUnitPlacement.name = string.Format("Skyscraper AdUnit Placement #{0}", + this.GetTimeStamp()); + skyscraperAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 120x600"; + + // Create local placement object to store medium square ad units. + Placement mediumSquareAdUnitPlacement = new Placement(); + mediumSquareAdUnitPlacement.name = string.Format("Medium Square AdUnit Placement #{0}", + this.GetTimeStamp()); + mediumSquareAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 300x250"; + + // Create local placement object to store banner ad units. + Placement bannerAdUnitPlacement = new Placement(); + bannerAdUnitPlacement.name = string.Format("Banner AdUnit Placement #{0}", + this.GetTimeStamp()); + bannerAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 468x60"; + + List placementList = new List(); + + // Get the first 500 ad units. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + List mediumSquareTargetedUnitIds = new List(); + List skyscraperTargetedUnitIds = new List(); + List bannerTargetedUnitIds = new List(); + + try { + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + // Separate the ad units by size. + if (page.results != null) { + foreach (AdUnit adUnit in page.results) { + if (adUnit.parentId != null && adUnit.adUnitSizes != null) { + foreach (AdUnitSize adUnitSize in adUnit.adUnitSizes) { + Size size = adUnitSize.size; + if (size.width == 300 && size.height == 250) { + if (!mediumSquareTargetedUnitIds.Contains(adUnit.id)) { + mediumSquareTargetedUnitIds.Add(adUnit.id); + } + } else if (size.width == 120 && size.height == 600) { + if (!skyscraperTargetedUnitIds.Contains(adUnit.id)) { + skyscraperTargetedUnitIds.Add(adUnit.id); + } + } else if (size.width == 468 && size.height == 60) { + if (!bannerTargetedUnitIds.Contains(adUnit.id)) { + bannerTargetedUnitIds.Add(adUnit.id); + } + } + } + } + } + } + mediumSquareAdUnitPlacement.targetedAdUnitIds = mediumSquareTargetedUnitIds.ToArray(); + skyscraperAdUnitPlacement.targetedAdUnitIds = skyscraperTargetedUnitIds.ToArray(); + bannerAdUnitPlacement.targetedAdUnitIds = bannerTargetedUnitIds.ToArray(); + + + // Only create placements with one or more ad unit. + if (mediumSquareAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(mediumSquareAdUnitPlacement); + } + + if (skyscraperAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(skyscraperAdUnitPlacement); + } + + if (bannerAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(bannerAdUnitPlacement); + } + + Placement[] placements = + placementService.createPlacements(placementList.ToArray()); + + // Display results. + if (placements != null) { + foreach (Placement placement in placements) { + Console.Write("A placement with ID = '{0}', name ='{1}', and containing " + + "ad units {{", placement.id, placement.name); + + foreach (string adUnitId in placement.targetedAdUnitIds) { + Console.Write("{0}, ", adUnitId); + } + Console.WriteLine("} was created."); + } + } else { + Console.WriteLine("No placements created."); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to create placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/PlacementService/DeactivatePlacement.cs b/examples/Dfp/CSharp/v201306/PlacementService/DeactivatePlacement.cs new file mode 100644 index 00000000000..44e66e90cfa --- /dev/null +++ b/examples/Dfp/CSharp/v201306/PlacementService/DeactivatePlacement.cs @@ -0,0 +1,120 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example deactivates all active placements. To determine which + /// placements exist, run GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// Tags: PlacementService.performPlacementAction + /// + class DeactivatePlacement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active placements. To determine which " + + "placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivatePlacement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201306.PlacementService); + + // Create Statement text to select active placements. + String statementText = "WHERE status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("status", + InventoryStatus.ACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + PlacementPage page = new PlacementPage(); + int offset = 0; + List placementIds = new List(); + + try { + do { + // Create a Statement to page through active placements. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get placements by Statement. + page = placementService.getPlacementsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID ='{1}', name ='{2}', and status ='{3}'" + + " will be deactivated.", i, placement.id, placement.name, placement.status); + placementIds.Add(placement.id.ToString()); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of placements to be deactivated: {0}", placementIds.Count); + + if (placementIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", placementIds.ToArray()))). + ToStatement(); + + // Create action. + DeactivatePlacements action = new DeactivatePlacements(); + + // Perform action. + UpdateResult result = placementService.performPlacementAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of placements deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No placements were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/PlacementService/GetAllPlacements.cs b/examples/Dfp/CSharp/v201306/PlacementService/GetAllPlacements.cs new file mode 100644 index 00000000000..07c7a4cca22 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/PlacementService/GetAllPlacements.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all placements. To create placements, run + /// CreatePlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// + class GetAllPlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all placements. To create placements, run " + + "CreatePlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllPlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201306.PlacementService); + + // Sets defaults for page and Statement. + PlacementPage page = new PlacementPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all ad units. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get ad units by Statement. + page = placementService.getPlacementsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID = '{1}' and name = '{2}' was found.", + i, placement.id, placement.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}" + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/PlacementService/GetPlacement.cs b/examples/Dfp/CSharp/v201306/PlacementService/GetPlacement.cs new file mode 100644 index 00000000000..c0e4f444935 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/PlacementService/GetPlacement.cs @@ -0,0 +1,79 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets a placement by its ID. To determine which + /// placements exist, run GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacement + /// + class GetPlacement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a placement by its ID. To determine which placements " + + "exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPlacement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201306.PlacementService); + + // Set the ID of the placement to get. + long placementId = long.Parse(_T("INSERT_PLACEMENT_ID_HERE")); + + try { + // Get the placement. + Placement placement = placementService.getPlacement(placementId); + + if (placement != null) { + Console.WriteLine("Placement with ID = '{0}', name = '{1}', and status = '{2}' " + + "was found.", placement.id, placement.name, placement.status); + } else { + Console.WriteLine("No placement found for this ID."); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to get placement by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/PlacementService/GetPlacementsByStatement.cs b/examples/Dfp/CSharp/v201306/PlacementService/GetPlacementsByStatement.cs new file mode 100644 index 00000000000..4b8609f808c --- /dev/null +++ b/examples/Dfp/CSharp/v201306/PlacementService/GetPlacementsByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all active placements by using a Statement. To + /// create a placement, run CreatePlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// + class GetPlacementsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active placements by using a Statement. To create a " + + "placement, run CreatePlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPlacementsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201306.PlacementService); + + // Create a Statement to only select active placements. + Statement statement = new StatementBuilder("WHERE status = :status LIMIT 500").AddValue( + "status", InventoryStatus.ACTIVE.ToString()).ToStatement(); + + try { + // Get placements by Statement. + PlacementPage page = placementService.getPlacementsByStatement(statement); + + // Display results. + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID = '{1}', name ='{2}', and status = '{3}' " + + "was found.", i, placement.id, placement.name, placement.status); + i++; + } + } + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get placement by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/PlacementService/UpdatePlacements.cs b/examples/Dfp/CSharp/v201306/PlacementService/UpdatePlacements.cs new file mode 100644 index 00000000000..c64b0cb5546 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/PlacementService/UpdatePlacements.cs @@ -0,0 +1,105 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example updates all placements to allow for AdSense targeting + /// up to the first 500. To determine which placements exist, run + /// GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// Tags: PlacementService.updatePlacements + /// + class UpdatePlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates all placements to allow for AdSense targeting up to " + + "the first 500. To determine which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdatePlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201306.PlacementService); + + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201306.InventoryService); + + // Create a statement to select first 500 placements. + Statement filterStatement = new Statement(); + filterStatement.query = "LIMIT 500"; + + try { + // Get placements by statement. + PlacementPage page = placementService.getPlacementsByStatement(filterStatement); + + if (page.results != null) { + Placement[] placements = page.results; + + // Update each local placement object by enabling AdSense targeting. + foreach (Placement placement in placements) { + placement.targetingDescription = (string.IsNullOrEmpty(placement.description))? + "Generic description" : placement.description; + placement.targetingAdLocation = "All images on sports pages."; + placement.targetingSiteName = "http://code.google.com"; + placement.isAdSenseTargetingEnabled = true; + } + + // Update the placements on the server. + placements = placementService.updatePlacements(placements); + + // Display results. + if (placements != null) { + foreach (Placement placement in placements) { + Console.WriteLine("A placement with ID \"{0}\", name \"{1}\", and AdSense targeting" + + " enabled \"{2}\" was updated.", placement.id, placement.name, + placement.isAdSenseTargetingEnabled); + } + } else { + Console.WriteLine("No placements updated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to update placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/PublisherQueryLanguageService/GetAllCities.cs b/examples/Dfp/CSharp/v201306/PublisherQueryLanguageService/GetAllCities.cs new file mode 100644 index 00000000000..caf7b0a93b9 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/PublisherQueryLanguageService/GetAllCities.cs @@ -0,0 +1,111 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all cities available to target. A full list of + /// available tables can be found at + /// http://code.google.com/apis/dfp/docs/reference/v201306/PublisherQueryLanguageService.html. + /// + /// Tags: PublisherQueryLanguageService.select + /// + class GetAllCities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all cities available to target. A full list of available " + + "tables can be found at " + + "http://code.google.com/apis/dfp/docs/reference/v201306/" + + "PublisherQueryLanguageService.html."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + PublisherQueryLanguageService pqlService = + (PublisherQueryLanguageService) user.GetService( + DfpService.v201306.PublisherQueryLanguageService); + + int pageSize = 500; + // Create statement to select all targetable cities. + String selectStatement = "SELECT * FROM City WHERE targetable = true LIMIT " + pageSize; + int offset = 0; + int resultSetSize = 0; + List allRows = new List(); + ResultSet resultSet; + + try { + do { + // For criteria that do not have a "targetable" property, that predicate + // may be left off, i.e. just "SELECT * FROM Browser_Groups LIMIT 500" + StatementBuilder statementBuilder = + new StatementBuilder(selectStatement + " OFFSET " + offset); + + // Get all cities. + resultSet = pqlService.select(statementBuilder.ToStatement()); + + // Collect all cities from each page. + allRows.AddRange(resultSet.rows); + + // Display results. + Console.WriteLine(PqlUtilities.ResultSetToString(resultSet)); + + offset += pageSize; + resultSetSize = resultSet.rows == null ? 0 : resultSet.rows.Length; + } while (resultSetSize == pageSize); + + Console.WriteLine("Number of results found: " + allRows.Count); + + // Optionally, save all rows to a CSV. + // Get a string array representation of the data rows. + resultSet.rows = allRows.ToArray(); + List rows = PqlUtilities.ResultSetToStringArrayList(resultSet); + + // Write the contents to a csv file. + CsvFile file = new CsvFile(); + file.Headers.AddRange(rows[0]); + file.Records.AddRange(rows.GetRange(1, rows.Count - 1).ToArray()); + file.Write("cities.csv"); + } catch (Exception ex) { + Console.WriteLine("Failed to get all cities. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ReportService/DisplayReport.cs b/examples/Dfp/CSharp/v201306/ReportService/DisplayReport.cs new file mode 100644 index 00000000000..eac677f1267 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ReportService/DisplayReport.cs @@ -0,0 +1,87 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example downloads a completed report and prints out its + /// contents. To download a completed report to a file, run DownloadReport.cs. + /// To run a report, run RunDeliveryReport.cs. + /// + /// Tags: ReportService.getReportDownloadUrlWithOptions + /// + class DisplayReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example downloads a completed report and prints out its contents. " + + "To download a completed report to a file, run DownloadReport.cs. To run a report, " + + "run RunDeliveryReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DisplayReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201306.ReportService); + + // Set the id of the completed report. + long reportJobId = long.Parse(_T("INSERT_REPORT_JOB_ID_HERE")); + ExportFormat exportFormat = (ExportFormat) Enum.Parse(typeof(ExportFormat), + _T("INSERT_EXPORT_FORMAT_HERE")); + + // Set the format of the report (e.g., CSV_DUMP) and download without + // compression so we can print it. + ReportDownloadOptions reportDownloadOptions = new ReportDownloadOptions(); + reportDownloadOptions.exportFormat = exportFormat; + reportDownloadOptions.useGzipCompression = false; + + try { + // Download report data. + string downloadUrl = reportService.getReportDownloadUrlWithOptions(reportJobId, + reportDownloadOptions); + byte[] rawReport = MediaUtilities.GetAssetDataFromUrl(downloadUrl); + string reportContents = Encoding.UTF8.GetString(rawReport); + + // Display results. + Console.WriteLine("Data for report job with id '{0}\':\n{1}", reportJobId, reportContents); + } catch (Exception ex) { + Console.WriteLine("Failed to download report. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ReportService/DownloadReport.cs b/examples/Dfp/CSharp/v201306/ReportService/DownloadReport.cs new file mode 100644 index 00000000000..b7311a4048a --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ReportService/DownloadReport.cs @@ -0,0 +1,83 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Text; +using System.IO; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example downloads a completed report. To run a report, run + /// RunDeliveryReport.cs. + /// + /// Tags: ReportService.getReportDownloadURL + /// + class DownloadReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example downloads a completed report. To run a report, run " + + "RunDeliveryReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DownloadReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201306.ReportService); + + // Set the id of the completed report. + long reportJobId = long.Parse(_T("INSERT_REPORT_JOB_ID_HERE")); + String fileName = _T("INSERT_FILE_PATH_HERE"); + + try { + // Download report data. + string url = reportService.getReportDownloadURL(reportJobId, ExportFormat.CSV_EXCEL); + byte[] gzipReport = MediaUtilities.GetAssetDataFromUrl(url); + string reportContents = Encoding.UTF8.GetString(MediaUtilities.DeflateGZipData(gzipReport)); + + using (StreamWriter writer = new StreamWriter(fileName)) { + writer.Write(reportContents); + } + + // Display results. + Console.WriteLine("Report job with id '{0}' was downloaded to '{1}'.", reportJobId, + fileName); + } catch (Exception ex) { + Console.WriteLine("Failed to download report. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ReportService/RunDeliveryReport.cs b/examples/Dfp/CSharp/v201306/ReportService/RunDeliveryReport.cs new file mode 100644 index 00000000000..d30016ee978 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ReportService/RunDeliveryReport.cs @@ -0,0 +1,104 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Threading; +using Google.Api.Ads.Dfp.Util.v201306; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example runs a report similar to the "Orders report" on the DFP + /// website with additional attributes and can filter to include just one + /// order. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunDeliveryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report similar to the \"Orders report\" on the DFP " + + "website with additional attributes and can filter to include just one order. To " + + "download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunDeliveryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201306.ReportService); + + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create statement object to filter for an order. + Statement filterStatement = new StatementBuilder("WHERE ORDER_ID = :id").AddValue( + "id", orderId).ToStatement(); + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportJob.reportQuery.dimensionAttributes = new DimensionAttribute[] { + DimensionAttribute.ORDER_TRAFFICKER, DimensionAttribute.ORDER_START_DATE_TIME, + DimensionAttribute.ORDER_END_DATE_TIME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportJob.reportQuery.statement = filterStatement; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ReportService/RunInventoryReport.cs b/examples/Dfp/CSharp/v201306/ReportService/RunInventoryReport.cs new file mode 100644 index 00000000000..d7b9dd7a22d --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ReportService/RunInventoryReport.cs @@ -0,0 +1,97 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example runs a report equal to the "Whole network report" on the + /// DFP website. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunInventoryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Whole network report\" on the " + + "DFP website. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunInventoryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201306.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.DATE}; + reportJob.reportQuery.columns = new Column[] { + Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, + Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + Column.TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + Column.TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE + }; + reportJob.reportQuery.adUnitView = ReportQueryAdUnitView.HIERARCHICAL; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_WEEK; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run inventory report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ReportService/RunMergedDeliveryReport.cs b/examples/Dfp/CSharp/v201306/ReportService/RunMergedDeliveryReport.cs new file mode 100644 index 00000000000..221dc440102 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ReportService/RunMergedDeliveryReport.cs @@ -0,0 +1,96 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example runs a report that an upgraded publisher would use to + /// include statistics before the upgrade. To download the report see + /// DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunMergedDeliveryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Orders report\" on the DFP " + + "website with additional attributes. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunMergedDeliveryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201306.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportQuery.columns = new Column[] {Column.MERGED_AD_SERVER_IMPRESSIONS, + Column.MERGED_AD_SERVER_CLICKS, Column.MERGED_AD_SERVER_CTR, + Column.MERGED_AD_SERVER_CPM_AND_CPC_REVENUE, + Column.MERGED_AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery = reportQuery; + + try { + // Run report job. + reportJob = reportService.runReportJob(reportJob); + + do { + Console.WriteLine("Report with ID '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS); + + if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with ID '{0}' failed to finish successfully.", + reportJob.id); + } else { + Console.WriteLine("Report job with ID '{0}' completed successfully.", reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ReportService/RunReachReport.cs b/examples/Dfp/CSharp/v201306/ReportService/RunReachReport.cs new file mode 100644 index 00000000000..f1fad6d8212 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ReportService/RunReachReport.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Threading; +using Google.Api.Ads.Dfp.Util.v201306; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example runs a reach report. To download the report see + /// DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunReachReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a reach report. To download the report see " + + "DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunReachReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201306.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.REACH_LIFETIME; + reportQuery.dimensions = new Dimension[] {Dimension.LINE_ITEM_ID, Dimension.LINE_ITEM_NAME}; + reportQuery.columns = new Column[] {Column.REACH_FREQUENCY, Column.REACH_AVERAGE_REVENUE, + Column.REACH}; + reportJob.reportQuery = reportQuery; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ReportService/RunReportWithCustomFields.cs b/examples/Dfp/CSharp/v201306/ReportService/RunReportWithCustomFields.cs new file mode 100644 index 00000000000..25801b71200 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ReportService/RunReportWithCustomFields.cs @@ -0,0 +1,145 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; +using Google.Api.Ads.Dfp.Util.v201306; + +using System; +using System.Threading; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example runs a report that includes custom fields found in the + /// line items of an order. To download the report see DownloadReport.cs. + /// + /// Tag: ReportService.runReportJob + /// Tag: ReportService.getReportJob + /// Tag: LineItemService.getLineItemsByStatement + /// + class RunReportWithCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report that includes custom fields found in the " + + "line items of an order. To download the report see DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunReportWithCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201306.LineItemService); + // Get the ReportService. + ReportService reportService = + (ReportService) user.GetService(DfpService.v201306.ReportService); + + try { + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Sets defaults for page and filterStatement. + LineItemPage page = new LineItemPage(); + int offset = 0; + + // Create a statement to only select line items from a given order. + String filterText = "WHERE orderId = :orderId LIMIT 500"; + Statement filterStatement = + new StatementBuilder(filterText).AddValue("orderId", orderId).ToStatement(); + + + // Collect all line item custom field IDs for an order. + List customFieldIds = new List(); + do { + filterStatement.query = filterText + " OFFSET " + offset; + + // Get line items by statement. + page = lineItemService.getLineItemsByStatement(filterStatement); + + // Get custom field IDs from the line items of an order. + if (page.results != null) { + foreach (LineItem lineItem in page.results) { + if (lineItem.customFieldValues != null) { + foreach (BaseCustomFieldValue customFieldValue in lineItem.customFieldValues) { + if (!customFieldIds.Contains(customFieldValue.customFieldId)) { + customFieldIds.Add(customFieldValue.customFieldId); + } + } + } + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + + // Create statement to filter for an order. + filterStatement = + new StatementBuilder("WHERE ORDER_ID = :orderId").AddValue("orderId", orderId) + .ToStatement(); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportQuery.dimensions = new Dimension[] {Dimension.LINE_ITEM_ID, Dimension.LINE_ITEM_NAME}; + reportQuery.statement = filterStatement; + reportQuery.customFieldIds = customFieldIds.ToArray(); + reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS}; + reportJob.reportQuery = reportQuery; + + // Run report job. + reportJob = reportService.runReportJob(reportJob); + + do { + Console.WriteLine("Report with ID '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS); + + if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with ID '{0}' failed to finish successfully.", + reportJob.id); + } else { + Console.WriteLine("Report job with ID '{0}' completed successfully.", reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run cusom fields report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/ReportService/RunSalesReport.cs b/examples/Dfp/CSharp/v201306/ReportService/RunSalesReport.cs new file mode 100644 index 00000000000..643ba1a49e1 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/ReportService/RunSalesReport.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example runs a report equal to the "Sales by salespersons + /// report" on the DFP website. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunSalesReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Sales by salespersons report\" on" + + "the DFP website. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunSalesReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201306.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.SALESPERSON_ID, + Dimension.SALESPERSON_NAME}; + reportJob.reportQuery.columns = new Column[] { + Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM + }; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run sales report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs b/examples/Dfp/CSharp/v201306/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs new file mode 100644 index 00000000000..e337f087c6c --- /dev/null +++ b/examples/Dfp/CSharp/v201306/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs @@ -0,0 +1,105 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201306; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example approves all suggested ad units with 50 or more + /// requests. This feature is only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// Tags: SuggestedAdUnitService.performSuggestedAdUnitAction + /// + class ApproveSuggestedAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example approves all suggested ad units with 50 or more requests. " + + "This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ApproveSuggestedAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201306.SuggestedAdUnitService); + + // Create statement to select all suggested ad units with 50 or more + // requests. + string statementText = "WHERE numRequests >= 50"; + Statement filterStatement = new StatementBuilder(statementText).ToStatement(); + + try { + // Get suggested ad units by statement. + SuggestedAdUnitPage page = + suggestedAdUnitService.getSuggestedAdUnitsByStatement(filterStatement); + + int i = 0; + if (page != null && page.results != null) { + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and \"{2}\" will be " + + "approved.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + + Console.WriteLine("Number of suggested ad units to be approved: " + + page.totalResultSetSize); + + // Create action. + ApproveSuggestedAdUnit action = new ApproveSuggestedAdUnit(); + + // Perform action. + SuggestedAdUnitUpdateResult result = suggestedAdUnitService.performSuggestedAdUnitAction( + action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of suggested ad units approved: " + result.numChanges); + } else { + Console.WriteLine("No suggested ad units were approved."); + } + } else { + Console.WriteLine("No suggested ad units were approved."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to approve suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs b/examples/Dfp/CSharp/v201306/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs new file mode 100644 index 00000000000..2f2526352b7 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201306; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all suggested ad units. To approve suggested ad + /// units, run ApproveSuggestedAdUnits.cs. This feature is only available to + /// DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// + class GetAllSuggestedAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all suggested ad units. To approve suggested ad units, " + + "run ApproveSuggestedAdUnits.cs. This feature is only available to DFP premium " + + "solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllSuggestedAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201306.SuggestedAdUnitService); + + // Set defaults for page and filterStatement. + SuggestedAdUnitPage page = new SuggestedAdUnitPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all suggested ad units. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get suggested ad units by statement. + page = suggestedAdUnitService.getSuggestedAdUnitsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and number of requests " + + "\"{2}\" was found.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/SuggestedAdUnitService/GetSuggestedAdUnit.cs b/examples/Dfp/CSharp/v201306/SuggestedAdUnitService/GetSuggestedAdUnit.cs new file mode 100644 index 00000000000..f2914fa7aff --- /dev/null +++ b/examples/Dfp/CSharp/v201306/SuggestedAdUnitService/GetSuggestedAdUnit.cs @@ -0,0 +1,83 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201306; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets a suggested ad unit by its ID. To determine which + /// suggested ad units exist, run GetAllSuggestedAdUnits.cs. This feature is + /// only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnit + /// + class GetSuggestedAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a suggested ad unit by its ID. To determine which " + + "suggested ad units exist, run GetAllSuggestedAdUnits.cs. This feature is only " + + "available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetSuggestedAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201306.SuggestedAdUnitService); + + // Set the ID of the suggested ad unit to get. + String suggestedAdUnitId = _T("INSERT_SUGGESTED_AD_UNIT_ID_HERE"); + + try { + // Get the suggested ad unit. + SuggestedAdUnit suggestedAdUnit = suggestedAdUnitService.getSuggestedAdUnit( + suggestedAdUnitId); + + if (suggestedAdUnit != null) { + Console.WriteLine("Suggested ad unit with ID \"{0}\", and number of requests \"{1}\" " + + "was found.", suggestedAdUnit.id, suggestedAdUnit.numRequests); + } else { + Console.WriteLine("No suggested ad unit found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs b/examples/Dfp/CSharp/v201306/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs new file mode 100644 index 00000000000..15b728e62c5 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs @@ -0,0 +1,90 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201306; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets suggested ad units that have more than 50 requests. + /// The statement retrieves up to the maximum page size limit of 500. This + /// feature is only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// + class GetSuggestedUnitByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets suggested ad units that have more than 50 requests. The " + + "statement retrieves up to the maximum page size limit of 500. This feature is " + + "only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetSuggestedUnitByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201306.SuggestedAdUnitService); + + // Set the number of requests to 50 or more. + long NUMBER_OF_REQUESTS = 50L; + + // Create a statement to only select suggested ad units that have more + // than 50 requests. + Statement filterStatement = new StatementBuilder("WHERE numRequests > :numRequests LIMIT 500") + .AddValue("numRequests", NUMBER_OF_REQUESTS).ToStatement(); + + try { + // Get suggested ad units by statement. + SuggestedAdUnitPage page = suggestedAdUnitService.getSuggestedAdUnitsByStatement( + filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and number of requests " + + "\"{2}\" was found.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/TeamService/CreateTeams.cs b/examples/Dfp/CSharp/v201306/TeamService/CreateTeams.cs new file mode 100644 index 00000000000..f88f8c46998 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/TeamService/CreateTeams.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using Google.Api.Ads.Dfp.Util.v201306; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates new teams. To determine which teams exist, run + /// GetAllTeams.cs. + /// + /// Tags: TeamService.createTeams + /// + class CreateTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new teams. To determine which teams exist, run " + + "GetAllTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201306.TeamService); + + try { + // Create an array to store local team objects. + Team[] teams = new Team[5]; + + for (int i = 0; i < 5; i++) { + Team team = new Team(); + team.name = "Team #" + i; + team.hasAllCompanies = false; + team.hasAllInventory = false; + teams[i] = team; + } + + // Create the teams on the server. + teams = teamService.createTeams(teams); + + if (teams != null && teams.Length > 0) { + foreach (Team newTeam in teams) { + Console.WriteLine("A team with ID \"{0}\", and name \"{1}\" was created.", + newTeam.id, newTeam.name); + } + } else { + Console.WriteLine("No teams created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create teams. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/TeamService/GetAllTeams.cs b/examples/Dfp/CSharp/v201306/TeamService/GetAllTeams.cs new file mode 100644 index 00000000000..27fd6ff085d --- /dev/null +++ b/examples/Dfp/CSharp/v201306/TeamService/GetAllTeams.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using Google.Api.Ads.Dfp.Util.v201306; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all teams. To create teams, run CreateTeams.cs. + /// + /// Tags: TeamService.getTeamsByStatement + /// + class GetAllTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams. To create teams, run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201306.TeamService); + + // Set defaults for page and filterStatement. + TeamPage page = new TeamPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all teams. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get teams by statement. + page = teamService.getTeamsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Team team in page.results) { + Console.WriteLine("{0}) Team with ID \"{1}\", name \"{2}\" was found.", + i, team.id, team.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all teams. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/TeamService/GetTeam.cs b/examples/Dfp/CSharp/v201306/TeamService/GetTeam.cs new file mode 100644 index 00000000000..5c4d112e3c6 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/TeamService/GetTeam.cs @@ -0,0 +1,78 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using Google.Api.Ads.Dfp.Util.v201306; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets a team by its ID. To determine which teams exist, + /// run GetAllTeams.cs. + /// + /// Tags: TeamService.getTeam + /// + class GetTeam : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a team by its ID. To determine which teams exist, run " + + "GetAllTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetTeam(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201306.TeamService); + + // Set the ID of the team to get. + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + + try { + // Get the team. + Team team = teamService.getTeam(teamId); + + if (team != null) { + Console.WriteLine("Team with ID \"{0}\"and name \"{1}\" was found.", team.id, team.name); + } else { + Console.WriteLine("No team found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get team by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/TeamService/GetTeamsByStatement.cs b/examples/Dfp/CSharp/v201306/TeamService/GetTeamsByStatement.cs new file mode 100644 index 00000000000..2a1560e6446 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/TeamService/GetTeamsByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using Google.Api.Ads.Dfp.Util.v201306; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all teams ordered by name. The statement retrieves + /// up to the maximum page size limit of 500. To create teams, + /// run CreateTeams.cs. + /// + /// Tags: TeamService.getTeamsByStatement + /// + class GetTeamsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams ordered by name. The statement retrieves up to " + + "the maximum page size limit of 500. To create teams, run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetTeamsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201306.TeamService); + + // Create a statement to order teams by name. + Statement filterStatement = new StatementBuilder("ORDER BY name LIMIT 500").ToStatement(); + + try { + // Get teams by statement. + TeamPage page = teamService.getTeamsByStatement(filterStatement); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (Team team in page.results) { + Console.WriteLine("{0}) Team with ID \"{1}\" and name \"{2}\" was found.", + i, team.id, team.name); + i++; + } + } + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get teams by statement. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/TeamService/UpdateTeams.cs b/examples/Dfp/CSharp/v201306/TeamService/UpdateTeams.cs new file mode 100644 index 00000000000..ec670250341 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/TeamService/UpdateTeams.cs @@ -0,0 +1,107 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using Google.Api.Ads.Dfp.Util.v201306; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example updates teams by adding an ad unit to the first 5. To + /// determine which teams exist, run GetAllTeams.cs. To determine which ad + /// units exist, run GetAllAdUnits.cs. + /// + /// Tags: TeamService.getTeamsByStatement, TeamService.updateTeams + /// + class UpdateTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates teams by adding an ad unit to the first 5. To " + + "determine which teams exist, run GetAllTeams.cs. To determine which ad units " + + "exist, run GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201306.TeamService); + + // Set the ID of the ad unit to add to the teams. + String adUnitId = _T("INSERT_AD_UNIT_ID_HERE"); + + // Create a statement to select first 5 teams that aren't built-in. + Statement filterStatement = new StatementBuilder("WHERE id > 0 LIMIT 5").ToStatement(); + + try { + // Get the teams by statement. + TeamPage page = teamService.getTeamsByStatement(filterStatement); + + if (page.results != null) { + Team[] teams = page.results; + + // Update each local team object by adding the ad unit to it. + foreach (Team team in teams) { + // Don't add ad unit if the team has all inventory already. + if (!team.hasAllInventory) { + List adUnitIds = new List(); + if (team.adUnitIds != null) { + adUnitIds.AddRange(team.adUnitIds); + } + adUnitIds.Add(adUnitId); + team.adUnitIds = adUnitIds.ToArray(); + } + } + + // Update the teams on the server. + teams = teamService.updateTeams(teams); + + if (teams != null) { + foreach (Team team in teams) { + Console.WriteLine("A team with ID \"{0}\" and name \"{1}\" was updated.", + team.id, team.name); + } + } else { + Console.WriteLine("No teams updated."); + } + } else { + Console.WriteLine("No teams found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update teams. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/UserService/CreateUsers.cs b/examples/Dfp/CSharp/v201306/UserService/CreateUsers.cs new file mode 100644 index 00000000000..d16bb7d477c --- /dev/null +++ b/examples/Dfp/CSharp/v201306/UserService/CreateUsers.cs @@ -0,0 +1,100 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example creates new users. To determine which users + /// exist, run GetAllUsers.cs. + /// + /// Tags: UserService.createUsers + /// + class CreateUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new users. To determine which users " + + "exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201306.UserService); + + // Set the user's email addresses and names. + List emailAndNames = new List(); + emailAndNames.Add(new String[] {_T("INSERT_EMAIL_ADDRESS_HERE"), _T("INSERT_NAME_HERE")}); + emailAndNames.Add(new String[] {_T("INSERT_ANOTHER_EMAIL_ADDRESS_HERE"), + _T("INSERT_ANOTHER_NAME_HERE")}); + + // Roles can be obtained by running GetAllRoles.cs. + long roleId = long.Parse(_T("INSERT_ROLE_ID_HERE")); + + // Create an array to store local user objects. + User[] users = new User[emailAndNames.Count]; + + for (int i = 0; i < users.Length; i++) { + // Create the new user structure. + User newUser = new User(); + newUser.email = emailAndNames[i][0]; + newUser.name = emailAndNames[i][1]; + newUser.roleId = roleId; + newUser.preferredLocale = "en_US"; + + users[i] = newUser; + } + + try { + // Create the users. + users = userService.createUsers(users); + + if (users != null) { + foreach (User newUser in users) { + Console.WriteLine("A user with ID = '{0}', email = '{1}', and role = '{2}' " + + "was created.", newUser.id, newUser.email, newUser.roleName); + } + } else { + Console.WriteLine("No users created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/UserService/DeactivateUser.cs b/examples/Dfp/CSharp/v201306/UserService/DeactivateUser.cs new file mode 100644 index 00000000000..e92d87ac977 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/UserService/DeactivateUser.cs @@ -0,0 +1,123 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example deactivates a user. Deactivated users can no longer make + /// requests to the API. The user making the request cannot deactivate itself. + /// To determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserService.getUsersByStatement, UserService.performUserAction + /// + class DeactivateUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates a user. Deactivated users can no longer make " + + "requests to the API. The user making the request cannot deactivate itself. " + + "To determine which users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201306.UserService); + + // Set the ID of the user to deactivate + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create Statement text to select user by id. + string statementText = "WHERE id = :userId LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("userId", userId).ToStatement(); + + // Sets defaults for page and offset. + UserPage page = new UserPage(); + int offset = 0; + List userIds = new List(); + + try { + do { + // Create a Statement to page through users. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get users by Statement. + page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User userResult in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and status = '{3}'" + + " will be deactivated.", i, userResult.id, userResult.email, + userResult.isActive ? "ACTIVE" : "INACTIVE"); + userIds.Add(userResult.id.ToString()); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of users to be deactivated: {0}", page.totalResultSetSize); + + if (userIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", userIds.ToArray()))). + ToStatement(); + + // Create action. + DeactivateUsers action = new DeactivateUsers(); + + // Perform action. + UpdateResult result = userService.performUserAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of users deactivated: {0}" + result.numChanges); + } else { + Console.WriteLine("No users were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/UserService/GetAllRoles.cs b/examples/Dfp/CSharp/v201306/UserService/GetAllRoles.cs new file mode 100644 index 00000000000..972a894b4a5 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/UserService/GetAllRoles.cs @@ -0,0 +1,77 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all roles. This example can be used to determine + /// which role ID is needed when getting and creating users. + /// + /// Tags: UserService.getAllRoles + /// + class GetAllRoles : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all roles. This example can be used to determine which " + + "role ID is needed when getting and creating users."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllRoles(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201306.UserService); + + try { + // Get all roles. + Role[] roles = userService.getAllRoles(); + int numRoles = 0; + if (roles != null && roles.Length > 0) { + foreach (Role role in roles) { + Console.WriteLine("Role with ID = '{0}' and name ='{1}' was found.", role.id, + role.name); + } + numRoles = roles.Length; + } + + Console.WriteLine("Number of results found: " + numRoles); + } catch (Exception ex) { + Console.WriteLine("Failed to get all roles. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/UserService/GetAllUsers.cs b/examples/Dfp/CSharp/v201306/UserService/GetAllUsers.cs new file mode 100644 index 00000000000..ba423bad9ce --- /dev/null +++ b/examples/Dfp/CSharp/v201306/UserService/GetAllUsers.cs @@ -0,0 +1,87 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all users. To create users, run CreateUsers.cs. + /// + /// Tags: UserService.getUsersByStatement + /// + class GetAllUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all users. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201306.UserService); + + // Sets defaults for page and Statement. + UserPage page = new UserPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all users. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get users by Statement. + page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User usr in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and role = '{3}'" + + " was found.", i, usr.id, usr.email, usr.roleName); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/UserService/GetCurrentUser.cs b/examples/Dfp/CSharp/v201306/UserService/GetCurrentUser.cs new file mode 100644 index 00000000000..1e2eb4a6623 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/UserService/GetCurrentUser.cs @@ -0,0 +1,71 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets current user. To create users, run CreateUsers.cs. + /// + /// Tags: UserService.getCurrentUser + /// + class GetCurrentUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets current user. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCurrentUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201306.UserService); + + try { + // Get the current user. + User usr = userService.getCurrentUser(); + + if (usr != null) { + Console.WriteLine("User with ID = '{0}', email = '{1}', and role = '{2}' is the " + + "current user.", usr.id, usr.email, usr.roleName); + } else { + Console.WriteLine("The current user could not be retrieved."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get current user. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/UserService/GetUser.cs b/examples/Dfp/CSharp/v201306/UserService/GetUser.cs new file mode 100644 index 00000000000..65ed1dd5697 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/UserService/GetUser.cs @@ -0,0 +1,76 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets a user by its ID. To create users, run + /// CreateUsers.cs. + /// + /// Tags: UserService.getUser + /// + class GetUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets a user by its ID. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201306.UserService); + + // Set the ID of the user to get. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + try { + // Get the user. + User usr = userService.getUser(userId); + + if (usr != null) { + Console.WriteLine("User with ID = '{0}', email = '{1}', and role = '{2}' was found.", + usr.id, usr.email, usr.roleName); + } else { + Console.WriteLine("No user found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/UserService/GetUsersByStatement.cs b/examples/Dfp/CSharp/v201306/UserService/GetUsersByStatement.cs new file mode 100644 index 00000000000..ebb9d6d767c --- /dev/null +++ b/examples/Dfp/CSharp/v201306/UserService/GetUsersByStatement.cs @@ -0,0 +1,82 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all users sorted by name. The Statement retrieves + /// up to the maximum page size limit of 500. To create new users, + /// run CreateUsers.cs. + /// + /// Tags: UserService.getUsersByStatement + /// + class GetUsersByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return " This code example gets all users sorted by name. The Statement retrieves " + + "up to the maximum page size limit of 500. To create new users, " + + "run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUsersByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201306.UserService); + + // Create a Statement to get all users sorted by name. + Statement statement = new Statement(); + statement.query = "ORDER BY name LIMIT 500"; + + try { + // Get users by Statement. + UserPage page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User usr in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and role = '{3}'" + + " was found.", i, usr.id, usr.email, usr.roleName); + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/UserService/UpdateUsers.cs b/examples/Dfp/CSharp/v201306/UserService/UpdateUsers.cs new file mode 100644 index 00000000000..833e6461483 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/UserService/UpdateUsers.cs @@ -0,0 +1,96 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example updates all users by adding "Sr." to the end of each + /// name (after a very large baby boom and lack of creativity). To + /// determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserService.getUsersByStatement, UserService.updateUsers + /// + class UpdateUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates all users by adding 'Sr.' to the end of each " + + "name (after a very large baby boom and lack of creativity). To " + + "determine which users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserService. + UserService userService = (UserService) dfpUser.GetService(DfpService.v201306.UserService); + + // Create a Statement to get all users. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get users by Statement. + UserPage page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + User[] users = page.results; + + // Update each local users object by changing its name. + foreach (User user in users) { + user.name = user.name + " Sr."; + } + + // Update the users on the server. + users = userService.updateUsers(users); + + if (users != null) { + foreach (User user in users) { + Console.WriteLine("A user with ID = '{0}', name ='{1}', and role = '{2}'" + + " was updated.", user.id, user.name, user.roleName); + } + } else { + Console.WriteLine("No users updated."); + } + } else { + Console.WriteLine("No users found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/UserTeamAssociationService/CreateUserTeamAssociations.cs b/examples/Dfp/CSharp/v201306/UserTeamAssociationService/CreateUserTeamAssociations.cs new file mode 100644 index 00000000000..0b747310576 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/UserTeamAssociationService/CreateUserTeamAssociations.cs @@ -0,0 +1,98 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example adds a user to a team by creating an association + /// between the two. To determine which teams exist, run GetAllTeams.cs. To + /// determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.createUserTeamAssociations + /// + class CreateUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a user to a team by creating an association between the " + + "two. To determine which teams exist, run GetAllTeams.cs. To determine which users " + + "exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201306.UserTeamAssociationService); + + // Set the users and team to add them to. + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + long[] userIds = new long[] {long.Parse(_T("INSERT_USER_ID_HERE"))}; + + // Create an array to store local user team association objects. + UserTeamAssociation[] userTeamAssociations = new UserTeamAssociation[userIds.Length]; + + // For each user, associate it with the given team. + int i = 0; + + foreach (long userId in userIds) { + UserTeamAssociation userTeamAssociation = new UserTeamAssociation(); + userTeamAssociation.userId = userId; + userTeamAssociation.teamId = teamId; + userTeamAssociations[i++] = userTeamAssociation; + } + + try { + // Create the user team associations on the server. + userTeamAssociations = + userTeamAssociationService.createUserTeamAssociations(userTeamAssociations); + + if (userTeamAssociations != null) { + foreach (UserTeamAssociation userTeamAssociation in userTeamAssociations) { + Console.WriteLine("A user team association between user with ID \"{0}\" and team " + + "with ID \"{1}\" was created.", userTeamAssociation.userId, + userTeamAssociation.teamId); + } + } else { + Console.WriteLine("No user team associations created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/UserTeamAssociationService/DeleteUserTeamAssociations.cs b/examples/Dfp/CSharp/v201306/UserTeamAssociationService/DeleteUserTeamAssociations.cs new file mode 100644 index 00000000000..2c0f511188f --- /dev/null +++ b/examples/Dfp/CSharp/v201306/UserTeamAssociationService/DeleteUserTeamAssociations.cs @@ -0,0 +1,121 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example removes the user from all its teams. To determine which + /// users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.performUserTeamAssociationAction + /// + class DeleteUserTeamAssociation : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example removes the user from all its teams. To determine which " + + "users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeleteUserTeamAssociation(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201306.UserTeamAssociationService); + + // Set the user to remove from its teams. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create filter text to select user team associations by the user ID. + String statementText = "WHERE userId = :userId LIMIT 500"; + Statement filterStatement = new StatementBuilder("").AddValue("userId", userId). + ToStatement(); + + // Set defaults for page and offset. + UserTeamAssociationPage page = new UserTeamAssociationPage(); + int offset = 0; + + try { + do { + // Create a statement to page through user team associations. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get user team associations by statement. + page = userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and " + + "team with ID \"{2}\" will be deleted.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of teams that the user will be removed from: " + + page.totalResultSetSize); + + if (page.totalResultSetSize > 0) { + // Modify statement for action. + filterStatement.query = "WHERE userId = :userId"; + + // Create action. + DeleteUserTeamAssociations action = new DeleteUserTeamAssociations(); + + // Perform action. + UpdateResult result = + userTeamAssociationService.performUserTeamAssociationAction(action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of teams that the user was removed from: " + + result.numChanges); + } else { + Console.WriteLine("No user team associations were deleted."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to delete user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/UserTeamAssociationService/GetAllUserTeamAssociations.cs b/examples/Dfp/CSharp/v201306/UserTeamAssociationService/GetAllUserTeamAssociations.cs new file mode 100644 index 00000000000..26af1472d6c --- /dev/null +++ b/examples/Dfp/CSharp/v201306/UserTeamAssociationService/GetAllUserTeamAssociations.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all user team associations. To create user team + /// associations, run CreateUserTeamAssociations.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// + class GetAllUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all user team associations. To create user team " + + "associations, run CreateUserTeamAssociations.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201306.UserTeamAssociationService); + + // Set defaults for page and filterStatement. + UserTeamAssociationPage page = new UserTeamAssociationPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all user team associations. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get user team associations by statement. + page = userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and " + + "team with ID \"{2}\" was found.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}." + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/UserTeamAssociationService/GetUserTeamAssociation.cs b/examples/Dfp/CSharp/v201306/UserTeamAssociationService/GetUserTeamAssociation.cs new file mode 100644 index 00000000000..472b30f9cc1 --- /dev/null +++ b/examples/Dfp/CSharp/v201306/UserTeamAssociationService/GetUserTeamAssociation.cs @@ -0,0 +1,84 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets a user team association by the user and team ID. + /// To determine which teams exist, run GetAllTeams.cs. To determine which + /// users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociation + /// + class GetUserTeamAssociation : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a user team association by the user and team ID. To " + + "determine which teams exist, run GetAllTeams.cs. To determine which users exist, " + + "run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUserTeamAssociation(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201306.UserTeamAssociationService); + + // Set the IDs of the user and team to get the association for. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + + try { + // Get the user team association. + UserTeamAssociation userTeamAssociation = userTeamAssociationService.getUserTeamAssociation( + teamId, userId); + + if (userTeamAssociation != null) { + Console.WriteLine("User team association between user with ID \"{0}\" and team with " + + "ID \"{1}\" was found.", userTeamAssociation.userId, userTeamAssociation.teamId); + } else { + Console.WriteLine("No user team association found."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs b/examples/Dfp/CSharp/v201306/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs new file mode 100644 index 00000000000..f33e6d95f7c --- /dev/null +++ b/examples/Dfp/CSharp/v201306/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs @@ -0,0 +1,98 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example gets all teams that the current user belongs to. The + /// statement retrieves up to the maximum page size limit of 500. To create + /// teams, run CreateTeams.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// Tags: UserService.getCurrentUser + /// + class GetUserTeamAssociationsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams that the current user belongs to. The " + + "statement retrieves up to the maximum page size limit of 500. To create teams, " + + "run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUserTeamAssociationsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201306.UserTeamAssociationService); + + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201306.UserService); + + try { + // Get the current user. + long currentUserId = userService.getCurrentUser().id; + + // Create filter text to select user team associations by the user ID. + String statementText = "WHERE userId = :userId LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText). + AddValue("userId", currentUserId).ToStatement(); + + // Get user team associations by statement. + UserTeamAssociationPage page = + userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and team " + + "with ID \"{2}\" was found.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201306/UserTeamAssociationService/UpdateUserTeamAssociations.cs b/examples/Dfp/CSharp/v201306/UserTeamAssociationService/UpdateUserTeamAssociations.cs new file mode 100644 index 00000000000..c95e5f5296f --- /dev/null +++ b/examples/Dfp/CSharp/v201306/UserTeamAssociationService/UpdateUserTeamAssociations.cs @@ -0,0 +1,107 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201306 { + /// + /// This code example updates user team associations by setting the + /// overridden access type to read only for all teams that the user belongs + /// to. To determine which users exists, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// Tags: UserTeamAssociationService.updateUserTeamAssociations + /// + class UpdateUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates user team associations by setting the overridden " + + "access type to read only for all teams that the user belongs to. To determine " + + "which users exists, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201306.UserTeamAssociationService); + + // Set the user to set to read only access within its teams. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create filter text to select user team associations by the user ID. + String statementText = "WHERE userId = :userId LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText). + AddValue("userId", userId).ToStatement(); + + try { + // Get user team associations by statement. + UserTeamAssociationPage page = + userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + if (page.results != null) { + UserTeamAssociation[] userTeamAssociations = page.results; + + // Update each local user team association to read only access. + foreach (UserTeamAssociation userTeamAssociation in userTeamAssociations) { + userTeamAssociation.overriddenTeamAccessType = TeamAccessType.READ_ONLY; + } + + // Update the user team associations on the server. + userTeamAssociations = + userTeamAssociationService.updateUserTeamAssociations(userTeamAssociations); + + if (userTeamAssociations != null) { + foreach (UserTeamAssociation userTeamAssociation in userTeamAssociations) { + Console.WriteLine("User team association between user with ID \"{0}\" and team " + + "with ID \"{1}\" was updated to access type \"{2}\".", userTeamAssociation.userId, + userTeamAssociation.teamId, userTeamAssociation.overriddenTeamAccessType); + } + } else { + Console.WriteLine("No user team associations updated."); + } + } else { + Console.WriteLine("No user team associations found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ActivityGroupService/CreateActivityGroups.cs b/examples/Dfp/CSharp/v201308/ActivityGroupService/CreateActivityGroups.cs new file mode 100644 index 00000000000..2df8cd4183f --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ActivityGroupService/CreateActivityGroups.cs @@ -0,0 +1,96 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates new activity groups. To determine which activity + /// groups exist, run GetAllActivityGroups.cs. + /// + /// Tags: ActivityGroupService.createActivityGroups + /// + class CreateActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new activity groups. To determine which activity " + + "groups exist, run GetAllActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201308.ActivityGroupService); + + // Set the ID of the advertiser company this activity group is associated + // with. + long advertiserCompanyId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Create a short-term activity group. + ActivityGroup shortTermActivityGroup = new ActivityGroup(); + shortTermActivityGroup.name = "Short-term activity group #" + GetTimeStamp(); + shortTermActivityGroup.companyIds = new long[] {advertiserCompanyId}; + shortTermActivityGroup.clicksLookback = 1; + shortTermActivityGroup.impressionsLookback = 1; + + // Create a long-term activity group. + ActivityGroup longTermActivityGroup = new ActivityGroup(); + longTermActivityGroup.name = "Long-term activity group #" + GetTimeStamp(); + longTermActivityGroup.companyIds = new long[] {advertiserCompanyId}; + longTermActivityGroup.clicksLookback = 30; + longTermActivityGroup.impressionsLookback = 30; + + try { + // Create the activity groups on the server. + ActivityGroup[] activityGroups = activityGroupService.createActivityGroups( + new ActivityGroup[] {shortTermActivityGroup, longTermActivityGroup}); + + // Display results. + if (activityGroups != null) { + foreach (ActivityGroup activityGroup in activityGroups) { + Console.WriteLine("An activity group with ID \"{0}\" and name \"{1}\" was created.", + activityGroup.id, activityGroup.name); + } + } else { + Console.WriteLine("No activity groups were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ActivityGroupService/GetActiveActivityGroups.cs b/examples/Dfp/CSharp/v201308/ActivityGroupService/GetActiveActivityGroups.cs new file mode 100644 index 00000000000..7b751539be4 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ActivityGroupService/GetActiveActivityGroups.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; +using Google.Api.Ads.Dfp.Util.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all active activity groups. To create activity + /// groups, run CreateActivityGroups.cs. + /// + /// Tags: ContactService.getContactsByStatement + /// + class GetActiveActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active activity groups. To create activity groups, " + + "run CreateActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActiveActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201308.ActivityGroupService); + + Statement filterStatement = new StatementBuilder("").AddValue( + "status", ActivityGroupStatus.ACTIVE.ToString()).ToStatement(); + + // Set defaults for page and filterStatement. + ActivityGroupPage page; + int offset = 0; + + try { + do { + // Create a statement to get all content. + filterStatement.query = "WHERE status = :status ORDER BY id LIMIT 500 OFFSET " + + offset.ToString(); + + + // Get contacts by statement. + page = activityGroupService.getActivityGroupsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (ActivityGroup activityGroup in page.results) { + Console.WriteLine("{0}) Activity group with ID \"{1}\" and name \"{2}\" was found.", + i, activityGroup.id, activityGroup.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ActivityGroupService/GetAllActivityGroups.cs b/examples/Dfp/CSharp/v201308/ActivityGroupService/GetAllActivityGroups.cs new file mode 100644 index 00000000000..4307382b6c9 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ActivityGroupService/GetAllActivityGroups.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; +using Google.Api.Ads.Dfp.Util.v201308; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all activity groups. To create activity groups, run + /// CreateActivityGroups.cs. + /// + /// Tags: ActivityGroupService.getActivityGroupsByStatement + /// + class GetAllActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all activity groups. To create activity groups, run " + + "CreateActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201308.ActivityGroupService); + + ActivityGroupPage page; + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + filterStatement.query = "ORDER BY id LIMIT 500 OFFSET " + offset.ToString(); + // Get activity groups by statement. + page = activityGroupService.getActivityGroupsByStatement(filterStatement); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + + foreach (ActivityGroup activityGroup in page.results) { + Console.WriteLine("{0}) Activity group with ID \"{1}\" and name \"{2}\" was " + + "found.", i, activityGroup.id, activityGroup.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ActivityGroupService/UpdateActivityGroups.cs b/examples/Dfp/CSharp/v201308/ActivityGroupService/UpdateActivityGroups.cs new file mode 100644 index 00000000000..a4936cafb26 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ActivityGroupService/UpdateActivityGroups.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; +using Google.Api.Ads.Dfp.Util.v201308; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example updates activity groups by adding a company. To + /// determine which activity groups exist, run GetAllActivityGroups.cs. + /// + /// Tags: ActivityGroupService.getActivityGroup + /// Tags: ActivityGroupService.updateActivityGroups + /// + class UpdateActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates activity groups by adding a company. To determine " + + "which activity groups exist, run GetAllActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201308.ActivityGroupService); + + // Set the ID of the activity group and the company to update it with. + int activityGroupId = int.Parse(_T("INSERT_ACTIVITY_GROUP_ID_HERE")); + long advertiserCompanyId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + try { + // Get the activity group. + ActivityGroup activityGroup = activityGroupService.getActivityGroup(activityGroupId); + + // Update the companies. + List companyIds = new List(activityGroup.companyIds); + companyIds.Add(advertiserCompanyId); + activityGroup.companyIds = companyIds.ToArray(); + + // Update the activity groups on the server. + ActivityGroup[] activityGroups = activityGroupService.updateActivityGroups( + new ActivityGroup[] {activityGroup}); + + // Display results. + if (activityGroups != null) { + foreach (ActivityGroup updatedActivityGroup in activityGroups) { + Console.WriteLine("Activity group with ID \"{0}\" and name \"{1}\" was updated.", + updatedActivityGroup.id, updatedActivityGroup.name); + } + } else { + Console.WriteLine("No activity groups were updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ActivityService/CreateActivities.cs b/examples/Dfp/CSharp/v201308/ActivityService/CreateActivities.cs new file mode 100644 index 00000000000..3e0d06e7fef --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ActivityService/CreateActivities.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates new activities. To determine which activities + /// exist, run GetAllActivities.cs. + /// + /// Tags: ActivityService.createActivities + /// + class CreateActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new activities. To determine which activities exist, " + + "run GetAllActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201308.ActivityService); + + // Set the ID of the activity group this activity is associated with. + int activityGroupId = int.Parse(_T("INSERT_ACTIVITY_GROUP_ID_HERE")); + + // Create a daily visits activity. + Activity dailyVisitsActivity = new Activity(); + dailyVisitsActivity.name = "Activity #" + GetTimeStamp(); + dailyVisitsActivity.activityGroupId = activityGroupId; + dailyVisitsActivity.type = ActivityType.DAILY_VISITS; + + // Create a custom activity. + Activity customActivity = new Activity(); + customActivity.name = "Activity #" + GetTimeStamp(); + customActivity.activityGroupId = activityGroupId; + customActivity.type = ActivityType.CUSTOM; + + try { + // Create the activities on the server. + Activity[] activities = activityService.createActivities( + new Activity[] {dailyVisitsActivity, customActivity}); + + // Display results. + if (activities != null) { + foreach (Activity newActivity in activities) { + Console.WriteLine("An activity with ID \"{0}\", name \"{1}\", and type \"{2}\" was " + + "created.\n", newActivity.id, newActivity.name, newActivity.type); + } + } else { + Console.WriteLine("No activities were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create activities. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ActivityService/GetActiveActivities.cs b/examples/Dfp/CSharp/v201308/ActivityService/GetActiveActivities.cs new file mode 100644 index 00000000000..cc1a95bc4de --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ActivityService/GetActiveActivities.cs @@ -0,0 +1,100 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; +using Google.Api.Ads.Dfp.Util.v201308; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all active activities. To create activities, + /// run CreateActivities.cs. + /// + /// Tags: ActivityService.getActivitiesByStatement + /// + class GetActiveActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active activities. To create activities, run " + + "CreateActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActiveActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201308.ActivityService); + + // Set the ID of the activity group these activities are associated with. + long activityGroupId = long.Parse(_T("INSERT_ACTIVITY_GROUP_ID_HERE")); + + // Statement parts to help build a statement that only selects active + // activities. + Statement filterStatement = new StatementBuilder(""). + AddValue("activityGroupId", activityGroupId). + AddValue("status", ActivityStatus.ACTIVE.ToString()). + ToStatement(); + + int offset = 0; + ActivityPage page; + + try { + do { + filterStatement.query = "WHERE activityGroupId = :activityGroupId and status = :status " + + "ORDER BY id LIMIT 500 OFFSET " + offset; + + page = activityService.getActivitiesByStatement(filterStatement); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (Activity activity in page.results) { + Console.WriteLine("{0}) Activity with ID \"{1}\", name \"{2}\", and type \"{3}\" " + + "was found.", i, activity.id, activity.name, activity.type); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}.", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get activities. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ActivityService/GetAllActivities.cs b/examples/Dfp/CSharp/v201308/ActivityService/GetAllActivities.cs new file mode 100644 index 00000000000..7d4dac4fcb0 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ActivityService/GetAllActivities.cs @@ -0,0 +1,132 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; +using Google.Api.Ads.Dfp.Util.v201308; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all activities. To create activities, run + /// CreateActivities.cs. + /// + /// Tags: ActivityService.getActivitiesByStatement + /// Tags: ActivityGroupService.getActivityGroupsByStatement + /// + class GetAllActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all activities. To create activities, run " + + "CreateActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201308.ActivityService); + + int totalResultsCounter = 0; + + try { + long[] activityGroupIds = getAllActivityGroupIds(user); + + foreach (long activityGroupId in activityGroupIds) { + Statement filterStatement = new StatementBuilder("").AddValue( + "activityGroupId", activityGroupId).ToStatement(); + + ActivityPage page = new ActivityPage(); + int offset = 0; + + do { + filterStatement.query = "WHERE activityGroupId = :activityGroupId ORDER BY id " + + "LIMIT 500 OFFSET " + offset; + // Get activities by statement. + page = activityService.getActivitiesByStatement(filterStatement); + + // Display results. + if (page.results != null) { + foreach (Activity activity in page.results) { + Console.WriteLine("{0}) Activity with ID \"{1}\", name \"{2}\", type \"{3}\", " + + "and activity group ID \"{4}\" was found.\n", totalResultsCounter, + activity.id, activity.name, activity.type, activityGroupId); + totalResultsCounter++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + } + Console.WriteLine("Number of results found: {0}.", totalResultsCounter); + } catch (Exception ex) { + Console.WriteLine("Failed to get contacts. Exception says \"{0}\"", ex.Message); + } + } + + /// + /// Get the list of all activity group ids. + /// + /// The DfpUser. + /// A list of ids for all the activity groups. + private long[] getAllActivityGroupIds(DfpUser user) { + List activityGroupIds = new List(); + + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201308.ActivityGroupService); + + ActivityGroupPage page; + Statement filterStatement = new Statement(); + int offset = 0; + + do { + // Create a statement to get all activity groups. + filterStatement.query = "ORDER BY id LIMIT 500 OFFSET " + offset.ToString(); + + // Get activity groups by statement. + page = activityGroupService.getActivityGroupsByStatement(filterStatement); + if (page.results != null) { + foreach (ActivityGroup activityGroup in page.results) { + activityGroupIds.Add(activityGroup.id); + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + return activityGroupIds.ToArray(); + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ActivityService/UpdateActivities.cs b/examples/Dfp/CSharp/v201308/ActivityService/UpdateActivities.cs new file mode 100644 index 00000000000..8a3e1b6863c --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ActivityService/UpdateActivities.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; +using Google.Api.Ads.Dfp.Util.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example updates activity expected URLs. To determine which + /// activities exist, run GetAllActivities.cs. + /// + /// Tags: ActivityService.getActivity + /// Tags: ActivityService.updateActivities + /// + class UpdateActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates activity expected URLs. To determine which activities " + + "exist, run GetAllActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201308.ActivityService); + + // Set the ID of the activity to update. + int activityId = int.Parse(_T("INSERT_ACTIVITY_ID_HERE")); + + try { + // Get the activity. + Activity activity = activityService.getActivity(activityId); + + // Update the expected URL. + activity.expectedURL = "https://www.google.com"; + + // Update the activity on the server. + Activity[] activities = activityService.updateActivities(new Activity[] {activity}); + + // Display results. + if (activities != null) { + foreach (Activity updatedActivity in activities) { + Console.WriteLine("Activity with ID \"{0}\" and name \"{1}\" was updated.", + updatedActivity.id, updatedActivity.name); + } + } else { + Console.WriteLine("No activities were updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update activities. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/AudienceSegmentService/CreateAudienceSegments.cs b/examples/Dfp/CSharp/v201308/AudienceSegmentService/CreateAudienceSegments.cs new file mode 100644 index 00000000000..1d2fd3d8be0 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/AudienceSegmentService/CreateAudienceSegments.cs @@ -0,0 +1,121 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates new rule based first party audience segments. To + /// determine which audience segments exist, run GetAllAudienceSegments.cs. + /// + /// Tags: AudienceSegmentService.createAudienceSegments + /// + class CreateAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new rule based first party audience segments. To " + + "determine which audience segments exist, run GetAllAudienceSegments.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = (AudienceSegmentService) user.GetService( + DfpService.v201308.AudienceSegmentService); + + // Get the NetworkService. + NetworkService networkService = (NetworkService) user.GetService( + DfpService.v201308.NetworkService); + + long customTargetingKeyId = long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + long customTargetingValueId = long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE")); + + try { + // Get the root ad unit ID used to target the whole site. + String rootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + + // Create ad unit targeting for the root ad unit (i.e. the whole network). + AdUnitTargeting adUnitTargeting = new AdUnitTargeting(); + adUnitTargeting.adUnitId = rootAdUnitId; + adUnitTargeting.includeDescendants = true; + + inventoryTargeting.targetedAdUnits = new AdUnitTargeting[] {adUnitTargeting}; + + // Create the custom criteria to be used in the segment rule. + // CUSTOM_TARGETING_KEY_ID == CUSTOM_TARGETING_VALUE_ID + CustomCriteria customCriteria = new CustomCriteria(); + customCriteria.keyId = customTargetingKeyId; + customCriteria.@operator = CustomCriteriaComparisonOperator.IS; + customCriteria.valueIds = new long[] {customTargetingValueId}; + + // Create the custom criteria expression. + CustomCriteriaSet topCustomCriteriaSet = new CustomCriteriaSet(); + topCustomCriteriaSet.logicalOperator = CustomCriteriaSetLogicalOperator.AND; + topCustomCriteriaSet.children = new CustomCriteriaNode[] {customCriteria}; + + // Create the audience segment rule. + FirstPartyAudienceSegmentRule rule = new FirstPartyAudienceSegmentRule(); + rule.inventoryRule = inventoryTargeting; + rule.customCriteriaRule = topCustomCriteriaSet; + + // Create an audience segment. + RuleBasedFirstPartyAudienceSegment audienceSegment = + new RuleBasedFirstPartyAudienceSegment(); + audienceSegment.name = "Sports enthusiasts audience segment #" + this.GetTimeStamp(); + audienceSegment.description = "Sports enthusiasts between the ages of 20 and 30."; + audienceSegment.pageViews = 6; + audienceSegment.recencyDays = 6; + audienceSegment.membershipExpirationDays = 88; + audienceSegment.rule = rule; + + // Create the audience segment on the server. + AudienceSegment[] audienceSegments = audienceSegmentService.createAudienceSegments( + new FirstPartyAudienceSegment[] {audienceSegment}); + + foreach (AudienceSegment createdAudienceSegment in audienceSegments) { + Console.WriteLine("An audience segment with ID \"{0}\", name \"{1}\", and type \"{2}\" " + + "was created.", createdAudienceSegment.id, createdAudienceSegment.name, + createdAudienceSegment.type); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get audience segment. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/AudienceSegmentService/GetAllAudienceSegments.cs b/examples/Dfp/CSharp/v201308/AudienceSegmentService/GetAllAudienceSegments.cs new file mode 100644 index 00000000000..00d1a982cd6 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/AudienceSegmentService/GetAllAudienceSegments.cs @@ -0,0 +1,90 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all audience segments.To create audience segments, + /// run CreateAudienceSegments.cs. + /// + /// Tags: AudienceSegmentService.getAudienceSegmentsByStatement + /// + class GetAllAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all audience segments. To create audience segments, run " + + "CreateAudienceSegments.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = + (AudienceSegmentService) user.GetService(DfpService.v201308.AudienceSegmentService); + + // Set defaults for page and Statement. + AudienceSegmentPage page = new AudienceSegmentPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all audience segments. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get audience segment by Statement. + page = audienceSegmentService.getAudienceSegmentsByStatement(statement); + + // Display results. + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AudienceSegment segment in page.results) { + Console.WriteLine("{0}) 'Audience segment with id \"{1}\" and name \"{2}\" was " + + "found.", i, segment.id, segment.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get audience segment. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/AudienceSegmentService/GetFirstPartyAudienceSegments.cs b/examples/Dfp/CSharp/v201308/AudienceSegmentService/GetFirstPartyAudienceSegments.cs new file mode 100644 index 00000000000..a83fee6615c --- /dev/null +++ b/examples/Dfp/CSharp/v201308/AudienceSegmentService/GetFirstPartyAudienceSegments.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using Google.Api.Ads.Dfp.Util.v201308; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all first party audience segments. To create first + /// party audience segments, run CreateAudienceSegments.cs. + /// + /// Tags: AudienceSegmentService.getAudienceSegmentsByStatement + /// + class GetFirstPartyAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all first party audience segments. To create first " + + "party audience segments, run CreateAudienceSegments.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetFirstPartyAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = + (AudienceSegmentService) user.GetService(DfpService.v201308.AudienceSegmentService); + + // Create a statement to only select first party audience segments. + string statementText = "where type = :type order by id ASC LIMIT 500"; + Statement statement = new StatementBuilder(statementText). + AddValue("type", "FIRST_PARTY").ToStatement(); + // Set defaults for page and Statement. + AudienceSegmentPage page = new AudienceSegmentPage(); + int offset = 0; + + try { + do { + // Create a Statement to get all first party audience segments. + statement.query = statementText + " OFFSET " + offset; + + // Get audience segment by Statement. + page = audienceSegmentService.getAudienceSegmentsByStatement(statement); + + // Display results. + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AudienceSegment segment in page.results) { + Console.WriteLine("{0}) 'Audience segment with id \"{1}\" and name \"{2}\" was " + + "found.", i, segment.id, segment.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get audience segment. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/AudienceSegmentService/PopulateFirstPartyAudienceSegments.cs b/examples/Dfp/CSharp/v201308/AudienceSegmentService/PopulateFirstPartyAudienceSegments.cs new file mode 100644 index 00000000000..b237c0079d1 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/AudienceSegmentService/PopulateFirstPartyAudienceSegments.cs @@ -0,0 +1,98 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using Google.Api.Ads.Dfp.Util.v201308; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example populates a specific rule base first party audience + /// segment. To determine which audience segments exist, run + /// GetAllAudienceSegments.cs. + /// + /// Tags: AudienceSegmentService.getAudienceSegmentsByStatement + /// Tags: AudienceSegmentService.performAudienceSegmentAction + /// + class PopulateFirstPartyAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example populates a specific rule base first party audience segment. " + + "To determine which audience segments exist, run GetAllAudienceSegments.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new PopulateFirstPartyAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = + (AudienceSegmentService) user.GetService(DfpService.v201308.AudienceSegmentService); + + long audienceSegmentId = long.Parse(_T("INSERT_AUDIENCE_SEGMENT_ID_HERE")); + + // Create a statement to only select a specified first party audience + // segment. + string statementText = "where id = :audienceSegmentId order by id ASC " + + "LIMIT 1"; + Statement statement = new StatementBuilder(statementText) + .AddValue("audienceSegmentId", audienceSegmentId) + .ToStatement(); + + try { + // Get audience segment by Statement. + AudienceSegment audienceSegment = + audienceSegmentService.getAudienceSegmentsByStatement(statement).results[0]; + + Console.WriteLine("Audience segment with id \"{0}\" and name \"{1}\" " + + "will be populated", audienceSegment.id, audienceSegment.name); + // Create action. + PopulateAudienceSegments action = new PopulateAudienceSegments(); + statement.query = statementText; + + // Perform action. + UpdateResult result = audienceSegmentService.performAudienceSegmentAction( + action, statement); + + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of audience segments populated: {0}", result.numChanges); + } else { + Console.WriteLine("No audience segments were populated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to populate audience segment. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/AudienceSegmentService/UpdateAudienceSegments.cs b/examples/Dfp/CSharp/v201308/AudienceSegmentService/UpdateAudienceSegments.cs new file mode 100644 index 00000000000..85ae3c4ca98 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/AudienceSegmentService/UpdateAudienceSegments.cs @@ -0,0 +1,97 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using Google.Api.Ads.Dfp.Util.v201308; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example updates a first party audience segment's member + /// expiration days. To determine which first party audience segments exist, + /// run GetFirstPartyAudienceSegments.cs. + /// + /// Tags: AudienceSegmentService.getAudienceSegmentsByStatement + /// Tags: AudienceSegmentService.updateAudienceSegments + /// + class UpdateAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a first party audience segment's member expiration " + + "days. To determine which first party audience segments exist, " + + "run GetFirstPartyAudienceSegments.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = + (AudienceSegmentService) user.GetService(DfpService.v201308.AudienceSegmentService); + + string audienceSegmentId = _T("INSERT_AUDIENCE_SEGMENT_ID_HERE"); + + // Create a statement to only select a specified first party audience + // segment. + string statementText = "where id = :audienceSegmentId order by id ASC " + + "LIMIT 1"; + Statement statement = new StatementBuilder(statementText) + .AddValue("audienceSegmentId", audienceSegmentId) + .ToStatement(); + + try { + // Get the audience segment. + RuleBasedFirstPartyAudienceSegment audienceSegment = + (RuleBasedFirstPartyAudienceSegment) audienceSegmentService + .getAudienceSegmentsByStatement(statement).results[0]; + + // Update the member expiration days. + audienceSegment.membershipExpirationDays = 180; + + // Update the audience segment on the server. + AudienceSegment[] audienceSegments = audienceSegmentService.updateAudienceSegments( + new FirstPartyAudienceSegment[] {audienceSegment}); + + foreach (AudienceSegment updatedAudienceSegment in audienceSegments) { + Console.WriteLine( + "Audience segment with ID \"{0}\" and name \"{1}\" was updated.\n", + updatedAudienceSegment.id, updatedAudienceSegment.name); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update audience segment. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CompanyService/CreateCompanies.cs b/examples/Dfp/CSharp/v201308/CompanyService/CreateCompanies.cs new file mode 100644 index 00000000000..0e8f1d6f99a --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CompanyService/CreateCompanies.cs @@ -0,0 +1,86 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates new companies. To determine which companies + /// exist, run GetAllCompanies.cs. + /// + /// Tags: CompanyService.createCompanies + /// + class CreateCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new companies. To determine which companies exist, " + + "run GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201308.CompanyService); + + // Create an array to store local company objects. + Company[] companies = new Company[5]; + + for (int i = 0; i < 5; i++) { + Company company = new Company(); + company.name = string.Format("Advertiser #{0}", i); + company.type = CompanyType.ADVERTISER; + companies[i] = company; + } + + try { + // Create the companies on the server. + companies = companyService.createCompanies(companies); + + if (companies != null && companies.Length > 0) { + foreach (Company company in companies) { + Console.WriteLine("A company with ID = '{0}', name = '{1}' and type = '{2}' was" + + " created.", company.id, company.name, company.type); + } + } else { + Console.WriteLine("No companies created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create company. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CompanyService/GetAllCompanies.cs b/examples/Dfp/CSharp/v201308/CompanyService/GetAllCompanies.cs new file mode 100644 index 00000000000..0580ad572d1 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CompanyService/GetAllCompanies.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all companies. To create companies, run + /// CreateCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement + /// + class GetAllCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all companies. To create companies, run CreateCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201308.CompanyService); + + // Set defaults for page and Statement. + CompanyPage page = new CompanyPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all companies. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get companies by Statement. + page = companyService.getCompaniesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Company company in page.results) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", + i, company.id, company.name, company.type); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CompanyService/GetCompaniesByStatement.cs b/examples/Dfp/CSharp/v201308/CompanyService/GetCompaniesByStatement.cs new file mode 100644 index 00000000000..191b0725929 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CompanyService/GetCompaniesByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all companies that are advertisers. The Statement + /// retrieves up to the maximum page size limit of 500. To create companies, + /// run CreateCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement + /// + class GetCompaniesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all companies that are advertisers. The Statement " + + "retrieves up to the maximum page size limit of 500. To create companies, run " + + "CreateCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCompaniesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201308.CompanyService); + + // Create a Statement to only select companies that are advertisers sorted + // by name. + Statement statement = new StatementBuilder("WHERE type = :advertiser ORDER BY name " + + "LIMIT 500").AddValue("advertiser", CompanyType.ADVERTISER.ToString()).ToStatement(); + + try { + // Get companies by Statement. + CompanyPage page = companyService.getCompaniesByStatement(statement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Company company in page.results) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", + i, company.id, company.name, company.type); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CompanyService/GetCompany.cs b/examples/Dfp/CSharp/v201308/CompanyService/GetCompany.cs new file mode 100644 index 00000000000..3c152b31eca --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CompanyService/GetCompany.cs @@ -0,0 +1,77 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets a company by its ID. To determine which companies + /// exist, run GetAllCompanies.cs. + /// + /// Tags: CompanyService.getCompany + /// + class GetCompany : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a company by its ID. To determine which companies " + + "exist, run GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCompany(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201308.CompanyService); + + // Set the ID of the company to get. + long companyId = long.Parse(_T("INSERT_COMPANY_ID_HERE")); + + try { + // Get the company. + Company company = companyService.getCompany(companyId); + + if (company != null) { + Console.WriteLine("Company with ID = {0}, name = {1} and type = {2} was found", + company.id, company.name, company.type); + } else { + Console.WriteLine("No company found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get company. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CompanyService/UpdateCompanies.cs b/examples/Dfp/CSharp/v201308/CompanyService/UpdateCompanies.cs new file mode 100644 index 00000000000..ae90de78d3d --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CompanyService/UpdateCompanies.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example updates the names of all companies that are advertisers + /// by appending "LLC." up to the first 500. To determine which companies + /// exist, run GetAllCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement, CompanyService.updateCompanies + /// + class UpdateCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the names of all companies that are advertisers by " + + "appending 'LLC.' up to the first 500. To determine which companies exist, run " + + "GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201308.CompanyService); + + // Create a Statement to only select companies that are advertisers. + Statement statement = new StatementBuilder("WHERE type = :advertiser LIMIT 500").AddValue( + "advertiser", CompanyType.ADVERTISER.ToString()).ToStatement(); + + try { + // Get the companies by Statement. + CompanyPage page = companyService.getCompaniesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + Company[] companies = page.results; + + // Update each local company object by appending LLC. to its name. + foreach (Company company in companies) { + company.name = company.name + " LLC."; + } + + // Update the companies on the server. + companies = companyService.updateCompanies(companies); + + if (companies != null && companies.Length > 0) { + int i = 0; + foreach (Company company in companies) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} was updated", + i, company.id, company.name, company.type); + i++; + } + } else { + Console.WriteLine("No companies updated."); + } + } else { + Console.WriteLine("No companies found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ContactService/CreateContacts.cs b/examples/Dfp/CSharp/v201308/ContactService/CreateContacts.cs new file mode 100644 index 00000000000..c956e43427c --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ContactService/CreateContacts.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates new contacts. To determine which contacts exist, + /// run GetAllContacts.cs. + /// + /// Tags: ContactService.createContacts + /// + class CreateContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new contacts. To determine which contacts exist, " + + "run GetAllContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201308.ContactService); + + // Set the IDs of the companies for the contacts. + long advertiserCompanyId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + long agencyCompanyId = long.Parse(_T("INSERT_AGENCY_COMPANY_ID_HERE")); + + // Create an advertiser contact. + Contact advertiserContact = new Contact(); + advertiserContact.name = "Mr. Advertiser #" + GetTimeStamp(); + advertiserContact.email = "advertiser@advertising.com"; + advertiserContact.companyId = advertiserCompanyId; + + // Create an agency contact. + Contact agencyContact = new Contact(); + agencyContact.name = "Ms. Agency #" + GetTimeStamp(); + agencyContact.email = "agency@agencies.com"; + agencyContact.companyId = agencyCompanyId; + + try { + // Create the contacts on the server. + Contact[] contacts = + contactService.createContacts(new Contact[] {advertiserContact, agencyContact}); + + foreach (Contact contact in contacts) { + Console.WriteLine("A contact with ID \"{0}\" and name \"{1}\" was created.", + contact.id, contact.name); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ContactService/GetAllContacts.cs b/examples/Dfp/CSharp/v201308/ContactService/GetAllContacts.cs new file mode 100644 index 00000000000..0714f03ee50 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ContactService/GetAllContacts.cs @@ -0,0 +1,90 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; +using Google.Api.Ads.Dfp.Util.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all contacts. To create contacts, run + /// CreateContacts.cs. + /// + /// Tags: ContactService.getContactsByStatement + /// + class GetAllContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all contacts. To create contacts, run CreateContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201308.ContactService); + + Statement filterStatement = new Statement(); + + // Set defaults for page and filterStatement. + ContactPage page = new ContactPage(); + int offset = 0; + + try { + do { + // Create a statement to get all contacts. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get contacts by statement. + page = contactService.getContactsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Contact contact in page.results) { + Console.WriteLine("{0}) Contact with ID \"{1}\" and name \"{2}\" was found.", + i, contact.id, contact.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ContactService/GetUninvitedContacts.cs b/examples/Dfp/CSharp/v201308/ContactService/GetUninvitedContacts.cs new file mode 100644 index 00000000000..68d1c762069 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ContactService/GetUninvitedContacts.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; +using Google.Api.Ads.Dfp.Util.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all contacts that aren't invited yet. To create + /// contacts, run CreateContacts.cs. + /// + /// Tags: ContactService.getContactsByStatement + /// + class GetUninvitedContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all contacts that aren't invited yet. To create " + + "contacts, run CreateContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUninvitedContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201308.ContactService); + + Statement filterStatement = new StatementBuilder("").AddValue( + "status", ContactStatus.UNINVITED.ToString()).ToStatement(); + + // Set defaults for page and filterStatement. + ContactPage page = new ContactPage(); + int offset = 0; + + try { + do { + // Create a statement to get all contacts. + filterStatement.query = "where status = :status LIMIT 500 OFFSET " + offset.ToString(); + + // Get contacts by statement. + page = contactService.getContactsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Contact contact in page.results) { + Console.WriteLine("{0}) Contact with ID \"{1}\" and name \"{2}\" was found.", + i, contact.id, contact.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ContactService/UpdateContacts.cs b/examples/Dfp/CSharp/v201308/ContactService/UpdateContacts.cs new file mode 100644 index 00000000000..57aed1a0e74 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ContactService/UpdateContacts.cs @@ -0,0 +1,83 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; +using Google.Api.Ads.Dfp.Util.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example updates contact addresses. To determine which contacts + /// exist, run GetAllContacts.cs. + /// + /// Tags: ContactService.updateContacts + /// + class UpdateContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates contact comments. To determine which contacts " + + "exist, run GetAllContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201308.ContactService); + + // Set the ID of the contact to update. + long contactId = long.Parse(_T("INSERT_CONTACT_ID_HERE")); + + try { + // Get the contact. + Contact contact = contactService.getContact(contactId); + + // Update the address of the contact. + contact.address = "123 New Street, New York, NY, 10011"; + + // Update the contact on the server. + Contact[] contacts = contactService.updateContacts(new Contact[] {contact}); + + // Display results. + foreach (Contact updatedContact in contacts) { + Console.WriteLine("Contact with ID \"{0}\", name \"{1}\", and comment \"{2}\" was " + + "updated.", updatedContact.id, updatedContact.name, updatedContact.comment); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ContentService/GetAllContent.cs b/examples/Dfp/CSharp/v201308/ContentService/GetAllContent.cs new file mode 100644 index 00000000000..a0d1ca5541d --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ContentService/GetAllContent.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all content. This feature is only available to DFP + /// premium solution networks. + /// + /// Tags: ContentService.getContentByStatement + /// + class GetAllContent : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all content. This feature is only available to DFP " + + "premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllContent(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContentService. + ContentService contentService = + (ContentService) user.GetService(DfpService.v201308.ContentService); + + // Set defaults for page and filterStatement. + ContentPage page = new ContentPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all content. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get content by statement. + page = contentService.getContentByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Content content in page.results) { + Console.WriteLine("{0}) Content with ID \"{1}\", name \"{2}\", and status \"{3}\" " + + "was found.", i, content.id, content.name, content.status); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all content. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ContentService/GetContentByCategory.cs b/examples/Dfp/CSharp/v201308/ContentService/GetContentByCategory.cs new file mode 100644 index 00000000000..5c548086701 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ContentService/GetContentByCategory.cs @@ -0,0 +1,123 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using Google.Api.Ads.Dfp.Util.v201308; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all active content categorized as "comedy" using + /// the network's content browse custom targeting key. This feature is only + /// available to DFP video publishers. + /// + /// Tags: NetworkService.getCurrentNetwork + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// Tags: ContentService.getContentByStatementAndCustomTargetingValue + /// /// + class GetContentByCategory : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active content categorized as 'comedy' using the " + + "network's content browse custom targeting key. This feature is only available to " + + "DFP video publishers."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetContentByCategory(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContentService. + ContentService contentService = + (ContentService) user.GetService(DfpService.v201308.ContentService); + + // Get the NetworkService. + NetworkService networkService = (NetworkService) user.GetService( + DfpService.v201308.NetworkService); + + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = (CustomTargetingService) user.GetService( + DfpService.v201308.CustomTargetingService); + + try { + // Get content browse custom targeting key ID. + long contentBrowseCustomTargetingKeyId = + networkService.getCurrentNetwork().contentBrowseCustomTargetingKeyId; + + // Create a statement to select the categories matching the name comedy. + Statement categoryFilterStatement = new StatementBuilder( + "WHERE customTargetingKeyId = :contentBrowseCustomTargetingKeyId " + + " and name = :category LIMIT 1") + .AddValue("contentBrowseCustomTargetingKeyId", contentBrowseCustomTargetingKeyId) + .AddValue("category", "comedy").ToStatement(); + + // Get categories matching the filter statement. + CustomTargetingValuePage customTargetingValuePage = + customTargetingService.getCustomTargetingValuesByStatement(categoryFilterStatement); + + if (customTargetingValuePage.results != null) { + // Get the custom targeting value ID for the comedy category. + long categoryCustomTargetingValueId = customTargetingValuePage.results[0].id; + + // Set defaults for page and filterStatement. + ContentPage page = new ContentPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + do { + // Create a statement to get all active content. + filterStatement.query = "WHERE status = 'ACTIVE' LIMIT 500 OFFSET " + offset.ToString(); + + // Get content by statement. + page = contentService.getContentByStatementAndCustomTargetingValue(filterStatement, + categoryCustomTargetingValueId); + + if (page.results != null) { + int i = page.startIndex; + foreach (Content content in page.results) { + Console.WriteLine("{0}) Content with ID \"{1}\", name \"{2}\", and status " + + "\"{3}\" was found.", i, content.id, content.name, content.status); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get content by category. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CreativeService/CopyImageCreatives.cs b/examples/Dfp/CSharp/v201308/CreativeService/CopyImageCreatives.cs new file mode 100644 index 00000000000..57fb9e19f9a --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CreativeService/CopyImageCreatives.cs @@ -0,0 +1,127 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example copies a given set of image creatives. This would + /// typically be done to reuse creatives in a small business network. To + /// determine which creatives exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// Tags: CreativeService.createCreatives + /// + class CopyImageCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example copies a given set of image creatives. This would typically be" + + " done to reuse creatives in a small business network. To determine which creatives " + + "exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CopyImageCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201308.CreativeService); + + long[] creativeIds = new long[] {long.Parse(_T("INSERT_IMAGE_CREATIVE_ID_HERE"))}; + + // Build a comma separated list of creativeIds. Note that if you are using + // .NET 4.0 or above, you could use the newly introduced + // String.Join(string separator, IEnumerable values) method to + // perform this task. + string[] creativeIdTexts = new string[creativeIds.Length]; + for (int i = 0; i < creativeIdTexts.Length; i++) { + creativeIdTexts[i] = creativeIds[i].ToString(); + } + + string commaSeparatedCreativeIds = string.Join(",", creativeIdTexts); + + // Create the statement to filter image creatives by id. + Statement statement = new StatementBuilder( + string.Format("WHERE id IN ({0}) and creativeType = :creativeType LIMIT 500", + commaSeparatedCreativeIds)).AddValue("creativeType", "ImageCreative"). + ToStatement(); + + try { + // Retrieve all creatives which match. + CreativePage page = creativeService.getCreativesByStatement(statement); + + if (page.results != null) { + Creative[] creatives = page.results; + long[] oldIds = new long[creatives.Length]; + for (int i = 0; i < creatives.Length; i++) { + ImageCreative imageCreative = (ImageCreative) creatives[i]; + oldIds[i] = imageCreative.id; + // Since we cannot set id to null, we mark it as not specified. + imageCreative.idSpecified = false; + + imageCreative.advertiserId = imageCreative.advertiserId; + imageCreative.name = imageCreative.name + " (Copy #" + GetTimeStamp() + ")"; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + imageCreative.primaryImageAsset.assetUrl); + + creativeAsset.size = imageCreative.primaryImageAsset.size; + imageCreative.primaryImageAsset = creativeAsset; + + creatives[i] = imageCreative; + } + + // Create the copied creative. + creatives = creativeService.createCreatives(creatives); + + // Display copied creatives. + for (int i = 0; i < creatives.Length; i++) { + Console.WriteLine("Image creative with ID \"{0}\" copied to ID \"{1}\".", oldIds[i], + creatives[i].id); + } + } else { + Console.WriteLine("No creatives were copied."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to copy creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CreativeService/CreateCreativeFromTemplate.cs b/examples/Dfp/CSharp/v201308/CreativeService/CreateCreativeFromTemplate.cs new file mode 100644 index 00000000000..f5b49308526 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CreativeService/CreateCreativeFromTemplate.cs @@ -0,0 +1,138 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates a new template creative for a given advertiser. + /// To determine which companies are advertisers, run + /// GetCompaniesByStatement.cs. To determine which creatives already exist, + /// run GetAllCreatives.cs. To determine which creative templates exist, run + /// GetAllCreativeTemplates.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCreativeFromTemplate : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new template creative for a given advertiser. To " + + "determine which companies are advertisers, run GetCompaniesByStatement.cs. To " + + "determine which creatives already exist, run GetAllCreatives.cs. To determine " + + "which creative templates exist, run GetAllCreativeTemplates.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreativeFromTemplate(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201308.CreativeService); + + // Set the ID of the advertiser (company) that all creative will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Use the image banner with optional third party tracking template. + long creativeTemplateId = 10000680L; + + // Create the local custom creative object. + TemplateCreative templateCreative = new TemplateCreative(); + templateCreative.name = "Template creative"; + templateCreative.advertiserId = advertiserId; + templateCreative.creativeTemplateId = creativeTemplateId; + + // Set the creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + templateCreative.size = size; + + // Create the asset variable value. + AssetCreativeTemplateVariableValue assetVariableValue = + new AssetCreativeTemplateVariableValue(); + assetVariableValue.uniqueName = "Imagefile"; + assetVariableValue.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + assetVariableValue.fileName = String.Format("image{0}.jpg", this.GetTimeStamp()); + + // Create the image width variable value. + LongCreativeTemplateVariableValue imageWidthVariableValue = + new LongCreativeTemplateVariableValue(); + imageWidthVariableValue.uniqueName = "Imagewidth"; + imageWidthVariableValue.value = 300; + + // Create the image height variable value. + LongCreativeTemplateVariableValue imageHeightVariableValue = + new LongCreativeTemplateVariableValue(); + imageHeightVariableValue.uniqueName = "Imageheight"; + imageHeightVariableValue.value = 250; + + // Create the URL variable value. + UrlCreativeTemplateVariableValue urlVariableValue = new UrlCreativeTemplateVariableValue(); + urlVariableValue.uniqueName = "ClickthroughURL"; + urlVariableValue.value = "www.google.com"; + + // Create the target window variable value. + StringCreativeTemplateVariableValue targetWindowVariableValue = + new StringCreativeTemplateVariableValue(); + targetWindowVariableValue.uniqueName = "Targetwindow"; + targetWindowVariableValue.value = "_blank"; + + templateCreative.creativeTemplateVariableValues = new BaseCreativeTemplateVariableValue[] { + assetVariableValue, imageWidthVariableValue, imageHeightVariableValue, urlVariableValue, + targetWindowVariableValue}; + + try { + // Create the template creative on the server. + templateCreative = (TemplateCreative) creativeService.createCreative(templateCreative); + + if (templateCreative != null) { + Console.WriteLine("A template creative with ID \"{0}\", name \"{1}\", and type \"{2}\" " + + "was created and can be previewed at {3}", templateCreative.id, templateCreative.name, + templateCreative.CreativeType, templateCreative.previewUrl); + } else { + Console.WriteLine("No creatives were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CreativeService/CreateCreatives.cs b/examples/Dfp/CSharp/v201308/CreativeService/CreateCreatives.cs new file mode 100644 index 00000000000..78dd4b1cd3b --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CreativeService/CreateCreatives.cs @@ -0,0 +1,120 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates new image creatives for a given advertiser. To + /// determine which companies are advertisers, run GetCompaniesByStatement.cs. + /// To determine which creatives already exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new image creatives for a given advertiser. To " + + "determine which companies are advertisers, run GetCompaniesByStatement.cs. " + + "To determine which creatives already exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201308.CreativeService); + + // Set the ID of the advertiser (company) that all creatives will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Create an array to store local image creative objects. + Creative[] imageCreatives = new ImageCreative[5]; + + for (int i = 0; i < 5; i++) { + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", i); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + imageCreatives[i] = imageCreative; + } + + try { + // Create the image creatives on the server. + imageCreatives = creativeService.createCreatives(imageCreatives); + + if (imageCreatives != null) { + foreach (Creative creative in imageCreatives) { + // Use "is" operator to determine what type of creative was + // returned. + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + Console.WriteLine("An image creative with ID ='{0}', name ='{1}' and size = " + + "({2},{3}) was created and can be previewed at: {4}", imageCreative.id, + imageCreative.name, imageCreative.size.width, imageCreative.size.height, + imageCreative.previewUrl); + } else { + Console.WriteLine("A creative with ID ='{0}', name='{1}' and type='{2}' was created.", + creative.id, creative.name, creative.CreativeType); + } + } + } else { + Console.WriteLine("No creatives created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CreativeService/CreateCustomCreative.cs b/examples/Dfp/CSharp/v201308/CreativeService/CreateCustomCreative.cs new file mode 100644 index 00000000000..a760d8d38e1 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CreativeService/CreateCustomCreative.cs @@ -0,0 +1,111 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates a custom creative for a given advertiser. To + /// determine which companies are advertisers, run GetCompaniesByStatement.cs. + /// To determine which creatives already exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCustomCreative : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a custom creative for a given advertiser. To determine " + + "which companies are advertisers, run GetCompaniesByStatement.cs. To determine which " + + "creatives already exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomCreative(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201308.CreativeService); + + // Set the ID of the advertiser (company) that all creatives will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + + // Create the local custom creative object. + CustomCreative customCreative = new CustomCreative(); + customCreative.name = "Custom creative " + GetTimeStamp(); + customCreative.advertiserId = advertiserId; + customCreative.destinationUrl = "http://google.com"; + + // Set the custom creative image asset. + CustomCreativeAsset customCreativeAsset = new CustomCreativeAsset(); + customCreativeAsset.macroName = "IMAGE_ASSET"; + customCreativeAsset.fileName = string.Format("inline{0}.jpg", GetTimeStamp()); + customCreativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + customCreative.customCreativeAssets = new CustomCreativeAsset[] {customCreativeAsset}; + + // Set the HTML snippet using the custom creative asset macro. + customCreative.htmlSnippet = "" + + "" + + "
Click above for great deals!"; + + // Set the creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + customCreative.size = size; + + try { + // Create the custom creative on the server. + customCreative = (CustomCreative) creativeService.createCreative(customCreative); + + if (customCreative != null) { + Console.WriteLine("A custom creative with ID \"{0}\", name \"{1}\", and size ({2}, " + + "{3}) was created and can be previewed at {4}", customCreative.id, + customCreative.name, customCreative.size.width, customCreative.size.height, + customCreative.previewUrl); + } else { + Console.WriteLine("No creative created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CreativeService/GetAllCreatives.cs b/examples/Dfp/CSharp/v201308/CreativeService/GetAllCreatives.cs new file mode 100644 index 00000000000..bb18e48fe35 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CreativeService/GetAllCreatives.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all creatives. To create creatives, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// + class GetAllCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all creatives. To create creatives, run CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201308.CreativeService); + + // Set defaults for page and Statement. + CreativePage page = new CreativePage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all creatives. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get creatives by Statement. + page = creativeService.getCreativesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Creative creative in page.results) { + Console.WriteLine("{0}) Creative with ID ='{1}', name ='{2}' and type ='{3}' " + + "was found.", i, creative.id, creative.name, creative.CreativeType); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CreativeService/GetCreative.cs b/examples/Dfp/CSharp/v201308/CreativeService/GetCreative.cs new file mode 100644 index 00000000000..bfbdf819b50 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CreativeService/GetCreative.cs @@ -0,0 +1,77 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets a creative by its ID. To determine which creatives + /// exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.getCreative + /// + class GetCreative : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a creative by its ID. To determine which creatives " + + "exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code sample as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreative(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201308.CreativeService); + + // Set the ID of the creative to get. + long creativeId = long.Parse(_T("INSERT_CREATIVE_ID_HERE")); + + try { + // Get the creative. + Creative creative = creativeService.getCreative(creativeId); + + if (creative != null) { + Console.WriteLine("Creative with ID ='{0}', name ='{1}' and type ='{2}' " + + "was found.", creative.id, creative.name, creative.CreativeType); + } else { + Console.WriteLine("No creative found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get creative. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CreativeService/GetCreativesByStatement.cs b/examples/Dfp/CSharp/v201308/CreativeService/GetCreativesByStatement.cs new file mode 100644 index 00000000000..1b51be7e938 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CreativeService/GetCreativesByStatement.cs @@ -0,0 +1,86 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all image creatives. The Statement retrieves up to + /// the maximum page size limit of 500. To create an image creative, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// + class GetCreativesByStatement : SampleBase { + /// + /// Returns a description about the sample code. + /// + public override string Description { + get { + return "This code example gets all image creatives. The Statement retrieves up to the " + + "maximum page size limit of 500. To create an image creative, run " + + "CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201308.CreativeService); + + // Create a Statement to only select image creatives. + Statement statement = new StatementBuilder("WHERE creativeType = :creativeType LIMIT 500"). + AddValue("creativeType", "ImageCreative").ToStatement(); + + try { + // Get creatives by Statement. + CreativePage page = creativeService.getCreativesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Creative creative in page.results) { + Console.WriteLine("{0}) Creative with ID ='{1}', name ='{2}' and type ='{3}' " + + "was found.", i, creative.id, creative.name, creative.CreativeType); + i++; + } + } + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get creatives by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CreativeService/UpdateCreatives.cs b/examples/Dfp/CSharp/v201308/CreativeService/UpdateCreatives.cs new file mode 100644 index 00000000000..67375d33c9d --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CreativeService/UpdateCreatives.cs @@ -0,0 +1,104 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all image creatives. The Statement retrieves up to + /// the maximum page size limit of 500. To create an image creative, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// Tags: CreativeService.updateCreatives + /// + class UpdateCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all image creatives. The Statement retrieves up to the " + + "maximum page size limit of 500. To create an image creative, run " + + "CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201308.CreativeService); + + // Create a Statement to get all image creatives. + Statement statement = new StatementBuilder("WHERE creativeType = :creativeType LIMIT 500"). + AddValue("creativeType", "ImageCreative").ToStatement(); + + try { + // Get creatives by Statement. + CreativePage page = creativeService.getCreativesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + Creative[] creatives = page.results; + + // Update each local creative object by changing its destination URL. + foreach (Creative creative in creatives) { + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + imageCreative.destinationUrl = "http://news.google.com"; + } + } + + // Update the creatives on the server. + creatives = creativeService.updateCreatives(creatives); + + if (creatives != null) { + foreach (Creative creative in creatives) { + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + Console.WriteLine("An image creative with ID = '{0}' and destination URL ='{1}' " + + "was updated.", imageCreative.id, imageCreative.destinationUrl); + } + } + } else { + Console.WriteLine("No creatives updated."); + } + } else { + Console.WriteLine("No creatives found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CreativeTemplateService/GetAllCreativeTemplates.cs b/examples/Dfp/CSharp/v201308/CreativeTemplateService/GetAllCreativeTemplates.cs new file mode 100644 index 00000000000..454ca332c71 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CreativeTemplateService/GetAllCreativeTemplates.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all creative templates. + /// + /// Tags: CreativeTemplateService.getCreativeTemplatesByStatement + /// + class GetAllCreativeTemplates : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all creative templates."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreativeTemplates(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201308.CreativeTemplateService); + + // Set defaults for page and filterStatement. + CreativeTemplatePage page = new CreativeTemplatePage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all creative templates. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get creative templates by statement. + page = creativeTemplateService.getCreativeTemplatesByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CreativeTemplate creativeTemplate in page.results) { + Console.WriteLine("{0}) Creative template with ID \"{1}\", name \"{2}\", and type " + + "\"{3}\" was found.", i, creativeTemplate.id, creativeTemplate.name, + creativeTemplate.type); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CreativeTemplateService/GetCreativeTemplate.cs b/examples/Dfp/CSharp/v201308/CreativeTemplateService/GetCreativeTemplate.cs new file mode 100644 index 00000000000..64f11086a9b --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CreativeTemplateService/GetCreativeTemplate.cs @@ -0,0 +1,87 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets a creative by its ID. To determine which creative + /// templates exist, run GetAllCreativeTemplates.cs. + /// + /// Tags: CreativeTemplateService.getCreativeTemplate + /// + class GetCreativeTemplate : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a creative by its ID. To determine which creative " + + "templates exist, run GetAllCreativeTemplates.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeTemplate(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201308.CreativeTemplateService); + + // Set the ID of the creative template to get. + long creativeTemplateId = long.Parse(_T("INSERT_CREATIVE_TEMPLATE_ID_HERE")); + + try { + // Get the creative template. + CreativeTemplate creativeTemplate = creativeTemplateService.getCreativeTemplate( + creativeTemplateId); + + if (creativeTemplate != null) { + Console.WriteLine("Creative template with ID \"{0}\", name \"{1}\", and type \"{2}\" " + + "was found.", creativeTemplate.id, creativeTemplate.name, creativeTemplate.type); + if (creativeTemplate.variables != null) { + foreach (CreativeTemplateVariable variable in creativeTemplate.variables) { + Console.WriteLine("Variable with name \"{0}\" is {1}.", variable.uniqueName, + variable.isRequired ? "required." : "optional."); + } + } + } else { + Console.WriteLine("No creative template found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CreativeTemplateService/GetCreativeTemplatesByStatement.cs b/examples/Dfp/CSharp/v201308/CreativeTemplateService/GetCreativeTemplatesByStatement.cs new file mode 100644 index 00000000000..5f474e311ba --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CreativeTemplateService/GetCreativeTemplatesByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets up to 500 system defined creative templates. + /// + /// Tags: CreativeTemplateService.getCreativeTemplatesByStatement + /// + class GetCreativeTemplatesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets up to 500 system defined creative templates."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeTemplatesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201308.CreativeTemplateService); + + // Create a statement to only select system defined creative templates. + Statement filterStatement = + new StatementBuilder("WHERE type = :creativeTemplateType LIMIT 500").AddValue( + "creativeTemplateType", CreativeTemplateType.SYSTEM_DEFINED.ToString()).ToStatement(); + + try { + // Get creative templates by statement. + CreativeTemplatePage page = creativeTemplateService.getCreativeTemplatesByStatement( + filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CreativeTemplate creativeTemplate in page.results) { + Console.WriteLine("{0}) Creative template with ID \"{1}\", name \"{2}\", and type " + + "\"{3}\" was found.", i, creativeTemplate.id, creativeTemplate.name, + creativeTemplate.type); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CreativeWrapperService/CreateCreativeWrappers.cs b/examples/Dfp/CSharp/v201308/CreativeWrapperService/CreateCreativeWrappers.cs new file mode 100644 index 00000000000..b66d5998cc3 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CreativeWrapperService/CreateCreativeWrappers.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates a new creative wrapper. Creative wrappers must + /// be associated with a LabelType.CREATIVE_WRAPPER label and applied to ad + /// units by AdUnit.appliedLabels. To determine which creative wrappers exist, + /// run GetAllCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.createCreativeWrappers + /// + class CreateCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new creative wrapper. Creative wrappers must be " + + "associated with a LabelType.CREATIVE_WRAPPER label and applied to ad units by " + + "AdUnit.appliedLabels. To determine which creative wrappers exist, run " + + "GetAllCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201308.CreativeWrapperService); + + long labelId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE")); + + // Create creative wrapper objects. + CreativeWrapper creativeWrapper = new CreativeWrapper(); + creativeWrapper.labelId = labelId; + creativeWrapper.ordering = CreativeWrapperOrdering.INNER; + creativeWrapper.header = new CreativeWrapperHtmlSnippet(); + creativeWrapper.header.htmlSnippet = "My creative wrapper header"; + creativeWrapper.footer = new CreativeWrapperHtmlSnippet(); + creativeWrapper.footer.htmlSnippet = "My creative wrapper footer"; + + try { + // Add creative wrapper. + CreativeWrapper[] creativeWrappers = creativeWrapperService.createCreativeWrappers( + new CreativeWrapper[] {creativeWrapper}); + + // Display results. + foreach (CreativeWrapper wrapper in creativeWrappers) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' was " + + "created.", wrapper.id, wrapper.labelId); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creative wrappers. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CreativeWrapperService/DeactivateCreativeWrappers.cs b/examples/Dfp/CSharp/v201308/CreativeWrapperService/DeactivateCreativeWrappers.cs new file mode 100644 index 00000000000..b15086a8cfa --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CreativeWrapperService/DeactivateCreativeWrappers.cs @@ -0,0 +1,95 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using Google.Api.Ads.Dfp.Util.v201308; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example deactivates a creative wrapper belonging to a label. + /// + /// Tags: CreativeWrapperService.getCreativeWrapperByStatement + /// Tags: CreativeWrapperService.performCreativeWrapperAction + /// + class DeActivateCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates a creative wrapper belonging to a label."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeActivateCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201308.CreativeWrapperService); + + long labelId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE")); + + try { + // Create a query to select the active creative wrapper for the given + // label. + Statement statement = new StatementBuilder("WHERE status = :status AND labelId = :labelId") + .AddValue("labelId", labelId) + .AddValue("status", CreativeWrapperStatus.ACTIVE.ToString()) + .ToStatement(); + CreativeWrapperPage page = creativeWrapperService.getCreativeWrappersByStatement(statement); + CreativeWrapper[] creativeWrappers = page.results; + if (creativeWrappers != null) { + foreach (CreativeWrapper wrapper in creativeWrappers) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' with " + + "status \'{2}\' will be deactivated.", wrapper.id, wrapper.labelId, wrapper.status); + } + Console.WriteLine("Number of creative wrappers to be deactivated: {0}", + creativeWrappers.Length); + + // Perform action. + CreativeWrapperAction action = new DeactivateCreativeWrappers(); + UpdateResult result = + creativeWrapperService.performCreativeWrapperAction(action, statement); + + // Display results. + if (result.numChanges > 0) { + Console.WriteLine("Number of creative wrappers deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No creative wrappers were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creative wrappers. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CreativeWrapperService/GetActiveCreativeWrappers.cs b/examples/Dfp/CSharp/v201308/CreativeWrapperService/GetActiveCreativeWrappers.cs new file mode 100644 index 00000000000..c329d0d97f7 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CreativeWrapperService/GetActiveCreativeWrappers.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using Google.Api.Ads.Dfp.Util.v201308; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all active creative wrappers. To create + /// creative wrappers, run CreateCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.getCreativeWrapperByStatement + /// + class GetActiveCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active creative wrappers. To create creative " + + "wrappers, run CreateCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActiveCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201308.CreativeWrapperService); + + // Set defaults for page and Statement. + CreativeWrapperPage page = new CreativeWrapperPage(); + Statement statement = new StatementBuilder("") + .AddValue("status", CreativeWrapperStatus.ACTIVE.ToString()) + .ToStatement(); + int offset = 0; + + try { + do { + // Create a Statement to get all active creative wrappers. + statement.query = string.Format("WHERE status = :status LIMIT 500 OFFSET {0}", offset); + + // Get creative wrappers by Statement. + page = creativeWrapperService.getCreativeWrappersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (CreativeWrapper wrapper in page.results) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' with " + + "status \'{2}\' was found.", wrapper.id, wrapper.labelId, wrapper.status); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get active creative wrappers. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CreativeWrapperService/GetAllCreativeWrappers.cs b/examples/Dfp/CSharp/v201308/CreativeWrapperService/GetAllCreativeWrappers.cs new file mode 100644 index 00000000000..492e92f5a5c --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CreativeWrapperService/GetAllCreativeWrappers.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using Google.Api.Ads.Dfp.Util.v201308; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all creative wrappers. To create creative wrappers, + /// run CreateCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.getCreativeWrapperByStatement + /// + class GetAllCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active creative wrappers. To create creative " + + "wrappers, run CreateCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201308.CreativeWrapperService); + + // Set defaults for page and Statement. + CreativeWrapperPage page = new CreativeWrapperPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all creative wrappers. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get creative wrappers by Statement. + page = creativeWrapperService.getCreativeWrappersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (CreativeWrapper wrapper in page.results) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' with " + + "status \'{2}\' was found.", wrapper.id, wrapper.labelId, wrapper.status); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get active creative wrappers. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CreativeWrapperService/UpdateCreativeWrappers.cs b/examples/Dfp/CSharp/v201308/CreativeWrapperService/UpdateCreativeWrappers.cs new file mode 100644 index 00000000000..57fcfdd0e0f --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CreativeWrapperService/UpdateCreativeWrappers.cs @@ -0,0 +1,84 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using Google.Api.Ads.Dfp.Util.v201308; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example updates a creative wrapper to the 'OUTER' wrapping + /// order. To determine which creative wrappers exist, run + /// GetAllCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.getCreativeWrapper + /// Tags: CreativeWrapperService.updateCreativeWrappers + /// + class UpdateCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active creative wrappers. To create creative " + + "wrappers, run CreateCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201308.CreativeWrapperService); + + long creativeWrapperId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_ID_HERE")); + + try { + CreativeWrapper wrapper = creativeWrapperService.getCreativeWrapper(creativeWrapperId); + if (wrapper != null) { + wrapper.ordering = CreativeWrapperOrdering.OUTER; + // Update the creative wrappers on the server. + CreativeWrapper[] creativeWrappers = creativeWrapperService.updateCreativeWrappers( + new CreativeWrapper[] {wrapper}); + + // Display results. + Console.WriteLine("Creative wrapper with ID '{0}' and wrapping order '{1}' was " + + "updated.", creativeWrappers[0].id, creativeWrappers[0].ordering); + } else { + Console.WriteLine("No creative wrappers found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update creative wrappers. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CustomFieldService/CreateCustomFieldOptions.cs b/examples/Dfp/CSharp/v201308/CustomFieldService/CreateCustomFieldOptions.cs new file mode 100644 index 00000000000..220b707e644 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CustomFieldService/CreateCustomFieldOptions.cs @@ -0,0 +1,97 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates custom field options for a drop-down custom + /// field. Once created, custom field options can be found under the options + /// fields of the drop-down custom field and they cannot be deleted. To + /// determine which custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.createCustomFieldOptions + /// + class CreateCustomFieldOptions : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates custom field options for a drop-down custom field. " + + "Once created, custom field options can be found under the options fields of the " + + "drop-down custom field and they cannot be deleted. To determine which custom " + + "fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomFieldOptions(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = + (CustomFieldService) user.GetService(DfpService.v201308.CustomFieldService); + + // Set the ID of the drop-down custom field to create options for. + long customFieldId = long.Parse(_T("INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE")); + + // Create custom field options. + CustomFieldOption customFieldOption1 = new CustomFieldOption(); + customFieldOption1.displayName = "Approved"; + customFieldOption1.customFieldId = customFieldId; + + CustomFieldOption customFieldOption2 = new CustomFieldOption(); + customFieldOption2.displayName = "Unapproved"; + customFieldOption2.customFieldId = customFieldId; + + try { + // Add custom field options. + CustomFieldOption[] customFieldOptions = + customFieldService.createCustomFieldOptions(new CustomFieldOption[] {customFieldOption1, + customFieldOption2}); + + // Display results. + if (customFieldOptions != null) { + foreach (CustomFieldOption customFieldOption in customFieldOptions) { + Console.WriteLine("Custom field option with ID \"{0}\" and name \"{1}\" was created.", + customFieldOption.id, customFieldOption.displayName); + } + } else { + Console.WriteLine("No custom field options created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom field options. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CustomFieldService/CreateCustomFields.cs b/examples/Dfp/CSharp/v201308/CustomFieldService/CreateCustomFields.cs new file mode 100644 index 00000000000..6410b22a8f6 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CustomFieldService/CreateCustomFields.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates custom fields. To determine which custom fields + /// exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.createCustomFields + /// + class CreateCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates custom fields. To determine which custom fields exist" + + ", run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201308.CustomFieldService); + + // Create custom fields. + CustomField customField1 = new CustomField(); + customField1.name = "Customer comments #" + GetTimeStamp(); + customField1.entityType = CustomFieldEntityType.LINE_ITEM; + customField1.dataType = CustomFieldDataType.STRING; + customField1.visibility = CustomFieldVisibility.FULL; + + CustomField customField2 = new CustomField(); + customField2.name = "Internal approval status #" + GetTimeStamp(); + customField2.entityType = CustomFieldEntityType.LINE_ITEM; + customField2.dataType = CustomFieldDataType.DROP_DOWN; + customField2.visibility = CustomFieldVisibility.FULL; + + try { + // Add custom fields. + CustomField[] customFields = + customFieldService.createCustomFields(new CustomField[] {customField1, customField2}); + + // Display results. + if (customFields != null) { + foreach (CustomField customField in customFields) { + Console.WriteLine("Custom field with ID \"{0}\" and name \"{1}\" was created.", + customField.id, customField.name); + } + } else { + Console.WriteLine("No custom fields created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CustomFieldService/DeactivateAllLineItemCustomFields.cs b/examples/Dfp/CSharp/v201308/CustomFieldService/DeactivateAllLineItemCustomFields.cs new file mode 100644 index 00000000000..e43e391f3ca --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CustomFieldService/DeactivateAllLineItemCustomFields.cs @@ -0,0 +1,122 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using Google.Api.Ads.Dfp.Util.v201308; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example deactivates all active line item custom fields. To + /// determine which custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// Tags: CustomFieldService.performCustomFieldAction + /// + class DeactivateAllLineItemCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active line item custom fields. To determine " + + "which custom fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateAllLineItemCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201308.CustomFieldService); + + // Create statement to select only active custom fields that apply to + // line items. + String statementText = "WHERE entityType = :entityType and isActive = :isActive LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText) + .AddValue("entityType", CustomFieldEntityType.LINE_ITEM.ToString()) + .AddValue("isActive", true) + .ToStatement(); + + // Set defaults for page and offset. + CustomFieldPage page = new CustomFieldPage(); + int offset = 0; + int i = 0; + List customFieldIds = new List(); + + try { + do { + // Create a statement to page through custom fields. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(filterStatement); + + if (page.results != null) { + foreach (CustomField customField in page.results) { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" will be " + + "deactivated.", i, customField.id, customField.name); + customFieldIds.Add(customField.id.ToString()); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of custom fields to be deactivated: " + customFieldIds.Count); + + if (customFieldIds.Count > 0) { + // Modify statement for action. + filterStatement.query = "WHERE id IN (" + string.Join(", ", customFieldIds.ToArray()) + + ")"; + + // Create action. + DeactivateCustomFields action = new DeactivateCustomFields(); + + // Perform action. + UpdateResult result = customFieldService.performCustomFieldAction( + action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of custom fields deactivated: " + result.numChanges); + } else { + Console.WriteLine("No custom fields were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CustomFieldService/GetAllCustomFields.cs b/examples/Dfp/CSharp/v201308/CustomFieldService/GetAllCustomFields.cs new file mode 100644 index 00000000000..dd1ec262763 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CustomFieldService/GetAllCustomFields.cs @@ -0,0 +1,107 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using Google.Api.Ads.Dfp.Util.v201308; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all custom fields. To create custom fields, run + /// CreateCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// Tags: CustomFieldService.performCustomFieldAction + /// + class GetAllCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom fields. To create custom fields, run " + + "CreateCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201308.CustomFieldService); + + // Sets defaults for page and filter. + CustomFieldPage page = new CustomFieldPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all custom fields. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomField customField in page.results) { + if (customField is DropDownCustomField) { + List dropDownCustomFieldStrings = new List(); + DropDownCustomField dropDownCustomField = (DropDownCustomField) customField; + if (dropDownCustomField.options != null) { + foreach (CustomFieldOption customFieldOption in dropDownCustomField.options) { + dropDownCustomFieldStrings.Add(customFieldOption.displayName); + } + } + Console.WriteLine("{0}) Drop-down custom field with ID \"{1}\", name \"{2}\", " + + "and options {{{3}}} was found.", i, customField.id, customField.name, + string.Join(", ", dropDownCustomFieldStrings.ToArray())); + } else { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" was found.", + i, customField.id, customField.name); + } + i++; + } + } + + offset += 500; + } while (page.results != null && page.results.Length == 500); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CustomFieldService/GetAllLineItemCustomFields.cs b/examples/Dfp/CSharp/v201308/CustomFieldService/GetAllLineItemCustomFields.cs new file mode 100644 index 00000000000..51d93fcd4fa --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CustomFieldService/GetAllLineItemCustomFields.cs @@ -0,0 +1,97 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using Google.Api.Ads.Dfp.Util.v201308; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all custom fields that apply to line items. To + /// create custom fields, run CreateCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// + class GetAllLineItemCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom fields that apply to line items. To create " + + "custom fields, run CreateCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLineItemCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201308.CustomFieldService); + + // Create statement to select only custom fields that apply to line items. + String statementText = "WHERE entityType = :entityType LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText) + .AddValue("entityType", CustomFieldEntityType.LINE_ITEM.ToString()) + .ToStatement(); + + // Set defaults for page and offset. + CustomFieldPage page = new CustomFieldPage(); + int offset = 0; + int i = 0; + + try { + do { + // Create a statement to page through custom fields. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(filterStatement); + + if (page.results != null) { + foreach (CustomField customField in page.results) { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" was found.", i, + customField.id, customField.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all line item custom fields. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CustomFieldService/SetLineItemCustomFieldValue.cs b/examples/Dfp/CSharp/v201308/CustomFieldService/SetLineItemCustomFieldValue.cs new file mode 100644 index 00000000000..c01efbf19ab --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CustomFieldService/SetLineItemCustomFieldValue.cs @@ -0,0 +1,148 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using Google.Api.Ads.Dfp.Util.v201308; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example sets custom field values on a line item. To determine + /// which custom fields exist, run GetAllCustomFields.cs. To create custom + /// field options, run CreateCustomFieldOptions.cs. To determine which line + /// items exist, run GetAllLineItems.cs. + /// + /// Tags: CustomFieldService.getCustomField + /// Tags: LineItemService.getLineItem + /// Tags: LineItemService.updateLineItems + /// + class SetLineItemCustomFieldValue : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example sets custom field values on a line item. To determine which " + + "custom fields exist, run GetAllCustomFields.cs. To create custom field options, " + + "run CreateCustomFieldOptions.cs. To determine which line items exist, run " + + "GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new SetLineItemCustomFieldValue(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201308.CustomFieldService); + + // Get the LineItemService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201308.LineItemService); + + // Set the IDs of the custom fields, custom field option, and line item. + long customFieldId = long.Parse(_T("INSERT_STRING_CUSTOM_FIELD_ID_HERE")); + long dropDownCustomFieldId = long.Parse(_T("INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE")); + long customFieldOptionId = long.Parse(_T("INSERT_CUSTOM_FIELD_OPTION_ID_HERE")); + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get the custom field. + CustomField customField = customFieldService.getCustomField(customFieldId); + + // Get the drop-down custom field. + DropDownCustomField dropDownCustomField = + (DropDownCustomField) customFieldService.getCustomField(dropDownCustomFieldId); + + // Get the line item. + LineItem lineItem = lineItemService.getLineItem(lineItemId); + + // Create custom field values. + List customFieldValues = new List(); + TextValue textValue = new TextValue(); + textValue.value = "Custom field value"; + + CustomFieldValue customFieldValue = new CustomFieldValue(); + customFieldValue.customFieldId = customFieldId; + customFieldValue.value = textValue; + customFieldValues.Add(customFieldValue); + + DropDownCustomFieldValue dropDownCustomFieldValue = new DropDownCustomFieldValue(); + dropDownCustomFieldValue.customFieldId = dropDownCustomFieldId; + dropDownCustomFieldValue.customFieldOptionId = customFieldOptionId; + customFieldValues.Add(dropDownCustomFieldValue); + + // Only add existing custom field values for different custom fields than + // the ones you are setting. + if (lineItem.customFieldValues != null) { + foreach (BaseCustomFieldValue oldCustomFieldValue in lineItem.customFieldValues) { + if (!(oldCustomFieldValue.customFieldId == customFieldId) + && !(oldCustomFieldValue.customFieldId == dropDownCustomFieldId)) { + customFieldValues.Add(oldCustomFieldValue); + } + } + } + + lineItem.customFieldValues = customFieldValues.ToArray(); + + // Update the line item on the server. + LineItem[] lineItems = lineItemService.updateLineItems(new LineItem[] {lineItem}); + + if (lineItems != null) { + foreach (LineItem updatedLineItem in lineItems) { + List customFieldValueStrings = new List(); + foreach (BaseCustomFieldValue baseCustomFieldValue in lineItem.customFieldValues) { + if (baseCustomFieldValue is CustomFieldValue + && ((CustomFieldValue) baseCustomFieldValue).value is TextValue) { + customFieldValueStrings.Add("{ID: '" + baseCustomFieldValue.customFieldId + + "', value: '" + + ((TextValue) ((CustomFieldValue) baseCustomFieldValue).value).value + + "'}"); + } else if (baseCustomFieldValue is DropDownCustomFieldValue) { + customFieldValueStrings.Add("{ID: '" + baseCustomFieldValue.customFieldId + + "', custom field option ID: '" + + ((DropDownCustomFieldValue) baseCustomFieldValue).customFieldOptionId + + "'}"); + } + } + Console.WriteLine("A line item with ID \"{0}\" set with custom field values \"{1}\".", + updatedLineItem.id, string.Join(", ", customFieldValueStrings.ToArray())); + } + } else { + Console.WriteLine("No line items were updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CustomFieldService/UpdateCustomFields.cs b/examples/Dfp/CSharp/v201308/CustomFieldService/UpdateCustomFields.cs new file mode 100644 index 00000000000..609aed43a30 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CustomFieldService/UpdateCustomFields.cs @@ -0,0 +1,95 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using Google.Api.Ads.Dfp.Util.v201308; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example updates custom field descriptions. To determine which + /// custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.updateCustomFields + /// + class UpdateCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates custom field descriptions. To determine which custom " + + "fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201308.CustomFieldService); + + // Set the ID of the custom field to update. + long customFieldId = long.Parse(_T("INSERT_CUSTOM_FIELD_ID_HERE")); + + try { + // Get the custom field. + CustomField customField = customFieldService.getCustomField(customFieldId); + + if (customField != null) { + customField.description = + (customField.description == null ? "" : customField.description + " Updated"); + + // Update the custom field on the server. + CustomField[] customFields = + customFieldService.updateCustomFields(new CustomField[] {customField}); + + // Display results + if (customFields != null) { + foreach (CustomField updatedCustomField in customFields) { + Console.WriteLine("Custom field with ID \"{0}\", name \"{1}\", and description " + + "\"{2}\" was updated.", updatedCustomField.id, updatedCustomField.name, + updatedCustomField.description); + } + } else { + Console.WriteLine("No custom fields were updated."); + } + } else { + Console.WriteLine("No custom fields found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs b/examples/Dfp/CSharp/v201308/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs new file mode 100644 index 00000000000..da2fb4801c9 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs @@ -0,0 +1,158 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates new custom targeting keys and values. To + /// determine which custom targeting keys and values exist, run + /// GetAllCustomTargetingKeysAndValues.cs. To target these custom targeting + /// keys and values, run TargetCustomCriteria.cs. + /// + /// Tags: CustomTargetingService.createCustomTargetingKeys + /// Tags: CustomTargetingService.createCustomTargetingValues + /// + class CreateCustomTargetingKeysAndValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new custom targeting keys and values. To determine " + + "which custom targeting keys and values exist, run " + + "GetAllCustomTargetingKeysAndValues.cs. To target these custom targeting keys and " + + "values, run TargetCustomCriteria.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomTargetingKeysAndValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201308.CustomTargetingService); + + // Create predefined key. + CustomTargetingKey genderKey = new CustomTargetingKey(); + genderKey.displayName = "gender"; + genderKey.name = "g"; + genderKey.type = CustomTargetingKeyType.PREDEFINED; + + // Create predefined key that may be used for content targeting. + CustomTargetingKey genreKey = new CustomTargetingKey(); + genreKey.displayName = "genre"; + genreKey.name = "genre"; + genreKey.type = CustomTargetingKeyType.PREDEFINED; + + // Create free-form key. + CustomTargetingKey carModelKey = new CustomTargetingKey(); + carModelKey.displayName = "car model"; + carModelKey.name = "c"; + carModelKey.type = CustomTargetingKeyType.FREEFORM; + + try { + // Create the custom targeting keys on the server. + CustomTargetingKey[] keys = customTargetingService.createCustomTargetingKeys( + new CustomTargetingKey[] {genderKey, genreKey, carModelKey}); + + if (keys != null) { + foreach (CustomTargetingKey key in keys) { + Console.WriteLine("A custom targeting key with ID \"{0}\", name \"{1}\", and display " + + "name \"{2}\" was created.", key.id, key.name, key.displayName); + } + } else { + Console.WriteLine("No keys were created."); + } + + // Create custom targeting value for the predefined gender key. + CustomTargetingValue genderMaleValue = new CustomTargetingValue(); + genderMaleValue.customTargetingKeyId = keys[0].id; + genderMaleValue.displayName = "male"; + // Name is set to 1 so that the actual name can be hidden from website + // users. + genderMaleValue.name = "1"; + genderMaleValue.matchType = CustomTargetingValueMatchType.EXACT; + + CustomTargetingValue genderFemaleValue = new CustomTargetingValue(); + genderFemaleValue.customTargetingKeyId = keys[0].id; + genderFemaleValue.displayName = "female"; + // Name is set to 2 so that the actual name can be hidden from website + // users. + genderFemaleValue.name = "2"; + genderFemaleValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create custom targeting value for the predefined genre key. + CustomTargetingValue genreComedyValue = new CustomTargetingValue(); + genreComedyValue.customTargetingKeyId = keys[1].id; + genreComedyValue.displayName = "comedy"; + genreComedyValue.name = "comedy"; + genreComedyValue.matchType = CustomTargetingValueMatchType.EXACT; + + CustomTargetingValue genreDramaValue = new CustomTargetingValue(); + genreDramaValue.customTargetingKeyId = keys[1].id; + genreDramaValue.displayName = "drama"; + genreDramaValue.name = "drama"; + genreDramaValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create custom targeting value for the free-form age key. These are + // values that would be suggested in the UI or can be used when + // targeting with a FreeFormCustomCriteria. + CustomTargetingValue carModelHondaCivicValue = new CustomTargetingValue(); + carModelHondaCivicValue.customTargetingKeyId = keys[2].id; + carModelHondaCivicValue.displayName = "honda civic"; + carModelHondaCivicValue.name = "honda civic"; + // Setting match type to exact will match exactly "honda civic". + carModelHondaCivicValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create the custom targeting values on the server. + CustomTargetingValue[] returnValues = customTargetingService.createCustomTargetingValues( + new CustomTargetingValue[] {genderMaleValue, genderFemaleValue, genreComedyValue, + genreDramaValue, carModelHondaCivicValue}); + + if (returnValues != null) { + foreach (CustomTargetingValue value in returnValues) { + Console.WriteLine("A custom targeting value with ID \"{0}\", belonging to key with " + + "ID \"{1}\", name \"{2}\", and display name \"{3}\" was created.", value.id, + value.customTargetingKeyId, value.name, value.displayName); + } + } else { + Console.WriteLine("No values were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom targeting keys and values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs b/examples/Dfp/CSharp/v201308/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs new file mode 100644 index 00000000000..f8b56c62fb0 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs @@ -0,0 +1,122 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all custom targeting keys and the values. To create + /// custom targeting keys and values, run + /// CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// + class GetAllCustomTargetingKeysAndValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom targeting keys and the values. To create " + + "custom targeting keys and values, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCustomTargetingKeysAndValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201308.CustomTargetingService); + + // Sets defaults for page and filter. + CustomTargetingKeyPage keyPage = new CustomTargetingKeyPage(); + Statement keyFilterStatement = new Statement(); + int keyOffset = 0; + + try { + do { + // Create a statement to get all custom targeting keys. + keyFilterStatement.query = "LIMIT 500 OFFSET " + keyOffset; + + // Get custom targeting keys by statement. + keyPage = customTargetingService.getCustomTargetingKeysByStatement(keyFilterStatement); + + if (keyPage.results != null) { + int i = keyPage.startIndex; + foreach (CustomTargetingKey key in keyPage.results) { + Console.WriteLine("{0}) Custom targeting key with ID \"{1}\", name \"{2}\", " + + "display name \"{3}\", and type \"{4}\" was found.", i, key.id, key.name, + key.displayName, key.type); + + + // Sets defaults for page and filter. + CustomTargetingValuePage valuePage = new CustomTargetingValuePage(); + Statement valueFilterStatement = new Statement(); + int valueOffset = 0; + + do { + // Create a statement to get all custom targeting values for a + // custom targeting key (required) by its ID. + valueFilterStatement.query = string.Format("WHERE customTargetingKeyId = {0} " + + "LIMIT 500 OFFSET {1}", key.id, valueOffset); + + // Get custom targeting values by statement. + valuePage = customTargetingService.getCustomTargetingValuesByStatement( + valueFilterStatement); + + if (valuePage.results != null) { + int j = valuePage.startIndex; + foreach (CustomTargetingValue value in valuePage.results) { + Console.WriteLine("\t{0}) Custom targeting value with ID \"{1}\", name " + + "\"{2}\", and display name \"{3}\" was found.", j, value.id, value.name, + value.displayName); + j++; + } + } + valueOffset += 500; + } while (valuePage.results != null && valuePage.results.Length == 500); + i++; + } + } + keyOffset += 500; + } while (keyPage.results != null && keyPage.results.Length == 500); + Console.WriteLine("Number of results found: {0}", keyPage.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get custom targeting keys and the values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CustomTargetingService/GetCustomTargetingKeysByStatement.cs b/examples/Dfp/CSharp/v201308/CustomTargetingService/GetCustomTargetingKeysByStatement.cs new file mode 100644 index 00000000000..ba0fc1df5fa --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CustomTargetingService/GetCustomTargetingKeysByStatement.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all predefined custom targeting keys. The statement + /// retrieves up to the maximum page size limit of 500. To create custom + /// targeting keys, run CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// + class GetCustomTargetingKeysByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all predefined custom targeting keys. The statement " + + "retrieves up to the maximum page size limit of 500. To create custom " + + "targeting keys, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCustomTargetingKeysByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201308.CustomTargetingService); + + try { + // Create a statement to only select predefined custom targeting keys. + Statement filterStatement = new StatementBuilder("WHERE type = :type LIMIT 500").AddValue( + "type", CustomTargetingKeyType.PREDEFINED.ToString()).ToStatement(); + + // Get custom targeting keys by statement. + CustomTargetingKeyPage page = + customTargetingService.getCustomTargetingKeysByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomTargetingKey customTargetingKey in page.results) { + Console.WriteLine("{0}) Custom targeting key with ID \"{1}\", name \"{2}\", and " + + "display name \"{3}\" was found.", i, customTargetingKey.id, + customTargetingKey.name, customTargetingKey.displayName); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get predefined custom targeting keys. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CustomTargetingService/GetCustomTargetingValuesByStatement.cs b/examples/Dfp/CSharp/v201308/CustomTargetingService/GetCustomTargetingValuesByStatement.cs new file mode 100644 index 00000000000..770f8ac0fbd --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CustomTargetingService/GetCustomTargetingValuesByStatement.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets custom targeting values for the given predefined + /// custom targeting key. The statement retrieves up to the maximum page size + /// limit of 500. To create custom targeting values, run + /// CreateCustomTargetingKeysAndValues.cs. To determine which custom + /// targeting keys exist, run GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// + class GetCustomTargetingValuesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets custom targeting values for the given predefined custom " + + "targeting key. The statement retrieves up to the maximum page size limit of 500. " + + "To create custom targeting values, run CreateCustomTargetingKeysAndValues.cs. To " + + "determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCustomTargetingValuesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201308.CustomTargetingService); + + // Set the ID of the custom targeting key to get custom targeting values + // for. + long customTargetingKeyId = long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + + // Create a statement to only select custom targeting values for a given + // key. + Statement filterStatement = + new StatementBuilder("WHERE customTargetingKeyId = :customTargetingKeyId LIMIT 500") + .AddValue("customTargetingKeyId", customTargetingKeyId).ToStatement(); + + try { + // Get custom targeting values by statement. + CustomTargetingValuePage page = + customTargetingService.getCustomTargetingValuesByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomTargetingValue customTargetingValue in page.results) { + Console.WriteLine("{0}) Custom targeting value with ID \"{1}\", name \"{2}\", and " + + "display name \"{3}\" was found.", i, customTargetingValue.id, + customTargetingValue.name, customTargetingValue.displayName); + i++; + } + } + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get custom targeting values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CustomTargetingService/UpdateCustomTargetingKeys.cs b/examples/Dfp/CSharp/v201308/CustomTargetingService/UpdateCustomTargetingKeys.cs new file mode 100644 index 00000000000..77f7b7f37e1 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CustomTargetingService/UpdateCustomTargetingKeys.cs @@ -0,0 +1,107 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example updates the display name of each custom targeting key up + /// to the first 500. To determine which custom targeting keys exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// Tags: CustomTargetingService.updateCustomTargetingKeys + /// + class UpdateCustomTargetingKeys : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the display name of each custom targeting key up " + + "to the first 500. To determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomTargetingKeys(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201308.CustomTargetingService); + + // Create a statement to get all custom targeting keys. + Statement filterStatement = new Statement(); + filterStatement.query = "LIMIT 500"; + + try { + // Get custom targeting keys by statement. + CustomTargetingKeyPage page = + customTargetingService.getCustomTargetingKeysByStatement(filterStatement); + + if (page.results != null) { + CustomTargetingKey[] customTargetingKeys = page.results; + + // Update each local custom targeting key object by changing its display + // name. + foreach (CustomTargetingKey customTargetingKey in customTargetingKeys) { + if (customTargetingKey.displayName == null) { + customTargetingKey.displayName = customTargetingKey.name; + } + customTargetingKey.displayName = customTargetingKey.displayName + " (Deprecated)"; + } + + // Update the custom targeting keys on the server. + customTargetingKeys = + customTargetingService.updateCustomTargetingKeys(customTargetingKeys); + + if (customTargetingKeys != null) { + foreach (CustomTargetingKey customTargetingKey in customTargetingKeys) { + Console.WriteLine("Custom targeting key with ID \"{0}\", name \"{1}\", and " + + "display name \"{2}\" was updated.", customTargetingKey.id, + customTargetingKey.name, customTargetingKey.displayName); + } + } else { + Console.WriteLine("No custom targeting keys updated."); + } + } else { + Console.WriteLine("No custom targeting keys found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update display name of custom targeting keys. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/CustomTargetingService/UpdateCustomTargetingValues.cs b/examples/Dfp/CSharp/v201308/CustomTargetingService/UpdateCustomTargetingValues.cs new file mode 100644 index 00000000000..50668fb1ee8 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/CustomTargetingService/UpdateCustomTargetingValues.cs @@ -0,0 +1,113 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example updates the display name of each custom targeting value + /// up to the first 500. To determine which custom targeting keys exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// Tags: CustomTargetingService.updateCustomTargetingValues + /// + class UpdateCustomTargetingValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the display name of each custom targeting value up to " + + "the first 500. To determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomTargetingValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201308.CustomTargetingService); + + // Set the ID of the predefined custom targeting key to get custom + // targeting values for. + long customTargetingKeyId = long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + + // Create a statement to only select predefined custom targeting values + // for a given key. + Statement filterStatement = + new StatementBuilder("WHERE customTargetingKeyId = :customTargetingKeyId LIMIT 500") + .AddValue("customTargetingKeyId", customTargetingKeyId).ToStatement(); + + try { + // Get custom targeting values by statement. + CustomTargetingValuePage page = + customTargetingService.getCustomTargetingValuesByStatement(filterStatement); + + if (page.results != null) { + CustomTargetingValue[] customTargetingValues = page.results; + + // Update each local custom targeting value object by changing its + // display name. + foreach (CustomTargetingValue customTargetingValue in customTargetingValues) { + if (customTargetingValue.displayName == null) { + customTargetingValue.displayName = customTargetingValue.displayName; + } + customTargetingValue.displayName = customTargetingValue.displayName + " (Deprecated)"; + } + + // Update the custom targeting values on the server. + customTargetingValues = + customTargetingService.updateCustomTargetingValues(customTargetingValues); + + if (customTargetingValues != null) { + foreach (CustomTargetingValue customTargetingValue in customTargetingValues) { + Console.WriteLine("Custom targeting value with ID \"{0}\", name \"{1}\", and " + + "display name \"{2}\" was updated.", customTargetingValue.id, + customTargetingValue.name, customTargetingValue.displayName); + } + } else { + Console.WriteLine("No custom targeting values updated."); + } + } else { + Console.WriteLine("No custom targeting values found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update display names of custom targeting values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ForecastService/GetForecast.cs b/examples/Dfp/CSharp/v201308/ForecastService/GetForecast.cs new file mode 100644 index 00000000000..2e8627392f9 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ForecastService/GetForecast.cs @@ -0,0 +1,113 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets a forecast for a prospective line item. To + /// determine which placements exist, run GetAllPlacements.cs. + /// + /// Tags: ForecastService.getForecast + /// + class GetForecast : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a forecast for a prospective line item. To determine " + + "which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetForecast(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ForecastService. + ForecastService forecastService = + (ForecastService)user.GetService(DfpService.v201308.ForecastService); + + // Set the placement that the prospective line item will target. + long[] targetPlacementIds = new long[] {long.Parse(_T("INSERT_PLACEMENT_ID_HERE"))}; + + // Set the end date time to have the line line item run till. + string endDateTime = "INSERT_END_DATE_TIME_HERE (yyyyMMdd HH:mm:ss)"; + + // Create prospective line item. + LineItem lineItem = new LineItem(); + + lineItem.targeting = new Targeting(); + lineItem.targeting.inventoryTargeting = new InventoryTargeting(); + lineItem.targeting.inventoryTargeting.targetedPlacementIds = targetPlacementIds; + + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + lineItem.lineItemType = LineItemType.SPONSORSHIP; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + + lineItem.endDateTime = DateTimeUtilities.FromString(endDateTime); + + // Set the cost type to match the unit type. + lineItem.costType = CostType.CPM; + + try { + // Get forecast. + Forecast forecast = forecastService.getForecast(lineItem); + + // Display results. + long matched = forecast.matchedUnits; + double availablePercent = (double) (forecast.availableUnits / (matched * 1.0)) * 100; + String unitType = forecast.unitType.ToString().ToLower(); + Console.WriteLine("{0} {1} matched.\n{2}% available.", matched, unitType, + availablePercent, unitType); + + if (forecast.possibleUnitsSpecified) { + double possiblePercent = (double) (forecast.possibleUnits / (matched * 1.0)) * 100; + Console.WriteLine("{0}% {1} possible.\n", possiblePercent, unitType); + } + Console.WriteLine("{0} contending line items.", (forecast.contendingLineItems != null) ? + forecast.contendingLineItems.Length : 0); + } catch (Exception ex) { + Console.WriteLine("Failed to get forecast. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ForecastService/GetForecastById.cs b/examples/Dfp/CSharp/v201308/ForecastService/GetForecastById.cs new file mode 100644 index 00000000000..16261581ef3 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ForecastService/GetForecastById.cs @@ -0,0 +1,84 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets a forecast for an existing line item. To determine + /// which line items exist, run GetAllLineItems.cs. + /// + /// Tags: ForecastService.getForecastById + /// + class GetForecastById : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a forecast for an existing line item. To determine which " + + "line items exist, run GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetForecastById(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ForecastService. + ForecastService forecastService = + (ForecastService) user.GetService(DfpService.v201308.ForecastService); + + // Set the line item to get a forecast for. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get forecast for line item. + Forecast forecast = forecastService.getForecastById(lineItemId); + + // Display results. + long matched = forecast.matchedUnits; + double availablePercent = (double) (forecast.availableUnits / (matched * 1.0)) * 100; + String unitType = forecast.unitType.ToString().ToLower(); + + Console.WriteLine("{0} {1} matched.\n{2} % {3} available.", matched, unitType, + availablePercent, unitType); + if (forecast.possibleUnitsSpecified) { + double possiblePercent = (double) (forecast.possibleUnits / (matched * 1.0)) * 100; + Console.WriteLine(possiblePercent + "% " + unitType + " possible.\n"); + } + Console.WriteLine("{0} contending line items.", (forecast.contendingLineItems != null)? + forecast.contendingLineItems.Length : 0); + } catch (Exception ex) { + Console.WriteLine("Failed to get forecast by id. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/InventoryService/CreateAdUnits.cs b/examples/Dfp/CSharp/v201308/InventoryService/CreateAdUnits.cs new file mode 100644 index 00000000000..2a67b3dec83 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/InventoryService/CreateAdUnits.cs @@ -0,0 +1,108 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates new ad units under the effective root ad unit. + /// To determine which ad units exist, run GetAdUnitTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.createAdUnits, NetworkService.getCurrentNetwork + /// + class CreateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new ad units under the effective root ad unit. To " + + "determine which ad units exist, run GetAdUnitTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201308.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201308.NetworkService); + + string effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create an array to store local ad unit objects. + AdUnit[] adUnits = new AdUnit[5]; + + for (int i = 0; i < 5; i++) { + AdUnit adUnit = new AdUnit(); + adUnit.name = string.Format("Ad_Unit_{0}", i); + adUnit.parentId = effectiveRootAdUnitId; + + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + + // Set the size of possible creatives that can match this ad unit. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + adUnits[i] = adUnit; + } + + try { + // Create the ad units on the server. + adUnits = inventoryService.createAdUnits(adUnits); + + if (adUnits != null) { + foreach (AdUnit adUnit in adUnits) { + Console.WriteLine("An ad unit with ID = '{0}' was created under parent with " + + "ID = '{1}'.", adUnit.id, adUnit.parentId); + } + } else { + Console.WriteLine("No ad units created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/InventoryService/CreateMobileAdUnit.cs b/examples/Dfp/CSharp/v201308/InventoryService/CreateMobileAdUnit.cs new file mode 100644 index 00000000000..5031ddab55b --- /dev/null +++ b/examples/Dfp/CSharp/v201308/InventoryService/CreateMobileAdUnit.cs @@ -0,0 +1,104 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates a new mobile ad unit under the effective root + /// ad unit. Mobile features need to be enabled on your account to use mobile + /// targeting. To determine which ad units exist, run GetInventoryTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.createAdUnits, NetworkService.getCurrentNetwork + /// + class CreateMobileAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new mobile ad unit under the effective ad unit. " + + "Mobile features need to be enabled on your account to use mobile targeting. To " + + "determine which ad units exist, run GetInventoryTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateMobileAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201308.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201308.NetworkService); + + // Set the parent ad unit's ID for all ad units to be created under. + String effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create local ad unit object. + AdUnit adUnit = new AdUnit(); + adUnit.name = "Mobile_Ad_Unit"; + adUnit.parentId = effectiveRootAdUnitId; + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + adUnit.targetPlatform = TargetPlatform.MOBILE; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + Size size = new Size(); + size.width = 400; + size.height = 300; + size.isAspectRatio = false; + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + // Set the size of possible creatives that can match this ad unit. + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + + try { + // Create the ad unit on the server. + adUnit = inventoryService.createAdUnit(adUnit); + + if (adUnit != null) { + Console.WriteLine("An ad unit with ID \"{0}\" was created under parent with ID \"{1}\".", + adUnit.id, adUnit.parentId); + } else { + Console.WriteLine("No ad units created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/InventoryService/CreateVideoAdUnit.cs b/examples/Dfp/CSharp/v201308/InventoryService/CreateVideoAdUnit.cs new file mode 100644 index 00000000000..ff84c533c9a --- /dev/null +++ b/examples/Dfp/CSharp/v201308/InventoryService/CreateVideoAdUnit.cs @@ -0,0 +1,123 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates a new video ad unit under the effective root + /// ad unit. To determine which ad units exist, run GetInventoryTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.CreateVideoAdUnit, NetworkService.getCurrentNetwork + /// + class CreateVideoAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new ad units under the effective root ad unit. To " + + "determine which ad units exist, run GetAdUnitTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateVideoAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201308.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201308.NetworkService); + + // Set the parent ad unit's ID for all ad units to be created under. + String effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create local ad unit object. + AdUnit adUnit = new AdUnit(); + adUnit.name = "Video_Ad_Unit"; + adUnit.parentId = effectiveRootAdUnitId; + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + adUnit.explicitlyTargeted = true; + adUnit.targetPlatform = TargetPlatform.WEB; + + // Create master ad unit size. + AdUnitSize masterAdUnitSize = new AdUnitSize(); + Size size1 = new Size(); + size1.width = 400; + size1.height = 300; + size1.isAspectRatio = false; + masterAdUnitSize.size = size1; + masterAdUnitSize.environmentType = EnvironmentType.VIDEO_PLAYER; + + // Create companion sizes. + AdUnitSize companionAdUnitSize1 = new AdUnitSize(); + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + size2.isAspectRatio = false; + companionAdUnitSize1.size = size2; + companionAdUnitSize1.environmentType = EnvironmentType.BROWSER; + + AdUnitSize companionAdUnitSize2 = new AdUnitSize(); + Size size3 = new Size(); + size3.width = 728; + size3.height = 90; + size3.isAspectRatio = false; + companionAdUnitSize2.size = size3; + companionAdUnitSize2.environmentType = EnvironmentType.BROWSER; + + // Add companions to master ad unit size. + masterAdUnitSize.companions = new AdUnitSize[] {companionAdUnitSize1, companionAdUnitSize2}; + + // Set the size of possible creatives that can match this ad unit. + adUnit.adUnitSizes = new AdUnitSize[] {masterAdUnitSize}; + + try { + // Create the ad unit on the server. + adUnit = inventoryService.createAdUnit(adUnit); + + if (adUnit != null) { + Console.WriteLine("A video ad unit with ID \"{0}\" was created under parent with ID " + + "\"{1}\".", adUnit.id, adUnit.parentId); + } else { + Console.WriteLine("No video ad units created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create video ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/InventoryService/DeActivateAdUnits.cs b/examples/Dfp/CSharp/v201308/InventoryService/DeActivateAdUnits.cs new file mode 100644 index 00000000000..59bcafe2578 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/InventoryService/DeActivateAdUnits.cs @@ -0,0 +1,120 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example deactivates all active ad units. To determine which ad + /// units exist, run GetAllAdUnits.cs or GetInventoryTree.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: InventoryService.performAdUnitAction + /// + class DeActivateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active ad units. To determine which ad units " + + "exist, run GetAllAdUnits.cs or GetInventoryTree.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeActivateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201308.InventoryService); + + // Create Statement text to select active ad units. + string statementText = "WHERE status = :status LIMIT 500"; + + Statement statement = new StatementBuilder("").AddValue("status", + InventoryStatus.ACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + AdUnitPage page = new AdUnitPage(); + int offset = 0; + List adUnitIds = new List(); + + try { + do { + // Create a Statement to page through active ad units. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID ='{1}', name = {2} and status = {3} will" + + " be deactivated.", i, adUnit.id, adUnit.name, adUnit.status); + adUnitIds.Add(adUnit.id); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of ad units to be deactivated: {0}", adUnitIds.Count); + + if (adUnitIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", adUnitIds.ToArray()))). + ToStatement(); + + // Create action. + DeactivateAdUnits action = new DeactivateAdUnits(); + + // Perform action. + UpdateResult result = inventoryService.performAdUnitAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of ad units deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No ad units were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/InventoryService/GetAdUnit.cs b/examples/Dfp/CSharp/v201308/InventoryService/GetAdUnit.cs new file mode 100644 index 00000000000..4e02321a3af --- /dev/null +++ b/examples/Dfp/CSharp/v201308/InventoryService/GetAdUnit.cs @@ -0,0 +1,77 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets an ad unit by its ID. To determine which ad units + /// exist, run GetInventoryTree.cs or GetAllAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnit + /// + class GetAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets an ad unit by its ID. To determine which ad units " + + "exist, run GetInventoryTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201308.InventoryService); + + // Set the ID of the ad unit to get. + String adUnitId = _T("INSERT_AD_UNIT_ID_HERE"); + + try { + // Get the ad unit. + AdUnit adUnit = inventoryService.getAdUnit(adUnitId); + + if (adUnit != null) { + Console.WriteLine("Ad unit with ID = '{0}', name = '{1}' and status = '{2}' was found.", + adUnit.id, adUnit.name, adUnit.status); + } else { + Console.WriteLine("No ad unit found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/InventoryService/GetAdUnitSizes.cs b/examples/Dfp/CSharp/v201308/InventoryService/GetAdUnitSizes.cs new file mode 100644 index 00000000000..0e586dc1649 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/InventoryService/GetAdUnitSizes.cs @@ -0,0 +1,80 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; +using Google.Api.Ads.Dfp.Util.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all web target platform ad unit sizes. + /// + /// Tags: InventoryService.getAdUnitSizesByStatement + /// + class GetAdUnitSizes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all web target platform ad unit sizes."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnitSizes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201308.InventoryService); + + Statement filterStatement = new StatementBuilder("WHERE targetPlatform = :targetPlatform"). + AddValue("targetPlatform", "WEB").ToStatement(); + + try { + // Get all ad unit sizes. + AdUnitSize[] adUnitSizes = inventoryService.getAdUnitSizesByStatement(filterStatement); + + // Display results. + if (adUnitSizes != null) { + for (int i = 0; i < adUnitSizes.Length; i++) { + AdUnitSize adUnitSize = adUnitSizes[i]; + Console.WriteLine("{0}) Ad unit size ({1}x{2}) was found.\n", i, + adUnitSize.size.width, adUnitSize.size.height); + } + } else { + Console.WriteLine("No ad unit sizes found."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit sizes. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/InventoryService/GetAdUnitsByStatement.cs b/examples/Dfp/CSharp/v201308/InventoryService/GetAdUnitsByStatement.cs new file mode 100644 index 00000000000..d0af1c77569 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/InventoryService/GetAdUnitsByStatement.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets the root ad unit. To create an ad unit, run + /// CreateAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: NetworkService.getCurrentNetwork + /// + class GetAdUnitsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the root ad unit. To create an ad unit, run " + + "CreateAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnitsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201308.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201308.NetworkService); + + // Get the effective root ad unit ID of the network. + string effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create a statement to select the children of the effective root ad + // unit. + Statement statement = new StatementBuilder("WHERE parentId = :id LIMIT 1").AddValue( + "id", effectiveRootAdUnitId).ToStatement(); + + try { + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID = '{1}', name = '{2}' and status = '{3}' " + + "was found.", i, adUnit.id, adUnit.name, adUnit.status); + i++; + } + } + + // The number of results should always be 1 for this code example. + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/InventoryService/GetAllAdUnits.cs b/examples/Dfp/CSharp/v201308/InventoryService/GetAllAdUnits.cs new file mode 100644 index 00000000000..4432458dffe --- /dev/null +++ b/examples/Dfp/CSharp/v201308/InventoryService/GetAllAdUnits.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all ad units. To create ad units, run + /// CreateAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// + class GetAllAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all ad units. To create ad units, run CreateAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201308.InventoryService); + + // Sets defaults for page and statement. + AdUnitPage page = new AdUnitPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all ad units. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID = '{1}', name = '{2}' and status = '{3}' " + + "was found.", i, adUnit.id, adUnit.name, adUnit.status); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/InventoryService/GetInventoryTree.cs b/examples/Dfp/CSharp/v201308/InventoryService/GetInventoryTree.cs new file mode 100644 index 00000000000..ff3dcf5e62c --- /dev/null +++ b/examples/Dfp/CSharp/v201308/InventoryService/GetInventoryTree.cs @@ -0,0 +1,203 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example retrieves a previously created ad units and creates + /// a tree. + /// + /// Tags: InventoryService.getAdUnit, InventoryService.getAdUnitsByStatement + /// + class GetInventoryTree : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves a previously created ad units and creates a tree."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetInventoryTree(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + try { + // Get all ad units. + AdUnit[] allAdUnits = GetAllAdUnits(user); + + // Find the root ad unit. rootAdUnit can also be set to child unit to + // only build and display a portion of the tree. + // i.e. AdUnit adUnit = + // inventoryService.getAdUnit("INSERT_AD_UNIT_HERE") + AdUnit rootAdUnit = FindRootAdUnit(user); + + if (rootAdUnit == null) { + Console.WriteLine("Could not build tree. No root ad unit found."); + } else { + BuildAndDisplayAdUnitTree(rootAdUnit, allAdUnits); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + + /// + /// Gets all ad units for this user. + /// + /// The DfpUser to get the ad units for. + /// All ad units for this user. + private static AdUnit[] GetAllAdUnits(DfpUser user) { + // Create list to hold all ad units. + List adUnits = new List(); + + // Get InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201308.InventoryService); + + // Sets defaults for page and Statement. + AdUnitPage page = new AdUnitPage(); + Statement statement = new Statement(); + int offset = 0; + + do { + // Create a Statement to get all ad units. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + adUnits.AddRange(page.results); + } + offset += 500; + } while (page.results != null && page.results.Length == 500); + return adUnits.ToArray(); + } + + /// + /// Finds the root ad unit for the user. + /// + /// The DfpUser to get the root ad unit for. + /// The ad unit representing the root ad unit or null if one + /// is not found. + private static AdUnit FindRootAdUnit(DfpUser user) { + // Get InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201308.InventoryService); + + // Create a Statement to only select the root ad unit. + Statement statement = new Statement(); + statement.query = "WHERE parentId IS NULL LIMIT 500"; + + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + return page.results[0]; + } + return null; + } + + /// + /// Builds and displays an ad unit tree from an array of ad units underneath + /// the root ad unit. + /// + /// The root ad unit to build the tree under. + /// The array of ad units. + private static void BuildAndDisplayAdUnitTree(AdUnit root, AdUnit[] units) { + Dictionary> treeMap = new Dictionary>(); + + foreach (AdUnit unit in units) { + if (unit.parentId != null) { + if (treeMap.ContainsKey(unit.parentId) == false) { + treeMap.Add(unit.parentId, new List()); + } + treeMap[unit.parentId].Add(unit); + } + } + + if (root != null) { + DisplayInventoryTree(root, treeMap); + } else { + Console.WriteLine("No root unit found."); + } + } + + /// + /// Displays the ad unit tree beginning at the root ad unit. + /// + /// The root ad unit + /// The map of id to list of ad units + private static void DisplayInventoryTree(AdUnit root, Dictionary> treeMap) { + DisplayInventoryTreeHelper(root, treeMap, 0); + } + + /// + /// Helper for displaying inventory units. + /// + /// The root inventory unit. + /// The map of id to List of inventory units. + /// The depth the tree has reached. + private static void DisplayInventoryTreeHelper(AdUnit root, + Dictionary> treeMap, int depth) { + Console.WriteLine(GenerateTab(depth) + root.name + " (" + root.id + ")"); + + if (treeMap.ContainsKey(root.id)) { + foreach (AdUnit child in treeMap[root.id]) { + DisplayInventoryTreeHelper(child, treeMap, depth + 1); + } + } + } + + /// + /// Generates a String of tabs to represent branching to children. + /// + /// A depth from 0 to max(depth). + /// A string to insert in front of the root unit. + private static String GenerateTab(int depth) { + StringBuilder builder = new StringBuilder(); + if (depth != 0) { + builder.Append(" "); + } + + for (int i = 1; i < depth; i++) { + builder.Append("| "); + } + builder.Append("+--"); + return builder.ToString(); + } + } +} diff --git a/examples/Dfp/CSharp/v201308/InventoryService/UpdateAdUnits.cs b/examples/Dfp/CSharp/v201308/InventoryService/UpdateAdUnits.cs new file mode 100644 index 00000000000..88d788347f1 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/InventoryService/UpdateAdUnits.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example updates an ad unit by enabling AdSense to the first + /// 500. To determine which ad units exist, run GetAllAdUnits.cs or + /// GetInventoryTree.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement, InventoryService.updateAdUnits + /// + class UpdateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates an ad unit by enabling AdSense to the first 500. To " + + "determine which ad units exist, run GetAllAdUnits.cs or GetInventoryTree.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the sample code. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201308.InventoryService); + + // Create a statement to get all ad units. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get ad units by statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null) { + // Update each local ad unit object by enabling AdSense. + foreach (AdUnit adUnit in page.results) { + adUnit.inheritedAdSenseSettings.value.adSenseEnabled = true; + } + + // Update the ad units on the server. + AdUnit[] updatedAdUnits = inventoryService.updateAdUnits(page.results); + + if (updatedAdUnits != null) { + foreach (AdUnit adUnit in updatedAdUnits) { + Console.WriteLine("Ad unit with ID \"{0}\", name \"{1}\", and is AdSense enabled " + + "\"{2}\" was updated.", adUnit.id, adUnit.name, + adUnit.inheritedAdSenseSettings.value.adSenseEnabled); + } + } else { + Console.WriteLine("No ad units updated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to update ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LabelService/CreateLabels.cs b/examples/Dfp/CSharp/v201308/LabelService/CreateLabels.cs new file mode 100644 index 00000000000..83848802a99 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LabelService/CreateLabels.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates new labels. To determine which labels exist, run + /// GetAllLabels.cs. This feature is only available to DFP premium solution + /// networks. + /// + /// Tags: LabelService.createLabels + /// + class CreateLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new labels. To determine which labels exist, run " + + "GetAllLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201308.LabelService); + + try { + // Create an array to store local label objects. + Label[] labels = new Label[5]; + + for (int i = 0; i < 5; i++) { + Label label = new Label(); + label.name = "Label #" + GetTimeStamp(); + label.types = new LabelType[] {LabelType.COMPETITIVE_EXCLUSION}; + labels[i] = label; + } + + // Create the labels on the server. + labels = labelService.createLabels(labels); + + if (labels != null) { + foreach (Label label in labels) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("A label with ID '{0}', name '{1}', and type '{2}' was created.", + label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + } + } else { + Console.WriteLine("No labels created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LabelService/DeactivateActiveLabels.cs b/examples/Dfp/CSharp/v201308/LabelService/DeactivateActiveLabels.cs new file mode 100644 index 00000000000..493c377b325 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LabelService/DeactivateActiveLabels.cs @@ -0,0 +1,116 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example deactivates all active labels. To determine which labels + /// exist, run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement, LabelService.performLabelAction + /// + class DeactivateActiveLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active labels. To determine which labels exist," + + " run GetAllLabels.cs. This feature is only available to DFP premium solution " + + "networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateActiveLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201308.LabelService); + + // Create statement text to select active labels. + String statementText = "WHERE isActive = :isActive LIMIT 500"; + Statement filterStatement = new StatementBuilder("").AddValue("isActive", true).ToStatement(); + + // Set defaults for page and offset. + LabelPage page = new LabelPage(); + int offset = 0; + List labelIds = new List(); + + try { + do { + // Create a statement to page through active labels. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get labels by statement. + page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + Console.WriteLine("{0}) Label with ID '{1}', name '{2}' will be deactivated.", + i, label.id, label.name); + labelIds.Add(label.id.ToString()); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of labels to be deactivated: " + labelIds.Count); + + if (labelIds.Count > 0) { + // Modify statement for action. + filterStatement.query = "WHERE id IN (" + string.Join(", ", labelIds.ToArray()) + ")"; + + // Create action. + DeactivateLabels action = new DeactivateLabels(); + + // Perform action. + UpdateResult result = labelService.performLabelAction(action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of labels deactivated: " + result.numChanges); + } else { + Console.WriteLine("No labels were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LabelService/GetAllLabels.cs b/examples/Dfp/CSharp/v201308/LabelService/GetAllLabels.cs new file mode 100644 index 00000000000..27fa31254e5 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LabelService/GetAllLabels.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all labels. To create labels, run CreateLabels.cs. + /// This feature is only available to DFP premium solution networks. + /// + /// Tags: LabelService.getLabelsByStatement + /// + class GetAllLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all labels. To create labels, run CreateLabels.cs. This " + + "feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201308.LabelService); + + // Set defaults for page and filterStatement. + LabelPage page = new LabelPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all labels. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get labels by statement. + page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("{0}) Label with ID '{1}', name '{2}' and type '{3}' was found.", + i, label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LabelService/GetLabel.cs b/examples/Dfp/CSharp/v201308/LabelService/GetLabel.cs new file mode 100644 index 00000000000..30f4c1ae1dd --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LabelService/GetLabel.cs @@ -0,0 +1,83 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets a label by its ID. To determine which labels exist, + /// run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabel + /// + class GetLabel : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a label by its ID. To determine which labels exist, " + + "run GetAllLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLabel(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201308.LabelService); + + // Set the ID of the label to get. + long labelId = long.Parse(_T("INSERT_LABEL_ID_HERE")); + + try { + // Get the label. + Label label = labelService.getLabel(labelId); + + if (label != null) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + Console.WriteLine("Label with ID '{0}, name '{1}' and type '{2}' was found.", + label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + } else { + Console.WriteLine("No label found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get label. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LabelService/GetLabelsByStatement.cs b/examples/Dfp/CSharp/v201308/LabelService/GetLabelsByStatement.cs new file mode 100644 index 00000000000..92f2ea9b2ef --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LabelService/GetLabelsByStatement.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all labels that are competitively excluded. The + /// statement retrieves up to the maximum page size limit of 500. To create + /// labels, run CreateLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement + /// + class GetLabelsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all labels that are competitively excluded. The statement " + + "retrieves up to the maximum page size limit of 500. To create labels, run " + + "CreateLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLabelsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201308.LabelService); + + // Create a statement to only select labels that are competitive + // sorted by name. + Statement filterStatement = new StatementBuilder("WHERE type = :type ORDER BY name LIMIT 500") + .AddValue("type", LabelType.COMPETITIVE_EXCLUSION.ToString()).ToStatement(); + + try { + // Get labels by statement. + LabelPage page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("{0}) Label with ID '{1}', name '{2}'and type '{3}' was found.", + i, label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LabelService/UpdateLabels.cs b/examples/Dfp/CSharp/v201308/LabelService/UpdateLabels.cs new file mode 100644 index 00000000000..5a12ad7429a --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LabelService/UpdateLabels.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example updates the descriptions of all active labels by + /// updating its description up to the first 500. To determine which labels + /// exist, run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement, LabelService.updateLabels + /// + class UpdateLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the descriptions of all active labels by updating " + + "its description up to the first 500. To determine which labels exist, run " + + "GetAllLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201308.LabelService); + + // Create a statement to only select labels that are competitive + // exclusion. + Statement filterStatement = new StatementBuilder("WHERE isActive = :isActive LIMIT 500"). + AddValue("isActive", true).ToStatement(); + + try { + // Get the labels by statement. + LabelPage page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + Label[] labels = page.results; + + // Update each local label object by updating its description. + foreach (Label label in labels) { + label.description = "These labels are still competiting with each other."; + } + + // Update the labels on the server. + labels = labelService.updateLabels(labels); + + if (labels != null) { + foreach (Label label in labels) { + Console.WriteLine("A label with ID '{0}' and name '{1}' was updated.", + label.id, label.name); + } + } else { + Console.WriteLine("No labels updated."); + } + } else { + Console.WriteLine("No labels found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/ActivateLicas.cs b/examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/ActivateLicas.cs new file mode 100644 index 00000000000..b35922e3912 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/ActivateLicas.cs @@ -0,0 +1,125 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example activates all deactivated LICAs for the line item. To + /// determine which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.performLineItemCreativeAssociationAction + /// + class ActivateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example activates all deactivated LICAs for the line item. To " + + "determine which LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ActivateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201308.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + String statementText = "WHERE lineItemId = :lineItemId and status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("lineItemId", lineItemId). + AddValue("status", LineItemCreativeAssociationStatus.INACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + int offset = 0; + List creativeIds = new List(); + + try { + do { + // Create a Statement to page through active LICAs. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' will be activated.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + creativeIds.Add(lica.creativeId.ToString()); + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of LICAs to be activated: {0}", creativeIds.Count); + + if (creativeIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE lineItemId = :lineItemId and creativeId IN ({0})", + string.Join(",", creativeIds.ToArray()))). + AddValue("lineItemId", lineItemId).ToStatement(); + + // Create action. + ActivateLineItemCreativeAssociations action = + new ActivateLineItemCreativeAssociations(); + + // Perform action. + UpdateResult result = + licaService.performLineItemCreativeAssociationAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of LICAs activated: {0}", result.numChanges); + } else { + Console.WriteLine("No LICAs were activated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to activate LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/CreateLicas.cs b/examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/CreateLicas.cs new file mode 100644 index 00000000000..78f8b931806 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/CreateLicas.cs @@ -0,0 +1,108 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates new line item creative associations (LICAs) for + /// an existing line item and a set of creative ids. For small business + /// networks, the creative ids must represent new or copied creatives as + /// creatives cannot be used for more than one line item. For premium + /// solution networks, the creative ids can represent any creative. To copy + /// creatives, run CopyImageCreatives.cs. To determine which LICAs exist, run + /// GetAllLicasExample.cs. + /// + /// Tags: LineItemCreativeAssociationService.createLineItemCreativeAssociations + /// + class CreateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new line item creative associations (LICAs) for an " + + "existing line item and a set of creative ids. For small business networks, the " + + "creative ids must represent new or copied creatives as creatives cannot be used " + + "for more than one line item. For premium solution networks, the creative ids can " + + "represent any creative. To copy creatives, run CopyImageCreatives.cs. To determine " + + "which LICAs exist, run GetAllLicasExample.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = + (LineItemCreativeAssociationService) user.GetService( + DfpService.v201308.LineItemCreativeAssociationService); + + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201308.CreativeService); + + // Set the line item ID and creative IDs to associate. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long[] creativeIds = new long[] {long.Parse(_T("INSERT_CREATIVE_ID_HERE"))}; + + // Create an array to store local LICA objects. + LineItemCreativeAssociation[] licas = new LineItemCreativeAssociation[creativeIds.Length]; + + // For each line item, associate it with the given creative. + int i = 0; + foreach (long creativeId in creativeIds) { + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId; + lica.lineItemId = lineItemId; + licas[i++] = lica; + } + + try { + // Create the LICAs on the server. + licas = licaService.createLineItemCreativeAssociations(licas); + + if (licas != null) { + foreach (LineItemCreativeAssociation lica in licas) { + Console.WriteLine("A LICA with line item ID \"{0}\", creative ID \"{1}\", and status " + + "\"{2}\" was created.", lica.lineItemId, lica.creativeId, lica.status); + } + } else { + Console.WriteLine("No LICAs created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to associate creative with line item. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/DeactivateLicas.cs b/examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/DeactivateLicas.cs new file mode 100644 index 00000000000..c4bf6498d9b --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/DeactivateLicas.cs @@ -0,0 +1,125 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example deactivates all LICAs for the line item. To determine + /// which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.performLineItemCreativeAssociationAction + /// + class DeactivateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all LICAs for the line item. To determine which " + + "LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201308.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + String statementText = "WHERE lineItemId = :lineItemId and status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("lineItemId", lineItemId). + AddValue("status", LineItemCreativeAssociationStatus.ACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + int offset = 0; + List creativeIds = new List(); + + try { + do { + // Create a Statement to page through active LICAs. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' will be deactivated.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + creativeIds.Add(lica.creativeId.ToString()); + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of LICAs to be deactivated: {0}", creativeIds.Count); + + if (creativeIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE lineItemId = :lineItemId and creativeId IN ({0})", + string.Join(",", creativeIds.ToArray()))). + AddValue("lineItemId", lineItemId).ToStatement(); + + // Create action. + DeactivateLineItemCreativeAssociations action = + new DeactivateLineItemCreativeAssociations(); + + // Perform action. + UpdateResult result = + licaService.performLineItemCreativeAssociationAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of LICAs deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No LICAs were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/GetAllLicas.cs b/examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/GetAllLicas.cs new file mode 100644 index 00000000000..b99aecee8a9 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/GetAllLicas.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all line item creative associations (LICA). To + /// create LICAs, run CreateLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// + class GetAllLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line item creative associations (LICA). To create " + + "LICAs, run CreateLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201308.LineItemCreativeAssociationService); + + // Sets defaults for page and Statement. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all LICAs. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' was found.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + } + } + + offset += 500; + } while (page.results != null && page.results.Length == 500); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/GetLica.cs b/examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/GetLica.cs new file mode 100644 index 00000000000..a27197ba3fe --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/GetLica.cs @@ -0,0 +1,81 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets a line item creative association (LICA) by the line + /// item and creative ID. To determine which line items exist, run + /// GetAllLineItems.cs. To determine which creatives exit, run + /// GetAllCreatives.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociation + /// + class GetLica : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a line item creative association (LICA) by the line " + + "item and creative ID. To determine which line items exist, run " + + "GetAllLineItems.cs. To determine which creatives exit, run " + + "GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + new GetLica().Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201308.LineItemCreativeAssociationService); + + // Set the line item and creative ID to use to retrieve the LICA. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long creativeId = long.Parse(_T("INSERT_CREATIVE_ID_HERE")); + + try { + // Get the LICA. + LineItemCreativeAssociation lica = + licaService.getLineItemCreativeAssociation(lineItemId, creativeId); + + if (lica != null) { + Console.WriteLine("LICA with line item ID = {0}, creative ID = '{1}' and status = " + + "'{2}' was found", lica.lineItemId, lica.creativeId, lica.status); + } else { + Console.WriteLine("No LICA found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get LICA. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/GetLicasByStatement.cs b/examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/GetLicasByStatement.cs new file mode 100644 index 00000000000..e5a488b4553 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/GetLicasByStatement.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all line item creative associations for a given + /// line item ID. The Statement retrieves up to the maximum page size limit of + /// 500. To create LICAs, run CreateLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// + class GetLicasByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line item creative associations for a given line " + + "item ID. The Statement retrieves up to the maximum page size limit of 500. To " + + "create LICAs, run CreateLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLicasByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201308.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + // Create a Statement to only select LICAs for the given lineItem ID. + Statement statement = new StatementBuilder("WHERE lineItemId = :lineItemId LIMIT 500"). + AddValue("lineItemId", lineItemId).ToStatement(); + + try { + // Get LICAs by Statement. + LineItemCreativeAssociationPage page = + licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' was found.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/UpdateLicas.cs b/examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/UpdateLicas.cs new file mode 100644 index 00000000000..fc056ba869a --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LineItemCreativeAssociationService/UpdateLicas.cs @@ -0,0 +1,97 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example updates the destination URL of all LICAs up to the first + /// 500. To determine which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.updateLineItemCreativeAssociations + /// + class UpdateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the destination URL of all LICAs up to the first " + + "500. To determine which LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201308.LineItemCreativeAssociationService); + + // Create a Statement to get all LICAs. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get LICAs by Statement. + LineItemCreativeAssociationPage page = + licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + LineItemCreativeAssociation[] licas = page.results; + + // Update each local LICA object by changing its destination URL. + foreach (LineItemCreativeAssociation lica in licas) { + lica.destinationUrl = "http://news.google.com"; + } + + // Update the LICAs on the server. + licas = licaService.updateLineItemCreativeAssociations(licas); + + if (licas != null) { + foreach (LineItemCreativeAssociation lica in licas) { + Console.WriteLine("LICA with line item ID = '{0}, creative ID ='{1}' and " + + "destination URL '{2}' was updated.", lica.lineItemId, lica.creativeId, + lica.destinationUrl); + } + } else { + Console.WriteLine("No LICAs updated."); + } + } else { + Console.WriteLine("No LICAs found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LineItemService/ActivateLineItem.cs b/examples/Dfp/CSharp/v201308/LineItemService/ActivateLineItem.cs new file mode 100644 index 00000000000..cbf4c0e795c --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LineItemService/ActivateLineItem.cs @@ -0,0 +1,134 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example activates all line items for the given order. To be + /// activated, line items need to be in the approved (needs creatives) state + /// and have at least one creative associated with them. To approve line + /// items, approve the order to which they belong by running ApproveOrders.cs. + /// To create LICAs, run CreateLicas.cs. To determine which line items exist, + /// run GetAllLineItem.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.performLineItemAction + /// + class ActivateLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example activates all line items for the given order. To be activated," + + " line items need to be in the approved (needs creatives) state and have at least one" + + " creative associated with them. To approve line items, approve the order to which" + + " they belong by running ApproveOrders.cs. To create LICAs, run CreateLicas.cs." + + " To determine which line items exist, run GetAllLineItem.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ActivateLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201308.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create Statement text to select approved line items from a given order. + string statementText = "WHERE orderId = :orderId and status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("orderId", orderId). + AddValue("status", ComputedStatus.NEEDS_CREATIVES.ToString()).ToStatement(); + + // Set defaults for page and offset. + LineItemPage page = new LineItemPage(); + int offset = 0; + int i = 0; + List lineItemIds = new List(); + + try { + do { + // Create a Statement to page through approved line items. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get line items by Statement. + page = lineItemService.getLineItemsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + foreach (LineItemSummary lineItem in page.results) { + // Archived line items cannot be activated. + if (!lineItem.isArchived) { + Console.WriteLine("{0}) Line item with ID ='{1}', belonging to order ID ='{2}' " + + "and name ='{2}' will be activated.", i, lineItem.id, lineItem.orderId, + lineItem.name); + lineItemIds.Add(lineItem.id.ToString()); + i++; + } + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of line items to be activated: {0}", lineItemIds.Count); + + if (lineItemIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", lineItemIds.ToArray()))). + ToStatement(); + + // Create action. + ActivateLineItems action = new ActivateLineItems(); + + // Perform action. + UpdateResult result = lineItemService.performLineItemAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of line items activated: {0}", result.numChanges); + } else { + Console.WriteLine("No line items were activated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to activate line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LineItemService/CreateLineItems.cs b/examples/Dfp/CSharp/v201308/LineItemService/CreateLineItems.cs new file mode 100644 index 00000000000..5254feb0ca3 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LineItemService/CreateLineItems.cs @@ -0,0 +1,217 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates new line items. To determine which line items + /// exist, run GetAllLineItems.cs. To determine which orders exist, run + /// GetAllOrders.cs. To determine which placements exist, run + /// GetAllPlacements.cs. To determine the IDs for locations, run + /// GetAllCities.cs, GetAllCountries.cs, GetAllMetros.cs, GetAllRegions.cs and + /// GetAllPostalCodes. + /// + /// Tags: LineItemService.createLineItems + /// + class CreateLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new line items. To determine which line items " + + "exist, run GetAllLineItems.cs. To determine which orders exist, run GetAllOrders.cs" + + ". To determine which placements exist, run GetAllPlacements.cs. To determine the " + + "IDs for locations, run GetAllCities.cs, GetAllCountries.cs, GetAllMetros.cs, " + + "GetAllRegions.cs and GetAllPostalCodes."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code examples. + /// + /// The DFP user object running the code examples. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201308.LineItemService); + + // Set the order that all created line items will belong to and the + // placement ID to target. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + long[] targetPlacementIds = new long[] {long.Parse(_T("INSERT_PLACEMENT_ID_HERE"))}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = targetPlacementIds; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + PostalCodeLocation postalCodeLocation = new PostalCodeLocation(); + postalCodeLocation.id = 9000093; + postalCodeLocation.postalCode = "B3P"; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201308.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201308.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + // Create an array to store local line item objects. + LineItem[] lineItems = new LineItem[5]; + + for (int i = 0; i < 5; i++) { + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + i; + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + lineItems[i] = lineItem; + } + + try { + // Create the line items on the server. + lineItems = lineItemService.createLineItems(lineItems); + + if (lineItems != null) { + foreach (LineItem lineItem in lineItems) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and" + + " named \"{2}\" was created.", lineItem.id, lineItem.orderId, lineItem.name); + } + } else { + Console.WriteLine("No line items created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LineItemService/CreateMobileLineItem.cs b/examples/Dfp/CSharp/v201308/LineItemService/CreateMobileLineItem.cs new file mode 100644 index 00000000000..25ebbccb218 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LineItemService/CreateMobileLineItem.cs @@ -0,0 +1,172 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates a new line item to serve to the mobile platform. + /// Mobile features needs to be enabled in your account to use mobile + /// targeting. To determine which line items exist, run GetAllLineItems.cs. To + /// determine which orders exist, run GetAllOrders.cs. To determine + /// which placements exist, run GetAllPlacements.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.performLineItemAction + /// + class CreateMobileLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new line item to serve to the mobile platform. Mobile" + + " features needs to be enabled in your account to use mobile targeting. To determine " + + "which line items exist, run GetAllLineItems.cs. To determine which orders exist, " + + "run GetAllOrders.cs. To determine which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateMobileLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201308.LineItemService); + + // Set the order that all created line items will belong to and the + // placement containing ad units with a mobile target platform. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + long[] targetedPlacementIds = new long[] {long.Parse(_T("INSERT_MOBILE_PLACEMENT_ID_HERE"))}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = targetedPlacementIds; + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create device manufacturer targeting. + DeviceManufacturerTargeting deviceManufacturerTargeting = new DeviceManufacturerTargeting(); + deviceManufacturerTargeting.isTargeted = true; + + // Target the Google device manufacturer (40100). + Technology deviceManufacturerTechnology = new Technology(); + deviceManufacturerTechnology.id = 40100L; + deviceManufacturerTargeting.deviceManufacturers = + new Technology[] {deviceManufacturerTechnology}; + technologyTargeting.deviceManufacturerTargeting = deviceManufacturerTargeting; + + // Create mobile device targeting. + MobileDeviceTargeting mobileDeviceTargeting = new MobileDeviceTargeting(); + + // Exclude the Nexus One device (604046). + Technology mobileDeviceTechnology = new Technology(); + mobileDeviceTechnology.id = 604046L; + mobileDeviceTargeting.targetedMobileDevices = new Technology[] {mobileDeviceTechnology}; + technologyTargeting.mobileDeviceTargeting = mobileDeviceTargeting; + + // Create mobile device submodel targeting. + MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargeting = + new MobileDeviceSubmodelTargeting(); + + // Target the iPhone 4 device submodel (640003). + Technology mobileDeviceSubmodelTechnology = new Technology(); + mobileDeviceSubmodelTechnology.id = 640003L; + mobileDeviceSubmodelTargeting.targetedMobileDeviceSubmodels = + new Technology[] {mobileDeviceSubmodelTechnology}; + technologyTargeting.mobileDeviceSubmodelTargeting = mobileDeviceSubmodelTargeting; + + // Create targeting. + Targeting targeting = new Targeting(); + targeting.inventoryTargeting = inventoryTargeting; + targeting.technologyTargeting = technologyTargeting; + + // Create local line item object. + LineItem lineItem = new LineItem(); + lineItem.name = "Mobile line item"; + lineItem.orderId = orderId; + lineItem.targeting = targeting; + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the target platform to mobile. + lineItem.targetPlatform = TargetPlatform.MOBILE; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + creativePlaceholder.size = size; + + // Set the size of creatives that can be associated with this line item. + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromString("20120901 00:00:00"); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + Money money = new Money(); + money.currencyCode = "USD"; + money.microAmount = 2000000L; + lineItem.costPerUnit = money; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + try { + // Create the line item on the server. + lineItem = lineItemService.createLineItem(lineItem); + + if (lineItem != null) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and " + + "named \"{2}\" was created.", lineItem.id, lineItem.orderId, lineItem.name); + } else { + Console.WriteLine("No line item created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LineItemService/CreateVideoLineItem.cs b/examples/Dfp/CSharp/v201308/LineItemService/CreateVideoLineItem.cs new file mode 100644 index 00000000000..94518f27c91 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LineItemService/CreateVideoLineItem.cs @@ -0,0 +1,187 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates a new line item to serve to video content. To + /// determine which line items exist, run GetAllLineItems.cs. To determine + /// which orders exist, run GetAllOrders.cs. To create a video ad unit, run + /// CreateVideoAdUnit.cs. To create criteria for categories, run + /// CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: LineItemService.createLineItem + /// + class CreateVideoLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new line item to serve to video content. To determine" + + " which line items exist, run GetAllLineItems.cs. To determine which orders exist, " + + "run GetAllOrders.cs. To create a video ad unit, run CreateVideoAdUnit.cs. To " + + "create criteria for categories, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateVideoLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201308.LineItemService); + + // Set the order that all created line items will belong to and the + // video ad unit ID to target. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + string targetedVideoAdUnitId = _T("INSERT_TARGETED_VIDEO_AD_UNIT_ID_HERE"); + + // Set the custom targeting key ID and value ID representing the metadata + // on the content to target. This would typically be a key representing + // a "genre" and a value representing something like "comedy". + long contentCustomTargetingKeyId = + long.Parse(_T("INSERT_CONTENT_CUSTOM_TARGETING_KEY_ID_HERE")); + long contentCustomTargetingValueId = + long.Parse(_T("INSERT_CONTENT_CUSTOM_TARGETING_VALUE_ID_HERE")); + + // Create custom criteria for the content metadata targeting. + CustomCriteria contentCustomCriteria = new CustomCriteria(); + contentCustomCriteria.keyId = contentCustomTargetingKeyId; + contentCustomCriteria.valueIds = new long[] {contentCustomTargetingValueId}; + contentCustomCriteria.@operator = CustomCriteriaComparisonOperator.IS; + + // Create custom criteria set. + CustomCriteriaSet customCriteriaSet = new CustomCriteriaSet(); + customCriteriaSet.children = new CustomCriteriaNode[] {contentCustomCriteria}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + AdUnitTargeting adUnitTargeting = new AdUnitTargeting(); + adUnitTargeting.adUnitId = targetedVideoAdUnitId; + adUnitTargeting.includeDescendants = true; + inventoryTargeting.targetedAdUnits = new AdUnitTargeting[] {adUnitTargeting}; + + // Create video position targeting. + VideoPosition videoPosition = new VideoPosition(); + videoPosition.positionType = VideoPositionType.PREROLL; + VideoPositionTarget videoPositionTarget = new VideoPositionTarget(); + videoPositionTarget.videoPosition = videoPosition; + VideoPositionTargeting videoPositionTargeting = new VideoPositionTargeting(); + videoPositionTargeting.targetedPositions = new VideoPositionTarget[] {videoPositionTarget}; + + // Create targeting. + Targeting targeting = new Targeting(); + targeting.customTargeting = customCriteriaSet; + targeting.inventoryTargeting = inventoryTargeting; + targeting.videoPositionTargeting = videoPositionTargeting; + + // Create local line item object. + LineItem lineItem = new LineItem(); + lineItem.name = "Video line item - " + this.GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = targeting; + lineItem.lineItemType = LineItemType.SPONSORSHIP; + lineItem.allowOverbook = true; + + // Set the environment type to video. + lineItem.environmentType = EnvironmentType.VIDEO_PLAYER; + + // Set the creative rotation type to optimized. + lineItem.creativeRotationType = CreativeRotationType.OPTIMIZED; + + // Create the master creative placeholder. + CreativePlaceholder creativeMasterPlaceholder = new CreativePlaceholder(); + Size size1 = new Size(); + size1.width = 400; + size1.height = 300; + size1.isAspectRatio = false; + creativeMasterPlaceholder.size = size1; + + // Create companion creative placeholders. + CreativePlaceholder companionCreativePlaceholder1 = new CreativePlaceholder(); + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + size2.isAspectRatio = false; + companionCreativePlaceholder1.size = size2; + + CreativePlaceholder companionCreativePlaceholder2 = new CreativePlaceholder(); + Size size3 = new Size(); + size3.width = 728; + size3.height = 90; + size3.isAspectRatio = false; + companionCreativePlaceholder2.size = size3; + + // Set companion creative placeholders. + creativeMasterPlaceholder.companions = new CreativePlaceholder[] { + companionCreativePlaceholder1, companionCreativePlaceholder2}; + + // Set the size of creatives that can be associated with this line item. + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativeMasterPlaceholder}; + + // Set delivery of video companions to optional. + lineItem.companionDeliveryOption = CompanionDeliveryOption.OPTIONAL; + + // Set the length of the line item to run. + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromString("20120901 00:00:00"); + + // Set the cost per day to $1. + lineItem.costType = CostType.CPD; + Money money = new Money(); + money.currencyCode = "USD"; + money.microAmount = 1000000L; + lineItem.costPerUnit = money; + + // Set the percentage to be 100%. + lineItem.unitsBought = 100; + + try { + // Create the line item on the server. + lineItem = lineItemService.createLineItem(lineItem); + + if (lineItem != null) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and " + + "named \"{2}\" was created.", lineItem.id, lineItem.orderId, lineItem.name); + } else { + Console.WriteLine("No line item created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LineItemService/GetAllLineItems.cs b/examples/Dfp/CSharp/v201308/LineItemService/GetAllLineItems.cs new file mode 100644 index 00000000000..ed521155dbb --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LineItemService/GetAllLineItems.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all line items. To create line items, run + /// CreateLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// + class GetAllLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items. To create line items, run " + + "CreateLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201308.LineItemService); + + // Sets defaults for page and Statement. + LineItemPage page = new LineItemPage(); + Statement statement = new Statement(); + int offset = 0; + try { + do { + // Create a Statement to get all line items. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get line items by Statement. + page = lineItemService.getLineItemsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemSummary lineItem in page.results) { + Console.WriteLine("{0}) Line item with ID = '{1}', belonging to order ID ='{2}'" + + " , and named '{3}' was found.", i, lineItem.id, lineItem.orderId, + lineItem.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LineItemService/GetLineItem.cs b/examples/Dfp/CSharp/v201308/LineItemService/GetLineItem.cs new file mode 100644 index 00000000000..2dac4dff730 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LineItemService/GetLineItem.cs @@ -0,0 +1,78 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets a line item by its ID. To determine which line + /// items exist, run GetAllLineItems.cs. + /// + /// Tags: LineItemService.getLineItem + /// + class GetLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a line item by its ID. To determine which line items " + + "exist, run GetAllLineItems.cs"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201308.LineItemService); + + // Set the ID of the line item to get. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get the line item. + LineItem lineItem = lineItemService.getLineItem(lineItemId); + + if (lineItem != null) { + Console.WriteLine("Line item with ID ='{0}', belonging to order ID ='{1}', and named " + + "'{2}' was found.", lineItem.id, lineItem.orderId, lineItem.name); + } else { + Console.WriteLine("No line item found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get line item by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LineItemService/GetLineItemsByStatement.cs b/examples/Dfp/CSharp/v201308/LineItemService/GetLineItemsByStatement.cs new file mode 100644 index 00000000000..4e78ac35f55 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LineItemService/GetLineItemsByStatement.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all line items for the given order. The Statement + /// retrieves up to the maximum page size limit of 500. To create line items, + /// run CreateLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// + class GetLineItemsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items for the given order. The Statement " + + "retrieves up to the maximum page size limit of 500. To create line items, " + + "run CreateLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLineItemsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201308.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create a statement to only select line items that need creatives from a + // given order. + Statement filterStatement = + new StatementBuilder("WHERE orderId = :orderId AND status = :status LIMIT 500") + .AddValue("orderId", orderId) + .AddValue("status", ComputedStatus.NEEDS_CREATIVES.ToString()) + .ToStatement(); + + try { + // Get line items by Statement. + LineItemPage page = lineItemService.getLineItemsByStatement(filterStatement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItem lineItem in page.results) { + Console.WriteLine("{0}) Line item with ID ='{1}', belonging to order ID = '{2}' and " + + "named '{3}' was found.", i, lineItem.id, lineItem.orderId, lineItem.name); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get line item by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LineItemService/GetRecentlyUpdatedLineItems.cs b/examples/Dfp/CSharp/v201308/LineItemService/GetRecentlyUpdatedLineItems.cs new file mode 100644 index 00000000000..511367b9d7c --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LineItemService/GetRecentlyUpdatedLineItems.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; +using Google.Api.Ads.Dfp.Util.v201308; + +using System; + +using DateTime = Google.Api.Ads.Dfp.v201308.DateTime; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example shows how to get recently updated line items. To create + /// line items, run CreateLineItems.cs. + /// + /// Tags: LineItemService.GetRecentlyUpdatedLineItems + /// + class GetRecentlyUpdatedLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a line item by its ID. To determine which line items " + + "exist, run GetAllLineItems.cs"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetRecentlyUpdatedLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201308.LineItemService); + + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + try { + // Create statement to only select line items for the given order that + // have been modified in the last 3 days. + DateTime threeDaysAgo = DateTimeUtilities.FromDateTime(System.DateTime.Now.AddDays(-3)); + Statement filterStatement = new StatementBuilder( + "WHERE lastModifiedDateTime >= :lastModifiedDateTime AND orderId = :orderId LIMIT 500"). + AddValue("lastModifiedDateTime", threeDaysAgo). + AddValue("orderId", orderId).ToStatement(); + + + // Get line items by statement. + LineItemPage page = lineItemService.getLineItemsByStatement(filterStatement); + + // Display results. + if (page != null && page.results != null) { + foreach (LineItem lineItem in page.results) { + Console.WriteLine("Line item with id \"{0}\", belonging to order id \"{1}\" and " + + "named \"{2}\" was found.", lineItem.id, lineItem.orderId, lineItem.name); + } + Console.WriteLine("Number of results found: {1}.", page.totalResultSetSize); + } else { + Console.WriteLine("No line items were found."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LineItemService/TargetCustomCriteria.cs b/examples/Dfp/CSharp/v201308/LineItemService/TargetCustomCriteria.cs new file mode 100644 index 00000000000..fa94d769ff9 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LineItemService/TargetCustomCriteria.cs @@ -0,0 +1,167 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example updates a line item to add custom criteria targeting. To + /// determine which line items exist, run GetAllLineItems.cs. To determine + /// which custom targeting keys and values exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: LineItemService.getLineItem, LineItemService.updateLineItem + /// + class TargetCustomCriteria : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a line item to add custom criteria targeting. To " + + "determine which line items exist, run GetAllLineItems.cs. To determine which custom " + + "targeting keys and values exist, run GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new TargetCustomCriteria(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201308.LineItemService); + + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = (CustomTargetingService) user.GetService( + DfpService.v201308.CustomTargetingService); + + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long[] customCriteriaIds1 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + long[] customCriteriaIds2 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + long[] customCriteriaIds3 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + + // Create custom criteria. + CustomCriteria customCriteria1 = new CustomCriteria(); + customCriteria1.keyId = customCriteriaIds1[0]; + customCriteria1.valueIds = new long[] {customCriteriaIds1[1]}; + customCriteria1.@operator = CustomCriteriaComparisonOperator.IS; + + CustomCriteria customCriteria2 = new CustomCriteria(); + customCriteria2.keyId = customCriteriaIds2[0]; + customCriteria2.valueIds = new long[] {customCriteriaIds2[1]}; + customCriteria2.@operator = CustomCriteriaComparisonOperator.IS_NOT; + + CustomCriteria customCriteria3 = new CustomCriteria(); + customCriteria3.keyId = customCriteriaIds3[0]; + customCriteria3.valueIds = new long[] {customCriteriaIds3[1]}; + customCriteria3.@operator = CustomCriteriaComparisonOperator.IS; + + // Create the custom criteria set that will resemble: + // + // (customCriteria1.key == customCriteria1.value OR + // (customCriteria2.key != customCriteria2.value AND + // customCriteria3.key == customCriteria3.value)) + CustomCriteriaSet topCustomCriteriaSet = new CustomCriteriaSet(); + topCustomCriteriaSet.logicalOperator = CustomCriteriaSetLogicalOperator.OR; + + CustomCriteriaSet subCustomCriteriaSet = new CustomCriteriaSet(); + subCustomCriteriaSet.logicalOperator = CustomCriteriaSetLogicalOperator.AND; + subCustomCriteriaSet.children = + new CustomCriteriaNode[] {customCriteria2, customCriteria3}; + topCustomCriteriaSet.children = + new CustomCriteriaNode[] {customCriteria1, subCustomCriteriaSet}; + + try { + // Set the custom criteria targeting on the line item. + LineItem lineItem = lineItemService.getLineItem(lineItemId); + lineItem.targeting.customTargeting = topCustomCriteriaSet; + + // Update the line items on the server. + lineItem = lineItemService.updateLineItem(lineItem); + + // Display the updated line item. + Console.WriteLine("Line item with ID {0} updated with custom criteria targeting \n{1}\n", + lineItem.id, getCustomCriteriaSetString(lineItem.targeting.customTargeting, 0)); + } catch (Exception ex) { + Console.WriteLine("Failed to add custom target criteria. Exception says \"{0}\"", + ex.Message); + } + } + + /// + /// Gets a string representation of the custom criteria node. If it has + /// children, each child will be appended to the string recursively. + /// + /// The root custom criteria node. + /// The level of the custom criteria tree. + /// + /// A string representation of the custom criteria node and its + /// children + /// + private static string getCustomCriteriaSetString(CustomCriteriaNode root, int level) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < level; i++) { + sb.Append("\t"); + } + + if (root is CustomCriteria) { + CustomCriteria customCriteria = (CustomCriteria) root; + StringBuilder ids = new StringBuilder(); + for (int j = 0; j < customCriteria.valueIds.Length; j++) { + ids.Append(customCriteria.valueIds[j] + ", "); + } + + sb.AppendFormat("Custom criteria: operator: [{0}] key: [{1}] values: [{2}]\n", + customCriteria.@operator, customCriteria.keyId, ids.ToString().TrimEnd(',', ' ')); + return sb.ToString(); + } else if (root is CustomCriteriaSet) { + CustomCriteriaSet customCriteriaSet = (CustomCriteriaSet) root; + sb.AppendFormat("Custom criteria set: operator: [{0}] children: \n", + customCriteriaSet.logicalOperator); + foreach (CustomCriteriaNode node in customCriteriaSet.children) { + sb.Append(getCustomCriteriaSetString(node, level + 1)); + } + return sb.Append("\n").ToString(); + } else { + throw new Exception("Unexpected node: " + root.CustomCriteriaNodeType); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/LineItemService/UpdateLineItems.cs b/examples/Dfp/CSharp/v201308/LineItemService/UpdateLineItems.cs new file mode 100644 index 00000000000..910d3399830 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/LineItemService/UpdateLineItems.cs @@ -0,0 +1,108 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example updates the delivery rate of all line items up to the + /// first 500. To determine which line items exist, run GetAllLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.updateLineItems + /// + class UpdateLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the delivery rate of all line items up to the first " + + "500. To determine which line items exist, run GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201308.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create a Statement to get line items with even delivery rates. + Statement statement = new StatementBuilder("WHERE deliveryRateType = :deliveryRateType and " + + "orderId = :orderId LIMIT 500").AddValue("deliveryRateType", + DeliveryRateType.EVENLY.ToString()).AddValue("orderId", orderId).ToStatement(); + + try { + // Get line items by Statement. + LineItemPage page = lineItemService.getLineItemsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + LineItem[] lineItems = page.results; + List lineItemsToUpdate = new List(); + + // Update each local line item object by changing its delivery rate. + foreach (LineItem lineItem in lineItems) { + // Archived line items cannot be updated. + if (!lineItem.isArchived) { + lineItem.deliveryRateType = DeliveryRateType.AS_FAST_AS_POSSIBLE; + lineItemsToUpdate.Add(lineItem); + } + } + + // Update the line items on the server. + lineItems = lineItemService.updateLineItems(lineItemsToUpdate.ToArray()); + + if (lineItems != null) { + foreach (LineItem lineItem in lineItems) { + Console.WriteLine("A line item with ID = '{0}', belonging to order ID = '{1}', " + + "named '{2}', and having delivery rate = '{3}' was updated.", + lineItem.id, lineItem.orderId, lineItem.name, lineItem.deliveryRateType); + } + } else { + Console.WriteLine("No line items updated."); + } + } else { + Console.WriteLine("No line items found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/NetworkService/GetAllNetworks.cs b/examples/Dfp/CSharp/v201308/NetworkService/GetAllNetworks.cs new file mode 100644 index 00000000000..610a7b01bf3 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/NetworkService/GetAllNetworks.cs @@ -0,0 +1,81 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all networks that you have access to with the + /// current login credentials. A networkCode should be left out for this + /// request. + /// + /// Tags: NetworkService.getAllNetworks + /// + class GetAllNetworks : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all networks that you have access to with the current " + + "login credentials. A networkCode should be left out for this request."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllNetworks(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201308.NetworkService); + // Set the networkCode field to null to retrieve all networks you have + // access to. + networkService.RequestHeader.networkCode = null; + + try { + // Get all networks that you have access to with the current login + // credentials. + Network[] networks = networkService.getAllNetworks(); + + int i = 0; + foreach (Network network in networks) { + Console.WriteLine("{0} ) Network with network code \"{1}\" and display name \"{2}\" " + + "was found.", i + 1, network.networkCode, network.displayName); + i++; + } + Console.WriteLine("Number of networks found: {0}", i); + } catch (Exception ex) { + Console.WriteLine("Failed to get all networks. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/NetworkService/GetCurrentNetwork.cs b/examples/Dfp/CSharp/v201308/NetworkService/GetCurrentNetwork.cs new file mode 100644 index 00000000000..3dc98b5300b --- /dev/null +++ b/examples/Dfp/CSharp/v201308/NetworkService/GetCurrentNetwork.cs @@ -0,0 +1,70 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets the current network that you can make requests + /// against. + /// + /// Tags: NetworkService.getCurrentNetwork + /// + class GetCurrentNetwork : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the current network that you can make requests against."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCurrentNetwork(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201308.NetworkService); + + try { + // Get the current network. + Network network = networkService.getCurrentNetwork(); + + Console.WriteLine("Current network has network code \"{0}\" and display name \"{1}\".", + network.networkCode, network.displayName); + } catch (Exception ex) { + Console.WriteLine("Failed to get current network. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/NetworkService/MakeTestNetwork.cs b/examples/Dfp/CSharp/v201308/NetworkService/MakeTestNetwork.cs new file mode 100644 index 00000000000..62ec62028f5 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/NetworkService/MakeTestNetwork.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates a test network. You do not need to have a DFP + /// account to run this example, but you do need to have a new Google account + /// (created at http://www.google.com/accounts/newaccount) that is not + /// associated with any other DFP networks (including old sandbox networks). + /// Once this network is created, you can supply the network code in your + /// settings to make calls to other services. + /// + /// Please see the following URL for more information: + /// https://developers.google.com/doubleclick-publishers/docs/signup + /// + /// Tags: NetworkService.makeTestNetwork + /// + class MakeTestNetwork : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a test network. You do not need to have a DFP" + + " account to run this example, but you do need to have a new Google account" + + " (created at http://www.google.com/accounts/newaccount) that is not associated " + + "with any other DFP networks (including old sandbox networks). Once this network " + + "is created, you can supply the network code in your settings to make calls to " + + "other services.\n\n Please see the following URL for more information:" + + " https://developers.google.com/doubleclick-publishers/docs/signup"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new MakeTestNetwork(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201308.NetworkService); + // Set the networkCode field to null. + networkService.RequestHeader.networkCode = null; + + try { + Network network = networkService.makeTestNetwork(); + + Console.WriteLine("Test network with network code \"{0}\" and display name \"{1}\" " + + "created.\nYou may now sign in at http://www.google.com/dfp/main?networkCode={0}", + network.networkCode, network.displayName); + } catch (Exception ex) { + Console.WriteLine("Failed to make test network. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/OrderService/ApproveOrder.cs b/examples/Dfp/CSharp/v201308/OrderService/ApproveOrder.cs new file mode 100644 index 00000000000..e3b3361c904 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/OrderService/ApproveOrder.cs @@ -0,0 +1,121 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example approves and overbooks all eligible draft and pending + /// orders. To determine which orders exist, run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement, OrderService.performOrderAction + /// + class ApproveOrder : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example approves and overbooks all draft orders. To determine which " + + "orders exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ApproveOrder(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = + (OrderService) user.GetService(DfpService.v201308.OrderService); + + // Create Statement text to select all draft orders. + string statementText = "WHERE status IN (:status1, :status2) and endDateTime >= :today " + + "AND isArchived = FALSE LIMIT 500"; + Statement statement = new StatementBuilder(""). + AddValue("status1", OrderStatus.DRAFT.ToString()). + AddValue("status2", OrderStatus.PENDING_APPROVAL.ToString()). + AddValue("today", System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss")).ToStatement(); + + // Set defaults for page and offset. + OrderPage page = new OrderPage(); + int i = 0; + int offset = 0; + List orderIds = new List(); + + try { + do { + // Create a Statement to page through draft orders. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + // Get orders by Statement. + page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and status ='{3}' " + + "will be approved.", i, order.id, order.name, order.status); + orderIds.Add(order.id.ToString()); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of orders to be approved: {0}", orderIds.Count); + + if (orderIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", orderIds.ToArray()))). + ToStatement(); + + // Create action. + ApproveAndOverbookOrders action = new ApproveAndOverbookOrders(); + + // Perform action. + UpdateResult result = orderService.performOrderAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of orders approved: {0}", result.numChanges); + } else { + Console.WriteLine("No orders were approved."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to approve orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/OrderService/CreateOrders.cs b/examples/Dfp/CSharp/v201308/OrderService/CreateOrders.cs new file mode 100644 index 00000000000..f607a4ad959 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/OrderService/CreateOrders.cs @@ -0,0 +1,96 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates new orders. To determine which orders exist, + /// run GetAllOrders.cs. + /// + /// Tags: OrderService.createOrders + /// + class CreateOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new orders. To determine which orders exist, " + + "run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = + (OrderService) user.GetService(DfpService.v201308.OrderService); + + // Set the advertiser, salesperson, and trafficker to assign to each + // order. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + long salespersonId = long.Parse(_T("INSERT_SALESPERSON_ID_HERE")); + long traffickerId = long.Parse(_T("INSERT_TRAFFICKER_ID_HERE")); + + // Create an array to store local order objects. + Order[] orders = new Order[5]; + + for (int i = 0; i < 5; i++) { + Order order = new Order(); + order.name = string.Format("Order #{0}", i); + order.advertiserId = advertiserId; + order.salespersonId = salespersonId; + order.traffickerId = traffickerId; + + orders[i] = order; + } + + try { + // Create the orders on the server. + orders = orderService.createOrders(orders); + + if (orders != null) { + foreach (Order order in orders) { + Console.WriteLine("An order with ID ='{0}' and named '{1}' was created.", + order.id, order.name); + } + } else { + Console.WriteLine("No orders created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/OrderService/GetAllOrders.cs b/examples/Dfp/CSharp/v201308/OrderService/GetAllOrders.cs new file mode 100644 index 00000000000..0d51c781063 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/OrderService/GetAllOrders.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all orders. To create orders, run CreateOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement + /// + class GetAllOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets all orders. To create orders, run CreateOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201308.OrderService); + + // Sets defaults for page and Statement. + OrderPage page = new OrderPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all orders. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get orders by Statement. + page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and advertiser " + + "ID = '{3}' was found.", i, order.id, order.name, order.advertiserId); + i++; + } + } + + offset += 500; + } while (page.results != null && page.results.Length == 500); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/OrderService/GetOrder.cs b/examples/Dfp/CSharp/v201308/OrderService/GetOrder.cs new file mode 100644 index 00000000000..a0e4f67a132 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/OrderService/GetOrder.cs @@ -0,0 +1,75 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets an order by its ID. To determine which orders + /// exist, run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrder + /// + class GetOrder : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets an order by its ID. To determine which orders " + + "exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + new GetOrder().Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201308.OrderService); + + // Set the ID of the order to get. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + try { + // Get the order. + Order order = orderService.getOrder(orderId); + + if (order != null) { + Console.WriteLine("An order with ID = {0}', name = '{1}', and advertiser ID = '{2}' " + + " was found.", order.id, order.name, order.advertiserId); + } else { + Console.WriteLine("No order found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get orders by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/OrderService/GetOrdersByStatement.cs b/examples/Dfp/CSharp/v201308/OrderService/GetOrdersByStatement.cs new file mode 100644 index 00000000000..600019080a6 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/OrderService/GetOrdersByStatement.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all orders for a given advertiser. The Statement + /// retrieves up to the maximum page size limit of 500. To create orders, run + /// CreateOrders.cs. To determine which companies are advertisers, + /// run GetCompaniesByStatement.cs. + /// + /// Tags: OrderService.getOrdersByStatement + /// + class GetOrdersByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all orders for a given advertiser. The Statement " + + "retrieves up to the maximum page size limit of 500. To create orders, run " + + "CreateOrders.cs. To determine which companies are advertisers,run " + + "GetCompaniesByStatement.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetOrdersByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201308.OrderService); + + // Set the name of the advertiser (company) to get orders for. + String advertiserId = _T("INSERT_ADVERTISER_COMPANY_ID_HERE"); + + // Create a Statement to only select orders for a given advertiser. + Statement statement = new StatementBuilder("WHERE advertiserId = :advertiserId LIMIT 500"). + AddValue("advertiserId", advertiserId).ToStatement(); + + try { + // Get orders by Statement. + OrderPage page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and advertiser " + + "ID = '{3}' was found.", i, order.id, order.name, order.advertiserId); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get orders by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/OrderService/UpdateOrders.cs b/examples/Dfp/CSharp/v201308/OrderService/UpdateOrders.cs new file mode 100644 index 00000000000..8ef986d0ae3 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/OrderService/UpdateOrders.cs @@ -0,0 +1,100 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example updates the notes of each order up to the first 500. + /// To determine which orders exist, run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement, OrderService.updateOrders + /// + class UpdateOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the notes of each order up to the first 500. " + + "To determine which orders exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201308.OrderService); + + // Create a Statement to get all orders. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get orders by Statement. + OrderPage page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + Order[] orders = page.results; + List ordersToUpdate = new List(); + + // Update each local order object by changing its notes. + foreach (Order order in orders) { + if (!order.isArchived) { + order.notes = "Spoke to advertiser. All is well."; + ordersToUpdate.Add(order); + } + } + + // Update the orders on the server. + orders = orderService.updateOrders(ordersToUpdate.ToArray()); + + if (orders != null) { + foreach (Order order in orders) { + Console.WriteLine("Order with ID = '{0}', name = '{1}', advertiser ID = '{2}', " + + "and notes = '{3}' was updated.", order.id, order.name, order.advertiserId, + order.notes); + } + } else { + Console.WriteLine("No orders updated."); + } + } else { + Console.WriteLine("No orders found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/PlacementService/CreatePlacements.cs b/examples/Dfp/CSharp/v201308/PlacementService/CreatePlacements.cs new file mode 100644 index 00000000000..af2819ffca0 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/PlacementService/CreatePlacements.cs @@ -0,0 +1,164 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates new placements for various ad unit sizes. To + /// determine which placements exist, run GetAllPlacements.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: PlacementService.createPlacements + /// + class CreatePlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new placements for various ad unit sizes. To determine " + + "which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreatePlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201308.InventoryService); + + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201308.PlacementService); + + // Create local placement object to store skyscraper ad units. + Placement skyscraperAdUnitPlacement = new Placement(); + skyscraperAdUnitPlacement.name = string.Format("Skyscraper AdUnit Placement #{0}", + this.GetTimeStamp()); + skyscraperAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 120x600"; + + // Create local placement object to store medium square ad units. + Placement mediumSquareAdUnitPlacement = new Placement(); + mediumSquareAdUnitPlacement.name = string.Format("Medium Square AdUnit Placement #{0}", + this.GetTimeStamp()); + mediumSquareAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 300x250"; + + // Create local placement object to store banner ad units. + Placement bannerAdUnitPlacement = new Placement(); + bannerAdUnitPlacement.name = string.Format("Banner AdUnit Placement #{0}", + this.GetTimeStamp()); + bannerAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 468x60"; + + List placementList = new List(); + + // Get the first 500 ad units. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + List mediumSquareTargetedUnitIds = new List(); + List skyscraperTargetedUnitIds = new List(); + List bannerTargetedUnitIds = new List(); + + try { + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + // Separate the ad units by size. + if (page.results != null) { + foreach (AdUnit adUnit in page.results) { + if (adUnit.parentId != null && adUnit.adUnitSizes != null) { + foreach (AdUnitSize adUnitSize in adUnit.adUnitSizes) { + Size size = adUnitSize.size; + if (size.width == 300 && size.height == 250) { + if (!mediumSquareTargetedUnitIds.Contains(adUnit.id)) { + mediumSquareTargetedUnitIds.Add(adUnit.id); + } + } else if (size.width == 120 && size.height == 600) { + if (!skyscraperTargetedUnitIds.Contains(adUnit.id)) { + skyscraperTargetedUnitIds.Add(adUnit.id); + } + } else if (size.width == 468 && size.height == 60) { + if (!bannerTargetedUnitIds.Contains(adUnit.id)) { + bannerTargetedUnitIds.Add(adUnit.id); + } + } + } + } + } + } + mediumSquareAdUnitPlacement.targetedAdUnitIds = mediumSquareTargetedUnitIds.ToArray(); + skyscraperAdUnitPlacement.targetedAdUnitIds = skyscraperTargetedUnitIds.ToArray(); + bannerAdUnitPlacement.targetedAdUnitIds = bannerTargetedUnitIds.ToArray(); + + + // Only create placements with one or more ad unit. + if (mediumSquareAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(mediumSquareAdUnitPlacement); + } + + if (skyscraperAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(skyscraperAdUnitPlacement); + } + + if (bannerAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(bannerAdUnitPlacement); + } + + Placement[] placements = + placementService.createPlacements(placementList.ToArray()); + + // Display results. + if (placements != null) { + foreach (Placement placement in placements) { + Console.Write("A placement with ID = '{0}', name ='{1}', and containing " + + "ad units {{", placement.id, placement.name); + + foreach (string adUnitId in placement.targetedAdUnitIds) { + Console.Write("{0}, ", adUnitId); + } + Console.WriteLine("} was created."); + } + } else { + Console.WriteLine("No placements created."); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to create placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/PlacementService/DeactivatePlacement.cs b/examples/Dfp/CSharp/v201308/PlacementService/DeactivatePlacement.cs new file mode 100644 index 00000000000..3441743a051 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/PlacementService/DeactivatePlacement.cs @@ -0,0 +1,120 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example deactivates all active placements. To determine which + /// placements exist, run GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// Tags: PlacementService.performPlacementAction + /// + class DeactivatePlacement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active placements. To determine which " + + "placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivatePlacement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201308.PlacementService); + + // Create Statement text to select active placements. + String statementText = "WHERE status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("status", + InventoryStatus.ACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + PlacementPage page = new PlacementPage(); + int offset = 0; + List placementIds = new List(); + + try { + do { + // Create a Statement to page through active placements. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get placements by Statement. + page = placementService.getPlacementsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID ='{1}', name ='{2}', and status ='{3}'" + + " will be deactivated.", i, placement.id, placement.name, placement.status); + placementIds.Add(placement.id.ToString()); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of placements to be deactivated: {0}", placementIds.Count); + + if (placementIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", placementIds.ToArray()))). + ToStatement(); + + // Create action. + DeactivatePlacements action = new DeactivatePlacements(); + + // Perform action. + UpdateResult result = placementService.performPlacementAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of placements deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No placements were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/PlacementService/GetAllPlacements.cs b/examples/Dfp/CSharp/v201308/PlacementService/GetAllPlacements.cs new file mode 100644 index 00000000000..c06a94b3157 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/PlacementService/GetAllPlacements.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all placements. To create placements, run + /// CreatePlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// + class GetAllPlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all placements. To create placements, run " + + "CreatePlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllPlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201308.PlacementService); + + // Sets defaults for page and Statement. + PlacementPage page = new PlacementPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all ad units. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get ad units by Statement. + page = placementService.getPlacementsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID = '{1}' and name = '{2}' was found.", + i, placement.id, placement.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}" + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/PlacementService/GetPlacement.cs b/examples/Dfp/CSharp/v201308/PlacementService/GetPlacement.cs new file mode 100644 index 00000000000..9cebff6d34f --- /dev/null +++ b/examples/Dfp/CSharp/v201308/PlacementService/GetPlacement.cs @@ -0,0 +1,79 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets a placement by its ID. To determine which + /// placements exist, run GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacement + /// + class GetPlacement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a placement by its ID. To determine which placements " + + "exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPlacement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201308.PlacementService); + + // Set the ID of the placement to get. + long placementId = long.Parse(_T("INSERT_PLACEMENT_ID_HERE")); + + try { + // Get the placement. + Placement placement = placementService.getPlacement(placementId); + + if (placement != null) { + Console.WriteLine("Placement with ID = '{0}', name = '{1}', and status = '{2}' " + + "was found.", placement.id, placement.name, placement.status); + } else { + Console.WriteLine("No placement found for this ID."); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to get placement by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/PlacementService/GetPlacementsByStatement.cs b/examples/Dfp/CSharp/v201308/PlacementService/GetPlacementsByStatement.cs new file mode 100644 index 00000000000..67efb532f22 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/PlacementService/GetPlacementsByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all active placements by using a Statement. To + /// create a placement, run CreatePlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// + class GetPlacementsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active placements by using a Statement. To create a " + + "placement, run CreatePlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPlacementsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201308.PlacementService); + + // Create a Statement to only select active placements. + Statement statement = new StatementBuilder("WHERE status = :status LIMIT 500").AddValue( + "status", InventoryStatus.ACTIVE.ToString()).ToStatement(); + + try { + // Get placements by Statement. + PlacementPage page = placementService.getPlacementsByStatement(statement); + + // Display results. + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID = '{1}', name ='{2}', and status = '{3}' " + + "was found.", i, placement.id, placement.name, placement.status); + i++; + } + } + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get placement by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/PlacementService/UpdatePlacements.cs b/examples/Dfp/CSharp/v201308/PlacementService/UpdatePlacements.cs new file mode 100644 index 00000000000..31806e9fbdd --- /dev/null +++ b/examples/Dfp/CSharp/v201308/PlacementService/UpdatePlacements.cs @@ -0,0 +1,105 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example updates all placements to allow for AdSense targeting + /// up to the first 500. To determine which placements exist, run + /// GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// Tags: PlacementService.updatePlacements + /// + class UpdatePlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates all placements to allow for AdSense targeting up to " + + "the first 500. To determine which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdatePlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201308.PlacementService); + + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201308.InventoryService); + + // Create a statement to select first 500 placements. + Statement filterStatement = new Statement(); + filterStatement.query = "LIMIT 500"; + + try { + // Get placements by statement. + PlacementPage page = placementService.getPlacementsByStatement(filterStatement); + + if (page.results != null) { + Placement[] placements = page.results; + + // Update each local placement object by enabling AdSense targeting. + foreach (Placement placement in placements) { + placement.targetingDescription = (string.IsNullOrEmpty(placement.description))? + "Generic description" : placement.description; + placement.targetingAdLocation = "All images on sports pages."; + placement.targetingSiteName = "http://code.google.com"; + placement.isAdSenseTargetingEnabled = true; + } + + // Update the placements on the server. + placements = placementService.updatePlacements(placements); + + // Display results. + if (placements != null) { + foreach (Placement placement in placements) { + Console.WriteLine("A placement with ID \"{0}\", name \"{1}\", and AdSense targeting" + + " enabled \"{2}\" was updated.", placement.id, placement.name, + placement.isAdSenseTargetingEnabled); + } + } else { + Console.WriteLine("No placements updated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to update placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/PublisherQueryLanguageService/GetAllLineItemsUsingPql.cs b/examples/Dfp/CSharp/v201308/PublisherQueryLanguageService/GetAllLineItemsUsingPql.cs new file mode 100644 index 00000000000..06381bda56c --- /dev/null +++ b/examples/Dfp/CSharp/v201308/PublisherQueryLanguageService/GetAllLineItemsUsingPql.cs @@ -0,0 +1,109 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all line items in your network using the Line_Item + /// table. This code example may take a while to run. The Line_Item PQL table + /// schema can be found here: + /// https://developers.google.com/doubleclick-publishers/docs/reference/v201308/PublisherQueryLanguageService#Line_Item + /// + /// Tags: PublisherQueryLanguageService.select + /// + class GetAllLineItemsUsingPql : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items in your network using the Line_Item table. " + + "This code example may take a while to run. The Line_Item PQL table schema can be " + + "found here: https://developers.google.com/doubleclick-publishers/docs/reference/v201308/PublisherQueryLanguageService#Line_Item"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLineItemsUsingPql(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PublisherQueryLanguageService. + PublisherQueryLanguageService pqlService = + (PublisherQueryLanguageService) user.GetService( + DfpService.v201308.PublisherQueryLanguageService); + + int pageSize = 500; + // Create statement to select all line items. + String selectStatement = "SELECT Id, Name, Status FROM Line_Item LIMIT " + pageSize; + int offset = 0; + int resultSetSize = 0; + List allRows = new List(); + ResultSet resultSet; + + try { + do { + StatementBuilder statementBuilder = + new StatementBuilder(selectStatement + " OFFSET " + offset); + + // Get all line items. + resultSet = pqlService.select(statementBuilder.ToStatement()); + + // Collect all line items from each page. + allRows.AddRange(resultSet.rows); + + // Display results. + Console.WriteLine(PqlUtilities.ResultSetToString(resultSet)); + + offset += pageSize; + resultSetSize = resultSet.rows == null ? 0 : resultSet.rows.Length; + } while (resultSetSize == pageSize); + + Console.WriteLine("Number of results found: " + allRows.Count); + + // Optionally, save all rows to a CSV. + // Get a string array representation of the data rows. + resultSet.rows = allRows.ToArray(); + List rows = PqlUtilities.ResultSetToStringArrayList(resultSet); + + // Write the contents to a csv file. + CsvFile file = new CsvFile(); + file.Headers.AddRange(rows[0]); + file.Records.AddRange(rows.GetRange(1, rows.Count - 1).ToArray()); + file.Write("line_items_" + this.GetTimeStamp() + ".csv"); + } catch (Exception ex) { + Console.WriteLine("Failed to get all line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/PublisherQueryLanguageService/GetGeoTargets.cs b/examples/Dfp/CSharp/v201308/PublisherQueryLanguageService/GetGeoTargets.cs new file mode 100644 index 00000000000..c62e9738774 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/PublisherQueryLanguageService/GetGeoTargets.cs @@ -0,0 +1,119 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets geographic criteria from the Geo_Target table, + /// such as all cities available to target. Other types include 'Country', + /// 'Region', 'State', 'Postal_Code', and 'DMA_Region' (i.e. Metro). + /// A full list of available geo target types can be found at + /// https://developers.google.com/doubleclick-publishers/docs/reference/v201308/PublisherQueryLanguageService + /// + /// Tags: PublisherQueryLanguageService.select + /// + class GetGeoTargets : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets geographic criteria from the Geo_Target table, such as " + + "all cities available to target. Other types include 'Country', 'Region', 'State', " + + "'Postal_Code', and 'DMA_Region' (i.e. Metro). A full list of available geo target " + + "types can be found at https://developers.google.com/doubleclick-publishers/docs/reference/v201308/PublisherQueryLanguageService"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetGeoTargets(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PublisherQueryLanguageService. + PublisherQueryLanguageService pqlService = + (PublisherQueryLanguageService) user.GetService( + DfpService.v201308.PublisherQueryLanguageService); + + string geoType = "City"; + + int pageSize = 500; + // Create statement to select all targetable cities. + String selectStatement = "SELECT Id, Name, CanonicalParentId, ParentIds, CountryCode from " + + "Geo_Target where Type = :type and Targetable = true order by CountryCode ASC, " + + "Name ASC limit " + pageSize; + + Statement statement = new StatementBuilder(selectStatement).AddValue("type", geoType) + .ToStatement(); + + int offset = 0; + int resultSetSize = 0; + List allRows = new List(); + ResultSet resultSet; + + try { + do { + statement.query = selectStatement + " OFFSET " + offset; + + // Get all cities. + resultSet = pqlService.select(statement); + + // Collect all cities from each page. + allRows.AddRange(resultSet.rows); + + // Display results. + Console.WriteLine(PqlUtilities.ResultSetToString(resultSet)); + + offset += pageSize; + resultSetSize = resultSet.rows == null ? 0 : resultSet.rows.Length; + } while (resultSetSize == pageSize); + + Console.WriteLine("Number of results found: " + allRows.Count); + + // Optionally, save all rows to a CSV. + // Get a string array representation of the data rows. + resultSet.rows = allRows.ToArray(); + List rows = PqlUtilities.ResultSetToStringArrayList(resultSet); + + // Write the contents to a csv file. + CsvFile file = new CsvFile(); + file.Headers.AddRange(rows[0]); + file.Records.AddRange(rows.GetRange(1, rows.Count - 1).ToArray()); + file.Write(geoType + "_" + this.GetTimeStamp() + ".csv"); + } catch (Exception ex) { + Console.WriteLine("Failed to get Geo type = '{0}'. Exception says \"{1}\"", + geoType, ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/PublisherQueryLanguageService/GetLineItemsNamedLike.cs b/examples/Dfp/CSharp/v201308/PublisherQueryLanguageService/GetLineItemsNamedLike.cs new file mode 100644 index 00000000000..661532ba370 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/PublisherQueryLanguageService/GetLineItemsNamedLike.cs @@ -0,0 +1,108 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all line items which have a name beginning with + /// "line item". This code example may take a while to run. + /// + /// Tags: PublisherQueryLanguageService.select + /// + class GetLineItemsNamedLike : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items which have a name beginning with " + + "'line item'. This code example may take a while to run."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLineItemsNamedLike(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PublisherQueryLanguageService. + PublisherQueryLanguageService pqlService = + (PublisherQueryLanguageService) user.GetService( + DfpService.v201308.PublisherQueryLanguageService); + + int pageSize = 500; + + // Create statement to select all line items. + String selectStatement = "SELECT Id, Name, Status FROM Line_Item where Name LIKE " + + "'line item%' order by Id ASC LIMIT " + pageSize; + int offset = 0; + int resultSetSize = 0; + List allRows = new List(); + ResultSet resultSet; + + try { + do { + StatementBuilder statementBuilder = + new StatementBuilder(selectStatement + " OFFSET " + offset); + + // Get line items like 'line item%'. + resultSet = pqlService.select(statementBuilder.ToStatement()); + + // Collect all line items from each page. + allRows.AddRange(resultSet.rows); + + // Display results. + Console.WriteLine(PqlUtilities.ResultSetToString(resultSet)); + + offset += pageSize; + resultSetSize = resultSet.rows == null ? 0 : resultSet.rows.Length; + } while (resultSetSize == pageSize); + + Console.WriteLine("Number of results found: " + allRows.Count); + + // Optionally, save all rows to a CSV. + // Get a string array representation of the data rows. + resultSet.rows = allRows.ToArray(); + List rows = PqlUtilities.ResultSetToStringArrayList(resultSet); + + // Write the contents to a csv file. + CsvFile file = new CsvFile(); + file.Headers.AddRange(rows[0]); + file.Records.AddRange(rows.GetRange(1, rows.Count - 1).ToArray()); + file.Write("line_items_named_like_" + GetTimeStamp() + ".csv"); + } catch (Exception ex) { + Console.WriteLine("Failed to get line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ReportService/DisplayReport.cs b/examples/Dfp/CSharp/v201308/ReportService/DisplayReport.cs new file mode 100644 index 00000000000..82659ee9cb5 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ReportService/DisplayReport.cs @@ -0,0 +1,87 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example downloads a completed report and prints out its + /// contents. To download a completed report to a file, run DownloadReport.cs. + /// To run a report, run RunDeliveryReport.cs. + /// + /// Tags: ReportService.getReportDownloadUrlWithOptions + /// + class DisplayReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example downloads a completed report and prints out its contents. " + + "To download a completed report to a file, run DownloadReport.cs. To run a report, " + + "run RunDeliveryReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DisplayReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201308.ReportService); + + // Set the id of the completed report. + long reportJobId = long.Parse(_T("INSERT_REPORT_JOB_ID_HERE")); + ExportFormat exportFormat = (ExportFormat) Enum.Parse(typeof(ExportFormat), + _T("INSERT_EXPORT_FORMAT_HERE")); + + // Set the format of the report (e.g., CSV_DUMP) and download without + // compression so we can print it. + ReportDownloadOptions reportDownloadOptions = new ReportDownloadOptions(); + reportDownloadOptions.exportFormat = exportFormat; + reportDownloadOptions.useGzipCompression = false; + + try { + // Download report data. + string downloadUrl = reportService.getReportDownloadUrlWithOptions(reportJobId, + reportDownloadOptions); + byte[] rawReport = MediaUtilities.GetAssetDataFromUrl(downloadUrl); + string reportContents = Encoding.UTF8.GetString(rawReport); + + // Display results. + Console.WriteLine("Data for report job with id '{0}\':\n{1}", reportJobId, reportContents); + } catch (Exception ex) { + Console.WriteLine("Failed to download report. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ReportService/DownloadReport.cs b/examples/Dfp/CSharp/v201308/ReportService/DownloadReport.cs new file mode 100644 index 00000000000..2f8170964d8 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ReportService/DownloadReport.cs @@ -0,0 +1,83 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Text; +using System.IO; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example downloads a completed report. To run a report, run + /// RunDeliveryReport.cs. + /// + /// Tags: ReportService.getReportDownloadURL + /// + class DownloadReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example downloads a completed report. To run a report, run " + + "RunDeliveryReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DownloadReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201308.ReportService); + + // Set the id of the completed report. + long reportJobId = long.Parse(_T("INSERT_REPORT_JOB_ID_HERE")); + String fileName = _T("INSERT_FILE_PATH_HERE"); + + try { + // Download report data. + string url = reportService.getReportDownloadURL(reportJobId, ExportFormat.CSV_EXCEL); + byte[] gzipReport = MediaUtilities.GetAssetDataFromUrl(url); + string reportContents = Encoding.UTF8.GetString(MediaUtilities.DeflateGZipData(gzipReport)); + + using (StreamWriter writer = new StreamWriter(fileName)) { + writer.Write(reportContents); + } + + // Display results. + Console.WriteLine("Report job with id '{0}' was downloaded to '{1}'.", reportJobId, + fileName); + } catch (Exception ex) { + Console.WriteLine("Failed to download report. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ReportService/RunDeliveryReport.cs b/examples/Dfp/CSharp/v201308/ReportService/RunDeliveryReport.cs new file mode 100644 index 00000000000..33e5414c9b3 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ReportService/RunDeliveryReport.cs @@ -0,0 +1,104 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Threading; +using Google.Api.Ads.Dfp.Util.v201308; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example runs a report similar to the "Orders report" on the DFP + /// website with additional attributes and can filter to include just one + /// order. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunDeliveryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report similar to the \"Orders report\" on the DFP " + + "website with additional attributes and can filter to include just one order. To " + + "download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunDeliveryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201308.ReportService); + + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create statement object to filter for an order. + Statement filterStatement = new StatementBuilder("WHERE ORDER_ID = :id").AddValue( + "id", orderId).ToStatement(); + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportJob.reportQuery.dimensionAttributes = new DimensionAttribute[] { + DimensionAttribute.ORDER_TRAFFICKER, DimensionAttribute.ORDER_START_DATE_TIME, + DimensionAttribute.ORDER_END_DATE_TIME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportJob.reportQuery.statement = filterStatement; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ReportService/RunInventoryReport.cs b/examples/Dfp/CSharp/v201308/ReportService/RunInventoryReport.cs new file mode 100644 index 00000000000..cb8d3a61aa4 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ReportService/RunInventoryReport.cs @@ -0,0 +1,97 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example runs a report equal to the "Whole network report" on the + /// DFP website. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunInventoryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Whole network report\" on the " + + "DFP website. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunInventoryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201308.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.DATE}; + reportJob.reportQuery.columns = new Column[] { + Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, + Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + Column.TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + Column.TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE + }; + reportJob.reportQuery.adUnitView = ReportQueryAdUnitView.HIERARCHICAL; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_WEEK; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run inventory report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ReportService/RunMergedDeliveryReport.cs b/examples/Dfp/CSharp/v201308/ReportService/RunMergedDeliveryReport.cs new file mode 100644 index 00000000000..90fa7269527 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ReportService/RunMergedDeliveryReport.cs @@ -0,0 +1,96 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example runs a report that an upgraded publisher would use to + /// include statistics before the upgrade. To download the report see + /// DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunMergedDeliveryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Orders report\" on the DFP " + + "website with additional attributes. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunMergedDeliveryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201308.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportQuery.columns = new Column[] {Column.MERGED_AD_SERVER_IMPRESSIONS, + Column.MERGED_AD_SERVER_CLICKS, Column.MERGED_AD_SERVER_CTR, + Column.MERGED_AD_SERVER_CPM_AND_CPC_REVENUE, + Column.MERGED_AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery = reportQuery; + + try { + // Run report job. + reportJob = reportService.runReportJob(reportJob); + + do { + Console.WriteLine("Report with ID '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS); + + if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with ID '{0}' failed to finish successfully.", + reportJob.id); + } else { + Console.WriteLine("Report job with ID '{0}' completed successfully.", reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ReportService/RunReachReport.cs b/examples/Dfp/CSharp/v201308/ReportService/RunReachReport.cs new file mode 100644 index 00000000000..7d84b81e09c --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ReportService/RunReachReport.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Threading; +using Google.Api.Ads.Dfp.Util.v201308; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example runs a reach report. To download the report see + /// DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunReachReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a reach report. To download the report see " + + "DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunReachReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201308.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.REACH_LIFETIME; + reportQuery.dimensions = new Dimension[] {Dimension.LINE_ITEM_ID, Dimension.LINE_ITEM_NAME}; + reportQuery.columns = new Column[] {Column.REACH_FREQUENCY, Column.REACH_AVERAGE_REVENUE, + Column.REACH}; + reportJob.reportQuery = reportQuery; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ReportService/RunReportWithCustomFields.cs b/examples/Dfp/CSharp/v201308/ReportService/RunReportWithCustomFields.cs new file mode 100644 index 00000000000..62ea126f35c --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ReportService/RunReportWithCustomFields.cs @@ -0,0 +1,145 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; +using Google.Api.Ads.Dfp.Util.v201308; + +using System; +using System.Threading; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example runs a report that includes custom fields found in the + /// line items of an order. To download the report see DownloadReport.cs. + /// + /// Tag: ReportService.runReportJob + /// Tag: ReportService.getReportJob + /// Tag: LineItemService.getLineItemsByStatement + /// + class RunReportWithCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report that includes custom fields found in the " + + "line items of an order. To download the report see DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunReportWithCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201308.LineItemService); + // Get the ReportService. + ReportService reportService = + (ReportService) user.GetService(DfpService.v201308.ReportService); + + try { + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Sets defaults for page and filterStatement. + LineItemPage page = new LineItemPage(); + int offset = 0; + + // Create a statement to only select line items from a given order. + String filterText = "WHERE orderId = :orderId LIMIT 500"; + Statement filterStatement = + new StatementBuilder(filterText).AddValue("orderId", orderId).ToStatement(); + + + // Collect all line item custom field IDs for an order. + List customFieldIds = new List(); + do { + filterStatement.query = filterText + " OFFSET " + offset; + + // Get line items by statement. + page = lineItemService.getLineItemsByStatement(filterStatement); + + // Get custom field IDs from the line items of an order. + if (page.results != null) { + foreach (LineItem lineItem in page.results) { + if (lineItem.customFieldValues != null) { + foreach (BaseCustomFieldValue customFieldValue in lineItem.customFieldValues) { + if (!customFieldIds.Contains(customFieldValue.customFieldId)) { + customFieldIds.Add(customFieldValue.customFieldId); + } + } + } + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + + // Create statement to filter for an order. + filterStatement = + new StatementBuilder("WHERE ORDER_ID = :orderId").AddValue("orderId", orderId) + .ToStatement(); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportQuery.dimensions = new Dimension[] {Dimension.LINE_ITEM_ID, Dimension.LINE_ITEM_NAME}; + reportQuery.statement = filterStatement; + reportQuery.customFieldIds = customFieldIds.ToArray(); + reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS}; + reportJob.reportQuery = reportQuery; + + // Run report job. + reportJob = reportService.runReportJob(reportJob); + + do { + Console.WriteLine("Report with ID '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS); + + if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with ID '{0}' failed to finish successfully.", + reportJob.id); + } else { + Console.WriteLine("Report job with ID '{0}' completed successfully.", reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run cusom fields report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/ReportService/RunSalesReport.cs b/examples/Dfp/CSharp/v201308/ReportService/RunSalesReport.cs new file mode 100644 index 00000000000..ade1a96d94c --- /dev/null +++ b/examples/Dfp/CSharp/v201308/ReportService/RunSalesReport.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example runs a report equal to the "Sales by salespersons + /// report" on the DFP website. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunSalesReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Sales by salespersons report\" on" + + "the DFP website. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunSalesReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201308.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.SALESPERSON_ID, + Dimension.SALESPERSON_NAME}; + reportJob.reportQuery.columns = new Column[] { + Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM + }; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run sales report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs b/examples/Dfp/CSharp/v201308/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs new file mode 100644 index 00000000000..4aad64bf8dc --- /dev/null +++ b/examples/Dfp/CSharp/v201308/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs @@ -0,0 +1,105 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201308; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example approves all suggested ad units with 50 or more + /// requests. This feature is only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// Tags: SuggestedAdUnitService.performSuggestedAdUnitAction + /// + class ApproveSuggestedAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example approves all suggested ad units with 50 or more requests. " + + "This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ApproveSuggestedAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201308.SuggestedAdUnitService); + + // Create statement to select all suggested ad units with 50 or more + // requests. + string statementText = "WHERE numRequests >= 50"; + Statement filterStatement = new StatementBuilder(statementText).ToStatement(); + + try { + // Get suggested ad units by statement. + SuggestedAdUnitPage page = + suggestedAdUnitService.getSuggestedAdUnitsByStatement(filterStatement); + + int i = 0; + if (page != null && page.results != null) { + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and \"{2}\" will be " + + "approved.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + + Console.WriteLine("Number of suggested ad units to be approved: " + + page.totalResultSetSize); + + // Create action. + ApproveSuggestedAdUnit action = new ApproveSuggestedAdUnit(); + + // Perform action. + SuggestedAdUnitUpdateResult result = suggestedAdUnitService.performSuggestedAdUnitAction( + action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of suggested ad units approved: " + result.numChanges); + } else { + Console.WriteLine("No suggested ad units were approved."); + } + } else { + Console.WriteLine("No suggested ad units were approved."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to approve suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs b/examples/Dfp/CSharp/v201308/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs new file mode 100644 index 00000000000..ede40a3751c --- /dev/null +++ b/examples/Dfp/CSharp/v201308/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201308; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all suggested ad units. To approve suggested ad + /// units, run ApproveSuggestedAdUnits.cs. This feature is only available to + /// DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// + class GetAllSuggestedAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all suggested ad units. To approve suggested ad units, " + + "run ApproveSuggestedAdUnits.cs. This feature is only available to DFP premium " + + "solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllSuggestedAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201308.SuggestedAdUnitService); + + // Set defaults for page and filterStatement. + SuggestedAdUnitPage page = new SuggestedAdUnitPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all suggested ad units. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get suggested ad units by statement. + page = suggestedAdUnitService.getSuggestedAdUnitsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and number of requests " + + "\"{2}\" was found.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/SuggestedAdUnitService/GetSuggestedAdUnit.cs b/examples/Dfp/CSharp/v201308/SuggestedAdUnitService/GetSuggestedAdUnit.cs new file mode 100644 index 00000000000..3db8317ad6a --- /dev/null +++ b/examples/Dfp/CSharp/v201308/SuggestedAdUnitService/GetSuggestedAdUnit.cs @@ -0,0 +1,83 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201308; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets a suggested ad unit by its ID. To determine which + /// suggested ad units exist, run GetAllSuggestedAdUnits.cs. This feature is + /// only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnit + /// + class GetSuggestedAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a suggested ad unit by its ID. To determine which " + + "suggested ad units exist, run GetAllSuggestedAdUnits.cs. This feature is only " + + "available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetSuggestedAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201308.SuggestedAdUnitService); + + // Set the ID of the suggested ad unit to get. + String suggestedAdUnitId = _T("INSERT_SUGGESTED_AD_UNIT_ID_HERE"); + + try { + // Get the suggested ad unit. + SuggestedAdUnit suggestedAdUnit = suggestedAdUnitService.getSuggestedAdUnit( + suggestedAdUnitId); + + if (suggestedAdUnit != null) { + Console.WriteLine("Suggested ad unit with ID \"{0}\", and number of requests \"{1}\" " + + "was found.", suggestedAdUnit.id, suggestedAdUnit.numRequests); + } else { + Console.WriteLine("No suggested ad unit found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs b/examples/Dfp/CSharp/v201308/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs new file mode 100644 index 00000000000..f900dab4b58 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs @@ -0,0 +1,90 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201308; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets suggested ad units that have more than 50 requests. + /// The statement retrieves up to the maximum page size limit of 500. This + /// feature is only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// + class GetSuggestedUnitByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets suggested ad units that have more than 50 requests. The " + + "statement retrieves up to the maximum page size limit of 500. This feature is " + + "only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetSuggestedUnitByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201308.SuggestedAdUnitService); + + // Set the number of requests to 50 or more. + long NUMBER_OF_REQUESTS = 50L; + + // Create a statement to only select suggested ad units that have more + // than 50 requests. + Statement filterStatement = new StatementBuilder("WHERE numRequests > :numRequests LIMIT 500") + .AddValue("numRequests", NUMBER_OF_REQUESTS).ToStatement(); + + try { + // Get suggested ad units by statement. + SuggestedAdUnitPage page = suggestedAdUnitService.getSuggestedAdUnitsByStatement( + filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and number of requests " + + "\"{2}\" was found.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/TeamService/CreateTeams.cs b/examples/Dfp/CSharp/v201308/TeamService/CreateTeams.cs new file mode 100644 index 00000000000..cd0bb0005a5 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/TeamService/CreateTeams.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using Google.Api.Ads.Dfp.Util.v201308; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates new teams. To determine which teams exist, run + /// GetAllTeams.cs. + /// + /// Tags: TeamService.createTeams + /// + class CreateTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new teams. To determine which teams exist, run " + + "GetAllTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201308.TeamService); + + try { + // Create an array to store local team objects. + Team[] teams = new Team[5]; + + for (int i = 0; i < 5; i++) { + Team team = new Team(); + team.name = "Team #" + i; + team.hasAllCompanies = false; + team.hasAllInventory = false; + teams[i] = team; + } + + // Create the teams on the server. + teams = teamService.createTeams(teams); + + if (teams != null && teams.Length > 0) { + foreach (Team newTeam in teams) { + Console.WriteLine("A team with ID \"{0}\", and name \"{1}\" was created.", + newTeam.id, newTeam.name); + } + } else { + Console.WriteLine("No teams created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create teams. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/TeamService/GetAllTeams.cs b/examples/Dfp/CSharp/v201308/TeamService/GetAllTeams.cs new file mode 100644 index 00000000000..6ea1e7eb01b --- /dev/null +++ b/examples/Dfp/CSharp/v201308/TeamService/GetAllTeams.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using Google.Api.Ads.Dfp.Util.v201308; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all teams. To create teams, run CreateTeams.cs. + /// + /// Tags: TeamService.getTeamsByStatement + /// + class GetAllTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams. To create teams, run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201308.TeamService); + + // Set defaults for page and filterStatement. + TeamPage page = new TeamPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all teams. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get teams by statement. + page = teamService.getTeamsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Team team in page.results) { + Console.WriteLine("{0}) Team with ID \"{1}\", name \"{2}\" was found.", + i, team.id, team.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all teams. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/TeamService/GetTeam.cs b/examples/Dfp/CSharp/v201308/TeamService/GetTeam.cs new file mode 100644 index 00000000000..694479c4fa9 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/TeamService/GetTeam.cs @@ -0,0 +1,78 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using Google.Api.Ads.Dfp.Util.v201308; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets a team by its ID. To determine which teams exist, + /// run GetAllTeams.cs. + /// + /// Tags: TeamService.getTeam + /// + class GetTeam : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a team by its ID. To determine which teams exist, run " + + "GetAllTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetTeam(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201308.TeamService); + + // Set the ID of the team to get. + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + + try { + // Get the team. + Team team = teamService.getTeam(teamId); + + if (team != null) { + Console.WriteLine("Team with ID \"{0}\"and name \"{1}\" was found.", team.id, team.name); + } else { + Console.WriteLine("No team found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get team by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/TeamService/GetTeamsByStatement.cs b/examples/Dfp/CSharp/v201308/TeamService/GetTeamsByStatement.cs new file mode 100644 index 00000000000..e05f0d346a1 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/TeamService/GetTeamsByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using Google.Api.Ads.Dfp.Util.v201308; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all teams ordered by name. The statement retrieves + /// up to the maximum page size limit of 500. To create teams, + /// run CreateTeams.cs. + /// + /// Tags: TeamService.getTeamsByStatement + /// + class GetTeamsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams ordered by name. The statement retrieves up to " + + "the maximum page size limit of 500. To create teams, run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetTeamsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201308.TeamService); + + // Create a statement to order teams by name. + Statement filterStatement = new StatementBuilder("ORDER BY name LIMIT 500").ToStatement(); + + try { + // Get teams by statement. + TeamPage page = teamService.getTeamsByStatement(filterStatement); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (Team team in page.results) { + Console.WriteLine("{0}) Team with ID \"{1}\" and name \"{2}\" was found.", + i, team.id, team.name); + i++; + } + } + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get teams by statement. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/TeamService/UpdateTeams.cs b/examples/Dfp/CSharp/v201308/TeamService/UpdateTeams.cs new file mode 100644 index 00000000000..a707b3dc2fb --- /dev/null +++ b/examples/Dfp/CSharp/v201308/TeamService/UpdateTeams.cs @@ -0,0 +1,107 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using Google.Api.Ads.Dfp.Util.v201308; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example updates teams by adding an ad unit to the first 5. To + /// determine which teams exist, run GetAllTeams.cs. To determine which ad + /// units exist, run GetAllAdUnits.cs. + /// + /// Tags: TeamService.getTeamsByStatement, TeamService.updateTeams + /// + class UpdateTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates teams by adding an ad unit to the first 5. To " + + "determine which teams exist, run GetAllTeams.cs. To determine which ad units " + + "exist, run GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201308.TeamService); + + // Set the ID of the ad unit to add to the teams. + String adUnitId = _T("INSERT_AD_UNIT_ID_HERE"); + + // Create a statement to select first 5 teams that aren't built-in. + Statement filterStatement = new StatementBuilder("WHERE id > 0 LIMIT 5").ToStatement(); + + try { + // Get the teams by statement. + TeamPage page = teamService.getTeamsByStatement(filterStatement); + + if (page.results != null) { + Team[] teams = page.results; + + // Update each local team object by adding the ad unit to it. + foreach (Team team in teams) { + // Don't add ad unit if the team has all inventory already. + if (!team.hasAllInventory) { + List adUnitIds = new List(); + if (team.adUnitIds != null) { + adUnitIds.AddRange(team.adUnitIds); + } + adUnitIds.Add(adUnitId); + team.adUnitIds = adUnitIds.ToArray(); + } + } + + // Update the teams on the server. + teams = teamService.updateTeams(teams); + + if (teams != null) { + foreach (Team team in teams) { + Console.WriteLine("A team with ID \"{0}\" and name \"{1}\" was updated.", + team.id, team.name); + } + } else { + Console.WriteLine("No teams updated."); + } + } else { + Console.WriteLine("No teams found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update teams. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/UserService/CreateUsers.cs b/examples/Dfp/CSharp/v201308/UserService/CreateUsers.cs new file mode 100644 index 00000000000..3b08e107cb9 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/UserService/CreateUsers.cs @@ -0,0 +1,100 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example creates new users. To determine which users + /// exist, run GetAllUsers.cs. + /// + /// Tags: UserService.createUsers + /// + class CreateUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new users. To determine which users " + + "exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201308.UserService); + + // Set the user's email addresses and names. + List emailAndNames = new List(); + emailAndNames.Add(new String[] {_T("INSERT_EMAIL_ADDRESS_HERE"), _T("INSERT_NAME_HERE")}); + emailAndNames.Add(new String[] {_T("INSERT_ANOTHER_EMAIL_ADDRESS_HERE"), + _T("INSERT_ANOTHER_NAME_HERE")}); + + // Roles can be obtained by running GetAllRoles.cs. + long roleId = long.Parse(_T("INSERT_ROLE_ID_HERE")); + + // Create an array to store local user objects. + User[] users = new User[emailAndNames.Count]; + + for (int i = 0; i < users.Length; i++) { + // Create the new user structure. + User newUser = new User(); + newUser.email = emailAndNames[i][0]; + newUser.name = emailAndNames[i][1]; + newUser.roleId = roleId; + newUser.preferredLocale = "en_US"; + + users[i] = newUser; + } + + try { + // Create the users. + users = userService.createUsers(users); + + if (users != null) { + foreach (User newUser in users) { + Console.WriteLine("A user with ID = '{0}', email = '{1}', and role = '{2}' " + + "was created.", newUser.id, newUser.email, newUser.roleName); + } + } else { + Console.WriteLine("No users created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/UserService/DeactivateUser.cs b/examples/Dfp/CSharp/v201308/UserService/DeactivateUser.cs new file mode 100644 index 00000000000..42264fab23b --- /dev/null +++ b/examples/Dfp/CSharp/v201308/UserService/DeactivateUser.cs @@ -0,0 +1,123 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example deactivates a user. Deactivated users can no longer make + /// requests to the API. The user making the request cannot deactivate itself. + /// To determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserService.getUsersByStatement, UserService.performUserAction + /// + class DeactivateUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates a user. Deactivated users can no longer make " + + "requests to the API. The user making the request cannot deactivate itself. " + + "To determine which users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201308.UserService); + + // Set the ID of the user to deactivate + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create Statement text to select user by id. + string statementText = "WHERE id = :userId LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("userId", userId).ToStatement(); + + // Sets defaults for page and offset. + UserPage page = new UserPage(); + int offset = 0; + List userIds = new List(); + + try { + do { + // Create a Statement to page through users. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get users by Statement. + page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User userResult in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and status = '{3}'" + + " will be deactivated.", i, userResult.id, userResult.email, + userResult.isActive ? "ACTIVE" : "INACTIVE"); + userIds.Add(userResult.id.ToString()); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of users to be deactivated: {0}", page.totalResultSetSize); + + if (userIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", userIds.ToArray()))). + ToStatement(); + + // Create action. + DeactivateUsers action = new DeactivateUsers(); + + // Perform action. + UpdateResult result = userService.performUserAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of users deactivated: {0}" + result.numChanges); + } else { + Console.WriteLine("No users were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/UserService/GetAllRoles.cs b/examples/Dfp/CSharp/v201308/UserService/GetAllRoles.cs new file mode 100644 index 00000000000..934aa4c8672 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/UserService/GetAllRoles.cs @@ -0,0 +1,77 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all roles. This example can be used to determine + /// which role ID is needed when getting and creating users. + /// + /// Tags: UserService.getAllRoles + /// + class GetAllRoles : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all roles. This example can be used to determine which " + + "role ID is needed when getting and creating users."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllRoles(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201308.UserService); + + try { + // Get all roles. + Role[] roles = userService.getAllRoles(); + int numRoles = 0; + if (roles != null && roles.Length > 0) { + foreach (Role role in roles) { + Console.WriteLine("Role with ID = '{0}' and name ='{1}' was found.", role.id, + role.name); + } + numRoles = roles.Length; + } + + Console.WriteLine("Number of results found: " + numRoles); + } catch (Exception ex) { + Console.WriteLine("Failed to get all roles. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/UserService/GetAllUsers.cs b/examples/Dfp/CSharp/v201308/UserService/GetAllUsers.cs new file mode 100644 index 00000000000..5e013820d74 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/UserService/GetAllUsers.cs @@ -0,0 +1,87 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all users. To create users, run CreateUsers.cs. + /// + /// Tags: UserService.getUsersByStatement + /// + class GetAllUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all users. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201308.UserService); + + // Sets defaults for page and Statement. + UserPage page = new UserPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all users. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get users by Statement. + page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User usr in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and role = '{3}'" + + " was found.", i, usr.id, usr.email, usr.roleName); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/UserService/GetCurrentUser.cs b/examples/Dfp/CSharp/v201308/UserService/GetCurrentUser.cs new file mode 100644 index 00000000000..f4dc1accb80 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/UserService/GetCurrentUser.cs @@ -0,0 +1,71 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets current user. To create users, run CreateUsers.cs. + /// + /// Tags: UserService.getCurrentUser + /// + class GetCurrentUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets current user. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCurrentUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201308.UserService); + + try { + // Get the current user. + User usr = userService.getCurrentUser(); + + if (usr != null) { + Console.WriteLine("User with ID = '{0}', email = '{1}', and role = '{2}' is the " + + "current user.", usr.id, usr.email, usr.roleName); + } else { + Console.WriteLine("The current user could not be retrieved."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get current user. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/UserService/GetUser.cs b/examples/Dfp/CSharp/v201308/UserService/GetUser.cs new file mode 100644 index 00000000000..5dbb5a07f19 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/UserService/GetUser.cs @@ -0,0 +1,76 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets a user by its ID. To create users, run + /// CreateUsers.cs. + /// + /// Tags: UserService.getUser + /// + class GetUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets a user by its ID. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201308.UserService); + + // Set the ID of the user to get. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + try { + // Get the user. + User usr = userService.getUser(userId); + + if (usr != null) { + Console.WriteLine("User with ID = '{0}', email = '{1}', and role = '{2}' was found.", + usr.id, usr.email, usr.roleName); + } else { + Console.WriteLine("No user found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/UserService/GetUsersByStatement.cs b/examples/Dfp/CSharp/v201308/UserService/GetUsersByStatement.cs new file mode 100644 index 00000000000..af4157f24a2 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/UserService/GetUsersByStatement.cs @@ -0,0 +1,82 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all users sorted by name. The Statement retrieves + /// up to the maximum page size limit of 500. To create new users, + /// run CreateUsers.cs. + /// + /// Tags: UserService.getUsersByStatement + /// + class GetUsersByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return " This code example gets all users sorted by name. The Statement retrieves " + + "up to the maximum page size limit of 500. To create new users, " + + "run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUsersByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201308.UserService); + + // Create a Statement to get all users sorted by name. + Statement statement = new Statement(); + statement.query = "ORDER BY name LIMIT 500"; + + try { + // Get users by Statement. + UserPage page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User usr in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and role = '{3}'" + + " was found.", i, usr.id, usr.email, usr.roleName); + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/UserService/UpdateUsers.cs b/examples/Dfp/CSharp/v201308/UserService/UpdateUsers.cs new file mode 100644 index 00000000000..152eac3edc5 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/UserService/UpdateUsers.cs @@ -0,0 +1,96 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example updates all users by adding "Sr." to the end of each + /// name (after a very large baby boom and lack of creativity). To + /// determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserService.getUsersByStatement, UserService.updateUsers + /// + class UpdateUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates all users by adding 'Sr.' to the end of each " + + "name (after a very large baby boom and lack of creativity). To " + + "determine which users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserService. + UserService userService = (UserService) dfpUser.GetService(DfpService.v201308.UserService); + + // Create a Statement to get all users. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get users by Statement. + UserPage page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + User[] users = page.results; + + // Update each local users object by changing its name. + foreach (User user in users) { + user.name = user.name + " Sr."; + } + + // Update the users on the server. + users = userService.updateUsers(users); + + if (users != null) { + foreach (User user in users) { + Console.WriteLine("A user with ID = '{0}', name ='{1}', and role = '{2}'" + + " was updated.", user.id, user.name, user.roleName); + } + } else { + Console.WriteLine("No users updated."); + } + } else { + Console.WriteLine("No users found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/UserTeamAssociationService/CreateUserTeamAssociations.cs b/examples/Dfp/CSharp/v201308/UserTeamAssociationService/CreateUserTeamAssociations.cs new file mode 100644 index 00000000000..560da372462 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/UserTeamAssociationService/CreateUserTeamAssociations.cs @@ -0,0 +1,98 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example adds a user to a team by creating an association + /// between the two. To determine which teams exist, run GetAllTeams.cs. To + /// determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.createUserTeamAssociations + /// + class CreateUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a user to a team by creating an association between the " + + "two. To determine which teams exist, run GetAllTeams.cs. To determine which users " + + "exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201308.UserTeamAssociationService); + + // Set the users and team to add them to. + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + long[] userIds = new long[] {long.Parse(_T("INSERT_USER_ID_HERE"))}; + + // Create an array to store local user team association objects. + UserTeamAssociation[] userTeamAssociations = new UserTeamAssociation[userIds.Length]; + + // For each user, associate it with the given team. + int i = 0; + + foreach (long userId in userIds) { + UserTeamAssociation userTeamAssociation = new UserTeamAssociation(); + userTeamAssociation.userId = userId; + userTeamAssociation.teamId = teamId; + userTeamAssociations[i++] = userTeamAssociation; + } + + try { + // Create the user team associations on the server. + userTeamAssociations = + userTeamAssociationService.createUserTeamAssociations(userTeamAssociations); + + if (userTeamAssociations != null) { + foreach (UserTeamAssociation userTeamAssociation in userTeamAssociations) { + Console.WriteLine("A user team association between user with ID \"{0}\" and team " + + "with ID \"{1}\" was created.", userTeamAssociation.userId, + userTeamAssociation.teamId); + } + } else { + Console.WriteLine("No user team associations created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/UserTeamAssociationService/DeleteUserTeamAssociations.cs b/examples/Dfp/CSharp/v201308/UserTeamAssociationService/DeleteUserTeamAssociations.cs new file mode 100644 index 00000000000..daf8245de7b --- /dev/null +++ b/examples/Dfp/CSharp/v201308/UserTeamAssociationService/DeleteUserTeamAssociations.cs @@ -0,0 +1,121 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example removes the user from all its teams. To determine which + /// users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.performUserTeamAssociationAction + /// + class DeleteUserTeamAssociation : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example removes the user from all its teams. To determine which " + + "users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeleteUserTeamAssociation(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201308.UserTeamAssociationService); + + // Set the user to remove from its teams. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create filter text to select user team associations by the user ID. + String statementText = "WHERE userId = :userId LIMIT 500"; + Statement filterStatement = new StatementBuilder("").AddValue("userId", userId). + ToStatement(); + + // Set defaults for page and offset. + UserTeamAssociationPage page = new UserTeamAssociationPage(); + int offset = 0; + + try { + do { + // Create a statement to page through user team associations. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get user team associations by statement. + page = userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and " + + "team with ID \"{2}\" will be deleted.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of teams that the user will be removed from: " + + page.totalResultSetSize); + + if (page.totalResultSetSize > 0) { + // Modify statement for action. + filterStatement.query = "WHERE userId = :userId"; + + // Create action. + DeleteUserTeamAssociations action = new DeleteUserTeamAssociations(); + + // Perform action. + UpdateResult result = + userTeamAssociationService.performUserTeamAssociationAction(action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of teams that the user was removed from: " + + result.numChanges); + } else { + Console.WriteLine("No user team associations were deleted."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to delete user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/UserTeamAssociationService/GetAllUserTeamAssociations.cs b/examples/Dfp/CSharp/v201308/UserTeamAssociationService/GetAllUserTeamAssociations.cs new file mode 100644 index 00000000000..98c22939313 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/UserTeamAssociationService/GetAllUserTeamAssociations.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all user team associations. To create user team + /// associations, run CreateUserTeamAssociations.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// + class GetAllUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all user team associations. To create user team " + + "associations, run CreateUserTeamAssociations.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201308.UserTeamAssociationService); + + // Set defaults for page and filterStatement. + UserTeamAssociationPage page = new UserTeamAssociationPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all user team associations. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get user team associations by statement. + page = userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and " + + "team with ID \"{2}\" was found.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}." + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/UserTeamAssociationService/GetUserTeamAssociation.cs b/examples/Dfp/CSharp/v201308/UserTeamAssociationService/GetUserTeamAssociation.cs new file mode 100644 index 00000000000..f6cb945d922 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/UserTeamAssociationService/GetUserTeamAssociation.cs @@ -0,0 +1,84 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets a user team association by the user and team ID. + /// To determine which teams exist, run GetAllTeams.cs. To determine which + /// users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociation + /// + class GetUserTeamAssociation : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a user team association by the user and team ID. To " + + "determine which teams exist, run GetAllTeams.cs. To determine which users exist, " + + "run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUserTeamAssociation(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201308.UserTeamAssociationService); + + // Set the IDs of the user and team to get the association for. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + + try { + // Get the user team association. + UserTeamAssociation userTeamAssociation = userTeamAssociationService.getUserTeamAssociation( + teamId, userId); + + if (userTeamAssociation != null) { + Console.WriteLine("User team association between user with ID \"{0}\" and team with " + + "ID \"{1}\" was found.", userTeamAssociation.userId, userTeamAssociation.teamId); + } else { + Console.WriteLine("No user team association found."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs b/examples/Dfp/CSharp/v201308/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs new file mode 100644 index 00000000000..54ec9f07adc --- /dev/null +++ b/examples/Dfp/CSharp/v201308/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs @@ -0,0 +1,98 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example gets all teams that the current user belongs to. The + /// statement retrieves up to the maximum page size limit of 500. To create + /// teams, run CreateTeams.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// Tags: UserService.getCurrentUser + /// + class GetUserTeamAssociationsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams that the current user belongs to. The " + + "statement retrieves up to the maximum page size limit of 500. To create teams, " + + "run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUserTeamAssociationsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201308.UserTeamAssociationService); + + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201308.UserService); + + try { + // Get the current user. + long currentUserId = userService.getCurrentUser().id; + + // Create filter text to select user team associations by the user ID. + String statementText = "WHERE userId = :userId LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText). + AddValue("userId", currentUserId).ToStatement(); + + // Get user team associations by statement. + UserTeamAssociationPage page = + userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and team " + + "with ID \"{2}\" was found.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201308/UserTeamAssociationService/UpdateUserTeamAssociations.cs b/examples/Dfp/CSharp/v201308/UserTeamAssociationService/UpdateUserTeamAssociations.cs new file mode 100644 index 00000000000..968eff118a3 --- /dev/null +++ b/examples/Dfp/CSharp/v201308/UserTeamAssociationService/UpdateUserTeamAssociations.cs @@ -0,0 +1,107 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201308 { + /// + /// This code example updates user team associations by setting the + /// overridden access type to read only for all teams that the user belongs + /// to. To determine which users exists, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// Tags: UserTeamAssociationService.updateUserTeamAssociations + /// + class UpdateUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates user team associations by setting the overridden " + + "access type to read only for all teams that the user belongs to. To determine " + + "which users exists, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201308.UserTeamAssociationService); + + // Set the user to set to read only access within its teams. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create filter text to select user team associations by the user ID. + String statementText = "WHERE userId = :userId LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText). + AddValue("userId", userId).ToStatement(); + + try { + // Get user team associations by statement. + UserTeamAssociationPage page = + userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + if (page.results != null) { + UserTeamAssociation[] userTeamAssociations = page.results; + + // Update each local user team association to read only access. + foreach (UserTeamAssociation userTeamAssociation in userTeamAssociations) { + userTeamAssociation.overriddenTeamAccessType = TeamAccessType.READ_ONLY; + } + + // Update the user team associations on the server. + userTeamAssociations = + userTeamAssociationService.updateUserTeamAssociations(userTeamAssociations); + + if (userTeamAssociations != null) { + foreach (UserTeamAssociation userTeamAssociation in userTeamAssociations) { + Console.WriteLine("User team association between user with ID \"{0}\" and team " + + "with ID \"{1}\" was updated to access type \"{2}\".", userTeamAssociation.userId, + userTeamAssociation.teamId, userTeamAssociation.overriddenTeamAccessType); + } + } else { + Console.WriteLine("No user team associations updated."); + } + } else { + Console.WriteLine("No user team associations found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ActivityGroupService/CreateActivityGroups.cs b/examples/Dfp/CSharp/v201311/ActivityGroupService/CreateActivityGroups.cs new file mode 100644 index 00000000000..f79f2a7789d --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ActivityGroupService/CreateActivityGroups.cs @@ -0,0 +1,96 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates new activity groups. To determine which activity + /// groups exist, run GetAllActivityGroups.cs. + /// + /// Tags: ActivityGroupService.createActivityGroups + /// + class CreateActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new activity groups. To determine which activity " + + "groups exist, run GetAllActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201311.ActivityGroupService); + + // Set the ID of the advertiser company this activity group is associated + // with. + long advertiserCompanyId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Create a short-term activity group. + ActivityGroup shortTermActivityGroup = new ActivityGroup(); + shortTermActivityGroup.name = "Short-term activity group #" + GetTimeStamp(); + shortTermActivityGroup.companyIds = new long[] {advertiserCompanyId}; + shortTermActivityGroup.clicksLookback = 1; + shortTermActivityGroup.impressionsLookback = 1; + + // Create a long-term activity group. + ActivityGroup longTermActivityGroup = new ActivityGroup(); + longTermActivityGroup.name = "Long-term activity group #" + GetTimeStamp(); + longTermActivityGroup.companyIds = new long[] {advertiserCompanyId}; + longTermActivityGroup.clicksLookback = 30; + longTermActivityGroup.impressionsLookback = 30; + + try { + // Create the activity groups on the server. + ActivityGroup[] activityGroups = activityGroupService.createActivityGroups( + new ActivityGroup[] {shortTermActivityGroup, longTermActivityGroup}); + + // Display results. + if (activityGroups != null) { + foreach (ActivityGroup activityGroup in activityGroups) { + Console.WriteLine("An activity group with ID \"{0}\" and name \"{1}\" was created.", + activityGroup.id, activityGroup.name); + } + } else { + Console.WriteLine("No activity groups were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ActivityGroupService/GetActiveActivityGroups.cs b/examples/Dfp/CSharp/v201311/ActivityGroupService/GetActiveActivityGroups.cs new file mode 100644 index 00000000000..d043a8da959 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ActivityGroupService/GetActiveActivityGroups.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; +using Google.Api.Ads.Dfp.Util.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all active activity groups. To create activity + /// groups, run CreateActivityGroups.cs. + /// + /// Tags: ContactService.getContactsByStatement + /// + class GetActiveActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active activity groups. To create activity groups, " + + "run CreateActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActiveActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201311.ActivityGroupService); + + Statement filterStatement = new StatementBuilder("").AddValue( + "status", ActivityGroupStatus.ACTIVE.ToString()).ToStatement(); + + // Set defaults for page and filterStatement. + ActivityGroupPage page; + int offset = 0; + + try { + do { + // Create a statement to get all content. + filterStatement.query = "WHERE status = :status ORDER BY id LIMIT 500 OFFSET " + + offset.ToString(); + + + // Get contacts by statement. + page = activityGroupService.getActivityGroupsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (ActivityGroup activityGroup in page.results) { + Console.WriteLine("{0}) Activity group with ID \"{1}\" and name \"{2}\" was found.", + i, activityGroup.id, activityGroup.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ActivityGroupService/GetAllActivityGroups.cs b/examples/Dfp/CSharp/v201311/ActivityGroupService/GetAllActivityGroups.cs new file mode 100644 index 00000000000..cbdc5d8955b --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ActivityGroupService/GetAllActivityGroups.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; +using Google.Api.Ads.Dfp.Util.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all activity groups. To create activity groups, run + /// CreateActivityGroups.cs. + /// + /// Tags: ActivityGroupService.getActivityGroupsByStatement + /// + class GetAllActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all activity groups. To create activity groups, run " + + "CreateActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201311.ActivityGroupService); + + ActivityGroupPage page; + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + filterStatement.query = "ORDER BY id LIMIT 500 OFFSET " + offset.ToString(); + // Get activity groups by statement. + page = activityGroupService.getActivityGroupsByStatement(filterStatement); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + + foreach (ActivityGroup activityGroup in page.results) { + Console.WriteLine("{0}) Activity group with ID \"{1}\" and name \"{2}\" was " + + "found.", i, activityGroup.id, activityGroup.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ActivityGroupService/UpdateActivityGroups.cs b/examples/Dfp/CSharp/v201311/ActivityGroupService/UpdateActivityGroups.cs new file mode 100644 index 00000000000..a81fac2d8b1 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ActivityGroupService/UpdateActivityGroups.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; +using Google.Api.Ads.Dfp.Util.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example updates activity groups by adding a company. To + /// determine which activity groups exist, run GetAllActivityGroups.cs. + /// + /// Tags: ActivityGroupService.getActivityGroup + /// Tags: ActivityGroupService.updateActivityGroups + /// + class UpdateActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates activity groups by adding a company. To determine " + + "which activity groups exist, run GetAllActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201311.ActivityGroupService); + + // Set the ID of the activity group and the company to update it with. + int activityGroupId = int.Parse(_T("INSERT_ACTIVITY_GROUP_ID_HERE")); + long advertiserCompanyId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + try { + // Get the activity group. + ActivityGroup activityGroup = activityGroupService.getActivityGroup(activityGroupId); + + // Update the companies. + List companyIds = new List(activityGroup.companyIds); + companyIds.Add(advertiserCompanyId); + activityGroup.companyIds = companyIds.ToArray(); + + // Update the activity groups on the server. + ActivityGroup[] activityGroups = activityGroupService.updateActivityGroups( + new ActivityGroup[] {activityGroup}); + + // Display results. + if (activityGroups != null) { + foreach (ActivityGroup updatedActivityGroup in activityGroups) { + Console.WriteLine("Activity group with ID \"{0}\" and name \"{1}\" was updated.", + updatedActivityGroup.id, updatedActivityGroup.name); + } + } else { + Console.WriteLine("No activity groups were updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ActivityService/CreateActivities.cs b/examples/Dfp/CSharp/v201311/ActivityService/CreateActivities.cs new file mode 100644 index 00000000000..751acb5058e --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ActivityService/CreateActivities.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates new activities. To determine which activities + /// exist, run GetAllActivities.cs. + /// + /// Tags: ActivityService.createActivities + /// + class CreateActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new activities. To determine which activities exist, " + + "run GetAllActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201311.ActivityService); + + // Set the ID of the activity group this activity is associated with. + int activityGroupId = int.Parse(_T("INSERT_ACTIVITY_GROUP_ID_HERE")); + + // Create a daily visits activity. + Activity dailyVisitsActivity = new Activity(); + dailyVisitsActivity.name = "Activity #" + GetTimeStamp(); + dailyVisitsActivity.activityGroupId = activityGroupId; + dailyVisitsActivity.type = ActivityType.DAILY_VISITS; + + // Create a custom activity. + Activity customActivity = new Activity(); + customActivity.name = "Activity #" + GetTimeStamp(); + customActivity.activityGroupId = activityGroupId; + customActivity.type = ActivityType.CUSTOM; + + try { + // Create the activities on the server. + Activity[] activities = activityService.createActivities( + new Activity[] {dailyVisitsActivity, customActivity}); + + // Display results. + if (activities != null) { + foreach (Activity newActivity in activities) { + Console.WriteLine("An activity with ID \"{0}\", name \"{1}\", and type \"{2}\" was " + + "created.\n", newActivity.id, newActivity.name, newActivity.type); + } + } else { + Console.WriteLine("No activities were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create activities. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ActivityService/GetActiveActivities.cs b/examples/Dfp/CSharp/v201311/ActivityService/GetActiveActivities.cs new file mode 100644 index 00000000000..4b467007815 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ActivityService/GetActiveActivities.cs @@ -0,0 +1,95 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; +using Google.Api.Ads.Dfp.Util.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all active activities. To create activities, + /// run CreateActivities.cs. + /// + /// Tags: ActivityService.getActivitiesByStatement + /// + class GetActiveActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active activities. To create activities, run " + + "CreateActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActiveActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201311.ActivityService); + + // Statement parts to help build a statement that only selects active + // activities. + Statement filterStatement = new StatementBuilder(""). + AddValue("status", ActivityStatus.ACTIVE.ToString()). + ToStatement(); + + int offset = 0; + ActivityPage page; + + try { + do { + filterStatement.query = "WHERE status = :status ORDER BY id LIMIT 500 OFFSET " + offset; + + page = activityService.getActivitiesByStatement(filterStatement); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (Activity activity in page.results) { + Console.WriteLine("{0}) Activity with ID \"{1}\", name \"{2}\", and type \"{3}\" " + + "was found.", i, activity.id, activity.name, activity.type); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}.", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get activities. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ActivityService/GetAllActivities.cs b/examples/Dfp/CSharp/v201311/ActivityService/GetAllActivities.cs new file mode 100644 index 00000000000..1baf3949058 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ActivityService/GetAllActivities.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; +using Google.Api.Ads.Dfp.Util.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all activities. To create activities, run + /// CreateActivities.cs. + /// + /// Tags: ActivityService.getActivitiesByStatement + /// + class GetAllActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all activities. To create activities, run " + + "CreateActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201311.ActivityService); + + int totalResultsCounter = 0; + + try { + Statement filterStatement = new StatementBuilder("").ToStatement(); + + ActivityPage page = new ActivityPage(); + int offset = 0; + + do { + filterStatement.query = "ORDER BY id LIMIT 500 OFFSET " + offset; + // Get activities by statement. + page = activityService.getActivitiesByStatement(filterStatement); + + // Display results. + if (page.results != null) { + foreach (Activity activity in page.results) { + Console.WriteLine("{0}) Activity with ID \"{1}\", name \"{2}\" and type \"{3}\" " + + "was found.\n", totalResultsCounter, activity.id, activity.name, + activity.type); + totalResultsCounter++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}.", totalResultsCounter); + } catch (Exception ex) { + Console.WriteLine("Failed to get contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ActivityService/UpdateActivities.cs b/examples/Dfp/CSharp/v201311/ActivityService/UpdateActivities.cs new file mode 100644 index 00000000000..84f5bce05d7 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ActivityService/UpdateActivities.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; +using Google.Api.Ads.Dfp.Util.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example updates activity expected URLs. To determine which + /// activities exist, run GetAllActivities.cs. + /// + /// Tags: ActivityService.getActivity + /// Tags: ActivityService.updateActivities + /// + class UpdateActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates activity expected URLs. To determine which activities " + + "exist, run GetAllActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201311.ActivityService); + + // Set the ID of the activity to update. + int activityId = int.Parse(_T("INSERT_ACTIVITY_ID_HERE")); + + try { + // Get the activity. + Activity activity = activityService.getActivity(activityId); + + // Update the expected URL. + activity.expectedURL = "https://www.google.com"; + + // Update the activity on the server. + Activity[] activities = activityService.updateActivities(new Activity[] {activity}); + + // Display results. + if (activities != null) { + foreach (Activity updatedActivity in activities) { + Console.WriteLine("Activity with ID \"{0}\" and name \"{1}\" was updated.", + updatedActivity.id, updatedActivity.name); + } + } else { + Console.WriteLine("No activities were updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update activities. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/AudienceSegmentService/CreateAudienceSegments.cs b/examples/Dfp/CSharp/v201311/AudienceSegmentService/CreateAudienceSegments.cs new file mode 100644 index 00000000000..6d3094ab8f2 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/AudienceSegmentService/CreateAudienceSegments.cs @@ -0,0 +1,121 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates new rule based first party audience segments. To + /// determine which audience segments exist, run GetAllAudienceSegments.cs. + /// + /// Tags: AudienceSegmentService.createAudienceSegments + /// + class CreateAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new rule based first party audience segments. To " + + "determine which audience segments exist, run GetAllAudienceSegments.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = (AudienceSegmentService) user.GetService( + DfpService.v201311.AudienceSegmentService); + + // Get the NetworkService. + NetworkService networkService = (NetworkService) user.GetService( + DfpService.v201311.NetworkService); + + long customTargetingKeyId = long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + long customTargetingValueId = long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE")); + + try { + // Get the root ad unit ID used to target the whole site. + String rootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + + // Create ad unit targeting for the root ad unit (i.e. the whole network). + AdUnitTargeting adUnitTargeting = new AdUnitTargeting(); + adUnitTargeting.adUnitId = rootAdUnitId; + adUnitTargeting.includeDescendants = true; + + inventoryTargeting.targetedAdUnits = new AdUnitTargeting[] {adUnitTargeting}; + + // Create the custom criteria to be used in the segment rule. + // CUSTOM_TARGETING_KEY_ID == CUSTOM_TARGETING_VALUE_ID + CustomCriteria customCriteria = new CustomCriteria(); + customCriteria.keyId = customTargetingKeyId; + customCriteria.@operator = CustomCriteriaComparisonOperator.IS; + customCriteria.valueIds = new long[] {customTargetingValueId}; + + // Create the custom criteria expression. + CustomCriteriaSet topCustomCriteriaSet = new CustomCriteriaSet(); + topCustomCriteriaSet.logicalOperator = CustomCriteriaSetLogicalOperator.AND; + topCustomCriteriaSet.children = new CustomCriteriaNode[] {customCriteria}; + + // Create the audience segment rule. + FirstPartyAudienceSegmentRule rule = new FirstPartyAudienceSegmentRule(); + rule.inventoryRule = inventoryTargeting; + rule.customCriteriaRule = topCustomCriteriaSet; + + // Create an audience segment. + RuleBasedFirstPartyAudienceSegment audienceSegment = + new RuleBasedFirstPartyAudienceSegment(); + audienceSegment.name = "Sports enthusiasts audience segment #" + this.GetTimeStamp(); + audienceSegment.description = "Sports enthusiasts between the ages of 20 and 30."; + audienceSegment.pageViews = 6; + audienceSegment.recencyDays = 6; + audienceSegment.membershipExpirationDays = 88; + audienceSegment.rule = rule; + + // Create the audience segment on the server. + AudienceSegment[] audienceSegments = audienceSegmentService.createAudienceSegments( + new FirstPartyAudienceSegment[] {audienceSegment}); + + foreach (AudienceSegment createdAudienceSegment in audienceSegments) { + Console.WriteLine("An audience segment with ID \"{0}\", name \"{1}\", and type \"{2}\" " + + "was created.", createdAudienceSegment.id, createdAudienceSegment.name, + createdAudienceSegment.type); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get audience segment. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/AudienceSegmentService/GetAllAudienceSegments.cs b/examples/Dfp/CSharp/v201311/AudienceSegmentService/GetAllAudienceSegments.cs new file mode 100644 index 00000000000..c952952c10a --- /dev/null +++ b/examples/Dfp/CSharp/v201311/AudienceSegmentService/GetAllAudienceSegments.cs @@ -0,0 +1,90 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all audience segments.To create audience segments, + /// run CreateAudienceSegments.cs. + /// + /// Tags: AudienceSegmentService.getAudienceSegmentsByStatement + /// + class GetAllAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all audience segments. To create audience segments, run " + + "CreateAudienceSegments.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = + (AudienceSegmentService) user.GetService(DfpService.v201311.AudienceSegmentService); + + // Set defaults for page and Statement. + AudienceSegmentPage page = new AudienceSegmentPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all audience segments. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get audience segment by Statement. + page = audienceSegmentService.getAudienceSegmentsByStatement(statement); + + // Display results. + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AudienceSegment segment in page.results) { + Console.WriteLine("{0}) 'Audience segment with id \"{1}\" and name \"{2}\" of " + + "size {3} was found.", i, segment.id, segment.name, segment.size); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get audience segment. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/AudienceSegmentService/GetFirstPartyAudienceSegments.cs b/examples/Dfp/CSharp/v201311/AudienceSegmentService/GetFirstPartyAudienceSegments.cs new file mode 100644 index 00000000000..3ee5e714436 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/AudienceSegmentService/GetFirstPartyAudienceSegments.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using Google.Api.Ads.Dfp.Util.v201311; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all first party audience segments. To create first + /// party audience segments, run CreateAudienceSegments.cs. + /// + /// Tags: AudienceSegmentService.getAudienceSegmentsByStatement + /// + class GetFirstPartyAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all first party audience segments. To create first " + + "party audience segments, run CreateAudienceSegments.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetFirstPartyAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = + (AudienceSegmentService) user.GetService(DfpService.v201311.AudienceSegmentService); + + // Create a statement to only select first party audience segments. + string statementText = "where type = :type order by id ASC LIMIT 500"; + Statement statement = new StatementBuilder(statementText). + AddValue("type", "FIRST_PARTY").ToStatement(); + // Set defaults for page and Statement. + AudienceSegmentPage page = new AudienceSegmentPage(); + int offset = 0; + + try { + do { + // Create a Statement to get all first party audience segments. + statement.query = statementText + " OFFSET " + offset; + + // Get audience segment by Statement. + page = audienceSegmentService.getAudienceSegmentsByStatement(statement); + + // Display results. + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AudienceSegment segment in page.results) { + Console.WriteLine("{0}) 'Audience segment with id \"{1}\" and name \"{2}\" of " + + "size {3} was found.", i, segment.id, segment.name, segment.size); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get audience segment. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/AudienceSegmentService/PopulateFirstPartyAudienceSegments.cs b/examples/Dfp/CSharp/v201311/AudienceSegmentService/PopulateFirstPartyAudienceSegments.cs new file mode 100644 index 00000000000..5a713cd60b8 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/AudienceSegmentService/PopulateFirstPartyAudienceSegments.cs @@ -0,0 +1,98 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using Google.Api.Ads.Dfp.Util.v201311; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example populates a specific rule base first party audience + /// segment. To determine which audience segments exist, run + /// GetAllAudienceSegments.cs. + /// + /// Tags: AudienceSegmentService.getAudienceSegmentsByStatement + /// Tags: AudienceSegmentService.performAudienceSegmentAction + /// + class PopulateFirstPartyAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example populates a specific rule base first party audience segment. " + + "To determine which audience segments exist, run GetAllAudienceSegments.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new PopulateFirstPartyAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = + (AudienceSegmentService) user.GetService(DfpService.v201311.AudienceSegmentService); + + long audienceSegmentId = long.Parse(_T("INSERT_AUDIENCE_SEGMENT_ID_HERE")); + + // Create a statement to only select a specified first party audience + // segment. + string statementText = "where id = :audienceSegmentId order by id ASC " + + "LIMIT 1"; + Statement statement = new StatementBuilder(statementText) + .AddValue("audienceSegmentId", audienceSegmentId) + .ToStatement(); + + try { + // Get audience segment by Statement. + AudienceSegment audienceSegment = + audienceSegmentService.getAudienceSegmentsByStatement(statement).results[0]; + + Console.WriteLine("Audience segment with id \"{0}\" and name \"{1}\" " + + "will be populated", audienceSegment.id, audienceSegment.name); + // Create action. + PopulateAudienceSegments action = new PopulateAudienceSegments(); + statement.query = statementText; + + // Perform action. + UpdateResult result = audienceSegmentService.performAudienceSegmentAction( + action, statement); + + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of audience segments populated: {0}", result.numChanges); + } else { + Console.WriteLine("No audience segments were populated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to populate audience segment. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/AudienceSegmentService/UpdateAudienceSegments.cs b/examples/Dfp/CSharp/v201311/AudienceSegmentService/UpdateAudienceSegments.cs new file mode 100644 index 00000000000..1bb30588ca3 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/AudienceSegmentService/UpdateAudienceSegments.cs @@ -0,0 +1,97 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using Google.Api.Ads.Dfp.Util.v201311; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example updates a first party audience segment's member + /// expiration days. To determine which first party audience segments exist, + /// run GetFirstPartyAudienceSegments.cs. + /// + /// Tags: AudienceSegmentService.getAudienceSegmentsByStatement + /// Tags: AudienceSegmentService.updateAudienceSegments + /// + class UpdateAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a first party audience segment's member expiration " + + "days. To determine which first party audience segments exist, " + + "run GetFirstPartyAudienceSegments.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = + (AudienceSegmentService) user.GetService(DfpService.v201311.AudienceSegmentService); + + string audienceSegmentId = _T("INSERT_AUDIENCE_SEGMENT_ID_HERE"); + + // Create a statement to only select a specified first party audience + // segment. + string statementText = "where id = :audienceSegmentId order by id ASC " + + "LIMIT 1"; + Statement statement = new StatementBuilder(statementText) + .AddValue("audienceSegmentId", audienceSegmentId) + .ToStatement(); + + try { + // Get the audience segment. + RuleBasedFirstPartyAudienceSegment audienceSegment = + (RuleBasedFirstPartyAudienceSegment) audienceSegmentService + .getAudienceSegmentsByStatement(statement).results[0]; + + // Update the member expiration days. + audienceSegment.membershipExpirationDays = 180; + + // Update the audience segment on the server. + AudienceSegment[] audienceSegments = audienceSegmentService.updateAudienceSegments( + new FirstPartyAudienceSegment[] {audienceSegment}); + + foreach (AudienceSegment updatedAudienceSegment in audienceSegments) { + Console.WriteLine( + "Audience segment with ID \"{0}\" and name \"{1}\" was updated.\n", + updatedAudienceSegment.id, updatedAudienceSegment.name); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update audience segment. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CompanyService/CreateCompanies.cs b/examples/Dfp/CSharp/v201311/CompanyService/CreateCompanies.cs new file mode 100644 index 00000000000..9787a300da3 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CompanyService/CreateCompanies.cs @@ -0,0 +1,86 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates new companies. To determine which companies + /// exist, run GetAllCompanies.cs. + /// + /// Tags: CompanyService.createCompanies + /// + class CreateCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new companies. To determine which companies exist, " + + "run GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201311.CompanyService); + + // Create an array to store local company objects. + Company[] companies = new Company[5]; + + for (int i = 0; i < 5; i++) { + Company company = new Company(); + company.name = string.Format("Advertiser #{0}", i); + company.type = CompanyType.ADVERTISER; + companies[i] = company; + } + + try { + // Create the companies on the server. + companies = companyService.createCompanies(companies); + + if (companies != null && companies.Length > 0) { + foreach (Company company in companies) { + Console.WriteLine("A company with ID = '{0}', name = '{1}' and type = '{2}' was" + + " created.", company.id, company.name, company.type); + } + } else { + Console.WriteLine("No companies created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create company. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CompanyService/GetAllCompanies.cs b/examples/Dfp/CSharp/v201311/CompanyService/GetAllCompanies.cs new file mode 100644 index 00000000000..b490b73beb4 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CompanyService/GetAllCompanies.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all companies. To create companies, run + /// CreateCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement + /// + class GetAllCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all companies. To create companies, run CreateCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201311.CompanyService); + + // Set defaults for page and Statement. + CompanyPage page = new CompanyPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all companies. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get companies by Statement. + page = companyService.getCompaniesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Company company in page.results) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", + i, company.id, company.name, company.type); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CompanyService/GetCompaniesByStatement.cs b/examples/Dfp/CSharp/v201311/CompanyService/GetCompaniesByStatement.cs new file mode 100644 index 00000000000..63c2e46572f --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CompanyService/GetCompaniesByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all companies that are advertisers. The Statement + /// retrieves up to the maximum page size limit of 500. To create companies, + /// run CreateCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement + /// + class GetCompaniesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all companies that are advertisers. The Statement " + + "retrieves up to the maximum page size limit of 500. To create companies, run " + + "CreateCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCompaniesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201311.CompanyService); + + // Create a Statement to only select companies that are advertisers sorted + // by name. + Statement statement = new StatementBuilder("WHERE type = :advertiser ORDER BY name " + + "LIMIT 500").AddValue("advertiser", CompanyType.ADVERTISER.ToString()).ToStatement(); + + try { + // Get companies by Statement. + CompanyPage page = companyService.getCompaniesByStatement(statement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Company company in page.results) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", + i, company.id, company.name, company.type); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CompanyService/GetCompany.cs b/examples/Dfp/CSharp/v201311/CompanyService/GetCompany.cs new file mode 100644 index 00000000000..b034068c8c2 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CompanyService/GetCompany.cs @@ -0,0 +1,77 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets a company by its ID. To determine which companies + /// exist, run GetAllCompanies.cs. + /// + /// Tags: CompanyService.getCompany + /// + class GetCompany : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a company by its ID. To determine which companies " + + "exist, run GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCompany(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201311.CompanyService); + + // Set the ID of the company to get. + long companyId = long.Parse(_T("INSERT_COMPANY_ID_HERE")); + + try { + // Get the company. + Company company = companyService.getCompany(companyId); + + if (company != null) { + Console.WriteLine("Company with ID = {0}, name = {1} and type = {2} was found", + company.id, company.name, company.type); + } else { + Console.WriteLine("No company found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get company. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CompanyService/UpdateCompanies.cs b/examples/Dfp/CSharp/v201311/CompanyService/UpdateCompanies.cs new file mode 100644 index 00000000000..3a4485b1f32 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CompanyService/UpdateCompanies.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example updates the names of all companies that are advertisers + /// by appending "LLC." up to the first 500. To determine which companies + /// exist, run GetAllCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement, CompanyService.updateCompanies + /// + class UpdateCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the names of all companies that are advertisers by " + + "appending 'LLC.' up to the first 500. To determine which companies exist, run " + + "GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201311.CompanyService); + + // Create a Statement to only select companies that are advertisers. + Statement statement = new StatementBuilder("WHERE type = :advertiser LIMIT 500").AddValue( + "advertiser", CompanyType.ADVERTISER.ToString()).ToStatement(); + + try { + // Get the companies by Statement. + CompanyPage page = companyService.getCompaniesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + Company[] companies = page.results; + + // Update each local company object by appending LLC. to its name. + foreach (Company company in companies) { + company.name = company.name + " LLC."; + } + + // Update the companies on the server. + companies = companyService.updateCompanies(companies); + + if (companies != null && companies.Length > 0) { + int i = 0; + foreach (Company company in companies) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} was updated", + i, company.id, company.name, company.type); + i++; + } + } else { + Console.WriteLine("No companies updated."); + } + } else { + Console.WriteLine("No companies found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ContactService/CreateContacts.cs b/examples/Dfp/CSharp/v201311/ContactService/CreateContacts.cs new file mode 100644 index 00000000000..a5cb9217326 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ContactService/CreateContacts.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates new contacts. To determine which contacts exist, + /// run GetAllContacts.cs. + /// + /// Tags: ContactService.createContacts + /// + class CreateContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new contacts. To determine which contacts exist, " + + "run GetAllContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201311.ContactService); + + // Set the IDs of the companies for the contacts. + long advertiserCompanyId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + long agencyCompanyId = long.Parse(_T("INSERT_AGENCY_COMPANY_ID_HERE")); + + // Create an advertiser contact. + Contact advertiserContact = new Contact(); + advertiserContact.name = "Mr. Advertiser #" + GetTimeStamp(); + advertiserContact.email = "advertiser@advertising.com"; + advertiserContact.companyId = advertiserCompanyId; + + // Create an agency contact. + Contact agencyContact = new Contact(); + agencyContact.name = "Ms. Agency #" + GetTimeStamp(); + agencyContact.email = "agency@agencies.com"; + agencyContact.companyId = agencyCompanyId; + + try { + // Create the contacts on the server. + Contact[] contacts = + contactService.createContacts(new Contact[] {advertiserContact, agencyContact}); + + foreach (Contact contact in contacts) { + Console.WriteLine("A contact with ID \"{0}\" and name \"{1}\" was created.", + contact.id, contact.name); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ContactService/GetAllContacts.cs b/examples/Dfp/CSharp/v201311/ContactService/GetAllContacts.cs new file mode 100644 index 00000000000..b3fe536d2b7 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ContactService/GetAllContacts.cs @@ -0,0 +1,90 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; +using Google.Api.Ads.Dfp.Util.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all contacts. To create contacts, run + /// CreateContacts.cs. + /// + /// Tags: ContactService.getContactsByStatement + /// + class GetAllContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all contacts. To create contacts, run CreateContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201311.ContactService); + + Statement filterStatement = new Statement(); + + // Set defaults for page and filterStatement. + ContactPage page = new ContactPage(); + int offset = 0; + + try { + do { + // Create a statement to get all contacts. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get contacts by statement. + page = contactService.getContactsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Contact contact in page.results) { + Console.WriteLine("{0}) Contact with ID \"{1}\" and name \"{2}\" was found.", + i, contact.id, contact.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ContactService/GetUninvitedContacts.cs b/examples/Dfp/CSharp/v201311/ContactService/GetUninvitedContacts.cs new file mode 100644 index 00000000000..a48ab85f78f --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ContactService/GetUninvitedContacts.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; +using Google.Api.Ads.Dfp.Util.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all contacts that aren't invited yet. To create + /// contacts, run CreateContacts.cs. + /// + /// Tags: ContactService.getContactsByStatement + /// + class GetUninvitedContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all contacts that aren't invited yet. To create " + + "contacts, run CreateContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUninvitedContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201311.ContactService); + + Statement filterStatement = new StatementBuilder("").AddValue( + "status", ContactStatus.UNINVITED.ToString()).ToStatement(); + + // Set defaults for page and filterStatement. + ContactPage page = new ContactPage(); + int offset = 0; + + try { + do { + // Create a statement to get all contacts. + filterStatement.query = "where status = :status LIMIT 500 OFFSET " + offset.ToString(); + + // Get contacts by statement. + page = contactService.getContactsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Contact contact in page.results) { + Console.WriteLine("{0}) Contact with ID \"{1}\" and name \"{2}\" was found.", + i, contact.id, contact.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ContactService/UpdateContacts.cs b/examples/Dfp/CSharp/v201311/ContactService/UpdateContacts.cs new file mode 100644 index 00000000000..31f6d51ebfe --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ContactService/UpdateContacts.cs @@ -0,0 +1,83 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; +using Google.Api.Ads.Dfp.Util.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example updates contact addresses. To determine which contacts + /// exist, run GetAllContacts.cs. + /// + /// Tags: ContactService.updateContacts + /// + class UpdateContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates contact comments. To determine which contacts " + + "exist, run GetAllContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201311.ContactService); + + // Set the ID of the contact to update. + long contactId = long.Parse(_T("INSERT_CONTACT_ID_HERE")); + + try { + // Get the contact. + Contact contact = contactService.getContact(contactId); + + // Update the address of the contact. + contact.address = "123 New Street, New York, NY, 10011"; + + // Update the contact on the server. + Contact[] contacts = contactService.updateContacts(new Contact[] {contact}); + + // Display results. + foreach (Contact updatedContact in contacts) { + Console.WriteLine("Contact with ID \"{0}\", name \"{1}\", and comment \"{2}\" was " + + "updated.", updatedContact.id, updatedContact.name, updatedContact.comment); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ContentService/GetAllContent.cs b/examples/Dfp/CSharp/v201311/ContentService/GetAllContent.cs new file mode 100644 index 00000000000..ddc4c277705 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ContentService/GetAllContent.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all content. This feature is only available to DFP + /// premium solution networks. + /// + /// Tags: ContentService.getContentByStatement + /// + class GetAllContent : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all content. This feature is only available to DFP " + + "premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllContent(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContentService. + ContentService contentService = + (ContentService) user.GetService(DfpService.v201311.ContentService); + + // Set defaults for page and filterStatement. + ContentPage page = new ContentPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all content. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get content by statement. + page = contentService.getContentByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Content content in page.results) { + Console.WriteLine("{0}) Content with ID \"{1}\", name \"{2}\", and status \"{3}\" " + + "was found.", i, content.id, content.name, content.status); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all content. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ContentService/GetContentByCategory.cs b/examples/Dfp/CSharp/v201311/ContentService/GetContentByCategory.cs new file mode 100644 index 00000000000..32511ad7da9 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ContentService/GetContentByCategory.cs @@ -0,0 +1,123 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using Google.Api.Ads.Dfp.Util.v201311; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all active content categorized as "comedy" using + /// the network's content browse custom targeting key. This feature is only + /// available to DFP video publishers. + /// + /// Tags: NetworkService.getCurrentNetwork + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// Tags: ContentService.getContentByStatementAndCustomTargetingValue + /// /// + class GetContentByCategory : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active content categorized as 'comedy' using the " + + "network's content browse custom targeting key. This feature is only available to " + + "DFP video publishers."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetContentByCategory(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContentService. + ContentService contentService = + (ContentService) user.GetService(DfpService.v201311.ContentService); + + // Get the NetworkService. + NetworkService networkService = (NetworkService) user.GetService( + DfpService.v201311.NetworkService); + + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = (CustomTargetingService) user.GetService( + DfpService.v201311.CustomTargetingService); + + try { + // Get content browse custom targeting key ID. + long contentBrowseCustomTargetingKeyId = + networkService.getCurrentNetwork().contentBrowseCustomTargetingKeyId; + + // Create a statement to select the categories matching the name comedy. + Statement categoryFilterStatement = new StatementBuilder( + "WHERE customTargetingKeyId = :contentBrowseCustomTargetingKeyId " + + " and name = :category LIMIT 1") + .AddValue("contentBrowseCustomTargetingKeyId", contentBrowseCustomTargetingKeyId) + .AddValue("category", "comedy").ToStatement(); + + // Get categories matching the filter statement. + CustomTargetingValuePage customTargetingValuePage = + customTargetingService.getCustomTargetingValuesByStatement(categoryFilterStatement); + + if (customTargetingValuePage.results != null) { + // Get the custom targeting value ID for the comedy category. + long categoryCustomTargetingValueId = customTargetingValuePage.results[0].id; + + // Set defaults for page and filterStatement. + ContentPage page = new ContentPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + do { + // Create a statement to get all active content. + filterStatement.query = "WHERE status = 'ACTIVE' LIMIT 500 OFFSET " + offset.ToString(); + + // Get content by statement. + page = contentService.getContentByStatementAndCustomTargetingValue(filterStatement, + categoryCustomTargetingValueId); + + if (page.results != null) { + int i = page.startIndex; + foreach (Content content in page.results) { + Console.WriteLine("{0}) Content with ID \"{1}\", name \"{2}\", and status " + + "\"{3}\" was found.", i, content.id, content.name, content.status); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get content by category. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CreativeService/CopyImageCreatives.cs b/examples/Dfp/CSharp/v201311/CreativeService/CopyImageCreatives.cs new file mode 100644 index 00000000000..cd24af8d117 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CreativeService/CopyImageCreatives.cs @@ -0,0 +1,127 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example copies a given set of image creatives. This would + /// typically be done to reuse creatives in a small business network. To + /// determine which creatives exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// Tags: CreativeService.createCreatives + /// + class CopyImageCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example copies a given set of image creatives. This would typically be" + + " done to reuse creatives in a small business network. To determine which creatives " + + "exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CopyImageCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201311.CreativeService); + + long[] creativeIds = new long[] {long.Parse(_T("INSERT_IMAGE_CREATIVE_ID_HERE"))}; + + // Build a comma separated list of creativeIds. Note that if you are using + // .NET 4.0 or above, you could use the newly introduced + // String.Join(string separator, IEnumerable values) method to + // perform this task. + string[] creativeIdTexts = new string[creativeIds.Length]; + for (int i = 0; i < creativeIdTexts.Length; i++) { + creativeIdTexts[i] = creativeIds[i].ToString(); + } + + string commaSeparatedCreativeIds = string.Join(",", creativeIdTexts); + + // Create the statement to filter image creatives by id. + Statement statement = new StatementBuilder( + string.Format("WHERE id IN ({0}) and creativeType = :creativeType LIMIT 500", + commaSeparatedCreativeIds)).AddValue("creativeType", "ImageCreative"). + ToStatement(); + + try { + // Retrieve all creatives which match. + CreativePage page = creativeService.getCreativesByStatement(statement); + + if (page.results != null) { + Creative[] creatives = page.results; + long[] oldIds = new long[creatives.Length]; + for (int i = 0; i < creatives.Length; i++) { + ImageCreative imageCreative = (ImageCreative) creatives[i]; + oldIds[i] = imageCreative.id; + // Since we cannot set id to null, we mark it as not specified. + imageCreative.idSpecified = false; + + imageCreative.advertiserId = imageCreative.advertiserId; + imageCreative.name = imageCreative.name + " (Copy #" + GetTimeStamp() + ")"; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + imageCreative.primaryImageAsset.assetUrl); + + creativeAsset.size = imageCreative.primaryImageAsset.size; + imageCreative.primaryImageAsset = creativeAsset; + + creatives[i] = imageCreative; + } + + // Create the copied creative. + creatives = creativeService.createCreatives(creatives); + + // Display copied creatives. + for (int i = 0; i < creatives.Length; i++) { + Console.WriteLine("Image creative with ID \"{0}\" copied to ID \"{1}\".", oldIds[i], + creatives[i].id); + } + } else { + Console.WriteLine("No creatives were copied."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to copy creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CreativeService/CreateCreativeFromTemplate.cs b/examples/Dfp/CSharp/v201311/CreativeService/CreateCreativeFromTemplate.cs new file mode 100644 index 00000000000..78a3bcea541 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CreativeService/CreateCreativeFromTemplate.cs @@ -0,0 +1,138 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates a new template creative for a given advertiser. + /// To determine which companies are advertisers, run + /// GetCompaniesByStatement.cs. To determine which creatives already exist, + /// run GetAllCreatives.cs. To determine which creative templates exist, run + /// GetAllCreativeTemplates.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCreativeFromTemplate : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new template creative for a given advertiser. To " + + "determine which companies are advertisers, run GetCompaniesByStatement.cs. To " + + "determine which creatives already exist, run GetAllCreatives.cs. To determine " + + "which creative templates exist, run GetAllCreativeTemplates.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreativeFromTemplate(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201311.CreativeService); + + // Set the ID of the advertiser (company) that all creative will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Use the image banner with optional third party tracking template. + long creativeTemplateId = 10000680L; + + // Create the local custom creative object. + TemplateCreative templateCreative = new TemplateCreative(); + templateCreative.name = "Template creative"; + templateCreative.advertiserId = advertiserId; + templateCreative.creativeTemplateId = creativeTemplateId; + + // Set the creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + templateCreative.size = size; + + // Create the asset variable value. + AssetCreativeTemplateVariableValue assetVariableValue = + new AssetCreativeTemplateVariableValue(); + assetVariableValue.uniqueName = "Imagefile"; + assetVariableValue.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + assetVariableValue.fileName = String.Format("image{0}.jpg", this.GetTimeStamp()); + + // Create the image width variable value. + LongCreativeTemplateVariableValue imageWidthVariableValue = + new LongCreativeTemplateVariableValue(); + imageWidthVariableValue.uniqueName = "Imagewidth"; + imageWidthVariableValue.value = 300; + + // Create the image height variable value. + LongCreativeTemplateVariableValue imageHeightVariableValue = + new LongCreativeTemplateVariableValue(); + imageHeightVariableValue.uniqueName = "Imageheight"; + imageHeightVariableValue.value = 250; + + // Create the URL variable value. + UrlCreativeTemplateVariableValue urlVariableValue = new UrlCreativeTemplateVariableValue(); + urlVariableValue.uniqueName = "ClickthroughURL"; + urlVariableValue.value = "www.google.com"; + + // Create the target window variable value. + StringCreativeTemplateVariableValue targetWindowVariableValue = + new StringCreativeTemplateVariableValue(); + targetWindowVariableValue.uniqueName = "Targetwindow"; + targetWindowVariableValue.value = "_blank"; + + templateCreative.creativeTemplateVariableValues = new BaseCreativeTemplateVariableValue[] { + assetVariableValue, imageWidthVariableValue, imageHeightVariableValue, urlVariableValue, + targetWindowVariableValue}; + + try { + // Create the template creative on the server. + templateCreative = (TemplateCreative) creativeService.createCreative(templateCreative); + + if (templateCreative != null) { + Console.WriteLine("A template creative with ID \"{0}\", name \"{1}\", and type \"{2}\" " + + "was created and can be previewed at {3}", templateCreative.id, templateCreative.name, + templateCreative.CreativeType, templateCreative.previewUrl); + } else { + Console.WriteLine("No creatives were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CreativeService/CreateCreatives.cs b/examples/Dfp/CSharp/v201311/CreativeService/CreateCreatives.cs new file mode 100644 index 00000000000..f9d42887010 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CreativeService/CreateCreatives.cs @@ -0,0 +1,120 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates new image creatives for a given advertiser. To + /// determine which companies are advertisers, run GetCompaniesByStatement.cs. + /// To determine which creatives already exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new image creatives for a given advertiser. To " + + "determine which companies are advertisers, run GetCompaniesByStatement.cs. " + + "To determine which creatives already exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201311.CreativeService); + + // Set the ID of the advertiser (company) that all creatives will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Create an array to store local image creative objects. + Creative[] imageCreatives = new ImageCreative[5]; + + for (int i = 0; i < 5; i++) { + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", i); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + imageCreatives[i] = imageCreative; + } + + try { + // Create the image creatives on the server. + imageCreatives = creativeService.createCreatives(imageCreatives); + + if (imageCreatives != null) { + foreach (Creative creative in imageCreatives) { + // Use "is" operator to determine what type of creative was + // returned. + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + Console.WriteLine("An image creative with ID ='{0}', name ='{1}' and size = " + + "({2},{3}) was created and can be previewed at: {4}", imageCreative.id, + imageCreative.name, imageCreative.size.width, imageCreative.size.height, + imageCreative.previewUrl); + } else { + Console.WriteLine("A creative with ID ='{0}', name='{1}' and type='{2}' was created.", + creative.id, creative.name, creative.CreativeType); + } + } + } else { + Console.WriteLine("No creatives created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CreativeService/CreateCustomCreative.cs b/examples/Dfp/CSharp/v201311/CreativeService/CreateCustomCreative.cs new file mode 100644 index 00000000000..7e30125d592 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CreativeService/CreateCustomCreative.cs @@ -0,0 +1,111 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates a custom creative for a given advertiser. To + /// determine which companies are advertisers, run GetCompaniesByStatement.cs. + /// To determine which creatives already exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCustomCreative : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a custom creative for a given advertiser. To determine " + + "which companies are advertisers, run GetCompaniesByStatement.cs. To determine which " + + "creatives already exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomCreative(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201311.CreativeService); + + // Set the ID of the advertiser (company) that all creatives will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + + // Create the local custom creative object. + CustomCreative customCreative = new CustomCreative(); + customCreative.name = "Custom creative " + GetTimeStamp(); + customCreative.advertiserId = advertiserId; + customCreative.destinationUrl = "http://google.com"; + + // Set the custom creative image asset. + CustomCreativeAsset customCreativeAsset = new CustomCreativeAsset(); + customCreativeAsset.macroName = "IMAGE_ASSET"; + customCreativeAsset.fileName = string.Format("inline{0}.jpg", GetTimeStamp()); + customCreativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + customCreative.customCreativeAssets = new CustomCreativeAsset[] {customCreativeAsset}; + + // Set the HTML snippet using the custom creative asset macro. + customCreative.htmlSnippet = "" + + "" + + "
Click above for great deals!"; + + // Set the creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + customCreative.size = size; + + try { + // Create the custom creative on the server. + customCreative = (CustomCreative) creativeService.createCreative(customCreative); + + if (customCreative != null) { + Console.WriteLine("A custom creative with ID \"{0}\", name \"{1}\", and size ({2}, " + + "{3}) was created and can be previewed at {4}", customCreative.id, + customCreative.name, customCreative.size.width, customCreative.size.height, + customCreative.previewUrl); + } else { + Console.WriteLine("No creative created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CreativeService/GetAllCreatives.cs b/examples/Dfp/CSharp/v201311/CreativeService/GetAllCreatives.cs new file mode 100644 index 00000000000..c87a7f42044 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CreativeService/GetAllCreatives.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all creatives. To create creatives, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// + class GetAllCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all creatives. To create creatives, run CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201311.CreativeService); + + // Set defaults for page and Statement. + CreativePage page = new CreativePage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all creatives. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get creatives by Statement. + page = creativeService.getCreativesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Creative creative in page.results) { + Console.WriteLine("{0}) Creative with ID ='{1}', name ='{2}' and type ='{3}' " + + "was found.", i, creative.id, creative.name, creative.CreativeType); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CreativeService/GetCreative.cs b/examples/Dfp/CSharp/v201311/CreativeService/GetCreative.cs new file mode 100644 index 00000000000..47ad2d383dd --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CreativeService/GetCreative.cs @@ -0,0 +1,77 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets a creative by its ID. To determine which creatives + /// exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.getCreative + /// + class GetCreative : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a creative by its ID. To determine which creatives " + + "exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code sample as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreative(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201311.CreativeService); + + // Set the ID of the creative to get. + long creativeId = long.Parse(_T("INSERT_CREATIVE_ID_HERE")); + + try { + // Get the creative. + Creative creative = creativeService.getCreative(creativeId); + + if (creative != null) { + Console.WriteLine("Creative with ID ='{0}', name ='{1}' and type ='{2}' " + + "was found.", creative.id, creative.name, creative.CreativeType); + } else { + Console.WriteLine("No creative found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get creative. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CreativeService/GetCreativesByStatement.cs b/examples/Dfp/CSharp/v201311/CreativeService/GetCreativesByStatement.cs new file mode 100644 index 00000000000..6a32a924f9d --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CreativeService/GetCreativesByStatement.cs @@ -0,0 +1,86 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all image creatives. The Statement retrieves up to + /// the maximum page size limit of 500. To create an image creative, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// + class GetCreativesByStatement : SampleBase { + /// + /// Returns a description about the sample code. + /// + public override string Description { + get { + return "This code example gets all image creatives. The Statement retrieves up to the " + + "maximum page size limit of 500. To create an image creative, run " + + "CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201311.CreativeService); + + // Create a Statement to only select image creatives. + Statement statement = new StatementBuilder("WHERE creativeType = :creativeType LIMIT 500"). + AddValue("creativeType", "ImageCreative").ToStatement(); + + try { + // Get creatives by Statement. + CreativePage page = creativeService.getCreativesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Creative creative in page.results) { + Console.WriteLine("{0}) Creative with ID ='{1}', name ='{2}' and type ='{3}' " + + "was found.", i, creative.id, creative.name, creative.CreativeType); + i++; + } + } + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get creatives by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CreativeService/UpdateCreatives.cs b/examples/Dfp/CSharp/v201311/CreativeService/UpdateCreatives.cs new file mode 100644 index 00000000000..b528a131b52 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CreativeService/UpdateCreatives.cs @@ -0,0 +1,104 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all image creatives. The Statement retrieves up to + /// the maximum page size limit of 500. To create an image creative, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// Tags: CreativeService.updateCreatives + /// + class UpdateCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all image creatives. The Statement retrieves up to the " + + "maximum page size limit of 500. To create an image creative, run " + + "CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201311.CreativeService); + + // Create a Statement to get all image creatives. + Statement statement = new StatementBuilder("WHERE creativeType = :creativeType LIMIT 500"). + AddValue("creativeType", "ImageCreative").ToStatement(); + + try { + // Get creatives by Statement. + CreativePage page = creativeService.getCreativesByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + Creative[] creatives = page.results; + + // Update each local creative object by changing its destination URL. + foreach (Creative creative in creatives) { + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + imageCreative.destinationUrl = "http://news.google.com"; + } + } + + // Update the creatives on the server. + creatives = creativeService.updateCreatives(creatives); + + if (creatives != null) { + foreach (Creative creative in creatives) { + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + Console.WriteLine("An image creative with ID = '{0}' and destination URL ='{1}' " + + "was updated.", imageCreative.id, imageCreative.destinationUrl); + } + } + } else { + Console.WriteLine("No creatives updated."); + } + } else { + Console.WriteLine("No creatives found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CreativeTemplateService/GetAllCreativeTemplates.cs b/examples/Dfp/CSharp/v201311/CreativeTemplateService/GetAllCreativeTemplates.cs new file mode 100644 index 00000000000..c618e84634c --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CreativeTemplateService/GetAllCreativeTemplates.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all creative templates. + /// + /// Tags: CreativeTemplateService.getCreativeTemplatesByStatement + /// + class GetAllCreativeTemplates : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all creative templates."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreativeTemplates(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201311.CreativeTemplateService); + + // Set defaults for page and filterStatement. + CreativeTemplatePage page = new CreativeTemplatePage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all creative templates. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get creative templates by statement. + page = creativeTemplateService.getCreativeTemplatesByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CreativeTemplate creativeTemplate in page.results) { + Console.WriteLine("{0}) Creative template with ID \"{1}\", name \"{2}\", and type " + + "\"{3}\" was found.", i, creativeTemplate.id, creativeTemplate.name, + creativeTemplate.type); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CreativeTemplateService/GetCreativeTemplate.cs b/examples/Dfp/CSharp/v201311/CreativeTemplateService/GetCreativeTemplate.cs new file mode 100644 index 00000000000..48315edf493 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CreativeTemplateService/GetCreativeTemplate.cs @@ -0,0 +1,87 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets a creative by its ID. To determine which creative + /// templates exist, run GetAllCreativeTemplates.cs. + /// + /// Tags: CreativeTemplateService.getCreativeTemplate + /// + class GetCreativeTemplate : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a creative by its ID. To determine which creative " + + "templates exist, run GetAllCreativeTemplates.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeTemplate(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201311.CreativeTemplateService); + + // Set the ID of the creative template to get. + long creativeTemplateId = long.Parse(_T("INSERT_CREATIVE_TEMPLATE_ID_HERE")); + + try { + // Get the creative template. + CreativeTemplate creativeTemplate = creativeTemplateService.getCreativeTemplate( + creativeTemplateId); + + if (creativeTemplate != null) { + Console.WriteLine("Creative template with ID \"{0}\", name \"{1}\", and type \"{2}\" " + + "was found.", creativeTemplate.id, creativeTemplate.name, creativeTemplate.type); + if (creativeTemplate.variables != null) { + foreach (CreativeTemplateVariable variable in creativeTemplate.variables) { + Console.WriteLine("Variable with name \"{0}\" is {1}.", variable.uniqueName, + variable.isRequired ? "required." : "optional."); + } + } + } else { + Console.WriteLine("No creative template found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CreativeTemplateService/GetCreativeTemplatesByStatement.cs b/examples/Dfp/CSharp/v201311/CreativeTemplateService/GetCreativeTemplatesByStatement.cs new file mode 100644 index 00000000000..ee8b428f924 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CreativeTemplateService/GetCreativeTemplatesByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets up to 500 system defined creative templates. + /// + /// Tags: CreativeTemplateService.getCreativeTemplatesByStatement + /// + class GetCreativeTemplatesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets up to 500 system defined creative templates."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeTemplatesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201311.CreativeTemplateService); + + // Create a statement to only select system defined creative templates. + Statement filterStatement = + new StatementBuilder("WHERE type = :creativeTemplateType LIMIT 500").AddValue( + "creativeTemplateType", CreativeTemplateType.SYSTEM_DEFINED.ToString()).ToStatement(); + + try { + // Get creative templates by statement. + CreativeTemplatePage page = creativeTemplateService.getCreativeTemplatesByStatement( + filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CreativeTemplate creativeTemplate in page.results) { + Console.WriteLine("{0}) Creative template with ID \"{1}\", name \"{2}\", and type " + + "\"{3}\" was found.", i, creativeTemplate.id, creativeTemplate.name, + creativeTemplate.type); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CreativeWrapperService/CreateCreativeWrappers.cs b/examples/Dfp/CSharp/v201311/CreativeWrapperService/CreateCreativeWrappers.cs new file mode 100644 index 00000000000..39a3c020533 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CreativeWrapperService/CreateCreativeWrappers.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates a new creative wrapper. Creative wrappers must + /// be associated with a LabelType.CREATIVE_WRAPPER label and applied to ad + /// units by AdUnit.appliedLabels. To determine which creative wrappers exist, + /// run GetAllCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.createCreativeWrappers + /// + class CreateCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new creative wrapper. Creative wrappers must be " + + "associated with a LabelType.CREATIVE_WRAPPER label and applied to ad units by " + + "AdUnit.appliedLabels. To determine which creative wrappers exist, run " + + "GetAllCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201311.CreativeWrapperService); + + long labelId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE")); + + // Create creative wrapper objects. + CreativeWrapper creativeWrapper = new CreativeWrapper(); + creativeWrapper.labelId = labelId; + creativeWrapper.ordering = CreativeWrapperOrdering.INNER; + creativeWrapper.header = new CreativeWrapperHtmlSnippet(); + creativeWrapper.header.htmlSnippet = "My creative wrapper header"; + creativeWrapper.footer = new CreativeWrapperHtmlSnippet(); + creativeWrapper.footer.htmlSnippet = "My creative wrapper footer"; + + try { + // Add creative wrapper. + CreativeWrapper[] creativeWrappers = creativeWrapperService.createCreativeWrappers( + new CreativeWrapper[] {creativeWrapper}); + + // Display results. + foreach (CreativeWrapper wrapper in creativeWrappers) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' was " + + "created.", wrapper.id, wrapper.labelId); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creative wrappers. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CreativeWrapperService/DeactivateCreativeWrappers.cs b/examples/Dfp/CSharp/v201311/CreativeWrapperService/DeactivateCreativeWrappers.cs new file mode 100644 index 00000000000..f3bdc276da0 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CreativeWrapperService/DeactivateCreativeWrappers.cs @@ -0,0 +1,95 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using Google.Api.Ads.Dfp.Util.v201311; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example deactivates a creative wrapper belonging to a label. + /// + /// Tags: CreativeWrapperService.getCreativeWrapperByStatement + /// Tags: CreativeWrapperService.performCreativeWrapperAction + /// + class DeActivateCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates a creative wrapper belonging to a label."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeActivateCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201311.CreativeWrapperService); + + long labelId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE")); + + try { + // Create a query to select the active creative wrapper for the given + // label. + Statement statement = new StatementBuilder("WHERE status = :status AND labelId = :labelId") + .AddValue("labelId", labelId) + .AddValue("status", CreativeWrapperStatus.ACTIVE.ToString()) + .ToStatement(); + CreativeWrapperPage page = creativeWrapperService.getCreativeWrappersByStatement(statement); + CreativeWrapper[] creativeWrappers = page.results; + if (creativeWrappers != null) { + foreach (CreativeWrapper wrapper in creativeWrappers) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' with " + + "status \'{2}\' will be deactivated.", wrapper.id, wrapper.labelId, wrapper.status); + } + Console.WriteLine("Number of creative wrappers to be deactivated: {0}", + creativeWrappers.Length); + + // Perform action. + CreativeWrapperAction action = new DeactivateCreativeWrappers(); + UpdateResult result = + creativeWrapperService.performCreativeWrapperAction(action, statement); + + // Display results. + if (result.numChanges > 0) { + Console.WriteLine("Number of creative wrappers deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No creative wrappers were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creative wrappers. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CreativeWrapperService/GetActiveCreativeWrappers.cs b/examples/Dfp/CSharp/v201311/CreativeWrapperService/GetActiveCreativeWrappers.cs new file mode 100644 index 00000000000..0a293998251 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CreativeWrapperService/GetActiveCreativeWrappers.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using Google.Api.Ads.Dfp.Util.v201311; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all active creative wrappers. To create + /// creative wrappers, run CreateCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.getCreativeWrapperByStatement + /// + class GetActiveCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active creative wrappers. To create creative " + + "wrappers, run CreateCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActiveCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201311.CreativeWrapperService); + + // Set defaults for page and Statement. + CreativeWrapperPage page = new CreativeWrapperPage(); + Statement statement = new StatementBuilder("") + .AddValue("status", CreativeWrapperStatus.ACTIVE.ToString()) + .ToStatement(); + int offset = 0; + + try { + do { + // Create a Statement to get all active creative wrappers. + statement.query = string.Format("WHERE status = :status LIMIT 500 OFFSET {0}", offset); + + // Get creative wrappers by Statement. + page = creativeWrapperService.getCreativeWrappersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (CreativeWrapper wrapper in page.results) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' with " + + "status \'{2}\' was found.", wrapper.id, wrapper.labelId, wrapper.status); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get active creative wrappers. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CreativeWrapperService/GetAllCreativeWrappers.cs b/examples/Dfp/CSharp/v201311/CreativeWrapperService/GetAllCreativeWrappers.cs new file mode 100644 index 00000000000..4ad97a7c069 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CreativeWrapperService/GetAllCreativeWrappers.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using Google.Api.Ads.Dfp.Util.v201311; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all creative wrappers. To create creative wrappers, + /// run CreateCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.getCreativeWrapperByStatement + /// + class GetAllCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active creative wrappers. To create creative " + + "wrappers, run CreateCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201311.CreativeWrapperService); + + // Set defaults for page and Statement. + CreativeWrapperPage page = new CreativeWrapperPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all creative wrappers. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get creative wrappers by Statement. + page = creativeWrapperService.getCreativeWrappersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (CreativeWrapper wrapper in page.results) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' with " + + "status \'{2}\' was found.", wrapper.id, wrapper.labelId, wrapper.status); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get active creative wrappers. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CreativeWrapperService/UpdateCreativeWrappers.cs b/examples/Dfp/CSharp/v201311/CreativeWrapperService/UpdateCreativeWrappers.cs new file mode 100644 index 00000000000..f4984e16862 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CreativeWrapperService/UpdateCreativeWrappers.cs @@ -0,0 +1,84 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using Google.Api.Ads.Dfp.Util.v201311; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example updates a creative wrapper to the 'OUTER' wrapping + /// order. To determine which creative wrappers exist, run + /// GetAllCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.getCreativeWrapper + /// Tags: CreativeWrapperService.updateCreativeWrappers + /// + class UpdateCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active creative wrappers. To create creative " + + "wrappers, run CreateCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201311.CreativeWrapperService); + + long creativeWrapperId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_ID_HERE")); + + try { + CreativeWrapper wrapper = creativeWrapperService.getCreativeWrapper(creativeWrapperId); + if (wrapper != null) { + wrapper.ordering = CreativeWrapperOrdering.OUTER; + // Update the creative wrappers on the server. + CreativeWrapper[] creativeWrappers = creativeWrapperService.updateCreativeWrappers( + new CreativeWrapper[] {wrapper}); + + // Display results. + Console.WriteLine("Creative wrapper with ID '{0}' and wrapping order '{1}' was " + + "updated.", creativeWrappers[0].id, creativeWrappers[0].ordering); + } else { + Console.WriteLine("No creative wrappers found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update creative wrappers. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CustomFieldService/CreateCustomFieldOptions.cs b/examples/Dfp/CSharp/v201311/CustomFieldService/CreateCustomFieldOptions.cs new file mode 100644 index 00000000000..131cd7e1d41 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CustomFieldService/CreateCustomFieldOptions.cs @@ -0,0 +1,97 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates custom field options for a drop-down custom + /// field. Once created, custom field options can be found under the options + /// fields of the drop-down custom field and they cannot be deleted. To + /// determine which custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.createCustomFieldOptions + /// + class CreateCustomFieldOptions : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates custom field options for a drop-down custom field. " + + "Once created, custom field options can be found under the options fields of the " + + "drop-down custom field and they cannot be deleted. To determine which custom " + + "fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomFieldOptions(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = + (CustomFieldService) user.GetService(DfpService.v201311.CustomFieldService); + + // Set the ID of the drop-down custom field to create options for. + long customFieldId = long.Parse(_T("INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE")); + + // Create custom field options. + CustomFieldOption customFieldOption1 = new CustomFieldOption(); + customFieldOption1.displayName = "Approved"; + customFieldOption1.customFieldId = customFieldId; + + CustomFieldOption customFieldOption2 = new CustomFieldOption(); + customFieldOption2.displayName = "Unapproved"; + customFieldOption2.customFieldId = customFieldId; + + try { + // Add custom field options. + CustomFieldOption[] customFieldOptions = + customFieldService.createCustomFieldOptions(new CustomFieldOption[] {customFieldOption1, + customFieldOption2}); + + // Display results. + if (customFieldOptions != null) { + foreach (CustomFieldOption customFieldOption in customFieldOptions) { + Console.WriteLine("Custom field option with ID \"{0}\" and name \"{1}\" was created.", + customFieldOption.id, customFieldOption.displayName); + } + } else { + Console.WriteLine("No custom field options created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom field options. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CustomFieldService/CreateCustomFields.cs b/examples/Dfp/CSharp/v201311/CustomFieldService/CreateCustomFields.cs new file mode 100644 index 00000000000..335e30090da --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CustomFieldService/CreateCustomFields.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates custom fields. To determine which custom fields + /// exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.createCustomFields + /// + class CreateCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates custom fields. To determine which custom fields exist" + + ", run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201311.CustomFieldService); + + // Create custom fields. + CustomField customField1 = new CustomField(); + customField1.name = "Customer comments #" + GetTimeStamp(); + customField1.entityType = CustomFieldEntityType.LINE_ITEM; + customField1.dataType = CustomFieldDataType.STRING; + customField1.visibility = CustomFieldVisibility.FULL; + + CustomField customField2 = new CustomField(); + customField2.name = "Internal approval status #" + GetTimeStamp(); + customField2.entityType = CustomFieldEntityType.LINE_ITEM; + customField2.dataType = CustomFieldDataType.DROP_DOWN; + customField2.visibility = CustomFieldVisibility.FULL; + + try { + // Add custom fields. + CustomField[] customFields = + customFieldService.createCustomFields(new CustomField[] {customField1, customField2}); + + // Display results. + if (customFields != null) { + foreach (CustomField customField in customFields) { + Console.WriteLine("Custom field with ID \"{0}\" and name \"{1}\" was created.", + customField.id, customField.name); + } + } else { + Console.WriteLine("No custom fields created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CustomFieldService/DeactivateAllLineItemCustomFields.cs b/examples/Dfp/CSharp/v201311/CustomFieldService/DeactivateAllLineItemCustomFields.cs new file mode 100644 index 00000000000..651dcdfb2fb --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CustomFieldService/DeactivateAllLineItemCustomFields.cs @@ -0,0 +1,122 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using Google.Api.Ads.Dfp.Util.v201311; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example deactivates all active line item custom fields. To + /// determine which custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// Tags: CustomFieldService.performCustomFieldAction + /// + class DeactivateAllLineItemCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active line item custom fields. To determine " + + "which custom fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateAllLineItemCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201311.CustomFieldService); + + // Create statement to select only active custom fields that apply to + // line items. + String statementText = "WHERE entityType = :entityType and isActive = :isActive LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText) + .AddValue("entityType", CustomFieldEntityType.LINE_ITEM.ToString()) + .AddValue("isActive", true) + .ToStatement(); + + // Set defaults for page and offset. + CustomFieldPage page = new CustomFieldPage(); + int offset = 0; + int i = 0; + List customFieldIds = new List(); + + try { + do { + // Create a statement to page through custom fields. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(filterStatement); + + if (page.results != null) { + foreach (CustomField customField in page.results) { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" will be " + + "deactivated.", i, customField.id, customField.name); + customFieldIds.Add(customField.id.ToString()); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of custom fields to be deactivated: " + customFieldIds.Count); + + if (customFieldIds.Count > 0) { + // Modify statement for action. + filterStatement.query = "WHERE id IN (" + string.Join(", ", customFieldIds.ToArray()) + + ")"; + + // Create action. + DeactivateCustomFields action = new DeactivateCustomFields(); + + // Perform action. + UpdateResult result = customFieldService.performCustomFieldAction( + action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of custom fields deactivated: " + result.numChanges); + } else { + Console.WriteLine("No custom fields were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CustomFieldService/GetAllCustomFields.cs b/examples/Dfp/CSharp/v201311/CustomFieldService/GetAllCustomFields.cs new file mode 100644 index 00000000000..15f51d86092 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CustomFieldService/GetAllCustomFields.cs @@ -0,0 +1,107 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using Google.Api.Ads.Dfp.Util.v201311; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all custom fields. To create custom fields, run + /// CreateCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// Tags: CustomFieldService.performCustomFieldAction + /// + class GetAllCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom fields. To create custom fields, run " + + "CreateCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201311.CustomFieldService); + + // Sets defaults for page and filter. + CustomFieldPage page = new CustomFieldPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all custom fields. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomField customField in page.results) { + if (customField is DropDownCustomField) { + List dropDownCustomFieldStrings = new List(); + DropDownCustomField dropDownCustomField = (DropDownCustomField) customField; + if (dropDownCustomField.options != null) { + foreach (CustomFieldOption customFieldOption in dropDownCustomField.options) { + dropDownCustomFieldStrings.Add(customFieldOption.displayName); + } + } + Console.WriteLine("{0}) Drop-down custom field with ID \"{1}\", name \"{2}\", " + + "and options {{{3}}} was found.", i, customField.id, customField.name, + string.Join(", ", dropDownCustomFieldStrings.ToArray())); + } else { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" was found.", + i, customField.id, customField.name); + } + i++; + } + } + + offset += 500; + } while (page.results != null && page.results.Length == 500); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CustomFieldService/GetAllLineItemCustomFields.cs b/examples/Dfp/CSharp/v201311/CustomFieldService/GetAllLineItemCustomFields.cs new file mode 100644 index 00000000000..d91005aa457 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CustomFieldService/GetAllLineItemCustomFields.cs @@ -0,0 +1,97 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using Google.Api.Ads.Dfp.Util.v201311; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all custom fields that apply to line items. To + /// create custom fields, run CreateCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// + class GetAllLineItemCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom fields that apply to line items. To create " + + "custom fields, run CreateCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLineItemCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201311.CustomFieldService); + + // Create statement to select only custom fields that apply to line items. + String statementText = "WHERE entityType = :entityType LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText) + .AddValue("entityType", CustomFieldEntityType.LINE_ITEM.ToString()) + .ToStatement(); + + // Set defaults for page and offset. + CustomFieldPage page = new CustomFieldPage(); + int offset = 0; + int i = 0; + + try { + do { + // Create a statement to page through custom fields. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(filterStatement); + + if (page.results != null) { + foreach (CustomField customField in page.results) { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" was found.", i, + customField.id, customField.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all line item custom fields. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CustomFieldService/SetLineItemCustomFieldValue.cs b/examples/Dfp/CSharp/v201311/CustomFieldService/SetLineItemCustomFieldValue.cs new file mode 100644 index 00000000000..9a4531f08d5 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CustomFieldService/SetLineItemCustomFieldValue.cs @@ -0,0 +1,148 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using Google.Api.Ads.Dfp.Util.v201311; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example sets custom field values on a line item. To determine + /// which custom fields exist, run GetAllCustomFields.cs. To create custom + /// field options, run CreateCustomFieldOptions.cs. To determine which line + /// items exist, run GetAllLineItems.cs. + /// + /// Tags: CustomFieldService.getCustomField + /// Tags: LineItemService.getLineItem + /// Tags: LineItemService.updateLineItems + /// + class SetLineItemCustomFieldValue : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example sets custom field values on a line item. To determine which " + + "custom fields exist, run GetAllCustomFields.cs. To create custom field options, " + + "run CreateCustomFieldOptions.cs. To determine which line items exist, run " + + "GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new SetLineItemCustomFieldValue(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201311.CustomFieldService); + + // Get the LineItemService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201311.LineItemService); + + // Set the IDs of the custom fields, custom field option, and line item. + long customFieldId = long.Parse(_T("INSERT_STRING_CUSTOM_FIELD_ID_HERE")); + long dropDownCustomFieldId = long.Parse(_T("INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE")); + long customFieldOptionId = long.Parse(_T("INSERT_CUSTOM_FIELD_OPTION_ID_HERE")); + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get the custom field. + CustomField customField = customFieldService.getCustomField(customFieldId); + + // Get the drop-down custom field. + DropDownCustomField dropDownCustomField = + (DropDownCustomField) customFieldService.getCustomField(dropDownCustomFieldId); + + // Get the line item. + LineItem lineItem = lineItemService.getLineItem(lineItemId); + + // Create custom field values. + List customFieldValues = new List(); + TextValue textValue = new TextValue(); + textValue.value = "Custom field value"; + + CustomFieldValue customFieldValue = new CustomFieldValue(); + customFieldValue.customFieldId = customFieldId; + customFieldValue.value = textValue; + customFieldValues.Add(customFieldValue); + + DropDownCustomFieldValue dropDownCustomFieldValue = new DropDownCustomFieldValue(); + dropDownCustomFieldValue.customFieldId = dropDownCustomFieldId; + dropDownCustomFieldValue.customFieldOptionId = customFieldOptionId; + customFieldValues.Add(dropDownCustomFieldValue); + + // Only add existing custom field values for different custom fields than + // the ones you are setting. + if (lineItem.customFieldValues != null) { + foreach (BaseCustomFieldValue oldCustomFieldValue in lineItem.customFieldValues) { + if (!(oldCustomFieldValue.customFieldId == customFieldId) + && !(oldCustomFieldValue.customFieldId == dropDownCustomFieldId)) { + customFieldValues.Add(oldCustomFieldValue); + } + } + } + + lineItem.customFieldValues = customFieldValues.ToArray(); + + // Update the line item on the server. + LineItem[] lineItems = lineItemService.updateLineItems(new LineItem[] {lineItem}); + + if (lineItems != null) { + foreach (LineItem updatedLineItem in lineItems) { + List customFieldValueStrings = new List(); + foreach (BaseCustomFieldValue baseCustomFieldValue in lineItem.customFieldValues) { + if (baseCustomFieldValue is CustomFieldValue + && ((CustomFieldValue) baseCustomFieldValue).value is TextValue) { + customFieldValueStrings.Add("{ID: '" + baseCustomFieldValue.customFieldId + + "', value: '" + + ((TextValue) ((CustomFieldValue) baseCustomFieldValue).value).value + + "'}"); + } else if (baseCustomFieldValue is DropDownCustomFieldValue) { + customFieldValueStrings.Add("{ID: '" + baseCustomFieldValue.customFieldId + + "', custom field option ID: '" + + ((DropDownCustomFieldValue) baseCustomFieldValue).customFieldOptionId + + "'}"); + } + } + Console.WriteLine("A line item with ID \"{0}\" set with custom field values \"{1}\".", + updatedLineItem.id, string.Join(", ", customFieldValueStrings.ToArray())); + } + } else { + Console.WriteLine("No line items were updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CustomFieldService/UpdateCustomFields.cs b/examples/Dfp/CSharp/v201311/CustomFieldService/UpdateCustomFields.cs new file mode 100644 index 00000000000..32ae6ac45d5 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CustomFieldService/UpdateCustomFields.cs @@ -0,0 +1,95 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using Google.Api.Ads.Dfp.Util.v201311; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example updates custom field descriptions. To determine which + /// custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.updateCustomFields + /// + class UpdateCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates custom field descriptions. To determine which custom " + + "fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201311.CustomFieldService); + + // Set the ID of the custom field to update. + long customFieldId = long.Parse(_T("INSERT_CUSTOM_FIELD_ID_HERE")); + + try { + // Get the custom field. + CustomField customField = customFieldService.getCustomField(customFieldId); + + if (customField != null) { + customField.description = + (customField.description == null ? "" : customField.description + " Updated"); + + // Update the custom field on the server. + CustomField[] customFields = + customFieldService.updateCustomFields(new CustomField[] {customField}); + + // Display results + if (customFields != null) { + foreach (CustomField updatedCustomField in customFields) { + Console.WriteLine("Custom field with ID \"{0}\", name \"{1}\", and description " + + "\"{2}\" was updated.", updatedCustomField.id, updatedCustomField.name, + updatedCustomField.description); + } + } else { + Console.WriteLine("No custom fields were updated."); + } + } else { + Console.WriteLine("No custom fields found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs b/examples/Dfp/CSharp/v201311/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs new file mode 100644 index 00000000000..3ed391bc26c --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs @@ -0,0 +1,158 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates new custom targeting keys and values. To + /// determine which custom targeting keys and values exist, run + /// GetAllCustomTargetingKeysAndValues.cs. To target these custom targeting + /// keys and values, run TargetCustomCriteria.cs. + /// + /// Tags: CustomTargetingService.createCustomTargetingKeys + /// Tags: CustomTargetingService.createCustomTargetingValues + /// + class CreateCustomTargetingKeysAndValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new custom targeting keys and values. To determine " + + "which custom targeting keys and values exist, run " + + "GetAllCustomTargetingKeysAndValues.cs. To target these custom targeting keys and " + + "values, run TargetCustomCriteria.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomTargetingKeysAndValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201311.CustomTargetingService); + + // Create predefined key. + CustomTargetingKey genderKey = new CustomTargetingKey(); + genderKey.displayName = "gender"; + genderKey.name = "g"; + genderKey.type = CustomTargetingKeyType.PREDEFINED; + + // Create predefined key that may be used for content targeting. + CustomTargetingKey genreKey = new CustomTargetingKey(); + genreKey.displayName = "genre"; + genreKey.name = "genre"; + genreKey.type = CustomTargetingKeyType.PREDEFINED; + + // Create free-form key. + CustomTargetingKey carModelKey = new CustomTargetingKey(); + carModelKey.displayName = "car model"; + carModelKey.name = "c"; + carModelKey.type = CustomTargetingKeyType.FREEFORM; + + try { + // Create the custom targeting keys on the server. + CustomTargetingKey[] keys = customTargetingService.createCustomTargetingKeys( + new CustomTargetingKey[] {genderKey, genreKey, carModelKey}); + + if (keys != null) { + foreach (CustomTargetingKey key in keys) { + Console.WriteLine("A custom targeting key with ID \"{0}\", name \"{1}\", and display " + + "name \"{2}\" was created.", key.id, key.name, key.displayName); + } + } else { + Console.WriteLine("No keys were created."); + } + + // Create custom targeting value for the predefined gender key. + CustomTargetingValue genderMaleValue = new CustomTargetingValue(); + genderMaleValue.customTargetingKeyId = keys[0].id; + genderMaleValue.displayName = "male"; + // Name is set to 1 so that the actual name can be hidden from website + // users. + genderMaleValue.name = "1"; + genderMaleValue.matchType = CustomTargetingValueMatchType.EXACT; + + CustomTargetingValue genderFemaleValue = new CustomTargetingValue(); + genderFemaleValue.customTargetingKeyId = keys[0].id; + genderFemaleValue.displayName = "female"; + // Name is set to 2 so that the actual name can be hidden from website + // users. + genderFemaleValue.name = "2"; + genderFemaleValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create custom targeting value for the predefined genre key. + CustomTargetingValue genreComedyValue = new CustomTargetingValue(); + genreComedyValue.customTargetingKeyId = keys[1].id; + genreComedyValue.displayName = "comedy"; + genreComedyValue.name = "comedy"; + genreComedyValue.matchType = CustomTargetingValueMatchType.EXACT; + + CustomTargetingValue genreDramaValue = new CustomTargetingValue(); + genreDramaValue.customTargetingKeyId = keys[1].id; + genreDramaValue.displayName = "drama"; + genreDramaValue.name = "drama"; + genreDramaValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create custom targeting value for the free-form age key. These are + // values that would be suggested in the UI or can be used when + // targeting with a FreeFormCustomCriteria. + CustomTargetingValue carModelHondaCivicValue = new CustomTargetingValue(); + carModelHondaCivicValue.customTargetingKeyId = keys[2].id; + carModelHondaCivicValue.displayName = "honda civic"; + carModelHondaCivicValue.name = "honda civic"; + // Setting match type to exact will match exactly "honda civic". + carModelHondaCivicValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create the custom targeting values on the server. + CustomTargetingValue[] returnValues = customTargetingService.createCustomTargetingValues( + new CustomTargetingValue[] {genderMaleValue, genderFemaleValue, genreComedyValue, + genreDramaValue, carModelHondaCivicValue}); + + if (returnValues != null) { + foreach (CustomTargetingValue value in returnValues) { + Console.WriteLine("A custom targeting value with ID \"{0}\", belonging to key with " + + "ID \"{1}\", name \"{2}\", and display name \"{3}\" was created.", value.id, + value.customTargetingKeyId, value.name, value.displayName); + } + } else { + Console.WriteLine("No values were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom targeting keys and values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs b/examples/Dfp/CSharp/v201311/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs new file mode 100644 index 00000000000..c19a1f65539 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs @@ -0,0 +1,122 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all custom targeting keys and the values. To create + /// custom targeting keys and values, run + /// CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// + class GetAllCustomTargetingKeysAndValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom targeting keys and the values. To create " + + "custom targeting keys and values, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCustomTargetingKeysAndValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201311.CustomTargetingService); + + // Sets defaults for page and filter. + CustomTargetingKeyPage keyPage = new CustomTargetingKeyPage(); + Statement keyFilterStatement = new Statement(); + int keyOffset = 0; + + try { + do { + // Create a statement to get all custom targeting keys. + keyFilterStatement.query = "LIMIT 500 OFFSET " + keyOffset; + + // Get custom targeting keys by statement. + keyPage = customTargetingService.getCustomTargetingKeysByStatement(keyFilterStatement); + + if (keyPage.results != null) { + int i = keyPage.startIndex; + foreach (CustomTargetingKey key in keyPage.results) { + Console.WriteLine("{0}) Custom targeting key with ID \"{1}\", name \"{2}\", " + + "display name \"{3}\", and type \"{4}\" was found.", i, key.id, key.name, + key.displayName, key.type); + + + // Sets defaults for page and filter. + CustomTargetingValuePage valuePage = new CustomTargetingValuePage(); + Statement valueFilterStatement = new Statement(); + int valueOffset = 0; + + do { + // Create a statement to get all custom targeting values for a + // custom targeting key (required) by its ID. + valueFilterStatement.query = string.Format("WHERE customTargetingKeyId = {0} " + + "LIMIT 500 OFFSET {1}", key.id, valueOffset); + + // Get custom targeting values by statement. + valuePage = customTargetingService.getCustomTargetingValuesByStatement( + valueFilterStatement); + + if (valuePage.results != null) { + int j = valuePage.startIndex; + foreach (CustomTargetingValue value in valuePage.results) { + Console.WriteLine("\t{0}) Custom targeting value with ID \"{1}\", name " + + "\"{2}\", and display name \"{3}\" was found.", j, value.id, value.name, + value.displayName); + j++; + } + } + valueOffset += 500; + } while (valuePage.results != null && valuePage.results.Length == 500); + i++; + } + } + keyOffset += 500; + } while (keyPage.results != null && keyPage.results.Length == 500); + Console.WriteLine("Number of results found: {0}", keyPage.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get custom targeting keys and the values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CustomTargetingService/GetCustomTargetingKeysByStatement.cs b/examples/Dfp/CSharp/v201311/CustomTargetingService/GetCustomTargetingKeysByStatement.cs new file mode 100644 index 00000000000..269119482d2 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CustomTargetingService/GetCustomTargetingKeysByStatement.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all predefined custom targeting keys. The statement + /// retrieves up to the maximum page size limit of 500. To create custom + /// targeting keys, run CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// + class GetCustomTargetingKeysByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all predefined custom targeting keys. The statement " + + "retrieves up to the maximum page size limit of 500. To create custom " + + "targeting keys, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCustomTargetingKeysByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201311.CustomTargetingService); + + try { + // Create a statement to only select predefined custom targeting keys. + Statement filterStatement = new StatementBuilder("WHERE type = :type LIMIT 500").AddValue( + "type", CustomTargetingKeyType.PREDEFINED.ToString()).ToStatement(); + + // Get custom targeting keys by statement. + CustomTargetingKeyPage page = + customTargetingService.getCustomTargetingKeysByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomTargetingKey customTargetingKey in page.results) { + Console.WriteLine("{0}) Custom targeting key with ID \"{1}\", name \"{2}\", and " + + "display name \"{3}\" was found.", i, customTargetingKey.id, + customTargetingKey.name, customTargetingKey.displayName); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get predefined custom targeting keys. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CustomTargetingService/GetCustomTargetingValuesByStatement.cs b/examples/Dfp/CSharp/v201311/CustomTargetingService/GetCustomTargetingValuesByStatement.cs new file mode 100644 index 00000000000..f5b7e629c01 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CustomTargetingService/GetCustomTargetingValuesByStatement.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets custom targeting values for the given predefined + /// custom targeting key. The statement retrieves up to the maximum page size + /// limit of 500. To create custom targeting values, run + /// CreateCustomTargetingKeysAndValues.cs. To determine which custom + /// targeting keys exist, run GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// + class GetCustomTargetingValuesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets custom targeting values for the given predefined custom " + + "targeting key. The statement retrieves up to the maximum page size limit of 500. " + + "To create custom targeting values, run CreateCustomTargetingKeysAndValues.cs. To " + + "determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCustomTargetingValuesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201311.CustomTargetingService); + + // Set the ID of the custom targeting key to get custom targeting values + // for. + long customTargetingKeyId = long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + + // Create a statement to only select custom targeting values for a given + // key. + Statement filterStatement = + new StatementBuilder("WHERE customTargetingKeyId = :customTargetingKeyId LIMIT 500") + .AddValue("customTargetingKeyId", customTargetingKeyId).ToStatement(); + + try { + // Get custom targeting values by statement. + CustomTargetingValuePage page = + customTargetingService.getCustomTargetingValuesByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomTargetingValue customTargetingValue in page.results) { + Console.WriteLine("{0}) Custom targeting value with ID \"{1}\", name \"{2}\", and " + + "display name \"{3}\" was found.", i, customTargetingValue.id, + customTargetingValue.name, customTargetingValue.displayName); + i++; + } + } + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get custom targeting values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CustomTargetingService/UpdateCustomTargetingKeys.cs b/examples/Dfp/CSharp/v201311/CustomTargetingService/UpdateCustomTargetingKeys.cs new file mode 100644 index 00000000000..bd778ec528d --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CustomTargetingService/UpdateCustomTargetingKeys.cs @@ -0,0 +1,107 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example updates the display name of each custom targeting key up + /// to the first 500. To determine which custom targeting keys exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// Tags: CustomTargetingService.updateCustomTargetingKeys + /// + class UpdateCustomTargetingKeys : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the display name of each custom targeting key up " + + "to the first 500. To determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomTargetingKeys(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201311.CustomTargetingService); + + // Create a statement to get all custom targeting keys. + Statement filterStatement = new Statement(); + filterStatement.query = "LIMIT 500"; + + try { + // Get custom targeting keys by statement. + CustomTargetingKeyPage page = + customTargetingService.getCustomTargetingKeysByStatement(filterStatement); + + if (page.results != null) { + CustomTargetingKey[] customTargetingKeys = page.results; + + // Update each local custom targeting key object by changing its display + // name. + foreach (CustomTargetingKey customTargetingKey in customTargetingKeys) { + if (customTargetingKey.displayName == null) { + customTargetingKey.displayName = customTargetingKey.name; + } + customTargetingKey.displayName = customTargetingKey.displayName + " (Deprecated)"; + } + + // Update the custom targeting keys on the server. + customTargetingKeys = + customTargetingService.updateCustomTargetingKeys(customTargetingKeys); + + if (customTargetingKeys != null) { + foreach (CustomTargetingKey customTargetingKey in customTargetingKeys) { + Console.WriteLine("Custom targeting key with ID \"{0}\", name \"{1}\", and " + + "display name \"{2}\" was updated.", customTargetingKey.id, + customTargetingKey.name, customTargetingKey.displayName); + } + } else { + Console.WriteLine("No custom targeting keys updated."); + } + } else { + Console.WriteLine("No custom targeting keys found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update display name of custom targeting keys. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/CustomTargetingService/UpdateCustomTargetingValues.cs b/examples/Dfp/CSharp/v201311/CustomTargetingService/UpdateCustomTargetingValues.cs new file mode 100644 index 00000000000..7cb6c3dd972 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/CustomTargetingService/UpdateCustomTargetingValues.cs @@ -0,0 +1,113 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example updates the display name of each custom targeting value + /// up to the first 500. To determine which custom targeting keys exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// Tags: CustomTargetingService.updateCustomTargetingValues + /// + class UpdateCustomTargetingValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the display name of each custom targeting value up to " + + "the first 500. To determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomTargetingValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201311.CustomTargetingService); + + // Set the ID of the predefined custom targeting key to get custom + // targeting values for. + long customTargetingKeyId = long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + + // Create a statement to only select predefined custom targeting values + // for a given key. + Statement filterStatement = + new StatementBuilder("WHERE customTargetingKeyId = :customTargetingKeyId LIMIT 500") + .AddValue("customTargetingKeyId", customTargetingKeyId).ToStatement(); + + try { + // Get custom targeting values by statement. + CustomTargetingValuePage page = + customTargetingService.getCustomTargetingValuesByStatement(filterStatement); + + if (page.results != null) { + CustomTargetingValue[] customTargetingValues = page.results; + + // Update each local custom targeting value object by changing its + // display name. + foreach (CustomTargetingValue customTargetingValue in customTargetingValues) { + if (customTargetingValue.displayName == null) { + customTargetingValue.displayName = customTargetingValue.displayName; + } + customTargetingValue.displayName = customTargetingValue.displayName + " (Deprecated)"; + } + + // Update the custom targeting values on the server. + customTargetingValues = + customTargetingService.updateCustomTargetingValues(customTargetingValues); + + if (customTargetingValues != null) { + foreach (CustomTargetingValue customTargetingValue in customTargetingValues) { + Console.WriteLine("Custom targeting value with ID \"{0}\", name \"{1}\", and " + + "display name \"{2}\" was updated.", customTargetingValue.id, + customTargetingValue.name, customTargetingValue.displayName); + } + } else { + Console.WriteLine("No custom targeting values updated."); + } + } else { + Console.WriteLine("No custom targeting values found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update display names of custom targeting values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ForecastService/GetForecast.cs b/examples/Dfp/CSharp/v201311/ForecastService/GetForecast.cs new file mode 100644 index 00000000000..7f8b631530e --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ForecastService/GetForecast.cs @@ -0,0 +1,113 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets a forecast for a prospective line item. To + /// determine which placements exist, run GetAllPlacements.cs. + /// + /// Tags: ForecastService.getForecast + /// + class GetForecast : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a forecast for a prospective line item. To determine " + + "which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetForecast(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ForecastService. + ForecastService forecastService = + (ForecastService)user.GetService(DfpService.v201311.ForecastService); + + // Set the placement that the prospective line item will target. + long[] targetPlacementIds = new long[] {long.Parse(_T("INSERT_PLACEMENT_ID_HERE"))}; + + // Set the end date time to have the line line item run till. + string endDateTime = "INSERT_END_DATE_TIME_HERE (yyyyMMdd HH:mm:ss)"; + + // Create prospective line item. + LineItem lineItem = new LineItem(); + + lineItem.targeting = new Targeting(); + lineItem.targeting.inventoryTargeting = new InventoryTargeting(); + lineItem.targeting.inventoryTargeting.targetedPlacementIds = targetPlacementIds; + + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + lineItem.lineItemType = LineItemType.SPONSORSHIP; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + + lineItem.endDateTime = DateTimeUtilities.FromString(endDateTime); + + // Set the cost type to match the unit type. + lineItem.costType = CostType.CPM; + + try { + // Get forecast. + Forecast forecast = forecastService.getForecast(lineItem); + + // Display results. + long matched = forecast.matchedUnits; + double availablePercent = (double) (forecast.availableUnits / (matched * 1.0)) * 100; + String unitType = forecast.unitType.ToString().ToLower(); + Console.WriteLine("{0} {1} matched.\n{2}% available.", matched, unitType, + availablePercent, unitType); + + if (forecast.possibleUnitsSpecified) { + double possiblePercent = (double) (forecast.possibleUnits / (matched * 1.0)) * 100; + Console.WriteLine("{0}% {1} possible.\n", possiblePercent, unitType); + } + Console.WriteLine("{0} contending line items.", (forecast.contendingLineItems != null) ? + forecast.contendingLineItems.Length : 0); + } catch (Exception ex) { + Console.WriteLine("Failed to get forecast. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ForecastService/GetForecastById.cs b/examples/Dfp/CSharp/v201311/ForecastService/GetForecastById.cs new file mode 100644 index 00000000000..ea4068f4eab --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ForecastService/GetForecastById.cs @@ -0,0 +1,84 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets a forecast for an existing line item. To determine + /// which line items exist, run GetAllLineItems.cs. + /// + /// Tags: ForecastService.getForecastById + /// + class GetForecastById : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a forecast for an existing line item. To determine which " + + "line items exist, run GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetForecastById(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ForecastService. + ForecastService forecastService = + (ForecastService) user.GetService(DfpService.v201311.ForecastService); + + // Set the line item to get a forecast for. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get forecast for line item. + Forecast forecast = forecastService.getForecastById(lineItemId); + + // Display results. + long matched = forecast.matchedUnits; + double availablePercent = (double) (forecast.availableUnits / (matched * 1.0)) * 100; + String unitType = forecast.unitType.ToString().ToLower(); + + Console.WriteLine("{0} {1} matched.\n{2} % {3} available.", matched, unitType, + availablePercent, unitType); + if (forecast.possibleUnitsSpecified) { + double possiblePercent = (double) (forecast.possibleUnits / (matched * 1.0)) * 100; + Console.WriteLine(possiblePercent + "% " + unitType + " possible.\n"); + } + Console.WriteLine("{0} contending line items.", (forecast.contendingLineItems != null)? + forecast.contendingLineItems.Length : 0); + } catch (Exception ex) { + Console.WriteLine("Failed to get forecast by id. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/InventoryService/CreateAdUnits.cs b/examples/Dfp/CSharp/v201311/InventoryService/CreateAdUnits.cs new file mode 100644 index 00000000000..47b2b839d66 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/InventoryService/CreateAdUnits.cs @@ -0,0 +1,108 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates new ad units under the effective root ad unit. + /// To determine which ad units exist, run GetAdUnitTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.createAdUnits, NetworkService.getCurrentNetwork + /// + class CreateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new ad units under the effective root ad unit. To " + + "determine which ad units exist, run GetAdUnitTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201311.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201311.NetworkService); + + string effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create an array to store local ad unit objects. + AdUnit[] adUnits = new AdUnit[5]; + + for (int i = 0; i < 5; i++) { + AdUnit adUnit = new AdUnit(); + adUnit.name = string.Format("Ad_Unit_{0}", i); + adUnit.parentId = effectiveRootAdUnitId; + + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + + // Set the size of possible creatives that can match this ad unit. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + adUnits[i] = adUnit; + } + + try { + // Create the ad units on the server. + adUnits = inventoryService.createAdUnits(adUnits); + + if (adUnits != null) { + foreach (AdUnit adUnit in adUnits) { + Console.WriteLine("An ad unit with ID = '{0}' was created under parent with " + + "ID = '{1}'.", adUnit.id, adUnit.parentId); + } + } else { + Console.WriteLine("No ad units created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/InventoryService/CreateMobileAdUnit.cs b/examples/Dfp/CSharp/v201311/InventoryService/CreateMobileAdUnit.cs new file mode 100644 index 00000000000..6a2eacce005 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/InventoryService/CreateMobileAdUnit.cs @@ -0,0 +1,104 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates a new mobile ad unit under the effective root + /// ad unit. Mobile features need to be enabled on your account to use mobile + /// targeting. To determine which ad units exist, run GetInventoryTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.createAdUnits, NetworkService.getCurrentNetwork + /// + class CreateMobileAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new mobile ad unit under the effective ad unit. " + + "Mobile features need to be enabled on your account to use mobile targeting. To " + + "determine which ad units exist, run GetInventoryTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateMobileAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201311.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201311.NetworkService); + + // Set the parent ad unit's ID for all ad units to be created under. + String effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create local ad unit object. + AdUnit adUnit = new AdUnit(); + adUnit.name = "Mobile_Ad_Unit"; + adUnit.parentId = effectiveRootAdUnitId; + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + adUnit.targetPlatform = TargetPlatform.MOBILE; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + Size size = new Size(); + size.width = 400; + size.height = 300; + size.isAspectRatio = false; + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + // Set the size of possible creatives that can match this ad unit. + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + + try { + // Create the ad unit on the server. + adUnit = inventoryService.createAdUnit(adUnit); + + if (adUnit != null) { + Console.WriteLine("An ad unit with ID \"{0}\" was created under parent with ID \"{1}\".", + adUnit.id, adUnit.parentId); + } else { + Console.WriteLine("No ad units created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/InventoryService/CreateVideoAdUnit.cs b/examples/Dfp/CSharp/v201311/InventoryService/CreateVideoAdUnit.cs new file mode 100644 index 00000000000..7e9775cafb7 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/InventoryService/CreateVideoAdUnit.cs @@ -0,0 +1,123 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates a new video ad unit under the effective root + /// ad unit. To determine which ad units exist, run GetInventoryTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.CreateVideoAdUnit, NetworkService.getCurrentNetwork + /// + class CreateVideoAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new ad units under the effective root ad unit. To " + + "determine which ad units exist, run GetAdUnitTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateVideoAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201311.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201311.NetworkService); + + // Set the parent ad unit's ID for all ad units to be created under. + String effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create local ad unit object. + AdUnit adUnit = new AdUnit(); + adUnit.name = "Video_Ad_Unit"; + adUnit.parentId = effectiveRootAdUnitId; + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + adUnit.explicitlyTargeted = true; + adUnit.targetPlatform = TargetPlatform.WEB; + + // Create master ad unit size. + AdUnitSize masterAdUnitSize = new AdUnitSize(); + Size size1 = new Size(); + size1.width = 400; + size1.height = 300; + size1.isAspectRatio = false; + masterAdUnitSize.size = size1; + masterAdUnitSize.environmentType = EnvironmentType.VIDEO_PLAYER; + + // Create companion sizes. + AdUnitSize companionAdUnitSize1 = new AdUnitSize(); + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + size2.isAspectRatio = false; + companionAdUnitSize1.size = size2; + companionAdUnitSize1.environmentType = EnvironmentType.BROWSER; + + AdUnitSize companionAdUnitSize2 = new AdUnitSize(); + Size size3 = new Size(); + size3.width = 728; + size3.height = 90; + size3.isAspectRatio = false; + companionAdUnitSize2.size = size3; + companionAdUnitSize2.environmentType = EnvironmentType.BROWSER; + + // Add companions to master ad unit size. + masterAdUnitSize.companions = new AdUnitSize[] {companionAdUnitSize1, companionAdUnitSize2}; + + // Set the size of possible creatives that can match this ad unit. + adUnit.adUnitSizes = new AdUnitSize[] {masterAdUnitSize}; + + try { + // Create the ad unit on the server. + adUnit = inventoryService.createAdUnit(adUnit); + + if (adUnit != null) { + Console.WriteLine("A video ad unit with ID \"{0}\" was created under parent with ID " + + "\"{1}\".", adUnit.id, adUnit.parentId); + } else { + Console.WriteLine("No video ad units created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create video ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/InventoryService/DeActivateAdUnits.cs b/examples/Dfp/CSharp/v201311/InventoryService/DeActivateAdUnits.cs new file mode 100644 index 00000000000..cbe03b7f2f1 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/InventoryService/DeActivateAdUnits.cs @@ -0,0 +1,120 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example deactivates all active ad units. To determine which ad + /// units exist, run GetAllAdUnits.cs or GetInventoryTree.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: InventoryService.performAdUnitAction + /// + class DeActivateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active ad units. To determine which ad units " + + "exist, run GetAllAdUnits.cs or GetInventoryTree.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeActivateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201311.InventoryService); + + // Create Statement text to select active ad units. + string statementText = "WHERE status = :status LIMIT 500"; + + Statement statement = new StatementBuilder("").AddValue("status", + InventoryStatus.ACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + AdUnitPage page = new AdUnitPage(); + int offset = 0; + List adUnitIds = new List(); + + try { + do { + // Create a Statement to page through active ad units. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID ='{1}', name = {2} and status = {3} will" + + " be deactivated.", i, adUnit.id, adUnit.name, adUnit.status); + adUnitIds.Add(adUnit.id); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of ad units to be deactivated: {0}", adUnitIds.Count); + + if (adUnitIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", adUnitIds.ToArray()))). + ToStatement(); + + // Create action. + DeactivateAdUnits action = new DeactivateAdUnits(); + + // Perform action. + UpdateResult result = inventoryService.performAdUnitAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of ad units deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No ad units were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/InventoryService/GetAdUnit.cs b/examples/Dfp/CSharp/v201311/InventoryService/GetAdUnit.cs new file mode 100644 index 00000000000..02f1cbc5aa0 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/InventoryService/GetAdUnit.cs @@ -0,0 +1,77 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets an ad unit by its ID. To determine which ad units + /// exist, run GetInventoryTree.cs or GetAllAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnit + /// + class GetAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets an ad unit by its ID. To determine which ad units " + + "exist, run GetInventoryTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201311.InventoryService); + + // Set the ID of the ad unit to get. + String adUnitId = _T("INSERT_AD_UNIT_ID_HERE"); + + try { + // Get the ad unit. + AdUnit adUnit = inventoryService.getAdUnit(adUnitId); + + if (adUnit != null) { + Console.WriteLine("Ad unit with ID = '{0}', name = '{1}' and status = '{2}' was found.", + adUnit.id, adUnit.name, adUnit.status); + } else { + Console.WriteLine("No ad unit found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/InventoryService/GetAdUnitSizes.cs b/examples/Dfp/CSharp/v201311/InventoryService/GetAdUnitSizes.cs new file mode 100644 index 00000000000..f4da33d9721 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/InventoryService/GetAdUnitSizes.cs @@ -0,0 +1,80 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; +using Google.Api.Ads.Dfp.Util.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all web target platform ad unit sizes. + /// + /// Tags: InventoryService.getAdUnitSizesByStatement + /// + class GetAdUnitSizes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all web target platform ad unit sizes."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnitSizes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201311.InventoryService); + + Statement filterStatement = new StatementBuilder("WHERE targetPlatform = :targetPlatform"). + AddValue("targetPlatform", "WEB").ToStatement(); + + try { + // Get all ad unit sizes. + AdUnitSize[] adUnitSizes = inventoryService.getAdUnitSizesByStatement(filterStatement); + + // Display results. + if (adUnitSizes != null) { + for (int i = 0; i < adUnitSizes.Length; i++) { + AdUnitSize adUnitSize = adUnitSizes[i]; + Console.WriteLine("{0}) Ad unit size ({1}x{2}) was found.\n", i, + adUnitSize.size.width, adUnitSize.size.height); + } + } else { + Console.WriteLine("No ad unit sizes found."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit sizes. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/InventoryService/GetAdUnitsByStatement.cs b/examples/Dfp/CSharp/v201311/InventoryService/GetAdUnitsByStatement.cs new file mode 100644 index 00000000000..b53e2a5425d --- /dev/null +++ b/examples/Dfp/CSharp/v201311/InventoryService/GetAdUnitsByStatement.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets the root ad unit. To create an ad unit, run + /// CreateAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: NetworkService.getCurrentNetwork + /// + class GetAdUnitsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the root ad unit. To create an ad unit, run " + + "CreateAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnitsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201311.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201311.NetworkService); + + // Get the effective root ad unit ID of the network. + string effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create a statement to select the children of the effective root ad + // unit. + Statement statement = new StatementBuilder("WHERE parentId = :id LIMIT 1").AddValue( + "id", effectiveRootAdUnitId).ToStatement(); + + try { + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID = '{1}', name = '{2}' and status = '{3}' " + + "was found.", i, adUnit.id, adUnit.name, adUnit.status); + i++; + } + } + + // The number of results should always be 1 for this code example. + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/InventoryService/GetAllAdUnits.cs b/examples/Dfp/CSharp/v201311/InventoryService/GetAllAdUnits.cs new file mode 100644 index 00000000000..b567b99c468 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/InventoryService/GetAllAdUnits.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all ad units. To create ad units, run + /// CreateAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// + class GetAllAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all ad units. To create ad units, run CreateAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201311.InventoryService); + + // Sets defaults for page and statement. + AdUnitPage page = new AdUnitPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all ad units. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID = '{1}', name = '{2}' and status = '{3}' " + + "was found.", i, adUnit.id, adUnit.name, adUnit.status); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/InventoryService/GetInventoryTree.cs b/examples/Dfp/CSharp/v201311/InventoryService/GetInventoryTree.cs new file mode 100644 index 00000000000..b745b259135 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/InventoryService/GetInventoryTree.cs @@ -0,0 +1,203 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example retrieves a previously created ad units and creates + /// a tree. + /// + /// Tags: InventoryService.getAdUnit, InventoryService.getAdUnitsByStatement + /// + class GetInventoryTree : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves a previously created ad units and creates a tree."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetInventoryTree(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + try { + // Get all ad units. + AdUnit[] allAdUnits = GetAllAdUnits(user); + + // Find the root ad unit. rootAdUnit can also be set to child unit to + // only build and display a portion of the tree. + // i.e. AdUnit adUnit = + // inventoryService.getAdUnit("INSERT_AD_UNIT_HERE") + AdUnit rootAdUnit = FindRootAdUnit(user); + + if (rootAdUnit == null) { + Console.WriteLine("Could not build tree. No root ad unit found."); + } else { + BuildAndDisplayAdUnitTree(rootAdUnit, allAdUnits); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + + /// + /// Gets all ad units for this user. + /// + /// The DfpUser to get the ad units for. + /// All ad units for this user. + private static AdUnit[] GetAllAdUnits(DfpUser user) { + // Create list to hold all ad units. + List adUnits = new List(); + + // Get InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201311.InventoryService); + + // Sets defaults for page and Statement. + AdUnitPage page = new AdUnitPage(); + Statement statement = new Statement(); + int offset = 0; + + do { + // Create a Statement to get all ad units. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + adUnits.AddRange(page.results); + } + offset += 500; + } while (page.results != null && page.results.Length == 500); + return adUnits.ToArray(); + } + + /// + /// Finds the root ad unit for the user. + /// + /// The DfpUser to get the root ad unit for. + /// The ad unit representing the root ad unit or null if one + /// is not found. + private static AdUnit FindRootAdUnit(DfpUser user) { + // Get InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201311.InventoryService); + + // Create a Statement to only select the root ad unit. + Statement statement = new Statement(); + statement.query = "WHERE parentId IS NULL LIMIT 500"; + + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + return page.results[0]; + } + return null; + } + + /// + /// Builds and displays an ad unit tree from an array of ad units underneath + /// the root ad unit. + /// + /// The root ad unit to build the tree under. + /// The array of ad units. + private static void BuildAndDisplayAdUnitTree(AdUnit root, AdUnit[] units) { + Dictionary> treeMap = new Dictionary>(); + + foreach (AdUnit unit in units) { + if (unit.parentId != null) { + if (treeMap.ContainsKey(unit.parentId) == false) { + treeMap.Add(unit.parentId, new List()); + } + treeMap[unit.parentId].Add(unit); + } + } + + if (root != null) { + DisplayInventoryTree(root, treeMap); + } else { + Console.WriteLine("No root unit found."); + } + } + + /// + /// Displays the ad unit tree beginning at the root ad unit. + /// + /// The root ad unit + /// The map of id to list of ad units + private static void DisplayInventoryTree(AdUnit root, Dictionary> treeMap) { + DisplayInventoryTreeHelper(root, treeMap, 0); + } + + /// + /// Helper for displaying inventory units. + /// + /// The root inventory unit. + /// The map of id to List of inventory units. + /// The depth the tree has reached. + private static void DisplayInventoryTreeHelper(AdUnit root, + Dictionary> treeMap, int depth) { + Console.WriteLine(GenerateTab(depth) + root.name + " (" + root.id + ")"); + + if (treeMap.ContainsKey(root.id)) { + foreach (AdUnit child in treeMap[root.id]) { + DisplayInventoryTreeHelper(child, treeMap, depth + 1); + } + } + } + + /// + /// Generates a String of tabs to represent branching to children. + /// + /// A depth from 0 to max(depth). + /// A string to insert in front of the root unit. + private static String GenerateTab(int depth) { + StringBuilder builder = new StringBuilder(); + if (depth != 0) { + builder.Append(" "); + } + + for (int i = 1; i < depth; i++) { + builder.Append("| "); + } + builder.Append("+--"); + return builder.ToString(); + } + } +} diff --git a/examples/Dfp/CSharp/v201311/InventoryService/UpdateAdUnits.cs b/examples/Dfp/CSharp/v201311/InventoryService/UpdateAdUnits.cs new file mode 100644 index 00000000000..0b01eecf635 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/InventoryService/UpdateAdUnits.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example updates an ad unit by enabling AdSense to the first + /// 500. To determine which ad units exist, run GetAllAdUnits.cs or + /// GetInventoryTree.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement, InventoryService.updateAdUnits + /// + class UpdateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates an ad unit by enabling AdSense to the first 500. To " + + "determine which ad units exist, run GetAllAdUnits.cs or GetInventoryTree.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the sample code. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201311.InventoryService); + + // Create a statement to get all ad units. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get ad units by statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + if (page.results != null) { + // Update each local ad unit object by enabling AdSense. + foreach (AdUnit adUnit in page.results) { + adUnit.inheritedAdSenseSettings.value.adSenseEnabled = true; + } + + // Update the ad units on the server. + AdUnit[] updatedAdUnits = inventoryService.updateAdUnits(page.results); + + if (updatedAdUnits != null) { + foreach (AdUnit adUnit in updatedAdUnits) { + Console.WriteLine("Ad unit with ID \"{0}\", name \"{1}\", and is AdSense enabled " + + "\"{2}\" was updated.", adUnit.id, adUnit.name, + adUnit.inheritedAdSenseSettings.value.adSenseEnabled); + } + } else { + Console.WriteLine("No ad units updated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to update ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LabelService/CreateLabels.cs b/examples/Dfp/CSharp/v201311/LabelService/CreateLabels.cs new file mode 100644 index 00000000000..00e58146900 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LabelService/CreateLabels.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates new labels. To determine which labels exist, run + /// GetAllLabels.cs. This feature is only available to DFP premium solution + /// networks. + /// + /// Tags: LabelService.createLabels + /// + class CreateLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new labels. To determine which labels exist, run " + + "GetAllLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201311.LabelService); + + try { + // Create an array to store local label objects. + Label[] labels = new Label[5]; + + for (int i = 0; i < 5; i++) { + Label label = new Label(); + label.name = "Label #" + GetTimeStamp(); + label.types = new LabelType[] {LabelType.COMPETITIVE_EXCLUSION}; + labels[i] = label; + } + + // Create the labels on the server. + labels = labelService.createLabels(labels); + + if (labels != null) { + foreach (Label label in labels) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("A label with ID '{0}', name '{1}', and type '{2}' was created.", + label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + } + } else { + Console.WriteLine("No labels created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LabelService/DeactivateActiveLabels.cs b/examples/Dfp/CSharp/v201311/LabelService/DeactivateActiveLabels.cs new file mode 100644 index 00000000000..c804ea5d112 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LabelService/DeactivateActiveLabels.cs @@ -0,0 +1,116 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example deactivates all active labels. To determine which labels + /// exist, run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement, LabelService.performLabelAction + /// + class DeactivateActiveLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active labels. To determine which labels exist," + + " run GetAllLabels.cs. This feature is only available to DFP premium solution " + + "networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateActiveLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201311.LabelService); + + // Create statement text to select active labels. + String statementText = "WHERE isActive = :isActive LIMIT 500"; + Statement filterStatement = new StatementBuilder("").AddValue("isActive", true).ToStatement(); + + // Set defaults for page and offset. + LabelPage page = new LabelPage(); + int offset = 0; + List labelIds = new List(); + + try { + do { + // Create a statement to page through active labels. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get labels by statement. + page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + Console.WriteLine("{0}) Label with ID '{1}', name '{2}' will be deactivated.", + i, label.id, label.name); + labelIds.Add(label.id.ToString()); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of labels to be deactivated: " + labelIds.Count); + + if (labelIds.Count > 0) { + // Modify statement for action. + filterStatement.query = "WHERE id IN (" + string.Join(", ", labelIds.ToArray()) + ")"; + + // Create action. + DeactivateLabels action = new DeactivateLabels(); + + // Perform action. + UpdateResult result = labelService.performLabelAction(action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of labels deactivated: " + result.numChanges); + } else { + Console.WriteLine("No labels were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LabelService/GetAllLabels.cs b/examples/Dfp/CSharp/v201311/LabelService/GetAllLabels.cs new file mode 100644 index 00000000000..a000f66d70d --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LabelService/GetAllLabels.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all labels. To create labels, run CreateLabels.cs. + /// This feature is only available to DFP premium solution networks. + /// + /// Tags: LabelService.getLabelsByStatement + /// + class GetAllLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all labels. To create labels, run CreateLabels.cs. This " + + "feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201311.LabelService); + + // Set defaults for page and filterStatement. + LabelPage page = new LabelPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all labels. + filterStatement.query = "LIMIT 500 OFFSET " + offset.ToString(); + + // Get labels by statement. + page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("{0}) Label with ID '{1}', name '{2}' and type '{3}' was found.", + i, label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LabelService/GetLabel.cs b/examples/Dfp/CSharp/v201311/LabelService/GetLabel.cs new file mode 100644 index 00000000000..94d10093fe6 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LabelService/GetLabel.cs @@ -0,0 +1,83 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets a label by its ID. To determine which labels exist, + /// run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabel + /// + class GetLabel : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a label by its ID. To determine which labels exist, " + + "run GetAllLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLabel(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201311.LabelService); + + // Set the ID of the label to get. + long labelId = long.Parse(_T("INSERT_LABEL_ID_HERE")); + + try { + // Get the label. + Label label = labelService.getLabel(labelId); + + if (label != null) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + Console.WriteLine("Label with ID '{0}, name '{1}' and type '{2}' was found.", + label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + } else { + Console.WriteLine("No label found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get label. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LabelService/GetLabelsByStatement.cs b/examples/Dfp/CSharp/v201311/LabelService/GetLabelsByStatement.cs new file mode 100644 index 00000000000..2f6971ffe9d --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LabelService/GetLabelsByStatement.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all labels that are competitively excluded. The + /// statement retrieves up to the maximum page size limit of 500. To create + /// labels, run CreateLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement + /// + class GetLabelsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all labels that are competitively excluded. The statement " + + "retrieves up to the maximum page size limit of 500. To create labels, run " + + "CreateLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLabelsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201311.LabelService); + + // Create a statement to only select labels that are competitive + // sorted by name. + Statement filterStatement = new StatementBuilder("WHERE type = :type ORDER BY name LIMIT 500") + .AddValue("type", LabelType.COMPETITIVE_EXCLUSION.ToString()).ToStatement(); + + try { + // Get labels by statement. + LabelPage page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("{0}) Label with ID '{1}', name '{2}'and type '{3}' was found.", + i, label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LabelService/UpdateLabels.cs b/examples/Dfp/CSharp/v201311/LabelService/UpdateLabels.cs new file mode 100644 index 00000000000..215fe2c356e --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LabelService/UpdateLabels.cs @@ -0,0 +1,99 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example updates the descriptions of all active labels by + /// updating its description up to the first 500. To determine which labels + /// exist, run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement, LabelService.updateLabels + /// + class UpdateLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the descriptions of all active labels by updating " + + "its description up to the first 500. To determine which labels exist, run " + + "GetAllLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201311.LabelService); + + // Create a statement to only select labels that are competitive + // exclusion. + Statement filterStatement = new StatementBuilder("WHERE isActive = :isActive LIMIT 500"). + AddValue("isActive", true).ToStatement(); + + try { + // Get the labels by statement. + LabelPage page = labelService.getLabelsByStatement(filterStatement); + + if (page.results != null) { + Label[] labels = page.results; + + // Update each local label object by updating its description. + foreach (Label label in labels) { + label.description = "These labels are still competiting with each other."; + } + + // Update the labels on the server. + labels = labelService.updateLabels(labels); + + if (labels != null) { + foreach (Label label in labels) { + Console.WriteLine("A label with ID '{0}' and name '{1}' was updated.", + label.id, label.name); + } + } else { + Console.WriteLine("No labels updated."); + } + } else { + Console.WriteLine("No labels found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/ActivateLicas.cs b/examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/ActivateLicas.cs new file mode 100644 index 00000000000..78e7bfd907a --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/ActivateLicas.cs @@ -0,0 +1,125 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example activates all deactivated LICAs for the line item. To + /// determine which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.performLineItemCreativeAssociationAction + /// + class ActivateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example activates all deactivated LICAs for the line item. To " + + "determine which LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ActivateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201311.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + String statementText = "WHERE lineItemId = :lineItemId and status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("lineItemId", lineItemId). + AddValue("status", LineItemCreativeAssociationStatus.INACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + int offset = 0; + List creativeIds = new List(); + + try { + do { + // Create a Statement to page through active LICAs. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' will be activated.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + creativeIds.Add(lica.creativeId.ToString()); + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of LICAs to be activated: {0}", creativeIds.Count); + + if (creativeIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE lineItemId = :lineItemId and creativeId IN ({0})", + string.Join(",", creativeIds.ToArray()))). + AddValue("lineItemId", lineItemId).ToStatement(); + + // Create action. + ActivateLineItemCreativeAssociations action = + new ActivateLineItemCreativeAssociations(); + + // Perform action. + UpdateResult result = + licaService.performLineItemCreativeAssociationAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of LICAs activated: {0}", result.numChanges); + } else { + Console.WriteLine("No LICAs were activated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to activate LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/CreateLicas.cs b/examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/CreateLicas.cs new file mode 100644 index 00000000000..5ae3bf0b5e3 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/CreateLicas.cs @@ -0,0 +1,108 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates new line item creative associations (LICAs) for + /// an existing line item and a set of creative ids. For small business + /// networks, the creative ids must represent new or copied creatives as + /// creatives cannot be used for more than one line item. For premium + /// solution networks, the creative ids can represent any creative. To copy + /// creatives, run CopyImageCreatives.cs. To determine which LICAs exist, run + /// GetAllLicasExample.cs. + /// + /// Tags: LineItemCreativeAssociationService.createLineItemCreativeAssociations + /// + class CreateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new line item creative associations (LICAs) for an " + + "existing line item and a set of creative ids. For small business networks, the " + + "creative ids must represent new or copied creatives as creatives cannot be used " + + "for more than one line item. For premium solution networks, the creative ids can " + + "represent any creative. To copy creatives, run CopyImageCreatives.cs. To determine " + + "which LICAs exist, run GetAllLicasExample.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = + (LineItemCreativeAssociationService) user.GetService( + DfpService.v201311.LineItemCreativeAssociationService); + + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201311.CreativeService); + + // Set the line item ID and creative IDs to associate. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long[] creativeIds = new long[] {long.Parse(_T("INSERT_CREATIVE_ID_HERE"))}; + + // Create an array to store local LICA objects. + LineItemCreativeAssociation[] licas = new LineItemCreativeAssociation[creativeIds.Length]; + + // For each line item, associate it with the given creative. + int i = 0; + foreach (long creativeId in creativeIds) { + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId; + lica.lineItemId = lineItemId; + licas[i++] = lica; + } + + try { + // Create the LICAs on the server. + licas = licaService.createLineItemCreativeAssociations(licas); + + if (licas != null) { + foreach (LineItemCreativeAssociation lica in licas) { + Console.WriteLine("A LICA with line item ID \"{0}\", creative ID \"{1}\", and status " + + "\"{2}\" was created.", lica.lineItemId, lica.creativeId, lica.status); + } + } else { + Console.WriteLine("No LICAs created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to associate creative with line item. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/DeactivateLicas.cs b/examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/DeactivateLicas.cs new file mode 100644 index 00000000000..01de393aa88 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/DeactivateLicas.cs @@ -0,0 +1,125 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example deactivates all LICAs for the line item. To determine + /// which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.performLineItemCreativeAssociationAction + /// + class DeactivateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all LICAs for the line item. To determine which " + + "LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201311.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + String statementText = "WHERE lineItemId = :lineItemId and status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("lineItemId", lineItemId). + AddValue("status", LineItemCreativeAssociationStatus.ACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + int offset = 0; + List creativeIds = new List(); + + try { + do { + // Create a Statement to page through active LICAs. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' will be deactivated.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + creativeIds.Add(lica.creativeId.ToString()); + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of LICAs to be deactivated: {0}", creativeIds.Count); + + if (creativeIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE lineItemId = :lineItemId and creativeId IN ({0})", + string.Join(",", creativeIds.ToArray()))). + AddValue("lineItemId", lineItemId).ToStatement(); + + // Create action. + DeactivateLineItemCreativeAssociations action = + new DeactivateLineItemCreativeAssociations(); + + // Perform action. + UpdateResult result = + licaService.performLineItemCreativeAssociationAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of LICAs deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No LICAs were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/GetAllLicas.cs b/examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/GetAllLicas.cs new file mode 100644 index 00000000000..f0a61823380 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/GetAllLicas.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all line item creative associations (LICA). To + /// create LICAs, run CreateLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// + class GetAllLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line item creative associations (LICA). To create " + + "LICAs, run CreateLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201311.LineItemCreativeAssociationService); + + // Sets defaults for page and Statement. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all LICAs. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' was found.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + } + } + + offset += 500; + } while (page.results != null && page.results.Length == 500); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/GetLica.cs b/examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/GetLica.cs new file mode 100644 index 00000000000..8ac6627174a --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/GetLica.cs @@ -0,0 +1,81 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets a line item creative association (LICA) by the line + /// item and creative ID. To determine which line items exist, run + /// GetAllLineItems.cs. To determine which creatives exit, run + /// GetAllCreatives.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociation + /// + class GetLica : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a line item creative association (LICA) by the line " + + "item and creative ID. To determine which line items exist, run " + + "GetAllLineItems.cs. To determine which creatives exit, run " + + "GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + new GetLica().Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201311.LineItemCreativeAssociationService); + + // Set the line item and creative ID to use to retrieve the LICA. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long creativeId = long.Parse(_T("INSERT_CREATIVE_ID_HERE")); + + try { + // Get the LICA. + LineItemCreativeAssociation lica = + licaService.getLineItemCreativeAssociation(lineItemId, creativeId); + + if (lica != null) { + Console.WriteLine("LICA with line item ID = {0}, creative ID = '{1}' and status = " + + "'{2}' was found", lica.lineItemId, lica.creativeId, lica.status); + } else { + Console.WriteLine("No LICA found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get LICA. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/GetLicasByStatement.cs b/examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/GetLicasByStatement.cs new file mode 100644 index 00000000000..a54aa5a43b9 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/GetLicasByStatement.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all line item creative associations for a given + /// line item ID. The Statement retrieves up to the maximum page size limit of + /// 500. To create LICAs, run CreateLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// + class GetLicasByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line item creative associations for a given line " + + "item ID. The Statement retrieves up to the maximum page size limit of 500. To " + + "create LICAs, run CreateLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLicasByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201311.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + // Create a Statement to only select LICAs for the given lineItem ID. + Statement statement = new StatementBuilder("WHERE lineItemId = :lineItemId LIMIT 500"). + AddValue("lineItemId", lineItemId).ToStatement(); + + try { + // Get LICAs by Statement. + LineItemCreativeAssociationPage page = + licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' was found.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/UpdateLicas.cs b/examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/UpdateLicas.cs new file mode 100644 index 00000000000..08e6343c1a7 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LineItemCreativeAssociationService/UpdateLicas.cs @@ -0,0 +1,97 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example updates the destination URL of all LICAs up to the first + /// 500. To determine which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.updateLineItemCreativeAssociations + /// + class UpdateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the destination URL of all LICAs up to the first " + + "500. To determine which LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201311.LineItemCreativeAssociationService); + + // Create a Statement to get all LICAs. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get LICAs by Statement. + LineItemCreativeAssociationPage page = + licaService.getLineItemCreativeAssociationsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + LineItemCreativeAssociation[] licas = page.results; + + // Update each local LICA object by changing its destination URL. + foreach (LineItemCreativeAssociation lica in licas) { + lica.destinationUrl = "http://news.google.com"; + } + + // Update the LICAs on the server. + licas = licaService.updateLineItemCreativeAssociations(licas); + + if (licas != null) { + foreach (LineItemCreativeAssociation lica in licas) { + Console.WriteLine("LICA with line item ID = '{0}, creative ID ='{1}' and " + + "destination URL '{2}' was updated.", lica.lineItemId, lica.creativeId, + lica.destinationUrl); + } + } else { + Console.WriteLine("No LICAs updated."); + } + } else { + Console.WriteLine("No LICAs found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LineItemService/ActivateLineItem.cs b/examples/Dfp/CSharp/v201311/LineItemService/ActivateLineItem.cs new file mode 100644 index 00000000000..d128cd6a4b4 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LineItemService/ActivateLineItem.cs @@ -0,0 +1,134 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example activates all line items for the given order. To be + /// activated, line items need to be in the approved (needs creatives) state + /// and have at least one creative associated with them. To approve line + /// items, approve the order to which they belong by running ApproveOrders.cs. + /// To create LICAs, run CreateLicas.cs. To determine which line items exist, + /// run GetAllLineItem.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.performLineItemAction + /// + class ActivateLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example activates all line items for the given order. To be activated," + + " line items need to be in the approved (needs creatives) state and have at least one" + + " creative associated with them. To approve line items, approve the order to which" + + " they belong by running ApproveOrders.cs. To create LICAs, run CreateLicas.cs." + + " To determine which line items exist, run GetAllLineItem.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ActivateLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201311.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create Statement text to select approved line items from a given order. + string statementText = "WHERE orderId = :orderId and status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("orderId", orderId). + AddValue("status", ComputedStatus.NEEDS_CREATIVES.ToString()).ToStatement(); + + // Set defaults for page and offset. + LineItemPage page = new LineItemPage(); + int offset = 0; + int i = 0; + List lineItemIds = new List(); + + try { + do { + // Create a Statement to page through approved line items. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get line items by Statement. + page = lineItemService.getLineItemsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + foreach (LineItemSummary lineItem in page.results) { + // Archived line items cannot be activated. + if (!lineItem.isArchived) { + Console.WriteLine("{0}) Line item with ID ='{1}', belonging to order ID ='{2}' " + + "and name ='{2}' will be activated.", i, lineItem.id, lineItem.orderId, + lineItem.name); + lineItemIds.Add(lineItem.id.ToString()); + i++; + } + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of line items to be activated: {0}", lineItemIds.Count); + + if (lineItemIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", lineItemIds.ToArray()))). + ToStatement(); + + // Create action. + ActivateLineItems action = new ActivateLineItems(); + + // Perform action. + UpdateResult result = lineItemService.performLineItemAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of line items activated: {0}", result.numChanges); + } else { + Console.WriteLine("No line items were activated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to activate line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LineItemService/CreateLineItems.cs b/examples/Dfp/CSharp/v201311/LineItemService/CreateLineItems.cs new file mode 100644 index 00000000000..e4c1266e6e0 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LineItemService/CreateLineItems.cs @@ -0,0 +1,216 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates new line items. To determine which line items + /// exist, run GetAllLineItems.cs. To determine which orders exist, run + /// GetAllOrders.cs. To determine which placements exist, run + /// GetAllPlacements.cs. To determine the IDs for locations, run + /// GetAllCities.cs, GetAllCountries.cs, GetAllMetros.cs, GetAllRegions.cs and + /// GetAllPostalCodes. + /// + /// Tags: LineItemService.createLineItems + /// + class CreateLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new line items. To determine which line items " + + "exist, run GetAllLineItems.cs. To determine which orders exist, run GetAllOrders.cs" + + ". To determine which placements exist, run GetAllPlacements.cs. To determine the " + + "IDs for locations, run GetAllCities.cs, GetAllCountries.cs, GetAllMetros.cs, " + + "GetAllRegions.cs and GetAllPostalCodes."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code examples. + /// + /// The DFP user object running the code examples. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201311.LineItemService); + + // Set the order that all created line items will belong to and the + // placement ID to target. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + long[] targetPlacementIds = new long[] {long.Parse(_T("INSERT_PLACEMENT_ID_HERE"))}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = targetPlacementIds; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + Location postalCodeLocation = new Location(); + postalCodeLocation.id = 9000093; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201311.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201311.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + // Create an array to store local line item objects. + LineItem[] lineItems = new LineItem[5]; + + for (int i = 0; i < 5; i++) { + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + i; + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + lineItems[i] = lineItem; + } + + try { + // Create the line items on the server. + lineItems = lineItemService.createLineItems(lineItems); + + if (lineItems != null) { + foreach (LineItem lineItem in lineItems) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and" + + " named \"{2}\" was created.", lineItem.id, lineItem.orderId, lineItem.name); + } + } else { + Console.WriteLine("No line items created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LineItemService/CreateMobileLineItem.cs b/examples/Dfp/CSharp/v201311/LineItemService/CreateMobileLineItem.cs new file mode 100644 index 00000000000..7dc5e1967f4 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LineItemService/CreateMobileLineItem.cs @@ -0,0 +1,172 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates a new line item to serve to the mobile platform. + /// Mobile features needs to be enabled in your account to use mobile + /// targeting. To determine which line items exist, run GetAllLineItems.cs. To + /// determine which orders exist, run GetAllOrders.cs. To determine + /// which placements exist, run GetAllPlacements.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.performLineItemAction + /// + class CreateMobileLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new line item to serve to the mobile platform. Mobile" + + " features needs to be enabled in your account to use mobile targeting. To determine " + + "which line items exist, run GetAllLineItems.cs. To determine which orders exist, " + + "run GetAllOrders.cs. To determine which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateMobileLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201311.LineItemService); + + // Set the order that all created line items will belong to and the + // placement containing ad units with a mobile target platform. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + long[] targetedPlacementIds = new long[] {long.Parse(_T("INSERT_MOBILE_PLACEMENT_ID_HERE"))}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = targetedPlacementIds; + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create device manufacturer targeting. + DeviceManufacturerTargeting deviceManufacturerTargeting = new DeviceManufacturerTargeting(); + deviceManufacturerTargeting.isTargeted = true; + + // Target the Google device manufacturer (40100). + Technology deviceManufacturerTechnology = new Technology(); + deviceManufacturerTechnology.id = 40100L; + deviceManufacturerTargeting.deviceManufacturers = + new Technology[] {deviceManufacturerTechnology}; + technologyTargeting.deviceManufacturerTargeting = deviceManufacturerTargeting; + + // Create mobile device targeting. + MobileDeviceTargeting mobileDeviceTargeting = new MobileDeviceTargeting(); + + // Exclude the Nexus One device (604046). + Technology mobileDeviceTechnology = new Technology(); + mobileDeviceTechnology.id = 604046L; + mobileDeviceTargeting.targetedMobileDevices = new Technology[] {mobileDeviceTechnology}; + technologyTargeting.mobileDeviceTargeting = mobileDeviceTargeting; + + // Create mobile device submodel targeting. + MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargeting = + new MobileDeviceSubmodelTargeting(); + + // Target the iPhone 4 device submodel (640003). + Technology mobileDeviceSubmodelTechnology = new Technology(); + mobileDeviceSubmodelTechnology.id = 640003L; + mobileDeviceSubmodelTargeting.targetedMobileDeviceSubmodels = + new Technology[] {mobileDeviceSubmodelTechnology}; + technologyTargeting.mobileDeviceSubmodelTargeting = mobileDeviceSubmodelTargeting; + + // Create targeting. + Targeting targeting = new Targeting(); + targeting.inventoryTargeting = inventoryTargeting; + targeting.technologyTargeting = technologyTargeting; + + // Create local line item object. + LineItem lineItem = new LineItem(); + lineItem.name = "Mobile line item"; + lineItem.orderId = orderId; + lineItem.targeting = targeting; + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the target platform to mobile. + lineItem.targetPlatform = TargetPlatform.MOBILE; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + creativePlaceholder.size = size; + + // Set the size of creatives that can be associated with this line item. + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromString("20120901 00:00:00"); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + Money money = new Money(); + money.currencyCode = "USD"; + money.microAmount = 2000000L; + lineItem.costPerUnit = money; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + try { + // Create the line item on the server. + lineItem = lineItemService.createLineItem(lineItem); + + if (lineItem != null) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and " + + "named \"{2}\" was created.", lineItem.id, lineItem.orderId, lineItem.name); + } else { + Console.WriteLine("No line item created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LineItemService/CreateVideoLineItem.cs b/examples/Dfp/CSharp/v201311/LineItemService/CreateVideoLineItem.cs new file mode 100644 index 00000000000..7cb6877a5e3 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LineItemService/CreateVideoLineItem.cs @@ -0,0 +1,187 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates a new line item to serve to video content. To + /// determine which line items exist, run GetAllLineItems.cs. To determine + /// which orders exist, run GetAllOrders.cs. To create a video ad unit, run + /// CreateVideoAdUnit.cs. To create criteria for categories, run + /// CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: LineItemService.createLineItem + /// + class CreateVideoLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new line item to serve to video content. To determine" + + " which line items exist, run GetAllLineItems.cs. To determine which orders exist, " + + "run GetAllOrders.cs. To create a video ad unit, run CreateVideoAdUnit.cs. To " + + "create criteria for categories, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateVideoLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201311.LineItemService); + + // Set the order that all created line items will belong to and the + // video ad unit ID to target. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + string targetedVideoAdUnitId = _T("INSERT_TARGETED_VIDEO_AD_UNIT_ID_HERE"); + + // Set the custom targeting key ID and value ID representing the metadata + // on the content to target. This would typically be a key representing + // a "genre" and a value representing something like "comedy". + long contentCustomTargetingKeyId = + long.Parse(_T("INSERT_CONTENT_CUSTOM_TARGETING_KEY_ID_HERE")); + long contentCustomTargetingValueId = + long.Parse(_T("INSERT_CONTENT_CUSTOM_TARGETING_VALUE_ID_HERE")); + + // Create custom criteria for the content metadata targeting. + CustomCriteria contentCustomCriteria = new CustomCriteria(); + contentCustomCriteria.keyId = contentCustomTargetingKeyId; + contentCustomCriteria.valueIds = new long[] {contentCustomTargetingValueId}; + contentCustomCriteria.@operator = CustomCriteriaComparisonOperator.IS; + + // Create custom criteria set. + CustomCriteriaSet customCriteriaSet = new CustomCriteriaSet(); + customCriteriaSet.children = new CustomCriteriaNode[] {contentCustomCriteria}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + AdUnitTargeting adUnitTargeting = new AdUnitTargeting(); + adUnitTargeting.adUnitId = targetedVideoAdUnitId; + adUnitTargeting.includeDescendants = true; + inventoryTargeting.targetedAdUnits = new AdUnitTargeting[] {adUnitTargeting}; + + // Create video position targeting. + VideoPosition videoPosition = new VideoPosition(); + videoPosition.positionType = VideoPositionType.PREROLL; + VideoPositionTarget videoPositionTarget = new VideoPositionTarget(); + videoPositionTarget.videoPosition = videoPosition; + VideoPositionTargeting videoPositionTargeting = new VideoPositionTargeting(); + videoPositionTargeting.targetedPositions = new VideoPositionTarget[] {videoPositionTarget}; + + // Create targeting. + Targeting targeting = new Targeting(); + targeting.customTargeting = customCriteriaSet; + targeting.inventoryTargeting = inventoryTargeting; + targeting.videoPositionTargeting = videoPositionTargeting; + + // Create local line item object. + LineItem lineItem = new LineItem(); + lineItem.name = "Video line item - " + this.GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = targeting; + lineItem.lineItemType = LineItemType.SPONSORSHIP; + lineItem.allowOverbook = true; + + // Set the environment type to video. + lineItem.environmentType = EnvironmentType.VIDEO_PLAYER; + + // Set the creative rotation type to optimized. + lineItem.creativeRotationType = CreativeRotationType.OPTIMIZED; + + // Create the master creative placeholder. + CreativePlaceholder creativeMasterPlaceholder = new CreativePlaceholder(); + Size size1 = new Size(); + size1.width = 400; + size1.height = 300; + size1.isAspectRatio = false; + creativeMasterPlaceholder.size = size1; + + // Create companion creative placeholders. + CreativePlaceholder companionCreativePlaceholder1 = new CreativePlaceholder(); + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + size2.isAspectRatio = false; + companionCreativePlaceholder1.size = size2; + + CreativePlaceholder companionCreativePlaceholder2 = new CreativePlaceholder(); + Size size3 = new Size(); + size3.width = 728; + size3.height = 90; + size3.isAspectRatio = false; + companionCreativePlaceholder2.size = size3; + + // Set companion creative placeholders. + creativeMasterPlaceholder.companions = new CreativePlaceholder[] { + companionCreativePlaceholder1, companionCreativePlaceholder2}; + + // Set the size of creatives that can be associated with this line item. + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativeMasterPlaceholder}; + + // Set delivery of video companions to optional. + lineItem.companionDeliveryOption = CompanionDeliveryOption.OPTIONAL; + + // Set the length of the line item to run. + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromString("20120901 00:00:00"); + + // Set the cost per day to $1. + lineItem.costType = CostType.CPD; + Money money = new Money(); + money.currencyCode = "USD"; + money.microAmount = 1000000L; + lineItem.costPerUnit = money; + + // Set the percentage to be 100%. + lineItem.unitsBought = 100; + + try { + // Create the line item on the server. + lineItem = lineItemService.createLineItem(lineItem); + + if (lineItem != null) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and " + + "named \"{2}\" was created.", lineItem.id, lineItem.orderId, lineItem.name); + } else { + Console.WriteLine("No line item created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LineItemService/GetAllLineItems.cs b/examples/Dfp/CSharp/v201311/LineItemService/GetAllLineItems.cs new file mode 100644 index 00000000000..9b044696206 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LineItemService/GetAllLineItems.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all line items. To create line items, run + /// CreateLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// + class GetAllLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items. To create line items, run " + + "CreateLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201311.LineItemService); + + // Sets defaults for page and Statement. + LineItemPage page = new LineItemPage(); + Statement statement = new Statement(); + int offset = 0; + try { + do { + // Create a Statement to get all line items. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get line items by Statement. + page = lineItemService.getLineItemsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemSummary lineItem in page.results) { + Console.WriteLine("{0}) Line item with ID = '{1}', belonging to order ID ='{2}'" + + " , and named '{3}' was found.", i, lineItem.id, lineItem.orderId, + lineItem.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LineItemService/GetLineItem.cs b/examples/Dfp/CSharp/v201311/LineItemService/GetLineItem.cs new file mode 100644 index 00000000000..0aaf9401e5f --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LineItemService/GetLineItem.cs @@ -0,0 +1,78 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets a line item by its ID. To determine which line + /// items exist, run GetAllLineItems.cs. + /// + /// Tags: LineItemService.getLineItem + /// + class GetLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a line item by its ID. To determine which line items " + + "exist, run GetAllLineItems.cs"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201311.LineItemService); + + // Set the ID of the line item to get. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get the line item. + LineItem lineItem = lineItemService.getLineItem(lineItemId); + + if (lineItem != null) { + Console.WriteLine("Line item with ID ='{0}', belonging to order ID ='{1}', and named " + + "'{2}' was found.", lineItem.id, lineItem.orderId, lineItem.name); + } else { + Console.WriteLine("No line item found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get line item by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LineItemService/GetLineItemsByStatement.cs b/examples/Dfp/CSharp/v201311/LineItemService/GetLineItemsByStatement.cs new file mode 100644 index 00000000000..c172469543e --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LineItemService/GetLineItemsByStatement.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all line items for the given order. The Statement + /// retrieves up to the maximum page size limit of 500. To create line items, + /// run CreateLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// + class GetLineItemsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items for the given order. The Statement " + + "retrieves up to the maximum page size limit of 500. To create line items, " + + "run CreateLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLineItemsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201311.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create a statement to only select line items that need creatives from a + // given order. + Statement filterStatement = + new StatementBuilder("WHERE orderId = :orderId AND status = :status LIMIT 500") + .AddValue("orderId", orderId) + .AddValue("status", ComputedStatus.NEEDS_CREATIVES.ToString()) + .ToStatement(); + + try { + // Get line items by Statement. + LineItemPage page = lineItemService.getLineItemsByStatement(filterStatement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItem lineItem in page.results) { + Console.WriteLine("{0}) Line item with ID ='{1}', belonging to order ID = '{2}' and " + + "named '{3}' was found.", i, lineItem.id, lineItem.orderId, lineItem.name); + i++; + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get line item by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LineItemService/GetRecentlyUpdatedLineItems.cs b/examples/Dfp/CSharp/v201311/LineItemService/GetRecentlyUpdatedLineItems.cs new file mode 100644 index 00000000000..3d3b4a06e5a --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LineItemService/GetRecentlyUpdatedLineItems.cs @@ -0,0 +1,92 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; +using Google.Api.Ads.Dfp.Util.v201311; + +using System; + +using DateTime = Google.Api.Ads.Dfp.v201311.DateTime; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example shows how to get recently updated line items. To create + /// line items, run CreateLineItems.cs. + /// + /// Tags: LineItemService.GetRecentlyUpdatedLineItems + /// + class GetRecentlyUpdatedLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a line item by its ID. To determine which line items " + + "exist, run GetAllLineItems.cs"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetRecentlyUpdatedLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201311.LineItemService); + + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + try { + // Create statement to only select line items for the given order that + // have been modified in the last 3 days. + DateTime threeDaysAgo = DateTimeUtilities.FromDateTime(System.DateTime.Now.AddDays(-3)); + Statement filterStatement = new StatementBuilder( + "WHERE lastModifiedDateTime >= :lastModifiedDateTime AND orderId = :orderId LIMIT 500"). + AddValue("lastModifiedDateTime", threeDaysAgo). + AddValue("orderId", orderId).ToStatement(); + + + // Get line items by statement. + LineItemPage page = lineItemService.getLineItemsByStatement(filterStatement); + + // Display results. + if (page != null && page.results != null) { + foreach (LineItem lineItem in page.results) { + Console.WriteLine("Line item with id \"{0}\", belonging to order id \"{1}\" and " + + "named \"{2}\" was found.", lineItem.id, lineItem.orderId, lineItem.name); + } + Console.WriteLine("Number of results found: {1}.", page.totalResultSetSize); + } else { + Console.WriteLine("No line items were found."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LineItemService/TargetCustomCriteria.cs b/examples/Dfp/CSharp/v201311/LineItemService/TargetCustomCriteria.cs new file mode 100644 index 00000000000..03754c9eddc --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LineItemService/TargetCustomCriteria.cs @@ -0,0 +1,167 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example updates a line item to add custom criteria targeting. To + /// determine which line items exist, run GetAllLineItems.cs. To determine + /// which custom targeting keys and values exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: LineItemService.getLineItem, LineItemService.updateLineItem + /// + class TargetCustomCriteria : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a line item to add custom criteria targeting. To " + + "determine which line items exist, run GetAllLineItems.cs. To determine which custom " + + "targeting keys and values exist, run GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new TargetCustomCriteria(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201311.LineItemService); + + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = (CustomTargetingService) user.GetService( + DfpService.v201311.CustomTargetingService); + + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long[] customCriteriaIds1 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + long[] customCriteriaIds2 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + long[] customCriteriaIds3 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + + // Create custom criteria. + CustomCriteria customCriteria1 = new CustomCriteria(); + customCriteria1.keyId = customCriteriaIds1[0]; + customCriteria1.valueIds = new long[] {customCriteriaIds1[1]}; + customCriteria1.@operator = CustomCriteriaComparisonOperator.IS; + + CustomCriteria customCriteria2 = new CustomCriteria(); + customCriteria2.keyId = customCriteriaIds2[0]; + customCriteria2.valueIds = new long[] {customCriteriaIds2[1]}; + customCriteria2.@operator = CustomCriteriaComparisonOperator.IS_NOT; + + CustomCriteria customCriteria3 = new CustomCriteria(); + customCriteria3.keyId = customCriteriaIds3[0]; + customCriteria3.valueIds = new long[] {customCriteriaIds3[1]}; + customCriteria3.@operator = CustomCriteriaComparisonOperator.IS; + + // Create the custom criteria set that will resemble: + // + // (customCriteria1.key == customCriteria1.value OR + // (customCriteria2.key != customCriteria2.value AND + // customCriteria3.key == customCriteria3.value)) + CustomCriteriaSet topCustomCriteriaSet = new CustomCriteriaSet(); + topCustomCriteriaSet.logicalOperator = CustomCriteriaSetLogicalOperator.OR; + + CustomCriteriaSet subCustomCriteriaSet = new CustomCriteriaSet(); + subCustomCriteriaSet.logicalOperator = CustomCriteriaSetLogicalOperator.AND; + subCustomCriteriaSet.children = + new CustomCriteriaNode[] {customCriteria2, customCriteria3}; + topCustomCriteriaSet.children = + new CustomCriteriaNode[] {customCriteria1, subCustomCriteriaSet}; + + try { + // Set the custom criteria targeting on the line item. + LineItem lineItem = lineItemService.getLineItem(lineItemId); + lineItem.targeting.customTargeting = topCustomCriteriaSet; + + // Update the line items on the server. + lineItem = lineItemService.updateLineItem(lineItem); + + // Display the updated line item. + Console.WriteLine("Line item with ID {0} updated with custom criteria targeting \n{1}\n", + lineItem.id, getCustomCriteriaSetString(lineItem.targeting.customTargeting, 0)); + } catch (Exception ex) { + Console.WriteLine("Failed to add custom target criteria. Exception says \"{0}\"", + ex.Message); + } + } + + /// + /// Gets a string representation of the custom criteria node. If it has + /// children, each child will be appended to the string recursively. + /// + /// The root custom criteria node. + /// The level of the custom criteria tree. + /// + /// A string representation of the custom criteria node and its + /// children + /// + private static string getCustomCriteriaSetString(CustomCriteriaNode root, int level) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < level; i++) { + sb.Append("\t"); + } + + if (root is CustomCriteria) { + CustomCriteria customCriteria = (CustomCriteria) root; + StringBuilder ids = new StringBuilder(); + for (int j = 0; j < customCriteria.valueIds.Length; j++) { + ids.Append(customCriteria.valueIds[j] + ", "); + } + + sb.AppendFormat("Custom criteria: operator: [{0}] key: [{1}] values: [{2}]\n", + customCriteria.@operator, customCriteria.keyId, ids.ToString().TrimEnd(',', ' ')); + return sb.ToString(); + } else if (root is CustomCriteriaSet) { + CustomCriteriaSet customCriteriaSet = (CustomCriteriaSet) root; + sb.AppendFormat("Custom criteria set: operator: [{0}] children: \n", + customCriteriaSet.logicalOperator); + foreach (CustomCriteriaNode node in customCriteriaSet.children) { + sb.Append(getCustomCriteriaSetString(node, level + 1)); + } + return sb.Append("\n").ToString(); + } else { + throw new Exception("Unexpected node: " + root.CustomCriteriaNodeType); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/LineItemService/UpdateLineItems.cs b/examples/Dfp/CSharp/v201311/LineItemService/UpdateLineItems.cs new file mode 100644 index 00000000000..798f1aa61d4 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/LineItemService/UpdateLineItems.cs @@ -0,0 +1,108 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example updates the delivery rate of all line items up to the + /// first 500. To determine which line items exist, run GetAllLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.updateLineItems + /// + class UpdateLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the delivery rate of all line items up to the first " + + "500. To determine which line items exist, run GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201311.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create a Statement to get line items with even delivery rates. + Statement statement = new StatementBuilder("WHERE deliveryRateType = :deliveryRateType and " + + "orderId = :orderId LIMIT 500").AddValue("deliveryRateType", + DeliveryRateType.EVENLY.ToString()).AddValue("orderId", orderId).ToStatement(); + + try { + // Get line items by Statement. + LineItemPage page = lineItemService.getLineItemsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + LineItem[] lineItems = page.results; + List lineItemsToUpdate = new List(); + + // Update each local line item object by changing its delivery rate. + foreach (LineItem lineItem in lineItems) { + // Archived line items cannot be updated. + if (!lineItem.isArchived) { + lineItem.deliveryRateType = DeliveryRateType.AS_FAST_AS_POSSIBLE; + lineItemsToUpdate.Add(lineItem); + } + } + + // Update the line items on the server. + lineItems = lineItemService.updateLineItems(lineItemsToUpdate.ToArray()); + + if (lineItems != null) { + foreach (LineItem lineItem in lineItems) { + Console.WriteLine("A line item with ID = '{0}', belonging to order ID = '{1}', " + + "named '{2}', and having delivery rate = '{3}' was updated.", + lineItem.id, lineItem.orderId, lineItem.name, lineItem.deliveryRateType); + } + } else { + Console.WriteLine("No line items updated."); + } + } else { + Console.WriteLine("No line items found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/NetworkService/GetAllNetworks.cs b/examples/Dfp/CSharp/v201311/NetworkService/GetAllNetworks.cs new file mode 100644 index 00000000000..83d3392ab37 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/NetworkService/GetAllNetworks.cs @@ -0,0 +1,81 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all networks that you have access to with the + /// current login credentials. A networkCode should be left out for this + /// request. + /// + /// Tags: NetworkService.getAllNetworks + /// + class GetAllNetworks : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all networks that you have access to with the current " + + "login credentials. A networkCode should be left out for this request."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllNetworks(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201311.NetworkService); + // Set the networkCode field to null to retrieve all networks you have + // access to. + networkService.RequestHeader.networkCode = null; + + try { + // Get all networks that you have access to with the current login + // credentials. + Network[] networks = networkService.getAllNetworks(); + + int i = 0; + foreach (Network network in networks) { + Console.WriteLine("{0} ) Network with network code \"{1}\" and display name \"{2}\" " + + "was found.", i + 1, network.networkCode, network.displayName); + i++; + } + Console.WriteLine("Number of networks found: {0}", i); + } catch (Exception ex) { + Console.WriteLine("Failed to get all networks. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/NetworkService/GetCurrentNetwork.cs b/examples/Dfp/CSharp/v201311/NetworkService/GetCurrentNetwork.cs new file mode 100644 index 00000000000..187cda7abc8 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/NetworkService/GetCurrentNetwork.cs @@ -0,0 +1,70 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets the current network that you can make requests + /// against. + /// + /// Tags: NetworkService.getCurrentNetwork + /// + class GetCurrentNetwork : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the current network that you can make requests against."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCurrentNetwork(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201311.NetworkService); + + try { + // Get the current network. + Network network = networkService.getCurrentNetwork(); + + Console.WriteLine("Current network has network code \"{0}\" and display name \"{1}\".", + network.networkCode, network.displayName); + } catch (Exception ex) { + Console.WriteLine("Failed to get current network. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/NetworkService/MakeTestNetwork.cs b/examples/Dfp/CSharp/v201311/NetworkService/MakeTestNetwork.cs new file mode 100644 index 00000000000..78c7880fcbd --- /dev/null +++ b/examples/Dfp/CSharp/v201311/NetworkService/MakeTestNetwork.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates a test network. You do not need to have a DFP + /// account to run this example, but you do need to have a new Google account + /// (created at http://www.google.com/accounts/newaccount) that is not + /// associated with any other DFP networks (including old sandbox networks). + /// Once this network is created, you can supply the network code in your + /// settings to make calls to other services. + /// + /// Please see the following URL for more information: + /// https://developers.google.com/doubleclick-publishers/docs/signup + /// + /// Tags: NetworkService.makeTestNetwork + /// + class MakeTestNetwork : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a test network. You do not need to have a DFP" + + " account to run this example, but you do need to have a new Google account" + + " (created at http://www.google.com/accounts/newaccount) that is not associated " + + "with any other DFP networks (including old sandbox networks). Once this network " + + "is created, you can supply the network code in your settings to make calls to " + + "other services.\n\n Please see the following URL for more information:" + + " https://developers.google.com/doubleclick-publishers/docs/signup"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new MakeTestNetwork(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201311.NetworkService); + // Set the networkCode field to null. + networkService.RequestHeader.networkCode = null; + + try { + Network network = networkService.makeTestNetwork(); + + Console.WriteLine("Test network with network code \"{0}\" and display name \"{1}\" " + + "created.\nYou may now sign in at http://www.google.com/dfp/main?networkCode={0}", + network.networkCode, network.displayName); + } catch (Exception ex) { + Console.WriteLine("Failed to make test network. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/OrderService/ApproveOrder.cs b/examples/Dfp/CSharp/v201311/OrderService/ApproveOrder.cs new file mode 100644 index 00000000000..29cc13c46c1 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/OrderService/ApproveOrder.cs @@ -0,0 +1,121 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example approves and overbooks all eligible draft and pending + /// orders. To determine which orders exist, run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement, OrderService.performOrderAction + /// + class ApproveOrder : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example approves and overbooks all draft orders. To determine which " + + "orders exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ApproveOrder(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = + (OrderService) user.GetService(DfpService.v201311.OrderService); + + // Create Statement text to select all draft orders. + string statementText = "WHERE status IN (:status1, :status2) and endDateTime >= :today " + + "AND isArchived = FALSE LIMIT 500"; + Statement statement = new StatementBuilder(""). + AddValue("status1", OrderStatus.DRAFT.ToString()). + AddValue("status2", OrderStatus.PENDING_APPROVAL.ToString()). + AddValue("today", System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss")).ToStatement(); + + // Set defaults for page and offset. + OrderPage page = new OrderPage(); + int i = 0; + int offset = 0; + List orderIds = new List(); + + try { + do { + // Create a Statement to page through draft orders. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + // Get orders by Statement. + page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and status ='{3}' " + + "will be approved.", i, order.id, order.name, order.status); + orderIds.Add(order.id.ToString()); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of orders to be approved: {0}", orderIds.Count); + + if (orderIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", orderIds.ToArray()))). + ToStatement(); + + // Create action. + ApproveAndOverbookOrders action = new ApproveAndOverbookOrders(); + + // Perform action. + UpdateResult result = orderService.performOrderAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of orders approved: {0}", result.numChanges); + } else { + Console.WriteLine("No orders were approved."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to approve orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/OrderService/CreateOrders.cs b/examples/Dfp/CSharp/v201311/OrderService/CreateOrders.cs new file mode 100644 index 00000000000..93f244526a6 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/OrderService/CreateOrders.cs @@ -0,0 +1,96 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates new orders. To determine which orders exist, + /// run GetAllOrders.cs. + /// + /// Tags: OrderService.createOrders + /// + class CreateOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new orders. To determine which orders exist, " + + "run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = + (OrderService) user.GetService(DfpService.v201311.OrderService); + + // Set the advertiser, salesperson, and trafficker to assign to each + // order. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + long salespersonId = long.Parse(_T("INSERT_SALESPERSON_ID_HERE")); + long traffickerId = long.Parse(_T("INSERT_TRAFFICKER_ID_HERE")); + + // Create an array to store local order objects. + Order[] orders = new Order[5]; + + for (int i = 0; i < 5; i++) { + Order order = new Order(); + order.name = string.Format("Order #{0}", i); + order.advertiserId = advertiserId; + order.salespersonId = salespersonId; + order.traffickerId = traffickerId; + + orders[i] = order; + } + + try { + // Create the orders on the server. + orders = orderService.createOrders(orders); + + if (orders != null) { + foreach (Order order in orders) { + Console.WriteLine("An order with ID ='{0}' and named '{1}' was created.", + order.id, order.name); + } + } else { + Console.WriteLine("No orders created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/OrderService/GetAllOrders.cs b/examples/Dfp/CSharp/v201311/OrderService/GetAllOrders.cs new file mode 100644 index 00000000000..02c5fbb307e --- /dev/null +++ b/examples/Dfp/CSharp/v201311/OrderService/GetAllOrders.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all orders. To create orders, run CreateOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement + /// + class GetAllOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets all orders. To create orders, run CreateOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201311.OrderService); + + // Sets defaults for page and Statement. + OrderPage page = new OrderPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all orders. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get orders by Statement. + page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and advertiser " + + "ID = '{3}' was found.", i, order.id, order.name, order.advertiserId); + i++; + } + } + + offset += 500; + } while (page.results != null && page.results.Length == 500); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/OrderService/GetOrder.cs b/examples/Dfp/CSharp/v201311/OrderService/GetOrder.cs new file mode 100644 index 00000000000..d4e97a99398 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/OrderService/GetOrder.cs @@ -0,0 +1,75 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets an order by its ID. To determine which orders + /// exist, run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrder + /// + class GetOrder : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets an order by its ID. To determine which orders " + + "exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + new GetOrder().Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201311.OrderService); + + // Set the ID of the order to get. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + try { + // Get the order. + Order order = orderService.getOrder(orderId); + + if (order != null) { + Console.WriteLine("An order with ID = {0}', name = '{1}', and advertiser ID = '{2}' " + + " was found.", order.id, order.name, order.advertiserId); + } else { + Console.WriteLine("No order found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get orders by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/OrderService/GetOrdersByStatement.cs b/examples/Dfp/CSharp/v201311/OrderService/GetOrdersByStatement.cs new file mode 100644 index 00000000000..54bff555c10 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/OrderService/GetOrdersByStatement.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all orders for a given advertiser. The Statement + /// retrieves up to the maximum page size limit of 500. To create orders, run + /// CreateOrders.cs. To determine which companies are advertisers, + /// run GetCompaniesByStatement.cs. + /// + /// Tags: OrderService.getOrdersByStatement + /// + class GetOrdersByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all orders for a given advertiser. The Statement " + + "retrieves up to the maximum page size limit of 500. To create orders, run " + + "CreateOrders.cs. To determine which companies are advertisers,run " + + "GetCompaniesByStatement.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetOrdersByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201311.OrderService); + + // Set the name of the advertiser (company) to get orders for. + String advertiserId = _T("INSERT_ADVERTISER_COMPANY_ID_HERE"); + + // Create a Statement to only select orders for a given advertiser. + Statement statement = new StatementBuilder("WHERE advertiserId = :advertiserId LIMIT 500"). + AddValue("advertiserId", advertiserId).ToStatement(); + + try { + // Get orders by Statement. + OrderPage page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and advertiser " + + "ID = '{3}' was found.", i, order.id, order.name, order.advertiserId); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get orders by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/OrderService/UpdateOrders.cs b/examples/Dfp/CSharp/v201311/OrderService/UpdateOrders.cs new file mode 100644 index 00000000000..a114e90a1bd --- /dev/null +++ b/examples/Dfp/CSharp/v201311/OrderService/UpdateOrders.cs @@ -0,0 +1,100 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example updates the notes of each order up to the first 500. + /// To determine which orders exist, run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement, OrderService.updateOrders + /// + class UpdateOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the notes of each order up to the first 500. " + + "To determine which orders exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201311.OrderService); + + // Create a Statement to get all orders. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get orders by Statement. + OrderPage page = orderService.getOrdersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + Order[] orders = page.results; + List ordersToUpdate = new List(); + + // Update each local order object by changing its notes. + foreach (Order order in orders) { + if (!order.isArchived) { + order.notes = "Spoke to advertiser. All is well."; + ordersToUpdate.Add(order); + } + } + + // Update the orders on the server. + orders = orderService.updateOrders(ordersToUpdate.ToArray()); + + if (orders != null) { + foreach (Order order in orders) { + Console.WriteLine("Order with ID = '{0}', name = '{1}', advertiser ID = '{2}', " + + "and notes = '{3}' was updated.", order.id, order.name, order.advertiserId, + order.notes); + } + } else { + Console.WriteLine("No orders updated."); + } + } else { + Console.WriteLine("No orders found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/PlacementService/CreatePlacements.cs b/examples/Dfp/CSharp/v201311/PlacementService/CreatePlacements.cs new file mode 100644 index 00000000000..8000671fed4 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/PlacementService/CreatePlacements.cs @@ -0,0 +1,164 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates new placements for various ad unit sizes. To + /// determine which placements exist, run GetAllPlacements.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: PlacementService.createPlacements + /// + class CreatePlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new placements for various ad unit sizes. To determine " + + "which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreatePlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201311.InventoryService); + + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201311.PlacementService); + + // Create local placement object to store skyscraper ad units. + Placement skyscraperAdUnitPlacement = new Placement(); + skyscraperAdUnitPlacement.name = string.Format("Skyscraper AdUnit Placement #{0}", + this.GetTimeStamp()); + skyscraperAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 120x600"; + + // Create local placement object to store medium square ad units. + Placement mediumSquareAdUnitPlacement = new Placement(); + mediumSquareAdUnitPlacement.name = string.Format("Medium Square AdUnit Placement #{0}", + this.GetTimeStamp()); + mediumSquareAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 300x250"; + + // Create local placement object to store banner ad units. + Placement bannerAdUnitPlacement = new Placement(); + bannerAdUnitPlacement.name = string.Format("Banner AdUnit Placement #{0}", + this.GetTimeStamp()); + bannerAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 468x60"; + + List placementList = new List(); + + // Get the first 500 ad units. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + List mediumSquareTargetedUnitIds = new List(); + List skyscraperTargetedUnitIds = new List(); + List bannerTargetedUnitIds = new List(); + + try { + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + // Separate the ad units by size. + if (page.results != null) { + foreach (AdUnit adUnit in page.results) { + if (adUnit.parentId != null && adUnit.adUnitSizes != null) { + foreach (AdUnitSize adUnitSize in adUnit.adUnitSizes) { + Size size = adUnitSize.size; + if (size.width == 300 && size.height == 250) { + if (!mediumSquareTargetedUnitIds.Contains(adUnit.id)) { + mediumSquareTargetedUnitIds.Add(adUnit.id); + } + } else if (size.width == 120 && size.height == 600) { + if (!skyscraperTargetedUnitIds.Contains(adUnit.id)) { + skyscraperTargetedUnitIds.Add(adUnit.id); + } + } else if (size.width == 468 && size.height == 60) { + if (!bannerTargetedUnitIds.Contains(adUnit.id)) { + bannerTargetedUnitIds.Add(adUnit.id); + } + } + } + } + } + } + mediumSquareAdUnitPlacement.targetedAdUnitIds = mediumSquareTargetedUnitIds.ToArray(); + skyscraperAdUnitPlacement.targetedAdUnitIds = skyscraperTargetedUnitIds.ToArray(); + bannerAdUnitPlacement.targetedAdUnitIds = bannerTargetedUnitIds.ToArray(); + + + // Only create placements with one or more ad unit. + if (mediumSquareAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(mediumSquareAdUnitPlacement); + } + + if (skyscraperAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(skyscraperAdUnitPlacement); + } + + if (bannerAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(bannerAdUnitPlacement); + } + + Placement[] placements = + placementService.createPlacements(placementList.ToArray()); + + // Display results. + if (placements != null) { + foreach (Placement placement in placements) { + Console.Write("A placement with ID = '{0}', name ='{1}', and containing " + + "ad units {{", placement.id, placement.name); + + foreach (string adUnitId in placement.targetedAdUnitIds) { + Console.Write("{0}, ", adUnitId); + } + Console.WriteLine("} was created."); + } + } else { + Console.WriteLine("No placements created."); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to create placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/PlacementService/DeactivatePlacement.cs b/examples/Dfp/CSharp/v201311/PlacementService/DeactivatePlacement.cs new file mode 100644 index 00000000000..c847dce2460 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/PlacementService/DeactivatePlacement.cs @@ -0,0 +1,120 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example deactivates all active placements. To determine which + /// placements exist, run GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// Tags: PlacementService.performPlacementAction + /// + class DeactivatePlacement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all active placements. To determine which " + + "placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivatePlacement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201311.PlacementService); + + // Create Statement text to select active placements. + String statementText = "WHERE status = :status LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("status", + InventoryStatus.ACTIVE.ToString()).ToStatement(); + + // Sets defaults for page and offset. + PlacementPage page = new PlacementPage(); + int offset = 0; + List placementIds = new List(); + + try { + do { + // Create a Statement to page through active placements. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get placements by Statement. + page = placementService.getPlacementsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID ='{1}', name ='{2}', and status ='{3}'" + + " will be deactivated.", i, placement.id, placement.name, placement.status); + placementIds.Add(placement.id.ToString()); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of placements to be deactivated: {0}", placementIds.Count); + + if (placementIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", placementIds.ToArray()))). + ToStatement(); + + // Create action. + DeactivatePlacements action = new DeactivatePlacements(); + + // Perform action. + UpdateResult result = placementService.performPlacementAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of placements deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No placements were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/PlacementService/GetAllPlacements.cs b/examples/Dfp/CSharp/v201311/PlacementService/GetAllPlacements.cs new file mode 100644 index 00000000000..4c38c6e92f8 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/PlacementService/GetAllPlacements.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all placements. To create placements, run + /// CreatePlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// + class GetAllPlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all placements. To create placements, run " + + "CreatePlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllPlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201311.PlacementService); + + // Sets defaults for page and Statement. + PlacementPage page = new PlacementPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all ad units. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get ad units by Statement. + page = placementService.getPlacementsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID = '{1}' and name = '{2}' was found.", + i, placement.id, placement.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}" + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/PlacementService/GetPlacement.cs b/examples/Dfp/CSharp/v201311/PlacementService/GetPlacement.cs new file mode 100644 index 00000000000..a406b4e805b --- /dev/null +++ b/examples/Dfp/CSharp/v201311/PlacementService/GetPlacement.cs @@ -0,0 +1,79 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets a placement by its ID. To determine which + /// placements exist, run GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacement + /// + class GetPlacement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a placement by its ID. To determine which placements " + + "exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPlacement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201311.PlacementService); + + // Set the ID of the placement to get. + long placementId = long.Parse(_T("INSERT_PLACEMENT_ID_HERE")); + + try { + // Get the placement. + Placement placement = placementService.getPlacement(placementId); + + if (placement != null) { + Console.WriteLine("Placement with ID = '{0}', name = '{1}', and status = '{2}' " + + "was found.", placement.id, placement.name, placement.status); + } else { + Console.WriteLine("No placement found for this ID."); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to get placement by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/PlacementService/GetPlacementsByStatement.cs b/examples/Dfp/CSharp/v201311/PlacementService/GetPlacementsByStatement.cs new file mode 100644 index 00000000000..79f30cbb6e7 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/PlacementService/GetPlacementsByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all active placements by using a Statement. To + /// create a placement, run CreatePlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// + class GetPlacementsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active placements by using a Statement. To create a " + + "placement, run CreatePlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPlacementsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201311.PlacementService); + + // Create a Statement to only select active placements. + Statement statement = new StatementBuilder("WHERE status = :status LIMIT 500").AddValue( + "status", InventoryStatus.ACTIVE.ToString()).ToStatement(); + + try { + // Get placements by Statement. + PlacementPage page = placementService.getPlacementsByStatement(statement); + + // Display results. + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID = '{1}', name ='{2}', and status = '{3}' " + + "was found.", i, placement.id, placement.name, placement.status); + i++; + } + } + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get placement by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/PlacementService/UpdatePlacements.cs b/examples/Dfp/CSharp/v201311/PlacementService/UpdatePlacements.cs new file mode 100644 index 00000000000..04dc3c757e6 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/PlacementService/UpdatePlacements.cs @@ -0,0 +1,105 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example updates all placements to allow for AdSense targeting + /// up to the first 500. To determine which placements exist, run + /// GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// Tags: PlacementService.updatePlacements + /// + class UpdatePlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates all placements to allow for AdSense targeting up to " + + "the first 500. To determine which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdatePlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201311.PlacementService); + + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201311.InventoryService); + + // Create a statement to select first 500 placements. + Statement filterStatement = new Statement(); + filterStatement.query = "LIMIT 500"; + + try { + // Get placements by statement. + PlacementPage page = placementService.getPlacementsByStatement(filterStatement); + + if (page.results != null) { + Placement[] placements = page.results; + + // Update each local placement object by enabling AdSense targeting. + foreach (Placement placement in placements) { + placement.targetingDescription = (string.IsNullOrEmpty(placement.description))? + "Generic description" : placement.description; + placement.targetingAdLocation = "All images on sports pages."; + placement.targetingSiteName = "http://code.google.com"; + placement.isAdSenseTargetingEnabled = true; + } + + // Update the placements on the server. + placements = placementService.updatePlacements(placements); + + // Display results. + if (placements != null) { + foreach (Placement placement in placements) { + Console.WriteLine("A placement with ID \"{0}\", name \"{1}\", and AdSense targeting" + + " enabled \"{2}\" was updated.", placement.id, placement.name, + placement.isAdSenseTargetingEnabled); + } + } else { + Console.WriteLine("No placements updated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to update placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/PublisherQueryLanguageService/FetchMatchTables.cs b/examples/Dfp/CSharp/v201311/PublisherQueryLanguageService/FetchMatchTables.cs new file mode 100644 index 00000000000..34a98128d7c --- /dev/null +++ b/examples/Dfp/CSharp/v201311/PublisherQueryLanguageService/FetchMatchTables.cs @@ -0,0 +1,115 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example fetches and creates match table files from the + /// Line_Item and Ad_Unit tables. This example may take a while to run. + /// + /// Tags: PublisherQueryLanguageService.select + /// + class FetchMatchTables : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example fetches and creates match table files from the Line_Item " + + "and Ad_Unit tables. This example may take a while to run."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new FetchMatchTables(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PublisherQueryLanguageService. + PublisherQueryLanguageService pqlService = + (PublisherQueryLanguageService) user.GetService( + DfpService.v201311.PublisherQueryLanguageService); + + try { + string selectStatement = "Select Id, Name, Status from Line_Item order by Id ASC"; + string lineItemFilePath = "Line-Item-Matchtable.csv"; + fetchMatchTables(pqlService, selectStatement, lineItemFilePath); + + selectStatement = "Select Id, Name from Ad_Unit order by Id ASC"; + string adUnitFilePath = "Ad-Unit-Matchtable.csv"; + fetchMatchTables(pqlService, selectStatement, adUnitFilePath); + Console.WriteLine("Ad units saved to %s", adUnitFilePath); + Console.WriteLine("Line items saved to %s\n", lineItemFilePath); + } catch (Exception ex) { + Console.WriteLine("Failed to get match tables. Exception says \"{0}\"", ex.Message); + } + } + + /// + /// Fetches a match table from a PQL statement and writes it to a file. + /// + /// The PQL service. + /// The select statement. + /// Name of the file. + private static void fetchMatchTables(PublisherQueryLanguageService pqlService, + string selectStatement, string fileName) { + int pageSize = 500; + Statement statement = new StatementBuilder(selectStatement).ToStatement(); + + int offset = 0; + int resultSetSize = 0; + List allRows = new List(); + ResultSet resultSet; + + do { + statement.query = selectStatement + " limit " + pageSize + " OFFSET " + offset; + + resultSet = pqlService.select(statement); + allRows.AddRange(resultSet.rows); + Console.WriteLine(PqlUtilities.ResultSetToString(resultSet)); + + offset += pageSize; + resultSetSize = resultSet.rows == null ? 0 : resultSet.rows.Length; + } while (resultSetSize == pageSize); + + resultSet.rows = allRows.ToArray(); + List rows = PqlUtilities.ResultSetToStringArrayList(resultSet); + + // Write the contents to a csv file. + CsvFile file = new CsvFile(); + file.Headers.AddRange(rows[0]); + file.Records.AddRange(rows.GetRange(1, rows.Count - 1).ToArray()); + file.Write(fileName); + } + } +} diff --git a/examples/Dfp/CSharp/v201311/PublisherQueryLanguageService/GetAllLineItemsUsingPql.cs b/examples/Dfp/CSharp/v201311/PublisherQueryLanguageService/GetAllLineItemsUsingPql.cs new file mode 100644 index 00000000000..7abb989fe82 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/PublisherQueryLanguageService/GetAllLineItemsUsingPql.cs @@ -0,0 +1,109 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all line items in your network using the Line_Item + /// table. This code example may take a while to run. The Line_Item PQL table + /// schema can be found here: + /// https://developers.google.com/doubleclick-publishers/docs/reference/v201311/PublisherQueryLanguageService#Line_Item + /// + /// Tags: PublisherQueryLanguageService.select + /// + class GetAllLineItemsUsingPql : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items in your network using the Line_Item table. " + + "This code example may take a while to run. The Line_Item PQL table schema can be " + + "found here: https://developers.google.com/doubleclick-publishers/docs/reference/v201311/PublisherQueryLanguageService#Line_Item"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLineItemsUsingPql(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PublisherQueryLanguageService. + PublisherQueryLanguageService pqlService = + (PublisherQueryLanguageService) user.GetService( + DfpService.v201311.PublisherQueryLanguageService); + + int pageSize = 500; + // Create statement to select all line items. + String selectStatement = "SELECT Id, Name, Status FROM Line_Item LIMIT " + pageSize; + int offset = 0; + int resultSetSize = 0; + List allRows = new List(); + ResultSet resultSet; + + try { + do { + StatementBuilder statementBuilder = + new StatementBuilder(selectStatement + " OFFSET " + offset); + + // Get all line items. + resultSet = pqlService.select(statementBuilder.ToStatement()); + + // Collect all line items from each page. + allRows.AddRange(resultSet.rows); + + // Display results. + Console.WriteLine(PqlUtilities.ResultSetToString(resultSet)); + + offset += pageSize; + resultSetSize = resultSet.rows == null ? 0 : resultSet.rows.Length; + } while (resultSetSize == pageSize); + + Console.WriteLine("Number of results found: " + allRows.Count); + + // Optionally, save all rows to a CSV. + // Get a string array representation of the data rows. + resultSet.rows = allRows.ToArray(); + List rows = PqlUtilities.ResultSetToStringArrayList(resultSet); + + // Write the contents to a csv file. + CsvFile file = new CsvFile(); + file.Headers.AddRange(rows[0]); + file.Records.AddRange(rows.GetRange(1, rows.Count - 1).ToArray()); + file.Write("line_items_" + this.GetTimeStamp() + ".csv"); + } catch (Exception ex) { + Console.WriteLine("Failed to get all line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/PublisherQueryLanguageService/GetGeoTargets.cs b/examples/Dfp/CSharp/v201311/PublisherQueryLanguageService/GetGeoTargets.cs new file mode 100644 index 00000000000..4ab8fea81bf --- /dev/null +++ b/examples/Dfp/CSharp/v201311/PublisherQueryLanguageService/GetGeoTargets.cs @@ -0,0 +1,119 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets geographic criteria from the Geo_Target table, + /// such as all cities available to target. Other types include 'Country', + /// 'Region', 'State', 'Postal_Code', and 'DMA_Region' (i.e. Metro). + /// A full list of available geo target types can be found at + /// https://developers.google.com/doubleclick-publishers/docs/reference/v201311/PublisherQueryLanguageService + /// + /// Tags: PublisherQueryLanguageService.select + /// + class GetGeoTargets : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets geographic criteria from the Geo_Target table, such as " + + "all cities available to target. Other types include 'Country', 'Region', 'State', " + + "'Postal_Code', and 'DMA_Region' (i.e. Metro). A full list of available geo target " + + "types can be found at https://developers.google.com/doubleclick-publishers/docs/reference/v201311/PublisherQueryLanguageService"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetGeoTargets(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PublisherQueryLanguageService. + PublisherQueryLanguageService pqlService = + (PublisherQueryLanguageService) user.GetService( + DfpService.v201311.PublisherQueryLanguageService); + + string geoType = "City"; + + int pageSize = 500; + // Create statement to select all targetable cities. + String selectStatement = "SELECT Id, Name, CanonicalParentId, ParentIds, CountryCode from " + + "Geo_Target where Type = :type and Targetable = true order by CountryCode ASC, " + + "Name ASC limit " + pageSize; + + Statement statement = new StatementBuilder(selectStatement).AddValue("type", geoType) + .ToStatement(); + + int offset = 0; + int resultSetSize = 0; + List allRows = new List(); + ResultSet resultSet; + + try { + do { + statement.query = selectStatement + " OFFSET " + offset; + + // Get all cities. + resultSet = pqlService.select(statement); + + // Collect all cities from each page. + allRows.AddRange(resultSet.rows); + + // Display results. + Console.WriteLine(PqlUtilities.ResultSetToString(resultSet)); + + offset += pageSize; + resultSetSize = resultSet.rows == null ? 0 : resultSet.rows.Length; + } while (resultSetSize == pageSize); + + Console.WriteLine("Number of results found: " + allRows.Count); + + // Optionally, save all rows to a CSV. + // Get a string array representation of the data rows. + resultSet.rows = allRows.ToArray(); + List rows = PqlUtilities.ResultSetToStringArrayList(resultSet); + + // Write the contents to a csv file. + CsvFile file = new CsvFile(); + file.Headers.AddRange(rows[0]); + file.Records.AddRange(rows.GetRange(1, rows.Count - 1).ToArray()); + file.Write(geoType + "_" + this.GetTimeStamp() + ".csv"); + } catch (Exception ex) { + Console.WriteLine("Failed to get Geo type = '{0}'. Exception says \"{1}\"", + geoType, ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/PublisherQueryLanguageService/GetLineItemsNamedLike.cs b/examples/Dfp/CSharp/v201311/PublisherQueryLanguageService/GetLineItemsNamedLike.cs new file mode 100644 index 00000000000..465b5ecfc57 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/PublisherQueryLanguageService/GetLineItemsNamedLike.cs @@ -0,0 +1,108 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all line items which have a name beginning with + /// "line item". This code example may take a while to run. + /// + /// Tags: PublisherQueryLanguageService.select + /// + class GetLineItemsNamedLike : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items which have a name beginning with " + + "'line item'. This code example may take a while to run."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLineItemsNamedLike(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PublisherQueryLanguageService. + PublisherQueryLanguageService pqlService = + (PublisherQueryLanguageService) user.GetService( + DfpService.v201311.PublisherQueryLanguageService); + + int pageSize = 500; + + // Create statement to select all line items. + String selectStatement = "SELECT Id, Name, Status FROM Line_Item where Name LIKE " + + "'line item%' order by Id ASC LIMIT " + pageSize; + int offset = 0; + int resultSetSize = 0; + List allRows = new List(); + ResultSet resultSet; + + try { + do { + StatementBuilder statementBuilder = + new StatementBuilder(selectStatement + " OFFSET " + offset); + + // Get line items like 'line item%'. + resultSet = pqlService.select(statementBuilder.ToStatement()); + + // Collect all line items from each page. + allRows.AddRange(resultSet.rows); + + // Display results. + Console.WriteLine(PqlUtilities.ResultSetToString(resultSet)); + + offset += pageSize; + resultSetSize = resultSet.rows == null ? 0 : resultSet.rows.Length; + } while (resultSetSize == pageSize); + + Console.WriteLine("Number of results found: " + allRows.Count); + + // Optionally, save all rows to a CSV. + // Get a string array representation of the data rows. + resultSet.rows = allRows.ToArray(); + List rows = PqlUtilities.ResultSetToStringArrayList(resultSet); + + // Write the contents to a csv file. + CsvFile file = new CsvFile(); + file.Headers.AddRange(rows[0]); + file.Records.AddRange(rows.GetRange(1, rows.Count - 1).ToArray()); + file.Write("line_items_named_like_" + GetTimeStamp() + ".csv"); + } catch (Exception ex) { + Console.WriteLine("Failed to get line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ReportService/DisplayReport.cs b/examples/Dfp/CSharp/v201311/ReportService/DisplayReport.cs new file mode 100644 index 00000000000..0afd07e179a --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ReportService/DisplayReport.cs @@ -0,0 +1,87 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example downloads a completed report and prints out its + /// contents. To download a completed report to a file, run DownloadReport.cs. + /// To run a report, run RunDeliveryReport.cs. + /// + /// Tags: ReportService.getReportDownloadUrlWithOptions + /// + class DisplayReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example downloads a completed report and prints out its contents. " + + "To download a completed report to a file, run DownloadReport.cs. To run a report, " + + "run RunDeliveryReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DisplayReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201311.ReportService); + + // Set the id of the completed report. + long reportJobId = long.Parse(_T("INSERT_REPORT_JOB_ID_HERE")); + ExportFormat exportFormat = (ExportFormat) Enum.Parse(typeof(ExportFormat), + _T("INSERT_EXPORT_FORMAT_HERE")); + + // Set the format of the report (e.g., CSV_DUMP) and download without + // compression so we can print it. + ReportDownloadOptions reportDownloadOptions = new ReportDownloadOptions(); + reportDownloadOptions.exportFormat = exportFormat; + reportDownloadOptions.useGzipCompression = false; + + try { + // Download report data. + string downloadUrl = reportService.getReportDownloadUrlWithOptions(reportJobId, + reportDownloadOptions); + byte[] rawReport = MediaUtilities.GetAssetDataFromUrl(downloadUrl); + string reportContents = Encoding.UTF8.GetString(rawReport); + + // Display results. + Console.WriteLine("Data for report job with id '{0}\':\n{1}", reportJobId, reportContents); + } catch (Exception ex) { + Console.WriteLine("Failed to download report. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ReportService/DownloadReport.cs b/examples/Dfp/CSharp/v201311/ReportService/DownloadReport.cs new file mode 100644 index 00000000000..947dc3b8bfa --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ReportService/DownloadReport.cs @@ -0,0 +1,83 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Text; +using System.IO; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example downloads a completed report. To run a report, run + /// RunDeliveryReport.cs. + /// + /// Tags: ReportService.getReportDownloadURL + /// + class DownloadReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example downloads a completed report. To run a report, run " + + "RunDeliveryReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DownloadReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201311.ReportService); + + // Set the id of the completed report. + long reportJobId = long.Parse(_T("INSERT_REPORT_JOB_ID_HERE")); + String fileName = _T("INSERT_FILE_PATH_HERE"); + + try { + // Download report data. + string url = reportService.getReportDownloadURL(reportJobId, ExportFormat.CSV_EXCEL); + byte[] gzipReport = MediaUtilities.GetAssetDataFromUrl(url); + string reportContents = Encoding.UTF8.GetString(MediaUtilities.DeflateGZipData(gzipReport)); + + using (StreamWriter writer = new StreamWriter(fileName)) { + writer.Write(reportContents); + } + + // Display results. + Console.WriteLine("Report job with id '{0}' was downloaded to '{1}'.", reportJobId, + fileName); + } catch (Exception ex) { + Console.WriteLine("Failed to download report. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ReportService/RunDeliveryReport.cs b/examples/Dfp/CSharp/v201311/ReportService/RunDeliveryReport.cs new file mode 100644 index 00000000000..6cbc91a68f7 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ReportService/RunDeliveryReport.cs @@ -0,0 +1,104 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Threading; +using Google.Api.Ads.Dfp.Util.v201311; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example runs a report similar to the "Orders report" on the DFP + /// website with additional attributes and can filter to include just one + /// order. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunDeliveryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report similar to the \"Orders report\" on the DFP " + + "website with additional attributes and can filter to include just one order. To " + + "download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunDeliveryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201311.ReportService); + + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create statement object to filter for an order. + Statement filterStatement = new StatementBuilder("WHERE ORDER_ID = :id").AddValue( + "id", orderId).ToStatement(); + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportJob.reportQuery.dimensionAttributes = new DimensionAttribute[] { + DimensionAttribute.ORDER_TRAFFICKER, DimensionAttribute.ORDER_START_DATE_TIME, + DimensionAttribute.ORDER_END_DATE_TIME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportJob.reportQuery.statement = filterStatement; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ReportService/RunInventoryReport.cs b/examples/Dfp/CSharp/v201311/ReportService/RunInventoryReport.cs new file mode 100644 index 00000000000..bbafa47aa64 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ReportService/RunInventoryReport.cs @@ -0,0 +1,116 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Threading; +using Google.Api.Ads.Dfp.Util.v201311; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example runs a report equal to the "Whole network report" on the + /// DFP website. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunInventoryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Whole network report\" on the " + + "DFP website. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunInventoryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201311.ReportService); + + // Get the NetworkService. + NetworkService networkService = (NetworkService) user.GetService( + DfpService.v201311.NetworkService); + + // Get the root ad unit ID to filter on. + String rootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create statement to filter on an ancestor ad unit with the root ad unit ID to include all + // ad units in the network. + StatementBuilder statementBuilder = new StatementBuilder( + "where AD_UNIT_ANCESTOR_AD_UNIT_ID = :ancestorAdUnitId"). + AddValue("ancestorAdUnitId", long.Parse(rootAdUnitId)); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dimensions = + new Dimension[] { Dimension.AD_UNIT_ID, Dimension.AD_UNIT_NAME }; + reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + Column.TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + Column.TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE}; + + // Set the filter statement. + reportQuery.statement = statementBuilder.ToStatement(); + + reportQuery.adUnitView = ReportQueryAdUnitView.HIERARCHICAL; + reportQuery.dateRangeType = DateRangeType.LAST_WEEK; + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = reportQuery; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run inventory report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ReportService/RunMergedDeliveryReport.cs b/examples/Dfp/CSharp/v201311/ReportService/RunMergedDeliveryReport.cs new file mode 100644 index 00000000000..f9b61236364 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ReportService/RunMergedDeliveryReport.cs @@ -0,0 +1,96 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example runs a report that an upgraded publisher would use to + /// include statistics before the upgrade. To download the report see + /// DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunMergedDeliveryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Orders report\" on the DFP " + + "website with additional attributes. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunMergedDeliveryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201311.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportQuery.columns = new Column[] {Column.MERGED_AD_SERVER_IMPRESSIONS, + Column.MERGED_AD_SERVER_CLICKS, Column.MERGED_AD_SERVER_CTR, + Column.MERGED_AD_SERVER_CPM_AND_CPC_REVENUE, + Column.MERGED_AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery = reportQuery; + + try { + // Run report job. + reportJob = reportService.runReportJob(reportJob); + + do { + Console.WriteLine("Report with ID '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS); + + if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with ID '{0}' failed to finish successfully.", + reportJob.id); + } else { + Console.WriteLine("Report job with ID '{0}' completed successfully.", reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ReportService/RunReachReport.cs b/examples/Dfp/CSharp/v201311/ReportService/RunReachReport.cs new file mode 100644 index 00000000000..5c3fb9f070a --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ReportService/RunReachReport.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Threading; +using Google.Api.Ads.Dfp.Util.v201311; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example runs a reach report. To download the report see + /// DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunReachReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a reach report. To download the report see " + + "DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunReachReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201311.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.REACH_LIFETIME; + reportQuery.dimensions = new Dimension[] {Dimension.LINE_ITEM_ID, Dimension.LINE_ITEM_NAME}; + reportQuery.columns = new Column[] {Column.REACH_FREQUENCY, Column.REACH_AVERAGE_REVENUE, + Column.REACH}; + reportJob.reportQuery = reportQuery; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ReportService/RunReportWithCustomFields.cs b/examples/Dfp/CSharp/v201311/ReportService/RunReportWithCustomFields.cs new file mode 100644 index 00000000000..b4e5a8e6471 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ReportService/RunReportWithCustomFields.cs @@ -0,0 +1,145 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; +using Google.Api.Ads.Dfp.Util.v201311; + +using System; +using System.Threading; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example runs a report that includes custom fields found in the + /// line items of an order. To download the report see DownloadReport.cs. + /// + /// Tag: ReportService.runReportJob + /// Tag: ReportService.getReportJob + /// Tag: LineItemService.getLineItemsByStatement + /// + class RunReportWithCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report that includes custom fields found in the " + + "line items of an order. To download the report see DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunReportWithCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201311.LineItemService); + // Get the ReportService. + ReportService reportService = + (ReportService) user.GetService(DfpService.v201311.ReportService); + + try { + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Sets defaults for page and filterStatement. + LineItemPage page = new LineItemPage(); + int offset = 0; + + // Create a statement to only select line items from a given order. + String filterText = "WHERE orderId = :orderId LIMIT 500"; + Statement filterStatement = + new StatementBuilder(filterText).AddValue("orderId", orderId).ToStatement(); + + + // Collect all line item custom field IDs for an order. + List customFieldIds = new List(); + do { + filterStatement.query = filterText + " OFFSET " + offset; + + // Get line items by statement. + page = lineItemService.getLineItemsByStatement(filterStatement); + + // Get custom field IDs from the line items of an order. + if (page.results != null) { + foreach (LineItem lineItem in page.results) { + if (lineItem.customFieldValues != null) { + foreach (BaseCustomFieldValue customFieldValue in lineItem.customFieldValues) { + if (!customFieldIds.Contains(customFieldValue.customFieldId)) { + customFieldIds.Add(customFieldValue.customFieldId); + } + } + } + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + + // Create statement to filter for an order. + filterStatement = + new StatementBuilder("WHERE ORDER_ID = :orderId").AddValue("orderId", orderId) + .ToStatement(); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportQuery.dimensions = new Dimension[] {Dimension.LINE_ITEM_ID, Dimension.LINE_ITEM_NAME}; + reportQuery.statement = filterStatement; + reportQuery.customFieldIds = customFieldIds.ToArray(); + reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS}; + reportJob.reportQuery = reportQuery; + + // Run report job. + reportJob = reportService.runReportJob(reportJob); + + do { + Console.WriteLine("Report with ID '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS); + + if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with ID '{0}' failed to finish successfully.", + reportJob.id); + } else { + Console.WriteLine("Report job with ID '{0}' completed successfully.", reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run cusom fields report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/ReportService/RunSalesReport.cs b/examples/Dfp/CSharp/v201311/ReportService/RunSalesReport.cs new file mode 100644 index 00000000000..1bd845f83eb --- /dev/null +++ b/examples/Dfp/CSharp/v201311/ReportService/RunSalesReport.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example runs a report equal to the "Sales by salespersons + /// report" on the DFP website. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunSalesReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Sales by salespersons report\" on" + + "the DFP website. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunSalesReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201311.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.SALESPERSON_ID, + Dimension.SALESPERSON_NAME}; + reportJob.reportQuery.columns = new Column[] { + Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM + }; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run sales report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs b/examples/Dfp/CSharp/v201311/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs new file mode 100644 index 00000000000..42087b39c47 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs @@ -0,0 +1,105 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201311; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example approves all suggested ad units with 50 or more + /// requests. This feature is only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// Tags: SuggestedAdUnitService.performSuggestedAdUnitAction + /// + class ApproveSuggestedAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example approves all suggested ad units with 50 or more requests. " + + "This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ApproveSuggestedAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201311.SuggestedAdUnitService); + + // Create statement to select all suggested ad units with 50 or more + // requests. + string statementText = "WHERE numRequests >= 50"; + Statement filterStatement = new StatementBuilder(statementText).ToStatement(); + + try { + // Get suggested ad units by statement. + SuggestedAdUnitPage page = + suggestedAdUnitService.getSuggestedAdUnitsByStatement(filterStatement); + + int i = 0; + if (page != null && page.results != null) { + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and \"{2}\" will be " + + "approved.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + + Console.WriteLine("Number of suggested ad units to be approved: " + + page.totalResultSetSize); + + // Create action. + ApproveSuggestedAdUnit action = new ApproveSuggestedAdUnit(); + + // Perform action. + SuggestedAdUnitUpdateResult result = suggestedAdUnitService.performSuggestedAdUnitAction( + action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of suggested ad units approved: " + result.numChanges); + } else { + Console.WriteLine("No suggested ad units were approved."); + } + } else { + Console.WriteLine("No suggested ad units were approved."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to approve suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs b/examples/Dfp/CSharp/v201311/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs new file mode 100644 index 00000000000..bbcbc606dc4 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201311; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all suggested ad units. To approve suggested ad + /// units, run ApproveSuggestedAdUnits.cs. This feature is only available to + /// DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// + class GetAllSuggestedAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all suggested ad units. To approve suggested ad units, " + + "run ApproveSuggestedAdUnits.cs. This feature is only available to DFP premium " + + "solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllSuggestedAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201311.SuggestedAdUnitService); + + // Set defaults for page and filterStatement. + SuggestedAdUnitPage page = new SuggestedAdUnitPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all suggested ad units. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get suggested ad units by statement. + page = suggestedAdUnitService.getSuggestedAdUnitsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and number of requests " + + "\"{2}\" was found.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/SuggestedAdUnitService/GetSuggestedAdUnit.cs b/examples/Dfp/CSharp/v201311/SuggestedAdUnitService/GetSuggestedAdUnit.cs new file mode 100644 index 00000000000..0c219f25a1c --- /dev/null +++ b/examples/Dfp/CSharp/v201311/SuggestedAdUnitService/GetSuggestedAdUnit.cs @@ -0,0 +1,83 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201311; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets a suggested ad unit by its ID. To determine which + /// suggested ad units exist, run GetAllSuggestedAdUnits.cs. This feature is + /// only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnit + /// + class GetSuggestedAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a suggested ad unit by its ID. To determine which " + + "suggested ad units exist, run GetAllSuggestedAdUnits.cs. This feature is only " + + "available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetSuggestedAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201311.SuggestedAdUnitService); + + // Set the ID of the suggested ad unit to get. + String suggestedAdUnitId = _T("INSERT_SUGGESTED_AD_UNIT_ID_HERE"); + + try { + // Get the suggested ad unit. + SuggestedAdUnit suggestedAdUnit = suggestedAdUnitService.getSuggestedAdUnit( + suggestedAdUnitId); + + if (suggestedAdUnit != null) { + Console.WriteLine("Suggested ad unit with ID \"{0}\", and number of requests \"{1}\" " + + "was found.", suggestedAdUnit.id, suggestedAdUnit.numRequests); + } else { + Console.WriteLine("No suggested ad unit found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs b/examples/Dfp/CSharp/v201311/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs new file mode 100644 index 00000000000..025df1d978d --- /dev/null +++ b/examples/Dfp/CSharp/v201311/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs @@ -0,0 +1,90 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201311; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets suggested ad units that have more than 50 requests. + /// The statement retrieves up to the maximum page size limit of 500. This + /// feature is only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// + class GetSuggestedUnitByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets suggested ad units that have more than 50 requests. The " + + "statement retrieves up to the maximum page size limit of 500. This feature is " + + "only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetSuggestedUnitByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201311.SuggestedAdUnitService); + + // Set the number of requests to 50 or more. + long NUMBER_OF_REQUESTS = 50L; + + // Create a statement to only select suggested ad units that have more + // than 50 requests. + Statement filterStatement = new StatementBuilder("WHERE numRequests > :numRequests LIMIT 500") + .AddValue("numRequests", NUMBER_OF_REQUESTS).ToStatement(); + + try { + // Get suggested ad units by statement. + SuggestedAdUnitPage page = suggestedAdUnitService.getSuggestedAdUnitsByStatement( + filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and number of requests " + + "\"{2}\" was found.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + } + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/TeamService/CreateTeams.cs b/examples/Dfp/CSharp/v201311/TeamService/CreateTeams.cs new file mode 100644 index 00000000000..d9a9859bf65 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/TeamService/CreateTeams.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using Google.Api.Ads.Dfp.Util.v201311; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates new teams. To determine which teams exist, run + /// GetAllTeams.cs. + /// + /// Tags: TeamService.createTeams + /// + class CreateTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new teams. To determine which teams exist, run " + + "GetAllTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201311.TeamService); + + try { + // Create an array to store local team objects. + Team[] teams = new Team[5]; + + for (int i = 0; i < 5; i++) { + Team team = new Team(); + team.name = "Team #" + i; + team.hasAllCompanies = false; + team.hasAllInventory = false; + teams[i] = team; + } + + // Create the teams on the server. + teams = teamService.createTeams(teams); + + if (teams != null && teams.Length > 0) { + foreach (Team newTeam in teams) { + Console.WriteLine("A team with ID \"{0}\", and name \"{1}\" was created.", + newTeam.id, newTeam.name); + } + } else { + Console.WriteLine("No teams created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create teams. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/TeamService/GetAllTeams.cs b/examples/Dfp/CSharp/v201311/TeamService/GetAllTeams.cs new file mode 100644 index 00000000000..78909e67e95 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/TeamService/GetAllTeams.cs @@ -0,0 +1,89 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using Google.Api.Ads.Dfp.Util.v201311; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all teams. To create teams, run CreateTeams.cs. + /// + /// Tags: TeamService.getTeamsByStatement + /// + class GetAllTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams. To create teams, run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201311.TeamService); + + // Set defaults for page and filterStatement. + TeamPage page = new TeamPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all teams. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get teams by statement. + page = teamService.getTeamsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Team team in page.results) { + Console.WriteLine("{0}) Team with ID \"{1}\", name \"{2}\" was found.", + i, team.id, team.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all teams. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/TeamService/GetTeam.cs b/examples/Dfp/CSharp/v201311/TeamService/GetTeam.cs new file mode 100644 index 00000000000..9f049d0060a --- /dev/null +++ b/examples/Dfp/CSharp/v201311/TeamService/GetTeam.cs @@ -0,0 +1,78 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using Google.Api.Ads.Dfp.Util.v201311; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets a team by its ID. To determine which teams exist, + /// run GetAllTeams.cs. + /// + /// Tags: TeamService.getTeam + /// + class GetTeam : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a team by its ID. To determine which teams exist, run " + + "GetAllTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetTeam(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201311.TeamService); + + // Set the ID of the team to get. + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + + try { + // Get the team. + Team team = teamService.getTeam(teamId); + + if (team != null) { + Console.WriteLine("Team with ID \"{0}\"and name \"{1}\" was found.", team.id, team.name); + } else { + Console.WriteLine("No team found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get team by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/TeamService/GetTeamsByStatement.cs b/examples/Dfp/CSharp/v201311/TeamService/GetTeamsByStatement.cs new file mode 100644 index 00000000000..6eb07ebf742 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/TeamService/GetTeamsByStatement.cs @@ -0,0 +1,85 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using Google.Api.Ads.Dfp.Util.v201311; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all teams ordered by name. The statement retrieves + /// up to the maximum page size limit of 500. To create teams, + /// run CreateTeams.cs. + /// + /// Tags: TeamService.getTeamsByStatement + /// + class GetTeamsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams ordered by name. The statement retrieves up to " + + "the maximum page size limit of 500. To create teams, run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetTeamsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201311.TeamService); + + // Create a statement to order teams by name. + Statement filterStatement = new StatementBuilder("ORDER BY name LIMIT 500").ToStatement(); + + try { + // Get teams by statement. + TeamPage page = teamService.getTeamsByStatement(filterStatement); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (Team team in page.results) { + Console.WriteLine("{0}) Team with ID \"{1}\" and name \"{2}\" was found.", + i, team.id, team.name); + i++; + } + } + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get teams by statement. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/TeamService/UpdateTeams.cs b/examples/Dfp/CSharp/v201311/TeamService/UpdateTeams.cs new file mode 100644 index 00000000000..0657726563c --- /dev/null +++ b/examples/Dfp/CSharp/v201311/TeamService/UpdateTeams.cs @@ -0,0 +1,107 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using Google.Api.Ads.Dfp.Util.v201311; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example updates teams by adding an ad unit to the first 5. To + /// determine which teams exist, run GetAllTeams.cs. To determine which ad + /// units exist, run GetAllAdUnits.cs. + /// + /// Tags: TeamService.getTeamsByStatement, TeamService.updateTeams + /// + class UpdateTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates teams by adding an ad unit to the first 5. To " + + "determine which teams exist, run GetAllTeams.cs. To determine which ad units " + + "exist, run GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201311.TeamService); + + // Set the ID of the ad unit to add to the teams. + String adUnitId = _T("INSERT_AD_UNIT_ID_HERE"); + + // Create a statement to select first 5 teams that aren't built-in. + Statement filterStatement = new StatementBuilder("WHERE id > 0 LIMIT 5").ToStatement(); + + try { + // Get the teams by statement. + TeamPage page = teamService.getTeamsByStatement(filterStatement); + + if (page.results != null) { + Team[] teams = page.results; + + // Update each local team object by adding the ad unit to it. + foreach (Team team in teams) { + // Don't add ad unit if the team has all inventory already. + if (!team.hasAllInventory) { + List adUnitIds = new List(); + if (team.adUnitIds != null) { + adUnitIds.AddRange(team.adUnitIds); + } + adUnitIds.Add(adUnitId); + team.adUnitIds = adUnitIds.ToArray(); + } + } + + // Update the teams on the server. + teams = teamService.updateTeams(teams); + + if (teams != null) { + foreach (Team team in teams) { + Console.WriteLine("A team with ID \"{0}\" and name \"{1}\" was updated.", + team.id, team.name); + } + } else { + Console.WriteLine("No teams updated."); + } + } else { + Console.WriteLine("No teams found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update teams. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/UserService/CreateUsers.cs b/examples/Dfp/CSharp/v201311/UserService/CreateUsers.cs new file mode 100644 index 00000000000..e674b40f842 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/UserService/CreateUsers.cs @@ -0,0 +1,100 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example creates new users. To determine which users + /// exist, run GetAllUsers.cs. + /// + /// Tags: UserService.createUsers + /// + class CreateUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new users. To determine which users " + + "exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201311.UserService); + + // Set the user's email addresses and names. + List emailAndNames = new List(); + emailAndNames.Add(new String[] {_T("INSERT_EMAIL_ADDRESS_HERE"), _T("INSERT_NAME_HERE")}); + emailAndNames.Add(new String[] {_T("INSERT_ANOTHER_EMAIL_ADDRESS_HERE"), + _T("INSERT_ANOTHER_NAME_HERE")}); + + // Roles can be obtained by running GetAllRoles.cs. + long roleId = long.Parse(_T("INSERT_ROLE_ID_HERE")); + + // Create an array to store local user objects. + User[] users = new User[emailAndNames.Count]; + + for (int i = 0; i < users.Length; i++) { + // Create the new user structure. + User newUser = new User(); + newUser.email = emailAndNames[i][0]; + newUser.name = emailAndNames[i][1]; + newUser.roleId = roleId; + newUser.preferredLocale = "en_US"; + + users[i] = newUser; + } + + try { + // Create the users. + users = userService.createUsers(users); + + if (users != null) { + foreach (User newUser in users) { + Console.WriteLine("A user with ID = '{0}', email = '{1}', and role = '{2}' " + + "was created.", newUser.id, newUser.email, newUser.roleName); + } + } else { + Console.WriteLine("No users created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/UserService/DeactivateUser.cs b/examples/Dfp/CSharp/v201311/UserService/DeactivateUser.cs new file mode 100644 index 00000000000..ef2c3ce2592 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/UserService/DeactivateUser.cs @@ -0,0 +1,123 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example deactivates a user. Deactivated users can no longer make + /// requests to the API. The user making the request cannot deactivate itself. + /// To determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserService.getUsersByStatement, UserService.performUserAction + /// + class DeactivateUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates a user. Deactivated users can no longer make " + + "requests to the API. The user making the request cannot deactivate itself. " + + "To determine which users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201311.UserService); + + // Set the ID of the user to deactivate + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create Statement text to select user by id. + string statementText = "WHERE id = :userId LIMIT 500"; + Statement statement = new StatementBuilder("").AddValue("userId", userId).ToStatement(); + + // Sets defaults for page and offset. + UserPage page = new UserPage(); + int offset = 0; + List userIds = new List(); + + try { + do { + // Create a Statement to page through users. + statement.query = string.Format("{0} OFFSET {1}", statementText, offset); + + // Get users by Statement. + page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User userResult in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and status = '{3}'" + + " will be deactivated.", i, userResult.id, userResult.email, + userResult.isActive ? "ACTIVE" : "INACTIVE"); + userIds.Add(userResult.id.ToString()); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of users to be deactivated: {0}", page.totalResultSetSize); + + if (userIds.Count > 0) { + // Create action Statement. + statement = new StatementBuilder( + string.Format("WHERE id IN ({0})", string.Join(",", userIds.ToArray()))). + ToStatement(); + + // Create action. + DeactivateUsers action = new DeactivateUsers(); + + // Perform action. + UpdateResult result = userService.performUserAction(action, statement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of users deactivated: {0}" + result.numChanges); + } else { + Console.WriteLine("No users were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/UserService/GetAllRoles.cs b/examples/Dfp/CSharp/v201311/UserService/GetAllRoles.cs new file mode 100644 index 00000000000..526c9284b77 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/UserService/GetAllRoles.cs @@ -0,0 +1,77 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all roles. This example can be used to determine + /// which role ID is needed when getting and creating users. + /// + /// Tags: UserService.getAllRoles + /// + class GetAllRoles : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all roles. This example can be used to determine which " + + "role ID is needed when getting and creating users."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllRoles(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201311.UserService); + + try { + // Get all roles. + Role[] roles = userService.getAllRoles(); + int numRoles = 0; + if (roles != null && roles.Length > 0) { + foreach (Role role in roles) { + Console.WriteLine("Role with ID = '{0}' and name ='{1}' was found.", role.id, + role.name); + } + numRoles = roles.Length; + } + + Console.WriteLine("Number of results found: " + numRoles); + } catch (Exception ex) { + Console.WriteLine("Failed to get all roles. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/UserService/GetAllUsers.cs b/examples/Dfp/CSharp/v201311/UserService/GetAllUsers.cs new file mode 100644 index 00000000000..6a74b21e9a5 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/UserService/GetAllUsers.cs @@ -0,0 +1,87 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all users. To create users, run CreateUsers.cs. + /// + /// Tags: UserService.getUsersByStatement + /// + class GetAllUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all users. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201311.UserService); + + // Sets defaults for page and Statement. + UserPage page = new UserPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all users. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get users by Statement. + page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User usr in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and role = '{3}'" + + " was found.", i, usr.id, usr.email, usr.roleName); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/UserService/GetCurrentUser.cs b/examples/Dfp/CSharp/v201311/UserService/GetCurrentUser.cs new file mode 100644 index 00000000000..d16af0fc074 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/UserService/GetCurrentUser.cs @@ -0,0 +1,71 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets current user. To create users, run CreateUsers.cs. + /// + /// Tags: UserService.getCurrentUser + /// + class GetCurrentUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets current user. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCurrentUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201311.UserService); + + try { + // Get the current user. + User usr = userService.getCurrentUser(); + + if (usr != null) { + Console.WriteLine("User with ID = '{0}', email = '{1}', and role = '{2}' is the " + + "current user.", usr.id, usr.email, usr.roleName); + } else { + Console.WriteLine("The current user could not be retrieved."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get current user. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/UserService/GetUser.cs b/examples/Dfp/CSharp/v201311/UserService/GetUser.cs new file mode 100644 index 00000000000..76253b6f7e2 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/UserService/GetUser.cs @@ -0,0 +1,76 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets a user by its ID. To create users, run + /// CreateUsers.cs. + /// + /// Tags: UserService.getUser + /// + class GetUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets a user by its ID. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201311.UserService); + + // Set the ID of the user to get. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + try { + // Get the user. + User usr = userService.getUser(userId); + + if (usr != null) { + Console.WriteLine("User with ID = '{0}', email = '{1}', and role = '{2}' was found.", + usr.id, usr.email, usr.roleName); + } else { + Console.WriteLine("No user found for this ID."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/UserService/GetUsersByStatement.cs b/examples/Dfp/CSharp/v201311/UserService/GetUsersByStatement.cs new file mode 100644 index 00000000000..cebdf1831d9 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/UserService/GetUsersByStatement.cs @@ -0,0 +1,82 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all users sorted by name. The Statement retrieves + /// up to the maximum page size limit of 500. To create new users, + /// run CreateUsers.cs. + /// + /// Tags: UserService.getUsersByStatement + /// + class GetUsersByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return " This code example gets all users sorted by name. The Statement retrieves " + + "up to the maximum page size limit of 500. To create new users, " + + "run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUsersByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201311.UserService); + + // Create a Statement to get all users sorted by name. + Statement statement = new Statement(); + statement.query = "ORDER BY name LIMIT 500"; + + try { + // Get users by Statement. + UserPage page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User usr in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and role = '{3}'" + + " was found.", i, usr.id, usr.email, usr.roleName); + } + } + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/UserService/UpdateUsers.cs b/examples/Dfp/CSharp/v201311/UserService/UpdateUsers.cs new file mode 100644 index 00000000000..d57cf4cb59c --- /dev/null +++ b/examples/Dfp/CSharp/v201311/UserService/UpdateUsers.cs @@ -0,0 +1,96 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example updates all users by adding "Sr." to the end of each + /// name (after a very large baby boom and lack of creativity). To + /// determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserService.getUsersByStatement, UserService.updateUsers + /// + class UpdateUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates all users by adding 'Sr.' to the end of each " + + "name (after a very large baby boom and lack of creativity). To " + + "determine which users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserService. + UserService userService = (UserService) dfpUser.GetService(DfpService.v201311.UserService); + + // Create a Statement to get all users. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + try { + // Get users by Statement. + UserPage page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + User[] users = page.results; + + // Update each local users object by changing its name. + foreach (User user in users) { + user.name = user.name + " Sr."; + } + + // Update the users on the server. + users = userService.updateUsers(users); + + if (users != null) { + foreach (User user in users) { + Console.WriteLine("A user with ID = '{0}', name ='{1}', and role = '{2}'" + + " was updated.", user.id, user.name, user.roleName); + } + } else { + Console.WriteLine("No users updated."); + } + } else { + Console.WriteLine("No users found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/UserTeamAssociationService/CreateUserTeamAssociations.cs b/examples/Dfp/CSharp/v201311/UserTeamAssociationService/CreateUserTeamAssociations.cs new file mode 100644 index 00000000000..747db8053e2 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/UserTeamAssociationService/CreateUserTeamAssociations.cs @@ -0,0 +1,98 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example adds a user to a team by creating an association + /// between the two. To determine which teams exist, run GetAllTeams.cs. To + /// determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.createUserTeamAssociations + /// + class CreateUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a user to a team by creating an association between the " + + "two. To determine which teams exist, run GetAllTeams.cs. To determine which users " + + "exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201311.UserTeamAssociationService); + + // Set the users and team to add them to. + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + long[] userIds = new long[] {long.Parse(_T("INSERT_USER_ID_HERE"))}; + + // Create an array to store local user team association objects. + UserTeamAssociation[] userTeamAssociations = new UserTeamAssociation[userIds.Length]; + + // For each user, associate it with the given team. + int i = 0; + + foreach (long userId in userIds) { + UserTeamAssociation userTeamAssociation = new UserTeamAssociation(); + userTeamAssociation.userId = userId; + userTeamAssociation.teamId = teamId; + userTeamAssociations[i++] = userTeamAssociation; + } + + try { + // Create the user team associations on the server. + userTeamAssociations = + userTeamAssociationService.createUserTeamAssociations(userTeamAssociations); + + if (userTeamAssociations != null) { + foreach (UserTeamAssociation userTeamAssociation in userTeamAssociations) { + Console.WriteLine("A user team association between user with ID \"{0}\" and team " + + "with ID \"{1}\" was created.", userTeamAssociation.userId, + userTeamAssociation.teamId); + } + } else { + Console.WriteLine("No user team associations created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/UserTeamAssociationService/DeleteUserTeamAssociations.cs b/examples/Dfp/CSharp/v201311/UserTeamAssociationService/DeleteUserTeamAssociations.cs new file mode 100644 index 00000000000..b0a4337eb34 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/UserTeamAssociationService/DeleteUserTeamAssociations.cs @@ -0,0 +1,121 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example removes the user from all its teams. To determine which + /// users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.performUserTeamAssociationAction + /// + class DeleteUserTeamAssociation : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example removes the user from all its teams. To determine which " + + "users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeleteUserTeamAssociation(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201311.UserTeamAssociationService); + + // Set the user to remove from its teams. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create filter text to select user team associations by the user ID. + String statementText = "WHERE userId = :userId LIMIT 500"; + Statement filterStatement = new StatementBuilder("").AddValue("userId", userId). + ToStatement(); + + // Set defaults for page and offset. + UserTeamAssociationPage page = new UserTeamAssociationPage(); + int offset = 0; + + try { + do { + // Create a statement to page through user team associations. + filterStatement.query = statementText + " OFFSET " + offset; + + // Get user team associations by statement. + page = userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and " + + "team with ID \"{2}\" will be deleted.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of teams that the user will be removed from: " + + page.totalResultSetSize); + + if (page.totalResultSetSize > 0) { + // Modify statement for action. + filterStatement.query = "WHERE userId = :userId"; + + // Create action. + DeleteUserTeamAssociations action = new DeleteUserTeamAssociations(); + + // Perform action. + UpdateResult result = + userTeamAssociationService.performUserTeamAssociationAction(action, filterStatement); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of teams that the user was removed from: " + + result.numChanges); + } else { + Console.WriteLine("No user team associations were deleted."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to delete user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/UserTeamAssociationService/GetAllUserTeamAssociations.cs b/examples/Dfp/CSharp/v201311/UserTeamAssociationService/GetAllUserTeamAssociations.cs new file mode 100644 index 00000000000..d35e17d3e9b --- /dev/null +++ b/examples/Dfp/CSharp/v201311/UserTeamAssociationService/GetAllUserTeamAssociations.cs @@ -0,0 +1,93 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all user team associations. To create user team + /// associations, run CreateUserTeamAssociations.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// + class GetAllUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all user team associations. To create user team " + + "associations, run CreateUserTeamAssociations.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201311.UserTeamAssociationService); + + // Set defaults for page and filterStatement. + UserTeamAssociationPage page = new UserTeamAssociationPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all user team associations. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get user team associations by statement. + page = userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and " + + "team with ID \"{2}\" was found.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}." + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/UserTeamAssociationService/GetUserTeamAssociation.cs b/examples/Dfp/CSharp/v201311/UserTeamAssociationService/GetUserTeamAssociation.cs new file mode 100644 index 00000000000..bf06657ca5c --- /dev/null +++ b/examples/Dfp/CSharp/v201311/UserTeamAssociationService/GetUserTeamAssociation.cs @@ -0,0 +1,84 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets a user team association by the user and team ID. + /// To determine which teams exist, run GetAllTeams.cs. To determine which + /// users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociation + /// + class GetUserTeamAssociation : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a user team association by the user and team ID. To " + + "determine which teams exist, run GetAllTeams.cs. To determine which users exist, " + + "run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUserTeamAssociation(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201311.UserTeamAssociationService); + + // Set the IDs of the user and team to get the association for. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + + try { + // Get the user team association. + UserTeamAssociation userTeamAssociation = userTeamAssociationService.getUserTeamAssociation( + teamId, userId); + + if (userTeamAssociation != null) { + Console.WriteLine("User team association between user with ID \"{0}\" and team with " + + "ID \"{1}\" was found.", userTeamAssociation.userId, userTeamAssociation.teamId); + } else { + Console.WriteLine("No user team association found."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs b/examples/Dfp/CSharp/v201311/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs new file mode 100644 index 00000000000..9b867acbc8d --- /dev/null +++ b/examples/Dfp/CSharp/v201311/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs @@ -0,0 +1,98 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example gets all teams that the current user belongs to. The + /// statement retrieves up to the maximum page size limit of 500. To create + /// teams, run CreateTeams.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// Tags: UserService.getCurrentUser + /// + class GetUserTeamAssociationsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams that the current user belongs to. The " + + "statement retrieves up to the maximum page size limit of 500. To create teams, " + + "run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUserTeamAssociationsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201311.UserTeamAssociationService); + + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201311.UserService); + + try { + // Get the current user. + long currentUserId = userService.getCurrentUser().id; + + // Create filter text to select user team associations by the user ID. + String statementText = "WHERE userId = :userId LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText). + AddValue("userId", currentUserId).ToStatement(); + + // Get user team associations by statement. + UserTeamAssociationPage page = + userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and team " + + "with ID \"{2}\" was found.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201311/UserTeamAssociationService/UpdateUserTeamAssociations.cs b/examples/Dfp/CSharp/v201311/UserTeamAssociationService/UpdateUserTeamAssociations.cs new file mode 100644 index 00000000000..88cb67c7039 --- /dev/null +++ b/examples/Dfp/CSharp/v201311/UserTeamAssociationService/UpdateUserTeamAssociations.cs @@ -0,0 +1,107 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201311 { + /// + /// This code example updates user team associations by setting the + /// overridden access type to read only for all teams that the user belongs + /// to. To determine which users exists, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// Tags: UserTeamAssociationService.updateUserTeamAssociations + /// + class UpdateUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates user team associations by setting the overridden " + + "access type to read only for all teams that the user belongs to. To determine " + + "which users exists, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201311.UserTeamAssociationService); + + // Set the user to set to read only access within its teams. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create filter text to select user team associations by the user ID. + String statementText = "WHERE userId = :userId LIMIT 500"; + Statement filterStatement = new StatementBuilder(statementText). + AddValue("userId", userId).ToStatement(); + + try { + // Get user team associations by statement. + UserTeamAssociationPage page = + userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + if (page.results != null) { + UserTeamAssociation[] userTeamAssociations = page.results; + + // Update each local user team association to read only access. + foreach (UserTeamAssociation userTeamAssociation in userTeamAssociations) { + userTeamAssociation.overriddenTeamAccessType = TeamAccessType.READ_ONLY; + } + + // Update the user team associations on the server. + userTeamAssociations = + userTeamAssociationService.updateUserTeamAssociations(userTeamAssociations); + + if (userTeamAssociations != null) { + foreach (UserTeamAssociation userTeamAssociation in userTeamAssociations) { + Console.WriteLine("User team association between user with ID \"{0}\" and team " + + "with ID \"{1}\" was updated to access type \"{2}\".", userTeamAssociation.userId, + userTeamAssociation.teamId, userTeamAssociation.overriddenTeamAccessType); + } + } else { + Console.WriteLine("No user team associations updated."); + } + } else { + Console.WriteLine("No user team associations found to update."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ActivityGroupService/CreateActivityGroups.cs b/examples/Dfp/CSharp/v201403/ActivityGroupService/CreateActivityGroups.cs new file mode 100644 index 00000000000..4689d48814c --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ActivityGroupService/CreateActivityGroups.cs @@ -0,0 +1,96 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates new activity groups. To determine which activity + /// groups exist, run GetAllActivityGroups.cs. + /// + /// Tags: ActivityGroupService.createActivityGroups + /// + class CreateActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new activity groups. To determine which activity " + + "groups exist, run GetAllActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201403.ActivityGroupService); + + // Set the ID of the advertiser company this activity group is associated + // with. + long advertiserCompanyId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Create a short-term activity group. + ActivityGroup shortTermActivityGroup = new ActivityGroup(); + shortTermActivityGroup.name = "Short-term activity group #" + GetTimeStamp(); + shortTermActivityGroup.companyIds = new long[] {advertiserCompanyId}; + shortTermActivityGroup.clicksLookback = 1; + shortTermActivityGroup.impressionsLookback = 1; + + // Create a long-term activity group. + ActivityGroup longTermActivityGroup = new ActivityGroup(); + longTermActivityGroup.name = "Long-term activity group #" + GetTimeStamp(); + longTermActivityGroup.companyIds = new long[] {advertiserCompanyId}; + longTermActivityGroup.clicksLookback = 30; + longTermActivityGroup.impressionsLookback = 30; + + try { + // Create the activity groups on the server. + ActivityGroup[] activityGroups = activityGroupService.createActivityGroups( + new ActivityGroup[] {shortTermActivityGroup, longTermActivityGroup}); + + // Display results. + if (activityGroups != null) { + foreach (ActivityGroup activityGroup in activityGroups) { + Console.WriteLine("An activity group with ID \"{0}\" and name \"{1}\" was created.", + activityGroup.id, activityGroup.name); + } + } else { + Console.WriteLine("No activity groups were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ActivityGroupService/GetActiveActivityGroups.cs b/examples/Dfp/CSharp/v201403/ActivityGroupService/GetActiveActivityGroups.cs new file mode 100644 index 00000000000..098501dd156 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ActivityGroupService/GetActiveActivityGroups.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; +using Google.Api.Ads.Dfp.Util.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all active activity groups. To create activity + /// groups, run CreateActivityGroups.cs. + /// + /// Tags: ContactService.getContactsByStatement + /// + class GetActiveActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active activity groups. To create activity groups, " + + "run CreateActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActiveActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201403.ActivityGroupService); + + StatementBuilder statementBuilder = new StatementBuilder() + .Where("status = :status") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("status", ActivityGroupStatus.ACTIVE.ToString()); + + // Set default for page. + ActivityGroupPage page; + + try { + do { + // Get contacts by statement. + page = activityGroupService.getActivityGroupsByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (ActivityGroup activityGroup in page.results) { + Console.WriteLine("{0}) Activity group with ID \"{1}\" and name \"{2}\" was found.", + i, activityGroup.id, activityGroup.name); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ActivityGroupService/GetAllActivityGroups.cs b/examples/Dfp/CSharp/v201403/ActivityGroupService/GetAllActivityGroups.cs new file mode 100644 index 00000000000..cd2371e5960 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ActivityGroupService/GetAllActivityGroups.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; +using Google.Api.Ads.Dfp.Util.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all activity groups. To create activity groups, run + /// CreateActivityGroups.cs. + /// + /// Tags: ActivityGroupService.getActivityGroupsByStatement + /// + class GetAllActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all activity groups. To create activity groups, run " + + "CreateActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201403.ActivityGroupService); + + ActivityGroupPage page; + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + try { + do { + // Get activity groups by statement. + page = activityGroupService.getActivityGroupsByStatement(statementBuilder.ToStatement()); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + + foreach (ActivityGroup activityGroup in page.results) { + Console.WriteLine("{0}) Activity group with ID \"{1}\" and name \"{2}\" was " + + "found.", i, activityGroup.id, activityGroup.name); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ActivityGroupService/UpdateActivityGroups.cs b/examples/Dfp/CSharp/v201403/ActivityGroupService/UpdateActivityGroups.cs new file mode 100644 index 00000000000..d85ce4de716 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ActivityGroupService/UpdateActivityGroups.cs @@ -0,0 +1,98 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; +using Google.Api.Ads.Dfp.Util.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example updates activity groups by adding a company. To + /// determine which activity groups exist, run GetAllActivityGroups.cs. + /// + /// Tags: ActivityGroupService.getActivityGroupsByStatement + /// Tags: ActivityGroupService.updateActivityGroups + /// + class UpdateActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates activity groups by adding a company. To determine " + + "which activity groups exist, run GetAllActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201403.ActivityGroupService); + + // Set the ID of the activity group and the company to update it with. + int activityGroupId = int.Parse(_T("INSERT_ACTIVITY_GROUP_ID_HERE")); + long advertiserCompanyId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + try { + // Get the activity group. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", activityGroupId); + + ActivityGroupPage page = activityGroupService.getActivityGroupsByStatement( + statementBuilder.ToStatement()); + + ActivityGroup activityGroup = page.results[0]; + + // Update the companies. + List companyIds = new List(activityGroup.companyIds); + companyIds.Add(advertiserCompanyId); + activityGroup.companyIds = companyIds.ToArray(); + + // Update the activity groups on the server. + ActivityGroup[] activityGroups = activityGroupService.updateActivityGroups( + new ActivityGroup[] {activityGroup}); + + // Display results. + foreach (ActivityGroup updatedActivityGroup in activityGroups) { + Console.WriteLine("Activity group with ID \"{0}\" and name \"{1}\" was updated.", + updatedActivityGroup.id, updatedActivityGroup.name); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ActivityService/CreateActivities.cs b/examples/Dfp/CSharp/v201403/ActivityService/CreateActivities.cs new file mode 100644 index 00000000000..a76e4dce57f --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ActivityService/CreateActivities.cs @@ -0,0 +1,93 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates new activities. To determine which activities + /// exist, run GetAllActivities.cs. + /// + /// Tags: ActivityService.createActivities + /// + class CreateActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new activities. To determine which activities exist, " + + "run GetAllActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201403.ActivityService); + + // Set the ID of the activity group this activity is associated with. + int activityGroupId = int.Parse(_T("INSERT_ACTIVITY_GROUP_ID_HERE")); + + // Create a daily visits activity. + Activity dailyVisitsActivity = new Activity(); + dailyVisitsActivity.name = "Activity #" + GetTimeStamp(); + dailyVisitsActivity.activityGroupId = activityGroupId; + dailyVisitsActivity.type = ActivityType.DAILY_VISITS; + + // Create a custom activity. + Activity customActivity = new Activity(); + customActivity.name = "Activity #" + GetTimeStamp(); + customActivity.activityGroupId = activityGroupId; + customActivity.type = ActivityType.CUSTOM; + + try { + // Create the activities on the server. + Activity[] activities = activityService.createActivities( + new Activity[] {dailyVisitsActivity, customActivity}); + + // Display results. + if (activities != null) { + foreach (Activity newActivity in activities) { + Console.WriteLine("An activity with ID \"{0}\", name \"{1}\", and type \"{2}\" was " + + "created.\n", newActivity.id, newActivity.name, newActivity.type); + } + } else { + Console.WriteLine("No activities were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create activities. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ActivityService/GetActiveActivities.cs b/examples/Dfp/CSharp/v201403/ActivityService/GetActiveActivities.cs new file mode 100644 index 00000000000..4d33caa84df --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ActivityService/GetActiveActivities.cs @@ -0,0 +1,93 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; +using Google.Api.Ads.Dfp.Util.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all active activities. To create activities, + /// run CreateActivities.cs. + /// + /// Tags: ActivityService.getActivitiesByStatement + /// + class GetActiveActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active activities. To create activities, run " + + "CreateActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActiveActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201403.ActivityService); + + // Create a statement to select active activities. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("status = :status") + .OrderBy("id") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("status", ActivityStatus.ACTIVE.ToString()); + + ActivityPage page = new ActivityPage(); + + try { + do { + page = activityService.getActivitiesByStatement(statementBuilder.ToStatement()); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (Activity activity in page.results) { + Console.WriteLine("{0}) Activity with ID \"{1}\", name \"{2}\", and type \"{3}\" " + + "was found.", i, activity.id, activity.name, activity.type); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}.", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get activities. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ActivityService/GetAllActivities.cs b/examples/Dfp/CSharp/v201403/ActivityService/GetAllActivities.cs new file mode 100644 index 00000000000..e24a3733022 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ActivityService/GetAllActivities.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; +using Google.Api.Ads.Dfp.Util.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all activities. To create activities, run + /// CreateActivities.cs. + /// + /// Tags: ActivityService.getActivitiesByStatement + /// + class GetAllActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all activities. To create activities, run " + + "CreateActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201403.ActivityService); + + int totalResultsCounter = 0; + + try { + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + ActivityPage page = new ActivityPage(); + + do { + // Get activities by statement. + page = activityService.getActivitiesByStatement(statementBuilder.ToStatement()); + + // Display results. + if (page.results != null) { + foreach (Activity activity in page.results) { + Console.WriteLine("{0}) Activity with ID \"{1}\", name \"{2}\" and type \"{3}\" " + + "was found.\n", totalResultsCounter, activity.id, activity.name, + activity.type); + totalResultsCounter++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}.", totalResultsCounter); + } catch (Exception ex) { + Console.WriteLine("Failed to get contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ActivityService/UpdateActivities.cs b/examples/Dfp/CSharp/v201403/ActivityService/UpdateActivities.cs new file mode 100644 index 00000000000..91e4a206973 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ActivityService/UpdateActivities.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; +using Google.Api.Ads.Dfp.Util.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example updates activity expected URLs. To determine which + /// activities exist, run GetAllActivities.cs. + /// + /// Tags: ActivityService.getActivitiesByStatement + /// Tags: ActivityService.updateActivities + /// + class UpdateActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates activity expected URLs. To determine which activities " + + "exist, run GetAllActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201403.ActivityService); + + // Set the ID of the activity to update. + int activityId = int.Parse(_T("INSERT_ACTIVITY_ID_HERE")); + + try { + // Get the activity. + StatementBuilder statemetnBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", activityId); + + ActivityPage page = activityService.getActivitiesByStatement( + statemetnBuilder.ToStatement()); + Activity activity = page.results[0]; + + // Update the expected URL. + activity.expectedURL = "https://www.google.com"; + + // Update the activity on the server. + Activity[] activities = activityService.updateActivities(new Activity[] {activity}); + + foreach (Activity updatedActivity in activities) { + Console.WriteLine("Activity with ID \"{0}\" and name \"{1}\" was updated.", + updatedActivity.id, updatedActivity.name); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update activities. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/AudienceSegmentService/CreateAudienceSegments.cs b/examples/Dfp/CSharp/v201403/AudienceSegmentService/CreateAudienceSegments.cs new file mode 100644 index 00000000000..10547adfc7a --- /dev/null +++ b/examples/Dfp/CSharp/v201403/AudienceSegmentService/CreateAudienceSegments.cs @@ -0,0 +1,121 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates new rule based first party audience segments. To + /// determine which audience segments exist, run GetAllAudienceSegments.cs. + /// + /// Tags: AudienceSegmentService.createAudienceSegments + /// + class CreateAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new rule based first party audience segments. To " + + "determine which audience segments exist, run GetAllAudienceSegments.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = (AudienceSegmentService) user.GetService( + DfpService.v201403.AudienceSegmentService); + + // Get the NetworkService. + NetworkService networkService = (NetworkService) user.GetService( + DfpService.v201403.NetworkService); + + long customTargetingKeyId = long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + long customTargetingValueId = long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE")); + + try { + // Get the root ad unit ID used to target the whole site. + String rootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + + // Create ad unit targeting for the root ad unit (i.e. the whole network). + AdUnitTargeting adUnitTargeting = new AdUnitTargeting(); + adUnitTargeting.adUnitId = rootAdUnitId; + adUnitTargeting.includeDescendants = true; + + inventoryTargeting.targetedAdUnits = new AdUnitTargeting[] {adUnitTargeting}; + + // Create the custom criteria to be used in the segment rule. + // CUSTOM_TARGETING_KEY_ID == CUSTOM_TARGETING_VALUE_ID + CustomCriteria customCriteria = new CustomCriteria(); + customCriteria.keyId = customTargetingKeyId; + customCriteria.@operator = CustomCriteriaComparisonOperator.IS; + customCriteria.valueIds = new long[] {customTargetingValueId}; + + // Create the custom criteria expression. + CustomCriteriaSet topCustomCriteriaSet = new CustomCriteriaSet(); + topCustomCriteriaSet.logicalOperator = CustomCriteriaSetLogicalOperator.AND; + topCustomCriteriaSet.children = new CustomCriteriaNode[] {customCriteria}; + + // Create the audience segment rule. + FirstPartyAudienceSegmentRule rule = new FirstPartyAudienceSegmentRule(); + rule.inventoryRule = inventoryTargeting; + rule.customCriteriaRule = topCustomCriteriaSet; + + // Create an audience segment. + RuleBasedFirstPartyAudienceSegment audienceSegment = + new RuleBasedFirstPartyAudienceSegment(); + audienceSegment.name = "Sports enthusiasts audience segment #" + this.GetTimeStamp(); + audienceSegment.description = "Sports enthusiasts between the ages of 20 and 30."; + audienceSegment.pageViews = 6; + audienceSegment.recencyDays = 6; + audienceSegment.membershipExpirationDays = 88; + audienceSegment.rule = rule; + + // Create the audience segment on the server. + AudienceSegment[] audienceSegments = audienceSegmentService.createAudienceSegments( + new FirstPartyAudienceSegment[] {audienceSegment}); + + foreach (AudienceSegment createdAudienceSegment in audienceSegments) { + Console.WriteLine("An audience segment with ID \"{0}\", name \"{1}\", and type \"{2}\" " + + "was created.", createdAudienceSegment.id, createdAudienceSegment.name, + createdAudienceSegment.type); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get audience segment. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/AudienceSegmentService/GetAllAudienceSegments.cs b/examples/Dfp/CSharp/v201403/AudienceSegmentService/GetAllAudienceSegments.cs new file mode 100644 index 00000000000..ba008f464ed --- /dev/null +++ b/examples/Dfp/CSharp/v201403/AudienceSegmentService/GetAllAudienceSegments.cs @@ -0,0 +1,92 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all audience segments.To create audience segments, + /// run CreateAudienceSegments.cs. + /// + /// Tags: AudienceSegmentService.getAudienceSegmentsByStatement + /// + class GetAllAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all audience segments. To create audience segments, run " + + "CreateAudienceSegments.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = + (AudienceSegmentService) user.GetService(DfpService.v201403.AudienceSegmentService); + + // Create a Statement to get all audience segments. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + AudienceSegmentPage page = new AudienceSegmentPage(); + + try { + do { + // Get audience segment by Statement. + page = audienceSegmentService.getAudienceSegmentsByStatement( + statementBuilder.ToStatement()); + + // Display results. + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AudienceSegment segment in page.results) { + Console.WriteLine("{0}) 'Audience segment with id \"{1}\" and name \"{2}\" of " + + "size {3} was found.", i, segment.id, segment.name, segment.size); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get audience segment. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/AudienceSegmentService/GetFirstPartyAudienceSegments.cs b/examples/Dfp/CSharp/v201403/AudienceSegmentService/GetFirstPartyAudienceSegments.cs new file mode 100644 index 00000000000..0e12f855bbd --- /dev/null +++ b/examples/Dfp/CSharp/v201403/AudienceSegmentService/GetFirstPartyAudienceSegments.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all first party audience segments. To create first + /// party audience segments, run CreateAudienceSegments.cs. + /// + /// Tags: AudienceSegmentService.getAudienceSegmentsByStatement + /// + class GetFirstPartyAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all first party audience segments. To create first " + + "party audience segments, run CreateAudienceSegments.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetFirstPartyAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = + (AudienceSegmentService) user.GetService(DfpService.v201403.AudienceSegmentService); + + // Create a statement to only select first party audience segments. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("type = :type") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("type", "FIRST_PARTY"); + + // Set default for page. + AudienceSegmentPage page = new AudienceSegmentPage(); + + try { + do { + // Get audience segment by Statement. + page = audienceSegmentService.getAudienceSegmentsByStatement( + statementBuilder.ToStatement()); + + // Display results. + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AudienceSegment segment in page.results) { + Console.WriteLine("{0}) 'Audience segment with id \"{1}\" and name \"{2}\" of " + + "size {3} was found.", i, segment.id, segment.name, segment.size); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get audience segment. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/AudienceSegmentService/PopulateFirstPartyAudienceSegments.cs b/examples/Dfp/CSharp/v201403/AudienceSegmentService/PopulateFirstPartyAudienceSegments.cs new file mode 100644 index 00000000000..fcc8a4ffa8b --- /dev/null +++ b/examples/Dfp/CSharp/v201403/AudienceSegmentService/PopulateFirstPartyAudienceSegments.cs @@ -0,0 +1,98 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example populates a specific rule base first party audience + /// segment. To determine which audience segments exist, run + /// GetAllAudienceSegments.cs. + /// + /// Tags: AudienceSegmentService.getAudienceSegmentsByStatement + /// Tags: AudienceSegmentService.performAudienceSegmentAction + /// + class PopulateFirstPartyAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example populates a specific rule base first party audience segment. " + + "To determine which audience segments exist, run GetAllAudienceSegments.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new PopulateFirstPartyAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = + (AudienceSegmentService) user.GetService(DfpService.v201403.AudienceSegmentService); + + long audienceSegmentId = long.Parse(_T("INSERT_AUDIENCE_SEGMENT_ID_HERE")); + + // Create a statement to only select a specified first party audience + // segment. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :audienceSegmentId") + .OrderBy("id ASC") + .Limit(1) + .AddValue("audienceSegmentId", audienceSegmentId); + + try { + // Get audience segment by Statement. + AudienceSegment audienceSegment = + audienceSegmentService.getAudienceSegmentsByStatement(statementBuilder.ToStatement()) + .results[0]; + + Console.WriteLine("Audience segment with id \"{0}\" and name \"{1}\" " + + "will be populated", audienceSegment.id, audienceSegment.name); + // Create action. + PopulateAudienceSegments action = new PopulateAudienceSegments(); + + // Perform action. + UpdateResult result = audienceSegmentService.performAudienceSegmentAction( + action, statementBuilder.ToStatement()); + + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of audience segments populated: {0}", result.numChanges); + } else { + Console.WriteLine("No audience segments were populated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to populate audience segment. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/AudienceSegmentService/UpdateAudienceSegments.cs b/examples/Dfp/CSharp/v201403/AudienceSegmentService/UpdateAudienceSegments.cs new file mode 100644 index 00000000000..0327303370b --- /dev/null +++ b/examples/Dfp/CSharp/v201403/AudienceSegmentService/UpdateAudienceSegments.cs @@ -0,0 +1,98 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example updates a first party audience segment's member + /// expiration days. To determine which first party audience segments exist, + /// run GetFirstPartyAudienceSegments.cs. + /// + /// Tags: AudienceSegmentService.getAudienceSegmentsByStatement + /// Tags: AudienceSegmentService.updateAudienceSegments + /// + class UpdateAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a first party audience segment's member expiration " + + "days. To determine which first party audience segments exist, " + + "run GetFirstPartyAudienceSegments.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = + (AudienceSegmentService) user.GetService(DfpService.v201403.AudienceSegmentService); + + // Set the ID of the audience segment to update. + int audienceSegmentId = int.Parse(_T("INSERT_AUDIENCE_SEGMENT_ID_HERE")); + + // Create a statement to only select a specified first party audience + // segment. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :audienceSegmentId") + .OrderBy("id ASC") + .Limit(1) + .AddValue("audienceSegmentId", audienceSegmentId); + + try { + // Get the audience segment. + RuleBasedFirstPartyAudienceSegment audienceSegment = + (RuleBasedFirstPartyAudienceSegment) audienceSegmentService + .getAudienceSegmentsByStatement(statementBuilder.ToStatement()).results[0]; + + // Update the member expiration days. + audienceSegment.membershipExpirationDays = 180; + + // Update the audience segment on the server. + AudienceSegment[] audienceSegments = audienceSegmentService.updateAudienceSegments( + new FirstPartyAudienceSegment[] {audienceSegment}); + + foreach (AudienceSegment updatedAudienceSegment in audienceSegments) { + Console.WriteLine( + "Audience segment with ID \"{0}\" and name \"{1}\" was updated.\n", + updatedAudienceSegment.id, updatedAudienceSegment.name); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update audience segment. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CompanyService/CreateCompanies.cs b/examples/Dfp/CSharp/v201403/CompanyService/CreateCompanies.cs new file mode 100644 index 00000000000..b9bc662b9e7 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CompanyService/CreateCompanies.cs @@ -0,0 +1,86 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates new companies. To determine which companies + /// exist, run GetAllCompanies.cs. + /// + /// Tags: CompanyService.createCompanies + /// + class CreateCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new companies. To determine which companies exist, " + + "run GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201403.CompanyService); + + // Create an array to store local company objects. + Company[] companies = new Company[5]; + + for (int i = 0; i < 5; i++) { + Company company = new Company(); + company.name = string.Format("Advertiser #{0}", i); + company.type = CompanyType.ADVERTISER; + companies[i] = company; + } + + try { + // Create the companies on the server. + companies = companyService.createCompanies(companies); + + if (companies != null && companies.Length > 0) { + foreach (Company company in companies) { + Console.WriteLine("A company with ID = '{0}', name = '{1}' and type = '{2}' was" + + " created.", company.id, company.name, company.type); + } + } else { + Console.WriteLine("No companies created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create company. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CompanyService/GetAllCompanies.cs b/examples/Dfp/CSharp/v201403/CompanyService/GetAllCompanies.cs new file mode 100644 index 00000000000..ca3514631d4 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CompanyService/GetAllCompanies.cs @@ -0,0 +1,87 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all companies. To create companies, run + /// CreateCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement + /// + class GetAllCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all companies. To create companies, run CreateCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201403.CompanyService); + + // Set defaults for page and Statement. + CompanyPage page = new CompanyPage(); + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + try { + do { + // Get companies by Statement. + page = companyService.getCompaniesByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Company company in page.results) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", + i, company.id, company.name, company.type); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CompanyService/GetCompaniesByStatement.cs b/examples/Dfp/CSharp/v201403/CompanyService/GetCompaniesByStatement.cs new file mode 100644 index 00000000000..d3d6608d297 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CompanyService/GetCompaniesByStatement.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all companies that are advertisers. To create companies, + /// run CreateCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement + /// + class GetCompaniesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all companies that are advertisers. To create companies, " + + "run CreateCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCompaniesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201403.CompanyService); + + // Create a Statement to only select companies that are advertisers sorted + // by name. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("type = :advertiser") + .OrderBy("name ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("advertiser", CompanyType.ADVERTISER.ToString()); + + CompanyPage page = new CompanyPage(); + + try { + do { + // Get companies by Statement. + page = companyService.getCompaniesByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Company company in page.results) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", + i, company.id, company.name, company.type); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CompanyService/UpdateCompanies.cs b/examples/Dfp/CSharp/v201403/CompanyService/UpdateCompanies.cs new file mode 100644 index 00000000000..fb5fdaccf26 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CompanyService/UpdateCompanies.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example updates company comments. To determine which companies exist, + /// run GetAllCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement, CompanyService.updateCompanies + /// + class UpdateCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates company comments. To detemine which companies exist, " + + "run GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201403.CompanyService); + + // Set the ID of the company to update. + int companyId = int.Parse(_T("INSERT_COMPANY_ID_HERE")); + + // Create a Statement to select the company by ID. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :companyId") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("id", companyId); + + try { + // Get the companies by Statement. + CompanyPage page = companyService.getCompaniesByStatement(statementBuilder.ToStatement()); + + Company company = page.results[0]; + + // Update the company comment + company.comment = company.comment + " Updated."; + + // Update the company on the server. + Company[] companies = companyService.updateCompanies(new Company[] {company}); + + foreach (Company updatedCompany in companies) { + Console.WriteLine("Company with ID = {0}, name = {1}, and comment \"{2}\" was updated", + updatedCompany.id, updatedCompany.name, updatedCompany.comment); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ContactService/CreateContacts.cs b/examples/Dfp/CSharp/v201403/ContactService/CreateContacts.cs new file mode 100644 index 00000000000..3b2907d7d79 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ContactService/CreateContacts.cs @@ -0,0 +1,89 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates new contacts. To determine which contacts exist, + /// run GetAllContacts.cs. + /// + /// Tags: ContactService.createContacts + /// + class CreateContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new contacts. To determine which contacts exist, " + + "run GetAllContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201403.ContactService); + + // Set the IDs of the companies for the contacts. + long advertiserCompanyId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + long agencyCompanyId = long.Parse(_T("INSERT_AGENCY_COMPANY_ID_HERE")); + + // Create an advertiser contact. + Contact advertiserContact = new Contact(); + advertiserContact.name = "Mr. Advertiser #" + GetTimeStamp(); + advertiserContact.email = "advertiser@advertising.com"; + advertiserContact.companyId = advertiserCompanyId; + + // Create an agency contact. + Contact agencyContact = new Contact(); + agencyContact.name = "Ms. Agency #" + GetTimeStamp(); + agencyContact.email = "agency@agencies.com"; + agencyContact.companyId = agencyCompanyId; + + try { + // Create the contacts on the server. + Contact[] contacts = + contactService.createContacts(new Contact[] {advertiserContact, agencyContact}); + + foreach (Contact contact in contacts) { + Console.WriteLine("A contact with ID \"{0}\" and name \"{1}\" was created.", + contact.id, contact.name); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ContactService/GetAllContacts.cs b/examples/Dfp/CSharp/v201403/ContactService/GetAllContacts.cs new file mode 100644 index 00000000000..609d5215136 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ContactService/GetAllContacts.cs @@ -0,0 +1,89 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; +using Google.Api.Ads.Dfp.Util.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all contacts. To create contacts, run + /// CreateContacts.cs. + /// + /// Tags: ContactService.getContactsByStatement + /// + class GetAllContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all contacts. To create contacts, run CreateContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201403.ContactService); + + // Create a statement to get all contacts. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + ContactPage page = new ContactPage(); + + try { + do { + // Get contacts by statement. + page = contactService.getContactsByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (Contact contact in page.results) { + Console.WriteLine("{0}) Contact with ID \"{1}\" and name \"{2}\" was found.", + i, contact.id, contact.name); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ContactService/GetUninvitedContacts.cs b/examples/Dfp/CSharp/v201403/ContactService/GetUninvitedContacts.cs new file mode 100644 index 00000000000..dcc3ec731ae --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ContactService/GetUninvitedContacts.cs @@ -0,0 +1,92 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; +using Google.Api.Ads.Dfp.Util.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all contacts that aren't invited yet. To create + /// contacts, run CreateContacts.cs. + /// + /// Tags: ContactService.getContactsByStatement + /// + class GetUninvitedContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all contacts that aren't invited yet. To create " + + "contacts, run CreateContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUninvitedContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201403.ContactService); + + // Create a statement to get all uninvited contacts. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("status = :status") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("status", ContactStatus.UNINVITED.ToString()); + + // Set default for page. + ContactPage page = new ContactPage(); + + try { + do { + // Get contacts by statement. + page = contactService.getContactsByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (Contact contact in page.results) { + Console.WriteLine("{0}) Contact with ID \"{1}\" and name \"{2}\" was found.", + i, contact.id, contact.name); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ContactService/UpdateContacts.cs b/examples/Dfp/CSharp/v201403/ContactService/UpdateContacts.cs new file mode 100644 index 00000000000..4966b5c6941 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ContactService/UpdateContacts.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; +using Google.Api.Ads.Dfp.Util.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example updates contact addresses. To determine which contacts + /// exist, run GetAllContacts.cs. + /// + /// Tags: ContactService.getContactsByStatement + /// Tags: ContactService.updateContacts + /// + class UpdateContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates contact comments. To determine which contacts " + + "exist, run GetAllContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201403.ContactService); + + // Set the ID of the contact to update. + long contactId = long.Parse(_T("INSERT_CONTACT_ID_HERE")); + + try { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", contactId); + + // Get the contact. + ContactPage page = contactService.getContactsByStatement(statementBuilder.ToStatement()); + Contact contact = page.results[0]; + + // Update the address of the contact. + contact.address = "123 New Street, New York, NY, 10011"; + + // Update the contact on the server. + Contact[] contacts = contactService.updateContacts(new Contact[] {contact}); + + // Display results. + foreach (Contact updatedContact in contacts) { + Console.WriteLine("Contact with ID \"{0}\", name \"{1}\", and comment \"{2}\" was " + + "updated.", updatedContact.id, updatedContact.name, updatedContact.comment); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ContentMetadataKeyHierarchyService/CreateContentMetadataKeyHierarchies.cs b/examples/Dfp/CSharp/v201403/ContentMetadataKeyHierarchyService/CreateContentMetadataKeyHierarchies.cs new file mode 100644 index 00000000000..7d273a50cca --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ContentMetadataKeyHierarchyService/CreateContentMetadataKeyHierarchies.cs @@ -0,0 +1,105 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates content metadata key hierachries. To determine which content + /// metadata key hierachries exist, run GetAllContentMetadataKeyHierarchies.cs + /// + /// Tags: ContentMetadataKeyHierarchyService.getContentMetadataKeyHierarchiesByStatement + /// Tags: ContentMetadataKeyHierarchyService.createContentMetadataKeyHierarchies + /// + class CreateContentMetadataKeyHierarchies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates content metadata key hierachries. To determine " + + "which content metadata key hierachries exist, run " + + "GetAllContentMetadataKeyHierarchies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateContentMetadataKeyHierarchies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(Lib.DfpUser user) { + // Get the ContentMetadataKeyHierarchy service. + ContentMetadataKeyHierarchyService contentMetadataKeyHierarchyService = + (ContentMetadataKeyHierarchyService) user.GetService( + DfpService.v201403.ContentMetadataKeyHierarchyService); + + // Set the IDs of the custom targeting keys for the hierarchy. + long customTargetingKeyId1 = long.Parse(_T("INSERT_LEVEL_ONE_CUSTOM_TARGETING_KEY_ID_HERE")); + long customTargetingKeyId2 = long.Parse(_T("INSERT_LEVEL_TWO_CUSTOM_TARGETING_KEY_ID_HERE")); + + List hierarchyLevels = + new List(); + + ContentMetadataKeyHierarchyLevel hierarchyLevel1 = new ContentMetadataKeyHierarchyLevel(); + hierarchyLevel1.customTargetingKeyId = customTargetingKeyId1; + hierarchyLevel1.hierarchyLevel = 1; + hierarchyLevels.Add(hierarchyLevel1); + + ContentMetadataKeyHierarchyLevel hierarchyLevel2 = new ContentMetadataKeyHierarchyLevel(); + hierarchyLevel2.customTargetingKeyId = customTargetingKeyId2; + hierarchyLevel2.hierarchyLevel = 2; + hierarchyLevels.Add(hierarchyLevel2); + + ContentMetadataKeyHierarchy contentMetadataKeyHierarchy = new ContentMetadataKeyHierarchy(); + contentMetadataKeyHierarchy.name = "Content hierarchy #" + new Random().Next(int.MaxValue); + contentMetadataKeyHierarchy.hierarchyLevels = hierarchyLevels.ToArray(); + + try { + // Create the content metadata key hierarchy on the server. + ContentMetadataKeyHierarchy[] contentMetadataKeyHierarchies = + contentMetadataKeyHierarchyService.createContentMetadataKeyHierarchies( + new ContentMetadataKeyHierarchy[] {contentMetadataKeyHierarchy}); + + foreach (ContentMetadataKeyHierarchy createdContentMetadataKeyHierarchy in + contentMetadataKeyHierarchies) { + Console.WriteLine("A content metadata key hierarchy with ID \"{0}\", name " + + "\"{1}\" and {2} levels was created.", createdContentMetadataKeyHierarchy.id, + createdContentMetadataKeyHierarchy.name, + createdContentMetadataKeyHierarchy.hierarchyLevels.Length); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create content metadata key hierarchies. Exception says " + + "\"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ContentMetadataKeyHierarchyService/DeleteContentMetadataKeyHierarchies.cs b/examples/Dfp/CSharp/v201403/ContentMetadataKeyHierarchyService/DeleteContentMetadataKeyHierarchies.cs new file mode 100644 index 00000000000..7a3f08b75c7 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ContentMetadataKeyHierarchyService/DeleteContentMetadataKeyHierarchies.cs @@ -0,0 +1,104 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This example deletes a content metadata key hierarchy. To determine + /// which content metadata key hierarchies exist, run + /// GetAllContentMetadataKeyHierarchies.cs. + /// + /// Tags: ContentMetadataKeyHierarchyService.getContentMetadataKeyHierarchiesByStatement + /// Tags: ContentMetadataKeyHierarchyService.performContentMetadataKeyHierarchyAction + /// + class DeleteContentMetadataKeyHierarchies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example deletes a content metadata key hierarchy. To determine " + + "which content metadata key hierarchies exist, run " + + "GetAllContentMetadataKeyHierarchies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomTargetingKeysAndValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(Lib.DfpUser user) { + // Get the ContentMetadataKeyHierarchy service. + ContentMetadataKeyHierarchyService contentMetadataKeyHierarchyService = + (ContentMetadataKeyHierarchyService) user.GetService( + DfpService.v201403.ContentMetadataKeyHierarchyService); + + // Set the ID of the content metadata key hierarchy to delete. + long contentMetadataKeyHierarchyId = + long.Parse(_T("INSERT_CONTENT_METADATA_KEY_HIERARCHY_ID_HERE")); + + // Create a statement to select a content metadata key hierarchy. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("WHERE id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", contentMetadataKeyHierarchyId); + + try { + // Get content metadata key hierarchies by statement. + ContentMetadataKeyHierarchyPage page = contentMetadataKeyHierarchyService + .getContentMetadataKeyHierarchiesByStatement(statementBuilder.ToStatement()); + + ContentMetadataKeyHierarchy contentMetadataKeyHierarchy = page.results[0]; + + Console.WriteLine("Content metadata key hierarchy with ID \"{0}\" will be deleted.", + contentMetadataKeyHierarchy.id); + + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + Google.Api.Ads.Dfp.v201403.DeleteContentMetadataKeyHierarchies action = + new Google.Api.Ads.Dfp.v201403.DeleteContentMetadataKeyHierarchies(); + + // Perform action. + UpdateResult result = contentMetadataKeyHierarchyService + .performContentMetadataKeyHierarchyAction(action, statementBuilder.ToStatement()); + + Console.WriteLine("Number of content metadata key hierarchies deleted: {0}", + result.numChanges); + } catch (Exception ex) { + Console.WriteLine("Failed to delete content metadata key hierarchies. " + + "Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ContentMetadataKeyHierarchyService/GetAllContentMetadataKeyHierarchies.cs b/examples/Dfp/CSharp/v201403/ContentMetadataKeyHierarchyService/GetAllContentMetadataKeyHierarchies.cs new file mode 100644 index 00000000000..46b4622a3c5 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ContentMetadataKeyHierarchyService/GetAllContentMetadataKeyHierarchies.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all content metadata key hierarchies. To create + /// content metadata key hierarchies, run + /// CreateContentMetadataKeyHierarchies.cs. + /// + /// Tags: ContentMetadataKeyHierarchyService.getContentMetadataKeyHierarchiesByStatement + /// + class GetAllContentMetadataKeyHierarchies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all content metadata key hierarchies. To create " + + "content metadata key hierarchies, run CreateContentMetadataKeyHierarchies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllContentMetadataKeyHierarchies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(Lib.DfpUser user) { + // Get the ContentMetadataKeyHierarchy service. + ContentMetadataKeyHierarchyService contentMetadataKeyHierarchyService = + (ContentMetadataKeyHierarchyService) user.GetService( + DfpService.v201403.ContentMetadataKeyHierarchyService); + + // Create a statement to get all content metadata key hierarchies + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + try { + int totalResultSetSize = 0; + do { + // Get content metadata key hierarchies by statement. + ContentMetadataKeyHierarchyPage page = contentMetadataKeyHierarchyService + .getContentMetadataKeyHierarchiesByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + totalResultSetSize = page.totalResultSetSize; + int i = page.startIndex; + foreach (ContentMetadataKeyHierarchy contentMetadataKeyHierarchy in page.results) { + Console.WriteLine("{0}) Content metadata key hierarchy with ID \"{1}\", " + + "and name \"{2}\" was found.", i++, contentMetadataKeyHierarchy.id, + contentMetadataKeyHierarchy.name); + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < totalResultSetSize); + Console.WriteLine("Number of results found: {0}", totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get content metadata key hierarchies. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ContentMetadataKeyHierarchyService/UpdateContentMetadataKeyHierarchies.cs b/examples/Dfp/CSharp/v201403/ContentMetadataKeyHierarchyService/UpdateContentMetadataKeyHierarchies.cs new file mode 100644 index 00000000000..593da3cad3b --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ContentMetadataKeyHierarchyService/UpdateContentMetadataKeyHierarchies.cs @@ -0,0 +1,118 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + + /// + /// This example updates a content metadata key hierarchy by adding a hierarchy level. To + /// determine which content metadata key hierarchies exist, run + /// GetAllContentMetadataKeyHierarchies.cs. + /// + /// Tags: ContentMetadataKeyHierarchyService.getContentMetadataKeyHierarchiesByStatement + /// Tags: ContentMetadataKeyHierarchyService.updateContentMetadataKeyHierarchies + /// + class UpdateContentMetadataKeyHierarchies : SampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example updates a content metadata key hierarchy by adding a hierarchy " + + "level. To determine which content metadata key hierarchies exist, run " + + "GetAllContentMetadataKeyHierarchies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateContentMetadataKeyHierarchies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(Lib.DfpUser user) { + // Get the ContentMetadataKeyHierarchy service. + ContentMetadataKeyHierarchyService contentMetadataKeyHierarchyService = + (ContentMetadataKeyHierarchyService) user.GetService( + DfpService.v201403.ContentMetadataKeyHierarchyService); + + // Set the ID of the content metadata key hierarchy to update. + long contentMetadataKeyHierarchyId = + long.Parse(_T("INSERT_CONTENT_METADATA_KEY_HIERARCHY_ID_HERE")); + + // Set the ID of the custom targeting key to be added as a hierarchy level + long customTargetingKeyId = long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + + // Create a statement to get content metadata key hierarchies. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("WHERE id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", contentMetadataKeyHierarchyId); + + try { + ContentMetadataKeyHierarchyPage page = contentMetadataKeyHierarchyService + .getContentMetadataKeyHierarchiesByStatement(statementBuilder.ToStatement()); + + ContentMetadataKeyHierarchy contentMetadataKeyHierarchy = page.results[0]; + + // Update the content metadata key hierarchy by adding a hierarchy level. + ContentMetadataKeyHierarchyLevel[] hierarchyLevels = contentMetadataKeyHierarchy + .hierarchyLevels; + + ContentMetadataKeyHierarchyLevel hierarchyLevel = new ContentMetadataKeyHierarchyLevel(); + hierarchyLevel.customTargetingKeyId = customTargetingKeyId; + hierarchyLevel.hierarchyLevel = hierarchyLevels.Length + 1; + + List updatedHieratchyLevels = + new List(); + updatedHieratchyLevels.AddRange(hierarchyLevels); + updatedHieratchyLevels.Add(hierarchyLevel); + + contentMetadataKeyHierarchy.hierarchyLevels = updatedHieratchyLevels.ToArray(); + + // Update the content hierarchy on the server. + ContentMetadataKeyHierarchy[] contentMetadataKeyHierarchies = + contentMetadataKeyHierarchyService.updateContentMetadataKeyHierarchies( + new ContentMetadataKeyHierarchy[] {contentMetadataKeyHierarchy}); + + foreach (ContentMetadataKeyHierarchy updatedContentMetadataKeyHierarchy in + contentMetadataKeyHierarchies) { + Console.WriteLine("Content metadata key hierarchy with ID \"{0}\", name " + + "\"{1}\" was updated.", updatedContentMetadataKeyHierarchy.id, + updatedContentMetadataKeyHierarchy.name); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update content metadata key hierarchies. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ContentService/GetAllContent.cs b/examples/Dfp/CSharp/v201403/ContentService/GetAllContent.cs new file mode 100644 index 00000000000..1a0253a2590 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ContentService/GetAllContent.cs @@ -0,0 +1,90 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all content. This feature is only available to DFP + /// premium solution networks. + /// + /// Tags: ContentService.getContentByStatement + /// + class GetAllContent : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all content. This feature is only available to DFP " + + "premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllContent(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContentService. + ContentService contentService = + (ContentService) user.GetService(DfpService.v201403.ContentService); + + // Create a statement to get all content. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + ContentPage page = new ContentPage(); + + try { + do { + // Get content by statement. + page = contentService.getContentByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (Content content in page.results) { + Console.WriteLine("{0}) Content with ID \"{1}\", name \"{2}\", and status \"{3}\" " + + "was found.", i, content.id, content.name, content.status); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all content. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ContentService/GetContentByCategory.cs b/examples/Dfp/CSharp/v201403/ContentService/GetContentByCategory.cs new file mode 100644 index 00000000000..304ac845f6f --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ContentService/GetContentByCategory.cs @@ -0,0 +1,128 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all active content categorized as "comedy" using + /// the network's content browse custom targeting key. This feature is only + /// available to DFP video publishers. + /// + /// Tags: NetworkService.getCurrentNetwork + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// Tags: ContentService.getContentByStatementAndCustomTargetingValue + /// /// + class GetContentByCategory : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active content categorized as 'comedy' using the " + + "network's content browse custom targeting key. This feature is only available to " + + "DFP video publishers."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetContentByCategory(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContentService. + ContentService contentService = + (ContentService) user.GetService(DfpService.v201403.ContentService); + + // Get the NetworkService. + NetworkService networkService = (NetworkService) user.GetService( + DfpService.v201403.NetworkService); + + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = (CustomTargetingService) user.GetService( + DfpService.v201403.CustomTargetingService); + + try { + // Get content browse custom targeting key ID. + long contentBrowseCustomTargetingKeyId = + networkService.getCurrentNetwork().contentBrowseCustomTargetingKeyId; + + // Create a statement to select the categories matching the name comedy. + Statement categoryFilterStatement = new StatementBuilder() + .Where("customTargetingKeyId = :contentBrowseCustomTargetingKeyId " + + " and name = :category") + .OrderBy("id ASC") + .Limit(1) + .AddValue("contentBrowseCustomTargetingKeyId", contentBrowseCustomTargetingKeyId) + .AddValue("category", "comedy") + .ToStatement(); + + // Get categories matching the filter statement. + CustomTargetingValuePage customTargetingValuePage = + customTargetingService.getCustomTargetingValuesByStatement(categoryFilterStatement); + + if (customTargetingValuePage.results != null) { + // Get the custom targeting value ID for the comedy category. + long categoryCustomTargetingValueId = customTargetingValuePage.results[0].id; + + // Create a statement to get all active content. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("status = :status") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("status", "ACTIVE"); + + // Set defaults for page and filterStatement. + ContentPage page = new ContentPage(); + + do { + // Get content by statement. + page = contentService.getContentByStatementAndCustomTargetingValue( + statementBuilder.ToStatement(), categoryCustomTargetingValueId); + + if (page.results != null) { + int i = page.startIndex; + foreach (Content content in page.results) { + Console.WriteLine("{0}) Content with ID \"{1}\", name \"{2}\", and status " + + "\"{3}\" was found.", i, content.id, content.name, content.status); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get content by category. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CreativeService/CopyImageCreatives.cs b/examples/Dfp/CSharp/v201403/CreativeService/CopyImageCreatives.cs new file mode 100644 index 00000000000..9b9738399b5 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CreativeService/CopyImageCreatives.cs @@ -0,0 +1,111 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates a copy of an image creative. This would + /// typically be done to reuse creatives in a small business network. To + /// determine which creatives exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// Tags: CreativeService.createCreatives + /// + class CopyImageCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a copy of an image creative. This would typically be" + + " done to reuse creatives in a small business network. To determine which creatives " + + "exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CopyImageCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201403.CreativeService); + + long creativeId = long.Parse(_T("INSERT_IMAGE_CREATIVE_ID_HERE")); + + // Create a statement to get the image creative. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("id", creativeId); + + try { + // Get the creative. + CreativePage page = creativeService.getCreativesByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + ImageCreative imageCreative = (ImageCreative) page.results[0]; + // Since we cannot set id to null, we mark it as not specified. + imageCreative.idSpecified = false; + + imageCreative.advertiserId = imageCreative.advertiserId; + imageCreative.name = imageCreative.name + " (Copy #" + GetTimeStamp() + ")"; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + imageCreative.primaryImageAsset.assetUrl); + + creativeAsset.size = imageCreative.primaryImageAsset.size; + imageCreative.primaryImageAsset = creativeAsset; + + // Create the copied creative. + Creative[] creatives = creativeService.createCreatives(new Creative[] {imageCreative}); + + // Display copied creatives. + foreach (Creative copiedCreative in creatives) { + Console.WriteLine("Image creative with ID \"{0}\", name \"{1}\", and type \"{2}\" " + + "was created and can be previewed at {3}", copiedCreative.id, copiedCreative.name, + copiedCreative.CreativeType, copiedCreative.previewUrl); + } + } else { + Console.WriteLine("No creatives were copied."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to copy creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CreativeService/CreateCreativeFromTemplate.cs b/examples/Dfp/CSharp/v201403/CreativeService/CreateCreativeFromTemplate.cs new file mode 100644 index 00000000000..5dde30f606e --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CreativeService/CreateCreativeFromTemplate.cs @@ -0,0 +1,138 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates a new template creative for a given advertiser. + /// To determine which companies are advertisers, run + /// GetCompaniesByStatement.cs. To determine which creatives already exist, + /// run GetAllCreatives.cs. To determine which creative templates exist, run + /// GetAllCreativeTemplates.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCreativeFromTemplate : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new template creative for a given advertiser. To " + + "determine which companies are advertisers, run GetCompaniesByStatement.cs. To " + + "determine which creatives already exist, run GetAllCreatives.cs. To determine " + + "which creative templates exist, run GetAllCreativeTemplates.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreativeFromTemplate(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201403.CreativeService); + + // Set the ID of the advertiser (company) that all creative will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Use the image banner with optional third party tracking template. + long creativeTemplateId = 10000680L; + + // Create the local custom creative object. + TemplateCreative templateCreative = new TemplateCreative(); + templateCreative.name = "Template creative"; + templateCreative.advertiserId = advertiserId; + templateCreative.creativeTemplateId = creativeTemplateId; + + // Set the creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + templateCreative.size = size; + + // Create the asset variable value. + AssetCreativeTemplateVariableValue assetVariableValue = + new AssetCreativeTemplateVariableValue(); + assetVariableValue.uniqueName = "Imagefile"; + assetVariableValue.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + assetVariableValue.fileName = String.Format("image{0}.jpg", this.GetTimeStamp()); + + // Create the image width variable value. + LongCreativeTemplateVariableValue imageWidthVariableValue = + new LongCreativeTemplateVariableValue(); + imageWidthVariableValue.uniqueName = "Imagewidth"; + imageWidthVariableValue.value = 300; + + // Create the image height variable value. + LongCreativeTemplateVariableValue imageHeightVariableValue = + new LongCreativeTemplateVariableValue(); + imageHeightVariableValue.uniqueName = "Imageheight"; + imageHeightVariableValue.value = 250; + + // Create the URL variable value. + UrlCreativeTemplateVariableValue urlVariableValue = new UrlCreativeTemplateVariableValue(); + urlVariableValue.uniqueName = "ClickthroughURL"; + urlVariableValue.value = "www.google.com"; + + // Create the target window variable value. + StringCreativeTemplateVariableValue targetWindowVariableValue = + new StringCreativeTemplateVariableValue(); + targetWindowVariableValue.uniqueName = "Targetwindow"; + targetWindowVariableValue.value = "_blank"; + + templateCreative.creativeTemplateVariableValues = new BaseCreativeTemplateVariableValue[] { + assetVariableValue, imageWidthVariableValue, imageHeightVariableValue, urlVariableValue, + targetWindowVariableValue}; + + try { + // Create the template creative on the server. + Creative[] createdTemplateCreatives = creativeService.createCreatives( + new Creative[] {templateCreative}); + + foreach (Creative createdTemplateCreative in createdTemplateCreatives) { + Console.WriteLine("A template creative with ID \"{0}\", name \"{1}\", and type " + + "\"{2}\" was created and can be previewed at {3}", createdTemplateCreative.id, + createdTemplateCreative.name, createdTemplateCreative.CreativeType, + createdTemplateCreative.previewUrl); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CreativeService/CreateCreatives.cs b/examples/Dfp/CSharp/v201403/CreativeService/CreateCreatives.cs new file mode 100644 index 00000000000..a07b4400a55 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CreativeService/CreateCreatives.cs @@ -0,0 +1,120 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates new image creatives for a given advertiser. To + /// determine which companies are advertisers, run GetCompaniesByStatement.cs. + /// To determine which creatives already exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new image creatives for a given advertiser. To " + + "determine which companies are advertisers, run GetCompaniesByStatement.cs. " + + "To determine which creatives already exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201403.CreativeService); + + // Set the ID of the advertiser (company) that all creatives will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Create an array to store local image creative objects. + Creative[] imageCreatives = new ImageCreative[5]; + + for (int i = 0; i < 5; i++) { + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", i); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + imageCreatives[i] = imageCreative; + } + + try { + // Create the image creatives on the server. + imageCreatives = creativeService.createCreatives(imageCreatives); + + if (imageCreatives != null) { + foreach (Creative creative in imageCreatives) { + // Use "is" operator to determine what type of creative was + // returned. + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + Console.WriteLine("An image creative with ID ='{0}', name ='{1}' and size = " + + "({2},{3}) was created and can be previewed at: {4}", imageCreative.id, + imageCreative.name, imageCreative.size.width, imageCreative.size.height, + imageCreative.previewUrl); + } else { + Console.WriteLine("A creative with ID ='{0}', name='{1}' and type='{2}' was created.", + creative.id, creative.name, creative.CreativeType); + } + } + } else { + Console.WriteLine("No creatives created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CreativeService/CreateCustomCreative.cs b/examples/Dfp/CSharp/v201403/CreativeService/CreateCustomCreative.cs new file mode 100644 index 00000000000..b0a7c6ef813 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CreativeService/CreateCustomCreative.cs @@ -0,0 +1,110 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates a custom creative for a given advertiser. To + /// determine which companies are advertisers, run GetCompaniesByStatement.cs. + /// To determine which creatives already exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCustomCreative : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a custom creative for a given advertiser. To determine " + + "which companies are advertisers, run GetCompaniesByStatement.cs. To determine which " + + "creatives already exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomCreative(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201403.CreativeService); + + // Set the ID of the advertiser (company) that all creatives will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + + // Create the local custom creative object. + CustomCreative customCreative = new CustomCreative(); + customCreative.name = "Custom creative " + GetTimeStamp(); + customCreative.advertiserId = advertiserId; + customCreative.destinationUrl = "http://google.com"; + + // Set the custom creative image asset. + CustomCreativeAsset customCreativeAsset = new CustomCreativeAsset(); + customCreativeAsset.macroName = "IMAGE_ASSET"; + customCreativeAsset.fileName = string.Format("inline{0}.jpg", GetTimeStamp()); + customCreativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + customCreative.customCreativeAssets = new CustomCreativeAsset[] {customCreativeAsset}; + + // Set the HTML snippet using the custom creative asset macro. + customCreative.htmlSnippet = "" + + "" + + "
Click above for great deals!"; + + // Set the creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + customCreative.size = size; + + try { + // Create the custom creative on the server. + Creative[] createdCreatives = creativeService.createCreatives( + new Creative[] {customCreative}); + + foreach (Creative createdCreative in createdCreatives) { + Console.WriteLine("A custom creative with ID \"{0}\", name \"{1}\", and size ({2}, " + + "{3}) was created and can be previewed at {4}", createdCreative.id, + createdCreative.name, createdCreative.size.width, createdCreative.size.height, + createdCreative.previewUrl); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CreativeService/GetAllCreatives.cs b/examples/Dfp/CSharp/v201403/CreativeService/GetAllCreatives.cs new file mode 100644 index 00000000000..53251898b64 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CreativeService/GetAllCreatives.cs @@ -0,0 +1,90 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all creatives. To create creatives, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// + class GetAllCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all creatives. To create creatives, run CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201403.CreativeService); + + // Create a Statement to get all creatives. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + CreativePage page = new CreativePage(); + + try { + do { + // Get creatives by Statement. + page = creativeService.getCreativesByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Creative creative in page.results) { + Console.WriteLine("{0}) Creative with ID ='{1}', name ='{2}' and type ='{3}' " + + "was found.", i, creative.id, creative.name, creative.CreativeType); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CreativeService/GetCreativesByStatement.cs b/examples/Dfp/CSharp/v201403/CreativeService/GetCreativesByStatement.cs new file mode 100644 index 00000000000..cfe21e0d839 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CreativeService/GetCreativesByStatement.cs @@ -0,0 +1,93 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all image creatives. To create an image creative, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// + class GetCreativesByStatement : SampleBase { + /// + /// Returns a description about the sample code. + /// + public override string Description { + get { + return "This code example gets all image creatives. To create an image creative, run " + + "CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201403.CreativeService); + + // Create a Statement to only select image creatives. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("creativeType = :creativeType") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("creativeType", "ImageCreative"); + + // Set default for page. + CreativePage page = new CreativePage(); + + try { + do { + // Get creatives by Statement. + page = creativeService.getCreativesByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Creative creative in page.results) { + Console.WriteLine("{0}) Creative with ID ='{1}', name ='{2}' and type ='{3}' " + + "was found.", i, creative.id, creative.name, creative.CreativeType); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get creatives by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CreativeService/UpdateCreatives.cs b/examples/Dfp/CSharp/v201403/CreativeService/UpdateCreatives.cs new file mode 100644 index 00000000000..d734abc0ebc --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CreativeService/UpdateCreatives.cs @@ -0,0 +1,98 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example updates image creatives. To create an image creative, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// Tags: CreativeService.updateCreatives + /// + class UpdateCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates image creatives. To create an image creative, run " + + "CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201403.CreativeService); + + // Set the ID of the creative to update. + int creativeId = int.Parse(_T("INSERT_CREATIVE_ID_HERE")); + + // Create a Statement to get all image creatives. + Statement statement = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", creativeId).ToStatement(); + + try { + // Get creatives by Statement. + CreativePage page = creativeService.getCreativesByStatement(statement); + + Creative creative = page.results[0]; + + // Update local creative object by changing its destination URL. + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + imageCreative.destinationUrl = "http://news.google.com"; + } + + // Update the creatives on the server. + Creative[] creatives = creativeService.updateCreatives(new Creative[] { creative }); + + foreach (Creative updatedCreative in creatives) { + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) updatedCreative; + Console.WriteLine("An image creative with ID = '{0}' and destination URL ='{1}' " + + "was updated.", imageCreative.id, imageCreative.destinationUrl); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to update creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CreativeTemplateService/GetAllCreativeTemplates.cs b/examples/Dfp/CSharp/v201403/CreativeTemplateService/GetAllCreativeTemplates.cs new file mode 100644 index 00000000000..0250a69a09c --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CreativeTemplateService/GetAllCreativeTemplates.cs @@ -0,0 +1,93 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all creative templates. + /// + /// Tags: CreativeTemplateService.getCreativeTemplatesByStatement + /// + class GetAllCreativeTemplates : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all creative templates."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreativeTemplates(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201403.CreativeTemplateService); + + // Create a statement to get all creative templates. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + CreativeTemplatePage page = new CreativeTemplatePage(); + + try { + do { + // Get creative templates by statement. + page = creativeTemplateService.getCreativeTemplatesByStatement( + statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (CreativeTemplate creativeTemplate in page.results) { + Console.WriteLine("{0}) Creative template with ID \"{1}\", name \"{2}\", and type " + + "\"{3}\" was found.", i, creativeTemplate.id, creativeTemplate.name, + creativeTemplate.type); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CreativeTemplateService/GetCreativeTemplatesByStatement.cs b/examples/Dfp/CSharp/v201403/CreativeTemplateService/GetCreativeTemplatesByStatement.cs new file mode 100644 index 00000000000..482e5be2f7a --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CreativeTemplateService/GetCreativeTemplatesByStatement.cs @@ -0,0 +1,93 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all the system defined creative templates. + /// + /// Tags: CreativeTemplateService.getCreativeTemplatesByStatement + /// + class GetCreativeTemplatesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all the system defined creative templates."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeTemplatesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201403.CreativeTemplateService); + + // Create a statement to only select system defined creative templates. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("type = :creativeTemplateType") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("creativeTemplateType", CreativeTemplateType.SYSTEM_DEFINED.ToString()); + + // Set default for page. + CreativeTemplatePage page = new CreativeTemplatePage(); + + try { + do { + // Get creative templates by statement. + page = creativeTemplateService.getCreativeTemplatesByStatement( + statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (CreativeTemplate creativeTemplate in page.results) { + Console.WriteLine("{0}) Creative template with ID \"{1}\", name \"{2}\", and type " + + "\"{3}\" was found.", i, creativeTemplate.id, creativeTemplate.name, + creativeTemplate.type); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CreativeWrapperService/CreateCreativeWrappers.cs b/examples/Dfp/CSharp/v201403/CreativeWrapperService/CreateCreativeWrappers.cs new file mode 100644 index 00000000000..cd7361482e0 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CreativeWrapperService/CreateCreativeWrappers.cs @@ -0,0 +1,89 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates a new creative wrapper. Creative wrappers must + /// be associated with a LabelType.CREATIVE_WRAPPER label and applied to ad + /// units by AdUnit.appliedLabels. To determine which creative wrappers exist, + /// run GetAllCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.createCreativeWrappers + /// + class CreateCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new creative wrapper. Creative wrappers must be " + + "associated with a LabelType.CREATIVE_WRAPPER label and applied to ad units by " + + "AdUnit.appliedLabels. To determine which creative wrappers exist, run " + + "GetAllCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201403.CreativeWrapperService); + + long labelId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE")); + + // Create creative wrapper objects. + CreativeWrapper creativeWrapper = new CreativeWrapper(); + creativeWrapper.labelId = labelId; + creativeWrapper.ordering = CreativeWrapperOrdering.INNER; + creativeWrapper.header = new CreativeWrapperHtmlSnippet(); + creativeWrapper.header.htmlSnippet = "My creative wrapper header"; + creativeWrapper.footer = new CreativeWrapperHtmlSnippet(); + creativeWrapper.footer.htmlSnippet = "My creative wrapper footer"; + + try { + // Add creative wrapper. + CreativeWrapper[] creativeWrappers = creativeWrapperService.createCreativeWrappers( + new CreativeWrapper[] {creativeWrapper}); + + // Display results. + foreach (CreativeWrapper wrapper in creativeWrappers) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' was " + + "created.", wrapper.id, wrapper.labelId); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creative wrappers. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CreativeWrapperService/DeactivateCreativeWrappers.cs b/examples/Dfp/CSharp/v201403/CreativeWrapperService/DeactivateCreativeWrappers.cs new file mode 100644 index 00000000000..944e9e2fc7e --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CreativeWrapperService/DeactivateCreativeWrappers.cs @@ -0,0 +1,111 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example deactivates all creative wrappers belonging to a label. + /// + /// Tags: CreativeWrapperService.getCreativeWrapperByStatement + /// Tags: CreativeWrapperService.performCreativeWrapperAction + /// + class DeActivateCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all creative wrappers belonging to a label."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeActivateCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201403.CreativeWrapperService); + + long labelId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE")); + + try { + // Create a query to select the active creative wrapper for the given + // label. + StatementBuilder statementBuilder = new StatementBuilder() + .Where ("labelId = :labelId AND status = :status") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("status", CreativeWrapperStatus.ACTIVE.ToString()) + .AddValue("labelId", labelId); + + // Set default for page. + CreativeWrapperPage page = new CreativeWrapperPage(); + + do { + page = + creativeWrapperService.getCreativeWrappersByStatement(statementBuilder.ToStatement()); + CreativeWrapper[] creativeWrappers = page.results; + if (creativeWrappers != null) { + foreach (CreativeWrapper wrapper in creativeWrappers) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' with " + + "status \'{2}\' will be deactivated.", wrapper.id, wrapper.labelId, + wrapper.status); + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of creative wrappers to be deactivated: {0}", + page.totalResultSetSize); + + // Modify statement for action. + statementBuilder.RemoveLimitAndOffset(); + + // Perform action. + CreativeWrapperAction action = new DeactivateCreativeWrappers(); + UpdateResult result = creativeWrapperService.performCreativeWrapperAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result.numChanges > 0) { + Console.WriteLine("Number of creative wrappers deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No creative wrappers were deactivated."); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to create creative wrappers. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CreativeWrapperService/GetActiveCreativeWrappers.cs b/examples/Dfp/CSharp/v201403/CreativeWrapperService/GetActiveCreativeWrappers.cs new file mode 100644 index 00000000000..06fbbfc9137 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CreativeWrapperService/GetActiveCreativeWrappers.cs @@ -0,0 +1,95 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; +using Google.Api.Ads.Dfp.Util.v201403; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all active creative wrappers. To create + /// creative wrappers, run CreateCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.getCreativeWrapperByStatement + /// + class GetActiveCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active creative wrappers. To create creative " + + "wrappers, run CreateCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActiveCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201403.CreativeWrapperService); + + // Create a Statement to get all active creative wrappers. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("status = :status") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("status", CreativeWrapperStatus.ACTIVE.ToString()); + + // Set default for page. + CreativeWrapperPage page = new CreativeWrapperPage(); + + try { + do { + // Get creative wrappers by Statement. + page = creativeWrapperService.getCreativeWrappersByStatement( + statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (CreativeWrapper wrapper in page.results) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' with " + + "status \'{2}\' was found.", wrapper.id, wrapper.labelId, wrapper.status); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get active creative wrappers. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CreativeWrapperService/GetAllCreativeWrappers.cs b/examples/Dfp/CSharp/v201403/CreativeWrapperService/GetAllCreativeWrappers.cs new file mode 100644 index 00000000000..036e8e19ada --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CreativeWrapperService/GetAllCreativeWrappers.cs @@ -0,0 +1,92 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all creative wrappers. To create creative wrappers, + /// run CreateCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.getCreativeWrapperByStatement + /// + class GetAllCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active creative wrappers. To create creative " + + "wrappers, run CreateCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201403.CreativeWrapperService); + + // Set defaults for page and Statement. + CreativeWrapperPage page = new CreativeWrapperPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all creative wrappers. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get creative wrappers by Statement. + page = creativeWrapperService.getCreativeWrappersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (CreativeWrapper wrapper in page.results) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' with " + + "status \'{2}\' was found.", wrapper.id, wrapper.labelId, wrapper.status); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get active creative wrappers. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CreativeWrapperService/UpdateCreativeWrappers.cs b/examples/Dfp/CSharp/v201403/CreativeWrapperService/UpdateCreativeWrappers.cs new file mode 100644 index 00000000000..b8668bb549e --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CreativeWrapperService/UpdateCreativeWrappers.cs @@ -0,0 +1,90 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; +using Google.Api.Ads.Dfp.Util.v201403; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example updates a creative wrapper to the 'OUTER' wrapping + /// order. To determine which creative wrappers exist, run + /// GetAllCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.getCreativeWrappersByStatement + /// Tags: CreativeWrapperService.updateCreativeWrappers + /// + class UpdateCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active creative wrappers. To create creative " + + "wrappers, run CreateCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201403.CreativeWrapperService); + + long creativeWrapperId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_ID_HERE")); + + try { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", creativeWrapperId); + CreativeWrapperPage page = creativeWrapperService.getCreativeWrappersByStatement( + statementBuilder.ToStatement()); + CreativeWrapper wrapper = page.results[0]; + + wrapper.ordering = CreativeWrapperOrdering.OUTER; + // Update the creative wrappers on the server. + CreativeWrapper[] creativeWrappers = creativeWrapperService.updateCreativeWrappers( + new CreativeWrapper[] {wrapper}); + + // Display results. + foreach (CreativeWrapper createdCreativeWrapper in creativeWrappers) { + Console.WriteLine("Creative wrapper with ID '{0}' and wrapping order '{1}' was " + + "updated.", createdCreativeWrapper.id, createdCreativeWrapper.ordering); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update creative wrappers. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CustomFieldService/CreateCustomFieldOptions.cs b/examples/Dfp/CSharp/v201403/CustomFieldService/CreateCustomFieldOptions.cs new file mode 100644 index 00000000000..fda53c22c01 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CustomFieldService/CreateCustomFieldOptions.cs @@ -0,0 +1,97 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates custom field options for a drop-down custom + /// field. Once created, custom field options can be found under the options + /// fields of the drop-down custom field and they cannot be deleted. To + /// determine which custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.createCustomFieldOptions + /// + class CreateCustomFieldOptions : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates custom field options for a drop-down custom field. " + + "Once created, custom field options can be found under the options fields of the " + + "drop-down custom field and they cannot be deleted. To determine which custom " + + "fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomFieldOptions(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = + (CustomFieldService) user.GetService(DfpService.v201403.CustomFieldService); + + // Set the ID of the drop-down custom field to create options for. + long customFieldId = long.Parse(_T("INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE")); + + // Create custom field options. + CustomFieldOption customFieldOption1 = new CustomFieldOption(); + customFieldOption1.displayName = "Approved"; + customFieldOption1.customFieldId = customFieldId; + + CustomFieldOption customFieldOption2 = new CustomFieldOption(); + customFieldOption2.displayName = "Unapproved"; + customFieldOption2.customFieldId = customFieldId; + + try { + // Add custom field options. + CustomFieldOption[] customFieldOptions = + customFieldService.createCustomFieldOptions(new CustomFieldOption[] {customFieldOption1, + customFieldOption2}); + + // Display results. + if (customFieldOptions != null) { + foreach (CustomFieldOption customFieldOption in customFieldOptions) { + Console.WriteLine("Custom field option with ID \"{0}\" and name \"{1}\" was created.", + customFieldOption.id, customFieldOption.displayName); + } + } else { + Console.WriteLine("No custom field options created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom field options. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CustomFieldService/CreateCustomFields.cs b/examples/Dfp/CSharp/v201403/CustomFieldService/CreateCustomFields.cs new file mode 100644 index 00000000000..7dff81993fe --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CustomFieldService/CreateCustomFields.cs @@ -0,0 +1,92 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates custom fields. To determine which custom fields + /// exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.createCustomFields + /// + class CreateCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates custom fields. To determine which custom fields exist" + + ", run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201403.CustomFieldService); + + // Create custom fields. + CustomField customField1 = new CustomField(); + customField1.name = "Customer comments #" + GetTimeStamp(); + customField1.entityType = CustomFieldEntityType.LINE_ITEM; + customField1.dataType = CustomFieldDataType.STRING; + customField1.visibility = CustomFieldVisibility.FULL; + + CustomField customField2 = new CustomField(); + customField2.name = "Internal approval status #" + GetTimeStamp(); + customField2.entityType = CustomFieldEntityType.LINE_ITEM; + customField2.dataType = CustomFieldDataType.DROP_DOWN; + customField2.visibility = CustomFieldVisibility.FULL; + + try { + // Add custom fields. + CustomField[] customFields = + customFieldService.createCustomFields(new CustomField[] {customField1, customField2}); + + // Display results. + if (customFields != null) { + foreach (CustomField customField in customFields) { + Console.WriteLine("Custom field with ID \"{0}\" and name \"{1}\" was created.", + customField.id, customField.name); + } + } else { + Console.WriteLine("No custom fields created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CustomFieldService/DeactivateCustomFields.cs b/examples/Dfp/CSharp/v201403/CustomFieldService/DeactivateCustomFields.cs new file mode 100644 index 00000000000..724bc873e44 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CustomFieldService/DeactivateCustomFields.cs @@ -0,0 +1,120 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example deactivates a custom field. To determine which custom fields exist, + /// run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// Tags: CustomFieldService.performCustomFieldAction + /// + class DeactivateCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates a custom field. To determine which custom fields " + + "exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201403.CustomFieldService); + + // Set the ID of the custom field to update. + int customFieldId = int.Parse(_T("INSERT_CUSTOM_FIELD_ID_HERE")); + + // Create statement to select only active custom fields that apply to + // line items. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", customFieldId); + + // Set default for page. + CustomFieldPage page = new CustomFieldPage(); + int i = 0; + List customFieldIds = new List(); + + try { + do { + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + foreach (CustomField customField in page.results) { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" will be " + + "deactivated.", i, customField.id, customField.name); + customFieldIds.Add(customField.id.ToString()); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of custom fields to be deactivated: " + customFieldIds.Count); + + if (customFieldIds.Count > 0) { + // Remove limit and offset from statement. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + Dfp.v201403.DeactivateCustomFields action = new Dfp.v201403.DeactivateCustomFields(); + + // Perform action. + UpdateResult result = customFieldService.performCustomFieldAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of custom fields deactivated: " + result.numChanges); + } else { + Console.WriteLine("No custom fields were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CustomFieldService/GetAllCustomFields.cs b/examples/Dfp/CSharp/v201403/CustomFieldService/GetAllCustomFields.cs new file mode 100644 index 00000000000..ff81b2c52db --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CustomFieldService/GetAllCustomFields.cs @@ -0,0 +1,107 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all custom fields. To create custom fields, run + /// CreateCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// Tags: CustomFieldService.performCustomFieldAction + /// + class GetAllCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom fields. To create custom fields, run " + + "CreateCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201403.CustomFieldService); + + // Create a statement to get all custom fields. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Sets default for page. + CustomFieldPage page = new CustomFieldPage(); + + try { + do { + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomField customField in page.results) { + if (customField is DropDownCustomField) { + List dropDownCustomFieldStrings = new List(); + DropDownCustomField dropDownCustomField = (DropDownCustomField) customField; + if (dropDownCustomField.options != null) { + foreach (CustomFieldOption customFieldOption in dropDownCustomField.options) { + dropDownCustomFieldStrings.Add(customFieldOption.displayName); + } + } + Console.WriteLine("{0}) Drop-down custom field with ID \"{1}\", name \"{2}\", " + + "and options {{{3}}} was found.", i, customField.id, customField.name, + string.Join(", ", dropDownCustomFieldStrings.ToArray())); + } else { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" was found.", + i, customField.id, customField.name); + } + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CustomFieldService/GetAllLineItemCustomFields.cs b/examples/Dfp/CSharp/v201403/CustomFieldService/GetAllLineItemCustomFields.cs new file mode 100644 index 00000000000..2dc038bbd5f --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CustomFieldService/GetAllLineItemCustomFields.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all custom fields that apply to line items. To + /// create custom fields, run CreateCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// + class GetAllLineItemCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom fields that apply to line items. To create " + + "custom fields, run CreateCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLineItemCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201403.CustomFieldService); + + // Create statement to select only custom fields that apply to line items. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("entityType = :entityType") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("entityType", CustomFieldEntityType.LINE_ITEM.ToString()); + + // Set default for page. + CustomFieldPage page = new CustomFieldPage(); + int i = 0; + + try { + do { + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + foreach (CustomField customField in page.results) { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" was found.", i, + customField.id, customField.name); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all line item custom fields. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CustomFieldService/SetLineItemCustomFieldValue.cs b/examples/Dfp/CSharp/v201403/CustomFieldService/SetLineItemCustomFieldValue.cs new file mode 100644 index 00000000000..1b55e67d077 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CustomFieldService/SetLineItemCustomFieldValue.cs @@ -0,0 +1,152 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; +using Google.Api.Ads.Dfp.Util.v201403; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example sets custom field values on a line item. To determine + /// which custom fields exist, run GetAllCustomFields.cs. To create custom + /// field options, run CreateCustomFieldOptions.cs. To determine which line + /// items exist, run GetAllLineItems.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.updateLineItems + /// + class SetLineItemCustomFieldValue : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example sets custom field values on a line item. To determine which " + + "custom fields exist, run GetAllCustomFields.cs. To create custom field options, " + + "run CreateCustomFieldOptions.cs. To determine which line items exist, run " + + "GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new SetLineItemCustomFieldValue(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201403.CustomFieldService); + + // Get the LineItemService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201403.LineItemService); + + // Set the IDs of the custom fields, custom field option, and line item. + long customFieldId = long.Parse(_T("INSERT_STRING_CUSTOM_FIELD_ID_HERE")); + long customFieldOptionId = long.Parse(_T("INSERT_CUSTOM_FIELD_OPTION_ID_HERE")); + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get the drop-down custom field id. + long dropDownCustomFieldId = + customFieldService.getCustomFieldOption(customFieldOptionId).customFieldId; + + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", lineItemId); + + // Get the line item. + LineItemPage lineItemPage = lineItemService.getLineItemsByStatement( + statementBuilder.ToStatement()); + LineItem lineItem = lineItemPage.results[0]; + + // Create custom field values. + List customFieldValues = new List(); + TextValue textValue = new TextValue(); + textValue.value = "Custom field value"; + + CustomFieldValue customFieldValue = new CustomFieldValue(); + customFieldValue.customFieldId = customFieldId; + customFieldValue.value = textValue; + customFieldValues.Add(customFieldValue); + + DropDownCustomFieldValue dropDownCustomFieldValue = new DropDownCustomFieldValue(); + dropDownCustomFieldValue.customFieldId = dropDownCustomFieldId; + dropDownCustomFieldValue.customFieldOptionId = customFieldOptionId; + customFieldValues.Add(dropDownCustomFieldValue); + + // Only add existing custom field values for different custom fields than + // the ones you are setting. + if (lineItem.customFieldValues != null) { + foreach (BaseCustomFieldValue oldCustomFieldValue in lineItem.customFieldValues) { + if (!(oldCustomFieldValue.customFieldId == customFieldId) + && !(oldCustomFieldValue.customFieldId == dropDownCustomFieldId)) { + customFieldValues.Add(oldCustomFieldValue); + } + } + } + + lineItem.customFieldValues = customFieldValues.ToArray(); + + // Update the line item on the server. + LineItem[] lineItems = lineItemService.updateLineItems(new LineItem[] {lineItem}); + + if (lineItems != null) { + foreach (LineItem updatedLineItem in lineItems) { + List customFieldValueStrings = new List(); + foreach (BaseCustomFieldValue baseCustomFieldValue in lineItem.customFieldValues) { + if (baseCustomFieldValue is CustomFieldValue + && ((CustomFieldValue) baseCustomFieldValue).value is TextValue) { + customFieldValueStrings.Add("{ID: '" + baseCustomFieldValue.customFieldId + + "', value: '" + + ((TextValue) ((CustomFieldValue) baseCustomFieldValue).value).value + + "'}"); + } else if (baseCustomFieldValue is DropDownCustomFieldValue) { + customFieldValueStrings.Add("{ID: '" + baseCustomFieldValue.customFieldId + + "', custom field option ID: '" + + ((DropDownCustomFieldValue) baseCustomFieldValue).customFieldOptionId + + "'}"); + } + } + Console.WriteLine("A line item with ID \"{0}\" set with custom field values \"{1}\".", + updatedLineItem.id, string.Join(", ", customFieldValueStrings.ToArray())); + } + } else { + Console.WriteLine("No line items were updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CustomFieldService/UpdateCustomFields.cs b/examples/Dfp/CSharp/v201403/CustomFieldService/UpdateCustomFields.cs new file mode 100644 index 00000000000..d13bff176fc --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CustomFieldService/UpdateCustomFields.cs @@ -0,0 +1,96 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; +using Google.Api.Ads.Dfp.Util.v201403; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example updates custom field descriptions. To determine which + /// custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// Tags: CustomFieldService.updateCustomFields + /// + class UpdateCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates custom field descriptions. To determine which custom " + + "fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201403.CustomFieldService); + + // Set the ID of the custom field to update. + long customFieldId = long.Parse(_T("INSERT_CUSTOM_FIELD_ID_HERE")); + + try { + // Get the custom field. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", customFieldId); + + CustomFieldPage page = customFieldService.getCustomFieldsByStatement( + statementBuilder.ToStatement()); + CustomField customField = page.results[0]; + + customField.description = + (customField.description == null ? "" : customField.description + " Updated"); + + // Update the custom field on the server. + CustomField[] customFields = + customFieldService.updateCustomFields(new CustomField[] {customField}); + + // Display results + foreach (CustomField updatedCustomField in customFields) { + Console.WriteLine("Custom field with ID \"{0}\", name \"{1}\", and description " + + "\"{2}\" was updated.", updatedCustomField.id, updatedCustomField.name, + updatedCustomField.description); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs b/examples/Dfp/CSharp/v201403/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs new file mode 100644 index 00000000000..d4c3fafc437 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs @@ -0,0 +1,158 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates new custom targeting keys and values. To + /// determine which custom targeting keys and values exist, run + /// GetAllCustomTargetingKeysAndValues.cs. To target these custom targeting + /// keys and values, run TargetCustomCriteria.cs. + /// + /// Tags: CustomTargetingService.createCustomTargetingKeys + /// Tags: CustomTargetingService.createCustomTargetingValues + /// + class CreateCustomTargetingKeysAndValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new custom targeting keys and values. To determine " + + "which custom targeting keys and values exist, run " + + "GetAllCustomTargetingKeysAndValues.cs. To target these custom targeting keys and " + + "values, run TargetCustomCriteria.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomTargetingKeysAndValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201403.CustomTargetingService); + + // Create predefined key. + CustomTargetingKey genderKey = new CustomTargetingKey(); + genderKey.displayName = "gender"; + genderKey.name = "g"; + genderKey.type = CustomTargetingKeyType.PREDEFINED; + + // Create predefined key that may be used for content targeting. + CustomTargetingKey genreKey = new CustomTargetingKey(); + genreKey.displayName = "genre"; + genreKey.name = "genre"; + genreKey.type = CustomTargetingKeyType.PREDEFINED; + + // Create free-form key. + CustomTargetingKey carModelKey = new CustomTargetingKey(); + carModelKey.displayName = "car model"; + carModelKey.name = "c"; + carModelKey.type = CustomTargetingKeyType.FREEFORM; + + try { + // Create the custom targeting keys on the server. + CustomTargetingKey[] keys = customTargetingService.createCustomTargetingKeys( + new CustomTargetingKey[] {genderKey, genreKey, carModelKey}); + + if (keys != null) { + foreach (CustomTargetingKey key in keys) { + Console.WriteLine("A custom targeting key with ID \"{0}\", name \"{1}\", and display " + + "name \"{2}\" was created.", key.id, key.name, key.displayName); + } + } else { + Console.WriteLine("No keys were created."); + } + + // Create custom targeting value for the predefined gender key. + CustomTargetingValue genderMaleValue = new CustomTargetingValue(); + genderMaleValue.customTargetingKeyId = keys[0].id; + genderMaleValue.displayName = "male"; + // Name is set to 1 so that the actual name can be hidden from website + // users. + genderMaleValue.name = "1"; + genderMaleValue.matchType = CustomTargetingValueMatchType.EXACT; + + CustomTargetingValue genderFemaleValue = new CustomTargetingValue(); + genderFemaleValue.customTargetingKeyId = keys[0].id; + genderFemaleValue.displayName = "female"; + // Name is set to 2 so that the actual name can be hidden from website + // users. + genderFemaleValue.name = "2"; + genderFemaleValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create custom targeting value for the predefined genre key. + CustomTargetingValue genreComedyValue = new CustomTargetingValue(); + genreComedyValue.customTargetingKeyId = keys[1].id; + genreComedyValue.displayName = "comedy"; + genreComedyValue.name = "comedy"; + genreComedyValue.matchType = CustomTargetingValueMatchType.EXACT; + + CustomTargetingValue genreDramaValue = new CustomTargetingValue(); + genreDramaValue.customTargetingKeyId = keys[1].id; + genreDramaValue.displayName = "drama"; + genreDramaValue.name = "drama"; + genreDramaValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create custom targeting value for the free-form age key. These are + // values that would be suggested in the UI or can be used when + // targeting with a FreeFormCustomCriteria. + CustomTargetingValue carModelHondaCivicValue = new CustomTargetingValue(); + carModelHondaCivicValue.customTargetingKeyId = keys[2].id; + carModelHondaCivicValue.displayName = "honda civic"; + carModelHondaCivicValue.name = "honda civic"; + // Setting match type to exact will match exactly "honda civic". + carModelHondaCivicValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create the custom targeting values on the server. + CustomTargetingValue[] returnValues = customTargetingService.createCustomTargetingValues( + new CustomTargetingValue[] {genderMaleValue, genderFemaleValue, genreComedyValue, + genreDramaValue, carModelHondaCivicValue}); + + if (returnValues != null) { + foreach (CustomTargetingValue value in returnValues) { + Console.WriteLine("A custom targeting value with ID \"{0}\", belonging to key with " + + "ID \"{1}\", name \"{2}\", and display name \"{3}\" was created.", value.id, + value.customTargetingKeyId, value.name, value.displayName); + } + } else { + Console.WriteLine("No values were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom targeting keys and values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs b/examples/Dfp/CSharp/v201403/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs new file mode 100644 index 00000000000..ff29993349f --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs @@ -0,0 +1,123 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all custom targeting keys and the values. To create + /// custom targeting keys and values, run + /// CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// + class GetAllCustomTargetingKeysAndValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom targeting keys and the values. To create " + + "custom targeting keys and values, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCustomTargetingKeysAndValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201403.CustomTargetingService); + + // Create a statement to get all custom targeting keys. + StatementBuilder keyStatementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + CustomTargetingKeyPage keyPage = new CustomTargetingKeyPage(); + + try { + do { + // Get custom targeting keys by statement. + keyPage = customTargetingService.getCustomTargetingKeysByStatement( + keyStatementBuilder.ToStatement()); + + if (keyPage.results != null) { + int i = keyPage.startIndex; + foreach (CustomTargetingKey key in keyPage.results) { + Console.WriteLine("{0}) Custom targeting key with ID \"{1}\", name \"{2}\", " + + "display name \"{3}\", and type \"{4}\" was found.", i, key.id, key.name, + key.displayName, key.type); + + // Create a statement to get all custom targeting values for a + // custom targeting key (required) by its ID. + StatementBuilder valueStatementBuilder = new StatementBuilder() + .Where("customTargetingKeyId = :customTargetingKeyId") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("customTargetingKeyId", key.id); + + // Set default for page. + CustomTargetingValuePage valuePage = new CustomTargetingValuePage(); + + do { + // Get custom targeting values by statement. + valuePage = customTargetingService.getCustomTargetingValuesByStatement( + valueStatementBuilder.ToStatement()); + + if (valuePage.results != null) { + int j = valuePage.startIndex; + foreach (CustomTargetingValue value in valuePage.results) { + Console.WriteLine("\t{0}) Custom targeting value with ID \"{1}\", name " + + "\"{2}\", and display name \"{3}\" was found.", j, value.id, value.name, + value.displayName); + j++; + } + } + valueStatementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (valueStatementBuilder.GetOffset() < valuePage.totalResultSetSize); + i++; + } + } + keyStatementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (keyStatementBuilder.GetOffset() < keyPage.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", keyPage.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get custom targeting keys and the values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CustomTargetingService/GetCustomTargetingKeysByStatement.cs b/examples/Dfp/CSharp/v201403/CustomTargetingService/GetCustomTargetingKeysByStatement.cs new file mode 100644 index 00000000000..a09284f408b --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CustomTargetingService/GetCustomTargetingKeysByStatement.cs @@ -0,0 +1,97 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all predefined custom targeting keys. To create custom + /// targeting keys, run CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// + class GetCustomTargetingKeysByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all predefined custom targeting keys. To create custom " + + "targeting keys, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCustomTargetingKeysByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201403.CustomTargetingService); + + // Create a statement to only select predefined custom targeting keys. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("type = :type") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("type", CustomTargetingKeyType.PREDEFINED.ToString()); + + // Set default for page. + CustomTargetingKeyPage page = new CustomTargetingKeyPage(); + + try { + do { + // Get custom targeting keys by statement. + page = customTargetingService.getCustomTargetingKeysByStatement( + statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomTargetingKey customTargetingKey in page.results) { + Console.WriteLine("{0}) Custom targeting key with ID \"{1}\", name \"{2}\", and " + + "display name \"{3}\" was found.", i, customTargetingKey.id, + customTargetingKey.name, customTargetingKey.displayName); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + + } catch (Exception ex) { + Console.WriteLine("Failed to get predefined custom targeting keys. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CustomTargetingService/GetCustomTargetingValuesByStatement.cs b/examples/Dfp/CSharp/v201403/CustomTargetingService/GetCustomTargetingValuesByStatement.cs new file mode 100644 index 00000000000..a29ecb3968c --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CustomTargetingService/GetCustomTargetingValuesByStatement.cs @@ -0,0 +1,105 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets custom targeting values for the given predefined + /// custom targeting key. To create custom targeting values, run + /// CreateCustomTargetingKeysAndValues.cs. To determine which custom + /// targeting keys exist, run GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// + class GetCustomTargetingValuesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets custom targeting values for the given predefined custom " + + "targeting key. To create custom targeting values, run " + + "CreateCustomTargetingKeysAndValues.cs. To determine which custom targeting keys " + + "exist, run GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCustomTargetingValuesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201403.CustomTargetingService); + + // Set the ID of the custom targeting key to get custom targeting values + // for. + long customTargetingKeyId = long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + + // Create a statement to only select custom targeting values for a given + // key. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("customTargetingKeyId = :customTargetingKeyId") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("customTargetingKeyId", customTargetingKeyId); + + // Set default for page. + CustomTargetingValuePage page = new CustomTargetingValuePage(); + + try { + do { + // Get custom targeting values by statement. + page = customTargetingService.getCustomTargetingValuesByStatement( + statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomTargetingValue customTargetingValue in page.results) { + Console.WriteLine("{0}) Custom targeting value with ID \"{1}\", name \"{2}\", and " + + "display name \"{3}\" was found.", i, customTargetingValue.id, + customTargetingValue.name, customTargetingValue.displayName); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get custom targeting values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CustomTargetingService/UpdateCustomTargetingKeys.cs b/examples/Dfp/CSharp/v201403/CustomTargetingService/UpdateCustomTargetingKeys.cs new file mode 100644 index 00000000000..41d60042b94 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CustomTargetingService/UpdateCustomTargetingKeys.cs @@ -0,0 +1,103 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example updates the display name of each custom targeting key up + /// to the first 500. To determine which custom targeting keys exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// Tags: CustomTargetingService.updateCustomTargetingKeys + /// + class UpdateCustomTargetingKeys : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the display name of custom targeting keys. To " + + "determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomTargetingKeys(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201403.CustomTargetingService); + + // Set the ID of the custom targeting key to update. + int customTargetingKeyId = int.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + + // Create a statement to get the custom targeting key. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", customTargetingKeyId); + + try { + // Get custom targeting keys by statement. + CustomTargetingKeyPage page = + customTargetingService.getCustomTargetingKeysByStatement( + statementBuilder.ToStatement()); + + CustomTargetingKey customTargetingKey = page.results[0]; + + // Update each local custom targeting key object by changing its display name. + if (customTargetingKey.displayName == null) { + customTargetingKey.displayName = customTargetingKey.name; + } + customTargetingKey.displayName = customTargetingKey.displayName + " (Deprecated)"; + + // Update the custom targeting keys on the server. + CustomTargetingKey[] customTargetingKeys = customTargetingService.updateCustomTargetingKeys( + new CustomTargetingKey[] {customTargetingKey}); + + foreach (CustomTargetingKey updatedCustomTargetingKey in customTargetingKeys) { + Console.WriteLine("Custom targeting key with ID \"{0}\", name \"{1}\", and " + + "display name \"{2}\" was updated.", updatedCustomTargetingKey.id, + updatedCustomTargetingKey.name, updatedCustomTargetingKey.displayName); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update display name of custom targeting keys. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/CustomTargetingService/UpdateCustomTargetingValues.cs b/examples/Dfp/CSharp/v201403/CustomTargetingService/UpdateCustomTargetingValues.cs new file mode 100644 index 00000000000..65bbbdc4cf5 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/CustomTargetingService/UpdateCustomTargetingValues.cs @@ -0,0 +1,104 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example updates the display name of custom targeting values. To determine + /// which custom targeting keys exist, run GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// Tags: CustomTargetingService.updateCustomTargetingValues + /// + class UpdateCustomTargetingValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the display name of custom targeting values. To " + + "determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomTargetingValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201403.CustomTargetingService); + + // Set the ID of the predefined custom targeting value to update. + long customTargetingValueId = long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE")); + + // Create a statement to only select predefined custom targeting values + // for a given key. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("customTargetingValueId = :customTargetingValueId") + .OrderBy("id ASC") + .Limit(1) + .AddValue("customTargetingValueId", customTargetingValueId); + + try { + // Get custom targeting values by statement. + CustomTargetingValuePage page = + customTargetingService.getCustomTargetingValuesByStatement( + statementBuilder.ToStatement()); + + CustomTargetingValue customTargetingValue = page.results[0]; + + // Update the local custom targeting value object by changing its display name. + if (customTargetingValue.displayName == null) { + customTargetingValue.displayName = customTargetingValue.displayName; + } + customTargetingValue.displayName = customTargetingValue.displayName + " (Deprecated)"; + + // Update the custom targeting values on the server. + CustomTargetingValue[] customTargetingValues = + customTargetingService.updateCustomTargetingValues( + new CustomTargetingValue[] {customTargetingValue}); + + foreach (CustomTargetingValue updatedCustomTargetingValue in customTargetingValues) { + Console.WriteLine("Custom targeting value with ID \"{0}\", name \"{1}\", and " + + "display name \"{2}\" was updated.", updatedCustomTargetingValue.id, + updatedCustomTargetingValue.name, updatedCustomTargetingValue.displayName); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update display names of custom targeting values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ForecastService/GetForecast.cs b/examples/Dfp/CSharp/v201403/ForecastService/GetForecast.cs new file mode 100644 index 00000000000..806852a1a94 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ForecastService/GetForecast.cs @@ -0,0 +1,113 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets a forecast for a prospective line item. To + /// determine which placements exist, run GetAllPlacements.cs. + /// + /// Tags: ForecastService.getForecast + /// + class GetForecast : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a forecast for a prospective line item. To determine " + + "which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetForecast(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ForecastService. + ForecastService forecastService = + (ForecastService)user.GetService(DfpService.v201403.ForecastService); + + // Set the placement that the prospective line item will target. + long[] targetPlacementIds = new long[] {long.Parse(_T("INSERT_PLACEMENT_ID_HERE"))}; + + // Set the end date time to have the line line item run till. + string endDateTime = "INSERT_END_DATE_TIME_HERE (yyyyMMdd HH:mm:ss)"; + + // Create prospective line item. + LineItem lineItem = new LineItem(); + + lineItem.targeting = new Targeting(); + lineItem.targeting.inventoryTargeting = new InventoryTargeting(); + lineItem.targeting.inventoryTargeting.targetedPlacementIds = targetPlacementIds; + + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + lineItem.lineItemType = LineItemType.SPONSORSHIP; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + + lineItem.endDateTime = DateTimeUtilities.FromString(endDateTime); + + // Set the cost type to match the unit type. + lineItem.costType = CostType.CPM; + + try { + // Get forecast. + Forecast forecast = forecastService.getForecast(lineItem); + + // Display results. + long matched = forecast.matchedUnits; + double availablePercent = (double) (forecast.availableUnits / (matched * 1.0)) * 100; + String unitType = forecast.unitType.ToString().ToLower(); + Console.WriteLine("{0} {1} matched.\n{2}% available.", matched, unitType, + availablePercent, unitType); + + if (forecast.possibleUnitsSpecified) { + double possiblePercent = (double) (forecast.possibleUnits / (matched * 1.0)) * 100; + Console.WriteLine("{0}% {1} possible.\n", possiblePercent, unitType); + } + Console.WriteLine("{0} contending line items.", (forecast.contendingLineItems != null) ? + forecast.contendingLineItems.Length : 0); + } catch (Exception ex) { + Console.WriteLine("Failed to get forecast. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ForecastService/GetForecastById.cs b/examples/Dfp/CSharp/v201403/ForecastService/GetForecastById.cs new file mode 100644 index 00000000000..7279af67596 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ForecastService/GetForecastById.cs @@ -0,0 +1,84 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets a forecast for an existing line item. To determine + /// which line items exist, run GetAllLineItems.cs. + /// + /// Tags: ForecastService.getForecastById + /// + class GetForecastById : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a forecast for an existing line item. To determine which " + + "line items exist, run GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetForecastById(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ForecastService. + ForecastService forecastService = + (ForecastService) user.GetService(DfpService.v201403.ForecastService); + + // Set the line item to get a forecast for. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get forecast for line item. + Forecast forecast = forecastService.getForecastById(lineItemId); + + // Display results. + long matched = forecast.matchedUnits; + double availablePercent = (double) (forecast.availableUnits / (matched * 1.0)) * 100; + String unitType = forecast.unitType.ToString().ToLower(); + + Console.WriteLine("{0} {1} matched.\n{2} % {3} available.", matched, unitType, + availablePercent, unitType); + if (forecast.possibleUnitsSpecified) { + double possiblePercent = (double) (forecast.possibleUnits / (matched * 1.0)) * 100; + Console.WriteLine(possiblePercent + "% " + unitType + " possible.\n"); + } + Console.WriteLine("{0} contending line items.", (forecast.contendingLineItems != null)? + forecast.contendingLineItems.Length : 0); + } catch (Exception ex) { + Console.WriteLine("Failed to get forecast by id. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/InventoryService/CreateAdUnits.cs b/examples/Dfp/CSharp/v201403/InventoryService/CreateAdUnits.cs new file mode 100644 index 00000000000..47707281f95 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/InventoryService/CreateAdUnits.cs @@ -0,0 +1,108 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates new ad units under the effective root ad unit. + /// To determine which ad units exist, run GetAdUnitTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.createAdUnits, NetworkService.getCurrentNetwork + /// + class CreateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new ad units under the effective root ad unit. To " + + "determine which ad units exist, run GetAdUnitTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201403.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201403.NetworkService); + + string effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create an array to store local ad unit objects. + AdUnit[] adUnits = new AdUnit[5]; + + for (int i = 0; i < 5; i++) { + AdUnit adUnit = new AdUnit(); + adUnit.name = string.Format("Ad_Unit_{0}", i); + adUnit.parentId = effectiveRootAdUnitId; + + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + + // Set the size of possible creatives that can match this ad unit. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + adUnits[i] = adUnit; + } + + try { + // Create the ad units on the server. + adUnits = inventoryService.createAdUnits(adUnits); + + if (adUnits != null) { + foreach (AdUnit adUnit in adUnits) { + Console.WriteLine("An ad unit with ID = '{0}' was created under parent with " + + "ID = '{1}'.", adUnit.id, adUnit.parentId); + } + } else { + Console.WriteLine("No ad units created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/InventoryService/CreateMobileAdUnit.cs b/examples/Dfp/CSharp/v201403/InventoryService/CreateMobileAdUnit.cs new file mode 100644 index 00000000000..ecbfb509f17 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/InventoryService/CreateMobileAdUnit.cs @@ -0,0 +1,102 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates a new mobile ad unit under the effective root + /// ad unit. Mobile features need to be enabled on your account to use mobile + /// targeting. To determine which ad units exist, run GetInventoryTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.createAdUnits, NetworkService.getCurrentNetwork + /// + class CreateMobileAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new mobile ad unit under the effective ad unit. " + + "Mobile features need to be enabled on your account to use mobile targeting. To " + + "determine which ad units exist, run GetInventoryTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateMobileAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201403.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201403.NetworkService); + + // Set the parent ad unit's ID for all ad units to be created under. + String effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create local ad unit object. + AdUnit adUnit = new AdUnit(); + adUnit.name = "Mobile_Ad_Unit"; + adUnit.parentId = effectiveRootAdUnitId; + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + adUnit.targetPlatform = TargetPlatform.MOBILE; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + Size size = new Size(); + size.width = 400; + size.height = 300; + size.isAspectRatio = false; + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + // Set the size of possible creatives that can match this ad unit. + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + + try { + // Create the ad unit on the server. + AdUnit[] createdAdUnits = inventoryService.createAdUnits(new AdUnit[] {adUnit}); + + foreach (AdUnit createdAdunit in createdAdUnits) { + Console.WriteLine("An ad unit with ID \"{0}\" was created under parent with ID " + + "\"{1}\".", createdAdunit.id, createdAdunit.parentId); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/InventoryService/CreateVideoAdUnit.cs b/examples/Dfp/CSharp/v201403/InventoryService/CreateVideoAdUnit.cs new file mode 100644 index 00000000000..7a61289019c --- /dev/null +++ b/examples/Dfp/CSharp/v201403/InventoryService/CreateVideoAdUnit.cs @@ -0,0 +1,121 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates a new video ad unit under the effective root + /// ad unit. To determine which ad units exist, run GetInventoryTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.createAdUnits, NetworkService.getCurrentNetwork + /// + class CreateVideoAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new ad units under the effective root ad unit. To " + + "determine which ad units exist, run GetAdUnitTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateVideoAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201403.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201403.NetworkService); + + // Set the parent ad unit's ID for all ad units to be created under. + String effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create local ad unit object. + AdUnit adUnit = new AdUnit(); + adUnit.name = "Video_Ad_Unit"; + adUnit.parentId = effectiveRootAdUnitId; + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + adUnit.explicitlyTargeted = true; + adUnit.targetPlatform = TargetPlatform.WEB; + + // Create master ad unit size. + AdUnitSize masterAdUnitSize = new AdUnitSize(); + Size size1 = new Size(); + size1.width = 400; + size1.height = 300; + size1.isAspectRatio = false; + masterAdUnitSize.size = size1; + masterAdUnitSize.environmentType = EnvironmentType.VIDEO_PLAYER; + + // Create companion sizes. + AdUnitSize companionAdUnitSize1 = new AdUnitSize(); + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + size2.isAspectRatio = false; + companionAdUnitSize1.size = size2; + companionAdUnitSize1.environmentType = EnvironmentType.BROWSER; + + AdUnitSize companionAdUnitSize2 = new AdUnitSize(); + Size size3 = new Size(); + size3.width = 728; + size3.height = 90; + size3.isAspectRatio = false; + companionAdUnitSize2.size = size3; + companionAdUnitSize2.environmentType = EnvironmentType.BROWSER; + + // Add companions to master ad unit size. + masterAdUnitSize.companions = new AdUnitSize[] {companionAdUnitSize1, companionAdUnitSize2}; + + // Set the size of possible creatives that can match this ad unit. + adUnit.adUnitSizes = new AdUnitSize[] {masterAdUnitSize}; + + try { + // Create the ad unit on the server. + AdUnit[] createdAdUnits = inventoryService.createAdUnits(new AdUnit[] {adUnit}); + + foreach (AdUnit createdAdUnit in createdAdUnits) { + Console.WriteLine("A video ad unit with ID \"{0}\" was created under parent with ID " + + "\"{1}\".", createdAdUnit.id, createdAdUnit.parentId); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create video ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/InventoryService/DeActivateAdUnits.cs b/examples/Dfp/CSharp/v201403/InventoryService/DeActivateAdUnits.cs new file mode 100644 index 00000000000..ff62a1a5b66 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/InventoryService/DeActivateAdUnits.cs @@ -0,0 +1,118 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example deactivates all active ad units. To determine which ad + /// units exist, run GetAllAdUnits.cs or GetInventoryTree.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: InventoryService.performAdUnitAction + /// + class DeActivateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates an ad unit. To determine which ad units exist, " + + "run GetAllAdUnits.cs or GetInventoryTree.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeActivateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201403.InventoryService); + + // Set the ID of the ad unit to deactivate. + int adUnitId = int.Parse(_T("INSERT_AD_UNIT_ID_HERE")); + + // Create a statement to select the ad unit. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", adUnitId); + + // Set default for page. + AdUnitPage page = new AdUnitPage(); + List adUnitIds = new List(); + + try { + do { + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID ='{1}', name = {2} and status = {3} will" + + " be deactivated.", i, adUnit.id, adUnit.name, adUnit.status); + adUnitIds.Add(adUnit.id); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of ad units to be deactivated: {0}", adUnitIds.Count); + + // Modify statement for action. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + DeactivateAdUnits action = new DeactivateAdUnits(); + + // Perform action. + UpdateResult result = inventoryService.performAdUnitAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of ad units deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No ad units were deactivated."); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/InventoryService/GetAdUnitSizes.cs b/examples/Dfp/CSharp/v201403/InventoryService/GetAdUnitSizes.cs new file mode 100644 index 00000000000..5c3b638571d --- /dev/null +++ b/examples/Dfp/CSharp/v201403/InventoryService/GetAdUnitSizes.cs @@ -0,0 +1,82 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; +using Google.Api.Ads.Dfp.Util.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all web target platform ad unit sizes. + /// + /// Tags: InventoryService.getAdUnitSizesByStatement + /// + class GetAdUnitSizes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all web target platform ad unit sizes."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnitSizes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201403.InventoryService); + + StatementBuilder statementBuilder = new StatementBuilder() + .Where("targetPlatform = :targetPlatform") + .AddValue("targetPlatform", "WEB"); + + try { + // Get all ad unit sizes. + AdUnitSize[] adUnitSizes = inventoryService.getAdUnitSizesByStatement( + statementBuilder.ToStatement()); + + // Display results. + if (adUnitSizes != null) { + for (int i = 0; i < adUnitSizes.Length; i++) { + AdUnitSize adUnitSize = adUnitSizes[i]; + Console.WriteLine("{0}) Ad unit size ({1}x{2}) was found.\n", i, + adUnitSize.size.width, adUnitSize.size.height); + } + } else { + Console.WriteLine("No ad unit sizes found."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit sizes. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/InventoryService/GetAdUnitsByStatement.cs b/examples/Dfp/CSharp/v201403/InventoryService/GetAdUnitsByStatement.cs new file mode 100644 index 00000000000..804ba0ac8eb --- /dev/null +++ b/examples/Dfp/CSharp/v201403/InventoryService/GetAdUnitsByStatement.cs @@ -0,0 +1,101 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets the root ad unit. To create an ad unit, run + /// CreateAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: NetworkService.getCurrentNetwork + /// + class GetAdUnitsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the root ad unit. To create an ad unit, run " + + "CreateAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnitsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201403.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201403.NetworkService); + + // Get the effective root ad unit ID of the network. + string effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create a statement to select the children of the effective root ad + // unit. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("parentId = :parentId") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("parentId", effectiveRootAdUnitId); + + // Set default for page. + AdUnitPage page = new AdUnitPage(); + + try { + do { + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID = '{1}', name = '{2}' and status = '{3}' " + + "was found.", i, adUnit.id, adUnit.name, adUnit.status); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/InventoryService/GetAllAdUnits.cs b/examples/Dfp/CSharp/v201403/InventoryService/GetAllAdUnits.cs new file mode 100644 index 00000000000..5b0f34968b0 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/InventoryService/GetAllAdUnits.cs @@ -0,0 +1,89 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all ad units. To create ad units, run + /// CreateAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// + class GetAllAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all ad units. To create ad units, run CreateAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201403.InventoryService); + + // Create a Statement to get all ad units. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + AdUnitPage page = new AdUnitPage(); + + try { + do { + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID = '{1}', name = '{2}' and status = '{3}' " + + "was found.", i, adUnit.id, adUnit.name, adUnit.status); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/InventoryService/GetInventoryTree.cs b/examples/Dfp/CSharp/v201403/InventoryService/GetInventoryTree.cs new file mode 100644 index 00000000000..8b198b14d58 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/InventoryService/GetInventoryTree.cs @@ -0,0 +1,206 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example retrieves a previously created ad units and creates + /// a tree. + /// + /// Tags: InventoryService.getAdUnit, InventoryService.getAdUnitsByStatement + /// + class GetInventoryTree : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves a previously created ad units and creates a tree."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetInventoryTree(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + try { + // Get all ad units. + AdUnit[] allAdUnits = GetAllAdUnits(user); + + // Find the root ad unit. rootAdUnit can also be set to child unit to + // only build and display a portion of the tree. + // i.e. AdUnit adUnit = + // inventoryService.getAdUnit("INSERT_AD_UNIT_HERE") + AdUnit rootAdUnit = FindRootAdUnit(user); + + if (rootAdUnit == null) { + Console.WriteLine("Could not build tree. No root ad unit found."); + } else { + BuildAndDisplayAdUnitTree(rootAdUnit, allAdUnits); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + + /// + /// Gets all ad units for this user. + /// + /// The DfpUser to get the ad units for. + /// All ad units for this user. + private static AdUnit[] GetAllAdUnits(DfpUser user) { + // Create list to hold all ad units. + List adUnits = new List(); + + // Get InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201403.InventoryService); + + // Create a Statement to get all ad units. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + AdUnitPage page = new AdUnitPage(); + + do { + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + adUnits.AddRange(page.results); + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + return adUnits.ToArray(); + } + + /// + /// Finds the root ad unit for the user. + /// + /// The DfpUser to get the root ad unit for. + /// The ad unit representing the root ad unit or null if one + /// is not found. + private static AdUnit FindRootAdUnit(DfpUser user) { + // Get InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201403.InventoryService); + + // Create a Statement to only select the root ad unit. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("parentId IS NULL") + .OrderBy("id ASC") + .Limit(1); + + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + return page.results[0]; + } + return null; + } + + /// + /// Builds and displays an ad unit tree from an array of ad units underneath + /// the root ad unit. + /// + /// The root ad unit to build the tree under. + /// The array of ad units. + private static void BuildAndDisplayAdUnitTree(AdUnit root, AdUnit[] units) { + Dictionary> treeMap = new Dictionary>(); + + foreach (AdUnit unit in units) { + if (unit.parentId != null) { + if (treeMap.ContainsKey(unit.parentId) == false) { + treeMap.Add(unit.parentId, new List()); + } + treeMap[unit.parentId].Add(unit); + } + } + + if (root != null) { + DisplayInventoryTree(root, treeMap); + } else { + Console.WriteLine("No root unit found."); + } + } + + /// + /// Displays the ad unit tree beginning at the root ad unit. + /// + /// The root ad unit + /// The map of id to list of ad units + private static void DisplayInventoryTree(AdUnit root, Dictionary> treeMap) { + DisplayInventoryTreeHelper(root, treeMap, 0); + } + + /// + /// Helper for displaying inventory units. + /// + /// The root inventory unit. + /// The map of id to List of inventory units. + /// The depth the tree has reached. + private static void DisplayInventoryTreeHelper(AdUnit root, + Dictionary> treeMap, int depth) { + Console.WriteLine(GenerateTab(depth) + root.name + " (" + root.id + ")"); + + if (treeMap.ContainsKey(root.id)) { + foreach (AdUnit child in treeMap[root.id]) { + DisplayInventoryTreeHelper(child, treeMap, depth + 1); + } + } + } + + /// + /// Generates a String of tabs to represent branching to children. + /// + /// A depth from 0 to max(depth). + /// A string to insert in front of the root unit. + private static String GenerateTab(int depth) { + StringBuilder builder = new StringBuilder(); + if (depth != 0) { + builder.Append(" "); + } + + for (int i = 1; i < depth; i++) { + builder.Append("| "); + } + builder.Append("+--"); + return builder.ToString(); + } + } +} diff --git a/examples/Dfp/CSharp/v201403/InventoryService/UpdateAdUnits.cs b/examples/Dfp/CSharp/v201403/InventoryService/UpdateAdUnits.cs new file mode 100644 index 00000000000..5dd61d97713 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/InventoryService/UpdateAdUnits.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example updates an ad unit by enabling AdSense to the first + /// 500. To determine which ad units exist, run GetAllAdUnits.cs or + /// GetInventoryTree.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement, InventoryService.updateAdUnits + /// + class UpdateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates an ad unit by enabling AdSense. To determine which " + + "ad units exist, run GetAllAdUnits.cs or GetInventoryTree.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the sample code. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201403.InventoryService); + + // Set the ID of the ad unit to update. + int adUnitId = int.Parse(_T("INSERT_AD_UNIT_ID_HERE")); + + // Create a statement to get the ad unit. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", adUnitId); + + try { + // Get ad units by statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statementBuilder.ToStatement()); + + AdUnit adUnit = page.results[0]; + adUnit.inheritedAdSenseSettings.value.adSenseEnabled = true; + + // Update the ad units on the server. + AdUnit[] updatedAdUnits = inventoryService.updateAdUnits(new AdUnit[] { adUnit }); + + foreach (AdUnit updatedAdUnit in updatedAdUnits) { + Console.WriteLine("Ad unit with ID \"{0}\", name \"{1}\", and is AdSense enabled " + + "\"{2}\" was updated.", updatedAdUnit.id, updatedAdUnit.name, + updatedAdUnit.inheritedAdSenseSettings.value.adSenseEnabled); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/LabelService/CreateLabels.cs b/examples/Dfp/CSharp/v201403/LabelService/CreateLabels.cs new file mode 100644 index 00000000000..ea14b894564 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/LabelService/CreateLabels.cs @@ -0,0 +1,93 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates new labels. To determine which labels exist, run + /// GetAllLabels.cs. This feature is only available to DFP premium solution + /// networks. + /// + /// Tags: LabelService.createLabels + /// + class CreateLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new labels. To determine which labels exist, run " + + "GetAllLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201403.LabelService); + + try { + // Create an array to store local label objects. + Label[] labels = new Label[5]; + + for (int i = 0; i < 5; i++) { + Label label = new Label(); + label.name = "Label #" + GetTimeStamp(); + label.types = new LabelType[] {LabelType.COMPETITIVE_EXCLUSION}; + labels[i] = label; + } + + // Create the labels on the server. + labels = labelService.createLabels(labels); + + if (labels != null) { + foreach (Label label in labels) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("A label with ID '{0}', name '{1}', and type '{2}' was created.", + label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + } + } else { + Console.WriteLine("No labels created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/LabelService/DeactivateActiveLabels.cs b/examples/Dfp/CSharp/v201403/LabelService/DeactivateActiveLabels.cs new file mode 100644 index 00000000000..4937550d990 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/LabelService/DeactivateActiveLabels.cs @@ -0,0 +1,115 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example deactivates all active labels. To determine which labels + /// exist, run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement, LabelService.performLabelAction + /// + class DeactivateActiveLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates a label. To determine which labels exist," + + " run GetAllLabels.cs. This feature is only available to DFP premium solution " + + "networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateActiveLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201403.LabelService); + + // Set the ID of the label to deactivate. + int labelId = int.Parse(_T("INSERT_LABEL_ID_HERE")); + + // Create statement text to select the label. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", labelId); + + // Set default for page. + LabelPage page = new LabelPage(); + + try { + do { + // Get labels by statement. + page = labelService.getLabelsByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + Console.WriteLine("{0}) Label with ID '{1}', name '{2}' will be deactivated.", + i, label.id, label.name); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of labels to be deactivated: " + page.totalResultSetSize); + + // Modify statement for action. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + DeactivateLabels action = new DeactivateLabels(); + + // Perform action. + UpdateResult result = labelService.performLabelAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of labels deactivated: " + result.numChanges); + } else { + Console.WriteLine("No labels were deactivated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/LabelService/GetAllLabels.cs b/examples/Dfp/CSharp/v201403/LabelService/GetAllLabels.cs new file mode 100644 index 00000000000..3f66796c8f1 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/LabelService/GetAllLabels.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all labels. To create labels, run CreateLabels.cs. + /// This feature is only available to DFP premium solution networks. + /// + /// Tags: LabelService.getLabelsByStatement + /// + class GetAllLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all labels. To create labels, run CreateLabels.cs. This " + + "feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201403.LabelService); + + // Create a statement to get all labels. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + LabelPage page = new LabelPage(); + + try { + do { + // Get labels by statement. + page = labelService.getLabelsByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("{0}) Label with ID '{1}', name '{2}' and type '{3}' was found.", + i, label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/LabelService/GetLabelsByStatement.cs b/examples/Dfp/CSharp/v201403/LabelService/GetLabelsByStatement.cs new file mode 100644 index 00000000000..e86f2ec7d52 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/LabelService/GetLabelsByStatement.cs @@ -0,0 +1,99 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all labels that are competitively excluded. To create + /// labels, run CreateLabels.cs. This feature is only available to DFP premium solution + /// networks. + /// Tags: LabelService.getLabelsByStatement + /// + class GetLabelsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all labels that are competitively excluded. To create " + + "labels, run CreateLabels.cs. This feature is only available to DFP premium solution " + + "networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLabelsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201403.LabelService); + + // Create a statement to only select labels that are competitive + // sorted by name. + StatementBuilder statementBuilder = new StatementBuilder() + .Where ("type = :type") + .OrderBy("name ASC") + .Limit (StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("type", LabelType.COMPETITIVE_EXCLUSION.ToString()); + + // Set default for page + LabelPage page = new LabelPage(); + + try { + do { + // Get labels by statement. + page = labelService.getLabelsByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("{0}) Label with ID '{1}', name '{2}'and type '{3}' was found.", + i, label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while(statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/LabelService/UpdateLabels.cs b/examples/Dfp/CSharp/v201403/LabelService/UpdateLabels.cs new file mode 100644 index 00000000000..ee77e2f9b6a --- /dev/null +++ b/examples/Dfp/CSharp/v201403/LabelService/UpdateLabels.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example updates a label's description. To determine which labels + /// exist, run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement, LabelService.updateLabels + /// + class UpdateLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a label's description. To determine which labels " + + "exist, run GetAllLabels.cs. This feature is only available to DFP premium solution " + + "networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201403.LabelService); + + // Set the ID of the label to deactivate. + int labelId = int.Parse(_T("INSERT_LABEL_ID_HERE")); + + // Create a statement to select the label. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", labelId); + + try { + // Get the labels by statement. + LabelPage page = labelService.getLabelsByStatement(statementBuilder.ToStatement()); + + Label label = page.results[0]; + + // Update the label description. + label.description = "New label description."; + + // Update the label on the server. + Label[] labels = labelService.updateLabels(new Label[] {label}); + + foreach (Label updatedLabel in labels) { + Console.WriteLine("A label with ID '{0}' and name '{1}' was updated.", + updatedLabel.id, updatedLabel.name); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to update labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/ActivateLicas.cs b/examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/ActivateLicas.cs new file mode 100644 index 00000000000..a9b3cdead1f --- /dev/null +++ b/examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/ActivateLicas.cs @@ -0,0 +1,122 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example activates all LICAs for a given line item. To + /// determine which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.performLineItemCreativeAssociationAction + /// + class ActivateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example activates all LICAs for a given line item. To " + + "determine which LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ActivateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201403.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + // Create a Statement to page through LICAs. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("lineItemId = :lineItemId") + .OrderBy("lineItemId ASC, creativeId ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("lineItemId", lineItemId); + + // Set default for page. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + List creativeIds = new List(); + + try { + do { + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement( + statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' will be activated.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + creativeIds.Add(lica.creativeId.ToString()); + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of LICAs to be activated: {0}", creativeIds.Count); + + if (creativeIds.Count > 0) { + // Modify statement for action. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + ActivateLineItemCreativeAssociations action = + new ActivateLineItemCreativeAssociations(); + + // Perform action. + UpdateResult result = licaService.performLineItemCreativeAssociationAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of LICAs activated: {0}", result.numChanges); + } else { + Console.WriteLine("No LICAs were activated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to activate LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/CreateLicas.cs b/examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/CreateLicas.cs new file mode 100644 index 00000000000..a4a7cc1731e --- /dev/null +++ b/examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/CreateLicas.cs @@ -0,0 +1,104 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates new line item creative associations (LICAs) for + /// an existing line item and a set of creative ids. For small business + /// networks, the creative ids must represent new or copied creatives as + /// creatives cannot be used for more than one line item. For premium + /// solution networks, the creative ids can represent any creative. To copy + /// creatives, run CopyImageCreatives.cs. To determine which LICAs exist, run + /// GetAllLicasExample.cs. + /// + /// Tags: LineItemCreativeAssociationService.createLineItemCreativeAssociations + /// + class CreateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new line item creative associations (LICAs) for an " + + "existing line item and a set of creative ids. For small business networks, the " + + "creative ids must represent new or copied creatives as creatives cannot be used " + + "for more than one line item. For premium solution networks, the creative ids can " + + "represent any creative. To copy creatives, run CopyImageCreatives.cs. To determine " + + "which LICAs exist, run GetAllLicasExample.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = + (LineItemCreativeAssociationService) user.GetService( + DfpService.v201403.LineItemCreativeAssociationService); + + // Set the line item ID and creative IDs to associate. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long[] creativeIds = new long[] {long.Parse(_T("INSERT_CREATIVE_ID_HERE"))}; + + // Create an array to store local LICA objects. + LineItemCreativeAssociation[] licas = new LineItemCreativeAssociation[creativeIds.Length]; + + // For each line item, associate it with the given creative. + int i = 0; + foreach (long creativeId in creativeIds) { + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId; + lica.lineItemId = lineItemId; + licas[i++] = lica; + } + + try { + // Create the LICAs on the server. + licas = licaService.createLineItemCreativeAssociations(licas); + + if (licas != null) { + foreach (LineItemCreativeAssociation lica in licas) { + Console.WriteLine("A LICA with line item ID \"{0}\", creative ID \"{1}\", and status " + + "\"{2}\" was created.", lica.lineItemId, lica.creativeId, lica.status); + } + } else { + Console.WriteLine("No LICAs created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to associate creative with line item. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/DeactivateLicas.cs b/examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/DeactivateLicas.cs new file mode 100644 index 00000000000..b946a9e6728 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/DeactivateLicas.cs @@ -0,0 +1,122 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example deactivates all LICAs for a given line item. To determine + /// which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.performLineItemCreativeAssociationAction + /// + class DeactivateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all LICAs for a given line item. To determine " + + "which LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201403.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + // Create a Statement to page through active LICAs. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("lineItemId = :lineItemId") + .OrderBy("lineItemId ASC, creativeId ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("lineItemId", lineItemId); + + // Set default for page. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + List creativeIds = new List(); + + try { + do { + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement( + statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' will be deactivated.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + creativeIds.Add(lica.creativeId.ToString()); + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of LICAs to be deactivated: {0}", creativeIds.Count); + + if (creativeIds.Count > 0) { + // Modify statement for action. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + DeactivateLineItemCreativeAssociations action = + new DeactivateLineItemCreativeAssociations(); + + // Perform action. + UpdateResult result = licaService.performLineItemCreativeAssociationAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of LICAs deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No LICAs were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/GetAllLicas.cs b/examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/GetAllLicas.cs new file mode 100644 index 00000000000..6ca312080d0 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/GetAllLicas.cs @@ -0,0 +1,92 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all line item creative associations (LICA). To + /// create LICAs, run CreateLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// + class GetAllLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line item creative associations (LICA). To create " + + "LICAs, run CreateLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201403.LineItemCreativeAssociationService); + + // Create a Statement to get all LICAs. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("lineItemId ASC, creativeId ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + + try { + do { + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement( + statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' was found.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/GetLicasByStatement.cs b/examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/GetLicasByStatement.cs new file mode 100644 index 00000000000..5e82c8b5c09 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/GetLicasByStatement.cs @@ -0,0 +1,96 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all line item creative associations for a given + /// line item ID. To create LICAs, run CreateLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// + class GetLicasByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line item creative associations for a given line " + + "item ID. To create LICAs, run CreateLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLicasByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201403.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + // Create a Statement to only select LICAs for the given lineItem ID. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("lineItemId = :lineItemId") + .OrderBy("lineItemId ASC, creativeId ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("lineItemId", lineItemId); + + // Set default for page. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + + try { + do { + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement( + statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' was found.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while(statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/UpdateLicas.cs b/examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/UpdateLicas.cs new file mode 100644 index 00000000000..d0af03325fd --- /dev/null +++ b/examples/Dfp/CSharp/v201403/LineItemCreativeAssociationService/UpdateLicas.cs @@ -0,0 +1,103 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example updates the destination URL of a LICA. To determine which LICAs exist, + /// run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.updateLineItemCreativeAssociations + /// + class UpdateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the destination URL of a LICAs. To determine which " + + "LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201403.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + // Set the creative to get LICAs by. + long creativeId = long.Parse(_T("INSERT_CREATIVE_ID_HERE")); + + // Create a Statement to get all LICAs. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("lineItemId = :lineItemId AND creativeId = :creativeId") + .OrderBy("id ASC") + .Limit(1) + .AddValue("lineItemId", lineItemId) + .AddValue("creativeId", creativeId); + + try { + // Get LICAs by Statement. + LineItemCreativeAssociationPage page = + licaService.getLineItemCreativeAssociationsByStatement(statementBuilder.ToStatement()); + + LineItemCreativeAssociation lica = page.results[0]; + + // Update the LICA object by changing its destination URL. + lica.destinationUrl = "http://news.google.com"; + + // Update the LICA on the server. + LineItemCreativeAssociation[] licas = licaService.updateLineItemCreativeAssociations( + new LineItemCreativeAssociation[] {lica}); + + if (licas != null) { + foreach (LineItemCreativeAssociation updatedLica in licas) { + Console.WriteLine("LICA with line item ID = '{0}, creative ID ='{1}' and " + + "destination URL '{2}' was updated.", updatedLica.lineItemId, + updatedLica.creativeId, updatedLica.destinationUrl); + } + } else { + Console.WriteLine("No LICAs updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/LineItemService/ActivateLineItem.cs b/examples/Dfp/CSharp/v201403/LineItemService/ActivateLineItem.cs new file mode 100644 index 00000000000..3f6a4cfb747 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/LineItemService/ActivateLineItem.cs @@ -0,0 +1,131 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example activates all line items for the given order. To be + /// activated, line items need to be in the approved (needs creatives) state + /// and have at least one creative associated with them. To approve line + /// items, approve the order to which they belong by running ApproveOrders.cs. + /// To create LICAs, run CreateLicas.cs. To determine which line items exist, + /// run GetAllLineItem.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.performLineItemAction + /// + class ActivateLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example activates all line items for the given order. To be activated," + + " line items need to be in the approved (needs creatives) state and have at least one" + + " creative associated with them. To approve line items, approve the order to which" + + " they belong by running ApproveOrders.cs. To create LICAs, run CreateLicas.cs." + + " To determine which line items exist, run GetAllLineItem.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ActivateLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201403.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create Statement to select approved line items from a given order. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("orderId = :orderId and status = :status") + .AddValue("orderId", orderId) + .AddValue("status", ComputedStatus.NEEDS_CREATIVES.ToString()); + + // Set default for page. + LineItemPage page = new LineItemPage(); + List lineItemIds = new List(); + + try { + do { + // Get line items by Statement. + page = lineItemService.getLineItemsByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemSummary lineItem in page.results) { + // Archived line items cannot be activated. + if (!lineItem.isArchived) { + Console.WriteLine("{0}) Line item with ID ='{1}', belonging to order ID ='{2}' " + + "and name ='{2}' will be activated.", i, lineItem.id, lineItem.orderId, + lineItem.name); + lineItemIds.Add(lineItem.id.ToString()); + i++; + } + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + + Console.WriteLine("Number of line items to be activated: {0}", lineItemIds.Count); + + if (lineItemIds.Count > 0) { + // Modify Statement. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + ActivateLineItems action = new ActivateLineItems(); + + // Perform action. + UpdateResult result = lineItemService.performLineItemAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of line items activated: {0}", result.numChanges); + } else { + Console.WriteLine("No line items were activated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to activate line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/LineItemService/CreateLineItems.cs b/examples/Dfp/CSharp/v201403/LineItemService/CreateLineItems.cs new file mode 100644 index 00000000000..7ea1cabcd14 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/LineItemService/CreateLineItems.cs @@ -0,0 +1,216 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates new line items. To determine which line items + /// exist, run GetAllLineItems.cs. To determine which orders exist, run + /// GetAllOrders.cs. To determine which placements exist, run + /// GetAllPlacements.cs. To determine the IDs for locations, run + /// GetAllCities.cs, GetAllCountries.cs, GetAllMetros.cs, GetAllRegions.cs and + /// GetAllPostalCodes. + /// + /// Tags: LineItemService.createLineItems + /// + class CreateLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new line items. To determine which line items " + + "exist, run GetAllLineItems.cs. To determine which orders exist, run GetAllOrders.cs" + + ". To determine which placements exist, run GetAllPlacements.cs. To determine the " + + "IDs for locations, run GetAllCities.cs, GetAllCountries.cs, GetAllMetros.cs, " + + "GetAllRegions.cs and GetAllPostalCodes."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code examples. + /// + /// The DFP user object running the code examples. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201403.LineItemService); + + // Set the order that all created line items will belong to and the + // placement ID to target. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + long[] targetPlacementIds = new long[] {long.Parse(_T("INSERT_PLACEMENT_ID_HERE"))}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = targetPlacementIds; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + Location postalCodeLocation = new Location(); + postalCodeLocation.id = 9000093; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201403.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201403.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + // Create an array to store local line item objects. + LineItem[] lineItems = new LineItem[5]; + + for (int i = 0; i < 5; i++) { + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + i; + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + lineItems[i] = lineItem; + } + + try { + // Create the line items on the server. + lineItems = lineItemService.createLineItems(lineItems); + + if (lineItems != null) { + foreach (LineItem lineItem in lineItems) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and" + + " named \"{2}\" was created.", lineItem.id, lineItem.orderId, lineItem.name); + } + } else { + Console.WriteLine("No line items created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/LineItemService/CreateMobileLineItem.cs b/examples/Dfp/CSharp/v201403/LineItemService/CreateMobileLineItem.cs new file mode 100644 index 00000000000..716f0c249d3 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/LineItemService/CreateMobileLineItem.cs @@ -0,0 +1,172 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + + /// + /// This code example creates a new line item to serve to the mobile platform. + /// Mobile features needs to be enabled in your account to use mobile + /// targeting. To determine which line items exist, run GetAllLineItems.cs. To + /// determine which orders exist, run GetAllOrders.cs. To determine + /// which placements exist, run GetAllPlacements.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.performLineItemAction + /// + class CreateMobileLineItem : SampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new line item to serve to the mobile platform. Mobile" + + " features needs to be enabled in your account to use mobile targeting. To determine " + + "which line items exist, run GetAllLineItems.cs. To determine which orders exist, " + + "run GetAllOrders.cs. To determine which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateMobileLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201403.LineItemService); + + // Set the order that all created line items will belong to and the + // placement containing ad units with a mobile target platform. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + long[] targetedPlacementIds = new long[] { long.Parse(_T("INSERT_MOBILE_PLACEMENT_ID_HERE")) }; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = targetedPlacementIds; + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create device manufacturer targeting. + DeviceManufacturerTargeting deviceManufacturerTargeting = new DeviceManufacturerTargeting(); + deviceManufacturerTargeting.isTargeted = true; + + // Target the Google device manufacturer (40100). + Technology deviceManufacturerTechnology = new Technology(); + deviceManufacturerTechnology.id = 40100L; + deviceManufacturerTargeting.deviceManufacturers = + new Technology[] { deviceManufacturerTechnology }; + technologyTargeting.deviceManufacturerTargeting = deviceManufacturerTargeting; + + // Create mobile device targeting. + MobileDeviceTargeting mobileDeviceTargeting = new MobileDeviceTargeting(); + + // Exclude the Nexus One device (604046). + Technology mobileDeviceTechnology = new Technology(); + mobileDeviceTechnology.id = 604046L; + mobileDeviceTargeting.targetedMobileDevices = new Technology[] { mobileDeviceTechnology }; + technologyTargeting.mobileDeviceTargeting = mobileDeviceTargeting; + + // Create mobile device submodel targeting. + MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargeting = + new MobileDeviceSubmodelTargeting(); + + // Target the iPhone 4 device submodel (640003). + Technology mobileDeviceSubmodelTechnology = new Technology(); + mobileDeviceSubmodelTechnology.id = 640003L; + mobileDeviceSubmodelTargeting.targetedMobileDeviceSubmodels = + new Technology[] { mobileDeviceSubmodelTechnology }; + technologyTargeting.mobileDeviceSubmodelTargeting = mobileDeviceSubmodelTargeting; + + // Create targeting. + Targeting targeting = new Targeting(); + targeting.inventoryTargeting = inventoryTargeting; + targeting.technologyTargeting = technologyTargeting; + + // Create local line item object. + LineItem lineItem = new LineItem(); + lineItem.name = "Mobile line item"; + lineItem.orderId = orderId; + lineItem.targeting = targeting; + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the target platform to mobile. + lineItem.targetPlatform = TargetPlatform.MOBILE; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + creativePlaceholder.size = size; + + // Set the size of creatives that can be associated with this line item. + lineItem.creativePlaceholders = new CreativePlaceholder[] { creativePlaceholder }; + + // Set the length of the line item to run. + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromString("20120901 00:00:00"); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + Money money = new Money(); + money.currencyCode = "USD"; + money.microAmount = 2000000L; + lineItem.costPerUnit = money; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + try { + // Create the line item on the server. + LineItem[] createdLineItems = lineItemService.createLineItems(new LineItem[] { lineItem }); + + foreach (LineItem createdLineItem in createdLineItems) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and " + + "named \"{2}\" was created.", createdLineItem.id, createdLineItem.orderId, + createdLineItem.name); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/LineItemService/CreateVideoLineItem.cs b/examples/Dfp/CSharp/v201403/LineItemService/CreateVideoLineItem.cs new file mode 100644 index 00000000000..0a9762cbb08 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/LineItemService/CreateVideoLineItem.cs @@ -0,0 +1,186 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates a new line item to serve to video content. To + /// determine which line items exist, run GetAllLineItems.cs. To determine + /// which orders exist, run GetAllOrders.cs. To create a video ad unit, run + /// CreateVideoAdUnit.cs. To create criteria for categories, run + /// CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: LineItemService.createLineItems + /// + class CreateVideoLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new line item to serve to video content. To determine" + + " which line items exist, run GetAllLineItems.cs. To determine which orders exist, " + + "run GetAllOrders.cs. To create a video ad unit, run CreateVideoAdUnit.cs. To " + + "create criteria for categories, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateVideoLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201403.LineItemService); + + // Set the order that all created line items will belong to and the + // video ad unit ID to target. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + string targetedVideoAdUnitId = _T("INSERT_TARGETED_VIDEO_AD_UNIT_ID_HERE"); + + // Set the custom targeting key ID and value ID representing the metadata + // on the content to target. This would typically be a key representing + // a "genre" and a value representing something like "comedy". + long contentCustomTargetingKeyId = + long.Parse(_T("INSERT_CONTENT_CUSTOM_TARGETING_KEY_ID_HERE")); + long contentCustomTargetingValueId = + long.Parse(_T("INSERT_CONTENT_CUSTOM_TARGETING_VALUE_ID_HERE")); + + // Create custom criteria for the content metadata targeting. + CustomCriteria contentCustomCriteria = new CustomCriteria(); + contentCustomCriteria.keyId = contentCustomTargetingKeyId; + contentCustomCriteria.valueIds = new long[] {contentCustomTargetingValueId}; + contentCustomCriteria.@operator = CustomCriteriaComparisonOperator.IS; + + // Create custom criteria set. + CustomCriteriaSet customCriteriaSet = new CustomCriteriaSet(); + customCriteriaSet.children = new CustomCriteriaNode[] {contentCustomCriteria}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + AdUnitTargeting adUnitTargeting = new AdUnitTargeting(); + adUnitTargeting.adUnitId = targetedVideoAdUnitId; + adUnitTargeting.includeDescendants = true; + inventoryTargeting.targetedAdUnits = new AdUnitTargeting[] {adUnitTargeting}; + + // Create video position targeting. + VideoPosition videoPosition = new VideoPosition(); + videoPosition.positionType = VideoPositionType.PREROLL; + VideoPositionTarget videoPositionTarget = new VideoPositionTarget(); + videoPositionTarget.videoPosition = videoPosition; + VideoPositionTargeting videoPositionTargeting = new VideoPositionTargeting(); + videoPositionTargeting.targetedPositions = new VideoPositionTarget[] {videoPositionTarget}; + + // Create targeting. + Targeting targeting = new Targeting(); + targeting.customTargeting = customCriteriaSet; + targeting.inventoryTargeting = inventoryTargeting; + targeting.videoPositionTargeting = videoPositionTargeting; + + // Create local line item object. + LineItem lineItem = new LineItem(); + lineItem.name = "Video line item - " + this.GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = targeting; + lineItem.lineItemType = LineItemType.SPONSORSHIP; + lineItem.allowOverbook = true; + + // Set the environment type to video. + lineItem.environmentType = EnvironmentType.VIDEO_PLAYER; + + // Set the creative rotation type to optimized. + lineItem.creativeRotationType = CreativeRotationType.OPTIMIZED; + + // Create the master creative placeholder. + CreativePlaceholder creativeMasterPlaceholder = new CreativePlaceholder(); + Size size1 = new Size(); + size1.width = 400; + size1.height = 300; + size1.isAspectRatio = false; + creativeMasterPlaceholder.size = size1; + + // Create companion creative placeholders. + CreativePlaceholder companionCreativePlaceholder1 = new CreativePlaceholder(); + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + size2.isAspectRatio = false; + companionCreativePlaceholder1.size = size2; + + CreativePlaceholder companionCreativePlaceholder2 = new CreativePlaceholder(); + Size size3 = new Size(); + size3.width = 728; + size3.height = 90; + size3.isAspectRatio = false; + companionCreativePlaceholder2.size = size3; + + // Set companion creative placeholders. + creativeMasterPlaceholder.companions = new CreativePlaceholder[] { + companionCreativePlaceholder1, companionCreativePlaceholder2}; + + // Set the size of creatives that can be associated with this line item. + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativeMasterPlaceholder}; + + // Set delivery of video companions to optional. + lineItem.companionDeliveryOption = CompanionDeliveryOption.OPTIONAL; + + // Set the length of the line item to run. + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromString("20120901 00:00:00"); + + // Set the cost per day to $1. + lineItem.costType = CostType.CPD; + Money money = new Money(); + money.currencyCode = "USD"; + money.microAmount = 1000000L; + lineItem.costPerUnit = money; + + // Set the percentage to be 100%. + lineItem.unitsBought = 100; + + try { + // Create the line item on the server. + LineItem[] createdLineItems = lineItemService.createLineItems(new LineItem[] {lineItem}); + + foreach (LineItem createdLineItem in createdLineItems) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and " + + "named \"{2}\" was created.", createdLineItem.id, createdLineItem.orderId, + createdLineItem.name); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/LineItemService/GetAllLineItems.cs b/examples/Dfp/CSharp/v201403/LineItemService/GetAllLineItems.cs new file mode 100644 index 00000000000..e6ae3faec74 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/LineItemService/GetAllLineItems.cs @@ -0,0 +1,92 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all line items. To create line items, run + /// CreateLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// + class GetAllLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items. To create line items, run " + + "CreateLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201403.LineItemService); + + // Create a Statement to get all line items. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Sets default for page. + LineItemPage page = new LineItemPage(); + try { + do { + // Get line items by Statement. + page = lineItemService.getLineItemsByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemSummary lineItem in page.results) { + Console.WriteLine("{0}) Line item with ID = '{1}', belonging to order ID ='{2}'" + + " , and named '{3}' was found.", i, lineItem.id, lineItem.orderId, + lineItem.name); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/LineItemService/GetLineItemsByStatement.cs b/examples/Dfp/CSharp/v201403/LineItemService/GetLineItemsByStatement.cs new file mode 100644 index 00000000000..07a58c8fc5d --- /dev/null +++ b/examples/Dfp/CSharp/v201403/LineItemService/GetLineItemsByStatement.cs @@ -0,0 +1,97 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all line items for the given order. To create line items, + /// run CreateLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// + class GetLineItemsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items for the given order. To create line items, " + + "run CreateLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLineItemsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201403.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create a statement to only select line items that need creatives from a + // given order. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("orderId = :orderId AND status = :status") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("orderId", orderId) + .AddValue("status", ComputedStatus.NEEDS_CREATIVES.ToString()); + + // Set default for page. + LineItemPage page = new LineItemPage(); + + try { + do { + // Get line items by Statement. + page = lineItemService.getLineItemsByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItem lineItem in page.results) { + Console.WriteLine("{0}) Line item with ID ='{1}', belonging to order ID = '{2}' " + + "and named '{3}' was found.", i, lineItem.id, lineItem.orderId, lineItem.name); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get line item by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/LineItemService/GetRecentlyUpdatedLineItems.cs b/examples/Dfp/CSharp/v201403/LineItemService/GetRecentlyUpdatedLineItems.cs new file mode 100644 index 00000000000..321f3e56810 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/LineItemService/GetRecentlyUpdatedLineItems.cs @@ -0,0 +1,98 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; +using Google.Api.Ads.Dfp.Util.v201403; + +using System; + +using DateTime = Google.Api.Ads.Dfp.v201403.DateTime; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example shows how to get recently updated line items. To create + /// line items, run CreateLineItems.cs. + /// + /// Tags: LineItemService.GetRecentlyUpdatedLineItems + /// + class GetRecentlyUpdatedLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to get recently updated line items. To create " + + "line items, run CreateLineItems.cs"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetRecentlyUpdatedLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201403.LineItemService); + + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create statement to only select line items for the given order that + // have been modified in the last 3 days. + DateTime threeDaysAgo = DateTimeUtilities.FromDateTime(System.DateTime.Now.AddDays(-3)); + StatementBuilder statementBuilder = new StatementBuilder() + .Where("lastModifiedDateTime >= :lastModifiedDateTime AND orderId = :orderId") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("lastModifiedDateTime", threeDaysAgo) + .AddValue("orderId", orderId); + + // Set default for page. + LineItemPage page = new LineItemPage(); + + try { + do { + // Get line items by statement. + page = lineItemService.getLineItemsByStatement(statementBuilder.ToStatement()); + + // Display results. + if (page != null && page.results != null) { + foreach (LineItem lineItem in page.results) { + Console.WriteLine("Line item with id \"{0}\", belonging to order id \"{1}\" and " + + "named \"{2}\" was found.", lineItem.id, lineItem.orderId, lineItem.name); + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while(statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {1}.", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/LineItemService/TargetCustomCriteria.cs b/examples/Dfp/CSharp/v201403/LineItemService/TargetCustomCriteria.cs new file mode 100644 index 00000000000..5e1f8cb3056 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/LineItemService/TargetCustomCriteria.cs @@ -0,0 +1,173 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + + /// + /// This code example updates a line item to add custom criteria targeting. To + /// determine which line items exist, run GetAllLineItems.cs. To determine + /// which custom targeting keys and values exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement, LineItemService.updateLineItems + /// + class TargetCustomCriteria : SampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a line item to add custom criteria targeting. To " + + "determine which line items exist, run GetAllLineItems.cs. To determine which custom " + + "targeting keys and values exist, run GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new TargetCustomCriteria(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201403.LineItemService); + + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long[] customCriteriaIds1 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + long[] customCriteriaIds2 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + long[] customCriteriaIds3 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + + // Create custom criteria. + CustomCriteria customCriteria1 = new CustomCriteria(); + customCriteria1.keyId = customCriteriaIds1[0]; + customCriteria1.valueIds = new long[] {customCriteriaIds1[1]}; + customCriteria1.@operator = CustomCriteriaComparisonOperator.IS; + + CustomCriteria customCriteria2 = new CustomCriteria(); + customCriteria2.keyId = customCriteriaIds2[0]; + customCriteria2.valueIds = new long[] {customCriteriaIds2[1]}; + customCriteria2.@operator = CustomCriteriaComparisonOperator.IS_NOT; + + CustomCriteria customCriteria3 = new CustomCriteria(); + customCriteria3.keyId = customCriteriaIds3[0]; + customCriteria3.valueIds = new long[] {customCriteriaIds3[1]}; + customCriteria3.@operator = CustomCriteriaComparisonOperator.IS; + + // Create the custom criteria set that will resemble: + // + // (customCriteria1.key == customCriteria1.value OR + // (customCriteria2.key != customCriteria2.value AND + // customCriteria3.key == customCriteria3.value)) + CustomCriteriaSet topCustomCriteriaSet = new CustomCriteriaSet(); + topCustomCriteriaSet.logicalOperator = CustomCriteriaSetLogicalOperator.OR; + + CustomCriteriaSet subCustomCriteriaSet = new CustomCriteriaSet(); + subCustomCriteriaSet.logicalOperator = CustomCriteriaSetLogicalOperator.AND; + subCustomCriteriaSet.children = + new CustomCriteriaNode[] {customCriteria2, customCriteria3}; + topCustomCriteriaSet.children = + new CustomCriteriaNode[] {customCriteria1, subCustomCriteriaSet}; + + try { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", lineItemId); + // Set the custom criteria targeting on the line item. + LineItemPage page = lineItemService.getLineItemsByStatement(statementBuilder.ToStatement()); + LineItem lineItem = page.results[0]; + lineItem.targeting.customTargeting = topCustomCriteriaSet; + + // Update the line items on the server. + LineItem[] updatedLineItems = lineItemService.updateLineItems(new LineItem[] { lineItem }); + + foreach (LineItem updatedLineItem in updatedLineItems) { + // Display the updated line item. + Console.WriteLine("Line item with ID {0} updated with custom criteria targeting \n{1}\n", + updatedLineItem.id, + getCustomCriteriaSetString(updatedLineItem.targeting.customTargeting, 0)); + } + } catch (Exception ex) { + Console.WriteLine("Failed to add custom target criteria. Exception says \"{0}\"", + ex.Message); + } + } + + /// + /// Gets a string representation of the custom criteria node. If it has + /// children, each child will be appended to the string recursively. + /// + /// The root custom criteria node. + /// The level of the custom criteria tree. + /// + /// A string representation of the custom criteria node and its + /// children + /// + private static string getCustomCriteriaSetString(CustomCriteriaNode root, int level) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < level; i++) { + sb.Append("\t"); + } + + if (root is CustomCriteria) { + CustomCriteria customCriteria = (CustomCriteria) root; + StringBuilder ids = new StringBuilder(); + for (int j = 0; j < customCriteria.valueIds.Length; j++) { + ids.Append(customCriteria.valueIds[j] + ", "); + } + + sb.AppendFormat("Custom criteria: operator: [{0}] key: [{1}] values: [{2}]\n", + customCriteria.@operator, customCriteria.keyId, ids.ToString().TrimEnd(',', ' ')); + return sb.ToString(); + } else if (root is CustomCriteriaSet) { + CustomCriteriaSet customCriteriaSet = (CustomCriteriaSet) root; + sb.AppendFormat("Custom criteria set: operator: [{0}] children: \n", + customCriteriaSet.logicalOperator); + foreach (CustomCriteriaNode node in customCriteriaSet.children) { + sb.Append(getCustomCriteriaSetString(node, level + 1)); + } + return sb.Append("\n").ToString(); + } else { + throw new Exception("Unexpected node: " + root.CustomCriteriaNodeType); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/LineItemService/UpdateLineItems.cs b/examples/Dfp/CSharp/v201403/LineItemService/UpdateLineItems.cs new file mode 100644 index 00000000000..378b287c35f --- /dev/null +++ b/examples/Dfp/CSharp/v201403/LineItemService/UpdateLineItems.cs @@ -0,0 +1,100 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example updates the delivery rate of a line items. + /// To determine which line items exist, run GetAllLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.updateLineItems + /// + class UpdateLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the delivery rate of a line item. To determine which " + + "line items exist, run GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201403.LineItemService); + + // Set the ID of the line item. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + // Create a Statement to get the line item. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :lineItemid") + .OrderBy("id ASC") + .Limit(1) + .AddValue("lineItemId", lineItemId); + + try { + // Get line items by Statement. + LineItemPage page = lineItemService.getLineItemsByStatement(statementBuilder.ToStatement()); + + LineItem lineItem = page.results[0]; + + // Update line item object by changing its delivery rate. + lineItem.deliveryRateType = DeliveryRateType.AS_FAST_AS_POSSIBLE; + + // Update the line item on the server. + LineItem[] lineItems = lineItemService.updateLineItems(new LineItem[] {lineItem}); + + if (lineItems != null) { + foreach (LineItem updatedLineItem in lineItems) { + Console.WriteLine("A line item with ID = '{0}', belonging to order ID = '{1}', " + + "named '{2}', and having delivery rate = '{3}' was updated.", + updatedLineItem.id, updatedLineItem.orderId, updatedLineItem.name, + updatedLineItem.deliveryRateType); + } + } else { + Console.WriteLine("No line items updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/NetworkService/GetAllNetworks.cs b/examples/Dfp/CSharp/v201403/NetworkService/GetAllNetworks.cs new file mode 100644 index 00000000000..be6d97eda6d --- /dev/null +++ b/examples/Dfp/CSharp/v201403/NetworkService/GetAllNetworks.cs @@ -0,0 +1,81 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all networks that you have access to with the + /// current login credentials. A networkCode should be left out for this + /// request. + /// + /// Tags: NetworkService.getAllNetworks + /// + class GetAllNetworks : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all networks that you have access to with the current " + + "login credentials. A networkCode should be left out for this request."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllNetworks(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201403.NetworkService); + // Set the networkCode field to null to retrieve all networks you have + // access to. + networkService.RequestHeader.networkCode = null; + + try { + // Get all networks that you have access to with the current login + // credentials. + Network[] networks = networkService.getAllNetworks(); + + int i = 0; + foreach (Network network in networks) { + Console.WriteLine("{0} ) Network with network code \"{1}\" and display name \"{2}\" " + + "was found.", i + 1, network.networkCode, network.displayName); + i++; + } + Console.WriteLine("Number of networks found: {0}", i); + } catch (Exception ex) { + Console.WriteLine("Failed to get all networks. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/NetworkService/GetCurrentNetwork.cs b/examples/Dfp/CSharp/v201403/NetworkService/GetCurrentNetwork.cs new file mode 100644 index 00000000000..4f53fbfba9c --- /dev/null +++ b/examples/Dfp/CSharp/v201403/NetworkService/GetCurrentNetwork.cs @@ -0,0 +1,70 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets the current network that you can make requests + /// against. + /// + /// Tags: NetworkService.getCurrentNetwork + /// + class GetCurrentNetwork : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the current network that you can make requests against."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCurrentNetwork(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201403.NetworkService); + + try { + // Get the current network. + Network network = networkService.getCurrentNetwork(); + + Console.WriteLine("Current network has network code \"{0}\" and display name \"{1}\".", + network.networkCode, network.displayName); + } catch (Exception ex) { + Console.WriteLine("Failed to get current network. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/NetworkService/MakeTestNetwork.cs b/examples/Dfp/CSharp/v201403/NetworkService/MakeTestNetwork.cs new file mode 100644 index 00000000000..3a3191c3e8c --- /dev/null +++ b/examples/Dfp/CSharp/v201403/NetworkService/MakeTestNetwork.cs @@ -0,0 +1,85 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates a test network. You do not need to have a DFP + /// account to run this example, but you do need to have a new Google account + /// (created at http://www.google.com/accounts/newaccount) that is not + /// associated with any other DFP networks (including old sandbox networks). + /// Once this network is created, you can supply the network code in your + /// settings to make calls to other services. + /// + /// Please see the following URL for more information: + /// https://developers.google.com/doubleclick-publishers/docs/signup + /// + /// Tags: NetworkService.makeTestNetwork + /// + class MakeTestNetwork : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a test network. You do not need to have a DFP" + + " account to run this example, but you do need to have a new Google account" + + " (created at http://www.google.com/accounts/newaccount) that is not associated " + + "with any other DFP networks (including old sandbox networks). Once this network " + + "is created, you can supply the network code in your settings to make calls to " + + "other services.\n\n Please see the following URL for more information:" + + " https://developers.google.com/doubleclick-publishers/docs/signup"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new MakeTestNetwork(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201403.NetworkService); + // Set the networkCode field to null. + networkService.RequestHeader.networkCode = null; + + try { + Network network = networkService.makeTestNetwork(); + + Console.WriteLine("Test network with network code \"{0}\" and display name \"{1}\" " + + "created.\nYou may now sign in at http://www.google.com/dfp/main?networkCode={0}", + network.networkCode, network.displayName); + } catch (Exception ex) { + Console.WriteLine("Failed to make test network. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/OrderService/ApproveOrder.cs b/examples/Dfp/CSharp/v201403/OrderService/ApproveOrder.cs new file mode 100644 index 00000000000..13443f0860f --- /dev/null +++ b/examples/Dfp/CSharp/v201403/OrderService/ApproveOrder.cs @@ -0,0 +1,119 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example approves an order and all line items belonging to that order. To determine + /// which orders exist, run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement, OrderService.performOrderAction + /// + class ApproveOrder : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example approves an order and all line items belonging to that order. " + + "To determine which orders exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ApproveOrder(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = + (OrderService) user.GetService(DfpService.v201403.OrderService); + + // Set the ID of the order. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create Statement to select the order. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", orderId); + + // Set default for page. + OrderPage page = new OrderPage(); + List orderIds = new List(); + int i = 0; + + try { + do { + // Get orders by Statement. + page = orderService.getOrdersByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and status ='{3}' " + + "will be approved.", i, order.id, order.name, order.status); + orderIds.Add(order.id.ToString()); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of orders to be approved: {0}", orderIds.Count); + + if (orderIds.Count > 0) { + // Modify statement for action. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + ApproveAndOverbookOrders action = new ApproveAndOverbookOrders(); + + // Perform action. + UpdateResult result = orderService.performOrderAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of orders approved: {0}", result.numChanges); + } else { + Console.WriteLine("No orders were approved."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to approve orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/OrderService/CreateOrders.cs b/examples/Dfp/CSharp/v201403/OrderService/CreateOrders.cs new file mode 100644 index 00000000000..31e6e772759 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/OrderService/CreateOrders.cs @@ -0,0 +1,96 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates new orders. To determine which orders exist, + /// run GetAllOrders.cs. + /// + /// Tags: OrderService.createOrders + /// + class CreateOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new orders. To determine which orders exist, " + + "run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = + (OrderService) user.GetService(DfpService.v201403.OrderService); + + // Set the advertiser, salesperson, and trafficker to assign to each + // order. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + long salespersonId = long.Parse(_T("INSERT_SALESPERSON_ID_HERE")); + long traffickerId = long.Parse(_T("INSERT_TRAFFICKER_ID_HERE")); + + // Create an array to store local order objects. + Order[] orders = new Order[5]; + + for (int i = 0; i < 5; i++) { + Order order = new Order(); + order.name = string.Format("Order #{0}", i); + order.advertiserId = advertiserId; + order.salespersonId = salespersonId; + order.traffickerId = traffickerId; + + orders[i] = order; + } + + try { + // Create the orders on the server. + orders = orderService.createOrders(orders); + + if (orders != null) { + foreach (Order order in orders) { + Console.WriteLine("An order with ID ='{0}' and named '{1}' was created.", + order.id, order.name); + } + } else { + Console.WriteLine("No orders created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/OrderService/GetAllOrders.cs b/examples/Dfp/CSharp/v201403/OrderService/GetAllOrders.cs new file mode 100644 index 00000000000..f8db571046a --- /dev/null +++ b/examples/Dfp/CSharp/v201403/OrderService/GetAllOrders.cs @@ -0,0 +1,89 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all orders. To create orders, run CreateOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement + /// + class GetAllOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets all orders. To create orders, run CreateOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201403.OrderService); + + // Create a Statement to get all orders. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + OrderPage page = new OrderPage(); + + try { + do { + // Get orders by Statement. + page = orderService.getOrdersByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and advertiser " + + "ID = '{3}' was found.", i, order.id, order.name, order.advertiserId); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/OrderService/GetOrdersByStatement.cs b/examples/Dfp/CSharp/v201403/OrderService/GetOrdersByStatement.cs new file mode 100644 index 00000000000..4b73fb2969c --- /dev/null +++ b/examples/Dfp/CSharp/v201403/OrderService/GetOrdersByStatement.cs @@ -0,0 +1,96 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all orders for a given advertiser. To create orders, run + /// CreateOrders.cs. To determine which companies are advertisers, + /// run GetCompaniesByStatement.cs. + /// + /// Tags: OrderService.getOrdersByStatement + /// + class GetOrdersByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all orders for a given advertiser. To create orders, run " + + "CreateOrders.cs. To determine which companies are advertisers,run " + + "GetCompaniesByStatement.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetOrdersByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201403.OrderService); + + // Set the name of the advertiser (company) to get orders for. + String advertiserId = _T("INSERT_ADVERTISER_COMPANY_ID_HERE"); + + // Create a Statement to only select orders for a given advertiser. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("advertiserId = :advertiserId") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("advertiserId", advertiserId); + + // Set default for page. + OrderPage page = new OrderPage(); + + try { + do { + // Get orders by Statement. + page = orderService.getOrdersByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and advertiser " + + "ID = '{3}' was found.", i, order.id, order.name, order.advertiserId); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while(statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get orders by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/OrderService/UpdateOrders.cs b/examples/Dfp/CSharp/v201403/OrderService/UpdateOrders.cs new file mode 100644 index 00000000000..8a8946659de --- /dev/null +++ b/examples/Dfp/CSharp/v201403/OrderService/UpdateOrders.cs @@ -0,0 +1,96 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example updates the note of an order. To determine which orders exist, + /// run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement, OrderService.updateOrders + /// + class UpdateOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the note of an order. To determine which orders " + + "exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201403.OrderService); + + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create a Statement to get the order. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", orderId); + + try { + // Get orders by Statement. + OrderPage page = orderService.getOrdersByStatement(statementBuilder.ToStatement()); + + Order order = page.results[0]; + + // Update the order object by changing its note. + order.notes = "Spoke to advertiser. All is well."; + + // Update the orders on the server. + Order[] orders = orderService.updateOrders(new Order[] {order}); + + if (orders != null) { + foreach (Order updatedOrder in orders) { + Console.WriteLine("Order with ID = '{0}', name = '{1}', advertiser ID = '{2}', " + + "and notes = '{3}' was updated.", updatedOrder.id, updatedOrder.name, + updatedOrder.advertiserId, updatedOrder.notes); + } + } else { + Console.WriteLine("No orders updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/PlacementService/CreatePlacements.cs b/examples/Dfp/CSharp/v201403/PlacementService/CreatePlacements.cs new file mode 100644 index 00000000000..bbb169e0bd9 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/PlacementService/CreatePlacements.cs @@ -0,0 +1,164 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates new placements for various ad unit sizes. To + /// determine which placements exist, run GetAllPlacements.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: PlacementService.createPlacements + /// + class CreatePlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new placements for various ad unit sizes. To determine " + + "which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreatePlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201403.InventoryService); + + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201403.PlacementService); + + // Create local placement object to store skyscraper ad units. + Placement skyscraperAdUnitPlacement = new Placement(); + skyscraperAdUnitPlacement.name = string.Format("Skyscraper AdUnit Placement #{0}", + this.GetTimeStamp()); + skyscraperAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 120x600"; + + // Create local placement object to store medium square ad units. + Placement mediumSquareAdUnitPlacement = new Placement(); + mediumSquareAdUnitPlacement.name = string.Format("Medium Square AdUnit Placement #{0}", + this.GetTimeStamp()); + mediumSquareAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 300x250"; + + // Create local placement object to store banner ad units. + Placement bannerAdUnitPlacement = new Placement(); + bannerAdUnitPlacement.name = string.Format("Banner AdUnit Placement #{0}", + this.GetTimeStamp()); + bannerAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 468x60"; + + List placementList = new List(); + + // Get the first 500 ad units. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + List mediumSquareTargetedUnitIds = new List(); + List skyscraperTargetedUnitIds = new List(); + List bannerTargetedUnitIds = new List(); + + try { + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + // Separate the ad units by size. + if (page.results != null) { + foreach (AdUnit adUnit in page.results) { + if (adUnit.parentId != null && adUnit.adUnitSizes != null) { + foreach (AdUnitSize adUnitSize in adUnit.adUnitSizes) { + Size size = adUnitSize.size; + if (size.width == 300 && size.height == 250) { + if (!mediumSquareTargetedUnitIds.Contains(adUnit.id)) { + mediumSquareTargetedUnitIds.Add(adUnit.id); + } + } else if (size.width == 120 && size.height == 600) { + if (!skyscraperTargetedUnitIds.Contains(adUnit.id)) { + skyscraperTargetedUnitIds.Add(adUnit.id); + } + } else if (size.width == 468 && size.height == 60) { + if (!bannerTargetedUnitIds.Contains(adUnit.id)) { + bannerTargetedUnitIds.Add(adUnit.id); + } + } + } + } + } + } + mediumSquareAdUnitPlacement.targetedAdUnitIds = mediumSquareTargetedUnitIds.ToArray(); + skyscraperAdUnitPlacement.targetedAdUnitIds = skyscraperTargetedUnitIds.ToArray(); + bannerAdUnitPlacement.targetedAdUnitIds = bannerTargetedUnitIds.ToArray(); + + + // Only create placements with one or more ad unit. + if (mediumSquareAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(mediumSquareAdUnitPlacement); + } + + if (skyscraperAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(skyscraperAdUnitPlacement); + } + + if (bannerAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(bannerAdUnitPlacement); + } + + Placement[] placements = + placementService.createPlacements(placementList.ToArray()); + + // Display results. + if (placements != null) { + foreach (Placement placement in placements) { + Console.Write("A placement with ID = '{0}', name ='{1}', and containing " + + "ad units {{", placement.id, placement.name); + + foreach (string adUnitId in placement.targetedAdUnitIds) { + Console.Write("{0}, ", adUnitId); + } + Console.WriteLine("} was created."); + } + } else { + Console.WriteLine("No placements created."); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to create placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/PlacementService/DeactivatePlacement.cs b/examples/Dfp/CSharp/v201403/PlacementService/DeactivatePlacement.cs new file mode 100644 index 00000000000..c4f0b79b782 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/PlacementService/DeactivatePlacement.cs @@ -0,0 +1,117 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example deactivates a placement. To determine which + /// placements exist, run GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// Tags: PlacementService.performPlacementAction + /// + class DeactivatePlacement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates a placement. To determine which " + + "placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivatePlacement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201403.PlacementService); + + // Create Statement to select active placements. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("status = :status") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("status", InventoryStatus.ACTIVE.ToString()); + + // Sets default for page. + PlacementPage page = new PlacementPage(); + List placementIds = new List(); + + try { + do { + // Get placements by Statement. + page = placementService.getPlacementsByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID ='{1}', name ='{2}', and status ='{3}'" + + " will be deactivated.", i, placement.id, placement.name, placement.status); + placementIds.Add(placement.id.ToString()); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of placements to be deactivated: {0}", placementIds.Count); + + if (placementIds.Count > 0) { + // Modify statement for action. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + DeactivatePlacements action = new DeactivatePlacements(); + + // Perform action. + UpdateResult result = placementService.performPlacementAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of placements deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No placements were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/PlacementService/GetAllPlacements.cs b/examples/Dfp/CSharp/v201403/PlacementService/GetAllPlacements.cs new file mode 100644 index 00000000000..83b49368c64 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/PlacementService/GetAllPlacements.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all placements. To create placements, run + /// CreatePlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// + class GetAllPlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all placements. To create placements, run " + + "CreatePlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllPlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201403.PlacementService); + + // Sets defaults for page and Statement. + PlacementPage page = new PlacementPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all ad units. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get ad units by Statement. + page = placementService.getPlacementsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID = '{1}' and name = '{2}' was found.", + i, placement.id, placement.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}" + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/PlacementService/GetPlacementsByStatement.cs b/examples/Dfp/CSharp/v201403/PlacementService/GetPlacementsByStatement.cs new file mode 100644 index 00000000000..a47cb80e2e2 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/PlacementService/GetPlacementsByStatement.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all active placements by using a Statement. To + /// create a placement, run CreatePlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// + class GetPlacementsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active placements by using a Statement. To create a " + + "placement, run CreatePlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPlacementsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201403.PlacementService); + + // Create a Statement to only select active placements. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("status = :status") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("status", InventoryStatus.ACTIVE.ToString()); + + // Set default for page + PlacementPage page = new PlacementPage(); + + try { + do { + // Get placements by Statement. + page = placementService.getPlacementsByStatement(statementBuilder.ToStatement()); + + // Display results. + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID = '{1}', name ='{2}', and status = '{3}' " + + "was found.", i, placement.id, placement.name, placement.status); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get placement by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/PlacementService/UpdatePlacements.cs b/examples/Dfp/CSharp/v201403/PlacementService/UpdatePlacements.cs new file mode 100644 index 00000000000..7fb470ab741 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/PlacementService/UpdatePlacements.cs @@ -0,0 +1,101 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example updates all placements to allow for AdSense targeting + /// up to the first 500. To determine which placements exist, run + /// GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// Tags: PlacementService.updatePlacements + /// + class UpdatePlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates all placements to allow for AdSense targeting up to " + + "the first 500. To determine which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdatePlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201403.PlacementService); + + // Create a statement to select first 500 placements. + Statement filterStatement = new Statement(); + filterStatement.query = "LIMIT 500"; + + try { + // Get placements by statement. + PlacementPage page = placementService.getPlacementsByStatement(filterStatement); + + if (page.results != null) { + Placement[] placements = page.results; + + // Update each local placement object by enabling AdSense targeting. + foreach (Placement placement in placements) { + placement.targetingDescription = (string.IsNullOrEmpty(placement.description))? + "Generic description" : placement.description; + placement.targetingAdLocation = "All images on sports pages."; + placement.targetingSiteName = "http://code.google.com"; + placement.isAdSenseTargetingEnabled = true; + } + + // Update the placements on the server. + placements = placementService.updatePlacements(placements); + + // Display results. + if (placements != null) { + foreach (Placement placement in placements) { + Console.WriteLine("A placement with ID \"{0}\", name \"{1}\", and AdSense targeting" + + " enabled \"{2}\" was updated.", placement.id, placement.name, + placement.isAdSenseTargetingEnabled); + } + } else { + Console.WriteLine("No placements updated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to update placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/PublisherQueryLanguageService/FetchMatchTables.cs b/examples/Dfp/CSharp/v201403/PublisherQueryLanguageService/FetchMatchTables.cs new file mode 100644 index 00000000000..8e3c2eefa17 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/PublisherQueryLanguageService/FetchMatchTables.cs @@ -0,0 +1,119 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example fetches and creates match table files from the + /// Line_Item and Ad_Unit tables. This example may take a while to run. + /// + /// Tags: PublisherQueryLanguageService.select + /// + class FetchMatchTables : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example fetches and creates match table files from the Line_Item " + + "and Ad_Unit tables. This example may take a while to run."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new FetchMatchTables(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PublisherQueryLanguageService. + PublisherQueryLanguageService pqlService = + (PublisherQueryLanguageService) user.GetService( + DfpService.v201403.PublisherQueryLanguageService); + + try { + StatementBuilder lineItemStatementBuilder = new StatementBuilder() + .Select("Id, Name, Status") + .From("Line_Item") + .OrderBy("Id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + string lineItemFilePath = "Line-Item-Matchtable.csv"; + fetchMatchTables(pqlService, lineItemStatementBuilder, lineItemFilePath); + + StatementBuilder adUnitStatementBuilder = new StatementBuilder() + .Select("Id, Name") + .From("Ad_Unit") + .OrderBy("Id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + string adUnitFilePath = "Ad-Unit-Matchtable.csv"; + fetchMatchTables(pqlService, adUnitStatementBuilder, adUnitFilePath); + + Console.WriteLine("Ad units saved to %s", adUnitFilePath); + Console.WriteLine("Line items saved to %s\n", lineItemFilePath); + } catch (Exception ex) { + Console.WriteLine("Failed to get match tables. Exception says \"{0}\"", ex.Message); + } + } + + /// + /// Fetches a match table from a PQL statement and writes it to a file. + /// + /// The PQL service. + /// The select statement. + /// Name of the file. + private static void fetchMatchTables(PublisherQueryLanguageService pqlService, + StatementBuilder statementBuilder, string fileName) { + + int resultSetSize = 0; + List allRows = new List(); + ResultSet resultSet; + + do { + resultSet = pqlService.select(statementBuilder.ToStatement()); + allRows.AddRange(resultSet.rows); + Console.WriteLine(PqlUtilities.ResultSetToString(resultSet)); + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + resultSetSize = resultSet.rows == null ? 0 : resultSet.rows.Length; + } while (resultSetSize > 0); + + resultSet.rows = allRows.ToArray(); + List rows = PqlUtilities.ResultSetToStringArrayList(resultSet); + + // Write the contents to a csv file. + CsvFile file = new CsvFile(); + file.Headers.AddRange(rows[0]); + file.Records.AddRange(rows.GetRange(1, rows.Count - 1).ToArray()); + file.Write(fileName); + } + } +} diff --git a/examples/Dfp/CSharp/v201403/PublisherQueryLanguageService/GetAllLineItemsUsingPql.cs b/examples/Dfp/CSharp/v201403/PublisherQueryLanguageService/GetAllLineItemsUsingPql.cs new file mode 100644 index 00000000000..5506c6fd0ec --- /dev/null +++ b/examples/Dfp/CSharp/v201403/PublisherQueryLanguageService/GetAllLineItemsUsingPql.cs @@ -0,0 +1,109 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all line items in your network using the Line_Item + /// table. This code example may take a while to run. The Line_Item PQL table + /// schema can be found here: + /// https://developers.google.com/doubleclick-publishers/docs/reference/v201403/PublisherQueryLanguageService#Line_Item + /// + /// Tags: PublisherQueryLanguageService.select + /// + class GetAllLineItemsUsingPql : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items in your network using the Line_Item table. " + + "This code example may take a while to run. The Line_Item PQL table schema can be " + + "found here: https://developers.google.com/doubleclick-publishers/docs/reference/v201403/PublisherQueryLanguageService#Line_Item"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLineItemsUsingPql(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PublisherQueryLanguageService. + PublisherQueryLanguageService pqlService = + (PublisherQueryLanguageService) user.GetService( + DfpService.v201403.PublisherQueryLanguageService); + + // Create statement to select all line items. + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Id, Name, Status") + .From("Line_Item") + .OrderBy ("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + int resultSetSize = 0; + List allRows = new List(); + ResultSet resultSet; + + try { + do { + // Get all line items. + resultSet = pqlService.select(statementBuilder.ToStatement()); + + // Collect all line items from each page. + allRows.AddRange(resultSet.rows); + + // Display results. + Console.WriteLine(PqlUtilities.ResultSetToString(resultSet)); + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + resultSetSize = resultSet.rows == null ? 0 : resultSet.rows.Length; + } while (resultSetSize > 0); + + Console.WriteLine("Number of results found: " + allRows.Count); + + // Optionally, save all rows to a CSV. + // Get a string array representation of the data rows. + resultSet.rows = allRows.ToArray(); + List rows = PqlUtilities.ResultSetToStringArrayList(resultSet); + + // Write the contents to a csv file. + CsvFile file = new CsvFile(); + file.Headers.AddRange(rows[0]); + file.Records.AddRange(rows.GetRange(1, rows.Count - 1).ToArray()); + file.Write("line_items_" + this.GetTimeStamp() + ".csv"); + } catch (Exception ex) { + Console.WriteLine("Failed to get all line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/PublisherQueryLanguageService/GetGeoTargets.cs b/examples/Dfp/CSharp/v201403/PublisherQueryLanguageService/GetGeoTargets.cs new file mode 100644 index 00000000000..994fdd0beea --- /dev/null +++ b/examples/Dfp/CSharp/v201403/PublisherQueryLanguageService/GetGeoTargets.cs @@ -0,0 +1,116 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets geographic criteria from the Geo_Target table, + /// such as all cities available to target. Other types include 'Country', + /// 'Region', 'State', 'Postal_Code', and 'DMA_Region' (i.e. Metro). + /// A full list of available geo target types can be found at + /// https://developers.google.com/doubleclick-publishers/docs/reference/v201403/PublisherQueryLanguageService + /// + /// Tags: PublisherQueryLanguageService.select + /// + class GetGeoTargets : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets geographic criteria from the Geo_Target table, such as " + + "all cities available to target. Other types include 'Country', 'Region', 'State', " + + "'Postal_Code', and 'DMA_Region' (i.e. Metro). A full list of available geo target " + + "types can be found at https://developers.google.com/doubleclick-publishers/docs/reference/v201403/PublisherQueryLanguageService"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetGeoTargets(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PublisherQueryLanguageService. + PublisherQueryLanguageService pqlService = + (PublisherQueryLanguageService) user.GetService( + DfpService.v201403.PublisherQueryLanguageService); + + string geoType = "City"; + + // Create statement to select all targetable cities. + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Id, Name, CanonicalParentId, ParentIds, CountryCode") + .From("Geo_Target") + .Where("Type = :type and Targetable = true") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("type", geoType); + + int resultSetSize = 0; + List allRows = new List(); + ResultSet resultSet; + + try { + do { + // Get all cities. + resultSet = pqlService.select(statementBuilder.ToStatement()); + + // Collect all cities from each page. + allRows.AddRange(resultSet.rows); + + // Display results. + Console.WriteLine(PqlUtilities.ResultSetToString(resultSet)); + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + resultSetSize = resultSet.rows == null ? 0 : resultSet.rows.Length; + } while (resultSetSize > 0); + + Console.WriteLine("Number of results found: " + allRows.Count); + + // Optionally, save all rows to a CSV. + // Get a string array representation of the data rows. + resultSet.rows = allRows.ToArray(); + List rows = PqlUtilities.ResultSetToStringArrayList(resultSet); + + // Write the contents to a csv file. + CsvFile file = new CsvFile(); + file.Headers.AddRange(rows[0]); + file.Records.AddRange(rows.GetRange(1, rows.Count - 1).ToArray()); + file.Write(geoType + "_" + this.GetTimeStamp() + ".csv"); + } catch (Exception ex) { + Console.WriteLine("Failed to get Geo type = '{0}'. Exception says \"{1}\"", + geoType, ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/PublisherQueryLanguageService/GetLineItemsNamedLike.cs b/examples/Dfp/CSharp/v201403/PublisherQueryLanguageService/GetLineItemsNamedLike.cs new file mode 100644 index 00000000000..59d8c7f4b08 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/PublisherQueryLanguageService/GetLineItemsNamedLike.cs @@ -0,0 +1,107 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all line items which have a name beginning with + /// "line item". This code example may take a while to run. + /// + /// Tags: PublisherQueryLanguageService.select + /// + class GetLineItemsNamedLike : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items which have a name beginning with " + + "'line item'. This code example may take a while to run."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLineItemsNamedLike(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PublisherQueryLanguageService. + PublisherQueryLanguageService pqlService = + (PublisherQueryLanguageService) user.GetService( + DfpService.v201403.PublisherQueryLanguageService); + + // Create statement to select all line items named like 'line item%'. + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Id, Name, Status") + .From("Line_Item") + .Where("Name LIKE 'line item%'") + .OrderBy("Id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + List allRows = new List(); + ResultSet resultSet; + int resultSetSize = 0; + + try { + do { + // Get line items like 'line item%'. + resultSet = pqlService.select(statementBuilder.ToStatement()); + + // Collect all line items from each page. + allRows.AddRange(resultSet.rows); + + // Display results. + Console.WriteLine(PqlUtilities.ResultSetToString(resultSet)); + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + resultSetSize = resultSet.rows == null ? 0 : resultSet.rows.Length; + } while (resultSetSize > 0); + + Console.WriteLine("Number of results found: " + allRows.Count); + + // Optionally, save all rows to a CSV. + // Get a string array representation of the data rows. + resultSet.rows = allRows.ToArray(); + List rows = PqlUtilities.ResultSetToStringArrayList(resultSet); + + // Write the contents to a csv file. + CsvFile file = new CsvFile(); + file.Headers.AddRange(rows[0]); + file.Records.AddRange(rows.GetRange(1, rows.Count - 1).ToArray()); + file.Write("line_items_named_like_" + GetTimeStamp() + ".csv"); + } catch (Exception ex) { + Console.WriteLine("Failed to get line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ReportService/DisplayReport.cs b/examples/Dfp/CSharp/v201403/ReportService/DisplayReport.cs new file mode 100644 index 00000000000..8c61c5ec7c1 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ReportService/DisplayReport.cs @@ -0,0 +1,87 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example downloads a completed report and prints out its + /// contents. To download a completed report to a file, run DownloadReport.cs. + /// To run a report, run RunDeliveryReport.cs. + /// + /// Tags: ReportService.getReportDownloadUrlWithOptions + /// + class DisplayReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example downloads a completed report and prints out its contents. " + + "To download a completed report to a file, run DownloadReport.cs. To run a report, " + + "run RunDeliveryReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DisplayReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201403.ReportService); + + // Set the id of the completed report. + long reportJobId = long.Parse(_T("INSERT_REPORT_JOB_ID_HERE")); + ExportFormat exportFormat = (ExportFormat) Enum.Parse(typeof(ExportFormat), + _T("INSERT_EXPORT_FORMAT_HERE")); + + // Set the format of the report (e.g., CSV_DUMP) and download without + // compression so we can print it. + ReportDownloadOptions reportDownloadOptions = new ReportDownloadOptions(); + reportDownloadOptions.exportFormat = exportFormat; + reportDownloadOptions.useGzipCompression = false; + + try { + // Download report data. + string downloadUrl = reportService.getReportDownloadUrlWithOptions(reportJobId, + reportDownloadOptions); + byte[] rawReport = MediaUtilities.GetAssetDataFromUrl(downloadUrl); + string reportContents = Encoding.UTF8.GetString(rawReport); + + // Display results. + Console.WriteLine("Data for report job with id '{0}\':\n{1}", reportJobId, reportContents); + } catch (Exception ex) { + Console.WriteLine("Failed to download report. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ReportService/DownloadReport.cs b/examples/Dfp/CSharp/v201403/ReportService/DownloadReport.cs new file mode 100644 index 00000000000..45991991108 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ReportService/DownloadReport.cs @@ -0,0 +1,83 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Text; +using System.IO; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example downloads a completed report. To run a report, run + /// RunDeliveryReport.cs. + /// + /// Tags: ReportService.getReportDownloadURL + /// + class DownloadReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example downloads a completed report. To run a report, run " + + "RunDeliveryReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DownloadReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201403.ReportService); + + // Set the id of the completed report. + long reportJobId = long.Parse(_T("INSERT_REPORT_JOB_ID_HERE")); + String fileName = _T("INSERT_FILE_PATH_HERE"); + + try { + // Download report data. + string url = reportService.getReportDownloadURL(reportJobId, ExportFormat.CSV_EXCEL); + byte[] gzipReport = MediaUtilities.GetAssetDataFromUrl(url); + string reportContents = Encoding.UTF8.GetString(MediaUtilities.DeflateGZipData(gzipReport)); + + using (StreamWriter writer = new StreamWriter(fileName)) { + writer.Write(reportContents); + } + + // Display results. + Console.WriteLine("Report job with id '{0}' was downloaded to '{1}'.", reportJobId, + fileName); + } catch (Exception ex) { + Console.WriteLine("Failed to download report. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ReportService/RunDeliveryReport.cs b/examples/Dfp/CSharp/v201403/ReportService/RunDeliveryReport.cs new file mode 100644 index 00000000000..7a3b81ec7d0 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ReportService/RunDeliveryReport.cs @@ -0,0 +1,105 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Threading; +using Google.Api.Ads.Dfp.Util.v201403; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example runs a report similar to the "Orders report" on the DFP + /// website with additional attributes and can filter to include just one + /// order. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunDeliveryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report similar to the \"Orders report\" on the DFP " + + "website with additional attributes and can filter to include just one order. To " + + "download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunDeliveryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201403.ReportService); + + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create statement object to filter for an order. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("ORDER_ID = :id") + .AddValue("id", orderId); + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportJob.reportQuery.dimensionAttributes = new DimensionAttribute[] { + DimensionAttribute.ORDER_TRAFFICKER, DimensionAttribute.ORDER_START_DATE_TIME, + DimensionAttribute.ORDER_END_DATE_TIME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportJob.reportQuery.statement = statementBuilder.ToStatement(); + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ReportService/RunInventoryReport.cs b/examples/Dfp/CSharp/v201403/ReportService/RunInventoryReport.cs new file mode 100644 index 00000000000..4d4e438001c --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ReportService/RunInventoryReport.cs @@ -0,0 +1,116 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Threading; +using Google.Api.Ads.Dfp.Util.v201403; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example runs a report equal to the "Whole network report" on the + /// DFP website. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunInventoryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Whole network report\" on the " + + "DFP website. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunInventoryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201403.ReportService); + + // Get the NetworkService. + NetworkService networkService = (NetworkService) user.GetService( + DfpService.v201403.NetworkService); + + // Get the root ad unit ID to filter on. + String rootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create statement to filter on an ancestor ad unit with the root ad unit ID to include all + // ad units in the network. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("AD_UNIT_ANCESTOR_AD_UNIT_ID = :ancestorAdUnitId") + .AddValue("ancestorAdUnitId", long.Parse(rootAdUnitId)); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dimensions = + new Dimension[] { Dimension.AD_UNIT_ID, Dimension.AD_UNIT_NAME }; + reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + Column.TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + Column.TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE}; + + // Set the filter statement. + reportQuery.statement = statementBuilder.ToStatement(); + + reportQuery.adUnitView = ReportQueryAdUnitView.HIERARCHICAL; + reportQuery.dateRangeType = DateRangeType.LAST_WEEK; + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = reportQuery; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run inventory report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ReportService/RunMergedDeliveryReport.cs b/examples/Dfp/CSharp/v201403/ReportService/RunMergedDeliveryReport.cs new file mode 100644 index 00000000000..e925ba3264c --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ReportService/RunMergedDeliveryReport.cs @@ -0,0 +1,96 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example runs a report that an upgraded publisher would use to + /// include statistics before the upgrade. To download the report see + /// DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunMergedDeliveryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Orders report\" on the DFP " + + "website with additional attributes. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunMergedDeliveryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201403.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportQuery.columns = new Column[] {Column.MERGED_AD_SERVER_IMPRESSIONS, + Column.MERGED_AD_SERVER_CLICKS, Column.MERGED_AD_SERVER_CTR, + Column.MERGED_AD_SERVER_CPM_AND_CPC_REVENUE, + Column.MERGED_AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery = reportQuery; + + try { + // Run report job. + reportJob = reportService.runReportJob(reportJob); + + do { + Console.WriteLine("Report with ID '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS); + + if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with ID '{0}' failed to finish successfully.", + reportJob.id); + } else { + Console.WriteLine("Report job with ID '{0}' completed successfully.", reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ReportService/RunReachReport.cs b/examples/Dfp/CSharp/v201403/ReportService/RunReachReport.cs new file mode 100644 index 00000000000..7b3c415d48f --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ReportService/RunReachReport.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Threading; +using Google.Api.Ads.Dfp.Util.v201403; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example runs a reach report. To download the report see + /// DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunReachReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a reach report. To download the report see " + + "DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunReachReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201403.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.REACH_LIFETIME; + reportQuery.dimensions = new Dimension[] {Dimension.LINE_ITEM_ID, Dimension.LINE_ITEM_NAME}; + reportQuery.columns = new Column[] {Column.REACH_FREQUENCY, Column.REACH_AVERAGE_REVENUE, + Column.REACH}; + reportJob.reportQuery = reportQuery; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ReportService/RunReportWithCustomFields.cs b/examples/Dfp/CSharp/v201403/ReportService/RunReportWithCustomFields.cs new file mode 100644 index 00000000000..a9c37017995 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ReportService/RunReportWithCustomFields.cs @@ -0,0 +1,141 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; +using Google.Api.Ads.Dfp.Util.v201403; + +using System; +using System.Threading; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example runs a report that includes custom fields found in the + /// line items of an order. To download the report see DownloadReport.cs. + /// + /// Tag: ReportService.runReportJob + /// Tag: ReportService.getReportJob + /// Tag: LineItemService.getLineItemsByStatement + /// + class RunReportWithCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report that includes custom fields found in the " + + "line items of an order. To download the report see DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunReportWithCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201403.LineItemService); + // Get the ReportService. + ReportService reportService = + (ReportService) user.GetService(DfpService.v201403.ReportService); + + try { + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Sets default for page. + LineItemPage page = new LineItemPage(); + + // Create a statement to only select line items from a given order. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("orderId = :orderId") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("orderId", orderId); + + + // Collect all line item custom field IDs for an order. + List customFieldIds = new List(); + do { + // Get line items by statement. + page = lineItemService.getLineItemsByStatement(statementBuilder.ToStatement()); + + // Get custom field IDs from the line items of an order. + if (page.results != null) { + foreach (LineItem lineItem in page.results) { + if (lineItem.customFieldValues != null) { + foreach (BaseCustomFieldValue customFieldValue in lineItem.customFieldValues) { + if (!customFieldIds.Contains(customFieldValue.customFieldId)) { + customFieldIds.Add(customFieldValue.customFieldId); + } + } + } + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + + // Create statement to filter for an order. + statementBuilder.RemoveLimitAndOffset(); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportQuery.dimensions = new Dimension[] {Dimension.LINE_ITEM_ID, Dimension.LINE_ITEM_NAME}; + reportQuery.statement = statementBuilder.ToStatement(); + reportQuery.customFieldIds = customFieldIds.ToArray(); + reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS}; + reportJob.reportQuery = reportQuery; + + // Run report job. + reportJob = reportService.runReportJob(reportJob); + + do { + Console.WriteLine("Report with ID '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS); + + if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with ID '{0}' failed to finish successfully.", + reportJob.id); + } else { + Console.WriteLine("Report job with ID '{0}' completed successfully.", reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run cusom fields report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/ReportService/RunSalesReport.cs b/examples/Dfp/CSharp/v201403/ReportService/RunSalesReport.cs new file mode 100644 index 00000000000..8d1a76fad30 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/ReportService/RunSalesReport.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example runs a report equal to the "Sales by salespersons + /// report" on the DFP website. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunSalesReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Sales by salespersons report\" on" + + "the DFP website. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunSalesReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201403.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.SALESPERSON_ID, + Dimension.SALESPERSON_NAME}; + reportJob.reportQuery.columns = new Column[] { + Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM + }; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run sales report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs b/examples/Dfp/CSharp/v201403/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs new file mode 100644 index 00000000000..bce6e504c2a --- /dev/null +++ b/examples/Dfp/CSharp/v201403/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs @@ -0,0 +1,117 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201403; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example approves all suggested ad units with 50 or more + /// requests. This feature is only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// Tags: SuggestedAdUnitService.performSuggestedAdUnitAction + /// + class ApproveSuggestedAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example approves all suggested ad units with 50 or more requests. " + + "This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ApproveSuggestedAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201403.SuggestedAdUnitService); + + // Set the number of requests for suggested ad units greater than which to approve. + long NUMBER_OF_REQUESTS = 50L; + + // Create statement to select all suggested ad units that are highly requested. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("numRequests > :numRequests") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("numRequests", NUMBER_OF_REQUESTS); + + // Set default for page. + SuggestedAdUnitPage page = new SuggestedAdUnitPage(); + + try { + do { + // Get suggested ad units by statement. + page = suggestedAdUnitService.getSuggestedAdUnitsByStatement( + statementBuilder.ToStatement()); + + int i = 0; + if (page != null && page.results != null) { + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and \"{2}\" will be " + + "approved.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while(statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of suggested ad units to be approved: " + + page.totalResultSetSize); + + // Modify statement for action. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + ApproveSuggestedAdUnit action = new ApproveSuggestedAdUnit(); + + // Perform action. + SuggestedAdUnitUpdateResult result = suggestedAdUnitService.performSuggestedAdUnitAction( + action, statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of suggested ad units approved: " + result.numChanges); + } else { + Console.WriteLine("No suggested ad units were approved."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to approve suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs b/examples/Dfp/CSharp/v201403/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs new file mode 100644 index 00000000000..58248fc9c1d --- /dev/null +++ b/examples/Dfp/CSharp/v201403/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201403; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all suggested ad units. To approve suggested ad + /// units, run ApproveSuggestedAdUnits.cs. This feature is only available to + /// DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// + class GetAllSuggestedAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all suggested ad units. To approve suggested ad units, " + + "run ApproveSuggestedAdUnits.cs. This feature is only available to DFP premium " + + "solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllSuggestedAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201403.SuggestedAdUnitService); + + // Set defaults for page and filterStatement. + SuggestedAdUnitPage page = new SuggestedAdUnitPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all suggested ad units. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get suggested ad units by statement. + page = suggestedAdUnitService.getSuggestedAdUnitsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and number of requests " + + "\"{2}\" was found.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs b/examples/Dfp/CSharp/v201403/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs new file mode 100644 index 00000000000..299c173cc7b --- /dev/null +++ b/examples/Dfp/CSharp/v201403/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs @@ -0,0 +1,100 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201403; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets suggested ad units that have more than 50 requests. + /// The statement retrieves up to the maximum page size limit of 500. This + /// feature is only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// + class GetSuggestedUnitByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets suggested ad units that have more than 50 requests. The " + + "statement retrieves up to the maximum page size limit of 500. This feature is " + + "only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetSuggestedUnitByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201403.SuggestedAdUnitService); + + // Set the number of requests to 50 or more. + long NUMBER_OF_REQUESTS = 50L; + + // Create a statement to only select suggested ad units that have more + // than 50 requests. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("numRequests > :numRequests") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("numRequests", NUMBER_OF_REQUESTS); + + // Set default for page. + SuggestedAdUnitPage page = new SuggestedAdUnitPage(); + + try { + do { + // Get suggested ad units by statement. + page = suggestedAdUnitService.getSuggestedAdUnitsByStatement( + statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and number of requests " + + "\"{2}\" was found.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/TeamService/CreateTeams.cs b/examples/Dfp/CSharp/v201403/TeamService/CreateTeams.cs new file mode 100644 index 00000000000..be941a399e7 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/TeamService/CreateTeams.cs @@ -0,0 +1,88 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; +using Google.Api.Ads.Dfp.Util.v201403; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates new teams. To determine which teams exist, run + /// GetAllTeams.cs. + /// + /// Tags: TeamService.createTeams + /// + class CreateTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new teams. To determine which teams exist, run " + + "GetAllTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201403.TeamService); + + try { + // Create an array to store local team objects. + Team[] teams = new Team[5]; + + for (int i = 0; i < 5; i++) { + Team team = new Team(); + team.name = "Team #" + i; + team.hasAllCompanies = false; + team.hasAllInventory = false; + teams[i] = team; + } + + // Create the teams on the server. + teams = teamService.createTeams(teams); + + if (teams != null && teams.Length > 0) { + foreach (Team newTeam in teams) { + Console.WriteLine("A team with ID \"{0}\", and name \"{1}\" was created.", + newTeam.id, newTeam.name); + } + } else { + Console.WriteLine("No teams created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create teams. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/TeamService/GetAllTeams.cs b/examples/Dfp/CSharp/v201403/TeamService/GetAllTeams.cs new file mode 100644 index 00000000000..b14d1d84b0a --- /dev/null +++ b/examples/Dfp/CSharp/v201403/TeamService/GetAllTeams.cs @@ -0,0 +1,89 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; +using Google.Api.Ads.Dfp.Util.v201403; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all teams. To create teams, run CreateTeams.cs. + /// + /// Tags: TeamService.getTeamsByStatement + /// + class GetAllTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams. To create teams, run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201403.TeamService); + + // Set defaults for page and filterStatement. + TeamPage page = new TeamPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all teams. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get teams by statement. + page = teamService.getTeamsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Team team in page.results) { + Console.WriteLine("{0}) Team with ID \"{1}\", name \"{2}\" was found.", + i, team.id, team.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all teams. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/TeamService/GetTeamsByStatement.cs b/examples/Dfp/CSharp/v201403/TeamService/GetTeamsByStatement.cs new file mode 100644 index 00000000000..da36db15cc9 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/TeamService/GetTeamsByStatement.cs @@ -0,0 +1,92 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; +using Google.Api.Ads.Dfp.Util.v201403; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all teams ordered by name. To create teams, + /// run CreateTeams.cs. + /// + /// Tags: TeamService.getTeamsByStatement + /// + class GetTeamsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams ordered by name. To create teams, run " + + "CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetTeamsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201403.TeamService); + + // Create a statement to order teams by name. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("name ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + TeamPage page = new TeamPage(); + + try { + do { + // Get teams by statement. + page = teamService.getTeamsByStatement(statementBuilder.ToStatement()); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (Team team in page.results) { + Console.WriteLine("{0}) Team with ID \"{1}\" and name \"{2}\" was found.", + i, team.id, team.name); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while(statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get teams by statement. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/TeamService/UpdateTeams.cs b/examples/Dfp/CSharp/v201403/TeamService/UpdateTeams.cs new file mode 100644 index 00000000000..7a2eff614a4 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/TeamService/UpdateTeams.cs @@ -0,0 +1,107 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; +using Google.Api.Ads.Dfp.Util.v201403; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example updates a team by adding an ad unit to it. To + /// determine which teams exist, run GetAllTeams.cs. To determine which ad + /// units exist, run GetAllAdUnits.cs. + /// + /// Tags: TeamService.getTeamsByStatement, TeamService.updateTeams + /// + class UpdateTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a team by adding an ad unit to it. To " + + "determine which teams exist, run GetAllTeams.cs. To determine which ad units " + + "exist, run GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201403.TeamService); + + // Set the ID of the team to update. + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + + // Set the ID of the ad unit to add to the team. + String adUnitId = _T("INSERT_AD_UNIT_ID_HERE"); + + // Create a statement to select the team. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", teamId); + + try { + // Get the teams by statement. + TeamPage page = teamService.getTeamsByStatement(statementBuilder.ToStatement()); + + Team team = page.results[0]; + + // Don't add ad unit if the team has all inventory already. + if (!team.hasAllInventory) { + List adUnitIds = new List(); + if (team.adUnitIds != null) { + adUnitIds.AddRange(team.adUnitIds); + } + adUnitIds.Add(adUnitId); + team.adUnitIds = adUnitIds.ToArray(); + } + + // Update the teams on the server. + Team[] teams = teamService.updateTeams(new Team[] {team}); + + if (teams != null) { + foreach (Team updatedTeam in teams) { + Console.WriteLine("A team with ID \"{0}\" and name \"{1}\" was updated.", + updatedTeam.id, updatedTeam.name); + } + } else { + Console.WriteLine("No teams updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update teams. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/UserService/CreateUsers.cs b/examples/Dfp/CSharp/v201403/UserService/CreateUsers.cs new file mode 100644 index 00000000000..350149b89fd --- /dev/null +++ b/examples/Dfp/CSharp/v201403/UserService/CreateUsers.cs @@ -0,0 +1,100 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example creates new users. To determine which users + /// exist, run GetAllUsers.cs. + /// + /// Tags: UserService.createUsers + /// + class CreateUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new users. To determine which users " + + "exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201403.UserService); + + // Set the user's email addresses and names. + List emailAndNames = new List(); + emailAndNames.Add(new String[] {_T("INSERT_EMAIL_ADDRESS_HERE"), _T("INSERT_NAME_HERE")}); + emailAndNames.Add(new String[] {_T("INSERT_ANOTHER_EMAIL_ADDRESS_HERE"), + _T("INSERT_ANOTHER_NAME_HERE")}); + + // Roles can be obtained by running GetAllRoles.cs. + long roleId = long.Parse(_T("INSERT_ROLE_ID_HERE")); + + // Create an array to store local user objects. + User[] users = new User[emailAndNames.Count]; + + for (int i = 0; i < users.Length; i++) { + // Create the new user structure. + User newUser = new User(); + newUser.email = emailAndNames[i][0]; + newUser.name = emailAndNames[i][1]; + newUser.roleId = roleId; + newUser.preferredLocale = "en_US"; + + users[i] = newUser; + } + + try { + // Create the users. + users = userService.createUsers(users); + + if (users != null) { + foreach (User newUser in users) { + Console.WriteLine("A user with ID = '{0}', email = '{1}', and role = '{2}' " + + "was created.", newUser.id, newUser.email, newUser.roleName); + } + } else { + Console.WriteLine("No users created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/UserService/DeactivateUser.cs b/examples/Dfp/CSharp/v201403/UserService/DeactivateUser.cs new file mode 100644 index 00000000000..0be68b51e78 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/UserService/DeactivateUser.cs @@ -0,0 +1,121 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example deactivates a user. Deactivated users can no longer make + /// requests to the API. The user making the request cannot deactivate itself. + /// To determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserService.getUsersByStatement, UserService.performUserAction + /// + class DeactivateUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates a user. Deactivated users can no longer make " + + "requests to the API. The user making the request cannot deactivate itself. " + + "To determine which users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201403.UserService); + + // Set the ID of the user to deactivate + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create Statement text to select user by id. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :userId") + .OrderBy("id ASC") + .Limit(1) + .AddValue("userId", userId); + + // Sets default for page. + UserPage page = new UserPage(); + List userIds = new List(); + + try { + do { + // Get users by Statement. + page = userService.getUsersByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User userResult in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and status = '{3}'" + + " will be deactivated.", i, userResult.id, userResult.email, + userResult.isActive ? "ACTIVE" : "INACTIVE"); + userIds.Add(userResult.id.ToString()); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of users to be deactivated: {0}", page.totalResultSetSize); + + if (userIds.Count > 0) { + // Modify statement for action. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + DeactivateUsers action = new DeactivateUsers(); + + // Perform action. + UpdateResult result = userService.performUserAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of users deactivated: {0}" + result.numChanges); + } else { + Console.WriteLine("No users were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/UserService/GetAllRoles.cs b/examples/Dfp/CSharp/v201403/UserService/GetAllRoles.cs new file mode 100644 index 00000000000..f34d2bf4b7e --- /dev/null +++ b/examples/Dfp/CSharp/v201403/UserService/GetAllRoles.cs @@ -0,0 +1,77 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all roles. This example can be used to determine + /// which role ID is needed when getting and creating users. + /// + /// Tags: UserService.getAllRoles + /// + class GetAllRoles : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all roles. This example can be used to determine which " + + "role ID is needed when getting and creating users."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllRoles(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201403.UserService); + + try { + // Get all roles. + Role[] roles = userService.getAllRoles(); + int numRoles = 0; + if (roles != null && roles.Length > 0) { + foreach (Role role in roles) { + Console.WriteLine("Role with ID = '{0}' and name ='{1}' was found.", role.id, + role.name); + } + numRoles = roles.Length; + } + + Console.WriteLine("Number of results found: " + numRoles); + } catch (Exception ex) { + Console.WriteLine("Failed to get all roles. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/UserService/GetAllUsers.cs b/examples/Dfp/CSharp/v201403/UserService/GetAllUsers.cs new file mode 100644 index 00000000000..3124683381d --- /dev/null +++ b/examples/Dfp/CSharp/v201403/UserService/GetAllUsers.cs @@ -0,0 +1,88 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all users. To create users, run CreateUsers.cs. + /// + /// Tags: UserService.getUsersByStatement + /// + class GetAllUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all users. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201403.UserService); + + // Create a Statement to get all users. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Sets defaults for page and Statement. + UserPage page = new UserPage(); + + try { + do { + // Get users by Statement. + page = userService.getUsersByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User usr in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and role = '{3}'" + + " was found.", i, usr.id, usr.email, usr.roleName); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/UserService/GetCurrentUser.cs b/examples/Dfp/CSharp/v201403/UserService/GetCurrentUser.cs new file mode 100644 index 00000000000..1b0d42b609e --- /dev/null +++ b/examples/Dfp/CSharp/v201403/UserService/GetCurrentUser.cs @@ -0,0 +1,71 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets current user. To create users, run CreateUsers.cs. + /// + /// Tags: UserService.getCurrentUser + /// + class GetCurrentUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets current user. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCurrentUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201403.UserService); + + try { + // Get the current user. + User usr = userService.getCurrentUser(); + + if (usr != null) { + Console.WriteLine("User with ID = '{0}', email = '{1}', and role = '{2}' is the " + + "current user.", usr.id, usr.email, usr.roleName); + } else { + Console.WriteLine("The current user could not be retrieved."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get current user. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/UserService/GetUsersByStatement.cs b/examples/Dfp/CSharp/v201403/UserService/GetUsersByStatement.cs new file mode 100644 index 00000000000..dec6ea29772 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/UserService/GetUsersByStatement.cs @@ -0,0 +1,90 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all active users sorted by name. To create new users, + /// run CreateUsers.cs. + /// + /// Tags: UserService.getUsersByStatement + /// + class GetUsersByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return " This code example gets all active users sorted by name. To create new users, " + + "run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUsersByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201403.UserService); + + // Create a Statement to get all active users sorted by name. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("status = :status") + .OrderBy("name ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("status", "ACTIVE"); + + // Set default for page. + UserPage page = new UserPage(); + + try { + do { + // Get users by Statement. + page = userService.getUsersByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User usr in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and role = '{3}'" + + " was found.", i, usr.id, usr.email, usr.roleName); + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/UserService/UpdateUsers.cs b/examples/Dfp/CSharp/v201403/UserService/UpdateUsers.cs new file mode 100644 index 00000000000..d895fba8a65 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/UserService/UpdateUsers.cs @@ -0,0 +1,96 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example updates a user by adding "Sr." to the end of its + /// name. To determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserService.getUsersByStatement, UserService.updateUsers + /// + class UpdateUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a user by adding 'Sr.' to the end of its " + + "name. To determine which users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserService. + UserService userService = (UserService) dfpUser.GetService(DfpService.v201403.UserService); + + // Set the user to update. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create a Statement to get all users. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :userId") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", userId); + + + try { + // Get users by Statement. + UserPage page = userService.getUsersByStatement(statementBuilder.ToStatement()); + + User user = page.results[0]; + + // Update user object by changing its name. + user.name = user.name + " Sr."; + + // Update the users on the server. + User[] users = userService.updateUsers(new User[] {user}); + + if (users != null) { + foreach (User updatedUser in users) { + Console.WriteLine("A user with ID = '{0}', name ='{1}', and role = '{2}'" + + " was updated.", updatedUser.id, updatedUser.name, updatedUser.roleName); + } + } else { + Console.WriteLine("No users updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/UserTeamAssociationService/CreateUserTeamAssociations.cs b/examples/Dfp/CSharp/v201403/UserTeamAssociationService/CreateUserTeamAssociations.cs new file mode 100644 index 00000000000..9ff1e9097b7 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/UserTeamAssociationService/CreateUserTeamAssociations.cs @@ -0,0 +1,98 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example adds a user to a team by creating an association + /// between the two. To determine which teams exist, run GetAllTeams.cs. To + /// determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.createUserTeamAssociations + /// + class CreateUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a user to a team by creating an association between the " + + "two. To determine which teams exist, run GetAllTeams.cs. To determine which users " + + "exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201403.UserTeamAssociationService); + + // Set the users and team to add them to. + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + long[] userIds = new long[] {long.Parse(_T("INSERT_USER_ID_HERE"))}; + + // Create an array to store local user team association objects. + UserTeamAssociation[] userTeamAssociations = new UserTeamAssociation[userIds.Length]; + + // For each user, associate it with the given team. + int i = 0; + + foreach (long userId in userIds) { + UserTeamAssociation userTeamAssociation = new UserTeamAssociation(); + userTeamAssociation.userId = userId; + userTeamAssociation.teamId = teamId; + userTeamAssociations[i++] = userTeamAssociation; + } + + try { + // Create the user team associations on the server. + userTeamAssociations = + userTeamAssociationService.createUserTeamAssociations(userTeamAssociations); + + if (userTeamAssociations != null) { + foreach (UserTeamAssociation userTeamAssociation in userTeamAssociations) { + Console.WriteLine("A user team association between user with ID \"{0}\" and team " + + "with ID \"{1}\" was created.", userTeamAssociation.userId, + userTeamAssociation.teamId); + } + } else { + Console.WriteLine("No user team associations created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/UserTeamAssociationService/DeleteUserTeamAssociations.cs b/examples/Dfp/CSharp/v201403/UserTeamAssociationService/DeleteUserTeamAssociations.cs new file mode 100644 index 00000000000..f279feaaa3f --- /dev/null +++ b/examples/Dfp/CSharp/v201403/UserTeamAssociationService/DeleteUserTeamAssociations.cs @@ -0,0 +1,120 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example removes the user from all its teams. To determine which + /// users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.performUserTeamAssociationAction + /// + class DeleteUserTeamAssociation : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example removes the user from all its teams. To determine which " + + "users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeleteUserTeamAssociation(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201403.UserTeamAssociationService); + + // Set the user to remove from its teams. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create filter text to select user team associations by the user ID. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("userId = :userId") + .OrderBy("userId ASC, teamId ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("userId", userId); + + // Set default for page. + UserTeamAssociationPage page = new UserTeamAssociationPage(); + + try { + do { + // Get user team associations by statement. + page = userTeamAssociationService.getUserTeamAssociationsByStatement( + statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and " + + "team with ID \"{2}\" will be deleted.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of teams that the user will be removed from: " + + page.totalResultSetSize); + + if (page.totalResultSetSize > 0) { + // Modify statement for action. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + DeleteUserTeamAssociations action = new DeleteUserTeamAssociations(); + + // Perform action. + UpdateResult result = userTeamAssociationService.performUserTeamAssociationAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of teams that the user was removed from: " + + result.numChanges); + } else { + Console.WriteLine("No user team associations were deleted."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to delete user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/UserTeamAssociationService/GetAllUserTeamAssociations.cs b/examples/Dfp/CSharp/v201403/UserTeamAssociationService/GetAllUserTeamAssociations.cs new file mode 100644 index 00000000000..f1af1d319fd --- /dev/null +++ b/examples/Dfp/CSharp/v201403/UserTeamAssociationService/GetAllUserTeamAssociations.cs @@ -0,0 +1,93 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all user team associations. To create user team + /// associations, run CreateUserTeamAssociations.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// + class GetAllUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all user team associations. To create user team " + + "associations, run CreateUserTeamAssociations.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201403.UserTeamAssociationService); + + // Set defaults for page and filterStatement. + UserTeamAssociationPage page = new UserTeamAssociationPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all user team associations. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get user team associations by statement. + page = userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and " + + "team with ID \"{2}\" was found.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}." + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs b/examples/Dfp/CSharp/v201403/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs new file mode 100644 index 00000000000..46862eaa87c --- /dev/null +++ b/examples/Dfp/CSharp/v201403/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs @@ -0,0 +1,100 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example gets all teams that the a user belongs to. To create + /// teams, run CreateTeams.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// + class GetUserTeamAssociationsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams that a user belongs to. To create " + + "teams, run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUserTeamAssociationsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201403.UserTeamAssociationService); + + // Set the ID of the user to fetch all user team associations for. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create statement to select user team associations by the user ID. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("userId = :userId") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("userId", userId); + + // Set default for page. + UserTeamAssociationPage page = new UserTeamAssociationPage(); + + try { + do { + // Get user team associations by statement. + page = userTeamAssociationService.getUserTeamAssociationsByStatement( + statementBuilder.ToStatement()); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and " + + "team with ID \"{2}\" was found.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while(statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201403/UserTeamAssociationService/UpdateUserTeamAssociations.cs b/examples/Dfp/CSharp/v201403/UserTeamAssociationService/UpdateUserTeamAssociations.cs new file mode 100644 index 00000000000..756de31c574 --- /dev/null +++ b/examples/Dfp/CSharp/v201403/UserTeamAssociationService/UpdateUserTeamAssociations.cs @@ -0,0 +1,109 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201403 { + /// + /// This code example updates user team associations by setting the + /// overridden access type to read only for all teams that the user belongs + /// to. To determine which users exists, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// Tags: UserTeamAssociationService.updateUserTeamAssociations + /// + class UpdateUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates user team associations by setting the overridden " + + "access type to read only for all teams that the user belongs to. To determine " + + "which users exists, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201403.UserTeamAssociationService); + + // Set the user id of the user team association to update. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Set the team id of the user team association to update. + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + + // Create a statement to select the user team association. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("userId = :userId and teamId = :teamId") + .OrderBy("userId ASC, teamId ASC") + .Limit(1) + .AddValue("userId", userId) + .AddValue("teamId", teamId); + + try { + // Get user team associations by statement. + UserTeamAssociationPage page = + userTeamAssociationService.getUserTeamAssociationsByStatement( + statementBuilder.ToStatement()); + + UserTeamAssociation userTeamAssociation = page.results[0]; + + userTeamAssociation.overriddenTeamAccessType = TeamAccessType.READ_ONLY; + + // Update the user team associations on the server. + UserTeamAssociation[] userTeamAssociations = + userTeamAssociationService.updateUserTeamAssociations( + new UserTeamAssociation[] {userTeamAssociation}); + + if (userTeamAssociations != null) { + foreach (UserTeamAssociation updatedUserTeamAssociation in userTeamAssociations) { + Console.WriteLine("User team association between user with ID \"{0}\" and team " + + "with ID \"{1}\" was updated to access type \"{2}\".", + updatedUserTeamAssociation.userId, updatedUserTeamAssociation.teamId, + updatedUserTeamAssociation.overriddenTeamAccessType); + } + } else { + Console.WriteLine("No user team associations updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ActivityGroupService/CreateActivityGroups.cs b/examples/Dfp/CSharp/v201405/ActivityGroupService/CreateActivityGroups.cs new file mode 100644 index 00000000000..4bd4a24310b --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ActivityGroupService/CreateActivityGroups.cs @@ -0,0 +1,96 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates new activity groups. To determine which activity + /// groups exist, run GetAllActivityGroups.cs. + /// + /// Tags: ActivityGroupService.createActivityGroups + /// + class CreateActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new activity groups. To determine which activity " + + "groups exist, run GetAllActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201405.ActivityGroupService); + + // Set the ID of the advertiser company this activity group is associated + // with. + long advertiserCompanyId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Create a short-term activity group. + ActivityGroup shortTermActivityGroup = new ActivityGroup(); + shortTermActivityGroup.name = "Short-term activity group #" + GetTimeStamp(); + shortTermActivityGroup.companyIds = new long[] {advertiserCompanyId}; + shortTermActivityGroup.clicksLookback = 1; + shortTermActivityGroup.impressionsLookback = 1; + + // Create a long-term activity group. + ActivityGroup longTermActivityGroup = new ActivityGroup(); + longTermActivityGroup.name = "Long-term activity group #" + GetTimeStamp(); + longTermActivityGroup.companyIds = new long[] {advertiserCompanyId}; + longTermActivityGroup.clicksLookback = 30; + longTermActivityGroup.impressionsLookback = 30; + + try { + // Create the activity groups on the server. + ActivityGroup[] activityGroups = activityGroupService.createActivityGroups( + new ActivityGroup[] {shortTermActivityGroup, longTermActivityGroup}); + + // Display results. + if (activityGroups != null) { + foreach (ActivityGroup activityGroup in activityGroups) { + Console.WriteLine("An activity group with ID \"{0}\" and name \"{1}\" was created.", + activityGroup.id, activityGroup.name); + } + } else { + Console.WriteLine("No activity groups were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ActivityGroupService/GetActiveActivityGroups.cs b/examples/Dfp/CSharp/v201405/ActivityGroupService/GetActiveActivityGroups.cs new file mode 100644 index 00000000000..f11100795ce --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ActivityGroupService/GetActiveActivityGroups.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; +using Google.Api.Ads.Dfp.Util.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all active activity groups. To create activity + /// groups, run CreateActivityGroups.cs. + /// + /// Tags: ContactService.getContactsByStatement + /// + class GetActiveActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active activity groups. To create activity groups, " + + "run CreateActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActiveActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201405.ActivityGroupService); + + StatementBuilder statementBuilder = new StatementBuilder() + .Where("status = :status") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("status", ActivityGroupStatus.ACTIVE.ToString()); + + // Set default for page. + ActivityGroupPage page; + + try { + do { + // Get contacts by statement. + page = activityGroupService.getActivityGroupsByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (ActivityGroup activityGroup in page.results) { + Console.WriteLine("{0}) Activity group with ID \"{1}\" and name \"{2}\" was found.", + i, activityGroup.id, activityGroup.name); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ActivityGroupService/GetAllActivityGroups.cs b/examples/Dfp/CSharp/v201405/ActivityGroupService/GetAllActivityGroups.cs new file mode 100644 index 00000000000..b391ca2638f --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ActivityGroupService/GetAllActivityGroups.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; +using Google.Api.Ads.Dfp.Util.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all activity groups. To create activity groups, run + /// CreateActivityGroups.cs. + /// + /// Tags: ActivityGroupService.getActivityGroupsByStatement + /// + class GetAllActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all activity groups. To create activity groups, run " + + "CreateActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201405.ActivityGroupService); + + ActivityGroupPage page; + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + try { + do { + // Get activity groups by statement. + page = activityGroupService.getActivityGroupsByStatement(statementBuilder.ToStatement()); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + + foreach (ActivityGroup activityGroup in page.results) { + Console.WriteLine("{0}) Activity group with ID \"{1}\" and name \"{2}\" was " + + "found.", i, activityGroup.id, activityGroup.name); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ActivityGroupService/UpdateActivityGroups.cs b/examples/Dfp/CSharp/v201405/ActivityGroupService/UpdateActivityGroups.cs new file mode 100644 index 00000000000..4900ea6525d --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ActivityGroupService/UpdateActivityGroups.cs @@ -0,0 +1,98 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; +using Google.Api.Ads.Dfp.Util.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example updates activity groups by adding a company. To + /// determine which activity groups exist, run GetAllActivityGroups.cs. + /// + /// Tags: ActivityGroupService.getActivityGroupsByStatement + /// Tags: ActivityGroupService.updateActivityGroups + /// + class UpdateActivityGroups : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates activity groups by adding a company. To determine " + + "which activity groups exist, run GetAllActivityGroups.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateActivityGroups(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityGroupService. + ActivityGroupService activityGroupService = + (ActivityGroupService) user.GetService(DfpService.v201405.ActivityGroupService); + + // Set the ID of the activity group and the company to update it with. + int activityGroupId = int.Parse(_T("INSERT_ACTIVITY_GROUP_ID_HERE")); + long advertiserCompanyId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + try { + // Get the activity group. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", activityGroupId); + + ActivityGroupPage page = activityGroupService.getActivityGroupsByStatement( + statementBuilder.ToStatement()); + + ActivityGroup activityGroup = page.results[0]; + + // Update the companies. + List companyIds = new List(activityGroup.companyIds); + companyIds.Add(advertiserCompanyId); + activityGroup.companyIds = companyIds.ToArray(); + + // Update the activity groups on the server. + ActivityGroup[] activityGroups = activityGroupService.updateActivityGroups( + new ActivityGroup[] {activityGroup}); + + // Display results. + foreach (ActivityGroup updatedActivityGroup in activityGroups) { + Console.WriteLine("Activity group with ID \"{0}\" and name \"{1}\" was updated.", + updatedActivityGroup.id, updatedActivityGroup.name); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update activity groups. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ActivityService/CreateActivities.cs b/examples/Dfp/CSharp/v201405/ActivityService/CreateActivities.cs new file mode 100644 index 00000000000..1b94e294af9 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ActivityService/CreateActivities.cs @@ -0,0 +1,93 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates new activities. To determine which activities + /// exist, run GetAllActivities.cs. + /// + /// Tags: ActivityService.createActivities + /// + class CreateActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new activities. To determine which activities exist, " + + "run GetAllActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201405.ActivityService); + + // Set the ID of the activity group this activity is associated with. + int activityGroupId = int.Parse(_T("INSERT_ACTIVITY_GROUP_ID_HERE")); + + // Create a daily visits activity. + Activity dailyVisitsActivity = new Activity(); + dailyVisitsActivity.name = "Activity #" + GetTimeStamp(); + dailyVisitsActivity.activityGroupId = activityGroupId; + dailyVisitsActivity.type = ActivityType.DAILY_VISITS; + + // Create a custom activity. + Activity customActivity = new Activity(); + customActivity.name = "Activity #" + GetTimeStamp(); + customActivity.activityGroupId = activityGroupId; + customActivity.type = ActivityType.CUSTOM; + + try { + // Create the activities on the server. + Activity[] activities = activityService.createActivities( + new Activity[] {dailyVisitsActivity, customActivity}); + + // Display results. + if (activities != null) { + foreach (Activity newActivity in activities) { + Console.WriteLine("An activity with ID \"{0}\", name \"{1}\", and type \"{2}\" was " + + "created.\n", newActivity.id, newActivity.name, newActivity.type); + } + } else { + Console.WriteLine("No activities were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create activities. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ActivityService/GetActiveActivities.cs b/examples/Dfp/CSharp/v201405/ActivityService/GetActiveActivities.cs new file mode 100644 index 00000000000..d557500f282 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ActivityService/GetActiveActivities.cs @@ -0,0 +1,93 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; +using Google.Api.Ads.Dfp.Util.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all active activities. To create activities, + /// run CreateActivities.cs. + /// + /// Tags: ActivityService.getActivitiesByStatement + /// + class GetActiveActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active activities. To create activities, run " + + "CreateActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActiveActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201405.ActivityService); + + // Create a statement to select active activities. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("status = :status") + .OrderBy("id") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("status", ActivityStatus.ACTIVE.ToString()); + + ActivityPage page = new ActivityPage(); + + try { + do { + page = activityService.getActivitiesByStatement(statementBuilder.ToStatement()); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (Activity activity in page.results) { + Console.WriteLine("{0}) Activity with ID \"{1}\", name \"{2}\", and type \"{3}\" " + + "was found.", i, activity.id, activity.name, activity.type); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}.", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get activities. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ActivityService/GetAllActivities.cs b/examples/Dfp/CSharp/v201405/ActivityService/GetAllActivities.cs new file mode 100644 index 00000000000..d3b1f953bb5 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ActivityService/GetAllActivities.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; +using Google.Api.Ads.Dfp.Util.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all activities. To create activities, run + /// CreateActivities.cs. + /// + /// Tags: ActivityService.getActivitiesByStatement + /// + class GetAllActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all activities. To create activities, run " + + "CreateActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201405.ActivityService); + + int totalResultsCounter = 0; + + try { + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + ActivityPage page = new ActivityPage(); + + do { + // Get activities by statement. + page = activityService.getActivitiesByStatement(statementBuilder.ToStatement()); + + // Display results. + if (page.results != null) { + foreach (Activity activity in page.results) { + Console.WriteLine("{0}) Activity with ID \"{1}\", name \"{2}\" and type \"{3}\" " + + "was found.\n", totalResultsCounter, activity.id, activity.name, + activity.type); + totalResultsCounter++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}.", totalResultsCounter); + } catch (Exception ex) { + Console.WriteLine("Failed to get contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ActivityService/UpdateActivities.cs b/examples/Dfp/CSharp/v201405/ActivityService/UpdateActivities.cs new file mode 100644 index 00000000000..1dbcb8762e8 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ActivityService/UpdateActivities.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; +using Google.Api.Ads.Dfp.Util.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example updates activity expected URLs. To determine which + /// activities exist, run GetAllActivities.cs. + /// + /// Tags: ActivityService.getActivitiesByStatement + /// Tags: ActivityService.updateActivities + /// + class UpdateActivities : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates activity expected URLs. To determine which activities " + + "exist, run GetAllActivities.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateActivities(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ActivityService. + ActivityService activityService = + (ActivityService) user.GetService(DfpService.v201405.ActivityService); + + // Set the ID of the activity to update. + int activityId = int.Parse(_T("INSERT_ACTIVITY_ID_HERE")); + + try { + // Get the activity. + StatementBuilder statemetnBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", activityId); + + ActivityPage page = activityService.getActivitiesByStatement( + statemetnBuilder.ToStatement()); + Activity activity = page.results[0]; + + // Update the expected URL. + activity.expectedURL = "https://www.google.com"; + + // Update the activity on the server. + Activity[] activities = activityService.updateActivities(new Activity[] {activity}); + + foreach (Activity updatedActivity in activities) { + Console.WriteLine("Activity with ID \"{0}\" and name \"{1}\" was updated.", + updatedActivity.id, updatedActivity.name); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update activities. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/AudienceSegmentService/CreateAudienceSegments.cs b/examples/Dfp/CSharp/v201405/AudienceSegmentService/CreateAudienceSegments.cs new file mode 100644 index 00000000000..eda4fd6da7e --- /dev/null +++ b/examples/Dfp/CSharp/v201405/AudienceSegmentService/CreateAudienceSegments.cs @@ -0,0 +1,121 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates new rule based first party audience segments. To + /// determine which audience segments exist, run GetAllAudienceSegments.cs. + /// + /// Tags: AudienceSegmentService.createAudienceSegments + /// + class CreateAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new rule based first party audience segments. To " + + "determine which audience segments exist, run GetAllAudienceSegments.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = (AudienceSegmentService) user.GetService( + DfpService.v201405.AudienceSegmentService); + + // Get the NetworkService. + NetworkService networkService = (NetworkService) user.GetService( + DfpService.v201405.NetworkService); + + long customTargetingKeyId = long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + long customTargetingValueId = long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE")); + + try { + // Get the root ad unit ID used to target the whole site. + String rootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + + // Create ad unit targeting for the root ad unit (i.e. the whole network). + AdUnitTargeting adUnitTargeting = new AdUnitTargeting(); + adUnitTargeting.adUnitId = rootAdUnitId; + adUnitTargeting.includeDescendants = true; + + inventoryTargeting.targetedAdUnits = new AdUnitTargeting[] {adUnitTargeting}; + + // Create the custom criteria to be used in the segment rule. + // CUSTOM_TARGETING_KEY_ID == CUSTOM_TARGETING_VALUE_ID + CustomCriteria customCriteria = new CustomCriteria(); + customCriteria.keyId = customTargetingKeyId; + customCriteria.@operator = CustomCriteriaComparisonOperator.IS; + customCriteria.valueIds = new long[] {customTargetingValueId}; + + // Create the custom criteria expression. + CustomCriteriaSet topCustomCriteriaSet = new CustomCriteriaSet(); + topCustomCriteriaSet.logicalOperator = CustomCriteriaSetLogicalOperator.AND; + topCustomCriteriaSet.children = new CustomCriteriaNode[] {customCriteria}; + + // Create the audience segment rule. + FirstPartyAudienceSegmentRule rule = new FirstPartyAudienceSegmentRule(); + rule.inventoryRule = inventoryTargeting; + rule.customCriteriaRule = topCustomCriteriaSet; + + // Create an audience segment. + RuleBasedFirstPartyAudienceSegment audienceSegment = + new RuleBasedFirstPartyAudienceSegment(); + audienceSegment.name = "Sports enthusiasts audience segment #" + this.GetTimeStamp(); + audienceSegment.description = "Sports enthusiasts between the ages of 20 and 30."; + audienceSegment.pageViews = 6; + audienceSegment.recencyDays = 6; + audienceSegment.membershipExpirationDays = 88; + audienceSegment.rule = rule; + + // Create the audience segment on the server. + AudienceSegment[] audienceSegments = audienceSegmentService.createAudienceSegments( + new FirstPartyAudienceSegment[] {audienceSegment}); + + foreach (AudienceSegment createdAudienceSegment in audienceSegments) { + Console.WriteLine("An audience segment with ID \"{0}\", name \"{1}\", and type \"{2}\" " + + "was created.", createdAudienceSegment.id, createdAudienceSegment.name, + createdAudienceSegment.type); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get audience segment. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/AudienceSegmentService/GetAllAudienceSegments.cs b/examples/Dfp/CSharp/v201405/AudienceSegmentService/GetAllAudienceSegments.cs new file mode 100644 index 00000000000..0e40e40865a --- /dev/null +++ b/examples/Dfp/CSharp/v201405/AudienceSegmentService/GetAllAudienceSegments.cs @@ -0,0 +1,92 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all audience segments.To create audience segments, + /// run CreateAudienceSegments.cs. + /// + /// Tags: AudienceSegmentService.getAudienceSegmentsByStatement + /// + class GetAllAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all audience segments. To create audience segments, run " + + "CreateAudienceSegments.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = + (AudienceSegmentService) user.GetService(DfpService.v201405.AudienceSegmentService); + + // Create a Statement to get all audience segments. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + AudienceSegmentPage page = new AudienceSegmentPage(); + + try { + do { + // Get audience segment by Statement. + page = audienceSegmentService.getAudienceSegmentsByStatement( + statementBuilder.ToStatement()); + + // Display results. + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AudienceSegment segment in page.results) { + Console.WriteLine("{0}) 'Audience segment with id \"{1}\" and name \"{2}\" of " + + "size {3} was found.", i, segment.id, segment.name, segment.size); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get audience segment. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/AudienceSegmentService/GetFirstPartyAudienceSegments.cs b/examples/Dfp/CSharp/v201405/AudienceSegmentService/GetFirstPartyAudienceSegments.cs new file mode 100644 index 00000000000..761649844bf --- /dev/null +++ b/examples/Dfp/CSharp/v201405/AudienceSegmentService/GetFirstPartyAudienceSegments.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all first party audience segments. To create first + /// party audience segments, run CreateAudienceSegments.cs. + /// + /// Tags: AudienceSegmentService.getAudienceSegmentsByStatement + /// + class GetFirstPartyAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all first party audience segments. To create first " + + "party audience segments, run CreateAudienceSegments.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetFirstPartyAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = + (AudienceSegmentService) user.GetService(DfpService.v201405.AudienceSegmentService); + + // Create a statement to only select first party audience segments. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("type = :type") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("type", "FIRST_PARTY"); + + // Set default for page. + AudienceSegmentPage page = new AudienceSegmentPage(); + + try { + do { + // Get audience segment by Statement. + page = audienceSegmentService.getAudienceSegmentsByStatement( + statementBuilder.ToStatement()); + + // Display results. + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AudienceSegment segment in page.results) { + Console.WriteLine("{0}) 'Audience segment with id \"{1}\" and name \"{2}\" of " + + "size {3} was found.", i, segment.id, segment.name, segment.size); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get audience segment. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/AudienceSegmentService/PopulateFirstPartyAudienceSegments.cs b/examples/Dfp/CSharp/v201405/AudienceSegmentService/PopulateFirstPartyAudienceSegments.cs new file mode 100644 index 00000000000..1a058da6f3f --- /dev/null +++ b/examples/Dfp/CSharp/v201405/AudienceSegmentService/PopulateFirstPartyAudienceSegments.cs @@ -0,0 +1,98 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example populates a specific rule base first party audience + /// segment. To determine which audience segments exist, run + /// GetAllAudienceSegments.cs. + /// + /// Tags: AudienceSegmentService.getAudienceSegmentsByStatement + /// Tags: AudienceSegmentService.performAudienceSegmentAction + /// + class PopulateFirstPartyAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example populates a specific rule base first party audience segment. " + + "To determine which audience segments exist, run GetAllAudienceSegments.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new PopulateFirstPartyAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = + (AudienceSegmentService) user.GetService(DfpService.v201405.AudienceSegmentService); + + long audienceSegmentId = long.Parse(_T("INSERT_AUDIENCE_SEGMENT_ID_HERE")); + + // Create a statement to only select a specified first party audience + // segment. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :audienceSegmentId") + .OrderBy("id ASC") + .Limit(1) + .AddValue("audienceSegmentId", audienceSegmentId); + + try { + // Get audience segment by Statement. + AudienceSegment audienceSegment = + audienceSegmentService.getAudienceSegmentsByStatement(statementBuilder.ToStatement()) + .results[0]; + + Console.WriteLine("Audience segment with id \"{0}\" and name \"{1}\" " + + "will be populated", audienceSegment.id, audienceSegment.name); + // Create action. + PopulateAudienceSegments action = new PopulateAudienceSegments(); + + // Perform action. + UpdateResult result = audienceSegmentService.performAudienceSegmentAction( + action, statementBuilder.ToStatement()); + + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of audience segments populated: {0}", result.numChanges); + } else { + Console.WriteLine("No audience segments were populated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to populate audience segment. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/AudienceSegmentService/UpdateAudienceSegments.cs b/examples/Dfp/CSharp/v201405/AudienceSegmentService/UpdateAudienceSegments.cs new file mode 100644 index 00000000000..3d51c3cd45d --- /dev/null +++ b/examples/Dfp/CSharp/v201405/AudienceSegmentService/UpdateAudienceSegments.cs @@ -0,0 +1,98 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example updates a first party audience segment's member + /// expiration days. To determine which first party audience segments exist, + /// run GetFirstPartyAudienceSegments.cs. + /// + /// Tags: AudienceSegmentService.getAudienceSegmentsByStatement + /// Tags: AudienceSegmentService.updateAudienceSegments + /// + class UpdateAudienceSegments : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a first party audience segment's member expiration " + + "days. To determine which first party audience segments exist, " + + "run GetFirstPartyAudienceSegments.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateAudienceSegments(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the AudienceSegmentService. + AudienceSegmentService audienceSegmentService = + (AudienceSegmentService) user.GetService(DfpService.v201405.AudienceSegmentService); + + // Set the ID of the audience segment to update. + int audienceSegmentId = int.Parse(_T("INSERT_AUDIENCE_SEGMENT_ID_HERE")); + + // Create a statement to only select a specified first party audience + // segment. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :audienceSegmentId") + .OrderBy("id ASC") + .Limit(1) + .AddValue("audienceSegmentId", audienceSegmentId); + + try { + // Get the audience segment. + RuleBasedFirstPartyAudienceSegment audienceSegment = + (RuleBasedFirstPartyAudienceSegment) audienceSegmentService + .getAudienceSegmentsByStatement(statementBuilder.ToStatement()).results[0]; + + // Update the member expiration days. + audienceSegment.membershipExpirationDays = 180; + + // Update the audience segment on the server. + AudienceSegment[] audienceSegments = audienceSegmentService.updateAudienceSegments( + new FirstPartyAudienceSegment[] {audienceSegment}); + + foreach (AudienceSegment updatedAudienceSegment in audienceSegments) { + Console.WriteLine( + "Audience segment with ID \"{0}\" and name \"{1}\" was updated.\n", + updatedAudienceSegment.id, updatedAudienceSegment.name); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update audience segment. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CompanyService/CreateCompanies.cs b/examples/Dfp/CSharp/v201405/CompanyService/CreateCompanies.cs new file mode 100644 index 00000000000..a7124bc4b90 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CompanyService/CreateCompanies.cs @@ -0,0 +1,86 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates new companies. To determine which companies + /// exist, run GetAllCompanies.cs. + /// + /// Tags: CompanyService.createCompanies + /// + class CreateCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new companies. To determine which companies exist, " + + "run GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201405.CompanyService); + + // Create an array to store local company objects. + Company[] companies = new Company[5]; + + for (int i = 0; i < 5; i++) { + Company company = new Company(); + company.name = string.Format("Advertiser #{0}", i); + company.type = CompanyType.ADVERTISER; + companies[i] = company; + } + + try { + // Create the companies on the server. + companies = companyService.createCompanies(companies); + + if (companies != null && companies.Length > 0) { + foreach (Company company in companies) { + Console.WriteLine("A company with ID = '{0}', name = '{1}' and type = '{2}' was" + + " created.", company.id, company.name, company.type); + } + } else { + Console.WriteLine("No companies created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create company. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CompanyService/GetAllCompanies.cs b/examples/Dfp/CSharp/v201405/CompanyService/GetAllCompanies.cs new file mode 100644 index 00000000000..f6a6a214ca7 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CompanyService/GetAllCompanies.cs @@ -0,0 +1,87 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all companies. To create companies, run + /// CreateCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement + /// + class GetAllCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all companies. To create companies, run CreateCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201405.CompanyService); + + // Set defaults for page and Statement. + CompanyPage page = new CompanyPage(); + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + try { + do { + // Get companies by Statement. + page = companyService.getCompaniesByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Company company in page.results) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", + i, company.id, company.name, company.type); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CompanyService/GetCompaniesByStatement.cs b/examples/Dfp/CSharp/v201405/CompanyService/GetCompaniesByStatement.cs new file mode 100644 index 00000000000..6a55a03b453 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CompanyService/GetCompaniesByStatement.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all companies that are advertisers. To create companies, + /// run CreateCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement + /// + class GetCompaniesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all companies that are advertisers. To create companies, " + + "run CreateCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCompaniesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201405.CompanyService); + + // Create a Statement to only select companies that are advertisers sorted + // by name. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("type = :advertiser") + .OrderBy("name ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("advertiser", CompanyType.ADVERTISER.ToString()); + + CompanyPage page = new CompanyPage(); + + try { + do { + // Get companies by Statement. + page = companyService.getCompaniesByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Company company in page.results) { + Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", + i, company.id, company.name, company.type); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CompanyService/UpdateCompanies.cs b/examples/Dfp/CSharp/v201405/CompanyService/UpdateCompanies.cs new file mode 100644 index 00000000000..c6efe66816e --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CompanyService/UpdateCompanies.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example updates company comments. To determine which companies exist, + /// run GetAllCompanies.cs. + /// + /// Tags: CompanyService.getCompaniesByStatement, CompanyService.updateCompanies + /// + class UpdateCompanies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates company comments. To detemine which companies exist, " + + "run GetAllCompanies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCompanies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CompanyService. + CompanyService companyService = + (CompanyService) user.GetService(DfpService.v201405.CompanyService); + + // Set the ID of the company to update. + int companyId = int.Parse(_T("INSERT_COMPANY_ID_HERE")); + + // Create a Statement to select the company by ID. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :companyId") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("id", companyId); + + try { + // Get the companies by Statement. + CompanyPage page = companyService.getCompaniesByStatement(statementBuilder.ToStatement()); + + Company company = page.results[0]; + + // Update the company comment + company.comment = company.comment + " Updated."; + + // Update the company on the server. + Company[] companies = companyService.updateCompanies(new Company[] {company}); + + foreach (Company updatedCompany in companies) { + Console.WriteLine("Company with ID = {0}, name = {1}, and comment \"{2}\" was updated", + updatedCompany.id, updatedCompany.name, updatedCompany.comment); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update companies. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ContactService/CreateContacts.cs b/examples/Dfp/CSharp/v201405/ContactService/CreateContacts.cs new file mode 100644 index 00000000000..cb3f199d08e --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ContactService/CreateContacts.cs @@ -0,0 +1,89 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates new contacts. To determine which contacts exist, + /// run GetAllContacts.cs. + /// + /// Tags: ContactService.createContacts + /// + class CreateContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new contacts. To determine which contacts exist, " + + "run GetAllContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201405.ContactService); + + // Set the IDs of the companies for the contacts. + long advertiserCompanyId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + long agencyCompanyId = long.Parse(_T("INSERT_AGENCY_COMPANY_ID_HERE")); + + // Create an advertiser contact. + Contact advertiserContact = new Contact(); + advertiserContact.name = "Mr. Advertiser #" + GetTimeStamp(); + advertiserContact.email = "advertiser@advertising.com"; + advertiserContact.companyId = advertiserCompanyId; + + // Create an agency contact. + Contact agencyContact = new Contact(); + agencyContact.name = "Ms. Agency #" + GetTimeStamp(); + agencyContact.email = "agency@agencies.com"; + agencyContact.companyId = agencyCompanyId; + + try { + // Create the contacts on the server. + Contact[] contacts = + contactService.createContacts(new Contact[] {advertiserContact, agencyContact}); + + foreach (Contact contact in contacts) { + Console.WriteLine("A contact with ID \"{0}\" and name \"{1}\" was created.", + contact.id, contact.name); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ContactService/GetAllContacts.cs b/examples/Dfp/CSharp/v201405/ContactService/GetAllContacts.cs new file mode 100644 index 00000000000..d608bbc2355 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ContactService/GetAllContacts.cs @@ -0,0 +1,89 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; +using Google.Api.Ads.Dfp.Util.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all contacts. To create contacts, run + /// CreateContacts.cs. + /// + /// Tags: ContactService.getContactsByStatement + /// + class GetAllContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all contacts. To create contacts, run CreateContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201405.ContactService); + + // Create a statement to get all contacts. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + ContactPage page = new ContactPage(); + + try { + do { + // Get contacts by statement. + page = contactService.getContactsByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (Contact contact in page.results) { + Console.WriteLine("{0}) Contact with ID \"{1}\" and name \"{2}\" was found.", + i, contact.id, contact.name); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ContactService/GetUninvitedContacts.cs b/examples/Dfp/CSharp/v201405/ContactService/GetUninvitedContacts.cs new file mode 100644 index 00000000000..0ff82a1db19 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ContactService/GetUninvitedContacts.cs @@ -0,0 +1,92 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; +using Google.Api.Ads.Dfp.Util.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all contacts that aren't invited yet. To create + /// contacts, run CreateContacts.cs. + /// + /// Tags: ContactService.getContactsByStatement + /// + class GetUninvitedContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all contacts that aren't invited yet. To create " + + "contacts, run CreateContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUninvitedContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201405.ContactService); + + // Create a statement to get all uninvited contacts. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("status = :status") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("status", ContactStatus.UNINVITED.ToString()); + + // Set default for page. + ContactPage page = new ContactPage(); + + try { + do { + // Get contacts by statement. + page = contactService.getContactsByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (Contact contact in page.results) { + Console.WriteLine("{0}) Contact with ID \"{1}\" and name \"{2}\" was found.", + i, contact.id, contact.name); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ContactService/UpdateContacts.cs b/examples/Dfp/CSharp/v201405/ContactService/UpdateContacts.cs new file mode 100644 index 00000000000..9c6e16603c6 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ContactService/UpdateContacts.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; +using Google.Api.Ads.Dfp.Util.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example updates contact addresses. To determine which contacts + /// exist, run GetAllContacts.cs. + /// + /// Tags: ContactService.getContactsByStatement + /// Tags: ContactService.updateContacts + /// + class UpdateContacts : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates contact comments. To determine which contacts " + + "exist, run GetAllContacts.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateContacts(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContactService. + ContactService contactService = + (ContactService) user.GetService(DfpService.v201405.ContactService); + + // Set the ID of the contact to update. + long contactId = long.Parse(_T("INSERT_CONTACT_ID_HERE")); + + try { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", contactId); + + // Get the contact. + ContactPage page = contactService.getContactsByStatement(statementBuilder.ToStatement()); + Contact contact = page.results[0]; + + // Update the address of the contact. + contact.address = "123 New Street, New York, NY, 10011"; + + // Update the contact on the server. + Contact[] contacts = contactService.updateContacts(new Contact[] {contact}); + + // Display results. + foreach (Contact updatedContact in contacts) { + Console.WriteLine("Contact with ID \"{0}\", name \"{1}\", and comment \"{2}\" was " + + "updated.", updatedContact.id, updatedContact.name, updatedContact.comment); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update contacts. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ContentMetadataKeyHierarchyService/CreateContentMetadataKeyHierarchies.cs b/examples/Dfp/CSharp/v201405/ContentMetadataKeyHierarchyService/CreateContentMetadataKeyHierarchies.cs new file mode 100644 index 00000000000..6ee9ee8e85c --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ContentMetadataKeyHierarchyService/CreateContentMetadataKeyHierarchies.cs @@ -0,0 +1,105 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates content metadata key hierachries. To determine which content + /// metadata key hierachries exist, run GetAllContentMetadataKeyHierarchies.cs + /// + /// Tags: ContentMetadataKeyHierarchyService.getContentMetadataKeyHierarchiesByStatement + /// Tags: ContentMetadataKeyHierarchyService.createContentMetadataKeyHierarchies + /// + class CreateContentMetadataKeyHierarchies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates content metadata key hierachries. To determine " + + "which content metadata key hierachries exist, run " + + "GetAllContentMetadataKeyHierarchies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateContentMetadataKeyHierarchies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(Lib.DfpUser user) { + // Get the ContentMetadataKeyHierarchy service. + ContentMetadataKeyHierarchyService contentMetadataKeyHierarchyService = + (ContentMetadataKeyHierarchyService) user.GetService( + DfpService.v201405.ContentMetadataKeyHierarchyService); + + // Set the IDs of the custom targeting keys for the hierarchy. + long customTargetingKeyId1 = long.Parse(_T("INSERT_LEVEL_ONE_CUSTOM_TARGETING_KEY_ID_HERE")); + long customTargetingKeyId2 = long.Parse(_T("INSERT_LEVEL_TWO_CUSTOM_TARGETING_KEY_ID_HERE")); + + List hierarchyLevels = + new List(); + + ContentMetadataKeyHierarchyLevel hierarchyLevel1 = new ContentMetadataKeyHierarchyLevel(); + hierarchyLevel1.customTargetingKeyId = customTargetingKeyId1; + hierarchyLevel1.hierarchyLevel = 1; + hierarchyLevels.Add(hierarchyLevel1); + + ContentMetadataKeyHierarchyLevel hierarchyLevel2 = new ContentMetadataKeyHierarchyLevel(); + hierarchyLevel2.customTargetingKeyId = customTargetingKeyId2; + hierarchyLevel2.hierarchyLevel = 2; + hierarchyLevels.Add(hierarchyLevel2); + + ContentMetadataKeyHierarchy contentMetadataKeyHierarchy = new ContentMetadataKeyHierarchy(); + contentMetadataKeyHierarchy.name = "Content hierarchy #" + new Random().Next(int.MaxValue); + contentMetadataKeyHierarchy.hierarchyLevels = hierarchyLevels.ToArray(); + + try { + // Create the content metadata key hierarchy on the server. + ContentMetadataKeyHierarchy[] contentMetadataKeyHierarchies = + contentMetadataKeyHierarchyService.createContentMetadataKeyHierarchies( + new ContentMetadataKeyHierarchy[] {contentMetadataKeyHierarchy}); + + foreach (ContentMetadataKeyHierarchy createdContentMetadataKeyHierarchy in + contentMetadataKeyHierarchies) { + Console.WriteLine("A content metadata key hierarchy with ID \"{0}\", name " + + "\"{1}\" and {2} levels was created.", createdContentMetadataKeyHierarchy.id, + createdContentMetadataKeyHierarchy.name, + createdContentMetadataKeyHierarchy.hierarchyLevels.Length); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create content metadata key hierarchies. Exception says " + + "\"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ContentMetadataKeyHierarchyService/DeleteContentMetadataKeyHierarchies.cs b/examples/Dfp/CSharp/v201405/ContentMetadataKeyHierarchyService/DeleteContentMetadataKeyHierarchies.cs new file mode 100644 index 00000000000..9629c7c833d --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ContentMetadataKeyHierarchyService/DeleteContentMetadataKeyHierarchies.cs @@ -0,0 +1,104 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This example deletes a content metadata key hierarchy. To determine + /// which content metadata key hierarchies exist, run + /// GetAllContentMetadataKeyHierarchies.cs. + /// + /// Tags: ContentMetadataKeyHierarchyService.getContentMetadataKeyHierarchiesByStatement + /// Tags: ContentMetadataKeyHierarchyService.performContentMetadataKeyHierarchyAction + /// + class DeleteContentMetadataKeyHierarchies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example deletes a content metadata key hierarchy. To determine " + + "which content metadata key hierarchies exist, run " + + "GetAllContentMetadataKeyHierarchies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomTargetingKeysAndValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(Lib.DfpUser user) { + // Get the ContentMetadataKeyHierarchy service. + ContentMetadataKeyHierarchyService contentMetadataKeyHierarchyService = + (ContentMetadataKeyHierarchyService) user.GetService( + DfpService.v201405.ContentMetadataKeyHierarchyService); + + // Set the ID of the content metadata key hierarchy to delete. + long contentMetadataKeyHierarchyId = + long.Parse(_T("INSERT_CONTENT_METADATA_KEY_HIERARCHY_ID_HERE")); + + // Create a statement to select a content metadata key hierarchy. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("WHERE id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", contentMetadataKeyHierarchyId); + + try { + // Get content metadata key hierarchies by statement. + ContentMetadataKeyHierarchyPage page = contentMetadataKeyHierarchyService + .getContentMetadataKeyHierarchiesByStatement(statementBuilder.ToStatement()); + + ContentMetadataKeyHierarchy contentMetadataKeyHierarchy = page.results[0]; + + Console.WriteLine("Content metadata key hierarchy with ID \"{0}\" will be deleted.", + contentMetadataKeyHierarchy.id); + + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + Google.Api.Ads.Dfp.v201405.DeleteContentMetadataKeyHierarchies action = + new Google.Api.Ads.Dfp.v201405.DeleteContentMetadataKeyHierarchies(); + + // Perform action. + UpdateResult result = contentMetadataKeyHierarchyService + .performContentMetadataKeyHierarchyAction(action, statementBuilder.ToStatement()); + + Console.WriteLine("Number of content metadata key hierarchies deleted: {0}", + result.numChanges); + } catch (Exception ex) { + Console.WriteLine("Failed to delete content metadata key hierarchies. " + + "Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ContentMetadataKeyHierarchyService/GetAllContentMetadataKeyHierarchies.cs b/examples/Dfp/CSharp/v201405/ContentMetadataKeyHierarchyService/GetAllContentMetadataKeyHierarchies.cs new file mode 100644 index 00000000000..456fdca660c --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ContentMetadataKeyHierarchyService/GetAllContentMetadataKeyHierarchies.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all content metadata key hierarchies. To create + /// content metadata key hierarchies, run + /// CreateContentMetadataKeyHierarchies.cs. + /// + /// Tags: ContentMetadataKeyHierarchyService.getContentMetadataKeyHierarchiesByStatement + /// + class GetAllContentMetadataKeyHierarchies : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all content metadata key hierarchies. To create " + + "content metadata key hierarchies, run CreateContentMetadataKeyHierarchies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllContentMetadataKeyHierarchies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(Lib.DfpUser user) { + // Get the ContentMetadataKeyHierarchy service. + ContentMetadataKeyHierarchyService contentMetadataKeyHierarchyService = + (ContentMetadataKeyHierarchyService) user.GetService( + DfpService.v201405.ContentMetadataKeyHierarchyService); + + // Create a statement to get all content metadata key hierarchies + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + try { + int totalResultSetSize = 0; + do { + // Get content metadata key hierarchies by statement. + ContentMetadataKeyHierarchyPage page = contentMetadataKeyHierarchyService + .getContentMetadataKeyHierarchiesByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + totalResultSetSize = page.totalResultSetSize; + int i = page.startIndex; + foreach (ContentMetadataKeyHierarchy contentMetadataKeyHierarchy in page.results) { + Console.WriteLine("{0}) Content metadata key hierarchy with ID \"{1}\", " + + "and name \"{2}\" was found.", i++, contentMetadataKeyHierarchy.id, + contentMetadataKeyHierarchy.name); + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < totalResultSetSize); + Console.WriteLine("Number of results found: {0}", totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get content metadata key hierarchies. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ContentMetadataKeyHierarchyService/UpdateContentMetadataKeyHierarchies.cs b/examples/Dfp/CSharp/v201405/ContentMetadataKeyHierarchyService/UpdateContentMetadataKeyHierarchies.cs new file mode 100644 index 00000000000..567aa0eea4a --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ContentMetadataKeyHierarchyService/UpdateContentMetadataKeyHierarchies.cs @@ -0,0 +1,118 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + + /// + /// This example updates a content metadata key hierarchy by adding a hierarchy level. To + /// determine which content metadata key hierarchies exist, run + /// GetAllContentMetadataKeyHierarchies.cs. + /// + /// Tags: ContentMetadataKeyHierarchyService.getContentMetadataKeyHierarchiesByStatement + /// Tags: ContentMetadataKeyHierarchyService.updateContentMetadataKeyHierarchies + /// + class UpdateContentMetadataKeyHierarchies : SampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example updates a content metadata key hierarchy by adding a hierarchy " + + "level. To determine which content metadata key hierarchies exist, run " + + "GetAllContentMetadataKeyHierarchies.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateContentMetadataKeyHierarchies(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(Lib.DfpUser user) { + // Get the ContentMetadataKeyHierarchy service. + ContentMetadataKeyHierarchyService contentMetadataKeyHierarchyService = + (ContentMetadataKeyHierarchyService) user.GetService( + DfpService.v201405.ContentMetadataKeyHierarchyService); + + // Set the ID of the content metadata key hierarchy to update. + long contentMetadataKeyHierarchyId = + long.Parse(_T("INSERT_CONTENT_METADATA_KEY_HIERARCHY_ID_HERE")); + + // Set the ID of the custom targeting key to be added as a hierarchy level + long customTargetingKeyId = long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + + // Create a statement to get content metadata key hierarchies. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("WHERE id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", contentMetadataKeyHierarchyId); + + try { + ContentMetadataKeyHierarchyPage page = contentMetadataKeyHierarchyService + .getContentMetadataKeyHierarchiesByStatement(statementBuilder.ToStatement()); + + ContentMetadataKeyHierarchy contentMetadataKeyHierarchy = page.results[0]; + + // Update the content metadata key hierarchy by adding a hierarchy level. + ContentMetadataKeyHierarchyLevel[] hierarchyLevels = contentMetadataKeyHierarchy + .hierarchyLevels; + + ContentMetadataKeyHierarchyLevel hierarchyLevel = new ContentMetadataKeyHierarchyLevel(); + hierarchyLevel.customTargetingKeyId = customTargetingKeyId; + hierarchyLevel.hierarchyLevel = hierarchyLevels.Length + 1; + + List updatedHieratchyLevels = + new List(); + updatedHieratchyLevels.AddRange(hierarchyLevels); + updatedHieratchyLevels.Add(hierarchyLevel); + + contentMetadataKeyHierarchy.hierarchyLevels = updatedHieratchyLevels.ToArray(); + + // Update the content hierarchy on the server. + ContentMetadataKeyHierarchy[] contentMetadataKeyHierarchies = + contentMetadataKeyHierarchyService.updateContentMetadataKeyHierarchies( + new ContentMetadataKeyHierarchy[] {contentMetadataKeyHierarchy}); + + foreach (ContentMetadataKeyHierarchy updatedContentMetadataKeyHierarchy in + contentMetadataKeyHierarchies) { + Console.WriteLine("Content metadata key hierarchy with ID \"{0}\", name " + + "\"{1}\" was updated.", updatedContentMetadataKeyHierarchy.id, + updatedContentMetadataKeyHierarchy.name); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update content metadata key hierarchies. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ContentService/GetAllContent.cs b/examples/Dfp/CSharp/v201405/ContentService/GetAllContent.cs new file mode 100644 index 00000000000..c37d1bbd7ea --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ContentService/GetAllContent.cs @@ -0,0 +1,90 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all content. This feature is only available to DFP + /// premium solution networks. + /// + /// Tags: ContentService.getContentByStatement + /// + class GetAllContent : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all content. This feature is only available to DFP " + + "premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllContent(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContentService. + ContentService contentService = + (ContentService) user.GetService(DfpService.v201405.ContentService); + + // Create a statement to get all content. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + ContentPage page = new ContentPage(); + + try { + do { + // Get content by statement. + page = contentService.getContentByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (Content content in page.results) { + Console.WriteLine("{0}) Content with ID \"{1}\", name \"{2}\", and status \"{3}\" " + + "was found.", i, content.id, content.name, content.status); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all content. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ContentService/GetContentByCategory.cs b/examples/Dfp/CSharp/v201405/ContentService/GetContentByCategory.cs new file mode 100644 index 00000000000..4c63f83c25c --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ContentService/GetContentByCategory.cs @@ -0,0 +1,128 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all active content categorized as "comedy" using + /// the network's content browse custom targeting key. This feature is only + /// available to DFP video publishers. + /// + /// Tags: NetworkService.getCurrentNetwork + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// Tags: ContentService.getContentByStatementAndCustomTargetingValue + /// /// + class GetContentByCategory : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active content categorized as 'comedy' using the " + + "network's content browse custom targeting key. This feature is only available to " + + "DFP video publishers."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetContentByCategory(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ContentService. + ContentService contentService = + (ContentService) user.GetService(DfpService.v201405.ContentService); + + // Get the NetworkService. + NetworkService networkService = (NetworkService) user.GetService( + DfpService.v201405.NetworkService); + + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = (CustomTargetingService) user.GetService( + DfpService.v201405.CustomTargetingService); + + try { + // Get content browse custom targeting key ID. + long contentBrowseCustomTargetingKeyId = + networkService.getCurrentNetwork().contentBrowseCustomTargetingKeyId; + + // Create a statement to select the categories matching the name comedy. + Statement categoryFilterStatement = new StatementBuilder() + .Where("customTargetingKeyId = :contentBrowseCustomTargetingKeyId " + + " and name = :category") + .OrderBy("id ASC") + .Limit(1) + .AddValue("contentBrowseCustomTargetingKeyId", contentBrowseCustomTargetingKeyId) + .AddValue("category", "comedy") + .ToStatement(); + + // Get categories matching the filter statement. + CustomTargetingValuePage customTargetingValuePage = + customTargetingService.getCustomTargetingValuesByStatement(categoryFilterStatement); + + if (customTargetingValuePage.results != null) { + // Get the custom targeting value ID for the comedy category. + long categoryCustomTargetingValueId = customTargetingValuePage.results[0].id; + + // Create a statement to get all active content. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("status = :status") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("status", "ACTIVE"); + + // Set defaults for page and filterStatement. + ContentPage page = new ContentPage(); + + do { + // Get content by statement. + page = contentService.getContentByStatementAndCustomTargetingValue( + statementBuilder.ToStatement(), categoryCustomTargetingValueId); + + if (page.results != null) { + int i = page.startIndex; + foreach (Content content in page.results) { + Console.WriteLine("{0}) Content with ID \"{1}\", name \"{2}\", and status " + + "\"{3}\" was found.", i, content.id, content.name, content.status); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get content by category. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CreativeService/CopyImageCreatives.cs b/examples/Dfp/CSharp/v201405/CreativeService/CopyImageCreatives.cs new file mode 100644 index 00000000000..10f7c14a9ca --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CreativeService/CopyImageCreatives.cs @@ -0,0 +1,111 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates a copy of an image creative. This would + /// typically be done to reuse creatives in a small business network. To + /// determine which creatives exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// Tags: CreativeService.createCreatives + /// + class CopyImageCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a copy of an image creative. This would typically be" + + " done to reuse creatives in a small business network. To determine which creatives " + + "exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CopyImageCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201405.CreativeService); + + long creativeId = long.Parse(_T("INSERT_IMAGE_CREATIVE_ID_HERE")); + + // Create a statement to get the image creative. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("id", creativeId); + + try { + // Get the creative. + CreativePage page = creativeService.getCreativesByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + ImageCreative imageCreative = (ImageCreative) page.results[0]; + // Since we cannot set id to null, we mark it as not specified. + imageCreative.idSpecified = false; + + imageCreative.advertiserId = imageCreative.advertiserId; + imageCreative.name = imageCreative.name + " (Copy #" + GetTimeStamp() + ")"; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + imageCreative.primaryImageAsset.assetUrl); + + creativeAsset.size = imageCreative.primaryImageAsset.size; + imageCreative.primaryImageAsset = creativeAsset; + + // Create the copied creative. + Creative[] creatives = creativeService.createCreatives(new Creative[] {imageCreative}); + + // Display copied creatives. + foreach (Creative copiedCreative in creatives) { + Console.WriteLine("Image creative with ID \"{0}\", name \"{1}\", and type \"{2}\" " + + "was created and can be previewed at {3}", copiedCreative.id, copiedCreative.name, + copiedCreative.CreativeType, copiedCreative.previewUrl); + } + } else { + Console.WriteLine("No creatives were copied."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to copy creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CreativeService/CreateCreativeFromTemplate.cs b/examples/Dfp/CSharp/v201405/CreativeService/CreateCreativeFromTemplate.cs new file mode 100644 index 00000000000..86a31f97147 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CreativeService/CreateCreativeFromTemplate.cs @@ -0,0 +1,138 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates a new template creative for a given advertiser. + /// To determine which companies are advertisers, run + /// GetCompaniesByStatement.cs. To determine which creatives already exist, + /// run GetAllCreatives.cs. To determine which creative templates exist, run + /// GetAllCreativeTemplates.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCreativeFromTemplate : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new template creative for a given advertiser. To " + + "determine which companies are advertisers, run GetCompaniesByStatement.cs. To " + + "determine which creatives already exist, run GetAllCreatives.cs. To determine " + + "which creative templates exist, run GetAllCreativeTemplates.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreativeFromTemplate(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201405.CreativeService); + + // Set the ID of the advertiser (company) that all creative will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Use the image banner with optional third party tracking template. + long creativeTemplateId = 10000680L; + + // Create the local custom creative object. + TemplateCreative templateCreative = new TemplateCreative(); + templateCreative.name = "Template creative"; + templateCreative.advertiserId = advertiserId; + templateCreative.creativeTemplateId = creativeTemplateId; + + // Set the creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + templateCreative.size = size; + + // Create the asset variable value. + AssetCreativeTemplateVariableValue assetVariableValue = + new AssetCreativeTemplateVariableValue(); + assetVariableValue.uniqueName = "Imagefile"; + assetVariableValue.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + assetVariableValue.fileName = String.Format("image{0}.jpg", this.GetTimeStamp()); + + // Create the image width variable value. + LongCreativeTemplateVariableValue imageWidthVariableValue = + new LongCreativeTemplateVariableValue(); + imageWidthVariableValue.uniqueName = "Imagewidth"; + imageWidthVariableValue.value = 300; + + // Create the image height variable value. + LongCreativeTemplateVariableValue imageHeightVariableValue = + new LongCreativeTemplateVariableValue(); + imageHeightVariableValue.uniqueName = "Imageheight"; + imageHeightVariableValue.value = 250; + + // Create the URL variable value. + UrlCreativeTemplateVariableValue urlVariableValue = new UrlCreativeTemplateVariableValue(); + urlVariableValue.uniqueName = "ClickthroughURL"; + urlVariableValue.value = "www.google.com"; + + // Create the target window variable value. + StringCreativeTemplateVariableValue targetWindowVariableValue = + new StringCreativeTemplateVariableValue(); + targetWindowVariableValue.uniqueName = "Targetwindow"; + targetWindowVariableValue.value = "_blank"; + + templateCreative.creativeTemplateVariableValues = new BaseCreativeTemplateVariableValue[] { + assetVariableValue, imageWidthVariableValue, imageHeightVariableValue, urlVariableValue, + targetWindowVariableValue}; + + try { + // Create the template creative on the server. + Creative[] createdTemplateCreatives = creativeService.createCreatives( + new Creative[] {templateCreative}); + + foreach (Creative createdTemplateCreative in createdTemplateCreatives) { + Console.WriteLine("A template creative with ID \"{0}\", name \"{1}\", and type " + + "\"{2}\" was created and can be previewed at {3}", createdTemplateCreative.id, + createdTemplateCreative.name, createdTemplateCreative.CreativeType, + createdTemplateCreative.previewUrl); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CreativeService/CreateCreatives.cs b/examples/Dfp/CSharp/v201405/CreativeService/CreateCreatives.cs new file mode 100644 index 00000000000..39668f3c9f4 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CreativeService/CreateCreatives.cs @@ -0,0 +1,120 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates new image creatives for a given advertiser. To + /// determine which companies are advertisers, run GetCompaniesByStatement.cs. + /// To determine which creatives already exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new image creatives for a given advertiser. To " + + "determine which companies are advertisers, run GetCompaniesByStatement.cs. " + + "To determine which creatives already exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201405.CreativeService); + + // Set the ID of the advertiser (company) that all creatives will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_COMPANY_ID_HERE")); + + // Create an array to store local image creative objects. + Creative[] imageCreatives = new ImageCreative[5]; + + for (int i = 0; i < 5; i++) { + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", i); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + imageCreatives[i] = imageCreative; + } + + try { + // Create the image creatives on the server. + imageCreatives = creativeService.createCreatives(imageCreatives); + + if (imageCreatives != null) { + foreach (Creative creative in imageCreatives) { + // Use "is" operator to determine what type of creative was + // returned. + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + Console.WriteLine("An image creative with ID ='{0}', name ='{1}' and size = " + + "({2},{3}) was created and can be previewed at: {4}", imageCreative.id, + imageCreative.name, imageCreative.size.width, imageCreative.size.height, + imageCreative.previewUrl); + } else { + Console.WriteLine("A creative with ID ='{0}', name='{1}' and type='{2}' was created.", + creative.id, creative.name, creative.CreativeType); + } + } + } else { + Console.WriteLine("No creatives created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CreativeService/CreateCustomCreative.cs b/examples/Dfp/CSharp/v201405/CreativeService/CreateCustomCreative.cs new file mode 100644 index 00000000000..fcf0aa2d51f --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CreativeService/CreateCustomCreative.cs @@ -0,0 +1,110 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates a custom creative for a given advertiser. To + /// determine which companies are advertisers, run GetCompaniesByStatement.cs. + /// To determine which creatives already exist, run GetAllCreatives.cs. + /// + /// Tags: CreativeService.createCreatives + /// + class CreateCustomCreative : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a custom creative for a given advertiser. To determine " + + "which companies are advertisers, run GetCompaniesByStatement.cs. To determine which " + + "creatives already exist, run GetAllCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomCreative(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201405.CreativeService); + + // Set the ID of the advertiser (company) that all creatives will be + // assigned to. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + + // Create the local custom creative object. + CustomCreative customCreative = new CustomCreative(); + customCreative.name = "Custom creative " + GetTimeStamp(); + customCreative.advertiserId = advertiserId; + customCreative.destinationUrl = "http://google.com"; + + // Set the custom creative image asset. + CustomCreativeAsset customCreativeAsset = new CustomCreativeAsset(); + customCreativeAsset.macroName = "IMAGE_ASSET"; + customCreativeAsset.fileName = string.Format("inline{0}.jpg", GetTimeStamp()); + customCreativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + customCreative.customCreativeAssets = new CustomCreativeAsset[] {customCreativeAsset}; + + // Set the HTML snippet using the custom creative asset macro. + customCreative.htmlSnippet = "" + + "" + + "
Click above for great deals!"; + + // Set the creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + customCreative.size = size; + + try { + // Create the custom creative on the server. + Creative[] createdCreatives = creativeService.createCreatives( + new Creative[] {customCreative}); + + foreach (Creative createdCreative in createdCreatives) { + Console.WriteLine("A custom creative with ID \"{0}\", name \"{1}\", and size ({2}, " + + "{3}) was created and can be previewed at {4}", createdCreative.id, + createdCreative.name, createdCreative.size.width, createdCreative.size.height, + createdCreative.previewUrl); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CreativeService/GetAllCreatives.cs b/examples/Dfp/CSharp/v201405/CreativeService/GetAllCreatives.cs new file mode 100644 index 00000000000..4a3dcc4ca83 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CreativeService/GetAllCreatives.cs @@ -0,0 +1,90 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all creatives. To create creatives, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// + class GetAllCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all creatives. To create creatives, run CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201405.CreativeService); + + // Create a Statement to get all creatives. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + CreativePage page = new CreativePage(); + + try { + do { + // Get creatives by Statement. + page = creativeService.getCreativesByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Creative creative in page.results) { + Console.WriteLine("{0}) Creative with ID ='{1}', name ='{2}' and type ='{3}' " + + "was found.", i, creative.id, creative.name, creative.CreativeType); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CreativeService/GetCreativesByStatement.cs b/examples/Dfp/CSharp/v201405/CreativeService/GetCreativesByStatement.cs new file mode 100644 index 00000000000..2626bb6c51d --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CreativeService/GetCreativesByStatement.cs @@ -0,0 +1,93 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all image creatives. To create an image creative, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// + class GetCreativesByStatement : SampleBase { + /// + /// Returns a description about the sample code. + /// + public override string Description { + get { + return "This code example gets all image creatives. To create an image creative, run " + + "CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201405.CreativeService); + + // Create a Statement to only select image creatives. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("creativeType = :creativeType") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("creativeType", "ImageCreative"); + + // Set default for page. + CreativePage page = new CreativePage(); + + try { + do { + // Get creatives by Statement. + page = creativeService.getCreativesByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Creative creative in page.results) { + Console.WriteLine("{0}) Creative with ID ='{1}', name ='{2}' and type ='{3}' " + + "was found.", i, creative.id, creative.name, creative.CreativeType); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get creatives by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CreativeService/UpdateCreatives.cs b/examples/Dfp/CSharp/v201405/CreativeService/UpdateCreatives.cs new file mode 100644 index 00000000000..e6bbee44b03 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CreativeService/UpdateCreatives.cs @@ -0,0 +1,98 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example updates image creatives. To create an image creative, run + /// CreateCreatives.cs. + /// + /// Tags: CreativeService.getCreativesByStatement + /// Tags: CreativeService.updateCreatives + /// + class UpdateCreatives : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates image creatives. To create an image creative, run " + + "CreateCreatives.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCreatives(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CreativeService creativeService = + (CreativeService) user.GetService(DfpService.v201405.CreativeService); + + // Set the ID of the creative to update. + int creativeId = int.Parse(_T("INSERT_CREATIVE_ID_HERE")); + + // Create a Statement to get all image creatives. + Statement statement = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", creativeId).ToStatement(); + + try { + // Get creatives by Statement. + CreativePage page = creativeService.getCreativesByStatement(statement); + + Creative creative = page.results[0]; + + // Update local creative object by changing its destination URL. + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) creative; + imageCreative.destinationUrl = "http://news.google.com"; + } + + // Update the creatives on the server. + Creative[] creatives = creativeService.updateCreatives(new Creative[] { creative }); + + foreach (Creative updatedCreative in creatives) { + if (creative is ImageCreative) { + ImageCreative imageCreative = (ImageCreative) updatedCreative; + Console.WriteLine("An image creative with ID = '{0}' and destination URL ='{1}' " + + "was updated.", imageCreative.id, imageCreative.destinationUrl); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to update creatives. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CreativeTemplateService/GetAllCreativeTemplates.cs b/examples/Dfp/CSharp/v201405/CreativeTemplateService/GetAllCreativeTemplates.cs new file mode 100644 index 00000000000..9050430323b --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CreativeTemplateService/GetAllCreativeTemplates.cs @@ -0,0 +1,93 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all creative templates. + /// + /// Tags: CreativeTemplateService.getCreativeTemplatesByStatement + /// + class GetAllCreativeTemplates : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all creative templates."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreativeTemplates(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201405.CreativeTemplateService); + + // Create a statement to get all creative templates. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + CreativeTemplatePage page = new CreativeTemplatePage(); + + try { + do { + // Get creative templates by statement. + page = creativeTemplateService.getCreativeTemplatesByStatement( + statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (CreativeTemplate creativeTemplate in page.results) { + Console.WriteLine("{0}) Creative template with ID \"{1}\", name \"{2}\", and type " + + "\"{3}\" was found.", i, creativeTemplate.id, creativeTemplate.name, + creativeTemplate.type); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CreativeTemplateService/GetCreativeTemplatesByStatement.cs b/examples/Dfp/CSharp/v201405/CreativeTemplateService/GetCreativeTemplatesByStatement.cs new file mode 100644 index 00000000000..c9bbd71bfe0 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CreativeTemplateService/GetCreativeTemplatesByStatement.cs @@ -0,0 +1,93 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all the system defined creative templates. + /// + /// Tags: CreativeTemplateService.getCreativeTemplatesByStatement + /// + class GetCreativeTemplatesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all the system defined creative templates."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCreativeTemplatesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeTemplateService. + CreativeTemplateService creativeTemplateService = + (CreativeTemplateService) user.GetService(DfpService.v201405.CreativeTemplateService); + + // Create a statement to only select system defined creative templates. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("type = :creativeTemplateType") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("creativeTemplateType", CreativeTemplateType.SYSTEM_DEFINED.ToString()); + + // Set default for page. + CreativeTemplatePage page = new CreativeTemplatePage(); + + try { + do { + // Get creative templates by statement. + page = creativeTemplateService.getCreativeTemplatesByStatement( + statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (CreativeTemplate creativeTemplate in page.results) { + Console.WriteLine("{0}) Creative template with ID \"{1}\", name \"{2}\", and type " + + "\"{3}\" was found.", i, creativeTemplate.id, creativeTemplate.name, + creativeTemplate.type); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get creative templates. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CreativeWrapperService/CreateCreativeWrappers.cs b/examples/Dfp/CSharp/v201405/CreativeWrapperService/CreateCreativeWrappers.cs new file mode 100644 index 00000000000..a81838b5a99 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CreativeWrapperService/CreateCreativeWrappers.cs @@ -0,0 +1,89 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates a new creative wrapper. Creative wrappers must + /// be associated with a LabelType.CREATIVE_WRAPPER label and applied to ad + /// units by AdUnit.appliedLabels. To determine which creative wrappers exist, + /// run GetAllCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.createCreativeWrappers + /// + class CreateCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new creative wrapper. Creative wrappers must be " + + "associated with a LabelType.CREATIVE_WRAPPER label and applied to ad units by " + + "AdUnit.appliedLabels. To determine which creative wrappers exist, run " + + "GetAllCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201405.CreativeWrapperService); + + long labelId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE")); + + // Create creative wrapper objects. + CreativeWrapper creativeWrapper = new CreativeWrapper(); + creativeWrapper.labelId = labelId; + creativeWrapper.ordering = CreativeWrapperOrdering.INNER; + creativeWrapper.header = new CreativeWrapperHtmlSnippet(); + creativeWrapper.header.htmlSnippet = "My creative wrapper header"; + creativeWrapper.footer = new CreativeWrapperHtmlSnippet(); + creativeWrapper.footer.htmlSnippet = "My creative wrapper footer"; + + try { + // Add creative wrapper. + CreativeWrapper[] creativeWrappers = creativeWrapperService.createCreativeWrappers( + new CreativeWrapper[] {creativeWrapper}); + + // Display results. + foreach (CreativeWrapper wrapper in creativeWrappers) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' was " + + "created.", wrapper.id, wrapper.labelId); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create creative wrappers. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CreativeWrapperService/DeactivateCreativeWrappers.cs b/examples/Dfp/CSharp/v201405/CreativeWrapperService/DeactivateCreativeWrappers.cs new file mode 100644 index 00000000000..152094c9c5f --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CreativeWrapperService/DeactivateCreativeWrappers.cs @@ -0,0 +1,111 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example deactivates all creative wrappers belonging to a label. + /// + /// Tags: CreativeWrapperService.getCreativeWrapperByStatement + /// Tags: CreativeWrapperService.performCreativeWrapperAction + /// + class DeActivateCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all creative wrappers belonging to a label."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeActivateCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201405.CreativeWrapperService); + + long labelId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE")); + + try { + // Create a query to select the active creative wrapper for the given + // label. + StatementBuilder statementBuilder = new StatementBuilder() + .Where ("labelId = :labelId AND status = :status") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("status", CreativeWrapperStatus.ACTIVE.ToString()) + .AddValue("labelId", labelId); + + // Set default for page. + CreativeWrapperPage page = new CreativeWrapperPage(); + + do { + page = + creativeWrapperService.getCreativeWrappersByStatement(statementBuilder.ToStatement()); + CreativeWrapper[] creativeWrappers = page.results; + if (creativeWrappers != null) { + foreach (CreativeWrapper wrapper in creativeWrappers) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' with " + + "status \'{2}\' will be deactivated.", wrapper.id, wrapper.labelId, + wrapper.status); + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of creative wrappers to be deactivated: {0}", + page.totalResultSetSize); + + // Modify statement for action. + statementBuilder.RemoveLimitAndOffset(); + + // Perform action. + CreativeWrapperAction action = new DeactivateCreativeWrappers(); + UpdateResult result = creativeWrapperService.performCreativeWrapperAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result.numChanges > 0) { + Console.WriteLine("Number of creative wrappers deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No creative wrappers were deactivated."); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to create creative wrappers. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CreativeWrapperService/GetActiveCreativeWrappers.cs b/examples/Dfp/CSharp/v201405/CreativeWrapperService/GetActiveCreativeWrappers.cs new file mode 100644 index 00000000000..f5015704284 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CreativeWrapperService/GetActiveCreativeWrappers.cs @@ -0,0 +1,95 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; +using Google.Api.Ads.Dfp.Util.v201405; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all active creative wrappers. To create + /// creative wrappers, run CreateCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.getCreativeWrapperByStatement + /// + class GetActiveCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active creative wrappers. To create creative " + + "wrappers, run CreateCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetActiveCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201405.CreativeWrapperService); + + // Create a Statement to get all active creative wrappers. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("status = :status") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("status", CreativeWrapperStatus.ACTIVE.ToString()); + + // Set default for page. + CreativeWrapperPage page = new CreativeWrapperPage(); + + try { + do { + // Get creative wrappers by Statement. + page = creativeWrapperService.getCreativeWrappersByStatement( + statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (CreativeWrapper wrapper in page.results) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' with " + + "status \'{2}\' was found.", wrapper.id, wrapper.labelId, wrapper.status); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get active creative wrappers. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CreativeWrapperService/GetAllCreativeWrappers.cs b/examples/Dfp/CSharp/v201405/CreativeWrapperService/GetAllCreativeWrappers.cs new file mode 100644 index 00000000000..025dae3a655 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CreativeWrapperService/GetAllCreativeWrappers.cs @@ -0,0 +1,92 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all creative wrappers. To create creative wrappers, + /// run CreateCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.getCreativeWrapperByStatement + /// + class GetAllCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active creative wrappers. To create creative " + + "wrappers, run CreateCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201405.CreativeWrapperService); + + // Set defaults for page and Statement. + CreativeWrapperPage page = new CreativeWrapperPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all creative wrappers. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get creative wrappers by Statement. + page = creativeWrapperService.getCreativeWrappersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (CreativeWrapper wrapper in page.results) { + Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' with " + + "status \'{2}\' was found.", wrapper.id, wrapper.labelId, wrapper.status); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get active creative wrappers. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CreativeWrapperService/UpdateCreativeWrappers.cs b/examples/Dfp/CSharp/v201405/CreativeWrapperService/UpdateCreativeWrappers.cs new file mode 100644 index 00000000000..0a32cacdc81 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CreativeWrapperService/UpdateCreativeWrappers.cs @@ -0,0 +1,90 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; +using Google.Api.Ads.Dfp.Util.v201405; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example updates a creative wrapper to the 'OUTER' wrapping + /// order. To determine which creative wrappers exist, run + /// GetAllCreativeWrappers.cs. + /// + /// Tags: CreativeWrapperService.getCreativeWrappersByStatement + /// Tags: CreativeWrapperService.updateCreativeWrappers + /// + class UpdateCreativeWrappers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active creative wrappers. To create creative " + + "wrappers, run CreateCreativeWrappers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCreativeWrappers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Create the CreativeWrapperService. + CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService( + DfpService.v201405.CreativeWrapperService); + + long creativeWrapperId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_ID_HERE")); + + try { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", creativeWrapperId); + CreativeWrapperPage page = creativeWrapperService.getCreativeWrappersByStatement( + statementBuilder.ToStatement()); + CreativeWrapper wrapper = page.results[0]; + + wrapper.ordering = CreativeWrapperOrdering.OUTER; + // Update the creative wrappers on the server. + CreativeWrapper[] creativeWrappers = creativeWrapperService.updateCreativeWrappers( + new CreativeWrapper[] {wrapper}); + + // Display results. + foreach (CreativeWrapper createdCreativeWrapper in creativeWrappers) { + Console.WriteLine("Creative wrapper with ID '{0}' and wrapping order '{1}' was " + + "updated.", createdCreativeWrapper.id, createdCreativeWrapper.ordering); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update creative wrappers. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CustomFieldService/CreateCustomFieldOptions.cs b/examples/Dfp/CSharp/v201405/CustomFieldService/CreateCustomFieldOptions.cs new file mode 100644 index 00000000000..e36e02d6132 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CustomFieldService/CreateCustomFieldOptions.cs @@ -0,0 +1,97 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates custom field options for a drop-down custom + /// field. Once created, custom field options can be found under the options + /// fields of the drop-down custom field and they cannot be deleted. To + /// determine which custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.createCustomFieldOptions + /// + class CreateCustomFieldOptions : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates custom field options for a drop-down custom field. " + + "Once created, custom field options can be found under the options fields of the " + + "drop-down custom field and they cannot be deleted. To determine which custom " + + "fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomFieldOptions(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = + (CustomFieldService) user.GetService(DfpService.v201405.CustomFieldService); + + // Set the ID of the drop-down custom field to create options for. + long customFieldId = long.Parse(_T("INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE")); + + // Create custom field options. + CustomFieldOption customFieldOption1 = new CustomFieldOption(); + customFieldOption1.displayName = "Approved"; + customFieldOption1.customFieldId = customFieldId; + + CustomFieldOption customFieldOption2 = new CustomFieldOption(); + customFieldOption2.displayName = "Unapproved"; + customFieldOption2.customFieldId = customFieldId; + + try { + // Add custom field options. + CustomFieldOption[] customFieldOptions = + customFieldService.createCustomFieldOptions(new CustomFieldOption[] {customFieldOption1, + customFieldOption2}); + + // Display results. + if (customFieldOptions != null) { + foreach (CustomFieldOption customFieldOption in customFieldOptions) { + Console.WriteLine("Custom field option with ID \"{0}\" and name \"{1}\" was created.", + customFieldOption.id, customFieldOption.displayName); + } + } else { + Console.WriteLine("No custom field options created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom field options. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CustomFieldService/CreateCustomFields.cs b/examples/Dfp/CSharp/v201405/CustomFieldService/CreateCustomFields.cs new file mode 100644 index 00000000000..e793b672bd1 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CustomFieldService/CreateCustomFields.cs @@ -0,0 +1,92 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates custom fields. To determine which custom fields + /// exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.createCustomFields + /// + class CreateCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates custom fields. To determine which custom fields exist" + + ", run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201405.CustomFieldService); + + // Create custom fields. + CustomField customField1 = new CustomField(); + customField1.name = "Customer comments #" + GetTimeStamp(); + customField1.entityType = CustomFieldEntityType.LINE_ITEM; + customField1.dataType = CustomFieldDataType.STRING; + customField1.visibility = CustomFieldVisibility.FULL; + + CustomField customField2 = new CustomField(); + customField2.name = "Internal approval status #" + GetTimeStamp(); + customField2.entityType = CustomFieldEntityType.LINE_ITEM; + customField2.dataType = CustomFieldDataType.DROP_DOWN; + customField2.visibility = CustomFieldVisibility.FULL; + + try { + // Add custom fields. + CustomField[] customFields = + customFieldService.createCustomFields(new CustomField[] {customField1, customField2}); + + // Display results. + if (customFields != null) { + foreach (CustomField customField in customFields) { + Console.WriteLine("Custom field with ID \"{0}\" and name \"{1}\" was created.", + customField.id, customField.name); + } + } else { + Console.WriteLine("No custom fields created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CustomFieldService/DeactivateCustomFields.cs b/examples/Dfp/CSharp/v201405/CustomFieldService/DeactivateCustomFields.cs new file mode 100644 index 00000000000..ed29abb2230 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CustomFieldService/DeactivateCustomFields.cs @@ -0,0 +1,120 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example deactivates a custom field. To determine which custom fields exist, + /// run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// Tags: CustomFieldService.performCustomFieldAction + /// + class DeactivateCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates a custom field. To determine which custom fields " + + "exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201405.CustomFieldService); + + // Set the ID of the custom field to update. + int customFieldId = int.Parse(_T("INSERT_CUSTOM_FIELD_ID_HERE")); + + // Create statement to select only active custom fields that apply to + // line items. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", customFieldId); + + // Set default for page. + CustomFieldPage page = new CustomFieldPage(); + int i = 0; + List customFieldIds = new List(); + + try { + do { + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + foreach (CustomField customField in page.results) { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" will be " + + "deactivated.", i, customField.id, customField.name); + customFieldIds.Add(customField.id.ToString()); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of custom fields to be deactivated: " + customFieldIds.Count); + + if (customFieldIds.Count > 0) { + // Remove limit and offset from statement. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + Dfp.v201405.DeactivateCustomFields action = new Dfp.v201405.DeactivateCustomFields(); + + // Perform action. + UpdateResult result = customFieldService.performCustomFieldAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of custom fields deactivated: " + result.numChanges); + } else { + Console.WriteLine("No custom fields were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CustomFieldService/GetAllCustomFields.cs b/examples/Dfp/CSharp/v201405/CustomFieldService/GetAllCustomFields.cs new file mode 100644 index 00000000000..40003e393d4 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CustomFieldService/GetAllCustomFields.cs @@ -0,0 +1,107 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all custom fields. To create custom fields, run + /// CreateCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// Tags: CustomFieldService.performCustomFieldAction + /// + class GetAllCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom fields. To create custom fields, run " + + "CreateCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201405.CustomFieldService); + + // Create a statement to get all custom fields. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Sets default for page. + CustomFieldPage page = new CustomFieldPage(); + + try { + do { + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomField customField in page.results) { + if (customField is DropDownCustomField) { + List dropDownCustomFieldStrings = new List(); + DropDownCustomField dropDownCustomField = (DropDownCustomField) customField; + if (dropDownCustomField.options != null) { + foreach (CustomFieldOption customFieldOption in dropDownCustomField.options) { + dropDownCustomFieldStrings.Add(customFieldOption.displayName); + } + } + Console.WriteLine("{0}) Drop-down custom field with ID \"{1}\", name \"{2}\", " + + "and options {{{3}}} was found.", i, customField.id, customField.name, + string.Join(", ", dropDownCustomFieldStrings.ToArray())); + } else { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" was found.", + i, customField.id, customField.name); + } + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CustomFieldService/GetAllLineItemCustomFields.cs b/examples/Dfp/CSharp/v201405/CustomFieldService/GetAllLineItemCustomFields.cs new file mode 100644 index 00000000000..9097a14aa70 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CustomFieldService/GetAllLineItemCustomFields.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all custom fields that apply to line items. To + /// create custom fields, run CreateCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// + class GetAllLineItemCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom fields that apply to line items. To create " + + "custom fields, run CreateCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLineItemCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201405.CustomFieldService); + + // Create statement to select only custom fields that apply to line items. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("entityType = :entityType") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("entityType", CustomFieldEntityType.LINE_ITEM.ToString()); + + // Set default for page. + CustomFieldPage page = new CustomFieldPage(); + int i = 0; + + try { + do { + // Get custom fields by statement. + page = customFieldService.getCustomFieldsByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + foreach (CustomField customField in page.results) { + Console.WriteLine("{0}) Custom field with ID \"{1}\" and name \"{2}\" was found.", i, + customField.id, customField.name); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all line item custom fields. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CustomFieldService/SetLineItemCustomFieldValue.cs b/examples/Dfp/CSharp/v201405/CustomFieldService/SetLineItemCustomFieldValue.cs new file mode 100644 index 00000000000..10b1fdf0a4f --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CustomFieldService/SetLineItemCustomFieldValue.cs @@ -0,0 +1,152 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; +using Google.Api.Ads.Dfp.Util.v201405; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example sets custom field values on a line item. To determine + /// which custom fields exist, run GetAllCustomFields.cs. To create custom + /// field options, run CreateCustomFieldOptions.cs. To determine which line + /// items exist, run GetAllLineItems.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.updateLineItems + /// + class SetLineItemCustomFieldValue : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example sets custom field values on a line item. To determine which " + + "custom fields exist, run GetAllCustomFields.cs. To create custom field options, " + + "run CreateCustomFieldOptions.cs. To determine which line items exist, run " + + "GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new SetLineItemCustomFieldValue(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201405.CustomFieldService); + + // Get the LineItemService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201405.LineItemService); + + // Set the IDs of the custom fields, custom field option, and line item. + long customFieldId = long.Parse(_T("INSERT_STRING_CUSTOM_FIELD_ID_HERE")); + long customFieldOptionId = long.Parse(_T("INSERT_CUSTOM_FIELD_OPTION_ID_HERE")); + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get the drop-down custom field id. + long dropDownCustomFieldId = + customFieldService.getCustomFieldOption(customFieldOptionId).customFieldId; + + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", lineItemId); + + // Get the line item. + LineItemPage lineItemPage = lineItemService.getLineItemsByStatement( + statementBuilder.ToStatement()); + LineItem lineItem = lineItemPage.results[0]; + + // Create custom field values. + List customFieldValues = new List(); + TextValue textValue = new TextValue(); + textValue.value = "Custom field value"; + + CustomFieldValue customFieldValue = new CustomFieldValue(); + customFieldValue.customFieldId = customFieldId; + customFieldValue.value = textValue; + customFieldValues.Add(customFieldValue); + + DropDownCustomFieldValue dropDownCustomFieldValue = new DropDownCustomFieldValue(); + dropDownCustomFieldValue.customFieldId = dropDownCustomFieldId; + dropDownCustomFieldValue.customFieldOptionId = customFieldOptionId; + customFieldValues.Add(dropDownCustomFieldValue); + + // Only add existing custom field values for different custom fields than + // the ones you are setting. + if (lineItem.customFieldValues != null) { + foreach (BaseCustomFieldValue oldCustomFieldValue in lineItem.customFieldValues) { + if (!(oldCustomFieldValue.customFieldId == customFieldId) + && !(oldCustomFieldValue.customFieldId == dropDownCustomFieldId)) { + customFieldValues.Add(oldCustomFieldValue); + } + } + } + + lineItem.customFieldValues = customFieldValues.ToArray(); + + // Update the line item on the server. + LineItem[] lineItems = lineItemService.updateLineItems(new LineItem[] {lineItem}); + + if (lineItems != null) { + foreach (LineItem updatedLineItem in lineItems) { + List customFieldValueStrings = new List(); + foreach (BaseCustomFieldValue baseCustomFieldValue in lineItem.customFieldValues) { + if (baseCustomFieldValue is CustomFieldValue + && ((CustomFieldValue) baseCustomFieldValue).value is TextValue) { + customFieldValueStrings.Add("{ID: '" + baseCustomFieldValue.customFieldId + + "', value: '" + + ((TextValue) ((CustomFieldValue) baseCustomFieldValue).value).value + + "'}"); + } else if (baseCustomFieldValue is DropDownCustomFieldValue) { + customFieldValueStrings.Add("{ID: '" + baseCustomFieldValue.customFieldId + + "', custom field option ID: '" + + ((DropDownCustomFieldValue) baseCustomFieldValue).customFieldOptionId + + "'}"); + } + } + Console.WriteLine("A line item with ID \"{0}\" set with custom field values \"{1}\".", + updatedLineItem.id, string.Join(", ", customFieldValueStrings.ToArray())); + } + } else { + Console.WriteLine("No line items were updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CustomFieldService/UpdateCustomFields.cs b/examples/Dfp/CSharp/v201405/CustomFieldService/UpdateCustomFields.cs new file mode 100644 index 00000000000..d4006c65438 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CustomFieldService/UpdateCustomFields.cs @@ -0,0 +1,96 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; +using Google.Api.Ads.Dfp.Util.v201405; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example updates custom field descriptions. To determine which + /// custom fields exist, run GetAllCustomFields.cs. + /// + /// Tags: CustomFieldService.getCustomFieldsByStatement + /// Tags: CustomFieldService.updateCustomFields + /// + class UpdateCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates custom field descriptions. To determine which custom " + + "fields exist, run GetAllCustomFields.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomFieldService. + CustomFieldService customFieldService = (CustomFieldService) user.GetService( + DfpService.v201405.CustomFieldService); + + // Set the ID of the custom field to update. + long customFieldId = long.Parse(_T("INSERT_CUSTOM_FIELD_ID_HERE")); + + try { + // Get the custom field. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", customFieldId); + + CustomFieldPage page = customFieldService.getCustomFieldsByStatement( + statementBuilder.ToStatement()); + CustomField customField = page.results[0]; + + customField.description = + (customField.description == null ? "" : customField.description + " Updated"); + + // Update the custom field on the server. + CustomField[] customFields = + customFieldService.updateCustomFields(new CustomField[] {customField}); + + // Display results + foreach (CustomField updatedCustomField in customFields) { + Console.WriteLine("Custom field with ID \"{0}\", name \"{1}\", and description " + + "\"{2}\" was updated.", updatedCustomField.id, updatedCustomField.name, + updatedCustomField.description); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update custom fields. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs b/examples/Dfp/CSharp/v201405/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs new file mode 100644 index 00000000000..87072ccba44 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CustomTargetingService/CreateCustomTargetingKeysAndValues.cs @@ -0,0 +1,158 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates new custom targeting keys and values. To + /// determine which custom targeting keys and values exist, run + /// GetAllCustomTargetingKeysAndValues.cs. To target these custom targeting + /// keys and values, run TargetCustomCriteria.cs. + /// + /// Tags: CustomTargetingService.createCustomTargetingKeys + /// Tags: CustomTargetingService.createCustomTargetingValues + /// + class CreateCustomTargetingKeysAndValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new custom targeting keys and values. To determine " + + "which custom targeting keys and values exist, run " + + "GetAllCustomTargetingKeysAndValues.cs. To target these custom targeting keys and " + + "values, run TargetCustomCriteria.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateCustomTargetingKeysAndValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201405.CustomTargetingService); + + // Create predefined key. + CustomTargetingKey genderKey = new CustomTargetingKey(); + genderKey.displayName = "gender"; + genderKey.name = "g"; + genderKey.type = CustomTargetingKeyType.PREDEFINED; + + // Create predefined key that may be used for content targeting. + CustomTargetingKey genreKey = new CustomTargetingKey(); + genreKey.displayName = "genre"; + genreKey.name = "genre"; + genreKey.type = CustomTargetingKeyType.PREDEFINED; + + // Create free-form key. + CustomTargetingKey carModelKey = new CustomTargetingKey(); + carModelKey.displayName = "car model"; + carModelKey.name = "c"; + carModelKey.type = CustomTargetingKeyType.FREEFORM; + + try { + // Create the custom targeting keys on the server. + CustomTargetingKey[] keys = customTargetingService.createCustomTargetingKeys( + new CustomTargetingKey[] {genderKey, genreKey, carModelKey}); + + if (keys != null) { + foreach (CustomTargetingKey key in keys) { + Console.WriteLine("A custom targeting key with ID \"{0}\", name \"{1}\", and display " + + "name \"{2}\" was created.", key.id, key.name, key.displayName); + } + } else { + Console.WriteLine("No keys were created."); + } + + // Create custom targeting value for the predefined gender key. + CustomTargetingValue genderMaleValue = new CustomTargetingValue(); + genderMaleValue.customTargetingKeyId = keys[0].id; + genderMaleValue.displayName = "male"; + // Name is set to 1 so that the actual name can be hidden from website + // users. + genderMaleValue.name = "1"; + genderMaleValue.matchType = CustomTargetingValueMatchType.EXACT; + + CustomTargetingValue genderFemaleValue = new CustomTargetingValue(); + genderFemaleValue.customTargetingKeyId = keys[0].id; + genderFemaleValue.displayName = "female"; + // Name is set to 2 so that the actual name can be hidden from website + // users. + genderFemaleValue.name = "2"; + genderFemaleValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create custom targeting value for the predefined genre key. + CustomTargetingValue genreComedyValue = new CustomTargetingValue(); + genreComedyValue.customTargetingKeyId = keys[1].id; + genreComedyValue.displayName = "comedy"; + genreComedyValue.name = "comedy"; + genreComedyValue.matchType = CustomTargetingValueMatchType.EXACT; + + CustomTargetingValue genreDramaValue = new CustomTargetingValue(); + genreDramaValue.customTargetingKeyId = keys[1].id; + genreDramaValue.displayName = "drama"; + genreDramaValue.name = "drama"; + genreDramaValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create custom targeting value for the free-form age key. These are + // values that would be suggested in the UI or can be used when + // targeting with a FreeFormCustomCriteria. + CustomTargetingValue carModelHondaCivicValue = new CustomTargetingValue(); + carModelHondaCivicValue.customTargetingKeyId = keys[2].id; + carModelHondaCivicValue.displayName = "honda civic"; + carModelHondaCivicValue.name = "honda civic"; + // Setting match type to exact will match exactly "honda civic". + carModelHondaCivicValue.matchType = CustomTargetingValueMatchType.EXACT; + + // Create the custom targeting values on the server. + CustomTargetingValue[] returnValues = customTargetingService.createCustomTargetingValues( + new CustomTargetingValue[] {genderMaleValue, genderFemaleValue, genreComedyValue, + genreDramaValue, carModelHondaCivicValue}); + + if (returnValues != null) { + foreach (CustomTargetingValue value in returnValues) { + Console.WriteLine("A custom targeting value with ID \"{0}\", belonging to key with " + + "ID \"{1}\", name \"{2}\", and display name \"{3}\" was created.", value.id, + value.customTargetingKeyId, value.name, value.displayName); + } + } else { + Console.WriteLine("No values were created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create custom targeting keys and values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs b/examples/Dfp/CSharp/v201405/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs new file mode 100644 index 00000000000..5e4ff88cc78 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CustomTargetingService/GetAllCustomTargetingKeysAndValues.cs @@ -0,0 +1,123 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all custom targeting keys and the values. To create + /// custom targeting keys and values, run + /// CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// + class GetAllCustomTargetingKeysAndValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all custom targeting keys and the values. To create " + + "custom targeting keys and values, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllCustomTargetingKeysAndValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201405.CustomTargetingService); + + // Create a statement to get all custom targeting keys. + StatementBuilder keyStatementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + CustomTargetingKeyPage keyPage = new CustomTargetingKeyPage(); + + try { + do { + // Get custom targeting keys by statement. + keyPage = customTargetingService.getCustomTargetingKeysByStatement( + keyStatementBuilder.ToStatement()); + + if (keyPage.results != null) { + int i = keyPage.startIndex; + foreach (CustomTargetingKey key in keyPage.results) { + Console.WriteLine("{0}) Custom targeting key with ID \"{1}\", name \"{2}\", " + + "display name \"{3}\", and type \"{4}\" was found.", i, key.id, key.name, + key.displayName, key.type); + + // Create a statement to get all custom targeting values for a + // custom targeting key (required) by its ID. + StatementBuilder valueStatementBuilder = new StatementBuilder() + .Where("customTargetingKeyId = :customTargetingKeyId") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("customTargetingKeyId", key.id); + + // Set default for page. + CustomTargetingValuePage valuePage = new CustomTargetingValuePage(); + + do { + // Get custom targeting values by statement. + valuePage = customTargetingService.getCustomTargetingValuesByStatement( + valueStatementBuilder.ToStatement()); + + if (valuePage.results != null) { + int j = valuePage.startIndex; + foreach (CustomTargetingValue value in valuePage.results) { + Console.WriteLine("\t{0}) Custom targeting value with ID \"{1}\", name " + + "\"{2}\", and display name \"{3}\" was found.", j, value.id, value.name, + value.displayName); + j++; + } + } + valueStatementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (valueStatementBuilder.GetOffset() < valuePage.totalResultSetSize); + i++; + } + } + keyStatementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (keyStatementBuilder.GetOffset() < keyPage.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", keyPage.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get custom targeting keys and the values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CustomTargetingService/GetCustomTargetingKeysByStatement.cs b/examples/Dfp/CSharp/v201405/CustomTargetingService/GetCustomTargetingKeysByStatement.cs new file mode 100644 index 00000000000..9ad5c47ba4a --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CustomTargetingService/GetCustomTargetingKeysByStatement.cs @@ -0,0 +1,97 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all predefined custom targeting keys. To create custom + /// targeting keys, run CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// + class GetCustomTargetingKeysByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all predefined custom targeting keys. To create custom " + + "targeting keys, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCustomTargetingKeysByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201405.CustomTargetingService); + + // Create a statement to only select predefined custom targeting keys. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("type = :type") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("type", CustomTargetingKeyType.PREDEFINED.ToString()); + + // Set default for page. + CustomTargetingKeyPage page = new CustomTargetingKeyPage(); + + try { + do { + // Get custom targeting keys by statement. + page = customTargetingService.getCustomTargetingKeysByStatement( + statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomTargetingKey customTargetingKey in page.results) { + Console.WriteLine("{0}) Custom targeting key with ID \"{1}\", name \"{2}\", and " + + "display name \"{3}\" was found.", i, customTargetingKey.id, + customTargetingKey.name, customTargetingKey.displayName); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + + } catch (Exception ex) { + Console.WriteLine("Failed to get predefined custom targeting keys. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CustomTargetingService/GetCustomTargetingValuesByStatement.cs b/examples/Dfp/CSharp/v201405/CustomTargetingService/GetCustomTargetingValuesByStatement.cs new file mode 100644 index 00000000000..a305d567601 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CustomTargetingService/GetCustomTargetingValuesByStatement.cs @@ -0,0 +1,105 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets custom targeting values for the given predefined + /// custom targeting key. To create custom targeting values, run + /// CreateCustomTargetingKeysAndValues.cs. To determine which custom + /// targeting keys exist, run GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// + class GetCustomTargetingValuesByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets custom targeting values for the given predefined custom " + + "targeting key. To create custom targeting values, run " + + "CreateCustomTargetingKeysAndValues.cs. To determine which custom targeting keys " + + "exist, run GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCustomTargetingValuesByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201405.CustomTargetingService); + + // Set the ID of the custom targeting key to get custom targeting values + // for. + long customTargetingKeyId = long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + + // Create a statement to only select custom targeting values for a given + // key. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("customTargetingKeyId = :customTargetingKeyId") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("customTargetingKeyId", customTargetingKeyId); + + // Set default for page. + CustomTargetingValuePage page = new CustomTargetingValuePage(); + + try { + do { + // Get custom targeting values by statement. + page = customTargetingService.getCustomTargetingValuesByStatement( + statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (CustomTargetingValue customTargetingValue in page.results) { + Console.WriteLine("{0}) Custom targeting value with ID \"{1}\", name \"{2}\", and " + + "display name \"{3}\" was found.", i, customTargetingValue.id, + customTargetingValue.name, customTargetingValue.displayName); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get custom targeting values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CustomTargetingService/UpdateCustomTargetingKeys.cs b/examples/Dfp/CSharp/v201405/CustomTargetingService/UpdateCustomTargetingKeys.cs new file mode 100644 index 00000000000..3e03f50e6af --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CustomTargetingService/UpdateCustomTargetingKeys.cs @@ -0,0 +1,103 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example updates the display name of each custom targeting key up + /// to the first 500. To determine which custom targeting keys exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingKeysByStatement + /// Tags: CustomTargetingService.updateCustomTargetingKeys + /// + class UpdateCustomTargetingKeys : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the display name of custom targeting keys. To " + + "determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomTargetingKeys(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CustomTargetingService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201405.CustomTargetingService); + + // Set the ID of the custom targeting key to update. + int customTargetingKeyId = int.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")); + + // Create a statement to get the custom targeting key. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", customTargetingKeyId); + + try { + // Get custom targeting keys by statement. + CustomTargetingKeyPage page = + customTargetingService.getCustomTargetingKeysByStatement( + statementBuilder.ToStatement()); + + CustomTargetingKey customTargetingKey = page.results[0]; + + // Update each local custom targeting key object by changing its display name. + if (customTargetingKey.displayName == null) { + customTargetingKey.displayName = customTargetingKey.name; + } + customTargetingKey.displayName = customTargetingKey.displayName + " (Deprecated)"; + + // Update the custom targeting keys on the server. + CustomTargetingKey[] customTargetingKeys = customTargetingService.updateCustomTargetingKeys( + new CustomTargetingKey[] {customTargetingKey}); + + foreach (CustomTargetingKey updatedCustomTargetingKey in customTargetingKeys) { + Console.WriteLine("Custom targeting key with ID \"{0}\", name \"{1}\", and " + + "display name \"{2}\" was updated.", updatedCustomTargetingKey.id, + updatedCustomTargetingKey.name, updatedCustomTargetingKey.displayName); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update display name of custom targeting keys. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/CustomTargetingService/UpdateCustomTargetingValues.cs b/examples/Dfp/CSharp/v201405/CustomTargetingService/UpdateCustomTargetingValues.cs new file mode 100644 index 00000000000..30ba509209e --- /dev/null +++ b/examples/Dfp/CSharp/v201405/CustomTargetingService/UpdateCustomTargetingValues.cs @@ -0,0 +1,104 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example updates the display name of custom targeting values. To determine + /// which custom targeting keys exist, run GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: CustomTargetingService.getCustomTargetingValuesByStatement + /// Tags: CustomTargetingService.updateCustomTargetingValues + /// + class UpdateCustomTargetingValues : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the display name of custom targeting values. To " + + "determine which custom targeting keys exist, run " + + "GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateCustomTargetingValues(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the CreativeService. + CustomTargetingService customTargetingService = + (CustomTargetingService) user.GetService(DfpService.v201405.CustomTargetingService); + + // Set the ID of the predefined custom targeting value to update. + long customTargetingValueId = long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE")); + + // Create a statement to only select predefined custom targeting values + // for a given key. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("customTargetingValueId = :customTargetingValueId") + .OrderBy("id ASC") + .Limit(1) + .AddValue("customTargetingValueId", customTargetingValueId); + + try { + // Get custom targeting values by statement. + CustomTargetingValuePage page = + customTargetingService.getCustomTargetingValuesByStatement( + statementBuilder.ToStatement()); + + CustomTargetingValue customTargetingValue = page.results[0]; + + // Update the local custom targeting value object by changing its display name. + if (customTargetingValue.displayName == null) { + customTargetingValue.displayName = customTargetingValue.displayName; + } + customTargetingValue.displayName = customTargetingValue.displayName + " (Deprecated)"; + + // Update the custom targeting values on the server. + CustomTargetingValue[] customTargetingValues = + customTargetingService.updateCustomTargetingValues( + new CustomTargetingValue[] {customTargetingValue}); + + foreach (CustomTargetingValue updatedCustomTargetingValue in customTargetingValues) { + Console.WriteLine("Custom targeting value with ID \"{0}\", name \"{1}\", and " + + "display name \"{2}\" was updated.", updatedCustomTargetingValue.id, + updatedCustomTargetingValue.name, updatedCustomTargetingValue.displayName); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update display names of custom targeting values. Exception " + + "says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ForecastService/GetForecast.cs b/examples/Dfp/CSharp/v201405/ForecastService/GetForecast.cs new file mode 100644 index 00000000000..40b34a108ad --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ForecastService/GetForecast.cs @@ -0,0 +1,117 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets a forecast for a prospective line item. To + /// determine which placements exist, run GetAllPlacements.cs. + /// + /// Tags: ForecastService.getForecast + /// + class GetForecast : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a forecast for a prospective line item. To determine " + + "which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetForecast(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ForecastService. + ForecastService forecastService = + (ForecastService)user.GetService(DfpService.v201405.ForecastService); + + // Set the placement that the prospective line item will target. + long[] targetPlacementIds = new long[] {long.Parse(_T("INSERT_PLACEMENT_ID_HERE"))}; + + // Set the end date time to have the line line item run till. + string endDateTime = "INSERT_END_DATE_TIME_HERE (yyyyMMdd HH:mm:ss)"; + + // Create prospective line item. + LineItem lineItem = new LineItem(); + + lineItem.targeting = new Targeting(); + lineItem.targeting.inventoryTargeting = new InventoryTargeting(); + lineItem.targeting.inventoryTargeting.targetedPlacementIds = targetPlacementIds; + + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + lineItem.lineItemType = LineItemType.SPONSORSHIP; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + + lineItem.endDateTime = DateTimeUtilities.FromString(endDateTime); + + // Set the cost type to match the unit type. + lineItem.costType = CostType.CPM; + Goal goal = new Goal(); + goal.unitType = UnitType.IMPRESSIONS; + goal.units = 50L; + lineItem.primaryGoal = goal; + + try { + // Get forecast. + Forecast forecast = forecastService.getForecast(lineItem); + + // Display results. + long matched = forecast.matchedUnits; + double availablePercent = (double) (forecast.availableUnits / (matched * 1.0)) * 100; + String unitType = forecast.unitType.ToString().ToLower(); + Console.WriteLine("{0} {1} matched.\n{2}% available.", matched, unitType, + availablePercent, unitType); + + if (forecast.possibleUnitsSpecified) { + double possiblePercent = (double) (forecast.possibleUnits / (matched * 1.0)) * 100; + Console.WriteLine("{0}% {1} possible.\n", possiblePercent, unitType); + } + Console.WriteLine("{0} contending line items.", (forecast.contendingLineItems != null) ? + forecast.contendingLineItems.Length : 0); + } catch (Exception ex) { + Console.WriteLine("Failed to get forecast. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ForecastService/GetForecastById.cs b/examples/Dfp/CSharp/v201405/ForecastService/GetForecastById.cs new file mode 100644 index 00000000000..8b25158803d --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ForecastService/GetForecastById.cs @@ -0,0 +1,84 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets a forecast for an existing line item. To determine + /// which line items exist, run GetAllLineItems.cs. + /// + /// Tags: ForecastService.getForecastById + /// + class GetForecastById : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets a forecast for an existing line item. To determine which " + + "line items exist, run GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetForecastById(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the ForecastService. + ForecastService forecastService = + (ForecastService) user.GetService(DfpService.v201405.ForecastService); + + // Set the line item to get a forecast for. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + try { + // Get forecast for line item. + Forecast forecast = forecastService.getForecastById(lineItemId); + + // Display results. + long matched = forecast.matchedUnits; + double availablePercent = (double) (forecast.availableUnits / (matched * 1.0)) * 100; + String unitType = forecast.unitType.ToString().ToLower(); + + Console.WriteLine("{0} {1} matched.\n{2} % {3} available.", matched, unitType, + availablePercent, unitType); + if (forecast.possibleUnitsSpecified) { + double possiblePercent = (double) (forecast.possibleUnits / (matched * 1.0)) * 100; + Console.WriteLine(possiblePercent + "% " + unitType + " possible.\n"); + } + Console.WriteLine("{0} contending line items.", (forecast.contendingLineItems != null)? + forecast.contendingLineItems.Length : 0); + } catch (Exception ex) { + Console.WriteLine("Failed to get forecast by id. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/InventoryService/CreateAdUnits.cs b/examples/Dfp/CSharp/v201405/InventoryService/CreateAdUnits.cs new file mode 100644 index 00000000000..535474b2b89 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/InventoryService/CreateAdUnits.cs @@ -0,0 +1,108 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates new ad units under the effective root ad unit. + /// To determine which ad units exist, run GetAdUnitTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.createAdUnits, NetworkService.getCurrentNetwork + /// + class CreateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new ad units under the effective root ad unit. To " + + "determine which ad units exist, run GetAdUnitTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201405.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201405.NetworkService); + + string effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create an array to store local ad unit objects. + AdUnit[] adUnits = new AdUnit[5]; + + for (int i = 0; i < 5; i++) { + AdUnit adUnit = new AdUnit(); + adUnit.name = string.Format("Ad_Unit_{0}", i); + adUnit.parentId = effectiveRootAdUnitId; + + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + + // Set the size of possible creatives that can match this ad unit. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + adUnits[i] = adUnit; + } + + try { + // Create the ad units on the server. + adUnits = inventoryService.createAdUnits(adUnits); + + if (adUnits != null) { + foreach (AdUnit adUnit in adUnits) { + Console.WriteLine("An ad unit with ID = '{0}' was created under parent with " + + "ID = '{1}'.", adUnit.id, adUnit.parentId); + } + } else { + Console.WriteLine("No ad units created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/InventoryService/CreateMobileAdUnit.cs b/examples/Dfp/CSharp/v201405/InventoryService/CreateMobileAdUnit.cs new file mode 100644 index 00000000000..3389d9f2ef7 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/InventoryService/CreateMobileAdUnit.cs @@ -0,0 +1,102 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates a new mobile ad unit under the effective root + /// ad unit. Mobile features need to be enabled on your account to use mobile + /// targeting. To determine which ad units exist, run GetInventoryTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.createAdUnits, NetworkService.getCurrentNetwork + /// + class CreateMobileAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new mobile ad unit under the effective ad unit. " + + "Mobile features need to be enabled on your account to use mobile targeting. To " + + "determine which ad units exist, run GetInventoryTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateMobileAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201405.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201405.NetworkService); + + // Set the parent ad unit's ID for all ad units to be created under. + String effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create local ad unit object. + AdUnit adUnit = new AdUnit(); + adUnit.name = "Mobile_Ad_Unit"; + adUnit.parentId = effectiveRootAdUnitId; + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + adUnit.targetPlatform = TargetPlatform.MOBILE; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + Size size = new Size(); + size.width = 400; + size.height = 300; + size.isAspectRatio = false; + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + // Set the size of possible creatives that can match this ad unit. + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + + try { + // Create the ad unit on the server. + AdUnit[] createdAdUnits = inventoryService.createAdUnits(new AdUnit[] {adUnit}); + + foreach (AdUnit createdAdunit in createdAdUnits) { + Console.WriteLine("An ad unit with ID \"{0}\" was created under parent with ID " + + "\"{1}\".", createdAdunit.id, createdAdunit.parentId); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/InventoryService/CreateVideoAdUnit.cs b/examples/Dfp/CSharp/v201405/InventoryService/CreateVideoAdUnit.cs new file mode 100644 index 00000000000..d248c7c9c60 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/InventoryService/CreateVideoAdUnit.cs @@ -0,0 +1,121 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates a new video ad unit under the effective root + /// ad unit. To determine which ad units exist, run GetInventoryTree.cs or + /// GetAllAdUnits.cs. + /// + /// Tags: InventoryService.createAdUnits, NetworkService.getCurrentNetwork + /// + class CreateVideoAdUnit : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new ad units under the effective root ad unit. To " + + "determine which ad units exist, run GetAdUnitTree.cs or GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateVideoAdUnit(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201405.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201405.NetworkService); + + // Set the parent ad unit's ID for all ad units to be created under. + String effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create local ad unit object. + AdUnit adUnit = new AdUnit(); + adUnit.name = "Video_Ad_Unit"; + adUnit.parentId = effectiveRootAdUnitId; + adUnit.description = "Ad unit description."; + adUnit.targetWindow = AdUnitTargetWindow.BLANK; + adUnit.explicitlyTargeted = true; + adUnit.targetPlatform = TargetPlatform.WEB; + + // Create master ad unit size. + AdUnitSize masterAdUnitSize = new AdUnitSize(); + Size size1 = new Size(); + size1.width = 400; + size1.height = 300; + size1.isAspectRatio = false; + masterAdUnitSize.size = size1; + masterAdUnitSize.environmentType = EnvironmentType.VIDEO_PLAYER; + + // Create companion sizes. + AdUnitSize companionAdUnitSize1 = new AdUnitSize(); + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + size2.isAspectRatio = false; + companionAdUnitSize1.size = size2; + companionAdUnitSize1.environmentType = EnvironmentType.BROWSER; + + AdUnitSize companionAdUnitSize2 = new AdUnitSize(); + Size size3 = new Size(); + size3.width = 728; + size3.height = 90; + size3.isAspectRatio = false; + companionAdUnitSize2.size = size3; + companionAdUnitSize2.environmentType = EnvironmentType.BROWSER; + + // Add companions to master ad unit size. + masterAdUnitSize.companions = new AdUnitSize[] {companionAdUnitSize1, companionAdUnitSize2}; + + // Set the size of possible creatives that can match this ad unit. + adUnit.adUnitSizes = new AdUnitSize[] {masterAdUnitSize}; + + try { + // Create the ad unit on the server. + AdUnit[] createdAdUnits = inventoryService.createAdUnits(new AdUnit[] {adUnit}); + + foreach (AdUnit createdAdUnit in createdAdUnits) { + Console.WriteLine("A video ad unit with ID \"{0}\" was created under parent with ID " + + "\"{1}\".", createdAdUnit.id, createdAdUnit.parentId); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create video ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/InventoryService/DeActivateAdUnits.cs b/examples/Dfp/CSharp/v201405/InventoryService/DeActivateAdUnits.cs new file mode 100644 index 00000000000..4398c1a0103 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/InventoryService/DeActivateAdUnits.cs @@ -0,0 +1,118 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example deactivates all active ad units. To determine which ad + /// units exist, run GetAllAdUnits.cs or GetInventoryTree.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: InventoryService.performAdUnitAction + /// + class DeActivateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates an ad unit. To determine which ad units exist, " + + "run GetAllAdUnits.cs or GetInventoryTree.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeActivateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201405.InventoryService); + + // Set the ID of the ad unit to deactivate. + int adUnitId = int.Parse(_T("INSERT_AD_UNIT_ID_HERE")); + + // Create a statement to select the ad unit. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", adUnitId); + + // Set default for page. + AdUnitPage page = new AdUnitPage(); + List adUnitIds = new List(); + + try { + do { + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID ='{1}', name = {2} and status = {3} will" + + " be deactivated.", i, adUnit.id, adUnit.name, adUnit.status); + adUnitIds.Add(adUnit.id); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of ad units to be deactivated: {0}", adUnitIds.Count); + + // Modify statement for action. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + DeactivateAdUnits action = new DeactivateAdUnits(); + + // Perform action. + UpdateResult result = inventoryService.performAdUnitAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of ad units deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No ad units were deactivated."); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/InventoryService/GetAdUnitSizes.cs b/examples/Dfp/CSharp/v201405/InventoryService/GetAdUnitSizes.cs new file mode 100644 index 00000000000..42d20ebe41a --- /dev/null +++ b/examples/Dfp/CSharp/v201405/InventoryService/GetAdUnitSizes.cs @@ -0,0 +1,82 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; +using Google.Api.Ads.Dfp.Util.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all web target platform ad unit sizes. + /// + /// Tags: InventoryService.getAdUnitSizesByStatement + /// + class GetAdUnitSizes : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all web target platform ad unit sizes."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnitSizes(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201405.InventoryService); + + StatementBuilder statementBuilder = new StatementBuilder() + .Where("targetPlatform = :targetPlatform") + .AddValue("targetPlatform", "WEB"); + + try { + // Get all ad unit sizes. + AdUnitSize[] adUnitSizes = inventoryService.getAdUnitSizesByStatement( + statementBuilder.ToStatement()); + + // Display results. + if (adUnitSizes != null) { + for (int i = 0; i < adUnitSizes.Length; i++) { + AdUnitSize adUnitSize = adUnitSizes[i]; + Console.WriteLine("{0}) Ad unit size ({1}x{2}) was found.\n", i, + adUnitSize.size.width, adUnitSize.size.height); + } + } else { + Console.WriteLine("No ad unit sizes found."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit sizes. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/InventoryService/GetAdUnitsByStatement.cs b/examples/Dfp/CSharp/v201405/InventoryService/GetAdUnitsByStatement.cs new file mode 100644 index 00000000000..eb70364ac82 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/InventoryService/GetAdUnitsByStatement.cs @@ -0,0 +1,101 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets the root ad unit. To create an ad unit, run + /// CreateAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: NetworkService.getCurrentNetwork + /// + class GetAdUnitsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the root ad unit. To create an ad unit, run " + + "CreateAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAdUnitsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201405.InventoryService); + + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201405.NetworkService); + + // Get the effective root ad unit ID of the network. + string effectiveRootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create a statement to select the children of the effective root ad + // unit. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("parentId = :parentId") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("parentId", effectiveRootAdUnitId); + + // Set default for page. + AdUnitPage page = new AdUnitPage(); + + try { + do { + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID = '{1}', name = '{2}' and status = '{3}' " + + "was found.", i, adUnit.id, adUnit.name, adUnit.status); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/InventoryService/GetAllAdUnits.cs b/examples/Dfp/CSharp/v201405/InventoryService/GetAllAdUnits.cs new file mode 100644 index 00000000000..46d380e96cc --- /dev/null +++ b/examples/Dfp/CSharp/v201405/InventoryService/GetAllAdUnits.cs @@ -0,0 +1,89 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all ad units. To create ad units, run + /// CreateAdUnits.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// + class GetAllAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all ad units. To create ad units, run CreateAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201405.InventoryService); + + // Create a Statement to get all ad units. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + AdUnitPage page = new AdUnitPage(); + + try { + do { + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (AdUnit adUnit in page.results) { + Console.WriteLine("{0}) Ad unit with ID = '{1}', name = '{2}' and status = '{3}' " + + "was found.", i, adUnit.id, adUnit.name, adUnit.status); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/InventoryService/GetInventoryTree.cs b/examples/Dfp/CSharp/v201405/InventoryService/GetInventoryTree.cs new file mode 100644 index 00000000000..90ed91d3712 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/InventoryService/GetInventoryTree.cs @@ -0,0 +1,206 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example retrieves a previously created ad units and creates + /// a tree. + /// + /// Tags: InventoryService.getAdUnit, InventoryService.getAdUnitsByStatement + /// + class GetInventoryTree : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example retrieves a previously created ad units and creates a tree."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetInventoryTree(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + try { + // Get all ad units. + AdUnit[] allAdUnits = GetAllAdUnits(user); + + // Find the root ad unit. rootAdUnit can also be set to child unit to + // only build and display a portion of the tree. + // i.e. AdUnit adUnit = + // inventoryService.getAdUnit("INSERT_AD_UNIT_HERE") + AdUnit rootAdUnit = FindRootAdUnit(user); + + if (rootAdUnit == null) { + Console.WriteLine("Could not build tree. No root ad unit found."); + } else { + BuildAndDisplayAdUnitTree(rootAdUnit, allAdUnits); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get ad unit. Exception says \"{0}\"", ex.Message); + } + } + + /// + /// Gets all ad units for this user. + /// + /// The DfpUser to get the ad units for. + /// All ad units for this user. + private static AdUnit[] GetAllAdUnits(DfpUser user) { + // Create list to hold all ad units. + List adUnits = new List(); + + // Get InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201405.InventoryService); + + // Create a Statement to get all ad units. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + AdUnitPage page = new AdUnitPage(); + + do { + // Get ad units by Statement. + page = inventoryService.getAdUnitsByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + adUnits.AddRange(page.results); + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + return adUnits.ToArray(); + } + + /// + /// Finds the root ad unit for the user. + /// + /// The DfpUser to get the root ad unit for. + /// The ad unit representing the root ad unit or null if one + /// is not found. + private static AdUnit FindRootAdUnit(DfpUser user) { + // Get InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201405.InventoryService); + + // Create a Statement to only select the root ad unit. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("parentId IS NULL") + .OrderBy("id ASC") + .Limit(1); + + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + return page.results[0]; + } + return null; + } + + /// + /// Builds and displays an ad unit tree from an array of ad units underneath + /// the root ad unit. + /// + /// The root ad unit to build the tree under. + /// The array of ad units. + private static void BuildAndDisplayAdUnitTree(AdUnit root, AdUnit[] units) { + Dictionary> treeMap = new Dictionary>(); + + foreach (AdUnit unit in units) { + if (unit.parentId != null) { + if (treeMap.ContainsKey(unit.parentId) == false) { + treeMap.Add(unit.parentId, new List()); + } + treeMap[unit.parentId].Add(unit); + } + } + + if (root != null) { + DisplayInventoryTree(root, treeMap); + } else { + Console.WriteLine("No root unit found."); + } + } + + /// + /// Displays the ad unit tree beginning at the root ad unit. + /// + /// The root ad unit + /// The map of id to list of ad units + private static void DisplayInventoryTree(AdUnit root, Dictionary> treeMap) { + DisplayInventoryTreeHelper(root, treeMap, 0); + } + + /// + /// Helper for displaying inventory units. + /// + /// The root inventory unit. + /// The map of id to List of inventory units. + /// The depth the tree has reached. + private static void DisplayInventoryTreeHelper(AdUnit root, + Dictionary> treeMap, int depth) { + Console.WriteLine(GenerateTab(depth) + root.name + " (" + root.id + ")"); + + if (treeMap.ContainsKey(root.id)) { + foreach (AdUnit child in treeMap[root.id]) { + DisplayInventoryTreeHelper(child, treeMap, depth + 1); + } + } + } + + /// + /// Generates a String of tabs to represent branching to children. + /// + /// A depth from 0 to max(depth). + /// A string to insert in front of the root unit. + private static String GenerateTab(int depth) { + StringBuilder builder = new StringBuilder(); + if (depth != 0) { + builder.Append(" "); + } + + for (int i = 1; i < depth; i++) { + builder.Append("| "); + } + builder.Append("+--"); + return builder.ToString(); + } + } +} diff --git a/examples/Dfp/CSharp/v201405/InventoryService/UpdateAdUnits.cs b/examples/Dfp/CSharp/v201405/InventoryService/UpdateAdUnits.cs new file mode 100644 index 00000000000..663105f27f0 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/InventoryService/UpdateAdUnits.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example updates an ad unit by enabling AdSense to the first + /// 500. To determine which ad units exist, run GetAllAdUnits.cs or + /// GetInventoryTree.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement, InventoryService.updateAdUnits + /// + class UpdateAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates an ad unit by enabling AdSense. To determine which " + + "ad units exist, run GetAllAdUnits.cs or GetInventoryTree.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the sample code. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201405.InventoryService); + + // Set the ID of the ad unit to update. + int adUnitId = int.Parse(_T("INSERT_AD_UNIT_ID_HERE")); + + // Create a statement to get the ad unit. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", adUnitId); + + try { + // Get ad units by statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statementBuilder.ToStatement()); + + AdUnit adUnit = page.results[0]; + adUnit.inheritedAdSenseSettings.value.adSenseEnabled = true; + + // Update the ad units on the server. + AdUnit[] updatedAdUnits = inventoryService.updateAdUnits(new AdUnit[] { adUnit }); + + foreach (AdUnit updatedAdUnit in updatedAdUnits) { + Console.WriteLine("Ad unit with ID \"{0}\", name \"{1}\", and is AdSense enabled " + + "\"{2}\" was updated.", updatedAdUnit.id, updatedAdUnit.name, + updatedAdUnit.inheritedAdSenseSettings.value.adSenseEnabled); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/LabelService/CreateLabels.cs b/examples/Dfp/CSharp/v201405/LabelService/CreateLabels.cs new file mode 100644 index 00000000000..d01fded9d2c --- /dev/null +++ b/examples/Dfp/CSharp/v201405/LabelService/CreateLabels.cs @@ -0,0 +1,93 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates new labels. To determine which labels exist, run + /// GetAllLabels.cs. This feature is only available to DFP premium solution + /// networks. + /// + /// Tags: LabelService.createLabels + /// + class CreateLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new labels. To determine which labels exist, run " + + "GetAllLabels.cs. This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201405.LabelService); + + try { + // Create an array to store local label objects. + Label[] labels = new Label[5]; + + for (int i = 0; i < 5; i++) { + Label label = new Label(); + label.name = "Label #" + GetTimeStamp(); + label.types = new LabelType[] {LabelType.COMPETITIVE_EXCLUSION}; + labels[i] = label; + } + + // Create the labels on the server. + labels = labelService.createLabels(labels); + + if (labels != null) { + foreach (Label label in labels) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("A label with ID '{0}', name '{1}', and type '{2}' was created.", + label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + } + } else { + Console.WriteLine("No labels created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/LabelService/DeactivateActiveLabels.cs b/examples/Dfp/CSharp/v201405/LabelService/DeactivateActiveLabels.cs new file mode 100644 index 00000000000..121277da65a --- /dev/null +++ b/examples/Dfp/CSharp/v201405/LabelService/DeactivateActiveLabels.cs @@ -0,0 +1,115 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example deactivates all active labels. To determine which labels + /// exist, run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement, LabelService.performLabelAction + /// + class DeactivateActiveLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates a label. To determine which labels exist," + + " run GetAllLabels.cs. This feature is only available to DFP premium solution " + + "networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateActiveLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201405.LabelService); + + // Set the ID of the label to deactivate. + int labelId = int.Parse(_T("INSERT_LABEL_ID_HERE")); + + // Create statement text to select the label. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", labelId); + + // Set default for page. + LabelPage page = new LabelPage(); + + try { + do { + // Get labels by statement. + page = labelService.getLabelsByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + Console.WriteLine("{0}) Label with ID '{1}', name '{2}' will be deactivated.", + i, label.id, label.name); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of labels to be deactivated: " + page.totalResultSetSize); + + // Modify statement for action. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + DeactivateLabels action = new DeactivateLabels(); + + // Perform action. + UpdateResult result = labelService.performLabelAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of labels deactivated: " + result.numChanges); + } else { + Console.WriteLine("No labels were deactivated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/LabelService/GetAllLabels.cs b/examples/Dfp/CSharp/v201405/LabelService/GetAllLabels.cs new file mode 100644 index 00000000000..6f206281a14 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/LabelService/GetAllLabels.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all labels. To create labels, run CreateLabels.cs. + /// This feature is only available to DFP premium solution networks. + /// + /// Tags: LabelService.getLabelsByStatement + /// + class GetAllLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all labels. To create labels, run CreateLabels.cs. This " + + "feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201405.LabelService); + + // Create a statement to get all labels. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + LabelPage page = new LabelPage(); + + try { + do { + // Get labels by statement. + page = labelService.getLabelsByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("{0}) Label with ID '{1}', name '{2}' and type '{3}' was found.", + i, label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/LabelService/GetLabelsByStatement.cs b/examples/Dfp/CSharp/v201405/LabelService/GetLabelsByStatement.cs new file mode 100644 index 00000000000..95e09850b33 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/LabelService/GetLabelsByStatement.cs @@ -0,0 +1,99 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all labels that are competitively excluded. To create + /// labels, run CreateLabels.cs. This feature is only available to DFP premium solution + /// networks. + /// Tags: LabelService.getLabelsByStatement + /// + class GetLabelsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all labels that are competitively excluded. To create " + + "labels, run CreateLabels.cs. This feature is only available to DFP premium solution " + + "networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLabelsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201405.LabelService); + + // Create a statement to only select labels that are competitive + // sorted by name. + StatementBuilder statementBuilder = new StatementBuilder() + .Where ("type = :type") + .OrderBy("name ASC") + .Limit (StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("type", LabelType.COMPETITIVE_EXCLUSION.ToString()); + + // Set default for page + LabelPage page = new LabelPage(); + + try { + do { + // Get labels by statement. + page = labelService.getLabelsByStatement(statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (Label label in page.results) { + StringBuilder builder = new StringBuilder(); + foreach (LabelType labelType in label.types) { + builder.AppendFormat("{0} | ", labelType); + } + + Console.WriteLine("{0}) Label with ID '{1}', name '{2}'and type '{3}' was found.", + i, label.id, label.name, builder.ToString().TrimEnd(' ', '|')); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while(statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/LabelService/UpdateLabels.cs b/examples/Dfp/CSharp/v201405/LabelService/UpdateLabels.cs new file mode 100644 index 00000000000..02aac246f04 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/LabelService/UpdateLabels.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example updates a label's description. To determine which labels + /// exist, run GetAllLabels.cs. This feature is only available to DFP premium + /// solution networks. + /// + /// Tags: LabelService.getLabelsByStatement, LabelService.updateLabels + /// + class UpdateLabels : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a label's description. To determine which labels " + + "exist, run GetAllLabels.cs. This feature is only available to DFP premium solution " + + "networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLabels(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LabelService. + LabelService labelService = + (LabelService) user.GetService(DfpService.v201405.LabelService); + + // Set the ID of the label to deactivate. + int labelId = int.Parse(_T("INSERT_LABEL_ID_HERE")); + + // Create a statement to select the label. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", labelId); + + try { + // Get the labels by statement. + LabelPage page = labelService.getLabelsByStatement(statementBuilder.ToStatement()); + + Label label = page.results[0]; + + // Update the label description. + label.description = "New label description."; + + // Update the label on the server. + Label[] labels = labelService.updateLabels(new Label[] {label}); + + foreach (Label updatedLabel in labels) { + Console.WriteLine("A label with ID '{0}' and name '{1}' was updated.", + updatedLabel.id, updatedLabel.name); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to update labels. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/ActivateLicas.cs b/examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/ActivateLicas.cs new file mode 100644 index 00000000000..12a3cfe1089 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/ActivateLicas.cs @@ -0,0 +1,122 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example activates all LICAs for a given line item. To + /// determine which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.performLineItemCreativeAssociationAction + /// + class ActivateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example activates all LICAs for a given line item. To " + + "determine which LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ActivateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201405.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + // Create a Statement to page through LICAs. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("lineItemId = :lineItemId") + .OrderBy("lineItemId ASC, creativeId ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("lineItemId", lineItemId); + + // Set default for page. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + List creativeIds = new List(); + + try { + do { + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement( + statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' will be activated.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + creativeIds.Add(lica.creativeId.ToString()); + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of LICAs to be activated: {0}", creativeIds.Count); + + if (creativeIds.Count > 0) { + // Modify statement for action. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + ActivateLineItemCreativeAssociations action = + new ActivateLineItemCreativeAssociations(); + + // Perform action. + UpdateResult result = licaService.performLineItemCreativeAssociationAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of LICAs activated: {0}", result.numChanges); + } else { + Console.WriteLine("No LICAs were activated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to activate LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/CreateLicas.cs b/examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/CreateLicas.cs new file mode 100644 index 00000000000..50b1dafaca8 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/CreateLicas.cs @@ -0,0 +1,104 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates new line item creative associations (LICAs) for + /// an existing line item and a set of creative ids. For small business + /// networks, the creative ids must represent new or copied creatives as + /// creatives cannot be used for more than one line item. For premium + /// solution networks, the creative ids can represent any creative. To copy + /// creatives, run CopyImageCreatives.cs. To determine which LICAs exist, run + /// GetAllLicasExample.cs. + /// + /// Tags: LineItemCreativeAssociationService.createLineItemCreativeAssociations + /// + class CreateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new line item creative associations (LICAs) for an " + + "existing line item and a set of creative ids. For small business networks, the " + + "creative ids must represent new or copied creatives as creatives cannot be used " + + "for more than one line item. For premium solution networks, the creative ids can " + + "represent any creative. To copy creatives, run CopyImageCreatives.cs. To determine " + + "which LICAs exist, run GetAllLicasExample.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = + (LineItemCreativeAssociationService) user.GetService( + DfpService.v201405.LineItemCreativeAssociationService); + + // Set the line item ID and creative IDs to associate. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long[] creativeIds = new long[] {long.Parse(_T("INSERT_CREATIVE_ID_HERE"))}; + + // Create an array to store local LICA objects. + LineItemCreativeAssociation[] licas = new LineItemCreativeAssociation[creativeIds.Length]; + + // For each line item, associate it with the given creative. + int i = 0; + foreach (long creativeId in creativeIds) { + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId; + lica.lineItemId = lineItemId; + licas[i++] = lica; + } + + try { + // Create the LICAs on the server. + licas = licaService.createLineItemCreativeAssociations(licas); + + if (licas != null) { + foreach (LineItemCreativeAssociation lica in licas) { + Console.WriteLine("A LICA with line item ID \"{0}\", creative ID \"{1}\", and status " + + "\"{2}\" was created.", lica.lineItemId, lica.creativeId, lica.status); + } + } else { + Console.WriteLine("No LICAs created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to associate creative with line item. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/DeactivateLicas.cs b/examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/DeactivateLicas.cs new file mode 100644 index 00000000000..b23434290f2 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/DeactivateLicas.cs @@ -0,0 +1,122 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example deactivates all LICAs for a given line item. To determine + /// which LICAs exist, run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.performLineItemCreativeAssociationAction + /// + class DeactivateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates all LICAs for a given line item. To determine " + + "which LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201405.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + // Create a Statement to page through active LICAs. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("lineItemId = :lineItemId") + .OrderBy("lineItemId ASC, creativeId ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("lineItemId", lineItemId); + + // Set default for page. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + List creativeIds = new List(); + + try { + do { + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement( + statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' will be deactivated.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + creativeIds.Add(lica.creativeId.ToString()); + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of LICAs to be deactivated: {0}", creativeIds.Count); + + if (creativeIds.Count > 0) { + // Modify statement for action. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + DeactivateLineItemCreativeAssociations action = + new DeactivateLineItemCreativeAssociations(); + + // Perform action. + UpdateResult result = licaService.performLineItemCreativeAssociationAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of LICAs deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No LICAs were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/GetAllLicas.cs b/examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/GetAllLicas.cs new file mode 100644 index 00000000000..1f11124b841 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/GetAllLicas.cs @@ -0,0 +1,92 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all line item creative associations (LICA). To + /// create LICAs, run CreateLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// + class GetAllLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line item creative associations (LICA). To create " + + "LICAs, run CreateLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201405.LineItemCreativeAssociationService); + + // Create a Statement to get all LICAs. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("lineItemId ASC, creativeId ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + + try { + do { + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement( + statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' was found.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/GetLicasByStatement.cs b/examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/GetLicasByStatement.cs new file mode 100644 index 00000000000..47562216814 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/GetLicasByStatement.cs @@ -0,0 +1,96 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all line item creative associations for a given + /// line item ID. To create LICAs, run CreateLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// + class GetLicasByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line item creative associations for a given line " + + "item ID. To create LICAs, run CreateLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLicasByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201405.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + // Create a Statement to only select LICAs for the given lineItem ID. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("lineItemId = :lineItemId") + .OrderBy("lineItemId ASC, creativeId ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("lineItemId", lineItemId); + + // Set default for page. + LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage(); + + try { + do { + // Get LICAs by Statement. + page = licaService.getLineItemCreativeAssociationsByStatement( + statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemCreativeAssociation lica in page.results) { + Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " + + "status ='{3}' was found.", i, lica.lineItemId, lica.creativeId, + lica.status); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while(statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/UpdateLicas.cs b/examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/UpdateLicas.cs new file mode 100644 index 00000000000..4783676355c --- /dev/null +++ b/examples/Dfp/CSharp/v201405/LineItemCreativeAssociationService/UpdateLicas.cs @@ -0,0 +1,103 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example updates the destination URL of a LICA. To determine which LICAs exist, + /// run GetAllLicas.cs. + /// + /// Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement + /// Tags: LineItemCreativeAssociationService.updateLineItemCreativeAssociations + /// + class UpdateLicas : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the destination URL of a LICAs. To determine which " + + "LICAs exist, run GetAllLicas.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLicas(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemCreativeAssociationService. + LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService) + user.GetService(DfpService.v201405.LineItemCreativeAssociationService); + + // Set the line item to get LICAs by. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + // Set the creative to get LICAs by. + long creativeId = long.Parse(_T("INSERT_CREATIVE_ID_HERE")); + + // Create a Statement to get all LICAs. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("lineItemId = :lineItemId AND creativeId = :creativeId") + .OrderBy("id ASC") + .Limit(1) + .AddValue("lineItemId", lineItemId) + .AddValue("creativeId", creativeId); + + try { + // Get LICAs by Statement. + LineItemCreativeAssociationPage page = + licaService.getLineItemCreativeAssociationsByStatement(statementBuilder.ToStatement()); + + LineItemCreativeAssociation lica = page.results[0]; + + // Update the LICA object by changing its destination URL. + lica.destinationUrl = "http://news.google.com"; + + // Update the LICA on the server. + LineItemCreativeAssociation[] licas = licaService.updateLineItemCreativeAssociations( + new LineItemCreativeAssociation[] {lica}); + + if (licas != null) { + foreach (LineItemCreativeAssociation updatedLica in licas) { + Console.WriteLine("LICA with line item ID = '{0}, creative ID ='{1}' and " + + "destination URL '{2}' was updated.", updatedLica.lineItemId, + updatedLica.creativeId, updatedLica.destinationUrl); + } + } else { + Console.WriteLine("No LICAs updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update LICAs. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/LineItemService/ActivateLineItem.cs b/examples/Dfp/CSharp/v201405/LineItemService/ActivateLineItem.cs new file mode 100644 index 00000000000..fcb79e9bf93 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/LineItemService/ActivateLineItem.cs @@ -0,0 +1,131 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example activates all line items for the given order. To be + /// activated, line items need to be in the approved (needs creatives) state + /// and have at least one creative associated with them. To approve line + /// items, approve the order to which they belong by running ApproveOrders.cs. + /// To create LICAs, run CreateLicas.cs. To determine which line items exist, + /// run GetAllLineItem.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.performLineItemAction + /// + class ActivateLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example activates all line items for the given order. To be activated," + + " line items need to be in the approved (needs creatives) state and have at least one" + + " creative associated with them. To approve line items, approve the order to which" + + " they belong by running ApproveOrders.cs. To create LICAs, run CreateLicas.cs." + + " To determine which line items exist, run GetAllLineItem.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ActivateLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201405.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create Statement to select approved line items from a given order. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("orderId = :orderId and status = :status") + .AddValue("orderId", orderId) + .AddValue("status", ComputedStatus.NEEDS_CREATIVES.ToString()); + + // Set default for page. + LineItemPage page = new LineItemPage(); + List lineItemIds = new List(); + + try { + do { + // Get line items by Statement. + page = lineItemService.getLineItemsByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemSummary lineItem in page.results) { + // Archived line items cannot be activated. + if (!lineItem.isArchived) { + Console.WriteLine("{0}) Line item with ID ='{1}', belonging to order ID ='{2}' " + + "and name ='{2}' will be activated.", i, lineItem.id, lineItem.orderId, + lineItem.name); + lineItemIds.Add(lineItem.id.ToString()); + i++; + } + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + + Console.WriteLine("Number of line items to be activated: {0}", lineItemIds.Count); + + if (lineItemIds.Count > 0) { + // Modify Statement. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + ActivateLineItems action = new ActivateLineItems(); + + // Perform action. + UpdateResult result = lineItemService.performLineItemAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of line items activated: {0}", result.numChanges); + } else { + Console.WriteLine("No line items were activated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to activate line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/LineItemService/CreateLineItems.cs b/examples/Dfp/CSharp/v201405/LineItemService/CreateLineItems.cs new file mode 100644 index 00000000000..0a9913d3944 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/LineItemService/CreateLineItems.cs @@ -0,0 +1,218 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates new line items. To determine which line items + /// exist, run GetAllLineItems.cs. To determine which orders exist, run + /// GetAllOrders.cs. To determine which placements exist, run + /// GetAllPlacements.cs. To determine the IDs for locations, run + /// GetAllCities.cs, GetAllCountries.cs, GetAllMetros.cs, GetAllRegions.cs and + /// GetAllPostalCodes. + /// + /// Tags: LineItemService.createLineItems + /// + class CreateLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new line items. To determine which line items " + + "exist, run GetAllLineItems.cs. To determine which orders exist, run GetAllOrders.cs" + + ". To determine which placements exist, run GetAllPlacements.cs. To determine the " + + "IDs for locations, run GetAllCities.cs, GetAllCountries.cs, GetAllMetros.cs, " + + "GetAllRegions.cs and GetAllPostalCodes."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code examples. + /// + /// The DFP user object running the code examples. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201405.LineItemService); + + // Set the order that all created line items will belong to and the + // placement ID to target. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + long[] targetPlacementIds = new long[] {long.Parse(_T("INSERT_PLACEMENT_ID_HERE"))}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = targetPlacementIds; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + Location postalCodeLocation = new Location(); + postalCodeLocation.id = 9000093; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201405.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201405.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + // Create an array to store local line item objects. + LineItem[] lineItems = new LineItem[5]; + + for (int i = 0; i < 5; i++) { + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + i; + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + Goal goal = new Goal(); + goal.units = 500000L; + goal.unitType = UnitType.IMPRESSIONS; + lineItem.primaryGoal = goal; + + lineItems[i] = lineItem; + } + + try { + // Create the line items on the server. + lineItems = lineItemService.createLineItems(lineItems); + + if (lineItems != null) { + foreach (LineItem lineItem in lineItems) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and" + + " named \"{2}\" was created.", lineItem.id, lineItem.orderId, lineItem.name); + } + } else { + Console.WriteLine("No line items created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/LineItemService/CreateVideoLineItem.cs b/examples/Dfp/CSharp/v201405/LineItemService/CreateVideoLineItem.cs new file mode 100644 index 00000000000..ad2eccce487 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/LineItemService/CreateVideoLineItem.cs @@ -0,0 +1,189 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates a new line item to serve to video content. To + /// determine which line items exist, run GetAllLineItems.cs. To determine + /// which orders exist, run GetAllOrders.cs. To create a video ad unit, run + /// CreateVideoAdUnit.cs. To create criteria for categories, run + /// CreateCustomTargetingKeysAndValues.cs. + /// + /// Tags: LineItemService.createLineItems + /// + class CreateVideoLineItem : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a new line item to serve to video content. To determine" + + " which line items exist, run GetAllLineItems.cs. To determine which orders exist, " + + "run GetAllOrders.cs. To create a video ad unit, run CreateVideoAdUnit.cs. To " + + "create criteria for categories, run CreateCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateVideoLineItem(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201405.LineItemService); + + // Set the order that all created line items will belong to and the + // video ad unit ID to target. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + string targetedVideoAdUnitId = _T("INSERT_TARGETED_VIDEO_AD_UNIT_ID_HERE"); + + // Set the custom targeting key ID and value ID representing the metadata + // on the content to target. This would typically be a key representing + // a "genre" and a value representing something like "comedy". + long contentCustomTargetingKeyId = + long.Parse(_T("INSERT_CONTENT_CUSTOM_TARGETING_KEY_ID_HERE")); + long contentCustomTargetingValueId = + long.Parse(_T("INSERT_CONTENT_CUSTOM_TARGETING_VALUE_ID_HERE")); + + // Create custom criteria for the content metadata targeting. + CustomCriteria contentCustomCriteria = new CustomCriteria(); + contentCustomCriteria.keyId = contentCustomTargetingKeyId; + contentCustomCriteria.valueIds = new long[] {contentCustomTargetingValueId}; + contentCustomCriteria.@operator = CustomCriteriaComparisonOperator.IS; + + // Create custom criteria set. + CustomCriteriaSet customCriteriaSet = new CustomCriteriaSet(); + customCriteriaSet.children = new CustomCriteriaNode[] {contentCustomCriteria}; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + AdUnitTargeting adUnitTargeting = new AdUnitTargeting(); + adUnitTargeting.adUnitId = targetedVideoAdUnitId; + adUnitTargeting.includeDescendants = true; + inventoryTargeting.targetedAdUnits = new AdUnitTargeting[] {adUnitTargeting}; + + // Create video position targeting. + VideoPosition videoPosition = new VideoPosition(); + videoPosition.positionType = VideoPositionType.PREROLL; + VideoPositionTarget videoPositionTarget = new VideoPositionTarget(); + videoPositionTarget.videoPosition = videoPosition; + VideoPositionTargeting videoPositionTargeting = new VideoPositionTargeting(); + videoPositionTargeting.targetedPositions = new VideoPositionTarget[] {videoPositionTarget}; + + // Create targeting. + Targeting targeting = new Targeting(); + targeting.customTargeting = customCriteriaSet; + targeting.inventoryTargeting = inventoryTargeting; + targeting.videoPositionTargeting = videoPositionTargeting; + + // Create local line item object. + LineItem lineItem = new LineItem(); + lineItem.name = "Video line item - " + this.GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = targeting; + lineItem.lineItemType = LineItemType.SPONSORSHIP; + lineItem.allowOverbook = true; + + // Set the environment type to video. + lineItem.environmentType = EnvironmentType.VIDEO_PLAYER; + + // Set the creative rotation type to optimized. + lineItem.creativeRotationType = CreativeRotationType.OPTIMIZED; + + // Create the master creative placeholder. + CreativePlaceholder creativeMasterPlaceholder = new CreativePlaceholder(); + Size size1 = new Size(); + size1.width = 400; + size1.height = 300; + size1.isAspectRatio = false; + creativeMasterPlaceholder.size = size1; + + // Create companion creative placeholders. + CreativePlaceholder companionCreativePlaceholder1 = new CreativePlaceholder(); + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + size2.isAspectRatio = false; + companionCreativePlaceholder1.size = size2; + + CreativePlaceholder companionCreativePlaceholder2 = new CreativePlaceholder(); + Size size3 = new Size(); + size3.width = 728; + size3.height = 90; + size3.isAspectRatio = false; + companionCreativePlaceholder2.size = size3; + + // Set companion creative placeholders. + creativeMasterPlaceholder.companions = new CreativePlaceholder[] { + companionCreativePlaceholder1, companionCreativePlaceholder2}; + + // Set the size of creatives that can be associated with this line item. + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativeMasterPlaceholder}; + + // Set delivery of video companions to optional. + lineItem.companionDeliveryOption = CompanionDeliveryOption.OPTIONAL; + + // Set the length of the line item to run. + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromString("20120901 00:00:00"); + + // Set the cost per day to $1. + lineItem.costType = CostType.CPD; + Money money = new Money(); + money.currencyCode = "USD"; + money.microAmount = 1000000L; + lineItem.costPerUnit = money; + + // Set the percentage to be 100%. + Goal goal = new Goal(); + goal.units = 100; + goal.unitType = UnitType.IMPRESSIONS; + lineItem.primaryGoal = goal; + + try { + // Create the line item on the server. + LineItem[] createdLineItems = lineItemService.createLineItems(new LineItem[] {lineItem}); + + foreach (LineItem createdLineItem in createdLineItems) { + Console.WriteLine("A line item with ID \"{0}\", belonging to order ID \"{1}\", and " + + "named \"{2}\" was created.", createdLineItem.id, createdLineItem.orderId, + createdLineItem.name); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/LineItemService/GetAllLineItems.cs b/examples/Dfp/CSharp/v201405/LineItemService/GetAllLineItems.cs new file mode 100644 index 00000000000..3f97efb04e6 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/LineItemService/GetAllLineItems.cs @@ -0,0 +1,92 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all line items. To create line items, run + /// CreateLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// + class GetAllLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items. To create line items, run " + + "CreateLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201405.LineItemService); + + // Create a Statement to get all line items. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Sets default for page. + LineItemPage page = new LineItemPage(); + try { + do { + // Get line items by Statement. + page = lineItemService.getLineItemsByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItemSummary lineItem in page.results) { + Console.WriteLine("{0}) Line item with ID = '{1}', belonging to order ID ='{2}'" + + " , and named '{3}' was found.", i, lineItem.id, lineItem.orderId, + lineItem.name); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/LineItemService/GetLineItemsByStatement.cs b/examples/Dfp/CSharp/v201405/LineItemService/GetLineItemsByStatement.cs new file mode 100644 index 00000000000..358eeda5c2c --- /dev/null +++ b/examples/Dfp/CSharp/v201405/LineItemService/GetLineItemsByStatement.cs @@ -0,0 +1,97 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all line items for the given order. To create line items, + /// run CreateLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// + class GetLineItemsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items for the given order. To create line items, " + + "run CreateLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLineItemsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201405.LineItemService); + + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create a statement to only select line items that need creatives from a + // given order. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("orderId = :orderId AND status = :status") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("orderId", orderId) + .AddValue("status", ComputedStatus.NEEDS_CREATIVES.ToString()); + + // Set default for page. + LineItemPage page = new LineItemPage(); + + try { + do { + // Get line items by Statement. + page = lineItemService.getLineItemsByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (LineItem lineItem in page.results) { + Console.WriteLine("{0}) Line item with ID ='{1}', belonging to order ID = '{2}' " + + "and named '{3}' was found.", i, lineItem.id, lineItem.orderId, lineItem.name); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get line item by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/LineItemService/GetRecentlyUpdatedLineItems.cs b/examples/Dfp/CSharp/v201405/LineItemService/GetRecentlyUpdatedLineItems.cs new file mode 100644 index 00000000000..b11e9d1da4e --- /dev/null +++ b/examples/Dfp/CSharp/v201405/LineItemService/GetRecentlyUpdatedLineItems.cs @@ -0,0 +1,98 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; +using Google.Api.Ads.Dfp.Util.v201405; + +using System; + +using DateTime = Google.Api.Ads.Dfp.v201405.DateTime; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example shows how to get recently updated line items. To create + /// line items, run CreateLineItems.cs. + /// + /// Tags: LineItemService.GetRecentlyUpdatedLineItems + /// + class GetRecentlyUpdatedLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example shows how to get recently updated line items. To create " + + "line items, run CreateLineItems.cs"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetRecentlyUpdatedLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201405.LineItemService); + + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create statement to only select line items for the given order that + // have been modified in the last 3 days. + DateTime threeDaysAgo = DateTimeUtilities.FromDateTime(System.DateTime.Now.AddDays(-3)); + StatementBuilder statementBuilder = new StatementBuilder() + .Where("lastModifiedDateTime >= :lastModifiedDateTime AND orderId = :orderId") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("lastModifiedDateTime", threeDaysAgo) + .AddValue("orderId", orderId); + + // Set default for page. + LineItemPage page = new LineItemPage(); + + try { + do { + // Get line items by statement. + page = lineItemService.getLineItemsByStatement(statementBuilder.ToStatement()); + + // Display results. + if (page != null && page.results != null) { + foreach (LineItem lineItem in page.results) { + Console.WriteLine("Line item with id \"{0}\", belonging to order id \"{1}\" and " + + "named \"{2}\" was found.", lineItem.id, lineItem.orderId, lineItem.name); + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while(statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {1}.", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/LineItemService/TargetCustomCriteria.cs b/examples/Dfp/CSharp/v201405/LineItemService/TargetCustomCriteria.cs new file mode 100644 index 00000000000..3e1e093f1a0 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/LineItemService/TargetCustomCriteria.cs @@ -0,0 +1,173 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + + /// + /// This code example updates a line item to add custom criteria targeting. To + /// determine which line items exist, run GetAllLineItems.cs. To determine + /// which custom targeting keys and values exist, run + /// GetAllCustomTargetingKeysAndValues.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement, LineItemService.updateLineItems + /// + class TargetCustomCriteria : SampleBase { + + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a line item to add custom criteria targeting. To " + + "determine which line items exist, run GetAllLineItems.cs. To determine which custom " + + "targeting keys and values exist, run GetAllCustomTargetingKeysAndValues.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new TargetCustomCriteria(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = (LineItemService) user.GetService( + DfpService.v201405.LineItemService); + + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + long[] customCriteriaIds1 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + long[] customCriteriaIds2 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + long[] customCriteriaIds3 = + new long[] {long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE")), + long.Parse(_T("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE"))}; + + // Create custom criteria. + CustomCriteria customCriteria1 = new CustomCriteria(); + customCriteria1.keyId = customCriteriaIds1[0]; + customCriteria1.valueIds = new long[] {customCriteriaIds1[1]}; + customCriteria1.@operator = CustomCriteriaComparisonOperator.IS; + + CustomCriteria customCriteria2 = new CustomCriteria(); + customCriteria2.keyId = customCriteriaIds2[0]; + customCriteria2.valueIds = new long[] {customCriteriaIds2[1]}; + customCriteria2.@operator = CustomCriteriaComparisonOperator.IS_NOT; + + CustomCriteria customCriteria3 = new CustomCriteria(); + customCriteria3.keyId = customCriteriaIds3[0]; + customCriteria3.valueIds = new long[] {customCriteriaIds3[1]}; + customCriteria3.@operator = CustomCriteriaComparisonOperator.IS; + + // Create the custom criteria set that will resemble: + // + // (customCriteria1.key == customCriteria1.value OR + // (customCriteria2.key != customCriteria2.value AND + // customCriteria3.key == customCriteria3.value)) + CustomCriteriaSet topCustomCriteriaSet = new CustomCriteriaSet(); + topCustomCriteriaSet.logicalOperator = CustomCriteriaSetLogicalOperator.OR; + + CustomCriteriaSet subCustomCriteriaSet = new CustomCriteriaSet(); + subCustomCriteriaSet.logicalOperator = CustomCriteriaSetLogicalOperator.AND; + subCustomCriteriaSet.children = + new CustomCriteriaNode[] {customCriteria2, customCriteria3}; + topCustomCriteriaSet.children = + new CustomCriteriaNode[] {customCriteria1, subCustomCriteriaSet}; + + try { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", lineItemId); + // Set the custom criteria targeting on the line item. + LineItemPage page = lineItemService.getLineItemsByStatement(statementBuilder.ToStatement()); + LineItem lineItem = page.results[0]; + lineItem.targeting.customTargeting = topCustomCriteriaSet; + + // Update the line items on the server. + LineItem[] updatedLineItems = lineItemService.updateLineItems(new LineItem[] { lineItem }); + + foreach (LineItem updatedLineItem in updatedLineItems) { + // Display the updated line item. + Console.WriteLine("Line item with ID {0} updated with custom criteria targeting \n{1}\n", + updatedLineItem.id, + getCustomCriteriaSetString(updatedLineItem.targeting.customTargeting, 0)); + } + } catch (Exception ex) { + Console.WriteLine("Failed to add custom target criteria. Exception says \"{0}\"", + ex.Message); + } + } + + /// + /// Gets a string representation of the custom criteria node. If it has + /// children, each child will be appended to the string recursively. + /// + /// The root custom criteria node. + /// The level of the custom criteria tree. + /// + /// A string representation of the custom criteria node and its + /// children + /// + private static string getCustomCriteriaSetString(CustomCriteriaNode root, int level) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < level; i++) { + sb.Append("\t"); + } + + if (root is CustomCriteria) { + CustomCriteria customCriteria = (CustomCriteria) root; + StringBuilder ids = new StringBuilder(); + for (int j = 0; j < customCriteria.valueIds.Length; j++) { + ids.Append(customCriteria.valueIds[j] + ", "); + } + + sb.AppendFormat("Custom criteria: operator: [{0}] key: [{1}] values: [{2}]\n", + customCriteria.@operator, customCriteria.keyId, ids.ToString().TrimEnd(',', ' ')); + return sb.ToString(); + } else if (root is CustomCriteriaSet) { + CustomCriteriaSet customCriteriaSet = (CustomCriteriaSet) root; + sb.AppendFormat("Custom criteria set: operator: [{0}] children: \n", + customCriteriaSet.logicalOperator); + foreach (CustomCriteriaNode node in customCriteriaSet.children) { + sb.Append(getCustomCriteriaSetString(node, level + 1)); + } + return sb.Append("\n").ToString(); + } else { + throw new Exception("Unexpected node: " + root.CustomCriteriaNodeType); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/LineItemService/UpdateLineItems.cs b/examples/Dfp/CSharp/v201405/LineItemService/UpdateLineItems.cs new file mode 100644 index 00000000000..54077ff5de7 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/LineItemService/UpdateLineItems.cs @@ -0,0 +1,100 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example updates the delivery rate of a line items. + /// To determine which line items exist, run GetAllLineItems.cs. + /// + /// Tags: LineItemService.getLineItemsByStatement + /// Tags: LineItemService.updateLineItems + /// + class UpdateLineItems : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the delivery rate of a line item. To determine which " + + "line items exist, run GetAllLineItems.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateLineItems(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201405.LineItemService); + + // Set the ID of the line item. + long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE")); + + // Create a Statement to get the line item. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :lineItemid") + .OrderBy("id ASC") + .Limit(1) + .AddValue("lineItemId", lineItemId); + + try { + // Get line items by Statement. + LineItemPage page = lineItemService.getLineItemsByStatement(statementBuilder.ToStatement()); + + LineItem lineItem = page.results[0]; + + // Update line item object by changing its delivery rate. + lineItem.deliveryRateType = DeliveryRateType.AS_FAST_AS_POSSIBLE; + + // Update the line item on the server. + LineItem[] lineItems = lineItemService.updateLineItems(new LineItem[] {lineItem}); + + if (lineItems != null) { + foreach (LineItem updatedLineItem in lineItems) { + Console.WriteLine("A line item with ID = '{0}', belonging to order ID = '{1}', " + + "named '{2}', and having delivery rate = '{3}' was updated.", + updatedLineItem.id, updatedLineItem.orderId, updatedLineItem.name, + updatedLineItem.deliveryRateType); + } + } else { + Console.WriteLine("No line items updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update line items. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/NetworkService/GetAllNetworks.cs b/examples/Dfp/CSharp/v201405/NetworkService/GetAllNetworks.cs new file mode 100644 index 00000000000..959d1533334 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/NetworkService/GetAllNetworks.cs @@ -0,0 +1,81 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all networks that you have access to with the + /// current login credentials. A networkCode should be left out for this + /// request. + /// + /// Tags: NetworkService.getAllNetworks + /// + class GetAllNetworks : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all networks that you have access to with the current " + + "login credentials. A networkCode should be left out for this request."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllNetworks(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201405.NetworkService); + // Set the networkCode field to null to retrieve all networks you have + // access to. + networkService.RequestHeader.networkCode = null; + + try { + // Get all networks that you have access to with the current login + // credentials. + Network[] networks = networkService.getAllNetworks(); + + int i = 0; + foreach (Network network in networks) { + Console.WriteLine("{0} ) Network with network code \"{1}\" and display name \"{2}\" " + + "was found.", i + 1, network.networkCode, network.displayName); + i++; + } + Console.WriteLine("Number of networks found: {0}", i); + } catch (Exception ex) { + Console.WriteLine("Failed to get all networks. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/NetworkService/GetCurrentNetwork.cs b/examples/Dfp/CSharp/v201405/NetworkService/GetCurrentNetwork.cs new file mode 100644 index 00000000000..1dd6d232422 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/NetworkService/GetCurrentNetwork.cs @@ -0,0 +1,70 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets the current network that you can make requests + /// against. + /// + /// Tags: NetworkService.getCurrentNetwork + /// + class GetCurrentNetwork : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets the current network that you can make requests against."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCurrentNetwork(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201405.NetworkService); + + try { + // Get the current network. + Network network = networkService.getCurrentNetwork(); + + Console.WriteLine("Current network has network code \"{0}\" and display name \"{1}\".", + network.networkCode, network.displayName); + } catch (Exception ex) { + Console.WriteLine("Failed to get current network. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/NetworkService/MakeTestNetwork.cs b/examples/Dfp/CSharp/v201405/NetworkService/MakeTestNetwork.cs new file mode 100644 index 00000000000..4d9aa637634 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/NetworkService/MakeTestNetwork.cs @@ -0,0 +1,85 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates a test network. You do not need to have a DFP + /// account to run this example, but you do need to have a new Google account + /// (created at http://www.google.com/accounts/newaccount) that is not + /// associated with any other DFP networks (including old sandbox networks). + /// Once this network is created, you can supply the network code in your + /// settings to make calls to other services. + /// + /// Please see the following URL for more information: + /// https://developers.google.com/doubleclick-publishers/docs/signup + /// + /// Tags: NetworkService.makeTestNetwork + /// + class MakeTestNetwork : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates a test network. You do not need to have a DFP" + + " account to run this example, but you do need to have a new Google account" + + " (created at http://www.google.com/accounts/newaccount) that is not associated " + + "with any other DFP networks (including old sandbox networks). Once this network " + + "is created, you can supply the network code in your settings to make calls to " + + "other services.\n\n Please see the following URL for more information:" + + " https://developers.google.com/doubleclick-publishers/docs/signup"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new MakeTestNetwork(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the NetworkService. + NetworkService networkService = + (NetworkService) user.GetService(DfpService.v201405.NetworkService); + // Set the networkCode field to null. + networkService.RequestHeader.networkCode = null; + + try { + Network network = networkService.makeTestNetwork(); + + Console.WriteLine("Test network with network code \"{0}\" and display name \"{1}\" " + + "created.\nYou may now sign in at http://www.google.com/dfp/main?networkCode={0}", + network.networkCode, network.displayName); + } catch (Exception ex) { + Console.WriteLine("Failed to make test network. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/OrderService/ApproveOrder.cs b/examples/Dfp/CSharp/v201405/OrderService/ApproveOrder.cs new file mode 100644 index 00000000000..a2682da79af --- /dev/null +++ b/examples/Dfp/CSharp/v201405/OrderService/ApproveOrder.cs @@ -0,0 +1,119 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example approves an order and all line items belonging to that order. To determine + /// which orders exist, run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement, OrderService.performOrderAction + /// + class ApproveOrder : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example approves an order and all line items belonging to that order. " + + "To determine which orders exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ApproveOrder(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = + (OrderService) user.GetService(DfpService.v201405.OrderService); + + // Set the ID of the order. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create Statement to select the order. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", orderId); + + // Set default for page. + OrderPage page = new OrderPage(); + List orderIds = new List(); + int i = 0; + + try { + do { + // Get orders by Statement. + page = orderService.getOrdersByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and status ='{3}' " + + "will be approved.", i, order.id, order.name, order.status); + orderIds.Add(order.id.ToString()); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of orders to be approved: {0}", orderIds.Count); + + if (orderIds.Count > 0) { + // Modify statement for action. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + ApproveAndOverbookOrders action = new ApproveAndOverbookOrders(); + + // Perform action. + UpdateResult result = orderService.performOrderAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of orders approved: {0}", result.numChanges); + } else { + Console.WriteLine("No orders were approved."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to approve orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/OrderService/CreateOrders.cs b/examples/Dfp/CSharp/v201405/OrderService/CreateOrders.cs new file mode 100644 index 00000000000..a1d0d67cf31 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/OrderService/CreateOrders.cs @@ -0,0 +1,96 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates new orders. To determine which orders exist, + /// run GetAllOrders.cs. + /// + /// Tags: OrderService.createOrders + /// + class CreateOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new orders. To determine which orders exist, " + + "run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = + (OrderService) user.GetService(DfpService.v201405.OrderService); + + // Set the advertiser, salesperson, and trafficker to assign to each + // order. + long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); + long salespersonId = long.Parse(_T("INSERT_SALESPERSON_ID_HERE")); + long traffickerId = long.Parse(_T("INSERT_TRAFFICKER_ID_HERE")); + + // Create an array to store local order objects. + Order[] orders = new Order[5]; + + for (int i = 0; i < 5; i++) { + Order order = new Order(); + order.name = string.Format("Order #{0}", i); + order.advertiserId = advertiserId; + order.salespersonId = salespersonId; + order.traffickerId = traffickerId; + + orders[i] = order; + } + + try { + // Create the orders on the server. + orders = orderService.createOrders(orders); + + if (orders != null) { + foreach (Order order in orders) { + Console.WriteLine("An order with ID ='{0}' and named '{1}' was created.", + order.id, order.name); + } + } else { + Console.WriteLine("No orders created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/OrderService/GetAllOrders.cs b/examples/Dfp/CSharp/v201405/OrderService/GetAllOrders.cs new file mode 100644 index 00000000000..5fc69e96fbb --- /dev/null +++ b/examples/Dfp/CSharp/v201405/OrderService/GetAllOrders.cs @@ -0,0 +1,89 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all orders. To create orders, run CreateOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement + /// + class GetAllOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets all orders. To create orders, run CreateOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201405.OrderService); + + // Create a Statement to get all orders. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + OrderPage page = new OrderPage(); + + try { + do { + // Get orders by Statement. + page = orderService.getOrdersByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and advertiser " + + "ID = '{3}' was found.", i, order.id, order.name, order.advertiserId); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/OrderService/GetOrdersByStatement.cs b/examples/Dfp/CSharp/v201405/OrderService/GetOrdersByStatement.cs new file mode 100644 index 00000000000..ddf9865126e --- /dev/null +++ b/examples/Dfp/CSharp/v201405/OrderService/GetOrdersByStatement.cs @@ -0,0 +1,96 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all orders for a given advertiser. To create orders, run + /// CreateOrders.cs. To determine which companies are advertisers, + /// run GetCompaniesByStatement.cs. + /// + /// Tags: OrderService.getOrdersByStatement + /// + class GetOrdersByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all orders for a given advertiser. To create orders, run " + + "CreateOrders.cs. To determine which companies are advertisers,run " + + "GetCompaniesByStatement.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetOrdersByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201405.OrderService); + + // Set the name of the advertiser (company) to get orders for. + String advertiserId = _T("INSERT_ADVERTISER_COMPANY_ID_HERE"); + + // Create a Statement to only select orders for a given advertiser. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("advertiserId = :advertiserId") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("advertiserId", advertiserId); + + // Set default for page. + OrderPage page = new OrderPage(); + + try { + do { + // Get orders by Statement. + page = orderService.getOrdersByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Order order in page.results) { + Console.WriteLine("{0}) Order with ID = '{1}', name = '{2}', and advertiser " + + "ID = '{3}' was found.", i, order.id, order.name, order.advertiserId); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while(statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get orders by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/OrderService/UpdateOrders.cs b/examples/Dfp/CSharp/v201405/OrderService/UpdateOrders.cs new file mode 100644 index 00000000000..94a292e408b --- /dev/null +++ b/examples/Dfp/CSharp/v201405/OrderService/UpdateOrders.cs @@ -0,0 +1,96 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example updates the note of an order. To determine which orders exist, + /// run GetAllOrders.cs. + /// + /// Tags: OrderService.getOrdersByStatement, OrderService.updateOrders + /// + class UpdateOrders : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates the note of an order. To determine which orders " + + "exist, run GetAllOrders.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateOrders(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201405.OrderService); + + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create a Statement to get the order. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", orderId); + + try { + // Get orders by Statement. + OrderPage page = orderService.getOrdersByStatement(statementBuilder.ToStatement()); + + Order order = page.results[0]; + + // Update the order object by changing its note. + order.notes = "Spoke to advertiser. All is well."; + + // Update the orders on the server. + Order[] orders = orderService.updateOrders(new Order[] {order}); + + if (orders != null) { + foreach (Order updatedOrder in orders) { + Console.WriteLine("Order with ID = '{0}', name = '{1}', advertiser ID = '{2}', " + + "and notes = '{3}' was updated.", updatedOrder.id, updatedOrder.name, + updatedOrder.advertiserId, updatedOrder.notes); + } + } else { + Console.WriteLine("No orders updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update orders. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/PlacementService/CreatePlacements.cs b/examples/Dfp/CSharp/v201405/PlacementService/CreatePlacements.cs new file mode 100644 index 00000000000..32fe87937fb --- /dev/null +++ b/examples/Dfp/CSharp/v201405/PlacementService/CreatePlacements.cs @@ -0,0 +1,164 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates new placements for various ad unit sizes. To + /// determine which placements exist, run GetAllPlacements.cs. + /// + /// Tags: InventoryService.getAdUnitsByStatement + /// Tags: PlacementService.createPlacements + /// + class CreatePlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new placements for various ad unit sizes. To determine " + + "which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreatePlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the InventoryService. + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201405.InventoryService); + + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201405.PlacementService); + + // Create local placement object to store skyscraper ad units. + Placement skyscraperAdUnitPlacement = new Placement(); + skyscraperAdUnitPlacement.name = string.Format("Skyscraper AdUnit Placement #{0}", + this.GetTimeStamp()); + skyscraperAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 120x600"; + + // Create local placement object to store medium square ad units. + Placement mediumSquareAdUnitPlacement = new Placement(); + mediumSquareAdUnitPlacement.name = string.Format("Medium Square AdUnit Placement #{0}", + this.GetTimeStamp()); + mediumSquareAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 300x250"; + + // Create local placement object to store banner ad units. + Placement bannerAdUnitPlacement = new Placement(); + bannerAdUnitPlacement.name = string.Format("Banner AdUnit Placement #{0}", + this.GetTimeStamp()); + bannerAdUnitPlacement.description = "Contains ad units that can hold creatives " + + "of size 468x60"; + + List placementList = new List(); + + // Get the first 500 ad units. + Statement statement = new Statement(); + statement.query = "LIMIT 500"; + + List mediumSquareTargetedUnitIds = new List(); + List skyscraperTargetedUnitIds = new List(); + List bannerTargetedUnitIds = new List(); + + try { + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + + // Separate the ad units by size. + if (page.results != null) { + foreach (AdUnit adUnit in page.results) { + if (adUnit.parentId != null && adUnit.adUnitSizes != null) { + foreach (AdUnitSize adUnitSize in adUnit.adUnitSizes) { + Size size = adUnitSize.size; + if (size.width == 300 && size.height == 250) { + if (!mediumSquareTargetedUnitIds.Contains(adUnit.id)) { + mediumSquareTargetedUnitIds.Add(adUnit.id); + } + } else if (size.width == 120 && size.height == 600) { + if (!skyscraperTargetedUnitIds.Contains(adUnit.id)) { + skyscraperTargetedUnitIds.Add(adUnit.id); + } + } else if (size.width == 468 && size.height == 60) { + if (!bannerTargetedUnitIds.Contains(adUnit.id)) { + bannerTargetedUnitIds.Add(adUnit.id); + } + } + } + } + } + } + mediumSquareAdUnitPlacement.targetedAdUnitIds = mediumSquareTargetedUnitIds.ToArray(); + skyscraperAdUnitPlacement.targetedAdUnitIds = skyscraperTargetedUnitIds.ToArray(); + bannerAdUnitPlacement.targetedAdUnitIds = bannerTargetedUnitIds.ToArray(); + + + // Only create placements with one or more ad unit. + if (mediumSquareAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(mediumSquareAdUnitPlacement); + } + + if (skyscraperAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(skyscraperAdUnitPlacement); + } + + if (bannerAdUnitPlacement.targetedAdUnitIds.Length != 0) { + placementList.Add(bannerAdUnitPlacement); + } + + Placement[] placements = + placementService.createPlacements(placementList.ToArray()); + + // Display results. + if (placements != null) { + foreach (Placement placement in placements) { + Console.Write("A placement with ID = '{0}', name ='{1}', and containing " + + "ad units {{", placement.id, placement.name); + + foreach (string adUnitId in placement.targetedAdUnitIds) { + Console.Write("{0}, ", adUnitId); + } + Console.WriteLine("} was created."); + } + } else { + Console.WriteLine("No placements created."); + } + + } catch (Exception ex) { + Console.WriteLine("Failed to create placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/PlacementService/DeactivatePlacement.cs b/examples/Dfp/CSharp/v201405/PlacementService/DeactivatePlacement.cs new file mode 100644 index 00000000000..3048bb763e8 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/PlacementService/DeactivatePlacement.cs @@ -0,0 +1,117 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example deactivates a placement. To determine which + /// placements exist, run GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// Tags: PlacementService.performPlacementAction + /// + class DeactivatePlacement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates a placement. To determine which " + + "placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivatePlacement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201405.PlacementService); + + // Create Statement to select active placements. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("status = :status") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("status", InventoryStatus.ACTIVE.ToString()); + + // Sets default for page. + PlacementPage page = new PlacementPage(); + List placementIds = new List(); + + try { + do { + // Get placements by Statement. + page = placementService.getPlacementsByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID ='{1}', name ='{2}', and status ='{3}'" + + " will be deactivated.", i, placement.id, placement.name, placement.status); + placementIds.Add(placement.id.ToString()); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of placements to be deactivated: {0}", placementIds.Count); + + if (placementIds.Count > 0) { + // Modify statement for action. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + DeactivatePlacements action = new DeactivatePlacements(); + + // Perform action. + UpdateResult result = placementService.performPlacementAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of placements deactivated: {0}", result.numChanges); + } else { + Console.WriteLine("No placements were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/PlacementService/GetAllPlacements.cs b/examples/Dfp/CSharp/v201405/PlacementService/GetAllPlacements.cs new file mode 100644 index 00000000000..dfe36fef180 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/PlacementService/GetAllPlacements.cs @@ -0,0 +1,91 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all placements. To create placements, run + /// CreatePlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// + class GetAllPlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all placements. To create placements, run " + + "CreatePlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllPlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201405.PlacementService); + + // Sets defaults for page and Statement. + PlacementPage page = new PlacementPage(); + Statement statement = new Statement(); + int offset = 0; + + try { + do { + // Create a Statement to get all ad units. + statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); + + // Get ad units by Statement. + page = placementService.getPlacementsByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID = '{1}' and name = '{2}' was found.", + i, placement.id, placement.name); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}" + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/PlacementService/GetPlacementsByStatement.cs b/examples/Dfp/CSharp/v201405/PlacementService/GetPlacementsByStatement.cs new file mode 100644 index 00000000000..9b3e2b4b1d7 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/PlacementService/GetPlacementsByStatement.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all active placements by using a Statement. To + /// create a placement, run CreatePlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// + class GetPlacementsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all active placements by using a Statement. To create a " + + "placement, run CreatePlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetPlacementsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201405.PlacementService); + + // Create a Statement to only select active placements. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("status = :status") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("status", InventoryStatus.ACTIVE.ToString()); + + // Set default for page + PlacementPage page = new PlacementPage(); + + try { + do { + // Get placements by Statement. + page = placementService.getPlacementsByStatement(statementBuilder.ToStatement()); + + // Display results. + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (Placement placement in page.results) { + Console.WriteLine("{0}) Placement with ID = '{1}', name ='{2}', and status = '{3}' " + + "was found.", i, placement.id, placement.name, placement.status); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get placement by Statement. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/PlacementService/UpdatePlacements.cs b/examples/Dfp/CSharp/v201405/PlacementService/UpdatePlacements.cs new file mode 100644 index 00000000000..e9b61890cb5 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/PlacementService/UpdatePlacements.cs @@ -0,0 +1,101 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example updates all placements to allow for AdSense targeting + /// up to the first 500. To determine which placements exist, run + /// GetAllPlacements.cs. + /// + /// Tags: PlacementService.getPlacementsByStatement + /// Tags: PlacementService.updatePlacements + /// + class UpdatePlacements : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates all placements to allow for AdSense targeting up to " + + "the first 500. To determine which placements exist, run GetAllPlacements.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdatePlacements(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PlacementService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201405.PlacementService); + + // Create a statement to select first 500 placements. + Statement filterStatement = new Statement(); + filterStatement.query = "LIMIT 500"; + + try { + // Get placements by statement. + PlacementPage page = placementService.getPlacementsByStatement(filterStatement); + + if (page.results != null) { + Placement[] placements = page.results; + + // Update each local placement object by enabling AdSense targeting. + foreach (Placement placement in placements) { + placement.targetingDescription = (string.IsNullOrEmpty(placement.description))? + "Generic description" : placement.description; + placement.targetingAdLocation = "All images on sports pages."; + placement.targetingSiteName = "http://code.google.com"; + placement.isAdSenseTargetingEnabled = true; + } + + // Update the placements on the server. + placements = placementService.updatePlacements(placements); + + // Display results. + if (placements != null) { + foreach (Placement placement in placements) { + Console.WriteLine("A placement with ID \"{0}\", name \"{1}\", and AdSense targeting" + + " enabled \"{2}\" was updated.", placement.id, placement.name, + placement.isAdSenseTargetingEnabled); + } + } else { + Console.WriteLine("No placements updated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to update placements. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/PublisherQueryLanguageService/FetchMatchTables.cs b/examples/Dfp/CSharp/v201405/PublisherQueryLanguageService/FetchMatchTables.cs new file mode 100644 index 00000000000..b6dc2a3a10e --- /dev/null +++ b/examples/Dfp/CSharp/v201405/PublisherQueryLanguageService/FetchMatchTables.cs @@ -0,0 +1,119 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example fetches and creates match table files from the + /// Line_Item and Ad_Unit tables. This example may take a while to run. + /// + /// Tags: PublisherQueryLanguageService.select + /// + class FetchMatchTables : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example fetches and creates match table files from the Line_Item " + + "and Ad_Unit tables. This example may take a while to run."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new FetchMatchTables(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PublisherQueryLanguageService. + PublisherQueryLanguageService pqlService = + (PublisherQueryLanguageService) user.GetService( + DfpService.v201405.PublisherQueryLanguageService); + + try { + StatementBuilder lineItemStatementBuilder = new StatementBuilder() + .Select("Id, Name, Status") + .From("Line_Item") + .OrderBy("Id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + string lineItemFilePath = "Line-Item-Matchtable.csv"; + fetchMatchTables(pqlService, lineItemStatementBuilder, lineItemFilePath); + + StatementBuilder adUnitStatementBuilder = new StatementBuilder() + .Select("Id, Name") + .From("Ad_Unit") + .OrderBy("Id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + string adUnitFilePath = "Ad-Unit-Matchtable.csv"; + fetchMatchTables(pqlService, adUnitStatementBuilder, adUnitFilePath); + + Console.WriteLine("Ad units saved to %s", adUnitFilePath); + Console.WriteLine("Line items saved to %s\n", lineItemFilePath); + } catch (Exception ex) { + Console.WriteLine("Failed to get match tables. Exception says \"{0}\"", ex.Message); + } + } + + /// + /// Fetches a match table from a PQL statement and writes it to a file. + /// + /// The PQL service. + /// The select statement. + /// Name of the file. + private static void fetchMatchTables(PublisherQueryLanguageService pqlService, + StatementBuilder statementBuilder, string fileName) { + + int resultSetSize = 0; + List allRows = new List(); + ResultSet resultSet; + + do { + resultSet = pqlService.select(statementBuilder.ToStatement()); + allRows.AddRange(resultSet.rows); + Console.WriteLine(PqlUtilities.ResultSetToString(resultSet)); + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + resultSetSize = resultSet.rows == null ? 0 : resultSet.rows.Length; + } while (resultSetSize > 0); + + resultSet.rows = allRows.ToArray(); + List rows = PqlUtilities.ResultSetToStringArrayList(resultSet); + + // Write the contents to a csv file. + CsvFile file = new CsvFile(); + file.Headers.AddRange(rows[0]); + file.Records.AddRange(rows.GetRange(1, rows.Count - 1).ToArray()); + file.Write(fileName); + } + } +} diff --git a/examples/Dfp/CSharp/v201405/PublisherQueryLanguageService/GetAllLineItemsUsingPql.cs b/examples/Dfp/CSharp/v201405/PublisherQueryLanguageService/GetAllLineItemsUsingPql.cs new file mode 100644 index 00000000000..2c882c4739f --- /dev/null +++ b/examples/Dfp/CSharp/v201405/PublisherQueryLanguageService/GetAllLineItemsUsingPql.cs @@ -0,0 +1,109 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all line items in your network using the Line_Item + /// table. This code example may take a while to run. The Line_Item PQL table + /// schema can be found here: + /// https://developers.google.com/doubleclick-publishers/docs/reference/v201405/PublisherQueryLanguageService#Line_Item + /// + /// Tags: PublisherQueryLanguageService.select + /// + class GetAllLineItemsUsingPql : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items in your network using the Line_Item table. " + + "This code example may take a while to run. The Line_Item PQL table schema can be " + + "found here: https://developers.google.com/doubleclick-publishers/docs/reference/v201405/PublisherQueryLanguageService#Line_Item"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllLineItemsUsingPql(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PublisherQueryLanguageService. + PublisherQueryLanguageService pqlService = + (PublisherQueryLanguageService) user.GetService( + DfpService.v201405.PublisherQueryLanguageService); + + // Create statement to select all line items. + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Id, Name, Status") + .From("Line_Item") + .OrderBy ("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + int resultSetSize = 0; + List allRows = new List(); + ResultSet resultSet; + + try { + do { + // Get all line items. + resultSet = pqlService.select(statementBuilder.ToStatement()); + + // Collect all line items from each page. + allRows.AddRange(resultSet.rows); + + // Display results. + Console.WriteLine(PqlUtilities.ResultSetToString(resultSet)); + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + resultSetSize = resultSet.rows == null ? 0 : resultSet.rows.Length; + } while (resultSetSize > 0); + + Console.WriteLine("Number of results found: " + allRows.Count); + + // Optionally, save all rows to a CSV. + // Get a string array representation of the data rows. + resultSet.rows = allRows.ToArray(); + List rows = PqlUtilities.ResultSetToStringArrayList(resultSet); + + // Write the contents to a csv file. + CsvFile file = new CsvFile(); + file.Headers.AddRange(rows[0]); + file.Records.AddRange(rows.GetRange(1, rows.Count - 1).ToArray()); + file.Write("line_items_" + this.GetTimeStamp() + ".csv"); + } catch (Exception ex) { + Console.WriteLine("Failed to get all line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/PublisherQueryLanguageService/GetGeoTargets.cs b/examples/Dfp/CSharp/v201405/PublisherQueryLanguageService/GetGeoTargets.cs new file mode 100644 index 00000000000..8d26affaa3e --- /dev/null +++ b/examples/Dfp/CSharp/v201405/PublisherQueryLanguageService/GetGeoTargets.cs @@ -0,0 +1,116 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets geographic criteria from the Geo_Target table, + /// such as all cities available to target. Other types include 'Country', + /// 'Region', 'State', 'Postal_Code', and 'DMA_Region' (i.e. Metro). + /// A full list of available geo target types can be found at + /// https://developers.google.com/doubleclick-publishers/docs/reference/v201405/PublisherQueryLanguageService + /// + /// Tags: PublisherQueryLanguageService.select + /// + class GetGeoTargets : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets geographic criteria from the Geo_Target table, such as " + + "all cities available to target. Other types include 'Country', 'Region', 'State', " + + "'Postal_Code', and 'DMA_Region' (i.e. Metro). A full list of available geo target " + + "types can be found at https://developers.google.com/doubleclick-publishers/docs/reference/v201405/PublisherQueryLanguageService"; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetGeoTargets(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PublisherQueryLanguageService. + PublisherQueryLanguageService pqlService = + (PublisherQueryLanguageService) user.GetService( + DfpService.v201405.PublisherQueryLanguageService); + + string geoType = "City"; + + // Create statement to select all targetable cities. + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Id, Name, CanonicalParentId, ParentIds, CountryCode") + .From("Geo_Target") + .Where("Type = :type and Targetable = true") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("type", geoType); + + int resultSetSize = 0; + List allRows = new List(); + ResultSet resultSet; + + try { + do { + // Get all cities. + resultSet = pqlService.select(statementBuilder.ToStatement()); + + // Collect all cities from each page. + allRows.AddRange(resultSet.rows); + + // Display results. + Console.WriteLine(PqlUtilities.ResultSetToString(resultSet)); + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + resultSetSize = resultSet.rows == null ? 0 : resultSet.rows.Length; + } while (resultSetSize > 0); + + Console.WriteLine("Number of results found: " + allRows.Count); + + // Optionally, save all rows to a CSV. + // Get a string array representation of the data rows. + resultSet.rows = allRows.ToArray(); + List rows = PqlUtilities.ResultSetToStringArrayList(resultSet); + + // Write the contents to a csv file. + CsvFile file = new CsvFile(); + file.Headers.AddRange(rows[0]); + file.Records.AddRange(rows.GetRange(1, rows.Count - 1).ToArray()); + file.Write(geoType + "_" + this.GetTimeStamp() + ".csv"); + } catch (Exception ex) { + Console.WriteLine("Failed to get Geo type = '{0}'. Exception says \"{1}\"", + geoType, ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/PublisherQueryLanguageService/GetLineItemsNamedLike.cs b/examples/Dfp/CSharp/v201405/PublisherQueryLanguageService/GetLineItemsNamedLike.cs new file mode 100644 index 00000000000..2f3a0cf78cf --- /dev/null +++ b/examples/Dfp/CSharp/v201405/PublisherQueryLanguageService/GetLineItemsNamedLike.cs @@ -0,0 +1,107 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all line items which have a name beginning with + /// "line item". This code example may take a while to run. + /// + /// Tags: PublisherQueryLanguageService.select + /// + class GetLineItemsNamedLike : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all line items which have a name beginning with " + + "'line item'. This code example may take a while to run."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetLineItemsNamedLike(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the PublisherQueryLanguageService. + PublisherQueryLanguageService pqlService = + (PublisherQueryLanguageService) user.GetService( + DfpService.v201405.PublisherQueryLanguageService); + + // Create statement to select all line items named like 'line item%'. + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Id, Name, Status") + .From("Line_Item") + .Where("Name LIKE 'line item%'") + .OrderBy("Id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + List allRows = new List(); + ResultSet resultSet; + int resultSetSize = 0; + + try { + do { + // Get line items like 'line item%'. + resultSet = pqlService.select(statementBuilder.ToStatement()); + + // Collect all line items from each page. + allRows.AddRange(resultSet.rows); + + // Display results. + Console.WriteLine(PqlUtilities.ResultSetToString(resultSet)); + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + resultSetSize = resultSet.rows == null ? 0 : resultSet.rows.Length; + } while (resultSetSize > 0); + + Console.WriteLine("Number of results found: " + allRows.Count); + + // Optionally, save all rows to a CSV. + // Get a string array representation of the data rows. + resultSet.rows = allRows.ToArray(); + List rows = PqlUtilities.ResultSetToStringArrayList(resultSet); + + // Write the contents to a csv file. + CsvFile file = new CsvFile(); + file.Headers.AddRange(rows[0]); + file.Records.AddRange(rows.GetRange(1, rows.Count - 1).ToArray()); + file.Write("line_items_named_like_" + GetTimeStamp() + ".csv"); + } catch (Exception ex) { + Console.WriteLine("Failed to get line items. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ReportService/DisplayReport.cs b/examples/Dfp/CSharp/v201405/ReportService/DisplayReport.cs new file mode 100644 index 00000000000..c39c51d11d2 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ReportService/DisplayReport.cs @@ -0,0 +1,87 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example downloads a completed report and prints out its + /// contents. To download a completed report to a file, run DownloadReport.cs. + /// To run a report, run RunDeliveryReport.cs. + /// + /// Tags: ReportService.getReportDownloadUrlWithOptions + /// + class DisplayReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example downloads a completed report and prints out its contents. " + + "To download a completed report to a file, run DownloadReport.cs. To run a report, " + + "run RunDeliveryReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DisplayReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201405.ReportService); + + // Set the id of the completed report. + long reportJobId = long.Parse(_T("INSERT_REPORT_JOB_ID_HERE")); + ExportFormat exportFormat = (ExportFormat) Enum.Parse(typeof(ExportFormat), + _T("INSERT_EXPORT_FORMAT_HERE")); + + // Set the format of the report (e.g., CSV_DUMP) and download without + // compression so we can print it. + ReportDownloadOptions reportDownloadOptions = new ReportDownloadOptions(); + reportDownloadOptions.exportFormat = exportFormat; + reportDownloadOptions.useGzipCompression = false; + + try { + // Download report data. + string downloadUrl = reportService.getReportDownloadUrlWithOptions(reportJobId, + reportDownloadOptions); + byte[] rawReport = MediaUtilities.GetAssetDataFromUrl(downloadUrl); + string reportContents = Encoding.UTF8.GetString(rawReport); + + // Display results. + Console.WriteLine("Data for report job with id '{0}\':\n{1}", reportJobId, reportContents); + } catch (Exception ex) { + Console.WriteLine("Failed to download report. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ReportService/DownloadReport.cs b/examples/Dfp/CSharp/v201405/ReportService/DownloadReport.cs new file mode 100644 index 00000000000..5e682778a16 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ReportService/DownloadReport.cs @@ -0,0 +1,83 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Text; +using System.IO; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example downloads a completed report. To run a report, run + /// RunDeliveryReport.cs. + /// + /// Tags: ReportService.getReportDownloadURL + /// + class DownloadReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example downloads a completed report. To run a report, run " + + "RunDeliveryReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DownloadReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201405.ReportService); + + // Set the id of the completed report. + long reportJobId = long.Parse(_T("INSERT_REPORT_JOB_ID_HERE")); + String fileName = _T("INSERT_FILE_PATH_HERE"); + + try { + // Download report data. + string url = reportService.getReportDownloadURL(reportJobId, ExportFormat.CSV_EXCEL); + byte[] gzipReport = MediaUtilities.GetAssetDataFromUrl(url); + string reportContents = Encoding.UTF8.GetString(MediaUtilities.DeflateGZipData(gzipReport)); + + using (StreamWriter writer = new StreamWriter(fileName)) { + writer.Write(reportContents); + } + + // Display results. + Console.WriteLine("Report job with id '{0}' was downloaded to '{1}'.", reportJobId, + fileName); + } catch (Exception ex) { + Console.WriteLine("Failed to download report. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ReportService/RunDeliveryReport.cs b/examples/Dfp/CSharp/v201405/ReportService/RunDeliveryReport.cs new file mode 100644 index 00000000000..b689a38fb1a --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ReportService/RunDeliveryReport.cs @@ -0,0 +1,105 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Threading; +using Google.Api.Ads.Dfp.Util.v201405; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example runs a report similar to the "Orders report" on the DFP + /// website with additional attributes and can filter to include just one + /// order. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunDeliveryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report similar to the \"Orders report\" on the DFP " + + "website with additional attributes and can filter to include just one order. To " + + "download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunDeliveryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201405.ReportService); + + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Create statement object to filter for an order. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("ORDER_ID = :id") + .AddValue("id", orderId); + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportJob.reportQuery.dimensionAttributes = new DimensionAttribute[] { + DimensionAttribute.ORDER_TRAFFICKER, DimensionAttribute.ORDER_START_DATE_TIME, + DimensionAttribute.ORDER_END_DATE_TIME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportJob.reportQuery.statement = statementBuilder.ToStatement(); + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ReportService/RunInventoryReport.cs b/examples/Dfp/CSharp/v201405/ReportService/RunInventoryReport.cs new file mode 100644 index 00000000000..c80326d9682 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ReportService/RunInventoryReport.cs @@ -0,0 +1,116 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Threading; +using Google.Api.Ads.Dfp.Util.v201405; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example runs a report equal to the "Whole network report" on the + /// DFP website. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunInventoryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Whole network report\" on the " + + "DFP website. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunInventoryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201405.ReportService); + + // Get the NetworkService. + NetworkService networkService = (NetworkService) user.GetService( + DfpService.v201405.NetworkService); + + // Get the root ad unit ID to filter on. + String rootAdUnitId = networkService.getCurrentNetwork().effectiveRootAdUnitId; + + // Create statement to filter on an ancestor ad unit with the root ad unit ID to include all + // ad units in the network. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("AD_UNIT_ANCESTOR_AD_UNIT_ID = :ancestorAdUnitId") + .AddValue("ancestorAdUnitId", long.Parse(rootAdUnitId)); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dimensions = + new Dimension[] { Dimension.AD_UNIT_ID, Dimension.AD_UNIT_NAME }; + reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + Column.TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + Column.TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE}; + + // Set the filter statement. + reportQuery.statement = statementBuilder.ToStatement(); + + reportQuery.adUnitView = ReportQueryAdUnitView.HIERARCHICAL; + reportQuery.dateRangeType = DateRangeType.LAST_WEEK; + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = reportQuery; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run inventory report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ReportService/RunMergedDeliveryReport.cs b/examples/Dfp/CSharp/v201405/ReportService/RunMergedDeliveryReport.cs new file mode 100644 index 00000000000..0776896b9ca --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ReportService/RunMergedDeliveryReport.cs @@ -0,0 +1,96 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example runs a report that an upgraded publisher would use to + /// include statistics before the upgrade. To download the report see + /// DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunMergedDeliveryReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Orders report\" on the DFP " + + "website with additional attributes. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunMergedDeliveryReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201405.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportQuery.columns = new Column[] {Column.MERGED_AD_SERVER_IMPRESSIONS, + Column.MERGED_AD_SERVER_CLICKS, Column.MERGED_AD_SERVER_CTR, + Column.MERGED_AD_SERVER_CPM_AND_CPC_REVENUE, + Column.MERGED_AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery = reportQuery; + + try { + // Run report job. + reportJob = reportService.runReportJob(reportJob); + + do { + Console.WriteLine("Report with ID '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS); + + if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with ID '{0}' failed to finish successfully.", + reportJob.id); + } else { + Console.WriteLine("Report job with ID '{0}' completed successfully.", reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ReportService/RunReachReport.cs b/examples/Dfp/CSharp/v201405/ReportService/RunReachReport.cs new file mode 100644 index 00000000000..10bcb0ee671 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ReportService/RunReachReport.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Threading; +using Google.Api.Ads.Dfp.Util.v201405; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example runs a reach report. To download the report see + /// DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunReachReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a reach report. To download the report see " + + "DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunReachReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201405.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.REACH_LIFETIME; + reportQuery.dimensions = new Dimension[] {Dimension.LINE_ITEM_ID, Dimension.LINE_ITEM_NAME}; + reportQuery.columns = new Column[] {Column.REACH_FREQUENCY, Column.REACH_AVERAGE_REVENUE, + Column.REACH}; + reportJob.reportQuery = reportQuery; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run delivery report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ReportService/RunReportWithCustomFields.cs b/examples/Dfp/CSharp/v201405/ReportService/RunReportWithCustomFields.cs new file mode 100644 index 00000000000..7e70bc0ef33 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ReportService/RunReportWithCustomFields.cs @@ -0,0 +1,141 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; +using Google.Api.Ads.Dfp.Util.v201405; + +using System; +using System.Threading; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example runs a report that includes custom fields found in the + /// line items of an order. To download the report see DownloadReport.cs. + /// + /// Tag: ReportService.runReportJob + /// Tag: ReportService.getReportJob + /// Tag: LineItemService.getLineItemsByStatement + /// + class RunReportWithCustomFields : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report that includes custom fields found in the " + + "line items of an order. To download the report see DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunReportWithCustomFields(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the LineItemService. + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201405.LineItemService); + // Get the ReportService. + ReportService reportService = + (ReportService) user.GetService(DfpService.v201405.ReportService); + + try { + // Set the ID of the order to get line items from. + long orderId = long.Parse(_T("INSERT_ORDER_ID_HERE")); + + // Sets default for page. + LineItemPage page = new LineItemPage(); + + // Create a statement to only select line items from a given order. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("orderId = :orderId") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("orderId", orderId); + + + // Collect all line item custom field IDs for an order. + List customFieldIds = new List(); + do { + // Get line items by statement. + page = lineItemService.getLineItemsByStatement(statementBuilder.ToStatement()); + + // Get custom field IDs from the line items of an order. + if (page.results != null) { + foreach (LineItem lineItem in page.results) { + if (lineItem.customFieldValues != null) { + foreach (BaseCustomFieldValue customFieldValue in lineItem.customFieldValues) { + if (!customFieldIds.Contains(customFieldValue.customFieldId)) { + customFieldIds.Add(customFieldValue.customFieldId); + } + } + } + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + + // Create statement to filter for an order. + statementBuilder.RemoveLimitAndOffset(); + + // Create report job. + ReportJob reportJob = new ReportJob(); + + // Create report query. + ReportQuery reportQuery = new ReportQuery(); + reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + reportQuery.dimensions = new Dimension[] {Dimension.LINE_ITEM_ID, Dimension.LINE_ITEM_NAME}; + reportQuery.statement = statementBuilder.ToStatement(); + reportQuery.customFieldIds = customFieldIds.ToArray(); + reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS}; + reportJob.reportQuery = reportQuery; + + // Run report job. + reportJob = reportService.runReportJob(reportJob); + + do { + Console.WriteLine("Report with ID '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS); + + if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with ID '{0}' failed to finish successfully.", + reportJob.id); + } else { + Console.WriteLine("Report job with ID '{0}' completed successfully.", reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run cusom fields report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/ReportService/RunSalesReport.cs b/examples/Dfp/CSharp/v201405/ReportService/RunSalesReport.cs new file mode 100644 index 00000000000..51dc7e10567 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/ReportService/RunSalesReport.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example runs a report equal to the "Sales by salespersons + /// report" on the DFP website. To download the report run DownloadReport.cs. + /// + /// Tags: ReportService.runReportJob, ReportService.getReportJob + /// + class RunSalesReport : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example runs a report equal to the \"Sales by salespersons report\" on" + + "the DFP website. To download the report run DownloadReport.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new RunSalesReport(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + ReportService reportService = (ReportService) user.GetService( + DfpService.v201405.ReportService); + + // Create report job. + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.SALESPERSON_ID, + Dimension.SALESPERSON_NAME}; + reportJob.reportQuery.columns = new Column[] { + Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM + }; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + try { + // Run report. + reportJob = reportService.runReportJob(reportJob); + // Wait for report to complete. + while (reportJob.reportJobStatus == ReportJobStatus.IN_PROGRESS) { + Console.WriteLine("Report job with id = '{0}' is still running.", reportJob.id); + Thread.Sleep(30000); + // Get report job. + reportJob = reportService.getReportJob(reportJob.id); + } + + if (reportJob.reportJobStatus == ReportJobStatus.COMPLETED) { + Console.WriteLine("Report job with id = '{0}' completed successfully.", reportJob.id); + } else if (reportJob.reportJobStatus == ReportJobStatus.FAILED) { + Console.WriteLine("Report job with id = '{0}' failed to complete successfully.", + reportJob.id); + } + } catch (Exception ex) { + Console.WriteLine("Failed to run sales report. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs b/examples/Dfp/CSharp/v201405/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs new file mode 100644 index 00000000000..c6dd55154f2 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/SuggestedAdUnitService/ApproveSuggestedAdUnits.cs @@ -0,0 +1,117 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201405; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example approves all suggested ad units with 50 or more + /// requests. This feature is only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// Tags: SuggestedAdUnitService.performSuggestedAdUnitAction + /// + class ApproveSuggestedAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example approves all suggested ad units with 50 or more requests. " + + "This feature is only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new ApproveSuggestedAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201405.SuggestedAdUnitService); + + // Set the number of requests for suggested ad units greater than which to approve. + long NUMBER_OF_REQUESTS = 50L; + + // Create statement to select all suggested ad units that are highly requested. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("numRequests > :numRequests") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("numRequests", NUMBER_OF_REQUESTS); + + // Set default for page. + SuggestedAdUnitPage page = new SuggestedAdUnitPage(); + + try { + do { + // Get suggested ad units by statement. + page = suggestedAdUnitService.getSuggestedAdUnitsByStatement( + statementBuilder.ToStatement()); + + int i = 0; + if (page != null && page.results != null) { + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and \"{2}\" will be " + + "approved.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while(statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of suggested ad units to be approved: " + + page.totalResultSetSize); + + // Modify statement for action. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + ApproveSuggestedAdUnit action = new ApproveSuggestedAdUnit(); + + // Perform action. + SuggestedAdUnitUpdateResult result = suggestedAdUnitService.performSuggestedAdUnitAction( + action, statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of suggested ad units approved: " + result.numChanges); + } else { + Console.WriteLine("No suggested ad units were approved."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to approve suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs b/examples/Dfp/CSharp/v201405/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs new file mode 100644 index 00000000000..bf15ec9513f --- /dev/null +++ b/examples/Dfp/CSharp/v201405/SuggestedAdUnitService/GetAllSuggestedAdUnits.cs @@ -0,0 +1,94 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201405; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all suggested ad units. To approve suggested ad + /// units, run ApproveSuggestedAdUnits.cs. This feature is only available to + /// DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// + class GetAllSuggestedAdUnits : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all suggested ad units. To approve suggested ad units, " + + "run ApproveSuggestedAdUnits.cs. This feature is only available to DFP premium " + + "solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllSuggestedAdUnits(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201405.SuggestedAdUnitService); + + // Set defaults for page and filterStatement. + SuggestedAdUnitPage page = new SuggestedAdUnitPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all suggested ad units. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get suggested ad units by statement. + page = suggestedAdUnitService.getSuggestedAdUnitsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and number of requests " + + "\"{2}\" was found.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs b/examples/Dfp/CSharp/v201405/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs new file mode 100644 index 00000000000..692d363915d --- /dev/null +++ b/examples/Dfp/CSharp/v201405/SuggestedAdUnitService/GetSuggestedUnitByStatement.cs @@ -0,0 +1,100 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; +using Google.Api.Ads.Dfp.Util.v201405; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets suggested ad units that have more than 50 requests. + /// The statement retrieves up to the maximum page size limit of 500. This + /// feature is only available to DFP premium solution networks. + /// + /// Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement + /// + class GetSuggestedUnitByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets suggested ad units that have more than 50 requests. The " + + "statement retrieves up to the maximum page size limit of 500. This feature is " + + "only available to DFP premium solution networks."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetSuggestedUnitByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the SuggestedAdUnitService. + SuggestedAdUnitService suggestedAdUnitService = (SuggestedAdUnitService) user.GetService( + DfpService.v201405.SuggestedAdUnitService); + + // Set the number of requests to 50 or more. + long NUMBER_OF_REQUESTS = 50L; + + // Create a statement to only select suggested ad units that have more + // than 50 requests. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("numRequests > :numRequests") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("numRequests", NUMBER_OF_REQUESTS); + + // Set default for page. + SuggestedAdUnitPage page = new SuggestedAdUnitPage(); + + try { + do { + // Get suggested ad units by statement. + page = suggestedAdUnitService.getSuggestedAdUnitsByStatement( + statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (SuggestedAdUnit suggestedAdUnit in page.results) { + Console.WriteLine("{0}) Suggested ad unit with ID \"{1}\", and number of requests " + + "\"{2}\" was found.", i, suggestedAdUnit.id, suggestedAdUnit.numRequests); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get suggested ad units. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/TeamService/CreateTeams.cs b/examples/Dfp/CSharp/v201405/TeamService/CreateTeams.cs new file mode 100644 index 00000000000..7a8fafc5722 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/TeamService/CreateTeams.cs @@ -0,0 +1,88 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; +using Google.Api.Ads.Dfp.Util.v201405; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates new teams. To determine which teams exist, run + /// GetAllTeams.cs. + /// + /// Tags: TeamService.createTeams + /// + class CreateTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new teams. To determine which teams exist, run " + + "GetAllTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201405.TeamService); + + try { + // Create an array to store local team objects. + Team[] teams = new Team[5]; + + for (int i = 0; i < 5; i++) { + Team team = new Team(); + team.name = "Team #" + i; + team.hasAllCompanies = false; + team.hasAllInventory = false; + teams[i] = team; + } + + // Create the teams on the server. + teams = teamService.createTeams(teams); + + if (teams != null && teams.Length > 0) { + foreach (Team newTeam in teams) { + Console.WriteLine("A team with ID \"{0}\", and name \"{1}\" was created.", + newTeam.id, newTeam.name); + } + } else { + Console.WriteLine("No teams created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create teams. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/TeamService/GetAllTeams.cs b/examples/Dfp/CSharp/v201405/TeamService/GetAllTeams.cs new file mode 100644 index 00000000000..7bd9f096dd3 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/TeamService/GetAllTeams.cs @@ -0,0 +1,89 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; +using Google.Api.Ads.Dfp.Util.v201405; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all teams. To create teams, run CreateTeams.cs. + /// + /// Tags: TeamService.getTeamsByStatement + /// + class GetAllTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams. To create teams, run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201405.TeamService); + + // Set defaults for page and filterStatement. + TeamPage page = new TeamPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all teams. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get teams by statement. + page = teamService.getTeamsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (Team team in page.results) { + Console.WriteLine("{0}) Team with ID \"{1}\", name \"{2}\" was found.", + i, team.id, team.name); + i++; + } + } + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all teams. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/TeamService/GetTeamsByStatement.cs b/examples/Dfp/CSharp/v201405/TeamService/GetTeamsByStatement.cs new file mode 100644 index 00000000000..b459cac938a --- /dev/null +++ b/examples/Dfp/CSharp/v201405/TeamService/GetTeamsByStatement.cs @@ -0,0 +1,92 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; +using Google.Api.Ads.Dfp.Util.v201405; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all teams ordered by name. To create teams, + /// run CreateTeams.cs. + /// + /// Tags: TeamService.getTeamsByStatement + /// + class GetTeamsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams ordered by name. To create teams, run " + + "CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetTeamsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201405.TeamService); + + // Create a statement to order teams by name. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("name ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Set default for page. + TeamPage page = new TeamPage(); + + try { + do { + // Get teams by statement. + page = teamService.getTeamsByStatement(statementBuilder.ToStatement()); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (Team team in page.results) { + Console.WriteLine("{0}) Team with ID \"{1}\" and name \"{2}\" was found.", + i, team.id, team.name); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while(statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get teams by statement. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/TeamService/UpdateTeams.cs b/examples/Dfp/CSharp/v201405/TeamService/UpdateTeams.cs new file mode 100644 index 00000000000..30db3c322f5 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/TeamService/UpdateTeams.cs @@ -0,0 +1,107 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; +using Google.Api.Ads.Dfp.Util.v201405; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example updates a team by adding an ad unit to it. To + /// determine which teams exist, run GetAllTeams.cs. To determine which ad + /// units exist, run GetAllAdUnits.cs. + /// + /// Tags: TeamService.getTeamsByStatement, TeamService.updateTeams + /// + class UpdateTeams : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a team by adding an ad unit to it. To " + + "determine which teams exist, run GetAllTeams.cs. To determine which ad units " + + "exist, run GetAllAdUnits.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateTeams(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the TeamService. + TeamService teamService = (TeamService) user.GetService(DfpService.v201405.TeamService); + + // Set the ID of the team to update. + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + + // Set the ID of the ad unit to add to the team. + String adUnitId = _T("INSERT_AD_UNIT_ID_HERE"); + + // Create a statement to select the team. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :id") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", teamId); + + try { + // Get the teams by statement. + TeamPage page = teamService.getTeamsByStatement(statementBuilder.ToStatement()); + + Team team = page.results[0]; + + // Don't add ad unit if the team has all inventory already. + if (!team.hasAllInventory) { + List adUnitIds = new List(); + if (team.adUnitIds != null) { + adUnitIds.AddRange(team.adUnitIds); + } + adUnitIds.Add(adUnitId); + team.adUnitIds = adUnitIds.ToArray(); + } + + // Update the teams on the server. + Team[] teams = teamService.updateTeams(new Team[] {team}); + + if (teams != null) { + foreach (Team updatedTeam in teams) { + Console.WriteLine("A team with ID \"{0}\" and name \"{1}\" was updated.", + updatedTeam.id, updatedTeam.name); + } + } else { + Console.WriteLine("No teams updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update teams. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/UserService/CreateUsers.cs b/examples/Dfp/CSharp/v201405/UserService/CreateUsers.cs new file mode 100644 index 00000000000..f0b9156da7c --- /dev/null +++ b/examples/Dfp/CSharp/v201405/UserService/CreateUsers.cs @@ -0,0 +1,100 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example creates new users. To determine which users + /// exist, run GetAllUsers.cs. + /// + /// Tags: UserService.createUsers + /// + class CreateUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example creates new users. To determine which users " + + "exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201405.UserService); + + // Set the user's email addresses and names. + List emailAndNames = new List(); + emailAndNames.Add(new String[] {_T("INSERT_EMAIL_ADDRESS_HERE"), _T("INSERT_NAME_HERE")}); + emailAndNames.Add(new String[] {_T("INSERT_ANOTHER_EMAIL_ADDRESS_HERE"), + _T("INSERT_ANOTHER_NAME_HERE")}); + + // Roles can be obtained by running GetAllRoles.cs. + long roleId = long.Parse(_T("INSERT_ROLE_ID_HERE")); + + // Create an array to store local user objects. + User[] users = new User[emailAndNames.Count]; + + for (int i = 0; i < users.Length; i++) { + // Create the new user structure. + User newUser = new User(); + newUser.email = emailAndNames[i][0]; + newUser.name = emailAndNames[i][1]; + newUser.roleId = roleId; + newUser.preferredLocale = "en_US"; + + users[i] = newUser; + } + + try { + // Create the users. + users = userService.createUsers(users); + + if (users != null) { + foreach (User newUser in users) { + Console.WriteLine("A user with ID = '{0}', email = '{1}', and role = '{2}' " + + "was created.", newUser.id, newUser.email, newUser.roleName); + } + } else { + Console.WriteLine("No users created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/UserService/DeactivateUser.cs b/examples/Dfp/CSharp/v201405/UserService/DeactivateUser.cs new file mode 100644 index 00000000000..c5cdd27e32b --- /dev/null +++ b/examples/Dfp/CSharp/v201405/UserService/DeactivateUser.cs @@ -0,0 +1,121 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example deactivates a user. Deactivated users can no longer make + /// requests to the API. The user making the request cannot deactivate itself. + /// To determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserService.getUsersByStatement, UserService.performUserAction + /// + class DeactivateUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example deactivates a user. Deactivated users can no longer make " + + "requests to the API. The user making the request cannot deactivate itself. " + + "To determine which users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeactivateUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201405.UserService); + + // Set the ID of the user to deactivate + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create Statement text to select user by id. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :userId") + .OrderBy("id ASC") + .Limit(1) + .AddValue("userId", userId); + + // Sets default for page. + UserPage page = new UserPage(); + List userIds = new List(); + + try { + do { + // Get users by Statement. + page = userService.getUsersByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User userResult in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and status = '{3}'" + + " will be deactivated.", i, userResult.id, userResult.email, + userResult.isActive ? "ACTIVE" : "INACTIVE"); + userIds.Add(userResult.id.ToString()); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of users to be deactivated: {0}", page.totalResultSetSize); + + if (userIds.Count > 0) { + // Modify statement for action. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + DeactivateUsers action = new DeactivateUsers(); + + // Perform action. + UpdateResult result = userService.performUserAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of users deactivated: {0}" + result.numChanges); + } else { + Console.WriteLine("No users were deactivated."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to deactivate users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/UserService/GetAllRoles.cs b/examples/Dfp/CSharp/v201405/UserService/GetAllRoles.cs new file mode 100644 index 00000000000..363a0fc904a --- /dev/null +++ b/examples/Dfp/CSharp/v201405/UserService/GetAllRoles.cs @@ -0,0 +1,77 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all roles. This example can be used to determine + /// which role ID is needed when getting and creating users. + /// + /// Tags: UserService.getAllRoles + /// + class GetAllRoles : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all roles. This example can be used to determine which " + + "role ID is needed when getting and creating users."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllRoles(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201405.UserService); + + try { + // Get all roles. + Role[] roles = userService.getAllRoles(); + int numRoles = 0; + if (roles != null && roles.Length > 0) { + foreach (Role role in roles) { + Console.WriteLine("Role with ID = '{0}' and name ='{1}' was found.", role.id, + role.name); + } + numRoles = roles.Length; + } + + Console.WriteLine("Number of results found: " + numRoles); + } catch (Exception ex) { + Console.WriteLine("Failed to get all roles. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/UserService/GetAllUsers.cs b/examples/Dfp/CSharp/v201405/UserService/GetAllUsers.cs new file mode 100644 index 00000000000..4548da1a471 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/UserService/GetAllUsers.cs @@ -0,0 +1,88 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all users. To create users, run CreateUsers.cs. + /// + /// Tags: UserService.getUsersByStatement + /// + class GetAllUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all users. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201405.UserService); + + // Create a Statement to get all users. + StatementBuilder statementBuilder = new StatementBuilder() + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + + // Sets defaults for page and Statement. + UserPage page = new UserPage(); + + try { + do { + // Get users by Statement. + page = userService.getUsersByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User usr in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and role = '{3}'" + + " was found.", i, usr.id, usr.email, usr.roleName); + i++; + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get all users. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/UserService/GetCurrentUser.cs b/examples/Dfp/CSharp/v201405/UserService/GetCurrentUser.cs new file mode 100644 index 00000000000..ab5618547b3 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/UserService/GetCurrentUser.cs @@ -0,0 +1,71 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets current user. To create users, run CreateUsers.cs. + /// + /// Tags: UserService.getCurrentUser + /// + class GetCurrentUser : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This example gets current user. To create users, run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetCurrentUser(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201405.UserService); + + try { + // Get the current user. + User usr = userService.getCurrentUser(); + + if (usr != null) { + Console.WriteLine("User with ID = '{0}', email = '{1}', and role = '{2}' is the " + + "current user.", usr.id, usr.email, usr.roleName); + } else { + Console.WriteLine("The current user could not be retrieved."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get current user. Exception says \"{0}\"", ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/UserService/GetUsersByStatement.cs b/examples/Dfp/CSharp/v201405/UserService/GetUsersByStatement.cs new file mode 100644 index 00000000000..385640e869c --- /dev/null +++ b/examples/Dfp/CSharp/v201405/UserService/GetUsersByStatement.cs @@ -0,0 +1,90 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all active users sorted by name. To create new users, + /// run CreateUsers.cs. + /// + /// Tags: UserService.getUsersByStatement + /// + class GetUsersByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return " This code example gets all active users sorted by name. To create new users, " + + "run CreateUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUsersByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserService. + UserService userService = (UserService) user.GetService(DfpService.v201405.UserService); + + // Create a Statement to get all active users sorted by name. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("status = :status") + .OrderBy("name ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("status", "ACTIVE"); + + // Set default for page. + UserPage page = new UserPage(); + + try { + do { + // Get users by Statement. + page = userService.getUsersByStatement(statementBuilder.ToStatement()); + + if (page.results != null && page.results.Length > 0) { + int i = page.startIndex; + foreach (User usr in page.results) { + Console.WriteLine("{0}) User with ID = '{1}', email = '{2}', and role = '{3}'" + + " was found.", i, usr.id, usr.email, usr.roleName); + } + } + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/UserService/UpdateUsers.cs b/examples/Dfp/CSharp/v201405/UserService/UpdateUsers.cs new file mode 100644 index 00000000000..5454b944b37 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/UserService/UpdateUsers.cs @@ -0,0 +1,96 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example updates a user by adding "Sr." to the end of its + /// name. To determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserService.getUsersByStatement, UserService.updateUsers + /// + class UpdateUsers : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates a user by adding 'Sr.' to the end of its " + + "name. To determine which users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateUsers(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserService. + UserService userService = (UserService) dfpUser.GetService(DfpService.v201405.UserService); + + // Set the user to update. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create a Statement to get all users. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("id = :userId") + .OrderBy("id ASC") + .Limit(1) + .AddValue("id", userId); + + + try { + // Get users by Statement. + UserPage page = userService.getUsersByStatement(statementBuilder.ToStatement()); + + User user = page.results[0]; + + // Update user object by changing its name. + user.name = user.name + " Sr."; + + // Update the users on the server. + User[] users = userService.updateUsers(new User[] {user}); + + if (users != null) { + foreach (User updatedUser in users) { + Console.WriteLine("A user with ID = '{0}', name ='{1}', and role = '{2}'" + + " was updated.", updatedUser.id, updatedUser.name, updatedUser.roleName); + } + } else { + Console.WriteLine("No users updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to get user by ID. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/UserTeamAssociationService/CreateUserTeamAssociations.cs b/examples/Dfp/CSharp/v201405/UserTeamAssociationService/CreateUserTeamAssociations.cs new file mode 100644 index 00000000000..2e410ec2bd1 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/UserTeamAssociationService/CreateUserTeamAssociations.cs @@ -0,0 +1,98 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example adds a user to a team by creating an association + /// between the two. To determine which teams exist, run GetAllTeams.cs. To + /// determine which users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.createUserTeamAssociations + /// + class CreateUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example adds a user to a team by creating an association between the " + + "two. To determine which teams exist, run GetAllTeams.cs. To determine which users " + + "exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new CreateUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201405.UserTeamAssociationService); + + // Set the users and team to add them to. + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + long[] userIds = new long[] {long.Parse(_T("INSERT_USER_ID_HERE"))}; + + // Create an array to store local user team association objects. + UserTeamAssociation[] userTeamAssociations = new UserTeamAssociation[userIds.Length]; + + // For each user, associate it with the given team. + int i = 0; + + foreach (long userId in userIds) { + UserTeamAssociation userTeamAssociation = new UserTeamAssociation(); + userTeamAssociation.userId = userId; + userTeamAssociation.teamId = teamId; + userTeamAssociations[i++] = userTeamAssociation; + } + + try { + // Create the user team associations on the server. + userTeamAssociations = + userTeamAssociationService.createUserTeamAssociations(userTeamAssociations); + + if (userTeamAssociations != null) { + foreach (UserTeamAssociation userTeamAssociation in userTeamAssociations) { + Console.WriteLine("A user team association between user with ID \"{0}\" and team " + + "with ID \"{1}\" was created.", userTeamAssociation.userId, + userTeamAssociation.teamId); + } + } else { + Console.WriteLine("No user team associations created."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to create user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/UserTeamAssociationService/DeleteUserTeamAssociations.cs b/examples/Dfp/CSharp/v201405/UserTeamAssociationService/DeleteUserTeamAssociations.cs new file mode 100644 index 00000000000..4aba767ee2e --- /dev/null +++ b/examples/Dfp/CSharp/v201405/UserTeamAssociationService/DeleteUserTeamAssociations.cs @@ -0,0 +1,120 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example removes the user from all its teams. To determine which + /// users exist, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.performUserTeamAssociationAction + /// + class DeleteUserTeamAssociation : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example removes the user from all its teams. To determine which " + + "users exist, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new DeleteUserTeamAssociation(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201405.UserTeamAssociationService); + + // Set the user to remove from its teams. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create filter text to select user team associations by the user ID. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("userId = :userId") + .OrderBy("userId ASC, teamId ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("userId", userId); + + // Set default for page. + UserTeamAssociationPage page = new UserTeamAssociationPage(); + + try { + do { + // Get user team associations by statement. + page = userTeamAssociationService.getUserTeamAssociationsByStatement( + statementBuilder.ToStatement()); + + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and " + + "team with ID \"{2}\" will be deleted.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while (statementBuilder.GetOffset() < page.totalResultSetSize); + + Console.WriteLine("Number of teams that the user will be removed from: " + + page.totalResultSetSize); + + if (page.totalResultSetSize > 0) { + // Modify statement for action. + statementBuilder.RemoveLimitAndOffset(); + + // Create action. + DeleteUserTeamAssociations action = new DeleteUserTeamAssociations(); + + // Perform action. + UpdateResult result = userTeamAssociationService.performUserTeamAssociationAction(action, + statementBuilder.ToStatement()); + + // Display results. + if (result != null && result.numChanges > 0) { + Console.WriteLine("Number of teams that the user was removed from: " + + result.numChanges); + } else { + Console.WriteLine("No user team associations were deleted."); + } + } + } catch (Exception ex) { + Console.WriteLine("Failed to delete user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/UserTeamAssociationService/GetAllUserTeamAssociations.cs b/examples/Dfp/CSharp/v201405/UserTeamAssociationService/GetAllUserTeamAssociations.cs new file mode 100644 index 00000000000..3c7493d6275 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/UserTeamAssociationService/GetAllUserTeamAssociations.cs @@ -0,0 +1,93 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all user team associations. To create user team + /// associations, run CreateUserTeamAssociations.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// + class GetAllUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all user team associations. To create user team " + + "associations, run CreateUserTeamAssociations.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetAllUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser dfpUser) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = (UserTeamAssociationService) + dfpUser.GetService(DfpService.v201405.UserTeamAssociationService); + + // Set defaults for page and filterStatement. + UserTeamAssociationPage page = new UserTeamAssociationPage(); + Statement filterStatement = new Statement(); + int offset = 0; + + try { + do { + // Create a statement to get all user team associations. + filterStatement.query = "LIMIT 500 OFFSET " + offset; + + // Get user team associations by statement. + page = userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement); + + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and " + + "team with ID \"{2}\" was found.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + offset += 500; + } while (offset < page.totalResultSetSize); + + Console.WriteLine("Number of results found: {0}." + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs b/examples/Dfp/CSharp/v201405/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs new file mode 100644 index 00000000000..2860ad4a7d5 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/UserTeamAssociationService/GetUserTeamAssociationsByStatement.cs @@ -0,0 +1,100 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example gets all teams that the a user belongs to. To create + /// teams, run CreateTeams.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// + class GetUserTeamAssociationsByStatement : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example gets all teams that a user belongs to. To create " + + "teams, run CreateTeams.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new GetUserTeamAssociationsByStatement(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201405.UserTeamAssociationService); + + // Set the ID of the user to fetch all user team associations for. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Create statement to select user team associations by the user ID. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("userId = :userId") + .OrderBy("id ASC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .AddValue("userId", userId); + + // Set default for page. + UserTeamAssociationPage page = new UserTeamAssociationPage(); + + try { + do { + // Get user team associations by statement. + page = userTeamAssociationService.getUserTeamAssociationsByStatement( + statementBuilder.ToStatement()); + + // Display results. + if (page.results != null) { + int i = page.startIndex; + foreach (UserTeamAssociation userTeamAssociation in page.results) { + Console.WriteLine("{0}) User team association between user with ID \"{1}\" and " + + "team with ID \"{2}\" was found.", i, userTeamAssociation.userId, + userTeamAssociation.teamId); + i++; + } + } + + statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } while(statementBuilder.GetOffset() < page.totalResultSetSize); + Console.WriteLine("Number of results found: " + page.totalResultSetSize); + } catch (Exception ex) { + Console.WriteLine("Failed to get user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/examples/Dfp/CSharp/v201405/UserTeamAssociationService/UpdateUserTeamAssociations.cs b/examples/Dfp/CSharp/v201405/UserTeamAssociationService/UpdateUserTeamAssociations.cs new file mode 100644 index 00000000000..a57842533e4 --- /dev/null +++ b/examples/Dfp/CSharp/v201405/UserTeamAssociationService/UpdateUserTeamAssociations.cs @@ -0,0 +1,109 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using System; + +namespace Google.Api.Ads.Dfp.Examples.CSharp.v201405 { + /// + /// This code example updates user team associations by setting the + /// overridden access type to read only for all teams that the user belongs + /// to. To determine which users exists, run GetAllUsers.cs. + /// + /// Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement + /// Tags: UserTeamAssociationService.updateUserTeamAssociations + /// + class UpdateUserTeamAssociations : SampleBase { + /// + /// Returns a description about the code example. + /// + public override string Description { + get { + return "This code example updates user team associations by setting the overridden " + + "access type to read only for all teams that the user belongs to. To determine " + + "which users exists, run GetAllUsers.cs."; + } + } + + /// + /// Main method, to run this code example as a standalone application. + /// + /// The command line arguments. + public static void Main(string[] args) { + SampleBase codeExample = new UpdateUserTeamAssociations(); + Console.WriteLine(codeExample.Description); + codeExample.Run(new DfpUser()); + } + + /// + /// Run the code example. + /// + /// The DFP user object running the code example. + public override void Run(DfpUser user) { + // Get the UserTeamAssociationService. + UserTeamAssociationService userTeamAssociationService = + (UserTeamAssociationService) user.GetService( + DfpService.v201405.UserTeamAssociationService); + + // Set the user id of the user team association to update. + long userId = long.Parse(_T("INSERT_USER_ID_HERE")); + + // Set the team id of the user team association to update. + long teamId = long.Parse(_T("INSERT_TEAM_ID_HERE")); + + // Create a statement to select the user team association. + StatementBuilder statementBuilder = new StatementBuilder() + .Where("userId = :userId and teamId = :teamId") + .OrderBy("userId ASC, teamId ASC") + .Limit(1) + .AddValue("userId", userId) + .AddValue("teamId", teamId); + + try { + // Get user team associations by statement. + UserTeamAssociationPage page = + userTeamAssociationService.getUserTeamAssociationsByStatement( + statementBuilder.ToStatement()); + + UserTeamAssociation userTeamAssociation = page.results[0]; + + userTeamAssociation.overriddenTeamAccessType = TeamAccessType.READ_ONLY; + + // Update the user team associations on the server. + UserTeamAssociation[] userTeamAssociations = + userTeamAssociationService.updateUserTeamAssociations( + new UserTeamAssociation[] {userTeamAssociation}); + + if (userTeamAssociations != null) { + foreach (UserTeamAssociation updatedUserTeamAssociation in userTeamAssociations) { + Console.WriteLine("User team association between user with ID \"{0}\" and team " + + "with ID \"{1}\" was updated to access type \"{2}\".", + updatedUserTeamAssociation.userId, updatedUserTeamAssociation.teamId, + updatedUserTeamAssociation.overriddenTeamAccessType); + } + } else { + Console.WriteLine("No user team associations updated."); + } + } catch (Exception ex) { + Console.WriteLine("Failed to update user team associations. Exception says \"{0}\"", + ex.Message); + } + } + } +} diff --git a/lib/NUnit/license.txt b/lib/NUnit/license.txt new file mode 100644 index 00000000000..66a5ebf28bb --- /dev/null +++ b/lib/NUnit/license.txt @@ -0,0 +1,15 @@ +Copyright © 2002-2008 Charlie Poole +Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov +Copyright © 2000-2002 Philip A. Craig + +This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment (see the following) in the product documentation is required. + +Portions Copyright © 2002-2008 Charlie Poole or Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright © 2000-2002 Philip A. Craig + +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source distribution. diff --git a/lib/NUnit/nunit.framework.dll b/lib/NUnit/nunit.framework.dll new file mode 100644 index 0000000000000000000000000000000000000000..07e4c6eaeebe158584411616b9c82baecab9616e GIT binary patch literal 131072 zcmeFa36xw_)i!+YP}SAd^N{M!K++)tm#*#%kU$ec2w@6yfDjT0BtRGvLkg-BK$?yL zLkti`k$H@u5kXNAQP39%izl4kancDZRuootoOp6aan*{Br7Jr2Iqb-e(+f*Zo={hp9cxw3+1HqZ9nXC7 zhfg0AruL$7N7pzRW1e=5=}_$JuZ8z65Hl6usCJWs_RGJSpacKWU%1HE%nJno9RJFl z^5S|m^d2pcYci<_9p7}grZ$GQ{jS3ppVkU=&+nv*`L$1>dZM*ax>Cc;EvMeBgl(Jn(@B zKJdT?9{9imA9&yc4}9Q(4?OVyBM&^yc{ToVZt9wp+4L)8UaNLYwP54RoDO5w#NeQJ zyZ`iP@8`K|H=KCRPH$Z|<>P0xEFXR0c6%-R;^sZS@Y-$X7GC=DsUNweVO6kb-+$zG zeCFLT=8fFFCoSs!{&Dv-9qa$>oVFRmX1x5&z4h5=PZ)mmS%=;K)WW~L^2_?##V2hE zo^7~h^OOfW>o6cO`tc`=?rLPn z@5c<-cY}IkvdCAiAIk&2>AY+pVw(_MuOG92@Z2>JPkWNb_50JpI^IC43b&ocv`k8w zufi)xyvewISW@v@-*Iy9I5kz%ZlJeZH)w!01R>1^HF;A7cR{CThT|8eA#Yi)CS3q$x=OCS+u^o0Z!%1KYkZ>-or6I zS_0UQMq?+EkQ_*;FfEgOvnTFsebKha?W2SzRifK#%Qw4ylnoK>sO0@H7A*p=sP&Te zMwFq-VPP+Ayy8W$s_;ABhw?&z?XE%Kv&@)Z>Oh1p*q615e`s+`eq^W&jYQhyhlVN? z%(`BncV!u(?oQPM-Ja$rnVtGj5psl*Ya7_~D+e*X(+yyuxNZVW@a(;|E2!%RMj_o* zsQ!+`GU{h-x-bld%l0+jm*zPocKLc*vsxU=Wdx zHX=#)f+3(6I%6i#2joL^=C_3pZrmom+%~3*qNvp888ikqwk4mQUzh-el1=eD`wDb( zp&z{7o#7=Vo8j;SnjjEOliNEIPVWb6+*N!1p!nz~Sfn-i)~doN++^K8a-|C$0LE8I zQKS5RwWY0U6TW+*vn8Jq2LO6;%dm_%pv7Dm*sLmR;dyM){l$mGlfgCDe zlaVsZS_@nJ{HaKfMTAB(U4W`=ODexzQ%Z2PZdE3j3UJQ^J_vDbq zw5#5e-`00L6cE~NMC3ScCEHnPU6nP4rHUZ{^WzZs)DrB3^s{NNuq%GMFwDW2jb+UN zE5|}Kx-V%og$6Pjo`liYCXA-d7-iXZ#_c1AB&UfoRvMz;(!3xODf0?w+_QxpaOsCftpx2&^808yHSulZ z$5`<_`D0tXe%Kt@%6OcLJ_7bPnbvHsCaj%RJ+C4Qs7$P&wI)-S(UD+FrYX}sLi)Yp zQ*cSM6QJA61_=LbF9IALVILDLhG9YYBd~* z3fm!wLl#ZCx=;hpwxrxXdcP~%l*+xs(GQ|g7*n~H^p<0l+AUPKoVtgp&Q`U}uVF@| ziGUr`s@{F~U9=L~J+xFev4aqWnWm_ZXlqF$D@|zOjM+=t2^lXS{PBxFj=A}dWjhzY z(q2ZMff?C!cfD8K*$tbJ{BT6%0)k;Jr580KkzwXgrE0z6g=G7K)L)KO)!H~IFV}=eoBOiN(iTmKZy9# zg^AE7)z(9P=P={=hq*KQ3?Dz}kof~Yp+ZUBLhtQI12(jku%AO>;ZG@ly{`iGseX79 zBW33G0_a6cfI1hBB`FD0;T%}oSo|@pDvtKTQCU1KYb@>zY;wTXCr0#9fhVDqP3IWokj_oUJ#9nlgy@o-7TJ>0u&BVO$TlHT?y!>$Fm2T~K++4xI0O%0HQ9St%fn_>YP@ckKOtTQr z!aqa#HLf%8(uvFpRtZi5Q*e?1eYC_YoTik1%CXK-_wJ$Yt*h&!{ayjR77|gaajPowP^EdWY0e65 z&$rn`DCdf;1@yr5k)(7A&|KMxlU)L;_YOl5ZOEgxT#kZ1#4Yj=EP@0Kswp}?YQZGb z%yZGWBvRp6l0MONLJAYoto+E5R{$fSKF{sNNG#jGJ%qwQvH3u^8MbYt7SOA6A|*i{ zj+s$O=v$%h47w0!Sd7PxA0tNS8Hj&s$X|4Ocfox>hRcx+C{6U6QEVn`As0s$6}Dv6 z7NPesDu*EGr%T%0@qp=g+D+eesNH0%n16Eop!A%o)Mjj8S)`8mwK3os_}QS| z(kIki$b(!+;R2V`6pxIeRLNfNTku1nE2+bk^_zr!NlovRv5QS8q-1`Q{Qr8N{O`U` zew0;-`R`?q^FI0A_sQ?QPkw(O{<_GYUU2>Z@tG)_t*%X!@Hqpm5$IY+2_J&FaxGy1 zzOAfHl<4yY(&w?>mew-~SGSM##EaJ{jz=$|NUg@X;37E0wufhiIxLHh2NL1eg~hwl zTEOly-Q9uV-;Yogbb$`iF_X;H!pbuarK24t27*7Qz#lYq*5j0UDokISp04^-q6yNJ zhGM~SCE8UdCD-6$%J*Cg!EkDqDxKQFx^~K7&-}H@rSePsRcJXJCd1!oHW-Q! znOey!L@p7L$%(9C+y>5^=VJ^X=l2!is|L34GHst@+Dk=Y zD0+v>_&S8y9-D-|aI5DrcxUrFQWKCJip zDHQ3Y%p~Fw8!*$Zgep`GI0FRa83bQcO{`C+qv+_;GNA@lxrbg+DPFlWzy5DHT!th!VxlU9ioUG6?<*nXJDGy*c9* zBc&1PVjjYpq!h7i7s+HNn-cz-RFc0+_|>>F{+e`EfMG4i9n|dA`>VT=ak)&)MctMS@qLh zX|9N&!pp>Umo}`djZS0rY$gP%?5~~GdO1wUQ*HBGQcbDMM9j@GvJ|QB`zXjaU@R8a zIQbOh4#ulbt;T%M=85y;TvIyuEBH2Iek_?Y`DupXA;MJ@z%bN?a+yF|Q&pL4C)XtI zK)%uLA}%%G>8^UsZJP|Zkuj`|HKx;^q*2(5e#rN_t1#BItq|x9?n=U*RI1wiT%)V~ zSa}=~t~`2e3&u5K^2q#gwXLdlOSfGv1o+b}!^6cwI0p^|E(7n4MsipvZpB_4Hsf@? zZJx=WFI#uU!y4(au%G{WQBAXJP=bE(aKzXewnxQp@s5p6aZVa{tmehdykiwE=BjYV zpefGh9Ydse4e#jm;*-3iH#-kZ&Yv+pkH&Hp}{?0p;oFw4bS9+h|fU*~a2x2qz}{gPL#?{ebep z6oflSS4-NO=Tpkl3%gRAuY=q^x&n~{#8^#1w&&eGI!|eQz%5C-vzk<=Df(5zYZ@3AEL)(%C@yCB956uJQL2(25y|p?~Gv2@7eS@)8$v9F2 zvujk+hwA!nkIPBH{;-eJ`Dic6l@kosr_rZRPL9FvQ|C9a+j5&qkVzo%=-%t=CWeaXXKuNZNTOlHAj%=vRXKkwn=#graIe zFr_^dRskdp&n!j$(dWheg|_3eW`zO&8NCO>qu5DXl|$#^Y9##zI4=R4XXsA&lLq z59UHMTV$AqX>Gb6i#W*cfvz7sLSNABSg!<%vG1FYBMtQSh#3^Tmgm}OqcAOqRret_*Eg(^=sUivYLhg)f-+sAu3ToRuxng{!A z`=g!{ZHU^e4jNQc^UMgPqE#axqfDKXab^#hv%OG1e{v4l;QEwJJhkO>L(2zFKyk0R4Q+uO30=z=tc@fxOON0V($wUH&ivX_>ctHe^?h%6J71%9;wPR*H zAq~GxkoGV*5)556p8TR6K;3%-v^!!o% z%FThUA*(Nelev&D|H64cB$|97ZD0kE-GakyS=3eU>w`IkzZU#W#NXNY>sgOWoXEw1 zTyH^uJ`TAmyp2MXc#xwkHTe~8oTlAYu8D;6b0Fy+E3(;iQrZeFn0c(#GahSURy&I! z_%qU}$u}0~)?j9O4KCUxSINFM&galv^ew^BV5TqmTjI+$@#TD==}VI7%ZM%Z`VZeXMmy@9F4E*(+j|<(QiF_0geR&L$TpnhZmCHKe6nA@Y7^x#DIdP;&<_}g! zQZRNT>lg$cpEZCJ8HB-~26G}3VH@yM{K8bOwX$*|AUt5gfIu7?Y1){9W1+9M=Psap zjRDq390BNE$b^o=1>Wab6>PtH!SO^c!X+In#>RO=_5<-$yNh5ziD1Rd8 z%Uy1BXP0XX)l}KU>9evBs;vwbocz{&qUADJwF&ddwYw;%t)QVonw~pwp_L~=cZ=V1 zCqSDT8xmx7nUs>8n;VK^oRad~1$hqzQ&W{zlAkZe8uF*O5MiAVk=g_Wr5P-NQv95Z zp9Qs>TH#qO1_ure`BAH0U%~ zh_d=*oE0|7$jUYp)tRw^{K?FCNlB?@*1KRSRN`kDe*WW<(s=v|?41(lv8=3SGl%PJ z4nKrcYo$rHWyOlk43-wva$v)vI-VI5x%`n~zM_&+{C`+d9AoW{_7yW>w!zP!r|Zgi z@~b^$P4PB1*{8#*b6p*$q4DK-4Ng{;VLG^|ZH8-Eor4w3SkG^f@4?3d5MsMi*X((6 z6BI<~3nFyTAOivnV_1V*{AMic@-9HrjOpp>!G{D8VV!76HK#ne3(gdgg9aZIK!mZ^ zl5WN_JMV&`hyc$bYpH6k^5ib)6+8w8IFDbCdl=t2!<9!}f|VBD3FpCZB>Fe-n5@-! z=J#ORMf`2o_;m^^ZA+Uzyd%?mnZ&lFdN@|?Jqzk^TC@Q_wYj={9gY{C&HL)M`Mf^| z_oCqCs*IdU(-Un~qmC_n7^Lyo>&Q>QfnXbLJXl;^HL6RARoLe!%miEET=IeqyCR4) z-FbM&7sZcOjXF-*^R-pQEeHxtq8d91bxhz1_6HM8*dok9NC=%0YU>+#3Q>ZkFCa59(R zk4h%wd%hvJ9T(zf_gnNn=rBef_P7WL{`FjkOS1P zT9Pil9YgcdMYlHeQ+{^3n2Dij>0*5hb)}1~F*Gt=90n*Odu)aCSSI;wI%B<$qs}@`MuP=`L);sUMtEUkg;X<6`=0R@uCFr?%4h3h>89>=|6c07|Zd0Yvfc2H?bQlY1 zx9algsD5&~RZG~WciGZ+e6W5e9mats7_Oc8hVA)o$++f2S9>B^42x^3E~VDmsyb|1 z;sonVpj-S*wb$eycMC4ZHsbloWF-A8lk;vt5NP-yFTS}E`lnI9m(}WEqZvjGH|f=T zuoG;7-UZnz1ttK%!k-}h1=^^BxvPxXMWAEskhN7NDVrY?r_osD`UQlS<;!PK1d@V= zd+Y}cnRrGI?dcpz+S8w4HDod5d&h+hZhnTJuo&B?=#Wy<6@XfsOI5WWyFesrU3ZS3 zkzIttJukYo<;!q~W0967CD-61Oexjvxp_Rb)&!sifS1RbC4pMMEG>6uS_vYgho$lV9uH)oY-B)WUb1 z{+S@4Z@`E&%~5kdVuA~T?0ZT8d*`yH+^`N$bOoZXXr9eM}Bd zAI=2Y`eBg@jH0QxPa4=TEfzwrUMTkFwk3kqc zcDyE{Yq9VceD4Woqk~mj>S)AbE-R8fT!P>X1Jlpd=1%}+Vo}ZGLah&uMki zf(R*yY6_3_@r0cOp5%B!BkCT*P#~Q^N6&e-BY!B%ruIwGvS5)pH)`R{>9$c5Z%(ga zxyhR7KP9HPChAE{1ezat-Y&T@%Kg|O@C_qG_oIS$Au8_RI_Uy-I9H?vZC58ej(5SbP@ZiJe_McefsnyKHGcWDe+tuU025;(wOQd|Arbi0Ubb%M`su`Kz(6@WGNgMRkJIU zy8X0$ELom!!g$Q=L%sI!JwhG}b+!4E;6Q50LeY3AVmkI5#!C9S27?|yXaWaHN`%^K zw{Wl~3*&O%Sx@Yrp{9tKoKUKkLIb4j{QcFiEZVPnvk*f6r>e#r9(mjo?7X4KY+2G;A zoU|)kqvj~0W?xgAf$zfym8U`96AYJQ5j*2`yt)H8_lNDhJt>~q_4>(Rs@_TO2DoqJk&hw3gMZT?d!wP%wscp8g$uxA#~;Np)2P+q^y!zQ`za1 z9fx8-AEUC+3{pd=NGoU^cDw17a92&Os+AiNIYH+oB1paicGc}rLKPnc}eyOZXdb2n%q9JbyeG{ zsuS6Yr)bjk%l zgfLyf2e*aj$R5StJ_vr}Aox#~;1lWI5fbRI z79uPI#UCX2XDjdr3;rh+_(KH$vkE-gVCXL*c1!hR0Rwo9e#`Kvf51Okq33YH{~&?a z_pEjh@AdYEikNr$1fwS6uPnzOsrY&2__>NddRy_>x}g5~<@``g{DN)8BSG@tmE<1+ z`vo5tUCaPlm`5Z|*?Y=m1)q?O82(GL$Q;wXw>(|JC(?}=66qeJvR^8f6?{TAVo1oM zdt$m6DrwM!epsk@H2xu8W4Mj@UNluvjA?8fr~DX4hx}W|qv>M050vvCulSp`1<(2@ z{Jk3x!@*^^c!h67;T)CeBGq|oxz2&`)G7F+&i|>@xma~>EY~>@o;n4e)cHuI&J$GU zo#i?Q!c(W4ucBd{0t59=#9C%i}vfv>);O-t9s{IG_P79G5MjtlNjC zR>x&>7K)JcM>=-1JZK6NJcJTF&8i2@qVk0LEgsFH;zJYWp%?cGE8w2OX)sTpL}WLP zg+M*`>C3?f%Dcf*ATf4w+s0-4sVd#ig!J5y#%5N1@a@pwr$j<+!t0Jw$pK`Z2xXA^ za;6^o)$07-d(eMSPCv0c?O|dxlNP^M;a7D_n;&I5^jVGi5?w~nD96mmm#49^1RY2@t@rSAMz4ZI2^yyq@lE#bAnxdLKeAv=s8~7N_OY`)EW#2B>=g zThNXDcWj}e-k-zbge}BbTed`$PL!~9MOea1teZKH!yL|zwYQ%C2CucZIZ~R(j)Mec z0>|;bFK63EN{k6Tt86u%i?y0Hk-W|g#@e#No(X-wYA=|=11x-kmji14j>^uL!l$i+ z@$;cp^7A+34}*m^4U1ypd~mRSv=2}}v@OthLt79AD`W@OG4wrkp!~I=!7F|0C6rxx z4OTw}EvS?@L}{^}#YkFCe1_2NBd5HVN_GQu=mUH7`864zDvwuKjKqw)5-|`SyA(c@ zg^njn`9yK=OK?X*C)RJZzJ&eNmrAG7z8Mib=JmfmH+2N%U^-!FZ| zd&r;h9(26Xt~`BD-XSMrWW3tzY%*MoOCsO2U+Kk;1}sp1JSIo>Tl$3epig@b`hk`7 zQu{tUfPL)uH2rvB6I>S?$#_VVK`&L5mjU}ZiEXT-ToQ{Sf119f^xqxS7Kls23p92z6O0{F9-X|gF$jR4|*l?aNw^z7%-Rfpq(WTCjrWXL2@|{;+#B1 zM5yu%ujG-rfh&^(<$)8*^~gNIm5GA#K&YJOa7~Mo2IYZJ%;U)!ybj^f34}6@h?wYO zj3IR{ff&3pG8(OnRTT2byaGJ)BA%8C9+_i+2V;9{5Nd9jo^9cgxd-%c@}V|k#!#jQ zcEHa%5m6pQ!@t2J^APB{D@tp8i5~b*=PHSL=0MD$pJZ+VefLEAcBs&&JaL^Fi247P zKAFS7KF(d#Z$X89%9F5f0Ors>nb$xc=QFBr#|nMQlh8K+bEr?|K+uOi*XnC1(Z_g| z`4D*aiFg_lJlZaRkM)p~BQ*;Rkqr-NTc}6oNzgMRVnV-H7DL;@(`jRo6DUm#m@+*w zH$qyROeqg~;eUfi=0niK36$#DzCzEo@GQ1AbJC=G##HFp79MoPQV%&%Qau;`%4*o;g{0bRS7qOtHwE z?)?P%m~(rt!8MC16&h0?bJ%OyKjBnau5cah##?;hdH~_`3AJ0&#!wkfN_S#9#$S}8*N@(v%fRT3WN%5|#e)`%F{tI)jpwb% zrR6H86Xa3K9py=^B!y?ExpjzjcA~uk>XdFI%cC4j!NPj0o8u+JW#FXVPzUi%r#ZairpL^Ui6#j zzBuWZiq!^J)X=Jy{>XQ%qn!rQiCT7|g~q(Jt$&#}kHn zF;=27wszj2*4{FZwXvS9XcxOb2gR%lc2m?Vz9zxPQiUQ% z#fwDCgO|R++R8@!p2j$9Ht!5UWpkSy`)k~Obj*IU@A!*Wzph($|#cxEvR0EW2jCO{zOT2$OIwuk4R2_76i)?gg7P!r}J%# z^0GzR%Q9UW+KXmZ?3G{Gi(j!hGhwlrH!-85j0w9* z7rS`_MHu_iZvN;g^9s9Nc_-wu&~EW_=wHpZ4O^*O+rhvOg}fzs)3nNY;i^RWL9aN{ z^s)HLc~1{{L%m|W>7&bpH*t!W{be(3SwWec1YoZBA82``A;7!K+X6!1;MfCm0yJ0{ zUSQbBvBwhp@LY?otz-O!KE01fk!D}NHzc*M7krzvSlC)7Q&-h$bVoQ}xB3+P*axfn zs9MftqiL&IjkvWG_KPKJ_++%{c=G;i$%7mGFYR?jPkWpd*ulIG4f9&UH?)k;<-0J{ zCnbD(?E4OQVZ#aN{^i*uZ84eGt;yW^Z^(S=-;nwAzag{f{mEe5oee%Shzv&Y$?|3o z#ZBnd#r@D!tzkJA@8cZ{zPNo0?pVTFwrJD%2om=38gN=5_G@j3cYEtX0{xx9qsa)* zJ(l1<8{#oSWbkr9w-!1ih|$I%dNnRukOt}jMkUd0czf*U0I*?%jqw$7?CGiT9f8xw4PtgX3yRn;0J~q#?)EWN?@lJ- z%eC-1AjDtE?0p_cW>4b255NCUY-6e=w%r@rChZ=_L}!Yh<&~+uqrw6eJGJbT-a9-b zg=KB=UkDWv-xTZfaYUp-UxJ=0p(g@jm=r8pH8ipe2(}Z92itBDi+K2Am@Ir8Nqh;& z5+4WuFUp^(miYL-fowx_DB&&n$;J609{H(3uEXld7}0(7BJJ-T6S^Mwl-bL{!wbaQ zLqt3(++F8);r(GwuC8Y+$aab;l&ZG6o<`vG>6)$@ZOxGsCT}W=!%V-xShG%ELG7(V zn`|Es7IL$rR&m#-;41S_=bdB`&H)r4EQxm9(D5SFYK8b)DMYLxK?RTXAJp|3v?txcX! z!Ymd`C(rYQCId^4$V!`gA#|Uux`#s?0nVQqXzegKP&*2MzJ5QL06_^dH$TE;+UDaE zHX}go%II6`5rsniPR5h>Ebd&N(U%#@5=h3-*_j zVbeKUm)V*mo|eIsUNL?iPH3W~I3E6W{Msx@o*-*JJYb%V!#M{UU1#64@8hg8-!+Ig z>Ej{16yH#|Cr+L3+*+A+=8sHxMtK19A(%FNAO9_Qz>axfnW4tB%q~TO|E06u7)@dB z`ANr^b454ad&P+b;$N^8@|u-uwJST?!%L-w)7bttZQgsvy}Id)Gh^16Lgrz5h$X54CD?xBxF`RG5d_&5|r z>%9~xpgq+skK%7h+YewjULRaa!=qilBXu08aya}uxQWhnNj)gm4?z?z#F^l8cQVBl z5wIUtmSvaCPX*n4wxAOa>3V)^um{>3(>V)(ytFYy924^Q!m@O^(9CinMMxsI4#2;6 zIlm$#5%Le1$bRKQijYJ$4v@$J<@}0}M94p2A_tcXDMEzMe5UzKb4B(KD;H7(R`Ojr zk}N_4CU-=+q#`6wcMg!!QRV!K5c9}CU?TI&g%lA^b1rjxpFrI7W4wm?zz|~pObC7A zlLB^b+zO9A@w6?Bh+-$yhz|=?q{{UoeTEhdD!%ho!I1bEW;R`X5z#E4zeHn<`iMbx zTAtY(RjnVYM7PCUpaHSQ>Dam!wGMM$j%!Jl3K`BLw_0ZsmEsg}sjV^!9D^z&M-*sw z93oh!wH0Zp$V>oRYoPZla7a-CM2b!1FjUa$7|ShB$mu-{kz+9l<}lLoQkVB*UAD;< zZRuMMKj;#cUC5GZ4U{Ya$M}wF_K9Ke`oa0Y^Oe48Si%ddl3q|i6z!E%#0Od8Oa_$( zVviRs4o}L)Y~@xePgDy_!~CpJR81A)fcCCV+N*%5q`jpo6PY|eDWm}1E5{)sZzcHG zCixYR(3r8cL_U@jQb2_E*_zPBNg)NqG72RvlVesIiDU6*BVHRhUNnoOe zVu~dcW+?8D^vam8EMry}SyJWz%UH3Awi;b6G6_#AB5bBG#?&>St=7@R`gLVY+k|c` zPe>6Qk>CGYw%lHBiy{W8b2bBalnW_B#>=t& z1Nl-I|C_%2bh#;t*cM;@*KN70+!jS(dC+#RUO#4kiT#lp?T?6*{%D@N8q+Di|6{ng z!7ou;5I~)}Ub~CL68gtV77wrI)pu=w9}%PLYS=5O<_z>DQ6f5Yji_1EWD=65tRoS! z=|poWuG&D$J|1{pldTluaUo=yXI8lCcduW7Jfj( z@mc_}jNh39OU6wFPl}~%5Yb{_&-MoLNdwtm2Cq)Qoyb|?k4z3<%Z_fDxA{&ucZI)U z34Dq&{zznI&onUDT>}J%yviVrNrA3<1rO7lo*a1+-|&DEyuxfHCP7YaR8~Kl(DP?_ zF?utArbIPU!4y0qY7jo)I06V=ih&w%+(|_6sBqjP930V=a1arEQ#dXW4s;GNM+0;a z5j;kY{PN^G5|ISSZ6tq7$cN~nP^6#a4w5$ud4l!D4jT474B5vTO*2aI{Mgf909y{P!f=cKjKUovT%*C0>-*X#*K1AHIK0WimsOsL zTr%f=HMAjsaO&Dt6E~y9jW4;5%cg|a#k-3V&$i#Y^=I4h;$PYtey0G+`Kl4EgKjY$ zC4_2gpMRfj=3b%CzYoV6{h?>+mS47D#u>b|t&(Js3J@>%~dZ?-9m`Y1WbG-adSJ@oYw^Tb4FJLFo{z$W5X#wWHJ#-PvE(|UOs zjBRlkninKO^9Y3BM+t9W4YMr?*U`^_K9mZ|E_#9HTvdsMF|*%4TcAbe3gU2HGK>H8=WX&()CzHoBBD6{W8 zW7^LFVbku2(*7xs1E)Q{G#yF1vlM4KuQD#OvQwn)XHZw1R?5}6j7+Q7!e^S_pM%M+ zgPa9t#*I6^_lF4|dK+!WJ9YRgJ&W{nuB^jInI*-LH|Z1nF07~WJ(`G3v{3k%UgA?t z=+*cJQRR$MVEX4qZ3)sxWslP@r6QTvlhg~Ke+IHTs$04?Z+`oNw)wr!GjlKCBKwK_ z#>n*yIQ$!R=o*d_iU&hx4KrOlg?CI|eb54_HS8seYe-;ERouWk_EE)ac*ovJ&TXz? zUsK#j+#25f4U3d(*eVvWRCdN125j+RQW>hnCwa#LC@v+H4X>QpUBfmP<6JBzwMI)z zGS$@i<1V1Yvoj3R{Q@F94QBL#=oKRjCZ~!CCCccKNMql&R6;SKghKO-CkIZ0&te%Y zni!R0LsLtzQ3g6;rJcF5p6fgW-a@_X{XzJ=JtivHoRJsd=_pUm14IM9^>B;b57zOQ z9rF<%kG}{>T$b=$RKi23lIP+Q9zuL2-wW(2G3?^&O19YhLC~|@;@c=wFIZ^#W{hEo z@!uNsBc6+ygl=b8X zI}a#A7262|DCqc$)e$XODq_%?izNKF@`M#3dE0v0%4pMmt32%p(aUc-mQ9QQSGeOj zw8ET2GlyVSgtk%dlrbyJDLOR|G(~q1ipeRu!t6(ykuTKb$d@!sshXBwCaJK@plgv> zRB3FktAsrY0F=s{ReA5cw+X3h+kPEiryDXc;3p%Z!(Hc^lISzK(J}{Yahi zwfQByW6OE<8+9>ndn&=NZ3b<2u;?e`wu&g!BQ8qXvnxVgv4K#+2J|Gf|H={`LJ1z5=2ay; zgerMHUcy5t!K3|t-_<2Ngx)8QwdWI|p1bG+Lhu`Z_~}Rf#*=f5-}*J7(wM79Lx8zg zGzCn=+_g|3F~^(om{YmZn2Y)1n6rEpF&Fd3F=u%PjJc4%B<6@5DCVv!$J;o=Fs78> z`tgQA@HY;Ezo{H=%k`FWyw!hejQ7kzh|hHrbHQF{6;@vZV&NC;jAR;)VKZKaA5r8y zOW{S9QUWXd^2IsHzVwefKrfb47|S<9Wu&dfZfp>#q*w+XHy8py#_Olk>?2~LkNsgt zqvJ4kL=xG4IxESS)Uh=hojI5s9h#)IMrj8#;Ull`OQbwrIoQ7piRtuIxN#J!fc>8I z=W4%r)6+BUx;GOt4$QY7Cq+++%hgrlk2s%g{VeEMhnuj+(!73_xw1?swzgr!%5s)* z(XXi)VHA-^z`0b7yz=z;8`yDO)mG{hQu)X-I?$95kME!Ir(~x~#B_bIq@5+Bcnq&F(9R5t2grN>?I4s6PZd+vP7^8e z+vb365*|W$ZmzVn?g6s2 zv=md(uM#bJ3q!E{H}s!P`*R_`_<~Rryc68kppS#3Xx(`pZqYZy;~TGwFVxjn*Y)2E zVLToxH=+1O8+FjF!~*(ybe@62`AsQG#!g1p2!J#O~)yY$IfS zw;k-bNZZx>fQ5LK8(c_JRi`)rJYimKUw}2eM7a~HEQ>FOJkoy?LZ#ym`)~f1_TQ?6 z>CmQ&2eIi(p;8$b5yFdpX}P4IGOt4R63XVVVNIuSxe4c^racS-{3p1U6jsdgLP=A#l}~5p-=Mo{>a`;g4AG2}Uko8%2b^BQS20$KdE>E?)j8l;N%@g&%jESdCXUe!8aqTwzVSd!#QOk{ zc#rH?#K0ROLaJW~UjKun`~45`r+sj?uPWQu_|seL<@D`tI6*IP_*`mQYAGAX*ft?SD%=rqxTSeotuoAqQP$_;o4mz)>(3u(ov@tU;pLuLn>`l*CjQP`^ z^OxeC?;O0~a|IqY4jMAmu)VIyzrD#%;qwC3RrVdaFT0t@d`aslsJyZ=t?h9Fai1t1 zKx;IO{Rc?nwyme($VPMqX_)wZY!Z8H&l-__f_4RFGZp2RD8PzH{SAtlYH5t8=RnRg&A#SyS4 zTmwT~V7xBpL4<@x2SZby!>jP)WwAdhXeB;I|E%xq`TzPmIrU7BjU8P#JwpA3@D5{2 z@kc6tUO9fQ;*Z`|Jn9b1V}3b56cfK-Tk%Mc{C6e!hoD>pAIC(@kcbH+PFak{;yhAT z@Cn(7;lCt{%rRZ`?4{`nK9O$3kVy9!mBrwoR95f_*@z(_d#uXtm6YX}d!gd@iSb*1 zC+G3Xe^bn_v9U<;n8U@kQU7AaZ!E{3p!hq>@h2*N;CD;9^2!t&tBH3@;;`4i@0LvL z1Gpvo08;qXws+vZK=VIPnZd5|_nf+ezUS1H*Yref1ZAbX z<9^944E8=#x3{G1DZ5yFy8%tDykFHVJQB9Lahp9*d{9>K$#lON%7(4F>R?@t`?B6X zCYE?DUF0|630^?2QMfkL6!tCJj;!Et2h-VX@avMkMf)G+*=-wmW)8~3zU1TLlM$f_ z(syxKC;G)cw{TBH)p6+nZC#m-+J{P;W_5gi03Bs*UhtbRpP@^W^MOaDqG0&@9Y!Xr z&NqR<@Ky=*9qT>vgm$ivNEjIP!d{Xse6{^3bs+AyRme5V?K)NX;c$oh^WTkVK z>*?DW7IVV})8%z;ut;w4VodxNA4gryZ5WFJ3J)R=#L-s5G0VO>CkU0^Qi@2Z_R0jy ztf??B9Jjdi;b41r+$O>H=iA6&^k{$r@RKLc3SCWk{p2;K^ZMqNO!s!iPxXEQ+2$ic zXg1Pl$0njIdk=@IbFsUNH690OD1TR!M;PqnDF!|qBn?DF8iy?3M;cXjhuEfyG!!#< z8n8M4-f3VPF5XkdvZ4B>6dSs)1RFWE6P^hEDJ}>rg4R2>x6SnJ>dgqX!pm@;jYFT` zOf#Pl+P4|Ig;zja`6<+s@T(HAyk)h}dTTJ<8ka4+%8I042T}d3_t#K|TlgJlK{fa! zff;U)!F}+1O4vQ)@E$PBWC#3SE9EZp8h$OPE{%^sy#|rn<(W56PB{HO`W}QYv2q<{ zFg?nqM2-)-HC1I)E`5wQ|8`k_!09Mia`;VE*dKAdbVsClJ>^p}4P=@PNE2(!e?Y3Y zNUD0S>Qzm3UhnH5tfBXMXYr2yh!(csY_=^CjBW2%P(kBu@5HvXv>MWj8 z2u2|=48EOXcj*<>{Qd{}<+&tOgw|mDQvC}4$NCpV_Kz#oui$^IU)wa=AC&4>&^Dso zLbDss3a~EiigHP|p}}zSZ9_|{UW?jIv?v%=qI4n*S~cf&&s;d8nAPD0Pr)SD`p>~LMG0XndjggVNDCOvSow3NuNFYke{G+Qf5>8+8h zOc8PFDON!F3VI>|(%Z}A%M&3F*PSt0!h1!~r|KF7H?ekyp?4Ca)-ujL`Ocj1@&Tl3 zl%yq+hW9WnyuzHJuTm-4(pSZlMF&E)5@yFPIjxiJudG z;&i#pkNQ3iEeA0P7DdTG-j%#1=?V3sfBP`+u@6h~mUJY2HF{8fNjS+a>30mqFNVbI zeD5Yk`sQYqCpu>vv3W$VuOq6eqTg=LNb47YUO*dd$5z1@I1FEhlC2s!1B^m4HMJ(s z($W(?2a+Z6_>RJ*)$8A>bpJ&SccZngtoVWrt9Xvm5m9;(Vo(wKYCqQDdy+|&Vng8)Y?LUm7!wVz z)DUBn8X|0@0ao^6L>N0dLWFW5qC{j`xriW=B1A+Yuv1Iq_5sUOu%U1X?|)GP^MSEz zX-)+ZrW|r46BUut1AZ_tfenRAu#pBH+Y25>@rFGd&(vB>C>dcQsbwbd?rsr}qG|wA zsHc(?Da1KG@xNR65(*%)r3@V^Dn&<1R@*|1+h)-gnKl?bR67Vg(l35^sKQr*33Ws~ z|DjZ=ub4!XjR8nu>XoF(jM!&fcNxILf({jxa{qUg4B%#_9p!H@dT84q^vFm&N-t|H zuCBCjG8AQZAX=z*09uJoOb;DbUP>VotP-8&w4}~5T8YjBMJKP7I?HKEon^EVod=0d zUMqE$(~>&NXeBz^L?^G6I?HKEon^F0Ck_he$^MZt)YwJ9)*u0aRUx!n4NmY!j9`|_ zvjB=cB8d%IlgLP3YGg?e#F)_32oo8IkE3e%@SA`dNd*kQ;z$~lA=Eh-LrD^h4Q=@J zZ6_5;49Jj7VjzZ+BqX>r7rd>^#efXSBnDzANkU>xli+P-5(6?MlNgAhBnb&UO@grMcj3WfB82B$F73Axa`{wM*it3>~T~ zMMp}cE_^B3XvUaOG{Qtuv9eDkYe^Y8lrKd`N>*UBI30emRqwu}5d+aebpy~!bTWXw z4HCu`I?HKEon^EVove4B_68L?%V|lSWwa8VtOec%sS6c4%V|lSWwa8V40~^b1b>Cj za#~Vn8LdPogHRV0g9@GHw4}~5T8U299dCowpbDMkw4}~5TBMT;T&320IC3Tk3N^~Y7sX}KtEvd7N7U`7eD$x{ULiq?2NtH#?m$wpu zLJKtwAXlO@5lIy~%V|lSWwa8ViAbu@Sx!spETfg^Ohi(J&T?8(XBn+TXCjg+be7YS zI?HG!Iunspp|hNp)LBL=(V2*(3Z3P&q|P#0q*J1+L{p3j&NXeBxmkyN3xoR-vCMk~>oh@=Xg<+P;EGFpkwL?l({ET<)PmeERd zCL*aqXE`mYvy4`vGZ9G@I?HKEon^F0r$kqYrWg~-N0@{Z-tRR7OJUI*n*&b8#8MU$ zNsZLq*65vvS=oz`7Z=LzMY!K;@zgK)a7TUCkq6Fl_yz_1KIyX0LmM;&Rd#;!8==Ev-R)B*e8 z_YT0bv57He*7CxMWX3-iBc7v2eX^!{B!GW9JL5GVk~&WLn9t+y3H*laua)bU zYCi+a!*c(N+9z@Us@(rouK$wj`g-DDsDHE`)Ou?8yI?X6#Pl?f`eXy~KgBg`mNydr zNF(tho2h?BGw&N)$n!P1UOt5QrW`RZ4CS?b*sDY9&C$bV3`?8)N09$}BZyxxlANC% z#rwm?>@+5APLS)`vBj}z^N(?_j7yv0k*l*KrKasTY{#@YMy^-yNZB9m_;q0ZD)$|oOmW#b;+J&tdT}T1+$8s3 zmg^Ip)bo$dKXj(edBVACo}7o_nl%@Wxf1&}_vWv}`)R+PCuhxYQeP3CKg#tDx&BkG zP8X>exz@{dh+I#R>l1Rlpqn;)rkk9flWWZcVvdsQ0~45|AIbgizT{?;S@0dgl56JatT(joQNxz(wHI0*b zoi};c$!W7{GC41j>wY_tf6llfPCRM!^Xiz}0gaT?AcW3GEFS_Wg?ksV-6-Fj!)s{q zoFHjSK&u5b0`x|+3Q#LzeLLeJ+&>CU)i?t-T4+}YtpO0_ZWg%)JgG$Ji-5+WhV5vo z0Q~@RDg5p%a=#Q>GtNgah5rQ2K!*s_ig(3P?leGSabj|R zNpCHnT6{@lj?k_LG#g)knK0@6BjWNrFa}RLVnsKHe&>`L;mcw$Kv- z{meq&6XxA|s zpefEAvq7L=0;)xwdR(A)1UlS2C35X)(vC1c6j}giA7`%lu|T_8=vjgGv(QfjnkRB| z&2s`RvCz*2S`Fx4bClU4&{cqXoTJUJ1^R-}jyA6d^i4o1v%vhxX~FT4pP~yN0_aVF zUKVH}Ah4P@!C8%S&45sTsVd4X0mRa55NN5vp*BFHF*Z2QS!(J8nha=-v&`V-XP_M@ zv}LAIpoIc`$TYju(l1(;n^vJ+3fdLUax+|@I|ag_Zh`(spcQCKXv=dVS1_Xm`mKe= z3iLLhTC~2q3e=nlGTY(14$}nc0h9u?yFmL|+CqVj7TVe7M1fAT&~*a!3g_A89+y4B zdO&>d{O5&sJ)kE6-7C;%0lk4|-oGdLdr;)on-_%kBS23(mzduO^cxGkEYRNp-3QvM z0%fad=OyNM0u2>tgLzF--w}{88%ztjl}58GpzQz+7w7=tyv9uNoQ_5_5720Hn>kdV zQ!RA3aQ2JbZDy`O*IMW(f$p==Jb^X~bh}v~TAl+m8sA`BDA4aMw8&$;{4bzt&`uP& zOqP~?+CpOly2qR;w4DX|oLMQ*EDNm?=x__2CD2J0I$NMK1^T=>SDe|6GzkWTg$KmRjlj^TF>GTYXmFwXHor9F4c{TJkVKdz2>PNG1cg$fejPA^hVe1a_8fId%0@fzt_(E{tQ>&yxcwn*EewuQ~&NzrcMux zHo>s^l!I$Cu4?Vc!)T$}uh%n&jYy3)eZyGdm*bi?Zx36LN*i}L@6*E<;=X41B3zq? zpNMPQ@RL(o^`zm<^=!E=!j+})Ls0Lie;(JT zhrcfOyQYcRORkIx`q?qB4CnRj;imwf9`PYu+eSDT36C4W{65(5Ensfkjy*K*wYAHDD&2Z{vQl`LSGoE!RKE^&fJr9!2VQat-7iNxr`Tl6;>!-M% zY@XeooP%jlewEdn#wH?8&khz%)nONEE+x&=?U%B z6xFIYMaTSW%mOS-q{q_!ea5mz+%WdTz}z~vAJ@Ca(o6Ts^**^iFqZ!LI%N$n6aai5| z^}5Vo1)5}`w*@*!A>-8-z_}@c&cbTaa{~R+sjkoR8Rv1d<;wQ@&gW`|m|B50i=9Kv z7=hHgLrgw`Hb8E_1k`5cS~+@YsJYcb^u#dpxP|D6;ihdo)1%G}nA?vPXtSZ*NOO#Z zC^yP{G~yg#I?QDe)B)%wfvz@J*MAyu^qiHW7I8FEcr0~O{XKB>upPqmkeZnkK^=f* zE0npX{sFk*G=wb?a=TyyjSiFx;SGDC)mR@v_n4i` z8v;FMn7^G(Z71b68~SXD87`2P*iYT z%;gP%Gt;zpi=FUpH=x-OG{xD=oD)Gaompm+g>Gp$*xB1WCXlALj~P2LwrpRs)N33R@h)YyUNk$QF}=lSNK#(SNGX1ze`3|rdc z%&Q8)vOFO9=(t&zITtA$Z#t$(3YoQyj{@35A+rJL9dG7X=t|HQnbQ>#EsM+sD@QGh z&D|DS+n6M$pn#}z{D|An)}ykembH4*Z6(Hxy6&{&1c$C_RO?KDff478KYbr!l-pvNurNrB$7 z(A@$BvgfcabH70IE%c~B>n-#>fgZ5XF9do;A@gd}?~tC)$E{GB57qz9ImL8E(4U=C z&D;q3mvfpqFM_JwrRI(ZYIK*GCk0ZUeaO6NA@+F7O(P#dur12z<_dw%H-Bjw;jS>t zal)Drl4>6B7R}h*6&lw((OqR8w$OpiySpDYn{eodoTmcnH;eaBXkGLE?)hdu_G$Qj zlN*}ny6a5)o&re^wBCF~AeLAMX8u^GY*kFN1&DMqXvE z5Qr&E#go@JSsHa-ZTwj==O@gO0x9P;X0fG_^IG$Gg7Z3)*_(38dA(^BNb`4tnQtNH z??!W7#JR$~$$Zw**!$jWo=DJcF)vvf)4SC)?Gsyen;9(-(_4X+lIfO4&W+~O1m`Es zM-!ZPm@5*TcbbP2oS!n!CpbTCUP*9nGVS}usei^y5$JrW;dhz)EHu64F6S=u4S{G` zhxx2|S|ODCO80K_nn3E8yG_%6vCezUXo1v&pEFY|jXC0(Pv*U&sd1P z#TU(607?(1g#0dd~HVeSw}Q}`eAkfkw&ht2#0 zW6np+N`aK~QNsgvVLke$2@Z-mA2a(1bd5Quvh?u({n9%<*pyCcl6%t(QlKSKI%bKQ4a>YW&RzU5v( z6O_}u-trsw*CA)>^_JJ%-$c+~n(lI5NkHS|ZEi$tPW`3n4fppEE!F%l_w@*Rw`HpN zYXsG|PBm{t&~~jI=5G-+3ADdQ&gk+<}38Y)^_h5)4D*R@3xNg-Zd*N^oQ2*Slb$LjMCm}?e=_Uy@l$B?CNEl z?T#f)Jy`2B38eFfT4$UYODO+I7SMNM#p_2eLI!iG421+Sg;+bWSgbj0ig38}7^zNNpM6TxTKL zvYqpgK9 z^Ug;i=t3{=Y_gox((Q~|5^I^@Oc#hFmP@^f&cX=#1U_VNUIcCQCObDNlo^*>YIbt& zvrxA{Pg-b-KrdNnx|>$*8wf45(1}7@ zX`vMYZBPg&CLRLk9TD`HH^q6}a-N@i0?>;Vx;Xa(KyO*-11{Q=M!7W#JXuYlGoWPYA|$(iEZW}#o_{^3n^9JxQr#p)y zXq3N)v(`e>+r|UBDS{^WGn|Jlv_EJwoaZ8Fg1@KpwuR=kO$F3?n%Xk2Z4ZB@(_^8N z+x7u8CxQ<4_i|QRsMvNSpbZxKNZT>~Eawh|GV9v{XK&{rOS`)51b=VmnNY6w1b-jr zwFo-Z-`DY%YU($(t?>7AMp)=>K>IsWEc6XPvz_@Cda7-ee}Hp_g`NX+ptIgWF9SNr zx!Xc-wVmf5>^x>6r~N$t5a)Rd)dRxUc$R7EtLr}MALg`MXuI~0`g5E~7U}|YxHH#6 zyR~2JAK@&w(5&_={Ue>V7CNH+I)AQnvqI9V&2u&>l*tUmywQ2sLhVC4%sl5w3k9GZ z?Yv~6-9S6q`IA7Ks}CGn@62~HAEKR`tB(_i_w3cq9Qv$3-{}w<+j-14oj^GaX$zc? z^WLE^`o}mk5}e06vjx&N_o%IRYLg$VIZK3l}f_9wqSb}z(^L&DKyz^3m zcD(a;g0{%JT!E&S?tV>Auvt8DlCw-8O>c>_HbGnBJd=P3Y9bDJk7Z~L0jfLlb|hg{*a(8cf0~qr!&H%YLRa+d^#F&vZ^xNLuzYo%NQ+mc8g~vJhMLqVu?g*s>R$S1iPqz361ll=P%! zFFHX4J?8Z~2P-6Ns=dx~OIuy{qTlPRk03X-(%ED=*$1q0p0p7AfK|?)EW|!wmD5_( z{IL&M<@8vHeZVSbp@rB7ta8>^h<(5+=MD?84_M_qu8{NrtDM&?#6I9Gr?FRa#6I9` zXNrZ`2b|-~w-Eb)4?E{sh<(7h&TSTAAJFGKW+C`=^}eEyTQk+VT6zsd@Oc(-1*<&_*aEdoP=u=@#N{%O+=` zK)R!{$@y?37o;{h>;DgX?*boHb+r%gbD1-fWG0u%6`4r51`v>-R8*t{!X?U05>!-# zAsJvGH!=w%YB4CHwrWv9se+==78ENewcf>wiq>0EQL88lUW>OcN#kx$+^ATIIPiF@hfB95_fzP#68AY zmn5a$VqB^aNxjursSrthud#y>&UnY1X8JW21|*mZRj$3SGxijxDUS&jD+U?t6e9Y)++(vj6ICx7+y6#U_^4B>bzR;VPh2zjd&8X39G*lTQ2=p5wjH6Br@A##!Pp7E+emq(TY?N#XJ$a3HN#vz3^ zMy_<;H|!s?EP+QNKXvvQ5s7&0`;5I;Q{GbXYGkGJfie6ViS|a;I3F1=EA&-llJ$v^ zd9BR*M`VNZM`NWzbhiJ@_)?*a!p+VX#v?1Jq_l~zj4h0$eST%Utn*%QzB2YRl0M{5 z#>nfap4=Y}8Y>yeR{m_PVRWOIT==^4XJeZ}XBF;o{$f0#P-AePbI5o_qXW)iW3NUB zoqrl%DfC$WKF2Tv*HeEtipTN~I6gC1qk~Ss?4!^ND4A*w)98ScZjRCDpp#{urO-zx znQhi;bim0sFVyIubBy^Dg$|))#9XV<0jJ2kQ=@}UPxE1g(hK%Ez0F-39dP=Y?`m|= z8DM^?(44}3&LGo&gB;PE!UN6_Ge@I?&QPbk0LWQx{z9Vz&P4M*jSf0f%pHv6Y)&uHtjdb2KUv=a>)3l7U|orunCvFEf%BGTr=GA+nJ3%&!&NUYP5j zVLGd%mbMob`e&Ni8ujtdHv22|R$+;Mj(LhkC;8`^V>KG#kDId<`Wz)|%tnn)^4FS6 zG#cTrH-DHe$CE*jPPuQrcUC>h{BN1xXjJ0gW2UT@ zBbtno@0iDEbdvu)vyVn4{(a^TG`iKl-<+t?CjZCgxfTXW>kle{f0G5qkWELJ+ILL$8Wu<(LpEG`c$FxV;}MdE#qd{X8N&D`7^C_jb8L;TSXe} z_UBqxYxJJKi}f>&KJ`be%^K}5uZ)~gE9`<3IYy%OR5$^mnLb;=rU z6YrVtG>*3>YSdc{wq|McXLE?vq!7JP8EU1jmG$V2$|=?{3eg*tQ?33A(L0pk)+q|n z`<2tIF$&Qel@Znyh3JjS53Oyt$~NhZ%1CSDZG@JJIo%HVM_W0!OSG`tP*G-0R_I6F z{^1{ERV#EwH!CpK+N;nF-2#De*7rIUoISZ{XG`b?tXdPDQ+ioiYO;*m&c?__~h-kJV?NG5sLy ze42izMni#K^`MKauQiH@i>(hB$vL{%62GAF$-Veut3V<0OG~WYjHF*`vj(fYt=X#s zZPqA_)(4hZlQr5LxWbyH(LU!YYq>@ToNKHbG&<<4ur?@^e(dVN_1420tqdV3Rdbqvry5 zS{G<^(7D^1uhFi+J=TQ^l^we+u*F)T(W8O;tTh_#2>jaGtkH9U`>p3RI_NxT?bc{l z;9=`Sg;o@;4m@HV(rA5PyXD&`$G4(rbKpsjS&2HjOq1Ub9wew9k3ndPt)K&RfW{(rx;?Q{EfgJM95~Mw^+NsCPm|;yr7aM!m)RR<%ao z2KHMk8GV>Sa(-lOR*2;M$l4)G20rXwBtEiUR(T}#$JWOx@2l>0=Es(OC-wJX3XS0t zE5c}bz~5si&|rnS_b3scTH_TOio8#)N`=aM7%6|WY7{!Vhaaeg(T6EC_5;=ml@~+3 z1J)XqM_T&K+NScFk@uOkU7<^R+-7`ky`j)GJr+5iTl-Z#(%=`?VU@QUd0$w8yW|*1 zpI=%2@#X6DTk~Eg~p|IP5H)Jtx?aEZ>?<#9qQ3D05pFvoa65#wWb(*EAZR z;@IyqBHubWC18J{^M;C4`)?YJPf4=__mE_=WXR5CB%{gH5v-^hAK(>QI`FsCojuBtkL+Cu${6cDOrx4$4JI*d3Fzt#;4@l z$9qb4v4`uti0EpM)2PnuYR5DhDk64^L;36xqS8Jnw-gdJY9DP>5D>cYClxw2Hgi!xj2H>h-WI721P( zJ?sl4!fZxFPrFH@p+HxvlBCaG_Bx%1PlnqY+o3J(&;zO-t(9K(%LJ<_F?bEh#NnQ{A?I{ukruHfk$Jz6AUId7K zsZx4w7IsInMqi=gAmlfW1YRED{6kH#F)k2HN(osUF$qw}IpB6E*sC zV2C}Q(bIz3Ji(r&^R^f#+N~O0nljX0r_og@!|a`&dZ*eW?st1wkuuz#pwU$+BkVOA z-I!8pf2q;hlrsDL-?;TQq>Qt-GrBP_Fz>FE)9tqvI+4*Kg@!ZAd4THO7#PE7uta!I zxfS)MsJyfD9!NREu2E=Q2B9kzn$39|6slviT_U`vd<-S`YV>r<1lxX)`x7hkUjT|Q zlAdUy-Am@-UF%&b6YY@-k<=6I^A%c}_byPALO;&?0O)FkZpiy1&<2Ip=6wb9h(Z@; z{uSs|g?^rQ80dgPTk?$5iMIWa)WkD+exQg%cxxE~I#Hp0dD*Fx>Y4URg|hQ|r%tsuD-_8;F15nmq0k_pO8aevhUS-~PP6~4(aEW2 z*#!?voej?)2{c%v@u_Fql?shR-r07IM&nb@u~#T`R{mt5jT)VuI^BL=p;-O}K>IbC zlX|WlctrNsm|qK2q|hb#O{wSE!z996%ZpOax2LGQTk_k0<|*_>{uQY+>^6mrf@@PR zuvaToSglMB|Q&a!tZG^${IYSiAV(A0uEQ)k=XFp?Hhjm=R?_HDP1QmgF< zBbgVodujAVYRn!c5iI%Z)H(LYvL4>l-<2}gwjWdD3$~@swId2WhB3^uM=JCJ#t^s9 zQRpL}`S!&M9m>Bpb%DK7p>&L|#(qGdC81TRwf4&j4ZvvY>_0J*a@O02WnN%^uLn}< z?V`t7mH@4sdV9D+f9mzO)OvfCLYch@EmNouqm2rc^)}M#?d=i?vYvW-uSO@QHrV!d zIa;!w2D_I=<5L&fV;D)v7TOav8Y&jrGd0RiYqVP=3T*3LBAVgQI{Nw zyoWT(PHVPb_0(HzAMn&$Y}-!={3m-~YzH;kVl1``HHwH9`-kmNv>j^H=$Nz?`(}-{ z7_IhQ9(1Ao2qSq;y~uu5Av&l2$bL_uK%eeum)M_c)HiLZeORNxY0K=Be@jx|C<1*> zNxRZML!(h?KelISbVk}W_F9e3O1sX!N26J3H`qHgT99_5Z9M6=*^+j%ov%?_+FE;{ zM$6M~vqx+6leBgABt}w$ci891yg*5xwP|eQpPOK%+a;*4wXn>TR$;&}fUX z!Tz&EVtSwZ(td9D-9eHq2YN8=7xp}bs{1^Vw#i=0NJgrg?fYaN$1j`hhufhi+o9iS zG*oQ1seSh^hwfI0{&FZH?$L<;awv%oX6#DaYQN2`$X)wh`(s8o1}?$a@3s9;QLER9 zpY(YHsDP22_j~QZ3emi8vqv&oDc1FQJMDgZqsqI#&xdIb+Xpn-6?oMCt4436J!S`< zrXFq-52NH`_5_V~1-9E~YxG9i6ZSlXUh457&}NNx1)j8jqtP2_JM5hbZAY6s?BFx9 zhwXiK1)jF^HF_iM8M}`{WUbHGCur0+?OA)IMuXFyw=dJ^l(d)aRT_;-+huRm=!~@2 z>_2LBR@$5P-!+<*_LiNwQ_2$PvmosqyF#OuwD;|}Mr~;y*q3OuJnbWUl}0~F``BKm z(73eE(mu8KYxHf}=eBrO_AoBZ7yQaD(kLT%&>pE#B=}c*mPW`slTQoW? z_)q(Jjm8BH-vNbQ=rbi~`U;+t{k_oVyr9oFQlsji-#1UAj9|cbrACop(6>>e;$Vhv zr$!~gEZ-rGP7CJv`u@)CVO%iJSE{t(wzNLJA852Zt*>u_Lf50se!kfnwWSU4wP>_F zZIJI;g+4-?$NM&D)Rs2H_mD=*(@ylgtk4&IE)Nd%eW=kj!C}6`8r={)#TR}-%K2B6 zJk{4%qicdAd?PfvAvn@ksnC@Lmj_FIF^#SXmiZQGbVG2g?+S&C;>&~Me5*COCV0AU zlSVfLC-@#xC{VmQIMMgAM(cu8d>?A`i{Mn>VU6wzR`|j%N~r_I4+PKh_0{Of;5oh# z3aw0kE->9US)+r_`My~i?FwArTd2_s!I{2GHQF7V?YlvvJ;7?<28GIweJ&95J*3e= zXP)n6jdlg*`##j@h2R3;VU2bN>wMvtq|{}{?g=*d`YP0=__@GB-^m&sbeeppYqTq{ z$akJX#VEPhw@{;l&V{}!G};xo*tb@pVa5A`Kl0t9(PzP>z9%&LI=IaDibjWn%YC0~ z*!5e&WjSdG_`L5E)7h3Jxq){+* zv+r4jW}wYmd~a#=S@1UBXBvGSyuJi%I+o4h4 z(5t?^8kL0J@Ez7@Sm-TZ!7H-&t=S_&dweHqG%oa>Z;D2fLi>F+8dZiq^j)dZjL@gP z4H{L4KJ#tYXnyDm-`g5BhYtD@uN6u^HXQ2W?AEAjsL=VVMm<7B zPQhzZ&h%sZhI%+BYg7{I<3h(fk7_h2G{kvFqsq{U&ObGp z5gO(c?RNXC#%G;MHJTqf&6%xHbEwq0Ors^CGG~KEFNDTAPieF}bh`7QMtedN9slcY z5BoxsoxU0!2vs=c8XXLs<;>UU(a<^0QjMMto$svHXpb|~xksVfiXRO{ohLMUIuvtW z(P)n|&-p;1U!vrE=deakhw7Z{H>700EZ*ZRbowiFZ*e%3aK>uXHMH27tx=EAh0YR< zMuaYQZq{gAsLi=wqe-F5oLw6A4PEYhu2D(oDkt?#+55f4!$Ma(eKe{JUF(d}Xh!II z=K_tYL#vz%HJTr~$+=OZ=Flz9y&5eE-Riuk(Z0|+=TnUigf=+NAKcy#hJNYv(CCHG zCTE03yF+(7=W4Vkw8dGZ(Kn%cohvo6)9-g~)+m(zptD(_hoH}got+wW4L$Dc*QiJ6 zw~lyA%JNY0h|mrvqS3g}PG^`#lS039DmCgGdckSXs3i1z=W30Hg%@4in6uj-q(j407oT$-~(1*?xjrN5;c4{;_5IW#osnNmE7tRKa zUI=~VY}aUa=xgU~jrN2NIfpd*CiJb7y2tI^PXC7!(I}K|_y;NUIP_`xPuHkx$nT${ zQIAln|5A-cgo6HCH5wPn^gpE0q)@hhw?=(Kx&A+CR1)gqPk%?s@;K}>;_t6fW$0M{ zSdC_cdiZB+R2}N=U!u|cP_h4JjhaKp`R~_gNobINmqzdH!=W>KmHjZ_=nF6!ovrXjrJ)zgeTo z&>a6xjb?=A`}b>99jf(<_XPgCQM_0@KUD9JXw)1^_=jntDx6-cQ`>e?CgR zyXaMk#GQj8;#NO>(=L5mjDhcSqi>Hc0i|z9Bf6gXo0x`~v&EB^d`TZ>{yFK?!VFM+ zBbFy^^(W3n$GFtQH;HvD<1H`y^0t4pTq$`jw=Zjr=CtH*U`dWfC!wS%rf~VGOsS+P zWICEbY1yV6o#e~*y*iO;DsQOr-=EW2w#A*=p;<8TeRp(QvlY}9_k;TI{bn6|?A)4^ zsx$Q;M{TBq;@jRhO&t1;GNQ+FTF%-Z3W(F4InpX*u1w1^-uaS!_3KKtI?L0Uh9e8v{!#A#7LMyJ9~(dtJ`IX*mE<&WEX9%QB`Nd2lK%tLwejtdWR0J5 zn}200*S?%Pd@-1wuT)M;i%mz`65Dzub$C4I(l=rm!fVyUhbQFnvp6>?p(W;nV+)d` zy|foGpJbDKL)^-B-vu?r2c6PVTCZJo=6G|Z)mek6eJ}qQ<_rZj#TZT}r8U}FrrfP$ zJCb_ak(|OjYNrQi`(8SGD!DFlJ>!+~e;+Dq9gTjU7XGVcqz~~@Zwua0OFtlKQzq#_ zQfaH-O{Gp`dFhwDEy%QY?><`EyR&$AAIbM>UdrROfA6@yJAE|$|9f-Vxv%e|?amh1 znL{m`_(sr^*={4@44ZaJB@R6HizKU$2JoI6W2A5XG%=6G$%o0jna zQ4`<(N_9K0FF9%{gUtP}a=Z~;=k_~uI+y=$jyKmkI&a!r=D#c5Inu++U}&-!)DYfu zQe&2&eaBY&PDj4ilY7(usr7$X8{{$Ec*Z+l9r=bxa=hvG^OY+t~|-|7JD0;S48`| zUY#GgJid{=L*&!Bh0Yvz?8!FUm-*i;vz$lihm&bns~tJ+NRxbbeyN3jRV&7RtcGne znRaV+@29S}-)<}6`NE@!%eshp9cdH&>1l3- z_xeiifZuOVyn{zA?QNS!1D$QMGe_={-~CqTXquFj3hc<(`|Q_mFGH>oNYT zoPSS;$r<_IH(z9LCPy{xcejpwgMX_*mZaYgI&!U!d~ZoNb|U?|wj`q|IU|(*eq}oL z;#zn|{{Kwx-)BYq-z@VSti62%mE;(L(vtq)D)UMwd6FDMP+HRV@^miqR;PB7979mr zJ-2!-YBbIlvSpboOSbRpf3BTm%dUkdIj+oJPeqcu*4vTa{^Te(z|KzwgtT(|%9?_uBdXE6&^ge`@_l8%Yg# z&uHzVChvKTY{pyCoBmI&|7gRj0dM+0w(%crcs1Zn|Hn4|qYbYHyy^dnZ6x=y_O&|l zy)l>}_VJnPvmq9KL-ri}n}^>_y-0j)T#SFE27O0SIny&i7dg|JMwt_5x{zrr)1^$W zVtO6ZpMh>MZU>FvS7{}^y5HM@5`%utVv}(TJ{GXaIF$c(`X=M-ymVue@qY1pNN?+R zkm)x}MaEX+oqnMV;%8@U67(yjXNm#+&&hbgIHmt>#f}qf5NEjf4R{rX7#@) zAPzxcwY4HYn0%e@DI>F z1FWot=J5jppeGMV2OTva8}#%61)voJ3bRVgKyeSy^9B%|Tv(jdYAzTsAnRoCPXRq| z0MW^XKV*Jc)`R#a=c%AHzYmJ~0p}pSWWX%WjU#;xbIw1G`0EBVWKBoirO4epU^(a( z&@6CPbNRJdXCl3sbGLHt)~xr8$%RjH?#?Wl-=U(!+&18Kw6<-)+h}dufcMeDwgDfZ z?zRC3P=4EhOESAdp1)@;g>EC5FQQvT&cL?=TSd=-w;42pc9>{dc#}~wun6f>2lht# z{o+YslI?uZEudGKR}5?ffBnFV!em!pq+Vx|g=`hu2VM%!u7N*B?jHuO1pRIHFTziV zKMs5l^v?qy50iC0AHLlryMm1k`XcpqvwF~9z)1``95yh^X7=soGNiY%oMhGgvP%W6 zivj5C1&78P5f5_in_};vTzt{z*MlNCZ;EdR^~$04Pe7W=ya!rmzQ<+WacAudLlQfC>`;oN62M;B#m6$1tr z<#w^2%J_YTVJsOiHaEp89Xu5jwgI|i!0g;sar)pNj(b|oSO#UpL;d`0{cqHuqU^lb@$+Xxg{w7N$$yzCn8Fb zPR%wB6hTp*qh&F>b%M9XNX%OdXqt*v%5`TqB{FNs0SDVB? z#Qej|7Z&k*S*yh$F3RiY651)>k=c_JM& zTYQ1suAJLbq#jch8tr_UyB_qIJS%;)GbL|5=rMUua(W-9t1?DA_vGyZ{Y#$6e9IW0 zX=PHnC+IPGqd}+SJ;|JXoVKz!7c?_}G^eYWUIyAfe?92@{3n^SkEs>r@}SG|M@yRh zmT@ruvh2~$;|1$MKP=b>IwjA_A=;DaXr@)5p)Qw!{v~f8Q!970)7m8^_bp>nK~JRD zb*Tb9CU0NvPwcf~S>!Hjt=P|WR^PXbpJum#Zp|+G0i{QRZq2U#A(dG+lIVs~qB}-$ zt8)g#SF^hAfMC~e~ zy{d_p#fa`;+G_!GYKT_XGM{O61ErTOB)XxI`3a^?%x@-Iwuq>`nCSM!q`keMTeJ5w z$8IHluM3H`UHFy}DOd-3a=~`ca|^^pZyC)6BSEh%D7%Qt%)00VKU%w(Yb_xvE};>% zUB;SRMx3(cME9>C+IAh4U&nMiQ~P@2ue+Z3+nMfV+Uo}5FJoG?vL`HmB-2?;+nBCn zx}9m!OzHn5YTrWqk+%?k7SlGS zz19$a8Phg=C<(QgZdgnF?VKKYE7xM$#&pN6l)K|LqHXIaciB2hujBM~rXz3XT1=~N z=aMpg2c>(hXU=-=k?D4(`>Z*T-X*$Y zFVX$)5w-Ub?X{n1*#|_cKP0;BBcdBVCc5JjqWeE3Y9Aol>ocNdpA)VAg6Og@iEj9c z=#D=TrT?ZgJ(uZuOwVUJgXsn0qx1vmfsDe8-Wh{3hGvY&D9boKV{%4C#swL%jGBx^ z8EqLq$yk|jbH*<+9>{n+lQK`s9F;jcvo^CSb6Mt^%sVsh z$=sRwa^~L5k2C+2S&~(rwJ7WAtUI!Pll4N@S6Sik!0@neX}BUhI~)%;hi?hr9o`mx zD*Q_L&G1LzV0Kn^x9q{$Kgb@QJt}*A_N45}?CIGTWLIa;&#upI%5KeGl6_hBRoTyF zznr~0`>pJ~*&k&8G5f3Rzh?hE+saAF>7P@YGcjjI&VroQoVJ`Ra<0u;lXFMT{W)Lf z9FyBW_tf0d+`8P$a(|k;D)-^s6Z3wUH$QK2-rBtNd3WYLoA*-Qt9ftc?a%u(@5{V1 z^Uuz|ApfrXE%^`U@5p~4|MmR$@*gZXvCC;)CU!Zy%d9R9U7qRke3#d{{Gp45JI7S~ zomQG~M3(T20_@dYaGp8_oUS4yA|hQJ3r>GGz3dJd+n>bD2`{eOKsBz*4;&gG6 zm?Tcd8E=BP0I8YcT%7gJ6LE3AsKu|-H{e(38%4Ef5;1WhaxMbrV$h}Ha&alXEo`~C z0{>rwUpK#2TrGZz)JpsX^eX%|_*!wZ*eGrhn-H7a1GE)i9)6#=TWrI;k4#?zIwAd1 z&?!u(F&&t37@YGm!uTlG?HN-+XJ-BybQRNEGIx5?yOF*(ljy*V^GqSOhKWAF^eLv# zG2O-Vb*6ime!%oIrr$Chm=Qx=x3vqAZp2+O5o^?#0>O$J{a{fK3q~`xU+2q{GSzDEPwNHqFZ4QF#Uk(XH36kx-y++d1u$>QEO+{Sq{-{paV0AA1Nd{xbPuxe12-Vv~WAp zzb?$gUz0Z;OWKh0bzTvrtC%ieTG0KyfDk>plT`h>e~9#{-Kor(Ol943yHoqKnRB%A zzwSY`p6ZdF;`S(8c&P`~{XQ)mt;gb?$+5_pm6CggQn`Xk#ksZ`t08^^YKjNpRZa0e{3>qJKuz&CaVqFx_+ChE{1CLKQ3~42 z7!BIn7z5hJ7zbL6(;fb5#yA7CzcCT?IAb#C0Nibv;&`J1bg(fEw8S_Ybcit>^aSHP z&=ZXrphJzBpg%C8pl29WpfimaB$>r@wlNo+DAOt-Z zy3V);^mgN?pm!M8fvz`h0Nr4$0)5c93G@TwXP_S%w}Ac?CstE@YupBU80UXe{M}d& z`VZshp#L;}2`bD@poV!DsA=8}YMJ+d+U8bJpLrjs-~2Ubck?%(z03zedz%kK8+|~b zZSzs2`!elsJ`PSlrpK92fIk4#6a&pCL8InVpuaMo0slVpS)}h}`mXsqaQ1?lxLGzrLH(vs0AJc5>_ekehuYl%SuYu-SuY=}WZ-N$BZ-I8P_JAH^y$jmSdJnY7+K1M< zgW~Untq+jy35rozA0geFX|eSQIDJ43{Ibm-k?za1zx5e7$1xpfeF6Rerh}}nz&{=o zR%9JSx&#zfWPOeF381DJX8jfPWa}HyQ>?#%o@)Iabh!0T(9O>nN^JRGEh@o zVf6#O1-}JviZ#|i(6#urcUUQY*B$nW-%y8r;`hp7pVmpB>#dVPH(IBHZn91Tz0>+3 z=v`JR=w@p)=-t*B&|g{OK<}~2LAO|EfNr%WfY|y>d zbkO&#^FZIXW`KTb%>@0U6$Sm=ssjDOih%~~xuD0`al^t5540>^v`q13dS+(7%p36he4g{S94j|1_r=`Zx$k$e+vrnLKK$QSjIBzXlHSsfILZI; zO({V_?Rm?Nz&ind(?XwOvfy!51&A2WMZ|cnm<693#lPA3SA~Bu#Ex_D zZ!Z3=6gMCeJcXKo7k-Z0KTkbpsAp6?SE=Vs>bXfh?^4el>iM*KKChmys;AG8?fca; zO+81Ol0Qa0XQ<~=^}Jj?uTsxz)bl#^Ji(InPgc(v>KRqfn0m(5vsOLdRL^W%*3VVX z=yJgiL@D)o%1 z=Unytk$PUDo=es9r|Nl~dfuR(Mv7`*J$>pKQqK(a%u>&8>e*dAd#Y!NdY+)3L-8DJ zFU%N%e}nKZjDI=!Hz%+#!^Xcnu`uIeJbxg%WAE*byU*^}ce}&dx?|_BgyYp#no4Vu#!t&J_NZ(J~_x~4{yPmLw&YZk>u*ViSQ8l&;LCNXIm6&tIIC9@JD znHJOP60xSqv**XEn#8DhU9_>)lUZ6Ulgs0)ioV4 zyP|nE#(%`D$&J;q#+X+Dqw8xMqK)xHyJ3!Nj76Jbjg|AF-obmglN&n@eL^ge=uqBe zbuL_5)da;a0{KdlbUO4ATiBcr##YZ$5tRsV^iYnc+)&@({1v9XQywVp*ji=E!pK*%pbb)*r{v3LaJ0lw5rod=b%|or%sa| zHJDUimjq;RI;SF5Ge>$$NUOOtaT=61!Ek3cHziw;L(~PNqtp;?Ql}?3>SS`fV_F&- zF>mmXqoN7#@=aza=UahUj@HC4BzsNP7w6R093=-0#;ZIfX-RruWn;6qow3oHgcnbW zPVyAi%F5DzUwwp7Fq0MO)js&#^W2(IzOJH;_rLK{L0!t_fbgzD|_YH)G@z z>g(o8Tv=ZO$A)!{-7h9Ig5|ibxU@RjKubY#VvQ~?i_M8P*I@1ai-NOCIyW}99_z!c zhXU*`<4vt@+b-_d=TZ1a>cVY`w`sQ>xoLN7h1NuMyb6v#seLqA5o?;(FgD)Oggsf$ zPseRvNWTnU2M30R>e-PciznBVDl#@+gROu|m&FoQjqwKB){_;=F~x8cV_K?WoFgh@ zElus6lB|we<6|}GPL$VG)ihVfP=y}Jrl!LC6O}r}Jl;mh-C3`EMTUX!c>0N1eVzjAho{;K~ zRqNu(rewV&?jUMKGq#LmZf9{xGv0hX<|K1!4B-^4v9!86?j2}-?QF!3@ab?~$;Xq?B! zUZcFznxd)K(WP2Qa5fwWiP}U}ePd00wy0=LASw~+v@oWwxmHZXiiKeFR^jm=iZ^KNZoE7<)-r^9jwZF z>2<|SB^+&%qP}6~sCW~vhq`JHn%qcWLj7Fmu?F#uAlVR7@RLFpPM}oj9NOo;<6JkW z^D%Ict26Ilsc~)?jn>5GG>OLe+<8r6j`w`Ghz=YxX9^0W!~`ldl?#>Av|~%A5tS!6 zbQIO~(l=G{o(UOg1kxLkBNo#V@YF|`^+DrebrjVmXTRM}2~gf?FYLsjQu=%;QwPP}<#)cTHgXf#e z?T{TPII0yN6w#=rY4RB&wh&}4r4akc?HfDcqWT5UTWO-Tt_m}Q#UnU98b{#SbaERN zn;WlF#m3ZCt5khM0%Ezxw}hy{f}7HumOsykrO>FLuEi82B%4^2H8s}mfZqX@m&N&p05=St zvB(esqpOKG$VHP-ej`y9pED=cI1_;mA0u5ngm5fc>tfFL;31e#_Y#5p4I1dc7$Vpi zB^zi5hwxY?)sKcmoTP)X+aNEScpdYn)nHa=+*4xMLtsIaE{nEG=6LKZGBq(?hogi{ zSHv)l)h@pVCh1{R#;X?4-3$euSVU^YN;Sj~0#mHRzD_E{n;})=$%jI``Eaj#2&$1J z$6K&dCaEw1hf#qYNDI*JCTLu&i4`c1*SZ^}!FJkXmAUF-RY^6uDst5`G44@~R15Z) z7|!^yxZHQO$`eOA#Gnvjz*x2SU?WNq!qJr%979#S7Ed*?Y$n+JC&cSw6Jm99;onKV_8jl_ zLj~n70|D#!kS?J<7D(tuhEi_XLVb07P8_z>ag&k^PsyY;jH!v$!kTf@&`!oN6DE{T zsVJ`ym~K)9qLs!NrlSc*I-J|aB&wo(N7K|;Uo(1M6t<6o?0n1NF=4!=32C++`R&aH zg<~y()}AU&Nq1y0L%Gq4vGKa0UBW@qv4zcH zbhNI%jy7AEG^WnIEAb@N9SH>-y4D;Vj1nTzJi9uM!Rfxr>*mx8TCjCZ;0cZ|bSCdR z<#06WZe?;EUCQXn@mNBdNL92M8*nn-A&KQkle~^tMNGUA&%w=>XsTz^awCXI65@u0 z*>pRi@?lQyL6AAh3aL{S@i4m_#@3kZpR(z4f%E8EffIb8z$siM@KfH_a#CKCcrPxP z-QhAro~{u#$y-R_xjOZx)y*i%l{QU?VFN@|BCk<(!dqlwJxY+FPM(8p*S#C`BzZj} z)PnJ!-$%MWF#kEE( zfr(KWsNvp&s>;lus;VGk4$%+<@a?E723kk)3mE8Kf-i(oN8Bd6m^m^C>-J7(*=|<6P~3iR!v); z%=9uy{}hh8707pbG3B?5cG&q-=<3#RTY&p?d(o9VJQ*c%=~)elY_44*9@J7YE*p#e{G-d6%n>@-n{WyT{S< zVpR)dN7#o{d7fIijgk$y2O_SJWUH%4fmuQ{z}J%MltJ&3)Op(73S{`#E^KOYrNSWv z8m*%^M+J#>Dm!p!QaRo+R8WA5+noyB#IuyDIX$ZWj7s z2kT)e=PD&r8xk!ySEOXx%|ysr-=sGz1UT;A#ToLhgjDEc+=yf zb=5VVE6K7kV@sz^sGK>WeA1Yi6UIy$S2!0t? z1rBB6lSBM zC`28LOB?6nf`|?fvNyiukOE2DKsV}I{fJ!NBPoaOBsGwpOkH>I$xca`><+;?-KV%3 zPIl9Y!>#J(-KOPJHH+IrH42<^sM(mZY~3tdQYS7q?Q-1^3R`y7JT8xW06C_3!tFNh z9gUn7?oj&Ljw(AMS8K@~soSx)w96yavfpBXs6>0@UG|i#^+Xk=(9+geZcnn>lU7>n zC{MB{)zIkD$}!_6Pc0u)!PcT)n2_t78pE5QI$Q?Dq{8s@N(Sh@U7;fSJmYEMy8O|y46NjoSXKRad}M$8DZ!Ny3|gn)2+JuqgmuEYF`7l4CiQWW6bmRMlDY-XKK5A zSAVfN>a#ugkb!zr!wMUR8KGBf)kG4>w=q>5e?gN1z7>BbheS1{rbZXz_|+s29nyu$ zG~OEF(i1@>sYI_YMwJ+Ftch+xF&mhv_PH1xFVgm0l*Z9sy^-%!2U{b3OaT|gM{Bur zt4D9qZ7sp?k=RmXl61}^kS~+;3YCy^Jvm;k4BF+}A`-L|mkUkgP;n;2M}P3Sp(fZ% zteWr6>5@a>eb>Auz6WT8?a6mV%KI{|KxuVWbtevrcV8;eH1bP#zOlgsVeKWW@nkA% z=6iCav0pUu9g%!dB(Kk9TD64mgu^9ROd=sD@}f%m#j3z6#j8wp*5y}n*hctJiJLU~ zhyoo-dH3ht#ZA%e0~k1Q5{E`im;bn+)1N|;yHR^a@=(ubd~UH5&yC6Gwg88fgy*wF zvdtu~Bj(A(i0OQ-f-z32dknsva4#~{4F&Vuw5!(SZ2?7tbQgi^g__ngV(fvEuf;qW z{IcHtu!^q1pS-BRzLKmndO`&S$u;q)_hq5m5-MOp%sgNp63Oo+bKLc-clSPgMq8TZ;`A9mETDwCpB_}jFEnGGcX8^7L=FK<+Jh$I9oHlr98q6i&bQ$2L#o(6jc#tF zyGwyL`U0L(z zO$##Vq}|Qhbw(~Gx#gi*>5Jdk%MjdsZ(A=vsfy1F%&W(%x~O_>hBr{SQiB$8ns6_5 zro>_kaJI(hV)5aEnoVjod;A(4~Ps}@&g8VK+TKjb3K*y>PUh&&$2!^>NHYWuWDA- z%N8U9Eiwa7a(HuabBWO-K$|B@XD3J{-g{U;xF;ANzry49)#~!q^GSKr2HO2#^XipHt$Q-WGNU(> z7&h6td|RQn+wz3GT9Esny#JSPMAc%XnINx#h(ubJnq>I`l3GQMdJE>xzwE8u)qQKb zcMN0{^F#&wYm?w(qVg#umW<&@RzkD|DNbd*6!mm`f`c0VT-{!is1#J-eE8VY*iDYt?fP{B=H$AIJ~Zk z)l^TOGY2txa`>dbiU!C>Ho-4L**N&UF{QAA_`NZu-4~;h?|C^&4Ecg|BD+M_r%HsV zkNhNm=(J4j@9-edr}`vB6k8%jOB0K?Vx)O>p-gNQ_UZR)REnBXGsZRP)S(OLPY_W_ zC4nCAG;#nM;U$jxjI9jBanO^2FKxs4$Vpuj-J#ZqG1YPGXrt&8$K)|}t&SO31aO#9 z`jc<6(jpk7ELn$iIa;GWF>5@A*{By2BIIpHWDEzd z7T;6QgcuE@>Q1dw`*Cn6CxLV`+KG#Wc%pum)C^{awUQ9xIO0&P7)uyu%@rX{8g$E% z2IoSrF>WWWoFbF~FN1VdjWRHJ(p|qvs3k|@ z)l?L1(AY@7G5qav5&pzIS+W7O@p_$GA$_#h@)7FxKJv&r$Z{0@v@b<-*9!fRTv&&o zB%{(=)^NzxZhU?!4e9fXcqE-_Sje+5pJ$B5Jk{aQ5FeWGwsKr&-cjqHS&EucH%-urY*~((v_UPqwq1){(!Z-$x$a~sS__L%9#(kC z*{DGyqIoQW=IeP*=K#ymy6r^KFKL$Mh2*P48`M6fNcYlaf;=in}G(Yt*~@1~S= z0is*`QsmTd|D)Umqv<>y&LJ294|RAinwVV6(NVV zYJ_cFkDMbVKggb#<H>Q`M|(x#iA5?RuVF*HRjQDNR0zY-lbqPsNoA(@r7!jgPBH|&SnZ*1HX#hHl_bJ1ylI&E6T5iR0q7D{;fV_7p&t%fGNw3_#v>2E44@ny* zi=x@5b>{9OQfr;tAlrjC?MXqI4EQMsXy1$S5p(~&F;;R9_=FdpB-LEjIq9l%G{Cz` z7m`_qS`?Jgp-BdWqFAmo@+9qZWI#*4itJw?kS7b4I6()lf9rTxgkvIUr?c$hgh}X2 z26UYzp&Yr&lTtvc-n4>?AQg>oE?O=UeU+~ppsX6-f)bj595;XyX`|5(*&kL(#zdBe z_CcyG3dvT;|1@%7*0PfC$KhH1YV+K*P=j(mSo^aH%Omu3`48mU2pDjh^&~b zl@4vR8bmRTw+2Z1D>}T;9!fJsEz(|x4~}3qspUDSA$_N-{n{gzC*S0@N*@16HT76( zE742G9gZRbceQlhsXFg^a+Q*|C4VRFn(T_!4ISR}o`~LP?Z{o4JheR1Qytn5Yq*ZI zp6}j!rAH<^c6FMJYN=ncJ@G^G#qIaiBeyD72FXqlko4M!jk9D6FQ5c0Xq3+A6<0_-*BdM+7sYlhW+CZ%bkQPG*~TSy}=l#@QuTlBnb;~B6H|D4wt*c z!#N~GElEFef#*`ijr>R>ba^5#RYpN~wAQ3YRhKGhZhe$WaXpeqBdH`3g~Op+xx0`b zpjmNGfsi?^Sd}Xl#__GN2l{`Yn27%eqIa69@%aA~)Tsrf*&PI()Bi^POm+D@T1*oY zVCB;=BV%xuorzUa3Ooj1fIAsHx>T;9-|xzviLb+*3_JhA0! zi=tNY1a!6}3lX^$pz>0gq6irQh*Edtop(aI7^I6exhuGFW5+X|=vE48N+D|{Mm~n+ zqtR8Wafq(&Sf{ZMXgA&y=)BVTW}tIiM{}lT<@3o;jWt@%oUrWWZS&rlSF~6JeskgZ zXLUJo?^Sk@2nS6kVmj%j6R@1{EL_VPc9CI3d_|@a0W}O}rV}&WA=vgj(k5k@;q(22 z@%@3B#|p60BLQKCgY>^640^y+!%K&uQg~@~z+Yt2BVhFv>At>{f&PNva#734ir51G z*#;34#D}kf4EN)1`q@r+=?0RvFSXV;+$9bDhWqA*2O7r;H(i3X%pU5pP6i7jF(VPm z7!dAfqvyWp__P3ZymUjjA4W_v(del&17*iJN>C|dj zpvY%LOw%MSg~zKZ<2_Z7mQ|qH0(2W8m6V3ZkSZhLQV39ufAf%Iq6sMa5X%!J)su*3 zz{w4lOTM67^xAgFFPTA-A&B}DN$duatAPjIpd@MVNP@JhtcI{u7FeXLlp>pEI1&j2 ziY!W{r>99)_{{K`0XID@JS`B!cu^os>3}252%aQF0}0SVsTPPcoyPzQSvRu88<`Vu zFahb|pp99MqzDUBlo?*yLa9*5O$CFLN(C=#M%D}@14yQ&sYGh3N~ENyL?D2K4~nAs zM)QSGv1J7Cq|rnoR18w5rw2@va!7IrkPg!W69$)F81M_TFn|nvJ1xouQecsp>6u9R zg&m-pmQ!f)a9$;&Pbc#NrMY+&-k@0Y* zBOzM2iL5O=f$0>cl}yipsvy8>)pXlxhHG57hT%FFu4A~tg&SzN!^8dPF_M>2co-XB z+eTguZOi22O8K~2K32%b8}jjXdJ2{UQ~{;1f0)H|JktqGr!cJ~9o7&zk@0Y*G&lo` zr?23S;eD{er8f#ds-?rQR5&p!ytIJbLohcShs9$uYVmI&JG^wH3VCX#!;7(Rg5!dr z1j)oLGZ^GYD3odoBS6NR8UhKD6@^kw2hKFbbV8g?G-3XeXIx%m3^#`4nPC)tQt^<=wv8&GL)J;SvN^3OgxFnvae&A){z%& zA+mzG@ZQ)d*bZ07((2J-!%Ulbp|plu`3aB0&wk;4{DkM>HaD<_R@l%}GszIwGEfTZ z9!>-l3q62Uo1Tt!k4d8hae1k_G(gjx9-_V{QhO7z?BV*u)8S$GnVyO!h=E4n7?57i7VxKQuy>Blse6>Meo{)o&LhReN31 zRaad&5880^D9L$9aNdu?KXUUZ$$3cdv~_3NO7mb5!Qc%8d$eI>&7c{{YFi3zV<%eL z;_#C#KN1dLVcKAm8>Ir_^TTp;z%xA+S;RnI%3#AZ5DJ6?se=tmrqbcb;6I7UwedB> zc#`hTbl!n4-4aGOM)=a|@H8F)oFz)|$SKJqKteK*!?O@2Uv0p>^6VByY#>A^0x3-B zbWA8xnAPd<)e$ViOLJ(Ls9Z$50QwhT@tBc=wZ|a5^h=BnX8a}G8b8x9T)=eq2}v1; z*o?m`g|G!;a|*C2 z!o2{brl!iQ5IusyppTrvFh@Wt>;MF2`5B;xOt}L94wG(Rm@hyDxY&566PQk6T4|$t z4UrQW4`(_OibSA56gvYbb_P)F44~KXmFjzB{j&jXymbPCf-8~hp~Co&$+ zbR;p#NDwkBHhZGsX{^Gw)im<915^}gq6cUyvD6*RT2|Y2WMi;*zks#CaA|GQQ!RN| zJ6j{3a&=Pz=AWs}KQn3mnO^fpdu;w_-b^Q(H4!mGNUQ;vMsGOFwpG|J&^(x{!)-rv z6W2ic!Vs;;!Vv6+p0JyM6~K2%!=5(s5KB?jNP&+*5w%e82nsvgJsdzM0EnbqK&q8| zSz@}k1Or)ul4%$amM}L#!<6X&b|X&7Ryh~rL90lT@+ra2k+XOuBZaA@A+vHJ68mdb z2Kz#ioLC`dg@RC7ZdTh`V3OW+K?)j?e4dJF$YsYsGmPe^u{)hk?v(loBgNU%BM=&s zO2uiqBI!O1!r<*9K$A$@1rj6y^ow~{i>MS{2~Da1`nQ(Pp7o0di% zjUrd@Nls3Z9w>oul4pv#q#2`$lS87hVp5VYjf$u|>L|hk022wq!Jz6G3F;V83OBB} zXq>nRTEM07N{Pcso)++=k&_~&*-vAQA*Lr6K+S?i+SZ9)IGwc#eEYW$4xQ3~r&g4f z2&`-a|G#v4+T%mdsJ$k5@<)%1+>`d+{2>pmT{Pkv`|qo+dvIW5d{4@6pT6Lkvxe`x zVe>D$WIuNMX}j+T&8>TV&og}vjXnI~Jn^tqZbfhIdgs)Pnax*?ed)N<|MJkqB_Z?W z>wo^znUB>@{doBaUz_93m^`-d^0cb%Yf{#qbV|?HOV0Y-+WpLZSO4Jm-MekJaVkZq zjNK(*`^|KdzRVu>it(qX)9iv`fHplMR3N~<0KaEprH9-0(CGchG%;U(3#%r8D9~@x zgYYc)V$|%%c6d6pq4Y{Rfy!+}>J%^pX>-e(LCG{CsYFtU1c;av9)X}V9IhQQO+@I# z4-%guf2=aU9b~=_ELzb3SlMub^gvWa9c0ZwKcTD{seWJ9j1aX#gE7;fj5Pe`_k$$a zbgoEEP4W9ule`oZO-V^XQP3ot&Kx+O`h5Y-3m`Hv0$DTALE!&s@BCilsG>MNGx;@{ zBx|$&Dw>rWQAi=KNl3v$swrtpElr!&kT#%{rCr;QrHM(~C@5r#ffo8u-y$gVL7@*V z2>K#a@X<#feDFcVz9|&!KT!4aJ$EAW=X` zaHa`eNhi|`^yBK!UNBnx4%9p7jn#)te`BP?g)KJKL1YkCu1XK%7KRe1t7tCj7CF5Z ztLLEB;97c`k=PF2!iD8bknUh?B8=Z{!`TfbAR zH)R?SFwf=E7O`WKg!M~MxCr-0)S7>@6V4o6xf}UL!5qXMC}eV_@Q{T^ES$1%T6`)B zM(uda!f_>BRB%MWlmeqXrEKON3P0%&gFd`m-KI<304CA)+yEId^T*~+?q+VK7@K}| zfDB`B)56chd`yAWY6@!gL(95q;dKjdSooubKcRj482sri)Dt=+%pYe093@F_s=F9{ z-0uOH^et{`*=k9dXqnka11x<9v`iM)fM5#Beupz6R^aw|bY!Y?)67jDf z9qbm-3_6l_;fM(@Q?K*`HHNLHm;ghcQ_+4T-@2k02X|DFytNW`g{vy*>TKUq* z_;D1Or?6x#dad{kC9YSCt&>_^$WjIdRic~HBPOBs1Xu5|ks`bqrN>do z`Qsg~B`&maIU^}S#TVKNZTa*gHdYG|>y&Q!Q?XSrx`h*=WO~hG`YC$4l`C}^Oh-LD zNn>H9_Rtqww)du=$GURs1Lc9Hl%WJ`(zxEy_(<=tF+M=!PVSMVf^HN*T)l+-p6}=~ zok2ovOoDq(*Ij8T?x{uS9U*+>EJC5%W~#LW`|;+DV$|EEg_WHsXDQ244rX2le=BK7fl&NHqoSp%XGVP}6Z=%rSEaI1AWD z$G0yI45JXnW~hRBKyONaBQxTzgN<+Mq|V?zqq$cSpU_ zqM8SAZ`MyH26)?$X^>@iMs7(C7gp!J3miTU#7c8=bq@N%;Au}-^lk_fo6qqITo^oC z&BVp13BfaA@Z^@#HD|0k9frq=c{NlY-4!&HF@GsJKm?ERM#L&R*%@J-OYtC&;M+BNIb#u2Hl&v$atlPb;)sIbH*O}>PmOwug)DdkxK88rsS<0|W zrJBUn*zzrPNjARS2AQT*@YafsFOq^*MBe-J>38jZvCsyWzyK~5U*6cf3-2;Moh&)j z9v13dBgNf(hlhrT@hzbN{YQDw&P6x3>`D&d@E*%<;caK>#Rc4cgVnDYIA3l!ExUn< zU2bG(Xyhe=Jx-2)mASH;lG|CaCuvSM>JH;4zU)pG-O=*O{M^#~pqrdKbG}rrxQU{h zURfA)`zqyk%X4mD(akI@A&$!nmz(h$QoSQ?>O3yXi*5pmJ_i|s<4(w@dfA~|x{z_n=Q&|B9X)k&skF#be>eQ-%s+ow$lkqg_!{*uiaU!o z1mD-uZD#V^pQZhk$|M8NKT^6}ws+Tv;;$D2H@-=l#WDmk1nLk7gB=|0Lr9>jb=MprUCG$U2=Ua(R!kdj#=kFjQ7Ga&Ok zzG!8k2@h}1Dl(kg=edN|Dc#DydgSNkub+ zK&1zRoJF|NS{a_ob4x}Nb;hL7IexDM-F37x(DLXWC}qT^&j@^XSAWB_XqYco7y97| z$_WW?-X>GaN?prjz*TFP%;-oix3;Z_{7KdkTyX%^_NWYWXLfEPj4<)zv4Ga`NP%L%P8q2 zZFig}55>TsN~R|B;O#I1kpZ~sl@XuXAi8O&7A$`ssWR}80hz-{M7cBM$w*fi%E10I zsoQJc(8l?Wz-NkjC7J49)hx7yp68~T)uI!YCPZ}}GKKPnSKf<^>nT*vZ|Ms!)iO(z zftSvd$t9mnnUjg6xXHjvCPO?qsgBwkP7AF@8J#luIYt?^RHH(@UmF)X@)EvXIT{RD z$bf|KJd5nfq`dh!34$?``K`47l>A4@{kWB_nU%@B&HK=8x4Z$E1sMVv0vQ4s0vQ4s z0vQ4s0vQ7T2Lyf%nLP)=1H41BPliB-K!!kuK!!kuK!!kuK!!kuK!!kuK!!kuz<(2g FzX1!`>QMjy literal 0 HcmV?d00001 diff --git a/src/AdWords/AdWords.csproj b/src/AdWords/AdWords.csproj new file mode 100644 index 00000000000..cefdaff0e6a --- /dev/null +++ b/src/AdWords/AdWords.csproj @@ -0,0 +1,112 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745} + Library + Properties + Google.Api.Ads.AdWords + Google.AdWords + v4.0 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AnyCPU + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + True + True + AdWordsErrorMessages.resx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer + + + + + ResXFileCodeGenerator + AdWordsErrorMessages.Designer.cs + Designer + + + + + {277404DB-A439-4450-B3A5-186294CDF245} + Common + + + + + \ No newline at end of file diff --git a/src/AdWords/AdWordsErrorMessages.Designer.cs b/src/AdWords/AdWordsErrorMessages.Designer.cs new file mode 100644 index 00000000000..525cb967f29 --- /dev/null +++ b/src/AdWords/AdWordsErrorMessages.Designer.cs @@ -0,0 +1,180 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18444 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Google.Api.Ads.AdWords { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class AdWordsErrorMessages { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AdWordsErrorMessages() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Google.Api.Ads.AdWords.AdWordsErrorMessages", typeof(AdWordsErrorMessages).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to An API exception has occurred. See ApiException and InnerException fields for more details.. + /// + internal static string AnApiExceptionOccurred { + get { + return ResourceManager.GetString("AnApiExceptionOccurred", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AdWords API can find out effective user from the authorization headers, but setting a client customer ID explicitly is recommended. If the credentials in your configuration corresponds to an MCC account, you may not see any data.. + /// + internal static string ClientCustomerIdIsEmpty { + get { + return ResourceManager.GetString("ClientCustomerIdIsEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ClientLogin is not supported in version {0}. Please upgrade to OAuth2.. + /// + internal static string ClientLoginNotSupported { + get { + return ResourceManager.GetString("ClientLoginNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AdWords API requires a developer token. If you don't have one, you can refer to the instructions at https://developers.google.com/adwords/api/docs/signingup to get one.. + /// + internal static string DeveloperTokenCannotBeEmpty { + get { + return ResourceManager.GetString("DeveloperTokenCannotBeEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not set AuthToken for outgoing API call. Please check if service.RequestHeader is not null.. + /// + internal static string FailedToSetAuthorizationHeader { + get { + return ResourceManager.GetString("FailedToSetAuthorizationHeader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid stage for Soap message.. + /// + internal static string InvalidStageForSoapMessage { + get { + return ResourceManager.GetString("InvalidStageForSoapMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OAuth provider cannot be null when selecting Authorization method as "OAuth".. + /// + internal static string OAuthProviderCannotBeNull { + get { + return ResourceManager.GetString("OAuthProviderCannotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Report generation failed.. + /// + internal static string ReportGenerationFailed { + get { + return ResourceManager.GetString("ReportGenerationFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Report contents are invalid.. + /// + internal static string ReportIsInvalid { + get { + return ResourceManager.GetString("ReportIsInvalid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Report could not be downloaded after {0} polling attempts. Try requesting a report with lesser amount of data, increase the number of polling attempts, or use the asynchronous download methods.. + /// + internal static string ReportNumPollsExceeded { + get { + return ResourceManager.GetString("ReportNumPollsExceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to returnMoneyInMicros header is not supported in AdWords API v201406 and later. Use the overloaded method that doesn't specify this parameter.. + /// + internal static string ReturnMoneyInMicrosNotSupported { + get { + return ResourceManager.GetString("ReturnMoneyInMicrosNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Signature should be a {0} instance.. + /// + internal static string SignatureIsOfWrongType { + get { + return ResourceManager.GetString("SignatureIsOfWrongType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unknown error occurred while converting v13 SoapException. See innerException for the original SoapException.. + /// + internal static string Unknownv13SoapExceptionOccurred { + get { + return ResourceManager.GetString("Unknownv13SoapExceptionOccurred", resourceCulture); + } + } + } +} diff --git a/src/AdWords/AdWordsErrorMessages.resx b/src/AdWords/AdWordsErrorMessages.resx new file mode 100644 index 00000000000..544af74eb98 --- /dev/null +++ b/src/AdWords/AdWordsErrorMessages.resx @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Invalid stage for Soap message. + Used for ArgumentException by TraceExtension.ProcessMessage if message parameter has an invalid value for Stage field. + + + Report generation failed. + Used by ReportUtilitiesGetReportXml when a report generation fails. + + + Report contents are invalid. + Used for ReportsException by ReportUtilities.DownloadReportToFile when a report is downloaded successfully, but its contents are invalid. Applies specifically to v201003 ReportDefinitionService. + + + Signature should be a {0} instance. + Used for ArgumentException by AdWordsServiceFactory.CreateService and LegacyAdWordsServiceFactory if the signature is not of desired type. + + + Unknown error occurred while converting v13 SoapException. See innerException for the original SoapException. + Used for LegacyAdWordsApiException by LegacyAdWordsApiService.GetCustomException when it gets an error code which cannot be mapped to an existing list of error codes and corresponding exception classes. + + + An API exception has occurred. See ApiException and InnerException fields for more details. + Used by AdWordsSoapClient while throwing AdWordsApiException. + + + Report could not be downloaded after {0} polling attempts. Try requesting a report with lesser amount of data, increase the number of polling attempts, or use the asynchronous download methods. + Used by ReportUtilites when number of polling attempts exceeds MaxPollingAttempts. + + + Could not set AuthToken for outgoing API call. Please check if service.RequestHeader is not null. + Used by AdWordsSoapClient.MakeApiCall when setting authorization headers. + + + OAuth provider cannot be null when selecting Authorization method as "OAuth". + Used by AdWordsSoapClient.MakeApiCall when setting authorization headers. + + + AdWords API requires a developer token. If you don't have one, you can refer to the instructions at https://developers.google.com/adwords/api/docs/signingup to get one. + Error message thrown when developer token is not set by user. + + + AdWords API can find out effective user from the authorization headers, but setting a client customer ID explicitly is recommended. If the credentials in your configuration corresponds to an MCC account, you may not see any data. + Warning message printed when clientCustomerID header is empty. + + + ClientLogin is not supported in version {0}. Please upgrade to OAuth2. + Used when attempting to use ClientLogin in an unsupported version + + + returnMoneyInMicros header is not supported in AdWords API v201406 and later. Use the overloaded method that doesn't specify this parameter. + returnMoneyInMicros header is not supported in AdWords API v201406 and later. Use the overloaded method that doesn't specify this parameter. + + \ No newline at end of file diff --git a/src/AdWords/App.config b/src/AdWords/App.config new file mode 100644 index 00000000000..1ee298baf62 --- /dev/null +++ b/src/AdWords/App.config @@ -0,0 +1,192 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/AdWords/Headers/AdWordsSoapHeader.cs b/src/AdWords/Headers/AdWordsSoapHeader.cs new file mode 100644 index 00000000000..44449cd8039 --- /dev/null +++ b/src/AdWords/Headers/AdWordsSoapHeader.cs @@ -0,0 +1,50 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; + +namespace Google.Api.Ads.AdWords.Headers { + /// + /// Base class for AdWords API SOAP headers. + /// + public abstract class AdWordsSoapHeader : SoapHeaderBase { + /// + /// Gets or sets the API version. + /// + public string Version { + get { + return placeHolders["{version}"].TrimStart('/'); + } + set { + placeHolders["{version}"] = "/" + value; + } + } + + /// + /// Gets or sets the service namespace (e.g. cm, o, info, etc.). + /// + public string GroupName { + get { + return placeHolders["{gp}"].TrimStart('/'); + } + set { + placeHolders["{gp}"] = "/" + value; + } + } + } +} diff --git a/src/AdWords/Headers/RequestHeader.cs b/src/AdWords/Headers/RequestHeader.cs new file mode 100644 index 00000000000..7f45a6f9ea7 --- /dev/null +++ b/src/AdWords/Headers/RequestHeader.cs @@ -0,0 +1,183 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; + +namespace Google.Api.Ads.AdWords.Headers { + /// + /// This class wraps the , adding + /// cross-namespace serialization capabilities. + /// + /// The XmlSerializer provides two mutually exclusive ways of + /// serialization. + /// - Mark a class as Serializable, and allow the class to be serialized + /// automagically. This option does object serialization correctly, but isn't + /// cross-namespace aware. + /// - Implement IXmlSerializable, and customize the serialization. This + /// option allows us to customize the serialization process and add cross + /// namespace support. + /// + /// However since options 1 and 2 are mutually exclusive (i.e. cannot be + /// applied to the same object hierarchy), we cannot derive this class from + /// , instead, we have to wrap it in another + /// class. + /// + public class RequestHeader : AdWordsSoapHeader { + /// + /// The request header stub that this class wraps. + /// + RequestHeaderStub stub = new RequestHeaderStub(); + + /// + /// Gets or sets the stub that is wrapped by this object. + /// + public override object Stub { + get { + return stub; + } + protected set { + stub = value as RequestHeaderStub; + } + } + + /// + /// Gets or sets the auth token. + /// + public string authToken { + get { + return stub.authToken; + } + set { + stub.authToken = value; + } + } + + /// + /// Gets or sets the client customer id. + /// + public string clientCustomerId { + get { + return stub.clientCustomerId; + } + set { + stub.clientCustomerId = value; + } + } + + /// + /// Gets or sets the developer token. + /// + public string developerToken { + get { + return stub.developerToken; + } + set { + stub.developerToken = value; + } + } + + /// + /// Gets or sets the user agent. + /// + public string userAgent { + get { + return stub.userAgent; + } + set { + stub.userAgent = value; + } + } + + /// + /// Gets or sets whether this API call is for validation only. + /// + public bool validateOnly { + get { + return stub.validateOnly; + } + set { + stub.validateOnlySpecified = true; + stub.validateOnly = value; + } + } + + /// + /// Gets or sets whether is specified. + /// + public bool validateOnlySpecified { + get { + return stub.validateOnlySpecified; + } + set { + stub.validateOnlySpecified = value; + } + } + + /// + /// Gets or sets whether partial failures should be returned. + /// + public bool partialFailure { + get { + return stub.partialFailure; + } + set { + stub.partialFailureSpecified = true; + stub.partialFailure = value; + } + } + + /// + /// Gets or sets whether is specified. + /// + public bool partialFailureSpecified { + get { + return stub.partialFailureSpecified; + } + set { + stub.partialFailureSpecified = value; + } + } + + /// + /// Gets or sets the AdWords Express business ID. This header applies only + /// for AdWords Express API services. + /// + public long expressBusinessId { + get { + return stub.expressBusinessId; + } + set { + stub.expressBusinessIdSpecified = true; + stub.expressBusinessId = value; + } + } + + /// + /// Gets or sets whether is specified. This + /// field applies only for AdWords Express API services. + /// + public bool expressBusinessIdSpecified { + get { + return stub.expressBusinessIdSpecified; + } + set { + stub.expressBusinessIdSpecified = value; + } + } + } +} diff --git a/src/AdWords/Headers/RequestHeaderStub.cs b/src/AdWords/Headers/RequestHeaderStub.cs new file mode 100644 index 00000000000..a2c8a1fae36 --- /dev/null +++ b/src/AdWords/Headers/RequestHeaderStub.cs @@ -0,0 +1,104 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Xml.Serialization; + +namespace Google.Api.Ads.AdWords.Headers { + /// + /// A SOAP stub class that represents the request headers for an AdWords + /// API call. + /// + [SerializableAttribute()] + [XmlRootAttribute(ElementName = "RequestHeader", Namespace = + "https://adwords.google.com/api/adwords{gp}{version}")] + public class RequestHeaderStub { + /// + /// Auth token to authenticate the API call. + /// + [XmlElementAttribute(Namespace = "https://adwords.google.com/api/adwords/cm{version}")] + public string authToken; + + /// + /// Application token. + /// + [XmlElementAttribute(Namespace = "https://adwords.google.com/api/adwords/cm{version}")] + [Obsolete("AdWords API no longer requires application tokens.")] + public string applicationToken; + + /// + /// Developer token. + /// + [XmlElementAttribute(Namespace = "https://adwords.google.com/api/adwords/cm{version}")] + public string developerToken; + + /// + /// Client customer id for which API calls are made. + /// + [XmlElementAttribute(Namespace = "https://adwords.google.com/api/adwords/cm{version}")] + public string clientCustomerId; + + /// + /// Client email for which API calls are made. + /// + [XmlElementAttribute(Namespace = "https://adwords.google.com/api/adwords/cm{version}")] + public string clientEmail; + + /// + /// User agent to identify the requesting application. + /// + [XmlElementAttribute(Namespace = "https://adwords.google.com/api/adwords/cm{version}")] + public string userAgent; + + /// + /// Specifies whether this request is for validation only. + /// + [XmlElementAttribute(Namespace = "https://adwords.google.com/api/adwords/cm{version}")] + public bool validateOnly; + + /// + /// Specifies whether is provided. + /// + [XmlIgnoreAttribute] + public bool validateOnlySpecified; + + /// + /// Specifies whether partial failures should be returned. + /// + [XmlElementAttribute(Namespace = "https://adwords.google.com/api/adwords/cm{version}")] + public bool partialFailure; + + /// + /// Specifies whether is provided. + /// + [XmlIgnoreAttribute] + public bool partialFailureSpecified; + + /// + /// Specifies the AdWords Express business ID. This field applies only + /// for AdWords Express API services. + /// + [XmlElementAttribute(Namespace = "https://adwords.google.com/api/adwords/express{version}")] + public long expressBusinessId; + + /// + /// Specifies whether is provided. This + /// field applies only for AdWords Express API services. + /// + [XmlIgnoreAttribute] + public bool expressBusinessIdSpecified; + } +} diff --git a/src/AdWords/Headers/ResponseHeader.cs b/src/AdWords/Headers/ResponseHeader.cs new file mode 100644 index 00000000000..7c8aeb001c3 --- /dev/null +++ b/src/AdWords/Headers/ResponseHeader.cs @@ -0,0 +1,133 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Common.Util; + +using System; +using System.Reflection; +using System.Xml; + +namespace Google.Api.Ads.AdWords.Headers { + /// + /// This class wraps the , adding + /// cross-namespace serialization capabilities. + /// + /// The XmlSerializer provides two mutually exclusive ways of + /// serialization. + /// - Mark a class as Serializable, and allow the class to be serialized + /// automagically. This option does object serialization correctly, but isn't + /// cross-namespace aware. + /// - Implement IXmlSerializable, and customize the serialization. This + /// option allows us to customize the serialization process and add cross + /// namespace support. + /// + /// However since options 1 and 2 are mutually exclusive (i.e. cannot be + /// applied to the same object hierarchy), we cannot derive this class from + /// , instead, we have to wrap it in another + /// class. + /// + public class ResponseHeader : AdWordsSoapHeader { + /// + /// The SOAP stub object that this class wraps. + /// + ResponseHeaderStub stub = new ResponseHeaderStub(); + + /// + /// Gets or sets the stub that is wrapped by this object. + /// + public override object Stub { + get { + return stub; + } + protected set { + stub = value as ResponseHeaderStub; + } + } + + /// + /// Gets or sets the request id for this API call. + /// + public string requestId { + get { + return stub.requestId; + } + set { + stub.requestId = value; + } + } + + /// + /// Gets or sets the number of operations for this API call. + /// + public long operations { + get { + return stub.operations; + } + set { + stub.operationsSpecified = true; + stub.operations = value; + } + } + + /// + /// Gets or sets the response time for this API call. + /// + public long responseTime { + get { + return stub.responseTime; + } + set { + stub.responseTimeSpecified = true; + stub.responseTime = value; + } + } + + /// + /// Gets or sets the number of units consumed for this API call. + /// + public long units { + get { + return stub.units; + } + set { + stub.unitsSpecified = true; + stub.units = value; + } + } + + /// + /// Deserialize the object from xml. + /// + /// The xml reader for reading the serialized xml. + /// + public override void ReadXml(XmlReader reader) { + object service = ContextStore.GetValue("SoapService"); + if (service != null) { + PropertyInfo propInfo = service.GetType().GetProperty("RequestHeader"); + if (propInfo != null) { + RequestHeader reqHeader = (RequestHeader) propInfo.GetValue(service, null); + if (reqHeader != null) { + // When deserializing, namespace is not relevant, just the version + // is. + this.Version = reqHeader.Version; + } + } + } + base.ReadXml(reader); + } + } +} diff --git a/src/AdWords/Headers/ResponseHeaderStub.cs b/src/AdWords/Headers/ResponseHeaderStub.cs new file mode 100644 index 00000000000..d01360a88c5 --- /dev/null +++ b/src/AdWords/Headers/ResponseHeaderStub.cs @@ -0,0 +1,71 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Xml.Serialization; + +namespace Google.Api.Ads.AdWords.Headers { + /// + /// A SOAP stub class that represents the response headers for an AdWords + /// API call. + /// + [XmlRootAttribute(ElementName = "ResponseHeader", Namespace = + "https://adwords.google.com/api/adwords{gp}{version}")] + [SerializableAttribute()] + public class ResponseHeaderStub { + /// + /// Request ID for this API call. + /// + [XmlElementAttribute(Namespace = "https://adwords.google.com/api/adwords/cm{version}")] + public string requestId; + + /// + /// Number of operations for this API call. + /// + [XmlElementAttribute(Namespace = "https://adwords.google.com/api/adwords/cm{version}")] + public long operations; + + /// + /// Specifies whether is provided. + /// + [XmlIgnoreAttribute] + public bool operationsSpecified; + + /// + /// Response time for this API call. + /// + [XmlElementAttribute(Namespace = "https://adwords.google.com/api/adwords/cm{version}")] + public long responseTime; + + /// + /// Specifies whether is provided. + /// + [XmlIgnoreAttribute] + public bool responseTimeSpecified; + + /// + /// Units consumed for this API call. + /// + [XmlElementAttribute(Namespace = "https://adwords.google.com/api/adwords/cm{version}")] + public long units; + + /// + /// Specifies whether is provided. + /// + [XmlIgnoreAttribute] + public bool unitsSpecified; + } +} diff --git a/src/AdWords/Lib/AdWordsApiException.cs b/src/AdWords/Lib/AdWordsApiException.cs new file mode 100644 index 00000000000..61ce275f5eb --- /dev/null +++ b/src/AdWords/Lib/AdWordsApiException.cs @@ -0,0 +1,120 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Common.Util; + +using System; +using System.IO; +using System.Runtime.Serialization; +using System.Security.Permissions; +using System.Text; +using System.Xml.Serialization; + +namespace Google.Api.Ads.AdWords.Lib { + /// + /// Custom exception class for wrapping AdWords API SOAP exceptions. + /// + [Serializable] + public class AdWordsApiException : AdWordsException { + /// + /// The original ApiException object from AdWords API. + /// + private object apiException; + + /// + /// Gets the ApiException object. + /// + public object ApiException { + get { + return apiException; + } + } + + /// + /// Public constructor. + /// + public AdWordsApiException() : base() { + } + + /// + /// Public constructor. + /// + /// The underlying ApiException from the + /// server. + public AdWordsApiException(object apiException) : base() { + this.apiException = apiException; + } + + /// + /// Public constructor. + /// + /// The underlying ApiException from the + /// server. + /// Error message for this API exception. + public AdWordsApiException(object apiException, string message) : base(message) { + this.apiException = apiException; + } + + /// + /// Public constructor. + /// + /// The underlying ApiException from the + /// server. + /// Error message for this API exception. + /// Inner exception, if any. + public AdWordsApiException(object apiException, string message, Exception innerException) + : base(message, innerException) { + this.apiException = apiException; + } + + /// + /// Protected constructor. Used by serialization frameworks while + /// deserializing an exception object. + /// + /// Info about the serialization context. + /// A streaming context that represents the + /// serialization stream. + protected AdWordsApiException(SerializationInfo info, StreamingContext context) + : base(info, context) { + if (info == null) { + throw new ArgumentNullException("info"); + } + apiException = SerializationUtilities.DeserializeFromXmlText( + GetValue(info, "apiException"), + GetValue(info, "apiExceptionType")); + } + + /// + /// This method is called by serialization frameworks while serializing + /// an exception object. + /// + /// Info about the serialization context. + /// A streaming context that represents the + /// serialization stream. + [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)] + public override void GetObjectData(SerializationInfo info, StreamingContext context) { + if (info == null) { + throw new ArgumentNullException("info"); + } + base.GetObjectData(info, context); + if (apiException != null) { + info.AddValue("apiException", SerializationUtilities.SerializeAsXmlText(apiException)); + info.AddValue("apiExceptionType", apiException.GetType()); + } + } + } +} diff --git a/src/AdWords/Lib/AdWordsAppConfig.cs b/src/AdWords/Lib/AdWordsAppConfig.cs new file mode 100644 index 00000000000..30bcd12499b --- /dev/null +++ b/src/AdWords/Lib/AdWordsAppConfig.cs @@ -0,0 +1,296 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Configuration; +using System.Collections; +using System.Collections.Specialized; +using System.IO; +using System.Net; +using System.Xml; + +namespace Google.Api.Ads.AdWords.Lib { + /// + /// This class reads the configuration keys from App.config. + /// + public class AdWordsAppConfig : AppConfigBase { + /// + /// The short name to identify this assembly. + /// + private const string SHORT_NAME = "AwApi-DotNet"; + + /// + /// Key name for clientCustomerId. + /// + private const string CLIENT_CUSTOMER_ID = "ClientCustomerId"; + + /// + /// Key name for merchantCenterId. + /// + private const string MERCHANT_CENTER_ID = "MerchantCenter.AccountId"; + + /// + /// Key name for placesLoginEmail. + /// + private const string PLACES_LOGIN_EMAIL = "GooglePlaces.LoginEmail"; + + /// + /// Key name for placesOAuth2RefreshToken. + /// + private const string PLACES_OAUTH2_REFRESH_TOKEN = "GooglePlaces.OAuth2RefreshToken"; + + /// + /// Key name for developerToken. + /// + private const string DEVELOPER_TOKEN = "DeveloperToken"; + + /// + /// Key name for userAgent. + /// + private const string USER_AGENT = "UserAgent"; + + /// + /// Key name for AdWords API URL. + /// + private const string ADWORDSAPI_SERVER = "AdWordsApi.Server"; + + /// + /// Key name for authorizationMethod. + /// + private const string AUTHORIZATION_METHOD = "AuthorizationMethod"; + + /// + /// Default value for AdWords API URL. + /// + private const string DEFAULT_ADWORDSAPI_SERVER = "https://adwords.google.com"; + + /// + /// Default value for authorizationMethod. + /// + private const AdWordsAuthorizationMethod DEFAULT_AUTHORIZATION_METHOD = + AdWordsAuthorizationMethod.OAuth2; + + /// + /// Default OAuth2 scope for AdWords API. + /// + private const string DEFAULT_OAUTH_SCOPE = "https://www.googleapis.com/auth/adwords"; + + /// + /// ClientCustomerId to be used in SOAP headers. + /// + private string clientCustomerId; + + /// + /// DeveloperToken to be used in the SOAP header. + /// + private string developerToken; + + /// + /// Login email to be used with Google Places account. + /// + private string placesLoginEmail; + + /// + /// OAuth2 refresh token to be used for Google Places account. + /// + private string placesOAuth2RefreshToken; + + /// + /// Merchant Center ID to be used for Shopping campaigns. + /// + private long merchantCenterId; + + /// + /// Useragent to be used in the SOAP header. + /// + private string userAgent; + + /// + /// Url for AdWords API. + /// + private string adWordsApiServer; + + /// + /// Authorization method to be used when making API calls. + /// + private AdWordsAuthorizationMethod authorizationMethod; + + /// + /// Gets or sets the client customerId to be used in SOAP headers. + /// + public string ClientCustomerId { + get { + return clientCustomerId; + } + set { + SetPropertyField("ClientCustomerId", ref clientCustomerId, value); + } + } + + /// + /// Gets or sets the developer token to be used in SOAP headers. + /// + public string DeveloperToken { + get { + return developerToken; + } + set { + SetPropertyField("DeveloperToken", ref developerToken, value); + } + } + + /// + /// Gets or sets the Merchant Center ID to be used with Shopping campaigns. + /// + public long MerchantCenterId { + get { + return merchantCenterId; + } + set { + SetPropertyField("MerchantCenterId", ref merchantCenterId, value); + } + } + + /// + /// Gets or sets the Google Places OAuth2 login email. + /// + public string PlacesLoginEmail { + get { + return placesLoginEmail; + } + set { + SetPropertyField("PlacesLoginEmail", ref placesLoginEmail, value); + } + } + + /// + /// Gets or sets the Google Places OAuth2 refresh token. + /// + public string PlacesOAuth2RefreshToken { + get { + return placesOAuth2RefreshToken; + } + set { + SetPropertyField("PlacesOAuth2RefreshToken", ref placesOAuth2RefreshToken, value); + } + } + + /// + /// Gets or sets the useragent to be used in SOAP headers. + /// + public string UserAgent { + get { + return userAgent; + } + set { + SetPropertyField("UserAgent", ref userAgent, value); + } + } + + /// + /// Gets or sets the URL for AdWords API. + /// + public string AdWordsApiServer { + get { + return adWordsApiServer; + } + set { + SetPropertyField("AdWordsApiServer", ref adWordsApiServer, value); + } + } + + /// + /// Gets or sets the authorization method to be used when making API calls. + /// + public AdWordsAuthorizationMethod AuthorizationMethod { + get { + return authorizationMethod; + } + set { + SetPropertyField("AuthorizationMethod", ref authorizationMethod, value); + } + } + + /// + /// Gets a useragent string that can be used with the library. + /// + public string GetUserAgent() { + return String.Format("{0} ({1}{2})", this.UserAgent, this.Signature, + this.EnableGzipCompression ? ", gzip" : ""); + } + + /// + /// Gets the default OAuth2 scope. + /// + public override string GetDefaultOAuth2Scope() { + return DEFAULT_OAUTH_SCOPE; + } + + /// + /// Public constructor. + /// + public AdWordsAppConfig() : base() { + clientCustomerId = ""; + developerToken = ""; + merchantCenterId = -1; + placesOAuth2RefreshToken = ""; + placesLoginEmail = ""; + userAgent = ""; + adWordsApiServer = DEFAULT_ADWORDSAPI_SERVER; + authorizationMethod = DEFAULT_AUTHORIZATION_METHOD; + + ReadSettings((Hashtable) ConfigurationManager.GetSection("AdWordsApi")); + } + + /// + /// Read all settings from App.config. + /// + /// The parsed App.config settings. + protected override void ReadSettings(Hashtable settings) { + base.ReadSettings(settings); + + clientCustomerId = ReadSetting(settings, CLIENT_CUSTOMER_ID, clientCustomerId); + developerToken = ReadSetting(settings, DEVELOPER_TOKEN, developerToken); + + // Configuration keys where AdWords API integrates with other products + // that have their own settings. + long.TryParse(ReadSetting(settings, MERCHANT_CENTER_ID, merchantCenterId.ToString()), + out merchantCenterId); + placesLoginEmail = ReadSetting(settings, PLACES_LOGIN_EMAIL, placesLoginEmail); + placesOAuth2RefreshToken = ReadSetting(settings, PLACES_OAUTH2_REFRESH_TOKEN, + placesOAuth2RefreshToken); + + userAgent = ReadSetting(settings, USER_AGENT, userAgent); + adWordsApiServer = ReadSetting(settings, ADWORDSAPI_SERVER, adWordsApiServer); + try { + authorizationMethod = (AdWordsAuthorizationMethod) Enum.Parse( + typeof(AdWordsAuthorizationMethod), + ReadSetting(settings, AUTHORIZATION_METHOD, authorizationMethod.ToString())); + } catch { + authorizationMethod = DEFAULT_AUTHORIZATION_METHOD; + } + + // If there is an OAuth2 scope mentioned in App.config, this will be + // loaded by the above call. If there isn't one, we will initialize it + // with a library-specific default value. + if (string.IsNullOrEmpty(this.OAuth2Scope)) { + this.OAuth2Scope = GetDefaultOAuth2Scope(); + } + } + } +} \ No newline at end of file diff --git a/src/AdWords/Lib/AdWordsAuthorizationMethod.cs b/src/AdWords/Lib/AdWordsAuthorizationMethod.cs new file mode 100644 index 00000000000..2da389c931c --- /dev/null +++ b/src/AdWords/Lib/AdWordsAuthorizationMethod.cs @@ -0,0 +1,32 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +namespace Google.Api.Ads.AdWords.Lib { + /// + /// List of supported Authorization methods for AdWords API. + /// + public enum AdWordsAuthorizationMethod { + /// + /// ClientLogin API. + /// + ClientLogin, + + /// + /// OAuth 2.0 API. + /// + OAuth2 + } +} diff --git a/src/AdWords/Lib/AdWordsCallListener.cs b/src/AdWords/Lib/AdWordsCallListener.cs new file mode 100644 index 00000000000..b9480120f63 --- /dev/null +++ b/src/AdWords/Lib/AdWordsCallListener.cs @@ -0,0 +1,133 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Text; +using System.Xml; + +namespace Google.Api.Ads.AdWords.Lib { + /// + /// Listens to SOAP messages and logs API unit costs. + /// + public class AdWordsCallListener : SoapListener { + /// + /// The config class to be used with this class. + /// + private AppConfig config; + + /// + /// Gets or sets the config class to be used with this class. + /// + public AppConfig Config { + get { + return config; + } + set { + config = value; + } + } + + /// + /// The singleton instance. + /// + protected static AdWordsCallListener instance = new AdWordsCallListener(); + + /// + /// Protected constructor. + /// + protected AdWordsCallListener() { + } + + /// + /// Gets the singleton instance. + /// + public static SoapListener Instance { + get { + return instance; + } + } + + /// + /// Records API operation count for a user. + /// + /// The AdWords user who made the call. + /// The AdWords API service that was called. + /// The name of the method that was called. + /// The number of API operations for the + /// current call. + private static void RecordApiOperationCount(AdWordsUser user, AdsClient service, + string methodName, int operationCount) { + if (user != null) { + ApiCallEntry entry = new ApiCallEntry(); + entry.Service = service; + entry.Method = methodName; + entry.OperationCount = operationCount; + user.AddCallDetails(entry); + } + } + + /// + /// Gets the API units for the method call from the SOAP message. + /// The derived classes should override this method to analyze + /// the message and return the API units. + /// + /// The SOAP message. + /// The API units for call. + protected static int GetApiUnitsForCall(XmlDocument soapMessage) { + XmlNamespaceManager xmlns = new XmlNamespaceManager(soapMessage.NameTable); + xmlns.AddNamespace("soap", "http://schemas.xmlsoap.org/soap/envelope/"); + XmlNodeList xmlNodeList = soapMessage.SelectNodes("soap:Envelope/soap:Header/descendant::*", + xmlns); + foreach (XmlElement xmlNode in xmlNodeList) { + if (xmlNode.LocalName == "operations") { + return int.Parse(xmlNode.InnerText); + } + } + return 0; + } + + /// + /// Handles the SOAP message. + /// + /// The SOAP message. + /// The SOAP service. + /// The direction of message. + public void HandleMessage(XmlDocument soapMessage, AdsClient service, + SoapMessageDirection direction) { + if (direction == SoapMessageDirection.IN) { + AdWordsUser user = service.User as AdWordsUser; + string methodName = (string) ContextStore.GetValue("SoapMethod"); + RecordApiOperationCount(user, service, methodName, GetApiUnitsForCall(soapMessage)); + } + } + + /// + /// Cleanups the after call. + /// + public void CleanupAfterCall() { + } + + /// + /// Inits for call. + /// + public void InitForCall() { + } + } +} + diff --git a/src/AdWords/Lib/AdWordsCredentialsExpiredException.cs b/src/AdWords/Lib/AdWordsCredentialsExpiredException.cs new file mode 100644 index 00000000000..429f24068e5 --- /dev/null +++ b/src/AdWords/Lib/AdWordsCredentialsExpiredException.cs @@ -0,0 +1,32 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.AdWords.Lib { + public class AdWordsCredentialsExpiredException : CredentialsExpiredException { + /// + /// Public constructor. + /// + /// The expired credential. + public AdWordsCredentialsExpiredException(string expiredCredential) : base(expiredCredential) { + } + } +} diff --git a/src/AdWords/Lib/AdWordsErrorHandler.cs b/src/AdWords/Lib/AdWordsErrorHandler.cs new file mode 100644 index 00000000000..38ab09cde90 --- /dev/null +++ b/src/AdWords/Lib/AdWordsErrorHandler.cs @@ -0,0 +1,204 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Headers; +using Google.Api.Ads.AdWords.Util.Reports; +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; + +namespace Google.Api.Ads.AdWords.Lib { + /// + /// Handles AdWords API Errors. + /// + public class AdWordsErrorHandler : ErrorHandler { + private readonly AdWordsUser user; + + /// + /// The error thrown when an auth token expires. + /// + private const string COOKIE_INVALID_ERROR = "AuthenticationError.GOOGLE_ACCOUNT_COOKIE_INVALID"; + + /// + /// The error thrown when an oauth token expires. + /// + private const string OAUTH_TOKEN_EXPIRED_ERROR = "AuthenticationError.OAUTH_TOKEN_INVALID"; + + /// + /// The error thrown when an oauth token expires. + /// + private const string RATE_EXCEEDED_ERROR = "RateExceededError.RATE_EXCEEDED"; + + /// + /// The error thrown when an unexpected internal error occurs. + /// + private const string INTERNAL_ERROR = "InternalApiError.UNEXPECTED_INTERNAL_API_ERROR"; + + /// + /// Initializes a new instance of the class. + /// + /// The user. + public AdWordsErrorHandler(AdWordsUser user) + : base(user.Config) { + this.user = user; + } + + /// + /// Gets the config. + /// + private AdWordsAppConfig Config { + get { + return this.user.Config as AdWordsAppConfig; + } + } + + /// + /// Checks if an API call should be retried when an exception occurs. + /// + /// The exception. + /// + /// True, if the call should be retried, false otherwise. + /// + public override bool ShouldRetry(Exception ex) { + if (HaveMoreRetryAttemptsLeft()) { + return IsExpiredCredentialsError(ex) || IsTransientError(ex); + } else { + return false; + } + } + + /// + /// Prepares the system for retrying the last failed call. + /// + /// The exception. + public override void PrepareForRetry(Exception ex) { + try { + if (ex is AdWordsCredentialsExpiredException) { + AdWordsCredentialsExpiredException e = (AdWordsCredentialsExpiredException) ex; + if (this.Config.AuthorizationMethod == AdWordsAuthorizationMethod.ClientLogin) { + AuthToken.Cache.InvalidateToken(e.ExpiredCredential); + Config.AuthToken = null; + } else if (this.Config.AuthorizationMethod == AdWordsAuthorizationMethod.OAuth2) { + this.user.OAuthProvider.RefreshAccessToken(); + } + } else if (IsTransientError(ex)) { + DoExponentialBackoff(); + } + IncrementRetriedAttempts(); + } catch (Exception e) { + // We threw an exception while trying to recover from another + // exception. The second exception may contain additional details + // (e.g. exact reason why OAuth token refresh failed.), so we + // raise an ApplicationException with the message from the second + // exception and the first exception as inner exception. Ideally, + // we'd like to return both the exception objects, but this is + // a reasonable tradeoff. + string msg = string.Format("An error occured while retrying a failed API call : " + + "{0}. See inner exception for more details.", e.Message); + throw new ApplicationException(msg, ex); + } + } + + /// + /// Determines whether an exception corrsponds to an expired credential. + /// + /// The exception. + /// True if the exception corresponds to an expired credential, + /// false otherwise. + public static bool IsExpiredCredentialsError(Exception ex) { + return ex is AdWordsCredentialsExpiredException; + } + + /// + /// Determines whether the exception thrown by the server is an AuthToken + /// Invalid Error. + /// + /// The exception. + /// True, if the server exception is a AuthToken invalid error, + /// false otherwise. + public static bool IsCookieInvalidError(Exception ex) { + if (ex is AdWordsApiException) { + return MatchesError((AdWordsApiException) ex, new string[] {COOKIE_INVALID_ERROR}); + } else if (ex is ReportsException) { + return MatchesError((ReportsException) ex, new string[] {COOKIE_INVALID_ERROR}); + } + return false; + } + + /// + /// Determines whether the exception thrown by the server is an OAuth token + /// expired error. + /// + /// The exception. + /// True, if the server exception is a OAuth token expired error, + /// false otherwise. + public static bool IsOAuthTokenExpiredError(Exception ex) { + if (ex is AdWordsApiException) { + return MatchesError((AdWordsApiException) ex, new string[] {OAUTH_TOKEN_EXPIRED_ERROR}); + } else if (ex is ReportsException) { + return MatchesError((ReportsException) ex, new string[] {OAUTH_TOKEN_EXPIRED_ERROR}); + } + return false; + } + + /// + /// Determines whether the exception thrown by the server matches a known + /// error. + /// + /// The exception. + /// The known error message. + /// True, if the server exception matches the known error, false + /// otherwise. + private static bool MatchesError(ReportsException ex, string[] errorMessages) { + foreach (ReportDownloadError error in ex.Errors) { + foreach (String errorMessage in errorMessages) { + if (error.ErrorType.Contains(errorMessage)) { + return true; + } + } + } + return false; + } + + /// + /// Determines whether the exception thrown by the server matches a known + /// error. + /// + /// The awapi exception. + /// The known error message. + /// True, if the server exception matches the known error, false + /// otherwise. + private static bool MatchesError(AdWordsApiException awapiException, string[] errorMessages) { + object[] errors = (object[]) awapiException.ApiException.GetType(). + GetProperty("errors").GetValue(awapiException.ApiException, null); + if (errors != null) { + for (int i = 0; i < errors.Length; i++) { + string errorString = (string) errors[i].GetType().GetProperty("errorString"). + GetValue(errors[i], null); + foreach (String errorMessage in errorMessages) { + if (String.Compare(errorString, errorMessage, true) == 0) { + return true; + } + } + } + } + return false; + } + } +} diff --git a/src/AdWords/Lib/AdWordsException.cs b/src/AdWords/Lib/AdWordsException.cs new file mode 100644 index 00000000000..e0e82550bd2 --- /dev/null +++ b/src/AdWords/Lib/AdWordsException.cs @@ -0,0 +1,65 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.IO; +using System.Runtime.Serialization; +using System.Security.Permissions; +using System.Text; +using System.Xml.Serialization; + +namespace Google.Api.Ads.AdWords.Lib { + /// + /// Base class for all exceptions specific to AdWords. + /// + [Serializable] + public class AdWordsException : AdsException { + /// + /// Public constructor. + /// + public AdWordsException() : base() { + } + + /// + /// Public constructor. + /// + /// Error message for this API exception. + public AdWordsException(string message) : base(message) { + } + + /// + /// Public constructor. + /// + /// Error message for this API exception. + /// Inner exception, if any. + public AdWordsException(string message, Exception innerException) + : base(message, innerException) { + } + + /// + /// Protected constructor. Used by serialization frameworks while + /// deserializing an exception object. + /// + /// Info about the serialization context. + /// A streaming context that represents the + /// serialization stream. + protected AdWordsException(SerializationInfo info, StreamingContext context) + : base(info, context) { + } + } +} diff --git a/src/AdWords/Lib/AdWordsService.cs b/src/AdWords/Lib/AdWordsService.cs new file mode 100644 index 00000000000..d81056660d0 --- /dev/null +++ b/src/AdWords/Lib/AdWordsService.cs @@ -0,0 +1,50 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Text; + +namespace Google.Api.Ads.AdWords.Lib { + /// + /// Lists all the services available through this library. + /// + public partial class AdWordsService : AdsService { + /// + /// Creates a service creation parameter for defining an AdWords service. + /// + /// Service version. + /// Group name. + /// Service name. + /// A service creation parameter defining this service. + protected static ServiceSignature MakeServiceSignature(string version, string groupName, + string serviceName) { + return new AdWordsServiceSignature(version, serviceName, groupName); + } + + /// + /// Gets all service types defined in this service. + /// + /// The nested types that define service versions under this + /// service. + public override Type[] GetServiceTypes() { + return MethodInfo.GetCurrentMethod().DeclaringType.GetNestedTypes(); + } + } +} diff --git a/src/AdWords/Lib/AdWordsServiceFactory.cs b/src/AdWords/Lib/AdWordsServiceFactory.cs new file mode 100644 index 00000000000..d44e754ca35 --- /dev/null +++ b/src/AdWords/Lib/AdWordsServiceFactory.cs @@ -0,0 +1,177 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Headers; +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Reflection; +using System.Text; +using System.Web.Services; +using System.Web.Services.Protocols; +using System.Xml; +using System.Xml.Schema; +using System.Xml.Serialization; + +namespace Google.Api.Ads.AdWords.Lib { + /// + /// The factory class for all AdWords API services. + /// + public class AdWordsServiceFactory : ServiceFactory { + + private const string FINAL_CLIENT_LOGIN_VERSION = "v201309"; + + /// + /// The request header to be used with AdWords API services. + /// + private RequestHeader requestHeader; + + /// + /// Default public constructor. + /// + public AdWordsServiceFactory() { + } + + /// + /// Create a service object. + /// + /// Signature of the service being created. + /// The user for which the service is being created. + /// The server to which the API calls should be + /// made. + /// + /// An object of the desired service type. + public override AdsClient CreateService(ServiceSignature signature, AdsUser user, + Uri serverUrl) { + AdWordsAppConfig awConfig = (AdWordsAppConfig) Config; + if (serverUrl == null) { + serverUrl = new Uri(awConfig.AdWordsApiServer); + } + + if (user == null) { + throw new ArgumentNullException("user"); + } + + CheckServicePreconditions(signature); + + AdWordsServiceSignature awapiSignature = signature as AdWordsServiceSignature; + + AdsClient service = (AdsClient) Activator.CreateInstance(awapiSignature.ServiceType); + PropertyInfo propInfo = awapiSignature.ServiceType.GetProperty("RequestHeader"); + if (propInfo != null) { + RequestHeader clonedHeader = (RequestHeader) requestHeader.Clone(); + clonedHeader.Version = awapiSignature.Version; + clonedHeader.GroupName = awapiSignature.GroupName; + propInfo.SetValue(service, clonedHeader, null); + } + + if (awConfig.Proxy != null) { + service.Proxy = awConfig.Proxy; + } + service.Timeout = awConfig.Timeout; + service.Url = string.Format("{0}api/adwords/{1}/{2}/{3}", + serverUrl.AbsoluteUri, awapiSignature.GroupName, awapiSignature.Version, + awapiSignature.ServiceName); + service.EnableDecompression = awConfig.EnableGzipCompression; + service.User = user; + service.Signature = awapiSignature; + return service; + } + + /// + /// Reads the headers from App.config. + /// + /// The configuration class. + protected override void ReadHeadersFromConfig(AppConfig config) { + AdWordsAppConfig awConfig = (AdWordsAppConfig) config; + this.requestHeader = new RequestHeader(); + + if (!string.IsNullOrEmpty(awConfig.ClientCustomerId)) { + requestHeader.clientCustomerId = awConfig.ClientCustomerId; + } + requestHeader.developerToken = awConfig.DeveloperToken; + requestHeader.userAgent = awConfig.GetUserAgent(); + } + + /// + /// Fix the request header namespace in outgoing Soap Requests, so that + /// cross namespace requests can work properly. + /// + /// The service creation parameters. + /// The service object for which RequestHeader + /// needs to be patched. + private static void FixRequestHeaderNameSpace(AdWordsServiceSignature signature, + AdsClient service) { + // Set the header namespace prefix. For all /cm services, the members + // shouldn't have xmlns. For all other services, the members should have + // /cm as xmlns. + object[] attributes = service.GetType().GetCustomAttributes(false); + foreach (object attribute in attributes) { + if (attribute is WebServiceBindingAttribute) { + WebServiceBindingAttribute binding = (WebServiceBindingAttribute) attribute; + string delimiter = "/api/adwords/"; + string xmlns = String.Join("", new String[] { + binding.Namespace.Substring(0, binding.Namespace.IndexOf(delimiter) + + delimiter.Length), "cm/", signature.Version}); + if (xmlns == binding.Namespace) { + xmlns = ""; + } + + RequestHeader svcRequestHeader = null; + PropertyInfo propInfo = service.GetType().GetProperty("RequestHeader"); + if (propInfo != null) { + svcRequestHeader = (RequestHeader) propInfo.GetValue(service, null); + + if (svcRequestHeader != null) { + PropertyInfo wsPropInfo = svcRequestHeader.GetType().GetProperty("TargetNamespace"); + if (wsPropInfo != null) { + wsPropInfo.SetValue(svcRequestHeader, xmlns, null); + } + } + } + } + } + } + + /// + /// Checks preconditions of the service signature and throws and exception if the service + /// cannot be generated. + /// + /// the service signature for generating the service + protected override void CheckServicePreconditions(ServiceSignature signature) { + if (signature == null) { + throw new ArgumentNullException("signature"); + } + + if (!(signature is AdWordsServiceSignature)) { + throw new InvalidCastException(string.Format(CultureInfo.InvariantCulture, + AdWordsErrorMessages.SignatureIsOfWrongType, typeof(AdWordsServiceSignature))); + } + + AdWordsAppConfig adWordsAppConfig = (AdWordsAppConfig) Config; + AdWordsServiceSignature adWordsSingature = signature as AdWordsServiceSignature; + String version = adWordsSingature.Version; + if (adWordsAppConfig.AuthorizationMethod == AdWordsAuthorizationMethod.ClientLogin + && version.CompareTo(FINAL_CLIENT_LOGIN_VERSION) > 0) { + throw new AdWordsException(string.Format(AdWordsErrorMessages.ClientLoginNotSupported, + version)); + } + } + + } +} diff --git a/src/AdWords/Lib/AdWordsServiceSignature.cs b/src/AdWords/Lib/AdWordsServiceSignature.cs new file mode 100644 index 00000000000..71bc8a95927 --- /dev/null +++ b/src/AdWords/Lib/AdWordsServiceSignature.cs @@ -0,0 +1,70 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Reflection; +using System.Text; +using System.Web.Services; +using System.Web.Services.Protocols; +using System.Xml; +using System.Xml.Schema; +using System.Xml.Serialization; + +namespace Google.Api.Ads.AdWords.Lib { + /// + /// Service creation params for AdWords API family of services. + /// + public class AdWordsServiceSignature : ServiceSignature { + /// + /// The group name, for instance, cm. + /// + private string groupName; + + /// + /// Gets the group name. + /// + public string GroupName { + get { + return groupName; + } + } + + /// + /// Gets the type of service. + /// + public override Type ServiceType { + get { + return Type.GetType(string.Format(CultureInfo.InvariantCulture, + "Google.Api.Ads.AdWords.{0}.{1}", Version, ServiceName)); + } + } + + /// + /// Public constructor. + /// + /// Service version. + /// Service name. + /// The group name + public AdWordsServiceSignature(string version, string serviceSignature, string groupName) + : base(version, serviceSignature, SupportedProtocols.SOAP) { + this.groupName = groupName; + } + } +} diff --git a/src/AdWords/Lib/AdWordsSoapClient.cs b/src/AdWords/Lib/AdWordsSoapClient.cs new file mode 100644 index 00000000000..5f3e1d4dca1 --- /dev/null +++ b/src/AdWords/Lib/AdWordsSoapClient.cs @@ -0,0 +1,159 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Headers; +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Common.Util; + +using System; +using System.IO; +using System.Net; +using System.Reflection; +using System.Text; +using System.Web; +using System.Web.Services; +using System.Web.Services.Protocols; +using System.Xml; +using System.Xml.Serialization; + +namespace Google.Api.Ads.AdWords.Lib { + /// + /// Base class for AdWords API services. + /// + public class AdWordsSoapClient : AdsSoapClient { + /// + /// Service name to be used when getting auth token for AdWords. + /// + public const string SERVICE_NAME = "adwords"; + + /// + /// Initializes the service before MakeApiCall. + /// + /// Name of the method. + /// The method parameters. + protected override void InitForCall(string methodName, object[] parameters) { + AdWordsAppConfig config = this.User.Config as AdWordsAppConfig; + string oAuthHeader = null; + RequestHeader header = GetRequestHeader(); + + if (string.IsNullOrEmpty(header.developerToken)) { + throw new ArgumentNullException(AdWordsErrorMessages.DeveloperTokenCannotBeEmpty); + } + + if (string.IsNullOrEmpty(header.clientCustomerId)) { + TraceUtilities.WriteGeneralWarnings(AdWordsErrorMessages.ClientCustomerIdIsEmpty); + } + + if (config.AuthorizationMethod == AdWordsAuthorizationMethod.OAuth2) { + if (this.User.OAuthProvider != null) { + oAuthHeader = this.User.OAuthProvider.GetAuthHeader(); + } else { + throw new AdWordsApiException(null, AdWordsErrorMessages.OAuthProviderCannotBeNull); + } + } else if (config.AuthorizationMethod == AdWordsAuthorizationMethod.ClientLogin) { + if (header != null) { + header.authToken = (!string.IsNullOrEmpty(config.AuthToken)) ? config.AuthToken : + new AuthToken(config, SERVICE_NAME).GetToken(); + } else { + throw new AdWordsApiException(null, AdWordsErrorMessages.FailedToSetAuthorizationHeader); + } + } + ContextStore.AddKey("OAuthHeader", oAuthHeader); + base.InitForCall(methodName, parameters); + } + + /// + /// Gets the request header. + /// + /// The request header. + private RequestHeader GetRequestHeader() { + return (RequestHeader) this.GetType().GetProperty("RequestHeader").GetValue(this, null); + } + + /// + /// Cleans up the service after MakeApiCall. + /// + /// Name of the method. + /// The method parameters. + protected override void CleanupAfterCall(string methodName, object[] parameters) { + ContextStore.RemoveKey("OAuthHeader"); + base.CleanupAfterCall(methodName, parameters); + } + + /// + /// Creates the error handler. + /// + /// + /// The error handler instance. + /// + protected override ErrorHandler CreateErrorHandler() { + return new AdWordsErrorHandler(this.User as AdWordsUser); + } + + /// + /// Creates a WebRequest instance for the specified url. + /// + /// The Uri to use when creating the WebRequest. + /// + /// The WebRequest instance. + /// + protected override WebRequest GetWebRequest(Uri uri) { + WebRequest request = base.GetWebRequest(uri); + string oAuthHeader = (string) ContextStore.GetValue("OAuthHeader"); + if (!string.IsNullOrEmpty(oAuthHeader)) { + request.Headers["Authorization"] = oAuthHeader; + } + return request; + } + + /// + /// Gets a custom exception that wraps the SOAP exception thrown + /// by the server. + /// + /// SOAPException that was thrown by the server. + /// A custom exception object that wraps the SOAP exception. + /// + protected override Exception GetCustomException(SoapException ex) { + string defaultNs = GetDefaultNamespace(); + + if (!string.IsNullOrEmpty(defaultNs) && ex.Detail != null) { + // Extract the ApiExceptionFault node. + XmlElement faultNode = GetFaultNode(ex, defaultNs, "ApiExceptionFault"); + + if (faultNode != null) { + try { + AdWordsApiException awapiException = new AdWordsApiException( + SerializationUtilities.DeserializeFromXmlTextCustomRootNs( + faultNode.OuterXml, Assembly.GetExecutingAssembly().GetType( + this.GetType().Namespace + ".ApiException"), defaultNs, "ApiExceptionFault"), + AdWordsErrorMessages.AnApiExceptionOccurred, ex); + if (AdWordsErrorHandler.IsCookieInvalidError(awapiException)) { + return new AdWordsCredentialsExpiredException(this.GetRequestHeader().authToken); + } else if (AdWordsErrorHandler.IsOAuthTokenExpiredError(awapiException)) { + return new AdWordsCredentialsExpiredException( + (string) ContextStore.GetValue("OAuthHeader")); + } else { + return awapiException; + } + } catch (Exception) { + // deserialization failed, but we can safely ignore it. + } + } + } + return new AdWordsApiException(null, AdWordsErrorMessages.AnApiExceptionOccurred, ex); + } + } +} diff --git a/src/AdWords/Lib/AdWordsTraceListener.cs b/src/AdWords/Lib/AdWordsTraceListener.cs new file mode 100644 index 00000000000..40223d157f2 --- /dev/null +++ b/src/AdWords/Lib/AdWordsTraceListener.cs @@ -0,0 +1,118 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Common.Util; + +using System; +using System.Globalization; +using System.IO; +using System.Net; +using System.Runtime.Remoting.Messaging; +using System.Text; +using System.Threading; +using System.Web; +using System.Web.Services; +using System.Web.Services.Protocols; +using System.Xml; +using System.Xml.Serialization; + +namespace Google.Api.Ads.AdWords.Lib { + /// + /// Listens to SOAP messages sent and received by this library. + /// + public class AdWordsTraceListener : TraceListener { + /// + /// The singleton instance. + /// + protected static AdWordsTraceListener instance = new AdWordsTraceListener(); + + /// + /// Protected constructor. + /// + protected AdWordsTraceListener() : base(new AdWordsAppConfig()) { + } + + /// + /// Gets the singleton instance. + /// + public static SoapListener Instance { + get { + return instance; + } + } + + /// + /// Create a formatted HTTP request text, to be written into HTTP logs. + /// + /// The request XML for this SOAP call. + /// A formatted string that represents the HTTP request. + protected override string FormatHttpRequest(string soapRequest) { + XmlDocument xDoc = SerializationUtilities.LoadXml(soapRequest); + XmlNamespaceManager xmlns = new XmlNamespaceManager(xDoc.NameTable); + xmlns.AddNamespace("soap", "http://schemas.xmlsoap.org/soap/envelope/"); + XmlNode methodNode = + xDoc.SelectSingleNode("soap:Envelope/soap:Body/*", xmlns); + string operators = "None"; + if (methodNode.Name == "mutate") { + StringBuilder builder = new StringBuilder(); + foreach (XmlNode child in methodNode.ChildNodes) { + if (child.Name == "operations") { + foreach (XmlNode grandChild in child.ChildNodes) { + if (grandChild.Name == "operator") { + builder.Append(grandChild.InnerText + "|"); + } + } + } + } + operators = builder.ToString().TrimEnd('|'); + } + return string.Format(CultureInfo.InvariantCulture, "method={0},operator={1}", + methodNode.Name, operators); + } + + /// + /// Create a formatted http response text, to be written into HTTP logs. + /// + /// The response xml for this SOAP call. + /// A formatted string that represents the HTTP response. + protected override string FormatHttpResponse(string soapResponse) { + XmlDocument xDoc = SerializationUtilities.LoadXml(soapResponse); + XmlNamespaceManager xmlns = new XmlNamespaceManager(xDoc.NameTable); + xmlns.AddNamespace("soap", "http://schemas.xmlsoap.org/soap/envelope/"); + XmlNodeList childNodes = + xDoc.SelectNodes("soap:Envelope/soap:Header/*", xmlns); + if (childNodes.Count == 1 && childNodes[0].Name == "ResponseHeader") { + childNodes = childNodes[0].ChildNodes; + } + StringBuilder responseText = new StringBuilder(); + foreach (XmlNode childNode in childNodes) { + if (childNode is XmlElement) { + responseText.AppendFormat("{0}={1},", childNode.Name, childNode.InnerText); + } + } + return responseText.ToString().TrimEnd(','); + } + + /// + /// Gets a list of fields to be masked in xml logs. + /// + /// The list of fields to be masked. + protected override string[] GetFieldsToMask() { + return new string[] {"password", "developerToken", "applicationToken", "authToken"}; + } + } +} diff --git a/src/AdWords/Lib/AdWordsUser.cs b/src/AdWords/Lib/AdWordsUser.cs new file mode 100644 index 00000000000..65a4e8f3dfb --- /dev/null +++ b/src/AdWords/Lib/AdWordsUser.cs @@ -0,0 +1,124 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Net; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Web.Services; +using System.Web.Services.Protocols; + +namespace Google.Api.Ads.AdWords.Lib { + /// + /// Represents an AdWords API user. + /// + public partial class AdWordsUser : AdsUser { + /// + /// Keeps track of the API calls made this user. + /// + private List apiCalls = new List(); + + /// + /// Public constructor. Use this version if you want the library to + /// use all settings from App.config. + /// + public AdWordsUser() : base(new AdWordsAppConfig()) { + } + + /// + /// Parameterized constructor. Use this version if you want to construct + /// an AdWordsUser with a custom set of headers. + /// + /// The custom set of headers. + public AdWordsUser(Dictionary headers) : base(new AdWordsAppConfig(), headers) { + } + + /// + /// Gets all the service types to be registered against this user. + /// + /// The type of all service classes to be registered. + public override Type[] GetServiceTypes() { + return new AdWordsService().GetServiceTypes(); + } + + /// + /// Gets the list of default SOAP listeners. + /// + /// + /// A list of default SOAP listeners. + /// + public override SoapListener[] GetDefaultListeners() { + return new SoapListener[] {AdWordsTraceListener.Instance, AdWordsCallListener.Instance}; + } + + /// + /// Adds an API call detail to this user instance. + /// + /// The API call details to be added. + [MethodImpl(MethodImplOptions.Synchronized)] + public void AddCallDetails(ApiCallEntry apiCall) { + apiCalls.Add(apiCall); + } + + /// + /// Gets the details of the API calls made by this user. + /// + /// The list of all call details. + [MethodImpl(MethodImplOptions.Synchronized)] + public ApiCallEntry[] GetCallDetails() { + return apiCalls.ToArray(); + } + + /// + /// Gets the total number of operations made by this user. + /// + /// The total number of operations made by this user, or 0 if no + /// calls were made. + [MethodImpl(MethodImplOptions.Synchronized)] + public int GetTotalOperationCount() { + int totalOperationCount = 0; + foreach (ApiCallEntry entry in apiCalls) { + totalOperationCount += entry.OperationCount; + } + return totalOperationCount; + } + + /// + /// Gets the number of operations for the last API call. + /// + /// The number of operations for the last API call, or 0 if no API + /// calls have been made so far. + [MethodImpl(MethodImplOptions.Synchronized)] + public int GetOperationCountForLastCall() { + if (apiCalls.Count == 0) { + return 0; + } else { + return apiCalls[apiCalls.Count - 1].OperationCount; + } + } + + /// + /// Resets the call history for this user. + /// + public void ResetCallHistory() { + apiCalls.Clear(); + } + } +} diff --git a/src/AdWords/Lib/ApiCallEntry.cs b/src/AdWords/Lib/ApiCallEntry.cs new file mode 100644 index 00000000000..5377164b1de --- /dev/null +++ b/src/AdWords/Lib/ApiCallEntry.cs @@ -0,0 +1,75 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +namespace Google.Api.Ads.AdWords.Lib { + /// + /// Represents an API call that was made to the AdWords API server. + /// + public partial class ApiCallEntry { + /// + /// The service that was called. + /// + private AdsClient service; + + /// + /// Name of the method that was called. + /// + private string method; + + /// + /// The number of API operations for this call. + /// + private int operationCount; + + /// + /// Gets or sets the service that was called. + /// + public AdsClient Service { + get { + return service; + } + set { + service = value; + } + } + + /// + /// Gets or sets the name of the method that was called. + /// + public string Method { + get { + return method; + } + set { + method = value; + } + } + + /// + /// Gets or sets the number of API operations for this call. + /// + public int OperationCount { + get { + return operationCount; + } + set { + operationCount = value; + } + } + } +} diff --git a/src/AdWords/Properties/AssemblyInfo.cs b/src/AdWords/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..65c795f9a1f --- /dev/null +++ b/src/AdWords/Properties/AssemblyInfo.cs @@ -0,0 +1,39 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("AdWords API DotNet Client Library")] +[assembly: AssemblyDescription( + "This library provides you with functionality to access AdWords API.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// TODO(Anash): Make this true once the library becomes CLS Compliant. +[assembly: System.CLSCompliant(false)] +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("ccc25b61-18d8-49d5-993c-5fd838a03719")] diff --git a/src/AdWords/Properties/Properties.cs b/src/AdWords/Properties/Properties.cs new file mode 100644 index 00000000000..de944c8264a --- /dev/null +++ b/src/AdWords/Properties/Properties.cs @@ -0,0 +1,24 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; + +[assembly: AssemblyCompany("Google")] +[assembly: AssemblyProduct("AdWords API DotNet Client Library")] +[assembly: AssemblyCopyright("Copyright 2011, Google Inc. All Rights Reserved.")] + +[assembly: AssemblyVersion("18.0.0.0")] +[assembly: AssemblyFileVersion("18.0.0.0")] diff --git a/src/AdWords/Util/ErrorUtilities.cs b/src/AdWords/Util/ErrorUtilities.cs new file mode 100644 index 00000000000..35b6cc98d0e --- /dev/null +++ b/src/AdWords/Util/ErrorUtilities.cs @@ -0,0 +1,44 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.AdWords.Util { + /// + /// Provides utility methods for handling API errors. + /// + public class ErrorUtilities { + /// + /// Gets the operation index that corresponds to an ApiError. + /// + /// The fieldPath from ApiError. + /// The operation index, or -1 if the index cannot be retrieved. + /// + public static int GetOperationIndex(string fieldPath) { + string[] parts = fieldPath.Split('.'); + + if (parts.Length > 0 && parts[0].StartsWith("operations[")) { + int index = 0; + if (int.TryParse(parts[0].Split(new char[] { '[', ']' })[1], out index)) { + return index; + } + } + return -1; + } + } +} diff --git a/src/AdWords/Util/Reports/ClientReport.cs b/src/AdWords/Util/Reports/ClientReport.cs new file mode 100644 index 00000000000..08c06bcaf73 --- /dev/null +++ b/src/AdWords/Util/Reports/ClientReport.cs @@ -0,0 +1,70 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Google.Api.Ads.AdWords.Util.Reports { + /// + /// Represents a report downloaded from the server. + /// + public class ClientReport { + /// + /// The path to which the report was downloaded. + /// + string path; + + /// + /// The report contents in memory. + /// + byte[] contents; + + /// + /// Gets or sets the path. + /// + public string Path { + get { + return path; + } + internal set { + path = value; + } + } + + /// + /// Gets the report contents. + /// + public byte[] Contents { + get { + return contents; + } + internal set { + contents = value; + } + } + + /// + /// Gets the report contents. + /// + public string Text { + get { + return Encoding.UTF8.GetString(contents); + } + } + } +} diff --git a/src/AdWords/Util/Reports/ReportDownloadError.cs b/src/AdWords/Util/Reports/ReportDownloadError.cs new file mode 100644 index 00000000000..c86d6f85eba --- /dev/null +++ b/src/AdWords/Util/Reports/ReportDownloadError.cs @@ -0,0 +1,78 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.AdWords.Util.Reports { + /// + /// Represents a report download error. + /// + [Serializable()] + public class ReportDownloadError { + /// + /// Type of error. + /// + string errorType; + + /// + /// The reason for triggering this error. + /// + string trigger; + + /// + /// The field that triggered this error, if applicable. + /// + string fieldPath; + + /// + /// Gets or sets the type of the error. + /// + public string ErrorType { + get { + return errorType; + } + set { + errorType = value; + } + } + + /// + /// Gets or sets the reason for triggering this error. + /// + public string Trigger { + get { + return trigger; + } + set { + trigger = value; + } + } + + /// + /// Gets or sets the field that triggered this error, if applicable. + /// + public string FieldPath { + get { + return fieldPath; + } + set { + fieldPath = value; + } + } + } +} diff --git a/src/AdWords/Util/Reports/ReportUtilities.cs b/src/AdWords/Util/Reports/ReportUtilities.cs new file mode 100644 index 00000000000..715bf58acb2 --- /dev/null +++ b/src/AdWords/Util/Reports/ReportUtilities.cs @@ -0,0 +1,436 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Net; +using System.Reflection; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading; +using System.Web; +using System.Xml; + +namespace Google.Api.Ads.AdWords.Util.Reports { + /// + /// Defines report utility functions for the client library. + /// + public class ReportUtilities { + /// + /// The user associated with this object. + /// + private AdWordsUser user; + + /// + /// Default report version. + /// + private const string DEFAULT_REPORT_VERSION = "v201406"; + + /// + /// Sets the reporting API version to use. + /// + private string reportVersion = DEFAULT_REPORT_VERSION; + + /// + /// The report download url format for ad-hoc reports. + /// + private const string QUERY_REPORT_URL_FORMAT = "{0}/api/adwords/reportdownload/{1}?" + + "__fmt={2}"; + + /// + /// The report download url format for ad-hoc reports. + /// + private const string ADHOC_REPORT_URL_FORMAT = "{0}/api/adwords/reportdownload/{1}"; + + /// + /// The Authorization header prefix to be used when Authorization method is + /// ClientLogin. + /// + private const string CLIENT_LOGIN_PREFIX = "GoogleLogin auth="; + + /// + /// Last version that supported returnMoneyInMicros header. + /// + private const string LAST_VERSION_WITH_MONEY_MICROS_FLAG = "v201402"; + + /// + /// Gets or sets the reporting API version to use. + /// + public string ReportVersion { + get { + return reportVersion; + } + set { + reportVersion = value; + } + } + + /// + /// Returns the user associated with this object. + /// + public AdWordsUser User { + get { + return user; + } + } + + /// + /// Initializes a new instance of the class. + /// + /// AdWords user to be used along with this + /// utilities object. + public ReportUtilities(AdWordsUser user) { + this.user = user; + } + + /// + /// Downloads a report into memory. + /// + /// The AWQL query for report definition. See + /// https://developers.google.com/adwords/api/docs/guides/awql for AWQL + /// documentation. + /// The report format. + /// The client report. + public ClientReport GetClientReport(string query, string format) { + return GetClientReport(query, format, null); + } + + /// + /// Downloads a report into memory. + /// + /// The AWQL query for report definition. See + /// https://developers.google.com/adwords/api/docs/guides/awql for AWQL + /// documentation. + /// The report format. + /// True, if the money values in the + /// report should be returned as micros, False otherwise. + /// The client report. + [Obsolete("returnMoneyInMicros header was sunset in AdWords API version v201406. " + + "This method wlll be removed when AdWords API version v201402 is sunset. Use " + + "GetClientReport(string query, string format) instead.")] + public ClientReport GetClientReport(string query, string format, bool? returnMoneyInMicros) { + AdWordsAppConfig config = (AdWordsAppConfig) User.Config; + string downloadUrl = string.Format(QUERY_REPORT_URL_FORMAT, config.AdWordsApiServer, + reportVersion, format); + string postData = string.Format("__rdquery={0}", HttpUtility.UrlEncode(query)); + return GetClientReportInternal(downloadUrl, postData, returnMoneyInMicros); + } + + /// + /// Downloads a report into memory. + /// + /// The report definition. + /// The client report. + public ClientReport GetClientReport(T reportDefinition) { + return GetClientReport(reportDefinition, null); + } + + /// + /// Downloads a report into memory. + /// + /// The report definition. + /// True, if the money values in the + /// report should be returned as micros, False otherwise. + /// The client report. + [Obsolete("returnMoneyInMicros header was sunset in AdWords API version v201406. " + + "This method wlll be removed when AdWords API version v201402 is sunset. Use " + + "GetClientReport(T reportDefinition) instead.")] + public ClientReport GetClientReport(T reportDefinition, bool? returnMoneyInMicros) { + AdWordsAppConfig config = (AdWordsAppConfig) User.Config; + + string postBody = "__rdxml=" + HttpUtility.UrlEncode(ConvertDefinitionToXml( + reportDefinition)); + string downloadUrl = string.Format(ADHOC_REPORT_URL_FORMAT, config.AdWordsApiServer, + reportVersion); + return GetClientReportInternal(downloadUrl, postBody, returnMoneyInMicros); + } + + /// + /// Downloads a report to disk. + /// + /// The AWQL query for report definition. + /// The report format. + /// The path to which report should be downloaded. + /// + /// The client report. + public ClientReport DownloadClientReport(string query, string format, string path) { + return DownloadClientReport(query, format, null, path); + } + + /// + /// Downloads a report to disk. + /// + /// The AWQL query for report definition. + /// The report format. + /// The path to which report should be downloaded. + /// + /// True, if the money values in the + /// report should be returned as micros, False otherwise. + /// The client report. + [Obsolete("returnMoneyInMicros header was sunset in AdWords API version v201406. " + + "This method wlll be removed when AdWords API version v201402 is sunset. Use " + + "DownloadClientReport(string query, string format, string path) instead.")] + public ClientReport DownloadClientReport(string query, string format, + bool? returnMoneyInMicros, string path) { + AdWordsAppConfig config = (AdWordsAppConfig) User.Config; + string downloadUrl = string.Format(QUERY_REPORT_URL_FORMAT, config.AdWordsApiServer, + reportVersion, format); + string postData = string.Format("__rdquery={0}", HttpUtility.UrlEncode(query)); + return DownloadClientReportInternal(downloadUrl, postData, returnMoneyInMicros, path); + } + + /// + /// Downloads a report to disk. + /// + /// The report definition. + /// The path to which report should be downloaded. + /// + /// The client report. + public ClientReport DownloadClientReport(T reportDefinition, string path) { + return DownloadClientReport(reportDefinition, null, path); + } + + /// + /// Downloads a report to disk. + /// + /// The report definition. + /// True, if the money values in the + /// report should be returned as micros, False otherwise. + /// The path to which report should be downloaded. + /// + /// The client report. + [Obsolete("returnMoneyInMicros header was sunset in AdWords API version v201406. " + + "This method wlll be removed when AdWords API version v201402 is sunset. Use " + + "DownloadClientReport(T reportDefinition, string path) instead.")] + public ClientReport DownloadClientReport(T reportDefinition, bool? returnMoneyInMicros, + string path) { + AdWordsAppConfig config = (AdWordsAppConfig) User.Config; + + string postBody = "__rdxml=" + HttpUtility.UrlEncode(ConvertDefinitionToXml( + reportDefinition)); + string downloadUrl = string.Format(ADHOC_REPORT_URL_FORMAT, config.AdWordsApiServer, + reportVersion); + return DownloadClientReportInternal(downloadUrl, postBody, returnMoneyInMicros, path); + } + + /// + /// Downloads the client report. + /// + /// The download URL. + /// The HTTP POST request body. + /// True, if the money values in the + /// report should be returned as micros, False otherwise. + /// The path to which report should be downloaded. + /// + /// The client report. + private ClientReport GetClientReportInternal(string downloadUrl, string postBody, + bool? returnMoneyInMicros) { + MemoryStream memStream = new MemoryStream(); + DownloadReportToStream(downloadUrl, returnMoneyInMicros, postBody, memStream); + + ClientReport retval = new ClientReport(); + retval.Contents = memStream.ToArray(); + return retval; + } + + /// + /// Downloads the client report. + /// + /// The download URL. + /// The HTTP POST request body. + /// True, if the money values in the + /// report should be returned as micros, False otherwise. + /// The path to which report should be downloaded. + /// + /// The client report. + private ClientReport DownloadClientReportInternal(string downloadUrl, string postBody, + bool? returnMoneyInMicros, string path) { + ClientReport retval = new ClientReport(); + using (FileStream fileStream = File.OpenWrite(path)) { + fileStream.SetLength(0); + DownloadReportToStream(downloadUrl, returnMoneyInMicros, postBody, fileStream); + retval.Path = path; + return retval; + } + } + + /// + /// Downloads a report to stream. + /// + /// The download url. + /// True if money values are returned + /// in micros. + /// The POST body. + /// The stream to which report is downloaded. + /// + private void DownloadReportToStream(string downloadUrl, bool? returnMoneyInMicros, + string postBody, Stream outputStream) { + AdWordsErrorHandler errorHandler = new AdWordsErrorHandler(user); + while (true) { + WebResponse response = null; + HttpWebRequest request = BuildRequest(downloadUrl, returnMoneyInMicros, postBody); + try { + response = request.GetResponse(); + MediaUtilities.CopyStream(response.GetResponseStream(), outputStream); + return; + } catch (WebException ex) { + Exception reportsException = null; + + try { + response = ex.Response; + + if (response != null) { + MemoryStream memStream = new MemoryStream(); + MediaUtilities.CopyStream(response.GetResponseStream(), memStream); + String exceptionBody = Encoding.UTF8.GetString(memStream.ToArray()); + reportsException = ParseException(exceptionBody); + } + + if (AdWordsErrorHandler.IsCookieInvalidError(reportsException)) { + reportsException = new AdWordsCredentialsExpiredException( + request.Headers["Authorization"].Replace(CLIENT_LOGIN_PREFIX, "")); + } else if (AdWordsErrorHandler.IsOAuthTokenExpiredError(reportsException)) { + reportsException = new AdWordsCredentialsExpiredException( + request.Headers["Authorization"]); + } + } catch (Exception) { + reportsException = ex; + } + if (errorHandler.ShouldRetry(reportsException)) { + errorHandler.PrepareForRetry(reportsException); + } else { + throw reportsException; + } + } finally { + if (response != null) { + response.Close(); + } + } + } + } + + /// + /// Validates the version reqirements for returnMoneyInMicrosHeader. + /// + /// Thrown if returnMoneyInMicrosHeader + /// header is used in a version that doesn't support it. + private void ValidateVersionReqirementsForMoneyMicros() { + if (string.Compare(ReportVersion, LAST_VERSION_WITH_MONEY_MICROS_FLAG, true) > 0) { + throw new ReportsException(AdWordsErrorMessages.ReturnMoneyInMicrosNotSupported); + } + } + + /// + /// Builds an HTTP request for downloading reports. + /// + /// The download url. + /// True if money values are returned + /// in micros. + /// The POST body. + /// A webrequest to download reports. + private HttpWebRequest BuildRequest(string downloadUrl, bool? returnMoneyInMicros, + string postBody) { + AdWordsAppConfig config = user.Config as AdWordsAppConfig; + + HttpWebRequest request = (HttpWebRequest) HttpWebRequest.Create(downloadUrl); + request.Method = "POST"; + request.Proxy = config.Proxy; + request.Timeout = config.Timeout; + request.UserAgent = config.GetUserAgent(); + + request.Headers.Add("clientCustomerId: " + config.ClientCustomerId); + request.ContentType = "application/x-www-form-urlencoded"; + if (config.EnableGzipCompression) { + (request as HttpWebRequest).AutomaticDecompression = DecompressionMethods.GZip + | DecompressionMethods.Deflate; + } else { + (request as HttpWebRequest).AutomaticDecompression = DecompressionMethods.None; + } + if (config.AuthorizationMethod == AdWordsAuthorizationMethod.OAuth2) { + if (this.User.OAuthProvider != null) { + request.Headers["Authorization"] = this.User.OAuthProvider.GetAuthHeader(); + } else { + throw new AdWordsApiException(null, AdWordsErrorMessages.OAuthProviderCannotBeNull); + } + } else if (config.AuthorizationMethod == AdWordsAuthorizationMethod.ClientLogin) { + string authToken = (!string.IsNullOrEmpty(config.AuthToken)) ? config.AuthToken : + new AuthToken(config, AdWordsSoapClient.SERVICE_NAME).GetToken(); + request.Headers["Authorization"] = CLIENT_LOGIN_PREFIX + authToken; + } + + if (returnMoneyInMicros.HasValue) { + ValidateVersionReqirementsForMoneyMicros(); + request.Headers.Add("returnMoneyInMicros: " + returnMoneyInMicros.ToString().ToLower()); + } + request.Headers.Add("developerToken: " + config.DeveloperToken); + // The client library will use only apiMode = true. + request.Headers.Add("apiMode", "true"); + + using (StreamWriter writer = new StreamWriter(request.GetRequestStream())) { + writer.Write(postBody); + } + return request; + } + + /// + /// Parses the error response into an exception. + /// + /// The error response from the server. + /// + private ReportsException ParseException(string errorsXml) { + XmlDocument xDoc = new XmlDocument(); + xDoc.LoadXml(errorsXml); + XmlNodeList errorNodes = xDoc.DocumentElement.SelectNodes("ApiError"); + List errorList = new List(); + foreach (XmlElement errorNode in errorNodes) { + ReportDownloadError downloadError = new ReportDownloadError(); + downloadError.ErrorType = errorNode.SelectSingleNode("type").InnerText; + downloadError.FieldPath = errorNode.SelectSingleNode("fieldPath").InnerText; + downloadError.Trigger = errorNode.SelectSingleNode("trigger").InnerText; + + errorList.Add(downloadError); + } + ReportsException ex = new ReportsException("Report download errors occurred, see errors " + + "field for more details."); + ex.Errors = errorList.ToArray(); + return ex; + } + + /// + /// Converts the report definition to XML format. + /// + /// The type of ReportDefinition. + /// The report definition. + /// The report definition serialized as an xml. + private string ConvertDefinitionToXml(T definition) { + string xml = SerializationUtilities.SerializeAsXmlText(definition).Replace( + "ReportDefinition", "reportDefinition"); + XmlDocument doc = new XmlDocument(); + doc.LoadXml(xml); + XmlNodeList xmlNodes = doc.SelectNodes("descendant::*"); + foreach (XmlElement node in xmlNodes) { + node.RemoveAllAttributes(); + } + return doc.OuterXml; + } + } +} \ No newline at end of file diff --git a/src/AdWords/Util/Reports/ReportsException.cs b/src/AdWords/Util/Reports/ReportsException.cs new file mode 100644 index 00000000000..6eb9b87187a --- /dev/null +++ b/src/AdWords/Util/Reports/ReportsException.cs @@ -0,0 +1,98 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.Common.Util; + +using System; +using System.IO; +using System.Runtime.Serialization; +using System.Security.Permissions; +using System.Text; +using System.Xml.Serialization; + +namespace Google.Api.Ads.AdWords.Util.Reports { + /// + /// Custom exception class for handling reporting errors. + /// + [Serializable] + public class ReportsException : AdWordsException { + ReportDownloadError[] errors; + + public ReportDownloadError[] Errors { + get { + return errors; + } + set { + errors = value; + } + } + + /// + /// Public constructor. + /// + public ReportsException() : base() { + } + + /// + /// Public constructor. + /// + /// Error message for this API exception. + public ReportsException(string message) : base(message) { + } + + /// + /// Public constructor. + /// + /// Error message for this API exception. + /// Inner exception, if any. + public ReportsException(string message, Exception innerException) + : base(message, innerException) { + } + + /// + /// Protected constructor. Used by serialization frameworks while + /// deserializing an exception object. + /// + /// Info about the serialization context. + /// A streaming context that represents the + /// serialization stream. + protected ReportsException(SerializationInfo info, StreamingContext context) + : base(info, context) { + if (info != null) { + errors = (ReportDownloadError[]) info.GetValue("errors", typeof(ReportDownloadError[])); + } + } + + /// + /// This method is called by serialization frameworks while serializing + /// an exception object. + /// + /// Info about the serialization context. + /// A streaming context that represents the + /// serialization stream. + [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)] + public override void GetObjectData(SerializationInfo info, StreamingContext context) { + if (info == null) { + throw new ArgumentNullException("info"); + } + base.GetObjectData(info, context); + if (info != null) { + info.AddValue("errors", errors); + } + } + } +} diff --git a/src/AdWords/Util/v201309/MapUtilities.cs b/src/AdWords/Util/v201309/MapUtilities.cs new file mode 100644 index 00000000000..6e5c0f4e680 --- /dev/null +++ b/src/AdWords/Util/v201309/MapUtilities.cs @@ -0,0 +1,90 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.AdWords.Util.v201309 { + /// + /// Provides utility functions for creating and handling + /// String_StringMapEntry[] fields. + /// + public class MapUtilities { + /// + /// Dictionary to hold the key-value pairs. + /// + Dictionary values = new Dictionary(); + + /// + /// Adds the specified key to the map. + /// + /// The settings key. + /// The settings value. + /// The maputils instance, for chaining calls. + public MapUtilities Add(string key, string value) { + values[key] = value; + return this; + } + + /// + /// Adds the specified string map entry to the map. + /// + /// The string map entry. + /// The maputils instance, for chaining calls. + public MapUtilities AddEntry(String_StringMapEntry entry) { + values[entry.key] = entry.value; + return this; + } + + /// + /// Adds an array of string map entries to the map. + /// + /// The list of string map entries. + /// The maputils instance, for chaining calls. + public MapUtilities AddEntries(String_StringMapEntry[] entries) { + foreach (String_StringMapEntry entry in entries) { + AddEntry(entry); + } + return this; + } + + /// + /// Returns the settings as a list of string map entries. + /// + /// The settings, as a list of string map entries. + public String_StringMapEntry[] AsArray() { + List entries = new List(); + foreach (string key in values.Keys) { + String_StringMapEntry entry = new String_StringMapEntry(); + entry.key = key; + entry.value = values[key]; + entries.Add(entry); + } + return entries.ToArray(); + } + + /// + /// Returns the settings as a dictionary. + /// + /// The dictionary that contains the settings. + public Dictionary AsDict() { + return values; + } + } +} diff --git a/src/AdWords/Util/v201402/MapUtilities.cs b/src/AdWords/Util/v201402/MapUtilities.cs new file mode 100644 index 00000000000..f5b87d1e9c7 --- /dev/null +++ b/src/AdWords/Util/v201402/MapUtilities.cs @@ -0,0 +1,90 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.AdWords.Util.v201402 { + /// + /// Provides utility functions for creating and handling + /// String_StringMapEntry[] fields. + /// + public class MapUtilities { + /// + /// Dictionary to hold the key-value pairs. + /// + Dictionary values = new Dictionary(); + + /// + /// Adds the specified key to the map. + /// + /// The settings key. + /// The settings value. + /// The maputils instance, for chaining calls. + public MapUtilities Add(string key, string value) { + values[key] = value; + return this; + } + + /// + /// Adds the specified string map entry to the map. + /// + /// The string map entry. + /// The maputils instance, for chaining calls. + public MapUtilities AddEntry(String_StringMapEntry entry) { + values[entry.key] = entry.value; + return this; + } + + /// + /// Adds an array of string map entries to the map. + /// + /// The list of string map entries. + /// The maputils instance, for chaining calls. + public MapUtilities AddEntries(String_StringMapEntry[] entries) { + foreach (String_StringMapEntry entry in entries) { + AddEntry(entry); + } + return this; + } + + /// + /// Returns the settings as a list of string map entries. + /// + /// The settings, as a list of string map entries. + public String_StringMapEntry[] AsArray() { + List entries = new List(); + foreach (string key in values.Keys) { + String_StringMapEntry entry = new String_StringMapEntry(); + entry.key = key; + entry.value = values[key]; + entries.Add(entry); + } + return entries.ToArray(); + } + + /// + /// Returns the settings as a dictionary. + /// + /// The dictionary that contains the settings. + public Dictionary AsDict() { + return values; + } + } +} diff --git a/src/AdWords/Util/v201406/MapUtilities.cs b/src/AdWords/Util/v201406/MapUtilities.cs new file mode 100644 index 00000000000..e32f5402d77 --- /dev/null +++ b/src/AdWords/Util/v201406/MapUtilities.cs @@ -0,0 +1,90 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.AdWords.Util.v201406 { + /// + /// Provides utility functions for creating and handling + /// String_StringMapEntry[] fields. + /// + public class MapUtilities { + /// + /// Dictionary to hold the key-value pairs. + /// + Dictionary values = new Dictionary(); + + /// + /// Adds the specified key to the map. + /// + /// The settings key. + /// The settings value. + /// The maputils instance, for chaining calls. + public MapUtilities Add(string key, string value) { + values[key] = value; + return this; + } + + /// + /// Adds the specified string map entry to the map. + /// + /// The string map entry. + /// The maputils instance, for chaining calls. + public MapUtilities AddEntry(String_StringMapEntry entry) { + values[entry.key] = entry.value; + return this; + } + + /// + /// Adds an array of string map entries to the map. + /// + /// The list of string map entries. + /// The maputils instance, for chaining calls. + public MapUtilities AddEntries(String_StringMapEntry[] entries) { + foreach (String_StringMapEntry entry in entries) { + AddEntry(entry); + } + return this; + } + + /// + /// Returns the settings as a list of string map entries. + /// + /// The settings, as a list of string map entries. + public String_StringMapEntry[] AsArray() { + List entries = new List(); + foreach (string key in values.Keys) { + String_StringMapEntry entry = new String_StringMapEntry(); + entry.key = key; + entry.value = values[key]; + entries.Add(entry); + } + return entries.ToArray(); + } + + /// + /// Returns the settings as a dictionary. + /// + /// The dictionary that contains the settings. + public Dictionary AsDict() { + return values; + } + } +} diff --git a/src/AdWords/v201309/AdWordsApi.cs b/src/AdWords/v201309/AdWordsApi.cs new file mode 100644 index 00000000000..907b4f6bd90 --- /dev/null +++ b/src/AdWords/v201309/AdWordsApi.cs @@ -0,0 +1,31152 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +#pragma warning disable 1591 + +namespace Google.Api.Ads.AdWords.v201309 { + using Google.Api.Ads.AdWords.Headers; + using Google.Api.Ads.AdWords.Lib; + + using System.Web.Services.Protocols; + using System; + using System.ComponentModel; + using System.Diagnostics; + using System.Web.Services; + using System.Xml.Serialization; + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "BudgetServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class BudgetService : AdWordsSoapClient, IBudgetService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public BudgetService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/BudgetService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BudgetPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((BudgetPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BudgetReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +BudgetOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((BudgetReturnValue) (results[0])); + } + } + + + + + + + + + + + + + + + + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetReturnValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignAdExtensionReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignCriterionReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignFeedReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignSharedSetReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConversionTrackerReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupAdReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExperimentReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedItemReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedMappingReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupFeedReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OfflineConversionFeedReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedCriterionReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedSetReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoAdReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCampaignCriterionReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCampaignReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupCriterionReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingGroupCriterionReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingGroupReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupBidModifierReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddingStrategyReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetOrderReturnValue))] + public abstract partial class ListReturnValue { + private string listReturnValueTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ListReturnValue.Type")] + public string ListReturnValueType { + get { return this.listReturnValueTypeField; } + set { this.listReturnValueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BudgetReturnValue : ListReturnValue { + private Budget[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public Budget[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Budget { + private long budgetIdField; + + private bool budgetIdFieldSpecified; + + private string nameField; + + private BudgetBudgetPeriod periodField; + + private bool periodFieldSpecified; + + private Money amountField; + + private BudgetBudgetDeliveryMethod deliveryMethodField; + + private bool deliveryMethodFieldSpecified; + + private int referenceCountField; + + private bool referenceCountFieldSpecified; + + private bool isExplicitlySharedField; + + private bool isExplicitlySharedFieldSpecified; + + private BudgetBudgetStatus statusField; + + private bool statusFieldSpecified; + + public long budgetId { + get { return this.budgetIdField; } + set { + this.budgetIdField = value; + this.budgetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool budgetIdSpecified { + get { return this.budgetIdFieldSpecified; } + set { this.budgetIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public BudgetBudgetPeriod period { + get { return this.periodField; } + set { + this.periodField = value; + this.periodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool periodSpecified { + get { return this.periodFieldSpecified; } + set { this.periodFieldSpecified = value; } + } + + public Money amount { + get { return this.amountField; } + set { this.amountField = value; } + } + + public BudgetBudgetDeliveryMethod deliveryMethod { + get { return this.deliveryMethodField; } + set { + this.deliveryMethodField = value; + this.deliveryMethodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryMethodSpecified { + get { return this.deliveryMethodFieldSpecified; } + set { this.deliveryMethodFieldSpecified = value; } + } + + public int referenceCount { + get { return this.referenceCountField; } + set { + this.referenceCountField = value; + this.referenceCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool referenceCountSpecified { + get { return this.referenceCountFieldSpecified; } + set { this.referenceCountFieldSpecified = value; } + } + + public bool isExplicitlyShared { + get { return this.isExplicitlySharedField; } + set { + this.isExplicitlySharedField = value; + this.isExplicitlySharedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isExplicitlySharedSpecified { + get { return this.isExplicitlySharedFieldSpecified; } + set { this.isExplicitlySharedFieldSpecified = value; } + } + + public BudgetBudgetStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Budget.BudgetPeriod", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum BudgetBudgetPeriod { + DAILY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Money : ComparableValue { + private long microAmountField; + + private bool microAmountFieldSpecified; + + public long microAmount { + get { return this.microAmountField; } + set { + this.microAmountField = value; + this.microAmountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool microAmountSpecified { + get { return this.microAmountFieldSpecified; } + set { this.microAmountFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NumberValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DoubleValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Money))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public abstract partial class ComparableValue { + private string comparableValueTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ComparableValue.Type")] + public string ComparableValueType { + get { return this.comparableValueTypeField; } + set { this.comparableValueTypeField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DoubleValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public abstract partial class NumberValue : ComparableValue { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class LongValue : NumberValue { + private long numberField; + + private bool numberFieldSpecified; + + public long number { + get { return this.numberField; } + set { + this.numberField = value; + this.numberSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numberSpecified { + get { return this.numberFieldSpecified; } + set { this.numberFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class DoubleValue : NumberValue { + private double numberField; + + private bool numberFieldSpecified; + + public double number { + get { return this.numberField; } + set { + this.numberField = value; + this.numberSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numberSpecified { + get { return this.numberFieldSpecified; } + set { this.numberFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Budget.BudgetDeliveryMethod", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum BudgetBudgetDeliveryMethod { + STANDARD, + ACCELERATED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Budget.BudgetStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum BudgetBudgetStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DatabaseError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringLengthError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SizeLimitError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SelectorError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequestError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RejectedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReadOnlyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RateExceededError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RangeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(QuotaCheckError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperationAccessDenied))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NullError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NotWhitelistedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NotEmptyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NewEntityCreationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InternalApiError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IdError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EntityNotFound))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EntityCountLimitExceeded))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DistinctError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClientTermsError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AuthorizationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AuthenticationError))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RegionCodeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PagingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatorError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignAdExtensionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BetaError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdxError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExtensionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(QueryError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignCriterionLimitExceeded))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignCriterionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StatsQueryError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SettingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(QuotaError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ForwardCompatibilityError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddingTransitionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddingErrors))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FunctionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CollectionSizeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignFeedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignSharedSetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConversionTrackingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomerSyncError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PolicyViolationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MediaError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupAdCountLimitExceeded))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupAdError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DataError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExperimentServiceError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EntityAccessDenied))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedMappingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GeoLocationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LocationCriterionServiceError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManagedCustomerServiceError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudioError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionPolicyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(JobError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupCriterionLimitExceeded))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BulkMutateJobError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupServiceError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupCriterionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExtensionOverrideError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupFeedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OfflineConversionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MatchesRegexError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CurrencyCodeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReportDefinitionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedCriterionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedSetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TrafficEstimatorError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingIdeaError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserListError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoAdError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TimeSeriesError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SortingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SegmentationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReportError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PersistenceError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EntityNotFoundError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdsApiError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AccessError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCampaignCriterionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingGroupCriterionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCampaignError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoBudgetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoBiddingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoServiceError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingGroupError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExpressBusinessError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PromotionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdParamPolicyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdParamError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AlertError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddingStrategyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomerOrderLineError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetOrderError))] + public abstract partial class ApiError { + private string fieldPathField; + + private string triggerField; + + private string errorStringField; + + private string apiErrorTypeField; + + public string fieldPath { + get { return this.fieldPathField; } + set { this.fieldPathField = value; } + } + + public string trigger { + get { return this.triggerField; } + set { this.triggerField = value; } + } + + public string errorString { + get { return this.errorStringField; } + set { this.errorStringField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApiError.Type")] + public string ApiErrorType { + get { return this.apiErrorTypeField; } + set { this.apiErrorTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class DatabaseError : ApiError { + private DatabaseErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DatabaseErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DatabaseError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum DatabaseErrorReason { + CONCURRENT_MODIFICATION, + PERMISSION_DENIED, + CAMPAIGN_PRODUCT_NOT_SUPPORTED, + DUPLICATE_KEY, + DATABASE_ERROR, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class StringLengthError : ApiError { + private StringLengthErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StringLengthErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StringLengthError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum StringLengthErrorReason { + TOO_SHORT, + TOO_LONG + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class SizeLimitError : ApiError { + private SizeLimitErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SizeLimitErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SizeLimitError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum SizeLimitErrorReason { + REQUEST_SIZE_LIMIT_EXCEEDED, + RESPONSE_SIZE_LIMIT_EXCEEDED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class SelectorError : ApiError { + private SelectorErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SelectorErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SelectorError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum SelectorErrorReason { + INVALID_FIELD_NAME, + MISSING_FIELDS, + MISSING_PREDICATES, + OPERATOR_DOES_NOT_SUPPORT_MULTIPLE_VALUES, + INVALID_PREDICATE_ENUM_VALUE, + MISSING_PREDICATE_OPERATOR, + MISSING_PREDICATE_VALUES, + INVALID_PREDICATE_FIELD_NAME, + INVALID_PREDICATE_OPERATOR, + INVALID_FIELD_SELECTION, + INVALID_PREDICATE_VALUE, + INVALID_SORT_FIELD_NAME, + SELECTOR_ERROR, + FILTER_BY_DATE_RANGE_NOT_SUPPORTED, + START_INDEX_IS_TOO_HIGH, + UNKNOWN_ERROR + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class RequiredError : ApiError { + private RequiredErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum RequiredErrorReason { + REQUIRED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class RequestError : ApiError { + private RequestErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequestErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequestError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum RequestErrorReason { + UNKNOWN, + INVALID_INPUT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class RejectedError : ApiError { + private RejectedErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RejectedErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RejectedError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum RejectedErrorReason { + UNKNOWN_VALUE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ReadOnlyError : ApiError { + private ReadOnlyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReadOnlyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReadOnlyError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ReadOnlyErrorReason { + READ_ONLY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class RateExceededError : ApiError { + private RateExceededErrorReason reasonField; + + private bool reasonFieldSpecified; + + private string rateNameField; + + private string rateScopeField; + + private int retryAfterSecondsField; + + private bool retryAfterSecondsFieldSpecified; + + public RateExceededErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + public string rateName { + get { return this.rateNameField; } + set { this.rateNameField = value; } + } + + public string rateScope { + get { return this.rateScopeField; } + set { this.rateScopeField = value; } + } + + public int retryAfterSeconds { + get { return this.retryAfterSecondsField; } + set { + this.retryAfterSecondsField = value; + this.retryAfterSecondsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool retryAfterSecondsSpecified { + get { return this.retryAfterSecondsFieldSpecified; } + set { this.retryAfterSecondsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RateExceededError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum RateExceededErrorReason { + RATE_EXCEEDED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class RangeError : ApiError { + private RangeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RangeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RangeError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum RangeErrorReason { + TOO_LOW, + TOO_HIGH + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class QuotaCheckError : ApiError { + private QuotaCheckErrorReason reasonField; + + private bool reasonFieldSpecified; + + public QuotaCheckErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "QuotaCheckError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum QuotaCheckErrorReason { + INVALID_TOKEN_HEADER, + ACCOUNT_DELINQUENT, + ACCOUNT_INACCESSIBLE, + ACCOUNT_INACTIVE, + INCOMPLETE_SIGNUP, + INCOMPLETE_SIGNUP_LATEST_ADWORDS_API_TNC_NOT_AGREED, + INCOMPLETE_SIGNUP_NO_BILLING_INFO, + INCOMPLETE_SIGNUP_USER_INFO_MISSING, + INCOMPLETE_SIGNUP_USER_INFO_PENDING, + INCOMPLETE_SIGNUP_USER_INFO_REJECTED, + MONTHLY_BUDGET_REACHED, + QUOTA_EXCEEDED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class OperationAccessDenied : ApiError { + private OperationAccessDeniedReason reasonField; + + private bool reasonFieldSpecified; + + public OperationAccessDeniedReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OperationAccessDenied.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum OperationAccessDeniedReason { + ACTION_NOT_PERMITTED, + ADD_OPERATION_NOT_PERMITTED, + REMOVE_OPERATION_NOT_PERMITTED, + SET_OPERATION_NOT_PERMITTED, + MUTATE_ACTION_NOT_PERMITTED_FOR_CLIENT, + OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class NullError : ApiError { + private NullErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NullErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NullError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum NullErrorReason { + NULL_CONTENT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class NotWhitelistedError : ApiError { + private NotWhitelistedErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NotWhitelistedErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NotWhitelistedError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum NotWhitelistedErrorReason { + CUSTOMER_NOT_WHITELISTED_FOR_API + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class NotEmptyError : ApiError { + private NotEmptyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NotEmptyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NotEmptyError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum NotEmptyErrorReason { + EMPTY_LIST + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class NewEntityCreationError : ApiError { + private NewEntityCreationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NewEntityCreationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NewEntityCreationError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum NewEntityCreationErrorReason { + CANNOT_SET_ID_FOR_ADD + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class InternalApiError : ApiError { + private InternalApiErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InternalApiErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InternalApiError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum InternalApiErrorReason { + UNEXPECTED_INTERNAL_API_ERROR, + UNKNOWN, + DOWNTIME + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class IdError : ApiError { + private IdErrorReason reasonField; + + private bool reasonFieldSpecified; + + public IdErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "IdError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum IdErrorReason { + NOT_FOUND + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class EntityNotFound : ApiError { + private EntityNotFoundReason reasonField; + + private bool reasonFieldSpecified; + + public EntityNotFoundReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "EntityNotFound.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum EntityNotFoundReason { + INVALID_ID + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignCriterionLimitExceeded))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupAdCountLimitExceeded))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupCriterionLimitExceeded))] + public partial class EntityCountLimitExceeded : ApiError { + private EntityCountLimitExceededReason reasonField; + + private bool reasonFieldSpecified; + + private string enclosingIdField; + + private int limitField; + + private bool limitFieldSpecified; + + private string accountLimitTypeField; + + private int existingCountField; + + private bool existingCountFieldSpecified; + + public EntityCountLimitExceededReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + public string enclosingId { + get { return this.enclosingIdField; } + set { this.enclosingIdField = value; } + } + + public int limit { + get { return this.limitField; } + set { + this.limitField = value; + this.limitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool limitSpecified { + get { return this.limitFieldSpecified; } + set { this.limitFieldSpecified = value; } + } + + public string accountLimitType { + get { return this.accountLimitTypeField; } + set { this.accountLimitTypeField = value; } + } + + public int existingCount { + get { return this.existingCountField; } + set { + this.existingCountField = value; + this.existingCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool existingCountSpecified { + get { return this.existingCountFieldSpecified; } + set { this.existingCountFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "EntityCountLimitExceeded.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum EntityCountLimitExceededReason { + ACCOUNT_LIMIT, + CAMPAIGN_LIMIT, + ADGROUP_LIMIT, + ADGROUP_TEXT_AD_LIMIT, + ADGROUP_DISPLAY_AD_LIMIT, + MATCHING_FUNCTION_LIMIT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class DistinctError : ApiError { + private DistinctErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DistinctErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DistinctError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum DistinctErrorReason { + DUPLICATE_ELEMENT, + DUPLICATE_TYPE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class DateError : ApiError { + private DateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DateError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum DateErrorReason { + INVALID_FIELD_VALUES_IN_DATE, + INVALID_FIELD_VALUES_IN_DATE_TIME, + INVALID_STRING_DATE, + INVALID_STRING_DATE_RANGE, + INVALID_STRING_DATE_TIME, + EARLIER_THAN_MINIMUM_DATE, + LATER_THAN_MAXIMUM_DATE, + DATE_RANGE_MINIMUM_DATE_LATER_THAN_MAXIMUM_DATE, + DATE_RANGE_MINIMUM_AND_MAXIMUM_DATES_BOTH_NULL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ClientTermsError : ApiError { + private ClientTermsErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ClientTermsErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ClientTermsError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ClientTermsErrorReason { + INCOMPLETE_SIGNUP_CURRENT_ADWORDS_TNC_NOT_AGREED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BudgetError : ApiError { + private BudgetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BudgetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BudgetError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum BudgetErrorReason { + BUDGET_DELETED, + BUDGET_ERROR, + BUDGET_IN_USE, + BUDGET_PERIOD_NOT_AVAILABLE, + CANNOT_EDIT_SHARED_BUDGET, + CANNOT_MODIFY_FIELD_OF_IMPLICITLY_SHARED_BUDGET, + CANNOT_UPDATE_BUDGET_TO_IMPLICITLY_SHARED, + CANNOT_USE_IMPLICITLY_SHARED_BUDGET_WITH_MULTIPLE_CAMPAIGNS, + DUPLICATE_NAME, + MONEY_AMOUNT_IN_WRONG_CURRENCY, + MONEY_AMOUNT_LESS_THAN_CURRENCY_MINIMUM_CPC, + MONEY_AMOUNT_TOO_LARGE, + NEGATIVE_MONEY_AMOUNT, + NON_MULTIPLE_OF_MINIMUM_CURRENCY_UNIT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AuthorizationError : ApiError { + private AuthorizationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AuthorizationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AuthorizationError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AuthorizationErrorReason { + UNABLE_TO_AUTHORIZE, + NO_ADWORDS_ACCOUNT_FOR_CUSTOMER, + USER_PERMISSION_DENIED, + EFFECTIVE_USER_PERMISSION_DENIED, + USER_HAS_READONLY_PERMISSION, + NO_CUSTOMER_FOUND, + SERVICE_ACCESS_DENIED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AuthenticationError : ApiError { + private AuthenticationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AuthenticationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AuthenticationError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AuthenticationErrorReason { + AUTHENTICATION_FAILED, + CLIENT_CUSTOMER_ID_IS_REQUIRED, + CLIENT_EMAIL_REQUIRED, + CLIENT_CUSTOMER_ID_INVALID, + CLIENT_EMAIL_INVALID, + CLIENT_EMAIL_FAILED_TO_AUTHENTICATE, + CUSTOMER_NOT_FOUND, + GOOGLE_ACCOUNT_DELETED, + GOOGLE_ACCOUNT_COOKIE_INVALID, + FAILED_TO_AUTHENTICATE_GOOGLE_ACCOUNT, + GOOGLE_ACCOUNT_USER_AND_ADS_USER_MISMATCH, + LOGIN_COOKIE_REQUIRED, + NOT_ADS_USER, + OAUTH_TOKEN_INVALID, + OAUTH_TOKEN_EXPIRED, + OAUTH_TOKEN_DISABLED, + OAUTH_TOKEN_REVOKED, + OAUTH_TOKEN_HEADER_INVALID, + LOGIN_COOKIE_INVALID, + FAILED_TO_RETRIEVE_LOGIN_COOKIE, + USER_ID_INVALID + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetOperation))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignAdExtensionOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignCriterionOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignFeedOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignSharedSetOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConversionTrackerOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupAdOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExperimentOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedItemOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedMappingOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManagedCustomerOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MoveOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LinkOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignTargetOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupCriterionOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupBidModifierOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExtensionOverrideOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupFeedOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OfflineConversionFeedOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedCriterionOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedSetOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserListOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoAdOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCampaignCriterionOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCampaignOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCallToActionOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingGroupCriterionOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingGroupOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExpressBusinessOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PromotionOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdParamOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddingStrategyOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetOrderOperation))] + public abstract partial class Operation { + private Operator operatorField; + + private bool operatorFieldSpecified; + + private string operationTypeField; + + public Operator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Operation.Type")] + public string OperationType { + get { return this.operationTypeField; } + set { this.operationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum Operator { + ADD, + REMOVE, + SET + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BudgetOperation : Operation { + private Budget operandField; + + public Budget operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetPage))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignAdExtensionPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignCriterionPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NullStatsPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignFeedPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignSharedSetPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NoStatsPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConversionTrackerPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupAdPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionBidLandscapePage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupBidLandscapePage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExperimentPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedItemPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedMappingPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManagedCustomerPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupFeedPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedCriterionPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedSetPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserListPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoAdPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCampaignReportPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCampaignCriterionPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCampaignPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupCriterionPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoSearchPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingGroupReportPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingGroupCriterionPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingGroupPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExpressNoStatsPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExpressBusinessPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PromotionPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductServicePage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupBidModifierPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(McmNoStatsPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AlertPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddingStrategyPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetOrderPage))] + public abstract partial class Page { + private int totalNumEntriesField; + + private bool totalNumEntriesFieldSpecified; + + private string pageTypeField; + + public int totalNumEntries { + get { return this.totalNumEntriesField; } + set { + this.totalNumEntriesField = value; + this.totalNumEntriesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalNumEntriesSpecified { + get { return this.totalNumEntriesFieldSpecified; } + set { this.totalNumEntriesFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Page.Type")] + public string PageType { + get { return this.pageTypeField; } + set { this.pageTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BudgetPage : Page { + private Budget[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Budget[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Paging { + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int numberResultsField; + + private bool numberResultsFieldSpecified; + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int numberResults { + get { return this.numberResultsField; } + set { + this.numberResultsField = value; + this.numberResultsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numberResultsSpecified { + get { return this.numberResultsFieldSpecified; } + set { this.numberResultsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class OrderBy { + private string fieldField; + + private SortOrder sortOrderField; + + private bool sortOrderFieldSpecified; + + public string field { + get { return this.fieldField; } + set { this.fieldField = value; } + } + + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { + this.sortOrderField = value; + this.sortOrderSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sortOrderSpecified { + get { return this.sortOrderFieldSpecified; } + set { this.sortOrderFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum SortOrder { + ASCENDING, + DESCENDING + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class DateRange { + private string minField; + + private string maxField; + + public string min { + get { return this.minField; } + set { this.minField = value; } + } + + public string max { + get { return this.maxField; } + set { this.maxField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Predicate { + private string fieldField; + + private PredicateOperator operatorField; + + private bool operatorFieldSpecified; + + private string[] valuesField; + + public string field { + get { return this.fieldField; } + set { this.fieldField = value; } + } + + public PredicateOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("values")] + public string[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Predicate.Operator", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum PredicateOperator { + EQUALS, + NOT_EQUALS, + IN, + NOT_IN, + GREATER_THAN, + GREATER_THAN_EQUALS, + LESS_THAN, + LESS_THAN_EQUALS, + STARTS_WITH, + STARTS_WITH_IGNORE_CASE, + CONTAINS, + CONTAINS_IGNORE_CASE, + DOES_NOT_CONTAIN, + DOES_NOT_CONTAIN_IGNORE_CASE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Selector { + private string[] fieldsField; + + private Predicate[] predicatesField; + + private DateRange dateRangeField; + + private OrderBy[] orderingField; + + private Paging pagingField; + + [System.Xml.Serialization.XmlElementAttribute("fields")] + public string[] fields { + get { return this.fieldsField; } + set { this.fieldsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("predicates")] + public Predicate[] predicates { + get { return this.predicatesField; } + set { this.predicatesField = value; } + } + + public DateRange dateRange { + get { return this.dateRangeField; } + set { this.dateRangeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ordering")] + public OrderBy[] ordering { + get { return this.orderingField; } + set { this.orderingField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApiException))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ApplicationException { + private string messageField; + + private string applicationExceptionTypeField; + + public string message { + get { return this.messageField; } + set { this.messageField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApplicationException.Type")] + public string ApplicationExceptionType { + get { return this.applicationExceptionTypeField; } + set { this.applicationExceptionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ApiException : ApplicationException { + private ApiError[] errorsField; + + [System.Xml.Serialization.XmlElementAttribute("errors")] + public ApiError[] errors { + get { return this.errorsField; } + set { this.errorsField = value; } + } + } + + + + + + + + + + + + + + + + + + + + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CampaignAdExtensionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CampaignAdExtensionService : AdWordsSoapClient, ICampaignAdExtensionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CampaignAdExtensionService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/CampaignAdExtensionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignAdExtensionPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((CampaignAdExtensionPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignAdExtensionReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +CampaignAdExtensionOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((CampaignAdExtensionReturnValue) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignAdExtensionReturnValue : ListReturnValue { + private CampaignAdExtension[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public CampaignAdExtension[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignAdExtension { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private AdExtension adExtensionField; + + private CampaignAdExtensionStatus statusField; + + private bool statusFieldSpecified; + + private CampaignAdExtensionApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public AdExtension adExtension { + get { return this.adExtensionField; } + set { this.adExtensionField = value; } + } + + public CampaignAdExtensionStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public CampaignAdExtensionApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LocationSyncExtension))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LocationExtension))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SitelinksExtension))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileExtension))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InAppLinkExtension))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DomainInfoExtension))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdExtension { + private long idField; + + private bool idFieldSpecified; + + private string adExtensionTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("AdExtension.Type")] + public string AdExtensionType { + get { return this.adExtensionTypeField; } + set { this.adExtensionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class LocationSyncExtension : AdExtension { + private string emailField; + + private string authTokenField; + + private OAuthInfo oAuthInfoField; + + private long iconMediaIdField; + + private bool iconMediaIdFieldSpecified; + + private bool shouldSyncUrlField; + + private bool shouldSyncUrlFieldSpecified; + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public string authToken { + get { return this.authTokenField; } + set { this.authTokenField = value; } + } + + public OAuthInfo oAuthInfo { + get { return this.oAuthInfoField; } + set { this.oAuthInfoField = value; } + } + + public long iconMediaId { + get { return this.iconMediaIdField; } + set { + this.iconMediaIdField = value; + this.iconMediaIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool iconMediaIdSpecified { + get { return this.iconMediaIdFieldSpecified; } + set { this.iconMediaIdFieldSpecified = value; } + } + + public bool shouldSyncUrl { + get { return this.shouldSyncUrlField; } + set { + this.shouldSyncUrlField = value; + this.shouldSyncUrlSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool shouldSyncUrlSpecified { + get { return this.shouldSyncUrlFieldSpecified; } + set { this.shouldSyncUrlFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class OAuthInfo { + private string httpMethodField; + + private string httpRequestUrlField; + + private string httpAuthorizationHeaderField; + + public string httpMethod { + get { return this.httpMethodField; } + set { this.httpMethodField = value; } + } + + public string httpRequestUrl { + get { return this.httpRequestUrlField; } + set { this.httpRequestUrlField = value; } + } + + public string httpAuthorizationHeader { + get { return this.httpAuthorizationHeaderField; } + set { this.httpAuthorizationHeaderField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class LocationExtension : AdExtension { + private Address addressField; + + private GeoPoint geoPointField; + + private byte[] encodedLocationField; + + private string companyNameField; + + private string phoneNumberField; + + private LocationExtensionSource sourceField; + + private bool sourceFieldSpecified; + + private long iconMediaIdField; + + private bool iconMediaIdFieldSpecified; + + private long imageMediaIdField; + + private bool imageMediaIdFieldSpecified; + + public Address address { + get { return this.addressField; } + set { this.addressField = value; } + } + + public GeoPoint geoPoint { + get { return this.geoPointField; } + set { this.geoPointField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] encodedLocation { + get { return this.encodedLocationField; } + set { this.encodedLocationField = value; } + } + + public string companyName { + get { return this.companyNameField; } + set { this.companyNameField = value; } + } + + public string phoneNumber { + get { return this.phoneNumberField; } + set { this.phoneNumberField = value; } + } + + public LocationExtensionSource source { + get { return this.sourceField; } + set { + this.sourceField = value; + this.sourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sourceSpecified { + get { return this.sourceFieldSpecified; } + set { this.sourceFieldSpecified = value; } + } + + public long iconMediaId { + get { return this.iconMediaIdField; } + set { + this.iconMediaIdField = value; + this.iconMediaIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool iconMediaIdSpecified { + get { return this.iconMediaIdFieldSpecified; } + set { this.iconMediaIdFieldSpecified = value; } + } + + public long imageMediaId { + get { return this.imageMediaIdField; } + set { + this.imageMediaIdField = value; + this.imageMediaIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool imageMediaIdSpecified { + get { return this.imageMediaIdFieldSpecified; } + set { this.imageMediaIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Address { + private string streetAddressField; + + private string streetAddress2Field; + + private string cityNameField; + + private string provinceCodeField; + + private string provinceNameField; + + private string postalCodeField; + + private string countryCodeField; + + public string streetAddress { + get { return this.streetAddressField; } + set { this.streetAddressField = value; } + } + + public string streetAddress2 { + get { return this.streetAddress2Field; } + set { this.streetAddress2Field = value; } + } + + public string cityName { + get { return this.cityNameField; } + set { this.cityNameField = value; } + } + + public string provinceCode { + get { return this.provinceCodeField; } + set { this.provinceCodeField = value; } + } + + public string provinceName { + get { return this.provinceNameField; } + set { this.provinceNameField = value; } + } + + public string postalCode { + get { return this.postalCodeField; } + set { this.postalCodeField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class GeoPoint { + private int latitudeInMicroDegreesField; + + private bool latitudeInMicroDegreesFieldSpecified; + + private int longitudeInMicroDegreesField; + + private bool longitudeInMicroDegreesFieldSpecified; + + public int latitudeInMicroDegrees { + get { return this.latitudeInMicroDegreesField; } + set { + this.latitudeInMicroDegreesField = value; + this.latitudeInMicroDegreesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool latitudeInMicroDegreesSpecified { + get { return this.latitudeInMicroDegreesFieldSpecified; } + set { this.latitudeInMicroDegreesFieldSpecified = value; } + } + + public int longitudeInMicroDegrees { + get { return this.longitudeInMicroDegreesField; } + set { + this.longitudeInMicroDegreesField = value; + this.longitudeInMicroDegreesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool longitudeInMicroDegreesSpecified { + get { return this.longitudeInMicroDegreesFieldSpecified; } + set { this.longitudeInMicroDegreesFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LocationExtension.Source", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum LocationExtensionSource { + ADWORDS_FRONTEND, + LBC_SYNC + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class SitelinksExtension : AdExtension { + private Sitelink[] sitelinksField; + + [System.Xml.Serialization.XmlElementAttribute("sitelinks")] + public Sitelink[] sitelinks { + get { return this.sitelinksField; } + set { this.sitelinksField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Sitelink { + private string displayTextField; + + private string destinationUrlField; + + public string displayText { + get { return this.displayTextField; } + set { this.displayTextField = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class MobileExtension : AdExtension { + private string phoneNumberField; + + private string countryCodeField; + + private bool isCallTrackingEnabledField; + + private bool isCallTrackingEnabledFieldSpecified; + + private bool isCallOnlyField; + + private bool isCallOnlyFieldSpecified; + + public string phoneNumber { + get { return this.phoneNumberField; } + set { this.phoneNumberField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + + public bool isCallTrackingEnabled { + get { return this.isCallTrackingEnabledField; } + set { + this.isCallTrackingEnabledField = value; + this.isCallTrackingEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isCallTrackingEnabledSpecified { + get { return this.isCallTrackingEnabledFieldSpecified; } + set { this.isCallTrackingEnabledFieldSpecified = value; } + } + + public bool isCallOnly { + get { return this.isCallOnlyField; } + set { + this.isCallOnlyField = value; + this.isCallOnlySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isCallOnlySpecified { + get { return this.isCallOnlyFieldSpecified; } + set { this.isCallOnlyFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class InAppLinkExtension : AdExtension { + private string inAppLinkTextField; + + private string inAppLinkUrlField; + + private InAppLinkExtensionAppStore appStoreField; + + private bool appStoreFieldSpecified; + + private string appIdField; + + public string inAppLinkText { + get { return this.inAppLinkTextField; } + set { this.inAppLinkTextField = value; } + } + + public string inAppLinkUrl { + get { return this.inAppLinkUrlField; } + set { this.inAppLinkUrlField = value; } + } + + public InAppLinkExtensionAppStore appStore { + get { return this.appStoreField; } + set { + this.appStoreField = value; + this.appStoreSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool appStoreSpecified { + get { return this.appStoreFieldSpecified; } + set { this.appStoreFieldSpecified = value; } + } + + public string appId { + get { return this.appIdField; } + set { this.appIdField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InAppLinkExtension.AppStore", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum InAppLinkExtensionAppStore { + GOOGLE_PLAY, + ITUNES + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class DomainInfoExtension : AdExtension { + private string domainNameField; + + private string languageCodeField; + + public string domainName { + get { return this.domainNameField; } + set { this.domainNameField = value; } + } + + public string languageCode { + get { return this.languageCodeField; } + set { this.languageCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignAdExtension.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum CampaignAdExtensionStatus { + ACTIVE, + DELETED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignAdExtension.ApprovalStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum CampaignAdExtensionApprovalStatus { + APPROVED, + UNCHECKED, + DISAPPROVED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class RegionCodeError : ApiError { + private RegionCodeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RegionCodeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RegionCodeError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum RegionCodeErrorReason { + INVALID_REGION_CODE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class PagingError : ApiError { + private PagingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PagingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PagingError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum PagingErrorReason { + START_INDEX_CANNOT_BE_NEGATIVE, + NUMBER_OF_RESULTS_CANNOT_BE_NEGATIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class OperatorError : ApiError { + private OperatorErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OperatorErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OperatorError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum OperatorErrorReason { + OPERATOR_NOT_SUPPORTED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignAdExtensionError : ApiError { + private CampaignAdExtensionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CampaignAdExtensionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignAdExtensionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum CampaignAdExtensionErrorReason { + ADEXTENSION_NOT_UNDER_CAMPAIGN, + CANNOT_ADD_DELETED_CAMPAIGN_ADEXTENSION, + CANNOT_OPERATE_ON_DELETED_CAMPAIGN_ADEXTENSION, + INVALID_ADEXTENSION_ID, + MISSING_ADEXTENSION_ID, + MUST_USE_CONCRETE_ADEXTENSION_DURING_ADD, + MUST_USE_CONCRETE_ADEXTENSION, + UNKNOWN_ERROR + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BetaError : ApiError { + private BetaErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BetaErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BetaError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum BetaErrorReason { + BETA_FEATURE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdxError : ApiError { + private AdxErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdxErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdxError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AdxErrorReason { + UNSUPPORTED_FEATURE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdExtensionError : ApiError { + private AdExtensionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdExtensionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdExtensionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AdExtensionErrorReason { + ACCOUNT_DELETED, + AD_EXTENSION_NO_LONGER_ACTIVE, + CANNOT_HAVE_MULTIPLE_LOCATION_SYNC_EXTENSIONS_PER_CAMPAIGN, + CANNOT_HAVE_MULTIPLE_MOBILE_EXTENSIONS_PER_CAMPAIGN, + CANNOT_HAVE_MULTIPLE_PRODUCT_EXTENSIONS_PER_CAMPAIGN, + CANNOT_HAVE_MULTIPLE_SITELINKS_EXTENSIONS_PER_CAMPAIGN, + CANNOT_HAVE_MULTIPLE_IN_APP_LINK_EXTENSIONS_PER_CAMPAIGN_PER_APPSTORE, + INVALID_ADEXTENSION_TYPE, + INVALID_AUTH_TOKEN_FOR_EMAIL, + INVALID_COUNTRY_CODE, + INVALID_DOMESTIC_PHONE_NUMBER_FORMAT, + INVALID_DESTINATION_URL, + INVALID_EMAIL, + INVALID_ENCODED_LOCATION, + INVALID_ENUM_CONDITION_OPERATOR, + INVALID_ICON_DIMENSIONS, + INVALID_ID, + INVALID_IMAGE_DIMENSIONS, + INVALID_INPUT, + INVALID_LATITUDE, + INVALID_LONGITUDE, + INVALID_PHONE_NUMBER, + INVALID_STRING_CONDITION_OPERATOR, + INVALID_TOLL_PHONE_NUMBER_FORMAT, + MEDIA_DOES_NOT_BELONG_TO_ACCOUNT, + MEDIA_NOT_ICON_TYPE, + MEDIA_NOT_IMAGE_TYPE, + MISSING_ADVERTISER_NAME, + MISSING_AUTH_TOKEN, + MISSING_COUNTRY_CODE, + MISSING_CITY_NAME, + MISSING_EMAIL, + MISSING_ENCODED_LOCATION, + MISSING_CONDITION_OPERAND, + MISSING_CONDITION_STRING_VALUE, + MISSING_POSTAL_CODE, + MISSING_STREET_ADDRESS, + NUM_AND_GROUPS_OVER_LIMIT, + NUM_CONDITIONS_OVER_LIMIT, + NUM_LOCATION_EXTENSIONS_OVER_LIMIT, + NOT_AUTHORIZED_TO_CREATE_EXTENSION, + PHONE_NUMBER_NOT_SUPPORTED_FOR_COUNTRY, + DISALLOWED_NUMBER_TYPE, + PREMIUM_RATE_NUMBER_NOT_ALLOWED, + TOO_LONG, + USER_NOT_PERMITTED_TO_CREATE_LBC_SYNC_LOCATION_EXTENSION + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignAdExtensionOperation : Operation { + private CampaignAdExtension operandField; + + public CampaignAdExtension operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignAdExtensionPage : Page { + private CampaignAdExtension[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public CampaignAdExtension[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CampaignCriterionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CampaignCriterionService : AdWordsSoapClient, ICampaignCriterionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CampaignCriterionService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/CampaignCriterionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignCriterionPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((CampaignCriterionPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignCriterionReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +CampaignCriterionOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((CampaignCriterionReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignCriterionPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((CampaignCriterionPage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignCriterionReturnValue : ListReturnValue { + private CampaignCriterion[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public CampaignCriterion[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NegativeCampaignCriterion))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignCriterion { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private bool isNegativeField; + + private bool isNegativeFieldSpecified; + + private Criterion criterionField; + + private double bidModifierField; + + private bool bidModifierFieldSpecified; + + private String_StringMapEntry[] forwardCompatibilityMapField; + + private string campaignCriterionTypeField; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public bool isNegative { + get { return this.isNegativeField; } + set { + this.isNegativeField = value; + this.isNegativeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isNegativeSpecified { + get { return this.isNegativeFieldSpecified; } + set { this.isNegativeFieldSpecified = value; } + } + + public Criterion criterion { + get { return this.criterionField; } + set { this.criterionField = value; } + } + + public double bidModifier { + get { return this.bidModifierField; } + set { + this.bidModifierField = value; + this.bidModifierSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidModifierSpecified { + get { return this.bidModifierFieldSpecified; } + set { this.bidModifierFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("forwardCompatibilityMap")] + public String_StringMapEntry[] forwardCompatibilityMap { + get { return this.forwardCompatibilityMapField; } + set { this.forwardCompatibilityMapField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("CampaignCriterion.Type")] + public string CampaignCriterionType { + get { return this.campaignCriterionTypeField; } + set { this.campaignCriterionTypeField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Webpage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Vertical))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionUserList))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionUserInterest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Proximity))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Product))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Platform))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Placement))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystemVersion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileDevice))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileApplication))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileAppCategory))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Location))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Language))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Keyword))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Gender))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentLabel))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Carrier))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AgeRange))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSchedule))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NegativeKeyword))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductService))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NegativeCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(KeywordSet))] + public partial class Criterion { + private long idField; + + private bool idFieldSpecified; + + private CriterionType typeField; + + private bool typeFieldSpecified; + + private string criterionTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public CriterionType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Criterion.Type")] + public string CriterionType { + get { return this.criterionTypeField; } + set { this.criterionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Criterion.Type", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum CriterionType { + CONTENT_LABEL, + KEYWORD, + PLACEMENT, + VERTICAL, + USER_LIST, + USER_INTEREST, + MOBILE_APPLICATION, + MOBILE_APP_CATEGORY, + PRODUCT, + WEBPAGE, + LANGUAGE, + LOCATION, + AGE_RANGE, + CARRIER, + OPERATING_SYSTEM_VERSION, + MOBILE_DEVICE, + GENDER, + PROXIMITY, + PLATFORM, + AD_SCHEDULE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Webpage : Criterion { + private WebpageParameter parameterField; + + private double criteriaCoverageField; + + private bool criteriaCoverageFieldSpecified; + + private string[] criteriaSamplesField; + + public WebpageParameter parameter { + get { return this.parameterField; } + set { this.parameterField = value; } + } + + public double criteriaCoverage { + get { return this.criteriaCoverageField; } + set { + this.criteriaCoverageField = value; + this.criteriaCoverageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criteriaCoverageSpecified { + get { return this.criteriaCoverageFieldSpecified; } + set { this.criteriaCoverageFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("criteriaSamples")] + public string[] criteriaSamples { + get { return this.criteriaSamplesField; } + set { this.criteriaSamplesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class WebpageParameter : CriterionParameter { + private string criterionNameField; + + private WebpageCondition[] conditionsField; + + public string criterionName { + get { return this.criterionNameField; } + set { this.criterionNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("conditions")] + public WebpageCondition[] conditions { + get { return this.conditionsField; } + set { this.conditionsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class WebpageCondition { + private WebpageConditionOperand operandField; + + private bool operandFieldSpecified; + + private string argumentField; + + public WebpageConditionOperand operand { + get { return this.operandField; } + set { + this.operandField = value; + this.operandSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operandSpecified { + get { return this.operandFieldSpecified; } + set { this.operandFieldSpecified = value; } + } + + public string argument { + get { return this.argumentField; } + set { this.argumentField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum WebpageConditionOperand { + URL, + CATEGORY, + PAGE_TITLE, + PAGE_CONTENT, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WebpageParameter))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public abstract partial class CriterionParameter { + private string criterionParameterTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CriterionParameter.Type")] + public string CriterionParameterType { + get { return this.criterionParameterTypeField; } + set { this.criterionParameterTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Vertical : Criterion { + private long verticalIdField; + + private bool verticalIdFieldSpecified; + + private long verticalParentIdField; + + private bool verticalParentIdFieldSpecified; + + private string[] pathField; + + public long verticalId { + get { return this.verticalIdField; } + set { + this.verticalIdField = value; + this.verticalIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool verticalIdSpecified { + get { return this.verticalIdFieldSpecified; } + set { this.verticalIdFieldSpecified = value; } + } + + public long verticalParentId { + get { return this.verticalParentIdField; } + set { + this.verticalParentIdField = value; + this.verticalParentIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool verticalParentIdSpecified { + get { return this.verticalParentIdFieldSpecified; } + set { this.verticalParentIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("path")] + public string[] path { + get { return this.pathField; } + set { this.pathField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CriterionUserList : Criterion { + private long userListIdField; + + private bool userListIdFieldSpecified; + + private string userListNameField; + + private CriterionUserListMembershipStatus userListMembershipStatusField; + + private bool userListMembershipStatusFieldSpecified; + + public long userListId { + get { return this.userListIdField; } + set { + this.userListIdField = value; + this.userListIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userListIdSpecified { + get { return this.userListIdFieldSpecified; } + set { this.userListIdFieldSpecified = value; } + } + + public string userListName { + get { return this.userListNameField; } + set { this.userListNameField = value; } + } + + public CriterionUserListMembershipStatus userListMembershipStatus { + get { return this.userListMembershipStatusField; } + set { + this.userListMembershipStatusField = value; + this.userListMembershipStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userListMembershipStatusSpecified { + get { return this.userListMembershipStatusFieldSpecified; } + set { this.userListMembershipStatusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CriterionUserList.MembershipStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum CriterionUserListMembershipStatus { + OPEN, + CLOSED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CriterionUserInterest : Criterion { + private long userInterestIdField; + + private bool userInterestIdFieldSpecified; + + private string userInterestNameField; + + public long userInterestId { + get { return this.userInterestIdField; } + set { + this.userInterestIdField = value; + this.userInterestIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userInterestIdSpecified { + get { return this.userInterestIdFieldSpecified; } + set { this.userInterestIdFieldSpecified = value; } + } + + public string userInterestName { + get { return this.userInterestNameField; } + set { this.userInterestNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Proximity : Criterion { + private GeoPoint geoPointField; + + private ProximityDistanceUnits radiusDistanceUnitsField; + + private bool radiusDistanceUnitsFieldSpecified; + + private double radiusInUnitsField; + + private bool radiusInUnitsFieldSpecified; + + private Address addressField; + + public GeoPoint geoPoint { + get { return this.geoPointField; } + set { this.geoPointField = value; } + } + + public ProximityDistanceUnits radiusDistanceUnits { + get { return this.radiusDistanceUnitsField; } + set { + this.radiusDistanceUnitsField = value; + this.radiusDistanceUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool radiusDistanceUnitsSpecified { + get { return this.radiusDistanceUnitsFieldSpecified; } + set { this.radiusDistanceUnitsFieldSpecified = value; } + } + + public double radiusInUnits { + get { return this.radiusInUnitsField; } + set { + this.radiusInUnitsField = value; + this.radiusInUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool radiusInUnitsSpecified { + get { return this.radiusInUnitsFieldSpecified; } + set { this.radiusInUnitsFieldSpecified = value; } + } + + public Address address { + get { return this.addressField; } + set { this.addressField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Proximity.DistanceUnits", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ProximityDistanceUnits { + KILOMETERS, + MILES + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Product : Criterion { + private ProductCondition[] conditionsField; + + private string textField; + + [System.Xml.Serialization.XmlElementAttribute("conditions")] + public ProductCondition[] conditions { + get { return this.conditionsField; } + set { this.conditionsField = value; } + } + + public string text { + get { return this.textField; } + set { this.textField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ProductCondition { + private string argumentField; + + private ProductConditionOperand operandField; + + public string argument { + get { return this.argumentField; } + set { this.argumentField = value; } + } + + public ProductConditionOperand operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ProductConditionOperand { + private string operandField; + + public string operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Platform : Criterion { + private string platformNameField; + + public string platformName { + get { return this.platformNameField; } + set { this.platformNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Placement : Criterion { + private string urlField; + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class OperatingSystemVersion : Criterion { + private string nameField; + + private int osMajorVersionField; + + private bool osMajorVersionFieldSpecified; + + private int osMinorVersionField; + + private bool osMinorVersionFieldSpecified; + + private OperatingSystemVersionOperatorType operatorTypeField; + + private bool operatorTypeFieldSpecified; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public int osMajorVersion { + get { return this.osMajorVersionField; } + set { + this.osMajorVersionField = value; + this.osMajorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool osMajorVersionSpecified { + get { return this.osMajorVersionFieldSpecified; } + set { this.osMajorVersionFieldSpecified = value; } + } + + public int osMinorVersion { + get { return this.osMinorVersionField; } + set { + this.osMinorVersionField = value; + this.osMinorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool osMinorVersionSpecified { + get { return this.osMinorVersionFieldSpecified; } + set { this.osMinorVersionFieldSpecified = value; } + } + + public OperatingSystemVersionOperatorType operatorType { + get { return this.operatorTypeField; } + set { + this.operatorTypeField = value; + this.operatorTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorTypeSpecified { + get { return this.operatorTypeFieldSpecified; } + set { this.operatorTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OperatingSystemVersion.OperatorType", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum OperatingSystemVersionOperatorType { + GREATER_THAN_EQUAL_TO, + EQUAL_TO, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class MobileDevice : Criterion { + private string deviceNameField; + + private string manufacturerNameField; + + private MobileDeviceDeviceType deviceTypeField; + + private bool deviceTypeFieldSpecified; + + private string operatingSystemNameField; + + public string deviceName { + get { return this.deviceNameField; } + set { this.deviceNameField = value; } + } + + public string manufacturerName { + get { return this.manufacturerNameField; } + set { this.manufacturerNameField = value; } + } + + public MobileDeviceDeviceType deviceType { + get { return this.deviceTypeField; } + set { + this.deviceTypeField = value; + this.deviceTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deviceTypeSpecified { + get { return this.deviceTypeFieldSpecified; } + set { this.deviceTypeFieldSpecified = value; } + } + + public string operatingSystemName { + get { return this.operatingSystemNameField; } + set { this.operatingSystemNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "MobileDevice.DeviceType", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum MobileDeviceDeviceType { + DEVICE_TYPE_MOBILE, + DEVICE_TYPE_TABLET + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class MobileApplication : Criterion { + private string appIdField; + + private string displayNameField; + + public string appId { + get { return this.appIdField; } + set { this.appIdField = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class MobileAppCategory : Criterion { + private int mobileAppCategoryIdField; + + private bool mobileAppCategoryIdFieldSpecified; + + private string displayNameField; + + public int mobileAppCategoryId { + get { return this.mobileAppCategoryIdField; } + set { + this.mobileAppCategoryIdField = value; + this.mobileAppCategoryIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mobileAppCategoryIdSpecified { + get { return this.mobileAppCategoryIdFieldSpecified; } + set { this.mobileAppCategoryIdFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Location : Criterion { + private string locationNameField; + + private string displayTypeField; + + private LocationTargetingStatus targetingStatusField; + + private bool targetingStatusFieldSpecified; + + private Location[] parentLocationsField; + + public string locationName { + get { return this.locationNameField; } + set { this.locationNameField = value; } + } + + public string displayType { + get { return this.displayTypeField; } + set { this.displayTypeField = value; } + } + + public LocationTargetingStatus targetingStatus { + get { return this.targetingStatusField; } + set { + this.targetingStatusField = value; + this.targetingStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetingStatusSpecified { + get { return this.targetingStatusFieldSpecified; } + set { this.targetingStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("parentLocations")] + public Location[] parentLocations { + get { return this.parentLocationsField; } + set { this.parentLocationsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum LocationTargetingStatus { + ACTIVE, + OBSOLETE, + PHASING_OUT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Language : Criterion { + private string codeField; + + private string nameField; + + public string code { + get { return this.codeField; } + set { this.codeField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NegativeKeyword))] + public partial class Keyword : Criterion { + private string textField; + + private KeywordMatchType matchTypeField; + + private bool matchTypeFieldSpecified; + + public string text { + get { return this.textField; } + set { this.textField = value; } + } + + public KeywordMatchType matchType { + get { return this.matchTypeField; } + set { + this.matchTypeField = value; + this.matchTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool matchTypeSpecified { + get { return this.matchTypeFieldSpecified; } + set { this.matchTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum KeywordMatchType { + EXACT, + PHRASE, + BROAD + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Gender : Criterion { + private GenderGenderType genderTypeField; + + private bool genderTypeFieldSpecified; + + public GenderGenderType genderType { + get { return this.genderTypeField; } + set { + this.genderTypeField = value; + this.genderTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool genderTypeSpecified { + get { return this.genderTypeFieldSpecified; } + set { this.genderTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Gender.GenderType", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum GenderGenderType { + GENDER_MALE, + GENDER_FEMALE, + GENDER_UNDETERMINED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ContentLabel : Criterion { + private ContentLabelType contentLabelTypeField; + + private bool contentLabelTypeFieldSpecified; + + public ContentLabelType contentLabelType { + get { return this.contentLabelTypeField; } + set { + this.contentLabelTypeField = value; + this.contentLabelTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contentLabelTypeSpecified { + get { return this.contentLabelTypeFieldSpecified; } + set { this.contentLabelTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ContentLabelType { + ADULTISH, + AFE, + BELOW_THE_FOLD, + CONFLICT, + DP, + EMBEDDED_VIDEO, + GAMES, + JACKASS, + PROFANITY, + UGC_FORUMS, + UGC_IMAGES, + UGC_SOCIAL, + UGC_VIDEOS, + SIRENS, + TRAGEDY, + VIDEO, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Carrier : Criterion { + private string nameField; + + private string countryCodeField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AgeRange : Criterion { + private AgeRangeAgeRangeType ageRangeTypeField; + + private bool ageRangeTypeFieldSpecified; + + public AgeRangeAgeRangeType ageRangeType { + get { return this.ageRangeTypeField; } + set { + this.ageRangeTypeField = value; + this.ageRangeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ageRangeTypeSpecified { + get { return this.ageRangeTypeFieldSpecified; } + set { this.ageRangeTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AgeRange.AgeRangeType", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AgeRangeAgeRangeType { + AGE_RANGE_18_24, + AGE_RANGE_25_34, + AGE_RANGE_35_44, + AGE_RANGE_45_54, + AGE_RANGE_55_64, + AGE_RANGE_65_UP, + AGE_RANGE_UNDETERMINED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdSchedule : Criterion { + private DayOfWeek dayOfWeekField; + + private bool dayOfWeekFieldSpecified; + + private int startHourField; + + private bool startHourFieldSpecified; + + private MinuteOfHour startMinuteField; + + private bool startMinuteFieldSpecified; + + private int endHourField; + + private bool endHourFieldSpecified; + + private MinuteOfHour endMinuteField; + + private bool endMinuteFieldSpecified; + + public DayOfWeek dayOfWeek { + get { return this.dayOfWeekField; } + set { + this.dayOfWeekField = value; + this.dayOfWeekSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dayOfWeekSpecified { + get { return this.dayOfWeekFieldSpecified; } + set { this.dayOfWeekFieldSpecified = value; } + } + + public int startHour { + get { return this.startHourField; } + set { + this.startHourField = value; + this.startHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startHourSpecified { + get { return this.startHourFieldSpecified; } + set { this.startHourFieldSpecified = value; } + } + + public MinuteOfHour startMinute { + get { return this.startMinuteField; } + set { + this.startMinuteField = value; + this.startMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startMinuteSpecified { + get { return this.startMinuteFieldSpecified; } + set { this.startMinuteFieldSpecified = value; } + } + + public int endHour { + get { return this.endHourField; } + set { + this.endHourField = value; + this.endHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endHourSpecified { + get { return this.endHourFieldSpecified; } + set { this.endHourFieldSpecified = value; } + } + + public MinuteOfHour endMinute { + get { return this.endMinuteField; } + set { + this.endMinuteField = value; + this.endMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endMinuteSpecified { + get { return this.endMinuteFieldSpecified; } + set { this.endMinuteFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum DayOfWeek { + MONDAY, + TUESDAY, + WEDNESDAY, + THURSDAY, + FRIDAY, + SATURDAY, + SUNDAY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum MinuteOfHour { + ZERO, + FIFTEEN, + THIRTY, + FORTY_FIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class String_StringMapEntry { + private string keyField; + + private string valueField; + + public string key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class NegativeCampaignCriterion : CampaignCriterion { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class QueryError : ApiError { + private QueryErrorReason reasonField; + + private bool reasonFieldSpecified; + + private string messageField; + + public QueryErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + public string message { + get { return this.messageField; } + set { this.messageField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "QueryError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum QueryErrorReason { + PARSING_FAILED, + MISSING_QUERY, + MISSING_SELECT_CLAUSE, + MISSING_FROM_CLAUSE, + INVALID_SELECT_CLAUSE, + INVALID_FROM_CLAUSE, + INVALID_WHERE_CLAUSE, + INVALID_ORDER_BY_CLAUSE, + INVALID_LIMIT_CLAUSE, + INVALID_START_INDEX_IN_LIMIT_CLAUSE, + INVALID_PAGE_SIZE_IN_LIMIT_CLAUSE, + INVALID_DURING_CLAUSE, + INVALID_MIN_DATE_IN_DURING_CLAUSE, + INVALID_MAX_DATE_IN_DURING_CLAUSE, + MAX_LESS_THAN_MIN_IN_DURING_CLAUSE, + VALIDATION_FAILED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignCriterionLimitExceeded : EntityCountLimitExceeded { + private CampaignCriterionLimitExceededCriteriaLimitType limitTypeField; + + private bool limitTypeFieldSpecified; + + public CampaignCriterionLimitExceededCriteriaLimitType limitType { + get { return this.limitTypeField; } + set { + this.limitTypeField = value; + this.limitTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool limitTypeSpecified { + get { return this.limitTypeFieldSpecified; } + set { this.limitTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignCriterionLimitExceeded.CriteriaLimitType", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum CampaignCriterionLimitExceededCriteriaLimitType { + CAMPAIGN_CRITERIA, + CAMPAIGN_NEGATIVE_KEYWORD, + CAMPAIGN_NEGATIVE_WEBSITE, + CAMPAIGN_LOCATION_CRITERIA, + CAMPAIGN_PROXIMITY_CRITERIA + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CriterionError : ApiError { + private CriterionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CriterionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CriterionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum CriterionErrorReason { + CONCRETE_TYPE_REQUIRED, + INVALID_EXCLUDED_CATEGORY, + INVALID_KEYWORD_TEXT, + KEYWORD_TEXT_TOO_LONG, + KEYWORD_HAS_TOO_MANY_WORDS, + KEYWORD_HAS_INVALID_CHARS, + INVALID_PLACEMENT_URL, + INVALID_USER_LIST, + INVALID_USER_INTEREST, + INVALID_FORMAT_FOR_PLACEMENT_URL, + PLACEMENT_URL_IS_TOO_LONG, + PLACEMENT_URL_HAS_ILLEGAL_CHAR, + PLACEMENT_URL_HAS_MULTIPLE_SITES_IN_LINE, + PLACEMENT_IS_NOT_AVAILABLE_FOR_TARGETING_OR_EXCLUSION, + INVALID_VERTICAL_PATH, + YOUTUBE_VERTICAL_CHANNEL_DEPRECATED, + YOUTUBE_DEMOGRAPHIC_CHANNEL_DEPRECATED, + CANNOT_EXCLUDE_CRITERIA_TYPE, + CANNOT_ADD_CRITERIA_TYPE, + INVALID_PRODUCT_FILTER, + PRODUCT_FILTER_TOO_LONG, + CANNOT_ADD_DISPLAY_ONLY_LISTS_TO_SEARCH_ONLY_CAMPAIGNS, + INVALID_CRITERION_ID, + CANNOT_TARGET_CRITERION, + CRITERION_ID_AND_TYPE_MISMATCH, + INVALID_PROXIMITY_RADIUS, + INVALID_PROXIMITY_RADIUS_UNITS, + INVALID_STREETADDRESS_LENGTH, + INVALID_CITYNAME_LENGTH, + INVALID_REGIONCODE_LENGTH, + INVALID_REGIONNAME_LENGTH, + INVALID_POSTALCODE_LENGTH, + INVALID_COUNTRY_CODE, + INVALID_LATITUDE, + INVALID_LONGITUDE, + PROXIMITY_GEOPOINT_AND_ADDRESS_BOTH_CANNOT_BE_NULL, + INVALID_PROXIMITY_ADDRESS, + AD_SCHEDULE_TIME_INTERVALS_OVERLAP, + AD_SCHEDULE_INTERVAL_CANNOT_SPAN_MULTIPLE_DAYS, + AD_SCHEDULE_INVALID_TIME_INTERVAL, + AD_SCHEDULE_EXCEEDED_INTERVALS_PER_DAY_LIMIT, + AD_SCHEDULE_CRITERION_ID_MISMATCHING_FIELDS, + CANNOT_BID_MODIFY_CRITERION_TYPE, + CANNOT_BID_MODIFY_NEGATIVE_CRITERION, + CANNOT_ADD_BID_MODIFIER_FOR_BIDDING_STRATEGY, + CANNOT_BID_MODIFY_DESKTOP, + ACCOUNT_INELIGIBLE_FOR_CRITERIA_TYPE, + CRITERIA_TYPE_INVALID_FOR_BIDDING_STRATEGY, + CANNOT_ATTACH_CRITERIA_BIDDING_STRATEGY_ON_CONTENT_NETWORK_ONLY_CAMPAIGN, + CANNOT_EXCLUDE_CRITERION, + CANNOT_REMOVE_CRITERION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignCriterionError : ApiError { + private CampaignCriterionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CampaignCriterionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignCriterionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum CampaignCriterionErrorReason { + CRITERIA_QUOTA_EXCEEDED, + CONCRETE_TYPE_REQUIRED, + ID_FILTERS_HAVE_DIFF_FIELDS_SET, + INVALID_EXCLUDED_CATEGORY, + INVALID_KEYWORD_TEXT, + INVALID_PLACEMENT_URL, + INVALID_VERTICAL_PATH, + LICENSED_USERLISTS_NOT_ALLOWED, + CANNOT_EXCLUDE_ALL_PLATFORMS, + CANNOT_EXCLUDE_CRITERIA_TYPE, + CANNOT_EXCLUDE_PLATFORM_CRITERION, + CANNOT_TARGET_AND_EXCLUDE, + TOO_MANY_OPERTAIONS, + OPERATOR_NOT_SUPPORTED_FOR_CRITERION_TYPE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignCriterionOperation : Operation { + private CampaignCriterion operandField; + + public CampaignCriterion operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignCriterionPage : Page { + private CampaignCriterion[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public CampaignCriterion[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CampaignServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CampaignService : AdWordsSoapClient, ICampaignService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CampaignService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/CampaignService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((CampaignPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +CampaignOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((CampaignReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((CampaignPage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignReturnValue : ListReturnValue { + private Campaign[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public Campaign[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Campaign { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private CampaignStatus statusField; + + private bool statusFieldSpecified; + + private ServingStatus servingStatusField; + + private bool servingStatusFieldSpecified; + + private string startDateField; + + private string endDateField; + + private Budget budgetField; + + private ConversionOptimizerEligibility conversionOptimizerEligibilityField; + + private AdServingOptimizationStatus adServingOptimizationStatusField; + + private bool adServingOptimizationStatusFieldSpecified; + + private FrequencyCap frequencyCapField; + + private Setting[] settingsField; + + private NetworkSetting networkSettingField; + + private BiddingStrategyConfiguration biddingStrategyConfigurationField; + + private String_StringMapEntry[] forwardCompatibilityMapField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public CampaignStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ServingStatus servingStatus { + get { return this.servingStatusField; } + set { + this.servingStatusField = value; + this.servingStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool servingStatusSpecified { + get { return this.servingStatusFieldSpecified; } + set { this.servingStatusFieldSpecified = value; } + } + + public string startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public string endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + public Budget budget { + get { return this.budgetField; } + set { this.budgetField = value; } + } + + public ConversionOptimizerEligibility conversionOptimizerEligibility { + get { return this.conversionOptimizerEligibilityField; } + set { this.conversionOptimizerEligibilityField = value; } + } + + public AdServingOptimizationStatus adServingOptimizationStatus { + get { return this.adServingOptimizationStatusField; } + set { + this.adServingOptimizationStatusField = value; + this.adServingOptimizationStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adServingOptimizationStatusSpecified { + get { return this.adServingOptimizationStatusFieldSpecified; } + set { this.adServingOptimizationStatusFieldSpecified = value; } + } + + public FrequencyCap frequencyCap { + get { return this.frequencyCapField; } + set { this.frequencyCapField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("settings")] + public Setting[] settings { + get { return this.settingsField; } + set { this.settingsField = value; } + } + + public NetworkSetting networkSetting { + get { return this.networkSettingField; } + set { this.networkSettingField = value; } + } + + public BiddingStrategyConfiguration biddingStrategyConfiguration { + get { return this.biddingStrategyConfigurationField; } + set { this.biddingStrategyConfigurationField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("forwardCompatibilityMap")] + public String_StringMapEntry[] forwardCompatibilityMap { + get { return this.forwardCompatibilityMapField; } + set { this.forwardCompatibilityMapField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum CampaignStatus { + ACTIVE, + PAUSED, + DELETED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ServingStatus { + SERVING, + NONE, + ENDED, + PENDING, + SUSPENDED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ConversionOptimizerEligibility { + private bool eligibleField; + + private bool eligibleFieldSpecified; + + private ConversionOptimizerEligibilityRejectionReason[] rejectionReasonsField; + + public bool eligible { + get { return this.eligibleField; } + set { + this.eligibleField = value; + this.eligibleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool eligibleSpecified { + get { return this.eligibleFieldSpecified; } + set { this.eligibleFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("rejectionReasons")] + public ConversionOptimizerEligibilityRejectionReason[] rejectionReasons { + get { return this.rejectionReasonsField; } + set { this.rejectionReasonsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConversionOptimizerEligibility.RejectionReason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ConversionOptimizerEligibilityRejectionReason { + CAMPAIGN_IS_NOT_ACTIVE, + NOT_CPC_CAMPAIGN, + CONVERSION_TRACKING_NOT_ENABLED, + NOT_ENOUGH_CONVERSIONS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AdServingOptimizationStatus { + OPTIMIZE, + CONVERSION_OPTIMIZE, + ROTATE, + ROTATE_INDEFINITELY, + UNAVAILABLE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FrequencyCap { + private long impressionsField; + + private bool impressionsFieldSpecified; + + private TimeUnit timeUnitField; + + private bool timeUnitFieldSpecified; + + private Level levelField; + + private bool levelFieldSpecified; + + public long impressions { + get { return this.impressionsField; } + set { + this.impressionsField = value; + this.impressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsSpecified { + get { return this.impressionsFieldSpecified; } + set { this.impressionsFieldSpecified = value; } + } + + public TimeUnit timeUnit { + get { return this.timeUnitField; } + set { + this.timeUnitField = value; + this.timeUnitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool timeUnitSpecified { + get { return this.timeUnitFieldSpecified; } + set { this.timeUnitFieldSpecified = value; } + } + + public Level level { + get { return this.levelField; } + set { + this.levelField = value; + this.levelSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool levelSpecified { + get { return this.levelFieldSpecified; } + set { this.levelFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum TimeUnit { + MINUTE, + HOUR, + DAY, + WEEK, + MONTH, + LIFETIME + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum Level { + CREATIVE, + ADGROUP, + CAMPAIGN, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TrackingSetting))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RealTimeBiddingSetting))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(KeywordMatchSetting))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GeoTargetTypeSetting))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingSetting))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExplorerAutoOptimizerSetting))] + public abstract partial class Setting { + private string settingTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Setting.Type")] + public string SettingType { + get { return this.settingTypeField; } + set { this.settingTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class TrackingSetting : Setting { + private string trackingUrlField; + + public string trackingUrl { + get { return this.trackingUrlField; } + set { this.trackingUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class RealTimeBiddingSetting : Setting { + private bool optInField; + + private bool optInFieldSpecified; + + public bool optIn { + get { return this.optInField; } + set { + this.optInField = value; + this.optInSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool optInSpecified { + get { return this.optInFieldSpecified; } + set { this.optInFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class KeywordMatchSetting : Setting { + private bool optInField; + + private bool optInFieldSpecified; + + public bool optIn { + get { return this.optInField; } + set { + this.optInField = value; + this.optInSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool optInSpecified { + get { return this.optInFieldSpecified; } + set { this.optInFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class GeoTargetTypeSetting : Setting { + private GeoTargetTypeSettingPositiveGeoTargetType positiveGeoTargetTypeField; + + private bool positiveGeoTargetTypeFieldSpecified; + + private GeoTargetTypeSettingNegativeGeoTargetType negativeGeoTargetTypeField; + + private bool negativeGeoTargetTypeFieldSpecified; + + public GeoTargetTypeSettingPositiveGeoTargetType positiveGeoTargetType { + get { return this.positiveGeoTargetTypeField; } + set { + this.positiveGeoTargetTypeField = value; + this.positiveGeoTargetTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool positiveGeoTargetTypeSpecified { + get { return this.positiveGeoTargetTypeFieldSpecified; } + set { this.positiveGeoTargetTypeFieldSpecified = value; } + } + + public GeoTargetTypeSettingNegativeGeoTargetType negativeGeoTargetType { + get { return this.negativeGeoTargetTypeField; } + set { + this.negativeGeoTargetTypeField = value; + this.negativeGeoTargetTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool negativeGeoTargetTypeSpecified { + get { return this.negativeGeoTargetTypeFieldSpecified; } + set { this.negativeGeoTargetTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GeoTargetTypeSetting.PositiveGeoTargetType", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum GeoTargetTypeSettingPositiveGeoTargetType { + DONT_CARE, + AREA_OF_INTEREST, + LOCATION_OF_PRESENCE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GeoTargetTypeSetting.NegativeGeoTargetType", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum GeoTargetTypeSettingNegativeGeoTargetType { + DONT_CARE, + LOCATION_OF_PRESENCE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class NetworkSetting { + private bool targetGoogleSearchField; + + private bool targetGoogleSearchFieldSpecified; + + private bool targetSearchNetworkField; + + private bool targetSearchNetworkFieldSpecified; + + private bool targetContentNetworkField; + + private bool targetContentNetworkFieldSpecified; + + private bool targetPartnerSearchNetworkField; + + private bool targetPartnerSearchNetworkFieldSpecified; + + public bool targetGoogleSearch { + get { return this.targetGoogleSearchField; } + set { + this.targetGoogleSearchField = value; + this.targetGoogleSearchSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetGoogleSearchSpecified { + get { return this.targetGoogleSearchFieldSpecified; } + set { this.targetGoogleSearchFieldSpecified = value; } + } + + public bool targetSearchNetwork { + get { return this.targetSearchNetworkField; } + set { + this.targetSearchNetworkField = value; + this.targetSearchNetworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetSearchNetworkSpecified { + get { return this.targetSearchNetworkFieldSpecified; } + set { this.targetSearchNetworkFieldSpecified = value; } + } + + public bool targetContentNetwork { + get { return this.targetContentNetworkField; } + set { + this.targetContentNetworkField = value; + this.targetContentNetworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetContentNetworkSpecified { + get { return this.targetContentNetworkFieldSpecified; } + set { this.targetContentNetworkFieldSpecified = value; } + } + + public bool targetPartnerSearchNetwork { + get { return this.targetPartnerSearchNetworkField; } + set { + this.targetPartnerSearchNetworkField = value; + this.targetPartnerSearchNetworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPartnerSearchNetworkSpecified { + get { return this.targetPartnerSearchNetworkFieldSpecified; } + set { this.targetPartnerSearchNetworkFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BiddingStrategyConfiguration { + private long biddingStrategyIdField; + + private bool biddingStrategyIdFieldSpecified; + + private string biddingStrategyNameField; + + private BiddingStrategyType biddingStrategyTypeField; + + private bool biddingStrategyTypeFieldSpecified; + + private BiddingStrategySource biddingStrategySourceField; + + private bool biddingStrategySourceFieldSpecified; + + private BiddingScheme biddingSchemeField; + + private Bids[] bidsField; + + public long biddingStrategyId { + get { return this.biddingStrategyIdField; } + set { + this.biddingStrategyIdField = value; + this.biddingStrategyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool biddingStrategyIdSpecified { + get { return this.biddingStrategyIdFieldSpecified; } + set { this.biddingStrategyIdFieldSpecified = value; } + } + + public string biddingStrategyName { + get { return this.biddingStrategyNameField; } + set { this.biddingStrategyNameField = value; } + } + + public BiddingStrategyType biddingStrategyType { + get { return this.biddingStrategyTypeField; } + set { + this.biddingStrategyTypeField = value; + this.biddingStrategyTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool biddingStrategyTypeSpecified { + get { return this.biddingStrategyTypeFieldSpecified; } + set { this.biddingStrategyTypeFieldSpecified = value; } + } + + public BiddingStrategySource biddingStrategySource { + get { return this.biddingStrategySourceField; } + set { + this.biddingStrategySourceField = value; + this.biddingStrategySourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool biddingStrategySourceSpecified { + get { return this.biddingStrategySourceFieldSpecified; } + set { this.biddingStrategySourceFieldSpecified = value; } + } + + public BiddingScheme biddingScheme { + get { return this.biddingSchemeField; } + set { this.biddingSchemeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("bids")] + public Bids[] bids { + get { return this.bidsField; } + set { this.bidsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum BiddingStrategyType { + BUDGET_OPTIMIZER, + CONVERSION_OPTIMIZER, + MANUAL_CPC, + MANUAL_CPM, + PAGE_ONE_PROMOTED, + PERCENT_CPA, + TARGET_SPEND, + ENHANCED_CPC, + TARGET_CPA, + NONE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum BiddingStrategySource { + CAMPAIGN, + ADGROUP, + CRITERION + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetOptimizerBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetSpendBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetCpaBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PageOnePromotedBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PercentCpaBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManualCpmBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManualCpcBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EnhancedCpcBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConversionOptimizerBiddingScheme))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public abstract partial class BiddingScheme { + private string biddingSchemeTypeField; + + [System.Xml.Serialization.XmlElementAttribute("BiddingScheme.Type")] + public string BiddingSchemeType { + get { return this.biddingSchemeTypeField; } + set { this.biddingSchemeTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BudgetOptimizerBiddingScheme : BiddingScheme { + private Money bidCeilingField; + + private bool enhancedCpcEnabledField; + + private bool enhancedCpcEnabledFieldSpecified; + + public Money bidCeiling { + get { return this.bidCeilingField; } + set { this.bidCeilingField = value; } + } + + public bool enhancedCpcEnabled { + get { return this.enhancedCpcEnabledField; } + set { + this.enhancedCpcEnabledField = value; + this.enhancedCpcEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool enhancedCpcEnabledSpecified { + get { return this.enhancedCpcEnabledFieldSpecified; } + set { this.enhancedCpcEnabledFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class TargetSpendBiddingScheme : BiddingScheme { + private Money bidCeilingField; + + private Money spendTargetField; + + public Money bidCeiling { + get { return this.bidCeilingField; } + set { this.bidCeilingField = value; } + } + + public Money spendTarget { + get { return this.spendTargetField; } + set { this.spendTargetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class TargetCpaBiddingScheme : BiddingScheme { + private Money targetCpaField; + + public Money targetCpa { + get { return this.targetCpaField; } + set { this.targetCpaField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class PageOnePromotedBiddingScheme : BiddingScheme { + private PageOnePromotedBiddingSchemeStrategyGoal strategyGoalField; + + private bool strategyGoalFieldSpecified; + + private Money bidCeilingField; + + private double bidModifierField; + + private bool bidModifierFieldSpecified; + + private bool bidChangesForRaisesOnlyField; + + private bool bidChangesForRaisesOnlyFieldSpecified; + + private bool raiseBidWhenBudgetConstainedField; + + private bool raiseBidWhenBudgetConstainedFieldSpecified; + + private bool raiseBidWhenLowQualityScoreField; + + private bool raiseBidWhenLowQualityScoreFieldSpecified; + + public PageOnePromotedBiddingSchemeStrategyGoal strategyGoal { + get { return this.strategyGoalField; } + set { + this.strategyGoalField = value; + this.strategyGoalSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool strategyGoalSpecified { + get { return this.strategyGoalFieldSpecified; } + set { this.strategyGoalFieldSpecified = value; } + } + + public Money bidCeiling { + get { return this.bidCeilingField; } + set { this.bidCeilingField = value; } + } + + public double bidModifier { + get { return this.bidModifierField; } + set { + this.bidModifierField = value; + this.bidModifierSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidModifierSpecified { + get { return this.bidModifierFieldSpecified; } + set { this.bidModifierFieldSpecified = value; } + } + + public bool bidChangesForRaisesOnly { + get { return this.bidChangesForRaisesOnlyField; } + set { + this.bidChangesForRaisesOnlyField = value; + this.bidChangesForRaisesOnlySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidChangesForRaisesOnlySpecified { + get { return this.bidChangesForRaisesOnlyFieldSpecified; } + set { this.bidChangesForRaisesOnlyFieldSpecified = value; } + } + + public bool raiseBidWhenBudgetConstained { + get { return this.raiseBidWhenBudgetConstainedField; } + set { + this.raiseBidWhenBudgetConstainedField = value; + this.raiseBidWhenBudgetConstainedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool raiseBidWhenBudgetConstainedSpecified { + get { return this.raiseBidWhenBudgetConstainedFieldSpecified; } + set { this.raiseBidWhenBudgetConstainedFieldSpecified = value; } + } + + public bool raiseBidWhenLowQualityScore { + get { return this.raiseBidWhenLowQualityScoreField; } + set { + this.raiseBidWhenLowQualityScoreField = value; + this.raiseBidWhenLowQualityScoreSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool raiseBidWhenLowQualityScoreSpecified { + get { return this.raiseBidWhenLowQualityScoreFieldSpecified; } + set { this.raiseBidWhenLowQualityScoreFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PageOnePromotedBiddingScheme.StrategyGoal", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum PageOnePromotedBiddingSchemeStrategyGoal { + PAGE_ONE, + PAGE_ONE_PROMOTED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class PercentCpaBiddingScheme : BiddingScheme { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ManualCpmBiddingScheme : BiddingScheme { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ManualCpcBiddingScheme : BiddingScheme { + private bool enhancedCpcEnabledField; + + private bool enhancedCpcEnabledFieldSpecified; + + public bool enhancedCpcEnabled { + get { return this.enhancedCpcEnabledField; } + set { + this.enhancedCpcEnabledField = value; + this.enhancedCpcEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool enhancedCpcEnabledSpecified { + get { return this.enhancedCpcEnabledFieldSpecified; } + set { this.enhancedCpcEnabledFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class EnhancedCpcBiddingScheme : BiddingScheme { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ConversionOptimizerBiddingScheme : BiddingScheme { + private ConversionOptimizerBiddingSchemePricingMode pricingModeField; + + private bool pricingModeFieldSpecified; + + private ConversionOptimizerBiddingSchemeBidType bidTypeField; + + private bool bidTypeFieldSpecified; + + public ConversionOptimizerBiddingSchemePricingMode pricingMode { + get { return this.pricingModeField; } + set { + this.pricingModeField = value; + this.pricingModeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool pricingModeSpecified { + get { return this.pricingModeFieldSpecified; } + set { this.pricingModeFieldSpecified = value; } + } + + public ConversionOptimizerBiddingSchemeBidType bidType { + get { return this.bidTypeField; } + set { + this.bidTypeField = value; + this.bidTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidTypeSpecified { + get { return this.bidTypeFieldSpecified; } + set { this.bidTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConversionOptimizerBiddingScheme.PricingMode", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ConversionOptimizerBiddingSchemePricingMode { + CLICKS, + CONVERSIONS + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConversionOptimizerBiddingScheme.BidType", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ConversionOptimizerBiddingSchemeBidType { + TARGET_CPA + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CpmBid))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CpcBid))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CpaBid))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PercentCpaBid))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public abstract partial class Bids { + private string bidsTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Bids.Type")] + public string BidsType { + get { return this.bidsTypeField; } + set { this.bidsTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CpmBid : Bids { + private Money bidField; + + private BidSource cpmBidSourceField; + + private bool cpmBidSourceFieldSpecified; + + public Money bid { + get { return this.bidField; } + set { this.bidField = value; } + } + + public BidSource cpmBidSource { + get { return this.cpmBidSourceField; } + set { + this.cpmBidSourceField = value; + this.cpmBidSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool cpmBidSourceSpecified { + get { return this.cpmBidSourceFieldSpecified; } + set { this.cpmBidSourceFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum BidSource { + ADGROUP, + CRITERION + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CpcBid : Bids { + private Money bidField; + + private Money contentBidField; + + private BidSource cpcBidSourceField; + + private bool cpcBidSourceFieldSpecified; + + public Money bid { + get { return this.bidField; } + set { this.bidField = value; } + } + + public Money contentBid { + get { return this.contentBidField; } + set { this.contentBidField = value; } + } + + public BidSource cpcBidSource { + get { return this.cpcBidSourceField; } + set { + this.cpcBidSourceField = value; + this.cpcBidSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool cpcBidSourceSpecified { + get { return this.cpcBidSourceFieldSpecified; } + set { this.cpcBidSourceFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CpaBid : Bids { + private Money bidField; + + public Money bid { + get { return this.bidField; } + set { this.bidField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class PercentCpaBid : Bids { + private int bidField; + + private bool bidFieldSpecified; + + private BidSource percentCpaBidSourceField; + + private bool percentCpaBidSourceFieldSpecified; + + public int bid { + get { return this.bidField; } + set { + this.bidField = value; + this.bidSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidSpecified { + get { return this.bidFieldSpecified; } + set { this.bidFieldSpecified = value; } + } + + public BidSource percentCpaBidSource { + get { return this.percentCpaBidSourceField; } + set { + this.percentCpaBidSourceField = value; + this.percentCpaBidSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool percentCpaBidSourceSpecified { + get { return this.percentCpaBidSourceFieldSpecified; } + set { this.percentCpaBidSourceFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class TargetError : ApiError { + private TargetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TargetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TargetError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum TargetErrorReason { + AD_SCHEDULE_ADVANCED_INCOMPATIBLE_WITH_CONVERSION_OPTIMIZER, + AD_SCHEDULE_BID_MULTIPLIER_MALFORMED, + AD_SCHEDULE_BID_MULTIPLIER_TOO_BIG, + AD_SCHEDULE_BID_MULTIPLIER_TOO_SMALL, + AD_SCHEDULE_BID_MULTIPLIER_TOO_MANY_FRACTION_DIGITS, + AD_SCHEDULE_EXCEEDED_INTERVALS_PER_DAY_LIMIT, + AD_SCHEDULE_EXCEEDS_PAST_END_OF_WEEK, + AD_SCHEDULE_INCOMPATIBILITY, + AD_SCHEDULE_INCOMPATIBLE_WITH_BUDGET_OPTIMIZER, + AD_SCHEDULE_INTERVAL_CANNOT_SPAN_MULTIPLE_DAYS, + AD_SCHEDULE_INVALID_DAY_OF_THE_WEEK, + AD_SCHEDULE_INVALID_TIME_INTERVAL, + AD_SCHEDULE_NO_INTERVALS_WHILE_ENABLED, + AD_SCHEDULE_NOT_MULTIPLE_OF_15_MINUTES, + AD_SCHEDULE_TIME_INTERVALS_OVERLAP, + CANNOT_EXCLUDE_CITY, + CANNOT_EXCLUDE_IF_NOT_TARGETED, + CANNOT_EXCLUDE_METRO, + CANNOT_EXCLUDE_PROVINCE, + CANNOT_OPT_OUT_GOOGLE_SEARCH_WHILE_BID_TO_POSITION_ENABLE, + CANNOT_TARGET_AGE_WITHOUT_GENDER, + CANNOT_TARGET_CITY, + CANNOT_TARGET_CONTENT_CONTEXTUAL_WITHOUT_CONTENT_NETWORK, + CANNOT_MODIFY_CONTENT_CONTEXTUAL, + CANNOT_TARGET_COUNTRY, + CANNOT_TARGET_COVERAGE, + CANNOT_TARGET_GENDER_WITHOUT_AGE, + CANNOT_TARGET_GOOGLE_SEARCH_FOR_CPM_CAMPAIGN, + CANNOT_CHANGE_GOOGLE_SEARCH_SETTING, + CANNOT_TARGET_LANGUAGE, + CANNOT_TARGET_METRO, + CANNOT_TARGET_MOBILE_CARRIER, + CANNOT_TARGET_PROVINCE, + CANNOT_TARGET_SEARCH_SYNDICATION_WITHOUT_GOOGLE_SEARCH, + CANNOT_TARGET_SYNDICATABLE_TYPES, + CANNOT_TARGET_THE_SAME_TARGET_LIST_TYPE_MULTIPLE_TIMES, + DEMOGRAPHIC_BID_MODIFIER_SHOULD_BE_IN_BETWEEN_0_AND_500, + INVALID_CITY_CODE, + INVALID_CITYNAME_LENGTH, + INVALID_EXCLUDED_POLYGON_TARGET, + INVALID_EXCLUDED_PROXIMITY_TARGET, + INVALID_LANGUAGE_CODE, + INVALID_LATITUDE, + INVALID_LONGITUDE, + INVALID_METRO_CODE, + INVALID_MOBILE_CARRIER, + INVALID_MOBILE_PLATFORM, + INVALID_POSTALCODE_LENGTH, + INVALID_PROVINCE_CODE, + INVALID_PROXIMITY_RADIUS, + INVALID_REGIONCODE_LENGTH, + INVALID_REGIONNAME_LENGTH, + INVALID_STREETADDRESS_LENGTH, + MULTIPLE_OCCURRENCES_OF_SAME_TARGET, + POLYGON_DUPLICATE_VERTICES, + POLYGON_EDGES_INTERSECT, + POLYGON_TOO_FEW_VERTICES, + POLYGON_TOO_MANY_VERTICES, + POLYGON_TOO_LARGE, + TARGETING_VALIDATION_FAILED, + TARGETING_CROSS_COUNTRY_REGIONAL, + TARGETING_EXCLUSION_NOT_SUPPORTED, + TARGETING_INCOMPATIBLE_LOCATION_TYPES, + TARGETING_NOT_SUPPORTED, + TARGETING_TOO_MANY_REGIONS, + TOO_MANY_EXCLUDED_LOCATIONS, + TOO_MANY_TARGETED_LOCATIONS, + WARNING_MAY_NOW_REQUIRE_CHINESE_APPROVAL, + WARNING_NOW_REQUIRES_CHINESE_APPROVAL, + WARNING_NOW_TARGETS_CHINA, + WARNING_NOW_TARGETS_CHINESE, + TARGET_ERROR + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class StatsQueryError : ApiError { + private StatsQueryErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StatsQueryErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StatsQueryError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum StatsQueryErrorReason { + DATE_NOT_IN_VALID_RANGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class SettingError : ApiError { + private SettingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SettingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SettingError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum SettingErrorReason { + DUPLICATE_SETTING_TYPE, + SETTING_TYPE_IS_NOT_AVAILABLE, + SETTING_TYPE_IS_NOT_COMPATIBLE_WITH_CAMPAIGN, + TARGETING_SETTING_REQUIRES_CAMPAIGN_TARGET_RESTRICT_SETTING, + TARGET_RESTRICT_SETTING_CANNOT_BE_REVERSED, + TARGETING_SETTING_CONTAINS_INVALID_CRITERION_TYPE_GROUP, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class QuotaError : ApiError { + private QuotaErrorReason reasonField; + + private bool reasonFieldSpecified; + + private int limitField; + + private bool limitFieldSpecified; + + public QuotaErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + public int limit { + get { return this.limitField; } + set { + this.limitField = value; + this.limitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool limitSpecified { + get { return this.limitFieldSpecified; } + set { this.limitFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "QuotaError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum QuotaErrorReason { + TOO_MANY_ADGROUPS_PER_CAMPAIGN, + TOO_MANY_CAMPAIGNS_PER_ACCOUNT, + TOO_MANY_CONVERSION_TYPES_PER_ACCOUNT, + TOO_MANY_KEYWORDS_PER_ADGROUP, + TOO_MANY_KEYWORDS_PER_CAMPAIGN, + TOO_MANY_KEYWORDS_PER_CUSTOMER, + TOO_MANY_SITES_PER_ADGROUP, + TOO_MANY_SITES_PER_CAMPAIGN, + TOO_MANY_CRITERIA_PER_ACCOUNT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ForwardCompatibilityError : ApiError { + private ForwardCompatibilityErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ForwardCompatibilityErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ForwardCompatibilityError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ForwardCompatibilityErrorReason { + INVALID_FORWARD_COMPATIBILITY_MAP_VALUE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignError : ApiError { + private CampaignErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CampaignErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum CampaignErrorReason { + AFTER_MAXIMUM_ALLOWABLE_DATE, + CANNOT_GO_BACK_TO_INCOMPLETE, + CANNOT_MODIFY_START_DATE_IF_ALREADY_STARTED, + CANNOT_SET_END_DATE_BEFORE_EXPERIMENT_END_DATE, + CANNOT_SET_DATE_TO_PAST, + DUPLICATE_CAMPAIGN_NAME, + INCOMPATIBLE_CAMPAIGN_FIELD, + INVALID_CAMPAIGN_NAME, + INVALID_AD_SERVING_OPTIMIZATION_STATUS, + INVALID_TRACKING_URL, + MAX_IMPRESSIONS_NOT_IN_RANGE, + START_DATE_AFTER_END_DATE, + TIME_UNIT_NOT_SUPPORTED, + INVALID_OPERATION_IF_SERVING_STATUS_HAS_ENDED, + BUDGET_CANNOT_BE_SHARED, + CANNOT_SET_BUDGET, + CAMPAIGN_CANNOT_USE_SHARED_BUDGET, + MUST_SPECIFY_KEYWORD_MATCH_SETTINGS, + BIDDING_STRATEGY_NOT_SUPPORTED_WITH_BID_MODIFIER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BiddingTransitionError : ApiError { + private BiddingTransitionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BiddingTransitionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BiddingTransitionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum BiddingTransitionErrorReason { + BID_TO_POSITION_ENABLED, + BIDDING_STRATEGY_NOT_AVAILABLE_FOR_ACCOUNT_TYPE, + BUDGET_OPTIMIZER_IS_ENABLED, + CONVERSION_OPTIMIZER_IS_ENABLED, + CONVERSION_TRACKING_NOT_ENABLED, + CONVERSION_TRACKING_NOT_AVAILABLE_FOR_ACCOUNT_TYPE, + USE_POSITION_PREFERENCE_IN_MANUALCPC_INSTEAD_TO_DISABLE_POSITION_PREFERENCE, + INVALID_BID, + CANNOT_SET_EXPLICIT_BID, + EXPLICIT_BID_REQUIRED_FOR_TRANSITION, + EXPLICIT_BID_TYPE_DOES_NOT_MATCH_CAMPAIGN_BIDDING_STRATEGY, + MISSING_REQUIRED_BID, + INVALID_STATUS, + IS_CPM_CAMPAIGN, + IS_PERCENT_CPA_CAMPAIGN, + NOT_THE_PREVIOUS_BIDDING_STRATEGY, + NOT_ENOUGH_CONVERSION_DATA, + NOT_ENOUGH_CONVERSIONS, + OPTED_IN_SEARCH, + PROXY_BIDDING_ON, + SITE_REMNANT_RESERVATION_ALLOWED, + TRANSITION_TO_ITSELF, + UNKNOWN_BIDDING_STRATEGY, + UNSUPPORTED_TRANSITION, + VCG_ENABLED, + BIDDING_TRANSITION_FAILED, + ACCELERATED_DELIVERY_NOT_SUPPORTED_FOR_BUDGET_OPTIMIZER, + HAS_ACTIVE_EXPERIMENT, + INCOMPATIBLE_WITH_CAMPAIGN_SETTING + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BiddingErrors : ApiError { + private BiddingErrorsReason reasonField; + + private bool reasonFieldSpecified; + + public BiddingErrorsReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BiddingErrors.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum BiddingErrorsReason { + BIDDING_STRATEGY_OVERRIDE_NOT_ALLOWED, + BIDDING_STRATEGY_TRANSITION_NOT_ALLOWED, + BIDDING_STRATEGY_NOT_COMPATIBLE_WITH_ADGROUP_OVERRIDES, + BIDDING_STRATEGY_NOT_COMPATIBLE_WITH_ADGROUP_CRITERIA_OVERRIDES, + CAMPAIGN_BIDDING_STRATEGY_CANNOT_BE_OVERRIDDEN, + ADGROUP_BIDDING_STRATEGY_CANNOT_BE_OVERRIDDEN, + CANNOT_ATTACH_BIDDING_STRATEGY_TO_ADGROUP, + CANNOT_ATTACH_BIDDING_STRATEGY_TO_ADGROUP_CRITERIA, + PERCENT_CPA_NOT_AVAILABLE_FOR_CUSTOMER, + INVALID_ANONYMOUS_BIDDING_STRATEGY_TYPE, + BIDS_NOT_ALLLOWED, + DUPLICATE_BIDS, + INVALID_BIDDING_SCHEME, + INVALID_BIDDING_STRATEGY_TYPE, + MISSING_BIDDING_STRATEGY_TYPE, + NULL_BID, + INVALID_BID, + BIDDING_STRATEGY_NOT_AVAILABLE_FOR_ACCOUNT_TYPE, + CONVERSION_TRACKING_NOT_ENABLED, + NOT_ENOUGH_CONVERSIONS, + NOT_ENOUGH_CONVERSION_DATA, + CANNOT_CREATE_CAMPAIGN_WITH_CONVERSION_OPTIMIZER, + CANNOT_ATTACH_POP_BIDDING_STRATEGY_FOR_CONTENT_NETWORK_ONLY_CAMPAIGN, + CANNOT_TARGET_CONTENT_NETWORK_ONLY_WITH_AD_GROUP_LEVEL_POP_BIDDING_STRATEGY, + CANNOT_TARGET_CONTENT_NETWORK_ONLY_WITH_CAMPAIGN_LEVEL_POP_BIDDING_STRATEGY, + BIDDING_STRATEGY_NOT_SUPPORTED_WITH_AD_SCHEDULE, + PAY_PER_CONVERSION_NOT_AVAILABLE_FOR_CUSTOMER, + PAY_PER_CONVERSION_NOT_ALLOWED_WITH_TARGET_CPA, + BIDDING_STRATEGY_NOT_ALLOWED_FOR_SEARCH_ONLY_CAMPAIGNS, + BIDDING_STRATEGY_NOT_SUPPORTED_FOR_CAMPAIGNS_WITH_EXPERIMENTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BiddingError : ApiError { + private BiddingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BiddingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BiddingError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum BiddingErrorReason { + BID_AMOUNT_REQUIRED, + BID_TOO_SMALL, + BID_TOO_BIG, + BID_TOO_MANY_FRACTIONAL_DIGITS, + NON_POSITIVE_BID, + BID_TOO_HIGH_FOR_DAILY_BUDGET, + BID_TOO_HIGH_FOR_MONTHLY_BUDGET, + MUST_EXCLUDE_0_TO_17_WITH_OTHER_AGE_EXCLUSIONS, + CAMPAIGN_MUST_HAVE_A_BUDGET_TO_ENABLE_BUDGET_OPTIMIZER, + CANNOT_SET_CONTENT_BID_WITHOUT_SETTING_KEYWORD_MAX_CPC_AS_WELL, + CANNOT_CREATE_CAMPAIGN_WITH_CONVERSION_OPTIMIZER, + PAY_PER_CONVERSION_NOT_AVAILABLE_FOR_CUSTOMER, + PAY_PER_CONVERSION_NOT_ALLOWED_WITH_TARGET_CPA, + PAY_PER_CONVERSION_NOT_ALLOWED_WITH_MANY_PER_CLICK, + TARGET_CPA_NOT_AVAILABLE_FOR_CUSTOMER, + MANY_PER_CLICK_NOT_AVAILABLE_FOR_CUSTOMER, + CANNOT_SET_SITE_MAX_CPC, + BID_ERROR + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignOperation : Operation { + private Campaign operandField; + + public Campaign operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignPage : Page { + private Campaign[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Campaign[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CampaignFeedServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CampaignFeedService : AdWordsSoapClient, ICampaignFeedService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CampaignFeedService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/CampaignFeedService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignFeedPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((CampaignFeedPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignFeedReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +CampaignFeedOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((CampaignFeedReturnValue) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignFeedReturnValue : ListReturnValue { + private CampaignFeed[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public CampaignFeed[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignFeed { + private long feedIdField; + + private bool feedIdFieldSpecified; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private Function matchingFunctionField; + + private int[] placeholderTypesField; + + private CampaignFeedStatus statusField; + + private bool statusFieldSpecified; + + public long feedId { + get { return this.feedIdField; } + set { + this.feedIdField = value; + this.feedIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedIdSpecified { + get { return this.feedIdFieldSpecified; } + set { this.feedIdFieldSpecified = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public Function matchingFunction { + get { return this.matchingFunctionField; } + set { this.matchingFunctionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("placeholderTypes")] + public int[] placeholderTypes { + get { return this.placeholderTypesField; } + set { this.placeholderTypesField = value; } + } + + public CampaignFeedStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Function { + private FunctionOperator operatorField; + + private bool operatorFieldSpecified; + + private FunctionArgumentOperand[] lhsOperandField; + + private FunctionArgumentOperand[] rhsOperandField; + + public FunctionOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("lhsOperand")] + public FunctionArgumentOperand[] lhsOperand { + get { return this.lhsOperandField; } + set { this.lhsOperandField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("rhsOperand")] + public FunctionArgumentOperand[] rhsOperand { + get { return this.rhsOperandField; } + set { this.rhsOperandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Function.Operator", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum FunctionOperator { + IN, + IDENTITY, + EQUALS, + AND, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequestContextOperand))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FunctionOperand))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedAttributeOperand))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConstantOperand))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public abstract partial class FunctionArgumentOperand { + private string functionArgumentOperandTypeField; + + [System.Xml.Serialization.XmlElementAttribute("FunctionArgumentOperand.Type")] + public string FunctionArgumentOperandType { + get { return this.functionArgumentOperandTypeField; } + set { this.functionArgumentOperandTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class RequestContextOperand : FunctionArgumentOperand { + private RequestContextOperandContextType contextTypeField; + + private bool contextTypeFieldSpecified; + + public RequestContextOperandContextType contextType { + get { return this.contextTypeField; } + set { + this.contextTypeField = value; + this.contextTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contextTypeSpecified { + get { return this.contextTypeFieldSpecified; } + set { this.contextTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequestContextOperand.ContextType", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum RequestContextOperandContextType { + CAMPAIGN_ID, + ADGROUP_ID, + AD_ID, + FEED_ITEM_ID, + DEVICE_PLATFORM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FunctionOperand : FunctionArgumentOperand { + private Function valueField; + + public Function value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FeedAttributeOperand : FunctionArgumentOperand { + private long feedIdField; + + private bool feedIdFieldSpecified; + + private long feedAttributeIdField; + + private bool feedAttributeIdFieldSpecified; + + public long feedId { + get { return this.feedIdField; } + set { + this.feedIdField = value; + this.feedIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedIdSpecified { + get { return this.feedIdFieldSpecified; } + set { this.feedIdFieldSpecified = value; } + } + + public long feedAttributeId { + get { return this.feedAttributeIdField; } + set { + this.feedAttributeIdField = value; + this.feedAttributeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedAttributeIdSpecified { + get { return this.feedAttributeIdFieldSpecified; } + set { this.feedAttributeIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ConstantOperand : FunctionArgumentOperand { + private ConstantOperandConstantType typeField; + + private bool typeFieldSpecified; + + private long longValueField; + + private bool longValueFieldSpecified; + + private bool booleanValueField; + + private bool booleanValueFieldSpecified; + + private double doubleValueField; + + private bool doubleValueFieldSpecified; + + private string stringValueField; + + public ConstantOperandConstantType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public long longValue { + get { return this.longValueField; } + set { + this.longValueField = value; + this.longValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool longValueSpecified { + get { return this.longValueFieldSpecified; } + set { this.longValueFieldSpecified = value; } + } + + public bool booleanValue { + get { return this.booleanValueField; } + set { + this.booleanValueField = value; + this.booleanValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool booleanValueSpecified { + get { return this.booleanValueFieldSpecified; } + set { this.booleanValueFieldSpecified = value; } + } + + public double doubleValue { + get { return this.doubleValueField; } + set { + this.doubleValueField = value; + this.doubleValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool doubleValueSpecified { + get { return this.doubleValueFieldSpecified; } + set { this.doubleValueFieldSpecified = value; } + } + + public string stringValue { + get { return this.stringValueField; } + set { this.stringValueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConstantOperand.ConstantType", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ConstantOperandConstantType { + BOOLEAN, + DOUBLE, + LONG, + STRING + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignFeed.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum CampaignFeedStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignFeedOperation : Operation { + private CampaignFeed operandField; + + public CampaignFeed operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignFeedPage))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignSharedSetPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedItemPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedMappingPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupFeedPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedSetPage))] + public abstract partial class NullStatsPage : Page { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignFeedPage : NullStatsPage { + private CampaignFeed[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public CampaignFeed[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FunctionError : ApiError { + private FunctionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FunctionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FunctionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum FunctionErrorReason { + DATA_TYPE_MISMATCH, + INVALID_CONJUNCTION_OPERANDS, + INVALID_NUMBER_OF_OPERANDS, + INVALID_OPERAND_TYPE, + INVALID_OPERATOR, + INVALID_REQUEST_CONTEXT_TYPE, + INVALID_FUNCTION_FOR_CALL_PLACEHOLDER, + INVALID_OPERAND, + MISSING_CONSTANT_OPERAND_VALUE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CollectionSizeError : ApiError { + private CollectionSizeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CollectionSizeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CollectionSizeError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum CollectionSizeErrorReason { + TOO_FEW, + TOO_MANY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignFeedError : ApiError { + private CampaignFeedErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CampaignFeedErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignFeedError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum CampaignFeedErrorReason { + FEED_ALREADY_EXISTS_FOR_PLACEHOLDER_TYPE, + INVALID_ID, + CANNOT_ADD_ALREADY_EXISTING_CAMPAIGN_FEED, + CANNOT_OPERATE_ON_DELETED_CAMPAIGN_FEED, + INVALID_PLACEHOLDER_TYPES, + MISSING_FEEDMAPPING_FOR_PLACEHOLDER_TYPE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CampaignSharedSetServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CampaignSharedSetService : AdWordsSoapClient, ICampaignSharedSetService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CampaignSharedSetService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/CampaignSharedSetService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignSharedSetPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((CampaignSharedSetPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignSharedSetReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +CampaignSharedSetOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((CampaignSharedSetReturnValue) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignSharedSetReturnValue : ListReturnValue { + private CampaignSharedSet[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public CampaignSharedSet[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignSharedSet { + private long sharedSetIdField; + + private bool sharedSetIdFieldSpecified; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private string sharedSetNameField; + + private SharedSetType sharedSetTypeField; + + private bool sharedSetTypeFieldSpecified; + + private string campaignNameField; + + private CampaignSharedSetStatus statusField; + + private bool statusFieldSpecified; + + public long sharedSetId { + get { return this.sharedSetIdField; } + set { + this.sharedSetIdField = value; + this.sharedSetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sharedSetIdSpecified { + get { return this.sharedSetIdFieldSpecified; } + set { this.sharedSetIdFieldSpecified = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public string sharedSetName { + get { return this.sharedSetNameField; } + set { this.sharedSetNameField = value; } + } + + public SharedSetType sharedSetType { + get { return this.sharedSetTypeField; } + set { + this.sharedSetTypeField = value; + this.sharedSetTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sharedSetTypeSpecified { + get { return this.sharedSetTypeFieldSpecified; } + set { this.sharedSetTypeFieldSpecified = value; } + } + + public string campaignName { + get { return this.campaignNameField; } + set { this.campaignNameField = value; } + } + + public CampaignSharedSetStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum SharedSetType { + NEGATIVE_KEYWORDS, + NEGATIVE_PLACEMENTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignSharedSet.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum CampaignSharedSetStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignSharedSetOperation : Operation { + private CampaignSharedSet operandField; + + public CampaignSharedSet operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignSharedSetPage : NullStatsPage { + private CampaignSharedSet[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public CampaignSharedSet[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignSharedSetError : ApiError { + private CampaignSharedSetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CampaignSharedSetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignSharedSetError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum CampaignSharedSetErrorReason { + CAMPAIGN_SHARED_SET_DOES_NOT_EXIST, + SHARED_SET_NOT_ACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ConstantDataServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Criterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ConstantDataService : AdWordsSoapClient, IConstantDataService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ConstantDataService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/ConstantDataService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AgeRange[] getAgeRangeCriterion() { + object[] results = this.Invoke("getAgeRangeCriterion", new object[0]); + return ((AgeRange[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Carrier[] getCarrierCriterion() { + object[] results = this.Invoke("getCarrierCriterion", new object[0]); + return ((Carrier[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Gender[] getGenderCriterion() { + object[] results = this.Invoke("getGenderCriterion", new object[0]); + return ((Gender[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Language[] getLanguageCriterion() { + object[] results = this.Invoke("getLanguageCriterion", new object[0]); + return ((Language[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual MobileDevice[] getMobileDeviceCriterion() { + object[] results = this.Invoke("getMobileDeviceCriterion", new object[0]); + return ((MobileDevice[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual OperatingSystemVersion[] getOperatingSystemVersionCriterion() { + object[] results = this.Invoke("getOperatingSystemVersionCriterion", new object[0]); + return ((OperatingSystemVersion[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CriterionUserInterest[] getUserInterestCriterion() { + object[] results = this.Invoke("getUserInterestCriterion", new object[0]); + return ((CriterionUserInterest[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Vertical[] getVerticalCriterion() { + object[] results = this.Invoke("getVerticalCriterion", new object[0]); + return ((Vertical[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ConversionTrackerServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ConversionTrackerService : AdWordsSoapClient, IConversionTrackerService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ConversionTrackerService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/ConversionTrackerService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ConversionTrackerPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((ConversionTrackerPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ConversionTrackerReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +ConversionTrackerOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((ConversionTrackerReturnValue) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ConversionTrackerReturnValue : ListReturnValue { + private ConversionTracker[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public ConversionTracker[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UploadConversion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AppConversion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdWordsConversionTracker))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public abstract partial class ConversionTracker { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private ConversionTrackerStatus statusField; + + private bool statusFieldSpecified; + + private ConversionTrackerCategory categoryField; + + private bool categoryFieldSpecified; + + private ConversionTrackerStats statsField; + + private int viewthroughLookbackWindowField; + + private bool viewthroughLookbackWindowFieldSpecified; + + private bool isProductAdsChargeableField; + + private bool isProductAdsChargeableFieldSpecified; + + private int productAdsChargeableConversionWindowField; + + private bool productAdsChargeableConversionWindowFieldSpecified; + + private int ctcLookbackWindowField; + + private bool ctcLookbackWindowFieldSpecified; + + private string conversionTrackerTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ConversionTrackerStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ConversionTrackerCategory category { + get { return this.categoryField; } + set { + this.categoryField = value; + this.categorySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool categorySpecified { + get { return this.categoryFieldSpecified; } + set { this.categoryFieldSpecified = value; } + } + + public ConversionTrackerStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public int viewthroughLookbackWindow { + get { return this.viewthroughLookbackWindowField; } + set { + this.viewthroughLookbackWindowField = value; + this.viewthroughLookbackWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool viewthroughLookbackWindowSpecified { + get { return this.viewthroughLookbackWindowFieldSpecified; } + set { this.viewthroughLookbackWindowFieldSpecified = value; } + } + + public bool isProductAdsChargeable { + get { return this.isProductAdsChargeableField; } + set { + this.isProductAdsChargeableField = value; + this.isProductAdsChargeableSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isProductAdsChargeableSpecified { + get { return this.isProductAdsChargeableFieldSpecified; } + set { this.isProductAdsChargeableFieldSpecified = value; } + } + + public int productAdsChargeableConversionWindow { + get { return this.productAdsChargeableConversionWindowField; } + set { + this.productAdsChargeableConversionWindowField = value; + this.productAdsChargeableConversionWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productAdsChargeableConversionWindowSpecified { + get { return this.productAdsChargeableConversionWindowFieldSpecified; } + set { this.productAdsChargeableConversionWindowFieldSpecified = value; } + } + + public int ctcLookbackWindow { + get { return this.ctcLookbackWindowField; } + set { + this.ctcLookbackWindowField = value; + this.ctcLookbackWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ctcLookbackWindowSpecified { + get { return this.ctcLookbackWindowFieldSpecified; } + set { this.ctcLookbackWindowFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ConversionTracker.Type")] + public string ConversionTrackerType { + get { return this.conversionTrackerTypeField; } + set { this.conversionTrackerTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConversionTracker.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ConversionTrackerStatus { + ENABLED, + DISABLED, + HIDDEN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConversionTracker.Category", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ConversionTrackerCategory { + DEFAULT, + PAGE_VIEW, + PURCHASE, + SIGNUP, + LEAD, + REMARKETING + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ConversionTrackerStats { + private int numConversionEventsField; + + private bool numConversionEventsFieldSpecified; + + private Money conversionValueField; + + private string mostRecentConversionDateField; + + private int numConvertedClicksField; + + private bool numConvertedClicksFieldSpecified; + + public int numConversionEvents { + get { return this.numConversionEventsField; } + set { + this.numConversionEventsField = value; + this.numConversionEventsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numConversionEventsSpecified { + get { return this.numConversionEventsFieldSpecified; } + set { this.numConversionEventsFieldSpecified = value; } + } + + public Money conversionValue { + get { return this.conversionValueField; } + set { this.conversionValueField = value; } + } + + public string mostRecentConversionDate { + get { return this.mostRecentConversionDateField; } + set { this.mostRecentConversionDateField = value; } + } + + public int numConvertedClicks { + get { return this.numConvertedClicksField; } + set { + this.numConvertedClicksField = value; + this.numConvertedClicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numConvertedClicksSpecified { + get { return this.numConvertedClicksFieldSpecified; } + set { this.numConvertedClicksFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class UploadConversion : ConversionTracker { + private string userRevenueValueField; + + public string userRevenueValue { + get { return this.userRevenueValueField; } + set { this.userRevenueValueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AppConversion : ConversionTracker { + private string appIdField; + + private AppConversionAppPlatform appPlatformField; + + private bool appPlatformFieldSpecified; + + private string userRevenueValueField; + + private string snippetField; + + private AppConversionAppConversionType appConversionTypeField; + + private bool appConversionTypeFieldSpecified; + + public string appId { + get { return this.appIdField; } + set { this.appIdField = value; } + } + + public AppConversionAppPlatform appPlatform { + get { return this.appPlatformField; } + set { + this.appPlatformField = value; + this.appPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool appPlatformSpecified { + get { return this.appPlatformFieldSpecified; } + set { this.appPlatformFieldSpecified = value; } + } + + public string userRevenueValue { + get { return this.userRevenueValueField; } + set { this.userRevenueValueField = value; } + } + + public string snippet { + get { return this.snippetField; } + set { this.snippetField = value; } + } + + public AppConversionAppConversionType appConversionType { + get { return this.appConversionTypeField; } + set { + this.appConversionTypeField = value; + this.appConversionTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool appConversionTypeSpecified { + get { return this.appConversionTypeFieldSpecified; } + set { this.appConversionTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AppConversion.AppPlatform", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AppConversionAppPlatform { + NONE, + ITUNES, + ANDROID_MARKET, + MOBILE_APP_CHANNEL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AppConversion.AppConversionType", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AppConversionAppConversionType { + NONE, + DOWNLOAD, + IN_APP_PURCHASE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdWordsConversionTracker : ConversionTracker { + private string snippetField; + + private AdWordsConversionTrackerMarkupLanguage markupLanguageField; + + private bool markupLanguageFieldSpecified; + + private AdWordsConversionTrackerTextFormat textFormatField; + + private bool textFormatFieldSpecified; + + private string conversionPageLanguageField; + + private string backgroundColorField; + + private string userRevenueValueField; + + private AdWordsConversionTrackerTrackingCodeType trackingCodeTypeField; + + private bool trackingCodeTypeFieldSpecified; + + public string snippet { + get { return this.snippetField; } + set { this.snippetField = value; } + } + + public AdWordsConversionTrackerMarkupLanguage markupLanguage { + get { return this.markupLanguageField; } + set { + this.markupLanguageField = value; + this.markupLanguageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool markupLanguageSpecified { + get { return this.markupLanguageFieldSpecified; } + set { this.markupLanguageFieldSpecified = value; } + } + + public AdWordsConversionTrackerTextFormat textFormat { + get { return this.textFormatField; } + set { + this.textFormatField = value; + this.textFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool textFormatSpecified { + get { return this.textFormatFieldSpecified; } + set { this.textFormatFieldSpecified = value; } + } + + public string conversionPageLanguage { + get { return this.conversionPageLanguageField; } + set { this.conversionPageLanguageField = value; } + } + + public string backgroundColor { + get { return this.backgroundColorField; } + set { this.backgroundColorField = value; } + } + + public string userRevenueValue { + get { return this.userRevenueValueField; } + set { this.userRevenueValueField = value; } + } + + public AdWordsConversionTrackerTrackingCodeType trackingCodeType { + get { return this.trackingCodeTypeField; } + set { + this.trackingCodeTypeField = value; + this.trackingCodeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool trackingCodeTypeSpecified { + get { return this.trackingCodeTypeFieldSpecified; } + set { this.trackingCodeTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdWordsConversionTracker.MarkupLanguage", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AdWordsConversionTrackerMarkupLanguage { + HTML, + CHTML, + XHTML, + WML + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdWordsConversionTracker.TextFormat", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AdWordsConversionTrackerTextFormat { + ONE_LINE, + TWO_LINE, + HIDDEN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdWordsConversionTracker.TrackingCodeType", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AdWordsConversionTrackerTrackingCodeType { + WEBPAGE, + CLICK_TO_CALL, + ANDROID_REMARKETING, + APPLE_IOS_REMARKETING + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ConversionTrackerOperation : Operation { + private ConversionTracker operandField; + + public ConversionTracker operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConversionTrackerPage))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionBidLandscapePage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupBidLandscapePage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductServicePage))] + public abstract partial class NoStatsPage : Page { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ConversionTrackerPage : NoStatsPage { + private ConversionTracker[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public ConversionTracker[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ConversionTrackingError : ApiError { + private ConversionTrackingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ConversionTrackingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConversionTrackingError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ConversionTrackingErrorReason { + ANALYTICS_NOT_ALLOWED, + CANNOT_ADD_CONVERSION_TYPE_SUBCLASS, + CANNOT_CHANGE_APP_CONVERSION_TYPE, + CANNOT_CHANGE_APP_PLATFORM, + CANNNOT_CHANGE_CONVERSION_SUBCLASS, + CANNOT_SET_HIDDEN_STATUS, + CONVERSION_TYPE_NOT_FOUND, + DOMAIN_EXCEPTION, + DUPLICATE_APP_ID, + DUPLICATE_NAME, + EMAIL_FAILED, + EXCEEDED_CONVERSION_TYPE_LIMIT, + ID_IS_NULL, + INVALID_APP_ID, + INVALID_COLOR, + INVALID_CONVERSION, + INVALID_DATE_RANGE, + INVALID_EMAIL_ADDRESS, + MUST_SET_APP_PLATFORM_AND_APP_CONVERSION_TYPE_TOGETHER, + NAME_ALREADY_EXISTS, + NO_RECIPIENTS, + NO_SNIPPET, + REMARKETING_TYPE_NOT_ALLOWED, + TOO_MANY_WEBPAGES, + UNKNOWN_SORTING_TYPE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomerServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomerService : AdWordsSoapClient, ICustomerService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomerService() { + this.Url = "https://adwords.google.com/api/adwords/mcm/v201309/CustomerService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Customer get() { + object[] results = this.Invoke("get", new object[0]); + return ((Customer) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public partial class Customer { + private long customerIdField; + + private bool customerIdFieldSpecified; + + private string currencyCodeField; + + private string dateTimeZoneField; + + private string descriptiveNameField; + + private bool canManageClientsField; + + private bool canManageClientsFieldSpecified; + + private bool testAccountField; + + private bool testAccountFieldSpecified; + + public long customerId { + get { return this.customerIdField; } + set { + this.customerIdField = value; + this.customerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customerIdSpecified { + get { return this.customerIdFieldSpecified; } + set { this.customerIdFieldSpecified = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public string dateTimeZone { + get { return this.dateTimeZoneField; } + set { this.dateTimeZoneField = value; } + } + + public string descriptiveName { + get { return this.descriptiveNameField; } + set { this.descriptiveNameField = value; } + } + + public bool canManageClients { + get { return this.canManageClientsField; } + set { + this.canManageClientsField = value; + this.canManageClientsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool canManageClientsSpecified { + get { return this.canManageClientsFieldSpecified; } + set { this.canManageClientsFieldSpecified = value; } + } + + public bool testAccount { + get { return this.testAccountField; } + set { + this.testAccountField = value; + this.testAccountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool testAccountSpecified { + get { return this.testAccountFieldSpecified; } + set { this.testAccountFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomerSyncServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/ch/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomerSyncService : AdWordsSoapClient, ICustomerSyncService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomerSyncService() { + this.Url = "https://adwords.google.com/api/adwords/ch/v201309/CustomerSyncService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/ch/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/ch/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomerChangeData get(CustomerSyncSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((CustomerChangeData) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/ch/v201309")] + public partial class FeedChangeData { + private long feedIdField; + + private bool feedIdFieldSpecified; + + private ChangeStatus feedChangeStatusField; + + private bool feedChangeStatusFieldSpecified; + + private long[] changedFeedItemsField; + + private long[] deletedFeedItemsField; + + public long feedId { + get { return this.feedIdField; } + set { + this.feedIdField = value; + this.feedIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedIdSpecified { + get { return this.feedIdFieldSpecified; } + set { this.feedIdFieldSpecified = value; } + } + + public ChangeStatus feedChangeStatus { + get { return this.feedChangeStatusField; } + set { + this.feedChangeStatusField = value; + this.feedChangeStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedChangeStatusSpecified { + get { return this.feedChangeStatusFieldSpecified; } + set { this.feedChangeStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedFeedItems")] + public long[] changedFeedItems { + get { return this.changedFeedItemsField; } + set { this.changedFeedItemsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deletedFeedItems")] + public long[] deletedFeedItems { + get { return this.deletedFeedItemsField; } + set { this.deletedFeedItemsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/ch/v201309")] + public enum ChangeStatus { + FIELDS_UNCHANGED, + FIELDS_CHANGED, + NEW + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/ch/v201309")] + public partial class AdGroupChangeData { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private ChangeStatus adGroupChangeStatusField; + + private bool adGroupChangeStatusFieldSpecified; + + private long[] changedAdsField; + + private long[] changedCriteriaField; + + private long[] deletedCriteriaField; + + private long[] changedFeedsField; + + private long[] deletedFeedsField; + + private long[] changedAdGroupBidModifierCriteriaField; + + private long[] deletedAdGroupBidModifierCriteriaField; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public ChangeStatus adGroupChangeStatus { + get { return this.adGroupChangeStatusField; } + set { + this.adGroupChangeStatusField = value; + this.adGroupChangeStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupChangeStatusSpecified { + get { return this.adGroupChangeStatusFieldSpecified; } + set { this.adGroupChangeStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedAds")] + public long[] changedAds { + get { return this.changedAdsField; } + set { this.changedAdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedCriteria")] + public long[] changedCriteria { + get { return this.changedCriteriaField; } + set { this.changedCriteriaField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deletedCriteria")] + public long[] deletedCriteria { + get { return this.deletedCriteriaField; } + set { this.deletedCriteriaField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedFeeds")] + public long[] changedFeeds { + get { return this.changedFeedsField; } + set { this.changedFeedsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deletedFeeds")] + public long[] deletedFeeds { + get { return this.deletedFeedsField; } + set { this.deletedFeedsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedAdGroupBidModifierCriteria")] + public long[] changedAdGroupBidModifierCriteria { + get { return this.changedAdGroupBidModifierCriteriaField; } + set { this.changedAdGroupBidModifierCriteriaField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deletedAdGroupBidModifierCriteria")] + public long[] deletedAdGroupBidModifierCriteria { + get { return this.deletedAdGroupBidModifierCriteriaField; } + set { this.deletedAdGroupBidModifierCriteriaField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/ch/v201309")] + public partial class CampaignChangeData { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private ChangeStatus campaignChangeStatusField; + + private bool campaignChangeStatusFieldSpecified; + + private AdGroupChangeData[] changedAdGroupsField; + + private long[] addedCampaignCriteriaField; + + private long[] deletedCampaignCriteriaField; + + private long[] addedAdExtensionsField; + + private long[] deletedAdExtensionsField; + + private long[] changedFeedsField; + + private long[] deletedFeedsField; + + private bool campaignTargetingChangedField; + + private bool campaignTargetingChangedFieldSpecified; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public ChangeStatus campaignChangeStatus { + get { return this.campaignChangeStatusField; } + set { + this.campaignChangeStatusField = value; + this.campaignChangeStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignChangeStatusSpecified { + get { return this.campaignChangeStatusFieldSpecified; } + set { this.campaignChangeStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedAdGroups")] + public AdGroupChangeData[] changedAdGroups { + get { return this.changedAdGroupsField; } + set { this.changedAdGroupsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("addedCampaignCriteria")] + public long[] addedCampaignCriteria { + get { return this.addedCampaignCriteriaField; } + set { this.addedCampaignCriteriaField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deletedCampaignCriteria")] + public long[] deletedCampaignCriteria { + get { return this.deletedCampaignCriteriaField; } + set { this.deletedCampaignCriteriaField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("addedAdExtensions")] + public long[] addedAdExtensions { + get { return this.addedAdExtensionsField; } + set { this.addedAdExtensionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deletedAdExtensions")] + public long[] deletedAdExtensions { + get { return this.deletedAdExtensionsField; } + set { this.deletedAdExtensionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedFeeds")] + public long[] changedFeeds { + get { return this.changedFeedsField; } + set { this.changedFeedsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deletedFeeds")] + public long[] deletedFeeds { + get { return this.deletedFeedsField; } + set { this.deletedFeedsField = value; } + } + + public bool campaignTargetingChanged { + get { return this.campaignTargetingChangedField; } + set { + this.campaignTargetingChangedField = value; + this.campaignTargetingChangedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignTargetingChangedSpecified { + get { return this.campaignTargetingChangedFieldSpecified; } + set { this.campaignTargetingChangedFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/ch/v201309")] + public partial class CustomerChangeData { + private CampaignChangeData[] changedCampaignsField; + + private FeedChangeData[] changedFeedsField; + + private string lastChangeTimestampField; + + [System.Xml.Serialization.XmlElementAttribute("changedCampaigns")] + public CampaignChangeData[] changedCampaigns { + get { return this.changedCampaignsField; } + set { this.changedCampaignsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedFeeds")] + public FeedChangeData[] changedFeeds { + get { return this.changedFeedsField; } + set { this.changedFeedsField = value; } + } + + public string lastChangeTimestamp { + get { return this.lastChangeTimestampField; } + set { this.lastChangeTimestampField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class DateTimeRange { + private string minField; + + private string maxField; + + public string min { + get { return this.minField; } + set { this.minField = value; } + } + + public string max { + get { return this.maxField; } + set { this.maxField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/ch/v201309")] + public partial class CustomerSyncSelector { + private DateTimeRange dateTimeRangeField; + + private long[] campaignIdsField; + + private long[] feedIdsField; + + public DateTimeRange dateTimeRange { + get { return this.dateTimeRangeField; } + set { this.dateTimeRangeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignIds")] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("feedIds")] + public long[] feedIds { + get { return this.feedIdsField; } + set { this.feedIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/ch/v201309")] + public partial class CustomerSyncError : ApiError { + private CustomerSyncErrorReason reasonField; + + private bool reasonFieldSpecified; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + public CustomerSyncErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomerSyncError.Reason", Namespace = "https://adwords.google.com/api/adwords/ch/v201309")] + public enum CustomerSyncErrorReason { + INVALID_CAMPAIGN_ID, + INVALID_FEED_ID, + INVALID_DATE_RANGE, + TOO_MANY_CHANGES + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdGroupAdServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdGroupAdService : AdWordsSoapClient, IAdGroupAdService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdGroupAdService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/AdGroupAdService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupAdPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((AdGroupAdPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupAdReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +AdGroupAdOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((AdGroupAdReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupAdPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((AdGroupAdPage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupAdReturnValue : ListReturnValue { + private AdGroupAd[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdGroupAd[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupAd { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private Ad adField; + + private AdGroupAdExperimentData experimentDataField; + + private AdGroupAdStatus statusField; + + private bool statusFieldSpecified; + + private AdGroupAdApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + private string[] disapprovalReasonsField; + + private bool trademarkDisapprovedField; + + private bool trademarkDisapprovedFieldSpecified; + + private String_StringMapEntry[] forwardCompatibilityMapField; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public Ad ad { + get { return this.adField; } + set { this.adField = value; } + } + + public AdGroupAdExperimentData experimentData { + get { return this.experimentDataField; } + set { this.experimentDataField = value; } + } + + public AdGroupAdStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public AdGroupAdApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("disapprovalReasons")] + public string[] disapprovalReasons { + get { return this.disapprovalReasonsField; } + set { this.disapprovalReasonsField = value; } + } + + public bool trademarkDisapproved { + get { return this.trademarkDisapprovedField; } + set { + this.trademarkDisapprovedField = value; + this.trademarkDisapprovedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool trademarkDisapprovedSpecified { + get { return this.trademarkDisapprovedFieldSpecified; } + set { this.trademarkDisapprovedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("forwardCompatibilityMap")] + public String_StringMapEntry[] forwardCompatibilityMap { + get { return this.forwardCompatibilityMapField; } + set { this.forwardCompatibilityMapField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DynamicSearchAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TextAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TemplateAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ThirdPartyRedirectAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileImageAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeprecatedAd))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Ad { + private long idField; + + private bool idFieldSpecified; + + private string urlField; + + private string displayUrlField; + + private long devicePreferenceField; + + private bool devicePreferenceFieldSpecified; + + private string adTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + + public string displayUrl { + get { return this.displayUrlField; } + set { this.displayUrlField = value; } + } + + public long devicePreference { + get { return this.devicePreferenceField; } + set { + this.devicePreferenceField = value; + this.devicePreferenceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool devicePreferenceSpecified { + get { return this.devicePreferenceFieldSpecified; } + set { this.devicePreferenceFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Ad.Type")] + public string AdType { + get { return this.adTypeField; } + set { this.adTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class DynamicSearchAd : Ad { + private string description1Field; + + private string description2Field; + + public string description1 { + get { return this.description1Field; } + set { this.description1Field = value; } + } + + public string description2 { + get { return this.description2Field; } + set { this.description2Field = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class TextAd : Ad { + private string headlineField; + + private string description1Field; + + private string description2Field; + + public string headline { + get { return this.headlineField; } + set { this.headlineField = value; } + } + + public string description1 { + get { return this.description1Field; } + set { this.description1Field = value; } + } + + public string description2 { + get { return this.description2Field; } + set { this.description2Field = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class TemplateAd : Ad { + private long templateIdField; + + private bool templateIdFieldSpecified; + + private AdUnionId adUnionIdField; + + private TemplateElement[] templateElementsField; + + private Dimensions dimensionsField; + + private string nameField; + + private int durationField; + + private bool durationFieldSpecified; + + private long originAdIdField; + + private bool originAdIdFieldSpecified; + + public long templateId { + get { return this.templateIdField; } + set { + this.templateIdField = value; + this.templateIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool templateIdSpecified { + get { return this.templateIdFieldSpecified; } + set { this.templateIdFieldSpecified = value; } + } + + public AdUnionId adUnionId { + get { return this.adUnionIdField; } + set { this.adUnionIdField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("templateElements")] + public TemplateElement[] templateElements { + get { return this.templateElementsField; } + set { this.templateElementsField = value; } + } + + public Dimensions dimensions { + get { return this.dimensionsField; } + set { this.dimensionsField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public long originAdId { + get { return this.originAdIdField; } + set { + this.originAdIdField = value; + this.originAdIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool originAdIdSpecified { + get { return this.originAdIdFieldSpecified; } + set { this.originAdIdFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TempAdUnionId))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdUnionId { + private long idField; + + private bool idFieldSpecified; + + private string adUnionIdTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("AdUnionId.Type")] + public string AdUnionIdType { + get { return this.adUnionIdTypeField; } + set { this.adUnionIdTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class TempAdUnionId : AdUnionId { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class TemplateElement { + private string uniqueNameField; + + private TemplateElementField[] fieldsField; + + public string uniqueName { + get { return this.uniqueNameField; } + set { this.uniqueNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("fields")] + public TemplateElementField[] fields { + get { return this.fieldsField; } + set { this.fieldsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class TemplateElementField { + private string nameField; + + private TemplateElementFieldType typeField; + + private bool typeFieldSpecified; + + private string fieldTextField; + + private Media fieldMediaField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public TemplateElementFieldType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public string fieldText { + get { return this.fieldTextField; } + set { this.fieldTextField = value; } + } + + public Media fieldMedia { + get { return this.fieldMediaField; } + set { this.fieldMediaField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TemplateElementField.Type", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum TemplateElementFieldType { + ADDRESS, + AUDIO, + ENUM, + IMAGE, + BACKGROUND_IMAGE, + NUMBER, + TEXT, + URL, + VIDEO, + VISIBLE_URL, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Video))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Image))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Audio))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Media { + private long mediaIdField; + + private bool mediaIdFieldSpecified; + + private MediaMediaType typeField; + + private bool typeFieldSpecified; + + private long referenceIdField; + + private bool referenceIdFieldSpecified; + + private Media_Size_DimensionsMapEntry[] dimensionsField; + + private Media_Size_StringMapEntry[] urlsField; + + private MediaMimeType mimeTypeField; + + private bool mimeTypeFieldSpecified; + + private string sourceUrlField; + + private string nameField; + + private long fileSizeField; + + private bool fileSizeFieldSpecified; + + private string creationTimeField; + + private string mediaTypeField; + + public long mediaId { + get { return this.mediaIdField; } + set { + this.mediaIdField = value; + this.mediaIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mediaIdSpecified { + get { return this.mediaIdFieldSpecified; } + set { this.mediaIdFieldSpecified = value; } + } + + public MediaMediaType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public long referenceId { + get { return this.referenceIdField; } + set { + this.referenceIdField = value; + this.referenceIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool referenceIdSpecified { + get { return this.referenceIdFieldSpecified; } + set { this.referenceIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("dimensions")] + public Media_Size_DimensionsMapEntry[] dimensions { + get { return this.dimensionsField; } + set { this.dimensionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("urls")] + public Media_Size_StringMapEntry[] urls { + get { return this.urlsField; } + set { this.urlsField = value; } + } + + public MediaMimeType mimeType { + get { return this.mimeTypeField; } + set { + this.mimeTypeField = value; + this.mimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mimeTypeSpecified { + get { return this.mimeTypeFieldSpecified; } + set { this.mimeTypeFieldSpecified = value; } + } + + public string sourceUrl { + get { return this.sourceUrlField; } + set { this.sourceUrlField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public long fileSize { + get { return this.fileSizeField; } + set { + this.fileSizeField = value; + this.fileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fileSizeSpecified { + get { return this.fileSizeFieldSpecified; } + set { this.fileSizeFieldSpecified = value; } + } + + public string creationTime { + get { return this.creationTimeField; } + set { this.creationTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Media.Type")] + public string MediaType { + get { return this.mediaTypeField; } + set { this.mediaTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Media.MediaType", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum MediaMediaType { + AUDIO, + DYNAMIC_IMAGE, + ICON, + IMAGE, + STANDARD_ICON, + VIDEO + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Media_Size_DimensionsMapEntry { + private MediaSize keyField; + + private bool keyFieldSpecified; + + private Dimensions valueField; + + public MediaSize key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public Dimensions value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Media.Size", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum MediaSize { + FULL, + SHRUNKEN, + PREVIEW, + VIDEO_THUMBNAIL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Dimensions { + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Media_Size_StringMapEntry { + private MediaSize keyField; + + private bool keyFieldSpecified; + + private string valueField; + + public MediaSize key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Media.MimeType", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum MediaMimeType { + IMAGE_JPEG, + IMAGE_GIF, + IMAGE_PNG, + FLASH, + TEXT_HTML, + PDF, + MSWORD, + MSEXCEL, + RTF, + AUDIO_WAV, + AUDIO_MP3 + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Video : Media { + private long durationMillisField; + + private bool durationMillisFieldSpecified; + + private string streamingUrlField; + + private bool readyToPlayOnTheWebField; + + private bool readyToPlayOnTheWebFieldSpecified; + + private string industryStandardCommercialIdentifierField; + + private string advertisingIdField; + + private string youTubeVideoIdStringField; + + public long durationMillis { + get { return this.durationMillisField; } + set { + this.durationMillisField = value; + this.durationMillisSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationMillisSpecified { + get { return this.durationMillisFieldSpecified; } + set { this.durationMillisFieldSpecified = value; } + } + + public string streamingUrl { + get { return this.streamingUrlField; } + set { this.streamingUrlField = value; } + } + + public bool readyToPlayOnTheWeb { + get { return this.readyToPlayOnTheWebField; } + set { + this.readyToPlayOnTheWebField = value; + this.readyToPlayOnTheWebSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool readyToPlayOnTheWebSpecified { + get { return this.readyToPlayOnTheWebFieldSpecified; } + set { this.readyToPlayOnTheWebFieldSpecified = value; } + } + + public string industryStandardCommercialIdentifier { + get { return this.industryStandardCommercialIdentifierField; } + set { this.industryStandardCommercialIdentifierField = value; } + } + + public string advertisingId { + get { return this.advertisingIdField; } + set { this.advertisingIdField = value; } + } + + public string youTubeVideoIdString { + get { return this.youTubeVideoIdStringField; } + set { this.youTubeVideoIdStringField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Image : Media { + private byte[] dataField; + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] data { + get { return this.dataField; } + set { this.dataField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Audio : Media { + private long durationMillisField; + + private bool durationMillisFieldSpecified; + + private string streamingUrlField; + + private bool readyToPlayOnTheWebField; + + private bool readyToPlayOnTheWebFieldSpecified; + + public long durationMillis { + get { return this.durationMillisField; } + set { + this.durationMillisField = value; + this.durationMillisSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationMillisSpecified { + get { return this.durationMillisFieldSpecified; } + set { this.durationMillisFieldSpecified = value; } + } + + public string streamingUrl { + get { return this.streamingUrlField; } + set { this.streamingUrlField = value; } + } + + public bool readyToPlayOnTheWeb { + get { return this.readyToPlayOnTheWebField; } + set { + this.readyToPlayOnTheWebField = value; + this.readyToPlayOnTheWebSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool readyToPlayOnTheWebSpecified { + get { return this.readyToPlayOnTheWebFieldSpecified; } + set { this.readyToPlayOnTheWebFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ThirdPartyRedirectAd))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public abstract partial class RichMediaAd : Ad { + private string nameField; + + private Dimensions dimensionsField; + + private string snippetField; + + private string impressionBeaconUrlField; + + private int adDurationField; + + private bool adDurationFieldSpecified; + + private long certifiedVendorFormatIdField; + + private bool certifiedVendorFormatIdFieldSpecified; + + private string sourceUrlField; + + private RichMediaAdRichMediaAdType richMediaAdTypeField; + + private bool richMediaAdTypeFieldSpecified; + + private RichMediaAdAdAttribute[] adAttributesField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public Dimensions dimensions { + get { return this.dimensionsField; } + set { this.dimensionsField = value; } + } + + public string snippet { + get { return this.snippetField; } + set { this.snippetField = value; } + } + + public string impressionBeaconUrl { + get { return this.impressionBeaconUrlField; } + set { this.impressionBeaconUrlField = value; } + } + + public int adDuration { + get { return this.adDurationField; } + set { + this.adDurationField = value; + this.adDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adDurationSpecified { + get { return this.adDurationFieldSpecified; } + set { this.adDurationFieldSpecified = value; } + } + + public long certifiedVendorFormatId { + get { return this.certifiedVendorFormatIdField; } + set { + this.certifiedVendorFormatIdField = value; + this.certifiedVendorFormatIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool certifiedVendorFormatIdSpecified { + get { return this.certifiedVendorFormatIdFieldSpecified; } + set { this.certifiedVendorFormatIdFieldSpecified = value; } + } + + public string sourceUrl { + get { return this.sourceUrlField; } + set { this.sourceUrlField = value; } + } + + public RichMediaAdRichMediaAdType richMediaAdType { + get { return this.richMediaAdTypeField; } + set { + this.richMediaAdTypeField = value; + this.richMediaAdTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool richMediaAdTypeSpecified { + get { return this.richMediaAdTypeFieldSpecified; } + set { this.richMediaAdTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adAttributes")] + public RichMediaAdAdAttribute[] adAttributes { + get { return this.adAttributesField; } + set { this.adAttributesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaAd.RichMediaAdType", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum RichMediaAdRichMediaAdType { + STANDARD, + IN_STREAM_VIDEO + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaAd.AdAttribute", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum RichMediaAdAdAttribute { + UNKNOWN, + ROLL_OVER_TO_EXPAND, + SSL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ThirdPartyRedirectAd : RichMediaAd { + private bool isCookieTargetedField; + + private bool isCookieTargetedFieldSpecified; + + private bool isUserInterestTargetedField; + + private bool isUserInterestTargetedFieldSpecified; + + private bool isTaggedField; + + private bool isTaggedFieldSpecified; + + private VideoType[] videoTypesField; + + private ThirdPartyRedirectAdExpandingDirection[] expandingDirectionsField; + + public bool isCookieTargeted { + get { return this.isCookieTargetedField; } + set { + this.isCookieTargetedField = value; + this.isCookieTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isCookieTargetedSpecified { + get { return this.isCookieTargetedFieldSpecified; } + set { this.isCookieTargetedFieldSpecified = value; } + } + + public bool isUserInterestTargeted { + get { return this.isUserInterestTargetedField; } + set { + this.isUserInterestTargetedField = value; + this.isUserInterestTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isUserInterestTargetedSpecified { + get { return this.isUserInterestTargetedFieldSpecified; } + set { this.isUserInterestTargetedFieldSpecified = value; } + } + + public bool isTagged { + get { return this.isTaggedField; } + set { + this.isTaggedField = value; + this.isTaggedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTaggedSpecified { + get { return this.isTaggedFieldSpecified; } + set { this.isTaggedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("videoTypes")] + public VideoType[] videoTypes { + get { return this.videoTypesField; } + set { this.videoTypesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("expandingDirections")] + public ThirdPartyRedirectAdExpandingDirection[] expandingDirections { + get { return this.expandingDirectionsField; } + set { this.expandingDirectionsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum VideoType { + ADOBE, + REALPLAYER, + QUICKTIME, + WINDOWSMEDIA + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ThirdPartyRedirectAd.ExpandingDirection", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ThirdPartyRedirectAdExpandingDirection { + UNKNOWN, + EXPANDING_UP, + EXPANDING_DOWN, + EXPANDING_LEFT, + EXPANDING_RIGHT, + EXPANDING_UPLEFT, + EXPANDING_UPRIGHT, + EXPANDING_DOWNLEFT, + EXPANDING_DOWNRIGHT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ProductAd : Ad { + private string promotionLineField; + + public string promotionLine { + get { return this.promotionLineField; } + set { this.promotionLineField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class MobileImageAd : Ad { + private MarkupLanguageType[] markupLanguagesField; + + private string[] mobileCarriersField; + + private Image imageField; + + [System.Xml.Serialization.XmlElementAttribute("markupLanguages")] + public MarkupLanguageType[] markupLanguages { + get { return this.markupLanguagesField; } + set { this.markupLanguagesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("mobileCarriers")] + public string[] mobileCarriers { + get { return this.mobileCarriersField; } + set { this.mobileCarriersField = value; } + } + + public Image image { + get { return this.imageField; } + set { this.imageField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum MarkupLanguageType { + HTML, + CHTML, + XHTML, + WML + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class MobileAd : Ad { + private string headlineField; + + private string descriptionField; + + private MarkupLanguageType[] markupLanguagesField; + + private string[] mobileCarriersField; + + private string businessNameField; + + private string countryCodeField; + + private string phoneNumberField; + + public string headline { + get { return this.headlineField; } + set { this.headlineField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("markupLanguages")] + public MarkupLanguageType[] markupLanguages { + get { return this.markupLanguagesField; } + set { this.markupLanguagesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("mobileCarriers")] + public string[] mobileCarriers { + get { return this.mobileCarriersField; } + set { this.mobileCarriersField = value; } + } + + public string businessName { + get { return this.businessNameField; } + set { this.businessNameField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + + public string phoneNumber { + get { return this.phoneNumberField; } + set { this.phoneNumberField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ImageAd : Ad { + private Image imageField; + + private string nameField; + + private long adToCopyImageFromField; + + private bool adToCopyImageFromFieldSpecified; + + public Image image { + get { return this.imageField; } + set { this.imageField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public long adToCopyImageFrom { + get { return this.adToCopyImageFromField; } + set { + this.adToCopyImageFromField = value; + this.adToCopyImageFromSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adToCopyImageFromSpecified { + get { return this.adToCopyImageFromFieldSpecified; } + set { this.adToCopyImageFromFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class DeprecatedAd : Ad { + private string nameField; + + private DeprecatedAdType typeField; + + private bool typeFieldSpecified; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DeprecatedAdType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DeprecatedAd.Type", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum DeprecatedAdType { + VIDEO, + CLICK_TO_CALL, + IN_STREAM_VIDEO, + FROOGLE, + TEXT_LINK, + GADGET, + PRINT, + TEXT_WIDE, + GADGET_TEMPLATE, + TEXT_WITH_VIDEO, + AUDIO, + LOCAL_BUSINESS_AD, + AUDIO_TEMPLATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupAdExperimentData { + private long experimentIdField; + + private bool experimentIdFieldSpecified; + + private ExperimentDeltaStatus experimentDeltaStatusField; + + private bool experimentDeltaStatusFieldSpecified; + + private ExperimentDataStatus experimentDataStatusField; + + private bool experimentDataStatusFieldSpecified; + + public long experimentId { + get { return this.experimentIdField; } + set { + this.experimentIdField = value; + this.experimentIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentIdSpecified { + get { return this.experimentIdFieldSpecified; } + set { this.experimentIdFieldSpecified = value; } + } + + public ExperimentDeltaStatus experimentDeltaStatus { + get { return this.experimentDeltaStatusField; } + set { + this.experimentDeltaStatusField = value; + this.experimentDeltaStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentDeltaStatusSpecified { + get { return this.experimentDeltaStatusFieldSpecified; } + set { this.experimentDeltaStatusFieldSpecified = value; } + } + + public ExperimentDataStatus experimentDataStatus { + get { return this.experimentDataStatusField; } + set { + this.experimentDataStatusField = value; + this.experimentDataStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentDataStatusSpecified { + get { return this.experimentDataStatusFieldSpecified; } + set { this.experimentDataStatusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ExperimentDeltaStatus { + EXPERIMENT_ONLY, + MODIFIED, + CONTROL_ONLY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ExperimentDataStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupAd.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AdGroupAdStatus { + ENABLED, + PAUSED, + DISABLED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupAd.ApprovalStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AdGroupAdApprovalStatus { + APPROVED, + DISAPPROVED, + FAMILY_SAFE, + NON_FAMILY_SAFE, + PORN, + UNCHECKED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionPolicyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdParamPolicyError))] + public partial class PolicyViolationError : ApiError { + private PolicyViolationKey keyField; + + private string externalPolicyNameField; + + private string externalPolicyUrlField; + + private string externalPolicyDescriptionField; + + private bool isExemptableField; + + private bool isExemptableFieldSpecified; + + private PolicyViolationErrorPart[] violatingPartsField; + + public PolicyViolationKey key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public string externalPolicyName { + get { return this.externalPolicyNameField; } + set { this.externalPolicyNameField = value; } + } + + public string externalPolicyUrl { + get { return this.externalPolicyUrlField; } + set { this.externalPolicyUrlField = value; } + } + + public string externalPolicyDescription { + get { return this.externalPolicyDescriptionField; } + set { this.externalPolicyDescriptionField = value; } + } + + public bool isExemptable { + get { return this.isExemptableField; } + set { + this.isExemptableField = value; + this.isExemptableSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isExemptableSpecified { + get { return this.isExemptableFieldSpecified; } + set { this.isExemptableFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("violatingParts")] + public PolicyViolationErrorPart[] violatingParts { + get { return this.violatingPartsField; } + set { this.violatingPartsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class PolicyViolationKey { + private string policyNameField; + + private string violatingTextField; + + public string policyName { + get { return this.policyNameField; } + set { this.policyNameField = value; } + } + + public string violatingText { + get { return this.violatingTextField; } + set { this.violatingTextField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PolicyViolationError.Part", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class PolicyViolationErrorPart { + private int indexField; + + private bool indexFieldSpecified; + + private int lengthField; + + private bool lengthFieldSpecified; + + public int index { + get { return this.indexField; } + set { + this.indexField = value; + this.indexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool indexSpecified { + get { return this.indexFieldSpecified; } + set { this.indexFieldSpecified = value; } + } + + public int length { + get { return this.lengthField; } + set { + this.lengthField = value; + this.lengthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lengthSpecified { + get { return this.lengthFieldSpecified; } + set { this.lengthFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class MediaError : ApiError { + private MediaErrorReason reasonField; + + private bool reasonFieldSpecified; + + public MediaErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "MediaError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum MediaErrorReason { + CANNOT_ADD_STANDARD_ICON, + CANNOT_SELECT_STANDARD_ICON_WITH_OTHER_TYPES, + DUPLICATE_MEDIA, + EMPTY_FIELD, + ENTITY_REFERENCED_IN_MULTIPLE_OPS, + FIELD_NOT_SUPPORTED_FOR_MEDIA_SUB_TYPE, + INVALID_MEDIA_ID, + INVALID_MEDIA_TYPE, + INVALID_MEDIA_SUB_TYPE, + INVALID_REFERENCE_ID, + INVALID_YOU_TUBE_ID, + YOU_TUBE_VIDEO_NOT_FOUND, + YOU_TUBE_SERVICE_UNAVAILABLE, + YOU_TUBE_VIDEO_HAS_NON_POSITIVE_DURATION, + MEDIA_FAILED_TRANSCODING, + MEDIA_NOT_TRANSCODED, + MEDIA_TYPE_DOES_NOT_MATCH_OBJECT_TYPE, + NO_FIELDS_SPECIFIED, + NULL_REFERENCE_ID_AND_MEDIA_ID, + TOO_LONG, + UNSUPPORTED_OPERATION, + UNSUPPORTED_TYPE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ImageError : ApiError { + private ImageErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ImageErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ImageError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ImageErrorReason { + INVALID_IMAGE, + STORAGE_ERROR, + BAD_REQUEST, + UNEXPECTED_SIZE, + ANIMATED_NOT_ALLOWED, + ANIMATION_TOO_LONG, + SERVER_ERROR, + CMYK_JPEG_NOT_ALLOWED, + FLASH_NOT_ALLOWED, + FLASH_WITHOUT_CLICKTAG, + ANIMATED_VISUAL_EFFECT, + FLASH_ERROR, + LAYOUT_PROBLEM, + PROBLEM_READING_IMAGE_FILE, + ERROR_STORING_IMAGE, + FLASH_HAS_NETWORK_OBJECTS, + FLASH_HAS_NETWORK_METHODS, + FLASH_HAS_URL, + FLASH_HAS_MOUSE_TRACKING, + FLASH_HAS_RANDOM_NUM, + FLASH_SELF_TARGETS, + FLASH_BAD_GETURL_TARGET, + FLASH_VERSION_NOT_SUPPORTED, + FLASH_WITHOUT_HARD_CODED_CLICK_URL, + INVALID_FLASH_FILE, + FAILED_TO_FIX_CLICK_TAG_IN_FLASH, + FLASH_ACCESSES_NETWORK_RESOURCES, + FLASH_EXTERNAL_JS_CALL, + FLASH_EXTERNAL_FS_CALL, + FILE_TOO_LARGE, + IMAGE_DATA_TOO_LARGE, + IMAGE_PROCESSING_ERROR, + IMAGE_TOO_SMALL, + INVALID_INPUT, + PROBLEM_READING_FILE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupAdCountLimitExceeded : EntityCountLimitExceeded { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupAdError : ApiError { + private AdGroupAdErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdGroupAdErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupAdError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AdGroupAdErrorReason { + AD_NOT_UNDER_ADGROUP, + CANNOT_OPERATE_ON_DELETED_ADGROUPAD, + CANNOT_CREATE_DEPRECATED_ADS, + EMPTY_FIELD, + ENTITY_REFERENCED_IN_MULTIPLE_OPS, + UNSUPPORTED_OPERATION + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdError : ApiError { + private AdErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AdErrorReason { + APPROXIMATELY_TOO_LONG, + APPROXIMATELY_TOO_SHORT, + BAD_SNIPPET, + CANNOT_SET_BUSINESS_NAME_IF_URL_SET, + CANNOT_SET_FIELD_WITH_ORIGIN_AD_ID_SET, + CANNOT_SET_URL, + CUSTOMER_NOT_APPROVED_MOBILEADS, + CUSTOMER_NOT_APPROVED_THIRDPARTY_ADS, + CUSTOMER_NOT_APPROVED_THIRDPARTY_REDIRECT_ADS, + CUSTOMER_NOT_ELIGIBLE, + CUSTOMER_NOT_ELIGIBLE_FOR_UPDATING_BEACON_URL, + DIMENSION_ALREADY_IN_UNION, + DIMENSION_MUST_BE_SET, + DIMENSION_NOT_IN_UNION, + DISPLAY_URL_CANNOT_BE_SPECIFIED, + DOMESTIC_PHONE_NUMBER_FORMAT, + EMERGENCY_PHONE_NUMBER, + EMPTY_FIELD, + INCONSISTENT_STATUS_IN_TEMPLATE_UNION, + INCORRECT_LENGTH, + INVALID_AD_ADDRESS_CAMPAIGN_TARGET, + INVALID_AD_TYPE, + INVALID_ATTRIBUTES_FOR_MOBILE_IMAGE, + INVALID_ATTRIBUTES_FOR_MOBILE_TEXT, + INVALID_CHARACTER_FOR_URL, + INVALID_COUNTRY_CODE, + INVALID_DSA_URL_TAG, + INVALID_INPUT, + INVALID_MARKUP_LANGUAGE, + INVALID_MOBILE_CARRIER, + INVALID_MOBILE_CARRIER_TARGET, + INVALID_NUMBER_OF_ELEMENTS, + INVALID_PHONE_NUMBER_FORMAT, + INVALID_RICH_MEDIA_CERTIFIED_VENDOR_FORMAT_ID, + INVALID_TEMPLATE_DATA, + INVALID_TEMPLATE_ELEMENT_FIELD_TYPE, + INVALID_TEMPLATE_ID, + LINE_TOO_WIDE, + MARKUP_LANGUAGES_PRESENT, + MISSING_ADDRESS_COMPONENT, + MISSING_ADVERTISEMENT_NAME, + MISSING_BUSINESS_NAME, + MISSING_DESCRIPTION1, + MISSING_DESCRIPTION2, + MISSING_DESTINATION_URL, + MISSING_DESTINATION_URL_TAG, + MISSING_DIMENSION, + MISSING_DISPLAY_URL, + MISSING_HEADLINE, + MISSING_HEIGHT, + MISSING_IMAGE, + MISSING_MARKUP_LANGUAGES, + MISSING_MOBILE_CARRIER, + MISSING_PHONE, + MISSING_REQUIRED_TEMPLATE_FIELDS, + MISSING_TEMPLATE_FIELD_VALUE, + MISSING_TEXT, + MISSING_URL_AND_PHONE, + MISSING_VISIBLE_URL, + MISSING_WIDTH, + MUST_USE_TEMP_AD_UNION_ID_ON_ADD, + TOO_LONG, + TOO_SHORT, + UNION_DIMENSIONS_CANNOT_CHANGE, + UNKNOWN_ADDRESS_COMPONENT, + UNKNOWN_FIELD_NAME, + UNKNOWN_UNIQUE_NAME, + UNSUPPORTED_DIMENSIONS, + URL_INVALID_SCHEME, + URL_INVALID_TOP_LEVEL_DOMAIN, + URL_MALFORMED, + URL_NO_HOST, + URL_HOST_NAME_TOO_LONG, + URL_NO_SCHEME, + URL_NO_TOP_LEVEL_DOMAIN, + URL_PATH_NOT_ALLOWED, + URL_PORT_NOT_ALLOWED, + URL_QUERY_NOT_ALLOWED, + URL_SCHEME_BEFORE_DSA_TAG, + USER_DOES_NOT_HAVE_ACCESS_TO_TEMPLATE, + INCONSISTENT_EXPANDABLE_SETTINGS, + INVALID_FORMAT, + INVALID_FIELD_TEXT, + ELEMENT_NOT_PRESENT, + IMAGE_ERROR, + VALUE_NOT_IN_RANGE, + FIELD_NOT_PRESENT, + ADDRESS_NOT_COMPLETE, + ADDRESS_INVALID, + VIDEO_RETRIEVAL_ERROR, + AUDIO_ERROR, + INVALID_YOUTUBE_DISPLAY_URL, + UNSUPPORTED_PARENT_CAMPAIGN_FOR_DEVICE_PREFERENCE, + INCOMPATIBLE_AD_TYPE_AND_DEVICE_PREFERENCE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ExemptionRequest { + private PolicyViolationKey keyField; + + public PolicyViolationKey key { + get { return this.keyField; } + set { this.keyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupAdOperation : Operation { + private AdGroupAd operandField; + + private ExemptionRequest[] exemptionRequestsField; + + public AdGroupAd operand { + get { return this.operandField; } + set { this.operandField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("exemptionRequests")] + public ExemptionRequest[] exemptionRequests { + get { return this.exemptionRequestsField; } + set { this.exemptionRequestsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupAdPage : Page { + private AdGroupAd[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public AdGroupAd[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "DataServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DataEntry))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class DataService : AdWordsSoapClient, IDataService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public DataService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/DataService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupBidLandscapePage getAdGroupBidLandscape(Selector serviceSelector) { + object[] results = this.Invoke("getAdGroupBidLandscape", new object[] { serviceSelector }); + return ((AdGroupBidLandscapePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CriterionBidLandscapePage getCriterionBidLandscape(Selector serviceSelector) { + object[] results = this.Invoke("getCriterionBidLandscape", new object[] { serviceSelector }); + return ((CriterionBidLandscapePage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BidLandscape.LandscapePoint", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BidLandscapeLandscapePoint { + private Money bidField; + + private long clicksField; + + private bool clicksFieldSpecified; + + private Money costField; + + private Money marginalCpcField; + + private long impressionsField; + + private bool impressionsFieldSpecified; + + private long promotedImpressionsField; + + private bool promotedImpressionsFieldSpecified; + + public Money bid { + get { return this.bidField; } + set { this.bidField = value; } + } + + public long clicks { + get { return this.clicksField; } + set { + this.clicksField = value; + this.clicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clicksSpecified { + get { return this.clicksFieldSpecified; } + set { this.clicksFieldSpecified = value; } + } + + public Money cost { + get { return this.costField; } + set { this.costField = value; } + } + + public Money marginalCpc { + get { return this.marginalCpcField; } + set { this.marginalCpcField = value; } + } + + public long impressions { + get { return this.impressionsField; } + set { + this.impressionsField = value; + this.impressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsSpecified { + get { return this.impressionsFieldSpecified; } + set { this.impressionsFieldSpecified = value; } + } + + public long promotedImpressions { + get { return this.promotedImpressionsField; } + set { + this.promotedImpressionsField = value; + this.promotedImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool promotedImpressionsSpecified { + get { return this.promotedImpressionsFieldSpecified; } + set { this.promotedImpressionsFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BidLandscape))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionBidLandscape))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupBidLandscape))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public abstract partial class DataEntry { + private string dataEntryTypeField; + + [System.Xml.Serialization.XmlElementAttribute("DataEntry.Type")] + public string DataEntryType { + get { return this.dataEntryTypeField; } + set { this.dataEntryTypeField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionBidLandscape))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupBidLandscape))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public abstract partial class BidLandscape : DataEntry { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private string startDateField; + + private string endDateField; + + private BidLandscapeLandscapePoint[] landscapePointsField; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public string startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public string endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("landscapePoints")] + public BidLandscapeLandscapePoint[] landscapePoints { + get { return this.landscapePointsField; } + set { this.landscapePointsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CriterionBidLandscape : BidLandscape { + private long criterionIdField; + + private bool criterionIdFieldSpecified; + + public long criterionId { + get { return this.criterionIdField; } + set { + this.criterionIdField = value; + this.criterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionIdSpecified { + get { return this.criterionIdFieldSpecified; } + set { this.criterionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupBidLandscape : BidLandscape { + private AdGroupBidLandscapeType typeField; + + private bool typeFieldSpecified; + + private bool landscapeCurrentField; + + private bool landscapeCurrentFieldSpecified; + + public AdGroupBidLandscapeType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public bool landscapeCurrent { + get { return this.landscapeCurrentField; } + set { + this.landscapeCurrentField = value; + this.landscapeCurrentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool landscapeCurrentSpecified { + get { return this.landscapeCurrentFieldSpecified; } + set { this.landscapeCurrentFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupBidLandscape.Type", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AdGroupBidLandscapeType { + UNIFORM, + DEFAULT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CriterionBidLandscapePage : NoStatsPage { + private CriterionBidLandscape[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public CriterionBidLandscape[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupBidLandscapePage : NoStatsPage { + private AdGroupBidLandscape[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public AdGroupBidLandscape[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class DataError : ApiError { + private DataErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DataErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DataError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum DataErrorReason { + CANNOT_CREATE_TABLE_ENTRY, + NO_TABLE_ENTRY_CLASS_FOR_VIEW_TYPE, + TABLE_SERVICE_ERROR + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ExperimentServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ExperimentService : AdWordsSoapClient, IExperimentService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ExperimentService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/ExperimentService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExperimentPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((ExperimentPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExperimentReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +ExperimentOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((ExperimentReturnValue) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ExperimentReturnValue : ListReturnValue { + private Experiment[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public Experiment[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Experiment { + private long idField; + + private bool idFieldSpecified; + + private long controlIdField; + + private bool controlIdFieldSpecified; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private string nameField; + + private ExperimentStatus statusField; + + private bool statusFieldSpecified; + + private ExperimentServingStatus servingStatusField; + + private bool servingStatusFieldSpecified; + + private int queryPercentageField; + + private bool queryPercentageFieldSpecified; + + private string startDateTimeField; + + private string endDateTimeField; + + private string lastModifiedDateTimeField; + + private ExperimentSummaryStats experimentSummaryStatsField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long controlId { + get { return this.controlIdField; } + set { + this.controlIdField = value; + this.controlIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool controlIdSpecified { + get { return this.controlIdFieldSpecified; } + set { this.controlIdFieldSpecified = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ExperimentStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ExperimentServingStatus servingStatus { + get { return this.servingStatusField; } + set { + this.servingStatusField = value; + this.servingStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool servingStatusSpecified { + get { return this.servingStatusFieldSpecified; } + set { this.servingStatusFieldSpecified = value; } + } + + public int queryPercentage { + get { return this.queryPercentageField; } + set { + this.queryPercentageField = value; + this.queryPercentageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool queryPercentageSpecified { + get { return this.queryPercentageFieldSpecified; } + set { this.queryPercentageFieldSpecified = value; } + } + + public string startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public string endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public string lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public ExperimentSummaryStats experimentSummaryStats { + get { return this.experimentSummaryStatsField; } + set { this.experimentSummaryStatsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ExperimentStatus { + ACTIVE, + DELETED, + PROMOTED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ExperimentServingStatus { + RUNNING, + PENDING, + ENDED, + DELETED, + PROMOTED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ExperimentSummaryStats { + private int adGroupsCountField; + + private bool adGroupsCountFieldSpecified; + + private int adGroupCriteriaCountField; + + private bool adGroupCriteriaCountFieldSpecified; + + private int adGroupAdsCountField; + + private bool adGroupAdsCountFieldSpecified; + + public int adGroupsCount { + get { return this.adGroupsCountField; } + set { + this.adGroupsCountField = value; + this.adGroupsCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupsCountSpecified { + get { return this.adGroupsCountFieldSpecified; } + set { this.adGroupsCountFieldSpecified = value; } + } + + public int adGroupCriteriaCount { + get { return this.adGroupCriteriaCountField; } + set { + this.adGroupCriteriaCountField = value; + this.adGroupCriteriaCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupCriteriaCountSpecified { + get { return this.adGroupCriteriaCountFieldSpecified; } + set { this.adGroupCriteriaCountFieldSpecified = value; } + } + + public int adGroupAdsCount { + get { return this.adGroupAdsCountField; } + set { + this.adGroupAdsCountField = value; + this.adGroupAdsCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupAdsCountSpecified { + get { return this.adGroupAdsCountFieldSpecified; } + set { this.adGroupAdsCountFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ExperimentOperation : Operation { + private Experiment operandField; + + public Experiment operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ExperimentPage : Page { + private Experiment[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Experiment[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ExperimentServiceError : ApiError { + private ExperimentServiceErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ExperimentServiceErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ExperimentServiceError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ExperimentServiceErrorReason { + AFTER_MAXIMUM_ALLOWABLE_DATE, + AOL_PARTNER_CAMPAIGNS_CANT_RUN_EXPERIMENTS, + CANNOT_CREATE_EXPERIMENT_FOR_BIDDING_STRATEGY, + CANNOT_CREATE_EXPERIMENT_FOR_BIDDING_STRATEGY_FEATURE, + CANNOT_SET_DATE_TO_PAST, + CANNOT_SET_END_DATE_WITHOUT_SETTING_START_DATE, + CANNOT_USE_EXPERIMENT_WITH_SHARED_BUDGET, + DATE_OUTSIDE_CAMPAIGN_DATE_RANGE, + EXPERIMENT_ALREADY_STARTED, + EXPERIMENT_ENDED, + EXPERIMENT_LIMIT_EXCEEDED, + INVALID_EXPERIMENT_NAME, + INVALID_QUERY_PERCENTAGE, + CANNOT_CHANGE_QUERY_PERCENTAGE_AFTER_EXPERIMENT_HAS_STARTED, + INVALID_STATUS_UPDATE, + START_DATE_AFTER_END_DATE, + NO_VALID_BUDGET, + EXPERIMENT_NOT_ACTIVE, + EXPERIMENT_SERVICE_ERROR + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "FeedServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class FeedService : AdWordsSoapClient, IFeedService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public FeedService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/FeedService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((FeedPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +FeedOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((FeedReturnValue) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FeedReturnValue : ListReturnValue { + private Feed[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public Feed[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Feed { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private FeedAttribute[] attributesField; + + private FeedStatus statusField; + + private bool statusFieldSpecified; + + private FeedOrigin originField; + + private bool originFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("attributes")] + public FeedAttribute[] attributes { + get { return this.attributesField; } + set { this.attributesField = value; } + } + + public FeedStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public FeedOrigin origin { + get { return this.originField; } + set { + this.originField = value; + this.originSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool originSpecified { + get { return this.originFieldSpecified; } + set { this.originFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FeedAttribute { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private FeedAttributeType typeField; + + private bool typeFieldSpecified; + + private bool isPartOfKeyField; + + private bool isPartOfKeyFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public FeedAttributeType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public bool isPartOfKey { + get { return this.isPartOfKeyField; } + set { + this.isPartOfKeyField = value; + this.isPartOfKeySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isPartOfKeySpecified { + get { return this.isPartOfKeyFieldSpecified; } + set { this.isPartOfKeyFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedAttribute.Type", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum FeedAttributeType { + INT64, + FLOAT, + STRING, + BOOLEAN, + URL, + DATE_TIME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Feed.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum FeedStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Feed.Origin", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum FeedOrigin { + USER, + ADWORDS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FeedOperation : Operation { + private Feed operandField; + + public Feed operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FeedPage : NullStatsPage { + private Feed[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Feed[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FeedError : ApiError { + private FeedErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FeedErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum FeedErrorReason { + ATTRIBUTE_NAMES_NOT_UNIQUE, + ATTRIBUTES_DO_NOT_MATCH_EXISTING_ATTRIBUTES, + CANNOT_CHANGE_FEED_NAME, + CANNOT_CHANGE_ORIGIN, + FEED_DELETED, + FEED_ORIGIN_IS_NOT_USER, + NEW_ATTRIBUTE_CANNOT_BE_PART_OF_UNIQUE_KEY, + TOO_MANY_FEED_ATTRIBUTES_FOR_FEED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "FeedItemServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class FeedItemService : AdWordsSoapClient, IFeedItemService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public FeedItemService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/FeedItemService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedItemPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((FeedItemPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedItemReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +FeedItemOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((FeedItemReturnValue) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FeedItemReturnValue : ListReturnValue { + private FeedItem[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public FeedItem[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FeedItem { + private long feedIdField; + + private bool feedIdFieldSpecified; + + private long feedItemIdField; + + private bool feedItemIdFieldSpecified; + + private FeedItemStatus statusField; + + private bool statusFieldSpecified; + + private string startTimeField; + + private string endTimeField; + + private FeedItemAttributeValue[] attributeValuesField; + + private FeedItemValidationDetail[] validationDetailsField; + + private FeedItemDevicePreference devicePreferenceField; + + private FeedItemSchedule[] schedulingField; + + public long feedId { + get { return this.feedIdField; } + set { + this.feedIdField = value; + this.feedIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedIdSpecified { + get { return this.feedIdFieldSpecified; } + set { this.feedIdFieldSpecified = value; } + } + + public long feedItemId { + get { return this.feedItemIdField; } + set { + this.feedItemIdField = value; + this.feedItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedItemIdSpecified { + get { return this.feedItemIdFieldSpecified; } + set { this.feedItemIdFieldSpecified = value; } + } + + public FeedItemStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public string endTime { + get { return this.endTimeField; } + set { this.endTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("attributeValues")] + public FeedItemAttributeValue[] attributeValues { + get { return this.attributeValuesField; } + set { this.attributeValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("validationDetails")] + public FeedItemValidationDetail[] validationDetails { + get { return this.validationDetailsField; } + set { this.validationDetailsField = value; } + } + + public FeedItemDevicePreference devicePreference { + get { return this.devicePreferenceField; } + set { this.devicePreferenceField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("feedItemSchedules", IsNullable = false)] + public FeedItemSchedule[] scheduling { + get { return this.schedulingField; } + set { this.schedulingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedItem.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum FeedItemStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FeedItemAttributeValue { + private long feedAttributeIdField; + + private bool feedAttributeIdFieldSpecified; + + private long integerValueField; + + private bool integerValueFieldSpecified; + + private double doubleValueField; + + private bool doubleValueFieldSpecified; + + private bool booleanValueField; + + private bool booleanValueFieldSpecified; + + private string stringValueField; + + public long feedAttributeId { + get { return this.feedAttributeIdField; } + set { + this.feedAttributeIdField = value; + this.feedAttributeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedAttributeIdSpecified { + get { return this.feedAttributeIdFieldSpecified; } + set { this.feedAttributeIdFieldSpecified = value; } + } + + public long integerValue { + get { return this.integerValueField; } + set { + this.integerValueField = value; + this.integerValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool integerValueSpecified { + get { return this.integerValueFieldSpecified; } + set { this.integerValueFieldSpecified = value; } + } + + public double doubleValue { + get { return this.doubleValueField; } + set { + this.doubleValueField = value; + this.doubleValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool doubleValueSpecified { + get { return this.doubleValueFieldSpecified; } + set { this.doubleValueFieldSpecified = value; } + } + + public bool booleanValue { + get { return this.booleanValueField; } + set { + this.booleanValueField = value; + this.booleanValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool booleanValueSpecified { + get { return this.booleanValueFieldSpecified; } + set { this.booleanValueFieldSpecified = value; } + } + + public string stringValue { + get { return this.stringValueField; } + set { this.stringValueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FeedItemValidationDetail { + private long feedMappingIdField; + + private bool feedMappingIdFieldSpecified; + + private FeedItemValidationDetailValidationStatus validationStatusField; + + private bool validationStatusFieldSpecified; + + private FeedItemAttributeError[] validationErrorsField; + + private FeedItemValidationDetailApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + public long feedMappingId { + get { return this.feedMappingIdField; } + set { + this.feedMappingIdField = value; + this.feedMappingIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedMappingIdSpecified { + get { return this.feedMappingIdFieldSpecified; } + set { this.feedMappingIdFieldSpecified = value; } + } + + public FeedItemValidationDetailValidationStatus validationStatus { + get { return this.validationStatusField; } + set { + this.validationStatusField = value; + this.validationStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool validationStatusSpecified { + get { return this.validationStatusFieldSpecified; } + set { this.validationStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("validationErrors")] + public FeedItemAttributeError[] validationErrors { + get { return this.validationErrorsField; } + set { this.validationErrorsField = value; } + } + + public FeedItemValidationDetailApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedItemValidationDetail.ValidationStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum FeedItemValidationDetailValidationStatus { + ERROR, + UNCHECKED, + VALID + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FeedItemAttributeError { + private long[] feedAttributeIdsField; + + private int validationErrorCodeField; + + private bool validationErrorCodeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("feedAttributeIds")] + public long[] feedAttributeIds { + get { return this.feedAttributeIdsField; } + set { this.feedAttributeIdsField = value; } + } + + public int validationErrorCode { + get { return this.validationErrorCodeField; } + set { + this.validationErrorCodeField = value; + this.validationErrorCodeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool validationErrorCodeSpecified { + get { return this.validationErrorCodeFieldSpecified; } + set { this.validationErrorCodeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedItemValidationDetail.ApprovalStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum FeedItemValidationDetailApprovalStatus { + APPROVED, + DISAPPROVED, + UNCHECKED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FeedItemDevicePreference { + private long devicePreferenceField; + + private bool devicePreferenceFieldSpecified; + + public long devicePreference { + get { return this.devicePreferenceField; } + set { + this.devicePreferenceField = value; + this.devicePreferenceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool devicePreferenceSpecified { + get { return this.devicePreferenceFieldSpecified; } + set { this.devicePreferenceFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FeedItemSchedule { + private DayOfWeek dayOfWeekField; + + private bool dayOfWeekFieldSpecified; + + private int startHourField; + + private bool startHourFieldSpecified; + + private MinuteOfHour startMinuteField; + + private bool startMinuteFieldSpecified; + + private int endHourField; + + private bool endHourFieldSpecified; + + private MinuteOfHour endMinuteField; + + private bool endMinuteFieldSpecified; + + public DayOfWeek dayOfWeek { + get { return this.dayOfWeekField; } + set { + this.dayOfWeekField = value; + this.dayOfWeekSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dayOfWeekSpecified { + get { return this.dayOfWeekFieldSpecified; } + set { this.dayOfWeekFieldSpecified = value; } + } + + public int startHour { + get { return this.startHourField; } + set { + this.startHourField = value; + this.startHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startHourSpecified { + get { return this.startHourFieldSpecified; } + set { this.startHourFieldSpecified = value; } + } + + public MinuteOfHour startMinute { + get { return this.startMinuteField; } + set { + this.startMinuteField = value; + this.startMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startMinuteSpecified { + get { return this.startMinuteFieldSpecified; } + set { this.startMinuteFieldSpecified = value; } + } + + public int endHour { + get { return this.endHourField; } + set { + this.endHourField = value; + this.endHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endHourSpecified { + get { return this.endHourFieldSpecified; } + set { this.endHourFieldSpecified = value; } + } + + public MinuteOfHour endMinute { + get { return this.endMinuteField; } + set { + this.endMinuteField = value; + this.endMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endMinuteSpecified { + get { return this.endMinuteFieldSpecified; } + set { this.endMinuteFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FeedItemError : ApiError { + private FeedItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FeedItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedItemError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum FeedItemErrorReason { + CANNOT_CONVERT_ATTRIBUTE_VALUE_FROM_STRING, + CANNOT_OPERATE_ON_DELETED_FEED_ITEM, + DATE_TIME_MUST_BE_IN_ACCOUNT_TIME_ZONE, + KEY_ATTRIBUTES_NOT_FOUND, + INVALID_DEVICE_PREFERENCE, + INVALID_SCHEDULE_END, + INVALID_URL, + MISSING_KEY_ATTRIBUTES, + KEY_ATTRIBUTES_NOT_UNIQUE, + CANNOT_MODIFY_KEY_ATTRIBUTE_VALUE, + OVERLAPPING_SCHEDULES, + SCHEDULE_END_NOT_AFTER_START, + TOO_MANY_SCHEDULES_PER_DAY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class EntityAccessDenied : ApiError { + private EntityAccessDeniedReason reasonField; + + private bool reasonFieldSpecified; + + public EntityAccessDeniedReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "EntityAccessDenied.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum EntityAccessDeniedReason { + READ_ACCESS_DENIED, + WRITE_ACCESS_DENIED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FeedItemOperation : Operation { + private FeedItem operandField; + + public FeedItem operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FeedItemPage : NullStatsPage { + private FeedItem[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public FeedItem[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "FeedMappingServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class FeedMappingService : AdWordsSoapClient, IFeedMappingService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public FeedMappingService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/FeedMappingService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedMappingPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((FeedMappingPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedMappingReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +FeedMappingOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((FeedMappingReturnValue) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FeedMappingReturnValue : ListReturnValue { + private FeedMapping[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public FeedMapping[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FeedMapping { + private long feedMappingIdField; + + private bool feedMappingIdFieldSpecified; + + private long feedIdField; + + private bool feedIdFieldSpecified; + + private int placeholderTypeField; + + private bool placeholderTypeFieldSpecified; + + private FeedMappingStatus statusField; + + private bool statusFieldSpecified; + + private AttributeFieldMapping[] attributeFieldMappingsField; + + public long feedMappingId { + get { return this.feedMappingIdField; } + set { + this.feedMappingIdField = value; + this.feedMappingIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedMappingIdSpecified { + get { return this.feedMappingIdFieldSpecified; } + set { this.feedMappingIdFieldSpecified = value; } + } + + public long feedId { + get { return this.feedIdField; } + set { + this.feedIdField = value; + this.feedIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedIdSpecified { + get { return this.feedIdFieldSpecified; } + set { this.feedIdFieldSpecified = value; } + } + + public int placeholderType { + get { return this.placeholderTypeField; } + set { + this.placeholderTypeField = value; + this.placeholderTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool placeholderTypeSpecified { + get { return this.placeholderTypeFieldSpecified; } + set { this.placeholderTypeFieldSpecified = value; } + } + + public FeedMappingStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("attributeFieldMappings")] + public AttributeFieldMapping[] attributeFieldMappings { + get { return this.attributeFieldMappingsField; } + set { this.attributeFieldMappingsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedMapping.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum FeedMappingStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AttributeFieldMapping { + private long feedAttributeIdField; + + private bool feedAttributeIdFieldSpecified; + + private int fieldIdField; + + private bool fieldIdFieldSpecified; + + public long feedAttributeId { + get { return this.feedAttributeIdField; } + set { + this.feedAttributeIdField = value; + this.feedAttributeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedAttributeIdSpecified { + get { return this.feedAttributeIdFieldSpecified; } + set { this.feedAttributeIdFieldSpecified = value; } + } + + public int fieldId { + get { return this.fieldIdField; } + set { + this.fieldIdField = value; + this.fieldIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fieldIdSpecified { + get { return this.fieldIdFieldSpecified; } + set { this.fieldIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FeedMappingOperation : Operation { + private FeedMapping operandField; + + public FeedMapping operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FeedMappingPage : NullStatsPage { + private FeedMapping[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public FeedMapping[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FeedMappingError : ApiError { + private FeedMappingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FeedMappingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedMappingError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum FeedMappingErrorReason { + INVALID_PLACEHOLDER_FIELD, + INVALID_PLACEHOLDER_TYPE, + NO_ATTRIBUTE_FIELD_MAPPINGS, + FEED_ATTRIBUTE_TYPE_MISMATCH, + MULTIPLE_MAPPINGS_FOR_PLACEHOLDER_TYPE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "GeoLocationServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class GeoLocationService : AdWordsSoapClient, IGeoLocationService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public GeoLocationService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/GeoLocationService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual GeoLocation[] get(GeoLocationSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((GeoLocation[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidGeoLocation))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class GeoLocation { + private GeoPoint geoPointField; + + private Address addressField; + + private byte[] encodedLocationField; + + private string geoLocationTypeField; + + public GeoPoint geoPoint { + get { return this.geoPointField; } + set { this.geoPointField = value; } + } + + public Address address { + get { return this.addressField; } + set { this.addressField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] encodedLocation { + get { return this.encodedLocationField; } + set { this.encodedLocationField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("GeoLocation.Type")] + public string GeoLocationType { + get { return this.geoLocationTypeField; } + set { this.geoLocationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class InvalidGeoLocation : GeoLocation { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class GeoLocationSelector { + private Address[] addressesField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("addresses")] + public Address[] addresses { + get { return this.addressesField; } + set { this.addressesField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class GeoLocationError : ApiError { + private GeoLocationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public GeoLocationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GeoLocationError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum GeoLocationErrorReason { + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LocationCriterionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Criterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LocationCriterionService : AdWordsSoapClient, ILocationCriterionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LocationCriterionService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/LocationCriterionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LocationCriterion[] get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((LocationCriterion[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class LocationCriterion { + private Location locationField; + + private string canonicalNameField; + + private long reachField; + + private bool reachFieldSpecified; + + private string localeField; + + private string searchTermField; + + private string countryCodeField; + + public Location location { + get { return this.locationField; } + set { this.locationField = value; } + } + + public string canonicalName { + get { return this.canonicalNameField; } + set { this.canonicalNameField = value; } + } + + public long reach { + get { return this.reachField; } + set { + this.reachField = value; + this.reachSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reachSpecified { + get { return this.reachFieldSpecified; } + set { this.reachFieldSpecified = value; } + } + + public string locale { + get { return this.localeField; } + set { this.localeField = value; } + } + + public string searchTerm { + get { return this.searchTermField; } + set { this.searchTermField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Date { + private int yearField; + + private bool yearFieldSpecified; + + private int monthField; + + private bool monthFieldSpecified; + + private int dayField; + + private bool dayFieldSpecified; + + public int year { + get { return this.yearField; } + set { + this.yearField = value; + this.yearSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool yearSpecified { + get { return this.yearFieldSpecified; } + set { this.yearFieldSpecified = value; } + } + + public int month { + get { return this.monthField; } + set { + this.monthField = value; + this.monthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool monthSpecified { + get { return this.monthFieldSpecified; } + set { this.monthFieldSpecified = value; } + } + + public int day { + get { return this.dayField; } + set { + this.dayField = value; + this.daySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool daySpecified { + get { return this.dayFieldSpecified; } + set { this.dayFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class LocationCriterionServiceError : ApiError { + private LocationCriterionServiceErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LocationCriterionServiceErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LocationCriterionServiceError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum LocationCriterionServiceErrorReason { + REQUIRED_LOCATION_CRITERION_PREDICATE_MISSING, + TOO_MANY_LOCATION_CRITERION_PREDICATES_SPECIFIED, + INVALID_COUNTRY_CODE, + LOCATION_CRITERION_SERVICE_ERROR + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ManagedCustomerServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ManagedCustomerService : AdWordsSoapClient, IManagedCustomerService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ManagedCustomerService() { + this.Url = "https://adwords.google.com/api/adwords/mcm/v201309/ManagedCustomerService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ManagedCustomerPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((ManagedCustomerPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual PendingInvitation[] getPendingInvitations(PendingInvitationSelector selector) { + object[] results = this.Invoke("getPendingInvitations", new object[] { selector }); + return ((PendingInvitation[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ManagedCustomerReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +ManagedCustomerOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((ManagedCustomerReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlArrayAttribute("rval")] + [return: System.Xml.Serialization.XmlArrayItemAttribute("links", IsNullable = false)] + public virtual ManagedCustomerLink[] mutateLink([System.Xml.Serialization.XmlElementAttribute("operations")] +LinkOperation[] operations) { + object[] results = this.Invoke("mutateLink", new object[] { operations }); + return ((ManagedCustomerLink[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlArrayAttribute("rval")] + [return: System.Xml.Serialization.XmlArrayItemAttribute("links", IsNullable = false)] + public virtual ManagedCustomerLink[] mutateManager([System.Xml.Serialization.XmlElementAttribute("operations")] +MoveOperation[] operations) { + object[] results = this.Invoke("mutateManager", new object[] { operations }); + return ((ManagedCustomerLink[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public partial class ManagedCustomerReturnValue { + private ManagedCustomer[] valueField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public ManagedCustomer[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public partial class ManagedCustomer { + private string nameField; + + private string loginField; + + private string companyNameField; + + private long customerIdField; + + private bool customerIdFieldSpecified; + + private bool canManageClientsField; + + private bool canManageClientsFieldSpecified; + + private string currencyCodeField; + + private string dateTimeZoneField; + + private bool testAccountField; + + private bool testAccountFieldSpecified; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string login { + get { return this.loginField; } + set { this.loginField = value; } + } + + public string companyName { + get { return this.companyNameField; } + set { this.companyNameField = value; } + } + + public long customerId { + get { return this.customerIdField; } + set { + this.customerIdField = value; + this.customerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customerIdSpecified { + get { return this.customerIdFieldSpecified; } + set { this.customerIdFieldSpecified = value; } + } + + public bool canManageClients { + get { return this.canManageClientsField; } + set { + this.canManageClientsField = value; + this.canManageClientsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool canManageClientsSpecified { + get { return this.canManageClientsFieldSpecified; } + set { this.canManageClientsFieldSpecified = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public string dateTimeZone { + get { return this.dateTimeZoneField; } + set { this.dateTimeZoneField = value; } + } + + public bool testAccount { + get { return this.testAccountField; } + set { + this.testAccountField = value; + this.testAccountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool testAccountSpecified { + get { return this.testAccountFieldSpecified; } + set { this.testAccountFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public partial class ManagedCustomerOperation : Operation { + private ManagedCustomer operandField; + + public ManagedCustomer operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public partial class MoveOperation : Operation { + private ManagedCustomerLink operandField; + + private long oldManagerCustomerIdField; + + private bool oldManagerCustomerIdFieldSpecified; + + public ManagedCustomerLink operand { + get { return this.operandField; } + set { this.operandField = value; } + } + + public long oldManagerCustomerId { + get { return this.oldManagerCustomerIdField; } + set { + this.oldManagerCustomerIdField = value; + this.oldManagerCustomerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool oldManagerCustomerIdSpecified { + get { return this.oldManagerCustomerIdFieldSpecified; } + set { this.oldManagerCustomerIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public partial class ManagedCustomerLink { + private long managerCustomerIdField; + + private bool managerCustomerIdFieldSpecified; + + private long clientCustomerIdField; + + private bool clientCustomerIdFieldSpecified; + + private LinkStatus linkStatusField; + + private bool linkStatusFieldSpecified; + + private string pendingDescriptiveNameField; + + public long managerCustomerId { + get { return this.managerCustomerIdField; } + set { + this.managerCustomerIdField = value; + this.managerCustomerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool managerCustomerIdSpecified { + get { return this.managerCustomerIdFieldSpecified; } + set { this.managerCustomerIdFieldSpecified = value; } + } + + public long clientCustomerId { + get { return this.clientCustomerIdField; } + set { + this.clientCustomerIdField = value; + this.clientCustomerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clientCustomerIdSpecified { + get { return this.clientCustomerIdFieldSpecified; } + set { this.clientCustomerIdFieldSpecified = value; } + } + + public LinkStatus linkStatus { + get { return this.linkStatusField; } + set { + this.linkStatusField = value; + this.linkStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool linkStatusSpecified { + get { return this.linkStatusFieldSpecified; } + set { this.linkStatusFieldSpecified = value; } + } + + public string pendingDescriptiveName { + get { return this.pendingDescriptiveNameField; } + set { this.pendingDescriptiveNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public enum LinkStatus { + ACTIVE, + INACTIVE, + PENDING, + REFUSED, + CANCELLED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public partial class LinkOperation : Operation { + private ManagedCustomerLink operandField; + + public ManagedCustomerLink operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public partial class PendingInvitation { + private ManagedCustomer managerField; + + private ManagedCustomer clientField; + + private string creationDateField; + + private string expirationDateField; + + public ManagedCustomer manager { + get { return this.managerField; } + set { this.managerField = value; } + } + + public ManagedCustomer client { + get { return this.clientField; } + set { this.clientField = value; } + } + + public string creationDate { + get { return this.creationDateField; } + set { this.creationDateField = value; } + } + + public string expirationDate { + get { return this.expirationDateField; } + set { this.expirationDateField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public partial class PendingInvitationSelector { + private long[] managerCustomerIdsField; + + private long[] clientCustomerIdsField; + + [System.Xml.Serialization.XmlElementAttribute("managerCustomerIds")] + public long[] managerCustomerIds { + get { return this.managerCustomerIdsField; } + set { this.managerCustomerIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("clientCustomerIds")] + public long[] clientCustomerIds { + get { return this.clientCustomerIdsField; } + set { this.clientCustomerIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public partial class ManagedCustomerPage : Page { + private ManagedCustomer[] entriesField; + + private ManagedCustomerLink[] linksField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public ManagedCustomer[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("links")] + public ManagedCustomerLink[] links { + get { return this.linksField; } + set { this.linksField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public partial class ManagedCustomerServiceError : ApiError { + private ManagedCustomerServiceErrorReason reasonField; + + private bool reasonFieldSpecified; + + private long[] customerIdsField; + + public ManagedCustomerServiceErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customerIds")] + public long[] customerIds { + get { return this.customerIdsField; } + set { this.customerIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ManagedCustomerServiceError.Reason", Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public enum ManagedCustomerServiceErrorReason { + UNKNOWN, + NOT_AUTHORIZED, + INVALID_SELECTOR, + INVALID_TIMEZONE, + INVALID_CURRENCY, + INVALID_DESCRIPTIVE_NAME, + ADD_CUSTOMER_FAILURE, + SAVE_CUSTOMERS_FAILURE, + TEST_ACCOUNT_LINK_ERROR + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "MediaServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class MediaService : AdWordsSoapClient, IMediaService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public MediaService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/MediaService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual MediaPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((MediaPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Media[] upload([System.Xml.Serialization.XmlElementAttribute("media")] +Media[] media) { + object[] results = this.Invoke("upload", new object[] { media }); + return ((Media[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class MediaPage { + private Media[] entriesField; + + private int totalNumEntriesField; + + private bool totalNumEntriesFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Media[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + + public int totalNumEntries { + get { return this.totalNumEntriesField; } + set { + this.totalNumEntriesField = value; + this.totalNumEntriesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalNumEntriesSpecified { + get { return this.totalNumEntriesFieldSpecified; } + set { this.totalNumEntriesFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class VideoError : ApiError { + private VideoErrorReason reasonField; + + private bool reasonFieldSpecified; + + public VideoErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum VideoErrorReason { + INVALID_VIDEO, + STORAGE_ERROR, + BAD_REQUEST, + ERROR_GENERATING_STREAMING_URL, + UNEXPECTED_SIZE, + SERVER_ERROR, + FILE_TOO_LARGE, + VIDEO_PROCESSING_ERROR, + INVALID_INPUT, + PROBLEM_READING_FILE, + INVALID_ISCI, + INVALID_AD_ID + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AudioError : ApiError { + private AudioErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AudioErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudioError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AudioErrorReason { + INVALID_AUDIO, + PROBLEM_READING_AUDIO_FILE, + ERROR_STORING_AUDIO, + FILE_TOO_LARGE, + UNSUPPORTED_AUDIO, + ERROR_GENERATING_STREAMING_URL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "MutateJobServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class MutateJobService : AdWordsSoapClient, IMutateJobService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public MutateJobService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/MutateJobService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Job[] get(JobSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((Job[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual JobResult getResult(JobSelector selector) { + object[] results = this.Invoke("getResult", new object[] { selector }); + return ((JobResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SimpleMutateJob mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +Operation[] operations, BulkMutateJobPolicy policy) { + object[] results = this.Invoke("mutate", new object[] { operations, policy }); + return ((SimpleMutateJob) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class SimpleMutateResult { + private Operand[] resultsField; + + private ApiError[] errorsField; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Operand[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("errors")] + public ApiError[] errors { + get { return this.errorsField; } + set { this.errorsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Operand { + private object itemField; + + [System.Xml.Serialization.XmlElementAttribute("Ad", typeof(Ad))] + [System.Xml.Serialization.XmlElementAttribute("AdExtensionOverride", typeof(AdExtensionOverride))] + [System.Xml.Serialization.XmlElementAttribute("AdGroup", typeof(AdGroup))] + [System.Xml.Serialization.XmlElementAttribute("AdGroupAd", typeof(AdGroupAd))] + [System.Xml.Serialization.XmlElementAttribute("AdGroupBidModifier", typeof(AdGroupBidModifier))] + [System.Xml.Serialization.XmlElementAttribute("AdGroupCriterion", typeof(AdGroupCriterion))] + [System.Xml.Serialization.XmlElementAttribute("Budget", typeof(Budget))] + [System.Xml.Serialization.XmlElementAttribute("Campaign", typeof(Campaign))] + [System.Xml.Serialization.XmlElementAttribute("CampaignAdExtension", typeof(CampaignAdExtension))] + [System.Xml.Serialization.XmlElementAttribute("CampaignCriterion", typeof(CampaignCriterion))] + [System.Xml.Serialization.XmlElementAttribute("FeedItem", typeof(FeedItem))] + [System.Xml.Serialization.XmlElementAttribute("Job", typeof(Job))] + [System.Xml.Serialization.XmlElementAttribute("Media", typeof(Media))] + [System.Xml.Serialization.XmlElementAttribute("PlaceHolder", typeof(PlaceHolder))] + [System.Xml.Serialization.XmlElementAttribute("Target", typeof(Target))] + [System.Xml.Serialization.XmlElementAttribute("TargetList", typeof(TargetList))] + public object Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdExtensionOverride { + private long adIdField; + + private bool adIdFieldSpecified; + + private AdExtension adExtensionField; + + private OverrideInfo overrideInfoField; + + private AdExtensionOverrideStatus statusField; + + private bool statusFieldSpecified; + + private AdExtensionOverrideApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + public long adId { + get { return this.adIdField; } + set { + this.adIdField = value; + this.adIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adIdSpecified { + get { return this.adIdFieldSpecified; } + set { this.adIdFieldSpecified = value; } + } + + public AdExtension adExtension { + get { return this.adExtensionField; } + set { this.adExtensionField = value; } + } + + public OverrideInfo overrideInfo { + get { return this.overrideInfoField; } + set { this.overrideInfoField = value; } + } + + public AdExtensionOverrideStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public AdExtensionOverrideApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class OverrideInfo { + private LocationOverrideInfo itemField; + + [System.Xml.Serialization.XmlElementAttribute("LocationOverrideInfo")] + public LocationOverrideInfo Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class LocationOverrideInfo { + private int radiusField; + + private bool radiusFieldSpecified; + + private LocationOverrideInfoRadiusUnits radiusUnitsField; + + private bool radiusUnitsFieldSpecified; + + public int radius { + get { return this.radiusField; } + set { + this.radiusField = value; + this.radiusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool radiusSpecified { + get { return this.radiusFieldSpecified; } + set { this.radiusFieldSpecified = value; } + } + + public LocationOverrideInfoRadiusUnits radiusUnits { + get { return this.radiusUnitsField; } + set { + this.radiusUnitsField = value; + this.radiusUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool radiusUnitsSpecified { + get { return this.radiusUnitsFieldSpecified; } + set { this.radiusUnitsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LocationOverrideInfo.RadiusUnits", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum LocationOverrideInfoRadiusUnits { + KILOMETERS, + MILES + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdExtensionOverride.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AdExtensionOverrideStatus { + ACTIVE, + DELETED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdExtensionOverride.ApprovalStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AdExtensionOverrideApprovalStatus { + APPROVED, + UNCHECKED, + DISAPPROVED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroup { + private long idField; + + private bool idFieldSpecified; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private string campaignNameField; + + private string nameField; + + private AdGroupStatus statusField; + + private bool statusFieldSpecified; + + private Setting[] settingsField; + + private AdGroupExperimentData experimentDataField; + + private String_StringMapEntry[] forwardCompatibilityMapField; + + private BiddingStrategyConfiguration biddingStrategyConfigurationField; + + private CriterionTypeGroup contentBidCriterionTypeGroupField; + + private bool contentBidCriterionTypeGroupFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public string campaignName { + get { return this.campaignNameField; } + set { this.campaignNameField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public AdGroupStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("settings")] + public Setting[] settings { + get { return this.settingsField; } + set { this.settingsField = value; } + } + + public AdGroupExperimentData experimentData { + get { return this.experimentDataField; } + set { this.experimentDataField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("forwardCompatibilityMap")] + public String_StringMapEntry[] forwardCompatibilityMap { + get { return this.forwardCompatibilityMapField; } + set { this.forwardCompatibilityMapField = value; } + } + + public BiddingStrategyConfiguration biddingStrategyConfiguration { + get { return this.biddingStrategyConfigurationField; } + set { this.biddingStrategyConfigurationField = value; } + } + + public CriterionTypeGroup contentBidCriterionTypeGroup { + get { return this.contentBidCriterionTypeGroupField; } + set { + this.contentBidCriterionTypeGroupField = value; + this.contentBidCriterionTypeGroupSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contentBidCriterionTypeGroupSpecified { + get { return this.contentBidCriterionTypeGroupFieldSpecified; } + set { this.contentBidCriterionTypeGroupFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroup.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AdGroupStatus { + ENABLED, + PAUSED, + DELETED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class TargetingSetting : Setting { + private TargetingSettingDetail[] detailsField; + + [System.Xml.Serialization.XmlElementAttribute("details")] + public TargetingSettingDetail[] details { + get { return this.detailsField; } + set { this.detailsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class TargetingSettingDetail { + private CriterionTypeGroup criterionTypeGroupField; + + private bool criterionTypeGroupFieldSpecified; + + private bool targetAllField; + + private bool targetAllFieldSpecified; + + public CriterionTypeGroup criterionTypeGroup { + get { return this.criterionTypeGroupField; } + set { + this.criterionTypeGroupField = value; + this.criterionTypeGroupSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionTypeGroupSpecified { + get { return this.criterionTypeGroupFieldSpecified; } + set { this.criterionTypeGroupFieldSpecified = value; } + } + + public bool targetAll { + get { return this.targetAllField; } + set { + this.targetAllField = value; + this.targetAllSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetAllSpecified { + get { return this.targetAllFieldSpecified; } + set { this.targetAllFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum CriterionTypeGroup { + KEYWORD, + USER_INTEREST_AND_LIST, + VERTICAL, + GENDER, + AGE_RANGE, + PLACEMENT, + NONE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ExplorerAutoOptimizerSetting : Setting { + private bool optInField; + + private bool optInFieldSpecified; + + public bool optIn { + get { return this.optInField; } + set { + this.optInField = value; + this.optInSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool optInSpecified { + get { return this.optInFieldSpecified; } + set { this.optInFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupExperimentData { + private long experimentIdField; + + private bool experimentIdFieldSpecified; + + private ExperimentDeltaStatus experimentDeltaStatusField; + + private bool experimentDeltaStatusFieldSpecified; + + private ExperimentDataStatus experimentDataStatusField; + + private bool experimentDataStatusFieldSpecified; + + private AdGroupExperimentBidMultipliers experimentBidMultipliersField; + + public long experimentId { + get { return this.experimentIdField; } + set { + this.experimentIdField = value; + this.experimentIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentIdSpecified { + get { return this.experimentIdFieldSpecified; } + set { this.experimentIdFieldSpecified = value; } + } + + public ExperimentDeltaStatus experimentDeltaStatus { + get { return this.experimentDeltaStatusField; } + set { + this.experimentDeltaStatusField = value; + this.experimentDeltaStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentDeltaStatusSpecified { + get { return this.experimentDeltaStatusFieldSpecified; } + set { this.experimentDeltaStatusFieldSpecified = value; } + } + + public ExperimentDataStatus experimentDataStatus { + get { return this.experimentDataStatusField; } + set { + this.experimentDataStatusField = value; + this.experimentDataStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentDataStatusSpecified { + get { return this.experimentDataStatusFieldSpecified; } + set { this.experimentDataStatusFieldSpecified = value; } + } + + public AdGroupExperimentBidMultipliers experimentBidMultipliers { + get { return this.experimentBidMultipliersField; } + set { this.experimentBidMultipliersField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManualCPMAdGroupExperimentBidMultipliers))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManualCPCAdGroupExperimentBidMultipliers))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public abstract partial class AdGroupExperimentBidMultipliers { + private string adGroupExperimentBidMultipliersTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AdGroupExperimentBidMultipliers.Type")] + public string AdGroupExperimentBidMultipliersType { + get { return this.adGroupExperimentBidMultipliersTypeField; } + set { this.adGroupExperimentBidMultipliersTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ManualCPMAdGroupExperimentBidMultipliers : AdGroupExperimentBidMultipliers { + private BidMultiplier maxCpmMultiplierField; + + public BidMultiplier maxCpmMultiplier { + get { return this.maxCpmMultiplierField; } + set { this.maxCpmMultiplierField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BidMultiplier { + private double multiplierField; + + private bool multiplierFieldSpecified; + + private Bid multipliedBidField; + + public double multiplier { + get { return this.multiplierField; } + set { + this.multiplierField = value; + this.multiplierSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool multiplierSpecified { + get { return this.multiplierFieldSpecified; } + set { this.multiplierFieldSpecified = value; } + } + + public Bid multipliedBid { + get { return this.multipliedBidField; } + set { this.multipliedBidField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class Bid { + private Money amountField; + + public Money amount { + get { return this.amountField; } + set { this.amountField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ManualCPCAdGroupExperimentBidMultipliers : AdGroupExperimentBidMultipliers { + private BidMultiplier maxCpcMultiplierField; + + private BidMultiplier maxContentCpcMultiplierField; + + public BidMultiplier maxCpcMultiplier { + get { return this.maxCpcMultiplierField; } + set { this.maxCpcMultiplierField = value; } + } + + public BidMultiplier maxContentCpcMultiplier { + get { return this.maxContentCpcMultiplierField; } + set { this.maxContentCpcMultiplierField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupBidModifier { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private Criterion criterionField; + + private double bidModifierField; + + private bool bidModifierFieldSpecified; + + private BidModifierSource bidModifierSourceField; + + private bool bidModifierSourceFieldSpecified; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public Criterion criterion { + get { return this.criterionField; } + set { this.criterionField = value; } + } + + public double bidModifier { + get { return this.bidModifierField; } + set { + this.bidModifierField = value; + this.bidModifierSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidModifierSpecified { + get { return this.bidModifierFieldSpecified; } + set { this.bidModifierFieldSpecified = value; } + } + + public BidModifierSource bidModifierSource { + get { return this.bidModifierSourceField; } + set { + this.bidModifierSourceField = value; + this.bidModifierSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidModifierSourceSpecified { + get { return this.bidModifierSourceFieldSpecified; } + set { this.bidModifierSourceFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum BidModifierSource { + UNKNOWN, + CAMPAIGN, + AD_GROUP + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NegativeAdGroupCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddableAdGroupCriterion))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupCriterion { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private CriterionUse criterionUseField; + + private bool criterionUseFieldSpecified; + + private Criterion criterionField; + + private String_StringMapEntry[] forwardCompatibilityMapField; + + private string adGroupCriterionTypeField; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public CriterionUse criterionUse { + get { return this.criterionUseField; } + set { + this.criterionUseField = value; + this.criterionUseSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionUseSpecified { + get { return this.criterionUseFieldSpecified; } + set { this.criterionUseFieldSpecified = value; } + } + + public Criterion criterion { + get { return this.criterionField; } + set { this.criterionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("forwardCompatibilityMap")] + public String_StringMapEntry[] forwardCompatibilityMap { + get { return this.forwardCompatibilityMapField; } + set { this.forwardCompatibilityMapField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("AdGroupCriterion.Type")] + public string AdGroupCriterionType { + get { return this.adGroupCriterionTypeField; } + set { this.adGroupCriterionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum CriterionUse { + BIDDABLE, + NEGATIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class NegativeAdGroupCriterion : AdGroupCriterion { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BiddableAdGroupCriterion : AdGroupCriterion { + private UserStatus userStatusField; + + private bool userStatusFieldSpecified; + + private SystemServingStatus systemServingStatusField; + + private bool systemServingStatusFieldSpecified; + + private ApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + private string[] disapprovalReasonsField; + + private string destinationUrlField; + + private BiddableAdGroupCriterionExperimentData experimentDataField; + + private Bid firstPageCpcField; + + private Bid topOfPageCpcField; + + private QualityInfo qualityInfoField; + + private BiddingStrategyConfiguration biddingStrategyConfigurationField; + + private double bidModifierField; + + private bool bidModifierFieldSpecified; + + public UserStatus userStatus { + get { return this.userStatusField; } + set { + this.userStatusField = value; + this.userStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userStatusSpecified { + get { return this.userStatusFieldSpecified; } + set { this.userStatusFieldSpecified = value; } + } + + public SystemServingStatus systemServingStatus { + get { return this.systemServingStatusField; } + set { + this.systemServingStatusField = value; + this.systemServingStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool systemServingStatusSpecified { + get { return this.systemServingStatusFieldSpecified; } + set { this.systemServingStatusFieldSpecified = value; } + } + + public ApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("disapprovalReasons")] + public string[] disapprovalReasons { + get { return this.disapprovalReasonsField; } + set { this.disapprovalReasonsField = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + public BiddableAdGroupCriterionExperimentData experimentData { + get { return this.experimentDataField; } + set { this.experimentDataField = value; } + } + + public Bid firstPageCpc { + get { return this.firstPageCpcField; } + set { this.firstPageCpcField = value; } + } + + public Bid topOfPageCpc { + get { return this.topOfPageCpcField; } + set { this.topOfPageCpcField = value; } + } + + public QualityInfo qualityInfo { + get { return this.qualityInfoField; } + set { this.qualityInfoField = value; } + } + + public BiddingStrategyConfiguration biddingStrategyConfiguration { + get { return this.biddingStrategyConfigurationField; } + set { this.biddingStrategyConfigurationField = value; } + } + + public double bidModifier { + get { return this.bidModifierField; } + set { + this.bidModifierField = value; + this.bidModifierSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidModifierSpecified { + get { return this.bidModifierFieldSpecified; } + set { this.bidModifierFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum UserStatus { + ACTIVE, + DELETED, + PAUSED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum SystemServingStatus { + ELIGIBLE, + RARELY_SERVED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ApprovalStatus { + APPROVED, + PENDING_REVIEW, + UNDER_REVIEW, + DISAPPROVED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BiddableAdGroupCriterionExperimentData { + private long experimentIdField; + + private bool experimentIdFieldSpecified; + + private ExperimentDeltaStatus experimentDeltaStatusField; + + private bool experimentDeltaStatusFieldSpecified; + + private ExperimentDataStatus experimentDataStatusField; + + private bool experimentDataStatusFieldSpecified; + + private AdGroupCriterionExperimentBidMultiplier experimentBidMultiplierField; + + public long experimentId { + get { return this.experimentIdField; } + set { + this.experimentIdField = value; + this.experimentIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentIdSpecified { + get { return this.experimentIdFieldSpecified; } + set { this.experimentIdFieldSpecified = value; } + } + + public ExperimentDeltaStatus experimentDeltaStatus { + get { return this.experimentDeltaStatusField; } + set { + this.experimentDeltaStatusField = value; + this.experimentDeltaStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentDeltaStatusSpecified { + get { return this.experimentDeltaStatusFieldSpecified; } + set { this.experimentDeltaStatusFieldSpecified = value; } + } + + public ExperimentDataStatus experimentDataStatus { + get { return this.experimentDataStatusField; } + set { + this.experimentDataStatusField = value; + this.experimentDataStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentDataStatusSpecified { + get { return this.experimentDataStatusFieldSpecified; } + set { this.experimentDataStatusFieldSpecified = value; } + } + + public AdGroupCriterionExperimentBidMultiplier experimentBidMultiplier { + get { return this.experimentBidMultiplierField; } + set { this.experimentBidMultiplierField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManualCPCAdGroupCriterionExperimentBidMultiplier))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public abstract partial class AdGroupCriterionExperimentBidMultiplier { + private string adGroupCriterionExperimentBidMultiplierTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AdGroupCriterionExperimentBidMultiplier.Type")] + public string AdGroupCriterionExperimentBidMultiplierType { + get { return this.adGroupCriterionExperimentBidMultiplierTypeField; } + set { this.adGroupCriterionExperimentBidMultiplierTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ManualCPCAdGroupCriterionExperimentBidMultiplier : AdGroupCriterionExperimentBidMultiplier { + private BidMultiplier maxCpcMultiplierField; + + private MultiplierSource multiplierSourceField; + + private bool multiplierSourceFieldSpecified; + + public BidMultiplier maxCpcMultiplier { + get { return this.maxCpcMultiplierField; } + set { this.maxCpcMultiplierField = value; } + } + + public MultiplierSource multiplierSource { + get { return this.multiplierSourceField; } + set { + this.multiplierSourceField = value; + this.multiplierSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool multiplierSourceSpecified { + get { return this.multiplierSourceFieldSpecified; } + set { this.multiplierSourceFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum MultiplierSource { + ADGROUP, + CRITERION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class QualityInfo { + private bool isKeywordAdRelevanceAcceptableField; + + private bool isKeywordAdRelevanceAcceptableFieldSpecified; + + private bool isLandingPageQualityAcceptableField; + + private bool isLandingPageQualityAcceptableFieldSpecified; + + private bool isLandingPageLatencyAcceptableField; + + private bool isLandingPageLatencyAcceptableFieldSpecified; + + private int qualityScoreField; + + private bool qualityScoreFieldSpecified; + + public bool isKeywordAdRelevanceAcceptable { + get { return this.isKeywordAdRelevanceAcceptableField; } + set { + this.isKeywordAdRelevanceAcceptableField = value; + this.isKeywordAdRelevanceAcceptableSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isKeywordAdRelevanceAcceptableSpecified { + get { return this.isKeywordAdRelevanceAcceptableFieldSpecified; } + set { this.isKeywordAdRelevanceAcceptableFieldSpecified = value; } + } + + public bool isLandingPageQualityAcceptable { + get { return this.isLandingPageQualityAcceptableField; } + set { + this.isLandingPageQualityAcceptableField = value; + this.isLandingPageQualityAcceptableSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isLandingPageQualityAcceptableSpecified { + get { return this.isLandingPageQualityAcceptableFieldSpecified; } + set { this.isLandingPageQualityAcceptableFieldSpecified = value; } + } + + public bool isLandingPageLatencyAcceptable { + get { return this.isLandingPageLatencyAcceptableField; } + set { + this.isLandingPageLatencyAcceptableField = value; + this.isLandingPageLatencyAcceptableSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isLandingPageLatencyAcceptableSpecified { + get { return this.isLandingPageLatencyAcceptableFieldSpecified; } + set { this.isLandingPageLatencyAcceptableFieldSpecified = value; } + } + + public int qualityScore { + get { return this.qualityScoreField; } + set { + this.qualityScoreField = value; + this.qualityScoreSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool qualityScoreSpecified { + get { return this.qualityScoreFieldSpecified; } + set { this.qualityScoreFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SimpleMutateJob))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BulkMutateJob))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public abstract partial class Job { + private ApiErrorReason failureReasonField; + + private JobStats statsField; + + private BillingSummary billingSummaryField; + + private string jobTypeField; + + public ApiErrorReason failureReason { + get { return this.failureReasonField; } + set { this.failureReasonField = value; } + } + + public JobStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public BillingSummary billingSummary { + get { return this.billingSummaryField; } + set { this.billingSummaryField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Job.Type")] + public string JobType { + get { return this.jobTypeField; } + set { this.jobTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ApiErrorReason { + private object itemField; + + [System.Xml.Serialization.XmlElementAttribute("AdErrorReason", typeof(AdErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AdExtensionErrorReason", typeof(AdExtensionErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AdExtensionOverrideErrorReason", typeof(AdExtensionOverrideErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AdGroupAdErrorReason", typeof(AdGroupAdErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AdGroupCriterionErrorReason", typeof(AdGroupCriterionErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AdGroupServiceErrorReason", typeof(AdGroupServiceErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AdxErrorReason", typeof(AdxErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AuthenticationErrorReason", typeof(AuthenticationErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AuthorizationErrorReason", typeof(AuthorizationErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("BetaErrorReason", typeof(BetaErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("BiddingErrorReason", typeof(BiddingErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("BiddingErrorsReason", typeof(BiddingErrorsReason))] + [System.Xml.Serialization.XmlElementAttribute("BiddingTransitionErrorReason", typeof(BiddingTransitionErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("BudgetErrorReason", typeof(BudgetErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("BulkMutateJobErrorReason", typeof(BulkMutateJobErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("CampaignAdExtensionErrorReason", typeof(CampaignAdExtensionErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("CampaignCriterionErrorReason", typeof(CampaignCriterionErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("CampaignErrorReason", typeof(CampaignErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("ClientTermsErrorReason", typeof(ClientTermsErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("CriterionErrorReason", typeof(CriterionErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("DatabaseErrorReason", typeof(DatabaseErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("DateErrorReason", typeof(DateErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("DistinctErrorReason", typeof(DistinctErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("EntityAccessDeniedReason", typeof(EntityAccessDeniedReason))] + [System.Xml.Serialization.XmlElementAttribute("EntityCountLimitExceededReason", typeof(EntityCountLimitExceededReason))] + [System.Xml.Serialization.XmlElementAttribute("EntityNotFoundReason", typeof(EntityNotFoundReason))] + [System.Xml.Serialization.XmlElementAttribute("FeedItemErrorReason", typeof(FeedItemErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("ForwardCompatibilityErrorReason", typeof(ForwardCompatibilityErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("FunctionParsingErrorReason", typeof(FunctionParsingErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("IdErrorReason", typeof(IdErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("ImageErrorReason", typeof(ImageErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("InternalApiErrorReason", typeof(InternalApiErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("JobErrorReason", typeof(JobErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("MediaErrorReason", typeof(MediaErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("NewEntityCreationErrorReason", typeof(NewEntityCreationErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("NotEmptyErrorReason", typeof(NotEmptyErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("NotWhitelistedErrorReason", typeof(NotWhitelistedErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("NullErrorReason", typeof(NullErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("OperationAccessDeniedReason", typeof(OperationAccessDeniedReason))] + [System.Xml.Serialization.XmlElementAttribute("OperatorErrorReason", typeof(OperatorErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("PagingErrorReason", typeof(PagingErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("PolicyViolationErrorReason", typeof(PolicyViolationErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("QueryErrorReason", typeof(QueryErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("QuotaCheckErrorReason", typeof(QuotaCheckErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("QuotaErrorReason", typeof(QuotaErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("RangeErrorReason", typeof(RangeErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("RateExceededErrorReason", typeof(RateExceededErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("ReadOnlyErrorReason", typeof(ReadOnlyErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("RegionCodeErrorReason", typeof(RegionCodeErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("RejectedErrorReason", typeof(RejectedErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("RequestErrorReason", typeof(RequestErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("RequiredErrorReason", typeof(RequiredErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("SelectorErrorReason", typeof(SelectorErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("SettingErrorReason", typeof(SettingErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("SizeLimitErrorReason", typeof(SizeLimitErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("StatsQueryErrorReason", typeof(StatsQueryErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("StringLengthErrorReason", typeof(StringLengthErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("TargetErrorReason", typeof(TargetErrorReason))] + public object Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdExtensionOverrideError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AdExtensionOverrideErrorReason { + AD_ALREADY_HAS_ADEXTENSION_OVERRIDE, + ADEXTENSION_ID_MUST_BE_SPECIFIED, + ADEXTENSION_LATITUTE_CANNOT_CHANGE_AFTER_BEING_SET_ONCE, + ADEXTENSION_LONGITUDE_CANNOT_CHANGE_AFTER_BEING_SET_ONCE, + ADEXTENSION_NOT_UNDER_CAMPAIGN, + CANNOT_OPERATE_ON_DELETED_OVERRIDE, + CANNOT_OVERRIDE_EXTENSIONS_ON_NON_TEXT_AD, + CANNOT_OVERRIDE_USING_NON_LOCATION_EXTENSION, + INVALID_ADEXTENSION_ID, + LOCATION_OVERRIDE_INFO_REQUIRED_FOR_NEW_LOCATION_EXTENSION_OVERRIDE, + OVERRIDE_INFO_MUST_BE_NULL_AFTER_BEING_SET_ONCE, + RADIUS_TOO_LARGE, + RADIUS_TOO_SMALL, + UNKNOWN_ADEXTENSION_OVERRIDE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupCriterionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AdGroupCriterionErrorReason { + INVALID_ID_FILTER_TYPE, + ID_FILTERS_HAVE_DIFF_FIELDS_SET, + INAPPLICABLE_FOR_NEGATIVE, + INAPPLICABLE_FILTER_SPECIFIED, + TOO_MANY_OPERTAIONS, + CANT_UPDATE_NEGATIVE, + TYPE_MISMATCH, + CONCRETE_TYPE_REQUIRED, + BID_INCOMPATIBLE_WITH_ADGROUP, + NETWORK_NOT_OVERRIDABLE, + CURRENCY_MISMATCH, + CRITERION_NOT_TARGETED, + CANNOT_TARGET_AND_EXCLUDE, + ILLEGAL_URL, + INVALID_VERTICAL_PATH, + NO_EFFECTIVE_BID_FOR_THIS_CRITERION, + INVALID_KEYWORD_TEXT, + INVALID_DESTINATION_URL, + MISSING_DESTINATION_URL_TAG, + KEYWORD_LEVEL_BID_NOT_SUPPORTED_FOR_MANUALCPM, + INVALID_USER_STATUS, + CANNOT_ADD_CRITERIA_TYPE, + CANNOT_EXCLUDE_CRITERIA_TYPE, + PRODUCT_FILTER_TOO_LONG, + INVALID_PRODUCT_FILTER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupServiceError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AdGroupServiceErrorReason { + DUPLICATE_ADGROUP_NAME, + INVALID_ADGROUP_NAME, + USE_SET_OPERATOR_AND_MARK_STATUS_TO_DELETED, + ADVERTISER_NOT_ON_CONTENT_NETWORK, + BID_TOO_BIG, + BID_TYPE_AND_BIDDING_STRATEGY_MISMATCH, + MISSING_ADGROUP_NAME, + INVALID_CONTENT_BID_CRITERION_TYPE_GROUP + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BulkMutateJobError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum BulkMutateJobErrorReason { + CAN_RETURN_RESULT_FOR_ONLY_COMPLETED_JOBS, + CAN_RETURN_RESULT_FOR_ONLY_ONE_JOB, + CANNOT_UPDATE_JOB_ONCE_ALL_REQUEST_PARTS_ARE_RECEIVED, + INVALID_SCOPING_ENTITY_TYPE, + MISSING_SCOPING_ENTITY_FOR_OPERATION_STREAM, + MORE_THAN_ONE_SCOPING_ENTITY_TYPE, + PAYLOAD_STORE_UNAVAILABLE, + REQUEST_PART_IS_OUT_OF_ORDER, + TOO_MANY_OPERATION_STREAMS_IN_REQUEST_PART, + TOO_MANY_OPERATIONS_IN_JOB, + TOO_MANY_OPERATIONS_IN_REQUEST_PART, + TOO_MANY_RESULTS_TO_STORE, + TOO_MANY_SCOPING_ENTITIES, + UNKNOWN, + LOST_RESULT, + UNPROCESSED_RESULT, + BATCH_FAILURE, + SERVICE_PROVIDED_NO_RESULT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FunctionParsingError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum FunctionParsingErrorReason { + NO_MORE_INPUT, + EXPECTED_CHARACTER, + UNEXPECTED_SEPARATOR, + UNMATCHED_LEFT_BRACKET, + UNMATCHED_RIGHT_BRACKET, + TOO_MANY_NESTED_FUNCTIONS, + MISSING_RIGHT_HAND_OPERAND, + INVALID_OPERATOR_NAME, + FEED_ATTRIBUTE_OPERAND_ARGUMENT_NOT_INTEGER, + NO_OPERANDS, + TOO_MANY_OPERANDS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "JobError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum JobErrorReason { + DUPLICATE_JOB_KEY_FOR_CUSTOMER, + JOB_TYPE_NOT_SUPPORTED, + PREREQUISITE_JOB_FAILED, + SELECTOR_CANNOT_USE_BOTH_JOB_IDS_AND_JOB_KEYS, + TOO_LATE_TO_CANCEL_JOB, + TOO_MANY_PREREQUISITE_JOBS, + TOO_MANY_JOBS_IN_QUEUE, + USER_CANCELED_JOB, + WORKFLOW_FAILURE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PolicyViolationError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum PolicyViolationErrorReason { + POLICY_ERROR + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BulkMutateJobStats))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class JobStats { + private int progressPercentField; + + private bool progressPercentFieldSpecified; + + private long pendingTimeMillisField; + + private bool pendingTimeMillisFieldSpecified; + + private long processingTimeMillisField; + + private bool processingTimeMillisFieldSpecified; + + private string jobStatsTypeField; + + public int progressPercent { + get { return this.progressPercentField; } + set { + this.progressPercentField = value; + this.progressPercentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool progressPercentSpecified { + get { return this.progressPercentFieldSpecified; } + set { this.progressPercentFieldSpecified = value; } + } + + public long pendingTimeMillis { + get { return this.pendingTimeMillisField; } + set { + this.pendingTimeMillisField = value; + this.pendingTimeMillisSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool pendingTimeMillisSpecified { + get { return this.pendingTimeMillisFieldSpecified; } + set { this.pendingTimeMillisFieldSpecified = value; } + } + + public long processingTimeMillis { + get { return this.processingTimeMillisField; } + set { + this.processingTimeMillisField = value; + this.processingTimeMillisSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool processingTimeMillisSpecified { + get { return this.processingTimeMillisFieldSpecified; } + set { this.processingTimeMillisFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("JobStats.Type")] + public string JobStatsType { + get { return this.jobStatsTypeField; } + set { this.jobStatsTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BulkMutateJobStats : JobStats { + private int numOperationsField; + + private bool numOperationsFieldSpecified; + + private int numFailedOperationsField; + + private bool numFailedOperationsFieldSpecified; + + private int numUnprocessedOperationsField; + + private bool numUnprocessedOperationsFieldSpecified; + + public int numOperations { + get { return this.numOperationsField; } + set { + this.numOperationsField = value; + this.numOperationsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numOperationsSpecified { + get { return this.numOperationsFieldSpecified; } + set { this.numOperationsFieldSpecified = value; } + } + + public int numFailedOperations { + get { return this.numFailedOperationsField; } + set { + this.numFailedOperationsField = value; + this.numFailedOperationsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numFailedOperationsSpecified { + get { return this.numFailedOperationsFieldSpecified; } + set { this.numFailedOperationsFieldSpecified = value; } + } + + public int numUnprocessedOperations { + get { return this.numUnprocessedOperationsField; } + set { + this.numUnprocessedOperationsField = value; + this.numUnprocessedOperationsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numUnprocessedOperationsSpecified { + get { return this.numUnprocessedOperationsFieldSpecified; } + set { this.numUnprocessedOperationsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BillingSummary { + private int numOperationsField; + + private bool numOperationsFieldSpecified; + + private long numUnitsField; + + private bool numUnitsFieldSpecified; + + public int numOperations { + get { return this.numOperationsField; } + set { + this.numOperationsField = value; + this.numOperationsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numOperationsSpecified { + get { return this.numOperationsFieldSpecified; } + set { this.numOperationsFieldSpecified = value; } + } + + public long numUnits { + get { return this.numUnitsField; } + set { + this.numUnitsField = value; + this.numUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numUnitsSpecified { + get { return this.numUnitsFieldSpecified; } + set { this.numUnitsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class SimpleMutateJob : Job { + private long idField; + + private bool idFieldSpecified; + + private BasicJobStatus statusField; + + private bool statusFieldSpecified; + + private JobEvent[] historyField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public BasicJobStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("history")] + public JobEvent[] history { + get { return this.historyField; } + set { this.historyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum BasicJobStatus { + COMPLETED, + PROCESSING, + FAILED, + PENDING + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BulkMutateJobEvent))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class JobEvent { + private string dateTimeField; + + private string jobEventTypeField; + + public string dateTime { + get { return this.dateTimeField; } + set { this.dateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("JobEvent.Type")] + public string JobEventType { + get { return this.jobEventTypeField; } + set { this.jobEventTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BulkMutateJobEvent : JobEvent { + private BasicJobStatus statusField; + + private bool statusFieldSpecified; + + public BasicJobStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BulkMutateJob : Job { + private long idField; + + private bool idFieldSpecified; + + private BulkMutateJobPolicy policyField; + + private BulkMutateRequest requestField; + + private BasicJobStatus statusField; + + private bool statusFieldSpecified; + + private BulkMutateJobEvent[] historyField; + + private BulkMutateResult resultField; + + private int numRequestPartsField; + + private bool numRequestPartsFieldSpecified; + + private int numRequestPartsReceivedField; + + private bool numRequestPartsReceivedFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public BulkMutateJobPolicy policy { + get { return this.policyField; } + set { this.policyField = value; } + } + + public BulkMutateRequest request { + get { return this.requestField; } + set { this.requestField = value; } + } + + public BasicJobStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("history")] + public BulkMutateJobEvent[] history { + get { return this.historyField; } + set { this.historyField = value; } + } + + public BulkMutateResult result { + get { return this.resultField; } + set { this.resultField = value; } + } + + public int numRequestParts { + get { return this.numRequestPartsField; } + set { + this.numRequestPartsField = value; + this.numRequestPartsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numRequestPartsSpecified { + get { return this.numRequestPartsFieldSpecified; } + set { this.numRequestPartsFieldSpecified = value; } + } + + public int numRequestPartsReceived { + get { return this.numRequestPartsReceivedField; } + set { + this.numRequestPartsReceivedField = value; + this.numRequestPartsReceivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numRequestPartsReceivedSpecified { + get { return this.numRequestPartsReceivedFieldSpecified; } + set { this.numRequestPartsReceivedFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BulkMutateJobPolicy { + private long[] prerequisiteJobIdsField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("prerequisiteJobIds")] + public long[] prerequisiteJobIds { + get { return this.prerequisiteJobIdsField; } + set { this.prerequisiteJobIdsField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BulkMutateRequest { + private int partIndexField; + + private bool partIndexFieldSpecified; + + private OperationStream[] operationStreamsField; + + public int partIndex { + get { return this.partIndexField; } + set { + this.partIndexField = value; + this.partIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool partIndexSpecified { + get { return this.partIndexFieldSpecified; } + set { this.partIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("operationStreams")] + public OperationStream[] operationStreams { + get { return this.operationStreamsField; } + set { this.operationStreamsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class OperationStream { + private EntityId scopingEntityIdField; + + private Operation[] operationsField; + + public EntityId scopingEntityId { + get { return this.scopingEntityIdField; } + set { this.scopingEntityIdField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("operations")] + public Operation[] operations { + get { return this.operationsField; } + set { this.operationsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class EntityId { + private EntityIdType typeField; + + private bool typeFieldSpecified; + + private long valueField; + + private bool valueFieldSpecified; + + public EntityIdType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public long value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "EntityId.Type", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum EntityIdType { + ADGROUP_ID, + AD_ID, + CAMPAIGN_ID, + CUSTOMER_ID + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CampaignTargetOperation : Operation { + private TargetList operandField; + + public TargetList operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdScheduleTargetList))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public abstract partial class TargetList { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private string targetListTypeField; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("TargetList.Type")] + public string TargetListType { + get { return this.targetListTypeField; } + set { this.targetListTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdScheduleTargetList : TargetList { + private AdScheduleTarget[] targetsField; + + [System.Xml.Serialization.XmlElementAttribute("targets")] + public AdScheduleTarget[] targets { + get { return this.targetsField; } + set { this.targetsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdScheduleTarget : Target { + private DayOfWeek dayOfWeekField; + + private bool dayOfWeekFieldSpecified; + + private int startHourField; + + private bool startHourFieldSpecified; + + private MinuteOfHour startMinuteField; + + private bool startMinuteFieldSpecified; + + private int endHourField; + + private bool endHourFieldSpecified; + + private MinuteOfHour endMinuteField; + + private bool endMinuteFieldSpecified; + + private double bidMultiplierField; + + private bool bidMultiplierFieldSpecified; + + public DayOfWeek dayOfWeek { + get { return this.dayOfWeekField; } + set { + this.dayOfWeekField = value; + this.dayOfWeekSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dayOfWeekSpecified { + get { return this.dayOfWeekFieldSpecified; } + set { this.dayOfWeekFieldSpecified = value; } + } + + public int startHour { + get { return this.startHourField; } + set { + this.startHourField = value; + this.startHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startHourSpecified { + get { return this.startHourFieldSpecified; } + set { this.startHourFieldSpecified = value; } + } + + public MinuteOfHour startMinute { + get { return this.startMinuteField; } + set { + this.startMinuteField = value; + this.startMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startMinuteSpecified { + get { return this.startMinuteFieldSpecified; } + set { this.startMinuteFieldSpecified = value; } + } + + public int endHour { + get { return this.endHourField; } + set { + this.endHourField = value; + this.endHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endHourSpecified { + get { return this.endHourFieldSpecified; } + set { this.endHourFieldSpecified = value; } + } + + public MinuteOfHour endMinute { + get { return this.endMinuteField; } + set { + this.endMinuteField = value; + this.endMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endMinuteSpecified { + get { return this.endMinuteFieldSpecified; } + set { this.endMinuteFieldSpecified = value; } + } + + public double bidMultiplier { + get { return this.bidMultiplierField; } + set { + this.bidMultiplierField = value; + this.bidMultiplierSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidMultiplierSpecified { + get { return this.bidMultiplierFieldSpecified; } + set { this.bidMultiplierFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdScheduleTarget))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public abstract partial class Target { + private string targetTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Target.Type")] + public string TargetType { + get { return this.targetTypeField; } + set { this.targetTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupOperation : Operation { + private AdGroup operandField; + + public AdGroup operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupCriterionOperation : Operation { + private AdGroupCriterion operandField; + + private ExemptionRequest[] exemptionRequestsField; + + public AdGroupCriterion operand { + get { return this.operandField; } + set { this.operandField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("exemptionRequests")] + public ExemptionRequest[] exemptionRequests { + get { return this.exemptionRequestsField; } + set { this.exemptionRequestsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupBidModifierOperation : Operation { + private AdGroupBidModifier operandField; + + public AdGroupBidModifier operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdExtensionOverrideOperation : Operation { + private AdExtensionOverride operandField; + + public AdExtensionOverride operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BulkMutateResult { + private int partIndexField; + + private bool partIndexFieldSpecified; + + private OperationStreamResult[] operationStreamResultsField; + + public int partIndex { + get { return this.partIndexField; } + set { + this.partIndexField = value; + this.partIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool partIndexSpecified { + get { return this.partIndexFieldSpecified; } + set { this.partIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("operationStreamResults")] + public OperationStreamResult[] operationStreamResults { + get { return this.operationStreamResultsField; } + set { this.operationStreamResultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class OperationStreamResult { + private OperationResult[] operationResultsField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("operationResults")] + public OperationResult[] operationResults { + get { return this.operationResultsField; } + set { this.operationResultsField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnprocessedResult))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReturnValueResult))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LostResult))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FailureResult))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BatchFailureResult))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public abstract partial class OperationResult { + private string operationResultTypeField; + + [System.Xml.Serialization.XmlElementAttribute("OperationResult.Type")] + public string OperationResultType { + get { return this.operationResultTypeField; } + set { this.operationResultTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class UnprocessedResult : OperationResult { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ReturnValueResult : OperationResult { + private Operand returnValueField; + + public Operand returnValue { + get { return this.returnValueField; } + set { this.returnValueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class LostResult : OperationResult { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class FailureResult : OperationResult { + private ApiException causeField; + + public ApiException cause { + get { return this.causeField; } + set { this.causeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CriterionPolicyError : PolicyViolationError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class JobError : ApiError { + private JobErrorReason reasonField; + + private bool reasonFieldSpecified; + + public JobErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupCriterionLimitExceeded : EntityCountLimitExceeded { + private AdGroupCriterionLimitExceededCriteriaLimitType limitTypeField; + + private bool limitTypeFieldSpecified; + + public AdGroupCriterionLimitExceededCriteriaLimitType limitType { + get { return this.limitTypeField; } + set { + this.limitTypeField = value; + this.limitTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool limitTypeSpecified { + get { return this.limitTypeFieldSpecified; } + set { this.limitTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupCriterionLimitExceeded.CriteriaLimitType", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AdGroupCriterionLimitExceededCriteriaLimitType { + ADGROUP_KEYWORD, + ADGROUP_WEBSITE, + ADGROUP_CRITERION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BulkMutateJobError : ApiError { + private BulkMutateJobErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BulkMutateJobErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupServiceError : ApiError { + private AdGroupServiceErrorReason reasonField; + + private bool reasonFieldSpecified; + + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + public AdGroupServiceErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupCriterionError : ApiError { + private AdGroupCriterionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdGroupCriterionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdExtensionOverrideError : ApiError { + private AdExtensionOverrideErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdExtensionOverrideErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BatchFailureResult : OperationResult { + private int operationIndexInBatchField; + + private bool operationIndexInBatchFieldSpecified; + + public int operationIndexInBatch { + get { return this.operationIndexInBatchField; } + set { + this.operationIndexInBatchField = value; + this.operationIndexInBatchSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operationIndexInBatchSpecified { + get { return this.operationIndexInBatchFieldSpecified; } + set { this.operationIndexInBatchFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class PlaceHolder { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class JobResult { + private object itemField; + + [System.Xml.Serialization.XmlElementAttribute("BulkMutateResult", typeof(BulkMutateResult))] + [System.Xml.Serialization.XmlElementAttribute("SimpleMutateResult", typeof(SimpleMutateResult))] + public object Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BulkMutateJobSelector))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public abstract partial class JobSelector { + private bool includeHistoryField; + + private bool includeHistoryFieldSpecified; + + private bool includeStatsField; + + private bool includeStatsFieldSpecified; + + private string jobSelectorTypeField; + + public bool includeHistory { + get { return this.includeHistoryField; } + set { + this.includeHistoryField = value; + this.includeHistorySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeHistorySpecified { + get { return this.includeHistoryFieldSpecified; } + set { this.includeHistoryFieldSpecified = value; } + } + + public bool includeStats { + get { return this.includeStatsField; } + set { + this.includeStatsField = value; + this.includeStatsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeStatsSpecified { + get { return this.includeStatsFieldSpecified; } + set { this.includeStatsFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("JobSelector.Type")] + public string JobSelectorType { + get { return this.jobSelectorTypeField; } + set { this.jobSelectorTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BulkMutateJobSelector : JobSelector { + private long[] jobIdsField; + + private int resultPartIndexField; + + private bool resultPartIndexFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("jobIds")] + public long[] jobIds { + get { return this.jobIdsField; } + set { this.jobIdsField = value; } + } + + public int resultPartIndex { + get { return this.resultPartIndexField; } + set { + this.resultPartIndexField = value; + this.resultPartIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool resultPartIndexSpecified { + get { return this.resultPartIndexFieldSpecified; } + set { this.resultPartIndexFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdGroupFeedServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdGroupFeedService : AdWordsSoapClient, IAdGroupFeedService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdGroupFeedService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/AdGroupFeedService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupFeedPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((AdGroupFeedPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupFeedReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +AdGroupFeedOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((AdGroupFeedReturnValue) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupFeedReturnValue : ListReturnValue { + private AdGroupFeed[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdGroupFeed[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupFeed { + private long feedIdField; + + private bool feedIdFieldSpecified; + + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private Function matchingFunctionField; + + private int[] placeholderTypesField; + + private AdGroupFeedStatus statusField; + + private bool statusFieldSpecified; + + public long feedId { + get { return this.feedIdField; } + set { + this.feedIdField = value; + this.feedIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedIdSpecified { + get { return this.feedIdFieldSpecified; } + set { this.feedIdFieldSpecified = value; } + } + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public Function matchingFunction { + get { return this.matchingFunctionField; } + set { this.matchingFunctionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("placeholderTypes")] + public int[] placeholderTypes { + get { return this.placeholderTypesField; } + set { this.placeholderTypesField = value; } + } + + public AdGroupFeedStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupFeed.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AdGroupFeedStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupFeedOperation : Operation { + private AdGroupFeed operandField; + + public AdGroupFeed operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupFeedPage : NullStatsPage { + private AdGroupFeed[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public AdGroupFeed[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupFeedError : ApiError { + private AdGroupFeedErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdGroupFeedErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupFeedError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AdGroupFeedErrorReason { + FEED_ALREADY_EXISTS_FOR_PLACEHOLDER_TYPE, + INVALID_ID, + CANNOT_ADD_ALREADY_EXISTING_ADGROUP_FEED, + CANNOT_OPERATE_ON_DELETED_ADGROUP_FEED, + INVALID_PLACEHOLDER_TYPES, + MISSING_FEEDMAPPING_FOR_PLACEHOLDER_TYPE, + FEEDS_ONLY_UNDER_ENHANCED_CAMPAIGNS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "OfflineConversionFeedServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class OfflineConversionFeedService : AdWordsSoapClient, IOfflineConversionFeedService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public OfflineConversionFeedService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/OfflineConversionFeedService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual OfflineConversionFeedReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +OfflineConversionFeedOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((OfflineConversionFeedReturnValue) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class OfflineConversionFeedReturnValue : ListReturnValue { + private OfflineConversionFeed[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public OfflineConversionFeed[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class OfflineConversionFeed { + private string googleClickIdField; + + private string conversionNameField; + + private string conversionTimeField; + + private double conversionValueField; + + private bool conversionValueFieldSpecified; + + public string googleClickId { + get { return this.googleClickIdField; } + set { this.googleClickIdField = value; } + } + + public string conversionName { + get { return this.conversionNameField; } + set { this.conversionNameField = value; } + } + + public string conversionTime { + get { return this.conversionTimeField; } + set { this.conversionTimeField = value; } + } + + public double conversionValue { + get { return this.conversionValueField; } + set { + this.conversionValueField = value; + this.conversionValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool conversionValueSpecified { + get { return this.conversionValueFieldSpecified; } + set { this.conversionValueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class OfflineConversionError : ApiError { + private OfflineConversionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OfflineConversionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OfflineConversionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum OfflineConversionErrorReason { + UNPARSEABLE_GCLID, + CONVERSION_PRECEDES_CLICK, + EXPIRED_CLICK, + TOO_RECENT_CLICK, + INVALID_CLICK, + UNAUTHORIZED_USER, + INVALID_CONVERSION_TYPE, + CLICK_MISSING_CONVERSION_LABEL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class MatchesRegexError : ApiError { + private MatchesRegexErrorReason reasonField; + + private bool reasonFieldSpecified; + + public MatchesRegexErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "MatchesRegexError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum MatchesRegexErrorReason { + UNKNOWN, + DOES_NOT_MATCH + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class CurrencyCodeError : ApiError { + private CurrencyCodeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CurrencyCodeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CurrencyCodeError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum CurrencyCodeErrorReason { + UNSUPPORTED_CURRENCY_CODE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class OfflineConversionFeedOperation : Operation { + private OfflineConversionFeed operandField; + + public OfflineConversionFeed operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReportDefinitionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReportDefinitionService : AdWordsSoapClient, IReportDefinitionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReportDefinitionService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/ReportDefinitionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReportDefinitionField[] getReportFields(ReportDefinitionReportType reportType) { + object[] results = this.Invoke("getReportFields", new object[] { reportType }); + return ((ReportDefinitionField[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class EnumValuePair { + private string enumValueField; + + private string enumDisplayValueField; + + public string enumValue { + get { return this.enumValueField; } + set { this.enumValueField = value; } + } + + public string enumDisplayValue { + get { return this.enumDisplayValueField; } + set { this.enumDisplayValueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ReportDefinitionField { + private string fieldNameField; + + private string displayFieldNameField; + + private string xmlAttributeNameField; + + private string fieldTypeField; + + private string[] enumValuesField; + + private bool canSelectField; + + private bool canSelectFieldSpecified; + + private bool canFilterField; + + private bool canFilterFieldSpecified; + + private bool isEnumTypeField; + + private bool isEnumTypeFieldSpecified; + + private bool isBetaField; + + private bool isBetaFieldSpecified; + + private EnumValuePair[] enumValuePairsField; + + public string fieldName { + get { return this.fieldNameField; } + set { this.fieldNameField = value; } + } + + public string displayFieldName { + get { return this.displayFieldNameField; } + set { this.displayFieldNameField = value; } + } + + public string xmlAttributeName { + get { return this.xmlAttributeNameField; } + set { this.xmlAttributeNameField = value; } + } + + public string fieldType { + get { return this.fieldTypeField; } + set { this.fieldTypeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("enumValues")] + public string[] enumValues { + get { return this.enumValuesField; } + set { this.enumValuesField = value; } + } + + public bool canSelect { + get { return this.canSelectField; } + set { + this.canSelectField = value; + this.canSelectSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool canSelectSpecified { + get { return this.canSelectFieldSpecified; } + set { this.canSelectFieldSpecified = value; } + } + + public bool canFilter { + get { return this.canFilterField; } + set { + this.canFilterField = value; + this.canFilterSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool canFilterSpecified { + get { return this.canFilterFieldSpecified; } + set { this.canFilterFieldSpecified = value; } + } + + public bool isEnumType { + get { return this.isEnumTypeField; } + set { + this.isEnumTypeField = value; + this.isEnumTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isEnumTypeSpecified { + get { return this.isEnumTypeFieldSpecified; } + set { this.isEnumTypeFieldSpecified = value; } + } + + public bool isBeta { + get { return this.isBetaField; } + set { + this.isBetaField = value; + this.isBetaSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isBetaSpecified { + get { return this.isBetaFieldSpecified; } + set { this.isBetaFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("enumValuePairs")] + public EnumValuePair[] enumValuePairs { + get { return this.enumValuePairsField; } + set { this.enumValuePairsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ReportDefinitionError : ApiError { + private ReportDefinitionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReportDefinitionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportDefinitionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ReportDefinitionErrorReason { + INVALID_DATE_RANGE_FOR_REPORT, + INVALID_FIELD_NAME_FOR_REPORT, + UNABLE_TO_FIND_MAPPING_FOR_THIS_REPORT, + INVALID_COLUMN_NAME_FOR_REPORT, + INVALID_REPORT_DEFINITION_ID, + REPORT_SELECTOR_CANNOT_BE_NULL, + NO_ENUMS_FOR_THIS_COLUMN_NAME, + INVALID_VIEW, + SORTING_NOT_SUPPORTED, + PAGING_NOT_SUPPORTED, + CUSTOMER_SERVING_TYPE_REPORT_MISMATCH, + CLIENT_SELECTOR_NO_CUSTOMER_IDENTIFIER, + CLIENT_SELECTOR_INVALID_CUSTOMER_ID, + REPORT_DEFINITION_ERROR + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportDefinition.ReportType", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ReportDefinitionReportType { + KEYWORDS_PERFORMANCE_REPORT, + AD_PERFORMANCE_REPORT, + URL_PERFORMANCE_REPORT, + ADGROUP_PERFORMANCE_REPORT, + CAMPAIGN_PERFORMANCE_REPORT, + ACCOUNT_PERFORMANCE_REPORT, + GEO_PERFORMANCE_REPORT, + SEARCH_QUERY_PERFORMANCE_REPORT, + AUTOMATIC_PLACEMENTS_PERFORMANCE_REPORT, + CAMPAIGN_NEGATIVE_KEYWORDS_PERFORMANCE_REPORT, + CAMPAIGN_NEGATIVE_PLACEMENTS_PERFORMANCE_REPORT, + AD_EXTENSIONS_PERFORMANCE_REPORT, + DESTINATION_URL_REPORT, + SHARED_SET_REPORT, + CAMPAIGN_SHARED_SET_REPORT, + SHARED_SET_CRITERIA_REPORT, + CREATIVE_CONVERSION_REPORT, + CALL_METRICS_CALL_DETAILS_REPORT, + KEYWORDLESS_QUERY_REPORT, + KEYWORDLESS_CATEGORY_REPORT, + ACCOUNT_REACH_FREQUENCY_REPORT, + CAMPAIGN_REACH_FREQUENCY_REPORT, + ADGROUP_REACH_FREQUENCY_REPORT, + CRITERIA_PERFORMANCE_REPORT, + CLICK_PERFORMANCE_REPORT, + BUDGET_PERFORMANCE_REPORT, + DISPLAY_KEYWORD_PERFORMANCE_REPORT, + PLACEHOLDER_FEED_ITEM_REPORT, + PLACEMENT_PERFORMANCE_REPORT, + CAMPAIGN_NEGATIVE_LOCATIONS_REPORT, + GENDER_PERFORMANCE_REPORT, + AGE_RANGE_PERFORMANCE_REPORT, + CAMPAIGN_LOCATION_TARGET_REPORT, + CAMPAIGN_AD_SCHEDULE_TARGET_REPORT, + CAMPAIGN_PLATFORM_TARGET_REPORT, + AUDIENCE_PERFORMANCE_REPORT, + DISPLAY_TOPICS_PERFORMANCE_REPORT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "SharedCriterionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class SharedCriterionService : AdWordsSoapClient, ISharedCriterionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public SharedCriterionService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/SharedCriterionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SharedCriterionPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((SharedCriterionPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SharedCriterionReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +SharedCriterionOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((SharedCriterionReturnValue) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class SharedCriterionReturnValue : ListReturnValue { + private SharedCriterion[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public SharedCriterion[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class SharedCriterion { + private long sharedSetIdField; + + private bool sharedSetIdFieldSpecified; + + private Criterion criterionField; + + private bool negativeField; + + private bool negativeFieldSpecified; + + public long sharedSetId { + get { return this.sharedSetIdField; } + set { + this.sharedSetIdField = value; + this.sharedSetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sharedSetIdSpecified { + get { return this.sharedSetIdFieldSpecified; } + set { this.sharedSetIdFieldSpecified = value; } + } + + public Criterion criterion { + get { return this.criterionField; } + set { this.criterionField = value; } + } + + public bool negative { + get { return this.negativeField; } + set { + this.negativeField = value; + this.negativeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool negativeSpecified { + get { return this.negativeFieldSpecified; } + set { this.negativeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class SharedCriterionOperation : Operation { + private SharedCriterion operandField; + + public SharedCriterion operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class SharedCriterionPage : Page { + private SharedCriterion[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public SharedCriterion[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class SharedCriterionError : ApiError { + private SharedCriterionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SharedCriterionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SharedCriterionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum SharedCriterionErrorReason { + EXCEEDS_CRITERIA_LIMIT, + INCORRECT_CRITERION_TYPE, + CANNOT_TARGET_AND_EXCLUDE, + NEGATIVE_CRITERION_REQUIRED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "SharedSetServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class SharedSetService : AdWordsSoapClient, ISharedSetService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public SharedSetService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/SharedSetService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SharedSetPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((SharedSetPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SharedSetReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +SharedSetOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((SharedSetReturnValue) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class SharedSetReturnValue : ListReturnValue { + private SharedSet[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public SharedSet[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class SharedSet { + private long sharedSetIdField; + + private bool sharedSetIdFieldSpecified; + + private string nameField; + + private SharedSetType typeField; + + private bool typeFieldSpecified; + + private int memberCountField; + + private bool memberCountFieldSpecified; + + private int referenceCountField; + + private bool referenceCountFieldSpecified; + + private SharedSetStatus statusField; + + private bool statusFieldSpecified; + + public long sharedSetId { + get { return this.sharedSetIdField; } + set { + this.sharedSetIdField = value; + this.sharedSetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sharedSetIdSpecified { + get { return this.sharedSetIdFieldSpecified; } + set { this.sharedSetIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public SharedSetType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public int memberCount { + get { return this.memberCountField; } + set { + this.memberCountField = value; + this.memberCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool memberCountSpecified { + get { return this.memberCountFieldSpecified; } + set { this.memberCountFieldSpecified = value; } + } + + public int referenceCount { + get { return this.referenceCountField; } + set { + this.referenceCountField = value; + this.referenceCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool referenceCountSpecified { + get { return this.referenceCountFieldSpecified; } + set { this.referenceCountFieldSpecified = value; } + } + + public SharedSetStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SharedSet.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum SharedSetStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class SharedSetOperation : Operation { + private SharedSet operandField; + + public SharedSet operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class SharedSetPage : NullStatsPage { + private SharedSet[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public SharedSet[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class SharedSetError : ApiError { + private SharedSetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SharedSetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SharedSetError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum SharedSetErrorReason { + CUSTOMER_CANNOT_CREATE_SHARED_SET_OF_THIS_TYPE, + DUPLICATE_NAME, + EXCEEDS_MAX_SHARED_SETS_FOR_TYPE, + INVALID_SET_NAME, + SHARED_SET_DELETED, + SHARED_SET_IN_USE, + TYPE_CANNOT_BE_CHANGED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "TargetingIdeaServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DataEntry))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class TargetingIdeaService : AdWordsSoapClient, ITargetingIdeaService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public TargetingIdeaService() { + this.Url = "https://adwords.google.com/api/adwords/o/v201309/TargetingIdeaService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/o/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/o/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TargetingIdeaPage get(TargetingIdeaSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((TargetingIdeaPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/o/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/o/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TargetingIdeaPage getBulkKeywordIdeas(TargetingIdeaSelector selector) { + object[] results = this.Invoke("getBulkKeywordIdeas", new object[] { selector }); + return ((TargetingIdeaPage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class WebpageDescriptor { + private string urlField; + + private string titleField; + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + + public string title { + get { return this.titleField; } + set { this.titleField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class MonthlySearchVolume { + private int yearField; + + private bool yearFieldSpecified; + + private int monthField; + + private bool monthFieldSpecified; + + private long countField; + + private bool countFieldSpecified; + + public int year { + get { return this.yearField; } + set { + this.yearField = value; + this.yearSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool yearSpecified { + get { return this.yearFieldSpecified; } + set { this.yearFieldSpecified = value; } + } + + public int month { + get { return this.monthField; } + set { + this.monthField = value; + this.monthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool monthSpecified { + get { return this.monthFieldSpecified; } + set { this.monthFieldSpecified = value; } + } + + public long count { + get { return this.countField; } + set { + this.countField = value; + this.countSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool countSpecified { + get { return this.countFieldSpecified; } + set { this.countFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class Range { + private ComparableValue minField; + + private ComparableValue maxField; + + public ComparableValue min { + get { return this.minField; } + set { this.minField = value; } + } + + public ComparableValue max { + get { return this.maxField; } + set { this.maxField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class InStreamAdInfo { + private int maxAdDurationField; + + private bool maxAdDurationFieldSpecified; + + private int minAdDurationField; + + private bool minAdDurationFieldSpecified; + + private int medianAdDurationField; + + private bool medianAdDurationFieldSpecified; + + private double preRollPercentField; + + private bool preRollPercentFieldSpecified; + + private double midRollPercentField; + + private bool midRollPercentFieldSpecified; + + private double postRollPercentField; + + private bool postRollPercentFieldSpecified; + + public int maxAdDuration { + get { return this.maxAdDurationField; } + set { + this.maxAdDurationField = value; + this.maxAdDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxAdDurationSpecified { + get { return this.maxAdDurationFieldSpecified; } + set { this.maxAdDurationFieldSpecified = value; } + } + + public int minAdDuration { + get { return this.minAdDurationField; } + set { + this.minAdDurationField = value; + this.minAdDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minAdDurationSpecified { + get { return this.minAdDurationFieldSpecified; } + set { this.minAdDurationFieldSpecified = value; } + } + + public int medianAdDuration { + get { return this.medianAdDurationField; } + set { + this.medianAdDurationField = value; + this.medianAdDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool medianAdDurationSpecified { + get { return this.medianAdDurationFieldSpecified; } + set { this.medianAdDurationFieldSpecified = value; } + } + + public double preRollPercent { + get { return this.preRollPercentField; } + set { + this.preRollPercentField = value; + this.preRollPercentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool preRollPercentSpecified { + get { return this.preRollPercentFieldSpecified; } + set { this.preRollPercentFieldSpecified = value; } + } + + public double midRollPercent { + get { return this.midRollPercentField; } + set { + this.midRollPercentField = value; + this.midRollPercentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool midRollPercentSpecified { + get { return this.midRollPercentFieldSpecified; } + set { this.midRollPercentFieldSpecified = value; } + } + + public double postRollPercent { + get { return this.postRollPercentField; } + set { + this.postRollPercentField = value; + this.postRollPercentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool postRollPercentSpecified { + get { return this.postRollPercentFieldSpecified; } + set { this.postRollPercentFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class AdFormatSpec { + private SiteConstantsAdFormat formatField; + + private bool formatFieldSpecified; + + public SiteConstantsAdFormat format { + get { return this.formatField; } + set { + this.formatField = value; + this.formatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool formatSpecified { + get { return this.formatFieldSpecified; } + set { this.formatFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SiteConstants.AdFormat", Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public enum SiteConstantsAdFormat { + UNKNOWN, + TEXT, + IMAGE, + VIDEO, + INSTREAM + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WebpageDescriptorAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementTypeAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OpportunityIdeaTypeAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MonthlySearchVolumeAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MoneyAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongRangeAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(KeywordAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IntegerSetAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IntegerAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InStreamAdInfoAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IdeaTypeAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DoubleAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BooleanAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BidLandscapeAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSpecListAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdFormatSpecListAttribute))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public abstract partial class Attribute { + private string attributeTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Attribute.Type")] + public string AttributeType { + get { return this.attributeTypeField; } + set { this.attributeTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class WebpageDescriptorAttribute : Attribute { + private WebpageDescriptor valueField; + + public WebpageDescriptor value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class StringAttribute : Attribute { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class PlacementTypeAttribute : Attribute { + private SiteConstantsPlacementType valueField; + + private bool valueFieldSpecified; + + public SiteConstantsPlacementType value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SiteConstants.PlacementType", Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public enum SiteConstantsPlacementType { + UNKNOWN, + SITE, + VIDEO, + FEED, + GAME, + MOBILE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class PlacementAttribute : Attribute { + private Placement valueField; + + public Placement value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class OpportunityIdeaTypeAttribute : Attribute { + private OpportunityIdeaType valueField; + + private bool valueFieldSpecified; + + public OpportunityIdeaType value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public enum OpportunityIdeaType { + KEYWORD, + BID, + BUDGET + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class MonthlySearchVolumeAttribute : Attribute { + private MonthlySearchVolume[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public MonthlySearchVolume[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class MoneyAttribute : Attribute { + private Money valueField; + + public Money value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class LongRangeAttribute : Attribute { + private Range valueField; + + public Range value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class LongAttribute : Attribute { + private long valueField; + + private bool valueFieldSpecified; + + public long value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class KeywordAttribute : Attribute { + private Keyword valueField; + + public Keyword value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class IntegerSetAttribute : Attribute { + private int[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public int[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class IntegerAttribute : Attribute { + private int valueField; + + private bool valueFieldSpecified; + + public int value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class InStreamAdInfoAttribute : Attribute { + private InStreamAdInfo valueField; + + public InStreamAdInfo value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class IdeaTypeAttribute : Attribute { + private IdeaType valueField; + + private bool valueFieldSpecified; + + public IdeaType value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public enum IdeaType { + KEYWORD, + PLACEMENT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class DoubleAttribute : Attribute { + private double valueField; + + private bool valueFieldSpecified; + + public double value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class CriterionAttribute : Attribute { + private Criterion valueField; + + public Criterion value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class BooleanAttribute : Attribute { + private bool valueField; + + private bool valueFieldSpecified; + + public bool value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class BidLandscapeAttribute : Attribute { + private BidLandscape valueField; + + public BidLandscape value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class AdSpecListAttribute : Attribute { + private AdSpec[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdSpec[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class AdSpec { + private object itemField; + + [System.Xml.Serialization.XmlElementAttribute("DisplayAdSpec", typeof(DisplayAdSpec))] + [System.Xml.Serialization.XmlElementAttribute("InStreamAdSpec", typeof(InStreamAdSpec))] + [System.Xml.Serialization.XmlElementAttribute("TextAdSpec", typeof(TextAdSpec))] + public object Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class DisplayAdSpec { + private DisplayType[] displayTypesField; + + private DisplayAdSpecActivationOption[] activationOptionsField; + + private DisplayAdSpecAdSizeSpec[] adSizeSpecsField; + + [System.Xml.Serialization.XmlElementAttribute("displayTypes")] + public DisplayType[] displayTypes { + get { return this.displayTypesField; } + set { this.displayTypesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("activationOptions")] + public DisplayAdSpecActivationOption[] activationOptions { + get { return this.activationOptionsField; } + set { this.activationOptionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adSizeSpecs")] + public DisplayAdSpecAdSizeSpec[] adSizeSpecs { + get { return this.adSizeSpecsField; } + set { this.adSizeSpecsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class DisplayType { + private object itemField; + + [System.Xml.Serialization.XmlElementAttribute("FlashDisplayType", typeof(FlashDisplayType))] + [System.Xml.Serialization.XmlElementAttribute("HtmlDisplayType", typeof(HtmlDisplayType))] + [System.Xml.Serialization.XmlElementAttribute("ImageDisplayType", typeof(ImageDisplayType))] + public object Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class FlashDisplayType { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class HtmlDisplayType { + private HtmlDisplayTypeHtmlOption htmlOptionField; + + private bool htmlOptionFieldSpecified; + + public HtmlDisplayTypeHtmlOption htmlOption { + get { return this.htmlOptionField; } + set { + this.htmlOptionField = value; + this.htmlOptionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool htmlOptionSpecified { + get { return this.htmlOptionFieldSpecified; } + set { this.htmlOptionFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "HtmlDisplayType.HtmlOption", Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public enum HtmlDisplayTypeHtmlOption { + UNKNOWN, + THIRD_PARTY_SERVING + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class ImageDisplayType { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DisplayAdSpec.ActivationOption", Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public enum DisplayAdSpecActivationOption { + UNKNOWN, + NONE, + STANDARD_EXPANDABLE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DisplayAdSpec.AdSizeSpec", Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class DisplayAdSpecAdSizeSpec { + private long widthField; + + private bool widthFieldSpecified; + + private long heightField; + + private bool heightFieldSpecified; + + private DisplayAdSpecActivationOption[] activationOptionFilterField; + + public long width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public long height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("activationOptionFilter")] + public DisplayAdSpecActivationOption[] activationOptionFilter { + get { return this.activationOptionFilterField; } + set { this.activationOptionFilterField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class InStreamAdSpec { + private InStreamAdSpecInStreamType[] inStreamTypesField; + + private long[] durationsField; + + [System.Xml.Serialization.XmlElementAttribute("inStreamTypes")] + public InStreamAdSpecInStreamType[] inStreamTypes { + get { return this.inStreamTypesField; } + set { this.inStreamTypesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("durations")] + public long[] durations { + get { return this.durationsField; } + set { this.durationsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InStreamAdSpec.InStreamType", Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public enum InStreamAdSpecInStreamType { + UNKNOWN, + IN_STREAM, + IN_DISPLAY, + IN_SLATE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class TextAdSpec { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class AdFormatSpecListAttribute : Attribute { + private AdFormatSpec[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdFormatSpec[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class Type_AttributeMapEntry { + private AttributeType keyField; + + private bool keyFieldSpecified; + + private Attribute valueField; + + public AttributeType key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public Attribute value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public enum AttributeType { + UNKNOWN, + AD_TYPE_SPEC, + APPROX_CONTENT_IMPRESSIONS_PER_DAY, + CATEGORY_PRODUCTS_AND_SERVICES, + COMPETITION, + CRITERION, + EXTRACTED_FROM_WEBPAGE, + IDEA_TYPE, + IN_STREAM_AD_INFO, + KEYWORD_TEXT, + PLACEMENT_NAME, + SAMPLE_URL, + PLACEMENT_CATEGORY, + PLACEMENT_TYPE, + SEARCH_VOLUME, + AVERAGE_CPC, + TARGETED_MONTHLY_SEARCHES + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class TargetingIdea { + private Type_AttributeMapEntry[] dataField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("data")] + public Type_AttributeMapEntry[] data { + get { return this.dataField; } + set { this.dataField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class TargetingIdeaPage { + private int totalNumEntriesField; + + private bool totalNumEntriesFieldSpecified; + + private TargetingIdea[] entriesField; + + public int totalNumEntries { + get { return this.totalNumEntriesField; } + set { + this.totalNumEntriesField = value; + this.totalNumEntriesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalNumEntriesSpecified { + get { return this.totalNumEntriesFieldSpecified; } + set { this.totalNumEntriesFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public TargetingIdea[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class LongComparisonOperation { + private long minimumField; + + private bool minimumFieldSpecified; + + private long maximumField; + + private bool maximumFieldSpecified; + + public long minimum { + get { return this.minimumField; } + set { + this.minimumField = value; + this.minimumSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minimumSpecified { + get { return this.minimumFieldSpecified; } + set { this.minimumFieldSpecified = value; } + } + + public long maximum { + get { return this.maximumField; } + set { + this.maximumField = value; + this.maximumSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maximumSpecified { + get { return this.maximumFieldSpecified; } + set { this.maximumFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SeedAdGroupIdSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SearchVolumeSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RelatedToUrlSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RelatedToQuerySearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementTypeSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NetworkSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LocationSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LanguageSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IncludeAdultContentSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IdeaTextFilterSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExcludedKeywordSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CompetitionSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CategoryProductsAndServicesSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSpecListSearchParameter))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public abstract partial class SearchParameter { + private string searchParameterTypeField; + + [System.Xml.Serialization.XmlElementAttribute("SearchParameter.Type")] + public string SearchParameterType { + get { return this.searchParameterTypeField; } + set { this.searchParameterTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class SeedAdGroupIdSearchParameter : SearchParameter { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class SearchVolumeSearchParameter : SearchParameter { + private LongComparisonOperation operationField; + + public LongComparisonOperation operation { + get { return this.operationField; } + set { this.operationField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class RelatedToUrlSearchParameter : SearchParameter { + private string[] urlsField; + + private bool includeSubUrlsField; + + private bool includeSubUrlsFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("urls")] + public string[] urls { + get { return this.urlsField; } + set { this.urlsField = value; } + } + + public bool includeSubUrls { + get { return this.includeSubUrlsField; } + set { + this.includeSubUrlsField = value; + this.includeSubUrlsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeSubUrlsSpecified { + get { return this.includeSubUrlsFieldSpecified; } + set { this.includeSubUrlsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class RelatedToQuerySearchParameter : SearchParameter { + private string[] queriesField; + + [System.Xml.Serialization.XmlElementAttribute("queries")] + public string[] queries { + get { return this.queriesField; } + set { this.queriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class PlacementTypeSearchParameter : SearchParameter { + private SiteConstantsPlacementType[] placementTypesField; + + [System.Xml.Serialization.XmlElementAttribute("placementTypes")] + public SiteConstantsPlacementType[] placementTypes { + get { return this.placementTypesField; } + set { this.placementTypesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class NetworkSearchParameter : SearchParameter { + private NetworkSetting networkSettingField; + + public NetworkSetting networkSetting { + get { return this.networkSettingField; } + set { this.networkSettingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class LocationSearchParameter : SearchParameter { + private Location[] locationsField; + + [System.Xml.Serialization.XmlElementAttribute("locations")] + public Location[] locations { + get { return this.locationsField; } + set { this.locationsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class LanguageSearchParameter : SearchParameter { + private Language[] languagesField; + + [System.Xml.Serialization.XmlElementAttribute("languages")] + public Language[] languages { + get { return this.languagesField; } + set { this.languagesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class IncludeAdultContentSearchParameter : SearchParameter { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class IdeaTextFilterSearchParameter : SearchParameter { + private string[] includedField; + + private string[] excludedField; + + [System.Xml.Serialization.XmlElementAttribute("included")] + public string[] included { + get { return this.includedField; } + set { this.includedField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excluded")] + public string[] excluded { + get { return this.excludedField; } + set { this.excludedField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class ExcludedKeywordSearchParameter : SearchParameter { + private Keyword[] keywordsField; + + [System.Xml.Serialization.XmlElementAttribute("keywords")] + public Keyword[] keywords { + get { return this.keywordsField; } + set { this.keywordsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class CompetitionSearchParameter : SearchParameter { + private CompetitionSearchParameterLevel[] levelsField; + + [System.Xml.Serialization.XmlElementAttribute("levels")] + public CompetitionSearchParameterLevel[] levels { + get { return this.levelsField; } + set { this.levelsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CompetitionSearchParameter.Level", Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public enum CompetitionSearchParameterLevel { + LOW, + MEDIUM, + HIGH + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class CategoryProductsAndServicesSearchParameter : SearchParameter { + private int categoryIdField; + + private bool categoryIdFieldSpecified; + + public int categoryId { + get { return this.categoryIdField; } + set { + this.categoryIdField = value; + this.categoryIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool categoryIdSpecified { + get { return this.categoryIdFieldSpecified; } + set { this.categoryIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class AdSpecListSearchParameter : SearchParameter { + private AdSpec[] adSpecsField; + + [System.Xml.Serialization.XmlElementAttribute("adSpecs")] + public AdSpec[] adSpecs { + get { return this.adSpecsField; } + set { this.adSpecsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class TargetingIdeaSelector { + private SearchParameter[] searchParametersField; + + private IdeaType ideaTypeField; + + private bool ideaTypeFieldSpecified; + + private RequestType requestTypeField; + + private bool requestTypeFieldSpecified; + + private AttributeType[] requestedAttributeTypesField; + + private Paging pagingField; + + private string localeCodeField; + + private string currencyCodeField; + + [System.Xml.Serialization.XmlElementAttribute("searchParameters")] + public SearchParameter[] searchParameters { + get { return this.searchParametersField; } + set { this.searchParametersField = value; } + } + + public IdeaType ideaType { + get { return this.ideaTypeField; } + set { + this.ideaTypeField = value; + this.ideaTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ideaTypeSpecified { + get { return this.ideaTypeFieldSpecified; } + set { this.ideaTypeFieldSpecified = value; } + } + + public RequestType requestType { + get { return this.requestTypeField; } + set { + this.requestTypeField = value; + this.requestTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool requestTypeSpecified { + get { return this.requestTypeFieldSpecified; } + set { this.requestTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("requestedAttributeTypes")] + public AttributeType[] requestedAttributeTypes { + get { return this.requestedAttributeTypesField; } + set { this.requestedAttributeTypesField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + + public string localeCode { + get { return this.localeCodeField; } + set { this.localeCodeField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public enum RequestType { + IDEAS, + STATS + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class TrafficEstimatorError : ApiError { + private TrafficEstimatorErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TrafficEstimatorErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TrafficEstimatorError.Reason", Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public enum TrafficEstimatorErrorReason { + NO_CAMPAIGN_FOR_AD_GROUP_ESTIMATE_REQUEST, + NO_AD_GROUP_FOR_KEYWORD_ESTIMATE_REQUEST, + NO_MAX_CPC_FOR_KEYWORD_ESTIMATE_REQUEST, + TOO_MANY_KEYWORD_ESTIMATE_REQUESTS, + TOO_MANY_CAMPAIGN_ESTIMATE_REQUESTS, + TOO_MANY_ADGROUP_ESTIMATE_REQUESTS, + TOO_MANY_TARGETS, + KEYWORD_TOO_LONG, + KEYWORD_CONTAINS_BROAD_MATCH_MODIFIERS, + INVALID_INPUT, + SERVICE_UNAVAILABLE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class TargetingIdeaError : ApiError { + private TargetingIdeaErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TargetingIdeaErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TargetingIdeaError.Reason", Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public enum TargetingIdeaErrorReason { + DUPLICATE_SEARCH_FILTER_TYPES_PRESENT, + INSUFFICIENT_SEARCH_PARAMETERS, + INVALID_ATTRIBUTE_TYPE, + INVALID_SEARCH_PARAMETERS, + INVALID_DOMAIN_SUFFIX, + MUTUALLY_EXCLUSIVE_SEARCH_PARAMETERS_IN_QUERY, + SERVICE_UNAVAILABLE, + INVALID_URL_IN_SEARCH_PARAMETER, + TOO_MANY_RESULTS_REQUESTED, + NO_PAGING_IN_SELECTOR, + INVALID_INCLUDED_EXCLUDED_KEYWORDS + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "TrafficEstimatorServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Estimate))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EstimateRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class TrafficEstimatorService : AdWordsSoapClient, ITrafficEstimatorService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public TrafficEstimatorService() { + this.Url = "https://adwords.google.com/api/adwords/o/v201309/TrafficEstimatorService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/o/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/o/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TrafficEstimatorResult get(TrafficEstimatorSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((TrafficEstimatorResult) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class StatsEstimate { + private Money averageCpcField; + + private double averagePositionField; + + private bool averagePositionFieldSpecified; + + private double clickThroughRateField; + + private bool clickThroughRateFieldSpecified; + + private float clicksPerDayField; + + private bool clicksPerDayFieldSpecified; + + private float impressionsPerDayField; + + private bool impressionsPerDayFieldSpecified; + + private Money totalCostField; + + public Money averageCpc { + get { return this.averageCpcField; } + set { this.averageCpcField = value; } + } + + public double averagePosition { + get { return this.averagePositionField; } + set { + this.averagePositionField = value; + this.averagePositionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool averagePositionSpecified { + get { return this.averagePositionFieldSpecified; } + set { this.averagePositionFieldSpecified = value; } + } + + public double clickThroughRate { + get { return this.clickThroughRateField; } + set { + this.clickThroughRateField = value; + this.clickThroughRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clickThroughRateSpecified { + get { return this.clickThroughRateFieldSpecified; } + set { this.clickThroughRateFieldSpecified = value; } + } + + public float clicksPerDay { + get { return this.clicksPerDayField; } + set { + this.clicksPerDayField = value; + this.clicksPerDaySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clicksPerDaySpecified { + get { return this.clicksPerDayFieldSpecified; } + set { this.clicksPerDayFieldSpecified = value; } + } + + public float impressionsPerDay { + get { return this.impressionsPerDayField; } + set { + this.impressionsPerDayField = value; + this.impressionsPerDaySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsPerDaySpecified { + get { return this.impressionsPerDayFieldSpecified; } + set { this.impressionsPerDayFieldSpecified = value; } + } + + public Money totalCost { + get { return this.totalCostField; } + set { this.totalCostField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignEstimate))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(KeywordEstimate))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupEstimate))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class Estimate { + private string estimateTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Estimate.Type")] + public string EstimateType { + get { return this.estimateTypeField; } + set { this.estimateTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class CampaignEstimate : Estimate { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private AdGroupEstimate[] adGroupEstimatesField; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adGroupEstimates")] + public AdGroupEstimate[] adGroupEstimates { + get { return this.adGroupEstimatesField; } + set { this.adGroupEstimatesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class AdGroupEstimate : Estimate { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private KeywordEstimate[] keywordEstimatesField; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("keywordEstimates")] + public KeywordEstimate[] keywordEstimates { + get { return this.keywordEstimatesField; } + set { this.keywordEstimatesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class KeywordEstimate : Estimate { + private long criterionIdField; + + private bool criterionIdFieldSpecified; + + private StatsEstimate minField; + + private StatsEstimate maxField; + + public long criterionId { + get { return this.criterionIdField; } + set { + this.criterionIdField = value; + this.criterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionIdSpecified { + get { return this.criterionIdFieldSpecified; } + set { this.criterionIdFieldSpecified = value; } + } + + public StatsEstimate min { + get { return this.minField; } + set { this.minField = value; } + } + + public StatsEstimate max { + get { return this.maxField; } + set { this.maxField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class TrafficEstimatorResult { + private CampaignEstimate[] campaignEstimatesField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("campaignEstimates")] + public CampaignEstimate[] campaignEstimates { + get { return this.campaignEstimatesField; } + set { this.campaignEstimatesField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignEstimateRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(KeywordEstimateRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupEstimateRequest))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public abstract partial class EstimateRequest { + private string estimateRequestTypeField; + + [System.Xml.Serialization.XmlElementAttribute("EstimateRequest.Type")] + public string EstimateRequestType { + get { return this.estimateRequestTypeField; } + set { this.estimateRequestTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class CampaignEstimateRequest : EstimateRequest { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private AdGroupEstimateRequest[] adGroupEstimateRequestsField; + + private Criterion[] criteriaField; + + private NetworkSetting networkSettingField; + + private Money dailyBudgetField; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adGroupEstimateRequests")] + public AdGroupEstimateRequest[] adGroupEstimateRequests { + get { return this.adGroupEstimateRequestsField; } + set { this.adGroupEstimateRequestsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("criteria")] + public Criterion[] criteria { + get { return this.criteriaField; } + set { this.criteriaField = value; } + } + + public NetworkSetting networkSetting { + get { return this.networkSettingField; } + set { this.networkSettingField = value; } + } + + public Money dailyBudget { + get { return this.dailyBudgetField; } + set { this.dailyBudgetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class AdGroupEstimateRequest : EstimateRequest { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private KeywordEstimateRequest[] keywordEstimateRequestsField; + + private Money maxCpcField; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("keywordEstimateRequests")] + public KeywordEstimateRequest[] keywordEstimateRequests { + get { return this.keywordEstimateRequestsField; } + set { this.keywordEstimateRequestsField = value; } + } + + public Money maxCpc { + get { return this.maxCpcField; } + set { this.maxCpcField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class KeywordEstimateRequest : EstimateRequest { + private Keyword keywordField; + + private Money maxCpcField; + + private bool isNegativeField; + + private bool isNegativeFieldSpecified; + + public Keyword keyword { + get { return this.keywordField; } + set { this.keywordField = value; } + } + + public Money maxCpc { + get { return this.maxCpcField; } + set { this.maxCpcField = value; } + } + + public bool isNegative { + get { return this.isNegativeField; } + set { + this.isNegativeField = value; + this.isNegativeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isNegativeSpecified { + get { return this.isNegativeFieldSpecified; } + set { this.isNegativeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201309")] + public partial class TrafficEstimatorSelector { + private CampaignEstimateRequest[] campaignEstimateRequestsField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("campaignEstimateRequests")] + public CampaignEstimateRequest[] campaignEstimateRequests { + get { return this.campaignEstimateRequestsField; } + set { this.campaignEstimateRequestsField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdwordsUserListServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/rm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdwordsUserListService : AdWordsSoapClient, IAdwordsUserListService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdwordsUserListService() { + this.Url = "https://adwords.google.com/api/adwords/rm/v201309/AdwordsUserListService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/rm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/rm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserListPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((UserListPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/rm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/rm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserListReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +UserListOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((UserListReturnValue) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201309")] + public partial class UserListReturnValue : ListReturnValue { + private UserList[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public UserList[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BasicUserList))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LogicalUserList))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExternalRemarketingUserList))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201309")] + public partial class UserList { + private long idField; + + private bool idFieldSpecified; + + private bool isReadOnlyField; + + private bool isReadOnlyFieldSpecified; + + private string nameField; + + private string descriptionField; + + private UserListMembershipStatus statusField; + + private bool statusFieldSpecified; + + private string integrationCodeField; + + private AccessReason accessReasonField; + + private bool accessReasonFieldSpecified; + + private AccountUserListStatus accountUserListStatusField; + + private bool accountUserListStatusFieldSpecified; + + private long membershipLifeSpanField; + + private bool membershipLifeSpanFieldSpecified; + + private long sizeField; + + private bool sizeFieldSpecified; + + private SizeRange sizeRangeField; + + private bool sizeRangeFieldSpecified; + + private long sizeForSearchField; + + private bool sizeForSearchFieldSpecified; + + private SizeRange sizeRangeForSearchField; + + private bool sizeRangeForSearchFieldSpecified; + + private string userListTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public bool isReadOnly { + get { return this.isReadOnlyField; } + set { + this.isReadOnlyField = value; + this.isReadOnlySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isReadOnlySpecified { + get { return this.isReadOnlyFieldSpecified; } + set { this.isReadOnlyFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public UserListMembershipStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string integrationCode { + get { return this.integrationCodeField; } + set { this.integrationCodeField = value; } + } + + public AccessReason accessReason { + get { return this.accessReasonField; } + set { + this.accessReasonField = value; + this.accessReasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool accessReasonSpecified { + get { return this.accessReasonFieldSpecified; } + set { this.accessReasonFieldSpecified = value; } + } + + public AccountUserListStatus accountUserListStatus { + get { return this.accountUserListStatusField; } + set { + this.accountUserListStatusField = value; + this.accountUserListStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool accountUserListStatusSpecified { + get { return this.accountUserListStatusFieldSpecified; } + set { this.accountUserListStatusFieldSpecified = value; } + } + + public long membershipLifeSpan { + get { return this.membershipLifeSpanField; } + set { + this.membershipLifeSpanField = value; + this.membershipLifeSpanSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool membershipLifeSpanSpecified { + get { return this.membershipLifeSpanFieldSpecified; } + set { this.membershipLifeSpanFieldSpecified = value; } + } + + public long size { + get { return this.sizeField; } + set { + this.sizeField = value; + this.sizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sizeSpecified { + get { return this.sizeFieldSpecified; } + set { this.sizeFieldSpecified = value; } + } + + public SizeRange sizeRange { + get { return this.sizeRangeField; } + set { + this.sizeRangeField = value; + this.sizeRangeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sizeRangeSpecified { + get { return this.sizeRangeFieldSpecified; } + set { this.sizeRangeFieldSpecified = value; } + } + + public long sizeForSearch { + get { return this.sizeForSearchField; } + set { + this.sizeForSearchField = value; + this.sizeForSearchSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sizeForSearchSpecified { + get { return this.sizeForSearchFieldSpecified; } + set { this.sizeForSearchFieldSpecified = value; } + } + + public SizeRange sizeRangeForSearch { + get { return this.sizeRangeForSearchField; } + set { + this.sizeRangeForSearchField = value; + this.sizeRangeForSearchSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sizeRangeForSearchSpecified { + get { return this.sizeRangeForSearchFieldSpecified; } + set { this.sizeRangeForSearchFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("UserList.Type")] + public string UserListType { + get { return this.userListTypeField; } + set { this.userListTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201309")] + public enum UserListMembershipStatus { + OPEN, + CLOSED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201309")] + public enum AccessReason { + OWNED, + SHARED, + LICENSED, + SUBSCRIBED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201309")] + public enum AccountUserListStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201309")] + public enum SizeRange { + LESS_THAN_FIVE_HUNDRED, + LESS_THAN_ONE_THOUSAND, + ONE_THOUSAND_TO_TEN_THOUSAND, + TEN_THOUSAND_TO_FIFTY_THOUSAND, + FIFTY_THOUSAND_TO_ONE_HUNDRED_THOUSAND, + ONE_HUNDRED_THOUSAND_TO_THREE_HUNDRED_THOUSAND, + THREE_HUNDRED_THOUSAND_TO_FIVE_HUNDRED_THOUSAND, + FIVE_HUNDRED_THOUSAND_TO_ONE_MILLION, + ONE_MILLION_TO_TWO_MILLION, + TWO_MILLION_TO_THREE_MILLION, + THREE_MILLION_TO_FIVE_MILLION, + FIVE_MILLION_TO_TEN_MILLION, + TEN_MILLION_TO_TWENTY_MILLION, + TWENTY_MILLION_TO_THIRTY_MILLION, + THIRTY_MILLION_TO_FIFTY_MILLION, + OVER_FIFTY_MILLION + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201309")] + public partial class BasicUserList : UserList { + private UserListConversionType[] conversionTypesField; + + [System.Xml.Serialization.XmlElementAttribute("conversionTypes")] + public UserListConversionType[] conversionTypes { + get { return this.conversionTypesField; } + set { this.conversionTypesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201309")] + public partial class UserListConversionType { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private UserListConversionTypeCategory categoryField; + + private bool categoryFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public UserListConversionTypeCategory category { + get { return this.categoryField; } + set { + this.categoryField = value; + this.categorySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool categorySpecified { + get { return this.categoryFieldSpecified; } + set { this.categoryFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "UserListConversionType.Category", Namespace = "https://adwords.google.com/api/adwords/rm/v201309")] + public enum UserListConversionTypeCategory { + BOOMERANG_EVENT, + OTHER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201309")] + public partial class LogicalUserList : UserList { + private UserListLogicalRule[] rulesField; + + [System.Xml.Serialization.XmlElementAttribute("rules")] + public UserListLogicalRule[] rules { + get { return this.rulesField; } + set { this.rulesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201309")] + public partial class UserListLogicalRule { + private UserListLogicalRuleOperator operatorField; + + private bool operatorFieldSpecified; + + private LogicalUserListOperand[] ruleOperandsField; + + public UserListLogicalRuleOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ruleOperands")] + public LogicalUserListOperand[] ruleOperands { + get { return this.ruleOperandsField; } + set { this.ruleOperandsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "UserListLogicalRule.Operator", Namespace = "https://adwords.google.com/api/adwords/rm/v201309")] + public enum UserListLogicalRuleOperator { + ALL, + ANY, + NONE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201309")] + public partial class LogicalUserListOperand { + private UserList itemField; + + [System.Xml.Serialization.XmlElementAttribute("UserList")] + public UserList Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201309")] + public partial class ExternalRemarketingUserList : UserList { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201309")] + public partial class UserListOperation : Operation { + private UserList operandField; + + public UserList operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201309")] + public partial class UserListPage : Page { + private UserList[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public UserList[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201309")] + public partial class UserListError : ApiError { + private UserListErrorReason reasonField; + + private bool reasonFieldSpecified; + + public UserListErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "UserListError.Reason", Namespace = "https://adwords.google.com/api/adwords/rm/v201309")] + public enum UserListErrorReason { + EXTERNAL_REMARKETING_USER_LIST_MUTATE_NOT_SUPPORTED, + CONCRETE_TYPE_REQUIRED, + CONVERSION_TYPE_ID_REQUIRED, + DUPLICATE_CONVERSION_TYPES, + INVALID_CONVERSION_TYPE, + INVALID_DESCRIPTION, + INVALID_NAME, + INVALID_TYPE, + INVALID_USER_LIST_LOGICAL_RULE_OPERAND, + NAME_ALREADY_USED, + NEW_CONVERSION_TYPE_NAME_REQUIRED, + OWNERSHIP_REQUIRED_FOR_SET, + REMOVE_NOT_SUPPORTED, + USER_LIST_MUTATE_NOT_SUPPORTED, + USER_LIST_SERVICE_ERROR + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "VideoAdServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class VideoAdService : AdWordsSoapClient, IVideoAdService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public VideoAdService() { + this.Url = "https://adwords.google.com/api/adwords/video/v201309/VideoAdService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual VideoAdPage get(VideoAdSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((VideoAdPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual VideoAdReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +VideoAdOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((VideoAdReturnValue) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoAdReturnValue : ListReturnValue { + private VideoAd[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public VideoAd[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoAd { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string videoIdField; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private TargetingGroupAssociation[] targetingGroupAssociationsField; + + private VideoEntityStats statsField; + + private VideoEntityStats[] segmentedStatsField; + + private ServingInfo issuesField; + + private string campaignNameField; + + private string headlineField; + + private string description1Field; + + private string description2Field; + + private VideoImage imageField; + + private VideoAdYouTubeDestinationPage youTubeDestinationPageField; + + private bool youTubeDestinationPageFieldSpecified; + + private string destinationUrlField; + + private string displayUrlField; + + private VideoImage companionBannerField; + + private bool showVideoAnnotationsField; + + private bool showVideoAnnotationsFieldSpecified; + + private VideoAdStatus statusField; + + private bool statusFieldSpecified; + + private DestinationType inDisplayDestinationTypeField; + + private bool inDisplayDestinationTypeFieldSpecified; + + private ApprovalContext_VideoAd_ApprovalStatusMapEntry[] approvalStatusesField; + + private ApprovalContext_VideoAd_ApprovalLimitMapEntry[] approvalLimitsField; + + private ScopedDisapprovalReason[] disapprovalReasonsField; + + private VideoAdDisplayFormat_VideoAdStatusMapEntry[] statusByFormatField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string videoId { + get { return this.videoIdField; } + set { this.videoIdField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetingGroupAssociations")] + public TargetingGroupAssociation[] targetingGroupAssociations { + get { return this.targetingGroupAssociationsField; } + set { this.targetingGroupAssociationsField = value; } + } + + public VideoEntityStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("segmentedStats")] + public VideoEntityStats[] segmentedStats { + get { return this.segmentedStatsField; } + set { this.segmentedStatsField = value; } + } + + public ServingInfo issues { + get { return this.issuesField; } + set { this.issuesField = value; } + } + + public string campaignName { + get { return this.campaignNameField; } + set { this.campaignNameField = value; } + } + + public string headline { + get { return this.headlineField; } + set { this.headlineField = value; } + } + + public string description1 { + get { return this.description1Field; } + set { this.description1Field = value; } + } + + public string description2 { + get { return this.description2Field; } + set { this.description2Field = value; } + } + + public VideoImage image { + get { return this.imageField; } + set { this.imageField = value; } + } + + public VideoAdYouTubeDestinationPage youTubeDestinationPage { + get { return this.youTubeDestinationPageField; } + set { + this.youTubeDestinationPageField = value; + this.youTubeDestinationPageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool youTubeDestinationPageSpecified { + get { return this.youTubeDestinationPageFieldSpecified; } + set { this.youTubeDestinationPageFieldSpecified = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + public string displayUrl { + get { return this.displayUrlField; } + set { this.displayUrlField = value; } + } + + public VideoImage companionBanner { + get { return this.companionBannerField; } + set { this.companionBannerField = value; } + } + + public bool showVideoAnnotations { + get { return this.showVideoAnnotationsField; } + set { + this.showVideoAnnotationsField = value; + this.showVideoAnnotationsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool showVideoAnnotationsSpecified { + get { return this.showVideoAnnotationsFieldSpecified; } + set { this.showVideoAnnotationsFieldSpecified = value; } + } + + public VideoAdStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public DestinationType inDisplayDestinationType { + get { return this.inDisplayDestinationTypeField; } + set { + this.inDisplayDestinationTypeField = value; + this.inDisplayDestinationTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool inDisplayDestinationTypeSpecified { + get { return this.inDisplayDestinationTypeFieldSpecified; } + set { this.inDisplayDestinationTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("approvalStatuses")] + public ApprovalContext_VideoAd_ApprovalStatusMapEntry[] approvalStatuses { + get { return this.approvalStatusesField; } + set { this.approvalStatusesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("approvalLimits")] + public ApprovalContext_VideoAd_ApprovalLimitMapEntry[] approvalLimits { + get { return this.approvalLimitsField; } + set { this.approvalLimitsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("disapprovalReasons")] + public ScopedDisapprovalReason[] disapprovalReasons { + get { return this.disapprovalReasonsField; } + set { this.disapprovalReasonsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("statusByFormat")] + public VideoAdDisplayFormat_VideoAdStatusMapEntry[] statusByFormat { + get { return this.statusByFormatField; } + set { this.statusByFormatField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class TargetingGroupAssociation { + private long targetingGroupIdField; + + private bool targetingGroupIdFieldSpecified; + + private TargetingGroupAssociationStatus statusField; + + private bool statusFieldSpecified; + + public long targetingGroupId { + get { return this.targetingGroupIdField; } + set { + this.targetingGroupIdField = value; + this.targetingGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetingGroupIdSpecified { + get { return this.targetingGroupIdFieldSpecified; } + set { this.targetingGroupIdFieldSpecified = value; } + } + + public TargetingGroupAssociationStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TargetingGroupAssociation.Status", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum TargetingGroupAssociationStatus { + ACTIVE, + PAUSED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoEntityStats { + private VideoEntityStatsSummaryType summaryTypeField; + + private bool summaryTypeFieldSpecified; + + private SegmentKey segmentKeyField; + + private string startDateField; + + private string endDateField; + + private long viewsField; + + private bool viewsFieldSpecified; + + private Money costField; + + private Money averageCpcField; + + private Money averageCpvField; + + private Money averageCpmField; + + private Integer_LongMapEntry[] impressionReachFrequenciesField; + + private double averageImpressionFrequencyField; + + private bool averageImpressionFrequencyFieldSpecified; + + private double averageViewFrequencyField; + + private bool averageViewFrequencyFieldSpecified; + + private long uniqueViewsField; + + private bool uniqueViewsFieldSpecified; + + private long thumbnailImpressionsField; + + private bool thumbnailImpressionsFieldSpecified; + + private long videoImpressionsField; + + private bool videoImpressionsFieldSpecified; + + private long totalImpressionsField; + + private bool totalImpressionsFieldSpecified; + + private long websiteClicksField; + + private bool websiteClicksFieldSpecified; + + private long conversionsField; + + private bool conversionsFieldSpecified; + + private Money costPerConversionField; + + private double conversionRateField; + + private bool conversionRateFieldSpecified; + + private long viewThroughConversionsField; + + private bool viewThroughConversionsFieldSpecified; + + private long conversionsManyPerViewField; + + private bool conversionsManyPerViewFieldSpecified; + + private Money costPerConversionManyPerViewField; + + private double conversionRateManyPerViewField; + + private bool conversionRateManyPerViewFieldSpecified; + + private double totalConversionValueField; + + private bool totalConversionValueFieldSpecified; + + private double valuePerConvField; + + private bool valuePerConvFieldSpecified; + + private double valuePerConvManyPerViewField; + + private bool valuePerConvManyPerViewFieldSpecified; + + private long followOnViewsField; + + private bool followOnViewsFieldSpecified; + + private double followOnViewRateField; + + private bool followOnViewRateFieldSpecified; + + private long followOnSubscribesField; + + private bool followOnSubscribesFieldSpecified; + + private double followOnSubscribeRateField; + + private bool followOnSubscribeRateFieldSpecified; + + private long followOnLikesField; + + private bool followOnLikesFieldSpecified; + + private long followOnCommentsField; + + private bool followOnCommentsFieldSpecified; + + private long followOnSharesField; + + private bool followOnSharesFieldSpecified; + + private long followOnAddToPlaylistField; + + private bool followOnAddToPlaylistFieldSpecified; + + private double ctrField; + + private bool ctrFieldSpecified; + + private double vtrField; + + private bool vtrFieldSpecified; + + private long videoStartsField; + + private bool videoStartsFieldSpecified; + + private long quartile25sField; + + private bool quartile25sFieldSpecified; + + private long quartile50sField; + + private bool quartile50sFieldSpecified; + + private long quartile75sField; + + private bool quartile75sFieldSpecified; + + private long quartile100sField; + + private bool quartile100sFieldSpecified; + + private double quartile25PercentsField; + + private bool quartile25PercentsFieldSpecified; + + private double quartile50PercentsField; + + private bool quartile50PercentsFieldSpecified; + + private double quartile75PercentsField; + + private bool quartile75PercentsFieldSpecified; + + private double quartile100PercentsField; + + private bool quartile100PercentsFieldSpecified; + + private double percentServedField; + + private bool percentServedFieldSpecified; + + private long eligibleFollowOnClicksField; + + private bool eligibleFollowOnClicksFieldSpecified; + + private double engagementScoreField; + + private bool engagementScoreFieldSpecified; + + private double retentionScoreField; + + private bool retentionScoreFieldSpecified; + + private long totalViewsField; + + private bool totalViewsFieldSpecified; + + private long ctaImpressionsField; + + private bool ctaImpressionsFieldSpecified; + + private long ctaClicksField; + + private bool ctaClicksFieldSpecified; + + private double ctaCtrField; + + private bool ctaCtrFieldSpecified; + + public VideoEntityStatsSummaryType summaryType { + get { return this.summaryTypeField; } + set { + this.summaryTypeField = value; + this.summaryTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool summaryTypeSpecified { + get { return this.summaryTypeFieldSpecified; } + set { this.summaryTypeFieldSpecified = value; } + } + + public SegmentKey segmentKey { + get { return this.segmentKeyField; } + set { this.segmentKeyField = value; } + } + + public string startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public string endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + public long views { + get { return this.viewsField; } + set { + this.viewsField = value; + this.viewsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool viewsSpecified { + get { return this.viewsFieldSpecified; } + set { this.viewsFieldSpecified = value; } + } + + public Money cost { + get { return this.costField; } + set { this.costField = value; } + } + + public Money averageCpc { + get { return this.averageCpcField; } + set { this.averageCpcField = value; } + } + + public Money averageCpv { + get { return this.averageCpvField; } + set { this.averageCpvField = value; } + } + + public Money averageCpm { + get { return this.averageCpmField; } + set { this.averageCpmField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("impressionReachFrequencies")] + public Integer_LongMapEntry[] impressionReachFrequencies { + get { return this.impressionReachFrequenciesField; } + set { this.impressionReachFrequenciesField = value; } + } + + public double averageImpressionFrequency { + get { return this.averageImpressionFrequencyField; } + set { + this.averageImpressionFrequencyField = value; + this.averageImpressionFrequencySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool averageImpressionFrequencySpecified { + get { return this.averageImpressionFrequencyFieldSpecified; } + set { this.averageImpressionFrequencyFieldSpecified = value; } + } + + public double averageViewFrequency { + get { return this.averageViewFrequencyField; } + set { + this.averageViewFrequencyField = value; + this.averageViewFrequencySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool averageViewFrequencySpecified { + get { return this.averageViewFrequencyFieldSpecified; } + set { this.averageViewFrequencyFieldSpecified = value; } + } + + public long uniqueViews { + get { return this.uniqueViewsField; } + set { + this.uniqueViewsField = value; + this.uniqueViewsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool uniqueViewsSpecified { + get { return this.uniqueViewsFieldSpecified; } + set { this.uniqueViewsFieldSpecified = value; } + } + + public long thumbnailImpressions { + get { return this.thumbnailImpressionsField; } + set { + this.thumbnailImpressionsField = value; + this.thumbnailImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thumbnailImpressionsSpecified { + get { return this.thumbnailImpressionsFieldSpecified; } + set { this.thumbnailImpressionsFieldSpecified = value; } + } + + public long videoImpressions { + get { return this.videoImpressionsField; } + set { + this.videoImpressionsField = value; + this.videoImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoImpressionsSpecified { + get { return this.videoImpressionsFieldSpecified; } + set { this.videoImpressionsFieldSpecified = value; } + } + + public long totalImpressions { + get { return this.totalImpressionsField; } + set { + this.totalImpressionsField = value; + this.totalImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalImpressionsSpecified { + get { return this.totalImpressionsFieldSpecified; } + set { this.totalImpressionsFieldSpecified = value; } + } + + public long websiteClicks { + get { return this.websiteClicksField; } + set { + this.websiteClicksField = value; + this.websiteClicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool websiteClicksSpecified { + get { return this.websiteClicksFieldSpecified; } + set { this.websiteClicksFieldSpecified = value; } + } + + public long conversions { + get { return this.conversionsField; } + set { + this.conversionsField = value; + this.conversionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool conversionsSpecified { + get { return this.conversionsFieldSpecified; } + set { this.conversionsFieldSpecified = value; } + } + + public Money costPerConversion { + get { return this.costPerConversionField; } + set { this.costPerConversionField = value; } + } + + public double conversionRate { + get { return this.conversionRateField; } + set { + this.conversionRateField = value; + this.conversionRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool conversionRateSpecified { + get { return this.conversionRateFieldSpecified; } + set { this.conversionRateFieldSpecified = value; } + } + + public long viewThroughConversions { + get { return this.viewThroughConversionsField; } + set { + this.viewThroughConversionsField = value; + this.viewThroughConversionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool viewThroughConversionsSpecified { + get { return this.viewThroughConversionsFieldSpecified; } + set { this.viewThroughConversionsFieldSpecified = value; } + } + + public long conversionsManyPerView { + get { return this.conversionsManyPerViewField; } + set { + this.conversionsManyPerViewField = value; + this.conversionsManyPerViewSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool conversionsManyPerViewSpecified { + get { return this.conversionsManyPerViewFieldSpecified; } + set { this.conversionsManyPerViewFieldSpecified = value; } + } + + public Money costPerConversionManyPerView { + get { return this.costPerConversionManyPerViewField; } + set { this.costPerConversionManyPerViewField = value; } + } + + public double conversionRateManyPerView { + get { return this.conversionRateManyPerViewField; } + set { + this.conversionRateManyPerViewField = value; + this.conversionRateManyPerViewSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool conversionRateManyPerViewSpecified { + get { return this.conversionRateManyPerViewFieldSpecified; } + set { this.conversionRateManyPerViewFieldSpecified = value; } + } + + public double totalConversionValue { + get { return this.totalConversionValueField; } + set { + this.totalConversionValueField = value; + this.totalConversionValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalConversionValueSpecified { + get { return this.totalConversionValueFieldSpecified; } + set { this.totalConversionValueFieldSpecified = value; } + } + + public double valuePerConv { + get { return this.valuePerConvField; } + set { + this.valuePerConvField = value; + this.valuePerConvSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valuePerConvSpecified { + get { return this.valuePerConvFieldSpecified; } + set { this.valuePerConvFieldSpecified = value; } + } + + public double valuePerConvManyPerView { + get { return this.valuePerConvManyPerViewField; } + set { + this.valuePerConvManyPerViewField = value; + this.valuePerConvManyPerViewSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valuePerConvManyPerViewSpecified { + get { return this.valuePerConvManyPerViewFieldSpecified; } + set { this.valuePerConvManyPerViewFieldSpecified = value; } + } + + public long followOnViews { + get { return this.followOnViewsField; } + set { + this.followOnViewsField = value; + this.followOnViewsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool followOnViewsSpecified { + get { return this.followOnViewsFieldSpecified; } + set { this.followOnViewsFieldSpecified = value; } + } + + public double followOnViewRate { + get { return this.followOnViewRateField; } + set { + this.followOnViewRateField = value; + this.followOnViewRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool followOnViewRateSpecified { + get { return this.followOnViewRateFieldSpecified; } + set { this.followOnViewRateFieldSpecified = value; } + } + + public long followOnSubscribes { + get { return this.followOnSubscribesField; } + set { + this.followOnSubscribesField = value; + this.followOnSubscribesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool followOnSubscribesSpecified { + get { return this.followOnSubscribesFieldSpecified; } + set { this.followOnSubscribesFieldSpecified = value; } + } + + public double followOnSubscribeRate { + get { return this.followOnSubscribeRateField; } + set { + this.followOnSubscribeRateField = value; + this.followOnSubscribeRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool followOnSubscribeRateSpecified { + get { return this.followOnSubscribeRateFieldSpecified; } + set { this.followOnSubscribeRateFieldSpecified = value; } + } + + public long followOnLikes { + get { return this.followOnLikesField; } + set { + this.followOnLikesField = value; + this.followOnLikesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool followOnLikesSpecified { + get { return this.followOnLikesFieldSpecified; } + set { this.followOnLikesFieldSpecified = value; } + } + + public long followOnComments { + get { return this.followOnCommentsField; } + set { + this.followOnCommentsField = value; + this.followOnCommentsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool followOnCommentsSpecified { + get { return this.followOnCommentsFieldSpecified; } + set { this.followOnCommentsFieldSpecified = value; } + } + + public long followOnShares { + get { return this.followOnSharesField; } + set { + this.followOnSharesField = value; + this.followOnSharesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool followOnSharesSpecified { + get { return this.followOnSharesFieldSpecified; } + set { this.followOnSharesFieldSpecified = value; } + } + + public long followOnAddToPlaylist { + get { return this.followOnAddToPlaylistField; } + set { + this.followOnAddToPlaylistField = value; + this.followOnAddToPlaylistSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool followOnAddToPlaylistSpecified { + get { return this.followOnAddToPlaylistFieldSpecified; } + set { this.followOnAddToPlaylistFieldSpecified = value; } + } + + public double ctr { + get { return this.ctrField; } + set { + this.ctrField = value; + this.ctrSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ctrSpecified { + get { return this.ctrFieldSpecified; } + set { this.ctrFieldSpecified = value; } + } + + public double vtr { + get { return this.vtrField; } + set { + this.vtrField = value; + this.vtrSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool vtrSpecified { + get { return this.vtrFieldSpecified; } + set { this.vtrFieldSpecified = value; } + } + + public long videoStarts { + get { return this.videoStartsField; } + set { + this.videoStartsField = value; + this.videoStartsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoStartsSpecified { + get { return this.videoStartsFieldSpecified; } + set { this.videoStartsFieldSpecified = value; } + } + + public long quartile25s { + get { return this.quartile25sField; } + set { + this.quartile25sField = value; + this.quartile25sSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool quartile25sSpecified { + get { return this.quartile25sFieldSpecified; } + set { this.quartile25sFieldSpecified = value; } + } + + public long quartile50s { + get { return this.quartile50sField; } + set { + this.quartile50sField = value; + this.quartile50sSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool quartile50sSpecified { + get { return this.quartile50sFieldSpecified; } + set { this.quartile50sFieldSpecified = value; } + } + + public long quartile75s { + get { return this.quartile75sField; } + set { + this.quartile75sField = value; + this.quartile75sSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool quartile75sSpecified { + get { return this.quartile75sFieldSpecified; } + set { this.quartile75sFieldSpecified = value; } + } + + public long quartile100s { + get { return this.quartile100sField; } + set { + this.quartile100sField = value; + this.quartile100sSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool quartile100sSpecified { + get { return this.quartile100sFieldSpecified; } + set { this.quartile100sFieldSpecified = value; } + } + + public double quartile25Percents { + get { return this.quartile25PercentsField; } + set { + this.quartile25PercentsField = value; + this.quartile25PercentsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool quartile25PercentsSpecified { + get { return this.quartile25PercentsFieldSpecified; } + set { this.quartile25PercentsFieldSpecified = value; } + } + + public double quartile50Percents { + get { return this.quartile50PercentsField; } + set { + this.quartile50PercentsField = value; + this.quartile50PercentsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool quartile50PercentsSpecified { + get { return this.quartile50PercentsFieldSpecified; } + set { this.quartile50PercentsFieldSpecified = value; } + } + + public double quartile75Percents { + get { return this.quartile75PercentsField; } + set { + this.quartile75PercentsField = value; + this.quartile75PercentsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool quartile75PercentsSpecified { + get { return this.quartile75PercentsFieldSpecified; } + set { this.quartile75PercentsFieldSpecified = value; } + } + + public double quartile100Percents { + get { return this.quartile100PercentsField; } + set { + this.quartile100PercentsField = value; + this.quartile100PercentsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool quartile100PercentsSpecified { + get { return this.quartile100PercentsFieldSpecified; } + set { this.quartile100PercentsFieldSpecified = value; } + } + + public double percentServed { + get { return this.percentServedField; } + set { + this.percentServedField = value; + this.percentServedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool percentServedSpecified { + get { return this.percentServedFieldSpecified; } + set { this.percentServedFieldSpecified = value; } + } + + public long eligibleFollowOnClicks { + get { return this.eligibleFollowOnClicksField; } + set { + this.eligibleFollowOnClicksField = value; + this.eligibleFollowOnClicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool eligibleFollowOnClicksSpecified { + get { return this.eligibleFollowOnClicksFieldSpecified; } + set { this.eligibleFollowOnClicksFieldSpecified = value; } + } + + public double engagementScore { + get { return this.engagementScoreField; } + set { + this.engagementScoreField = value; + this.engagementScoreSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool engagementScoreSpecified { + get { return this.engagementScoreFieldSpecified; } + set { this.engagementScoreFieldSpecified = value; } + } + + public double retentionScore { + get { return this.retentionScoreField; } + set { + this.retentionScoreField = value; + this.retentionScoreSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool retentionScoreSpecified { + get { return this.retentionScoreFieldSpecified; } + set { this.retentionScoreFieldSpecified = value; } + } + + public long totalViews { + get { return this.totalViewsField; } + set { + this.totalViewsField = value; + this.totalViewsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalViewsSpecified { + get { return this.totalViewsFieldSpecified; } + set { this.totalViewsFieldSpecified = value; } + } + + public long ctaImpressions { + get { return this.ctaImpressionsField; } + set { + this.ctaImpressionsField = value; + this.ctaImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ctaImpressionsSpecified { + get { return this.ctaImpressionsFieldSpecified; } + set { this.ctaImpressionsFieldSpecified = value; } + } + + public long ctaClicks { + get { return this.ctaClicksField; } + set { + this.ctaClicksField = value; + this.ctaClicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ctaClicksSpecified { + get { return this.ctaClicksFieldSpecified; } + set { this.ctaClicksFieldSpecified = value; } + } + + public double ctaCtr { + get { return this.ctaCtrField; } + set { + this.ctaCtrField = value; + this.ctaCtrSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ctaCtrSpecified { + get { return this.ctaCtrFieldSpecified; } + set { this.ctaCtrFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoEntityStats.SummaryType", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoEntityStatsSummaryType { + ALL, + ALL_ENABLED, + ALL_BUT_DELETED, + ALL_DELETED, + ALL_NON_VIDEO, + COMBINED_VIDEO_NON_VIDEO, + PERFORMANCE_OTHER, + NON_SUMMARY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class SegmentKey { + private object itemField; + + [System.Xml.Serialization.XmlElementAttribute("CampaignKey", typeof(CampaignKey))] + [System.Xml.Serialization.XmlElementAttribute("ConversionTypeKey", typeof(ConversionTypeKey))] + [System.Xml.Serialization.XmlElementAttribute("CountryKey", typeof(CountryKey))] + [System.Xml.Serialization.XmlElementAttribute("DateKey", typeof(DateKey))] + [System.Xml.Serialization.XmlElementAttribute("DayOfWeekKey", typeof(DayOfWeekKey))] + [System.Xml.Serialization.XmlElementAttribute("DeviceKey", typeof(DeviceKey))] + [System.Xml.Serialization.XmlElementAttribute("DisplayFormatKey", typeof(DisplayFormatKey))] + [System.Xml.Serialization.XmlElementAttribute("DisplayFormatNetworkKey", typeof(DisplayFormatNetworkKey))] + [System.Xml.Serialization.XmlElementAttribute("DisplayFormatTypeKey", typeof(DisplayFormatTypeKey))] + [System.Xml.Serialization.XmlElementAttribute("GeoKey", typeof(GeoKey))] + [System.Xml.Serialization.XmlElementAttribute("HourOfDayKey", typeof(HourOfDayKey))] + [System.Xml.Serialization.XmlElementAttribute("MetroKey", typeof(MetroKey))] + [System.Xml.Serialization.XmlElementAttribute("NetworkKey", typeof(NetworkKey))] + [System.Xml.Serialization.XmlElementAttribute("PaidViewsKey", typeof(PaidViewsKey))] + [System.Xml.Serialization.XmlElementAttribute("RegionKey", typeof(RegionKey))] + [System.Xml.Serialization.XmlElementAttribute("TargetingGroupKey", typeof(TargetingGroupKey))] + [System.Xml.Serialization.XmlElementAttribute("VideoAdKey", typeof(VideoAdKey))] + public object Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class CampaignKey { + private string campaignNameField; + + public string campaignName { + get { return this.campaignNameField; } + set { this.campaignNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class ConversionTypeKey { + private long conversionTypeIdField; + + private bool conversionTypeIdFieldSpecified; + + private string conversionTypeNameField; + + public long conversionTypeId { + get { return this.conversionTypeIdField; } + set { + this.conversionTypeIdField = value; + this.conversionTypeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool conversionTypeIdSpecified { + get { return this.conversionTypeIdFieldSpecified; } + set { this.conversionTypeIdFieldSpecified = value; } + } + + public string conversionTypeName { + get { return this.conversionTypeNameField; } + set { this.conversionTypeNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class CountryKey { + private long criterionIdField; + + private bool criterionIdFieldSpecified; + + private RegionCode regionCodeField; + + private bool regionCodeFieldSpecified; + + private string countryNameField; + + public long criterionId { + get { return this.criterionIdField; } + set { + this.criterionIdField = value; + this.criterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionIdSpecified { + get { return this.criterionIdFieldSpecified; } + set { this.criterionIdFieldSpecified = value; } + } + + public RegionCode regionCode { + get { return this.regionCodeField; } + set { + this.regionCodeField = value; + this.regionCodeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool regionCodeSpecified { + get { return this.regionCodeFieldSpecified; } + set { this.regionCodeFieldSpecified = value; } + } + + public string countryName { + get { return this.countryNameField; } + set { this.countryNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum RegionCode { + AC, + AD, + AE, + AF, + AG, + AI, + AL, + AM, + AN, + AO, + AQ, + AR, + AS, + AT, + AU, + AW, + AX, + AZ, + BA, + BB, + BD, + BE, + BF, + BG, + BH, + BI, + BJ, + BL, + BM, + BN, + BO, + BQ, + BR, + BS, + BT, + BU, + BV, + BW, + BY, + BZ, + CA, + CC, + CD, + CF, + CG, + CH, + CI, + CK, + CL, + CM, + CN, + CO, + CP, + CR, + CS, + CU, + CV, + CW, + CX, + CY, + CZ, + DD, + DE, + DG, + DJ, + DK, + DM, + DO, + DZ, + EA, + EC, + EE, + EG, + EH, + ER, + ES, + ET, + EU, + FI, + FJ, + FK, + FM, + FO, + FR, + FX, + GA, + GB, + GD, + GE, + GF, + GG, + GH, + GI, + GL, + GM, + GN, + GP, + GQ, + GR, + GS, + GT, + GU, + GW, + GY, + HK, + HM, + HN, + HR, + HT, + HU, + IC, + ID, + IE, + IL, + IM, + IN, + IO, + IQ, + IR, + IS, + IT, + JE, + JM, + JO, + JP, + KE, + KG, + KH, + KI, + KM, + KN, + KP, + KR, + KW, + KY, + KZ, + LA, + LB, + LC, + LI, + LK, + LR, + LS, + LT, + LU, + LV, + LY, + MA, + MC, + MD, + ME, + MF, + MG, + MH, + MK, + ML, + MM, + MN, + MO, + MP, + MQ, + MR, + MS, + MT, + MU, + MV, + MW, + MX, + MY, + MZ, + NA, + NC, + NE, + NF, + NG, + NI, + NL, + NO, + NP, + NR, + NT, + NU, + NZ, + OM, + PA, + PE, + PF, + PG, + PH, + PK, + PL, + PM, + PN, + PR, + PS, + PT, + PW, + PY, + QA, + QO, + QU, + RE, + RO, + RS, + RU, + RW, + SA, + SB, + SC, + SD, + SE, + SG, + SH, + SI, + SJ, + SK, + SL, + SM, + SN, + SO, + SR, + SS, + ST, + SU, + SV, + SX, + SY, + SZ, + TA, + TC, + TD, + TF, + TG, + TH, + TJ, + TK, + TL, + TM, + TN, + TO, + TP, + TR, + TT, + TV, + TW, + TZ, + UA, + UG, + UM, + US, + UY, + UZ, + VA, + VC, + VE, + VG, + VI, + VN, + VU, + WF, + WS, + XA, + XB, + XC, + XK, + YD, + YE, + YT, + YU, + ZA, + ZM, + ZR, + ZW, + ZZ, + UN001, + UN002, + UN003, + UN005, + UN009, + UN011, + UN013, + UN014, + UN015, + UN017, + UN018, + UN019, + UN021, + UN029, + UN030, + UN034, + UN035, + UN039, + UN053, + UN054, + UN057, + UN061, + UN142, + UN143, + UN145, + UN150, + UN151, + UN154, + UN155, + UN419 + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class DateKey { + private string dateField; + + private SegmentationDimension dimensionField; + + private bool dimensionFieldSpecified; + + public string date { + get { return this.dateField; } + set { this.dateField = value; } + } + + public SegmentationDimension dimension { + get { return this.dimensionField; } + set { + this.dimensionField = value; + this.dimensionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dimensionSpecified { + get { return this.dimensionFieldSpecified; } + set { this.dimensionFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum SegmentationDimension { + NONE, + DATE_DAY, + DATE_WEEK, + DATE_MONTH, + DATE_QUARTER, + DATE_YEAR, + DAY_OF_WEEK, + DEVICE_TYPE, + DISPLAY_FORMAT, + DISPLAY_FORMATxNETWORK, + HOUR_OF_DAY, + NETWORK, + TARGETING_GROUP, + VIDEO_AD, + CONVERSION_TYPE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class DayOfWeekKey { + private VideoDayOfWeek dayOfWeekField; + + private bool dayOfWeekFieldSpecified; + + public VideoDayOfWeek dayOfWeek { + get { return this.dayOfWeekField; } + set { + this.dayOfWeekField = value; + this.dayOfWeekSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dayOfWeekSpecified { + get { return this.dayOfWeekFieldSpecified; } + set { this.dayOfWeekFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoDayOfWeek { + MONDAY, + TUESDAY, + WEDNESDAY, + THURSDAY, + FRIDAY, + SATURDAY, + SUNDAY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class DeviceKey { + private DeviceKeyDeviceType deviceTypeField; + + private bool deviceTypeFieldSpecified; + + public DeviceKeyDeviceType deviceType { + get { return this.deviceTypeField; } + set { + this.deviceTypeField = value; + this.deviceTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deviceTypeSpecified { + get { return this.deviceTypeFieldSpecified; } + set { this.deviceTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DeviceKey.DeviceType", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum DeviceKeyDeviceType { + DESKTOP, + HIGHENDMOBILE, + TABLET, + OTHER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class DisplayFormatKey { + private VideoAdDisplayFormat displayFormatField; + + private bool displayFormatFieldSpecified; + + public VideoAdDisplayFormat displayFormat { + get { return this.displayFormatField; } + set { + this.displayFormatField = value; + this.displayFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool displayFormatSpecified { + get { return this.displayFormatFieldSpecified; } + set { this.displayFormatFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoAdDisplayFormat { + TRUE_VIEW_IN_SEARCH, + TRUE_VIEW_IN_SLATE, + TRUE_VIEW_IN_DISPLAY, + TRUE_VIEW_IN_STREAM, + STANDARD_IN_STREAM, + ALL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class DisplayFormatNetworkKey { + private VideoAdDisplayFormat formatField; + + private bool formatFieldSpecified; + + private VideoAdNetwork networkField; + + private bool networkFieldSpecified; + + public VideoAdDisplayFormat format { + get { return this.formatField; } + set { + this.formatField = value; + this.formatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool formatSpecified { + get { return this.formatFieldSpecified; } + set { this.formatFieldSpecified = value; } + } + + public VideoAdNetwork network { + get { return this.networkField; } + set { + this.networkField = value; + this.networkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool networkSpecified { + get { return this.networkFieldSpecified; } + set { this.networkFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoAdNetwork { + YOUTUBE_SEARCH, + YOUTUBE_WATCH, + GOOGLE_DISPLAY_NETWORK, + GOOGLE_SEARCH, + ALL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class DisplayFormatTypeKey { + private VideoAdDisplayFormatType displayFormatTypeField; + + private bool displayFormatTypeFieldSpecified; + + public VideoAdDisplayFormatType displayFormatType { + get { return this.displayFormatTypeField; } + set { + this.displayFormatTypeField = value; + this.displayFormatTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool displayFormatTypeSpecified { + get { return this.displayFormatTypeFieldSpecified; } + set { this.displayFormatTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoAdDisplayFormat.Type", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoAdDisplayFormatType { + TRUE_VIEW, + STANDARD, + ALL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class GeoKey { + private object itemField; + + [System.Xml.Serialization.XmlElementAttribute("CountryKey", typeof(CountryKey))] + [System.Xml.Serialization.XmlElementAttribute("MetroKey", typeof(MetroKey))] + [System.Xml.Serialization.XmlElementAttribute("RegionKey", typeof(RegionKey))] + public object Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class MetroKey { + private long criterionIdField; + + private bool criterionIdFieldSpecified; + + private string metroCodeField; + + private string metroNameField; + + public long criterionId { + get { return this.criterionIdField; } + set { + this.criterionIdField = value; + this.criterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionIdSpecified { + get { return this.criterionIdFieldSpecified; } + set { this.criterionIdFieldSpecified = value; } + } + + public string metroCode { + get { return this.metroCodeField; } + set { this.metroCodeField = value; } + } + + public string metroName { + get { return this.metroNameField; } + set { this.metroNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class RegionKey { + private long criterionIdField; + + private bool criterionIdFieldSpecified; + + private string regionCodeField; + + private string regionNameField; + + public long criterionId { + get { return this.criterionIdField; } + set { + this.criterionIdField = value; + this.criterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionIdSpecified { + get { return this.criterionIdFieldSpecified; } + set { this.criterionIdFieldSpecified = value; } + } + + public string regionCode { + get { return this.regionCodeField; } + set { this.regionCodeField = value; } + } + + public string regionName { + get { return this.regionNameField; } + set { this.regionNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class HourOfDayKey { + private int hourOfDayField; + + private bool hourOfDayFieldSpecified; + + public int hourOfDay { + get { return this.hourOfDayField; } + set { + this.hourOfDayField = value; + this.hourOfDaySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hourOfDaySpecified { + get { return this.hourOfDayFieldSpecified; } + set { this.hourOfDayFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class NetworkKey { + private VideoAdNetwork networkField; + + private bool networkFieldSpecified; + + public VideoAdNetwork network { + get { return this.networkField; } + set { + this.networkField = value; + this.networkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool networkSpecified { + get { return this.networkFieldSpecified; } + set { this.networkFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class PaidViewsKey { + private bool paidViewsField; + + private bool paidViewsFieldSpecified; + + public bool paidViews { + get { return this.paidViewsField; } + set { + this.paidViewsField = value; + this.paidViewsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool paidViewsSpecified { + get { return this.paidViewsFieldSpecified; } + set { this.paidViewsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class TargetingGroupKey { + private long targetingGroupIdField; + + private bool targetingGroupIdFieldSpecified; + + private string targetingGroupNameField; + + public long targetingGroupId { + get { return this.targetingGroupIdField; } + set { + this.targetingGroupIdField = value; + this.targetingGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetingGroupIdSpecified { + get { return this.targetingGroupIdFieldSpecified; } + set { this.targetingGroupIdFieldSpecified = value; } + } + + public string targetingGroupName { + get { return this.targetingGroupNameField; } + set { this.targetingGroupNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoAdKey { + private string videoAdNameField; + + private long videoAdIdField; + + private bool videoAdIdFieldSpecified; + + public string videoAdName { + get { return this.videoAdNameField; } + set { this.videoAdNameField = value; } + } + + public long videoAdId { + get { return this.videoAdIdField; } + set { + this.videoAdIdField = value; + this.videoAdIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoAdIdSpecified { + get { return this.videoAdIdFieldSpecified; } + set { this.videoAdIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class Integer_LongMapEntry { + private int keyField; + + private bool keyFieldSpecified; + + private long valueField; + + private bool valueFieldSpecified; + + public int key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public long value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class ServingInfo { + private ServingIssue[] issuesField; + + private VideoServingStatus servingStatusField; + + private bool servingStatusFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("issues")] + public ServingIssue[] issues { + get { return this.issuesField; } + set { this.issuesField = value; } + } + + public VideoServingStatus servingStatus { + get { return this.servingStatusField; } + set { + this.servingStatusField = value; + this.servingStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool servingStatusSpecified { + get { return this.servingStatusFieldSpecified; } + set { this.servingStatusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class ServingIssue { + private ServingIssueReason reasonField; + + private bool reasonFieldSpecified; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private long targetingGroupIdField; + + private bool targetingGroupIdFieldSpecified; + + private long videoAdIdField; + + private bool videoAdIdFieldSpecified; + + private string videoIdField; + + private bool hideActionLinkField; + + private bool hideActionLinkFieldSpecified; + + private ServingIssueSeverity severityField; + + private bool severityFieldSpecified; + + private ServingIssueType typeField; + + private bool typeFieldSpecified; + + public ServingIssueReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public long targetingGroupId { + get { return this.targetingGroupIdField; } + set { + this.targetingGroupIdField = value; + this.targetingGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetingGroupIdSpecified { + get { return this.targetingGroupIdFieldSpecified; } + set { this.targetingGroupIdFieldSpecified = value; } + } + + public long videoAdId { + get { return this.videoAdIdField; } + set { + this.videoAdIdField = value; + this.videoAdIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoAdIdSpecified { + get { return this.videoAdIdFieldSpecified; } + set { this.videoAdIdFieldSpecified = value; } + } + + public string videoId { + get { return this.videoIdField; } + set { this.videoIdField = value; } + } + + public bool hideActionLink { + get { return this.hideActionLinkField; } + set { + this.hideActionLinkField = value; + this.hideActionLinkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hideActionLinkSpecified { + get { return this.hideActionLinkFieldSpecified; } + set { this.hideActionLinkFieldSpecified = value; } + } + + public ServingIssueSeverity severity { + get { return this.severityField; } + set { + this.severityField = value; + this.severitySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool severitySpecified { + get { return this.severityFieldSpecified; } + set { this.severityFieldSpecified = value; } + } + + public ServingIssueType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ServingIssue.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum ServingIssueReason { + ACCOUNT_SUSPENDED, + ACCOUNT_CLOSED, + ACCOUNT_DISABLED, + SUSPENDED, + LIMITED_BY_BUDGET, + INSTREAM_TOO_HIGH, + ALL_CREATIVES_UNHEALTHY, + SOME_CREATIVES_DISAPPROVED, + ALL_CREATIVES_DISAPPROVED, + SOME_CREATIVES_LABELED, + ALL_CREATIVES_LABELED, + SOME_CREATIVES_UNREVIEWED, + ALL_CREATIVES_UNREVIEWED, + SOME_CREATIVES_ELIGIBLE, + ALL_CREATIVES_ELIGIBLE, + VIDEO_ADS_WITHOUT_TARGETING, + ACTIVE_AD_WITH_ALL_FORMATS_PAUSED, + TARGETING_BID_REQUIRED, + INSLATE_DEPRECATED, + TARGETING_DUPLICATE_NAME, + TARGETING_MISMATCH, + TARGETING_NO_VIDEOAD, + STUDY_INVITATION, + SURVEY_INVITATION, + NO_VIDEO_AD_SERVING, + ALL_VIDEO_ADS_PENDING, + SOME_VIDEO_ADS_PENDING, + ALL_VIDEO_ADS_UNHEALTHY, + SOME_VIDEO_ADS_UNHEALTHY, + NO_VIDEO, + NO_TARGETING, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ServingIssue.Severity", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum ServingIssueSeverity { + HIGH, + MEDIUM, + LOW + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ServingIssue.Type", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum ServingIssueType { + BLOCKING, + ISSUE, + NOTIFICATION, + PENDING + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoServingStatus { + UNDEFINED, + DELETED, + CAMPAIGN_DELETED, + PAUSED, + CAMPAIGN_PAUSED, + ENDED, + SUSPENDED, + BROKEN, + IMPROVABLE, + NOTIFICATION, + PENDING, + SERVING, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoImage { + private VideoImageType typeField; + + private bool typeFieldSpecified; + + private VideoImageType secondaryTypeField; + + private bool secondaryTypeFieldSpecified; + + private long mediaIdField; + + private bool mediaIdFieldSpecified; + + private string urlField; + + private VideoImageMimeType mimeTypeField; + + private bool mimeTypeFieldSpecified; + + public VideoImageType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public VideoImageType secondaryType { + get { return this.secondaryTypeField; } + set { + this.secondaryTypeField = value; + this.secondaryTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool secondaryTypeSpecified { + get { return this.secondaryTypeFieldSpecified; } + set { this.secondaryTypeFieldSpecified = value; } + } + + public long mediaId { + get { return this.mediaIdField; } + set { + this.mediaIdField = value; + this.mediaIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mediaIdSpecified { + get { return this.mediaIdFieldSpecified; } + set { this.mediaIdFieldSpecified = value; } + } + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + + public VideoImageMimeType mimeType { + get { return this.mimeTypeField; } + set { + this.mimeTypeField = value; + this.mimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mimeTypeSpecified { + get { return this.mimeTypeFieldSpecified; } + set { this.mimeTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoImage.Type", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoImageType { + MEDIA, + DEFAULT_THUMBNAIL, + THUMBNAIL1, + THUMBNAIL2, + THUMBNAIL3, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoImage.MimeType", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoImageMimeType { + IMAGE_JPEG, + IMAGE_GIF, + IMAGE_PNG, + FLASH + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoAd.YouTubeDestinationPage", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoAdYouTubeDestinationPage { + WATCH_PAGE, + CHANNEL_PAGE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoAdStatus { + ENABLED, + PAUSED, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum DestinationType { + YOUTUBE, + ADVERTISER_SITE, + LEGACY_BOTH, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class ApprovalContext_VideoAd_ApprovalStatusMapEntry { + private ApprovalContext keyField; + + private VideoAdApprovalStatus valueField; + + private bool valueFieldSpecified; + + public ApprovalContext key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public VideoAdApprovalStatus value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class ApprovalContext { + private TargetingScope targetingScopeField; + + private bool targetingScopeFieldSpecified; + + private DestinationType destinationTypeField; + + private bool destinationTypeFieldSpecified; + + public TargetingScope targetingScope { + get { return this.targetingScopeField; } + set { + this.targetingScopeField = value; + this.targetingScopeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetingScopeSpecified { + get { return this.targetingScopeFieldSpecified; } + set { this.targetingScopeFieldSpecified = value; } + } + + public DestinationType destinationType { + get { return this.destinationTypeField; } + set { + this.destinationTypeField = value; + this.destinationTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool destinationTypeSpecified { + get { return this.destinationTypeFieldSpecified; } + set { this.destinationTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum TargetingScope { + TRUE_VIEW_IN_SEARCH_ON_YOUTUBE_SEARCH, + TRUE_VIEW_IN_SLATE_ON_YOUTUBE_WATCH, + TRUE_VIEW_IN_DISPLAY_ON_YOUTUBE_WATCH, + TRUE_VIEW_IN_STREAM_ON_YOUTUBE_WATCH, + TRUE_VIEW_IN_SLATE_ON_GOOGLE_DISPLAY_NETWORK, + TRUE_VIEW_IN_DISPLAY_ON_GOOGLE_DISPLAY_NETWORK, + TRUE_VIEW_IN_STREAM_ON_GOOGLE_DISPLAY_NETWORK, + TRUE_VIEW_IN_SEARCH_ON_GOOGLE_SEARCH, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoAd.ApprovalStatus", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoAdApprovalStatus { + APPROVED, + APPROVED_LIMITED, + ELIGIBLE, + UNDER_REVIEW, + DISAPPROVED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class ApprovalContext_VideoAd_ApprovalLimitMapEntry { + private ApprovalContext keyField; + + private VideoAdApprovalLimit valueField; + + private bool valueFieldSpecified; + + public ApprovalContext key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public VideoAdApprovalLimit value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoAd.ApprovalLimit", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoAdApprovalLimit { + FAMILY_SAFE, + NON_FAMILY_SAFE, + ADULT_CONTENT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class ScopedDisapprovalReason { + private ApprovalContext approvalContextField; + + private DisapprovalReason disapprovalReasonField; + + public ApprovalContext approvalContext { + get { return this.approvalContextField; } + set { this.approvalContextField = value; } + } + + public DisapprovalReason disapprovalReason { + get { return this.disapprovalReasonField; } + set { this.disapprovalReasonField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class DisapprovalReason { + private string reasonField; + + private int helpIdField; + + private bool helpIdFieldSpecified; + + public string reason { + get { return this.reasonField; } + set { this.reasonField = value; } + } + + public int helpId { + get { return this.helpIdField; } + set { + this.helpIdField = value; + this.helpIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool helpIdSpecified { + get { return this.helpIdFieldSpecified; } + set { this.helpIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoAdDisplayFormat_VideoAdStatusMapEntry { + private VideoAdDisplayFormat keyField; + + private bool keyFieldSpecified; + + private VideoAdStatus valueField; + + private bool valueFieldSpecified; + + public VideoAdDisplayFormat key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public VideoAdStatus value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoAdOperation : Operation { + private VideoAd operandField; + + private ExemptionRequest[] exemptionRequestsField; + + public VideoAd operand { + get { return this.operandField; } + set { this.operandField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("exemptionRequests")] + public ExemptionRequest[] exemptionRequests { + get { return this.exemptionRequestsField; } + set { this.exemptionRequestsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoAdPage : Page { + private VideoAd[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public VideoAd[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class Sortable { + private object itemField; + + [System.Xml.Serialization.XmlElementAttribute("StatsSortable", typeof(StatsSortable))] + [System.Xml.Serialization.XmlElementAttribute("VideoAdSortable", typeof(VideoAdSortable))] + public object Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum StatsSortable { + AVERAGE_CPV, + AVERAGE_CPM, + VIEWS, + VIEW_RATE, + CTR, + COST, + COST_PER_CONVERSION, + IMPRESSIONS, + WEBSITE_CLICKS, + CONVERSIONS, + CONVERSION_RATE, + VIEW_THROUGH_CONVERSIONS, + CONVERSIONS_MANY_PER_VIEW, + CONVERSION_RATE_MANY_PER_VIEW, + COST_PER_CONVERSION_MANY_PER_VIEW, + TOTAL_CONV_VALUE, + VALUE_PER_CONV, + VALUE_PER_CONV_MANY_PER_VIEW, + PERCENT_SERVED, + VIDEO_STARTS, + QUARTILE_25S, + QUARTILE_50S, + QUARTILE_75S, + QUARTILE_100S, + QUARTILE_25_PERCENTS, + QUARTILE_50_PERCENTS, + QUARTILE_75_PERCENTS, + QUARTILE_100_PERCENTS, + FOLLOW_ON_SUBSCRIBES, + FOLLOW_ON_SUBSCRIBE_RATE, + FOLLOW_ON_VIEWS, + FOLLOW_ON_VIEW_RATE, + FOLLOW_ON_ADD_TO_PLAYLIST, + FOLLOW_ON_COMMENTS, + FOLLOW_ON_LIKES, + FOLLOW_ON_SHARES, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoAdSortable { + CAMPAIGN_ID, + CAMPAIGN_NAME, + NAME, + STATUS, + VIDEOAD_ID, + VIDEO_NAME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class Sorting { + private Sortable fieldField; + + private VideoSortOrder sortOrderField; + + private bool sortOrderFieldSpecified; + + private Sortable[] fieldsField; + + private VideoSortOrder[] sortOrdersField; + + public Sortable field { + get { return this.fieldField; } + set { this.fieldField = value; } + } + + public VideoSortOrder sortOrder { + get { return this.sortOrderField; } + set { + this.sortOrderField = value; + this.sortOrderSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sortOrderSpecified { + get { return this.sortOrderFieldSpecified; } + set { this.sortOrderFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("fields")] + public Sortable[] fields { + get { return this.fieldsField; } + set { this.fieldsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("sortOrders")] + public VideoSortOrder[] sortOrders { + get { return this.sortOrdersField; } + set { this.sortOrdersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoSortOrder { + ASCENDING, + DESCENDING + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class StatsSelector { + private DateRange dateRangeField; + + private SegmentationDimension[] segmentationDimensionsField; + + private Metric[] metricsField; + + private VideoEntityStatsSummaryType[] summaryTypesField; + + private VideoEntityStatsSummaryType segmentedSummaryTypeField; + + private bool segmentedSummaryTypeFieldSpecified; + + private StatsSelectorAllTimeRestrict allTimeRestrictField; + + private bool allTimeRestrictFieldSpecified; + + public DateRange dateRange { + get { return this.dateRangeField; } + set { this.dateRangeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("segmentationDimensions")] + public SegmentationDimension[] segmentationDimensions { + get { return this.segmentationDimensionsField; } + set { this.segmentationDimensionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("metrics")] + public Metric[] metrics { + get { return this.metricsField; } + set { this.metricsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("summaryTypes")] + public VideoEntityStatsSummaryType[] summaryTypes { + get { return this.summaryTypesField; } + set { this.summaryTypesField = value; } + } + + public VideoEntityStatsSummaryType segmentedSummaryType { + get { return this.segmentedSummaryTypeField; } + set { + this.segmentedSummaryTypeField = value; + this.segmentedSummaryTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool segmentedSummaryTypeSpecified { + get { return this.segmentedSummaryTypeFieldSpecified; } + set { this.segmentedSummaryTypeFieldSpecified = value; } + } + + public StatsSelectorAllTimeRestrict allTimeRestrict { + get { return this.allTimeRestrictField; } + set { + this.allTimeRestrictField = value; + this.allTimeRestrictSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allTimeRestrictSpecified { + get { return this.allTimeRestrictFieldSpecified; } + set { this.allTimeRestrictFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum Metric { + VIEWS, + THUMBNAIL_IMPRESSIONS, + VIDEO_IMPRESSIONS, + TOTAL_IMPRESSIONS, + COST, + AVERAGE_CPV, + VTR, + CONVERSIONS, + DAILY_UNIQUE_VIEWERS, + WEEKLY_UNIQUE_VIEWERS, + MONTHLY_UNIQUE_VIEWERS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StatsSelector.AllTimeRestrict", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum StatsSelectorAllTimeRestrict { + NONE, + SINCE_VIDEO_AD_START, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoAdSelector { + private long[] campaignIdsField; + + private long[] idsField; + + private VideoAdStatus[] statusesField; + + private VideoCampaignStatus[] campaignStatusesField; + + private StatsSelector statsSelectorField; + + private Paging pagingField; + + private Sorting sortingField; + + [System.Xml.Serialization.XmlElementAttribute("campaignIds")] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ids")] + public long[] ids { + get { return this.idsField; } + set { this.idsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("statuses")] + public VideoAdStatus[] statuses { + get { return this.statusesField; } + set { this.statusesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignStatuses")] + public VideoCampaignStatus[] campaignStatuses { + get { return this.campaignStatusesField; } + set { this.campaignStatusesField = value; } + } + + public StatsSelector statsSelector { + get { return this.statsSelectorField; } + set { this.statsSelectorField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + + public Sorting sorting { + get { return this.sortingField; } + set { this.sortingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoCampaignStatus { + ACTIVE, + DELETED, + PAUSED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoAdError : ApiError { + private VideoAdErrorReason reasonField; + + private bool reasonFieldSpecified; + + public VideoAdErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoAdError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoAdErrorReason { + UNKNOWN, + INVALID_FORMAT, + INVALID_INPUT, + URL_INVALID_TOP_LEVEL_DOMAIN, + URL_MALFORMED, + URL_NO_HOST, + URL_NO_SCHEME, + TOO_LONG, + LINE_TOO_WIDE, + INVALID_IMAGE_MEDIA_ID, + INVALID_COMPANION_BANNER_IMAGE_TYPE, + TOO_MANY_TARGETING_GROUP_ASSOCIATIONS, + TOO_MANY_VIDEO_ADS_PER_CUSTOMER, + TOO_MANY_VIDEO_ADS_PER_CAMPAIGN, + CANNOT_OPERATE_ON_DELETED_AD, + UNSUPPORTED_SCOPE_STATUS, + NO_SCOPE_STATUSES_SPECIFIED, + TARGETING_GROUP_FROM_DIFFERENT_CAMPAIGN, + APPROXIMATELY_TOO_LONG, + APPROXIMATELY_TOO_SHORT, + BAD_SNIPPET, + CUSTOMER_NOT_APPROVED_MOBILEADS, + CUSTOMER_NOT_ELIGIBLE, + INCORRECT_LENGTH, + INVALID_AD_ADDRESS_CAMPAIGN_TARGET, + INVALID_CHARACTER_FOR_URL, + INVALID_COUNTRY_CODE, + INVALID_MARKUP_LANGUAGE, + INVALID_MOBILE_CARRIER, + INVALID_MOBILE_CARRIER_TARGET, + TOO_SHORT, + URL_INVALID_SCHEME, + URL_HOST_NAME_TOO_LONG, + URL_NO_TOP_LEVEL_DOMAIN, + URL_PATH_NOT_ALLOWED, + URL_PORT_NOT_ALLOWED, + URL_QUERY_NOT_ALLOWED, + URL_SCHEME_BEFORE_DSA_TAG, + USER_DOES_NOT_HAVE_ACCESS_TO_TEMPLATE, + INVALID_FIELD_TEXT, + IMAGE_ERROR, + VIDEO_RETRIEVAL_ERROR, + AUDIO_ERROR, + DEPRECATED_FORMAT_ERROR + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class TimeSeriesError : ApiError { + private TimeSeriesErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TimeSeriesErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TimeSeriesError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum TimeSeriesErrorReason { + UNKNOWN, + INVALID_SEGMENTATION_DIMENSION + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class SortingError : ApiError { + private SortingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SortingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SortingError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum SortingErrorReason { + SORT_ORDER_MISMATCH, + INVALID_FIELD, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class SegmentationError : ApiError { + private SegmentationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SegmentationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SegmentationError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum SegmentationErrorReason { + INCOMPATIBLE_DIMENSIONS, + UNSUPPORTED_SEGMENTATION, + MAXIMUM_SEGMENTATION_DIMENSIONS_EXCEEDED, + DATE_RANGE_TOO_LONG, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class ReportError : ApiError { + private ReportErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReportErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum ReportErrorReason { + UNKNOWN, + CRITERIA_TYPE_NOT_SUPPORTED, + INVALID_TARGETING_GROUP_ID_COUNT, + NO_STATS_SELECTOR + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class PersistenceError : ApiError { + private PersistenceErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PersistenceErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PersistenceError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum PersistenceErrorReason { + LOAD_FAILED, + SAVE_FAILED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class EntityNotFoundError : ApiError { + private EntityNotFoundErrorReason reasonField; + + private bool reasonFieldSpecified; + + public EntityNotFoundErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "EntityNotFoundError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum EntityNotFoundErrorReason { + INVALID_ID + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class AdsApiError : ApiError { + private AdsApiErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdsApiErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdsApiError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum AdsApiErrorReason { + UNHANDLED_ADS_API_ERROR, + INTERNAL_ERROR, + UNEXPECTED_ERROR, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class AccessError : ApiError { + private AccessErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AccessErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AccessError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum AccessErrorReason { + ACTION_NOT_PERMITTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "VideoCampaignCriterionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class VideoCampaignCriterionService : AdWordsSoapClient, IVideoCampaignCriterionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public VideoCampaignCriterionService() { + this.Url = "https://adwords.google.com/api/adwords/video/v201309/VideoCampaignCriterionServic" + "e"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual VideoCampaignCriterionPage get(VideoCampaignCriterionSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((VideoCampaignCriterionPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual VideoCampaignCriterionReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +VideoCampaignCriterionOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((VideoCampaignCriterionReturnValue) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoCampaignCriterionReturnValue : ListReturnValue { + private VideoCampaignCriterion[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public VideoCampaignCriterion[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReportedVideoCampaignCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NegativeVideoCampaignCriterion))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoCampaignCriterion { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private string campaignNameField; + + private BaseCriterion criterionField; + + private string videoCampaignCriterionTypeField; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public string campaignName { + get { return this.campaignNameField; } + set { this.campaignNameField = value; } + } + + public BaseCriterion criterion { + get { return this.criterionField; } + set { this.criterionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("VideoCampaignCriterion.Type")] + public string VideoCampaignCriterionType { + get { return this.videoCampaignCriterionTypeField; } + set { this.videoCampaignCriterionTypeField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(YouTubePlacement))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WebSite))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Topic))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RunOfYoutube))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlatformVideoCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystemVersionVideoCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileDeviceVideoCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileApplicationVideoCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileAppCategoryVideoCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LocationVideoCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LanguageVideoCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseKeyword))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SearchKeyword))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentKeyword))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentCategoryLabel))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Channel))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CarrierVideoCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceUserList))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceInterest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceGender))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceAge))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdScheduleVideoCriterion))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public abstract partial class BaseCriterion { + private long idField; + + private bool idFieldSpecified; + + private string baseCriterionTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseCriterion.Type")] + public string BaseCriterionType { + get { return this.baseCriterionTypeField; } + set { this.baseCriterionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class YouTubePlacement : BaseCriterion { + private string urlField; + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class WebSite : BaseCriterion { + private string urlField; + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoCriterion : BaseCriterion { + private string videoIdField; + + private string videoNameField; + + public string videoId { + get { return this.videoIdField; } + set { this.videoIdField = value; } + } + + public string videoName { + get { return this.videoNameField; } + set { this.videoNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class Topic : BaseCriterion { + private long verticalIdField; + + private bool verticalIdFieldSpecified; + + private string[] verticalPathField; + + public long verticalId { + get { return this.verticalIdField; } + set { + this.verticalIdField = value; + this.verticalIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool verticalIdSpecified { + get { return this.verticalIdFieldSpecified; } + set { this.verticalIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("verticalPath")] + public string[] verticalPath { + get { return this.verticalPathField; } + set { this.verticalPathField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class RunOfYoutube : BaseCriterion { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class PlatformVideoCriterion : BaseCriterion { + private string platformNameField; + + public string platformName { + get { return this.platformNameField; } + set { this.platformNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class OperatingSystemVersionVideoCriterion : BaseCriterion { + private string nameField; + + private int osMajorVersionField; + + private bool osMajorVersionFieldSpecified; + + private int osMinorVersionField; + + private bool osMinorVersionFieldSpecified; + + private VideoOperatingSystemVersionOperatorType operatorTypeField; + + private bool operatorTypeFieldSpecified; + + private long operatingSystemIdField; + + private bool operatingSystemIdFieldSpecified; + + private bool obsoleteField; + + private bool obsoleteFieldSpecified; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public int osMajorVersion { + get { return this.osMajorVersionField; } + set { + this.osMajorVersionField = value; + this.osMajorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool osMajorVersionSpecified { + get { return this.osMajorVersionFieldSpecified; } + set { this.osMajorVersionFieldSpecified = value; } + } + + public int osMinorVersion { + get { return this.osMinorVersionField; } + set { + this.osMinorVersionField = value; + this.osMinorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool osMinorVersionSpecified { + get { return this.osMinorVersionFieldSpecified; } + set { this.osMinorVersionFieldSpecified = value; } + } + + public VideoOperatingSystemVersionOperatorType operatorType { + get { return this.operatorTypeField; } + set { + this.operatorTypeField = value; + this.operatorTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorTypeSpecified { + get { return this.operatorTypeFieldSpecified; } + set { this.operatorTypeFieldSpecified = value; } + } + + public long operatingSystemId { + get { return this.operatingSystemIdField; } + set { + this.operatingSystemIdField = value; + this.operatingSystemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatingSystemIdSpecified { + get { return this.operatingSystemIdFieldSpecified; } + set { this.operatingSystemIdFieldSpecified = value; } + } + + public bool obsolete { + get { return this.obsoleteField; } + set { + this.obsoleteField = value; + this.obsoleteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool obsoleteSpecified { + get { return this.obsoleteFieldSpecified; } + set { this.obsoleteFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoOperatingSystemVersion.OperatorType", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoOperatingSystemVersionOperatorType { + GREATER_THAN_EQUAL_TO, + EQUAL_TO, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class MobileDeviceVideoCriterion : BaseCriterion { + private string deviceNameField; + + private string manufacturerNameField; + + private VideoMobileDeviceDeviceType deviceTypeField; + + private bool deviceTypeFieldSpecified; + + private string operatingSystemNameField; + + public string deviceName { + get { return this.deviceNameField; } + set { this.deviceNameField = value; } + } + + public string manufacturerName { + get { return this.manufacturerNameField; } + set { this.manufacturerNameField = value; } + } + + public VideoMobileDeviceDeviceType deviceType { + get { return this.deviceTypeField; } + set { + this.deviceTypeField = value; + this.deviceTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deviceTypeSpecified { + get { return this.deviceTypeFieldSpecified; } + set { this.deviceTypeFieldSpecified = value; } + } + + public string operatingSystemName { + get { return this.operatingSystemNameField; } + set { this.operatingSystemNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoMobileDevice.DeviceType", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoMobileDeviceDeviceType { + DEVICE_TYPE_MOBILE, + DEVICE_TYPE_TABLET + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class MobileApplicationVideoCriterion : BaseCriterion { + private string appIdField; + + public string appId { + get { return this.appIdField; } + set { this.appIdField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class MobileAppCategoryVideoCriterion : BaseCriterion { + private int mobileAppCategoryIdField; + + private bool mobileAppCategoryIdFieldSpecified; + + public int mobileAppCategoryId { + get { return this.mobileAppCategoryIdField; } + set { + this.mobileAppCategoryIdField = value; + this.mobileAppCategoryIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mobileAppCategoryIdSpecified { + get { return this.mobileAppCategoryIdFieldSpecified; } + set { this.mobileAppCategoryIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class LocationVideoCriterion : BaseCriterion { + private string locationNameField; + + private string displayTypeField; + + private bool isObsoleteField; + + private bool isObsoleteFieldSpecified; + + private LocationVideoCriterion[] parentLocationsField; + + public string locationName { + get { return this.locationNameField; } + set { this.locationNameField = value; } + } + + public string displayType { + get { return this.displayTypeField; } + set { this.displayTypeField = value; } + } + + public bool isObsolete { + get { return this.isObsoleteField; } + set { + this.isObsoleteField = value; + this.isObsoleteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isObsoleteSpecified { + get { return this.isObsoleteFieldSpecified; } + set { this.isObsoleteFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("parentLocations")] + public LocationVideoCriterion[] parentLocations { + get { return this.parentLocationsField; } + set { this.parentLocationsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class LanguageVideoCriterion : BaseCriterion { + private string codeField; + + private string nameField; + + public string code { + get { return this.codeField; } + set { this.codeField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SearchKeyword))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentKeyword))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class BaseKeyword : BaseCriterion { + private string textField; + + private BaseKeywordMatchType matchTypeField; + + private bool matchTypeFieldSpecified; + + public string text { + get { return this.textField; } + set { this.textField = value; } + } + + public BaseKeywordMatchType matchType { + get { return this.matchTypeField; } + set { + this.matchTypeField = value; + this.matchTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool matchTypeSpecified { + get { return this.matchTypeFieldSpecified; } + set { this.matchTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BaseKeyword.MatchType", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum BaseKeywordMatchType { + EXACT, + PHRASE, + BROAD, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class SearchKeyword : BaseKeyword { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class ContentKeyword : BaseKeyword { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class ContentCategoryLabel : BaseCriterion { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class Channel : BaseCriterion { + private string userNameField; + + private string userIdField; + + private string publicNameField; + + public string userName { + get { return this.userNameField; } + set { this.userNameField = value; } + } + + public string userId { + get { return this.userIdField; } + set { this.userIdField = value; } + } + + public string publicName { + get { return this.publicNameField; } + set { this.publicNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class CarrierVideoCriterion : BaseCriterion { + private string nameField; + + private string countryCodeField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class AudienceUserList : BaseCriterion { + private long listIdField; + + private bool listIdFieldSpecified; + + private string nameField; + + public long listId { + get { return this.listIdField; } + set { + this.listIdField = value; + this.listIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool listIdSpecified { + get { return this.listIdFieldSpecified; } + set { this.listIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class AudienceInterest : BaseCriterion { + private long interestIdField; + + private bool interestIdFieldSpecified; + + private string[] interestPathField; + + public long interestId { + get { return this.interestIdField; } + set { + this.interestIdField = value; + this.interestIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool interestIdSpecified { + get { return this.interestIdFieldSpecified; } + set { this.interestIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("interestPath")] + public string[] interestPath { + get { return this.interestPathField; } + set { this.interestPathField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class AudienceGender : BaseCriterion { + private AudienceGenderGenderType genderTypeField; + + private bool genderTypeFieldSpecified; + + public AudienceGenderGenderType genderType { + get { return this.genderTypeField; } + set { + this.genderTypeField = value; + this.genderTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool genderTypeSpecified { + get { return this.genderTypeFieldSpecified; } + set { this.genderTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceGender.GenderType", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum AudienceGenderGenderType { + GENDER_MALE, + GENDER_FEMALE, + GENDER_UNDETERMINED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class AudienceAge : BaseCriterion { + private AudienceAgeAgeRange ageRangeField; + + private bool ageRangeFieldSpecified; + + public AudienceAgeAgeRange ageRange { + get { return this.ageRangeField; } + set { + this.ageRangeField = value; + this.ageRangeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ageRangeSpecified { + get { return this.ageRangeFieldSpecified; } + set { this.ageRangeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceAge.AgeRange", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum AudienceAgeAgeRange { + AGE_RANGE_18_24, + AGE_RANGE_25_34, + AGE_RANGE_35_44, + AGE_RANGE_45_54, + AGE_RANGE_55_64, + AGE_RANGE_65_UP, + AGE_RANGE_UNDETERMINED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class AdScheduleVideoCriterion : BaseCriterion { + private VideoDayOfWeek dayOfWeekField; + + private bool dayOfWeekFieldSpecified; + + private int startHourField; + + private bool startHourFieldSpecified; + + private VideoMinuteOfHour startMinuteField; + + private bool startMinuteFieldSpecified; + + private int endHourField; + + private bool endHourFieldSpecified; + + private VideoMinuteOfHour endMinuteField; + + private bool endMinuteFieldSpecified; + + public VideoDayOfWeek dayOfWeek { + get { return this.dayOfWeekField; } + set { + this.dayOfWeekField = value; + this.dayOfWeekSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dayOfWeekSpecified { + get { return this.dayOfWeekFieldSpecified; } + set { this.dayOfWeekFieldSpecified = value; } + } + + public int startHour { + get { return this.startHourField; } + set { + this.startHourField = value; + this.startHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startHourSpecified { + get { return this.startHourFieldSpecified; } + set { this.startHourFieldSpecified = value; } + } + + public VideoMinuteOfHour startMinute { + get { return this.startMinuteField; } + set { + this.startMinuteField = value; + this.startMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startMinuteSpecified { + get { return this.startMinuteFieldSpecified; } + set { this.startMinuteFieldSpecified = value; } + } + + public int endHour { + get { return this.endHourField; } + set { + this.endHourField = value; + this.endHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endHourSpecified { + get { return this.endHourFieldSpecified; } + set { this.endHourFieldSpecified = value; } + } + + public VideoMinuteOfHour endMinute { + get { return this.endMinuteField; } + set { + this.endMinuteField = value; + this.endMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endMinuteSpecified { + get { return this.endMinuteFieldSpecified; } + set { this.endMinuteFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoMinuteOfHour { + ZERO, + FIFTEEN, + THIRTY, + FORTY_FIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class ReportedVideoCampaignCriterion : VideoCampaignCriterion { + private VideoEntityStats statsField; + + private VideoEntityStats[] segmentedStatsField; + + private bool excludedField; + + private bool excludedFieldSpecified; + + public VideoEntityStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("segmentedStats")] + public VideoEntityStats[] segmentedStats { + get { return this.segmentedStatsField; } + set { this.segmentedStatsField = value; } + } + + public bool excluded { + get { return this.excludedField; } + set { + this.excludedField = value; + this.excludedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool excludedSpecified { + get { return this.excludedFieldSpecified; } + set { this.excludedFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class NegativeVideoCampaignCriterion : VideoCampaignCriterion { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoCampaignCriterionOperation : Operation { + private VideoCampaignCriterion operandField; + + public VideoCampaignCriterion operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoCampaignReportPage : Page { + private ReportedVideoCampaignCriterion[] entriesField; + + private VideoEntityStats[] summaryStatsField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public ReportedVideoCampaignCriterion[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("summaryStats")] + public VideoEntityStats[] summaryStats { + get { return this.summaryStatsField; } + set { this.summaryStatsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoCampaignCriterionPage : Page { + private VideoCampaignCriterion[] entriesField; + + private VideoEntityStats[] summaryStatsField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public VideoCampaignCriterion[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("summaryStats")] + public VideoEntityStats[] summaryStats { + get { return this.summaryStatsField; } + set { this.summaryStatsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoCampaignCriterionSortable { + CAMPAIGN_ID + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoCampaignCriterionSelector { + private long[] campaignIdsField; + + private VideoCampaignStatus[] campaignStatusesField; + + private BaseCriterionType[] criterionTypesField; + + private Sorting sortingField; + + private Paging pagingField; + + [System.Xml.Serialization.XmlElementAttribute("campaignIds")] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignStatuses")] + public VideoCampaignStatus[] campaignStatuses { + get { return this.campaignStatusesField; } + set { this.campaignStatusesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("criterionTypes")] + public BaseCriterionType[] criterionTypes { + get { return this.criterionTypesField; } + set { this.criterionTypesField = value; } + } + + public Sorting sorting { + get { return this.sortingField; } + set { this.sortingField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BaseCriterion.Type", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum BaseCriterionType { + AGE, + CARRIER, + CHANNEL, + CONTENT_KEYWORD, + CONTENT_LABEL, + GENDER, + INTEREST, + KEYWORD, + LANGUAGE, + LOCATION, + MOBILE_APPLICATION, + MOBILE_APP_CATEGORY, + MOBILE_DEVICE, + OPERATING_SYSTEM_VERSION, + PLATFORM, + RUN_OF_YOUTUBE, + SCHEDULE, + SEARCH_KEYWORD, + USER_LIST, + VERTICAL, + VIDEO, + WEB_SITE, + YOUTUBE_PLACEMENT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoCampaignCriterionError : ApiError { + private VideoCampaignCriterionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public VideoCampaignCriterionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoCampaignCriterionError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoCampaignCriterionErrorReason { + UNKNOWN, + INVALID_CRITERION_USE, + INVALID_CRITERION_TYPE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class TargetingGroupCriterionError : ApiError { + private TargetingGroupCriterionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TargetingGroupCriterionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TargetingGroupCriterionError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum TargetingGroupCriterionErrorReason { + UNKNOWN, + WEBSITE_NOT_ALLOWED_FOR_NETWORK, + NETWORK_NOT_SUPPORTED, + INVALID_KEYWORD_TEXT, + KEYWORD_TEXT_TOO_LONG, + KEYWORD_HAS_TOO_MANY_WORDS, + KEYWORD_HAS_INVALID_CHARS, + INVALID_WEBSITE_URL, + INVALID_FORMAT_FOR_WEBSITE_URL, + WEBSITE_URL_IS_TOO_LONG, + WEBSITE_URL_HAS_ILLEGAL_CHAR, + WEBSITE_URL_HAS_MULTIPLE_SITES_IN_LINE, + WEBSITE_DOMAIN_BLACKLISTED, + INVALID_VIDEO_ID, + INVALID_CHANNEL_ID, + INVALID_VERTICAL_PATH, + INVALID_USER_LIST_ID, + KEYWORD_UNSUPPORTED, + INVALID_TARGETING_GROUP_ID, + INVALID_CRITERION_ID, + IMMUTABLE_NEGATIVE, + WEBSITE_URL_HAS_SCHEMA, + USER_ID_OF_CHANNEL_MISSING, + TOO_MANY_CRITERIONS_PER_TARGETING_GROUP, + INVALID_STATUS, + MUTATING_REPORTED_TGC, + UNSUPPORTED_BID_OVERRIDE, + CANNOT_TARGET_AND_EXCLUDE, + CANNOT_REMOVE_CRITERION, + CANNOT_TARGET_CRITERION, + CANNOT_TARGET_OBSOLETE_CRITERION + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "VideoCampaignServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class VideoCampaignService : AdWordsSoapClient, IVideoCampaignService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public VideoCampaignService() { + this.Url = "https://adwords.google.com/api/adwords/video/v201309/VideoCampaignService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual VideoCampaignPage get(VideoCampaignSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((VideoCampaignPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual VideoCampaignReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +VideoCampaignOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((VideoCampaignReturnValue) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoCampaignReturnValue : ListReturnValue { + private VideoCampaign[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public VideoCampaign[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoCampaign { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private VideoCampaignStatus statusField; + + private bool statusFieldSpecified; + + private string startDateField; + + private string endDateField; + + private long budgetIdField; + + private bool budgetIdFieldSpecified; + + private VideoCampaignBiddingMode biddingModeField; + + private bool biddingModeFieldSpecified; + + private VideoCampaignTargetingMode targetingModeField; + + private bool targetingModeFieldSpecified; + + private VideoCampaignSpendingStatus spendingStatusField; + + private bool spendingStatusFieldSpecified; + + private CampaignSchedulingStatus schedulingStatusField; + + private bool schedulingStatusFieldSpecified; + + private VideoAdServingOptimizationStatus adServingOptimizationStatusField; + + private bool adServingOptimizationStatusFieldSpecified; + + private VideoFrequencyCap frequencyCapField; + + private VideoEntityStats statsField; + + private VideoEntityStats[] segmentedStatsField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public VideoCampaignStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public string endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + public long budgetId { + get { return this.budgetIdField; } + set { + this.budgetIdField = value; + this.budgetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool budgetIdSpecified { + get { return this.budgetIdFieldSpecified; } + set { this.budgetIdFieldSpecified = value; } + } + + public VideoCampaignBiddingMode biddingMode { + get { return this.biddingModeField; } + set { + this.biddingModeField = value; + this.biddingModeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool biddingModeSpecified { + get { return this.biddingModeFieldSpecified; } + set { this.biddingModeFieldSpecified = value; } + } + + public VideoCampaignTargetingMode targetingMode { + get { return this.targetingModeField; } + set { + this.targetingModeField = value; + this.targetingModeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetingModeSpecified { + get { return this.targetingModeFieldSpecified; } + set { this.targetingModeFieldSpecified = value; } + } + + public VideoCampaignSpendingStatus spendingStatus { + get { return this.spendingStatusField; } + set { + this.spendingStatusField = value; + this.spendingStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool spendingStatusSpecified { + get { return this.spendingStatusFieldSpecified; } + set { this.spendingStatusFieldSpecified = value; } + } + + public CampaignSchedulingStatus schedulingStatus { + get { return this.schedulingStatusField; } + set { + this.schedulingStatusField = value; + this.schedulingStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool schedulingStatusSpecified { + get { return this.schedulingStatusFieldSpecified; } + set { this.schedulingStatusFieldSpecified = value; } + } + + public VideoAdServingOptimizationStatus adServingOptimizationStatus { + get { return this.adServingOptimizationStatusField; } + set { + this.adServingOptimizationStatusField = value; + this.adServingOptimizationStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adServingOptimizationStatusSpecified { + get { return this.adServingOptimizationStatusFieldSpecified; } + set { this.adServingOptimizationStatusFieldSpecified = value; } + } + + public VideoFrequencyCap frequencyCap { + get { return this.frequencyCapField; } + set { this.frequencyCapField = value; } + } + + public VideoEntityStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("segmentedStats")] + public VideoEntityStats[] segmentedStats { + get { return this.segmentedStatsField; } + set { this.segmentedStatsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoCampaign.BiddingMode", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoCampaignBiddingMode { + AUTO, + MANUAL, + NONE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoCampaign.TargetingMode", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoCampaignTargetingMode { + AUTO, + MANUAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoCampaign.SpendingStatus", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoCampaignSpendingStatus { + UNAVAILABLE, + SUSPENDED, + CONSTRAINED, + NON_CONSTRAINED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum CampaignSchedulingStatus { + UNAVAILABLE, + CURRENT, + ENDED, + PENDING + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoAdServingOptimizationStatus { + OPTIMIZE, + CONVERSION_OPTIMIZE, + ROTATE, + ROTATE_FOREVER, + UNAVAILABLE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoFrequencyCap { + private long impressionsField; + + private bool impressionsFieldSpecified; + + private long viewsField; + + private bool viewsFieldSpecified; + + private VideoTimeUnit timeUnitField; + + private bool timeUnitFieldSpecified; + + private VideoLevel levelField; + + private bool levelFieldSpecified; + + public long impressions { + get { return this.impressionsField; } + set { + this.impressionsField = value; + this.impressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsSpecified { + get { return this.impressionsFieldSpecified; } + set { this.impressionsFieldSpecified = value; } + } + + public long views { + get { return this.viewsField; } + set { + this.viewsField = value; + this.viewsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool viewsSpecified { + get { return this.viewsFieldSpecified; } + set { this.viewsFieldSpecified = value; } + } + + public VideoTimeUnit timeUnit { + get { return this.timeUnitField; } + set { + this.timeUnitField = value; + this.timeUnitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool timeUnitSpecified { + get { return this.timeUnitFieldSpecified; } + set { this.timeUnitFieldSpecified = value; } + } + + public VideoLevel level { + get { return this.levelField; } + set { + this.levelField = value; + this.levelSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool levelSpecified { + get { return this.levelFieldSpecified; } + set { this.levelFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoTimeUnit { + MINUTE, + HOUR, + DAY, + WEEK, + MONTH, + LIFETIME + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoLevel { + VIDEO_CAMPAIGN, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoCampaignOperation : Operation { + private VideoCampaign operandField; + + public VideoCampaign operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoBudget { + private long budgetIdField; + + private bool budgetIdFieldSpecified; + + private string nameField; + + private Money amountField; + + private VideoBudgetBudgetDeliveryMethod deliveryMethodField; + + private bool deliveryMethodFieldSpecified; + + private bool isExplicitlySharedField; + + private bool isExplicitlySharedFieldSpecified; + + public long budgetId { + get { return this.budgetIdField; } + set { + this.budgetIdField = value; + this.budgetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool budgetIdSpecified { + get { return this.budgetIdFieldSpecified; } + set { this.budgetIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public Money amount { + get { return this.amountField; } + set { this.amountField = value; } + } + + public VideoBudgetBudgetDeliveryMethod deliveryMethod { + get { return this.deliveryMethodField; } + set { + this.deliveryMethodField = value; + this.deliveryMethodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryMethodSpecified { + get { return this.deliveryMethodFieldSpecified; } + set { this.deliveryMethodFieldSpecified = value; } + } + + public bool isExplicitlyShared { + get { return this.isExplicitlySharedField; } + set { + this.isExplicitlySharedField = value; + this.isExplicitlySharedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isExplicitlySharedSpecified { + get { return this.isExplicitlySharedFieldSpecified; } + set { this.isExplicitlySharedFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoBudget.BudgetDeliveryMethod", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoBudgetBudgetDeliveryMethod { + STANDARD, + ACCELERATED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class SummaryBudgets { + private VideoBudget totalVideoBudgetField; + + private Money nonVideoBudgetField; + + private Money combinedBudgetField; + + public VideoBudget totalVideoBudget { + get { return this.totalVideoBudgetField; } + set { this.totalVideoBudgetField = value; } + } + + public Money nonVideoBudget { + get { return this.nonVideoBudgetField; } + set { this.nonVideoBudgetField = value; } + } + + public Money combinedBudget { + get { return this.combinedBudgetField; } + set { this.combinedBudgetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoCampaignPage : Page { + private VideoCampaign[] entriesField; + + private VideoEntityStats[] summaryStatsField; + + private SummaryBudgets summaryBudgetsField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public VideoCampaign[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("summaryStats")] + public VideoEntityStats[] summaryStats { + get { return this.summaryStatsField; } + set { this.summaryStatsField = value; } + } + + public SummaryBudgets summaryBudgets { + get { return this.summaryBudgetsField; } + set { this.summaryBudgetsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoCampaignSortable { + BUDGET_AMOUNT, + CAMPAIGN_ID, + END_DATE, + NAME, + START_DATE, + STATUS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoCampaignSelector { + private long[] idsField; + + private VideoCampaignStatus[] campaignStatusesField; + + private StatsSelector statsSelectorField; + + private Paging pagingField; + + private Sorting sortingField; + + [System.Xml.Serialization.XmlElementAttribute("ids")] + public long[] ids { + get { return this.idsField; } + set { this.idsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignStatuses")] + public VideoCampaignStatus[] campaignStatuses { + get { return this.campaignStatusesField; } + set { this.campaignStatusesField = value; } + } + + public StatsSelector statsSelector { + get { return this.statsSelectorField; } + set { this.statsSelectorField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + + public Sorting sorting { + get { return this.sortingField; } + set { this.sortingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoCampaignError : ApiError { + private VideoCampaignErrorReason reasonField; + + private bool reasonFieldSpecified; + + public VideoCampaignErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoCampaignError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoCampaignErrorReason { + UNKNOWN, + AFTER_MAXIMUM_ALLOWABLE_DATE, + CANNOT_SET_DATE_TO_PAST, + DUPLICATE_CAMPAIGN_NAME, + INVALID_CAMPAIGN_NAME, + START_DATE_AFTER_END_DATE, + CANNOT_MODIFY_START_DATE_IF_ALREADY_STARTED, + INVALID_OPERATION_IF_SERVING_STATUS_HAS_ENDED, + CAMPAIGN_LIMIT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoBudgetError : ApiError { + private VideoBudgetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public VideoBudgetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoBudgetError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoBudgetErrorReason { + MONEY_AMOUNT_LESS_THAN_CURRENCY_MINIMUM_CPC, + MONEY_AMOUNT_LESS_THAN_MAXIMUM_AD_GROUP_CPM, + MONEY_AMOUNT_LESS_THAN_MAXIMUM_SITE_CPM, + MONEY_AMOUNT_LESS_THAN_MINIMUM_AD_GROUP_CPC, + MONEY_AMOUNT_LESS_THAN_MINIMUM_CRITERIA_CPC, + MONEY_AMOUNT_TOO_LARGE, + NON_MULTIPLE_OF_MINIMUM_CURRENCY_UNIT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoBiddingError : ApiError { + private VideoBiddingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public VideoBiddingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoBiddingError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoBiddingErrorReason { + BID_AMOUNT_REQUIRED, + BID_TOO_SMALL, + BID_TOO_BIG, + BID_TOO_MANY_FRACTIONAL_DIGITS, + BID_TOO_HIGH_FOR_DAILY_BUDGET, + NON_POSITIVE_BID, + BID_FOR_DEPRECATED_FORMAT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdGroupCriterionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdGroupCriterionService : AdWordsSoapClient, IAdGroupCriterionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdGroupCriterionService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/AdGroupCriterionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupCriterionPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((AdGroupCriterionPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupCriterionReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +AdGroupCriterionOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((AdGroupCriterionReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupCriterionPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((AdGroupCriterionPage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupCriterionReturnValue : ListReturnValue { + private AdGroupCriterion[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdGroupCriterion[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupCriterionPage : Page { + private AdGroupCriterion[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public AdGroupCriterion[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "VideoServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class VideoService : AdWordsSoapClient, IVideoService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public VideoService() { + this.Url = "https://adwords.google.com/api/adwords/video/v201309/VideoService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual VideoPage get(VideoSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((VideoPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual VideoReturnValue mutateCallToAction([System.Xml.Serialization.XmlElementAttribute("operations")] +VideoCallToActionOperation[] operations) { + object[] results = this.Invoke("mutateCallToAction", new object[] { operations }); + return ((VideoReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual VideoSearchPage search(VideoSearchSelector selector) { + object[] results = this.Invoke("search", new object[] { selector }); + return ((VideoSearchPage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoSearchSelector { + private VideoSearchSelectorSearchType searchTypeField; + + private bool searchTypeFieldSpecified; + + private string[] videoIdsField; + + private string queryField; + + private string[] channelUserNamesField; + + private string[] channelUserIdsField; + + private Paging pagingField; + + private Sorting sortingField; + + public VideoSearchSelectorSearchType searchType { + get { return this.searchTypeField; } + set { + this.searchTypeField = value; + this.searchTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool searchTypeSpecified { + get { return this.searchTypeFieldSpecified; } + set { this.searchTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("videoIds")] + public string[] videoIds { + get { return this.videoIdsField; } + set { this.videoIdsField = value; } + } + + public string query { + get { return this.queryField; } + set { this.queryField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("channelUserNames")] + public string[] channelUserNames { + get { return this.channelUserNamesField; } + set { this.channelUserNamesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("channelUserIds")] + public string[] channelUserIds { + get { return this.channelUserIdsField; } + set { this.channelUserIdsField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + + public Sorting sorting { + get { return this.sortingField; } + set { this.sortingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoSearchSelector.SearchType", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoSearchSelectorSearchType { + VIDEO, + CHANNEL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoSearchSortable { + RELEVANCE, + DATE_UPLOADED, + VIEW_COUNT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoSortable { + TITLE, + DATE_UPLOADED, + DURATION, + CHANNEL, + VIEW_COUNT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoStatsSortable { + TOTAL_VIEWS, + CTA_IMPRESSIONS, + CTA_CLICKS, + CTA_CTR, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoReturnValue : ListReturnValue { + private YouTubeVideo[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public YouTubeVideo[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class YouTubeVideo { + private string idField; + + private string titleField; + + private string descriptionField; + + private string dateUploadedField; + + private long durationSecField; + + private bool durationSecFieldSpecified; + + private string userPublicNameField; + + private string userIdField; + + private long viewCountField; + + private bool viewCountFieldSpecified; + + private VideoCampaignInfo[] campaignInfosField; + + private CallToAction callToActionField; + + private VideoEntityStats statsField; + + private VideoEntityStats[] segmentedStatsField; + + private YouTubeVideoAccessLevel accessLevelField; + + private bool accessLevelFieldSpecified; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string title { + get { return this.titleField; } + set { this.titleField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public string dateUploaded { + get { return this.dateUploadedField; } + set { this.dateUploadedField = value; } + } + + public long durationSec { + get { return this.durationSecField; } + set { + this.durationSecField = value; + this.durationSecSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSecSpecified { + get { return this.durationSecFieldSpecified; } + set { this.durationSecFieldSpecified = value; } + } + + public string userPublicName { + get { return this.userPublicNameField; } + set { this.userPublicNameField = value; } + } + + public string userId { + get { return this.userIdField; } + set { this.userIdField = value; } + } + + public long viewCount { + get { return this.viewCountField; } + set { + this.viewCountField = value; + this.viewCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool viewCountSpecified { + get { return this.viewCountFieldSpecified; } + set { this.viewCountFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignInfos")] + public VideoCampaignInfo[] campaignInfos { + get { return this.campaignInfosField; } + set { this.campaignInfosField = value; } + } + + public CallToAction callToAction { + get { return this.callToActionField; } + set { this.callToActionField = value; } + } + + public VideoEntityStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("segmentedStats")] + public VideoEntityStats[] segmentedStats { + get { return this.segmentedStatsField; } + set { this.segmentedStatsField = value; } + } + + public YouTubeVideoAccessLevel accessLevel { + get { return this.accessLevelField; } + set { + this.accessLevelField = value; + this.accessLevelSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool accessLevelSpecified { + get { return this.accessLevelFieldSpecified; } + set { this.accessLevelFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoCampaignInfo { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private string campaignNameField; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public string campaignName { + get { return this.campaignNameField; } + set { this.campaignNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class CallToAction { + private CallToActionCreative creativeField; + + private bool isEnabledOnMobileField; + + private bool isEnabledOnMobileFieldSpecified; + + private CallToActionStatus statusField; + + private bool statusFieldSpecified; + + private CallToActionPolicyViolation[] policyViolationsField; + + public CallToActionCreative creative { + get { return this.creativeField; } + set { this.creativeField = value; } + } + + public bool isEnabledOnMobile { + get { return this.isEnabledOnMobileField; } + set { + this.isEnabledOnMobileField = value; + this.isEnabledOnMobileSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isEnabledOnMobileSpecified { + get { return this.isEnabledOnMobileFieldSpecified; } + set { this.isEnabledOnMobileFieldSpecified = value; } + } + + public CallToActionStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("policyViolations")] + public CallToActionPolicyViolation[] policyViolations { + get { return this.policyViolationsField; } + set { this.policyViolationsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CallToAction.Creative", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class CallToActionCreative { + private CallToActionCreativeType typeField; + + private bool typeFieldSpecified; + + private string headlineField; + + private string descriptionLine1Field; + + private string descriptionLine2Field; + + private string displayUrlField; + + private string destinationUrlField; + + private CallToActionImage imageField; + + public CallToActionCreativeType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public string headline { + get { return this.headlineField; } + set { this.headlineField = value; } + } + + public string descriptionLine1 { + get { return this.descriptionLine1Field; } + set { this.descriptionLine1Field = value; } + } + + public string descriptionLine2 { + get { return this.descriptionLine2Field; } + set { this.descriptionLine2Field = value; } + } + + public string displayUrl { + get { return this.displayUrlField; } + set { this.displayUrlField = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + public CallToActionImage image { + get { return this.imageField; } + set { this.imageField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CallToAction.Creative.Type", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum CallToActionCreativeType { + TEXT_ONLY, + TEXT_AND_IMAGE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class CallToActionImage { + private byte[] dataField; + + private string imageUrlField; + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] data { + get { return this.dataField; } + set { this.dataField = value; } + } + + public string imageUrl { + get { return this.imageUrlField; } + set { this.imageUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CallToAction.Status", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum CallToActionStatus { + ACTIVE, + INACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CallToAction.PolicyViolation", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class CallToActionPolicyViolation { + private string textField; + + public string text { + get { return this.textField; } + set { this.textField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "YouTubeVideo.AccessLevel", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum YouTubeVideoAccessLevel { + FULL_LINKED, + LIMITED_NOT_LINKED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoCallToAction { + private string idField; + + private CallToAction callToActionField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public CallToAction callToAction { + get { return this.callToActionField; } + set { this.callToActionField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoOperation : Operation { + private YouTubeVideo operandField; + + public YouTubeVideo operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoCallToActionOperation : Operation { + private VideoCallToAction operandField; + + public VideoCallToAction operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoSearchPage : Page { + private string[] recommendedChannelsField; + + private YouTubeVideo[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("recommendedChannels")] + public string[] recommendedChannels { + get { return this.recommendedChannelsField; } + set { this.recommendedChannelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public YouTubeVideo[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoPage : Page { + private YouTubeVideo[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public YouTubeVideo[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoSelector { + private string[] videoIdsField; + + private long[] campaignIdsField; + + private VideoCampaignStatus[] campaignStatusesField; + + private bool includeCallToActionsField; + + private bool includeCallToActionsFieldSpecified; + + private StatsSelector statsSelectorField; + + private Paging pagingField; + + private Sorting sortingField; + + [System.Xml.Serialization.XmlElementAttribute("videoIds")] + public string[] videoIds { + get { return this.videoIdsField; } + set { this.videoIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignIds")] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignStatuses")] + public VideoCampaignStatus[] campaignStatuses { + get { return this.campaignStatusesField; } + set { this.campaignStatusesField = value; } + } + + public bool includeCallToActions { + get { return this.includeCallToActionsField; } + set { + this.includeCallToActionsField = value; + this.includeCallToActionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeCallToActionsSpecified { + get { return this.includeCallToActionsFieldSpecified; } + set { this.includeCallToActionsFieldSpecified = value; } + } + + public StatsSelector statsSelector { + get { return this.statsSelectorField; } + set { this.statsSelectorField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + + public Sorting sorting { + get { return this.sortingField; } + set { this.sortingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoServiceError : ApiError { + private VideoServiceErrorReason reasonField; + + private bool reasonFieldSpecified; + + public VideoServiceErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoServiceError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoServiceErrorReason { + UNKNOWN, + INVALID_VIDEO_ID, + VIDEO_NOT_FOUND, + INVALID_CHANNEL, + VIDEO_LOOKUP_SERVICE_UNAVAILABLE, + VIDEO_SEARCH_SERVICE_UNAVAILABLE, + CHANNEL_SEARCH_SERVICE_UNAVAILABLE, + YOUTUBE_ANALYTICS_SERVICE_UNAVAILABLE, + VIDEO_NOT_OWNED_BY_LINKED_ACCOUNT, + VIDEO_NOT_ENABLED_FOR_CALL_TO_ACTION, + CALL_TO_ACTION_NOT_FOUND, + INVALID_CALL_TO_ACTION, + UNKNOWN_CALL_TO_ACTION_ERROR, + CALL_TO_ACTION_TOO_LONG, + CALL_TO_ACTION_INVALID_FORMAT, + CALL_TO_ACTION_INVALID_CHARS, + CALL_TO_ACTION_INVALID_INPUT, + INVALID_FORMAT, + INVALID_INPUT, + INVALID_IMAGE_FILESIZE, + UNSUPPORTED_IMAGE_FORMAT, + DUPLICATE_VIDEO_ID, + TOO_LONG + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "VideoTargetingGroupCriterionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class VideoTargetingGroupCriterionService : AdWordsSoapClient, IVideoTargetingGroupCriterionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public VideoTargetingGroupCriterionService() { + this.Url = "https://adwords.google.com/api/adwords/video/v201309/VideoTargetingGroupCriterion" + "Service"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TargetingGroupCriterionPage get(TargetingGroupCriterionSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((TargetingGroupCriterionPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TargetingGroupCriterionReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +TargetingGroupCriterionOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((TargetingGroupCriterionReturnValue) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class TargetingGroupCriterionReturnValue : ListReturnValue { + private TargetingGroupCriterion[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public TargetingGroupCriterion[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReportedTargetingGroupCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NegativeTargetingGroupCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddableTargetingGroupCriterion))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class TargetingGroupCriterion { + private long targetingGroupIdField; + + private bool targetingGroupIdFieldSpecified; + + private string targetingGroupNameField; + + private BaseCriterion criterionField; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private string targetingGroupCriterionTypeField; + + public long targetingGroupId { + get { return this.targetingGroupIdField; } + set { + this.targetingGroupIdField = value; + this.targetingGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetingGroupIdSpecified { + get { return this.targetingGroupIdFieldSpecified; } + set { this.targetingGroupIdFieldSpecified = value; } + } + + public string targetingGroupName { + get { return this.targetingGroupNameField; } + set { this.targetingGroupNameField = value; } + } + + public BaseCriterion criterion { + get { return this.criterionField; } + set { this.criterionField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("TargetingGroupCriterion.Type")] + public string TargetingGroupCriterionType { + get { return this.targetingGroupCriterionTypeField; } + set { this.targetingGroupCriterionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class ReportedTargetingGroupCriterion : TargetingGroupCriterion { + private VideoEntityStats statsField; + + private VideoEntityStats[] segmentedStatsField; + + private bool excludedField; + + private bool excludedFieldSpecified; + + private bool partiallyExcludedField; + + private bool partiallyExcludedFieldSpecified; + + public VideoEntityStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("segmentedStats")] + public VideoEntityStats[] segmentedStats { + get { return this.segmentedStatsField; } + set { this.segmentedStatsField = value; } + } + + public bool excluded { + get { return this.excludedField; } + set { + this.excludedField = value; + this.excludedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool excludedSpecified { + get { return this.excludedFieldSpecified; } + set { this.excludedFieldSpecified = value; } + } + + public bool partiallyExcluded { + get { return this.partiallyExcludedField; } + set { + this.partiallyExcludedField = value; + this.partiallyExcludedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool partiallyExcludedSpecified { + get { return this.partiallyExcludedFieldSpecified; } + set { this.partiallyExcludedFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class NegativeTargetingGroupCriterion : TargetingGroupCriterion { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class BiddableTargetingGroupCriterion : TargetingGroupCriterion { + private VideoUserStatus userStatusField; + + private bool userStatusFieldSpecified; + + private VideoEntityStats statsField; + + private VideoEntityStats[] segmentedStatsField; + + public VideoUserStatus userStatus { + get { return this.userStatusField; } + set { + this.userStatusField = value; + this.userStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userStatusSpecified { + get { return this.userStatusFieldSpecified; } + set { this.userStatusFieldSpecified = value; } + } + + public VideoEntityStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("segmentedStats")] + public VideoEntityStats[] segmentedStats { + get { return this.segmentedStatsField; } + set { this.segmentedStatsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoUserStatus { + ACTIVE, + DELETED, + PAUSED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class TargetingGroupCriterionOperation : Operation { + private TargetingGroupCriterion operandField; + + private ExemptionRequest[] exemptionRequestsField; + + public TargetingGroupCriterion operand { + get { return this.operandField; } + set { this.operandField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("exemptionRequests")] + public ExemptionRequest[] exemptionRequests { + get { return this.exemptionRequestsField; } + set { this.exemptionRequestsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class TargetingGroupReportPage : Page { + private ReportedTargetingGroupCriterion[] entriesField; + + private VideoEntityStats[] summaryStatsField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public ReportedTargetingGroupCriterion[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("summaryStats")] + public VideoEntityStats[] summaryStats { + get { return this.summaryStatsField; } + set { this.summaryStatsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class TargetingGroupCriterionPage : Page { + private TargetingGroupCriterion[] entriesField; + + private VideoEntityStats[] summaryStatsField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public TargetingGroupCriterion[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("summaryStats")] + public VideoEntityStats[] summaryStats { + get { return this.summaryStatsField; } + set { this.summaryStatsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum TargetingGroupCriterionSortable { + UNKNOWN, + CRITERION_ID, + TARGETING_GROUP_ID, + STATUS, + NAME, + TYPE, + TARGETING_GROUP_NAME + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class TargetingGroupCriterionSelector { + private CriteriaDimension criteriaDimensionField; + + private bool criteriaDimensionFieldSpecified; + + private BaseCriterionType[] criterionTypesField; + + private VideoUserStatus[] userStatusesField; + + private VideoCampaignStatus[] campaignStatusesField; + + private StatsSelector statsSelectorField; + + private Paging pagingField; + + private Sorting sortingField; + + private long[] campaignIdsField; + + private long[] targetingGroupIdsField; + + private long[] criterionIdsField; + + private TargetingGroupCriterionSelectorCriterionUse criterionUseField; + + private bool criterionUseFieldSpecified; + + public CriteriaDimension criteriaDimension { + get { return this.criteriaDimensionField; } + set { + this.criteriaDimensionField = value; + this.criteriaDimensionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criteriaDimensionSpecified { + get { return this.criteriaDimensionFieldSpecified; } + set { this.criteriaDimensionFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("criterionTypes")] + public BaseCriterionType[] criterionTypes { + get { return this.criterionTypesField; } + set { this.criterionTypesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("userStatuses")] + public VideoUserStatus[] userStatuses { + get { return this.userStatusesField; } + set { this.userStatusesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignStatuses")] + public VideoCampaignStatus[] campaignStatuses { + get { return this.campaignStatusesField; } + set { this.campaignStatusesField = value; } + } + + public StatsSelector statsSelector { + get { return this.statsSelectorField; } + set { this.statsSelectorField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + + public Sorting sorting { + get { return this.sortingField; } + set { this.sortingField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignIds")] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetingGroupIds")] + public long[] targetingGroupIds { + get { return this.targetingGroupIdsField; } + set { this.targetingGroupIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("criterionIds")] + public long[] criterionIds { + get { return this.criterionIdsField; } + set { this.criterionIdsField = value; } + } + + public TargetingGroupCriterionSelectorCriterionUse criterionUse { + get { return this.criterionUseField; } + set { + this.criterionUseField = value; + this.criterionUseSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionUseSpecified { + get { return this.criterionUseFieldSpecified; } + set { this.criterionUseFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum CriteriaDimension { + AGE, + GENDER, + KEYWORD, + PLACEMENT, + TOPIC, + USER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TargetingGroupCriterionSelector.CriterionUse", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum TargetingGroupCriterionSelectorCriterionUse { + BIDDABLE, + NEGATIVE, + ALL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "VideoTargetingGroupServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class VideoTargetingGroupService : AdWordsSoapClient, IVideoTargetingGroupService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public VideoTargetingGroupService() { + this.Url = "https://adwords.google.com/api/adwords/video/v201309/VideoTargetingGroupService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TargetingGroupPage get(TargetingGroupSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((TargetingGroupPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TargetingGroupReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +TargetingGroupOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((TargetingGroupReturnValue) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class TargetingGroupReturnValue : ListReturnValue { + private TargetingGroup[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public TargetingGroup[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class TargetingGroup { + private long idField; + + private bool idFieldSpecified; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private string nameField; + + private TargetingGroupStatus statusField; + + private bool statusFieldSpecified; + + private VideoAdDisplayFormat_VideoBidMapEntry[] bidsByFormatField; + + private TargetingScope_VideoBidMapEntry[] scopedBidsField; + + private VideoEntityStats statsField; + + private ServingInfo issuesField; + + private VideoEntityStats[] segmentedStatsField; + + private string campaignNameField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public TargetingGroupStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("bidsByFormat", IsNullable = false)] + public VideoAdDisplayFormat_VideoBidMapEntry[] bidsByFormat { + get { return this.bidsByFormatField; } + set { this.bidsByFormatField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("bidsByScope", IsNullable = false)] + public TargetingScope_VideoBidMapEntry[] scopedBids { + get { return this.scopedBidsField; } + set { this.scopedBidsField = value; } + } + + public VideoEntityStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public ServingInfo issues { + get { return this.issuesField; } + set { this.issuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("segmentedStats")] + public VideoEntityStats[] segmentedStats { + get { return this.segmentedStatsField; } + set { this.segmentedStatsField = value; } + } + + public string campaignName { + get { return this.campaignNameField; } + set { this.campaignNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum TargetingGroupStatus { + ACTIVE, + DELETED, + PAUSED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoAdDisplayFormat_VideoBidMapEntry { + private VideoAdDisplayFormat keyField; + + private bool keyFieldSpecified; + + private VideoBid valueField; + + public VideoAdDisplayFormat key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public VideoBid value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class VideoBid { + private Money amountField; + + private VideoBidSource sourceField; + + private bool sourceFieldSpecified; + + public Money amount { + get { return this.amountField; } + set { this.amountField = value; } + } + + public VideoBidSource source { + get { return this.sourceField; } + set { + this.sourceField = value; + this.sourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sourceSpecified { + get { return this.sourceFieldSpecified; } + set { this.sourceFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoBid.Source", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum VideoBidSource { + TARGETING_GROUP, + CRITERION + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class TargetingScope_VideoBidMapEntry { + private TargetingScope keyField; + + private bool keyFieldSpecified; + + private VideoBid valueField; + + public TargetingScope key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public VideoBid value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class TargetingGroupOperation : Operation { + private TargetingGroup operandField; + + public TargetingGroup operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class TargetingGroupPage : Page { + private TargetingGroup[] entriesField; + + private VideoEntityStats[] summaryStatsField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public TargetingGroup[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("summaryStats")] + public VideoEntityStats[] summaryStats { + get { return this.summaryStatsField; } + set { this.summaryStatsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum TargetingGroupSortable { + UNKNOWN, + TARGETING_GROUP_NAME, + STATUS, + BID, + TARGETING_GROUP_ID + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class TargetingGroupSelector { + private long[] idsField; + + private long[] campaignIdsField; + + private TargetingGroupStatus[] statusesField; + + private VideoCampaignStatus[] campaignStatusesField; + + private StatsSelector statsSelectorField; + + private Paging pagingField; + + private Sorting sortingField; + + [System.Xml.Serialization.XmlElementAttribute("ids")] + public long[] ids { + get { return this.idsField; } + set { this.idsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignIds")] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("statuses")] + public TargetingGroupStatus[] statuses { + get { return this.statusesField; } + set { this.statusesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignStatuses")] + public VideoCampaignStatus[] campaignStatuses { + get { return this.campaignStatusesField; } + set { this.campaignStatusesField = value; } + } + + public StatsSelector statsSelector { + get { return this.statsSelectorField; } + set { this.statsSelectorField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + + public Sorting sorting { + get { return this.sortingField; } + set { this.sortingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public partial class TargetingGroupError : ApiError { + private TargetingGroupErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TargetingGroupErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TargetingGroupError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201309")] + public enum TargetingGroupErrorReason { + UNKNOWN, + DUPLICATE_TARGETING_GROUP_ID, + DUPLICATE_TARGETING_GROUP_NAME, + DETECTED_DUPLICATE_TARGETING_GROUP_NAME, + IMMUTABLE_FIELD, + INVALID_TARGETING_GROUP_ID, + INVALID_TARGETING_GROUP_NAME, + NOT_PERSISTENT, + TARGETING_GROUP_NOT_FOUND, + TOO_MANY_TARGETING_GROUPS + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ExpressBusinessServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ExpressBusinessService : AdWordsSoapClient, IExpressBusinessService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ExpressBusinessService() { + this.Url = "https://adwords.google.com/api/adwords/express/v201309/ExpressBusinessService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/express/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/express/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExpressBusinessPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((ExpressBusinessPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/express/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/express/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExpressBusiness[] mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +ExpressBusinessOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((ExpressBusiness[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + public partial class ExpressBusinessOperation : Operation { + private ExpressBusiness operandField; + + public ExpressBusiness operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + public partial class ExpressBusiness { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private ExpressBusinessStatus statusField; + + private bool statusFieldSpecified; + + private Address addressField; + + private GeoPoint geoPointField; + + private PhoneNumber phoneNumberField; + + private string websiteField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ExpressBusinessStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public Address address { + get { return this.addressField; } + set { this.addressField = value; } + } + + public GeoPoint geoPoint { + get { return this.geoPointField; } + set { this.geoPointField = value; } + } + + public PhoneNumber phoneNumber { + get { return this.phoneNumberField; } + set { this.phoneNumberField = value; } + } + + public string website { + get { return this.websiteField; } + set { this.websiteField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ExpressBusiness.Status", Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + public enum ExpressBusinessStatus { + ACTIVE, + DELETED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + public partial class PhoneNumber { + private ExpressRegionCode regionCodeField; + + private bool regionCodeFieldSpecified; + + private string numberField; + + public ExpressRegionCode regionCode { + get { return this.regionCodeField; } + set { + this.regionCodeField = value; + this.regionCodeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool regionCodeSpecified { + get { return this.regionCodeFieldSpecified; } + set { this.regionCodeFieldSpecified = value; } + } + + public string number { + get { return this.numberField; } + set { this.numberField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + public enum ExpressRegionCode { + AC, + AD, + AE, + AF, + AG, + AI, + AL, + AM, + AN, + AO, + AQ, + AR, + AS, + AT, + AU, + AW, + AX, + AZ, + BA, + BB, + BD, + BE, + BF, + BG, + BH, + BI, + BJ, + BL, + BM, + BN, + BO, + BQ, + BR, + BS, + BT, + BU, + BV, + BW, + BY, + BZ, + CA, + CC, + CD, + CF, + CG, + CH, + CI, + CK, + CL, + CM, + CN, + CO, + CP, + CR, + CS, + CU, + CV, + CW, + CX, + CY, + CZ, + DD, + DE, + DG, + DJ, + DK, + DM, + DO, + DZ, + EA, + EC, + EE, + EG, + EH, + ER, + ES, + ET, + EU, + FI, + FJ, + FK, + FM, + FO, + FR, + FX, + GA, + GB, + GD, + GE, + GF, + GG, + GH, + GI, + GL, + GM, + GN, + GP, + GQ, + GR, + GS, + GT, + GU, + GW, + GY, + HK, + HM, + HN, + HR, + HT, + HU, + IC, + ID, + IE, + IL, + IM, + IN, + IO, + IQ, + IR, + IS, + IT, + JE, + JM, + JO, + JP, + KE, + KG, + KH, + KI, + KM, + KN, + KP, + KR, + KW, + KY, + KZ, + LA, + LB, + LC, + LI, + LK, + LR, + LS, + LT, + LU, + LV, + LY, + MA, + MC, + MD, + ME, + MF, + MG, + MH, + MK, + ML, + MM, + MN, + MO, + MP, + MQ, + MR, + MS, + MT, + MU, + MV, + MW, + MX, + MY, + MZ, + NA, + NC, + NE, + NF, + NG, + NI, + NL, + NO, + NP, + NR, + NT, + NU, + NZ, + OM, + PA, + PE, + PF, + PG, + PH, + PK, + PL, + PM, + PN, + PR, + PS, + PT, + PW, + PY, + QA, + QO, + QU, + RE, + RO, + RS, + RU, + RW, + SA, + SB, + SC, + SD, + SE, + SG, + SH, + SI, + SJ, + SK, + SL, + SM, + SN, + SO, + SR, + SS, + ST, + SU, + SV, + SX, + SY, + SZ, + TA, + TC, + TD, + TF, + TG, + TH, + TJ, + TK, + TL, + TM, + TN, + TO, + TP, + TR, + TT, + TV, + TW, + TZ, + UA, + UG, + UM, + US, + UY, + UZ, + VA, + VC, + VE, + VG, + VI, + VN, + VU, + WF, + WS, + XA, + XB, + XC, + XK, + YD, + YE, + YT, + YU, + ZA, + ZM, + ZR, + ZW, + ZZ, + UN001, + UN002, + UN003, + UN005, + UN009, + UN011, + UN013, + UN014, + UN015, + UN017, + UN018, + UN019, + UN021, + UN029, + UN030, + UN034, + UN035, + UN039, + UN053, + UN054, + UN057, + UN061, + UN142, + UN143, + UN145, + UN150, + UN151, + UN154, + UN155, + UN419 + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExpressBusinessPage))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PromotionPage))] + public abstract partial class ExpressNoStatsPage : Page { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + public partial class ExpressBusinessPage : ExpressNoStatsPage { + private ExpressBusiness[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public ExpressBusiness[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + public partial class ExpressBusinessError : ApiError { + private ExpressBusinessErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ExpressBusinessErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ExpressBusinessError.Reason", Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + public enum ExpressBusinessErrorReason { + INVALID_WEBSITE, + INVALID_ADDRESS, + INVALID_PHONE_NUMBER, + PREMIUM_RATE_PHONE_NUMBER_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "PromotionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SoapHeader))] + public partial class PromotionService : AdWordsSoapClient, IPromotionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public PromotionService() { + this.Url = "https://adwords.google.com/api/adwords/express/v201309/PromotionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/express/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/express/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual PromotionPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((PromotionPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/express/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/express/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Promotion[] mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +PromotionOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((Promotion[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + public partial class PromotionOperation : Operation { + private Promotion operandField; + + public Promotion operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + public partial class Promotion { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private PromotionStatus statusField; + + private bool statusFieldSpecified; + + private Creative[] creativesField; + + private string destinationUrlField; + + private PhoneNumber phoneNumberField; + + private bool streetAddressVisibleField; + + private bool streetAddressVisibleFieldSpecified; + + private bool callTrackingEnabledField; + + private bool callTrackingEnabledFieldSpecified; + + private Money budgetField; + + private Criterion[] criteriaField; + + private long[] campaignIdsField; + + private Money remainingBudgetField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public PromotionStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creatives")] + public Creative[] creatives { + get { return this.creativesField; } + set { this.creativesField = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + public PhoneNumber phoneNumber { + get { return this.phoneNumberField; } + set { this.phoneNumberField = value; } + } + + public bool streetAddressVisible { + get { return this.streetAddressVisibleField; } + set { + this.streetAddressVisibleField = value; + this.streetAddressVisibleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool streetAddressVisibleSpecified { + get { return this.streetAddressVisibleFieldSpecified; } + set { this.streetAddressVisibleFieldSpecified = value; } + } + + public bool callTrackingEnabled { + get { return this.callTrackingEnabledField; } + set { + this.callTrackingEnabledField = value; + this.callTrackingEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool callTrackingEnabledSpecified { + get { return this.callTrackingEnabledFieldSpecified; } + set { this.callTrackingEnabledFieldSpecified = value; } + } + + public Money budget { + get { return this.budgetField; } + set { this.budgetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("criteria")] + public Criterion[] criteria { + get { return this.criteriaField; } + set { this.criteriaField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignIds")] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + public Money remainingBudget { + get { return this.remainingBudgetField; } + set { this.remainingBudgetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Promotion.Status", Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + public enum PromotionStatus { + DRAFT, + ACTIVE, + PAUSED, + DELETED, + UPGRADED_TO_ADWORDS + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + public partial class Creative { + private string headlineField; + + private string line1Field; + + private string line2Field; + + public string headline { + get { return this.headlineField; } + set { this.headlineField = value; } + } + + public string line1 { + get { return this.line1Field; } + set { this.line1Field = value; } + } + + public string line2 { + get { return this.line2Field; } + set { this.line2Field = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + public partial class NegativeKeyword : Keyword { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + public partial class ProductService : Criterion, IProductService { + private string textField; + + private string localeField; + + public virtual string text { + get { return this.textField; } + set { this.textField = value; } + } + + public virtual string locale { + get { return this.localeField; } + set { this.localeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + public partial class NegativeCriterion : Criterion { + private Criterion criterionField; + + public Criterion criterion { + get { return this.criterionField; } + set { this.criterionField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + public partial class KeywordSet : Criterion { + private string keywordSetIdField; + + private string nameField; + + private bool deprecatedField; + + private bool deprecatedFieldSpecified; + + public string keywordSetId { + get { return this.keywordSetIdField; } + set { this.keywordSetIdField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public bool deprecated { + get { return this.deprecatedField; } + set { + this.deprecatedField = value; + this.deprecatedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deprecatedSpecified { + get { return this.deprecatedFieldSpecified; } + set { this.deprecatedFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + public partial class PromotionPage : ExpressNoStatsPage { + private Promotion[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Promotion[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + public partial class PromotionError : ApiError { + private PromotionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PromotionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PromotionError.Reason", Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + public enum PromotionErrorReason { + BUSINESS_DELETED, + CURRENCY_NOT_SUPPORTED, + GOOGLE_GRANT_ACCOUNT, + AOL_ACCOUNT, + MCC_ACCOUNT, + INVALID_DESTINATION_URL, + CALL_TRACKING_NOT_SUPPORTED, + UNKNOWN + } + + + + + + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProductServiceServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Criterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProductServiceService : AdWordsSoapClient, IProductServiceService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProductServiceService() { + this.Url = "https://adwords.google.com/api/adwords/express/v201309/ProductServiceService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/express/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/express/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductServicePage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((ProductServicePage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201309")] + public partial class ProductServicePage : NoStatsPage { + private ProductService[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public ProductService[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdGroupServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdGroupService : AdWordsSoapClient, IAdGroupService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdGroupService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/AdGroupService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((AdGroupPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +AdGroupOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((AdGroupReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((AdGroupPage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupReturnValue : ListReturnValue { + private AdGroup[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdGroup[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupPage : Page { + private AdGroup[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public AdGroup[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdGroupBidModifierServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdGroupBidModifierService : AdWordsSoapClient, IAdGroupBidModifierService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdGroupBidModifierService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/AdGroupBidModifierService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupBidModifierPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((AdGroupBidModifierPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupBidModifierReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +AdGroupBidModifierOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((AdGroupBidModifierReturnValue) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupBidModifierReturnValue : ListReturnValue { + private AdGroupBidModifier[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdGroupBidModifier[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdGroupBidModifierPage : Page { + private AdGroupBidModifier[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public AdGroupBidModifier[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdParamServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdParamService : AdWordsSoapClient, IAdParamService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdParamService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/AdParamService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdParamPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((AdParamPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdParam[] mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +AdParamOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((AdParam[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdParamOperation : Operation { + private AdParam operandField; + + public AdParam operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdParam { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private long criterionIdField; + + private bool criterionIdFieldSpecified; + + private string insertionTextField; + + private int paramIndexField; + + private bool paramIndexFieldSpecified; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public long criterionId { + get { return this.criterionIdField; } + set { + this.criterionIdField = value; + this.criterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionIdSpecified { + get { return this.criterionIdFieldSpecified; } + set { this.criterionIdFieldSpecified = value; } + } + + public string insertionText { + get { return this.insertionTextField; } + set { this.insertionTextField = value; } + } + + public int paramIndex { + get { return this.paramIndexField; } + set { + this.paramIndexField = value; + this.paramIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool paramIndexSpecified { + get { return this.paramIndexFieldSpecified; } + set { this.paramIndexFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdParamPage { + private AdParam[] entriesField; + + private int totalNumEntriesField; + + private bool totalNumEntriesFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public AdParam[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + + public int totalNumEntries { + get { return this.totalNumEntriesField; } + set { + this.totalNumEntriesField = value; + this.totalNumEntriesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalNumEntriesSpecified { + get { return this.totalNumEntriesFieldSpecified; } + set { this.totalNumEntriesFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdParamPolicyError : PolicyViolationError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class AdParamError : ApiError { + private AdParamErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdParamErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdParamError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum AdParamErrorReason { + AD_PARAM_CANNOT_BE_SPECIFIED_MULTIPLE_TIMES, + AD_PARAM_DOES_NOT_EXIST, + CRITERION_SPECIFIED_MUST_BE_KEYWORD, + INVALID_ADGROUP_CRITERION_SPECIFIED, + INVALID_INSERTION_TEXT_FORMAT, + MUST_SPECIFY_ADGROUP_ID, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AlertServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AlertService : AdWordsSoapClient, IAlertService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AlertService() { + this.Url = "https://adwords.google.com/api/adwords/mcm/v201309/AlertService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AlertPage get(AlertSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((AlertPage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public partial class Detail { + private string triggerTimeField; + + public string triggerTime { + get { return this.triggerTimeField; } + set { this.triggerTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public partial class Alert { + private AlertSeverity alertSeverityField; + + private bool alertSeverityFieldSpecified; + + private AlertType alertTypeField; + + private bool alertTypeFieldSpecified; + + private long clientCustomerIdField; + + private bool clientCustomerIdFieldSpecified; + + private Detail[] detailsField; + + public AlertSeverity alertSeverity { + get { return this.alertSeverityField; } + set { + this.alertSeverityField = value; + this.alertSeveritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool alertSeveritySpecified { + get { return this.alertSeverityFieldSpecified; } + set { this.alertSeverityFieldSpecified = value; } + } + + public AlertType alertType { + get { return this.alertTypeField; } + set { + this.alertTypeField = value; + this.alertTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool alertTypeSpecified { + get { return this.alertTypeFieldSpecified; } + set { this.alertTypeFieldSpecified = value; } + } + + public long clientCustomerId { + get { return this.clientCustomerIdField; } + set { + this.clientCustomerIdField = value; + this.clientCustomerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clientCustomerIdSpecified { + get { return this.clientCustomerIdFieldSpecified; } + set { this.clientCustomerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("details")] + public Detail[] details { + get { return this.detailsField; } + set { this.detailsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public enum AlertSeverity { + GREEN, + YELLOW, + RED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public enum AlertType { + ACCOUNT_ON_TARGET, + DECLINED_PAYMENT, + CREDIT_CARD_EXPIRING, + ACCOUNT_BUDGET_ENDING, + CAMPAIGN_ENDING, + PAYMENT_NOT_ENTERED, + MISSING_BANK_REFERENCE_NUMBER, + CAMPAIGN_ENDED, + ACCOUNT_BUDGET_BURN_RATE, + USER_INVITE_PENDING, + USER_INVITE_ACCEPTED, + MANAGER_LINK_PENDING, + ZERO_DAILY_SPENDING_LIMIT, + TV_ACCOUNT_ON_TARGET, + TV_ACCOUNT_BUDGET_ENDING, + TV_ZERO_DAILY_SPENDING_LIMIT, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AlertPage))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public abstract partial class McmNoStatsPage : Page { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public partial class AlertPage : McmNoStatsPage { + private Alert[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Alert[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public partial class AlertQuery { + private ClientSpec clientSpecField; + + private bool clientSpecFieldSpecified; + + private FilterSpec filterSpecField; + + private bool filterSpecFieldSpecified; + + private AlertType[] typesField; + + private AlertSeverity[] severitiesField; + + private TriggerTimeSpec triggerTimeSpecField; + + private bool triggerTimeSpecFieldSpecified; + + private string triggerTimeField; + + private long[] clientCustomerIdsField; + + public ClientSpec clientSpec { + get { return this.clientSpecField; } + set { + this.clientSpecField = value; + this.clientSpecSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clientSpecSpecified { + get { return this.clientSpecFieldSpecified; } + set { this.clientSpecFieldSpecified = value; } + } + + public FilterSpec filterSpec { + get { return this.filterSpecField; } + set { + this.filterSpecField = value; + this.filterSpecSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool filterSpecSpecified { + get { return this.filterSpecFieldSpecified; } + set { this.filterSpecFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("types")] + public AlertType[] types { + get { return this.typesField; } + set { this.typesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("severities")] + public AlertSeverity[] severities { + get { return this.severitiesField; } + set { this.severitiesField = value; } + } + + public TriggerTimeSpec triggerTimeSpec { + get { return this.triggerTimeSpecField; } + set { + this.triggerTimeSpecField = value; + this.triggerTimeSpecSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool triggerTimeSpecSpecified { + get { return this.triggerTimeSpecFieldSpecified; } + set { this.triggerTimeSpecFieldSpecified = value; } + } + + public string triggerTime { + get { return this.triggerTimeField; } + set { this.triggerTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("clientCustomerIds")] + public long[] clientCustomerIds { + get { return this.clientCustomerIdsField; } + set { this.clientCustomerIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public enum ClientSpec { + ALL, + DIRECT, + ID_LIST, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public enum FilterSpec { + ALL, + ONLY_SUBMANAGERS, + ONLY_LEAF_CLIENTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public enum TriggerTimeSpec { + ALL_TIME, + CUSTOM_TIME, + LAST_24_HOURS, + LAST_7_DAYS + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public partial class AlertSelector { + private AlertQuery queryField; + + private Paging pagingField; + + public AlertQuery query { + get { return this.queryField; } + set { this.queryField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public partial class AlertError : ApiError { + private AlertErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AlertErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AlertError.Reason", Namespace = "https://adwords.google.com/api/adwords/mcm/v201309")] + public enum AlertErrorReason { + NO_CLIENT_IDS_SELECTED, + INVALID_CLIENT_ID_SELECTED, + INVALID_CLIENT_ID_FORMAT, + UNAVAILABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "BiddingStrategyServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class BiddingStrategyService : AdWordsSoapClient, IBiddingStrategyService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public BiddingStrategyService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201309/BiddingStrategyService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BiddingStrategyPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((BiddingStrategyPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BiddingStrategyReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +BiddingStrategyOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((BiddingStrategyReturnValue) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BiddingStrategyReturnValue : ListReturnValue { + private SharedBiddingStrategy[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public SharedBiddingStrategy[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class SharedBiddingStrategy { + private BiddingScheme biddingSchemeField; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private SharedBiddingStrategyBiddingStrategyStatus statusField; + + private bool statusFieldSpecified; + + private BiddingStrategyType typeField; + + private bool typeFieldSpecified; + + public BiddingScheme biddingScheme { + get { return this.biddingSchemeField; } + set { this.biddingSchemeField = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public SharedBiddingStrategyBiddingStrategyStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public BiddingStrategyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SharedBiddingStrategy.BiddingStrategyStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum SharedBiddingStrategyBiddingStrategyStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BiddingStrategyOperation : Operation { + private SharedBiddingStrategy operandField; + + public SharedBiddingStrategy operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BiddingStrategyPage : Page { + private SharedBiddingStrategy[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public SharedBiddingStrategy[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class BiddingStrategyError : ApiError { + private BiddingStrategyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BiddingStrategyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BiddingStrategyError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum BiddingStrategyErrorReason { + DUPLICATE_NAME, + CANNOT_CHANGE_BIDDING_STRATEGY_TYPE, + CANNOT_DELETE_ASSOCIATED_STRATEGY, + BIDDING_STRATEGY_NOT_SUPPORTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "BudgetOrderServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/billing/v201309")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class BudgetOrderService : AdWordsSoapClient, IBudgetOrderService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public BudgetOrderService() { + this.Url = "https://adwords.google.com/api/adwords/billing/v201309/BudgetOrderService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/billing/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/billing/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BudgetOrderPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((BudgetOrderPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/billing/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/billing/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BillingAccount[] getBillingAccounts() { + object[] results = this.Invoke("getBillingAccounts", new object[0]); + return ((BillingAccount[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/billing/v201309", ResponseNamespace = "https://adwords.google.com/api/adwords/billing/v201309", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BudgetOrderReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +BudgetOrderOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((BudgetOrderReturnValue) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201309")] + public partial class BudgetOrderReturnValue : ListReturnValue { + private BudgetOrder[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public BudgetOrder[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201309")] + public partial class BudgetOrder { + private string billingAccountIdField; + + private long idField; + + private bool idFieldSpecified; + + private string billingAccountNameField; + + private string poNumberField; + + private string budgetOrderNameField; + + private string primaryBillingIdField; + + private string secondaryBillingIdField; + + private Money spendingLimitField; + + private string startDateTimeField; + + private string endDateTimeField; + + private BudgetOrderRequest lastRequestField; + + public string billingAccountId { + get { return this.billingAccountIdField; } + set { this.billingAccountIdField = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string billingAccountName { + get { return this.billingAccountNameField; } + set { this.billingAccountNameField = value; } + } + + public string poNumber { + get { return this.poNumberField; } + set { this.poNumberField = value; } + } + + public string budgetOrderName { + get { return this.budgetOrderNameField; } + set { this.budgetOrderNameField = value; } + } + + public string primaryBillingId { + get { return this.primaryBillingIdField; } + set { this.primaryBillingIdField = value; } + } + + public string secondaryBillingId { + get { return this.secondaryBillingIdField; } + set { this.secondaryBillingIdField = value; } + } + + public Money spendingLimit { + get { return this.spendingLimitField; } + set { this.spendingLimitField = value; } + } + + public string startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public string endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public BudgetOrderRequest lastRequest { + get { return this.lastRequestField; } + set { this.lastRequestField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201309")] + public partial class BudgetOrderRequest { + private BudgetOrderRequestStatus statusField; + + private bool statusFieldSpecified; + + private string dateField; + + private string billingAccountNameField; + + private string poNumberField; + + private string budgetOrderNameField; + + private Money spendingLimitField; + + private string startDateTimeField; + + private string endDateTimeField; + + public BudgetOrderRequestStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string date { + get { return this.dateField; } + set { this.dateField = value; } + } + + public string billingAccountName { + get { return this.billingAccountNameField; } + set { this.billingAccountNameField = value; } + } + + public string poNumber { + get { return this.poNumberField; } + set { this.poNumberField = value; } + } + + public string budgetOrderName { + get { return this.budgetOrderNameField; } + set { this.budgetOrderNameField = value; } + } + + public Money spendingLimit { + get { return this.spendingLimitField; } + set { this.spendingLimitField = value; } + } + + public string startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public string endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BudgetOrderRequest.Status", Namespace = "https://adwords.google.com/api/adwords/billing/v201309")] + public enum BudgetOrderRequestStatus { + UNDER_REVIEW, + APPROVED, + REJECTED, + CANCELLED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201309")] + public partial class BudgetOrderOperation : Operation { + private BudgetOrder operandField; + + public BudgetOrder operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201309")] + public partial class BillingAccount { + private string idField; + + private string nameField; + + private string currencyCodeField; + + private string primaryBillingIdField; + + private string secondaryBillingIdField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public string primaryBillingId { + get { return this.primaryBillingIdField; } + set { this.primaryBillingIdField = value; } + } + + public string secondaryBillingId { + get { return this.secondaryBillingIdField; } + set { this.secondaryBillingIdField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201309")] + public partial class BudgetOrderPage : Page { + private BudgetOrder[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public BudgetOrder[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201309")] + public partial class CustomerOrderLineError : ApiError { + private CustomerOrderLineErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomerOrderLineErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomerOrderLineError.Reason", Namespace = "https://adwords.google.com/api/adwords/billing/v201309")] + public enum CustomerOrderLineErrorReason { + INVALID_ORDER_LINE_ID, + END_DATE_BEFORE_START_DATE, + NEGATIVE_SPEND, + CREATE_IN_PAST, + ALREADY_STARTED, + ALREADY_SPENT, + FINISHED_IN_THE_PAST, + CANCEL_ACTIVE, + OVERLAP_DATE_RANGE, + COS_CHANGE, + NON_ADWORDS, + START_DATE_AFTER_ACTUAL, + END_DATE_PAST_MAX, + PARENT_IS_SELF, + CANNOT_CANCEL_NEW, + CANNOT_CANCEL_STARTED, + CANNOT_PROMOTE_NON_PENDING_ORDERLINE, + UPDATE_ORDERLINE_WILL_SHIFT_CURRENT, + ORDERLINE_BEING_MODIFIED_IS_NOT_NORMAL_OR_PENDING, + INVALID_STATUS_CHANGE, + MORE_THAN_ONE_OPERATION_NOT_PERMITTED, + INVALID_TIMEZONE_IN_DATE_RANGES, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201309")] + public partial class BudgetOrderError : ApiError { + private BudgetOrderErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BudgetOrderErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BudgetOrderError.Reason", Namespace = "https://adwords.google.com/api/adwords/billing/v201309")] + public enum BudgetOrderErrorReason { + CUSTOMER_NOT_WHITELISTED_FOR_NEW_BILLING, + BUDGET_APPROVAL_IN_PROGRESS, + SERVICE_UNAVAILABLE, + INVALID_BILLING_ACCOUNT, + GENERIC_BILLING_ERROR, + INVALID_BILLING_ACCOUNT_ID_FORMAT, + INVALID_BUDGET_DATE_RANGE, + INCOMPATIBLE_CURRENCY, + BUDGET_UPDATE_DENIED, + BUDGET_ALREDY_STARTED, + BUDGET_ALREADY_ENDED, + INVALID_CONSTRAINT, + INVALID_BID_TOO_LARGE, + NO_SUCH_BUDGET_FOUND, + INVALID_BUDGET_ALREADY_SPENT, + INVALID_TIMEZONE_IN_DATE, + ACCOUNT_BUDGET_ID_SET_IN_ADD, + MORE_THAN_ONE_OPERATIONS, + MCC_HIERARCHY_SIZE_TOO_LARGE, + INVALID_MCC_HIERARCHY, + UNKNOWN + } + public interface IBudgetService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + BudgetPage get(Selector selector); + BudgetReturnValue mutate(BudgetOperation[] operations); + } + public interface ICampaignAdExtensionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CampaignAdExtensionPage get(Selector serviceSelector); + CampaignAdExtensionReturnValue mutate(CampaignAdExtensionOperation[] operations); + } + public interface ICampaignCriterionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CampaignCriterionPage get(Selector serviceSelector); + CampaignCriterionReturnValue mutate(CampaignCriterionOperation[] operations); + CampaignCriterionPage query(string query1); + } + public interface ICampaignService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CampaignPage get(Selector serviceSelector); + CampaignReturnValue mutate(CampaignOperation[] operations); + CampaignPage query(string query1); + } + public interface ICampaignFeedService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CampaignFeedPage get(Selector selector); + CampaignFeedReturnValue mutate(CampaignFeedOperation[] operations); + } + public interface ICampaignSharedSetService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CampaignSharedSetPage get(Selector selector); + CampaignSharedSetReturnValue mutate(CampaignSharedSetOperation[] operations); + } + public interface IConstantDataService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AgeRange[] getAgeRangeCriterion(); + Carrier[] getCarrierCriterion(); + Gender[] getGenderCriterion(); + Language[] getLanguageCriterion(); + MobileDevice[] getMobileDeviceCriterion(); + OperatingSystemVersion[] getOperatingSystemVersionCriterion(); + CriterionUserInterest[] getUserInterestCriterion(); + Vertical[] getVerticalCriterion(); + } + public interface IConversionTrackerService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ConversionTrackerPage get(Selector serviceSelector); + ConversionTrackerReturnValue mutate(ConversionTrackerOperation[] operations); + } + public interface ICustomerService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Customer get(); + } + public interface ICustomerSyncService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CustomerChangeData get(CustomerSyncSelector selector); + } + public interface IAdGroupAdService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdGroupAdPage get(Selector serviceSelector); + AdGroupAdReturnValue mutate(AdGroupAdOperation[] operations); + AdGroupAdPage query(string query1); + } + public interface IDataService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdGroupBidLandscapePage getAdGroupBidLandscape(Selector serviceSelector); + CriterionBidLandscapePage getCriterionBidLandscape(Selector serviceSelector); + } + public interface IExperimentService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ExperimentPage get(Selector serviceSelector); + ExperimentReturnValue mutate(ExperimentOperation[] operations); + } + public interface IFeedService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + FeedPage get(Selector selector); + FeedReturnValue mutate(FeedOperation[] operations); + } + public interface IFeedItemService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + FeedItemPage get(Selector selector); + FeedItemReturnValue mutate(FeedItemOperation[] operations); + } + public interface IFeedMappingService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + FeedMappingPage get(Selector selector); + FeedMappingReturnValue mutate(FeedMappingOperation[] operations); + } + public interface IGeoLocationService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + GeoLocation[] get(GeoLocationSelector selector); + } + public interface ILocationCriterionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + LocationCriterion[] get(Selector selector); + } + public interface IManagedCustomerService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ManagedCustomerPage get(Selector serviceSelector); + PendingInvitation[] getPendingInvitations(PendingInvitationSelector selector); + ManagedCustomerReturnValue mutate(ManagedCustomerOperation[] operations); + ManagedCustomerLink[] mutateLink(LinkOperation[] operations); + ManagedCustomerLink[] mutateManager(MoveOperation[] operations); + } + public interface IMediaService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + MediaPage get(Selector serviceSelector); + Media[] upload(Media[] media); + } + public interface IMutateJobService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Job[] get(JobSelector selector); + JobResult getResult(JobSelector selector); + SimpleMutateJob mutate(Operation[] operations, BulkMutateJobPolicy policy); + } + public interface IAdGroupFeedService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdGroupFeedPage get(Selector selector); + AdGroupFeedReturnValue mutate(AdGroupFeedOperation[] operations); + } + public interface IOfflineConversionFeedService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + OfflineConversionFeedReturnValue mutate(OfflineConversionFeedOperation[] operations); + } + public interface IReportDefinitionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ReportDefinitionField[] getReportFields(ReportDefinitionReportType reportType); + } + public interface ISharedCriterionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + SharedCriterionPage get(Selector selector); + SharedCriterionReturnValue mutate(SharedCriterionOperation[] operations); + } + public interface ISharedSetService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + SharedSetPage get(Selector selector); + SharedSetReturnValue mutate(SharedSetOperation[] operations); + } + public interface ITargetingIdeaService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + TargetingIdeaPage get(TargetingIdeaSelector selector); + TargetingIdeaPage getBulkKeywordIdeas(TargetingIdeaSelector selector); + } + public interface ITrafficEstimatorService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + TrafficEstimatorResult get(TrafficEstimatorSelector selector); + } + public interface IAdwordsUserListService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + UserListPage get(Selector serviceSelector); + UserListReturnValue mutate(UserListOperation[] operations); + } + public interface IVideoAdService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + VideoAdPage get(VideoAdSelector selector); + VideoAdReturnValue mutate(VideoAdOperation[] operations); + } + public interface IVideoCampaignCriterionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + VideoCampaignCriterionPage get(VideoCampaignCriterionSelector selector); + VideoCampaignCriterionReturnValue mutate(VideoCampaignCriterionOperation[] operations); + } + public interface IVideoCampaignService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + VideoCampaignPage get(VideoCampaignSelector selector); + VideoCampaignReturnValue mutate(VideoCampaignOperation[] operations); + } + public interface IAdGroupCriterionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdGroupCriterionPage get(Selector serviceSelector); + AdGroupCriterionReturnValue mutate(AdGroupCriterionOperation[] operations); + AdGroupCriterionPage query(string query1); + } + public interface IVideoService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + VideoPage get(VideoSelector selector); + VideoReturnValue mutateCallToAction(VideoCallToActionOperation[] operations); + VideoSearchPage search(VideoSearchSelector selector); + } + public interface IVideoTargetingGroupCriterionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + TargetingGroupCriterionPage get(TargetingGroupCriterionSelector selector); + TargetingGroupCriterionReturnValue mutate(TargetingGroupCriterionOperation[] operations); + } + public interface IVideoTargetingGroupService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + TargetingGroupPage get(TargetingGroupSelector selector); + TargetingGroupReturnValue mutate(TargetingGroupOperation[] operations); + } + public interface IExpressBusinessService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ExpressBusinessPage get(Selector selector); + ExpressBusiness[] mutate(ExpressBusinessOperation[] operations); + } + public interface IPromotionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + PromotionPage get(Selector selector); + Promotion[] mutate(PromotionOperation[] operations); + } + public interface IProductService { + string text { + get; + set; + } + string locale { + get; + set; + } + } + public interface IProductServiceService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ProductServicePage get(Selector selector); + } + public interface IAdGroupService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdGroupPage get(Selector serviceSelector); + AdGroupReturnValue mutate(AdGroupOperation[] operations); + AdGroupPage query(string query1); + } + public interface IAdGroupBidModifierService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdGroupBidModifierPage get(Selector selector); + AdGroupBidModifierReturnValue mutate(AdGroupBidModifierOperation[] operations); + } + public interface IAdParamService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdParamPage get(Selector serviceSelector); + AdParam[] mutate(AdParamOperation[] operations); + } + public interface IAlertService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AlertPage get(AlertSelector selector); + } + public interface IBiddingStrategyService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + BiddingStrategyPage get(Selector selector); + BiddingStrategyReturnValue mutate(BiddingStrategyOperation[] operations); + } + public interface IBudgetOrderService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + BudgetOrderPage get(Selector serviceSelector); + BillingAccount[] getBillingAccounts(); + BudgetOrderReturnValue mutate(BudgetOrderOperation[] operations); + } +} diff --git a/src/AdWords/v201309/AdWordsServiceV201309.cs b/src/AdWords/v201309/AdWordsServiceV201309.cs new file mode 100644 index 00000000000..98eb1b10e9a --- /dev/null +++ b/src/AdWords/v201309/AdWordsServiceV201309.cs @@ -0,0 +1,410 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: thagikura@gmail.com (Takeshi Hagikura) + +using Google.Api.Ads.Common.Lib; + +using System; + +namespace Google.Api.Ads.AdWords.Lib { + + /// + /// Lists all the services available through this library. + /// + public partial class AdWordsService : AdsService { + + /// + /// All the services available in v201309. + /// + public class v201309 { + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdGroupAdService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdGroupBidModifierService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdGroupCriterionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdGroupFeedService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdGroupService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdParamService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdwordsUserListService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AlertService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature BiddingStrategyService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature BudgetOrderService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature BudgetService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CampaignAdExtensionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CampaignCriterionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CampaignFeedService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CampaignService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CampaignSharedSetService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ConstantDataService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ConversionTrackerService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomerService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomerSyncService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature DataService; + + public static readonly ServiceSignature ExperimentService; + + /// + /// Factory type for v201309 services. + /// + public static readonly Type factoryType = typeof(AdWordsServiceFactory); + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature FeedItemService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature FeedMappingService; + + /// + /// See + /// this page for details. + /// + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature FeedService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature GeoLocationService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LocationCriterionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ManagedCustomerService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature MediaService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature MutateJobService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature OfflineConversionFeedService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReportDefinitionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SharedCriterionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SharedSetService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature TargetingIdeaService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature TrafficEstimatorService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature VideoAdService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature VideoCampaignCriterionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature VideoCampaignService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature VideoService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature VideoTargetingGroupCriterionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature VideoTargetingGroupService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ExpressBusinessService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature PromotionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProductServiceService; + + /// + /// Static constructor to initialize the service constants. + /// + static v201309() { + OfflineConversionFeedService = + AdWordsService.MakeServiceSignature("v201309", "cm", "OfflineConversionFeedService"); + AdGroupAdService = + AdWordsService.MakeServiceSignature("v201309", "cm", "AdGroupAdService"); + AdGroupCriterionService = + AdWordsService.MakeServiceSignature("v201309", "cm", "AdGroupCriterionService"); + AdGroupService = + AdWordsService.MakeServiceSignature("v201309", "cm", "AdGroupService"); + AdGroupBidModifierService = + AdWordsService.MakeServiceSignature("v201309", "cm", "AdGroupBidModifierService"); + AdGroupFeedService = + AdWordsService.MakeServiceSignature("v201309", "cm", "AdGroupFeedService"); + AdParamService = + AdWordsService.MakeServiceSignature("v201309", "cm", "AdParamService"); + AdwordsUserListService = + AdWordsService.MakeServiceSignature("v201309", "rm", "AdwordsUserListService"); + AlertService = + AdWordsService.MakeServiceSignature("v201309", "mcm", "AlertService"); + BiddingStrategyService = + AdWordsService.MakeServiceSignature("v201309", "cm", "BiddingStrategyService"); + BudgetService = + AdWordsService.MakeServiceSignature("v201309", "cm", "BudgetService"); + BudgetOrderService = + AdWordsService.MakeServiceSignature("v201309", "billing", "BudgetOrderService"); + CampaignAdExtensionService = + AdWordsService.MakeServiceSignature("v201309", "cm", "CampaignAdExtensionService"); + CampaignCriterionService = + AdWordsService.MakeServiceSignature("v201309", "cm", "CampaignCriterionService"); + CampaignService = + AdWordsService.MakeServiceSignature("v201309", "cm", "CampaignService"); + CampaignFeedService = + AdWordsService.MakeServiceSignature("v201309", "cm", "CampaignFeedService"); + CampaignSharedSetService = + AdWordsService.MakeServiceSignature("v201309", "cm", "CampaignSharedSetService"); + ConstantDataService = + AdWordsService.MakeServiceSignature("v201309", "cm", "ConstantDataService"); + ConversionTrackerService = + AdWordsService.MakeServiceSignature("v201309", "cm", "ConversionTrackerService"); + CustomerService = + AdWordsService.MakeServiceSignature("v201309", "mcm", "CustomerService"); + CustomerSyncService = + AdWordsService.MakeServiceSignature("v201309", "ch", "CustomerSyncService"); + DataService = + AdWordsService.MakeServiceSignature("v201309", "cm", "DataService"); + ExperimentService = + AdWordsService.MakeServiceSignature("v201309", "cm", "ExperimentService"); + FeedService = + AdWordsService.MakeServiceSignature("v201309", "cm", "FeedService"); + FeedItemService = + AdWordsService.MakeServiceSignature("v201309", "cm", "FeedItemService"); + FeedMappingService = + AdWordsService.MakeServiceSignature("v201309", "cm", "FeedMappingService"); + GeoLocationService = + AdWordsService.MakeServiceSignature("v201309", "cm", "GeoLocationService"); + LocationCriterionService = + AdWordsService.MakeServiceSignature("v201309", "cm", "LocationCriterionService"); + ManagedCustomerService = + AdWordsService.MakeServiceSignature("v201309", "mcm", "ManagedCustomerService"); + MediaService = + AdWordsService.MakeServiceSignature("v201309", "cm", "MediaService"); + MutateJobService = + AdWordsService.MakeServiceSignature("v201309", "cm", "MutateJobService"); + ReportDefinitionService = + AdWordsService.MakeServiceSignature("v201309", "cm", "ReportDefinitionService"); + SharedCriterionService = + AdWordsService.MakeServiceSignature("v201309", "cm", "SharedCriterionService"); + SharedSetService = + AdWordsService.MakeServiceSignature("v201309", "cm", "SharedSetService"); + TargetingIdeaService = + AdWordsService.MakeServiceSignature("v201309", "o", "TargetingIdeaService"); + TrafficEstimatorService = + AdWordsService.MakeServiceSignature("v201309", "o", "TrafficEstimatorService"); + + VideoAdService = + AdWordsService.MakeServiceSignature("v201309", "video", "VideoAdService"); + VideoCampaignCriterionService = + AdWordsService.MakeServiceSignature("v201309", "video", + "VideoCampaignCriterionService"); + VideoCampaignService = + AdWordsService.MakeServiceSignature("v201309", "video", "VideoCampaignService"); + VideoService = + AdWordsService.MakeServiceSignature("v201309", "video", "VideoService"); + VideoTargetingGroupCriterionService = + AdWordsService.MakeServiceSignature("v201309", "video", + "VideoTargetingGroupCriterionService"); + VideoTargetingGroupService = + AdWordsService.MakeServiceSignature("v201309", "video", "VideoTargetingGroupService"); + + ExpressBusinessService = + AdWordsService.MakeServiceSignature("v201309", "express", + "ExpressBusinessService"); + PromotionService = + AdWordsService.MakeServiceSignature("v201309", "express", "PromotionService"); + ProductServiceService = + AdWordsService.MakeServiceSignature("v201309", "express", "ProductServiceService"); + } + } + } +} \ No newline at end of file diff --git a/src/AdWords/v201309/ReportDefinition.cs b/src/AdWords/v201309/ReportDefinition.cs new file mode 100644 index 00000000000..001106878f4 --- /dev/null +++ b/src/AdWords/v201309/ReportDefinition.cs @@ -0,0 +1,203 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +#pragma warning disable 1591 + +namespace Google.Api.Ads.AdWords.v201309 { + using Google.Api.Ads.AdWords.Headers; + using Google.Api.Ads.AdWords.Lib; + + using System.Web.Services.Protocols; + using System; + using System.ComponentModel; + using System.Diagnostics; + using System.Web.Services; + using System.Xml.Serialization; + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public partial class ReportDefinition { + private long idField; + + private bool idFieldSpecified; + + private Selector selectorField; + + private string reportNameField; + + private ReportDefinitionReportType reportTypeField; + + private bool reportTypeFieldSpecified; + + private bool hasAttachmentField; + + private bool hasAttachmentFieldSpecified; + + private ReportDefinitionDateRangeType dateRangeTypeField; + + private bool dateRangeTypeFieldSpecified; + + private DownloadFormat downloadFormatField; + + private bool downloadFormatFieldSpecified; + + private string creationTimeField; + + private bool includeZeroImpressionsField; + + private bool includeZeroImpressionsFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public Selector selector { + get { return this.selectorField; } + set { this.selectorField = value; } + } + + public string reportName { + get { return this.reportNameField; } + set { this.reportNameField = value; } + } + + public ReportDefinitionReportType reportType { + get { return this.reportTypeField; } + set { + this.reportTypeField = value; + this.reportTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reportTypeSpecified { + get { return this.reportTypeFieldSpecified; } + set { this.reportTypeFieldSpecified = value; } + } + + public bool hasAttachment { + get { return this.hasAttachmentField; } + set { + this.hasAttachmentField = value; + this.hasAttachmentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasAttachmentSpecified { + get { return this.hasAttachmentFieldSpecified; } + set { this.hasAttachmentFieldSpecified = value; } + } + + public ReportDefinitionDateRangeType dateRangeType { + get { return this.dateRangeTypeField; } + set { + this.dateRangeTypeField = value; + this.dateRangeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dateRangeTypeSpecified { + get { return this.dateRangeTypeFieldSpecified; } + set { this.dateRangeTypeFieldSpecified = value; } + } + + public DownloadFormat downloadFormat { + get { return this.downloadFormatField; } + set { + this.downloadFormatField = value; + this.downloadFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool downloadFormatSpecified { + get { return this.downloadFormatFieldSpecified; } + set { this.downloadFormatFieldSpecified = value; } + } + + public string creationTime { + get { return this.creationTimeField; } + set { this.creationTimeField = value; } + } + + public bool includeZeroImpressions { + get { return this.includeZeroImpressionsField; } + set { + this.includeZeroImpressionsField = value; + this.includeZeroImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeZeroImpressionsSpecified { + get { return this.includeZeroImpressionsFieldSpecified; } + set { this.includeZeroImpressionsFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportDefinition.DateRangeType", Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum ReportDefinitionDateRangeType { + TODAY, + YESTERDAY, + LAST_7_DAYS, + LAST_WEEK, + LAST_BUSINESS_WEEK, + THIS_MONTH, + LAST_MONTH, + ALL_TIME, + CUSTOM_DATE, + LAST_14_DAYS, + LAST_30_DAYS, + THIS_WEEK_SUN_TODAY, + THIS_WEEK_MON_TODAY, + LAST_WEEK_SUN_SAT + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201309")] + public enum DownloadFormat { + CSVFOREXCEL, + CSV, + TSV, + XML, + GZIPPED_CSV, + GZIPPED_XML + } +} diff --git a/src/AdWords/v201402/AdWordsApi.cs b/src/AdWords/v201402/AdWordsApi.cs new file mode 100644 index 00000000000..9ccab97a871 --- /dev/null +++ b/src/AdWords/v201402/AdWordsApi.cs @@ -0,0 +1,30426 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +#pragma warning disable 1591 + +namespace Google.Api.Ads.AdWords.v201402 { + using Google.Api.Ads.AdWords.Headers; + using Google.Api.Ads.AdWords.Lib; + + using System.Web.Services.Protocols; + using System; + using System.ComponentModel; + using System.Diagnostics; + using System.Web.Services; + using System.Xml.Serialization; + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "BudgetServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class BudgetService : AdWordsSoapClient, IBudgetService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public BudgetService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/BudgetService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BudgetPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((BudgetPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BudgetReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +BudgetOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((BudgetReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BudgetPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((BudgetPage) (results[0])); + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetReturnValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignAdExtensionReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignCriterionReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignFeedReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConversionTrackerReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomerFeedReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupAdReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExperimentReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedItemReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedMappingReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupFeedReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OfflineConversionFeedReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoAdReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCampaignCriterionReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCampaignReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingGroupCriterionReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupCriterionReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingGroupReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignSharedSetReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedCriterionReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedSetReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupBidModifierReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddingStrategyReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetOrderReturnValue))] + public abstract partial class ListReturnValue { + private string listReturnValueTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ListReturnValue.Type")] + public string ListReturnValueType { + get { return this.listReturnValueTypeField; } + set { this.listReturnValueTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class BudgetReturnValue : ListReturnValue { + private Budget[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public Budget[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Budget { + private long budgetIdField; + + private bool budgetIdFieldSpecified; + + private string nameField; + + private BudgetBudgetPeriod periodField; + + private bool periodFieldSpecified; + + private Money amountField; + + private BudgetBudgetDeliveryMethod deliveryMethodField; + + private bool deliveryMethodFieldSpecified; + + private int referenceCountField; + + private bool referenceCountFieldSpecified; + + private bool isExplicitlySharedField; + + private bool isExplicitlySharedFieldSpecified; + + private BudgetBudgetStatus statusField; + + private bool statusFieldSpecified; + + public long budgetId { + get { return this.budgetIdField; } + set { + this.budgetIdField = value; + this.budgetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool budgetIdSpecified { + get { return this.budgetIdFieldSpecified; } + set { this.budgetIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public BudgetBudgetPeriod period { + get { return this.periodField; } + set { + this.periodField = value; + this.periodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool periodSpecified { + get { return this.periodFieldSpecified; } + set { this.periodFieldSpecified = value; } + } + + public Money amount { + get { return this.amountField; } + set { this.amountField = value; } + } + + public BudgetBudgetDeliveryMethod deliveryMethod { + get { return this.deliveryMethodField; } + set { + this.deliveryMethodField = value; + this.deliveryMethodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryMethodSpecified { + get { return this.deliveryMethodFieldSpecified; } + set { this.deliveryMethodFieldSpecified = value; } + } + + public int referenceCount { + get { return this.referenceCountField; } + set { + this.referenceCountField = value; + this.referenceCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool referenceCountSpecified { + get { return this.referenceCountFieldSpecified; } + set { this.referenceCountFieldSpecified = value; } + } + + public bool isExplicitlyShared { + get { return this.isExplicitlySharedField; } + set { + this.isExplicitlySharedField = value; + this.isExplicitlySharedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isExplicitlySharedSpecified { + get { return this.isExplicitlySharedFieldSpecified; } + set { this.isExplicitlySharedFieldSpecified = value; } + } + + public BudgetBudgetStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Budget.BudgetPeriod", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum BudgetBudgetPeriod { + DAILY + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Money : ComparableValue { + private long microAmountField; + + private bool microAmountFieldSpecified; + + public long microAmount { + get { return this.microAmountField; } + set { + this.microAmountField = value; + this.microAmountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool microAmountSpecified { + get { return this.microAmountFieldSpecified; } + set { this.microAmountFieldSpecified = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NumberValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DoubleValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Money))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public abstract partial class ComparableValue { + private string comparableValueTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ComparableValue.Type")] + public string ComparableValueType { + get { return this.comparableValueTypeField; } + set { this.comparableValueTypeField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DoubleValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public abstract partial class NumberValue : ComparableValue { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class LongValue : NumberValue { + private long numberField; + + private bool numberFieldSpecified; + + public long number { + get { return this.numberField; } + set { + this.numberField = value; + this.numberSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numberSpecified { + get { return this.numberFieldSpecified; } + set { this.numberFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class DoubleValue : NumberValue { + private double numberField; + + private bool numberFieldSpecified; + + public double number { + get { return this.numberField; } + set { + this.numberField = value; + this.numberSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numberSpecified { + get { return this.numberFieldSpecified; } + set { this.numberFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Budget.BudgetDeliveryMethod", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum BudgetBudgetDeliveryMethod { + STANDARD, + ACCELERATED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Budget.BudgetStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum BudgetBudgetStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DatabaseError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringLengthError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SizeLimitError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SelectorError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequestError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RejectedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReadOnlyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RateExceededError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RangeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(QuotaCheckError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(QueryError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperationAccessDenied))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NullError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NotEmptyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NewEntityCreationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InternalApiError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IdError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EntityNotFound))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EntityCountLimitExceeded))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DistinctError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClientTermsError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AuthorizationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AuthenticationError))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RegionCodeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PagingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatorError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignAdExtensionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdxError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExtensionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FunctionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignCriterionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StatsQueryError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SettingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(QuotaError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ForwardCompatibilityError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddingTransitionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddingErrors))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CollectionSizeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignFeedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConversionTrackingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomerSyncError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomerFeedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PolicyViolationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MediaError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExperimentError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupAdCountLimitExceeded))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupAdError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DataError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExperimentServiceError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EntityAccessDenied))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedMappingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GeoLocationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LocationCriterionServiceError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManagedCustomerServiceError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudioError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionPolicyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(JobError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupCriterionLimitExceeded))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BulkMutateJobError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupServiceError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupCriterionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExtensionOverrideError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupFeedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OfflineConversionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MatchesRegexError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CurrencyCodeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReportDefinitionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NotWhitelistedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TrafficEstimatorError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingIdeaError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserListError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoAdError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TimeSeriesError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SortingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SegmentationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReportError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PersistenceError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EntityNotFoundError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdsApiError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AccessError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCampaignCriterionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingGroupCriterionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCampaignError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoBudgetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoBiddingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NetworkError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoServiceError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingGroupError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExpressBusinessError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PromotionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignSharedSetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedCriterionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedSetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdParamPolicyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdParamError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AlertError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddingStrategyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomerOrderLineError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetOrderError))] + public abstract partial class ApiError { + private string fieldPathField; + + private string triggerField; + + private string errorStringField; + + private string apiErrorTypeField; + + public string fieldPath { + get { return this.fieldPathField; } + set { this.fieldPathField = value; } + } + + public string trigger { + get { return this.triggerField; } + set { this.triggerField = value; } + } + + public string errorString { + get { return this.errorStringField; } + set { this.errorStringField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApiError.Type")] + public string ApiErrorType { + get { return this.apiErrorTypeField; } + set { this.apiErrorTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class DatabaseError : ApiError { + private DatabaseErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DatabaseErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DatabaseError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum DatabaseErrorReason { + CONCURRENT_MODIFICATION, + PERMISSION_DENIED, + CAMPAIGN_PRODUCT_NOT_SUPPORTED, + DUPLICATE_KEY, + DATABASE_ERROR, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class StringLengthError : ApiError { + private StringLengthErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StringLengthErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StringLengthError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum StringLengthErrorReason { + TOO_SHORT, + TOO_LONG + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class SizeLimitError : ApiError { + private SizeLimitErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SizeLimitErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SizeLimitError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum SizeLimitErrorReason { + REQUEST_SIZE_LIMIT_EXCEEDED, + RESPONSE_SIZE_LIMIT_EXCEEDED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class SelectorError : ApiError { + private SelectorErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SelectorErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SelectorError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum SelectorErrorReason { + INVALID_FIELD_NAME, + MISSING_FIELDS, + MISSING_PREDICATES, + OPERATOR_DOES_NOT_SUPPORT_MULTIPLE_VALUES, + INVALID_PREDICATE_ENUM_VALUE, + MISSING_PREDICATE_OPERATOR, + MISSING_PREDICATE_VALUES, + INVALID_PREDICATE_FIELD_NAME, + INVALID_PREDICATE_OPERATOR, + INVALID_FIELD_SELECTION, + INVALID_PREDICATE_VALUE, + INVALID_SORT_FIELD_NAME, + SELECTOR_ERROR, + FILTER_BY_DATE_RANGE_NOT_SUPPORTED, + START_INDEX_IS_TOO_HIGH, + TOO_MANY_PREDICATE_VALUES, + UNKNOWN_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class RequiredError : ApiError { + private RequiredErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum RequiredErrorReason { + REQUIRED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class RequestError : ApiError { + private RequestErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequestErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequestError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum RequestErrorReason { + UNKNOWN, + INVALID_INPUT + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class RejectedError : ApiError { + private RejectedErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RejectedErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RejectedError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum RejectedErrorReason { + UNKNOWN_VALUE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ReadOnlyError : ApiError { + private ReadOnlyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReadOnlyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReadOnlyError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ReadOnlyErrorReason { + READ_ONLY + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class RateExceededError : ApiError { + private RateExceededErrorReason reasonField; + + private bool reasonFieldSpecified; + + private string rateNameField; + + private string rateScopeField; + + private int retryAfterSecondsField; + + private bool retryAfterSecondsFieldSpecified; + + public RateExceededErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + public string rateName { + get { return this.rateNameField; } + set { this.rateNameField = value; } + } + + public string rateScope { + get { return this.rateScopeField; } + set { this.rateScopeField = value; } + } + + public int retryAfterSeconds { + get { return this.retryAfterSecondsField; } + set { + this.retryAfterSecondsField = value; + this.retryAfterSecondsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool retryAfterSecondsSpecified { + get { return this.retryAfterSecondsFieldSpecified; } + set { this.retryAfterSecondsFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RateExceededError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum RateExceededErrorReason { + RATE_EXCEEDED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class RangeError : ApiError { + private RangeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RangeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RangeError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum RangeErrorReason { + TOO_LOW, + TOO_HIGH + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class QuotaCheckError : ApiError { + private QuotaCheckErrorReason reasonField; + + private bool reasonFieldSpecified; + + public QuotaCheckErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "QuotaCheckError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum QuotaCheckErrorReason { + INVALID_TOKEN_HEADER, + ACCOUNT_DELINQUENT, + ACCOUNT_INACCESSIBLE, + ACCOUNT_INACTIVE, + INCOMPLETE_SIGNUP, + INCOMPLETE_SIGNUP_LATEST_ADWORDS_API_TNC_NOT_AGREED, + INCOMPLETE_SIGNUP_NO_BILLING_INFO, + INCOMPLETE_SIGNUP_USER_INFO_MISSING, + INCOMPLETE_SIGNUP_USER_INFO_PENDING, + INCOMPLETE_SIGNUP_USER_INFO_REJECTED, + MONTHLY_BUDGET_REACHED, + QUOTA_EXCEEDED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class QueryError : ApiError { + private QueryErrorReason reasonField; + + private bool reasonFieldSpecified; + + private string messageField; + + public QueryErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + public string message { + get { return this.messageField; } + set { this.messageField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "QueryError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum QueryErrorReason { + PARSING_FAILED, + MISSING_QUERY, + MISSING_SELECT_CLAUSE, + MISSING_FROM_CLAUSE, + INVALID_SELECT_CLAUSE, + INVALID_FROM_CLAUSE, + INVALID_WHERE_CLAUSE, + INVALID_ORDER_BY_CLAUSE, + INVALID_LIMIT_CLAUSE, + INVALID_START_INDEX_IN_LIMIT_CLAUSE, + INVALID_PAGE_SIZE_IN_LIMIT_CLAUSE, + INVALID_DURING_CLAUSE, + INVALID_MIN_DATE_IN_DURING_CLAUSE, + INVALID_MAX_DATE_IN_DURING_CLAUSE, + MAX_LESS_THAN_MIN_IN_DURING_CLAUSE, + VALIDATION_FAILED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class OperationAccessDenied : ApiError { + private OperationAccessDeniedReason reasonField; + + private bool reasonFieldSpecified; + + public OperationAccessDeniedReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OperationAccessDenied.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum OperationAccessDeniedReason { + ACTION_NOT_PERMITTED, + ADD_OPERATION_NOT_PERMITTED, + REMOVE_OPERATION_NOT_PERMITTED, + SET_OPERATION_NOT_PERMITTED, + MUTATE_ACTION_NOT_PERMITTED_FOR_CLIENT, + OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class NullError : ApiError { + private NullErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NullErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NullError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum NullErrorReason { + NULL_CONTENT + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class NotEmptyError : ApiError { + private NotEmptyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NotEmptyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NotEmptyError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum NotEmptyErrorReason { + EMPTY_LIST + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class NewEntityCreationError : ApiError { + private NewEntityCreationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NewEntityCreationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NewEntityCreationError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum NewEntityCreationErrorReason { + CANNOT_SET_ID_FOR_ADD + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class InternalApiError : ApiError { + private InternalApiErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InternalApiErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InternalApiError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum InternalApiErrorReason { + UNEXPECTED_INTERNAL_API_ERROR, + UNKNOWN, + DOWNTIME + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class IdError : ApiError { + private IdErrorReason reasonField; + + private bool reasonFieldSpecified; + + public IdErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "IdError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum IdErrorReason { + NOT_FOUND + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class EntityNotFound : ApiError { + private EntityNotFoundReason reasonField; + + private bool reasonFieldSpecified; + + public EntityNotFoundReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "EntityNotFound.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum EntityNotFoundReason { + INVALID_ID + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupAdCountLimitExceeded))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupCriterionLimitExceeded))] + public partial class EntityCountLimitExceeded : ApiError { + private EntityCountLimitExceededReason reasonField; + + private bool reasonFieldSpecified; + + private string enclosingIdField; + + private int limitField; + + private bool limitFieldSpecified; + + private string accountLimitTypeField; + + private int existingCountField; + + private bool existingCountFieldSpecified; + + public EntityCountLimitExceededReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + public string enclosingId { + get { return this.enclosingIdField; } + set { this.enclosingIdField = value; } + } + + public int limit { + get { return this.limitField; } + set { + this.limitField = value; + this.limitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool limitSpecified { + get { return this.limitFieldSpecified; } + set { this.limitFieldSpecified = value; } + } + + public string accountLimitType { + get { return this.accountLimitTypeField; } + set { this.accountLimitTypeField = value; } + } + + public int existingCount { + get { return this.existingCountField; } + set { + this.existingCountField = value; + this.existingCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool existingCountSpecified { + get { return this.existingCountFieldSpecified; } + set { this.existingCountFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "EntityCountLimitExceeded.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum EntityCountLimitExceededReason { + ACCOUNT_LIMIT, + CAMPAIGN_LIMIT, + ADGROUP_LIMIT, + SHARED_SET_LIMIT, + ADGROUP_TEXT_AD_LIMIT, + ADGROUP_DISPLAY_AD_LIMIT, + MATCHING_FUNCTION_LIMIT, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class DistinctError : ApiError { + private DistinctErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DistinctErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DistinctError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum DistinctErrorReason { + DUPLICATE_ELEMENT, + DUPLICATE_TYPE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class DateError : ApiError { + private DateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DateError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum DateErrorReason { + INVALID_FIELD_VALUES_IN_DATE, + INVALID_FIELD_VALUES_IN_DATE_TIME, + INVALID_STRING_DATE, + INVALID_STRING_DATE_RANGE, + INVALID_STRING_DATE_TIME, + EARLIER_THAN_MINIMUM_DATE, + LATER_THAN_MAXIMUM_DATE, + DATE_RANGE_MINIMUM_DATE_LATER_THAN_MAXIMUM_DATE, + DATE_RANGE_MINIMUM_AND_MAXIMUM_DATES_BOTH_NULL + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ClientTermsError : ApiError { + private ClientTermsErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ClientTermsErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ClientTermsError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ClientTermsErrorReason { + INCOMPLETE_SIGNUP_CURRENT_ADWORDS_TNC_NOT_AGREED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class BudgetError : ApiError { + private BudgetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BudgetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BudgetError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum BudgetErrorReason { + BUDGET_DELETED, + BUDGET_ERROR, + BUDGET_IN_USE, + BUDGET_PERIOD_NOT_AVAILABLE, + CANNOT_EDIT_SHARED_BUDGET, + CANNOT_MODIFY_FIELD_OF_IMPLICITLY_SHARED_BUDGET, + CANNOT_UPDATE_BUDGET_TO_IMPLICITLY_SHARED, + CANNOT_USE_IMPLICITLY_SHARED_BUDGET_WITH_MULTIPLE_CAMPAIGNS, + DUPLICATE_NAME, + MONEY_AMOUNT_IN_WRONG_CURRENCY, + MONEY_AMOUNT_LESS_THAN_CURRENCY_MINIMUM_CPC, + MONEY_AMOUNT_TOO_LARGE, + NEGATIVE_MONEY_AMOUNT, + NON_MULTIPLE_OF_MINIMUM_CURRENCY_UNIT + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AuthorizationError : ApiError { + private AuthorizationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AuthorizationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AuthorizationError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AuthorizationErrorReason { + UNABLE_TO_AUTHORIZE, + NO_ADWORDS_ACCOUNT_FOR_CUSTOMER, + USER_PERMISSION_DENIED, + EFFECTIVE_USER_PERMISSION_DENIED, + USER_HAS_READONLY_PERMISSION, + NO_CUSTOMER_FOUND, + SERVICE_ACCESS_DENIED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AuthenticationError : ApiError { + private AuthenticationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AuthenticationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AuthenticationError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AuthenticationErrorReason { + AUTHENTICATION_FAILED, + CLIENT_CUSTOMER_ID_IS_REQUIRED, + CLIENT_EMAIL_REQUIRED, + CLIENT_CUSTOMER_ID_INVALID, + CLIENT_EMAIL_INVALID, + CLIENT_EMAIL_FAILED_TO_AUTHENTICATE, + CUSTOMER_NOT_FOUND, + GOOGLE_ACCOUNT_DELETED, + GOOGLE_ACCOUNT_COOKIE_INVALID, + FAILED_TO_AUTHENTICATE_GOOGLE_ACCOUNT, + GOOGLE_ACCOUNT_USER_AND_ADS_USER_MISMATCH, + LOGIN_COOKIE_REQUIRED, + NOT_ADS_USER, + OAUTH_TOKEN_INVALID, + OAUTH_TOKEN_EXPIRED, + OAUTH_TOKEN_DISABLED, + OAUTH_TOKEN_REVOKED, + OAUTH_TOKEN_HEADER_INVALID, + LOGIN_COOKIE_INVALID, + FAILED_TO_RETRIEVE_LOGIN_COOKIE, + USER_ID_INVALID + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetOperation))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignAdExtensionOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignCriterionOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignFeedOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConversionTrackerOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomerFeedOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupAdOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExperimentOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedItemOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedMappingOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManagedCustomerOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MoveOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LinkOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignTargetOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupCriterionOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupBidModifierOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExtensionOverrideOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupFeedOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OfflineConversionFeedOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserListOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoAdOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCampaignCriterionOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCampaignOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCallToActionOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingGroupCriterionOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingGroupOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExpressBusinessOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PromotionOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignSharedSetOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedCriterionOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedSetOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdParamOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddingStrategyOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetOrderOperation))] + public abstract partial class Operation { + private Operator operatorField; + + private bool operatorFieldSpecified; + + private string operationTypeField; + + public Operator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Operation.Type")] + public string OperationType { + get { return this.operationTypeField; } + set { this.operationTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum Operator { + ADD, + REMOVE, + SET + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class BudgetOperation : Operation { + private Budget operandField; + + public Budget operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetPage))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignAdExtensionPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignCriterionPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NullStatsPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignFeedPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NoStatsPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConversionTrackerPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomerFeedPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupAdPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionBidLandscapePage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupBidLandscapePage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExperimentPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedItemPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedMappingPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManagedCustomerPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupFeedPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserListPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoAdPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCampaignReportPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCampaignCriterionPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCampaignPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoSearchPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingGroupReportPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingGroupCriterionPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupCriterionPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingGroupPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExpressNoStatsPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExpressBusinessPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PromotionPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductServicePage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignSharedSetPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedCriterionPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedSetPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupBidModifierPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(McmNoStatsPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AlertPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddingStrategyPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetOrderPage))] + public abstract partial class Page { + private int totalNumEntriesField; + + private bool totalNumEntriesFieldSpecified; + + private string pageTypeField; + + public int totalNumEntries { + get { return this.totalNumEntriesField; } + set { + this.totalNumEntriesField = value; + this.totalNumEntriesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalNumEntriesSpecified { + get { return this.totalNumEntriesFieldSpecified; } + set { this.totalNumEntriesFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Page.Type")] + public string PageType { + get { return this.pageTypeField; } + set { this.pageTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class BudgetPage : Page { + private Budget[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Budget[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Paging { + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int numberResultsField; + + private bool numberResultsFieldSpecified; + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int numberResults { + get { return this.numberResultsField; } + set { + this.numberResultsField = value; + this.numberResultsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numberResultsSpecified { + get { return this.numberResultsFieldSpecified; } + set { this.numberResultsFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class OrderBy { + private string fieldField; + + private SortOrder sortOrderField; + + private bool sortOrderFieldSpecified; + + public string field { + get { return this.fieldField; } + set { this.fieldField = value; } + } + + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { + this.sortOrderField = value; + this.sortOrderSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sortOrderSpecified { + get { return this.sortOrderFieldSpecified; } + set { this.sortOrderFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum SortOrder { + ASCENDING, + DESCENDING + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class DateRange { + private string minField; + + private string maxField; + + public string min { + get { return this.minField; } + set { this.minField = value; } + } + + public string max { + get { return this.maxField; } + set { this.maxField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Predicate { + private string fieldField; + + private PredicateOperator operatorField; + + private bool operatorFieldSpecified; + + private string[] valuesField; + + public string field { + get { return this.fieldField; } + set { this.fieldField = value; } + } + + public PredicateOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("values")] + public string[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Predicate.Operator", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum PredicateOperator { + EQUALS, + NOT_EQUALS, + IN, + NOT_IN, + GREATER_THAN, + GREATER_THAN_EQUALS, + LESS_THAN, + LESS_THAN_EQUALS, + STARTS_WITH, + STARTS_WITH_IGNORE_CASE, + CONTAINS, + CONTAINS_IGNORE_CASE, + DOES_NOT_CONTAIN, + DOES_NOT_CONTAIN_IGNORE_CASE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Selector { + private string[] fieldsField; + + private Predicate[] predicatesField; + + private DateRange dateRangeField; + + private OrderBy[] orderingField; + + private Paging pagingField; + + [System.Xml.Serialization.XmlElementAttribute("fields")] + public string[] fields { + get { return this.fieldsField; } + set { this.fieldsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("predicates")] + public Predicate[] predicates { + get { return this.predicatesField; } + set { this.predicatesField = value; } + } + + public DateRange dateRange { + get { return this.dateRangeField; } + set { this.dateRangeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ordering")] + public OrderBy[] ordering { + get { return this.orderingField; } + set { this.orderingField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApiException))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ApplicationException { + private string messageField; + + private string applicationExceptionTypeField; + + public string message { + get { return this.messageField; } + set { this.messageField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApplicationException.Type")] + public string ApplicationExceptionType { + get { return this.applicationExceptionTypeField; } + set { this.applicationExceptionTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ApiException : ApplicationException { + private ApiError[] errorsField; + + [System.Xml.Serialization.XmlElementAttribute("errors")] + public ApiError[] errors { + get { return this.errorsField; } + set { this.errorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CampaignAdExtensionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CampaignAdExtensionService : AdWordsSoapClient, ICampaignAdExtensionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CampaignAdExtensionService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/CampaignAdExtensionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignAdExtensionPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((CampaignAdExtensionPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignAdExtensionReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +CampaignAdExtensionOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((CampaignAdExtensionReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignAdExtensionReturnValue : ListReturnValue { + private CampaignAdExtension[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public CampaignAdExtension[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignAdExtension { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private AdExtension adExtensionField; + + private CampaignAdExtensionStatus statusField; + + private bool statusFieldSpecified; + + private CampaignAdExtensionApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public AdExtension adExtension { + get { return this.adExtensionField; } + set { this.adExtensionField = value; } + } + + public CampaignAdExtensionStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public CampaignAdExtensionApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LocationSyncExtension))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LocationExtension))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdExtension { + private long idField; + + private bool idFieldSpecified; + + private string adExtensionTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("AdExtension.Type")] + public string AdExtensionType { + get { return this.adExtensionTypeField; } + set { this.adExtensionTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class LocationSyncExtension : AdExtension { + private string emailField; + + private string authTokenField; + + private OAuthInfo oAuthInfoField; + + private long iconMediaIdField; + + private bool iconMediaIdFieldSpecified; + + private bool shouldSyncUrlField; + + private bool shouldSyncUrlFieldSpecified; + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public string authToken { + get { return this.authTokenField; } + set { this.authTokenField = value; } + } + + public OAuthInfo oAuthInfo { + get { return this.oAuthInfoField; } + set { this.oAuthInfoField = value; } + } + + public long iconMediaId { + get { return this.iconMediaIdField; } + set { + this.iconMediaIdField = value; + this.iconMediaIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool iconMediaIdSpecified { + get { return this.iconMediaIdFieldSpecified; } + set { this.iconMediaIdFieldSpecified = value; } + } + + public bool shouldSyncUrl { + get { return this.shouldSyncUrlField; } + set { + this.shouldSyncUrlField = value; + this.shouldSyncUrlSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool shouldSyncUrlSpecified { + get { return this.shouldSyncUrlFieldSpecified; } + set { this.shouldSyncUrlFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class OAuthInfo { + private string httpMethodField; + + private string httpRequestUrlField; + + private string httpAuthorizationHeaderField; + + public string httpMethod { + get { return this.httpMethodField; } + set { this.httpMethodField = value; } + } + + public string httpRequestUrl { + get { return this.httpRequestUrlField; } + set { this.httpRequestUrlField = value; } + } + + public string httpAuthorizationHeader { + get { return this.httpAuthorizationHeaderField; } + set { this.httpAuthorizationHeaderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class LocationExtension : AdExtension { + private Address addressField; + + private GeoPoint geoPointField; + + private byte[] encodedLocationField; + + private string companyNameField; + + private string phoneNumberField; + + private LocationExtensionSource sourceField; + + private bool sourceFieldSpecified; + + private long iconMediaIdField; + + private bool iconMediaIdFieldSpecified; + + private long imageMediaIdField; + + private bool imageMediaIdFieldSpecified; + + public Address address { + get { return this.addressField; } + set { this.addressField = value; } + } + + public GeoPoint geoPoint { + get { return this.geoPointField; } + set { this.geoPointField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] encodedLocation { + get { return this.encodedLocationField; } + set { this.encodedLocationField = value; } + } + + public string companyName { + get { return this.companyNameField; } + set { this.companyNameField = value; } + } + + public string phoneNumber { + get { return this.phoneNumberField; } + set { this.phoneNumberField = value; } + } + + public LocationExtensionSource source { + get { return this.sourceField; } + set { + this.sourceField = value; + this.sourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sourceSpecified { + get { return this.sourceFieldSpecified; } + set { this.sourceFieldSpecified = value; } + } + + public long iconMediaId { + get { return this.iconMediaIdField; } + set { + this.iconMediaIdField = value; + this.iconMediaIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool iconMediaIdSpecified { + get { return this.iconMediaIdFieldSpecified; } + set { this.iconMediaIdFieldSpecified = value; } + } + + public long imageMediaId { + get { return this.imageMediaIdField; } + set { + this.imageMediaIdField = value; + this.imageMediaIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool imageMediaIdSpecified { + get { return this.imageMediaIdFieldSpecified; } + set { this.imageMediaIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Address { + private string streetAddressField; + + private string streetAddress2Field; + + private string cityNameField; + + private string provinceCodeField; + + private string provinceNameField; + + private string postalCodeField; + + private string countryCodeField; + + public string streetAddress { + get { return this.streetAddressField; } + set { this.streetAddressField = value; } + } + + public string streetAddress2 { + get { return this.streetAddress2Field; } + set { this.streetAddress2Field = value; } + } + + public string cityName { + get { return this.cityNameField; } + set { this.cityNameField = value; } + } + + public string provinceCode { + get { return this.provinceCodeField; } + set { this.provinceCodeField = value; } + } + + public string provinceName { + get { return this.provinceNameField; } + set { this.provinceNameField = value; } + } + + public string postalCode { + get { return this.postalCodeField; } + set { this.postalCodeField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class GeoPoint { + private int latitudeInMicroDegreesField; + + private bool latitudeInMicroDegreesFieldSpecified; + + private int longitudeInMicroDegreesField; + + private bool longitudeInMicroDegreesFieldSpecified; + + public int latitudeInMicroDegrees { + get { return this.latitudeInMicroDegreesField; } + set { + this.latitudeInMicroDegreesField = value; + this.latitudeInMicroDegreesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool latitudeInMicroDegreesSpecified { + get { return this.latitudeInMicroDegreesFieldSpecified; } + set { this.latitudeInMicroDegreesFieldSpecified = value; } + } + + public int longitudeInMicroDegrees { + get { return this.longitudeInMicroDegreesField; } + set { + this.longitudeInMicroDegreesField = value; + this.longitudeInMicroDegreesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool longitudeInMicroDegreesSpecified { + get { return this.longitudeInMicroDegreesFieldSpecified; } + set { this.longitudeInMicroDegreesFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LocationExtension.Source", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum LocationExtensionSource { + ADWORDS_FRONTEND, + LBC_SYNC + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignAdExtension.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum CampaignAdExtensionStatus { + ACTIVE, + DELETED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignAdExtension.ApprovalStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum CampaignAdExtensionApprovalStatus { + APPROVED, + UNCHECKED, + DISAPPROVED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class RegionCodeError : ApiError { + private RegionCodeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RegionCodeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RegionCodeError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum RegionCodeErrorReason { + INVALID_REGION_CODE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class PagingError : ApiError { + private PagingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PagingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PagingError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum PagingErrorReason { + START_INDEX_CANNOT_BE_NEGATIVE, + NUMBER_OF_RESULTS_CANNOT_BE_NEGATIVE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class OperatorError : ApiError { + private OperatorErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OperatorErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OperatorError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum OperatorErrorReason { + OPERATOR_NOT_SUPPORTED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignAdExtensionError : ApiError { + private CampaignAdExtensionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CampaignAdExtensionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignAdExtensionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum CampaignAdExtensionErrorReason { + ADEXTENSION_NOT_UNDER_CAMPAIGN, + CANNOT_ADD_DELETED_CAMPAIGN_ADEXTENSION, + CANNOT_OPERATE_ON_DELETED_CAMPAIGN_ADEXTENSION, + INVALID_ADEXTENSION_ID, + MISSING_ADEXTENSION_ID, + MUST_USE_CONCRETE_ADEXTENSION_DURING_ADD, + MUST_USE_CONCRETE_ADEXTENSION, + UNKNOWN_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdxError : ApiError { + private AdxErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdxErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdxError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdxErrorReason { + UNSUPPORTED_FEATURE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdExtensionError : ApiError { + private AdExtensionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdExtensionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdExtensionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdExtensionErrorReason { + ACCOUNT_DELETED, + AD_EXTENSION_NO_LONGER_ACTIVE, + CANNOT_HAVE_MULTIPLE_LOCATION_SYNC_EXTENSIONS_PER_CAMPAIGN, + CANNOT_HAVE_MULTIPLE_MOBILE_EXTENSIONS_PER_CAMPAIGN, + CANNOT_HAVE_MULTIPLE_PRODUCT_EXTENSIONS_PER_CAMPAIGN, + CANNOT_HAVE_MULTIPLE_SITELINKS_EXTENSIONS_PER_CAMPAIGN, + CANNOT_HAVE_MULTIPLE_IN_APP_LINK_EXTENSIONS_PER_CAMPAIGN_PER_APPSTORE, + INVALID_ADEXTENSION_TYPE, + INVALID_AUTH_TOKEN_FOR_EMAIL, + INVALID_COUNTRY_CODE, + INVALID_DOMESTIC_PHONE_NUMBER_FORMAT, + INVALID_DESTINATION_URL, + INVALID_EMAIL, + INVALID_ENCODED_LOCATION, + INVALID_ENUM_CONDITION_OPERATOR, + INVALID_ICON_DIMENSIONS, + INVALID_ID, + INVALID_IMAGE_DIMENSIONS, + INVALID_INPUT, + INVALID_LATITUDE, + INVALID_LONGITUDE, + INVALID_PHONE_NUMBER, + INVALID_STRING_CONDITION_OPERATOR, + INVALID_TOLL_PHONE_NUMBER_FORMAT, + MEDIA_DOES_NOT_BELONG_TO_ACCOUNT, + MEDIA_NOT_ICON_TYPE, + MEDIA_NOT_IMAGE_TYPE, + MISSING_ADVERTISER_NAME, + MISSING_AUTH_TOKEN, + MISSING_COUNTRY_CODE, + MISSING_CITY_NAME, + MISSING_EMAIL, + MISSING_ENCODED_LOCATION, + MISSING_CONDITION_OPERAND, + MISSING_CONDITION_STRING_VALUE, + MISSING_POSTAL_CODE, + MISSING_STREET_ADDRESS, + NUM_AND_GROUPS_OVER_LIMIT, + NUM_CONDITIONS_OVER_LIMIT, + NUM_LOCATION_EXTENSIONS_OVER_LIMIT, + NOT_AUTHORIZED_TO_CREATE_EXTENSION, + PHONE_NUMBER_NOT_SUPPORTED_FOR_COUNTRY, + DISALLOWED_NUMBER_TYPE, + PREMIUM_RATE_NUMBER_NOT_ALLOWED, + TOO_LONG, + USER_NOT_PERMITTED_TO_CREATE_LBC_SYNC_LOCATION_EXTENSION + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignAdExtensionOperation : Operation { + private CampaignAdExtension operandField; + + public CampaignAdExtension operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignAdExtensionPage : Page { + private CampaignAdExtension[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public CampaignAdExtension[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CampaignCriterionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CampaignCriterionService : AdWordsSoapClient, ICampaignCriterionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CampaignCriterionService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/CampaignCriterionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignCriterionPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((CampaignCriterionPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignCriterionReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +CampaignCriterionOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((CampaignCriterionReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignCriterionPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((CampaignCriterionPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignCriterionReturnValue : ListReturnValue { + private CampaignCriterion[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public CampaignCriterion[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NegativeCampaignCriterion))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignCriterion { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private bool isNegativeField; + + private bool isNegativeFieldSpecified; + + private Criterion criterionField; + + private double bidModifierField; + + private bool bidModifierFieldSpecified; + + private String_StringMapEntry[] forwardCompatibilityMapField; + + private string campaignCriterionTypeField; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public bool isNegative { + get { return this.isNegativeField; } + set { + this.isNegativeField = value; + this.isNegativeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isNegativeSpecified { + get { return this.isNegativeFieldSpecified; } + set { this.isNegativeFieldSpecified = value; } + } + + public Criterion criterion { + get { return this.criterionField; } + set { this.criterionField = value; } + } + + public double bidModifier { + get { return this.bidModifierField; } + set { + this.bidModifierField = value; + this.bidModifierSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidModifierSpecified { + get { return this.bidModifierFieldSpecified; } + set { this.bidModifierFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("forwardCompatibilityMap")] + public String_StringMapEntry[] forwardCompatibilityMap { + get { return this.forwardCompatibilityMapField; } + set { this.forwardCompatibilityMapField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("CampaignCriterion.Type")] + public string CampaignCriterionType { + get { return this.campaignCriterionTypeField; } + set { this.campaignCriterionTypeField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Vertical))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionUserList))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionUserInterest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LocationGroups))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Proximity))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductScope))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductSalesChannel))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Product))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Platform))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Placement))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystemVersion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileDevice))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileApplication))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileAppCategory))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Location))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Language))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Keyword))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IpBlock))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Gender))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentLabel))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Carrier))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AgeRange))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSchedule))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Webpage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductPartition))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NegativeKeyword))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductService))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NegativeCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(KeywordSet))] + public partial class Criterion { + private long idField; + + private bool idFieldSpecified; + + private CriterionType typeField; + + private bool typeFieldSpecified; + + private string criterionTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public CriterionType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Criterion.Type")] + public string CriterionType { + get { return this.criterionTypeField; } + set { this.criterionTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Criterion.Type", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum CriterionType { + CONTENT_LABEL, + KEYWORD, + PLACEMENT, + VERTICAL, + USER_LIST, + USER_INTEREST, + MOBILE_APPLICATION, + MOBILE_APP_CATEGORY, + PRODUCT, + PRODUCT_PARTITION, + IP_BLOCK, + WEBPAGE, + LANGUAGE, + LOCATION, + AGE_RANGE, + CARRIER, + OPERATING_SYSTEM_VERSION, + MOBILE_DEVICE, + GENDER, + PROXIMITY, + PLATFORM, + AD_SCHEDULE, + LOCATION_GROUPS, + PRODUCT_SCOPE, + PRODUCT_SALES_CHANNEL, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Vertical : Criterion { + private long verticalIdField; + + private bool verticalIdFieldSpecified; + + private long verticalParentIdField; + + private bool verticalParentIdFieldSpecified; + + private string[] pathField; + + public long verticalId { + get { return this.verticalIdField; } + set { + this.verticalIdField = value; + this.verticalIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool verticalIdSpecified { + get { return this.verticalIdFieldSpecified; } + set { this.verticalIdFieldSpecified = value; } + } + + public long verticalParentId { + get { return this.verticalParentIdField; } + set { + this.verticalParentIdField = value; + this.verticalParentIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool verticalParentIdSpecified { + get { return this.verticalParentIdFieldSpecified; } + set { this.verticalParentIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("path")] + public string[] path { + get { return this.pathField; } + set { this.pathField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CriterionUserList : Criterion { + private long userListIdField; + + private bool userListIdFieldSpecified; + + private string userListNameField; + + private CriterionUserListMembershipStatus userListMembershipStatusField; + + private bool userListMembershipStatusFieldSpecified; + + public long userListId { + get { return this.userListIdField; } + set { + this.userListIdField = value; + this.userListIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userListIdSpecified { + get { return this.userListIdFieldSpecified; } + set { this.userListIdFieldSpecified = value; } + } + + public string userListName { + get { return this.userListNameField; } + set { this.userListNameField = value; } + } + + public CriterionUserListMembershipStatus userListMembershipStatus { + get { return this.userListMembershipStatusField; } + set { + this.userListMembershipStatusField = value; + this.userListMembershipStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userListMembershipStatusSpecified { + get { return this.userListMembershipStatusFieldSpecified; } + set { this.userListMembershipStatusFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CriterionUserList.MembershipStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum CriterionUserListMembershipStatus { + OPEN, + CLOSED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CriterionUserInterest : Criterion { + private long userInterestIdField; + + private bool userInterestIdFieldSpecified; + + private string userInterestNameField; + + public long userInterestId { + get { return this.userInterestIdField; } + set { + this.userInterestIdField = value; + this.userInterestIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userInterestIdSpecified { + get { return this.userInterestIdFieldSpecified; } + set { this.userInterestIdFieldSpecified = value; } + } + + public string userInterestName { + get { return this.userInterestNameField; } + set { this.userInterestNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class LocationGroups : Criterion { + private Function matchingFunctionField; + + public Function matchingFunction { + get { return this.matchingFunctionField; } + set { this.matchingFunctionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Function { + private FunctionOperator operatorField; + + private bool operatorFieldSpecified; + + private FunctionArgumentOperand[] lhsOperandField; + + private FunctionArgumentOperand[] rhsOperandField; + + public FunctionOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("lhsOperand")] + public FunctionArgumentOperand[] lhsOperand { + get { return this.lhsOperandField; } + set { this.lhsOperandField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("rhsOperand")] + public FunctionArgumentOperand[] rhsOperand { + get { return this.rhsOperandField; } + set { this.rhsOperandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Function.Operator", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum FunctionOperator { + IN, + IDENTITY, + EQUALS, + AND, + UNKNOWN + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacesOfInterestOperand))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IncomeOperand))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GeoTargetOperand))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequestContextOperand))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FunctionOperand))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedAttributeOperand))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConstantOperand))] + public abstract partial class FunctionArgumentOperand { + private string functionArgumentOperandTypeField; + + [System.Xml.Serialization.XmlElementAttribute("FunctionArgumentOperand.Type")] + public string FunctionArgumentOperandType { + get { return this.functionArgumentOperandTypeField; } + set { this.functionArgumentOperandTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class PlacesOfInterestOperand : FunctionArgumentOperand { + private PlacesOfInterestOperandCategory categoryField; + + private bool categoryFieldSpecified; + + public PlacesOfInterestOperandCategory category { + get { return this.categoryField; } + set { + this.categoryField = value; + this.categorySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool categorySpecified { + get { return this.categoryFieldSpecified; } + set { this.categoryFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PlacesOfInterestOperand.Category", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum PlacesOfInterestOperandCategory { + AIRPORT, + DOWNTOWN, + UNIVERSITY, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class IncomeOperand : FunctionArgumentOperand { + private IncomeTier tierField; + + private bool tierFieldSpecified; + + public IncomeTier tier { + get { return this.tierField; } + set { + this.tierField = value; + this.tierSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool tierSpecified { + get { return this.tierFieldSpecified; } + set { this.tierFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum IncomeTier { + UNKNOWN, + TIER_1, + TIER_2, + TIER_3, + TIER_4, + TIER_5, + TIER_6_TO_10 + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class GeoTargetOperand : FunctionArgumentOperand { + private long[] locationsField; + + [System.Xml.Serialization.XmlElementAttribute("locations")] + public long[] locations { + get { return this.locationsField; } + set { this.locationsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Proximity : Criterion { + private GeoPoint geoPointField; + + private ProximityDistanceUnits radiusDistanceUnitsField; + + private bool radiusDistanceUnitsFieldSpecified; + + private double radiusInUnitsField; + + private bool radiusInUnitsFieldSpecified; + + private Address addressField; + + public GeoPoint geoPoint { + get { return this.geoPointField; } + set { this.geoPointField = value; } + } + + public ProximityDistanceUnits radiusDistanceUnits { + get { return this.radiusDistanceUnitsField; } + set { + this.radiusDistanceUnitsField = value; + this.radiusDistanceUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool radiusDistanceUnitsSpecified { + get { return this.radiusDistanceUnitsFieldSpecified; } + set { this.radiusDistanceUnitsFieldSpecified = value; } + } + + public double radiusInUnits { + get { return this.radiusInUnitsField; } + set { + this.radiusInUnitsField = value; + this.radiusInUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool radiusInUnitsSpecified { + get { return this.radiusInUnitsFieldSpecified; } + set { this.radiusInUnitsFieldSpecified = value; } + } + + public Address address { + get { return this.addressField; } + set { this.addressField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Proximity.DistanceUnits", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ProximityDistanceUnits { + KILOMETERS, + MILES + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ProductScope : Criterion { + private ProductDimension[] dimensionsField; + + [System.Xml.Serialization.XmlElementAttribute("dimensions")] + public ProductDimension[] dimensions { + get { return this.dimensionsField; } + set { this.dimensionsField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductTypeFull))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductOfferId))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductCustomAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductLegacyCondition))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductCanonicalCondition))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductBrand))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductBiddingCategory))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductAdwordsLabels))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductAdwordsGrouping))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public abstract partial class ProductDimension { + private string productDimensionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProductDimension.Type")] + public string ProductDimensionType { + get { return this.productDimensionTypeField; } + set { this.productDimensionTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ProductTypeFull : ProductDimension { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ProductType : ProductDimension { + private ProductDimensionType typeField; + + private bool typeFieldSpecified; + + private string valueField; + + public ProductDimensionType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ProductDimensionType { + UNKNOWN, + BIDDING_CATEGORY_L1, + BIDDING_CATEGORY_L2, + BIDDING_CATEGORY_L3, + BIDDING_CATEGORY_L4, + BIDDING_CATEGORY_L5, + BRAND, + CANONICAL_CONDITION, + CUSTOM_ATTRIBUTE_0, + CUSTOM_ATTRIBUTE_1, + CUSTOM_ATTRIBUTE_2, + CUSTOM_ATTRIBUTE_3, + CUSTOM_ATTRIBUTE_4, + OFFER_ID, + PRODUCT_TYPE_L1, + PRODUCT_TYPE_L2, + PRODUCT_TYPE_L3, + PRODUCT_TYPE_L4, + PRODUCT_TYPE_L5 + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ProductOfferId : ProductDimension { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ProductCustomAttribute : ProductDimension { + private ProductDimensionType typeField; + + private bool typeFieldSpecified; + + private string valueField; + + public ProductDimensionType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ProductLegacyCondition : ProductDimension { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ProductCanonicalCondition : ProductDimension { + private ProductCanonicalConditionCondition conditionField; + + private bool conditionFieldSpecified; + + public ProductCanonicalConditionCondition condition { + get { return this.conditionField; } + set { + this.conditionField = value; + this.conditionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool conditionSpecified { + get { return this.conditionFieldSpecified; } + set { this.conditionFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductCanonicalCondition.Condition", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ProductCanonicalConditionCondition { + NEW, + USED, + REFURBISHED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ProductBrand : ProductDimension { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ProductBiddingCategory : ProductDimension { + private ProductDimensionType typeField; + + private bool typeFieldSpecified; + + private long valueField; + + private bool valueFieldSpecified; + + public ProductDimensionType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public long value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ProductAdwordsLabels : ProductDimension { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ProductAdwordsGrouping : ProductDimension { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ProductSalesChannel : Criterion { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Product : Criterion { + private ProductCondition[] conditionsField; + + private string textField; + + [System.Xml.Serialization.XmlElementAttribute("conditions")] + public ProductCondition[] conditions { + get { return this.conditionsField; } + set { this.conditionsField = value; } + } + + public string text { + get { return this.textField; } + set { this.textField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ProductCondition { + private string argumentField; + + private ProductConditionOperand operandField; + + public string argument { + get { return this.argumentField; } + set { this.argumentField = value; } + } + + public ProductConditionOperand operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ProductConditionOperand { + private string operandField; + + public string operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Platform : Criterion { + private string platformNameField; + + public string platformName { + get { return this.platformNameField; } + set { this.platformNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Placement : Criterion { + private string urlField; + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class OperatingSystemVersion : Criterion { + private string nameField; + + private int osMajorVersionField; + + private bool osMajorVersionFieldSpecified; + + private int osMinorVersionField; + + private bool osMinorVersionFieldSpecified; + + private OperatingSystemVersionOperatorType operatorTypeField; + + private bool operatorTypeFieldSpecified; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public int osMajorVersion { + get { return this.osMajorVersionField; } + set { + this.osMajorVersionField = value; + this.osMajorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool osMajorVersionSpecified { + get { return this.osMajorVersionFieldSpecified; } + set { this.osMajorVersionFieldSpecified = value; } + } + + public int osMinorVersion { + get { return this.osMinorVersionField; } + set { + this.osMinorVersionField = value; + this.osMinorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool osMinorVersionSpecified { + get { return this.osMinorVersionFieldSpecified; } + set { this.osMinorVersionFieldSpecified = value; } + } + + public OperatingSystemVersionOperatorType operatorType { + get { return this.operatorTypeField; } + set { + this.operatorTypeField = value; + this.operatorTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorTypeSpecified { + get { return this.operatorTypeFieldSpecified; } + set { this.operatorTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OperatingSystemVersion.OperatorType", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum OperatingSystemVersionOperatorType { + GREATER_THAN_EQUAL_TO, + EQUAL_TO, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class MobileDevice : Criterion { + private string deviceNameField; + + private string manufacturerNameField; + + private MobileDeviceDeviceType deviceTypeField; + + private bool deviceTypeFieldSpecified; + + private string operatingSystemNameField; + + public string deviceName { + get { return this.deviceNameField; } + set { this.deviceNameField = value; } + } + + public string manufacturerName { + get { return this.manufacturerNameField; } + set { this.manufacturerNameField = value; } + } + + public MobileDeviceDeviceType deviceType { + get { return this.deviceTypeField; } + set { + this.deviceTypeField = value; + this.deviceTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deviceTypeSpecified { + get { return this.deviceTypeFieldSpecified; } + set { this.deviceTypeFieldSpecified = value; } + } + + public string operatingSystemName { + get { return this.operatingSystemNameField; } + set { this.operatingSystemNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "MobileDevice.DeviceType", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum MobileDeviceDeviceType { + DEVICE_TYPE_MOBILE, + DEVICE_TYPE_TABLET + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class MobileApplication : Criterion { + private string appIdField; + + private string displayNameField; + + public string appId { + get { return this.appIdField; } + set { this.appIdField = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class MobileAppCategory : Criterion { + private int mobileAppCategoryIdField; + + private bool mobileAppCategoryIdFieldSpecified; + + private string displayNameField; + + public int mobileAppCategoryId { + get { return this.mobileAppCategoryIdField; } + set { + this.mobileAppCategoryIdField = value; + this.mobileAppCategoryIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mobileAppCategoryIdSpecified { + get { return this.mobileAppCategoryIdFieldSpecified; } + set { this.mobileAppCategoryIdFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Location : Criterion { + private string locationNameField; + + private string displayTypeField; + + private LocationTargetingStatus targetingStatusField; + + private bool targetingStatusFieldSpecified; + + private Location[] parentLocationsField; + + public string locationName { + get { return this.locationNameField; } + set { this.locationNameField = value; } + } + + public string displayType { + get { return this.displayTypeField; } + set { this.displayTypeField = value; } + } + + public LocationTargetingStatus targetingStatus { + get { return this.targetingStatusField; } + set { + this.targetingStatusField = value; + this.targetingStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetingStatusSpecified { + get { return this.targetingStatusFieldSpecified; } + set { this.targetingStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("parentLocations")] + public Location[] parentLocations { + get { return this.parentLocationsField; } + set { this.parentLocationsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum LocationTargetingStatus { + ACTIVE, + OBSOLETE, + PHASING_OUT + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Language : Criterion { + private string codeField; + + private string nameField; + + public string code { + get { return this.codeField; } + set { this.codeField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NegativeKeyword))] + public partial class Keyword : Criterion { + private string textField; + + private KeywordMatchType matchTypeField; + + private bool matchTypeFieldSpecified; + + public string text { + get { return this.textField; } + set { this.textField = value; } + } + + public KeywordMatchType matchType { + get { return this.matchTypeField; } + set { + this.matchTypeField = value; + this.matchTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool matchTypeSpecified { + get { return this.matchTypeFieldSpecified; } + set { this.matchTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum KeywordMatchType { + EXACT, + PHRASE, + BROAD + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class IpBlock : Criterion { + private string ipAddressField; + + public string ipAddress { + get { return this.ipAddressField; } + set { this.ipAddressField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Gender : Criterion { + private GenderGenderType genderTypeField; + + private bool genderTypeFieldSpecified; + + public GenderGenderType genderType { + get { return this.genderTypeField; } + set { + this.genderTypeField = value; + this.genderTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool genderTypeSpecified { + get { return this.genderTypeFieldSpecified; } + set { this.genderTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Gender.GenderType", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum GenderGenderType { + GENDER_MALE, + GENDER_FEMALE, + GENDER_UNDETERMINED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ContentLabel : Criterion { + private ContentLabelType contentLabelTypeField; + + private bool contentLabelTypeFieldSpecified; + + public ContentLabelType contentLabelType { + get { return this.contentLabelTypeField; } + set { + this.contentLabelTypeField = value; + this.contentLabelTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contentLabelTypeSpecified { + get { return this.contentLabelTypeFieldSpecified; } + set { this.contentLabelTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ContentLabelType { + ADULTISH, + AFE, + BELOW_THE_FOLD, + CONFLICT, + DP, + EMBEDDED_VIDEO, + GAMES, + JACKASS, + PROFANITY, + UGC_FORUMS, + UGC_IMAGES, + UGC_SOCIAL, + UGC_VIDEOS, + SIRENS, + TRAGEDY, + VIDEO, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Carrier : Criterion { + private string nameField; + + private string countryCodeField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AgeRange : Criterion { + private AgeRangeAgeRangeType ageRangeTypeField; + + private bool ageRangeTypeFieldSpecified; + + public AgeRangeAgeRangeType ageRangeType { + get { return this.ageRangeTypeField; } + set { + this.ageRangeTypeField = value; + this.ageRangeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ageRangeTypeSpecified { + get { return this.ageRangeTypeFieldSpecified; } + set { this.ageRangeTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AgeRange.AgeRangeType", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AgeRangeAgeRangeType { + AGE_RANGE_18_24, + AGE_RANGE_25_34, + AGE_RANGE_35_44, + AGE_RANGE_45_54, + AGE_RANGE_55_64, + AGE_RANGE_65_UP, + AGE_RANGE_UNDETERMINED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdSchedule : Criterion { + private DayOfWeek dayOfWeekField; + + private bool dayOfWeekFieldSpecified; + + private int startHourField; + + private bool startHourFieldSpecified; + + private MinuteOfHour startMinuteField; + + private bool startMinuteFieldSpecified; + + private int endHourField; + + private bool endHourFieldSpecified; + + private MinuteOfHour endMinuteField; + + private bool endMinuteFieldSpecified; + + public DayOfWeek dayOfWeek { + get { return this.dayOfWeekField; } + set { + this.dayOfWeekField = value; + this.dayOfWeekSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dayOfWeekSpecified { + get { return this.dayOfWeekFieldSpecified; } + set { this.dayOfWeekFieldSpecified = value; } + } + + public int startHour { + get { return this.startHourField; } + set { + this.startHourField = value; + this.startHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startHourSpecified { + get { return this.startHourFieldSpecified; } + set { this.startHourFieldSpecified = value; } + } + + public MinuteOfHour startMinute { + get { return this.startMinuteField; } + set { + this.startMinuteField = value; + this.startMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startMinuteSpecified { + get { return this.startMinuteFieldSpecified; } + set { this.startMinuteFieldSpecified = value; } + } + + public int endHour { + get { return this.endHourField; } + set { + this.endHourField = value; + this.endHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endHourSpecified { + get { return this.endHourFieldSpecified; } + set { this.endHourFieldSpecified = value; } + } + + public MinuteOfHour endMinute { + get { return this.endMinuteField; } + set { + this.endMinuteField = value; + this.endMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endMinuteSpecified { + get { return this.endMinuteFieldSpecified; } + set { this.endMinuteFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum DayOfWeek { + MONDAY, + TUESDAY, + WEDNESDAY, + THURSDAY, + FRIDAY, + SATURDAY, + SUNDAY + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum MinuteOfHour { + ZERO, + FIFTEEN, + THIRTY, + FORTY_FIVE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class String_StringMapEntry { + private string keyField; + + private string valueField; + + public string key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class NegativeCampaignCriterion : CampaignCriterion { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FunctionError : ApiError { + private FunctionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FunctionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FunctionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum FunctionErrorReason { + INVALID_FUNCTION_FORMAT, + DATA_TYPE_MISMATCH, + INVALID_CONJUNCTION_OPERANDS, + INVALID_NUMBER_OF_OPERANDS, + INVALID_OPERAND_TYPE, + INVALID_OPERATOR, + INVALID_REQUEST_CONTEXT_TYPE, + INVALID_FUNCTION_FOR_CALL_PLACEHOLDER, + INVALID_FUNCTION_FOR_PLACEHOLDER, + INVALID_OPERAND, + MISSING_CONSTANT_OPERAND_VALUE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CriterionError : ApiError { + private CriterionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CriterionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CriterionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum CriterionErrorReason { + CONCRETE_TYPE_REQUIRED, + INVALID_EXCLUDED_CATEGORY, + INVALID_KEYWORD_TEXT, + KEYWORD_TEXT_TOO_LONG, + KEYWORD_HAS_TOO_MANY_WORDS, + KEYWORD_HAS_INVALID_CHARS, + INVALID_PLACEMENT_URL, + INVALID_USER_LIST, + INVALID_USER_INTEREST, + INVALID_FORMAT_FOR_PLACEMENT_URL, + PLACEMENT_URL_IS_TOO_LONG, + PLACEMENT_URL_HAS_ILLEGAL_CHAR, + PLACEMENT_URL_HAS_MULTIPLE_SITES_IN_LINE, + PLACEMENT_IS_NOT_AVAILABLE_FOR_TARGETING_OR_EXCLUSION, + INVALID_VERTICAL_PATH, + YOUTUBE_VERTICAL_CHANNEL_DEPRECATED, + YOUTUBE_DEMOGRAPHIC_CHANNEL_DEPRECATED, + CANNOT_EXCLUDE_CRITERIA_TYPE, + CANNOT_ADD_CRITERIA_TYPE, + INVALID_PRODUCT_FILTER, + PRODUCT_FILTER_TOO_LONG, + CANNOT_ADD_DISPLAY_ONLY_LISTS_TO_SEARCH_ONLY_CAMPAIGNS, + INVALID_CRITERION_ID, + CANNOT_TARGET_CRITERION, + CRITERION_ID_AND_TYPE_MISMATCH, + INVALID_PROXIMITY_RADIUS, + INVALID_PROXIMITY_RADIUS_UNITS, + INVALID_STREETADDRESS_LENGTH, + INVALID_CITYNAME_LENGTH, + INVALID_REGIONCODE_LENGTH, + INVALID_REGIONNAME_LENGTH, + INVALID_POSTALCODE_LENGTH, + INVALID_COUNTRY_CODE, + INVALID_LATITUDE, + INVALID_LONGITUDE, + PROXIMITY_GEOPOINT_AND_ADDRESS_BOTH_CANNOT_BE_NULL, + INVALID_PROXIMITY_ADDRESS, + AD_SCHEDULE_TIME_INTERVALS_OVERLAP, + AD_SCHEDULE_INTERVAL_CANNOT_SPAN_MULTIPLE_DAYS, + AD_SCHEDULE_INVALID_TIME_INTERVAL, + AD_SCHEDULE_EXCEEDED_INTERVALS_PER_DAY_LIMIT, + AD_SCHEDULE_CRITERION_ID_MISMATCHING_FIELDS, + CANNOT_BID_MODIFY_CRITERION_TYPE, + CANNOT_BID_MODIFY_NEGATIVE_CRITERION, + BID_MODIFIER_ALREADY_EXISTS, + ACCOUNT_INELIGIBLE_FOR_CRITERIA_TYPE, + CRITERIA_TYPE_INVALID_FOR_BIDDING_STRATEGY, + CANNOT_ATTACH_CRITERIA_BIDDING_STRATEGY_ON_CONTENT_NETWORK_ONLY_CAMPAIGN, + CANNOT_EXCLUDE_CRITERION, + CANNOT_REMOVE_CRITERION, + PRODUCT_SCOPE_TOO_LONG, + PRODUCT_SCOPE_TOO_MANY_DIMENSIONS, + PRODUCT_PARTITION_TOO_LONG, + PRODUCT_PARTITION_TOO_MANY_DIMENSIONS, + INVALID_PRODUCT_DIMENSION, + INVALID_PRODUCT_DIMENSION_TYPE, + INVALID_PRODUCT_BIDDING_CATEGORY, + MISSING_SHOPPING_SETTING, + INVALID_MATCHING_FUNCTION, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignCriterionError : ApiError { + private CampaignCriterionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CampaignCriterionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignCriterionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum CampaignCriterionErrorReason { + CONCRETE_TYPE_REQUIRED, + INVALID_PLACEMENT_URL, + CANNOT_EXCLUDE_CRITERIA_TYPE, + CANNOT_TARGET_AND_EXCLUDE, + TOO_MANY_OPERTAIONS, + OPERATOR_NOT_SUPPORTED_FOR_CRITERION_TYPE, + SHOPPING_CAMPAIGN_SALES_COUNTRY_NOT_SUPPORTED_FOR_SALES_CHANNEL, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignCriterionOperation : Operation { + private CampaignCriterion operandField; + + public CampaignCriterion operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignCriterionPage : Page { + private CampaignCriterion[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public CampaignCriterion[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CampaignServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CampaignService : AdWordsSoapClient, ICampaignService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CampaignService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/CampaignService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((CampaignPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +CampaignOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((CampaignReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((CampaignPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignReturnValue : ListReturnValue { + private Campaign[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public Campaign[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Campaign { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private CampaignStatus statusField; + + private bool statusFieldSpecified; + + private ServingStatus servingStatusField; + + private bool servingStatusFieldSpecified; + + private string startDateField; + + private string endDateField; + + private Budget budgetField; + + private ConversionOptimizerEligibility conversionOptimizerEligibilityField; + + private AdServingOptimizationStatus adServingOptimizationStatusField; + + private bool adServingOptimizationStatusFieldSpecified; + + private FrequencyCap frequencyCapField; + + private Setting[] settingsField; + + private AdvertisingChannelType advertisingChannelTypeField; + + private bool advertisingChannelTypeFieldSpecified; + + private NetworkSetting networkSettingField; + + private BiddingStrategyConfiguration biddingStrategyConfigurationField; + + private String_StringMapEntry[] forwardCompatibilityMapField; + + private bool displaySelectField; + + private bool displaySelectFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public CampaignStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ServingStatus servingStatus { + get { return this.servingStatusField; } + set { + this.servingStatusField = value; + this.servingStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool servingStatusSpecified { + get { return this.servingStatusFieldSpecified; } + set { this.servingStatusFieldSpecified = value; } + } + + public string startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public string endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + public Budget budget { + get { return this.budgetField; } + set { this.budgetField = value; } + } + + public ConversionOptimizerEligibility conversionOptimizerEligibility { + get { return this.conversionOptimizerEligibilityField; } + set { this.conversionOptimizerEligibilityField = value; } + } + + public AdServingOptimizationStatus adServingOptimizationStatus { + get { return this.adServingOptimizationStatusField; } + set { + this.adServingOptimizationStatusField = value; + this.adServingOptimizationStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adServingOptimizationStatusSpecified { + get { return this.adServingOptimizationStatusFieldSpecified; } + set { this.adServingOptimizationStatusFieldSpecified = value; } + } + + public FrequencyCap frequencyCap { + get { return this.frequencyCapField; } + set { this.frequencyCapField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("settings")] + public Setting[] settings { + get { return this.settingsField; } + set { this.settingsField = value; } + } + + public AdvertisingChannelType advertisingChannelType { + get { return this.advertisingChannelTypeField; } + set { + this.advertisingChannelTypeField = value; + this.advertisingChannelTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertisingChannelTypeSpecified { + get { return this.advertisingChannelTypeFieldSpecified; } + set { this.advertisingChannelTypeFieldSpecified = value; } + } + + public NetworkSetting networkSetting { + get { return this.networkSettingField; } + set { this.networkSettingField = value; } + } + + public BiddingStrategyConfiguration biddingStrategyConfiguration { + get { return this.biddingStrategyConfigurationField; } + set { this.biddingStrategyConfigurationField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("forwardCompatibilityMap")] + public String_StringMapEntry[] forwardCompatibilityMap { + get { return this.forwardCompatibilityMapField; } + set { this.forwardCompatibilityMapField = value; } + } + + public bool displaySelect { + get { return this.displaySelectField; } + set { + this.displaySelectField = value; + this.displaySelectSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool displaySelectSpecified { + get { return this.displaySelectFieldSpecified; } + set { this.displaySelectFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum CampaignStatus { + ACTIVE, + PAUSED, + DELETED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ServingStatus { + SERVING, + NONE, + ENDED, + PENDING, + SUSPENDED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ConversionOptimizerEligibility { + private bool eligibleField; + + private bool eligibleFieldSpecified; + + private ConversionOptimizerEligibilityRejectionReason[] rejectionReasonsField; + + public bool eligible { + get { return this.eligibleField; } + set { + this.eligibleField = value; + this.eligibleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool eligibleSpecified { + get { return this.eligibleFieldSpecified; } + set { this.eligibleFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("rejectionReasons")] + public ConversionOptimizerEligibilityRejectionReason[] rejectionReasons { + get { return this.rejectionReasonsField; } + set { this.rejectionReasonsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConversionOptimizerEligibility.RejectionReason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ConversionOptimizerEligibilityRejectionReason { + CAMPAIGN_IS_NOT_ACTIVE, + NOT_CPC_CAMPAIGN, + CONVERSION_TRACKING_NOT_ENABLED, + NOT_ENOUGH_CONVERSIONS, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdServingOptimizationStatus { + OPTIMIZE, + CONVERSION_OPTIMIZE, + ROTATE, + ROTATE_INDEFINITELY, + UNAVAILABLE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FrequencyCap { + private long impressionsField; + + private bool impressionsFieldSpecified; + + private TimeUnit timeUnitField; + + private bool timeUnitFieldSpecified; + + private Level levelField; + + private bool levelFieldSpecified; + + public long impressions { + get { return this.impressionsField; } + set { + this.impressionsField = value; + this.impressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsSpecified { + get { return this.impressionsFieldSpecified; } + set { this.impressionsFieldSpecified = value; } + } + + public TimeUnit timeUnit { + get { return this.timeUnitField; } + set { + this.timeUnitField = value; + this.timeUnitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool timeUnitSpecified { + get { return this.timeUnitFieldSpecified; } + set { this.timeUnitFieldSpecified = value; } + } + + public Level level { + get { return this.levelField; } + set { + this.levelField = value; + this.levelSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool levelSpecified { + get { return this.levelFieldSpecified; } + set { this.levelFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum TimeUnit { + MINUTE, + HOUR, + DAY, + WEEK, + MONTH, + LIFETIME + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum Level { + CREATIVE, + ADGROUP, + CAMPAIGN, + UNKNOWN + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TrackingSetting))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ShoppingSetting))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RealTimeBiddingSetting))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(KeywordMatchSetting))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GeoTargetTypeSetting))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DynamicSearchAdsSetting))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingSetting))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExplorerAutoOptimizerSetting))] + public abstract partial class Setting { + private string settingTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Setting.Type")] + public string SettingType { + get { return this.settingTypeField; } + set { this.settingTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class TrackingSetting : Setting { + private string trackingUrlField; + + public string trackingUrl { + get { return this.trackingUrlField; } + set { this.trackingUrlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ShoppingSetting : Setting { + private long merchantIdField; + + private bool merchantIdFieldSpecified; + + private string salesCountryField; + + private int campaignPriorityField; + + private bool campaignPriorityFieldSpecified; + + public long merchantId { + get { return this.merchantIdField; } + set { + this.merchantIdField = value; + this.merchantIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool merchantIdSpecified { + get { return this.merchantIdFieldSpecified; } + set { this.merchantIdFieldSpecified = value; } + } + + public string salesCountry { + get { return this.salesCountryField; } + set { this.salesCountryField = value; } + } + + public int campaignPriority { + get { return this.campaignPriorityField; } + set { + this.campaignPriorityField = value; + this.campaignPrioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignPrioritySpecified { + get { return this.campaignPriorityFieldSpecified; } + set { this.campaignPriorityFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class RealTimeBiddingSetting : Setting { + private bool optInField; + + private bool optInFieldSpecified; + + public bool optIn { + get { return this.optInField; } + set { + this.optInField = value; + this.optInSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool optInSpecified { + get { return this.optInFieldSpecified; } + set { this.optInFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class KeywordMatchSetting : Setting { + private bool optInField; + + private bool optInFieldSpecified; + + public bool optIn { + get { return this.optInField; } + set { + this.optInField = value; + this.optInSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool optInSpecified { + get { return this.optInFieldSpecified; } + set { this.optInFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class GeoTargetTypeSetting : Setting { + private GeoTargetTypeSettingPositiveGeoTargetType positiveGeoTargetTypeField; + + private bool positiveGeoTargetTypeFieldSpecified; + + private GeoTargetTypeSettingNegativeGeoTargetType negativeGeoTargetTypeField; + + private bool negativeGeoTargetTypeFieldSpecified; + + public GeoTargetTypeSettingPositiveGeoTargetType positiveGeoTargetType { + get { return this.positiveGeoTargetTypeField; } + set { + this.positiveGeoTargetTypeField = value; + this.positiveGeoTargetTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool positiveGeoTargetTypeSpecified { + get { return this.positiveGeoTargetTypeFieldSpecified; } + set { this.positiveGeoTargetTypeFieldSpecified = value; } + } + + public GeoTargetTypeSettingNegativeGeoTargetType negativeGeoTargetType { + get { return this.negativeGeoTargetTypeField; } + set { + this.negativeGeoTargetTypeField = value; + this.negativeGeoTargetTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool negativeGeoTargetTypeSpecified { + get { return this.negativeGeoTargetTypeFieldSpecified; } + set { this.negativeGeoTargetTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GeoTargetTypeSetting.PositiveGeoTargetType", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum GeoTargetTypeSettingPositiveGeoTargetType { + DONT_CARE, + AREA_OF_INTEREST, + LOCATION_OF_PRESENCE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GeoTargetTypeSetting.NegativeGeoTargetType", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum GeoTargetTypeSettingNegativeGeoTargetType { + DONT_CARE, + LOCATION_OF_PRESENCE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class DynamicSearchAdsSetting : Setting { + private string domainNameField; + + private string languageCodeField; + + public string domainName { + get { return this.domainNameField; } + set { this.domainNameField = value; } + } + + public string languageCode { + get { return this.languageCodeField; } + set { this.languageCodeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdvertisingChannelType { + UNKNOWN, + SEARCH, + DISPLAY, + SHOPPING + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class NetworkSetting { + private bool targetGoogleSearchField; + + private bool targetGoogleSearchFieldSpecified; + + private bool targetSearchNetworkField; + + private bool targetSearchNetworkFieldSpecified; + + private bool targetContentNetworkField; + + private bool targetContentNetworkFieldSpecified; + + private bool targetPartnerSearchNetworkField; + + private bool targetPartnerSearchNetworkFieldSpecified; + + public bool targetGoogleSearch { + get { return this.targetGoogleSearchField; } + set { + this.targetGoogleSearchField = value; + this.targetGoogleSearchSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetGoogleSearchSpecified { + get { return this.targetGoogleSearchFieldSpecified; } + set { this.targetGoogleSearchFieldSpecified = value; } + } + + public bool targetSearchNetwork { + get { return this.targetSearchNetworkField; } + set { + this.targetSearchNetworkField = value; + this.targetSearchNetworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetSearchNetworkSpecified { + get { return this.targetSearchNetworkFieldSpecified; } + set { this.targetSearchNetworkFieldSpecified = value; } + } + + public bool targetContentNetwork { + get { return this.targetContentNetworkField; } + set { + this.targetContentNetworkField = value; + this.targetContentNetworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetContentNetworkSpecified { + get { return this.targetContentNetworkFieldSpecified; } + set { this.targetContentNetworkFieldSpecified = value; } + } + + public bool targetPartnerSearchNetwork { + get { return this.targetPartnerSearchNetworkField; } + set { + this.targetPartnerSearchNetworkField = value; + this.targetPartnerSearchNetworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPartnerSearchNetworkSpecified { + get { return this.targetPartnerSearchNetworkFieldSpecified; } + set { this.targetPartnerSearchNetworkFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class BiddingStrategyConfiguration { + private long biddingStrategyIdField; + + private bool biddingStrategyIdFieldSpecified; + + private string biddingStrategyNameField; + + private BiddingStrategyType biddingStrategyTypeField; + + private bool biddingStrategyTypeFieldSpecified; + + private BiddingStrategySource biddingStrategySourceField; + + private bool biddingStrategySourceFieldSpecified; + + private BiddingScheme biddingSchemeField; + + private Bids[] bidsField; + + public long biddingStrategyId { + get { return this.biddingStrategyIdField; } + set { + this.biddingStrategyIdField = value; + this.biddingStrategyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool biddingStrategyIdSpecified { + get { return this.biddingStrategyIdFieldSpecified; } + set { this.biddingStrategyIdFieldSpecified = value; } + } + + public string biddingStrategyName { + get { return this.biddingStrategyNameField; } + set { this.biddingStrategyNameField = value; } + } + + public BiddingStrategyType biddingStrategyType { + get { return this.biddingStrategyTypeField; } + set { + this.biddingStrategyTypeField = value; + this.biddingStrategyTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool biddingStrategyTypeSpecified { + get { return this.biddingStrategyTypeFieldSpecified; } + set { this.biddingStrategyTypeFieldSpecified = value; } + } + + public BiddingStrategySource biddingStrategySource { + get { return this.biddingStrategySourceField; } + set { + this.biddingStrategySourceField = value; + this.biddingStrategySourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool biddingStrategySourceSpecified { + get { return this.biddingStrategySourceFieldSpecified; } + set { this.biddingStrategySourceFieldSpecified = value; } + } + + public BiddingScheme biddingScheme { + get { return this.biddingSchemeField; } + set { this.biddingSchemeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("bids")] + public Bids[] bids { + get { return this.bidsField; } + set { this.bidsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum BiddingStrategyType { + BUDGET_OPTIMIZER, + CONVERSION_OPTIMIZER, + MANUAL_CPC, + MANUAL_CPM, + PAGE_ONE_PROMOTED, + PERCENT_CPA, + TARGET_SPEND, + ENHANCED_CPC, + TARGET_CPA, + TARGET_ROAS, + NONE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum BiddingStrategySource { + CAMPAIGN, + ADGROUP, + CRITERION + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetOptimizerBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetSpendBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetRoasBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetCpaBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PageOnePromotedBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PercentCpaBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManualCpmBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManualCpcBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EnhancedCpcBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConversionOptimizerBiddingScheme))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public abstract partial class BiddingScheme { + private string biddingSchemeTypeField; + + [System.Xml.Serialization.XmlElementAttribute("BiddingScheme.Type")] + public string BiddingSchemeType { + get { return this.biddingSchemeTypeField; } + set { this.biddingSchemeTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class BudgetOptimizerBiddingScheme : BiddingScheme { + private Money bidCeilingField; + + private bool enhancedCpcEnabledField; + + private bool enhancedCpcEnabledFieldSpecified; + + public Money bidCeiling { + get { return this.bidCeilingField; } + set { this.bidCeilingField = value; } + } + + public bool enhancedCpcEnabled { + get { return this.enhancedCpcEnabledField; } + set { + this.enhancedCpcEnabledField = value; + this.enhancedCpcEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool enhancedCpcEnabledSpecified { + get { return this.enhancedCpcEnabledFieldSpecified; } + set { this.enhancedCpcEnabledFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class TargetSpendBiddingScheme : BiddingScheme { + private Money bidCeilingField; + + private Money spendTargetField; + + public Money bidCeiling { + get { return this.bidCeilingField; } + set { this.bidCeilingField = value; } + } + + public Money spendTarget { + get { return this.spendTargetField; } + set { this.spendTargetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class TargetRoasBiddingScheme : BiddingScheme { + private double targetRoasField; + + private bool targetRoasFieldSpecified; + + private Money bidCeilingField; + + private Money bidFloorField; + + public double targetRoas { + get { return this.targetRoasField; } + set { + this.targetRoasField = value; + this.targetRoasSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetRoasSpecified { + get { return this.targetRoasFieldSpecified; } + set { this.targetRoasFieldSpecified = value; } + } + + public Money bidCeiling { + get { return this.bidCeilingField; } + set { this.bidCeilingField = value; } + } + + public Money bidFloor { + get { return this.bidFloorField; } + set { this.bidFloorField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class TargetCpaBiddingScheme : BiddingScheme { + private Money targetCpaField; + + private Money maxCpcBidCeilingField; + + private Money maxCpcBidFloorField; + + public Money targetCpa { + get { return this.targetCpaField; } + set { this.targetCpaField = value; } + } + + public Money maxCpcBidCeiling { + get { return this.maxCpcBidCeilingField; } + set { this.maxCpcBidCeilingField = value; } + } + + public Money maxCpcBidFloor { + get { return this.maxCpcBidFloorField; } + set { this.maxCpcBidFloorField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class PageOnePromotedBiddingScheme : BiddingScheme { + private PageOnePromotedBiddingSchemeStrategyGoal strategyGoalField; + + private bool strategyGoalFieldSpecified; + + private Money bidCeilingField; + + private double bidModifierField; + + private bool bidModifierFieldSpecified; + + private bool bidChangesForRaisesOnlyField; + + private bool bidChangesForRaisesOnlyFieldSpecified; + + private bool raiseBidWhenBudgetConstainedField; + + private bool raiseBidWhenBudgetConstainedFieldSpecified; + + private bool raiseBidWhenLowQualityScoreField; + + private bool raiseBidWhenLowQualityScoreFieldSpecified; + + public PageOnePromotedBiddingSchemeStrategyGoal strategyGoal { + get { return this.strategyGoalField; } + set { + this.strategyGoalField = value; + this.strategyGoalSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool strategyGoalSpecified { + get { return this.strategyGoalFieldSpecified; } + set { this.strategyGoalFieldSpecified = value; } + } + + public Money bidCeiling { + get { return this.bidCeilingField; } + set { this.bidCeilingField = value; } + } + + public double bidModifier { + get { return this.bidModifierField; } + set { + this.bidModifierField = value; + this.bidModifierSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidModifierSpecified { + get { return this.bidModifierFieldSpecified; } + set { this.bidModifierFieldSpecified = value; } + } + + public bool bidChangesForRaisesOnly { + get { return this.bidChangesForRaisesOnlyField; } + set { + this.bidChangesForRaisesOnlyField = value; + this.bidChangesForRaisesOnlySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidChangesForRaisesOnlySpecified { + get { return this.bidChangesForRaisesOnlyFieldSpecified; } + set { this.bidChangesForRaisesOnlyFieldSpecified = value; } + } + + public bool raiseBidWhenBudgetConstained { + get { return this.raiseBidWhenBudgetConstainedField; } + set { + this.raiseBidWhenBudgetConstainedField = value; + this.raiseBidWhenBudgetConstainedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool raiseBidWhenBudgetConstainedSpecified { + get { return this.raiseBidWhenBudgetConstainedFieldSpecified; } + set { this.raiseBidWhenBudgetConstainedFieldSpecified = value; } + } + + public bool raiseBidWhenLowQualityScore { + get { return this.raiseBidWhenLowQualityScoreField; } + set { + this.raiseBidWhenLowQualityScoreField = value; + this.raiseBidWhenLowQualityScoreSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool raiseBidWhenLowQualityScoreSpecified { + get { return this.raiseBidWhenLowQualityScoreFieldSpecified; } + set { this.raiseBidWhenLowQualityScoreFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PageOnePromotedBiddingScheme.StrategyGoal", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum PageOnePromotedBiddingSchemeStrategyGoal { + PAGE_ONE, + PAGE_ONE_PROMOTED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class PercentCpaBiddingScheme : BiddingScheme { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ManualCpmBiddingScheme : BiddingScheme { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ManualCpcBiddingScheme : BiddingScheme { + private bool enhancedCpcEnabledField; + + private bool enhancedCpcEnabledFieldSpecified; + + public bool enhancedCpcEnabled { + get { return this.enhancedCpcEnabledField; } + set { + this.enhancedCpcEnabledField = value; + this.enhancedCpcEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool enhancedCpcEnabledSpecified { + get { return this.enhancedCpcEnabledFieldSpecified; } + set { this.enhancedCpcEnabledFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class EnhancedCpcBiddingScheme : BiddingScheme { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ConversionOptimizerBiddingScheme : BiddingScheme { + private ConversionOptimizerBiddingSchemePricingMode pricingModeField; + + private bool pricingModeFieldSpecified; + + private ConversionOptimizerBiddingSchemeBidType bidTypeField; + + private bool bidTypeFieldSpecified; + + public ConversionOptimizerBiddingSchemePricingMode pricingMode { + get { return this.pricingModeField; } + set { + this.pricingModeField = value; + this.pricingModeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool pricingModeSpecified { + get { return this.pricingModeFieldSpecified; } + set { this.pricingModeFieldSpecified = value; } + } + + public ConversionOptimizerBiddingSchemeBidType bidType { + get { return this.bidTypeField; } + set { + this.bidTypeField = value; + this.bidTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidTypeSpecified { + get { return this.bidTypeFieldSpecified; } + set { this.bidTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConversionOptimizerBiddingScheme.PricingMode", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ConversionOptimizerBiddingSchemePricingMode { + CLICKS, + CONVERSIONS + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConversionOptimizerBiddingScheme.BidType", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ConversionOptimizerBiddingSchemeBidType { + TARGET_CPA + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CpmBid))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CpcBid))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CpaBid))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PercentCpaBid))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public abstract partial class Bids { + private string bidsTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Bids.Type")] + public string BidsType { + get { return this.bidsTypeField; } + set { this.bidsTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CpmBid : Bids { + private Money bidField; + + private BidSource cpmBidSourceField; + + private bool cpmBidSourceFieldSpecified; + + public Money bid { + get { return this.bidField; } + set { this.bidField = value; } + } + + public BidSource cpmBidSource { + get { return this.cpmBidSourceField; } + set { + this.cpmBidSourceField = value; + this.cpmBidSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool cpmBidSourceSpecified { + get { return this.cpmBidSourceFieldSpecified; } + set { this.cpmBidSourceFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum BidSource { + ADGROUP, + CRITERION + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CpcBid : Bids { + private Money bidField; + + private Money contentBidField; + + private BidSource cpcBidSourceField; + + private bool cpcBidSourceFieldSpecified; + + public Money bid { + get { return this.bidField; } + set { this.bidField = value; } + } + + public Money contentBid { + get { return this.contentBidField; } + set { this.contentBidField = value; } + } + + public BidSource cpcBidSource { + get { return this.cpcBidSourceField; } + set { + this.cpcBidSourceField = value; + this.cpcBidSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool cpcBidSourceSpecified { + get { return this.cpcBidSourceFieldSpecified; } + set { this.cpcBidSourceFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CpaBid : Bids { + private Money bidField; + + public Money bid { + get { return this.bidField; } + set { this.bidField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class PercentCpaBid : Bids { + private int bidField; + + private bool bidFieldSpecified; + + private BidSource percentCpaBidSourceField; + + private bool percentCpaBidSourceFieldSpecified; + + public int bid { + get { return this.bidField; } + set { + this.bidField = value; + this.bidSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidSpecified { + get { return this.bidFieldSpecified; } + set { this.bidFieldSpecified = value; } + } + + public BidSource percentCpaBidSource { + get { return this.percentCpaBidSourceField; } + set { + this.percentCpaBidSourceField = value; + this.percentCpaBidSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool percentCpaBidSourceSpecified { + get { return this.percentCpaBidSourceFieldSpecified; } + set { this.percentCpaBidSourceFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class TargetError : ApiError { + private TargetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TargetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TargetError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum TargetErrorReason { + AD_SCHEDULE_ADVANCED_INCOMPATIBLE_WITH_CONVERSION_OPTIMIZER, + AD_SCHEDULE_BID_MULTIPLIER_MALFORMED, + AD_SCHEDULE_BID_MULTIPLIER_TOO_BIG, + AD_SCHEDULE_BID_MULTIPLIER_TOO_SMALL, + AD_SCHEDULE_BID_MULTIPLIER_TOO_MANY_FRACTION_DIGITS, + AD_SCHEDULE_EXCEEDED_INTERVALS_PER_DAY_LIMIT, + AD_SCHEDULE_EXCEEDS_PAST_END_OF_WEEK, + AD_SCHEDULE_INCOMPATIBILITY, + AD_SCHEDULE_INCOMPATIBLE_WITH_BUDGET_OPTIMIZER, + AD_SCHEDULE_INTERVAL_CANNOT_SPAN_MULTIPLE_DAYS, + AD_SCHEDULE_INVALID_DAY_OF_THE_WEEK, + AD_SCHEDULE_INVALID_TIME_INTERVAL, + AD_SCHEDULE_NO_INTERVALS_WHILE_ENABLED, + AD_SCHEDULE_NOT_MULTIPLE_OF_15_MINUTES, + AD_SCHEDULE_TIME_INTERVALS_OVERLAP, + CANNOT_EXCLUDE_CITY, + CANNOT_EXCLUDE_IF_NOT_TARGETED, + CANNOT_EXCLUDE_METRO, + CANNOT_EXCLUDE_PROVINCE, + CANNOT_OPT_OUT_GOOGLE_SEARCH_WHILE_BID_TO_POSITION_ENABLE, + CANNOT_TARGET_AGE_WITHOUT_GENDER, + CANNOT_TARGET_CITY, + CANNOT_TARGET_CONTENT_CONTEXTUAL_WITHOUT_CONTENT_NETWORK, + CANNOT_MODIFY_CONTENT_CONTEXTUAL, + CANNOT_TARGET_COUNTRY, + CANNOT_TARGET_COVERAGE, + CANNOT_TARGET_GENDER_WITHOUT_AGE, + CANNOT_TARGET_GOOGLE_SEARCH_FOR_CPM_CAMPAIGN, + CANNOT_CHANGE_GOOGLE_SEARCH_SETTING, + CANNOT_TARGET_LANGUAGE, + CANNOT_TARGET_METRO, + CANNOT_TARGET_MOBILE_CARRIER, + CANNOT_TARGET_PROVINCE, + CANNOT_TARGET_SEARCH_SYNDICATION_WITHOUT_GOOGLE_SEARCH, + CANNOT_TARGET_SYNDICATABLE_TYPES, + CANNOT_TARGET_THE_SAME_TARGET_LIST_TYPE_MULTIPLE_TIMES, + DEMOGRAPHIC_BID_MODIFIER_SHOULD_BE_IN_BETWEEN_0_AND_500, + INVALID_CITY_CODE, + INVALID_CITYNAME_LENGTH, + INVALID_EXCLUDED_POLYGON_TARGET, + INVALID_EXCLUDED_PROXIMITY_TARGET, + INVALID_LANGUAGE_CODE, + INVALID_LATITUDE, + INVALID_LONGITUDE, + INVALID_METRO_CODE, + INVALID_MOBILE_CARRIER, + INVALID_MOBILE_PLATFORM, + INVALID_POSTALCODE_LENGTH, + INVALID_PROVINCE_CODE, + INVALID_PROXIMITY_RADIUS, + INVALID_REGIONCODE_LENGTH, + INVALID_REGIONNAME_LENGTH, + INVALID_STREETADDRESS_LENGTH, + MULTIPLE_OCCURRENCES_OF_SAME_TARGET, + POLYGON_DUPLICATE_VERTICES, + POLYGON_EDGES_INTERSECT, + POLYGON_TOO_FEW_VERTICES, + POLYGON_TOO_MANY_VERTICES, + POLYGON_TOO_LARGE, + TARGETING_VALIDATION_FAILED, + TARGETING_CROSS_COUNTRY_REGIONAL, + TARGETING_EXCLUSION_NOT_SUPPORTED, + TARGETING_INCOMPATIBLE_LOCATION_TYPES, + TARGETING_NOT_SUPPORTED, + TARGETING_TOO_MANY_REGIONS, + TOO_MANY_EXCLUDED_LOCATIONS, + TOO_MANY_TARGETED_LOCATIONS, + WARNING_MAY_NOW_REQUIRE_CHINESE_APPROVAL, + WARNING_NOW_REQUIRES_CHINESE_APPROVAL, + WARNING_NOW_TARGETS_CHINA, + WARNING_NOW_TARGETS_CHINESE, + TARGET_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class StatsQueryError : ApiError { + private StatsQueryErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StatsQueryErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StatsQueryError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum StatsQueryErrorReason { + DATE_NOT_IN_VALID_RANGE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class SettingError : ApiError { + private SettingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SettingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SettingError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum SettingErrorReason { + DUPLICATE_SETTING_TYPE, + SETTING_TYPE_IS_NOT_AVAILABLE, + SETTING_TYPE_IS_NOT_COMPATIBLE_WITH_CAMPAIGN, + TARGETING_SETTING_CONTAINS_INVALID_CRITERION_TYPE_GROUP, + DYNAMIC_SEARCH_ADS_SETTING_CONTAINS_INVALID_DOMAIN_NAME, + DYNAMIC_SEARCH_ADS_SETTING_CONTAINS_INVALID_LANGUAGE_CODE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class QuotaError : ApiError { + private QuotaErrorReason reasonField; + + private bool reasonFieldSpecified; + + private int limitField; + + private bool limitFieldSpecified; + + public QuotaErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + public int limit { + get { return this.limitField; } + set { + this.limitField = value; + this.limitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool limitSpecified { + get { return this.limitFieldSpecified; } + set { this.limitFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "QuotaError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum QuotaErrorReason { + TOO_MANY_ADGROUPS_PER_CAMPAIGN, + TOO_MANY_CAMPAIGNS_PER_ACCOUNT, + TOO_MANY_CONVERSION_TYPES_PER_ACCOUNT, + TOO_MANY_KEYWORDS_PER_ADGROUP, + TOO_MANY_KEYWORDS_PER_CAMPAIGN, + TOO_MANY_KEYWORDS_PER_CUSTOMER, + TOO_MANY_SITES_PER_ADGROUP, + TOO_MANY_SITES_PER_CAMPAIGN, + TOO_MANY_CRITERIA_PER_ACCOUNT, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ForwardCompatibilityError : ApiError { + private ForwardCompatibilityErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ForwardCompatibilityErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ForwardCompatibilityError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ForwardCompatibilityErrorReason { + INVALID_FORWARD_COMPATIBILITY_MAP_VALUE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignError : ApiError { + private CampaignErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CampaignErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum CampaignErrorReason { + AFTER_MAXIMUM_ALLOWABLE_DATE, + CANNOT_GO_BACK_TO_INCOMPLETE, + CANNOT_MODIFY_START_DATE_IF_ALREADY_STARTED, + CANNOT_SET_END_DATE_BEFORE_EXPERIMENT_END_DATE, + CANNOT_SET_DATE_TO_PAST, + DUPLICATE_CAMPAIGN_NAME, + INCOMPATIBLE_CAMPAIGN_FIELD, + INVALID_CAMPAIGN_NAME, + INVALID_AD_SERVING_OPTIMIZATION_STATUS, + INVALID_TRACKING_URL, + MAX_IMPRESSIONS_NOT_IN_RANGE, + START_DATE_AFTER_END_DATE, + TIME_UNIT_NOT_SUPPORTED, + INVALID_OPERATION_IF_SERVING_STATUS_HAS_ENDED, + BUDGET_CANNOT_BE_SHARED, + CANNOT_SET_BUDGET, + CAMPAIGN_CANNOT_USE_SHARED_BUDGET, + MUST_SPECIFY_KEYWORD_MATCH_SETTINGS, + MISSING_SHOPPING_SETTING, + INVALID_SHOPPING_SALES_COUNTRY, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class BiddingTransitionError : ApiError { + private BiddingTransitionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BiddingTransitionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BiddingTransitionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum BiddingTransitionErrorReason { + BID_TO_POSITION_ENABLED, + BIDDING_STRATEGY_NOT_AVAILABLE_FOR_ACCOUNT_TYPE, + BUDGET_OPTIMIZER_IS_ENABLED, + CONVERSION_OPTIMIZER_IS_ENABLED, + CONVERSION_TRACKING_NOT_ENABLED, + CONVERSION_TRACKING_NOT_AVAILABLE_FOR_ACCOUNT_TYPE, + USE_POSITION_PREFERENCE_IN_MANUALCPC_INSTEAD_TO_DISABLE_POSITION_PREFERENCE, + INVALID_BID, + CANNOT_SET_EXPLICIT_BID, + EXPLICIT_BID_REQUIRED_FOR_TRANSITION, + EXPLICIT_BID_TYPE_DOES_NOT_MATCH_CAMPAIGN_BIDDING_STRATEGY, + MISSING_REQUIRED_BID, + INVALID_STATUS, + IS_CPM_CAMPAIGN, + IS_PERCENT_CPA_CAMPAIGN, + NOT_THE_PREVIOUS_BIDDING_STRATEGY, + NOT_ENOUGH_CONVERSION_DATA, + NOT_ENOUGH_CONVERSIONS, + OPTED_IN_SEARCH, + PROXY_BIDDING_ON, + SITE_REMNANT_RESERVATION_ALLOWED, + TRANSITION_TO_ITSELF, + UNKNOWN_BIDDING_STRATEGY, + UNSUPPORTED_TRANSITION, + VCG_ENABLED, + BIDDING_TRANSITION_FAILED, + ACCELERATED_DELIVERY_NOT_SUPPORTED_FOR_BUDGET_OPTIMIZER, + HAS_ACTIVE_EXPERIMENT, + INCOMPATIBLE_WITH_CAMPAIGN_SETTING + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class BiddingErrors : ApiError { + private BiddingErrorsReason reasonField; + + private bool reasonFieldSpecified; + + public BiddingErrorsReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BiddingErrors.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum BiddingErrorsReason { + BIDDING_STRATEGY_OVERRIDE_NOT_ALLOWED, + BIDDING_STRATEGY_TRANSITION_NOT_ALLOWED, + BIDDING_STRATEGY_NOT_COMPATIBLE_WITH_ADGROUP_OVERRIDES, + BIDDING_STRATEGY_NOT_COMPATIBLE_WITH_ADGROUP_CRITERIA_OVERRIDES, + CAMPAIGN_BIDDING_STRATEGY_CANNOT_BE_OVERRIDDEN, + ADGROUP_BIDDING_STRATEGY_CANNOT_BE_OVERRIDDEN, + CANNOT_ATTACH_BIDDING_STRATEGY_TO_CAMPAIGN, + CANNOT_ATTACH_BIDDING_STRATEGY_TO_ADGROUP, + CANNOT_ATTACH_BIDDING_STRATEGY_TO_ADGROUP_CRITERIA, + PERCENT_CPA_NOT_AVAILABLE_FOR_CUSTOMER, + INVALID_ANONYMOUS_BIDDING_STRATEGY_TYPE, + BIDS_NOT_ALLLOWED, + DUPLICATE_BIDS, + INVALID_BIDDING_SCHEME, + INVALID_BIDDING_STRATEGY_TYPE, + MISSING_BIDDING_STRATEGY_TYPE, + NULL_BID, + INVALID_BID, + BIDDING_STRATEGY_NOT_AVAILABLE_FOR_ACCOUNT_TYPE, + CONVERSION_TRACKING_NOT_ENABLED, + NOT_ENOUGH_CONVERSIONS, + CANNOT_CREATE_CAMPAIGN_WITH_CONVERSION_OPTIMIZER, + CANNOT_ATTACH_POP_BIDDING_STRATEGY_FOR_CONTENT_NETWORK_ONLY_CAMPAIGN, + CANNOT_TARGET_CONTENT_NETWORK_ONLY_WITH_AD_GROUP_LEVEL_POP_BIDDING_STRATEGY, + CANNOT_TARGET_CONTENT_NETWORK_ONLY_WITH_CAMPAIGN_LEVEL_POP_BIDDING_STRATEGY, + BIDDING_STRATEGY_NOT_SUPPORTED_WITH_AD_SCHEDULE, + PAY_PER_CONVERSION_NOT_AVAILABLE_FOR_CUSTOMER, + PAY_PER_CONVERSION_NOT_ALLOWED_WITH_TARGET_CPA, + BIDDING_STRATEGY_NOT_ALLOWED_FOR_SEARCH_ONLY_CAMPAIGNS, + BIDDING_STRATEGY_NOT_SUPPORTED_FOR_CAMPAIGNS_WITH_EXPERIMENTS, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class BiddingError : ApiError { + private BiddingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BiddingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BiddingError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum BiddingErrorReason { + BID_AMOUNT_REQUIRED, + BID_TOO_SMALL, + BID_TOO_BIG, + BID_TOO_MANY_FRACTIONAL_DIGITS, + NON_POSITIVE_BID, + BID_TOO_HIGH_FOR_DAILY_BUDGET, + BID_TOO_HIGH_FOR_MONTHLY_BUDGET, + MUST_EXCLUDE_0_TO_17_WITH_OTHER_AGE_EXCLUSIONS, + CAMPAIGN_MUST_HAVE_A_BUDGET_TO_ENABLE_BUDGET_OPTIMIZER, + CANNOT_SET_CONTENT_BID_WITHOUT_SETTING_KEYWORD_MAX_CPC_AS_WELL, + CANNOT_CREATE_CAMPAIGN_WITH_CONVERSION_OPTIMIZER, + PAY_PER_CONVERSION_NOT_AVAILABLE_FOR_CUSTOMER, + PAY_PER_CONVERSION_NOT_ALLOWED_WITH_TARGET_CPA, + PAY_PER_CONVERSION_NOT_ALLOWED_WITH_MANY_PER_CLICK, + TARGET_CPA_NOT_AVAILABLE_FOR_CUSTOMER, + MANY_PER_CLICK_NOT_AVAILABLE_FOR_CUSTOMER, + CANNOT_SET_SITE_MAX_CPC, + BID_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignOperation : Operation { + private Campaign operandField; + + public Campaign operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignPage : Page { + private Campaign[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Campaign[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CampaignFeedServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CampaignFeedService : AdWordsSoapClient, ICampaignFeedService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CampaignFeedService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/CampaignFeedService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignFeedPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((CampaignFeedPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignFeedReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +CampaignFeedOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((CampaignFeedReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignFeedPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((CampaignFeedPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignFeedReturnValue : ListReturnValue { + private CampaignFeed[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public CampaignFeed[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignFeed { + private long feedIdField; + + private bool feedIdFieldSpecified; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private Function matchingFunctionField; + + private int[] placeholderTypesField; + + private CampaignFeedStatus statusField; + + private bool statusFieldSpecified; + + public long feedId { + get { return this.feedIdField; } + set { + this.feedIdField = value; + this.feedIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedIdSpecified { + get { return this.feedIdFieldSpecified; } + set { this.feedIdFieldSpecified = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public Function matchingFunction { + get { return this.matchingFunctionField; } + set { this.matchingFunctionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("placeholderTypes")] + public int[] placeholderTypes { + get { return this.placeholderTypesField; } + set { this.placeholderTypesField = value; } + } + + public CampaignFeedStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class RequestContextOperand : FunctionArgumentOperand { + private RequestContextOperandContextType contextTypeField; + + private bool contextTypeFieldSpecified; + + public RequestContextOperandContextType contextType { + get { return this.contextTypeField; } + set { + this.contextTypeField = value; + this.contextTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contextTypeSpecified { + get { return this.contextTypeFieldSpecified; } + set { this.contextTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequestContextOperand.ContextType", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum RequestContextOperandContextType { + CAMPAIGN_ID, + ADGROUP_ID, + AD_ID, + FEED_ITEM_ID, + DEVICE_PLATFORM, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FunctionOperand : FunctionArgumentOperand { + private Function valueField; + + public Function value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FeedAttributeOperand : FunctionArgumentOperand { + private long feedIdField; + + private bool feedIdFieldSpecified; + + private long feedAttributeIdField; + + private bool feedAttributeIdFieldSpecified; + + public long feedId { + get { return this.feedIdField; } + set { + this.feedIdField = value; + this.feedIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedIdSpecified { + get { return this.feedIdFieldSpecified; } + set { this.feedIdFieldSpecified = value; } + } + + public long feedAttributeId { + get { return this.feedAttributeIdField; } + set { + this.feedAttributeIdField = value; + this.feedAttributeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedAttributeIdSpecified { + get { return this.feedAttributeIdFieldSpecified; } + set { this.feedAttributeIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ConstantOperand : FunctionArgumentOperand { + private ConstantOperandConstantType typeField; + + private bool typeFieldSpecified; + + private long longValueField; + + private bool longValueFieldSpecified; + + private bool booleanValueField; + + private bool booleanValueFieldSpecified; + + private double doubleValueField; + + private bool doubleValueFieldSpecified; + + private string stringValueField; + + public ConstantOperandConstantType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public long longValue { + get { return this.longValueField; } + set { + this.longValueField = value; + this.longValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool longValueSpecified { + get { return this.longValueFieldSpecified; } + set { this.longValueFieldSpecified = value; } + } + + public bool booleanValue { + get { return this.booleanValueField; } + set { + this.booleanValueField = value; + this.booleanValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool booleanValueSpecified { + get { return this.booleanValueFieldSpecified; } + set { this.booleanValueFieldSpecified = value; } + } + + public double doubleValue { + get { return this.doubleValueField; } + set { + this.doubleValueField = value; + this.doubleValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool doubleValueSpecified { + get { return this.doubleValueFieldSpecified; } + set { this.doubleValueFieldSpecified = value; } + } + + public string stringValue { + get { return this.stringValueField; } + set { this.stringValueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConstantOperand.ConstantType", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ConstantOperandConstantType { + BOOLEAN, + DOUBLE, + LONG, + STRING + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignFeed.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum CampaignFeedStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignFeedOperation : Operation { + private CampaignFeed operandField; + + public CampaignFeed operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignFeedPage))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomerFeedPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedItemPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedMappingPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupFeedPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignSharedSetPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedSetPage))] + public abstract partial class NullStatsPage : Page { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignFeedPage : NullStatsPage { + private CampaignFeed[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public CampaignFeed[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CollectionSizeError : ApiError { + private CollectionSizeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CollectionSizeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CollectionSizeError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum CollectionSizeErrorReason { + TOO_FEW, + TOO_MANY + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignFeedError : ApiError { + private CampaignFeedErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CampaignFeedErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignFeedError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum CampaignFeedErrorReason { + FEED_ALREADY_EXISTS_FOR_PLACEHOLDER_TYPE, + INVALID_ID, + CANNOT_ADD_ALREADY_EXISTING_CAMPAIGN_FEED, + CANNOT_OPERATE_ON_DELETED_CAMPAIGN_FEED, + INVALID_PLACEHOLDER_TYPES, + MISSING_FEEDMAPPING_FOR_PLACEHOLDER_TYPE, + NO_EXISTING_LOCATION_CUSTOMER_FEED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ConstantDataServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductDimension))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConstantData))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Criterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ConstantDataService : AdWordsSoapClient, IConstantDataService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ConstantDataService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/ConstantDataService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AgeRange[] getAgeRangeCriterion() { + object[] results = this.Invoke("getAgeRangeCriterion", new object[0]); + return ((AgeRange[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Carrier[] getCarrierCriterion() { + object[] results = this.Invoke("getCarrierCriterion", new object[0]); + return ((Carrier[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Gender[] getGenderCriterion() { + object[] results = this.Invoke("getGenderCriterion", new object[0]); + return ((Gender[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Language[] getLanguageCriterion() { + object[] results = this.Invoke("getLanguageCriterion", new object[0]); + return ((Language[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual MobileDevice[] getMobileDeviceCriterion() { + object[] results = this.Invoke("getMobileDeviceCriterion", new object[0]); + return ((MobileDevice[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual OperatingSystemVersion[] getOperatingSystemVersionCriterion() { + object[] results = this.Invoke("getOperatingSystemVersionCriterion", new object[0]); + return ((OperatingSystemVersion[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductBiddingCategoryData[] getProductBiddingCategoryData(Selector selector) { + object[] results = this.Invoke("getProductBiddingCategoryData", new object[] { selector }); + return ((ProductBiddingCategoryData[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CriterionUserInterest[] getUserInterestCriterion(ConstantDataServiceUserInterestTaxonomyType userInterestTaxonomyType, [System.Xml.Serialization.XmlIgnoreAttribute()] +bool userInterestTaxonomyTypeSpecified) { + object[] results = this.Invoke("getUserInterestCriterion", new object[] { userInterestTaxonomyType, userInterestTaxonomyTypeSpecified }); + return ((CriterionUserInterest[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Vertical[] getVerticalCriterion() { + object[] results = this.Invoke("getVerticalCriterion", new object[0]); + return ((Vertical[]) (results[0])); + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductBiddingCategoryData))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ConstantData { + private string constantDataTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ConstantData.Type")] + public string ConstantDataType { + get { return this.constantDataTypeField; } + set { this.constantDataTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ProductBiddingCategoryData : ConstantData { + private ProductBiddingCategory dimensionValueField; + + private ProductBiddingCategory parentDimensionValueField; + + private string countryField; + + private String_StringMapEntry[] displayValueField; + + public ProductBiddingCategory dimensionValue { + get { return this.dimensionValueField; } + set { this.dimensionValueField = value; } + } + + public ProductBiddingCategory parentDimensionValue { + get { return this.parentDimensionValueField; } + set { this.parentDimensionValueField = value; } + } + + public string country { + get { return this.countryField; } + set { this.countryField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("displayValue")] + public String_StringMapEntry[] displayValue { + get { return this.displayValueField; } + set { this.displayValueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConstantDataService.UserInterestTaxonomyType", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ConstantDataServiceUserInterestTaxonomyType { + BRAND, + IN_MARKET, + VERTICAL_GEO + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ConversionTrackerServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ConversionTrackerService : AdWordsSoapClient, IConversionTrackerService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ConversionTrackerService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/ConversionTrackerService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ConversionTrackerPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((ConversionTrackerPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ConversionTrackerReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +ConversionTrackerOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((ConversionTrackerReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ConversionTrackerReturnValue : ListReturnValue { + private ConversionTracker[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public ConversionTracker[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UploadConversion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AppConversion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdWordsConversionTracker))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdCallMetricsConversion))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public abstract partial class ConversionTracker { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private ConversionTrackerStatus statusField; + + private bool statusFieldSpecified; + + private ConversionTrackerCategory categoryField; + + private bool categoryFieldSpecified; + + private ConversionTrackerStats statsField; + + private int viewthroughLookbackWindowField; + + private bool viewthroughLookbackWindowFieldSpecified; + + private bool isProductAdsChargeableField; + + private bool isProductAdsChargeableFieldSpecified; + + private int productAdsChargeableConversionWindowField; + + private bool productAdsChargeableConversionWindowFieldSpecified; + + private int ctcLookbackWindowField; + + private bool ctcLookbackWindowFieldSpecified; + + private ConversionDeduplicationMode countingTypeField; + + private bool countingTypeFieldSpecified; + + private double defaultRevenueValueField; + + private bool defaultRevenueValueFieldSpecified; + + private bool alwaysUseDefaultRevenueValueField; + + private bool alwaysUseDefaultRevenueValueFieldSpecified; + + private string conversionTrackerTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ConversionTrackerStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ConversionTrackerCategory category { + get { return this.categoryField; } + set { + this.categoryField = value; + this.categorySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool categorySpecified { + get { return this.categoryFieldSpecified; } + set { this.categoryFieldSpecified = value; } + } + + public ConversionTrackerStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public int viewthroughLookbackWindow { + get { return this.viewthroughLookbackWindowField; } + set { + this.viewthroughLookbackWindowField = value; + this.viewthroughLookbackWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool viewthroughLookbackWindowSpecified { + get { return this.viewthroughLookbackWindowFieldSpecified; } + set { this.viewthroughLookbackWindowFieldSpecified = value; } + } + + public bool isProductAdsChargeable { + get { return this.isProductAdsChargeableField; } + set { + this.isProductAdsChargeableField = value; + this.isProductAdsChargeableSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isProductAdsChargeableSpecified { + get { return this.isProductAdsChargeableFieldSpecified; } + set { this.isProductAdsChargeableFieldSpecified = value; } + } + + public int productAdsChargeableConversionWindow { + get { return this.productAdsChargeableConversionWindowField; } + set { + this.productAdsChargeableConversionWindowField = value; + this.productAdsChargeableConversionWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productAdsChargeableConversionWindowSpecified { + get { return this.productAdsChargeableConversionWindowFieldSpecified; } + set { this.productAdsChargeableConversionWindowFieldSpecified = value; } + } + + public int ctcLookbackWindow { + get { return this.ctcLookbackWindowField; } + set { + this.ctcLookbackWindowField = value; + this.ctcLookbackWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ctcLookbackWindowSpecified { + get { return this.ctcLookbackWindowFieldSpecified; } + set { this.ctcLookbackWindowFieldSpecified = value; } + } + + public ConversionDeduplicationMode countingType { + get { return this.countingTypeField; } + set { + this.countingTypeField = value; + this.countingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool countingTypeSpecified { + get { return this.countingTypeFieldSpecified; } + set { this.countingTypeFieldSpecified = value; } + } + + public double defaultRevenueValue { + get { return this.defaultRevenueValueField; } + set { + this.defaultRevenueValueField = value; + this.defaultRevenueValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool defaultRevenueValueSpecified { + get { return this.defaultRevenueValueFieldSpecified; } + set { this.defaultRevenueValueFieldSpecified = value; } + } + + public bool alwaysUseDefaultRevenueValue { + get { return this.alwaysUseDefaultRevenueValueField; } + set { + this.alwaysUseDefaultRevenueValueField = value; + this.alwaysUseDefaultRevenueValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool alwaysUseDefaultRevenueValueSpecified { + get { return this.alwaysUseDefaultRevenueValueFieldSpecified; } + set { this.alwaysUseDefaultRevenueValueFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ConversionTracker.Type")] + public string ConversionTrackerType { + get { return this.conversionTrackerTypeField; } + set { this.conversionTrackerTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConversionTracker.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ConversionTrackerStatus { + ENABLED, + DISABLED, + HIDDEN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConversionTracker.Category", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ConversionTrackerCategory { + DEFAULT, + PAGE_VIEW, + PURCHASE, + SIGNUP, + LEAD, + REMARKETING, + DOWNLOAD + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ConversionTrackerStats { + private int numConversionEventsField; + + private bool numConversionEventsFieldSpecified; + + private Money conversionValueField; + + private string mostRecentConversionDateField; + + private int numConvertedClicksField; + + private bool numConvertedClicksFieldSpecified; + + public int numConversionEvents { + get { return this.numConversionEventsField; } + set { + this.numConversionEventsField = value; + this.numConversionEventsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numConversionEventsSpecified { + get { return this.numConversionEventsFieldSpecified; } + set { this.numConversionEventsFieldSpecified = value; } + } + + public Money conversionValue { + get { return this.conversionValueField; } + set { this.conversionValueField = value; } + } + + public string mostRecentConversionDate { + get { return this.mostRecentConversionDateField; } + set { this.mostRecentConversionDateField = value; } + } + + public int numConvertedClicks { + get { return this.numConvertedClicksField; } + set { + this.numConvertedClicksField = value; + this.numConvertedClicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numConvertedClicksSpecified { + get { return this.numConvertedClicksFieldSpecified; } + set { this.numConvertedClicksFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ConversionDeduplicationMode { + ONE_PER_CLICK, + MANY_PER_CLICK + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class UploadConversion : ConversionTracker { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AppConversion : ConversionTracker { + private string appIdField; + + private AppConversionAppPlatform appPlatformField; + + private bool appPlatformFieldSpecified; + + private string snippetField; + + private AppConversionAppConversionType appConversionTypeField; + + private bool appConversionTypeFieldSpecified; + + private string appPostbackUrlField; + + public string appId { + get { return this.appIdField; } + set { this.appIdField = value; } + } + + public AppConversionAppPlatform appPlatform { + get { return this.appPlatformField; } + set { + this.appPlatformField = value; + this.appPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool appPlatformSpecified { + get { return this.appPlatformFieldSpecified; } + set { this.appPlatformFieldSpecified = value; } + } + + public string snippet { + get { return this.snippetField; } + set { this.snippetField = value; } + } + + public AppConversionAppConversionType appConversionType { + get { return this.appConversionTypeField; } + set { + this.appConversionTypeField = value; + this.appConversionTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool appConversionTypeSpecified { + get { return this.appConversionTypeFieldSpecified; } + set { this.appConversionTypeFieldSpecified = value; } + } + + public string appPostbackUrl { + get { return this.appPostbackUrlField; } + set { this.appPostbackUrlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AppConversion.AppPlatform", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AppConversionAppPlatform { + NONE, + ITUNES, + ANDROID_MARKET, + MOBILE_APP_CHANNEL + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AppConversion.AppConversionType", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AppConversionAppConversionType { + NONE, + DOWNLOAD, + IN_APP_PURCHASE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdWordsConversionTracker : ConversionTracker { + private string snippetField; + + private AdWordsConversionTrackerMarkupLanguage markupLanguageField; + + private bool markupLanguageFieldSpecified; + + private AdWordsConversionTrackerTextFormat textFormatField; + + private bool textFormatFieldSpecified; + + private string conversionPageLanguageField; + + private string backgroundColorField; + + private AdWordsConversionTrackerTrackingCodeType trackingCodeTypeField; + + private bool trackingCodeTypeFieldSpecified; + + public string snippet { + get { return this.snippetField; } + set { this.snippetField = value; } + } + + public AdWordsConversionTrackerMarkupLanguage markupLanguage { + get { return this.markupLanguageField; } + set { + this.markupLanguageField = value; + this.markupLanguageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool markupLanguageSpecified { + get { return this.markupLanguageFieldSpecified; } + set { this.markupLanguageFieldSpecified = value; } + } + + public AdWordsConversionTrackerTextFormat textFormat { + get { return this.textFormatField; } + set { + this.textFormatField = value; + this.textFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool textFormatSpecified { + get { return this.textFormatFieldSpecified; } + set { this.textFormatFieldSpecified = value; } + } + + public string conversionPageLanguage { + get { return this.conversionPageLanguageField; } + set { this.conversionPageLanguageField = value; } + } + + public string backgroundColor { + get { return this.backgroundColorField; } + set { this.backgroundColorField = value; } + } + + public AdWordsConversionTrackerTrackingCodeType trackingCodeType { + get { return this.trackingCodeTypeField; } + set { + this.trackingCodeTypeField = value; + this.trackingCodeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool trackingCodeTypeSpecified { + get { return this.trackingCodeTypeFieldSpecified; } + set { this.trackingCodeTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdWordsConversionTracker.MarkupLanguage", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdWordsConversionTrackerMarkupLanguage { + HTML, + CHTML, + XHTML, + WML + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdWordsConversionTracker.TextFormat", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdWordsConversionTrackerTextFormat { + ONE_LINE, + TWO_LINE, + HIDDEN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdWordsConversionTracker.TrackingCodeType", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdWordsConversionTrackerTrackingCodeType { + WEBPAGE, + CLICK_TO_CALL, + ANDROID_REMARKETING, + APPLE_IOS_REMARKETING + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdCallMetricsConversion : ConversionTracker { + private long phoneCallDurationField; + + private bool phoneCallDurationFieldSpecified; + + public long phoneCallDuration { + get { return this.phoneCallDurationField; } + set { + this.phoneCallDurationField = value; + this.phoneCallDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool phoneCallDurationSpecified { + get { return this.phoneCallDurationFieldSpecified; } + set { this.phoneCallDurationFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ConversionTrackerOperation : Operation { + private ConversionTracker operandField; + + public ConversionTracker operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConversionTrackerPage))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionBidLandscapePage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupBidLandscapePage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductServicePage))] + public abstract partial class NoStatsPage : Page { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ConversionTrackerPage : NoStatsPage { + private ConversionTracker[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public ConversionTracker[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ConversionTrackingError : ApiError { + private ConversionTrackingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ConversionTrackingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConversionTrackingError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ConversionTrackingErrorReason { + ANALYTICS_NOT_ALLOWED, + CANNOT_ADD_CONVERSION_TYPE_SUBCLASS, + CANNOT_CHANGE_APP_CONVERSION_TYPE, + CANNOT_CHANGE_APP_PLATFORM, + CANNNOT_CHANGE_CONVERSION_SUBCLASS, + CANNOT_SET_HIDDEN_STATUS, + CONVERSION_TYPE_NOT_FOUND, + DOMAIN_EXCEPTION, + INCONSISTENT_COUNTING_TYPE, + DUPLICATE_APP_ID, + DUPLICATE_NAME, + EMAIL_FAILED, + EXCEEDED_CONVERSION_TYPE_LIMIT, + ID_IS_NULL, + INVALID_APP_ID, + INVALID_COLOR, + INVALID_CONVERSION, + INVALID_DATE_RANGE, + INVALID_EMAIL_ADDRESS, + MUST_SET_APP_PLATFORM_AND_APP_CONVERSION_TYPE_TOGETHER, + NAME_ALREADY_EXISTS, + NO_RECIPIENTS, + NO_SNIPPET, + TOO_MANY_WEBPAGES, + UNKNOWN_SORTING_TYPE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomerServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomerService : AdWordsSoapClient, ICustomerService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomerService() { + this.Url = "https://adwords.google.com/api/adwords/mcm/v201402/CustomerService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Customer get() { + object[] results = this.Invoke("get", new object[0]); + return ((Customer) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Customer mutate(Customer customer) { + object[] results = this.Invoke("mutate", new object[] { customer }); + return ((Customer) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public partial class Customer { + private long customerIdField; + + private bool customerIdFieldSpecified; + + private string currencyCodeField; + + private string dateTimeZoneField; + + private string descriptiveNameField; + + private string companyNameField; + + private bool canManageClientsField; + + private bool canManageClientsFieldSpecified; + + private bool testAccountField; + + private bool testAccountFieldSpecified; + + private bool autoTaggingEnabledField; + + private bool autoTaggingEnabledFieldSpecified; + + public long customerId { + get { return this.customerIdField; } + set { + this.customerIdField = value; + this.customerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customerIdSpecified { + get { return this.customerIdFieldSpecified; } + set { this.customerIdFieldSpecified = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public string dateTimeZone { + get { return this.dateTimeZoneField; } + set { this.dateTimeZoneField = value; } + } + + public string descriptiveName { + get { return this.descriptiveNameField; } + set { this.descriptiveNameField = value; } + } + + public string companyName { + get { return this.companyNameField; } + set { this.companyNameField = value; } + } + + public bool canManageClients { + get { return this.canManageClientsField; } + set { + this.canManageClientsField = value; + this.canManageClientsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool canManageClientsSpecified { + get { return this.canManageClientsFieldSpecified; } + set { this.canManageClientsFieldSpecified = value; } + } + + public bool testAccount { + get { return this.testAccountField; } + set { + this.testAccountField = value; + this.testAccountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool testAccountSpecified { + get { return this.testAccountFieldSpecified; } + set { this.testAccountFieldSpecified = value; } + } + + public bool autoTaggingEnabled { + get { return this.autoTaggingEnabledField; } + set { + this.autoTaggingEnabledField = value; + this.autoTaggingEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool autoTaggingEnabledSpecified { + get { return this.autoTaggingEnabledFieldSpecified; } + set { this.autoTaggingEnabledFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomerSyncServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/ch/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomerSyncService : AdWordsSoapClient, ICustomerSyncService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomerSyncService() { + this.Url = "https://adwords.google.com/api/adwords/ch/v201402/CustomerSyncService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/ch/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/ch/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomerChangeData get(CustomerSyncSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((CustomerChangeData) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/ch/v201402")] + public partial class FeedChangeData { + private long feedIdField; + + private bool feedIdFieldSpecified; + + private ChangeStatus feedChangeStatusField; + + private bool feedChangeStatusFieldSpecified; + + private long[] changedFeedItemsField; + + private long[] deletedFeedItemsField; + + public long feedId { + get { return this.feedIdField; } + set { + this.feedIdField = value; + this.feedIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedIdSpecified { + get { return this.feedIdFieldSpecified; } + set { this.feedIdFieldSpecified = value; } + } + + public ChangeStatus feedChangeStatus { + get { return this.feedChangeStatusField; } + set { + this.feedChangeStatusField = value; + this.feedChangeStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedChangeStatusSpecified { + get { return this.feedChangeStatusFieldSpecified; } + set { this.feedChangeStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedFeedItems")] + public long[] changedFeedItems { + get { return this.changedFeedItemsField; } + set { this.changedFeedItemsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deletedFeedItems")] + public long[] deletedFeedItems { + get { return this.deletedFeedItemsField; } + set { this.deletedFeedItemsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/ch/v201402")] + public enum ChangeStatus { + FIELDS_UNCHANGED, + FIELDS_CHANGED, + NEW + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/ch/v201402")] + public partial class AdGroupChangeData { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private ChangeStatus adGroupChangeStatusField; + + private bool adGroupChangeStatusFieldSpecified; + + private long[] changedAdsField; + + private long[] changedCriteriaField; + + private long[] deletedCriteriaField; + + private long[] changedFeedsField; + + private long[] deletedFeedsField; + + private long[] changedAdGroupBidModifierCriteriaField; + + private long[] deletedAdGroupBidModifierCriteriaField; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public ChangeStatus adGroupChangeStatus { + get { return this.adGroupChangeStatusField; } + set { + this.adGroupChangeStatusField = value; + this.adGroupChangeStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupChangeStatusSpecified { + get { return this.adGroupChangeStatusFieldSpecified; } + set { this.adGroupChangeStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedAds")] + public long[] changedAds { + get { return this.changedAdsField; } + set { this.changedAdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedCriteria")] + public long[] changedCriteria { + get { return this.changedCriteriaField; } + set { this.changedCriteriaField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deletedCriteria")] + public long[] deletedCriteria { + get { return this.deletedCriteriaField; } + set { this.deletedCriteriaField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedFeeds")] + public long[] changedFeeds { + get { return this.changedFeedsField; } + set { this.changedFeedsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deletedFeeds")] + public long[] deletedFeeds { + get { return this.deletedFeedsField; } + set { this.deletedFeedsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedAdGroupBidModifierCriteria")] + public long[] changedAdGroupBidModifierCriteria { + get { return this.changedAdGroupBidModifierCriteriaField; } + set { this.changedAdGroupBidModifierCriteriaField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deletedAdGroupBidModifierCriteria")] + public long[] deletedAdGroupBidModifierCriteria { + get { return this.deletedAdGroupBidModifierCriteriaField; } + set { this.deletedAdGroupBidModifierCriteriaField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/ch/v201402")] + public partial class CampaignChangeData { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private ChangeStatus campaignChangeStatusField; + + private bool campaignChangeStatusFieldSpecified; + + private AdGroupChangeData[] changedAdGroupsField; + + private long[] addedCampaignCriteriaField; + + private long[] deletedCampaignCriteriaField; + + private long[] addedAdExtensionsField; + + private long[] deletedAdExtensionsField; + + private long[] changedFeedsField; + + private long[] deletedFeedsField; + + private bool campaignTargetingChangedField; + + private bool campaignTargetingChangedFieldSpecified; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public ChangeStatus campaignChangeStatus { + get { return this.campaignChangeStatusField; } + set { + this.campaignChangeStatusField = value; + this.campaignChangeStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignChangeStatusSpecified { + get { return this.campaignChangeStatusFieldSpecified; } + set { this.campaignChangeStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedAdGroups")] + public AdGroupChangeData[] changedAdGroups { + get { return this.changedAdGroupsField; } + set { this.changedAdGroupsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("addedCampaignCriteria")] + public long[] addedCampaignCriteria { + get { return this.addedCampaignCriteriaField; } + set { this.addedCampaignCriteriaField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deletedCampaignCriteria")] + public long[] deletedCampaignCriteria { + get { return this.deletedCampaignCriteriaField; } + set { this.deletedCampaignCriteriaField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("addedAdExtensions")] + public long[] addedAdExtensions { + get { return this.addedAdExtensionsField; } + set { this.addedAdExtensionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deletedAdExtensions")] + public long[] deletedAdExtensions { + get { return this.deletedAdExtensionsField; } + set { this.deletedAdExtensionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedFeeds")] + public long[] changedFeeds { + get { return this.changedFeedsField; } + set { this.changedFeedsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deletedFeeds")] + public long[] deletedFeeds { + get { return this.deletedFeedsField; } + set { this.deletedFeedsField = value; } + } + + public bool campaignTargetingChanged { + get { return this.campaignTargetingChangedField; } + set { + this.campaignTargetingChangedField = value; + this.campaignTargetingChangedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignTargetingChangedSpecified { + get { return this.campaignTargetingChangedFieldSpecified; } + set { this.campaignTargetingChangedFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/ch/v201402")] + public partial class CustomerChangeData { + private CampaignChangeData[] changedCampaignsField; + + private FeedChangeData[] changedFeedsField; + + private string lastChangeTimestampField; + + [System.Xml.Serialization.XmlElementAttribute("changedCampaigns")] + public CampaignChangeData[] changedCampaigns { + get { return this.changedCampaignsField; } + set { this.changedCampaignsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedFeeds")] + public FeedChangeData[] changedFeeds { + get { return this.changedFeedsField; } + set { this.changedFeedsField = value; } + } + + public string lastChangeTimestamp { + get { return this.lastChangeTimestampField; } + set { this.lastChangeTimestampField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class DateTimeRange { + private string minField; + + private string maxField; + + public string min { + get { return this.minField; } + set { this.minField = value; } + } + + public string max { + get { return this.maxField; } + set { this.maxField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/ch/v201402")] + public partial class CustomerSyncSelector { + private DateTimeRange dateTimeRangeField; + + private long[] campaignIdsField; + + private long[] feedIdsField; + + public DateTimeRange dateTimeRange { + get { return this.dateTimeRangeField; } + set { this.dateTimeRangeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignIds")] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("feedIds")] + public long[] feedIds { + get { return this.feedIdsField; } + set { this.feedIdsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/ch/v201402")] + public partial class CustomerSyncError : ApiError { + private CustomerSyncErrorReason reasonField; + + private bool reasonFieldSpecified; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + public CustomerSyncErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomerSyncError.Reason", Namespace = "https://adwords.google.com/api/adwords/ch/v201402")] + public enum CustomerSyncErrorReason { + INVALID_CAMPAIGN_ID, + INVALID_FEED_ID, + INVALID_DATE_RANGE, + TOO_MANY_CHANGES + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomerFeedServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomerFeedService : AdWordsSoapClient, ICustomerFeedService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomerFeedService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/CustomerFeedService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomerFeedPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((CustomerFeedPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomerFeedReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +CustomerFeedOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((CustomerFeedReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomerFeedPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((CustomerFeedPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CustomerFeedReturnValue : ListReturnValue { + private CustomerFeed[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public CustomerFeed[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CustomerFeed { + private long feedIdField; + + private bool feedIdFieldSpecified; + + private Function matchingFunctionField; + + private int[] placeholderTypesField; + + private CustomerFeedStatus statusField; + + private bool statusFieldSpecified; + + public long feedId { + get { return this.feedIdField; } + set { + this.feedIdField = value; + this.feedIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedIdSpecified { + get { return this.feedIdFieldSpecified; } + set { this.feedIdFieldSpecified = value; } + } + + public Function matchingFunction { + get { return this.matchingFunctionField; } + set { this.matchingFunctionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("placeholderTypes")] + public int[] placeholderTypes { + get { return this.placeholderTypesField; } + set { this.placeholderTypesField = value; } + } + + public CustomerFeedStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomerFeed.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum CustomerFeedStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CustomerFeedOperation : Operation { + private CustomerFeed operandField; + + public CustomerFeed operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CustomerFeedPage : NullStatsPage { + private CustomerFeed[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public CustomerFeed[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CustomerFeedError : ApiError { + private CustomerFeedErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomerFeedErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomerFeedError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum CustomerFeedErrorReason { + FEED_ALREADY_EXISTS_FOR_PLACEHOLDER_TYPE, + INVALID_ID, + CANNOT_ADD_ALREADY_EXISTING_CUSTOMER_FEED, + CANNOT_MODIFY_DELETED_CUSTOMER_FEED, + INVALID_PLACEHOLDER_TYPES, + MISSING_FEEDMAPPING_FOR_PLACEHOLDER_TYPE, + PLACEHOLDER_TYPE_NOT_ALLOWED_ON_CUSTOMER_FEED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdGroupAdServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdGroupAdService : AdWordsSoapClient, IAdGroupAdService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdGroupAdService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/AdGroupAdService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupAdPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((AdGroupAdPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupAdReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +AdGroupAdOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((AdGroupAdReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupAdPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((AdGroupAdPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupAdReturnValue : ListReturnValue { + private AdGroupAd[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdGroupAd[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupAd { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private Ad adField; + + private AdGroupAdExperimentData experimentDataField; + + private AdGroupAdStatus statusField; + + private bool statusFieldSpecified; + + private AdGroupAdApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + private string[] disapprovalReasonsField; + + private bool trademarkDisapprovedField; + + private bool trademarkDisapprovedFieldSpecified; + + private String_StringMapEntry[] forwardCompatibilityMapField; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public Ad ad { + get { return this.adField; } + set { this.adField = value; } + } + + public AdGroupAdExperimentData experimentData { + get { return this.experimentDataField; } + set { this.experimentDataField = value; } + } + + public AdGroupAdStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public AdGroupAdApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("disapprovalReasons")] + public string[] disapprovalReasons { + get { return this.disapprovalReasonsField; } + set { this.disapprovalReasonsField = value; } + } + + public bool trademarkDisapproved { + get { return this.trademarkDisapprovedField; } + set { + this.trademarkDisapprovedField = value; + this.trademarkDisapprovedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool trademarkDisapprovedSpecified { + get { return this.trademarkDisapprovedFieldSpecified; } + set { this.trademarkDisapprovedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("forwardCompatibilityMap")] + public String_StringMapEntry[] forwardCompatibilityMap { + get { return this.forwardCompatibilityMapField; } + set { this.forwardCompatibilityMapField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DynamicSearchAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TextAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TemplateAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ThirdPartyRedirectAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileImageAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeprecatedAd))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Ad { + private long idField; + + private bool idFieldSpecified; + + private string urlField; + + private string displayUrlField; + + private long devicePreferenceField; + + private bool devicePreferenceFieldSpecified; + + private string adTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + + public string displayUrl { + get { return this.displayUrlField; } + set { this.displayUrlField = value; } + } + + public long devicePreference { + get { return this.devicePreferenceField; } + set { + this.devicePreferenceField = value; + this.devicePreferenceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool devicePreferenceSpecified { + get { return this.devicePreferenceFieldSpecified; } + set { this.devicePreferenceFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Ad.Type")] + public string AdType { + get { return this.adTypeField; } + set { this.adTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class DynamicSearchAd : Ad { + private string description1Field; + + private string description2Field; + + public string description1 { + get { return this.description1Field; } + set { this.description1Field = value; } + } + + public string description2 { + get { return this.description2Field; } + set { this.description2Field = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class TextAd : Ad { + private string headlineField; + + private string description1Field; + + private string description2Field; + + public string headline { + get { return this.headlineField; } + set { this.headlineField = value; } + } + + public string description1 { + get { return this.description1Field; } + set { this.description1Field = value; } + } + + public string description2 { + get { return this.description2Field; } + set { this.description2Field = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class TemplateAd : Ad { + private long templateIdField; + + private bool templateIdFieldSpecified; + + private AdUnionId adUnionIdField; + + private TemplateElement[] templateElementsField; + + private Image adAsImageField; + + private Dimensions dimensionsField; + + private string nameField; + + private int durationField; + + private bool durationFieldSpecified; + + private long originAdIdField; + + private bool originAdIdFieldSpecified; + + public long templateId { + get { return this.templateIdField; } + set { + this.templateIdField = value; + this.templateIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool templateIdSpecified { + get { return this.templateIdFieldSpecified; } + set { this.templateIdFieldSpecified = value; } + } + + public AdUnionId adUnionId { + get { return this.adUnionIdField; } + set { this.adUnionIdField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("templateElements")] + public TemplateElement[] templateElements { + get { return this.templateElementsField; } + set { this.templateElementsField = value; } + } + + public Image adAsImage { + get { return this.adAsImageField; } + set { this.adAsImageField = value; } + } + + public Dimensions dimensions { + get { return this.dimensionsField; } + set { this.dimensionsField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public long originAdId { + get { return this.originAdIdField; } + set { + this.originAdIdField = value; + this.originAdIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool originAdIdSpecified { + get { return this.originAdIdFieldSpecified; } + set { this.originAdIdFieldSpecified = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TempAdUnionId))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdUnionId { + private long idField; + + private bool idFieldSpecified; + + private string adUnionIdTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("AdUnionId.Type")] + public string AdUnionIdType { + get { return this.adUnionIdTypeField; } + set { this.adUnionIdTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class TempAdUnionId : AdUnionId { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class TemplateElement { + private string uniqueNameField; + + private TemplateElementField[] fieldsField; + + public string uniqueName { + get { return this.uniqueNameField; } + set { this.uniqueNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("fields")] + public TemplateElementField[] fields { + get { return this.fieldsField; } + set { this.fieldsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class TemplateElementField { + private string nameField; + + private TemplateElementFieldType typeField; + + private bool typeFieldSpecified; + + private string fieldTextField; + + private Media fieldMediaField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public TemplateElementFieldType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public string fieldText { + get { return this.fieldTextField; } + set { this.fieldTextField = value; } + } + + public Media fieldMedia { + get { return this.fieldMediaField; } + set { this.fieldMediaField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TemplateElementField.Type", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum TemplateElementFieldType { + ADDRESS, + AUDIO, + ENUM, + IMAGE, + BACKGROUND_IMAGE, + NUMBER, + TEXT, + URL, + VIDEO, + VISIBLE_URL, + UNKNOWN + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Video))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Image))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Audio))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Media { + private long mediaIdField; + + private bool mediaIdFieldSpecified; + + private MediaMediaType typeField; + + private bool typeFieldSpecified; + + private long referenceIdField; + + private bool referenceIdFieldSpecified; + + private Media_Size_DimensionsMapEntry[] dimensionsField; + + private Media_Size_StringMapEntry[] urlsField; + + private MediaMimeType mimeTypeField; + + private bool mimeTypeFieldSpecified; + + private string sourceUrlField; + + private string nameField; + + private long fileSizeField; + + private bool fileSizeFieldSpecified; + + private string creationTimeField; + + private string mediaTypeField; + + public long mediaId { + get { return this.mediaIdField; } + set { + this.mediaIdField = value; + this.mediaIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mediaIdSpecified { + get { return this.mediaIdFieldSpecified; } + set { this.mediaIdFieldSpecified = value; } + } + + public MediaMediaType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public long referenceId { + get { return this.referenceIdField; } + set { + this.referenceIdField = value; + this.referenceIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool referenceIdSpecified { + get { return this.referenceIdFieldSpecified; } + set { this.referenceIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("dimensions")] + public Media_Size_DimensionsMapEntry[] dimensions { + get { return this.dimensionsField; } + set { this.dimensionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("urls")] + public Media_Size_StringMapEntry[] urls { + get { return this.urlsField; } + set { this.urlsField = value; } + } + + public MediaMimeType mimeType { + get { return this.mimeTypeField; } + set { + this.mimeTypeField = value; + this.mimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mimeTypeSpecified { + get { return this.mimeTypeFieldSpecified; } + set { this.mimeTypeFieldSpecified = value; } + } + + public string sourceUrl { + get { return this.sourceUrlField; } + set { this.sourceUrlField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public long fileSize { + get { return this.fileSizeField; } + set { + this.fileSizeField = value; + this.fileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fileSizeSpecified { + get { return this.fileSizeFieldSpecified; } + set { this.fileSizeFieldSpecified = value; } + } + + public string creationTime { + get { return this.creationTimeField; } + set { this.creationTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Media.Type")] + public string MediaType { + get { return this.mediaTypeField; } + set { this.mediaTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Media.MediaType", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum MediaMediaType { + AUDIO, + DYNAMIC_IMAGE, + ICON, + IMAGE, + STANDARD_ICON, + VIDEO + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Media_Size_DimensionsMapEntry { + private MediaSize keyField; + + private bool keyFieldSpecified; + + private Dimensions valueField; + + public MediaSize key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public Dimensions value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Media.Size", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum MediaSize { + FULL, + SHRUNKEN, + PREVIEW, + VIDEO_THUMBNAIL + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Dimensions { + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Media_Size_StringMapEntry { + private MediaSize keyField; + + private bool keyFieldSpecified; + + private string valueField; + + public MediaSize key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Media.MimeType", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum MediaMimeType { + IMAGE_JPEG, + IMAGE_GIF, + IMAGE_PNG, + FLASH, + TEXT_HTML, + PDF, + MSWORD, + MSEXCEL, + RTF, + AUDIO_WAV, + AUDIO_MP3 + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Video : Media { + private long durationMillisField; + + private bool durationMillisFieldSpecified; + + private string streamingUrlField; + + private bool readyToPlayOnTheWebField; + + private bool readyToPlayOnTheWebFieldSpecified; + + private string industryStandardCommercialIdentifierField; + + private string advertisingIdField; + + private string youTubeVideoIdStringField; + + public long durationMillis { + get { return this.durationMillisField; } + set { + this.durationMillisField = value; + this.durationMillisSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationMillisSpecified { + get { return this.durationMillisFieldSpecified; } + set { this.durationMillisFieldSpecified = value; } + } + + public string streamingUrl { + get { return this.streamingUrlField; } + set { this.streamingUrlField = value; } + } + + public bool readyToPlayOnTheWeb { + get { return this.readyToPlayOnTheWebField; } + set { + this.readyToPlayOnTheWebField = value; + this.readyToPlayOnTheWebSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool readyToPlayOnTheWebSpecified { + get { return this.readyToPlayOnTheWebFieldSpecified; } + set { this.readyToPlayOnTheWebFieldSpecified = value; } + } + + public string industryStandardCommercialIdentifier { + get { return this.industryStandardCommercialIdentifierField; } + set { this.industryStandardCommercialIdentifierField = value; } + } + + public string advertisingId { + get { return this.advertisingIdField; } + set { this.advertisingIdField = value; } + } + + public string youTubeVideoIdString { + get { return this.youTubeVideoIdStringField; } + set { this.youTubeVideoIdStringField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Image : Media { + private byte[] dataField; + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] data { + get { return this.dataField; } + set { this.dataField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Audio : Media { + private long durationMillisField; + + private bool durationMillisFieldSpecified; + + private string streamingUrlField; + + private bool readyToPlayOnTheWebField; + + private bool readyToPlayOnTheWebFieldSpecified; + + public long durationMillis { + get { return this.durationMillisField; } + set { + this.durationMillisField = value; + this.durationMillisSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationMillisSpecified { + get { return this.durationMillisFieldSpecified; } + set { this.durationMillisFieldSpecified = value; } + } + + public string streamingUrl { + get { return this.streamingUrlField; } + set { this.streamingUrlField = value; } + } + + public bool readyToPlayOnTheWeb { + get { return this.readyToPlayOnTheWebField; } + set { + this.readyToPlayOnTheWebField = value; + this.readyToPlayOnTheWebSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool readyToPlayOnTheWebSpecified { + get { return this.readyToPlayOnTheWebFieldSpecified; } + set { this.readyToPlayOnTheWebFieldSpecified = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ThirdPartyRedirectAd))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public abstract partial class RichMediaAd : Ad { + private string nameField; + + private Dimensions dimensionsField; + + private string snippetField; + + private string impressionBeaconUrlField; + + private int adDurationField; + + private bool adDurationFieldSpecified; + + private long certifiedVendorFormatIdField; + + private bool certifiedVendorFormatIdFieldSpecified; + + private string sourceUrlField; + + private RichMediaAdRichMediaAdType richMediaAdTypeField; + + private bool richMediaAdTypeFieldSpecified; + + private RichMediaAdAdAttribute[] adAttributesField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public Dimensions dimensions { + get { return this.dimensionsField; } + set { this.dimensionsField = value; } + } + + public string snippet { + get { return this.snippetField; } + set { this.snippetField = value; } + } + + public string impressionBeaconUrl { + get { return this.impressionBeaconUrlField; } + set { this.impressionBeaconUrlField = value; } + } + + public int adDuration { + get { return this.adDurationField; } + set { + this.adDurationField = value; + this.adDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adDurationSpecified { + get { return this.adDurationFieldSpecified; } + set { this.adDurationFieldSpecified = value; } + } + + public long certifiedVendorFormatId { + get { return this.certifiedVendorFormatIdField; } + set { + this.certifiedVendorFormatIdField = value; + this.certifiedVendorFormatIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool certifiedVendorFormatIdSpecified { + get { return this.certifiedVendorFormatIdFieldSpecified; } + set { this.certifiedVendorFormatIdFieldSpecified = value; } + } + + public string sourceUrl { + get { return this.sourceUrlField; } + set { this.sourceUrlField = value; } + } + + public RichMediaAdRichMediaAdType richMediaAdType { + get { return this.richMediaAdTypeField; } + set { + this.richMediaAdTypeField = value; + this.richMediaAdTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool richMediaAdTypeSpecified { + get { return this.richMediaAdTypeFieldSpecified; } + set { this.richMediaAdTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adAttributes")] + public RichMediaAdAdAttribute[] adAttributes { + get { return this.adAttributesField; } + set { this.adAttributesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaAd.RichMediaAdType", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum RichMediaAdRichMediaAdType { + STANDARD, + IN_STREAM_VIDEO + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaAd.AdAttribute", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum RichMediaAdAdAttribute { + UNKNOWN, + ROLL_OVER_TO_EXPAND, + SSL + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ThirdPartyRedirectAd : RichMediaAd { + private bool isCookieTargetedField; + + private bool isCookieTargetedFieldSpecified; + + private bool isUserInterestTargetedField; + + private bool isUserInterestTargetedFieldSpecified; + + private bool isTaggedField; + + private bool isTaggedFieldSpecified; + + private VideoType[] videoTypesField; + + private ThirdPartyRedirectAdExpandingDirection[] expandingDirectionsField; + + public bool isCookieTargeted { + get { return this.isCookieTargetedField; } + set { + this.isCookieTargetedField = value; + this.isCookieTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isCookieTargetedSpecified { + get { return this.isCookieTargetedFieldSpecified; } + set { this.isCookieTargetedFieldSpecified = value; } + } + + public bool isUserInterestTargeted { + get { return this.isUserInterestTargetedField; } + set { + this.isUserInterestTargetedField = value; + this.isUserInterestTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isUserInterestTargetedSpecified { + get { return this.isUserInterestTargetedFieldSpecified; } + set { this.isUserInterestTargetedFieldSpecified = value; } + } + + public bool isTagged { + get { return this.isTaggedField; } + set { + this.isTaggedField = value; + this.isTaggedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTaggedSpecified { + get { return this.isTaggedFieldSpecified; } + set { this.isTaggedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("videoTypes")] + public VideoType[] videoTypes { + get { return this.videoTypesField; } + set { this.videoTypesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("expandingDirections")] + public ThirdPartyRedirectAdExpandingDirection[] expandingDirections { + get { return this.expandingDirectionsField; } + set { this.expandingDirectionsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum VideoType { + ADOBE, + REALPLAYER, + QUICKTIME, + WINDOWSMEDIA + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ThirdPartyRedirectAd.ExpandingDirection", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ThirdPartyRedirectAdExpandingDirection { + UNKNOWN, + EXPANDING_UP, + EXPANDING_DOWN, + EXPANDING_LEFT, + EXPANDING_RIGHT, + EXPANDING_UPLEFT, + EXPANDING_UPRIGHT, + EXPANDING_DOWNLEFT, + EXPANDING_DOWNRIGHT + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ProductAd : Ad { + private string promotionLineField; + + public string promotionLine { + get { return this.promotionLineField; } + set { this.promotionLineField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class MobileImageAd : Ad { + private MarkupLanguageType[] markupLanguagesField; + + private string[] mobileCarriersField; + + private Image imageField; + + [System.Xml.Serialization.XmlElementAttribute("markupLanguages")] + public MarkupLanguageType[] markupLanguages { + get { return this.markupLanguagesField; } + set { this.markupLanguagesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("mobileCarriers")] + public string[] mobileCarriers { + get { return this.mobileCarriersField; } + set { this.mobileCarriersField = value; } + } + + public Image image { + get { return this.imageField; } + set { this.imageField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum MarkupLanguageType { + HTML, + CHTML, + XHTML, + WML + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class MobileAd : Ad { + private string headlineField; + + private string descriptionField; + + private MarkupLanguageType[] markupLanguagesField; + + private string[] mobileCarriersField; + + private string businessNameField; + + private string countryCodeField; + + private string phoneNumberField; + + public string headline { + get { return this.headlineField; } + set { this.headlineField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("markupLanguages")] + public MarkupLanguageType[] markupLanguages { + get { return this.markupLanguagesField; } + set { this.markupLanguagesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("mobileCarriers")] + public string[] mobileCarriers { + get { return this.mobileCarriersField; } + set { this.mobileCarriersField = value; } + } + + public string businessName { + get { return this.businessNameField; } + set { this.businessNameField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + + public string phoneNumber { + get { return this.phoneNumberField; } + set { this.phoneNumberField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ImageAd : Ad { + private Image imageField; + + private string nameField; + + private long adToCopyImageFromField; + + private bool adToCopyImageFromFieldSpecified; + + public Image image { + get { return this.imageField; } + set { this.imageField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public long adToCopyImageFrom { + get { return this.adToCopyImageFromField; } + set { + this.adToCopyImageFromField = value; + this.adToCopyImageFromSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adToCopyImageFromSpecified { + get { return this.adToCopyImageFromFieldSpecified; } + set { this.adToCopyImageFromFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class DeprecatedAd : Ad { + private string nameField; + + private DeprecatedAdType typeField; + + private bool typeFieldSpecified; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DeprecatedAdType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DeprecatedAd.Type", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum DeprecatedAdType { + VIDEO, + CLICK_TO_CALL, + IN_STREAM_VIDEO, + FROOGLE, + TEXT_LINK, + GADGET, + PRINT, + TEXT_WIDE, + GADGET_TEMPLATE, + TEXT_WITH_VIDEO, + AUDIO, + LOCAL_BUSINESS_AD, + AUDIO_TEMPLATE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupAdExperimentData { + private long experimentIdField; + + private bool experimentIdFieldSpecified; + + private ExperimentDeltaStatus experimentDeltaStatusField; + + private bool experimentDeltaStatusFieldSpecified; + + private ExperimentDataStatus experimentDataStatusField; + + private bool experimentDataStatusFieldSpecified; + + public long experimentId { + get { return this.experimentIdField; } + set { + this.experimentIdField = value; + this.experimentIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentIdSpecified { + get { return this.experimentIdFieldSpecified; } + set { this.experimentIdFieldSpecified = value; } + } + + public ExperimentDeltaStatus experimentDeltaStatus { + get { return this.experimentDeltaStatusField; } + set { + this.experimentDeltaStatusField = value; + this.experimentDeltaStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentDeltaStatusSpecified { + get { return this.experimentDeltaStatusFieldSpecified; } + set { this.experimentDeltaStatusFieldSpecified = value; } + } + + public ExperimentDataStatus experimentDataStatus { + get { return this.experimentDataStatusField; } + set { + this.experimentDataStatusField = value; + this.experimentDataStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentDataStatusSpecified { + get { return this.experimentDataStatusFieldSpecified; } + set { this.experimentDataStatusFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ExperimentDeltaStatus { + EXPERIMENT_ONLY, + MODIFIED, + CONTROL_ONLY, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ExperimentDataStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupAd.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdGroupAdStatus { + ENABLED, + PAUSED, + DISABLED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupAd.ApprovalStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdGroupAdApprovalStatus { + APPROVED, + DISAPPROVED, + FAMILY_SAFE, + NON_FAMILY_SAFE, + PORN, + UNCHECKED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionPolicyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdParamPolicyError))] + public partial class PolicyViolationError : ApiError { + private PolicyViolationKey keyField; + + private string externalPolicyNameField; + + private string externalPolicyUrlField; + + private string externalPolicyDescriptionField; + + private bool isExemptableField; + + private bool isExemptableFieldSpecified; + + private PolicyViolationErrorPart[] violatingPartsField; + + public PolicyViolationKey key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public string externalPolicyName { + get { return this.externalPolicyNameField; } + set { this.externalPolicyNameField = value; } + } + + public string externalPolicyUrl { + get { return this.externalPolicyUrlField; } + set { this.externalPolicyUrlField = value; } + } + + public string externalPolicyDescription { + get { return this.externalPolicyDescriptionField; } + set { this.externalPolicyDescriptionField = value; } + } + + public bool isExemptable { + get { return this.isExemptableField; } + set { + this.isExemptableField = value; + this.isExemptableSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isExemptableSpecified { + get { return this.isExemptableFieldSpecified; } + set { this.isExemptableFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("violatingParts")] + public PolicyViolationErrorPart[] violatingParts { + get { return this.violatingPartsField; } + set { this.violatingPartsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class PolicyViolationKey { + private string policyNameField; + + private string violatingTextField; + + public string policyName { + get { return this.policyNameField; } + set { this.policyNameField = value; } + } + + public string violatingText { + get { return this.violatingTextField; } + set { this.violatingTextField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PolicyViolationError.Part", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class PolicyViolationErrorPart { + private int indexField; + + private bool indexFieldSpecified; + + private int lengthField; + + private bool lengthFieldSpecified; + + public int index { + get { return this.indexField; } + set { + this.indexField = value; + this.indexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool indexSpecified { + get { return this.indexFieldSpecified; } + set { this.indexFieldSpecified = value; } + } + + public int length { + get { return this.lengthField; } + set { + this.lengthField = value; + this.lengthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lengthSpecified { + get { return this.lengthFieldSpecified; } + set { this.lengthFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class MediaError : ApiError { + private MediaErrorReason reasonField; + + private bool reasonFieldSpecified; + + public MediaErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "MediaError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum MediaErrorReason { + CANNOT_ADD_STANDARD_ICON, + CANNOT_SELECT_STANDARD_ICON_WITH_OTHER_TYPES, + DUPLICATE_MEDIA, + EMPTY_FIELD, + ENTITY_REFERENCED_IN_MULTIPLE_OPS, + FIELD_NOT_SUPPORTED_FOR_MEDIA_SUB_TYPE, + INVALID_MEDIA_ID, + INVALID_MEDIA_TYPE, + INVALID_MEDIA_SUB_TYPE, + INVALID_REFERENCE_ID, + INVALID_YOU_TUBE_ID, + YOU_TUBE_VIDEO_NOT_FOUND, + YOU_TUBE_SERVICE_UNAVAILABLE, + YOU_TUBE_VIDEO_HAS_NON_POSITIVE_DURATION, + MEDIA_FAILED_TRANSCODING, + MEDIA_NOT_TRANSCODED, + MEDIA_TYPE_DOES_NOT_MATCH_OBJECT_TYPE, + NO_FIELDS_SPECIFIED, + NULL_REFERENCE_ID_AND_MEDIA_ID, + TOO_LONG, + UNSUPPORTED_OPERATION, + UNSUPPORTED_TYPE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ImageError : ApiError { + private ImageErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ImageErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ImageError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ImageErrorReason { + INVALID_IMAGE, + STORAGE_ERROR, + BAD_REQUEST, + UNEXPECTED_SIZE, + ANIMATED_NOT_ALLOWED, + ANIMATION_TOO_LONG, + SERVER_ERROR, + CMYK_JPEG_NOT_ALLOWED, + FLASH_NOT_ALLOWED, + FLASH_WITHOUT_CLICKTAG, + FLASH_ERROR_AFTER_FIXING_CLICK_TAG, + ANIMATED_VISUAL_EFFECT, + FLASH_ERROR, + LAYOUT_PROBLEM, + PROBLEM_READING_IMAGE_FILE, + ERROR_STORING_IMAGE, + FLASH_HAS_NETWORK_OBJECTS, + FLASH_HAS_NETWORK_METHODS, + FLASH_HAS_URL, + FLASH_HAS_MOUSE_TRACKING, + FLASH_HAS_RANDOM_NUM, + FLASH_SELF_TARGETS, + FLASH_BAD_GETURL_TARGET, + FLASH_VERSION_NOT_SUPPORTED, + FLASH_WITHOUT_HARD_CODED_CLICK_URL, + INVALID_FLASH_FILE, + FAILED_TO_FIX_CLICK_TAG_IN_FLASH, + FLASH_ACCESSES_NETWORK_RESOURCES, + FLASH_EXTERNAL_JS_CALL, + FLASH_EXTERNAL_FS_CALL, + FILE_TOO_LARGE, + IMAGE_DATA_TOO_LARGE, + IMAGE_PROCESSING_ERROR, + IMAGE_TOO_SMALL, + INVALID_INPUT, + PROBLEM_READING_FILE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ExperimentError : ApiError { + private ExperimentErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ExperimentErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ExperimentError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ExperimentErrorReason { + EXPERIMENT_DELTA_STATUS_NOT_SPECIFIED, + EXPERIMENT_DELTA_STATUS_NOT_ALLOWED, + EXPERIMENT_STATUS_NOT_ALLOWED, + EXPERIMENT_NOT_ALLOWED_FOR_BIDDING_STRATEGY, + EXPERIMENT_NOT_ALLOWED_FOR_CRITERION_TYPE, + EXPERIMENT_NOT_ACTIVE, + INVALID_EXPERIMENT_ID, + EXPERIMENT_ID_NOT_SPECIFIED_WITH_SEGMENTATION_CRITERIA, + TOO_MANY_CHANGES_TO_EXPERIMENT, + EXPERIMENT_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupAdCountLimitExceeded : EntityCountLimitExceeded { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupAdError : ApiError { + private AdGroupAdErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdGroupAdErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupAdError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdGroupAdErrorReason { + AD_NOT_UNDER_ADGROUP, + CANNOT_OPERATE_ON_DELETED_ADGROUPAD, + CANNOT_CREATE_DEPRECATED_ADS, + EMPTY_FIELD, + ENTITY_REFERENCED_IN_MULTIPLE_OPS, + UNSUPPORTED_OPERATION + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdError : ApiError { + private AdErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdErrorReason { + APPROXIMATELY_TOO_LONG, + APPROXIMATELY_TOO_SHORT, + BAD_SNIPPET, + CANNOT_SET_BUSINESS_NAME_IF_URL_SET, + CANNOT_SET_FIELD_WITH_ORIGIN_AD_ID_SET, + CANNOT_SET_URL, + CUSTOMER_NOT_APPROVED_MOBILEADS, + CUSTOMER_NOT_APPROVED_THIRDPARTY_ADS, + CUSTOMER_NOT_APPROVED_THIRDPARTY_REDIRECT_ADS, + CUSTOMER_NOT_ELIGIBLE, + CUSTOMER_NOT_ELIGIBLE_FOR_UPDATING_BEACON_URL, + DIMENSION_ALREADY_IN_UNION, + DIMENSION_MUST_BE_SET, + DIMENSION_NOT_IN_UNION, + DISPLAY_URL_CANNOT_BE_SPECIFIED, + DOMESTIC_PHONE_NUMBER_FORMAT, + EMERGENCY_PHONE_NUMBER, + EMPTY_FIELD, + INCONSISTENT_STATUS_IN_TEMPLATE_UNION, + INCORRECT_LENGTH, + INVALID_AD_ADDRESS_CAMPAIGN_TARGET, + INVALID_AD_TYPE, + INVALID_ATTRIBUTES_FOR_MOBILE_IMAGE, + INVALID_ATTRIBUTES_FOR_MOBILE_TEXT, + INVALID_CHARACTER_FOR_URL, + INVALID_COUNTRY_CODE, + INVALID_DSA_URL_TAG, + INVALID_INPUT, + INVALID_MARKUP_LANGUAGE, + INVALID_MOBILE_CARRIER, + INVALID_MOBILE_CARRIER_TARGET, + INVALID_NUMBER_OF_ELEMENTS, + INVALID_PHONE_NUMBER_FORMAT, + INVALID_RICH_MEDIA_CERTIFIED_VENDOR_FORMAT_ID, + INVALID_TEMPLATE_DATA, + INVALID_TEMPLATE_ELEMENT_FIELD_TYPE, + INVALID_TEMPLATE_ID, + LINE_TOO_WIDE, + MARKUP_LANGUAGES_PRESENT, + MISSING_ADDRESS_COMPONENT, + MISSING_ADVERTISEMENT_NAME, + MISSING_BUSINESS_NAME, + MISSING_DESCRIPTION1, + MISSING_DESCRIPTION2, + MISSING_DESTINATION_URL, + MISSING_DESTINATION_URL_TAG, + MISSING_DIMENSION, + MISSING_DISPLAY_URL, + MISSING_HEADLINE, + MISSING_HEIGHT, + MISSING_IMAGE, + MISSING_MARKUP_LANGUAGES, + MISSING_MOBILE_CARRIER, + MISSING_PHONE, + MISSING_REQUIRED_TEMPLATE_FIELDS, + MISSING_TEMPLATE_FIELD_VALUE, + MISSING_TEXT, + MISSING_URL_AND_PHONE, + MISSING_VISIBLE_URL, + MISSING_WIDTH, + MUST_USE_TEMP_AD_UNION_ID_ON_ADD, + TOO_LONG, + TOO_SHORT, + UNION_DIMENSIONS_CANNOT_CHANGE, + UNKNOWN_ADDRESS_COMPONENT, + UNKNOWN_FIELD_NAME, + UNKNOWN_UNIQUE_NAME, + UNSUPPORTED_DIMENSIONS, + URL_INVALID_SCHEME, + URL_INVALID_TOP_LEVEL_DOMAIN, + URL_MALFORMED, + URL_NO_HOST, + URL_HOST_NAME_TOO_LONG, + URL_NO_SCHEME, + URL_NO_TOP_LEVEL_DOMAIN, + URL_PATH_NOT_ALLOWED, + URL_PORT_NOT_ALLOWED, + URL_QUERY_NOT_ALLOWED, + URL_SCHEME_BEFORE_DSA_TAG, + USER_DOES_NOT_HAVE_ACCESS_TO_TEMPLATE, + INCONSISTENT_EXPANDABLE_SETTINGS, + INVALID_FORMAT, + INVALID_FIELD_TEXT, + ELEMENT_NOT_PRESENT, + IMAGE_ERROR, + VALUE_NOT_IN_RANGE, + FIELD_NOT_PRESENT, + ADDRESS_NOT_COMPLETE, + ADDRESS_INVALID, + VIDEO_RETRIEVAL_ERROR, + AUDIO_ERROR, + INVALID_YOUTUBE_DISPLAY_URL, + INCOMPATIBLE_AD_TYPE_AND_DEVICE_PREFERENCE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ExemptionRequest { + private PolicyViolationKey keyField; + + public PolicyViolationKey key { + get { return this.keyField; } + set { this.keyField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupAdOperation : Operation { + private AdGroupAd operandField; + + private ExemptionRequest[] exemptionRequestsField; + + public AdGroupAd operand { + get { return this.operandField; } + set { this.operandField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("exemptionRequests")] + public ExemptionRequest[] exemptionRequests { + get { return this.exemptionRequestsField; } + set { this.exemptionRequestsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupAdPage : Page { + private AdGroupAd[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public AdGroupAd[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "DataServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DataEntry))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class DataService : AdWordsSoapClient, IDataService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public DataService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/DataService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupBidLandscapePage getAdGroupBidLandscape(Selector serviceSelector) { + object[] results = this.Invoke("getAdGroupBidLandscape", new object[] { serviceSelector }); + return ((AdGroupBidLandscapePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CriterionBidLandscapePage getCriterionBidLandscape(Selector serviceSelector) { + object[] results = this.Invoke("getCriterionBidLandscape", new object[] { serviceSelector }); + return ((CriterionBidLandscapePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupBidLandscapePage queryAdGroupBidLandscape(string query) { + object[] results = this.Invoke("queryAdGroupBidLandscape", new object[] { query }); + return ((AdGroupBidLandscapePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CriterionBidLandscapePage queryCriterionBidLandscape(string query) { + object[] results = this.Invoke("queryCriterionBidLandscape", new object[] { query }); + return ((CriterionBidLandscapePage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BidLandscape.LandscapePoint", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class BidLandscapeLandscapePoint { + private Money bidField; + + private long clicksField; + + private bool clicksFieldSpecified; + + private Money costField; + + private Money marginalCpcField; + + private long impressionsField; + + private bool impressionsFieldSpecified; + + private long promotedImpressionsField; + + private bool promotedImpressionsFieldSpecified; + + public Money bid { + get { return this.bidField; } + set { this.bidField = value; } + } + + public long clicks { + get { return this.clicksField; } + set { + this.clicksField = value; + this.clicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clicksSpecified { + get { return this.clicksFieldSpecified; } + set { this.clicksFieldSpecified = value; } + } + + public Money cost { + get { return this.costField; } + set { this.costField = value; } + } + + public Money marginalCpc { + get { return this.marginalCpcField; } + set { this.marginalCpcField = value; } + } + + public long impressions { + get { return this.impressionsField; } + set { + this.impressionsField = value; + this.impressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsSpecified { + get { return this.impressionsFieldSpecified; } + set { this.impressionsFieldSpecified = value; } + } + + public long promotedImpressions { + get { return this.promotedImpressionsField; } + set { + this.promotedImpressionsField = value; + this.promotedImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool promotedImpressionsSpecified { + get { return this.promotedImpressionsFieldSpecified; } + set { this.promotedImpressionsFieldSpecified = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BidLandscape))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionBidLandscape))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupBidLandscape))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public abstract partial class DataEntry { + private string dataEntryTypeField; + + [System.Xml.Serialization.XmlElementAttribute("DataEntry.Type")] + public string DataEntryType { + get { return this.dataEntryTypeField; } + set { this.dataEntryTypeField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionBidLandscape))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupBidLandscape))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public abstract partial class BidLandscape : DataEntry { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private string startDateField; + + private string endDateField; + + private BidLandscapeLandscapePoint[] landscapePointsField; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public string startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public string endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("landscapePoints")] + public BidLandscapeLandscapePoint[] landscapePoints { + get { return this.landscapePointsField; } + set { this.landscapePointsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CriterionBidLandscape : BidLandscape { + private long criterionIdField; + + private bool criterionIdFieldSpecified; + + public long criterionId { + get { return this.criterionIdField; } + set { + this.criterionIdField = value; + this.criterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionIdSpecified { + get { return this.criterionIdFieldSpecified; } + set { this.criterionIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupBidLandscape : BidLandscape { + private AdGroupBidLandscapeType typeField; + + private bool typeFieldSpecified; + + private bool landscapeCurrentField; + + private bool landscapeCurrentFieldSpecified; + + public AdGroupBidLandscapeType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public bool landscapeCurrent { + get { return this.landscapeCurrentField; } + set { + this.landscapeCurrentField = value; + this.landscapeCurrentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool landscapeCurrentSpecified { + get { return this.landscapeCurrentFieldSpecified; } + set { this.landscapeCurrentFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupBidLandscape.Type", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdGroupBidLandscapeType { + UNIFORM, + DEFAULT, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CriterionBidLandscapePage : NoStatsPage { + private CriterionBidLandscape[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public CriterionBidLandscape[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupBidLandscapePage : NoStatsPage { + private AdGroupBidLandscape[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public AdGroupBidLandscape[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class DataError : ApiError { + private DataErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DataErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DataError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum DataErrorReason { + CANNOT_CREATE_TABLE_ENTRY, + NO_TABLE_ENTRY_CLASS_FOR_VIEW_TYPE, + TABLE_SERVICE_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ExperimentServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ExperimentService : AdWordsSoapClient, IExperimentService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ExperimentService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/ExperimentService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExperimentPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((ExperimentPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExperimentReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +ExperimentOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((ExperimentReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ExperimentReturnValue : ListReturnValue { + private Experiment[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public Experiment[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Experiment { + private long idField; + + private bool idFieldSpecified; + + private long controlIdField; + + private bool controlIdFieldSpecified; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private string nameField; + + private ExperimentStatus statusField; + + private bool statusFieldSpecified; + + private ExperimentServingStatus servingStatusField; + + private bool servingStatusFieldSpecified; + + private int queryPercentageField; + + private bool queryPercentageFieldSpecified; + + private string startDateTimeField; + + private string endDateTimeField; + + private string lastModifiedDateTimeField; + + private ExperimentSummaryStats experimentSummaryStatsField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long controlId { + get { return this.controlIdField; } + set { + this.controlIdField = value; + this.controlIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool controlIdSpecified { + get { return this.controlIdFieldSpecified; } + set { this.controlIdFieldSpecified = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ExperimentStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ExperimentServingStatus servingStatus { + get { return this.servingStatusField; } + set { + this.servingStatusField = value; + this.servingStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool servingStatusSpecified { + get { return this.servingStatusFieldSpecified; } + set { this.servingStatusFieldSpecified = value; } + } + + public int queryPercentage { + get { return this.queryPercentageField; } + set { + this.queryPercentageField = value; + this.queryPercentageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool queryPercentageSpecified { + get { return this.queryPercentageFieldSpecified; } + set { this.queryPercentageFieldSpecified = value; } + } + + public string startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public string endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public string lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public ExperimentSummaryStats experimentSummaryStats { + get { return this.experimentSummaryStatsField; } + set { this.experimentSummaryStatsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ExperimentStatus { + ACTIVE, + DELETED, + PROMOTED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ExperimentServingStatus { + RUNNING, + PENDING, + ENDED, + DELETED, + PROMOTED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ExperimentSummaryStats { + private int adGroupsCountField; + + private bool adGroupsCountFieldSpecified; + + private int adGroupCriteriaCountField; + + private bool adGroupCriteriaCountFieldSpecified; + + private int adGroupAdsCountField; + + private bool adGroupAdsCountFieldSpecified; + + public int adGroupsCount { + get { return this.adGroupsCountField; } + set { + this.adGroupsCountField = value; + this.adGroupsCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupsCountSpecified { + get { return this.adGroupsCountFieldSpecified; } + set { this.adGroupsCountFieldSpecified = value; } + } + + public int adGroupCriteriaCount { + get { return this.adGroupCriteriaCountField; } + set { + this.adGroupCriteriaCountField = value; + this.adGroupCriteriaCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupCriteriaCountSpecified { + get { return this.adGroupCriteriaCountFieldSpecified; } + set { this.adGroupCriteriaCountFieldSpecified = value; } + } + + public int adGroupAdsCount { + get { return this.adGroupAdsCountField; } + set { + this.adGroupAdsCountField = value; + this.adGroupAdsCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupAdsCountSpecified { + get { return this.adGroupAdsCountFieldSpecified; } + set { this.adGroupAdsCountFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ExperimentOperation : Operation { + private Experiment operandField; + + public Experiment operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ExperimentPage : Page { + private Experiment[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Experiment[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ExperimentServiceError : ApiError { + private ExperimentServiceErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ExperimentServiceErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ExperimentServiceError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ExperimentServiceErrorReason { + AFTER_MAXIMUM_ALLOWABLE_DATE, + AOL_PARTNER_CAMPAIGNS_CANT_RUN_EXPERIMENTS, + CANNOT_CREATE_EXPERIMENT_FOR_BIDDING_STRATEGY, + CANNOT_CREATE_EXPERIMENT_FOR_BIDDING_STRATEGY_FEATURE, + CANNOT_SET_DATE_TO_PAST, + CANNOT_SET_END_DATE_WITHOUT_SETTING_START_DATE, + CANNOT_USE_EXPERIMENT_WITH_SHARED_BUDGET, + DATE_OUTSIDE_CAMPAIGN_DATE_RANGE, + EXPERIMENT_ALREADY_STARTED, + EXPERIMENT_ENDED, + EXPERIMENT_LIMIT_EXCEEDED, + INVALID_EXPERIMENT_NAME, + INVALID_QUERY_PERCENTAGE, + CANNOT_CHANGE_QUERY_PERCENTAGE_AFTER_EXPERIMENT_HAS_STARTED, + INVALID_STATUS_UPDATE, + START_DATE_AFTER_END_DATE, + NO_VALID_BUDGET, + EXPERIMENT_NOT_ACTIVE, + EXPERIMENT_SERVICE_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "FeedServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class FeedService : AdWordsSoapClient, IFeedService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public FeedService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/FeedService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((FeedPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +FeedOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((FeedReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((FeedPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FeedReturnValue : ListReturnValue { + private Feed[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public Feed[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Feed { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private FeedAttribute[] attributesField; + + private FeedStatus statusField; + + private bool statusFieldSpecified; + + private FeedOrigin originField; + + private bool originFieldSpecified; + + private SystemFeedGenerationData systemFeedGenerationDataField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("attributes")] + public FeedAttribute[] attributes { + get { return this.attributesField; } + set { this.attributesField = value; } + } + + public FeedStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public FeedOrigin origin { + get { return this.originField; } + set { + this.originField = value; + this.originSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool originSpecified { + get { return this.originFieldSpecified; } + set { this.originFieldSpecified = value; } + } + + public SystemFeedGenerationData systemFeedGenerationData { + get { return this.systemFeedGenerationDataField; } + set { this.systemFeedGenerationDataField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FeedAttribute { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private FeedAttributeType typeField; + + private bool typeFieldSpecified; + + private bool isPartOfKeyField; + + private bool isPartOfKeyFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public FeedAttributeType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public bool isPartOfKey { + get { return this.isPartOfKeyField; } + set { + this.isPartOfKeyField = value; + this.isPartOfKeySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isPartOfKeySpecified { + get { return this.isPartOfKeyFieldSpecified; } + set { this.isPartOfKeyFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedAttribute.Type", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum FeedAttributeType { + INT64, + FLOAT, + STRING, + BOOLEAN, + URL, + DATE_TIME, + INT64_LIST, + FLOAT_LIST, + STRING_LIST, + BOOLEAN_LIST, + URL_LIST, + DATE_TIME_LIST, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Feed.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum FeedStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Feed.Origin", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum FeedOrigin { + USER, + ADWORDS, + UNKNOWN + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacesLocationFeedData))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class SystemFeedGenerationData { + private string systemFeedGenerationDataTypeField; + + [System.Xml.Serialization.XmlElementAttribute("SystemFeedGenerationData.Type")] + public string SystemFeedGenerationDataType { + get { return this.systemFeedGenerationDataTypeField; } + set { this.systemFeedGenerationDataTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class PlacesLocationFeedData : SystemFeedGenerationData { + private OAuthInfo oAuthInfoField; + + private string emailAddressField; + + private string businessNameFilterField; + + private string[] categoryFiltersField; + + public OAuthInfo oAuthInfo { + get { return this.oAuthInfoField; } + set { this.oAuthInfoField = value; } + } + + public string emailAddress { + get { return this.emailAddressField; } + set { this.emailAddressField = value; } + } + + public string businessNameFilter { + get { return this.businessNameFilterField; } + set { this.businessNameFilterField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("categoryFilters")] + public string[] categoryFilters { + get { return this.categoryFiltersField; } + set { this.categoryFiltersField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FeedOperation : Operation { + private Feed operandField; + + public Feed operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FeedPage : NullStatsPage { + private Feed[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Feed[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FeedError : ApiError { + private FeedErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FeedErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum FeedErrorReason { + ATTRIBUTE_NAMES_NOT_UNIQUE, + ATTRIBUTES_DO_NOT_MATCH_EXISTING_ATTRIBUTES, + CANNOT_CHANGE_FEED_NAME, + CANNOT_CHANGE_ORIGIN, + CANNOT_SPECIFY_USER_ORIGIN_FOR_SYSTEM_FEED, + CANNOT_SPECIFY_ADWORDS_ORIGIN_FOR_NON_SYSTEM_FEED, + CANNOT_SPECIFY_FEED_ATTRIBUTES_FOR_SYSTEM_FEED, + CANNOT_UPDATE_FEED_ATTRIBUTES_WITH_ORIGIN_ADWORDS, + FEED_DELETED, + INVALID_ORIGIN_VALUE, + FEED_ORIGIN_IS_NOT_USER, + NEW_ATTRIBUTE_CANNOT_BE_PART_OF_UNIQUE_KEY, + TOO_MANY_FEED_ATTRIBUTES_FOR_FEED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "FeedItemServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class FeedItemService : AdWordsSoapClient, IFeedItemService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public FeedItemService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/FeedItemService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedItemPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((FeedItemPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedItemReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +FeedItemOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((FeedItemReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedItemPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((FeedItemPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FeedItemReturnValue : ListReturnValue { + private FeedItem[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public FeedItem[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FeedItem { + private long feedIdField; + + private bool feedIdFieldSpecified; + + private long feedItemIdField; + + private bool feedItemIdFieldSpecified; + + private FeedItemStatus statusField; + + private bool statusFieldSpecified; + + private string startTimeField; + + private string endTimeField; + + private FeedItemAttributeValue[] attributeValuesField; + + private FeedItemValidationDetail[] validationDetailsField; + + private FeedItemDevicePreference devicePreferenceField; + + private FeedItemSchedule[] schedulingField; + + public long feedId { + get { return this.feedIdField; } + set { + this.feedIdField = value; + this.feedIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedIdSpecified { + get { return this.feedIdFieldSpecified; } + set { this.feedIdFieldSpecified = value; } + } + + public long feedItemId { + get { return this.feedItemIdField; } + set { + this.feedItemIdField = value; + this.feedItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedItemIdSpecified { + get { return this.feedItemIdFieldSpecified; } + set { this.feedItemIdFieldSpecified = value; } + } + + public FeedItemStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public string endTime { + get { return this.endTimeField; } + set { this.endTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("attributeValues")] + public FeedItemAttributeValue[] attributeValues { + get { return this.attributeValuesField; } + set { this.attributeValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("validationDetails")] + public FeedItemValidationDetail[] validationDetails { + get { return this.validationDetailsField; } + set { this.validationDetailsField = value; } + } + + public FeedItemDevicePreference devicePreference { + get { return this.devicePreferenceField; } + set { this.devicePreferenceField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("feedItemSchedules", IsNullable = false)] + public FeedItemSchedule[] scheduling { + get { return this.schedulingField; } + set { this.schedulingField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedItem.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum FeedItemStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FeedItemAttributeValue { + private long feedAttributeIdField; + + private bool feedAttributeIdFieldSpecified; + + private long integerValueField; + + private bool integerValueFieldSpecified; + + private double doubleValueField; + + private bool doubleValueFieldSpecified; + + private bool booleanValueField; + + private bool booleanValueFieldSpecified; + + private string stringValueField; + + public long feedAttributeId { + get { return this.feedAttributeIdField; } + set { + this.feedAttributeIdField = value; + this.feedAttributeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedAttributeIdSpecified { + get { return this.feedAttributeIdFieldSpecified; } + set { this.feedAttributeIdFieldSpecified = value; } + } + + public long integerValue { + get { return this.integerValueField; } + set { + this.integerValueField = value; + this.integerValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool integerValueSpecified { + get { return this.integerValueFieldSpecified; } + set { this.integerValueFieldSpecified = value; } + } + + public double doubleValue { + get { return this.doubleValueField; } + set { + this.doubleValueField = value; + this.doubleValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool doubleValueSpecified { + get { return this.doubleValueFieldSpecified; } + set { this.doubleValueFieldSpecified = value; } + } + + public bool booleanValue { + get { return this.booleanValueField; } + set { + this.booleanValueField = value; + this.booleanValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool booleanValueSpecified { + get { return this.booleanValueFieldSpecified; } + set { this.booleanValueFieldSpecified = value; } + } + + public string stringValue { + get { return this.stringValueField; } + set { this.stringValueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FeedItemValidationDetail { + private long feedMappingIdField; + + private bool feedMappingIdFieldSpecified; + + private FeedItemValidationDetailValidationStatus validationStatusField; + + private bool validationStatusFieldSpecified; + + private FeedItemAttributeError[] validationErrorsField; + + private FeedItemValidationDetailApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + public long feedMappingId { + get { return this.feedMappingIdField; } + set { + this.feedMappingIdField = value; + this.feedMappingIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedMappingIdSpecified { + get { return this.feedMappingIdFieldSpecified; } + set { this.feedMappingIdFieldSpecified = value; } + } + + public FeedItemValidationDetailValidationStatus validationStatus { + get { return this.validationStatusField; } + set { + this.validationStatusField = value; + this.validationStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool validationStatusSpecified { + get { return this.validationStatusFieldSpecified; } + set { this.validationStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("validationErrors")] + public FeedItemAttributeError[] validationErrors { + get { return this.validationErrorsField; } + set { this.validationErrorsField = value; } + } + + public FeedItemValidationDetailApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedItemValidationDetail.ValidationStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum FeedItemValidationDetailValidationStatus { + ERROR, + UNCHECKED, + VALID + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FeedItemAttributeError { + private long[] feedAttributeIdsField; + + private int validationErrorCodeField; + + private bool validationErrorCodeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("feedAttributeIds")] + public long[] feedAttributeIds { + get { return this.feedAttributeIdsField; } + set { this.feedAttributeIdsField = value; } + } + + public int validationErrorCode { + get { return this.validationErrorCodeField; } + set { + this.validationErrorCodeField = value; + this.validationErrorCodeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool validationErrorCodeSpecified { + get { return this.validationErrorCodeFieldSpecified; } + set { this.validationErrorCodeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedItemValidationDetail.ApprovalStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum FeedItemValidationDetailApprovalStatus { + APPROVED, + DISAPPROVED, + UNCHECKED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FeedItemDevicePreference { + private long devicePreferenceField; + + private bool devicePreferenceFieldSpecified; + + public long devicePreference { + get { return this.devicePreferenceField; } + set { + this.devicePreferenceField = value; + this.devicePreferenceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool devicePreferenceSpecified { + get { return this.devicePreferenceFieldSpecified; } + set { this.devicePreferenceFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FeedItemSchedule { + private DayOfWeek dayOfWeekField; + + private bool dayOfWeekFieldSpecified; + + private int startHourField; + + private bool startHourFieldSpecified; + + private MinuteOfHour startMinuteField; + + private bool startMinuteFieldSpecified; + + private int endHourField; + + private bool endHourFieldSpecified; + + private MinuteOfHour endMinuteField; + + private bool endMinuteFieldSpecified; + + public DayOfWeek dayOfWeek { + get { return this.dayOfWeekField; } + set { + this.dayOfWeekField = value; + this.dayOfWeekSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dayOfWeekSpecified { + get { return this.dayOfWeekFieldSpecified; } + set { this.dayOfWeekFieldSpecified = value; } + } + + public int startHour { + get { return this.startHourField; } + set { + this.startHourField = value; + this.startHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startHourSpecified { + get { return this.startHourFieldSpecified; } + set { this.startHourFieldSpecified = value; } + } + + public MinuteOfHour startMinute { + get { return this.startMinuteField; } + set { + this.startMinuteField = value; + this.startMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startMinuteSpecified { + get { return this.startMinuteFieldSpecified; } + set { this.startMinuteFieldSpecified = value; } + } + + public int endHour { + get { return this.endHourField; } + set { + this.endHourField = value; + this.endHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endHourSpecified { + get { return this.endHourFieldSpecified; } + set { this.endHourFieldSpecified = value; } + } + + public MinuteOfHour endMinute { + get { return this.endMinuteField; } + set { + this.endMinuteField = value; + this.endMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endMinuteSpecified { + get { return this.endMinuteFieldSpecified; } + set { this.endMinuteFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FeedItemError : ApiError { + private FeedItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FeedItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedItemError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum FeedItemErrorReason { + CANNOT_CONVERT_ATTRIBUTE_VALUE_FROM_STRING, + CANNOT_OPERATE_ON_DELETED_FEED_ITEM, + DATE_TIME_MUST_BE_IN_ACCOUNT_TIME_ZONE, + KEY_ATTRIBUTES_NOT_FOUND, + INVALID_DEVICE_PREFERENCE, + INVALID_SCHEDULE_END, + INVALID_URL, + MISSING_KEY_ATTRIBUTES, + KEY_ATTRIBUTES_NOT_UNIQUE, + CANNOT_MODIFY_KEY_ATTRIBUTE_VALUE, + OVERLAPPING_SCHEDULES, + SCHEDULE_END_NOT_AFTER_START, + TOO_MANY_SCHEDULES_PER_DAY, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class EntityAccessDenied : ApiError { + private EntityAccessDeniedReason reasonField; + + private bool reasonFieldSpecified; + + public EntityAccessDeniedReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "EntityAccessDenied.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum EntityAccessDeniedReason { + READ_ACCESS_DENIED, + WRITE_ACCESS_DENIED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FeedItemOperation : Operation { + private FeedItem operandField; + + public FeedItem operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FeedItemPage : NullStatsPage { + private FeedItem[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public FeedItem[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "FeedMappingServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class FeedMappingService : AdWordsSoapClient, IFeedMappingService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public FeedMappingService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/FeedMappingService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedMappingPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((FeedMappingPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedMappingReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +FeedMappingOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((FeedMappingReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedMappingPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((FeedMappingPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FeedMappingReturnValue : ListReturnValue { + private FeedMapping[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public FeedMapping[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FeedMapping { + private long feedMappingIdField; + + private bool feedMappingIdFieldSpecified; + + private long feedIdField; + + private bool feedIdFieldSpecified; + + private int placeholderTypeField; + + private bool placeholderTypeFieldSpecified; + + private FeedMappingStatus statusField; + + private bool statusFieldSpecified; + + private AttributeFieldMapping[] attributeFieldMappingsField; + + private int criterionTypeField; + + private bool criterionTypeFieldSpecified; + + public long feedMappingId { + get { return this.feedMappingIdField; } + set { + this.feedMappingIdField = value; + this.feedMappingIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedMappingIdSpecified { + get { return this.feedMappingIdFieldSpecified; } + set { this.feedMappingIdFieldSpecified = value; } + } + + public long feedId { + get { return this.feedIdField; } + set { + this.feedIdField = value; + this.feedIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedIdSpecified { + get { return this.feedIdFieldSpecified; } + set { this.feedIdFieldSpecified = value; } + } + + public int placeholderType { + get { return this.placeholderTypeField; } + set { + this.placeholderTypeField = value; + this.placeholderTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool placeholderTypeSpecified { + get { return this.placeholderTypeFieldSpecified; } + set { this.placeholderTypeFieldSpecified = value; } + } + + public FeedMappingStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("attributeFieldMappings")] + public AttributeFieldMapping[] attributeFieldMappings { + get { return this.attributeFieldMappingsField; } + set { this.attributeFieldMappingsField = value; } + } + + public int criterionType { + get { return this.criterionTypeField; } + set { + this.criterionTypeField = value; + this.criterionTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionTypeSpecified { + get { return this.criterionTypeFieldSpecified; } + set { this.criterionTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedMapping.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum FeedMappingStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AttributeFieldMapping { + private long feedAttributeIdField; + + private bool feedAttributeIdFieldSpecified; + + private int fieldIdField; + + private bool fieldIdFieldSpecified; + + public long feedAttributeId { + get { return this.feedAttributeIdField; } + set { + this.feedAttributeIdField = value; + this.feedAttributeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedAttributeIdSpecified { + get { return this.feedAttributeIdFieldSpecified; } + set { this.feedAttributeIdFieldSpecified = value; } + } + + public int fieldId { + get { return this.fieldIdField; } + set { + this.fieldIdField = value; + this.fieldIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fieldIdSpecified { + get { return this.fieldIdFieldSpecified; } + set { this.fieldIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FeedMappingOperation : Operation { + private FeedMapping operandField; + + public FeedMapping operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FeedMappingPage : NullStatsPage { + private FeedMapping[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public FeedMapping[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class FeedMappingError : ApiError { + private FeedMappingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FeedMappingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedMappingError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum FeedMappingErrorReason { + INVALID_PLACEHOLDER_FIELD, + INVALID_CRITERION_FIELD, + INVALID_PLACEHOLDER_TYPE, + INVALID_CRITERION_TYPE, + CANNOT_SET_PLACEHOLDER_TYPE_AND_CRITERION_TYPE, + NO_ATTRIBUTE_FIELD_MAPPINGS, + FEED_ATTRIBUTE_TYPE_MISMATCH, + CANNOT_OPERATE_ON_MAPPINGS_FOR_SYSTEM_GENERATED_FEED, + MULTIPLE_MAPPINGS_FOR_PLACEHOLDER_TYPE, + MULTIPLE_MAPPINGS_FOR_CRITERION_TYPE, + UNEXPECTED_ATTRIBUTE_FIELD_MAPPINGS, + LOCATION_PLACEHOLDER_ONLY_FOR_PLACES_FEEDS, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "GeoLocationServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class GeoLocationService : AdWordsSoapClient, IGeoLocationService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public GeoLocationService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/GeoLocationService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual GeoLocation[] get(GeoLocationSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((GeoLocation[]) (results[0])); + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidGeoLocation))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class GeoLocation { + private GeoPoint geoPointField; + + private Address addressField; + + private byte[] encodedLocationField; + + private string geoLocationTypeField; + + public GeoPoint geoPoint { + get { return this.geoPointField; } + set { this.geoPointField = value; } + } + + public Address address { + get { return this.addressField; } + set { this.addressField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] encodedLocation { + get { return this.encodedLocationField; } + set { this.encodedLocationField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("GeoLocation.Type")] + public string GeoLocationType { + get { return this.geoLocationTypeField; } + set { this.geoLocationTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class InvalidGeoLocation : GeoLocation { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class GeoLocationSelector { + private Address[] addressesField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("addresses")] + public Address[] addresses { + get { return this.addressesField; } + set { this.addressesField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class GeoLocationError : ApiError { + private GeoLocationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public GeoLocationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GeoLocationError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum GeoLocationErrorReason { + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LocationCriterionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Criterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LocationCriterionService : AdWordsSoapClient, ILocationCriterionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LocationCriterionService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/LocationCriterionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LocationCriterion[] get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((LocationCriterion[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LocationCriterion[] query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((LocationCriterion[]) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class LocationCriterion { + private Location locationField; + + private string canonicalNameField; + + private long reachField; + + private bool reachFieldSpecified; + + private string localeField; + + private string searchTermField; + + private string countryCodeField; + + public Location location { + get { return this.locationField; } + set { this.locationField = value; } + } + + public string canonicalName { + get { return this.canonicalNameField; } + set { this.canonicalNameField = value; } + } + + public long reach { + get { return this.reachField; } + set { + this.reachField = value; + this.reachSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reachSpecified { + get { return this.reachFieldSpecified; } + set { this.reachFieldSpecified = value; } + } + + public string locale { + get { return this.localeField; } + set { this.localeField = value; } + } + + public string searchTerm { + get { return this.searchTermField; } + set { this.searchTermField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Date { + private int yearField; + + private bool yearFieldSpecified; + + private int monthField; + + private bool monthFieldSpecified; + + private int dayField; + + private bool dayFieldSpecified; + + public int year { + get { return this.yearField; } + set { + this.yearField = value; + this.yearSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool yearSpecified { + get { return this.yearFieldSpecified; } + set { this.yearFieldSpecified = value; } + } + + public int month { + get { return this.monthField; } + set { + this.monthField = value; + this.monthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool monthSpecified { + get { return this.monthFieldSpecified; } + set { this.monthFieldSpecified = value; } + } + + public int day { + get { return this.dayField; } + set { + this.dayField = value; + this.daySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool daySpecified { + get { return this.dayFieldSpecified; } + set { this.dayFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class LocationCriterionServiceError : ApiError { + private LocationCriterionServiceErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LocationCriterionServiceErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LocationCriterionServiceError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum LocationCriterionServiceErrorReason { + REQUIRED_LOCATION_CRITERION_PREDICATE_MISSING, + TOO_MANY_LOCATION_CRITERION_PREDICATES_SPECIFIED, + INVALID_COUNTRY_CODE, + LOCATION_CRITERION_SERVICE_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ManagedCustomerServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ManagedCustomerService : AdWordsSoapClient, IManagedCustomerService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ManagedCustomerService() { + this.Url = "https://adwords.google.com/api/adwords/mcm/v201402/ManagedCustomerService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ManagedCustomerPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((ManagedCustomerPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual PendingInvitation[] getPendingInvitations(PendingInvitationSelector selector) { + object[] results = this.Invoke("getPendingInvitations", new object[] { selector }); + return ((PendingInvitation[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ManagedCustomerReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +ManagedCustomerOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((ManagedCustomerReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlArrayAttribute("rval")] + [return: System.Xml.Serialization.XmlArrayItemAttribute("links", IsNullable = false)] + public virtual ManagedCustomerLink[] mutateLink([System.Xml.Serialization.XmlElementAttribute("operations")] +LinkOperation[] operations) { + object[] results = this.Invoke("mutateLink", new object[] { operations }); + return ((ManagedCustomerLink[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlArrayAttribute("rval")] + [return: System.Xml.Serialization.XmlArrayItemAttribute("links", IsNullable = false)] + public virtual ManagedCustomerLink[] mutateManager([System.Xml.Serialization.XmlElementAttribute("operations")] +MoveOperation[] operations) { + object[] results = this.Invoke("mutateManager", new object[] { operations }); + return ((ManagedCustomerLink[]) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public partial class ManagedCustomerReturnValue { + private ManagedCustomer[] valueField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public ManagedCustomer[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public partial class ManagedCustomer { + private string nameField; + + private string loginField; + + private string companyNameField; + + private long customerIdField; + + private bool customerIdFieldSpecified; + + private bool canManageClientsField; + + private bool canManageClientsFieldSpecified; + + private string currencyCodeField; + + private string dateTimeZoneField; + + private bool testAccountField; + + private bool testAccountFieldSpecified; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string login { + get { return this.loginField; } + set { this.loginField = value; } + } + + public string companyName { + get { return this.companyNameField; } + set { this.companyNameField = value; } + } + + public long customerId { + get { return this.customerIdField; } + set { + this.customerIdField = value; + this.customerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customerIdSpecified { + get { return this.customerIdFieldSpecified; } + set { this.customerIdFieldSpecified = value; } + } + + public bool canManageClients { + get { return this.canManageClientsField; } + set { + this.canManageClientsField = value; + this.canManageClientsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool canManageClientsSpecified { + get { return this.canManageClientsFieldSpecified; } + set { this.canManageClientsFieldSpecified = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public string dateTimeZone { + get { return this.dateTimeZoneField; } + set { this.dateTimeZoneField = value; } + } + + public bool testAccount { + get { return this.testAccountField; } + set { + this.testAccountField = value; + this.testAccountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool testAccountSpecified { + get { return this.testAccountFieldSpecified; } + set { this.testAccountFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public partial class ManagedCustomerOperation : Operation { + private ManagedCustomer operandField; + + public ManagedCustomer operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public partial class MoveOperation : Operation { + private ManagedCustomerLink operandField; + + private long oldManagerCustomerIdField; + + private bool oldManagerCustomerIdFieldSpecified; + + public ManagedCustomerLink operand { + get { return this.operandField; } + set { this.operandField = value; } + } + + public long oldManagerCustomerId { + get { return this.oldManagerCustomerIdField; } + set { + this.oldManagerCustomerIdField = value; + this.oldManagerCustomerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool oldManagerCustomerIdSpecified { + get { return this.oldManagerCustomerIdFieldSpecified; } + set { this.oldManagerCustomerIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public partial class ManagedCustomerLink { + private long managerCustomerIdField; + + private bool managerCustomerIdFieldSpecified; + + private long clientCustomerIdField; + + private bool clientCustomerIdFieldSpecified; + + private LinkStatus linkStatusField; + + private bool linkStatusFieldSpecified; + + private string pendingDescriptiveNameField; + + public long managerCustomerId { + get { return this.managerCustomerIdField; } + set { + this.managerCustomerIdField = value; + this.managerCustomerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool managerCustomerIdSpecified { + get { return this.managerCustomerIdFieldSpecified; } + set { this.managerCustomerIdFieldSpecified = value; } + } + + public long clientCustomerId { + get { return this.clientCustomerIdField; } + set { + this.clientCustomerIdField = value; + this.clientCustomerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clientCustomerIdSpecified { + get { return this.clientCustomerIdFieldSpecified; } + set { this.clientCustomerIdFieldSpecified = value; } + } + + public LinkStatus linkStatus { + get { return this.linkStatusField; } + set { + this.linkStatusField = value; + this.linkStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool linkStatusSpecified { + get { return this.linkStatusFieldSpecified; } + set { this.linkStatusFieldSpecified = value; } + } + + public string pendingDescriptiveName { + get { return this.pendingDescriptiveNameField; } + set { this.pendingDescriptiveNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public enum LinkStatus { + ACTIVE, + INACTIVE, + PENDING, + REFUSED, + CANCELLED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public partial class LinkOperation : Operation { + private ManagedCustomerLink operandField; + + public ManagedCustomerLink operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public partial class PendingInvitation { + private ManagedCustomer managerField; + + private ManagedCustomer clientField; + + private string creationDateField; + + private string expirationDateField; + + public ManagedCustomer manager { + get { return this.managerField; } + set { this.managerField = value; } + } + + public ManagedCustomer client { + get { return this.clientField; } + set { this.clientField = value; } + } + + public string creationDate { + get { return this.creationDateField; } + set { this.creationDateField = value; } + } + + public string expirationDate { + get { return this.expirationDateField; } + set { this.expirationDateField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public partial class PendingInvitationSelector { + private long[] managerCustomerIdsField; + + private long[] clientCustomerIdsField; + + [System.Xml.Serialization.XmlElementAttribute("managerCustomerIds")] + public long[] managerCustomerIds { + get { return this.managerCustomerIdsField; } + set { this.managerCustomerIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("clientCustomerIds")] + public long[] clientCustomerIds { + get { return this.clientCustomerIdsField; } + set { this.clientCustomerIdsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public partial class ManagedCustomerPage : Page { + private ManagedCustomer[] entriesField; + + private ManagedCustomerLink[] linksField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public ManagedCustomer[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("links")] + public ManagedCustomerLink[] links { + get { return this.linksField; } + set { this.linksField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public partial class ManagedCustomerServiceError : ApiError { + private ManagedCustomerServiceErrorReason reasonField; + + private bool reasonFieldSpecified; + + private long[] customerIdsField; + + public ManagedCustomerServiceErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customerIds")] + public long[] customerIds { + get { return this.customerIdsField; } + set { this.customerIdsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ManagedCustomerServiceError.Reason", Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public enum ManagedCustomerServiceErrorReason { + UNKNOWN, + NOT_AUTHORIZED, + INVALID_SELECTOR, + INVALID_TIMEZONE, + INVALID_CURRENCY, + INVALID_DESCRIPTIVE_NAME, + ADD_CUSTOMER_FAILURE, + SAVE_CUSTOMERS_FAILURE, + TEST_ACCOUNT_LINK_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "MediaServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class MediaService : AdWordsSoapClient, IMediaService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public MediaService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/MediaService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual MediaPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((MediaPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual MediaPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((MediaPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Media[] upload([System.Xml.Serialization.XmlElementAttribute("media")] +Media[] media) { + object[] results = this.Invoke("upload", new object[] { media }); + return ((Media[]) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class MediaPage { + private Media[] entriesField; + + private int totalNumEntriesField; + + private bool totalNumEntriesFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Media[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + + public int totalNumEntries { + get { return this.totalNumEntriesField; } + set { + this.totalNumEntriesField = value; + this.totalNumEntriesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalNumEntriesSpecified { + get { return this.totalNumEntriesFieldSpecified; } + set { this.totalNumEntriesFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class VideoError : ApiError { + private VideoErrorReason reasonField; + + private bool reasonFieldSpecified; + + public VideoErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum VideoErrorReason { + INVALID_VIDEO, + STORAGE_ERROR, + BAD_REQUEST, + ERROR_GENERATING_STREAMING_URL, + UNEXPECTED_SIZE, + SERVER_ERROR, + FILE_TOO_LARGE, + VIDEO_PROCESSING_ERROR, + INVALID_INPUT, + PROBLEM_READING_FILE, + INVALID_ISCI, + INVALID_AD_ID + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AudioError : ApiError { + private AudioErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AudioErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudioError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AudioErrorReason { + INVALID_AUDIO, + PROBLEM_READING_AUDIO_FILE, + ERROR_STORING_AUDIO, + FILE_TOO_LARGE, + UNSUPPORTED_AUDIO, + ERROR_GENERATING_STREAMING_URL + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "MutateJobServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class MutateJobService : AdWordsSoapClient, IMutateJobService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public MutateJobService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/MutateJobService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Job[] get(JobSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((Job[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual JobResult getResult(JobSelector selector) { + object[] results = this.Invoke("getResult", new object[] { selector }); + return ((JobResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SimpleMutateJob mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +Operation[] operations, BulkMutateJobPolicy policy) { + object[] results = this.Invoke("mutate", new object[] { operations, policy }); + return ((SimpleMutateJob) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class BulkMutateJobPolicy { + private long[] prerequisiteJobIdsField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("prerequisiteJobIds")] + public long[] prerequisiteJobIds { + get { return this.prerequisiteJobIdsField; } + set { this.prerequisiteJobIdsField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignTargetOperation : Operation { + private TargetList operandField; + + public TargetList operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdScheduleTargetList))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public abstract partial class TargetList { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private string targetListTypeField; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("TargetList.Type")] + public string TargetListType { + get { return this.targetListTypeField; } + set { this.targetListTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdScheduleTargetList : TargetList { + private AdScheduleTarget[] targetsField; + + [System.Xml.Serialization.XmlElementAttribute("targets")] + public AdScheduleTarget[] targets { + get { return this.targetsField; } + set { this.targetsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdScheduleTarget : Target { + private DayOfWeek dayOfWeekField; + + private bool dayOfWeekFieldSpecified; + + private int startHourField; + + private bool startHourFieldSpecified; + + private MinuteOfHour startMinuteField; + + private bool startMinuteFieldSpecified; + + private int endHourField; + + private bool endHourFieldSpecified; + + private MinuteOfHour endMinuteField; + + private bool endMinuteFieldSpecified; + + private double bidMultiplierField; + + private bool bidMultiplierFieldSpecified; + + public DayOfWeek dayOfWeek { + get { return this.dayOfWeekField; } + set { + this.dayOfWeekField = value; + this.dayOfWeekSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dayOfWeekSpecified { + get { return this.dayOfWeekFieldSpecified; } + set { this.dayOfWeekFieldSpecified = value; } + } + + public int startHour { + get { return this.startHourField; } + set { + this.startHourField = value; + this.startHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startHourSpecified { + get { return this.startHourFieldSpecified; } + set { this.startHourFieldSpecified = value; } + } + + public MinuteOfHour startMinute { + get { return this.startMinuteField; } + set { + this.startMinuteField = value; + this.startMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startMinuteSpecified { + get { return this.startMinuteFieldSpecified; } + set { this.startMinuteFieldSpecified = value; } + } + + public int endHour { + get { return this.endHourField; } + set { + this.endHourField = value; + this.endHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endHourSpecified { + get { return this.endHourFieldSpecified; } + set { this.endHourFieldSpecified = value; } + } + + public MinuteOfHour endMinute { + get { return this.endMinuteField; } + set { + this.endMinuteField = value; + this.endMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endMinuteSpecified { + get { return this.endMinuteFieldSpecified; } + set { this.endMinuteFieldSpecified = value; } + } + + public double bidMultiplier { + get { return this.bidMultiplierField; } + set { + this.bidMultiplierField = value; + this.bidMultiplierSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidMultiplierSpecified { + get { return this.bidMultiplierFieldSpecified; } + set { this.bidMultiplierFieldSpecified = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdScheduleTarget))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public abstract partial class Target { + private string targetTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Target.Type")] + public string TargetType { + get { return this.targetTypeField; } + set { this.targetTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class TargetingSetting : Setting { + private TargetingSettingDetail[] detailsField; + + [System.Xml.Serialization.XmlElementAttribute("details")] + public TargetingSettingDetail[] details { + get { return this.detailsField; } + set { this.detailsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class TargetingSettingDetail { + private CriterionTypeGroup criterionTypeGroupField; + + private bool criterionTypeGroupFieldSpecified; + + private bool targetAllField; + + private bool targetAllFieldSpecified; + + public CriterionTypeGroup criterionTypeGroup { + get { return this.criterionTypeGroupField; } + set { + this.criterionTypeGroupField = value; + this.criterionTypeGroupSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionTypeGroupSpecified { + get { return this.criterionTypeGroupFieldSpecified; } + set { this.criterionTypeGroupFieldSpecified = value; } + } + + public bool targetAll { + get { return this.targetAllField; } + set { + this.targetAllField = value; + this.targetAllSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetAllSpecified { + get { return this.targetAllFieldSpecified; } + set { this.targetAllFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum CriterionTypeGroup { + KEYWORD, + USER_INTEREST_AND_LIST, + VERTICAL, + GENDER, + AGE_RANGE, + PLACEMENT, + NONE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ExplorerAutoOptimizerSetting : Setting { + private bool optInField; + + private bool optInFieldSpecified; + + public bool optIn { + get { return this.optInField; } + set { + this.optInField = value; + this.optInSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool optInSpecified { + get { return this.optInFieldSpecified; } + set { this.optInFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Webpage : Criterion { + private WebpageParameter parameterField; + + private double criteriaCoverageField; + + private bool criteriaCoverageFieldSpecified; + + private string[] criteriaSamplesField; + + public WebpageParameter parameter { + get { return this.parameterField; } + set { this.parameterField = value; } + } + + public double criteriaCoverage { + get { return this.criteriaCoverageField; } + set { + this.criteriaCoverageField = value; + this.criteriaCoverageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criteriaCoverageSpecified { + get { return this.criteriaCoverageFieldSpecified; } + set { this.criteriaCoverageFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("criteriaSamples")] + public string[] criteriaSamples { + get { return this.criteriaSamplesField; } + set { this.criteriaSamplesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class WebpageParameter : CriterionParameter { + private string criterionNameField; + + private WebpageCondition[] conditionsField; + + public string criterionName { + get { return this.criterionNameField; } + set { this.criterionNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("conditions")] + public WebpageCondition[] conditions { + get { return this.conditionsField; } + set { this.conditionsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class WebpageCondition { + private WebpageConditionOperand operandField; + + private bool operandFieldSpecified; + + private string argumentField; + + public WebpageConditionOperand operand { + get { return this.operandField; } + set { + this.operandField = value; + this.operandSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operandSpecified { + get { return this.operandFieldSpecified; } + set { this.operandFieldSpecified = value; } + } + + public string argument { + get { return this.argumentField; } + set { this.argumentField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum WebpageConditionOperand { + URL, + CATEGORY, + PAGE_TITLE, + PAGE_CONTENT, + UNKNOWN + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WebpageParameter))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public abstract partial class CriterionParameter { + private string criterionParameterTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CriterionParameter.Type")] + public string CriterionParameterType { + get { return this.criterionParameterTypeField; } + set { this.criterionParameterTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ProductPartition : Criterion { + private ProductPartitionType partitionTypeField; + + private bool partitionTypeFieldSpecified; + + private long parentCriterionIdField; + + private bool parentCriterionIdFieldSpecified; + + private ProductDimension caseValueField; + + public ProductPartitionType partitionType { + get { return this.partitionTypeField; } + set { + this.partitionTypeField = value; + this.partitionTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool partitionTypeSpecified { + get { return this.partitionTypeFieldSpecified; } + set { this.partitionTypeFieldSpecified = value; } + } + + public long parentCriterionId { + get { return this.parentCriterionIdField; } + set { + this.parentCriterionIdField = value; + this.parentCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool parentCriterionIdSpecified { + get { return this.parentCriterionIdFieldSpecified; } + set { this.parentCriterionIdFieldSpecified = value; } + } + + public ProductDimension caseValue { + get { return this.caseValueField; } + set { this.caseValueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ProductPartitionType { + UNKNOWN, + SUBDIVISION, + UNIT + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupOperation : Operation { + private AdGroup operandField; + + public AdGroup operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroup { + private long idField; + + private bool idFieldSpecified; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private string campaignNameField; + + private string nameField; + + private AdGroupStatus statusField; + + private bool statusFieldSpecified; + + private Setting[] settingsField; + + private AdGroupExperimentData experimentDataField; + + private String_StringMapEntry[] forwardCompatibilityMapField; + + private BiddingStrategyConfiguration biddingStrategyConfigurationField; + + private CriterionTypeGroup contentBidCriterionTypeGroupField; + + private bool contentBidCriterionTypeGroupFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public string campaignName { + get { return this.campaignNameField; } + set { this.campaignNameField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public AdGroupStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("settings")] + public Setting[] settings { + get { return this.settingsField; } + set { this.settingsField = value; } + } + + public AdGroupExperimentData experimentData { + get { return this.experimentDataField; } + set { this.experimentDataField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("forwardCompatibilityMap")] + public String_StringMapEntry[] forwardCompatibilityMap { + get { return this.forwardCompatibilityMapField; } + set { this.forwardCompatibilityMapField = value; } + } + + public BiddingStrategyConfiguration biddingStrategyConfiguration { + get { return this.biddingStrategyConfigurationField; } + set { this.biddingStrategyConfigurationField = value; } + } + + public CriterionTypeGroup contentBidCriterionTypeGroup { + get { return this.contentBidCriterionTypeGroupField; } + set { + this.contentBidCriterionTypeGroupField = value; + this.contentBidCriterionTypeGroupSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contentBidCriterionTypeGroupSpecified { + get { return this.contentBidCriterionTypeGroupFieldSpecified; } + set { this.contentBidCriterionTypeGroupFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroup.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdGroupStatus { + ENABLED, + PAUSED, + DELETED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupExperimentData { + private long experimentIdField; + + private bool experimentIdFieldSpecified; + + private ExperimentDeltaStatus experimentDeltaStatusField; + + private bool experimentDeltaStatusFieldSpecified; + + private ExperimentDataStatus experimentDataStatusField; + + private bool experimentDataStatusFieldSpecified; + + private AdGroupExperimentBidMultipliers experimentBidMultipliersField; + + public long experimentId { + get { return this.experimentIdField; } + set { + this.experimentIdField = value; + this.experimentIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentIdSpecified { + get { return this.experimentIdFieldSpecified; } + set { this.experimentIdFieldSpecified = value; } + } + + public ExperimentDeltaStatus experimentDeltaStatus { + get { return this.experimentDeltaStatusField; } + set { + this.experimentDeltaStatusField = value; + this.experimentDeltaStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentDeltaStatusSpecified { + get { return this.experimentDeltaStatusFieldSpecified; } + set { this.experimentDeltaStatusFieldSpecified = value; } + } + + public ExperimentDataStatus experimentDataStatus { + get { return this.experimentDataStatusField; } + set { + this.experimentDataStatusField = value; + this.experimentDataStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentDataStatusSpecified { + get { return this.experimentDataStatusFieldSpecified; } + set { this.experimentDataStatusFieldSpecified = value; } + } + + public AdGroupExperimentBidMultipliers experimentBidMultipliers { + get { return this.experimentBidMultipliersField; } + set { this.experimentBidMultipliersField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManualCPMAdGroupExperimentBidMultipliers))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManualCPCAdGroupExperimentBidMultipliers))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public abstract partial class AdGroupExperimentBidMultipliers { + private string adGroupExperimentBidMultipliersTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AdGroupExperimentBidMultipliers.Type")] + public string AdGroupExperimentBidMultipliersType { + get { return this.adGroupExperimentBidMultipliersTypeField; } + set { this.adGroupExperimentBidMultipliersTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ManualCPMAdGroupExperimentBidMultipliers : AdGroupExperimentBidMultipliers { + private BidMultiplier maxCpmMultiplierField; + + public BidMultiplier maxCpmMultiplier { + get { return this.maxCpmMultiplierField; } + set { this.maxCpmMultiplierField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class BidMultiplier { + private double multiplierField; + + private bool multiplierFieldSpecified; + + private Bid multipliedBidField; + + public double multiplier { + get { return this.multiplierField; } + set { + this.multiplierField = value; + this.multiplierSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool multiplierSpecified { + get { return this.multiplierFieldSpecified; } + set { this.multiplierFieldSpecified = value; } + } + + public Bid multipliedBid { + get { return this.multipliedBidField; } + set { this.multipliedBidField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Bid { + private Money amountField; + + public Money amount { + get { return this.amountField; } + set { this.amountField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ManualCPCAdGroupExperimentBidMultipliers : AdGroupExperimentBidMultipliers { + private BidMultiplier maxCpcMultiplierField; + + private BidMultiplier maxContentCpcMultiplierField; + + public BidMultiplier maxCpcMultiplier { + get { return this.maxCpcMultiplierField; } + set { this.maxCpcMultiplierField = value; } + } + + public BidMultiplier maxContentCpcMultiplier { + get { return this.maxContentCpcMultiplierField; } + set { this.maxContentCpcMultiplierField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupCriterionOperation : Operation { + private AdGroupCriterion operandField; + + private ExemptionRequest[] exemptionRequestsField; + + public AdGroupCriterion operand { + get { return this.operandField; } + set { this.operandField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("exemptionRequests")] + public ExemptionRequest[] exemptionRequests { + get { return this.exemptionRequestsField; } + set { this.exemptionRequestsField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NegativeAdGroupCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddableAdGroupCriterion))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupCriterion { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private CriterionUse criterionUseField; + + private bool criterionUseFieldSpecified; + + private Criterion criterionField; + + private String_StringMapEntry[] forwardCompatibilityMapField; + + private string adGroupCriterionTypeField; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public CriterionUse criterionUse { + get { return this.criterionUseField; } + set { + this.criterionUseField = value; + this.criterionUseSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionUseSpecified { + get { return this.criterionUseFieldSpecified; } + set { this.criterionUseFieldSpecified = value; } + } + + public Criterion criterion { + get { return this.criterionField; } + set { this.criterionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("forwardCompatibilityMap")] + public String_StringMapEntry[] forwardCompatibilityMap { + get { return this.forwardCompatibilityMapField; } + set { this.forwardCompatibilityMapField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("AdGroupCriterion.Type")] + public string AdGroupCriterionType { + get { return this.adGroupCriterionTypeField; } + set { this.adGroupCriterionTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum CriterionUse { + BIDDABLE, + NEGATIVE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class NegativeAdGroupCriterion : AdGroupCriterion { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class BiddableAdGroupCriterion : AdGroupCriterion { + private UserStatus userStatusField; + + private bool userStatusFieldSpecified; + + private SystemServingStatus systemServingStatusField; + + private bool systemServingStatusFieldSpecified; + + private ApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + private string[] disapprovalReasonsField; + + private string destinationUrlField; + + private BiddableAdGroupCriterionExperimentData experimentDataField; + + private Bid firstPageCpcField; + + private Bid topOfPageCpcField; + + private QualityInfo qualityInfoField; + + private BiddingStrategyConfiguration biddingStrategyConfigurationField; + + private double bidModifierField; + + private bool bidModifierFieldSpecified; + + public UserStatus userStatus { + get { return this.userStatusField; } + set { + this.userStatusField = value; + this.userStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userStatusSpecified { + get { return this.userStatusFieldSpecified; } + set { this.userStatusFieldSpecified = value; } + } + + public SystemServingStatus systemServingStatus { + get { return this.systemServingStatusField; } + set { + this.systemServingStatusField = value; + this.systemServingStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool systemServingStatusSpecified { + get { return this.systemServingStatusFieldSpecified; } + set { this.systemServingStatusFieldSpecified = value; } + } + + public ApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("disapprovalReasons")] + public string[] disapprovalReasons { + get { return this.disapprovalReasonsField; } + set { this.disapprovalReasonsField = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + public BiddableAdGroupCriterionExperimentData experimentData { + get { return this.experimentDataField; } + set { this.experimentDataField = value; } + } + + public Bid firstPageCpc { + get { return this.firstPageCpcField; } + set { this.firstPageCpcField = value; } + } + + public Bid topOfPageCpc { + get { return this.topOfPageCpcField; } + set { this.topOfPageCpcField = value; } + } + + public QualityInfo qualityInfo { + get { return this.qualityInfoField; } + set { this.qualityInfoField = value; } + } + + public BiddingStrategyConfiguration biddingStrategyConfiguration { + get { return this.biddingStrategyConfigurationField; } + set { this.biddingStrategyConfigurationField = value; } + } + + public double bidModifier { + get { return this.bidModifierField; } + set { + this.bidModifierField = value; + this.bidModifierSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidModifierSpecified { + get { return this.bidModifierFieldSpecified; } + set { this.bidModifierFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum UserStatus { + ACTIVE, + DELETED, + PAUSED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum SystemServingStatus { + ELIGIBLE, + RARELY_SERVED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ApprovalStatus { + APPROVED, + PENDING_REVIEW, + UNDER_REVIEW, + DISAPPROVED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class BiddableAdGroupCriterionExperimentData { + private long experimentIdField; + + private bool experimentIdFieldSpecified; + + private ExperimentDeltaStatus experimentDeltaStatusField; + + private bool experimentDeltaStatusFieldSpecified; + + private ExperimentDataStatus experimentDataStatusField; + + private bool experimentDataStatusFieldSpecified; + + private AdGroupCriterionExperimentBidMultiplier experimentBidMultiplierField; + + public long experimentId { + get { return this.experimentIdField; } + set { + this.experimentIdField = value; + this.experimentIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentIdSpecified { + get { return this.experimentIdFieldSpecified; } + set { this.experimentIdFieldSpecified = value; } + } + + public ExperimentDeltaStatus experimentDeltaStatus { + get { return this.experimentDeltaStatusField; } + set { + this.experimentDeltaStatusField = value; + this.experimentDeltaStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentDeltaStatusSpecified { + get { return this.experimentDeltaStatusFieldSpecified; } + set { this.experimentDeltaStatusFieldSpecified = value; } + } + + public ExperimentDataStatus experimentDataStatus { + get { return this.experimentDataStatusField; } + set { + this.experimentDataStatusField = value; + this.experimentDataStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentDataStatusSpecified { + get { return this.experimentDataStatusFieldSpecified; } + set { this.experimentDataStatusFieldSpecified = value; } + } + + public AdGroupCriterionExperimentBidMultiplier experimentBidMultiplier { + get { return this.experimentBidMultiplierField; } + set { this.experimentBidMultiplierField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManualCPCAdGroupCriterionExperimentBidMultiplier))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public abstract partial class AdGroupCriterionExperimentBidMultiplier { + private string adGroupCriterionExperimentBidMultiplierTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AdGroupCriterionExperimentBidMultiplier.Type")] + public string AdGroupCriterionExperimentBidMultiplierType { + get { return this.adGroupCriterionExperimentBidMultiplierTypeField; } + set { this.adGroupCriterionExperimentBidMultiplierTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ManualCPCAdGroupCriterionExperimentBidMultiplier : AdGroupCriterionExperimentBidMultiplier { + private BidMultiplier maxCpcMultiplierField; + + private MultiplierSource multiplierSourceField; + + private bool multiplierSourceFieldSpecified; + + public BidMultiplier maxCpcMultiplier { + get { return this.maxCpcMultiplierField; } + set { this.maxCpcMultiplierField = value; } + } + + public MultiplierSource multiplierSource { + get { return this.multiplierSourceField; } + set { + this.multiplierSourceField = value; + this.multiplierSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool multiplierSourceSpecified { + get { return this.multiplierSourceFieldSpecified; } + set { this.multiplierSourceFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum MultiplierSource { + ADGROUP, + CRITERION, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class QualityInfo { + private bool isKeywordAdRelevanceAcceptableField; + + private bool isKeywordAdRelevanceAcceptableFieldSpecified; + + private bool isLandingPageQualityAcceptableField; + + private bool isLandingPageQualityAcceptableFieldSpecified; + + private bool isLandingPageLatencyAcceptableField; + + private bool isLandingPageLatencyAcceptableFieldSpecified; + + private int qualityScoreField; + + private bool qualityScoreFieldSpecified; + + public bool isKeywordAdRelevanceAcceptable { + get { return this.isKeywordAdRelevanceAcceptableField; } + set { + this.isKeywordAdRelevanceAcceptableField = value; + this.isKeywordAdRelevanceAcceptableSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isKeywordAdRelevanceAcceptableSpecified { + get { return this.isKeywordAdRelevanceAcceptableFieldSpecified; } + set { this.isKeywordAdRelevanceAcceptableFieldSpecified = value; } + } + + public bool isLandingPageQualityAcceptable { + get { return this.isLandingPageQualityAcceptableField; } + set { + this.isLandingPageQualityAcceptableField = value; + this.isLandingPageQualityAcceptableSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isLandingPageQualityAcceptableSpecified { + get { return this.isLandingPageQualityAcceptableFieldSpecified; } + set { this.isLandingPageQualityAcceptableFieldSpecified = value; } + } + + public bool isLandingPageLatencyAcceptable { + get { return this.isLandingPageLatencyAcceptableField; } + set { + this.isLandingPageLatencyAcceptableField = value; + this.isLandingPageLatencyAcceptableSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isLandingPageLatencyAcceptableSpecified { + get { return this.isLandingPageLatencyAcceptableFieldSpecified; } + set { this.isLandingPageLatencyAcceptableFieldSpecified = value; } + } + + public int qualityScore { + get { return this.qualityScoreField; } + set { + this.qualityScoreField = value; + this.qualityScoreSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool qualityScoreSpecified { + get { return this.qualityScoreFieldSpecified; } + set { this.qualityScoreFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupBidModifierOperation : Operation { + private AdGroupBidModifier operandField; + + public AdGroupBidModifier operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupBidModifier { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private Criterion criterionField; + + private double bidModifierField; + + private bool bidModifierFieldSpecified; + + private BidModifierSource bidModifierSourceField; + + private bool bidModifierSourceFieldSpecified; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public Criterion criterion { + get { return this.criterionField; } + set { this.criterionField = value; } + } + + public double bidModifier { + get { return this.bidModifierField; } + set { + this.bidModifierField = value; + this.bidModifierSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidModifierSpecified { + get { return this.bidModifierFieldSpecified; } + set { this.bidModifierFieldSpecified = value; } + } + + public BidModifierSource bidModifierSource { + get { return this.bidModifierSourceField; } + set { + this.bidModifierSourceField = value; + this.bidModifierSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidModifierSourceSpecified { + get { return this.bidModifierSourceFieldSpecified; } + set { this.bidModifierSourceFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum BidModifierSource { + UNKNOWN, + CAMPAIGN, + AD_GROUP + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdExtensionOverrideOperation : Operation { + private AdExtensionOverride operandField; + + public AdExtensionOverride operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdExtensionOverride { + private long adIdField; + + private bool adIdFieldSpecified; + + private AdExtension adExtensionField; + + private OverrideInfo overrideInfoField; + + private AdExtensionOverrideStatus statusField; + + private bool statusFieldSpecified; + + private AdExtensionOverrideApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + public long adId { + get { return this.adIdField; } + set { + this.adIdField = value; + this.adIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adIdSpecified { + get { return this.adIdFieldSpecified; } + set { this.adIdFieldSpecified = value; } + } + + public AdExtension adExtension { + get { return this.adExtensionField; } + set { this.adExtensionField = value; } + } + + public OverrideInfo overrideInfo { + get { return this.overrideInfoField; } + set { this.overrideInfoField = value; } + } + + public AdExtensionOverrideStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public AdExtensionOverrideApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class OverrideInfo { + private LocationOverrideInfo itemField; + + [System.Xml.Serialization.XmlElementAttribute("LocationOverrideInfo")] + public LocationOverrideInfo Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class LocationOverrideInfo { + private int radiusField; + + private bool radiusFieldSpecified; + + private LocationOverrideInfoRadiusUnits radiusUnitsField; + + private bool radiusUnitsFieldSpecified; + + public int radius { + get { return this.radiusField; } + set { + this.radiusField = value; + this.radiusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool radiusSpecified { + get { return this.radiusFieldSpecified; } + set { this.radiusFieldSpecified = value; } + } + + public LocationOverrideInfoRadiusUnits radiusUnits { + get { return this.radiusUnitsField; } + set { + this.radiusUnitsField = value; + this.radiusUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool radiusUnitsSpecified { + get { return this.radiusUnitsFieldSpecified; } + set { this.radiusUnitsFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LocationOverrideInfo.RadiusUnits", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum LocationOverrideInfoRadiusUnits { + KILOMETERS, + MILES + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdExtensionOverride.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdExtensionOverrideStatus { + ACTIVE, + DELETED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdExtensionOverride.ApprovalStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdExtensionOverrideApprovalStatus { + APPROVED, + UNCHECKED, + DISAPPROVED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class PlaceHolder { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class Operand { + private object itemField; + + [System.Xml.Serialization.XmlElementAttribute("Ad", typeof(Ad))] + [System.Xml.Serialization.XmlElementAttribute("AdExtensionOverride", typeof(AdExtensionOverride))] + [System.Xml.Serialization.XmlElementAttribute("AdGroup", typeof(AdGroup))] + [System.Xml.Serialization.XmlElementAttribute("AdGroupAd", typeof(AdGroupAd))] + [System.Xml.Serialization.XmlElementAttribute("AdGroupBidModifier", typeof(AdGroupBidModifier))] + [System.Xml.Serialization.XmlElementAttribute("AdGroupCriterion", typeof(AdGroupCriterion))] + [System.Xml.Serialization.XmlElementAttribute("Budget", typeof(Budget))] + [System.Xml.Serialization.XmlElementAttribute("Campaign", typeof(Campaign))] + [System.Xml.Serialization.XmlElementAttribute("CampaignAdExtension", typeof(CampaignAdExtension))] + [System.Xml.Serialization.XmlElementAttribute("CampaignCriterion", typeof(CampaignCriterion))] + [System.Xml.Serialization.XmlElementAttribute("FeedItem", typeof(FeedItem))] + [System.Xml.Serialization.XmlElementAttribute("Job", typeof(Job))] + [System.Xml.Serialization.XmlElementAttribute("Media", typeof(Media))] + [System.Xml.Serialization.XmlElementAttribute("PlaceHolder", typeof(PlaceHolder))] + [System.Xml.Serialization.XmlElementAttribute("Target", typeof(Target))] + [System.Xml.Serialization.XmlElementAttribute("TargetList", typeof(TargetList))] + public object Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SimpleMutateJob))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public abstract partial class Job { + private ApiErrorReason failureReasonField; + + private JobStats statsField; + + private BillingSummary billingSummaryField; + + private string jobTypeField; + + public ApiErrorReason failureReason { + get { return this.failureReasonField; } + set { this.failureReasonField = value; } + } + + public JobStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public BillingSummary billingSummary { + get { return this.billingSummaryField; } + set { this.billingSummaryField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Job.Type")] + public string JobType { + get { return this.jobTypeField; } + set { this.jobTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ApiErrorReason { + private object itemField; + + [System.Xml.Serialization.XmlElementAttribute("AdErrorReason", typeof(AdErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AdExtensionErrorReason", typeof(AdExtensionErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AdExtensionOverrideErrorReason", typeof(AdExtensionOverrideErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AdGroupAdErrorReason", typeof(AdGroupAdErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AdGroupCriterionErrorReason", typeof(AdGroupCriterionErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AdGroupServiceErrorReason", typeof(AdGroupServiceErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AdxErrorReason", typeof(AdxErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AuthenticationErrorReason", typeof(AuthenticationErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AuthorizationErrorReason", typeof(AuthorizationErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("BetaErrorReason", typeof(BetaErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("BiddingErrorReason", typeof(BiddingErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("BiddingErrorsReason", typeof(BiddingErrorsReason))] + [System.Xml.Serialization.XmlElementAttribute("BiddingTransitionErrorReason", typeof(BiddingTransitionErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("BudgetErrorReason", typeof(BudgetErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("BulkMutateJobErrorReason", typeof(BulkMutateJobErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("CampaignAdExtensionErrorReason", typeof(CampaignAdExtensionErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("CampaignCriterionErrorReason", typeof(CampaignCriterionErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("CampaignErrorReason", typeof(CampaignErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("ClientTermsErrorReason", typeof(ClientTermsErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("CriterionErrorReason", typeof(CriterionErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("DatabaseErrorReason", typeof(DatabaseErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("DateErrorReason", typeof(DateErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("DistinctErrorReason", typeof(DistinctErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("EntityAccessDeniedReason", typeof(EntityAccessDeniedReason))] + [System.Xml.Serialization.XmlElementAttribute("EntityCountLimitExceededReason", typeof(EntityCountLimitExceededReason))] + [System.Xml.Serialization.XmlElementAttribute("EntityNotFoundReason", typeof(EntityNotFoundReason))] + [System.Xml.Serialization.XmlElementAttribute("ExperimentErrorReason", typeof(ExperimentErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("FeedItemErrorReason", typeof(FeedItemErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("ForwardCompatibilityErrorReason", typeof(ForwardCompatibilityErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("FunctionErrorReason", typeof(FunctionErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("FunctionParsingErrorReason", typeof(FunctionParsingErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("IdErrorReason", typeof(IdErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("ImageErrorReason", typeof(ImageErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("InternalApiErrorReason", typeof(InternalApiErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("JobErrorReason", typeof(JobErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("MediaErrorReason", typeof(MediaErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("NewEntityCreationErrorReason", typeof(NewEntityCreationErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("NotEmptyErrorReason", typeof(NotEmptyErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("NullErrorReason", typeof(NullErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("OperationAccessDeniedReason", typeof(OperationAccessDeniedReason))] + [System.Xml.Serialization.XmlElementAttribute("OperatorErrorReason", typeof(OperatorErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("PagingErrorReason", typeof(PagingErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("PolicyViolationErrorReason", typeof(PolicyViolationErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("QueryErrorReason", typeof(QueryErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("QuotaCheckErrorReason", typeof(QuotaCheckErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("QuotaErrorReason", typeof(QuotaErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("RangeErrorReason", typeof(RangeErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("RateExceededErrorReason", typeof(RateExceededErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("ReadOnlyErrorReason", typeof(ReadOnlyErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("RegionCodeErrorReason", typeof(RegionCodeErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("RejectedErrorReason", typeof(RejectedErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("RequestErrorReason", typeof(RequestErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("RequiredErrorReason", typeof(RequiredErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("SelectorErrorReason", typeof(SelectorErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("SettingErrorReason", typeof(SettingErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("SizeLimitErrorReason", typeof(SizeLimitErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("StatsQueryErrorReason", typeof(StatsQueryErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("StringLengthErrorReason", typeof(StringLengthErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("TargetErrorReason", typeof(TargetErrorReason))] + public object Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdExtensionOverrideError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdExtensionOverrideErrorReason { + AD_ALREADY_HAS_ADEXTENSION_OVERRIDE, + ADEXTENSION_ID_MUST_BE_SPECIFIED, + ADEXTENSION_LATITUTE_CANNOT_CHANGE_AFTER_BEING_SET_ONCE, + ADEXTENSION_LONGITUDE_CANNOT_CHANGE_AFTER_BEING_SET_ONCE, + ADEXTENSION_NOT_UNDER_CAMPAIGN, + CANNOT_OPERATE_ON_DELETED_OVERRIDE, + CANNOT_OVERRIDE_EXTENSIONS_ON_NON_TEXT_AD, + CANNOT_OVERRIDE_USING_NON_LOCATION_EXTENSION, + INVALID_ADEXTENSION_ID, + LOCATION_OVERRIDE_INFO_REQUIRED_FOR_NEW_LOCATION_EXTENSION_OVERRIDE, + OVERRIDE_INFO_MUST_BE_NULL_AFTER_BEING_SET_ONCE, + RADIUS_TOO_LARGE, + RADIUS_TOO_SMALL, + UNKNOWN_ADEXTENSION_OVERRIDE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupCriterionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdGroupCriterionErrorReason { + TOO_MANY_OPERTAIONS, + CANT_UPDATE_NEGATIVE, + CONCRETE_TYPE_REQUIRED, + BID_INCOMPATIBLE_WITH_ADGROUP, + CANNOT_TARGET_AND_EXCLUDE, + ILLEGAL_URL, + INVALID_KEYWORD_TEXT, + INVALID_DESTINATION_URL, + MISSING_DESTINATION_URL_TAG, + KEYWORD_LEVEL_BID_NOT_SUPPORTED_FOR_MANUALCPM, + INVALID_USER_STATUS, + CANNOT_ADD_CRITERIA_TYPE, + CANNOT_EXCLUDE_CRITERIA_TYPE, + INVALID_PRODUCT_PARTITION_HIERARCHY, + PRODUCT_PARTITION_UNIT_CANNOT_HAVE_CHILDREN, + PRODUCT_PARTITION_SUBDIVISION_REQUIRES_OTHERS_CASE, + PRODUCT_PARTITION_REQUIRES_SAME_DIMENSION_TYPE_AS_SIBLINGS, + PRODUCT_PARTITION_ALREADY_EXISTS, + PRODUCT_PARTITION_DOES_NOT_EXIST, + PRODUCT_PARTITION_CANNOT_BE_REMOVED, + INVALID_PRODUCT_PARTITION_TYPE, + PRODUCT_PARTITION_ADD_MAY_ONLY_USE_TEMP_ID, + OPERATIONS_FOR_TOO_MANY_SHOPPING_ADGROUPS, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupServiceError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdGroupServiceErrorReason { + DUPLICATE_ADGROUP_NAME, + INVALID_ADGROUP_NAME, + USE_SET_OPERATOR_AND_MARK_STATUS_TO_DELETED, + ADVERTISER_NOT_ON_CONTENT_NETWORK, + BID_TOO_BIG, + BID_TYPE_AND_BIDDING_STRATEGY_MISMATCH, + MISSING_ADGROUP_NAME, + INVALID_CONTENT_BID_CRITERION_TYPE_GROUP + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BetaError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum BetaErrorReason { + BETA_FEATURE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BulkMutateJobError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum BulkMutateJobErrorReason { + CAN_RETURN_RESULT_FOR_ONLY_COMPLETED_JOBS, + CAN_RETURN_RESULT_FOR_ONLY_ONE_JOB, + CANNOT_UPDATE_JOB_ONCE_ALL_REQUEST_PARTS_ARE_RECEIVED, + INVALID_SCOPING_ENTITY_TYPE, + MISSING_SCOPING_ENTITY_FOR_OPERATION_STREAM, + MORE_THAN_ONE_SCOPING_ENTITY_TYPE, + PAYLOAD_STORE_UNAVAILABLE, + REQUEST_PART_IS_OUT_OF_ORDER, + TOO_MANY_OPERATION_STREAMS_IN_REQUEST_PART, + TOO_MANY_OPERATIONS_IN_JOB, + TOO_MANY_OPERATIONS_IN_REQUEST_PART, + TOO_MANY_RESULTS_TO_STORE, + TOO_MANY_SCOPING_ENTITIES, + UNKNOWN, + LOST_RESULT, + UNPROCESSED_RESULT, + BATCH_FAILURE, + SERVICE_PROVIDED_NO_RESULT + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FunctionParsingError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum FunctionParsingErrorReason { + NO_MORE_INPUT, + EXPECTED_CHARACTER, + UNEXPECTED_SEPARATOR, + UNMATCHED_LEFT_BRACKET, + UNMATCHED_RIGHT_BRACKET, + TOO_MANY_NESTED_FUNCTIONS, + MISSING_RIGHT_HAND_OPERAND, + INVALID_OPERATOR_NAME, + FEED_ATTRIBUTE_OPERAND_ARGUMENT_NOT_INTEGER, + NO_OPERANDS, + TOO_MANY_OPERANDS, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "JobError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum JobErrorReason { + DUPLICATE_JOB_KEY_FOR_CUSTOMER, + JOB_TYPE_NOT_SUPPORTED, + PREREQUISITE_JOB_FAILED, + SELECTOR_CANNOT_USE_BOTH_JOB_IDS_AND_JOB_KEYS, + TOO_LATE_TO_CANCEL_JOB, + TOO_MANY_PREREQUISITE_JOBS, + TOO_MANY_JOBS_IN_QUEUE, + USER_CANCELED_JOB, + WORKFLOW_FAILURE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PolicyViolationError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum PolicyViolationErrorReason { + POLICY_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class JobStats { + private int progressPercentField; + + private bool progressPercentFieldSpecified; + + private long pendingTimeMillisField; + + private bool pendingTimeMillisFieldSpecified; + + private long processingTimeMillisField; + + private bool processingTimeMillisFieldSpecified; + + private string jobStatsTypeField; + + public int progressPercent { + get { return this.progressPercentField; } + set { + this.progressPercentField = value; + this.progressPercentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool progressPercentSpecified { + get { return this.progressPercentFieldSpecified; } + set { this.progressPercentFieldSpecified = value; } + } + + public long pendingTimeMillis { + get { return this.pendingTimeMillisField; } + set { + this.pendingTimeMillisField = value; + this.pendingTimeMillisSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool pendingTimeMillisSpecified { + get { return this.pendingTimeMillisFieldSpecified; } + set { this.pendingTimeMillisFieldSpecified = value; } + } + + public long processingTimeMillis { + get { return this.processingTimeMillisField; } + set { + this.processingTimeMillisField = value; + this.processingTimeMillisSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool processingTimeMillisSpecified { + get { return this.processingTimeMillisFieldSpecified; } + set { this.processingTimeMillisFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("JobStats.Type")] + public string JobStatsType { + get { return this.jobStatsTypeField; } + set { this.jobStatsTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class BillingSummary { + private int numOperationsField; + + private bool numOperationsFieldSpecified; + + private long numUnitsField; + + private bool numUnitsFieldSpecified; + + public int numOperations { + get { return this.numOperationsField; } + set { + this.numOperationsField = value; + this.numOperationsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numOperationsSpecified { + get { return this.numOperationsFieldSpecified; } + set { this.numOperationsFieldSpecified = value; } + } + + public long numUnits { + get { return this.numUnitsField; } + set { + this.numUnitsField = value; + this.numUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numUnitsSpecified { + get { return this.numUnitsFieldSpecified; } + set { this.numUnitsFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class SimpleMutateJob : Job { + private long idField; + + private bool idFieldSpecified; + + private BasicJobStatus statusField; + + private bool statusFieldSpecified; + + private JobEvent[] historyField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public BasicJobStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("history")] + public JobEvent[] history { + get { return this.historyField; } + set { this.historyField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum BasicJobStatus { + COMPLETED, + PROCESSING, + FAILED, + PENDING + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class JobEvent { + private string dateTimeField; + + private string jobEventTypeField; + + public string dateTime { + get { return this.dateTimeField; } + set { this.dateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("JobEvent.Type")] + public string JobEventType { + get { return this.jobEventTypeField; } + set { this.jobEventTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class SimpleMutateResult { + private Operand[] resultsField; + + private ApiError[] errorsField; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Operand[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("errors")] + public ApiError[] errors { + get { return this.errorsField; } + set { this.errorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CriterionPolicyError : PolicyViolationError { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class JobError : ApiError { + private JobErrorReason reasonField; + + private bool reasonFieldSpecified; + + public JobErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupCriterionLimitExceeded : EntityCountLimitExceeded { + private AdGroupCriterionLimitExceededCriteriaLimitType limitTypeField; + + private bool limitTypeFieldSpecified; + + public AdGroupCriterionLimitExceededCriteriaLimitType limitType { + get { return this.limitTypeField; } + set { + this.limitTypeField = value; + this.limitTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool limitTypeSpecified { + get { return this.limitTypeFieldSpecified; } + set { this.limitTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupCriterionLimitExceeded.CriteriaLimitType", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdGroupCriterionLimitExceededCriteriaLimitType { + ADGROUP_KEYWORD, + ADGROUP_WEBSITE, + ADGROUP_CRITERION, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class BulkMutateJobError : ApiError { + private BulkMutateJobErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BulkMutateJobErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupServiceError : ApiError { + private AdGroupServiceErrorReason reasonField; + + private bool reasonFieldSpecified; + + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + public AdGroupServiceErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupCriterionError : ApiError { + private AdGroupCriterionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdGroupCriterionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdExtensionOverrideError : ApiError { + private AdExtensionOverrideErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdExtensionOverrideErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class JobResult { + private SimpleMutateResult itemField; + + [System.Xml.Serialization.XmlElementAttribute("SimpleMutateResult")] + public SimpleMutateResult Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BulkMutateJobSelector))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public abstract partial class JobSelector { + private bool includeHistoryField; + + private bool includeHistoryFieldSpecified; + + private bool includeStatsField; + + private bool includeStatsFieldSpecified; + + private string jobSelectorTypeField; + + public bool includeHistory { + get { return this.includeHistoryField; } + set { + this.includeHistoryField = value; + this.includeHistorySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeHistorySpecified { + get { return this.includeHistoryFieldSpecified; } + set { this.includeHistoryFieldSpecified = value; } + } + + public bool includeStats { + get { return this.includeStatsField; } + set { + this.includeStatsField = value; + this.includeStatsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeStatsSpecified { + get { return this.includeStatsFieldSpecified; } + set { this.includeStatsFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("JobSelector.Type")] + public string JobSelectorType { + get { return this.jobSelectorTypeField; } + set { this.jobSelectorTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class BulkMutateJobSelector : JobSelector { + private long[] jobIdsField; + + private int resultPartIndexField; + + private bool resultPartIndexFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("jobIds")] + public long[] jobIds { + get { return this.jobIdsField; } + set { this.jobIdsField = value; } + } + + public int resultPartIndex { + get { return this.resultPartIndexField; } + set { + this.resultPartIndexField = value; + this.resultPartIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool resultPartIndexSpecified { + get { return this.resultPartIndexFieldSpecified; } + set { this.resultPartIndexFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdGroupFeedServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdGroupFeedService : AdWordsSoapClient, IAdGroupFeedService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdGroupFeedService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/AdGroupFeedService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupFeedPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((AdGroupFeedPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupFeedReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +AdGroupFeedOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((AdGroupFeedReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupFeedPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((AdGroupFeedPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupFeedReturnValue : ListReturnValue { + private AdGroupFeed[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdGroupFeed[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupFeed { + private long feedIdField; + + private bool feedIdFieldSpecified; + + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private Function matchingFunctionField; + + private int[] placeholderTypesField; + + private AdGroupFeedStatus statusField; + + private bool statusFieldSpecified; + + public long feedId { + get { return this.feedIdField; } + set { + this.feedIdField = value; + this.feedIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedIdSpecified { + get { return this.feedIdFieldSpecified; } + set { this.feedIdFieldSpecified = value; } + } + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public Function matchingFunction { + get { return this.matchingFunctionField; } + set { this.matchingFunctionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("placeholderTypes")] + public int[] placeholderTypes { + get { return this.placeholderTypesField; } + set { this.placeholderTypesField = value; } + } + + public AdGroupFeedStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupFeed.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdGroupFeedStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupFeedOperation : Operation { + private AdGroupFeed operandField; + + public AdGroupFeed operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupFeedPage : NullStatsPage { + private AdGroupFeed[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public AdGroupFeed[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupFeedError : ApiError { + private AdGroupFeedErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdGroupFeedErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupFeedError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdGroupFeedErrorReason { + FEED_ALREADY_EXISTS_FOR_PLACEHOLDER_TYPE, + INVALID_ID, + CANNOT_ADD_ALREADY_EXISTING_ADGROUP_FEED, + CANNOT_OPERATE_ON_DELETED_ADGROUP_FEED, + INVALID_PLACEHOLDER_TYPES, + MISSING_FEEDMAPPING_FOR_PLACEHOLDER_TYPE, + NO_EXISTING_LOCATION_CUSTOMER_FEED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "OfflineConversionFeedServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class OfflineConversionFeedService : AdWordsSoapClient, IOfflineConversionFeedService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public OfflineConversionFeedService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/OfflineConversionFeedService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual OfflineConversionFeedReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +OfflineConversionFeedOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((OfflineConversionFeedReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class OfflineConversionFeedReturnValue : ListReturnValue { + private OfflineConversionFeed[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public OfflineConversionFeed[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class OfflineConversionFeed { + private string googleClickIdField; + + private string conversionNameField; + + private string conversionTimeField; + + private double conversionValueField; + + private bool conversionValueFieldSpecified; + + public string googleClickId { + get { return this.googleClickIdField; } + set { this.googleClickIdField = value; } + } + + public string conversionName { + get { return this.conversionNameField; } + set { this.conversionNameField = value; } + } + + public string conversionTime { + get { return this.conversionTimeField; } + set { this.conversionTimeField = value; } + } + + public double conversionValue { + get { return this.conversionValueField; } + set { + this.conversionValueField = value; + this.conversionValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool conversionValueSpecified { + get { return this.conversionValueFieldSpecified; } + set { this.conversionValueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class OfflineConversionError : ApiError { + private OfflineConversionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OfflineConversionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OfflineConversionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum OfflineConversionErrorReason { + UNPARSEABLE_GCLID, + CONVERSION_PRECEDES_CLICK, + EXPIRED_CLICK, + TOO_RECENT_CLICK, + INVALID_CLICK, + UNAUTHORIZED_USER, + INVALID_CONVERSION_TYPE, + CLICK_MISSING_CONVERSION_LABEL, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class MatchesRegexError : ApiError { + private MatchesRegexErrorReason reasonField; + + private bool reasonFieldSpecified; + + public MatchesRegexErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "MatchesRegexError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum MatchesRegexErrorReason { + UNKNOWN, + DOES_NOT_MATCH + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CurrencyCodeError : ApiError { + private CurrencyCodeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CurrencyCodeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CurrencyCodeError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum CurrencyCodeErrorReason { + UNSUPPORTED_CURRENCY_CODE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class OfflineConversionFeedOperation : Operation { + private OfflineConversionFeed operandField; + + public OfflineConversionFeed operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReportDefinitionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReportDefinitionService : AdWordsSoapClient, IReportDefinitionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReportDefinitionService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/ReportDefinitionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReportDefinitionField[] getReportFields(ReportDefinitionReportType reportType) { + object[] results = this.Invoke("getReportFields", new object[] { reportType }); + return ((ReportDefinitionField[]) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class EnumValuePair { + private string enumValueField; + + private string enumDisplayValueField; + + public string enumValue { + get { return this.enumValueField; } + set { this.enumValueField = value; } + } + + public string enumDisplayValue { + get { return this.enumDisplayValueField; } + set { this.enumDisplayValueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ReportDefinitionField { + private string fieldNameField; + + private string displayFieldNameField; + + private string xmlAttributeNameField; + + private string fieldTypeField; + + private string[] enumValuesField; + + private bool canSelectField; + + private bool canSelectFieldSpecified; + + private bool canFilterField; + + private bool canFilterFieldSpecified; + + private bool isEnumTypeField; + + private bool isEnumTypeFieldSpecified; + + private bool isBetaField; + + private bool isBetaFieldSpecified; + + private EnumValuePair[] enumValuePairsField; + + public string fieldName { + get { return this.fieldNameField; } + set { this.fieldNameField = value; } + } + + public string displayFieldName { + get { return this.displayFieldNameField; } + set { this.displayFieldNameField = value; } + } + + public string xmlAttributeName { + get { return this.xmlAttributeNameField; } + set { this.xmlAttributeNameField = value; } + } + + public string fieldType { + get { return this.fieldTypeField; } + set { this.fieldTypeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("enumValues")] + public string[] enumValues { + get { return this.enumValuesField; } + set { this.enumValuesField = value; } + } + + public bool canSelect { + get { return this.canSelectField; } + set { + this.canSelectField = value; + this.canSelectSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool canSelectSpecified { + get { return this.canSelectFieldSpecified; } + set { this.canSelectFieldSpecified = value; } + } + + public bool canFilter { + get { return this.canFilterField; } + set { + this.canFilterField = value; + this.canFilterSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool canFilterSpecified { + get { return this.canFilterFieldSpecified; } + set { this.canFilterFieldSpecified = value; } + } + + public bool isEnumType { + get { return this.isEnumTypeField; } + set { + this.isEnumTypeField = value; + this.isEnumTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isEnumTypeSpecified { + get { return this.isEnumTypeFieldSpecified; } + set { this.isEnumTypeFieldSpecified = value; } + } + + public bool isBeta { + get { return this.isBetaField; } + set { + this.isBetaField = value; + this.isBetaSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isBetaSpecified { + get { return this.isBetaFieldSpecified; } + set { this.isBetaFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("enumValuePairs")] + public EnumValuePair[] enumValuePairs { + get { return this.enumValuePairsField; } + set { this.enumValuePairsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ReportDefinitionError : ApiError { + private ReportDefinitionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReportDefinitionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportDefinitionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ReportDefinitionErrorReason { + INVALID_DATE_RANGE_FOR_REPORT, + INVALID_FIELD_NAME_FOR_REPORT, + UNABLE_TO_FIND_MAPPING_FOR_THIS_REPORT, + INVALID_COLUMN_NAME_FOR_REPORT, + INVALID_REPORT_DEFINITION_ID, + REPORT_SELECTOR_CANNOT_BE_NULL, + NO_ENUMS_FOR_THIS_COLUMN_NAME, + INVALID_VIEW, + SORTING_NOT_SUPPORTED, + PAGING_NOT_SUPPORTED, + CUSTOMER_SERVING_TYPE_REPORT_MISMATCH, + CLIENT_SELECTOR_NO_CUSTOMER_IDENTIFIER, + CLIENT_SELECTOR_INVALID_CUSTOMER_ID, + REPORT_DEFINITION_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class NotWhitelistedError : ApiError { + private NotWhitelistedErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NotWhitelistedErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NotWhitelistedError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum NotWhitelistedErrorReason { + CUSTOMER_NOT_WHITELISTED_FOR_API + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportDefinition.ReportType", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ReportDefinitionReportType { + KEYWORDS_PERFORMANCE_REPORT, + AD_PERFORMANCE_REPORT, + URL_PERFORMANCE_REPORT, + ADGROUP_PERFORMANCE_REPORT, + CAMPAIGN_PERFORMANCE_REPORT, + ACCOUNT_PERFORMANCE_REPORT, + GEO_PERFORMANCE_REPORT, + SEARCH_QUERY_PERFORMANCE_REPORT, + AUTOMATIC_PLACEMENTS_PERFORMANCE_REPORT, + CAMPAIGN_NEGATIVE_KEYWORDS_PERFORMANCE_REPORT, + CAMPAIGN_NEGATIVE_PLACEMENTS_PERFORMANCE_REPORT, + AD_EXTENSIONS_PERFORMANCE_REPORT, + DESTINATION_URL_REPORT, + SHARED_SET_REPORT, + CAMPAIGN_SHARED_SET_REPORT, + SHARED_SET_CRITERIA_REPORT, + CREATIVE_CONVERSION_REPORT, + CALL_METRICS_CALL_DETAILS_REPORT, + KEYWORDLESS_QUERY_REPORT, + KEYWORDLESS_CATEGORY_REPORT, + ACCOUNT_REACH_FREQUENCY_REPORT, + CAMPAIGN_REACH_FREQUENCY_REPORT, + ADGROUP_REACH_FREQUENCY_REPORT, + CRITERIA_PERFORMANCE_REPORT, + CLICK_PERFORMANCE_REPORT, + BUDGET_PERFORMANCE_REPORT, + BID_GOAL_PERFORMANCE_REPORT, + DISPLAY_KEYWORD_PERFORMANCE_REPORT, + PLACEHOLDER_FEED_ITEM_REPORT, + PLACEMENT_PERFORMANCE_REPORT, + CAMPAIGN_NEGATIVE_LOCATIONS_REPORT, + GENDER_PERFORMANCE_REPORT, + AGE_RANGE_PERFORMANCE_REPORT, + CAMPAIGN_LOCATION_TARGET_REPORT, + CAMPAIGN_AD_SCHEDULE_TARGET_REPORT, + CAMPAIGN_PLATFORM_TARGET_REPORT, + PAID_ORGANIC_QUERY_REPORT, + AUDIENCE_PERFORMANCE_REPORT, + DISPLAY_TOPICS_PERFORMANCE_REPORT, + SHOPPING_PERFORMANCE_REPORT, + PRODUCT_PARTITION_REPORT, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "TargetingIdeaServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DataEntry))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class TargetingIdeaService : AdWordsSoapClient, ITargetingIdeaService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public TargetingIdeaService() { + this.Url = "https://adwords.google.com/api/adwords/o/v201402/TargetingIdeaService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/o/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/o/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TargetingIdeaPage get(TargetingIdeaSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((TargetingIdeaPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/o/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/o/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TargetingIdeaPage getBulkKeywordIdeas(TargetingIdeaSelector selector) { + object[] results = this.Invoke("getBulkKeywordIdeas", new object[] { selector }); + return ((TargetingIdeaPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class WebpageDescriptor { + private string urlField; + + private string titleField; + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + + public string title { + get { return this.titleField; } + set { this.titleField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class MonthlySearchVolume { + private int yearField; + + private bool yearFieldSpecified; + + private int monthField; + + private bool monthFieldSpecified; + + private long countField; + + private bool countFieldSpecified; + + public int year { + get { return this.yearField; } + set { + this.yearField = value; + this.yearSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool yearSpecified { + get { return this.yearFieldSpecified; } + set { this.yearFieldSpecified = value; } + } + + public int month { + get { return this.monthField; } + set { + this.monthField = value; + this.monthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool monthSpecified { + get { return this.monthFieldSpecified; } + set { this.monthFieldSpecified = value; } + } + + public long count { + get { return this.countField; } + set { + this.countField = value; + this.countSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool countSpecified { + get { return this.countFieldSpecified; } + set { this.countFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class Range { + private ComparableValue minField; + + private ComparableValue maxField; + + public ComparableValue min { + get { return this.minField; } + set { this.minField = value; } + } + + public ComparableValue max { + get { return this.maxField; } + set { this.maxField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class InStreamAdInfo { + private int maxAdDurationField; + + private bool maxAdDurationFieldSpecified; + + private int minAdDurationField; + + private bool minAdDurationFieldSpecified; + + private int medianAdDurationField; + + private bool medianAdDurationFieldSpecified; + + private double preRollPercentField; + + private bool preRollPercentFieldSpecified; + + private double midRollPercentField; + + private bool midRollPercentFieldSpecified; + + private double postRollPercentField; + + private bool postRollPercentFieldSpecified; + + public int maxAdDuration { + get { return this.maxAdDurationField; } + set { + this.maxAdDurationField = value; + this.maxAdDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxAdDurationSpecified { + get { return this.maxAdDurationFieldSpecified; } + set { this.maxAdDurationFieldSpecified = value; } + } + + public int minAdDuration { + get { return this.minAdDurationField; } + set { + this.minAdDurationField = value; + this.minAdDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minAdDurationSpecified { + get { return this.minAdDurationFieldSpecified; } + set { this.minAdDurationFieldSpecified = value; } + } + + public int medianAdDuration { + get { return this.medianAdDurationField; } + set { + this.medianAdDurationField = value; + this.medianAdDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool medianAdDurationSpecified { + get { return this.medianAdDurationFieldSpecified; } + set { this.medianAdDurationFieldSpecified = value; } + } + + public double preRollPercent { + get { return this.preRollPercentField; } + set { + this.preRollPercentField = value; + this.preRollPercentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool preRollPercentSpecified { + get { return this.preRollPercentFieldSpecified; } + set { this.preRollPercentFieldSpecified = value; } + } + + public double midRollPercent { + get { return this.midRollPercentField; } + set { + this.midRollPercentField = value; + this.midRollPercentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool midRollPercentSpecified { + get { return this.midRollPercentFieldSpecified; } + set { this.midRollPercentFieldSpecified = value; } + } + + public double postRollPercent { + get { return this.postRollPercentField; } + set { + this.postRollPercentField = value; + this.postRollPercentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool postRollPercentSpecified { + get { return this.postRollPercentFieldSpecified; } + set { this.postRollPercentFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class AdFormatSpec { + private SiteConstantsAdFormat formatField; + + private bool formatFieldSpecified; + + public SiteConstantsAdFormat format { + get { return this.formatField; } + set { + this.formatField = value; + this.formatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool formatSpecified { + get { return this.formatFieldSpecified; } + set { this.formatFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SiteConstants.AdFormat", Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public enum SiteConstantsAdFormat { + UNKNOWN, + TEXT, + IMAGE, + VIDEO, + INSTREAM + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WebpageDescriptorAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementTypeAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OpportunityIdeaTypeAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MonthlySearchVolumeAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MoneyAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongRangeAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(KeywordAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IntegerSetAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IntegerAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InStreamAdInfoAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IdeaTypeAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DoubleAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BooleanAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BidLandscapeAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSpecListAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdFormatSpecListAttribute))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public abstract partial class Attribute { + private string attributeTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Attribute.Type")] + public string AttributeType { + get { return this.attributeTypeField; } + set { this.attributeTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class WebpageDescriptorAttribute : Attribute { + private WebpageDescriptor valueField; + + public WebpageDescriptor value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class StringAttribute : Attribute { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class PlacementTypeAttribute : Attribute { + private SiteConstantsPlacementType valueField; + + private bool valueFieldSpecified; + + public SiteConstantsPlacementType value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SiteConstants.PlacementType", Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public enum SiteConstantsPlacementType { + UNKNOWN, + SITE, + VIDEO, + FEED, + GAME, + MOBILE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class PlacementAttribute : Attribute { + private Placement valueField; + + public Placement value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class OpportunityIdeaTypeAttribute : Attribute { + private OpportunityIdeaType valueField; + + private bool valueFieldSpecified; + + public OpportunityIdeaType value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public enum OpportunityIdeaType { + KEYWORD, + BID, + BUDGET + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class MonthlySearchVolumeAttribute : Attribute { + private MonthlySearchVolume[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public MonthlySearchVolume[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class MoneyAttribute : Attribute { + private Money valueField; + + public Money value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class LongRangeAttribute : Attribute { + private Range valueField; + + public Range value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class LongAttribute : Attribute { + private long valueField; + + private bool valueFieldSpecified; + + public long value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class KeywordAttribute : Attribute { + private Keyword valueField; + + public Keyword value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class IntegerSetAttribute : Attribute { + private int[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public int[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class IntegerAttribute : Attribute { + private int valueField; + + private bool valueFieldSpecified; + + public int value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class InStreamAdInfoAttribute : Attribute { + private InStreamAdInfo valueField; + + public InStreamAdInfo value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class IdeaTypeAttribute : Attribute { + private IdeaType valueField; + + private bool valueFieldSpecified; + + public IdeaType value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public enum IdeaType { + KEYWORD, + PLACEMENT + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class DoubleAttribute : Attribute { + private double valueField; + + private bool valueFieldSpecified; + + public double value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class CriterionAttribute : Attribute { + private Criterion valueField; + + public Criterion value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class BooleanAttribute : Attribute { + private bool valueField; + + private bool valueFieldSpecified; + + public bool value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class BidLandscapeAttribute : Attribute { + private BidLandscape valueField; + + public BidLandscape value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class AdSpecListAttribute : Attribute { + private AdSpec[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdSpec[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class AdSpec { + private object itemField; + + [System.Xml.Serialization.XmlElementAttribute("DisplayAdSpec", typeof(DisplayAdSpec))] + [System.Xml.Serialization.XmlElementAttribute("InStreamAdSpec", typeof(InStreamAdSpec))] + [System.Xml.Serialization.XmlElementAttribute("TextAdSpec", typeof(TextAdSpec))] + public object Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class DisplayAdSpec { + private DisplayType[] displayTypesField; + + private DisplayAdSpecActivationOption[] activationOptionsField; + + private DisplayAdSpecAdSizeSpec[] adSizeSpecsField; + + [System.Xml.Serialization.XmlElementAttribute("displayTypes")] + public DisplayType[] displayTypes { + get { return this.displayTypesField; } + set { this.displayTypesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("activationOptions")] + public DisplayAdSpecActivationOption[] activationOptions { + get { return this.activationOptionsField; } + set { this.activationOptionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adSizeSpecs")] + public DisplayAdSpecAdSizeSpec[] adSizeSpecs { + get { return this.adSizeSpecsField; } + set { this.adSizeSpecsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class DisplayType { + private object itemField; + + [System.Xml.Serialization.XmlElementAttribute("FlashDisplayType", typeof(FlashDisplayType))] + [System.Xml.Serialization.XmlElementAttribute("HtmlDisplayType", typeof(HtmlDisplayType))] + [System.Xml.Serialization.XmlElementAttribute("ImageDisplayType", typeof(ImageDisplayType))] + public object Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class FlashDisplayType { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class HtmlDisplayType { + private HtmlDisplayTypeHtmlOption htmlOptionField; + + private bool htmlOptionFieldSpecified; + + public HtmlDisplayTypeHtmlOption htmlOption { + get { return this.htmlOptionField; } + set { + this.htmlOptionField = value; + this.htmlOptionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool htmlOptionSpecified { + get { return this.htmlOptionFieldSpecified; } + set { this.htmlOptionFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "HtmlDisplayType.HtmlOption", Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public enum HtmlDisplayTypeHtmlOption { + UNKNOWN, + THIRD_PARTY_SERVING + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class ImageDisplayType { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DisplayAdSpec.ActivationOption", Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public enum DisplayAdSpecActivationOption { + UNKNOWN, + NONE, + STANDARD_EXPANDABLE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DisplayAdSpec.AdSizeSpec", Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class DisplayAdSpecAdSizeSpec { + private long widthField; + + private bool widthFieldSpecified; + + private long heightField; + + private bool heightFieldSpecified; + + private DisplayAdSpecActivationOption[] activationOptionFilterField; + + public long width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public long height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("activationOptionFilter")] + public DisplayAdSpecActivationOption[] activationOptionFilter { + get { return this.activationOptionFilterField; } + set { this.activationOptionFilterField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class InStreamAdSpec { + private InStreamAdSpecInStreamType[] inStreamTypesField; + + private long[] durationsField; + + [System.Xml.Serialization.XmlElementAttribute("inStreamTypes")] + public InStreamAdSpecInStreamType[] inStreamTypes { + get { return this.inStreamTypesField; } + set { this.inStreamTypesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("durations")] + public long[] durations { + get { return this.durationsField; } + set { this.durationsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InStreamAdSpec.InStreamType", Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public enum InStreamAdSpecInStreamType { + UNKNOWN, + IN_STREAM, + IN_DISPLAY, + IN_SLATE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class TextAdSpec { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class AdFormatSpecListAttribute : Attribute { + private AdFormatSpec[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdFormatSpec[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class Type_AttributeMapEntry { + private AttributeType keyField; + + private bool keyFieldSpecified; + + private Attribute valueField; + + public AttributeType key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public Attribute value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public enum AttributeType { + UNKNOWN, + AD_TYPE_SPEC, + APPROX_CONTENT_IMPRESSIONS_PER_DAY, + CATEGORY_PRODUCTS_AND_SERVICES, + COMPETITION, + CRITERION, + EXTRACTED_FROM_WEBPAGE, + IDEA_TYPE, + IN_STREAM_AD_INFO, + KEYWORD_TEXT, + PLACEMENT_NAME, + SAMPLE_URL, + PLACEMENT_CATEGORY, + PLACEMENT_TYPE, + SEARCH_VOLUME, + AVERAGE_CPC, + TARGETED_MONTHLY_SEARCHES + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class TargetingIdea { + private Type_AttributeMapEntry[] dataField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("data")] + public Type_AttributeMapEntry[] data { + get { return this.dataField; } + set { this.dataField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class TargetingIdeaPage { + private int totalNumEntriesField; + + private bool totalNumEntriesFieldSpecified; + + private TargetingIdea[] entriesField; + + public int totalNumEntries { + get { return this.totalNumEntriesField; } + set { + this.totalNumEntriesField = value; + this.totalNumEntriesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalNumEntriesSpecified { + get { return this.totalNumEntriesFieldSpecified; } + set { this.totalNumEntriesFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public TargetingIdea[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class LongComparisonOperation { + private long minimumField; + + private bool minimumFieldSpecified; + + private long maximumField; + + private bool maximumFieldSpecified; + + public long minimum { + get { return this.minimumField; } + set { + this.minimumField = value; + this.minimumSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minimumSpecified { + get { return this.minimumFieldSpecified; } + set { this.minimumFieldSpecified = value; } + } + + public long maximum { + get { return this.maximumField; } + set { + this.maximumField = value; + this.maximumSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maximumSpecified { + get { return this.maximumFieldSpecified; } + set { this.maximumFieldSpecified = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SeedAdGroupIdSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SearchVolumeSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RelatedToUrlSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RelatedToQuerySearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementTypeSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NetworkSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LocationSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LanguageSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IncludeAdultContentSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IdeaTextFilterSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExcludedKeywordSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CompetitionSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CategoryProductsAndServicesSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSpecListSearchParameter))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public abstract partial class SearchParameter { + private string searchParameterTypeField; + + [System.Xml.Serialization.XmlElementAttribute("SearchParameter.Type")] + public string SearchParameterType { + get { return this.searchParameterTypeField; } + set { this.searchParameterTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class SeedAdGroupIdSearchParameter : SearchParameter { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class SearchVolumeSearchParameter : SearchParameter { + private LongComparisonOperation operationField; + + public LongComparisonOperation operation { + get { return this.operationField; } + set { this.operationField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class RelatedToUrlSearchParameter : SearchParameter { + private string[] urlsField; + + private bool includeSubUrlsField; + + private bool includeSubUrlsFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("urls")] + public string[] urls { + get { return this.urlsField; } + set { this.urlsField = value; } + } + + public bool includeSubUrls { + get { return this.includeSubUrlsField; } + set { + this.includeSubUrlsField = value; + this.includeSubUrlsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeSubUrlsSpecified { + get { return this.includeSubUrlsFieldSpecified; } + set { this.includeSubUrlsFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class RelatedToQuerySearchParameter : SearchParameter { + private string[] queriesField; + + [System.Xml.Serialization.XmlElementAttribute("queries")] + public string[] queries { + get { return this.queriesField; } + set { this.queriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class PlacementTypeSearchParameter : SearchParameter { + private SiteConstantsPlacementType[] placementTypesField; + + [System.Xml.Serialization.XmlElementAttribute("placementTypes")] + public SiteConstantsPlacementType[] placementTypes { + get { return this.placementTypesField; } + set { this.placementTypesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class NetworkSearchParameter : SearchParameter { + private NetworkSetting networkSettingField; + + public NetworkSetting networkSetting { + get { return this.networkSettingField; } + set { this.networkSettingField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class LocationSearchParameter : SearchParameter { + private Location[] locationsField; + + [System.Xml.Serialization.XmlElementAttribute("locations")] + public Location[] locations { + get { return this.locationsField; } + set { this.locationsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class LanguageSearchParameter : SearchParameter { + private Language[] languagesField; + + [System.Xml.Serialization.XmlElementAttribute("languages")] + public Language[] languages { + get { return this.languagesField; } + set { this.languagesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class IncludeAdultContentSearchParameter : SearchParameter { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class IdeaTextFilterSearchParameter : SearchParameter { + private string[] includedField; + + private string[] excludedField; + + [System.Xml.Serialization.XmlElementAttribute("included")] + public string[] included { + get { return this.includedField; } + set { this.includedField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excluded")] + public string[] excluded { + get { return this.excludedField; } + set { this.excludedField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class ExcludedKeywordSearchParameter : SearchParameter { + private Keyword[] keywordsField; + + [System.Xml.Serialization.XmlElementAttribute("keywords")] + public Keyword[] keywords { + get { return this.keywordsField; } + set { this.keywordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class CompetitionSearchParameter : SearchParameter { + private CompetitionSearchParameterLevel[] levelsField; + + [System.Xml.Serialization.XmlElementAttribute("levels")] + public CompetitionSearchParameterLevel[] levels { + get { return this.levelsField; } + set { this.levelsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CompetitionSearchParameter.Level", Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public enum CompetitionSearchParameterLevel { + LOW, + MEDIUM, + HIGH + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class CategoryProductsAndServicesSearchParameter : SearchParameter { + private int categoryIdField; + + private bool categoryIdFieldSpecified; + + public int categoryId { + get { return this.categoryIdField; } + set { + this.categoryIdField = value; + this.categoryIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool categoryIdSpecified { + get { return this.categoryIdFieldSpecified; } + set { this.categoryIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class AdSpecListSearchParameter : SearchParameter { + private AdSpec[] adSpecsField; + + [System.Xml.Serialization.XmlElementAttribute("adSpecs")] + public AdSpec[] adSpecs { + get { return this.adSpecsField; } + set { this.adSpecsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class TargetingIdeaSelector { + private SearchParameter[] searchParametersField; + + private IdeaType ideaTypeField; + + private bool ideaTypeFieldSpecified; + + private RequestType requestTypeField; + + private bool requestTypeFieldSpecified; + + private AttributeType[] requestedAttributeTypesField; + + private Paging pagingField; + + private string localeCodeField; + + private string currencyCodeField; + + [System.Xml.Serialization.XmlElementAttribute("searchParameters")] + public SearchParameter[] searchParameters { + get { return this.searchParametersField; } + set { this.searchParametersField = value; } + } + + public IdeaType ideaType { + get { return this.ideaTypeField; } + set { + this.ideaTypeField = value; + this.ideaTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ideaTypeSpecified { + get { return this.ideaTypeFieldSpecified; } + set { this.ideaTypeFieldSpecified = value; } + } + + public RequestType requestType { + get { return this.requestTypeField; } + set { + this.requestTypeField = value; + this.requestTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool requestTypeSpecified { + get { return this.requestTypeFieldSpecified; } + set { this.requestTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("requestedAttributeTypes")] + public AttributeType[] requestedAttributeTypes { + get { return this.requestedAttributeTypesField; } + set { this.requestedAttributeTypesField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + + public string localeCode { + get { return this.localeCodeField; } + set { this.localeCodeField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public enum RequestType { + IDEAS, + STATS + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class TrafficEstimatorError : ApiError { + private TrafficEstimatorErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TrafficEstimatorErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TrafficEstimatorError.Reason", Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public enum TrafficEstimatorErrorReason { + NO_CAMPAIGN_FOR_AD_GROUP_ESTIMATE_REQUEST, + NO_AD_GROUP_FOR_KEYWORD_ESTIMATE_REQUEST, + NO_MAX_CPC_FOR_KEYWORD_ESTIMATE_REQUEST, + TOO_MANY_KEYWORD_ESTIMATE_REQUESTS, + TOO_MANY_CAMPAIGN_ESTIMATE_REQUESTS, + TOO_MANY_ADGROUP_ESTIMATE_REQUESTS, + TOO_MANY_TARGETS, + KEYWORD_TOO_LONG, + KEYWORD_CONTAINS_BROAD_MATCH_MODIFIERS, + INVALID_INPUT, + SERVICE_UNAVAILABLE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class TargetingIdeaError : ApiError { + private TargetingIdeaErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TargetingIdeaErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TargetingIdeaError.Reason", Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public enum TargetingIdeaErrorReason { + DUPLICATE_SEARCH_FILTER_TYPES_PRESENT, + INSUFFICIENT_SEARCH_PARAMETERS, + INVALID_ATTRIBUTE_TYPE, + INVALID_SEARCH_PARAMETERS, + INVALID_DOMAIN_SUFFIX, + MUTUALLY_EXCLUSIVE_SEARCH_PARAMETERS_IN_QUERY, + SERVICE_UNAVAILABLE, + INVALID_URL_IN_SEARCH_PARAMETER, + TOO_MANY_RESULTS_REQUESTED, + NO_PAGING_IN_SELECTOR, + INVALID_INCLUDED_EXCLUDED_KEYWORDS + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "TrafficEstimatorServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Estimate))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EstimateRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class TrafficEstimatorService : AdWordsSoapClient, ITrafficEstimatorService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public TrafficEstimatorService() { + this.Url = "https://adwords.google.com/api/adwords/o/v201402/TrafficEstimatorService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/o/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/o/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TrafficEstimatorResult get(TrafficEstimatorSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((TrafficEstimatorResult) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class StatsEstimate { + private Money averageCpcField; + + private double averagePositionField; + + private bool averagePositionFieldSpecified; + + private double clickThroughRateField; + + private bool clickThroughRateFieldSpecified; + + private float clicksPerDayField; + + private bool clicksPerDayFieldSpecified; + + private float impressionsPerDayField; + + private bool impressionsPerDayFieldSpecified; + + private Money totalCostField; + + public Money averageCpc { + get { return this.averageCpcField; } + set { this.averageCpcField = value; } + } + + public double averagePosition { + get { return this.averagePositionField; } + set { + this.averagePositionField = value; + this.averagePositionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool averagePositionSpecified { + get { return this.averagePositionFieldSpecified; } + set { this.averagePositionFieldSpecified = value; } + } + + public double clickThroughRate { + get { return this.clickThroughRateField; } + set { + this.clickThroughRateField = value; + this.clickThroughRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clickThroughRateSpecified { + get { return this.clickThroughRateFieldSpecified; } + set { this.clickThroughRateFieldSpecified = value; } + } + + public float clicksPerDay { + get { return this.clicksPerDayField; } + set { + this.clicksPerDayField = value; + this.clicksPerDaySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clicksPerDaySpecified { + get { return this.clicksPerDayFieldSpecified; } + set { this.clicksPerDayFieldSpecified = value; } + } + + public float impressionsPerDay { + get { return this.impressionsPerDayField; } + set { + this.impressionsPerDayField = value; + this.impressionsPerDaySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsPerDaySpecified { + get { return this.impressionsPerDayFieldSpecified; } + set { this.impressionsPerDayFieldSpecified = value; } + } + + public Money totalCost { + get { return this.totalCostField; } + set { this.totalCostField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignEstimate))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(KeywordEstimate))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupEstimate))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class Estimate { + private string estimateTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Estimate.Type")] + public string EstimateType { + get { return this.estimateTypeField; } + set { this.estimateTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class CampaignEstimate : Estimate { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private AdGroupEstimate[] adGroupEstimatesField; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adGroupEstimates")] + public AdGroupEstimate[] adGroupEstimates { + get { return this.adGroupEstimatesField; } + set { this.adGroupEstimatesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class AdGroupEstimate : Estimate { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private KeywordEstimate[] keywordEstimatesField; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("keywordEstimates")] + public KeywordEstimate[] keywordEstimates { + get { return this.keywordEstimatesField; } + set { this.keywordEstimatesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class KeywordEstimate : Estimate { + private long criterionIdField; + + private bool criterionIdFieldSpecified; + + private StatsEstimate minField; + + private StatsEstimate maxField; + + public long criterionId { + get { return this.criterionIdField; } + set { + this.criterionIdField = value; + this.criterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionIdSpecified { + get { return this.criterionIdFieldSpecified; } + set { this.criterionIdFieldSpecified = value; } + } + + public StatsEstimate min { + get { return this.minField; } + set { this.minField = value; } + } + + public StatsEstimate max { + get { return this.maxField; } + set { this.maxField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class TrafficEstimatorResult { + private CampaignEstimate[] campaignEstimatesField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("campaignEstimates")] + public CampaignEstimate[] campaignEstimates { + get { return this.campaignEstimatesField; } + set { this.campaignEstimatesField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignEstimateRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(KeywordEstimateRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupEstimateRequest))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public abstract partial class EstimateRequest { + private string estimateRequestTypeField; + + [System.Xml.Serialization.XmlElementAttribute("EstimateRequest.Type")] + public string EstimateRequestType { + get { return this.estimateRequestTypeField; } + set { this.estimateRequestTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class CampaignEstimateRequest : EstimateRequest { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private AdGroupEstimateRequest[] adGroupEstimateRequestsField; + + private Criterion[] criteriaField; + + private NetworkSetting networkSettingField; + + private Money dailyBudgetField; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adGroupEstimateRequests")] + public AdGroupEstimateRequest[] adGroupEstimateRequests { + get { return this.adGroupEstimateRequestsField; } + set { this.adGroupEstimateRequestsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("criteria")] + public Criterion[] criteria { + get { return this.criteriaField; } + set { this.criteriaField = value; } + } + + public NetworkSetting networkSetting { + get { return this.networkSettingField; } + set { this.networkSettingField = value; } + } + + public Money dailyBudget { + get { return this.dailyBudgetField; } + set { this.dailyBudgetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class AdGroupEstimateRequest : EstimateRequest { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private KeywordEstimateRequest[] keywordEstimateRequestsField; + + private Money maxCpcField; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("keywordEstimateRequests")] + public KeywordEstimateRequest[] keywordEstimateRequests { + get { return this.keywordEstimateRequestsField; } + set { this.keywordEstimateRequestsField = value; } + } + + public Money maxCpc { + get { return this.maxCpcField; } + set { this.maxCpcField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class KeywordEstimateRequest : EstimateRequest { + private Keyword keywordField; + + private Money maxCpcField; + + private bool isNegativeField; + + private bool isNegativeFieldSpecified; + + public Keyword keyword { + get { return this.keywordField; } + set { this.keywordField = value; } + } + + public Money maxCpc { + get { return this.maxCpcField; } + set { this.maxCpcField = value; } + } + + public bool isNegative { + get { return this.isNegativeField; } + set { + this.isNegativeField = value; + this.isNegativeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isNegativeSpecified { + get { return this.isNegativeFieldSpecified; } + set { this.isNegativeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201402")] + public partial class TrafficEstimatorSelector { + private CampaignEstimateRequest[] campaignEstimateRequestsField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("campaignEstimateRequests")] + public CampaignEstimateRequest[] campaignEstimateRequests { + get { return this.campaignEstimateRequestsField; } + set { this.campaignEstimateRequestsField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdwordsUserListServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/rm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdwordsUserListService : AdWordsSoapClient, IAdwordsUserListService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdwordsUserListService() { + this.Url = "https://adwords.google.com/api/adwords/rm/v201402/AdwordsUserListService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/rm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/rm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserListPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((UserListPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/rm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/rm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserListReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +UserListOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((UserListReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201402")] + public partial class UserListReturnValue : ListReturnValue { + private UserList[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public UserList[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SimilarUserList))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BasicUserList))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LogicalUserList))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExternalRemarketingUserList))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201402")] + public partial class UserList { + private long idField; + + private bool idFieldSpecified; + + private bool isReadOnlyField; + + private bool isReadOnlyFieldSpecified; + + private string nameField; + + private string descriptionField; + + private UserListMembershipStatus statusField; + + private bool statusFieldSpecified; + + private string integrationCodeField; + + private AccessReason accessReasonField; + + private bool accessReasonFieldSpecified; + + private AccountUserListStatus accountUserListStatusField; + + private bool accountUserListStatusFieldSpecified; + + private long membershipLifeSpanField; + + private bool membershipLifeSpanFieldSpecified; + + private long sizeField; + + private bool sizeFieldSpecified; + + private SizeRange sizeRangeField; + + private bool sizeRangeFieldSpecified; + + private long sizeForSearchField; + + private bool sizeForSearchFieldSpecified; + + private SizeRange sizeRangeForSearchField; + + private bool sizeRangeForSearchFieldSpecified; + + private string userListTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public bool isReadOnly { + get { return this.isReadOnlyField; } + set { + this.isReadOnlyField = value; + this.isReadOnlySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isReadOnlySpecified { + get { return this.isReadOnlyFieldSpecified; } + set { this.isReadOnlyFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public UserListMembershipStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string integrationCode { + get { return this.integrationCodeField; } + set { this.integrationCodeField = value; } + } + + public AccessReason accessReason { + get { return this.accessReasonField; } + set { + this.accessReasonField = value; + this.accessReasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool accessReasonSpecified { + get { return this.accessReasonFieldSpecified; } + set { this.accessReasonFieldSpecified = value; } + } + + public AccountUserListStatus accountUserListStatus { + get { return this.accountUserListStatusField; } + set { + this.accountUserListStatusField = value; + this.accountUserListStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool accountUserListStatusSpecified { + get { return this.accountUserListStatusFieldSpecified; } + set { this.accountUserListStatusFieldSpecified = value; } + } + + public long membershipLifeSpan { + get { return this.membershipLifeSpanField; } + set { + this.membershipLifeSpanField = value; + this.membershipLifeSpanSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool membershipLifeSpanSpecified { + get { return this.membershipLifeSpanFieldSpecified; } + set { this.membershipLifeSpanFieldSpecified = value; } + } + + public long size { + get { return this.sizeField; } + set { + this.sizeField = value; + this.sizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sizeSpecified { + get { return this.sizeFieldSpecified; } + set { this.sizeFieldSpecified = value; } + } + + public SizeRange sizeRange { + get { return this.sizeRangeField; } + set { + this.sizeRangeField = value; + this.sizeRangeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sizeRangeSpecified { + get { return this.sizeRangeFieldSpecified; } + set { this.sizeRangeFieldSpecified = value; } + } + + public long sizeForSearch { + get { return this.sizeForSearchField; } + set { + this.sizeForSearchField = value; + this.sizeForSearchSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sizeForSearchSpecified { + get { return this.sizeForSearchFieldSpecified; } + set { this.sizeForSearchFieldSpecified = value; } + } + + public SizeRange sizeRangeForSearch { + get { return this.sizeRangeForSearchField; } + set { + this.sizeRangeForSearchField = value; + this.sizeRangeForSearchSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sizeRangeForSearchSpecified { + get { return this.sizeRangeForSearchFieldSpecified; } + set { this.sizeRangeForSearchFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("UserList.Type")] + public string UserListType { + get { return this.userListTypeField; } + set { this.userListTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201402")] + public enum UserListMembershipStatus { + OPEN, + CLOSED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201402")] + public enum AccessReason { + OWNED, + SHARED, + LICENSED, + SUBSCRIBED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201402")] + public enum AccountUserListStatus { + ACTIVE, + INACTIVE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201402")] + public enum SizeRange { + LESS_THAN_FIVE_HUNDRED, + LESS_THAN_ONE_THOUSAND, + ONE_THOUSAND_TO_TEN_THOUSAND, + TEN_THOUSAND_TO_FIFTY_THOUSAND, + FIFTY_THOUSAND_TO_ONE_HUNDRED_THOUSAND, + ONE_HUNDRED_THOUSAND_TO_THREE_HUNDRED_THOUSAND, + THREE_HUNDRED_THOUSAND_TO_FIVE_HUNDRED_THOUSAND, + FIVE_HUNDRED_THOUSAND_TO_ONE_MILLION, + ONE_MILLION_TO_TWO_MILLION, + TWO_MILLION_TO_THREE_MILLION, + THREE_MILLION_TO_FIVE_MILLION, + FIVE_MILLION_TO_TEN_MILLION, + TEN_MILLION_TO_TWENTY_MILLION, + TWENTY_MILLION_TO_THIRTY_MILLION, + THIRTY_MILLION_TO_FIFTY_MILLION, + OVER_FIFTY_MILLION + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201402")] + public partial class SimilarUserList : UserList { + private long seedUserListIdField; + + private bool seedUserListIdFieldSpecified; + + private string seedUserListNameField; + + private string seedUserListDescriptionField; + + private UserListMembershipStatus seedUserListStatusField; + + private bool seedUserListStatusFieldSpecified; + + private long seedListSizeField; + + private bool seedListSizeFieldSpecified; + + public long seedUserListId { + get { return this.seedUserListIdField; } + set { + this.seedUserListIdField = value; + this.seedUserListIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool seedUserListIdSpecified { + get { return this.seedUserListIdFieldSpecified; } + set { this.seedUserListIdFieldSpecified = value; } + } + + public string seedUserListName { + get { return this.seedUserListNameField; } + set { this.seedUserListNameField = value; } + } + + public string seedUserListDescription { + get { return this.seedUserListDescriptionField; } + set { this.seedUserListDescriptionField = value; } + } + + public UserListMembershipStatus seedUserListStatus { + get { return this.seedUserListStatusField; } + set { + this.seedUserListStatusField = value; + this.seedUserListStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool seedUserListStatusSpecified { + get { return this.seedUserListStatusFieldSpecified; } + set { this.seedUserListStatusFieldSpecified = value; } + } + + public long seedListSize { + get { return this.seedListSizeField; } + set { + this.seedListSizeField = value; + this.seedListSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool seedListSizeSpecified { + get { return this.seedListSizeFieldSpecified; } + set { this.seedListSizeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201402")] + public partial class BasicUserList : UserList { + private UserListConversionType[] conversionTypesField; + + [System.Xml.Serialization.XmlElementAttribute("conversionTypes")] + public UserListConversionType[] conversionTypes { + get { return this.conversionTypesField; } + set { this.conversionTypesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201402")] + public partial class UserListConversionType { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private UserListConversionTypeCategory categoryField; + + private bool categoryFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public UserListConversionTypeCategory category { + get { return this.categoryField; } + set { + this.categoryField = value; + this.categorySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool categorySpecified { + get { return this.categoryFieldSpecified; } + set { this.categoryFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "UserListConversionType.Category", Namespace = "https://adwords.google.com/api/adwords/rm/v201402")] + public enum UserListConversionTypeCategory { + BOOMERANG_EVENT, + OTHER + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201402")] + public partial class LogicalUserList : UserList { + private UserListLogicalRule[] rulesField; + + [System.Xml.Serialization.XmlElementAttribute("rules")] + public UserListLogicalRule[] rules { + get { return this.rulesField; } + set { this.rulesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201402")] + public partial class UserListLogicalRule { + private UserListLogicalRuleOperator operatorField; + + private bool operatorFieldSpecified; + + private LogicalUserListOperand[] ruleOperandsField; + + public UserListLogicalRuleOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ruleOperands")] + public LogicalUserListOperand[] ruleOperands { + get { return this.ruleOperandsField; } + set { this.ruleOperandsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "UserListLogicalRule.Operator", Namespace = "https://adwords.google.com/api/adwords/rm/v201402")] + public enum UserListLogicalRuleOperator { + ALL, + ANY, + NONE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201402")] + public partial class LogicalUserListOperand { + private UserList itemField; + + [System.Xml.Serialization.XmlElementAttribute("UserList")] + public UserList Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201402")] + public partial class ExternalRemarketingUserList : UserList { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201402")] + public partial class UserListOperation : Operation { + private UserList operandField; + + public UserList operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201402")] + public partial class UserListPage : Page { + private UserList[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public UserList[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201402")] + public partial class UserListError : ApiError { + private UserListErrorReason reasonField; + + private bool reasonFieldSpecified; + + public UserListErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "UserListError.Reason", Namespace = "https://adwords.google.com/api/adwords/rm/v201402")] + public enum UserListErrorReason { + EXTERNAL_REMARKETING_USER_LIST_MUTATE_NOT_SUPPORTED, + CONCRETE_TYPE_REQUIRED, + CONVERSION_TYPE_ID_REQUIRED, + DUPLICATE_CONVERSION_TYPES, + INVALID_CONVERSION_TYPE, + INVALID_DESCRIPTION, + INVALID_NAME, + INVALID_TYPE, + INVALID_USER_LIST_LOGICAL_RULE_OPERAND, + NAME_ALREADY_USED, + NEW_CONVERSION_TYPE_NAME_REQUIRED, + OWNERSHIP_REQUIRED_FOR_SET, + REMOVE_NOT_SUPPORTED, + USER_LIST_MUTATE_NOT_SUPPORTED, + USER_LIST_SERVICE_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "VideoAdServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class VideoAdService : AdWordsSoapClient, IVideoAdService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public VideoAdService() { + this.Url = "https://adwords.google.com/api/adwords/video/v201402/VideoAdService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual VideoAdPage get(VideoAdSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((VideoAdPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual VideoAdReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +VideoAdOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((VideoAdReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoAdReturnValue : ListReturnValue { + private VideoAd[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public VideoAd[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoAd { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string videoIdField; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private TargetingGroupAssociation[] targetingGroupAssociationsField; + + private VideoEntityStats statsField; + + private VideoEntityStats[] segmentedStatsField; + + private ServingInfo issuesField; + + private string campaignNameField; + + private string headlineField; + + private string description1Field; + + private string description2Field; + + private VideoImage imageField; + + private VideoAdYouTubeDestinationPage youTubeDestinationPageField; + + private bool youTubeDestinationPageFieldSpecified; + + private string destinationUrlField; + + private string displayUrlField; + + private VideoImage companionBannerField; + + private bool showVideoAnnotationsField; + + private bool showVideoAnnotationsFieldSpecified; + + private VideoAdStatus statusField; + + private bool statusFieldSpecified; + + private ApprovalContext_VideoAd_ApprovalStatusMapEntry[] approvalStatusesField; + + private ApprovalContext_VideoAd_ApprovalLimitMapEntry[] approvalLimitsField; + + private ScopedDisapprovalReason[] disapprovalReasonsField; + + private VideoAdDisplayFormat_VideoAdStatusMapEntry[] statusByFormatField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string videoId { + get { return this.videoIdField; } + set { this.videoIdField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetingGroupAssociations")] + public TargetingGroupAssociation[] targetingGroupAssociations { + get { return this.targetingGroupAssociationsField; } + set { this.targetingGroupAssociationsField = value; } + } + + public VideoEntityStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("segmentedStats")] + public VideoEntityStats[] segmentedStats { + get { return this.segmentedStatsField; } + set { this.segmentedStatsField = value; } + } + + public ServingInfo issues { + get { return this.issuesField; } + set { this.issuesField = value; } + } + + public string campaignName { + get { return this.campaignNameField; } + set { this.campaignNameField = value; } + } + + public string headline { + get { return this.headlineField; } + set { this.headlineField = value; } + } + + public string description1 { + get { return this.description1Field; } + set { this.description1Field = value; } + } + + public string description2 { + get { return this.description2Field; } + set { this.description2Field = value; } + } + + public VideoImage image { + get { return this.imageField; } + set { this.imageField = value; } + } + + public VideoAdYouTubeDestinationPage youTubeDestinationPage { + get { return this.youTubeDestinationPageField; } + set { + this.youTubeDestinationPageField = value; + this.youTubeDestinationPageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool youTubeDestinationPageSpecified { + get { return this.youTubeDestinationPageFieldSpecified; } + set { this.youTubeDestinationPageFieldSpecified = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + public string displayUrl { + get { return this.displayUrlField; } + set { this.displayUrlField = value; } + } + + public VideoImage companionBanner { + get { return this.companionBannerField; } + set { this.companionBannerField = value; } + } + + public bool showVideoAnnotations { + get { return this.showVideoAnnotationsField; } + set { + this.showVideoAnnotationsField = value; + this.showVideoAnnotationsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool showVideoAnnotationsSpecified { + get { return this.showVideoAnnotationsFieldSpecified; } + set { this.showVideoAnnotationsFieldSpecified = value; } + } + + public VideoAdStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("approvalStatuses")] + public ApprovalContext_VideoAd_ApprovalStatusMapEntry[] approvalStatuses { + get { return this.approvalStatusesField; } + set { this.approvalStatusesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("approvalLimits")] + public ApprovalContext_VideoAd_ApprovalLimitMapEntry[] approvalLimits { + get { return this.approvalLimitsField; } + set { this.approvalLimitsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("disapprovalReasons")] + public ScopedDisapprovalReason[] disapprovalReasons { + get { return this.disapprovalReasonsField; } + set { this.disapprovalReasonsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("statusByFormat")] + public VideoAdDisplayFormat_VideoAdStatusMapEntry[] statusByFormat { + get { return this.statusByFormatField; } + set { this.statusByFormatField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class TargetingGroupAssociation { + private long targetingGroupIdField; + + private bool targetingGroupIdFieldSpecified; + + private TargetingGroupAssociationStatus statusField; + + private bool statusFieldSpecified; + + public long targetingGroupId { + get { return this.targetingGroupIdField; } + set { + this.targetingGroupIdField = value; + this.targetingGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetingGroupIdSpecified { + get { return this.targetingGroupIdFieldSpecified; } + set { this.targetingGroupIdFieldSpecified = value; } + } + + public TargetingGroupAssociationStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TargetingGroupAssociation.Status", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum TargetingGroupAssociationStatus { + ACTIVE, + PAUSED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoEntityStats { + private VideoEntityStatsSummaryType summaryTypeField; + + private bool summaryTypeFieldSpecified; + + private SegmentKey segmentKeyField; + + private string startDateField; + + private string endDateField; + + private long viewsField; + + private bool viewsFieldSpecified; + + private Money costField; + + private Money averageCpcField; + + private Money averageCpvField; + + private Money averageCpmField; + + private Integer_LongMapEntry[] impressionReachFrequenciesField; + + private double averageImpressionFrequencyField; + + private bool averageImpressionFrequencyFieldSpecified; + + private double averageViewFrequencyField; + + private bool averageViewFrequencyFieldSpecified; + + private long uniqueViewsField; + + private bool uniqueViewsFieldSpecified; + + private long thumbnailImpressionsField; + + private bool thumbnailImpressionsFieldSpecified; + + private long videoImpressionsField; + + private bool videoImpressionsFieldSpecified; + + private long totalImpressionsField; + + private bool totalImpressionsFieldSpecified; + + private long websiteClicksField; + + private bool websiteClicksFieldSpecified; + + private long conversionsField; + + private bool conversionsFieldSpecified; + + private Money costPerConversionField; + + private double conversionRateField; + + private bool conversionRateFieldSpecified; + + private long viewThroughConversionsField; + + private bool viewThroughConversionsFieldSpecified; + + private long conversionsManyPerViewField; + + private bool conversionsManyPerViewFieldSpecified; + + private Money costPerConversionManyPerViewField; + + private double conversionRateManyPerViewField; + + private bool conversionRateManyPerViewFieldSpecified; + + private double totalConversionValueField; + + private bool totalConversionValueFieldSpecified; + + private double valuePerConvField; + + private bool valuePerConvFieldSpecified; + + private double valuePerConvManyPerViewField; + + private bool valuePerConvManyPerViewFieldSpecified; + + private long followOnViewsField; + + private bool followOnViewsFieldSpecified; + + private double followOnViewRateField; + + private bool followOnViewRateFieldSpecified; + + private long followOnSubscribesField; + + private bool followOnSubscribesFieldSpecified; + + private double followOnSubscribeRateField; + + private bool followOnSubscribeRateFieldSpecified; + + private long followOnLikesField; + + private bool followOnLikesFieldSpecified; + + private long followOnCommentsField; + + private bool followOnCommentsFieldSpecified; + + private long followOnSharesField; + + private bool followOnSharesFieldSpecified; + + private long followOnAddToPlaylistField; + + private bool followOnAddToPlaylistFieldSpecified; + + private double ctrField; + + private bool ctrFieldSpecified; + + private double vtrField; + + private bool vtrFieldSpecified; + + private long videoStartsField; + + private bool videoStartsFieldSpecified; + + private long quartile25sField; + + private bool quartile25sFieldSpecified; + + private long quartile50sField; + + private bool quartile50sFieldSpecified; + + private long quartile75sField; + + private bool quartile75sFieldSpecified; + + private long quartile100sField; + + private bool quartile100sFieldSpecified; + + private double quartile25PercentsField; + + private bool quartile25PercentsFieldSpecified; + + private double quartile50PercentsField; + + private bool quartile50PercentsFieldSpecified; + + private double quartile75PercentsField; + + private bool quartile75PercentsFieldSpecified; + + private double quartile100PercentsField; + + private bool quartile100PercentsFieldSpecified; + + private double percentServedField; + + private bool percentServedFieldSpecified; + + private long eligibleFollowOnClicksField; + + private bool eligibleFollowOnClicksFieldSpecified; + + private double engagementScoreField; + + private bool engagementScoreFieldSpecified; + + private double retentionScoreField; + + private bool retentionScoreFieldSpecified; + + private long totalViewsField; + + private bool totalViewsFieldSpecified; + + private long ctaImpressionsField; + + private bool ctaImpressionsFieldSpecified; + + private long ctaClicksField; + + private bool ctaClicksFieldSpecified; + + private double ctaCtrField; + + private bool ctaCtrFieldSpecified; + + public VideoEntityStatsSummaryType summaryType { + get { return this.summaryTypeField; } + set { + this.summaryTypeField = value; + this.summaryTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool summaryTypeSpecified { + get { return this.summaryTypeFieldSpecified; } + set { this.summaryTypeFieldSpecified = value; } + } + + public SegmentKey segmentKey { + get { return this.segmentKeyField; } + set { this.segmentKeyField = value; } + } + + public string startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public string endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + public long views { + get { return this.viewsField; } + set { + this.viewsField = value; + this.viewsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool viewsSpecified { + get { return this.viewsFieldSpecified; } + set { this.viewsFieldSpecified = value; } + } + + public Money cost { + get { return this.costField; } + set { this.costField = value; } + } + + public Money averageCpc { + get { return this.averageCpcField; } + set { this.averageCpcField = value; } + } + + public Money averageCpv { + get { return this.averageCpvField; } + set { this.averageCpvField = value; } + } + + public Money averageCpm { + get { return this.averageCpmField; } + set { this.averageCpmField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("impressionReachFrequencies")] + public Integer_LongMapEntry[] impressionReachFrequencies { + get { return this.impressionReachFrequenciesField; } + set { this.impressionReachFrequenciesField = value; } + } + + public double averageImpressionFrequency { + get { return this.averageImpressionFrequencyField; } + set { + this.averageImpressionFrequencyField = value; + this.averageImpressionFrequencySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool averageImpressionFrequencySpecified { + get { return this.averageImpressionFrequencyFieldSpecified; } + set { this.averageImpressionFrequencyFieldSpecified = value; } + } + + public double averageViewFrequency { + get { return this.averageViewFrequencyField; } + set { + this.averageViewFrequencyField = value; + this.averageViewFrequencySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool averageViewFrequencySpecified { + get { return this.averageViewFrequencyFieldSpecified; } + set { this.averageViewFrequencyFieldSpecified = value; } + } + + public long uniqueViews { + get { return this.uniqueViewsField; } + set { + this.uniqueViewsField = value; + this.uniqueViewsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool uniqueViewsSpecified { + get { return this.uniqueViewsFieldSpecified; } + set { this.uniqueViewsFieldSpecified = value; } + } + + public long thumbnailImpressions { + get { return this.thumbnailImpressionsField; } + set { + this.thumbnailImpressionsField = value; + this.thumbnailImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thumbnailImpressionsSpecified { + get { return this.thumbnailImpressionsFieldSpecified; } + set { this.thumbnailImpressionsFieldSpecified = value; } + } + + public long videoImpressions { + get { return this.videoImpressionsField; } + set { + this.videoImpressionsField = value; + this.videoImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoImpressionsSpecified { + get { return this.videoImpressionsFieldSpecified; } + set { this.videoImpressionsFieldSpecified = value; } + } + + public long totalImpressions { + get { return this.totalImpressionsField; } + set { + this.totalImpressionsField = value; + this.totalImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalImpressionsSpecified { + get { return this.totalImpressionsFieldSpecified; } + set { this.totalImpressionsFieldSpecified = value; } + } + + public long websiteClicks { + get { return this.websiteClicksField; } + set { + this.websiteClicksField = value; + this.websiteClicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool websiteClicksSpecified { + get { return this.websiteClicksFieldSpecified; } + set { this.websiteClicksFieldSpecified = value; } + } + + public long conversions { + get { return this.conversionsField; } + set { + this.conversionsField = value; + this.conversionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool conversionsSpecified { + get { return this.conversionsFieldSpecified; } + set { this.conversionsFieldSpecified = value; } + } + + public Money costPerConversion { + get { return this.costPerConversionField; } + set { this.costPerConversionField = value; } + } + + public double conversionRate { + get { return this.conversionRateField; } + set { + this.conversionRateField = value; + this.conversionRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool conversionRateSpecified { + get { return this.conversionRateFieldSpecified; } + set { this.conversionRateFieldSpecified = value; } + } + + public long viewThroughConversions { + get { return this.viewThroughConversionsField; } + set { + this.viewThroughConversionsField = value; + this.viewThroughConversionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool viewThroughConversionsSpecified { + get { return this.viewThroughConversionsFieldSpecified; } + set { this.viewThroughConversionsFieldSpecified = value; } + } + + public long conversionsManyPerView { + get { return this.conversionsManyPerViewField; } + set { + this.conversionsManyPerViewField = value; + this.conversionsManyPerViewSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool conversionsManyPerViewSpecified { + get { return this.conversionsManyPerViewFieldSpecified; } + set { this.conversionsManyPerViewFieldSpecified = value; } + } + + public Money costPerConversionManyPerView { + get { return this.costPerConversionManyPerViewField; } + set { this.costPerConversionManyPerViewField = value; } + } + + public double conversionRateManyPerView { + get { return this.conversionRateManyPerViewField; } + set { + this.conversionRateManyPerViewField = value; + this.conversionRateManyPerViewSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool conversionRateManyPerViewSpecified { + get { return this.conversionRateManyPerViewFieldSpecified; } + set { this.conversionRateManyPerViewFieldSpecified = value; } + } + + public double totalConversionValue { + get { return this.totalConversionValueField; } + set { + this.totalConversionValueField = value; + this.totalConversionValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalConversionValueSpecified { + get { return this.totalConversionValueFieldSpecified; } + set { this.totalConversionValueFieldSpecified = value; } + } + + public double valuePerConv { + get { return this.valuePerConvField; } + set { + this.valuePerConvField = value; + this.valuePerConvSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valuePerConvSpecified { + get { return this.valuePerConvFieldSpecified; } + set { this.valuePerConvFieldSpecified = value; } + } + + public double valuePerConvManyPerView { + get { return this.valuePerConvManyPerViewField; } + set { + this.valuePerConvManyPerViewField = value; + this.valuePerConvManyPerViewSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valuePerConvManyPerViewSpecified { + get { return this.valuePerConvManyPerViewFieldSpecified; } + set { this.valuePerConvManyPerViewFieldSpecified = value; } + } + + public long followOnViews { + get { return this.followOnViewsField; } + set { + this.followOnViewsField = value; + this.followOnViewsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool followOnViewsSpecified { + get { return this.followOnViewsFieldSpecified; } + set { this.followOnViewsFieldSpecified = value; } + } + + public double followOnViewRate { + get { return this.followOnViewRateField; } + set { + this.followOnViewRateField = value; + this.followOnViewRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool followOnViewRateSpecified { + get { return this.followOnViewRateFieldSpecified; } + set { this.followOnViewRateFieldSpecified = value; } + } + + public long followOnSubscribes { + get { return this.followOnSubscribesField; } + set { + this.followOnSubscribesField = value; + this.followOnSubscribesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool followOnSubscribesSpecified { + get { return this.followOnSubscribesFieldSpecified; } + set { this.followOnSubscribesFieldSpecified = value; } + } + + public double followOnSubscribeRate { + get { return this.followOnSubscribeRateField; } + set { + this.followOnSubscribeRateField = value; + this.followOnSubscribeRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool followOnSubscribeRateSpecified { + get { return this.followOnSubscribeRateFieldSpecified; } + set { this.followOnSubscribeRateFieldSpecified = value; } + } + + public long followOnLikes { + get { return this.followOnLikesField; } + set { + this.followOnLikesField = value; + this.followOnLikesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool followOnLikesSpecified { + get { return this.followOnLikesFieldSpecified; } + set { this.followOnLikesFieldSpecified = value; } + } + + public long followOnComments { + get { return this.followOnCommentsField; } + set { + this.followOnCommentsField = value; + this.followOnCommentsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool followOnCommentsSpecified { + get { return this.followOnCommentsFieldSpecified; } + set { this.followOnCommentsFieldSpecified = value; } + } + + public long followOnShares { + get { return this.followOnSharesField; } + set { + this.followOnSharesField = value; + this.followOnSharesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool followOnSharesSpecified { + get { return this.followOnSharesFieldSpecified; } + set { this.followOnSharesFieldSpecified = value; } + } + + public long followOnAddToPlaylist { + get { return this.followOnAddToPlaylistField; } + set { + this.followOnAddToPlaylistField = value; + this.followOnAddToPlaylistSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool followOnAddToPlaylistSpecified { + get { return this.followOnAddToPlaylistFieldSpecified; } + set { this.followOnAddToPlaylistFieldSpecified = value; } + } + + public double ctr { + get { return this.ctrField; } + set { + this.ctrField = value; + this.ctrSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ctrSpecified { + get { return this.ctrFieldSpecified; } + set { this.ctrFieldSpecified = value; } + } + + public double vtr { + get { return this.vtrField; } + set { + this.vtrField = value; + this.vtrSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool vtrSpecified { + get { return this.vtrFieldSpecified; } + set { this.vtrFieldSpecified = value; } + } + + public long videoStarts { + get { return this.videoStartsField; } + set { + this.videoStartsField = value; + this.videoStartsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoStartsSpecified { + get { return this.videoStartsFieldSpecified; } + set { this.videoStartsFieldSpecified = value; } + } + + public long quartile25s { + get { return this.quartile25sField; } + set { + this.quartile25sField = value; + this.quartile25sSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool quartile25sSpecified { + get { return this.quartile25sFieldSpecified; } + set { this.quartile25sFieldSpecified = value; } + } + + public long quartile50s { + get { return this.quartile50sField; } + set { + this.quartile50sField = value; + this.quartile50sSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool quartile50sSpecified { + get { return this.quartile50sFieldSpecified; } + set { this.quartile50sFieldSpecified = value; } + } + + public long quartile75s { + get { return this.quartile75sField; } + set { + this.quartile75sField = value; + this.quartile75sSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool quartile75sSpecified { + get { return this.quartile75sFieldSpecified; } + set { this.quartile75sFieldSpecified = value; } + } + + public long quartile100s { + get { return this.quartile100sField; } + set { + this.quartile100sField = value; + this.quartile100sSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool quartile100sSpecified { + get { return this.quartile100sFieldSpecified; } + set { this.quartile100sFieldSpecified = value; } + } + + public double quartile25Percents { + get { return this.quartile25PercentsField; } + set { + this.quartile25PercentsField = value; + this.quartile25PercentsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool quartile25PercentsSpecified { + get { return this.quartile25PercentsFieldSpecified; } + set { this.quartile25PercentsFieldSpecified = value; } + } + + public double quartile50Percents { + get { return this.quartile50PercentsField; } + set { + this.quartile50PercentsField = value; + this.quartile50PercentsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool quartile50PercentsSpecified { + get { return this.quartile50PercentsFieldSpecified; } + set { this.quartile50PercentsFieldSpecified = value; } + } + + public double quartile75Percents { + get { return this.quartile75PercentsField; } + set { + this.quartile75PercentsField = value; + this.quartile75PercentsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool quartile75PercentsSpecified { + get { return this.quartile75PercentsFieldSpecified; } + set { this.quartile75PercentsFieldSpecified = value; } + } + + public double quartile100Percents { + get { return this.quartile100PercentsField; } + set { + this.quartile100PercentsField = value; + this.quartile100PercentsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool quartile100PercentsSpecified { + get { return this.quartile100PercentsFieldSpecified; } + set { this.quartile100PercentsFieldSpecified = value; } + } + + public double percentServed { + get { return this.percentServedField; } + set { + this.percentServedField = value; + this.percentServedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool percentServedSpecified { + get { return this.percentServedFieldSpecified; } + set { this.percentServedFieldSpecified = value; } + } + + public long eligibleFollowOnClicks { + get { return this.eligibleFollowOnClicksField; } + set { + this.eligibleFollowOnClicksField = value; + this.eligibleFollowOnClicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool eligibleFollowOnClicksSpecified { + get { return this.eligibleFollowOnClicksFieldSpecified; } + set { this.eligibleFollowOnClicksFieldSpecified = value; } + } + + public double engagementScore { + get { return this.engagementScoreField; } + set { + this.engagementScoreField = value; + this.engagementScoreSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool engagementScoreSpecified { + get { return this.engagementScoreFieldSpecified; } + set { this.engagementScoreFieldSpecified = value; } + } + + public double retentionScore { + get { return this.retentionScoreField; } + set { + this.retentionScoreField = value; + this.retentionScoreSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool retentionScoreSpecified { + get { return this.retentionScoreFieldSpecified; } + set { this.retentionScoreFieldSpecified = value; } + } + + public long totalViews { + get { return this.totalViewsField; } + set { + this.totalViewsField = value; + this.totalViewsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalViewsSpecified { + get { return this.totalViewsFieldSpecified; } + set { this.totalViewsFieldSpecified = value; } + } + + public long ctaImpressions { + get { return this.ctaImpressionsField; } + set { + this.ctaImpressionsField = value; + this.ctaImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ctaImpressionsSpecified { + get { return this.ctaImpressionsFieldSpecified; } + set { this.ctaImpressionsFieldSpecified = value; } + } + + public long ctaClicks { + get { return this.ctaClicksField; } + set { + this.ctaClicksField = value; + this.ctaClicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ctaClicksSpecified { + get { return this.ctaClicksFieldSpecified; } + set { this.ctaClicksFieldSpecified = value; } + } + + public double ctaCtr { + get { return this.ctaCtrField; } + set { + this.ctaCtrField = value; + this.ctaCtrSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ctaCtrSpecified { + get { return this.ctaCtrFieldSpecified; } + set { this.ctaCtrFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoEntityStats.SummaryType", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoEntityStatsSummaryType { + ALL, + ALL_ENABLED, + ALL_BUT_DELETED, + ALL_DELETED, + ALL_NON_VIDEO, + COMBINED_VIDEO_NON_VIDEO, + PERFORMANCE_OTHER, + NON_SUMMARY, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class SegmentKey { + private object itemField; + + [System.Xml.Serialization.XmlElementAttribute("CampaignKey", typeof(CampaignKey))] + [System.Xml.Serialization.XmlElementAttribute("ConversionTypeKey", typeof(ConversionTypeKey))] + [System.Xml.Serialization.XmlElementAttribute("DateKey", typeof(DateKey))] + [System.Xml.Serialization.XmlElementAttribute("DayOfWeekKey", typeof(DayOfWeekKey))] + [System.Xml.Serialization.XmlElementAttribute("DeviceKey", typeof(DeviceKey))] + [System.Xml.Serialization.XmlElementAttribute("DisplayFormatKey", typeof(DisplayFormatKey))] + [System.Xml.Serialization.XmlElementAttribute("DisplayFormatNetworkKey", typeof(DisplayFormatNetworkKey))] + [System.Xml.Serialization.XmlElementAttribute("DisplayFormatTypeKey", typeof(DisplayFormatTypeKey))] + [System.Xml.Serialization.XmlElementAttribute("HourOfDayKey", typeof(HourOfDayKey))] + [System.Xml.Serialization.XmlElementAttribute("NetworkKey", typeof(NetworkKey))] + [System.Xml.Serialization.XmlElementAttribute("PaidViewsKey", typeof(PaidViewsKey))] + [System.Xml.Serialization.XmlElementAttribute("TargetingGroupKey", typeof(TargetingGroupKey))] + [System.Xml.Serialization.XmlElementAttribute("VideoAdKey", typeof(VideoAdKey))] + public object Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class CampaignKey { + private string campaignNameField; + + public string campaignName { + get { return this.campaignNameField; } + set { this.campaignNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class ConversionTypeKey { + private long conversionTypeIdField; + + private bool conversionTypeIdFieldSpecified; + + private string conversionTypeNameField; + + public long conversionTypeId { + get { return this.conversionTypeIdField; } + set { + this.conversionTypeIdField = value; + this.conversionTypeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool conversionTypeIdSpecified { + get { return this.conversionTypeIdFieldSpecified; } + set { this.conversionTypeIdFieldSpecified = value; } + } + + public string conversionTypeName { + get { return this.conversionTypeNameField; } + set { this.conversionTypeNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class DateKey { + private string dateField; + + private SegmentationDimension dimensionField; + + private bool dimensionFieldSpecified; + + public string date { + get { return this.dateField; } + set { this.dateField = value; } + } + + public SegmentationDimension dimension { + get { return this.dimensionField; } + set { + this.dimensionField = value; + this.dimensionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dimensionSpecified { + get { return this.dimensionFieldSpecified; } + set { this.dimensionFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum SegmentationDimension { + NONE, + DATE_DAY, + DATE_WEEK, + DATE_MONTH, + DATE_QUARTER, + DATE_YEAR, + DAY_OF_WEEK, + DEVICE_TYPE, + DISPLAY_FORMAT, + DISPLAY_FORMATxNETWORK, + HOUR_OF_DAY, + NETWORK, + TARGETING_GROUP, + VIDEO_AD, + CONVERSION_TYPE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class DayOfWeekKey { + private VideoDayOfWeek dayOfWeekField; + + private bool dayOfWeekFieldSpecified; + + public VideoDayOfWeek dayOfWeek { + get { return this.dayOfWeekField; } + set { + this.dayOfWeekField = value; + this.dayOfWeekSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dayOfWeekSpecified { + get { return this.dayOfWeekFieldSpecified; } + set { this.dayOfWeekFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoDayOfWeek { + MONDAY, + TUESDAY, + WEDNESDAY, + THURSDAY, + FRIDAY, + SATURDAY, + SUNDAY + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class DeviceKey { + private DeviceKeyDeviceType deviceTypeField; + + private bool deviceTypeFieldSpecified; + + public DeviceKeyDeviceType deviceType { + get { return this.deviceTypeField; } + set { + this.deviceTypeField = value; + this.deviceTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deviceTypeSpecified { + get { return this.deviceTypeFieldSpecified; } + set { this.deviceTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DeviceKey.DeviceType", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum DeviceKeyDeviceType { + DESKTOP, + HIGHENDMOBILE, + TABLET, + OTHER + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class DisplayFormatKey { + private VideoAdDisplayFormat displayFormatField; + + private bool displayFormatFieldSpecified; + + public VideoAdDisplayFormat displayFormat { + get { return this.displayFormatField; } + set { + this.displayFormatField = value; + this.displayFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool displayFormatSpecified { + get { return this.displayFormatFieldSpecified; } + set { this.displayFormatFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoAdDisplayFormat { + TRUE_VIEW_IN_SEARCH, + TRUE_VIEW_IN_SLATE, + TRUE_VIEW_IN_DISPLAY, + TRUE_VIEW_IN_STREAM, + STANDARD_IN_STREAM, + ALL + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class DisplayFormatNetworkKey { + private VideoAdDisplayFormat formatField; + + private bool formatFieldSpecified; + + private VideoAdNetwork networkField; + + private bool networkFieldSpecified; + + public VideoAdDisplayFormat format { + get { return this.formatField; } + set { + this.formatField = value; + this.formatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool formatSpecified { + get { return this.formatFieldSpecified; } + set { this.formatFieldSpecified = value; } + } + + public VideoAdNetwork network { + get { return this.networkField; } + set { + this.networkField = value; + this.networkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool networkSpecified { + get { return this.networkFieldSpecified; } + set { this.networkFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoAdNetwork { + YOUTUBE_SEARCH, + YOUTUBE_WATCH, + GOOGLE_DISPLAY_NETWORK, + GOOGLE_SEARCH, + ALL + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class DisplayFormatTypeKey { + private VideoAdDisplayFormatType displayFormatTypeField; + + private bool displayFormatTypeFieldSpecified; + + public VideoAdDisplayFormatType displayFormatType { + get { return this.displayFormatTypeField; } + set { + this.displayFormatTypeField = value; + this.displayFormatTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool displayFormatTypeSpecified { + get { return this.displayFormatTypeFieldSpecified; } + set { this.displayFormatTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoAdDisplayFormat.Type", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoAdDisplayFormatType { + TRUE_VIEW, + STANDARD, + ALL + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class HourOfDayKey { + private int hourOfDayField; + + private bool hourOfDayFieldSpecified; + + public int hourOfDay { + get { return this.hourOfDayField; } + set { + this.hourOfDayField = value; + this.hourOfDaySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hourOfDaySpecified { + get { return this.hourOfDayFieldSpecified; } + set { this.hourOfDayFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class NetworkKey { + private VideoAdNetwork networkField; + + private bool networkFieldSpecified; + + public VideoAdNetwork network { + get { return this.networkField; } + set { + this.networkField = value; + this.networkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool networkSpecified { + get { return this.networkFieldSpecified; } + set { this.networkFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class PaidViewsKey { + private bool paidViewsField; + + private bool paidViewsFieldSpecified; + + public bool paidViews { + get { return this.paidViewsField; } + set { + this.paidViewsField = value; + this.paidViewsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool paidViewsSpecified { + get { return this.paidViewsFieldSpecified; } + set { this.paidViewsFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class TargetingGroupKey { + private long targetingGroupIdField; + + private bool targetingGroupIdFieldSpecified; + + private string targetingGroupNameField; + + public long targetingGroupId { + get { return this.targetingGroupIdField; } + set { + this.targetingGroupIdField = value; + this.targetingGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetingGroupIdSpecified { + get { return this.targetingGroupIdFieldSpecified; } + set { this.targetingGroupIdFieldSpecified = value; } + } + + public string targetingGroupName { + get { return this.targetingGroupNameField; } + set { this.targetingGroupNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoAdKey { + private string videoAdNameField; + + private long videoAdIdField; + + private bool videoAdIdFieldSpecified; + + public string videoAdName { + get { return this.videoAdNameField; } + set { this.videoAdNameField = value; } + } + + public long videoAdId { + get { return this.videoAdIdField; } + set { + this.videoAdIdField = value; + this.videoAdIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoAdIdSpecified { + get { return this.videoAdIdFieldSpecified; } + set { this.videoAdIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class Integer_LongMapEntry { + private int keyField; + + private bool keyFieldSpecified; + + private long valueField; + + private bool valueFieldSpecified; + + public int key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public long value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class ServingInfo { + private ServingIssue[] issuesField; + + private VideoServingStatus servingStatusField; + + private bool servingStatusFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("issues")] + public ServingIssue[] issues { + get { return this.issuesField; } + set { this.issuesField = value; } + } + + public VideoServingStatus servingStatus { + get { return this.servingStatusField; } + set { + this.servingStatusField = value; + this.servingStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool servingStatusSpecified { + get { return this.servingStatusFieldSpecified; } + set { this.servingStatusFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class ServingIssue { + private ServingIssueReason reasonField; + + private bool reasonFieldSpecified; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private long targetingGroupIdField; + + private bool targetingGroupIdFieldSpecified; + + private long videoAdIdField; + + private bool videoAdIdFieldSpecified; + + private string videoIdField; + + private bool hideActionLinkField; + + private bool hideActionLinkFieldSpecified; + + private ServingIssueSeverity severityField; + + private bool severityFieldSpecified; + + private ServingIssueType typeField; + + private bool typeFieldSpecified; + + public ServingIssueReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public long targetingGroupId { + get { return this.targetingGroupIdField; } + set { + this.targetingGroupIdField = value; + this.targetingGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetingGroupIdSpecified { + get { return this.targetingGroupIdFieldSpecified; } + set { this.targetingGroupIdFieldSpecified = value; } + } + + public long videoAdId { + get { return this.videoAdIdField; } + set { + this.videoAdIdField = value; + this.videoAdIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoAdIdSpecified { + get { return this.videoAdIdFieldSpecified; } + set { this.videoAdIdFieldSpecified = value; } + } + + public string videoId { + get { return this.videoIdField; } + set { this.videoIdField = value; } + } + + public bool hideActionLink { + get { return this.hideActionLinkField; } + set { + this.hideActionLinkField = value; + this.hideActionLinkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hideActionLinkSpecified { + get { return this.hideActionLinkFieldSpecified; } + set { this.hideActionLinkFieldSpecified = value; } + } + + public ServingIssueSeverity severity { + get { return this.severityField; } + set { + this.severityField = value; + this.severitySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool severitySpecified { + get { return this.severityFieldSpecified; } + set { this.severityFieldSpecified = value; } + } + + public ServingIssueType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ServingIssue.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum ServingIssueReason { + ACCOUNT_SUSPENDED, + ACCOUNT_CLOSED, + ACCOUNT_DISABLED, + SUSPENDED, + LIMITED_BY_BUDGET, + INSTREAM_TOO_HIGH, + ALL_CREATIVES_UNHEALTHY, + SOME_CREATIVES_DISAPPROVED, + ALL_CREATIVES_DISAPPROVED, + SOME_CREATIVES_LABELED, + ALL_CREATIVES_LABELED, + SOME_CREATIVES_UNREVIEWED, + ALL_CREATIVES_UNREVIEWED, + SOME_CREATIVES_ELIGIBLE, + ALL_CREATIVES_ELIGIBLE, + VIDEO_ADS_WITHOUT_TARGETING, + ACTIVE_AD_WITH_ALL_FORMATS_PAUSED, + TARGETING_BID_REQUIRED, + INSLATE_DEPRECATED, + TARGETING_DUPLICATE_NAME, + TARGETING_MISMATCH, + TARGETING_NO_VIDEOAD, + STUDY_INVITATION, + SURVEY_INVITATION, + NO_VIDEO_AD_SERVING, + ALL_VIDEO_ADS_PENDING, + SOME_VIDEO_ADS_PENDING, + ALL_VIDEO_ADS_UNHEALTHY, + SOME_VIDEO_ADS_UNHEALTHY, + NO_VIDEO, + NO_TARGETING, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ServingIssue.Severity", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum ServingIssueSeverity { + HIGH, + MEDIUM, + LOW + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ServingIssue.Type", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum ServingIssueType { + BLOCKING, + ISSUE, + NOTIFICATION, + PENDING + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoServingStatus { + UNDEFINED, + DELETED, + CAMPAIGN_DELETED, + PAUSED, + CAMPAIGN_PAUSED, + ENDED, + SUSPENDED, + BROKEN, + IMPROVABLE, + NOTIFICATION, + PENDING, + SERVING, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoImage { + private VideoImageType typeField; + + private bool typeFieldSpecified; + + private VideoImageType secondaryTypeField; + + private bool secondaryTypeFieldSpecified; + + private long mediaIdField; + + private bool mediaIdFieldSpecified; + + private string urlField; + + private VideoImageMimeType mimeTypeField; + + private bool mimeTypeFieldSpecified; + + public VideoImageType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public VideoImageType secondaryType { + get { return this.secondaryTypeField; } + set { + this.secondaryTypeField = value; + this.secondaryTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool secondaryTypeSpecified { + get { return this.secondaryTypeFieldSpecified; } + set { this.secondaryTypeFieldSpecified = value; } + } + + public long mediaId { + get { return this.mediaIdField; } + set { + this.mediaIdField = value; + this.mediaIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mediaIdSpecified { + get { return this.mediaIdFieldSpecified; } + set { this.mediaIdFieldSpecified = value; } + } + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + + public VideoImageMimeType mimeType { + get { return this.mimeTypeField; } + set { + this.mimeTypeField = value; + this.mimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mimeTypeSpecified { + get { return this.mimeTypeFieldSpecified; } + set { this.mimeTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoImage.Type", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoImageType { + MEDIA, + DEFAULT_THUMBNAIL, + THUMBNAIL1, + THUMBNAIL2, + THUMBNAIL3, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoImage.MimeType", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoImageMimeType { + IMAGE_JPEG, + IMAGE_GIF, + IMAGE_PNG, + FLASH + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoAd.YouTubeDestinationPage", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoAdYouTubeDestinationPage { + WATCH_PAGE, + CHANNEL_PAGE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoAdStatus { + ENABLED, + PAUSED, + DELETED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class ApprovalContext_VideoAd_ApprovalStatusMapEntry { + private ApprovalContext keyField; + + private VideoAdApprovalStatus valueField; + + private bool valueFieldSpecified; + + public ApprovalContext key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public VideoAdApprovalStatus value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class ApprovalContext { + private TargetingScope targetingScopeField; + + private bool targetingScopeFieldSpecified; + + private DestinationType destinationTypeField; + + private bool destinationTypeFieldSpecified; + + public TargetingScope targetingScope { + get { return this.targetingScopeField; } + set { + this.targetingScopeField = value; + this.targetingScopeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetingScopeSpecified { + get { return this.targetingScopeFieldSpecified; } + set { this.targetingScopeFieldSpecified = value; } + } + + public DestinationType destinationType { + get { return this.destinationTypeField; } + set { + this.destinationTypeField = value; + this.destinationTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool destinationTypeSpecified { + get { return this.destinationTypeFieldSpecified; } + set { this.destinationTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum TargetingScope { + TRUE_VIEW_IN_SEARCH_ON_YOUTUBE_SEARCH, + TRUE_VIEW_IN_SLATE_ON_YOUTUBE_WATCH, + TRUE_VIEW_IN_DISPLAY_ON_YOUTUBE_WATCH, + TRUE_VIEW_IN_STREAM_ON_YOUTUBE_WATCH, + TRUE_VIEW_IN_SLATE_ON_GOOGLE_DISPLAY_NETWORK, + TRUE_VIEW_IN_DISPLAY_ON_GOOGLE_DISPLAY_NETWORK, + TRUE_VIEW_IN_STREAM_ON_GOOGLE_DISPLAY_NETWORK, + TRUE_VIEW_IN_SEARCH_ON_GOOGLE_SEARCH, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum DestinationType { + YOUTUBE, + ADVERTISER_SITE, + LEGACY_BOTH, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoAd.ApprovalStatus", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoAdApprovalStatus { + APPROVED, + APPROVED_LIMITED, + ELIGIBLE, + UNDER_REVIEW, + DISAPPROVED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class ApprovalContext_VideoAd_ApprovalLimitMapEntry { + private ApprovalContext keyField; + + private VideoAdApprovalLimit valueField; + + private bool valueFieldSpecified; + + public ApprovalContext key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public VideoAdApprovalLimit value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoAd.ApprovalLimit", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoAdApprovalLimit { + FAMILY_SAFE, + NON_FAMILY_SAFE, + ADULT_CONTENT, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class ScopedDisapprovalReason { + private ApprovalContext approvalContextField; + + private DisapprovalReason disapprovalReasonField; + + public ApprovalContext approvalContext { + get { return this.approvalContextField; } + set { this.approvalContextField = value; } + } + + public DisapprovalReason disapprovalReason { + get { return this.disapprovalReasonField; } + set { this.disapprovalReasonField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class DisapprovalReason { + private string reasonField; + + private int helpIdField; + + private bool helpIdFieldSpecified; + + public string reason { + get { return this.reasonField; } + set { this.reasonField = value; } + } + + public int helpId { + get { return this.helpIdField; } + set { + this.helpIdField = value; + this.helpIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool helpIdSpecified { + get { return this.helpIdFieldSpecified; } + set { this.helpIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoAdDisplayFormat_VideoAdStatusMapEntry { + private VideoAdDisplayFormat keyField; + + private bool keyFieldSpecified; + + private VideoAdStatus valueField; + + private bool valueFieldSpecified; + + public VideoAdDisplayFormat key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public VideoAdStatus value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoAdOperation : Operation { + private VideoAd operandField; + + private ExemptionRequest[] exemptionRequestsField; + + public VideoAd operand { + get { return this.operandField; } + set { this.operandField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("exemptionRequests")] + public ExemptionRequest[] exemptionRequests { + get { return this.exemptionRequestsField; } + set { this.exemptionRequestsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoAdPage : Page { + private VideoAd[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public VideoAd[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class Sortable { + private object itemField; + + [System.Xml.Serialization.XmlElementAttribute("StatsSortable", typeof(StatsSortable))] + [System.Xml.Serialization.XmlElementAttribute("VideoAdSortable", typeof(VideoAdSortable))] + public object Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum StatsSortable { + AVERAGE_CPV, + AVERAGE_CPM, + VIEWS, + VIEW_RATE, + CTR, + COST, + COST_PER_CONVERSION, + IMPRESSIONS, + WEBSITE_CLICKS, + CONVERSIONS, + CONVERSION_RATE, + VIEW_THROUGH_CONVERSIONS, + CONVERSIONS_MANY_PER_VIEW, + CONVERSION_RATE_MANY_PER_VIEW, + COST_PER_CONVERSION_MANY_PER_VIEW, + TOTAL_CONV_VALUE, + VALUE_PER_CONV, + VALUE_PER_CONV_MANY_PER_VIEW, + PERCENT_SERVED, + VIDEO_STARTS, + QUARTILE_25S, + QUARTILE_50S, + QUARTILE_75S, + QUARTILE_100S, + QUARTILE_25_PERCENTS, + QUARTILE_50_PERCENTS, + QUARTILE_75_PERCENTS, + QUARTILE_100_PERCENTS, + FOLLOW_ON_SUBSCRIBES, + FOLLOW_ON_SUBSCRIBE_RATE, + FOLLOW_ON_VIEWS, + FOLLOW_ON_VIEW_RATE, + FOLLOW_ON_ADD_TO_PLAYLIST, + FOLLOW_ON_COMMENTS, + FOLLOW_ON_LIKES, + FOLLOW_ON_SHARES, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoAdSortable { + CAMPAIGN_ID, + CAMPAIGN_NAME, + NAME, + STATUS, + VIDEOAD_ID, + VIDEO_NAME, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class Sorting { + private Sortable fieldField; + + private VideoSortOrder sortOrderField; + + private bool sortOrderFieldSpecified; + + private Sortable[] fieldsField; + + private VideoSortOrder[] sortOrdersField; + + public Sortable field { + get { return this.fieldField; } + set { this.fieldField = value; } + } + + public VideoSortOrder sortOrder { + get { return this.sortOrderField; } + set { + this.sortOrderField = value; + this.sortOrderSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sortOrderSpecified { + get { return this.sortOrderFieldSpecified; } + set { this.sortOrderFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("fields")] + public Sortable[] fields { + get { return this.fieldsField; } + set { this.fieldsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("sortOrders")] + public VideoSortOrder[] sortOrders { + get { return this.sortOrdersField; } + set { this.sortOrdersField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoSortOrder { + ASCENDING, + DESCENDING + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class StatsSelector { + private DateRange dateRangeField; + + private SegmentationDimension[] segmentationDimensionsField; + + private Metric[] metricsField; + + private VideoEntityStatsSummaryType[] summaryTypesField; + + private VideoEntityStatsSummaryType segmentedSummaryTypeField; + + private bool segmentedSummaryTypeFieldSpecified; + + private StatsSelectorAllTimeRestrict allTimeRestrictField; + + private bool allTimeRestrictFieldSpecified; + + public DateRange dateRange { + get { return this.dateRangeField; } + set { this.dateRangeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("segmentationDimensions")] + public SegmentationDimension[] segmentationDimensions { + get { return this.segmentationDimensionsField; } + set { this.segmentationDimensionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("metrics")] + public Metric[] metrics { + get { return this.metricsField; } + set { this.metricsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("summaryTypes")] + public VideoEntityStatsSummaryType[] summaryTypes { + get { return this.summaryTypesField; } + set { this.summaryTypesField = value; } + } + + public VideoEntityStatsSummaryType segmentedSummaryType { + get { return this.segmentedSummaryTypeField; } + set { + this.segmentedSummaryTypeField = value; + this.segmentedSummaryTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool segmentedSummaryTypeSpecified { + get { return this.segmentedSummaryTypeFieldSpecified; } + set { this.segmentedSummaryTypeFieldSpecified = value; } + } + + public StatsSelectorAllTimeRestrict allTimeRestrict { + get { return this.allTimeRestrictField; } + set { + this.allTimeRestrictField = value; + this.allTimeRestrictSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allTimeRestrictSpecified { + get { return this.allTimeRestrictFieldSpecified; } + set { this.allTimeRestrictFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum Metric { + VIEWS, + THUMBNAIL_IMPRESSIONS, + VIDEO_IMPRESSIONS, + TOTAL_IMPRESSIONS, + COST, + AVERAGE_CPV, + VTR, + CONVERSIONS, + DAILY_UNIQUE_VIEWERS, + WEEKLY_UNIQUE_VIEWERS, + MONTHLY_UNIQUE_VIEWERS, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StatsSelector.AllTimeRestrict", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum StatsSelectorAllTimeRestrict { + NONE, + SINCE_VIDEO_AD_START, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoAdSelector { + private long[] campaignIdsField; + + private long[] idsField; + + private VideoAdStatus[] statusesField; + + private VideoCampaignStatus[] campaignStatusesField; + + private StatsSelector statsSelectorField; + + private Paging pagingField; + + private Sorting sortingField; + + [System.Xml.Serialization.XmlElementAttribute("campaignIds")] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ids")] + public long[] ids { + get { return this.idsField; } + set { this.idsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("statuses")] + public VideoAdStatus[] statuses { + get { return this.statusesField; } + set { this.statusesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignStatuses")] + public VideoCampaignStatus[] campaignStatuses { + get { return this.campaignStatusesField; } + set { this.campaignStatusesField = value; } + } + + public StatsSelector statsSelector { + get { return this.statsSelectorField; } + set { this.statsSelectorField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + + public Sorting sorting { + get { return this.sortingField; } + set { this.sortingField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoCampaignStatus { + ACTIVE, + DELETED, + PAUSED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoAdError : ApiError { + private VideoAdErrorReason reasonField; + + private bool reasonFieldSpecified; + + public VideoAdErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoAdError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoAdErrorReason { + UNKNOWN, + INVALID_FORMAT, + INVALID_INPUT, + EMPTY_FIELD, + URL_INVALID_TOP_LEVEL_DOMAIN, + URL_MALFORMED, + URL_NO_HOST, + URL_NO_SCHEME, + TOO_LONG, + LINE_TOO_WIDE, + INVALID_IMAGE_MEDIA_ID, + INVALID_COMPANION_BANNER_IMAGE_TYPE, + UNSUPPORTED_COMPANION_IMAGE_SIZE, + TOO_MANY_TARGETING_GROUP_ASSOCIATIONS, + TOO_MANY_VIDEO_ADS_PER_CUSTOMER, + TOO_MANY_VIDEO_ADS_PER_CAMPAIGN, + CANNOT_OPERATE_ON_DELETED_AD, + UNSUPPORTED_SCOPE_STATUS, + NO_SCOPE_STATUSES_SPECIFIED, + TARGETING_GROUP_FROM_DIFFERENT_CAMPAIGN, + APPROXIMATELY_TOO_LONG, + APPROXIMATELY_TOO_SHORT, + BAD_SNIPPET, + CUSTOMER_NOT_APPROVED_MOBILEADS, + CUSTOMER_NOT_ELIGIBLE, + INCORRECT_LENGTH, + INVALID_AD_ADDRESS_CAMPAIGN_TARGET, + INVALID_CHARACTER_FOR_URL, + INVALID_COUNTRY_CODE, + INVALID_MARKUP_LANGUAGE, + INVALID_MOBILE_CARRIER, + INVALID_MOBILE_CARRIER_TARGET, + TOO_SHORT, + URL_INVALID_SCHEME, + URL_HOST_NAME_TOO_LONG, + URL_NO_TOP_LEVEL_DOMAIN, + URL_PATH_NOT_ALLOWED, + URL_PORT_NOT_ALLOWED, + URL_QUERY_NOT_ALLOWED, + URL_SCHEME_BEFORE_DSA_TAG, + USER_DOES_NOT_HAVE_ACCESS_TO_TEMPLATE, + INVALID_FIELD_TEXT, + IMAGE_ERROR, + VIDEO_RETRIEVAL_ERROR, + AUDIO_ERROR, + DEPRECATED_FORMAT_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class TimeSeriesError : ApiError { + private TimeSeriesErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TimeSeriesErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TimeSeriesError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum TimeSeriesErrorReason { + UNKNOWN, + INVALID_SEGMENTATION_DIMENSION + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class SortingError : ApiError { + private SortingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SortingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SortingError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum SortingErrorReason { + SORT_ORDER_MISMATCH, + INVALID_FIELD, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class SegmentationError : ApiError { + private SegmentationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SegmentationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SegmentationError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum SegmentationErrorReason { + INCOMPATIBLE_DIMENSIONS, + UNSUPPORTED_SEGMENTATION, + MAXIMUM_SEGMENTATION_DIMENSIONS_EXCEEDED, + DATE_RANGE_TOO_LONG, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class ReportError : ApiError { + private ReportErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReportErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum ReportErrorReason { + UNKNOWN, + CRITERIA_TYPE_NOT_SUPPORTED, + INVALID_TARGETING_GROUP_ID_COUNT, + NO_STATS_SELECTOR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class PersistenceError : ApiError { + private PersistenceErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PersistenceErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PersistenceError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum PersistenceErrorReason { + LOAD_FAILED, + SAVE_FAILED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class EntityNotFoundError : ApiError { + private EntityNotFoundErrorReason reasonField; + + private bool reasonFieldSpecified; + + public EntityNotFoundErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "EntityNotFoundError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum EntityNotFoundErrorReason { + INVALID_ID + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class AdsApiError : ApiError { + private AdsApiErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdsApiErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdsApiError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum AdsApiErrorReason { + UNHANDLED_ADS_API_ERROR, + INTERNAL_ERROR, + UNEXPECTED_ERROR, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class AccessError : ApiError { + private AccessErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AccessErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AccessError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum AccessErrorReason { + ACTION_NOT_PERMITTED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "VideoCampaignCriterionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class VideoCampaignCriterionService : AdWordsSoapClient, IVideoCampaignCriterionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public VideoCampaignCriterionService() { + this.Url = "https://adwords.google.com/api/adwords/video/v201402/VideoCampaignCriterionServic" + "e"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual VideoCampaignCriterionPage get(VideoCampaignCriterionSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((VideoCampaignCriterionPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual VideoCampaignCriterionReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +VideoCampaignCriterionOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((VideoCampaignCriterionReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoCampaignCriterionReturnValue : ListReturnValue { + private VideoCampaignCriterion[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public VideoCampaignCriterion[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReportedVideoCampaignCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NegativeVideoCampaignCriterion))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoCampaignCriterion { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private string campaignNameField; + + private BaseCriterion criterionField; + + private string videoCampaignCriterionTypeField; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public string campaignName { + get { return this.campaignNameField; } + set { this.campaignNameField = value; } + } + + public BaseCriterion criterion { + get { return this.criterionField; } + set { this.criterionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("VideoCampaignCriterion.Type")] + public string VideoCampaignCriterionType { + get { return this.videoCampaignCriterionTypeField; } + set { this.videoCampaignCriterionTypeField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(YouTubePlacement))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WebSite))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Topic))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RunOfYoutube))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlatformVideoCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystemVersionVideoCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileDeviceVideoCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileApplicationVideoCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileAppCategoryVideoCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LocationVideoCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LanguageVideoCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseKeyword))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SearchKeyword))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentKeyword))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentCategoryLabel))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Channel))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CarrierVideoCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceUserList))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceInterest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceGender))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceAge))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdScheduleVideoCriterion))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public abstract partial class BaseCriterion { + private long idField; + + private bool idFieldSpecified; + + private string baseCriterionTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseCriterion.Type")] + public string BaseCriterionType { + get { return this.baseCriterionTypeField; } + set { this.baseCriterionTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class YouTubePlacement : BaseCriterion { + private string urlField; + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class WebSite : BaseCriterion { + private string urlField; + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoCriterion : BaseCriterion { + private string videoIdField; + + private string videoNameField; + + public string videoId { + get { return this.videoIdField; } + set { this.videoIdField = value; } + } + + public string videoName { + get { return this.videoNameField; } + set { this.videoNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class Topic : BaseCriterion { + private long verticalIdField; + + private bool verticalIdFieldSpecified; + + private string[] verticalPathField; + + public long verticalId { + get { return this.verticalIdField; } + set { + this.verticalIdField = value; + this.verticalIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool verticalIdSpecified { + get { return this.verticalIdFieldSpecified; } + set { this.verticalIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("verticalPath")] + public string[] verticalPath { + get { return this.verticalPathField; } + set { this.verticalPathField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class RunOfYoutube : BaseCriterion { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class PlatformVideoCriterion : BaseCriterion { + private string platformNameField; + + public string platformName { + get { return this.platformNameField; } + set { this.platformNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class OperatingSystemVersionVideoCriterion : BaseCriterion { + private string nameField; + + private int osMajorVersionField; + + private bool osMajorVersionFieldSpecified; + + private int osMinorVersionField; + + private bool osMinorVersionFieldSpecified; + + private VideoOperatingSystemVersionOperatorType operatorTypeField; + + private bool operatorTypeFieldSpecified; + + private long operatingSystemIdField; + + private bool operatingSystemIdFieldSpecified; + + private bool obsoleteField; + + private bool obsoleteFieldSpecified; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public int osMajorVersion { + get { return this.osMajorVersionField; } + set { + this.osMajorVersionField = value; + this.osMajorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool osMajorVersionSpecified { + get { return this.osMajorVersionFieldSpecified; } + set { this.osMajorVersionFieldSpecified = value; } + } + + public int osMinorVersion { + get { return this.osMinorVersionField; } + set { + this.osMinorVersionField = value; + this.osMinorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool osMinorVersionSpecified { + get { return this.osMinorVersionFieldSpecified; } + set { this.osMinorVersionFieldSpecified = value; } + } + + public VideoOperatingSystemVersionOperatorType operatorType { + get { return this.operatorTypeField; } + set { + this.operatorTypeField = value; + this.operatorTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorTypeSpecified { + get { return this.operatorTypeFieldSpecified; } + set { this.operatorTypeFieldSpecified = value; } + } + + public long operatingSystemId { + get { return this.operatingSystemIdField; } + set { + this.operatingSystemIdField = value; + this.operatingSystemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatingSystemIdSpecified { + get { return this.operatingSystemIdFieldSpecified; } + set { this.operatingSystemIdFieldSpecified = value; } + } + + public bool obsolete { + get { return this.obsoleteField; } + set { + this.obsoleteField = value; + this.obsoleteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool obsoleteSpecified { + get { return this.obsoleteFieldSpecified; } + set { this.obsoleteFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoOperatingSystemVersion.OperatorType", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoOperatingSystemVersionOperatorType { + GREATER_THAN_EQUAL_TO, + EQUAL_TO, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class MobileDeviceVideoCriterion : BaseCriterion { + private string deviceNameField; + + private string manufacturerNameField; + + private VideoMobileDeviceDeviceType deviceTypeField; + + private bool deviceTypeFieldSpecified; + + private string operatingSystemNameField; + + public string deviceName { + get { return this.deviceNameField; } + set { this.deviceNameField = value; } + } + + public string manufacturerName { + get { return this.manufacturerNameField; } + set { this.manufacturerNameField = value; } + } + + public VideoMobileDeviceDeviceType deviceType { + get { return this.deviceTypeField; } + set { + this.deviceTypeField = value; + this.deviceTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deviceTypeSpecified { + get { return this.deviceTypeFieldSpecified; } + set { this.deviceTypeFieldSpecified = value; } + } + + public string operatingSystemName { + get { return this.operatingSystemNameField; } + set { this.operatingSystemNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoMobileDevice.DeviceType", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoMobileDeviceDeviceType { + DEVICE_TYPE_MOBILE, + DEVICE_TYPE_TABLET + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class MobileApplicationVideoCriterion : BaseCriterion { + private string appIdField; + + public string appId { + get { return this.appIdField; } + set { this.appIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class MobileAppCategoryVideoCriterion : BaseCriterion { + private int mobileAppCategoryIdField; + + private bool mobileAppCategoryIdFieldSpecified; + + public int mobileAppCategoryId { + get { return this.mobileAppCategoryIdField; } + set { + this.mobileAppCategoryIdField = value; + this.mobileAppCategoryIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mobileAppCategoryIdSpecified { + get { return this.mobileAppCategoryIdFieldSpecified; } + set { this.mobileAppCategoryIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class LocationVideoCriterion : BaseCriterion { + private string locationNameField; + + private string displayTypeField; + + private bool isObsoleteField; + + private bool isObsoleteFieldSpecified; + + private LocationVideoCriterion[] parentLocationsField; + + public string locationName { + get { return this.locationNameField; } + set { this.locationNameField = value; } + } + + public string displayType { + get { return this.displayTypeField; } + set { this.displayTypeField = value; } + } + + public bool isObsolete { + get { return this.isObsoleteField; } + set { + this.isObsoleteField = value; + this.isObsoleteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isObsoleteSpecified { + get { return this.isObsoleteFieldSpecified; } + set { this.isObsoleteFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("parentLocations")] + public LocationVideoCriterion[] parentLocations { + get { return this.parentLocationsField; } + set { this.parentLocationsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class LanguageVideoCriterion : BaseCriterion { + private string codeField; + + private string nameField; + + public string code { + get { return this.codeField; } + set { this.codeField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SearchKeyword))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentKeyword))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class BaseKeyword : BaseCriterion { + private string textField; + + private BaseKeywordMatchType matchTypeField; + + private bool matchTypeFieldSpecified; + + public string text { + get { return this.textField; } + set { this.textField = value; } + } + + public BaseKeywordMatchType matchType { + get { return this.matchTypeField; } + set { + this.matchTypeField = value; + this.matchTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool matchTypeSpecified { + get { return this.matchTypeFieldSpecified; } + set { this.matchTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BaseKeyword.MatchType", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum BaseKeywordMatchType { + EXACT, + PHRASE, + BROAD, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class SearchKeyword : BaseKeyword { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class ContentKeyword : BaseKeyword { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class ContentCategoryLabel : BaseCriterion { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class Channel : BaseCriterion { + private string userNameField; + + private string userIdField; + + private string publicNameField; + + public string userName { + get { return this.userNameField; } + set { this.userNameField = value; } + } + + public string userId { + get { return this.userIdField; } + set { this.userIdField = value; } + } + + public string publicName { + get { return this.publicNameField; } + set { this.publicNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class CarrierVideoCriterion : BaseCriterion { + private string nameField; + + private string countryCodeField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class AudienceUserList : BaseCriterion { + private long listIdField; + + private bool listIdFieldSpecified; + + private string nameField; + + public long listId { + get { return this.listIdField; } + set { + this.listIdField = value; + this.listIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool listIdSpecified { + get { return this.listIdFieldSpecified; } + set { this.listIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class AudienceInterest : BaseCriterion { + private long interestIdField; + + private bool interestIdFieldSpecified; + + private string[] interestPathField; + + public long interestId { + get { return this.interestIdField; } + set { + this.interestIdField = value; + this.interestIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool interestIdSpecified { + get { return this.interestIdFieldSpecified; } + set { this.interestIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("interestPath")] + public string[] interestPath { + get { return this.interestPathField; } + set { this.interestPathField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class AudienceGender : BaseCriterion { + private AudienceGenderGenderType genderTypeField; + + private bool genderTypeFieldSpecified; + + public AudienceGenderGenderType genderType { + get { return this.genderTypeField; } + set { + this.genderTypeField = value; + this.genderTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool genderTypeSpecified { + get { return this.genderTypeFieldSpecified; } + set { this.genderTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceGender.GenderType", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum AudienceGenderGenderType { + GENDER_MALE, + GENDER_FEMALE, + GENDER_UNDETERMINED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class AudienceAge : BaseCriterion { + private AudienceAgeAgeRange ageRangeField; + + private bool ageRangeFieldSpecified; + + public AudienceAgeAgeRange ageRange { + get { return this.ageRangeField; } + set { + this.ageRangeField = value; + this.ageRangeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ageRangeSpecified { + get { return this.ageRangeFieldSpecified; } + set { this.ageRangeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceAge.AgeRange", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum AudienceAgeAgeRange { + AGE_RANGE_18_24, + AGE_RANGE_25_34, + AGE_RANGE_35_44, + AGE_RANGE_45_54, + AGE_RANGE_55_64, + AGE_RANGE_65_UP, + AGE_RANGE_UNDETERMINED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class AdScheduleVideoCriterion : BaseCriterion { + private VideoDayOfWeek dayOfWeekField; + + private bool dayOfWeekFieldSpecified; + + private int startHourField; + + private bool startHourFieldSpecified; + + private VideoMinuteOfHour startMinuteField; + + private bool startMinuteFieldSpecified; + + private int endHourField; + + private bool endHourFieldSpecified; + + private VideoMinuteOfHour endMinuteField; + + private bool endMinuteFieldSpecified; + + public VideoDayOfWeek dayOfWeek { + get { return this.dayOfWeekField; } + set { + this.dayOfWeekField = value; + this.dayOfWeekSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dayOfWeekSpecified { + get { return this.dayOfWeekFieldSpecified; } + set { this.dayOfWeekFieldSpecified = value; } + } + + public int startHour { + get { return this.startHourField; } + set { + this.startHourField = value; + this.startHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startHourSpecified { + get { return this.startHourFieldSpecified; } + set { this.startHourFieldSpecified = value; } + } + + public VideoMinuteOfHour startMinute { + get { return this.startMinuteField; } + set { + this.startMinuteField = value; + this.startMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startMinuteSpecified { + get { return this.startMinuteFieldSpecified; } + set { this.startMinuteFieldSpecified = value; } + } + + public int endHour { + get { return this.endHourField; } + set { + this.endHourField = value; + this.endHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endHourSpecified { + get { return this.endHourFieldSpecified; } + set { this.endHourFieldSpecified = value; } + } + + public VideoMinuteOfHour endMinute { + get { return this.endMinuteField; } + set { + this.endMinuteField = value; + this.endMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endMinuteSpecified { + get { return this.endMinuteFieldSpecified; } + set { this.endMinuteFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoMinuteOfHour { + ZERO, + FIFTEEN, + THIRTY, + FORTY_FIVE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class ReportedVideoCampaignCriterion : VideoCampaignCriterion { + private VideoEntityStats statsField; + + private VideoEntityStats[] segmentedStatsField; + + private bool excludedField; + + private bool excludedFieldSpecified; + + public VideoEntityStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("segmentedStats")] + public VideoEntityStats[] segmentedStats { + get { return this.segmentedStatsField; } + set { this.segmentedStatsField = value; } + } + + public bool excluded { + get { return this.excludedField; } + set { + this.excludedField = value; + this.excludedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool excludedSpecified { + get { return this.excludedFieldSpecified; } + set { this.excludedFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class NegativeVideoCampaignCriterion : VideoCampaignCriterion { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoCampaignCriterionOperation : Operation { + private VideoCampaignCriterion operandField; + + public VideoCampaignCriterion operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoCampaignReportPage : Page { + private ReportedVideoCampaignCriterion[] entriesField; + + private VideoEntityStats[] summaryStatsField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public ReportedVideoCampaignCriterion[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("summaryStats")] + public VideoEntityStats[] summaryStats { + get { return this.summaryStatsField; } + set { this.summaryStatsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoCampaignCriterionPage : Page { + private VideoCampaignCriterion[] entriesField; + + private VideoEntityStats[] summaryStatsField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public VideoCampaignCriterion[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("summaryStats")] + public VideoEntityStats[] summaryStats { + get { return this.summaryStatsField; } + set { this.summaryStatsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoCampaignCriterionSortable { + CAMPAIGN_ID + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoCampaignCriterionSelector { + private long[] campaignIdsField; + + private VideoCampaignStatus[] campaignStatusesField; + + private BaseCriterionType[] criterionTypesField; + + private Sorting sortingField; + + private Paging pagingField; + + [System.Xml.Serialization.XmlElementAttribute("campaignIds")] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignStatuses")] + public VideoCampaignStatus[] campaignStatuses { + get { return this.campaignStatusesField; } + set { this.campaignStatusesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("criterionTypes")] + public BaseCriterionType[] criterionTypes { + get { return this.criterionTypesField; } + set { this.criterionTypesField = value; } + } + + public Sorting sorting { + get { return this.sortingField; } + set { this.sortingField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BaseCriterion.Type", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum BaseCriterionType { + AGE, + CARRIER, + CHANNEL, + CONTENT_KEYWORD, + CONTENT_LABEL, + GENDER, + INTEREST, + KEYWORD, + LANGUAGE, + LOCATION, + MOBILE_APPLICATION, + MOBILE_APP_CATEGORY, + MOBILE_DEVICE, + OPERATING_SYSTEM_VERSION, + PLATFORM, + RUN_OF_YOUTUBE, + SCHEDULE, + SEARCH_KEYWORD, + USER_LIST, + VERTICAL, + VIDEO, + WEB_SITE, + YOUTUBE_PLACEMENT, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoCampaignCriterionError : ApiError { + private VideoCampaignCriterionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public VideoCampaignCriterionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoCampaignCriterionError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoCampaignCriterionErrorReason { + UNKNOWN, + INVALID_CRITERION_USE, + INVALID_CRITERION_TYPE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class TargetingGroupCriterionError : ApiError { + private TargetingGroupCriterionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TargetingGroupCriterionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TargetingGroupCriterionError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum TargetingGroupCriterionErrorReason { + UNKNOWN, + WEBSITE_NOT_ALLOWED_FOR_NETWORK, + NETWORK_NOT_SUPPORTED, + INVALID_KEYWORD_TEXT, + KEYWORD_TEXT_TOO_LONG, + KEYWORD_HAS_TOO_MANY_WORDS, + KEYWORD_HAS_INVALID_CHARS, + INVALID_WEBSITE_URL, + INVALID_FORMAT_FOR_WEBSITE_URL, + WEBSITE_URL_IS_TOO_LONG, + WEBSITE_URL_HAS_ILLEGAL_CHAR, + WEBSITE_URL_HAS_MULTIPLE_SITES_IN_LINE, + WEBSITE_DOMAIN_BLACKLISTED, + INVALID_VIDEO_ID, + INVALID_CHANNEL_ID, + INVALID_VERTICAL_PATH, + INVALID_USER_LIST_ID, + KEYWORD_UNSUPPORTED, + INVALID_TARGETING_GROUP_ID, + INVALID_CRITERION_ID, + IMMUTABLE_NEGATIVE, + WEBSITE_URL_HAS_SCHEMA, + USER_ID_OF_CHANNEL_MISSING, + TOO_MANY_CRITERIONS_PER_TARGETING_GROUP, + INVALID_STATUS, + MUTATING_REPORTED_TGC, + UNSUPPORTED_BID_OVERRIDE, + CANNOT_TARGET_AND_EXCLUDE, + CANNOT_REMOVE_CRITERION, + CANNOT_TARGET_CRITERION, + CANNOT_TARGET_OBSOLETE_CRITERION + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "VideoCampaignServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class VideoCampaignService : AdWordsSoapClient, IVideoCampaignService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public VideoCampaignService() { + this.Url = "https://adwords.google.com/api/adwords/video/v201402/VideoCampaignService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual VideoCampaignPage get(VideoCampaignSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((VideoCampaignPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual VideoCampaignReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +VideoCampaignOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((VideoCampaignReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoCampaignReturnValue : ListReturnValue { + private VideoCampaign[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public VideoCampaign[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoCampaign { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private VideoCampaignStatus statusField; + + private bool statusFieldSpecified; + + private string startDateField; + + private string endDateField; + + private long budgetIdField; + + private bool budgetIdFieldSpecified; + + private VideoCampaignBiddingMode biddingModeField; + + private bool biddingModeFieldSpecified; + + private VideoCampaignTargetingMode targetingModeField; + + private bool targetingModeFieldSpecified; + + private VideoCampaignSpendingStatus spendingStatusField; + + private bool spendingStatusFieldSpecified; + + private CampaignSchedulingStatus schedulingStatusField; + + private bool schedulingStatusFieldSpecified; + + private VideoAdServingOptimizationStatus adServingOptimizationStatusField; + + private bool adServingOptimizationStatusFieldSpecified; + + private VideoFrequencyCap frequencyCapField; + + private VideoAdNetwork[] networksField; + + private VideoEntityStats statsField; + + private VideoEntityStats[] segmentedStatsField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public VideoCampaignStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public string endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + public long budgetId { + get { return this.budgetIdField; } + set { + this.budgetIdField = value; + this.budgetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool budgetIdSpecified { + get { return this.budgetIdFieldSpecified; } + set { this.budgetIdFieldSpecified = value; } + } + + public VideoCampaignBiddingMode biddingMode { + get { return this.biddingModeField; } + set { + this.biddingModeField = value; + this.biddingModeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool biddingModeSpecified { + get { return this.biddingModeFieldSpecified; } + set { this.biddingModeFieldSpecified = value; } + } + + public VideoCampaignTargetingMode targetingMode { + get { return this.targetingModeField; } + set { + this.targetingModeField = value; + this.targetingModeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetingModeSpecified { + get { return this.targetingModeFieldSpecified; } + set { this.targetingModeFieldSpecified = value; } + } + + public VideoCampaignSpendingStatus spendingStatus { + get { return this.spendingStatusField; } + set { + this.spendingStatusField = value; + this.spendingStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool spendingStatusSpecified { + get { return this.spendingStatusFieldSpecified; } + set { this.spendingStatusFieldSpecified = value; } + } + + public CampaignSchedulingStatus schedulingStatus { + get { return this.schedulingStatusField; } + set { + this.schedulingStatusField = value; + this.schedulingStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool schedulingStatusSpecified { + get { return this.schedulingStatusFieldSpecified; } + set { this.schedulingStatusFieldSpecified = value; } + } + + public VideoAdServingOptimizationStatus adServingOptimizationStatus { + get { return this.adServingOptimizationStatusField; } + set { + this.adServingOptimizationStatusField = value; + this.adServingOptimizationStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adServingOptimizationStatusSpecified { + get { return this.adServingOptimizationStatusFieldSpecified; } + set { this.adServingOptimizationStatusFieldSpecified = value; } + } + + public VideoFrequencyCap frequencyCap { + get { return this.frequencyCapField; } + set { this.frequencyCapField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("networks", IsNullable = false)] + public VideoAdNetwork[] networks { + get { return this.networksField; } + set { this.networksField = value; } + } + + public VideoEntityStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("segmentedStats")] + public VideoEntityStats[] segmentedStats { + get { return this.segmentedStatsField; } + set { this.segmentedStatsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoCampaign.BiddingMode", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoCampaignBiddingMode { + AUTO, + MANUAL, + NONE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoCampaign.TargetingMode", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoCampaignTargetingMode { + AUTO, + MANUAL + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoCampaign.SpendingStatus", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoCampaignSpendingStatus { + UNAVAILABLE, + SUSPENDED, + CONSTRAINED, + NON_CONSTRAINED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum CampaignSchedulingStatus { + UNAVAILABLE, + CURRENT, + ENDED, + PENDING + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoAdServingOptimizationStatus { + OPTIMIZE, + CONVERSION_OPTIMIZE, + ROTATE, + ROTATE_FOREVER, + UNAVAILABLE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoFrequencyCap { + private long impressionsField; + + private bool impressionsFieldSpecified; + + private VideoTimeUnit timeUnitField; + + private bool timeUnitFieldSpecified; + + private VideoLevel levelField; + + private bool levelFieldSpecified; + + public long impressions { + get { return this.impressionsField; } + set { + this.impressionsField = value; + this.impressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsSpecified { + get { return this.impressionsFieldSpecified; } + set { this.impressionsFieldSpecified = value; } + } + + public VideoTimeUnit timeUnit { + get { return this.timeUnitField; } + set { + this.timeUnitField = value; + this.timeUnitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool timeUnitSpecified { + get { return this.timeUnitFieldSpecified; } + set { this.timeUnitFieldSpecified = value; } + } + + public VideoLevel level { + get { return this.levelField; } + set { + this.levelField = value; + this.levelSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool levelSpecified { + get { return this.levelFieldSpecified; } + set { this.levelFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoTimeUnit { + MINUTE, + HOUR, + DAY, + WEEK, + MONTH, + LIFETIME + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoLevel { + VIDEO_CAMPAIGN, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoCampaignOperation : Operation { + private VideoCampaign operandField; + + public VideoCampaign operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoBudget { + private long budgetIdField; + + private bool budgetIdFieldSpecified; + + private string nameField; + + private Money amountField; + + private VideoBudgetBudgetDeliveryMethod deliveryMethodField; + + private bool deliveryMethodFieldSpecified; + + private bool isExplicitlySharedField; + + private bool isExplicitlySharedFieldSpecified; + + public long budgetId { + get { return this.budgetIdField; } + set { + this.budgetIdField = value; + this.budgetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool budgetIdSpecified { + get { return this.budgetIdFieldSpecified; } + set { this.budgetIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public Money amount { + get { return this.amountField; } + set { this.amountField = value; } + } + + public VideoBudgetBudgetDeliveryMethod deliveryMethod { + get { return this.deliveryMethodField; } + set { + this.deliveryMethodField = value; + this.deliveryMethodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryMethodSpecified { + get { return this.deliveryMethodFieldSpecified; } + set { this.deliveryMethodFieldSpecified = value; } + } + + public bool isExplicitlyShared { + get { return this.isExplicitlySharedField; } + set { + this.isExplicitlySharedField = value; + this.isExplicitlySharedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isExplicitlySharedSpecified { + get { return this.isExplicitlySharedFieldSpecified; } + set { this.isExplicitlySharedFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoBudget.BudgetDeliveryMethod", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoBudgetBudgetDeliveryMethod { + STANDARD, + ACCELERATED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class SummaryBudgets { + private VideoBudget totalVideoBudgetField; + + private Money nonVideoBudgetField; + + private Money combinedBudgetField; + + public VideoBudget totalVideoBudget { + get { return this.totalVideoBudgetField; } + set { this.totalVideoBudgetField = value; } + } + + public Money nonVideoBudget { + get { return this.nonVideoBudgetField; } + set { this.nonVideoBudgetField = value; } + } + + public Money combinedBudget { + get { return this.combinedBudgetField; } + set { this.combinedBudgetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoCampaignPage : Page { + private VideoCampaign[] entriesField; + + private VideoEntityStats[] summaryStatsField; + + private SummaryBudgets summaryBudgetsField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public VideoCampaign[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("summaryStats")] + public VideoEntityStats[] summaryStats { + get { return this.summaryStatsField; } + set { this.summaryStatsField = value; } + } + + public SummaryBudgets summaryBudgets { + get { return this.summaryBudgetsField; } + set { this.summaryBudgetsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoCampaignSortable { + BUDGET_AMOUNT, + CAMPAIGN_ID, + END_DATE, + NAME, + START_DATE, + STATUS, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoCampaignSelector { + private long[] idsField; + + private VideoCampaignStatus[] campaignStatusesField; + + private StatsSelector statsSelectorField; + + private Paging pagingField; + + private Sorting sortingField; + + [System.Xml.Serialization.XmlElementAttribute("ids")] + public long[] ids { + get { return this.idsField; } + set { this.idsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignStatuses")] + public VideoCampaignStatus[] campaignStatuses { + get { return this.campaignStatusesField; } + set { this.campaignStatusesField = value; } + } + + public StatsSelector statsSelector { + get { return this.statsSelectorField; } + set { this.statsSelectorField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + + public Sorting sorting { + get { return this.sortingField; } + set { this.sortingField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoCampaignError : ApiError { + private VideoCampaignErrorReason reasonField; + + private bool reasonFieldSpecified; + + public VideoCampaignErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoCampaignError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoCampaignErrorReason { + UNKNOWN, + AFTER_MAXIMUM_ALLOWABLE_DATE, + CANNOT_SET_DATE_TO_PAST, + DUPLICATE_CAMPAIGN_NAME, + INVALID_CAMPAIGN_NAME, + START_DATE_AFTER_END_DATE, + CANNOT_MODIFY_START_DATE_IF_ALREADY_STARTED, + INVALID_OPERATION_IF_SERVING_STATUS_HAS_ENDED, + CAMPAIGN_LIMIT + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoBudgetError : ApiError { + private VideoBudgetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public VideoBudgetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoBudgetError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoBudgetErrorReason { + MONEY_AMOUNT_LESS_THAN_CURRENCY_MINIMUM_CPC, + MONEY_AMOUNT_LESS_THAN_MAXIMUM_AD_GROUP_CPM, + MONEY_AMOUNT_LESS_THAN_MAXIMUM_SITE_CPM, + MONEY_AMOUNT_LESS_THAN_MINIMUM_AD_GROUP_CPC, + MONEY_AMOUNT_LESS_THAN_MINIMUM_CRITERIA_CPC, + MONEY_AMOUNT_TOO_LARGE, + NON_MULTIPLE_OF_MINIMUM_CURRENCY_UNIT, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoBiddingError : ApiError { + private VideoBiddingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public VideoBiddingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoBiddingError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoBiddingErrorReason { + BID_AMOUNT_REQUIRED, + BID_TOO_SMALL, + BID_TOO_BIG, + BID_TOO_MANY_FRACTIONAL_DIGITS, + BID_TOO_HIGH_FOR_DAILY_BUDGET, + NON_POSITIVE_BID, + BID_FOR_DEPRECATED_FORMAT, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class NetworkError : ApiError { + private NetworkErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NetworkErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NetworkError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum NetworkErrorReason { + EMPTY, + INVALID, + NOT_ALLOWED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "VideoServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class VideoService : AdWordsSoapClient, IVideoService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public VideoService() { + this.Url = "https://adwords.google.com/api/adwords/video/v201402/VideoService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual VideoPage get(VideoSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((VideoPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual VideoReturnValue mutateCallToAction([System.Xml.Serialization.XmlElementAttribute("operations")] +VideoCallToActionOperation[] operations) { + object[] results = this.Invoke("mutateCallToAction", new object[] { operations }); + return ((VideoReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual VideoSearchPage search(VideoSearchSelector selector) { + object[] results = this.Invoke("search", new object[] { selector }); + return ((VideoSearchPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoSearchSelector { + private VideoSearchSelectorSearchType searchTypeField; + + private bool searchTypeFieldSpecified; + + private string[] videoIdsField; + + private string queryField; + + private string[] channelUserNamesField; + + private string[] channelUserIdsField; + + private Paging pagingField; + + private Sorting sortingField; + + public VideoSearchSelectorSearchType searchType { + get { return this.searchTypeField; } + set { + this.searchTypeField = value; + this.searchTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool searchTypeSpecified { + get { return this.searchTypeFieldSpecified; } + set { this.searchTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("videoIds")] + public string[] videoIds { + get { return this.videoIdsField; } + set { this.videoIdsField = value; } + } + + public string query { + get { return this.queryField; } + set { this.queryField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("channelUserNames")] + public string[] channelUserNames { + get { return this.channelUserNamesField; } + set { this.channelUserNamesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("channelUserIds")] + public string[] channelUserIds { + get { return this.channelUserIdsField; } + set { this.channelUserIdsField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + + public Sorting sorting { + get { return this.sortingField; } + set { this.sortingField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoSearchSelector.SearchType", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoSearchSelectorSearchType { + VIDEO, + CHANNEL + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoSearchSortable { + RELEVANCE, + DATE_UPLOADED, + VIEW_COUNT, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoSortable { + TITLE, + DATE_UPLOADED, + DURATION, + CHANNEL, + VIEW_COUNT, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoStatsSortable { + TOTAL_VIEWS, + CTA_IMPRESSIONS, + CTA_CLICKS, + CTA_CTR, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoReturnValue : ListReturnValue { + private YouTubeVideo[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public YouTubeVideo[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class YouTubeVideo { + private string idField; + + private string titleField; + + private string descriptionField; + + private string dateUploadedField; + + private long durationSecField; + + private bool durationSecFieldSpecified; + + private string userPublicNameField; + + private string userIdField; + + private long viewCountField; + + private bool viewCountFieldSpecified; + + private VideoCampaignInfo[] campaignInfosField; + + private CallToAction callToActionField; + + private VideoEntityStats statsField; + + private VideoEntityStats[] segmentedStatsField; + + private YouTubeVideoAccessLevel accessLevelField; + + private bool accessLevelFieldSpecified; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string title { + get { return this.titleField; } + set { this.titleField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public string dateUploaded { + get { return this.dateUploadedField; } + set { this.dateUploadedField = value; } + } + + public long durationSec { + get { return this.durationSecField; } + set { + this.durationSecField = value; + this.durationSecSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSecSpecified { + get { return this.durationSecFieldSpecified; } + set { this.durationSecFieldSpecified = value; } + } + + public string userPublicName { + get { return this.userPublicNameField; } + set { this.userPublicNameField = value; } + } + + public string userId { + get { return this.userIdField; } + set { this.userIdField = value; } + } + + public long viewCount { + get { return this.viewCountField; } + set { + this.viewCountField = value; + this.viewCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool viewCountSpecified { + get { return this.viewCountFieldSpecified; } + set { this.viewCountFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignInfos")] + public VideoCampaignInfo[] campaignInfos { + get { return this.campaignInfosField; } + set { this.campaignInfosField = value; } + } + + public CallToAction callToAction { + get { return this.callToActionField; } + set { this.callToActionField = value; } + } + + public VideoEntityStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("segmentedStats")] + public VideoEntityStats[] segmentedStats { + get { return this.segmentedStatsField; } + set { this.segmentedStatsField = value; } + } + + public YouTubeVideoAccessLevel accessLevel { + get { return this.accessLevelField; } + set { + this.accessLevelField = value; + this.accessLevelSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool accessLevelSpecified { + get { return this.accessLevelFieldSpecified; } + set { this.accessLevelFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoCampaignInfo { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private string campaignNameField; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public string campaignName { + get { return this.campaignNameField; } + set { this.campaignNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class CallToAction { + private CallToActionCreative creativeField; + + private bool isEnabledOnMobileField; + + private bool isEnabledOnMobileFieldSpecified; + + private CallToActionStatus statusField; + + private bool statusFieldSpecified; + + private CallToActionPolicyViolation[] policyViolationsField; + + public CallToActionCreative creative { + get { return this.creativeField; } + set { this.creativeField = value; } + } + + public bool isEnabledOnMobile { + get { return this.isEnabledOnMobileField; } + set { + this.isEnabledOnMobileField = value; + this.isEnabledOnMobileSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isEnabledOnMobileSpecified { + get { return this.isEnabledOnMobileFieldSpecified; } + set { this.isEnabledOnMobileFieldSpecified = value; } + } + + public CallToActionStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("policyViolations")] + public CallToActionPolicyViolation[] policyViolations { + get { return this.policyViolationsField; } + set { this.policyViolationsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CallToAction.Creative", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class CallToActionCreative { + private CallToActionCreativeType typeField; + + private bool typeFieldSpecified; + + private string headlineField; + + private string descriptionLine1Field; + + private string descriptionLine2Field; + + private string displayUrlField; + + private string destinationUrlField; + + private CallToActionImage imageField; + + public CallToActionCreativeType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public string headline { + get { return this.headlineField; } + set { this.headlineField = value; } + } + + public string descriptionLine1 { + get { return this.descriptionLine1Field; } + set { this.descriptionLine1Field = value; } + } + + public string descriptionLine2 { + get { return this.descriptionLine2Field; } + set { this.descriptionLine2Field = value; } + } + + public string displayUrl { + get { return this.displayUrlField; } + set { this.displayUrlField = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + public CallToActionImage image { + get { return this.imageField; } + set { this.imageField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CallToAction.Creative.Type", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum CallToActionCreativeType { + TEXT_ONLY, + TEXT_AND_IMAGE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class CallToActionImage { + private byte[] dataField; + + private string imageUrlField; + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] data { + get { return this.dataField; } + set { this.dataField = value; } + } + + public string imageUrl { + get { return this.imageUrlField; } + set { this.imageUrlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CallToAction.Status", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum CallToActionStatus { + ACTIVE, + INACTIVE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CallToAction.PolicyViolation", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class CallToActionPolicyViolation { + private string textField; + + public string text { + get { return this.textField; } + set { this.textField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "YouTubeVideo.AccessLevel", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum YouTubeVideoAccessLevel { + FULL_LINKED, + LIMITED_NOT_LINKED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoCallToAction { + private string idField; + + private CallToAction callToActionField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public CallToAction callToAction { + get { return this.callToActionField; } + set { this.callToActionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoOperation : Operation { + private YouTubeVideo operandField; + + public YouTubeVideo operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoCallToActionOperation : Operation { + private VideoCallToAction operandField; + + public VideoCallToAction operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoSearchPage : Page { + private string[] recommendedChannelsField; + + private YouTubeVideo[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("recommendedChannels")] + public string[] recommendedChannels { + get { return this.recommendedChannelsField; } + set { this.recommendedChannelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public YouTubeVideo[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoPage : Page { + private YouTubeVideo[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public YouTubeVideo[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoSelector { + private string[] videoIdsField; + + private long[] campaignIdsField; + + private VideoCampaignStatus[] campaignStatusesField; + + private bool includeCallToActionsField; + + private bool includeCallToActionsFieldSpecified; + + private StatsSelector statsSelectorField; + + private Paging pagingField; + + private Sorting sortingField; + + [System.Xml.Serialization.XmlElementAttribute("videoIds")] + public string[] videoIds { + get { return this.videoIdsField; } + set { this.videoIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignIds")] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignStatuses")] + public VideoCampaignStatus[] campaignStatuses { + get { return this.campaignStatusesField; } + set { this.campaignStatusesField = value; } + } + + public bool includeCallToActions { + get { return this.includeCallToActionsField; } + set { + this.includeCallToActionsField = value; + this.includeCallToActionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeCallToActionsSpecified { + get { return this.includeCallToActionsFieldSpecified; } + set { this.includeCallToActionsFieldSpecified = value; } + } + + public StatsSelector statsSelector { + get { return this.statsSelectorField; } + set { this.statsSelectorField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + + public Sorting sorting { + get { return this.sortingField; } + set { this.sortingField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoServiceError : ApiError { + private VideoServiceErrorReason reasonField; + + private bool reasonFieldSpecified; + + public VideoServiceErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoServiceError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoServiceErrorReason { + UNKNOWN, + INVALID_VIDEO_ID, + VIDEO_NOT_FOUND, + INVALID_CHANNEL, + VIDEO_LOOKUP_SERVICE_UNAVAILABLE, + VIDEO_SEARCH_SERVICE_UNAVAILABLE, + CHANNEL_SEARCH_SERVICE_UNAVAILABLE, + YOUTUBE_ANALYTICS_SERVICE_UNAVAILABLE, + VIDEO_NOT_OWNED_BY_LINKED_ACCOUNT, + VIDEO_NOT_ENABLED_FOR_CALL_TO_ACTION, + CALL_TO_ACTION_NOT_FOUND, + INVALID_CALL_TO_ACTION, + UNKNOWN_CALL_TO_ACTION_ERROR, + CALL_TO_ACTION_TOO_LONG, + CALL_TO_ACTION_INVALID_FORMAT, + CALL_TO_ACTION_INVALID_CHARS, + CALL_TO_ACTION_INVALID_INPUT, + INVALID_FORMAT, + INVALID_INPUT, + INVALID_IMAGE_FILESIZE, + UNSUPPORTED_IMAGE_FORMAT, + DUPLICATE_VIDEO_ID, + TOO_LONG + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "VideoTargetingGroupCriterionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class VideoTargetingGroupCriterionService : AdWordsSoapClient, IVideoTargetingGroupCriterionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public VideoTargetingGroupCriterionService() { + this.Url = "https://adwords.google.com/api/adwords/video/v201402/VideoTargetingGroupCriterion" + "Service"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TargetingGroupCriterionPage get(TargetingGroupCriterionSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((TargetingGroupCriterionPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TargetingGroupCriterionReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +TargetingGroupCriterionOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((TargetingGroupCriterionReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class TargetingGroupCriterionReturnValue : ListReturnValue { + private TargetingGroupCriterion[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public TargetingGroupCriterion[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReportedTargetingGroupCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NegativeTargetingGroupCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddableTargetingGroupCriterion))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class TargetingGroupCriterion { + private long targetingGroupIdField; + + private bool targetingGroupIdFieldSpecified; + + private string targetingGroupNameField; + + private BaseCriterion criterionField; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private string targetingGroupCriterionTypeField; + + public long targetingGroupId { + get { return this.targetingGroupIdField; } + set { + this.targetingGroupIdField = value; + this.targetingGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetingGroupIdSpecified { + get { return this.targetingGroupIdFieldSpecified; } + set { this.targetingGroupIdFieldSpecified = value; } + } + + public string targetingGroupName { + get { return this.targetingGroupNameField; } + set { this.targetingGroupNameField = value; } + } + + public BaseCriterion criterion { + get { return this.criterionField; } + set { this.criterionField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("TargetingGroupCriterion.Type")] + public string TargetingGroupCriterionType { + get { return this.targetingGroupCriterionTypeField; } + set { this.targetingGroupCriterionTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class ReportedTargetingGroupCriterion : TargetingGroupCriterion { + private VideoEntityStats statsField; + + private VideoEntityStats[] segmentedStatsField; + + private bool excludedField; + + private bool excludedFieldSpecified; + + private bool partiallyExcludedField; + + private bool partiallyExcludedFieldSpecified; + + public VideoEntityStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("segmentedStats")] + public VideoEntityStats[] segmentedStats { + get { return this.segmentedStatsField; } + set { this.segmentedStatsField = value; } + } + + public bool excluded { + get { return this.excludedField; } + set { + this.excludedField = value; + this.excludedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool excludedSpecified { + get { return this.excludedFieldSpecified; } + set { this.excludedFieldSpecified = value; } + } + + public bool partiallyExcluded { + get { return this.partiallyExcludedField; } + set { + this.partiallyExcludedField = value; + this.partiallyExcludedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool partiallyExcludedSpecified { + get { return this.partiallyExcludedFieldSpecified; } + set { this.partiallyExcludedFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class NegativeTargetingGroupCriterion : TargetingGroupCriterion { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class BiddableTargetingGroupCriterion : TargetingGroupCriterion { + private VideoUserStatus userStatusField; + + private bool userStatusFieldSpecified; + + private VideoEntityStats statsField; + + private VideoEntityStats[] segmentedStatsField; + + public VideoUserStatus userStatus { + get { return this.userStatusField; } + set { + this.userStatusField = value; + this.userStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userStatusSpecified { + get { return this.userStatusFieldSpecified; } + set { this.userStatusFieldSpecified = value; } + } + + public VideoEntityStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("segmentedStats")] + public VideoEntityStats[] segmentedStats { + get { return this.segmentedStatsField; } + set { this.segmentedStatsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoUserStatus { + ACTIVE, + DELETED, + PAUSED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class TargetingGroupCriterionOperation : Operation { + private TargetingGroupCriterion operandField; + + private ExemptionRequest[] exemptionRequestsField; + + public TargetingGroupCriterion operand { + get { return this.operandField; } + set { this.operandField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("exemptionRequests")] + public ExemptionRequest[] exemptionRequests { + get { return this.exemptionRequestsField; } + set { this.exemptionRequestsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class TargetingGroupReportPage : Page { + private ReportedTargetingGroupCriterion[] entriesField; + + private VideoEntityStats[] summaryStatsField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public ReportedTargetingGroupCriterion[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("summaryStats")] + public VideoEntityStats[] summaryStats { + get { return this.summaryStatsField; } + set { this.summaryStatsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class TargetingGroupCriterionPage : Page { + private TargetingGroupCriterion[] entriesField; + + private VideoEntityStats[] summaryStatsField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public TargetingGroupCriterion[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("summaryStats")] + public VideoEntityStats[] summaryStats { + get { return this.summaryStatsField; } + set { this.summaryStatsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum TargetingGroupCriterionSortable { + UNKNOWN, + CRITERION_ID, + TARGETING_GROUP_ID, + STATUS, + NAME, + TYPE, + TARGETING_GROUP_NAME + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class TargetingGroupCriterionSelector { + private CriteriaDimension criteriaDimensionField; + + private bool criteriaDimensionFieldSpecified; + + private BaseCriterionType[] criterionTypesField; + + private VideoUserStatus[] userStatusesField; + + private VideoCampaignStatus[] campaignStatusesField; + + private StatsSelector statsSelectorField; + + private Paging pagingField; + + private Sorting sortingField; + + private long[] campaignIdsField; + + private long[] targetingGroupIdsField; + + private long[] criterionIdsField; + + private TargetingGroupCriterionSelectorCriterionUse criterionUseField; + + private bool criterionUseFieldSpecified; + + public CriteriaDimension criteriaDimension { + get { return this.criteriaDimensionField; } + set { + this.criteriaDimensionField = value; + this.criteriaDimensionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criteriaDimensionSpecified { + get { return this.criteriaDimensionFieldSpecified; } + set { this.criteriaDimensionFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("criterionTypes")] + public BaseCriterionType[] criterionTypes { + get { return this.criterionTypesField; } + set { this.criterionTypesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("userStatuses")] + public VideoUserStatus[] userStatuses { + get { return this.userStatusesField; } + set { this.userStatusesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignStatuses")] + public VideoCampaignStatus[] campaignStatuses { + get { return this.campaignStatusesField; } + set { this.campaignStatusesField = value; } + } + + public StatsSelector statsSelector { + get { return this.statsSelectorField; } + set { this.statsSelectorField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + + public Sorting sorting { + get { return this.sortingField; } + set { this.sortingField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignIds")] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetingGroupIds")] + public long[] targetingGroupIds { + get { return this.targetingGroupIdsField; } + set { this.targetingGroupIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("criterionIds")] + public long[] criterionIds { + get { return this.criterionIdsField; } + set { this.criterionIdsField = value; } + } + + public TargetingGroupCriterionSelectorCriterionUse criterionUse { + get { return this.criterionUseField; } + set { + this.criterionUseField = value; + this.criterionUseSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionUseSpecified { + get { return this.criterionUseFieldSpecified; } + set { this.criterionUseFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum CriteriaDimension { + AGE, + GENDER, + KEYWORD, + PLACEMENT, + TOPIC, + USER, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TargetingGroupCriterionSelector.CriterionUse", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum TargetingGroupCriterionSelectorCriterionUse { + BIDDABLE, + NEGATIVE, + ALL + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdGroupCriterionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdGroupCriterionService : AdWordsSoapClient, IAdGroupCriterionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdGroupCriterionService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/AdGroupCriterionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupCriterionPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((AdGroupCriterionPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupCriterionReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +AdGroupCriterionOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((AdGroupCriterionReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupCriterionPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((AdGroupCriterionPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupCriterionReturnValue : ListReturnValue { + private AdGroupCriterion[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdGroupCriterion[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupCriterionPage : Page { + private AdGroupCriterion[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public AdGroupCriterion[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "VideoTargetingGroupServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class VideoTargetingGroupService : AdWordsSoapClient, IVideoTargetingGroupService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public VideoTargetingGroupService() { + this.Url = "https://adwords.google.com/api/adwords/video/v201402/VideoTargetingGroupService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TargetingGroupPage get(TargetingGroupSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((TargetingGroupPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/video/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/video/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TargetingGroupReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +TargetingGroupOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((TargetingGroupReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class TargetingGroupReturnValue : ListReturnValue { + private TargetingGroup[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public TargetingGroup[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class TargetingGroup { + private long idField; + + private bool idFieldSpecified; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private string nameField; + + private TargetingGroupStatus statusField; + + private bool statusFieldSpecified; + + private VideoAdDisplayFormat_VideoBidMapEntry[] bidsByFormatField; + + private VideoEntityStats statsField; + + private ServingInfo issuesField; + + private VideoEntityStats[] segmentedStatsField; + + private string campaignNameField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public TargetingGroupStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("bidsByFormat", IsNullable = false)] + public VideoAdDisplayFormat_VideoBidMapEntry[] bidsByFormat { + get { return this.bidsByFormatField; } + set { this.bidsByFormatField = value; } + } + + public VideoEntityStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public ServingInfo issues { + get { return this.issuesField; } + set { this.issuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("segmentedStats")] + public VideoEntityStats[] segmentedStats { + get { return this.segmentedStatsField; } + set { this.segmentedStatsField = value; } + } + + public string campaignName { + get { return this.campaignNameField; } + set { this.campaignNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum TargetingGroupStatus { + ACTIVE, + DELETED, + PAUSED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoAdDisplayFormat_VideoBidMapEntry { + private VideoAdDisplayFormat keyField; + + private bool keyFieldSpecified; + + private VideoBid valueField; + + public VideoAdDisplayFormat key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public VideoBid value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class VideoBid { + private Money amountField; + + private VideoBidSource sourceField; + + private bool sourceFieldSpecified; + + public Money amount { + get { return this.amountField; } + set { this.amountField = value; } + } + + public VideoBidSource source { + get { return this.sourceField; } + set { + this.sourceField = value; + this.sourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sourceSpecified { + get { return this.sourceFieldSpecified; } + set { this.sourceFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoBid.Source", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum VideoBidSource { + TARGETING_GROUP, + CRITERION + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class TargetingGroupOperation : Operation { + private TargetingGroup operandField; + + public TargetingGroup operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class TargetingGroupPage : Page { + private TargetingGroup[] entriesField; + + private VideoEntityStats[] summaryStatsField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public TargetingGroup[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("summaryStats")] + public VideoEntityStats[] summaryStats { + get { return this.summaryStatsField; } + set { this.summaryStatsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum TargetingGroupSortable { + UNKNOWN, + TARGETING_GROUP_NAME, + STATUS, + BID, + TARGETING_GROUP_ID + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class TargetingGroupSelector { + private long[] idsField; + + private long[] campaignIdsField; + + private TargetingGroupStatus[] statusesField; + + private VideoCampaignStatus[] campaignStatusesField; + + private StatsSelector statsSelectorField; + + private Paging pagingField; + + private Sorting sortingField; + + [System.Xml.Serialization.XmlElementAttribute("ids")] + public long[] ids { + get { return this.idsField; } + set { this.idsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignIds")] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("statuses")] + public TargetingGroupStatus[] statuses { + get { return this.statusesField; } + set { this.statusesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignStatuses")] + public VideoCampaignStatus[] campaignStatuses { + get { return this.campaignStatusesField; } + set { this.campaignStatusesField = value; } + } + + public StatsSelector statsSelector { + get { return this.statsSelectorField; } + set { this.statsSelectorField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + + public Sorting sorting { + get { return this.sortingField; } + set { this.sortingField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public partial class TargetingGroupError : ApiError { + private TargetingGroupErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TargetingGroupErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TargetingGroupError.Reason", Namespace = "https://adwords.google.com/api/adwords/video/v201402")] + public enum TargetingGroupErrorReason { + UNKNOWN, + DUPLICATE_TARGETING_GROUP_ID, + DUPLICATE_TARGETING_GROUP_NAME, + DETECTED_DUPLICATE_TARGETING_GROUP_NAME, + IMMUTABLE_FIELD, + INVALID_TARGETING_GROUP_ID, + INVALID_TARGETING_GROUP_NAME, + NOT_PERSISTENT, + TARGETING_GROUP_NOT_FOUND, + TOO_MANY_TARGETING_GROUPS + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ExpressBusinessServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ExpressBusinessService : AdWordsSoapClient, IExpressBusinessService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ExpressBusinessService() { + this.Url = "https://adwords.google.com/api/adwords/express/v201402/ExpressBusinessService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/express/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/express/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExpressBusinessPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((ExpressBusinessPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/express/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/express/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExpressBusiness[] mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +ExpressBusinessOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((ExpressBusiness[]) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + public partial class ExpressBusinessOperation : Operation { + private ExpressBusiness operandField; + + public ExpressBusiness operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + public partial class ExpressBusiness { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private ExpressBusinessStatus statusField; + + private bool statusFieldSpecified; + + private Address addressField; + + private GeoPoint geoPointField; + + private PhoneNumber phoneNumberField; + + private string websiteField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ExpressBusinessStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public Address address { + get { return this.addressField; } + set { this.addressField = value; } + } + + public GeoPoint geoPoint { + get { return this.geoPointField; } + set { this.geoPointField = value; } + } + + public PhoneNumber phoneNumber { + get { return this.phoneNumberField; } + set { this.phoneNumberField = value; } + } + + public string website { + get { return this.websiteField; } + set { this.websiteField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ExpressBusiness.Status", Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + public enum ExpressBusinessStatus { + ACTIVE, + DELETED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + public partial class PhoneNumber { + private ExpressRegionCode regionCodeField; + + private bool regionCodeFieldSpecified; + + private string numberField; + + public ExpressRegionCode regionCode { + get { return this.regionCodeField; } + set { + this.regionCodeField = value; + this.regionCodeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool regionCodeSpecified { + get { return this.regionCodeFieldSpecified; } + set { this.regionCodeFieldSpecified = value; } + } + + public string number { + get { return this.numberField; } + set { this.numberField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + public enum ExpressRegionCode { + AC, + AD, + AE, + AF, + AG, + AI, + AL, + AM, + AN, + AO, + AQ, + AR, + AS, + AT, + AU, + AW, + AX, + AZ, + BA, + BB, + BD, + BE, + BF, + BG, + BH, + BI, + BJ, + BL, + BM, + BN, + BO, + BQ, + BR, + BS, + BT, + BU, + BV, + BW, + BY, + BZ, + CA, + CC, + CD, + CF, + CG, + CH, + CI, + CK, + CL, + CM, + CN, + CO, + CP, + CR, + CS, + CU, + CV, + CW, + CX, + CY, + CZ, + DD, + DE, + DG, + DJ, + DK, + DM, + DO, + DZ, + EA, + EC, + EE, + EG, + EH, + ER, + ES, + ET, + EU, + FI, + FJ, + FK, + FM, + FO, + FR, + FX, + GA, + GB, + GD, + GE, + GF, + GG, + GH, + GI, + GL, + GM, + GN, + GP, + GQ, + GR, + GS, + GT, + GU, + GW, + GY, + HK, + HM, + HN, + HR, + HT, + HU, + IC, + ID, + IE, + IL, + IM, + IN, + IO, + IQ, + IR, + IS, + IT, + JE, + JM, + JO, + JP, + KE, + KG, + KH, + KI, + KM, + KN, + KP, + KR, + KW, + KY, + KZ, + LA, + LB, + LC, + LI, + LK, + LR, + LS, + LT, + LU, + LV, + LY, + MA, + MC, + MD, + ME, + MF, + MG, + MH, + MK, + ML, + MM, + MN, + MO, + MP, + MQ, + MR, + MS, + MT, + MU, + MV, + MW, + MX, + MY, + MZ, + NA, + NC, + NE, + NF, + NG, + NI, + NL, + NO, + NP, + NR, + NT, + NU, + NZ, + OM, + PA, + PE, + PF, + PG, + PH, + PK, + PL, + PM, + PN, + PR, + PS, + PT, + PW, + PY, + QA, + QO, + QU, + RE, + RO, + RS, + RU, + RW, + SA, + SB, + SC, + SD, + SE, + SG, + SH, + SI, + SJ, + SK, + SL, + SM, + SN, + SO, + SR, + SS, + ST, + SU, + SV, + SX, + SY, + SZ, + TA, + TC, + TD, + TF, + TG, + TH, + TJ, + TK, + TL, + TM, + TN, + TO, + TP, + TR, + TT, + TV, + TW, + TZ, + UA, + UG, + UM, + US, + UY, + UZ, + VA, + VC, + VE, + VG, + VI, + VN, + VU, + WF, + WS, + XA, + XB, + XC, + XK, + YD, + YE, + YT, + YU, + ZA, + ZM, + ZR, + ZW, + ZZ, + UN001, + UN002, + UN003, + UN005, + UN009, + UN011, + UN013, + UN014, + UN015, + UN017, + UN018, + UN019, + UN021, + UN029, + UN030, + UN034, + UN035, + UN039, + UN053, + UN054, + UN057, + UN061, + UN142, + UN143, + UN145, + UN150, + UN151, + UN154, + UN155, + UN419 + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExpressBusinessPage))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PromotionPage))] + public abstract partial class ExpressNoStatsPage : Page { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + public partial class ExpressBusinessPage : ExpressNoStatsPage { + private ExpressBusiness[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public ExpressBusiness[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + public partial class ExpressBusinessError : ApiError { + private ExpressBusinessErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ExpressBusinessErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ExpressBusinessError.Reason", Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + public enum ExpressBusinessErrorReason { + INVALID_WEBSITE, + INVALID_ADDRESS, + INVALID_PHONE_NUMBER, + PREMIUM_RATE_PHONE_NUMBER_NOT_ALLOWED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "PromotionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SoapHeader))] + public partial class PromotionService : AdWordsSoapClient, IPromotionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public PromotionService() { + this.Url = "https://adwords.google.com/api/adwords/express/v201402/PromotionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/express/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/express/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual PromotionPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((PromotionPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/express/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/express/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Promotion[] mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +PromotionOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((Promotion[]) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + public partial class PromotionOperation : Operation { + private Promotion operandField; + + public Promotion operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + public partial class Promotion { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private PromotionStatus statusField; + + private bool statusFieldSpecified; + + private Creative[] creativesField; + + private string destinationUrlField; + + private PhoneNumber phoneNumberField; + + private bool streetAddressVisibleField; + + private bool streetAddressVisibleFieldSpecified; + + private bool callTrackingEnabledField; + + private bool callTrackingEnabledFieldSpecified; + + private Money budgetField; + + private Criterion[] criteriaField; + + private long[] campaignIdsField; + + private Money remainingBudgetField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public PromotionStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creatives")] + public Creative[] creatives { + get { return this.creativesField; } + set { this.creativesField = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + public PhoneNumber phoneNumber { + get { return this.phoneNumberField; } + set { this.phoneNumberField = value; } + } + + public bool streetAddressVisible { + get { return this.streetAddressVisibleField; } + set { + this.streetAddressVisibleField = value; + this.streetAddressVisibleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool streetAddressVisibleSpecified { + get { return this.streetAddressVisibleFieldSpecified; } + set { this.streetAddressVisibleFieldSpecified = value; } + } + + public bool callTrackingEnabled { + get { return this.callTrackingEnabledField; } + set { + this.callTrackingEnabledField = value; + this.callTrackingEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool callTrackingEnabledSpecified { + get { return this.callTrackingEnabledFieldSpecified; } + set { this.callTrackingEnabledFieldSpecified = value; } + } + + public Money budget { + get { return this.budgetField; } + set { this.budgetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("criteria")] + public Criterion[] criteria { + get { return this.criteriaField; } + set { this.criteriaField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignIds")] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + public Money remainingBudget { + get { return this.remainingBudgetField; } + set { this.remainingBudgetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Promotion.Status", Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + public enum PromotionStatus { + DRAFT, + ACTIVE, + PAUSED, + DELETED, + UPGRADED_TO_ADWORDS + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + public partial class Creative { + private string headlineField; + + private string line1Field; + + private string line2Field; + + public string headline { + get { return this.headlineField; } + set { this.headlineField = value; } + } + + public string line1 { + get { return this.line1Field; } + set { this.line1Field = value; } + } + + public string line2 { + get { return this.line2Field; } + set { this.line2Field = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + public partial class NegativeKeyword : Keyword { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + public partial class ProductService : Criterion, IProductService { + private string textField; + + private string localeField; + + public virtual string text { + get { return this.textField; } + set { this.textField = value; } + } + + public virtual string locale { + get { return this.localeField; } + set { this.localeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + public partial class NegativeCriterion : Criterion { + private Criterion criterionField; + + public Criterion criterion { + get { return this.criterionField; } + set { this.criterionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + public partial class KeywordSet : Criterion { + private string keywordSetIdField; + + private string nameField; + + private bool deprecatedField; + + private bool deprecatedFieldSpecified; + + public string keywordSetId { + get { return this.keywordSetIdField; } + set { this.keywordSetIdField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public bool deprecated { + get { return this.deprecatedField; } + set { + this.deprecatedField = value; + this.deprecatedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deprecatedSpecified { + get { return this.deprecatedFieldSpecified; } + set { this.deprecatedFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + public partial class PromotionPage : ExpressNoStatsPage { + private Promotion[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Promotion[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + public partial class PromotionError : ApiError { + private PromotionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PromotionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PromotionError.Reason", Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + public enum PromotionErrorReason { + BUSINESS_DELETED, + CURRENCY_NOT_SUPPORTED, + GOOGLE_GRANT_ACCOUNT, + AOL_ACCOUNT, + MCC_ACCOUNT, + INVALID_DESTINATION_URL, + CALL_TRACKING_NOT_SUPPORTED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProductServiceServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Criterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProductServiceService : AdWordsSoapClient, IProductServiceService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProductServiceService() { + this.Url = "https://adwords.google.com/api/adwords/express/v201402/ProductServiceService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/express/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/express/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductServicePage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((ProductServicePage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201402")] + public partial class ProductServicePage : NoStatsPage { + private ProductService[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public ProductService[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CampaignSharedSetServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CampaignSharedSetService : AdWordsSoapClient, ICampaignSharedSetService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CampaignSharedSetService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/CampaignSharedSetService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignSharedSetPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((CampaignSharedSetPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignSharedSetReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +CampaignSharedSetOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((CampaignSharedSetReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignSharedSetReturnValue : ListReturnValue { + private CampaignSharedSet[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public CampaignSharedSet[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignSharedSet { + private long sharedSetIdField; + + private bool sharedSetIdFieldSpecified; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private string sharedSetNameField; + + private SharedSetType sharedSetTypeField; + + private bool sharedSetTypeFieldSpecified; + + private string campaignNameField; + + private CampaignSharedSetStatus statusField; + + private bool statusFieldSpecified; + + public long sharedSetId { + get { return this.sharedSetIdField; } + set { + this.sharedSetIdField = value; + this.sharedSetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sharedSetIdSpecified { + get { return this.sharedSetIdFieldSpecified; } + set { this.sharedSetIdFieldSpecified = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public string sharedSetName { + get { return this.sharedSetNameField; } + set { this.sharedSetNameField = value; } + } + + public SharedSetType sharedSetType { + get { return this.sharedSetTypeField; } + set { + this.sharedSetTypeField = value; + this.sharedSetTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sharedSetTypeSpecified { + get { return this.sharedSetTypeFieldSpecified; } + set { this.sharedSetTypeFieldSpecified = value; } + } + + public string campaignName { + get { return this.campaignNameField; } + set { this.campaignNameField = value; } + } + + public CampaignSharedSetStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum SharedSetType { + NEGATIVE_KEYWORDS, + NEGATIVE_PLACEMENTS, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignSharedSet.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum CampaignSharedSetStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignSharedSetOperation : Operation { + private CampaignSharedSet operandField; + + public CampaignSharedSet operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignSharedSetPage : NullStatsPage { + private CampaignSharedSet[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public CampaignSharedSet[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class CampaignSharedSetError : ApiError { + private CampaignSharedSetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CampaignSharedSetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignSharedSetError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum CampaignSharedSetErrorReason { + CAMPAIGN_SHARED_SET_DOES_NOT_EXIST, + SHARED_SET_NOT_ACTIVE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "SharedCriterionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class SharedCriterionService : AdWordsSoapClient, ISharedCriterionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public SharedCriterionService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/SharedCriterionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SharedCriterionPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((SharedCriterionPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SharedCriterionReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +SharedCriterionOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((SharedCriterionReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class SharedCriterionReturnValue : ListReturnValue { + private SharedCriterion[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public SharedCriterion[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class SharedCriterion { + private long sharedSetIdField; + + private bool sharedSetIdFieldSpecified; + + private Criterion criterionField; + + private bool negativeField; + + private bool negativeFieldSpecified; + + public long sharedSetId { + get { return this.sharedSetIdField; } + set { + this.sharedSetIdField = value; + this.sharedSetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sharedSetIdSpecified { + get { return this.sharedSetIdFieldSpecified; } + set { this.sharedSetIdFieldSpecified = value; } + } + + public Criterion criterion { + get { return this.criterionField; } + set { this.criterionField = value; } + } + + public bool negative { + get { return this.negativeField; } + set { + this.negativeField = value; + this.negativeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool negativeSpecified { + get { return this.negativeFieldSpecified; } + set { this.negativeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class SharedCriterionOperation : Operation { + private SharedCriterion operandField; + + public SharedCriterion operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class SharedCriterionPage : Page { + private SharedCriterion[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public SharedCriterion[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class SharedCriterionError : ApiError { + private SharedCriterionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SharedCriterionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SharedCriterionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum SharedCriterionErrorReason { + EXCEEDS_CRITERIA_LIMIT, + INCORRECT_CRITERION_TYPE, + CANNOT_TARGET_AND_EXCLUDE, + NEGATIVE_CRITERION_REQUIRED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "SharedSetServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class SharedSetService : AdWordsSoapClient, ISharedSetService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public SharedSetService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/SharedSetService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SharedSetPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((SharedSetPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SharedSetReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +SharedSetOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((SharedSetReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class SharedSetReturnValue : ListReturnValue { + private SharedSet[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public SharedSet[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class SharedSet { + private long sharedSetIdField; + + private bool sharedSetIdFieldSpecified; + + private string nameField; + + private SharedSetType typeField; + + private bool typeFieldSpecified; + + private int memberCountField; + + private bool memberCountFieldSpecified; + + private int referenceCountField; + + private bool referenceCountFieldSpecified; + + private SharedSetStatus statusField; + + private bool statusFieldSpecified; + + public long sharedSetId { + get { return this.sharedSetIdField; } + set { + this.sharedSetIdField = value; + this.sharedSetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sharedSetIdSpecified { + get { return this.sharedSetIdFieldSpecified; } + set { this.sharedSetIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public SharedSetType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public int memberCount { + get { return this.memberCountField; } + set { + this.memberCountField = value; + this.memberCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool memberCountSpecified { + get { return this.memberCountFieldSpecified; } + set { this.memberCountFieldSpecified = value; } + } + + public int referenceCount { + get { return this.referenceCountField; } + set { + this.referenceCountField = value; + this.referenceCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool referenceCountSpecified { + get { return this.referenceCountFieldSpecified; } + set { this.referenceCountFieldSpecified = value; } + } + + public SharedSetStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SharedSet.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum SharedSetStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class SharedSetOperation : Operation { + private SharedSet operandField; + + public SharedSet operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class SharedSetPage : NullStatsPage { + private SharedSet[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public SharedSet[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class SharedSetError : ApiError { + private SharedSetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SharedSetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SharedSetError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum SharedSetErrorReason { + CUSTOMER_CANNOT_CREATE_SHARED_SET_OF_THIS_TYPE, + DUPLICATE_NAME, + EXCEEDS_MAX_SHARED_SETS_FOR_TYPE, + INVALID_SET_NAME, + SHARED_SET_DELETED, + SHARED_SET_IN_USE, + TYPE_CANNOT_BE_CHANGED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdGroupServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdGroupService : AdWordsSoapClient, IAdGroupService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdGroupService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/AdGroupService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((AdGroupPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +AdGroupOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((AdGroupReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((AdGroupPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupReturnValue : ListReturnValue { + private AdGroup[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdGroup[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupPage : Page { + private AdGroup[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public AdGroup[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdGroupBidModifierServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdGroupBidModifierService : AdWordsSoapClient, IAdGroupBidModifierService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdGroupBidModifierService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/AdGroupBidModifierService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupBidModifierPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((AdGroupBidModifierPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupBidModifierReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +AdGroupBidModifierOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((AdGroupBidModifierReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupBidModifierPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((AdGroupBidModifierPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupBidModifierReturnValue : ListReturnValue { + private AdGroupBidModifier[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdGroupBidModifier[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdGroupBidModifierPage : Page { + private AdGroupBidModifier[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public AdGroupBidModifier[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdParamServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdParamService : AdWordsSoapClient, IAdParamService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdParamService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/AdParamService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdParamPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((AdParamPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdParam[] mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +AdParamOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((AdParam[]) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdParamOperation : Operation { + private AdParam operandField; + + public AdParam operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdParam { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private long criterionIdField; + + private bool criterionIdFieldSpecified; + + private string insertionTextField; + + private int paramIndexField; + + private bool paramIndexFieldSpecified; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public long criterionId { + get { return this.criterionIdField; } + set { + this.criterionIdField = value; + this.criterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionIdSpecified { + get { return this.criterionIdFieldSpecified; } + set { this.criterionIdFieldSpecified = value; } + } + + public string insertionText { + get { return this.insertionTextField; } + set { this.insertionTextField = value; } + } + + public int paramIndex { + get { return this.paramIndexField; } + set { + this.paramIndexField = value; + this.paramIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool paramIndexSpecified { + get { return this.paramIndexFieldSpecified; } + set { this.paramIndexFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdParamPage { + private AdParam[] entriesField; + + private int totalNumEntriesField; + + private bool totalNumEntriesFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public AdParam[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + + public int totalNumEntries { + get { return this.totalNumEntriesField; } + set { + this.totalNumEntriesField = value; + this.totalNumEntriesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalNumEntriesSpecified { + get { return this.totalNumEntriesFieldSpecified; } + set { this.totalNumEntriesFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdParamPolicyError : PolicyViolationError { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class AdParamError : ApiError { + private AdParamErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdParamErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdParamError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum AdParamErrorReason { + AD_PARAM_CANNOT_BE_SPECIFIED_MULTIPLE_TIMES, + AD_PARAM_DOES_NOT_EXIST, + CRITERION_SPECIFIED_MUST_BE_KEYWORD, + INVALID_ADGROUP_CRITERION_SPECIFIED, + INVALID_INSERTION_TEXT_FORMAT, + MUST_SPECIFY_ADGROUP_ID, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AlertServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AlertService : AdWordsSoapClient, IAlertService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AlertService() { + this.Url = "https://adwords.google.com/api/adwords/mcm/v201402/AlertService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AlertPage get(AlertSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((AlertPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public partial class Detail { + private string triggerTimeField; + + public string triggerTime { + get { return this.triggerTimeField; } + set { this.triggerTimeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public partial class Alert { + private AlertSeverity alertSeverityField; + + private bool alertSeverityFieldSpecified; + + private AlertType alertTypeField; + + private bool alertTypeFieldSpecified; + + private long clientCustomerIdField; + + private bool clientCustomerIdFieldSpecified; + + private Detail[] detailsField; + + public AlertSeverity alertSeverity { + get { return this.alertSeverityField; } + set { + this.alertSeverityField = value; + this.alertSeveritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool alertSeveritySpecified { + get { return this.alertSeverityFieldSpecified; } + set { this.alertSeverityFieldSpecified = value; } + } + + public AlertType alertType { + get { return this.alertTypeField; } + set { + this.alertTypeField = value; + this.alertTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool alertTypeSpecified { + get { return this.alertTypeFieldSpecified; } + set { this.alertTypeFieldSpecified = value; } + } + + public long clientCustomerId { + get { return this.clientCustomerIdField; } + set { + this.clientCustomerIdField = value; + this.clientCustomerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clientCustomerIdSpecified { + get { return this.clientCustomerIdFieldSpecified; } + set { this.clientCustomerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("details")] + public Detail[] details { + get { return this.detailsField; } + set { this.detailsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public enum AlertSeverity { + GREEN, + YELLOW, + RED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public enum AlertType { + ACCOUNT_ON_TARGET, + DECLINED_PAYMENT, + CREDIT_CARD_EXPIRING, + ACCOUNT_BUDGET_ENDING, + CAMPAIGN_ENDING, + PAYMENT_NOT_ENTERED, + MISSING_BANK_REFERENCE_NUMBER, + CAMPAIGN_ENDED, + ACCOUNT_BUDGET_BURN_RATE, + USER_INVITE_PENDING, + USER_INVITE_ACCEPTED, + MANAGER_LINK_PENDING, + ZERO_DAILY_SPENDING_LIMIT, + TV_ACCOUNT_ON_TARGET, + TV_ACCOUNT_BUDGET_ENDING, + TV_ZERO_DAILY_SPENDING_LIMIT, + UNKNOWN + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AlertPage))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public abstract partial class McmNoStatsPage : Page { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public partial class AlertPage : McmNoStatsPage { + private Alert[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Alert[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public partial class AlertQuery { + private ClientSpec clientSpecField; + + private bool clientSpecFieldSpecified; + + private FilterSpec filterSpecField; + + private bool filterSpecFieldSpecified; + + private AlertType[] typesField; + + private AlertSeverity[] severitiesField; + + private TriggerTimeSpec triggerTimeSpecField; + + private bool triggerTimeSpecFieldSpecified; + + private string triggerTimeField; + + private long[] clientCustomerIdsField; + + public ClientSpec clientSpec { + get { return this.clientSpecField; } + set { + this.clientSpecField = value; + this.clientSpecSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clientSpecSpecified { + get { return this.clientSpecFieldSpecified; } + set { this.clientSpecFieldSpecified = value; } + } + + public FilterSpec filterSpec { + get { return this.filterSpecField; } + set { + this.filterSpecField = value; + this.filterSpecSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool filterSpecSpecified { + get { return this.filterSpecFieldSpecified; } + set { this.filterSpecFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("types")] + public AlertType[] types { + get { return this.typesField; } + set { this.typesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("severities")] + public AlertSeverity[] severities { + get { return this.severitiesField; } + set { this.severitiesField = value; } + } + + public TriggerTimeSpec triggerTimeSpec { + get { return this.triggerTimeSpecField; } + set { + this.triggerTimeSpecField = value; + this.triggerTimeSpecSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool triggerTimeSpecSpecified { + get { return this.triggerTimeSpecFieldSpecified; } + set { this.triggerTimeSpecFieldSpecified = value; } + } + + public string triggerTime { + get { return this.triggerTimeField; } + set { this.triggerTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("clientCustomerIds")] + public long[] clientCustomerIds { + get { return this.clientCustomerIdsField; } + set { this.clientCustomerIdsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public enum ClientSpec { + ALL, + DIRECT, + ID_LIST, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public enum FilterSpec { + ALL, + ONLY_SUBMANAGERS, + ONLY_LEAF_CLIENTS, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public enum TriggerTimeSpec { + ALL_TIME, + CUSTOM_TIME, + LAST_24_HOURS, + LAST_7_DAYS + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public partial class AlertSelector { + private AlertQuery queryField; + + private Paging pagingField; + + public AlertQuery query { + get { return this.queryField; } + set { this.queryField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public partial class AlertError : ApiError { + private AlertErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AlertErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AlertError.Reason", Namespace = "https://adwords.google.com/api/adwords/mcm/v201402")] + public enum AlertErrorReason { + NO_CLIENT_IDS_SELECTED, + INVALID_CLIENT_ID_SELECTED, + INVALID_CLIENT_ID_FORMAT, + UNAVAILABLE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "BiddingStrategyServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class BiddingStrategyService : AdWordsSoapClient, IBiddingStrategyService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public BiddingStrategyService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201402/BiddingStrategyService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BiddingStrategyPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((BiddingStrategyPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BiddingStrategyReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +BiddingStrategyOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((BiddingStrategyReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BiddingStrategyPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((BiddingStrategyPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class BiddingStrategyReturnValue : ListReturnValue { + private SharedBiddingStrategy[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public SharedBiddingStrategy[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class SharedBiddingStrategy { + private BiddingScheme biddingSchemeField; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private SharedBiddingStrategyBiddingStrategyStatus statusField; + + private bool statusFieldSpecified; + + private BiddingStrategyType typeField; + + private bool typeFieldSpecified; + + public BiddingScheme biddingScheme { + get { return this.biddingSchemeField; } + set { this.biddingSchemeField = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public SharedBiddingStrategyBiddingStrategyStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public BiddingStrategyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SharedBiddingStrategy.BiddingStrategyStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum SharedBiddingStrategyBiddingStrategyStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class BiddingStrategyOperation : Operation { + private SharedBiddingStrategy operandField; + + public SharedBiddingStrategy operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class BiddingStrategyPage : Page { + private SharedBiddingStrategy[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public SharedBiddingStrategy[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class BiddingStrategyError : ApiError { + private BiddingStrategyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BiddingStrategyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BiddingStrategyError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum BiddingStrategyErrorReason { + DUPLICATE_NAME, + CANNOT_CHANGE_BIDDING_STRATEGY_TYPE, + CANNOT_DELETE_ASSOCIATED_STRATEGY, + BIDDING_STRATEGY_NOT_SUPPORTED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "BudgetOrderServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/billing/v201402")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class BudgetOrderService : AdWordsSoapClient, IBudgetOrderService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public BudgetOrderService() { + this.Url = "https://adwords.google.com/api/adwords/billing/v201402/BudgetOrderService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/billing/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/billing/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BudgetOrderPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((BudgetOrderPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/billing/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/billing/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BillingAccount[] getBillingAccounts() { + object[] results = this.Invoke("getBillingAccounts", new object[0]); + return ((BillingAccount[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/billing/v201402", ResponseNamespace = "https://adwords.google.com/api/adwords/billing/v201402", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BudgetOrderReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +BudgetOrderOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((BudgetOrderReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201402")] + public partial class BudgetOrderReturnValue : ListReturnValue { + private BudgetOrder[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public BudgetOrder[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201402")] + public partial class BudgetOrder { + private string billingAccountIdField; + + private long idField; + + private bool idFieldSpecified; + + private string billingAccountNameField; + + private string poNumberField; + + private string budgetOrderNameField; + + private string primaryBillingIdField; + + private string secondaryBillingIdField; + + private Money spendingLimitField; + + private string startDateTimeField; + + private string endDateTimeField; + + private BudgetOrderRequest lastRequestField; + + public string billingAccountId { + get { return this.billingAccountIdField; } + set { this.billingAccountIdField = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string billingAccountName { + get { return this.billingAccountNameField; } + set { this.billingAccountNameField = value; } + } + + public string poNumber { + get { return this.poNumberField; } + set { this.poNumberField = value; } + } + + public string budgetOrderName { + get { return this.budgetOrderNameField; } + set { this.budgetOrderNameField = value; } + } + + public string primaryBillingId { + get { return this.primaryBillingIdField; } + set { this.primaryBillingIdField = value; } + } + + public string secondaryBillingId { + get { return this.secondaryBillingIdField; } + set { this.secondaryBillingIdField = value; } + } + + public Money spendingLimit { + get { return this.spendingLimitField; } + set { this.spendingLimitField = value; } + } + + public string startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public string endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public BudgetOrderRequest lastRequest { + get { return this.lastRequestField; } + set { this.lastRequestField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201402")] + public partial class BudgetOrderRequest { + private BudgetOrderRequestStatus statusField; + + private bool statusFieldSpecified; + + private string dateField; + + private string billingAccountNameField; + + private string poNumberField; + + private string budgetOrderNameField; + + private Money spendingLimitField; + + private string startDateTimeField; + + private string endDateTimeField; + + public BudgetOrderRequestStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string date { + get { return this.dateField; } + set { this.dateField = value; } + } + + public string billingAccountName { + get { return this.billingAccountNameField; } + set { this.billingAccountNameField = value; } + } + + public string poNumber { + get { return this.poNumberField; } + set { this.poNumberField = value; } + } + + public string budgetOrderName { + get { return this.budgetOrderNameField; } + set { this.budgetOrderNameField = value; } + } + + public Money spendingLimit { + get { return this.spendingLimitField; } + set { this.spendingLimitField = value; } + } + + public string startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public string endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BudgetOrderRequest.Status", Namespace = "https://adwords.google.com/api/adwords/billing/v201402")] + public enum BudgetOrderRequestStatus { + UNDER_REVIEW, + APPROVED, + REJECTED, + CANCELLED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201402")] + public partial class BudgetOrderOperation : Operation { + private BudgetOrder operandField; + + public BudgetOrder operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201402")] + public partial class BillingAccount { + private string idField; + + private string nameField; + + private string currencyCodeField; + + private string primaryBillingIdField; + + private string secondaryBillingIdField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public string primaryBillingId { + get { return this.primaryBillingIdField; } + set { this.primaryBillingIdField = value; } + } + + public string secondaryBillingId { + get { return this.secondaryBillingIdField; } + set { this.secondaryBillingIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201402")] + public partial class BudgetOrderPage : Page { + private BudgetOrder[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public BudgetOrder[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201402")] + public partial class CustomerOrderLineError : ApiError { + private CustomerOrderLineErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomerOrderLineErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomerOrderLineError.Reason", Namespace = "https://adwords.google.com/api/adwords/billing/v201402")] + public enum CustomerOrderLineErrorReason { + INVALID_ORDER_LINE_ID, + END_DATE_BEFORE_START_DATE, + NEGATIVE_SPEND, + CREATE_IN_PAST, + ALREADY_STARTED, + ALREADY_SPENT, + FINISHED_IN_THE_PAST, + CANCEL_ACTIVE, + OVERLAP_DATE_RANGE, + COS_CHANGE, + NON_ADWORDS, + START_DATE_AFTER_ACTUAL, + END_DATE_PAST_MAX, + PARENT_IS_SELF, + CANNOT_CANCEL_NEW, + CANNOT_CANCEL_STARTED, + CANNOT_PROMOTE_NON_PENDING_ORDERLINE, + UPDATE_ORDERLINE_WILL_SHIFT_CURRENT, + ORDERLINE_BEING_MODIFIED_IS_NOT_NORMAL_OR_PENDING, + INVALID_STATUS_CHANGE, + MORE_THAN_ONE_OPERATION_NOT_PERMITTED, + INVALID_TIMEZONE_IN_DATE_RANGES, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201402")] + public partial class BudgetOrderError : ApiError { + private BudgetOrderErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BudgetOrderErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BudgetOrderError.Reason", Namespace = "https://adwords.google.com/api/adwords/billing/v201402")] + public enum BudgetOrderErrorReason { + CUSTOMER_NOT_WHITELISTED_FOR_NEW_BILLING, + BUDGET_APPROVAL_IN_PROGRESS, + SERVICE_UNAVAILABLE, + INVALID_BILLING_ACCOUNT, + GENERIC_BILLING_ERROR, + INVALID_BILLING_ACCOUNT_ID_FORMAT, + INVALID_BUDGET_DATE_RANGE, + INCOMPATIBLE_CURRENCY, + BUDGET_UPDATE_DENIED, + BUDGET_ALREDY_STARTED, + BUDGET_ALREADY_ENDED, + INVALID_CONSTRAINT, + INVALID_BID_TOO_LARGE, + NO_SUCH_BUDGET_FOUND, + INVALID_BUDGET_ALREADY_SPENT, + INVALID_TIMEZONE_IN_DATE, + ACCOUNT_BUDGET_ID_SET_IN_ADD, + MORE_THAN_ONE_OPERATIONS, + MCC_HIERARCHY_SIZE_TOO_LARGE, + INVALID_MCC_HIERARCHY, + UNKNOWN + } + public interface IBudgetService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + BudgetPage get(Selector selector); + BudgetReturnValue mutate(BudgetOperation[] operations); + BudgetPage query(string query1); + } + public interface ICampaignAdExtensionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CampaignAdExtensionPage get(Selector serviceSelector); + CampaignAdExtensionReturnValue mutate(CampaignAdExtensionOperation[] operations); + } + public interface ICampaignCriterionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CampaignCriterionPage get(Selector serviceSelector); + CampaignCriterionReturnValue mutate(CampaignCriterionOperation[] operations); + CampaignCriterionPage query(string query1); + } + public interface ICampaignService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CampaignPage get(Selector serviceSelector); + CampaignReturnValue mutate(CampaignOperation[] operations); + CampaignPage query(string query1); + } + public interface ICampaignFeedService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CampaignFeedPage get(Selector selector); + CampaignFeedReturnValue mutate(CampaignFeedOperation[] operations); + CampaignFeedPage query(string query1); + } + public interface IConstantDataService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AgeRange[] getAgeRangeCriterion(); + Carrier[] getCarrierCriterion(); + Gender[] getGenderCriterion(); + Language[] getLanguageCriterion(); + MobileDevice[] getMobileDeviceCriterion(); + OperatingSystemVersion[] getOperatingSystemVersionCriterion(); + ProductBiddingCategoryData[] getProductBiddingCategoryData(Selector selector); + CriterionUserInterest[] getUserInterestCriterion(ConstantDataServiceUserInterestTaxonomyType userInterestTaxonomyType, bool userInterestTaxonomyTypeSpecified); + Vertical[] getVerticalCriterion(); + } + public interface IConversionTrackerService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ConversionTrackerPage get(Selector serviceSelector); + ConversionTrackerReturnValue mutate(ConversionTrackerOperation[] operations); + } + public interface ICustomerService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Customer get(); + Customer mutate(Customer customer); + } + public interface ICustomerSyncService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CustomerChangeData get(CustomerSyncSelector selector); + } + public interface ICustomerFeedService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CustomerFeedPage get(Selector selector); + CustomerFeedReturnValue mutate(CustomerFeedOperation[] operations); + CustomerFeedPage query(string query1); + } + public interface IAdGroupAdService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdGroupAdPage get(Selector serviceSelector); + AdGroupAdReturnValue mutate(AdGroupAdOperation[] operations); + AdGroupAdPage query(string query1); + } + public interface IDataService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdGroupBidLandscapePage getAdGroupBidLandscape(Selector serviceSelector); + CriterionBidLandscapePage getCriterionBidLandscape(Selector serviceSelector); + AdGroupBidLandscapePage queryAdGroupBidLandscape(string query); + CriterionBidLandscapePage queryCriterionBidLandscape(string query); + } + public interface IExperimentService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ExperimentPage get(Selector serviceSelector); + ExperimentReturnValue mutate(ExperimentOperation[] operations); + } + public interface IFeedService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + FeedPage get(Selector selector); + FeedReturnValue mutate(FeedOperation[] operations); + FeedPage query(string query1); + } + public interface IFeedItemService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + FeedItemPage get(Selector selector); + FeedItemReturnValue mutate(FeedItemOperation[] operations); + FeedItemPage query(string query1); + } + public interface IFeedMappingService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + FeedMappingPage get(Selector selector); + FeedMappingReturnValue mutate(FeedMappingOperation[] operations); + FeedMappingPage query(string query1); + } + public interface IGeoLocationService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + GeoLocation[] get(GeoLocationSelector selector); + } + public interface ILocationCriterionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + LocationCriterion[] get(Selector selector); + LocationCriterion[] query(string query1); + } + public interface IManagedCustomerService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ManagedCustomerPage get(Selector serviceSelector); + PendingInvitation[] getPendingInvitations(PendingInvitationSelector selector); + ManagedCustomerReturnValue mutate(ManagedCustomerOperation[] operations); + ManagedCustomerLink[] mutateLink(LinkOperation[] operations); + ManagedCustomerLink[] mutateManager(MoveOperation[] operations); + } + public interface IMediaService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + MediaPage get(Selector serviceSelector); + MediaPage query(string query1); + Media[] upload(Media[] media); + } + public interface IMutateJobService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Job[] get(JobSelector selector); + JobResult getResult(JobSelector selector); + SimpleMutateJob mutate(Operation[] operations, BulkMutateJobPolicy policy); + } + public interface IAdGroupFeedService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdGroupFeedPage get(Selector selector); + AdGroupFeedReturnValue mutate(AdGroupFeedOperation[] operations); + AdGroupFeedPage query(string query1); + } + public interface IOfflineConversionFeedService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + OfflineConversionFeedReturnValue mutate(OfflineConversionFeedOperation[] operations); + } + public interface IReportDefinitionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ReportDefinitionField[] getReportFields(ReportDefinitionReportType reportType); + } + public interface ITargetingIdeaService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + TargetingIdeaPage get(TargetingIdeaSelector selector); + TargetingIdeaPage getBulkKeywordIdeas(TargetingIdeaSelector selector); + } + public interface ITrafficEstimatorService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + TrafficEstimatorResult get(TrafficEstimatorSelector selector); + } + public interface IAdwordsUserListService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + UserListPage get(Selector serviceSelector); + UserListReturnValue mutate(UserListOperation[] operations); + } + public interface IVideoAdService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + VideoAdPage get(VideoAdSelector selector); + VideoAdReturnValue mutate(VideoAdOperation[] operations); + } + public interface IVideoCampaignCriterionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + VideoCampaignCriterionPage get(VideoCampaignCriterionSelector selector); + VideoCampaignCriterionReturnValue mutate(VideoCampaignCriterionOperation[] operations); + } + public interface IVideoCampaignService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + VideoCampaignPage get(VideoCampaignSelector selector); + VideoCampaignReturnValue mutate(VideoCampaignOperation[] operations); + } + public interface IVideoService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + VideoPage get(VideoSelector selector); + VideoReturnValue mutateCallToAction(VideoCallToActionOperation[] operations); + VideoSearchPage search(VideoSearchSelector selector); + } + public interface IVideoTargetingGroupCriterionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + TargetingGroupCriterionPage get(TargetingGroupCriterionSelector selector); + TargetingGroupCriterionReturnValue mutate(TargetingGroupCriterionOperation[] operations); + } + public interface IAdGroupCriterionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdGroupCriterionPage get(Selector serviceSelector); + AdGroupCriterionReturnValue mutate(AdGroupCriterionOperation[] operations); + AdGroupCriterionPage query(string query1); + } + public interface IVideoTargetingGroupService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + TargetingGroupPage get(TargetingGroupSelector selector); + TargetingGroupReturnValue mutate(TargetingGroupOperation[] operations); + } + public interface IExpressBusinessService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ExpressBusinessPage get(Selector selector); + ExpressBusiness[] mutate(ExpressBusinessOperation[] operations); + } + public interface IPromotionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + PromotionPage get(Selector selector); + Promotion[] mutate(PromotionOperation[] operations); + } + public interface IProductService { + string text { + get; + set; + } + string locale { + get; + set; + } + } + public interface IProductServiceService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ProductServicePage get(Selector selector); + } + public interface ICampaignSharedSetService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CampaignSharedSetPage get(Selector selector); + CampaignSharedSetReturnValue mutate(CampaignSharedSetOperation[] operations); + } + public interface ISharedCriterionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + SharedCriterionPage get(Selector selector); + SharedCriterionReturnValue mutate(SharedCriterionOperation[] operations); + } + public interface ISharedSetService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + SharedSetPage get(Selector selector); + SharedSetReturnValue mutate(SharedSetOperation[] operations); + } + public interface IAdGroupService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdGroupPage get(Selector serviceSelector); + AdGroupReturnValue mutate(AdGroupOperation[] operations); + AdGroupPage query(string query1); + } + public interface IAdGroupBidModifierService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdGroupBidModifierPage get(Selector selector); + AdGroupBidModifierReturnValue mutate(AdGroupBidModifierOperation[] operations); + AdGroupBidModifierPage query(string query1); + } + public interface IAdParamService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdParamPage get(Selector serviceSelector); + AdParam[] mutate(AdParamOperation[] operations); + } + public interface IAlertService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AlertPage get(AlertSelector selector); + } + public interface IBiddingStrategyService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + BiddingStrategyPage get(Selector selector); + BiddingStrategyReturnValue mutate(BiddingStrategyOperation[] operations); + BiddingStrategyPage query(string query1); + } + public interface IBudgetOrderService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + BudgetOrderPage get(Selector serviceSelector); + BillingAccount[] getBillingAccounts(); + BudgetOrderReturnValue mutate(BudgetOrderOperation[] operations); + } +} diff --git a/src/AdWords/v201402/AdWordsServiceV201402.cs b/src/AdWords/v201402/AdWordsServiceV201402.cs new file mode 100644 index 00000000000..4eb20610c3d --- /dev/null +++ b/src/AdWords/v201402/AdWordsServiceV201402.cs @@ -0,0 +1,418 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; + +namespace Google.Api.Ads.AdWords.Lib { + + /// + /// Lists all the services available through this library. + /// + public partial class AdWordsService : AdsService { + + /// + /// All the services available in v201402. + /// + public class v201402 { + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdGroupAdService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdGroupBidModifierService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdGroupCriterionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdGroupFeedService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdGroupService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdParamService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdwordsUserListService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AlertService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature BiddingStrategyService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature BudgetOrderService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature BudgetService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CampaignAdExtensionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CampaignCriterionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CampaignFeedService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CampaignService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CampaignSharedSetService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ConstantDataService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ConversionTrackerService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomerService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomerSyncService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomerFeedService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature DataService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ExperimentService; + + /// + /// Factory type for v201402 services. + /// + public static readonly Type factoryType = typeof(AdWordsServiceFactory); + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature FeedItemService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature FeedMappingService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature FeedService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature GeoLocationService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LocationCriterionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ManagedCustomerService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature MediaService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature MutateJobService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature OfflineConversionFeedService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReportDefinitionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SharedCriterionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SharedSetService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature TargetingIdeaService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature TrafficEstimatorService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature VideoAdService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature VideoCampaignCriterionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature VideoCampaignService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature VideoService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature VideoTargetingGroupCriterionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature VideoTargetingGroupService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ExpressBusinessService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature PromotionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProductServiceService; + + /// + /// Static constructor to initialize the service constants. + /// + static v201402() { + OfflineConversionFeedService = + AdWordsService.MakeServiceSignature("v201402", "cm", "OfflineConversionFeedService"); + AdGroupAdService = + AdWordsService.MakeServiceSignature("v201402", "cm", "AdGroupAdService"); + AdGroupCriterionService = + AdWordsService.MakeServiceSignature("v201402", "cm", "AdGroupCriterionService"); + AdGroupService = + AdWordsService.MakeServiceSignature("v201402", "cm", "AdGroupService"); + AdGroupBidModifierService = + AdWordsService.MakeServiceSignature("v201402", "cm", "AdGroupBidModifierService"); + AdGroupFeedService = + AdWordsService.MakeServiceSignature("v201402", "cm", "AdGroupFeedService"); + AdParamService = + AdWordsService.MakeServiceSignature("v201402", "cm", "AdParamService"); + AdwordsUserListService = + AdWordsService.MakeServiceSignature("v201402", "rm", "AdwordsUserListService"); + AlertService = + AdWordsService.MakeServiceSignature("v201402", "mcm", "AlertService"); + BiddingStrategyService = + AdWordsService.MakeServiceSignature("v201402", "cm", "BiddingStrategyService"); + BudgetService = + AdWordsService.MakeServiceSignature("v201402", "cm", "BudgetService"); + BudgetOrderService = + AdWordsService.MakeServiceSignature("v201402", "billing", "BudgetOrderService"); + CampaignAdExtensionService = + AdWordsService.MakeServiceSignature("v201402", "cm", "CampaignAdExtensionService"); + CampaignCriterionService = + AdWordsService.MakeServiceSignature("v201402", "cm", "CampaignCriterionService"); + CampaignService = + AdWordsService.MakeServiceSignature("v201402", "cm", "CampaignService"); + CampaignFeedService = + AdWordsService.MakeServiceSignature("v201402", "cm", "CampaignFeedService"); + CampaignSharedSetService = + AdWordsService.MakeServiceSignature("v201402", "cm", "CampaignSharedSetService"); + ConstantDataService = + AdWordsService.MakeServiceSignature("v201402", "cm", "ConstantDataService"); + ConversionTrackerService = + AdWordsService.MakeServiceSignature("v201402", "cm", "ConversionTrackerService"); + CustomerService = + AdWordsService.MakeServiceSignature("v201402", "mcm", "CustomerService"); + CustomerSyncService = + AdWordsService.MakeServiceSignature("v201402", "ch", "CustomerSyncService"); + CustomerFeedService = + AdWordsService.MakeServiceSignature("v201402", "cm", "CustomerFeedService"); + DataService = + AdWordsService.MakeServiceSignature("v201402", "cm", "DataService"); + ExperimentService = + AdWordsService.MakeServiceSignature("v201402", "cm", "ExperimentService"); + FeedService = + AdWordsService.MakeServiceSignature("v201402", "cm", "FeedService"); + FeedItemService = + AdWordsService.MakeServiceSignature("v201402", "cm", "FeedItemService"); + FeedMappingService = + AdWordsService.MakeServiceSignature("v201402", "cm", "FeedMappingService"); + GeoLocationService = + AdWordsService.MakeServiceSignature("v201402", "cm", "GeoLocationService"); + LocationCriterionService = + AdWordsService.MakeServiceSignature("v201402", "cm", "LocationCriterionService"); + ManagedCustomerService = + AdWordsService.MakeServiceSignature("v201402", "mcm", "ManagedCustomerService"); + MediaService = + AdWordsService.MakeServiceSignature("v201402", "cm", "MediaService"); + MutateJobService = + AdWordsService.MakeServiceSignature("v201402", "cm", "MutateJobService"); + ReportDefinitionService = + AdWordsService.MakeServiceSignature("v201402", "cm", "ReportDefinitionService"); + SharedCriterionService = + AdWordsService.MakeServiceSignature("v201402", "cm", "SharedCriterionService"); + SharedSetService = + AdWordsService.MakeServiceSignature("v201402", "cm", "SharedSetService"); + TargetingIdeaService = + AdWordsService.MakeServiceSignature("v201402", "o", "TargetingIdeaService"); + TrafficEstimatorService = + AdWordsService.MakeServiceSignature("v201402", "o", "TrafficEstimatorService"); + + VideoAdService = + AdWordsService.MakeServiceSignature("v201402", "video", "VideoAdService"); + VideoCampaignCriterionService = + AdWordsService.MakeServiceSignature("v201402", "video", + "VideoCampaignCriterionService"); + VideoCampaignService = + AdWordsService.MakeServiceSignature("v201402", "video", "VideoCampaignService"); + VideoService = + AdWordsService.MakeServiceSignature("v201402", "video", "VideoService"); + VideoTargetingGroupCriterionService = + AdWordsService.MakeServiceSignature("v201402", "video", + "VideoTargetingGroupCriterionService"); + VideoTargetingGroupService = + AdWordsService.MakeServiceSignature("v201402", "video", "VideoTargetingGroupService"); + + ExpressBusinessService = + AdWordsService.MakeServiceSignature("v201402", "express", + "ExpressBusinessService"); + PromotionService = + AdWordsService.MakeServiceSignature("v201402", "express", "PromotionService"); + ProductServiceService = + AdWordsService.MakeServiceSignature("v201402", "express", "ProductServiceService"); + } + } + } +} \ No newline at end of file diff --git a/src/AdWords/v201402/ReportDefinition.cs b/src/AdWords/v201402/ReportDefinition.cs new file mode 100644 index 00000000000..114a6c7261f --- /dev/null +++ b/src/AdWords/v201402/ReportDefinition.cs @@ -0,0 +1,203 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +#pragma warning disable 1591 + +namespace Google.Api.Ads.AdWords.v201402 { + using Google.Api.Ads.AdWords.Headers; + using Google.Api.Ads.AdWords.Lib; + + using System.Web.Services.Protocols; + using System; + using System.ComponentModel; + using System.Diagnostics; + using System.Web.Services; + using System.Xml.Serialization; + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public partial class ReportDefinition { + private long idField; + + private bool idFieldSpecified; + + private Selector selectorField; + + private string reportNameField; + + private ReportDefinitionReportType reportTypeField; + + private bool reportTypeFieldSpecified; + + private bool hasAttachmentField; + + private bool hasAttachmentFieldSpecified; + + private ReportDefinitionDateRangeType dateRangeTypeField; + + private bool dateRangeTypeFieldSpecified; + + private DownloadFormat downloadFormatField; + + private bool downloadFormatFieldSpecified; + + private string creationTimeField; + + private bool includeZeroImpressionsField; + + private bool includeZeroImpressionsFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public Selector selector { + get { return this.selectorField; } + set { this.selectorField = value; } + } + + public string reportName { + get { return this.reportNameField; } + set { this.reportNameField = value; } + } + + public ReportDefinitionReportType reportType { + get { return this.reportTypeField; } + set { + this.reportTypeField = value; + this.reportTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reportTypeSpecified { + get { return this.reportTypeFieldSpecified; } + set { this.reportTypeFieldSpecified = value; } + } + + public bool hasAttachment { + get { return this.hasAttachmentField; } + set { + this.hasAttachmentField = value; + this.hasAttachmentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasAttachmentSpecified { + get { return this.hasAttachmentFieldSpecified; } + set { this.hasAttachmentFieldSpecified = value; } + } + + public ReportDefinitionDateRangeType dateRangeType { + get { return this.dateRangeTypeField; } + set { + this.dateRangeTypeField = value; + this.dateRangeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dateRangeTypeSpecified { + get { return this.dateRangeTypeFieldSpecified; } + set { this.dateRangeTypeFieldSpecified = value; } + } + + public DownloadFormat downloadFormat { + get { return this.downloadFormatField; } + set { + this.downloadFormatField = value; + this.downloadFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool downloadFormatSpecified { + get { return this.downloadFormatFieldSpecified; } + set { this.downloadFormatFieldSpecified = value; } + } + + public string creationTime { + get { return this.creationTimeField; } + set { this.creationTimeField = value; } + } + + public bool includeZeroImpressions { + get { return this.includeZeroImpressionsField; } + set { + this.includeZeroImpressionsField = value; + this.includeZeroImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeZeroImpressionsSpecified { + get { return this.includeZeroImpressionsFieldSpecified; } + set { this.includeZeroImpressionsFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportDefinition.DateRangeType", Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum ReportDefinitionDateRangeType { + TODAY, + YESTERDAY, + LAST_7_DAYS, + LAST_WEEK, + LAST_BUSINESS_WEEK, + THIS_MONTH, + LAST_MONTH, + ALL_TIME, + CUSTOM_DATE, + LAST_14_DAYS, + LAST_30_DAYS, + THIS_WEEK_SUN_TODAY, + THIS_WEEK_MON_TODAY, + LAST_WEEK_SUN_SAT + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201402")] + public enum DownloadFormat { + CSVFOREXCEL, + CSV, + TSV, + XML, + GZIPPED_CSV, + GZIPPED_XML + } +} diff --git a/src/AdWords/v201406/AdWordsApi.cs b/src/AdWords/v201406/AdWordsApi.cs new file mode 100644 index 00000000000..388035134f9 --- /dev/null +++ b/src/AdWords/v201406/AdWordsApi.cs @@ -0,0 +1,25224 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +#pragma warning disable 1591 + +namespace Google.Api.Ads.AdWords.v201406 { + using Google.Api.Ads.AdWords.Headers; + using Google.Api.Ads.AdWords.Lib; + + using System.Web.Services.Protocols; + using System; + using System.ComponentModel; + using System.Diagnostics; + using System.Web.Services; + using System.Xml.Serialization; + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "BudgetServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class BudgetService : AdWordsSoapClient, IBudgetService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public BudgetService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/BudgetService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BudgetPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((BudgetPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BudgetReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +BudgetOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((BudgetReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BudgetPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((BudgetPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ApiException : ApplicationException { + private ApiError[] errorsField; + + [System.Xml.Serialization.XmlElementAttribute("errors")] + public ApiError[] errors { + get { return this.errorsField; } + set { this.errorsField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DatabaseError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringLengthError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SizeLimitError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SelectorError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequestError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RejectedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReadOnlyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RateExceededError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RangeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(QuotaCheckError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(QueryError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperationAccessDenied))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NullError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NotEmptyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NewEntityCreationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InternalApiError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IdError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EntityNotFound))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EntityCountLimitExceeded))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DistinctError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateRangeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClientTermsError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AuthorizationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AuthenticationError))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RegionCodeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PagingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatorError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignAdExtensionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdxError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExtensionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FunctionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignCriterionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UrlError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StatsQueryError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SettingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(QuotaError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ForwardCompatibilityError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddingTransitionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddingErrors))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CollectionSizeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignFeedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConversionTrackingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomerSyncError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomerFeedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PolicyViolationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MediaError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FunctionParsingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExperimentError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupAdCountLimitExceeded))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EntityAccessDenied))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupAdError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DataError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExperimentServiceError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedMappingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GeoLocationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LocationCriterionServiceError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManagedCustomerServiceError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudioError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionPolicyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MultiplierError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(JobError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupCriterionLimitExceeded))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BulkMutateJobError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupServiceError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupCriterionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupFeedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OfflineConversionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MatchesRegexError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CurrencyCodeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReportDefinitionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NotWhitelistedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TrafficEstimatorError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingIdeaError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserListError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExpressBusinessError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PromotionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignSharedSetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedCriterionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedSetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LabelError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdParamPolicyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdParamError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AlertError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddingStrategyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomerOrderLineError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetOrderError))] + public abstract partial class ApiError { + private string fieldPathField; + + private string triggerField; + + private string errorStringField; + + private string apiErrorTypeField; + + public string fieldPath { + get { return this.fieldPathField; } + set { this.fieldPathField = value; } + } + + public string trigger { + get { return this.triggerField; } + set { this.triggerField = value; } + } + + public string errorString { + get { return this.errorStringField; } + set { this.errorStringField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApiError.Type")] + public string ApiErrorType { + get { return this.apiErrorTypeField; } + set { this.apiErrorTypeField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetReturnValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignAdExtensionReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignCriterionReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignLabelReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignFeedReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConversionTrackerReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomerFeedReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupAdReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupAdLabelReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExperimentReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedItemReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedMappingReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupFeedReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OfflineConversionFeedReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignSharedSetReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupCriterionReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupCriterionLabelReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedCriterionReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedSetReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LabelReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupLabelReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupBidModifierReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddingStrategyReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetOrderReturnValue))] + public abstract partial class ListReturnValue { + private string listReturnValueTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ListReturnValue.Type")] + public string ListReturnValueType { + get { return this.listReturnValueTypeField; } + set { this.listReturnValueTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class BudgetReturnValue : ListReturnValue { + private Budget[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public Budget[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Budget { + private long budgetIdField; + + private bool budgetIdFieldSpecified; + + private string nameField; + + private BudgetBudgetPeriod periodField; + + private bool periodFieldSpecified; + + private Money amountField; + + private BudgetBudgetDeliveryMethod deliveryMethodField; + + private bool deliveryMethodFieldSpecified; + + private int referenceCountField; + + private bool referenceCountFieldSpecified; + + private bool isExplicitlySharedField; + + private bool isExplicitlySharedFieldSpecified; + + private BudgetBudgetStatus statusField; + + private bool statusFieldSpecified; + + public long budgetId { + get { return this.budgetIdField; } + set { + this.budgetIdField = value; + this.budgetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool budgetIdSpecified { + get { return this.budgetIdFieldSpecified; } + set { this.budgetIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public BudgetBudgetPeriod period { + get { return this.periodField; } + set { + this.periodField = value; + this.periodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool periodSpecified { + get { return this.periodFieldSpecified; } + set { this.periodFieldSpecified = value; } + } + + public Money amount { + get { return this.amountField; } + set { this.amountField = value; } + } + + public BudgetBudgetDeliveryMethod deliveryMethod { + get { return this.deliveryMethodField; } + set { + this.deliveryMethodField = value; + this.deliveryMethodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryMethodSpecified { + get { return this.deliveryMethodFieldSpecified; } + set { this.deliveryMethodFieldSpecified = value; } + } + + public int referenceCount { + get { return this.referenceCountField; } + set { + this.referenceCountField = value; + this.referenceCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool referenceCountSpecified { + get { return this.referenceCountFieldSpecified; } + set { this.referenceCountFieldSpecified = value; } + } + + public bool isExplicitlyShared { + get { return this.isExplicitlySharedField; } + set { + this.isExplicitlySharedField = value; + this.isExplicitlySharedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isExplicitlySharedSpecified { + get { return this.isExplicitlySharedFieldSpecified; } + set { this.isExplicitlySharedFieldSpecified = value; } + } + + public BudgetBudgetStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Budget.BudgetPeriod", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum BudgetBudgetPeriod { + DAILY + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Money : ComparableValue { + private long microAmountField; + + private bool microAmountFieldSpecified; + + public long microAmount { + get { return this.microAmountField; } + set { + this.microAmountField = value; + this.microAmountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool microAmountSpecified { + get { return this.microAmountFieldSpecified; } + set { this.microAmountFieldSpecified = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NumberValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DoubleValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Money))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public abstract partial class ComparableValue { + private string comparableValueTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ComparableValue.Type")] + public string ComparableValueType { + get { return this.comparableValueTypeField; } + set { this.comparableValueTypeField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DoubleValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public abstract partial class NumberValue : ComparableValue { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class LongValue : NumberValue { + private long numberField; + + private bool numberFieldSpecified; + + public long number { + get { return this.numberField; } + set { + this.numberField = value; + this.numberSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numberSpecified { + get { return this.numberFieldSpecified; } + set { this.numberFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class DoubleValue : NumberValue { + private double numberField; + + private bool numberFieldSpecified; + + public double number { + get { return this.numberField; } + set { + this.numberField = value; + this.numberSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numberSpecified { + get { return this.numberFieldSpecified; } + set { this.numberFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Budget.BudgetDeliveryMethod", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum BudgetBudgetDeliveryMethod { + STANDARD, + ACCELERATED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Budget.BudgetStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum BudgetBudgetStatus { + ENABLED, + REMOVED, + UNKNOWN + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetOperation))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignAdExtensionOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignCriterionOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignLabelOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignFeedOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConversionTrackerOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomerFeedOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupAdOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupAdLabelOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExperimentOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedItemOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedMappingOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManagedCustomerOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MoveOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LinkOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignTargetOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupLabelOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupCriterionOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupCriterionLabelOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupBidModifierOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupFeedOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OfflineConversionFeedOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserListOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExpressBusinessOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PromotionOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignSharedSetOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedCriterionOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedSetOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LabelOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdParamOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddingStrategyOperation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetOrderOperation))] + public abstract partial class Operation { + private Operator operatorField; + + private bool operatorFieldSpecified; + + private string operationTypeField; + + public Operator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Operation.Type")] + public string OperationType { + get { return this.operationTypeField; } + set { this.operationTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum Operator { + ADD, + REMOVE, + SET + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class BudgetOperation : Operation { + private Budget operandField; + + public Budget operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetPage))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignAdExtensionPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignCriterionPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NullStatsPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignFeedPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NoStatsPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConversionTrackerPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomerFeedPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupAdPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionBidLandscapePage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupBidLandscapePage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DomainCategoryPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExperimentPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedItemPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedMappingPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManagedCustomerPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupFeedPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserListPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExpressNoStatsPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExpressBusinessPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PromotionPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductServicePage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignSharedSetPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupCriterionPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedCriterionPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedSetPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LabelPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupBidModifierPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(McmNoStatsPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AlertPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddingStrategyPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetOrderPage))] + public abstract partial class Page { + private int totalNumEntriesField; + + private bool totalNumEntriesFieldSpecified; + + private string pageTypeField; + + public int totalNumEntries { + get { return this.totalNumEntriesField; } + set { + this.totalNumEntriesField = value; + this.totalNumEntriesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalNumEntriesSpecified { + get { return this.totalNumEntriesFieldSpecified; } + set { this.totalNumEntriesFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Page.Type")] + public string PageType { + get { return this.pageTypeField; } + set { this.pageTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class BudgetPage : Page { + private Budget[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Budget[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Paging { + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int numberResultsField; + + private bool numberResultsFieldSpecified; + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int numberResults { + get { return this.numberResultsField; } + set { + this.numberResultsField = value; + this.numberResultsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numberResultsSpecified { + get { return this.numberResultsFieldSpecified; } + set { this.numberResultsFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class OrderBy { + private string fieldField; + + private SortOrder sortOrderField; + + private bool sortOrderFieldSpecified; + + public string field { + get { return this.fieldField; } + set { this.fieldField = value; } + } + + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { + this.sortOrderField = value; + this.sortOrderSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sortOrderSpecified { + get { return this.sortOrderFieldSpecified; } + set { this.sortOrderFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum SortOrder { + ASCENDING, + DESCENDING + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class DateRange { + private string minField; + + private string maxField; + + public string min { + get { return this.minField; } + set { this.minField = value; } + } + + public string max { + get { return this.maxField; } + set { this.maxField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Predicate { + private string fieldField; + + private PredicateOperator operatorField; + + private bool operatorFieldSpecified; + + private string[] valuesField; + + public string field { + get { return this.fieldField; } + set { this.fieldField = value; } + } + + public PredicateOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("values")] + public string[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Predicate.Operator", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum PredicateOperator { + EQUALS, + NOT_EQUALS, + IN, + NOT_IN, + GREATER_THAN, + GREATER_THAN_EQUALS, + LESS_THAN, + LESS_THAN_EQUALS, + STARTS_WITH, + STARTS_WITH_IGNORE_CASE, + CONTAINS, + CONTAINS_IGNORE_CASE, + DOES_NOT_CONTAIN, + DOES_NOT_CONTAIN_IGNORE_CASE, + CONTAINS_ANY, + CONTAINS_ALL, + CONTAINS_NONE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Selector { + private string[] fieldsField; + + private Predicate[] predicatesField; + + private DateRange dateRangeField; + + private OrderBy[] orderingField; + + private Paging pagingField; + + [System.Xml.Serialization.XmlElementAttribute("fields")] + public string[] fields { + get { return this.fieldsField; } + set { this.fieldsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("predicates")] + public Predicate[] predicates { + get { return this.predicatesField; } + set { this.predicatesField = value; } + } + + public DateRange dateRange { + get { return this.dateRangeField; } + set { this.dateRangeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ordering")] + public OrderBy[] ordering { + get { return this.orderingField; } + set { this.orderingField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApiException))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ApplicationException { + private string messageField; + + private string applicationExceptionTypeField; + + public string message { + get { return this.messageField; } + set { this.messageField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApplicationException.Type")] + public string ApplicationExceptionType { + get { return this.applicationExceptionTypeField; } + set { this.applicationExceptionTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class DatabaseError : ApiError { + private DatabaseErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DatabaseErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DatabaseError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum DatabaseErrorReason { + CONCURRENT_MODIFICATION, + PERMISSION_DENIED, + CAMPAIGN_PRODUCT_NOT_SUPPORTED, + DUPLICATE_KEY, + DATABASE_ERROR, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class StringLengthError : ApiError { + private StringLengthErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StringLengthErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StringLengthError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum StringLengthErrorReason { + TOO_SHORT, + TOO_LONG + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class SizeLimitError : ApiError { + private SizeLimitErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SizeLimitErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SizeLimitError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum SizeLimitErrorReason { + REQUEST_SIZE_LIMIT_EXCEEDED, + RESPONSE_SIZE_LIMIT_EXCEEDED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class SelectorError : ApiError { + private SelectorErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SelectorErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SelectorError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum SelectorErrorReason { + INVALID_FIELD_NAME, + MISSING_FIELDS, + MISSING_PREDICATES, + OPERATOR_DOES_NOT_SUPPORT_MULTIPLE_VALUES, + INVALID_PREDICATE_ENUM_VALUE, + MISSING_PREDICATE_OPERATOR, + MISSING_PREDICATE_VALUES, + INVALID_PREDICATE_FIELD_NAME, + INVALID_PREDICATE_OPERATOR, + INVALID_FIELD_SELECTION, + INVALID_PREDICATE_VALUE, + INVALID_SORT_FIELD_NAME, + SELECTOR_ERROR, + FILTER_BY_DATE_RANGE_NOT_SUPPORTED, + START_INDEX_IS_TOO_HIGH, + TOO_MANY_PREDICATE_VALUES, + UNKNOWN_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class RequiredError : ApiError { + private RequiredErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum RequiredErrorReason { + REQUIRED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class RequestError : ApiError { + private RequestErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequestErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequestError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum RequestErrorReason { + UNKNOWN, + INVALID_INPUT + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class RejectedError : ApiError { + private RejectedErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RejectedErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RejectedError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum RejectedErrorReason { + UNKNOWN_VALUE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ReadOnlyError : ApiError { + private ReadOnlyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReadOnlyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReadOnlyError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ReadOnlyErrorReason { + READ_ONLY + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class RateExceededError : ApiError { + private RateExceededErrorReason reasonField; + + private bool reasonFieldSpecified; + + private string rateNameField; + + private string rateScopeField; + + private int retryAfterSecondsField; + + private bool retryAfterSecondsFieldSpecified; + + public RateExceededErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + public string rateName { + get { return this.rateNameField; } + set { this.rateNameField = value; } + } + + public string rateScope { + get { return this.rateScopeField; } + set { this.rateScopeField = value; } + } + + public int retryAfterSeconds { + get { return this.retryAfterSecondsField; } + set { + this.retryAfterSecondsField = value; + this.retryAfterSecondsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool retryAfterSecondsSpecified { + get { return this.retryAfterSecondsFieldSpecified; } + set { this.retryAfterSecondsFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RateExceededError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum RateExceededErrorReason { + RATE_EXCEEDED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class RangeError : ApiError { + private RangeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RangeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RangeError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum RangeErrorReason { + TOO_LOW, + TOO_HIGH + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class QuotaCheckError : ApiError { + private QuotaCheckErrorReason reasonField; + + private bool reasonFieldSpecified; + + public QuotaCheckErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "QuotaCheckError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum QuotaCheckErrorReason { + INVALID_TOKEN_HEADER, + ACCOUNT_DELINQUENT, + ACCOUNT_INACCESSIBLE, + ACCOUNT_INACTIVE, + INCOMPLETE_SIGNUP, + INCOMPLETE_SIGNUP_LATEST_ADWORDS_API_TNC_NOT_AGREED, + INCOMPLETE_SIGNUP_NO_BILLING_INFO, + INCOMPLETE_SIGNUP_USER_INFO_MISSING, + INCOMPLETE_SIGNUP_USER_INFO_PENDING, + INCOMPLETE_SIGNUP_USER_INFO_REJECTED, + MONTHLY_BUDGET_REACHED, + QUOTA_EXCEEDED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class QueryError : ApiError { + private QueryErrorReason reasonField; + + private bool reasonFieldSpecified; + + private string messageField; + + public QueryErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + public string message { + get { return this.messageField; } + set { this.messageField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "QueryError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum QueryErrorReason { + PARSING_FAILED, + MISSING_QUERY, + MISSING_SELECT_CLAUSE, + MISSING_FROM_CLAUSE, + INVALID_SELECT_CLAUSE, + INVALID_FROM_CLAUSE, + INVALID_WHERE_CLAUSE, + INVALID_ORDER_BY_CLAUSE, + INVALID_LIMIT_CLAUSE, + INVALID_START_INDEX_IN_LIMIT_CLAUSE, + INVALID_PAGE_SIZE_IN_LIMIT_CLAUSE, + INVALID_DURING_CLAUSE, + INVALID_MIN_DATE_IN_DURING_CLAUSE, + INVALID_MAX_DATE_IN_DURING_CLAUSE, + MAX_LESS_THAN_MIN_IN_DURING_CLAUSE, + VALIDATION_FAILED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class OperationAccessDenied : ApiError { + private OperationAccessDeniedReason reasonField; + + private bool reasonFieldSpecified; + + public OperationAccessDeniedReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OperationAccessDenied.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum OperationAccessDeniedReason { + ACTION_NOT_PERMITTED, + ADD_OPERATION_NOT_PERMITTED, + REMOVE_OPERATION_NOT_PERMITTED, + SET_OPERATION_NOT_PERMITTED, + MUTATE_ACTION_NOT_PERMITTED_FOR_CLIENT, + OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE, + ADD_AS_REMOVED_NOT_PERMITTED, + OPERATION_NOT_PERMITTED_FOR_REMOVED_ENTITY, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class NullError : ApiError { + private NullErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NullErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NullError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum NullErrorReason { + NULL_CONTENT + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class NotEmptyError : ApiError { + private NotEmptyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NotEmptyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NotEmptyError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum NotEmptyErrorReason { + EMPTY_LIST + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class NewEntityCreationError : ApiError { + private NewEntityCreationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NewEntityCreationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NewEntityCreationError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum NewEntityCreationErrorReason { + CANNOT_SET_ID_FOR_ADD + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class InternalApiError : ApiError { + private InternalApiErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InternalApiErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InternalApiError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum InternalApiErrorReason { + UNEXPECTED_INTERNAL_API_ERROR, + UNKNOWN, + DOWNTIME + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class IdError : ApiError { + private IdErrorReason reasonField; + + private bool reasonFieldSpecified; + + public IdErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "IdError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum IdErrorReason { + NOT_FOUND + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class EntityNotFound : ApiError { + private EntityNotFoundReason reasonField; + + private bool reasonFieldSpecified; + + public EntityNotFoundReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "EntityNotFound.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum EntityNotFoundReason { + INVALID_ID + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupAdCountLimitExceeded))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupCriterionLimitExceeded))] + public partial class EntityCountLimitExceeded : ApiError { + private EntityCountLimitExceededReason reasonField; + + private bool reasonFieldSpecified; + + private string enclosingIdField; + + private int limitField; + + private bool limitFieldSpecified; + + private string accountLimitTypeField; + + private int existingCountField; + + private bool existingCountFieldSpecified; + + public EntityCountLimitExceededReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + public string enclosingId { + get { return this.enclosingIdField; } + set { this.enclosingIdField = value; } + } + + public int limit { + get { return this.limitField; } + set { + this.limitField = value; + this.limitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool limitSpecified { + get { return this.limitFieldSpecified; } + set { this.limitFieldSpecified = value; } + } + + public string accountLimitType { + get { return this.accountLimitTypeField; } + set { this.accountLimitTypeField = value; } + } + + public int existingCount { + get { return this.existingCountField; } + set { + this.existingCountField = value; + this.existingCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool existingCountSpecified { + get { return this.existingCountFieldSpecified; } + set { this.existingCountFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "EntityCountLimitExceeded.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum EntityCountLimitExceededReason { + ACCOUNT_LIMIT, + CAMPAIGN_LIMIT, + ADGROUP_LIMIT, + SHARED_SET_LIMIT, + MATCHING_FUNCTION_LIMIT, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class DistinctError : ApiError { + private DistinctErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DistinctErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DistinctError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum DistinctErrorReason { + DUPLICATE_ELEMENT, + DUPLICATE_TYPE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class DateRangeError : ApiError { + private DateRangeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DateRangeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DateRangeError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum DateRangeErrorReason { + DATE_RANGE_ERROR, + INVALID_DATE, + START_DATE_AFTER_END_DATE, + CANNOT_SET_DATE_TO_PAST, + AFTER_MAXIMUM_ALLOWABLE_DATE, + CANNOT_MODIFY_START_DATE_IF_ALREADY_STARTED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class DateError : ApiError { + private DateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DateError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum DateErrorReason { + INVALID_FIELD_VALUES_IN_DATE, + INVALID_FIELD_VALUES_IN_DATE_TIME, + INVALID_STRING_DATE, + INVALID_STRING_DATE_RANGE, + INVALID_STRING_DATE_TIME, + EARLIER_THAN_MINIMUM_DATE, + LATER_THAN_MAXIMUM_DATE, + DATE_RANGE_MINIMUM_DATE_LATER_THAN_MAXIMUM_DATE, + DATE_RANGE_MINIMUM_AND_MAXIMUM_DATES_BOTH_NULL + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ClientTermsError : ApiError { + private ClientTermsErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ClientTermsErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ClientTermsError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ClientTermsErrorReason { + INCOMPLETE_SIGNUP_CURRENT_ADWORDS_TNC_NOT_AGREED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class BudgetError : ApiError { + private BudgetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BudgetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BudgetError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum BudgetErrorReason { + BUDGET_REMOVED, + BUDGET_ERROR, + BUDGET_IN_USE, + BUDGET_PERIOD_NOT_AVAILABLE, + CANNOT_EDIT_SHARED_BUDGET, + CANNOT_MODIFY_FIELD_OF_IMPLICITLY_SHARED_BUDGET, + CANNOT_UPDATE_BUDGET_TO_IMPLICITLY_SHARED, + CANNOT_USE_IMPLICITLY_SHARED_BUDGET_WITH_MULTIPLE_CAMPAIGNS, + DUPLICATE_NAME, + MONEY_AMOUNT_IN_WRONG_CURRENCY, + MONEY_AMOUNT_LESS_THAN_CURRENCY_MINIMUM_CPC, + MONEY_AMOUNT_TOO_LARGE, + NEGATIVE_MONEY_AMOUNT, + NON_MULTIPLE_OF_MINIMUM_CURRENCY_UNIT + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AuthorizationError : ApiError { + private AuthorizationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AuthorizationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AuthorizationError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AuthorizationErrorReason { + UNABLE_TO_AUTHORIZE, + NO_ADWORDS_ACCOUNT_FOR_CUSTOMER, + USER_PERMISSION_DENIED, + EFFECTIVE_USER_PERMISSION_DENIED, + USER_HAS_READONLY_PERMISSION, + NO_CUSTOMER_FOUND, + SERVICE_ACCESS_DENIED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AuthenticationError : ApiError { + private AuthenticationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AuthenticationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AuthenticationError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AuthenticationErrorReason { + AUTHENTICATION_FAILED, + CLIENT_CUSTOMER_ID_IS_REQUIRED, + CLIENT_EMAIL_REQUIRED, + CLIENT_CUSTOMER_ID_INVALID, + CLIENT_EMAIL_INVALID, + CLIENT_EMAIL_FAILED_TO_AUTHENTICATE, + CUSTOMER_NOT_FOUND, + GOOGLE_ACCOUNT_DELETED, + GOOGLE_ACCOUNT_COOKIE_INVALID, + FAILED_TO_AUTHENTICATE_GOOGLE_ACCOUNT, + GOOGLE_ACCOUNT_USER_AND_ADS_USER_MISMATCH, + LOGIN_COOKIE_REQUIRED, + NOT_ADS_USER, + OAUTH_TOKEN_INVALID, + OAUTH_TOKEN_EXPIRED, + OAUTH_TOKEN_DISABLED, + OAUTH_TOKEN_REVOKED, + OAUTH_TOKEN_HEADER_INVALID, + LOGIN_COOKIE_INVALID, + FAILED_TO_RETRIEVE_LOGIN_COOKIE, + USER_ID_INVALID + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CampaignAdExtensionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CampaignAdExtensionService : AdWordsSoapClient, ICampaignAdExtensionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CampaignAdExtensionService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/CampaignAdExtensionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignAdExtensionPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((CampaignAdExtensionPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignAdExtensionReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +CampaignAdExtensionOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((CampaignAdExtensionReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignAdExtensionReturnValue : ListReturnValue { + private CampaignAdExtension[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public CampaignAdExtension[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignAdExtension { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private AdExtension adExtensionField; + + private CampaignAdExtensionStatus statusField; + + private bool statusFieldSpecified; + + private CampaignAdExtensionApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public AdExtension adExtension { + get { return this.adExtensionField; } + set { this.adExtensionField = value; } + } + + public CampaignAdExtensionStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public CampaignAdExtensionApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LocationSyncExtension))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LocationExtension))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdExtension { + private long idField; + + private bool idFieldSpecified; + + private string adExtensionTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("AdExtension.Type")] + public string AdExtensionType { + get { return this.adExtensionTypeField; } + set { this.adExtensionTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class LocationSyncExtension : AdExtension { + private string emailField; + + private OAuthInfo oAuthInfoField; + + private long iconMediaIdField; + + private bool iconMediaIdFieldSpecified; + + private bool shouldSyncUrlField; + + private bool shouldSyncUrlFieldSpecified; + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public OAuthInfo oAuthInfo { + get { return this.oAuthInfoField; } + set { this.oAuthInfoField = value; } + } + + public long iconMediaId { + get { return this.iconMediaIdField; } + set { + this.iconMediaIdField = value; + this.iconMediaIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool iconMediaIdSpecified { + get { return this.iconMediaIdFieldSpecified; } + set { this.iconMediaIdFieldSpecified = value; } + } + + public bool shouldSyncUrl { + get { return this.shouldSyncUrlField; } + set { + this.shouldSyncUrlField = value; + this.shouldSyncUrlSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool shouldSyncUrlSpecified { + get { return this.shouldSyncUrlFieldSpecified; } + set { this.shouldSyncUrlFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class OAuthInfo { + private string httpMethodField; + + private string httpRequestUrlField; + + private string httpAuthorizationHeaderField; + + public string httpMethod { + get { return this.httpMethodField; } + set { this.httpMethodField = value; } + } + + public string httpRequestUrl { + get { return this.httpRequestUrlField; } + set { this.httpRequestUrlField = value; } + } + + public string httpAuthorizationHeader { + get { return this.httpAuthorizationHeaderField; } + set { this.httpAuthorizationHeaderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class LocationExtension : AdExtension { + private Address addressField; + + private GeoPoint geoPointField; + + private byte[] encodedLocationField; + + private string companyNameField; + + private string phoneNumberField; + + private LocationExtensionSource sourceField; + + private bool sourceFieldSpecified; + + private long iconMediaIdField; + + private bool iconMediaIdFieldSpecified; + + private long imageMediaIdField; + + private bool imageMediaIdFieldSpecified; + + public Address address { + get { return this.addressField; } + set { this.addressField = value; } + } + + public GeoPoint geoPoint { + get { return this.geoPointField; } + set { this.geoPointField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] encodedLocation { + get { return this.encodedLocationField; } + set { this.encodedLocationField = value; } + } + + public string companyName { + get { return this.companyNameField; } + set { this.companyNameField = value; } + } + + public string phoneNumber { + get { return this.phoneNumberField; } + set { this.phoneNumberField = value; } + } + + public LocationExtensionSource source { + get { return this.sourceField; } + set { + this.sourceField = value; + this.sourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sourceSpecified { + get { return this.sourceFieldSpecified; } + set { this.sourceFieldSpecified = value; } + } + + public long iconMediaId { + get { return this.iconMediaIdField; } + set { + this.iconMediaIdField = value; + this.iconMediaIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool iconMediaIdSpecified { + get { return this.iconMediaIdFieldSpecified; } + set { this.iconMediaIdFieldSpecified = value; } + } + + public long imageMediaId { + get { return this.imageMediaIdField; } + set { + this.imageMediaIdField = value; + this.imageMediaIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool imageMediaIdSpecified { + get { return this.imageMediaIdFieldSpecified; } + set { this.imageMediaIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Address { + private string streetAddressField; + + private string streetAddress2Field; + + private string cityNameField; + + private string provinceCodeField; + + private string provinceNameField; + + private string postalCodeField; + + private string countryCodeField; + + public string streetAddress { + get { return this.streetAddressField; } + set { this.streetAddressField = value; } + } + + public string streetAddress2 { + get { return this.streetAddress2Field; } + set { this.streetAddress2Field = value; } + } + + public string cityName { + get { return this.cityNameField; } + set { this.cityNameField = value; } + } + + public string provinceCode { + get { return this.provinceCodeField; } + set { this.provinceCodeField = value; } + } + + public string provinceName { + get { return this.provinceNameField; } + set { this.provinceNameField = value; } + } + + public string postalCode { + get { return this.postalCodeField; } + set { this.postalCodeField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class GeoPoint { + private int latitudeInMicroDegreesField; + + private bool latitudeInMicroDegreesFieldSpecified; + + private int longitudeInMicroDegreesField; + + private bool longitudeInMicroDegreesFieldSpecified; + + public int latitudeInMicroDegrees { + get { return this.latitudeInMicroDegreesField; } + set { + this.latitudeInMicroDegreesField = value; + this.latitudeInMicroDegreesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool latitudeInMicroDegreesSpecified { + get { return this.latitudeInMicroDegreesFieldSpecified; } + set { this.latitudeInMicroDegreesFieldSpecified = value; } + } + + public int longitudeInMicroDegrees { + get { return this.longitudeInMicroDegreesField; } + set { + this.longitudeInMicroDegreesField = value; + this.longitudeInMicroDegreesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool longitudeInMicroDegreesSpecified { + get { return this.longitudeInMicroDegreesFieldSpecified; } + set { this.longitudeInMicroDegreesFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LocationExtension.Source", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum LocationExtensionSource { + ADWORDS_FRONTEND, + LBC_SYNC + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignAdExtension.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum CampaignAdExtensionStatus { + ENABLED, + REMOVED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignAdExtension.ApprovalStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum CampaignAdExtensionApprovalStatus { + APPROVED, + UNCHECKED, + DISAPPROVED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignAdExtensionOperation : Operation { + private CampaignAdExtension operandField; + + public CampaignAdExtension operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignAdExtensionPage : Page { + private CampaignAdExtension[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public CampaignAdExtension[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class RegionCodeError : ApiError { + private RegionCodeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RegionCodeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RegionCodeError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum RegionCodeErrorReason { + INVALID_REGION_CODE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class PagingError : ApiError { + private PagingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PagingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PagingError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum PagingErrorReason { + START_INDEX_CANNOT_BE_NEGATIVE, + NUMBER_OF_RESULTS_CANNOT_BE_NEGATIVE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class OperatorError : ApiError { + private OperatorErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OperatorErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OperatorError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum OperatorErrorReason { + OPERATOR_NOT_SUPPORTED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignAdExtensionError : ApiError { + private CampaignAdExtensionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CampaignAdExtensionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignAdExtensionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum CampaignAdExtensionErrorReason { + ADEXTENSION_NOT_UNDER_CAMPAIGN, + CANNOT_ADD_REMOVED_CAMPAIGN_ADEXTENSION, + CANNOT_OPERATE_ON_REMOVED_CAMPAIGN_ADEXTENSION, + INVALID_ADEXTENSION_ID, + MISSING_ADEXTENSION_ID, + MUST_USE_CONCRETE_ADEXTENSION, + UNKNOWN_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdxError : ApiError { + private AdxErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdxErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdxError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AdxErrorReason { + UNSUPPORTED_FEATURE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdExtensionError : ApiError { + private AdExtensionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdExtensionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdExtensionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AdExtensionErrorReason { + ACCOUNT_DELETED, + AD_EXTENSION_NO_LONGER_ACTIVE, + CANNOT_HAVE_MULTIPLE_LOCATION_SYNC_EXTENSIONS_PER_CAMPAIGN, + CANNOT_HAVE_MULTIPLE_MOBILE_EXTENSIONS_PER_CAMPAIGN, + CANNOT_HAVE_MULTIPLE_PRODUCT_EXTENSIONS_PER_CAMPAIGN, + CANNOT_HAVE_MULTIPLE_SITELINKS_EXTENSIONS_PER_CAMPAIGN, + CANNOT_HAVE_MULTIPLE_IN_APP_LINK_EXTENSIONS_PER_CAMPAIGN_PER_APPSTORE, + INVALID_ADEXTENSION_TYPE, + INVALID_AUTH_TOKEN_FOR_EMAIL, + INVALID_COUNTRY_CODE, + INVALID_DOMESTIC_PHONE_NUMBER_FORMAT, + INVALID_DESTINATION_URL, + INVALID_EMAIL, + INVALID_ENCODED_LOCATION, + INVALID_ENUM_CONDITION_OPERATOR, + INVALID_ICON_DIMENSIONS, + INVALID_ID, + INVALID_IMAGE_DIMENSIONS, + INVALID_INPUT, + INVALID_LATITUDE, + INVALID_LONGITUDE, + INVALID_PHONE_NUMBER, + INVALID_STRING_CONDITION_OPERATOR, + INVALID_TOLL_PHONE_NUMBER_FORMAT, + MEDIA_DOES_NOT_BELONG_TO_ACCOUNT, + MEDIA_NOT_ICON_TYPE, + MEDIA_NOT_IMAGE_TYPE, + MISSING_ADVERTISER_NAME, + MISSING_AUTH_TOKEN, + MISSING_COUNTRY_CODE, + MISSING_CITY_NAME, + MISSING_EMAIL, + MISSING_ENCODED_LOCATION, + MISSING_CONDITION_OPERAND, + MISSING_CONDITION_STRING_VALUE, + MISSING_POSTAL_CODE, + MISSING_STREET_ADDRESS, + NUM_AND_GROUPS_OVER_LIMIT, + NUM_CONDITIONS_OVER_LIMIT, + NUM_LOCATION_EXTENSIONS_OVER_LIMIT, + NOT_AUTHORIZED_TO_CREATE_EXTENSION, + PHONE_NUMBER_NOT_SUPPORTED_FOR_COUNTRY, + DISALLOWED_NUMBER_TYPE, + PREMIUM_RATE_NUMBER_NOT_ALLOWED, + TOO_LONG, + USER_NOT_PERMITTED_TO_CREATE_LBC_SYNC_LOCATION_EXTENSION + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CampaignCriterionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CampaignCriterionService : AdWordsSoapClient, ICampaignCriterionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CampaignCriterionService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/CampaignCriterionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignCriterionPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((CampaignCriterionPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignCriterionReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +CampaignCriterionOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((CampaignCriterionReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignCriterionPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((CampaignCriterionPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignCriterionReturnValue : ListReturnValue { + private CampaignCriterion[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public CampaignCriterion[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NegativeCampaignCriterion))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignCriterion { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private bool isNegativeField; + + private bool isNegativeFieldSpecified; + + private Criterion criterionField; + + private double bidModifierField; + + private bool bidModifierFieldSpecified; + + private String_StringMapEntry[] forwardCompatibilityMapField; + + private string campaignCriterionTypeField; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public bool isNegative { + get { return this.isNegativeField; } + set { + this.isNegativeField = value; + this.isNegativeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isNegativeSpecified { + get { return this.isNegativeFieldSpecified; } + set { this.isNegativeFieldSpecified = value; } + } + + public Criterion criterion { + get { return this.criterionField; } + set { this.criterionField = value; } + } + + public double bidModifier { + get { return this.bidModifierField; } + set { + this.bidModifierField = value; + this.bidModifierSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidModifierSpecified { + get { return this.bidModifierFieldSpecified; } + set { this.bidModifierFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("forwardCompatibilityMap")] + public String_StringMapEntry[] forwardCompatibilityMap { + get { return this.forwardCompatibilityMapField; } + set { this.forwardCompatibilityMapField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("CampaignCriterion.Type")] + public string CampaignCriterionType { + get { return this.campaignCriterionTypeField; } + set { this.campaignCriterionTypeField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Vertical))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionUserList))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionUserInterest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LocationGroups))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Proximity))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductScope))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductSalesChannel))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Product))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Platform))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Placement))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystemVersion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileDevice))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileApplication))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileAppCategory))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Location))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Language))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Keyword))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IpBlock))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Gender))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentLabel))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Carrier))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AgeRange))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSchedule))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Webpage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductPartition))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NegativeKeyword))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductService))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NegativeCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(KeywordSet))] + public partial class Criterion { + private long idField; + + private bool idFieldSpecified; + + private CriterionType typeField; + + private bool typeFieldSpecified; + + private string criterionTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public CriterionType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Criterion.Type")] + public string CriterionType { + get { return this.criterionTypeField; } + set { this.criterionTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Criterion.Type", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum CriterionType { + CONTENT_LABEL, + KEYWORD, + PLACEMENT, + VERTICAL, + USER_LIST, + USER_INTEREST, + MOBILE_APPLICATION, + MOBILE_APP_CATEGORY, + PRODUCT, + PRODUCT_PARTITION, + IP_BLOCK, + WEBPAGE, + LANGUAGE, + LOCATION, + AGE_RANGE, + CARRIER, + OPERATING_SYSTEM_VERSION, + MOBILE_DEVICE, + GENDER, + PROXIMITY, + PLATFORM, + AD_SCHEDULE, + LOCATION_GROUPS, + PRODUCT_SCOPE, + PRODUCT_SALES_CHANNEL, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Vertical : Criterion { + private long verticalIdField; + + private bool verticalIdFieldSpecified; + + private long verticalParentIdField; + + private bool verticalParentIdFieldSpecified; + + private string[] pathField; + + public long verticalId { + get { return this.verticalIdField; } + set { + this.verticalIdField = value; + this.verticalIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool verticalIdSpecified { + get { return this.verticalIdFieldSpecified; } + set { this.verticalIdFieldSpecified = value; } + } + + public long verticalParentId { + get { return this.verticalParentIdField; } + set { + this.verticalParentIdField = value; + this.verticalParentIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool verticalParentIdSpecified { + get { return this.verticalParentIdFieldSpecified; } + set { this.verticalParentIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("path")] + public string[] path { + get { return this.pathField; } + set { this.pathField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CriterionUserList : Criterion { + private long userListIdField; + + private bool userListIdFieldSpecified; + + private string userListNameField; + + private CriterionUserListMembershipStatus userListMembershipStatusField; + + private bool userListMembershipStatusFieldSpecified; + + public long userListId { + get { return this.userListIdField; } + set { + this.userListIdField = value; + this.userListIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userListIdSpecified { + get { return this.userListIdFieldSpecified; } + set { this.userListIdFieldSpecified = value; } + } + + public string userListName { + get { return this.userListNameField; } + set { this.userListNameField = value; } + } + + public CriterionUserListMembershipStatus userListMembershipStatus { + get { return this.userListMembershipStatusField; } + set { + this.userListMembershipStatusField = value; + this.userListMembershipStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userListMembershipStatusSpecified { + get { return this.userListMembershipStatusFieldSpecified; } + set { this.userListMembershipStatusFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CriterionUserList.MembershipStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum CriterionUserListMembershipStatus { + OPEN, + CLOSED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CriterionUserInterest : Criterion { + private long userInterestIdField; + + private bool userInterestIdFieldSpecified; + + private string userInterestNameField; + + public long userInterestId { + get { return this.userInterestIdField; } + set { + this.userInterestIdField = value; + this.userInterestIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userInterestIdSpecified { + get { return this.userInterestIdFieldSpecified; } + set { this.userInterestIdFieldSpecified = value; } + } + + public string userInterestName { + get { return this.userInterestNameField; } + set { this.userInterestNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class LocationGroups : Criterion { + private Function matchingFunctionField; + + public Function matchingFunction { + get { return this.matchingFunctionField; } + set { this.matchingFunctionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Function { + private FunctionOperator operatorField; + + private bool operatorFieldSpecified; + + private FunctionArgumentOperand[] lhsOperandField; + + private FunctionArgumentOperand[] rhsOperandField; + + public FunctionOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("lhsOperand")] + public FunctionArgumentOperand[] lhsOperand { + get { return this.lhsOperandField; } + set { this.lhsOperandField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("rhsOperand")] + public FunctionArgumentOperand[] rhsOperand { + get { return this.rhsOperandField; } + set { this.rhsOperandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Function.Operator", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum FunctionOperator { + IN, + IDENTITY, + EQUALS, + AND, + UNKNOWN + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacesOfInterestOperand))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LocationExtensionOperand))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IncomeOperand))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GeoTargetOperand))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConstantOperand))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequestContextOperand))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FunctionOperand))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedAttributeOperand))] + public abstract partial class FunctionArgumentOperand { + private string functionArgumentOperandTypeField; + + [System.Xml.Serialization.XmlElementAttribute("FunctionArgumentOperand.Type")] + public string FunctionArgumentOperandType { + get { return this.functionArgumentOperandTypeField; } + set { this.functionArgumentOperandTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class PlacesOfInterestOperand : FunctionArgumentOperand { + private PlacesOfInterestOperandCategory categoryField; + + private bool categoryFieldSpecified; + + public PlacesOfInterestOperandCategory category { + get { return this.categoryField; } + set { + this.categoryField = value; + this.categorySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool categorySpecified { + get { return this.categoryFieldSpecified; } + set { this.categoryFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PlacesOfInterestOperand.Category", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum PlacesOfInterestOperandCategory { + AIRPORT, + DOWNTOWN, + UNIVERSITY, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class LocationExtensionOperand : FunctionArgumentOperand { + private ConstantOperand radiusField; + + public ConstantOperand radius { + get { return this.radiusField; } + set { this.radiusField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ConstantOperand : FunctionArgumentOperand { + private ConstantOperandConstantType typeField; + + private bool typeFieldSpecified; + + private ConstantOperandUnit unitField; + + private bool unitFieldSpecified; + + private long longValueField; + + private bool longValueFieldSpecified; + + private bool booleanValueField; + + private bool booleanValueFieldSpecified; + + private double doubleValueField; + + private bool doubleValueFieldSpecified; + + private string stringValueField; + + public ConstantOperandConstantType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public ConstantOperandUnit unit { + get { return this.unitField; } + set { + this.unitField = value; + this.unitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitSpecified { + get { return this.unitFieldSpecified; } + set { this.unitFieldSpecified = value; } + } + + public long longValue { + get { return this.longValueField; } + set { + this.longValueField = value; + this.longValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool longValueSpecified { + get { return this.longValueFieldSpecified; } + set { this.longValueFieldSpecified = value; } + } + + public bool booleanValue { + get { return this.booleanValueField; } + set { + this.booleanValueField = value; + this.booleanValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool booleanValueSpecified { + get { return this.booleanValueFieldSpecified; } + set { this.booleanValueFieldSpecified = value; } + } + + public double doubleValue { + get { return this.doubleValueField; } + set { + this.doubleValueField = value; + this.doubleValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool doubleValueSpecified { + get { return this.doubleValueFieldSpecified; } + set { this.doubleValueFieldSpecified = value; } + } + + public string stringValue { + get { return this.stringValueField; } + set { this.stringValueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConstantOperand.ConstantType", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ConstantOperandConstantType { + BOOLEAN, + DOUBLE, + LONG, + STRING + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConstantOperand.Unit", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ConstantOperandUnit { + METERS, + MILES, + NONE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class IncomeOperand : FunctionArgumentOperand { + private IncomeTier tierField; + + private bool tierFieldSpecified; + + public IncomeTier tier { + get { return this.tierField; } + set { + this.tierField = value; + this.tierSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool tierSpecified { + get { return this.tierFieldSpecified; } + set { this.tierFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum IncomeTier { + UNKNOWN, + TIER_1, + TIER_2, + TIER_3, + TIER_4, + TIER_5, + TIER_6_TO_10 + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class GeoTargetOperand : FunctionArgumentOperand { + private long[] locationsField; + + [System.Xml.Serialization.XmlElementAttribute("locations")] + public long[] locations { + get { return this.locationsField; } + set { this.locationsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Proximity : Criterion { + private GeoPoint geoPointField; + + private ProximityDistanceUnits radiusDistanceUnitsField; + + private bool radiusDistanceUnitsFieldSpecified; + + private double radiusInUnitsField; + + private bool radiusInUnitsFieldSpecified; + + private Address addressField; + + public GeoPoint geoPoint { + get { return this.geoPointField; } + set { this.geoPointField = value; } + } + + public ProximityDistanceUnits radiusDistanceUnits { + get { return this.radiusDistanceUnitsField; } + set { + this.radiusDistanceUnitsField = value; + this.radiusDistanceUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool radiusDistanceUnitsSpecified { + get { return this.radiusDistanceUnitsFieldSpecified; } + set { this.radiusDistanceUnitsFieldSpecified = value; } + } + + public double radiusInUnits { + get { return this.radiusInUnitsField; } + set { + this.radiusInUnitsField = value; + this.radiusInUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool radiusInUnitsSpecified { + get { return this.radiusInUnitsFieldSpecified; } + set { this.radiusInUnitsFieldSpecified = value; } + } + + public Address address { + get { return this.addressField; } + set { this.addressField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Proximity.DistanceUnits", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ProximityDistanceUnits { + KILOMETERS, + MILES + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ProductScope : Criterion { + private ProductDimension[] dimensionsField; + + [System.Xml.Serialization.XmlElementAttribute("dimensions")] + public ProductDimension[] dimensions { + get { return this.dimensionsField; } + set { this.dimensionsField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductTypeFull))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductOfferId))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductCustomAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductLegacyCondition))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductCanonicalCondition))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductBrand))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductBiddingCategory))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductAdwordsLabels))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductAdwordsGrouping))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public abstract partial class ProductDimension { + private string productDimensionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProductDimension.Type")] + public string ProductDimensionType { + get { return this.productDimensionTypeField; } + set { this.productDimensionTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ProductTypeFull : ProductDimension { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ProductType : ProductDimension { + private ProductDimensionType typeField; + + private bool typeFieldSpecified; + + private string valueField; + + public ProductDimensionType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ProductDimensionType { + UNKNOWN, + BIDDING_CATEGORY_L1, + BIDDING_CATEGORY_L2, + BIDDING_CATEGORY_L3, + BIDDING_CATEGORY_L4, + BIDDING_CATEGORY_L5, + BRAND, + CANONICAL_CONDITION, + CUSTOM_ATTRIBUTE_0, + CUSTOM_ATTRIBUTE_1, + CUSTOM_ATTRIBUTE_2, + CUSTOM_ATTRIBUTE_3, + CUSTOM_ATTRIBUTE_4, + OFFER_ID, + PRODUCT_TYPE_L1, + PRODUCT_TYPE_L2, + PRODUCT_TYPE_L3, + PRODUCT_TYPE_L4, + PRODUCT_TYPE_L5 + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ProductOfferId : ProductDimension { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ProductCustomAttribute : ProductDimension { + private ProductDimensionType typeField; + + private bool typeFieldSpecified; + + private string valueField; + + public ProductDimensionType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ProductLegacyCondition : ProductDimension { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ProductCanonicalCondition : ProductDimension { + private ProductCanonicalConditionCondition conditionField; + + private bool conditionFieldSpecified; + + public ProductCanonicalConditionCondition condition { + get { return this.conditionField; } + set { + this.conditionField = value; + this.conditionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool conditionSpecified { + get { return this.conditionFieldSpecified; } + set { this.conditionFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductCanonicalCondition.Condition", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ProductCanonicalConditionCondition { + NEW, + USED, + REFURBISHED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ProductBrand : ProductDimension { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ProductBiddingCategory : ProductDimension { + private ProductDimensionType typeField; + + private bool typeFieldSpecified; + + private long valueField; + + private bool valueFieldSpecified; + + public ProductDimensionType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public long value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ProductAdwordsLabels : ProductDimension { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ProductAdwordsGrouping : ProductDimension { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ProductSalesChannel : Criterion { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Product : Criterion { + private ProductCondition[] conditionsField; + + private string textField; + + [System.Xml.Serialization.XmlElementAttribute("conditions")] + public ProductCondition[] conditions { + get { return this.conditionsField; } + set { this.conditionsField = value; } + } + + public string text { + get { return this.textField; } + set { this.textField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ProductCondition { + private string argumentField; + + private ProductConditionOperand operandField; + + public string argument { + get { return this.argumentField; } + set { this.argumentField = value; } + } + + public ProductConditionOperand operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ProductConditionOperand { + private string operandField; + + public string operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Platform : Criterion { + private string platformNameField; + + public string platformName { + get { return this.platformNameField; } + set { this.platformNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Placement : Criterion { + private string urlField; + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class OperatingSystemVersion : Criterion { + private string nameField; + + private int osMajorVersionField; + + private bool osMajorVersionFieldSpecified; + + private int osMinorVersionField; + + private bool osMinorVersionFieldSpecified; + + private OperatingSystemVersionOperatorType operatorTypeField; + + private bool operatorTypeFieldSpecified; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public int osMajorVersion { + get { return this.osMajorVersionField; } + set { + this.osMajorVersionField = value; + this.osMajorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool osMajorVersionSpecified { + get { return this.osMajorVersionFieldSpecified; } + set { this.osMajorVersionFieldSpecified = value; } + } + + public int osMinorVersion { + get { return this.osMinorVersionField; } + set { + this.osMinorVersionField = value; + this.osMinorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool osMinorVersionSpecified { + get { return this.osMinorVersionFieldSpecified; } + set { this.osMinorVersionFieldSpecified = value; } + } + + public OperatingSystemVersionOperatorType operatorType { + get { return this.operatorTypeField; } + set { + this.operatorTypeField = value; + this.operatorTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorTypeSpecified { + get { return this.operatorTypeFieldSpecified; } + set { this.operatorTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OperatingSystemVersion.OperatorType", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum OperatingSystemVersionOperatorType { + GREATER_THAN_EQUAL_TO, + EQUAL_TO, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class MobileDevice : Criterion { + private string deviceNameField; + + private string manufacturerNameField; + + private MobileDeviceDeviceType deviceTypeField; + + private bool deviceTypeFieldSpecified; + + private string operatingSystemNameField; + + public string deviceName { + get { return this.deviceNameField; } + set { this.deviceNameField = value; } + } + + public string manufacturerName { + get { return this.manufacturerNameField; } + set { this.manufacturerNameField = value; } + } + + public MobileDeviceDeviceType deviceType { + get { return this.deviceTypeField; } + set { + this.deviceTypeField = value; + this.deviceTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deviceTypeSpecified { + get { return this.deviceTypeFieldSpecified; } + set { this.deviceTypeFieldSpecified = value; } + } + + public string operatingSystemName { + get { return this.operatingSystemNameField; } + set { this.operatingSystemNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "MobileDevice.DeviceType", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum MobileDeviceDeviceType { + DEVICE_TYPE_MOBILE, + DEVICE_TYPE_TABLET + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class MobileApplication : Criterion { + private string appIdField; + + private string displayNameField; + + public string appId { + get { return this.appIdField; } + set { this.appIdField = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class MobileAppCategory : Criterion { + private int mobileAppCategoryIdField; + + private bool mobileAppCategoryIdFieldSpecified; + + private string displayNameField; + + public int mobileAppCategoryId { + get { return this.mobileAppCategoryIdField; } + set { + this.mobileAppCategoryIdField = value; + this.mobileAppCategoryIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mobileAppCategoryIdSpecified { + get { return this.mobileAppCategoryIdFieldSpecified; } + set { this.mobileAppCategoryIdFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Location : Criterion { + private string locationNameField; + + private string displayTypeField; + + private LocationTargetingStatus targetingStatusField; + + private bool targetingStatusFieldSpecified; + + private Location[] parentLocationsField; + + public string locationName { + get { return this.locationNameField; } + set { this.locationNameField = value; } + } + + public string displayType { + get { return this.displayTypeField; } + set { this.displayTypeField = value; } + } + + public LocationTargetingStatus targetingStatus { + get { return this.targetingStatusField; } + set { + this.targetingStatusField = value; + this.targetingStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetingStatusSpecified { + get { return this.targetingStatusFieldSpecified; } + set { this.targetingStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("parentLocations")] + public Location[] parentLocations { + get { return this.parentLocationsField; } + set { this.parentLocationsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum LocationTargetingStatus { + ACTIVE, + OBSOLETE, + PHASING_OUT + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Language : Criterion { + private string codeField; + + private string nameField; + + public string code { + get { return this.codeField; } + set { this.codeField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NegativeKeyword))] + public partial class Keyword : Criterion { + private string textField; + + private KeywordMatchType matchTypeField; + + private bool matchTypeFieldSpecified; + + public string text { + get { return this.textField; } + set { this.textField = value; } + } + + public KeywordMatchType matchType { + get { return this.matchTypeField; } + set { + this.matchTypeField = value; + this.matchTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool matchTypeSpecified { + get { return this.matchTypeFieldSpecified; } + set { this.matchTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum KeywordMatchType { + EXACT, + PHRASE, + BROAD + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class IpBlock : Criterion { + private string ipAddressField; + + public string ipAddress { + get { return this.ipAddressField; } + set { this.ipAddressField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Gender : Criterion { + private GenderGenderType genderTypeField; + + private bool genderTypeFieldSpecified; + + public GenderGenderType genderType { + get { return this.genderTypeField; } + set { + this.genderTypeField = value; + this.genderTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool genderTypeSpecified { + get { return this.genderTypeFieldSpecified; } + set { this.genderTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Gender.GenderType", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum GenderGenderType { + GENDER_MALE, + GENDER_FEMALE, + GENDER_UNDETERMINED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ContentLabel : Criterion { + private ContentLabelType contentLabelTypeField; + + private bool contentLabelTypeFieldSpecified; + + public ContentLabelType contentLabelType { + get { return this.contentLabelTypeField; } + set { + this.contentLabelTypeField = value; + this.contentLabelTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contentLabelTypeSpecified { + get { return this.contentLabelTypeFieldSpecified; } + set { this.contentLabelTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ContentLabelType { + ADULTISH, + AFE, + BELOW_THE_FOLD, + CONFLICT, + DP, + EMBEDDED_VIDEO, + GAMES, + JACKASS, + PROFANITY, + UGC_FORUMS, + UGC_IMAGES, + UGC_SOCIAL, + UGC_VIDEOS, + SIRENS, + TRAGEDY, + VIDEO, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Carrier : Criterion { + private string nameField; + + private string countryCodeField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AgeRange : Criterion { + private AgeRangeAgeRangeType ageRangeTypeField; + + private bool ageRangeTypeFieldSpecified; + + public AgeRangeAgeRangeType ageRangeType { + get { return this.ageRangeTypeField; } + set { + this.ageRangeTypeField = value; + this.ageRangeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ageRangeTypeSpecified { + get { return this.ageRangeTypeFieldSpecified; } + set { this.ageRangeTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AgeRange.AgeRangeType", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AgeRangeAgeRangeType { + AGE_RANGE_18_24, + AGE_RANGE_25_34, + AGE_RANGE_35_44, + AGE_RANGE_45_54, + AGE_RANGE_55_64, + AGE_RANGE_65_UP, + AGE_RANGE_UNDETERMINED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdSchedule : Criterion { + private DayOfWeek dayOfWeekField; + + private bool dayOfWeekFieldSpecified; + + private int startHourField; + + private bool startHourFieldSpecified; + + private MinuteOfHour startMinuteField; + + private bool startMinuteFieldSpecified; + + private int endHourField; + + private bool endHourFieldSpecified; + + private MinuteOfHour endMinuteField; + + private bool endMinuteFieldSpecified; + + public DayOfWeek dayOfWeek { + get { return this.dayOfWeekField; } + set { + this.dayOfWeekField = value; + this.dayOfWeekSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dayOfWeekSpecified { + get { return this.dayOfWeekFieldSpecified; } + set { this.dayOfWeekFieldSpecified = value; } + } + + public int startHour { + get { return this.startHourField; } + set { + this.startHourField = value; + this.startHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startHourSpecified { + get { return this.startHourFieldSpecified; } + set { this.startHourFieldSpecified = value; } + } + + public MinuteOfHour startMinute { + get { return this.startMinuteField; } + set { + this.startMinuteField = value; + this.startMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startMinuteSpecified { + get { return this.startMinuteFieldSpecified; } + set { this.startMinuteFieldSpecified = value; } + } + + public int endHour { + get { return this.endHourField; } + set { + this.endHourField = value; + this.endHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endHourSpecified { + get { return this.endHourFieldSpecified; } + set { this.endHourFieldSpecified = value; } + } + + public MinuteOfHour endMinute { + get { return this.endMinuteField; } + set { + this.endMinuteField = value; + this.endMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endMinuteSpecified { + get { return this.endMinuteFieldSpecified; } + set { this.endMinuteFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum DayOfWeek { + MONDAY, + TUESDAY, + WEDNESDAY, + THURSDAY, + FRIDAY, + SATURDAY, + SUNDAY + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum MinuteOfHour { + ZERO, + FIFTEEN, + THIRTY, + FORTY_FIVE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class String_StringMapEntry { + private string keyField; + + private string valueField; + + public string key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class NegativeCampaignCriterion : CampaignCriterion { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignCriterionOperation : Operation { + private CampaignCriterion operandField; + + public CampaignCriterion operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignCriterionPage : Page { + private CampaignCriterion[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public CampaignCriterion[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FunctionError : ApiError { + private FunctionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FunctionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FunctionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum FunctionErrorReason { + INVALID_FUNCTION_FORMAT, + DATA_TYPE_MISMATCH, + INVALID_CONJUNCTION_OPERANDS, + INVALID_NUMBER_OF_OPERANDS, + INVALID_OPERAND_TYPE, + INVALID_OPERATOR, + INVALID_REQUEST_CONTEXT_TYPE, + INVALID_FUNCTION_FOR_CALL_PLACEHOLDER, + INVALID_FUNCTION_FOR_PLACEHOLDER, + INVALID_OPERAND, + MISSING_CONSTANT_OPERAND_VALUE, + INVALID_CONSTANT_OPERAND_VALUE, + INVALID_NESTING, + MULTIPLE_FEED_IDS_NOT_SUPPORTED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CriterionError : ApiError { + private CriterionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CriterionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CriterionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum CriterionErrorReason { + CONCRETE_TYPE_REQUIRED, + INVALID_EXCLUDED_CATEGORY, + INVALID_KEYWORD_TEXT, + KEYWORD_TEXT_TOO_LONG, + KEYWORD_HAS_TOO_MANY_WORDS, + KEYWORD_HAS_INVALID_CHARS, + INVALID_PLACEMENT_URL, + INVALID_USER_LIST, + INVALID_USER_INTEREST, + INVALID_FORMAT_FOR_PLACEMENT_URL, + PLACEMENT_URL_IS_TOO_LONG, + PLACEMENT_URL_HAS_ILLEGAL_CHAR, + PLACEMENT_URL_HAS_MULTIPLE_SITES_IN_LINE, + PLACEMENT_IS_NOT_AVAILABLE_FOR_TARGETING_OR_EXCLUSION, + INVALID_VERTICAL_PATH, + YOUTUBE_VERTICAL_CHANNEL_DEPRECATED, + YOUTUBE_DEMOGRAPHIC_CHANNEL_DEPRECATED, + CANNOT_EXCLUDE_CRITERIA_TYPE, + CANNOT_ADD_CRITERIA_TYPE, + INVALID_PRODUCT_FILTER, + PRODUCT_FILTER_TOO_LONG, + CANNOT_ADD_DISPLAY_ONLY_LISTS_TO_SEARCH_ONLY_CAMPAIGNS, + INVALID_CRITERION_ID, + CANNOT_TARGET_CRITERION, + CRITERION_ID_AND_TYPE_MISMATCH, + INVALID_PROXIMITY_RADIUS, + INVALID_PROXIMITY_RADIUS_UNITS, + INVALID_STREETADDRESS_LENGTH, + INVALID_CITYNAME_LENGTH, + INVALID_REGIONCODE_LENGTH, + INVALID_REGIONNAME_LENGTH, + INVALID_POSTALCODE_LENGTH, + INVALID_COUNTRY_CODE, + INVALID_LATITUDE, + INVALID_LONGITUDE, + PROXIMITY_GEOPOINT_AND_ADDRESS_BOTH_CANNOT_BE_NULL, + INVALID_PROXIMITY_ADDRESS, + AD_SCHEDULE_TIME_INTERVALS_OVERLAP, + AD_SCHEDULE_INTERVAL_CANNOT_SPAN_MULTIPLE_DAYS, + AD_SCHEDULE_INVALID_TIME_INTERVAL, + AD_SCHEDULE_EXCEEDED_INTERVALS_PER_DAY_LIMIT, + AD_SCHEDULE_CRITERION_ID_MISMATCHING_FIELDS, + CANNOT_BID_MODIFY_CRITERION_TYPE, + CANNOT_BID_MODIFY_CRITERION_CAMPAIGN_OPTED_OUT, + CANNOT_BID_MODIFY_NEGATIVE_CRITERION, + BID_MODIFIER_ALREADY_EXISTS, + ACCOUNT_INELIGIBLE_FOR_CRITERIA_TYPE, + CRITERIA_TYPE_INVALID_FOR_BIDDING_STRATEGY, + CANNOT_ATTACH_CRITERIA_BIDDING_STRATEGY_ON_CONTENT_NETWORK_ONLY_CAMPAIGN, + CANNOT_EXCLUDE_CRITERION, + CANNOT_REMOVE_CRITERION, + PRODUCT_SCOPE_TOO_LONG, + PRODUCT_SCOPE_TOO_MANY_DIMENSIONS, + PRODUCT_PARTITION_TOO_LONG, + PRODUCT_PARTITION_TOO_MANY_DIMENSIONS, + INVALID_PRODUCT_DIMENSION, + INVALID_PRODUCT_DIMENSION_TYPE, + INVALID_PRODUCT_BIDDING_CATEGORY, + MISSING_SHOPPING_SETTING, + INVALID_MATCHING_FUNCTION, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignCriterionError : ApiError { + private CampaignCriterionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CampaignCriterionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignCriterionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum CampaignCriterionErrorReason { + CONCRETE_TYPE_REQUIRED, + INVALID_PLACEMENT_URL, + CANNOT_EXCLUDE_CRITERIA_TYPE, + CANNOT_TARGET_AND_EXCLUDE, + TOO_MANY_OPERTAIONS, + OPERATOR_NOT_SUPPORTED_FOR_CRITERION_TYPE, + SHOPPING_CAMPAIGN_SALES_COUNTRY_NOT_SUPPORTED_FOR_SALES_CHANNEL, + UNKNOWN, + CANNOT_ADD_EXISTING_FIELD + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CampaignServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CampaignService : AdWordsSoapClient, ICampaignService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CampaignService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/CampaignService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((CampaignPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +CampaignOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((CampaignReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignLabelReturnValue mutateLabel([System.Xml.Serialization.XmlElementAttribute("operations")] +CampaignLabelOperation[] operations) { + object[] results = this.Invoke("mutateLabel", new object[] { operations }); + return ((CampaignLabelReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((CampaignPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignReturnValue : ListReturnValue { + private Campaign[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public Campaign[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Campaign { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private CampaignStatus statusField; + + private bool statusFieldSpecified; + + private ServingStatus servingStatusField; + + private bool servingStatusFieldSpecified; + + private string startDateField; + + private string endDateField; + + private Budget budgetField; + + private ConversionOptimizerEligibility conversionOptimizerEligibilityField; + + private AdServingOptimizationStatus adServingOptimizationStatusField; + + private bool adServingOptimizationStatusFieldSpecified; + + private FrequencyCap frequencyCapField; + + private Setting[] settingsField; + + private AdvertisingChannelType advertisingChannelTypeField; + + private bool advertisingChannelTypeFieldSpecified; + + private NetworkSetting networkSettingField; + + private Label[] labelsField; + + private BiddingStrategyConfiguration biddingStrategyConfigurationField; + + private String_StringMapEntry[] forwardCompatibilityMapField; + + private bool displaySelectField; + + private bool displaySelectFieldSpecified; + + private string trackingUrlTemplateField; + + private CustomParameters urlCustomParametersField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public CampaignStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ServingStatus servingStatus { + get { return this.servingStatusField; } + set { + this.servingStatusField = value; + this.servingStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool servingStatusSpecified { + get { return this.servingStatusFieldSpecified; } + set { this.servingStatusFieldSpecified = value; } + } + + public string startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public string endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + public Budget budget { + get { return this.budgetField; } + set { this.budgetField = value; } + } + + public ConversionOptimizerEligibility conversionOptimizerEligibility { + get { return this.conversionOptimizerEligibilityField; } + set { this.conversionOptimizerEligibilityField = value; } + } + + public AdServingOptimizationStatus adServingOptimizationStatus { + get { return this.adServingOptimizationStatusField; } + set { + this.adServingOptimizationStatusField = value; + this.adServingOptimizationStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adServingOptimizationStatusSpecified { + get { return this.adServingOptimizationStatusFieldSpecified; } + set { this.adServingOptimizationStatusFieldSpecified = value; } + } + + public FrequencyCap frequencyCap { + get { return this.frequencyCapField; } + set { this.frequencyCapField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("settings")] + public Setting[] settings { + get { return this.settingsField; } + set { this.settingsField = value; } + } + + public AdvertisingChannelType advertisingChannelType { + get { return this.advertisingChannelTypeField; } + set { + this.advertisingChannelTypeField = value; + this.advertisingChannelTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertisingChannelTypeSpecified { + get { return this.advertisingChannelTypeFieldSpecified; } + set { this.advertisingChannelTypeFieldSpecified = value; } + } + + public NetworkSetting networkSetting { + get { return this.networkSettingField; } + set { this.networkSettingField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("labels")] + public Label[] labels { + get { return this.labelsField; } + set { this.labelsField = value; } + } + + public BiddingStrategyConfiguration biddingStrategyConfiguration { + get { return this.biddingStrategyConfigurationField; } + set { this.biddingStrategyConfigurationField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("forwardCompatibilityMap")] + public String_StringMapEntry[] forwardCompatibilityMap { + get { return this.forwardCompatibilityMapField; } + set { this.forwardCompatibilityMapField = value; } + } + + public bool displaySelect { + get { return this.displaySelectField; } + set { + this.displaySelectField = value; + this.displaySelectSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool displaySelectSpecified { + get { return this.displaySelectFieldSpecified; } + set { this.displaySelectFieldSpecified = value; } + } + + public string trackingUrlTemplate { + get { return this.trackingUrlTemplateField; } + set { this.trackingUrlTemplateField = value; } + } + + public CustomParameters urlCustomParameters { + get { return this.urlCustomParametersField; } + set { this.urlCustomParametersField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum CampaignStatus { + ENABLED, + PAUSED, + REMOVED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ServingStatus { + SERVING, + NONE, + ENDED, + PENDING, + SUSPENDED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ConversionOptimizerEligibility { + private bool eligibleField; + + private bool eligibleFieldSpecified; + + private ConversionOptimizerEligibilityRejectionReason[] rejectionReasonsField; + + public bool eligible { + get { return this.eligibleField; } + set { + this.eligibleField = value; + this.eligibleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool eligibleSpecified { + get { return this.eligibleFieldSpecified; } + set { this.eligibleFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("rejectionReasons")] + public ConversionOptimizerEligibilityRejectionReason[] rejectionReasons { + get { return this.rejectionReasonsField; } + set { this.rejectionReasonsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConversionOptimizerEligibility.RejectionReason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ConversionOptimizerEligibilityRejectionReason { + CAMPAIGN_IS_NOT_ACTIVE, + NOT_CPC_CAMPAIGN, + CONVERSION_TRACKING_NOT_ENABLED, + NOT_ENOUGH_CONVERSIONS, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AdServingOptimizationStatus { + OPTIMIZE, + CONVERSION_OPTIMIZE, + ROTATE, + ROTATE_INDEFINITELY, + UNAVAILABLE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FrequencyCap { + private long impressionsField; + + private bool impressionsFieldSpecified; + + private TimeUnit timeUnitField; + + private bool timeUnitFieldSpecified; + + private Level levelField; + + private bool levelFieldSpecified; + + public long impressions { + get { return this.impressionsField; } + set { + this.impressionsField = value; + this.impressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsSpecified { + get { return this.impressionsFieldSpecified; } + set { this.impressionsFieldSpecified = value; } + } + + public TimeUnit timeUnit { + get { return this.timeUnitField; } + set { + this.timeUnitField = value; + this.timeUnitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool timeUnitSpecified { + get { return this.timeUnitFieldSpecified; } + set { this.timeUnitFieldSpecified = value; } + } + + public Level level { + get { return this.levelField; } + set { + this.levelField = value; + this.levelSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool levelSpecified { + get { return this.levelFieldSpecified; } + set { this.levelFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum TimeUnit { + MINUTE, + HOUR, + DAY, + WEEK, + MONTH, + LIFETIME + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum Level { + CREATIVE, + ADGROUP, + CAMPAIGN, + UNKNOWN + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TrackingSetting))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ShoppingSetting))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RealTimeBiddingSetting))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(KeywordMatchSetting))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GeoTargetTypeSetting))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DynamicSearchAdsSetting))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetingSetting))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExplorerAutoOptimizerSetting))] + public abstract partial class Setting { + private string settingTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Setting.Type")] + public string SettingType { + get { return this.settingTypeField; } + set { this.settingTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class TrackingSetting : Setting { + private string trackingUrlField; + + public string trackingUrl { + get { return this.trackingUrlField; } + set { this.trackingUrlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ShoppingSetting : Setting { + private long merchantIdField; + + private bool merchantIdFieldSpecified; + + private string salesCountryField; + + private int campaignPriorityField; + + private bool campaignPriorityFieldSpecified; + + public long merchantId { + get { return this.merchantIdField; } + set { + this.merchantIdField = value; + this.merchantIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool merchantIdSpecified { + get { return this.merchantIdFieldSpecified; } + set { this.merchantIdFieldSpecified = value; } + } + + public string salesCountry { + get { return this.salesCountryField; } + set { this.salesCountryField = value; } + } + + public int campaignPriority { + get { return this.campaignPriorityField; } + set { + this.campaignPriorityField = value; + this.campaignPrioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignPrioritySpecified { + get { return this.campaignPriorityFieldSpecified; } + set { this.campaignPriorityFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class RealTimeBiddingSetting : Setting { + private bool optInField; + + private bool optInFieldSpecified; + + public bool optIn { + get { return this.optInField; } + set { + this.optInField = value; + this.optInSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool optInSpecified { + get { return this.optInFieldSpecified; } + set { this.optInFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class KeywordMatchSetting : Setting { + private bool optInField; + + private bool optInFieldSpecified; + + public bool optIn { + get { return this.optInField; } + set { + this.optInField = value; + this.optInSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool optInSpecified { + get { return this.optInFieldSpecified; } + set { this.optInFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class GeoTargetTypeSetting : Setting { + private GeoTargetTypeSettingPositiveGeoTargetType positiveGeoTargetTypeField; + + private bool positiveGeoTargetTypeFieldSpecified; + + private GeoTargetTypeSettingNegativeGeoTargetType negativeGeoTargetTypeField; + + private bool negativeGeoTargetTypeFieldSpecified; + + public GeoTargetTypeSettingPositiveGeoTargetType positiveGeoTargetType { + get { return this.positiveGeoTargetTypeField; } + set { + this.positiveGeoTargetTypeField = value; + this.positiveGeoTargetTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool positiveGeoTargetTypeSpecified { + get { return this.positiveGeoTargetTypeFieldSpecified; } + set { this.positiveGeoTargetTypeFieldSpecified = value; } + } + + public GeoTargetTypeSettingNegativeGeoTargetType negativeGeoTargetType { + get { return this.negativeGeoTargetTypeField; } + set { + this.negativeGeoTargetTypeField = value; + this.negativeGeoTargetTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool negativeGeoTargetTypeSpecified { + get { return this.negativeGeoTargetTypeFieldSpecified; } + set { this.negativeGeoTargetTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GeoTargetTypeSetting.PositiveGeoTargetType", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum GeoTargetTypeSettingPositiveGeoTargetType { + DONT_CARE, + AREA_OF_INTEREST, + LOCATION_OF_PRESENCE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GeoTargetTypeSetting.NegativeGeoTargetType", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum GeoTargetTypeSettingNegativeGeoTargetType { + DONT_CARE, + LOCATION_OF_PRESENCE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class DynamicSearchAdsSetting : Setting { + private string domainNameField; + + private string languageCodeField; + + public string domainName { + get { return this.domainNameField; } + set { this.domainNameField = value; } + } + + public string languageCode { + get { return this.languageCodeField; } + set { this.languageCodeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AdvertisingChannelType { + UNKNOWN, + SEARCH, + DISPLAY, + SHOPPING + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class NetworkSetting { + private bool targetGoogleSearchField; + + private bool targetGoogleSearchFieldSpecified; + + private bool targetSearchNetworkField; + + private bool targetSearchNetworkFieldSpecified; + + private bool targetContentNetworkField; + + private bool targetContentNetworkFieldSpecified; + + private bool targetPartnerSearchNetworkField; + + private bool targetPartnerSearchNetworkFieldSpecified; + + public bool targetGoogleSearch { + get { return this.targetGoogleSearchField; } + set { + this.targetGoogleSearchField = value; + this.targetGoogleSearchSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetGoogleSearchSpecified { + get { return this.targetGoogleSearchFieldSpecified; } + set { this.targetGoogleSearchFieldSpecified = value; } + } + + public bool targetSearchNetwork { + get { return this.targetSearchNetworkField; } + set { + this.targetSearchNetworkField = value; + this.targetSearchNetworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetSearchNetworkSpecified { + get { return this.targetSearchNetworkFieldSpecified; } + set { this.targetSearchNetworkFieldSpecified = value; } + } + + public bool targetContentNetwork { + get { return this.targetContentNetworkField; } + set { + this.targetContentNetworkField = value; + this.targetContentNetworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetContentNetworkSpecified { + get { return this.targetContentNetworkFieldSpecified; } + set { this.targetContentNetworkFieldSpecified = value; } + } + + public bool targetPartnerSearchNetwork { + get { return this.targetPartnerSearchNetworkField; } + set { + this.targetPartnerSearchNetworkField = value; + this.targetPartnerSearchNetworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPartnerSearchNetworkSpecified { + get { return this.targetPartnerSearchNetworkFieldSpecified; } + set { this.targetPartnerSearchNetworkFieldSpecified = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TextLabel))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Label { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private LabelStatus statusField; + + private bool statusFieldSpecified; + + private string labelTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public LabelStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Label.Type")] + public string LabelType { + get { return this.labelTypeField; } + set { this.labelTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Label.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum LabelStatus { + ENABLED, + REMOVED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class TextLabel : Label { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class BiddingStrategyConfiguration { + private long biddingStrategyIdField; + + private bool biddingStrategyIdFieldSpecified; + + private string biddingStrategyNameField; + + private BiddingStrategyType biddingStrategyTypeField; + + private bool biddingStrategyTypeFieldSpecified; + + private BiddingStrategySource biddingStrategySourceField; + + private bool biddingStrategySourceFieldSpecified; + + private BiddingScheme biddingSchemeField; + + private Bids[] bidsField; + + public long biddingStrategyId { + get { return this.biddingStrategyIdField; } + set { + this.biddingStrategyIdField = value; + this.biddingStrategyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool biddingStrategyIdSpecified { + get { return this.biddingStrategyIdFieldSpecified; } + set { this.biddingStrategyIdFieldSpecified = value; } + } + + public string biddingStrategyName { + get { return this.biddingStrategyNameField; } + set { this.biddingStrategyNameField = value; } + } + + public BiddingStrategyType biddingStrategyType { + get { return this.biddingStrategyTypeField; } + set { + this.biddingStrategyTypeField = value; + this.biddingStrategyTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool biddingStrategyTypeSpecified { + get { return this.biddingStrategyTypeFieldSpecified; } + set { this.biddingStrategyTypeFieldSpecified = value; } + } + + public BiddingStrategySource biddingStrategySource { + get { return this.biddingStrategySourceField; } + set { + this.biddingStrategySourceField = value; + this.biddingStrategySourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool biddingStrategySourceSpecified { + get { return this.biddingStrategySourceFieldSpecified; } + set { this.biddingStrategySourceFieldSpecified = value; } + } + + public BiddingScheme biddingScheme { + get { return this.biddingSchemeField; } + set { this.biddingSchemeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("bids")] + public Bids[] bids { + get { return this.bidsField; } + set { this.bidsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum BiddingStrategyType { + BUDGET_OPTIMIZER, + CONVERSION_OPTIMIZER, + MANUAL_CPC, + MANUAL_CPM, + PAGE_ONE_PROMOTED, + PERCENT_CPA, + TARGET_SPEND, + ENHANCED_CPC, + TARGET_CPA, + TARGET_ROAS, + NONE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum BiddingStrategySource { + CAMPAIGN, + ADGROUP, + CRITERION + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BudgetOptimizerBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetSpendBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetRoasBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetCpaBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PageOnePromotedBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PercentCpaBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManualCpmBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManualCpcBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EnhancedCpcBiddingScheme))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConversionOptimizerBiddingScheme))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public abstract partial class BiddingScheme { + private string biddingSchemeTypeField; + + [System.Xml.Serialization.XmlElementAttribute("BiddingScheme.Type")] + public string BiddingSchemeType { + get { return this.biddingSchemeTypeField; } + set { this.biddingSchemeTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class BudgetOptimizerBiddingScheme : BiddingScheme { + private Money bidCeilingField; + + private bool enhancedCpcEnabledField; + + private bool enhancedCpcEnabledFieldSpecified; + + public Money bidCeiling { + get { return this.bidCeilingField; } + set { this.bidCeilingField = value; } + } + + public bool enhancedCpcEnabled { + get { return this.enhancedCpcEnabledField; } + set { + this.enhancedCpcEnabledField = value; + this.enhancedCpcEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool enhancedCpcEnabledSpecified { + get { return this.enhancedCpcEnabledFieldSpecified; } + set { this.enhancedCpcEnabledFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class TargetSpendBiddingScheme : BiddingScheme { + private Money bidCeilingField; + + private Money spendTargetField; + + public Money bidCeiling { + get { return this.bidCeilingField; } + set { this.bidCeilingField = value; } + } + + public Money spendTarget { + get { return this.spendTargetField; } + set { this.spendTargetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class TargetRoasBiddingScheme : BiddingScheme { + private double targetRoasField; + + private bool targetRoasFieldSpecified; + + private Money bidCeilingField; + + private Money bidFloorField; + + public double targetRoas { + get { return this.targetRoasField; } + set { + this.targetRoasField = value; + this.targetRoasSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetRoasSpecified { + get { return this.targetRoasFieldSpecified; } + set { this.targetRoasFieldSpecified = value; } + } + + public Money bidCeiling { + get { return this.bidCeilingField; } + set { this.bidCeilingField = value; } + } + + public Money bidFloor { + get { return this.bidFloorField; } + set { this.bidFloorField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class TargetCpaBiddingScheme : BiddingScheme { + private Money targetCpaField; + + private Money maxCpcBidCeilingField; + + private Money maxCpcBidFloorField; + + public Money targetCpa { + get { return this.targetCpaField; } + set { this.targetCpaField = value; } + } + + public Money maxCpcBidCeiling { + get { return this.maxCpcBidCeilingField; } + set { this.maxCpcBidCeilingField = value; } + } + + public Money maxCpcBidFloor { + get { return this.maxCpcBidFloorField; } + set { this.maxCpcBidFloorField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class PageOnePromotedBiddingScheme : BiddingScheme { + private PageOnePromotedBiddingSchemeStrategyGoal strategyGoalField; + + private bool strategyGoalFieldSpecified; + + private Money bidCeilingField; + + private double bidModifierField; + + private bool bidModifierFieldSpecified; + + private bool bidChangesForRaisesOnlyField; + + private bool bidChangesForRaisesOnlyFieldSpecified; + + private bool raiseBidWhenBudgetConstainedField; + + private bool raiseBidWhenBudgetConstainedFieldSpecified; + + private bool raiseBidWhenLowQualityScoreField; + + private bool raiseBidWhenLowQualityScoreFieldSpecified; + + public PageOnePromotedBiddingSchemeStrategyGoal strategyGoal { + get { return this.strategyGoalField; } + set { + this.strategyGoalField = value; + this.strategyGoalSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool strategyGoalSpecified { + get { return this.strategyGoalFieldSpecified; } + set { this.strategyGoalFieldSpecified = value; } + } + + public Money bidCeiling { + get { return this.bidCeilingField; } + set { this.bidCeilingField = value; } + } + + public double bidModifier { + get { return this.bidModifierField; } + set { + this.bidModifierField = value; + this.bidModifierSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidModifierSpecified { + get { return this.bidModifierFieldSpecified; } + set { this.bidModifierFieldSpecified = value; } + } + + public bool bidChangesForRaisesOnly { + get { return this.bidChangesForRaisesOnlyField; } + set { + this.bidChangesForRaisesOnlyField = value; + this.bidChangesForRaisesOnlySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidChangesForRaisesOnlySpecified { + get { return this.bidChangesForRaisesOnlyFieldSpecified; } + set { this.bidChangesForRaisesOnlyFieldSpecified = value; } + } + + public bool raiseBidWhenBudgetConstained { + get { return this.raiseBidWhenBudgetConstainedField; } + set { + this.raiseBidWhenBudgetConstainedField = value; + this.raiseBidWhenBudgetConstainedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool raiseBidWhenBudgetConstainedSpecified { + get { return this.raiseBidWhenBudgetConstainedFieldSpecified; } + set { this.raiseBidWhenBudgetConstainedFieldSpecified = value; } + } + + public bool raiseBidWhenLowQualityScore { + get { return this.raiseBidWhenLowQualityScoreField; } + set { + this.raiseBidWhenLowQualityScoreField = value; + this.raiseBidWhenLowQualityScoreSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool raiseBidWhenLowQualityScoreSpecified { + get { return this.raiseBidWhenLowQualityScoreFieldSpecified; } + set { this.raiseBidWhenLowQualityScoreFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PageOnePromotedBiddingScheme.StrategyGoal", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum PageOnePromotedBiddingSchemeStrategyGoal { + PAGE_ONE, + PAGE_ONE_PROMOTED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class PercentCpaBiddingScheme : BiddingScheme { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ManualCpmBiddingScheme : BiddingScheme { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ManualCpcBiddingScheme : BiddingScheme { + private bool enhancedCpcEnabledField; + + private bool enhancedCpcEnabledFieldSpecified; + + public bool enhancedCpcEnabled { + get { return this.enhancedCpcEnabledField; } + set { + this.enhancedCpcEnabledField = value; + this.enhancedCpcEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool enhancedCpcEnabledSpecified { + get { return this.enhancedCpcEnabledFieldSpecified; } + set { this.enhancedCpcEnabledFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class EnhancedCpcBiddingScheme : BiddingScheme { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ConversionOptimizerBiddingScheme : BiddingScheme { + private ConversionOptimizerBiddingSchemePricingMode pricingModeField; + + private bool pricingModeFieldSpecified; + + private ConversionOptimizerBiddingSchemeBidType bidTypeField; + + private bool bidTypeFieldSpecified; + + public ConversionOptimizerBiddingSchemePricingMode pricingMode { + get { return this.pricingModeField; } + set { + this.pricingModeField = value; + this.pricingModeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool pricingModeSpecified { + get { return this.pricingModeFieldSpecified; } + set { this.pricingModeFieldSpecified = value; } + } + + public ConversionOptimizerBiddingSchemeBidType bidType { + get { return this.bidTypeField; } + set { + this.bidTypeField = value; + this.bidTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidTypeSpecified { + get { return this.bidTypeFieldSpecified; } + set { this.bidTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConversionOptimizerBiddingScheme.PricingMode", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ConversionOptimizerBiddingSchemePricingMode { + CLICKS, + CONVERSIONS + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConversionOptimizerBiddingScheme.BidType", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ConversionOptimizerBiddingSchemeBidType { + TARGET_CPA + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CpmBid))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CpcBid))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CpaBid))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PercentCpaBid))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public abstract partial class Bids { + private string bidsTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Bids.Type")] + public string BidsType { + get { return this.bidsTypeField; } + set { this.bidsTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CpmBid : Bids { + private Money bidField; + + private BidSource cpmBidSourceField; + + private bool cpmBidSourceFieldSpecified; + + public Money bid { + get { return this.bidField; } + set { this.bidField = value; } + } + + public BidSource cpmBidSource { + get { return this.cpmBidSourceField; } + set { + this.cpmBidSourceField = value; + this.cpmBidSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool cpmBidSourceSpecified { + get { return this.cpmBidSourceFieldSpecified; } + set { this.cpmBidSourceFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum BidSource { + ADGROUP, + CRITERION + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CpcBid : Bids { + private Money bidField; + + private BidSource cpcBidSourceField; + + private bool cpcBidSourceFieldSpecified; + + public Money bid { + get { return this.bidField; } + set { this.bidField = value; } + } + + public BidSource cpcBidSource { + get { return this.cpcBidSourceField; } + set { + this.cpcBidSourceField = value; + this.cpcBidSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool cpcBidSourceSpecified { + get { return this.cpcBidSourceFieldSpecified; } + set { this.cpcBidSourceFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CpaBid : Bids { + private Money bidField; + + public Money bid { + get { return this.bidField; } + set { this.bidField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class PercentCpaBid : Bids { + private int bidField; + + private bool bidFieldSpecified; + + private BidSource percentCpaBidSourceField; + + private bool percentCpaBidSourceFieldSpecified; + + public int bid { + get { return this.bidField; } + set { + this.bidField = value; + this.bidSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidSpecified { + get { return this.bidFieldSpecified; } + set { this.bidFieldSpecified = value; } + } + + public BidSource percentCpaBidSource { + get { return this.percentCpaBidSourceField; } + set { + this.percentCpaBidSourceField = value; + this.percentCpaBidSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool percentCpaBidSourceSpecified { + get { return this.percentCpaBidSourceFieldSpecified; } + set { this.percentCpaBidSourceFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CustomParameters { + private CustomParameter[] parametersField; + + private bool doReplaceField; + + private bool doReplaceFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("parameters")] + public CustomParameter[] parameters { + get { return this.parametersField; } + set { this.parametersField = value; } + } + + public bool doReplace { + get { return this.doReplaceField; } + set { + this.doReplaceField = value; + this.doReplaceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool doReplaceSpecified { + get { return this.doReplaceFieldSpecified; } + set { this.doReplaceFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CustomParameter { + private string keyField; + + private string valueField; + + private bool isRemoveField; + + private bool isRemoveFieldSpecified; + + public string key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + + public bool isRemove { + get { return this.isRemoveField; } + set { + this.isRemoveField = value; + this.isRemoveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isRemoveSpecified { + get { return this.isRemoveFieldSpecified; } + set { this.isRemoveFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignLabelReturnValue : ListReturnValue { + private CampaignLabel[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public CampaignLabel[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignLabel { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private long labelIdField; + + private bool labelIdFieldSpecified; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignOperation : Operation { + private Campaign operandField; + + public Campaign operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignLabelOperation : Operation { + private CampaignLabel operandField; + + public CampaignLabel operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignPage : Page { + private Campaign[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Campaign[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class UrlError : ApiError { + private UrlErrorReason reasonField; + + private bool reasonFieldSpecified; + + public UrlErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "UrlError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum UrlErrorReason { + INVALID_URL, + INVALID_TAG_IN_URL, + MISSING_URL_TAG, + INVALID_TRACKING_URL_TEMPLATE, + INVALID_TAG_IN_TRACKING_URL_TEMPLATE, + MISSING_TRACKING_URL_TEMPLATE_TAG, + INVALID_FINAL_URL, + INVALID_TAG_IN_FINAL_URL, + INVALID_FINAL_MOBILE_URL, + INVALID_TAG_IN_FINAL_MOBILE_URL, + URL_CUSTOM_PARAMETERS_COUNT_EXCEEDS_LIMIT, + URL_CUSTOM_PARAMETER_REMOVAL_WITH_NON_NULL_VALUE, + CANNOT_REMOVE_URL_CUSTOM_PARAMETER_IN_ADD_OPERATION, + INVALID_CHARACTERS_IN_URL_CUSTOM_PARAMETER_KEY, + INVALID_CHARACTERS_IN_URL_CUSTOM_PARAMETER_VALUE, + INVALID_TAG_IN_URL_CUSTOM_PARAMETER_VALUE, + URL_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class TargetError : ApiError { + private TargetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TargetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TargetError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum TargetErrorReason { + AD_SCHEDULE_ADVANCED_INCOMPATIBLE_WITH_CONVERSION_OPTIMIZER, + AD_SCHEDULE_BID_MULTIPLIER_MALFORMED, + AD_SCHEDULE_BID_MULTIPLIER_TOO_BIG, + AD_SCHEDULE_BID_MULTIPLIER_TOO_SMALL, + AD_SCHEDULE_BID_MULTIPLIER_TOO_MANY_FRACTION_DIGITS, + AD_SCHEDULE_EXCEEDED_INTERVALS_PER_DAY_LIMIT, + AD_SCHEDULE_EXCEEDS_PAST_END_OF_WEEK, + AD_SCHEDULE_INCOMPATIBILITY, + AD_SCHEDULE_INCOMPATIBLE_WITH_BUDGET_OPTIMIZER, + AD_SCHEDULE_INTERVAL_CANNOT_SPAN_MULTIPLE_DAYS, + AD_SCHEDULE_INVALID_DAY_OF_THE_WEEK, + AD_SCHEDULE_INVALID_TIME_INTERVAL, + AD_SCHEDULE_NO_INTERVALS_WHILE_ENABLED, + AD_SCHEDULE_NOT_MULTIPLE_OF_15_MINUTES, + AD_SCHEDULE_TIME_INTERVALS_OVERLAP, + CANNOT_EXCLUDE_CITY, + CANNOT_EXCLUDE_IF_NOT_TARGETED, + CANNOT_EXCLUDE_METRO, + CANNOT_EXCLUDE_PROVINCE, + CANNOT_OPT_OUT_GOOGLE_SEARCH_WHILE_BID_TO_POSITION_ENABLE, + CANNOT_TARGET_AGE_WITHOUT_GENDER, + CANNOT_TARGET_CITY, + CANNOT_TARGET_CONTENT_CONTEXTUAL_WITHOUT_CONTENT_NETWORK, + CANNOT_MODIFY_CONTENT_CONTEXTUAL, + CANNOT_TARGET_COUNTRY, + CANNOT_TARGET_COVERAGE, + CANNOT_TARGET_GENDER_WITHOUT_AGE, + CANNOT_TARGET_GOOGLE_SEARCH_FOR_CPM_CAMPAIGN, + CANNOT_CHANGE_GOOGLE_SEARCH_SETTING, + CANNOT_TARGET_LANGUAGE, + CANNOT_TARGET_METRO, + CANNOT_TARGET_MOBILE_CARRIER, + CANNOT_TARGET_PROVINCE, + CANNOT_TARGET_SEARCH_SYNDICATION_WITHOUT_GOOGLE_SEARCH, + CANNOT_TARGET_SYNDICATABLE_TYPES, + CANNOT_TARGET_THE_SAME_TARGET_LIST_TYPE_MULTIPLE_TIMES, + DEMOGRAPHIC_BID_MODIFIER_SHOULD_BE_IN_BETWEEN_0_AND_500, + INVALID_CITY_CODE, + INVALID_CITYNAME_LENGTH, + INVALID_EXCLUDED_POLYGON_TARGET, + INVALID_EXCLUDED_PROXIMITY_TARGET, + INVALID_LANGUAGE_CODE, + INVALID_LATITUDE, + INVALID_LONGITUDE, + INVALID_METRO_CODE, + INVALID_MOBILE_CARRIER, + INVALID_MOBILE_PLATFORM, + INVALID_POSTALCODE_LENGTH, + INVALID_PROVINCE_CODE, + INVALID_PROXIMITY_RADIUS, + INVALID_REGIONCODE_LENGTH, + INVALID_REGIONNAME_LENGTH, + INVALID_STREETADDRESS_LENGTH, + MULTIPLE_OCCURRENCES_OF_SAME_TARGET, + POLYGON_DUPLICATE_VERTICES, + POLYGON_EDGES_INTERSECT, + POLYGON_TOO_FEW_VERTICES, + POLYGON_TOO_MANY_VERTICES, + POLYGON_TOO_LARGE, + TARGETING_VALIDATION_FAILED, + TARGETING_CROSS_COUNTRY_REGIONAL, + TARGETING_EXCLUSION_NOT_SUPPORTED, + TARGETING_INCOMPATIBLE_LOCATION_TYPES, + TARGETING_NOT_SUPPORTED, + TARGETING_TOO_MANY_REGIONS, + TOO_MANY_EXCLUDED_LOCATIONS, + TOO_MANY_TARGETED_LOCATIONS, + WARNING_MAY_NOW_REQUIRE_CHINESE_APPROVAL, + WARNING_NOW_REQUIRES_CHINESE_APPROVAL, + WARNING_NOW_TARGETS_CHINA, + WARNING_NOW_TARGETS_CHINESE, + TARGET_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class StatsQueryError : ApiError { + private StatsQueryErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StatsQueryErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StatsQueryError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum StatsQueryErrorReason { + DATE_NOT_IN_VALID_RANGE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class SettingError : ApiError { + private SettingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SettingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SettingError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum SettingErrorReason { + DUPLICATE_SETTING_TYPE, + SETTING_TYPE_IS_NOT_AVAILABLE, + SETTING_TYPE_IS_NOT_COMPATIBLE_WITH_CAMPAIGN, + TARGETING_SETTING_CONTAINS_INVALID_CRITERION_TYPE_GROUP, + DYNAMIC_SEARCH_ADS_SETTING_CONTAINS_INVALID_DOMAIN_NAME, + DYNAMIC_SEARCH_ADS_SETTING_CONTAINS_INVALID_LANGUAGE_CODE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class QuotaError : ApiError { + private QuotaErrorReason reasonField; + + private bool reasonFieldSpecified; + + private int limitField; + + private bool limitFieldSpecified; + + public QuotaErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + public int limit { + get { return this.limitField; } + set { + this.limitField = value; + this.limitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool limitSpecified { + get { return this.limitFieldSpecified; } + set { this.limitFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "QuotaError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum QuotaErrorReason { + TOO_MANY_ADGROUPS_PER_CAMPAIGN, + TOO_MANY_CAMPAIGNS_PER_ACCOUNT, + TOO_MANY_CONVERSION_TYPES_PER_ACCOUNT, + TOO_MANY_KEYWORDS_PER_ADGROUP, + TOO_MANY_KEYWORDS_PER_CAMPAIGN, + TOO_MANY_KEYWORDS_PER_CUSTOMER, + TOO_MANY_SITES_PER_ADGROUP, + TOO_MANY_SITES_PER_CAMPAIGN, + TOO_MANY_CRITERIA_PER_ACCOUNT, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ForwardCompatibilityError : ApiError { + private ForwardCompatibilityErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ForwardCompatibilityErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ForwardCompatibilityError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ForwardCompatibilityErrorReason { + INVALID_FORWARD_COMPATIBILITY_MAP_VALUE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignError : ApiError { + private CampaignErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CampaignErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum CampaignErrorReason { + CANNOT_GO_BACK_TO_INCOMPLETE, + CANNOT_SET_END_DATE_BEFORE_EXPERIMENT_END_DATE, + DUPLICATE_CAMPAIGN_NAME, + INCOMPATIBLE_CAMPAIGN_FIELD, + INVALID_CAMPAIGN_NAME, + INVALID_AD_SERVING_OPTIMIZATION_STATUS, + INVALID_TRACKING_URL, + MAX_IMPRESSIONS_NOT_IN_RANGE, + TIME_UNIT_NOT_SUPPORTED, + INVALID_OPERATION_IF_SERVING_STATUS_HAS_ENDED, + BUDGET_CANNOT_BE_SHARED, + CANNOT_SET_BUDGET, + CAMPAIGN_CANNOT_USE_SHARED_BUDGET, + CAMPAIGN_LABEL_DOES_NOT_EXIST, + CAMPAIGN_LABEL_ALREADY_EXISTS, + MUST_SPECIFY_KEYWORD_MATCH_SETTINGS, + MISSING_SHOPPING_SETTING, + INVALID_SHOPPING_SALES_COUNTRY, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class BiddingTransitionError : ApiError { + private BiddingTransitionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BiddingTransitionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BiddingTransitionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum BiddingTransitionErrorReason { + BID_TO_POSITION_ENABLED, + BIDDING_STRATEGY_NOT_AVAILABLE_FOR_ACCOUNT_TYPE, + BUDGET_OPTIMIZER_IS_ENABLED, + CONVERSION_OPTIMIZER_IS_ENABLED, + CONVERSION_TRACKING_NOT_ENABLED, + CONVERSION_TRACKING_NOT_AVAILABLE_FOR_ACCOUNT_TYPE, + USE_POSITION_PREFERENCE_IN_MANUALCPC_INSTEAD_TO_DISABLE_POSITION_PREFERENCE, + INVALID_BID, + CANNOT_SET_EXPLICIT_BID, + EXPLICIT_BID_REQUIRED_FOR_TRANSITION, + EXPLICIT_BID_TYPE_DOES_NOT_MATCH_CAMPAIGN_BIDDING_STRATEGY, + MISSING_REQUIRED_BID, + INVALID_STATUS, + IS_CPM_CAMPAIGN, + IS_PERCENT_CPA_CAMPAIGN, + NOT_THE_PREVIOUS_BIDDING_STRATEGY, + NOT_ENOUGH_CONVERSION_DATA, + NOT_ENOUGH_CONVERSIONS, + OPTED_IN_SEARCH, + PROXY_BIDDING_ON, + SITE_REMNANT_RESERVATION_ALLOWED, + TRANSITION_TO_ITSELF, + UNKNOWN_BIDDING_STRATEGY, + UNSUPPORTED_TRANSITION, + VCG_ENABLED, + BIDDING_TRANSITION_FAILED, + ACCELERATED_DELIVERY_NOT_SUPPORTED_FOR_BUDGET_OPTIMIZER, + HAS_ACTIVE_EXPERIMENT, + INCOMPATIBLE_WITH_CAMPAIGN_SETTING + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class BiddingErrors : ApiError { + private BiddingErrorsReason reasonField; + + private bool reasonFieldSpecified; + + public BiddingErrorsReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BiddingErrors.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum BiddingErrorsReason { + BIDDING_STRATEGY_TRANSITION_NOT_ALLOWED, + BIDDING_STRATEGY_NOT_COMPATIBLE_WITH_ADGROUP_OVERRIDES, + BIDDING_STRATEGY_NOT_COMPATIBLE_WITH_ADGROUP_CRITERIA_OVERRIDES, + CAMPAIGN_BIDDING_STRATEGY_CANNOT_BE_OVERRIDDEN, + ADGROUP_BIDDING_STRATEGY_CANNOT_BE_OVERRIDDEN, + CANNOT_ATTACH_BIDDING_STRATEGY_TO_CAMPAIGN, + CANNOT_ATTACH_BIDDING_STRATEGY_TO_ADGROUP, + CANNOT_ATTACH_BIDDING_STRATEGY_TO_ADGROUP_CRITERIA, + PERCENT_CPA_NOT_AVAILABLE_FOR_CUSTOMER, + INVALID_ANONYMOUS_BIDDING_STRATEGY_TYPE, + BIDS_NOT_ALLLOWED, + DUPLICATE_BIDS, + INVALID_BIDDING_SCHEME, + INVALID_BIDDING_STRATEGY_TYPE, + MISSING_BIDDING_STRATEGY_TYPE, + NULL_BID, + INVALID_BID, + BIDDING_STRATEGY_NOT_AVAILABLE_FOR_ACCOUNT_TYPE, + CONVERSION_TRACKING_NOT_ENABLED, + NOT_ENOUGH_CONVERSIONS, + CANNOT_CREATE_CAMPAIGN_WITH_CONVERSION_OPTIMIZER, + CANNOT_ATTACH_POP_BIDDING_STRATEGY_FOR_CONTENT_NETWORK_ONLY_CAMPAIGN, + CANNOT_TARGET_CONTENT_NETWORK_ONLY_WITH_AD_GROUP_LEVEL_POP_BIDDING_STRATEGY, + CANNOT_TARGET_CONTENT_NETWORK_ONLY_WITH_CAMPAIGN_LEVEL_POP_BIDDING_STRATEGY, + BIDDING_STRATEGY_NOT_SUPPORTED_WITH_AD_SCHEDULE, + PAY_PER_CONVERSION_NOT_AVAILABLE_FOR_CUSTOMER, + PAY_PER_CONVERSION_NOT_ALLOWED_WITH_TARGET_CPA, + BIDDING_STRATEGY_NOT_ALLOWED_FOR_SEARCH_ONLY_CAMPAIGNS, + BIDDING_STRATEGY_NOT_SUPPORTED_FOR_CAMPAIGNS_WITH_EXPERIMENTS, + CANNOT_CHANGE_BIDDING_STRATEGY_IN_CAMPAIGN_WITH_EXPERIMENT, + BIDDING_STRATEGY_TYPE_DOES_NOT_SUPPORT_PRODUCT_TYPE_ADGROUP_CRITERION, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class BiddingError : ApiError { + private BiddingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BiddingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BiddingError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum BiddingErrorReason { + BID_AMOUNT_REQUIRED, + BID_TOO_SMALL, + BID_TOO_BIG, + BID_TOO_MANY_FRACTIONAL_DIGITS, + NON_POSITIVE_BID, + BID_TOO_HIGH_FOR_DAILY_BUDGET, + BID_TOO_HIGH_FOR_MONTHLY_BUDGET, + MUST_EXCLUDE_0_TO_17_WITH_OTHER_AGE_EXCLUSIONS, + CAMPAIGN_MUST_HAVE_A_BUDGET_TO_ENABLE_BUDGET_OPTIMIZER, + CANNOT_SET_CONTENT_BID_WITHOUT_SETTING_KEYWORD_MAX_CPC_AS_WELL, + CANNOT_CREATE_CAMPAIGN_WITH_CONVERSION_OPTIMIZER, + PAY_PER_CONVERSION_NOT_AVAILABLE_FOR_CUSTOMER, + PAY_PER_CONVERSION_NOT_ALLOWED_WITH_TARGET_CPA, + PAY_PER_CONVERSION_NOT_ALLOWED_WITH_MANY_PER_CLICK, + TARGET_CPA_NOT_AVAILABLE_FOR_CUSTOMER, + MANY_PER_CLICK_NOT_AVAILABLE_FOR_CUSTOMER, + CANNOT_SET_SITE_MAX_CPC, + BID_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CampaignFeedServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CampaignFeedService : AdWordsSoapClient, ICampaignFeedService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CampaignFeedService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/CampaignFeedService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignFeedPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((CampaignFeedPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignFeedReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +CampaignFeedOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((CampaignFeedReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignFeedPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((CampaignFeedPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignFeedReturnValue : ListReturnValue { + private CampaignFeed[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public CampaignFeed[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignFeed { + private long feedIdField; + + private bool feedIdFieldSpecified; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private Function matchingFunctionField; + + private int[] placeholderTypesField; + + private CampaignFeedStatus statusField; + + private bool statusFieldSpecified; + + public long feedId { + get { return this.feedIdField; } + set { + this.feedIdField = value; + this.feedIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedIdSpecified { + get { return this.feedIdFieldSpecified; } + set { this.feedIdFieldSpecified = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public Function matchingFunction { + get { return this.matchingFunctionField; } + set { this.matchingFunctionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("placeholderTypes")] + public int[] placeholderTypes { + get { return this.placeholderTypesField; } + set { this.placeholderTypesField = value; } + } + + public CampaignFeedStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class RequestContextOperand : FunctionArgumentOperand { + private RequestContextOperandContextType contextTypeField; + + private bool contextTypeFieldSpecified; + + public RequestContextOperandContextType contextType { + get { return this.contextTypeField; } + set { + this.contextTypeField = value; + this.contextTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contextTypeSpecified { + get { return this.contextTypeFieldSpecified; } + set { this.contextTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequestContextOperand.ContextType", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum RequestContextOperandContextType { + FEED_ITEM_ID, + DEVICE_PLATFORM, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FunctionOperand : FunctionArgumentOperand { + private Function valueField; + + public Function value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedAttributeOperand : FunctionArgumentOperand { + private long feedIdField; + + private bool feedIdFieldSpecified; + + private long feedAttributeIdField; + + private bool feedAttributeIdFieldSpecified; + + public long feedId { + get { return this.feedIdField; } + set { + this.feedIdField = value; + this.feedIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedIdSpecified { + get { return this.feedIdFieldSpecified; } + set { this.feedIdFieldSpecified = value; } + } + + public long feedAttributeId { + get { return this.feedAttributeIdField; } + set { + this.feedAttributeIdField = value; + this.feedAttributeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedAttributeIdSpecified { + get { return this.feedAttributeIdFieldSpecified; } + set { this.feedAttributeIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignFeed.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum CampaignFeedStatus { + ENABLED, + REMOVED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignFeedOperation : Operation { + private CampaignFeed operandField; + + public CampaignFeed operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignFeedPage))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomerFeedPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedItemPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeedMappingPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupFeedPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignSharedSetPage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedSetPage))] + public abstract partial class NullStatsPage : Page { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignFeedPage : NullStatsPage { + private CampaignFeed[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public CampaignFeed[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CollectionSizeError : ApiError { + private CollectionSizeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CollectionSizeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CollectionSizeError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum CollectionSizeErrorReason { + TOO_FEW, + TOO_MANY + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignFeedError : ApiError { + private CampaignFeedErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CampaignFeedErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignFeedError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum CampaignFeedErrorReason { + FEED_ALREADY_EXISTS_FOR_PLACEHOLDER_TYPE, + INVALID_ID, + CANNOT_ADD_ALREADY_EXISTING_CAMPAIGN_FEED, + CANNOT_OPERATE_ON_REMOVED_CAMPAIGN_FEED, + INVALID_PLACEHOLDER_TYPES, + MISSING_FEEDMAPPING_FOR_PLACEHOLDER_TYPE, + NO_EXISTING_LOCATION_CUSTOMER_FEED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ConstantDataServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductDimension))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConstantData))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Criterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ConstantDataService : AdWordsSoapClient, IConstantDataService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ConstantDataService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/ConstantDataService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AgeRange[] getAgeRangeCriterion() { + object[] results = this.Invoke("getAgeRangeCriterion", new object[0]); + return ((AgeRange[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Carrier[] getCarrierCriterion() { + object[] results = this.Invoke("getCarrierCriterion", new object[0]); + return ((Carrier[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Gender[] getGenderCriterion() { + object[] results = this.Invoke("getGenderCriterion", new object[0]); + return ((Gender[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Language[] getLanguageCriterion() { + object[] results = this.Invoke("getLanguageCriterion", new object[0]); + return ((Language[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual MobileDevice[] getMobileDeviceCriterion() { + object[] results = this.Invoke("getMobileDeviceCriterion", new object[0]); + return ((MobileDevice[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual OperatingSystemVersion[] getOperatingSystemVersionCriterion() { + object[] results = this.Invoke("getOperatingSystemVersionCriterion", new object[0]); + return ((OperatingSystemVersion[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductBiddingCategoryData[] getProductBiddingCategoryData(Selector selector) { + object[] results = this.Invoke("getProductBiddingCategoryData", new object[] { selector }); + return ((ProductBiddingCategoryData[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CriterionUserInterest[] getUserInterestCriterion(ConstantDataServiceUserInterestTaxonomyType userInterestTaxonomyType, [System.Xml.Serialization.XmlIgnoreAttribute()] +bool userInterestTaxonomyTypeSpecified) { + object[] results = this.Invoke("getUserInterestCriterion", new object[] { userInterestTaxonomyType, userInterestTaxonomyTypeSpecified }); + return ((CriterionUserInterest[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Vertical[] getVerticalCriterion() { + object[] results = this.Invoke("getVerticalCriterion", new object[0]); + return ((Vertical[]) (results[0])); + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductBiddingCategoryData))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ConstantData { + private string constantDataTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ConstantData.Type")] + public string ConstantDataType { + get { return this.constantDataTypeField; } + set { this.constantDataTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ProductBiddingCategoryData : ConstantData { + private ProductBiddingCategory dimensionValueField; + + private ProductBiddingCategory parentDimensionValueField; + + private string countryField; + + private String_StringMapEntry[] displayValueField; + + public ProductBiddingCategory dimensionValue { + get { return this.dimensionValueField; } + set { this.dimensionValueField = value; } + } + + public ProductBiddingCategory parentDimensionValue { + get { return this.parentDimensionValueField; } + set { this.parentDimensionValueField = value; } + } + + public string country { + get { return this.countryField; } + set { this.countryField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("displayValue")] + public String_StringMapEntry[] displayValue { + get { return this.displayValueField; } + set { this.displayValueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConstantDataService.UserInterestTaxonomyType", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ConstantDataServiceUserInterestTaxonomyType { + BRAND, + IN_MARKET, + VERTICAL_GEO + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ConversionTrackerServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ConversionTrackerService : AdWordsSoapClient, IConversionTrackerService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ConversionTrackerService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/ConversionTrackerService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ConversionTrackerPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((ConversionTrackerPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ConversionTrackerReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +ConversionTrackerOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((ConversionTrackerReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ConversionTrackerReturnValue : ListReturnValue { + private ConversionTracker[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public ConversionTracker[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UploadConversion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AppConversion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdWordsConversionTracker))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdCallMetricsConversion))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public abstract partial class ConversionTracker { + private long idField; + + private bool idFieldSpecified; + + private long originalConversionTypeIdField; + + private bool originalConversionTypeIdFieldSpecified; + + private string nameField; + + private ConversionTrackerStatus statusField; + + private bool statusFieldSpecified; + + private ConversionTrackerCategory categoryField; + + private bool categoryFieldSpecified; + + private ConversionTrackerStats statsField; + + private int viewthroughLookbackWindowField; + + private bool viewthroughLookbackWindowFieldSpecified; + + private bool isProductAdsChargeableField; + + private bool isProductAdsChargeableFieldSpecified; + + private int productAdsChargeableConversionWindowField; + + private bool productAdsChargeableConversionWindowFieldSpecified; + + private int ctcLookbackWindowField; + + private bool ctcLookbackWindowFieldSpecified; + + private ConversionDeduplicationMode countingTypeField; + + private bool countingTypeFieldSpecified; + + private double defaultRevenueValueField; + + private bool defaultRevenueValueFieldSpecified; + + private bool alwaysUseDefaultRevenueValueField; + + private bool alwaysUseDefaultRevenueValueFieldSpecified; + + private string conversionTrackerTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long originalConversionTypeId { + get { return this.originalConversionTypeIdField; } + set { + this.originalConversionTypeIdField = value; + this.originalConversionTypeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool originalConversionTypeIdSpecified { + get { return this.originalConversionTypeIdFieldSpecified; } + set { this.originalConversionTypeIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ConversionTrackerStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ConversionTrackerCategory category { + get { return this.categoryField; } + set { + this.categoryField = value; + this.categorySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool categorySpecified { + get { return this.categoryFieldSpecified; } + set { this.categoryFieldSpecified = value; } + } + + public ConversionTrackerStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public int viewthroughLookbackWindow { + get { return this.viewthroughLookbackWindowField; } + set { + this.viewthroughLookbackWindowField = value; + this.viewthroughLookbackWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool viewthroughLookbackWindowSpecified { + get { return this.viewthroughLookbackWindowFieldSpecified; } + set { this.viewthroughLookbackWindowFieldSpecified = value; } + } + + public bool isProductAdsChargeable { + get { return this.isProductAdsChargeableField; } + set { + this.isProductAdsChargeableField = value; + this.isProductAdsChargeableSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isProductAdsChargeableSpecified { + get { return this.isProductAdsChargeableFieldSpecified; } + set { this.isProductAdsChargeableFieldSpecified = value; } + } + + public int productAdsChargeableConversionWindow { + get { return this.productAdsChargeableConversionWindowField; } + set { + this.productAdsChargeableConversionWindowField = value; + this.productAdsChargeableConversionWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productAdsChargeableConversionWindowSpecified { + get { return this.productAdsChargeableConversionWindowFieldSpecified; } + set { this.productAdsChargeableConversionWindowFieldSpecified = value; } + } + + public int ctcLookbackWindow { + get { return this.ctcLookbackWindowField; } + set { + this.ctcLookbackWindowField = value; + this.ctcLookbackWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ctcLookbackWindowSpecified { + get { return this.ctcLookbackWindowFieldSpecified; } + set { this.ctcLookbackWindowFieldSpecified = value; } + } + + public ConversionDeduplicationMode countingType { + get { return this.countingTypeField; } + set { + this.countingTypeField = value; + this.countingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool countingTypeSpecified { + get { return this.countingTypeFieldSpecified; } + set { this.countingTypeFieldSpecified = value; } + } + + public double defaultRevenueValue { + get { return this.defaultRevenueValueField; } + set { + this.defaultRevenueValueField = value; + this.defaultRevenueValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool defaultRevenueValueSpecified { + get { return this.defaultRevenueValueFieldSpecified; } + set { this.defaultRevenueValueFieldSpecified = value; } + } + + public bool alwaysUseDefaultRevenueValue { + get { return this.alwaysUseDefaultRevenueValueField; } + set { + this.alwaysUseDefaultRevenueValueField = value; + this.alwaysUseDefaultRevenueValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool alwaysUseDefaultRevenueValueSpecified { + get { return this.alwaysUseDefaultRevenueValueFieldSpecified; } + set { this.alwaysUseDefaultRevenueValueFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ConversionTracker.Type")] + public string ConversionTrackerType { + get { return this.conversionTrackerTypeField; } + set { this.conversionTrackerTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConversionTracker.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ConversionTrackerStatus { + ENABLED, + DISABLED, + HIDDEN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConversionTracker.Category", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ConversionTrackerCategory { + DEFAULT, + PAGE_VIEW, + PURCHASE, + SIGNUP, + LEAD, + REMARKETING, + DOWNLOAD + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ConversionTrackerStats { + private int numConversionEventsField; + + private bool numConversionEventsFieldSpecified; + + private Money conversionValueField; + + private string mostRecentConversionDateField; + + private int numConvertedClicksField; + + private bool numConvertedClicksFieldSpecified; + + public int numConversionEvents { + get { return this.numConversionEventsField; } + set { + this.numConversionEventsField = value; + this.numConversionEventsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numConversionEventsSpecified { + get { return this.numConversionEventsFieldSpecified; } + set { this.numConversionEventsFieldSpecified = value; } + } + + public Money conversionValue { + get { return this.conversionValueField; } + set { this.conversionValueField = value; } + } + + public string mostRecentConversionDate { + get { return this.mostRecentConversionDateField; } + set { this.mostRecentConversionDateField = value; } + } + + public int numConvertedClicks { + get { return this.numConvertedClicksField; } + set { + this.numConvertedClicksField = value; + this.numConvertedClicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numConvertedClicksSpecified { + get { return this.numConvertedClicksFieldSpecified; } + set { this.numConvertedClicksFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ConversionDeduplicationMode { + ONE_PER_CLICK, + MANY_PER_CLICK + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class UploadConversion : ConversionTracker { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AppConversion : ConversionTracker { + private string appIdField; + + private AppConversionAppPlatform appPlatformField; + + private bool appPlatformFieldSpecified; + + private string snippetField; + + private AppConversionAppConversionType appConversionTypeField; + + private bool appConversionTypeFieldSpecified; + + private string appPostbackUrlField; + + public string appId { + get { return this.appIdField; } + set { this.appIdField = value; } + } + + public AppConversionAppPlatform appPlatform { + get { return this.appPlatformField; } + set { + this.appPlatformField = value; + this.appPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool appPlatformSpecified { + get { return this.appPlatformFieldSpecified; } + set { this.appPlatformFieldSpecified = value; } + } + + public string snippet { + get { return this.snippetField; } + set { this.snippetField = value; } + } + + public AppConversionAppConversionType appConversionType { + get { return this.appConversionTypeField; } + set { + this.appConversionTypeField = value; + this.appConversionTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool appConversionTypeSpecified { + get { return this.appConversionTypeFieldSpecified; } + set { this.appConversionTypeFieldSpecified = value; } + } + + public string appPostbackUrl { + get { return this.appPostbackUrlField; } + set { this.appPostbackUrlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AppConversion.AppPlatform", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AppConversionAppPlatform { + NONE, + ITUNES, + ANDROID_MARKET, + MOBILE_APP_CHANNEL + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AppConversion.AppConversionType", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AppConversionAppConversionType { + NONE, + DOWNLOAD, + IN_APP_PURCHASE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdWordsConversionTracker : ConversionTracker { + private string snippetField; + + private AdWordsConversionTrackerMarkupLanguage markupLanguageField; + + private bool markupLanguageFieldSpecified; + + private AdWordsConversionTrackerTextFormat textFormatField; + + private bool textFormatFieldSpecified; + + private string conversionPageLanguageField; + + private string backgroundColorField; + + private AdWordsConversionTrackerTrackingCodeType trackingCodeTypeField; + + private bool trackingCodeTypeFieldSpecified; + + public string snippet { + get { return this.snippetField; } + set { this.snippetField = value; } + } + + public AdWordsConversionTrackerMarkupLanguage markupLanguage { + get { return this.markupLanguageField; } + set { + this.markupLanguageField = value; + this.markupLanguageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool markupLanguageSpecified { + get { return this.markupLanguageFieldSpecified; } + set { this.markupLanguageFieldSpecified = value; } + } + + public AdWordsConversionTrackerTextFormat textFormat { + get { return this.textFormatField; } + set { + this.textFormatField = value; + this.textFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool textFormatSpecified { + get { return this.textFormatFieldSpecified; } + set { this.textFormatFieldSpecified = value; } + } + + public string conversionPageLanguage { + get { return this.conversionPageLanguageField; } + set { this.conversionPageLanguageField = value; } + } + + public string backgroundColor { + get { return this.backgroundColorField; } + set { this.backgroundColorField = value; } + } + + public AdWordsConversionTrackerTrackingCodeType trackingCodeType { + get { return this.trackingCodeTypeField; } + set { + this.trackingCodeTypeField = value; + this.trackingCodeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool trackingCodeTypeSpecified { + get { return this.trackingCodeTypeFieldSpecified; } + set { this.trackingCodeTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdWordsConversionTracker.MarkupLanguage", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AdWordsConversionTrackerMarkupLanguage { + HTML, + CHTML, + XHTML, + WML + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdWordsConversionTracker.TextFormat", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AdWordsConversionTrackerTextFormat { + ONE_LINE, + TWO_LINE, + HIDDEN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdWordsConversionTracker.TrackingCodeType", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AdWordsConversionTrackerTrackingCodeType { + WEBPAGE, + CLICK_TO_CALL, + ANDROID_REMARKETING, + APPLE_IOS_REMARKETING + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdCallMetricsConversion : ConversionTracker { + private long phoneCallDurationField; + + private bool phoneCallDurationFieldSpecified; + + public long phoneCallDuration { + get { return this.phoneCallDurationField; } + set { + this.phoneCallDurationField = value; + this.phoneCallDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool phoneCallDurationSpecified { + get { return this.phoneCallDurationFieldSpecified; } + set { this.phoneCallDurationFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ConversionTrackerOperation : Operation { + private ConversionTracker operandField; + + public ConversionTracker operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConversionTrackerPage))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionBidLandscapePage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupBidLandscapePage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductServicePage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LabelPage))] + public abstract partial class NoStatsPage : Page { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ConversionTrackerPage : NoStatsPage { + private ConversionTracker[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public ConversionTracker[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ConversionTrackingError : ApiError { + private ConversionTrackingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ConversionTrackingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ConversionTrackingError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ConversionTrackingErrorReason { + ALREADY_CREATED_CUSTOM_CONVERSION_TYPE, + ANALYTICS_NOT_ALLOWED, + CANNOT_ADD_CONVERSION_TYPE_SUBCLASS, + CANNOT_CHANGE_APP_CONVERSION_TYPE, + CANNOT_CHANGE_APP_PLATFORM, + CANNNOT_CHANGE_CONVERSION_SUBCLASS, + CANNOT_SET_HIDDEN_STATUS, + CONVERSION_TYPE_NOT_FOUND, + DOMAIN_EXCEPTION, + INCONSISTENT_COUNTING_TYPE, + DUPLICATE_APP_ID, + DUPLICATE_NAME, + EMAIL_FAILED, + EXCEEDED_CONVERSION_TYPE_LIMIT, + ID_IS_NULL, + INVALID_APP_ID, + INVALID_COLOR, + INVALID_CONVERSION, + INVALID_DATE_RANGE, + INVALID_EMAIL_ADDRESS, + INVALID_ORIGINAL_CONVERSION_TYPE_ID, + MUST_SET_APP_PLATFORM_AND_APP_CONVERSION_TYPE_TOGETHER, + NAME_ALREADY_EXISTS, + NO_RECIPIENTS, + NO_SNIPPET, + TOO_MANY_WEBPAGES, + UNKNOWN_SORTING_TYPE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomerServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomerService : AdWordsSoapClient, ICustomerService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomerService() { + this.Url = "https://adwords.google.com/api/adwords/mcm/v201406/CustomerService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Customer get() { + object[] results = this.Invoke("get", new object[0]); + return ((Customer) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Customer mutate(Customer customer) { + object[] results = this.Invoke("mutate", new object[] { customer }); + return ((Customer) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public partial class ConversionTrackingSettings { + private ConversionDeduplicationMode conversionOptimizerModeField; + + private bool conversionOptimizerModeFieldSpecified; + + public ConversionDeduplicationMode conversionOptimizerMode { + get { return this.conversionOptimizerModeField; } + set { + this.conversionOptimizerModeField = value; + this.conversionOptimizerModeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool conversionOptimizerModeSpecified { + get { return this.conversionOptimizerModeFieldSpecified; } + set { this.conversionOptimizerModeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public partial class Customer { + private long customerIdField; + + private bool customerIdFieldSpecified; + + private string currencyCodeField; + + private string dateTimeZoneField; + + private string descriptiveNameField; + + private string companyNameField; + + private bool canManageClientsField; + + private bool canManageClientsFieldSpecified; + + private bool testAccountField; + + private bool testAccountFieldSpecified; + + private bool autoTaggingEnabledField; + + private bool autoTaggingEnabledFieldSpecified; + + private string trackingUrlTemplateField; + + private ConversionTrackingSettings conversionTrackingSettingsField; + + public long customerId { + get { return this.customerIdField; } + set { + this.customerIdField = value; + this.customerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customerIdSpecified { + get { return this.customerIdFieldSpecified; } + set { this.customerIdFieldSpecified = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public string dateTimeZone { + get { return this.dateTimeZoneField; } + set { this.dateTimeZoneField = value; } + } + + public string descriptiveName { + get { return this.descriptiveNameField; } + set { this.descriptiveNameField = value; } + } + + public string companyName { + get { return this.companyNameField; } + set { this.companyNameField = value; } + } + + public bool canManageClients { + get { return this.canManageClientsField; } + set { + this.canManageClientsField = value; + this.canManageClientsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool canManageClientsSpecified { + get { return this.canManageClientsFieldSpecified; } + set { this.canManageClientsFieldSpecified = value; } + } + + public bool testAccount { + get { return this.testAccountField; } + set { + this.testAccountField = value; + this.testAccountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool testAccountSpecified { + get { return this.testAccountFieldSpecified; } + set { this.testAccountFieldSpecified = value; } + } + + public bool autoTaggingEnabled { + get { return this.autoTaggingEnabledField; } + set { + this.autoTaggingEnabledField = value; + this.autoTaggingEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool autoTaggingEnabledSpecified { + get { return this.autoTaggingEnabledFieldSpecified; } + set { this.autoTaggingEnabledFieldSpecified = value; } + } + + public string trackingUrlTemplate { + get { return this.trackingUrlTemplateField; } + set { this.trackingUrlTemplateField = value; } + } + + public ConversionTrackingSettings conversionTrackingSettings { + get { return this.conversionTrackingSettingsField; } + set { this.conversionTrackingSettingsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomerSyncServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/ch/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomerSyncService : AdWordsSoapClient, ICustomerSyncService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomerSyncService() { + this.Url = "https://adwords.google.com/api/adwords/ch/v201406/CustomerSyncService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/ch/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/ch/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomerChangeData get(CustomerSyncSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((CustomerChangeData) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/ch/v201406")] + public partial class FeedChangeData { + private long feedIdField; + + private bool feedIdFieldSpecified; + + private ChangeStatus feedChangeStatusField; + + private bool feedChangeStatusFieldSpecified; + + private long[] changedFeedItemsField; + + private long[] removedFeedItemsField; + + public long feedId { + get { return this.feedIdField; } + set { + this.feedIdField = value; + this.feedIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedIdSpecified { + get { return this.feedIdFieldSpecified; } + set { this.feedIdFieldSpecified = value; } + } + + public ChangeStatus feedChangeStatus { + get { return this.feedChangeStatusField; } + set { + this.feedChangeStatusField = value; + this.feedChangeStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedChangeStatusSpecified { + get { return this.feedChangeStatusFieldSpecified; } + set { this.feedChangeStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedFeedItems")] + public long[] changedFeedItems { + get { return this.changedFeedItemsField; } + set { this.changedFeedItemsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("removedFeedItems")] + public long[] removedFeedItems { + get { return this.removedFeedItemsField; } + set { this.removedFeedItemsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/ch/v201406")] + public enum ChangeStatus { + FIELDS_UNCHANGED, + FIELDS_CHANGED, + NEW + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/ch/v201406")] + public partial class AdGroupChangeData { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private ChangeStatus adGroupChangeStatusField; + + private bool adGroupChangeStatusFieldSpecified; + + private long[] changedAdsField; + + private long[] changedCriteriaField; + + private long[] removedCriteriaField; + + private long[] changedFeedsField; + + private long[] removedFeedsField; + + private long[] changedAdGroupBidModifierCriteriaField; + + private long[] removedAdGroupBidModifierCriteriaField; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public ChangeStatus adGroupChangeStatus { + get { return this.adGroupChangeStatusField; } + set { + this.adGroupChangeStatusField = value; + this.adGroupChangeStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupChangeStatusSpecified { + get { return this.adGroupChangeStatusFieldSpecified; } + set { this.adGroupChangeStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedAds")] + public long[] changedAds { + get { return this.changedAdsField; } + set { this.changedAdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedCriteria")] + public long[] changedCriteria { + get { return this.changedCriteriaField; } + set { this.changedCriteriaField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("removedCriteria")] + public long[] removedCriteria { + get { return this.removedCriteriaField; } + set { this.removedCriteriaField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedFeeds")] + public long[] changedFeeds { + get { return this.changedFeedsField; } + set { this.changedFeedsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("removedFeeds")] + public long[] removedFeeds { + get { return this.removedFeedsField; } + set { this.removedFeedsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedAdGroupBidModifierCriteria")] + public long[] changedAdGroupBidModifierCriteria { + get { return this.changedAdGroupBidModifierCriteriaField; } + set { this.changedAdGroupBidModifierCriteriaField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("removedAdGroupBidModifierCriteria")] + public long[] removedAdGroupBidModifierCriteria { + get { return this.removedAdGroupBidModifierCriteriaField; } + set { this.removedAdGroupBidModifierCriteriaField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/ch/v201406")] + public partial class CampaignChangeData { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private ChangeStatus campaignChangeStatusField; + + private bool campaignChangeStatusFieldSpecified; + + private AdGroupChangeData[] changedAdGroupsField; + + private long[] addedCampaignCriteriaField; + + private long[] removedCampaignCriteriaField; + + private long[] addedAdExtensionsField; + + private long[] removedAdExtensionsField; + + private long[] changedFeedsField; + + private long[] removedFeedsField; + + private bool campaignTargetingChangedField; + + private bool campaignTargetingChangedFieldSpecified; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public ChangeStatus campaignChangeStatus { + get { return this.campaignChangeStatusField; } + set { + this.campaignChangeStatusField = value; + this.campaignChangeStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignChangeStatusSpecified { + get { return this.campaignChangeStatusFieldSpecified; } + set { this.campaignChangeStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedAdGroups")] + public AdGroupChangeData[] changedAdGroups { + get { return this.changedAdGroupsField; } + set { this.changedAdGroupsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("addedCampaignCriteria")] + public long[] addedCampaignCriteria { + get { return this.addedCampaignCriteriaField; } + set { this.addedCampaignCriteriaField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("removedCampaignCriteria")] + public long[] removedCampaignCriteria { + get { return this.removedCampaignCriteriaField; } + set { this.removedCampaignCriteriaField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("addedAdExtensions")] + public long[] addedAdExtensions { + get { return this.addedAdExtensionsField; } + set { this.addedAdExtensionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("removedAdExtensions")] + public long[] removedAdExtensions { + get { return this.removedAdExtensionsField; } + set { this.removedAdExtensionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedFeeds")] + public long[] changedFeeds { + get { return this.changedFeedsField; } + set { this.changedFeedsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("removedFeeds")] + public long[] removedFeeds { + get { return this.removedFeedsField; } + set { this.removedFeedsField = value; } + } + + public bool campaignTargetingChanged { + get { return this.campaignTargetingChangedField; } + set { + this.campaignTargetingChangedField = value; + this.campaignTargetingChangedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignTargetingChangedSpecified { + get { return this.campaignTargetingChangedFieldSpecified; } + set { this.campaignTargetingChangedFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/ch/v201406")] + public partial class CustomerChangeData { + private CampaignChangeData[] changedCampaignsField; + + private FeedChangeData[] changedFeedsField; + + private string lastChangeTimestampField; + + [System.Xml.Serialization.XmlElementAttribute("changedCampaigns")] + public CampaignChangeData[] changedCampaigns { + get { return this.changedCampaignsField; } + set { this.changedCampaignsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("changedFeeds")] + public FeedChangeData[] changedFeeds { + get { return this.changedFeedsField; } + set { this.changedFeedsField = value; } + } + + public string lastChangeTimestamp { + get { return this.lastChangeTimestampField; } + set { this.lastChangeTimestampField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class DateTimeRange { + private string minField; + + private string maxField; + + public string min { + get { return this.minField; } + set { this.minField = value; } + } + + public string max { + get { return this.maxField; } + set { this.maxField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/ch/v201406")] + public partial class CustomerSyncSelector { + private DateTimeRange dateTimeRangeField; + + private long[] campaignIdsField; + + private long[] feedIdsField; + + public DateTimeRange dateTimeRange { + get { return this.dateTimeRangeField; } + set { this.dateTimeRangeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignIds")] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("feedIds")] + public long[] feedIds { + get { return this.feedIdsField; } + set { this.feedIdsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/ch/v201406")] + public partial class CustomerSyncError : ApiError { + private CustomerSyncErrorReason reasonField; + + private bool reasonFieldSpecified; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + public CustomerSyncErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomerSyncError.Reason", Namespace = "https://adwords.google.com/api/adwords/ch/v201406")] + public enum CustomerSyncErrorReason { + INVALID_CAMPAIGN_ID, + INVALID_FEED_ID, + INVALID_DATE_RANGE, + TOO_MANY_CHANGES + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomerFeedServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomerFeedService : AdWordsSoapClient, ICustomerFeedService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomerFeedService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/CustomerFeedService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomerFeedPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((CustomerFeedPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomerFeedReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +CustomerFeedOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((CustomerFeedReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomerFeedPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((CustomerFeedPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CustomerFeedReturnValue : ListReturnValue { + private CustomerFeed[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public CustomerFeed[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CustomerFeed { + private long feedIdField; + + private bool feedIdFieldSpecified; + + private Function matchingFunctionField; + + private int[] placeholderTypesField; + + private CustomerFeedStatus statusField; + + private bool statusFieldSpecified; + + public long feedId { + get { return this.feedIdField; } + set { + this.feedIdField = value; + this.feedIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedIdSpecified { + get { return this.feedIdFieldSpecified; } + set { this.feedIdFieldSpecified = value; } + } + + public Function matchingFunction { + get { return this.matchingFunctionField; } + set { this.matchingFunctionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("placeholderTypes")] + public int[] placeholderTypes { + get { return this.placeholderTypesField; } + set { this.placeholderTypesField = value; } + } + + public CustomerFeedStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomerFeed.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum CustomerFeedStatus { + ENABLED, + REMOVED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CustomerFeedOperation : Operation { + private CustomerFeed operandField; + + public CustomerFeed operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CustomerFeedPage : NullStatsPage { + private CustomerFeed[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public CustomerFeed[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CustomerFeedError : ApiError { + private CustomerFeedErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomerFeedErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomerFeedError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum CustomerFeedErrorReason { + FEED_ALREADY_EXISTS_FOR_PLACEHOLDER_TYPE, + INVALID_ID, + CANNOT_ADD_ALREADY_EXISTING_CUSTOMER_FEED, + CANNOT_MODIFY_REMOVED_CUSTOMER_FEED, + INVALID_PLACEHOLDER_TYPES, + MISSING_FEEDMAPPING_FOR_PLACEHOLDER_TYPE, + PLACEHOLDER_TYPE_NOT_ALLOWED_ON_CUSTOMER_FEED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdGroupAdServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdGroupAdService : AdWordsSoapClient, IAdGroupAdService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdGroupAdService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/AdGroupAdService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupAdPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((AdGroupAdPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupAdReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +AdGroupAdOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((AdGroupAdReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupAdLabelReturnValue mutateLabel([System.Xml.Serialization.XmlElementAttribute("operations")] +AdGroupAdLabelOperation[] operations) { + object[] results = this.Invoke("mutateLabel", new object[] { operations }); + return ((AdGroupAdLabelReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupAdPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((AdGroupAdPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupAdReturnValue : ListReturnValue { + private AdGroupAd[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdGroupAd[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupAd { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private Ad adField; + + private AdGroupAdExperimentData experimentDataField; + + private AdGroupAdStatus statusField; + + private bool statusFieldSpecified; + + private AdGroupAdApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + private string[] disapprovalReasonsField; + + private bool trademarkDisapprovedField; + + private bool trademarkDisapprovedFieldSpecified; + + private Label[] labelsField; + + private String_StringMapEntry[] forwardCompatibilityMapField; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public Ad ad { + get { return this.adField; } + set { this.adField = value; } + } + + public AdGroupAdExperimentData experimentData { + get { return this.experimentDataField; } + set { this.experimentDataField = value; } + } + + public AdGroupAdStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public AdGroupAdApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("disapprovalReasons")] + public string[] disapprovalReasons { + get { return this.disapprovalReasonsField; } + set { this.disapprovalReasonsField = value; } + } + + public bool trademarkDisapproved { + get { return this.trademarkDisapprovedField; } + set { + this.trademarkDisapprovedField = value; + this.trademarkDisapprovedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool trademarkDisapprovedSpecified { + get { return this.trademarkDisapprovedFieldSpecified; } + set { this.trademarkDisapprovedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("labels")] + public Label[] labels { + get { return this.labelsField; } + set { this.labelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("forwardCompatibilityMap")] + public String_StringMapEntry[] forwardCompatibilityMap { + get { return this.forwardCompatibilityMapField; } + set { this.forwardCompatibilityMapField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DynamicSearchAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TextAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TemplateAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ThirdPartyRedirectAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileImageAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageAd))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeprecatedAd))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Ad { + private long idField; + + private bool idFieldSpecified; + + private string urlField; + + private string displayUrlField; + + private string[] finalUrlsField; + + private string[] finalMobileUrlsField; + + private string trackingUrlTemplateField; + + private CustomParameters urlCustomParametersField; + + private long devicePreferenceField; + + private bool devicePreferenceFieldSpecified; + + private string adTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + + public string displayUrl { + get { return this.displayUrlField; } + set { this.displayUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("finalUrls")] + public string[] finalUrls { + get { return this.finalUrlsField; } + set { this.finalUrlsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("finalMobileUrls")] + public string[] finalMobileUrls { + get { return this.finalMobileUrlsField; } + set { this.finalMobileUrlsField = value; } + } + + public string trackingUrlTemplate { + get { return this.trackingUrlTemplateField; } + set { this.trackingUrlTemplateField = value; } + } + + public CustomParameters urlCustomParameters { + get { return this.urlCustomParametersField; } + set { this.urlCustomParametersField = value; } + } + + public long devicePreference { + get { return this.devicePreferenceField; } + set { + this.devicePreferenceField = value; + this.devicePreferenceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool devicePreferenceSpecified { + get { return this.devicePreferenceFieldSpecified; } + set { this.devicePreferenceFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Ad.Type")] + public string AdType { + get { return this.adTypeField; } + set { this.adTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class DynamicSearchAd : Ad { + private string description1Field; + + private string description2Field; + + public string description1 { + get { return this.description1Field; } + set { this.description1Field = value; } + } + + public string description2 { + get { return this.description2Field; } + set { this.description2Field = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class TextAd : Ad { + private string headlineField; + + private string description1Field; + + private string description2Field; + + public string headline { + get { return this.headlineField; } + set { this.headlineField = value; } + } + + public string description1 { + get { return this.description1Field; } + set { this.description1Field = value; } + } + + public string description2 { + get { return this.description2Field; } + set { this.description2Field = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class TemplateAd : Ad { + private long templateIdField; + + private bool templateIdFieldSpecified; + + private AdUnionId adUnionIdField; + + private TemplateElement[] templateElementsField; + + private Image adAsImageField; + + private Dimensions dimensionsField; + + private string nameField; + + private int durationField; + + private bool durationFieldSpecified; + + private long originAdIdField; + + private bool originAdIdFieldSpecified; + + public long templateId { + get { return this.templateIdField; } + set { + this.templateIdField = value; + this.templateIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool templateIdSpecified { + get { return this.templateIdFieldSpecified; } + set { this.templateIdFieldSpecified = value; } + } + + public AdUnionId adUnionId { + get { return this.adUnionIdField; } + set { this.adUnionIdField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("templateElements")] + public TemplateElement[] templateElements { + get { return this.templateElementsField; } + set { this.templateElementsField = value; } + } + + public Image adAsImage { + get { return this.adAsImageField; } + set { this.adAsImageField = value; } + } + + public Dimensions dimensions { + get { return this.dimensionsField; } + set { this.dimensionsField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public long originAdId { + get { return this.originAdIdField; } + set { + this.originAdIdField = value; + this.originAdIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool originAdIdSpecified { + get { return this.originAdIdFieldSpecified; } + set { this.originAdIdFieldSpecified = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TempAdUnionId))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdUnionId { + private long idField; + + private bool idFieldSpecified; + + private string adUnionIdTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("AdUnionId.Type")] + public string AdUnionIdType { + get { return this.adUnionIdTypeField; } + set { this.adUnionIdTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class TempAdUnionId : AdUnionId { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class TemplateElement { + private string uniqueNameField; + + private TemplateElementField[] fieldsField; + + public string uniqueName { + get { return this.uniqueNameField; } + set { this.uniqueNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("fields")] + public TemplateElementField[] fields { + get { return this.fieldsField; } + set { this.fieldsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class TemplateElementField { + private string nameField; + + private TemplateElementFieldType typeField; + + private bool typeFieldSpecified; + + private string fieldTextField; + + private Media fieldMediaField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public TemplateElementFieldType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public string fieldText { + get { return this.fieldTextField; } + set { this.fieldTextField = value; } + } + + public Media fieldMedia { + get { return this.fieldMediaField; } + set { this.fieldMediaField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TemplateElementField.Type", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum TemplateElementFieldType { + ADDRESS, + AUDIO, + ENUM, + IMAGE, + BACKGROUND_IMAGE, + NUMBER, + TEXT, + URL, + VIDEO, + VISIBLE_URL, + UNKNOWN + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Video))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Image))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Audio))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Media { + private long mediaIdField; + + private bool mediaIdFieldSpecified; + + private MediaMediaType typeField; + + private bool typeFieldSpecified; + + private long referenceIdField; + + private bool referenceIdFieldSpecified; + + private Media_Size_DimensionsMapEntry[] dimensionsField; + + private Media_Size_StringMapEntry[] urlsField; + + private MediaMimeType mimeTypeField; + + private bool mimeTypeFieldSpecified; + + private string sourceUrlField; + + private string nameField; + + private long fileSizeField; + + private bool fileSizeFieldSpecified; + + private string creationTimeField; + + private string mediaTypeField; + + public long mediaId { + get { return this.mediaIdField; } + set { + this.mediaIdField = value; + this.mediaIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mediaIdSpecified { + get { return this.mediaIdFieldSpecified; } + set { this.mediaIdFieldSpecified = value; } + } + + public MediaMediaType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public long referenceId { + get { return this.referenceIdField; } + set { + this.referenceIdField = value; + this.referenceIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool referenceIdSpecified { + get { return this.referenceIdFieldSpecified; } + set { this.referenceIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("dimensions")] + public Media_Size_DimensionsMapEntry[] dimensions { + get { return this.dimensionsField; } + set { this.dimensionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("urls")] + public Media_Size_StringMapEntry[] urls { + get { return this.urlsField; } + set { this.urlsField = value; } + } + + public MediaMimeType mimeType { + get { return this.mimeTypeField; } + set { + this.mimeTypeField = value; + this.mimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mimeTypeSpecified { + get { return this.mimeTypeFieldSpecified; } + set { this.mimeTypeFieldSpecified = value; } + } + + public string sourceUrl { + get { return this.sourceUrlField; } + set { this.sourceUrlField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public long fileSize { + get { return this.fileSizeField; } + set { + this.fileSizeField = value; + this.fileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fileSizeSpecified { + get { return this.fileSizeFieldSpecified; } + set { this.fileSizeFieldSpecified = value; } + } + + public string creationTime { + get { return this.creationTimeField; } + set { this.creationTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Media.Type")] + public string MediaType { + get { return this.mediaTypeField; } + set { this.mediaTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Media.MediaType", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum MediaMediaType { + AUDIO, + DYNAMIC_IMAGE, + ICON, + IMAGE, + STANDARD_ICON, + VIDEO + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Media_Size_DimensionsMapEntry { + private MediaSize keyField; + + private bool keyFieldSpecified; + + private Dimensions valueField; + + public MediaSize key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public Dimensions value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Media.Size", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum MediaSize { + FULL, + SHRUNKEN, + PREVIEW, + VIDEO_THUMBNAIL + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Dimensions { + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Media_Size_StringMapEntry { + private MediaSize keyField; + + private bool keyFieldSpecified; + + private string valueField; + + public MediaSize key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Media.MimeType", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum MediaMimeType { + IMAGE_JPEG, + IMAGE_GIF, + IMAGE_PNG, + FLASH, + TEXT_HTML, + PDF, + MSWORD, + MSEXCEL, + RTF, + AUDIO_WAV, + AUDIO_MP3 + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Video : Media { + private long durationMillisField; + + private bool durationMillisFieldSpecified; + + private string streamingUrlField; + + private bool readyToPlayOnTheWebField; + + private bool readyToPlayOnTheWebFieldSpecified; + + private string industryStandardCommercialIdentifierField; + + private string advertisingIdField; + + private string youTubeVideoIdStringField; + + public long durationMillis { + get { return this.durationMillisField; } + set { + this.durationMillisField = value; + this.durationMillisSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationMillisSpecified { + get { return this.durationMillisFieldSpecified; } + set { this.durationMillisFieldSpecified = value; } + } + + public string streamingUrl { + get { return this.streamingUrlField; } + set { this.streamingUrlField = value; } + } + + public bool readyToPlayOnTheWeb { + get { return this.readyToPlayOnTheWebField; } + set { + this.readyToPlayOnTheWebField = value; + this.readyToPlayOnTheWebSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool readyToPlayOnTheWebSpecified { + get { return this.readyToPlayOnTheWebFieldSpecified; } + set { this.readyToPlayOnTheWebFieldSpecified = value; } + } + + public string industryStandardCommercialIdentifier { + get { return this.industryStandardCommercialIdentifierField; } + set { this.industryStandardCommercialIdentifierField = value; } + } + + public string advertisingId { + get { return this.advertisingIdField; } + set { this.advertisingIdField = value; } + } + + public string youTubeVideoIdString { + get { return this.youTubeVideoIdStringField; } + set { this.youTubeVideoIdStringField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Image : Media { + private byte[] dataField; + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] data { + get { return this.dataField; } + set { this.dataField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Audio : Media { + private long durationMillisField; + + private bool durationMillisFieldSpecified; + + private string streamingUrlField; + + private bool readyToPlayOnTheWebField; + + private bool readyToPlayOnTheWebFieldSpecified; + + public long durationMillis { + get { return this.durationMillisField; } + set { + this.durationMillisField = value; + this.durationMillisSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationMillisSpecified { + get { return this.durationMillisFieldSpecified; } + set { this.durationMillisFieldSpecified = value; } + } + + public string streamingUrl { + get { return this.streamingUrlField; } + set { this.streamingUrlField = value; } + } + + public bool readyToPlayOnTheWeb { + get { return this.readyToPlayOnTheWebField; } + set { + this.readyToPlayOnTheWebField = value; + this.readyToPlayOnTheWebSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool readyToPlayOnTheWebSpecified { + get { return this.readyToPlayOnTheWebFieldSpecified; } + set { this.readyToPlayOnTheWebFieldSpecified = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ThirdPartyRedirectAd))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public abstract partial class RichMediaAd : Ad { + private string nameField; + + private Dimensions dimensionsField; + + private string snippetField; + + private string impressionBeaconUrlField; + + private int adDurationField; + + private bool adDurationFieldSpecified; + + private long certifiedVendorFormatIdField; + + private bool certifiedVendorFormatIdFieldSpecified; + + private string sourceUrlField; + + private RichMediaAdRichMediaAdType richMediaAdTypeField; + + private bool richMediaAdTypeFieldSpecified; + + private RichMediaAdAdAttribute[] adAttributesField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public Dimensions dimensions { + get { return this.dimensionsField; } + set { this.dimensionsField = value; } + } + + public string snippet { + get { return this.snippetField; } + set { this.snippetField = value; } + } + + public string impressionBeaconUrl { + get { return this.impressionBeaconUrlField; } + set { this.impressionBeaconUrlField = value; } + } + + public int adDuration { + get { return this.adDurationField; } + set { + this.adDurationField = value; + this.adDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adDurationSpecified { + get { return this.adDurationFieldSpecified; } + set { this.adDurationFieldSpecified = value; } + } + + public long certifiedVendorFormatId { + get { return this.certifiedVendorFormatIdField; } + set { + this.certifiedVendorFormatIdField = value; + this.certifiedVendorFormatIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool certifiedVendorFormatIdSpecified { + get { return this.certifiedVendorFormatIdFieldSpecified; } + set { this.certifiedVendorFormatIdFieldSpecified = value; } + } + + public string sourceUrl { + get { return this.sourceUrlField; } + set { this.sourceUrlField = value; } + } + + public RichMediaAdRichMediaAdType richMediaAdType { + get { return this.richMediaAdTypeField; } + set { + this.richMediaAdTypeField = value; + this.richMediaAdTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool richMediaAdTypeSpecified { + get { return this.richMediaAdTypeFieldSpecified; } + set { this.richMediaAdTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adAttributes")] + public RichMediaAdAdAttribute[] adAttributes { + get { return this.adAttributesField; } + set { this.adAttributesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaAd.RichMediaAdType", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum RichMediaAdRichMediaAdType { + STANDARD, + IN_STREAM_VIDEO + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaAd.AdAttribute", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum RichMediaAdAdAttribute { + UNKNOWN, + ROLL_OVER_TO_EXPAND, + SSL + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ThirdPartyRedirectAd : RichMediaAd { + private bool isCookieTargetedField; + + private bool isCookieTargetedFieldSpecified; + + private bool isUserInterestTargetedField; + + private bool isUserInterestTargetedFieldSpecified; + + private bool isTaggedField; + + private bool isTaggedFieldSpecified; + + private VideoType[] videoTypesField; + + private ThirdPartyRedirectAdExpandingDirection[] expandingDirectionsField; + + public bool isCookieTargeted { + get { return this.isCookieTargetedField; } + set { + this.isCookieTargetedField = value; + this.isCookieTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isCookieTargetedSpecified { + get { return this.isCookieTargetedFieldSpecified; } + set { this.isCookieTargetedFieldSpecified = value; } + } + + public bool isUserInterestTargeted { + get { return this.isUserInterestTargetedField; } + set { + this.isUserInterestTargetedField = value; + this.isUserInterestTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isUserInterestTargetedSpecified { + get { return this.isUserInterestTargetedFieldSpecified; } + set { this.isUserInterestTargetedFieldSpecified = value; } + } + + public bool isTagged { + get { return this.isTaggedField; } + set { + this.isTaggedField = value; + this.isTaggedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTaggedSpecified { + get { return this.isTaggedFieldSpecified; } + set { this.isTaggedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("videoTypes")] + public VideoType[] videoTypes { + get { return this.videoTypesField; } + set { this.videoTypesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("expandingDirections")] + public ThirdPartyRedirectAdExpandingDirection[] expandingDirections { + get { return this.expandingDirectionsField; } + set { this.expandingDirectionsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum VideoType { + ADOBE, + REALPLAYER, + QUICKTIME, + WINDOWSMEDIA + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ThirdPartyRedirectAd.ExpandingDirection", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ThirdPartyRedirectAdExpandingDirection { + UNKNOWN, + EXPANDING_UP, + EXPANDING_DOWN, + EXPANDING_LEFT, + EXPANDING_RIGHT, + EXPANDING_UPLEFT, + EXPANDING_UPRIGHT, + EXPANDING_DOWNLEFT, + EXPANDING_DOWNRIGHT + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ProductAd : Ad { + private string promotionLineField; + + public string promotionLine { + get { return this.promotionLineField; } + set { this.promotionLineField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class MobileImageAd : Ad { + private MarkupLanguageType[] markupLanguagesField; + + private string[] mobileCarriersField; + + private Image imageField; + + [System.Xml.Serialization.XmlElementAttribute("markupLanguages")] + public MarkupLanguageType[] markupLanguages { + get { return this.markupLanguagesField; } + set { this.markupLanguagesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("mobileCarriers")] + public string[] mobileCarriers { + get { return this.mobileCarriersField; } + set { this.mobileCarriersField = value; } + } + + public Image image { + get { return this.imageField; } + set { this.imageField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum MarkupLanguageType { + HTML, + CHTML, + XHTML, + WML + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class MobileAd : Ad { + private string headlineField; + + private string descriptionField; + + private MarkupLanguageType[] markupLanguagesField; + + private string[] mobileCarriersField; + + private string businessNameField; + + private string countryCodeField; + + private string phoneNumberField; + + public string headline { + get { return this.headlineField; } + set { this.headlineField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("markupLanguages")] + public MarkupLanguageType[] markupLanguages { + get { return this.markupLanguagesField; } + set { this.markupLanguagesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("mobileCarriers")] + public string[] mobileCarriers { + get { return this.mobileCarriersField; } + set { this.mobileCarriersField = value; } + } + + public string businessName { + get { return this.businessNameField; } + set { this.businessNameField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + + public string phoneNumber { + get { return this.phoneNumberField; } + set { this.phoneNumberField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ImageAd : Ad { + private Image imageField; + + private string nameField; + + private long adToCopyImageFromField; + + private bool adToCopyImageFromFieldSpecified; + + public Image image { + get { return this.imageField; } + set { this.imageField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public long adToCopyImageFrom { + get { return this.adToCopyImageFromField; } + set { + this.adToCopyImageFromField = value; + this.adToCopyImageFromSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adToCopyImageFromSpecified { + get { return this.adToCopyImageFromFieldSpecified; } + set { this.adToCopyImageFromFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class DeprecatedAd : Ad { + private string nameField; + + private DeprecatedAdType typeField; + + private bool typeFieldSpecified; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DeprecatedAdType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DeprecatedAd.Type", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum DeprecatedAdType { + VIDEO, + CLICK_TO_CALL, + IN_STREAM_VIDEO, + FROOGLE, + TEXT_LINK, + GADGET, + PRINT, + TEXT_WIDE, + GADGET_TEMPLATE, + TEXT_WITH_VIDEO, + AUDIO, + LOCAL_BUSINESS_AD, + AUDIO_TEMPLATE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupAdExperimentData { + private long experimentIdField; + + private bool experimentIdFieldSpecified; + + private ExperimentDeltaStatus experimentDeltaStatusField; + + private bool experimentDeltaStatusFieldSpecified; + + private ExperimentDataStatus experimentDataStatusField; + + private bool experimentDataStatusFieldSpecified; + + public long experimentId { + get { return this.experimentIdField; } + set { + this.experimentIdField = value; + this.experimentIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentIdSpecified { + get { return this.experimentIdFieldSpecified; } + set { this.experimentIdFieldSpecified = value; } + } + + public ExperimentDeltaStatus experimentDeltaStatus { + get { return this.experimentDeltaStatusField; } + set { + this.experimentDeltaStatusField = value; + this.experimentDeltaStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentDeltaStatusSpecified { + get { return this.experimentDeltaStatusFieldSpecified; } + set { this.experimentDeltaStatusFieldSpecified = value; } + } + + public ExperimentDataStatus experimentDataStatus { + get { return this.experimentDataStatusField; } + set { + this.experimentDataStatusField = value; + this.experimentDataStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentDataStatusSpecified { + get { return this.experimentDataStatusFieldSpecified; } + set { this.experimentDataStatusFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ExperimentDeltaStatus { + EXPERIMENT_ONLY, + MODIFIED, + CONTROL_ONLY, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ExperimentDataStatus { + ENABLED, + REMOVED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupAd.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AdGroupAdStatus { + ENABLED, + PAUSED, + DISABLED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupAd.ApprovalStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AdGroupAdApprovalStatus { + APPROVED, + DISAPPROVED, + FAMILY_SAFE, + NON_FAMILY_SAFE, + PORN, + UNCHECKED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupAdLabelReturnValue : ListReturnValue { + private AdGroupAdLabel[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdGroupAdLabel[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupAdLabel { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private long adIdField; + + private bool adIdFieldSpecified; + + private long labelIdField; + + private bool labelIdFieldSpecified; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public long adId { + get { return this.adIdField; } + set { + this.adIdField = value; + this.adIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adIdSpecified { + get { return this.adIdFieldSpecified; } + set { this.adIdFieldSpecified = value; } + } + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ExemptionRequest { + private PolicyViolationKey keyField; + + public PolicyViolationKey key { + get { return this.keyField; } + set { this.keyField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class PolicyViolationKey { + private string policyNameField; + + private string violatingTextField; + + public string policyName { + get { return this.policyNameField; } + set { this.policyNameField = value; } + } + + public string violatingText { + get { return this.violatingTextField; } + set { this.violatingTextField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupAdOperation : Operation { + private AdGroupAd operandField; + + private ExemptionRequest[] exemptionRequestsField; + + public AdGroupAd operand { + get { return this.operandField; } + set { this.operandField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("exemptionRequests")] + public ExemptionRequest[] exemptionRequests { + get { return this.exemptionRequestsField; } + set { this.exemptionRequestsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupAdLabelOperation : Operation { + private AdGroupAdLabel operandField; + + public AdGroupAdLabel operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupAdPage : Page { + private AdGroupAd[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public AdGroupAd[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PolicyViolationError.Part", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class PolicyViolationErrorPart { + private int indexField; + + private bool indexFieldSpecified; + + private int lengthField; + + private bool lengthFieldSpecified; + + public int index { + get { return this.indexField; } + set { + this.indexField = value; + this.indexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool indexSpecified { + get { return this.indexFieldSpecified; } + set { this.indexFieldSpecified = value; } + } + + public int length { + get { return this.lengthField; } + set { + this.lengthField = value; + this.lengthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lengthSpecified { + get { return this.lengthFieldSpecified; } + set { this.lengthFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionPolicyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdParamPolicyError))] + public partial class PolicyViolationError : ApiError { + private PolicyViolationKey keyField; + + private string externalPolicyNameField; + + private string externalPolicyUrlField; + + private string externalPolicyDescriptionField; + + private bool isExemptableField; + + private bool isExemptableFieldSpecified; + + private PolicyViolationErrorPart[] violatingPartsField; + + public PolicyViolationKey key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public string externalPolicyName { + get { return this.externalPolicyNameField; } + set { this.externalPolicyNameField = value; } + } + + public string externalPolicyUrl { + get { return this.externalPolicyUrlField; } + set { this.externalPolicyUrlField = value; } + } + + public string externalPolicyDescription { + get { return this.externalPolicyDescriptionField; } + set { this.externalPolicyDescriptionField = value; } + } + + public bool isExemptable { + get { return this.isExemptableField; } + set { + this.isExemptableField = value; + this.isExemptableSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isExemptableSpecified { + get { return this.isExemptableFieldSpecified; } + set { this.isExemptableFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("violatingParts")] + public PolicyViolationErrorPart[] violatingParts { + get { return this.violatingPartsField; } + set { this.violatingPartsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class MediaError : ApiError { + private MediaErrorReason reasonField; + + private bool reasonFieldSpecified; + + public MediaErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "MediaError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum MediaErrorReason { + CANNOT_ADD_STANDARD_ICON, + CANNOT_SELECT_STANDARD_ICON_WITH_OTHER_TYPES, + DUPLICATE_MEDIA, + EMPTY_FIELD, + ENTITY_REFERENCED_IN_MULTIPLE_OPS, + FIELD_NOT_SUPPORTED_FOR_MEDIA_SUB_TYPE, + INVALID_MEDIA_ID, + INVALID_MEDIA_TYPE, + INVALID_MEDIA_SUB_TYPE, + INVALID_REFERENCE_ID, + INVALID_YOU_TUBE_ID, + YOU_TUBE_VIDEO_NOT_FOUND, + YOU_TUBE_SERVICE_UNAVAILABLE, + YOU_TUBE_VIDEO_HAS_NON_POSITIVE_DURATION, + MEDIA_FAILED_TRANSCODING, + MEDIA_NOT_TRANSCODED, + MEDIA_TYPE_DOES_NOT_MATCH_OBJECT_TYPE, + NO_FIELDS_SPECIFIED, + NULL_REFERENCE_ID_AND_MEDIA_ID, + TOO_LONG, + UNSUPPORTED_OPERATION, + UNSUPPORTED_TYPE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ImageError : ApiError { + private ImageErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ImageErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ImageError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ImageErrorReason { + INVALID_IMAGE, + STORAGE_ERROR, + BAD_REQUEST, + UNEXPECTED_SIZE, + ANIMATED_NOT_ALLOWED, + ANIMATION_TOO_LONG, + SERVER_ERROR, + CMYK_JPEG_NOT_ALLOWED, + FLASH_NOT_ALLOWED, + FLASH_WITHOUT_CLICKTAG, + FLASH_ERROR_AFTER_FIXING_CLICK_TAG, + ANIMATED_VISUAL_EFFECT, + FLASH_ERROR, + LAYOUT_PROBLEM, + PROBLEM_READING_IMAGE_FILE, + ERROR_STORING_IMAGE, + FLASH_HAS_NETWORK_OBJECTS, + FLASH_HAS_NETWORK_METHODS, + FLASH_HAS_URL, + FLASH_HAS_MOUSE_TRACKING, + FLASH_HAS_RANDOM_NUM, + FLASH_SELF_TARGETS, + FLASH_BAD_GETURL_TARGET, + FLASH_VERSION_NOT_SUPPORTED, + FLASH_WITHOUT_HARD_CODED_CLICK_URL, + INVALID_FLASH_FILE, + FAILED_TO_FIX_CLICK_TAG_IN_FLASH, + FLASH_ACCESSES_NETWORK_RESOURCES, + FLASH_EXTERNAL_JS_CALL, + FLASH_EXTERNAL_FS_CALL, + FILE_TOO_LARGE, + IMAGE_DATA_TOO_LARGE, + IMAGE_PROCESSING_ERROR, + IMAGE_TOO_SMALL, + INVALID_INPUT, + PROBLEM_READING_FILE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FunctionParsingError : ApiError { + private FunctionParsingErrorReason reasonField; + + private bool reasonFieldSpecified; + + private string offendingTextField; + + private int offendingTextIndexField; + + private bool offendingTextIndexFieldSpecified; + + public FunctionParsingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + public string offendingText { + get { return this.offendingTextField; } + set { this.offendingTextField = value; } + } + + public int offendingTextIndex { + get { return this.offendingTextIndexField; } + set { + this.offendingTextIndexField = value; + this.offendingTextIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool offendingTextIndexSpecified { + get { return this.offendingTextIndexFieldSpecified; } + set { this.offendingTextIndexFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FunctionParsingError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum FunctionParsingErrorReason { + NO_MORE_INPUT, + EXPECTED_CHARACTER, + UNEXPECTED_SEPARATOR, + UNMATCHED_LEFT_BRACKET, + UNMATCHED_RIGHT_BRACKET, + TOO_MANY_NESTED_FUNCTIONS, + MISSING_RIGHT_HAND_OPERAND, + INVALID_OPERATOR_NAME, + FEED_ATTRIBUTE_OPERAND_ARGUMENT_NOT_INTEGER, + NO_OPERANDS, + TOO_MANY_OPERANDS, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ExperimentError : ApiError { + private ExperimentErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ExperimentErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ExperimentError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ExperimentErrorReason { + EXPERIMENT_DELTA_STATUS_NOT_SPECIFIED, + EXPERIMENT_DELTA_STATUS_NOT_ALLOWED, + EXPERIMENT_STATUS_NOT_ALLOWED, + EXPERIMENT_NOT_ALLOWED_FOR_BIDDING_STRATEGY, + EXPERIMENT_NOT_ALLOWED_FOR_CRITERION_TYPE, + EXPERIMENT_NOT_ACTIVE, + INVALID_EXPERIMENT_ID, + EXPERIMENT_ID_NOT_SPECIFIED_WITH_SEGMENTATION_CRITERIA, + TOO_MANY_CHANGES_TO_EXPERIMENT, + EXPERIMENT_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupAdCountLimitExceeded : EntityCountLimitExceeded { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class EntityAccessDenied : ApiError { + private EntityAccessDeniedReason reasonField; + + private bool reasonFieldSpecified; + + public EntityAccessDeniedReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "EntityAccessDenied.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum EntityAccessDeniedReason { + READ_ACCESS_DENIED, + WRITE_ACCESS_DENIED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupAdError : ApiError { + private AdGroupAdErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdGroupAdErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupAdError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AdGroupAdErrorReason { + AD_GROUP_AD_LABEL_DOES_NOT_EXIST, + AD_GROUP_AD_LABEL_ALREADY_EXISTS, + AD_NOT_UNDER_ADGROUP, + CANNOT_OPERATE_ON_REMOVED_ADGROUPAD, + CANNOT_CREATE_DEPRECATED_ADS, + EMPTY_FIELD, + ENTITY_REFERENCED_IN_MULTIPLE_OPS, + UNSUPPORTED_OPERATION + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdError : ApiError { + private AdErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AdErrorReason { + APPROXIMATELY_TOO_LONG, + APPROXIMATELY_TOO_SHORT, + BAD_SNIPPET, + CANNOT_SET_BUSINESS_NAME_IF_URL_SET, + CANNOT_SET_FIELD_WITH_ORIGIN_AD_ID_SET, + CANNOT_SET_URL, + CANNOT_SET_WITHOUT_FINAL_URLS, + CANNOT_SET_WITH_FINAL_URLS, + CANNOT_SET_WITH_TRACKING_URL_TEMPLATE, + CUSTOMER_NOT_APPROVED_MOBILEADS, + CUSTOMER_NOT_APPROVED_THIRDPARTY_ADS, + CUSTOMER_NOT_APPROVED_THIRDPARTY_REDIRECT_ADS, + CUSTOMER_NOT_ELIGIBLE, + CUSTOMER_NOT_ELIGIBLE_FOR_UPDATING_BEACON_URL, + DIMENSION_ALREADY_IN_UNION, + DIMENSION_MUST_BE_SET, + DIMENSION_NOT_IN_UNION, + DISPLAY_URL_CANNOT_BE_SPECIFIED, + DOMESTIC_PHONE_NUMBER_FORMAT, + EMERGENCY_PHONE_NUMBER, + EMPTY_FIELD, + INCONSISTENT_STATUS_IN_TEMPLATE_UNION, + INCORRECT_LENGTH, + INVALID_AD_ADDRESS_CAMPAIGN_TARGET, + INVALID_AD_TYPE, + INVALID_ATTRIBUTES_FOR_MOBILE_IMAGE, + INVALID_ATTRIBUTES_FOR_MOBILE_TEXT, + INVALID_CHARACTER_FOR_URL, + INVALID_COUNTRY_CODE, + INVALID_DSA_URL_TAG, + INVALID_INPUT, + INVALID_MARKUP_LANGUAGE, + INVALID_MOBILE_CARRIER, + INVALID_MOBILE_CARRIER_TARGET, + INVALID_NUMBER_OF_ELEMENTS, + INVALID_PHONE_NUMBER_FORMAT, + INVALID_RICH_MEDIA_CERTIFIED_VENDOR_FORMAT_ID, + INVALID_TEMPLATE_DATA, + INVALID_TEMPLATE_ELEMENT_FIELD_TYPE, + INVALID_TEMPLATE_ID, + LINE_TOO_WIDE, + MARKUP_LANGUAGES_PRESENT, + MISSING_ADDRESS_COMPONENT, + MISSING_ADVERTISEMENT_NAME, + MISSING_BUSINESS_NAME, + MISSING_DESCRIPTION1, + MISSING_DESCRIPTION2, + MISSING_DESTINATION_URL, + MISSING_DESTINATION_URL_TAG, + MISSING_DIMENSION, + MISSING_DISPLAY_URL, + MISSING_HEADLINE, + MISSING_HEIGHT, + MISSING_IMAGE, + MISSING_MARKUP_LANGUAGES, + MISSING_MOBILE_CARRIER, + MISSING_PHONE, + MISSING_REQUIRED_TEMPLATE_FIELDS, + MISSING_TEMPLATE_FIELD_VALUE, + MISSING_TEXT, + MISSING_URL_AND_PHONE, + MISSING_VISIBLE_URL, + MISSING_WIDTH, + MUST_USE_TEMP_AD_UNION_ID_ON_ADD, + TOO_LONG, + TOO_SHORT, + UNION_DIMENSIONS_CANNOT_CHANGE, + UNKNOWN_ADDRESS_COMPONENT, + UNKNOWN_FIELD_NAME, + UNKNOWN_UNIQUE_NAME, + UNSUPPORTED_DIMENSIONS, + URL_INVALID_SCHEME, + URL_INVALID_TOP_LEVEL_DOMAIN, + URL_MALFORMED, + URL_NO_HOST, + URL_HOST_NAME_TOO_LONG, + URL_NO_SCHEME, + URL_NO_TOP_LEVEL_DOMAIN, + URL_PATH_NOT_ALLOWED, + URL_PORT_NOT_ALLOWED, + URL_QUERY_NOT_ALLOWED, + URL_SCHEME_BEFORE_DSA_TAG, + USER_DOES_NOT_HAVE_ACCESS_TO_TEMPLATE, + INCONSISTENT_EXPANDABLE_SETTINGS, + INVALID_FORMAT, + INVALID_FIELD_TEXT, + ELEMENT_NOT_PRESENT, + IMAGE_ERROR, + VALUE_NOT_IN_RANGE, + FIELD_NOT_PRESENT, + ADDRESS_NOT_COMPLETE, + ADDRESS_INVALID, + VIDEO_RETRIEVAL_ERROR, + AUDIO_ERROR, + INVALID_YOUTUBE_DISPLAY_URL, + INCOMPATIBLE_AD_TYPE_AND_DEVICE_PREFERENCE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "DataServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DataEntry))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class DataService : AdWordsSoapClient, IDataService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public DataService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/DataService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupBidLandscapePage getAdGroupBidLandscape(Selector serviceSelector) { + object[] results = this.Invoke("getAdGroupBidLandscape", new object[] { serviceSelector }); + return ((AdGroupBidLandscapePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CriterionBidLandscapePage getCriterionBidLandscape(Selector serviceSelector) { + object[] results = this.Invoke("getCriterionBidLandscape", new object[] { serviceSelector }); + return ((CriterionBidLandscapePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual DomainCategoryPage getDomainCategory(Selector serviceSelector) { + object[] results = this.Invoke("getDomainCategory", new object[] { serviceSelector }); + return ((DomainCategoryPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupBidLandscapePage queryAdGroupBidLandscape(string query) { + object[] results = this.Invoke("queryAdGroupBidLandscape", new object[] { query }); + return ((AdGroupBidLandscapePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CriterionBidLandscapePage queryCriterionBidLandscape(string query) { + object[] results = this.Invoke("queryCriterionBidLandscape", new object[] { query }); + return ((CriterionBidLandscapePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual DomainCategoryPage queryDomainCategory(string query) { + object[] results = this.Invoke("queryDomainCategory", new object[] { query }); + return ((DomainCategoryPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class LevelOfDetail { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BidLandscape.LandscapePoint", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class BidLandscapeLandscapePoint { + private Money bidField; + + private long clicksField; + + private bool clicksFieldSpecified; + + private Money costField; + + private Money marginalCpcField; + + private long impressionsField; + + private bool impressionsFieldSpecified; + + private long promotedImpressionsField; + + private bool promotedImpressionsFieldSpecified; + + public Money bid { + get { return this.bidField; } + set { this.bidField = value; } + } + + public long clicks { + get { return this.clicksField; } + set { + this.clicksField = value; + this.clicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clicksSpecified { + get { return this.clicksFieldSpecified; } + set { this.clicksFieldSpecified = value; } + } + + public Money cost { + get { return this.costField; } + set { this.costField = value; } + } + + public Money marginalCpc { + get { return this.marginalCpcField; } + set { this.marginalCpcField = value; } + } + + public long impressions { + get { return this.impressionsField; } + set { + this.impressionsField = value; + this.impressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsSpecified { + get { return this.impressionsFieldSpecified; } + set { this.impressionsFieldSpecified = value; } + } + + public long promotedImpressions { + get { return this.promotedImpressionsField; } + set { + this.promotedImpressionsField = value; + this.promotedImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool promotedImpressionsSpecified { + get { return this.promotedImpressionsFieldSpecified; } + set { this.promotedImpressionsFieldSpecified = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DimensionProperties))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DomainCategory))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BidLandscape))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionBidLandscape))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupBidLandscape))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public abstract partial class DataEntry { + private string dataEntryTypeField; + + [System.Xml.Serialization.XmlElementAttribute("DataEntry.Type")] + public string DataEntryType { + get { return this.dataEntryTypeField; } + set { this.dataEntryTypeField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DomainCategory))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public abstract partial class DimensionProperties : DataEntry { + private LevelOfDetail levelOfDetailField; + + public LevelOfDetail levelOfDetail { + get { return this.levelOfDetailField; } + set { this.levelOfDetailField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class DomainCategory : DimensionProperties { + private string categoryField; + + private double coverageField; + + private bool coverageFieldSpecified; + + private string domainNameField; + + private string isoLanguageField; + + public string category { + get { return this.categoryField; } + set { this.categoryField = value; } + } + + public double coverage { + get { return this.coverageField; } + set { + this.coverageField = value; + this.coverageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool coverageSpecified { + get { return this.coverageFieldSpecified; } + set { this.coverageFieldSpecified = value; } + } + + public string domainName { + get { return this.domainNameField; } + set { this.domainNameField = value; } + } + + public string isoLanguage { + get { return this.isoLanguageField; } + set { this.isoLanguageField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionBidLandscape))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupBidLandscape))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public abstract partial class BidLandscape : DataEntry { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private string startDateField; + + private string endDateField; + + private BidLandscapeLandscapePoint[] landscapePointsField; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public string startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public string endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("landscapePoints")] + public BidLandscapeLandscapePoint[] landscapePoints { + get { return this.landscapePointsField; } + set { this.landscapePointsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CriterionBidLandscape : BidLandscape { + private long criterionIdField; + + private bool criterionIdFieldSpecified; + + public long criterionId { + get { return this.criterionIdField; } + set { + this.criterionIdField = value; + this.criterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionIdSpecified { + get { return this.criterionIdFieldSpecified; } + set { this.criterionIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupBidLandscape : BidLandscape { + private AdGroupBidLandscapeType typeField; + + private bool typeFieldSpecified; + + private bool landscapeCurrentField; + + private bool landscapeCurrentFieldSpecified; + + public AdGroupBidLandscapeType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public bool landscapeCurrent { + get { return this.landscapeCurrentField; } + set { + this.landscapeCurrentField = value; + this.landscapeCurrentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool landscapeCurrentSpecified { + get { return this.landscapeCurrentFieldSpecified; } + set { this.landscapeCurrentFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupBidLandscape.Type", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AdGroupBidLandscapeType { + UNIFORM, + DEFAULT, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CriterionBidLandscapePage : NoStatsPage { + private CriterionBidLandscape[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public CriterionBidLandscape[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupBidLandscapePage : NoStatsPage { + private AdGroupBidLandscape[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public AdGroupBidLandscape[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class DomainCategoryPage : Page { + private DomainCategory[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public DomainCategory[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class DataError : ApiError { + private DataErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DataErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DataError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum DataErrorReason { + CANNOT_CREATE_TABLE_ENTRY, + NO_TABLE_ENTRY_CLASS_FOR_VIEW_TYPE, + TABLE_SERVICE_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ExperimentServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ExperimentService : AdWordsSoapClient, IExperimentService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ExperimentService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/ExperimentService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExperimentPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((ExperimentPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExperimentReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +ExperimentOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((ExperimentReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ExperimentReturnValue : ListReturnValue { + private Experiment[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public Experiment[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Experiment { + private long idField; + + private bool idFieldSpecified; + + private long controlIdField; + + private bool controlIdFieldSpecified; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private string nameField; + + private ExperimentStatus statusField; + + private bool statusFieldSpecified; + + private ExperimentServingStatus servingStatusField; + + private bool servingStatusFieldSpecified; + + private int queryPercentageField; + + private bool queryPercentageFieldSpecified; + + private string startDateTimeField; + + private string endDateTimeField; + + private string lastModifiedDateTimeField; + + private ExperimentSummaryStats experimentSummaryStatsField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long controlId { + get { return this.controlIdField; } + set { + this.controlIdField = value; + this.controlIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool controlIdSpecified { + get { return this.controlIdFieldSpecified; } + set { this.controlIdFieldSpecified = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ExperimentStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ExperimentServingStatus servingStatus { + get { return this.servingStatusField; } + set { + this.servingStatusField = value; + this.servingStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool servingStatusSpecified { + get { return this.servingStatusFieldSpecified; } + set { this.servingStatusFieldSpecified = value; } + } + + public int queryPercentage { + get { return this.queryPercentageField; } + set { + this.queryPercentageField = value; + this.queryPercentageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool queryPercentageSpecified { + get { return this.queryPercentageFieldSpecified; } + set { this.queryPercentageFieldSpecified = value; } + } + + public string startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public string endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public string lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public ExperimentSummaryStats experimentSummaryStats { + get { return this.experimentSummaryStatsField; } + set { this.experimentSummaryStatsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ExperimentStatus { + ENABLED, + REMOVED, + PROMOTED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ExperimentServingStatus { + RUNNING, + PENDING, + ENDED, + REMOVED, + PROMOTED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ExperimentSummaryStats { + private int adGroupsCountField; + + private bool adGroupsCountFieldSpecified; + + private int adGroupCriteriaCountField; + + private bool adGroupCriteriaCountFieldSpecified; + + private int adGroupAdsCountField; + + private bool adGroupAdsCountFieldSpecified; + + public int adGroupsCount { + get { return this.adGroupsCountField; } + set { + this.adGroupsCountField = value; + this.adGroupsCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupsCountSpecified { + get { return this.adGroupsCountFieldSpecified; } + set { this.adGroupsCountFieldSpecified = value; } + } + + public int adGroupCriteriaCount { + get { return this.adGroupCriteriaCountField; } + set { + this.adGroupCriteriaCountField = value; + this.adGroupCriteriaCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupCriteriaCountSpecified { + get { return this.adGroupCriteriaCountFieldSpecified; } + set { this.adGroupCriteriaCountFieldSpecified = value; } + } + + public int adGroupAdsCount { + get { return this.adGroupAdsCountField; } + set { + this.adGroupAdsCountField = value; + this.adGroupAdsCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupAdsCountSpecified { + get { return this.adGroupAdsCountFieldSpecified; } + set { this.adGroupAdsCountFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ExperimentOperation : Operation { + private Experiment operandField; + + public Experiment operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ExperimentPage : Page { + private Experiment[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Experiment[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ExperimentServiceError : ApiError { + private ExperimentServiceErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ExperimentServiceErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ExperimentServiceError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ExperimentServiceErrorReason { + AFTER_MAXIMUM_ALLOWABLE_DATE, + AOL_PARTNER_CAMPAIGNS_CANT_RUN_EXPERIMENTS, + CANNOT_CREATE_EXPERIMENT_FOR_BIDDING_STRATEGY, + CANNOT_CREATE_EXPERIMENT_FOR_BIDDING_STRATEGY_FEATURE, + CANNOT_SET_DATE_TO_PAST, + CANNOT_SET_END_DATE_WITHOUT_SETTING_START_DATE, + CANNOT_USE_EXPERIMENT_WITH_SHARED_BUDGET, + DATE_OUTSIDE_CAMPAIGN_DATE_RANGE, + EXPERIMENT_ALREADY_STARTED, + EXPERIMENT_ENDED, + EXPERIMENT_LIMIT_EXCEEDED, + INVALID_EXPERIMENT_NAME, + INVALID_QUERY_PERCENTAGE, + CANNOT_CHANGE_QUERY_PERCENTAGE_AFTER_EXPERIMENT_HAS_STARTED, + INVALID_STATUS_UPDATE, + START_DATE_AFTER_END_DATE, + NO_VALID_BUDGET, + EXPERIMENT_NOT_ACTIVE, + EXPERIMENT_SERVICE_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "FeedServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class FeedService : AdWordsSoapClient, IFeedService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public FeedService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/FeedService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((FeedPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +FeedOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((FeedReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((FeedPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedReturnValue : ListReturnValue { + private Feed[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public Feed[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Feed { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private FeedAttribute[] attributesField; + + private FeedStatus statusField; + + private bool statusFieldSpecified; + + private FeedOrigin originField; + + private bool originFieldSpecified; + + private SystemFeedGenerationData systemFeedGenerationDataField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("attributes")] + public FeedAttribute[] attributes { + get { return this.attributesField; } + set { this.attributesField = value; } + } + + public FeedStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public FeedOrigin origin { + get { return this.originField; } + set { + this.originField = value; + this.originSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool originSpecified { + get { return this.originFieldSpecified; } + set { this.originFieldSpecified = value; } + } + + public SystemFeedGenerationData systemFeedGenerationData { + get { return this.systemFeedGenerationDataField; } + set { this.systemFeedGenerationDataField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedAttribute { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private FeedAttributeType typeField; + + private bool typeFieldSpecified; + + private bool isPartOfKeyField; + + private bool isPartOfKeyFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public FeedAttributeType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public bool isPartOfKey { + get { return this.isPartOfKeyField; } + set { + this.isPartOfKeyField = value; + this.isPartOfKeySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isPartOfKeySpecified { + get { return this.isPartOfKeyFieldSpecified; } + set { this.isPartOfKeyFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedAttribute.Type", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum FeedAttributeType { + INT64, + FLOAT, + STRING, + BOOLEAN, + URL, + DATE_TIME, + INT64_LIST, + FLOAT_LIST, + STRING_LIST, + BOOLEAN_LIST, + URL_LIST, + DATE_TIME_LIST, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Feed.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum FeedStatus { + ENABLED, + REMOVED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Feed.Origin", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum FeedOrigin { + USER, + ADWORDS, + UNKNOWN + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacesLocationFeedData))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class SystemFeedGenerationData { + private string systemFeedGenerationDataTypeField; + + [System.Xml.Serialization.XmlElementAttribute("SystemFeedGenerationData.Type")] + public string SystemFeedGenerationDataType { + get { return this.systemFeedGenerationDataTypeField; } + set { this.systemFeedGenerationDataTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class PlacesLocationFeedData : SystemFeedGenerationData { + private OAuthInfo oAuthInfoField; + + private string emailAddressField; + + private string businessNameFilterField; + + private string[] categoryFiltersField; + + public OAuthInfo oAuthInfo { + get { return this.oAuthInfoField; } + set { this.oAuthInfoField = value; } + } + + public string emailAddress { + get { return this.emailAddressField; } + set { this.emailAddressField = value; } + } + + public string businessNameFilter { + get { return this.businessNameFilterField; } + set { this.businessNameFilterField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("categoryFilters")] + public string[] categoryFilters { + get { return this.categoryFiltersField; } + set { this.categoryFiltersField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedOperation : Operation { + private Feed operandField; + + public Feed operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedPage : NullStatsPage { + private Feed[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Feed[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedError : ApiError { + private FeedErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FeedErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum FeedErrorReason { + ATTRIBUTE_NAMES_NOT_UNIQUE, + ATTRIBUTES_DO_NOT_MATCH_EXISTING_ATTRIBUTES, + CANNOT_CHANGE_ORIGIN, + CANNOT_SPECIFY_USER_ORIGIN_FOR_SYSTEM_FEED, + CANNOT_SPECIFY_ADWORDS_ORIGIN_FOR_NON_SYSTEM_FEED, + CANNOT_SPECIFY_FEED_ATTRIBUTES_FOR_SYSTEM_FEED, + CANNOT_UPDATE_FEED_ATTRIBUTES_WITH_ORIGIN_ADWORDS, + FEED_REMOVED, + INVALID_ORIGIN_VALUE, + FEED_ORIGIN_IS_NOT_USER, + DUPLICATE_FEED_NAME, + INVALID_FEED_NAME, + MISSING_OAUTH_INFO, + NEW_ATTRIBUTE_CANNOT_BE_PART_OF_UNIQUE_KEY, + TOO_MANY_FEED_ATTRIBUTES_FOR_FEED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "FeedItemServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Criterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class FeedItemService : AdWordsSoapClient, IFeedItemService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public FeedItemService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/FeedItemService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedItemPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((FeedItemPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedItemReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +FeedItemOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((FeedItemReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedItemPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((FeedItemPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedItemReturnValue : ListReturnValue { + private FeedItem[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public FeedItem[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedItem { + private long feedIdField; + + private bool feedIdFieldSpecified; + + private long feedItemIdField; + + private bool feedItemIdFieldSpecified; + + private FeedItemStatus statusField; + + private bool statusFieldSpecified; + + private string startTimeField; + + private string endTimeField; + + private FeedItemAttributeValue[] attributeValuesField; + + private FeedItemValidationDetail[] validationDetailsField; + + private FeedItemDevicePreference devicePreferenceField; + + private FeedItemSchedule[] schedulingField; + + private FeedItemCampaignTargeting campaignTargetingField; + + private FeedItemAdGroupTargeting adGroupTargetingField; + + private Keyword keywordTargetingField; + + private CustomParameters urlCustomParametersField; + + public long feedId { + get { return this.feedIdField; } + set { + this.feedIdField = value; + this.feedIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedIdSpecified { + get { return this.feedIdFieldSpecified; } + set { this.feedIdFieldSpecified = value; } + } + + public long feedItemId { + get { return this.feedItemIdField; } + set { + this.feedItemIdField = value; + this.feedItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedItemIdSpecified { + get { return this.feedItemIdFieldSpecified; } + set { this.feedItemIdFieldSpecified = value; } + } + + public FeedItemStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public string endTime { + get { return this.endTimeField; } + set { this.endTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("attributeValues")] + public FeedItemAttributeValue[] attributeValues { + get { return this.attributeValuesField; } + set { this.attributeValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("validationDetails")] + public FeedItemValidationDetail[] validationDetails { + get { return this.validationDetailsField; } + set { this.validationDetailsField = value; } + } + + public FeedItemDevicePreference devicePreference { + get { return this.devicePreferenceField; } + set { this.devicePreferenceField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("feedItemSchedules", IsNullable = false)] + public FeedItemSchedule[] scheduling { + get { return this.schedulingField; } + set { this.schedulingField = value; } + } + + public FeedItemCampaignTargeting campaignTargeting { + get { return this.campaignTargetingField; } + set { this.campaignTargetingField = value; } + } + + public FeedItemAdGroupTargeting adGroupTargeting { + get { return this.adGroupTargetingField; } + set { this.adGroupTargetingField = value; } + } + + public Keyword keywordTargeting { + get { return this.keywordTargetingField; } + set { this.keywordTargetingField = value; } + } + + public CustomParameters urlCustomParameters { + get { return this.urlCustomParametersField; } + set { this.urlCustomParametersField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedItem.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum FeedItemStatus { + ENABLED, + REMOVED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedItemAttributeValue { + private long feedAttributeIdField; + + private bool feedAttributeIdFieldSpecified; + + private long integerValueField; + + private bool integerValueFieldSpecified; + + private double doubleValueField; + + private bool doubleValueFieldSpecified; + + private bool booleanValueField; + + private bool booleanValueFieldSpecified; + + private string stringValueField; + + private long[] integerValuesField; + + private double[] doubleValuesField; + + private bool[] booleanValuesField; + + private string[] stringValuesField; + + public long feedAttributeId { + get { return this.feedAttributeIdField; } + set { + this.feedAttributeIdField = value; + this.feedAttributeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedAttributeIdSpecified { + get { return this.feedAttributeIdFieldSpecified; } + set { this.feedAttributeIdFieldSpecified = value; } + } + + public long integerValue { + get { return this.integerValueField; } + set { + this.integerValueField = value; + this.integerValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool integerValueSpecified { + get { return this.integerValueFieldSpecified; } + set { this.integerValueFieldSpecified = value; } + } + + public double doubleValue { + get { return this.doubleValueField; } + set { + this.doubleValueField = value; + this.doubleValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool doubleValueSpecified { + get { return this.doubleValueFieldSpecified; } + set { this.doubleValueFieldSpecified = value; } + } + + public bool booleanValue { + get { return this.booleanValueField; } + set { + this.booleanValueField = value; + this.booleanValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool booleanValueSpecified { + get { return this.booleanValueFieldSpecified; } + set { this.booleanValueFieldSpecified = value; } + } + + public string stringValue { + get { return this.stringValueField; } + set { this.stringValueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("integerValues")] + public long[] integerValues { + get { return this.integerValuesField; } + set { this.integerValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("doubleValues")] + public double[] doubleValues { + get { return this.doubleValuesField; } + set { this.doubleValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("booleanValues")] + public bool[] booleanValues { + get { return this.booleanValuesField; } + set { this.booleanValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("stringValues")] + public string[] stringValues { + get { return this.stringValuesField; } + set { this.stringValuesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedItemValidationDetail { + private long feedMappingIdField; + + private bool feedMappingIdFieldSpecified; + + private FeedItemValidationDetailValidationStatus validationStatusField; + + private bool validationStatusFieldSpecified; + + private FeedItemAttributeError[] validationErrorsField; + + private FeedItemValidationDetailApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + public long feedMappingId { + get { return this.feedMappingIdField; } + set { + this.feedMappingIdField = value; + this.feedMappingIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedMappingIdSpecified { + get { return this.feedMappingIdFieldSpecified; } + set { this.feedMappingIdFieldSpecified = value; } + } + + public FeedItemValidationDetailValidationStatus validationStatus { + get { return this.validationStatusField; } + set { + this.validationStatusField = value; + this.validationStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool validationStatusSpecified { + get { return this.validationStatusFieldSpecified; } + set { this.validationStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("validationErrors")] + public FeedItemAttributeError[] validationErrors { + get { return this.validationErrorsField; } + set { this.validationErrorsField = value; } + } + + public FeedItemValidationDetailApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedItemValidationDetail.ValidationStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum FeedItemValidationDetailValidationStatus { + ERROR, + UNCHECKED, + VALID + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedItemAttributeError { + private long[] feedAttributeIdsField; + + private int validationErrorCodeField; + + private bool validationErrorCodeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("feedAttributeIds")] + public long[] feedAttributeIds { + get { return this.feedAttributeIdsField; } + set { this.feedAttributeIdsField = value; } + } + + public int validationErrorCode { + get { return this.validationErrorCodeField; } + set { + this.validationErrorCodeField = value; + this.validationErrorCodeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool validationErrorCodeSpecified { + get { return this.validationErrorCodeFieldSpecified; } + set { this.validationErrorCodeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedItemValidationDetail.ApprovalStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum FeedItemValidationDetailApprovalStatus { + APPROVED, + DISAPPROVED, + UNCHECKED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedItemDevicePreference { + private long devicePreferenceField; + + private bool devicePreferenceFieldSpecified; + + public long devicePreference { + get { return this.devicePreferenceField; } + set { + this.devicePreferenceField = value; + this.devicePreferenceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool devicePreferenceSpecified { + get { return this.devicePreferenceFieldSpecified; } + set { this.devicePreferenceFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedItemSchedule { + private DayOfWeek dayOfWeekField; + + private bool dayOfWeekFieldSpecified; + + private int startHourField; + + private bool startHourFieldSpecified; + + private MinuteOfHour startMinuteField; + + private bool startMinuteFieldSpecified; + + private int endHourField; + + private bool endHourFieldSpecified; + + private MinuteOfHour endMinuteField; + + private bool endMinuteFieldSpecified; + + public DayOfWeek dayOfWeek { + get { return this.dayOfWeekField; } + set { + this.dayOfWeekField = value; + this.dayOfWeekSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dayOfWeekSpecified { + get { return this.dayOfWeekFieldSpecified; } + set { this.dayOfWeekFieldSpecified = value; } + } + + public int startHour { + get { return this.startHourField; } + set { + this.startHourField = value; + this.startHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startHourSpecified { + get { return this.startHourFieldSpecified; } + set { this.startHourFieldSpecified = value; } + } + + public MinuteOfHour startMinute { + get { return this.startMinuteField; } + set { + this.startMinuteField = value; + this.startMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startMinuteSpecified { + get { return this.startMinuteFieldSpecified; } + set { this.startMinuteFieldSpecified = value; } + } + + public int endHour { + get { return this.endHourField; } + set { + this.endHourField = value; + this.endHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endHourSpecified { + get { return this.endHourFieldSpecified; } + set { this.endHourFieldSpecified = value; } + } + + public MinuteOfHour endMinute { + get { return this.endMinuteField; } + set { + this.endMinuteField = value; + this.endMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endMinuteSpecified { + get { return this.endMinuteFieldSpecified; } + set { this.endMinuteFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedItemCampaignTargeting { + private long targetingCampaignIdField; + + private bool targetingCampaignIdFieldSpecified; + + public long TargetingCampaignId { + get { return this.targetingCampaignIdField; } + set { + this.targetingCampaignIdField = value; + this.TargetingCampaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool TargetingCampaignIdSpecified { + get { return this.targetingCampaignIdFieldSpecified; } + set { this.targetingCampaignIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedItemAdGroupTargeting { + private long targetingAdGroupIdField; + + private bool targetingAdGroupIdFieldSpecified; + + public long TargetingAdGroupId { + get { return this.targetingAdGroupIdField; } + set { + this.targetingAdGroupIdField = value; + this.TargetingAdGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool TargetingAdGroupIdSpecified { + get { return this.targetingAdGroupIdFieldSpecified; } + set { this.targetingAdGroupIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedItemOperation : Operation { + private FeedItem operandField; + + public FeedItem operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedItemPage : NullStatsPage { + private FeedItem[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public FeedItem[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedItemError : ApiError { + private FeedItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FeedItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedItemError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum FeedItemErrorReason { + CAMPAIGN_TARGETING_MISMATCH, + CANNOT_CONVERT_ATTRIBUTE_VALUE_FROM_STRING, + CANNOT_OPERATE_ON_REMOVED_FEED_ITEM, + DATE_TIME_MUST_BE_IN_ACCOUNT_TIME_ZONE, + KEY_ATTRIBUTES_NOT_FOUND, + INVALID_DEVICE_PREFERENCE, + INVALID_SCHEDULE_END, + INVALID_URL, + MISSING_KEY_ATTRIBUTES, + KEY_ATTRIBUTES_NOT_UNIQUE, + CANNOT_MODIFY_KEY_ATTRIBUTE_VALUE, + OVERLAPPING_SCHEDULES, + SCHEDULE_END_NOT_AFTER_START, + TOO_MANY_SCHEDULES_PER_DAY, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "FeedMappingServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class FeedMappingService : AdWordsSoapClient, IFeedMappingService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public FeedMappingService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/FeedMappingService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedMappingPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((FeedMappingPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedMappingReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +FeedMappingOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((FeedMappingReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FeedMappingPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((FeedMappingPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedMappingReturnValue : ListReturnValue { + private FeedMapping[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public FeedMapping[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedMapping { + private long feedMappingIdField; + + private bool feedMappingIdFieldSpecified; + + private long feedIdField; + + private bool feedIdFieldSpecified; + + private int placeholderTypeField; + + private bool placeholderTypeFieldSpecified; + + private FeedMappingStatus statusField; + + private bool statusFieldSpecified; + + private AttributeFieldMapping[] attributeFieldMappingsField; + + private int criterionTypeField; + + private bool criterionTypeFieldSpecified; + + public long feedMappingId { + get { return this.feedMappingIdField; } + set { + this.feedMappingIdField = value; + this.feedMappingIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedMappingIdSpecified { + get { return this.feedMappingIdFieldSpecified; } + set { this.feedMappingIdFieldSpecified = value; } + } + + public long feedId { + get { return this.feedIdField; } + set { + this.feedIdField = value; + this.feedIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedIdSpecified { + get { return this.feedIdFieldSpecified; } + set { this.feedIdFieldSpecified = value; } + } + + public int placeholderType { + get { return this.placeholderTypeField; } + set { + this.placeholderTypeField = value; + this.placeholderTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool placeholderTypeSpecified { + get { return this.placeholderTypeFieldSpecified; } + set { this.placeholderTypeFieldSpecified = value; } + } + + public FeedMappingStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("attributeFieldMappings")] + public AttributeFieldMapping[] attributeFieldMappings { + get { return this.attributeFieldMappingsField; } + set { this.attributeFieldMappingsField = value; } + } + + public int criterionType { + get { return this.criterionTypeField; } + set { + this.criterionTypeField = value; + this.criterionTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionTypeSpecified { + get { return this.criterionTypeFieldSpecified; } + set { this.criterionTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedMapping.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum FeedMappingStatus { + ENABLED, + REMOVED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AttributeFieldMapping { + private long feedAttributeIdField; + + private bool feedAttributeIdFieldSpecified; + + private int fieldIdField; + + private bool fieldIdFieldSpecified; + + public long feedAttributeId { + get { return this.feedAttributeIdField; } + set { + this.feedAttributeIdField = value; + this.feedAttributeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedAttributeIdSpecified { + get { return this.feedAttributeIdFieldSpecified; } + set { this.feedAttributeIdFieldSpecified = value; } + } + + public int fieldId { + get { return this.fieldIdField; } + set { + this.fieldIdField = value; + this.fieldIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fieldIdSpecified { + get { return this.fieldIdFieldSpecified; } + set { this.fieldIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedMappingOperation : Operation { + private FeedMapping operandField; + + public FeedMapping operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedMappingPage : NullStatsPage { + private FeedMapping[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public FeedMapping[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class FeedMappingError : ApiError { + private FeedMappingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FeedMappingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeedMappingError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum FeedMappingErrorReason { + INVALID_PLACEHOLDER_FIELD, + INVALID_CRITERION_FIELD, + INVALID_PLACEHOLDER_TYPE, + INVALID_CRITERION_TYPE, + CANNOT_SET_PLACEHOLDER_TYPE_AND_CRITERION_TYPE, + NO_ATTRIBUTE_FIELD_MAPPINGS, + FEED_ATTRIBUTE_TYPE_MISMATCH, + CANNOT_OPERATE_ON_MAPPINGS_FOR_SYSTEM_GENERATED_FEED, + MULTIPLE_MAPPINGS_FOR_PLACEHOLDER_TYPE, + MULTIPLE_MAPPINGS_FOR_CRITERION_TYPE, + UNEXPECTED_ATTRIBUTE_FIELD_MAPPINGS, + LOCATION_PLACEHOLDER_ONLY_FOR_PLACES_FEEDS, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "GeoLocationServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class GeoLocationService : AdWordsSoapClient, IGeoLocationService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public GeoLocationService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/GeoLocationService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual GeoLocation[] get(GeoLocationSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((GeoLocation[]) (results[0])); + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidGeoLocation))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class GeoLocation { + private GeoPoint geoPointField; + + private Address addressField; + + private byte[] encodedLocationField; + + private string geoLocationTypeField; + + public GeoPoint geoPoint { + get { return this.geoPointField; } + set { this.geoPointField = value; } + } + + public Address address { + get { return this.addressField; } + set { this.addressField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] encodedLocation { + get { return this.encodedLocationField; } + set { this.encodedLocationField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("GeoLocation.Type")] + public string GeoLocationType { + get { return this.geoLocationTypeField; } + set { this.geoLocationTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class InvalidGeoLocation : GeoLocation { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class GeoLocationSelector { + private Address[] addressesField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("addresses")] + public Address[] addresses { + get { return this.addressesField; } + set { this.addressesField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class GeoLocationError : ApiError { + private GeoLocationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public GeoLocationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GeoLocationError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum GeoLocationErrorReason { + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LocationCriterionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Criterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LocationCriterionService : AdWordsSoapClient, ILocationCriterionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LocationCriterionService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/LocationCriterionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LocationCriterion[] get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((LocationCriterion[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LocationCriterion[] query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((LocationCriterion[]) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class LocationCriterion { + private Location locationField; + + private string canonicalNameField; + + private long reachField; + + private bool reachFieldSpecified; + + private string localeField; + + private string searchTermField; + + private string countryCodeField; + + public Location location { + get { return this.locationField; } + set { this.locationField = value; } + } + + public string canonicalName { + get { return this.canonicalNameField; } + set { this.canonicalNameField = value; } + } + + public long reach { + get { return this.reachField; } + set { + this.reachField = value; + this.reachSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reachSpecified { + get { return this.reachFieldSpecified; } + set { this.reachFieldSpecified = value; } + } + + public string locale { + get { return this.localeField; } + set { this.localeField = value; } + } + + public string searchTerm { + get { return this.searchTermField; } + set { this.searchTermField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Date { + private int yearField; + + private bool yearFieldSpecified; + + private int monthField; + + private bool monthFieldSpecified; + + private int dayField; + + private bool dayFieldSpecified; + + public int year { + get { return this.yearField; } + set { + this.yearField = value; + this.yearSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool yearSpecified { + get { return this.yearFieldSpecified; } + set { this.yearFieldSpecified = value; } + } + + public int month { + get { return this.monthField; } + set { + this.monthField = value; + this.monthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool monthSpecified { + get { return this.monthFieldSpecified; } + set { this.monthFieldSpecified = value; } + } + + public int day { + get { return this.dayField; } + set { + this.dayField = value; + this.daySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool daySpecified { + get { return this.dayFieldSpecified; } + set { this.dayFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class LocationCriterionServiceError : ApiError { + private LocationCriterionServiceErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LocationCriterionServiceErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LocationCriterionServiceError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum LocationCriterionServiceErrorReason { + REQUIRED_LOCATION_CRITERION_PREDICATE_MISSING, + TOO_MANY_LOCATION_CRITERION_PREDICATES_SPECIFIED, + INVALID_COUNTRY_CODE, + LOCATION_CRITERION_SERVICE_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ManagedCustomerServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ManagedCustomerService : AdWordsSoapClient, IManagedCustomerService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ManagedCustomerService() { + this.Url = "https://adwords.google.com/api/adwords/mcm/v201406/ManagedCustomerService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ManagedCustomerPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((ManagedCustomerPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual PendingInvitation[] getPendingInvitations(PendingInvitationSelector selector) { + object[] results = this.Invoke("getPendingInvitations", new object[] { selector }); + return ((PendingInvitation[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ManagedCustomerReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +ManagedCustomerOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((ManagedCustomerReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlArrayAttribute("rval")] + [return: System.Xml.Serialization.XmlArrayItemAttribute("links", IsNullable = false)] + public virtual ManagedCustomerLink[] mutateLink([System.Xml.Serialization.XmlElementAttribute("operations")] +LinkOperation[] operations) { + object[] results = this.Invoke("mutateLink", new object[] { operations }); + return ((ManagedCustomerLink[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlArrayAttribute("rval")] + [return: System.Xml.Serialization.XmlArrayItemAttribute("links", IsNullable = false)] + public virtual ManagedCustomerLink[] mutateManager([System.Xml.Serialization.XmlElementAttribute("operations")] +MoveOperation[] operations) { + object[] results = this.Invoke("mutateManager", new object[] { operations }); + return ((ManagedCustomerLink[]) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public partial class ManagedCustomerReturnValue { + private ManagedCustomer[] valueField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public ManagedCustomer[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public partial class ManagedCustomer { + private string nameField; + + private string loginField; + + private string companyNameField; + + private long customerIdField; + + private bool customerIdFieldSpecified; + + private bool canManageClientsField; + + private bool canManageClientsFieldSpecified; + + private string currencyCodeField; + + private string dateTimeZoneField; + + private bool testAccountField; + + private bool testAccountFieldSpecified; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string login { + get { return this.loginField; } + set { this.loginField = value; } + } + + public string companyName { + get { return this.companyNameField; } + set { this.companyNameField = value; } + } + + public long customerId { + get { return this.customerIdField; } + set { + this.customerIdField = value; + this.customerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customerIdSpecified { + get { return this.customerIdFieldSpecified; } + set { this.customerIdFieldSpecified = value; } + } + + public bool canManageClients { + get { return this.canManageClientsField; } + set { + this.canManageClientsField = value; + this.canManageClientsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool canManageClientsSpecified { + get { return this.canManageClientsFieldSpecified; } + set { this.canManageClientsFieldSpecified = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public string dateTimeZone { + get { return this.dateTimeZoneField; } + set { this.dateTimeZoneField = value; } + } + + public bool testAccount { + get { return this.testAccountField; } + set { + this.testAccountField = value; + this.testAccountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool testAccountSpecified { + get { return this.testAccountFieldSpecified; } + set { this.testAccountFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public partial class ManagedCustomerOperation : Operation { + private ManagedCustomer operandField; + + public ManagedCustomer operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public partial class MoveOperation : Operation { + private ManagedCustomerLink operandField; + + private long oldManagerCustomerIdField; + + private bool oldManagerCustomerIdFieldSpecified; + + public ManagedCustomerLink operand { + get { return this.operandField; } + set { this.operandField = value; } + } + + public long oldManagerCustomerId { + get { return this.oldManagerCustomerIdField; } + set { + this.oldManagerCustomerIdField = value; + this.oldManagerCustomerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool oldManagerCustomerIdSpecified { + get { return this.oldManagerCustomerIdFieldSpecified; } + set { this.oldManagerCustomerIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public partial class ManagedCustomerLink { + private long managerCustomerIdField; + + private bool managerCustomerIdFieldSpecified; + + private long clientCustomerIdField; + + private bool clientCustomerIdFieldSpecified; + + private LinkStatus linkStatusField; + + private bool linkStatusFieldSpecified; + + private string pendingDescriptiveNameField; + + public long managerCustomerId { + get { return this.managerCustomerIdField; } + set { + this.managerCustomerIdField = value; + this.managerCustomerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool managerCustomerIdSpecified { + get { return this.managerCustomerIdFieldSpecified; } + set { this.managerCustomerIdFieldSpecified = value; } + } + + public long clientCustomerId { + get { return this.clientCustomerIdField; } + set { + this.clientCustomerIdField = value; + this.clientCustomerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clientCustomerIdSpecified { + get { return this.clientCustomerIdFieldSpecified; } + set { this.clientCustomerIdFieldSpecified = value; } + } + + public LinkStatus linkStatus { + get { return this.linkStatusField; } + set { + this.linkStatusField = value; + this.linkStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool linkStatusSpecified { + get { return this.linkStatusFieldSpecified; } + set { this.linkStatusFieldSpecified = value; } + } + + public string pendingDescriptiveName { + get { return this.pendingDescriptiveNameField; } + set { this.pendingDescriptiveNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public enum LinkStatus { + ACTIVE, + INACTIVE, + PENDING, + REFUSED, + CANCELLED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public partial class LinkOperation : Operation { + private ManagedCustomerLink operandField; + + public ManagedCustomerLink operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public partial class PendingInvitation { + private ManagedCustomer managerField; + + private ManagedCustomer clientField; + + private string creationDateField; + + private string expirationDateField; + + public ManagedCustomer manager { + get { return this.managerField; } + set { this.managerField = value; } + } + + public ManagedCustomer client { + get { return this.clientField; } + set { this.clientField = value; } + } + + public string creationDate { + get { return this.creationDateField; } + set { this.creationDateField = value; } + } + + public string expirationDate { + get { return this.expirationDateField; } + set { this.expirationDateField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public partial class PendingInvitationSelector { + private long[] managerCustomerIdsField; + + private long[] clientCustomerIdsField; + + [System.Xml.Serialization.XmlElementAttribute("managerCustomerIds")] + public long[] managerCustomerIds { + get { return this.managerCustomerIdsField; } + set { this.managerCustomerIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("clientCustomerIds")] + public long[] clientCustomerIds { + get { return this.clientCustomerIdsField; } + set { this.clientCustomerIdsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public partial class ManagedCustomerPage : Page { + private ManagedCustomer[] entriesField; + + private ManagedCustomerLink[] linksField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public ManagedCustomer[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("links")] + public ManagedCustomerLink[] links { + get { return this.linksField; } + set { this.linksField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public partial class ManagedCustomerServiceError : ApiError { + private ManagedCustomerServiceErrorReason reasonField; + + private bool reasonFieldSpecified; + + private long[] customerIdsField; + + public ManagedCustomerServiceErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customerIds")] + public long[] customerIds { + get { return this.customerIdsField; } + set { this.customerIdsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ManagedCustomerServiceError.Reason", Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public enum ManagedCustomerServiceErrorReason { + UNKNOWN, + NOT_AUTHORIZED, + INVALID_SELECTOR, + INVALID_TIMEZONE, + INVALID_CURRENCY, + INVALID_DESCRIPTIVE_NAME, + ADD_CUSTOMER_FAILURE, + SAVE_CUSTOMERS_FAILURE, + ALREADY_MANAGED_BY_THIS_MANAGER, + ALREADY_INVITED_BY_THIS_MANAGER, + NO_PENDING_INVITATION, + TEST_ACCOUNT_LINK_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "MediaServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class MediaService : AdWordsSoapClient, IMediaService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public MediaService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/MediaService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual MediaPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((MediaPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual MediaPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((MediaPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Media[] upload([System.Xml.Serialization.XmlElementAttribute("media")] +Media[] media) { + object[] results = this.Invoke("upload", new object[] { media }); + return ((Media[]) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class MediaPage { + private Media[] entriesField; + + private int totalNumEntriesField; + + private bool totalNumEntriesFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Media[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + + public int totalNumEntries { + get { return this.totalNumEntriesField; } + set { + this.totalNumEntriesField = value; + this.totalNumEntriesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalNumEntriesSpecified { + get { return this.totalNumEntriesFieldSpecified; } + set { this.totalNumEntriesFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class VideoError : ApiError { + private VideoErrorReason reasonField; + + private bool reasonFieldSpecified; + + public VideoErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum VideoErrorReason { + INVALID_VIDEO, + STORAGE_ERROR, + BAD_REQUEST, + ERROR_GENERATING_STREAMING_URL, + UNEXPECTED_SIZE, + SERVER_ERROR, + FILE_TOO_LARGE, + VIDEO_PROCESSING_ERROR, + INVALID_INPUT, + PROBLEM_READING_FILE, + INVALID_ISCI, + INVALID_AD_ID + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AudioError : ApiError { + private AudioErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AudioErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudioError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AudioErrorReason { + INVALID_AUDIO, + PROBLEM_READING_AUDIO_FILE, + ERROR_STORING_AUDIO, + FILE_TOO_LARGE, + UNSUPPORTED_AUDIO, + ERROR_GENERATING_STREAMING_URL + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "MutateJobServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class MutateJobService : AdWordsSoapClient, IMutateJobService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public MutateJobService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/MutateJobService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Job[] get(JobSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((Job[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual JobResult getResult(JobSelector selector) { + object[] results = this.Invoke("getResult", new object[] { selector }); + return ((JobResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SimpleMutateJob mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +Operation[] operations, BulkMutateJobPolicy policy) { + object[] results = this.Invoke("mutate", new object[] { operations, policy }); + return ((SimpleMutateJob) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class BulkMutateJobPolicy { + private long[] prerequisiteJobIdsField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("prerequisiteJobIds")] + public long[] prerequisiteJobIds { + get { return this.prerequisiteJobIdsField; } + set { this.prerequisiteJobIdsField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Webpage : Criterion { + private WebpageParameter parameterField; + + private double criteriaCoverageField; + + private bool criteriaCoverageFieldSpecified; + + private string[] criteriaSamplesField; + + public WebpageParameter parameter { + get { return this.parameterField; } + set { this.parameterField = value; } + } + + public double criteriaCoverage { + get { return this.criteriaCoverageField; } + set { + this.criteriaCoverageField = value; + this.criteriaCoverageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criteriaCoverageSpecified { + get { return this.criteriaCoverageFieldSpecified; } + set { this.criteriaCoverageFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("criteriaSamples")] + public string[] criteriaSamples { + get { return this.criteriaSamplesField; } + set { this.criteriaSamplesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class WebpageParameter : CriterionParameter { + private string criterionNameField; + + private WebpageCondition[] conditionsField; + + public string criterionName { + get { return this.criterionNameField; } + set { this.criterionNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("conditions")] + public WebpageCondition[] conditions { + get { return this.conditionsField; } + set { this.conditionsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class WebpageCondition { + private WebpageConditionOperand operandField; + + private bool operandFieldSpecified; + + private string argumentField; + + public WebpageConditionOperand operand { + get { return this.operandField; } + set { + this.operandField = value; + this.operandSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operandSpecified { + get { return this.operandFieldSpecified; } + set { this.operandFieldSpecified = value; } + } + + public string argument { + get { return this.argumentField; } + set { this.argumentField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum WebpageConditionOperand { + URL, + CATEGORY, + PAGE_TITLE, + PAGE_CONTENT, + UNKNOWN + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WebpageParameter))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public abstract partial class CriterionParameter { + private string criterionParameterTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CriterionParameter.Type")] + public string CriterionParameterType { + get { return this.criterionParameterTypeField; } + set { this.criterionParameterTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ProductPartition : Criterion { + private ProductPartitionType partitionTypeField; + + private bool partitionTypeFieldSpecified; + + private long parentCriterionIdField; + + private bool parentCriterionIdFieldSpecified; + + private ProductDimension caseValueField; + + public ProductPartitionType partitionType { + get { return this.partitionTypeField; } + set { + this.partitionTypeField = value; + this.partitionTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool partitionTypeSpecified { + get { return this.partitionTypeFieldSpecified; } + set { this.partitionTypeFieldSpecified = value; } + } + + public long parentCriterionId { + get { return this.parentCriterionIdField; } + set { + this.parentCriterionIdField = value; + this.parentCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool parentCriterionIdSpecified { + get { return this.parentCriterionIdFieldSpecified; } + set { this.parentCriterionIdFieldSpecified = value; } + } + + public ProductDimension caseValue { + get { return this.caseValueField; } + set { this.caseValueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ProductPartitionType { + UNKNOWN, + SUBDIVISION, + UNIT + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignTargetOperation : Operation { + private TargetList operandField; + + public TargetList operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdScheduleTargetList))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public abstract partial class TargetList { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private string targetListTypeField; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("TargetList.Type")] + public string TargetListType { + get { return this.targetListTypeField; } + set { this.targetListTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdScheduleTargetList : TargetList { + private AdScheduleTarget[] targetsField; + + [System.Xml.Serialization.XmlElementAttribute("targets")] + public AdScheduleTarget[] targets { + get { return this.targetsField; } + set { this.targetsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdScheduleTarget : Target { + private DayOfWeek dayOfWeekField; + + private bool dayOfWeekFieldSpecified; + + private int startHourField; + + private bool startHourFieldSpecified; + + private MinuteOfHour startMinuteField; + + private bool startMinuteFieldSpecified; + + private int endHourField; + + private bool endHourFieldSpecified; + + private MinuteOfHour endMinuteField; + + private bool endMinuteFieldSpecified; + + private double bidMultiplierField; + + private bool bidMultiplierFieldSpecified; + + public DayOfWeek dayOfWeek { + get { return this.dayOfWeekField; } + set { + this.dayOfWeekField = value; + this.dayOfWeekSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dayOfWeekSpecified { + get { return this.dayOfWeekFieldSpecified; } + set { this.dayOfWeekFieldSpecified = value; } + } + + public int startHour { + get { return this.startHourField; } + set { + this.startHourField = value; + this.startHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startHourSpecified { + get { return this.startHourFieldSpecified; } + set { this.startHourFieldSpecified = value; } + } + + public MinuteOfHour startMinute { + get { return this.startMinuteField; } + set { + this.startMinuteField = value; + this.startMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startMinuteSpecified { + get { return this.startMinuteFieldSpecified; } + set { this.startMinuteFieldSpecified = value; } + } + + public int endHour { + get { return this.endHourField; } + set { + this.endHourField = value; + this.endHourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endHourSpecified { + get { return this.endHourFieldSpecified; } + set { this.endHourFieldSpecified = value; } + } + + public MinuteOfHour endMinute { + get { return this.endMinuteField; } + set { + this.endMinuteField = value; + this.endMinuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool endMinuteSpecified { + get { return this.endMinuteFieldSpecified; } + set { this.endMinuteFieldSpecified = value; } + } + + public double bidMultiplier { + get { return this.bidMultiplierField; } + set { + this.bidMultiplierField = value; + this.bidMultiplierSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidMultiplierSpecified { + get { return this.bidMultiplierFieldSpecified; } + set { this.bidMultiplierFieldSpecified = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdScheduleTarget))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public abstract partial class Target { + private string targetTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Target.Type")] + public string TargetType { + get { return this.targetTypeField; } + set { this.targetTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class TargetingSetting : Setting { + private TargetingSettingDetail[] detailsField; + + [System.Xml.Serialization.XmlElementAttribute("details")] + public TargetingSettingDetail[] details { + get { return this.detailsField; } + set { this.detailsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class TargetingSettingDetail { + private CriterionTypeGroup criterionTypeGroupField; + + private bool criterionTypeGroupFieldSpecified; + + private bool targetAllField; + + private bool targetAllFieldSpecified; + + public CriterionTypeGroup criterionTypeGroup { + get { return this.criterionTypeGroupField; } + set { + this.criterionTypeGroupField = value; + this.criterionTypeGroupSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionTypeGroupSpecified { + get { return this.criterionTypeGroupFieldSpecified; } + set { this.criterionTypeGroupFieldSpecified = value; } + } + + public bool targetAll { + get { return this.targetAllField; } + set { + this.targetAllField = value; + this.targetAllSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetAllSpecified { + get { return this.targetAllFieldSpecified; } + set { this.targetAllFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum CriterionTypeGroup { + KEYWORD, + USER_INTEREST_AND_LIST, + VERTICAL, + GENDER, + AGE_RANGE, + PLACEMENT, + NONE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ExplorerAutoOptimizerSetting : Setting { + private bool optInField; + + private bool optInFieldSpecified; + + public bool optIn { + get { return this.optInField; } + set { + this.optInField = value; + this.optInSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool optInSpecified { + get { return this.optInFieldSpecified; } + set { this.optInFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupOperation : Operation { + private AdGroup operandField; + + public AdGroup operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroup { + private long idField; + + private bool idFieldSpecified; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private string campaignNameField; + + private string nameField; + + private AdGroupStatus statusField; + + private bool statusFieldSpecified; + + private Setting[] settingsField; + + private AdGroupExperimentData experimentDataField; + + private Label[] labelsField; + + private String_StringMapEntry[] forwardCompatibilityMapField; + + private BiddingStrategyConfiguration biddingStrategyConfigurationField; + + private CriterionTypeGroup contentBidCriterionTypeGroupField; + + private bool contentBidCriterionTypeGroupFieldSpecified; + + private string trackingUrlTemplateField; + + private CustomParameters urlCustomParametersField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public string campaignName { + get { return this.campaignNameField; } + set { this.campaignNameField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public AdGroupStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("settings")] + public Setting[] settings { + get { return this.settingsField; } + set { this.settingsField = value; } + } + + public AdGroupExperimentData experimentData { + get { return this.experimentDataField; } + set { this.experimentDataField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("labels")] + public Label[] labels { + get { return this.labelsField; } + set { this.labelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("forwardCompatibilityMap")] + public String_StringMapEntry[] forwardCompatibilityMap { + get { return this.forwardCompatibilityMapField; } + set { this.forwardCompatibilityMapField = value; } + } + + public BiddingStrategyConfiguration biddingStrategyConfiguration { + get { return this.biddingStrategyConfigurationField; } + set { this.biddingStrategyConfigurationField = value; } + } + + public CriterionTypeGroup contentBidCriterionTypeGroup { + get { return this.contentBidCriterionTypeGroupField; } + set { + this.contentBidCriterionTypeGroupField = value; + this.contentBidCriterionTypeGroupSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contentBidCriterionTypeGroupSpecified { + get { return this.contentBidCriterionTypeGroupFieldSpecified; } + set { this.contentBidCriterionTypeGroupFieldSpecified = value; } + } + + public string trackingUrlTemplate { + get { return this.trackingUrlTemplateField; } + set { this.trackingUrlTemplateField = value; } + } + + public CustomParameters urlCustomParameters { + get { return this.urlCustomParametersField; } + set { this.urlCustomParametersField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroup.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AdGroupStatus { + ENABLED, + PAUSED, + REMOVED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupExperimentData { + private long experimentIdField; + + private bool experimentIdFieldSpecified; + + private ExperimentDeltaStatus experimentDeltaStatusField; + + private bool experimentDeltaStatusFieldSpecified; + + private ExperimentDataStatus experimentDataStatusField; + + private bool experimentDataStatusFieldSpecified; + + private AdGroupExperimentBidMultipliers experimentBidMultipliersField; + + public long experimentId { + get { return this.experimentIdField; } + set { + this.experimentIdField = value; + this.experimentIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentIdSpecified { + get { return this.experimentIdFieldSpecified; } + set { this.experimentIdFieldSpecified = value; } + } + + public ExperimentDeltaStatus experimentDeltaStatus { + get { return this.experimentDeltaStatusField; } + set { + this.experimentDeltaStatusField = value; + this.experimentDeltaStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentDeltaStatusSpecified { + get { return this.experimentDeltaStatusFieldSpecified; } + set { this.experimentDeltaStatusFieldSpecified = value; } + } + + public ExperimentDataStatus experimentDataStatus { + get { return this.experimentDataStatusField; } + set { + this.experimentDataStatusField = value; + this.experimentDataStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentDataStatusSpecified { + get { return this.experimentDataStatusFieldSpecified; } + set { this.experimentDataStatusFieldSpecified = value; } + } + + public AdGroupExperimentBidMultipliers experimentBidMultipliers { + get { return this.experimentBidMultipliersField; } + set { this.experimentBidMultipliersField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManualCPMAdGroupExperimentBidMultipliers))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManualCPCAdGroupExperimentBidMultipliers))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public abstract partial class AdGroupExperimentBidMultipliers { + private string adGroupExperimentBidMultipliersTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AdGroupExperimentBidMultipliers.Type")] + public string AdGroupExperimentBidMultipliersType { + get { return this.adGroupExperimentBidMultipliersTypeField; } + set { this.adGroupExperimentBidMultipliersTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ManualCPMAdGroupExperimentBidMultipliers : AdGroupExperimentBidMultipliers { + private BidMultiplier maxCpmMultiplierField; + + public BidMultiplier maxCpmMultiplier { + get { return this.maxCpmMultiplierField; } + set { this.maxCpmMultiplierField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class BidMultiplier { + private double multiplierField; + + private bool multiplierFieldSpecified; + + private Bid multipliedBidField; + + public double multiplier { + get { return this.multiplierField; } + set { + this.multiplierField = value; + this.multiplierSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool multiplierSpecified { + get { return this.multiplierFieldSpecified; } + set { this.multiplierFieldSpecified = value; } + } + + public Bid multipliedBid { + get { return this.multipliedBidField; } + set { this.multipliedBidField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Bid { + private Money amountField; + + public Money amount { + get { return this.amountField; } + set { this.amountField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ManualCPCAdGroupExperimentBidMultipliers : AdGroupExperimentBidMultipliers { + private BidMultiplier maxCpcMultiplierField; + + private BidMultiplier maxContentCpcMultiplierField; + + public BidMultiplier maxCpcMultiplier { + get { return this.maxCpcMultiplierField; } + set { this.maxCpcMultiplierField = value; } + } + + public BidMultiplier maxContentCpcMultiplier { + get { return this.maxContentCpcMultiplierField; } + set { this.maxContentCpcMultiplierField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupLabelOperation : Operation { + private AdGroupLabel operandField; + + public AdGroupLabel operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupLabel { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private long labelIdField; + + private bool labelIdFieldSpecified; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupCriterionOperation : Operation { + private AdGroupCriterion operandField; + + private ExemptionRequest[] exemptionRequestsField; + + public AdGroupCriterion operand { + get { return this.operandField; } + set { this.operandField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("exemptionRequests")] + public ExemptionRequest[] exemptionRequests { + get { return this.exemptionRequestsField; } + set { this.exemptionRequestsField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NegativeAdGroupCriterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BiddableAdGroupCriterion))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupCriterion { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private CriterionUse criterionUseField; + + private bool criterionUseFieldSpecified; + + private Criterion criterionField; + + private Label[] labelsField; + + private String_StringMapEntry[] forwardCompatibilityMapField; + + private string adGroupCriterionTypeField; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public CriterionUse criterionUse { + get { return this.criterionUseField; } + set { + this.criterionUseField = value; + this.criterionUseSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionUseSpecified { + get { return this.criterionUseFieldSpecified; } + set { this.criterionUseFieldSpecified = value; } + } + + public Criterion criterion { + get { return this.criterionField; } + set { this.criterionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("labels")] + public Label[] labels { + get { return this.labelsField; } + set { this.labelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("forwardCompatibilityMap")] + public String_StringMapEntry[] forwardCompatibilityMap { + get { return this.forwardCompatibilityMapField; } + set { this.forwardCompatibilityMapField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("AdGroupCriterion.Type")] + public string AdGroupCriterionType { + get { return this.adGroupCriterionTypeField; } + set { this.adGroupCriterionTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum CriterionUse { + BIDDABLE, + NEGATIVE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class NegativeAdGroupCriterion : AdGroupCriterion { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class BiddableAdGroupCriterion : AdGroupCriterion { + private UserStatus userStatusField; + + private bool userStatusFieldSpecified; + + private SystemServingStatus systemServingStatusField; + + private bool systemServingStatusFieldSpecified; + + private ApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + private string[] disapprovalReasonsField; + + private string destinationUrlField; + + private BiddableAdGroupCriterionExperimentData experimentDataField; + + private Bid firstPageCpcField; + + private Bid topOfPageCpcField; + + private QualityInfo qualityInfoField; + + private BiddingStrategyConfiguration biddingStrategyConfigurationField; + + private double bidModifierField; + + private bool bidModifierFieldSpecified; + + private UrlList finalUrlsField; + + private UrlList finalMobileUrlsField; + + private string trackingUrlTemplateField; + + private CustomParameters urlCustomParametersField; + + public UserStatus userStatus { + get { return this.userStatusField; } + set { + this.userStatusField = value; + this.userStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userStatusSpecified { + get { return this.userStatusFieldSpecified; } + set { this.userStatusFieldSpecified = value; } + } + + public SystemServingStatus systemServingStatus { + get { return this.systemServingStatusField; } + set { + this.systemServingStatusField = value; + this.systemServingStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool systemServingStatusSpecified { + get { return this.systemServingStatusFieldSpecified; } + set { this.systemServingStatusFieldSpecified = value; } + } + + public ApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("disapprovalReasons")] + public string[] disapprovalReasons { + get { return this.disapprovalReasonsField; } + set { this.disapprovalReasonsField = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + public BiddableAdGroupCriterionExperimentData experimentData { + get { return this.experimentDataField; } + set { this.experimentDataField = value; } + } + + public Bid firstPageCpc { + get { return this.firstPageCpcField; } + set { this.firstPageCpcField = value; } + } + + public Bid topOfPageCpc { + get { return this.topOfPageCpcField; } + set { this.topOfPageCpcField = value; } + } + + public QualityInfo qualityInfo { + get { return this.qualityInfoField; } + set { this.qualityInfoField = value; } + } + + public BiddingStrategyConfiguration biddingStrategyConfiguration { + get { return this.biddingStrategyConfigurationField; } + set { this.biddingStrategyConfigurationField = value; } + } + + public double bidModifier { + get { return this.bidModifierField; } + set { + this.bidModifierField = value; + this.bidModifierSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidModifierSpecified { + get { return this.bidModifierFieldSpecified; } + set { this.bidModifierFieldSpecified = value; } + } + + public UrlList finalUrls { + get { return this.finalUrlsField; } + set { this.finalUrlsField = value; } + } + + public UrlList finalMobileUrls { + get { return this.finalMobileUrlsField; } + set { this.finalMobileUrlsField = value; } + } + + public string trackingUrlTemplate { + get { return this.trackingUrlTemplateField; } + set { this.trackingUrlTemplateField = value; } + } + + public CustomParameters urlCustomParameters { + get { return this.urlCustomParametersField; } + set { this.urlCustomParametersField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum UserStatus { + ENABLED, + REMOVED, + PAUSED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum SystemServingStatus { + ELIGIBLE, + RARELY_SERVED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ApprovalStatus { + APPROVED, + PENDING_REVIEW, + UNDER_REVIEW, + DISAPPROVED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class BiddableAdGroupCriterionExperimentData { + private long experimentIdField; + + private bool experimentIdFieldSpecified; + + private ExperimentDeltaStatus experimentDeltaStatusField; + + private bool experimentDeltaStatusFieldSpecified; + + private ExperimentDataStatus experimentDataStatusField; + + private bool experimentDataStatusFieldSpecified; + + private AdGroupCriterionExperimentBidMultiplier experimentBidMultiplierField; + + public long experimentId { + get { return this.experimentIdField; } + set { + this.experimentIdField = value; + this.experimentIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentIdSpecified { + get { return this.experimentIdFieldSpecified; } + set { this.experimentIdFieldSpecified = value; } + } + + public ExperimentDeltaStatus experimentDeltaStatus { + get { return this.experimentDeltaStatusField; } + set { + this.experimentDeltaStatusField = value; + this.experimentDeltaStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentDeltaStatusSpecified { + get { return this.experimentDeltaStatusFieldSpecified; } + set { this.experimentDeltaStatusFieldSpecified = value; } + } + + public ExperimentDataStatus experimentDataStatus { + get { return this.experimentDataStatusField; } + set { + this.experimentDataStatusField = value; + this.experimentDataStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool experimentDataStatusSpecified { + get { return this.experimentDataStatusFieldSpecified; } + set { this.experimentDataStatusFieldSpecified = value; } + } + + public AdGroupCriterionExperimentBidMultiplier experimentBidMultiplier { + get { return this.experimentBidMultiplierField; } + set { this.experimentBidMultiplierField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ManualCPCAdGroupCriterionExperimentBidMultiplier))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public abstract partial class AdGroupCriterionExperimentBidMultiplier { + private string adGroupCriterionExperimentBidMultiplierTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AdGroupCriterionExperimentBidMultiplier.Type")] + public string AdGroupCriterionExperimentBidMultiplierType { + get { return this.adGroupCriterionExperimentBidMultiplierTypeField; } + set { this.adGroupCriterionExperimentBidMultiplierTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ManualCPCAdGroupCriterionExperimentBidMultiplier : AdGroupCriterionExperimentBidMultiplier { + private BidMultiplier maxCpcMultiplierField; + + private MultiplierSource multiplierSourceField; + + private bool multiplierSourceFieldSpecified; + + public BidMultiplier maxCpcMultiplier { + get { return this.maxCpcMultiplierField; } + set { this.maxCpcMultiplierField = value; } + } + + public MultiplierSource multiplierSource { + get { return this.multiplierSourceField; } + set { + this.multiplierSourceField = value; + this.multiplierSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool multiplierSourceSpecified { + get { return this.multiplierSourceFieldSpecified; } + set { this.multiplierSourceFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum MultiplierSource { + ADGROUP, + CRITERION, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class QualityInfo { + private bool isKeywordAdRelevanceAcceptableField; + + private bool isKeywordAdRelevanceAcceptableFieldSpecified; + + private bool isLandingPageQualityAcceptableField; + + private bool isLandingPageQualityAcceptableFieldSpecified; + + private bool isLandingPageLatencyAcceptableField; + + private bool isLandingPageLatencyAcceptableFieldSpecified; + + private int qualityScoreField; + + private bool qualityScoreFieldSpecified; + + public bool isKeywordAdRelevanceAcceptable { + get { return this.isKeywordAdRelevanceAcceptableField; } + set { + this.isKeywordAdRelevanceAcceptableField = value; + this.isKeywordAdRelevanceAcceptableSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isKeywordAdRelevanceAcceptableSpecified { + get { return this.isKeywordAdRelevanceAcceptableFieldSpecified; } + set { this.isKeywordAdRelevanceAcceptableFieldSpecified = value; } + } + + public bool isLandingPageQualityAcceptable { + get { return this.isLandingPageQualityAcceptableField; } + set { + this.isLandingPageQualityAcceptableField = value; + this.isLandingPageQualityAcceptableSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isLandingPageQualityAcceptableSpecified { + get { return this.isLandingPageQualityAcceptableFieldSpecified; } + set { this.isLandingPageQualityAcceptableFieldSpecified = value; } + } + + public bool isLandingPageLatencyAcceptable { + get { return this.isLandingPageLatencyAcceptableField; } + set { + this.isLandingPageLatencyAcceptableField = value; + this.isLandingPageLatencyAcceptableSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isLandingPageLatencyAcceptableSpecified { + get { return this.isLandingPageLatencyAcceptableFieldSpecified; } + set { this.isLandingPageLatencyAcceptableFieldSpecified = value; } + } + + public int qualityScore { + get { return this.qualityScoreField; } + set { + this.qualityScoreField = value; + this.qualityScoreSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool qualityScoreSpecified { + get { return this.qualityScoreFieldSpecified; } + set { this.qualityScoreFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class UrlList { + private string[] urlsField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("urls")] + public string[] urls { + get { return this.urlsField; } + set { this.urlsField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupCriterionLabelOperation : Operation { + private AdGroupCriterionLabel operandField; + + public AdGroupCriterionLabel operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupCriterionLabel { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private long criterionIdField; + + private bool criterionIdFieldSpecified; + + private long labelIdField; + + private bool labelIdFieldSpecified; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public long criterionId { + get { return this.criterionIdField; } + set { + this.criterionIdField = value; + this.criterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionIdSpecified { + get { return this.criterionIdFieldSpecified; } + set { this.criterionIdFieldSpecified = value; } + } + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupBidModifierOperation : Operation { + private AdGroupBidModifier operandField; + + public AdGroupBidModifier operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupBidModifier { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private Criterion criterionField; + + private double bidModifierField; + + private bool bidModifierFieldSpecified; + + private BidModifierSource bidModifierSourceField; + + private bool bidModifierSourceFieldSpecified; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public Criterion criterion { + get { return this.criterionField; } + set { this.criterionField = value; } + } + + public double bidModifier { + get { return this.bidModifierField; } + set { + this.bidModifierField = value; + this.bidModifierSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidModifierSpecified { + get { return this.bidModifierFieldSpecified; } + set { this.bidModifierFieldSpecified = value; } + } + + public BidModifierSource bidModifierSource { + get { return this.bidModifierSourceField; } + set { + this.bidModifierSourceField = value; + this.bidModifierSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bidModifierSourceSpecified { + get { return this.bidModifierSourceFieldSpecified; } + set { this.bidModifierSourceFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum BidModifierSource { + UNKNOWN, + CAMPAIGN, + AD_GROUP + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class PlaceHolder { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class Operand { + private object itemField; + + [System.Xml.Serialization.XmlElementAttribute("Ad", typeof(Ad))] + [System.Xml.Serialization.XmlElementAttribute("AdGroup", typeof(AdGroup))] + [System.Xml.Serialization.XmlElementAttribute("AdGroupAd", typeof(AdGroupAd))] + [System.Xml.Serialization.XmlElementAttribute("AdGroupAdLabel", typeof(AdGroupAdLabel))] + [System.Xml.Serialization.XmlElementAttribute("AdGroupBidModifier", typeof(AdGroupBidModifier))] + [System.Xml.Serialization.XmlElementAttribute("AdGroupCriterion", typeof(AdGroupCriterion))] + [System.Xml.Serialization.XmlElementAttribute("AdGroupCriterionLabel", typeof(AdGroupCriterionLabel))] + [System.Xml.Serialization.XmlElementAttribute("AdGroupLabel", typeof(AdGroupLabel))] + [System.Xml.Serialization.XmlElementAttribute("Budget", typeof(Budget))] + [System.Xml.Serialization.XmlElementAttribute("Campaign", typeof(Campaign))] + [System.Xml.Serialization.XmlElementAttribute("CampaignAdExtension", typeof(CampaignAdExtension))] + [System.Xml.Serialization.XmlElementAttribute("CampaignCriterion", typeof(CampaignCriterion))] + [System.Xml.Serialization.XmlElementAttribute("CampaignLabel", typeof(CampaignLabel))] + [System.Xml.Serialization.XmlElementAttribute("FeedItem", typeof(FeedItem))] + [System.Xml.Serialization.XmlElementAttribute("Job", typeof(Job))] + [System.Xml.Serialization.XmlElementAttribute("Label", typeof(Label))] + [System.Xml.Serialization.XmlElementAttribute("Media", typeof(Media))] + [System.Xml.Serialization.XmlElementAttribute("PlaceHolder", typeof(PlaceHolder))] + [System.Xml.Serialization.XmlElementAttribute("Target", typeof(Target))] + [System.Xml.Serialization.XmlElementAttribute("TargetList", typeof(TargetList))] + public object Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SimpleMutateJob))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public abstract partial class Job { + private ApiErrorReason failureReasonField; + + private JobStats statsField; + + private BillingSummary billingSummaryField; + + private string jobTypeField; + + public ApiErrorReason failureReason { + get { return this.failureReasonField; } + set { this.failureReasonField = value; } + } + + public JobStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public BillingSummary billingSummary { + get { return this.billingSummaryField; } + set { this.billingSummaryField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Job.Type")] + public string JobType { + get { return this.jobTypeField; } + set { this.jobTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ApiErrorReason { + private object itemField; + + [System.Xml.Serialization.XmlElementAttribute("AdErrorReason", typeof(AdErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AdExtensionErrorReason", typeof(AdExtensionErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AdGroupAdErrorReason", typeof(AdGroupAdErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AdGroupCriterionErrorReason", typeof(AdGroupCriterionErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AdGroupServiceErrorReason", typeof(AdGroupServiceErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AdxErrorReason", typeof(AdxErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AuthenticationErrorReason", typeof(AuthenticationErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("AuthorizationErrorReason", typeof(AuthorizationErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("BetaErrorReason", typeof(BetaErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("BiddingErrorReason", typeof(BiddingErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("BiddingErrorsReason", typeof(BiddingErrorsReason))] + [System.Xml.Serialization.XmlElementAttribute("BiddingTransitionErrorReason", typeof(BiddingTransitionErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("BudgetErrorReason", typeof(BudgetErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("BulkMutateJobErrorReason", typeof(BulkMutateJobErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("CampaignAdExtensionErrorReason", typeof(CampaignAdExtensionErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("CampaignCriterionErrorReason", typeof(CampaignCriterionErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("CampaignErrorReason", typeof(CampaignErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("ClientTermsErrorReason", typeof(ClientTermsErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("CollectionSizeErrorReason", typeof(CollectionSizeErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("CriterionErrorReason", typeof(CriterionErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("DatabaseErrorReason", typeof(DatabaseErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("DateErrorReason", typeof(DateErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("DateRangeErrorReason", typeof(DateRangeErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("DistinctErrorReason", typeof(DistinctErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("EntityAccessDeniedReason", typeof(EntityAccessDeniedReason))] + [System.Xml.Serialization.XmlElementAttribute("EntityCountLimitExceededReason", typeof(EntityCountLimitExceededReason))] + [System.Xml.Serialization.XmlElementAttribute("EntityNotFoundReason", typeof(EntityNotFoundReason))] + [System.Xml.Serialization.XmlElementAttribute("ExperimentErrorReason", typeof(ExperimentErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("FeedItemErrorReason", typeof(FeedItemErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("ForwardCompatibilityErrorReason", typeof(ForwardCompatibilityErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("FunctionErrorReason", typeof(FunctionErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("FunctionParsingErrorReason", typeof(FunctionParsingErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("IdErrorReason", typeof(IdErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("ImageErrorReason", typeof(ImageErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("InternalApiErrorReason", typeof(InternalApiErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("JobErrorReason", typeof(JobErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("MediaErrorReason", typeof(MediaErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("MultiplierErrorReason", typeof(MultiplierErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("NewEntityCreationErrorReason", typeof(NewEntityCreationErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("NotEmptyErrorReason", typeof(NotEmptyErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("NullErrorReason", typeof(NullErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("OperationAccessDeniedReason", typeof(OperationAccessDeniedReason))] + [System.Xml.Serialization.XmlElementAttribute("OperatorErrorReason", typeof(OperatorErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("PagingErrorReason", typeof(PagingErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("PolicyViolationErrorReason", typeof(PolicyViolationErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("QueryErrorReason", typeof(QueryErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("QuotaCheckErrorReason", typeof(QuotaCheckErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("QuotaErrorReason", typeof(QuotaErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("RangeErrorReason", typeof(RangeErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("RateExceededErrorReason", typeof(RateExceededErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("ReadOnlyErrorReason", typeof(ReadOnlyErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("RegionCodeErrorReason", typeof(RegionCodeErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("RejectedErrorReason", typeof(RejectedErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("RequestErrorReason", typeof(RequestErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("RequiredErrorReason", typeof(RequiredErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("SelectorErrorReason", typeof(SelectorErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("SettingErrorReason", typeof(SettingErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("SizeLimitErrorReason", typeof(SizeLimitErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("StatsQueryErrorReason", typeof(StatsQueryErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("StringLengthErrorReason", typeof(StringLengthErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("TargetErrorReason", typeof(TargetErrorReason))] + [System.Xml.Serialization.XmlElementAttribute("UrlErrorReason", typeof(UrlErrorReason))] + public object Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupCriterionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AdGroupCriterionErrorReason { + AD_GROUP_CRITERION_LABEL_DOES_NOT_EXIST, + AD_GROUP_CRITERION_LABEL_ALREADY_EXISTS, + CANNOT_ADD_LABEL_TO_NEGATIVE_CRITERION, + TOO_MANY_OPERTAIONS, + CANT_UPDATE_NEGATIVE, + CONCRETE_TYPE_REQUIRED, + BID_INCOMPATIBLE_WITH_ADGROUP, + CANNOT_TARGET_AND_EXCLUDE, + ILLEGAL_URL, + INVALID_KEYWORD_TEXT, + INVALID_DESTINATION_URL, + MISSING_DESTINATION_URL_TAG, + KEYWORD_LEVEL_BID_NOT_SUPPORTED_FOR_MANUALCPM, + INVALID_USER_STATUS, + CANNOT_ADD_CRITERIA_TYPE, + CANNOT_EXCLUDE_CRITERIA_TYPE, + INVALID_PRODUCT_PARTITION_HIERARCHY, + PRODUCT_PARTITION_UNIT_CANNOT_HAVE_CHILDREN, + PRODUCT_PARTITION_SUBDIVISION_REQUIRES_OTHERS_CASE, + PRODUCT_PARTITION_REQUIRES_SAME_DIMENSION_TYPE_AS_SIBLINGS, + PRODUCT_PARTITION_ALREADY_EXISTS, + PRODUCT_PARTITION_DOES_NOT_EXIST, + PRODUCT_PARTITION_CANNOT_BE_REMOVED, + INVALID_PRODUCT_PARTITION_TYPE, + PRODUCT_PARTITION_ADD_MAY_ONLY_USE_TEMP_ID, + OPERATIONS_FOR_TOO_MANY_SHOPPING_ADGROUPS, + CANNOT_MODIFY_URL_FIELDS_WITH_DUPLICATE_ELEMENTS, + CANNOT_SET_WITHOUT_FINAL_URLS, + CANNOT_CLEAR_FINAL_URLS_IF_FINAL_MOBILE_URLS_EXIST, + CANNOT_CLEAR_FINAL_URLS_IF_TRACKING_URL_TEMPLATE_EXISTS, + CANNOT_CLEAR_FINAL_URLS_IF_URL_CUSTOM_PARAMETERS_EXIST, + CANNOT_SET_BOTH_DESTINATION_URL_AND_FINAL_URLS, + FINAL_URLS_NOT_SUPPORTED_FOR_CRITERION_TYPE, + FINAL_MOBILE_URLS_NOT_SUPPORTED_FOR_CRITERION_TYPE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupServiceError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AdGroupServiceErrorReason { + DUPLICATE_ADGROUP_NAME, + INVALID_ADGROUP_NAME, + USE_SET_OPERATOR_AND_MARK_STATUS_TO_REMOVED, + ADVERTISER_NOT_ON_CONTENT_NETWORK, + BID_TOO_BIG, + BID_TYPE_AND_BIDDING_STRATEGY_MISMATCH, + MISSING_ADGROUP_NAME, + ADGROUP_LABEL_DOES_NOT_EXIST, + ADGROUP_LABEL_ALREADY_EXISTS, + INVALID_CONTENT_BID_CRITERION_TYPE_GROUP + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BetaError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum BetaErrorReason { + BETA_FEATURE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BulkMutateJobError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum BulkMutateJobErrorReason { + CAN_RETURN_RESULT_FOR_ONLY_COMPLETED_JOBS, + CAN_RETURN_RESULT_FOR_ONLY_ONE_JOB, + CANNOT_UPDATE_JOB_ONCE_ALL_REQUEST_PARTS_ARE_RECEIVED, + INVALID_SCOPING_ENTITY_TYPE, + MISSING_SCOPING_ENTITY_FOR_OPERATION_STREAM, + MORE_THAN_ONE_SCOPING_ENTITY_TYPE, + PAYLOAD_STORE_UNAVAILABLE, + REQUEST_PART_IS_OUT_OF_ORDER, + TOO_MANY_OPERATION_STREAMS_IN_REQUEST_PART, + TOO_MANY_OPERATIONS_IN_JOB, + TOO_MANY_OPERATIONS_IN_REQUEST_PART, + TOO_MANY_RESULTS_TO_STORE, + TOO_MANY_SCOPING_ENTITIES, + UNKNOWN, + LOST_RESULT, + UNPROCESSED_RESULT, + BATCH_FAILURE, + SERVICE_PROVIDED_NO_RESULT + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "JobError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum JobErrorReason { + DUPLICATE_JOB_KEY_FOR_CUSTOMER, + JOB_TYPE_NOT_SUPPORTED, + PREREQUISITE_JOB_FAILED, + SELECTOR_CANNOT_USE_BOTH_JOB_IDS_AND_JOB_KEYS, + TOO_LATE_TO_CANCEL_JOB, + TOO_MANY_PREREQUISITE_JOBS, + TOO_MANY_JOBS_IN_QUEUE, + USER_CANCELED_JOB, + WORKFLOW_FAILURE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "MultiplierError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum MultiplierErrorReason { + MULTIPLIER_TOO_HIGH, + MULTIPLIER_TOO_LOW, + TOO_MANY_FRACTIONAL_DIGITS, + MULTIPLIER_NOT_ALLOWED_FOR_BIDDING_STRATEGY, + MULTIPLIER_NOT_ALLOWED_WHEN_BASE_BID_IS_MISSING, + MULTIPLIER_NOT_ALLOWED_FOR_EXPERIMENT_DELTA_STATUS, + NO_MULTIPLIER_SPECIFIED, + MULTIPLIER_CAUSES_BID_TO_EXCEED_DAILY_BUDGET, + MULTIPLIER_CAUSES_BID_TO_EXCEED_MONTHLY_BUDGET, + MULTIPLIER_CAUSES_BID_TO_EXCEED_CUSTOM_BUDGET, + MULTIPLIER_CAUSES_BID_TO_EXCEED_MAX_ALLOWED_BID, + BID_LESS_THAN_MIN_ALLOWED_BID_WITH_MULTIPLIER, + MULTIPLIER_AND_BIDDING_STRATEGY_TYPE_MISMATCH, + MULTIPLIER_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PolicyViolationError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum PolicyViolationErrorReason { + POLICY_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class JobStats { + private int progressPercentField; + + private bool progressPercentFieldSpecified; + + private long pendingTimeMillisField; + + private bool pendingTimeMillisFieldSpecified; + + private long processingTimeMillisField; + + private bool processingTimeMillisFieldSpecified; + + private string jobStatsTypeField; + + public int progressPercent { + get { return this.progressPercentField; } + set { + this.progressPercentField = value; + this.progressPercentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool progressPercentSpecified { + get { return this.progressPercentFieldSpecified; } + set { this.progressPercentFieldSpecified = value; } + } + + public long pendingTimeMillis { + get { return this.pendingTimeMillisField; } + set { + this.pendingTimeMillisField = value; + this.pendingTimeMillisSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool pendingTimeMillisSpecified { + get { return this.pendingTimeMillisFieldSpecified; } + set { this.pendingTimeMillisFieldSpecified = value; } + } + + public long processingTimeMillis { + get { return this.processingTimeMillisField; } + set { + this.processingTimeMillisField = value; + this.processingTimeMillisSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool processingTimeMillisSpecified { + get { return this.processingTimeMillisFieldSpecified; } + set { this.processingTimeMillisFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("JobStats.Type")] + public string JobStatsType { + get { return this.jobStatsTypeField; } + set { this.jobStatsTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class BillingSummary { + private int numOperationsField; + + private bool numOperationsFieldSpecified; + + private long numUnitsField; + + private bool numUnitsFieldSpecified; + + public int numOperations { + get { return this.numOperationsField; } + set { + this.numOperationsField = value; + this.numOperationsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numOperationsSpecified { + get { return this.numOperationsFieldSpecified; } + set { this.numOperationsFieldSpecified = value; } + } + + public long numUnits { + get { return this.numUnitsField; } + set { + this.numUnitsField = value; + this.numUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numUnitsSpecified { + get { return this.numUnitsFieldSpecified; } + set { this.numUnitsFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class SimpleMutateJob : Job { + private long idField; + + private bool idFieldSpecified; + + private BasicJobStatus statusField; + + private bool statusFieldSpecified; + + private JobEvent[] historyField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public BasicJobStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("history")] + public JobEvent[] history { + get { return this.historyField; } + set { this.historyField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum BasicJobStatus { + COMPLETED, + PROCESSING, + FAILED, + PENDING + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class JobEvent { + private string dateTimeField; + + private string jobEventTypeField; + + public string dateTime { + get { return this.dateTimeField; } + set { this.dateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("JobEvent.Type")] + public string JobEventType { + get { return this.jobEventTypeField; } + set { this.jobEventTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class SimpleMutateResult { + private Operand[] resultsField; + + private ApiError[] errorsField; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Operand[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("errors")] + public ApiError[] errors { + get { return this.errorsField; } + set { this.errorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class JobResult { + private SimpleMutateResult itemField; + + [System.Xml.Serialization.XmlElementAttribute("SimpleMutateResult")] + public SimpleMutateResult Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BulkMutateJobSelector))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public abstract partial class JobSelector { + private bool includeHistoryField; + + private bool includeHistoryFieldSpecified; + + private bool includeStatsField; + + private bool includeStatsFieldSpecified; + + private string jobSelectorTypeField; + + public bool includeHistory { + get { return this.includeHistoryField; } + set { + this.includeHistoryField = value; + this.includeHistorySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeHistorySpecified { + get { return this.includeHistoryFieldSpecified; } + set { this.includeHistoryFieldSpecified = value; } + } + + public bool includeStats { + get { return this.includeStatsField; } + set { + this.includeStatsField = value; + this.includeStatsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeStatsSpecified { + get { return this.includeStatsFieldSpecified; } + set { this.includeStatsFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("JobSelector.Type")] + public string JobSelectorType { + get { return this.jobSelectorTypeField; } + set { this.jobSelectorTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class BulkMutateJobSelector : JobSelector { + private long[] jobIdsField; + + private int resultPartIndexField; + + private bool resultPartIndexFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("jobIds")] + public long[] jobIds { + get { return this.jobIdsField; } + set { this.jobIdsField = value; } + } + + public int resultPartIndex { + get { return this.resultPartIndexField; } + set { + this.resultPartIndexField = value; + this.resultPartIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool resultPartIndexSpecified { + get { return this.resultPartIndexFieldSpecified; } + set { this.resultPartIndexFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CriterionPolicyError : PolicyViolationError { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class MultiplierError : ApiError { + private MultiplierErrorReason reasonField; + + private bool reasonFieldSpecified; + + public MultiplierErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class JobError : ApiError { + private JobErrorReason reasonField; + + private bool reasonFieldSpecified; + + public JobErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupCriterionLimitExceeded : EntityCountLimitExceeded { + private AdGroupCriterionLimitExceededCriteriaLimitType limitTypeField; + + private bool limitTypeFieldSpecified; + + public AdGroupCriterionLimitExceededCriteriaLimitType limitType { + get { return this.limitTypeField; } + set { + this.limitTypeField = value; + this.limitTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool limitTypeSpecified { + get { return this.limitTypeFieldSpecified; } + set { this.limitTypeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupCriterionLimitExceeded.CriteriaLimitType", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AdGroupCriterionLimitExceededCriteriaLimitType { + ADGROUP_KEYWORD, + ADGROUP_WEBSITE, + ADGROUP_CRITERION, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class BulkMutateJobError : ApiError { + private BulkMutateJobErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BulkMutateJobErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupServiceError : ApiError { + private AdGroupServiceErrorReason reasonField; + + private bool reasonFieldSpecified; + + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + public AdGroupServiceErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupCriterionError : ApiError { + private AdGroupCriterionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdGroupCriterionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdGroupFeedServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdGroupFeedService : AdWordsSoapClient, IAdGroupFeedService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdGroupFeedService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/AdGroupFeedService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupFeedPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((AdGroupFeedPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupFeedReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +AdGroupFeedOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((AdGroupFeedReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupFeedPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((AdGroupFeedPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupFeedReturnValue : ListReturnValue { + private AdGroupFeed[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdGroupFeed[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupFeed { + private long feedIdField; + + private bool feedIdFieldSpecified; + + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private Function matchingFunctionField; + + private int[] placeholderTypesField; + + private AdGroupFeedStatus statusField; + + private bool statusFieldSpecified; + + public long feedId { + get { return this.feedIdField; } + set { + this.feedIdField = value; + this.feedIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool feedIdSpecified { + get { return this.feedIdFieldSpecified; } + set { this.feedIdFieldSpecified = value; } + } + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public Function matchingFunction { + get { return this.matchingFunctionField; } + set { this.matchingFunctionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("placeholderTypes")] + public int[] placeholderTypes { + get { return this.placeholderTypesField; } + set { this.placeholderTypesField = value; } + } + + public AdGroupFeedStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupFeed.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AdGroupFeedStatus { + ENABLED, + REMOVED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupFeedOperation : Operation { + private AdGroupFeed operandField; + + public AdGroupFeed operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupFeedPage : NullStatsPage { + private AdGroupFeed[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public AdGroupFeed[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupFeedError : ApiError { + private AdGroupFeedErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdGroupFeedErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdGroupFeedError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AdGroupFeedErrorReason { + FEED_ALREADY_EXISTS_FOR_PLACEHOLDER_TYPE, + INVALID_ID, + CANNOT_ADD_ALREADY_EXISTING_ADGROUP_FEED, + CANNOT_OPERATE_ON_REMOVED_ADGROUP_FEED, + INVALID_PLACEHOLDER_TYPES, + MISSING_FEEDMAPPING_FOR_PLACEHOLDER_TYPE, + NO_EXISTING_LOCATION_CUSTOMER_FEED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "OfflineConversionFeedServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class OfflineConversionFeedService : AdWordsSoapClient, IOfflineConversionFeedService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public OfflineConversionFeedService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/OfflineConversionFeedService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual OfflineConversionFeedReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +OfflineConversionFeedOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((OfflineConversionFeedReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class OfflineConversionFeedReturnValue : ListReturnValue { + private OfflineConversionFeed[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public OfflineConversionFeed[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class OfflineConversionFeed { + private string googleClickIdField; + + private string conversionNameField; + + private string conversionTimeField; + + private double conversionValueField; + + private bool conversionValueFieldSpecified; + + public string googleClickId { + get { return this.googleClickIdField; } + set { this.googleClickIdField = value; } + } + + public string conversionName { + get { return this.conversionNameField; } + set { this.conversionNameField = value; } + } + + public string conversionTime { + get { return this.conversionTimeField; } + set { this.conversionTimeField = value; } + } + + public double conversionValue { + get { return this.conversionValueField; } + set { + this.conversionValueField = value; + this.conversionValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool conversionValueSpecified { + get { return this.conversionValueFieldSpecified; } + set { this.conversionValueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class OfflineConversionFeedOperation : Operation { + private OfflineConversionFeed operandField; + + public OfflineConversionFeed operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class OfflineConversionError : ApiError { + private OfflineConversionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OfflineConversionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OfflineConversionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum OfflineConversionErrorReason { + UNPARSEABLE_GCLID, + CONVERSION_PRECEDES_CLICK, + FUTURE_CONVERSION_TIME, + EXPIRED_CLICK, + TOO_RECENT_CLICK, + INVALID_CLICK, + UNAUTHORIZED_USER, + INVALID_CONVERSION_TYPE, + CLICK_MISSING_CONVERSION_LABEL, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class MatchesRegexError : ApiError { + private MatchesRegexErrorReason reasonField; + + private bool reasonFieldSpecified; + + public MatchesRegexErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "MatchesRegexError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum MatchesRegexErrorReason { + UNKNOWN, + DOES_NOT_MATCH + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CurrencyCodeError : ApiError { + private CurrencyCodeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CurrencyCodeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CurrencyCodeError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum CurrencyCodeErrorReason { + UNSUPPORTED_CURRENCY_CODE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReportDefinitionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReportDefinitionService : AdWordsSoapClient, IReportDefinitionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReportDefinitionService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/ReportDefinitionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReportDefinitionField[] getReportFields(ReportDefinitionReportType reportType) { + object[] results = this.Invoke("getReportFields", new object[] { reportType }); + return ((ReportDefinitionField[]) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class EnumValuePair { + private string enumValueField; + + private string enumDisplayValueField; + + public string enumValue { + get { return this.enumValueField; } + set { this.enumValueField = value; } + } + + public string enumDisplayValue { + get { return this.enumDisplayValueField; } + set { this.enumDisplayValueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ReportDefinitionField { + private string fieldNameField; + + private string displayFieldNameField; + + private string xmlAttributeNameField; + + private string fieldTypeField; + + private string[] enumValuesField; + + private bool canSelectField; + + private bool canSelectFieldSpecified; + + private bool canFilterField; + + private bool canFilterFieldSpecified; + + private bool isEnumTypeField; + + private bool isEnumTypeFieldSpecified; + + private bool isBetaField; + + private bool isBetaFieldSpecified; + + private bool isZeroRowCompatibleField; + + private bool isZeroRowCompatibleFieldSpecified; + + private EnumValuePair[] enumValuePairsField; + + public string fieldName { + get { return this.fieldNameField; } + set { this.fieldNameField = value; } + } + + public string displayFieldName { + get { return this.displayFieldNameField; } + set { this.displayFieldNameField = value; } + } + + public string xmlAttributeName { + get { return this.xmlAttributeNameField; } + set { this.xmlAttributeNameField = value; } + } + + public string fieldType { + get { return this.fieldTypeField; } + set { this.fieldTypeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("enumValues")] + public string[] enumValues { + get { return this.enumValuesField; } + set { this.enumValuesField = value; } + } + + public bool canSelect { + get { return this.canSelectField; } + set { + this.canSelectField = value; + this.canSelectSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool canSelectSpecified { + get { return this.canSelectFieldSpecified; } + set { this.canSelectFieldSpecified = value; } + } + + public bool canFilter { + get { return this.canFilterField; } + set { + this.canFilterField = value; + this.canFilterSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool canFilterSpecified { + get { return this.canFilterFieldSpecified; } + set { this.canFilterFieldSpecified = value; } + } + + public bool isEnumType { + get { return this.isEnumTypeField; } + set { + this.isEnumTypeField = value; + this.isEnumTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isEnumTypeSpecified { + get { return this.isEnumTypeFieldSpecified; } + set { this.isEnumTypeFieldSpecified = value; } + } + + public bool isBeta { + get { return this.isBetaField; } + set { + this.isBetaField = value; + this.isBetaSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isBetaSpecified { + get { return this.isBetaFieldSpecified; } + set { this.isBetaFieldSpecified = value; } + } + + public bool isZeroRowCompatible { + get { return this.isZeroRowCompatibleField; } + set { + this.isZeroRowCompatibleField = value; + this.isZeroRowCompatibleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isZeroRowCompatibleSpecified { + get { return this.isZeroRowCompatibleFieldSpecified; } + set { this.isZeroRowCompatibleFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("enumValuePairs")] + public EnumValuePair[] enumValuePairs { + get { return this.enumValuePairsField; } + set { this.enumValuePairsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ReportDefinitionError : ApiError { + private ReportDefinitionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReportDefinitionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportDefinitionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ReportDefinitionErrorReason { + INVALID_DATE_RANGE_FOR_REPORT, + INVALID_FIELD_NAME_FOR_REPORT, + UNABLE_TO_FIND_MAPPING_FOR_THIS_REPORT, + INVALID_COLUMN_NAME_FOR_REPORT, + INVALID_REPORT_DEFINITION_ID, + REPORT_SELECTOR_CANNOT_BE_NULL, + NO_ENUMS_FOR_THIS_COLUMN_NAME, + INVALID_VIEW, + SORTING_NOT_SUPPORTED, + PAGING_NOT_SUPPORTED, + CUSTOMER_SERVING_TYPE_REPORT_MISMATCH, + CLIENT_SELECTOR_NO_CUSTOMER_IDENTIFIER, + CLIENT_SELECTOR_INVALID_CUSTOMER_ID, + REPORT_DEFINITION_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class NotWhitelistedError : ApiError { + private NotWhitelistedErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NotWhitelistedErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NotWhitelistedError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum NotWhitelistedErrorReason { + CUSTOMER_NOT_WHITELISTED_FOR_API + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportDefinition.ReportType", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ReportDefinitionReportType { + KEYWORDS_PERFORMANCE_REPORT, + AD_PERFORMANCE_REPORT, + URL_PERFORMANCE_REPORT, + ADGROUP_PERFORMANCE_REPORT, + CAMPAIGN_PERFORMANCE_REPORT, + ACCOUNT_PERFORMANCE_REPORT, + GEO_PERFORMANCE_REPORT, + SEARCH_QUERY_PERFORMANCE_REPORT, + AUTOMATIC_PLACEMENTS_PERFORMANCE_REPORT, + CAMPAIGN_NEGATIVE_KEYWORDS_PERFORMANCE_REPORT, + CAMPAIGN_NEGATIVE_PLACEMENTS_PERFORMANCE_REPORT, + AD_EXTENSIONS_PERFORMANCE_REPORT, + DESTINATION_URL_REPORT, + SHARED_SET_REPORT, + CAMPAIGN_SHARED_SET_REPORT, + SHARED_SET_CRITERIA_REPORT, + CREATIVE_CONVERSION_REPORT, + CALL_METRICS_CALL_DETAILS_REPORT, + KEYWORDLESS_QUERY_REPORT, + KEYWORDLESS_CATEGORY_REPORT, + ACCOUNT_REACH_FREQUENCY_REPORT, + CAMPAIGN_REACH_FREQUENCY_REPORT, + ADGROUP_REACH_FREQUENCY_REPORT, + CRITERIA_PERFORMANCE_REPORT, + CLICK_PERFORMANCE_REPORT, + BUDGET_PERFORMANCE_REPORT, + BID_GOAL_PERFORMANCE_REPORT, + DISPLAY_KEYWORD_PERFORMANCE_REPORT, + PLACEHOLDER_FEED_ITEM_REPORT, + PLACEMENT_PERFORMANCE_REPORT, + CAMPAIGN_NEGATIVE_LOCATIONS_REPORT, + GENDER_PERFORMANCE_REPORT, + AGE_RANGE_PERFORMANCE_REPORT, + CAMPAIGN_LOCATION_TARGET_REPORT, + CAMPAIGN_AD_SCHEDULE_TARGET_REPORT, + CAMPAIGN_PLATFORM_TARGET_REPORT, + PAID_ORGANIC_QUERY_REPORT, + AUDIENCE_PERFORMANCE_REPORT, + DISPLAY_TOPICS_PERFORMANCE_REPORT, + SHOPPING_PERFORMANCE_REPORT, + PRODUCT_PARTITION_REPORT, + AD_PLACEHOLDER_FEED_ITEM_REPORT, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "TargetingIdeaServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DataEntry))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class TargetingIdeaService : AdWordsSoapClient, ITargetingIdeaService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public TargetingIdeaService() { + this.Url = "https://adwords.google.com/api/adwords/o/v201406/TargetingIdeaService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/o/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/o/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TargetingIdeaPage get(TargetingIdeaSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((TargetingIdeaPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/o/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/o/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TargetingIdeaPage getBulkKeywordIdeas(TargetingIdeaSelector selector) { + object[] results = this.Invoke("getBulkKeywordIdeas", new object[] { selector }); + return ((TargetingIdeaPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class WebpageDescriptor { + private string urlField; + + private string titleField; + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + + public string title { + get { return this.titleField; } + set { this.titleField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class MonthlySearchVolume { + private int yearField; + + private bool yearFieldSpecified; + + private int monthField; + + private bool monthFieldSpecified; + + private long countField; + + private bool countFieldSpecified; + + public int year { + get { return this.yearField; } + set { + this.yearField = value; + this.yearSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool yearSpecified { + get { return this.yearFieldSpecified; } + set { this.yearFieldSpecified = value; } + } + + public int month { + get { return this.monthField; } + set { + this.monthField = value; + this.monthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool monthSpecified { + get { return this.monthFieldSpecified; } + set { this.monthFieldSpecified = value; } + } + + public long count { + get { return this.countField; } + set { + this.countField = value; + this.countSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool countSpecified { + get { return this.countFieldSpecified; } + set { this.countFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class Range { + private ComparableValue minField; + + private ComparableValue maxField; + + public ComparableValue min { + get { return this.minField; } + set { this.minField = value; } + } + + public ComparableValue max { + get { return this.maxField; } + set { this.maxField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class InStreamAdInfo { + private int maxAdDurationField; + + private bool maxAdDurationFieldSpecified; + + private int minAdDurationField; + + private bool minAdDurationFieldSpecified; + + private int medianAdDurationField; + + private bool medianAdDurationFieldSpecified; + + private double preRollPercentField; + + private bool preRollPercentFieldSpecified; + + private double midRollPercentField; + + private bool midRollPercentFieldSpecified; + + private double postRollPercentField; + + private bool postRollPercentFieldSpecified; + + public int maxAdDuration { + get { return this.maxAdDurationField; } + set { + this.maxAdDurationField = value; + this.maxAdDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxAdDurationSpecified { + get { return this.maxAdDurationFieldSpecified; } + set { this.maxAdDurationFieldSpecified = value; } + } + + public int minAdDuration { + get { return this.minAdDurationField; } + set { + this.minAdDurationField = value; + this.minAdDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minAdDurationSpecified { + get { return this.minAdDurationFieldSpecified; } + set { this.minAdDurationFieldSpecified = value; } + } + + public int medianAdDuration { + get { return this.medianAdDurationField; } + set { + this.medianAdDurationField = value; + this.medianAdDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool medianAdDurationSpecified { + get { return this.medianAdDurationFieldSpecified; } + set { this.medianAdDurationFieldSpecified = value; } + } + + public double preRollPercent { + get { return this.preRollPercentField; } + set { + this.preRollPercentField = value; + this.preRollPercentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool preRollPercentSpecified { + get { return this.preRollPercentFieldSpecified; } + set { this.preRollPercentFieldSpecified = value; } + } + + public double midRollPercent { + get { return this.midRollPercentField; } + set { + this.midRollPercentField = value; + this.midRollPercentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool midRollPercentSpecified { + get { return this.midRollPercentFieldSpecified; } + set { this.midRollPercentFieldSpecified = value; } + } + + public double postRollPercent { + get { return this.postRollPercentField; } + set { + this.postRollPercentField = value; + this.postRollPercentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool postRollPercentSpecified { + get { return this.postRollPercentFieldSpecified; } + set { this.postRollPercentFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class AdFormatSpec { + private SiteConstantsAdFormat formatField; + + private bool formatFieldSpecified; + + public SiteConstantsAdFormat format { + get { return this.formatField; } + set { + this.formatField = value; + this.formatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool formatSpecified { + get { return this.formatFieldSpecified; } + set { this.formatFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SiteConstants.AdFormat", Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public enum SiteConstantsAdFormat { + UNKNOWN, + TEXT, + IMAGE, + VIDEO, + INSTREAM + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WebpageDescriptorAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementTypeAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OpportunityIdeaTypeAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MonthlySearchVolumeAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MoneyAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongRangeAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(KeywordAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IntegerSetAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IntegerAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InStreamAdInfoAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IdeaTypeAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DoubleAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BooleanAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BidLandscapeAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSpecListAttribute))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdFormatSpecListAttribute))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public abstract partial class Attribute { + private string attributeTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Attribute.Type")] + public string AttributeType { + get { return this.attributeTypeField; } + set { this.attributeTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class WebpageDescriptorAttribute : Attribute { + private WebpageDescriptor valueField; + + public WebpageDescriptor value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class StringAttribute : Attribute { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class PlacementTypeAttribute : Attribute { + private SiteConstantsPlacementType valueField; + + private bool valueFieldSpecified; + + public SiteConstantsPlacementType value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SiteConstants.PlacementType", Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public enum SiteConstantsPlacementType { + UNKNOWN, + SITE, + VIDEO, + FEED, + GAME, + MOBILE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class PlacementAttribute : Attribute { + private Placement valueField; + + public Placement value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class OpportunityIdeaTypeAttribute : Attribute { + private OpportunityIdeaType valueField; + + private bool valueFieldSpecified; + + public OpportunityIdeaType value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public enum OpportunityIdeaType { + KEYWORD, + BID, + BUDGET + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class MonthlySearchVolumeAttribute : Attribute { + private MonthlySearchVolume[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public MonthlySearchVolume[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class MoneyAttribute : Attribute { + private Money valueField; + + public Money value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class LongRangeAttribute : Attribute { + private Range valueField; + + public Range value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class LongAttribute : Attribute { + private long valueField; + + private bool valueFieldSpecified; + + public long value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class KeywordAttribute : Attribute { + private Keyword valueField; + + public Keyword value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class IntegerSetAttribute : Attribute { + private int[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public int[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class IntegerAttribute : Attribute { + private int valueField; + + private bool valueFieldSpecified; + + public int value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class InStreamAdInfoAttribute : Attribute { + private InStreamAdInfo valueField; + + public InStreamAdInfo value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class IdeaTypeAttribute : Attribute { + private IdeaType valueField; + + private bool valueFieldSpecified; + + public IdeaType value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public enum IdeaType { + KEYWORD, + PLACEMENT + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class DoubleAttribute : Attribute { + private double valueField; + + private bool valueFieldSpecified; + + public double value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class CriterionAttribute : Attribute { + private Criterion valueField; + + public Criterion value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class BooleanAttribute : Attribute { + private bool valueField; + + private bool valueFieldSpecified; + + public bool value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class BidLandscapeAttribute : Attribute { + private BidLandscape valueField; + + public BidLandscape value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class AdSpecListAttribute : Attribute { + private AdSpec[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdSpec[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class AdSpec { + private object itemField; + + [System.Xml.Serialization.XmlElementAttribute("DisplayAdSpec", typeof(DisplayAdSpec))] + [System.Xml.Serialization.XmlElementAttribute("InStreamAdSpec", typeof(InStreamAdSpec))] + [System.Xml.Serialization.XmlElementAttribute("TextAdSpec", typeof(TextAdSpec))] + public object Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class DisplayAdSpec { + private DisplayType[] displayTypesField; + + private DisplayAdSpecActivationOption[] activationOptionsField; + + private DisplayAdSpecAdSizeSpec[] adSizeSpecsField; + + [System.Xml.Serialization.XmlElementAttribute("displayTypes")] + public DisplayType[] displayTypes { + get { return this.displayTypesField; } + set { this.displayTypesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("activationOptions")] + public DisplayAdSpecActivationOption[] activationOptions { + get { return this.activationOptionsField; } + set { this.activationOptionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adSizeSpecs")] + public DisplayAdSpecAdSizeSpec[] adSizeSpecs { + get { return this.adSizeSpecsField; } + set { this.adSizeSpecsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class DisplayType { + private object itemField; + + [System.Xml.Serialization.XmlElementAttribute("FlashDisplayType", typeof(FlashDisplayType))] + [System.Xml.Serialization.XmlElementAttribute("HtmlDisplayType", typeof(HtmlDisplayType))] + [System.Xml.Serialization.XmlElementAttribute("ImageDisplayType", typeof(ImageDisplayType))] + public object Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class FlashDisplayType { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class HtmlDisplayType { + private HtmlDisplayTypeHtmlOption htmlOptionField; + + private bool htmlOptionFieldSpecified; + + public HtmlDisplayTypeHtmlOption htmlOption { + get { return this.htmlOptionField; } + set { + this.htmlOptionField = value; + this.htmlOptionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool htmlOptionSpecified { + get { return this.htmlOptionFieldSpecified; } + set { this.htmlOptionFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "HtmlDisplayType.HtmlOption", Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public enum HtmlDisplayTypeHtmlOption { + UNKNOWN, + THIRD_PARTY_SERVING + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class ImageDisplayType { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DisplayAdSpec.ActivationOption", Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public enum DisplayAdSpecActivationOption { + UNKNOWN, + NONE, + STANDARD_EXPANDABLE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DisplayAdSpec.AdSizeSpec", Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class DisplayAdSpecAdSizeSpec { + private long widthField; + + private bool widthFieldSpecified; + + private long heightField; + + private bool heightFieldSpecified; + + private DisplayAdSpecActivationOption[] activationOptionFilterField; + + public long width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public long height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("activationOptionFilter")] + public DisplayAdSpecActivationOption[] activationOptionFilter { + get { return this.activationOptionFilterField; } + set { this.activationOptionFilterField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class InStreamAdSpec { + private InStreamAdSpecInStreamType[] inStreamTypesField; + + private long[] durationsField; + + [System.Xml.Serialization.XmlElementAttribute("inStreamTypes")] + public InStreamAdSpecInStreamType[] inStreamTypes { + get { return this.inStreamTypesField; } + set { this.inStreamTypesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("durations")] + public long[] durations { + get { return this.durationsField; } + set { this.durationsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InStreamAdSpec.InStreamType", Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public enum InStreamAdSpecInStreamType { + UNKNOWN, + IN_STREAM, + IN_DISPLAY, + IN_SLATE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class TextAdSpec { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class AdFormatSpecListAttribute : Attribute { + private AdFormatSpec[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdFormatSpec[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class Type_AttributeMapEntry { + private AttributeType keyField; + + private bool keyFieldSpecified; + + private Attribute valueField; + + public AttributeType key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public Attribute value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public enum AttributeType { + UNKNOWN, + AD_TYPE_SPEC, + APPROX_CONTENT_IMPRESSIONS_PER_DAY, + CATEGORY_PRODUCTS_AND_SERVICES, + COMPETITION, + CRITERION, + EXTRACTED_FROM_WEBPAGE, + IDEA_TYPE, + IN_STREAM_AD_INFO, + KEYWORD_TEXT, + PLACEMENT_NAME, + SAMPLE_URL, + PLACEMENT_CATEGORY, + PLACEMENT_TYPE, + SEARCH_VOLUME, + AVERAGE_CPC, + TARGETED_MONTHLY_SEARCHES + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class TargetingIdea { + private Type_AttributeMapEntry[] dataField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("data")] + public Type_AttributeMapEntry[] data { + get { return this.dataField; } + set { this.dataField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class TargetingIdeaPage { + private int totalNumEntriesField; + + private bool totalNumEntriesFieldSpecified; + + private TargetingIdea[] entriesField; + + public int totalNumEntries { + get { return this.totalNumEntriesField; } + set { + this.totalNumEntriesField = value; + this.totalNumEntriesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalNumEntriesSpecified { + get { return this.totalNumEntriesFieldSpecified; } + set { this.totalNumEntriesFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public TargetingIdea[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class LongComparisonOperation { + private long minimumField; + + private bool minimumFieldSpecified; + + private long maximumField; + + private bool maximumFieldSpecified; + + public long minimum { + get { return this.minimumField; } + set { + this.minimumField = value; + this.minimumSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minimumSpecified { + get { return this.minimumFieldSpecified; } + set { this.minimumFieldSpecified = value; } + } + + public long maximum { + get { return this.maximumField; } + set { + this.maximumField = value; + this.maximumSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maximumSpecified { + get { return this.maximumFieldSpecified; } + set { this.maximumFieldSpecified = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SeedAdGroupIdSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SearchVolumeSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RelatedToUrlSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RelatedToQuerySearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementTypeSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NetworkSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LocationSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LanguageSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IncludeAdultContentSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IdeaTextFilterSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExcludedKeywordSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CompetitionSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CategoryProductsAndServicesSearchParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSpecListSearchParameter))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public abstract partial class SearchParameter { + private string searchParameterTypeField; + + [System.Xml.Serialization.XmlElementAttribute("SearchParameter.Type")] + public string SearchParameterType { + get { return this.searchParameterTypeField; } + set { this.searchParameterTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class SeedAdGroupIdSearchParameter : SearchParameter { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class SearchVolumeSearchParameter : SearchParameter { + private LongComparisonOperation operationField; + + public LongComparisonOperation operation { + get { return this.operationField; } + set { this.operationField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class RelatedToUrlSearchParameter : SearchParameter { + private string[] urlsField; + + private bool includeSubUrlsField; + + private bool includeSubUrlsFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("urls")] + public string[] urls { + get { return this.urlsField; } + set { this.urlsField = value; } + } + + public bool includeSubUrls { + get { return this.includeSubUrlsField; } + set { + this.includeSubUrlsField = value; + this.includeSubUrlsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeSubUrlsSpecified { + get { return this.includeSubUrlsFieldSpecified; } + set { this.includeSubUrlsFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class RelatedToQuerySearchParameter : SearchParameter { + private string[] queriesField; + + [System.Xml.Serialization.XmlElementAttribute("queries")] + public string[] queries { + get { return this.queriesField; } + set { this.queriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class PlacementTypeSearchParameter : SearchParameter { + private SiteConstantsPlacementType[] placementTypesField; + + [System.Xml.Serialization.XmlElementAttribute("placementTypes")] + public SiteConstantsPlacementType[] placementTypes { + get { return this.placementTypesField; } + set { this.placementTypesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class NetworkSearchParameter : SearchParameter { + private NetworkSetting networkSettingField; + + public NetworkSetting networkSetting { + get { return this.networkSettingField; } + set { this.networkSettingField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class LocationSearchParameter : SearchParameter { + private Location[] locationsField; + + [System.Xml.Serialization.XmlElementAttribute("locations")] + public Location[] locations { + get { return this.locationsField; } + set { this.locationsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class LanguageSearchParameter : SearchParameter { + private Language[] languagesField; + + [System.Xml.Serialization.XmlElementAttribute("languages")] + public Language[] languages { + get { return this.languagesField; } + set { this.languagesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class IncludeAdultContentSearchParameter : SearchParameter { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class IdeaTextFilterSearchParameter : SearchParameter { + private string[] includedField; + + private string[] excludedField; + + [System.Xml.Serialization.XmlElementAttribute("included")] + public string[] included { + get { return this.includedField; } + set { this.includedField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excluded")] + public string[] excluded { + get { return this.excludedField; } + set { this.excludedField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class ExcludedKeywordSearchParameter : SearchParameter { + private Keyword[] keywordsField; + + [System.Xml.Serialization.XmlElementAttribute("keywords")] + public Keyword[] keywords { + get { return this.keywordsField; } + set { this.keywordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class CompetitionSearchParameter : SearchParameter { + private CompetitionSearchParameterLevel[] levelsField; + + [System.Xml.Serialization.XmlElementAttribute("levels")] + public CompetitionSearchParameterLevel[] levels { + get { return this.levelsField; } + set { this.levelsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CompetitionSearchParameter.Level", Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public enum CompetitionSearchParameterLevel { + LOW, + MEDIUM, + HIGH + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class CategoryProductsAndServicesSearchParameter : SearchParameter { + private int categoryIdField; + + private bool categoryIdFieldSpecified; + + public int categoryId { + get { return this.categoryIdField; } + set { + this.categoryIdField = value; + this.categoryIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool categoryIdSpecified { + get { return this.categoryIdFieldSpecified; } + set { this.categoryIdFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class AdSpecListSearchParameter : SearchParameter { + private AdSpec[] adSpecsField; + + [System.Xml.Serialization.XmlElementAttribute("adSpecs")] + public AdSpec[] adSpecs { + get { return this.adSpecsField; } + set { this.adSpecsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class TargetingIdeaSelector { + private SearchParameter[] searchParametersField; + + private IdeaType ideaTypeField; + + private bool ideaTypeFieldSpecified; + + private RequestType requestTypeField; + + private bool requestTypeFieldSpecified; + + private AttributeType[] requestedAttributeTypesField; + + private Paging pagingField; + + private string localeCodeField; + + private string currencyCodeField; + + [System.Xml.Serialization.XmlElementAttribute("searchParameters")] + public SearchParameter[] searchParameters { + get { return this.searchParametersField; } + set { this.searchParametersField = value; } + } + + public IdeaType ideaType { + get { return this.ideaTypeField; } + set { + this.ideaTypeField = value; + this.ideaTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ideaTypeSpecified { + get { return this.ideaTypeFieldSpecified; } + set { this.ideaTypeFieldSpecified = value; } + } + + public RequestType requestType { + get { return this.requestTypeField; } + set { + this.requestTypeField = value; + this.requestTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool requestTypeSpecified { + get { return this.requestTypeFieldSpecified; } + set { this.requestTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("requestedAttributeTypes")] + public AttributeType[] requestedAttributeTypes { + get { return this.requestedAttributeTypesField; } + set { this.requestedAttributeTypesField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + + public string localeCode { + get { return this.localeCodeField; } + set { this.localeCodeField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public enum RequestType { + IDEAS, + STATS + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class TrafficEstimatorError : ApiError { + private TrafficEstimatorErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TrafficEstimatorErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TrafficEstimatorError.Reason", Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public enum TrafficEstimatorErrorReason { + NO_CAMPAIGN_FOR_AD_GROUP_ESTIMATE_REQUEST, + NO_AD_GROUP_FOR_KEYWORD_ESTIMATE_REQUEST, + NO_MAX_CPC_FOR_KEYWORD_ESTIMATE_REQUEST, + TOO_MANY_KEYWORD_ESTIMATE_REQUESTS, + TOO_MANY_CAMPAIGN_ESTIMATE_REQUESTS, + TOO_MANY_ADGROUP_ESTIMATE_REQUESTS, + TOO_MANY_TARGETS, + KEYWORD_TOO_LONG, + KEYWORD_CONTAINS_BROAD_MATCH_MODIFIERS, + INVALID_INPUT, + SERVICE_UNAVAILABLE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class TargetingIdeaError : ApiError { + private TargetingIdeaErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TargetingIdeaErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TargetingIdeaError.Reason", Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public enum TargetingIdeaErrorReason { + DUPLICATE_SEARCH_FILTER_TYPES_PRESENT, + INSUFFICIENT_SEARCH_PARAMETERS, + INVALID_ATTRIBUTE_TYPE, + INVALID_SEARCH_PARAMETERS, + INVALID_DOMAIN_SUFFIX, + MUTUALLY_EXCLUSIVE_SEARCH_PARAMETERS_IN_QUERY, + SERVICE_UNAVAILABLE, + INVALID_URL_IN_SEARCH_PARAMETER, + TOO_MANY_RESULTS_REQUESTED, + NO_PAGING_IN_SELECTOR, + INVALID_INCLUDED_EXCLUDED_KEYWORDS + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "TrafficEstimatorServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Estimate))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EstimateRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class TrafficEstimatorService : AdWordsSoapClient, ITrafficEstimatorService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public TrafficEstimatorService() { + this.Url = "https://adwords.google.com/api/adwords/o/v201406/TrafficEstimatorService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/o/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/o/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TrafficEstimatorResult get(TrafficEstimatorSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((TrafficEstimatorResult) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class StatsEstimate { + private Money averageCpcField; + + private double averagePositionField; + + private bool averagePositionFieldSpecified; + + private double clickThroughRateField; + + private bool clickThroughRateFieldSpecified; + + private float clicksPerDayField; + + private bool clicksPerDayFieldSpecified; + + private float impressionsPerDayField; + + private bool impressionsPerDayFieldSpecified; + + private Money totalCostField; + + public Money averageCpc { + get { return this.averageCpcField; } + set { this.averageCpcField = value; } + } + + public double averagePosition { + get { return this.averagePositionField; } + set { + this.averagePositionField = value; + this.averagePositionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool averagePositionSpecified { + get { return this.averagePositionFieldSpecified; } + set { this.averagePositionFieldSpecified = value; } + } + + public double clickThroughRate { + get { return this.clickThroughRateField; } + set { + this.clickThroughRateField = value; + this.clickThroughRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clickThroughRateSpecified { + get { return this.clickThroughRateFieldSpecified; } + set { this.clickThroughRateFieldSpecified = value; } + } + + public float clicksPerDay { + get { return this.clicksPerDayField; } + set { + this.clicksPerDayField = value; + this.clicksPerDaySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clicksPerDaySpecified { + get { return this.clicksPerDayFieldSpecified; } + set { this.clicksPerDayFieldSpecified = value; } + } + + public float impressionsPerDay { + get { return this.impressionsPerDayField; } + set { + this.impressionsPerDayField = value; + this.impressionsPerDaySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsPerDaySpecified { + get { return this.impressionsPerDayFieldSpecified; } + set { this.impressionsPerDayFieldSpecified = value; } + } + + public Money totalCost { + get { return this.totalCostField; } + set { this.totalCostField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignEstimate))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(KeywordEstimate))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupEstimate))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class Estimate { + private string estimateTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Estimate.Type")] + public string EstimateType { + get { return this.estimateTypeField; } + set { this.estimateTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class CampaignEstimate : Estimate { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private AdGroupEstimate[] adGroupEstimatesField; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adGroupEstimates")] + public AdGroupEstimate[] adGroupEstimates { + get { return this.adGroupEstimatesField; } + set { this.adGroupEstimatesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class AdGroupEstimate : Estimate { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private KeywordEstimate[] keywordEstimatesField; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("keywordEstimates")] + public KeywordEstimate[] keywordEstimates { + get { return this.keywordEstimatesField; } + set { this.keywordEstimatesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class KeywordEstimate : Estimate { + private long criterionIdField; + + private bool criterionIdFieldSpecified; + + private StatsEstimate minField; + + private StatsEstimate maxField; + + public long criterionId { + get { return this.criterionIdField; } + set { + this.criterionIdField = value; + this.criterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionIdSpecified { + get { return this.criterionIdFieldSpecified; } + set { this.criterionIdFieldSpecified = value; } + } + + public StatsEstimate min { + get { return this.minField; } + set { this.minField = value; } + } + + public StatsEstimate max { + get { return this.maxField; } + set { this.maxField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class TrafficEstimatorResult { + private CampaignEstimate[] campaignEstimatesField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("campaignEstimates")] + public CampaignEstimate[] campaignEstimates { + get { return this.campaignEstimatesField; } + set { this.campaignEstimatesField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CampaignEstimateRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(KeywordEstimateRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdGroupEstimateRequest))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public abstract partial class EstimateRequest { + private string estimateRequestTypeField; + + [System.Xml.Serialization.XmlElementAttribute("EstimateRequest.Type")] + public string EstimateRequestType { + get { return this.estimateRequestTypeField; } + set { this.estimateRequestTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class CampaignEstimateRequest : EstimateRequest { + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private AdGroupEstimateRequest[] adGroupEstimateRequestsField; + + private Criterion[] criteriaField; + + private NetworkSetting networkSettingField; + + private Money dailyBudgetField; + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adGroupEstimateRequests")] + public AdGroupEstimateRequest[] adGroupEstimateRequests { + get { return this.adGroupEstimateRequestsField; } + set { this.adGroupEstimateRequestsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("criteria")] + public Criterion[] criteria { + get { return this.criteriaField; } + set { this.criteriaField = value; } + } + + public NetworkSetting networkSetting { + get { return this.networkSettingField; } + set { this.networkSettingField = value; } + } + + public Money dailyBudget { + get { return this.dailyBudgetField; } + set { this.dailyBudgetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class AdGroupEstimateRequest : EstimateRequest { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private KeywordEstimateRequest[] keywordEstimateRequestsField; + + private Money maxCpcField; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("keywordEstimateRequests")] + public KeywordEstimateRequest[] keywordEstimateRequests { + get { return this.keywordEstimateRequestsField; } + set { this.keywordEstimateRequestsField = value; } + } + + public Money maxCpc { + get { return this.maxCpcField; } + set { this.maxCpcField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class KeywordEstimateRequest : EstimateRequest { + private Keyword keywordField; + + private Money maxCpcField; + + private bool isNegativeField; + + private bool isNegativeFieldSpecified; + + public Keyword keyword { + get { return this.keywordField; } + set { this.keywordField = value; } + } + + public Money maxCpc { + get { return this.maxCpcField; } + set { this.maxCpcField = value; } + } + + public bool isNegative { + get { return this.isNegativeField; } + set { + this.isNegativeField = value; + this.isNegativeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isNegativeSpecified { + get { return this.isNegativeFieldSpecified; } + set { this.isNegativeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/o/v201406")] + public partial class TrafficEstimatorSelector { + private CampaignEstimateRequest[] campaignEstimateRequestsField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("campaignEstimateRequests")] + public CampaignEstimateRequest[] campaignEstimateRequests { + get { return this.campaignEstimateRequestsField; } + set { this.campaignEstimateRequestsField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdwordsUserListServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/rm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdwordsUserListService : AdWordsSoapClient, IAdwordsUserListService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdwordsUserListService() { + this.Url = "https://adwords.google.com/api/adwords/rm/v201406/AdwordsUserListService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/rm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/rm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserListPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((UserListPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/rm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/rm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserListReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +UserListOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((UserListReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201406")] + public partial class UserListReturnValue : ListReturnValue { + private UserList[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public UserList[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SimilarUserList))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BasicUserList))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LogicalUserList))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExternalRemarketingUserList))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201406")] + public partial class UserList { + private long idField; + + private bool idFieldSpecified; + + private bool isReadOnlyField; + + private bool isReadOnlyFieldSpecified; + + private string nameField; + + private string descriptionField; + + private UserListMembershipStatus statusField; + + private bool statusFieldSpecified; + + private string integrationCodeField; + + private AccessReason accessReasonField; + + private bool accessReasonFieldSpecified; + + private AccountUserListStatus accountUserListStatusField; + + private bool accountUserListStatusFieldSpecified; + + private long membershipLifeSpanField; + + private bool membershipLifeSpanFieldSpecified; + + private long sizeField; + + private bool sizeFieldSpecified; + + private SizeRange sizeRangeField; + + private bool sizeRangeFieldSpecified; + + private long sizeForSearchField; + + private bool sizeForSearchFieldSpecified; + + private SizeRange sizeRangeForSearchField; + + private bool sizeRangeForSearchFieldSpecified; + + private UserListType typeField; + + private bool typeFieldSpecified; + + private string userListTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public bool isReadOnly { + get { return this.isReadOnlyField; } + set { + this.isReadOnlyField = value; + this.isReadOnlySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isReadOnlySpecified { + get { return this.isReadOnlyFieldSpecified; } + set { this.isReadOnlyFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public UserListMembershipStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string integrationCode { + get { return this.integrationCodeField; } + set { this.integrationCodeField = value; } + } + + public AccessReason accessReason { + get { return this.accessReasonField; } + set { + this.accessReasonField = value; + this.accessReasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool accessReasonSpecified { + get { return this.accessReasonFieldSpecified; } + set { this.accessReasonFieldSpecified = value; } + } + + public AccountUserListStatus accountUserListStatus { + get { return this.accountUserListStatusField; } + set { + this.accountUserListStatusField = value; + this.accountUserListStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool accountUserListStatusSpecified { + get { return this.accountUserListStatusFieldSpecified; } + set { this.accountUserListStatusFieldSpecified = value; } + } + + public long membershipLifeSpan { + get { return this.membershipLifeSpanField; } + set { + this.membershipLifeSpanField = value; + this.membershipLifeSpanSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool membershipLifeSpanSpecified { + get { return this.membershipLifeSpanFieldSpecified; } + set { this.membershipLifeSpanFieldSpecified = value; } + } + + public long size { + get { return this.sizeField; } + set { + this.sizeField = value; + this.sizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sizeSpecified { + get { return this.sizeFieldSpecified; } + set { this.sizeFieldSpecified = value; } + } + + public SizeRange sizeRange { + get { return this.sizeRangeField; } + set { + this.sizeRangeField = value; + this.sizeRangeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sizeRangeSpecified { + get { return this.sizeRangeFieldSpecified; } + set { this.sizeRangeFieldSpecified = value; } + } + + public long sizeForSearch { + get { return this.sizeForSearchField; } + set { + this.sizeForSearchField = value; + this.sizeForSearchSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sizeForSearchSpecified { + get { return this.sizeForSearchFieldSpecified; } + set { this.sizeForSearchFieldSpecified = value; } + } + + public SizeRange sizeRangeForSearch { + get { return this.sizeRangeForSearchField; } + set { + this.sizeRangeForSearchField = value; + this.sizeRangeForSearchSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sizeRangeForSearchSpecified { + get { return this.sizeRangeForSearchFieldSpecified; } + set { this.sizeRangeForSearchFieldSpecified = value; } + } + + public UserListType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("UserList.Type")] + public string UserListType { + get { return this.userListTypeField; } + set { this.userListTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201406")] + public enum UserListMembershipStatus { + OPEN, + CLOSED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201406")] + public enum AccessReason { + OWNED, + SHARED, + LICENSED, + SUBSCRIBED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201406")] + public enum AccountUserListStatus { + ACTIVE, + INACTIVE + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201406")] + public enum SizeRange { + LESS_THAN_FIVE_HUNDRED, + LESS_THAN_ONE_THOUSAND, + ONE_THOUSAND_TO_TEN_THOUSAND, + TEN_THOUSAND_TO_FIFTY_THOUSAND, + FIFTY_THOUSAND_TO_ONE_HUNDRED_THOUSAND, + ONE_HUNDRED_THOUSAND_TO_THREE_HUNDRED_THOUSAND, + THREE_HUNDRED_THOUSAND_TO_FIVE_HUNDRED_THOUSAND, + FIVE_HUNDRED_THOUSAND_TO_ONE_MILLION, + ONE_MILLION_TO_TWO_MILLION, + TWO_MILLION_TO_THREE_MILLION, + THREE_MILLION_TO_FIVE_MILLION, + FIVE_MILLION_TO_TEN_MILLION, + TEN_MILLION_TO_TWENTY_MILLION, + TWENTY_MILLION_TO_THIRTY_MILLION, + THIRTY_MILLION_TO_FIFTY_MILLION, + OVER_FIFTY_MILLION + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201406")] + public enum UserListType { + UNKNOWN, + REMARKETING, + LOGICAL, + EXTERNAL_REMARKETING, + SIMILAR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201406")] + public partial class SimilarUserList : UserList { + private long seedUserListIdField; + + private bool seedUserListIdFieldSpecified; + + private string seedUserListNameField; + + private string seedUserListDescriptionField; + + private UserListMembershipStatus seedUserListStatusField; + + private bool seedUserListStatusFieldSpecified; + + private long seedListSizeField; + + private bool seedListSizeFieldSpecified; + + public long seedUserListId { + get { return this.seedUserListIdField; } + set { + this.seedUserListIdField = value; + this.seedUserListIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool seedUserListIdSpecified { + get { return this.seedUserListIdFieldSpecified; } + set { this.seedUserListIdFieldSpecified = value; } + } + + public string seedUserListName { + get { return this.seedUserListNameField; } + set { this.seedUserListNameField = value; } + } + + public string seedUserListDescription { + get { return this.seedUserListDescriptionField; } + set { this.seedUserListDescriptionField = value; } + } + + public UserListMembershipStatus seedUserListStatus { + get { return this.seedUserListStatusField; } + set { + this.seedUserListStatusField = value; + this.seedUserListStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool seedUserListStatusSpecified { + get { return this.seedUserListStatusFieldSpecified; } + set { this.seedUserListStatusFieldSpecified = value; } + } + + public long seedListSize { + get { return this.seedListSizeField; } + set { + this.seedListSizeField = value; + this.seedListSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool seedListSizeSpecified { + get { return this.seedListSizeFieldSpecified; } + set { this.seedListSizeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201406")] + public partial class BasicUserList : UserList { + private UserListConversionType[] conversionTypesField; + + [System.Xml.Serialization.XmlElementAttribute("conversionTypes")] + public UserListConversionType[] conversionTypes { + get { return this.conversionTypesField; } + set { this.conversionTypesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201406")] + public partial class UserListConversionType { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private UserListConversionTypeCategory categoryField; + + private bool categoryFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public UserListConversionTypeCategory category { + get { return this.categoryField; } + set { + this.categoryField = value; + this.categorySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool categorySpecified { + get { return this.categoryFieldSpecified; } + set { this.categoryFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "UserListConversionType.Category", Namespace = "https://adwords.google.com/api/adwords/rm/v201406")] + public enum UserListConversionTypeCategory { + BOOMERANG_EVENT, + OTHER + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201406")] + public partial class LogicalUserList : UserList { + private UserListLogicalRule[] rulesField; + + [System.Xml.Serialization.XmlElementAttribute("rules")] + public UserListLogicalRule[] rules { + get { return this.rulesField; } + set { this.rulesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201406")] + public partial class UserListLogicalRule { + private UserListLogicalRuleOperator operatorField; + + private bool operatorFieldSpecified; + + private LogicalUserListOperand[] ruleOperandsField; + + public UserListLogicalRuleOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ruleOperands")] + public LogicalUserListOperand[] ruleOperands { + get { return this.ruleOperandsField; } + set { this.ruleOperandsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "UserListLogicalRule.Operator", Namespace = "https://adwords.google.com/api/adwords/rm/v201406")] + public enum UserListLogicalRuleOperator { + ALL, + ANY, + NONE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201406")] + public partial class LogicalUserListOperand { + private UserList itemField; + + [System.Xml.Serialization.XmlElementAttribute("UserList")] + public UserList Item { + get { return this.itemField; } + set { this.itemField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201406")] + public partial class ExternalRemarketingUserList : UserList { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201406")] + public partial class UserListOperation : Operation { + private UserList operandField; + + public UserList operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201406")] + public partial class UserListPage : Page { + private UserList[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public UserList[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/rm/v201406")] + public partial class UserListError : ApiError { + private UserListErrorReason reasonField; + + private bool reasonFieldSpecified; + + public UserListErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "UserListError.Reason", Namespace = "https://adwords.google.com/api/adwords/rm/v201406")] + public enum UserListErrorReason { + EXTERNAL_REMARKETING_USER_LIST_MUTATE_NOT_SUPPORTED, + CONCRETE_TYPE_REQUIRED, + CONVERSION_TYPE_ID_REQUIRED, + DUPLICATE_CONVERSION_TYPES, + INVALID_CONVERSION_TYPE, + INVALID_DESCRIPTION, + INVALID_NAME, + INVALID_TYPE, + INVALID_USER_LIST_LOGICAL_RULE_OPERAND, + NAME_ALREADY_USED, + NEW_CONVERSION_TYPE_NAME_REQUIRED, + OWNERSHIP_REQUIRED_FOR_SET, + REMOVE_NOT_SUPPORTED, + USER_LIST_MUTATE_NOT_SUPPORTED, + USER_LIST_SERVICE_ERROR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ExpressBusinessServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ExpressBusinessService : AdWordsSoapClient, IExpressBusinessService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ExpressBusinessService() { + this.Url = "https://adwords.google.com/api/adwords/express/v201406/ExpressBusinessService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/express/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/express/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExpressBusinessPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((ExpressBusinessPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/express/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/express/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExpressBusiness[] mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +ExpressBusinessOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((ExpressBusiness[]) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public partial class ExpressBusinessOperation : Operation { + private ExpressBusiness operandField; + + public ExpressBusiness operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public partial class ExpressBusiness { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private ExpressBusinessStatus statusField; + + private bool statusFieldSpecified; + + private Address addressField; + + private GeoPoint geoPointField; + + private PhoneNumber phoneNumberField; + + private string websiteField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ExpressBusinessStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public Address address { + get { return this.addressField; } + set { this.addressField = value; } + } + + public GeoPoint geoPoint { + get { return this.geoPointField; } + set { this.geoPointField = value; } + } + + public PhoneNumber phoneNumber { + get { return this.phoneNumberField; } + set { this.phoneNumberField = value; } + } + + public string website { + get { return this.websiteField; } + set { this.websiteField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ExpressBusiness.Status", Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public enum ExpressBusinessStatus { + ENABLED, + REMOVED + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public partial class PhoneNumber { + private ExpressRegionCode regionCodeField; + + private bool regionCodeFieldSpecified; + + private string numberField; + + public ExpressRegionCode regionCode { + get { return this.regionCodeField; } + set { + this.regionCodeField = value; + this.regionCodeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool regionCodeSpecified { + get { return this.regionCodeFieldSpecified; } + set { this.regionCodeFieldSpecified = value; } + } + + public string number { + get { return this.numberField; } + set { this.numberField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public enum ExpressRegionCode { + AC, + AD, + AE, + AF, + AG, + AI, + AL, + AM, + AN, + AO, + AQ, + AR, + AS, + AT, + AU, + AW, + AX, + AZ, + BA, + BB, + BD, + BE, + BF, + BG, + BH, + BI, + BJ, + BL, + BM, + BN, + BO, + BQ, + BR, + BS, + BT, + BU, + BV, + BW, + BY, + BZ, + CA, + CC, + CD, + CF, + CG, + CH, + CI, + CK, + CL, + CM, + CN, + CO, + CP, + CR, + CS, + CU, + CV, + CW, + CX, + CY, + CZ, + DD, + DE, + DG, + DJ, + DK, + DM, + DO, + DZ, + EA, + EC, + EE, + EG, + EH, + ER, + ES, + ET, + EU, + FI, + FJ, + FK, + FM, + FO, + FR, + FX, + GA, + GB, + GD, + GE, + GF, + GG, + GH, + GI, + GL, + GM, + GN, + GP, + GQ, + GR, + GS, + GT, + GU, + GW, + GY, + HK, + HM, + HN, + HR, + HT, + HU, + IC, + ID, + IE, + IL, + IM, + IN, + IO, + IQ, + IR, + IS, + IT, + JE, + JM, + JO, + JP, + KE, + KG, + KH, + KI, + KM, + KN, + KP, + KR, + KW, + KY, + KZ, + LA, + LB, + LC, + LI, + LK, + LR, + LS, + LT, + LU, + LV, + LY, + MA, + MC, + MD, + ME, + MF, + MG, + MH, + MK, + ML, + MM, + MN, + MO, + MP, + MQ, + MR, + MS, + MT, + MU, + MV, + MW, + MX, + MY, + MZ, + NA, + NC, + NE, + NF, + NG, + NI, + NL, + NO, + NP, + NR, + NT, + NU, + NZ, + OM, + PA, + PE, + PF, + PG, + PH, + PK, + PL, + PM, + PN, + PR, + PS, + PT, + PW, + PY, + QA, + QO, + QU, + RE, + RO, + RS, + RU, + RW, + SA, + SB, + SC, + SD, + SE, + SG, + SH, + SI, + SJ, + SK, + SL, + SM, + SN, + SO, + SR, + SS, + ST, + SU, + SV, + SX, + SY, + SZ, + TA, + TC, + TD, + TF, + TG, + TH, + TJ, + TK, + TL, + TM, + TN, + TO, + TP, + TR, + TT, + TV, + TW, + TZ, + UA, + UG, + UM, + US, + UY, + UZ, + VA, + VC, + VE, + VG, + VI, + VN, + VU, + WF, + WS, + XA, + XB, + XC, + XK, + YD, + YE, + YT, + YU, + ZA, + ZM, + ZR, + ZW, + ZZ, + UN001, + UN002, + UN003, + UN005, + UN009, + UN011, + UN013, + UN014, + UN015, + UN017, + UN018, + UN019, + UN021, + UN029, + UN030, + UN034, + UN035, + UN039, + UN053, + UN054, + UN057, + UN061, + UN142, + UN143, + UN145, + UN150, + UN151, + UN154, + UN155, + UN419 + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExpressBusinessPage))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PromotionPage))] + public abstract partial class ExpressNoStatsPage : Page { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public partial class ExpressBusinessPage : ExpressNoStatsPage { + private ExpressBusiness[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public ExpressBusiness[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public partial class ExpressBusinessError : ApiError { + private ExpressBusinessErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ExpressBusinessErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ExpressBusinessError.Reason", Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public enum ExpressBusinessErrorReason { + INVALID_WEBSITE, + INVALID_ADDRESS, + INVALID_PHONE_NUMBER, + PREMIUM_RATE_PHONE_NUMBER_NOT_ALLOWED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "BudgetSuggestionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SoapHeader))] + public partial class BudgetSuggestionService : AdWordsSoapClient, IBudgetSuggestionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public BudgetSuggestionService() { + this.Url = "https://adwords.google.com/api/adwords/express/v201406/BudgetSuggestionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/express/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/express/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BudgetSuggestion get(BudgetSuggestionSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((BudgetSuggestion) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public partial class BudgetSuggestion { + private Money cpcField; + + private Money minCpcField; + + private Money maxCpcField; + + private Money cpmField; + + private Money suggestedBudgetField; + + private Money minBudgetField; + + private Money maxBudgetField; + + private Money[] budgetQuantilesField; + + private long impressionsField; + + private bool impressionsFieldSpecified; + + public Money cpc { + get { return this.cpcField; } + set { this.cpcField = value; } + } + + public Money minCpc { + get { return this.minCpcField; } + set { this.minCpcField = value; } + } + + public Money maxCpc { + get { return this.maxCpcField; } + set { this.maxCpcField = value; } + } + + public Money cpm { + get { return this.cpmField; } + set { this.cpmField = value; } + } + + public Money suggestedBudget { + get { return this.suggestedBudgetField; } + set { this.suggestedBudgetField = value; } + } + + public Money minBudget { + get { return this.minBudgetField; } + set { this.minBudgetField = value; } + } + + public Money maxBudget { + get { return this.maxBudgetField; } + set { this.maxBudgetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("budgetQuantiles")] + public Money[] budgetQuantiles { + get { return this.budgetQuantilesField; } + set { this.budgetQuantilesField = value; } + } + + public long impressions { + get { return this.impressionsField; } + set { + this.impressionsField = value; + this.impressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsSpecified { + get { return this.impressionsFieldSpecified; } + set { this.impressionsFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public partial class NegativeKeyword : Keyword { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public partial class ProductService : Criterion, IProductService { + private string textField; + + private string localeField; + + public virtual string text { + get { return this.textField; } + set { this.textField = value; } + } + + public virtual string locale { + get { return this.localeField; } + set { this.localeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public partial class NegativeCriterion : Criterion { + private Criterion criterionField; + + public Criterion criterion { + get { return this.criterionField; } + set { this.criterionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public partial class KeywordSet : Criterion { + private string keywordSetIdField; + + private string nameField; + + private bool deprecatedField; + + private bool deprecatedFieldSpecified; + + public string keywordSetId { + get { return this.keywordSetIdField; } + set { this.keywordSetIdField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public bool deprecated { + get { return this.deprecatedField; } + set { + this.deprecatedField = value; + this.deprecatedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deprecatedSpecified { + get { return this.deprecatedFieldSpecified; } + set { this.deprecatedFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public partial class BudgetSuggestionSelector { + private Criterion[] criteriaField; + + private CurrencyCode currencyCodeField; + + private bool currencyCodeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("criteria")] + public Criterion[] criteria { + get { return this.criteriaField; } + set { this.criteriaField = value; } + } + + public CurrencyCode currencyCode { + get { return this.currencyCodeField; } + set { + this.currencyCodeField = value; + this.currencyCodeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool currencyCodeSpecified { + get { return this.currencyCodeFieldSpecified; } + set { this.currencyCodeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public enum CurrencyCode { + ADP, + AED, + AFA, + AFN, + ALK, + ALL, + AMD, + ANG, + AOA, + AOK, + AON, + AOR, + ARA, + ARL, + ARM, + ARP, + ARS, + ATS, + AUD, + AWG, + AZM, + AZN, + BAD, + BAM, + BAN, + BBD, + BDT, + BEF, + BGL, + BGM, + BGN, + BGO, + BHD, + BIF, + BMD, + BND, + BOB, + BOL, + BOP, + BRB, + BRC, + BRE, + BRL, + BRN, + BRR, + BRZ, + BSD, + BTN, + BUK, + BWP, + BYB, + BYR, + BZD, + CAD, + CDF, + CHF, + CLE, + CLF, + CLP, + CNY, + COP, + CRC, + CSD, + CSK, + CUC, + CUP, + CVE, + CYP, + CZK, + DDM, + DEM, + DJF, + DKK, + DOP, + DZD, + ECS, + EEK, + EGP, + ERN, + ESP, + ETB, + EUR, + FIM, + FJD, + FKP, + FRF, + GBP, + GEK, + GEL, + GHC, + GHP, + GHS, + GIP, + GMD, + GNF, + GNS, + GQE, + GRD, + GTQ, + GWE, + GWP, + GYD, + HKD, + HNL, + HRD, + HRK, + HTG, + HUF, + IDR, + IEP, + ILP, + ILR, + ILS, + INR, + IQD, + IRR, + ISJ, + ISK, + ITL, + JMD, + JOD, + JPY, + KES, + KGS, + KHR, + KMF, + KPW, + KRH, + KRO, + KRW, + KWD, + KYD, + KZT, + LAK, + LBP, + LKR, + LRD, + LSL, + LTL, + LTT, + LUF, + LVL, + LVR, + LYD, + MAD, + MAF, + MCF, + MDC, + MDL, + MGA, + MGF, + MKD, + MKN, + MLF, + MMK, + MNT, + MOP, + MRO, + MTL, + MTP, + MUR, + MVR, + MWK, + MXN, + MXP, + MYR, + MZE, + MZM, + MZN, + NAD, + NGN, + NIC, + NIO, + NLG, + NOK, + NPR, + NZD, + OMR, + PAB, + PEI, + PEN, + PES, + PGK, + PHP, + PKR, + PLN, + PLZ, + PTE, + PYG, + QAR, + RHD, + ROL, + RON, + RSD, + RUB, + RUR, + RWF, + SAR, + SBD, + SCR, + SDD, + SDG, + SDP, + SEK, + SGD, + SHP, + SIT, + SKK, + SLL, + SOS, + SRD, + SRG, + SSP, + STD, + SUR, + SVC, + SYP, + SZL, + THB, + TJR, + TJS, + TMM, + TMT, + TND, + TOP, + TPE, + TRL, + TRY, + TTD, + TWD, + TZS, + UAH, + UAK, + UGS, + UGX, + USD, + UYP, + UYU, + UZS, + VEB, + VEF, + VND, + VNN, + VUV, + WST, + XAF, + XCD, + XOF, + XPF, + XXX, + YDD, + YER, + YUD, + YUM, + YUN, + YUR, + ZAR, + ZMK, + ZMW, + ZRN, + ZRZ, + ZWD, + ZWL, + ZWR + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "PromotionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SoapHeader))] + public partial class PromotionService : AdWordsSoapClient, IPromotionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public PromotionService() { + this.Url = "https://adwords.google.com/api/adwords/express/v201406/PromotionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/express/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/express/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual PromotionPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((PromotionPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/express/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/express/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Promotion[] mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +PromotionOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((Promotion[]) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public partial class PromotionOperation : Operation { + private Promotion operandField; + + public Promotion operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public partial class Promotion { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private PromotionStatus statusField; + + private bool statusFieldSpecified; + + private Creative[] creativesField; + + private string destinationUrlField; + + private PhoneNumber phoneNumberField; + + private bool streetAddressVisibleField; + + private bool streetAddressVisibleFieldSpecified; + + private bool callTrackingEnabledField; + + private bool callTrackingEnabledFieldSpecified; + + private Money budgetField; + + private Criterion[] criteriaField; + + private long[] campaignIdsField; + + private Money remainingBudgetField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public PromotionStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creatives")] + public Creative[] creatives { + get { return this.creativesField; } + set { this.creativesField = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + public PhoneNumber phoneNumber { + get { return this.phoneNumberField; } + set { this.phoneNumberField = value; } + } + + public bool streetAddressVisible { + get { return this.streetAddressVisibleField; } + set { + this.streetAddressVisibleField = value; + this.streetAddressVisibleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool streetAddressVisibleSpecified { + get { return this.streetAddressVisibleFieldSpecified; } + set { this.streetAddressVisibleFieldSpecified = value; } + } + + public bool callTrackingEnabled { + get { return this.callTrackingEnabledField; } + set { + this.callTrackingEnabledField = value; + this.callTrackingEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool callTrackingEnabledSpecified { + get { return this.callTrackingEnabledFieldSpecified; } + set { this.callTrackingEnabledFieldSpecified = value; } + } + + public Money budget { + get { return this.budgetField; } + set { this.budgetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("criteria")] + public Criterion[] criteria { + get { return this.criteriaField; } + set { this.criteriaField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("campaignIds")] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + public Money remainingBudget { + get { return this.remainingBudgetField; } + set { this.remainingBudgetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Promotion.Status", Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public enum PromotionStatus { + DRAFT, + ENABLED, + PAUSED, + REMOVED, + UPGRADED_TO_ADWORDS + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public partial class Creative { + private string headlineField; + + private string line1Field; + + private string line2Field; + + public string headline { + get { return this.headlineField; } + set { this.headlineField = value; } + } + + public string line1 { + get { return this.line1Field; } + set { this.line1Field = value; } + } + + public string line2 { + get { return this.line2Field; } + set { this.line2Field = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public partial class PromotionPage : ExpressNoStatsPage { + private Promotion[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Promotion[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public partial class PromotionError : ApiError { + private PromotionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PromotionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PromotionError.Reason", Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public enum PromotionErrorReason { + BUSINESS_DELETED, + CURRENCY_NOT_SUPPORTED, + GOOGLE_GRANT_ACCOUNT, + AOL_ACCOUNT, + MCC_ACCOUNT, + INVALID_DESTINATION_URL, + CALL_TRACKING_NOT_SUPPORTED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProductServiceServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Criterion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProductServiceService : AdWordsSoapClient, IProductServiceService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProductServiceService() { + this.Url = "https://adwords.google.com/api/adwords/express/v201406/ProductServiceService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/express/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/express/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductServicePage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((ProductServicePage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/express/v201406")] + public partial class ProductServicePage : NoStatsPage { + private ProductService[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public ProductService[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CampaignSharedSetServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CampaignSharedSetService : AdWordsSoapClient, ICampaignSharedSetService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CampaignSharedSetService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/CampaignSharedSetService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignSharedSetPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((CampaignSharedSetPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CampaignSharedSetReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +CampaignSharedSetOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((CampaignSharedSetReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignSharedSetReturnValue : ListReturnValue { + private CampaignSharedSet[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public CampaignSharedSet[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignSharedSet { + private long sharedSetIdField; + + private bool sharedSetIdFieldSpecified; + + private long campaignIdField; + + private bool campaignIdFieldSpecified; + + private string sharedSetNameField; + + private SharedSetType sharedSetTypeField; + + private bool sharedSetTypeFieldSpecified; + + private string campaignNameField; + + private CampaignSharedSetStatus statusField; + + private bool statusFieldSpecified; + + public long sharedSetId { + get { return this.sharedSetIdField; } + set { + this.sharedSetIdField = value; + this.sharedSetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sharedSetIdSpecified { + get { return this.sharedSetIdFieldSpecified; } + set { this.sharedSetIdFieldSpecified = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { + this.campaignIdField = value; + this.campaignIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool campaignIdSpecified { + get { return this.campaignIdFieldSpecified; } + set { this.campaignIdFieldSpecified = value; } + } + + public string sharedSetName { + get { return this.sharedSetNameField; } + set { this.sharedSetNameField = value; } + } + + public SharedSetType sharedSetType { + get { return this.sharedSetTypeField; } + set { + this.sharedSetTypeField = value; + this.sharedSetTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sharedSetTypeSpecified { + get { return this.sharedSetTypeFieldSpecified; } + set { this.sharedSetTypeFieldSpecified = value; } + } + + public string campaignName { + get { return this.campaignNameField; } + set { this.campaignNameField = value; } + } + + public CampaignSharedSetStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum SharedSetType { + NEGATIVE_KEYWORDS, + NEGATIVE_PLACEMENTS, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignSharedSet.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum CampaignSharedSetStatus { + ENABLED, + REMOVED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignSharedSetOperation : Operation { + private CampaignSharedSet operandField; + + public CampaignSharedSet operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignSharedSetPage : NullStatsPage { + private CampaignSharedSet[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public CampaignSharedSet[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class CampaignSharedSetError : ApiError { + private CampaignSharedSetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CampaignSharedSetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CampaignSharedSetError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum CampaignSharedSetErrorReason { + CAMPAIGN_SHARED_SET_DOES_NOT_EXIST, + SHARED_SET_NOT_ACTIVE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdGroupCriterionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CriterionParameter))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdGroupCriterionService : AdWordsSoapClient, IAdGroupCriterionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdGroupCriterionService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/AdGroupCriterionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupCriterionPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((AdGroupCriterionPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupCriterionReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +AdGroupCriterionOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((AdGroupCriterionReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupCriterionLabelReturnValue mutateLabel([System.Xml.Serialization.XmlElementAttribute("operations")] +AdGroupCriterionLabelOperation[] operations) { + object[] results = this.Invoke("mutateLabel", new object[] { operations }); + return ((AdGroupCriterionLabelReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupCriterionPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((AdGroupCriterionPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupCriterionReturnValue : ListReturnValue { + private AdGroupCriterion[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdGroupCriterion[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupCriterionLabelReturnValue : ListReturnValue { + private AdGroupCriterionLabel[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdGroupCriterionLabel[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupCriterionPage : Page { + private AdGroupCriterion[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public AdGroupCriterion[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "SharedCriterionServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class SharedCriterionService : AdWordsSoapClient, ISharedCriterionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public SharedCriterionService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/SharedCriterionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SharedCriterionPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((SharedCriterionPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SharedCriterionReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +SharedCriterionOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((SharedCriterionReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class SharedCriterionReturnValue : ListReturnValue { + private SharedCriterion[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public SharedCriterion[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class SharedCriterion { + private long sharedSetIdField; + + private bool sharedSetIdFieldSpecified; + + private Criterion criterionField; + + private bool negativeField; + + private bool negativeFieldSpecified; + + public long sharedSetId { + get { return this.sharedSetIdField; } + set { + this.sharedSetIdField = value; + this.sharedSetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sharedSetIdSpecified { + get { return this.sharedSetIdFieldSpecified; } + set { this.sharedSetIdFieldSpecified = value; } + } + + public Criterion criterion { + get { return this.criterionField; } + set { this.criterionField = value; } + } + + public bool negative { + get { return this.negativeField; } + set { + this.negativeField = value; + this.negativeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool negativeSpecified { + get { return this.negativeFieldSpecified; } + set { this.negativeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class SharedCriterionOperation : Operation { + private SharedCriterion operandField; + + public SharedCriterion operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class SharedCriterionPage : Page { + private SharedCriterion[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public SharedCriterion[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class SharedCriterionError : ApiError { + private SharedCriterionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SharedCriterionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SharedCriterionError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum SharedCriterionErrorReason { + EXCEEDS_CRITERIA_LIMIT, + INCORRECT_CRITERION_TYPE, + CANNOT_TARGET_AND_EXCLUDE, + NEGATIVE_CRITERION_REQUIRED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "SharedSetServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class SharedSetService : AdWordsSoapClient, ISharedSetService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public SharedSetService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/SharedSetService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SharedSetPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((SharedSetPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SharedSetReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +SharedSetOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((SharedSetReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class SharedSetReturnValue : ListReturnValue { + private SharedSet[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public SharedSet[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class SharedSet { + private long sharedSetIdField; + + private bool sharedSetIdFieldSpecified; + + private string nameField; + + private SharedSetType typeField; + + private bool typeFieldSpecified; + + private int memberCountField; + + private bool memberCountFieldSpecified; + + private int referenceCountField; + + private bool referenceCountFieldSpecified; + + private SharedSetStatus statusField; + + private bool statusFieldSpecified; + + public long sharedSetId { + get { return this.sharedSetIdField; } + set { + this.sharedSetIdField = value; + this.sharedSetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sharedSetIdSpecified { + get { return this.sharedSetIdFieldSpecified; } + set { this.sharedSetIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public SharedSetType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public int memberCount { + get { return this.memberCountField; } + set { + this.memberCountField = value; + this.memberCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool memberCountSpecified { + get { return this.memberCountFieldSpecified; } + set { this.memberCountFieldSpecified = value; } + } + + public int referenceCount { + get { return this.referenceCountField; } + set { + this.referenceCountField = value; + this.referenceCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool referenceCountSpecified { + get { return this.referenceCountFieldSpecified; } + set { this.referenceCountFieldSpecified = value; } + } + + public SharedSetStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SharedSet.Status", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum SharedSetStatus { + ENABLED, + REMOVED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class SharedSetOperation : Operation { + private SharedSet operandField; + + public SharedSet operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class SharedSetPage : NullStatsPage { + private SharedSet[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public SharedSet[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class SharedSetError : ApiError { + private SharedSetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SharedSetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SharedSetError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum SharedSetErrorReason { + CUSTOMER_CANNOT_CREATE_SHARED_SET_OF_THIS_TYPE, + DUPLICATE_NAME, + EXCEEDS_MAX_SHARED_SETS_FOR_TYPE, + INVALID_SET_NAME, + SHARED_SET_REMOVED, + SHARED_SET_IN_USE, + TYPE_CANNOT_BE_CHANGED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LabelServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LabelService : AdWordsSoapClient, ILabelService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LabelService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/LabelService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LabelPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((LabelPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LabelReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +LabelOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((LabelReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LabelPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((LabelPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class LabelReturnValue : ListReturnValue { + private Label[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public Label[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class LabelOperation : Operation { + private Label operandField; + + public Label operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class LabelPage : NoStatsPage { + private Label[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Label[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class LabelError : ApiError { + private LabelErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LabelErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LabelError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum LabelErrorReason { + DUPLICATE_NAME, + INVALID_LABEL_NAME, + INVALID_LABEL_TYPE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdGroupServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdGroupService : AdWordsSoapClient, IAdGroupService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdGroupService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/AdGroupService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((AdGroupPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +AdGroupOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((AdGroupReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupLabelReturnValue mutateLabel([System.Xml.Serialization.XmlElementAttribute("operations")] +AdGroupLabelOperation[] operations) { + object[] results = this.Invoke("mutateLabel", new object[] { operations }); + return ((AdGroupLabelReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((AdGroupPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupReturnValue : ListReturnValue { + private AdGroup[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdGroup[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupLabelReturnValue : ListReturnValue { + private AdGroupLabel[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdGroupLabel[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupPage : Page { + private AdGroup[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public AdGroup[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdGroupBidModifierServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdGroupBidModifierService : AdWordsSoapClient, IAdGroupBidModifierService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdGroupBidModifierService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/AdGroupBidModifierService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupBidModifierPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((AdGroupBidModifierPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupBidModifierReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +AdGroupBidModifierOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((AdGroupBidModifierReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdGroupBidModifierPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((AdGroupBidModifierPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupBidModifierReturnValue : ListReturnValue { + private AdGroupBidModifier[] valueField; + + private ApiError[] partialFailureErrorsField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public AdGroupBidModifier[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("partialFailureErrors")] + public ApiError[] partialFailureErrors { + get { return this.partialFailureErrorsField; } + set { this.partialFailureErrorsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdGroupBidModifierPage : Page { + private AdGroupBidModifier[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public AdGroupBidModifier[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdParamServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdParamService : AdWordsSoapClient, IAdParamService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdParamService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/AdParamService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdParamPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((AdParamPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdParam[] mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +AdParamOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((AdParam[]) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdParamOperation : Operation { + private AdParam operandField; + + public AdParam operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdParam { + private long adGroupIdField; + + private bool adGroupIdFieldSpecified; + + private long criterionIdField; + + private bool criterionIdFieldSpecified; + + private string insertionTextField; + + private int paramIndexField; + + private bool paramIndexFieldSpecified; + + public long adGroupId { + get { return this.adGroupIdField; } + set { + this.adGroupIdField = value; + this.adGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adGroupIdSpecified { + get { return this.adGroupIdFieldSpecified; } + set { this.adGroupIdFieldSpecified = value; } + } + + public long criterionId { + get { return this.criterionIdField; } + set { + this.criterionIdField = value; + this.criterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool criterionIdSpecified { + get { return this.criterionIdFieldSpecified; } + set { this.criterionIdFieldSpecified = value; } + } + + public string insertionText { + get { return this.insertionTextField; } + set { this.insertionTextField = value; } + } + + public int paramIndex { + get { return this.paramIndexField; } + set { + this.paramIndexField = value; + this.paramIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool paramIndexSpecified { + get { return this.paramIndexFieldSpecified; } + set { this.paramIndexFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdParamPage { + private AdParam[] entriesField; + + private int totalNumEntriesField; + + private bool totalNumEntriesFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public AdParam[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + + public int totalNumEntries { + get { return this.totalNumEntriesField; } + set { + this.totalNumEntriesField = value; + this.totalNumEntriesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalNumEntriesSpecified { + get { return this.totalNumEntriesFieldSpecified; } + set { this.totalNumEntriesFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdParamPolicyError : PolicyViolationError { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class AdParamError : ApiError { + private AdParamErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdParamErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdParamError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum AdParamErrorReason { + AD_PARAM_CANNOT_BE_SPECIFIED_MULTIPLE_TIMES, + AD_PARAM_DOES_NOT_EXIST, + CRITERION_SPECIFIED_MUST_BE_KEYWORD, + INVALID_ADGROUP_CRITERION_SPECIFIED, + INVALID_INSERTION_TEXT_FORMAT, + MUST_SPECIFY_ADGROUP_ID, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AlertServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AlertService : AdWordsSoapClient, IAlertService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AlertService() { + this.Url = "https://adwords.google.com/api/adwords/mcm/v201406/AlertService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/mcm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/mcm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AlertPage get(AlertSelector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((AlertPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public partial class Detail { + private string triggerTimeField; + + public string triggerTime { + get { return this.triggerTimeField; } + set { this.triggerTimeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public partial class Alert { + private AlertSeverity alertSeverityField; + + private bool alertSeverityFieldSpecified; + + private AlertType alertTypeField; + + private bool alertTypeFieldSpecified; + + private long clientCustomerIdField; + + private bool clientCustomerIdFieldSpecified; + + private Detail[] detailsField; + + public AlertSeverity alertSeverity { + get { return this.alertSeverityField; } + set { + this.alertSeverityField = value; + this.alertSeveritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool alertSeveritySpecified { + get { return this.alertSeverityFieldSpecified; } + set { this.alertSeverityFieldSpecified = value; } + } + + public AlertType alertType { + get { return this.alertTypeField; } + set { + this.alertTypeField = value; + this.alertTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool alertTypeSpecified { + get { return this.alertTypeFieldSpecified; } + set { this.alertTypeFieldSpecified = value; } + } + + public long clientCustomerId { + get { return this.clientCustomerIdField; } + set { + this.clientCustomerIdField = value; + this.clientCustomerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clientCustomerIdSpecified { + get { return this.clientCustomerIdFieldSpecified; } + set { this.clientCustomerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("details")] + public Detail[] details { + get { return this.detailsField; } + set { this.detailsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public enum AlertSeverity { + GREEN, + YELLOW, + RED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public enum AlertType { + ACCOUNT_ON_TARGET, + DECLINED_PAYMENT, + CREDIT_CARD_EXPIRING, + ACCOUNT_BUDGET_ENDING, + CAMPAIGN_ENDING, + PAYMENT_NOT_ENTERED, + MISSING_BANK_REFERENCE_NUMBER, + CAMPAIGN_ENDED, + ACCOUNT_BUDGET_BURN_RATE, + USER_INVITE_PENDING, + USER_INVITE_ACCEPTED, + MANAGER_LINK_PENDING, + ZERO_DAILY_SPENDING_LIMIT, + TV_ACCOUNT_ON_TARGET, + TV_ACCOUNT_BUDGET_ENDING, + TV_ZERO_DAILY_SPENDING_LIMIT, + UNKNOWN + } + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AlertPage))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public abstract partial class McmNoStatsPage : Page { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public partial class AlertPage : McmNoStatsPage { + private Alert[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public Alert[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public partial class AlertQuery { + private ClientSpec clientSpecField; + + private bool clientSpecFieldSpecified; + + private FilterSpec filterSpecField; + + private bool filterSpecFieldSpecified; + + private AlertType[] typesField; + + private AlertSeverity[] severitiesField; + + private TriggerTimeSpec triggerTimeSpecField; + + private bool triggerTimeSpecFieldSpecified; + + private string triggerTimeField; + + private long[] clientCustomerIdsField; + + public ClientSpec clientSpec { + get { return this.clientSpecField; } + set { + this.clientSpecField = value; + this.clientSpecSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clientSpecSpecified { + get { return this.clientSpecFieldSpecified; } + set { this.clientSpecFieldSpecified = value; } + } + + public FilterSpec filterSpec { + get { return this.filterSpecField; } + set { + this.filterSpecField = value; + this.filterSpecSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool filterSpecSpecified { + get { return this.filterSpecFieldSpecified; } + set { this.filterSpecFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("types")] + public AlertType[] types { + get { return this.typesField; } + set { this.typesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("severities")] + public AlertSeverity[] severities { + get { return this.severitiesField; } + set { this.severitiesField = value; } + } + + public TriggerTimeSpec triggerTimeSpec { + get { return this.triggerTimeSpecField; } + set { + this.triggerTimeSpecField = value; + this.triggerTimeSpecSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool triggerTimeSpecSpecified { + get { return this.triggerTimeSpecFieldSpecified; } + set { this.triggerTimeSpecFieldSpecified = value; } + } + + public string triggerTime { + get { return this.triggerTimeField; } + set { this.triggerTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("clientCustomerIds")] + public long[] clientCustomerIds { + get { return this.clientCustomerIdsField; } + set { this.clientCustomerIdsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public enum ClientSpec { + ALL, + DIRECT, + ID_LIST, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public enum FilterSpec { + ALL, + ONLY_SUBMANAGERS, + ONLY_LEAF_CLIENTS, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public enum TriggerTimeSpec { + ALL_TIME, + CUSTOM_TIME, + LAST_24_HOURS, + LAST_7_DAYS + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public partial class AlertSelector { + private AlertQuery queryField; + + private Paging pagingField; + + public AlertQuery query { + get { return this.queryField; } + set { this.queryField = value; } + } + + public Paging paging { + get { return this.pagingField; } + set { this.pagingField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public partial class AlertError : ApiError { + private AlertErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AlertErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AlertError.Reason", Namespace = "https://adwords.google.com/api/adwords/mcm/v201406")] + public enum AlertErrorReason { + NO_CLIENT_IDS_SELECTED, + INVALID_CLIENT_ID_SELECTED, + INVALID_CLIENT_ID_FORMAT, + UNAVAILABLE, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "BiddingStrategyServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class BiddingStrategyService : AdWordsSoapClient, IBiddingStrategyService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public BiddingStrategyService() { + this.Url = "https://adwords.google.com/api/adwords/cm/v201406/BiddingStrategyService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BiddingStrategyPage get(Selector selector) { + object[] results = this.Invoke("get", new object[] { selector }); + return ((BiddingStrategyPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BiddingStrategyReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +BiddingStrategyOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((BiddingStrategyReturnValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/cm/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/cm/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BiddingStrategyPage query([System.Xml.Serialization.XmlElementAttribute("query")] +string query1) { + object[] results = this.Invoke("query", new object[] { query1 }); + return ((BiddingStrategyPage) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class BiddingStrategyReturnValue : ListReturnValue { + private SharedBiddingStrategy[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public SharedBiddingStrategy[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class SharedBiddingStrategy { + private BiddingScheme biddingSchemeField; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private SharedBiddingStrategyBiddingStrategyStatus statusField; + + private bool statusFieldSpecified; + + private BiddingStrategyType typeField; + + private bool typeFieldSpecified; + + public BiddingScheme biddingScheme { + get { return this.biddingSchemeField; } + set { this.biddingSchemeField = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public SharedBiddingStrategyBiddingStrategyStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public BiddingStrategyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SharedBiddingStrategy.BiddingStrategyStatus", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum SharedBiddingStrategyBiddingStrategyStatus { + ENABLED, + REMOVED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class BiddingStrategyOperation : Operation { + private SharedBiddingStrategy operandField; + + public SharedBiddingStrategy operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class BiddingStrategyPage : Page { + private SharedBiddingStrategy[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public SharedBiddingStrategy[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class BiddingStrategyError : ApiError { + private BiddingStrategyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BiddingStrategyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BiddingStrategyError.Reason", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum BiddingStrategyErrorReason { + DUPLICATE_NAME, + CANNOT_CHANGE_BIDDING_STRATEGY_TYPE, + CANNOT_REMOVE_ASSOCIATED_STRATEGY, + BIDDING_STRATEGY_NOT_SUPPORTED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "BudgetOrderServiceSoapBinding", Namespace = "https://adwords.google.com/api/adwords/billing/v201406")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListReturnValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Operation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ComparableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Page))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class BudgetOrderService : AdWordsSoapClient, IBudgetOrderService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public BudgetOrderService() { + this.Url = "https://adwords.google.com/api/adwords/billing/v201406/BudgetOrderService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/billing/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/billing/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BudgetOrderPage get(Selector serviceSelector) { + object[] results = this.Invoke("get", new object[] { serviceSelector }); + return ((BudgetOrderPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/billing/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/billing/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BillingAccount[] getBillingAccounts() { + object[] results = this.Invoke("getBillingAccounts", new object[0]); + return ((BillingAccount[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://adwords.google.com/api/adwords/billing/v201406", ResponseNamespace = "https://adwords.google.com/api/adwords/billing/v201406", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BudgetOrderReturnValue mutate([System.Xml.Serialization.XmlElementAttribute("operations")] +BudgetOrderOperation[] operations) { + object[] results = this.Invoke("mutate", new object[] { operations }); + return ((BudgetOrderReturnValue) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201406")] + public partial class BudgetOrderReturnValue : ListReturnValue { + private BudgetOrder[] valueField; + + [System.Xml.Serialization.XmlElementAttribute("value")] + public BudgetOrder[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201406")] + public partial class BudgetOrder { + private string billingAccountIdField; + + private long idField; + + private bool idFieldSpecified; + + private string billingAccountNameField; + + private string poNumberField; + + private string budgetOrderNameField; + + private string primaryBillingIdField; + + private string secondaryBillingIdField; + + private Money spendingLimitField; + + private string startDateTimeField; + + private string endDateTimeField; + + private BudgetOrderRequest lastRequestField; + + public string billingAccountId { + get { return this.billingAccountIdField; } + set { this.billingAccountIdField = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string billingAccountName { + get { return this.billingAccountNameField; } + set { this.billingAccountNameField = value; } + } + + public string poNumber { + get { return this.poNumberField; } + set { this.poNumberField = value; } + } + + public string budgetOrderName { + get { return this.budgetOrderNameField; } + set { this.budgetOrderNameField = value; } + } + + public string primaryBillingId { + get { return this.primaryBillingIdField; } + set { this.primaryBillingIdField = value; } + } + + public string secondaryBillingId { + get { return this.secondaryBillingIdField; } + set { this.secondaryBillingIdField = value; } + } + + public Money spendingLimit { + get { return this.spendingLimitField; } + set { this.spendingLimitField = value; } + } + + public string startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public string endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public BudgetOrderRequest lastRequest { + get { return this.lastRequestField; } + set { this.lastRequestField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201406")] + public partial class BudgetOrderRequest { + private BudgetOrderRequestStatus statusField; + + private bool statusFieldSpecified; + + private string dateField; + + private string billingAccountNameField; + + private string poNumberField; + + private string budgetOrderNameField; + + private Money spendingLimitField; + + private string startDateTimeField; + + private string endDateTimeField; + + public BudgetOrderRequestStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string date { + get { return this.dateField; } + set { this.dateField = value; } + } + + public string billingAccountName { + get { return this.billingAccountNameField; } + set { this.billingAccountNameField = value; } + } + + public string poNumber { + get { return this.poNumberField; } + set { this.poNumberField = value; } + } + + public string budgetOrderName { + get { return this.budgetOrderNameField; } + set { this.budgetOrderNameField = value; } + } + + public Money spendingLimit { + get { return this.spendingLimitField; } + set { this.spendingLimitField = value; } + } + + public string startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public string endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BudgetOrderRequest.Status", Namespace = "https://adwords.google.com/api/adwords/billing/v201406")] + public enum BudgetOrderRequestStatus { + UNDER_REVIEW, + APPROVED, + REJECTED, + CANCELLED, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201406")] + public partial class BudgetOrderOperation : Operation { + private BudgetOrder operandField; + + public BudgetOrder operand { + get { return this.operandField; } + set { this.operandField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201406")] + public partial class BillingAccount { + private string idField; + + private string nameField; + + private string currencyCodeField; + + private string primaryBillingIdField; + + private string secondaryBillingIdField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public string primaryBillingId { + get { return this.primaryBillingIdField; } + set { this.primaryBillingIdField = value; } + } + + public string secondaryBillingId { + get { return this.secondaryBillingIdField; } + set { this.secondaryBillingIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201406")] + public partial class BudgetOrderPage : Page { + private BudgetOrder[] entriesField; + + [System.Xml.Serialization.XmlElementAttribute("entries")] + public BudgetOrder[] entries { + get { return this.entriesField; } + set { this.entriesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201406")] + public partial class CustomerOrderLineError : ApiError { + private CustomerOrderLineErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomerOrderLineErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomerOrderLineError.Reason", Namespace = "https://adwords.google.com/api/adwords/billing/v201406")] + public enum CustomerOrderLineErrorReason { + INVALID_ORDER_LINE_ID, + END_DATE_BEFORE_START_DATE, + NEGATIVE_SPEND, + CREATE_IN_PAST, + ALREADY_STARTED, + ALREADY_SPENT, + FINISHED_IN_THE_PAST, + CANCEL_ACTIVE, + OVERLAP_DATE_RANGE, + COS_CHANGE, + NON_ADWORDS, + START_DATE_AFTER_ACTUAL, + END_DATE_PAST_MAX, + PARENT_IS_SELF, + CANNOT_CANCEL_NEW, + CANNOT_CANCEL_STARTED, + CANNOT_PROMOTE_NON_PENDING_ORDERLINE, + UPDATE_ORDERLINE_WILL_SHIFT_CURRENT, + ORDERLINE_BEING_MODIFIED_IS_NOT_NORMAL_OR_PENDING, + INVALID_STATUS_CHANGE, + MORE_THAN_ONE_OPERATION_NOT_PERMITTED, + INVALID_TIMEZONE_IN_DATE_RANGES, + UNKNOWN + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/billing/v201406")] + public partial class BudgetOrderError : ApiError { + private BudgetOrderErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BudgetOrderErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BudgetOrderError.Reason", Namespace = "https://adwords.google.com/api/adwords/billing/v201406")] + public enum BudgetOrderErrorReason { + CUSTOMER_NOT_WHITELISTED_FOR_NEW_BILLING, + BUDGET_APPROVAL_IN_PROGRESS, + SERVICE_UNAVAILABLE, + INVALID_BILLING_ACCOUNT, + GENERIC_BILLING_ERROR, + INVALID_BILLING_ACCOUNT_ID_FORMAT, + INVALID_BUDGET_DATE_RANGE, + INCOMPATIBLE_CURRENCY, + BUDGET_UPDATE_DENIED, + BUDGET_ALREADY_STARTED, + BUDGET_ALREADY_ENDED, + INVALID_CONSTRAINT, + INVALID_BID_TOO_LARGE, + NO_SUCH_BUDGET_FOUND, + INVALID_BUDGET_ALREADY_SPENT, + INVALID_TIMEZONE_IN_DATE, + ACCOUNT_BUDGET_ID_SET_IN_ADD, + MORE_THAN_ONE_OPERATIONS, + MCC_HIERARCHY_SIZE_TOO_LARGE, + INVALID_MCC_HIERARCHY, + UNKNOWN + } + public interface IBudgetService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + BudgetPage get(Selector selector); + BudgetReturnValue mutate(BudgetOperation[] operations); + BudgetPage query(string query1); + } + public interface ICampaignAdExtensionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CampaignAdExtensionPage get(Selector serviceSelector); + CampaignAdExtensionReturnValue mutate(CampaignAdExtensionOperation[] operations); + } + public interface ICampaignCriterionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CampaignCriterionPage get(Selector serviceSelector); + CampaignCriterionReturnValue mutate(CampaignCriterionOperation[] operations); + CampaignCriterionPage query(string query1); + } + public interface ICampaignService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CampaignPage get(Selector serviceSelector); + CampaignReturnValue mutate(CampaignOperation[] operations); + CampaignLabelReturnValue mutateLabel(CampaignLabelOperation[] operations); + CampaignPage query(string query1); + } + public interface ICampaignFeedService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CampaignFeedPage get(Selector selector); + CampaignFeedReturnValue mutate(CampaignFeedOperation[] operations); + CampaignFeedPage query(string query1); + } + public interface IConstantDataService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AgeRange[] getAgeRangeCriterion(); + Carrier[] getCarrierCriterion(); + Gender[] getGenderCriterion(); + Language[] getLanguageCriterion(); + MobileDevice[] getMobileDeviceCriterion(); + OperatingSystemVersion[] getOperatingSystemVersionCriterion(); + ProductBiddingCategoryData[] getProductBiddingCategoryData(Selector selector); + CriterionUserInterest[] getUserInterestCriterion(ConstantDataServiceUserInterestTaxonomyType userInterestTaxonomyType, bool userInterestTaxonomyTypeSpecified); + Vertical[] getVerticalCriterion(); + } + public interface IConversionTrackerService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ConversionTrackerPage get(Selector serviceSelector); + ConversionTrackerReturnValue mutate(ConversionTrackerOperation[] operations); + } + public interface ICustomerService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Customer get(); + Customer mutate(Customer customer); + } + public interface ICustomerSyncService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CustomerChangeData get(CustomerSyncSelector selector); + } + public interface ICustomerFeedService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CustomerFeedPage get(Selector selector); + CustomerFeedReturnValue mutate(CustomerFeedOperation[] operations); + CustomerFeedPage query(string query1); + } + public interface IAdGroupAdService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdGroupAdPage get(Selector serviceSelector); + AdGroupAdReturnValue mutate(AdGroupAdOperation[] operations); + AdGroupAdLabelReturnValue mutateLabel(AdGroupAdLabelOperation[] operations); + AdGroupAdPage query(string query1); + } + public interface IDataService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdGroupBidLandscapePage getAdGroupBidLandscape(Selector serviceSelector); + CriterionBidLandscapePage getCriterionBidLandscape(Selector serviceSelector); + DomainCategoryPage getDomainCategory(Selector serviceSelector); + AdGroupBidLandscapePage queryAdGroupBidLandscape(string query); + CriterionBidLandscapePage queryCriterionBidLandscape(string query); + DomainCategoryPage queryDomainCategory(string query); + } + public interface IExperimentService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ExperimentPage get(Selector serviceSelector); + ExperimentReturnValue mutate(ExperimentOperation[] operations); + } + public interface IFeedService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + FeedPage get(Selector selector); + FeedReturnValue mutate(FeedOperation[] operations); + FeedPage query(string query1); + } + public interface IFeedItemService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + FeedItemPage get(Selector selector); + FeedItemReturnValue mutate(FeedItemOperation[] operations); + FeedItemPage query(string query1); + } + public interface IFeedMappingService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + FeedMappingPage get(Selector selector); + FeedMappingReturnValue mutate(FeedMappingOperation[] operations); + FeedMappingPage query(string query1); + } + public interface IGeoLocationService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + GeoLocation[] get(GeoLocationSelector selector); + } + public interface ILocationCriterionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + LocationCriterion[] get(Selector selector); + LocationCriterion[] query(string query1); + } + public interface IManagedCustomerService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ManagedCustomerPage get(Selector serviceSelector); + PendingInvitation[] getPendingInvitations(PendingInvitationSelector selector); + ManagedCustomerReturnValue mutate(ManagedCustomerOperation[] operations); + ManagedCustomerLink[] mutateLink(LinkOperation[] operations); + ManagedCustomerLink[] mutateManager(MoveOperation[] operations); + } + public interface IMediaService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + MediaPage get(Selector serviceSelector); + MediaPage query(string query1); + Media[] upload(Media[] media); + } + public interface IMutateJobService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Job[] get(JobSelector selector); + JobResult getResult(JobSelector selector); + SimpleMutateJob mutate(Operation[] operations, BulkMutateJobPolicy policy); + } + public interface IAdGroupFeedService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdGroupFeedPage get(Selector selector); + AdGroupFeedReturnValue mutate(AdGroupFeedOperation[] operations); + AdGroupFeedPage query(string query1); + } + public interface IOfflineConversionFeedService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + OfflineConversionFeedReturnValue mutate(OfflineConversionFeedOperation[] operations); + } + public interface IReportDefinitionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ReportDefinitionField[] getReportFields(ReportDefinitionReportType reportType); + } + public interface ITargetingIdeaService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + TargetingIdeaPage get(TargetingIdeaSelector selector); + TargetingIdeaPage getBulkKeywordIdeas(TargetingIdeaSelector selector); + } + public interface ITrafficEstimatorService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + TrafficEstimatorResult get(TrafficEstimatorSelector selector); + } + public interface IAdwordsUserListService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + UserListPage get(Selector serviceSelector); + UserListReturnValue mutate(UserListOperation[] operations); + } + public interface IExpressBusinessService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ExpressBusinessPage get(Selector selector); + ExpressBusiness[] mutate(ExpressBusinessOperation[] operations); + } + public interface IBudgetSuggestionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + BudgetSuggestion get(BudgetSuggestionSelector selector); + } + public interface IProductService { + string text { + get; + set; + } + string locale { + get; + set; + } + } + public interface IPromotionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + PromotionPage get(Selector selector); + Promotion[] mutate(PromotionOperation[] operations); + } + public interface IProductServiceService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ProductServicePage get(Selector selector); + } + public interface ICampaignSharedSetService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CampaignSharedSetPage get(Selector selector); + CampaignSharedSetReturnValue mutate(CampaignSharedSetOperation[] operations); + } + public interface IAdGroupCriterionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdGroupCriterionPage get(Selector serviceSelector); + AdGroupCriterionReturnValue mutate(AdGroupCriterionOperation[] operations); + AdGroupCriterionLabelReturnValue mutateLabel(AdGroupCriterionLabelOperation[] operations); + AdGroupCriterionPage query(string query1); + } + public interface ISharedCriterionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + SharedCriterionPage get(Selector selector); + SharedCriterionReturnValue mutate(SharedCriterionOperation[] operations); + } + public interface ISharedSetService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + SharedSetPage get(Selector selector); + SharedSetReturnValue mutate(SharedSetOperation[] operations); + } + public interface ILabelService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + LabelPage get(Selector serviceSelector); + LabelReturnValue mutate(LabelOperation[] operations); + LabelPage query(string query1); + } + public interface IAdGroupService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdGroupPage get(Selector serviceSelector); + AdGroupReturnValue mutate(AdGroupOperation[] operations); + AdGroupLabelReturnValue mutateLabel(AdGroupLabelOperation[] operations); + AdGroupPage query(string query1); + } + public interface IAdGroupBidModifierService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdGroupBidModifierPage get(Selector selector); + AdGroupBidModifierReturnValue mutate(AdGroupBidModifierOperation[] operations); + AdGroupBidModifierPage query(string query1); + } + public interface IAdParamService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdParamPage get(Selector serviceSelector); + AdParam[] mutate(AdParamOperation[] operations); + } + public interface IAlertService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AlertPage get(AlertSelector selector); + } + public interface IBiddingStrategyService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + BiddingStrategyPage get(Selector selector); + BiddingStrategyReturnValue mutate(BiddingStrategyOperation[] operations); + BiddingStrategyPage query(string query1); + } + public interface IBudgetOrderService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + BudgetOrderPage get(Selector serviceSelector); + BillingAccount[] getBillingAccounts(); + BudgetOrderReturnValue mutate(BudgetOrderOperation[] operations); + } +} diff --git a/src/AdWords/v201406/AdWordsServiceV201406.cs b/src/AdWords/v201406/AdWordsServiceV201406.cs new file mode 100644 index 00000000000..0de4b4071d6 --- /dev/null +++ b/src/AdWords/v201406/AdWordsServiceV201406.cs @@ -0,0 +1,384 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; + +namespace Google.Api.Ads.AdWords.Lib { + + /// + /// Lists all the services available through this library. + /// + public partial class AdWordsService : AdsService { + + /// + /// All the services available in v201406. + /// + public class v201406 { + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdGroupAdService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdGroupBidModifierService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdGroupCriterionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdGroupFeedService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdGroupService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdParamService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdwordsUserListService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AlertService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature BiddingStrategyService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature BudgetOrderService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature BudgetService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CampaignAdExtensionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CampaignCriterionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CampaignFeedService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CampaignService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ConstantDataService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ConversionTrackerService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomerService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomerSyncService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomerFeedService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature DataService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ExperimentService; + + /// + /// Factory type for v201406 services. + /// + public static readonly Type factoryType = typeof(AdWordsServiceFactory); + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature FeedItemService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature FeedMappingService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature FeedService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature GeoLocationService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LocationCriterionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ManagedCustomerService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature MediaService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature MutateJobService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature OfflineConversionFeedService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReportDefinitionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature TargetingIdeaService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature TrafficEstimatorService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ExpressBusinessService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature BudgetSuggestionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature PromotionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProductServiceService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CampaignSharedSetService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SharedCriterionService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SharedSetService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LabelService; + + /// + /// Static constructor to initialize the service constants. + /// + static v201406() { + OfflineConversionFeedService = + AdWordsService.MakeServiceSignature("v201406", "cm", "OfflineConversionFeedService"); + AdGroupAdService = + AdWordsService.MakeServiceSignature("v201406", "cm", "AdGroupAdService"); + AdGroupCriterionService = + AdWordsService.MakeServiceSignature("v201406", "cm", "AdGroupCriterionService"); + AdGroupService = + AdWordsService.MakeServiceSignature("v201406", "cm", "AdGroupService"); + AdGroupBidModifierService = + AdWordsService.MakeServiceSignature("v201406", "cm", "AdGroupBidModifierService"); + AdGroupFeedService = + AdWordsService.MakeServiceSignature("v201406", "cm", "AdGroupFeedService"); + AdParamService = + AdWordsService.MakeServiceSignature("v201406", "cm", "AdParamService"); + AdwordsUserListService = + AdWordsService.MakeServiceSignature("v201406", "rm", "AdwordsUserListService"); + AlertService = + AdWordsService.MakeServiceSignature("v201406", "mcm", "AlertService"); + BiddingStrategyService = + AdWordsService.MakeServiceSignature("v201406", "cm", "BiddingStrategyService"); + BudgetService = + AdWordsService.MakeServiceSignature("v201406", "cm", "BudgetService"); + BudgetOrderService = + AdWordsService.MakeServiceSignature("v201406", "billing", "BudgetOrderService"); + CampaignAdExtensionService = + AdWordsService.MakeServiceSignature("v201406", "cm", "CampaignAdExtensionService"); + CampaignCriterionService = + AdWordsService.MakeServiceSignature("v201406", "cm", "CampaignCriterionService"); + CampaignService = + AdWordsService.MakeServiceSignature("v201406", "cm", "CampaignService"); + CampaignFeedService = + AdWordsService.MakeServiceSignature("v201406", "cm", "CampaignFeedService"); + ConstantDataService = + AdWordsService.MakeServiceSignature("v201406", "cm", "ConstantDataService"); + ConversionTrackerService = + AdWordsService.MakeServiceSignature("v201406", "cm", "ConversionTrackerService"); + CustomerService = + AdWordsService.MakeServiceSignature("v201406", "mcm", "CustomerService"); + CustomerSyncService = + AdWordsService.MakeServiceSignature("v201406", "ch", "CustomerSyncService"); + CustomerFeedService = + AdWordsService.MakeServiceSignature("v201406", "cm", "CustomerFeedService"); + DataService = + AdWordsService.MakeServiceSignature("v201406", "cm", "DataService"); + ExperimentService = + AdWordsService.MakeServiceSignature("v201406", "cm", "ExperimentService"); + FeedService = + AdWordsService.MakeServiceSignature("v201406", "cm", "FeedService"); + FeedItemService = + AdWordsService.MakeServiceSignature("v201406", "cm", "FeedItemService"); + FeedMappingService = + AdWordsService.MakeServiceSignature("v201406", "cm", "FeedMappingService"); + GeoLocationService = + AdWordsService.MakeServiceSignature("v201406", "cm", "GeoLocationService"); + LocationCriterionService = + AdWordsService.MakeServiceSignature("v201406", "cm", "LocationCriterionService"); + ManagedCustomerService = + AdWordsService.MakeServiceSignature("v201406", "mcm", "ManagedCustomerService"); + MediaService = + AdWordsService.MakeServiceSignature("v201406", "cm", "MediaService"); + MutateJobService = + AdWordsService.MakeServiceSignature("v201406", "cm", "MutateJobService"); + ReportDefinitionService = + AdWordsService.MakeServiceSignature("v201406", "cm", "ReportDefinitionService"); + TargetingIdeaService = + AdWordsService.MakeServiceSignature("v201406", "o", "TargetingIdeaService"); + TrafficEstimatorService = + AdWordsService.MakeServiceSignature("v201406", "o", "TrafficEstimatorService"); + + ExpressBusinessService = + AdWordsService.MakeServiceSignature("v201406", "express", + "ExpressBusinessService"); + BudgetSuggestionService = + AdWordsService.MakeServiceSignature("v201406", "express", "BudgetSuggestionService"); + PromotionService = + AdWordsService.MakeServiceSignature("v201406", "express", "PromotionService"); + ProductServiceService = + AdWordsService.MakeServiceSignature("v201406", "express", "ProductServiceService"); + + SharedCriterionService = + AdWordsService.MakeServiceSignature("v201406", "cm", "SharedCriterionService"); + CampaignSharedSetService = + AdWordsService.MakeServiceSignature("v201406", "cm", "CampaignSharedSetService"); + SharedSetService = + AdWordsService.MakeServiceSignature("v201406", "cm", "SharedSetService"); + LabelService = + AdWordsService.MakeServiceSignature("v201406", "cm", "LabelService"); + } + } + } +} \ No newline at end of file diff --git a/src/AdWords/v201406/ReportDefinition.cs b/src/AdWords/v201406/ReportDefinition.cs new file mode 100644 index 00000000000..d18fd258b82 --- /dev/null +++ b/src/AdWords/v201406/ReportDefinition.cs @@ -0,0 +1,203 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +#pragma warning disable 1591 + +namespace Google.Api.Ads.AdWords.v201406 { + using Google.Api.Ads.AdWords.Headers; + using Google.Api.Ads.AdWords.Lib; + + using System.Web.Services.Protocols; + using System; + using System.ComponentModel; + using System.Diagnostics; + using System.Web.Services; + using System.Xml.Serialization; + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public partial class ReportDefinition { + private long idField; + + private bool idFieldSpecified; + + private Selector selectorField; + + private string reportNameField; + + private ReportDefinitionReportType reportTypeField; + + private bool reportTypeFieldSpecified; + + private bool hasAttachmentField; + + private bool hasAttachmentFieldSpecified; + + private ReportDefinitionDateRangeType dateRangeTypeField; + + private bool dateRangeTypeFieldSpecified; + + private DownloadFormat downloadFormatField; + + private bool downloadFormatFieldSpecified; + + private string creationTimeField; + + private bool includeZeroImpressionsField; + + private bool includeZeroImpressionsFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public Selector selector { + get { return this.selectorField; } + set { this.selectorField = value; } + } + + public string reportName { + get { return this.reportNameField; } + set { this.reportNameField = value; } + } + + public ReportDefinitionReportType reportType { + get { return this.reportTypeField; } + set { + this.reportTypeField = value; + this.reportTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reportTypeSpecified { + get { return this.reportTypeFieldSpecified; } + set { this.reportTypeFieldSpecified = value; } + } + + public bool hasAttachment { + get { return this.hasAttachmentField; } + set { + this.hasAttachmentField = value; + this.hasAttachmentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasAttachmentSpecified { + get { return this.hasAttachmentFieldSpecified; } + set { this.hasAttachmentFieldSpecified = value; } + } + + public ReportDefinitionDateRangeType dateRangeType { + get { return this.dateRangeTypeField; } + set { + this.dateRangeTypeField = value; + this.dateRangeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dateRangeTypeSpecified { + get { return this.dateRangeTypeFieldSpecified; } + set { this.dateRangeTypeFieldSpecified = value; } + } + + public DownloadFormat downloadFormat { + get { return this.downloadFormatField; } + set { + this.downloadFormatField = value; + this.downloadFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool downloadFormatSpecified { + get { return this.downloadFormatFieldSpecified; } + set { this.downloadFormatFieldSpecified = value; } + } + + public string creationTime { + get { return this.creationTimeField; } + set { this.creationTimeField = value; } + } + + public bool includeZeroImpressions { + get { return this.includeZeroImpressionsField; } + set { + this.includeZeroImpressionsField = value; + this.includeZeroImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeZeroImpressionsSpecified { + get { return this.includeZeroImpressionsFieldSpecified; } + set { this.includeZeroImpressionsFieldSpecified = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportDefinition.DateRangeType", Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum ReportDefinitionDateRangeType { + TODAY, + YESTERDAY, + LAST_7_DAYS, + LAST_WEEK, + LAST_BUSINESS_WEEK, + THIS_MONTH, + LAST_MONTH, + ALL_TIME, + CUSTOM_DATE, + LAST_14_DAYS, + LAST_30_DAYS, + THIS_WEEK_SUN_TODAY, + THIS_WEEK_MON_TODAY, + LAST_WEEK_SUN_SAT + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://adwords.google.com/api/adwords/cm/v201406")] + public enum DownloadFormat { + CSVFOREXCEL, + CSV, + TSV, + XML, + GZIPPED_CSV, + GZIPPED_XML + } +} diff --git a/src/Common/AdsApi.snk b/src/Common/AdsApi.snk new file mode 100644 index 0000000000000000000000000000000000000000..ec3f95a81b7eabad745a46d3d5a41bfdad9e1f08 GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50098khK_oNbYq%=?O^MjDm1QRlz}mDy*v@} zyFJX3o-nzWlB1*E89YMX;)Ds3NTn zN`@AG1Q+1@(JLnyrrK2W$S!&~mnNCT(b3OR`kS8n9?J9pD<<5YoXVojpd4(Wp5NVH9|f6Ai*< z5tV4_*vpg<#L(YoQ@T6c#NLc^O|El>UZfU|R1_?WhZj0*X0Foj`GLf3xrK5R>t43k z@+BE{!3FtQUw<*bkJ8}L6zjO@$VqTSwr%>q^=oiDMReDZX`drypSlLeYv`iX zHza^C&A7K+Hg%>#4!M|QteHnPNHk2P-qWF^$F6_BIu#cPj@6+W@``@-BbzLUs3HDf z{lxkMC>o`_z`Q3zG zt4PxNR8YupxMo|ph=Muxm>&%*W^dlpBdbFaBe@DQD~Jh;B331BWYc!Kf9G3*!(|%y i6@qDr^z2-~2~-rv){Bw_+YYz(@3!R2@*&S-vqu?z%_5!v literal 0 HcmV?d00001 diff --git a/src/Common/Common.csproj b/src/Common/Common.csproj new file mode 100644 index 00000000000..6b3b90b0f4f --- /dev/null +++ b/src/Common/Common.csproj @@ -0,0 +1,112 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {277404DB-A439-4450-B3A5-186294CDF245} + Library + Properties + Google.Api.Ads.Common + Google.Ads.Common + v4.0 + true + AdsApi.snk + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AnyCPU + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + True + True + CommonErrorMessages.resx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Code + + + + + + + + + + + + + + + + + ResXFileCodeGenerator + CommonErrorMessages.Designer.cs + Designer + + + + + + + + \ No newline at end of file diff --git a/src/Common/CommonErrorMessages.Designer.cs b/src/Common/CommonErrorMessages.Designer.cs new file mode 100644 index 00000000000..64c3f6b4abd --- /dev/null +++ b/src/Common/CommonErrorMessages.Designer.cs @@ -0,0 +1,243 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.1008 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Google.Api.Ads.Common { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class CommonErrorMessages { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal CommonErrorMessages() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Google.Api.Ads.Common.CommonErrorMessages", typeof(CommonErrorMessages).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to AuthToken login failed. See ErrorCode for more details.. + /// + internal static string AuthTokenLoginFailed { + get { + return ResourceManager.GetString("AuthTokenLoginFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Email cannot be null. + /// + internal static string EmailCannotBeNull { + get { + return ResourceManager.GetString("EmailCannotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Failed to parse response from server. See inner exception for more details.. + /// + internal static string FailedToParseAuthTokenException { + get { + return ResourceManager.GetString("FailedToParseAuthTokenException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid stage for Soap message.. + /// + internal static string InvalidStageForSoapMessage { + get { + return ResourceManager.GetString("InvalidStageForSoapMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not locate factoryType field in Type {0}. + /// + internal static string MissingFactoryType { + get { + return ResourceManager.GetString("MissingFactoryType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OAuth2 authorizationCode cannot be empty when fetching access token.. + /// + internal static string OAuth2AuthorizationCodeIsEmpty { + get { + return ResourceManager.GetString("OAuth2AuthorizationCodeIsEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OAuth2 Offline mode should be true to refresh access token.. + /// + internal static string OAuth2IsNotInOfflineMode { + get { + return ResourceManager.GetString("OAuth2IsNotInOfflineMode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Looks like your application is not configured to use OAuth2 properly. Required OAuth2 parameter {0} is missing. You may run Common\\Utils\\OAuth2TokenGenerator.cs to generate a default OAuth2 configuration.. + /// + internal static string OAuth2ParameterErrorMessage { + get { + return ResourceManager.GetString("OAuth2ParameterErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not load an oauth extension class.. + /// + internal static string OAuthExtensionNotLoaded { + get { + return ResourceManager.GetString("OAuthExtensionNotLoaded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Password cannot be null. + /// + internal static string PasswordCannotBeNull { + get { + return ResourceManager.GetString("PasswordCannotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Quotes not closed in csv record.. + /// + internal static string QuotesNotClosedInCsvLine { + get { + return ResourceManager.GetString("QuotesNotClosedInCsvLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service cannot be null. + /// + internal static string ServiceCannotBeNull { + get { + return ResourceManager.GetString("ServiceCannotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cache signature cannot be null.. + /// + internal static string SignatureCannotBeNull { + get { + return ResourceManager.GetString("SignatureCannotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The SoapListenerExtension class is not loaded. The most possible cause for this error is that you haven't registered Google.Api.Ads.Common.Lib.SoapListenerExtension as a soap extension under configuration/system.web/webServices/soapExtensionTypes in your your App.config or Web.config. See the sample App.config for details on how to register soap extensions.. + /// + internal static string SoapListenerExtensionNotLoaded { + get { + return ResourceManager.GetString("SoapListenerExtensionNotLoaded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Source stream is not readable.. + /// + internal static string SourceStreamIsNotReadable { + get { + return ResourceManager.GetString("SourceStreamIsNotReadable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start index should be less than end index.. + /// + internal static string StartIndexShouldBeLessThanEndIndex { + get { + return ResourceManager.GetString("StartIndexShouldBeLessThanEndIndex", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This parameter should be greater than 0 and less than the length of text.. + /// + internal static string StringIndexOutOfBounds { + get { + return ResourceManager.GetString("StringIndexOutOfBounds", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Target stream is not writable.. + /// + internal static string TargetStreamIsNotWritable { + get { + return ResourceManager.GetString("TargetStreamIsNotWritable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Text to split cannot be null.. + /// + internal static string TextCannotBeNull { + get { + return ResourceManager.GetString("TextCannotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unregistered service type {0} was requested.. + /// + internal static string UnregisteredServiceTypeRequested { + get { + return ResourceManager.GetString("UnregisteredServiceTypeRequested", resourceCulture); + } + } + } +} diff --git a/src/Common/CommonErrorMessages.resx b/src/Common/CommonErrorMessages.resx new file mode 100644 index 00000000000..ca3f267c8e1 --- /dev/null +++ b/src/Common/CommonErrorMessages.resx @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + AuthToken login failed. See ErrorCode for more details. + Used by AuthToken when login fails. + + + Email cannot be null + Used by AuthTokenCache when an empty email is passed to it. + + + Failed to parse response from server. See inner exception for more details. + Used as default error message when auth token error parsing fails. + + + Invalid stage for Soap message. + Used for ArgumentException by TraceExtension.ProcessMessage if message parameter has an invalid value for Stage field. + + + Could not locate factoryType field in Type {0} + Used for ArgumentException when AdsUser.RegisterServices cannot locate factoryType in a registered Service. + + + OAuth2 authorizationCode cannot be empty when fetching access token. + Used to validate authorizationCode in OAuth2 flow. + + + OAuth2 Offline mode should be true to refresh access token. + Used to check if OAuth2 offline mode is enabled when refreshing access tokens. + + + Looks like your application is not configured to use OAuth2 properly. Required OAuth2 parameter {0} is missing. You may run Common\\Utils\\OAuth2TokenGenerator.cs to generate a default OAuth2 configuration. + Thrown when a required OAuth2 parameter is missing. + + + Could not load an oauth extension class. + + + Password cannot be null + Used by AuthTokenCache when an empty password is passed to it. + + + Quotes not closed in csv record. + Used for CsvException by CsvFile.SplitCsvLine if text parameter has an unclosed quote. + + + Service cannot be null + Used by AuthTokenCache when an empty service is passed to it. + + + Cache signature cannot be null. + Used for ArgumentException by InMemoryTokenCache class. + + + The SoapListenerExtension class is not loaded. The most possible cause for this error is that you haven't registered Google.Api.Ads.Common.Lib.SoapListenerExtension as a soap extension under configuration/system.web/webServices/soapExtensionTypes in your your App.config or Web.config. See the sample App.config for details on how to register soap extensions. + Thrown when SoapListenerExtension was not loaded as a soap extension from App.config. + + + Source stream is not readable. + Used for ArgumentException by MediaUtilities.CopyStream if source stream is not readable. + + + Start index should be less than end index. + Used for ArgumentException by ExtractAndAddItem if startIndex > endIndex. + + + This parameter should be greater than 0 and less than the length of text. + Used for ArgumentOutOfRangeException wherever string index is out of bounds. + + + Target stream is not writable. + Used for ArgumentException by MediaUtilities.CopyStream if target stream is not writable. + + + Text to split cannot be null. + Used for ArgumentNullException by CsvFile.SplitCsvLine for 'text' parameter. + + + Unregistered service type {0} was requested. + Used for InvalidCastException by AdsUser.GetService for serviceSignature parameter if an unregistered service type is requested. + + \ No newline at end of file diff --git a/src/Common/Lib/AdsClient.cs b/src/Common/Lib/AdsClient.cs new file mode 100644 index 00000000000..a61eee5e087 --- /dev/null +++ b/src/Common/Lib/AdsClient.cs @@ -0,0 +1,182 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Net; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using Google.Api.Ads.Common.Lib; + +namespace Google.Api.Ads.Common.Lib { + /// + /// This interface defines a client protocol (SOAP, WSE, REST, etc.) + /// supported by the library. + /// + public interface AdsClient { + /// + /// Gets or sets the name of the connection group for the request. + /// + string ConnectionGroupName { + get; + set; + } + + /// + /// Gets or sets security credentials for client authentication. + /// + ICredentials Credentials { + get; + set; + } + + /// + /// Gets or sets whether pre-authentication is enabled. + /// + bool PreAuthenticate { + get; + set; + } + + /// + /// The System.Text.Encoding used to make the client request to the service. + /// + Encoding RequestEncoding { + get; + set; + } + + /// + /// The timeout for the request. + /// + int Timeout { + get; + set; + } + + /// + /// The url endpoint for the service. + /// + string Url { + get; + set; + } + + /// + /// Gets or sets whether this service should use the credentials from + /// System.Net.CredentialCache.DefaultCredentials. + /// + bool UseDefaultCredentials { + get; + set; + } + + /// + /// Gets or sets whether the client automatically follows server redirects. + /// + bool AllowAutoRedirect { + get; + set; + } + + /// + /// Gets the collection of client certificates. + /// + X509CertificateCollection ClientCertificates { + get; + } + + /// + /// Gets or sets the collection of cookies. + /// + CookieContainer CookieContainer { + get; + set; + } + + /// + /// Gets or sets whether gzip compression is enabled. + /// + bool EnableDecompression { + get; + set; + } + + /// + /// Gets or sets proxy information for making a service request through + /// a firewall. + /// + IWebProxy Proxy { + get; + set; + } + + /// + /// Gets or sets a value that indicates whether connection sharing is + /// enabled when the client uses NTLM authentication to connect to the Web + /// server that hosts the web service. + /// + bool UnsafeAuthenticatedConnectionSharing { + get; + set; + } + + /// + /// Gets or sets the value for the user agent header that is sent with each + /// request. + /// + string UserAgent { + get; + set; + } + + /// + /// Gets or sets the AdsUser object that created this + /// service. + /// + AdsUser User { + get; + set; + } + + /// + /// Gets or sets the signature for this service. + /// + ServiceSignature Signature { + get; + set; + } + + /// + /// Gets or sets the web request associated with this service's + /// last API call. + /// + WebRequest LastRequest { + get; + set; + } + + /// + /// Gets or sets the web response associated with this service's + /// last API call. + /// + WebResponse LastResponse { + get; + set; + } + } +} diff --git a/src/Common/Lib/AdsException.cs b/src/Common/Lib/AdsException.cs new file mode 100644 index 00000000000..da7c337f767 --- /dev/null +++ b/src/Common/Lib/AdsException.cs @@ -0,0 +1,74 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Base class for all exceptions thrown by the library related + /// to an Ads API call. + /// + [Serializable] + public abstract class AdsException : Exception { + /// + /// Protected constructor. + /// + protected AdsException() : base() { + } + + /// + /// Protected constructor. + /// + /// Error message for this API exception. + protected AdsException(string message) : base(message) { + } + + /// + /// Protected constructor. + /// + /// Error message for this API exception. + /// Inner exception, if any. + protected AdsException(string message, Exception innerException) + : base(message, innerException) { + } + + /// + /// Protected constructor, used by serialization frameworks while + /// deserializing an exception object. + /// + /// Info about the serialization context. + /// A streaming context that represents the + /// serialization stream. + protected AdsException(SerializationInfo info, StreamingContext context) : base(info, context) { + } + + /// + /// Gets a specified field from serialization stream. + /// + /// The type of field. + /// The serialization context. + /// The serialization field name. + /// The deserialized value of field. + protected T GetValue(SerializationInfo info, string fieldName) { + return (T) info.GetValue(fieldName, typeof(T)); + } + } +} diff --git a/src/Common/Lib/AdsOAuthException.cs b/src/Common/Lib/AdsOAuthException.cs new file mode 100644 index 00000000000..5efa00c99ab --- /dev/null +++ b/src/Common/Lib/AdsOAuthException.cs @@ -0,0 +1,65 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.IO; +using System.Runtime.Serialization; +using System.Security.Permissions; +using System.Text; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Exception thrown when OAuth authentication with Ads server fails. + /// + [Serializable] + public class AdsOAuthException : AdsException { + /// + /// Public constructor. + /// + public AdsOAuthException() : base() { + } + + /// + /// Public constructor. + /// + /// Error message for this API exception. + public AdsOAuthException(string message) : base(message) { + } + + /// + /// Public constructor. + /// + /// Error message for this API exception. + /// Inner exception, if any. + public AdsOAuthException(string message, Exception innerException) + : base(message, innerException) { + } + + /// + /// Protected constructor. Used by serialization frameworks while + /// deserializing an exception object. + /// + /// Info about the serialization context. + /// A streaming context that represents the + /// serialization stream. + protected AdsOAuthException(SerializationInfo info, StreamingContext context) + : base(info, context) { + } + } +} diff --git a/src/Common/Lib/AdsOAuthProvider.cs b/src/Common/Lib/AdsOAuthProvider.cs new file mode 100644 index 00000000000..4f7472120e5 --- /dev/null +++ b/src/Common/Lib/AdsOAuthProvider.cs @@ -0,0 +1,120 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Called when an AdsOAuthProvider obtained a new access token and optionally + /// a new refresh token from the OAuth server. + /// + /// The provider. + public delegate void OAuthTokensObtainedCallback(AdsOAuthProvider provider); + + /// + /// The type of OAuth2 flow. + /// + public enum OAuth2Flow { + /// + /// Web and installed application flows. + /// + APPLICATION, + + /// + /// Service account flow. + /// + SERVICE_ACCOUNT + } + + /// + /// Provides OAuth authorization mechanism for Ads services. + /// + public interface AdsOAuthProvider : Configurable { + /// + /// Gets or sets the client that is making the request. This value is + /// obtained from the + /// API console during application registration. + /// + string ClientId { get; set; } + + /// + /// Gets or sets the client secret obtained from the + /// API console + /// during application registration.during application registration. + /// + string ClientSecret { get; set; } + + /// + /// Gets or sets the API access your application is requesting. This is + /// space delimited. + /// + string Scope { get; set; } + + /// + /// Gets or sets a parameter that your application can use for keeping + /// state. The OAuth Authorization Server roundtrips this parameter. + /// + string State { get; set; } + + /// + /// Gets the type of token returned by the server. This field will + /// always have the value Bearer for now. + /// + string TokenType { get; } + + /// + /// Gets or sets the token that can be sent to a Google API for + /// authentication. + /// + string AccessToken { get; set; } + + /// + /// Gets or sets the time at which access token was retrieved. + /// + DateTime UpdatedOn { get; set; } + + /// + /// Gets the remaining lifetime on the access token. + /// + int ExpiresIn { get; set; } + + /// + /// Refreshes the access token if expiring. + /// + void RefreshAccessToken(); + + /// + /// Refreshes the access token if expiring. + /// + void RefreshAccessTokenIfExpiring(); + + /// + /// Gets the OAuth authorization header to be used with HTTP requests. + /// + /// The authorization header. + string GetAuthHeader(); + + /// + /// Callback triggered when this provider obtains a new access token or + /// refresh token from the OAuth server. + /// + OAuthTokensObtainedCallback OnOAuthTokensObtained { + get; + } + } +} diff --git a/src/Common/Lib/AdsOAuthProviderForApplications.cs b/src/Common/Lib/AdsOAuthProviderForApplications.cs new file mode 100644 index 00000000000..55350b2d7bc --- /dev/null +++ b/src/Common/Lib/AdsOAuthProviderForApplications.cs @@ -0,0 +1,69 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Provides OAuth authorization mechanism for Ads services when using Web and + /// Installed application flows. + /// + public interface AdsOAuthProviderForApplications : AdsOAuthProvider { + /// + /// Indicates if your application needs to access APIs when the user is not + /// present at the browser. This is defaulted to true. + /// + bool IsOffline { get; set; } + + /// + /// Gets or sets where the url where the response is sent. This should be a + /// registered redirect uri on the + /// API console. + /// + string RedirectUri { get; set; } + + /// + /// Gets or sets a token that may be used to obtain a new access token. + /// Refresh tokens are valid until the user revokes access. + /// + string RefreshToken { get; set; } + + /// + /// Gets the authorization URL. + /// + /// The authorization url. + string GetAuthorizationUrl(); + + /// + /// Fetches the access and optionally the refresh token if applicable. + /// + /// The authorization code returned by + /// OAuth server. + /// True if the tokens were fetched successfully, false otherwise. + /// + bool FetchAccessAndRefreshTokens(string authorizationCode); + + /// + /// Refreshes the access token if offline mode is used. + /// + void RefreshAccessTokenInOfflineMode(); + + /// + /// Revokes the refresh token if offline mode is used. + /// + void RevokeRefreshToken(); + } +} diff --git a/src/Common/Lib/AdsOAuthProviderForServiceAccounts.cs b/src/Common/Lib/AdsOAuthProviderForServiceAccounts.cs new file mode 100644 index 00000000000..fb506e6b3f9 --- /dev/null +++ b/src/Common/Lib/AdsOAuthProviderForServiceAccounts.cs @@ -0,0 +1,51 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Provides OAuth authorization mechanism for Ads services when using service + /// account flow. + /// + public interface AdsOAuthProviderForServiceAccounts : AdsOAuthProvider { + /// + /// Gets or sets the service account email for which access token should be + /// retrieved.. + /// + string ServiceAccountEmail { get; set; } + + /// + /// Gets or sets the email of the account for which the call is being made. + /// + string PrnEmail { get; set; } + + /// + /// Gets or sets the JWT certificate path. + /// + string JwtCertificatePath { get; set; } + + /// + /// Gets or sets the JWT certificate password. + /// + string JwtCertificatePassword { get; set; } + + /// + /// Generates the access token for service account. + /// + void GenerateAccessTokenForServiceAccount(); + } +} diff --git a/src/Common/Lib/AdsService.cs b/src/Common/Lib/AdsService.cs new file mode 100644 index 00000000000..5c22de2fb3b --- /dev/null +++ b/src/Common/Lib/AdsService.cs @@ -0,0 +1,33 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.Reflection; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Lists all the services available through this library. + /// + public abstract class AdsService { + /// + /// Gets all service types defined in this service. + /// + /// The nested types that define service versions under this + /// service. + public abstract Type[] GetServiceTypes(); + } +} diff --git a/src/Common/Lib/AdsSoapClient.cs b/src/Common/Lib/AdsSoapClient.cs new file mode 100644 index 00000000000..fae617475a4 --- /dev/null +++ b/src/Common/Lib/AdsSoapClient.cs @@ -0,0 +1,362 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.IO; +using System.Net; +using System.Runtime.Remoting.Messaging; +using System.Text; +using System.Web; +using System.Web.Services; +using System.Web.Services.Configuration; +using System.Web.Services.Protocols; +using System.Xml; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Base class for all SOAP services supported by this library. + /// + [System.ComponentModel.DesignerCategoryAttribute("code")] + public abstract class AdsSoapClient : SoapHttpClientProtocol, AdsClient { + /// + /// The user that created this service instance. + /// + private AdsUser user; + + /// + /// The signature for this service. + /// + private ServiceSignature signature; + + /// + /// The WebRequest that was used by the last API call from this service. + /// + private WebRequest lastRequest; + + /// + /// The WebResponse for the last API call from this service. + /// + private WebResponse lastResponse; + + /// + /// An internal delegate to the method that makes the SOAP API call. + /// + /// The name of the SOAP API method. + /// The list of parameters for the SOAP API + /// method. + /// The results from calling the SOAP API method. + private delegate object[] CallMethod(string methodName, object[] parameters); + + /// + /// Gets or sets the AdsUser object that created this + /// service. + /// + public AdsUser User { + get { + return user; + } + set { + user = value; + } + } + + /// + /// Gets or sets the signature for this service. + /// + public ServiceSignature Signature { + get { + return signature; + } + set { + signature = value; + } + } + + /// + /// Gets or sets the web request associated with this service's + /// last API call. + /// + public WebRequest LastRequest { + get { + return lastRequest; + } + set { + lastRequest = value; + } + } + + /// + /// Gets or sets the web response associated with this service's + /// last API call. + /// + public WebResponse LastResponse { + get { + return lastResponse; + } + set { + lastResponse = value; + } + } + + /// + /// Invokes a SOAP service method synchronously using SOAP. + /// + /// The name of the SOAP service method + /// in the derived class that is invoking BeginInvoke. + /// An array of objects containing the + /// parameters to pass to the SOAP service. The order of the + /// values in the array correspond to the order of the parameters + /// in the calling method of the derived class. + /// An array of objects containing the return value and any + /// by reference or out parameters of the derived class method. + protected new object[] Invoke(string methodName, object[] parameters) { + return MakeApiCall(methodName, parameters); + } + + /// + /// Starts an asynchronous invocation of a SOAP service method + /// using SOAP. + /// + /// The name of the SOAP service method + /// in the derived class that is invoking BeginInvoke. + /// An array of objects containing the + /// parameters to pass to the SOAP service. The order of the + /// values in the array correspond to the order of the parameters + /// in the calling method of the derived class. + /// The delegate to call when the asynchronous + /// invoke is complete. + /// Extra information supplied by the caller. + /// + /// An IAsyncResult which is passed to EndInvoke to obtain + /// the return values from the remote method call. + protected new IAsyncResult BeginInvoke(string methodName, object[] parameters, + AsyncCallback callback, object asyncState) { + CallMethod apiFunction = new CallMethod(MakeApiCall); + return apiFunction.BeginInvoke(methodName, parameters, callback, apiFunction); + } + + /// + /// Ends an asynchronous invocation of a SOAP service method using + /// SOAP. + /// + /// The IAsyncResult returned from BeginInvoke. + /// + /// An array of objects containing the return value and any + /// by-reference or out parameters of the derived class method. + /// Thrown if + /// is null. + protected new object[] EndInvoke(IAsyncResult asyncResult) { + if (asyncResult == null) { + throw new ArgumentNullException("asyncResult"); + } + CallMethod apiFunction = (CallMethod) asyncResult.AsyncState; + return apiFunction.EndInvoke(asyncResult); + } + + /// + /// Initializes the service before MakeApiCall. + /// + /// Name of the method. + /// The method parameters. + protected virtual void InitForCall(string methodName, object[] parameters) { + if (!IsSoapListenerLoaded()) { + throw new ApplicationException(CommonErrorMessages.SoapListenerExtensionNotLoaded); + } + ContextStore.AddKey("SoapService", this); + ContextStore.AddKey("SoapMethod", methodName); + this.user.InitListeners(); + } + + /// + /// Cleans up the service after MakeApiCall. + /// + /// Name of the method. + /// The method parameters. + protected virtual void CleanupAfterCall(string methodName, object[] parameters) { + this.user.CleanupListeners(); + ContextStore.RemoveKey("SoapService"); + ContextStore.RemoveKey("SoapMethod"); + this.lastRequest = null; + this.lastResponse = null; + } + + /// + /// This method makes the actual SOAP API call. It is a thin wrapper + /// over SOAPHttpClientProtocol:Invoke, and provide things like + /// protection from race condition. + /// + /// The name of the SOAP API method. + /// The list of parameters for the SOAP API + /// method. + /// The results from calling the SOAP API method. + protected virtual object[] MakeApiCall(string methodName, object[] parameters) { + ErrorHandler errorHandler = CreateErrorHandler(); + + while (true) { + try { + InitForCall(methodName, parameters); + return base.Invoke(methodName, parameters); + } catch (SoapException ex) { + Exception customException = GetCustomException(ex); + if (errorHandler.ShouldRetry(customException)) { + errorHandler.PrepareForRetry(customException); + } else { + throw customException; + } + } finally { + CleanupAfterCall(methodName, parameters); + } + } + throw new ArgumentOutOfRangeException("Retry count cannot be negative."); + } + + /// + /// Creates the error handler. + /// + /// The error handler instance. + protected virtual ErrorHandler CreateErrorHandler() { + return new ErrorHandler(this.User.Config); + } + + /// + /// Determines whether SOAP listener extension is loaded. + /// + /// True, if SoapListenerExtension is loaded as a SOAP extension. + /// + private static bool IsSoapListenerLoaded() { + foreach (SoapExtensionTypeElement extensionElement in + WebServicesSection.Current.SoapExtensionTypes) { + if (extensionElement.Type == typeof(SoapListenerExtension)) { + return true; + } + } + return false; + } + + /// + /// Gets a custom exception that wraps the SOAP exception thrown + /// by the server. + /// + /// SOAPException that was thrown by the server. + /// A custom exception object that wraps the SOAP exception. + /// + /// Any service that wishes to provide a custom exception + /// should override this method. + protected virtual Exception GetCustomException(SoapException ex) { + return ex; + } + + /// + /// Creates a WebRequest instance for the specified url. + /// + /// The Uri to use when creating the WebRequest. + /// The WebRequest instance. + protected override WebRequest GetWebRequest(Uri uri) { + // Store the base WebRequest in the member variable for future access. + this.lastRequest = base.GetWebRequest(uri); + if (this.lastRequest is HttpWebRequest) { + (this.lastRequest as HttpWebRequest).ServicePoint.Expect100Continue = false; + } + return this.lastRequest; + } + + /// + /// Returns a response from a synchronous request to an XML Web + /// service method. + /// + /// The System.Net.WebRequest from which + /// to get the response. + /// The web response. + protected override WebResponse GetWebResponse(WebRequest request) { + // Store the base WebResponse in the member variable for future access. + this.lastResponse = base.GetWebResponse(request); + return this.lastResponse; + } + + /// + /// Returns a response from an asynchronous request to a SOAP service + /// method. + /// + /// The System.Net.WebRequest from which to get the + /// response. + /// The System.IAsyncResult to pass to System.Net. + /// HttpWebRequest.EndGetResponse(System.IAsyncResult) when the response + /// has completed. + /// The web response. + protected override WebResponse GetWebResponse(WebRequest request, IAsyncResult result) { + // Store the base WebResponse in the member variable for future access. + lastResponse = base.GetWebResponse(request, result); + return lastResponse; + } + + /// + /// Gets the default XML namespace, based on the type of this object. + /// + /// The XML namespace to which this object is serialized, or an + /// empty string if the method fails to retrieve the default namespace. + /// + /// + /// All the services making use of the XML Serialization framework + /// (including ones generated by wsdl.exe and xsd.exe) will have + /// a WebServiceBindingAttribute decoration, something like: + /// + /// [System.Web.Services.WebServiceBindingAttribute( + /// Name = "SomeServiceSoapBinding", + /// Namespace = "https://the_xml_namespace_for_serializing")] + /// public partial class SomeService : SoapHttpClientProtocol { + /// ... + /// } + /// + /// The only exception to this rule is when we choose to write our own + /// serialization framework, by implementing IXmlSerializable on + /// AdsSoapClient. If and when someone does that, and someone were to + /// call this method, then he/she will get an empty string from this + /// method. + /// + protected string GetDefaultNamespace() { + object[] attributes = this.GetType().GetCustomAttributes(false); + foreach (object attribute in attributes) { + if (attribute is WebServiceBindingAttribute) { + return ((WebServiceBindingAttribute) attribute).Namespace; + } + } + return String.Empty; + } + + /// + /// Extracts the fault xml node from soap exception. + /// + /// The SOAP exception corresponding to the SOAP + /// fault. + /// The xml namespace for the fault node. + /// The root node name for fault node. + /// The fault node. + protected static XmlElement GetFaultNode(SoapException exception, string ns, + string nodeName) { + // Issue 1: Exception.Detail could be null. Can happen if SoapException + // is a SoapHeaderException. + if (exception.Detail == null) { + return null; + } else { + XmlNamespaceManager xmlns = + new XmlNamespaceManager(exception.Detail.OwnerDocument.NameTable); + xmlns.AddNamespace("api", ns); + return (XmlElement) exception.Detail.SelectSingleNode("api:" + nodeName, xmlns); + } + } + } +} diff --git a/src/Common/Lib/AdsUser.cs b/src/Common/Lib/AdsUser.cs new file mode 100644 index 00000000000..3666e4ccac0 --- /dev/null +++ b/src/Common/Lib/AdsUser.cs @@ -0,0 +1,334 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Net; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Web.Services; +using System.Web.Services.Protocols; +using System.Xml; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Represents an Ads API user. + /// + public abstract class AdsUser : Configurable { + /// + /// The list of SOAP listeners. + /// + List listeners = new List(); + + /// + /// The OAuth provider. + /// + AdsOAuthProvider oAuthProvider = null; + + /// + /// The application configuration for this user. + /// + private AppConfig config; + + /// + /// Stores all the registered services and their factories. + /// + private Dictionary serviceFactoryMap = + new Dictionary(); + + /// + /// Gets or sets the OAuth provider. + /// + public AdsOAuthProvider OAuthProvider { + get { + return oAuthProvider; + } + set { + oAuthProvider = value; + } + } + + /// + /// Gets or sets the application configuration for this user. + /// + public AppConfig Config { + get { + return config; + } + } + + /// + /// Gets the listeners. + /// + public List Listeners { + get { + return listeners; + } + } + + /// + /// Protected constructor. Use this version from a derived class if you want + /// the library to use all settings from App.config. + /// + protected AdsUser(AppConfigBase config) : this (config, null) { + } + + /// + /// Protected constructor. Use this version from a derived class if you want + /// the library to use all settings from App.config. + /// + /// This constructor exists for backward compatibility purposes. + /// + protected AdsUser(AppConfigBase config, Dictionary headers) { + this.config = config; + MergeValuesFromHeaders(config, headers); + RegisterServices(GetServiceTypes()); + listeners.AddRange(GetDefaultListeners()); + SetHeadersFromConfig(); + config.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e) { + if (e.PropertyName == "OAuth2Mode") { + SetOAuthProvider(config); + } + }; + SetOAuthProvider(config); + } + + /// + /// Sets the OAuth provider. + /// + /// The config. + private void SetOAuthProvider(AppConfigBase config) { + if (config.OAuth2Mode == OAuth2Flow.APPLICATION) { + this.OAuthProvider = new OAuth2ProviderForApplications(config); + } else { + this.OAuthProvider = new OAuth2ProviderForServiceAccounts(config); + } + } + + /// + /// Merges the values from headers and config into config instance. + /// + /// The appication configuration to use. + /// The configuration headers. + private void MergeValuesFromHeaders(AppConfigBase config, Dictionary headers) { + if (headers != null) { + Type configType = config.GetType(); + foreach (string key in headers.Keys) { + PropertyInfo propInfo = configType.GetProperty(key, BindingFlags.IgnoreCase | + BindingFlags.Public | BindingFlags.Instance); + if (propInfo != null && propInfo.PropertyType == typeof(string)) { + propInfo.SetValue(config, headers[key], null); + } + } + } + } + + /// + /// Registers a family of services against this user. + /// + /// The family of services that should be + /// registered against this user. + /// + /// Every family of services that should be registered with an AdsUser + /// should be like follows: + /// + /// + /// public class vX { + /// /// Type of the factory that can create services of SomeService.vX + /// public Type factoryType = typeof(SomeServiceVxFactory); + /// + /// /// Various services under vX. + /// + /// public readonly ServiceSignature Service1; + /// public readonly ServiceSignature Service2; + /// } + /// + /// + /// The method uses reflection to + /// - Find all the fields of type ServiceSignature. + /// - Extract the factory type from factoryType field. + /// - Register each found service type with the user. + /// + /// + protected void RegisterServices(Type[] servicesFamilies) { + if (servicesFamilies == null) { + return; + } + foreach (Type serviceFamily in servicesFamilies) { + FieldInfo fieldInfo = serviceFamily.GetField("factoryType", BindingFlags.Public + | BindingFlags.Static); + Type serviceFactoryType = null; + if (fieldInfo != null) { + serviceFactoryType = (Type) fieldInfo.GetValue(null); + } else { + throw new ArgumentException(string.Format(CommonErrorMessages.MissingFactoryType, + serviceFactoryType.AssemblyQualifiedName)); + } + if (serviceFactoryType != null) { + ServiceFactory serviceFactory = + (ServiceFactory) Activator.CreateInstance(serviceFactoryType); + FieldInfo[] fields = serviceFamily.GetFields(); + foreach (FieldInfo field in fields) { + ServiceSignature signature = field.GetValue(null) as ServiceSignature; + if (signature != null) { + RegisterService(signature.Id, serviceFactory); + } + } + } + } + } + + /// + /// Gets all the service types to be registered against this user. + /// + /// The type of all service classes to be registered. + public abstract Type[] GetServiceTypes(); + + /// + /// Gets the default listeners. + /// + /// A list of default listeners + public abstract SoapListener[] GetDefaultListeners(); + + /// + /// Set the user headers from App.config. + /// + protected void SetHeadersFromConfig() { + List uniqueFactories = GetUniqueFactories(); + foreach (ServiceFactory uniqueFactory in uniqueFactories) { + uniqueFactory.Config = config; + } + } + + /// + /// Gets the unique set of factories from the list of registered factories. + /// + private List GetUniqueFactories() { + List uniqueFactories = new List(); + foreach (string id in serviceFactoryMap.Keys) { + ServiceFactory serviceFactory = serviceFactoryMap[id]; + if (!uniqueFactories.Contains(serviceFactory)) { + uniqueFactories.Add(serviceFactory); + } + } + return uniqueFactories; + } + + /// + /// Register a service with AdsUser. + /// + /// A unique id for the service being registered. + /// + /// The factory that will create this + /// service. + public void RegisterService(string serviceId, ServiceFactory serviceFactory) { + serviceFactoryMap[serviceId] = serviceFactory; + } + + /// + /// Gets the service factory for a service. + /// + /// The service id. + /// The service factory instance, or null if the service is not + /// yet registered. + public ServiceFactory GetServiceFactory(string serviceId) { + return (serviceFactoryMap.ContainsKey(serviceId)) ? serviceFactoryMap[serviceId] : null; + } + + /// + /// Creates an object of the requested type of service. + /// + /// Signature of the service being requested. + /// + /// An object of the requested type of service. The + /// caller should cast this object to the desired type. + public AdsClient GetService(ServiceSignature serviceSignature) { + return GetService(serviceSignature, String.Empty); + } + + /// + /// Creates an object of the requested type of service. + /// + /// Signature of the service being requested. + /// + /// The server url for Ads service. + /// An object of the requested type of service. The + /// caller should cast this object to the desired type. + public AdsClient GetService(ServiceSignature serviceSignature, string serverUrl) { + Uri uri = null; + if (!string.IsNullOrEmpty(serverUrl)) { + uri = new Uri(serverUrl); + } + return GetService(serviceSignature, uri); + } + + /// + /// Creates an object of the requested type of service. + /// + /// Signature of the service being requested. + /// + /// The server url for Ads service. + /// An object of the requested type of service. The + /// caller should cast this object to the desired type. + [MethodImpl(MethodImplOptions.Synchronized)] + public AdsClient GetService(ServiceSignature serviceSignature, Uri serverUrl) { + if (serviceSignature == null) { + throw new ArgumentNullException("serviceSignature"); + } else { + ServiceFactory factory = GetServiceFactory(serviceSignature.Id); + if (factory == null) { + throw new ArgumentException(string.Format( + CommonErrorMessages.UnregisteredServiceTypeRequested, serviceSignature.ServiceName)); + } else { + return factory.CreateService(serviceSignature, this, serverUrl); + } + } + } + + /// + /// Calls the SOAP listeners. + /// + /// The SOAP message as an xml document. + /// The service for which call is being made. + /// The direction of SOAP message. + internal void CallListeners(XmlDocument document, AdsClient service, + SoapMessageDirection direction) { + foreach (SoapListener listener in listeners) { + listener.HandleMessage(document, service, direction); + } + } + + /// + /// Initialize the SOAP listeners before an API call. + /// + internal void InitListeners() { + foreach (SoapListener listener in listeners) { + listener.InitForCall(); + } + } + + /// + /// Cleans up the SOAP listeners after an API call. + /// + internal void CleanupListeners() { + foreach (SoapListener listener in listeners) { + listener.CleanupAfterCall(); + } + } + } +} diff --git a/src/Common/Lib/AppConfig.cs b/src/Common/Lib/AppConfig.cs new file mode 100644 index 00000000000..f9e24a5ffe3 --- /dev/null +++ b/src/Common/Lib/AppConfig.cs @@ -0,0 +1,155 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.ComponentModel; +using System.Net; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Interface for common configuration properties. + /// + public interface AppConfig { + /// + /// Gets whether the credentials in the log file should be masked. + /// + bool MaskCredentials { get; } + + /// + /// Gets or sets the OAuth2 mode. + /// + OAuth2Flow OAuth2Mode { get; set; } + + /// + /// Gets or sets the OAuth2 access token. + /// + string OAuth2AccessToken { get; set; } + + /// + /// Gets or sets the OAuth2 client id. + /// + string OAuth2ClientId { get; set; } + + /// + /// Gets or sets the OAuth2 client secret. + /// + string OAuth2ClientSecret { get; set; } + + /// + /// Gets or sets the OAuth2 redirect URI. + /// + /// This key is applicable only when using OAuth2 web flow. + /// + string OAuth2RedirectUri { get; set; } + + /// + /// OAuth2 refresh token. + /// + /// This key is applicable only when using OAuth2 web / application + /// flow in offline mode. + string OAuth2RefreshToken { get; set; } + + /// + /// Gets or sets the OAuth2 scope. + /// + string OAuth2Scope { get; set; } + + /// + /// Gets or sets the OAuth2 service account email. + /// + /// This key is applicable only when using OAuth2 service accounts. + /// + string OAuth2ServiceAccountEmail { get; set; } + + /// + /// Gets or sets the OAuth2 prn email. + /// + /// This key is applicable only when using OAuth2 service accounts. + /// + string OAuth2PrnEmail { get; set; } + + /// + /// Gets or sets the OAuth2 certificate path. + /// + /// This key is applicable only when using OAuth2 service accounts. + /// + string OAuth2CertificatePath { get; set; } + + /// + /// Gets or sets the OAuth2 certificate password. + /// + /// This key is applicable only when using OAuth2 service accounts. + /// + string OAuth2CertificatePassword { get; set; } + + /// + /// Gets or sets the email to be used in getting AuthToken. + /// + string Email { get; set; } + + /// + /// Gets or sets the password to be used in getting AuthToken. + /// + string Password { get; set; } + + /// + /// Gets or sets the auth token to be used in SOAP headers. + /// + string AuthToken { get; set; } + + /// + /// Occurs when a property is changed. + /// + event PropertyChangedEventHandler PropertyChanged; + + /// + /// Gets the web proxy to be used with the services. + /// + IWebProxy Proxy { get; } + + /// + /// Gets or sets the number of times to retry a call if an API call fails + /// and can be retried. + /// + int RetryCount { get; set; } + + /// + /// Gets the signature for this library. + /// + string Signature { get; } + + /// + /// Gets or sets the timeout for Ads services in milliseconds. + /// + int Timeout { get; set; } + + /// + /// Gets or sets whether gzip compression should be turned on for SOAP + /// requests and responses. + /// + bool EnableGzipCompression { get; set; } + + /// + /// Gets the number of seconds after Jan 1, 1970, 00:00:00 + /// + long UnixTimestamp { get; } + + /// + /// Gets the default OAuth2 scope. + /// + string GetDefaultOAuth2Scope(); + } +} diff --git a/src/Common/Lib/AppConfigBase.cs b/src/Common/Lib/AppConfigBase.cs new file mode 100644 index 00000000000..fec88c537bc --- /dev/null +++ b/src/Common/Lib/AppConfigBase.cs @@ -0,0 +1,677 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Globalization; +using System.IO; +using System.Net; +using System.Reflection; +using System.Security.Cryptography.X509Certificates; +using System.Xml; + +namespace Google.Api.Ads.Common.Lib { + /// + /// This class reads the configuration keys from App.config. + /// + public abstract class AppConfigBase : INotifyPropertyChanged, AppConfig { + /// + /// The short name to identify this assembly. + /// + private const string SHORT_NAME = "Common-Dotnet"; + + /// + /// Key name for proxyServer + /// + private const string PROXY_SERVER = "ProxyServer"; + + /// + /// Key name for proxyUser. + /// + private const string PROXY_USER = "ProxyUser"; + + /// + /// Key name for proxyPassword. + /// + private const string PROXY_PASSWORD = "ProxyPassword"; + + /// + /// Key name for proxyDomain. + /// + private const string PROXY_DOMAIN = "ProxyDomain"; + + /// + /// Key name for maskCredentials. + /// + private const string MASK_CREDENTIALS = "MaskCredentials"; + + /// + /// Key name for timeout. + /// + private const string TIMEOUT = "Timeout"; + + /// + /// Key name for retryCount. + /// + private const string RETRYCOUNT = "RetryCount"; + + /// + /// Key name for enableGzipCompression. + /// + private const string ENABLE_GZIP_COMPRESSION = "EnableGzipCompression"; + + /// + /// Key name for OAuth2 mode. + /// + private const string OAUTH2_MODE = "OAuth2Mode"; + + /// + /// Key name for OAuth2 client id. + /// + private const string OAUTH2_CLIENTID = "OAuth2ClientId"; + + /// + /// Key name for OAuth2 client secret. + /// + private const string OAUTH2_CLIENTSECRET = "OAuth2ClientSecret"; + + /// + /// Key name for OAuth2 access token. + /// + private const string OAUTH2_ACCESSTOKEN = "OAuth2AccessToken"; + + /// + /// Key name for OAuth2 refresh token. + /// + private const string OAUTH2_REFRESHTOKEN = "OAuth2RefreshToken"; + + /// + /// Key name for OAuth2 scope. + /// + private const string OAUTH2_SCOPE = "OAuth2Scope"; + + /// + /// Key name for redirect uri. + /// + private const string OAUTH2_REDIRECTURI = "OAuth2RedirectUri"; + + /// + /// Key name for service account email. + /// + private const string OAUTH2_SERVICEACCOUNT_EMAIL = "OAuth2ServiceAccountEmail"; + + /// + /// Key name for prn account email. + /// + private const string OAUTH2_PRN_EMAIL = "OAuth2PrnEmail"; + + /// + /// Key name for jwt certificate path. + /// + private const string OAUTH2_JWT_CERTIFICATE_PATH = "OAuth2JwtCertificatePath"; + + /// + /// Key name for jwt certificate password. + /// + private const string OAUTH2_JWT_CERTIFICATE_PASSWORD = "OAuth2JwtCertificatePassword"; + + /// + /// Key name for authToken. + /// + private const string AUTHTOKEN = "AuthToken"; + + /// + /// Key name for email. + /// + private const string EMAIL = "Email"; + + /// + /// Key name for password. + /// + private const string PASSWORD = "Password"; + + /// + /// Web proxy to be used with the services. + /// + private IWebProxy proxy; + + /// + /// True, if the credentials in the log file should be masked. + /// + private bool maskCredentials; + + /// + /// Timeout to be used for Ads services in milliseconds. + /// + private int timeout; + + /// + /// Number of times to retry a call if an API call fails and can be retried. + /// + private int retryCount; + + /// + /// True, if gzip compression should be turned on for SOAP requests and + /// responses. + /// + private bool enableGzipCompression; + + /// + /// OAuth2 client id. + /// + private string oAuth2ClientId; + + /// + /// OAuth2 client secret. + /// + private string oAuth2ClientSecret; + + /// + /// OAuth2 access token. + /// + private string oAuth2AccessToken; + + /// + /// OAuth2 refresh token. + /// + private string oAuth2RefreshToken; + + /// + /// OAuth2 service account email. + /// + private string oAuth2ServiceAccountEmail; + + /// + /// OAuth2 prn email. + /// + private string oAuth2PrnEmail; + + /// + /// OAuth2 certificate path. + /// + private string oAuth2CertificatePath; + + /// + /// OAuth2 certificate password. + /// + private string oAuth2CertificatePassword; + + /// + /// OAuth2 scope. + /// + private string oAuth2Scope; + + /// + /// Redirect uri. + /// + private string oAuth2RedirectUri; + + /// + /// OAuth2 mode. + /// + private OAuth2Flow oAuth2Mode; + + /// + /// Authtoken to be used in making API calls. + /// + private string authToken; + + /// + /// Email to be used in getting AuthToken. + /// + private string email; + + /// + /// Password to be used in getting AuthToken. + /// + private string password; + + /// + /// Default value for number of times to retry a call if an API call fails + /// and can be retried. + /// + private const int DEFAULT_RETRYCOUNT = 0; + + /// + /// Default value for timeout for Ads services. + /// + private const int DEFAULT_TIMEOUT = -1; + + /// + /// Gets whether the credentials in the log file should be masked. + /// + public bool MaskCredentials { + get { + return maskCredentials; + } + protected set { + maskCredentials = value; + } + } + + /// + /// Gets the web proxy to be used with the services. + /// + public IWebProxy Proxy { + get { + return proxy; + } + set { + SetPropertyField("Proxy", ref proxy, value); + } + } + + /// + /// Gets or sets the timeout for Ads services in milliseconds. + /// + public int Timeout { + get { + return timeout; + } + set { + SetPropertyField("Timeout", ref timeout, value); + } + } + + /// + /// Gets or sets the number of times to retry a call if an API call fails + /// and can be retried. + /// + public int RetryCount { + get { + return retryCount; + } + set { + SetPropertyField("RetryCount", ref retryCount, value); + } + } + + /// + /// Gets or sets whether gzip compression should be turned on for SOAP + /// requests and responses. + /// + public bool EnableGzipCompression { + get { + return enableGzipCompression; + } + set { + SetPropertyField("EnableGzipCompression", ref enableGzipCompression, value); + } + } + + /// + /// Gets or sets the OAuth2 client id. + /// + public string OAuth2ClientId { + get { + return oAuth2ClientId; + } + set { + SetPropertyField("OAuth2ClientId", ref oAuth2ClientId, value); + } + } + + /// + /// Gets or sets the OAuth2 client secret. + /// + public string OAuth2ClientSecret { + get { + return oAuth2ClientSecret; + } + set { + SetPropertyField("OAuth2ClientSecret", ref oAuth2ClientSecret, value); + } + } + + /// + /// Gets or sets the OAuth2 access token. + /// + public string OAuth2AccessToken { + get { + return oAuth2AccessToken; + } + set { + SetPropertyField("OAuth2AccessToken", ref oAuth2AccessToken, value); + } + } + + /// + /// Gets or sets the OAuth2 refresh token. + /// + /// This key is applicable only when using OAuth2 web / application + /// flow in offline mode. + public string OAuth2RefreshToken { + get { + return oAuth2RefreshToken; + } + set { + SetPropertyField("OAuth2RefreshToken", ref oAuth2RefreshToken, value); + } + } + + /// + /// Gets or sets the OAuth2 scope. + /// + public string OAuth2Scope { + get { + return oAuth2Scope; + } + set { + SetPropertyField("OAuth2Scope", ref oAuth2Scope, value); + } + } + + /// + /// Gets or sets the OAuth2 redirect URI. + /// + /// This key is applicable only when using OAuth2 web flow. + /// + public string OAuth2RedirectUri { + get { + return oAuth2RedirectUri; + } + set { + SetPropertyField("OAuth2RedirectUri", ref oAuth2RedirectUri, value); + } + } + + /// + /// Gets or sets the OAuth2 mode. + /// + public OAuth2Flow OAuth2Mode { + get { + return oAuth2Mode; + } + set { + SetPropertyField("OAuth2Mode", ref oAuth2Mode, value); + } + } + + /// + /// Gets or sets the OAuth2 service account email. + /// + /// This key is applicable only when using OAuth2 service accounts. + /// + public string OAuth2ServiceAccountEmail { + get { + return oAuth2ServiceAccountEmail; + } + set { + SetPropertyField("OAuth2ServiceAccountEmail", ref oAuth2ServiceAccountEmail, value); + } + } + + /// + /// Gets or sets the OAuth2 prn email. + /// + /// This key is applicable only when using OAuth2 service accounts. + /// + public string OAuth2PrnEmail { + get { + return oAuth2PrnEmail; + } + set { + SetPropertyField("OAuth2PrnEmail", ref oAuth2PrnEmail, value); + } + } + + /// + /// Gets or sets the OAuth2 certificate path. + /// + /// This key is applicable only when using OAuth2 service accounts. + /// + public string OAuth2CertificatePath { + get { + return oAuth2CertificatePath; + } + set { + SetPropertyField("OAuth2CertificatePath", ref oAuth2CertificatePath, value); + } + } + + /// + /// Gets or sets the OAuth2 certificate password. + /// + /// This key is applicable only when using OAuth2 service accounts. + /// + public string OAuth2CertificatePassword { + get { + return oAuth2CertificatePassword; + } + set { + SetPropertyField("OAuth2CertificatePassword", ref oAuth2CertificatePassword, value); + } + } + + /// + /// Gets or sets the email to be used in getting AuthToken. + /// + public string Email { + get { + return email; + } + set { + SetPropertyField("Email", ref email, value); + } + } + + /// + /// Gets or sets the password to be used in getting AuthToken. + /// + public string Password { + get { + return password; + } + set { + SetPropertyField("Password", ref password, value); + } + } + + /// + /// Gets or sets the auth token to be used in SOAP headers. + /// + public string AuthToken { + get { + return authToken; + } + set { + SetPropertyField("AuthToken", ref authToken, value); + } + } + + /// + /// Gets the default OAuth2 scope. + /// + public virtual string GetDefaultOAuth2Scope() { + return ""; + } + + /// + /// Gets the signature for this assembly, given a type derived from + /// AppConfigBase. + /// + /// Type of the class derived from AppConfigBase. + /// The assembly signature. + /// Thrown if type is not derived from + /// AppConfigBase. + private string GetAssemblySignatureFromAppConfigType(Type type) { + Type appConfigBaseType = typeof(AppConfigBase); + if (!(type.BaseType == appConfigBaseType || type == appConfigBaseType)) { + throw new ArgumentException(string.Format("{0} is not derived from {1}.", + type.FullName, appConfigBaseType.FullName)); + } + Version version = type.Assembly.GetName().Version; + string shortName = (string) type.GetField("SHORT_NAME", BindingFlags.NonPublic | + BindingFlags.Static).GetValue(null); + return string.Format("{0}/{1}.{2}.{3}", shortName, version.Major, version.Minor, + version.Revision); + } + + /// + /// Gets the signature for this library. + /// + public string Signature { + get { + return string.Format("{0}, {1}, .NET CLR/{2}", + GetAssemblySignatureFromAppConfigType(this.GetType()), + GetAssemblySignatureFromAppConfigType(this.GetType().BaseType), Environment.Version); + } + } + + /// + /// Gets the number of seconds after Jan 1, 1970, 00:00:00 + /// + public virtual long UnixTimestamp { + get { + TimeSpan unixTime = (DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0)); + return (long) unixTime.TotalSeconds; + } + } + + /// + /// Default constructor for the object. + /// + protected AppConfigBase() { + proxy = null; + maskCredentials = true; + timeout = DEFAULT_TIMEOUT; + enableGzipCompression = true; + oAuth2Mode = OAuth2Flow.APPLICATION; + oAuth2ClientId = ""; + oAuth2ClientSecret = ""; + oAuth2AccessToken = ""; + oAuth2RefreshToken = ""; + oAuth2Scope = ""; + oAuth2RedirectUri = null; + oAuth2PrnEmail = ""; + oAuth2ServiceAccountEmail = ""; + authToken = ""; + email = ""; + password = ""; + } + + /// + /// Read all settings from App.config. + /// + /// The parsed app.config settings. + protected virtual void ReadSettings(Hashtable settings) { + // Common keys. + string proxyUrl = ReadSetting(settings, PROXY_SERVER, ""); + + if (!string.IsNullOrEmpty(proxyUrl)) { + WebProxy proxy = new WebProxy(); + proxy.Address = new Uri(proxyUrl); + + string proxyUser = ReadSetting(settings, PROXY_USER, ""); + string proxyPassword = ReadSetting(settings, PROXY_PASSWORD, ""); + string proxyDomain = ReadSetting(settings, PROXY_DOMAIN, ""); + + if (!string.IsNullOrEmpty(proxyUrl)) { + proxy.Credentials = new NetworkCredential(proxyUser, + proxyPassword, proxyDomain); + } + this.proxy = proxy; + } else { + // System.Net.WebRequest will find a proxy if needed. + this.proxy = null; + } + maskCredentials = bool.Parse(ReadSetting(settings, MASK_CREDENTIALS, + maskCredentials.ToString())); + + try { + oAuth2Mode = (OAuth2Flow) Enum.Parse(typeof(OAuth2Flow), ReadSetting(settings, OAUTH2_MODE, + oAuth2Mode.ToString())); + } catch (Exception e) { + // No action. + } + + oAuth2ClientId = ReadSetting(settings, OAUTH2_CLIENTID, oAuth2ClientId); + oAuth2ClientSecret = ReadSetting(settings, OAUTH2_CLIENTSECRET, oAuth2ClientSecret); + oAuth2AccessToken = ReadSetting(settings, OAUTH2_ACCESSTOKEN, oAuth2AccessToken); + oAuth2RefreshToken = ReadSetting(settings, OAUTH2_REFRESHTOKEN, oAuth2RefreshToken); + oAuth2Scope = ReadSetting(settings, OAUTH2_SCOPE, oAuth2Scope); + oAuth2RedirectUri = ReadSetting(settings, OAUTH2_REDIRECTURI, oAuth2RedirectUri); + oAuth2ServiceAccountEmail = ReadSetting(settings, OAUTH2_SERVICEACCOUNT_EMAIL, + oAuth2ServiceAccountEmail); + oAuth2PrnEmail = ReadSetting(settings, OAUTH2_PRN_EMAIL, oAuth2PrnEmail); + + oAuth2CertificatePath = ReadSetting(settings, OAUTH2_JWT_CERTIFICATE_PATH, + oAuth2CertificatePath); + oAuth2CertificatePassword = ReadSetting(settings, OAUTH2_JWT_CERTIFICATE_PASSWORD, + oAuth2CertificatePassword); + + email = ReadSetting(settings, EMAIL, email); + password = ReadSetting(settings, PASSWORD, password); + authToken = ReadSetting(settings, AUTHTOKEN, authToken); + + int.TryParse(ReadSetting(settings, TIMEOUT, timeout.ToString()), out timeout); + int.TryParse(ReadSetting(settings, RETRYCOUNT, retryCount.ToString()), out retryCount); + bool.TryParse(ReadSetting(settings, ENABLE_GZIP_COMPRESSION, + enableGzipCompression.ToString()), out enableGzipCompression); + } + + /// + /// Reads a setting from a given NameValueCollection, and sets + /// default value if the key is not available in the collection. + /// + /// The settings collection from which the keys + /// are to be read. + /// Key name to be read. + /// Default value for the key. + /// Actual value from settings, or defaultValue if settings + /// does not have this key. + protected static string ReadSetting(Hashtable settings, string key, string defaultValue) { + if (settings == null) { + return defaultValue; + } else { + return settings.ContainsKey(key) ? (string) settings[key] : defaultValue; + } + } + + /// + /// Raises the event. + /// + /// The + /// instance containing the event data. + protected void OnPropertyChanged(PropertyChangedEventArgs e) { + PropertyChangedEventHandler handler = PropertyChanged; + if (handler != null) { + handler(this, e); + } + } + + /// + /// Sets the specified property field. + /// + /// Type of the property field to be set. + /// Name of the property. + /// The property field to be set. + /// The new value to be set to the propery. + protected void SetPropertyField(string propertyName, ref T field, T newValue) { + if (!EqualityComparer.Default.Equals(field, newValue)) { + field = newValue; + OnPropertyChanged(new PropertyChangedEventArgs(propertyName)); + } + } + + /// + /// Occurs when a property value changes. + /// + public event PropertyChangedEventHandler PropertyChanged; + } +} diff --git a/src/Common/Lib/AuthToken.cs b/src/Common/Lib/AuthToken.cs new file mode 100644 index 00000000000..dc18cbf38be --- /dev/null +++ b/src/Common/Lib/AuthToken.cs @@ -0,0 +1,346 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Net; +using System.Reflection; +using System.Text; +using System.Web; + +namespace Google.Api.Ads.Common.Lib { + /// + /// This class wraps the ClientLogin API. See + /// http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html + /// for details. + /// + [Obsolete("ClientLogin API is deprecated, see " + + "https://developers.google.com/accounts/docs/AuthForInstalledApps for details. OAuth2 is " + + "the recommended authentication mechanism. You can refer to the code examples for details " + + " on how to use OAUth2 in your application. You can use Util\\OAuth2TokenGenerator.cs for " + + "generating OAuth2 refresh tokens for offline access to various Ads* APIs.")] + public class AuthToken : Configurable { + /// + /// Url endpoint for ClientLogin API. + /// + private static readonly Uri url = new Uri("https://www.google.com/accounts/ClientLogin"); + + /// + /// The prefix to be appended for captcha urls. + /// + private readonly string CaptchaUrlPrefix = "http://www.google.com/accounts/"; + + /// + /// Account type to be used with ClientLogin API. + /// + private const string ACCOUNT_TYPE = "GOOGLE"; + + /// + /// Service type to be used with ClientLogin API. + /// + private string service; + + /// + /// The configuration class to configure this instance. + /// + private AppConfig config; + + /// + /// The cache for storing authtokens. + /// + private static AuthTokenCache cache = new DefaultAuthTokenCache(); + + /// + /// Gets the URL. + /// + public static Uri Url { + get { + return url; + } + } + + /// + /// Gets the SOURCE parameter for calling ClientLogin API. + /// + private string SOURCE { + get { + return string.Format(CultureInfo.InvariantCulture, "Google-{0}", config.Signature); + } + } + + /// + /// Gets or sets the email to be used for authentication.. + /// + public string Email { + get { + return config.Email; + } + set { + config.Email = value; + } + } + + /// + /// Gets or sets the password to be used for authentication. + /// + public string Password { + get { + return config.Password; + } + set { + config.Password = value; + } + } + + /// + /// Gets or sets the service type to be used with ClientLogin API.. + /// + /// + /// The service. + /// + public string Service { + get { + return service; + } + set { + service = value; + } + } + + /// + /// Gets or sets the configuration class to configure this instance. + /// + /// + /// The config. + /// + public AppConfig Config { + get { + return config; + } set { + config = value; + } + } + + /// + /// Gets or sets the cache for storing authtokens.. + /// + public static AuthTokenCache Cache { + get { + return cache; + } + set { + cache = value; + } + } + + /// + /// Initializes a new instance of the class. + /// + public AuthToken() : this(null, null) { + } + + /// + /// Public constructor. + /// + /// Email to be used for authentication. + /// Password to be used for authentication + /// The configuration object for use with this object. + /// + /// The gaia service name for which tokens are being + /// generated. + [Obsolete("Use AuthToken(AppConfig config, string service) constructor instead.")] + public AuthToken(AppConfig config, string service, string email, string password) { + this.config = config; + this.Email = email; + this.Password = password; + this.service = service; + } + + /// + /// Public constructor. + /// + /// The configuration object for use with this object. + /// + /// The gaia service name for which tokens are being + /// generated. + public AuthToken(AppConfig config, string service) { + this.config = config; + this.service = service; + } + + /// + /// Obtains a ClientLogin token for use with various Ads APIs. + /// + /// The token string. + /// If the token cannot be obtained, + /// then an AuthTokenException is thrown with appropriate error code. + /// + public string GetToken() { + DeprecationUtilities.ShowDeprecationMessage(this.GetType()); + + if (string.IsNullOrEmpty(Email)) { + throw new ArgumentNullException(CommonErrorMessages.EmailCannotBeNull); + } + + if (string.IsNullOrEmpty(Password)) { + throw new ArgumentNullException(CommonErrorMessages.PasswordCannotBeNull); + } + + string cachedToken = cache.GetToken(this.service, Email); + if (cachedToken == null) { + lock (this.GetType()) { + cachedToken = cache.GetToken(this.service, Email); + return (cachedToken != null) ? cachedToken : cache.AddToken(this.service, Email, + GenerateToken()); + } + } + return cachedToken; + } + + /// + /// Generates a ClientLogin token for use with various Ads APIs. + /// + /// The token string. + /// If the token cannot be obtained, + /// then an AuthTokenException is thrown with appropriate error code. + /// + private string GenerateToken() { + WebRequest webRequest = HttpWebRequest.Create(url); + webRequest.Method = "POST"; + webRequest.ContentType = "application/x-www-form-urlencoded"; + + webRequest.Proxy = config.Proxy; + webRequest.Timeout = config.Timeout; + + string postParams = + "accountType=" + HttpUtility.UrlEncode(ACCOUNT_TYPE) + + "&Email=" + HttpUtility.UrlEncode(Email) + + "&Passwd=" + HttpUtility.UrlEncode(Password) + + "&service=" + HttpUtility.UrlEncode(service) + + "&source=" + HttpUtility.UrlEncode(SOURCE); + + byte[] postBytes = Encoding.UTF8.GetBytes(postParams); + webRequest.ContentLength = postBytes.Length; + + using (Stream strmReq = webRequest.GetRequestStream()) { + strmReq.Write(postBytes, 0, postBytes.Length); + } + + Dictionary tblResponse = null; + WebResponse response = null; + + try { + response = webRequest.GetResponse(); + tblResponse = ParseResponse(response); + } catch (WebException ex) { + AuthTokenException authException = ExtractException(ex); + throw authException; + } finally { + if (response != null) { + response.Close(); + } + } + + if (tblResponse.ContainsKey("Auth")) { + return (string) tblResponse["Auth"]; + } else { + throw new AuthTokenException(AuthTokenErrorCode.Unknown, null, String.Empty, null, + "Login failed - Could not find Auth key in response", null); + } + } + + /// + /// Extracts a ClientLogin failure and wraps it into + /// an AuthTokenException. + /// + /// The exception originally thrown by webrequest + /// to ClientLogin endpoint. + /// + private AuthTokenException ExtractException(WebException ex) { + Uri url = null; + string error = String.Empty; + string captchaToken = String.Empty; + Uri captchaUrl = null; + string info = String.Empty; + string errorMessage = CommonErrorMessages.AuthTokenLoginFailed; + AuthTokenErrorCode errCode = AuthTokenErrorCode.Unknown; + + try { + Dictionary tblResponse = ParseResponse(ex.Response); + + if (tblResponse.ContainsKey("Url")) { + url = new Uri(tblResponse["Url"]); + } + if (tblResponse.ContainsKey("Error")) { + error = tblResponse["Error"]; + } + if (tblResponse.ContainsKey("CaptchaToken")) { + captchaToken = tblResponse["CaptchaToken"]; + } + if (tblResponse.ContainsKey("CaptchaUrl")) { + captchaUrl = new Uri(CaptchaUrlPrefix + tblResponse["CaptchaUrl"]); + } + + try { + errCode = (AuthTokenErrorCode) Enum.Parse(typeof(AuthTokenErrorCode), + error, true); + } catch (ArgumentException) { + // Enum does not have a tryParse. + } + + if (tblResponse.ContainsKey("Info")) { + info = tblResponse["Info"]; + } + } catch (Exception) { + errorMessage = CommonErrorMessages.FailedToParseAuthTokenException; + } + return new AuthTokenException(errCode, url, captchaToken, captchaUrl, info, + errorMessage, ex); + } + + /// + /// Parses a successful ClientLogin response into a hashtable. + /// + /// The successful response from ClientLogin + /// endpoint. + /// The parsed response, as key-value pairs, in a Hashtable. + /// + private static Dictionary ParseResponse(WebResponse response) { + Dictionary retVal = new Dictionary(); + + using (StreamReader reader = new StreamReader(response.GetResponseStream())) { + string sResponse = reader.ReadToEnd(); + string[] splits = sResponse.Split('\n'); + foreach (string split in splits) { + string[] subsplits = split.Split('='); + if (subsplits.Length >= 2) { + if (!string.IsNullOrEmpty(subsplits[0])) { + if (!retVal.ContainsKey(subsplits[0])) { + retVal.Add(subsplits[0], split.Substring(subsplits[0].Length + 1)); + } + } + } + } + } + return retVal; + } + } +} diff --git a/src/Common/Lib/AuthTokenCache.cs b/src/Common/Lib/AuthTokenCache.cs new file mode 100644 index 00000000000..7fe52b69849 --- /dev/null +++ b/src/Common/Lib/AuthTokenCache.cs @@ -0,0 +1,86 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Defines a cache for storing auth tokens. + /// + [Obsolete("ClientLogin API is deprecated, see " + + "https://developers.google.com/accounts/docs/AuthForInstalledApps for details. OAuth2 is " + + "the recommended authentication mechanism. You can refer to the code examples for details " + + " on how to use OAUth2 in your application. You can use Util\\OAuth2TokenGenerator.cs for " + + "generating OAuth2 refresh tokens for offline access to various Ads* APIs.")] + public interface AuthTokenCache { + /// + /// Adds an auth token to cache. + /// + /// The ClientLogin service for which this auth token + /// is generated. + /// The login email. + /// The login password. + /// The auth token. + /// The auth token. + [Obsolete("Use AddToken(string service, string email, string token) instead.")] + string AddToken(string service, string email, string password, string token); + + /// + /// Gets an auth token from cache. + /// + /// The ClientLogin service for which this auth token + /// is generated. + /// The login email. + /// The login password. + /// The auth token, or null if the cache doesn't have a token. + /// + [Obsolete("Use string GetToken(string service, string email) instead.")] + string GetToken(string service, string email, string password); + + /// + /// Adds an auth token to cache. + /// + /// The ClientLogin service for which this auth token + /// is generated. + /// The login email. + /// The auth token. + /// The auth token. + string AddToken(string service, string email, string token); + + /// + /// Gets an auth token from cache. + /// + /// The ClientLogin service for which this auth token + /// is generated. + /// The login email. + /// The auth token, or null if the cache doesn't have a token. + /// + string GetToken(string service, string email); + + /// + /// Invalidates an auth token. + /// + /// The auth token. + void InvalidateToken(string token); + + /// + /// Clears the cache. + /// + void Clear(); + } +} diff --git a/src/Common/Lib/AuthTokenErrorCode.cs b/src/Common/Lib/AuthTokenErrorCode.cs new file mode 100644 index 00000000000..9db7c50d050 --- /dev/null +++ b/src/Common/Lib/AuthTokenErrorCode.cs @@ -0,0 +1,81 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Runtime.Serialization; + +namespace Google.Api.Ads.Common.Lib { + /// + /// An enumeration for all the possible exceptions you can + /// get from ClientLogin API. + /// + [Obsolete("ClientLogin API is deprecated, see " + + "https://developers.google.com/accounts/docs/AuthForInstalledApps for details. OAuth2 is " + + "the recommended authentication mechanism. You can refer to the code examples for details " + + " on how to use OAUth2 in your application. You can use Util\\OAuth2TokenGenerator.cs for " + + "generating OAuth2 refresh tokens for offline access to various Ads* APIs.")] + public enum AuthTokenErrorCode { + /// + /// The login request used a username or password that is not recognized. + /// + BadAuthentication, + + /// + /// The account email address has not been verified. The user will need to + /// access their Google account directly to resolve the issue before logging + /// in using a non-Google application. + /// + NotVerified, + + /// + /// The user has not agreed to terms. The user will need to access their Google + /// account directly to resolve the issue before logging in using a non-Google application. + /// + TermsNotAgreed, + + /// + /// A CAPTCHA is required. (A response with this error code will also contain an image URL + /// and a CAPTCHA token.) + /// + CaptchaRequired, + + /// + /// The error is unknown or unspecified; the request contained invalid input or was malformed. + /// + Unknown, + + /// + /// The user account has been deleted. + /// + AccountDeleted, + + /// + /// The user account has been disabled. + /// + AccountDisabled, + + /// + /// The user's access to the specified service has been disabled. (The user account may + /// still be valid.) + /// + ServiceDisabled, + + /// + /// The service is not available; try again later. + /// + ServiceUnavailable + }; +} diff --git a/src/Common/Lib/AuthTokenException.cs b/src/Common/Lib/AuthTokenException.cs new file mode 100644 index 00000000000..ced13e15a9a --- /dev/null +++ b/src/Common/Lib/AuthTokenException.cs @@ -0,0 +1,253 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Runtime.Serialization; + +namespace Google.Api.Ads.Common.Lib { + /// + /// An exception class that represents an exception thrown by ClientLogin API. + /// + [Serializable] + [Obsolete("ClientLogin API is deprecated, see " + + "https://developers.google.com/accounts/docs/AuthForInstalledApps for details. OAuth2 is " + + "the recommended authentication mechanism. You can refer to the code examples for details " + + " on how to use OAUth2 in your application. You can use Util\\OAuth2TokenGenerator.cs for " + + "generating OAuth2 refresh tokens for offline access to various Ads* APIs.")] + public class AuthTokenException : AdsException { + /// + /// The error code associated with this Auth Exception. + /// + private AuthTokenErrorCode errorCode; + + /// + /// The url that describes this error. + /// + private Uri errorUrl; + + /// + /// The token associated with the captcha, if a Require Captcha error + /// is triggered. + /// + private string captchaToken; + + /// + /// The url for the captcha. If Require Captcha error is triggered, then + /// this url should be presented to the users to unlock their accounts. + /// + private Uri captchaUrl; + + /// + /// Additional error information field. + /// + private string info; + + /// + /// A url that describes the error for this exception. + /// + public Uri ErrorUrl { + get { + return errorUrl; + } + set { + errorUrl = value; + } + } + + /// + /// A token to identify the captcha if it gets triggered. + /// + public string CaptchaToken { + get { + return captchaToken; + } + set { + captchaToken = value; + } + } + + /// + /// The url for the captcha page page. Append this url to + /// http://www.google.com/accounts. + /// + public Uri CaptchaUrl { + get { + return captchaUrl; + } + set { + captchaUrl = value; + } + } + + /// + /// The error code that caused this exception. + /// + public AuthTokenErrorCode ErrorCode { + get { + return errorCode; + } + set { + errorCode = value; + } + } + + /// + /// Gets or sets the additional error information field. + /// + /// The info. + public string Info { + get { + return info; + } + set { + info = value; + } + } + + /// + /// Public constructor. + /// + /// The error code for this exception. + /// + public AuthTokenException(AuthTokenErrorCode standardErrorCode) + : this(standardErrorCode, null, String.Empty, null, String.Empty, String.Empty, null) { + } + + /// + /// Public constructor. + /// + /// The error code for this exception. + /// + /// The error url for this exception. + public AuthTokenException(AuthTokenErrorCode standardErrorCode, Uri errorUrl) + : this(standardErrorCode, errorUrl, String.Empty, null, String.Empty, String.Empty, null) { + } + + /// + /// Public constructor. + /// + /// The error code for this exception. + /// + /// The error url for this exception. + /// The captcha token, if applicable. + /// The captcha url, if applicable. + public AuthTokenException(AuthTokenErrorCode standardErrorCode, Uri errorUrl, + string captchaToken, Uri captchaUrl) + : this(standardErrorCode, errorUrl, captchaToken, captchaUrl, String.Empty, String.Empty, + null) { + } + + /// + /// Public constructor. + /// + /// The error code for this exception. + /// + /// The error url for this exception. + /// The captcha token, if applicable. + /// The captcha url, if applicable. + /// Additional information about the error code. + public AuthTokenException(AuthTokenErrorCode standardErrorCode, Uri errorUrl, + string captchaToken, Uri captchaUrl, string info) + : this(standardErrorCode, errorUrl, captchaToken, captchaUrl, info, + String.Empty, null) { + } + + /// + /// Public constructor. + /// + /// The error code for this exception. + /// + /// The error url for this exception. + /// The captcha token, if applicable. + /// The captcha url, if applicable. + /// Additional information about the error code. + /// An additional error message for this exception, + /// added by the code throwing this exception. + public AuthTokenException(AuthTokenErrorCode standardErrorCode, Uri errorUrl, + string captchaToken, Uri captchaUrl, string info, string message) + : this(standardErrorCode, errorUrl, captchaToken, captchaUrl, info, + message, null) { + } + + /// + /// Public constructor. + /// + /// The error code for this exception. + /// + /// The error url for this exception. + /// The captcha token, if applicable. + /// The captcha url, if applicable. + /// Additional information about the error code. + /// An additional error message for this exception, + /// added by the code throwing this exception. + /// An inner exception that this exception + /// will wrap around. + public AuthTokenException(AuthTokenErrorCode standardErrorCode, Uri errorUrl, + string captchaToken, Uri captchaUrl, string info, string message, + Exception innerException) + : base(message, innerException) { + this.errorCode = standardErrorCode; + this.errorUrl = errorUrl; + this.captchaToken = captchaToken; + this.captchaUrl = captchaUrl; + this.info = info; + } + + /// + /// Protected constructor, used by serialization frameworks while + /// deserializing an exception object. + /// + /// Info about the serialization context. + /// + /// A streaming context that represents the + /// serialization stream. + /// Thrown if + /// is null. + protected AuthTokenException(SerializationInfo info, StreamingContext context) + : base(info, context) { + if (info == null) { + throw new ArgumentNullException("info"); + } + this.errorCode = (AuthTokenErrorCode) info.GetValue("ErrorCode", + typeof(AuthTokenErrorCode)); + this.errorUrl = (Uri) info.GetValue("ErrorUrl", typeof(Uri)); + this.captchaToken = (string) info.GetValue("CaptchaToken", typeof(string)); + this.captchaUrl = (Uri) info.GetValue("CaptchaUrl", typeof(Uri)); + this.info = (string) info.GetValue("Info", typeof(string)); + } + + /// + /// This method is called by serialization frameworks while serializing + /// an exception object. + /// + /// Info about the serialization context. + /// A streaming context that represents the + /// serialization stream. + /// Thrown if + /// is null. + public override void GetObjectData(SerializationInfo info, StreamingContext context) { + if (info == null) { + throw new ArgumentNullException("info"); + } + base.GetObjectData(info, context); + info.AddValue("ErrorCode", errorCode, typeof(AuthTokenErrorCode)); + info.AddValue("ErrorUrl", errorUrl, typeof(Uri)); + info.AddValue("CaptchaToken", captchaToken, typeof(string)); + info.AddValue("CaptchaUrl", captchaUrl, typeof(Uri)); + info.AddValue("Info", this.info, typeof(string)); + } + } +} diff --git a/src/Common/Lib/Configurable.cs b/src/Common/Lib/Configurable.cs new file mode 100644 index 00000000000..93f60651236 --- /dev/null +++ b/src/Common/Lib/Configurable.cs @@ -0,0 +1,29 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Marks a class as configurable. + /// + public interface Configurable { + /// + /// Gets the application configuration class for this object. + /// + AppConfig Config { get; } + } +} diff --git a/src/Common/Lib/ContextStore.cs b/src/Common/Lib/ContextStore.cs new file mode 100644 index 00000000000..a56bd95728d --- /dev/null +++ b/src/Common/Lib/ContextStore.cs @@ -0,0 +1,71 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.Remoting.Messaging; +using System.Web; + +namespace Google.Api.Ads.Common.Lib { + /// + /// This class provides access to the call context, and hides the differences + /// when the library is running as a web application or a normal application. + /// + public class ContextStore { + /// + /// Adds a key-value pair to the context store. + /// + /// The key for the value being stored. + /// The value being stored. + public static void AddKey(string key, object value) { + if (HttpContext.Current != null) { + HttpContext.Current.Items[key] = value; + } else { + CallContext.SetData(key, value); + } + } + + /// + /// Removes a stored value from the context store. + /// + /// The key for the value to be removed. + public static void RemoveKey(string key) { + if (HttpContext.Current != null) { + HttpContext.Current.Items.Remove(key); + } else { + CallContext.FreeNamedDataSlot(key); + } + } + + /// + /// Gets the value of an item stored in the context store. + /// + /// The key for which value should be retrieved. + /// The object's value, or null if the key is missing. + public static object GetValue(string key) { + if (HttpContext.Current != null) { + if (HttpContext.Current.Items.Contains(key)) { + return HttpContext.Current.Items[key]; + } else { + return null; + } + } else { + return CallContext.GetData(key); + } + } + } +} diff --git a/src/Common/Lib/CredentialsExpiredException.cs b/src/Common/Lib/CredentialsExpiredException.cs new file mode 100644 index 00000000000..01f4fa9d807 --- /dev/null +++ b/src/Common/Lib/CredentialsExpiredException.cs @@ -0,0 +1,91 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Exception thrown when credentials are expired. + /// + public class CredentialsExpiredException : AdsException { + T expiredCredential; + + /// + /// Gets the expired credential. + /// + public T ExpiredCredential { + get { + return expiredCredential; + } + } + + /// + /// Public constructor. + /// + /// The expired credential. + public CredentialsExpiredException(T expiredCredential) : base() { + this.expiredCredential = expiredCredential; + } + + /// + /// Public constructor. + /// + /// Error message for this API exception. + /// The expired credential. + public CredentialsExpiredException(T expiredCredential, string message) + : base(message) { + this.expiredCredential = expiredCredential; + } + + /// + /// Public constructor. + /// + /// The expired credential. + /// Error message for this API exception. + /// Inner exception, if any. + public CredentialsExpiredException(T expiredCredential, string message, + Exception innerException) : base(message, innerException) { + this.expiredCredential = expiredCredential; + } + + /// + /// Protected constructor. Used by serialization frameworks while + /// deserializing an exception object. + /// + /// Info about the serialization context. + /// A streaming context that represents the + /// serialization stream. + protected CredentialsExpiredException(SerializationInfo info, StreamingContext context) + : base(info, context) { + this.expiredCredential = (T) info.GetValue("ExpiredCredential", typeof(T)); + } + + /// + /// Gets details about the exception for serialization. + /// + /// Holds the serialized object data about the exception + /// being thrown. + /// Contains contextual information about the source + /// or destination. + public override void GetObjectData(SerializationInfo info, StreamingContext context) { + base.GetObjectData(info, context); + info.AddValue("ExpiredCredential", this.expiredCredential); + } + } +} diff --git a/src/Common/Lib/DefaultAuthTokenCache.cs b/src/Common/Lib/DefaultAuthTokenCache.cs new file mode 100644 index 00000000000..b4b8f6b8acb --- /dev/null +++ b/src/Common/Lib/DefaultAuthTokenCache.cs @@ -0,0 +1,135 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Default implementation of auth token cache. + /// + [Obsolete("ClientLogin API is deprecated, see " + + "https://developers.google.com/accounts/docs/AuthForInstalledApps for details. OAuth2 is " + + "the recommended authentication mechanism. You can refer to the code examples for details " + + " on how to use OAUth2 in your application. You can use Util\\OAuth2TokenGenerator.cs for " + + "generating OAuth2 refresh tokens for offline access to various Ads* APIs.")] + public class DefaultAuthTokenCache : AuthTokenCache { + /// + /// An internal dictionary for caching auth tokens. + /// + InMemoryTokenCache tokenCache = new InMemoryTokenCache(); + + #region AuthTokenCache Members + + /// + /// Adds an auth token to cache. + /// + /// The ClientLogin service for which this auth token + /// is generated. + /// The login email. + /// The login password. + /// The auth token. + /// + /// The auth token. + /// + public string AddToken(string service, string email, string password, string token) { + return AddToken(service, email, token); + } + + /// + /// Gets an auth token from cache. + /// + /// The ClientLogin service for which this auth token + /// is generated. + /// The login email. + /// The login password. + /// + /// The auth token, or null if the cache doesn't have a token. + /// + public string GetToken(string service, string email, string password) { + return GetToken(service, email); + } + + + /// + /// Adds an auth token to cache. + /// + /// The ClientLogin service for which this auth token + /// is generated. + /// The login email. + /// The auth token. + /// The auth token. + public string AddToken(string service, string email, string token) { + ValidateParams(service, email); + return tokenCache.AddToken(GetKey(service, email), token); + } + + /// + /// Gets an auth token from cache. + /// + /// The ClientLogin service for which this auth token + /// is generated. + /// The login email. + /// The auth token, or null if the cache doesn't have a token. + /// + public string GetToken(string service, string email) { + ValidateParams(service, email); + return tokenCache.GetToken(GetKey(service, email)); + } + + /// + /// Invalidates an auth token. + /// + /// The auth token. + public void InvalidateToken(string token) { + tokenCache.InvalidateToken(token); + } + + /// + /// Clears the cache. + /// + public void Clear() { + tokenCache.Clear(); + } + + #endregion + + /// + /// Gets a unique key for cache map. + /// + /// The ClientLogin service. + /// The login email. + /// The cache map key. + private string GetKey(string service, string email) { + return string.Format("{0}:{1}", service, email.ToLower()); + } + + /// + /// Validates the input params. + /// + /// The ClientLogin service name. + /// The login email. + private static void ValidateParams(string service, string email) { + if (string.IsNullOrEmpty(email)) { + throw new ArgumentException(CommonErrorMessages.EmailCannotBeNull); + } + if (string.IsNullOrEmpty(service)) { + throw new ArgumentException(CommonErrorMessages.ServiceCannotBeNull); + } + } + } +} diff --git a/src/Common/Lib/ErrorHandler.cs b/src/Common/Lib/ErrorHandler.cs new file mode 100644 index 00000000000..d6da019e054 --- /dev/null +++ b/src/Common/Lib/ErrorHandler.cs @@ -0,0 +1,97 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Threading; + +namespace Google.Api.Ads.Common.Lib { + + /// + /// Handles errors for an Ads API. + /// + public class ErrorHandler { + + /// + /// Wait time in ms to wait before retrying a call. The actual retry time + /// will be higher due to exponential backoff. + /// + protected const int WAIT_TIME = 30000; + + protected readonly AppConfig config; + + /// + /// Number of retry attempts made. + /// + private int numRetries = 0; + + /// + /// Initializes a new instance of the class. + /// + /// The user. + public ErrorHandler(AppConfig config) { + this.config = config; + } + + /// + /// Does the exponential backoff. + /// + public virtual void DoExponentialBackoff() { + Thread.Sleep(WAIT_TIME * (int) Math.Pow(2, this.numRetries)); + } + + /// + /// Checks if there are more retry attempts left. + /// + /// True, if there are more retry attempts left, false otherwise. + /// + public virtual bool HaveMoreRetryAttemptsLeft() { + return numRetries < config.RetryCount; + } + + /// + /// Increment the counter for attempts retried. + /// + public virtual void IncrementRetriedAttempts() { + this.numRetries++; + } + + /// + /// Determines whether the exception thrown by the server is a transient + /// error. + /// The exception. + /// True, if the server exception is a transient error, false + /// otherwise. + public virtual bool IsTransientError(Exception ex) { + return false; + } + + /// + /// Prepares the system for retrying the last failed call. + /// + /// The exception. + public virtual void PrepareForRetry(Exception ex) { + } + + /// + /// Checks if an API call should be retried when an exception occurs. + /// + /// The exception. + /// True, if the call should be retried, false otherwise. + public virtual bool ShouldRetry(Exception ex) { + return false; + } + } +} diff --git a/src/Common/Lib/InMemoryTokenCache.cs b/src/Common/Lib/InMemoryTokenCache.cs new file mode 100644 index 00000000000..fce1e00bd87 --- /dev/null +++ b/src/Common/Lib/InMemoryTokenCache.cs @@ -0,0 +1,102 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using System.Text; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Implements an in-memory cache for holding tokens. + /// + public class InMemoryTokenCache where T: class { + /// + /// An internal dictionary for caching tokens. + /// + Dictionary tokenMap = new Dictionary(); + + /// + /// An internal dictionary for caching token signatures. + /// + Dictionary signatureMap = new Dictionary(); + + /// + /// Adds a token to cache. + /// + /// The token signature, used as a key. + /// The token to be cached. + /// + /// The cached token. + /// + public T AddToken(string signature, T token) { + ValidateParams(signature); + lock (tokenMap) { + tokenMap[signature] = token; + signatureMap[token] = signature; + return token; + } + } + + /// + /// Gets a token from cache. + /// + /// The token signature, used as a key. + /// + /// The cached token, or null if the cache doesn't have a token. + /// + public T GetToken(string signature) { + ValidateParams(signature); + lock (tokenMap) { + return tokenMap.ContainsKey(signature) ? tokenMap[signature] : default(T); + } + } + + /// + /// Invalidates a cached token. + /// + /// The cached token. + public void InvalidateToken(T token) { + lock (tokenMap) { + if (signatureMap.ContainsKey(token)) { + string signature = signatureMap[token]; + tokenMap.Remove(signature); + signatureMap.Remove(token); + } + } + } + + /// + /// Clears the cache. + /// + public void Clear() { + lock (tokenMap) { + tokenMap.Clear(); + signatureMap.Clear(); + } + } + + /// + /// Validates the input params. + /// + /// The token signature, used as a key. + private static void ValidateParams(string signature) { + if (string.IsNullOrEmpty(signature)) { + throw new ArgumentException(CommonErrorMessages.SignatureCannotBeNull); + } + } + } +} diff --git a/src/Common/Lib/OAuth2ProviderBase.cs b/src/Common/Lib/OAuth2ProviderBase.cs new file mode 100644 index 00000000000..e2b16d98243 --- /dev/null +++ b/src/Common/Lib/OAuth2ProviderBase.cs @@ -0,0 +1,398 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Text; + +namespace Google.Api.Ads.Common.Lib { + public abstract class OAuth2ProviderBase : AdsOAuthProvider { + /// + /// The OAuth2 endpoint for obtaining an authorization token. + /// + protected string AUTH_ENDPOINT = "https://accounts.google.com/o/oauth2/auth"; + + /// + /// The OAuth2 endpoint for obtaining or refreshing an access token. + /// + protected string TOKEN_ENDPOINT = "https://accounts.google.com/o/oauth2/token"; + + /// + /// The OAuth2 tokens will be refreshed automatically if the time left for + /// access token expiry is less than this value in seconds. + /// + private int oAuth2RefreshCutoffLimit = 60; + + /// + /// A parameter that your application can use for keeping state. The + /// OAuth Authorization Server roundtrips this parameter. + /// + string state; + + /// + /// Indicates the type of token returned by the server. This field will + /// always have the value Bearer for now. + /// + string tokenType; + + /// + /// The time at which access token was updated. + /// + private DateTime updatedOn = DateTime.MinValue; + + /// + /// The remaining lifetime on the access token. + /// + private int expiresIn; + + /// + /// The configuration object to be used with this client. + /// + protected AppConfig config = null; + + /// + /// Callback triggered when this provider obtains a new access token or + /// refresh token from the OAuth server. + /// + OAuthTokensObtainedCallback oAuthTokensObtained = + new OAuthTokensObtainedCallback(TokensUpdatedCallback); + + /// + /// Gets the config. + /// + public AppConfig Config { + get { + return config; + } + } + + /// + /// Gets or sets the client that is making the request. This value is + /// obtained from the + /// API console during application registration. + /// + public string ClientId { + get { + return config.OAuth2ClientId; + } + set { + config.OAuth2ClientId = value; + } + } + + /// + /// Gets or sets the client secret obtained from the + /// API console + /// during application registration.during application registration. + /// + public string ClientSecret { + get { + return config.OAuth2ClientSecret; + } + set { + config.OAuth2ClientSecret = value; + } + } + + /// + /// Gets or sets the API access your application is requesting. This is + /// space delimited. + /// + public string Scope { + get { + return config.OAuth2Scope; + } + set { + config.OAuth2Scope = value; + } + } + + /// + /// Gets or sets a parameter that your application can use for keeping + /// state. The OAuth Authorization Server roundtrips this parameter. + /// + public string State { + get { + return state; + } + set { + state = value; + } + } + + + /// + /// Gets the type of token returned by the server. This field will + /// always have the value Bearer for now. + /// + public string TokenType { + get { + return tokenType; + } + } + + /// + /// Gets or sets the token that can be sent to a Google API for + /// authentication. + /// + public string AccessToken { + get { + return config.OAuth2AccessToken; + } + set { + config.OAuth2AccessToken = value; + } + } + + /// + /// Gets or sets a token that may be used to obtain a new access token. + /// Refresh tokens are valid until the user revokes access. + /// + public string RefreshToken { + get { + return config.OAuth2RefreshToken; + } + set { + config.OAuth2RefreshToken = value; + } + } + + /// + /// Gets or sets the time at which access token was retrieved. + /// + public DateTime UpdatedOn { + get { + return updatedOn; + } + set { + updatedOn = value; + } + } + /// + /// Gets the remaining lifetime on the access token. + /// + public int ExpiresIn { + get { + return expiresIn; + } + set { + expiresIn = value; + } + } + + /// + /// Callback triggered when this provider obtains a new access token or + /// refresh token from the OAuth server. + /// + public OAuthTokensObtainedCallback OnOAuthTokensObtained { + get { + return oAuthTokensObtained; + } + set { + oAuthTokensObtained = value; + } + } + + /// + /// Gets or sets the OAuth2 refresh cutoff limit. + /// + public int OAuth2RefreshCutoffLimit { + get { + return oAuth2RefreshCutoffLimit; + } + set { + oAuth2RefreshCutoffLimit = value; + } + } + + /// + /// Initializes a new instance of the class. + /// + /// The config. + public OAuth2ProviderBase(AppConfig config) { + this.config = config; + } + + /// + /// Gets the auth header. + /// + /// The auth header. + public string GetAuthHeader() { + RefreshAccessTokenIfExpiring(); + return "Bearer " + this.AccessToken; + } + + /// + /// Refreshes the access token if expiring. + /// + public void RefreshAccessTokenIfExpiring() { + if (IsAccessTokenExpiring()) { + RefreshAccessToken(); + } + } + + /// + /// Refreshes the access token if expiring. + /// + public abstract void RefreshAccessToken(); + + /// + /// Determines whether the access token for a provider is expiring. + /// + /// The provider. + /// True if the token is expiring, false otherwise. + private bool IsAccessTokenExpiring() { + if (this.UpdatedOn == DateTime.MinValue) { + return true; + } + return this.UpdatedOn + + new TimeSpan(0, 0, this.ExpiresIn - oAuth2RefreshCutoffLimit) < DateTime.Now; + } + + + /// + /// Calls the token endpoint to obtain an access token. + /// + /// The request body. + /// The error message. + protected void CallTokenEndpoint(string body) { + WebRequest request = HttpWebRequest.Create(TOKEN_ENDPOINT); + request.Proxy = config.Proxy; + + request.Method = "POST"; + request.ContentType = "application/x-www-form-urlencoded"; + + using (StreamWriter writer = new StreamWriter(request.GetRequestStream())) { + writer.Write(body); + } + + try { + string contents = GetResponseText(request.GetResponse()); + Dictionary values = ParseJsonObjectResponse(contents); + if (values.ContainsKey("access_token")) { + this.AccessToken = values["access_token"]; + } + if (values.ContainsKey("refresh_token")) { + this.RefreshToken = values["refresh_token"]; + } + if (values.ContainsKey("token_type")) { + this.tokenType = values["token_type"]; + } + if (values.ContainsKey("expires_in")) { + this.expiresIn = int.Parse(values["expires_in"]); + } + this.updatedOn = DateTime.Now; + + if (this.OnOAuthTokensObtained != null) { + this.OnOAuthTokensObtained(this); + } + } catch (WebException ex) { + throw new ApplicationException(GetResponseText(ex.Response)); + } + } + + /// + /// Gets the RSA sha256 signature for data. + /// + /// The certificate. + /// The data for which signature should be calculated. + /// + /// The signature. + protected static byte[] GetRsaSha256Signature(X509Certificate2 certificate, byte[] data) { + RSACryptoServiceProvider rsacsp = (RSACryptoServiceProvider) certificate.PrivateKey; + CspParameters cspParam = new CspParameters(); + cspParam.KeyContainerName = rsacsp.CspKeyContainerInfo.KeyContainerName; + cspParam.KeyNumber = rsacsp.CspKeyContainerInfo.KeyNumber == KeyNumber.Exchange ? 1 : 2; + using (RSACryptoServiceProvider aescsp = new RSACryptoServiceProvider(cspParam)) { + aescsp.PersistKeyInCsp = false; + byte[] signature = aescsp.SignData(data, "SHA256"); + bool results = aescsp.VerifyData(data, "SHA256", signature); + return signature; + } + } + + /// + /// Generates a url-safe base64 encoded string. + /// + /// The data to be base64-encoded. + /// The base64 encoded string. + protected static string Base64UrlEncode(byte[] data) { + return Convert.ToBase64String(data).Replace("=", String.Empty).Replace('+', '-'). + Replace('/', '_'); + } + + /// + /// Gets the response text from a web response. + /// + /// The web response. + /// The web response contents. + protected static string GetResponseText(WebResponse response) { + if (response == null) { + return String.Empty; + } + MemoryStream memStream = new MemoryStream(); + MediaUtilities.CopyStream(response.GetResponseStream(), memStream); + return Encoding.UTF8.GetString(memStream.ToArray()); + } + + /// + /// Parses a json object response. + /// + /// The json contents. + /// A dictionary of key-value pairs. + /// This is not a full-blown json parser, it can handle only cases + /// where the response is a json object without nested objects or arrays. + /// + protected Dictionary ParseJsonObjectResponse(string contents) { + Dictionary retval = new Dictionary(); + string[] splits = contents.Trim(new char[] {' ', '{', '}'}).Split(','); + foreach (string split in splits) { + string[] subSplits = split.Trim(new char[] {' ', '\r', '\n'}).Split(':'); + if (subSplits.Length == 2) { + retval.Add(subSplits[0].Trim(new char[] {'"', ' '}), + subSplits[1].Trim(new char[] {'"', ' '})); + } + } + return retval; + } + + /// + /// Validates if a required OAuth2 parameter is null or empty. + /// + /// Name of the property. + /// The property value. + protected static void ValidateOAuth2Parameter(string propertyName, string propertyValue) { + if (string.IsNullOrEmpty(propertyValue)) { + throw new ArgumentNullException( + string.Format(CommonErrorMessages.OAuth2ParameterErrorMessage, propertyName)); + } + } + + /// + /// Default callback when this provider obtains a new access token or + /// refresh token from the OAuth server. + /// + /// The provider. + protected static void TokensUpdatedCallback(AdsOAuthProvider provider) { + } + } +} diff --git a/src/Common/Lib/OAuth2ProviderForApplications.cs b/src/Common/Lib/OAuth2ProviderForApplications.cs new file mode 100644 index 00000000000..a506159861c --- /dev/null +++ b/src/Common/Lib/OAuth2ProviderForApplications.cs @@ -0,0 +1,203 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Net; +using System.Web; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Provides OAuth authorization mechanism for Ads services when using Web and + /// installed application flows. + /// + public class OAuth2ProviderForApplications : OAuth2ProviderBase, AdsOAuthProviderForApplications { + /// + /// The OAuth2 endpoint for revoking a refresh token programmatically. + /// + private string REVOKE_ENDPOINT = "https://accounts.google.com/o/oauth2/revoke"; + + /// + /// The OAuth2 redirect url to be used if your application is a desktop + /// application. To use this url, your client should be registered as an + /// installed application on the + /// API console. + /// + public const string OFFLINE_REDIRECT_URL = "urn:ietf:wg:oauth:2.0:oob"; + + /// + /// Determines if the Google OAuth 2.0 endpoint returns an authorization + /// code. + /// + private const string RESPONSE_TYPE = "code"; + + /// + /// Indicates if your application needs to access APIs when the user is not + /// present at the browser. This is defaulted to true. + /// + bool isOffline = true; + + /// + /// Indicates if your application needs to access APIs when the user is not + /// present at the browser. This is defaulted to true. + /// + public bool IsOffline { + get { + return isOffline; + } + set { + isOffline = value; + } + } + + /// + /// Gets or sets where the url where the response is sent. This should be a + /// registered redirect uri on the + /// API console. + /// + public string RedirectUri { + get { + return config.OAuth2RedirectUri; + } + set { + config.OAuth2RedirectUri = value; + } + } + + /// + /// Initializes a new instance of the OAuth2ProviderForApplications class. + /// + /// The config. + public OAuth2ProviderForApplications(AppConfig config) : base(config) { } + + /// + /// Builds the OAuth2 authorization url. + /// + /// The Authorization url that the user needs to visit to authorize + /// the application. + /// Thrown if one of the following + /// OAuth2 parameters are empty: Scope, ClientId + public string GetAuthorizationUrl() { + string accessType = (isOffline) ? "offline" : "online"; + string redirectUrl = (string.IsNullOrEmpty(RedirectUri)) ? OFFLINE_REDIRECT_URL : RedirectUri; + + ValidateOAuth2Parameter("Scope", Scope); + ValidateOAuth2Parameter("ClientId", ClientId); + + return string.Format("{0}?scope={1}&state={2}&redirect_uri={3}&response_type={4}&" + + "client_id={5}&access_type={6}", AUTH_ENDPOINT, HttpUtility.UrlEncode(Scope), + HttpUtility.UrlEncode(State), HttpUtility.UrlEncode(redirectUrl), + HttpUtility.UrlEncode(RESPONSE_TYPE), HttpUtility.UrlEncode(ClientId), + HttpUtility.UrlEncode(accessType)); + } + + /// + /// Gets the OAuth access and refresh tokens. + /// + /// The authorization code obtained from the + /// Authorization url after the user authorizes the application to make API + /// calls. + /// + /// True if the tokens were fetched successfully, false otherwise. + /// + /// + /// Refresh tokens are obtained only if access mode was set to + /// offline. + /// + /// Thrown if one of the following + /// OAuth2 parameters are empty: ClientId, ClientSecret, AuthorizationCode. + /// + public bool FetchAccessAndRefreshTokens(string authorizationCode) { + string redirectUrl = (string.IsNullOrEmpty(RedirectUri)) ? OFFLINE_REDIRECT_URL : RedirectUri; + + if (string.IsNullOrEmpty(authorizationCode)) { + throw new ArgumentNullException(CommonErrorMessages.OAuth2AuthorizationCodeIsEmpty); + } + + ValidateOAuth2Parameter("ClientId", ClientId); + ValidateOAuth2Parameter("ClientSecret", ClientSecret); + + string body = string.Format("code={0}&client_id={1}&client_secret={2}&redirect_uri={3}" + + "&grant_type={4}", HttpUtility.UrlEncode(authorizationCode), + HttpUtility.UrlEncode(ClientId), HttpUtility.UrlEncode(ClientSecret), + HttpUtility.UrlEncode(redirectUrl), HttpUtility.UrlEncode("authorization_code")); + + try { + CallTokenEndpoint(body); + } catch (ApplicationException e) { + throw new AdsOAuthException("Failed to get access token." + "\n" + e.Message); + } + return true; + } + + /// + /// Refreshes the access token. + /// + /// This method should be used only when access mode is set to + /// offline. + /// Thrown if one of the following + /// OAuth2 parameters are empty: ClientId, ClientSecret, RefreshToken. + /// + public void RefreshAccessTokenInOfflineMode() { + ValidateOAuth2Parameter("RefreshToken", RefreshToken); + ValidateOAuth2Parameter("ClientId", ClientId); + ValidateOAuth2Parameter("ClientSecret", ClientSecret); + + string body = string.Format("client_id={0}&client_secret={1}&refresh_token={2}" + + "&grant_type={3}", HttpUtility.UrlEncode(ClientId), HttpUtility.UrlEncode(ClientSecret), + HttpUtility.UrlEncode(RefreshToken), HttpUtility.UrlEncode("refresh_token")); + + try { + CallTokenEndpoint(body); + } catch (ApplicationException e) { + throw new AdsOAuthException("Failed to refresh access token." + "\n" + e.Message); + } + } + + /// + /// Revokes the refresh token. + /// + /// Thrown if one of the following + /// OAuth2 parameters are empty: RefreshToken. + public void RevokeRefreshToken() { + ValidateOAuth2Parameter("RefreshToken", RefreshToken); + + string url = string.Format("{0}?token={1}", REVOKE_ENDPOINT, RefreshToken); + WebRequest request = HttpWebRequest.Create(url); + request.Proxy = config.Proxy; + try { + WebResponse response = request.GetResponse(); + } catch (WebException ex) { + throw new AdsOAuthException("Failed to revoke refresh token.\n" + + GetResponseText(ex.Response)); + } + } + + /// + /// Refreshes the access token. + /// + /// Thrown if IsOffline is false. + /// + /// Thrown if RefreshToken is empty. + /// + public override void RefreshAccessToken() { + ValidateOAuth2Parameter("RefreshToken", RefreshToken); + if (!IsOffline) { + throw new ArgumentException(CommonErrorMessages.OAuth2IsNotInOfflineMode); + } + RefreshAccessTokenInOfflineMode(); + } + } +} diff --git a/src/Common/Lib/OAuth2ProviderForServiceAccounts.cs b/src/Common/Lib/OAuth2ProviderForServiceAccounts.cs new file mode 100644 index 00000000000..c4403b97546 --- /dev/null +++ b/src/Common/Lib/OAuth2ProviderForServiceAccounts.cs @@ -0,0 +1,158 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Text; +using System.Security.Cryptography.X509Certificates; +using System.Web; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Provides OAuth authorization mechanism for Ads services when using service + /// account flow. + /// + public class OAuth2ProviderForServiceAccounts : OAuth2ProviderBase, + AdsOAuthProviderForServiceAccounts { + /// + /// Audience for generating JWT string. + /// + private const string JWT_AUDIENCE = "https://accounts.google.com/o/oauth2/token"; + + /// + /// Grant type for generating JWT string. + /// + private const string JWT_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:jwt-bearer"; + + /// + /// Header for generating JWT string. + /// + private const string JWT_HEADER = "{\"alg\":\"RS256\",\"typ\":\"JWT\"}"; + + /// + /// Claimset template for generating JWT string. + /// + private const string JWT_CLAIMSET_TEMPLATE = "{{\"iss\":\"{0}\", \"scope\":\"{1}\", " + + "\"aud\":\"{2}\", \"exp\":{3}, \"iat\":{4}, \"prn\":\"{5}\"}}"; + + /// + /// Default expiry period for access token. + /// + private const int DEFAULT_EXPIRY_PERIOD = 3600; + + /// + /// Gets or sets the service account email for which access token should be + /// retrieved. + /// + public string ServiceAccountEmail { + get { + return config.OAuth2ServiceAccountEmail; + } + set { + config.OAuth2ServiceAccountEmail = value; + } + } + + /// + /// Gets or sets the email of the account for which the call is being made. + /// + public string PrnEmail { + get { + return config.OAuth2PrnEmail; + } + set { + config.OAuth2PrnEmail = value; + } + } + + /// + /// Gets or sets the JWT certificate path. + /// + public string JwtCertificatePath { + get { + return config.OAuth2CertificatePath; + } + set { + config.OAuth2CertificatePath = value; + } + } + + /// + /// Gets or sets the JWT certificate password. + /// + public string JwtCertificatePassword { + get { + return config.OAuth2CertificatePassword; + } + set { + config.OAuth2CertificatePassword = value; + } + } + + /// + /// Initializes a new instance of the OAuth2ProviderForServiceAccounts class. + /// + /// The config. + public OAuth2ProviderForServiceAccounts(AppConfig config) : base(config) { } + + /// + /// Gets the access token for service account. + /// + /// Thrown if one of the following + /// OAuth2 parameters are empty: ServiceAccountEmail, Scope, PrnEmail, + /// JwtCertificatePath, JwtCertificatePassword. + public void GenerateAccessTokenForServiceAccount() { + long timestamp = config.UnixTimestamp; + long expiry = timestamp + DEFAULT_EXPIRY_PERIOD; + + ValidateOAuth2Parameter("ServiceAccountEmail", ServiceAccountEmail); + ValidateOAuth2Parameter("Scope", Scope); + ValidateOAuth2Parameter("PrnEmail", PrnEmail); + ValidateOAuth2Parameter("JwtCertificatePath", JwtCertificatePath); + ValidateOAuth2Parameter("JwtCertificatePassword", JwtCertificatePassword); + + string jwtClaimset = string.Format(JWT_CLAIMSET_TEMPLATE, ServiceAccountEmail, Scope, + JWT_AUDIENCE, expiry, timestamp, PrnEmail); + + string encodedHeader = Base64UrlEncode(Encoding.UTF8.GetBytes(JWT_HEADER)); + string encodedClaimset = Base64UrlEncode(Encoding.UTF8.GetBytes(jwtClaimset)); + string inputForSignature = encodedHeader + "." + encodedClaimset; + + X509Certificate2 jwtCertificate = new X509Certificate2(JwtCertificatePath, + JwtCertificatePassword); + + string signature = Base64UrlEncode(GetRsaSha256Signature(jwtCertificate, + Encoding.UTF8.GetBytes(inputForSignature))); + string jwt = inputForSignature + "." + signature; + + string body = "grant_type=" + HttpUtility.UrlEncode(JWT_GRANT_TYPE) + "&assertion=" + + HttpUtility.UrlEncode(jwt); + + try { + CallTokenEndpoint(body); + } catch (ApplicationException e) { + throw new AdsOAuthException("Failed to get access token for service account." + "\n" + + e.Message); + } + } + + /// + /// Refreshes the access token. + /// + public override void RefreshAccessToken() { + GenerateAccessTokenForServiceAccount(); + } + } +} diff --git a/src/Common/Lib/ServiceFactory.cs b/src/Common/Lib/ServiceFactory.cs new file mode 100644 index 00000000000..7d38d74cf61 --- /dev/null +++ b/src/Common/Lib/ServiceFactory.cs @@ -0,0 +1,75 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Text; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Interface to a factory which can create a particular group of services. + /// For every new service supported, you need an implementation of this + /// interface. + /// + public abstract class ServiceFactory : Configurable { + /// + /// An App.config reader suitable for this factory. + /// + private AppConfig config; + + /// + /// Gets an App.config reader suitable for this factory. + /// + public AppConfig Config { + get { + return config; + } + set { + config = value; + config.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e) { + ReadHeadersFromConfig(config); + }; + ReadHeadersFromConfig(config); + } + } + + /// + /// Create a service object. + /// + /// Signature of the service being created. + /// The user for which the service is being created. + /// The server to which the API calls should be + /// made. + /// + /// An object of the desired service type. + public abstract AdsClient CreateService(ServiceSignature signature, AdsUser user, + Uri serverUrl); + + /// + /// Reads the headers from App.config. + /// + /// The configuration class. + protected abstract void ReadHeadersFromConfig(AppConfig config); + + /// + /// Checks preconditions of the service signature and throws and exception if the service + /// cannot be generated. + /// + /// the service signature for generating the service + protected abstract void CheckServicePreconditions(ServiceSignature signature); + } +} diff --git a/src/Common/Lib/ServiceSignature.cs b/src/Common/Lib/ServiceSignature.cs new file mode 100644 index 00000000000..f9266f203da --- /dev/null +++ b/src/Common/Lib/ServiceSignature.cs @@ -0,0 +1,113 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Defines an API signature object. This class is used as a support class + /// to assist AdsUser in creating a service object. + /// + public abstract class ServiceSignature { + /// + /// The various protocols supported by the library. + /// + public enum SupportedProtocols { + /// + /// SOAP + /// + SOAP, + + /// + /// WSE + /// + WSE + } + + /// + /// The supported protocol. + /// + SupportedProtocols supportedProtocol; + + /// + /// The service version. + /// + private string version; + + /// + /// The name of the service. + /// + private string serviceName; + + /// + /// A unique id to distinguish the service represented by this signature + /// object. + /// + public virtual string Id { + get { + return version + "." + serviceName; + } + } + + /// + /// Gets the service version. + /// + public string Version { + get { + return version; + } + } + + /// + /// Gets the service name. + /// + public string ServiceName { + get { + return serviceName; + } + } + + /// + /// Gets the supported protocol. + /// + public SupportedProtocols SupportedProtocol { + get { + return supportedProtocol; + } + } + + /// + /// Gets the type of service. + /// + public abstract Type ServiceType { + get; + } + + /// + /// Protected constructor. + /// + /// Service version. + /// Service name. + /// The supported protocol. + protected ServiceSignature(string version, string serviceName, SupportedProtocols protocol) { + this.version = version; + this.serviceName = serviceName; + this.supportedProtocol = protocol; + } + } +} diff --git a/src/Common/Lib/SoapHeaderBase.cs b/src/Common/Lib/SoapHeaderBase.cs new file mode 100644 index 00000000000..27bb748e20a --- /dev/null +++ b/src/Common/Lib/SoapHeaderBase.cs @@ -0,0 +1,144 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; + +using System; +using System.Collections.Generic; +using System.Web.Services.Protocols; +using System.Xml; +using System.Xml.Schema; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Common base class for all SOAP Headers. + /// + public abstract class SoapHeaderBase : SoapHeader, ICloneable, IXmlSerializable { + /// + /// The placeholders that need to be replaced in the serialized xml from + /// the stub. + /// + protected Dictionary placeHolders = new Dictionary(); + + /// + /// Gets or sets the stub that is wrapped by this object. + /// + public abstract object Stub { + get; + protected set; + } + + /// + /// Gets the schema for this object. Can return null if the + /// server does not expect the schema. + /// + /// The xml schema associated with this class, or null + /// if not applicable. + public virtual XmlSchema GetSchema() { + return null; + } + + /// + /// Gets the name of the XML element for serializing this object or null if + /// no element name is available. + /// + protected string XmlElementName { + get { + foreach (Attribute attribute in Stub.GetType().GetCustomAttributes(true)) { + if (attribute is XmlRootAttribute) { + return (attribute as XmlRootAttribute).ElementName; + } + } + return null; + } + } + + /// + /// Gets the XML namespace for serializing this object or null if no + /// namespace is available. + /// + protected string XmlNamespace { + get { + foreach (Attribute attribute in Stub.GetType().GetCustomAttributes(true)) { + if (attribute is XmlRootAttribute) { + return (attribute as XmlRootAttribute).Namespace; + } + } + return null; + } + } + + /// + /// Deserialize the object from xml. + /// + /// The xml reader for reading the + /// serialized xml. + public virtual void ReadXml(XmlReader reader) { + XmlDocument doc = SerializationUtilities.LoadXml(reader.ReadOuterXml()); + + XmlNameTable xmlnt = doc.NameTable; + XmlElement root = doc.CreateElement(XmlElementName, XmlNamespace); + + XmlNodeList xmlNodes = doc.DocumentElement.SelectNodes("*"); + foreach (XmlNode node in xmlNodes) { + root.AppendChild(node); + } + doc.RemoveAll(); + doc.AppendChild(root); + + string contents = doc.OuterXml; + + foreach (string key in placeHolders.Keys) { + if (placeHolders[key] != null) { + contents = contents.Replace(placeHolders[key], key); + } + } + Stub = SerializationUtilities.DeserializeFromXmlText(contents, Stub.GetType()); + } + + /// + /// Serialize the object into an xml. + /// + /// The writer to which the serialized data + /// should be written. + public virtual void WriteXml(XmlWriter writer) { + string contents = SerializationUtilities.SerializeAsXmlText(Stub); + + foreach (string key in placeHolders.Keys) { + if (placeHolders[key] != null) { + contents = contents.Replace(key, placeHolders[key]); + } + } + + XmlDocument xDoc = SerializationUtilities.LoadXml(contents); + writer.WriteRaw(xDoc.DocumentElement.InnerXml); + } + + /// + /// Clone this object. + /// + /// + /// A cloned object. + /// + public object Clone() { + SoapHeaderBase header = (SoapHeaderBase) Activator.CreateInstance(this.GetType()); + header.Stub = SerializationUtilities.DeserializeFromXmlText( + SerializationUtilities.SerializeAsXmlText(this.Stub), this.Stub.GetType()); + return header; + } + } +} diff --git a/src/Common/Lib/SoapListener.cs b/src/Common/Lib/SoapListener.cs new file mode 100644 index 00000000000..dcd25dc2f36 --- /dev/null +++ b/src/Common/Lib/SoapListener.cs @@ -0,0 +1,43 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Xml; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Listens to SOAP messages sent and received by this library. + /// + public interface SoapListener : Configurable { + /// + /// Initializes the listener for handling an API call. + /// + void InitForCall(); + + /// + /// Handles the SOAP message. + /// + /// The SOAP message. + /// The SOAP service. + /// The direction of message. + void HandleMessage(XmlDocument soapMessage, AdsClient service, SoapMessageDirection direction); + + /// + /// Cleans up any resources after an API call. + /// + void CleanupAfterCall(); + } +} diff --git a/src/Common/Lib/SoapListenerExtension.cs b/src/Common/Lib/SoapListenerExtension.cs new file mode 100644 index 00000000000..3c82c0a6c48 --- /dev/null +++ b/src/Common/Lib/SoapListenerExtension.cs @@ -0,0 +1,168 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; + +using System; +using System.Globalization; +using System.IO; +using System.Net; +using System.Runtime.CompilerServices; +using System.Runtime.Remoting.Messaging; +using System.Security.Permissions; +using System.Text; +using System.Threading; +using System.Web; +using System.Web.Services.Protocols; +using System.Xml; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Define a SOAP Extension that traces the SOAP request and SOAP response + /// for the XML Web service method the SOAP extension is applied to. + /// + public class SoapListenerExtension : SoapExtension { + /// + /// The old stream, which we replaced in . + /// + private Stream oldStream; + + /// + /// The new stream, which we substituted for, in . + /// + private MemoryStream newStream; + + /// + /// Initializes a new instance of the + /// class. + /// + public SoapListenerExtension() {} + + /// + /// Save the Stream representing the SOAP request or SOAP response into + /// a local memory buffer. + /// + /// The original stream + /// The new stream. + public override Stream ChainStream(Stream stream) { + oldStream = stream; + newStream = new MemoryStream(); + return newStream; + } + + /// + /// When the SOAP extension is accessed for the first time, the XML Web + /// service method it is applied to is accessed to store the file + /// name passed in, using the corresponding SoapExtensionAttribute. + /// + /// The method being called. + /// Decorating attribute for the method. + /// An initializer object. + /// Thrown if + /// is null. + public override object GetInitializer(LogicalMethodInfo methodInfo, + SoapExtensionAttribute attribute) { + if (methodInfo == null) { + throw new ArgumentNullException("methodInfo"); + } + return methodInfo.DeclaringType; + } + + /// + /// The SOAP extension was configured to run using a configuration file + /// instead of an attribute applied to a specific XML Web service + /// method. + /// + /// The type of the webservice being + /// used. + /// An initializer object. + public override object GetInitializer(Type serviceType) { + return serviceType; + } + + /// + /// Process the messages passing in and out of the SOAP services. + /// + /// The current SOAP message. + /// Thrown if + /// is null. + [MethodImpl(MethodImplOptions.Synchronized)] + public override void ProcessMessage(SoapMessage message) { + if (message == null) { + throw new ArgumentNullException("message"); + } + switch (message.Stage) { + case SoapMessageStage.BeforeSerialize: + break; + case SoapMessageStage.AfterSerialize: + CallListeners(SoapMessageDirection.OUT); + CopyContentsToOldStream(); + break; + case SoapMessageStage.BeforeDeserialize: + CopyContentsFromOldStream(); + CallListeners(SoapMessageDirection.IN); + break; + case SoapMessageStage.AfterDeserialize: + break; + default: + throw new ArgumentException(CommonErrorMessages.InvalidStageForSoapMessage); + } + } + + /// + /// Calls the listeners. + /// + /// The direction of SOAP message. + private void CallListeners(SoapMessageDirection direction) { + XmlDocument document = SerializationUtilities.LoadXml(Encoding.UTF8.GetString( + newStream.ToArray())); + + AdsClient service = (AdsClient) ContextStore.GetValue("SoapService"); + if (service != null) { + service.User.CallListeners(document, service, direction); + } + byte[] bytes = Encoding.UTF8.GetBytes(document.OuterXml); + newStream.SetLength(0); + newStream.Write(bytes, 0, bytes.Length); + newStream.Seek(0, SeekOrigin.Begin); + } + + /// + /// Copy the contents from new stream to old stream. + /// + private void CopyContentsToOldStream() { + newStream.Position = 0; + MediaUtilities.CopyStream(newStream, oldStream); + } + + /// + /// Copy the contents from old stream to new stream. + /// + private void CopyContentsFromOldStream() { + MediaUtilities.CopyStream(oldStream, newStream); + newStream.Position = 0; + } + + /// + /// When overridden in a derived class, allows a SOAP extension to + /// initialize itself using the data cached in the GetInitializer method. + /// + /// The object returned from GetInitializer + /// + public override void Initialize(object initializer) { + } + } +} diff --git a/src/Common/Lib/SoapListenerExtensionAttribute.cs b/src/Common/Lib/SoapListenerExtensionAttribute.cs new file mode 100644 index 00000000000..5dbba1ef4bb --- /dev/null +++ b/src/Common/Lib/SoapListenerExtensionAttribute.cs @@ -0,0 +1,53 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Web.Services.Protocols; + +namespace Google.Api.Ads.Common.Lib { + /// + /// SoapExtensionAttribute for the SOAP Extension that can be + /// applied to an XML Web service method to enable tracing. + /// + [AttributeUsage(AttributeTargets.Method)] + public sealed class SoapListenerExtensionAttribute : SoapExtensionAttribute { + /// + /// Stores the priority for this trace attribute. + /// + private int priority; + + /// + /// Return the type of Extension. + /// + public override Type ExtensionType { + get { + return typeof(SoapListenerExtension); + } + } + + /// + /// Return the priority of this attribute. + /// + public override int Priority { + get { + return priority; + } + set { + priority = value; + } + } + } +} diff --git a/src/Common/Lib/SoapMessageDirection.cs b/src/Common/Lib/SoapMessageDirection.cs new file mode 100644 index 00000000000..d701d77432c --- /dev/null +++ b/src/Common/Lib/SoapMessageDirection.cs @@ -0,0 +1,33 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Direction of SOAP message. + /// + public enum SoapMessageDirection { + /// + /// Response from the server. + /// + IN, + /// + /// Request to the server. + /// + OUT + } +} diff --git a/src/Common/Lib/TraceListener.cs b/src/Common/Lib/TraceListener.cs new file mode 100644 index 00000000000..c3207bce24d --- /dev/null +++ b/src/Common/Lib/TraceListener.cs @@ -0,0 +1,250 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; + +using System; +using System.Globalization; +using System.IO; +using System.Net; +using System.Runtime.Remoting.Messaging; +using System.Text; +using System.Threading; +using System.Web; +using System.Web.Services; +using System.Web.Services.Protocols; +using System.Xml; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Listens to SOAP messages sent and received by this library. + /// + public abstract class TraceListener : SoapListener { + /// + /// The config class to be used with this class. + /// + private AppConfig config; + + /// + /// Gets the config class to be used with this class. + /// + public AppConfig Config { + get { + return config; + } + } + + /// + /// Protected constructor. + /// + /// The config class. + protected TraceListener(AppConfig config) { + this.config = config; + } + + /// + /// Initializes the listener for handling an API call. + /// + public void InitForCall() { + } + + /// + /// Handles the SOAP message. + /// + /// The SOAP message. + /// The SOAP service. + /// The direction of message. + public void HandleMessage(XmlDocument soapMessage, AdsClient service, + SoapMessageDirection direction) { + if (direction == SoapMessageDirection.OUT) { + ContextStore.AddKey("SoapRequest", soapMessage.OuterXml); + } else { + ContextStore.AddKey("SoapResponse", soapMessage.OuterXml); + } + if (direction == SoapMessageDirection.IN) { + PerformLogging(service, (string) ContextStore.GetValue("SoapRequest"), + (string) ContextStore.GetValue("SoapResponse")); + } + } + + /// + /// Cleans up any resources after an API call. + /// + public void CleanupAfterCall() { + ContextStore.RemoveKey("SoapRequest"); + ContextStore.RemoveKey("SoapResponse"); + ContextStore.RemoveKey("FormattedSoapLog"); + ContextStore.RemoveKey("FormattedRequestLog"); + } + + /// + /// Performs the SOAP and HTTP logging. + /// + /// The SOAP service. + /// The SOAP response xml. + /// The SOAP request xml. + private void PerformLogging(AdsClient service, string soapRequest, string soapResponse) { + if (service == null || service.User == null || soapRequest == null || soapResponse == null) { + return; + } + + if (config.MaskCredentials) { + XmlDocument xDoc = SerializationUtilities.LoadXml(soapRequest); + MaskCredentialsInLogs(xDoc, GetFieldsToMask()); + soapRequest = xDoc.OuterXml; + } + + string formattedSoapRequest = FormatSoapRequest(service.LastRequest, soapRequest); + string formattedSoapResponse = FormatSoapResponse(service.LastResponse, soapResponse); + string formattedHttpRequest = FormatHttpRequest(soapRequest); + string formattedHttpResponse = FormatHttpResponse(soapResponse); + + string soapLog = formattedSoapRequest + formattedSoapResponse; + string requestLog = string.Format(CultureInfo.InvariantCulture, "host={0},url={1},{2},{3}", + service.LastRequest.RequestUri.Host, service.LastRequest.RequestUri.AbsolutePath, + formattedHttpRequest, formattedHttpResponse); + + ContextStore.AddKey("FormattedSoapLog", soapLog); + ContextStore.AddKey("FormattedRequestLog", requestLog); + + bool isError = service.LastResponse != null && service.LastResponse is HttpWebResponse && + (service.LastResponse as HttpWebResponse).StatusCode == + HttpStatusCode.InternalServerError; + + TraceUtilities.WriteSoapXmlLogs(soapLog, isError); + TraceUtilities.WriteRequestInfoLogs(requestLog, isError); + } + + /// + /// Gets a list of fields to be masked in xml logs. + /// + /// The list of fields to be masked. + protected abstract string[] GetFieldsToMask(); + + /// + /// Creates a formatted http request text, to be written into HTTP logs. + /// + /// The request xml for this SOAP call. + /// A formatted string that represents the HTTP request. + protected virtual string FormatHttpRequest(string soapRequest) { + return ""; + } + + /// + /// Creates a formatted http response text, to be written into HTTP logs. + /// + /// The response xml for this SOAP call. + /// A formatted string that represents the HTTP response. + protected virtual string FormatHttpResponse(string soapResponse) { + return ""; + } + + /// + /// Creates a formatted soap request text, to be written into SOAP logs. + /// + /// The web request for this SOAP call. + /// The request xml for this SOAP call. + /// A formatted string that represents the SOAP request. + protected virtual string FormatSoapRequest(WebRequest webRequest, string soapRequest) { + StringBuilder builder = new StringBuilder(); + builder.AppendFormat("\r\n-----------------BEGIN API CALL---------------------\r\n"); + builder.AppendFormat("\r\nRequest\r\n"); + builder.AppendFormat("-------\r\n\r\n"); + + StringBuilder headerBuilder = new StringBuilder(); + + headerBuilder.AppendFormat("{0} {1}\r\n", webRequest.Method, + webRequest.RequestUri.AbsolutePath); + foreach (string key in webRequest.Headers) { + headerBuilder.AppendFormat("{0}: {1}\r\n", key, webRequest.Headers[key]); + } + headerBuilder.AppendFormat("TimeStamp: {0}\r\n", this.GetTimeStamp()); + builder.AppendFormat("\r\n{0}\r\n", AppendHeadersToSoapXml(soapRequest, + headerBuilder.ToString())); + return builder.ToString(); + } + + /// + /// Creates a formatted soap response text, to be written into SOAP logs. + /// + /// The web response for this SOAP call. + /// The response xml for this SOAP call. + /// A formatted string that represents the SOAP response. + protected virtual string FormatSoapResponse(WebResponse webResponse, string soapResponse) { + StringBuilder builder = new StringBuilder(); + builder.AppendFormat("\r\nResponse\r\n"); + builder.AppendFormat("--------\r\n\r\n"); + + StringBuilder headerBuilder = new StringBuilder(); + foreach (string key in webResponse.Headers) { + headerBuilder.AppendFormat("{0}: {1}\r\n", key, webResponse.Headers[key]); + } + headerBuilder.AppendFormat("TimeStamp: {0}\r\n", this.GetTimeStamp()); + builder.AppendFormat("\r\n{0}\r\n", AppendHeadersToSoapXml(soapResponse, + headerBuilder.ToString())); + + builder.AppendFormat("-----------------END API CALL-----------------------\r\n"); + return builder.ToString(); + } + + /// + /// Gets the current timestamp as a formatted string. + /// + /// The current timestamp. + protected virtual string GetTimeStamp() { + return DateTime.Now.ToString("R"); + } + + /// + /// Appends the HTTP headers to SOAP xml. + /// + /// The SOAP request. + /// The HTTP headers. + /// The modified SOAP xml for appending to the logs. + protected string AppendHeadersToSoapXml(string soapRequest, string headers) { + try { + XmlDocument xDoc = SerializationUtilities.LoadXml(soapRequest); + XmlComment comment = xDoc.CreateComment(headers); + xDoc.DocumentElement.InsertBefore(comment, xDoc.DocumentElement.FirstChild); + return xDoc.OuterXml; + } catch { + return string.Format("{0}\r\n{1}\r\n", headers, soapRequest); + } + } + + /// + /// Masks a list of fields in the SOAP message before logging it. + /// + /// The SOAP message, loaded as an XmlDocument. + /// + /// The list of field names to be masked. + protected void MaskCredentialsInLogs(XmlDocument soapMessageXml, string[] fieldNames) { + XmlNamespaceManager xmlns = new XmlNamespaceManager(soapMessageXml.NameTable); + xmlns.AddNamespace("soap", "http://schemas.xmlsoap.org/soap/envelope/"); + XmlNodeList nodes = + soapMessageXml.SelectNodes("soap:Envelope/soap:Header/descendant::*", xmlns); + + foreach (XmlElement node in nodes) { + if (Array.Exists(fieldNames, delegate(string match) { + return string.Compare(match, node.LocalName, true) == 0; + })) { + node.InnerText = "******"; + } + } + } + } +} diff --git a/src/Common/Properties/AssemblyInfo.cs b/src/Common/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..b697a43a3d1 --- /dev/null +++ b/src/Common/Properties/AssemblyInfo.cs @@ -0,0 +1,37 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Ads API Dotnet Common Library")] +[assembly: AssemblyDescription( + "This library provides you with common functionality to access Ads API.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("664c76a0-82f8-489b-a74f-8595f289713b")] \ No newline at end of file diff --git a/src/Common/Properties/Properties.cs b/src/Common/Properties/Properties.cs new file mode 100644 index 00000000000..63a131184af --- /dev/null +++ b/src/Common/Properties/Properties.cs @@ -0,0 +1,23 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; + +[assembly: AssemblyCompany("Google")] +[assembly: AssemblyProduct("Ads API Dotnet Common Library")] +[assembly: AssemblyCopyright("Copyright 2012, Google Inc. All Rights Reserved.")] +[assembly: AssemblyVersion("3.0.0.0")] +[assembly: AssemblyFileVersion("3.0.0.0")] diff --git a/src/Common/Util/CsvException.cs b/src/Common/Util/CsvException.cs new file mode 100644 index 00000000000..0adb77b5b44 --- /dev/null +++ b/src/Common/Util/CsvException.cs @@ -0,0 +1,64 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.IO; +using System.Text; +using System.Runtime.Serialization; +using System.Security.Permissions; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Common.Util { + /// + /// Custom exception class for handling csv errors. + /// + [Serializable] + public class CsvException : AdsException { + /// + /// Public constructor. + /// + public CsvException() : base() { + } + + /// + /// Public constructor. + /// + /// Error message for this API exception. + public CsvException(string message) : base(message) { + } + + /// + /// Public constructor. + /// + /// Error message for this API exception. + /// Inner exception, if any. + public CsvException(string message, Exception innerException) + : base(message, innerException) { + } + + /// + /// Protected constructor. Used by serialization frameworks while + /// deserializing an exception object. + /// + /// Info about the serialization context. + /// A streaming context that represents the + /// serialization stream. + protected CsvException(SerializationInfo info, StreamingContext context) : base(info, context) { + } + } +} diff --git a/src/Common/Util/CsvFile.cs b/src/Common/Util/CsvFile.cs new file mode 100644 index 00000000000..af0c844a137 --- /dev/null +++ b/src/Common/Util/CsvFile.cs @@ -0,0 +1,257 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Text; + +namespace Google.Api.Ads.Common.Util { + /// + /// Wraps the functionalities to read and write from a CSV file. + /// + public class CsvFile { + /// + /// Headers in the csv file. + /// + private List headers; + + /// + /// Records in the csv file. + /// + private List records; + + /// + /// List of CSV file headers. + /// + public List Headers { + get { + return headers; + } + } + + /// + /// List of records in the CSV file. + /// + public List Records { + get { + return records; + } + } + + /// + /// Public constructor. + /// + public CsvFile() { + headers = new List(); + records = new List(); + } + + /// + /// Reads the contents of the CSV file into memory. + /// + /// Full path to the csv file. + /// True, if the first line of the csv file + /// is a header. + public void Read(string fileName, bool hasHeaders) { + Load(fileName, hasHeaders); + } + + /// + /// Reads the contents of the CSV string into memory. + /// + /// Text to be parsed as csv file contents. + /// True, if the first line of the csv file + /// contents is a header. + public void ReadFromString(string contents, bool hasHeaders) { + Parse(contents, hasHeaders); + } + + /// + /// Writes the contents of the CsvFile object into a file. + /// + /// The full path of the file to which + /// the contents are to be written. + /// The file will have headers only if + /// are set for this object. + public void Write(string fileName) { + using (StreamWriter writer = new StreamWriter(fileName)) { + if (Headers.Count != 0) { + StringBuilder builder = ConvertRowToCsvString(Headers.ToArray()); + writer.WriteLine(builder.ToString().TrimEnd(',')); + } + foreach (string[] row in Records) { + StringBuilder builder = ConvertRowToCsvString(row); + writer.WriteLine(builder.ToString().TrimEnd(',')); + } + } + } + + /// + /// Converts a csv row item collection into a csv string. + /// + /// An array of string items which represents + /// one row in CSV file. + /// A StringBuilder object representing the stringized row. + /// You can call a ToString() to get the stringized representation + /// for this row. + private static StringBuilder ConvertRowToCsvString(string[] rowItems) { + StringBuilder builder = new StringBuilder(); + for (int i = 0; i < rowItems.Length; i++) { + string temp = rowItems[i]; + temp = temp.Replace("\"", "\"\""); + if (temp.Contains(",") || temp.Contains("\"")) { + temp = string.Format(CultureInfo.InvariantCulture, "\"{0}\"", temp); + } + builder.Append(temp + ","); + } + return builder; + } + + /// + /// Parses a csv file and loads it into memory. + /// + /// Full path to the csv file. + /// True, if the first line of the csv file + /// is a header. + private void Load(string filePath, bool hasHeaders) { + using (StreamReader reader = new StreamReader(filePath)) { + string contents = reader.ReadToEnd(); + Parse(contents, hasHeaders); + } + } + + /// + /// Parses a csv file's contents and loads it into memory. + /// + /// File contents that should be parsed into memory. + /// + /// True, if the first line of the csv file is + /// a header. + private void Parse(string contents, bool hasHeaders) { + string[] lines = contents.Split(new char[] {'\n', '\r'}, + StringSplitOptions.RemoveEmptyEntries); + + if (lines.Length == 0) { + return; + } + int startIndex = 0; + + if (hasHeaders) { + headers = new List(SplitCsvLine(lines[0], StringSplitOptions.None)); + startIndex = 1; + } else { + headers = null; + } + records = new List(); + for (int i = startIndex; i < lines.Length; i++) { + string[] splits = SplitCsvLine(lines[i], StringSplitOptions.None); + records.Add(splits); + } + } + + /// + /// Splits a csv line into its components. + /// + /// The comma separated line to be split into + /// components. + /// The string splitting options. + /// The items, broken down as an array of strings. + /// Thrown if + /// is null. + /// Thrown if the csv string is malformed. + /// + private static string[] SplitCsvLine(string text, StringSplitOptions options) { + if (text == null) { + throw new ArgumentNullException("text"); + } + int start = 0; + List retVal = new List(); + bool quotes = false; + for (int i = 0; i < text.Length; i++) { + switch (text[i]) { + case '"': + quotes = !quotes; + break; + + case ',': + if (!quotes) { + retVal.AddRange(ExtractAndAddItem(text, start, i, options)); + start = i + 1; + } + break; + } + } + retVal.AddRange(ExtractAndAddItem(text, start, text.Length, options)); + // Quotes opened, not closed. + if (quotes) { + throw new CsvException(CommonErrorMessages.QuotesNotClosedInCsvLine); + } + return retVal.ToArray(); + } + + /// + /// Extracts one token identified by SplitCsvLine. + /// + /// The original comma separated line. + /// Start index for the item just identified. + /// + /// Stop index for the item just identified. + /// The string split options to be used while + /// extracting the token. + /// Thrown if + /// is null or empty. + /// Thrown if 0 < + /// <= <= + /// .Length is not met. + private static string[] ExtractAndAddItem(string text, int startIndex, int endIndex, + StringSplitOptions options) { + List retVal = new List(); + + if (string.IsNullOrEmpty(text)) { + throw new ArgumentNullException("text"); + } + + if (startIndex < 0 || startIndex > text.Length) { + throw new ArgumentOutOfRangeException("startIndex", + CommonErrorMessages.StringIndexOutOfBounds); + } + if (endIndex > text.Length) { + throw new ArgumentOutOfRangeException("endIndex", + CommonErrorMessages.StringIndexOutOfBounds); + } + + if (endIndex < startIndex) { + throw new ArgumentOutOfRangeException( + CommonErrorMessages.StartIndexShouldBeLessThanEndIndex); + } + + string item = String.Empty; + + item = text.Substring(startIndex, endIndex - startIndex); + item = item.Replace("\"\"", "\""); + if (item.Length >= 2 && item[0] == '"' && item[item.Length - 1] == '"') { + item = item.Substring(1, item.Length - 2); + } + if (options == StringSplitOptions.None || (options == StringSplitOptions.RemoveEmptyEntries + && !string.IsNullOrEmpty(item))) { + retVal.Add(item); + } + return retVal.ToArray(); + } + } +} diff --git a/src/Common/Util/DeprecationUtilities.cs b/src/Common/Util/DeprecationUtilities.cs new file mode 100644 index 00000000000..4003f40219b --- /dev/null +++ b/src/Common/Util/DeprecationUtilities.cs @@ -0,0 +1,53 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Reflection; + +namespace Google.Api.Ads.Common.Util { + /// + /// Utility class to display deprecation message at runtime. + /// + public class DeprecationUtilities { + /// + /// Writes a deprecation message to Trace stream. + /// + /// Details of the deprecated member. + /// The member corresponding to memberInfo should be annotated with + /// an ObsoleteAttribute. + public static void ShowDeprecationMessage(MemberInfo memberInfo) { + if (memberInfo == null) { + throw new NullReferenceException("MemberInfo cannot be null."); + } + TraceUtilities.WriteDeprecationWarnings(GetDeprecationMessage(memberInfo)); + } + + /// + /// Gets the deprecation message to be displayed. + /// + /// Details of the deprecated member. + /// The deprecation message as found on the ObsoleteAttribute + /// decoration for this member, or null otherwise. + private static string GetDeprecationMessage(MemberInfo memberInfo) { + object[] attributes = memberInfo.GetCustomAttributes(typeof(ObsoleteAttribute), false); + + if (attributes.Length > 0) { + return ((ObsoleteAttribute) attributes[0]).Message; + } + return null; + } + } +} diff --git a/src/Common/Util/MediaUtilities.cs b/src/Common/Util/MediaUtilities.cs new file mode 100644 index 00000000000..6f22a757b7f --- /dev/null +++ b/src/Common/Util/MediaUtilities.cs @@ -0,0 +1,147 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.IO; +using System.IO.Compression; +using System.Net; +using System.Text; + +namespace Google.Api.Ads.Common.Util { + /// + /// Provides utility methods for handling media resources. + /// + public static class MediaUtilities { + /// + /// Retrieves an asset from the web given its url. + /// + /// The url of the asset to be retrieved. + /// Asset data, as an array of bytes. + /// Thrown if + /// is null. + public static byte[] GetAssetDataFromUrl(Uri assetUrl) { + if (assetUrl == null) { + throw new ArgumentNullException("assetUrl"); + } + WebRequest request = HttpWebRequest.Create(assetUrl); + WebResponse response = request.GetResponse(); + + MemoryStream memStream = new MemoryStream(); + using (Stream responseStream = response.GetResponseStream()) { + CopyStream(responseStream, memStream); + } + return memStream.ToArray(); + } + + /// + /// Retrieves an asset from the web given its url. + /// + /// The url of the asset to be retrieved. + /// Asset data, as an array of bytes. + /// Thrown if + /// is null. + public static byte[] GetAssetDataFromUrl(string assetUrl) { + if (string.IsNullOrEmpty(assetUrl)) { + throw new ArgumentNullException("assetUrl"); + } + return GetAssetDataFromUrl(new Uri(assetUrl)); + } + + /// + /// Deflates data compressed in gzip format. + /// + /// Data to be deflated. + /// Deflated data. + /// Thrown if + /// is null. + public static byte[] DeflateGZipData(byte[] gzipData) { + if (gzipData == null) { + throw new ArgumentNullException("gzipData"); + } + MemoryStream memStream = new MemoryStream(); + using (GZipStream gzipStream = new GZipStream(new MemoryStream(gzipData), + CompressionMode.Decompress)) { + CopyStream(gzipStream, memStream); + } + return memStream.ToArray(); + } + + /// + /// Copies a stream from source to destination and returns the first n + /// bytes as preview. + /// + /// Source stream. + /// Destination stream. + /// The maximum number of preview bytes to + /// return. + /// An array of bytes, whose max size is maxPreviewBytes. + /// Thrown if source stream is not + /// readable, or if the target stream is not writable. + /// + /// + /// Thrown if or + /// is null. + public static byte[] CopyStreamWithPreview(Stream sourceStream, Stream targetStream, + int maxPreviewBytes) { + if (sourceStream == null) { + throw new ArgumentNullException("sourceStream"); + } + + if (targetStream == null) { + throw new ArgumentNullException("targetStream"); + } + + if (!sourceStream.CanRead) { + throw new System.ArgumentException(CommonErrorMessages.SourceStreamIsNotReadable); + } + + if (!targetStream.CanWrite) { + throw new System.ArgumentException(CommonErrorMessages.TargetStreamIsNotWritable); + } + + int bufferSize = 2 << 20; + byte[] buffer = new byte[bufferSize]; + List byteArray = new List(); + + int bytesRead = 0; + while ((bytesRead = sourceStream.Read(buffer, 0, bufferSize)) != 0) { + int index = 0; + while (byteArray.Count < maxPreviewBytes && index < bytesRead) { + byteArray.Add(buffer[index]); + index++; + } + targetStream.Write(buffer, 0, bytesRead); + } + return byteArray.ToArray(); + } + + /// + /// Copies a stream from source to destination. + /// + /// Source stream. + /// Destination stream. + /// Thrown if source stream is not + /// readable, or if the target stream is not writable. + /// + /// + /// Thrown if or + /// is null. + public static void CopyStream(Stream sourceStream, Stream targetStream) { + CopyStreamWithPreview(sourceStream, targetStream, 0); + } + } +} diff --git a/src/Common/Util/PreconditionUtilities.cs b/src/Common/Util/PreconditionUtilities.cs new file mode 100644 index 00000000000..09e9670bd26 --- /dev/null +++ b/src/Common/Util/PreconditionUtilities.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfp.Util { + + public class PreconditionUtilities { + + /// + /// Utility method for null checking arguments. + /// + /// The Object to check + /// The name of the argument being checked + public static void CheckArgumentNotNull(object value, string argument) { + if (value == null) { + throw new ArgumentNullException(argument); + } + } + } +} diff --git a/src/Common/Util/SerializationUtilities.cs b/src/Common/Util/SerializationUtilities.cs new file mode 100644 index 00000000000..8448a285d6f --- /dev/null +++ b/src/Common/Util/SerializationUtilities.cs @@ -0,0 +1,167 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.CompilerServices; +using System.Xml.Serialization; +using System.Text; +using System.Xml; + +namespace Google.Api.Ads.Common.Util { + /// + /// This class provides utility methods in serializing and deserializing an + /// object as xml. + /// + public class SerializationUtilities { + /// + /// A map to store custom xml serializers. + /// + /// For background, see + /// http://support.microsoft.com/kb/886385/en-us. The summary of the issue + /// is that .NET runtime will leak XmlSerializer objects if the non-custom + /// constructor (custom rootNode, namespace, etc.) is requested, and hence + /// the serializers need to be cached locally. To replicate memory leaks, + /// write AdWords API code that will throw a lot of SOAPExceptions. The + /// XmlSerializers obtained for deserializing the SOAP exceptions will be + /// leaked by the runtime. + /// + private static Dictionary customSerializerMaps = + new Dictionary(); + + /// + /// A mono-friendly version of XmlDocument::LoadXml. + /// + /// The xml string to be loaded into DOM. + /// The xml as XmlDocument. + public static XmlDocument LoadXml(string xmlText) { + XmlDocument xDoc = new XmlDocument(); + + try { + xDoc.LoadXml(xmlText); + } catch { + StringReader stringReader = new StringReader(xmlText); + stringReader.Read(); // skip BOM + xDoc.Load(stringReader); + } + return xDoc; + } + + /// + /// Deserialize an object from xml for a custom root node and xml namespace. + /// + /// The serialized xml. + /// The type of deserialized object. + /// The xml namespace of the object in serialized xml. + /// + /// The root node name for the object in serialized + /// xml. + /// The deserialized object or null if deserialization fails. + /// + /// must be XmlSerializable. + /// + public static object DeserializeFromXmlTextCustomRootNs(string contents, Type contentType, + string ns, string rootNode) { + if (string.IsNullOrEmpty(contents) || contentType == null || string.IsNullOrEmpty(ns) || + string.IsNullOrEmpty(rootNode)) { + return null; + } + XmlSerializer serializer = GetCustomXmlSerializer(contentType, ns, rootNode); + return DeserializeFromXmlText(serializer, contents); + } + + /// + /// Gets a custom serializer for a type from a cache. + /// + /// The type of deserialized object. + /// The xml namespace of the object in serialized xml. + /// + /// The root node name for the object in serialized + /// xml. + /// The xml serializer. + /// See http://support.microsoft.com/kb/886385/en-us and + /// http://code.google.com/p/google-api-adwords-dotnet/issues/detail?id=78 + /// for more details. + [MethodImpl(MethodImplOptions.Synchronized)] + private static XmlSerializer GetCustomXmlSerializer(Type contentType, string ns, + string rootNode) { + string key = string.Format("{0}_{1}_{2}", contentType.AssemblyQualifiedName, ns, rootNode); + if (customSerializerMaps.ContainsKey(key)) { + return customSerializerMaps[key]; + } + + XmlSerializer serializer = new XmlSerializer(contentType, new XmlAttributeOverrides(), + new Type[] {}, new XmlRootAttribute(rootNode), ns); + customSerializerMaps.Add(key, serializer); + return serializer; + } + + /// + /// Deserialize an object from xml. + /// + /// The serialized xml. + /// The type of deserialized object. + /// The deserialized object. + /// must be XmlSerializable. + /// + public static object DeserializeFromXmlText(string contents, Type contentType) { + if (string.IsNullOrEmpty(contents) || contentType == null) { + return null; + } + + return DeserializeFromXmlText(new XmlSerializer(contentType), contents); + } + + /// + /// Deserialize an object from xml. + /// + /// The serialized xml. + /// The serializer to be used for deserializing + /// the objects. + /// The deserialized object. + /// must be XmlSerializable. + /// + private static object DeserializeFromXmlText(XmlSerializer serializer, string contents) { + object retval = null; + + using (MemoryStream memStream = new MemoryStream()) { + byte[] bytes = Encoding.UTF8.GetBytes(contents); + memStream.Write(bytes, 0, bytes.Length); + memStream.Seek(0, SeekOrigin.Begin); + retval = serializer.Deserialize(memStream); + } + return retval; + } + + /// + /// Serializes an object as xml. + /// + /// The object to serialize. + /// The serialized xml string. + /// must me XmlSerializable. + /// + public static string SerializeAsXmlText(object objToSerialize) { + string retval = ""; + + using (MemoryStream memStream = new MemoryStream()) { + new XmlSerializer(objToSerialize.GetType()).Serialize(memStream, objToSerialize); + retval = Encoding.UTF8.GetString(memStream.ToArray()); + } + return retval; + } + } +} diff --git a/src/Common/Util/TraceUtilities.cs b/src/Common/Util/TraceUtilities.cs new file mode 100644 index 00000000000..914734ea2a5 --- /dev/null +++ b/src/Common/Util/TraceUtilities.cs @@ -0,0 +1,123 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +#define TRACE + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; + +namespace Google.Api.Ads.Common.Util { + /// + /// Provides utility methods to write to Trace stream. + /// + public class TraceUtilities { + /// + /// Trace source for deprecation messages. + /// + private const string DEPRECATION_MESSAGES_SOURCE = "AdsClientLibs.DeprecationMessages"; + + /// + /// Trace source for general warning messages. + /// + private const string GENERAL_WARNING_MESSAGES_SOURCE = "AdsClientLibs.GeneralWarningMessages"; + + /// + /// Trace source for SOAP XML logs. + /// + private const string SOAP_XML_LOGS_SOURCE = "AdsClientLibs.SoapXmlLogs"; + + /// + /// Trace source for request info logs. + /// + private const string REQUEST_INFO_LOGS_SOURCE = "AdsClientLibs.RequestInfoLogs"; + + /// + /// The Trace message id. + /// + /// Trace.Write needs a TRACE id to categorize messages, but since + /// we don't provide any categorization, we will use a standard value. + /// + private const int ADS_API_TRACE_ID = 1; + + /// + /// Writes the deprecation warnings. + /// + /// The message. + /// The trace levels may be controlled from App.config by setting + /// the level for AdsClientLibs.DeprecationMessages trace switch. + public static void WriteDeprecationWarnings(string message) { + Write(DEPRECATION_MESSAGES_SOURCE, TraceEventType.Warning, message); + } + + /// + /// Writes the general warnings. + /// + /// The message. + /// The trace levels may be controlled from App.config by setting + /// the level for AdsClientLibs.GeneralWarningMessages trace switch. + public static void WriteGeneralWarnings(string message) { + Write(GENERAL_WARNING_MESSAGES_SOURCE, TraceEventType.Warning, message); + } + + /// + /// Writes the general errors. + /// + /// The message. + /// The trace levels may be controlled from App.config by setting + /// the level for AdsClientLibs.GeneralWarningMessages trace switch. + public static void WriteGeneralErrors(string message) { + Write(GENERAL_WARNING_MESSAGES_SOURCE, TraceEventType.Error, message); + } + + /// + /// Writes the SOAP XML logs. + /// + /// The SOAP XML logs. + /// Indicates whether or not these are error logs. + /// The trace levels may be controlled from App.config by setting + /// the level for AdsClientLibs.SoapXmlLogs trace switch. + public static void WriteSoapXmlLogs(string message, Boolean isError) { + TraceEventType type = isError ? TraceEventType.Error : TraceEventType.Information; + Write(SOAP_XML_LOGS_SOURCE, type, message); + } + + /// + /// Writes the request info logs. + /// + /// The request info logs. + /// Indicates whether or not these are error logs. + /// The trace levels may be controlled from App.config by setting + /// the level for AdsClientLibs.RequestInfoLogs trace switch. + public static void WriteRequestInfoLogs(string message, Boolean isError) { + TraceEventType type = isError ? TraceEventType.Error : TraceEventType.Information; + Write(REQUEST_INFO_LOGS_SOURCE, type, message); + } + + /// + /// Writes to the specified Trace source. + /// + /// The trace source. + /// The message level. + /// The message. + private static void Write(string source, TraceEventType level, string message) { + TraceSource messageTrace = new TraceSource(source); + messageTrace.TraceEvent(level, ADS_API_TRACE_ID, message); + messageTrace.Flush(); + } + } +} diff --git a/src/Dfa/AdsApi.snk b/src/Dfa/AdsApi.snk new file mode 100644 index 0000000000000000000000000000000000000000..ec3f95a81b7eabad745a46d3d5a41bfdad9e1f08 GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50098khK_oNbYq%=?O^MjDm1QRlz}mDy*v@} zyFJX3o-nzWlB1*E89YMX;)Ds3NTn zN`@AG1Q+1@(JLnyrrK2W$S!&~mnNCT(b3OR`kS8n9?J9pD<<5YoXVojpd4(Wp5NVH9|f6Ai*< z5tV4_*vpg<#L(YoQ@T6c#NLc^O|El>UZfU|R1_?WhZj0*X0Foj`GLf3xrK5R>t43k z@+BE{!3FtQUw<*bkJ8}L6zjO@$VqTSwr%>q^=oiDMReDZX`drypSlLeYv`iX zHza^C&A7K+Hg%>#4!M|QteHnPNHk2P-qWF^$F6_BIu#cPj@6+W@``@-BbzLUs3HDf z{lxkMC>o`_z`Q3zG zt4PxNR8YupxMo|ph=Muxm>&%*W^dlpBdbFaBe@DQD~Jh;B331BWYc!Kf9G3*!(|%y i6@qDr^z2-~2~-rv){Bw_+YYz(@3!R2@*&S-vqu?z%_5!v literal 0 HcmV?d00001 diff --git a/src/Dfa/App.config b/src/Dfa/App.config new file mode 100644 index 00000000000..3a6bc204c19 --- /dev/null +++ b/src/Dfa/App.config @@ -0,0 +1,189 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Dfa/Dfa.csproj b/src/Dfa/Dfa.csproj new file mode 100644 index 00000000000..97cf962eddf --- /dev/null +++ b/src/Dfa/Dfa.csproj @@ -0,0 +1,114 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB} + Library + Properties + Google.Api.Ads.Dfa + Dfa + v4.0 + true + AdsApi.snk + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AnyCPU + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + True + True + DfaErrorMessages.resx + + + + + + + + + + + + + + + + + + + + True + True + CodeCsvs.resx + + + + + + + + + + + + + + {277404DB-A439-4450-B3A5-186294CDF245} + Common + + + + + + Designer + + + + + + ResXFileCodeGenerator + DfaErrorMessages.Designer.cs + Designer + + + ResXFileCodeGenerator + Designer + CodeCsvs.Designer.cs + + + + + \ No newline at end of file diff --git a/src/Dfa/DfaErrorMessages.Designer.cs b/src/Dfa/DfaErrorMessages.Designer.cs new file mode 100644 index 00000000000..dc29dd986af --- /dev/null +++ b/src/Dfa/DfaErrorMessages.Designer.cs @@ -0,0 +1,99 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.296 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Google.Api.Ads.Dfa { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class DfaErrorMessages { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal DfaErrorMessages() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Google.Api.Ads.Dfa.DfaErrorMessages", typeof(DfaErrorMessages).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to OAuth provider cannot be null when selecting Authorization method as "OAuth2".. + /// + internal static string OAuthProviderCannotBeNull { + get { + return ResourceManager.GetString("OAuthProviderCannotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Password cannot be empty.. + /// + internal static string PasswordCannotBeEmpty { + get { + return ResourceManager.GetString("PasswordCannotBeEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Signature should be a {0} instance.. + /// + internal static string SignatureIsOfWrongType { + get { + return ResourceManager.GetString("SignatureIsOfWrongType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Username cannot be empty.. + /// + internal static string UserNameCannotBeEmpty { + get { + return ResourceManager.GetString("UserNameCannotBeEmpty", resourceCulture); + } + } + } +} diff --git a/src/Dfa/DfaErrorMessages.resx b/src/Dfa/DfaErrorMessages.resx new file mode 100644 index 00000000000..fa2432800e7 --- /dev/null +++ b/src/Dfa/DfaErrorMessages.resx @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + OAuth provider cannot be null when selecting Authorization method as "OAuth2". + Used by DfaSoapClient.MakeApiCall when setting authorization headers. + + + Password cannot be empty. + Used for validating DfaPassword key. + + + Signature should be a {0} instance. + Used for ArgumentException by DfaServiceFactory.CreateService if the signature is not of desired type. + + + Username cannot be empty. + Used for validating DfaUserName key. + + \ No newline at end of file diff --git a/src/Dfa/Lib/DefaultLoginTokenCache.cs b/src/Dfa/Lib/DefaultLoginTokenCache.cs new file mode 100644 index 00000000000..f16bcca27bb --- /dev/null +++ b/src/Dfa/Lib/DefaultLoginTokenCache.cs @@ -0,0 +1,88 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfa.Lib { + /// + /// Default implementation of login token cache. + /// + public class DefaultLoginTokenCache : LoginTokenCache { + /// + /// An internal dictionary for caching login tokens. + /// + InMemoryTokenCache tokenCache = new InMemoryTokenCache(); + + #region LoginTokenCache Members + + /// + /// Adds a login token to cache. + /// + /// The DFA user name. + /// The DFA user password. + /// The login token. + /// + /// The login token. + /// + public UserToken AddToken(string username, UserToken token) { + ValidateParams(username); + return tokenCache.AddToken(username, token); + } + + /// + /// Gets a login token from cache. + /// + /// The DFA user name. + /// + /// The login token, or null if the cache doesn't have a token. + /// + public UserToken GetToken(string username) { + ValidateParams(username); + return tokenCache.GetToken(username); + } + + /// + /// Invalidates a login token. + /// + /// The login token. + public void InvalidateToken(UserToken token) { + tokenCache.InvalidateToken(token); + } + + /// + /// Clears the cache. + /// + public void Clear() { + tokenCache.Clear(); + } + + #endregion + + /// + /// Validates the input params. + /// + /// The DFA user name. + private static void ValidateParams(string username) { + if (string.IsNullOrEmpty(username)) { + throw new ArgumentException(DfaErrorMessages.UserNameCannotBeEmpty); + } + } + } +} diff --git a/src/Dfa/Lib/DfaApiException.cs b/src/Dfa/Lib/DfaApiException.cs new file mode 100644 index 00000000000..af9b506c9bf --- /dev/null +++ b/src/Dfa/Lib/DfaApiException.cs @@ -0,0 +1,115 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfa.Util; + +using System; +using System.IO; +using System.Runtime.Serialization; +using System.Security.Permissions; +using System.Text; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfa.Lib { + /// + /// Custom exception class for wrapping DFA API SOAP exceptions. + /// + [Serializable] + public class DfaApiException : DfaException { + /// + /// The parsed error code. + /// + private ErrorCode errorCode; + + /// + /// Gets the error code. + /// + public ErrorCode ErrorCode { + get { + return errorCode; + } + } + + /// + /// Public constructor. + /// + public DfaApiException() : base() { + } + + /// + /// Public constructor. + /// + /// The parsed error code from the server. + public DfaApiException(ErrorCode errorCode) : base() { + this.errorCode = errorCode; + } + + /// + /// Public constructor. + /// + /// The parsed error code from the server. + /// Error message for this API exception. + public DfaApiException(ErrorCode errorCode, string message) : base(message) { + this.errorCode = errorCode; + } + + /// + /// Public constructor. + /// + /// The parsed error code from the server. + /// Error message for this API exception. + /// Inner exception, if any. + public DfaApiException(ErrorCode errorCode, string message, Exception innerException) + : base(message, innerException) { + this.errorCode = errorCode; + } + + /// + /// Protected constructor. Used by serialization frameworks while + /// deserializing an exception object. + /// + /// Info about the serialization context. + /// A streaming context that represents the + /// serialization stream. + protected DfaApiException(SerializationInfo info, StreamingContext context) + : base(info, context) { + if (info == null) { + throw new ArgumentNullException("info"); + } + errorCode = GetValue(info, "errorCode"); + } + + /// + /// This method is called by serialization frameworks while serializing + /// an exception object. + /// + /// Info about the serialization context. + /// A streaming context that represents the + /// serialization stream. + [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)] + public override void GetObjectData(SerializationInfo info, StreamingContext context) { + if (info == null) { + throw new ArgumentNullException("info"); + } + base.GetObjectData(info, context); + if (errorCode != null) { + info.AddValue("errorCode", errorCode); + } + } + } +} diff --git a/src/Dfa/Lib/DfaAppConfig.cs b/src/Dfa/Lib/DfaAppConfig.cs new file mode 100644 index 00000000000..eb8329ed1f5 --- /dev/null +++ b/src/Dfa/Lib/DfaAppConfig.cs @@ -0,0 +1,243 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Configuration; +using System.Collections; +using System.Collections.Specialized; +using System.IO; +using System.Net; +using System.Xml; + +namespace Google.Api.Ads.Dfa.Lib { + /// + /// This class reads the configuration keys from App.config. + /// + public class DfaAppConfig : AppConfigBase { + /// + /// The short name to identify this assembly. + /// + private const string SHORT_NAME = "DfaApi-Dotnet"; + + /// + /// Key name for dfaAuthToken. + /// + private const string DFA_AUTHTOKEN = "DfaAuthToken"; + + /// + /// Key name for dfaUserName. + /// + private const string DFA_USERNAME = "DfaUserName"; + + /// + /// Key name for dfaPassword. + /// + private const string DFA_PASSWORD = "DfaPassword"; + + /// + /// Key name for applicationName. + /// + private const string APPLICATION_NAME = "ApplicationName"; + + /// + /// Key name for DFA API URL. + /// + private const string DFAAPI_SERVER = "DfaApi.Server"; + + /// + /// Default value for DFAAPI_SERVER. + /// + private const string DEFAULT_DFAAPI_SERVER = "https://advertisersapi.doubleclick.net"; + + /// + /// OAUth2 scope for DFA API. + /// + private const string DFA_OAUTH2_SCOPE = "https://www.googleapis.com/auth/dfatrafficking"; + + /// + /// Key name for authorizationMethod. + /// + private const string AUTHORIZATION_METHOD = "AuthorizationMethod"; + + /// + /// Default value for authorizationMethod. + /// + private const DfaAuthorizationMethod DEFAULT_AUTHORIZATION_METHOD = + DfaAuthorizationMethod.LoginService; + + /// + /// Login authentication token to be used in making API calls. + /// + private string dfaAuthToken; + + /// + /// Email to be used in getting login token. + /// + private string dfaUserName; + + /// + /// Password to be used in getting login tokens. + /// + private string dfaPassword; + + /// + /// Application name. + /// + private string applicationName; + + /// + /// URL for DFA API. + /// + private string dfaApiServer; + + /// + /// Authorization method to be used when making API calls. + /// + private DfaAuthorizationMethod authorizationMethod; + + /// + /// Gets or sets the auth token to be used in SOAP headers. + /// + public string DfaAuthToken { + get { + return dfaAuthToken; + } + set { + SetPropertyField("DfaAuthToken", ref dfaAuthToken, value); + } + } + + /// + /// Gets or sets the username to be used in getting AuthToken. + /// + public string DfaUserName { + get { + return dfaUserName; + } + set { + SetPropertyField("DfaUserName", ref dfaUserName, value); + } + } + + /// + /// Gets or sets the password to be used in getting AuthToken. + /// + public string DfaPassword { + get { + return dfaPassword; + } + set { + SetPropertyField("DfaPassword", ref dfaPassword, value); + } + } + + /// + /// Gets or sets the application name. + /// + public string ApplicationName { + get { + return applicationName; + } + set { + SetPropertyField("ApplicationName", ref applicationName, value); + } + } + + /// + /// Gets or sets URL for DFA API. + /// + public string DfaApiServer { + get { + return dfaApiServer; + } + set { + SetPropertyField("DfaApiServer", ref dfaApiServer, value); + } + } + + /// + /// Gets or sets the authorization method to be used when making API calls. + /// + public DfaAuthorizationMethod AuthorizationMethod { + get { + return authorizationMethod; + } + set { + SetPropertyField("AuthorizationMethod", ref authorizationMethod, value); + } + } + + /// + /// Gets a useragent string that can be used with the library. + /// + public string GetUserAgent() { + return String.Format("{0} ({1}{2})", this.applicationName, this.Signature, + this.EnableGzipCompression ? ", gzip" : ""); + } + + /// + /// Public constructor. + /// + public DfaAppConfig() : base() { + authorizationMethod = DEFAULT_AUTHORIZATION_METHOD; + dfaAuthToken = ""; + dfaUserName = null; + dfaPassword = null; + applicationName = ""; + dfaApiServer = DEFAULT_DFAAPI_SERVER; + + ReadSettings((Hashtable) ConfigurationManager.GetSection("DfaApi")); + } + + /// + /// Read all settings from App.config. + /// + /// The parsed App.config settings. + protected override void ReadSettings(Hashtable settings) { + base.ReadSettings(settings); + + try { + authorizationMethod = (DfaAuthorizationMethod) Enum.Parse( + typeof(DfaAuthorizationMethod), + ReadSetting(settings, AUTHORIZATION_METHOD, authorizationMethod.ToString())); + } catch { + authorizationMethod = DEFAULT_AUTHORIZATION_METHOD; + } + dfaAuthToken = ReadSetting(settings, DFA_AUTHTOKEN, dfaAuthToken); + dfaUserName = ReadSetting(settings, DFA_USERNAME, dfaUserName); + dfaPassword = ReadSetting(settings, DFA_PASSWORD, dfaPassword); + applicationName = ReadSetting(settings, APPLICATION_NAME, applicationName); + + dfaApiServer = ReadSetting(settings, DFAAPI_SERVER, dfaApiServer); + + // If there is an OAuth2 scope mentioned in App.config, this will be + // loaded by the above call. If there isn't one, we will initialize it + // with a library-specific default value. + if (string.IsNullOrEmpty(this.OAuth2Scope)) { + this.OAuth2Scope = GetDefaultOAuth2Scope(); + } + } + + /// + /// Gets the default OAuth2 scope. + /// + public override string GetDefaultOAuth2Scope() { + return DFA_OAUTH2_SCOPE; + } + } +} diff --git a/src/Dfa/Lib/DfaAuthorizationMethod.cs b/src/Dfa/Lib/DfaAuthorizationMethod.cs new file mode 100644 index 00000000000..cb854d77f55 --- /dev/null +++ b/src/Dfa/Lib/DfaAuthorizationMethod.cs @@ -0,0 +1,32 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +namespace Google.Api.Ads.Dfa.Lib { + /// + /// List of supported Authorization methods for DFA API. + /// + public enum DfaAuthorizationMethod { + /// + /// LoginService API. + /// + LoginService, + + /// + /// OAuth 2.0 API. + /// + OAuth2 + } +} diff --git a/src/Dfa/Lib/DfaCredentialsExpiredException.cs b/src/Dfa/Lib/DfaCredentialsExpiredException.cs new file mode 100644 index 00000000000..5237e6b8abf --- /dev/null +++ b/src/Dfa/Lib/DfaCredentialsExpiredException.cs @@ -0,0 +1,33 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfa.Lib { + public class DfaCredentialsExpiredException : CredentialsExpiredException { + /// + /// Public constructor. + /// + /// The expired credential. + public DfaCredentialsExpiredException(UserToken expiredCredential) + : base(expiredCredential) { + } + } +} diff --git a/src/Dfa/Lib/DfaErrorHandler.cs b/src/Dfa/Lib/DfaErrorHandler.cs new file mode 100644 index 00000000000..ecf7460b9bc --- /dev/null +++ b/src/Dfa/Lib/DfaErrorHandler.cs @@ -0,0 +1,121 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Dfa.Util; + +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; + +namespace Google.Api.Ads.Dfa.Lib { + /// + /// Handles DFA API Errors. + /// + public class DfaErrorHandler : ErrorHandler { + private static readonly ErrorCode TOKEN_EXPIRED_CODE = ErrorCode.FromCode(4); + private const string TOKEN_EXPIRED_MESSAGE = "Authentication token has expired."; + + /// + /// The service associated with this error handler. + /// + private DfaSoapClient service = null; + + /// + /// Initializes a new instance of the class. + /// + /// The service associated with this error handler. + /// + public DfaErrorHandler(DfaSoapClient service) + : base(service.User.Config) { + this.service = service; + } + + /// + /// Gets the user. + /// + private DfaUser User { + get { + return this.service.User as DfaUser; + } + } + + /// + /// Gets the config. + /// + private DfaAppConfig Config { + get { + return this.User.Config as DfaAppConfig; + } + } + + /// + /// Checks if an API call should be retried when an exception occurs. + /// + /// The exception. + /// + /// True, if the call should be retried, false otherwise. + /// + public override bool ShouldRetry(Exception ex) { + return HaveMoreRetryAttemptsLeft() && IsExpiredCredentialsError(ex); + } + + /// + /// Prepares the system for retrying the last failed call. + /// + /// The exception. + public override void PrepareForRetry(Exception ex) { + if (IsExpiredCredentialsError(ex)) { + DfaCredentialsExpiredException e = (DfaCredentialsExpiredException) ex; + LoginUtil.Cache.InvalidateToken(e.ExpiredCredential); + this.Config.DfaAuthToken = null; + this.service.Token = null; + IncrementRetriedAttempts(); + } else { + throw ex; + } + } + + /// + /// Determines whether an exception corrsponds to an expired credential. + /// + /// The exception. + /// True if the exception corresponds to an expired credential, + /// false otherwise. + public static bool IsExpiredCredentialsError(Exception ex) { + return ex is DfaCredentialsExpiredException; + } + + /// + /// Determines whether the exception thrown by the server is due to a login + /// token expiration. + /// + /// The exception. + /// True, if the server exception is a AuthToken invalid error, + /// false otherwise. + public static bool IsTokenExpiredError(Exception ex) { + if (ex is DfaApiException) { + DfaApiException dfaEx = (DfaApiException) ex; + if (dfaEx.ErrorCode == TOKEN_EXPIRED_CODE && dfaEx.Message.CompareTo( + TOKEN_EXPIRED_MESSAGE) == 0) { + return true; + } + } + return false; + } + } +} diff --git a/src/Dfa/Lib/DfaException.cs b/src/Dfa/Lib/DfaException.cs new file mode 100644 index 00000000000..463253d1321 --- /dev/null +++ b/src/Dfa/Lib/DfaException.cs @@ -0,0 +1,65 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.IO; +using System.Runtime.Serialization; +using System.Security.Permissions; +using System.Text; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfa.Lib { + /// + /// Base class for all exceptions specific to DFA. + /// + [Serializable] + public class DfaException : AdsException { + /// + /// Public constructor. + /// + public DfaException() : base() { + } + + /// + /// Public constructor. + /// + /// Error message for this API exception. + public DfaException(string message) : base(message) { + } + + /// + /// Public constructor. + /// + /// Error message for this API exception. + /// Inner exception, if any. + public DfaException(string message, Exception innerException) + : base(message, innerException) { + } + + /// + /// Protected constructor. Used by serialization frameworks while + /// deserializing an exception object. + /// + /// Info about the serialization context. + /// A streaming context that represents the + /// serialization stream. + protected DfaException(SerializationInfo info, StreamingContext context) + : base(info, context) { + } + } +} diff --git a/src/Dfa/Lib/DfaService.cs b/src/Dfa/Lib/DfaService.cs new file mode 100644 index 00000000000..7739f15ec81 --- /dev/null +++ b/src/Dfa/Lib/DfaService.cs @@ -0,0 +1,47 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Reflection; + +namespace Google.Api.Ads.Dfa.Lib { + /// + /// Lists all the services available through this library. + /// + public partial class DfaService : AdsService { + /// + /// Creates a service creation parameter for defining a DFA service. + /// + /// Service version. + /// Service name. + /// A service creation parameter defining this service. + protected static ServiceSignature MakeServiceSignature(string version, string serviceName) { + return new DfaServiceSignature(version, serviceName); + } + + /// + /// Gets all service types defined in this service. + /// + /// The nested types that define service versions under this + /// service. + public override Type[] GetServiceTypes() { + return MethodInfo.GetCurrentMethod().DeclaringType.GetNestedTypes(); + } + } +} diff --git a/src/Dfa/Lib/DfaServiceFactory.cs b/src/Dfa/Lib/DfaServiceFactory.cs new file mode 100644 index 00000000000..a2b37d9b677 --- /dev/null +++ b/src/Dfa/Lib/DfaServiceFactory.cs @@ -0,0 +1,155 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Reflection; +using System.Text; +using System.Web.Services; +using System.Web.Services.Protocols; +using System.Xml; +using System.Xml.Schema; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfa.Lib { + /// + /// The factory class for all DFA API services. + /// + public class DfaServiceFactory : ServiceFactory { + /// + /// Default public constructor. + /// + public DfaServiceFactory() { + } + + /// + /// Create a service object. + /// + /// Signature of the service being created. + /// The user for which the service is being created. + /// The server to which the API calls should be + /// made. + /// + /// An object of the desired service type. + public override AdsClient CreateService(ServiceSignature signature, AdsUser user, + Uri serverUrl) { + DfaAppConfig config = (DfaAppConfig) base.Config; + + if (serverUrl == null) { + serverUrl = new Uri(config.DfaApiServer); + } + + if (user == null) { + throw new ArgumentNullException("user"); + } + + CheckServicePreconditions(signature); + + DfaServiceSignature dfaapiSignature = signature as DfaServiceSignature; + + AdsClient service = (AdsClient) Activator.CreateInstance(dfaapiSignature.ServiceType); + + if (config.Proxy != null) { + service.Proxy = config.Proxy; + } + + service.Timeout = config.Timeout; + service.Url = string.Format("{0}{1}/api/dfa-api/{2}", + serverUrl, dfaapiSignature.Version, dfaapiSignature.ServiceEndpoint); + service.UserAgent = config.GetUserAgent(); + + service.User = user; + service.Signature = signature; + + service.GetType().GetProperty("RequestHeader").SetValue(service, + GetRequestHeader(), null); + SetRequestHeaderNameSpace(signature as DfaServiceSignature, service); + + return service; + } + + /// + /// Gets the request header. + /// + /// The request header. + private RequestHeader GetRequestHeader() { + DfaAppConfig config = (DfaAppConfig) base.Config; + RequestHeader reqHeader = new RequestHeader(); + reqHeader.ApplicationName = config.GetUserAgent(); + return reqHeader; + } + + /// + /// Sets the request header namespace in outgoing Soap Requests. + /// + /// The service creation parameters. + /// The service object for which RequestHeader + /// needs to be patched. + private static void SetRequestHeaderNameSpace(DfaServiceSignature signature, + AdsClient service) { + // Set the header namespace prefix. For all /cm services, the members + // shouldn't have xmlns. For all other services, the members should have + // /cm as xmlns. + object[] attributes = service.GetType().GetCustomAttributes(false); + foreach (object attribute in attributes) { + if (attribute is WebServiceBindingAttribute) { + WebServiceBindingAttribute binding = (WebServiceBindingAttribute) attribute; + + string xmlns = binding.Namespace; + RequestHeader svcRequestHeader = null; + PropertyInfo propInfo = service.GetType().GetProperty("RequestHeader"); + if (propInfo != null) { + svcRequestHeader = (RequestHeader) propInfo.GetValue(service, null); + + if (svcRequestHeader != null) { + PropertyInfo wsPropInfo = svcRequestHeader.GetType().GetProperty("TargetNamespace"); + if (wsPropInfo != null) { + wsPropInfo.SetValue(svcRequestHeader, xmlns, null); + } + } + } + } + } + } + + /// + /// Reads the headers from App.config. + /// + /// The configuration class. + protected override void ReadHeadersFromConfig(AppConfig config) { + // nothing to do here. + } + + /// + /// Checks preconditions of the service signature and throws and exception if the service + /// cannot be generated. + /// + /// the service signature for generating the service + protected override void CheckServicePreconditions(ServiceSignature signature) { + if (signature == null) { + throw new ArgumentNullException("signature"); + } + + if (!(signature is DfaServiceSignature)) { + throw new InvalidCastException(string.Format(CultureInfo.InvariantCulture, + DfaErrorMessages.SignatureIsOfWrongType, typeof(DfaServiceSignature))); + } + } + } +} diff --git a/src/Dfa/Lib/DfaServiceSignature.cs b/src/Dfa/Lib/DfaServiceSignature.cs new file mode 100644 index 00000000000..c8c9e2a66fc --- /dev/null +++ b/src/Dfa/Lib/DfaServiceSignature.cs @@ -0,0 +1,82 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Reflection; +using System.Text; +using System.Web.Services; +using System.Web.Services.Protocols; +using System.Xml; +using System.Xml.Schema; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfa.Lib { + /// + /// Service creation params for DFA API family of services. + /// + public class DfaServiceSignature : ServiceSignature { + /// + /// Gets the type of service. + /// + public override Type ServiceType { + get { + return Type.GetType(string.Format(CultureInfo.InvariantCulture, + "Google.Api.Ads.Dfa.{0}.{1}", VersionNamespace, ServiceName)); + } + } + + /// + /// Gets the service version namespace. + /// + public string VersionNamespace { + get { + // Version takes the form of vx.yz, but since since it is not a valid + // identifier in C#, we generate namespace as vx_yz. + return Version.Replace(".", "_"); + } + } + + /// + /// Gets the service endpoint. + /// + public string ServiceEndpoint { + get { + // The generated classes have their name as XyzRemoteService, and their + // endpoints are /xyz (i.e. lower case, and without RemoteService). + string endpoint = ServiceName.ToLower().Replace("remoteservice", ""); + + if (endpoint.CompareTo("placementstrategy") == 0) { + return "strategy"; + } else { + return endpoint; + } + } + } + + /// + /// Public constructor. + /// + /// Service version. + /// Service name. + public DfaServiceSignature(string version, string serviceName) : base(version, serviceName, + SupportedProtocols.WSE) { + } + } +} diff --git a/src/Dfa/Lib/DfaSoapClient.cs b/src/Dfa/Lib/DfaSoapClient.cs new file mode 100644 index 00000000000..1876f5e67ab --- /dev/null +++ b/src/Dfa/Lib/DfaSoapClient.cs @@ -0,0 +1,216 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfa.Util; + +using System; +using System.IO; +using System.Net; +using System.Reflection; +using System.Text; +using System.Web.Services; +using System.Web.Services.Protocols; +using System.Xml; +using System.Xml.Serialization; +using System.Web.Services.Configuration; + +namespace Google.Api.Ads.Dfa.Lib { + /// + /// Base class for DFA API services. + /// + public class DfaSoapClient : AdsSoapClient { + /// + /// The user token for authentication purposes. + /// + UserToken token = null; + + /// + /// The optional request header for sending additional details. + /// + RequestHeader requestHeader = null; + + /// + /// The response header from DFA server. + /// + ResponseHeader responseHeader = null; + + /// + /// Gets or sets the request header. + /// + public RequestHeader RequestHeader { + get { + return requestHeader; + } set { + requestHeader = value; + } + } + + /// + /// Gets or sets the response header. + /// + public ResponseHeader ResponseHeader { + get { + return responseHeader; + } + set { + responseHeader = value; + } + } + + /// + /// Gets or sets the token for authentication purposes. + /// + public UserToken Token { + get { + return token; + } set { + token = value; + } + } + + /// + /// Initializes the service before MakeApiCall. + /// + /// Name of the method. + /// The method parameters. + protected override void InitForCall(string methodName, object[] parameters) { + DfaAppConfig config = this.User.Config as DfaAppConfig; + string oAuthHeader = null; + + if (this.GetType().Name == "LoginRemoteService") { + // The choice of OAuth comes only when calling LoginRemoteService. + // All other services will still use the login token. + if (config.AuthorizationMethod == DfaAuthorizationMethod.OAuth2) { + if (this.User.OAuthProvider != null) { + oAuthHeader = this.User.OAuthProvider.GetAuthHeader(); + } else { + throw new DfaApiException(null, DfaErrorMessages.OAuthProviderCannotBeNull); + } + } + } else { + if (this.Token == null) { + this.Token = LoginUtil.GetAuthenticationToken(this.User, this.Signature.Version); + } + } + + ContextStore.AddKey("OAuthHeader", oAuthHeader); + ContextStore.AddKey("RequestHeader", requestHeader); + ContextStore.AddKey("Token", Token); + + base.InitForCall(methodName, parameters); + } + + /// + /// Cleans up the service after MakeApiCall. + /// + /// Name of the method. + /// The method parameters. + protected override void CleanupAfterCall(string methodName, object[] parameters) { + this.ResponseHeader = (ResponseHeader) ContextStore.GetValue("ResponseHeader"); + ContextStore.RemoveKey("OAuthHeader"); + ContextStore.RemoveKey("RequestHeader"); + ContextStore.RemoveKey("ResponseHeader"); + ContextStore.RemoveKey("Token"); + + base.CleanupAfterCall(methodName, parameters); + } + + /// + /// Creates a WebRequest instance for the specified url. + /// + /// The Uri to use when creating the WebRequest. + /// + /// The WebRequest instance. + /// + protected override WebRequest GetWebRequest(Uri uri) { + WebRequest request = base.GetWebRequest(uri); + string oAuthHeader = (string) ContextStore.GetValue("OAuthHeader"); + if (!string.IsNullOrEmpty(oAuthHeader)) { + request.Headers["Authorization"] = oAuthHeader; + } + return request; + } + + /// + /// Creates the error handler. + /// + /// + /// The error handler instance. + /// + protected override ErrorHandler CreateErrorHandler() { + return new DfaErrorHandler(this); + } + + /// + /// Gets a custom exception that wraps the SOAP exception thrown + /// by the server. + /// + /// SOAPException that was thrown by the server. + /// A custom exception object that wraps the SOAP exception. + /// + protected override Exception GetCustomException(SoapException ex) { + string defaultNs = GetDefaultNamespace(); + + object apiException = Activator.CreateInstance(Type.GetType( + this.GetType().Namespace + ".ApiException")); + XmlNode faultNode = GetDetailsNode(ex); + ErrorCode errorCode = null; + + if (faultNode != null) { + errorCode = new ErrorCode(); + foreach (XmlElement xNode in faultNode.SelectNodes("*")) { + switch (xNode.Name) { + case "errorCode": + errorCode.Code = int.Parse(xNode.InnerText); + break; + + case "errorMessage": + errorCode.Description = xNode.InnerText; + break; + } + } + } + DfaApiException dfaApiException = new DfaApiException(errorCode, ex.Message, ex); + if (DfaErrorHandler.IsTokenExpiredError(dfaApiException)) { + return new DfaCredentialsExpiredException(this.Token); + } else { + return dfaApiException; + } + } + + /// + /// Gets the details node for the SOAP exception. + /// + /// The SOAP exception. + /// The details node. + private static XmlNode GetDetailsNode(SoapException ex) { + String[] possibleNodeNames = { + "com.doubleclick.dart.appserver.dfa.dto.api.ApiException", + "com.google.ads.xfa.soapapi.entity.common.ApiException" + }; + + foreach (String nodeName in possibleNodeNames) { + XmlNode faultNode = ex.Detail.SelectSingleNode(nodeName); + if (faultNode != null) { + return faultNode; + } + } + return null; + } + } +} diff --git a/src/Dfa/Lib/DfaTraceListener.cs b/src/Dfa/Lib/DfaTraceListener.cs new file mode 100644 index 00000000000..ee2c106c7d8 --- /dev/null +++ b/src/Dfa/Lib/DfaTraceListener.cs @@ -0,0 +1,90 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.IO; +using System.Net; +using System.Runtime.Remoting.Messaging; +using System.Text; +using System.Web; +using System.Web.Services; +using System.Web.Services.Protocols; +using System.Xml; +using System.Xml.Serialization; +using System.Globalization; +using System.Threading; +using Google.Api.Ads.Dfa.Lib; + +namespace Google.Api.Ads.Common.Lib { + /// + /// Listens to SOAP messages sent and received by this library. + /// + public class DfaTraceListener : TraceListener { + /// + /// The singleton instance. + /// + protected static DfaTraceListener instance = new DfaTraceListener(); + + /// + /// Protected constructor. + /// + protected DfaTraceListener() : base(new DfaAppConfig()) { + } + + /// + /// Gets the singleton instance. + /// + public static SoapListener Instance { + get { + return instance; + } + } + + /// + /// Create a formatted HTTP request text, to be written into HTTP logs. + /// + /// The request XML for this SOAP call. + /// A formatted string that represents the HTTP request. + protected override string FormatHttpRequest(string soapRequest) { + XmlDocument xDoc = new XmlDocument(); + xDoc.LoadXml(soapRequest); + XmlNamespaceManager xmlns = new XmlNamespaceManager(xDoc.NameTable); + xmlns.AddNamespace("soap", "http://schemas.xmlsoap.org/soap/envelope/"); + XmlNode methodNode = + xDoc.SelectSingleNode("soap:Envelope/soap:Body/*", xmlns); + return string.Format("method={0}", methodNode.Name); + } + + /// + /// Create a formatted http response text, to be written into HTTP logs. + /// + /// The response xml for this SOAP call. + /// A formatted string that represents the HTTP response. + protected override string FormatHttpResponse(string soapResponse) { + // Right now, there isn't anything in the DFA response header that needs + // to be formatted as part of HTTP logs. + return base.FormatHttpResponse(soapResponse); + } + + /// + /// Gets a list of fields to be masked in xml logs. + /// + /// The list of fields to be masked. + protected override string[] GetFieldsToMask() { + return new string[] {"Password"}; + } + } +} diff --git a/src/Dfa/Lib/DfaUser.cs b/src/Dfa/Lib/DfaUser.cs new file mode 100644 index 00000000000..9087f74d85c --- /dev/null +++ b/src/Dfa/Lib/DfaUser.cs @@ -0,0 +1,66 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Net; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Web.Services; +using System.Web.Services.Protocols; + +namespace Google.Api.Ads.Dfa.Lib { + /// + /// Represents a DFA API user. + /// + public partial class DfaUser : AdsUser { + /// + /// Public constructor. Use this version if you want the library to + /// use all settings from App.config. + /// + public DfaUser() : base(new DfaAppConfig()) { + } + + /// + /// Parameterized constructor. Use this version if you want to construct + /// a DfaUser with a custom set of headers. + /// + /// The custom set of headers. + public DfaUser(Dictionary headers) : base(new DfaAppConfig(), headers) { + } + + /// + /// Gets all the service types to be registered against this user. + /// + /// The type of all service classes to be registered. + public override Type[] GetServiceTypes() { + return new DfaService().GetServiceTypes(); + } + + /// + /// Gets the default listeners. + /// + /// A list of default listeners + public override SoapListener[] GetDefaultListeners() { + // Order is important, WseSecurityListener should get the first shot, so + // DfaTraceListener writes log with header. + return new SoapListener[] {SoapHeaderListener.Instance, DfaTraceListener.Instance}; + } + } +} diff --git a/src/Dfa/Lib/LoginTokenCache.cs b/src/Dfa/Lib/LoginTokenCache.cs new file mode 100644 index 00000000000..ed4661f859c --- /dev/null +++ b/src/Dfa/Lib/LoginTokenCache.cs @@ -0,0 +1,53 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfa.Lib { + /// + /// Defines a cache for storing tokens from LoginService. + /// + public interface LoginTokenCache { + /// + /// Adds a login token to cache. + /// + /// The DFA user name. + /// The login token. + /// The login token. + UserToken AddToken(string username, UserToken token); + + /// + /// Gets a login token from cache. + /// + /// The DFA user name. + /// The login token, or null if the cache doesn't have a token. + /// + UserToken GetToken(string username); + + /// + /// Invalidates a login token. + /// + /// The login token. + void InvalidateToken(UserToken token); + + /// + /// Clears the cache. + /// + void Clear(); + } +} diff --git a/src/Dfa/Lib/RequestHeader.cs b/src/Dfa/Lib/RequestHeader.cs new file mode 100644 index 00000000000..30d03b97e26 --- /dev/null +++ b/src/Dfa/Lib/RequestHeader.cs @@ -0,0 +1,60 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfa.Lib { + /// + /// This class represents an optional Request Soap Header be used with + /// DFA services. + /// + public class RequestHeader { + /// + /// The application name. + /// + string applicationName = ""; + + /// + /// The target namespace to which this object is serialized. + /// + string targetNamespace; + + /// + /// Gets or sets the target namespace. + /// + public string TargetNamespace { + get { + return targetNamespace; + } set { + targetNamespace = value; + } + } + + /// + /// Gets or sets the applicationName. + /// + public string ApplicationName { + get { + return applicationName; + } + set { + applicationName = value; + } + } + } +} diff --git a/src/Dfa/Lib/ResponseHeader.cs b/src/Dfa/Lib/ResponseHeader.cs new file mode 100644 index 00000000000..0faac48225f --- /dev/null +++ b/src/Dfa/Lib/ResponseHeader.cs @@ -0,0 +1,58 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfa.Lib { + /// + /// This class represents the Response Soap Header from the DFA server. + /// + public class ResponseHeader { + /// + /// The request id. + /// + string requestId = ""; + + /// + /// The response time. + /// + long responseTime; + + /// + /// Gets or sets the request id. + /// + public string RequestId { + get { + return requestId; + } set { + requestId = value; + } + } + + /// + /// Gets or sets the response time. + /// + public long ResponseTime { + get { + return responseTime; + } set { + responseTime = value; + } + } + } +} diff --git a/src/Dfa/Lib/SoapHeaderListener.cs b/src/Dfa/Lib/SoapHeaderListener.cs new file mode 100644 index 00000000000..986e20e6c1f --- /dev/null +++ b/src/Dfa/Lib/SoapHeaderListener.cs @@ -0,0 +1,223 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Dfa.Lib; + +using System; +using System.Collections.Generic; +using System.Text; +using System.Xml; + +namespace Google.Api.Ads.Dfa.Lib { + /// + /// This listener adds or retrieves necessary Soap Headers to or from the + /// Soap messages. + /// + public class SoapHeaderListener : SoapListener { + /// + /// The config class to be used with this class. + /// + private AppConfig config; + + /// + /// Gets the config class to be used with this class. + /// + public AppConfig Config { + get { + return config; + } + } + /// + /// The singleton instance. + /// + protected static SoapHeaderListener instance = new SoapHeaderListener(); + + /// + /// The soap namespace prefix. + /// + private const string SOAP_PREFIX = "soap"; + + /// + /// The soap namespace url. + /// + private const string SOAP_NAMESPACE = "http://schemas.xmlsoap.org/soap/envelope/"; + + /// + /// The wsse namespace prefix. + /// + private const string WSSE_PREFIX = "wsse"; + + /// + /// The wsse namespace url. + /// + private const string WSSE_NAMESPACE = + "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"; + + /// + /// Protected constructor. + /// + protected SoapHeaderListener() { + this.config = new DfaAppConfig(); + } + + /// + /// Gets the singleton instance. + /// + public static SoapListener Instance { + get { + return instance; + } + } + + /// + /// Gets the soap header node. + /// + /// The soap message. + /// The xml nametable. + /// True, if the header node should be created + /// if missing. + /// The soap header node. + XmlElement GetSoapHeaderNode(XmlDocument soapMessage, XmlNamespaceManager xmlnt, + bool createIfMissing) { + string headerXpath = string.Format("{0}:Envelope/{0}:Header", SOAP_PREFIX); + string bodyXpath = string.Format("{0}:Envelope/{0}:Body", SOAP_PREFIX); + XmlElement soapHeader = (XmlElement) soapMessage.SelectSingleNode(headerXpath, xmlnt); + if (soapHeader == null && createIfMissing) { + soapHeader = soapMessage.CreateElement(SOAP_PREFIX, "Header", SOAP_NAMESPACE); + XmlElement soapBody = (XmlElement) soapMessage.SelectSingleNode(bodyXpath, xmlnt); + if (soapBody != null) { + soapMessage.DocumentElement.InsertBefore(soapHeader, soapBody); + } + } + return soapHeader; + } + + /// + /// Adds the security header. + /// + /// The SOAP header. + /// The user token. + private void AddSecurityHeader(XmlElement soapHeader, UserToken token) { + string securityXml = string.Join("\n", new string[] { + "<" + WSSE_PREFIX + ":Security xmlns:" + SOAP_PREFIX + "='" + SOAP_NAMESPACE + "'", + "xmlns:" + WSSE_PREFIX + "='" + WSSE_NAMESPACE + "'", + SOAP_PREFIX + ":mustUnderstand='1'>", + "<" + WSSE_PREFIX + ":UsernameToken>", + "<" + WSSE_PREFIX + ":Username>" + token.Username + "", + "<" + WSSE_PREFIX + ":Password>" + token.Password + "", + "", + ""}); + XmlDocumentFragment securityHeader = soapHeader.OwnerDocument.CreateDocumentFragment(); + securityHeader.InnerXml = securityXml; + soapHeader.AppendChild(securityHeader); + } + + /// + /// Adds the request header. + /// + /// The SOAP header. + /// The request header. + private void AddRequestHeader(XmlElement soapHeader, RequestHeader requestHeader) { + const string TNS_PREFIX = "tns"; + string TNS_NAMESPACE = requestHeader.TargetNamespace; + + string requestHeaderXml = string.Join("\n", new string[] { + "<" + TNS_PREFIX + ":RequestHeader xmlns:" + TNS_PREFIX + "='" + TNS_NAMESPACE + "'>", + "<" + TNS_PREFIX + ":applicationName>" + requestHeader.ApplicationName + "", + "" + }); + XmlDocumentFragment requestHeaderNode = soapHeader.OwnerDocument.CreateDocumentFragment(); + requestHeaderNode.InnerXml = requestHeaderXml; + soapHeader.AppendChild(requestHeaderNode); + } + + /// + /// Parses the response header. + /// + /// The SOAP message. + /// The xml name table. + /// The response header. + private ResponseHeader ParseResponseHeader(XmlDocument soapMessage, XmlNamespaceManager xmlnt) { + ResponseHeader responseHeader = null; + XmlElement soapHeader = GetSoapHeaderNode(soapMessage, xmlnt, false); + if (soapHeader != null) { + responseHeader = new ResponseHeader(); + XmlNodeList childNodes = soapHeader.SelectNodes("child::*"); + foreach (XmlElement childNode in childNodes) { + if (childNode.LocalName == "ResponseHeader") { + XmlNodeList grandChildNodes = childNode.SelectNodes("child::*"); + foreach (XmlElement grandChildNode in grandChildNodes) { + switch (grandChildNode.LocalName) { + case "requestId": + responseHeader.RequestId = grandChildNode.InnerText; + break; + + case "responseTime": + responseHeader.ResponseTime = long.Parse(grandChildNode.InnerText); + break; + } + } + + } + } + } + return responseHeader; + } + + /// + /// Initializes the listener for handling an API call. + /// + public void InitForCall() { + } + + /// + /// Handles the message. + /// + /// The SOAP message. + /// The service. + /// The direction. + public void HandleMessage(XmlDocument soapMessage, AdsClient service, + SoapMessageDirection direction) { + XmlNamespaceManager xmlnt = new XmlNamespaceManager(soapMessage.NameTable); + xmlnt.AddNamespace(SOAP_PREFIX, SOAP_NAMESPACE); + if (direction == SoapMessageDirection.OUT) { + UserToken token = (UserToken) ContextStore.GetValue("Token"); + RequestHeader requestHeader = (RequestHeader) ContextStore.GetValue("RequestHeader"); + + if (token != null || requestHeader != null) { + XmlElement soapHeader = GetSoapHeaderNode(soapMessage, xmlnt, true); + + if (token != null) { + AddSecurityHeader(soapHeader, token); + } + if (requestHeader != null) { + AddRequestHeader(soapHeader, requestHeader); + } + } + } else { + ContextStore.AddKey("ResponseHeader", ParseResponseHeader(soapMessage, xmlnt)); + } + } + + /// + /// Cleans up any resources after an API call. + /// + public void CleanupAfterCall() { + } + } +} diff --git a/src/Dfa/Lib/UserToken.cs b/src/Dfa/Lib/UserToken.cs new file mode 100644 index 00000000000..de31226eef4 --- /dev/null +++ b/src/Dfa/Lib/UserToken.cs @@ -0,0 +1,74 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfa.Lib { + /// + /// This class represents a WSE security token to be used with DFA services. + /// + public class UserToken { + /// + /// The username obtained from LoginService. + /// + string username; + + /// + /// The password token obtained from LoginService. + /// + string password; + + /// + /// Gets or sets the username. + /// + public string Username { + get { + return username; + } set { + username = value; + } + } + + /// + /// Gets or sets the password. + /// + public string Password { + get { + return password; + } set { + password = value; + } + } + + /// + /// Default public constructor. + /// + public UserToken() : this("", "") { + } + + /// + /// Parameterized constructor. + /// + /// The username. + /// The password. + public UserToken(string username, string password) { + this.username = username; + this.password = password; + } + } +} diff --git a/src/Dfa/Properties/AssemblyInfo.cs b/src/Dfa/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..9b3b35aca7c --- /dev/null +++ b/src/Dfa/Properties/AssemblyInfo.cs @@ -0,0 +1,37 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("DoubleClick for Advertisers API DotNet Client Library")] +[assembly: AssemblyDescription( + "This library provides you with functionality to access DoubleClick for Advertisers API.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("49165cbb-dc0f-45c7-bf03-5fed0669ff46")] diff --git a/src/Dfa/Properties/Properties.cs b/src/Dfa/Properties/Properties.cs new file mode 100644 index 00000000000..e227e002fbb --- /dev/null +++ b/src/Dfa/Properties/Properties.cs @@ -0,0 +1,24 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; + +[assembly: AssemblyCompany("Google")] +[assembly: AssemblyProduct("DoubleClick for Advertisers API DotNet Client Library")] +[assembly: AssemblyCopyright("Copyright 2011, Google Inc. All Rights Reserved.")] + +[assembly: AssemblyVersion("18.0.0.0")] +[assembly: AssemblyFileVersion("18.0.0.0")] diff --git a/src/Dfa/Resources/ErrorCodes.csv b/src/Dfa/Resources/ErrorCodes.csv new file mode 100644 index 00000000000..1836c0bbd29 --- /dev/null +++ b/src/Dfa/Resources/ErrorCodes.csv @@ -0,0 +1,1896 @@ +code,description +1,Internal error. +2,Invalid Parameter +3,Item doesn't exist. +4,Invalid username or password. +5,You are not authorized to perform this operation. +6,This functionality has not yet been implemented. +7,Your password has expired. +10,Error when using invoke method. +13,Invalid fields. +14,File already exists. +15,Error encountered while saving the file. +16,Error encountered while reading from the input stream. +17,Error encountered while sending email. +18,The mail server name is not configured correctly. +19,Please specify a valid profile name to impersonate. +20,Please specify a valid network to impersonate. +21,The given profile name is not valid. +22,No user with this profile name can be found. +23,The GAIA ID is not associated with the given user. +24,The given GAIA ID is not valid. +25,GAIA ID could not be authenticated. +26,Error encountered while writing to zip output stream. +27,Your current password is no longer valid. +28,Enter a new password in both the Password and Confirm Password fields. +29,The new password and confirm password do not match. Try again. +30,Passwords must contain numbers and letters. +31,This is your current password. Please enter a new password. +32,Passwords cannot be a subset of your profile name. Enter a different password. +33,No email address found for this user name. +34,The user profile is inactive. +35,A user profile with this name already exists. +36,The language you set for this user profile was not recognized. Please check the ID and try again. +37,The language encoding you set for this user profile was not recognized. Please check the ID and try again. +38,The filter type you set for this user profile was not recognized. Please check the ID and try again. +39,One of the objects you set for filtering was not recognized. Please check the IDs and try again. +40,"User comments cannot exceed 4,000 characters." +41,Invalid Trafficker Type. +42,Invalid Email Subject. +43,Invalid Email Message. +44,User profile ID must be greater than 0. +45,This user profile is not linked to a Google Account. +46,This user profile is already linked to Google Account. +5000,Size cannot be found. +5001,Size ID is not valid. It must be greater than 0. +5002,The width of this ad is a negative number. Please fix it and try again. +5003,The height of this ad is a negative number. Please fix it and try again. +5004,Network cannot be found. +5005,Country cannot be found. +5006,Region cannot be found. +5007,Placement cannot be found. +5008,Designated Market Area cannot be found. +5009,City cannot be found. +5010,Contact type is invalid. +5011,The ZIP code format is invalid. +5012,Invalid syntax. +5013,Keyword targeting can't contain just one negated term. +5014,# must in front of a word or a phrase +5015,A maximum of 8 words are allowed as the value in a key-value. +5016,An exact match can only be for one word. +5017,No key value is defined after kw= +5018,No key is defined before = +5019,dom is a reserved key. It cannot be used. +5020,An ad cannot target more than 255 keywords. +5021,# cannot be used alone as key-value targeting. +5022,Illegal usage of '?' +5023,Ad is targeting an invalid tile slot. To target a tile slot please enter a key-value pair tile=value where the value is a number from 1 to 16. +5024,sz is a reserved key. It cannot be used. +5025,Duplicate key-value +5026,Negation (!) and exact match (#) cannot be applied to the same term. +5027,Domain name and keyword cannot be targeted with each other. +5028,Creative Dimension doesn't exist +5029,The major version is invalid. It is required and must be a number. +5030,The minor version is invalid. +5031,Subaccount can't be found. +5033,The file name is limited to alphanumeric characters and these symbols: . = - _ +5107,Invalid advertiser status. +6000,Creative data is invalid. +6001,Creative file asset is empty. +6002,Creative file asset is invalid. +6003,Could not save file asset. +6004,A valid advertiser ID must be specified for the creative search criteria +6005,The creative is of the wrong creative type. +6006,Invalid URL for creative asset. +6007,A name must be specified for a creative. +6008,A creative name must be 255 characters or less. +6009,An advertiser must be specified for the creative. +6010,The filename for an image creative cannot be empty. +6011,The file for an image creative cannot be empty. +6012,The click-through URL for the creative is invalid. +6013,The redirect URL for the creative is invalid. +6014,This network does not have permission to serve redirect or internal redirect creatives. +6015,The filename for the asset file cannot be empty +6016,HTML code must be specified for rich media redirect creatives. +6017,Rich media creative asset files must have a filename. +6018,Rich media creatives must have asset files. +6019,HTML code must be specified for rich media creatives. +6020,You cannot overwrite an existing asset file for the rich media creative. +6021,All creative asset filenames must be unique. +6022,The dimensions of the uploaded creative are not supported by the network. +6023,Creative dimensions must be specified. +6024,The image URL for the internal redirect creative is invalid. The URL must refer to a DoubleClick URL. +6025,The Click-Through URL for the internal redirect creative is invalid. The URL must refer to a DoubleClick URL. +6026,Creative cannot be found. +6027,The advertiser specified for the creative is not valid. +6028,The dimensions specified for the creative are not valid. +6029,The type specified for the creative is not valid. +6030,The sub-type specified for the creative is not valid. +6031,Error reading creative asset file. +6032,Missing size for creative. +6033,Missing creative. +6500,A creative dimension cannot be found. +6501,You must specify a valid creative dimension banning for creative. +6502,You must specify a valid creative dimension banning level for creative. +6503,You can only assign a single creative dimension banning level to creative for the dimension. +6504,You must specify a creative dimension banning level for creative. +7000,Size required. +7001,Start date must precede the end date. +7003,Start date invalid. +7004,End date required. +7005,End date invalid. +7006,Profile name must be between 1 and 64 characters. +7007,Password must be between 1 and 32 characters +7008,A user profile with this name cannot be found. +7009,Profile name must be between 1 and 64 characters and must start with a letter. +7010,User password must be between 8 and 32 characters. It must contain at least one numeric character and cannot contain whitespace. +7011,Invalid attribute group for application attribute setting. +7012,A remarketing client type setting is required for remarketing-enabled customers. +7013,The remarketing client type setting is invalid. +7014,A default data center is required for remarketing-enabled customers. +7015,Default data center attribute setting invalid. +8000,Invalid day of week. +8001,Invalid hour of week. +8002,Invalid bandwidth. +8003,Network required. +8004,Network invalid. +8005,You need to specify a user role. +8006,User role invalid. +8007,Language required +8008,Language invalid +8009,Language Encoding required +8010,Language Encoding invalid +8011,Invalid city. +8012,Invalid designated market area. +8013,Country required. +8014,Invalid country. +8015,Invalid area code. +8016,Invalid state. +8017,Currency required. +8018,Invalid currency. +8100,The maximum length of advertiser name is 64 characters. +8300,"The Activity Group Tag String can contain only letters, numbers, hyphens (-) and underscores (_)." +8301,"The Activity Group Name doesn't look right. Make sure it's not blank and doesn't contain quotes (' or "")." +8302,First report header is invalid. +8303,Second report header is invalid. +8304,That Activity Group Name or Tag String already exists. +8305,The Activity Group Name cannot exceed 64 characters. +8306,The Activity Group Tag String cannot exceed eight characters. +8307,Activity group name cannot be modified. +8308,Activity group not found. +8309,Invalid description length. +8310,"The Activity Name doesn't look right. Make sure it's not blank, doesn't contain quotes (' or ""), and is no more than 64 characters." +8311,"Invalid activity tag string (cat). The activity tag string can contain only alphanumeric characters, dashes, and underscores." +8312,Activity not found. +8313,Activity name cannot be modified. +8314,That Activity Name already exists. +8315,Minimum Impressions must be a positive number. +8316,Invalid tag method. +8317,Enter a valid Expected URL +8318,Invalid random code type. +8319,Invalid country code. +8320,Spotlight configuration cannot be deleted. +8321,Invalid site specified for Floodlight. +8322,Duplicate Floodlight tag. +8323,Invalid floodlight tag value +8324,Cannot assign site to default Floodlight tag. +8325,Invalid first day of week. +8326,Invalid time slot. +8327,The Lookback Window you entered for Clicks exceeds the limit for your network. Please choose a smaller value. +8328,The Lookback Window you entered for Impressions exceeds the limit for your network. Please choose a smaller value. +8329,Invalid custom variable. +8330,Invalid Custom Spotlight Variable type. +8331,Invalid report name length +8332,This custom variable cannot be deleted because it is assigned to a Spotlight activity. +8333,That Custom Spotlight Variable Name (Friendly Name) already exists. Try a different name. +8334,Invalid standard variable. +8335,Invalid standard variable report name. +8336,Invalid spotlight configuration +8337,Could not find spotlight configuration. +8338,Invalid data sampling rate for UBR configuration. +8339,You need to choose an Activity Group before you save. +8340,A country code must be specified for a spotlight activity. +8341,A tag code type must be specified for a spotlight activity. +8342,No reporting configuration found for the given spotlight. +8343,Invalid spotlight activity group. +8344,Invalid country specified. +8345,Invalid tag format. +8346,"Custom Spotlight Variable Names (Friendly Names) cannot contain double quotes ("") or angle brackets (< and >)." +8347,Account permission not enabled for user-defined Spotlight variables. +8348,Network permission not enabled for standard variables. +8349,Invalid advertiser. +8350,Invalid activity type. +8351,Invalid activity. +8352,This activity didn't receive the minimum number of impressions. +8353,Report assigned is not enabled for network. +8354,Invalid value for DoubleClick Rich Media events lookback window. +8355,Total number of characters for all default Floodlight tags should not exceed 4000. +8356,Number of characters for Floodlight tag should not exceed 4000. +8357,Invalid natural search conversion attribution option for ubr configuration. +8358,Natural search conversion change date cannot be null. +8359,Activity group type cannot be modified. +9000,Invalid search criteria for remarketing list. +9001,Invalid remarketing list expression. +9400,Placement Name must be 1-255 characters long. +9401,Start date must precede the end date. +9402,Start date required. +9403,The maximum length of a Click-Through URL is 1024 characters. +9404,The maximum length of alternate text is 1024 characters. +9406,The frequency value of the frequency cap is invalid. +9407,The frequency period value of the frequency cap is invalid. +10000,The landing page name cannot be empty. +10001,Landing page URL should be 1 - 1024 character long. +10002,Invalid landing page. +11000,Invalid Creative Template Data. +11001,Invalid Creative Template ID. +11002,Creative Template not found. +11003,File extension is invalid. +11004,Required placeholder is missing. +11005,Numeric placeholder has non numeric value. +11006,List placeholder has invalid value. +11007,Invalid placeholders. +12000,Permission not found in network. +12001,User role not found. +12002,Default user roles can't be created or modified. +12003,A user role can't be created without a source user role. +12004,The user role's account is invalid. +12005,The user profile's account is different from the user role's account. +12006,User role names must contain between 1 and 255 characters. +12007,A user role with this name already exists. +12008,Default user roles can't be deleted. +12009,The user role can't be deleted because it's assigned to user profiles. +12010,The source user role can't be changed. +13000,The Creative Field Value is not found. +13001,Creative Field name must be 1-32 characters long. +13002,Creative Field can have a maximum of 768 creative field values. +13003,The Creative Field Value name must be 1-32 characters long. +13004,Invalid Creative Field. +13005,The Creative Field name already exists. +13006,The creative field Advertiser Specified doesn't exist. +13007,Invalid Creative Field Value. +13008,Creative Field was not specified for the Creative Field Value. +13009,Creative Field was not found for the Creative Field Value. +13010,Creative Field Value name already exists. +13011,An advertiser can a have maximum of 12 creative fields. +13012,Creative Field doesn't exist. +14000,Network name cannot be empty. +14001,Network name cannot exceed 128 characters. +14002,Network with this name already exists. +14003,Network abbreviation cannot be empty. +14004,Account with this abbreviation already exists. +14005,Invalid maximum image size. +14006,Invalid default size. +14007,Invalid number of activities for exposure-to-conversion. +14008,Invalid number of exposure level for exposure-to-conversion. +14009,Exposure level cannot be less than existing value. +14010,Invalid currency. +14011,Invalid language. +14012,Invalid language encoding. +14013,Invalid report generation time zone. +14014,Permission not found. +14015,This user profile has no access to this account. +14016,Network abbreviation cannot exceed 8 characters. +14017,Invalid network permission. +14018,There was a problem with the billing code. Please check the code and try again. +14019,There was a problem with the customer ID. Please check the ID and try again. +14020,This customer account is not active. +14021,This customer billing account has expired. +14022,We couldn't find a customer that matched the billing code and customer ID you entered. Please check the values and try again. +14023,Invalid Account Widget Image Upload request. +14024,"There was a problem with the image you tried to upload. Please upload an image file with the extension .jpg, .gif, or .jpeg" +14025,The image file size exceeds the maximum. Please try a smaller file. +14026,Invalid image data. +14027,Oops! We were unable to save the image file. Please try again. +14028,Please enter the customer ID and billing code to enable the Rich Media permission. +14029,"To enable Flash-in-Flash creatives, please upload a Widget backup image." +14030,"You don't have permission to make associations between a customer account and a publisher. For more information, contact your database administrator." +15000,place holder +51002,Invalid email address. +51003,Advertiser name cannot be null or empty. +51004,Advertiser cannot be deleted because it has orders associated with it. +51005,Advertiser cannot be deleted because it has Spotlight configurations shared with another advertiser. +51006,Invalid network has been specified for the advertiser. +51046,Advanced report is not enabled at network +51047,Cannot change advertiser group. +51048,Country name may not exceed 32 characters. +51049,Telephone may not exceed 32 characters. +51050,Fax may not exceed 32 characters. +51051,Contact person name may not exceed 32 characters. +51052,Website URL may not exceed 96 characters. +51053,Billing address1 may not exceed 64 characters. +51054,Billing address2 may not exceed 64 characters. +51055,Billing city name may not exceed 64 characters. +51056,Billing state name may not exceed 32 characters. +51057,Billing postal code may not exceed 10 characters. +51058,Billing country name may not exceed 32 characters. +51059,Terms description may not exceed 100 characters. +51060,Production and trafficking description may not exceed 255 characters. +51061,Email may not exceed 64 characters. +51062,Address1 may not exceed 64 characters. +51063,Address2 may not exceed 64 characters. +51064,City name may not exceed 32 characters. +51065,State name may not exceed 100 characters. +51066,Postal code may not exceed 12 characters. +51067,Invalid telephone. +51068,The advertiser could not be found. +51070,Advanced Reports cannot be unassigned because they are enabled at the network level. +51071,This advertiser cannot be accessed. The advertiser ID has not been assigned in the advertiser filter. +51072,No permission to view advertisers +51073,Advertiser doesn't belong to the user subnetwork +53000,Object is already included in the User Watch List +53001,Ad does not Exist +54000,Advertiser not found. +54001,The creative asset base directory is not specified. +54002,"DFP can't connect to the server that's storing the creative assets. Close the creative trafficking window and try again. If this problem persists, please contact support." +54003,The image creative asset base directory cannot be found. +54004,The Rich Media creative asset base directory cannot be found. +54005,The creative asset directory for the advertiser cannot be found. +54006,Error encountered while browsing the creative asset directory. +54007,The creative asset file could not be read. +54008,The creative asset supplied cannot be null. +54009,The name specified for the creative asset is not valid. +54010,The content specified for the creative asset is not valid. +54011,The creative asset is not of a valid image type. +54012,Another creative asset with the same name already exists. +54013,The advertiser specified in the creative asset is not valid. +54014,You cannot upload this asset because the dimensions of the asset do not match the dimensions allowed in your network. Please select another asset. +54015,The creative asset's dimensions are not supported by the network. +54016,DART does not support this image type. +54017,You cannot upload executable files. +54018,The creative asset exceeds the maximum image size allowed for the network. +54019,You forgot to enter search criteria. +54020,You must enter an advertiser to search for a creative. +54021,The relative image asset URL is not valid. It is required and must refer a valid image asset for the advertiser. +54022,The image asset referred to by the relative URL could not be found. +54023,Alternate Text cannot exceed 1024 characters. +54024,The creative version is not valid. +54025,The custom code for the creative is missing. +54026,The length of the custom code exceeds the maximum allowed limit. +54027,"The creative code must contain the %i macro, which enables the DART ad servers to record when the interstitial impression displays." +54028,The relative asset URL in the creative cannot be null or empty. +54029,One of the assets specified in the creative could not be found. +54030,The redirect URL is not valid. It is required and cannot exceed 1024 characters. +54031,The redirect URL is not valid. It must start with http:// or https:// +54032,You cannot delete this creative because it is assigned to a default ad. Default ads must have at least one creative. +54033,The creative cannot be deleted because one or more assignments have a creative time gap. +54034,The creative cannot be deleted because it is assigned to an ad that is active. +54035,One of the campaigns associated with the creative is not valid. +54036,The given creative IDs array to associate with the campaign cannot be null or empty. +54037,The creative type is not valid. +54038,An error was encountered while parsing the file. +54039,The raw file data is empty. +54040,The raw file name is not valid. +54041,The raw file mime-type is not valid. +54042,The mime-type for the raw file is not supported for creative upload. +54043,The zip file entry cannot be recognized as an image or a Rich Media file. +54044,The raw file set is null. +54045,The advertiser specified in the raw file set is not valid. +54046,The campaign specified in the raw file set is not valid. +54047,Either the advertiser or the campaign must be specified in the raw file set +54048,The raw file set does not contain any raw files. +54049,The parsed raw file set is null. +54050,The parsed raw file set does not contain any parsed raw files. +54051,Unable to read the Flash file. +54052,The Flash file is empty. Check your file or select another one and try again. +54053,The Flash-Banner custom code template could not be found. +54054,The creative can contain only one back-up image. +54055,The creative can contain only one Flash asset. +54056,The creative is missing the back-up image. +54057,The creative is missing the Flash asset. +54058,The creative does not contain any assets. It must contain one Flash asset and one back-up image asset. +54059,The Flash-Banner with AdInisght Flex Tag custom code template could not be found. +54060,This is a default creative hence +54062,Please specify a default landing page for the campaign before uploading creatives. +54063,"This file type isn't supported, or the file doesn't matched the specified file type. Only image files are supported." +54064,The dimensions of the creative can't be changed because it is marked as default in one of the campaigns. +54065,You cannot change the dimensions of the creative because it is assigned to one or more ads. +54066,The dimensions of the creative can't be changed because it is assigned to one or more rotation groups. +54067,The creative you are trying to delete is not a Motif creative. +54068,The Interstitial Pop-Up template can't be found. +54069,The Interstitial Pop-Up type is not valid. +54070,The window width is not valid. Please specify a width greater than zero. +54071,The window height is not valid. Please specify a height greater than zero. +54072,The 'top' value is not valid. Please specify a value greater than or equal to zero. +54073,The 'left' value is not valid. Please specify a value greater than or equal to zero. +54074,The creative type is not valid. +54075,You do not have permission to view creatives. +54076,You do not have permission to archive creatives. +54077,You do not have permission to delete creatives. +54078,You do not have permission to change a creative's status. +54079,You do not have permission to create creatives. +54080,The maturity level you specified for the creative is not valid. +54081,You must specify a maturity level for the creative. +54082,The art type you selected for the creative is not valid. +54083,You must specify an art type for the creative. +54084,Invalid Flash file. Check the file and try uploading it again. +54085,Invalid file extension. Check the file and try uploading it again. +54086,You do not have permission to create or update creative assignments. +54087,The assignment's start date cannot be before the ad's start date. +54088,The assignment's start date cannot be after the ad's end date. +54089,The assignment dates are not valid. +54090,The assignment's end date cannot be before the ad's start date. +54091,The assignment's end date cannot be after the ad's end date. +54092,Unassigning this creative will leave one of the ads with no active creative. +54093,The creative type is not valid for the ad type. +54094,The Flash file contains hardcoded URLs. +54095,We encountered an error while parsing the Flash file. Check the file and try uploading it again. +54096,The dimensions of the creative do not match the dimensions of the ad. +54097,Interstitial DoubleClick Tag and Interstitial Custom/Interstitial Motif creatives cannot be assigned to Interstitial Ads. +54098,Creative code cannot contain the word %1$2s +54099,Ad should contain at least one active creative assignment. +54100,Creative template name cannot be null and can contain max 64 characters. +54101,Creative template description can contain max 255 characters +54102,Creative template name must be unique +54103,Creative template type not valid. Must be either DFA or DFP or Standard or Custom or local +54104,Placeholder name cannot be empty +54105,Not allowed to create standard and custom templates +54106,You do not have permission to create templates +54107,You do not have permission to edit templates +54108,Assignments cannot be submitted because one or more assignments have a creative time gap. +56000,User does not have access to network. +56001,Object doesn't belong to user subnetwork +56002,User doesn't exist in DART. +56003,User not enabled for SNS. +56004,You don't have permission to view this ad +57000,The advertiser could not be found +60000,Ad Tool Kit version should be 1.01 or greater. +60001,Error merging conduit. +60002,Error merging conduit for Interactivity time +60003,Error while reading or writing Rich Media asset on Pusher. +60004,"Invalid input template, required asset was not found" +60005,"Placeholder not found in input.xml, placeholder =" +60006,Error getting System Advertiser ID +60007,Error in Merging DOM +60008,Invalid Rich Media package. Valid files use the extension .mtf. +60009,Input template is missing. +60010,Missing asset. +60011,Invalid Template. +60012,Invalid Rich Media file +60013,Ad tool kit version for Rich Media Flash in Flash creative should be 2.0 or greater. +60014,Maximum file upload limit exceeds. +60015,Maximum Parent Asset file or Alternate Image file upload limit exceeds. +60016,"You can only upload Floating, Pop-up and Floating with Reminder files to Rich Media Interstitial creatives." +60017,"Only upload Floating, Pop-up and Floating with Reminder files can be uploaded to Rich Media Interstitial creatives." +60018,"Only upload Floating, Pop-up and Floating with Reminder Rich Media creatives to Interstitial ads." +60019,"Only upload Floating, Pop-up and Floating with Reminder Rich Media creatives to Interstitial ads." +60020,"You cannot upload a Floating, Pop-up or Floating With Reminder file in Rich Media creatives." +60021,"Cannot upload a Floating, Pop-up or Floating With Reminder Rich Media creative in regular ads. They should be booked as interstitial." +60022,"You can only upload a Floating, Pop-up or Floating With Reminder file in Rich Media creatives." +60023,"Cannot upload a Floating, Pop-up or Floating With Reminder Rich Media creative in regular ads. They should be booked as interstitial." +60024,"This MTF is not supported for Rich Media for Flash-in-Flash. Only In-Page, Expanding, or Floating creative types may be uploaded into Rich Media for Flash-in-Flash creatives." +60025,The type of creative uploaded is not compatible with this ad. +60026,The parent asset cannot be greater than 300 KB +60027,The alternate image cannot be greater than 300 KB +60028,All or some of the parameters sent in the request are invalid. +60029,"You cannot load assets of types other than GIF, JPEG or JPG." +60030,Either the file name does not exist or it is not a valid type than can be uploaded. +60031,The image file is not valid or an error occurred while uploading the file. Try again. +60032,Progressive URL protocol must start with http:// or https://. +60033,Replaced child extension needs to be same as the original. +60034,"A file with the same name has already been uploaded, please select a different file." +60035,New filename must not be a duplicate of an existing child file. +60036,The asset may not be deleted because it is referenced in a component. +60037,Creative Package cannot be null. +60038,Advertiser ID is missing in the Rich Media Creative Package. +60039,MTF package with zero size cannot be uploaded. +60040,MTF package having files of zero size cannot be uploaded. +60041,MTF file is empty and cannot be uploaded. +60042,Either the video file you are trying to upload does not exist or its size is set to zero. +60043,Either the alternate image file you are trying to upload does not exist or its size is set to zero. +60044,This MTF file cannot be uploaded as the Flash-in-Flash creative type does not support Full Screen Video. +60045,Advertiser ID is missing in the Studio creative package. +60046,No studio creative package passed in upload request. +60047,Invalid studio creative details passed in package upload request. +60048,Invalid studio creative package. +60049,Filename for asset in the creative is invalid. +60050,Error in populating child files. Motif Creative Properties is out of synch. +60051,Error in populating video components. Motif Creative Properties is out of synch. +60052,Error populating Motif Expanding components. Motif Creative Properties is out of synch. +60053,Error populating events information. Motif Creative properties is out of synch. +60054,Flash version for Studio Flash in Flash creative should be 7 or greater. +60055,This Studio package can not be uploaded as the Flash-in-Flash creative type does not support full screen video feature. +60056,Please upload an FLV file. Other file types are not supported. +60057,"The file name of the asset needs a file extension. For example, in the name file.gif, .gif is the extension." +60058,The creative doesn't contain the assets that you're trying to delete. Please check the asset file names and try again. +60059,The parent Flash asset does not exist. +60060,"This operation is only allowed for MTF-based creatives, and not for the ones created in Studio." +60503,Invalid input template file. +60504,Rich Media properties are missing in template. +60505,Placement size is invalid. +60506,Exceeds maximum length for comments. +60507,Rich Media file cannot have more than two Flash assets. +60508,WMode value for Flash asset is invalid. +60509,An .mtf file cannot have more than 30 events. +60510,Background color for Flash asset is invalid. +60511,Value of position for Flash asset is missing. +60512,Value of position for Flash asset is invalid. +60513,Z-index value for Flash asset is missing. +60514,Top value for Flash asset is missing. +60515,Left value for Flash asset is missing. +60516,Z-index value for Flash asset is invalid. +60517,"Top value must be from -1500 to 1500, inclusive." +60518,"Left value must be from -1500 to 1500, inclusive." +60519,Alternate image for Flash asset is missing. +60520,Exceeds max length for alternate text. +60521,Value of width for asset is invalid. +60522,Value of height for asset is invalid. +60523,Value of width for asset is missing. +60524,Value of height for asset is missing. +60525,Value of height for placement is invalid. +60526,Value of width for placement is invalid. +60527,Pop-under attribute for Flash asset is missing. +60528,Required element is missing from input template. +60529,Required asset is missing from input template. +60530,Invalid display start time. +60531,Invalid display duration. +60532,Event names cannot have spaces. +60533,Invalid value for total file size. +60534,Invalid value for plugin version. +60535,Exit event name missing +60536,Exit event ID missing +60537,Invalid exit event ID +60538,Exit event name length should not exceed 64 characters. +60539,Missing value for total file size. +60540,Missing value for plugin version. +60541,Image asset can have only one exit type event. +60542,Event names cannot be greater than 64 characters. +60543,Name is required. +60544,Event ID cannot be null. +60545,Click-through Landing Page URL is required. +60546,Invalid event ID +60547,Event URL cannot be greater than 1024 characters. +60548,Event description cannot be greater than 124 characters. +60549,Fixed-Flash must have an alternate image with one exit event. +60550,Target is required for Exit Links and Load Movies. +60551,The length of the Survey URL cannot exceed 254 characters. +60552,Survey URL must start with http:// or https://. +60553,The Expanded Width for Expanding Flash Asset is missing. +60554,The Expanded Width for Expanding Flash Asset is invalid. +60555,The Expanded Height for Expanding Flash Asset is missing. +60556,The Expanded Height for Expanding Flash Asset is invalid. +60557,Expanding-Flash must have an alternate image with one exit event. +60558,Left Offset for Expanding flash asset is missing. +60559,Invalid value of Left Offset for Expanding flash asset. +60560,Right Offset for Expanding flash asset is missing. +60561,Invalid value of Right Offset for Expanding flash asset. +60562,Top Offset for Expanding flash asset is missing. +60563,Invalid value of Top Offset for Expanding flash asset. +60564,Bottom Offset for Expanding flash asset is missing. +60565,Bottom offset value of Expanding Flash asset is invalid. +60566,The Window Feature Top for an Exit Event is invalid. +60567,The Window Feature Left for an Exit Event is invalid. +60568,The Window Feature Width for an Exit Event is invalid. +60569,The Window Feature Height for an Exit Event is invalid. +60570,Invalid syntax for keywords. +60571,The reserved keys cannot be used. +60572,The length of a Third-Party Click URL cannot exceed 1024 characters. +60573,The length of a Third-Party Impression URL cannot exceed 1024 characters. +60574,Third-Party Click URL must start with http:// or https://. +60575,Third-Party Imp URL must start with http:// or https://. +60576,Invalid syntax for metadata. +60577,The reserved keys cannot be used for metadata. +60578,Event information cannot contain non-English characters. +60579,You cannot use non-English characters in alternate text. +60580,Push-Down Animation time for Expanding Ad should be in the range of 0 to 9.99. +60581,The Push-Down feature is allowed only for Expanding Ads that expand downwards. +60582,The RichMedia creative can not have more than 100 events. +60583,Video Length cannot have alphanumeric or negative values. +60584,The length of a Third-Party Backup Image Impression URL cannot exceed 1024 characters. +60585,The length of a Third-Party Flash Display Impression URL cannot exceed 1024 characters. +60586,Third-Party Backup Image Impression URL must start with http:// or https://. +60587,Third-Party Flash Display Impression URL must start with http:// or https://. +60588,Primary and secondary connection types for video component must be different. +60589,At least one File Name is required for DART hosted video assets. +60590,At least one File Path or URL is required for Externally hosted video assets. +60591,Host Domain must start with 'rtmp://'. +60592,Selected DART Hosted video assets are missing. Please upload missing assets. +60593,Progressive URL must start with 'http://' or 'https://'. +60594,This MTF was published for Flash version 6 or below. Rich Media for Flash-in-Flash creative supports only MTF packages published for Flash version 7 and higher. +60595,Host domain is a required field if either of primary or secondary connection type is streaming. +60596,The MTF cannot be uploaded because this network does not have the Rich Media full screen video feature enabled. +60597,The Upload Request may not be null +60599,MediaServer macro name is not specified +60600,The Creative Features selection cannot be changed once the Creative is submitted. +60601,Creative version cannot be incremented if the previous version is not saved. +61000,Invalid Creative ID or Creative does not exist. +61001,Required value site URL is missing. +61002,Invalid site url. +61003,Cannot connect to the given site. +61004,Page is framed and cannot be previewed with the creative. +61005,The page you specified has no matching Rich Media or DART ad tags. You cannot preview the creative in this page. +61006,Rich Media unsaved creative preview request cannot be null. +61007,Rich Media creative properties object is a requried field for an un-saved Rich Media creative preview request. It cannot be empty. +61008,"Edited ad code missing in the request. If a creative is manually edited, the edited ad code should be passed in the request." +61009,Required parameter Width is missing from the un-saved Rich Media creative preview request. +61010,Required parameter Height is missing from the un-saved Rich Media creative preview request. +61011,Required Adveriser ID is missing in the Rich Media creative object sent in the preview request. +61012,The Rich Media Creative object is a required field for an unsaved Rich Media creative preview request. It cannot be null. +61013,A required parameter is missing for the creative ID in saved creative preview request. +61014,Rich Media saved creative preview request cannot be null. +61015,External preview is not available for Flash-in-Flash creatives. +61016,"External preview is only available for valid Rich Media creative types. Visit ""http://www.google.com/support/dfa/bin/answer.py?answer=146738"" for more information." +61500,Creative can't be assigned to Ad as the Creative and Ad belong to different Advertisers +61501,The creative cannot be assigned to the ad because the creative size does not match the Ad size. +61502,The creative is assigned to a default ad and cannot be deleted. Any default ad must have a creative. +61503,The creative cannot be deleted because it is assigned to an ad that is active. +61504,The creative version is not valid. +61505,The Creative being assigned to the ad is not a Rich Media Creative. +61506,Creative version cannot be incremented for a manually edited Rich Media creative. +61507,The .MTF file for a manually edited creative cannot be replaced. +61508,Child assets cannot be uploaded/replaced for a manually edited creative. +61509,Child assets cannot be removed for a manually edited creative. +61510,Please submit the creative in order to edit the HTML code. +61511,You do not have permission to enable manual edit for a Rich Media creative. +61512,Only Creative Name and Creative Dimensions can be changed for a manually edited Rich Media creative. +61513,Save any changes before enabling manual edit for a Rich Media creative. +61514,You do not have permission to unselect manual edit for a Rich Media creative. +61515,Version has been incremented. Please save this change first and then enable manual edit for the Rich Media Creative. +61516,HTML value cannot be null or empty for a Rich Media creative. +61517,HTML value exceeds the maximum size limit of 131064 bytes for a Rich Media creative. +61518,An Alternate Image cannot be replaced for a manually edited creative. +61519,You do not have permission to overridde CSS style sheet properties. +61520,Creative for one of the Creative Field Assignment is not valid. +61521,Creative Field for one of the Creative Fild Assignment is not valid. +61522,Creative Field of one of the Creative Field Assignment doesn't belong to same advertiser. +61523,Creative field value for one of the Creative Field Assignment is not valid. +61530,Override URLs must begin with http:// or https://. +61531,Invalid exit ID specified for override. +61532,Invalid placement creative specified for override. +61533,An error occurred in the code generator service. +61534,The event you edited could not be found. Please check the ID and try again. +61535,The asset you edited could not be found. Please check the ID and try again. +61536,We couldn't complete your request. Only FLV assets can be deleted. +61537,Invalid SD Site ID in StudioTraffickingRequest +61538,Invalid Creative SD Site assignment list in StudioTraffickingRequest +61539,Invalid Studio Creative ID in StudioTraffickingRequest +61540,The Dynamic Ad feature hasn't been enabled for the network. Please contact support or log a support case at http://help.doubleclick.com. +61602,Valid value for Z-Index should be in between -1000000000 and 1000000000. +61603,"The following CSS properties cannot be overridden - width, height, position and z-index." +61604,CSS Properties can be overridden for In-Page and Expanding Flash assets only. +61605,File name can only contain alphanumeric characters (not case-sensitive) and . = - or _. +61606,A file in the .mtf package has a name that contains invalid characters. File names can include only alphanumeric characters and these special characters: . = - _ +61607,"The left unit value for the Flash asset was not recognized. Please enter % for percentage or px for pixels, pxc for pixels from centre." +61608,The exit event URL must begin with http:// or https://. +61609,"The target value for the exit event was not recognized. Please enter _parent, _self, _blank, or _top." +61610,The top unit value for the Flash asset was not recognized. Please enter % for percentage or px for pixels. +61611,You can no longer access the updated version of this creative as the same version of it was deleted from DoubleClick Studio. +61614,The length of the Custom Script URL cannot exceed 1024 characters. +61615,Custom Script URL must start with http:// or https://. +63000,The Rich Media feature has not been enabled for this network. Contact Customer Support or go to http://help.doubleclick.com to log a support case. +63001,Advertiser not found. +63002,Advertiser is missing. +63003,The Rich Media Flash-in-Flash feature has not been enabled for this network. Contact Customer Support or go to http://help.doubleclick.com to log a support case. +63500,The change log record cannot be null. +63501,The criteria for searching change logs is not valid. It must specify object IDs. +63502,The given change log is not valid. +63503,The change log record could not be found. +63504,The length of the comments is too long. Please enter up to 4000 characters. +63505,You are not authorized to access this change log record. +64000,Company name is missing. +64001,Please select an admin user for this company. +64002,Company name already exists. +64003,Only a super user can impersonate a company. +64004,Invalid company ID. +64005,You don't have permission to view this company. +64006,You don't have permission to save or modify this company. +64007,You don't have permission to delete this company. +64008,You can't delete this entity because it has child elements. +64009,Only a super user impersonating another user can access this service. +64010,You don't have permission to query multiple companies. +64011,You aren't authorized to access this company. +64012,Required API company object is missing. +64013,No QA region with this ID exists. +64014,Unlink QA Vendor Enabled Clients before removing QA Vendor status. +64015,Unlink QA Vendor associated clients before removing QA Vendor enabled status +64016,You can't remove trafficking permission from this Company because there are Trafficking Enabled Clients present in this Company +64017,This company can't be assigned to the DART network id you provided because the DART network id is already assigned to another Studio Company. +64018,You can't change DART network id associated with your company once it is assigned. +64019,You must specify a valid DFA Network ID when you enable Trafficking for a Company. +64020,The network ID is either not a valid DFA network id or the DFA network does not have appropriate rich media permissions. +64022,You must assign the 'Enable Rich Media' permission for the DFA network before proceeding. +64023,You must assign the 'Enable Rich Media for Flash-in-Flash' permission for the DFA network before proceeding. +64024,You must assign the 'Modify Character Encoding and Language' permission for the DFA network before proceeding. +64025,The DFA network permissions for your account are currently unavailable. Please try again or contact support. +64100,Required API campaign object is missing. +64101,Please enter a campaign name and resubmit. +64102,Campaign name is required. +64103,Campaign name can't exceed 256 characters. +64104,Campaign description can't exceed 1024 characters. +64105,Campaign must be associated with a valid company. +64106,Sorry. You don't have permission to create a campaign for this company. +64107,You can't delete campaigns from a company that isn't assigned to you. +64108,Campaign must be associated with valid client. +64109,Campaign name already exists. +64110,You don't have permission to view campaigns. +64111,You don't have permission to save or modify campaigns. +64112,You don't have permission to save a campaign in this company. +64113,You don't have permission to delete campaigns. +64114,You don't have permission to view a campaign for this company. +64115,You don't have permission to send a preview email. +64116,You don't have permission to view campaign assets for this company. +64117,You don't have permission to view preview emails for a campaign. +64118,You don't have permission to take QA ownership of a campaign. +64119,You must provide a QA approver email address to submit a creative to QA. +64120,The email address provided is not a valid email address +64121,The campaign could not be created because a corresponding trafficking campaign can't be created in DART. Please contact support. +64200,Required API user object is missing. +64201,Please enter a user name and resubmit. +64202,Please select a company. +64203,Please select a contact. +64204,Please select a user role. +64205,You can't assign a contact as the contact's company is different from the user's. +64206,Sorry. You don't have permission to access this company. +64207,User name already exists. +64208,You don't have permission to view this user. +64209,You don't have permission to save or modify this user. +64210,Inactive user. +64211,You don't have permission to delete this user. +64212,You don't have permission to view users. +64213,You don't have permission to view a user in this company. +64214,You don't have permission to save or modify users. +64215,You don't have permission to save a user to this company. +64216,You don't have permission to delete a user from this company. +64217,User with this ID doesn't exist. +64218,You don't have permission to impersonate another company. +64219,Invalid GAIA ID. +64220,GAIA ID can't be authenticated. +64221,Studio login ID provided in the hash code is invalid. +64222,The Google account you are trying to use is already used by another Studio user. +64223,"Access denied, only super users can view the page you are trying to access." +64224,The email address you are trying to use is already used by another Studio user. +64225,Thw GAIA configuration required when saving a new user is missing. +64226,"User can't be deleted because of an internal system error. Please try again later. If error persists, contact support." +64227,The DART user could not be created. Please try again or contact support. +64300,Required API client object is missing. +64301,Client with this ID doesn't exist. +64302,Client name is required. +64303,Client name can't exceed 64 characters. +64304,Client description can't exceed 1024 characters. +64305,Client must be associated with valid company. +64306,You don't have permission to save a client to this company. +64307,You don't have permission to delete a client from this company. +64308,Client name already exists. +64309,You don't have permission to save or modify clients. +64310,You don't have permission to view clients. +64311,You don't have permission to delete clients. +64312,You don't have permission to view a client in this company. +64313,You can't delete this client because it is associated with an advertiser. +64314,This client can't be enabled for Trafficking as the Company is not enabled for Trafficking. +64315,This client can't be enabled for trafficking because it already has campaigns attached to it. Please create a new client or use an existing one without campaigns. +64316,You can't disable trafficking for this client because it has one or more campaigns attached to it. +64317,You can't remove the client-advertiser association for trafficking-enabled clients. +64318,The client could not be created because the corresponding DART advertiser could not be created. Please contact support. +64400,Invalid API creative object. +64401,Please select a campaign. +64402,Please select a client. +64403,Please select a company. +64404,You entered a creative with invalid dimensions. Please correct and resubmit. +64405,Please select a creative type and resubmit. +64406,Only Expanding or Flash-In-Flash Expanding formats are valid for this creative. +64407,Expanding and Flash-In-Flash Expanding formats are invalid for this creative. +64408,Creative name missing. Please correct and resubmit. +64409,Creative name already exists. +64410,Multiple events share the same value for a detail with a uniqueness constraint. +64411,You can only associate a Flash asset with a display properties object. +64412,You can't associate a Flash asset that lacks an enabler with a display properties object. +64413,Dimensions of backup image should match dimensions of creative. +64414,Backup image file size can't exceed 300 KB. +64415,"Backup image must have .jpg, .gif, or .png extension." +64416,You can't exceed one backup image for this creative type. +64417,Backup image doesn't apply for this creative type. +64418,Event name is required. +64419,Event report label is required. +64420,You have more assets with enabler than are required. Please delete unnecessary assets. +64421,Auto-detected events are missing from this creative. +64422,StudioAssetEvents are missing from the Studio Asset. +64423,You can't manually associate a StudioAssetEvent with a StudioAsset. +64424,You can't change the Flash name for auto-detected events. +64425,You can't change auto-detected events to manually added events. +64426,You can't create new events with the auto-detected flag set. +64427,Event name must have English characters only. +64428,Event report label must have English characters only. +64429,Creative used to import events in invalid. +64430,You can't import events from the same creative. +64431,Invalid value for this event type. +64432,You don't have permission to view the creative. +64433,You don't have permission to view creatives. +64434,Creative with this ID doesn't exist. +64435,You don't have permission to save or modify creatives. +64436,You don't have permission to save a creative in this company. +64437,You don't have permission to delete creatives. +64438,You do not have permission to delete creatives for this company. +64439,You do not have permission to view creatives for this company. +64440,Request for creatives is not authenticated. You must supply a campaign trafficking code. +64441,Video component(s) has no name or a duplicate name. Please correct and try again. +64442,You don't have permission to enter a QA note. Requires permission to approve the creative. +64443,You don't have permission to set the creative to this status. +64444,You can't set the creative to this status. +64445,"The dynamic creative contains a missing or invalid Profile ID, the ID must be 22 characters in length." +64446,"The dynamic creative contains more than one distinct Profile ID, ensure Profile IDs are the same in all assets." +64447,Pushdown may only be enabled for creatives that expand down. +64448,The RMDA profile ID associated with the creative cannot be altered. +64449,The required creative id parameter is missing or invalid. +64450,The required manifest server parameter is missing or invalid. +64451,One or more supplied parameters are invalid. +64453,You can no longer access this updated creative because its status was changed in DoubleClick Studio. The creative must be resubmitted from DoubleClick Studio before you can proceed. +64454,Can't pull the requested creative. +64455,Your creative includes the Dynamic Enabler component and can't be trafficked to the publishing environment. Please contact support. +64500,You're trying to upload an invalid zip file. +64501,You're trying to upload an invalid asset type. +64502,You're trying to upload an invalid asset request. +64503,Assets upload request is missing required Studio creative object. +64504,You didn't include any assets in the upload request. +64505,You can't upload assets of 0 file size. +64506,You can't submit duplicate files in an asset upload or copy request. +64507,Error parsing SWF file. +64508,Invalid asset duplicate request. +64509,Asset duplicate request is missing required creative object. +64510,Asset IDs missing from the asset duplication request. +64511,Asset delete request is missing required Studio creative object. +64512,Invalid asset delete request. +64513,Asset delete request is missing asset file name. +64514,No matching asset found in the creative. +64515,You can't duplicate assets in same creative. +64516,Invalid asset IDs passed in the asset duplication request. +64517,Creative's asset display properties don't match creative type. +64518,Creative's asset display properties don't match number of assets in the creative. +64519,Asset ID not found. +64520,You can't duplicate the asset as a file already exists with the same name. +64521,You can't have multiple assets with the same name in a duplicate assets request. +64522,"Invalid duration value for one or more assets. Must be auto, none, or a value greater than or equal to zero." +64523,Invalid start time for one or more assets. Must be none or a value greater than or equal to zero. +64524,You can't exceed one Flash asset with enabler for this creative type. +64525,You can't exceed two Flash assets with enablers for this creative type. +64526,You can't exceed 100 custom events per creative. +64527,Studio creative package size can't exceed 30 MB. +64528,Size of flash asset with enabler can't exceed 300 KB. +64529,You can't modify the collapsed dimensions of an expanding asset. +64530,Exit event URL must start with http:// or https:// +64531,StudioAssetComponents missing from StudioFlashAsset. +64532,You can't add StudioAssetComponents to the existing StudioFlashAsset. +64533,You can't modify the component version in the existing StudioAssetComponent. +64534,You can't exceed one flash asset with expanding component. +64535,You can't publish a creative without an associated advertiser. +64536,An error occurred while publishing a creative to its advertising platform. +64537,Dimensions of main asset should match creative dimensions. +64538,Dimensions of at least one main asset should match creative dimensions. +64540,There is a maximum of one Enabler component per SWF. +64541,Publish versions must be the same across all SWFs. +64542,ActionScript language versions must be the same across all SWFs. +64543,Not a valid creative format type for a creative with f2f enabler +64544,Only one type of enabler allowed per creative +64545,"One or more assets are using old, no longer supported versions of the Studio components. Please update to the latest release." +64546,File name can only contain alphanumeric characters (not case-sensitive) and . = - or _. Spaces not allowed. +64600,Invalid user role. +64601,User role missing. +64602,Company missing for user role. +64603,One or more users assigned to user role are invalid. Please correct and resubmit. +64604,User Role doesn't exist. +64605,You can't delete a user role that's assigned to one or more users. Unassign all users from user role and resubmit. +64606,Inactive user role. +64607,You don't have permission to save or modify roles. +64608,You don't have permission to save role due to invalid company or permission restrictions. +64609,You don't have permission to delete roles. +64610,You don't have permission to delete role due to invalid company or permission restrictions. +64611,You don't have permission to view this role. +64612,You don't have permission to view roles. +64700,Invalid External Preview request. Please correct and resubmit. +64701,Campaign ID in External Preview email request doesn't match campaign ID of creative. Please correct and resubmit. +64702,No creatives selected for External Preview email request. +64703,URL has expired. Please generate a new URL for the campaign. +64704,Invalid campaign code. +64800,Association can't be processed. Studio client doesn't exist. +64801,No association exists for client ID or advertiser ID. +64802,Client is already associated with an advertiser. +64803,Invalid trafficking code. +64804,Expired trafficking code. +64805,The creative cannot be pushed as the client association to advertiser does not exist. +64806,An association can't be made because the advertiser is already associated with a trafficking-enabled client. +64900,You entered invalid search text. Please try again using different terms. +64901,You are trying to associate sites with an invalid company in DoubleClick Studio. Please try again with a valid company. +64902,The site is already associated with this campaign. +64903,An application error occurred. Please try again. +64904,An application error occurred. Please try again. +64905,Invalid request parameter. +64906,An application error occurred. Please try again. +64907,You can't delete sites from a company that's assigned to a campaign. +64908,The site directory records could not be retrieved. Please try again or contact support. +64909,Please remove duplicate assignments by unchecking any creatives that were linked to a site more than once. +64910,Tags are not available for these creative assignments. +64911,You have entered an invalid DFA network ID. Please check your records and try again. +64912,The site type for this assignment is invalid or doesn't map to a DART site type. +64913,The campaign for this assignment is invalid because the creative doesn't belong to the campaign. +64914,The campaign for this assignment is invalid because it isn't mapped to a DART campaign. +64915,You entered an invalid network ID. Please check the number and try again. +64916,An error occurred while the creative was being trafficked to DFA. Please try again or contact support. +64917,You have chosen an invalid site assignment. +64918,Cannot delete as this creative is a part of an Creative assignment. +64919,Cannot update/edit this creative as its trafficking is incomplete. Please try again after some time. +64920,One or more of your sites can not be deleted as they are part of Creative assignments. +64921,The Studio creative is not trafficked. The correspoding dart creative is not available. +64922,"An error occurred while the creative was being deleted. Please try again later. If the problem persists, contact your DoubleClick account representative." +64923,You can't delete this campaign because one or more sites are assigned to it. +65000,Invalid Widget Tag Request. +65001,Error while creating Tag URL for iGoogle. +65002,Error while creating Tag URL for Page Flakes. +67000,The InStream feature has not been enabled for this network. Contact Customer Support or go to http://help.doubleclick.com to log a support case. +67025,Advertiser not found. +67026,Advertiser is missing in Creative. +67100,Creative version is invalid. +67101,Survey URL can't exceed 1024 characters. +67102,Survey URL must start with http:// or https://. +67103,Third-party midpoint URL can't exceed 1024 characters. +67104,Third-party midpoint URL must start with http:// or https://. +67105,Third-party impression URL must start with http:// or https://. +67106,Third-party impression URL can't exceed 1024 characters. +67107,Third-party complete URL must start with http:// or https://. +67108,Third-party complete URL can't exceed 1024 characters. +67109,Third-party click-tracking URL must start with http:// or https://. +67110,Third-party click-tracking URL can't exceed 1024 characters. +67111,Third-party start URL must start with http:// or https://. +67112,Third-party start URL can't exceed 1024 characters. +67113,Third-party first quartile URL must start with http:// or https://. +67114,Third-party first quartile URL can't exceed 1024 characters. +67115,Third-party third quartile URL must start with http:// or https://. +67116,Third-party third quartile URL can't exceed 1024 characters. +67117,Third-party mute URL must start with http:// or https://. +67118,Third-party mute URL can't exceed 1024 characters. +67119,Third-party pause URL must start with http:// or https://. +67120,Third-party pause URL can't exceed 1024 characters. +67121,Third-party replay URL must start with http:// or https://. +67122,Third-party replay URL can't exceed 1024 characters. +67123,Third-party full-screen URL must start with http:// or https://. +67124,Third-party full-screen URL can't exceed 1024 characters. +67125,Third-party stop URL must start with http:// or https://. +67126,Third-party stop URL can't exceed 1024 characters. +67127,Description can't exceed 255 characters. +67128,Can't save creative without at least one media file. +67129,Creative version can't be incremented if previous version isn't saved. +67130,Creative duration unavailable. At least one valid video file with metadata must be uploaded to determine the video duration +67131,Invalid video asset found. The duration of the media file must be within one second of the duration of the creative. +67132,Ad ID can't exceed 15 characters. +67133,File with this name doesn't exist. +67134,Creative being assigned to ad isn't an In-Stream creative. +67135,Creative can't be assigned to an ad because creative and ad belong to different advertisers. +67136,Creative ID is invalid. +67137,Third-party custom click URL must start with http:// or https://. +67138,Third-party custom click URL can't exceed 1024 characters. +67139,Ad ID must be numeric. +67140,Can't save creative without at least one media file green-lighted. +67141,A companion ad can't contain both an ad tag URL and a relative asset path. +67142,A non-linear ad can't contain both an ad tag URL and a relative asset path. +67143,Companion click-through URL must start with http:// or https://. +67144,Companion click-through URL can't exceed 1024 characters. +67145,Non-linear click-through URL must start with http:// or https://. +67146,Non-linear click-through URL can't exceed 1024 characters. +67147,Companion ad tag URL must start with http:// or https://. +67148,Companion ad tag URL can't exceed 1024 characters. +67149,Non-linear ad tag URL must start with http:// or https://. +67150,Non-linear ad tag URL can't exceed 1024 characters. +67151,Companion ad tag URL must have size information. +67152,Non-linear ad tag URL must have size information. +67153,Companion ad tag URL provided must be a DoubleClick ad tag URL. +67154,Non-linear ad tag URL provided must be a DoubleClick ad tag URL. +67155,Expanded width and height must be specified for an expandable companion ad. +67156,Expanded width and height must be specified for an expandable non-linear ad. +67157,Can't enable lock aspect ratio. Non-linear ad isn't scalable. +67158,Companion ad alternate text can't exceed 255 characters. +67159,Non-linear ad alternate text can't exceed 255 characters. +67160,Companion ad width must be between 1 and 1500. +67161,Companion ad height must be between 1 and 1500. +67162,Non-linear ad width must be between 1 and 1500. +67163,Non-linear ad height must be between 1 and 1500. +67164,Expanded width of a companion ad can't be less than the collapsed width or greater than 1500. +67165,Expanded height of a companion ad can't be less than the collapsed height or greater than 1500. +67166,Expanded width of a non-linear ad can't be less than the collapsed width or greater than 1500. +67167,Expanded height of a non-linear ad can't be less than the collapsed height or greater than 1500. +67168,Creative is assigned to a default ad and can't be deleted. A default ad must have a creative. +67169,Creative can't be deleted because it's assigned to an active ad. +67170,Error encountered while creating copy of the creative. Please try again later. +67300,Upload request can't be null. +67301,Invalid image dimensions. +67302,Asset must be image or Flash type. +67303,Asset must be an FLV video file. +67304,Required metadata missing from header section of file. +67305,Can't upload because required parameter is missing. +67306,Required parameter(s) missing. +67500,Invalid preview request. +67501,Can't preview creative. No media file present. +67502,Can't preview creative. Specified media file not present. +70000,Internal error. +70001,Unknown error. +70002,Unable to invoke a method. +70003,You must specify a search criteria. +70004,Invalid search criteria. +70005,Workflow status required. +70006,Workflow status invalid. +70007,Advertiser category required. +70008,Advertiser category invalid. +70009,Global advertiser required. +70010,Global advertiser invalid. +70011,Website/Channel required. +70012,Website/Channel invalid. +70013,Content category required. +70014,Content category invalid. +70015,Contact required. +70016,Contact invalid. +70017,Bid rule required. +70018,Bid rule invalid. +70019,Rotation type required. +70020,Rotation type invalid. +70021,Assigned category does not belong to category type. +70022,Availability required. +70023,Availability invalid. +70024,Site maturity required. +70025,Site maturity invalid. +70026,Page position required. +70027,Page position invalid. +70028,DART advertiser required. +70029,DART advertiser invalid. +70030,Customer required. +70031,Customer invalid. +70032,You are not authorized to access this customer. +70033,Customer must be active. +70034,Customer cannot be changed. +70035,Contact type required +70036,Contact type invalid +70037,Frequency Type invalid +70038,Frequency Unit invalid +70039,eCPM method required. +70040,eCPM method invalid. +70041,Creative Content Type is required +70042,Creative Content Type could not be found +70043,Creative Format Type is required +70044,Creative Format Type could not be found +70045,Creative Maturity Level is required +70046,Creative Maturity Level could not be found +70047,Application required. +70048,Product Required +70049,Product Type invalid. +70100,You must be DCLK Admin to perform this action. +70101,You must be Admin to perform this action. +70102,You must be Seller to perform this action. +70103,You must be Buyer to perform this action. +70104,Invalid contact for customer was specified. +71000,Customer name must be unique. +71001,You cannot delete an active customer. +71002,Customer name must be 1-256 characters long. +71004,You cannnot specify category types for customer. +71005,Customer does not have correct role associated with it. +71008,Customer must have buyer role in order to have buyer category types. +71009,Customer must have seller role in order to have seller category types. +71010,Customer must have 5 buyer category types +71011,Customer must have 5 seller category types +71013,Customer can have only one category type mapped to publisher. +71014,Customer can have only one category type mapped to site. +71015,Customer with buyer role must have one buyer category type mapped to Dart advertiser. +71016,Customer with seller role must have one house bid per network size. +71017,Customer with seller role can have only one house creative per network size. +71018,Customer with seller role must have house advertiser. +71019,You cannot remove from customer any website/channel that is used by AdSlot. +71020,You cannot remove from customer any advertiser that is used by Bid. +72000,Create category types is prohibited. +72001,Missing Category Type. +72002,Delete category type is prohibited +72003,You can specify only one category type for targeting default. +72004,You can specify only one category type for frequency cap default. +72005,Category type must be either for seller or buyer. +72006,Category type must have unique name. +72007,You can specify only one category type for budget default. +72008,Category type name must be 1-256 characters long. +72009,Category type cannot be both publisher and site. +72010,"Cannot assign, unassign or make optional a system-required attribute." +72011,There are missing attributes in attribute assignment for category type. +72012,You can specify only one category type for billing invoice. +73000,Placement does not exist. +73001,You cannot change placement's end date once it has expired. +73004,Unable to find given placement. +73005,Expect one default bid for each default creative. +73006,Placement's customer must match its category's customer. +73007,You cannot save a global default placement that is not marked as global default. +73008,Placement can be only assigned to category in active category type. +73009,Retrieving the default placement by its ID is prohibited. +73010,Saving the default placement as a regular placement is prohibited. +73011,Deleting the global default placement is prohibited. +73012,You cannot change a default placement to a non-default placement or vice versa. +73013,A customer can only have one global default placement. +73014,A category default placement cannot be retrieved for a category type that does not have targeting enabled. +73015,"You must specify either test end date or test budget. When specified, test budget must be between 1 and 4294967 cents." +73016,You cannot save the category default placement that is not marked as category default. +73017,Creative size must match placement size. +73018,You must specify a valid content category for placement. +73019,Placement adjustment must be between 0.01% and 1000%. +73020,Placement and category advertiser must match. +73021,Placement and creatives advertiser must match. +73022,The frequency value of the pacing limit is invalid. +73023,The time value of the pacing limit is invalid. +73024,Placement min bid must be between 0 and 1000000 cents. +73025,"You must specify either initial bid or initial click rate (but not both). If initial bid is specified, the initial bid must be between 1 and 1000000 cents. If initial click rate is specified it must be greater than 0." +73026,Placement value of click must be between 1 and 1000000 cents. +73027,You are not allowed to change Advertiser for placement. +73028,You must specify a valid contact for placement. +73029,The creative to be unassigned from this placement was never assigned to this placement. +73030,This creative to placement assignment does not exist. +73031,This creative is not assigned to this placement. +73032,Placement budget must be between 1 and 4294967295 cents. +73033,Placement max bid must be between 1 and 1000000 cents. +73034,Placement min bid must be less than or equal to the max bid. +73035,You are not allowed to specify a limit on both budget & impression count for a placement. +73036,The frequency cap values for a placement must match +73037,You cannot explicitly change a house creative to a house bid assignment. +73038,You cannot explicitly update a house bid. +73039,You cannot explicitly delete a house bid. +73040,"When targeting anonymous publishers, you must select at least ten." +73041,Error getting publisher count. +73042,Percentage of excluded publishers is too high. +73043,A category can only have one default placement. +73044,Deleting the category default placement is prohibited. +73045,Initial Click Rate percentage must be a valid real number greater than 0 and less than or equal to 100. +73046,Initial Conversion Rate percentage must be a valid real number greater than 0 and less than or equal to 100. +73047,Initial bid must be greater than or equal to min bid and less than or equal to max bid +73048,You cannot deactivate default placement. +73049,The placement's conversion value must be between 1 and 1000000 cents. +73050,The placement's initial conversion rate must be between 0.00000001% and 100.0% +73051,The placement's initial conversion value must be between 1 and 1000000 cents. +73052,No bid rule specified for placement. +73053,Only Sales Activities can be used as conversion values. Conversion values from activities that are not Sales Activities are not valid. +73054,Spotlight activity ID is invalid. +73055,Placement using CPA bid rule has null activity. +73056,Placement's test end date must be before the placement's actual end date. +73057,Placement's test budget must be less than the placement's actual budget. +73058,Placements using an impression goal bid rule must have a minimum impression goal of 1 impression. +73059,Could not connect to Bid Rule Engine to get bid price. +73060,Error in communicating with Bid Rule Engine to get bid price. +74003,You must specify a valid creative dimension banning for ad slot. +74004,AdSlot name must be between 1-256 characters. +74005,AdSlot min CPM must be between 1 and 4294967296 cents. +74006,An ad slot key-value cannot be more than 4000 characters. +74007,AdSlot's start date must precede its end date. +74008,You must specify a valid creative dimension banning level for ad slot. +74009,You can only assign a single creative dimension banning level to ad slot. +74010,You must specify a creative dimension banning level for ad slot. +74012,Unable to find given ad slot. +74013,Ad slot's customer must match its category's customer. +74014,You cannot save the global default ad slot that is not marked as global default. +74015,Ad slot can be only assigned to category in active category type. +74016,AdSlot external ID cannot be more than 256 characters. +74017,AdSlot does not exist. +74018,You must specify valid availability for ad slot. +74019,A customer can only have one global default ad slot. +74020,Changing the default status of an ad slot is prohibited. +74021,Retrieving a default ad slot by its ID is prohibited. +74022,Saving a default ad slot as a regular ad slot is prohibited. +74023,Deleting the global default ad slot is prohibited. +74026,You must specify a valid seller category for ad slot. +74027,You must specify at least one buyer for ad slot with private availability. +74028,You cannot specify a buyer for an ad slot with non-private availability +74029,You cannot save the category default ad slot that is not marked as category default. +74030,A category can only have one default ad slot. +74031,A category default ad slot cannot be retrieved for a category type that does not have targeting enabled. +74032,Invalid buyer for ad slot. +74033,Revenue share must be between 0 and 100% (inclusive). +74034,Deleting the category default ad slot is prohibited. +74036,Creative Maturity Level is required +74037,"To save a Category Default, the CategoryType must have targeting enabled." +74038,You cannot deactivate default ad slot. +75000,Creative does not exist. +75001,Creative size does not match placement size. +75002,Creative size ID is duplicated in database. +75003,You cannot assign a creative with missing creative dimension banning level to a placement. +75009,Unsupported creative dimension requested. +75010,Cannot upload file without a file extension +75011,File extension is invalid +75012,File cannot be larger than 1 Megabyte +75013,The following illegal Javascript was found in the rich media code posted: {0} +75800,Specified creatives are invalid or do not exist. +75801,Could not get user. +76000,The user profile must have at least one role. +76001,A user role must be included. +76002,You can only map Adx user to DFA or DFP User. +76003,You must specify dart username when mapping Adx user to DFA or DFP. +76004,Profile name must be unique. +76005,Unable to verify dart username. +77002,Category name must be between 1-256 characters. +77003,Category alternate ID cannot be more than 256 characters. +77004,Category url cannot be more than 256 characters. +77005,Category description cannot be more than 256 characters. +77006,You must have access to the category type for the category. +77007,You must specify a category type for category. +77008,Category must have unique name. +77010,Unable to find given category. +77011,You must specify category type for the category. +77012,The attribute is not associated with the corresponding category type. +77018,There can be only one order for a DART advertiser. +77019,You must enter data for user-defined attributes that are no more than 4000 characters. +77020,You must enter data for all required attributes. +77021,You must enter numerical data. +77022,You must enter data in the dd-mm-yyyy and hh:mm:ss formats. +77023,You can only enter a single selection for single-select attribute +77024,You must specify category attribute. +78000,Contact first name must be between 1-40 characters +78001,Contact state cannot have more than 64 characters +78002,Contact city cannot have more than 255 characters +78003,Contact address1 cannot have more than 255 characters +78004,Contact address2 cannot have more than 255 characters +78005,Contact postal code cannot have more than 45 characters +78006,Contact phone cannot have more than 40 characters +78007,Contact cell cannot have more than 40 characters +78008,Contact fax cannot have more than 64 characters +78009,Contact Email must be between 1-64 characters +78015,Contact last name must be between 1-50 characters +78016,Network of contact must match network of customer +78017,Contact department name cannot have more than 255 characters. +78018,Contact company name cannot have more than 255 characters. +78019,Contact title cannot have more than 64 characters. +78020,Contact phone cannot have more than 40 characters +78021,Contact pager cannot have more than 64 characters. +78022,Contact comments cannot have more than 1000 characters. +78023,You cannot delete contacts that are assigned to ad slot. +78024,You cannot delete contacts that are assigned to placement. +78025,You cannot delete contacts that are assigned to category. +78026,Invalid contact specified. +78027,Address1 must be specified for billing contacts. +78028,City must be specified for billing contacts. +78029,State must be specified for billing contacts. +78030,Postal code must be specified for billing contacts. +78031,Country must be specified for billing contacts. +78032,Cannot delete billing contact for customer. Please change billing contact for customer before deleting this contact +78033,Invalid postal code for contact. +79000,Spotlight configuration id required. +79001,Spotlight configuration ID is invalid. +79002,Customer ID for Spotlight search criteria required. +79003,The Spotlight search criteria is invalid. Spotlight search criteria must not be empty and requires a customer ID. +79100,Website/Channel name must be between 1-255 characters. +79101,Website/Channel name must be unique. +79102,Website/Channel url must be between 1-255 characters. +79103,Website/Channel url is invalid. +79104,Website/Channel url must be unique. +88999,Placeholder +89999,Placeholder +91000,Advertiser name already exists. +91001,Invalid URL. +91002,Invalid email address. +91003,Advertiser name cannot be null or empty. +91004,Advertiser cannot be deleted because it has campaigns associated with it. +91005,The advertiser cannot be deleted because its Spotlight configuration is being used by another advertiser. +91006,Invalid advertiser group name. +91007,Advertiser group name already exists. +91008,Cannot delete advertiser group because advertisers are assigned to this group. +91009,Invalid advertiser group assigned to advertiser. +91010,Invalid network has been specified for the advertiser. +91011,Invalid advertiser status. +91012,Invalid advertiser. +91013,You don't have access to the subaccount specified for the advertiser. +91014,Advertiser cannot be deleted as there exists an association with Studio Client +91015,Advertiser name can't contain tab spaces. +91046,The advanced report selected for the advertiser is not enabled for the network. +91047,Cannot change advertiser group +91048,Country name may not exceed 32 characters +91049,Telephone number may not exceed 32 characters +91050,Fax number may not exceed 32 characters +91051,Contact person name may not exceed 32 characters +91052,Website URL may not exceed 96 characters +91053,Billing Address 1 may not exceed 64 characters +91054,Billing Address 2 may not exceed 64 characters +91055,Billing City Name may not exceed 64 characters +91056,Billing State Name may not exceed 32 characters +91057,Billing Postal Code may not exceed 10 characters +91058,Billing Country Name may not exceed 32 characters +91059,Terms description may not exceed 100 characters +91060,Production and Trafficking description may not exceed 255 characters +91061,Email may not exceed 64 characters +91062,Address 1 may not exceed 64 characters +91063,Address 2 may not exceed 64 characters +91064,City Name may not exceed 32 characters +91065,State Name may not exceed 100 characters +91066,Postal Code may not exceed 12 characters +91067,Invalid telephone. +91068,The advertiser could not be found. +91070,Cannot unassign Advanced Report enabled at network +91071,The number of activities to track cannot exceed the limit set for the network. +91072,Activity exposure days cannot exceed clicks or impressions lookback value. +91073,Activity exposure level cannot exceed network limit. +91074,Exposure-to-conversion not enabled for advertiser. +91075,A Spotlight configuration cannot be shared with an advertiser that is already sharing Spotlight configurations with another advertiser. +91076,The Spotlight configuration cannot be shared. It is already used by another advertiser. +91077,The activity assigned for advanced reports cannot be deleted. +91078,This activity is assigned to a placement with a CPA cost type. It cannot be deleted. +91079,Number of exposure activities exceed the limit specified at the configuration level. +91080,Activity exposure days cannot be greater than 30. +91081,Spotlight activities can only be deleted by a super user. +91082,The site specified for the publisher tag is not valid. +91083,The advertiser can't share the spotlight configuration of another advertiser because this advertiser already contains some activity groups or activities. +91084,Activity exposure level cannot be 0. +91085,Activity exposure days cannot be 0 or less than 0. +91087,Search Criteria results exceed allowed download limit of 300 tags. +91088,Spotlight activity group can be deleted only by super user. +91089,The Spotlight activity group can't be deleted because advanced reports are being generated for at least one activity within the group. Please check the campaign properties for each of the advertiser's campaigns and remove any Spotlight activities from the 'Advanced Reports on Spotlight Activities' section. +91090,"The Spotlight activity group can't be deleted because at least one activity within the group is being used as the activity type for a placement that uses the CPA (cost per activity) pricing model. To delete the group, first remove the activities from all placements." +92000,Campaign name cannot be empty. +92001,Campaign name may not exceed 255 characters. +92003,Campaign comments may not exceed 255 characters. +92004,The campaign end date must be after the start date. +92005,The campaign's end date is in the past. +92006,The campaign's network is invalid. +92007,The campaign's advertiser is invalid. +92008,The user's account is different from the campaign's account. +92009,The advertiser's network is different from the campaign's network. +92010,The minimum weight of each creative for optimization should be a whole number greater than 0 and less than or equal to 100. +92011,The relative strength of the optimizer should be a number between 1 and 10. +92012,The Weight of each activity selected for optimization should be a whole number between 0 and 100. +92013,"You must select a Counter or Sales activity if optimization is based on Post-Clicks, Post-Impression or Post-Impression and Post-Click." +92014,You cannot select a Counter or Sales activity if optimization is based on clicks. +92015,A campaign with the given name already exists. +92016,The Campaign date range is invalid. +92017,The Campaign object to be saved cannot be null. +92018,Audience Segmentation name is required and cannot exceed 64 characters. +92019,Audience Segmentation name must be unique per Campaign. +92020,You must define at least one Audience Segment for each Segmentation. +92021,Audience segment name is required and cannot exceed 64 characters. +92022,Audience Segment name must be unique per Segmentation. +92023,The percentage allocation for all Segments in a Segmentation must add up to 100. +92024,Invalid Creative Group name. The Creative Group name must be 1 to 255 characters in size. +92025,"A Creative Group with the same name already exists, specify a different name." +92026,Advanced report is not enabled for the advertiser. +92027,Campaigns containing placements can't be deleted. +92028,More than 20 activities cannot be selected for Advanced Reports. +92029,Invalid number of clicks or impressions for the campaign specified. +92030,The campaign cannot be found. +92031,Invalid advertiser has been specified for the network. +92032,Campaign's landing page Name and URL are both required. +92033,Campaign's landing page URL should be 1 - 1024 character long. +92034,The landing page can't be deleted as it has been assigned. +92035,The Spotlight Lookback Window for Clicks cannot exceed the Lookback Window set in the Spotlight configuration. +92036,The Spotlight Lookback Window for Impressions cannot exceed the Lookback Window set in the Spotlight configuration. +92037,Creative Group specified does not exist. +92038,A campaign cannot have multiple landing pages with the same name. +92039,Creative Field is not assigned to campaign +92040,Campaign can't be deleted because some of its landing pages are used by assignments. +92041,Creative is not assigned to campaign. +92042,Invalid campaign specified +92043,The campaign cannot be deleted because it contains ads. +92044,The landing page can't be removed from the campaign because it is in use by creatives or ads. +92045,The creative field name cannot be null or empty. +92046,The creative field search criteria must include either the creative field IDs or the advertiser IDs. +92047,One or more of the given creative fields could not be found. +92048,Campaign must have at least one landing page. +92049,The Spotlight Lookback Window for DoubleClick Rich Media Events cannot exceed the Lookback Window set in the Spotlight configuration. +92050,Null audience segmentation group specified for the campaign. +92051,Landing page is invalid. +92052,The activity specified for creative optimization is not valid. +92053,The activity specified for creative optimization can't be found. +92054,The activity specified for creative optimization does not belong to the campaign's advertiser spotlight configuration. +92055,Campaigns with active ads can't be archived. +92056,Landing Page is already associated to an existing campaign +92057,Creative can be assigned one creative group in the same creative group family +92058,Campaign name can't contain tab spaces. +92059,The campaign can't have placements beyond the campaign date range. +92060,Advance Reach Report Configuration not enabled for Network. +92061,Advance Reach Report Configuration network is invalid. +92062,Advance Reach Report Configuration campaign is invalid. +92063,Advance Reach Report Configuration report is invalid. +92064,Campaigns containing media orders can't be deleted. +92067,This campaign can't be upgraded because it uses an outdated version of audience segmentation that is not yet supported in DFA6. +93000,The placement name cannot be null or empty and cannot exceed the 256 character limit. +93001,Invalid or null pricing object. +93002,The start date of a pricing period cannot be null or after the end date. +93003,The end date of a pricing period cannot be null or before the start date. +93004,The cost of a pricing period or placement cannot be negative. +93005,The units of a pricing period or placement cannot be negative. +93006,The rate of a pricing period or placement cannot be negative. +93007,The pricing period comments cannot exceed 256 characters. +93008,The pricing type is not valid. +93009,The placement start date cannot be null or after the end date. +93010,The placement end date cannot be null or before the start date. +93011,The placement comments cannot exceed the 4000 character limit. +93012,The pricing start date must be within the placement run date range. +93013,The pricing end date must be within the placement run date range. +93014,The campaign specified for a placement cannot be null. +93015,The site specified for a placement cannot be null. +93016,The sitepage number ID specified for a placement cannot be negative. +93017,The placement type is not valid. +93018,The placement testing start date cannot be after the start or end dates. +93019,Placements with an Impressions or Clicks rate type cannot be flighted or have pricings specified. +93020,Placement run dates must be specified before adding any pricing records. +93021,The pricing start or end dates cannot be outside the placement start and end date range. +93022,The pricing record that starts with the start of the placement cannot be removed. +93023,The pricing record that starts with the start of a month cannot be removed from flighted placements. Only pricing records that start in the middle of the month can be removed. +93024,The cap cost type is invalid. +93025,The placement start date must be within the campaign date range. +93026,The placement end date must be within the campaign date range. +93027,The site and campaign must belong to the same network. +93028,The site and advertiser must belong to the same subaccount. +93062,DO NOT USE +93063,All placements in spreadsheet must belong to the same campaign. +93064,Group not found. +93065,The campaign is locked because it has active placement import jobs. +93066,You must select type of tag to display. +93067,You are not authorized to approve this publisher-paid placement. +93068,You can't unapprove a publisher-paid placement which has already been approved. +93069,The publisher-paid setting of the placement can't be changed because it has already registered some impressions or clicks. +93070,The publisher-paid placement can't be approved because there is no corresponding default creative specified in the campaign. +93071,The publisher-paid placement is already approved and so it can't be changed into an agency-paid placement. +93072,The placement testing start date must be within the campaign date range. +93073,The account is not enabled for publisher-paid placements. +93074,An alphanumeric temporary ID is required while importing a new flighted site placement. +93075,The Spotlight Lookback Window for Clicks cannot exceed the Lookback Window set in the Spotlight configuration. +93076,The Spotlight Lookback Window for Impressions cannot exceed the Lookback Window set in the Spotlight configuration. +93077,The Spotlight Lookback Window for DoubleClick Rich Media Events cannot exceed the Lookback Window set in the Spotlight configuration. +93078,Invalid Placement Tag download option. +93079,You cannot create a site placement. This site has been deactivated. +93080,"Email address of the author for widget is invalid, please correct and re-submit." +93081,"The widget image you are trying to upload is invalid. You can only upload image of types: .jpeg, .gif, .jpeg, .png, .wbmp." +93082,Widget Image could not be saved. +93083,The widget image exceeds the maximum image size allowed for the network. +93084,Invalid image data. +93085,Widget Image Upload request is null. +93086,Invalid Widget Image Upload request. +93087,You cannot create a Widget Site Placement as your network is not enabled for F2F. Please contact your Network Administrator. +93088,You cannot create an In-Stream Video Site Placement as your network is not enabled for In-Stream Tracking. Please contact your Network Administrator. +93089,A placement can't be created for an unapproved DFA site. +93090,Placement filter type is not valid. +93091,Placement Group filter type is not valid. +93092,The placement testing start date cannot be after the campaign end date. +93093,An active site placement cannot be assigned to an archived group. +93094,Placement names can't contain tab spaces. +93097,Placements and media orders must belong to the same campaign. +93098,"One or more placements can't be deleted because they were created in MediaVisor. You can archive them instead, or delete them in MediaVisor." +93100,"Once a widget or In-Stream video placement has been creative, you can't change the placement type." +93101,"Because Spotlight activity tracking isn't available for mobile ads, the CPA cost structure can't be used with mobile placements. Please use a different cost structure." +94000,Site cannot be found. +94001,The given site is null and cannot be saved. +94002,The site with the given name already exists. +94003,The site with the given URL (keyname) already exists. +94004,Invalid network has been specified for the site. +94005,Invalid URL (keyname) specified for site. It is required and can only contain characters [A-Z a-z 0-9 _ - . ?] +94006,DFA site cannot be created from Site Directory site because the given Site Directory site is invalid. +94007,You cannot create a site because the given directory site is already mapped to another site in this network. +94008,"The given keyword handling option is not valid. It should be one of 1 (Placeholder with list of keywords), 2 (Ignore) or 3 (Generate separate tag for each keyword)." +94009,The maximum allowed length of additional key-values is 255 characters. +94010,The additional key-values should be of the format key=value and separated by semicolons. +94011,Cannot assign content category to unapproved site. +94012,Cannot assign inactive content category to site. +94013,The values cannot exceed impression/click lookback windows defined for your network. +94014,Values for impression/clicks cannot be negative. +94015,The criteria to search for SD-DFA site mappings cannot be null. +94028,The placement cannot be found. +94029,The given placement cannot be null. +94030,The size specified for the placement is not valid. +94031,Regular placements must have a valid size. +94032,"You cannot change the placement's dimensions because there are ads assigned to the placement. To change the dimensions, first unassign all ads." +94033,"You cannot change the placement's type because there are ads assigned to the placement. To change the type, first remove all assignments." +94034,The placement cannot be deleted because it has already registered some impressions or clicks. +94035,"You cannot delete the placement because there are ads assigned to it. To delete the placement, first remove all assignments." +94036,The placement can't be publisher-paid because the site doesn't accept DoubleClick Rich Media payments. +94037,"The Impressions and Clicks pricing types are no longer supported. Please use any one of CPM, CPC, CPA, Flat Rate - Impressions, Flat Rate - Clicks." +94038,Content category name is not unique. +94039,Content category name cannot be empty. +94040,Content-category cannot be found. +94041,The values cannot exceed impression/click lookback windows defined for this placement advertiser. +94042,The values cannot exceed impression/click lookback windows defined for your network. +94043,Values for lookback window cannot be negative. +94044,The placement and its group (package or roadblock) must belong to the same campaign and site. +94045,The group assigned to the placement cannot be found. +94046,The placement added to the group cannot be found. +94047,An archived placement cannot be assigned to an active group. +94048,The roadblock does not contain a primary placement. +94049,The placement is marked as primary for the roadblock and therefore cannot be removed. +94050,The group assigned to the placement must be either a roadblock or a package. +94051,The placement added to the group cannot be another group or roadblock. +94052,The placement being added to this group is already marked as a primary placement for some other roadblock. +94053,The Spotlight activity assigned to the placement is not valid. +94054,The placement creative comments cannot exceed 255 characters +94055,The placement other comments cannot exceed 4000 characters. +94056,The placement strategy could not be found. +94057,The placement strategy cannot be null. +94058,Another placement strategy with the same name already exists in the network. +94059,The placement strategy name is required and has a maximum length of 255 characters. +94060,Activity group not found. +94061,Invalid pricing type for counter activity group. +94062,DO NOT USE +94063,The site does not support interstitial placements. +94064,The Content Category object to be saved cannot be null. +94065,The Site Directory site is already linked to another DFA site in the same DFA account (subaccount) +94066,You don't have access to the subaccount. +94067,The keyword referrer cannot exceed 32 characters. +94068,DFA sites can be linked only to active Site Directory sites. +94069,The Site Directory site assigned to the DFA site can't be changed. +94070,The site name is not valid. It is required and can be up to 128 characters. +94071,The country specified for the site is not valid. +94072,The target window is not valid. It has a maximum length of 32 characters. +94073,The alternate text is not valid. It has a maximum length of 255 characters. +94074,The frame and layer header is not valid. It has a maximum length of 2000 characters. +94075,The frame and layer footer is not valid. It has a maximum length of 2000 characters. +94076,The iframe header is not valid. It has a maximum length of 2000 characters. +94077,The iframe footer is not valid. It has a maximum length of 2000 characters. +94078,The DFA site is not linked to any Site Directory site. +94079,The site does not support In-Stream Video placements. +94080,The rich media event lookback window can't exceed the network limit. +94081,The rich media event lookback window must be greater than or equal to 0. +94082,Not authorized to create/modify sites. +94083,Search string must be specified when looking for suggestions. +94084,You can't create a site outside your subaccount. +94085,Site name can't contain tab spaces. +94086,The site you chose for this placement does not support Widgets. Please try a different site or placement type. +94087,The DFA site can't be found. +94091,The placement can't be publisher-paid because the site is not associated with a publisher. +94092,The customer account associated with this site has expired. +94093,The customer account associated with this site is inactive. +94095,We had a problem mapping the DFA site to a Site Directory site. The Rich Media Customer set for the site in DFA5 doesn't match the billing customer set for the Site Directory site. Please contact customer support to resolve the issue +96000,This user profile does not have access to this account. +96001,This Network is not permitted to access DFA6. +96002,This user is not permitted to access DFA6. +96003,The network is not a valid DFA network. +96004,Network permission not enabled for floodlight. +96005,You are not authorized to access this environment +96006,The 'View User Profiles' permission is not enabled +96007,The 'Modify User Profiles' permission is not enabled. +96008,There's already a user profile with that name. Please try a different profile name. +96009,The permissions set for this network don't allow changes to the language or language encoding. +96010,"There was a problem with the user profile name. Please make sure it doesn't contain a space or any of these characters: & ; < > ' "" # % ," +96011,The number of support contacts exceeds the maximum set for this account. +96012,Support Contact count should be greated than or equal to 0. +96013,Cannot set the value for Support Contact less than the total number of existing Support Contacts. +96015,You must enable Rich Media for this account before you can enable Creative Merge. +96016,You must enable Rich Media for this account before you can enable Dynamic Ads. +97000,We couldn't find this placement. Please check the ID and try again. +97001,We couldn't find this campaign. Please check the ID and try again. +97002,We couldn't find this advertiser. Please check the ID and try again. +97003,We couldn't find this account. Please check the ID and try again. +97004,Please enter a value from 1 to 16 for the ad's priority. +97005,"We didn't recognize the rotation type you set for this ad. Please enter 'random', 'sequential', 'weighted', or 'best performing'. (See the Help tab for details.)" +97006,The ad delivery schedule is not valid. +97007,The frequency cap specified for the ad is not valid. Acceptable values must be integers from 0 and 15. +97008,The frequency cap period specified for the ad is not valid. Acceptable values: 0 <= period <= 129600 seconds (90 days). +97009,We couldn't find this ad. Please check the ID and try again. +97010,Ad cannot be null. +97011,You tried to activate an archived ad. Only unarchived ads can be activated. +97012,A standard ad can't be activated until it has at least one creative. +97013,Static click ads cannot be activated. Set the value to FALSE. +97014,DoubleClick Search click ads can't be activated. Set the value to FALSE. +97015,The ad is the wrong ad type. +97016,The cost type specified for the ad is not valid. +97017,Impression ratio and delivery limit can't be specified at the same time. +97018,Delivery limit must have valid cost type. +97019,An ad can't be active unless it's assigned to a placement. +97020,You've tried to assign an ad to a placement in a different campaign. Please make sure the ad and placement are part of the same campaign and try again. +97021,The ad and placement have different dimensions. Please check the dimensions and try again. +97022,The campaign specified for the ad is invalid. It cannot be null and the user profile must have access to the campaign. +97023,Invalid bandwidth. +97024,Invalid domain name. +97025,Invalid city. +97026,Invalid Designated Market Area. +97027,Invalid Area Code. +97028,Invalid Country. +97029,Invalid State. +97030,Invalid Browser. +97031,"We didn't recognize the ad type you set for this ad. Please enter 'in-page', 'interstitial', 'click tracker', 'dynamic click tracker', 'Rich Media Flash-in-Flash', or 'In-Stream Video'. (See the Help tab for details.)" +97032,The ad type specified in the ad is not valid. The ad type must match the ad type. +97033,We couldn't find the primary creative for this ad. Please check the ID and try again. +97034,The ad and its primary creative must belong to the same advertiser. +97035,The ad and its parent must belong to the same campaign. +97036,The creative is already a primary creative for another ad in the same campaign. +97037,The ad type and the primary creative type are not compatible. +97038,The ad specified is null. +97039,The ad must have a corresponding ad. +97040,We couldn't find this ad. Please check the ID and try again. +97041,You've tried to assign an ad to a placement in a different campaign. Please make sure the ad and placement are part of the same campaign and try again. +97042,The ad and placement have different dimensions. Please check the dimensions and try again. +97043,"We didn't recognize the ad type you set for this ad. Please enter 'in-page', 'interstitial', 'click tracker', 'dynamic click tracker', 'Rich Media Flash-in-Flash', or 'In-Stream Video'. (See the Help tab for details.)" +97044,We didn't recognize the landing page you entered for this assignment. Please enter a landing page that has been added to this campaign. +97045,Please enter a landing page for this assignment. +97046,No placement was specified for the assignment. +97047,The search criteria cannot be null. +97048,The search criteria must specify a campaign or ID. +97049,We didn't recognize the landing page you entered for this ad. Please enter a landing page that has been added to this campaign. +97050,We couldn't find this campaign. Please check the ID and try again. +97051,The placements can be assigned only to a parent ad. +97052,We couldn't read the ad name. Please check to make sure you've included an ad name that's no more than 255 characters. +97053,Please enter a start date. +97054,Please enter an end date. +97055,You've set a start date that's after the end date. Please check the dates and try again. +97056,You've set a start date in the past. Please set a date and time that have not already passed. +97057,"This ad has already passed its hard cut-off date. To reactivate it, first remove the hard cut-off or change the end date." +97058,"The advertiser for this ad hasn't been approved yet, so this ad can't be activated. Try leaving it inactive for now. You can activate the ad once the advertiser is approved." +97059,One of the targeted placements is null. +97060,We couldn't find one or more of the placements to which you assigned this ad. Please check the IDs and try again. +97061,One or more of the placements to which you assigned this ad are part of a different campaign. Please make sure the ad and placements are part of the same campaign and try again. +97062,This ad can't be assigned to this placement because their types are not compatible. +97063,The size can't be null. +97064,"We didn't recognize the dimensions you set for this ad. Please check the dimensions and enter them again, in the format widthxheight (for example, 468x60)." +97065,The dimensions you set for this ad aren't in use in this account. Please check the dimensions and try again. +97066,You can't change the dimensions for this ad because it already contains creatives or is assigned to placements. Please check the dimensions and try again. +97067,The ad's dimensions don't match the placement's dimensions. Ads can only be assigned to placements that share the same dimensions. +97068,The delivery limit value is not valid. +97069,One of the assigned creatives is null. +97070,One or more of the assigned creatives can't be found. Please check the IDs and try again. +97071,One or more of the assigned creatives do not belong to the same advertiser as this campaign. Only this advertiser's creatives can be assigned to this ad. +97072,One or more of the assigned creatives are not compatible with the ad type. Please check the ad type and creative types and try again. +97073,The creative assignment with the specified ID can't be found. +97074,The associated creative's start date is not within the ad's date range. Please check the dates and try again. +97075,The associated creative's end date is not within the ad's date range. Please check the dates and try again. +97076,A frequency cap value must be specified if a frequency period is specified. +97077,"Whoa there, buddy! A sequential rotation can't have more than 64 creatives." +97078,That's a lot of creatives! The maximum for an ad is 80. +97079,We didn't understand the sequence number you entered for this creative. Please enter a number from 1 to 65536. +97080,Please enter a unique sequence number for each creative in the ad. +97081,We didn't recognize the weight you set for one of this ad's creatives. Please enter a value from 1 to 100. +97082,We couldn't find a default landing page for this campaign. Please enter a different landing page or a custom click-through URL. +97083,We didn't recognize the landing page you entered for this creative. Please enter a landing page that has been added to this campaign. +97084,"There was a problem with the click-through URL you set for the creative. Please enter a URL that begins with http:// or https:// and has no more than 1,024 characters." +97085,"We didn't recognize the ad type you set for this ad. Please enter 'in-page', 'interstitial', 'click tracker', 'dynamic click tracker', 'Rich Media Flash-in-Flash', or 'In-Stream Video'. (See the Help tab for details.)" +97086,Can't find appropriate product for the ad. The ad type may not be enabled for the network. +97087,"There was a problem with the click-through URL. Please enter a URL that's no more than 1,024 characters. This field is required." +97088,"There was a problem with the click-through URL. Please enter a URL that begins with http:// or https:// and has no more than 1,024 characters." +97089,A default Landing Page must be defined on the Campaign Properties page before saving a new creative. +97090,It looks like you've tried to assign an ad to a package or roadblock. Ads can only be assigned to individual placements. +97091,No default landing page found for the campaign. +97092,"There was a problem with the click-through URL. Please enter a URL that's no more than 1,024 characters. This field is required." +97093,"There's a problem with this ad. Please make sure that there's at least one creative with an active status. If you're changing the run dates for a creative, make sure that there are no time gaps during which no active creative is scheduled to be delivered." +97094,A standard ad can't be activated until it has at least one creative. +97095,Please enter a start date. +97096,Please enter an end date. +97097,"We didn't recognize the rotation type you set for this ad. Please enter 'random', 'sequential', 'weighted', or 'best performing'. (See the Help tab for details.)" +97098,"Please give this ad a name, and make sure it has no more than 255 characters." +97099,The given assignment object is null. Please provide a valid non-null assignment object. +97100,You cannot associate a Rich Media creative with a new ad. Please save the ad before associating Rich Media creatives. +97101,The creative's dimensions don't match the ad's dimensions. Creatives can only be associated with ads that share the same dimensions. +97102,"The placement to which you assigned this ad is archived, which means it's inactive and can't accept new assignments. Please unarchive this placement if you want to use it in a campaign." +97103,This account does not permit ads with Rich Media creatives to be assigned to agency-paid placements. +97104,This account does not currently permit ads to be assigned to publisher-paid placements. Please contact your account administrator if you need to change the account settings. +97105,Assignment properties cannot be overridden. +97106,The placement is not assigned to the assignment object. It must be assigned before the assignment properties can be overridden. +97107,The placement is not assigned to the assignment object. +97108,Invalid postal code. +97109,Invalid audience segmentation option. +97110,The audience segmentation option specified for the ad has 0 percentage. +97111,The audience segmentation can't be deleted because it is assigned to one or more ads. +97112,The ad can't target both a whole country and also specific area codes within that same country. +97113,Browser is invalid. +97114,Operating System is invalid +97115,Hour of day is invalid +97116,Day of week is invalid +97117,The maximum width is 2000. Please check the width and try again. +97118,The maximum height is 2000. Please check the height and try again. +97119,The ad comments cannot exceed the 512 character limit. +97120,The ad can't be deleted because it is active. +97121,The ad can't be deleted because it has been activated in the past. +97122,The ad can't be deleted because it has already registered some impressions or clicks. +97123,This account doesn't permit tracking ads. Please check the ad type and try again. +97124,"Because this ad uses creative optimization, you can't change the rotation type from weighted. Please make sure that the rotation type is weighted and try again." +97125,One of the creative group assignments is invalid. +97126,One of the creative groups does not belong to the campaign. +97127,Each creative can be assigned only one creative group for each group number. +97128,Each ad can be assigned only one creative group for each group number. +97129,Creatives can't be associated with click trackers. Please check to make sure you're associating your creatives with the right ad. +97130,The name for this ad contains tab spaces. Please remove them and try again. +97131,Specify at least one placement for creative assignment. +97135,Trafficking sheet upload limit has been exceeded. Please upload up to 1000 assignments at a time. +97136,Number of active ads exceeds the maximum set for this account. +97137,The ad end date can't be more than 5 years from now. +97141,There was a problem with your request. We couldn't identify the ad you tried to copy. Please check the ID and try again. +97142,Ad can only be copied to a campaign under same advertiser. +97143,Default Ad can't be copied. +97144,You can't use custom URLs with Rich Media creatives whose code has been manually edited. +97145,The option specified for creative association with ad is not supported. +97146,There was a problem with your request. We couldn't identify the parameters to associate creative with ad. Please try again. +98000,The advertiser specified in the search criteria is not valid. +98001,The creative asset base directory not specified. +98002,The creative asset base directory cannot be found. +98003,The image creative asset base directory cannot be found. +98004,The Rich Media creative asset base directory cannot be found. +98005,The creative asset directory for the advertiser cannot be found. +98006,Error encountered while browsing the creative asset directory. +98007,The creative asset file could not be read. +98008,The creative asset supplied cannot be null. +98009,The name specified for the creative asset is not valid. +98010,The content specified for the creative asset is not valid. +98011,The creative asset is not of a valid image type. +98012,Another creative asset with the same name already exists. +98013,The advertiser specified in the creative asset is not valid. +98014,The creative asset's dimensions are not valid. +98015,The creative asset dimensions are not supported by the network. +98016,The image type is not supported. +98017,Executable files are not allowed. +98018,The creative asset exceeds the maximum image size allowed for this account. +98019,The creative search criteria cannot be null or empty. +98020,Either the advertiser or the campaign must be specified in the creative search criteria. +98021,The relative image asset URL is not valid. It is required and must refer a valid image asset for the advertiser. +98022,The image asset referred to by the image asset relative URL could not be found. +98023,The alternate text cannot exceed 1024 characters. +98024,The creative version is not valid. +98025,The rich media code for the creative is missing. +98026,The length of the rich media code exceeds the maximum allowed limit. +98027,The rich media code must contain the %i macro. +98028,The relative asset URL in the creative cannot be null or empty. +98029,One of the rich media assets specified in the creative could not be found. +98030,The redirect URL is not valid. It is required and cannot exceed 1024 characters. +98031,The redirect URL is not valid. It must start with http or https. +98032,The creative is assigned to a default ad and therefore cannot be deleted. Any default ad must have a creative. +98033,The creative cannot be deleted because one or more assignments have a creative time gap. +98034,The creative cannot be deleted because it is assigned to an ad that was active. +98035,One of the campaigns associated with the creative is not valid. +98036,The given creative IDs array to associate with the campaign cannot be null or empty. +98037,The creative type is not valid. +98038,An error was encountered while parsing the file. +98039,The raw file data is empty. +98040,The raw file name is not valid. +98041,The raw file mime-type is not valid. +98042,The mime-type for the raw file is not supported for creative upload. +98043,The zip file entry cannot be recognized as an image or a rich media file. +98044,The raw file set is null. +98045,The advertiser specified in the raw file set is not valid. +98046,The campaign specified in the raw file set is not valid. +98047,Either the advertiser or the campaign must be specified in the raw file set +98048,The raw file set does not contain any raw files. +98049,The parsed raw file set is null. +98050,The parsed raw file set does not contain any parsed raw files. +98051,Unable to read the flash file. +98052,The flash file is empty. +98053,The Flash-Banner rich media code template could not be found. +98054,The Flash-Banner creative can contain only one backup image. +98055,The Flash-Banner creative can contain only one flash asset. +98056,The creative is missing the backup image. +98057,The creative is missing the flash asset. +98058,The creative does not contain any assets. It must contain one flash asset and one backup image asset. +98059,The Flash-Banner with AdInisght Flex Tag rich media code template could not be found. +98060,"This is a default creative; therefore, it cannot be deleted. Assign another creative as a default before deleting the creative." +98061,The redirect URL is not valid. The format for an internal redirect URL is http://ad.doubleclick.net/ad/filelocation. +98062,Please specify a campaign default landing page before uploading creatives. +98063,"This file type isn't supported, or the file doesn't matched the specified file type. Only image files are supported." +98064,The dimensions of the creative can't be changed because it is marked as default in one of the campaigns. +98065,The dimensions of the creative can't be changed because it is assigned to one or more placements. +98066,The dimensions of the creative can't be changed because it is associated with one or more ads. +98067,The creative you are trying to delete is not a Rich Media creative. +98068,The Interstitial Pop-Up template can't be found. +98069,The interstitial pop-up type is not valid. +98070,The window width is not valid. Please specify a width greater than zero. +98071,The window height is not valid. Please specify a height greater than zero. +98072,The 'top' value is not valid. Please specify a value greater than or equal to zero. +98073,The 'left' value is not valid. Please specify a value greater than or equal to zero. +98074,The creative type is not valid. +98075,The name of a file can only contain the following characters: A-Z a-z 0-9 . = - _ +98076,"You're trying to upload more than 500KB at once. Try uploading fewer files at once, breaking up very large Zip files, or removing unnecessary files." +98077,"You can only upload 50 files at a time, including files within a Zip file. Try uploading fewer files at once, breaking up very large Zip files, or removing unnecessary files." +98078,The parent flash asset is not valid. +98079,The backup image asset is not valid. +98080,The backup image target window is not valid. +98081,The wmode setting is not valid. +98082,The fscommand option is not valid. +98083,The fscommand target window dimensions are not valid. +98084,One of the clickTag parameters is not valid. +98085,The backup image target window option is not valid. +98086,The backup image target window other option value is not valid. +98087,One of the additional flash assets is not valid +98088,One of the additional image assets is not valid +98089,Flash In-Page template can't be found. +98090,Flash In-Page template not specified. +98091,Flash In-Page creative is not valid. +98092,The given creative is not a valid DoubleClick Rich Media creative. +98093,The creative can't be deleted because it was assigned to an active ad. +98094,The flash asset and the backup image dimensions must match. +98095,A Creative for one of the Creative Field Assignment is not valid. +98096,A Creative Field for one of the Creative Field Assignment is not valid. +98097,A Creative Field of one of the Creative Field Assignments doesn't belong to same advertiser. +98098,Creative field values for one of the Creative Field Assignment is not valid. +98099,Creative name can't contain tab spaces. +98100,The creative can't be archived because it is marked as default in a campaign. +98101,The creative can't be archived because it is assigned to an active ad. +98102,The creative creation start date in creative search criteria is missing. +98103,The creative can't be deactivated because it's the only creative scheduled to be active during at least part of the run of at least one associated ad. +98104,The creative can't be deactivated because it's the only active creative in one or more ads. +98105,Invalid creative copy request. +98106,The creative upload session can't be null. +98107,The creative upload session was not found. +98108,You can't modify this creative upload session because it has been completed or canceled. +98109,"To create a creative upload session, you need to provide either an advertiser ID or a campaign ID." +98110,It looks like you're trying to associate this creative upload session with a different advertiser or campaign than the one you chose when the session was created. +98111,The creative upload file can't be null. +98112,A file name is required for the creative. +98113,A name is required for the creative source file. +98114,The creative file size must be greater than 0 KB. +98115,The creative dimensions couldn't be correctly read from the file you sent. Please check the file and try again. +98116,The base directory where the creative files are stored could not be found. This problem is usually temporary. Please try again later. +98117,We were unable to create the creatives in this upload session because the creative files haven't been specified. +98118,We couldn't find any creative files in this upload session. +98119,"To create a creative, provide either an image file or a Flash file with an image file as a backup." +98120,We couldn't find the Flash file you specified in this creative upload session. +98121,We couldn't find the Image file you specified in this creative upload session. +99000,The job is not of the correct type. +99001,The job could not be found. +99002,The job cannot be submitted for processing because it is already finished. Only pending or running jobs can be submitted for processing. +99003,The data given for the job is not valid. +99004,The type specified for the scheduled job is not valid. +99005,The campaign specified for the job is not valid. +99006,One of the sites specified for the tags job is not valid. +99007,The maximum allowed length of the email message body is 4000 characters. +99008,No output types have been specified for one of the sites in the tags job. Please specify at least one output type. +99009,One of the sites has an invalid recipient specified in the tags job. +99010,One of the site's recipient names exceeds the 255 character limit. +99011,The email address specified for one of the site's recipients is not valid. Each recipient must have a valid email address up to 255 characters in length. +99012,One of the placements specified for the tags job is not valid. +99013,The directory for storing the tag output files cannot be found or is not configured correctly. +99014,One of the placements specified for the Media Plan job is not valid. +99015,The directory for storing the Media Plan output files cannot be found or is not configured correctly. +99016,The template for generating the Media Plan output files cannot be found or is not configured correctly. +99017,The default from email address is not found. +99018,The placement specified for the job is invalid. +99019,The placement does not belong to the campaign for which the job is submitted. +99020,Ad ID is missing. +99021,The campaign specified in the job is not valid. +99022,The given job element is null. +99023,The job specified for the element is not valid. +99024,The given job placement object can't be null. +99025,The job specified for the placement is not valid. +99026,One of the site has invalid reply to email address. The reply to address must be valid email address with 255 characters in length. +99027,"To email tags to a site, you need to choose a filename format. Please check the filename format for each site and try again." +99028,The From address can't contain more than 255 characters. Please check the address and try again. +100000,File not found. +100001,The change log record can't be null. +100002,The criteria for searching change logs is not valid. It must specify object type and object IDs. +100003,The given change log is not valid. +100004,The change log record could not be found. +100005,The length of the comments is too long. Please enter up to 4000 characters. +100006,You are not authorized to access this change log record. +100007,This network does not allow changes to Rich Media events lookback windows. +100008,Modify campaign permission is not enabled. +100009,Modify media plan permission is not enabled. +100010,Modify Media Cost permission is not enabled. +100011,Modify Traffic Sheet permission is not enabled. +100012,Modify Ads permission is not enabled. +100013,Modify Ceatives permission is not enabled. +100014,Modify Advertisers permission is not enabled. +100015,Modify Spotlight permission is not enabled. +100016,Modify Advanced Report permission is not enabled. +100017,View tags permission is not enabled. +100018,Modify user role permission is not enabled. +100019,The GAIA email address is not valid. +100020,"Unable to read the spreadsheet. To convert it into a valid Excel file, please open the document in Excel, then save it." +100021,A user profile ID or profile name must be specified in the GAIA migration request. +100022,The rendering width is not valid. It must be greater than 0 with a maximum value of 65535. +100023,The rendering height is not valid. It must be greater than 0 with a maximum value of 65535. +100024,The In-Stream feature has not been enabled for this account. Contact Customer Support or go to http://help.doubleclick.com to log a support case. +100025,The Rich Media for Flash-in-Flash feature has not been enabled for this account. Contact Customer Support or go to http://help.doubleclick.com to log a support case. +100026,View User Roles permission is not enabled. +100027,The Advertiser Studio Client association feature has not been enabled for this network. Contact Customer Support or go to http://help.doubleclick.com to log a support case. +100028,Association between given studio client and advertiser already exists +100029,Studio client association removal failed +100030,Studio client association failed +100031,Network permission is not enabled for Advance Reach Report. +100032,Your user profile doesn't have permission to change account settings. Please contact your account administrator for help. +100033,Your user profile doesn't have permission to view account settings. Please contact your account administrator for help. +100036,"To enable Rich Media for Flash-in-Flash creatives, you first need to enable DoubleClick Rich Media for this account" +100037,The network is not a DFA network. Please try again with a DFA network. +100040,Your user profile doesn't have permission to upgrade campaigns. Please contact your account administrator for help. +100041,The support contact first name is required and has a maximum of 64 characters. +100042,The support contact last name is required and has a maximum of 64 characters. +100043,The support contact first name can't contain a pipe character (|). +100044,The support contact last name can't contain a pipe character (|). +100045,Your user profile doesn't have permission to create advertisers. Please contact your account administrator for help. +101000,The ad statuses cannot be null or empty. +101001,The site placements cannot be null or empty. +101002,The creatives to associate cannot be null or empty. +101003,The campaign to associate is not valid. +101004,The creative array is null or empty. +101005,The creative properties to update must be specified. +101006,The ad ID is not valid. +101007,The ad array is null or empty. +101008,You need to specify which ad properties are being updated. +101009,One of the properties specified is not supported. +101010,Size with the given dimensions already exists. +101011,The campaign array is null or empty. +101012,The campaign properties to update must be specified. +101013,The placement-assignment key specified for the overridable assignment properties is invalid. +101014,No overridable assignment properties found for the given placement and assignment combination. +101015,The given overridable assignment properties object can't be null. +101016,The placement array is null or empty. +101017,The value of the creative id is not valid. +101018,The creative ad association properties to update must be specified. +101019,One of the properties specified to update creative ad association is not supported. +110000,This user profile doesn't have access to the subaccount specified for this user role. +112001,Media order not found. +112002,We couldn't find an ID for this media order. +112003,The media order publisher ID needs to be a positive number. +112004,Media orders containing placements can't be deleted. +112005,Media order search criteria must include a campaign ID. +200005,There was a problem with the subaccount name. Make sure you entered a subaccount name that's no more than 128 characters. diff --git a/src/Dfa/Util/ApiCodes/CodeCsvs.Designer.cs b/src/Dfa/Util/ApiCodes/CodeCsvs.Designer.cs new file mode 100644 index 00000000000..a2c69421239 --- /dev/null +++ b/src/Dfa/Util/ApiCodes/CodeCsvs.Designer.cs @@ -0,0 +1,86 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.269 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Google.Api.Ads.Dfa.Util.ApiCodes { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class CodeCsvs { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal CodeCsvs() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Google.Api.Ads.Dfa.Util.ApiCodes.CodeCsvs", typeof(CodeCsvs).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to code,description + ///1,Internal error. + ///2,Invalid Parameter + ///3,Item doesn't exist. + ///4,Invalid username or password. + ///5,You are not authorized to perform this operation. + ///6,This functionality has not yet been implemented. + ///7,Your password has expired. + ///10,Error when using invoke method. + ///13,Invalid fields. + ///14,File already exists. + ///15,Error encountered while saving the file. + ///16,Error encountered while reading from the input stream. + ///17,Error encountered while sending email. + ///18,The mail server name is not conf [rest of string was truncated]";. + /// + internal static string ErrorCodes { + get { + return ResourceManager.GetString("ErrorCodes", resourceCulture); + } + } + } +} diff --git a/src/Dfa/Util/ApiCodes/CodeCsvs.resx b/src/Dfa/Util/ApiCodes/CodeCsvs.resx new file mode 100644 index 00000000000..0ff0e4a9b4c --- /dev/null +++ b/src/Dfa/Util/ApiCodes/CodeCsvs.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\..\Resources\ErrorCodes.csv;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + + \ No newline at end of file diff --git a/src/Dfa/Util/ApiCodes/ErrorCode.cs b/src/Dfa/Util/ApiCodes/ErrorCode.cs new file mode 100644 index 00000000000..e3b573bca8c --- /dev/null +++ b/src/Dfa/Util/ApiCodes/ErrorCode.cs @@ -0,0 +1,115 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfa.Util.ApiCodes; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.Dfa.Util { + /// + /// Represents an error code returned by DFA servers. + /// + [Serializable()] + public class ErrorCode { + /// + /// Error code. + /// + int code = 0; + + /// + /// Error description. + /// + string description = ""; + + /// + /// Map of all error codes. + /// + static Dictionary allCodes; + + /// + /// Gets or sets the error code. + /// + public int Code { + get { + return code; + } + set { + code = value; + } + } + + /// + /// Gets or sets the error description. + /// + public string Description { + get { + return description; + } + set { + description = value; + } + } + + /// + /// Static constructor. + /// + static ErrorCode() { + LoadErrorCodes(); + } + + /// + /// Default public constructor. + /// + public ErrorCode() : this(0, "") { + } + + /// + /// Parameterized constructor. + /// + /// The error code. + /// The error description. + public ErrorCode(int code, string description) { + this.code = code; + this.description = description; + } + + /// + /// Load all error codes into memory. + /// + private static void LoadErrorCodes() { + allCodes = new Dictionary(); + CsvFile reader = new CsvFile(); + reader.ReadFromString(CodeCsvs.ErrorCodes, true); + List retVal = new List(); + + foreach (string[] item in reader.Records) { + allCodes.Add(int.Parse(item[0]), new ErrorCode(int.Parse(item[0]), item[1])); + } + } + + /// + /// Gets an error code given the error number. + /// + /// Error number. + /// The error code. + public static ErrorCode FromCode(int code) { + return allCodes[code]; + } + } +} diff --git a/src/Dfa/Util/LoginUtil.cs b/src/Dfa/Util/LoginUtil.cs new file mode 100644 index 00000000000..94b02005118 --- /dev/null +++ b/src/Dfa/Util/LoginUtil.cs @@ -0,0 +1,104 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Dfa.Lib; + +namespace Google.Api.Ads.Dfa.Util { + /// + /// Utility class to assist in generating login token. + /// + public class LoginUtil { + /// + /// The login token cache. + /// + private static LoginTokenCache tokenCache = new DefaultLoginTokenCache(); + + /// + /// Gets or sets the cache. + /// + public static LoginTokenCache Cache { + get { + return LoginUtil.tokenCache; + } + set { + LoginUtil.tokenCache = value; + } + } + + /// + /// Gets a login token for authenticating DFA API calls. + /// + /// The user for which token is generated. + /// The service version. + /// A token which may be used for future API calls. + public static UserToken GetAuthenticationToken(AdsUser user, string serviceVersion) { + DfaAppConfig config = (DfaAppConfig) user.Config; + + if (string.IsNullOrEmpty(config.DfaUserName)) { + throw new ArgumentNullException(DfaErrorMessages.UserNameCannotBeEmpty); + } + + UserToken userToken = tokenCache.GetToken(config.DfaUserName); + + if (userToken == null) { + lock (typeof(LoginUtil)) { + userToken = tokenCache.GetToken(config.DfaUserName); + if (userToken == null) { + userToken = GenerateAuthenticationToken(user, serviceVersion); + tokenCache.AddToken(config.DfaUserName, userToken); + } + } + } + return userToken; + } + + /// + /// Generates a login token for authenticating DFA API calls. + /// + /// The user for which token is generated. + /// The service version. + /// A token which may be used for future API calls. + private static UserToken GenerateAuthenticationToken(AdsUser user, string serviceVersion) { + DfaAppConfig config = (DfaAppConfig) user.Config; + if (!String.IsNullOrEmpty(config.DfaAuthToken)) { + return new UserToken(config.DfaUserName, config.DfaAuthToken); + } + if (config.AuthorizationMethod == DfaAuthorizationMethod.LoginService) { + if (string.IsNullOrEmpty(config.DfaUserName)) { + throw new ArgumentNullException(DfaErrorMessages.UserNameCannotBeEmpty); + } + if (string.IsNullOrEmpty(config.DfaPassword)) { + throw new ArgumentNullException(DfaErrorMessages.PasswordCannotBeEmpty); + } + } + try { + DfaServiceSignature loginServiceSignature = new DfaServiceSignature(serviceVersion, + "LoginRemoteService"); + AdsClient loginService = user.GetService(loginServiceSignature, config.DfaApiServer); + object userProfile = loginService.GetType().GetMethod("authenticate").Invoke( + loginService, new object[] {config.DfaUserName, config.DfaPassword}); + return new UserToken( + userProfile.GetType().GetProperty("name").GetValue(userProfile, null).ToString(), + userProfile.GetType().GetProperty("token").GetValue(userProfile, null).ToString()); + } catch (Exception ex) { + throw new DfaException("Failed to authenticate user. See inner exception for details.", ex); + } + } + } +} diff --git a/src/Dfa/v1_19/DfaApi.cs b/src/Dfa/v1_19/DfaApi.cs new file mode 100644 index 00000000000..9d6d14d296d --- /dev/null +++ b/src/Dfa/v1_19/DfaApi.cs @@ -0,0 +1,11267 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +namespace Google.Api.Ads.Dfa.v1_19 { + using Google.Api.Ads.Dfa.Lib; + + using System; + using System.ComponentModel; + using System.Diagnostics; + using System.Xml.Serialization; + using System.Web.Services; + using System.Web.Services.Protocols; + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "loginSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class LoginRemoteService : DfaSoapClient { + public LoginRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.19/api/dfa-api/login"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("authenticateReturn")] + public UserProfile authenticate(string username, string password) { + object[] results = this.Invoke("authenticate", new object[] {username, password}); + return ((UserProfile) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("impersonateUserReturn")] + public UserProfile impersonateUser(string username, string token, string userToImpersonate) { + object[] results = this.Invoke("impersonateUser", new object[] {username, token, userToImpersonate}); + return ((UserProfile) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("impersonateNetworkReturn")] + public UserProfile impersonateNetwork(string username, string token, long networkId) { + object[] results = this.Invoke("impersonateNetwork", new object[] {username, token, networkId}); + return ((UserProfile) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("changePasswordReturn")] + public UserProfile changePassword(ChangePasswordRequest changePasswordRequest) { + object[] results = this.Invoke("changePassword", new object[] {changePasswordRequest}); + return ((UserProfile) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class UserProfile : UserBase { + private System.DateTime? lastAccessTimeField; + + private string networkNameField; + + private string tokenField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? lastAccessTime { + get { return this.lastAccessTimeField; } + set { this.lastAccessTimeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string networkName { + get { return this.networkNameField; } + set { this.networkNameField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string token { + get { return this.tokenField; } + set { this.tokenField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(UserProfile))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public abstract partial class UserBase : Base { + private bool activeField; + + private bool apiUserField; + + private string emailField; + + private long languageIdField; + + private long networkIdField; + + private string passwordField; + + private long subnetworkIdField; + + private long userGroupIdField; + + private long userLevelIdField; + + public bool active { + get { return this.activeField; } + set { this.activeField = value; } + } + + public bool apiUser { + get { return this.apiUserField; } + set { this.apiUserField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public long languageId { + get { return this.languageIdField; } + set { this.languageIdField = value; } + } + + public long networkId { + get { return this.networkIdField; } + set { this.networkIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string password { + get { return this.passwordField; } + set { this.passwordField = value; } + } + + public long subnetworkId { + get { return this.subnetworkIdField; } + set { this.subnetworkIdField = value; } + } + + public long userGroupId { + get { return this.userGroupIdField; } + set { this.userGroupIdField = value; } + } + + public long userLevelId { + get { return this.userLevelIdField; } + set { this.userLevelIdField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(UserBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(UserProfile))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public abstract partial class Base { + private long idField; + + private string nameField; + + private ApiException dummyExceptionField; + + public long id { + get { return this.idField; } + set { this.idField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ApiException dummyException { + get { return this.dummyExceptionField; } + set { this.dummyExceptionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ApiException { + private long errorCodeField; + + private string errorMessageField; + + private string messageField; + + public long errorCode { + get { return this.errorCodeField; } + set { this.errorCodeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string message { + get { return this.messageField; } + set { this.messageField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ChangePasswordRequest { + private string confirmPasswordField; + + private string newPasswordField; + + private string oldPasswordField; + + private string tokenField; + + private string usernameField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string confirmPassword { + get { return this.confirmPasswordField; } + set { this.confirmPasswordField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string newPassword { + get { return this.newPasswordField; } + set { this.newPasswordField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string oldPassword { + get { return this.oldPasswordField; } + set { this.oldPasswordField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string token { + get { return this.tokenField; } + set { this.tokenField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string username { + get { return this.usernameField; } + set { this.usernameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "networkSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class NetworkRemoteService : DfaSoapClient { + public NetworkRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.19/api/dfa-api/network"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getNetworkReturn")] + public Network getNetwork(long networkId) { + object[] results = this.Invoke("getNetwork", new object[] {networkId}); + return ((Network) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public void executeAgreement(long agreementId) { + this.Invoke("executeAgreement", new object[] {agreementId}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getAgreementsReturn")] + public AgreementRecordSet getAgreements(AgreementSearchCriteria criteria) { + object[] results = this.Invoke("getAgreements", new object[] {criteria}); + return ((AgreementRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getCurrenciesReturn")] + public Currency[] getCurrencies() { + object[] results = this.Invoke("getCurrencies", new object[0]); + return ((Currency[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getNetworksReturn")] + public NetworkRecordSet getNetworks(NetworkSearchCriteria networkSearchCriteria) { + object[] results = this.Invoke("getNetworks", new object[] {networkSearchCriteria}); + return ((NetworkRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("saveNetworkReturn")] + public NetworkSaveResult saveNetwork(Network network) { + object[] results = this.Invoke("saveNetwork", new object[] {network}); + return ((NetworkSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getLanguageEncodingListReturn")] + public LanguageEncoding[] getLanguageEncodingList() { + object[] results = this.Invoke("getLanguageEncodingList", new object[0]); + return ((LanguageEncoding[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getTimeZoneListReturn")] + public TimeZone[] getTimeZoneList() { + object[] results = this.Invoke("getTimeZoneList", new object[0]); + return ((TimeZone[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getAllPermissionsReturn")] + public Permission[] getAllPermissions() { + object[] results = this.Invoke("getAllPermissions", new object[0]); + return ((Permission[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getAllNetworkPermissionsReturn")] + public NetworkPermission[] getAllNetworkPermissions() { + object[] results = this.Invoke("getAllNetworkPermissions", new object[0]); + return ((NetworkPermission[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getAssignedNetworkPermissionsReturn")] + public NetworkPermission[] getAssignedNetworkPermissions(long networkId) { + object[] results = this.Invoke("getAssignedNetworkPermissions", new object[] {networkId}); + return ((NetworkPermission[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getAdministratorPermissionsReturn")] + public AdministratorPermission[] getAdministratorPermissions() { + object[] results = this.Invoke("getAdministratorPermissions", new object[0]); + return ((AdministratorPermission[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("uploadNetworkWidgetImageReturn")] + public WidgetImageUploadResponse uploadNetworkWidgetImage(WidgetImageUploadRequest request) { + object[] results = this.Invoke("uploadNetworkWidgetImage", new object[] {request}); + return ((WidgetImageUploadResponse) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class Network : NetworkBase { + private string abbreviationField; + + private bool activeField; + + private int activeAdsLimitField; + + private int availableAdsField; + + private long[] availablePermissionsField; + + private string countryField; + + private long currencyField; + + private long defaultCreativeSizeField; + + private long defaultEncodingField; + + private long defaultLanguageField; + + private string descriptionField; + + private FrequencyCapGroup[] frequencyCapGroupsField; + + private int loginAttemptsField; + + private long maximumImageSizeField; + + private int minimumPasswordLengthField; + + private long[] networkPermissionsField; + + private string notificationEmailAddressField; + + private long passwordExpirePeriodField; + + private long reportGenerationTimeZoneField; + + private ReportsConfiguration reportsConfigurationField; + + private RichMediaNetworkConfiguration richmediaNetworkConfigField; + + private int totalActiveAdsField; + + private WidgetNetworkConfig widgetNetworkConfigField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string abbreviation { + get { return this.abbreviationField; } + set { this.abbreviationField = value; } + } + + public bool active { + get { return this.activeField; } + set { this.activeField = value; } + } + + public int activeAdsLimit { + get { return this.activeAdsLimitField; } + set { this.activeAdsLimitField = value; } + } + + public int availableAds { + get { return this.availableAdsField; } + set { this.availableAdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] availablePermissions { + get { return this.availablePermissionsField; } + set { this.availablePermissionsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string country { + get { return this.countryField; } + set { this.countryField = value; } + } + + public long currency { + get { return this.currencyField; } + set { this.currencyField = value; } + } + + public long defaultCreativeSize { + get { return this.defaultCreativeSizeField; } + set { this.defaultCreativeSizeField = value; } + } + + public long defaultEncoding { + get { return this.defaultEncodingField; } + set { this.defaultEncodingField = value; } + } + + public long defaultLanguage { + get { return this.defaultLanguageField; } + set { this.defaultLanguageField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public FrequencyCapGroup[] frequencyCapGroups { + get { return this.frequencyCapGroupsField; } + set { this.frequencyCapGroupsField = value; } + } + + public int loginAttempts { + get { return this.loginAttemptsField; } + set { this.loginAttemptsField = value; } + } + + public long maximumImageSize { + get { return this.maximumImageSizeField; } + set { this.maximumImageSizeField = value; } + } + + public int minimumPasswordLength { + get { return this.minimumPasswordLengthField; } + set { this.minimumPasswordLengthField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] networkPermissions { + get { return this.networkPermissionsField; } + set { this.networkPermissionsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string notificationEmailAddress { + get { return this.notificationEmailAddressField; } + set { this.notificationEmailAddressField = value; } + } + + public long passwordExpirePeriod { + get { return this.passwordExpirePeriodField; } + set { this.passwordExpirePeriodField = value; } + } + + public long reportGenerationTimeZone { + get { return this.reportGenerationTimeZoneField; } + set { this.reportGenerationTimeZoneField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ReportsConfiguration reportsConfiguration { + get { return this.reportsConfigurationField; } + set { this.reportsConfigurationField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaNetworkConfiguration richmediaNetworkConfig { + get { return this.richmediaNetworkConfigField; } + set { this.richmediaNetworkConfigField = value; } + } + + public int totalActiveAds { + get { return this.totalActiveAdsField; } + set { this.totalActiveAdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public WidgetNetworkConfig widgetNetworkConfig { + get { return this.widgetNetworkConfigField; } + set { this.widgetNetworkConfigField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class FrequencyCapGroup : FrequencyCapGroupBase { + private long? durationField; + + private long? impressionsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long? duration { + get { return this.durationField; } + set { this.durationField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long? impressions { + get { return this.impressionsField; } + set { this.impressionsField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(FrequencyCapGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class FrequencyCapGroupBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class WidgetImageUploadResponse { + private double imageSizeField; + + private string relativeImageUrlField; + + private string staticDataUrlField; + + public double imageSize { + get { return this.imageSizeField; } + set { this.imageSizeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string relativeImageUrl { + get { return this.relativeImageUrlField; } + set { this.relativeImageUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string staticDataUrl { + get { return this.staticDataUrlField; } + set { this.staticDataUrlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class WidgetImageUploadRequest { + private long campaignField; + + private byte[] filedataField; + + private string filenameField; + + private long networkField; + + private bool networkWidgetImageUploadField; + + private string profileField; + + public long campaign { + get { return this.campaignField; } + set { this.campaignField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(DataType = "base64Binary", IsNullable = true)] + public byte[] filedata { + get { return this.filedataField; } + set { this.filedataField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string filename { + get { return this.filenameField; } + set { this.filenameField = value; } + } + + public long network { + get { return this.networkField; } + set { this.networkField = value; } + } + + public bool networkWidgetImageUpload { + get { return this.networkWidgetImageUploadField; } + set { this.networkWidgetImageUploadField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string profile { + get { return this.profileField; } + set { this.profileField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(NetworkSaveResult))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public abstract partial class SaveResult { + private long idField; + + public long id { + get { return this.idField; } + set { this.idField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class NetworkSaveResult : SaveResult { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(NetworkRecordSet))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public abstract partial class PagedRecordSet { + private int pageNumberField; + + private int totalNumberOfPagesField; + + private int totalNumberOfRecordsField; + + public int pageNumber { + get { return this.pageNumberField; } + set { this.pageNumberField = value; } + } + + public int totalNumberOfPages { + get { return this.totalNumberOfPagesField; } + set { this.totalNumberOfPagesField = value; } + } + + public int totalNumberOfRecords { + get { return this.totalNumberOfRecordsField; } + set { this.totalNumberOfRecordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class NetworkRecordSet : PagedRecordSet { + private Network[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Network[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AgreementRecordSet { + private Agreement[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Agreement[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class Agreement : Base { + private string descriptionField; + + private string emailAddressField; + + private bool executedField; + + private System.DateTime? executionDateField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string emailAddress { + get { return this.emailAddressField; } + set { this.emailAddressField = value; } + } + + public bool executed { + get { return this.executedField; } + set { this.executedField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? executionDate { + get { return this.executionDateField; } + set { this.executionDateField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SortOrder { + private bool descendingField; + + private string fieldNameField; + + public bool descending { + get { return this.descendingField; } + set { this.descendingField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string fieldName { + get { return this.fieldNameField; } + set { this.fieldNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ActiveFilter { + private bool activeOnlyField; + + private bool inactiveOnlyField; + + public bool activeOnly { + get { return this.activeOnlyField; } + set { this.activeOnlyField = value; } + } + + public bool inactiveOnly { + get { return this.inactiveOnlyField; } + set { this.inactiveOnlyField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PageableSearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(NetworkSearchCriteria))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(AgreementSearchCriteria))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public abstract partial class SearchCriteriaBase { + private long[] idsField; + + private string searchStringField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] ids { + get { return this.idsField; } + set { this.idsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string searchString { + get { return this.searchStringField; } + set { this.searchStringField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(NetworkSearchCriteria))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public abstract partial class PageableSearchCriteriaBase : SearchCriteriaBase { + private int pageNumberField; + + private int pageSizeField; + + public int pageNumber { + get { return this.pageNumberField; } + set { this.pageNumberField = value; } + } + + public int pageSize { + get { return this.pageSizeField; } + set { this.pageSizeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class NetworkSearchCriteria : PageableSearchCriteriaBase { + private ActiveFilter activeFilterField; + + private SortOrder sortOrderField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ActiveFilter activeFilter { + get { return this.activeFilterField; } + set { this.activeFilterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AgreementSearchCriteria : SearchCriteriaBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class WidgetNetworkConfig { + private bool activeField; + + private double imageSizeField; + + private string imageUrlField; + + private string staticDataURLField; + + public bool active { + get { return this.activeField; } + set { this.activeField = value; } + } + + public double imageSize { + get { return this.imageSizeField; } + set { this.imageSizeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string imageUrl { + get { return this.imageUrlField; } + set { this.imageUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string staticDataURL { + get { return this.staticDataURLField; } + set { this.staticDataURLField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class BillingCustomer { + private string accessCodeTypeField; + + private bool activeField; + + private string billingCodeField; + + private System.DateTime? expirationDateField; + + private bool publisherField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string accessCodeType { + get { return this.accessCodeTypeField; } + set { this.accessCodeTypeField = value; } + } + + public bool active { + get { return this.activeField; } + set { this.activeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string billingCode { + get { return this.billingCodeField; } + set { this.billingCodeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? expirationDate { + get { return this.expirationDateField; } + set { this.expirationDateField = value; } + } + + public bool publisher { + get { return this.publisherField; } + set { this.publisherField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaNetworkConfiguration { + private BillingCustomer billingCustomerField; + + private long changeUserIdField; + + private long customerIdField; + + private System.DateTime? dateAssignedField; + + private long networkField; + + private long teaserSizeLimitField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public BillingCustomer billingCustomer { + get { return this.billingCustomerField; } + set { this.billingCustomerField = value; } + } + + public long changeUserId { + get { return this.changeUserIdField; } + set { this.changeUserIdField = value; } + } + + public long customerId { + get { return this.customerIdField; } + set { this.customerIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? dateAssigned { + get { return this.dateAssignedField; } + set { this.dateAssignedField = value; } + } + + public long network { + get { return this.networkField; } + set { this.networkField = value; } + } + + public long teaserSizeLimit { + get { return this.teaserSizeLimitField; } + set { this.teaserSizeLimitField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ReachReportConfiguration { + private bool adTypeFrequencyAndReachField; + + private bool pageLevelFrequencyField; + + private bool placementFrequencyField; + + private bool siteLevelFrequencyField; + + public bool adTypeFrequencyAndReach { + get { return this.adTypeFrequencyAndReachField; } + set { this.adTypeFrequencyAndReachField = value; } + } + + public bool pageLevelFrequency { + get { return this.pageLevelFrequencyField; } + set { this.pageLevelFrequencyField = value; } + } + + public bool placementFrequency { + get { return this.placementFrequencyField; } + set { this.placementFrequencyField = value; } + } + + public bool siteLevelFrequency { + get { return this.siteLevelFrequencyField; } + set { this.siteLevelFrequencyField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class LookbackConfiguration { + private int clickDurationField; + + private int postImpressionActivitiesDurationField; + + private int reportsDaysField; + + private int richMediaEventsDaysField; + + public int clickDuration { + get { return this.clickDurationField; } + set { this.clickDurationField = value; } + } + + public int postImpressionActivitiesDuration { + get { return this.postImpressionActivitiesDurationField; } + set { this.postImpressionActivitiesDurationField = value; } + } + + public int reportsDays { + get { return this.reportsDaysField; } + set { this.reportsDaysField = value; } + } + + public int richMediaEventsDays { + get { return this.richMediaEventsDaysField; } + set { this.richMediaEventsDaysField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ExposureToConversionConfiguration { + private int activitiesToTrackField; + + private bool exposureToConversionEnabledField; + + private int exposuresToTrackField; + + public int activitiesToTrack { + get { return this.activitiesToTrackField; } + set { this.activitiesToTrackField = value; } + } + + public bool exposureToConversionEnabled { + get { return this.exposureToConversionEnabledField; } + set { this.exposureToConversionEnabledField = value; } + } + + public int exposuresToTrack { + get { return this.exposuresToTrackField; } + set { this.exposuresToTrackField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AdvancedReportsConfiguration { + private int crossSiteDuplicationField; + + private int frequencyToConversionField; + + private int timeLagToConversionField; + + public int crossSiteDuplication { + get { return this.crossSiteDuplicationField; } + set { this.crossSiteDuplicationField = value; } + } + + public int frequencyToConversion { + get { return this.frequencyToConversionField; } + set { this.frequencyToConversionField = value; } + } + + public int timeLagToConversion { + get { return this.timeLagToConversionField; } + set { this.timeLagToConversionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ReportsConfiguration { + private AdvancedReportsConfiguration advancedReportsConfigurationField; + + private ExposureToConversionConfiguration exposureToConversionConfigurationField; + + private LookbackConfiguration lookbackConfigurationField; + + private int minimumClickRateField; + + private int minimumClicksField; + + private int minimumDaysField; + + private int minimumImpressionsField; + + private ReachReportConfiguration reachReportConfigurationField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public AdvancedReportsConfiguration advancedReportsConfiguration { + get { return this.advancedReportsConfigurationField; } + set { this.advancedReportsConfigurationField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ExposureToConversionConfiguration exposureToConversionConfiguration { + get { return this.exposureToConversionConfigurationField; } + set { this.exposureToConversionConfigurationField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public LookbackConfiguration lookbackConfiguration { + get { return this.lookbackConfigurationField; } + set { this.lookbackConfigurationField = value; } + } + + public int minimumClickRate { + get { return this.minimumClickRateField; } + set { this.minimumClickRateField = value; } + } + + public int minimumClicks { + get { return this.minimumClicksField; } + set { this.minimumClicksField = value; } + } + + public int minimumDays { + get { return this.minimumDaysField; } + set { this.minimumDaysField = value; } + } + + public int minimumImpressions { + get { return this.minimumImpressionsField; } + set { this.minimumImpressionsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ReachReportConfiguration reachReportConfiguration { + get { return this.reachReportConfigurationField; } + set { this.reachReportConfigurationField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(NetworkPermissionGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class NetworkPermissionGroupBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class NetworkPermissionGroup : NetworkPermissionGroupBase { + private int displayOrderField; + + public int displayOrder { + get { return this.displayOrderField; } + set { this.displayOrderField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(NetworkPermission))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class NetworkPermissionBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class NetworkPermission : NetworkPermissionBase { + private NetworkPermissionGroup permissionGroupField; + + private string shortNameField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public NetworkPermissionGroup permissionGroup { + get { return this.permissionGroupField; } + set { this.permissionGroupField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string shortName { + get { return this.shortNameField; } + set { this.shortNameField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PermissionGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PermissionGroupBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PermissionGroup : PermissionGroupBase { + private long displayOrderField; + + public long displayOrder { + get { return this.displayOrderField; } + set { this.displayOrderField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(AdministratorPermission))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Permission))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PermissionBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AdministratorPermission : PermissionBase { + private int accessLevelField; + + public int accessLevel { + get { return this.accessLevelField; } + set { this.accessLevelField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class Permission : PermissionBase { + private long displayOrderField; + + private PermissionGroup permissionGroupField; + + private string permissionStringField; + + public long displayOrder { + get { return this.displayOrderField; } + set { this.displayOrderField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PermissionGroup permissionGroup { + get { return this.permissionGroupField; } + set { this.permissionGroupField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string permissionString { + get { return this.permissionStringField; } + set { this.permissionStringField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class TimeZone : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class LanguageEncoding : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class Currency : Base { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Network))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class NetworkBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "placementSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PlacementTagInfo))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(ClickCommandInfo))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PlacementTagCriteria))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaExitOverride))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(BrowserVersion))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(AreaCode))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PlacementAssignment))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SpotlightActivityWeight))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(TagSettingsBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PricingPeriod))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class PlacementRemoteService : DfaSoapClient { + public PlacementRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.19/api/dfa-api/placement"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getPlacementTypesReturn")] + public PlacementType[] getPlacementTypes() { + object[] results = this.Invoke("getPlacementTypes", new object[0]); + return ((PlacementType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getPricingTypesReturn")] + public PricingType[] getPricingTypes() { + object[] results = this.Invoke("getPricingTypes", new object[0]); + return ((PricingType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getPlacementReturn")] + public Placement getPlacement(long id) { + object[] results = this.Invoke("getPlacement", new object[] {id}); + return ((Placement) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("savePlacementReturn")] + public PlacementSaveResult savePlacement(Placement placement) { + object[] results = this.Invoke("savePlacement", new object[] {placement}); + return ((PlacementSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public void deletePlacement(long id) { + this.Invoke("deletePlacement", new object[] {id}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getPlacementGroupReturn")] + public PlacementGroup getPlacementGroup(long id) { + object[] results = this.Invoke("getPlacementGroup", new object[] {id}); + return ((PlacementGroup) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("savePlacementGroupReturn")] + public PlacementGroupSaveResult savePlacementGroup(PlacementGroup placementGroup) { + object[] results = this.Invoke("savePlacementGroup", new object[] {placementGroup}); + return ((PlacementGroupSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public void deletePlacementGroup(long id) { + this.Invoke("deletePlacementGroup", new object[] {id}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getPlacementGroupTypesReturn")] + public PlacementGroupType[] getPlacementGroupTypes() { + object[] results = this.Invoke("getPlacementGroupTypes", new object[0]); + return ((PlacementGroupType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getPlacementTagDataReturn")] + public PlacementTagData getPlacementTagData(long campaignId, PlacementTagCriteria[] placementTagCriterias) { + object[] results = this.Invoke("getPlacementTagData", new object[] {campaignId, placementTagCriterias}); + return ((PlacementTagData) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getRegularPlacementTagOptionsReturn")] + public PlacementTagOption[] getRegularPlacementTagOptions() { + object[] results = this.Invoke("getRegularPlacementTagOptions", new object[0]); + return ((PlacementTagOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getMobilePlacementTagOptionsReturn")] + public PlacementTagOption[] getMobilePlacementTagOptions() { + object[] results = this.Invoke("getMobilePlacementTagOptions", new object[0]); + return ((PlacementTagOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getInterstitialPlacementTagOptionsReturn")] + public PlacementTagOption[] getInterstitialPlacementTagOptions() { + object[] results = this.Invoke("getInterstitialPlacementTagOptions", new object[0]); + return ((PlacementTagOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getInStreamVideoPlacementTagOptionsReturn")] + public PlacementTagOption[] getInStreamVideoPlacementTagOptions() { + object[] results = this.Invoke("getInStreamVideoPlacementTagOptions", new object[0]); + return ((PlacementTagOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getPlacementsByCriteriaReturn")] + public PlacementRecordSet getPlacementsByCriteria(PlacementSearchCriteria searchCriteria) { + object[] results = this.Invoke("getPlacementsByCriteria", new object[] {searchCriteria}); + return ((PlacementRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getPlacementGroupsByCriteriaReturn")] + public PlacementGroupRecordSet getPlacementGroupsByCriteria(PlacementGroupSearchCriteria searchCriteria) { + object[] results = this.Invoke("getPlacementGroupsByCriteria", new object[] {searchCriteria}); + return ((PlacementGroupRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("updatePlacementsReturn")] + public PlacementUpdateResultSet updatePlacements(PlacementUpdateRequest request) { + object[] results = this.Invoke("updatePlacements", new object[] {request}); + return ((PlacementUpdateResultSet) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementUpdateResultSet { + private bool inErrorField; + + private PlacementUpdateResult[] resultField; + + public bool inError { + get { return this.inErrorField; } + set { this.inErrorField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PlacementUpdateResult[] result { + get { return this.resultField; } + set { this.resultField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementUpdateResult : SaveResult { + private string errorMessageField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementGroupSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementUpdateRequest { + private long campaignIdField; + + private System.DateTime? endDateField; + + private int flightingOptionField; + + private System.DateTime? startDateField; + + private int updateOptionField; + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + public int flightingOption { + get { return this.flightingOptionField; } + set { this.flightingOptionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public int updateOption { + get { return this.updateOptionField; } + set { this.updateOptionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementGroupRecordSet : PagedRecordSet { + private PlacementGroup[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PlacementGroup[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementGroup : PlacementGroupBase { + private bool archivedField; + + private long campaignIdField; + + private string commentsField; + + private long contentCategoryIdField; + + private long dfaSiteIdField; + + private int placementGroupTypeField; + + private long[] placementIdsField; + + private long placementStrategyIdField; + + private PricingSchedule pricingScheduleField; + + private long primaryPlacementIdField; + + private long siteIdField; + + public bool archived { + get { return this.archivedField; } + set { this.archivedField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string comments { + get { return this.commentsField; } + set { this.commentsField = value; } + } + + public long contentCategoryId { + get { return this.contentCategoryIdField; } + set { this.contentCategoryIdField = value; } + } + + public long dfaSiteId { + get { return this.dfaSiteIdField; } + set { this.dfaSiteIdField = value; } + } + + public int placementGroupType { + get { return this.placementGroupTypeField; } + set { this.placementGroupTypeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] placementIds { + get { return this.placementIdsField; } + set { this.placementIdsField = value; } + } + + public long placementStrategyId { + get { return this.placementStrategyIdField; } + set { this.placementStrategyIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PricingSchedule pricingSchedule { + get { return this.pricingScheduleField; } + set { this.pricingScheduleField = value; } + } + + public long primaryPlacementId { + get { return this.primaryPlacementIdField; } + set { this.primaryPlacementIdField = value; } + } + + public long siteId { + get { return this.siteIdField; } + set { this.siteIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PricingSchedule { + private int capCostOptionField; + + private System.DateTime? endDateField; + + private bool flightedField; + + private PricingPeriod[] pricingPeriodsField; + + private int pricingTypeField; + + private System.DateTime? startDateField; + + private System.DateTime? testingStartDateField; + + public int capCostOption { + get { return this.capCostOptionField; } + set { this.capCostOptionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + public bool flighted { + get { return this.flightedField; } + set { this.flightedField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PricingPeriod[] pricingPeriods { + get { return this.pricingPeriodsField; } + set { this.pricingPeriodsField = value; } + } + + public int pricingType { + get { return this.pricingTypeField; } + set { this.pricingTypeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? testingStartDate { + get { return this.testingStartDateField; } + set { this.testingStartDateField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PricingPeriod { + private string commentsField; + + private System.DateTime? endDateField; + + private double rateOrCostField; + + private System.DateTime? startDateField; + + private long unitsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string comments { + get { return this.commentsField; } + set { this.commentsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + public double rateOrCost { + get { return this.rateOrCostField; } + set { this.rateOrCostField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public long units { + get { return this.unitsField; } + set { this.unitsField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PlacementGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementGroupBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementRecordSet : PagedRecordSet { + private Placement[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Placement[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class Placement : PlacementBase { + private bool archivedField; + + private long campaignIdField; + + private string commentsField; + + private long contentCategoryIdField; + + private long dfaSiteIdField; + + private LookbackWindow lookbackWindowField; + + private bool paymentAcceptedField; + + private long placementGroupIdField; + + private long placementStrategyIdField; + + private int placementTypeField; + + private PricingSchedule pricingScheduleField; + + private long siteIdField; + + private long sizeIdField; + + private TagSettings tagSettingsField; + + public bool archived { + get { return this.archivedField; } + set { this.archivedField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string comments { + get { return this.commentsField; } + set { this.commentsField = value; } + } + + public long contentCategoryId { + get { return this.contentCategoryIdField; } + set { this.contentCategoryIdField = value; } + } + + public long dfaSiteId { + get { return this.dfaSiteIdField; } + set { this.dfaSiteIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public LookbackWindow lookbackWindow { + get { return this.lookbackWindowField; } + set { this.lookbackWindowField = value; } + } + + public bool paymentAccepted { + get { return this.paymentAcceptedField; } + set { this.paymentAcceptedField = value; } + } + + public long placementGroupId { + get { return this.placementGroupIdField; } + set { this.placementGroupIdField = value; } + } + + public long placementStrategyId { + get { return this.placementStrategyIdField; } + set { this.placementStrategyIdField = value; } + } + + public int placementType { + get { return this.placementTypeField; } + set { this.placementTypeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PricingSchedule pricingSchedule { + get { return this.pricingScheduleField; } + set { this.pricingScheduleField = value; } + } + + public long siteId { + get { return this.siteIdField; } + set { this.siteIdField = value; } + } + + public long sizeId { + get { return this.sizeIdField; } + set { this.sizeIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public TagSettings tagSettings { + get { return this.tagSettingsField; } + set { this.tagSettingsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class LookbackWindow { + private int postClickEventLookbackWindowField; + + private int postImpressionEventLookbackWindowField; + + private int richMediaEventLookbackWindowField; + + public int postClickEventLookbackWindow { + get { return this.postClickEventLookbackWindowField; } + set { this.postClickEventLookbackWindowField = value; } + } + + public int postImpressionEventLookbackWindow { + get { return this.postImpressionEventLookbackWindowField; } + set { this.postImpressionEventLookbackWindowField = value; } + } + + public int richMediaEventLookbackWindow { + get { return this.richMediaEventLookbackWindowField; } + set { this.richMediaEventLookbackWindowField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class TagSettings : TagSettingsBase { + private int[] tagTypesField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public int[] tagTypes { + get { return this.tagTypesField; } + set { this.tagTypesField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(TagSettings))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class TagSettingsBase { + private string additionalKeyValuesField; + + private bool includeClickTrackingStringInTagsField; + + private int keywordHandlingOptionField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string additionalKeyValues { + get { return this.additionalKeyValuesField; } + set { this.additionalKeyValuesField = value; } + } + + public bool includeClickTrackingStringInTags { + get { return this.includeClickTrackingStringInTagsField; } + set { this.includeClickTrackingStringInTagsField = value; } + } + + public int keywordHandlingOption { + get { return this.keywordHandlingOptionField; } + set { this.keywordHandlingOptionField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Placement))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class DateInterval { + private System.DateTime? endDateField; + + private System.DateTime? startDateField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementGroupSearchCriteria : PageableSearchCriteriaBase { + private ActiveFilter archiveFilterField; + + private long[] campaignIdsField; + + private long[] dfaSiteIdsField; + + private DateInterval endDateRangeField; + + private int placementGroupFilterField; + + private long[] placementStrategyIdsField; + + private long[] pricingTypeIdsField; + + private long[] siteIdsField; + + private SortOrder sortOrderField; + + private DateInterval startDateRangeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ActiveFilter archiveFilter { + get { return this.archiveFilterField; } + set { this.archiveFilterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] dfaSiteIds { + get { return this.dfaSiteIdsField; } + set { this.dfaSiteIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DateInterval endDateRange { + get { return this.endDateRangeField; } + set { this.endDateRangeField = value; } + } + + public int placementGroupFilter { + get { return this.placementGroupFilterField; } + set { this.placementGroupFilterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] placementStrategyIds { + get { return this.placementStrategyIdsField; } + set { this.placementStrategyIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] pricingTypeIds { + get { return this.pricingTypeIdsField; } + set { this.pricingTypeIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] siteIds { + get { return this.siteIdsField; } + set { this.siteIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DateInterval startDateRange { + get { return this.startDateRangeField; } + set { this.startDateRangeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementSearchCriteria : PageableSearchCriteriaBase { + private ActiveFilter archiveFilterField; + + private long[] campaignIdsField; + + private long[] dfaSiteIdsField; + + private DateInterval endDateRangeField; + + private int placementFilterField; + + private long[] placementStrategyIdsField; + + private long[] placementTypeIdsField; + + private long[] pricingTypeIdsField; + + private long[] siteIdsField; + + private long[] sizeIdsField; + + private SortOrder sortOrderField; + + private DateInterval startDateRangeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ActiveFilter archiveFilter { + get { return this.archiveFilterField; } + set { this.archiveFilterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] dfaSiteIds { + get { return this.dfaSiteIdsField; } + set { this.dfaSiteIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DateInterval endDateRange { + get { return this.endDateRangeField; } + set { this.endDateRangeField = value; } + } + + public int placementFilter { + get { return this.placementFilterField; } + set { this.placementFilterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] placementStrategyIds { + get { return this.placementStrategyIdsField; } + set { this.placementStrategyIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] placementTypeIds { + get { return this.placementTypeIdsField; } + set { this.placementTypeIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] pricingTypeIds { + get { return this.pricingTypeIdsField; } + set { this.pricingTypeIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] siteIds { + get { return this.siteIdsField; } + set { this.siteIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] sizeIds { + get { return this.sizeIdsField; } + set { this.sizeIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DateInterval startDateRange { + get { return this.startDateRangeField; } + set { this.startDateRangeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementTagInfo { + private string clickThroughUrlTagField; + + private string iframeJavaScriptTagField; + + private string imageRedirectUrlTagField; + + private string internalRedirectTagField; + + private string javaScriptTagField; + + private string motifInstructionsField; + + private PlacementBase placementField; + + private string prefetchTagField; + + private string standardTagField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string clickThroughUrlTag { + get { return this.clickThroughUrlTagField; } + set { this.clickThroughUrlTagField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string iframeJavaScriptTag { + get { return this.iframeJavaScriptTagField; } + set { this.iframeJavaScriptTagField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string imageRedirectUrlTag { + get { return this.imageRedirectUrlTagField; } + set { this.imageRedirectUrlTagField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string internalRedirectTag { + get { return this.internalRedirectTagField; } + set { this.internalRedirectTagField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string javaScriptTag { + get { return this.javaScriptTagField; } + set { this.javaScriptTagField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string motifInstructions { + get { return this.motifInstructionsField; } + set { this.motifInstructionsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PlacementBase placement { + get { return this.placementField; } + set { this.placementField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string prefetchTag { + get { return this.prefetchTagField; } + set { this.prefetchTagField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string standardTag { + get { return this.standardTagField; } + set { this.standardTagField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ClickCommandInfo { + private AdBase adField; + + private string clickCommandField; + + private PlacementBase placementField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public AdBase ad { + get { return this.adField; } + set { this.adField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string clickCommand { + get { return this.clickCommandField; } + set { this.clickCommandField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PlacementBase placement { + get { return this.placementField; } + set { this.placementField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(MobileAd))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(TrackingAd))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(DefaultAd))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(ClickTracker))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(TargetableAdBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeAd))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RotationGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public abstract partial class AdBase : Base { + private bool activeField; + + private bool archivedField; + + private long campaignIdField; + + private string commentsField; + + private System.DateTime? endTimeField; + + private PlacementAssignment[] placementAssignmentsField; + + private long sizeIdField; + + private System.DateTime? startTimeField; + + private long typeIdField; + + public bool active { + get { return this.activeField; } + set { this.activeField = value; } + } + + public bool archived { + get { return this.archivedField; } + set { this.archivedField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string comments { + get { return this.commentsField; } + set { this.commentsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? endTime { + get { return this.endTimeField; } + set { this.endTimeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PlacementAssignment[] placementAssignments { + get { return this.placementAssignmentsField; } + set { this.placementAssignmentsField = value; } + } + + public long sizeId { + get { return this.sizeIdField; } + set { this.sizeIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public long typeId { + get { return this.typeIdField; } + set { this.typeIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementAssignment { + private bool activeField; + + private long placementIdField; + + public bool active { + get { return this.activeField; } + set { this.activeField = value; } + } + + public long placementId { + get { return this.placementIdField; } + set { this.placementIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class MobileAd : AdBase { + private CountryTargetingCriteria countryTargetingCriteriaField; + + private CreativeAssignment[] creativeAssignmentsField; + + private int[] daysOfWeekField; + + private int deliveryLimitField; + + private bool deliveryLimitEnabledField; + + private bool hardCutOffField; + + private int[] hoursOfDayField; + + private string keywordExpressionField; + + private MobilePlatform[] mobilePlatformsField; + + private int priorityField; + + private int ratioField; + + private bool userLocalTimeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CountryTargetingCriteria countryTargetingCriteria { + get { return this.countryTargetingCriteriaField; } + set { this.countryTargetingCriteriaField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeAssignment[] creativeAssignments { + get { return this.creativeAssignmentsField; } + set { this.creativeAssignmentsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public int[] daysOfWeek { + get { return this.daysOfWeekField; } + set { this.daysOfWeekField = value; } + } + + public int deliveryLimit { + get { return this.deliveryLimitField; } + set { this.deliveryLimitField = value; } + } + + public bool deliveryLimitEnabled { + get { return this.deliveryLimitEnabledField; } + set { this.deliveryLimitEnabledField = value; } + } + + public bool hardCutOff { + get { return this.hardCutOffField; } + set { this.hardCutOffField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public int[] hoursOfDay { + get { return this.hoursOfDayField; } + set { this.hoursOfDayField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string keywordExpression { + get { return this.keywordExpressionField; } + set { this.keywordExpressionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public MobilePlatform[] mobilePlatforms { + get { return this.mobilePlatformsField; } + set { this.mobilePlatformsField = value; } + } + + public int priority { + get { return this.priorityField; } + set { this.priorityField = value; } + } + + public int ratio { + get { return this.ratioField; } + set { this.ratioField = value; } + } + + public bool userLocalTime { + get { return this.userLocalTimeField; } + set { this.userLocalTimeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CountryTargetingCriteria { + private Country[] countriesField; + + private bool excludeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Country[] countries { + get { return this.countriesField; } + set { this.countriesField = value; } + } + + public bool exclude { + get { return this.excludeField; } + set { this.excludeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class Country : Base { + private string countryCodeField; + + private bool secureField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + + public bool secure { + get { return this.secureField; } + set { this.secureField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeAssignment { + private bool activeField; + + private string alternalteTextField; + + private ClickThroughUrl clickThroughUrlField; + + private CreativeGroupAssignment creativeGroupAssignmentField; + + private long creativeIdField; + + private System.DateTime? endDateField; + + private RichMediaExitOverride[] richMediaExitOverridesField; + + private int sequenceField; + + private System.DateTime? startDateField; + + private int weightField; + + public bool active { + get { return this.activeField; } + set { this.activeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string alternalteText { + get { return this.alternalteTextField; } + set { this.alternalteTextField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ClickThroughUrl clickThroughUrl { + get { return this.clickThroughUrlField; } + set { this.clickThroughUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeGroupAssignment creativeGroupAssignment { + get { return this.creativeGroupAssignmentField; } + set { this.creativeGroupAssignmentField = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { this.creativeIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaExitOverride[] richMediaExitOverrides { + get { return this.richMediaExitOverridesField; } + set { this.richMediaExitOverridesField = value; } + } + + public int sequence { + get { return this.sequenceField; } + set { this.sequenceField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public int weight { + get { return this.weightField; } + set { this.weightField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ClickThroughUrl { + private string customClickThroughUrlField; + + private bool defaultLandingPageUsedField; + + private long landingPageIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string customClickThroughUrl { + get { return this.customClickThroughUrlField; } + set { this.customClickThroughUrlField = value; } + } + + public bool defaultLandingPageUsed { + get { return this.defaultLandingPageUsedField; } + set { this.defaultLandingPageUsedField = value; } + } + + public long landingPageId { + get { return this.landingPageIdField; } + set { this.landingPageIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeGroupAssignment { + private long creativeGroup1IdField; + + private long creativeGroup2IdField; + + public long creativeGroup1Id { + get { return this.creativeGroup1IdField; } + set { this.creativeGroup1IdField = value; } + } + + public long creativeGroup2Id { + get { return this.creativeGroup2IdField; } + set { this.creativeGroup2IdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaExitOverride { + private string clickThroughUrlField; + + private long exitIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string clickThroughUrl { + get { return this.clickThroughUrlField; } + set { this.clickThroughUrlField = value; } + } + + public long exitId { + get { return this.exitIdField; } + set { this.exitIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class MobilePlatform : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class TrackingAd : AdBase { + private CreativeAssignment[] creativeAssignmentsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeAssignment[] creativeAssignments { + get { return this.creativeAssignmentsField; } + set { this.creativeAssignmentsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class DefaultAd : AdBase { + private CreativeAssignment creativeAssignmentField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeAssignment creativeAssignment { + get { return this.creativeAssignmentField; } + set { this.creativeAssignmentField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ClickTracker : AdBase { + private ClickThroughUrl clickThroughUrlField; + + private CreativeGroupAssignment creativeGroupAssignmentField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ClickThroughUrl clickThroughUrl { + get { return this.clickThroughUrlField; } + set { this.clickThroughUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeGroupAssignment creativeGroupAssignment { + get { return this.creativeGroupAssignmentField; } + set { this.creativeGroupAssignmentField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeAd))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RotationGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public abstract partial class TargetableAdBase : AdBase { + private ISP[] iSPsField; + + private OSP[] oSPsField; + + private AreaCode[] areaCodesField; + + private long audienceSegmentIdField; + + private Bandwidth[] bandwidthsField; + + private BrowserVersion[] browserVersionsField; + + private City[] citiesField; + + private int costTypeField; + + private CountryTargetingCriteria countryTargetingCriteriaField; + + private int[] daysOfWeekField; + + private int deliveryLimitField; + + private bool deliveryLimitEnabledField; + + private DesignatedMarketArea[] designatedMarketAreasField; + + private DomainNameBase[] domainNamesField; + + private DomainType[] domainTypesField; + + private int frequencyCapField; + + private long frequencyCapPeriodField; + + private bool hardCutOffField; + + private int[] hoursOfDayField; + + private string keywordExpressionField; + + private OperatingSystem[] operatingSystemsField; + + private string[] postalCodesField; + + private int priorityField; + + private int ratioField; + + private State[] statesField; + + private UserListExpression userListExpressionField; + + private bool userLocalTimeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ISP[] ISPs { + get { return this.iSPsField; } + set { this.iSPsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public OSP[] OSPs { + get { return this.oSPsField; } + set { this.oSPsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public AreaCode[] areaCodes { + get { return this.areaCodesField; } + set { this.areaCodesField = value; } + } + + public long audienceSegmentId { + get { return this.audienceSegmentIdField; } + set { this.audienceSegmentIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Bandwidth[] bandwidths { + get { return this.bandwidthsField; } + set { this.bandwidthsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public BrowserVersion[] browserVersions { + get { return this.browserVersionsField; } + set { this.browserVersionsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public City[] cities { + get { return this.citiesField; } + set { this.citiesField = value; } + } + + public int costType { + get { return this.costTypeField; } + set { this.costTypeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CountryTargetingCriteria countryTargetingCriteria { + get { return this.countryTargetingCriteriaField; } + set { this.countryTargetingCriteriaField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public int[] daysOfWeek { + get { return this.daysOfWeekField; } + set { this.daysOfWeekField = value; } + } + + public int deliveryLimit { + get { return this.deliveryLimitField; } + set { this.deliveryLimitField = value; } + } + + public bool deliveryLimitEnabled { + get { return this.deliveryLimitEnabledField; } + set { this.deliveryLimitEnabledField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DesignatedMarketArea[] designatedMarketAreas { + get { return this.designatedMarketAreasField; } + set { this.designatedMarketAreasField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DomainNameBase[] domainNames { + get { return this.domainNamesField; } + set { this.domainNamesField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DomainType[] domainTypes { + get { return this.domainTypesField; } + set { this.domainTypesField = value; } + } + + public int frequencyCap { + get { return this.frequencyCapField; } + set { this.frequencyCapField = value; } + } + + public long frequencyCapPeriod { + get { return this.frequencyCapPeriodField; } + set { this.frequencyCapPeriodField = value; } + } + + public bool hardCutOff { + get { return this.hardCutOffField; } + set { this.hardCutOffField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public int[] hoursOfDay { + get { return this.hoursOfDayField; } + set { this.hoursOfDayField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string keywordExpression { + get { return this.keywordExpressionField; } + set { this.keywordExpressionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public OperatingSystem[] operatingSystems { + get { return this.operatingSystemsField; } + set { this.operatingSystemsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string[] postalCodes { + get { return this.postalCodesField; } + set { this.postalCodesField = value; } + } + + public int priority { + get { return this.priorityField; } + set { this.priorityField = value; } + } + + public int ratio { + get { return this.ratioField; } + set { this.ratioField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public State[] states { + get { return this.statesField; } + set { this.statesField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public UserListExpression userListExpression { + get { return this.userListExpressionField; } + set { this.userListExpressionField = value; } + } + + public bool userLocalTime { + get { return this.userLocalTimeField; } + set { this.userLocalTimeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ISP : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class OSP : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AreaCode { + private long areaCodeField; + + private long countryIdField; + + public long areaCode { + get { return this.areaCodeField; } + set { this.areaCodeField = value; } + } + + public long countryId { + get { return this.countryIdField; } + set { this.countryIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class Bandwidth : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class BrowserVersion { + private Browser browserField; + + private int majorVersionField; + + private string minorVersionField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Browser browser { + get { return this.browserField; } + set { this.browserField = value; } + } + + public int majorVersion { + get { return this.majorVersionField; } + set { this.majorVersionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string minorVersion { + get { return this.minorVersionField; } + set { this.minorVersionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class Browser : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class City : Base { + private long countryIdField; + + private long regionIdField; + + public long countryId { + get { return this.countryIdField; } + set { this.countryIdField = value; } + } + + public long regionId { + get { return this.regionIdField; } + set { this.regionIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class DesignatedMarketArea : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class DomainNameBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class DomainType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class OperatingSystem : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class State : Base { + private string abbreviationField; + + private long countryIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string abbreviation { + get { return this.abbreviationField; } + set { this.abbreviationField = value; } + } + + public long countryId { + get { return this.countryIdField; } + set { this.countryIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class UserListExpression { + private string idExpressionField; + + private string nameExpressionField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string idExpression { + get { return this.idExpressionField; } + set { this.idExpressionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string nameExpression { + get { return this.nameExpressionField; } + set { this.nameExpressionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeAd : TargetableAdBase { + private ClickThroughUrl clickThroughUrlField; + + private CreativeGroupAssignment creativeGroupAssignmentField; + + private long creativeIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ClickThroughUrl clickThroughUrl { + get { return this.clickThroughUrlField; } + set { this.clickThroughUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeGroupAssignment creativeGroupAssignment { + get { return this.creativeGroupAssignmentField; } + set { this.creativeGroupAssignmentField = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { this.creativeIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RotationGroup : TargetableAdBase { + private FrequencyCapGroup[] assignedFrequencyCapGroupsField; + + private CreativeAssignment[] creativeAssignmentsField; + + private bool creativeOptimizationEnabledField; + + private int rotationTypeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public FrequencyCapGroup[] assignedFrequencyCapGroups { + get { return this.assignedFrequencyCapGroupsField; } + set { this.assignedFrequencyCapGroupsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeAssignment[] creativeAssignments { + get { return this.creativeAssignmentsField; } + set { this.creativeAssignmentsField = value; } + } + + public bool creativeOptimizationEnabled { + get { return this.creativeOptimizationEnabledField; } + set { this.creativeOptimizationEnabledField = value; } + } + + public int rotationType { + get { return this.rotationTypeField; } + set { this.rotationTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementTagData { + private Advertiser advertiserField; + + private CampaignBase campaignField; + + private ClickCommandInfo[] clickCommandInfosField; + + private PlacementTagInfo[] placementTagInfosField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Advertiser advertiser { + get { return this.advertiserField; } + set { this.advertiserField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CampaignBase campaign { + get { return this.campaignField; } + set { this.campaignField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ClickCommandInfo[] clickCommandInfos { + get { return this.clickCommandInfosField; } + set { this.clickCommandInfosField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PlacementTagInfo[] placementTagInfos { + get { return this.placementTagInfosField; } + set { this.placementTagInfosField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class Advertiser : AdvertiserBase { + private long advertiserGroupIdField; + + private bool approvedField; + + private bool hiddenField; + + private bool impressionExchangeEnabledField; + + private bool inventoryAdvertiserField; + + private long networkIdField; + + private long spotIdField; + + private long subnetworkIdField; + + public long advertiserGroupId { + get { return this.advertiserGroupIdField; } + set { this.advertiserGroupIdField = value; } + } + + public bool approved { + get { return this.approvedField; } + set { this.approvedField = value; } + } + + public bool hidden { + get { return this.hiddenField; } + set { this.hiddenField = value; } + } + + public bool impressionExchangeEnabled { + get { return this.impressionExchangeEnabledField; } + set { this.impressionExchangeEnabledField = value; } + } + + public bool inventoryAdvertiser { + get { return this.inventoryAdvertiserField; } + set { this.inventoryAdvertiserField = value; } + } + + public long networkId { + get { return this.networkIdField; } + set { this.networkIdField = value; } + } + + public long spotId { + get { return this.spotIdField; } + set { this.spotIdField = value; } + } + + public long subnetworkId { + get { return this.subnetworkIdField; } + set { this.subnetworkIdField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Advertiser))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AdvertiserBase : Base { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Campaign))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CampaignSummary))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CampaignBase : Base { + private long advertiserIdField; + + private bool archivedField; + + private string billingInvoiceNotationField; + + private string commentsField; + + private long defaultLandingPageIdField; + + private System.DateTime? endDateField; + + private System.DateTime? startDateField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + public bool archived { + get { return this.archivedField; } + set { this.archivedField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string billingInvoiceNotation { + get { return this.billingInvoiceNotationField; } + set { this.billingInvoiceNotationField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string comments { + get { return this.commentsField; } + set { this.commentsField = value; } + } + + public long defaultLandingPageId { + get { return this.defaultLandingPageIdField; } + set { this.defaultLandingPageIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class Campaign : CampaignBase { + private AudienceSegmentGroup[] audienceSegmentGroupsField; + + private long[] creativeGroupIdsField; + + private CreativeOptimizationConfiguration creativeOptimizationConfigurationField; + + private long[] landingPageIdsField; + + private LookbackWindow lookbackWindowField; + + private ReachReportConfiguration reachReportConfigurationField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public AudienceSegmentGroup[] audienceSegmentGroups { + get { return this.audienceSegmentGroupsField; } + set { this.audienceSegmentGroupsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] creativeGroupIds { + get { return this.creativeGroupIdsField; } + set { this.creativeGroupIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeOptimizationConfiguration creativeOptimizationConfiguration { + get { return this.creativeOptimizationConfigurationField; } + set { this.creativeOptimizationConfigurationField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] landingPageIds { + get { return this.landingPageIdsField; } + set { this.landingPageIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public LookbackWindow lookbackWindow { + get { return this.lookbackWindowField; } + set { this.lookbackWindowField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ReachReportConfiguration reachReportConfiguration { + get { return this.reachReportConfigurationField; } + set { this.reachReportConfigurationField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AudienceSegmentGroup : Base { + private AudienceSegment[] audienceSegmentsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public AudienceSegment[] audienceSegments { + get { return this.audienceSegmentsField; } + set { this.audienceSegmentsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AudienceSegment : Base { + private int percentageAllocationField; + + public int percentageAllocation { + get { return this.percentageAllocationField; } + set { this.percentageAllocationField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeOptimizationConfiguration { + private int minimumCreativeWeightField; + + private int optimizationModelIdField; + + private int relativeStrengthField; + + private SpotlightActivityWeight[] spotlightActivitiesField; + + public int minimumCreativeWeight { + get { return this.minimumCreativeWeightField; } + set { this.minimumCreativeWeightField = value; } + } + + public int optimizationModelId { + get { return this.optimizationModelIdField; } + set { this.optimizationModelIdField = value; } + } + + public int relativeStrength { + get { return this.relativeStrengthField; } + set { this.relativeStrengthField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SpotlightActivityWeight[] spotlightActivities { + get { return this.spotlightActivitiesField; } + set { this.spotlightActivitiesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SpotlightActivityWeight { + private long activityIdField; + + private int weightField; + + public long activityId { + get { return this.activityIdField; } + set { this.activityIdField = value; } + } + + public int weight { + get { return this.weightField; } + set { this.weightField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CampaignSummary : CampaignBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementTagCriteria { + private long idField; + + private long[] tagOptionIdsField; + + public long id { + get { return this.idField; } + set { this.idField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] tagOptionIds { + get { return this.tagOptionIdsField; } + set { this.tagOptionIdsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementTagOption : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementGroupType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PricingType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "reportSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class ReportRemoteService : DfaSoapClient { + public ReportRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.19/api/dfa-api/report"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getReportsByCriteriaReturn")] + public ReportInfoRecordSet getReportsByCriteria(ReportSearchCriteria ReportSearchCriteria) { + object[] results = this.Invoke("getReportsByCriteria", new object[] {ReportSearchCriteria}); + return ((ReportInfoRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getReportReturn")] + public ReportInfo getReport(ReportRequest ReportRequest) { + object[] results = this.Invoke("getReport", new object[] {ReportRequest}); + return ((ReportInfo) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("runDeferredReportReturn")] + public ReportInfo runDeferredReport(ReportRequest ReportRequest) { + object[] results = this.Invoke("runDeferredReport", new object[] {ReportRequest}); + return ((ReportInfo) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ReportSearchCriteria { + private DateInterval intervalField; + + private long queryIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DateInterval interval { + get { return this.intervalField; } + set { this.intervalField = value; } + } + + public long queryId { + get { return this.queryIdField; } + set { this.queryIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ReportRequest { + private long queryIdField; + + private long reportIdField; + + public long queryId { + get { return this.queryIdField; } + set { this.queryIdField = value; } + } + + public long reportId { + get { return this.reportIdField; } + set { this.reportIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ReportStatusType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ReportInfo { + private long queryIdField; + + private long reportIdField; + + private ReportStatusType statusField; + + private string urlField; + + public long queryId { + get { return this.queryIdField; } + set { this.queryIdField = value; } + } + + public long reportId { + get { return this.reportIdField; } + set { this.reportIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ReportStatusType status { + get { return this.statusField; } + set { this.statusField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ReportInfoRecordSet { + private ReportInfo[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ReportInfo[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "siteSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SiteDirectorySiteImportRequest))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SiteDirectoryDfaSiteMappingResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SiteDirectoryDfaSiteMappingRequest))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(TagSettingsBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + public partial class SiteRemoteService : DfaSoapClient { + public SiteRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.19/api/dfa-api/site"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getContactsReturn")] + public ContactRecordSet getContacts(ContactSearchCriteria sc) { + object[] results = this.Invoke("getContacts", new object[] {sc}); + return ((ContactRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getSitesByCriteriaReturn")] + public SiteRecordSet getSitesByCriteria(SiteSearchCriteria searchCriteria) { + object[] results = this.Invoke("getSitesByCriteria", new object[] {searchCriteria}); + return ((SiteRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public void linkDfaSiteToSiteDirectorySite(long dfaSiteId, long siteDirectorySiteId) { + this.Invoke("linkDfaSiteToSiteDirectorySite", new object[] {dfaSiteId, siteDirectorySiteId}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("linkDfaSitesToSiteDirectorySitesReturn")] + public SiteDirectoryDfaSiteMappingResult[] linkDfaSitesToSiteDirectorySites(SiteDirectoryDfaSiteMappingRequest[] requests) { + object[] results = this.Invoke("linkDfaSitesToSiteDirectorySites", new object[] {requests}); + return ((SiteDirectoryDfaSiteMappingResult[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("importSiteDirectorySitesReturn")] + public SiteDirectorySiteImportResult[] importSiteDirectorySites(SiteDirectorySiteImportRequest[] requests) { + object[] results = this.Invoke("importSiteDirectorySites", new object[] {requests}); + return ((SiteDirectorySiteImportResult[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("saveSiteDirectorySiteReturn")] + public SiteSaveResult saveSiteDirectorySite(Site site) { + object[] results = this.Invoke("saveSiteDirectorySite", new object[] {site}); + return ((SiteSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getDfaSiteReturn")] + public DfaSite getDfaSite(long dfaSiteId) { + object[] results = this.Invoke("getDfaSite", new object[] {dfaSiteId}); + return ((DfaSite) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getDfaSitesReturn")] + public DfaSiteRecordSet getDfaSites(DfaSiteSearchCriteria sc) { + object[] results = this.Invoke("getDfaSites", new object[] {sc}); + return ((DfaSiteRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("saveDfaSiteReturn")] + public DfaSiteSaveResult saveDfaSite(DfaSite dfaSite) { + object[] results = this.Invoke("saveDfaSite", new object[] {dfaSite}); + return ((DfaSiteSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getAvailableDfaSiteContactTypesReturn")] + public DfaSiteContactType[] getAvailableDfaSiteContactTypes() { + object[] results = this.Invoke("getAvailableDfaSiteContactTypes", new object[0]); + return ((DfaSiteContactType[]) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ContactSearchCriteria : PageableSearchCriteriaBase { + private bool includeParentContactsField; + + private long[] siteDirectorySiteIdsField; + + private SortOrder sortOrderField; + + public bool includeParentContacts { + get { return this.includeParentContactsField; } + set { this.includeParentContactsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] siteDirectorySiteIds { + get { return this.siteDirectorySiteIdsField; } + set { this.siteDirectorySiteIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class DfaSiteSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SiteSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SiteDirectorySiteImportResult : SaveResult { + private long dfaSiteIdField; + + private string errorMessageField; + + private long subnetworkIdField; + + public long dfaSiteId { + get { return this.dfaSiteIdField; } + set { this.dfaSiteIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + + public long subnetworkId { + get { return this.subnetworkIdField; } + set { this.subnetworkIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SiteDirectorySiteImportRequest { + private long siteDirectorySiteIdField; + + private long subnetworkIdField; + + public long siteDirectorySiteId { + get { return this.siteDirectorySiteIdField; } + set { this.siteDirectorySiteIdField = value; } + } + + public long subnetworkId { + get { return this.subnetworkIdField; } + set { this.subnetworkIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SiteDirectoryDfaSiteMappingResult { + private long dfaSiteIdField; + + private string errorMessageField; + + private long siteDirectorySiteIdField; + + public long dfaSiteId { + get { return this.dfaSiteIdField; } + set { this.dfaSiteIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + + public long siteDirectorySiteId { + get { return this.siteDirectorySiteIdField; } + set { this.siteDirectorySiteIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SiteDirectoryDfaSiteMappingRequest { + private long dfaSiteIdField; + + private long siteDirectorySiteIdField; + + public long dfaSiteId { + get { return this.dfaSiteIdField; } + set { this.dfaSiteIdField = value; } + } + + public long siteDirectorySiteId { + get { return this.siteDirectorySiteIdField; } + set { this.siteDirectorySiteIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SiteTagSettings : TagSettingsBase { + private string keywordReferrerField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string keywordReferrer { + get { return this.keywordReferrerField; } + set { this.keywordReferrerField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SiteRichMediaSettings { + private string alternateTextField; + + private string frameAndLayerFooterField; + + private string frameAndLayerHeaderField; + + private string iframeFooterField; + + private string iframeHeaderField; + + private string targetWindowField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string alternateText { + get { return this.alternateTextField; } + set { this.alternateTextField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string frameAndLayerFooter { + get { return this.frameAndLayerFooterField; } + set { this.frameAndLayerFooterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string frameAndLayerHeader { + get { return this.frameAndLayerHeaderField; } + set { this.frameAndLayerHeaderField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string iframeFooter { + get { return this.iframeFooterField; } + set { this.iframeFooterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string iframeHeader { + get { return this.iframeHeaderField; } + set { this.iframeHeaderField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string targetWindow { + get { return this.targetWindowField; } + set { this.targetWindowField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class DfaSiteContactType : Base { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(DfaSiteContact))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class DfaSiteContactBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class DfaSiteContact : DfaSiteContactBase { + private long dfaSiteContactTypeIdField; + + private long dfaSiteIdField; + + private string firstNameField; + + private string lastNameField; + + public long dfaSiteContactTypeId { + get { return this.dfaSiteContactTypeIdField; } + set { this.dfaSiteContactTypeIdField = value; } + } + + public long dfaSiteId { + get { return this.dfaSiteIdField; } + set { this.dfaSiteIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string firstName { + get { return this.firstNameField; } + set { this.firstNameField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string lastName { + get { return this.lastNameField; } + set { this.lastNameField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(DfaSite))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class DfaSiteBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class DfaSite : DfaSiteBase { + private bool approvedField; + + private long countryIdField; + + private DfaSiteContact[] dfaSiteContactField; + + private bool displayAlternateTextBelowRichMediaCreativesField; + + private bool existingCookiesIgnoredField; + + private bool explicitApprovalNeededField; + + private string keynameField; + + private LookbackWindow lookbackWindowField; + + private long networkIdField; + + private bool newCookiesDisabledField; + + private SiteRichMediaSettings richMediaSettingsField; + + private long siteDirectorySiteIdField; + + private long subnetworkIdField; + + private SiteTagSettings tagSettingsField; + + public bool approved { + get { return this.approvedField; } + set { this.approvedField = value; } + } + + public long countryId { + get { return this.countryIdField; } + set { this.countryIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DfaSiteContact[] dfaSiteContact { + get { return this.dfaSiteContactField; } + set { this.dfaSiteContactField = value; } + } + + public bool displayAlternateTextBelowRichMediaCreatives { + get { return this.displayAlternateTextBelowRichMediaCreativesField; } + set { this.displayAlternateTextBelowRichMediaCreativesField = value; } + } + + public bool existingCookiesIgnored { + get { return this.existingCookiesIgnoredField; } + set { this.existingCookiesIgnoredField = value; } + } + + public bool explicitApprovalNeeded { + get { return this.explicitApprovalNeededField; } + set { this.explicitApprovalNeededField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string keyname { + get { return this.keynameField; } + set { this.keynameField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public LookbackWindow lookbackWindow { + get { return this.lookbackWindowField; } + set { this.lookbackWindowField = value; } + } + + public long networkId { + get { return this.networkIdField; } + set { this.networkIdField = value; } + } + + public bool newCookiesDisabled { + get { return this.newCookiesDisabledField; } + set { this.newCookiesDisabledField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SiteRichMediaSettings richMediaSettings { + get { return this.richMediaSettingsField; } + set { this.richMediaSettingsField = value; } + } + + public long siteDirectorySiteId { + get { return this.siteDirectorySiteIdField; } + set { this.siteDirectorySiteIdField = value; } + } + + public long subnetworkId { + get { return this.subnetworkIdField; } + set { this.subnetworkIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SiteTagSettings tagSettings { + get { return this.tagSettingsField; } + set { this.tagSettingsField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Site))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SiteBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class Site : SiteBase { + private bool acceptingInterstitialPlacementsField; + + private bool acceptingMobilePlacementsField; + + private bool acceptingPublisherPaidPlacementsField; + + private bool activeField; + + private long[] inpageTagSettingsField; + + private long[] interstitialTagSettingsField; + + private string[] urlsField; + + public bool acceptingInterstitialPlacements { + get { return this.acceptingInterstitialPlacementsField; } + set { this.acceptingInterstitialPlacementsField = value; } + } + + public bool acceptingMobilePlacements { + get { return this.acceptingMobilePlacementsField; } + set { this.acceptingMobilePlacementsField = value; } + } + + public bool acceptingPublisherPaidPlacements { + get { return this.acceptingPublisherPaidPlacementsField; } + set { this.acceptingPublisherPaidPlacementsField = value; } + } + + public bool active { + get { return this.activeField; } + set { this.activeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] inpageTagSettings { + get { return this.inpageTagSettingsField; } + set { this.inpageTagSettingsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] interstitialTagSettings { + get { return this.interstitialTagSettingsField; } + set { this.interstitialTagSettingsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string[] urls { + get { return this.urlsField; } + set { this.urlsField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Contact))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ContactBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class Contact : ContactBase { + private bool allowedToEditSiteField; + + private string cityField; + + private string countryField; + + private string firstNameField; + + private string lastNameField; + + private string phoneField; + + private string postalCodeField; + + private string stateField; + + private string titleField; + + private string typeField; + + public bool allowedToEditSite { + get { return this.allowedToEditSiteField; } + set { this.allowedToEditSiteField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string city { + get { return this.cityField; } + set { this.cityField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string country { + get { return this.countryField; } + set { this.countryField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string firstName { + get { return this.firstNameField; } + set { this.firstNameField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string lastName { + get { return this.lastNameField; } + set { this.lastNameField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string phone { + get { return this.phoneField; } + set { this.phoneField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string postalCode { + get { return this.postalCodeField; } + set { this.postalCodeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string state { + get { return this.stateField; } + set { this.stateField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string title { + get { return this.titleField; } + set { this.titleField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string type { + get { return this.typeField; } + set { this.typeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class DfaSiteRecordSet : PagedRecordSet { + private DfaSite[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DfaSite[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SiteRecordSet : PagedRecordSet { + private Site[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Site[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ContactRecordSet : PagedRecordSet { + private Contact[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Contact[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class DfaSiteSearchCriteria : PageableSearchCriteriaBase { + private long[] sDSiteIdsField; + + private long[] campaignIdsField; + + private bool excludeSitesMappedToSiteDirectoryField; + + private long networkIdField; + + private SortOrder sortOrderField; + + private long subnetworkIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] SDSiteIds { + get { return this.sDSiteIdsField; } + set { this.sDSiteIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + public bool excludeSitesMappedToSiteDirectory { + get { return this.excludeSitesMappedToSiteDirectoryField; } + set { this.excludeSitesMappedToSiteDirectoryField = value; } + } + + public long networkId { + get { return this.networkIdField; } + set { this.networkIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + + public long subnetworkId { + get { return this.subnetworkIdField; } + set { this.subnetworkIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SiteSearchCriteria : PageableSearchCriteriaBase { + private bool activeField; + + public bool active { + get { return this.activeField; } + set { this.activeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "sizeSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + public partial class SizeRemoteService : DfaSoapClient { + public SizeRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.19/api/dfa-api/size"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getSizeReturn")] + public Size getSize(long id) { + object[] results = this.Invoke("getSize", new object[] {id}); + return ((Size) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getSizesReturn")] + public SizeRecordSet getSizes(SizeSearchCriteria searchCriteria) { + object[] results = this.Invoke("getSizes", new object[] {searchCriteria}); + return ((SizeRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("saveSizeReturn")] + public SizeSaveResult saveSize(Size size) { + object[] results = this.Invoke("saveSize", new object[] {size}); + return ((SizeSaveResult) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class Size { + private int heightField; + + private long idField; + + private int widthField; + + public int height { + get { return this.heightField; } + set { this.heightField = value; } + } + + public long id { + get { return this.idField; } + set { this.idField = value; } + } + + public int width { + get { return this.widthField; } + set { this.widthField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SizeSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SizeRecordSet { + private Size[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Size[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SizeSearchCriteria : SearchCriteriaBase { + private int heightField; + + private int widthField; + + public int height { + get { return this.heightField; } + set { this.heightField = value; } + } + + public int width { + get { return this.widthField; } + set { this.widthField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "spotlightSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class SpotlightRemoteService : DfaSoapClient { + public SpotlightRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.19/api/dfa-api/spotlight"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("generateTagsReturn")] + public string generateTags(long[] activityIds) { + object[] results = this.Invoke("generateTags", new object[] {activityIds}); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getSpotlightConfigurationReturn")] + public SpotlightConfiguration getSpotlightConfiguration(long id) { + object[] results = this.Invoke("getSpotlightConfiguration", new object[] {id}); + return ((SpotlightConfiguration) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getSpotlightActivitiesReturn")] + public SpotlightActivityRecordSet getSpotlightActivities(SpotlightActivitySearchCriteria searchCriteria) { + object[] results = this.Invoke("getSpotlightActivities", new object[] {searchCriteria}); + return ((SpotlightActivityRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public void deleteSpotlightActivity(long spolightActivityId) { + this.Invoke("deleteSpotlightActivity", new object[] {spolightActivityId}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public void deleteSpotlightActivityGroup(long spolightActivityGroupId) { + this.Invoke("deleteSpotlightActivityGroup", new object[] {spolightActivityGroupId}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getAvailableCustomSpotlightVariablesReturn")] + public CustomSpotlightVariable[] getAvailableCustomSpotlightVariables() { + object[] results = this.Invoke("getAvailableCustomSpotlightVariables", new object[0]); + return ((CustomSpotlightVariable[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getAvailableStandardVariablesReturn")] + public StandardVariable[] getAvailableStandardVariables() { + object[] results = this.Invoke("getAvailableStandardVariables", new object[0]); + return ((StandardVariable[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getCountriesByCriteriaReturn")] + public Country[] getCountriesByCriteria(CountrySearchCriteria searchCriteria) { + object[] results = this.Invoke("getCountriesByCriteria", new object[] {searchCriteria}); + return ((Country[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getSpotlightActivityReturn")] + public SpotlightActivity getSpotlightActivity(long spotlightActivityId) { + object[] results = this.Invoke("getSpotlightActivity", new object[] {spotlightActivityId}); + return ((SpotlightActivity) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getSpotlightActivityGroupsReturn")] + public SpotlightActivityGroupRecordSet getSpotlightActivityGroups(SpotlightActivityGroupSearchCriteria searchCriteria) { + object[] results = this.Invoke("getSpotlightActivityGroups", new object[] {searchCriteria}); + return ((SpotlightActivityGroupRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getSpotlightActivityTypesReturn")] + public SpotlightActivityType[] getSpotlightActivityTypes() { + object[] results = this.Invoke("getSpotlightActivityTypes", new object[0]); + return ((SpotlightActivityType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getSpotlightTagCodeTypesReturn")] + public SpotlightTagCodeType[] getSpotlightTagCodeTypes() { + object[] results = this.Invoke("getSpotlightTagCodeTypes", new object[0]); + return ((SpotlightTagCodeType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getSpotlightTagFormatTypesReturn")] + public SpotlightTagFormatType[] getSpotlightTagFormatTypes() { + object[] results = this.Invoke("getSpotlightTagFormatTypes", new object[0]); + return ((SpotlightTagFormatType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getSpotlightTagMethodTypesReturn")] + public SpotlightTagMethodType[] getSpotlightTagMethodTypes() { + object[] results = this.Invoke("getSpotlightTagMethodTypes", new object[0]); + return ((SpotlightTagMethodType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("saveSpotlightActivityReturn")] + public SpotlightActivitySaveResult saveSpotlightActivity(SpotlightActivity spotlightActivity) { + object[] results = this.Invoke("saveSpotlightActivity", new object[] {spotlightActivity}); + return ((SpotlightActivitySaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("saveSpotlightActivityGroupReturn")] + public SpotlightActivityGroupSaveResult saveSpotlightActivityGroup(SpotlightActivityGroup spotlightActivityGroup) { + object[] results = this.Invoke("saveSpotlightActivityGroup", new object[] {spotlightActivityGroup}); + return ((SpotlightActivityGroupSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("saveSpotlightConfigurationReturn")] + public SpotlightConfigurationSaveResult saveSpotlightConfiguration(SpotlightConfiguration spotlightConfiguration) { + object[] results = this.Invoke("saveSpotlightConfiguration", new object[] {spotlightConfiguration}); + return ((SpotlightConfigurationSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("updateActivityImageTagsReturn")] + public SpotlightActivityImageTagsSaveResult[] updateActivityImageTags(SpotlightActivityImageTagsSaveRequest request) { + object[] results = this.Invoke("updateActivityImageTags", new object[] {request}); + return ((SpotlightActivityImageTagsSaveResult[]) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SpotlightConfiguration : SpotlightConfigurationBase { + private int clickDaysField; + + private bool crossSiteDuplicateReportField; + + private CustomSpotlightVariableConfiguration[] customSpotlightVariableConfigurationsField; + + private bool dynamicSpotlightEnabledField; + + private int exposureActivitiesCountField; + + private int exposureDaysField; + + private int exposureLevelField; + + private bool exposureToConversionReportField; + + private int firstDayOfWeekField; + + private bool frequencyConversionReportField; + + private bool googleAnalyticsIntegrationEnabledField; + + private bool imageTagsEnabledField; + + private int impressionDaysField; + + private int motifEventsDaysField; + + private long naturalSearchConversionAttributionOptionField; + + private bool omnitureCostDataEnabledField; + + private bool omnitureIntegrationEnabledField; + + private long[] standardVariableIdsField; + + private bool timeLagConversionReportField; + + private int timeSlotField; + + public int clickDays { + get { return this.clickDaysField; } + set { this.clickDaysField = value; } + } + + public bool crossSiteDuplicateReport { + get { return this.crossSiteDuplicateReportField; } + set { this.crossSiteDuplicateReportField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CustomSpotlightVariableConfiguration[] customSpotlightVariableConfigurations { + get { return this.customSpotlightVariableConfigurationsField; } + set { this.customSpotlightVariableConfigurationsField = value; } + } + + public bool dynamicSpotlightEnabled { + get { return this.dynamicSpotlightEnabledField; } + set { this.dynamicSpotlightEnabledField = value; } + } + + public int exposureActivitiesCount { + get { return this.exposureActivitiesCountField; } + set { this.exposureActivitiesCountField = value; } + } + + public int exposureDays { + get { return this.exposureDaysField; } + set { this.exposureDaysField = value; } + } + + public int exposureLevel { + get { return this.exposureLevelField; } + set { this.exposureLevelField = value; } + } + + public bool exposureToConversionReport { + get { return this.exposureToConversionReportField; } + set { this.exposureToConversionReportField = value; } + } + + public int firstDayOfWeek { + get { return this.firstDayOfWeekField; } + set { this.firstDayOfWeekField = value; } + } + + public bool frequencyConversionReport { + get { return this.frequencyConversionReportField; } + set { this.frequencyConversionReportField = value; } + } + + public bool googleAnalyticsIntegrationEnabled { + get { return this.googleAnalyticsIntegrationEnabledField; } + set { this.googleAnalyticsIntegrationEnabledField = value; } + } + + public bool imageTagsEnabled { + get { return this.imageTagsEnabledField; } + set { this.imageTagsEnabledField = value; } + } + + public int impressionDays { + get { return this.impressionDaysField; } + set { this.impressionDaysField = value; } + } + + public int motifEventsDays { + get { return this.motifEventsDaysField; } + set { this.motifEventsDaysField = value; } + } + + public long naturalSearchConversionAttributionOption { + get { return this.naturalSearchConversionAttributionOptionField; } + set { this.naturalSearchConversionAttributionOptionField = value; } + } + + public bool omnitureCostDataEnabled { + get { return this.omnitureCostDataEnabledField; } + set { this.omnitureCostDataEnabledField = value; } + } + + public bool omnitureIntegrationEnabled { + get { return this.omnitureIntegrationEnabledField; } + set { this.omnitureIntegrationEnabledField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] standardVariableIds { + get { return this.standardVariableIdsField; } + set { this.standardVariableIdsField = value; } + } + + public bool timeLagConversionReport { + get { return this.timeLagConversionReportField; } + set { this.timeLagConversionReportField = value; } + } + + public int timeSlot { + get { return this.timeSlotField; } + set { this.timeSlotField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CustomSpotlightVariableConfiguration : VariableBase { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CustomSpotlightVariableConfiguration))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public abstract partial class VariableBase : Base { + private int typeField; + + public int type { + get { return this.typeField; } + set { this.typeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SpotlightActivityImageTagsSaveRequest { + private long[] activityIdsField; + + private bool statusField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] activityIds { + get { return this.activityIdsField; } + set { this.activityIdsField = value; } + } + + public bool status { + get { return this.statusField; } + set { this.statusField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SpotlightActivityImageTagsSaveResult : SaveResult { + private string errorMessageField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SpotlightConfigurationSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SpotlightActivityGroupSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SpotlightActivitySaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SpotlightActivityGroupRecordSet { + private SpotlightActivityGroup[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SpotlightActivityGroup[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SpotlightActivityGroup : SpotlightActivityGroupBase { + private int groupTypeField; + + private long spotlightConfigurationIdField; + + private string tagStringField; + + public int groupType { + get { return this.groupTypeField; } + set { this.groupTypeField = value; } + } + + public long spotlightConfigurationId { + get { return this.spotlightConfigurationIdField; } + set { this.spotlightConfigurationIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string tagString { + get { return this.tagStringField; } + set { this.tagStringField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SpotlightActivityGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public abstract partial class SpotlightActivityGroupBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CountrySearchCriteria { + private bool secureField; + + public bool secure { + get { return this.secureField; } + set { this.secureField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SpotlightActivityRecordSet : PagedRecordSet { + private SpotlightActivity[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SpotlightActivity[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SpotlightActivity : SpotlightActivityBase { + private long activityGroupIdField; + + private long activityTypeIdField; + + private long[] assignedCustomSpotlightVariableIdsField; + + private long countryIdField; + + private FloodlightTag[] defaultFloodlightTagsField; + + private string expectedUrlField; + + private bool imageTagsEnabledField; + + private int minimumExpectedEventsField; + + private FloodlightPublisherTag[] publisherTagsField; + + private bool secureField; + + private long tagCodeTypeIdField; + + private long tagFormatIdField; + + private long tagMethodTypeIdField; + + private SpotlightActivityTagProperty tagPropertyField; + + private string tagStringField; + + public long activityGroupId { + get { return this.activityGroupIdField; } + set { this.activityGroupIdField = value; } + } + + public long activityTypeId { + get { return this.activityTypeIdField; } + set { this.activityTypeIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] assignedCustomSpotlightVariableIds { + get { return this.assignedCustomSpotlightVariableIdsField; } + set { this.assignedCustomSpotlightVariableIdsField = value; } + } + + public long countryId { + get { return this.countryIdField; } + set { this.countryIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public FloodlightTag[] defaultFloodlightTags { + get { return this.defaultFloodlightTagsField; } + set { this.defaultFloodlightTagsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string expectedUrl { + get { return this.expectedUrlField; } + set { this.expectedUrlField = value; } + } + + public bool imageTagsEnabled { + get { return this.imageTagsEnabledField; } + set { this.imageTagsEnabledField = value; } + } + + public int minimumExpectedEvents { + get { return this.minimumExpectedEventsField; } + set { this.minimumExpectedEventsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public FloodlightPublisherTag[] publisherTags { + get { return this.publisherTagsField; } + set { this.publisherTagsField = value; } + } + + public bool secure { + get { return this.secureField; } + set { this.secureField = value; } + } + + public long tagCodeTypeId { + get { return this.tagCodeTypeIdField; } + set { this.tagCodeTypeIdField = value; } + } + + public long tagFormatId { + get { return this.tagFormatIdField; } + set { this.tagFormatIdField = value; } + } + + public long tagMethodTypeId { + get { return this.tagMethodTypeIdField; } + set { this.tagMethodTypeIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SpotlightActivityTagProperty tagProperty { + get { return this.tagPropertyField; } + set { this.tagPropertyField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string tagString { + get { return this.tagStringField; } + set { this.tagStringField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(FloodlightPublisherTag))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class FloodlightTag : Base { + private string urlField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class FloodlightPublisherTag : FloodlightTag { + private bool clickThroughField; + + private long siteIdField; + + private bool viewThroughField; + + public bool clickThrough { + get { return this.clickThroughField; } + set { this.clickThroughField = value; } + } + + public long siteId { + get { return this.siteIdField; } + set { this.siteIdField = value; } + } + + public bool viewThrough { + get { return this.viewThroughField; } + set { this.viewThroughField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SpotlightActivityTagProperty { + private int averageNumEventsField; + + private bool errorField; + + private int lastDayNumEventsField; + + private string topReferrerURLField; + + public int averageNumEvents { + get { return this.averageNumEventsField; } + set { this.averageNumEventsField = value; } + } + + public bool error { + get { return this.errorField; } + set { this.errorField = value; } + } + + public int lastDayNumEvents { + get { return this.lastDayNumEventsField; } + set { this.lastDayNumEventsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string topReferrerURL { + get { return this.topReferrerURLField; } + set { this.topReferrerURLField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SpotlightActivity))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SpotlightActivityBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SpotlightActivityGroupSearchCriteria : SearchCriteriaBase { + private long advertiserIdField; + + private int typeField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + public int type { + get { return this.typeField; } + set { this.typeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SpotlightActivitySearchCriteria : PageableSearchCriteriaBase { + private ActiveFilter activeFilterField; + + private int activityTypeField; + + private long advertiserIdField; + + private long[] spotlightActivityGroupIdsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ActiveFilter activeFilter { + get { return this.activeFilterField; } + set { this.activeFilterField = value; } + } + + public int activityType { + get { return this.activityTypeField; } + set { this.activityTypeField = value; } + } + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] spotlightActivityGroupIds { + get { return this.spotlightActivityGroupIdsField; } + set { this.spotlightActivityGroupIdsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SpotlightTagMethodType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SpotlightTagFormatType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SpotlightTagCodeType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SpotlightActivityType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class StandardVariable : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CustomSpotlightVariable : Base { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SpotlightConfiguration))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SpotlightConfigurationBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "strategySoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class PlacementStrategyRemoteService : DfaSoapClient { + public PlacementStrategyRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.19/api/dfa-api/strategy"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getPlacementStrategyReturn")] + public PlacementStrategy getPlacementStrategy(long placementStrategyId) { + object[] results = this.Invoke("getPlacementStrategy", new object[] {placementStrategyId}); + return ((PlacementStrategy) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getPlacementStrategiesByCriteriaReturn")] + public PlacementStrategyRecordSet getPlacementStrategiesByCriteria(PlacementStrategySearchCriteria placementStrategySearchCriteria) { + object[] results = this.Invoke("getPlacementStrategiesByCriteria", new object[] {placementStrategySearchCriteria}); + return ((PlacementStrategyRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("savePlacementStrategyReturn")] + public PlacementStrategySaveResult savePlacementStrategy(PlacementStrategy placementStrategy) { + object[] results = this.Invoke("savePlacementStrategy", new object[] {placementStrategy}); + return ((PlacementStrategySaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public void deletePlacementStrategy(long placementStrategyId) { + this.Invoke("deletePlacementStrategy", new object[] {placementStrategyId}); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementStrategy : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementStrategySaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementStrategyRecordSet : PagedRecordSet { + private PlacementStrategy[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PlacementStrategy[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class PlacementStrategySearchCriteria : PageableSearchCriteriaBase { + private SortOrder sortOrderField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "subnetworkSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class SubnetworkRemoteService : DfaSoapClient { + public SubnetworkRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.19/api/dfa-api/subnetwork"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getSubnetworkReturn")] + public Subnetwork getSubnetwork(long subnetworkId) { + object[] results = this.Invoke("getSubnetwork", new object[] {subnetworkId}); + return ((Subnetwork) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getSubnetworksReturn")] + public SubnetworkRecordSet getSubnetworks(SubnetworkSearchCriteria subnetworkSearchCriteria) { + object[] results = this.Invoke("getSubnetworks", new object[] {subnetworkSearchCriteria}); + return ((SubnetworkRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getAllAvailablePermissionsReturn")] + public Permission[] getAllAvailablePermissions() { + object[] results = this.Invoke("getAllAvailablePermissions", new object[0]); + return ((Permission[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getDefaultPermissionsReturn")] + public Permission[] getDefaultPermissions() { + object[] results = this.Invoke("getDefaultPermissions", new object[0]); + return ((Permission[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getSubnetworkSummariesReturn")] + public SubnetworkSummaryRecordSet getSubnetworkSummaries(SubnetworkSearchCriteria subnetworkSearchCriteria) { + object[] results = this.Invoke("getSubnetworkSummaries", new object[] {subnetworkSearchCriteria}); + return ((SubnetworkSummaryRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("saveSubnetworkReturn")] + public SubnetworkSaveResult saveSubnetwork(Subnetwork subnetwork) { + object[] results = this.Invoke("saveSubnetwork", new object[] {subnetwork}); + return ((SubnetworkSaveResult) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class Subnetwork : SubnetworkBase { + private long[] availablePermissionsField; + + private long networkIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] availablePermissions { + get { return this.availablePermissionsField; } + set { this.availablePermissionsField = value; } + } + + public long networkId { + get { return this.networkIdField; } + set { this.networkIdField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SubnetworkSummary))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Subnetwork))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public abstract partial class SubnetworkBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SubnetworkSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SubnetworkSummaryRecordSet : PagedRecordSet { + private SubnetworkSummary[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SubnetworkSummary[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SubnetworkSummary : SubnetworkBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SubnetworkRecordSet : PagedRecordSet { + private Subnetwork[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Subnetwork[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class SubnetworkSearchCriteria : PageableSearchCriteriaBase { + private SortOrder sortOrderField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "userSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class UserRemoteService : DfaSoapClient { + public UserRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.19/api/dfa-api/user"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getUserReturn")] + public User getUser(long userId) { + object[] results = this.Invoke("getUser", new object[] {userId}); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getUsersByCriteriaReturn")] + public UserRecordSet getUsersByCriteria(UserSearchCriteria searchCriteria) { + object[] results = this.Invoke("getUsersByCriteria", new object[] {searchCriteria}); + return ((UserRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("saveUserReturn")] + public UserSaveResult saveUser(User user) { + object[] results = this.Invoke("saveUser", new object[] {user}); + return ((UserSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("generateUniqueUsernameReturn")] + public string generateUniqueUsername(string username) { + object[] results = this.Invoke("generateUniqueUsername", new object[] {username}); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public void sendUserInvitationEmail(UserInvitationEmailRequest emailRequest) { + this.Invoke("sendUserInvitationEmail", new object[] {emailRequest}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getAvailableUserFilterTypesReturn")] + public UserFilterType[] getAvailableUserFilterTypes() { + object[] results = this.Invoke("getAvailableUserFilterTypes", new object[0]); + return ((UserFilterType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getAvailableUserFilterCriteriaTypesReturn")] + public UserFilterCriteriaType[] getAvailableUserFilterCriteriaTypes() { + object[] results = this.Invoke("getAvailableUserFilterCriteriaTypes", new object[0]); + return ((UserFilterCriteriaType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getAvailableTraffickerTypesReturn")] + public TraffickerType[] getAvailableTraffickerTypes() { + object[] results = this.Invoke("getAvailableTraffickerTypes", new object[0]); + return ((TraffickerType[]) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class User : UserBase { + private UserFilter advertiserUserFilterField; + + private UserFilter campaignUserFilterField; + + private string commentsField; + + private bool gaiaEnabledField; + + private long languageEncodingIdField; + + private UserFilter siteUserFilterField; + + private long traffickerTypeField; + + private UserFilter userRoleUserFilterField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public UserFilter advertiserUserFilter { + get { return this.advertiserUserFilterField; } + set { this.advertiserUserFilterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public UserFilter campaignUserFilter { + get { return this.campaignUserFilterField; } + set { this.campaignUserFilterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string comments { + get { return this.commentsField; } + set { this.commentsField = value; } + } + + public bool gaiaEnabled { + get { return this.gaiaEnabledField; } + set { this.gaiaEnabledField = value; } + } + + public long languageEncodingId { + get { return this.languageEncodingIdField; } + set { this.languageEncodingIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public UserFilter siteUserFilter { + get { return this.siteUserFilterField; } + set { this.siteUserFilterField = value; } + } + + public long traffickerType { + get { return this.traffickerTypeField; } + set { this.traffickerTypeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public UserFilter userRoleUserFilter { + get { return this.userRoleUserFilterField; } + set { this.userRoleUserFilterField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class UserFilter { + private ObjectFilter[] objectFiltersField; + + private int userFilterCriteriaIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ObjectFilter[] objectFilters { + get { return this.objectFiltersField; } + set { this.objectFiltersField = value; } + } + + public int userFilterCriteriaId { + get { return this.userFilterCriteriaIdField; } + set { this.userFilterCriteriaIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ObjectFilter : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class UserInvitationEmailRequest { + private string emailMessageField; + + private string emailSubjectField; + + private long idField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string emailMessage { + get { return this.emailMessageField; } + set { this.emailMessageField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string emailSubject { + get { return this.emailSubjectField; } + set { this.emailSubjectField = value; } + } + + public long id { + get { return this.idField; } + set { this.idField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class UserSaveResult : SaveResult { + private string tokenField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string token { + get { return this.tokenField; } + set { this.tokenField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class UserRecordSet : PagedRecordSet { + private User[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public User[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class UserSearchCriteria : PageableSearchCriteriaBase { + private ActiveFilter activeFilterField; + + private SortOrder sortOrderField; + + private long subnetworkIdField; + + private long userRoleIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ActiveFilter activeFilter { + get { return this.activeFilterField; } + set { this.activeFilterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + + public long subnetworkId { + get { return this.subnetworkIdField; } + set { this.subnetworkIdField = value; } + } + + public long userRoleId { + get { return this.userRoleIdField; } + set { this.userRoleIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class TraffickerType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class UserFilterCriteriaType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class UserFilterType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "adSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaExitOverride))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(BrowserVersion))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(AreaCode))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PlacementAssignment))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class AdRemoteService : DfaSoapClient { + public AdRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.19/api/dfa-api/ad"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getAdTypesReturn")] + public AdType[] getAdTypes() { + object[] results = this.Invoke("getAdTypes", new object[0]); + return ((AdType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("copyAdsReturn")] + public AdCopyResult[] copyAds(AdCopyRequest[] adCopyRequests) { + object[] results = this.Invoke("copyAds", new object[] {adCopyRequests}); + return ((AdCopyResult[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getCountriesReturn")] + public Country[] getCountries() { + object[] results = this.Invoke("getCountries", new object[0]); + return ((Country[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getBandwidthsReturn")] + public Bandwidth[] getBandwidths() { + object[] results = this.Invoke("getBandwidths", new object[0]); + return ((Bandwidth[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getBrowsersReturn")] + public Browser[] getBrowsers() { + object[] results = this.Invoke("getBrowsers", new object[0]); + return ((Browser[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getCitiesReturn")] + public City[] getCities(CitySearchCriteria criteria) { + object[] results = this.Invoke("getCities", new object[] {criteria}); + return ((City[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getOperatingSystemsReturn")] + public OperatingSystem[] getOperatingSystems() { + object[] results = this.Invoke("getOperatingSystems", new object[0]); + return ((OperatingSystem[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getMobilePlatformsReturn")] + public MobilePlatform[] getMobilePlatforms() { + object[] results = this.Invoke("getMobilePlatforms", new object[0]); + return ((MobilePlatform[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getRegionsReturn")] + public Region[] getRegions(long[] countryIds) { + object[] results = this.Invoke("getRegions", new object[] {countryIds}); + return ((Region[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getAdReturn")] + public AdBase getAd(long adId) { + object[] results = this.Invoke("getAd", new object[] {adId}); + return ((AdBase) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getAreaCodesReturn")] + public AreaCode[] getAreaCodes(long[] countryIds) { + object[] results = this.Invoke("getAreaCodes", new object[] {countryIds}); + return ((AreaCode[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getDesignatedMarketAreasReturn")] + public DesignatedMarketArea[] getDesignatedMarketAreas() { + object[] results = this.Invoke("getDesignatedMarketAreas", new object[0]); + return ((DesignatedMarketArea[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getStatesReturn")] + public State[] getStates(long[] countryIds) { + object[] results = this.Invoke("getStates", new object[] {countryIds}); + return ((State[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getDomainTypesReturn")] + public DomainType[] getDomainTypes() { + object[] results = this.Invoke("getDomainTypes", new object[0]); + return ((DomainType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getISPsReturn")] + public ISP[] getISPs() { + object[] results = this.Invoke("getISPs", new object[0]); + return ((ISP[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getOSPsReturn")] + public OSP[] getOSPs() { + object[] results = this.Invoke("getOSPs", new object[0]); + return ((OSP[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public void deleteAd(long adId) { + this.Invoke("deleteAd", new object[] {adId}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getAdsReturn")] + public AdRecordSet getAds(AdSearchCriteria adSearchCriteria) { + object[] results = this.Invoke("getAds", new object[] {adSearchCriteria}); + return ((AdRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getDomainNamesBySearchCriteriaReturn")] + public DomainNameRecordSet getDomainNamesBySearchCriteria(DomainNameSearchCriteria searchCriteria) { + object[] results = this.Invoke("getDomainNamesBySearchCriteria", new object[] {searchCriteria}); + return ((DomainNameRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getUserListGroupsByCriteriaReturn")] + public UserListGroup[] getUserListGroupsByCriteria(UserListSearchCriteria searchCriteria) { + object[] results = this.Invoke("getUserListGroupsByCriteria", new object[] {searchCriteria}); + return ((UserListGroup[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getUserListsByCriteriaReturn")] + public UserList[] getUserListsByCriteria(UserListSearchCriteria searchCriteria) { + object[] results = this.Invoke("getUserListsByCriteria", new object[] {searchCriteria}); + return ((UserList[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("saveAdReturn")] + public AdSaveResult saveAd(AdBase ad) { + object[] results = this.Invoke("saveAd", new object[] {ad}); + return ((AdSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("updateCreativeAssignmentPropertiesReturn")] + public CreativeAdAssociationSaveResultSet updateCreativeAssignmentProperties(CreativeAdAssociationUpdateRequest associationUpdateRequest) { + object[] results = this.Invoke("updateCreativeAssignmentProperties", new object[] {associationUpdateRequest}); + return ((CreativeAdAssociationSaveResultSet) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AdType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeAdAssociationSaveResultSet { + private bool inErrorField; + + private CreativeAdAssociationSaveResult[] saveResultsField; + + public bool inError { + get { return this.inErrorField; } + set { this.inErrorField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeAdAssociationSaveResult[] saveResults { + get { return this.saveResultsField; } + set { this.saveResultsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeAdAssociationSaveResult : SaveResult { + private string errorMessageField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AdSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AdCopyResult : SaveResult { + private AdCopyRequest adCopyRequestField; + + private string errorMessageField; + + private string nameField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public AdCopyRequest adCopyRequest { + get { return this.adCopyRequestField; } + set { this.adCopyRequestField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AdCopyRequest { + private long adIdField; + + private long campaignIdField; + + private bool copyCreativeAssociationField; + + private bool copyPlacementAssignmentField; + + public long adId { + get { return this.adIdField; } + set { this.adIdField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + public bool copyCreativeAssociation { + get { return this.copyCreativeAssociationField; } + set { this.copyCreativeAssociationField = value; } + } + + public bool copyPlacementAssignment { + get { return this.copyPlacementAssignmentField; } + set { this.copyPlacementAssignmentField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeAdAssociationUpdateRequest { + private long[] adIdsField; + + private bool associationStatusField; + + private string clickThroughUrlField; + + private long creativeIdField; + + private System.DateTime? endDateField; + + private string[] propertiesToUpdateField; + + private System.DateTime? startDateField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] adIds { + get { return this.adIdsField; } + set { this.adIdsField = value; } + } + + public bool associationStatus { + get { return this.associationStatusField; } + set { this.associationStatusField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string clickThroughUrl { + get { return this.clickThroughUrlField; } + set { this.clickThroughUrlField = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { this.creativeIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string[] propertiesToUpdate { + get { return this.propertiesToUpdateField; } + set { this.propertiesToUpdateField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class DomainNameRecordSet : PagedRecordSet { + private DomainName[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DomainName[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class DomainName : DomainNameBase { + private string companyNameField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string companyName { + get { return this.companyNameField; } + set { this.companyNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AdRecordSet : PagedRecordSet { + private AdBase[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public AdBase[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class UserListSearchCriteria : SearchCriteriaBase { + private long advertiserIdField; + + private long[] userListGroupIdsField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] userListGroupIds { + get { return this.userListGroupIdsField; } + set { this.userListGroupIdsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class DomainNameSearchCriteria : PageableSearchCriteriaBase { + private string domainField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string domain { + get { return this.domainField; } + set { this.domainField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AdSearchCriteria : PageableSearchCriteriaBase { + private ActiveFilter activeFilterField; + + private long campaignIdField; + + private long[] sizeIdsField; + + private long[] typeIdsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ActiveFilter activeFilter { + get { return this.activeFilterField; } + set { this.activeFilterField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] sizeIds { + get { return this.sizeIdsField; } + set { this.sizeIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] typeIds { + get { return this.typeIdsField; } + set { this.typeIdsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CitySearchCriteria { + private long[] countryIdsField; + + private long[] regionIdsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] countryIds { + get { return this.countryIdsField; } + set { this.countryIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] regionIds { + get { return this.regionIdsField; } + set { this.regionIdsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class UserList : Base { + private string descriptionField; + + private int estimatedUserCountField; + + private System.DateTime? modifiedTimestampField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public int estimatedUserCount { + get { return this.estimatedUserCountField; } + set { this.estimatedUserCountField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? modifiedTimestamp { + get { return this.modifiedTimestampField; } + set { this.modifiedTimestampField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class UserListGroup : Base { + private string descriptionField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class Region : Base { + private long countryIdField; + + public long countryId { + get { return this.countryIdField; } + set { this.countryIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "userroleSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class UserRoleRemoteService : DfaSoapClient { + public UserRoleRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.19/api/dfa-api/userrole"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("UserRole")] + public UserRole getUserRole(long userRoleId) { + object[] results = this.Invoke("getUserRole", new object[] {userRoleId}); + return ((UserRole) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getAvailablePermissionsReturn")] + public Permission[] getAvailablePermissions(long subnetworkId) { + object[] results = this.Invoke("getAvailablePermissions", new object[] {subnetworkId}); + return ((Permission[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getUserRolesReturn")] + public UserRoleRecordSet getUserRoles(UserRoleSearchCriteria criteria) { + object[] results = this.Invoke("getUserRoles", new object[] {criteria}); + return ((UserRoleRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public void deleteUserRole(long id) { + this.Invoke("deleteUserRole", new object[] {id}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getUserRoleSummariesReturn")] + public UserRoleSummaryRecordSet getUserRoleSummaries(UserRoleSearchCriteria searchCriteria) { + object[] results = this.Invoke("getUserRoleSummaries", new object[] {searchCriteria}); + return ((UserRoleSummaryRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("saveUserRoleReturn")] + public UserRoleSaveResult saveUserRole(UserRole userGroup) { + object[] results = this.Invoke("saveUserRole", new object[] {userGroup}); + return ((UserRoleSaveResult) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class UserRole : UserRoleBase { + private long parentUserRoleIdField; + + private Permission[] permissionsField; + + private long totalAssignedUsersField; + + public long parentUserRoleId { + get { return this.parentUserRoleIdField; } + set { this.parentUserRoleIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Permission[] permissions { + get { return this.permissionsField; } + set { this.permissionsField = value; } + } + + public long totalAssignedUsers { + get { return this.totalAssignedUsersField; } + set { this.totalAssignedUsersField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class UserRoleSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class UserRoleSummaryRecordSet : PagedRecordSet { + private UserRoleSummary[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public UserRoleSummary[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class UserRoleSummary : UserRoleBase { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(UserRoleSummary))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(UserRole))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class UserRoleBase : Base { + private bool defaultUserRoleField; + + private long subnetworkIdField; + + public bool defaultUserRole { + get { return this.defaultUserRoleField; } + set { this.defaultUserRoleField = value; } + } + + public long subnetworkId { + get { return this.subnetworkIdField; } + set { this.subnetworkIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class UserRoleRecordSet : PagedRecordSet { + private UserRole[] userRolesField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public UserRole[] userRoles { + get { return this.userRolesField; } + set { this.userRolesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class UserRoleSearchCriteria : PageableSearchCriteriaBase { + private bool parentNetworkUserRolesOnlyField; + + private SortOrder sortOrderField; + + private long subnetworkIdField; + + public bool parentNetworkUserRolesOnly { + get { return this.parentNetworkUserRolesOnlyField; } + set { this.parentNetworkUserRolesOnlyField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + + public long subnetworkId { + get { return this.subnetworkIdField; } + set { this.subnetworkIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "advertiserSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + public partial class AdvertiserRemoteService : DfaSoapClient { + public AdvertiserRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.19/api/dfa-api/advertiser"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getAdvertisersReturn")] + public AdvertiserRecordSet getAdvertisers(AdvertiserSearchCriteria advertiserSearchCriteria) { + object[] results = this.Invoke("getAdvertisers", new object[] {advertiserSearchCriteria}); + return ((AdvertiserRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("saveAdvertiserReturn")] + public AdvertiserSaveResult saveAdvertiser(Advertiser advertiser) { + object[] results = this.Invoke("saveAdvertiser", new object[] {advertiser}); + return ((AdvertiserSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public void deleteAdvertiser(long advertiserId) { + this.Invoke("deleteAdvertiser", new object[] {advertiserId}); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AdvertiserSearchCriteria : PageableSearchCriteriaBase { + private long[] advertiserGroupIdsField; + + private bool includeAdvertisersWithOutGroupOnlyField; + + private bool includeInventoryAdvertisersOnlyField; + + private long[] spotIdsField; + + private long subnetworkIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] advertiserGroupIds { + get { return this.advertiserGroupIdsField; } + set { this.advertiserGroupIdsField = value; } + } + + public bool includeAdvertisersWithOutGroupOnly { + get { return this.includeAdvertisersWithOutGroupOnlyField; } + set { this.includeAdvertisersWithOutGroupOnlyField = value; } + } + + public bool includeInventoryAdvertisersOnly { + get { return this.includeInventoryAdvertisersOnlyField; } + set { this.includeInventoryAdvertisersOnlyField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] spotIds { + get { return this.spotIdsField; } + set { this.spotIdsField = value; } + } + + public long subnetworkId { + get { return this.subnetworkIdField; } + set { this.subnetworkIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AdvertiserSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AdvertiserRecordSet : PagedRecordSet { + private Advertiser[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Advertiser[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "advertisergroupSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + public partial class AdvertiserGroupRemoteService : DfaSoapClient { + public AdvertiserGroupRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.19/api/dfa-api/advertisergroup"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getAdvertiserGroupsReturn")] + public AdvertiserGroupRecordSet getAdvertiserGroups(AdvertiserGroupSearchCriteria searchCriteria) { + object[] results = this.Invoke("getAdvertiserGroups", new object[] {searchCriteria}); + return ((AdvertiserGroupRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getAdvertiserGroupReturn")] + public AdvertiserGroup getAdvertiserGroup(long advertiserGroupId) { + object[] results = this.Invoke("getAdvertiserGroup", new object[] {advertiserGroupId}); + return ((AdvertiserGroup) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("saveAdvertiserGroupReturn")] + public AdvertiserGroupSaveResult saveAdvertiserGroup(AdvertiserGroup advertiserGroup) { + object[] results = this.Invoke("saveAdvertiserGroup", new object[] {advertiserGroup}); + return ((AdvertiserGroupSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public void deleteAdvertiserGroup(long advertiserGroupId) { + this.Invoke("deleteAdvertiserGroup", new object[] {advertiserGroupId}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public void assignAdvertisersToAdvertiserGroup(long advertiserGroupId, long[] advertiserIds) { + this.Invoke("assignAdvertisersToAdvertiserGroup", new object[] {advertiserGroupId, advertiserIds}); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AdvertiserGroupSearchCriteria : PageableSearchCriteriaBase { + private SortOrder sortOrderField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AdvertiserGroupSaveResult : SaveResult { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(AdvertiserGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AdvertiserGroupBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AdvertiserGroup : AdvertiserGroupBase { + private int advertiserCountField; + + public int advertiserCount { + get { return this.advertiserCountField; } + set { this.advertiserCountField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class AdvertiserGroupRecordSet : PagedRecordSet { + private AdvertiserGroup[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public AdvertiserGroup[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "campaignSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SpotlightActivityWeight))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class CampaignRemoteService : DfaSoapClient { + public CampaignRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.19/api/dfa-api/campaign"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("saveLandingPageReturn")] + public LandingPageSaveResult saveLandingPage(LandingPage landingPage) { + object[] results = this.Invoke("saveLandingPage", new object[] {landingPage}); + return ((LandingPageSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getCampaignReturn")] + public Campaign getCampaign(long id) { + object[] results = this.Invoke("getCampaign", new object[] {id}); + return ((Campaign) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public void deleteCampaign(long campaignId) { + this.Invoke("deleteCampaign", new object[] {campaignId}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("saveCampaignReturn")] + public CampaignSaveResult saveCampaign(Campaign campaign) { + object[] results = this.Invoke("saveCampaign", new object[] {campaign}); + return ((CampaignSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getLandingPagesForCampaignReturn")] + public LandingPageRecordSet getLandingPagesForCampaign(long nCampaignId) { + object[] results = this.Invoke("getLandingPagesForCampaign", new object[] {nCampaignId}); + return ((LandingPageRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("addLandingPageToCampaignReturn")] + public bool addLandingPageToCampaign(long nCampaignId, LandingPage[] landingPages) { + object[] results = this.Invoke("addLandingPageToCampaign", new object[] {nCampaignId, landingPages}); + return ((bool) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getCampaignsByCriteriaReturn")] + public CampaignRecordSet getCampaignsByCriteria(CampaignSearchCriteria searchCriteria) { + object[] results = this.Invoke("getCampaignsByCriteria", new object[] {searchCriteria}); + return ((CampaignRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("migrateCampaignReturn")] + public CampaignMigrationResult migrateCampaign(CampaignMigrationRequest campaignMigrationRequest) { + object[] results = this.Invoke("migrateCampaign", new object[] {campaignMigrationRequest}); + return ((CampaignMigrationResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("copyCampaignsReturn")] + public CampaignCopyResult[] copyCampaigns(CampaignCopyRequest[] campaignCopyRequests) { + object[] results = this.Invoke("copyCampaigns", new object[] {campaignCopyRequests}); + return ((CampaignCopyResult[]) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class LandingPage : LandingPageBase { + private string urlField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(LandingPage))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class LandingPageBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CampaignMigrationRequest { + private long campaignIdField; + + private string landingPageUrlField; + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string landingPageUrl { + get { return this.landingPageUrlField; } + set { this.landingPageUrlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CampaignRecordSet : PagedRecordSet { + private Campaign[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Campaign[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CampaignSearchCriteria : PageableSearchCriteriaBase { + private long[] advertiserIdsField; + + private ActiveFilter archiveFilterField; + + private SortOrder sortOrderField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] advertiserIds { + get { return this.advertiserIdsField; } + set { this.advertiserIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ActiveFilter archiveFilter { + get { return this.archiveFilterField; } + set { this.archiveFilterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class LandingPageRecordSet { + private LandingPage[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public LandingPage[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CampaignCopyRequest { + private long campaignIdField; + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CampaignCopyResult : SaveResult { + private CampaignCopyRequest copyRequestField; + + private string errorMessageField; + + private string nameField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CampaignCopyRequest copyRequest { + get { return this.copyRequestField; } + set { this.copyRequestField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CampaignMigrationResult : SaveResult { + private string errorMessageField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CampaignSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class LandingPageSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "changelogSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + public partial class ChangeLogRemoteService : DfaSoapClient { + public ChangeLogRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.19/api/dfa-api/changelog"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getChangeLogRecordReturn")] + public ChangeLogRecord getChangeLogRecord(long id) { + object[] results = this.Invoke("getChangeLogRecord", new object[] {id}); + return ((ChangeLogRecord) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getChangeLogRecordsReturn")] + public ChangeLogRecordSet getChangeLogRecords(ChangeLogRecordSearchCriteria criteria) { + object[] results = this.Invoke("getChangeLogRecords", new object[] {criteria}); + return ((ChangeLogRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getChangeLogRecordForObjectTypeReturn")] + public ChangeLogRecord getChangeLogRecordForObjectType(long id, long objectTypeId) { + object[] results = this.Invoke("getChangeLogRecordForObjectType", new object[] {id, objectTypeId}); + return ((ChangeLogRecord) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getChangeLogObjectTypesReturn")] + public ChangeLogObjectType[] getChangeLogObjectTypes() { + object[] results = this.Invoke("getChangeLogObjectTypes", new object[0]); + return ((ChangeLogObjectType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public void updateChangeLogRecordComments(long changeLogRecordId, string comments) { + this.Invoke("updateChangeLogRecordComments", new object[] {changeLogRecordId, comments}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public void updateChangeLogRecordCommentsForObjectType(long changeLogRecordId, string comments, long objectTypeId) { + this.Invoke("updateChangeLogRecordCommentsForObjectType", new object[] {changeLogRecordId, comments, objectTypeId}); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ChangeLogRecord { + private string actionField; + + private System.DateTime? changeDateField; + + private string commentsField; + + private string contextField; + + private long groupIdField; + + private long idField; + + private string newValueField; + + private long objectIdField; + + private string objectTypeField; + + private string oldValueField; + + private long userIdField; + + private string usernameField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string action { + get { return this.actionField; } + set { this.actionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? changeDate { + get { return this.changeDateField; } + set { this.changeDateField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string comments { + get { return this.commentsField; } + set { this.commentsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string context { + get { return this.contextField; } + set { this.contextField = value; } + } + + public long groupId { + get { return this.groupIdField; } + set { this.groupIdField = value; } + } + + public long id { + get { return this.idField; } + set { this.idField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string newValue { + get { return this.newValueField; } + set { this.newValueField = value; } + } + + public long objectId { + get { return this.objectIdField; } + set { this.objectIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string objectType { + get { return this.objectTypeField; } + set { this.objectTypeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string oldValue { + get { return this.oldValueField; } + set { this.oldValueField = value; } + } + + public long userId { + get { return this.userIdField; } + set { this.userIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string username { + get { return this.usernameField; } + set { this.usernameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ChangeLogObjectType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ChangeLogRecordSet : PagedRecordSet { + private ChangeLogRecord[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ChangeLogRecord[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ChangeLogRecordSearchCriteria : PageableSearchCriteriaBase { + private long objectIdField; + + private long objectTypeIdField; + + private SortOrder sortOrderField; + + public long objectId { + get { return this.objectIdField; } + set { this.objectIdField = value; } + } + + public long objectTypeId { + get { return this.objectTypeIdField; } + set { this.objectTypeIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "contentcategorySoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + public partial class ContentCategoryRemoteService : DfaSoapClient { + public ContentCategoryRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.19/api/dfa-api/contentcategory"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getContentCategoriesReturn")] + public ContentCategoryRecordSet getContentCategories(ContentCategorySearchCriteria searchCriteria) { + object[] results = this.Invoke("getContentCategories", new object[] {searchCriteria}); + return ((ContentCategoryRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("saveContentCategoryReturn")] + public ContentCategorySaveResult saveContentCategory(ContentCategory contentCategory) { + object[] results = this.Invoke("saveContentCategory", new object[] {contentCategory}); + return ((ContentCategorySaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getContentCategoryReturn")] + public ContentCategory getContentCategory(long contentCategoryId) { + object[] results = this.Invoke("getContentCategory", new object[] {contentCategoryId}); + return ((ContentCategory) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public void deleteContentCategory(long contentCategoryId) { + this.Invoke("deleteContentCategory", new object[] {contentCategoryId}); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ContentCategorySearchCriteria : PageableSearchCriteriaBase { + private SortOrder sortOrderField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ContentCategorySaveResult : SaveResult { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(ContentCategory))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ContentCategoryBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ContentCategory : ContentCategoryBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ContentCategoryRecordSet : PagedRecordSet { + private ContentCategory[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ContentCategory[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "creativeSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RawFileSummary))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeSaveRequest))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeRenderingResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeAssetBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(InStreamNonLinearAd))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(InStreamCompanionAd))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(FlashClickTag))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeFieldAssignment))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativePlacementAssignment))] + public partial class CreativeRemoteService : DfaSoapClient { + public CreativeRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.19/api/dfa-api/creative"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("assignCreativesToPlacementsReturn")] + public CreativePlacementAssignmentResult[] assignCreativesToPlacements(CreativePlacementAssignment[] creativePlacementAssignments) { + object[] results = this.Invoke("assignCreativesToPlacements", new object[] {creativePlacementAssignments}); + return ((CreativePlacementAssignmentResult[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativeReturn")] + public CreativeBase getCreative(long creativeId) { + object[] results = this.Invoke("getCreative", new object[] {creativeId}); + return ((CreativeBase) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativeAssetsReturn")] + public CreativeAssetRecordSet getCreativeAssets(CreativeAssetSearchCriteria searchCriteria) { + object[] results = this.Invoke("getCreativeAssets", new object[] {searchCriteria}); + return ((CreativeAssetRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("saveCreativeAssetReturn")] + public CreativeAssetSaveResult saveCreativeAsset(CreativeAsset creativeAsset) { + object[] results = this.Invoke("saveCreativeAsset", new object[] {creativeAsset}); + return ((CreativeAssetSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativesReturn")] + public CreativeRecordSet getCreatives(CreativeSearchCriteria searchCriteria) { + object[] results = this.Invoke("getCreatives", new object[] {searchCriteria}); + return ((CreativeRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("saveCreativeReturn")] + public CreativeSaveResult saveCreative(CreativeBase creativeBase, long campaignId) { + object[] results = this.Invoke("saveCreative", new object[] {creativeBase, campaignId}); + return ((CreativeSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativeTypesReturn")] + public CreativeType[] getCreativeTypes() { + object[] results = this.Invoke("getCreativeTypes", new object[0]); + return ((CreativeType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("associateCreativesToCampaignReturn")] + public CreativeCampaignAssociationResult[] associateCreativesToCampaign(long campaignId, long[] creativeIds) { + object[] results = this.Invoke("associateCreativesToCampaign", new object[] {campaignId, creativeIds}); + return ((CreativeCampaignAssociationResult[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("copyCreativeReturn")] + public CreativeCopyResult[] copyCreative(CreativeCopyRequest[] copyRequests) { + object[] results = this.Invoke("copyCreative", new object[] {copyRequests}); + return ((CreativeCopyResult[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("uploadRichMediaAssetReturn")] + public RichMediaCreativeBase uploadRichMediaAsset(RichMediaAssetUploadRequest uploadRequest) { + object[] results = this.Invoke("uploadRichMediaAsset", new object[] {uploadRequest}); + return ((RichMediaCreativeBase) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("replaceRichMediaAssetReturn")] + public RichMediaCreativeBase replaceRichMediaAsset(string oldAssetFileName, RichMediaAssetUploadRequest replaceRequest) { + object[] results = this.Invoke("replaceRichMediaAsset", new object[] {oldAssetFileName, replaceRequest}); + return ((RichMediaCreativeBase) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("deleteRichMediaAssetReturn")] + public RichMediaCreativeBase deleteRichMediaAsset(long creativeId, string assetFileName) { + object[] results = this.Invoke("deleteRichMediaAsset", new object[] {creativeId, assetFileName}); + return ((RichMediaCreativeBase) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("uploadRichMediaCreativePackageReturn")] + public RichMediaCreativeBase uploadRichMediaCreativePackage(long advertiserId, [System.Xml.Serialization.SoapElementAttribute(DataType = "base64Binary")] +byte[] fileData, bool uploadAsFlashInFlashCreative) { + object[] results = this.Invoke("uploadRichMediaCreativePackage", new object[] {advertiserId, fileData, uploadAsFlashInFlashCreative}); + return ((RichMediaCreativeBase) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("replaceRichMediaCreativePackageReturn")] + public RichMediaCreativeBase replaceRichMediaCreativePackage(long creativeId, [System.Xml.Serialization.SoapElementAttribute(DataType = "base64Binary")] +byte[] fileData) { + object[] results = this.Invoke("replaceRichMediaCreativePackage", new object[] {creativeId, fileData}); + return ((RichMediaCreativeBase) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getRichMediaPreviewURLReturn")] + public string getRichMediaPreviewURL(long creativeId) { + object[] results = this.Invoke("getRichMediaPreviewURL", new object[] {creativeId}); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativeRenderingsReturn")] + public CreativeRenderingResult[] getCreativeRenderings(CreativeRenderingRequest creativeRenderingRequest) { + object[] results = this.Invoke("getCreativeRenderings", new object[] {creativeRenderingRequest}); + return ((CreativeRenderingResult[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("uploadInStreamAssetReturn")] + public InStreamVideoCreative uploadInStreamAsset(InStreamAssetUploadRequest assetUploadRequest) { + object[] results = this.Invoke("uploadInStreamAsset", new object[] {assetUploadRequest}); + return ((InStreamVideoCreative) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("deleteInStreamAssetReturn")] + public InStreamVideoCreative deleteInStreamAsset(long creativeId, string assetName) { + object[] results = this.Invoke("deleteInStreamAsset", new object[] {creativeId, assetName}); + return ((InStreamVideoCreative) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("replaceInStreamAssetReturn")] + public InStreamVideoCreative replaceInStreamAsset(string assetName, InStreamAssetUploadRequest assetReplaceRequest) { + object[] results = this.Invoke("replaceInStreamAsset", new object[] {assetName, assetReplaceRequest}); + return ((InStreamVideoCreative) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("generateCreativeUploadSessionReturn")] + public CreativeUploadSession generateCreativeUploadSession(CreativeUploadSessionRequest creativeUploadSessionRequest) { + object[] results = this.Invoke("generateCreativeUploadSession", new object[] {creativeUploadSessionRequest}); + return ((CreativeUploadSession) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("uploadCreativeFilesReturn")] + public CreativeUploadSession uploadCreativeFiles(CreativeUploadRequest uploadRequest) { + object[] results = this.Invoke("uploadCreativeFiles", new object[] {uploadRequest}); + return ((CreativeUploadSession) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getCompleteCreativeUploadSessionReturn")] + public CreativeUploadSession getCompleteCreativeUploadSession(CreativeUploadSessionSummary uploadSession) { + object[] results = this.Invoke("getCompleteCreativeUploadSession", new object[] {uploadSession}); + return ((CreativeUploadSession) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("createCreativesFromCreativeUploadSessionReturn")] + public CreativeUploadSession createCreativesFromCreativeUploadSession(CreativeUploadSession uploadSession) { + object[] results = this.Invoke("createCreativesFromCreativeUploadSession", new object[] {uploadSession}); + return ((CreativeUploadSession) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public void deleteCreative(long creativeId) { + this.Invoke("deleteCreative", new object[] {creativeId}); + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativePlacementAssignmentResult))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativePlacementAssignment { + private string adNameField; + + private long creativeIdField; + + private long placementIdField; + + private long[] placementIdsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string adName { + get { return this.adNameField; } + set { this.adNameField = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { this.creativeIdField = value; } + } + + public long placementId { + get { return this.placementIdField; } + set { this.placementIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] placementIds { + get { return this.placementIdsField; } + set { this.placementIdsField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RawFile))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RawFileSummary { + private string filenameField; + + private string mimeTypeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string filename { + get { return this.filenameField; } + set { this.filenameField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string mimeType { + get { return this.mimeTypeField; } + set { this.mimeTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RawFile : RawFileSummary { + private byte[] fileDataField; + + [System.Xml.Serialization.SoapElementAttribute(DataType = "base64Binary", IsNullable = true)] + public byte[] fileData { + get { return this.fileDataField; } + set { this.fileDataField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeUploadRequest { + private CreativeUploadSessionSummary creativeUploadSessionSummaryField; + + private RawFile[] rawFilesField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeUploadSessionSummary creativeUploadSessionSummary { + get { return this.creativeUploadSessionSummaryField; } + set { this.creativeUploadSessionSummaryField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RawFile[] rawFiles { + get { return this.rawFilesField; } + set { this.rawFilesField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeUploadSession))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeUploadSessionSummary { + private long advertiserIdField; + + private long campaignIdField; + + private long creativeUploadIdField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + public long creativeUploadId { + get { return this.creativeUploadIdField; } + set { this.creativeUploadIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeUploadSession : CreativeUploadSessionSummary { + private CreativeSaveRequest[] creativeSaveRequestsField; + + private CreativeUploadFileCount fileCountField; + + private int statusField; + + private CreativeUploadFile[] uploadedFilesField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeSaveRequest[] creativeSaveRequests { + get { return this.creativeSaveRequestsField; } + set { this.creativeSaveRequestsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeUploadFileCount fileCount { + get { return this.fileCountField; } + set { this.fileCountField = value; } + } + + public int status { + get { return this.statusField; } + set { this.statusField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeUploadFile[] uploadedFiles { + get { return this.uploadedFilesField; } + set { this.uploadedFilesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeSaveRequest { + private long creativeIdField; + + private string errorMessageField; + + private FlashFile flashFileField; + + private ImageFile imageFileField; + + public long creativeId { + get { return this.creativeIdField; } + set { this.creativeIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public FlashFile flashFile { + get { return this.flashFileField; } + set { this.flashFileField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ImageFile imageFile { + get { return this.imageFileField; } + set { this.imageFileField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class FlashFile : CreativeUploadFileBase { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(ImageFile))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(FlashFile))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public abstract partial class CreativeUploadFileBase : Base { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeUploadFile))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeUploadFileSummary : Base { + private string sourcePathField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string sourcePath { + get { return this.sourcePathField; } + set { this.sourcePathField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeUploadFile : CreativeUploadFileSummary { + private Dimensions dimensionsField; + + private string errorMessageField; + + private long fileLengthField; + + private bool flashFileField; + + private CreativeUploadFileSummary[] matchedFilesField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Dimensions dimensions { + get { return this.dimensionsField; } + set { this.dimensionsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + + public long fileLength { + get { return this.fileLengthField; } + set { this.fileLengthField = value; } + } + + public bool flashFile { + get { return this.flashFileField; } + set { this.flashFileField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeUploadFileSummary[] matchedFiles { + get { return this.matchedFilesField; } + set { this.matchedFilesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class Dimensions { + private int heightField; + + private int widthField; + + public int height { + get { return this.heightField; } + set { this.heightField = value; } + } + + public int width { + get { return this.widthField; } + set { this.widthField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class InStreamMediaFile : Base { + private double bitrateField; + + private float fileSizeField; + + private int heightField; + + private string mimeTypeField; + + private bool pickedToServeField; + + private int widthField; + + public double bitrate { + get { return this.bitrateField; } + set { this.bitrateField = value; } + } + + public float fileSize { + get { return this.fileSizeField; } + set { this.fileSizeField = value; } + } + + public int height { + get { return this.heightField; } + set { this.heightField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string mimeType { + get { return this.mimeTypeField; } + set { this.mimeTypeField = value; } + } + + public bool pickedToServe { + get { return this.pickedToServeField; } + set { this.pickedToServeField = value; } + } + + public int width { + get { return this.widthField; } + set { this.widthField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaTimerEvent))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaExitEvent))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaCounterEvent))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaEventBase : Base { + private string descriptionField; + + private string modeField; + + private long parentAssetIdField; + + private string typeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string mode { + get { return this.modeField; } + set { this.modeField = value; } + } + + public long parentAssetId { + get { return this.parentAssetIdField; } + set { this.parentAssetIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string type { + get { return this.typeField; } + set { this.typeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaTimerEvent : RichMediaEventBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaExitEvent : RichMediaEventBase { + private RichMediaExitWindowProperties exitWindowPropertiesField; + + private string targetField; + + private string urlField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaExitWindowProperties exitWindowProperties { + get { return this.exitWindowPropertiesField; } + set { this.exitWindowPropertiesField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string target { + get { return this.targetField; } + set { this.targetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaExitWindowProperties { + private int heightField; + + private int leftField; + + private bool locationBarField; + + private bool menuBarField; + + private bool resizableField; + + private bool scrollBarsField; + + private bool statusBarField; + + private bool toolBarField; + + private int topField; + + private int widthField; + + public int height { + get { return this.heightField; } + set { this.heightField = value; } + } + + public int left { + get { return this.leftField; } + set { this.leftField = value; } + } + + public bool locationBar { + get { return this.locationBarField; } + set { this.locationBarField = value; } + } + + public bool menuBar { + get { return this.menuBarField; } + set { this.menuBarField = value; } + } + + public bool resizable { + get { return this.resizableField; } + set { this.resizableField = value; } + } + + public bool scrollBars { + get { return this.scrollBarsField; } + set { this.scrollBarsField = value; } + } + + public bool statusBar { + get { return this.statusBarField; } + set { this.statusBarField = value; } + } + + public bool toolBar { + get { return this.toolBarField; } + set { this.toolBarField = value; } + } + + public int top { + get { return this.topField; } + set { this.topField = value; } + } + + public int width { + get { return this.widthField; } + set { this.widthField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaCounterEvent : RichMediaEventBase { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(TrackingTextCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RedirectCreativeBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(InternalRedirectCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(InterstitialInternalRedirectCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RedirectCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(InStreamVideoCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(ImageCreativeBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(TrackingImageCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(ImageCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaCreativeBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaImageWithOverlayCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaImageWithFloatingCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaOverlayCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFloatingWithReminderCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaExpandingCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaMultiFloatingCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaInPageCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFloatingCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaInPageWithOverlayCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFlashInFlashCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaMobileInAppCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaInPageWithFloatingCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(HTMLCreativeBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(TrackingHTMLCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(MobileDisplayCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(HTMLCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(HTMLInterstitialCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(FlashInpageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public abstract partial class CreativeBase : Base { + private bool activeField; + + private long advertiserIdField; + + private bool archivedField; + + private CreativeFieldAssignment[] creativeFieldAssignmentsField; + + private long sizeIdField; + + private long typeIdField; + + private int versionField; + + public bool active { + get { return this.activeField; } + set { this.activeField = value; } + } + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + public bool archived { + get { return this.archivedField; } + set { this.archivedField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeFieldAssignment[] creativeFieldAssignments { + get { return this.creativeFieldAssignmentsField; } + set { this.creativeFieldAssignmentsField = value; } + } + + public long sizeId { + get { return this.sizeIdField; } + set { this.sizeIdField = value; } + } + + public long typeId { + get { return this.typeIdField; } + set { this.typeIdField = value; } + } + + public int version { + get { return this.versionField; } + set { this.versionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeFieldAssignment { + private long creativeFieldIdField; + + private long creativeFieldValueIdField; + + public long creativeFieldId { + get { return this.creativeFieldIdField; } + set { this.creativeFieldIdField = value; } + } + + public long creativeFieldValueId { + get { return this.creativeFieldValueIdField; } + set { this.creativeFieldValueIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class TrackingTextCreative : CreativeBase { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(InternalRedirectCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(InterstitialInternalRedirectCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RedirectCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public abstract partial class RedirectCreativeBase : CreativeBase { + private string redirectUrlField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string redirectUrl { + get { return this.redirectUrlField; } + set { this.redirectUrlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class InternalRedirectCreative : RedirectCreativeBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class InterstitialInternalRedirectCreative : RedirectCreativeBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RedirectCreative : RedirectCreativeBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class InStreamVideoCreative : CreativeBase { + private string adIdField; + + private string clickThroughUrlField; + + private InStreamCompanionAd[] companionAdsField; + + private System.DateTime? createdDateField; + + private string descriptionField; + + private InStreamMediaFile[] mediaFilesField; + + private InStreamNonLinearAd[] nonLinearAdsField; + + private bool skippableAdField; + + private string surveyUrlField; + + private InStreamThirdPartyTrackingEvents thirdPartyTrackingEventsField; + + private float videoDurationField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string adId { + get { return this.adIdField; } + set { this.adIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string clickThroughUrl { + get { return this.clickThroughUrlField; } + set { this.clickThroughUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public InStreamCompanionAd[] companionAds { + get { return this.companionAdsField; } + set { this.companionAdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? createdDate { + get { return this.createdDateField; } + set { this.createdDateField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public InStreamMediaFile[] mediaFiles { + get { return this.mediaFilesField; } + set { this.mediaFilesField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public InStreamNonLinearAd[] nonLinearAds { + get { return this.nonLinearAdsField; } + set { this.nonLinearAdsField = value; } + } + + public bool skippableAd { + get { return this.skippableAdField; } + set { this.skippableAdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string surveyUrl { + get { return this.surveyUrlField; } + set { this.surveyUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public InStreamThirdPartyTrackingEvents thirdPartyTrackingEvents { + get { return this.thirdPartyTrackingEventsField; } + set { this.thirdPartyTrackingEventsField = value; } + } + + public float videoDuration { + get { return this.videoDurationField; } + set { this.videoDurationField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class InStreamCompanionAd { + private string adParametersField; + + private string altTextField; + + private string clickThroughUrlField; + + private int expandedHeightField; + + private int expandedWidthField; + + private string fileNameField; + + private int heightField; + + private long idField; + + private string urlField; + + private int widthField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string adParameters { + get { return this.adParametersField; } + set { this.adParametersField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string clickThroughUrl { + get { return this.clickThroughUrlField; } + set { this.clickThroughUrlField = value; } + } + + public int expandedHeight { + get { return this.expandedHeightField; } + set { this.expandedHeightField = value; } + } + + public int expandedWidth { + get { return this.expandedWidthField; } + set { this.expandedWidthField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public int height { + get { return this.heightField; } + set { this.heightField = value; } + } + + public long id { + get { return this.idField; } + set { this.idField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + + public int width { + get { return this.widthField; } + set { this.widthField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class InStreamNonLinearAd { + private string adParametersField; + + private string clickThroughUrlField; + + private int expandedHeightField; + + private int expandedWidthField; + + private string fileNameField; + + private int heightField; + + private long idField; + + private bool maintainAspectRatioField; + + private bool scalableField; + + private string urlField; + + private int widthField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string adParameters { + get { return this.adParametersField; } + set { this.adParametersField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string clickThroughUrl { + get { return this.clickThroughUrlField; } + set { this.clickThroughUrlField = value; } + } + + public int expandedHeight { + get { return this.expandedHeightField; } + set { this.expandedHeightField = value; } + } + + public int expandedWidth { + get { return this.expandedWidthField; } + set { this.expandedWidthField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public int height { + get { return this.heightField; } + set { this.heightField = value; } + } + + public long id { + get { return this.idField; } + set { this.idField = value; } + } + + public bool maintainAspectRatio { + get { return this.maintainAspectRatioField; } + set { this.maintainAspectRatioField = value; } + } + + public bool scalable { + get { return this.scalableField; } + set { this.scalableField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + + public int width { + get { return this.widthField; } + set { this.widthField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class InStreamThirdPartyTrackingEvents { + private string clickTrackingUrlField; + + private string completeUrlField; + + private string customClickUrlField; + + private string firstQuartileUrlField; + + private string fullScreenUrlField; + + private string impressionUrlField; + + private string midPointUrlField; + + private string muteUrlField; + + private string pauseUrlField; + + private string replayUrlField; + + private string startUrlField; + + private string stopUrlField; + + private string thirdQuartileUrlField; + + private string videoSkipUrlField; + + private string videoViewUrlField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string clickTrackingUrl { + get { return this.clickTrackingUrlField; } + set { this.clickTrackingUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string completeUrl { + get { return this.completeUrlField; } + set { this.completeUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string customClickUrl { + get { return this.customClickUrlField; } + set { this.customClickUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string firstQuartileUrl { + get { return this.firstQuartileUrlField; } + set { this.firstQuartileUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string fullScreenUrl { + get { return this.fullScreenUrlField; } + set { this.fullScreenUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string impressionUrl { + get { return this.impressionUrlField; } + set { this.impressionUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string midPointUrl { + get { return this.midPointUrlField; } + set { this.midPointUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string muteUrl { + get { return this.muteUrlField; } + set { this.muteUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string pauseUrl { + get { return this.pauseUrlField; } + set { this.pauseUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string replayUrl { + get { return this.replayUrlField; } + set { this.replayUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string startUrl { + get { return this.startUrlField; } + set { this.startUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string stopUrl { + get { return this.stopUrlField; } + set { this.stopUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string thirdQuartileUrl { + get { return this.thirdQuartileUrlField; } + set { this.thirdQuartileUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string videoSkipUrl { + get { return this.videoSkipUrlField; } + set { this.videoSkipUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string videoViewUrl { + get { return this.videoViewUrlField; } + set { this.videoViewUrlField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(TrackingImageCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(ImageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public abstract partial class ImageCreativeBase : CreativeBase { + private string alternateTextField; + + private string assetFilenameField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string alternateText { + get { return this.alternateTextField; } + set { this.alternateTextField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string assetFilename { + get { return this.assetFilenameField; } + set { this.assetFilenameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class TrackingImageCreative : ImageCreativeBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ImageCreative : ImageCreativeBase { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaImageWithOverlayCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaImageWithFloatingCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaOverlayCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFloatingWithReminderCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaExpandingCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaMultiFloatingCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaInPageCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFloatingCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaInPageWithOverlayCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFlashInFlashCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaMobileInAppCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaInPageWithFloatingCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public abstract partial class RichMediaCreativeBase : CreativeBase { + private string actionScriptVersionField; + + private string adRequestKeysField; + + private string authoringApplicationField; + + private RichMediaAsset[] childAssetsField; + + private string commentsField; + + private RichMediaCounterEvent[] counterEventsField; + + private System.DateTime? createdDateField; + + private string[] creativeAttributesField; + + private string customKeyValuesField; + + private RichMediaExitEvent[] exitEventsField; + + private bool flashInFlashField; + + private bool interstitialField; + + private string metaDataField; + + private string modeField; + + private int placementHeightField; + + private int placementWidthField; + + private string requiredFlashPlayerVersionField; + + private string surveyUrlField; + + private string thirdPartyBackupImageImpressionUrlField; + + private string thirdPartyClickUrlField; + + private string thirdPartyFlashImpressionUrlField; + + private string thirdPartyImpressionUrlField; + + private RichMediaTimerEvent[] timerEventField; + + private int totalFileSizeField; + + private string typeField; + + private long videoLengthField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string actionScriptVersion { + get { return this.actionScriptVersionField; } + set { this.actionScriptVersionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string adRequestKeys { + get { return this.adRequestKeysField; } + set { this.adRequestKeysField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string authoringApplication { + get { return this.authoringApplicationField; } + set { this.authoringApplicationField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaAsset[] childAssets { + get { return this.childAssetsField; } + set { this.childAssetsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string comments { + get { return this.commentsField; } + set { this.commentsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaCounterEvent[] counterEvents { + get { return this.counterEventsField; } + set { this.counterEventsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? createdDate { + get { return this.createdDateField; } + set { this.createdDateField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string[] creativeAttributes { + get { return this.creativeAttributesField; } + set { this.creativeAttributesField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string customKeyValues { + get { return this.customKeyValuesField; } + set { this.customKeyValuesField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaExitEvent[] exitEvents { + get { return this.exitEventsField; } + set { this.exitEventsField = value; } + } + + public bool flashInFlash { + get { return this.flashInFlashField; } + set { this.flashInFlashField = value; } + } + + public bool interstitial { + get { return this.interstitialField; } + set { this.interstitialField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string metaData { + get { return this.metaDataField; } + set { this.metaDataField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string mode { + get { return this.modeField; } + set { this.modeField = value; } + } + + public int placementHeight { + get { return this.placementHeightField; } + set { this.placementHeightField = value; } + } + + public int placementWidth { + get { return this.placementWidthField; } + set { this.placementWidthField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string requiredFlashPlayerVersion { + get { return this.requiredFlashPlayerVersionField; } + set { this.requiredFlashPlayerVersionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string surveyUrl { + get { return this.surveyUrlField; } + set { this.surveyUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string thirdPartyBackupImageImpressionUrl { + get { return this.thirdPartyBackupImageImpressionUrlField; } + set { this.thirdPartyBackupImageImpressionUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string thirdPartyClickUrl { + get { return this.thirdPartyClickUrlField; } + set { this.thirdPartyClickUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string thirdPartyFlashImpressionUrl { + get { return this.thirdPartyFlashImpressionUrlField; } + set { this.thirdPartyFlashImpressionUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string thirdPartyImpressionUrl { + get { return this.thirdPartyImpressionUrlField; } + set { this.thirdPartyImpressionUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaTimerEvent[] timerEvent { + get { return this.timerEventField; } + set { this.timerEventField = value; } + } + + public int totalFileSize { + get { return this.totalFileSizeField; } + set { this.totalFileSizeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string type { + get { return this.typeField; } + set { this.typeField = value; } + } + + public long videoLength { + get { return this.videoLengthField; } + set { this.videoLengthField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaVideoAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaHtmlAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaExpandingHtmlAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaInPageHtmlAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFloatingHtmlAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaMobileInAppAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaImageAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFlashAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaOverlayAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaExpandingAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaReminderAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaInPageAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFloatingAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaMultiFloatingAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaAsset { + private string fileNameField; + + private int fileSizeField; + + private long idField; + + private long parentAssetIdField; + + private string typeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public int fileSize { + get { return this.fileSizeField; } + set { this.fileSizeField = value; } + } + + public long id { + get { return this.idField; } + set { this.idField = value; } + } + + public long parentAssetId { + get { return this.parentAssetIdField; } + set { this.parentAssetIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string type { + get { return this.typeField; } + set { this.typeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaVideoAsset : RichMediaAsset { + private string progressiveUrlField; + + private string streamingUrlField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string progressiveUrl { + get { return this.progressiveUrlField; } + set { this.progressiveUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string streamingUrl { + get { return this.streamingUrlField; } + set { this.streamingUrlField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaExpandingHtmlAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaInPageHtmlAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFloatingHtmlAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaMobileInAppAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaHtmlAsset : RichMediaAsset { + private string creativeFormatField; + + private int heightField; + + private int widthField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string creativeFormat { + get { return this.creativeFormatField; } + set { this.creativeFormatField = value; } + } + + public int height { + get { return this.heightField; } + set { this.heightField = value; } + } + + public int width { + get { return this.widthField; } + set { this.widthField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaExpandingHtmlAsset : RichMediaHtmlAsset { + private string zIndexField; + + private RichMediaImageAsset alternateImageField; + + private int bottomOffsetField; + + private int expandedHeightField; + + private int expandedWidthField; + + private bool hideDropDownsField; + + private bool hideFlashObjectsField; + + private int leftOffsetField; + + private int rightOffsetField; + + private int topOffsetField; + + private bool transparentField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string ZIndex { + get { return this.zIndexField; } + set { this.zIndexField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaImageAsset alternateImage { + get { return this.alternateImageField; } + set { this.alternateImageField = value; } + } + + public int bottomOffset { + get { return this.bottomOffsetField; } + set { this.bottomOffsetField = value; } + } + + public int expandedHeight { + get { return this.expandedHeightField; } + set { this.expandedHeightField = value; } + } + + public int expandedWidth { + get { return this.expandedWidthField; } + set { this.expandedWidthField = value; } + } + + public bool hideDropDowns { + get { return this.hideDropDownsField; } + set { this.hideDropDownsField = value; } + } + + public bool hideFlashObjects { + get { return this.hideFlashObjectsField; } + set { this.hideFlashObjectsField = value; } + } + + public int leftOffset { + get { return this.leftOffsetField; } + set { this.leftOffsetField = value; } + } + + public int rightOffset { + get { return this.rightOffsetField; } + set { this.rightOffsetField = value; } + } + + public int topOffset { + get { return this.topOffsetField; } + set { this.topOffsetField = value; } + } + + public bool transparent { + get { return this.transparentField; } + set { this.transparentField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaImageAsset : RichMediaAsset { + private string altTextField; + + private bool backupImageField; + + private RichMediaExitEvent exitEventField; + + private int heightField; + + private int widthField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + public bool backupImage { + get { return this.backupImageField; } + set { this.backupImageField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaExitEvent exitEvent { + get { return this.exitEventField; } + set { this.exitEventField = value; } + } + + public int height { + get { return this.heightField; } + set { this.heightField = value; } + } + + public int width { + get { return this.widthField; } + set { this.widthField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaInPageHtmlAsset : RichMediaHtmlAsset { + private RichMediaImageAsset alternateImageAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaImageAsset alternateImageAsset { + get { return this.alternateImageAssetField; } + set { this.alternateImageAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaFloatingHtmlAsset : RichMediaHtmlAsset { + private int durationField; + + private bool hideDropDownsField; + + private bool hideFlashObjectsField; + + private int leftField; + + private bool leftLockPositionField; + + private string leftUnitField; + + private int startTimeField; + + private int topField; + + private bool topLockPositionField; + + private string topUnitField; + + private bool transparentField; + + private string zIndexField; + + public int duration { + get { return this.durationField; } + set { this.durationField = value; } + } + + public bool hideDropDowns { + get { return this.hideDropDownsField; } + set { this.hideDropDownsField = value; } + } + + public bool hideFlashObjects { + get { return this.hideFlashObjectsField; } + set { this.hideFlashObjectsField = value; } + } + + public int left { + get { return this.leftField; } + set { this.leftField = value; } + } + + public bool leftLockPosition { + get { return this.leftLockPositionField; } + set { this.leftLockPositionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string leftUnit { + get { return this.leftUnitField; } + set { this.leftUnitField = value; } + } + + public int startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public int top { + get { return this.topField; } + set { this.topField = value; } + } + + public bool topLockPosition { + get { return this.topLockPositionField; } + set { this.topLockPositionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string topUnit { + get { return this.topUnitField; } + set { this.topUnitField = value; } + } + + public bool transparent { + get { return this.transparentField; } + set { this.transparentField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string zIndex { + get { return this.zIndexField; } + set { this.zIndexField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaMobileInAppAsset : RichMediaHtmlAsset { + private RichMediaImageAsset alternateImageAssetField; + + private bool transparentField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaImageAsset alternateImageAsset { + get { return this.alternateImageAssetField; } + set { this.alternateImageAssetField = value; } + } + + public bool transparent { + get { return this.transparentField; } + set { this.transparentField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaOverlayAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaExpandingAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaReminderAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaInPageAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFloatingAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaMultiFloatingAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaFlashAsset : RichMediaAsset { + private string creativeFormatField; + + private int heightField; + + private int widthField; + + private string wmodeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string creativeFormat { + get { return this.creativeFormatField; } + set { this.creativeFormatField = value; } + } + + public int height { + get { return this.heightField; } + set { this.heightField = value; } + } + + public int width { + get { return this.widthField; } + set { this.widthField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string wmode { + get { return this.wmodeField; } + set { this.wmodeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaOverlayAsset : RichMediaFlashAsset { + private bool addressBarField; + + private int durationField; + + private int leftField; + + private string leftUnitField; + + private bool menuBarField; + + private bool overlayField; + + private int startTimeField; + + private bool statusBarField; + + private bool toolBarField; + + private int topField; + + private string topUnitField; + + private string windowTitleField; + + public bool addressBar { + get { return this.addressBarField; } + set { this.addressBarField = value; } + } + + public int duration { + get { return this.durationField; } + set { this.durationField = value; } + } + + public int left { + get { return this.leftField; } + set { this.leftField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string leftUnit { + get { return this.leftUnitField; } + set { this.leftUnitField = value; } + } + + public bool menuBar { + get { return this.menuBarField; } + set { this.menuBarField = value; } + } + + public bool overlay { + get { return this.overlayField; } + set { this.overlayField = value; } + } + + public int startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public bool statusBar { + get { return this.statusBarField; } + set { this.statusBarField = value; } + } + + public bool toolBar { + get { return this.toolBarField; } + set { this.toolBarField = value; } + } + + public int top { + get { return this.topField; } + set { this.topField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string topUnit { + get { return this.topUnitField; } + set { this.topUnitField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string windowTitle { + get { return this.windowTitleField; } + set { this.windowTitleField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaExpandingAsset : RichMediaFlashAsset { + private string zIndexField; + + private RichMediaImageAsset alternateImageField; + + private int bottomOffsetField; + + private int expandedHeightField; + + private int expandedWidthField; + + private bool hideDropDownsField; + + private bool hideFlashObjectsField; + + private bool hideIframesField; + + private bool hideJavaAppletsField; + + private bool hideScrollBarsField; + + private int leftOffsetField; + + private bool multidirectionalField; + + private bool pushDownField; + + private double pushdownAnimationTimeField; + + private int rightOffsetField; + + private int topOffsetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string ZIndex { + get { return this.zIndexField; } + set { this.zIndexField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaImageAsset alternateImage { + get { return this.alternateImageField; } + set { this.alternateImageField = value; } + } + + public int bottomOffset { + get { return this.bottomOffsetField; } + set { this.bottomOffsetField = value; } + } + + public int expandedHeight { + get { return this.expandedHeightField; } + set { this.expandedHeightField = value; } + } + + public int expandedWidth { + get { return this.expandedWidthField; } + set { this.expandedWidthField = value; } + } + + public bool hideDropDowns { + get { return this.hideDropDownsField; } + set { this.hideDropDownsField = value; } + } + + public bool hideFlashObjects { + get { return this.hideFlashObjectsField; } + set { this.hideFlashObjectsField = value; } + } + + public bool hideIframes { + get { return this.hideIframesField; } + set { this.hideIframesField = value; } + } + + public bool hideJavaApplets { + get { return this.hideJavaAppletsField; } + set { this.hideJavaAppletsField = value; } + } + + public bool hideScrollBars { + get { return this.hideScrollBarsField; } + set { this.hideScrollBarsField = value; } + } + + public int leftOffset { + get { return this.leftOffsetField; } + set { this.leftOffsetField = value; } + } + + public bool multidirectional { + get { return this.multidirectionalField; } + set { this.multidirectionalField = value; } + } + + public bool pushDown { + get { return this.pushDownField; } + set { this.pushDownField = value; } + } + + public double pushdownAnimationTime { + get { return this.pushdownAnimationTimeField; } + set { this.pushdownAnimationTimeField = value; } + } + + public int rightOffset { + get { return this.rightOffsetField; } + set { this.rightOffsetField = value; } + } + + public int topOffset { + get { return this.topOffsetField; } + set { this.topOffsetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaReminderAsset : RichMediaFlashAsset { + private string zIndexField; + + private int durationField; + + private int leftField; + + private bool leftLockPositionField; + + private string leftUnitField; + + private int startTimeField; + + private int topField; + + private bool topLockPositionField; + + private string topUnitField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string ZIndex { + get { return this.zIndexField; } + set { this.zIndexField = value; } + } + + public int duration { + get { return this.durationField; } + set { this.durationField = value; } + } + + public int left { + get { return this.leftField; } + set { this.leftField = value; } + } + + public bool leftLockPosition { + get { return this.leftLockPositionField; } + set { this.leftLockPositionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string leftUnit { + get { return this.leftUnitField; } + set { this.leftUnitField = value; } + } + + public int startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public int top { + get { return this.topField; } + set { this.topField = value; } + } + + public bool topLockPosition { + get { return this.topLockPositionField; } + set { this.topLockPositionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string topUnit { + get { return this.topUnitField; } + set { this.topUnitField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaInPageAsset : RichMediaFlashAsset { + private RichMediaImageAsset alternateImageAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaImageAsset alternateImageAsset { + get { return this.alternateImageAssetField; } + set { this.alternateImageAssetField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaMultiFloatingAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaFloatingAsset : RichMediaFlashAsset { + private string zIndexField; + + private int durationField; + + private bool hideDropDownsField; + + private bool hideFlashObjectsField; + + private bool hideIframesField; + + private bool hideJavaAppletsField; + + private bool hideScrollBarsField; + + private int leftField; + + private bool leftLockPositionField; + + private string leftUnitField; + + private int startTimeField; + + private int topField; + + private bool topLockPositionField; + + private string topUnitField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string ZIndex { + get { return this.zIndexField; } + set { this.zIndexField = value; } + } + + public int duration { + get { return this.durationField; } + set { this.durationField = value; } + } + + public bool hideDropDowns { + get { return this.hideDropDownsField; } + set { this.hideDropDownsField = value; } + } + + public bool hideFlashObjects { + get { return this.hideFlashObjectsField; } + set { this.hideFlashObjectsField = value; } + } + + public bool hideIframes { + get { return this.hideIframesField; } + set { this.hideIframesField = value; } + } + + public bool hideJavaApplets { + get { return this.hideJavaAppletsField; } + set { this.hideJavaAppletsField = value; } + } + + public bool hideScrollBars { + get { return this.hideScrollBarsField; } + set { this.hideScrollBarsField = value; } + } + + public int left { + get { return this.leftField; } + set { this.leftField = value; } + } + + public bool leftLockPosition { + get { return this.leftLockPositionField; } + set { this.leftLockPositionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string leftUnit { + get { return this.leftUnitField; } + set { this.leftUnitField = value; } + } + + public int startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public int top { + get { return this.topField; } + set { this.topField = value; } + } + + public bool topLockPosition { + get { return this.topLockPositionField; } + set { this.topLockPositionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string topUnit { + get { return this.topUnitField; } + set { this.topUnitField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaMultiFloatingAsset : RichMediaFloatingAsset { + private string alignmentField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string alignment { + get { return this.alignmentField; } + set { this.alignmentField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaImageWithOverlayCreative : RichMediaCreativeBase { + private RichMediaImageAsset imageAssetField; + + private RichMediaOverlayAsset overlayAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaImageAsset imageAsset { + get { return this.imageAssetField; } + set { this.imageAssetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaOverlayAsset overlayAsset { + get { return this.overlayAssetField; } + set { this.overlayAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaImageWithFloatingCreative : RichMediaCreativeBase { + private RichMediaFloatingAsset floatingAssetField; + + private RichMediaImageAsset imageAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaFloatingAsset floatingAsset { + get { return this.floatingAssetField; } + set { this.floatingAssetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaImageAsset imageAsset { + get { return this.imageAssetField; } + set { this.imageAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaOverlayCreative : RichMediaCreativeBase { + private RichMediaOverlayAsset overlayAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaOverlayAsset overlayAsset { + get { return this.overlayAssetField; } + set { this.overlayAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaFloatingWithReminderCreative : RichMediaCreativeBase { + private RichMediaFloatingAsset floatingAssetField; + + private RichMediaReminderAsset reminderAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaFloatingAsset floatingAsset { + get { return this.floatingAssetField; } + set { this.floatingAssetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaReminderAsset reminderAsset { + get { return this.reminderAssetField; } + set { this.reminderAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaExpandingCreative : RichMediaCreativeBase { + private RichMediaExpandingAsset expandingAssetField; + + private RichMediaExpandingHtmlAsset expandingHtmlAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaExpandingAsset expandingAsset { + get { return this.expandingAssetField; } + set { this.expandingAssetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaExpandingHtmlAsset expandingHtmlAsset { + get { return this.expandingHtmlAssetField; } + set { this.expandingHtmlAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaMultiFloatingCreative : RichMediaCreativeBase { + private RichMediaMultiFloatingAsset[] multiFloatingAssetsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaMultiFloatingAsset[] multiFloatingAssets { + get { return this.multiFloatingAssetsField; } + set { this.multiFloatingAssetsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaInPageCreative : RichMediaCreativeBase { + private RichMediaInPageAsset inPageAssetField; + + private RichMediaInPageHtmlAsset inPageHtmlAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaInPageAsset inPageAsset { + get { return this.inPageAssetField; } + set { this.inPageAssetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaInPageHtmlAsset inPageHtmlAsset { + get { return this.inPageHtmlAssetField; } + set { this.inPageHtmlAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaFloatingCreative : RichMediaCreativeBase { + private RichMediaFloatingAsset floatingAssetField; + + private RichMediaFloatingHtmlAsset floatingHtmlAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaFloatingAsset floatingAsset { + get { return this.floatingAssetField; } + set { this.floatingAssetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaFloatingHtmlAsset floatingHtmlAsset { + get { return this.floatingHtmlAssetField; } + set { this.floatingHtmlAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaInPageWithOverlayCreative : RichMediaCreativeBase { + private RichMediaInPageAsset inPageAssetField; + + private RichMediaOverlayAsset overlayAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaInPageAsset inPageAsset { + get { return this.inPageAssetField; } + set { this.inPageAssetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaOverlayAsset overlayAsset { + get { return this.overlayAssetField; } + set { this.overlayAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaFlashInFlashCreative : RichMediaCreativeBase { + private string assetTypeField; + + private RichMediaFlashAsset flashAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string assetType { + get { return this.assetTypeField; } + set { this.assetTypeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaFlashAsset flashAsset { + get { return this.flashAssetField; } + set { this.flashAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaMobileInAppCreative : RichMediaCreativeBase { + private RichMediaMobileInAppAsset mobileInAppAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaMobileInAppAsset mobileInAppAsset { + get { return this.mobileInAppAssetField; } + set { this.mobileInAppAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaInPageWithFloatingCreative : RichMediaCreativeBase { + private RichMediaFloatingAsset floatingAssetField; + + private RichMediaInPageAsset inPageAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaFloatingAsset floatingAsset { + get { return this.floatingAssetField; } + set { this.floatingAssetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaInPageAsset inPageAsset { + get { return this.inPageAssetField; } + set { this.inPageAssetField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(TrackingHTMLCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(MobileDisplayCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(HTMLCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(HTMLInterstitialCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(FlashInpageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public abstract partial class HTMLCreativeBase : CreativeBase { + private string hTMLCodeField; + + private HTMLCreativeAsset[] creativeAssetsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string HTMLCode { + get { return this.hTMLCodeField; } + set { this.hTMLCodeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public HTMLCreativeAsset[] creativeAssets { + get { return this.creativeAssetsField; } + set { this.creativeAssetsField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(MobileDisplayCreativeAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(HTMLCreativeFlashAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class HTMLCreativeAsset { + private string assetFilenameField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string assetFilename { + get { return this.assetFilenameField; } + set { this.assetFilenameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class MobileDisplayCreativeAsset : HTMLCreativeAsset { + private Dimensions dimesionsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Dimensions dimesions { + get { return this.dimesionsField; } + set { this.dimesionsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class HTMLCreativeFlashAsset : HTMLCreativeAsset { + private FlashClickTag[] clickTagsField; + + private int flashVersionField; + + private Dimensions frameSizeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public FlashClickTag[] clickTags { + get { return this.clickTagsField; } + set { this.clickTagsField = value; } + } + + public int flashVersion { + get { return this.flashVersionField; } + set { this.flashVersionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Dimensions frameSize { + get { return this.frameSizeField; } + set { this.frameSizeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class FlashClickTag { + private string nameField; + + private string valueField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class TrackingHTMLCreative : HTMLCreativeBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class MobileDisplayCreative : HTMLCreativeBase { + private string thirdPartyClickTrackingUrlField; + + private string thirdPartyImpressionTrackingUrlField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string thirdPartyClickTrackingUrl { + get { return this.thirdPartyClickTrackingUrlField; } + set { this.thirdPartyClickTrackingUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string thirdPartyImpressionTrackingUrl { + get { return this.thirdPartyImpressionTrackingUrlField; } + set { this.thirdPartyImpressionTrackingUrlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class HTMLCreative : HTMLCreativeBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class HTMLInterstitialCreative : HTMLCreativeBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class FlashInpageCreative : HTMLCreativeBase { + private FSCommand fSCommandField; + + private HTMLCreativeFlashAsset[] additionalFlashAssetsField; + + private HTMLCreativeAsset[] additionalImageAssetsField; + + private bool allowScriptAccessField; + + private string backgroundColorField; + + private string backupImageAlternateTextField; + + private HTMLCreativeAsset backupImageAssetField; + + private string backupImageClickThroughUrlField; + + private TargetWindow backupImageTargetWindowField; + + private FlashClickTag[] clickTagsField; + + private bool codeLockedField; + + private HTMLCreativeFlashAsset parentFlashAssetField; + + private string surveyUrlField; + + private string wmodeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public FSCommand FSCommand { + get { return this.fSCommandField; } + set { this.fSCommandField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public HTMLCreativeFlashAsset[] additionalFlashAssets { + get { return this.additionalFlashAssetsField; } + set { this.additionalFlashAssetsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public HTMLCreativeAsset[] additionalImageAssets { + get { return this.additionalImageAssetsField; } + set { this.additionalImageAssetsField = value; } + } + + public bool allowScriptAccess { + get { return this.allowScriptAccessField; } + set { this.allowScriptAccessField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string backgroundColor { + get { return this.backgroundColorField; } + set { this.backgroundColorField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string backupImageAlternateText { + get { return this.backupImageAlternateTextField; } + set { this.backupImageAlternateTextField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public HTMLCreativeAsset backupImageAsset { + get { return this.backupImageAssetField; } + set { this.backupImageAssetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string backupImageClickThroughUrl { + get { return this.backupImageClickThroughUrlField; } + set { this.backupImageClickThroughUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public TargetWindow backupImageTargetWindow { + get { return this.backupImageTargetWindowField; } + set { this.backupImageTargetWindowField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public FlashClickTag[] clickTags { + get { return this.clickTagsField; } + set { this.clickTagsField = value; } + } + + public bool codeLocked { + get { return this.codeLockedField; } + set { this.codeLockedField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public HTMLCreativeFlashAsset parentFlashAsset { + get { return this.parentFlashAssetField; } + set { this.parentFlashAssetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string surveyUrl { + get { return this.surveyUrlField; } + set { this.surveyUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string wmode { + get { return this.wmodeField; } + set { this.wmodeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class FSCommand { + private int leftField; + + private string optionField; + + private int topField; + + private Dimensions windowDimensionsField; + + public int left { + get { return this.leftField; } + set { this.leftField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string option { + get { return this.optionField; } + set { this.optionField = value; } + } + + public int top { + get { return this.topField; } + set { this.topField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Dimensions windowDimensions { + get { return this.windowDimensionsField; } + set { this.windowDimensionsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class TargetWindow { + private string optionField; + + private string otherValueField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string option { + get { return this.optionField; } + set { this.optionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string otherValue { + get { return this.otherValueField; } + set { this.otherValueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class ImageFile : CreativeUploadFileBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeUploadFileCount { + private int flashFileCountField; + + private int imageFileCountField; + + private int otherFileCountField; + + public int flashFileCount { + get { return this.flashFileCountField; } + set { this.flashFileCountField = value; } + } + + public int imageFileCount { + get { return this.imageFileCountField; } + set { this.imageFileCountField = value; } + } + + public int otherFileCount { + get { return this.otherFileCountField; } + set { this.otherFileCountField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeUploadSessionRequest { + private long advertiserIdField; + + private long campaignIdField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class InStreamAssetUploadRequest { + private bool companionField; + + private long creativeIdField; + + private CreativeAsset inStreamAssetField; + + private bool mediaFileField; + + private bool nonLinearField; + + public bool companion { + get { return this.companionField; } + set { this.companionField = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { this.creativeIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeAsset inStreamAsset { + get { return this.inStreamAssetField; } + set { this.inStreamAssetField = value; } + } + + public bool mediaFile { + get { return this.mediaFileField; } + set { this.mediaFileField = value; } + } + + public bool nonLinear { + get { return this.nonLinearField; } + set { this.nonLinearField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeAsset : CreativeAssetBase { + private byte[] contentField; + + [System.Xml.Serialization.SoapElementAttribute(DataType = "base64Binary", IsNullable = true)] + public byte[] content { + get { return this.contentField; } + set { this.contentField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public abstract partial class CreativeAssetBase { + private long advertiserIdField; + + private bool forHTMLCreativesField; + + private string nameField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + public bool forHTMLCreatives { + get { return this.forHTMLCreativesField; } + set { this.forHTMLCreativesField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeRenderingResult { + private long creativeIdField; + + private long renderingIdField; + + private long renderingVersionField; + + public long creativeId { + get { return this.creativeIdField; } + set { this.creativeIdField = value; } + } + + public long renderingId { + get { return this.renderingIdField; } + set { this.renderingIdField = value; } + } + + public long renderingVersion { + get { return this.renderingVersionField; } + set { this.renderingVersionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeRenderingRequest { + private long[] creativeIdsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] creativeIds { + get { return this.creativeIdsField; } + set { this.creativeIdsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class RichMediaAssetUploadRequest { + private string assetFileNameField; + + private long creativeIdField; + + private byte[] fileDataField; + + private int parentAssetIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string assetFileName { + get { return this.assetFileNameField; } + set { this.assetFileNameField = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { this.creativeIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(DataType = "base64Binary", IsNullable = true)] + public byte[] fileData { + get { return this.fileDataField; } + set { this.fileDataField = value; } + } + + public int parentAssetId { + get { return this.parentAssetIdField; } + set { this.parentAssetIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeCopyRequest { + private long advertiserIdField; + + private long campaignIdField; + + private long copyModeField; + + private long creativeIdField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + public long copyMode { + get { return this.copyModeField; } + set { this.copyModeField = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { this.creativeIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeCopyResult : SaveResult { + private CreativeCopyRequest copyRequestField; + + private string errorMessageField; + + private string nameField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeCopyRequest copyRequest { + get { return this.copyRequestField; } + set { this.copyRequestField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeCampaignAssociationResult : SaveResult { + private long campaignIdField; + + private string errorMessageField; + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeSaveResult : SaveResult { + private long adIdField; + + public long adId { + get { return this.adIdField; } + set { this.adIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeRecordSet : PagedRecordSet { + private CreativeBase[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeBase[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeSearchCriteria : PageableSearchCriteriaBase { + private ActiveFilter activeStatusField; + + private long advertiserIdField; + + private long archiveStatusFilterField; + + private long campaignIdField; + + private DateInterval creativeCreationDateRangeField; + + private bool studioCreativeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ActiveFilter activeStatus { + get { return this.activeStatusField; } + set { this.activeStatusField = value; } + } + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + public long archiveStatusFilter { + get { return this.archiveStatusFilterField; } + set { this.archiveStatusFilterField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DateInterval creativeCreationDateRange { + get { return this.creativeCreationDateRangeField; } + set { this.creativeCreationDateRangeField = value; } + } + + public bool studioCreative { + get { return this.studioCreativeField; } + set { this.studioCreativeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeAssetSaveResult { + private FlashClickTag[] clickTagsField; + + private int flashVersionField; + + private Dimensions frameSizeField; + + private string savedFilenameField; + + private Size sizeField; + + private string urlField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public FlashClickTag[] clickTags { + get { return this.clickTagsField; } + set { this.clickTagsField = value; } + } + + public int flashVersion { + get { return this.flashVersionField; } + set { this.flashVersionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Dimensions frameSize { + get { return this.frameSizeField; } + set { this.frameSizeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string savedFilename { + get { return this.savedFilenameField; } + set { this.savedFilenameField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeAssetRecordSet { + private CreativeAssetBase[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeAssetBase[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeAssetSearchCriteria { + private long advertiserIdField; + + private string assetFilenameField; + + private bool forHTMLCreativesField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string assetFilename { + get { return this.assetFilenameField; } + set { this.assetFilenameField = value; } + } + + public bool forHTMLCreatives { + get { return this.forHTMLCreativesField; } + set { this.forHTMLCreativesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativePlacementAssignmentResult : CreativePlacementAssignment { + private long adIdField; + + private string errorMessageField; + + public long adId { + get { return this.adIdField; } + set { this.adIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "creativefieldSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + public partial class CreativeFieldRemoteService : DfaSoapClient { + public CreativeFieldRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.19/api/dfa-api/creativefield"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativeFieldValuesReturn")] + public CreativeFieldValueRecordSet getCreativeFieldValues(CreativeFieldValueSearchCriteria creativeFieldValueSearchCriteria) { + object[] results = this.Invoke("getCreativeFieldValues", new object[] {creativeFieldValueSearchCriteria}); + return ((CreativeFieldValueRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativeFieldValueReturn")] + public CreativeFieldValue getCreativeFieldValue(long creativeFieldValueId) { + object[] results = this.Invoke("getCreativeFieldValue", new object[] {creativeFieldValueId}); + return ((CreativeFieldValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("saveCreativeFieldValueReturn")] + public CreativeFieldValueSaveResult saveCreativeFieldValue(CreativeFieldValue creativeFieldValue) { + object[] results = this.Invoke("saveCreativeFieldValue", new object[] {creativeFieldValue}); + return ((CreativeFieldValueSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public void deleteCreativeFieldValue(long creativeFieldValueId) { + this.Invoke("deleteCreativeFieldValue", new object[] {creativeFieldValueId}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativeFieldReturn")] + public CreativeField getCreativeField(long creativeFieldId) { + object[] results = this.Invoke("getCreativeField", new object[] {creativeFieldId}); + return ((CreativeField) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativeFieldsReturn")] + public CreativeFieldRecordSet getCreativeFields(CreativeFieldSearchCriteria creativeFieldSearchCriteria) { + object[] results = this.Invoke("getCreativeFields", new object[] {creativeFieldSearchCriteria}); + return ((CreativeFieldRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("saveCreativeFieldReturn")] + public CreativeFieldSaveResult saveCreativeField(CreativeField creativeField) { + object[] results = this.Invoke("saveCreativeField", new object[] {creativeField}); + return ((CreativeFieldSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public void deleteCreativeField(long creativeFieldId) { + this.Invoke("deleteCreativeField", new object[] {creativeFieldId}); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeFieldValueSearchCriteria : PageableSearchCriteriaBase { + private long[] creativeFieldIdsField; + + private SortOrder sortOrderField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] creativeFieldIds { + get { return this.creativeFieldIdsField; } + set { this.creativeFieldIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeFieldSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeFieldValueSaveResult : SaveResult { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeField))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeFieldBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeField : CreativeFieldBase { + private long advertiserIdField; + + private long totalNumberOfValuesField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + public long totalNumberOfValues { + get { return this.totalNumberOfValuesField; } + set { this.totalNumberOfValuesField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeFieldValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeFieldValueBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeFieldValue : CreativeFieldValueBase { + private long creativeFieldIdField; + + public long creativeFieldId { + get { return this.creativeFieldIdField; } + set { this.creativeFieldIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeFieldRecordSet : PagedRecordSet { + private CreativeField[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeField[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeFieldValueRecordSet : PagedRecordSet { + private CreativeFieldValue[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeFieldValue[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeFieldSearchCriteria : PageableSearchCriteriaBase { + private long[] advertiserIdsField; + + private SortOrder sortOrderField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] advertiserIds { + get { return this.advertiserIdsField; } + set { this.advertiserIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "creativegroupSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + public partial class CreativeGroupRemoteService : DfaSoapClient { + public CreativeGroupRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.19/api/dfa-api/creativegroup"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativeGroupsReturn")] + public CreativeGroupRecordSet getCreativeGroups(CreativeGroupSearchCriteria searchCriteria) { + object[] results = this.Invoke("getCreativeGroups", new object[] {searchCriteria}); + return ((CreativeGroupRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativeGroupReturn")] + public CreativeGroup getCreativeGroup(long id) { + object[] results = this.Invoke("getCreativeGroup", new object[] {id}); + return ((CreativeGroup) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + [return: System.Xml.Serialization.SoapElementAttribute("saveCreativeGroupReturn")] + public CreativeGroupSaveResult saveCreativeGroup(CreativeGroup creativeGroup) { + object[] results = this.Invoke("saveCreativeGroup", new object[] {creativeGroup}); + return ((CreativeGroupSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.19", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public void deleteCreativeGroup(long creativeGroupId) { + this.Invoke("deleteCreativeGroup", new object[] {creativeGroupId}); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeGroupSearchCriteria : SearchCriteriaBase { + private long[] advertiserIdsField; + + private int groupNumberField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] advertiserIds { + get { return this.advertiserIdsField; } + set { this.advertiserIdsField = value; } + } + + public int groupNumber { + get { return this.groupNumberField; } + set { this.groupNumberField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeGroupSaveResult : SaveResult { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeGroupBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeGroup : CreativeGroupBase { + private long advertiserIdField; + + private int groupNumberField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + public int groupNumber { + get { return this.groupNumberField; } + set { this.groupNumberField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.19")] + public partial class CreativeGroupRecordSet { + private CreativeGroup[] recordsField; + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeGroup[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } +} diff --git a/src/Dfa/v1_19/DfaServiceV1_19.cs b/src/Dfa/v1_19/DfaServiceV1_19.cs new file mode 100644 index 00000000000..a77c014c809 --- /dev/null +++ b/src/Dfa/v1_19/DfaServiceV1_19.cs @@ -0,0 +1,191 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Reflection; + +namespace Google.Api.Ads.Dfa.Lib { + /// + /// Lists all the services available through this library. + /// + public partial class DfaService : AdsService { + /// + /// All the services available in v1.19. + /// + public class v1_19 { + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdvertiserRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdvertiserGroupRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CampaignRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ChangeLogRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ContentCategoryRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeFieldRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeGroupRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LoginRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature NetworkRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature PlacementRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReportRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SiteRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SizeRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SpotlightRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature PlacementStrategyRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SubnetworkRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature UserRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature UserRoleRemoteService; + + /// + /// Factory type for v1.19 services. + /// + public static readonly Type factoryType = typeof(DfaServiceFactory); + + /// + /// Static constructor to initialize the service constants. + /// + static v1_19() { + AdRemoteService = DfaService.MakeServiceSignature("v1.19", "AdRemoteService"); + AdvertiserRemoteService = DfaService.MakeServiceSignature("v1.19", + "AdvertiserRemoteService"); + AdvertiserGroupRemoteService = DfaService.MakeServiceSignature("v1.19", + "AdvertiserGroupRemoteService"); + CampaignRemoteService = DfaService.MakeServiceSignature("v1.19", "CampaignRemoteService"); + ChangeLogRemoteService = DfaService.MakeServiceSignature("v1.19", "ChangeLogRemoteService"); + ContentCategoryRemoteService = DfaService.MakeServiceSignature("v1.19", + "ContentCategoryRemoteService"); + CreativeRemoteService = DfaService.MakeServiceSignature("v1.19", "CreativeRemoteService"); + CreativeFieldRemoteService = DfaService.MakeServiceSignature("v1.19", + "CreativeFieldRemoteService"); + CreativeGroupRemoteService = DfaService.MakeServiceSignature("v1.19", + "CreativeGroupRemoteService"); + LoginRemoteService = DfaService.MakeServiceSignature("v1.19", "LoginRemoteService"); + NetworkRemoteService = DfaService.MakeServiceSignature("v1.19", "NetworkRemoteService"); + PlacementRemoteService = DfaService.MakeServiceSignature("v1.19", "PlacementRemoteService"); + ReportRemoteService = DfaService.MakeServiceSignature("v1.19", "ReportRemoteService"); + SiteRemoteService = DfaService.MakeServiceSignature("v1.19", "SiteRemoteService"); + SizeRemoteService = DfaService.MakeServiceSignature("v1.19", "SizeRemoteService"); + SpotlightRemoteService = DfaService.MakeServiceSignature("v1.19", "SpotlightRemoteService"); + PlacementStrategyRemoteService = DfaService.MakeServiceSignature("v1.19", + "PlacementStrategyRemoteService"); + SubnetworkRemoteService = DfaService.MakeServiceSignature("v1.19", + "SubnetworkRemoteService"); + UserRemoteService = DfaService.MakeServiceSignature("v1.19", "UserRemoteService"); + UserRoleRemoteService = DfaService.MakeServiceSignature("v1.19", "UserRoleRemoteService"); + } + } + } +} diff --git a/src/Dfa/v1_20/DfaApi.cs b/src/Dfa/v1_20/DfaApi.cs new file mode 100644 index 00000000000..ef2d5ca47c9 --- /dev/null +++ b/src/Dfa/v1_20/DfaApi.cs @@ -0,0 +1,11423 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +namespace Google.Api.Ads.Dfa.v1_20 { + using Google.Api.Ads.Dfa.Lib; + + using System; + using System.ComponentModel; + using System.Diagnostics; + using System.Xml.Serialization; + using System.Web.Services; + using System.Web.Services.Protocols; + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "loginSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class LoginRemoteService : DfaSoapClient { + public LoginRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.20/api/dfa-api/login"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("impersonateUserReturn")] + public UserProfile impersonateUser(string username, string token, string userToImpersonate) { + object[] results = this.Invoke("impersonateUser", new object[] {username, token, userToImpersonate}); + return ((UserProfile) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("impersonateNetworkReturn")] + public UserProfile impersonateNetwork(string username, string token, long networkId) { + object[] results = this.Invoke("impersonateNetwork", new object[] {username, token, networkId}); + return ((UserProfile) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("changePasswordReturn")] + public UserProfile changePassword(ChangePasswordRequest changePasswordRequest) { + object[] results = this.Invoke("changePassword", new object[] {changePasswordRequest}); + return ((UserProfile) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("authenticateReturn")] + public UserProfile authenticate(string username, string password) { + object[] results = this.Invoke("authenticate", new object[] {username, password}); + return ((UserProfile) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class UserProfile : UserBase { + private System.DateTime? lastAccessTimeField; + + private string networkNameField; + + private string tokenField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? lastAccessTime { + get { return this.lastAccessTimeField; } + set { this.lastAccessTimeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string networkName { + get { return this.networkNameField; } + set { this.networkNameField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string token { + get { return this.tokenField; } + set { this.tokenField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(UserProfile))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public abstract partial class UserBase : Base { + private bool activeField; + + private bool apiUserField; + + private string emailField; + + private long languageIdField; + + private long networkIdField; + + private string passwordField; + + private long subnetworkIdField; + + private long userGroupIdField; + + private long userLevelIdField; + + public bool active { + get { return this.activeField; } + set { this.activeField = value; } + } + + public bool apiUser { + get { return this.apiUserField; } + set { this.apiUserField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public long languageId { + get { return this.languageIdField; } + set { this.languageIdField = value; } + } + + public long networkId { + get { return this.networkIdField; } + set { this.networkIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string password { + get { return this.passwordField; } + set { this.passwordField = value; } + } + + public long subnetworkId { + get { return this.subnetworkIdField; } + set { this.subnetworkIdField = value; } + } + + public long userGroupId { + get { return this.userGroupIdField; } + set { this.userGroupIdField = value; } + } + + public long userLevelId { + get { return this.userLevelIdField; } + set { this.userLevelIdField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(UserBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(UserProfile))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public abstract partial class Base { + private long idField; + + private string nameField; + + private ApiException dummyExceptionField; + + public long id { + get { return this.idField; } + set { this.idField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ApiException dummyException { + get { return this.dummyExceptionField; } + set { this.dummyExceptionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ApiException { + private long errorCodeField; + + private string errorMessageField; + + private string messageField; + + public long errorCode { + get { return this.errorCodeField; } + set { this.errorCodeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string message { + get { return this.messageField; } + set { this.messageField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ChangePasswordRequest { + private string confirmPasswordField; + + private string newPasswordField; + + private string oldPasswordField; + + private string tokenField; + + private string usernameField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string confirmPassword { + get { return this.confirmPasswordField; } + set { this.confirmPasswordField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string newPassword { + get { return this.newPasswordField; } + set { this.newPasswordField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string oldPassword { + get { return this.oldPasswordField; } + set { this.oldPasswordField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string token { + get { return this.tokenField; } + set { this.tokenField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string username { + get { return this.usernameField; } + set { this.usernameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "networkSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + public partial class NetworkRemoteService : DfaSoapClient { + public NetworkRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.20/api/dfa-api/network"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public void executeAgreement(long agreementId) { + this.Invoke("executeAgreement", new object[] {agreementId}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getAgreementsReturn")] + public AgreementRecordSet getAgreements(AgreementSearchCriteria criteria) { + object[] results = this.Invoke("getAgreements", new object[] {criteria}); + return ((AgreementRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getCurrenciesReturn")] + public Currency[] getCurrencies() { + object[] results = this.Invoke("getCurrencies", new object[0]); + return ((Currency[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("saveNetworkReturn")] + public NetworkSaveResult saveNetwork(Network network) { + object[] results = this.Invoke("saveNetwork", new object[] {network}); + return ((NetworkSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getLanguageEncodingListReturn")] + public LanguageEncoding[] getLanguageEncodingList() { + object[] results = this.Invoke("getLanguageEncodingList", new object[0]); + return ((LanguageEncoding[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getTimeZoneListReturn")] + public TimeZone[] getTimeZoneList() { + object[] results = this.Invoke("getTimeZoneList", new object[0]); + return ((TimeZone[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getAllPermissionsReturn")] + public Permission[] getAllPermissions() { + object[] results = this.Invoke("getAllPermissions", new object[0]); + return ((Permission[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getAssignedNetworkPermissionsReturn")] + public NetworkPermission[] getAssignedNetworkPermissions(long networkId) { + object[] results = this.Invoke("getAssignedNetworkPermissions", new object[] {networkId}); + return ((NetworkPermission[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getAdministratorPermissionsReturn")] + public AdministratorPermission[] getAdministratorPermissions() { + object[] results = this.Invoke("getAdministratorPermissions", new object[0]); + return ((AdministratorPermission[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("uploadNetworkWidgetImageReturn")] + public WidgetImageUploadResponse uploadNetworkWidgetImage(WidgetImageUploadRequest request) { + object[] results = this.Invoke("uploadNetworkWidgetImage", new object[] {request}); + return ((WidgetImageUploadResponse) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getAllNetworkPermissionsReturn")] + public NetworkPermission[] getAllNetworkPermissions() { + object[] results = this.Invoke("getAllNetworkPermissions", new object[0]); + return ((NetworkPermission[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getNetworksReturn")] + public NetworkRecordSet getNetworks(NetworkSearchCriteria networkSearchCriteria) { + object[] results = this.Invoke("getNetworks", new object[] {networkSearchCriteria}); + return ((NetworkRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getNetworkReturn")] + public Network getNetwork(long networkId) { + object[] results = this.Invoke("getNetwork", new object[] {networkId}); + return ((Network) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AgreementSearchCriteria : SearchCriteriaBase { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PageableSearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(NetworkSearchCriteria))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(AgreementSearchCriteria))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public abstract partial class SearchCriteriaBase { + private long[] idsField; + + private string searchStringField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] ids { + get { return this.idsField; } + set { this.idsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string searchString { + get { return this.searchStringField; } + set { this.searchStringField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(NetworkRecordSet))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public abstract partial class PagedRecordSet { + private int pageNumberField; + + private int totalNumberOfPagesField; + + private int totalNumberOfRecordsField; + + public int pageNumber { + get { return this.pageNumberField; } + set { this.pageNumberField = value; } + } + + public int totalNumberOfPages { + get { return this.totalNumberOfPagesField; } + set { this.totalNumberOfPagesField = value; } + } + + public int totalNumberOfRecords { + get { return this.totalNumberOfRecordsField; } + set { this.totalNumberOfRecordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class NetworkRecordSet : PagedRecordSet { + private Network[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Network[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class Network : NetworkBase { + private string abbreviationField; + + private bool activeField; + + private int activeAdsLimitField; + + private int availableAdsField; + + private long[] availablePermissionsField; + + private string countryField; + + private long currencyField; + + private long defaultCreativeSizeField; + + private long defaultEncodingField; + + private long defaultLanguageField; + + private string descriptionField; + + private FrequencyCapGroup[] frequencyCapGroupsField; + + private int loginAttemptsField; + + private long maximumImageSizeField; + + private int minimumPasswordLengthField; + + private long[] networkPermissionsField; + + private string notificationEmailAddressField; + + private long passwordExpirePeriodField; + + private long reportGenerationTimeZoneField; + + private ReportsConfiguration reportsConfigurationField; + + private RichMediaNetworkConfiguration richmediaNetworkConfigField; + + private int totalActiveAdsField; + + private WidgetNetworkConfig widgetNetworkConfigField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string abbreviation { + get { return this.abbreviationField; } + set { this.abbreviationField = value; } + } + + public bool active { + get { return this.activeField; } + set { this.activeField = value; } + } + + public int activeAdsLimit { + get { return this.activeAdsLimitField; } + set { this.activeAdsLimitField = value; } + } + + public int availableAds { + get { return this.availableAdsField; } + set { this.availableAdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] availablePermissions { + get { return this.availablePermissionsField; } + set { this.availablePermissionsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string country { + get { return this.countryField; } + set { this.countryField = value; } + } + + public long currency { + get { return this.currencyField; } + set { this.currencyField = value; } + } + + public long defaultCreativeSize { + get { return this.defaultCreativeSizeField; } + set { this.defaultCreativeSizeField = value; } + } + + public long defaultEncoding { + get { return this.defaultEncodingField; } + set { this.defaultEncodingField = value; } + } + + public long defaultLanguage { + get { return this.defaultLanguageField; } + set { this.defaultLanguageField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public FrequencyCapGroup[] frequencyCapGroups { + get { return this.frequencyCapGroupsField; } + set { this.frequencyCapGroupsField = value; } + } + + public int loginAttempts { + get { return this.loginAttemptsField; } + set { this.loginAttemptsField = value; } + } + + public long maximumImageSize { + get { return this.maximumImageSizeField; } + set { this.maximumImageSizeField = value; } + } + + public int minimumPasswordLength { + get { return this.minimumPasswordLengthField; } + set { this.minimumPasswordLengthField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] networkPermissions { + get { return this.networkPermissionsField; } + set { this.networkPermissionsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string notificationEmailAddress { + get { return this.notificationEmailAddressField; } + set { this.notificationEmailAddressField = value; } + } + + public long passwordExpirePeriod { + get { return this.passwordExpirePeriodField; } + set { this.passwordExpirePeriodField = value; } + } + + public long reportGenerationTimeZone { + get { return this.reportGenerationTimeZoneField; } + set { this.reportGenerationTimeZoneField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ReportsConfiguration reportsConfiguration { + get { return this.reportsConfigurationField; } + set { this.reportsConfigurationField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaNetworkConfiguration richmediaNetworkConfig { + get { return this.richmediaNetworkConfigField; } + set { this.richmediaNetworkConfigField = value; } + } + + public int totalActiveAds { + get { return this.totalActiveAdsField; } + set { this.totalActiveAdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public WidgetNetworkConfig widgetNetworkConfig { + get { return this.widgetNetworkConfigField; } + set { this.widgetNetworkConfigField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class FrequencyCapGroup : FrequencyCapGroupBase { + private long? durationField; + + private long? impressionsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long? duration { + get { return this.durationField; } + set { this.durationField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long? impressions { + get { return this.impressionsField; } + set { this.impressionsField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(FrequencyCapGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class FrequencyCapGroupBase : Base { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(NetworkPermissionGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class NetworkPermissionGroupBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class NetworkPermissionGroup : NetworkPermissionGroupBase { + private int displayOrderField; + + public int displayOrder { + get { return this.displayOrderField; } + set { this.displayOrderField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(NetworkPermission))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class NetworkPermissionBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class NetworkPermission : NetworkPermissionBase { + private NetworkPermissionGroup permissionGroupField; + + private string shortNameField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public NetworkPermissionGroup permissionGroup { + get { return this.permissionGroupField; } + set { this.permissionGroupField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string shortName { + get { return this.shortNameField; } + set { this.shortNameField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PermissionGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PermissionGroupBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PermissionGroup : PermissionGroupBase { + private long displayOrderField; + + public long displayOrder { + get { return this.displayOrderField; } + set { this.displayOrderField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(AdministratorPermission))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Permission))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PermissionBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AdministratorPermission : PermissionBase { + private int accessLevelField; + + public int accessLevel { + get { return this.accessLevelField; } + set { this.accessLevelField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class Permission : PermissionBase { + private long displayOrderField; + + private PermissionGroup permissionGroupField; + + private string permissionStringField; + + public long displayOrder { + get { return this.displayOrderField; } + set { this.displayOrderField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PermissionGroup permissionGroup { + get { return this.permissionGroupField; } + set { this.permissionGroupField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string permissionString { + get { return this.permissionStringField; } + set { this.permissionStringField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class TimeZone : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class LanguageEncoding : Base { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Network))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class NetworkBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class Currency : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class Agreement : Base { + private string descriptionField; + + private string emailAddressField; + + private bool executedField; + + private System.DateTime? executionDateField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string emailAddress { + get { return this.emailAddressField; } + set { this.emailAddressField = value; } + } + + public bool executed { + get { return this.executedField; } + set { this.executedField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? executionDate { + get { return this.executionDateField; } + set { this.executionDateField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ReportsConfiguration { + private AdvancedReportsConfiguration advancedReportsConfigurationField; + + private ExposureToConversionConfiguration exposureToConversionConfigurationField; + + private LookbackConfiguration lookbackConfigurationField; + + private int minimumClickRateField; + + private int minimumClicksField; + + private int minimumDaysField; + + private int minimumImpressionsField; + + private ReachReportConfiguration reachReportConfigurationField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public AdvancedReportsConfiguration advancedReportsConfiguration { + get { return this.advancedReportsConfigurationField; } + set { this.advancedReportsConfigurationField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ExposureToConversionConfiguration exposureToConversionConfiguration { + get { return this.exposureToConversionConfigurationField; } + set { this.exposureToConversionConfigurationField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public LookbackConfiguration lookbackConfiguration { + get { return this.lookbackConfigurationField; } + set { this.lookbackConfigurationField = value; } + } + + public int minimumClickRate { + get { return this.minimumClickRateField; } + set { this.minimumClickRateField = value; } + } + + public int minimumClicks { + get { return this.minimumClicksField; } + set { this.minimumClicksField = value; } + } + + public int minimumDays { + get { return this.minimumDaysField; } + set { this.minimumDaysField = value; } + } + + public int minimumImpressions { + get { return this.minimumImpressionsField; } + set { this.minimumImpressionsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ReachReportConfiguration reachReportConfiguration { + get { return this.reachReportConfigurationField; } + set { this.reachReportConfigurationField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AdvancedReportsConfiguration { + private int crossSiteDuplicationField; + + private int frequencyToConversionField; + + private int timeLagToConversionField; + + public int crossSiteDuplication { + get { return this.crossSiteDuplicationField; } + set { this.crossSiteDuplicationField = value; } + } + + public int frequencyToConversion { + get { return this.frequencyToConversionField; } + set { this.frequencyToConversionField = value; } + } + + public int timeLagToConversion { + get { return this.timeLagToConversionField; } + set { this.timeLagToConversionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ExposureToConversionConfiguration { + private int activitiesToTrackField; + + private bool exposureToConversionEnabledField; + + private int exposuresToTrackField; + + public int activitiesToTrack { + get { return this.activitiesToTrackField; } + set { this.activitiesToTrackField = value; } + } + + public bool exposureToConversionEnabled { + get { return this.exposureToConversionEnabledField; } + set { this.exposureToConversionEnabledField = value; } + } + + public int exposuresToTrack { + get { return this.exposuresToTrackField; } + set { this.exposuresToTrackField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class LookbackConfiguration { + private int clickDurationField; + + private int postImpressionActivitiesDurationField; + + private int reportsDaysField; + + private int richMediaEventsDaysField; + + public int clickDuration { + get { return this.clickDurationField; } + set { this.clickDurationField = value; } + } + + public int postImpressionActivitiesDuration { + get { return this.postImpressionActivitiesDurationField; } + set { this.postImpressionActivitiesDurationField = value; } + } + + public int reportsDays { + get { return this.reportsDaysField; } + set { this.reportsDaysField = value; } + } + + public int richMediaEventsDays { + get { return this.richMediaEventsDaysField; } + set { this.richMediaEventsDaysField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ReachReportConfiguration { + private bool adTypeFrequencyAndReachField; + + private bool pageLevelFrequencyField; + + private bool placementFrequencyField; + + private bool siteLevelFrequencyField; + + public bool adTypeFrequencyAndReach { + get { return this.adTypeFrequencyAndReachField; } + set { this.adTypeFrequencyAndReachField = value; } + } + + public bool pageLevelFrequency { + get { return this.pageLevelFrequencyField; } + set { this.pageLevelFrequencyField = value; } + } + + public bool placementFrequency { + get { return this.placementFrequencyField; } + set { this.placementFrequencyField = value; } + } + + public bool siteLevelFrequency { + get { return this.siteLevelFrequencyField; } + set { this.siteLevelFrequencyField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaNetworkConfiguration { + private BillingCustomer billingCustomerField; + + private long changeUserIdField; + + private long customerIdField; + + private System.DateTime? dateAssignedField; + + private long networkField; + + private long teaserSizeLimitField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public BillingCustomer billingCustomer { + get { return this.billingCustomerField; } + set { this.billingCustomerField = value; } + } + + public long changeUserId { + get { return this.changeUserIdField; } + set { this.changeUserIdField = value; } + } + + public long customerId { + get { return this.customerIdField; } + set { this.customerIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? dateAssigned { + get { return this.dateAssignedField; } + set { this.dateAssignedField = value; } + } + + public long network { + get { return this.networkField; } + set { this.networkField = value; } + } + + public long teaserSizeLimit { + get { return this.teaserSizeLimitField; } + set { this.teaserSizeLimitField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class BillingCustomer { + private string accessCodeTypeField; + + private bool activeField; + + private string billingCodeField; + + private System.DateTime? expirationDateField; + + private bool publisherField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string accessCodeType { + get { return this.accessCodeTypeField; } + set { this.accessCodeTypeField = value; } + } + + public bool active { + get { return this.activeField; } + set { this.activeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string billingCode { + get { return this.billingCodeField; } + set { this.billingCodeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? expirationDate { + get { return this.expirationDateField; } + set { this.expirationDateField = value; } + } + + public bool publisher { + get { return this.publisherField; } + set { this.publisherField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class WidgetNetworkConfig { + private bool activeField; + + private double imageSizeField; + + private string imageUrlField; + + private string staticDataURLField; + + public bool active { + get { return this.activeField; } + set { this.activeField = value; } + } + + public double imageSize { + get { return this.imageSizeField; } + set { this.imageSizeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string imageUrl { + get { return this.imageUrlField; } + set { this.imageUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string staticDataURL { + get { return this.staticDataURLField; } + set { this.staticDataURLField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class WidgetImageUploadResponse { + private double imageSizeField; + + private string relativeImageUrlField; + + private string staticDataUrlField; + + public double imageSize { + get { return this.imageSizeField; } + set { this.imageSizeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string relativeImageUrl { + get { return this.relativeImageUrlField; } + set { this.relativeImageUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string staticDataUrl { + get { return this.staticDataUrlField; } + set { this.staticDataUrlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class WidgetImageUploadRequest { + private long campaignField; + + private byte[] filedataField; + + private string filenameField; + + private long networkField; + + private bool networkWidgetImageUploadField; + + private string profileField; + + public long campaign { + get { return this.campaignField; } + set { this.campaignField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(DataType = "base64Binary", IsNullable = true)] + public byte[] filedata { + get { return this.filedataField; } + set { this.filedataField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string filename { + get { return this.filenameField; } + set { this.filenameField = value; } + } + + public long network { + get { return this.networkField; } + set { this.networkField = value; } + } + + public bool networkWidgetImageUpload { + get { return this.networkWidgetImageUploadField; } + set { this.networkWidgetImageUploadField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string profile { + get { return this.profileField; } + set { this.profileField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(NetworkSaveResult))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public abstract partial class SaveResult { + private long idField; + + public long id { + get { return this.idField; } + set { this.idField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class NetworkSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AgreementRecordSet { + private Agreement[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Agreement[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SortOrder { + private bool descendingField; + + private string fieldNameField; + + public bool descending { + get { return this.descendingField; } + set { this.descendingField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string fieldName { + get { return this.fieldNameField; } + set { this.fieldNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ActiveFilter { + private bool activeOnlyField; + + private bool inactiveOnlyField; + + public bool activeOnly { + get { return this.activeOnlyField; } + set { this.activeOnlyField = value; } + } + + public bool inactiveOnly { + get { return this.inactiveOnlyField; } + set { this.inactiveOnlyField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(NetworkSearchCriteria))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public abstract partial class PageableSearchCriteriaBase : SearchCriteriaBase { + private int pageNumberField; + + private int pageSizeField; + + public int pageNumber { + get { return this.pageNumberField; } + set { this.pageNumberField = value; } + } + + public int pageSize { + get { return this.pageSizeField; } + set { this.pageSizeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class NetworkSearchCriteria : PageableSearchCriteriaBase { + private ActiveFilter activeFilterField; + + private SortOrder sortOrderField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ActiveFilter activeFilter { + get { return this.activeFilterField; } + set { this.activeFilterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "placementSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PlacementTagInfo))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(ClickCommandInfo))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PlacementTagCriteria))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaExitOverride))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(BrowserVersion))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(AreaCode))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PlacementAssignment))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SpotlightActivityWeight))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(TagSettingsBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PricingPeriod))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class PlacementRemoteService : DfaSoapClient { + public PlacementRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.20/api/dfa-api/placement"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getMobilePlacementTagOptionsReturn")] + public PlacementTagOption[] getMobilePlacementTagOptions() { + object[] results = this.Invoke("getMobilePlacementTagOptions", new object[0]); + return ((PlacementTagOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getInterstitialPlacementTagOptionsReturn")] + public PlacementTagOption[] getInterstitialPlacementTagOptions() { + object[] results = this.Invoke("getInterstitialPlacementTagOptions", new object[0]); + return ((PlacementTagOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getInStreamVideoPlacementTagOptionsReturn")] + public PlacementTagOption[] getInStreamVideoPlacementTagOptions() { + object[] results = this.Invoke("getInStreamVideoPlacementTagOptions", new object[0]); + return ((PlacementTagOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getPlacementsByCriteriaReturn")] + public PlacementRecordSet getPlacementsByCriteria(PlacementSearchCriteria searchCriteria) { + object[] results = this.Invoke("getPlacementsByCriteria", new object[] {searchCriteria}); + return ((PlacementRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getPlacementGroupsByCriteriaReturn")] + public PlacementGroupRecordSet getPlacementGroupsByCriteria(PlacementGroupSearchCriteria searchCriteria) { + object[] results = this.Invoke("getPlacementGroupsByCriteria", new object[] {searchCriteria}); + return ((PlacementGroupRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("updatePlacementsReturn")] + public PlacementUpdateResultSet updatePlacements(PlacementUpdateRequest request) { + object[] results = this.Invoke("updatePlacements", new object[] {request}); + return ((PlacementUpdateResultSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getPlacementSummaryRecordSetReturn")] + public PlacementSummaryRecordSet getPlacementSummaryRecordSet(PlacementSummarySearchCriteria criteria) { + object[] results = this.Invoke("getPlacementSummaryRecordSet", new object[] {criteria}); + return ((PlacementSummaryRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("savePlacementReturn")] + public PlacementSaveResult savePlacement(Placement placement) { + object[] results = this.Invoke("savePlacement", new object[] {placement}); + return ((PlacementSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public void deletePlacement(long id) { + this.Invoke("deletePlacement", new object[] {id}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("savePlacementGroupReturn")] + public PlacementGroupSaveResult savePlacementGroup(PlacementGroup placementGroup) { + object[] results = this.Invoke("savePlacementGroup", new object[] {placementGroup}); + return ((PlacementGroupSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public void deletePlacementGroup(long id) { + this.Invoke("deletePlacementGroup", new object[] {id}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getPlacementGroupTypesReturn")] + public PlacementGroupType[] getPlacementGroupTypes() { + object[] results = this.Invoke("getPlacementGroupTypes", new object[0]); + return ((PlacementGroupType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getPlacementTagDataReturn")] + public PlacementTagData getPlacementTagData(long campaignId, PlacementTagCriteria[] placementTagCriterias) { + object[] results = this.Invoke("getPlacementTagData", new object[] {campaignId, placementTagCriterias}); + return ((PlacementTagData) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getRegularPlacementTagOptionsReturn")] + public PlacementTagOption[] getRegularPlacementTagOptions() { + object[] results = this.Invoke("getRegularPlacementTagOptions", new object[0]); + return ((PlacementTagOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getPlacementTypesReturn")] + public PlacementType[] getPlacementTypes() { + object[] results = this.Invoke("getPlacementTypes", new object[0]); + return ((PlacementType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getPricingTypesReturn")] + public PricingType[] getPricingTypes() { + object[] results = this.Invoke("getPricingTypes", new object[0]); + return ((PricingType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getPlacementReturn")] + public Placement getPlacement(long id) { + object[] results = this.Invoke("getPlacement", new object[] {id}); + return ((Placement) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getPlacementGroupReturn")] + public PlacementGroup getPlacementGroup(long id) { + object[] results = this.Invoke("getPlacementGroup", new object[] {id}); + return ((PlacementGroup) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementTagOption : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementTagInfo { + private string clickThroughUrlTagField; + + private string iframeJavaScriptTagField; + + private string imageRedirectUrlTagField; + + private string internalRedirectTagField; + + private string javaScriptTagField; + + private string motifInstructionsField; + + private PlacementBase placementField; + + private string prefetchTagField; + + private string standardTagField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string clickThroughUrlTag { + get { return this.clickThroughUrlTagField; } + set { this.clickThroughUrlTagField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string iframeJavaScriptTag { + get { return this.iframeJavaScriptTagField; } + set { this.iframeJavaScriptTagField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string imageRedirectUrlTag { + get { return this.imageRedirectUrlTagField; } + set { this.imageRedirectUrlTagField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string internalRedirectTag { + get { return this.internalRedirectTagField; } + set { this.internalRedirectTagField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string javaScriptTag { + get { return this.javaScriptTagField; } + set { this.javaScriptTagField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string motifInstructions { + get { return this.motifInstructionsField; } + set { this.motifInstructionsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PlacementBase placement { + get { return this.placementField; } + set { this.placementField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string prefetchTag { + get { return this.prefetchTagField; } + set { this.prefetchTagField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string standardTag { + get { return this.standardTagField; } + set { this.standardTagField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PlacementSummary))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Placement))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementSummary : PlacementBase { + private LookbackWindow lookbackWindowField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public LookbackWindow lookbackWindow { + get { return this.lookbackWindowField; } + set { this.lookbackWindowField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class LookbackWindow { + private int postClickEventLookbackWindowField; + + private int postImpressionEventLookbackWindowField; + + private int richMediaEventLookbackWindowField; + + public int postClickEventLookbackWindow { + get { return this.postClickEventLookbackWindowField; } + set { this.postClickEventLookbackWindowField = value; } + } + + public int postImpressionEventLookbackWindow { + get { return this.postImpressionEventLookbackWindowField; } + set { this.postImpressionEventLookbackWindowField = value; } + } + + public int richMediaEventLookbackWindow { + get { return this.richMediaEventLookbackWindowField; } + set { this.richMediaEventLookbackWindowField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class Placement : PlacementBase { + private bool archivedField; + + private long campaignIdField; + + private string commentsField; + + private long contentCategoryIdField; + + private long dfaSiteIdField; + + private string keynameField; + + private LookbackWindow lookbackWindowField; + + private bool paymentAcceptedField; + + private long placementGroupIdField; + + private long placementStrategyIdField; + + private int placementTypeField; + + private PricingSchedule pricingScheduleField; + + private long siteIdField; + + private long sizeIdField; + + private long spotlightActivityIdField; + + private TagSettings tagSettingsField; + + public bool archived { + get { return this.archivedField; } + set { this.archivedField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string comments { + get { return this.commentsField; } + set { this.commentsField = value; } + } + + public long contentCategoryId { + get { return this.contentCategoryIdField; } + set { this.contentCategoryIdField = value; } + } + + public long dfaSiteId { + get { return this.dfaSiteIdField; } + set { this.dfaSiteIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string keyname { + get { return this.keynameField; } + set { this.keynameField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public LookbackWindow lookbackWindow { + get { return this.lookbackWindowField; } + set { this.lookbackWindowField = value; } + } + + public bool paymentAccepted { + get { return this.paymentAcceptedField; } + set { this.paymentAcceptedField = value; } + } + + public long placementGroupId { + get { return this.placementGroupIdField; } + set { this.placementGroupIdField = value; } + } + + public long placementStrategyId { + get { return this.placementStrategyIdField; } + set { this.placementStrategyIdField = value; } + } + + public int placementType { + get { return this.placementTypeField; } + set { this.placementTypeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PricingSchedule pricingSchedule { + get { return this.pricingScheduleField; } + set { this.pricingScheduleField = value; } + } + + public long siteId { + get { return this.siteIdField; } + set { this.siteIdField = value; } + } + + public long sizeId { + get { return this.sizeIdField; } + set { this.sizeIdField = value; } + } + + public long spotlightActivityId { + get { return this.spotlightActivityIdField; } + set { this.spotlightActivityIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public TagSettings tagSettings { + get { return this.tagSettingsField; } + set { this.tagSettingsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PricingSchedule { + private int capCostOptionField; + + private System.DateTime? endDateField; + + private bool flightedField; + + private PricingPeriod[] pricingPeriodsField; + + private int pricingTypeField; + + private System.DateTime? startDateField; + + private System.DateTime? testingStartDateField; + + public int capCostOption { + get { return this.capCostOptionField; } + set { this.capCostOptionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + public bool flighted { + get { return this.flightedField; } + set { this.flightedField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PricingPeriod[] pricingPeriods { + get { return this.pricingPeriodsField; } + set { this.pricingPeriodsField = value; } + } + + public int pricingType { + get { return this.pricingTypeField; } + set { this.pricingTypeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? testingStartDate { + get { return this.testingStartDateField; } + set { this.testingStartDateField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PricingPeriod { + private string commentsField; + + private System.DateTime? endDateField; + + private double rateOrCostField; + + private System.DateTime? startDateField; + + private long unitsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string comments { + get { return this.commentsField; } + set { this.commentsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + public double rateOrCost { + get { return this.rateOrCostField; } + set { this.rateOrCostField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public long units { + get { return this.unitsField; } + set { this.unitsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class TagSettings : TagSettingsBase { + private int[] tagTypesField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public int[] tagTypes { + get { return this.tagTypesField; } + set { this.tagTypesField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(TagSettings))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class TagSettingsBase { + private string additionalKeyValuesField; + + private bool includeClickTrackingStringInTagsField; + + private int keywordHandlingOptionField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string additionalKeyValues { + get { return this.additionalKeyValuesField; } + set { this.additionalKeyValuesField = value; } + } + + public bool includeClickTrackingStringInTags { + get { return this.includeClickTrackingStringInTagsField; } + set { this.includeClickTrackingStringInTagsField = value; } + } + + public int keywordHandlingOption { + get { return this.keywordHandlingOptionField; } + set { this.keywordHandlingOptionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ClickCommandInfo { + private AdBase adField; + + private string clickCommandField; + + private PlacementBase placementField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public AdBase ad { + get { return this.adField; } + set { this.adField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string clickCommand { + get { return this.clickCommandField; } + set { this.clickCommandField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PlacementBase placement { + get { return this.placementField; } + set { this.placementField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(ClickTracker))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(MobileAd))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(TrackingAd))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(DefaultAd))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(TargetableAdBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeAd))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RotationGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public abstract partial class AdBase : Base { + private bool activeField; + + private bool archivedField; + + private long campaignIdField; + + private string commentsField; + + private System.DateTime? endTimeField; + + private PlacementAssignment[] placementAssignmentsField; + + private long sizeIdField; + + private System.DateTime? startTimeField; + + private long typeIdField; + + public bool active { + get { return this.activeField; } + set { this.activeField = value; } + } + + public bool archived { + get { return this.archivedField; } + set { this.archivedField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string comments { + get { return this.commentsField; } + set { this.commentsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? endTime { + get { return this.endTimeField; } + set { this.endTimeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PlacementAssignment[] placementAssignments { + get { return this.placementAssignmentsField; } + set { this.placementAssignmentsField = value; } + } + + public long sizeId { + get { return this.sizeIdField; } + set { this.sizeIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public long typeId { + get { return this.typeIdField; } + set { this.typeIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementAssignment { + private bool activeField; + + private long placementIdField; + + public bool active { + get { return this.activeField; } + set { this.activeField = value; } + } + + public long placementId { + get { return this.placementIdField; } + set { this.placementIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ClickTracker : AdBase { + private ClickThroughUrl clickThroughUrlField; + + private CreativeGroupAssignment creativeGroupAssignmentField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ClickThroughUrl clickThroughUrl { + get { return this.clickThroughUrlField; } + set { this.clickThroughUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeGroupAssignment creativeGroupAssignment { + get { return this.creativeGroupAssignmentField; } + set { this.creativeGroupAssignmentField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ClickThroughUrl { + private string computedClickThroughUrlField; + + private string customClickThroughUrlField; + + private bool defaultLandingPageUsedField; + + private long landingPageIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string computedClickThroughUrl { + get { return this.computedClickThroughUrlField; } + set { this.computedClickThroughUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string customClickThroughUrl { + get { return this.customClickThroughUrlField; } + set { this.customClickThroughUrlField = value; } + } + + public bool defaultLandingPageUsed { + get { return this.defaultLandingPageUsedField; } + set { this.defaultLandingPageUsedField = value; } + } + + public long landingPageId { + get { return this.landingPageIdField; } + set { this.landingPageIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeGroupAssignment { + private long creativeGroup1IdField; + + private long creativeGroup2IdField; + + public long creativeGroup1Id { + get { return this.creativeGroup1IdField; } + set { this.creativeGroup1IdField = value; } + } + + public long creativeGroup2Id { + get { return this.creativeGroup2IdField; } + set { this.creativeGroup2IdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class MobileAd : AdBase { + private CountryTargetingCriteria countryTargetingCriteriaField; + + private CreativeAssignment[] creativeAssignmentsField; + + private int[] daysOfWeekField; + + private int deliveryLimitField; + + private bool deliveryLimitEnabledField; + + private bool hardCutOffField; + + private int[] hoursOfDayField; + + private string keywordExpressionField; + + private MobilePlatform[] mobilePlatformsField; + + private int priorityField; + + private int ratioField; + + private bool userLocalTimeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CountryTargetingCriteria countryTargetingCriteria { + get { return this.countryTargetingCriteriaField; } + set { this.countryTargetingCriteriaField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeAssignment[] creativeAssignments { + get { return this.creativeAssignmentsField; } + set { this.creativeAssignmentsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public int[] daysOfWeek { + get { return this.daysOfWeekField; } + set { this.daysOfWeekField = value; } + } + + public int deliveryLimit { + get { return this.deliveryLimitField; } + set { this.deliveryLimitField = value; } + } + + public bool deliveryLimitEnabled { + get { return this.deliveryLimitEnabledField; } + set { this.deliveryLimitEnabledField = value; } + } + + public bool hardCutOff { + get { return this.hardCutOffField; } + set { this.hardCutOffField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public int[] hoursOfDay { + get { return this.hoursOfDayField; } + set { this.hoursOfDayField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string keywordExpression { + get { return this.keywordExpressionField; } + set { this.keywordExpressionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public MobilePlatform[] mobilePlatforms { + get { return this.mobilePlatformsField; } + set { this.mobilePlatformsField = value; } + } + + public int priority { + get { return this.priorityField; } + set { this.priorityField = value; } + } + + public int ratio { + get { return this.ratioField; } + set { this.ratioField = value; } + } + + public bool userLocalTime { + get { return this.userLocalTimeField; } + set { this.userLocalTimeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CountryTargetingCriteria { + private Country[] countriesField; + + private bool excludeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Country[] countries { + get { return this.countriesField; } + set { this.countriesField = value; } + } + + public bool exclude { + get { return this.excludeField; } + set { this.excludeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class Country : Base { + private string countryCodeField; + + private bool secureField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + + public bool secure { + get { return this.secureField; } + set { this.secureField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeAssignment { + private bool activeField; + + private string alternalteTextField; + + private ClickThroughUrl clickThroughUrlField; + + private CreativeGroupAssignment creativeGroupAssignmentField; + + private long creativeIdField; + + private System.DateTime? endDateField; + + private RichMediaExitOverride[] richMediaExitOverridesField; + + private int sequenceField; + + private System.DateTime? startDateField; + + private int weightField; + + public bool active { + get { return this.activeField; } + set { this.activeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string alternalteText { + get { return this.alternalteTextField; } + set { this.alternalteTextField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ClickThroughUrl clickThroughUrl { + get { return this.clickThroughUrlField; } + set { this.clickThroughUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeGroupAssignment creativeGroupAssignment { + get { return this.creativeGroupAssignmentField; } + set { this.creativeGroupAssignmentField = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { this.creativeIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaExitOverride[] richMediaExitOverrides { + get { return this.richMediaExitOverridesField; } + set { this.richMediaExitOverridesField = value; } + } + + public int sequence { + get { return this.sequenceField; } + set { this.sequenceField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public int weight { + get { return this.weightField; } + set { this.weightField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaExitOverride { + private string clickThroughUrlField; + + private long exitIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string clickThroughUrl { + get { return this.clickThroughUrlField; } + set { this.clickThroughUrlField = value; } + } + + public long exitId { + get { return this.exitIdField; } + set { this.exitIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class MobilePlatform : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class TrackingAd : AdBase { + private CreativeAssignment[] creativeAssignmentsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeAssignment[] creativeAssignments { + get { return this.creativeAssignmentsField; } + set { this.creativeAssignmentsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class DefaultAd : AdBase { + private CreativeAssignment creativeAssignmentField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeAssignment creativeAssignment { + get { return this.creativeAssignmentField; } + set { this.creativeAssignmentField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeAd))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RotationGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public abstract partial class TargetableAdBase : AdBase { + private ISP[] iSPsField; + + private OSP[] oSPsField; + + private AreaCode[] areaCodesField; + + private long audienceSegmentIdField; + + private Bandwidth[] bandwidthsField; + + private BrowserVersion[] browserVersionsField; + + private City[] citiesField; + + private int costTypeField; + + private CountryTargetingCriteria countryTargetingCriteriaField; + + private int[] daysOfWeekField; + + private int deliveryLimitField; + + private bool deliveryLimitEnabledField; + + private DesignatedMarketArea[] designatedMarketAreasField; + + private DomainNameBase[] domainNamesField; + + private DomainType[] domainTypesField; + + private int frequencyCapField; + + private long frequencyCapPeriodField; + + private bool hardCutOffField; + + private int[] hoursOfDayField; + + private string keywordExpressionField; + + private OperatingSystem[] operatingSystemsField; + + private string[] postalCodesField; + + private int priorityField; + + private int ratioField; + + private State[] statesField; + + private UserListExpression userListExpressionField; + + private bool userLocalTimeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ISP[] ISPs { + get { return this.iSPsField; } + set { this.iSPsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public OSP[] OSPs { + get { return this.oSPsField; } + set { this.oSPsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public AreaCode[] areaCodes { + get { return this.areaCodesField; } + set { this.areaCodesField = value; } + } + + public long audienceSegmentId { + get { return this.audienceSegmentIdField; } + set { this.audienceSegmentIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Bandwidth[] bandwidths { + get { return this.bandwidthsField; } + set { this.bandwidthsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public BrowserVersion[] browserVersions { + get { return this.browserVersionsField; } + set { this.browserVersionsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public City[] cities { + get { return this.citiesField; } + set { this.citiesField = value; } + } + + public int costType { + get { return this.costTypeField; } + set { this.costTypeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CountryTargetingCriteria countryTargetingCriteria { + get { return this.countryTargetingCriteriaField; } + set { this.countryTargetingCriteriaField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public int[] daysOfWeek { + get { return this.daysOfWeekField; } + set { this.daysOfWeekField = value; } + } + + public int deliveryLimit { + get { return this.deliveryLimitField; } + set { this.deliveryLimitField = value; } + } + + public bool deliveryLimitEnabled { + get { return this.deliveryLimitEnabledField; } + set { this.deliveryLimitEnabledField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DesignatedMarketArea[] designatedMarketAreas { + get { return this.designatedMarketAreasField; } + set { this.designatedMarketAreasField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DomainNameBase[] domainNames { + get { return this.domainNamesField; } + set { this.domainNamesField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DomainType[] domainTypes { + get { return this.domainTypesField; } + set { this.domainTypesField = value; } + } + + public int frequencyCap { + get { return this.frequencyCapField; } + set { this.frequencyCapField = value; } + } + + public long frequencyCapPeriod { + get { return this.frequencyCapPeriodField; } + set { this.frequencyCapPeriodField = value; } + } + + public bool hardCutOff { + get { return this.hardCutOffField; } + set { this.hardCutOffField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public int[] hoursOfDay { + get { return this.hoursOfDayField; } + set { this.hoursOfDayField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string keywordExpression { + get { return this.keywordExpressionField; } + set { this.keywordExpressionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public OperatingSystem[] operatingSystems { + get { return this.operatingSystemsField; } + set { this.operatingSystemsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string[] postalCodes { + get { return this.postalCodesField; } + set { this.postalCodesField = value; } + } + + public int priority { + get { return this.priorityField; } + set { this.priorityField = value; } + } + + public int ratio { + get { return this.ratioField; } + set { this.ratioField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public State[] states { + get { return this.statesField; } + set { this.statesField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public UserListExpression userListExpression { + get { return this.userListExpressionField; } + set { this.userListExpressionField = value; } + } + + public bool userLocalTime { + get { return this.userLocalTimeField; } + set { this.userLocalTimeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ISP : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class OSP : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AreaCode { + private long areaCodeField; + + private long countryIdField; + + public long areaCode { + get { return this.areaCodeField; } + set { this.areaCodeField = value; } + } + + public long countryId { + get { return this.countryIdField; } + set { this.countryIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class Bandwidth : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class BrowserVersion { + private Browser browserField; + + private int majorVersionField; + + private string minorVersionField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Browser browser { + get { return this.browserField; } + set { this.browserField = value; } + } + + public int majorVersion { + get { return this.majorVersionField; } + set { this.majorVersionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string minorVersion { + get { return this.minorVersionField; } + set { this.minorVersionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class Browser : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class City : Base { + private long countryIdField; + + private long regionIdField; + + public long countryId { + get { return this.countryIdField; } + set { this.countryIdField = value; } + } + + public long regionId { + get { return this.regionIdField; } + set { this.regionIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class DesignatedMarketArea : Base { + private long internalDmaIdField; + + public long internalDmaId { + get { return this.internalDmaIdField; } + set { this.internalDmaIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class DomainNameBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class DomainType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class OperatingSystem : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class State : Base { + private string abbreviationField; + + private long countryIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string abbreviation { + get { return this.abbreviationField; } + set { this.abbreviationField = value; } + } + + public long countryId { + get { return this.countryIdField; } + set { this.countryIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class UserListExpression { + private string idExpressionField; + + private string nameExpressionField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string idExpression { + get { return this.idExpressionField; } + set { this.idExpressionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string nameExpression { + get { return this.nameExpressionField; } + set { this.nameExpressionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeAd : TargetableAdBase { + private ClickThroughUrl clickThroughUrlField; + + private CreativeGroupAssignment creativeGroupAssignmentField; + + private long creativeIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ClickThroughUrl clickThroughUrl { + get { return this.clickThroughUrlField; } + set { this.clickThroughUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeGroupAssignment creativeGroupAssignment { + get { return this.creativeGroupAssignmentField; } + set { this.creativeGroupAssignmentField = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { this.creativeIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RotationGroup : TargetableAdBase { + private FrequencyCapGroup[] assignedFrequencyCapGroupsField; + + private CreativeAssignment[] creativeAssignmentsField; + + private bool creativeOptimizationEnabledField; + + private int rotationTypeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public FrequencyCapGroup[] assignedFrequencyCapGroups { + get { return this.assignedFrequencyCapGroupsField; } + set { this.assignedFrequencyCapGroupsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeAssignment[] creativeAssignments { + get { return this.creativeAssignmentsField; } + set { this.creativeAssignmentsField = value; } + } + + public bool creativeOptimizationEnabled { + get { return this.creativeOptimizationEnabledField; } + set { this.creativeOptimizationEnabledField = value; } + } + + public int rotationType { + get { return this.rotationTypeField; } + set { this.rotationTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementTagData { + private Advertiser advertiserField; + + private CampaignBase campaignField; + + private ClickCommandInfo[] clickCommandInfosField; + + private PlacementTagInfo[] placementTagInfosField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Advertiser advertiser { + get { return this.advertiserField; } + set { this.advertiserField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CampaignBase campaign { + get { return this.campaignField; } + set { this.campaignField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ClickCommandInfo[] clickCommandInfos { + get { return this.clickCommandInfosField; } + set { this.clickCommandInfosField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PlacementTagInfo[] placementTagInfos { + get { return this.placementTagInfosField; } + set { this.placementTagInfosField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class Advertiser : AdvertiserBase { + private long advertiserGroupIdField; + + private bool approvedField; + + private bool hiddenField; + + private bool impressionExchangeEnabledField; + + private bool inventoryAdvertiserField; + + private long networkIdField; + + private long spotIdField; + + private long subnetworkIdField; + + public long advertiserGroupId { + get { return this.advertiserGroupIdField; } + set { this.advertiserGroupIdField = value; } + } + + public bool approved { + get { return this.approvedField; } + set { this.approvedField = value; } + } + + public bool hidden { + get { return this.hiddenField; } + set { this.hiddenField = value; } + } + + public bool impressionExchangeEnabled { + get { return this.impressionExchangeEnabledField; } + set { this.impressionExchangeEnabledField = value; } + } + + public bool inventoryAdvertiser { + get { return this.inventoryAdvertiserField; } + set { this.inventoryAdvertiserField = value; } + } + + public long networkId { + get { return this.networkIdField; } + set { this.networkIdField = value; } + } + + public long spotId { + get { return this.spotIdField; } + set { this.spotIdField = value; } + } + + public long subnetworkId { + get { return this.subnetworkIdField; } + set { this.subnetworkIdField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Advertiser))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AdvertiserBase : Base { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CampaignSummary))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Campaign))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CampaignBase : Base { + private long advertiserIdField; + + private bool archivedField; + + private string billingInvoiceNotationField; + + private string commentsField; + + private long defaultLandingPageIdField; + + private System.DateTime? endDateField; + + private System.DateTime? startDateField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + public bool archived { + get { return this.archivedField; } + set { this.archivedField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string billingInvoiceNotation { + get { return this.billingInvoiceNotationField; } + set { this.billingInvoiceNotationField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string comments { + get { return this.commentsField; } + set { this.commentsField = value; } + } + + public long defaultLandingPageId { + get { return this.defaultLandingPageIdField; } + set { this.defaultLandingPageIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CampaignSummary : CampaignBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class Campaign : CampaignBase { + private bool advancedAdServingEnabledField; + + private AudienceSegmentGroup[] audienceSegmentGroupsField; + + private long[] creativeGroupIdsField; + + private CreativeOptimizationConfiguration creativeOptimizationConfigurationField; + + private long[] landingPageIdsField; + + private LookbackWindow lookbackWindowField; + + private ReachReportConfiguration reachReportConfigurationField; + + public bool advancedAdServingEnabled { + get { return this.advancedAdServingEnabledField; } + set { this.advancedAdServingEnabledField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public AudienceSegmentGroup[] audienceSegmentGroups { + get { return this.audienceSegmentGroupsField; } + set { this.audienceSegmentGroupsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] creativeGroupIds { + get { return this.creativeGroupIdsField; } + set { this.creativeGroupIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeOptimizationConfiguration creativeOptimizationConfiguration { + get { return this.creativeOptimizationConfigurationField; } + set { this.creativeOptimizationConfigurationField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] landingPageIds { + get { return this.landingPageIdsField; } + set { this.landingPageIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public LookbackWindow lookbackWindow { + get { return this.lookbackWindowField; } + set { this.lookbackWindowField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ReachReportConfiguration reachReportConfiguration { + get { return this.reachReportConfigurationField; } + set { this.reachReportConfigurationField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AudienceSegmentGroup : Base { + private AudienceSegment[] audienceSegmentsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public AudienceSegment[] audienceSegments { + get { return this.audienceSegmentsField; } + set { this.audienceSegmentsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AudienceSegment : Base { + private int percentageAllocationField; + + public int percentageAllocation { + get { return this.percentageAllocationField; } + set { this.percentageAllocationField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeOptimizationConfiguration { + private int minimumCreativeWeightField; + + private int optimizationModelIdField; + + private int relativeStrengthField; + + private SpotlightActivityWeight[] spotlightActivitiesField; + + public int minimumCreativeWeight { + get { return this.minimumCreativeWeightField; } + set { this.minimumCreativeWeightField = value; } + } + + public int optimizationModelId { + get { return this.optimizationModelIdField; } + set { this.optimizationModelIdField = value; } + } + + public int relativeStrength { + get { return this.relativeStrengthField; } + set { this.relativeStrengthField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SpotlightActivityWeight[] spotlightActivities { + get { return this.spotlightActivitiesField; } + set { this.spotlightActivitiesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SpotlightActivityWeight { + private long activityIdField; + + private int weightField; + + public long activityId { + get { return this.activityIdField; } + set { this.activityIdField = value; } + } + + public int weight { + get { return this.weightField; } + set { this.weightField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementTagCriteria { + private long idField; + + private long[] tagOptionIdsField; + + public long id { + get { return this.idField; } + set { this.idField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] tagOptionIds { + get { return this.tagOptionIdsField; } + set { this.tagOptionIdsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementGroupSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementUpdateResult : SaveResult { + private string errorMessageField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementUpdateResultSet { + private bool inErrorField; + + private PlacementUpdateResult[] resultField; + + public bool inError { + get { return this.inErrorField; } + set { this.inErrorField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PlacementUpdateResult[] result { + get { return this.resultField; } + set { this.resultField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementUpdateRequest { + private long campaignIdField; + + private System.DateTime? endDateField; + + private int flightingOptionField; + + private System.DateTime? startDateField; + + private int updateOptionField; + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + public int flightingOption { + get { return this.flightingOptionField; } + set { this.flightingOptionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public int updateOption { + get { return this.updateOptionField; } + set { this.updateOptionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementSummaryRecordSet : PagedRecordSet { + private PlacementSummary[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PlacementSummary[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementGroupRecordSet : PagedRecordSet { + private PlacementGroup[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PlacementGroup[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementGroup : PlacementGroupBase { + private bool archivedField; + + private long campaignIdField; + + private string commentsField; + + private long contentCategoryIdField; + + private long dfaSiteIdField; + + private int placementGroupTypeField; + + private long[] placementIdsField; + + private long placementStrategyIdField; + + private PricingSchedule pricingScheduleField; + + private long primaryPlacementIdField; + + private long siteIdField; + + public bool archived { + get { return this.archivedField; } + set { this.archivedField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string comments { + get { return this.commentsField; } + set { this.commentsField = value; } + } + + public long contentCategoryId { + get { return this.contentCategoryIdField; } + set { this.contentCategoryIdField = value; } + } + + public long dfaSiteId { + get { return this.dfaSiteIdField; } + set { this.dfaSiteIdField = value; } + } + + public int placementGroupType { + get { return this.placementGroupTypeField; } + set { this.placementGroupTypeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] placementIds { + get { return this.placementIdsField; } + set { this.placementIdsField = value; } + } + + public long placementStrategyId { + get { return this.placementStrategyIdField; } + set { this.placementStrategyIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PricingSchedule pricingSchedule { + get { return this.pricingScheduleField; } + set { this.pricingScheduleField = value; } + } + + public long primaryPlacementId { + get { return this.primaryPlacementIdField; } + set { this.primaryPlacementIdField = value; } + } + + public long siteId { + get { return this.siteIdField; } + set { this.siteIdField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PlacementGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementGroupBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementRecordSet : PagedRecordSet { + private Placement[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Placement[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class DateInterval { + private System.DateTime? endDateField; + + private System.DateTime? startDateField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementSummarySearchCriteria : PageableSearchCriteriaBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementGroupSearchCriteria : PageableSearchCriteriaBase { + private ActiveFilter archiveFilterField; + + private long[] campaignIdsField; + + private long[] dfaSiteIdsField; + + private DateInterval endDateRangeField; + + private int placementGroupFilterField; + + private long[] placementStrategyIdsField; + + private long[] pricingTypeIdsField; + + private long[] siteIdsField; + + private SortOrder sortOrderField; + + private DateInterval startDateRangeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ActiveFilter archiveFilter { + get { return this.archiveFilterField; } + set { this.archiveFilterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] dfaSiteIds { + get { return this.dfaSiteIdsField; } + set { this.dfaSiteIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DateInterval endDateRange { + get { return this.endDateRangeField; } + set { this.endDateRangeField = value; } + } + + public int placementGroupFilter { + get { return this.placementGroupFilterField; } + set { this.placementGroupFilterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] placementStrategyIds { + get { return this.placementStrategyIdsField; } + set { this.placementStrategyIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] pricingTypeIds { + get { return this.pricingTypeIdsField; } + set { this.pricingTypeIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] siteIds { + get { return this.siteIdsField; } + set { this.siteIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DateInterval startDateRange { + get { return this.startDateRangeField; } + set { this.startDateRangeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementSearchCriteria : PageableSearchCriteriaBase { + private ActiveFilter archiveFilterField; + + private long[] campaignIdsField; + + private long[] dfaSiteIdsField; + + private DateInterval endDateRangeField; + + private int placementFilterField; + + private long[] placementStrategyIdsField; + + private long[] placementTypeIdsField; + + private long[] pricingTypeIdsField; + + private long[] siteIdsField; + + private long[] sizeIdsField; + + private SortOrder sortOrderField; + + private DateInterval startDateRangeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ActiveFilter archiveFilter { + get { return this.archiveFilterField; } + set { this.archiveFilterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] dfaSiteIds { + get { return this.dfaSiteIdsField; } + set { this.dfaSiteIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DateInterval endDateRange { + get { return this.endDateRangeField; } + set { this.endDateRangeField = value; } + } + + public int placementFilter { + get { return this.placementFilterField; } + set { this.placementFilterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] placementStrategyIds { + get { return this.placementStrategyIdsField; } + set { this.placementStrategyIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] placementTypeIds { + get { return this.placementTypeIdsField; } + set { this.placementTypeIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] pricingTypeIds { + get { return this.pricingTypeIdsField; } + set { this.pricingTypeIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] siteIds { + get { return this.siteIdsField; } + set { this.siteIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] sizeIds { + get { return this.sizeIdsField; } + set { this.sizeIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DateInterval startDateRange { + get { return this.startDateRangeField; } + set { this.startDateRangeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PricingType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementGroupType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "reportSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class ReportRemoteService : DfaSoapClient { + public ReportRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.20/api/dfa-api/report"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getReportsByCriteriaReturn")] + public ReportInfoRecordSet getReportsByCriteria(ReportSearchCriteria ReportSearchCriteria) { + object[] results = this.Invoke("getReportsByCriteria", new object[] {ReportSearchCriteria}); + return ((ReportInfoRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getReportReturn")] + public ReportInfo getReport(ReportRequest ReportRequest) { + object[] results = this.Invoke("getReport", new object[] {ReportRequest}); + return ((ReportInfo) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("runDeferredReportReturn")] + public ReportInfo runDeferredReport(ReportRequest ReportRequest) { + object[] results = this.Invoke("runDeferredReport", new object[] {ReportRequest}); + return ((ReportInfo) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ReportSearchCriteria { + private DateInterval intervalField; + + private long queryIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DateInterval interval { + get { return this.intervalField; } + set { this.intervalField = value; } + } + + public long queryId { + get { return this.queryIdField; } + set { this.queryIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ReportRequest { + private long queryIdField; + + private long reportIdField; + + public long queryId { + get { return this.queryIdField; } + set { this.queryIdField = value; } + } + + public long reportId { + get { return this.reportIdField; } + set { this.reportIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ReportStatusType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ReportInfo { + private long queryIdField; + + private long reportIdField; + + private ReportStatusType statusField; + + private string urlField; + + public long queryId { + get { return this.queryIdField; } + set { this.queryIdField = value; } + } + + public long reportId { + get { return this.reportIdField; } + set { this.reportIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ReportStatusType status { + get { return this.statusField; } + set { this.statusField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ReportInfoRecordSet { + private ReportInfo[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ReportInfo[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "siteSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SiteDirectoryDfaSiteMappingResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SiteDirectoryDfaSiteMappingRequest))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(TagSettingsBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SiteDirectorySiteImportRequest))] + public partial class SiteRemoteService : DfaSoapClient { + public SiteRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.20/api/dfa-api/site"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("importSiteDirectorySitesReturn")] + public SiteDirectorySiteImportResult[] importSiteDirectorySites(SiteDirectorySiteImportRequest[] requests) { + object[] results = this.Invoke("importSiteDirectorySites", new object[] {requests}); + return ((SiteDirectorySiteImportResult[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getSitesByCriteriaReturn")] + public SiteRecordSet getSitesByCriteria(SiteSearchCriteria searchCriteria) { + object[] results = this.Invoke("getSitesByCriteria", new object[] {searchCriteria}); + return ((SiteRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public void linkDfaSiteToSiteDirectorySite(long dfaSiteId, long siteDirectorySiteId) { + this.Invoke("linkDfaSiteToSiteDirectorySite", new object[] {dfaSiteId, siteDirectorySiteId}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("linkDfaSitesToSiteDirectorySitesReturn")] + public SiteDirectoryDfaSiteMappingResult[] linkDfaSitesToSiteDirectorySites(SiteDirectoryDfaSiteMappingRequest[] requests) { + object[] results = this.Invoke("linkDfaSitesToSiteDirectorySites", new object[] {requests}); + return ((SiteDirectoryDfaSiteMappingResult[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("saveSiteDirectorySiteReturn")] + public SiteSaveResult saveSiteDirectorySite(Site site) { + object[] results = this.Invoke("saveSiteDirectorySite", new object[] {site}); + return ((SiteSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getDfaSiteReturn")] + public DfaSite getDfaSite(long dfaSiteId) { + object[] results = this.Invoke("getDfaSite", new object[] {dfaSiteId}); + return ((DfaSite) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getDfaSitesReturn")] + public DfaSiteRecordSet getDfaSites(DfaSiteSearchCriteria sc) { + object[] results = this.Invoke("getDfaSites", new object[] {sc}); + return ((DfaSiteRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("saveDfaSiteReturn")] + public DfaSiteSaveResult saveDfaSite(DfaSite dfaSite) { + object[] results = this.Invoke("saveDfaSite", new object[] {dfaSite}); + return ((DfaSiteSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getAvailableDfaSiteContactTypesReturn")] + public DfaSiteContactType[] getAvailableDfaSiteContactTypes() { + object[] results = this.Invoke("getAvailableDfaSiteContactTypes", new object[0]); + return ((DfaSiteContactType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getContactsReturn")] + public ContactRecordSet getContacts(ContactSearchCriteria sc) { + object[] results = this.Invoke("getContacts", new object[] {sc}); + return ((ContactRecordSet) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SiteDirectorySiteImportRequest { + private long siteDirectorySiteIdField; + + private long subnetworkIdField; + + public long siteDirectorySiteId { + get { return this.siteDirectorySiteIdField; } + set { this.siteDirectorySiteIdField = value; } + } + + public long subnetworkId { + get { return this.subnetworkIdField; } + set { this.subnetworkIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SiteDirectoryDfaSiteMappingResult { + private long dfaSiteIdField; + + private string errorMessageField; + + private long siteDirectorySiteIdField; + + public long dfaSiteId { + get { return this.dfaSiteIdField; } + set { this.dfaSiteIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + + public long siteDirectorySiteId { + get { return this.siteDirectorySiteIdField; } + set { this.siteDirectorySiteIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SiteDirectoryDfaSiteMappingRequest { + private long dfaSiteIdField; + + private long siteDirectorySiteIdField; + + public long dfaSiteId { + get { return this.dfaSiteIdField; } + set { this.dfaSiteIdField = value; } + } + + public long siteDirectorySiteId { + get { return this.siteDirectorySiteIdField; } + set { this.siteDirectorySiteIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SiteTagSettings : TagSettingsBase { + private string keywordReferrerField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string keywordReferrer { + get { return this.keywordReferrerField; } + set { this.keywordReferrerField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SiteRichMediaSettings { + private string alternateTextField; + + private string frameAndLayerFooterField; + + private string frameAndLayerHeaderField; + + private string iframeFooterField; + + private string iframeHeaderField; + + private string targetWindowField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string alternateText { + get { return this.alternateTextField; } + set { this.alternateTextField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string frameAndLayerFooter { + get { return this.frameAndLayerFooterField; } + set { this.frameAndLayerFooterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string frameAndLayerHeader { + get { return this.frameAndLayerHeaderField; } + set { this.frameAndLayerHeaderField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string iframeFooter { + get { return this.iframeFooterField; } + set { this.iframeFooterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string iframeHeader { + get { return this.iframeHeaderField; } + set { this.iframeHeaderField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string targetWindow { + get { return this.targetWindowField; } + set { this.targetWindowField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Contact))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ContactBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class Contact : ContactBase { + private bool allowedToEditSiteField; + + private string cityField; + + private string countryField; + + private string firstNameField; + + private string lastNameField; + + private string phoneField; + + private string postalCodeField; + + private string stateField; + + private string titleField; + + private string typeField; + + public bool allowedToEditSite { + get { return this.allowedToEditSiteField; } + set { this.allowedToEditSiteField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string city { + get { return this.cityField; } + set { this.cityField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string country { + get { return this.countryField; } + set { this.countryField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string firstName { + get { return this.firstNameField; } + set { this.firstNameField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string lastName { + get { return this.lastNameField; } + set { this.lastNameField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string phone { + get { return this.phoneField; } + set { this.phoneField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string postalCode { + get { return this.postalCodeField; } + set { this.postalCodeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string state { + get { return this.stateField; } + set { this.stateField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string title { + get { return this.titleField; } + set { this.titleField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string type { + get { return this.typeField; } + set { this.typeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class DfaSiteContactType : Base { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(DfaSiteContact))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class DfaSiteContactBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class DfaSiteContact : DfaSiteContactBase { + private long dfaSiteContactTypeIdField; + + private long dfaSiteIdField; + + private string firstNameField; + + private string lastNameField; + + public long dfaSiteContactTypeId { + get { return this.dfaSiteContactTypeIdField; } + set { this.dfaSiteContactTypeIdField = value; } + } + + public long dfaSiteId { + get { return this.dfaSiteIdField; } + set { this.dfaSiteIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string firstName { + get { return this.firstNameField; } + set { this.firstNameField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string lastName { + get { return this.lastNameField; } + set { this.lastNameField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(DfaSite))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class DfaSiteBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class DfaSite : DfaSiteBase { + private bool approvedField; + + private long countryIdField; + + private DfaSiteContact[] dfaSiteContactField; + + private bool displayAlternateTextBelowRichMediaCreativesField; + + private bool existingCookiesIgnoredField; + + private bool explicitApprovalNeededField; + + private string keynameField; + + private LookbackWindow lookbackWindowField; + + private long networkIdField; + + private bool newCookiesDisabledField; + + private SiteRichMediaSettings richMediaSettingsField; + + private long siteDirectorySiteIdField; + + private long subnetworkIdField; + + private SiteTagSettings tagSettingsField; + + public bool approved { + get { return this.approvedField; } + set { this.approvedField = value; } + } + + public long countryId { + get { return this.countryIdField; } + set { this.countryIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DfaSiteContact[] dfaSiteContact { + get { return this.dfaSiteContactField; } + set { this.dfaSiteContactField = value; } + } + + public bool displayAlternateTextBelowRichMediaCreatives { + get { return this.displayAlternateTextBelowRichMediaCreativesField; } + set { this.displayAlternateTextBelowRichMediaCreativesField = value; } + } + + public bool existingCookiesIgnored { + get { return this.existingCookiesIgnoredField; } + set { this.existingCookiesIgnoredField = value; } + } + + public bool explicitApprovalNeeded { + get { return this.explicitApprovalNeededField; } + set { this.explicitApprovalNeededField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string keyname { + get { return this.keynameField; } + set { this.keynameField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public LookbackWindow lookbackWindow { + get { return this.lookbackWindowField; } + set { this.lookbackWindowField = value; } + } + + public long networkId { + get { return this.networkIdField; } + set { this.networkIdField = value; } + } + + public bool newCookiesDisabled { + get { return this.newCookiesDisabledField; } + set { this.newCookiesDisabledField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SiteRichMediaSettings richMediaSettings { + get { return this.richMediaSettingsField; } + set { this.richMediaSettingsField = value; } + } + + public long siteDirectorySiteId { + get { return this.siteDirectorySiteIdField; } + set { this.siteDirectorySiteIdField = value; } + } + + public long subnetworkId { + get { return this.subnetworkIdField; } + set { this.subnetworkIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SiteTagSettings tagSettings { + get { return this.tagSettingsField; } + set { this.tagSettingsField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Site))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SiteBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class Site : SiteBase { + private bool acceptingInterstitialPlacementsField; + + private bool acceptingMobilePlacementsField; + + private bool acceptingPublisherPaidPlacementsField; + + private bool activeField; + + private long[] inpageTagSettingsField; + + private long[] interstitialTagSettingsField; + + private string[] urlsField; + + public bool acceptingInterstitialPlacements { + get { return this.acceptingInterstitialPlacementsField; } + set { this.acceptingInterstitialPlacementsField = value; } + } + + public bool acceptingMobilePlacements { + get { return this.acceptingMobilePlacementsField; } + set { this.acceptingMobilePlacementsField = value; } + } + + public bool acceptingPublisherPaidPlacements { + get { return this.acceptingPublisherPaidPlacementsField; } + set { this.acceptingPublisherPaidPlacementsField = value; } + } + + public bool active { + get { return this.activeField; } + set { this.activeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] inpageTagSettings { + get { return this.inpageTagSettingsField; } + set { this.inpageTagSettingsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] interstitialTagSettings { + get { return this.interstitialTagSettingsField; } + set { this.interstitialTagSettingsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string[] urls { + get { return this.urlsField; } + set { this.urlsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ContactRecordSet : PagedRecordSet { + private Contact[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Contact[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class DfaSiteRecordSet : PagedRecordSet { + private DfaSite[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DfaSite[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SiteRecordSet : PagedRecordSet { + private Site[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Site[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ContactSearchCriteria : PageableSearchCriteriaBase { + private bool includeParentContactsField; + + private long[] siteDirectorySiteIdsField; + + private SortOrder sortOrderField; + + public bool includeParentContacts { + get { return this.includeParentContactsField; } + set { this.includeParentContactsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] siteDirectorySiteIds { + get { return this.siteDirectorySiteIdsField; } + set { this.siteDirectorySiteIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class DfaSiteSearchCriteria : PageableSearchCriteriaBase { + private long[] sDSiteIdsField; + + private long[] campaignIdsField; + + private bool excludeSitesMappedToSiteDirectoryField; + + private long networkIdField; + + private SortOrder sortOrderField; + + private long subnetworkIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] SDSiteIds { + get { return this.sDSiteIdsField; } + set { this.sDSiteIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] campaignIds { + get { return this.campaignIdsField; } + set { this.campaignIdsField = value; } + } + + public bool excludeSitesMappedToSiteDirectory { + get { return this.excludeSitesMappedToSiteDirectoryField; } + set { this.excludeSitesMappedToSiteDirectoryField = value; } + } + + public long networkId { + get { return this.networkIdField; } + set { this.networkIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + + public long subnetworkId { + get { return this.subnetworkIdField; } + set { this.subnetworkIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SiteSearchCriteria : PageableSearchCriteriaBase { + private bool activeField; + + public bool active { + get { return this.activeField; } + set { this.activeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class DfaSiteSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SiteSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SiteDirectorySiteImportResult : SaveResult { + private long dfaSiteIdField; + + private string errorMessageField; + + private long subnetworkIdField; + + public long dfaSiteId { + get { return this.dfaSiteIdField; } + set { this.dfaSiteIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + + public long subnetworkId { + get { return this.subnetworkIdField; } + set { this.subnetworkIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "sizeSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + public partial class SizeRemoteService : DfaSoapClient { + public SizeRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.20/api/dfa-api/size"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("saveSizeReturn")] + public SizeSaveResult saveSize(Size size) { + object[] results = this.Invoke("saveSize", new object[] {size}); + return ((SizeSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getSizesReturn")] + public SizeRecordSet getSizes(SizeSearchCriteria searchCriteria) { + object[] results = this.Invoke("getSizes", new object[] {searchCriteria}); + return ((SizeRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getSizeReturn")] + public Size getSize(long id) { + object[] results = this.Invoke("getSize", new object[] {id}); + return ((Size) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class Size { + private int heightField; + + private long idField; + + private int widthField; + + public int height { + get { return this.heightField; } + set { this.heightField = value; } + } + + public long id { + get { return this.idField; } + set { this.idField = value; } + } + + public int width { + get { return this.widthField; } + set { this.widthField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SizeRecordSet { + private Size[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Size[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SizeSearchCriteria : SearchCriteriaBase { + private int heightField; + + private int widthField; + + public int height { + get { return this.heightField; } + set { this.heightField = value; } + } + + public int width { + get { return this.widthField; } + set { this.widthField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SizeSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "spotlightSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class SpotlightRemoteService : DfaSoapClient { + public SpotlightRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.20/api/dfa-api/spotlight"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getSpotlightConfigurationReturn")] + public SpotlightConfiguration getSpotlightConfiguration(long id) { + object[] results = this.Invoke("getSpotlightConfiguration", new object[] {id}); + return ((SpotlightConfiguration) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getSpotlightActivitiesReturn")] + public SpotlightActivityRecordSet getSpotlightActivities(SpotlightActivitySearchCriteria searchCriteria) { + object[] results = this.Invoke("getSpotlightActivities", new object[] {searchCriteria}); + return ((SpotlightActivityRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getSpotlightActivityReturn")] + public SpotlightActivity getSpotlightActivity(long spotlightActivityId) { + object[] results = this.Invoke("getSpotlightActivity", new object[] {spotlightActivityId}); + return ((SpotlightActivity) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("saveSpotlightActivityReturn")] + public SpotlightActivitySaveResult saveSpotlightActivity(SpotlightActivity spotlightActivity) { + object[] results = this.Invoke("saveSpotlightActivity", new object[] {spotlightActivity}); + return ((SpotlightActivitySaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("saveSpotlightConfigurationReturn")] + public SpotlightConfigurationSaveResult saveSpotlightConfiguration(SpotlightConfiguration spotlightConfiguration) { + object[] results = this.Invoke("saveSpotlightConfiguration", new object[] {spotlightConfiguration}); + return ((SpotlightConfigurationSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("saveSpotlightActivityGroupReturn")] + public SpotlightActivityGroupSaveResult saveSpotlightActivityGroup(SpotlightActivityGroup spotlightActivityGroup) { + object[] results = this.Invoke("saveSpotlightActivityGroup", new object[] {spotlightActivityGroup}); + return ((SpotlightActivityGroupSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public void deleteSpotlightActivity(long spolightActivityId) { + this.Invoke("deleteSpotlightActivity", new object[] {spolightActivityId}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getAvailableCustomSpotlightVariablesReturn")] + public CustomSpotlightVariable[] getAvailableCustomSpotlightVariables() { + object[] results = this.Invoke("getAvailableCustomSpotlightVariables", new object[0]); + return ((CustomSpotlightVariable[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public void deleteSpotlightActivityGroup(long spolightActivityGroupId) { + this.Invoke("deleteSpotlightActivityGroup", new object[] {spolightActivityGroupId}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getAvailableStandardVariablesReturn")] + public StandardVariable[] getAvailableStandardVariables() { + object[] results = this.Invoke("getAvailableStandardVariables", new object[0]); + return ((StandardVariable[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getCountriesByCriteriaReturn")] + public Country[] getCountriesByCriteria(CountrySearchCriteria searchCriteria) { + object[] results = this.Invoke("getCountriesByCriteria", new object[] {searchCriteria}); + return ((Country[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getSpotlightActivityGroupsReturn")] + public SpotlightActivityGroupRecordSet getSpotlightActivityGroups(SpotlightActivityGroupSearchCriteria searchCriteria) { + object[] results = this.Invoke("getSpotlightActivityGroups", new object[] {searchCriteria}); + return ((SpotlightActivityGroupRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getSpotlightActivityTypesReturn")] + public SpotlightActivityType[] getSpotlightActivityTypes() { + object[] results = this.Invoke("getSpotlightActivityTypes", new object[0]); + return ((SpotlightActivityType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getSpotlightTagCodeTypesReturn")] + public SpotlightTagCodeType[] getSpotlightTagCodeTypes() { + object[] results = this.Invoke("getSpotlightTagCodeTypes", new object[0]); + return ((SpotlightTagCodeType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getSpotlightTagFormatTypesReturn")] + public SpotlightTagFormatType[] getSpotlightTagFormatTypes() { + object[] results = this.Invoke("getSpotlightTagFormatTypes", new object[0]); + return ((SpotlightTagFormatType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getSpotlightTagMethodTypesReturn")] + public SpotlightTagMethodType[] getSpotlightTagMethodTypes() { + object[] results = this.Invoke("getSpotlightTagMethodTypes", new object[0]); + return ((SpotlightTagMethodType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("updateActivityImageTagsReturn")] + public SpotlightActivityImageTagsSaveResult[] updateActivityImageTags(SpotlightActivityImageTagsSaveRequest request) { + object[] results = this.Invoke("updateActivityImageTags", new object[] {request}); + return ((SpotlightActivityImageTagsSaveResult[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("generateTagsReturn")] + public string generateTags(long[] activityIds) { + object[] results = this.Invoke("generateTags", new object[] {activityIds}); + return ((string) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SpotlightConfiguration : SpotlightConfigurationBase { + private int clickDaysField; + + private bool crossSiteDuplicateReportField; + + private CustomSpotlightVariableConfiguration[] customSpotlightVariableConfigurationsField; + + private bool dynamicSpotlightEnabledField; + + private int exposureActivitiesCountField; + + private int exposureDaysField; + + private int exposureLevelField; + + private bool exposureToConversionReportField; + + private int firstDayOfWeekField; + + private bool frequencyConversionReportField; + + private bool googleAnalyticsIntegrationEnabledField; + + private bool imageTagsEnabledField; + + private int impressionDaysField; + + private int motifEventsDaysField; + + private long naturalSearchConversionAttributionOptionField; + + private bool omnitureCostDataEnabledField; + + private bool omnitureIntegrationEnabledField; + + private long[] standardVariableIdsField; + + private bool timeLagConversionReportField; + + private int timeSlotField; + + public int clickDays { + get { return this.clickDaysField; } + set { this.clickDaysField = value; } + } + + public bool crossSiteDuplicateReport { + get { return this.crossSiteDuplicateReportField; } + set { this.crossSiteDuplicateReportField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CustomSpotlightVariableConfiguration[] customSpotlightVariableConfigurations { + get { return this.customSpotlightVariableConfigurationsField; } + set { this.customSpotlightVariableConfigurationsField = value; } + } + + public bool dynamicSpotlightEnabled { + get { return this.dynamicSpotlightEnabledField; } + set { this.dynamicSpotlightEnabledField = value; } + } + + public int exposureActivitiesCount { + get { return this.exposureActivitiesCountField; } + set { this.exposureActivitiesCountField = value; } + } + + public int exposureDays { + get { return this.exposureDaysField; } + set { this.exposureDaysField = value; } + } + + public int exposureLevel { + get { return this.exposureLevelField; } + set { this.exposureLevelField = value; } + } + + public bool exposureToConversionReport { + get { return this.exposureToConversionReportField; } + set { this.exposureToConversionReportField = value; } + } + + public int firstDayOfWeek { + get { return this.firstDayOfWeekField; } + set { this.firstDayOfWeekField = value; } + } + + public bool frequencyConversionReport { + get { return this.frequencyConversionReportField; } + set { this.frequencyConversionReportField = value; } + } + + public bool googleAnalyticsIntegrationEnabled { + get { return this.googleAnalyticsIntegrationEnabledField; } + set { this.googleAnalyticsIntegrationEnabledField = value; } + } + + public bool imageTagsEnabled { + get { return this.imageTagsEnabledField; } + set { this.imageTagsEnabledField = value; } + } + + public int impressionDays { + get { return this.impressionDaysField; } + set { this.impressionDaysField = value; } + } + + public int motifEventsDays { + get { return this.motifEventsDaysField; } + set { this.motifEventsDaysField = value; } + } + + public long naturalSearchConversionAttributionOption { + get { return this.naturalSearchConversionAttributionOptionField; } + set { this.naturalSearchConversionAttributionOptionField = value; } + } + + public bool omnitureCostDataEnabled { + get { return this.omnitureCostDataEnabledField; } + set { this.omnitureCostDataEnabledField = value; } + } + + public bool omnitureIntegrationEnabled { + get { return this.omnitureIntegrationEnabledField; } + set { this.omnitureIntegrationEnabledField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] standardVariableIds { + get { return this.standardVariableIdsField; } + set { this.standardVariableIdsField = value; } + } + + public bool timeLagConversionReport { + get { return this.timeLagConversionReportField; } + set { this.timeLagConversionReportField = value; } + } + + public int timeSlot { + get { return this.timeSlotField; } + set { this.timeSlotField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CustomSpotlightVariableConfiguration : VariableBase { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CustomSpotlightVariableConfiguration))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public abstract partial class VariableBase : Base { + private int typeField; + + public int type { + get { return this.typeField; } + set { this.typeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SpotlightActivityImageTagsSaveRequest { + private long[] activityIdsField; + + private bool statusField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] activityIds { + get { return this.activityIdsField; } + set { this.activityIdsField = value; } + } + + public bool status { + get { return this.statusField; } + set { this.statusField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SpotlightActivityGroupRecordSet { + private SpotlightActivityGroup[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SpotlightActivityGroup[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SpotlightActivityGroup : SpotlightActivityGroupBase { + private int groupTypeField; + + private long spotlightConfigurationIdField; + + private string tagStringField; + + public int groupType { + get { return this.groupTypeField; } + set { this.groupTypeField = value; } + } + + public long spotlightConfigurationId { + get { return this.spotlightConfigurationIdField; } + set { this.spotlightConfigurationIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string tagString { + get { return this.tagStringField; } + set { this.tagStringField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SpotlightActivityGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public abstract partial class SpotlightActivityGroupBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CountrySearchCriteria { + private bool secureField; + + public bool secure { + get { return this.secureField; } + set { this.secureField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SpotlightActivityImageTagsSaveResult : SaveResult { + private string errorMessageField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SpotlightActivityGroupSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SpotlightConfigurationSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SpotlightActivitySaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SpotlightActivityRecordSet : PagedRecordSet { + private SpotlightActivity[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SpotlightActivity[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SpotlightActivity : SpotlightActivityBase { + private long activityGroupIdField; + + private long activityTypeIdField; + + private long[] assignedCustomSpotlightVariableIdsField; + + private long countryIdField; + + private FloodlightTag[] defaultFloodlightTagsField; + + private string expectedUrlField; + + private bool imageTagsEnabledField; + + private int minimumExpectedEventsField; + + private FloodlightPublisherTag[] publisherTagsField; + + private bool secureField; + + private long tagCodeTypeIdField; + + private long tagFormatIdField; + + private long tagMethodTypeIdField; + + private SpotlightActivityTagProperty tagPropertyField; + + private string tagStringField; + + public long activityGroupId { + get { return this.activityGroupIdField; } + set { this.activityGroupIdField = value; } + } + + public long activityTypeId { + get { return this.activityTypeIdField; } + set { this.activityTypeIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] assignedCustomSpotlightVariableIds { + get { return this.assignedCustomSpotlightVariableIdsField; } + set { this.assignedCustomSpotlightVariableIdsField = value; } + } + + public long countryId { + get { return this.countryIdField; } + set { this.countryIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public FloodlightTag[] defaultFloodlightTags { + get { return this.defaultFloodlightTagsField; } + set { this.defaultFloodlightTagsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string expectedUrl { + get { return this.expectedUrlField; } + set { this.expectedUrlField = value; } + } + + public bool imageTagsEnabled { + get { return this.imageTagsEnabledField; } + set { this.imageTagsEnabledField = value; } + } + + public int minimumExpectedEvents { + get { return this.minimumExpectedEventsField; } + set { this.minimumExpectedEventsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public FloodlightPublisherTag[] publisherTags { + get { return this.publisherTagsField; } + set { this.publisherTagsField = value; } + } + + public bool secure { + get { return this.secureField; } + set { this.secureField = value; } + } + + public long tagCodeTypeId { + get { return this.tagCodeTypeIdField; } + set { this.tagCodeTypeIdField = value; } + } + + public long tagFormatId { + get { return this.tagFormatIdField; } + set { this.tagFormatIdField = value; } + } + + public long tagMethodTypeId { + get { return this.tagMethodTypeIdField; } + set { this.tagMethodTypeIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SpotlightActivityTagProperty tagProperty { + get { return this.tagPropertyField; } + set { this.tagPropertyField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string tagString { + get { return this.tagStringField; } + set { this.tagStringField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(FloodlightPublisherTag))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class FloodlightTag : Base { + private string urlField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class FloodlightPublisherTag : FloodlightTag { + private bool clickThroughField; + + private long siteIdField; + + private bool viewThroughField; + + public bool clickThrough { + get { return this.clickThroughField; } + set { this.clickThroughField = value; } + } + + public long siteId { + get { return this.siteIdField; } + set { this.siteIdField = value; } + } + + public bool viewThrough { + get { return this.viewThroughField; } + set { this.viewThroughField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SpotlightActivityTagProperty { + private int averageNumEventsField; + + private bool errorField; + + private int lastDayNumEventsField; + + private string topReferrerURLField; + + public int averageNumEvents { + get { return this.averageNumEventsField; } + set { this.averageNumEventsField = value; } + } + + public bool error { + get { return this.errorField; } + set { this.errorField = value; } + } + + public int lastDayNumEvents { + get { return this.lastDayNumEventsField; } + set { this.lastDayNumEventsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string topReferrerURL { + get { return this.topReferrerURLField; } + set { this.topReferrerURLField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SpotlightActivity))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SpotlightActivityBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SpotlightActivityGroupSearchCriteria : SearchCriteriaBase { + private long advertiserIdField; + + private int typeField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + public int type { + get { return this.typeField; } + set { this.typeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SpotlightActivitySearchCriteria : PageableSearchCriteriaBase { + private ActiveFilter activeFilterField; + + private int activityTypeField; + + private long advertiserIdField; + + private long[] spotlightActivityGroupIdsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ActiveFilter activeFilter { + get { return this.activeFilterField; } + set { this.activeFilterField = value; } + } + + public int activityType { + get { return this.activityTypeField; } + set { this.activityTypeField = value; } + } + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] spotlightActivityGroupIds { + get { return this.spotlightActivityGroupIdsField; } + set { this.spotlightActivityGroupIdsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SpotlightTagMethodType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SpotlightTagFormatType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SpotlightTagCodeType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SpotlightActivityType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class StandardVariable : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CustomSpotlightVariable : Base { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SpotlightConfiguration))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SpotlightConfigurationBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "strategySoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class PlacementStrategyRemoteService : DfaSoapClient { + public PlacementStrategyRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.20/api/dfa-api/strategy"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("savePlacementStrategyReturn")] + public PlacementStrategySaveResult savePlacementStrategy(PlacementStrategy placementStrategy) { + object[] results = this.Invoke("savePlacementStrategy", new object[] {placementStrategy}); + return ((PlacementStrategySaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getPlacementStrategiesByCriteriaReturn")] + public PlacementStrategyRecordSet getPlacementStrategiesByCriteria(PlacementStrategySearchCriteria placementStrategySearchCriteria) { + object[] results = this.Invoke("getPlacementStrategiesByCriteria", new object[] {placementStrategySearchCriteria}); + return ((PlacementStrategyRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getPlacementStrategyReturn")] + public PlacementStrategy getPlacementStrategy(long placementStrategyId) { + object[] results = this.Invoke("getPlacementStrategy", new object[] {placementStrategyId}); + return ((PlacementStrategy) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public void deletePlacementStrategy(long placementStrategyId) { + this.Invoke("deletePlacementStrategy", new object[] {placementStrategyId}); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementStrategy : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementStrategyRecordSet : PagedRecordSet { + private PlacementStrategy[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public PlacementStrategy[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementStrategySearchCriteria : PageableSearchCriteriaBase { + private SortOrder sortOrderField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class PlacementStrategySaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "subnetworkSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class SubnetworkRemoteService : DfaSoapClient { + public SubnetworkRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.20/api/dfa-api/subnetwork"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getAllAvailablePermissionsReturn")] + public Permission[] getAllAvailablePermissions() { + object[] results = this.Invoke("getAllAvailablePermissions", new object[0]); + return ((Permission[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getDefaultPermissionsReturn")] + public Permission[] getDefaultPermissions() { + object[] results = this.Invoke("getDefaultPermissions", new object[0]); + return ((Permission[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getSubnetworksReturn")] + public SubnetworkRecordSet getSubnetworks(SubnetworkSearchCriteria subnetworkSearchCriteria) { + object[] results = this.Invoke("getSubnetworks", new object[] {subnetworkSearchCriteria}); + return ((SubnetworkRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getSubnetworkSummariesReturn")] + public SubnetworkSummaryRecordSet getSubnetworkSummaries(SubnetworkSearchCriteria subnetworkSearchCriteria) { + object[] results = this.Invoke("getSubnetworkSummaries", new object[] {subnetworkSearchCriteria}); + return ((SubnetworkSummaryRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("saveSubnetworkReturn")] + public SubnetworkSaveResult saveSubnetwork(Subnetwork subnetwork) { + object[] results = this.Invoke("saveSubnetwork", new object[] {subnetwork}); + return ((SubnetworkSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getSubnetworkReturn")] + public Subnetwork getSubnetwork(long subnetworkId) { + object[] results = this.Invoke("getSubnetwork", new object[] {subnetworkId}); + return ((Subnetwork) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SubnetworkSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SubnetworkSummaryRecordSet : PagedRecordSet { + private SubnetworkSummary[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SubnetworkSummary[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SubnetworkSummary : SubnetworkBase { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SubnetworkSummary))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Subnetwork))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public abstract partial class SubnetworkBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class Subnetwork : SubnetworkBase { + private long[] availablePermissionsField; + + private long networkIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] availablePermissions { + get { return this.availablePermissionsField; } + set { this.availablePermissionsField = value; } + } + + public long networkId { + get { return this.networkIdField; } + set { this.networkIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SubnetworkRecordSet : PagedRecordSet { + private Subnetwork[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Subnetwork[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class SubnetworkSearchCriteria : PageableSearchCriteriaBase { + private SortOrder sortOrderField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "userSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + public partial class UserRemoteService : DfaSoapClient { + public UserRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.20/api/dfa-api/user"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getUsersByCriteriaReturn")] + public UserRecordSet getUsersByCriteria(UserSearchCriteria searchCriteria) { + object[] results = this.Invoke("getUsersByCriteria", new object[] {searchCriteria}); + return ((UserRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("saveUserReturn")] + public UserSaveResult saveUser(User user) { + object[] results = this.Invoke("saveUser", new object[] {user}); + return ((UserSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("generateUniqueUsernameReturn")] + public string generateUniqueUsername(string username) { + object[] results = this.Invoke("generateUniqueUsername", new object[] {username}); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public void sendUserInvitationEmail(UserInvitationEmailRequest emailRequest) { + this.Invoke("sendUserInvitationEmail", new object[] {emailRequest}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getAvailableUserFilterTypesReturn")] + public UserFilterType[] getAvailableUserFilterTypes() { + object[] results = this.Invoke("getAvailableUserFilterTypes", new object[0]); + return ((UserFilterType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getAvailableUserFilterCriteriaTypesReturn")] + public UserFilterCriteriaType[] getAvailableUserFilterCriteriaTypes() { + object[] results = this.Invoke("getAvailableUserFilterCriteriaTypes", new object[0]); + return ((UserFilterCriteriaType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getAvailableTraffickerTypesReturn")] + public TraffickerType[] getAvailableTraffickerTypes() { + object[] results = this.Invoke("getAvailableTraffickerTypes", new object[0]); + return ((TraffickerType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getUserReturn")] + public User getUser(long userId) { + object[] results = this.Invoke("getUser", new object[] {userId}); + return ((User) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class UserSearchCriteria : PageableSearchCriteriaBase { + private ActiveFilter activeFilterField; + + private SortOrder sortOrderField; + + private long subnetworkIdField; + + private long userRoleIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ActiveFilter activeFilter { + get { return this.activeFilterField; } + set { this.activeFilterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + + public long subnetworkId { + get { return this.subnetworkIdField; } + set { this.subnetworkIdField = value; } + } + + public long userRoleId { + get { return this.userRoleIdField; } + set { this.userRoleIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class UserInvitationEmailRequest { + private string emailMessageField; + + private string emailSubjectField; + + private long idField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string emailMessage { + get { return this.emailMessageField; } + set { this.emailMessageField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string emailSubject { + get { return this.emailSubjectField; } + set { this.emailSubjectField = value; } + } + + public long id { + get { return this.idField; } + set { this.idField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class UserSaveResult : SaveResult { + private string tokenField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string token { + get { return this.tokenField; } + set { this.tokenField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class UserFilter { + private ObjectFilter[] objectFiltersField; + + private int userFilterCriteriaIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ObjectFilter[] objectFilters { + get { return this.objectFiltersField; } + set { this.objectFiltersField = value; } + } + + public int userFilterCriteriaId { + get { return this.userFilterCriteriaIdField; } + set { this.userFilterCriteriaIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ObjectFilter : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class TraffickerType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class UserFilterCriteriaType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class UserFilterType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class User : UserBase { + private UserFilter advertiserUserFilterField; + + private UserFilter campaignUserFilterField; + + private string commentsField; + + private bool gaiaEnabledField; + + private long languageEncodingIdField; + + private UserFilter siteUserFilterField; + + private long traffickerTypeField; + + private UserFilter userRoleUserFilterField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public UserFilter advertiserUserFilter { + get { return this.advertiserUserFilterField; } + set { this.advertiserUserFilterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public UserFilter campaignUserFilter { + get { return this.campaignUserFilterField; } + set { this.campaignUserFilterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string comments { + get { return this.commentsField; } + set { this.commentsField = value; } + } + + public bool gaiaEnabled { + get { return this.gaiaEnabledField; } + set { this.gaiaEnabledField = value; } + } + + public long languageEncodingId { + get { return this.languageEncodingIdField; } + set { this.languageEncodingIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public UserFilter siteUserFilter { + get { return this.siteUserFilterField; } + set { this.siteUserFilterField = value; } + } + + public long traffickerType { + get { return this.traffickerTypeField; } + set { this.traffickerTypeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public UserFilter userRoleUserFilter { + get { return this.userRoleUserFilterField; } + set { this.userRoleUserFilterField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class UserRecordSet : PagedRecordSet { + private User[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public User[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "adSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaExitOverride))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(BrowserVersion))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(AreaCode))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PlacementAssignment))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class AdRemoteService : DfaSoapClient { + public AdRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.20/api/dfa-api/ad"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getDomainTypesReturn")] + public DomainType[] getDomainTypes() { + object[] results = this.Invoke("getDomainTypes", new object[0]); + return ((DomainType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getISPsReturn")] + public ISP[] getISPs() { + object[] results = this.Invoke("getISPs", new object[0]); + return ((ISP[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getOSPsReturn")] + public OSP[] getOSPs() { + object[] results = this.Invoke("getOSPs", new object[0]); + return ((OSP[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getMobilePlatformsReturn")] + public MobilePlatform[] getMobilePlatforms() { + object[] results = this.Invoke("getMobilePlatforms", new object[0]); + return ((MobilePlatform[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public void deleteAd(long adId) { + this.Invoke("deleteAd", new object[] {adId}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getAdsReturn")] + public AdRecordSet getAds(AdSearchCriteria adSearchCriteria) { + object[] results = this.Invoke("getAds", new object[] {adSearchCriteria}); + return ((AdRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getDomainNamesBySearchCriteriaReturn")] + public DomainNameRecordSet getDomainNamesBySearchCriteria(DomainNameSearchCriteria searchCriteria) { + object[] results = this.Invoke("getDomainNamesBySearchCriteria", new object[] {searchCriteria}); + return ((DomainNameRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getUserListGroupsByCriteriaReturn")] + public UserListGroup[] getUserListGroupsByCriteria(UserListSearchCriteria searchCriteria) { + object[] results = this.Invoke("getUserListGroupsByCriteria", new object[] {searchCriteria}); + return ((UserListGroup[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getUserListsByCriteriaReturn")] + public UserList[] getUserListsByCriteria(UserListSearchCriteria searchCriteria) { + object[] results = this.Invoke("getUserListsByCriteria", new object[] {searchCriteria}); + return ((UserList[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("saveAdReturn")] + public AdSaveResult saveAd(AdBase ad) { + object[] results = this.Invoke("saveAd", new object[] {ad}); + return ((AdSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("updateCreativeAssignmentPropertiesReturn")] + public CreativeAdAssociationSaveResultSet updateCreativeAssignmentProperties(CreativeAdAssociationUpdateRequest associationUpdateRequest) { + object[] results = this.Invoke("updateCreativeAssignmentProperties", new object[] {associationUpdateRequest}); + return ((CreativeAdAssociationSaveResultSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getAreaCodesReturn")] + public AreaCode[] getAreaCodes(long[] countryIds) { + object[] results = this.Invoke("getAreaCodes", new object[] {countryIds}); + return ((AreaCode[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getDesignatedMarketAreasReturn")] + public DesignatedMarketArea[] getDesignatedMarketAreas() { + object[] results = this.Invoke("getDesignatedMarketAreas", new object[0]); + return ((DesignatedMarketArea[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getStatesReturn")] + public State[] getStates(long[] countryIds) { + object[] results = this.Invoke("getStates", new object[] {countryIds}); + return ((State[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getBandwidthsReturn")] + public Bandwidth[] getBandwidths() { + object[] results = this.Invoke("getBandwidths", new object[0]); + return ((Bandwidth[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getAdReturn")] + public AdBase getAd(long adId) { + object[] results = this.Invoke("getAd", new object[] {adId}); + return ((AdBase) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getAdTypesReturn")] + public AdType[] getAdTypes() { + object[] results = this.Invoke("getAdTypes", new object[0]); + return ((AdType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("copyAdsReturn")] + public AdCopyResult[] copyAds(AdCopyRequest[] adCopyRequests) { + object[] results = this.Invoke("copyAds", new object[] {adCopyRequests}); + return ((AdCopyResult[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getCountriesReturn")] + public Country[] getCountries() { + object[] results = this.Invoke("getCountries", new object[0]); + return ((Country[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getBrowsersReturn")] + public Browser[] getBrowsers() { + object[] results = this.Invoke("getBrowsers", new object[0]); + return ((Browser[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getCitiesReturn")] + public City[] getCities(CitySearchCriteria criteria) { + object[] results = this.Invoke("getCities", new object[] {criteria}); + return ((City[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getOperatingSystemsReturn")] + public OperatingSystem[] getOperatingSystems() { + object[] results = this.Invoke("getOperatingSystems", new object[0]); + return ((OperatingSystem[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getRegionsReturn")] + public Region[] getRegions(long[] countryIds) { + object[] results = this.Invoke("getRegions", new object[] {countryIds}); + return ((Region[]) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CitySearchCriteria { + private long[] countryIdsField; + + private long[] idsField; + + private long[] regionIdsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] countryIds { + get { return this.countryIdsField; } + set { this.countryIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] ids { + get { return this.idsField; } + set { this.idsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] regionIds { + get { return this.regionIdsField; } + set { this.regionIdsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeAdAssociationSaveResultSet { + private bool inErrorField; + + private CreativeAdAssociationSaveResult[] saveResultsField; + + public bool inError { + get { return this.inErrorField; } + set { this.inErrorField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeAdAssociationSaveResult[] saveResults { + get { return this.saveResultsField; } + set { this.saveResultsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeAdAssociationSaveResult : SaveResult { + private string errorMessageField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AdCopyResult : SaveResult { + private AdCopyRequest adCopyRequestField; + + private string errorMessageField; + + private string nameField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public AdCopyRequest adCopyRequest { + get { return this.adCopyRequestField; } + set { this.adCopyRequestField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AdCopyRequest { + private long adIdField; + + private long campaignIdField; + + private bool copyCreativeAssociationField; + + private bool copyPlacementAssignmentField; + + public long adId { + get { return this.adIdField; } + set { this.adIdField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + public bool copyCreativeAssociation { + get { return this.copyCreativeAssociationField; } + set { this.copyCreativeAssociationField = value; } + } + + public bool copyPlacementAssignment { + get { return this.copyPlacementAssignmentField; } + set { this.copyPlacementAssignmentField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AdSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeAdAssociationUpdateRequest { + private long[] adIdsField; + + private bool associationStatusField; + + private string clickThroughUrlField; + + private long creativeIdField; + + private System.DateTime? endDateField; + + private string[] propertiesToUpdateField; + + private System.DateTime? startDateField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] adIds { + get { return this.adIdsField; } + set { this.adIdsField = value; } + } + + public bool associationStatus { + get { return this.associationStatusField; } + set { this.associationStatusField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string clickThroughUrl { + get { return this.clickThroughUrlField; } + set { this.clickThroughUrlField = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { this.creativeIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string[] propertiesToUpdate { + get { return this.propertiesToUpdateField; } + set { this.propertiesToUpdateField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class DomainNameRecordSet : PagedRecordSet { + private DomainName[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DomainName[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class DomainName : DomainNameBase { + private string companyNameField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string companyName { + get { return this.companyNameField; } + set { this.companyNameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AdRecordSet : PagedRecordSet { + private AdBase[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public AdBase[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class UserListSearchCriteria : SearchCriteriaBase { + private long advertiserIdField; + + private long[] userListGroupIdsField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] userListGroupIds { + get { return this.userListGroupIdsField; } + set { this.userListGroupIdsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class DomainNameSearchCriteria : PageableSearchCriteriaBase { + private string domainField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string domain { + get { return this.domainField; } + set { this.domainField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AdSearchCriteria : PageableSearchCriteriaBase { + private ActiveFilter activeFilterField; + + private long campaignIdField; + + private long[] sizeIdsField; + + private long[] typeIdsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ActiveFilter activeFilter { + get { return this.activeFilterField; } + set { this.activeFilterField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] sizeIds { + get { return this.sizeIdsField; } + set { this.sizeIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] typeIds { + get { return this.typeIdsField; } + set { this.typeIdsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class Region : Base { + private long countryIdField; + + public long countryId { + get { return this.countryIdField; } + set { this.countryIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AdType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class UserList : Base { + private string descriptionField; + + private int estimatedUserCountField; + + private System.DateTime? modifiedTimestampField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public int estimatedUserCount { + get { return this.estimatedUserCountField; } + set { this.estimatedUserCountField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? modifiedTimestamp { + get { return this.modifiedTimestampField; } + set { this.modifiedTimestampField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class UserListGroup : Base { + private string descriptionField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "userroleSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + public partial class UserRoleRemoteService : DfaSoapClient { + public UserRoleRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.20/api/dfa-api/userrole"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getUserRolesReturn")] + public UserRoleRecordSet getUserRoles(UserRoleSearchCriteria criteria) { + object[] results = this.Invoke("getUserRoles", new object[] {criteria}); + return ((UserRoleRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public void deleteUserRole(long id) { + this.Invoke("deleteUserRole", new object[] {id}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getUserRoleSummariesReturn")] + public UserRoleSummaryRecordSet getUserRoleSummaries(UserRoleSearchCriteria searchCriteria) { + object[] results = this.Invoke("getUserRoleSummaries", new object[] {searchCriteria}); + return ((UserRoleSummaryRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("saveUserRoleReturn")] + public UserRoleSaveResult saveUserRole(UserRole userGroup) { + object[] results = this.Invoke("saveUserRole", new object[] {userGroup}); + return ((UserRoleSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getUserRoleReturn")] + public UserRole getUserRole(long id) { + object[] results = this.Invoke("getUserRole", new object[] {id}); + return ((UserRole) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getAvailablePermissionsReturn")] + public Permission[] getAvailablePermissions(long subnetworkId) { + object[] results = this.Invoke("getAvailablePermissions", new object[] {subnetworkId}); + return ((Permission[]) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class UserRoleSearchCriteria : PageableSearchCriteriaBase { + private bool parentNetworkUserRolesOnlyField; + + private SortOrder sortOrderField; + + private long subnetworkIdField; + + public bool parentNetworkUserRolesOnly { + get { return this.parentNetworkUserRolesOnlyField; } + set { this.parentNetworkUserRolesOnlyField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + + public long subnetworkId { + get { return this.subnetworkIdField; } + set { this.subnetworkIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class UserRoleSaveResult : SaveResult { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(UserRoleSummary))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(UserRole))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class UserRoleBase : Base { + private bool defaultUserRoleField; + + private long subnetworkIdField; + + public bool defaultUserRole { + get { return this.defaultUserRoleField; } + set { this.defaultUserRoleField = value; } + } + + public long subnetworkId { + get { return this.subnetworkIdField; } + set { this.subnetworkIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class UserRoleSummary : UserRoleBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class UserRole : UserRoleBase { + private long parentUserRoleIdField; + + private Permission[] permissionsField; + + private long totalAssignedUsersField; + + public long parentUserRoleId { + get { return this.parentUserRoleIdField; } + set { this.parentUserRoleIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Permission[] permissions { + get { return this.permissionsField; } + set { this.permissionsField = value; } + } + + public long totalAssignedUsers { + get { return this.totalAssignedUsersField; } + set { this.totalAssignedUsersField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class UserRoleSummaryRecordSet : PagedRecordSet { + private UserRoleSummary[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public UserRoleSummary[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class UserRoleRecordSet : PagedRecordSet { + private UserRole[] userRolesField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public UserRole[] userRoles { + get { return this.userRolesField; } + set { this.userRolesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "advertiserSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class AdvertiserRemoteService : DfaSoapClient { + public AdvertiserRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.20/api/dfa-api/advertiser"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("saveAdvertiserReturn")] + public AdvertiserSaveResult saveAdvertiser(Advertiser advertiser) { + object[] results = this.Invoke("saveAdvertiser", new object[] {advertiser}); + return ((AdvertiserSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public void deleteAdvertiser(long advertiserId) { + this.Invoke("deleteAdvertiser", new object[] {advertiserId}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getAdvertisersReturn")] + public AdvertiserRecordSet getAdvertisers(AdvertiserSearchCriteria advertiserSearchCriteria) { + object[] results = this.Invoke("getAdvertisers", new object[] {advertiserSearchCriteria}); + return ((AdvertiserRecordSet) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AdvertiserRecordSet : PagedRecordSet { + private Advertiser[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Advertiser[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AdvertiserSearchCriteria : PageableSearchCriteriaBase { + private long[] advertiserGroupIdsField; + + private bool includeAdvertisersWithOutGroupOnlyField; + + private bool includeInventoryAdvertisersOnlyField; + + private long[] spotIdsField; + + private long subnetworkIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] advertiserGroupIds { + get { return this.advertiserGroupIdsField; } + set { this.advertiserGroupIdsField = value; } + } + + public bool includeAdvertisersWithOutGroupOnly { + get { return this.includeAdvertisersWithOutGroupOnlyField; } + set { this.includeAdvertisersWithOutGroupOnlyField = value; } + } + + public bool includeInventoryAdvertisersOnly { + get { return this.includeInventoryAdvertisersOnlyField; } + set { this.includeInventoryAdvertisersOnlyField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] spotIds { + get { return this.spotIdsField; } + set { this.spotIdsField = value; } + } + + public long subnetworkId { + get { return this.subnetworkIdField; } + set { this.subnetworkIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AdvertiserSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "advertisergroupSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class AdvertiserGroupRemoteService : DfaSoapClient { + public AdvertiserGroupRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.20/api/dfa-api/advertisergroup"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public void deleteAdvertiserGroup(long advertiserGroupId) { + this.Invoke("deleteAdvertiserGroup", new object[] {advertiserGroupId}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getAdvertiserGroupReturn")] + public AdvertiserGroup getAdvertiserGroup(long advertiserGroupId) { + object[] results = this.Invoke("getAdvertiserGroup", new object[] {advertiserGroupId}); + return ((AdvertiserGroup) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("saveAdvertiserGroupReturn")] + public AdvertiserGroupSaveResult saveAdvertiserGroup(AdvertiserGroup advertiserGroup) { + object[] results = this.Invoke("saveAdvertiserGroup", new object[] {advertiserGroup}); + return ((AdvertiserGroupSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public void assignAdvertisersToAdvertiserGroup(long advertiserGroupId, long[] advertiserIds) { + this.Invoke("assignAdvertisersToAdvertiserGroup", new object[] {advertiserGroupId, advertiserIds}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getAdvertiserGroupsReturn")] + public AdvertiserGroupRecordSet getAdvertiserGroups(AdvertiserGroupSearchCriteria searchCriteria) { + object[] results = this.Invoke("getAdvertiserGroups", new object[] {searchCriteria}); + return ((AdvertiserGroupRecordSet) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AdvertiserGroup : AdvertiserGroupBase { + private int advertiserCountField; + + public int advertiserCount { + get { return this.advertiserCountField; } + set { this.advertiserCountField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(AdvertiserGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AdvertiserGroupBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AdvertiserGroupRecordSet : PagedRecordSet { + private AdvertiserGroup[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public AdvertiserGroup[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AdvertiserGroupSearchCriteria : PageableSearchCriteriaBase { + private SortOrder sortOrderField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class AdvertiserGroupSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "campaignSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SpotlightActivityWeight))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class CampaignRemoteService : DfaSoapClient { + public CampaignRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.20/api/dfa-api/campaign"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("saveCampaignReturn")] + public CampaignSaveResult saveCampaign(Campaign campaign) { + object[] results = this.Invoke("saveCampaign", new object[] {campaign}); + return ((CampaignSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public void deleteCampaign(long campaignId) { + this.Invoke("deleteCampaign", new object[] {campaignId}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getLandingPagesForCampaignReturn")] + public LandingPageRecordSet getLandingPagesForCampaign(long nCampaignId) { + object[] results = this.Invoke("getLandingPagesForCampaign", new object[] {nCampaignId}); + return ((LandingPageRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("addLandingPageToCampaignReturn")] + public bool addLandingPageToCampaign(long nCampaignId, LandingPage[] landingPages) { + object[] results = this.Invoke("addLandingPageToCampaign", new object[] {nCampaignId, landingPages}); + return ((bool) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getCampaignsByCriteriaReturn")] + public CampaignRecordSet getCampaignsByCriteria(CampaignSearchCriteria searchCriteria) { + object[] results = this.Invoke("getCampaignsByCriteria", new object[] {searchCriteria}); + return ((CampaignRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("migrateCampaignReturn")] + public CampaignMigrationResult migrateCampaign(CampaignMigrationRequest campaignMigrationRequest) { + object[] results = this.Invoke("migrateCampaign", new object[] {campaignMigrationRequest}); + return ((CampaignMigrationResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("copyCampaignsReturn")] + public CampaignCopyResult[] copyCampaigns(CampaignCopyRequest[] campaignCopyRequests) { + object[] results = this.Invoke("copyCampaigns", new object[] {campaignCopyRequests}); + return ((CampaignCopyResult[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getCampaignReturn")] + public Campaign getCampaign(long id) { + object[] results = this.Invoke("getCampaign", new object[] {id}); + return ((Campaign) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("saveLandingPageReturn")] + public LandingPageSaveResult saveLandingPage(LandingPage landingPage) { + object[] results = this.Invoke("saveLandingPage", new object[] {landingPage}); + return ((LandingPageSaveResult) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CampaignMigrationRequest { + private long campaignIdField; + + private string landingPageUrlField; + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string landingPageUrl { + get { return this.landingPageUrlField; } + set { this.landingPageUrlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CampaignRecordSet : PagedRecordSet { + private Campaign[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Campaign[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CampaignSearchCriteria : PageableSearchCriteriaBase { + private long[] advertiserIdsField; + + private ActiveFilter archiveFilterField; + + private SortOrder sortOrderField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] advertiserIds { + get { return this.advertiserIdsField; } + set { this.advertiserIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ActiveFilter archiveFilter { + get { return this.archiveFilterField; } + set { this.archiveFilterField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class LandingPageRecordSet { + private LandingPage[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public LandingPage[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class LandingPage : LandingPageBase { + private string urlField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(LandingPage))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class LandingPageBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CampaignCopyRequest { + private long campaignIdField; + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class LandingPageSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CampaignCopyResult : SaveResult { + private CampaignCopyRequest copyRequestField; + + private string errorMessageField; + + private string nameField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CampaignCopyRequest copyRequest { + get { return this.copyRequestField; } + set { this.copyRequestField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CampaignMigrationResult : SaveResult { + private string errorMessageField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CampaignSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "changelogSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + public partial class ChangeLogRemoteService : DfaSoapClient { + public ChangeLogRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.20/api/dfa-api/changelog"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getChangeLogRecordsReturn")] + public ChangeLogRecordSet getChangeLogRecords(ChangeLogRecordSearchCriteria criteria) { + object[] results = this.Invoke("getChangeLogRecords", new object[] {criteria}); + return ((ChangeLogRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getChangeLogObjectTypesReturn")] + public ChangeLogObjectType[] getChangeLogObjectTypes() { + object[] results = this.Invoke("getChangeLogObjectTypes", new object[0]); + return ((ChangeLogObjectType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public void updateChangeLogRecordComments(long changeLogRecordId, string comments) { + this.Invoke("updateChangeLogRecordComments", new object[] {changeLogRecordId, comments}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public void updateChangeLogRecordCommentsForObjectType(long changeLogRecordId, string comments, long objectTypeId) { + this.Invoke("updateChangeLogRecordCommentsForObjectType", new object[] {changeLogRecordId, comments, objectTypeId}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getChangeLogRecordForObjectTypeReturn")] + public ChangeLogRecord getChangeLogRecordForObjectType(long id, long objectTypeId) { + object[] results = this.Invoke("getChangeLogRecordForObjectType", new object[] {id, objectTypeId}); + return ((ChangeLogRecord) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getChangeLogRecordReturn")] + public ChangeLogRecord getChangeLogRecord(long id) { + object[] results = this.Invoke("getChangeLogRecord", new object[] {id}); + return ((ChangeLogRecord) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ChangeLogRecordSearchCriteria : PageableSearchCriteriaBase { + private long objectIdField; + + private long objectTypeIdField; + + private SortOrder sortOrderField; + + public long objectId { + get { return this.objectIdField; } + set { this.objectIdField = value; } + } + + public long objectTypeId { + get { return this.objectTypeIdField; } + set { this.objectTypeIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ChangeLogObjectType : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ChangeLogRecord { + private string actionField; + + private System.DateTime? changeDateField; + + private string commentsField; + + private string contextField; + + private long groupIdField; + + private long idField; + + private string newValueField; + + private long objectIdField; + + private string objectTypeField; + + private string oldValueField; + + private long userIdField; + + private string usernameField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string action { + get { return this.actionField; } + set { this.actionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? changeDate { + get { return this.changeDateField; } + set { this.changeDateField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string comments { + get { return this.commentsField; } + set { this.commentsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string context { + get { return this.contextField; } + set { this.contextField = value; } + } + + public long groupId { + get { return this.groupIdField; } + set { this.groupIdField = value; } + } + + public long id { + get { return this.idField; } + set { this.idField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string newValue { + get { return this.newValueField; } + set { this.newValueField = value; } + } + + public long objectId { + get { return this.objectIdField; } + set { this.objectIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string objectType { + get { return this.objectTypeField; } + set { this.objectTypeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string oldValue { + get { return this.oldValueField; } + set { this.oldValueField = value; } + } + + public long userId { + get { return this.userIdField; } + set { this.userIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string username { + get { return this.usernameField; } + set { this.usernameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ChangeLogRecordSet : PagedRecordSet { + private ChangeLogRecord[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ChangeLogRecord[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "contentcategorySoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + public partial class ContentCategoryRemoteService : DfaSoapClient { + public ContentCategoryRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.20/api/dfa-api/contentcategory"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getContentCategoriesReturn")] + public ContentCategoryRecordSet getContentCategories(ContentCategorySearchCriteria searchCriteria) { + object[] results = this.Invoke("getContentCategories", new object[] {searchCriteria}); + return ((ContentCategoryRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getContentCategoryReturn")] + public ContentCategory getContentCategory(long contentCategoryId) { + object[] results = this.Invoke("getContentCategory", new object[] {contentCategoryId}); + return ((ContentCategory) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("saveContentCategoryReturn")] + public ContentCategorySaveResult saveContentCategory(ContentCategory contentCategory) { + object[] results = this.Invoke("saveContentCategory", new object[] {contentCategory}); + return ((ContentCategorySaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public void deleteContentCategory(long contentCategoryId) { + this.Invoke("deleteContentCategory", new object[] {contentCategoryId}); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ContentCategorySearchCriteria : PageableSearchCriteriaBase { + private SortOrder sortOrderField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ContentCategorySaveResult : SaveResult { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(ContentCategory))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ContentCategoryBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ContentCategory : ContentCategoryBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ContentCategoryRecordSet : PagedRecordSet { + private ContentCategory[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ContentCategory[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "creativeSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativePlacementAssignment))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RawFileSummary))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeSaveRequest))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeRenderingResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeAssetBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(FlashClickTag))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(InStreamNonLinearAd))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(InStreamCompanionAd))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeFieldAssignment))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + public partial class CreativeRemoteService : DfaSoapClient { + public CreativeRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.20/api/dfa-api/creative"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativesReturn")] + public CreativeRecordSet getCreatives(CreativeSearchCriteria searchCriteria) { + object[] results = this.Invoke("getCreatives", new object[] {searchCriteria}); + return ((CreativeRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("saveCreativeReturn")] + public CreativeSaveResult saveCreative(CreativeBase creativeBase, long campaignId) { + object[] results = this.Invoke("saveCreative", new object[] {creativeBase, campaignId}); + return ((CreativeSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("saveCreativeAssetReturn")] + public CreativeAssetSaveResult saveCreativeAsset(CreativeAsset creativeAsset) { + object[] results = this.Invoke("saveCreativeAsset", new object[] {creativeAsset}); + return ((CreativeAssetSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("associateCreativesToCampaignReturn")] + public CreativeCampaignAssociationResult[] associateCreativesToCampaign(long campaignId, long[] creativeIds) { + object[] results = this.Invoke("associateCreativesToCampaign", new object[] {campaignId, creativeIds}); + return ((CreativeCampaignAssociationResult[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("copyCreativeReturn")] + public CreativeCopyResult[] copyCreative(CreativeCopyRequest[] copyRequests) { + object[] results = this.Invoke("copyCreative", new object[] {copyRequests}); + return ((CreativeCopyResult[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativeRenderingsReturn")] + public CreativeRenderingResult[] getCreativeRenderings(CreativeRenderingRequest request) { + object[] results = this.Invoke("getCreativeRenderings", new object[] {request}); + return ((CreativeRenderingResult[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("uploadRichMediaAssetReturn")] + public RichMediaCreativeBase uploadRichMediaAsset(RichMediaAssetUploadRequest uploadRequest) { + object[] results = this.Invoke("uploadRichMediaAsset", new object[] {uploadRequest}); + return ((RichMediaCreativeBase) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("replaceRichMediaAssetReturn")] + public RichMediaCreativeBase replaceRichMediaAsset(string oldAssetFileName, RichMediaAssetUploadRequest replaceRequest) { + object[] results = this.Invoke("replaceRichMediaAsset", new object[] {oldAssetFileName, replaceRequest}); + return ((RichMediaCreativeBase) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("deleteRichMediaAssetReturn")] + public RichMediaCreativeBase deleteRichMediaAsset(long creativeId, string assetFileName) { + object[] results = this.Invoke("deleteRichMediaAsset", new object[] {creativeId, assetFileName}); + return ((RichMediaCreativeBase) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("uploadRichMediaCreativePackageReturn")] + public RichMediaCreativeBase uploadRichMediaCreativePackage(long advertiserId, [System.Xml.Serialization.SoapElementAttribute(DataType = "base64Binary")] +byte[] fileData, bool uploadAsFlashInFlashCreative) { + object[] results = this.Invoke("uploadRichMediaCreativePackage", new object[] {advertiserId, fileData, uploadAsFlashInFlashCreative}); + return ((RichMediaCreativeBase) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("replaceRichMediaCreativePackageReturn")] + public RichMediaCreativeBase replaceRichMediaCreativePackage(long creativeId, [System.Xml.Serialization.SoapElementAttribute(DataType = "base64Binary")] +byte[] fileData) { + object[] results = this.Invoke("replaceRichMediaCreativePackage", new object[] {creativeId, fileData}); + return ((RichMediaCreativeBase) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getRichMediaPreviewURLReturn")] + public string getRichMediaPreviewURL(long creativeId) { + object[] results = this.Invoke("getRichMediaPreviewURL", new object[] {creativeId}); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("uploadInStreamAssetReturn")] + public InStreamVideoCreative uploadInStreamAsset(InStreamAssetUploadRequest assetUploadRequest) { + object[] results = this.Invoke("uploadInStreamAsset", new object[] {assetUploadRequest}); + return ((InStreamVideoCreative) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("deleteInStreamAssetReturn")] + public InStreamVideoCreative deleteInStreamAsset(long creativeId, string assetName) { + object[] results = this.Invoke("deleteInStreamAsset", new object[] {creativeId, assetName}); + return ((InStreamVideoCreative) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("replaceInStreamAssetReturn")] + public InStreamVideoCreative replaceInStreamAsset(string assetName, InStreamAssetUploadRequest assetReplaceRequest) { + object[] results = this.Invoke("replaceInStreamAsset", new object[] {assetName, assetReplaceRequest}); + return ((InStreamVideoCreative) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getRichMediaStandardEventsReturn")] + public RichMediaStandardEvent[] getRichMediaStandardEvents() { + object[] results = this.Invoke("getRichMediaStandardEvents", new object[0]); + return ((RichMediaStandardEvent[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("generateCreativeUploadSessionReturn")] + public CreativeUploadSession generateCreativeUploadSession(CreativeUploadSessionRequest creativeUploadSessionRequest) { + object[] results = this.Invoke("generateCreativeUploadSession", new object[] {creativeUploadSessionRequest}); + return ((CreativeUploadSession) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("uploadCreativeFilesReturn")] + public CreativeUploadSession uploadCreativeFiles(CreativeUploadRequest uploadRequest) { + object[] results = this.Invoke("uploadCreativeFiles", new object[] {uploadRequest}); + return ((CreativeUploadSession) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getCompleteCreativeUploadSessionReturn")] + public CreativeUploadSession getCompleteCreativeUploadSession(CreativeUploadSessionSummary uploadSession) { + object[] results = this.Invoke("getCompleteCreativeUploadSession", new object[] {uploadSession}); + return ((CreativeUploadSession) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("createCreativesFromCreativeUploadSessionReturn")] + public CreativeUploadSession createCreativesFromCreativeUploadSession(CreativeUploadSession uploadSession) { + object[] results = this.Invoke("createCreativesFromCreativeUploadSession", new object[] {uploadSession}); + return ((CreativeUploadSession) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public void deleteCreative(long creativeId) { + this.Invoke("deleteCreative", new object[] {creativeId}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativeAssetsReturn")] + public CreativeAssetRecordSet getCreativeAssets(CreativeAssetSearchCriteria searchCriteria) { + object[] results = this.Invoke("getCreativeAssets", new object[] {searchCriteria}); + return ((CreativeAssetRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativeTypesReturn")] + public CreativeType[] getCreativeTypes() { + object[] results = this.Invoke("getCreativeTypes", new object[0]); + return ((CreativeType[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativeReturn")] + public CreativeBase getCreative(long creativeId) { + object[] results = this.Invoke("getCreative", new object[] {creativeId}); + return ((CreativeBase) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("assignCreativesToPlacementsReturn")] + public CreativePlacementAssignmentResult[] assignCreativesToPlacements(CreativePlacementAssignment[] creativePlacementAssignments) { + object[] results = this.Invoke("assignCreativesToPlacements", new object[] {creativePlacementAssignments}); + return ((CreativePlacementAssignmentResult[]) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeSearchCriteria : PageableSearchCriteriaBase { + private ActiveFilter activeStatusField; + + private long advertiserIdField; + + private long archiveStatusFilterField; + + private long campaignIdField; + + private DateInterval creativeCreationDateRangeField; + + private long[] renderingIdsField; + + private bool studioCreativeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ActiveFilter activeStatus { + get { return this.activeStatusField; } + set { this.activeStatusField = value; } + } + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + public long archiveStatusFilter { + get { return this.archiveStatusFilterField; } + set { this.archiveStatusFilterField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public DateInterval creativeCreationDateRange { + get { return this.creativeCreationDateRangeField; } + set { this.creativeCreationDateRangeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] renderingIds { + get { return this.renderingIdsField; } + set { this.renderingIdsField = value; } + } + + public bool studioCreative { + get { return this.studioCreativeField; } + set { this.studioCreativeField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativePlacementAssignmentResult))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativePlacementAssignment { + private string adNameField; + + private long creativeIdField; + + private long placementIdField; + + private long[] placementIdsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string adName { + get { return this.adNameField; } + set { this.adNameField = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { this.creativeIdField = value; } + } + + public long placementId { + get { return this.placementIdField; } + set { this.placementIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] placementIds { + get { return this.placementIdsField; } + set { this.placementIdsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativePlacementAssignmentResult : CreativePlacementAssignment { + private long adIdField; + + private string errorMessageField; + + public long adId { + get { return this.adIdField; } + set { this.adIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeAssetRecordSet { + private CreativeAssetBase[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeAssetBase[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public abstract partial class CreativeAssetBase { + private long advertiserIdField; + + private bool forHTMLCreativesField; + + private string nameField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + public bool forHTMLCreatives { + get { return this.forHTMLCreativesField; } + set { this.forHTMLCreativesField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeAsset : CreativeAssetBase { + private byte[] contentField; + + [System.Xml.Serialization.SoapElementAttribute(DataType = "base64Binary", IsNullable = true)] + public byte[] content { + get { return this.contentField; } + set { this.contentField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeAssetSearchCriteria { + private long advertiserIdField; + + private string assetFilenameField; + + private bool forHTMLCreativesField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string assetFilename { + get { return this.assetFilenameField; } + set { this.assetFilenameField = value; } + } + + public bool forHTMLCreatives { + get { return this.forHTMLCreativesField; } + set { this.forHTMLCreativesField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RawFile))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RawFileSummary { + private string filenameField; + + private string mimeTypeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string filename { + get { return this.filenameField; } + set { this.filenameField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string mimeType { + get { return this.mimeTypeField; } + set { this.mimeTypeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RawFile : RawFileSummary { + private byte[] fileDataField; + + [System.Xml.Serialization.SoapElementAttribute(DataType = "base64Binary", IsNullable = true)] + public byte[] fileData { + get { return this.fileDataField; } + set { this.fileDataField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeUploadRequest { + private CreativeUploadSessionSummary creativeUploadSessionSummaryField; + + private RawFile[] rawFilesField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeUploadSessionSummary creativeUploadSessionSummary { + get { return this.creativeUploadSessionSummaryField; } + set { this.creativeUploadSessionSummaryField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RawFile[] rawFiles { + get { return this.rawFilesField; } + set { this.rawFilesField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeUploadSession))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeUploadSessionSummary { + private long advertiserIdField; + + private long campaignIdField; + + private long creativeUploadIdField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + public long creativeUploadId { + get { return this.creativeUploadIdField; } + set { this.creativeUploadIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeUploadSession : CreativeUploadSessionSummary { + private CreativeSaveRequest[] creativeSaveRequestsField; + + private CreativeUploadFileCount fileCountField; + + private int statusField; + + private CreativeUploadFile[] uploadedFilesField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeSaveRequest[] creativeSaveRequests { + get { return this.creativeSaveRequestsField; } + set { this.creativeSaveRequestsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeUploadFileCount fileCount { + get { return this.fileCountField; } + set { this.fileCountField = value; } + } + + public int status { + get { return this.statusField; } + set { this.statusField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeUploadFile[] uploadedFiles { + get { return this.uploadedFilesField; } + set { this.uploadedFilesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeSaveRequest { + private long creativeIdField; + + private string errorMessageField; + + private FlashFile flashFileField; + + private ImageFile imageFileField; + + public long creativeId { + get { return this.creativeIdField; } + set { this.creativeIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public FlashFile flashFile { + get { return this.flashFileField; } + set { this.flashFileField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public ImageFile imageFile { + get { return this.imageFileField; } + set { this.imageFileField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class FlashFile : CreativeUploadFileBase { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(ImageFile))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(FlashFile))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public abstract partial class CreativeUploadFileBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeType : Base { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeUploadFile))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeUploadFileSummary : Base { + private string sourcePathField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string sourcePath { + get { return this.sourcePathField; } + set { this.sourcePathField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeUploadFile : CreativeUploadFileSummary { + private Dimensions dimensionsField; + + private string errorMessageField; + + private long fileLengthField; + + private bool flashFileField; + + private CreativeUploadFileSummary[] matchedFilesField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Dimensions dimensions { + get { return this.dimensionsField; } + set { this.dimensionsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + + public long fileLength { + get { return this.fileLengthField; } + set { this.fileLengthField = value; } + } + + public bool flashFile { + get { return this.flashFileField; } + set { this.flashFileField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeUploadFileSummary[] matchedFiles { + get { return this.matchedFilesField; } + set { this.matchedFilesField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class Dimensions { + private int heightField; + + private int widthField; + + public int height { + get { return this.heightField; } + set { this.heightField = value; } + } + + public int width { + get { return this.widthField; } + set { this.widthField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaStandardEvent : Base { + private long metEventIdField; + + public long metEventId { + get { return this.metEventIdField; } + set { this.metEventIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class InStreamMediaFile : Base { + private double bitrateField; + + private float fileSizeField; + + private int heightField; + + private string mimeTypeField; + + private bool pickedToServeField; + + private int widthField; + + public double bitrate { + get { return this.bitrateField; } + set { this.bitrateField = value; } + } + + public float fileSize { + get { return this.fileSizeField; } + set { this.fileSizeField = value; } + } + + public int height { + get { return this.heightField; } + set { this.heightField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string mimeType { + get { return this.mimeTypeField; } + set { this.mimeTypeField = value; } + } + + public bool pickedToServe { + get { return this.pickedToServeField; } + set { this.pickedToServeField = value; } + } + + public int width { + get { return this.widthField; } + set { this.widthField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaTimerEvent))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaExitEvent))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaCounterEvent))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaEventBase : Base { + private string descriptionField; + + private long metEventIdField; + + private string modeField; + + private long parentAssetIdField; + + private string typeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public long metEventId { + get { return this.metEventIdField; } + set { this.metEventIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string mode { + get { return this.modeField; } + set { this.modeField = value; } + } + + public long parentAssetId { + get { return this.parentAssetIdField; } + set { this.parentAssetIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string type { + get { return this.typeField; } + set { this.typeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaTimerEvent : RichMediaEventBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaExitEvent : RichMediaEventBase { + private RichMediaExitWindowProperties exitWindowPropertiesField; + + private string targetField; + + private string urlField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaExitWindowProperties exitWindowProperties { + get { return this.exitWindowPropertiesField; } + set { this.exitWindowPropertiesField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string target { + get { return this.targetField; } + set { this.targetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaExitWindowProperties { + private int heightField; + + private int leftField; + + private bool locationBarField; + + private bool menuBarField; + + private bool resizableField; + + private bool scrollBarsField; + + private bool statusBarField; + + private bool toolBarField; + + private int topField; + + private int widthField; + + public int height { + get { return this.heightField; } + set { this.heightField = value; } + } + + public int left { + get { return this.leftField; } + set { this.leftField = value; } + } + + public bool locationBar { + get { return this.locationBarField; } + set { this.locationBarField = value; } + } + + public bool menuBar { + get { return this.menuBarField; } + set { this.menuBarField = value; } + } + + public bool resizable { + get { return this.resizableField; } + set { this.resizableField = value; } + } + + public bool scrollBars { + get { return this.scrollBarsField; } + set { this.scrollBarsField = value; } + } + + public bool statusBar { + get { return this.statusBarField; } + set { this.statusBarField = value; } + } + + public bool toolBar { + get { return this.toolBarField; } + set { this.toolBarField = value; } + } + + public int top { + get { return this.topField; } + set { this.topField = value; } + } + + public int width { + get { return this.widthField; } + set { this.widthField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaCounterEvent : RichMediaEventBase { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(TrackingTextCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(ImageCreativeBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(TrackingImageCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(ImageCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RedirectCreativeBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(InterstitialInternalRedirectCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(InternalRedirectCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RedirectCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(HTMLCreativeBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(TrackingHTMLCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(MobileDisplayCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(HTMLInterstitialCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(FlashInpageCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(HTMLCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(InStreamVideoCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaCreativeBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaMobileInAppCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaMultiFloatingCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFlashInFlashCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaInPageWithFloatingCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaImageWithOverlayCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaExpandingCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFloatingCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFloatingWithReminderCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaInPageWithOverlayCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaOverlayCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaImageWithFloatingCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaInPageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public abstract partial class CreativeBase : Base { + private bool activeField; + + private long advertiserIdField; + + private bool archivedField; + + private CreativeFieldAssignment[] creativeFieldAssignmentsField; + + private System.DateTime? modifiedDateField; + + private long renderingIdField; + + private long sizeIdField; + + private long typeIdField; + + private int versionField; + + public bool active { + get { return this.activeField; } + set { this.activeField = value; } + } + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + public bool archived { + get { return this.archivedField; } + set { this.archivedField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeFieldAssignment[] creativeFieldAssignments { + get { return this.creativeFieldAssignmentsField; } + set { this.creativeFieldAssignmentsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? modifiedDate { + get { return this.modifiedDateField; } + set { this.modifiedDateField = value; } + } + + public long renderingId { + get { return this.renderingIdField; } + set { this.renderingIdField = value; } + } + + public long sizeId { + get { return this.sizeIdField; } + set { this.sizeIdField = value; } + } + + public long typeId { + get { return this.typeIdField; } + set { this.typeIdField = value; } + } + + public int version { + get { return this.versionField; } + set { this.versionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeFieldAssignment { + private long creativeFieldIdField; + + private long creativeFieldValueIdField; + + public long creativeFieldId { + get { return this.creativeFieldIdField; } + set { this.creativeFieldIdField = value; } + } + + public long creativeFieldValueId { + get { return this.creativeFieldValueIdField; } + set { this.creativeFieldValueIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class TrackingTextCreative : CreativeBase { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(TrackingImageCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(ImageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public abstract partial class ImageCreativeBase : CreativeBase { + private string alternateTextField; + + private string assetFilenameField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string alternateText { + get { return this.alternateTextField; } + set { this.alternateTextField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string assetFilename { + get { return this.assetFilenameField; } + set { this.assetFilenameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class TrackingImageCreative : ImageCreativeBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ImageCreative : ImageCreativeBase { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(InterstitialInternalRedirectCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(InternalRedirectCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RedirectCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public abstract partial class RedirectCreativeBase : CreativeBase { + private string redirectUrlField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string redirectUrl { + get { return this.redirectUrlField; } + set { this.redirectUrlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class InterstitialInternalRedirectCreative : RedirectCreativeBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class InternalRedirectCreative : RedirectCreativeBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RedirectCreative : RedirectCreativeBase { + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(TrackingHTMLCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(MobileDisplayCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(HTMLInterstitialCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(FlashInpageCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(HTMLCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public abstract partial class HTMLCreativeBase : CreativeBase { + private string hTMLCodeField; + + private HTMLCreativeAsset[] creativeAssetsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string HTMLCode { + get { return this.hTMLCodeField; } + set { this.hTMLCodeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public HTMLCreativeAsset[] creativeAssets { + get { return this.creativeAssetsField; } + set { this.creativeAssetsField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(MobileDisplayCreativeAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(HTMLCreativeFlashAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class HTMLCreativeAsset { + private string assetFilenameField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string assetFilename { + get { return this.assetFilenameField; } + set { this.assetFilenameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class MobileDisplayCreativeAsset : HTMLCreativeAsset { + private Dimensions dimesionsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Dimensions dimesions { + get { return this.dimesionsField; } + set { this.dimesionsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class HTMLCreativeFlashAsset : HTMLCreativeAsset { + private FlashClickTag[] clickTagsField; + + private int flashVersionField; + + private Dimensions frameSizeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public FlashClickTag[] clickTags { + get { return this.clickTagsField; } + set { this.clickTagsField = value; } + } + + public int flashVersion { + get { return this.flashVersionField; } + set { this.flashVersionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Dimensions frameSize { + get { return this.frameSizeField; } + set { this.frameSizeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class FlashClickTag { + private string nameField; + + private string valueField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class TrackingHTMLCreative : HTMLCreativeBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class MobileDisplayCreative : HTMLCreativeBase { + private string thirdPartyClickTrackingUrlField; + + private string thirdPartyImpressionTrackingUrlField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string thirdPartyClickTrackingUrl { + get { return this.thirdPartyClickTrackingUrlField; } + set { this.thirdPartyClickTrackingUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string thirdPartyImpressionTrackingUrl { + get { return this.thirdPartyImpressionTrackingUrlField; } + set { this.thirdPartyImpressionTrackingUrlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class HTMLInterstitialCreative : HTMLCreativeBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class FlashInpageCreative : HTMLCreativeBase { + private FSCommand fSCommandField; + + private HTMLCreativeFlashAsset[] additionalFlashAssetsField; + + private HTMLCreativeAsset[] additionalImageAssetsField; + + private bool allowScriptAccessField; + + private string backgroundColorField; + + private string backupImageAlternateTextField; + + private HTMLCreativeAsset backupImageAssetField; + + private string backupImageClickThroughUrlField; + + private TargetWindow backupImageTargetWindowField; + + private FlashClickTag[] clickTagsField; + + private bool codeLockedField; + + private HTMLCreativeFlashAsset parentFlashAssetField; + + private string surveyUrlField; + + private string wmodeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public FSCommand FSCommand { + get { return this.fSCommandField; } + set { this.fSCommandField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public HTMLCreativeFlashAsset[] additionalFlashAssets { + get { return this.additionalFlashAssetsField; } + set { this.additionalFlashAssetsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public HTMLCreativeAsset[] additionalImageAssets { + get { return this.additionalImageAssetsField; } + set { this.additionalImageAssetsField = value; } + } + + public bool allowScriptAccess { + get { return this.allowScriptAccessField; } + set { this.allowScriptAccessField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string backgroundColor { + get { return this.backgroundColorField; } + set { this.backgroundColorField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string backupImageAlternateText { + get { return this.backupImageAlternateTextField; } + set { this.backupImageAlternateTextField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public HTMLCreativeAsset backupImageAsset { + get { return this.backupImageAssetField; } + set { this.backupImageAssetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string backupImageClickThroughUrl { + get { return this.backupImageClickThroughUrlField; } + set { this.backupImageClickThroughUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public TargetWindow backupImageTargetWindow { + get { return this.backupImageTargetWindowField; } + set { this.backupImageTargetWindowField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public FlashClickTag[] clickTags { + get { return this.clickTagsField; } + set { this.clickTagsField = value; } + } + + public bool codeLocked { + get { return this.codeLockedField; } + set { this.codeLockedField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public HTMLCreativeFlashAsset parentFlashAsset { + get { return this.parentFlashAssetField; } + set { this.parentFlashAssetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string surveyUrl { + get { return this.surveyUrlField; } + set { this.surveyUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string wmode { + get { return this.wmodeField; } + set { this.wmodeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class FSCommand { + private int leftField; + + private string optionField; + + private int topField; + + private Dimensions windowDimensionsField; + + public int left { + get { return this.leftField; } + set { this.leftField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string option { + get { return this.optionField; } + set { this.optionField = value; } + } + + public int top { + get { return this.topField; } + set { this.topField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Dimensions windowDimensions { + get { return this.windowDimensionsField; } + set { this.windowDimensionsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class TargetWindow { + private string optionField; + + private string otherValueField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string option { + get { return this.optionField; } + set { this.optionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string otherValue { + get { return this.otherValueField; } + set { this.otherValueField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class HTMLCreative : HTMLCreativeBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class InStreamVideoCreative : CreativeBase { + private string adIdField; + + private string clickThroughUrlField; + + private InStreamCompanionAd[] companionAdsField; + + private System.DateTime? createdDateField; + + private string descriptionField; + + private InStreamMediaFile[] mediaFilesField; + + private InStreamNonLinearAd[] nonLinearAdsField; + + private bool skippableAdField; + + private string surveyUrlField; + + private InStreamThirdPartyTrackingEvents thirdPartyTrackingEventsField; + + private float videoDurationField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string adId { + get { return this.adIdField; } + set { this.adIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string clickThroughUrl { + get { return this.clickThroughUrlField; } + set { this.clickThroughUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public InStreamCompanionAd[] companionAds { + get { return this.companionAdsField; } + set { this.companionAdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? createdDate { + get { return this.createdDateField; } + set { this.createdDateField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public InStreamMediaFile[] mediaFiles { + get { return this.mediaFilesField; } + set { this.mediaFilesField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public InStreamNonLinearAd[] nonLinearAds { + get { return this.nonLinearAdsField; } + set { this.nonLinearAdsField = value; } + } + + public bool skippableAd { + get { return this.skippableAdField; } + set { this.skippableAdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string surveyUrl { + get { return this.surveyUrlField; } + set { this.surveyUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public InStreamThirdPartyTrackingEvents thirdPartyTrackingEvents { + get { return this.thirdPartyTrackingEventsField; } + set { this.thirdPartyTrackingEventsField = value; } + } + + public float videoDuration { + get { return this.videoDurationField; } + set { this.videoDurationField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class InStreamCompanionAd { + private string adParametersField; + + private string altTextField; + + private string clickThroughUrlField; + + private int expandedHeightField; + + private int expandedWidthField; + + private string fileNameField; + + private int heightField; + + private long idField; + + private string urlField; + + private int widthField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string adParameters { + get { return this.adParametersField; } + set { this.adParametersField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string clickThroughUrl { + get { return this.clickThroughUrlField; } + set { this.clickThroughUrlField = value; } + } + + public int expandedHeight { + get { return this.expandedHeightField; } + set { this.expandedHeightField = value; } + } + + public int expandedWidth { + get { return this.expandedWidthField; } + set { this.expandedWidthField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public int height { + get { return this.heightField; } + set { this.heightField = value; } + } + + public long id { + get { return this.idField; } + set { this.idField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + + public int width { + get { return this.widthField; } + set { this.widthField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class InStreamNonLinearAd { + private string adParametersField; + + private string clickThroughUrlField; + + private int expandedHeightField; + + private int expandedWidthField; + + private string fileNameField; + + private int heightField; + + private long idField; + + private bool maintainAspectRatioField; + + private bool scalableField; + + private string urlField; + + private int widthField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string adParameters { + get { return this.adParametersField; } + set { this.adParametersField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string clickThroughUrl { + get { return this.clickThroughUrlField; } + set { this.clickThroughUrlField = value; } + } + + public int expandedHeight { + get { return this.expandedHeightField; } + set { this.expandedHeightField = value; } + } + + public int expandedWidth { + get { return this.expandedWidthField; } + set { this.expandedWidthField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public int height { + get { return this.heightField; } + set { this.heightField = value; } + } + + public long id { + get { return this.idField; } + set { this.idField = value; } + } + + public bool maintainAspectRatio { + get { return this.maintainAspectRatioField; } + set { this.maintainAspectRatioField = value; } + } + + public bool scalable { + get { return this.scalableField; } + set { this.scalableField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + + public int width { + get { return this.widthField; } + set { this.widthField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class InStreamThirdPartyTrackingEvents { + private string clickTrackingUrlField; + + private string completeUrlField; + + private string customClickUrlField; + + private string firstQuartileUrlField; + + private string fullScreenUrlField; + + private string impressionUrlField; + + private string midPointUrlField; + + private string muteUrlField; + + private string pauseUrlField; + + private string replayUrlField; + + private string startUrlField; + + private string stopUrlField; + + private string thirdQuartileUrlField; + + private string videoSkipUrlField; + + private string videoViewUrlField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string clickTrackingUrl { + get { return this.clickTrackingUrlField; } + set { this.clickTrackingUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string completeUrl { + get { return this.completeUrlField; } + set { this.completeUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string customClickUrl { + get { return this.customClickUrlField; } + set { this.customClickUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string firstQuartileUrl { + get { return this.firstQuartileUrlField; } + set { this.firstQuartileUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string fullScreenUrl { + get { return this.fullScreenUrlField; } + set { this.fullScreenUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string impressionUrl { + get { return this.impressionUrlField; } + set { this.impressionUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string midPointUrl { + get { return this.midPointUrlField; } + set { this.midPointUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string muteUrl { + get { return this.muteUrlField; } + set { this.muteUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string pauseUrl { + get { return this.pauseUrlField; } + set { this.pauseUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string replayUrl { + get { return this.replayUrlField; } + set { this.replayUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string startUrl { + get { return this.startUrlField; } + set { this.startUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string stopUrl { + get { return this.stopUrlField; } + set { this.stopUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string thirdQuartileUrl { + get { return this.thirdQuartileUrlField; } + set { this.thirdQuartileUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string videoSkipUrl { + get { return this.videoSkipUrlField; } + set { this.videoSkipUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string videoViewUrl { + get { return this.videoViewUrlField; } + set { this.videoViewUrlField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaMobileInAppCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaMultiFloatingCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFlashInFlashCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaInPageWithFloatingCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaImageWithOverlayCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaExpandingCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFloatingCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFloatingWithReminderCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaInPageWithOverlayCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaOverlayCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaImageWithFloatingCreative))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaInPageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public abstract partial class RichMediaCreativeBase : CreativeBase { + private string actionScriptVersionField; + + private string adRequestKeysField; + + private string authoringApplicationField; + + private RichMediaAsset[] childAssetsField; + + private string commentsField; + + private RichMediaCounterEvent[] counterEventsField; + + private System.DateTime? createdDateField; + + private string[] creativeAttributesField; + + private string customKeyValuesField; + + private RichMediaExitEvent[] exitEventsField; + + private bool flashInFlashField; + + private bool interstitialField; + + private bool lidarEnabledField; + + private string metaDataField; + + private string modeField; + + private int placementHeightField; + + private int placementWidthField; + + private string requiredFlashPlayerVersionField; + + private string surveyUrlField; + + private string thirdPartyBackupImageImpressionUrlField; + + private string thirdPartyClickUrlField; + + private string thirdPartyFlashImpressionUrlField; + + private string thirdPartyImpressionUrlField; + + private RichMediaTimerEvent[] timerEventField; + + private int totalFileSizeField; + + private string typeField; + + private long videoLengthField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string actionScriptVersion { + get { return this.actionScriptVersionField; } + set { this.actionScriptVersionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string adRequestKeys { + get { return this.adRequestKeysField; } + set { this.adRequestKeysField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string authoringApplication { + get { return this.authoringApplicationField; } + set { this.authoringApplicationField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaAsset[] childAssets { + get { return this.childAssetsField; } + set { this.childAssetsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string comments { + get { return this.commentsField; } + set { this.commentsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaCounterEvent[] counterEvents { + get { return this.counterEventsField; } + set { this.counterEventsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public System.DateTime? createdDate { + get { return this.createdDateField; } + set { this.createdDateField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string[] creativeAttributes { + get { return this.creativeAttributesField; } + set { this.creativeAttributesField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string customKeyValues { + get { return this.customKeyValuesField; } + set { this.customKeyValuesField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaExitEvent[] exitEvents { + get { return this.exitEventsField; } + set { this.exitEventsField = value; } + } + + public bool flashInFlash { + get { return this.flashInFlashField; } + set { this.flashInFlashField = value; } + } + + public bool interstitial { + get { return this.interstitialField; } + set { this.interstitialField = value; } + } + + public bool lidarEnabled { + get { return this.lidarEnabledField; } + set { this.lidarEnabledField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string metaData { + get { return this.metaDataField; } + set { this.metaDataField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string mode { + get { return this.modeField; } + set { this.modeField = value; } + } + + public int placementHeight { + get { return this.placementHeightField; } + set { this.placementHeightField = value; } + } + + public int placementWidth { + get { return this.placementWidthField; } + set { this.placementWidthField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string requiredFlashPlayerVersion { + get { return this.requiredFlashPlayerVersionField; } + set { this.requiredFlashPlayerVersionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string surveyUrl { + get { return this.surveyUrlField; } + set { this.surveyUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string thirdPartyBackupImageImpressionUrl { + get { return this.thirdPartyBackupImageImpressionUrlField; } + set { this.thirdPartyBackupImageImpressionUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string thirdPartyClickUrl { + get { return this.thirdPartyClickUrlField; } + set { this.thirdPartyClickUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string thirdPartyFlashImpressionUrl { + get { return this.thirdPartyFlashImpressionUrlField; } + set { this.thirdPartyFlashImpressionUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string thirdPartyImpressionUrl { + get { return this.thirdPartyImpressionUrlField; } + set { this.thirdPartyImpressionUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaTimerEvent[] timerEvent { + get { return this.timerEventField; } + set { this.timerEventField = value; } + } + + public int totalFileSize { + get { return this.totalFileSizeField; } + set { this.totalFileSizeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string type { + get { return this.typeField; } + set { this.typeField = value; } + } + + public long videoLength { + get { return this.videoLengthField; } + set { this.videoLengthField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaVideoAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaHtmlAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaMobileInAppAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaExpandingHtmlAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFloatingHtmlAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaInPageHtmlAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaImageAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFlashAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaExpandingAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaReminderAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaOverlayAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFloatingAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaMultiFloatingAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaInPageAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaAsset { + private string fileNameField; + + private int fileSizeField; + + private long idField; + + private long parentAssetIdField; + + private string typeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public int fileSize { + get { return this.fileSizeField; } + set { this.fileSizeField = value; } + } + + public long id { + get { return this.idField; } + set { this.idField = value; } + } + + public long parentAssetId { + get { return this.parentAssetIdField; } + set { this.parentAssetIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string type { + get { return this.typeField; } + set { this.typeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaVideoAsset : RichMediaAsset { + private string progressiveUrlField; + + private string streamingUrlField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string progressiveUrl { + get { return this.progressiveUrlField; } + set { this.progressiveUrlField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string streamingUrl { + get { return this.streamingUrlField; } + set { this.streamingUrlField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaMobileInAppAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaExpandingHtmlAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFloatingHtmlAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaInPageHtmlAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaHtmlAsset : RichMediaAsset { + private string creativeFormatField; + + private int heightField; + + private int widthField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string creativeFormat { + get { return this.creativeFormatField; } + set { this.creativeFormatField = value; } + } + + public int height { + get { return this.heightField; } + set { this.heightField = value; } + } + + public int width { + get { return this.widthField; } + set { this.widthField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaMobileInAppAsset : RichMediaHtmlAsset { + private RichMediaImageAsset alternateImageAssetField; + + private bool transparentField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaImageAsset alternateImageAsset { + get { return this.alternateImageAssetField; } + set { this.alternateImageAssetField = value; } + } + + public bool transparent { + get { return this.transparentField; } + set { this.transparentField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaImageAsset : RichMediaAsset { + private string altTextField; + + private bool backupImageField; + + private RichMediaExitEvent exitEventField; + + private int heightField; + + private int widthField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + public bool backupImage { + get { return this.backupImageField; } + set { this.backupImageField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaExitEvent exitEvent { + get { return this.exitEventField; } + set { this.exitEventField = value; } + } + + public int height { + get { return this.heightField; } + set { this.heightField = value; } + } + + public int width { + get { return this.widthField; } + set { this.widthField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaExpandingHtmlAsset : RichMediaHtmlAsset { + private string zIndexField; + + private RichMediaImageAsset alternateImageField; + + private int bottomOffsetField; + + private int expandedHeightField; + + private int expandedWidthField; + + private bool hideDropDownsField; + + private bool hideFlashObjectsField; + + private int leftOffsetField; + + private int rightOffsetField; + + private int topOffsetField; + + private bool transparentField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string ZIndex { + get { return this.zIndexField; } + set { this.zIndexField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaImageAsset alternateImage { + get { return this.alternateImageField; } + set { this.alternateImageField = value; } + } + + public int bottomOffset { + get { return this.bottomOffsetField; } + set { this.bottomOffsetField = value; } + } + + public int expandedHeight { + get { return this.expandedHeightField; } + set { this.expandedHeightField = value; } + } + + public int expandedWidth { + get { return this.expandedWidthField; } + set { this.expandedWidthField = value; } + } + + public bool hideDropDowns { + get { return this.hideDropDownsField; } + set { this.hideDropDownsField = value; } + } + + public bool hideFlashObjects { + get { return this.hideFlashObjectsField; } + set { this.hideFlashObjectsField = value; } + } + + public int leftOffset { + get { return this.leftOffsetField; } + set { this.leftOffsetField = value; } + } + + public int rightOffset { + get { return this.rightOffsetField; } + set { this.rightOffsetField = value; } + } + + public int topOffset { + get { return this.topOffsetField; } + set { this.topOffsetField = value; } + } + + public bool transparent { + get { return this.transparentField; } + set { this.transparentField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaFloatingHtmlAsset : RichMediaHtmlAsset { + private int durationField; + + private bool hideDropDownsField; + + private bool hideFlashObjectsField; + + private int leftField; + + private bool leftLockPositionField; + + private string leftUnitField; + + private int startTimeField; + + private int topField; + + private bool topLockPositionField; + + private string topUnitField; + + private bool transparentField; + + private string zIndexField; + + public int duration { + get { return this.durationField; } + set { this.durationField = value; } + } + + public bool hideDropDowns { + get { return this.hideDropDownsField; } + set { this.hideDropDownsField = value; } + } + + public bool hideFlashObjects { + get { return this.hideFlashObjectsField; } + set { this.hideFlashObjectsField = value; } + } + + public int left { + get { return this.leftField; } + set { this.leftField = value; } + } + + public bool leftLockPosition { + get { return this.leftLockPositionField; } + set { this.leftLockPositionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string leftUnit { + get { return this.leftUnitField; } + set { this.leftUnitField = value; } + } + + public int startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public int top { + get { return this.topField; } + set { this.topField = value; } + } + + public bool topLockPosition { + get { return this.topLockPositionField; } + set { this.topLockPositionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string topUnit { + get { return this.topUnitField; } + set { this.topUnitField = value; } + } + + public bool transparent { + get { return this.transparentField; } + set { this.transparentField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string zIndex { + get { return this.zIndexField; } + set { this.zIndexField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaInPageHtmlAsset : RichMediaHtmlAsset { + private RichMediaImageAsset alternateImageAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaImageAsset alternateImageAsset { + get { return this.alternateImageAssetField; } + set { this.alternateImageAssetField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaExpandingAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaReminderAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaOverlayAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaFloatingAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaMultiFloatingAsset))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaInPageAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaFlashAsset : RichMediaAsset { + private string creativeFormatField; + + private int heightField; + + private int widthField; + + private string wmodeField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string creativeFormat { + get { return this.creativeFormatField; } + set { this.creativeFormatField = value; } + } + + public int height { + get { return this.heightField; } + set { this.heightField = value; } + } + + public int width { + get { return this.widthField; } + set { this.widthField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string wmode { + get { return this.wmodeField; } + set { this.wmodeField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaExpandingAsset : RichMediaFlashAsset { + private string zIndexField; + + private RichMediaImageAsset alternateImageField; + + private int bottomOffsetField; + + private int expandedHeightField; + + private int expandedWidthField; + + private bool hideDropDownsField; + + private bool hideFlashObjectsField; + + private bool hideIframesField; + + private bool hideJavaAppletsField; + + private bool hideScrollBarsField; + + private int leftOffsetField; + + private bool multidirectionalField; + + private bool pushDownField; + + private double pushdownAnimationTimeField; + + private int rightOffsetField; + + private int topOffsetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string ZIndex { + get { return this.zIndexField; } + set { this.zIndexField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaImageAsset alternateImage { + get { return this.alternateImageField; } + set { this.alternateImageField = value; } + } + + public int bottomOffset { + get { return this.bottomOffsetField; } + set { this.bottomOffsetField = value; } + } + + public int expandedHeight { + get { return this.expandedHeightField; } + set { this.expandedHeightField = value; } + } + + public int expandedWidth { + get { return this.expandedWidthField; } + set { this.expandedWidthField = value; } + } + + public bool hideDropDowns { + get { return this.hideDropDownsField; } + set { this.hideDropDownsField = value; } + } + + public bool hideFlashObjects { + get { return this.hideFlashObjectsField; } + set { this.hideFlashObjectsField = value; } + } + + public bool hideIframes { + get { return this.hideIframesField; } + set { this.hideIframesField = value; } + } + + public bool hideJavaApplets { + get { return this.hideJavaAppletsField; } + set { this.hideJavaAppletsField = value; } + } + + public bool hideScrollBars { + get { return this.hideScrollBarsField; } + set { this.hideScrollBarsField = value; } + } + + public int leftOffset { + get { return this.leftOffsetField; } + set { this.leftOffsetField = value; } + } + + public bool multidirectional { + get { return this.multidirectionalField; } + set { this.multidirectionalField = value; } + } + + public bool pushDown { + get { return this.pushDownField; } + set { this.pushDownField = value; } + } + + public double pushdownAnimationTime { + get { return this.pushdownAnimationTimeField; } + set { this.pushdownAnimationTimeField = value; } + } + + public int rightOffset { + get { return this.rightOffsetField; } + set { this.rightOffsetField = value; } + } + + public int topOffset { + get { return this.topOffsetField; } + set { this.topOffsetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaReminderAsset : RichMediaFlashAsset { + private string zIndexField; + + private int durationField; + + private int leftField; + + private bool leftLockPositionField; + + private string leftUnitField; + + private int startTimeField; + + private int topField; + + private bool topLockPositionField; + + private string topUnitField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string ZIndex { + get { return this.zIndexField; } + set { this.zIndexField = value; } + } + + public int duration { + get { return this.durationField; } + set { this.durationField = value; } + } + + public int left { + get { return this.leftField; } + set { this.leftField = value; } + } + + public bool leftLockPosition { + get { return this.leftLockPositionField; } + set { this.leftLockPositionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string leftUnit { + get { return this.leftUnitField; } + set { this.leftUnitField = value; } + } + + public int startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public int top { + get { return this.topField; } + set { this.topField = value; } + } + + public bool topLockPosition { + get { return this.topLockPositionField; } + set { this.topLockPositionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string topUnit { + get { return this.topUnitField; } + set { this.topUnitField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaOverlayAsset : RichMediaFlashAsset { + private bool addressBarField; + + private int durationField; + + private int leftField; + + private string leftUnitField; + + private bool menuBarField; + + private bool overlayField; + + private int startTimeField; + + private bool statusBarField; + + private bool toolBarField; + + private int topField; + + private string topUnitField; + + private string windowTitleField; + + public bool addressBar { + get { return this.addressBarField; } + set { this.addressBarField = value; } + } + + public int duration { + get { return this.durationField; } + set { this.durationField = value; } + } + + public int left { + get { return this.leftField; } + set { this.leftField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string leftUnit { + get { return this.leftUnitField; } + set { this.leftUnitField = value; } + } + + public bool menuBar { + get { return this.menuBarField; } + set { this.menuBarField = value; } + } + + public bool overlay { + get { return this.overlayField; } + set { this.overlayField = value; } + } + + public int startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public bool statusBar { + get { return this.statusBarField; } + set { this.statusBarField = value; } + } + + public bool toolBar { + get { return this.toolBarField; } + set { this.toolBarField = value; } + } + + public int top { + get { return this.topField; } + set { this.topField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string topUnit { + get { return this.topUnitField; } + set { this.topUnitField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string windowTitle { + get { return this.windowTitleField; } + set { this.windowTitleField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(RichMediaMultiFloatingAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaFloatingAsset : RichMediaFlashAsset { + private string zIndexField; + + private int durationField; + + private bool hideDropDownsField; + + private bool hideFlashObjectsField; + + private bool hideIframesField; + + private bool hideJavaAppletsField; + + private bool hideScrollBarsField; + + private int leftField; + + private bool leftLockPositionField; + + private string leftUnitField; + + private int startTimeField; + + private int topField; + + private bool topLockPositionField; + + private string topUnitField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string ZIndex { + get { return this.zIndexField; } + set { this.zIndexField = value; } + } + + public int duration { + get { return this.durationField; } + set { this.durationField = value; } + } + + public bool hideDropDowns { + get { return this.hideDropDownsField; } + set { this.hideDropDownsField = value; } + } + + public bool hideFlashObjects { + get { return this.hideFlashObjectsField; } + set { this.hideFlashObjectsField = value; } + } + + public bool hideIframes { + get { return this.hideIframesField; } + set { this.hideIframesField = value; } + } + + public bool hideJavaApplets { + get { return this.hideJavaAppletsField; } + set { this.hideJavaAppletsField = value; } + } + + public bool hideScrollBars { + get { return this.hideScrollBarsField; } + set { this.hideScrollBarsField = value; } + } + + public int left { + get { return this.leftField; } + set { this.leftField = value; } + } + + public bool leftLockPosition { + get { return this.leftLockPositionField; } + set { this.leftLockPositionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string leftUnit { + get { return this.leftUnitField; } + set { this.leftUnitField = value; } + } + + public int startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public int top { + get { return this.topField; } + set { this.topField = value; } + } + + public bool topLockPosition { + get { return this.topLockPositionField; } + set { this.topLockPositionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string topUnit { + get { return this.topUnitField; } + set { this.topUnitField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaMultiFloatingAsset : RichMediaFloatingAsset { + private string alignmentField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string alignment { + get { return this.alignmentField; } + set { this.alignmentField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaInPageAsset : RichMediaFlashAsset { + private RichMediaImageAsset alternateImageAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaImageAsset alternateImageAsset { + get { return this.alternateImageAssetField; } + set { this.alternateImageAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaMobileInAppCreative : RichMediaCreativeBase { + private RichMediaMobileInAppAsset mobileInAppAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaMobileInAppAsset mobileInAppAsset { + get { return this.mobileInAppAssetField; } + set { this.mobileInAppAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaMultiFloatingCreative : RichMediaCreativeBase { + private RichMediaMultiFloatingAsset[] multiFloatingAssetsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaMultiFloatingAsset[] multiFloatingAssets { + get { return this.multiFloatingAssetsField; } + set { this.multiFloatingAssetsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaFlashInFlashCreative : RichMediaCreativeBase { + private string assetTypeField; + + private RichMediaFlashAsset flashAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string assetType { + get { return this.assetTypeField; } + set { this.assetTypeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaFlashAsset flashAsset { + get { return this.flashAssetField; } + set { this.flashAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaInPageWithFloatingCreative : RichMediaCreativeBase { + private RichMediaFloatingAsset floatingAssetField; + + private RichMediaInPageAsset inPageAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaFloatingAsset floatingAsset { + get { return this.floatingAssetField; } + set { this.floatingAssetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaInPageAsset inPageAsset { + get { return this.inPageAssetField; } + set { this.inPageAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaImageWithOverlayCreative : RichMediaCreativeBase { + private RichMediaImageAsset imageAssetField; + + private RichMediaOverlayAsset overlayAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaImageAsset imageAsset { + get { return this.imageAssetField; } + set { this.imageAssetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaOverlayAsset overlayAsset { + get { return this.overlayAssetField; } + set { this.overlayAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaExpandingCreative : RichMediaCreativeBase { + private RichMediaExpandingAsset expandingAssetField; + + private RichMediaExpandingHtmlAsset expandingHtmlAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaExpandingAsset expandingAsset { + get { return this.expandingAssetField; } + set { this.expandingAssetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaExpandingHtmlAsset expandingHtmlAsset { + get { return this.expandingHtmlAssetField; } + set { this.expandingHtmlAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaFloatingCreative : RichMediaCreativeBase { + private RichMediaFloatingAsset floatingAssetField; + + private RichMediaFloatingHtmlAsset floatingHtmlAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaFloatingAsset floatingAsset { + get { return this.floatingAssetField; } + set { this.floatingAssetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaFloatingHtmlAsset floatingHtmlAsset { + get { return this.floatingHtmlAssetField; } + set { this.floatingHtmlAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaFloatingWithReminderCreative : RichMediaCreativeBase { + private RichMediaFloatingAsset floatingAssetField; + + private RichMediaReminderAsset reminderAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaFloatingAsset floatingAsset { + get { return this.floatingAssetField; } + set { this.floatingAssetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaReminderAsset reminderAsset { + get { return this.reminderAssetField; } + set { this.reminderAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaInPageWithOverlayCreative : RichMediaCreativeBase { + private RichMediaInPageAsset inPageAssetField; + + private RichMediaOverlayAsset overlayAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaInPageAsset inPageAsset { + get { return this.inPageAssetField; } + set { this.inPageAssetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaOverlayAsset overlayAsset { + get { return this.overlayAssetField; } + set { this.overlayAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaOverlayCreative : RichMediaCreativeBase { + private RichMediaOverlayAsset overlayAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaOverlayAsset overlayAsset { + get { return this.overlayAssetField; } + set { this.overlayAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaImageWithFloatingCreative : RichMediaCreativeBase { + private RichMediaFloatingAsset floatingAssetField; + + private RichMediaImageAsset imageAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaFloatingAsset floatingAsset { + get { return this.floatingAssetField; } + set { this.floatingAssetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaImageAsset imageAsset { + get { return this.imageAssetField; } + set { this.imageAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaInPageCreative : RichMediaCreativeBase { + private RichMediaInPageAsset inPageAssetField; + + private RichMediaInPageHtmlAsset inPageHtmlAssetField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaInPageAsset inPageAsset { + get { return this.inPageAssetField; } + set { this.inPageAssetField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public RichMediaInPageHtmlAsset inPageHtmlAsset { + get { return this.inPageHtmlAssetField; } + set { this.inPageHtmlAssetField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class ImageFile : CreativeUploadFileBase { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeUploadFileCount { + private int flashFileCountField; + + private int imageFileCountField; + + private int otherFileCountField; + + public int flashFileCount { + get { return this.flashFileCountField; } + set { this.flashFileCountField = value; } + } + + public int imageFileCount { + get { return this.imageFileCountField; } + set { this.imageFileCountField = value; } + } + + public int otherFileCount { + get { return this.otherFileCountField; } + set { this.otherFileCountField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeUploadSessionRequest { + private long advertiserIdField; + + private long campaignIdField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class InStreamAssetUploadRequest { + private bool companionField; + + private long creativeIdField; + + private CreativeAsset inStreamAssetField; + + private bool mediaFileField; + + private bool nonLinearField; + + public bool companion { + get { return this.companionField; } + set { this.companionField = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { this.creativeIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeAsset inStreamAsset { + get { return this.inStreamAssetField; } + set { this.inStreamAssetField = value; } + } + + public bool mediaFile { + get { return this.mediaFileField; } + set { this.mediaFileField = value; } + } + + public bool nonLinear { + get { return this.nonLinearField; } + set { this.nonLinearField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class RichMediaAssetUploadRequest { + private string assetFileNameField; + + private long creativeIdField; + + private byte[] fileDataField; + + private int parentAssetIdField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string assetFileName { + get { return this.assetFileNameField; } + set { this.assetFileNameField = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { this.creativeIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(DataType = "base64Binary", IsNullable = true)] + public byte[] fileData { + get { return this.fileDataField; } + set { this.fileDataField = value; } + } + + public int parentAssetId { + get { return this.parentAssetIdField; } + set { this.parentAssetIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeRenderingResult { + private long creativeIdField; + + private long renderingIdField; + + private long renderingVersionField; + + public long creativeId { + get { return this.creativeIdField; } + set { this.creativeIdField = value; } + } + + public long renderingId { + get { return this.renderingIdField; } + set { this.renderingIdField = value; } + } + + public long renderingVersion { + get { return this.renderingVersionField; } + set { this.renderingVersionField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeRenderingRequest { + private long[] creativeIdsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] creativeIds { + get { return this.creativeIdsField; } + set { this.creativeIdsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeAssetSaveResult { + private FlashClickTag[] clickTagsField; + + private int flashVersionField; + + private Dimensions frameSizeField; + + private string savedFilenameField; + + private Size sizeField; + + private string urlField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public FlashClickTag[] clickTags { + get { return this.clickTagsField; } + set { this.clickTagsField = value; } + } + + public int flashVersion { + get { return this.flashVersionField; } + set { this.flashVersionField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Dimensions frameSize { + get { return this.frameSizeField; } + set { this.frameSizeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string savedFilename { + get { return this.savedFilenameField; } + set { this.savedFilenameField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeCopyRequest { + private long advertiserIdField; + + private long campaignIdField; + + private long copyModeField; + + private long creativeIdField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + public long copyMode { + get { return this.copyModeField; } + set { this.copyModeField = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { this.creativeIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeCopyResult : SaveResult { + private CreativeCopyRequest copyRequestField; + + private string errorMessageField; + + private string nameField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeCopyRequest copyRequest { + get { return this.copyRequestField; } + set { this.copyRequestField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeCampaignAssociationResult : SaveResult { + private long campaignIdField; + + private string errorMessageField; + + public long campaignId { + get { return this.campaignIdField; } + set { this.campaignIdField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public string errorMessage { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeSaveResult : SaveResult { + private long adIdField; + + public long adId { + get { return this.adIdField; } + set { this.adIdField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeRecordSet : PagedRecordSet { + private CreativeBase[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeBase[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "creativefieldSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(PagedRecordSet))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class CreativeFieldRemoteService : DfaSoapClient { + public CreativeFieldRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.20/api/dfa-api/creativefield"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("saveCreativeFieldReturn")] + public CreativeFieldSaveResult saveCreativeField(CreativeField creativeField) { + object[] results = this.Invoke("saveCreativeField", new object[] {creativeField}); + return ((CreativeFieldSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public void deleteCreativeField(long creativeFieldId) { + this.Invoke("deleteCreativeField", new object[] {creativeFieldId}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativeFieldsReturn")] + public CreativeFieldRecordSet getCreativeFields(CreativeFieldSearchCriteria creativeFieldSearchCriteria) { + object[] results = this.Invoke("getCreativeFields", new object[] {creativeFieldSearchCriteria}); + return ((CreativeFieldRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativeFieldReturn")] + public CreativeField getCreativeField(long creativeFieldId) { + object[] results = this.Invoke("getCreativeField", new object[] {creativeFieldId}); + return ((CreativeField) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativeFieldValuesReturn")] + public CreativeFieldValueRecordSet getCreativeFieldValues(CreativeFieldValueSearchCriteria creativeFieldValueSearchCriteria) { + object[] results = this.Invoke("getCreativeFieldValues", new object[] {creativeFieldValueSearchCriteria}); + return ((CreativeFieldValueRecordSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativeFieldValueReturn")] + public CreativeFieldValue getCreativeFieldValue(long creativeFieldValueId) { + object[] results = this.Invoke("getCreativeFieldValue", new object[] {creativeFieldValueId}); + return ((CreativeFieldValue) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("saveCreativeFieldValueReturn")] + public CreativeFieldValueSaveResult saveCreativeFieldValue(CreativeFieldValue creativeFieldValue) { + object[] results = this.Invoke("saveCreativeFieldValue", new object[] {creativeFieldValue}); + return ((CreativeFieldValueSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public void deleteCreativeFieldValue(long creativeFieldValueId) { + this.Invoke("deleteCreativeFieldValue", new object[] {creativeFieldValueId}); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeField : CreativeFieldBase { + private long advertiserIdField; + + private long slotNumberField; + + private long totalNumberOfValuesField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + public long slotNumber { + get { return this.slotNumberField; } + set { this.slotNumberField = value; } + } + + public long totalNumberOfValues { + get { return this.totalNumberOfValuesField; } + set { this.totalNumberOfValuesField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeField))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeFieldBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeFieldValueRecordSet : PagedRecordSet { + private CreativeFieldValue[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeFieldValue[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeFieldValue : CreativeFieldValueBase { + private long creativeFieldIdField; + + public long creativeFieldId { + get { return this.creativeFieldIdField; } + set { this.creativeFieldIdField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeFieldValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeFieldValueBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeFieldRecordSet : PagedRecordSet { + private CreativeField[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeField[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeFieldValueSearchCriteria : PageableSearchCriteriaBase { + private long[] creativeFieldIdsField; + + private SortOrder sortOrderField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] creativeFieldIds { + get { return this.creativeFieldIdsField; } + set { this.creativeFieldIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeFieldSearchCriteria : PageableSearchCriteriaBase { + private long[] advertiserIdsField; + + private SortOrder sortOrderField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] advertiserIds { + get { return this.advertiserIdsField; } + set { this.advertiserIdsField = value; } + } + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public SortOrder sortOrder { + get { return this.sortOrderField; } + set { this.sortOrderField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeFieldValueSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeFieldSaveResult : SaveResult { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "creativegroupSoapBinding", Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SearchCriteriaBase))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(SaveResult))] + [System.Xml.Serialization.SoapIncludeAttribute(typeof(Base))] + public partial class CreativeGroupRemoteService : DfaSoapClient { + public CreativeGroupRemoteService() { + this.Url = "https://advertisersapi.doubleclick.net/v1.20/api/dfa-api/creativegroup"; + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public void deleteCreativeGroup(long creativeGroupId) { + this.Invoke("deleteCreativeGroup", new object[] {creativeGroupId}); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("saveCreativeGroupReturn")] + public CreativeGroupSaveResult saveCreativeGroup(CreativeGroup creativeGroup) { + object[] results = this.Invoke("saveCreativeGroup", new object[] {creativeGroup}); + return ((CreativeGroupSaveResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativeGroupReturn")] + public CreativeGroup getCreativeGroup(long id) { + object[] results = this.Invoke("getCreativeGroup", new object[] {id}); + return ((CreativeGroup) (results[0])); + } + + [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace = "http://www.doubleclick.net/dfa-api/v1.20", ResponseNamespace = "http://www.doubleclick.net/dfa-api/v1.20")] + [return: System.Xml.Serialization.SoapElementAttribute("getCreativeGroupsReturn")] + public CreativeGroupRecordSet getCreativeGroups(CreativeGroupSearchCriteria searchCriteria) { + object[] results = this.Invoke("getCreativeGroups", new object[] {searchCriteria}); + return ((CreativeGroupRecordSet) (results[0])); + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeGroup : CreativeGroupBase { + private long advertiserIdField; + + private int groupNumberField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { this.advertiserIdField = value; } + } + + public int groupNumber { + get { return this.groupNumberField; } + set { this.groupNumberField = value; } + } + } + + [System.Xml.Serialization.SoapIncludeAttribute(typeof(CreativeGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeGroupBase : Base { + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeGroupRecordSet { + private CreativeGroup[] recordsField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public CreativeGroup[] records { + get { return this.recordsField; } + set { this.recordsField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeGroupSearchCriteria : SearchCriteriaBase { + private long[] advertiserIdsField; + + private int groupNumberField; + + [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)] + public long[] advertiserIds { + get { return this.advertiserIdsField; } + set { this.advertiserIdsField = value; } + } + + public int groupNumber { + get { return this.groupNumberField; } + set { this.groupNumberField = value; } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://www.doubleclick.net/dfa-api/v1.20")] + public partial class CreativeGroupSaveResult : SaveResult { + } +} diff --git a/src/Dfa/v1_20/DfaServiceV1_20.cs b/src/Dfa/v1_20/DfaServiceV1_20.cs new file mode 100644 index 00000000000..500bbc0fbf4 --- /dev/null +++ b/src/Dfa/v1_20/DfaServiceV1_20.cs @@ -0,0 +1,191 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Reflection; + +namespace Google.Api.Ads.Dfa.Lib { + /// + /// Lists all the services available through this library. + /// + public partial class DfaService : AdsService { + /// + /// All the services available in v1.20. + /// + public class v1_20 { + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdvertiserRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdvertiserGroupRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CampaignRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ChangeLogRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ContentCategoryRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeFieldRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeGroupRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LoginRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature NetworkRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature PlacementRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReportRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SiteRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SizeRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SpotlightRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature PlacementStrategyRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SubnetworkRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature UserRemoteService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature UserRoleRemoteService; + + /// + /// Factory type for v1.20 services. + /// + public static readonly Type factoryType = typeof(DfaServiceFactory); + + /// + /// Static constructor to initialize the service constants. + /// + static v1_20() { + AdRemoteService = DfaService.MakeServiceSignature("v1.20", "AdRemoteService"); + AdvertiserRemoteService = DfaService.MakeServiceSignature("v1.20", + "AdvertiserRemoteService"); + AdvertiserGroupRemoteService = DfaService.MakeServiceSignature("v1.20", + "AdvertiserGroupRemoteService"); + CampaignRemoteService = DfaService.MakeServiceSignature("v1.20", "CampaignRemoteService"); + ChangeLogRemoteService = DfaService.MakeServiceSignature("v1.20", "ChangeLogRemoteService"); + ContentCategoryRemoteService = DfaService.MakeServiceSignature("v1.20", + "ContentCategoryRemoteService"); + CreativeRemoteService = DfaService.MakeServiceSignature("v1.20", "CreativeRemoteService"); + CreativeFieldRemoteService = DfaService.MakeServiceSignature("v1.20", + "CreativeFieldRemoteService"); + CreativeGroupRemoteService = DfaService.MakeServiceSignature("v1.20", + "CreativeGroupRemoteService"); + LoginRemoteService = DfaService.MakeServiceSignature("v1.20", "LoginRemoteService"); + NetworkRemoteService = DfaService.MakeServiceSignature("v1.20", "NetworkRemoteService"); + PlacementRemoteService = DfaService.MakeServiceSignature("v1.20", "PlacementRemoteService"); + ReportRemoteService = DfaService.MakeServiceSignature("v1.20", "ReportRemoteService"); + SiteRemoteService = DfaService.MakeServiceSignature("v1.20", "SiteRemoteService"); + SizeRemoteService = DfaService.MakeServiceSignature("v1.20", "SizeRemoteService"); + SpotlightRemoteService = DfaService.MakeServiceSignature("v1.20", "SpotlightRemoteService"); + PlacementStrategyRemoteService = DfaService.MakeServiceSignature("v1.20", + "PlacementStrategyRemoteService"); + SubnetworkRemoteService = DfaService.MakeServiceSignature("v1.20", + "SubnetworkRemoteService"); + UserRemoteService = DfaService.MakeServiceSignature("v1.20", "UserRemoteService"); + UserRoleRemoteService = DfaService.MakeServiceSignature("v1.20", "UserRoleRemoteService"); + } + } + } +} diff --git a/src/Dfp/App.config b/src/Dfp/App.config new file mode 100644 index 00000000000..95e79456764 --- /dev/null +++ b/src/Dfp/App.config @@ -0,0 +1,190 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Dfp/Dfp.csproj b/src/Dfp/Dfp.csproj new file mode 100644 index 00000000000..687e3aad669 --- /dev/null +++ b/src/Dfp/Dfp.csproj @@ -0,0 +1,135 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB} + Library + Properties + Google.Api.Ads.Dfp + Dfp + v4.0 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AnyCPU + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + DfpErrorMessages.resx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {277404DB-A439-4450-B3A5-186294CDF245} + Common + + + + + Designer + + + + + ResXFileCodeGenerator + DfpErrorMessages.Designer.cs + Designer + + + + + \ No newline at end of file diff --git a/src/Dfp/DfpErrorMessages.Designer.cs b/src/Dfp/DfpErrorMessages.Designer.cs new file mode 100644 index 00000000000..6cb37f62627 --- /dev/null +++ b/src/Dfp/DfpErrorMessages.Designer.cs @@ -0,0 +1,135 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18063 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Google.Api.Ads.Dfp { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class DfpErrorMessages { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal DfpErrorMessages() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Google.Api.Ads.Dfp.DfpErrorMessages", typeof(DfpErrorMessages).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to ClientLogin is not supported in version {0}. Please upgrade to OAuth2.. + /// + internal static string ClientLoginNotSupported { + get { + return ResourceManager.GetString("ClientLoginNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The complete query is already set. Partial query building is not allowed.. + /// + internal static string CompleteQuerySet { + get { + return ResourceManager.GetString("CompleteQuerySet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not set AuthToken or OAuthHeader for outgoing API call. Please check if service.RequestHeader is not null.. + /// + internal static string FailedToSetAuthorizationHeader { + get { + return ResourceManager.GetString("FailedToSetAuthorizationHeader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OFFSET cannot be set if LIMIT is not set.. + /// + internal static string InvalidOffsetAndLimit { + get { + return ResourceManager.GetString("InvalidOffsetAndLimit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OAuth provider cannot be null when selecting Authorization method as "OAuth".. + /// + internal static string OAuthProviderCannotBeNull { + get { + return ResourceManager.GetString("OAuthProviderCannotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A partial query is already set. Access to the complete query is restricted.. + /// + internal static string PartialQuerySet { + get { + return ResourceManager.GetString("PartialQuerySet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid application name was not found in the request header. Please provide a valid application name by modifying the ApplicationName setting in your application's App.config / Web.config or DfpAppConfig instance.. + /// + internal static string RequireValidApplicationName { + get { + return ResourceManager.GetString("RequireValidApplicationName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Signature should be a {0} instance.. + /// + internal static string SignatureIsOfWrongType { + get { + return ResourceManager.GetString("SignatureIsOfWrongType", resourceCulture); + } + } + } +} diff --git a/src/Dfp/DfpErrorMessages.resx b/src/Dfp/DfpErrorMessages.resx new file mode 100644 index 00000000000..68be07688e3 --- /dev/null +++ b/src/Dfp/DfpErrorMessages.resx @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ClientLogin is not supported in version {0}. Please upgrade to OAuth2. + Used when attempting to use ClientLogin in an unsupported version + + + The complete query is already set. Partial query building is not allowed. + Used when StatementBuilder has a complete query and a partial construction function is used + + + Could not set AuthToken or OAuthHeader for outgoing API call. Please check if service.RequestHeader is not null. + Used by DfpSoapClient.MakeApiCall when setting authorization headers. + + + OFFSET cannot be set if LIMIT is not set. + Used when validating a Satement query + + + OAuth provider cannot be null when selecting Authorization method as "OAuth". + Used by DfpSoapClient.MakeApiCall when setting authorization headers. + + + A partial query is already set. Access to the complete query is restricted. + Used when StatementBuilder has a partial query and the full query is set + + + A valid application name was not found in the request header. Please provide a valid application name by modifying the ApplicationName setting in your application's App.config / Web.config or DfpAppConfig instance. + Used to validate whether the user is providing a valid key for ApplicationName field. It cannot be empty, or the default value (INSERT_YOUR_APPLICATION_NAME_HERE) + + + Signature should be a {0} instance. + Used for ArgumentException by DfpServiceFactory.CreateService if the signature is not of desired type. + + \ No newline at end of file diff --git a/src/Dfp/Headers/Authentication.cs b/src/Dfp/Headers/Authentication.cs new file mode 100644 index 00000000000..69af7188a25 --- /dev/null +++ b/src/Dfp/Headers/Authentication.cs @@ -0,0 +1,46 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfp.Headers { + /// + /// The authentication header. + /// + [XmlIncludeAttribute(typeof(ClientLogin))] + [XmlIncludeAttribute(typeof(OAuth))] + [XmlRootAttribute(Namespace = "https://www.google.com/apis/ads/publisher{version}")] + public abstract class Authentication { + /// + /// The authentication type. + /// + private string authenticationTypeField; + + /// + /// Gets or sets the type of the authentication. + /// + [XmlElementAttribute("Authentication.Type")] + public string AuthenticationType { + get { + return this.authenticationTypeField; + } + set { + this.authenticationTypeField = value; + } + } + } +} diff --git a/src/Dfp/Headers/ClientLogin.cs b/src/Dfp/Headers/ClientLogin.cs new file mode 100644 index 00000000000..6bcd3d6c6d5 --- /dev/null +++ b/src/Dfp/Headers/ClientLogin.cs @@ -0,0 +1,43 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfp.Headers { + /// + /// The client login authentication header. + /// + [XmlRootAttribute(Namespace = "https://www.google.com/apis/ads/publisher{version}")] + public class ClientLogin : Authentication { + /// + /// The authToken. + /// + private string tokenField; + + /// + /// Gets or sets the authToken. + /// + public string token { + get { + return this.tokenField; + } + set { + this.tokenField = value; + } + } + } +} diff --git a/src/Dfp/Headers/DfpSoapHeader.cs b/src/Dfp/Headers/DfpSoapHeader.cs new file mode 100644 index 00000000000..9f2fb72384e --- /dev/null +++ b/src/Dfp/Headers/DfpSoapHeader.cs @@ -0,0 +1,38 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; + +namespace Google.Api.Ads.Dfp.Headers { + /// + /// Base class for Dfp API Soap headers. + /// + public abstract class DfpSoapHeader : SoapHeaderBase { + /// + /// Gets or sets the API version. + /// + public string Version { + get { + return placeHolders["{version}"].TrimStart('/'); + } + set { + placeHolders["{version}"] = "/" + value; + } + } + } +} diff --git a/src/Dfp/Headers/OAuth.cs b/src/Dfp/Headers/OAuth.cs new file mode 100644 index 00000000000..15f8f882af4 --- /dev/null +++ b/src/Dfp/Headers/OAuth.cs @@ -0,0 +1,43 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfp.Headers { + /// + /// The oauth authentication header. + /// + [XmlRootAttribute(Namespace = "https://www.google.com/apis/ads/publisher{version}")] + public class OAuth : Authentication { + /// + /// The oauth parameters. + /// + private string parametersField; + + /// + /// Gets or sets the oauth parameters. + /// + public string parameters { + get { + return this.parametersField; + } + set { + this.parametersField = value; + } + } + } +} diff --git a/src/Dfp/Headers/RequestHeader.cs b/src/Dfp/Headers/RequestHeader.cs new file mode 100644 index 00000000000..be09e823c3a --- /dev/null +++ b/src/Dfp/Headers/RequestHeader.cs @@ -0,0 +1,91 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; + +namespace Google.Api.Ads.Dfp.Headers { + /// + /// Soap Request header for DFP API services. + /// + public class RequestHeader : DfpSoapHeader { + /// + /// The request header stub that this class wraps. + /// + RequestHeaderStub stub = new RequestHeaderStub(); + + /// + /// Gets or sets the stub that is wrapped by this object. + /// + public override object Stub { + get { + return stub; + } + protected set { + stub = value as RequestHeaderStub; + } + } + + /// + /// Gets or sets the authentication field. + /// + public Authentication authentication { + get { + return stub.authentication; + } + set { + stub.authentication = value; + } + } + + /// + /// Gets or sets the OAuth token. + /// + public string oAuthToken { + get { + return stub.oAuthToken; + } + set { + stub.oAuthToken = value; + } + } + + /// + /// Gets or sets the network code. + /// + public string networkCode { + get { + return stub.networkCode; + } + set { + stub.networkCode = value; + } + } + + /// + /// Gets or sets the application name. + /// + public string applicationName { + get { + return stub.applicationName; + } + set { + stub.applicationName = value; + } + } + } +} diff --git a/src/Dfp/Headers/RequestHeaderStub.cs b/src/Dfp/Headers/RequestHeaderStub.cs new file mode 100644 index 00000000000..0b386f93232 --- /dev/null +++ b/src/Dfp/Headers/RequestHeaderStub.cs @@ -0,0 +1,53 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfp.Headers { + /// + /// A SOAP stub class that represents the request headers for a DFP API call. + /// + [SerializableAttribute()] + [XmlRootAttribute(ElementName = "RequestHeader", Namespace = + "https://www.google.com/apis/ads/publisher{version}")] + public class RequestHeaderStub { + /// + /// Auth token. + /// + public string authToken; + + /// + /// OAuth token. + /// + public string oAuthToken; + + /// + /// Network code. + /// + public string networkCode; + + /// + /// Application name. + /// + public string applicationName; + + /// + /// The authentication field. + /// + public Authentication authentication; + } +} diff --git a/src/Dfp/Headers/ResponseHeader.cs b/src/Dfp/Headers/ResponseHeader.cs new file mode 100644 index 00000000000..531e429dc37 --- /dev/null +++ b/src/Dfp/Headers/ResponseHeader.cs @@ -0,0 +1,103 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Reflection; +using System.Xml; + +namespace Google.Api.Ads.Dfp.Headers { + /// + /// SOAP Response header for DFP API services. + /// + public class ResponseHeader : DfpSoapHeader { + /// + /// The request header stub that this class wraps. + /// + ResponseHeaderStub stub = new ResponseHeaderStub(); + + /// + /// Gets or sets the stub that is wrapped by this object. + /// + public override object Stub { + get { + return stub; + } + protected set { + stub = value as ResponseHeaderStub; + } + } + + /// + /// Gets or sets the request id for this API call. + /// + public string requestId { + get { + return stub.requestId; + } + set { + stub.requestId = value; + } + } + + /// + /// Gets or sets the response time for this API call. + /// + public long responseTime { + get { + return stub.responseTime; + } + set { + stub.responseTimeSpecified = true; + stub.responseTime = value; + } + } + + /// + /// Gets or sets the response time for this API call. + /// + public bool responseTimeSpecified { + get { + return stub.responseTimeSpecified; + } + set { + stub.responseTimeSpecified = value; + } + } + + /// + /// Deserialize the object from xml. + /// + /// The xml reader for reading the serialized xml. + /// + public override void ReadXml(XmlReader reader) { + object service = ContextStore.GetValue("SoapService"); + if (service != null) { + PropertyInfo propInfo = service.GetType().GetProperty("RequestHeader"); + if (propInfo != null) { + RequestHeader reqHeader = (RequestHeader)propInfo.GetValue(service, null); + if (reqHeader != null) { + // when deserializing, namespace is not relevant, just the version + // is. + this.Version = reqHeader.Version; + } + } + } + base.ReadXml(reader); + } + } +} diff --git a/src/Dfp/Headers/ResponseHeaderStub.cs b/src/Dfp/Headers/ResponseHeaderStub.cs new file mode 100644 index 00000000000..368b6472fdb --- /dev/null +++ b/src/Dfp/Headers/ResponseHeaderStub.cs @@ -0,0 +1,44 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfp { + /// + /// A SOAP stub class that represents the response headers for a DFP API call. + /// + [SerializableAttribute()] + [XmlRootAttribute(ElementName = "ResponseHeader", Namespace = + "https://www.google.com/apis/ads/publisher{version}")] + public class ResponseHeaderStub { + /// + /// Request ID for this API call. + /// + public string requestId; + + /// + /// Response time for this API call. + /// + public long responseTime; + + /// + /// True, if response time is set. + /// + [XmlIgnoreAttribute] + public bool responseTimeSpecified; + } +} diff --git a/src/Dfp/Lib/DfpApiException.cs b/src/Dfp/Lib/DfpApiException.cs new file mode 100644 index 00000000000..3d1595d4d69 --- /dev/null +++ b/src/Dfp/Lib/DfpApiException.cs @@ -0,0 +1,120 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Common.Util; + +using System; +using System.IO; +using System.Runtime.Serialization; +using System.Security.Permissions; +using System.Text; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfp.Lib { + /// + /// Custom exception class for wrapping DFP API SOAP exceptions. + /// + [Serializable] + public class DfpApiException : DfpException { + /// + /// The original ApiException object from DFP API. + /// + private object apiException; + + /// + /// Gets the ApiException object. + /// + public object ApiException { + get { + return apiException; + } + } + + /// + /// Public constructor. + /// + public DfpApiException() : base() { + } + + /// + /// Public constructor. + /// + /// The underlying ApiException from the + /// server. + public DfpApiException(object apiException) : base() { + this.apiException = apiException; + } + + /// + /// Public constructor. + /// + /// The underlying ApiException from the + /// server. + /// Error message for this API exception. + public DfpApiException(object apiException, string message) : base(message) { + this.apiException = apiException; + } + + /// + /// Public constructor. + /// + /// The underlying ApiException from the + /// server. + /// Error message for this API exception. + /// Inner exception, if any. + public DfpApiException(object apiException, string message, Exception innerException) + : base(message, innerException) { + this.apiException = apiException; + } + + /// + /// Protected constructor. Used by serialization frameworks while + /// deserializing an exception object. + /// + /// Info about the serialization context. + /// A streaming context that represents the + /// serialization stream. + protected DfpApiException(SerializationInfo info, StreamingContext context) + : base(info, context) { + if (info == null) { + throw new ArgumentNullException("info"); + } + apiException = SerializationUtilities.DeserializeFromXmlText( + GetValue(info, "apiException"), + GetValue(info, "apiExceptionType")); + } + + /// + /// This method is called by serialization frameworks while serializing + /// an exception object. + /// + /// Info about the serialization context. + /// A streaming context that represents the + /// serialization stream. + [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)] + public override void GetObjectData(SerializationInfo info, StreamingContext context) { + if (info == null) { + throw new ArgumentNullException("info"); + } + base.GetObjectData(info, context); + if (apiException != null) { + info.AddValue("apiException", SerializationUtilities.SerializeAsXmlText(apiException)); + info.AddValue("apiExceptionType", apiException.GetType()); + } + } + } +} diff --git a/src/Dfp/Lib/DfpAppConfig.cs b/src/Dfp/Lib/DfpAppConfig.cs new file mode 100644 index 00000000000..883cc56a7b0 --- /dev/null +++ b/src/Dfp/Lib/DfpAppConfig.cs @@ -0,0 +1,200 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Configuration; +using System.Collections; +using System.Collections.Specialized; +using System.IO; +using System.Net; +using System.Xml; + +namespace Google.Api.Ads.Dfp.Lib { + /// + /// This class reads the configuration keys from App.config. + /// + public class DfpAppConfig : AppConfigBase { + /// + /// The short name to identify this assembly. + /// + private const string SHORT_NAME = "DfpApi-DotNet"; + + /// + /// Key name for networkCode. + /// + private const string NETWORK_CODE = "NetworkCode"; + + /// + /// Key name for applicationName. + /// + private const string APPLICATION_NAME = "ApplicationName"; + + /// + /// Key name for Dfp API URL. + /// + private const string DFPAPI_SERVER = "DfpApi.Server"; + + /// + /// Key name for authorizationMethod. + /// + private const string AUTHORIZATION_METHOD = "AuthorizationMethod"; + + /// + /// Default value for DFPAPI_SERVER. + /// + private const string DEFAULT_DFPAPI_SERVER = "https://www.google.com"; + + /// + /// The OAuth2 scope for DFP API. + /// + private const string DFP_OAUTH2_SCOPE = "https://www.google.com/apis/ads/publisher/"; + + /// + /// Default value for authorizationMethod. + /// + private const DfpAuthorizationMethod DEFAULT_AUTHORIZATION_METHOD = + DfpAuthorizationMethod.ClientLogin; + + /// + /// The default value for application name. + /// + public const string DEFAULT_APPLICATION_NAME = "INSERT_YOUR_APPLICATION_NAME_HERE"; + + /// + /// NetworkCode to be used in SOAP headers. + /// + private string networkCode; + + /// + /// Application name to be used in SOAP headers. + /// + private string applicationName; + + /// + /// URL for DFP API. + /// + private string dfpApiServer; + + /// + /// Authorization method to be used when making API calls. + /// + private DfpAuthorizationMethod authorizationMethod; + + /// + /// Gets or sets networkCode to be used in SOAP headers. + /// + public string NetworkCode { + get { + return networkCode; + } + set { + SetPropertyField("NetworkCode", ref networkCode, value); + } + } + + /// + /// Gets or sets application name to be used in SOAP headers. + /// + public string ApplicationName { + get { + return applicationName; + } + set { + SetPropertyField("ApplicationName", ref applicationName, value); + } + } + + /// + /// Gets or sets URL for DFP API. + /// + public string DfpApiServer { + get { + return dfpApiServer; + } + set { + SetPropertyField("DfpApiServer", ref dfpApiServer, value); + } + } + + /// + /// Gets or sets the authorization method to be used when making API calls. + /// + public DfpAuthorizationMethod AuthorizationMethod { + get { + return authorizationMethod; + } + set { + SetPropertyField("AuthorizationMethod", ref authorizationMethod, value); + } + } + + /// + /// Gets a useragent string that can be used with the library. + /// + public string GetUserAgent() { + return String.Format("{0} ({1}{2})", this.applicationName, this.Signature, + this.EnableGzipCompression ? ", gzip" : ""); + } + + /// + /// Public constructor. + /// + public DfpAppConfig() : base() { + networkCode = ""; + applicationName = DEFAULT_APPLICATION_NAME; + dfpApiServer = DEFAULT_DFPAPI_SERVER; + authorizationMethod = DEFAULT_AUTHORIZATION_METHOD; + + ReadSettings((Hashtable) ConfigurationManager.GetSection("DfpApi")); + } + + /// + /// Read all settings from App.config. + /// + /// The parsed App.config settings. + protected override void ReadSettings(Hashtable settings) { + base.ReadSettings(settings); + + networkCode = ReadSetting(settings, NETWORK_CODE, networkCode); + applicationName = ReadSetting(settings, APPLICATION_NAME, applicationName); + dfpApiServer = ReadSetting(settings, DFPAPI_SERVER, dfpApiServer); + + try { + authorizationMethod = (DfpAuthorizationMethod) Enum.Parse( + typeof(DfpAuthorizationMethod), + ReadSetting(settings, AUTHORIZATION_METHOD, authorizationMethod.ToString())); + } catch { + authorizationMethod = DEFAULT_AUTHORIZATION_METHOD; + } + + // If there is an OAuth2 scope mentioned in App.config, this will be + // loaded by the above call. If there isn't one, we will initialize it + // with a library-specific default value. + if (string.IsNullOrEmpty(this.OAuth2Scope)) { + this.OAuth2Scope = GetDefaultOAuth2Scope(); + } + } + + /// + /// Gets the default OAuth2 scope. + /// + public override string GetDefaultOAuth2Scope() { + return DFP_OAUTH2_SCOPE; + } + } +} diff --git a/src/Dfp/Lib/DfpAuthorizationMethod.cs b/src/Dfp/Lib/DfpAuthorizationMethod.cs new file mode 100644 index 00000000000..d31ad206717 --- /dev/null +++ b/src/Dfp/Lib/DfpAuthorizationMethod.cs @@ -0,0 +1,32 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +namespace Google.Api.Ads.Dfp.Lib { + /// + /// List of supported Authorization methods for Dfp API. + /// + public enum DfpAuthorizationMethod { + /// + /// ClientLogin API. + /// + ClientLogin, + + /// + /// OAuth 2.0 draft 10 API. + /// + OAuth2 + } +} diff --git a/src/Dfp/Lib/DfpException.cs b/src/Dfp/Lib/DfpException.cs new file mode 100644 index 00000000000..7b5dc964865 --- /dev/null +++ b/src/Dfp/Lib/DfpException.cs @@ -0,0 +1,65 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.IO; +using System.Runtime.Serialization; +using System.Security.Permissions; +using System.Text; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfp.Lib { + /// + /// Base class for all exceptions specific to DFP. + /// + [Serializable] + public class DfpException : AdsException { + /// + /// Public constructor. + /// + public DfpException() : base() { + } + + /// + /// Public constructor. + /// + /// Error message for this API exception. + public DfpException(string message) : base(message) { + } + + /// + /// Public constructor. + /// + /// Error message for this API exception. + /// Inner exception, if any. + public DfpException(string message, Exception innerException) + : base(message, innerException) { + } + + /// + /// Protected constructor. Used by serialization frameworks while + /// deserializing an exception object. + /// + /// Info about the serialization context. + /// A streaming context that represents the + /// serialization stream. + protected DfpException(SerializationInfo info, StreamingContext context) + : base(info, context) { + } + } +} diff --git a/src/Dfp/Lib/DfpService.cs b/src/Dfp/Lib/DfpService.cs new file mode 100644 index 00000000000..56620428fb7 --- /dev/null +++ b/src/Dfp/Lib/DfpService.cs @@ -0,0 +1,47 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Reflection; + +namespace Google.Api.Ads.Dfp.Lib { + /// + /// Lists all the services available through this library. + /// + public partial class DfpService : AdsService { + /// + /// Creates a service creation parameter for defining a DFP service. + /// + /// Service version. + /// Service name. + /// A service creation parameter defining this service. + protected static ServiceSignature MakeServiceSignature(string version, string serviceName) { + return new DfpServiceSignature(version, serviceName); + } + + /// + /// Gets all service types defined in this service. + /// + /// The nested types that define service versions under this + /// service. + public override Type[] GetServiceTypes() { + return MethodInfo.GetCurrentMethod().DeclaringType.GetNestedTypes(); + } + } +} diff --git a/src/Dfp/Lib/DfpServiceFactory.cs b/src/Dfp/Lib/DfpServiceFactory.cs new file mode 100644 index 00000000000..38ff1e2eabb --- /dev/null +++ b/src/Dfp/Lib/DfpServiceFactory.cs @@ -0,0 +1,130 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Dfp.Headers; + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Reflection; +using System.Text; +using System.Web.Services; +using System.Web.Services.Protocols; +using System.Xml; +using System.Xml.Schema; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfp.Lib { + /// + /// The factory class for all DFP API services. + /// + public class DfpServiceFactory : ServiceFactory { + + private const string FINAL_CLIENT_LOGIN_VERSION = "v201311"; + + /// + /// The request header to be used with DFP API services. + /// + private RequestHeader requestHeader; + + /// + /// Default public constructor. + /// + public DfpServiceFactory() { + } + + /// + /// Create a service object. + /// + /// Signature of the service being created. + /// The user for which the service is being created. + /// The server to which the API calls should be + /// made. + /// + /// An object of the desired service type. + public override AdsClient CreateService(ServiceSignature signature, AdsUser user, + Uri serverUrl) { + DfpAppConfig dfpConfig = (DfpAppConfig) Config; + if (serverUrl == null) { + serverUrl = new Uri(dfpConfig.DfpApiServer); + } + + if (user == null) { + throw new ArgumentNullException("user"); + } + + CheckServicePreconditions(signature); + + DfpServiceSignature dfpapiSignature = signature as DfpServiceSignature; + + AdsClient service = (AdsClient) Activator.CreateInstance(dfpapiSignature.ServiceType); + PropertyInfo propInfo = dfpapiSignature.ServiceType.GetProperty("RequestHeader"); + + if (propInfo != null) { + RequestHeader clonedHeader = (RequestHeader) requestHeader.Clone(); + clonedHeader.Version = dfpapiSignature.Version; + propInfo.SetValue(service, clonedHeader, null); + } + + if (dfpConfig.Proxy != null) { + service.Proxy = dfpConfig.Proxy; + } + service.Timeout = dfpConfig.Timeout; + service.Url = string.Format("{0}apis/ads/publisher/{1}/{2}", + serverUrl, dfpapiSignature.Version, dfpapiSignature.ServiceName); + service.UserAgent = dfpConfig.GetUserAgent(); + + service.Signature = signature; + service.User = user; + return service; + } + + /// + /// Reads the headers from App.config. + /// + /// The configuration class. + protected override void ReadHeadersFromConfig(AppConfig config) { + DfpAppConfig dfpConfig = (DfpAppConfig) config; + + this.requestHeader = new RequestHeader(); + this.requestHeader.networkCode = dfpConfig.NetworkCode; + this.requestHeader.applicationName = dfpConfig.GetUserAgent(); + } + + /// + /// Checks preconditions of the service signature and throws and exception if the service + /// cannot be generated. + /// + /// the service signature for generating the service + protected override void CheckServicePreconditions(ServiceSignature signature) { + if (signature == null) { + throw new ArgumentNullException("signature"); + } + if (!(signature is DfpServiceSignature)) { + throw new InvalidCastException(string.Format(CultureInfo.InvariantCulture, + DfpErrorMessages.SignatureIsOfWrongType, typeof(DfpServiceSignature))); + } + DfpAppConfig dfpConfig = (DfpAppConfig) Config; + DfpServiceSignature dfpSignature = signature as DfpServiceSignature; + String version = dfpSignature.Version; + if (dfpConfig.AuthorizationMethod == DfpAuthorizationMethod.ClientLogin + && version.CompareTo(FINAL_CLIENT_LOGIN_VERSION) > 0) { + throw new DfpException(string.Format(DfpErrorMessages.ClientLoginNotSupported, version)); + } + } + } +} diff --git a/src/Dfp/Lib/DfpServiceSignature.cs b/src/Dfp/Lib/DfpServiceSignature.cs new file mode 100644 index 00000000000..49efe8cd218 --- /dev/null +++ b/src/Dfp/Lib/DfpServiceSignature.cs @@ -0,0 +1,54 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Reflection; +using System.Text; +using System.Web.Services; +using System.Web.Services.Protocols; +using System.Xml; +using System.Xml.Schema; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfp.Lib { + /// + /// Service creation params for DFP API family of services. + /// + public class DfpServiceSignature : ServiceSignature { + /// + /// Gets the type of service. + /// + public override Type ServiceType { + get { + return Type.GetType(string.Format(CultureInfo.InvariantCulture, + "Google.Api.Ads.Dfp.{0}.{1}", Version, ServiceName)); + } + } + + /// + /// Public constructor. + /// + /// Service version. + /// Service name. + public DfpServiceSignature(string version, string serviceName) : base(version, serviceName, + SupportedProtocols.SOAP) { + } + } +} diff --git a/src/Dfp/Lib/DfpSoapClient.cs b/src/Dfp/Lib/DfpSoapClient.cs new file mode 100644 index 00000000000..5fbe3a3c93c --- /dev/null +++ b/src/Dfp/Lib/DfpSoapClient.cs @@ -0,0 +1,152 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Headers; + +using System; +using System.IO; +using System.Net; +using System.Reflection; +using System.Text; +using System.Web.Services; +using System.Web.Services.Protocols; +using System.Xml; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfp.Lib { + /// + /// Base class for DFP API services. + /// + public class DfpSoapClient : AdsSoapClient { + /// + /// The error thrown when an auth token expires. + /// + private const string COOKIE_INVALID_ERROR = "AuthenticationError.GOOGLE_ACCOUNT_COOKIE_INVALID"; + + /// + /// The error thrown when an oauth token expires. + /// + private const string OAUTH_TOKEN_EXPIRED_ERROR = "AuthenticationError.AUTHENTICATION_FAILED"; + + /// + /// The service name for use with ClientLogin server. + /// + private const string SERVICE_NAME = "gam"; + + /// + /// Gets a custom exception that wraps the SOAP exception thrown + /// by the server. + /// + /// SOAPException that was thrown by the server. + /// A custom exception object that wraps the SOAP exception. + /// + protected override Exception GetCustomException(SoapException ex) { + string defaultNs = GetDefaultNamespace(); + if (!string.IsNullOrEmpty(defaultNs)) { + // Extract the ApiExceptionFault node. + XmlElement faultNode = GetFaultNode(ex, defaultNs, "ApiExceptionFault"); + + if (faultNode != null) { + try { + DfpApiException dfpException = new DfpApiException( + SerializationUtilities.DeserializeFromXmlTextCustomRootNs( + faultNode.OuterXml, + Assembly.GetExecutingAssembly().GetType( + this.GetType().Namespace + ".ApiException"), defaultNs, + "ApiExceptionFault"), + ex.Message, ex); + return dfpException; + } catch (Exception) { + // deserialization failed, but we can safely ignore it. + } + } + } + return new DfpApiException(null, ex.Message, ex); + } + + /// + /// Initializes the service before MakeApiCall. + /// + /// Name of the method. + /// The method parameters. + protected override void InitForCall(string methodName, object[] parameters) { + DfpAppConfig config = this.User.Config as DfpAppConfig; + string oAuthHeader = null; + RequestHeader header = GetRequestHeader(); + + if (header == null) { + throw new DfpApiException(null, DfpErrorMessages.FailedToSetAuthorizationHeader); + } + + if (!(this.GetType().Name == "NetworkService" && (methodName == "getAllNetworks" + || methodName == "makeTestNetwork"))) { + if (string.IsNullOrEmpty(header.networkCode)) { + throw new SoapHeaderException("networkCode header is required in all API versions >= " + + "v201203. The only exceptions are NetworkService.getAllNetworks and " + + "NetworkService.makeTestNetwork.", XmlQualifiedName.Empty); + } + } + + if (string.IsNullOrEmpty(header.applicationName) || header.applicationName.Contains( + DfpAppConfig.DEFAULT_APPLICATION_NAME)) { + throw new ApplicationException(DfpErrorMessages.RequireValidApplicationName); + } + + if (config.AuthorizationMethod == DfpAuthorizationMethod.OAuth2) { + if (this.User.OAuthProvider != null) { + oAuthHeader = this.User.OAuthProvider.GetAuthHeader(); + } else { + throw new DfpApiException(null, DfpErrorMessages.OAuthProviderCannotBeNull); + } + } else if (config.AuthorizationMethod == DfpAuthorizationMethod.ClientLogin) { + string authToken = (!string.IsNullOrEmpty(config.AuthToken)) ? config.AuthToken : + new AuthToken(config, SERVICE_NAME).GetToken(); + ClientLogin clientLogin = (header.authentication as ClientLogin) ?? new ClientLogin(); + clientLogin.token = authToken; + header.authentication = clientLogin; + } + + ContextStore.AddKey("OAuthHeader", oAuthHeader); + base.InitForCall(methodName, parameters); + } + + /// + /// Creates a WebRequest instance for the specified url. + /// + /// The Uri to use when creating the WebRequest. + /// + /// The WebRequest instance. + /// + protected override WebRequest GetWebRequest(Uri uri) { + WebRequest request = base.GetWebRequest(uri); + string oAuthHeader = (string) ContextStore.GetValue("OAuthHeader"); + if (!string.IsNullOrEmpty(oAuthHeader)) { + request.Headers["Authorization"] = oAuthHeader; + } + return request; + } + + /// + /// Gets the request header. + /// + /// The request header. + private RequestHeader GetRequestHeader() { + return (RequestHeader) this.GetType().GetProperty("RequestHeader").GetValue(this, null); + } + } +} diff --git a/src/Dfp/Lib/DfpTraceListener.cs b/src/Dfp/Lib/DfpTraceListener.cs new file mode 100644 index 00000000000..20d04268646 --- /dev/null +++ b/src/Dfp/Lib/DfpTraceListener.cs @@ -0,0 +1,104 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Globalization; +using System.IO; +using System.Net; +using System.Runtime.Remoting.Messaging; +using System.Text; +using System.Threading; +using System.Web; +using System.Web.Services; +using System.Web.Services.Protocols; +using System.Xml; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfp.Lib { + /// + /// Listens to SOAP messages sent and received by this library. + /// + public class DfpTraceListener : TraceListener { + /// + /// The singleton instance. + /// + protected static DfpTraceListener instance = new DfpTraceListener(); + + /// + /// Protected constructor. + /// + protected DfpTraceListener() : base(new DfpAppConfig()) { + } + + /// + /// Gets the singleton instance. + /// + public static SoapListener Instance { + get { + return instance; + } + } + + /// + /// Create a formatted HTTP request text, to be written into HTTP logs. + /// + /// The request XML for this SOAP call. + /// A formatted string that represents the HTTP request. + protected override string FormatHttpRequest(string soapRequest) { + XmlDocument xDoc = new XmlDocument(); + xDoc.LoadXml(soapRequest); + XmlNamespaceManager xmlns = new XmlNamespaceManager(xDoc.NameTable); + xmlns.AddNamespace("soap", "http://schemas.xmlsoap.org/soap/envelope/"); + XmlNode methodNode = + xDoc.SelectSingleNode("soap:Envelope/soap:Body/*", xmlns); + return string.Format("method={0}", methodNode.Name); + } + + /// + /// Create a formatted http response text, to be written into HTTP logs. + /// + /// The response xml for this SOAP call. + /// A formatted string that represents the HTTP response. + protected override string FormatHttpResponse(string soapResponse) { + XmlDocument xDoc = new XmlDocument(); + xDoc.LoadXml(soapResponse); + XmlNamespaceManager xmlns = new XmlNamespaceManager(xDoc.NameTable); + xmlns.AddNamespace("soap", "http://schemas.xmlsoap.org/soap/envelope/"); + XmlNodeList childNodes = + xDoc.SelectNodes("soap:Envelope/soap:Header/*", xmlns); + if (childNodes.Count == 1 && childNodes[0].Name == "ResponseHeader") { + childNodes = childNodes[0].ChildNodes; + } + StringBuilder responseText = new StringBuilder(); + foreach (XmlNode childNode in childNodes) { + if (childNode is XmlElement) { + responseText.AppendFormat("{0}={1},", childNode.Name, childNode.InnerText); + } + } + return responseText.ToString().TrimEnd(','); + } + + /// + /// Gets a list of fields to be masked in xml logs. + /// + /// The list of fields to be masked. + protected override string[] GetFieldsToMask() { + return new string[] {"authToken", "token"}; + } + } +} diff --git a/src/Dfp/Lib/DfpUser.cs b/src/Dfp/Lib/DfpUser.cs new file mode 100644 index 00000000000..d43098879dd --- /dev/null +++ b/src/Dfp/Lib/DfpUser.cs @@ -0,0 +1,64 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Net; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Web.Services; +using System.Web.Services.Protocols; + +namespace Google.Api.Ads.Dfp.Lib { + /// + /// Represents an DFP API user. + /// + public partial class DfpUser : AdsUser { + /// + /// Public constructor. Use this version if you want the library to + /// use all settings from App.config. + /// + public DfpUser() : base(new DfpAppConfig()) { + } + + /// + /// Parameterized constructor. Use this version if you want to construct + /// a DfpUser with a custom set of headers. + /// + /// The custom set of headers. + public DfpUser(Dictionary headers) : base(new DfpAppConfig(), headers) { + } + + /// + /// Gets all the service types to be registered against this user. + /// + /// The type of all service classes to be registered. + public override Type[] GetServiceTypes() { + return new DfpService().GetServiceTypes(); + } + + /// + /// Gets the default listeners. + /// + /// A list of default listeners + public override SoapListener[] GetDefaultListeners() { + return new SoapListener[] {DfpTraceListener.Instance}; + } + } +} diff --git a/src/Dfp/Properties/AssemblyInfo.cs b/src/Dfp/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..bdf07e356cd --- /dev/null +++ b/src/Dfp/Properties/AssemblyInfo.cs @@ -0,0 +1,38 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Google's DoubleClick for Publishers API DotNet Client Library")] +[assembly: AssemblyDescription( + "This library provides you with functionality to access Google's DoubleClick for " + + "Publishers API.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("49165cbb-dc0f-45c7-bf03-5fed0669ff46")] diff --git a/src/Dfp/Properties/Properties.cs b/src/Dfp/Properties/Properties.cs new file mode 100644 index 00000000000..0d4995b8074 --- /dev/null +++ b/src/Dfp/Properties/Properties.cs @@ -0,0 +1,24 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; + +[assembly: AssemblyCompany("Google")] +[assembly: AssemblyProduct("Google's DoubleClick for Publishers API DotNet Client Library")] +[assembly: AssemblyCopyright("Copyright 2011, Google Inc. All Rights Reserved.")] + +[assembly: AssemblyVersion("18.0.0.0")] +[assembly: AssemblyFileVersion("18.0.0.0")] diff --git a/src/Dfp/Util/v201208/DateTimeUtilities.cs b/src/Dfp/Util/v201208/DateTimeUtilities.cs new file mode 100644 index 00000000000..d26660a0374 --- /dev/null +++ b/src/Dfp/Util/v201208/DateTimeUtilities.cs @@ -0,0 +1,57 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; +using System.Text; + +using DfpDateTime = Google.Api.Ads.Dfp.v201208.DateTime; + +namespace Google.Api.Ads.Dfp.Util.v201208 { + /// + /// A utility class that allows you to build Datetime objects from strings. + /// + public class DateTimeUtilities { + /// + /// Converts the string in format yyyyMMdd HH:mm:ss to a date object. + /// + /// The date string. + /// A Dfp Datetime object. + public static DfpDateTime FromString(string dateString) { + System.DateTime dateTime = System.DateTime.ParseExact(dateString, "yyyyMMdd HH:mm:ss", null); + return FromDateTime(dateTime); + } + + /// + /// Converts a System.DateTime object to a date object. + /// + /// The DateTime object. + /// A Dfp Datetime object. + public static DfpDateTime FromDateTime(System.DateTime dateTime) { + DfpDateTime retval = new DfpDateTime(); + retval.date = new Date(); + retval.date.year = dateTime.Year; + retval.date.month = dateTime.Month; + retval.date.day = dateTime.Day; + retval.hour = dateTime.Hour; + retval.minute = dateTime.Minute; + retval.second = dateTime.Second; + return retval; + } + } +} diff --git a/src/Dfp/Util/v201208/PqlUtilities.cs b/src/Dfp/Util/v201208/PqlUtilities.cs new file mode 100644 index 00000000000..627b34dde88 --- /dev/null +++ b/src/Dfp/Util/v201208/PqlUtilities.cs @@ -0,0 +1,187 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.v201208; + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; + +namespace Google.Api.Ads.Dfp.Util.v201208 { + /// + /// A utility class for handling PQL objects. + /// + public class PqlUtilities { + /// + /// Gets the underlying value of the Value object. + /// + /// The Value object to get the value from. + /// The underlying value. + public static object GetValue(Value value) { + PropertyInfo propInfo = value.GetType().GetProperty("value"); + if (propInfo != null) { + return propInfo.GetValue(value, null); + } + return null; + } + + /// + /// Gets the result set as list of string arrays. + /// + /// The result set to convert to a string array list. + /// A list of string arrays representing the result set. + public static List ResultSetToStringArrayList(ResultSet resultSet) { + List stringArrayList = new List(); + stringArrayList.Add(GetColumnLabels(resultSet)); + if (resultSet.rows != null) { + foreach (Row row in resultSet.rows) { + stringArrayList.Add(GetRowStringValues(row)); + } + } + return stringArrayList; + } + + /// + /// Gets the result set as a table represenation in the form of: + /// + ///
+    /// +-------+-------+-------+
+    /// |column1|column2|column3|
+    /// +-------+-------+-------+
+    /// |value1 |value2 |value3 |
+    /// +-------+-------+-------+
+    /// |value1 |value2 |value3 |
+    /// +-------+-------+-------+
+    /// 
+ ///
+ /// The result set to display as a string + /// The string represenation of result set as a table. + public static String ResultSetToString(ResultSet resultSet) { + StringBuilder resultSetStringBuilder = new StringBuilder(); + List resultSetStringArrayList = ResultSetToStringArrayList(resultSet); + List maxColumnSizes = GetMaxColumnSizes(resultSetStringArrayList); + string rowTemplate = CreateRowTemplate(maxColumnSizes); + string rowSeparator = CreateRowSeperator(maxColumnSizes); + + resultSetStringBuilder.Append(rowSeparator); + for (int i = 0; i < resultSetStringArrayList.Count; i++) { + resultSetStringBuilder.AppendFormat(rowTemplate, (object[]) resultSetStringArrayList[i]). + Append(rowSeparator); + } + return resultSetStringBuilder.ToString(); + } + + /// + /// Creates the row template given the maximum size for each column. + /// + /// The maximum size for each column + /// The row template to format row data into. + private static string CreateRowTemplate(List maxColumnSizes) { + List columnFormatSpecifiers = new List(); + int i = 0; + foreach (int maxColumnSize in maxColumnSizes) { + columnFormatSpecifiers.Add(string.Format("{{{0},{1}}}", i, maxColumnSize)); + i++; + } + return new StringBuilder("| ").Append(string.Join(" | ", columnFormatSpecifiers.ToArray())). + Append(" |\n").ToString(); + } + + /// + /// Creates the row seperator given the maximum size for each column. + /// + /// + /// The row seperator. + private static String CreateRowSeperator(List maxColumnSizes) { + StringBuilder rowSeperator = new StringBuilder("+"); + foreach (int maxColumnSize in maxColumnSizes) { + for (int i = 0; i < maxColumnSize + 2; i++) { + rowSeperator.Append("-"); + } + rowSeperator.Append("+"); + } + return rowSeperator.Append("\n").ToString(); + } + + /// + /// Gets a list of the maximum size for each column. + /// + /// The result set to process. + /// A list of the maximum size for each column. + private static List GetMaxColumnSizes(List resultSet) { + List maxColumnSizes = new List(); + for (int i = 0; i < resultSet[i].Length; i++) { + int maxColumnSize = -1; + for (int j = 0; j < resultSet.Count; j++) { + if (resultSet[j][i].Length > maxColumnSize) { + maxColumnSize = resultSet[j][i].Length; + } + } + maxColumnSizes.Add(maxColumnSize); + + } + return maxColumnSizes; + } + + /// + /// Gets the column labels for the result set. + /// + /// The result set to get the column labels for. + /// + /// The string array of column labels. + public static String[] GetColumnLabels(ResultSet resultSet) { + List columnLabels = new List(); + foreach (ColumnType column in resultSet.columnTypes) { + columnLabels.Add(column.labelName); + } + return columnLabels.ToArray(); + } + + /// + /// Gets the row values for a row of the result set in the form of an object + /// array. + /// + /// The row to get the values for. + /// The object array of the row values. + public static object[] GetRowValues(Row row) { + List rowValues = new List(); + foreach (Value value in row.values) { + rowValues.Add(GetValue(value)); + } + return rowValues.ToArray(); + } + + /// + /// Gets the row values for a row of the result set in a the form of a string + /// array. null values are interperted as empty strings. + /// + /// The row to get the values for. + /// The string array of the row values. + public static String[] GetRowStringValues(Row row) { + object[] rowValues = GetRowValues(row); + List rowStringValues = new List(); + foreach (object obj in rowValues) { + if (obj != null) { + rowStringValues.Add(obj.ToString()); + } else { + rowStringValues.Add(""); + } + } + return rowStringValues.ToArray(); + } + } +} diff --git a/src/Dfp/Util/v201208/StatementBuilder.cs b/src/Dfp/Util/v201208/StatementBuilder.cs new file mode 100644 index 00000000000..ce194b30828 --- /dev/null +++ b/src/Dfp/Util/v201208/StatementBuilder.cs @@ -0,0 +1,363 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) +// Author: Chris Seeley (https://github.com/Narwalter) + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Dfp.v201208; +using DateTime = Google.Api.Ads.Dfp.v201208.DateTime; + +namespace Google.Api.Ads.Dfp.Util.v201208 { + + /// + /// A utility class that allows for statements to be constructed in parts. + /// Typical usage is: + /// + /// StatementBuilder statementBuilder = new StatementBuilder() + /// .Where("lastModifiedTime > :yesterday AND type = :type") + /// .OrderBy("name DESC") + /// .Limit(200) + /// .Offset(20) + /// .AddValue("yesterday", + /// DateTimeUtilities.FromDateTime(System.DateTime.Now.AddDays(-1))) + /// .AddValue("type", "Type"); + /// Statement statement = statementBuilder.ToStatement(); + /// // ... + /// statementBuilder.increaseOffsetBy(20); + /// statement = statementBuilder.ToStatement(); + /// + /// + public class StatementBuilder { + public const int SUGGESTED_PAGE_LIMIT = 500; + + private const string SELECT = "SELECT"; + private const string FROM = "FROM"; + private const string WHERE = "WHERE"; + private const string LIMIT = "LIMIT"; + private const string OFFSET = "OFFSET"; + private const string ORDER_BY = "ORDER BY"; + + protected string query; + protected string select; + protected string from; + protected string where; + protected int? limit = null; + protected int? offset = null; + protected string orderBy; + + /// + /// The list of query parameters. + /// + private List valueEntries; + + /// + /// Constructs a statement builder for partial query building. + /// + public StatementBuilder() { + valueEntries = new List(); + } + + /// + /// Constructs a statement builder with a complete query. + /// + /// The query string. + [Obsolete("Use partial query construction instead")] + public StatementBuilder(string query) { + this.query = query; + valueEntries = new List(); + } + + /// + /// Gets or sets the statement query. + /// + [Obsolete("Use partial query construction instead")] + public string Query { + get { + ValidateUsingCompleteQuery(); + return query; + } + set { + ValidateUsingCompleteQuery(); + query = value; + } + } + + /// + /// Removes a keyword from the start of a clause, if it exists. + /// + /// The clause to remove the keyword from + /// The keyword to remove + /// The clause with the keyword removed + private static string RemoveKeyword(string clause, string keyword) { + string formattedKeyword = keyword.Trim() + " "; + return clause.StartsWith(formattedKeyword, true, null) + ? clause.Substring(formattedKeyword.Length) : clause; + } + + private void ValidateUsingCompleteQuery() { + if (PartialQueryExists()) { + throw new InvalidOperationException(DfpErrorMessages.PartialQuerySet); + } + } + + private bool PartialQueryExists() { + return select != null + || from != null + || where != null + || limit != null + || offset != null + || orderBy != null; + } + + private void ValidateUsingPartialQuery() { + if (!String.IsNullOrEmpty(query)) { + throw new InvalidOperationException(DfpErrorMessages.CompleteQuerySet); + } + } + + /// + /// Sets the statement SELECT clause in the form of "a,b". + /// Only necessary for statements being sent to the + /// . + /// The "SELECT " keyword will be ignored. + /// + /// + /// The statement serlect clause without "SELECT". + /// + /// The statement builder, for chaining method calls. + public StatementBuilder Select(String columns) { + PreconditionUtilities.CheckArgumentNotNull(columns, "columns"); + ValidateUsingPartialQuery(); + this.select = RemoveKeyword(columns, SELECT); + return this; + } + + /// + /// Sets the statement FROM clause in the form of "table". + /// Only necessary for statements being sent to the + /// . + /// The "FROM " keyword will be ignored. + /// + /// The statement from clause without "FROM" + /// The statement builder, for chaining method calls. + public StatementBuilder From(String table) { + PreconditionUtilities.CheckArgumentNotNull(table, "table"); + ValidateUsingPartialQuery(); + this.from = RemoveKeyword(table, FROM); + return this; + } + + /// + /// Sets the statement WHERE clause in the form of + /// + /// "WHERE <condition> {[AND | OR] <condition> ...}" + /// + /// e.g. "a = b OR b = c". The "WHERE " keyword will be ignored. + /// + /// The statement query without "WHERE" + /// The statement builder, for chaining method calls. + public StatementBuilder Where(String conditions) { + PreconditionUtilities.CheckArgumentNotNull(conditions, "conditions"); + ValidateUsingPartialQuery(); + this.where = RemoveKeyword(conditions, WHERE); + return this; + } + + /// + /// Sets the statement LIMIT clause in the form of + /// "LIMIT <count>" + /// + /// the statement limit + /// The statement builder, for chaining method calls. + public StatementBuilder Limit(Int32 count) { + ValidateUsingPartialQuery(); + this.limit = count; + return this; + } + + /// + /// Sets the statement OFFSET clause in the form of + /// "OFFSET <count>" + /// + /// the statement offset + /// The statement builder, for chaining method calls. + public StatementBuilder Offset(Int32 count) { + ValidateUsingPartialQuery(); + this.offset = count; + return this; + } + + /// + /// Increases the offset by the given amount. + /// + /// the amount to increase the offset + /// The statement builder, for chaining method calls. + public StatementBuilder IncreaseOffsetBy(Int32 amount) { + ValidateUsingPartialQuery(); + if (this.offset == null) { + this.offset = 0; + } + this.offset += amount; + return this; + } + + /// + /// Gets the curent offset + /// + /// The current offset + public int? GetOffset() { + ValidateUsingPartialQuery(); + return this.offset; + } + + /// + /// Removes the limit and offset from the query. + /// + /// The statement builder, for chaining method calls. + public StatementBuilder RemoveLimitAndOffset() { + ValidateUsingPartialQuery(); + this.offset = null; + this.limit = null; + return this; + } + + /// + /// Sets the statement ORDER BY clause in the form of + /// "ORDER BY <property> [ASC | DESC]" + /// e.g. "type ASC, lastModifiedDateTime DESC". + /// The "ORDER BY " keyword will be ignored. + /// + /// the statement order by without "ORDER BY" + /// The statement builder, for chaining method calls. + public StatementBuilder OrderBy(String orderBy) { + PreconditionUtilities.CheckArgumentNotNull(orderBy, "orderBy"); + this.orderBy = RemoveKeyword(orderBy, ORDER_BY); + return this; + } + + /// + /// Adds a new string value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, string value) { + TextValue queryValue = new TextValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new boolean value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, bool value) { + BooleanValue queryValue = new BooleanValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new decimal value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, decimal value) { + NumberValue queryValue = new NumberValue(); + queryValue.value = value.ToString(); + return AddValue(key, queryValue); + } + + /// + /// Adds a new DateTime value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, DateTime value) { + DateTimeValue queryValue = new DateTimeValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + private StatementBuilder AddValue(string key, Value value) { + String_ValueMapEntry queryValue = new String_ValueMapEntry(); + queryValue.key = key; + queryValue.value = value; + valueEntries.Add(queryValue); + return this; + } + + private void ValidateQuery() { + if (limit == null && offset != null) { + throw new InvalidOperationException( + DfpErrorMessages.InvalidOffsetAndLimit); + } + } + + private String BuildQuery() { + ValidateQuery(); + StringBuilder stringBuilder = new StringBuilder(); + if (!String.IsNullOrEmpty(select)) { + stringBuilder = stringBuilder.Append(SELECT).Append(" ") + .Append(select).Append(" "); + } + if (!String.IsNullOrEmpty(from)) { + stringBuilder = stringBuilder.Append(FROM).Append(" ") + .Append(from).Append(" "); + } + if (!String.IsNullOrEmpty(where)) { + stringBuilder = stringBuilder.Append(WHERE).Append(" ") + .Append(where).Append(" "); + } + if (!String.IsNullOrEmpty(orderBy)) { + stringBuilder = stringBuilder.Append(ORDER_BY).Append(" ") + .Append(orderBy).Append(" "); + } + if (limit != null) { + stringBuilder = stringBuilder.Append(LIMIT).Append(" ") + .Append(limit).Append(" "); + } + if (offset != null) { + stringBuilder = stringBuilder.Append(OFFSET).Append(" ") + .Append(offset).Append(" "); + } + return stringBuilder.ToString().Trim(); + } + + /// + /// Gets the representing the state of this + /// statement builder. + /// + /// The statement. + public Statement ToStatement() { + Statement statement = new Statement(); + statement.query = !String.IsNullOrEmpty(query) ? query : BuildQuery(); + statement.values = valueEntries.ToArray(); + return statement; + } + } +} diff --git a/src/Dfp/Util/v201211/DateTimeUtilities.cs b/src/Dfp/Util/v201211/DateTimeUtilities.cs new file mode 100644 index 00000000000..167fc6cc0e3 --- /dev/null +++ b/src/Dfp/Util/v201211/DateTimeUtilities.cs @@ -0,0 +1,57 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; +using System.Text; + +using DfpDateTime = Google.Api.Ads.Dfp.v201211.DateTime; + +namespace Google.Api.Ads.Dfp.Util.v201211 { + /// + /// A utility class that allows you to build Datetime objects from strings. + /// + public class DateTimeUtilities { + /// + /// Converts the string in format yyyyMMdd HH:mm:ss to a date object. + /// + /// The date string. + /// A Dfp Datetime object. + public static DfpDateTime FromString(string dateString) { + System.DateTime dateTime = System.DateTime.ParseExact(dateString, "yyyyMMdd HH:mm:ss", null); + return FromDateTime(dateTime); + } + + /// + /// Converts a System.DateTime object to a date object. + /// + /// The DateTime object. + /// A Dfp Datetime object. + public static DfpDateTime FromDateTime(System.DateTime dateTime) { + DfpDateTime retval = new DfpDateTime(); + retval.date = new Date(); + retval.date.year = dateTime.Year; + retval.date.month = dateTime.Month; + retval.date.day = dateTime.Day; + retval.hour = dateTime.Hour; + retval.minute = dateTime.Minute; + retval.second = dateTime.Second; + return retval; + } + } +} diff --git a/src/Dfp/Util/v201211/PqlUtilities.cs b/src/Dfp/Util/v201211/PqlUtilities.cs new file mode 100644 index 00000000000..67b31dd06db --- /dev/null +++ b/src/Dfp/Util/v201211/PqlUtilities.cs @@ -0,0 +1,187 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.v201211; + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; + +namespace Google.Api.Ads.Dfp.Util.v201211 { + /// + /// A utility class for handling PQL objects. + /// + public class PqlUtilities { + /// + /// Gets the underlying value of the Value object. + /// + /// The Value object to get the value from. + /// The underlying value. + public static object GetValue(Value value) { + PropertyInfo propInfo = value.GetType().GetProperty("value"); + if (propInfo != null) { + return propInfo.GetValue(value, null); + } + return null; + } + + /// + /// Gets the result set as list of string arrays. + /// + /// The result set to convert to a string array list. + /// A list of string arrays representing the result set. + public static List ResultSetToStringArrayList(ResultSet resultSet) { + List stringArrayList = new List(); + stringArrayList.Add(GetColumnLabels(resultSet)); + if (resultSet.rows != null) { + foreach (Row row in resultSet.rows) { + stringArrayList.Add(GetRowStringValues(row)); + } + } + return stringArrayList; + } + + /// + /// Gets the result set as a table represenation in the form of: + /// + ///
+    /// +-------+-------+-------+
+    /// |column1|column2|column3|
+    /// +-------+-------+-------+
+    /// |value1 |value2 |value3 |
+    /// +-------+-------+-------+
+    /// |value1 |value2 |value3 |
+    /// +-------+-------+-------+
+    /// 
+ ///
+ /// The result set to display as a string + /// The string represenation of result set as a table. + public static String ResultSetToString(ResultSet resultSet) { + StringBuilder resultSetStringBuilder = new StringBuilder(); + List resultSetStringArrayList = ResultSetToStringArrayList(resultSet); + List maxColumnSizes = GetMaxColumnSizes(resultSetStringArrayList); + string rowTemplate = CreateRowTemplate(maxColumnSizes); + string rowSeparator = CreateRowSeperator(maxColumnSizes); + + resultSetStringBuilder.Append(rowSeparator); + for (int i = 0; i < resultSetStringArrayList.Count; i++) { + resultSetStringBuilder.AppendFormat(rowTemplate, (object[]) resultSetStringArrayList[i]). + Append(rowSeparator); + } + return resultSetStringBuilder.ToString(); + } + + /// + /// Creates the row template given the maximum size for each column. + /// + /// The maximum size for each column + /// The row template to format row data into. + private static string CreateRowTemplate(List maxColumnSizes) { + List columnFormatSpecifiers = new List(); + int i = 0; + foreach (int maxColumnSize in maxColumnSizes) { + columnFormatSpecifiers.Add(string.Format("{{{0},{1}}}", i, maxColumnSize)); + i++; + } + return new StringBuilder("| ").Append(string.Join(" | ", columnFormatSpecifiers.ToArray())). + Append(" |\n").ToString(); + } + + /// + /// Creates the row seperator given the maximum size for each column. + /// + /// + /// The row seperator. + private static String CreateRowSeperator(List maxColumnSizes) { + StringBuilder rowSeperator = new StringBuilder("+"); + foreach (int maxColumnSize in maxColumnSizes) { + for (int i = 0; i < maxColumnSize + 2; i++) { + rowSeperator.Append("-"); + } + rowSeperator.Append("+"); + } + return rowSeperator.Append("\n").ToString(); + } + + /// + /// Gets a list of the maximum size for each column. + /// + /// The result set to process. + /// A list of the maximum size for each column. + private static List GetMaxColumnSizes(List resultSet) { + List maxColumnSizes = new List(); + for (int i = 0; i < resultSet[i].Length; i++) { + int maxColumnSize = -1; + for (int j = 0; j < resultSet.Count; j++) { + if (resultSet[j][i].Length > maxColumnSize) { + maxColumnSize = resultSet[j][i].Length; + } + } + maxColumnSizes.Add(maxColumnSize); + + } + return maxColumnSizes; + } + + /// + /// Gets the column labels for the result set. + /// + /// The result set to get the column labels for. + /// + /// The string array of column labels. + public static String[] GetColumnLabels(ResultSet resultSet) { + List columnLabels = new List(); + foreach (ColumnType column in resultSet.columnTypes) { + columnLabels.Add(column.labelName); + } + return columnLabels.ToArray(); + } + + /// + /// Gets the row values for a row of the result set in the form of an object + /// array. + /// + /// The row to get the values for. + /// The object array of the row values. + public static object[] GetRowValues(Row row) { + List rowValues = new List(); + foreach (Value value in row.values) { + rowValues.Add(GetValue(value)); + } + return rowValues.ToArray(); + } + + /// + /// Gets the row values for a row of the result set in a the form of a string + /// array. null values are interperted as empty strings. + /// + /// The row to get the values for. + /// The string array of the row values. + public static String[] GetRowStringValues(Row row) { + object[] rowValues = GetRowValues(row); + List rowStringValues = new List(); + foreach (object obj in rowValues) { + if (obj != null) { + rowStringValues.Add(obj.ToString()); + } else { + rowStringValues.Add(""); + } + } + return rowStringValues.ToArray(); + } + } +} diff --git a/src/Dfp/Util/v201211/StatementBuilder.cs b/src/Dfp/Util/v201211/StatementBuilder.cs new file mode 100644 index 00000000000..84f4ad6aa92 --- /dev/null +++ b/src/Dfp/Util/v201211/StatementBuilder.cs @@ -0,0 +1,363 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) +// Author: Chris Seeley (https://github.com/Narwalter) + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Dfp.v201211; +using DateTime = Google.Api.Ads.Dfp.v201211.DateTime; + +namespace Google.Api.Ads.Dfp.Util.v201211 { + + /// + /// A utility class that allows for statements to be constructed in parts. + /// Typical usage is: + /// + /// StatementBuilder statementBuilder = new StatementBuilder() + /// .Where("lastModifiedTime > :yesterday AND type = :type") + /// .OrderBy("name DESC") + /// .Limit(200) + /// .Offset(20) + /// .AddValue("yesterday", + /// DateTimeUtilities.FromDateTime(System.DateTime.Now.AddDays(-1))) + /// .AddValue("type", "Type"); + /// Statement statement = statementBuilder.ToStatement(); + /// // ... + /// statementBuilder.increaseOffsetBy(20); + /// statement = statementBuilder.ToStatement(); + /// + /// + public class StatementBuilder { + public const int SUGGESTED_PAGE_LIMIT = 500; + + private const string SELECT = "SELECT"; + private const string FROM = "FROM"; + private const string WHERE = "WHERE"; + private const string LIMIT = "LIMIT"; + private const string OFFSET = "OFFSET"; + private const string ORDER_BY = "ORDER BY"; + + protected string query; + protected string select; + protected string from; + protected string where; + protected int? limit = null; + protected int? offset = null; + protected string orderBy; + + /// + /// The list of query parameters. + /// + private List valueEntries; + + /// + /// Constructs a statement builder for partial query building. + /// + public StatementBuilder() { + valueEntries = new List(); + } + + /// + /// Constructs a statement builder with a complete query. + /// + /// The query string. + [Obsolete("Use partial query construction instead")] + public StatementBuilder(string query) { + this.query = query; + valueEntries = new List(); + } + + /// + /// Gets or sets the statement query. + /// + [Obsolete("Use partial query construction instead")] + public string Query { + get { + ValidateUsingCompleteQuery(); + return query; + } + set { + ValidateUsingCompleteQuery(); + query = value; + } + } + + /// + /// Removes a keyword from the start of a clause, if it exists. + /// + /// The clause to remove the keyword from + /// The keyword to remove + /// The clause with the keyword removed + private static string RemoveKeyword(string clause, string keyword) { + string formattedKeyword = keyword.Trim() + " "; + return clause.StartsWith(formattedKeyword, true, null) + ? clause.Substring(formattedKeyword.Length) : clause; + } + + private void ValidateUsingCompleteQuery() { + if (PartialQueryExists()) { + throw new InvalidOperationException(DfpErrorMessages.PartialQuerySet); + } + } + + private bool PartialQueryExists() { + return select != null + || from != null + || where != null + || limit != null + || offset != null + || orderBy != null; + } + + private void ValidateUsingPartialQuery() { + if (!String.IsNullOrEmpty(query)) { + throw new InvalidOperationException(DfpErrorMessages.CompleteQuerySet); + } + } + + /// + /// Sets the statement SELECT clause in the form of "a,b". + /// Only necessary for statements being sent to the + /// . + /// The "SELECT " keyword will be ignored. + /// + /// + /// The statement serlect clause without "SELECT". + /// + /// The statement builder, for chaining method calls. + public StatementBuilder Select(String columns) { + PreconditionUtilities.CheckArgumentNotNull(columns, "columns"); + ValidateUsingPartialQuery(); + this.select = RemoveKeyword(columns, SELECT); + return this; + } + + /// + /// Sets the statement FROM clause in the form of "table". + /// Only necessary for statements being sent to the + /// . + /// The "FROM " keyword will be ignored. + /// + /// The statement from clause without "FROM" + /// The statement builder, for chaining method calls. + public StatementBuilder From(String table) { + PreconditionUtilities.CheckArgumentNotNull(table, "table"); + ValidateUsingPartialQuery(); + this.from = RemoveKeyword(table, FROM); + return this; + } + + /// + /// Sets the statement WHERE clause in the form of + /// + /// "WHERE <condition> {[AND | OR] <condition> ...}" + /// + /// e.g. "a = b OR b = c". The "WHERE " keyword will be ignored. + /// + /// The statement query without "WHERE" + /// The statement builder, for chaining method calls. + public StatementBuilder Where(String conditions) { + PreconditionUtilities.CheckArgumentNotNull(conditions, "conditions"); + ValidateUsingPartialQuery(); + this.where = RemoveKeyword(conditions, WHERE); + return this; + } + + /// + /// Sets the statement LIMIT clause in the form of + /// "LIMIT <count>" + /// + /// the statement limit + /// The statement builder, for chaining method calls. + public StatementBuilder Limit(Int32 count) { + ValidateUsingPartialQuery(); + this.limit = count; + return this; + } + + /// + /// Sets the statement OFFSET clause in the form of + /// "OFFSET <count>" + /// + /// the statement offset + /// The statement builder, for chaining method calls. + public StatementBuilder Offset(Int32 count) { + ValidateUsingPartialQuery(); + this.offset = count; + return this; + } + + /// + /// Increases the offset by the given amount. + /// + /// the amount to increase the offset + /// The statement builder, for chaining method calls. + public StatementBuilder IncreaseOffsetBy(Int32 amount) { + ValidateUsingPartialQuery(); + if (this.offset == null) { + this.offset = 0; + } + this.offset += amount; + return this; + } + + /// + /// Gets the curent offset + /// + /// The current offset + public int? GetOffset() { + ValidateUsingPartialQuery(); + return this.offset; + } + + /// + /// Removes the limit and offset from the query. + /// + /// The statement builder, for chaining method calls. + public StatementBuilder RemoveLimitAndOffset() { + ValidateUsingPartialQuery(); + this.offset = null; + this.limit = null; + return this; + } + + /// + /// Sets the statement ORDER BY clause in the form of + /// "ORDER BY <property> [ASC | DESC]" + /// e.g. "type ASC, lastModifiedDateTime DESC". + /// The "ORDER BY " keyword will be ignored. + /// + /// the statement order by without "ORDER BY" + /// The statement builder, for chaining method calls. + public StatementBuilder OrderBy(String orderBy) { + PreconditionUtilities.CheckArgumentNotNull(orderBy, "orderBy"); + this.orderBy = RemoveKeyword(orderBy, ORDER_BY); + return this; + } + + /// + /// Adds a new string value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, string value) { + TextValue queryValue = new TextValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new boolean value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, bool value) { + BooleanValue queryValue = new BooleanValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new decimal value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, decimal value) { + NumberValue queryValue = new NumberValue(); + queryValue.value = value.ToString(); + return AddValue(key, queryValue); + } + + /// + /// Adds a new DateTime value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, DateTime value) { + DateTimeValue queryValue = new DateTimeValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + private StatementBuilder AddValue(string key, Value value) { + String_ValueMapEntry queryValue = new String_ValueMapEntry(); + queryValue.key = key; + queryValue.value = value; + valueEntries.Add(queryValue); + return this; + } + + private void ValidateQuery() { + if (limit == null && offset != null) { + throw new InvalidOperationException( + DfpErrorMessages.InvalidOffsetAndLimit); + } + } + + private String BuildQuery() { + ValidateQuery(); + StringBuilder stringBuilder = new StringBuilder(); + if (!String.IsNullOrEmpty(select)) { + stringBuilder = stringBuilder.Append(SELECT).Append(" ") + .Append(select).Append(" "); + } + if (!String.IsNullOrEmpty(from)) { + stringBuilder = stringBuilder.Append(FROM).Append(" ") + .Append(from).Append(" "); + } + if (!String.IsNullOrEmpty(where)) { + stringBuilder = stringBuilder.Append(WHERE).Append(" ") + .Append(where).Append(" "); + } + if (!String.IsNullOrEmpty(orderBy)) { + stringBuilder = stringBuilder.Append(ORDER_BY).Append(" ") + .Append(orderBy).Append(" "); + } + if (limit != null) { + stringBuilder = stringBuilder.Append(LIMIT).Append(" ") + .Append(limit).Append(" "); + } + if (offset != null) { + stringBuilder = stringBuilder.Append(OFFSET).Append(" ") + .Append(offset).Append(" "); + } + return stringBuilder.ToString().Trim(); + } + + /// + /// Gets the representing the state of this + /// statement builder. + /// + /// The statement. + public Statement ToStatement() { + Statement statement = new Statement(); + statement.query = !String.IsNullOrEmpty(query) ? query : BuildQuery(); + statement.values = valueEntries.ToArray(); + return statement; + } + } +} diff --git a/src/Dfp/Util/v201302/DateTimeUtilities.cs b/src/Dfp/Util/v201302/DateTimeUtilities.cs new file mode 100644 index 00000000000..de8aef3a015 --- /dev/null +++ b/src/Dfp/Util/v201302/DateTimeUtilities.cs @@ -0,0 +1,57 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; +using System.Text; + +using DfpDateTime = Google.Api.Ads.Dfp.v201302.DateTime; + +namespace Google.Api.Ads.Dfp.Util.v201302 { + /// + /// A utility class that allows you to build Datetime objects from strings. + /// + public class DateTimeUtilities { + /// + /// Converts the string in format yyyyMMdd HH:mm:ss to a date object. + /// + /// The date string. + /// A Dfp Datetime object. + public static DfpDateTime FromString(string dateString) { + System.DateTime dateTime = System.DateTime.ParseExact(dateString, "yyyyMMdd HH:mm:ss", null); + return FromDateTime(dateTime); + } + + /// + /// Converts a System.DateTime object to a date object. + /// + /// The DateTime object. + /// A Dfp Datetime object. + public static DfpDateTime FromDateTime(System.DateTime dateTime) { + DfpDateTime retval = new DfpDateTime(); + retval.date = new Date(); + retval.date.year = dateTime.Year; + retval.date.month = dateTime.Month; + retval.date.day = dateTime.Day; + retval.hour = dateTime.Hour; + retval.minute = dateTime.Minute; + retval.second = dateTime.Second; + return retval; + } + } +} diff --git a/src/Dfp/Util/v201302/PqlUtilities.cs b/src/Dfp/Util/v201302/PqlUtilities.cs new file mode 100644 index 00000000000..eb18e624a31 --- /dev/null +++ b/src/Dfp/Util/v201302/PqlUtilities.cs @@ -0,0 +1,187 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.v201302; + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; + +namespace Google.Api.Ads.Dfp.Util.v201302 { + /// + /// A utility class for handling PQL objects. + /// + public class PqlUtilities { + /// + /// Gets the underlying value of the Value object. + /// + /// The Value object to get the value from. + /// The underlying value. + public static object GetValue(Value value) { + PropertyInfo propInfo = value.GetType().GetProperty("value"); + if (propInfo != null) { + return propInfo.GetValue(value, null); + } + return null; + } + + /// + /// Gets the result set as list of string arrays. + /// + /// The result set to convert to a string array list. + /// A list of string arrays representing the result set. + public static List ResultSetToStringArrayList(ResultSet resultSet) { + List stringArrayList = new List(); + stringArrayList.Add(GetColumnLabels(resultSet)); + if (resultSet.rows != null) { + foreach (Row row in resultSet.rows) { + stringArrayList.Add(GetRowStringValues(row)); + } + } + return stringArrayList; + } + + /// + /// Gets the result set as a table represenation in the form of: + /// + ///
+    /// +-------+-------+-------+
+    /// |column1|column2|column3|
+    /// +-------+-------+-------+
+    /// |value1 |value2 |value3 |
+    /// +-------+-------+-------+
+    /// |value1 |value2 |value3 |
+    /// +-------+-------+-------+
+    /// 
+ ///
+ /// The result set to display as a string + /// The string represenation of result set as a table. + public static String ResultSetToString(ResultSet resultSet) { + StringBuilder resultSetStringBuilder = new StringBuilder(); + List resultSetStringArrayList = ResultSetToStringArrayList(resultSet); + List maxColumnSizes = GetMaxColumnSizes(resultSetStringArrayList); + string rowTemplate = CreateRowTemplate(maxColumnSizes); + string rowSeparator = CreateRowSeperator(maxColumnSizes); + + resultSetStringBuilder.Append(rowSeparator); + for (int i = 0; i < resultSetStringArrayList.Count; i++) { + resultSetStringBuilder.AppendFormat(rowTemplate, (object[]) resultSetStringArrayList[i]). + Append(rowSeparator); + } + return resultSetStringBuilder.ToString(); + } + + /// + /// Creates the row template given the maximum size for each column. + /// + /// The maximum size for each column + /// The row template to format row data into. + private static string CreateRowTemplate(List maxColumnSizes) { + List columnFormatSpecifiers = new List(); + int i = 0; + foreach (int maxColumnSize in maxColumnSizes) { + columnFormatSpecifiers.Add(string.Format("{{{0},{1}}}", i, maxColumnSize)); + i++; + } + return new StringBuilder("| ").Append(string.Join(" | ", columnFormatSpecifiers.ToArray())). + Append(" |\n").ToString(); + } + + /// + /// Creates the row seperator given the maximum size for each column. + /// + /// + /// The row seperator. + private static String CreateRowSeperator(List maxColumnSizes) { + StringBuilder rowSeperator = new StringBuilder("+"); + foreach (int maxColumnSize in maxColumnSizes) { + for (int i = 0; i < maxColumnSize + 2; i++) { + rowSeperator.Append("-"); + } + rowSeperator.Append("+"); + } + return rowSeperator.Append("\n").ToString(); + } + + /// + /// Gets a list of the maximum size for each column. + /// + /// The result set to process. + /// A list of the maximum size for each column. + private static List GetMaxColumnSizes(List resultSet) { + List maxColumnSizes = new List(); + for (int i = 0; i < resultSet[i].Length; i++) { + int maxColumnSize = -1; + for (int j = 0; j < resultSet.Count; j++) { + if (resultSet[j][i].Length > maxColumnSize) { + maxColumnSize = resultSet[j][i].Length; + } + } + maxColumnSizes.Add(maxColumnSize); + + } + return maxColumnSizes; + } + + /// + /// Gets the column labels for the result set. + /// + /// The result set to get the column labels for. + /// + /// The string array of column labels. + public static String[] GetColumnLabels(ResultSet resultSet) { + List columnLabels = new List(); + foreach (ColumnType column in resultSet.columnTypes) { + columnLabels.Add(column.labelName); + } + return columnLabels.ToArray(); + } + + /// + /// Gets the row values for a row of the result set in the form of an object + /// array. + /// + /// The row to get the values for. + /// The object array of the row values. + public static object[] GetRowValues(Row row) { + List rowValues = new List(); + foreach (Value value in row.values) { + rowValues.Add(GetValue(value)); + } + return rowValues.ToArray(); + } + + /// + /// Gets the row values for a row of the result set in a the form of a string + /// array. null values are interperted as empty strings. + /// + /// The row to get the values for. + /// The string array of the row values. + public static String[] GetRowStringValues(Row row) { + object[] rowValues = GetRowValues(row); + List rowStringValues = new List(); + foreach (object obj in rowValues) { + if (obj != null) { + rowStringValues.Add(obj.ToString()); + } else { + rowStringValues.Add(""); + } + } + return rowStringValues.ToArray(); + } + } +} diff --git a/src/Dfp/Util/v201302/StatementBuilder.cs b/src/Dfp/Util/v201302/StatementBuilder.cs new file mode 100644 index 00000000000..fa31ab1da15 --- /dev/null +++ b/src/Dfp/Util/v201302/StatementBuilder.cs @@ -0,0 +1,363 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) +// Author: Chris Seeley (https://github.com/Narwalter) + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Dfp.v201302; +using DateTime = Google.Api.Ads.Dfp.v201302.DateTime; + +namespace Google.Api.Ads.Dfp.Util.v201302 { + + /// + /// A utility class that allows for statements to be constructed in parts. + /// Typical usage is: + /// + /// StatementBuilder statementBuilder = new StatementBuilder() + /// .Where("lastModifiedTime > :yesterday AND type = :type") + /// .OrderBy("name DESC") + /// .Limit(200) + /// .Offset(20) + /// .AddValue("yesterday", + /// DateTimeUtilities.FromDateTime(System.DateTime.Now.AddDays(-1))) + /// .AddValue("type", "Type"); + /// Statement statement = statementBuilder.ToStatement(); + /// // ... + /// statementBuilder.increaseOffsetBy(20); + /// statement = statementBuilder.ToStatement(); + /// + /// + public class StatementBuilder { + public const int SUGGESTED_PAGE_LIMIT = 500; + + private const string SELECT = "SELECT"; + private const string FROM = "FROM"; + private const string WHERE = "WHERE"; + private const string LIMIT = "LIMIT"; + private const string OFFSET = "OFFSET"; + private const string ORDER_BY = "ORDER BY"; + + protected string query; + protected string select; + protected string from; + protected string where; + protected int? limit = null; + protected int? offset = null; + protected string orderBy; + + /// + /// The list of query parameters. + /// + private List valueEntries; + + /// + /// Constructs a statement builder for partial query building. + /// + public StatementBuilder() { + valueEntries = new List(); + } + + /// + /// Constructs a statement builder with a complete query. + /// + /// The query string. + [Obsolete("Use partial query construction instead")] + public StatementBuilder(string query) { + this.query = query; + valueEntries = new List(); + } + + /// + /// Gets or sets the statement query. + /// + [Obsolete("Use partial query construction instead")] + public string Query { + get { + ValidateUsingCompleteQuery(); + return query; + } + set { + ValidateUsingCompleteQuery(); + query = value; + } + } + + /// + /// Removes a keyword from the start of a clause, if it exists. + /// + /// The clause to remove the keyword from + /// The keyword to remove + /// The clause with the keyword removed + private static string RemoveKeyword(string clause, string keyword) { + string formattedKeyword = keyword.Trim() + " "; + return clause.StartsWith(formattedKeyword, true, null) + ? clause.Substring(formattedKeyword.Length) : clause; + } + + private void ValidateUsingCompleteQuery() { + if (PartialQueryExists()) { + throw new InvalidOperationException(DfpErrorMessages.PartialQuerySet); + } + } + + private bool PartialQueryExists() { + return select != null + || from != null + || where != null + || limit != null + || offset != null + || orderBy != null; + } + + private void ValidateUsingPartialQuery() { + if (!String.IsNullOrEmpty(query)) { + throw new InvalidOperationException(DfpErrorMessages.CompleteQuerySet); + } + } + + /// + /// Sets the statement SELECT clause in the form of "a,b". + /// Only necessary for statements being sent to the + /// . + /// The "SELECT " keyword will be ignored. + /// + /// + /// The statement serlect clause without "SELECT". + /// + /// The statement builder, for chaining method calls. + public StatementBuilder Select(String columns) { + PreconditionUtilities.CheckArgumentNotNull(columns, "columns"); + ValidateUsingPartialQuery(); + this.select = RemoveKeyword(columns, SELECT); + return this; + } + + /// + /// Sets the statement FROM clause in the form of "table". + /// Only necessary for statements being sent to the + /// . + /// The "FROM " keyword will be ignored. + /// + /// The statement from clause without "FROM" + /// The statement builder, for chaining method calls. + public StatementBuilder From(String table) { + PreconditionUtilities.CheckArgumentNotNull(table, "table"); + ValidateUsingPartialQuery(); + this.from = RemoveKeyword(table, FROM); + return this; + } + + /// + /// Sets the statement WHERE clause in the form of + /// + /// "WHERE <condition> {[AND | OR] <condition> ...}" + /// + /// e.g. "a = b OR b = c". The "WHERE " keyword will be ignored. + /// + /// The statement query without "WHERE" + /// The statement builder, for chaining method calls. + public StatementBuilder Where(String conditions) { + PreconditionUtilities.CheckArgumentNotNull(conditions, "conditions"); + ValidateUsingPartialQuery(); + this.where = RemoveKeyword(conditions, WHERE); + return this; + } + + /// + /// Sets the statement LIMIT clause in the form of + /// "LIMIT <count>" + /// + /// the statement limit + /// The statement builder, for chaining method calls. + public StatementBuilder Limit(Int32 count) { + ValidateUsingPartialQuery(); + this.limit = count; + return this; + } + + /// + /// Sets the statement OFFSET clause in the form of + /// "OFFSET <count>" + /// + /// the statement offset + /// The statement builder, for chaining method calls. + public StatementBuilder Offset(Int32 count) { + ValidateUsingPartialQuery(); + this.offset = count; + return this; + } + + /// + /// Increases the offset by the given amount. + /// + /// the amount to increase the offset + /// The statement builder, for chaining method calls. + public StatementBuilder IncreaseOffsetBy(Int32 amount) { + ValidateUsingPartialQuery(); + if (this.offset == null) { + this.offset = 0; + } + this.offset += amount; + return this; + } + + /// + /// Gets the curent offset + /// + /// The current offset + public int? GetOffset() { + ValidateUsingPartialQuery(); + return this.offset; + } + + /// + /// Removes the limit and offset from the query. + /// + /// The statement builder, for chaining method calls. + public StatementBuilder RemoveLimitAndOffset() { + ValidateUsingPartialQuery(); + this.offset = null; + this.limit = null; + return this; + } + + /// + /// Sets the statement ORDER BY clause in the form of + /// "ORDER BY <property> [ASC | DESC]" + /// e.g. "type ASC, lastModifiedDateTime DESC". + /// The "ORDER BY " keyword will be ignored. + /// + /// the statement order by without "ORDER BY" + /// The statement builder, for chaining method calls. + public StatementBuilder OrderBy(String orderBy) { + PreconditionUtilities.CheckArgumentNotNull(orderBy, "orderBy"); + this.orderBy = RemoveKeyword(orderBy, ORDER_BY); + return this; + } + + /// + /// Adds a new string value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, string value) { + TextValue queryValue = new TextValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new boolean value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, bool value) { + BooleanValue queryValue = new BooleanValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new decimal value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, decimal value) { + NumberValue queryValue = new NumberValue(); + queryValue.value = value.ToString(); + return AddValue(key, queryValue); + } + + /// + /// Adds a new DateTime value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, DateTime value) { + DateTimeValue queryValue = new DateTimeValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + private StatementBuilder AddValue(string key, Value value) { + String_ValueMapEntry queryValue = new String_ValueMapEntry(); + queryValue.key = key; + queryValue.value = value; + valueEntries.Add(queryValue); + return this; + } + + private void ValidateQuery() { + if (limit == null && offset != null) { + throw new InvalidOperationException( + DfpErrorMessages.InvalidOffsetAndLimit); + } + } + + private String BuildQuery() { + ValidateQuery(); + StringBuilder stringBuilder = new StringBuilder(); + if (!String.IsNullOrEmpty(select)) { + stringBuilder = stringBuilder.Append(SELECT).Append(" ") + .Append(select).Append(" "); + } + if (!String.IsNullOrEmpty(from)) { + stringBuilder = stringBuilder.Append(FROM).Append(" ") + .Append(from).Append(" "); + } + if (!String.IsNullOrEmpty(where)) { + stringBuilder = stringBuilder.Append(WHERE).Append(" ") + .Append(where).Append(" "); + } + if (!String.IsNullOrEmpty(orderBy)) { + stringBuilder = stringBuilder.Append(ORDER_BY).Append(" ") + .Append(orderBy).Append(" "); + } + if (limit != null) { + stringBuilder = stringBuilder.Append(LIMIT).Append(" ") + .Append(limit).Append(" "); + } + if (offset != null) { + stringBuilder = stringBuilder.Append(OFFSET).Append(" ") + .Append(offset).Append(" "); + } + return stringBuilder.ToString().Trim(); + } + + /// + /// Gets the representing the state of this + /// statement builder. + /// + /// The statement. + public Statement ToStatement() { + Statement statement = new Statement(); + statement.query = !String.IsNullOrEmpty(query) ? query : BuildQuery(); + statement.values = valueEntries.ToArray(); + return statement; + } + } +} diff --git a/src/Dfp/Util/v201306/DateTimeUtilities.cs b/src/Dfp/Util/v201306/DateTimeUtilities.cs new file mode 100644 index 00000000000..c83016c3c24 --- /dev/null +++ b/src/Dfp/Util/v201306/DateTimeUtilities.cs @@ -0,0 +1,57 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; +using System.Text; + +using DfpDateTime = Google.Api.Ads.Dfp.v201306.DateTime; + +namespace Google.Api.Ads.Dfp.Util.v201306 { + /// + /// A utility class that allows you to build Datetime objects from strings. + /// + public class DateTimeUtilities { + /// + /// Converts the string in format yyyyMMdd HH:mm:ss to a date object. + /// + /// The date string. + /// A Dfp Datetime object. + public static DfpDateTime FromString(string dateString) { + System.DateTime dateTime = System.DateTime.ParseExact(dateString, "yyyyMMdd HH:mm:ss", null); + return FromDateTime(dateTime); + } + + /// + /// Converts a System.DateTime object to a date object. + /// + /// The DateTime object. + /// A Dfp Datetime object. + public static DfpDateTime FromDateTime(System.DateTime dateTime) { + DfpDateTime retval = new DfpDateTime(); + retval.date = new Date(); + retval.date.year = dateTime.Year; + retval.date.month = dateTime.Month; + retval.date.day = dateTime.Day; + retval.hour = dateTime.Hour; + retval.minute = dateTime.Minute; + retval.second = dateTime.Second; + return retval; + } + } +} diff --git a/src/Dfp/Util/v201306/PqlUtilities.cs b/src/Dfp/Util/v201306/PqlUtilities.cs new file mode 100644 index 00000000000..ae8e49cf560 --- /dev/null +++ b/src/Dfp/Util/v201306/PqlUtilities.cs @@ -0,0 +1,187 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.v201306; + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; + +namespace Google.Api.Ads.Dfp.Util.v201306 { + /// + /// A utility class for handling PQL objects. + /// + public class PqlUtilities { + /// + /// Gets the underlying value of the Value object. + /// + /// The Value object to get the value from. + /// The underlying value. + public static object GetValue(Value value) { + PropertyInfo propInfo = value.GetType().GetProperty("value"); + if (propInfo != null) { + return propInfo.GetValue(value, null); + } + return null; + } + + /// + /// Gets the result set as list of string arrays. + /// + /// The result set to convert to a string array list. + /// A list of string arrays representing the result set. + public static List ResultSetToStringArrayList(ResultSet resultSet) { + List stringArrayList = new List(); + stringArrayList.Add(GetColumnLabels(resultSet)); + if (resultSet.rows != null) { + foreach (Row row in resultSet.rows) { + stringArrayList.Add(GetRowStringValues(row)); + } + } + return stringArrayList; + } + + /// + /// Gets the result set as a table represenation in the form of: + /// + ///
+    /// +-------+-------+-------+
+    /// |column1|column2|column3|
+    /// +-------+-------+-------+
+    /// |value1 |value2 |value3 |
+    /// +-------+-------+-------+
+    /// |value1 |value2 |value3 |
+    /// +-------+-------+-------+
+    /// 
+ ///
+ /// The result set to display as a string + /// The string represenation of result set as a table. + public static String ResultSetToString(ResultSet resultSet) { + StringBuilder resultSetStringBuilder = new StringBuilder(); + List resultSetStringArrayList = ResultSetToStringArrayList(resultSet); + List maxColumnSizes = GetMaxColumnSizes(resultSetStringArrayList); + string rowTemplate = CreateRowTemplate(maxColumnSizes); + string rowSeparator = CreateRowSeperator(maxColumnSizes); + + resultSetStringBuilder.Append(rowSeparator); + for (int i = 0; i < resultSetStringArrayList.Count; i++) { + resultSetStringBuilder.AppendFormat(rowTemplate, (object[]) resultSetStringArrayList[i]). + Append(rowSeparator); + } + return resultSetStringBuilder.ToString(); + } + + /// + /// Creates the row template given the maximum size for each column. + /// + /// The maximum size for each column + /// The row template to format row data into. + private static string CreateRowTemplate(List maxColumnSizes) { + List columnFormatSpecifiers = new List(); + int i = 0; + foreach (int maxColumnSize in maxColumnSizes) { + columnFormatSpecifiers.Add(string.Format("{{{0},{1}}}", i, maxColumnSize)); + i++; + } + return new StringBuilder("| ").Append(string.Join(" | ", columnFormatSpecifiers.ToArray())). + Append(" |\n").ToString(); + } + + /// + /// Creates the row seperator given the maximum size for each column. + /// + /// + /// The row seperator. + private static String CreateRowSeperator(List maxColumnSizes) { + StringBuilder rowSeperator = new StringBuilder("+"); + foreach (int maxColumnSize in maxColumnSizes) { + for (int i = 0; i < maxColumnSize + 2; i++) { + rowSeperator.Append("-"); + } + rowSeperator.Append("+"); + } + return rowSeperator.Append("\n").ToString(); + } + + /// + /// Gets a list of the maximum size for each column. + /// + /// The result set to process. + /// A list of the maximum size for each column. + private static List GetMaxColumnSizes(List resultSet) { + List maxColumnSizes = new List(); + for (int i = 0; i < resultSet[i].Length; i++) { + int maxColumnSize = -1; + for (int j = 0; j < resultSet.Count; j++) { + if (resultSet[j][i].Length > maxColumnSize) { + maxColumnSize = resultSet[j][i].Length; + } + } + maxColumnSizes.Add(maxColumnSize); + + } + return maxColumnSizes; + } + + /// + /// Gets the column labels for the result set. + /// + /// The result set to get the column labels for. + /// + /// The string array of column labels. + public static String[] GetColumnLabels(ResultSet resultSet) { + List columnLabels = new List(); + foreach (ColumnType column in resultSet.columnTypes) { + columnLabels.Add(column.labelName); + } + return columnLabels.ToArray(); + } + + /// + /// Gets the row values for a row of the result set in the form of an object + /// array. + /// + /// The row to get the values for. + /// The object array of the row values. + public static object[] GetRowValues(Row row) { + List rowValues = new List(); + foreach (Value value in row.values) { + rowValues.Add(GetValue(value)); + } + return rowValues.ToArray(); + } + + /// + /// Gets the row values for a row of the result set in a the form of a string + /// array. null values are interperted as empty strings. + /// + /// The row to get the values for. + /// The string array of the row values. + public static String[] GetRowStringValues(Row row) { + object[] rowValues = GetRowValues(row); + List rowStringValues = new List(); + foreach (object obj in rowValues) { + if (obj != null) { + rowStringValues.Add(obj.ToString()); + } else { + rowStringValues.Add(""); + } + } + return rowStringValues.ToArray(); + } + } +} diff --git a/src/Dfp/Util/v201306/StatementBuilder.cs b/src/Dfp/Util/v201306/StatementBuilder.cs new file mode 100644 index 00000000000..b348f22f7be --- /dev/null +++ b/src/Dfp/Util/v201306/StatementBuilder.cs @@ -0,0 +1,375 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) +// Author: Chris Seeley (https://github.com/Narwalter) + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Dfp.v201306; +using DateTime = Google.Api.Ads.Dfp.v201306.DateTime; + +namespace Google.Api.Ads.Dfp.Util.v201306 { + + /// + /// A utility class that allows for statements to be constructed in parts. + /// Typical usage is: + /// + /// StatementBuilder statementBuilder = new StatementBuilder() + /// .Where("lastModifiedTime > :yesterday AND type = :type") + /// .OrderBy("name DESC") + /// .Limit(200) + /// .Offset(20) + /// .AddValue("yesterday", + /// DateTimeUtilities.FromDateTime(System.DateTime.Now.AddDays(-1))) + /// .AddValue("type", "Type"); + /// Statement statement = statementBuilder.ToStatement(); + /// // ... + /// statementBuilder.increaseOffsetBy(20); + /// statement = statementBuilder.ToStatement(); + /// + /// + public class StatementBuilder { + public const int SUGGESTED_PAGE_LIMIT = 500; + + private const string SELECT = "SELECT"; + private const string FROM = "FROM"; + private const string WHERE = "WHERE"; + private const string LIMIT = "LIMIT"; + private const string OFFSET = "OFFSET"; + private const string ORDER_BY = "ORDER BY"; + + protected string query; + protected string select; + protected string from; + protected string where; + protected int? limit = null; + protected int? offset = null; + protected string orderBy; + + /// + /// The list of query parameters. + /// + private List valueEntries; + + /// + /// Constructs a statement builder for partial query building. + /// + public StatementBuilder() { + valueEntries = new List(); + } + + /// + /// Constructs a statement builder with a complete query. + /// + /// The query string. + [Obsolete("Use partial query construction instead")] + public StatementBuilder(string query) { + this.query = query; + valueEntries = new List(); + } + + /// + /// Gets or sets the statement query. + /// + [Obsolete("Use partial query construction instead")] + public string Query { + get { + ValidateUsingCompleteQuery(); + return query; + } + set { + ValidateUsingCompleteQuery(); + query = value; + } + } + + /// + /// Removes a keyword from the start of a clause, if it exists. + /// + /// The clause to remove the keyword from + /// The keyword to remove + /// The clause with the keyword removed + private static string RemoveKeyword(string clause, string keyword) { + string formattedKeyword = keyword.Trim() + " "; + return clause.StartsWith(formattedKeyword, true, null) + ? clause.Substring(formattedKeyword.Length) : clause; + } + + private void ValidateUsingCompleteQuery() { + if (PartialQueryExists()) { + throw new InvalidOperationException(DfpErrorMessages.PartialQuerySet); + } + } + + private bool PartialQueryExists() { + return select != null + || from != null + || where != null + || limit != null + || offset != null + || orderBy != null; + } + + private void ValidateUsingPartialQuery() { + if (!String.IsNullOrEmpty(query)) { + throw new InvalidOperationException(DfpErrorMessages.CompleteQuerySet); + } + } + + /// + /// Sets the statement SELECT clause in the form of "a,b". + /// Only necessary for statements being sent to the + /// . + /// The "SELECT " keyword will be ignored. + /// + /// + /// The statement serlect clause without "SELECT". + /// + /// The statement builder, for chaining method calls. + public StatementBuilder Select(String columns) { + PreconditionUtilities.CheckArgumentNotNull(columns, "columns"); + ValidateUsingPartialQuery(); + this.select = RemoveKeyword(columns, SELECT); + return this; + } + + /// + /// Sets the statement FROM clause in the form of "table". + /// Only necessary for statements being sent to the + /// . + /// The "FROM " keyword will be ignored. + /// + /// The statement from clause without "FROM" + /// The statement builder, for chaining method calls. + public StatementBuilder From(String table) { + PreconditionUtilities.CheckArgumentNotNull(table, "table"); + ValidateUsingPartialQuery(); + this.from = RemoveKeyword(table, FROM); + return this; + } + + /// + /// Sets the statement WHERE clause in the form of + /// + /// "WHERE <condition> {[AND | OR] <condition> ...}" + /// + /// e.g. "a = b OR b = c". The "WHERE " keyword will be ignored. + /// + /// The statement query without "WHERE" + /// The statement builder, for chaining method calls. + public StatementBuilder Where(String conditions) { + PreconditionUtilities.CheckArgumentNotNull(conditions, "conditions"); + ValidateUsingPartialQuery(); + this.where = RemoveKeyword(conditions, WHERE); + return this; + } + + /// + /// Sets the statement LIMIT clause in the form of + /// "LIMIT <count>" + /// + /// the statement limit + /// The statement builder, for chaining method calls. + public StatementBuilder Limit(Int32 count) { + ValidateUsingPartialQuery(); + this.limit = count; + return this; + } + + /// + /// Sets the statement OFFSET clause in the form of + /// "OFFSET <count>" + /// + /// the statement offset + /// The statement builder, for chaining method calls. + public StatementBuilder Offset(Int32 count) { + ValidateUsingPartialQuery(); + this.offset = count; + return this; + } + + /// + /// Increases the offset by the given amount. + /// + /// the amount to increase the offset + /// The statement builder, for chaining method calls. + public StatementBuilder IncreaseOffsetBy(Int32 amount) { + ValidateUsingPartialQuery(); + if (this.offset == null) { + this.offset = 0; + } + this.offset += amount; + return this; + } + + /// + /// Gets the curent offset + /// + /// The current offset + public int? GetOffset() { + ValidateUsingPartialQuery(); + return this.offset; + } + + /// + /// Removes the limit and offset from the query. + /// + /// The statement builder, for chaining method calls. + public StatementBuilder RemoveLimitAndOffset() { + ValidateUsingPartialQuery(); + this.offset = null; + this.limit = null; + return this; + } + + /// + /// Sets the statement ORDER BY clause in the form of + /// "ORDER BY <property> [ASC | DESC]" + /// e.g. "type ASC, lastModifiedDateTime DESC". + /// The "ORDER BY " keyword will be ignored. + /// + /// the statement order by without "ORDER BY" + /// The statement builder, for chaining method calls. + public StatementBuilder OrderBy(String orderBy) { + PreconditionUtilities.CheckArgumentNotNull(orderBy, "orderBy"); + this.orderBy = RemoveKeyword(orderBy, ORDER_BY); + return this; + } + + /// + /// Adds a new string value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, string value) { + TextValue queryValue = new TextValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new boolean value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, bool value) { + BooleanValue queryValue = new BooleanValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new decimal value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, decimal value) { + NumberValue queryValue = new NumberValue(); + queryValue.value = value.ToString(); + return AddValue(key, queryValue); + } + + /// + /// Adds a new DateTime value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, DateTime value) { + DateTimeValue queryValue = new DateTimeValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new Date value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, Date value) { + DateValue queryValue = new DateValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + private StatementBuilder AddValue(string key, Value value) { + String_ValueMapEntry queryValue = new String_ValueMapEntry(); + queryValue.key = key; + queryValue.value = value; + valueEntries.Add(queryValue); + return this; + } + + private void ValidateQuery() { + if (limit == null && offset != null) { + throw new InvalidOperationException( + DfpErrorMessages.InvalidOffsetAndLimit); + } + } + + private String BuildQuery() { + ValidateQuery(); + StringBuilder stringBuilder = new StringBuilder(); + if (!String.IsNullOrEmpty(select)) { + stringBuilder = stringBuilder.Append(SELECT).Append(" ") + .Append(select).Append(" "); + } + if (!String.IsNullOrEmpty(from)) { + stringBuilder = stringBuilder.Append(FROM).Append(" ") + .Append(from).Append(" "); + } + if (!String.IsNullOrEmpty(where)) { + stringBuilder = stringBuilder.Append(WHERE).Append(" ") + .Append(where).Append(" "); + } + if (!String.IsNullOrEmpty(orderBy)) { + stringBuilder = stringBuilder.Append(ORDER_BY).Append(" ") + .Append(orderBy).Append(" "); + } + if (limit != null) { + stringBuilder = stringBuilder.Append(LIMIT).Append(" ") + .Append(limit).Append(" "); + } + if (offset != null) { + stringBuilder = stringBuilder.Append(OFFSET).Append(" ") + .Append(offset).Append(" "); + } + return stringBuilder.ToString().Trim(); + } + + /// + /// Gets the representing the state of this + /// statement builder. + /// + /// The statement. + public Statement ToStatement() { + Statement statement = new Statement(); + statement.query = !String.IsNullOrEmpty(query) ? query : BuildQuery(); + statement.values = valueEntries.ToArray(); + return statement; + } + } +} diff --git a/src/Dfp/Util/v201308/DateTimeUtilities.cs b/src/Dfp/Util/v201308/DateTimeUtilities.cs new file mode 100644 index 00000000000..c3771ec88f6 --- /dev/null +++ b/src/Dfp/Util/v201308/DateTimeUtilities.cs @@ -0,0 +1,57 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; +using System.Text; + +using DfpDateTime = Google.Api.Ads.Dfp.v201308.DateTime; + +namespace Google.Api.Ads.Dfp.Util.v201308 { + /// + /// A utility class that allows you to build Datetime objects from strings. + /// + public class DateTimeUtilities { + /// + /// Converts the string in format yyyyMMdd HH:mm:ss to a date object. + /// + /// The date string. + /// A Dfp Datetime object. + public static DfpDateTime FromString(string dateString) { + System.DateTime dateTime = System.DateTime.ParseExact(dateString, "yyyyMMdd HH:mm:ss", null); + return FromDateTime(dateTime); + } + + /// + /// Converts a System.DateTime object to a date object. + /// + /// The DateTime object. + /// A Dfp Datetime object. + public static DfpDateTime FromDateTime(System.DateTime dateTime) { + DfpDateTime retval = new DfpDateTime(); + retval.date = new Date(); + retval.date.year = dateTime.Year; + retval.date.month = dateTime.Month; + retval.date.day = dateTime.Day; + retval.hour = dateTime.Hour; + retval.minute = dateTime.Minute; + retval.second = dateTime.Second; + return retval; + } + } +} diff --git a/src/Dfp/Util/v201308/PqlUtilities.cs b/src/Dfp/Util/v201308/PqlUtilities.cs new file mode 100644 index 00000000000..d671e98fe76 --- /dev/null +++ b/src/Dfp/Util/v201308/PqlUtilities.cs @@ -0,0 +1,214 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.v201308; + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; + +namespace Google.Api.Ads.Dfp.Util.v201308 { + /// + /// A utility class for handling PQL objects. + /// + public class PqlUtilities { + /// + /// Gets the underlying value of the Value object. + /// + /// The Value object to get the value from. + /// The underlying value. + public static object GetValue(Value value) { + PropertyInfo propInfo = value.GetType().GetProperty("value"); + if (propInfo != null) { + return propInfo.GetValue(value, null); + } + return null; + } + + /// + /// Gets the result set as list of string arrays. + /// + /// The result set to convert to a string array list. + /// A list of string arrays representing the result set. + public static List ResultSetToStringArrayList(ResultSet resultSet) { + List stringArrayList = new List(); + stringArrayList.Add(GetColumnLabels(resultSet)); + if (resultSet.rows != null) { + foreach (Row row in resultSet.rows) { + stringArrayList.Add(GetRowStringValues(row)); + } + } + return stringArrayList; + } + + /// + /// Gets the result set as a table represenation in the form of: + /// + ///
+    /// +-------+-------+-------+
+    /// |column1|column2|column3|
+    /// +-------+-------+-------+
+    /// |value1 |value2 |value3 |
+    /// +-------+-------+-------+
+    /// |value1 |value2 |value3 |
+    /// +-------+-------+-------+
+    /// 
+ ///
+ /// The result set to display as a string + /// The string represenation of result set as a table. + public static String ResultSetToString(ResultSet resultSet) { + StringBuilder resultSetStringBuilder = new StringBuilder(); + List resultSetStringArrayList = ResultSetToStringArrayList(resultSet); + List maxColumnSizes = GetMaxColumnSizes(resultSetStringArrayList); + string rowTemplate = CreateRowTemplate(maxColumnSizes); + string rowSeparator = CreateRowSeperator(maxColumnSizes); + + resultSetStringBuilder.Append(rowSeparator); + for (int i = 0; i < resultSetStringArrayList.Count; i++) { + resultSetStringBuilder.AppendFormat(rowTemplate, (object[]) resultSetStringArrayList[i]). + Append(rowSeparator); + } + return resultSetStringBuilder.ToString(); + } + + /// + /// Creates the row template given the maximum size for each column. + /// + /// The maximum size for each column + /// The row template to format row data into. + private static string CreateRowTemplate(List maxColumnSizes) { + List columnFormatSpecifiers = new List(); + int i = 0; + foreach (int maxColumnSize in maxColumnSizes) { + columnFormatSpecifiers.Add(string.Format("{{{0},{1}}}", i, maxColumnSize)); + i++; + } + return new StringBuilder("| ").Append(string.Join(" | ", columnFormatSpecifiers.ToArray())). + Append(" |\n").ToString(); + } + + /// + /// Creates the row seperator given the maximum size for each column. + /// + /// + /// The row seperator. + private static String CreateRowSeperator(List maxColumnSizes) { + StringBuilder rowSeperator = new StringBuilder("+"); + foreach (int maxColumnSize in maxColumnSizes) { + for (int i = 0; i < maxColumnSize + 2; i++) { + rowSeperator.Append("-"); + } + rowSeperator.Append("+"); + } + return rowSeperator.Append("\n").ToString(); + } + + /// + /// Gets a list of the maximum size for each column. + /// + /// The result set to process. + /// A list of the maximum size for each column. + private static List GetMaxColumnSizes(List resultSet) { + List maxColumnSizes = new List(); + for (int i = 0; i < resultSet[i].Length; i++) { + int maxColumnSize = -1; + for (int j = 0; j < resultSet.Count; j++) { + if (resultSet[j][i].Length > maxColumnSize) { + maxColumnSize = resultSet[j][i].Length; + } + } + maxColumnSizes.Add(maxColumnSize); + + } + return maxColumnSizes; + } + + /// + /// Gets the column labels for the result set. + /// + /// The result set to get the column labels for. + /// + /// The string array of column labels. + public static String[] GetColumnLabels(ResultSet resultSet) { + List columnLabels = new List(); + foreach (ColumnType column in resultSet.columnTypes) { + columnLabels.Add(column.labelName); + } + return columnLabels.ToArray(); + } + + /// + /// Gets the row values for a row of the result set in the form of an object + /// array. + /// + /// The row to get the values for. + /// The object array of the row values. + public static object[] GetRowValues(Row row) { + List rowValues = new List(); + foreach (Value value in row.values) { + rowValues.Add(GetValue(value)); + } + return rowValues.ToArray(); + } + + /// + /// Gets the row values for a row of the result set in a the form of a string + /// array. null values are interperted as empty strings. + /// + /// The row to get the values for. + /// The string array of the row values. + public static String[] GetRowStringValues(Row row) { + object[] rowValues = GetRowValues(row); + List rowStringValues = new List(); + foreach (object obj in rowValues) { + rowStringValues.Add(getTextValue(obj)); + } + return rowStringValues.ToArray(); + } + + /// + /// Gets the text value of an object. + /// + /// The value. + /// A formatted text representation of the value. + /// DateValue is formatted in yyyy-mm-dd format. DateTimeValue is + /// formatted in yyyy-mm-dd HH:mm:ss Z format. + private static string getTextValue(Object value) { + if (value == null) { + return ""; + } + + if (value is DateValue) { + Google.Api.Ads.Dfp.v201308.DateValue dateValue = + (Google.Api.Ads.Dfp.v201308.DateValue) value; + return string.Format("{0:0000}-{1:00}-{2:00}", dateValue.value.year, dateValue.value.month, + dateValue.value.day); + } else if (value is DateTimeValue) { + Google.Api.Ads.Dfp.v201308.DateTimeValue dateTimeValue = + (Google.Api.Ads.Dfp.v201308.DateTimeValue) value; + return string.Format("{0:0000}-{1:00}-{2:00}T{3:00}:{4:00}:{5:00} {6}", + dateTimeValue.value.date.year, dateTimeValue.value.date.month, + dateTimeValue.value.date.day, dateTimeValue.value.hour, + dateTimeValue.value.minute, dateTimeValue.value.second, + dateTimeValue.value.timeZoneID); + } else { + // NumberValue, BooleanValue, TextValue + return value.ToString(); + } + } + } +} diff --git a/src/Dfp/Util/v201308/StatementBuilder.cs b/src/Dfp/Util/v201308/StatementBuilder.cs new file mode 100644 index 00000000000..af7f23d95a1 --- /dev/null +++ b/src/Dfp/Util/v201308/StatementBuilder.cs @@ -0,0 +1,375 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) +// Author: Chris Seeley (https://github.com/Narwalter) + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Dfp.v201308; +using DateTime = Google.Api.Ads.Dfp.v201308.DateTime; + +namespace Google.Api.Ads.Dfp.Util.v201308 { + + /// + /// A utility class that allows for statements to be constructed in parts. + /// Typical usage is: + /// + /// StatementBuilder statementBuilder = new StatementBuilder() + /// .Where("lastModifiedTime > :yesterday AND type = :type") + /// .OrderBy("name DESC") + /// .Limit(200) + /// .Offset(20) + /// .AddValue("yesterday", + /// DateTimeUtilities.FromDateTime(System.DateTime.Now.AddDays(-1))) + /// .AddValue("type", "Type"); + /// Statement statement = statementBuilder.ToStatement(); + /// // ... + /// statementBuilder.increaseOffsetBy(20); + /// statement = statementBuilder.ToStatement(); + /// + /// + public class StatementBuilder { + public const int SUGGESTED_PAGE_LIMIT = 500; + + private const string SELECT = "SELECT"; + private const string FROM = "FROM"; + private const string WHERE = "WHERE"; + private const string LIMIT = "LIMIT"; + private const string OFFSET = "OFFSET"; + private const string ORDER_BY = "ORDER BY"; + + protected string query; + protected string select; + protected string from; + protected string where; + protected int? limit = null; + protected int? offset = null; + protected string orderBy; + + /// + /// The list of query parameters. + /// + private List valueEntries; + + /// + /// Constructs a statement builder for partial query building. + /// + public StatementBuilder() { + valueEntries = new List(); + } + + /// + /// Constructs a statement builder with a complete query. + /// + /// The query string. + [Obsolete("Use partial query construction instead")] + public StatementBuilder(string query) { + this.query = query; + valueEntries = new List(); + } + + /// + /// Gets or sets the statement query. + /// + [Obsolete("Use partial query construction instead")] + public string Query { + get { + ValidateUsingCompleteQuery(); + return query; + } + set { + ValidateUsingCompleteQuery(); + query = value; + } + } + + /// + /// Removes a keyword from the start of a clause, if it exists. + /// + /// The clause to remove the keyword from + /// The keyword to remove + /// The clause with the keyword removed + private static string RemoveKeyword(string clause, string keyword) { + string formattedKeyword = keyword.Trim() + " "; + return clause.StartsWith(formattedKeyword, true, null) + ? clause.Substring(formattedKeyword.Length) : clause; + } + + private void ValidateUsingCompleteQuery() { + if (PartialQueryExists()) { + throw new InvalidOperationException(DfpErrorMessages.PartialQuerySet); + } + } + + private bool PartialQueryExists() { + return select != null + || from != null + || where != null + || limit != null + || offset != null + || orderBy != null; + } + + private void ValidateUsingPartialQuery() { + if (!String.IsNullOrEmpty(query)) { + throw new InvalidOperationException(DfpErrorMessages.CompleteQuerySet); + } + } + + /// + /// Sets the statement SELECT clause in the form of "a,b". + /// Only necessary for statements being sent to the + /// . + /// The "SELECT " keyword will be ignored. + /// + /// + /// The statement serlect clause without "SELECT". + /// + /// The statement builder, for chaining method calls. + public StatementBuilder Select(String columns) { + PreconditionUtilities.CheckArgumentNotNull(columns, "columns"); + ValidateUsingPartialQuery(); + this.select = RemoveKeyword(columns, SELECT); + return this; + } + + /// + /// Sets the statement FROM clause in the form of "table". + /// Only necessary for statements being sent to the + /// . + /// The "FROM " keyword will be ignored. + /// + /// The statement from clause without "FROM" + /// The statement builder, for chaining method calls. + public StatementBuilder From(String table) { + PreconditionUtilities.CheckArgumentNotNull(table, "table"); + ValidateUsingPartialQuery(); + this.from = RemoveKeyword(table, FROM); + return this; + } + + /// + /// Sets the statement WHERE clause in the form of + /// + /// "WHERE <condition> {[AND | OR] <condition> ...}" + /// + /// e.g. "a = b OR b = c". The "WHERE " keyword will be ignored. + /// + /// The statement query without "WHERE" + /// The statement builder, for chaining method calls. + public StatementBuilder Where(String conditions) { + PreconditionUtilities.CheckArgumentNotNull(conditions, "conditions"); + ValidateUsingPartialQuery(); + this.where = RemoveKeyword(conditions, WHERE); + return this; + } + + /// + /// Sets the statement LIMIT clause in the form of + /// "LIMIT <count>" + /// + /// the statement limit + /// The statement builder, for chaining method calls. + public StatementBuilder Limit(Int32 count) { + ValidateUsingPartialQuery(); + this.limit = count; + return this; + } + + /// + /// Sets the statement OFFSET clause in the form of + /// "OFFSET <count>" + /// + /// the statement offset + /// The statement builder, for chaining method calls. + public StatementBuilder Offset(Int32 count) { + ValidateUsingPartialQuery(); + this.offset = count; + return this; + } + + /// + /// Increases the offset by the given amount. + /// + /// the amount to increase the offset + /// The statement builder, for chaining method calls. + public StatementBuilder IncreaseOffsetBy(Int32 amount) { + ValidateUsingPartialQuery(); + if (this.offset == null) { + this.offset = 0; + } + this.offset += amount; + return this; + } + + /// + /// Gets the curent offset + /// + /// The current offset + public int? GetOffset() { + ValidateUsingPartialQuery(); + return this.offset; + } + + /// + /// Removes the limit and offset from the query. + /// + /// The statement builder, for chaining method calls. + public StatementBuilder RemoveLimitAndOffset() { + ValidateUsingPartialQuery(); + this.offset = null; + this.limit = null; + return this; + } + + /// + /// Sets the statement ORDER BY clause in the form of + /// "ORDER BY <property> [ASC | DESC]" + /// e.g. "type ASC, lastModifiedDateTime DESC". + /// The "ORDER BY " keyword will be ignored. + /// + /// the statement order by without "ORDER BY" + /// The statement builder, for chaining method calls. + public StatementBuilder OrderBy(String orderBy) { + PreconditionUtilities.CheckArgumentNotNull(orderBy, "orderBy"); + this.orderBy = RemoveKeyword(orderBy, ORDER_BY); + return this; + } + + /// + /// Adds a new string value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, string value) { + TextValue queryValue = new TextValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new boolean value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, bool value) { + BooleanValue queryValue = new BooleanValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new decimal value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, decimal value) { + NumberValue queryValue = new NumberValue(); + queryValue.value = value.ToString(); + return AddValue(key, queryValue); + } + + /// + /// Adds a new DateTime value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, DateTime value) { + DateTimeValue queryValue = new DateTimeValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new Date value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, Date value) { + DateValue queryValue = new DateValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + private StatementBuilder AddValue(string key, Value value) { + String_ValueMapEntry queryValue = new String_ValueMapEntry(); + queryValue.key = key; + queryValue.value = value; + valueEntries.Add(queryValue); + return this; + } + + private void ValidateQuery() { + if (limit == null && offset != null) { + throw new InvalidOperationException( + DfpErrorMessages.InvalidOffsetAndLimit); + } + } + + private String BuildQuery() { + ValidateQuery(); + StringBuilder stringBuilder = new StringBuilder(); + if (!String.IsNullOrEmpty(select)) { + stringBuilder = stringBuilder.Append(SELECT).Append(" ") + .Append(select).Append(" "); + } + if (!String.IsNullOrEmpty(from)) { + stringBuilder = stringBuilder.Append(FROM).Append(" ") + .Append(from).Append(" "); + } + if (!String.IsNullOrEmpty(where)) { + stringBuilder = stringBuilder.Append(WHERE).Append(" ") + .Append(where).Append(" "); + } + if (!String.IsNullOrEmpty(orderBy)) { + stringBuilder = stringBuilder.Append(ORDER_BY).Append(" ") + .Append(orderBy).Append(" "); + } + if (limit != null) { + stringBuilder = stringBuilder.Append(LIMIT).Append(" ") + .Append(limit).Append(" "); + } + if (offset != null) { + stringBuilder = stringBuilder.Append(OFFSET).Append(" ") + .Append(offset).Append(" "); + } + return stringBuilder.ToString().Trim(); + } + + /// + /// Gets the representing the state of this + /// statement builder. + /// + /// The statement. + public Statement ToStatement() { + Statement statement = new Statement(); + statement.query = !String.IsNullOrEmpty(query) ? query : BuildQuery(); + statement.values = valueEntries.ToArray(); + return statement; + } + } +} diff --git a/src/Dfp/Util/v201311/DateTimeUtilities.cs b/src/Dfp/Util/v201311/DateTimeUtilities.cs new file mode 100644 index 00000000000..1cc7437cfb3 --- /dev/null +++ b/src/Dfp/Util/v201311/DateTimeUtilities.cs @@ -0,0 +1,57 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; +using System.Text; + +using DfpDateTime = Google.Api.Ads.Dfp.v201311.DateTime; + +namespace Google.Api.Ads.Dfp.Util.v201311 { + /// + /// A utility class that allows you to build Datetime objects from strings. + /// + public class DateTimeUtilities { + /// + /// Converts the string in format yyyyMMdd HH:mm:ss to a date object. + /// + /// The date string. + /// A Dfp Datetime object. + public static DfpDateTime FromString(string dateString) { + System.DateTime dateTime = System.DateTime.ParseExact(dateString, "yyyyMMdd HH:mm:ss", null); + return FromDateTime(dateTime); + } + + /// + /// Converts a System.DateTime object to a date object. + /// + /// The DateTime object. + /// A Dfp Datetime object. + public static DfpDateTime FromDateTime(System.DateTime dateTime) { + DfpDateTime retval = new DfpDateTime(); + retval.date = new Date(); + retval.date.year = dateTime.Year; + retval.date.month = dateTime.Month; + retval.date.day = dateTime.Day; + retval.hour = dateTime.Hour; + retval.minute = dateTime.Minute; + retval.second = dateTime.Second; + return retval; + } + } +} diff --git a/src/Dfp/Util/v201311/PqlUtilities.cs b/src/Dfp/Util/v201311/PqlUtilities.cs new file mode 100644 index 00000000000..c3855852d51 --- /dev/null +++ b/src/Dfp/Util/v201311/PqlUtilities.cs @@ -0,0 +1,214 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.v201311; + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; + +namespace Google.Api.Ads.Dfp.Util.v201311 { + /// + /// A utility class for handling PQL objects. + /// + public class PqlUtilities { + /// + /// Gets the underlying value of the Value object. + /// + /// The Value object to get the value from. + /// The underlying value. + public static object GetValue(Value value) { + PropertyInfo propInfo = value.GetType().GetProperty("value"); + if (propInfo != null) { + return propInfo.GetValue(value, null); + } + return null; + } + + /// + /// Gets the result set as list of string arrays. + /// + /// The result set to convert to a string array list. + /// A list of string arrays representing the result set. + public static List ResultSetToStringArrayList(ResultSet resultSet) { + List stringArrayList = new List(); + stringArrayList.Add(GetColumnLabels(resultSet)); + if (resultSet.rows != null) { + foreach (Row row in resultSet.rows) { + stringArrayList.Add(GetRowStringValues(row)); + } + } + return stringArrayList; + } + + /// + /// Gets the result set as a table represenation in the form of: + /// + ///
+    /// +-------+-------+-------+
+    /// |column1|column2|column3|
+    /// +-------+-------+-------+
+    /// |value1 |value2 |value3 |
+    /// +-------+-------+-------+
+    /// |value1 |value2 |value3 |
+    /// +-------+-------+-------+
+    /// 
+ ///
+ /// The result set to display as a string + /// The string represenation of result set as a table. + public static String ResultSetToString(ResultSet resultSet) { + StringBuilder resultSetStringBuilder = new StringBuilder(); + List resultSetStringArrayList = ResultSetToStringArrayList(resultSet); + List maxColumnSizes = GetMaxColumnSizes(resultSetStringArrayList); + string rowTemplate = CreateRowTemplate(maxColumnSizes); + string rowSeparator = CreateRowSeperator(maxColumnSizes); + + resultSetStringBuilder.Append(rowSeparator); + for (int i = 0; i < resultSetStringArrayList.Count; i++) { + resultSetStringBuilder.AppendFormat(rowTemplate, (object[]) resultSetStringArrayList[i]). + Append(rowSeparator); + } + return resultSetStringBuilder.ToString(); + } + + /// + /// Creates the row template given the maximum size for each column. + /// + /// The maximum size for each column + /// The row template to format row data into. + private static string CreateRowTemplate(List maxColumnSizes) { + List columnFormatSpecifiers = new List(); + int i = 0; + foreach (int maxColumnSize in maxColumnSizes) { + columnFormatSpecifiers.Add(string.Format("{{{0},{1}}}", i, maxColumnSize)); + i++; + } + return new StringBuilder("| ").Append(string.Join(" | ", columnFormatSpecifiers.ToArray())). + Append(" |\n").ToString(); + } + + /// + /// Creates the row seperator given the maximum size for each column. + /// + /// + /// The row seperator. + private static String CreateRowSeperator(List maxColumnSizes) { + StringBuilder rowSeperator = new StringBuilder("+"); + foreach (int maxColumnSize in maxColumnSizes) { + for (int i = 0; i < maxColumnSize + 2; i++) { + rowSeperator.Append("-"); + } + rowSeperator.Append("+"); + } + return rowSeperator.Append("\n").ToString(); + } + + /// + /// Gets a list of the maximum size for each column. + /// + /// The result set to process. + /// A list of the maximum size for each column. + private static List GetMaxColumnSizes(List resultSet) { + List maxColumnSizes = new List(); + for (int i = 0; i < resultSet[i].Length; i++) { + int maxColumnSize = -1; + for (int j = 0; j < resultSet.Count; j++) { + if (resultSet[j][i].Length > maxColumnSize) { + maxColumnSize = resultSet[j][i].Length; + } + } + maxColumnSizes.Add(maxColumnSize); + + } + return maxColumnSizes; + } + + /// + /// Gets the column labels for the result set. + /// + /// The result set to get the column labels for. + /// + /// The string array of column labels. + public static String[] GetColumnLabels(ResultSet resultSet) { + List columnLabels = new List(); + foreach (ColumnType column in resultSet.columnTypes) { + columnLabels.Add(column.labelName); + } + return columnLabels.ToArray(); + } + + /// + /// Gets the row values for a row of the result set in the form of an object + /// array. + /// + /// The row to get the values for. + /// The object array of the row values. + public static object[] GetRowValues(Row row) { + List rowValues = new List(); + foreach (Value value in row.values) { + rowValues.Add(GetValue(value)); + } + return rowValues.ToArray(); + } + + /// + /// Gets the row values for a row of the result set in a the form of a string + /// array. null values are interperted as empty strings. + /// + /// The row to get the values for. + /// The string array of the row values. + public static String[] GetRowStringValues(Row row) { + object[] rowValues = GetRowValues(row); + List rowStringValues = new List(); + foreach (object obj in rowValues) { + rowStringValues.Add(getTextValue(obj)); + } + return rowStringValues.ToArray(); + } + + /// + /// Gets the text value of an object. + /// + /// The value. + /// A formatted text representation of the value. + /// DateValue is formatted in yyyy-mm-dd format. DateTimeValue is + /// formatted in yyyy-mm-dd HH:mm:ss Z format. + private static string getTextValue(Object value) { + if (value == null) { + return ""; + } + + if (value is DateValue) { + Google.Api.Ads.Dfp.v201311.DateValue dateValue = + (Google.Api.Ads.Dfp.v201311.DateValue) value; + return string.Format("{0:0000}-{1:00}-{2:00}", dateValue.value.year, dateValue.value.month, + dateValue.value.day); + } else if (value is DateTimeValue) { + Google.Api.Ads.Dfp.v201311.DateTimeValue dateTimeValue = + (Google.Api.Ads.Dfp.v201311.DateTimeValue) value; + return string.Format("{0:0000}-{1:00}-{2:00}T{3:00}:{4:00}:{5:00} {6}", + dateTimeValue.value.date.year, dateTimeValue.value.date.month, + dateTimeValue.value.date.day, dateTimeValue.value.hour, + dateTimeValue.value.minute, dateTimeValue.value.second, + dateTimeValue.value.timeZoneID); + } else { + // NumberValue, BooleanValue, TextValue + return value.ToString(); + } + } + } +} diff --git a/src/Dfp/Util/v201311/StatementBuilder.cs b/src/Dfp/Util/v201311/StatementBuilder.cs new file mode 100644 index 00000000000..296f98d5a74 --- /dev/null +++ b/src/Dfp/Util/v201311/StatementBuilder.cs @@ -0,0 +1,375 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) +// Author: Chris Seeley (https://github.com/Narwalter) + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Dfp.v201311; +using DateTime = Google.Api.Ads.Dfp.v201311.DateTime; + +namespace Google.Api.Ads.Dfp.Util.v201311 { + + /// + /// A utility class that allows for statements to be constructed in parts. + /// Typical usage is: + /// + /// StatementBuilder statementBuilder = new StatementBuilder() + /// .Where("lastModifiedTime > :yesterday AND type = :type") + /// .OrderBy("name DESC") + /// .Limit(200) + /// .Offset(20) + /// .AddValue("yesterday", + /// DateTimeUtilities.FromDateTime(System.DateTime.Now.AddDays(-1))) + /// .AddValue("type", "Type"); + /// Statement statement = statementBuilder.ToStatement(); + /// // ... + /// statementBuilder.increaseOffsetBy(20); + /// statement = statementBuilder.ToStatement(); + /// + /// + public class StatementBuilder { + public const int SUGGESTED_PAGE_LIMIT = 500; + + private const string SELECT = "SELECT"; + private const string FROM = "FROM"; + private const string WHERE = "WHERE"; + private const string LIMIT = "LIMIT"; + private const string OFFSET = "OFFSET"; + private const string ORDER_BY = "ORDER BY"; + + protected string query; + protected string select; + protected string from; + protected string where; + protected int? limit = null; + protected int? offset = null; + protected string orderBy; + + /// + /// The list of query parameters. + /// + private List valueEntries; + + /// + /// Constructs a statement builder for partial query building. + /// + public StatementBuilder() { + valueEntries = new List(); + } + + /// + /// Constructs a statement builder with a complete query. + /// + /// The query string. + [Obsolete("Use partial query construction instead")] + public StatementBuilder(string query) { + this.query = query; + valueEntries = new List(); + } + + /// + /// Gets or sets the statement query. + /// + [Obsolete("Use partial query construction instead")] + public string Query { + get { + ValidateUsingCompleteQuery(); + return query; + } + set { + ValidateUsingCompleteQuery(); + query = value; + } + } + + /// + /// Removes a keyword from the start of a clause, if it exists. + /// + /// The clause to remove the keyword from + /// The keyword to remove + /// The clause with the keyword removed + private static string RemoveKeyword(string clause, string keyword) { + string formattedKeyword = keyword.Trim() + " "; + return clause.StartsWith(formattedKeyword, true, null) + ? clause.Substring(formattedKeyword.Length) : clause; + } + + private void ValidateUsingCompleteQuery() { + if (PartialQueryExists()) { + throw new InvalidOperationException(DfpErrorMessages.PartialQuerySet); + } + } + + private bool PartialQueryExists() { + return select != null + || from != null + || where != null + || limit != null + || offset != null + || orderBy != null; + } + + private void ValidateUsingPartialQuery() { + if (!String.IsNullOrEmpty(query)) { + throw new InvalidOperationException(DfpErrorMessages.CompleteQuerySet); + } + } + + /// + /// Sets the statement SELECT clause in the form of "a,b". + /// Only necessary for statements being sent to the + /// . + /// The "SELECT " keyword will be ignored. + /// + /// + /// The statement serlect clause without "SELECT". + /// + /// The statement builder, for chaining method calls. + public StatementBuilder Select(String columns) { + PreconditionUtilities.CheckArgumentNotNull(columns, "columns"); + ValidateUsingPartialQuery(); + this.select = RemoveKeyword(columns, SELECT); + return this; + } + + /// + /// Sets the statement FROM clause in the form of "table". + /// Only necessary for statements being sent to the + /// . + /// The "FROM " keyword will be ignored. + /// + /// The statement from clause without "FROM" + /// The statement builder, for chaining method calls. + public StatementBuilder From(String table) { + PreconditionUtilities.CheckArgumentNotNull(table, "table"); + ValidateUsingPartialQuery(); + this.from = RemoveKeyword(table, FROM); + return this; + } + + /// + /// Sets the statement WHERE clause in the form of + /// + /// "WHERE <condition> {[AND | OR] <condition> ...}" + /// + /// e.g. "a = b OR b = c". The "WHERE " keyword will be ignored. + /// + /// The statement query without "WHERE" + /// The statement builder, for chaining method calls. + public StatementBuilder Where(String conditions) { + PreconditionUtilities.CheckArgumentNotNull(conditions, "conditions"); + ValidateUsingPartialQuery(); + this.where = RemoveKeyword(conditions, WHERE); + return this; + } + + /// + /// Sets the statement LIMIT clause in the form of + /// "LIMIT <count>" + /// + /// the statement limit + /// The statement builder, for chaining method calls. + public StatementBuilder Limit(Int32 count) { + ValidateUsingPartialQuery(); + this.limit = count; + return this; + } + + /// + /// Sets the statement OFFSET clause in the form of + /// "OFFSET <count>" + /// + /// the statement offset + /// The statement builder, for chaining method calls. + public StatementBuilder Offset(Int32 count) { + ValidateUsingPartialQuery(); + this.offset = count; + return this; + } + + /// + /// Increases the offset by the given amount. + /// + /// the amount to increase the offset + /// The statement builder, for chaining method calls. + public StatementBuilder IncreaseOffsetBy(Int32 amount) { + ValidateUsingPartialQuery(); + if (this.offset == null) { + this.offset = 0; + } + this.offset += amount; + return this; + } + + /// + /// Gets the curent offset + /// + /// The current offset + public int? GetOffset() { + ValidateUsingPartialQuery(); + return this.offset; + } + + /// + /// Removes the limit and offset from the query. + /// + /// The statement builder, for chaining method calls. + public StatementBuilder RemoveLimitAndOffset() { + ValidateUsingPartialQuery(); + this.offset = null; + this.limit = null; + return this; + } + + /// + /// Sets the statement ORDER BY clause in the form of + /// "ORDER BY <property> [ASC | DESC]" + /// e.g. "type ASC, lastModifiedDateTime DESC". + /// The "ORDER BY " keyword will be ignored. + /// + /// the statement order by without "ORDER BY" + /// The statement builder, for chaining method calls. + public StatementBuilder OrderBy(String orderBy) { + PreconditionUtilities.CheckArgumentNotNull(orderBy, "orderBy"); + this.orderBy = RemoveKeyword(orderBy, ORDER_BY); + return this; + } + + /// + /// Adds a new string value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, string value) { + TextValue queryValue = new TextValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new boolean value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, bool value) { + BooleanValue queryValue = new BooleanValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new decimal value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, decimal value) { + NumberValue queryValue = new NumberValue(); + queryValue.value = value.ToString(); + return AddValue(key, queryValue); + } + + /// + /// Adds a new DateTime value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, DateTime value) { + DateTimeValue queryValue = new DateTimeValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new Date value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, Date value) { + DateValue queryValue = new DateValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + private StatementBuilder AddValue(string key, Value value) { + String_ValueMapEntry queryValue = new String_ValueMapEntry(); + queryValue.key = key; + queryValue.value = value; + valueEntries.Add(queryValue); + return this; + } + + private void ValidateQuery() { + if (limit == null && offset != null) { + throw new InvalidOperationException( + DfpErrorMessages.InvalidOffsetAndLimit); + } + } + + private String BuildQuery() { + ValidateQuery(); + StringBuilder stringBuilder = new StringBuilder(); + if (!String.IsNullOrEmpty(select)) { + stringBuilder = stringBuilder.Append(SELECT).Append(" ") + .Append(select).Append(" "); + } + if (!String.IsNullOrEmpty(from)) { + stringBuilder = stringBuilder.Append(FROM).Append(" ") + .Append(from).Append(" "); + } + if (!String.IsNullOrEmpty(where)) { + stringBuilder = stringBuilder.Append(WHERE).Append(" ") + .Append(where).Append(" "); + } + if (!String.IsNullOrEmpty(orderBy)) { + stringBuilder = stringBuilder.Append(ORDER_BY).Append(" ") + .Append(orderBy).Append(" "); + } + if (limit != null) { + stringBuilder = stringBuilder.Append(LIMIT).Append(" ") + .Append(limit).Append(" "); + } + if (offset != null) { + stringBuilder = stringBuilder.Append(OFFSET).Append(" ") + .Append(offset).Append(" "); + } + return stringBuilder.ToString().Trim(); + } + + /// + /// Gets the representing the state of this + /// statement builder. + /// + /// The statement. + public Statement ToStatement() { + Statement statement = new Statement(); + statement.query = !String.IsNullOrEmpty(query) ? query : BuildQuery(); + statement.values = valueEntries.ToArray(); + return statement; + } + } +} diff --git a/src/Dfp/Util/v201403/DateTimeUtilities.cs b/src/Dfp/Util/v201403/DateTimeUtilities.cs new file mode 100644 index 00000000000..9b7bab4c509 --- /dev/null +++ b/src/Dfp/Util/v201403/DateTimeUtilities.cs @@ -0,0 +1,57 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; +using System.Text; + +using DfpDateTime = Google.Api.Ads.Dfp.v201403.DateTime; + +namespace Google.Api.Ads.Dfp.Util.v201403 { + /// + /// A utility class that allows you to build Datetime objects from strings. + /// + public class DateTimeUtilities { + /// + /// Converts the string in format yyyyMMdd HH:mm:ss to a date object. + /// + /// The date string. + /// A Dfp Datetime object. + public static DfpDateTime FromString(string dateString) { + System.DateTime dateTime = System.DateTime.ParseExact(dateString, "yyyyMMdd HH:mm:ss", null); + return FromDateTime(dateTime); + } + + /// + /// Converts a System.DateTime object to a date object. + /// + /// The DateTime object. + /// A Dfp Datetime object. + public static DfpDateTime FromDateTime(System.DateTime dateTime) { + DfpDateTime retval = new DfpDateTime(); + retval.date = new Date(); + retval.date.year = dateTime.Year; + retval.date.month = dateTime.Month; + retval.date.day = dateTime.Day; + retval.hour = dateTime.Hour; + retval.minute = dateTime.Minute; + retval.second = dateTime.Second; + return retval; + } + } +} diff --git a/src/Dfp/Util/v201403/PqlUtilities.cs b/src/Dfp/Util/v201403/PqlUtilities.cs new file mode 100644 index 00000000000..7fdd81a24fc --- /dev/null +++ b/src/Dfp/Util/v201403/PqlUtilities.cs @@ -0,0 +1,214 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.v201403; + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; + +namespace Google.Api.Ads.Dfp.Util.v201403 { + /// + /// A utility class for handling PQL objects. + /// + public class PqlUtilities { + /// + /// Gets the underlying value of the Value object. + /// + /// The Value object to get the value from. + /// The underlying value. + public static object GetValue(Value value) { + PropertyInfo propInfo = value.GetType().GetProperty("value"); + if (propInfo != null) { + return propInfo.GetValue(value, null); + } + return null; + } + + /// + /// Gets the result set as list of string arrays. + /// + /// The result set to convert to a string array list. + /// A list of string arrays representing the result set. + public static List ResultSetToStringArrayList(ResultSet resultSet) { + List stringArrayList = new List(); + stringArrayList.Add(GetColumnLabels(resultSet)); + if (resultSet.rows != null) { + foreach (Row row in resultSet.rows) { + stringArrayList.Add(GetRowStringValues(row)); + } + } + return stringArrayList; + } + + /// + /// Gets the result set as a table represenation in the form of: + /// + ///
+    /// +-------+-------+-------+
+    /// |column1|column2|column3|
+    /// +-------+-------+-------+
+    /// |value1 |value2 |value3 |
+    /// +-------+-------+-------+
+    /// |value1 |value2 |value3 |
+    /// +-------+-------+-------+
+    /// 
+ ///
+ /// The result set to display as a string + /// The string represenation of result set as a table. + public static String ResultSetToString(ResultSet resultSet) { + StringBuilder resultSetStringBuilder = new StringBuilder(); + List resultSetStringArrayList = ResultSetToStringArrayList(resultSet); + List maxColumnSizes = GetMaxColumnSizes(resultSetStringArrayList); + string rowTemplate = CreateRowTemplate(maxColumnSizes); + string rowSeparator = CreateRowSeperator(maxColumnSizes); + + resultSetStringBuilder.Append(rowSeparator); + for (int i = 0; i < resultSetStringArrayList.Count; i++) { + resultSetStringBuilder.AppendFormat(rowTemplate, (object[]) resultSetStringArrayList[i]). + Append(rowSeparator); + } + return resultSetStringBuilder.ToString(); + } + + /// + /// Creates the row template given the maximum size for each column. + /// + /// The maximum size for each column + /// The row template to format row data into. + private static string CreateRowTemplate(List maxColumnSizes) { + List columnFormatSpecifiers = new List(); + int i = 0; + foreach (int maxColumnSize in maxColumnSizes) { + columnFormatSpecifiers.Add(string.Format("{{{0},{1}}}", i, maxColumnSize)); + i++; + } + return new StringBuilder("| ").Append(string.Join(" | ", columnFormatSpecifiers.ToArray())). + Append(" |\n").ToString(); + } + + /// + /// Creates the row seperator given the maximum size for each column. + /// + /// + /// The row seperator. + private static String CreateRowSeperator(List maxColumnSizes) { + StringBuilder rowSeperator = new StringBuilder("+"); + foreach (int maxColumnSize in maxColumnSizes) { + for (int i = 0; i < maxColumnSize + 2; i++) { + rowSeperator.Append("-"); + } + rowSeperator.Append("+"); + } + return rowSeperator.Append("\n").ToString(); + } + + /// + /// Gets a list of the maximum size for each column. + /// + /// The result set to process. + /// A list of the maximum size for each column. + private static List GetMaxColumnSizes(List resultSet) { + List maxColumnSizes = new List(); + for (int i = 0; i < resultSet[i].Length; i++) { + int maxColumnSize = -1; + for (int j = 0; j < resultSet.Count; j++) { + if (resultSet[j][i].Length > maxColumnSize) { + maxColumnSize = resultSet[j][i].Length; + } + } + maxColumnSizes.Add(maxColumnSize); + + } + return maxColumnSizes; + } + + /// + /// Gets the column labels for the result set. + /// + /// The result set to get the column labels for. + /// + /// The string array of column labels. + public static String[] GetColumnLabels(ResultSet resultSet) { + List columnLabels = new List(); + foreach (ColumnType column in resultSet.columnTypes) { + columnLabels.Add(column.labelName); + } + return columnLabels.ToArray(); + } + + /// + /// Gets the row values for a row of the result set in the form of an object + /// array. + /// + /// The row to get the values for. + /// The object array of the row values. + public static object[] GetRowValues(Row row) { + List rowValues = new List(); + foreach (Value value in row.values) { + rowValues.Add(GetValue(value)); + } + return rowValues.ToArray(); + } + + /// + /// Gets the row values for a row of the result set in a the form of a string + /// array. null values are interperted as empty strings. + /// + /// The row to get the values for. + /// The string array of the row values. + public static String[] GetRowStringValues(Row row) { + object[] rowValues = GetRowValues(row); + List rowStringValues = new List(); + foreach (object obj in rowValues) { + rowStringValues.Add(getTextValue(obj)); + } + return rowStringValues.ToArray(); + } + + /// + /// Gets the text value of an object. + /// + /// The value. + /// A formatted text representation of the value. + /// DateValue is formatted in yyyy-mm-dd format. DateTimeValue is + /// formatted in yyyy-mm-dd HH:mm:ss Z format. + private static string getTextValue(Object value) { + if (value == null) { + return ""; + } + + if (value is DateValue) { + Google.Api.Ads.Dfp.v201403.DateValue dateValue = + (Google.Api.Ads.Dfp.v201403.DateValue) value; + return string.Format("{0:0000}-{1:00}-{2:00}", dateValue.value.year, dateValue.value.month, + dateValue.value.day); + } else if (value is DateTimeValue) { + Google.Api.Ads.Dfp.v201403.DateTimeValue dateTimeValue = + (Google.Api.Ads.Dfp.v201403.DateTimeValue) value; + return string.Format("{0:0000}-{1:00}-{2:00}T{3:00}:{4:00}:{5:00} {6}", + dateTimeValue.value.date.year, dateTimeValue.value.date.month, + dateTimeValue.value.date.day, dateTimeValue.value.hour, + dateTimeValue.value.minute, dateTimeValue.value.second, + dateTimeValue.value.timeZoneID); + } else { + // NumberValue, BooleanValue, TextValue + return value.ToString(); + } + } + } +} diff --git a/src/Dfp/Util/v201403/StatementBuilder.cs b/src/Dfp/Util/v201403/StatementBuilder.cs new file mode 100644 index 00000000000..931ef80de44 --- /dev/null +++ b/src/Dfp/Util/v201403/StatementBuilder.cs @@ -0,0 +1,375 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) +// Author: Chris Seeley (https://github.com/Narwalter) + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Dfp.v201403; +using DateTime = Google.Api.Ads.Dfp.v201403.DateTime; + +namespace Google.Api.Ads.Dfp.Util.v201403 { + + /// + /// A utility class that allows for statements to be constructed in parts. + /// Typical usage is: + /// + /// StatementBuilder statementBuilder = new StatementBuilder() + /// .Where("lastModifiedTime > :yesterday AND type = :type") + /// .OrderBy("name DESC") + /// .Limit(200) + /// .Offset(20) + /// .AddValue("yesterday", + /// DateTimeUtilities.FromDateTime(System.DateTime.Now.AddDays(-1))) + /// .AddValue("type", "Type"); + /// Statement statement = statementBuilder.ToStatement(); + /// // ... + /// statementBuilder.increaseOffsetBy(20); + /// statement = statementBuilder.ToStatement(); + /// + /// + public class StatementBuilder { + public const int SUGGESTED_PAGE_LIMIT = 500; + + private const string SELECT = "SELECT"; + private const string FROM = "FROM"; + private const string WHERE = "WHERE"; + private const string LIMIT = "LIMIT"; + private const string OFFSET = "OFFSET"; + private const string ORDER_BY = "ORDER BY"; + + protected string query; + protected string select; + protected string from; + protected string where; + protected int? limit = null; + protected int? offset = null; + protected string orderBy; + + /// + /// The list of query parameters. + /// + private List valueEntries; + + /// + /// Constructs a statement builder for partial query building. + /// + public StatementBuilder() { + valueEntries = new List(); + } + + /// + /// Constructs a statement builder with a complete query. + /// + /// The query string. + [Obsolete("Use partial query construction instead")] + public StatementBuilder(string query) { + this.query = query; + valueEntries = new List(); + } + + /// + /// Gets or sets the statement query. + /// + [Obsolete("Use partial query construction instead")] + public string Query { + get { + ValidateUsingCompleteQuery(); + return query; + } + set { + ValidateUsingCompleteQuery(); + query = value; + } + } + + /// + /// Removes a keyword from the start of a clause, if it exists. + /// + /// The clause to remove the keyword from + /// The keyword to remove + /// The clause with the keyword removed + private static string RemoveKeyword(string clause, string keyword) { + string formattedKeyword = keyword.Trim() + " "; + return clause.StartsWith(formattedKeyword, true, null) + ? clause.Substring(formattedKeyword.Length) : clause; + } + + private void ValidateUsingCompleteQuery() { + if (PartialQueryExists()) { + throw new InvalidOperationException(DfpErrorMessages.PartialQuerySet); + } + } + + private bool PartialQueryExists() { + return select != null + || from != null + || where != null + || limit != null + || offset != null + || orderBy != null; + } + + private void ValidateUsingPartialQuery() { + if (!String.IsNullOrEmpty(query)) { + throw new InvalidOperationException(DfpErrorMessages.CompleteQuerySet); + } + } + + /// + /// Sets the statement SELECT clause in the form of "a,b". + /// Only necessary for statements being sent to the + /// . + /// The "SELECT " keyword will be ignored. + /// + /// + /// The statement serlect clause without "SELECT". + /// + /// The statement builder, for chaining method calls. + public StatementBuilder Select(String columns) { + PreconditionUtilities.CheckArgumentNotNull(columns, "columns"); + ValidateUsingPartialQuery(); + this.select = RemoveKeyword(columns, SELECT); + return this; + } + + /// + /// Sets the statement FROM clause in the form of "table". + /// Only necessary for statements being sent to the + /// . + /// The "FROM " keyword will be ignored. + /// + /// The statement from clause without "FROM" + /// The statement builder, for chaining method calls. + public StatementBuilder From(String table) { + PreconditionUtilities.CheckArgumentNotNull(table, "table"); + ValidateUsingPartialQuery(); + this.from = RemoveKeyword(table, FROM); + return this; + } + + /// + /// Sets the statement WHERE clause in the form of + /// + /// "WHERE <condition> {[AND | OR] <condition> ...}" + /// + /// e.g. "a = b OR b = c". The "WHERE " keyword will be ignored. + /// + /// The statement query without "WHERE" + /// The statement builder, for chaining method calls. + public StatementBuilder Where(String conditions) { + PreconditionUtilities.CheckArgumentNotNull(conditions, "conditions"); + ValidateUsingPartialQuery(); + this.where = RemoveKeyword(conditions, WHERE); + return this; + } + + /// + /// Sets the statement LIMIT clause in the form of + /// "LIMIT <count>" + /// + /// the statement limit + /// The statement builder, for chaining method calls. + public StatementBuilder Limit(Int32 count) { + ValidateUsingPartialQuery(); + this.limit = count; + return this; + } + + /// + /// Sets the statement OFFSET clause in the form of + /// "OFFSET <count>" + /// + /// the statement offset + /// The statement builder, for chaining method calls. + public StatementBuilder Offset(Int32 count) { + ValidateUsingPartialQuery(); + this.offset = count; + return this; + } + + /// + /// Increases the offset by the given amount. + /// + /// the amount to increase the offset + /// The statement builder, for chaining method calls. + public StatementBuilder IncreaseOffsetBy(Int32 amount) { + ValidateUsingPartialQuery(); + if (this.offset == null) { + this.offset = 0; + } + this.offset += amount; + return this; + } + + /// + /// Gets the curent offset + /// + /// The current offset + public int? GetOffset() { + ValidateUsingPartialQuery(); + return this.offset; + } + + /// + /// Removes the limit and offset from the query. + /// + /// The statement builder, for chaining method calls. + public StatementBuilder RemoveLimitAndOffset() { + ValidateUsingPartialQuery(); + this.offset = null; + this.limit = null; + return this; + } + + /// + /// Sets the statement ORDER BY clause in the form of + /// "ORDER BY <property> [ASC | DESC]" + /// e.g. "type ASC, lastModifiedDateTime DESC". + /// The "ORDER BY " keyword will be ignored. + /// + /// the statement order by without "ORDER BY" + /// The statement builder, for chaining method calls. + public StatementBuilder OrderBy(String orderBy) { + PreconditionUtilities.CheckArgumentNotNull(orderBy, "orderBy"); + this.orderBy = RemoveKeyword(orderBy, ORDER_BY); + return this; + } + + /// + /// Adds a new string value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, string value) { + TextValue queryValue = new TextValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new boolean value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, bool value) { + BooleanValue queryValue = new BooleanValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new decimal value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, decimal value) { + NumberValue queryValue = new NumberValue(); + queryValue.value = value.ToString(); + return AddValue(key, queryValue); + } + + /// + /// Adds a new DateTime value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, DateTime value) { + DateTimeValue queryValue = new DateTimeValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new Date value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, Date value) { + DateValue queryValue = new DateValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + private StatementBuilder AddValue(string key, Value value) { + String_ValueMapEntry queryValue = new String_ValueMapEntry(); + queryValue.key = key; + queryValue.value = value; + valueEntries.Add(queryValue); + return this; + } + + private void ValidateQuery() { + if (limit == null && offset != null) { + throw new InvalidOperationException( + DfpErrorMessages.InvalidOffsetAndLimit); + } + } + + private String BuildQuery() { + ValidateQuery(); + StringBuilder stringBuilder = new StringBuilder(); + if (!String.IsNullOrEmpty(select)) { + stringBuilder = stringBuilder.Append(SELECT).Append(" ") + .Append(select).Append(" "); + } + if (!String.IsNullOrEmpty(from)) { + stringBuilder = stringBuilder.Append(FROM).Append(" ") + .Append(from).Append(" "); + } + if (!String.IsNullOrEmpty(where)) { + stringBuilder = stringBuilder.Append(WHERE).Append(" ") + .Append(where).Append(" "); + } + if (!String.IsNullOrEmpty(orderBy)) { + stringBuilder = stringBuilder.Append(ORDER_BY).Append(" ") + .Append(orderBy).Append(" "); + } + if (limit != null) { + stringBuilder = stringBuilder.Append(LIMIT).Append(" ") + .Append(limit).Append(" "); + } + if (offset != null) { + stringBuilder = stringBuilder.Append(OFFSET).Append(" ") + .Append(offset).Append(" "); + } + return stringBuilder.ToString().Trim(); + } + + /// + /// Gets the representing the state of this + /// statement builder. + /// + /// The statement. + public Statement ToStatement() { + Statement statement = new Statement(); + statement.query = !String.IsNullOrEmpty(query) ? query : BuildQuery(); + statement.values = valueEntries.ToArray(); + return statement; + } + } +} diff --git a/src/Dfp/Util/v201405/DateTimeUtilities.cs b/src/Dfp/Util/v201405/DateTimeUtilities.cs new file mode 100644 index 00000000000..b7c27052a91 --- /dev/null +++ b/src/Dfp/Util/v201405/DateTimeUtilities.cs @@ -0,0 +1,57 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; +using System.Text; + +using DfpDateTime = Google.Api.Ads.Dfp.v201405.DateTime; + +namespace Google.Api.Ads.Dfp.Util.v201405 { + /// + /// A utility class that allows you to build Datetime objects from strings. + /// + public class DateTimeUtilities { + /// + /// Converts the string in format yyyyMMdd HH:mm:ss to a date object. + /// + /// The date string. + /// A Dfp Datetime object. + public static DfpDateTime FromString(string dateString) { + System.DateTime dateTime = System.DateTime.ParseExact(dateString, "yyyyMMdd HH:mm:ss", null); + return FromDateTime(dateTime); + } + + /// + /// Converts a System.DateTime object to a date object. + /// + /// The DateTime object. + /// A Dfp Datetime object. + public static DfpDateTime FromDateTime(System.DateTime dateTime) { + DfpDateTime retval = new DfpDateTime(); + retval.date = new Date(); + retval.date.year = dateTime.Year; + retval.date.month = dateTime.Month; + retval.date.day = dateTime.Day; + retval.hour = dateTime.Hour; + retval.minute = dateTime.Minute; + retval.second = dateTime.Second; + return retval; + } + } +} diff --git a/src/Dfp/Util/v201405/PqlUtilities.cs b/src/Dfp/Util/v201405/PqlUtilities.cs new file mode 100644 index 00000000000..7380a3b3489 --- /dev/null +++ b/src/Dfp/Util/v201405/PqlUtilities.cs @@ -0,0 +1,214 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.v201405; + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; + +namespace Google.Api.Ads.Dfp.Util.v201405 { + /// + /// A utility class for handling PQL objects. + /// + public class PqlUtilities { + /// + /// Gets the underlying value of the Value object. + /// + /// The Value object to get the value from. + /// The underlying value. + public static object GetValue(Value value) { + PropertyInfo propInfo = value.GetType().GetProperty("value"); + if (propInfo != null) { + return propInfo.GetValue(value, null); + } + return null; + } + + /// + /// Gets the result set as list of string arrays. + /// + /// The result set to convert to a string array list. + /// A list of string arrays representing the result set. + public static List ResultSetToStringArrayList(ResultSet resultSet) { + List stringArrayList = new List(); + stringArrayList.Add(GetColumnLabels(resultSet)); + if (resultSet.rows != null) { + foreach (Row row in resultSet.rows) { + stringArrayList.Add(GetRowStringValues(row)); + } + } + return stringArrayList; + } + + /// + /// Gets the result set as a table represenation in the form of: + /// + ///
+    /// +-------+-------+-------+
+    /// |column1|column2|column3|
+    /// +-------+-------+-------+
+    /// |value1 |value2 |value3 |
+    /// +-------+-------+-------+
+    /// |value1 |value2 |value3 |
+    /// +-------+-------+-------+
+    /// 
+ ///
+ /// The result set to display as a string + /// The string represenation of result set as a table. + public static String ResultSetToString(ResultSet resultSet) { + StringBuilder resultSetStringBuilder = new StringBuilder(); + List resultSetStringArrayList = ResultSetToStringArrayList(resultSet); + List maxColumnSizes = GetMaxColumnSizes(resultSetStringArrayList); + string rowTemplate = CreateRowTemplate(maxColumnSizes); + string rowSeparator = CreateRowSeperator(maxColumnSizes); + + resultSetStringBuilder.Append(rowSeparator); + for (int i = 0; i < resultSetStringArrayList.Count; i++) { + resultSetStringBuilder.AppendFormat(rowTemplate, (object[]) resultSetStringArrayList[i]). + Append(rowSeparator); + } + return resultSetStringBuilder.ToString(); + } + + /// + /// Creates the row template given the maximum size for each column. + /// + /// The maximum size for each column + /// The row template to format row data into. + private static string CreateRowTemplate(List maxColumnSizes) { + List columnFormatSpecifiers = new List(); + int i = 0; + foreach (int maxColumnSize in maxColumnSizes) { + columnFormatSpecifiers.Add(string.Format("{{{0},{1}}}", i, maxColumnSize)); + i++; + } + return new StringBuilder("| ").Append(string.Join(" | ", columnFormatSpecifiers.ToArray())). + Append(" |\n").ToString(); + } + + /// + /// Creates the row seperator given the maximum size for each column. + /// + /// + /// The row seperator. + private static String CreateRowSeperator(List maxColumnSizes) { + StringBuilder rowSeperator = new StringBuilder("+"); + foreach (int maxColumnSize in maxColumnSizes) { + for (int i = 0; i < maxColumnSize + 2; i++) { + rowSeperator.Append("-"); + } + rowSeperator.Append("+"); + } + return rowSeperator.Append("\n").ToString(); + } + + /// + /// Gets a list of the maximum size for each column. + /// + /// The result set to process. + /// A list of the maximum size for each column. + private static List GetMaxColumnSizes(List resultSet) { + List maxColumnSizes = new List(); + for (int i = 0; i < resultSet[i].Length; i++) { + int maxColumnSize = -1; + for (int j = 0; j < resultSet.Count; j++) { + if (resultSet[j][i].Length > maxColumnSize) { + maxColumnSize = resultSet[j][i].Length; + } + } + maxColumnSizes.Add(maxColumnSize); + + } + return maxColumnSizes; + } + + /// + /// Gets the column labels for the result set. + /// + /// The result set to get the column labels for. + /// + /// The string array of column labels. + public static String[] GetColumnLabels(ResultSet resultSet) { + List columnLabels = new List(); + foreach (ColumnType column in resultSet.columnTypes) { + columnLabels.Add(column.labelName); + } + return columnLabels.ToArray(); + } + + /// + /// Gets the row values for a row of the result set in the form of an object + /// array. + /// + /// The row to get the values for. + /// The object array of the row values. + public static object[] GetRowValues(Row row) { + List rowValues = new List(); + foreach (Value value in row.values) { + rowValues.Add(GetValue(value)); + } + return rowValues.ToArray(); + } + + /// + /// Gets the row values for a row of the result set in a the form of a string + /// array. null values are interperted as empty strings. + /// + /// The row to get the values for. + /// The string array of the row values. + public static String[] GetRowStringValues(Row row) { + object[] rowValues = GetRowValues(row); + List rowStringValues = new List(); + foreach (object obj in rowValues) { + rowStringValues.Add(getTextValue(obj)); + } + return rowStringValues.ToArray(); + } + + /// + /// Gets the text value of an object. + /// + /// The value. + /// A formatted text representation of the value. + /// DateValue is formatted in yyyy-mm-dd format. DateTimeValue is + /// formatted in yyyy-mm-dd HH:mm:ss Z format. + private static string getTextValue(Object value) { + if (value == null) { + return ""; + } + + if (value is DateValue) { + Google.Api.Ads.Dfp.v201405.DateValue dateValue = + (Google.Api.Ads.Dfp.v201405.DateValue) value; + return string.Format("{0:0000}-{1:00}-{2:00}", dateValue.value.year, dateValue.value.month, + dateValue.value.day); + } else if (value is DateTimeValue) { + Google.Api.Ads.Dfp.v201405.DateTimeValue dateTimeValue = + (Google.Api.Ads.Dfp.v201405.DateTimeValue) value; + return string.Format("{0:0000}-{1:00}-{2:00}T{3:00}:{4:00}:{5:00} {6}", + dateTimeValue.value.date.year, dateTimeValue.value.date.month, + dateTimeValue.value.date.day, dateTimeValue.value.hour, + dateTimeValue.value.minute, dateTimeValue.value.second, + dateTimeValue.value.timeZoneID); + } else { + // NumberValue, BooleanValue, TextValue + return value.ToString(); + } + } + } +} diff --git a/src/Dfp/Util/v201405/StatementBuilder.cs b/src/Dfp/Util/v201405/StatementBuilder.cs new file mode 100644 index 00000000000..65c5a9f5e38 --- /dev/null +++ b/src/Dfp/Util/v201405/StatementBuilder.cs @@ -0,0 +1,375 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) +// Author: Chris Seeley (https://github.com/Narwalter) + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Dfp.v201405; +using DateTime = Google.Api.Ads.Dfp.v201405.DateTime; + +namespace Google.Api.Ads.Dfp.Util.v201405 { + + /// + /// A utility class that allows for statements to be constructed in parts. + /// Typical usage is: + /// + /// StatementBuilder statementBuilder = new StatementBuilder() + /// .Where("lastModifiedTime > :yesterday AND type = :type") + /// .OrderBy("name DESC") + /// .Limit(200) + /// .Offset(20) + /// .AddValue("yesterday", + /// DateTimeUtilities.FromDateTime(System.DateTime.Now.AddDays(-1))) + /// .AddValue("type", "Type"); + /// Statement statement = statementBuilder.ToStatement(); + /// // ... + /// statementBuilder.increaseOffsetBy(20); + /// statement = statementBuilder.ToStatement(); + /// + /// + public class StatementBuilder { + public const int SUGGESTED_PAGE_LIMIT = 500; + + private const string SELECT = "SELECT"; + private const string FROM = "FROM"; + private const string WHERE = "WHERE"; + private const string LIMIT = "LIMIT"; + private const string OFFSET = "OFFSET"; + private const string ORDER_BY = "ORDER BY"; + + protected string query; + protected string select; + protected string from; + protected string where; + protected int? limit = null; + protected int? offset = null; + protected string orderBy; + + /// + /// The list of query parameters. + /// + private List valueEntries; + + /// + /// Constructs a statement builder for partial query building. + /// + public StatementBuilder() { + valueEntries = new List(); + } + + /// + /// Constructs a statement builder with a complete query. + /// + /// The query string. + [Obsolete("Use partial query construction instead")] + public StatementBuilder(string query) { + this.query = query; + valueEntries = new List(); + } + + /// + /// Gets or sets the statement query. + /// + [Obsolete("Use partial query construction instead")] + public string Query { + get { + ValidateUsingCompleteQuery(); + return query; + } + set { + ValidateUsingCompleteQuery(); + query = value; + } + } + + /// + /// Removes a keyword from the start of a clause, if it exists. + /// + /// The clause to remove the keyword from + /// The keyword to remove + /// The clause with the keyword removed + private static string RemoveKeyword(string clause, string keyword) { + string formattedKeyword = keyword.Trim() + " "; + return clause.StartsWith(formattedKeyword, true, null) + ? clause.Substring(formattedKeyword.Length) : clause; + } + + private void ValidateUsingCompleteQuery() { + if (PartialQueryExists()) { + throw new InvalidOperationException(DfpErrorMessages.PartialQuerySet); + } + } + + private bool PartialQueryExists() { + return select != null + || from != null + || where != null + || limit != null + || offset != null + || orderBy != null; + } + + private void ValidateUsingPartialQuery() { + if (!String.IsNullOrEmpty(query)) { + throw new InvalidOperationException(DfpErrorMessages.CompleteQuerySet); + } + } + + /// + /// Sets the statement SELECT clause in the form of "a,b". + /// Only necessary for statements being sent to the + /// . + /// The "SELECT " keyword will be ignored. + /// + /// + /// The statement serlect clause without "SELECT". + /// + /// The statement builder, for chaining method calls. + public StatementBuilder Select(String columns) { + PreconditionUtilities.CheckArgumentNotNull(columns, "columns"); + ValidateUsingPartialQuery(); + this.select = RemoveKeyword(columns, SELECT); + return this; + } + + /// + /// Sets the statement FROM clause in the form of "table". + /// Only necessary for statements being sent to the + /// . + /// The "FROM " keyword will be ignored. + /// + /// The statement from clause without "FROM" + /// The statement builder, for chaining method calls. + public StatementBuilder From(String table) { + PreconditionUtilities.CheckArgumentNotNull(table, "table"); + ValidateUsingPartialQuery(); + this.from = RemoveKeyword(table, FROM); + return this; + } + + /// + /// Sets the statement WHERE clause in the form of + /// + /// "WHERE <condition> {[AND | OR] <condition> ...}" + /// + /// e.g. "a = b OR b = c". The "WHERE " keyword will be ignored. + /// + /// The statement query without "WHERE" + /// The statement builder, for chaining method calls. + public StatementBuilder Where(String conditions) { + PreconditionUtilities.CheckArgumentNotNull(conditions, "conditions"); + ValidateUsingPartialQuery(); + this.where = RemoveKeyword(conditions, WHERE); + return this; + } + + /// + /// Sets the statement LIMIT clause in the form of + /// "LIMIT <count>" + /// + /// the statement limit + /// The statement builder, for chaining method calls. + public StatementBuilder Limit(Int32 count) { + ValidateUsingPartialQuery(); + this.limit = count; + return this; + } + + /// + /// Sets the statement OFFSET clause in the form of + /// "OFFSET <count>" + /// + /// the statement offset + /// The statement builder, for chaining method calls. + public StatementBuilder Offset(Int32 count) { + ValidateUsingPartialQuery(); + this.offset = count; + return this; + } + + /// + /// Increases the offset by the given amount. + /// + /// the amount to increase the offset + /// The statement builder, for chaining method calls. + public StatementBuilder IncreaseOffsetBy(Int32 amount) { + ValidateUsingPartialQuery(); + if (this.offset == null) { + this.offset = 0; + } + this.offset += amount; + return this; + } + + /// + /// Gets the curent offset + /// + /// The current offset + public int? GetOffset() { + ValidateUsingPartialQuery(); + return this.offset; + } + + /// + /// Removes the limit and offset from the query. + /// + /// The statement builder, for chaining method calls. + public StatementBuilder RemoveLimitAndOffset() { + ValidateUsingPartialQuery(); + this.offset = null; + this.limit = null; + return this; + } + + /// + /// Sets the statement ORDER BY clause in the form of + /// "ORDER BY <property> [ASC | DESC]" + /// e.g. "type ASC, lastModifiedDateTime DESC". + /// The "ORDER BY " keyword will be ignored. + /// + /// the statement order by without "ORDER BY" + /// The statement builder, for chaining method calls. + public StatementBuilder OrderBy(String orderBy) { + PreconditionUtilities.CheckArgumentNotNull(orderBy, "orderBy"); + this.orderBy = RemoveKeyword(orderBy, ORDER_BY); + return this; + } + + /// + /// Adds a new string value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, string value) { + TextValue queryValue = new TextValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new boolean value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, bool value) { + BooleanValue queryValue = new BooleanValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new decimal value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, decimal value) { + NumberValue queryValue = new NumberValue(); + queryValue.value = value.ToString(); + return AddValue(key, queryValue); + } + + /// + /// Adds a new DateTime value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, DateTime value) { + DateTimeValue queryValue = new DateTimeValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new Date value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + public StatementBuilder AddValue(string key, Date value) { + DateValue queryValue = new DateValue(); + queryValue.value = value; + return AddValue(key, queryValue); + } + + /// + /// Adds a new value to the list of query parameters. + /// + /// The parameter name. + /// The parameter value. + /// The statement builder, for chaining method calls. + private StatementBuilder AddValue(string key, Value value) { + String_ValueMapEntry queryValue = new String_ValueMapEntry(); + queryValue.key = key; + queryValue.value = value; + valueEntries.Add(queryValue); + return this; + } + + private void ValidateQuery() { + if (limit == null && offset != null) { + throw new InvalidOperationException( + DfpErrorMessages.InvalidOffsetAndLimit); + } + } + + private String BuildQuery() { + ValidateQuery(); + StringBuilder stringBuilder = new StringBuilder(); + if (!String.IsNullOrEmpty(select)) { + stringBuilder = stringBuilder.Append(SELECT).Append(" ") + .Append(select).Append(" "); + } + if (!String.IsNullOrEmpty(from)) { + stringBuilder = stringBuilder.Append(FROM).Append(" ") + .Append(from).Append(" "); + } + if (!String.IsNullOrEmpty(where)) { + stringBuilder = stringBuilder.Append(WHERE).Append(" ") + .Append(where).Append(" "); + } + if (!String.IsNullOrEmpty(orderBy)) { + stringBuilder = stringBuilder.Append(ORDER_BY).Append(" ") + .Append(orderBy).Append(" "); + } + if (limit != null) { + stringBuilder = stringBuilder.Append(LIMIT).Append(" ") + .Append(limit).Append(" "); + } + if (offset != null) { + stringBuilder = stringBuilder.Append(OFFSET).Append(" ") + .Append(offset).Append(" "); + } + return stringBuilder.ToString().Trim(); + } + + /// + /// Gets the representing the state of this + /// statement builder. + /// + /// The statement. + public Statement ToStatement() { + Statement statement = new Statement(); + statement.query = !String.IsNullOrEmpty(query) ? query : BuildQuery(); + statement.values = valueEntries.ToArray(); + return statement; + } + } +} diff --git a/src/Dfp/v201208/DfpApi.cs b/src/Dfp/v201208/DfpApi.cs new file mode 100644 index 00000000000..d3be249d4b2 --- /dev/null +++ b/src/Dfp/v201208/DfpApi.cs @@ -0,0 +1,16747 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +namespace Google.Api.Ads.Dfp.v201208 { + using Google.Api.Ads.Dfp.Lib; + using Google.Api.Ads.Dfp.Headers; + using System; + using System.Web.Services; + using System.Diagnostics; + using System.Web.Services.Protocols; + using System.Xml.Serialization; + using System.ComponentModel; + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeSetServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeSetService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeSetService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/CreativeSetService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeSet createCreativeSet(CreativeSet creativeSet) { + object[] results = this.Invoke("createCreativeSet", new object[] { creativeSet }); + return ((CreativeSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeSet getCreativeSet(long creativeSetId) { + object[] results = this.Invoke("getCreativeSet", new object[] { creativeSetId }); + return ((CreativeSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeSetPage getCreativeSetsByStatement(Statement statement) { + object[] results = this.Invoke("getCreativeSetsByStatement", new object[] { statement }); + return ((CreativeSetPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeSet updateCreativeSet(CreativeSet creativeSet) { + object[] results = this.Invoke("updateCreativeSet", new object[] { creativeSet }); + return ((CreativeSet) (results[0])); + } + } + + + + + + + + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CreativeSetPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeSet[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeSet[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CreativeSet { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private long masterCreativeIdField; + + private bool masterCreativeIdFieldSpecified; + + private long[] companionCreativeIdsField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public long masterCreativeId { + get { return this.masterCreativeIdField; } + set { + this.masterCreativeIdField = value; + this.masterCreativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool masterCreativeIdSpecified { + get { return this.masterCreativeIdFieldSpecified; } + set { this.masterCreativeIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class Date { + private int yearField; + + private bool yearFieldSpecified; + + private int monthField; + + private bool monthFieldSpecified; + + private int dayField; + + private bool dayFieldSpecified; + + public int year { + get { return this.yearField; } + set { + this.yearField = value; + this.yearSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool yearSpecified { + get { return this.yearFieldSpecified; } + set { this.yearFieldSpecified = value; } + } + + public int month { + get { return this.monthField; } + set { + this.monthField = value; + this.monthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool monthSpecified { + get { return this.monthFieldSpecified; } + set { this.monthFieldSpecified = value; } + } + + public int day { + get { return this.dayField; } + set { + this.dayField = value; + this.daySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool daySpecified { + get { return this.dayFieldSpecified; } + set { this.dayFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DateTime { + private Date dateField; + + private int hourField; + + private bool hourFieldSpecified; + + private int minuteField; + + private bool minuteFieldSpecified; + + private int secondField; + + private bool secondFieldSpecified; + + private string timeZoneIDField; + + public Date date { + get { return this.dateField; } + set { this.dateField = value; } + } + + public int hour { + get { return this.hourField; } + set { + this.hourField = value; + this.hourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hourSpecified { + get { return this.hourFieldSpecified; } + set { this.hourFieldSpecified = value; } + } + + public int minute { + get { return this.minuteField; } + set { + this.minuteField = value; + this.minuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minuteSpecified { + get { return this.minuteFieldSpecified; } + set { this.minuteFieldSpecified = value; } + } + + public int second { + get { return this.secondField; } + set { + this.secondField = value; + this.secondSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool secondSpecified { + get { return this.secondFieldSpecified; } + set { this.secondFieldSpecified = value; } + } + + public string timeZoneID { + get { return this.timeZoneIDField; } + set { this.timeZoneIDField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TextValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NumberValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateTimeValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BooleanValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class Value { + private string valueTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Value.Type")] + public string ValueType { + get { return this.valueTypeField; } + set { this.valueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class TextValue : Value { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class NumberValue : Value { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DateTimeValue : Value { + private DateTime valueField; + + public DateTime value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class BooleanValue : Value { + private bool valueField; + + private bool valueFieldSpecified; + + public bool value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class String_ValueMapEntry { + private string keyField; + + private Value valueField; + + public string key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public Value value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class Statement { + private string queryField; + + private String_ValueMapEntry[] valuesField; + + public string query { + get { return this.queryField; } + set { this.queryField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("values")] + public String_ValueMapEntry[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UniqueError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TypeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TemplateInstantiatedCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringLengthError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StatementError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServerError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredSizeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredNumberError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredCollectionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RangeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(QuotaError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PublisherQueryLanguageSyntaxError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PublisherQueryLanguageContextError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PermissionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ParseError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NullError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NotNullError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LabelEntityAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidUrlError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidPhoneNumberError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InternalApiError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FileError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeatureError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EntityLimitReachedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeSetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeAssetMacroError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CommonError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AuthenticationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApiVersionError))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReservationDetailsError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RegExError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OrderError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OrderActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemOperationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemFlightDateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidEmailError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitHierarchyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitCodeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitAfcSizeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentPartnerError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserDomainTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TechnologyTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TeamError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemCreativeAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GeoTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GenericTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FrequencyCapError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ForecastError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DayPartTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateTimeRangeTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldValueError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CompanyCreditStatusError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClickTrackingLineItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceExtensionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReportError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitTypeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitSizesError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitPartnerAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidColorError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeWrapperError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseAccountError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeTemplateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CompanyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LabelError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemCreativeAssociationOperationError))] + public abstract partial class ApiError { + private string fieldPathField; + + private string triggerField; + + private string errorStringField; + + private string apiErrorTypeField; + + public string fieldPath { + get { return this.fieldPathField; } + set { this.fieldPathField = value; } + } + + public string trigger { + get { return this.triggerField; } + set { this.triggerField = value; } + } + + public string errorString { + get { return this.errorStringField; } + set { this.errorStringField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApiError.Type")] + public string ApiErrorType { + get { return this.apiErrorTypeField; } + set { this.apiErrorTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class UniqueError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class TypeError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class TemplateInstantiatedCreativeError : ApiError { + private TemplateInstantiatedCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TemplateInstantiatedCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TemplateInstantiatedCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum TemplateInstantiatedCreativeErrorReason { + INACTIVE_CREATIVE_TEMPLATE, + FILE_TYPE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class StringLengthError : ApiError { + private StringLengthErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StringLengthErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StringLengthError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum StringLengthErrorReason { + TOO_LONG, + TOO_SHORT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class StatementError : ApiError { + private StatementErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StatementErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StatementError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum StatementErrorReason { + VARIABLE_NOT_BOUND_TO_VALUE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ServerError : ApiError { + private ServerErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ServerErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ServerError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum ServerErrorReason { + SERVER_ERROR, + SERVER_BUSY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class RichMediaStudioCreativeError : ApiError { + private RichMediaStudioCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RichMediaStudioCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaStudioCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum RichMediaStudioCreativeErrorReason { + CREATION_NOT_ALLOWED, + UKNOWN_ERROR, + INVALID_CODE_GENERATION_REQUEST, + INVALID_CREATIVE_OBJECT, + STUDIO_CONNECTION_ERROR, + PUSHDOWN_DURATION_NOT_ALLOWED, + INVALID_POSITION, + INVALID_Z_INDEX, + INVALID_PUSHDOWN_DURATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class RequiredSizeError : ApiError { + private RequiredSizeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredSizeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredSizeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum RequiredSizeErrorReason { + REQUIRED, + NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class RequiredNumberError : ApiError { + private RequiredNumberErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredNumberErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredNumberError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum RequiredNumberErrorReason { + REQUIRED, + TOO_LARGE, + TOO_SMALL, + TOO_LARGE_WITH_DETAILS, + TOO_SMALL_WITH_DETAILS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class RequiredError : ApiError { + private RequiredErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum RequiredErrorReason { + REQUIRED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class RequiredCollectionError : ApiError { + private RequiredCollectionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredCollectionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredCollectionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum RequiredCollectionErrorReason { + REQUIRED, + TOO_LARGE, + TOO_SMALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class RangeError : ApiError { + private RangeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RangeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RangeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum RangeErrorReason { + TOO_HIGH, + TOO_LOW, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class QuotaError : ApiError { + private QuotaErrorReason reasonField; + + private bool reasonFieldSpecified; + + public QuotaErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "QuotaError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum QuotaErrorReason { + EXCEEDED_QUOTA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class PublisherQueryLanguageSyntaxError : ApiError { + private PublisherQueryLanguageSyntaxErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PublisherQueryLanguageSyntaxErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PublisherQueryLanguageSyntaxError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum PublisherQueryLanguageSyntaxErrorReason { + UNPARSABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class PublisherQueryLanguageContextError : ApiError { + private PublisherQueryLanguageContextErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PublisherQueryLanguageContextErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PublisherQueryLanguageContextError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum PublisherQueryLanguageContextErrorReason { + UNEXECUTABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class PermissionError : ApiError { + private PermissionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PermissionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PermissionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum PermissionErrorReason { + PERMISSION_DENIED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ParseError : ApiError { + private ParseErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ParseErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ParseError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum ParseErrorReason { + UNPARSABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class NullError : ApiError { + private NullErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NullErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NullError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum NullErrorReason { + NULL_CONTENT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class NotNullError : ApiError { + private NotNullErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NotNullErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NotNullError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum NotNullErrorReason { + ARG1_NULL, + ARG2_NULL, + ARG3_NULL, + NULL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class LabelEntityAssociationError : ApiError { + private LabelEntityAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LabelEntityAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LabelEntityAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum LabelEntityAssociationErrorReason { + INVALID_COMPANY_TYPE, + DUPLICATE_ASSOCIATION, + INVALID_ASSOCIATION, + DUPLICATE_ASSOCIATION_WITH_NEGATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class InvalidUrlError : ApiError { + private InvalidUrlErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidUrlErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidUrlError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum InvalidUrlErrorReason { + ILLEGAL_CHARACTERS, + INVALID_FORMAT, + INSECURE_SCHEME, + NO_SCHEME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class InvalidPhoneNumberError : ApiError { + private InvalidPhoneNumberErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidPhoneNumberErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidPhoneNumberError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum InvalidPhoneNumberErrorReason { + INVALID_FORMAT, + TOO_SHORT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class InternalApiError : ApiError { + private InternalApiErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InternalApiErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InternalApiError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum InternalApiErrorReason { + UNEXPECTED_INTERNAL_API_ERROR, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ImageError : ApiError { + private ImageErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ImageErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ImageError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum ImageErrorReason { + INVALID_IMAGE, + INVALID_SIZE, + UNEXPECTED_SIZE, + ANIMATED_NOT_ALLOWED, + ANIMATION_TOO_LONG, + CMYK_JPEG_NOT_ALLOWED, + FLASH_NOT_ALLOWED, + FLASH_WITHOUT_CLICKTAG, + ANIMATED_VISUAL_EFFECT, + FLASH_ERROR, + LAYOUT_PROBLEM, + FLASH_HAS_NETWORK_OBJECTS, + FLASH_HAS_NETWORK_METHODS, + FLASH_HAS_URL, + FLASH_HAS_MOUSE_TRACKING, + FLASH_HAS_RANDOM_NUM, + FLASH_SELF_TARGETS, + FLASH_BAD_GETURL_TARGET, + FLASH_VERSION_NOT_SUPPORTED, + FILE_TOO_LARGE, + SYSTEM_ERROR, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class FileError : ApiError { + private FileErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FileErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FileError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum FileErrorReason { + MISSING_CONTENTS, + SIZE_TOO_LARGE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class FeatureError : ApiError { + private FeatureErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FeatureErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeatureError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum FeatureErrorReason { + MISSING_FEATURE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class EntityLimitReachedError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CustomCreativeError : ApiError { + private CustomCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CustomCreativeErrorReason { + DUPLICATE_MACRO_NAME_FOR_CREATIVE, + SNIPPET_REFERENCES_MISSING_MACRO, + UNRECOGNIZED_MACRO, + CUSTOM_CREATIVE_NOT_ALLOWED, + MISSING_INTERSTITIAL_MACRO, + DUPLICATE_ASSET_IN_MACROS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CreativeSetError : ApiError { + private CreativeSetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeSetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeSetError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CreativeSetErrorReason { + VIDEO_FEATURE_REQUIRED, + CANNOT_CREATE_OR_UPDATE_VIDEO_CREATIVES, + ROADBLOCK_FEATURE_REQUIRED, + MASTER_CREATIVE_CANNOT_BE_COMPANION, + VIDEO_CREATIVE_NOT_ALLOWED, + INVALID_ADVERTISER, + UPDATE_MASTER_CREATIVE_NOT_ALLOWED, + MASTER_CREATIVE_DOES_NOT_BELONG_TO_CREATIVE_SET, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CreativeError : ApiError { + private CreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CreativeErrorReason { + FLASH_AND_FALLBACK_URL_ARE_SAME, + INVALID_INTERNAL_REDIRECT_URL, + DESTINATION_URL_REQUIRED, + CANNOT_CREATE_OR_UPDATE_LEGACY_DFP_CREATIVE, + CANNOT_CREATE_OR_UPDATE_LEGACY_DFP_MOBILE_CREATIVE, + MISSING_FEATURE, + INVALID_COMPANY_TYPE, + INVALID_ADSENSE_CREATIVE_SIZE, + INVALID_AD_EXCHANGE_CREATIVE_SIZE, + DUPLICATE_ASSET_IN_CREATIVE, + CREATIVE_ASSET_CANNOT_HAVE_ID_AND_BYTE_ARRAY, + CANNOT_CREATE_OR_UPDATE_UNSUPPORTED_CREATIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CreativeAssetMacroError : ApiError { + private CreativeAssetMacroErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeAssetMacroErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeAssetMacroError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CreativeAssetMacroErrorReason { + INVALID_MACRO_NAME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CommonError : ApiError { + private CommonErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CommonErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CommonError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CommonErrorReason { + NOT_FOUND, + ALREADY_EXISTS, + DUPLICATE_OBJECT, + CANNOT_UPDATE, + CONCURRENT_MODIFICATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AuthenticationError : ApiError { + private AuthenticationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AuthenticationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AuthenticationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum AuthenticationErrorReason { + AMBIGUOUS_SOAP_REQUEST_HEADER, + INVALID_EMAIL, + AUTHENTICATION_FAILED, + INVALID_OAUTH_SIGNATURE, + INVALID_SERVICE, + MISSING_SOAP_REQUEST_HEADER, + MISSING_AUTHENTICATION_HTTP_HEADER, + MISSING_AUTHENTICATION, + NOT_WHITELISTED_FOR_API_ACCESS, + NO_NETWORKS_TO_ACCESS, + NETWORK_NOT_FOUND, + NETWORK_CODE_REQUIRED, + CONNECTION_ERROR, + GOOGLE_ACCOUNT_ALREADY_ASSOCIATED_WITH_NETWORK, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AssetError : ApiError { + private AssetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AssetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AssetError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum AssetErrorReason { + NON_UNIQUE_NAME, + FILE_NAME_TOO_LONG, + FILE_SIZE_TOO_LARGE, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_CLIENT, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_HEIGHT, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_WIDTH, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_FORMAT, + INVALID_CODE_SNIPPET_PARAMETER_VALUE, + INVALID_ASSET_ID, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ApiVersionError : ApiError { + private ApiVersionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ApiVersionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ApiVersionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum ApiVersionErrorReason { + UPDATE_TO_NEWER_VERSION, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApiException))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ApplicationException { + private string messageField; + + private string applicationExceptionTypeField; + + public string message { + get { return this.messageField; } + set { this.messageField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApplicationException.Type")] + public string ApplicationExceptionType { + get { return this.applicationExceptionTypeField; } + set { this.applicationExceptionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ApiException : ApplicationException { + private ApiError[] errorsField; + + [System.Xml.Serialization.XmlElementAttribute("errors")] + public ApiError[] errors { + get { return this.errorsField; } + set { this.errorsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OAuth))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClientLogin))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class Authentication { + private string authenticationTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Authentication.Type")] + public string AuthenticationType { + get { return this.authenticationTypeField; } + set { this.authenticationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class OAuth : Authentication { + private string parametersField; + + public string parameters { + get { return this.parametersField; } + set { this.parametersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ClientLogin : Authentication { + private string tokenField; + + public string token { + get { return this.tokenField; } + set { this.tokenField = value; } + } + } + + + + + + + + + + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "PublisherQueryLanguageServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class PublisherQueryLanguageService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public PublisherQueryLanguageService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/PublisherQueryLanguageService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ResultSet select(Statement selectStatement) { + object[] results = this.Invoke("select", new object[] { selectStatement }); + return ((ResultSet) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class Row { + private Value[] valuesField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("values")] + public Value[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ColumnType { + private string labelNameField; + + public string labelName { + get { return this.labelNameField; } + set { this.labelNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ResultSet { + private ColumnType[] columnTypesField; + + private Row[] rowsField; + + [System.Xml.Serialization.XmlElementAttribute("columnTypes")] + public ColumnType[] columnTypes { + get { return this.columnTypesField; } + set { this.columnTypesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("rows")] + public Row[] rows { + get { return this.rowsField; } + set { this.rowsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ReservationDetailsError : ApiError { + private ReservationDetailsErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReservationDetailsErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReservationDetailsError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum ReservationDetailsErrorReason { + UNLIMITED_UNITS_BOUGHT_NOT_ALLOWED, + UNLIMITED_END_DATE_TIME_NOT_ALLOWED, + PERCENTAGE_UNITS_BOUGHT_TOO_HIGH, + DURATION_NOT_ALLOWED, + UNIT_TYPE_NOT_ALLOWED, + COST_TYPE_NOT_ALLOWED, + COST_TYPE_UNIT_TYPE_MISMATCH_NOT_ALLOWED, + LINE_ITEM_TYPE_NOT_ALLOWED, + NETWORK_REMNANT_ORDER_CANNOT_UPDATE_LINEITEM_TYPE, + BACKFILL_WEBPROPERTY_CODE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class RegExError : ApiError { + private RegExErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RegExErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RegExError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum RegExErrorReason { + INVALID, + NULL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class OrderError : ApiError { + private OrderErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OrderErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OrderError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum OrderErrorReason { + UPDATE_CANCELED_ORDER_NOT_ALLOWED, + UPDATE_PENDING_APPROVAL_ORDER_NOT_ALLOWED, + UPDATE_ARCHIVED_ORDER_NOT_ALLOWED, + CANNOT_MODIFY_PROPOSAL_ID, + PRIMARY_USER_REQUIRED, + PRIMARY_USER_CANNOT_BE_SECONDARY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class OrderActionError : ApiError { + private OrderActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OrderActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OrderActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum OrderActionErrorReason { + PERMISSION_DENIED, + NOT_APPLICABLE, + IS_ARCHIVED, + HAS_ENDED, + CANNOT_APPROVE_WITH_UNRESERVED_LINE_ITEMS, + CANNOT_DELETE_ORDER_WITH_DELIVERED_LINEITEMS, + CANNOT_APPROVE_COMPANY_CREDIT_STATUS_NOT_ACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class LineItemOperationError : ApiError { + private LineItemOperationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemOperationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemOperationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum LineItemOperationErrorReason { + NOT_ALLOWED, + NOT_APPLICABLE, + HAS_COMPLETED, + HAS_NO_ACTIVE_CREATIVES, + CANNOT_ACTIVATE_LEGACY_DFP_LINE_ITEM, + CANNOT_DELETE_DELIVERED_LINE_ITEM, + CANNOT_RESERVE_COMPANY_CREDIT_STATUS_NOT_ACTIVE, + CANNOT_ACTIVATE_INVALID_COMPANY_CREDIT_STATUS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class LineItemFlightDateError : ApiError { + private LineItemFlightDateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemFlightDateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemFlightDateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum LineItemFlightDateErrorReason { + START_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_NOT_AFTER_START_TIME, + END_DATE_TIME_TOO_LATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class InventoryUnitError : ApiError { + private InventoryUnitErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum InventoryUnitErrorReason { + EXPLICIT_TARGETING_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class InventoryTargetingError : ApiError { + private InventoryTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum InventoryTargetingErrorReason { + AT_LEAST_ONE_PLACEMENT_OR_INVENTORY_UNIT_REQUIRED, + INVENTORY_CANNOT_BE_TARGETED_AND_EXCLUDED, + PARENT_CONTAINS_INVALID_MIX_OF_TARGETED_AND_EXCLUDED_AD_UNITS, + INVENTORY_EXCLUSIONS_MUST_HAVE_PARENT_INVENTORY_UNIT, + INVENTORY_UNIT_CANNOT_BE_TARGETED_IF_ANCESTOR_IS_TARGETED, + INVENTORY_UNIT_CANNOT_BE_TARGETED_IF_ANCESTOR_IS_EXCLUDED, + INVENTORY_UNIT_CANNOT_BE_EXCLUDED_IF_ANCESTOR_IS_EXCLUDED, + EXPLICITLY_TARGETED_INVENTORY_UNIT_CANNOT_BE_TARGETED, + EXPLICITLY_TARGETED_INVENTORY_UNIT_CANNOT_BE_EXCLUDED, + SELF_ONLY_INVENTORY_UNIT_NOT_ALLOWED, + SELF_ONLY_INVENTORY_UNIT_WITHOUT_DESCENDANTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class InvalidEmailError : ApiError { + private InvalidEmailErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidEmailErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidEmailError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum InvalidEmailErrorReason { + INVALID_FORMAT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AdUnitHierarchyError : ApiError { + private AdUnitHierarchyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitHierarchyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitHierarchyError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum AdUnitHierarchyErrorReason { + INVALID_DEPTH, + INVALID_PARENT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AdUnitCodeError : ApiError { + private AdUnitCodeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitCodeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitCodeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum AdUnitCodeErrorReason { + INVALID_CHARACTERS, + INVALID_CHARACTERS_WHEN_UTF_CHARACTERS_ARE_ALLOWED, + LEADING_FORWARD_SLASH, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AdUnitAfcSizeError : ApiError { + private AdUnitAfcSizeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitAfcSizeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitAfcSizeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum AdUnitAfcSizeErrorReason { + INVALID, + DOESNT_FIT, + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomTargetingServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomTargetingService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomTargetingService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/CustomTargetingService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomTargetingKey[] createCustomTargetingKeys([System.Xml.Serialization.XmlElementAttribute("keys")] +CustomTargetingKey[] keys) { + object[] results = this.Invoke("createCustomTargetingKeys", new object[] { keys }); + return ((CustomTargetingKey[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomTargetingValue[] createCustomTargetingValues([System.Xml.Serialization.XmlElementAttribute("values")] +CustomTargetingValue[] values) { + object[] results = this.Invoke("createCustomTargetingValues", new object[] { values }); + return ((CustomTargetingValue[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomTargetingKeyPage getCustomTargetingKeysByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomTargetingKeysByStatement", new object[] { filterStatement }); + return ((CustomTargetingKeyPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomTargetingValuePage getCustomTargetingValuesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomTargetingValuesByStatement", new object[] { filterStatement }); + return ((CustomTargetingValuePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performCustomTargetingKeyAction(CustomTargetingKeyAction customTargetingKeyAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomTargetingKeyAction", new object[] { customTargetingKeyAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performCustomTargetingValueAction(CustomTargetingValueAction customTargetingValueAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomTargetingValueAction", new object[] { customTargetingValueAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomTargetingKey[] updateCustomTargetingKeys([System.Xml.Serialization.XmlElementAttribute("keys")] +CustomTargetingKey[] keys) { + object[] results = this.Invoke("updateCustomTargetingKeys", new object[] { keys }); + return ((CustomTargetingKey[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomTargetingValue[] updateCustomTargetingValues([System.Xml.Serialization.XmlElementAttribute("values")] +CustomTargetingValue[] values) { + object[] results = this.Invoke("updateCustomTargetingValues", new object[] { values }); + return ((CustomTargetingValue[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteCustomTargetingValues))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class CustomTargetingValueAction { + private string customTargetingValueActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomTargetingValueAction.Type")] + public string CustomTargetingValueActionType { + get { return this.customTargetingValueActionTypeField; } + set { this.customTargetingValueActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DeleteCustomTargetingValues : CustomTargetingValueAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class UpdateResult { + private int numChangesField; + + private bool numChangesFieldSpecified; + + public int numChanges { + get { return this.numChangesField; } + set { + this.numChangesField = value; + this.numChangesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numChangesSpecified { + get { return this.numChangesFieldSpecified; } + set { this.numChangesFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteCustomTargetingKeys))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class CustomTargetingKeyAction { + private string customTargetingKeyActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomTargetingKeyAction.Type")] + public string CustomTargetingKeyActionType { + get { return this.customTargetingKeyActionTypeField; } + set { this.customTargetingKeyActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DeleteCustomTargetingKeys : CustomTargetingKeyAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CustomTargetingValuePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomTargetingValue[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomTargetingValue[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CustomTargetingValue { + private long customTargetingKeyIdField; + + private bool customTargetingKeyIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string displayNameField; + + private CustomTargetingValueMatchType matchTypeField; + + private bool matchTypeFieldSpecified; + + public long customTargetingKeyId { + get { return this.customTargetingKeyIdField; } + set { + this.customTargetingKeyIdField = value; + this.customTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customTargetingKeyIdSpecified { + get { return this.customTargetingKeyIdFieldSpecified; } + set { this.customTargetingKeyIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public CustomTargetingValueMatchType matchType { + get { return this.matchTypeField; } + set { + this.matchTypeField = value; + this.matchTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool matchTypeSpecified { + get { return this.matchTypeFieldSpecified; } + set { this.matchTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingValue.MatchType", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CustomTargetingValueMatchType { + EXACT, + BROAD, + PREFIX, + BROAD_PREFIX + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CustomTargetingKeyPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomTargetingKey[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomTargetingKey[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CustomTargetingKey { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string displayNameField; + + private CustomTargetingKeyType typeField; + + private bool typeFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public CustomTargetingKeyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingKey.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CustomTargetingKeyType { + PREDEFINED, + FREEFORM + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CustomTargetingError : ApiError { + private CustomTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CustomTargetingErrorReason { + KEY_NOT_FOUND, + KEY_COUNT_TOO_LARGE, + KEY_NAME_DUPLICATE, + KEY_NAME_EMPTY, + KEY_NAME_INVALID_LENGTH, + KEY_NAME_INVALID_CHARS, + KEY_NAME_RESERVED, + KEY_DISPLAY_NAME_INVALID_LENGTH, + VALUE_NOT_FOUND, + GET_VALUES_BY_STATEMENT_MUST_CONTAIN_KEY_ID, + VALUE_COUNT_FOR_KEY_TOO_LARGE, + VALUE_NAME_DUPLICATE, + VALUE_NAME_EMPTY, + VALUE_NAME_INVALID_LENGTH, + VALUE_NAME_INVALID_CHARS, + VALUE_DISPLAY_NAME_INVALID_LENGTH, + VALUE_MATCH_TYPE_NOT_ALLOWED, + VALUE_MATCH_TYPE_NOT_EXACT_FOR_PREDEFINED_KEY, + KEY_WITH_MISSING_VALUES, + CANNOT_OR_DIFFERENT_KEYS, + INVALID_TARGETING_EXPRESSION, + DELETED_KEY_CANNOT_BE_USED_FOR_TARGETING, + DELETED_VALUE_CANNOT_BE_USED_FOR_TARGETING, + VIDEO_BROWSE_BY_KEY_CANNOT_BE_USED_FOR_CUSTOM_TARGETING, + CANNOT_TARGET_AUDIENCE_SEGMENT, + CANNOT_TARGET_INACTIVE_AUDIENCE_SEGMENT, + INVALID_AUDIENCE_SEGMENTS, + ONLY_APPROVED_AUDIENCE_SEGMENTS_CAN_BE_TARGETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ContentServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ContentService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ContentService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/ContentService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ContentPage getContentByStatement(Statement statement) { + object[] results = this.Invoke("getContentByStatement", new object[] { statement }); + return ((ContentPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ContentPage getContentByStatementAndCustomTargetingValue(Statement filterStatement, long customTargetingValueId) { + object[] results = this.Invoke("getContentByStatementAndCustomTargetingValue", new object[] { filterStatement, customTargetingValueId }); + return ((ContentPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ContentPage getUncategorizedContentByStatement(Statement filterStatement) { + object[] results = this.Invoke("getUncategorizedContentByStatement", new object[] { filterStatement }); + return ((ContentPage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class Content { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private ContentStatus statusField; + + private bool statusFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ContentStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum ContentStatus { + ACTIVE, + INACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ContentPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Content[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Content[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ContentPartnerError : ApiError { + private ContentPartnerErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ContentPartnerErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ContentPartnerError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum ContentPartnerErrorReason { + FEATURE_NOT_ENABLED, + INVALID_PARTNER_TYPE, + NO_PARTNER_CATCH_ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ThirdPartySlotServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ThirdPartySlotService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ThirdPartySlotService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/ThirdPartySlotService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ThirdPartySlot createThirdPartySlot(ThirdPartySlot thirdPartySlot) { + object[] results = this.Invoke("createThirdPartySlot", new object[] { thirdPartySlot }); + return ((ThirdPartySlot) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ThirdPartySlotPage getThirdPartySlotsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getThirdPartySlotsByStatement", new object[] { filterStatement }); + return ((ThirdPartySlotPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performThirdPartySlotAction(ThirdPartySlotAction thirdPartySlotAction, Statement filterStatement) { + object[] results = this.Invoke("performThirdPartySlotAction", new object[] { thirdPartySlotAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ThirdPartySlot updateThirdPartySlot(ThirdPartySlot thirdPartySlot) { + object[] results = this.Invoke("updateThirdPartySlot", new object[] { thirdPartySlot }); + return ((ThirdPartySlot) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveThirdPartySlots))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateThirdPartySlots))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class ThirdPartySlotAction { + private string thirdPartySlotActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ThirdPartySlotAction.Type")] + public string ThirdPartySlotActionType { + get { return this.thirdPartySlotActionTypeField; } + set { this.thirdPartySlotActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ArchiveThirdPartySlots : ThirdPartySlotAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ActivateThirdPartySlots : ThirdPartySlotAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ThirdPartySlotPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ThirdPartySlot[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ThirdPartySlot[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ThirdPartySlot { + private long idField; + + private bool idFieldSpecified; + + private long[] creativeIdsField; + + private long companyIdField; + + private bool companyIdFieldSpecified; + + private string externalUniqueIdField; + + private string externalUniqueNameField; + + private string descriptionField; + + private ThirdPartySlotStatus statusField; + + private bool statusFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativeIds")] + public long[] creativeIds { + get { return this.creativeIdsField; } + set { this.creativeIdsField = value; } + } + + public long companyId { + get { return this.companyIdField; } + set { + this.companyIdField = value; + this.companyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companyIdSpecified { + get { return this.companyIdFieldSpecified; } + set { this.companyIdFieldSpecified = value; } + } + + public string externalUniqueId { + get { return this.externalUniqueIdField; } + set { this.externalUniqueIdField = value; } + } + + public string externalUniqueName { + get { return this.externalUniqueNameField; } + set { this.externalUniqueNameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public ThirdPartySlotStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ThirdPartySlot.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum ThirdPartySlotStatus { + ACTIVE, + ARCHIVED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LineItemServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LineItemService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LineItemService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/LineItemService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItem createLineItem(LineItem lineItem) { + object[] results = this.Invoke("createLineItem", new object[] { lineItem }); + return ((LineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItem[] createLineItems([System.Xml.Serialization.XmlElementAttribute("lineItems")] +LineItem[] lineItems) { + object[] results = this.Invoke("createLineItems", new object[] { lineItems }); + return ((LineItem[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItem getLineItem(long lineItemId) { + object[] results = this.Invoke("getLineItem", new object[] { lineItemId }); + return ((LineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItemPage getLineItemsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLineItemsByStatement", new object[] { filterStatement }); + return ((LineItemPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performLineItemAction(LineItemAction lineItemAction, Statement filterStatement) { + object[] results = this.Invoke("performLineItemAction", new object[] { lineItemAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItem updateLineItem(LineItem lineItem) { + object[] results = this.Invoke("updateLineItem", new object[] { lineItem }); + return ((LineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItem[] updateLineItems([System.Xml.Serialization.XmlElementAttribute("lineItems")] +LineItem[] lineItems) { + object[] results = this.Invoke("updateLineItems", new object[] { lineItems }); + return ((LineItem[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveAndOverbookLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReleaseLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PauseLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class LineItemAction { + private string lineItemActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LineItemAction.Type")] + public string LineItemActionType { + get { return this.lineItemActionTypeField; } + set { this.lineItemActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class UnarchiveLineItems : LineItemAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ResumeLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ResumeAndOverbookLineItems : ResumeLineItems { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveAndOverbookLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ReserveLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ReserveAndOverbookLineItems : ReserveLineItems { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ReleaseLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class PauseLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DeleteLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ArchiveLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ActivateLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class LineItemPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LineItem[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LineItem[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class LineItem : LineItemSummary { + private Targeting targetingField; + + public Targeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class Targeting { + private GeoTargeting geoTargetingField; + + private InventoryTargeting inventoryTargetingField; + + private DayPartTargeting dayPartTargetingField; + + private TechnologyTargeting technologyTargetingField; + + private CustomCriteriaSet customTargetingField; + + private UserDomainTargeting userDomainTargetingField; + + private ContentTargeting contentTargetingField; + + private VideoPositionTargeting videoPositionTargetingField; + + public GeoTargeting geoTargeting { + get { return this.geoTargetingField; } + set { this.geoTargetingField = value; } + } + + public InventoryTargeting inventoryTargeting { + get { return this.inventoryTargetingField; } + set { this.inventoryTargetingField = value; } + } + + public DayPartTargeting dayPartTargeting { + get { return this.dayPartTargetingField; } + set { this.dayPartTargetingField = value; } + } + + public TechnologyTargeting technologyTargeting { + get { return this.technologyTargetingField; } + set { this.technologyTargetingField = value; } + } + + public CustomCriteriaSet customTargeting { + get { return this.customTargetingField; } + set { this.customTargetingField = value; } + } + + public UserDomainTargeting userDomainTargeting { + get { return this.userDomainTargetingField; } + set { this.userDomainTargetingField = value; } + } + + public ContentTargeting contentTargeting { + get { return this.contentTargetingField; } + set { this.contentTargetingField = value; } + } + + public VideoPositionTargeting videoPositionTargeting { + get { return this.videoPositionTargetingField; } + set { this.videoPositionTargetingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class GeoTargeting { + private Location[] targetedLocationsField; + + private Location[] excludedLocationsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedLocations")] + public Location[] targetedLocations { + get { return this.targetedLocationsField; } + set { this.targetedLocationsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedLocations")] + public Location[] excludedLocations { + get { return this.excludedLocationsField; } + set { this.excludedLocationsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RegionLocation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PostalCodeLocation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MetroLocation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CountryLocation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CityLocation))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class Location { + private long idField; + + private bool idFieldSpecified; + + private string locationTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Location.Type")] + public string LocationType { + get { return this.locationTypeField; } + set { this.locationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class RegionLocation : Location { + private string regionCodeField; + + public string regionCode { + get { return this.regionCodeField; } + set { this.regionCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class PostalCodeLocation : Location { + private string postalCodeField; + + private string countryCodeField; + + public string postalCode { + get { return this.postalCodeField; } + set { this.postalCodeField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class MetroLocation : Location { + private string metroCodeField; + + private string countryCodeField; + + public string metroCode { + get { return this.metroCodeField; } + set { this.metroCodeField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CountryLocation : Location { + private string countryCodeField; + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CityLocation : Location { + private string cityNameField; + + private string regionCodeField; + + private string countryCodeField; + + public string cityName { + get { return this.cityNameField; } + set { this.cityNameField = value; } + } + + public string regionCode { + get { return this.regionCodeField; } + set { this.regionCodeField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class InventoryTargeting { + private AdUnitTargeting[] targetedAdUnitsField; + + private AdUnitTargeting[] excludedAdUnitsField; + + private long[] targetedPlacementIdsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedAdUnits")] + public AdUnitTargeting[] targetedAdUnits { + get { return this.targetedAdUnitsField; } + set { this.targetedAdUnitsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedAdUnits")] + public AdUnitTargeting[] excludedAdUnits { + get { return this.excludedAdUnitsField; } + set { this.excludedAdUnitsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedPlacementIds")] + public long[] targetedPlacementIds { + get { return this.targetedPlacementIdsField; } + set { this.targetedPlacementIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AdUnitTargeting { + private string adUnitIdField; + + private bool includeDescendantsField; + + private bool includeDescendantsFieldSpecified; + + public string adUnitId { + get { return this.adUnitIdField; } + set { this.adUnitIdField = value; } + } + + public bool includeDescendants { + get { return this.includeDescendantsField; } + set { + this.includeDescendantsField = value; + this.includeDescendantsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeDescendantsSpecified { + get { return this.includeDescendantsFieldSpecified; } + set { this.includeDescendantsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DayPartTargeting { + private DayPart[] dayPartsField; + + private DeliveryTimeZone timeZoneField; + + private bool timeZoneFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("dayParts")] + public DayPart[] dayParts { + get { return this.dayPartsField; } + set { this.dayPartsField = value; } + } + + public DeliveryTimeZone timeZone { + get { return this.timeZoneField; } + set { + this.timeZoneField = value; + this.timeZoneSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool timeZoneSpecified { + get { return this.timeZoneFieldSpecified; } + set { this.timeZoneFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DayPart { + private DayOfWeek dayOfWeekField; + + private bool dayOfWeekFieldSpecified; + + private TimeOfDay startTimeField; + + private TimeOfDay endTimeField; + + public DayOfWeek dayOfWeek { + get { return this.dayOfWeekField; } + set { + this.dayOfWeekField = value; + this.dayOfWeekSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dayOfWeekSpecified { + get { return this.dayOfWeekFieldSpecified; } + set { this.dayOfWeekFieldSpecified = value; } + } + + public TimeOfDay startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public TimeOfDay endTime { + get { return this.endTimeField; } + set { this.endTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum DayOfWeek { + MONDAY, + TUESDAY, + WEDNESDAY, + THURSDAY, + FRIDAY, + SATURDAY, + SUNDAY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class TimeOfDay { + private int hourField; + + private bool hourFieldSpecified; + + private MinuteOfHour minuteField; + + private bool minuteFieldSpecified; + + public int hour { + get { return this.hourField; } + set { + this.hourField = value; + this.hourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hourSpecified { + get { return this.hourFieldSpecified; } + set { this.hourFieldSpecified = value; } + } + + public MinuteOfHour minute { + get { return this.minuteField; } + set { + this.minuteField = value; + this.minuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minuteSpecified { + get { return this.minuteFieldSpecified; } + set { this.minuteFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum MinuteOfHour { + ZERO, + FIFTEEN, + THIRTY, + FORTY_FIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum DeliveryTimeZone { + PUBLISHER, + BROWSER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class TechnologyTargeting { + private BandwidthGroupTargeting bandwidthGroupTargetingField; + + private BrowserTargeting browserTargetingField; + + private BrowserLanguageTargeting browserLanguageTargetingField; + + private DeviceCapabilityTargeting deviceCapabilityTargetingField; + + private DeviceCategoryTargeting deviceCategoryTargetingField; + + private DeviceManufacturerTargeting deviceManufacturerTargetingField; + + private MobileCarrierTargeting mobileCarrierTargetingField; + + private MobileDeviceTargeting mobileDeviceTargetingField; + + private MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargetingField; + + private OperatingSystemTargeting operatingSystemTargetingField; + + private OperatingSystemVersionTargeting operatingSystemVersionTargetingField; + + public BandwidthGroupTargeting bandwidthGroupTargeting { + get { return this.bandwidthGroupTargetingField; } + set { this.bandwidthGroupTargetingField = value; } + } + + public BrowserTargeting browserTargeting { + get { return this.browserTargetingField; } + set { this.browserTargetingField = value; } + } + + public BrowserLanguageTargeting browserLanguageTargeting { + get { return this.browserLanguageTargetingField; } + set { this.browserLanguageTargetingField = value; } + } + + public DeviceCapabilityTargeting deviceCapabilityTargeting { + get { return this.deviceCapabilityTargetingField; } + set { this.deviceCapabilityTargetingField = value; } + } + + public DeviceCategoryTargeting deviceCategoryTargeting { + get { return this.deviceCategoryTargetingField; } + set { this.deviceCategoryTargetingField = value; } + } + + public DeviceManufacturerTargeting deviceManufacturerTargeting { + get { return this.deviceManufacturerTargetingField; } + set { this.deviceManufacturerTargetingField = value; } + } + + public MobileCarrierTargeting mobileCarrierTargeting { + get { return this.mobileCarrierTargetingField; } + set { this.mobileCarrierTargetingField = value; } + } + + public MobileDeviceTargeting mobileDeviceTargeting { + get { return this.mobileDeviceTargetingField; } + set { this.mobileDeviceTargetingField = value; } + } + + public MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargeting { + get { return this.mobileDeviceSubmodelTargetingField; } + set { this.mobileDeviceSubmodelTargetingField = value; } + } + + public OperatingSystemTargeting operatingSystemTargeting { + get { return this.operatingSystemTargetingField; } + set { this.operatingSystemTargetingField = value; } + } + + public OperatingSystemVersionTargeting operatingSystemVersionTargeting { + get { return this.operatingSystemVersionTargetingField; } + set { this.operatingSystemVersionTargetingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class BandwidthGroupTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] bandwidthGroupsField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("bandwidthGroups")] + public Technology[] bandwidthGroups { + get { return this.bandwidthGroupsField; } + set { this.bandwidthGroupsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystemVersion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystem))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileDeviceSubmodel))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileDevice))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileCarrier))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceManufacturer))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceCategory))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceCapability))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BrowserLanguage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Browser))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BandwidthGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class Technology { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string technologyTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Technology.Type")] + public string TechnologyType { + get { return this.technologyTypeField; } + set { this.technologyTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class OperatingSystemVersion : Technology { + private int majorVersionField; + + private bool majorVersionFieldSpecified; + + private int minorVersionField; + + private bool minorVersionFieldSpecified; + + private int microVersionField; + + private bool microVersionFieldSpecified; + + public int majorVersion { + get { return this.majorVersionField; } + set { + this.majorVersionField = value; + this.majorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool majorVersionSpecified { + get { return this.majorVersionFieldSpecified; } + set { this.majorVersionFieldSpecified = value; } + } + + public int minorVersion { + get { return this.minorVersionField; } + set { + this.minorVersionField = value; + this.minorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minorVersionSpecified { + get { return this.minorVersionFieldSpecified; } + set { this.minorVersionFieldSpecified = value; } + } + + public int microVersion { + get { return this.microVersionField; } + set { + this.microVersionField = value; + this.microVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool microVersionSpecified { + get { return this.microVersionFieldSpecified; } + set { this.microVersionFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class OperatingSystem : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class MobileDeviceSubmodel : Technology { + private long mobileDeviceCriterionIdField; + + private bool mobileDeviceCriterionIdFieldSpecified; + + private long deviceManufacturerCriterionIdField; + + private bool deviceManufacturerCriterionIdFieldSpecified; + + public long mobileDeviceCriterionId { + get { return this.mobileDeviceCriterionIdField; } + set { + this.mobileDeviceCriterionIdField = value; + this.mobileDeviceCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mobileDeviceCriterionIdSpecified { + get { return this.mobileDeviceCriterionIdFieldSpecified; } + set { this.mobileDeviceCriterionIdFieldSpecified = value; } + } + + public long deviceManufacturerCriterionId { + get { return this.deviceManufacturerCriterionIdField; } + set { + this.deviceManufacturerCriterionIdField = value; + this.deviceManufacturerCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deviceManufacturerCriterionIdSpecified { + get { return this.deviceManufacturerCriterionIdFieldSpecified; } + set { this.deviceManufacturerCriterionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class MobileDevice : Technology { + private long manufacturerCriterionIdField; + + private bool manufacturerCriterionIdFieldSpecified; + + public long manufacturerCriterionId { + get { return this.manufacturerCriterionIdField; } + set { + this.manufacturerCriterionIdField = value; + this.manufacturerCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manufacturerCriterionIdSpecified { + get { return this.manufacturerCriterionIdFieldSpecified; } + set { this.manufacturerCriterionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class MobileCarrier : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DeviceManufacturer : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DeviceCategory : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DeviceCapability : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class BrowserLanguage : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class Browser : Technology { + private string majorVersionField; + + private string minorVersionField; + + public string majorVersion { + get { return this.majorVersionField; } + set { this.majorVersionField = value; } + } + + public string minorVersion { + get { return this.minorVersionField; } + set { this.minorVersionField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class BandwidthGroup : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class BrowserTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] browsersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("browsers")] + public Technology[] browsers { + get { return this.browsersField; } + set { this.browsersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class BrowserLanguageTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] browserLanguagesField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("browserLanguages")] + public Technology[] browserLanguages { + get { return this.browserLanguagesField; } + set { this.browserLanguagesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DeviceCapabilityTargeting { + private Technology[] targetedDeviceCapabilitiesField; + + private Technology[] excludedDeviceCapabilitiesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedDeviceCapabilities")] + public Technology[] targetedDeviceCapabilities { + get { return this.targetedDeviceCapabilitiesField; } + set { this.targetedDeviceCapabilitiesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedDeviceCapabilities")] + public Technology[] excludedDeviceCapabilities { + get { return this.excludedDeviceCapabilitiesField; } + set { this.excludedDeviceCapabilitiesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DeviceCategoryTargeting { + private Technology[] targetedDeviceCategoriesField; + + private Technology[] excludedDeviceCategoriesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedDeviceCategories")] + public Technology[] targetedDeviceCategories { + get { return this.targetedDeviceCategoriesField; } + set { this.targetedDeviceCategoriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedDeviceCategories")] + public Technology[] excludedDeviceCategories { + get { return this.excludedDeviceCategoriesField; } + set { this.excludedDeviceCategoriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DeviceManufacturerTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] deviceManufacturersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deviceManufacturers")] + public Technology[] deviceManufacturers { + get { return this.deviceManufacturersField; } + set { this.deviceManufacturersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class MobileCarrierTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] mobileCarriersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("mobileCarriers")] + public Technology[] mobileCarriers { + get { return this.mobileCarriersField; } + set { this.mobileCarriersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class MobileDeviceTargeting { + private Technology[] targetedMobileDevicesField; + + private Technology[] excludedMobileDevicesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedMobileDevices")] + public Technology[] targetedMobileDevices { + get { return this.targetedMobileDevicesField; } + set { this.targetedMobileDevicesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedMobileDevices")] + public Technology[] excludedMobileDevices { + get { return this.excludedMobileDevicesField; } + set { this.excludedMobileDevicesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class MobileDeviceSubmodelTargeting { + private Technology[] targetedMobileDeviceSubmodelsField; + + private Technology[] excludedMobileDeviceSubmodelsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedMobileDeviceSubmodels")] + public Technology[] targetedMobileDeviceSubmodels { + get { return this.targetedMobileDeviceSubmodelsField; } + set { this.targetedMobileDeviceSubmodelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedMobileDeviceSubmodels")] + public Technology[] excludedMobileDeviceSubmodels { + get { return this.excludedMobileDeviceSubmodelsField; } + set { this.excludedMobileDeviceSubmodelsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class OperatingSystemTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] operatingSystemsField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("operatingSystems")] + public Technology[] operatingSystems { + get { return this.operatingSystemsField; } + set { this.operatingSystemsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class OperatingSystemVersionTargeting { + private Technology[] targetedOperatingSystemVersionsField; + + private Technology[] excludedOperatingSystemVersionsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedOperatingSystemVersions")] + public Technology[] targetedOperatingSystemVersions { + get { return this.targetedOperatingSystemVersionsField; } + set { this.targetedOperatingSystemVersionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedOperatingSystemVersions")] + public Technology[] excludedOperatingSystemVersions { + get { return this.excludedOperatingSystemVersionsField; } + set { this.excludedOperatingSystemVersionsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CustomCriteriaSet : CustomCriteriaNode { + private CustomCriteriaSetLogicalOperator logicalOperatorField; + + private bool logicalOperatorFieldSpecified; + + private CustomCriteriaNode[] childrenField; + + public CustomCriteriaSetLogicalOperator logicalOperator { + get { return this.logicalOperatorField; } + set { + this.logicalOperatorField = value; + this.logicalOperatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool logicalOperatorSpecified { + get { return this.logicalOperatorFieldSpecified; } + set { this.logicalOperatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("children")] + public CustomCriteriaNode[] children { + get { return this.childrenField; } + set { this.childrenField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCriteriaSet.LogicalOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CustomCriteriaSetLogicalOperator { + AND, + OR + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteriaLeaf))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceSegmentCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteriaSet))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class CustomCriteriaNode { + private string customCriteriaNodeTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomCriteriaNode.Type")] + public string CustomCriteriaNodeType { + get { return this.customCriteriaNodeTypeField; } + set { this.customCriteriaNodeTypeField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceSegmentCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteria))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class CustomCriteriaLeaf : CustomCriteriaNode { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AudienceSegmentCriteria : CustomCriteriaLeaf { + private AudienceSegmentCriteriaComparisonOperator operatorField; + + private bool operatorFieldSpecified; + + private long[] audienceSegmentIdsField; + + public AudienceSegmentCriteriaComparisonOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("audienceSegmentIds")] + public long[] audienceSegmentIds { + get { return this.audienceSegmentIdsField; } + set { this.audienceSegmentIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegmentCriteria.ComparisonOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum AudienceSegmentCriteriaComparisonOperator { + IS, + IS_NOT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CustomCriteria : CustomCriteriaLeaf { + private long keyIdField; + + private bool keyIdFieldSpecified; + + private long[] valueIdsField; + + private CustomCriteriaComparisonOperator operatorField; + + private bool operatorFieldSpecified; + + public long keyId { + get { return this.keyIdField; } + set { + this.keyIdField = value; + this.keyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keyIdSpecified { + get { return this.keyIdFieldSpecified; } + set { this.keyIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("valueIds")] + public long[] valueIds { + get { return this.valueIdsField; } + set { this.valueIdsField = value; } + } + + public CustomCriteriaComparisonOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCriteria.ComparisonOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CustomCriteriaComparisonOperator { + IS, + IS_NOT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class UserDomainTargeting { + private string[] domainsField; + + private bool targetedField; + + private bool targetedFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("domains")] + public string[] domains { + get { return this.domainsField; } + set { this.domainsField = value; } + } + + public bool targeted { + get { return this.targetedField; } + set { + this.targetedField = value; + this.targetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetedSpecified { + get { return this.targetedFieldSpecified; } + set { this.targetedFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ContentTargeting { + private long[] targetedContentIdsField; + + private long[] excludedContentIdsField; + + private long[] targetedVideoCategoryIdsField; + + private long[] excludedVideoCategoryIdsField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("targetedContentIds")] + public long[] targetedContentIds { + get { return this.targetedContentIdsField; } + set { this.targetedContentIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedContentIds")] + public long[] excludedContentIds { + get { return this.excludedContentIdsField; } + set { this.excludedContentIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedVideoCategoryIds")] + public long[] targetedVideoCategoryIds { + get { return this.targetedVideoCategoryIdsField; } + set { this.targetedVideoCategoryIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedVideoCategoryIds")] + public long[] excludedVideoCategoryIds { + get { return this.excludedVideoCategoryIdsField; } + set { this.excludedVideoCategoryIdsField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class VideoPositionTargeting { + private VideoPositionTargetingType[] targetedVideoPositionsField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("targetedVideoPositions")] + public VideoPositionTargetingType[] targetedVideoPositions { + get { return this.targetedVideoPositionsField; } + set { this.targetedVideoPositionsField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum VideoPositionTargetingType { + PREROLL, + MIDROLL, + POSTROLL, + BEFORE_PREROLL_BUMPER, + AFTER_PREROLL_BUMPER, + BEFORE_MIDROLL_BUMPERS, + AFTER_MIDROLL_BUMPERS, + BEFORE_POSTROLL_BUMPER, + AFTER_POSTROLL_BUMPER, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItem))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class LineItemSummary { + private long orderIdField; + + private bool orderIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string externalIdField; + + private string orderNameField; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private int autoExtensionDaysField; + + private bool autoExtensionDaysFieldSpecified; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private CreativeRotationType creativeRotationTypeField; + + private bool creativeRotationTypeFieldSpecified; + + private DeliveryRateType deliveryRateTypeField; + + private bool deliveryRateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int priorityField; + + private bool priorityFieldSpecified; + + private UnitType unitTypeField; + + private bool unitTypeFieldSpecified; + + private LineItemSummaryDuration durationField; + + private bool durationFieldSpecified; + + private long unitsBoughtField; + + private bool unitsBoughtFieldSpecified; + + private Money costPerUnitField; + + private Money valueCostPerUnitField; + + private CostType costTypeField; + + private bool costTypeFieldSpecified; + + private LineItemDiscountType discountTypeField; + + private bool discountTypeFieldSpecified; + + private double discountField; + + private bool discountFieldSpecified; + + private long contractedUnitsBoughtField; + + private bool contractedUnitsBoughtFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private EnvironmentType environmentTypeField; + + private bool environmentTypeFieldSpecified; + + private CompanionDeliveryOption companionDeliveryOptionField; + + private bool companionDeliveryOptionFieldSpecified; + + private CreativePersistenceType creativePersistenceTypeField; + + private bool creativePersistenceTypeFieldSpecified; + + private bool allowOverbookField; + + private bool allowOverbookFieldSpecified; + + private bool reserveAtCreationField; + + private bool reserveAtCreationFieldSpecified; + + private Stats statsField; + + private DeliveryIndicator deliveryIndicatorField; + + private long[] deliveryDataField; + + private Money budgetField; + + private ComputedStatus statusField; + + private bool statusFieldSpecified; + + private LineItemSummaryReservationStatus reservationStatusField; + + private bool reservationStatusFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private string webPropertyCodeField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private bool disableSameAdvertiserCompetitiveExclusionField; + + private bool disableSameAdvertiserCompetitiveExclusionFieldSpecified; + + private string lastModifiedByAppField; + + private string notesField; + + private DateTime lastModifiedDateTimeField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private string lineItemSummaryTypeField; + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string externalId { + get { return this.externalIdField; } + set { this.externalIdField = value; } + } + + public string orderName { + get { return this.orderNameField; } + set { this.orderNameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public int autoExtensionDays { + get { return this.autoExtensionDaysField; } + set { + this.autoExtensionDaysField = value; + this.autoExtensionDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool autoExtensionDaysSpecified { + get { return this.autoExtensionDaysFieldSpecified; } + set { this.autoExtensionDaysFieldSpecified = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public CreativeRotationType creativeRotationType { + get { return this.creativeRotationTypeField; } + set { + this.creativeRotationTypeField = value; + this.creativeRotationTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeRotationTypeSpecified { + get { return this.creativeRotationTypeFieldSpecified; } + set { this.creativeRotationTypeFieldSpecified = value; } + } + + public DeliveryRateType deliveryRateType { + get { return this.deliveryRateTypeField; } + set { + this.deliveryRateTypeField = value; + this.deliveryRateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryRateTypeSpecified { + get { return this.deliveryRateTypeFieldSpecified; } + set { this.deliveryRateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + public UnitType unitType { + get { return this.unitTypeField; } + set { + this.unitTypeField = value; + this.unitTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitTypeSpecified { + get { return this.unitTypeFieldSpecified; } + set { this.unitTypeFieldSpecified = value; } + } + + public LineItemSummaryDuration duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public long unitsBought { + get { return this.unitsBoughtField; } + set { + this.unitsBoughtField = value; + this.unitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitsBoughtSpecified { + get { return this.unitsBoughtFieldSpecified; } + set { this.unitsBoughtFieldSpecified = value; } + } + + public Money costPerUnit { + get { return this.costPerUnitField; } + set { this.costPerUnitField = value; } + } + + public Money valueCostPerUnit { + get { return this.valueCostPerUnitField; } + set { this.valueCostPerUnitField = value; } + } + + public CostType costType { + get { return this.costTypeField; } + set { + this.costTypeField = value; + this.costTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool costTypeSpecified { + get { return this.costTypeFieldSpecified; } + set { this.costTypeFieldSpecified = value; } + } + + public LineItemDiscountType discountType { + get { return this.discountTypeField; } + set { + this.discountTypeField = value; + this.discountTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool discountTypeSpecified { + get { return this.discountTypeFieldSpecified; } + set { this.discountTypeFieldSpecified = value; } + } + + public double discount { + get { return this.discountField; } + set { + this.discountField = value; + this.discountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool discountSpecified { + get { return this.discountFieldSpecified; } + set { this.discountFieldSpecified = value; } + } + + public long contractedUnitsBought { + get { return this.contractedUnitsBoughtField; } + set { + this.contractedUnitsBoughtField = value; + this.contractedUnitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contractedUnitsBoughtSpecified { + get { return this.contractedUnitsBoughtFieldSpecified; } + set { this.contractedUnitsBoughtFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + public EnvironmentType environmentType { + get { return this.environmentTypeField; } + set { + this.environmentTypeField = value; + this.environmentTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool environmentTypeSpecified { + get { return this.environmentTypeFieldSpecified; } + set { this.environmentTypeFieldSpecified = value; } + } + + public CompanionDeliveryOption companionDeliveryOption { + get { return this.companionDeliveryOptionField; } + set { + this.companionDeliveryOptionField = value; + this.companionDeliveryOptionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companionDeliveryOptionSpecified { + get { return this.companionDeliveryOptionFieldSpecified; } + set { this.companionDeliveryOptionFieldSpecified = value; } + } + + public CreativePersistenceType creativePersistenceType { + get { return this.creativePersistenceTypeField; } + set { + this.creativePersistenceTypeField = value; + this.creativePersistenceTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativePersistenceTypeSpecified { + get { return this.creativePersistenceTypeFieldSpecified; } + set { this.creativePersistenceTypeFieldSpecified = value; } + } + + public bool allowOverbook { + get { return this.allowOverbookField; } + set { + this.allowOverbookField = value; + this.allowOverbookSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowOverbookSpecified { + get { return this.allowOverbookFieldSpecified; } + set { this.allowOverbookFieldSpecified = value; } + } + + public bool reserveAtCreation { + get { return this.reserveAtCreationField; } + set { + this.reserveAtCreationField = value; + this.reserveAtCreationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reserveAtCreationSpecified { + get { return this.reserveAtCreationFieldSpecified; } + set { this.reserveAtCreationFieldSpecified = value; } + } + + public Stats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public DeliveryIndicator deliveryIndicator { + get { return this.deliveryIndicatorField; } + set { this.deliveryIndicatorField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("units", IsNullable = false)] + public long[] deliveryData { + get { return this.deliveryDataField; } + set { this.deliveryDataField = value; } + } + + public Money budget { + get { return this.budgetField; } + set { this.budgetField = value; } + } + + public ComputedStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public LineItemSummaryReservationStatus reservationStatus { + get { return this.reservationStatusField; } + set { + this.reservationStatusField = value; + this.reservationStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reservationStatusSpecified { + get { return this.reservationStatusFieldSpecified; } + set { this.reservationStatusFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public string webPropertyCode { + get { return this.webPropertyCodeField; } + set { this.webPropertyCodeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public bool disableSameAdvertiserCompetitiveExclusion { + get { return this.disableSameAdvertiserCompetitiveExclusionField; } + set { + this.disableSameAdvertiserCompetitiveExclusionField = value; + this.disableSameAdvertiserCompetitiveExclusionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool disableSameAdvertiserCompetitiveExclusionSpecified { + get { return this.disableSameAdvertiserCompetitiveExclusionFieldSpecified; } + set { this.disableSameAdvertiserCompetitiveExclusionFieldSpecified = value; } + } + + public string lastModifiedByApp { + get { return this.lastModifiedByAppField; } + set { this.lastModifiedByAppField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("LineItemSummary.Type")] + public string LineItemSummaryType { + get { return this.lineItemSummaryTypeField; } + set { this.lineItemSummaryTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum StartDateTimeType { + USE_START_DATE_TIME, + IMMEDIATELY, + ONE_HOUR_FROM_NOW + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CreativeRotationType { + EVEN, + OPTIMIZED, + MANUAL, + SEQUENTIAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum DeliveryRateType { + EVENLY, + FRONTLOADED, + AS_FAST_AS_POSSIBLE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum RoadblockingType { + ONLY_ONE, + ONE_OR_MORE, + AS_MANY_AS_POSSIBLE, + ALL_ROADBLOCK, + CREATIVE_SET + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class FrequencyCap { + private int maxImpressionsField; + + private bool maxImpressionsFieldSpecified; + + private int numTimeUnitsField; + + private bool numTimeUnitsFieldSpecified; + + private TimeUnit timeUnitField; + + private bool timeUnitFieldSpecified; + + public int maxImpressions { + get { return this.maxImpressionsField; } + set { + this.maxImpressionsField = value; + this.maxImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxImpressionsSpecified { + get { return this.maxImpressionsFieldSpecified; } + set { this.maxImpressionsFieldSpecified = value; } + } + + public int numTimeUnits { + get { return this.numTimeUnitsField; } + set { + this.numTimeUnitsField = value; + this.numTimeUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numTimeUnitsSpecified { + get { return this.numTimeUnitsFieldSpecified; } + set { this.numTimeUnitsFieldSpecified = value; } + } + + public TimeUnit timeUnit { + get { return this.timeUnitField; } + set { + this.timeUnitField = value; + this.timeUnitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool timeUnitSpecified { + get { return this.timeUnitFieldSpecified; } + set { this.timeUnitFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum TimeUnit { + MINUTE, + HOUR, + DAY, + WEEK, + MONTH, + LIFETIME, + POD, + STREAM + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum LineItemType { + SPONSORSHIP, + STANDARD, + NETWORK, + BULK, + PRICE_PRIORITY, + HOUSE, + LEGACY_DFP, + CLICK_TRACKING, + ADSENSE, + AD_EXCHANGE, + BUMPER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum UnitType { + IMPRESSIONS, + CLICKS + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemSummary.Duration", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum LineItemSummaryDuration { + NONE, + LIFETIME, + DAILY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class Money { + private string currencyCodeField; + + private long microAmountField; + + private bool microAmountFieldSpecified; + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public long microAmount { + get { return this.microAmountField; } + set { + this.microAmountField = value; + this.microAmountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool microAmountSpecified { + get { return this.microAmountFieldSpecified; } + set { this.microAmountFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CostType { + CPC, + CPD, + CPM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum LineItemDiscountType { + ABSOLUTE_VALUE, + PERCENTAGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CreativePlaceholder { + private Size sizeField; + + private CreativePlaceholder[] companionsField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private long idField; + + private bool idFieldSpecified; + + private int expectedCreativeCountField; + + private bool expectedCreativeCountFieldSpecified; + + private CreativeSizeType creativeSizeTypeField; + + private bool creativeSizeTypeFieldSpecified; + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companions")] + public CreativePlaceholder[] companions { + get { return this.companionsField; } + set { this.companionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public int expectedCreativeCount { + get { return this.expectedCreativeCountField; } + set { + this.expectedCreativeCountField = value; + this.expectedCreativeCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expectedCreativeCountSpecified { + get { return this.expectedCreativeCountFieldSpecified; } + set { this.expectedCreativeCountFieldSpecified = value; } + } + + public CreativeSizeType creativeSizeType { + get { return this.creativeSizeTypeField; } + set { + this.creativeSizeTypeField = value; + this.creativeSizeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeSizeTypeSpecified { + get { return this.creativeSizeTypeFieldSpecified; } + set { this.creativeSizeTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class Size { + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + private bool isAspectRatioField; + + private bool isAspectRatioFieldSpecified; + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + public bool isAspectRatio { + get { return this.isAspectRatioField; } + set { + this.isAspectRatioField = value; + this.isAspectRatioSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAspectRatioSpecified { + get { return this.isAspectRatioFieldSpecified; } + set { this.isAspectRatioFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AppliedLabel { + private long labelIdField; + + private bool labelIdFieldSpecified; + + private bool isNegatedField; + + private bool isNegatedFieldSpecified; + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + + public bool isNegated { + get { return this.isNegatedField; } + set { + this.isNegatedField = value; + this.isNegatedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isNegatedSpecified { + get { return this.isNegatedFieldSpecified; } + set { this.isNegatedFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CreativeSizeType { + PIXEL, + ASPECT_RATIO, + INTERSTITIAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum TargetPlatform { + WEB, + MOBILE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum EnvironmentType { + BROWSER, + VIDEO_PLAYER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CompanionDeliveryOption { + OPTIONAL, + AT_LEAST_ONE, + ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CreativePersistenceType { + NOT_PERSISTENT, + PERSISTENT_AND_EXCLUDE_NONE, + PERSISTENT_AND_EXCLUDE_DISPLAY, + PERSISTENT_AND_EXCLUDE_VIDEO, + PERSISTENT_AND_EXCLUDE_ALL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class Stats { + private long impressionsDeliveredField; + + private bool impressionsDeliveredFieldSpecified; + + private long clicksDeliveredField; + + private bool clicksDeliveredFieldSpecified; + + public long impressionsDelivered { + get { return this.impressionsDeliveredField; } + set { + this.impressionsDeliveredField = value; + this.impressionsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsDeliveredSpecified { + get { return this.impressionsDeliveredFieldSpecified; } + set { this.impressionsDeliveredFieldSpecified = value; } + } + + public long clicksDelivered { + get { return this.clicksDeliveredField; } + set { + this.clicksDeliveredField = value; + this.clicksDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clicksDeliveredSpecified { + get { return this.clicksDeliveredFieldSpecified; } + set { this.clicksDeliveredFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DeliveryIndicator { + private double expectedDeliveryPercentageField; + + private bool expectedDeliveryPercentageFieldSpecified; + + private double actualDeliveryPercentageField; + + private bool actualDeliveryPercentageFieldSpecified; + + public double expectedDeliveryPercentage { + get { return this.expectedDeliveryPercentageField; } + set { + this.expectedDeliveryPercentageField = value; + this.expectedDeliveryPercentageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expectedDeliveryPercentageSpecified { + get { return this.expectedDeliveryPercentageFieldSpecified; } + set { this.expectedDeliveryPercentageFieldSpecified = value; } + } + + public double actualDeliveryPercentage { + get { return this.actualDeliveryPercentageField; } + set { + this.actualDeliveryPercentageField = value; + this.actualDeliveryPercentageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool actualDeliveryPercentageSpecified { + get { return this.actualDeliveryPercentageFieldSpecified; } + set { this.actualDeliveryPercentageFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum ComputedStatus { + DELIVERY_EXTENDED, + DELIVERING, + READY, + PAUSED, + NEEDS_CREATIVES, + PAUSED_INVENTORY_RELEASED, + PENDING_APPROVAL, + COMPLETED, + DISAPPROVED, + DRAFT, + CANCELED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemSummary.ReservationStatus", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum LineItemSummaryReservationStatus { + RESERVED, + UNRESERVED + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DropDownCustomFieldValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class BaseCustomFieldValue { + private long customFieldIdField; + + private bool customFieldIdFieldSpecified; + + private string baseCustomFieldValueTypeField; + + public long customFieldId { + get { return this.customFieldIdField; } + set { + this.customFieldIdField = value; + this.customFieldIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldIdSpecified { + get { return this.customFieldIdFieldSpecified; } + set { this.customFieldIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseCustomFieldValue.Type")] + public string BaseCustomFieldValueType { + get { return this.baseCustomFieldValueTypeField; } + set { this.baseCustomFieldValueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DropDownCustomFieldValue : BaseCustomFieldValue { + private long customFieldOptionIdField; + + private bool customFieldOptionIdFieldSpecified; + + public long customFieldOptionId { + get { return this.customFieldOptionIdField; } + set { + this.customFieldOptionIdField = value; + this.customFieldOptionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldOptionIdSpecified { + get { return this.customFieldOptionIdFieldSpecified; } + set { this.customFieldOptionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CustomFieldValue : BaseCustomFieldValue { + private Value valueField; + + public Value value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class UserDomainTargetingError : ApiError { + private UserDomainTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public UserDomainTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "UserDomainTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum UserDomainTargetingErrorReason { + INVALID_DOMAIN_NAMES, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class TechnologyTargetingError : ApiError { + private TechnologyTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TechnologyTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TechnologyTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum TechnologyTargetingErrorReason { + MOBILE_LINE_ITEM_CONTAINS_WEB_TECH_CRITERIA, + WEB_LINE_ITEM_CONTAINS_MOBILE_TECH_CRITERIA, + MOBILE_CARRIER_TARGETING_FEATURE_NOT_ENABLED, + DEVICE_CAPABILITY_TARGETING_FEATURE_NOT_ENABLED, + DEVICE_CATEGORY_TARGETING_FEATURE_NOT_ENABLED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class TeamError : ApiError { + private TeamErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TeamErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TeamError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum TeamErrorReason { + ENTITY_NOT_ON_USERS_TEAMS, + MISSING_USERS_TEAM, + ALL_TEAM_ASSOCIATION_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class LineItemError : ApiError { + private LineItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum LineItemErrorReason { + ALREADY_STARTED, + UPDATE_RESERVATION_NOT_ALLOWED, + ALL_ROADBLOCK_NOT_ALLOWED, + CREATIVE_SET_ROADBLOCK_NOT_ALLOWED, + FRACTIONAL_PERCENTAGE_NOT_ALLOWED, + DISCOUNT_NOT_ALLOWED, + UPDATE_CANCELED_LINE_ITEM_NOT_ALLOWED, + UPDATE_PENDING_APPROVAL_LINE_ITEM_NOT_ALLOWED, + UPDATE_ARCHIVED_LINE_ITEM_NOT_ALLOWED, + FRONTLOADED_NOT_ALLOWED, + CREATE_OR_UPDATE_LEGACY_DFP_LINE_ITEM_TYPE_NOT_ALLOWED, + COPY_LINE_ITEM_FROM_DIFFERENT_COMPANY_NOT_ALLOWED, + INVALID_SIZE_FOR_PLATFORM, + INVALID_LINE_ITEM_TYPE_FOR_PLATFORM, + INVALID_WEB_PROPERTY_FOR_PLATFORM, + INVALID_WEB_PROPERTY_FOR_ENVIRONMENT, + AFMA_BACKFILL_NOT_ALLOWED, + UPDATE_ENVIRONMENT_TYPE_NOT_ALLOWED, + COMPANIONS_NOT_ALLOWED, + ROADBLOCKS_WITH_NONROADBLOCKS_NOT_ALLOWED, + CANNOT_UPDATE_TO_OR_FROM_CREATIVE_SET_ROADBLOCK, + UPDATE_FROM_BACKFILL_LINE_ITEM_TYPE_NOT_ALLOWED, + UPDATE_TO_BACKFILL_LINE_ITEM_TYPE_NOT_ALLOWED, + UPDATE_BACKFILL_WEB_PROPERTY_NOT_ALLOWED, + INVALID_COMPANION_DELIVERY_OPTION_FOR_ENVIRONMENT_TYPE, + COMPANION_BACKFILL_REQUIRES_VIDEO, + COMPANION_DELIVERY_OPTION_REQUIRE_PREMIUM, + DUPLICATE_MASTER_SIZES, + INVALID_PRIORITY_FOR_LINE_ITEM_TYPE, + INVALID_ENVIRONMENT_TYPE, + INVALID_ENVIRONMENT_TYPE_FOR_PLATFORM, + INVALID_TYPE_FOR_AUTO_EXTENSION, + INVALID_TYPE_FOR_CONTRACTED_UNITS_BOUGHT, + VIDEO_INVALID_ROADBLOCKING, + BACKFILL_TYPE_NOT_ALLOWED, + COMPANION_DELIVERY_OPTIONS_NOT_ALLOWED_WITH_BACKFILL, + INVALID_WEB_PROPERTY_FOR_ADX_BACKFILL, + INVALID_SIZE_FOR_ENVIRONMENT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class LineItemCreativeAssociationError : ApiError { + private LineItemCreativeAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemCreativeAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum LineItemCreativeAssociationErrorReason { + CREATIVE_IN_WRONG_ADVERTISERS_LIBRARY, + INVALID_LINEITEM_CREATIVE_PAIRING, + STARTDATE_BEFORE_LINEITEM_STARTDATE, + STARTDATE_NOT_BEFORE_LINEITEM_ENDDATE, + ENDDATE_AFTER_LINEITEM_ENDDATE, + ENDDATE_NOT_AFTER_LINEITEM_STARTDATE, + ENDDATE_NOT_AFTER_STARTDATE, + ENDDATE_IN_THE_PAST, + CANNOT_COPY_WITHIN_SAME_LINE_ITEM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class GeoTargetingError : ApiError { + private GeoTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public GeoTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GeoTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum GeoTargetingErrorReason { + TARGETED_LOCATIONS_NOT_EXCLUDABLE, + EXCLUDED_LOCATIONS_CANNOT_HAVE_CHILDREN_TARGETED, + POSTAL_CODES_CANNOT_BE_EXCLUDED, + UNTARGETABLE_LOCATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class GenericTargetingError : ApiError { + private GenericTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public GenericTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GenericTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum GenericTargetingErrorReason { + CONFLICTING_INCLUSION_OR_EXCLUSION_OF_SIBLINGS, + INCLUDING_DESCENDANTS_OF_EXCLUDED_CRITERIA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class FrequencyCapError : ApiError { + private FrequencyCapErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FrequencyCapErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FrequencyCapError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum FrequencyCapErrorReason { + IMPRESSION_LIMIT_EXCEEDED, + IMPRESSIONS_TOO_LOW, + RANGE_LIMIT_EXCEEDED, + RANGE_TOO_LOW, + DUPLICATE_TIME_RANGE, + TOO_MANY_FREQUENCY_CAPS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ForecastError : ApiError { + private ForecastErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ForecastErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ForecastError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum ForecastErrorReason { + SERVER_NOT_AVAILABLE, + INTERNAL_ERROR, + NO_FORECAST_YET, + NOT_ENOUGH_INVENTORY, + SUCCESS, + ZERO_LENGTH_RESERVATION, + EXCEEDED_QUOTA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DayPartTargetingError : ApiError { + private DayPartTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DayPartTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DayPartTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum DayPartTargetingErrorReason { + INVALID_HOUR, + INVALID_MINUTE, + END_TIME_NOT_AFTER_START_TIME, + TIME_PERIODS_OVERLAP, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DateTimeRangeTargetingError : ApiError { + private DateTimeRangeTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DateTimeRangeTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DateTimeRangeTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum DateTimeRangeTargetingErrorReason { + EMPTY_RANGES, + NOT_SPONSORSHIP_LINEITEM, + PAST_RANGES_CHANGED, + RANGES_OVERLAP, + RANGES_OUT_OF_LINEITEM_ACTIVE_PERIOD, + START_TIME_IS_NOT_START_OF_DAY, + END_TIME_IS_NOT_END_OF_DAY, + START_DATE_TIME_IS_IN_PAST, + RANGE_END_TIME_BEFORE_START_TIME, + END_DATE_TIME_IS_TOO_LATE, + LIMITED_RANGES_IN_UNLIMITED_LINEITEM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CustomFieldValueError : ApiError { + private CustomFieldValueErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomFieldValueErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomFieldValueError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CustomFieldValueErrorReason { + CUSTOM_FIELD_NOT_FOUND, + CUSTOM_FIELD_INACTIVE, + CUSTOM_FIELD_OPTION_NOT_FOUND, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CompanyCreditStatusError : ApiError { + private CompanyCreditStatusErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CompanyCreditStatusErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CompanyCreditStatusError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CompanyCreditStatusErrorReason { + COMPANY_CREDIT_STATUS_CHANGE_NOT_ALLOWED, + CANNOT_USE_CREDIT_STATUS_SETTING, + CANNOT_USE_ADVANCED_CREDIT_STATUS_SETTING, + UNACCEPTABLE_COMPANY_CREDIT_STATUS_FOR_ORDER, + UNACCEPTABLE_COMPANY_CREDIT_STATUS_FOR_LINE_ITEM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ClickTrackingLineItemError : ApiError { + private ClickTrackingLineItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ClickTrackingLineItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ClickTrackingLineItemError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum ClickTrackingLineItemErrorReason { + TYPE_IMMUTABLE, + INVALID_TARGETING_TYPE, + INVALID_ROADBLOCKING_TYPE, + INVALID_CREATIVEROTATION_TYPE, + INVALID_DELIVERY_RATE_TYPE, + UNSUPPORTED_FIELD, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AudienceExtensionError : ApiError { + private AudienceExtensionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AudienceExtensionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceExtensionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum AudienceExtensionErrorReason { + FREQUENCY_CAPS_NOT_SUPPORTED, + INVALID_TARGETING, + INVENTORY_UNIT_TARGETING_INVALID, + INVALID_CREATIVE_ROTATION, + INVALID_LINE_ITEM_TYPE, + INVALID_MAX_BID, + AUDIENCE_EXTENSION_BULK_UPDATE_NOT_ALLOWED, + UNEXPECTED_AUDIENCE_EXTENSION_ERROR, + MAX_DAILY_BUDGET_AMOUNT_EXCEEDED, + EXTERNAL_CAMPAIGN_ALREADY_EXISTS, + AUDIENCE_EXTENSION_WITHOUT_FEATURE, + AUDIENCE_EXTENSION_WITHOUT_LINKED_ACCOUNT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomFieldServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomFieldService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomFieldService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/CustomFieldService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomField createCustomField(CustomField customField) { + object[] results = this.Invoke("createCustomField", new object[] { customField }); + return ((CustomField) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomFieldOption createCustomFieldOption(CustomFieldOption customFieldOption) { + object[] results = this.Invoke("createCustomFieldOption", new object[] { customFieldOption }); + return ((CustomFieldOption) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomFieldOption[] createCustomFieldOptions([System.Xml.Serialization.XmlElementAttribute("customFieldOptions")] +CustomFieldOption[] customFieldOptions) { + object[] results = this.Invoke("createCustomFieldOptions", new object[] { customFieldOptions }); + return ((CustomFieldOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomField[] createCustomFields([System.Xml.Serialization.XmlElementAttribute("customFields")] +CustomField[] customFields) { + object[] results = this.Invoke("createCustomFields", new object[] { customFields }); + return ((CustomField[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomField getCustomField(long customFieldId) { + object[] results = this.Invoke("getCustomField", new object[] { customFieldId }); + return ((CustomField) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomFieldOption getCustomFieldOption(long customFieldOptionId, [System.Xml.Serialization.XmlIgnoreAttribute()] +bool customFieldOptionIdSpecified) { + object[] results = this.Invoke("getCustomFieldOption", new object[] { customFieldOptionId, customFieldOptionIdSpecified }); + return ((CustomFieldOption) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomFieldPage getCustomFieldsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomFieldsByStatement", new object[] { filterStatement }); + return ((CustomFieldPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performCustomFieldAction(CustomFieldAction customFieldAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomFieldAction", new object[] { customFieldAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomField updateCustomField(CustomField customField) { + object[] results = this.Invoke("updateCustomField", new object[] { customField }); + return ((CustomField) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomFieldOption updateCustomFieldOption(CustomFieldOption customFieldOption) { + object[] results = this.Invoke("updateCustomFieldOption", new object[] { customFieldOption }); + return ((CustomFieldOption) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomFieldOption[] updateCustomFieldOptions([System.Xml.Serialization.XmlElementAttribute("customFieldOptions")] +CustomFieldOption[] customFieldOptions) { + object[] results = this.Invoke("updateCustomFieldOptions", new object[] { customFieldOptions }); + return ((CustomFieldOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomField[] updateCustomFields([System.Xml.Serialization.XmlElementAttribute("customFields")] +CustomField[] customFields) { + object[] results = this.Invoke("updateCustomFields", new object[] { customFields }); + return ((CustomField[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateCustomFields))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateCustomFields))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CustomFieldAction { + private string customFieldActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomFieldAction.Type")] + public string CustomFieldActionType { + get { return this.customFieldActionTypeField; } + set { this.customFieldActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DeactivateCustomFields : CustomFieldAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ActivateCustomFields : CustomFieldAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CustomFieldPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomField[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomField[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DropDownCustomField))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CustomField { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private CustomFieldEntityType entityTypeField; + + private bool entityTypeFieldSpecified; + + private CustomFieldDataType dataTypeField; + + private bool dataTypeFieldSpecified; + + private CustomFieldVisibility visibilityField; + + private bool visibilityFieldSpecified; + + private string customFieldTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + public CustomFieldEntityType entityType { + get { return this.entityTypeField; } + set { + this.entityTypeField = value; + this.entityTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool entityTypeSpecified { + get { return this.entityTypeFieldSpecified; } + set { this.entityTypeFieldSpecified = value; } + } + + public CustomFieldDataType dataType { + get { return this.dataTypeField; } + set { + this.dataTypeField = value; + this.dataTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dataTypeSpecified { + get { return this.dataTypeFieldSpecified; } + set { this.dataTypeFieldSpecified = value; } + } + + public CustomFieldVisibility visibility { + get { return this.visibilityField; } + set { + this.visibilityField = value; + this.visibilitySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool visibilitySpecified { + get { return this.visibilityFieldSpecified; } + set { this.visibilityFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("CustomField.Type")] + public string CustomFieldType { + get { return this.customFieldTypeField; } + set { this.customFieldTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CustomFieldEntityType { + LINE_ITEM, + ORDER, + CREATIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CustomFieldDataType { + STRING, + NUMBER, + TOGGLE, + DROP_DOWN, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CustomFieldVisibility { + API_ONLY, + READ_ONLY, + FULL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DropDownCustomField : CustomField { + private CustomFieldOption[] optionsField; + + [System.Xml.Serialization.XmlElementAttribute("options")] + public CustomFieldOption[] options { + get { return this.optionsField; } + set { this.optionsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CustomFieldOption { + private long idField; + + private bool idFieldSpecified; + + private long customFieldIdField; + + private bool customFieldIdFieldSpecified; + + private string displayNameField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long customFieldId { + get { return this.customFieldIdField; } + set { + this.customFieldIdField = value; + this.customFieldIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldIdSpecified { + get { return this.customFieldIdFieldSpecified; } + set { this.customFieldIdFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CustomFieldError : ApiError { + private CustomFieldErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomFieldErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomFieldError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CustomFieldErrorReason { + INVALID_CUSTOM_FIELD_FOR_OPTION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "NetworkServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class NetworkService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public NetworkService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/NetworkService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Network[] getAllNetworks() { + object[] results = this.Invoke("getAllNetworks", new object[0]); + return ((Network[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Network getCurrentNetwork() { + object[] results = this.Invoke("getCurrentNetwork", new object[0]); + return ((Network) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Network makeTestNetwork() { + object[] results = this.Invoke("makeTestNetwork", new object[0]); + return ((Network) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Network updateNetwork(Network network) { + object[] results = this.Invoke("updateNetwork", new object[] { network }); + return ((Network) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class Network { + private long idField; + + private bool idFieldSpecified; + + private string displayNameField; + + private string networkCodeField; + + private string propertyCodeField; + + private string timeZoneField; + + private string currencyCodeField; + + private string effectiveRootAdUnitIdField; + + private long contentBrowseCustomTargetingKeyIdField; + + private bool contentBrowseCustomTargetingKeyIdFieldSpecified; + + private bool isTestField; + + private bool isTestFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public string networkCode { + get { return this.networkCodeField; } + set { this.networkCodeField = value; } + } + + public string propertyCode { + get { return this.propertyCodeField; } + set { this.propertyCodeField = value; } + } + + public string timeZone { + get { return this.timeZoneField; } + set { this.timeZoneField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public string effectiveRootAdUnitId { + get { return this.effectiveRootAdUnitIdField; } + set { this.effectiveRootAdUnitIdField = value; } + } + + public long contentBrowseCustomTargetingKeyId { + get { return this.contentBrowseCustomTargetingKeyIdField; } + set { + this.contentBrowseCustomTargetingKeyIdField = value; + this.contentBrowseCustomTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contentBrowseCustomTargetingKeyIdSpecified { + get { return this.contentBrowseCustomTargetingKeyIdFieldSpecified; } + set { this.contentBrowseCustomTargetingKeyIdFieldSpecified = value; } + } + + public bool isTest { + get { return this.isTestField; } + set { + this.isTestField = value; + this.isTestSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTestSpecified { + get { return this.isTestFieldSpecified; } + set { this.isTestFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AudienceSegmentServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AudienceSegmentService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AudienceSegmentService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/AudienceSegmentService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AudienceSegmentPage getAudienceSegmentsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAudienceSegmentsByStatement", new object[] { filterStatement }); + return ((AudienceSegmentPage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AudienceSegment { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private AudienceSegmentStatus statusField; + + private bool statusFieldSpecified; + + private long sizeField; + + private bool sizeFieldSpecified; + + private string audienceSegmentTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public AudienceSegmentStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public long size { + get { return this.sizeField; } + set { + this.sizeField = value; + this.sizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sizeSpecified { + get { return this.sizeFieldSpecified; } + set { this.sizeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("AudienceSegment.Type")] + public string AudienceSegmentType { + get { return this.audienceSegmentTypeField; } + set { this.audienceSegmentTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegment.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum AudienceSegmentStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AudienceSegmentPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AudienceSegment[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AudienceSegment[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "SuggestedAdUnitServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class SuggestedAdUnitService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public SuggestedAdUnitService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/SuggestedAdUnitService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public SuggestedAdUnit getSuggestedAdUnit(string suggestedAdUnitId) { + object[] results = this.Invoke("getSuggestedAdUnit", new object[] { suggestedAdUnitId }); + return ((SuggestedAdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public SuggestedAdUnitPage getSuggestedAdUnitsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getSuggestedAdUnitsByStatement", new object[] { filterStatement }); + return ((SuggestedAdUnitPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public SuggestedAdUnitUpdateResult performSuggestedAdUnitAction(SuggestedAdUnitAction suggestedAdUnitAction, Statement filterStatement) { + object[] results = this.Invoke("performSuggestedAdUnitAction", new object[] { suggestedAdUnitAction, filterStatement }); + return ((SuggestedAdUnitUpdateResult) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class SuggestedAdUnitUpdateResult { + private string[] newAdUnitIdsField; + + private int numChangesField; + + private bool numChangesFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("newAdUnitIds")] + public string[] newAdUnitIds { + get { return this.newAdUnitIdsField; } + set { this.newAdUnitIdsField = value; } + } + + public int numChanges { + get { return this.numChangesField; } + set { + this.numChangesField = value; + this.numChangesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numChangesSpecified { + get { return this.numChangesFieldSpecified; } + set { this.numChangesFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveSuggestedAdUnit))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class SuggestedAdUnitAction { + private string suggestedAdUnitActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("SuggestedAdUnitAction.Type")] + public string SuggestedAdUnitActionType { + get { return this.suggestedAdUnitActionTypeField; } + set { this.suggestedAdUnitActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ApproveSuggestedAdUnit : SuggestedAdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class SuggestedAdUnitPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private SuggestedAdUnit[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public SuggestedAdUnit[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class SuggestedAdUnit { + private string idField; + + private long numRequestsField; + + private bool numRequestsFieldSpecified; + + private string[] pathField; + + private AdUnitTargetWindow targetWindowField; + + private bool targetWindowFieldSpecified; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private AdUnitSize[] suggestedAdUnitSizesField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public long numRequests { + get { return this.numRequestsField; } + set { + this.numRequestsField = value; + this.numRequestsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numRequestsSpecified { + get { return this.numRequestsFieldSpecified; } + set { this.numRequestsFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("path")] + public string[] path { + get { return this.pathField; } + set { this.pathField = value; } + } + + public AdUnitTargetWindow targetWindow { + get { return this.targetWindowField; } + set { + this.targetWindowField = value; + this.targetWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetWindowSpecified { + get { return this.targetWindowFieldSpecified; } + set { this.targetWindowFieldSpecified = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("suggestedAdUnitSizes")] + public AdUnitSize[] suggestedAdUnitSizes { + get { return this.suggestedAdUnitSizesField; } + set { this.suggestedAdUnitSizesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnit.TargetWindow", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum AdUnitTargetWindow { + TOP, + BLANK + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AdUnitSize { + private Size sizeField; + + private EnvironmentType environmentTypeField; + + private bool environmentTypeFieldSpecified; + + private AdUnitSize[] companionsField; + + private string fullDisplayStringField; + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + public EnvironmentType environmentType { + get { return this.environmentTypeField; } + set { + this.environmentTypeField = value; + this.environmentTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool environmentTypeSpecified { + get { return this.environmentTypeFieldSpecified; } + set { this.environmentTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companions")] + public AdUnitSize[] companions { + get { return this.companionsField; } + set { this.companionsField = value; } + } + + public string fullDisplayString { + get { return this.fullDisplayStringField; } + set { this.fullDisplayStringField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "TeamServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class TeamService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public TeamService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/TeamService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Team createTeam(Team team) { + object[] results = this.Invoke("createTeam", new object[] { team }); + return ((Team) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Team[] createTeams([System.Xml.Serialization.XmlElementAttribute("teams")] +Team[] teams) { + object[] results = this.Invoke("createTeams", new object[] { teams }); + return ((Team[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Team getTeam(long teamId) { + object[] results = this.Invoke("getTeam", new object[] { teamId }); + return ((Team) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public TeamPage getTeamsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getTeamsByStatement", new object[] { filterStatement }); + return ((TeamPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Team updateTeam(Team team) { + object[] results = this.Invoke("updateTeam", new object[] { team }); + return ((Team) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Team[] updateTeams([System.Xml.Serialization.XmlElementAttribute("teams")] +Team[] teams) { + object[] results = this.Invoke("updateTeams", new object[] { teams }); + return ((Team[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class TeamPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Team[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Team[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class Team { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool hasAllCompaniesField; + + private bool hasAllCompaniesFieldSpecified; + + private bool hasAllInventoryField; + + private bool hasAllInventoryFieldSpecified; + + private TeamAccessType teamAccessTypeField; + + private bool teamAccessTypeFieldSpecified; + + private long[] companyIdsField; + + private string[] adUnitIdsField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool hasAllCompanies { + get { return this.hasAllCompaniesField; } + set { + this.hasAllCompaniesField = value; + this.hasAllCompaniesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasAllCompaniesSpecified { + get { return this.hasAllCompaniesFieldSpecified; } + set { this.hasAllCompaniesFieldSpecified = value; } + } + + public bool hasAllInventory { + get { return this.hasAllInventoryField; } + set { + this.hasAllInventoryField = value; + this.hasAllInventorySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasAllInventorySpecified { + get { return this.hasAllInventoryFieldSpecified; } + set { this.hasAllInventoryFieldSpecified = value; } + } + + public TeamAccessType teamAccessType { + get { return this.teamAccessTypeField; } + set { + this.teamAccessTypeField = value; + this.teamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool teamAccessTypeSpecified { + get { return this.teamAccessTypeFieldSpecified; } + set { this.teamAccessTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companyIds")] + public long[] companyIds { + get { return this.companyIdsField; } + set { this.companyIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adUnitIds")] + public string[] adUnitIds { + get { return this.adUnitIdsField; } + set { this.adUnitIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum TeamAccessType { + NONE, + READ_ONLY, + READ_WRITE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReportServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReportService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReportService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/ReportService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public string getReportDownloadURL(long reportJobId, ExportFormat exportFormat) { + object[] results = this.Invoke("getReportDownloadURL", new object[] { reportJobId, exportFormat }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public string getReportDownloadUrlWithOptions(long reportJobId, [System.Xml.Serialization.XmlIgnoreAttribute()] +bool reportJobIdSpecified, ReportDownloadOptions reportDownloadOptions) { + object[] results = this.Invoke("getReportDownloadUrlWithOptions", new object[] { reportJobId, reportJobIdSpecified, reportDownloadOptions }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ReportJob getReportJob(long reportJobId) { + object[] results = this.Invoke("getReportJob", new object[] { reportJobId }); + return ((ReportJob) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ReportJob runReportJob(ReportJob reportJob) { + object[] results = this.Invoke("runReportJob", new object[] { reportJob }); + return ((ReportJob) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ReportQuery { + private Dimension[] dimensionsField; + + private ReportQueryAdUnitView adUnitViewField; + + private bool adUnitViewFieldSpecified; + + private Column[] columnsField; + + private DimensionAttribute[] dimensionAttributesField; + + private long[] customFieldIdsField; + + private Date startDateField; + + private Date endDateField; + + private DateRangeType dateRangeTypeField; + + private bool dateRangeTypeFieldSpecified; + + private DimensionFilter[] dimensionFiltersField; + + private Statement statementField; + + [System.Xml.Serialization.XmlElementAttribute("dimensions")] + public Dimension[] dimensions { + get { return this.dimensionsField; } + set { this.dimensionsField = value; } + } + + public ReportQueryAdUnitView adUnitView { + get { return this.adUnitViewField; } + set { + this.adUnitViewField = value; + this.adUnitViewSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adUnitViewSpecified { + get { return this.adUnitViewFieldSpecified; } + set { this.adUnitViewFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("columns")] + public Column[] columns { + get { return this.columnsField; } + set { this.columnsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("dimensionAttributes")] + public DimensionAttribute[] dimensionAttributes { + get { return this.dimensionAttributesField; } + set { this.dimensionAttributesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldIds")] + public long[] customFieldIds { + get { return this.customFieldIdsField; } + set { this.customFieldIdsField = value; } + } + + public Date startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public Date endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + public DateRangeType dateRangeType { + get { return this.dateRangeTypeField; } + set { + this.dateRangeTypeField = value; + this.dateRangeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dateRangeTypeSpecified { + get { return this.dateRangeTypeFieldSpecified; } + set { this.dateRangeTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("dimensionFilters")] + public DimensionFilter[] dimensionFilters { + get { return this.dimensionFiltersField; } + set { this.dimensionFiltersField = value; } + } + + public Statement statement { + get { return this.statementField; } + set { this.statementField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum Dimension { + MONTH, + WEEK, + DATE, + DAY, + HOUR, + LINE_ITEM_ID, + LINE_ITEM_NAME, + LINE_ITEM, + LINE_ITEM_TYPE, + ORDER_ID, + ORDER_NAME, + ORDER, + ADVERTISER_ID, + ADVERTISER_NAME, + ADVERTISER, + SALESPERSON_ID, + SALESPERSON_NAME, + SALESPERSON, + CREATIVE_ID, + CREATIVE_NAME, + CREATIVE, + CREATIVE_TYPE, + CREATIVE_SIZE, + AD_UNIT_ID, + AD_UNIT_NAME, + AD_UNIT, + PLACEMENT_ID, + PLACEMENT_NAME, + PLACEMENT, + GENERIC_CRITERION_NAME, + COUNTRY_CRITERIA_ID, + COUNTRY_NAME, + REGION_CRITERIA_ID, + REGION_NAME, + CITY_CRITERIA_ID, + CITY_NAME, + METRO_CRITERIA_ID, + METRO_NAME, + POSTAL_CODE_CRITERIA_ID, + POSTAL_CODE, + CUSTOM_TARGETING_VALUE_ID, + CUSTOM_TARGETING, + ACTIVITY_ID, + ACTIVITY_NAME, + ACTIVITY, + ACTIVITY_GROUP_ID, + ACTIVITY_GROUP_NAME, + ACTIVITY_GROUP, + MASTER_COMPANION_CREATIVE_ID, + MASTER_COMPANION_CREATIVE_NAME + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportQuery.AdUnitView", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum ReportQueryAdUnitView { + TOP_LEVEL, + FLAT, + HIERARCHICAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum Column { + AD_SERVER_IMPRESSIONS, + AD_SERVER_CLICKS, + AD_SERVER_CTR, + AD_SERVER_CPM_AND_CPC_REVENUE, + AD_SERVER_AVERAGE_ECPM, + AD_SERVER_INVENTORY_LEVEL_PERCENT_IMPRESSIONS, + AD_SERVER_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + AD_SERVER_INVENTORY_LEVEL_PERCENT_CLICKS, + AD_SERVER_LINE_ITEM_LEVEL_PERCENT_CLICKS, + AD_SERVER_INVENTORY_LEVEL_PERCENT_REVENUE, + AD_SERVER_LINE_ITEM_LEVEL_PERCENT_REVENUE, + AD_SERVER_DELIVERY_INDICATOR, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + ADSENSE_LINE_ITEM_LEVEL_IMPRESSIONS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + ADSENSE_LINE_ITEM_LEVEL_CLICKS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CTR, + ADSENSE_LINE_ITEM_LEVEL_CTR, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_REVENUE, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_AVERAGE_ECPM, + ADSENSE_LINE_ITEM_LEVEL_AVERAGE_ECPM, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_PERCENT_IMPRESSIONS, + ADSENSE_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_PERCENT_CLICKS, + ADSENSE_LINE_ITEM_LEVEL_PERCENT_CLICKS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_PERCENT_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_IMPRESSIONS, + AD_EXCHANGE_LINE_ITEM_LEVEL_CLICKS, + AD_EXCHANGE_LINE_ITEM_LEVEL_CTR, + AD_EXCHANGE_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + AD_EXCHANGE_LINE_ITEM_LEVEL_PERCENT_CLICKS, + AD_EXCHANGE_LINE_ITEM_LEVEL_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_AVERAGE_ECPM, + TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + TOTAL_LINE_ITEM_LEVEL_IMPRESSIONS, + TOTAL_INVENTORY_LEVEL_CLICKS, + TOTAL_LINE_ITEM_LEVEL_CLICKS, + TOTAL_INVENTORY_LEVEL_CTR, + TOTAL_LINE_ITEM_LEVEL_CTR, + TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE, + TOTAL_LINE_ITEM_LEVEL_CPM_AND_CPC_REVENUE, + TOTAL_INVENTORY_LEVEL_AVERAGE_ECPM, + TOTAL_LINE_ITEM_LEVEL_AVERAGE_ECPM, + TOTAL_INVENTORY_LEVEL_UNFILLED_IMPRESSIONS, + MERGED_AD_SERVER_DELIVERY_INDICATOR, + MERGED_AD_SERVER_IMPRESSIONS, + MERGED_AD_SERVER_CLICKS, + MERGED_AD_SERVER_CTR, + MERGED_AD_SERVER_CPM_AND_CPC_REVENUE, + MERGED_AD_SERVER_AVERAGE_ECPM, + OPTIMIZATION_CONTROL_IMPRESSIONS, + OPTIMIZATION_CONTROL_CLICKS, + OPTIMIZATION_CONTROL_CTR, + OPTIMIZATION_OPTIMIZED_IMPRESSIONS, + OPTIMIZATION_OPTIMIZED_CLICKS, + OPTIMIZATION_NON_OPTIMIZED_IMPRESSIONS, + OPTIMIZATION_NON_OPTIMIZED_CLICKS, + OPTIMIZATION_EXTRA_CLICKS, + OPTIMIZATION_OPTIMIZED_CTR, + OPTIMIZATION_LIFT, + OPTIMIZATION_COVERAGE, + OPTIMIZATION_BEHIND_SCHEDULE_IMPRESSIONS, + OPTIMIZATION_NO_CLICKS_RECORDED_IMPRESSIONS, + OPTIMIZATION_SPONSORSHIP_IMPRESSIONS, + OPTIMIZATION_AS_FAST_AS_POSSIBLE_IMPRESSIONS, + OPTIMIZATION_NO_ABSOLUTE_LIFETIME_GOAL_IMPRESSIONS, + OPTIMIZATION_CONTROL_REVENUE, + OPTIMIZATION_OPTIMIZED_REVENUE, + OPTIMIZATION_CONTROL_ECPM, + OPTIMIZATION_OPTIMIZED_ECPM, + OPTIMIZATION_FREED_UP_IMPRESSIONS, + OPTIMIZATION_ECPM_LIFT, + REACH_FREQUENCY, + REACH_AVERAGE_REVENUE, + REACH, + RICH_MEDIA_BACKUP_IMAGES, + RICH_MEDIA_DISPLAY_TIME, + RICH_MEDIA_AVERAGE_DISPLAY_TIME, + RICH_MEDIA_EXPANSIONS, + RICH_MEDIA_EXPANDING_TIME, + RICH_MEDIA_INTERACTION_TIME, + RICH_MEDIA_INTERACTION_COUNT, + RICH_MEDIA_INTERACTION_RATE, + RICH_MEDIA_AVERAGE_INTERACTION_TIME, + RICH_MEDIA_INTERACTION_IMPRESSIONS, + RICH_MEDIA_MANUAL_CLOSES, + RICH_MEDIA_FULL_SCREEN_IMPRESSIONS, + RICH_MEDIA_VIDEO_INTERACTIONS, + RICH_MEDIA_VIDEO_INTERACTION_RATE, + RICH_MEDIA_VIDEO_MUTES, + RICH_MEDIA_VIDEO_PAUSES, + RICH_MEDIA_VIDEO_PLAYES, + RICH_MEDIA_VIDEO_MIDPOINTS, + RICH_MEDIA_VIDEO_COMPLETES, + RICH_MEDIA_VIDEO_REPLAYS, + RICH_MEDIA_VIDEO_STOPS, + RICH_MEDIA_VIDEO_UNMUTES, + RICH_MEDIA_VIDEO_VIEW_TIME, + RICH_MEDIA_VIDEO_VIEW_RATE, + RICH_MEDIA_CUSTOM_CONVERSION_TIME_VALUE, + RICH_MEDIA_CUSTOM_CONVERSION_COUNT_VALUE, + VIDEO_INTERACTION_START, + VIDEO_INTERACTION_FIRST_QUARTILE, + VIDEO_INTERACTION_MIDPOINT, + VIDEO_INTERACTION_THIRD_QUARTILE, + VIDEO_INTERACTION_COMPLETE, + VIDEO_INTERACTION_VIEW_RATE, + VIDEO_INTERACTION_AVERAGE_VIEW_RATE, + VIDEO_INTERACTION_COMPLETION_RATE, + VIDEO_INTERACTION_ERROR_COUNT, + VIDEO_INTERACTION_VIDEO_LENGTH, + VIDEO_INTERACTION_PAUSE, + VIDEO_INTERACTION_RESUME, + VIDEO_INTERACTION_REWIND, + VIDEO_INTERACTION_MUTE, + VIDEO_INTERACTION_UNMUTE, + VIDEO_INTERACTION_COLLAPSE, + VIDEO_INTERACTION_EXPAND, + VIDEO_INTERACTION_FULL_SCREEN, + VIDEO_INTERACTION_AVERAGE_INTERACTION_RATE, + VIDEO_INTERACTION_VIDEO_SKIPS, + VIDEO_INTERACTION_VIDEO_SKIP_SHOWN, + VIDEO_INTERACTION_ENGAGED_VIEW, + VIDEO_INTERACTION_VIEW_THROUGH_RATE, + VIEW_THROUGH_CONVERSIONS, + CONVERSIONS_PER_THOUSAND_IMPRESSIONS, + CLICK_THROUGH_CONVERSIONS, + CONVERSIONS_PER_CLICK, + VIEW_THROUGH_REVENUE, + CLICK_THROUGH_REVENUE, + TOTAL_CONVERSIONS, + TOTAL_CONVERSION_REVENUE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum DimensionAttribute { + LINE_ITEM_LABELS, + ORDER_START_DATE_TIME, + ORDER_END_DATE_TIME, + ORDER_EXTERNAL_ID, + ORDER_PO_NUMBER, + ORDER_AGENCY, + ORDER_LABELS, + ORDER_TRAFFICKER, + ORDER_SECONDARY_TRAFFICKERS, + ORDER_SALESPERSON, + ORDER_SECONDARY_SALESPEOPLE, + ORDER_LIFETIME_IMPRESSIONS, + ORDER_LIFETIME_CLICKS, + ORDER_LIFETIME_MERGED_IMPRESSIONS, + ORDER_LIFETIME_MERGED_CLICKS, + LINE_ITEM_START_DATE_TIME, + LINE_ITEM_END_DATE_TIME, + LINE_ITEM_EXTERNAL_ID, + LINE_ITEM_COST_TYPE, + LINE_ITEM_COST_PER_UNIT, + LINE_ITEM_GOAL_QUANTITY, + LINE_ITEM_LIFETIME_IMPRESSIONS, + LINE_ITEM_LIFETIME_CLICKS, + LINE_ITEM_LIFETIME_MERGED_IMPRESSIONS, + LINE_ITEM_LIFETIME_MERGED_CLICKS, + CREATIVE_OR_CREATIVE_SET, + MASTER_COMPANION_TYPE, + LINE_ITEM_CONTRACTED_QUANTITY, + ADVERTISER_LABELS, + CREATIVE_CLICK_THROUGH_URL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum DateRangeType { + TODAY, + YESTERDAY, + LAST_WEEK, + LAST_MONTH, + CUSTOM_DATE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum DimensionFilter { + ADVERTISERS, + ACTIVE_ADVERTISERS, + HOUSE_ADVERTISERS, + NON_HOUSE_ADVERTISERS, + ALL_SALESPEOPLE, + WHOLE_NETWORK, + CURRENT_USER_ORDERS, + STARTED_ORDERS, + COMPLETED_ORDERS, + ACTIVE_AD_UNITS, + INACTIVE_AD_UNITS, + ARCHIVED_AD_UNITS, + ACTIVE_PLACEMENTS, + INACTIVE_PLACEMENTS, + ARCHIVED_PLACEMENTS, + OPTIMIZABLE_ORDERS + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ReportJob { + private long idField; + + private bool idFieldSpecified; + + private ReportQuery reportQueryField; + + private ReportJobStatus reportJobStatusField; + + private bool reportJobStatusFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public ReportQuery reportQuery { + get { return this.reportQueryField; } + set { this.reportQueryField = value; } + } + + public ReportJobStatus reportJobStatus { + get { return this.reportJobStatusField; } + set { + this.reportJobStatusField = value; + this.reportJobStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reportJobStatusSpecified { + get { return this.reportJobStatusFieldSpecified; } + set { this.reportJobStatusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum ReportJobStatus { + COMPLETED, + IN_PROGRESS, + FAILED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ReportDownloadOptions { + private ExportFormat exportFormatField; + + private bool exportFormatFieldSpecified; + + private bool includeReportPropertiesField; + + private bool includeReportPropertiesFieldSpecified; + + private bool includeTotalsRowField; + + private bool includeTotalsRowFieldSpecified; + + private bool useGzipCompressionField; + + private bool useGzipCompressionFieldSpecified; + + public ExportFormat exportFormat { + get { return this.exportFormatField; } + set { + this.exportFormatField = value; + this.exportFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool exportFormatSpecified { + get { return this.exportFormatFieldSpecified; } + set { this.exportFormatFieldSpecified = value; } + } + + public bool includeReportProperties { + get { return this.includeReportPropertiesField; } + set { + this.includeReportPropertiesField = value; + this.includeReportPropertiesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeReportPropertiesSpecified { + get { return this.includeReportPropertiesFieldSpecified; } + set { this.includeReportPropertiesFieldSpecified = value; } + } + + public bool includeTotalsRow { + get { return this.includeTotalsRowField; } + set { + this.includeTotalsRowField = value; + this.includeTotalsRowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeTotalsRowSpecified { + get { return this.includeTotalsRowFieldSpecified; } + set { this.includeTotalsRowFieldSpecified = value; } + } + + public bool useGzipCompression { + get { return this.useGzipCompressionField; } + set { + this.useGzipCompressionField = value; + this.useGzipCompressionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool useGzipCompressionSpecified { + get { return this.useGzipCompressionFieldSpecified; } + set { this.useGzipCompressionFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum ExportFormat { + TSV, + CSV_EXCEL, + CSV_DUMP, + XML, + XLS, + XLSX + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ReportError : ApiError { + private ReportErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReportErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum ReportErrorReason { + DEFAULT, + REPORT_ACCESS_NOT_ALLOWED, + DIMENSION_VIEW_NOT_ALLOWED, + DIMENSION_COMBINATION_NOT_ALLOWED, + ATTRIBUTE_VIEW_NOT_ALLOWED, + COLUMN_VIEW_NOT_ALLOWED, + TOO_MANY_CONCURRENT_REPORTS, + REPORT_TOO_BIG, + INVALID_OPERATION_FOR_REPORT_STATE, + INVALID_DIMENSIONS, + INVALID_ATTRIBUTES, + INVALID_COLUMNS, + INVALID_DIMENSION_FILTERS, + INVALID_DATE, + END_DATE_TIME_NOT_AFTER_START_TIME, + NOT_NULL, + ATTRIBUTES_NOT_SUPPORTED_FOR_REQUEST, + COLUMNS_NOT_SUPPORTED_FOR_REQUESTED_DIMENSIONS, + FAILED_TO_STORE_REPORT, + REPORT_NOT_FOUND, + SR_CANNOT_RUN_REPORT_IN_ANOTHER_NETWORK, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "InventoryServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class InventoryService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public InventoryService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/InventoryService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdUnit createAdUnit(AdUnit adUnit) { + object[] results = this.Invoke("createAdUnit", new object[] { adUnit }); + return ((AdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdUnit[] createAdUnits([System.Xml.Serialization.XmlElementAttribute("adUnits")] +AdUnit[] adUnits) { + object[] results = this.Invoke("createAdUnits", new object[] { adUnits }); + return ((AdUnit[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdUnit getAdUnit(string adUnitId) { + object[] results = this.Invoke("getAdUnit", new object[] { adUnitId }); + return ((AdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdUnitSize[] getAdUnitSizesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAdUnitSizesByStatement", new object[] { filterStatement }); + return ((AdUnitSize[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdUnitPage getAdUnitsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAdUnitsByStatement", new object[] { filterStatement }); + return ((AdUnitPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performAdUnitAction(AdUnitAction adUnitAction, Statement filterStatement) { + object[] results = this.Invoke("performAdUnitAction", new object[] { adUnitAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdUnit updateAdUnit(AdUnit adUnit) { + object[] results = this.Invoke("updateAdUnit", new object[] { adUnit }); + return ((AdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdUnit[] updateAdUnits([System.Xml.Serialization.XmlElementAttribute("adUnits")] +AdUnit[] adUnits) { + object[] results = this.Invoke("updateAdUnits", new object[] { adUnits }); + return ((AdUnit[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateAdUnits))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssignAdUnitsToPlacement))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveAdUnits))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateAdUnits))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class AdUnitAction { + private string adUnitActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AdUnitAction.Type")] + public string AdUnitActionType { + get { return this.adUnitActionTypeField; } + set { this.adUnitActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DeactivateAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AssignAdUnitsToPlacement : AdUnitAction { + private long placementIdField; + + private bool placementIdFieldSpecified; + + public long placementId { + get { return this.placementIdField; } + set { + this.placementIdField = value; + this.placementIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool placementIdSpecified { + get { return this.placementIdFieldSpecified; } + set { this.placementIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ArchiveAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ActivateAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AdUnitPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AdUnit[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AdUnit[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AdUnit { + private string idField; + + private string parentIdField; + + private bool hasChildrenField; + + private bool hasChildrenFieldSpecified; + + private AdUnitParent[] parentPathField; + + private string nameField; + + private string descriptionField; + + private AdUnitTargetWindow targetWindowField; + + private bool targetWindowFieldSpecified; + + private InventoryStatus statusField; + + private bool statusFieldSpecified; + + private string adUnitCodeField; + + private AdUnitSize[] adUnitSizesField; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private MobilePlatform mobilePlatformField; + + private bool mobilePlatformFieldSpecified; + + private bool explicitlyTargetedField; + + private bool explicitlyTargetedFieldSpecified; + + private AdSenseSettingsInheritedProperty inheritedAdSenseSettingsField; + + private LabelFrequencyCap[] appliedLabelFrequencyCapsField; + + private LabelFrequencyCap[] effectiveLabelFrequencyCapsField; + + private long[] effectiveTeamIdsField; + + private long[] appliedTeamIdsField; + + private DateTime lastModifiedDateTimeField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string parentId { + get { return this.parentIdField; } + set { this.parentIdField = value; } + } + + public bool hasChildren { + get { return this.hasChildrenField; } + set { + this.hasChildrenField = value; + this.hasChildrenSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasChildrenSpecified { + get { return this.hasChildrenFieldSpecified; } + set { this.hasChildrenFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("parentPath")] + public AdUnitParent[] parentPath { + get { return this.parentPathField; } + set { this.parentPathField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public AdUnitTargetWindow targetWindow { + get { return this.targetWindowField; } + set { + this.targetWindowField = value; + this.targetWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetWindowSpecified { + get { return this.targetWindowFieldSpecified; } + set { this.targetWindowFieldSpecified = value; } + } + + public InventoryStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string adUnitCode { + get { return this.adUnitCodeField; } + set { this.adUnitCodeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adUnitSizes")] + public AdUnitSize[] adUnitSizes { + get { return this.adUnitSizesField; } + set { this.adUnitSizesField = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + public MobilePlatform mobilePlatform { + get { return this.mobilePlatformField; } + set { + this.mobilePlatformField = value; + this.mobilePlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mobilePlatformSpecified { + get { return this.mobilePlatformFieldSpecified; } + set { this.mobilePlatformFieldSpecified = value; } + } + + public bool explicitlyTargeted { + get { return this.explicitlyTargetedField; } + set { + this.explicitlyTargetedField = value; + this.explicitlyTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool explicitlyTargetedSpecified { + get { return this.explicitlyTargetedFieldSpecified; } + set { this.explicitlyTargetedFieldSpecified = value; } + } + + public AdSenseSettingsInheritedProperty inheritedAdSenseSettings { + get { return this.inheritedAdSenseSettingsField; } + set { this.inheritedAdSenseSettingsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabelFrequencyCaps")] + public LabelFrequencyCap[] appliedLabelFrequencyCaps { + get { return this.appliedLabelFrequencyCapsField; } + set { this.appliedLabelFrequencyCapsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveLabelFrequencyCaps")] + public LabelFrequencyCap[] effectiveLabelFrequencyCaps { + get { return this.effectiveLabelFrequencyCapsField; } + set { this.effectiveLabelFrequencyCapsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveTeamIds")] + public long[] effectiveTeamIds { + get { return this.effectiveTeamIdsField; } + set { this.effectiveTeamIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AdUnitParent { + private string idField; + + private string nameField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum InventoryStatus { + ACTIVE, + INACTIVE, + ARCHIVED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum MobilePlatform { + SITE, + APPLICATION + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AdSenseSettingsInheritedProperty { + private AdSenseSettings valueField; + + public AdSenseSettings value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AdSenseSettings { + private bool adSenseEnabledField; + + private bool adSenseEnabledFieldSpecified; + + private string borderColorField; + + private string titleColorField; + + private string backgroundColorField; + + private string textColorField; + + private string urlColorField; + + private AdSenseSettingsAdType adTypeField; + + private bool adTypeFieldSpecified; + + private AdSenseSettingsBorderStyle borderStyleField; + + private bool borderStyleFieldSpecified; + + private AdSenseSettingsFontFamily fontFamilyField; + + private bool fontFamilyFieldSpecified; + + private AdSenseSettingsFontSize fontSizeField; + + private bool fontSizeFieldSpecified; + + private Size_StringMapEntry[] afcFormatsField; + + public bool adSenseEnabled { + get { return this.adSenseEnabledField; } + set { + this.adSenseEnabledField = value; + this.adSenseEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adSenseEnabledSpecified { + get { return this.adSenseEnabledFieldSpecified; } + set { this.adSenseEnabledFieldSpecified = value; } + } + + public string borderColor { + get { return this.borderColorField; } + set { this.borderColorField = value; } + } + + public string titleColor { + get { return this.titleColorField; } + set { this.titleColorField = value; } + } + + public string backgroundColor { + get { return this.backgroundColorField; } + set { this.backgroundColorField = value; } + } + + public string textColor { + get { return this.textColorField; } + set { this.textColorField = value; } + } + + public string urlColor { + get { return this.urlColorField; } + set { this.urlColorField = value; } + } + + public AdSenseSettingsAdType adType { + get { return this.adTypeField; } + set { + this.adTypeField = value; + this.adTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adTypeSpecified { + get { return this.adTypeFieldSpecified; } + set { this.adTypeFieldSpecified = value; } + } + + public AdSenseSettingsBorderStyle borderStyle { + get { return this.borderStyleField; } + set { + this.borderStyleField = value; + this.borderStyleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool borderStyleSpecified { + get { return this.borderStyleFieldSpecified; } + set { this.borderStyleFieldSpecified = value; } + } + + public AdSenseSettingsFontFamily fontFamily { + get { return this.fontFamilyField; } + set { + this.fontFamilyField = value; + this.fontFamilySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fontFamilySpecified { + get { return this.fontFamilyFieldSpecified; } + set { this.fontFamilyFieldSpecified = value; } + } + + public AdSenseSettingsFontSize fontSize { + get { return this.fontSizeField; } + set { + this.fontSizeField = value; + this.fontSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fontSizeSpecified { + get { return this.fontSizeFieldSpecified; } + set { this.fontSizeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("afcFormats")] + public Size_StringMapEntry[] afcFormats { + get { return this.afcFormatsField; } + set { this.afcFormatsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.AdType", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum AdSenseSettingsAdType { + TEXT, + IMAGE, + TEXT_AND_IMAGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.BorderStyle", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum AdSenseSettingsBorderStyle { + DEFAULT, + NOT_ROUNDED, + SLIGHTLY_ROUNDED, + VERY_ROUNDED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.FontFamily", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum AdSenseSettingsFontFamily { + DEFAULT, + ARIAL, + TAHOMA, + GEORGIA, + TIMES, + VERDANA + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.FontSize", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum AdSenseSettingsFontSize { + DEFAULT, + SMALL, + MEDIUM, + LARGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class Size_StringMapEntry { + private Size keyField; + + private string valueField; + + public Size key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class LabelFrequencyCap { + private FrequencyCap frequencyCapField; + + private long labelIdField; + + private bool labelIdFieldSpecified; + + public FrequencyCap frequencyCap { + get { return this.frequencyCapField; } + set { this.frequencyCapField = value; } + } + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AdUnitTypeError : ApiError { + private AdUnitTypeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitTypeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitTypeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum AdUnitTypeErrorReason { + MOBILE_APP_PLATFORM_NOT_VALID, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class InventoryUnitSizesError : ApiError { + private InventoryUnitSizesErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitSizesErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitSizesError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum InventoryUnitSizesErrorReason { + INVALID_SIZES, + INVALID_SIZE_FOR_PLATFORM, + INVALID_SIZE_FOR_ENVIRONMENT, + INVALID_SIZE_FOR_MASTER, + INVALID_SIZE_FOR_COMPANION, + DUPLICATE_MASTER_SIZES, + ASPECT_RATIO_NOT_SUPPORTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class InventoryUnitPartnerAssociationError : ApiError { + private InventoryUnitPartnerAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitPartnerAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitPartnerAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum InventoryUnitPartnerAssociationErrorReason { + ANCESTOR_AD_UNIT_HAS_PARTNER_ASSOCIATION, + DESCENDANT_AD_UNIT_HAS_PARTNER_ASSOCIATION, + SAME_PARTNER_ASSOCIATION_IN_INVENTORY_HIERARCHY, + NO_PARTNER_CATCH_ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class InvalidColorError : ApiError { + private InvalidColorErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidColorErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidColorError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum InvalidColorErrorReason { + INVALID_FORMAT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CreativeWrapperError : ApiError { + private CreativeWrapperErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeWrapperErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeWrapperError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CreativeWrapperErrorReason { + LABEL_ALREADY_ASSOCIATED_WITH_CREATIVE_WRAPPER, + INVALID_LABEL_TYPE, + UNRECOGNIZED_MACRO, + NEITHER_HEADER_NOR_FOOTER_SPECIFIED, + CANNOT_USE_CREATIVE_WRAPPER_TYPE, + CANNOT_UPDATE_LABEL_ID, + CANNOT_APPLY_TO_AD_UNIT_WITH_VIDEO_SIZES, + CANNOT_APPLY_TO_MOBILE_AD_UNIT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AdSenseAccountError : ApiError { + private AdSenseAccountErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdSenseAccountErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseAccountError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum AdSenseAccountErrorReason { + ASSOCIATE_ACCOUNT_API_ERROR, + GET_AD_SLOT_API_ERROR, + GET_BULK_ACCOUNT_STATUSES_API_ERROR, + RESEND_VERIFICATION_EMAIL_ERROR, + UNEXPECTED_API_RESPONSE_ERROR, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeTemplateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeTemplateService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeTemplateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/CreativeTemplateService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeTemplate getCreativeTemplate(long creativeTemplateId) { + object[] results = this.Invoke("getCreativeTemplate", new object[] { creativeTemplateId }); + return ((CreativeTemplate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeTemplatePage getCreativeTemplatesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativeTemplatesByStatement", new object[] { filterStatement }); + return ((CreativeTemplatePage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CreativeTemplatePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeTemplate[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeTemplate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CreativeTemplate { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private CreativeTemplateVariable[] variablesField; + + private CreativeTemplateStatus statusField; + + private bool statusFieldSpecified; + + private CreativeTemplateType typeField; + + private bool typeFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("variables")] + public CreativeTemplateVariable[] variables { + get { return this.variablesField; } + set { this.variablesField = value; } + } + + public CreativeTemplateStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public CreativeTemplateType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UrlCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListStringCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetCreativeTemplateVariable))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class CreativeTemplateVariable { + private string labelField; + + private string uniqueNameField; + + private string descriptionField; + + private bool isRequiredField; + + private bool isRequiredFieldSpecified; + + private string creativeTemplateVariableTypeField; + + public string label { + get { return this.labelField; } + set { this.labelField = value; } + } + + public string uniqueName { + get { return this.uniqueNameField; } + set { this.uniqueNameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isRequired { + get { return this.isRequiredField; } + set { + this.isRequiredField = value; + this.isRequiredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isRequiredSpecified { + get { return this.isRequiredFieldSpecified; } + set { this.isRequiredFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("CreativeTemplateVariable.Type")] + public string CreativeTemplateVariableType { + get { return this.creativeTemplateVariableTypeField; } + set { this.creativeTemplateVariableTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class UrlCreativeTemplateVariable : CreativeTemplateVariable { + private string defaultValueField; + + public string defaultValue { + get { return this.defaultValueField; } + set { this.defaultValueField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListStringCreativeTemplateVariable))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class StringCreativeTemplateVariable : CreativeTemplateVariable { + private string defaultValueField; + + public string defaultValue { + get { return this.defaultValueField; } + set { this.defaultValueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ListStringCreativeTemplateVariable : StringCreativeTemplateVariable { + private ListStringCreativeTemplateVariableVariableChoice[] choicesField; + + private bool allowOtherChoiceField; + + private bool allowOtherChoiceFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("choices")] + public ListStringCreativeTemplateVariableVariableChoice[] choices { + get { return this.choicesField; } + set { this.choicesField = value; } + } + + public bool allowOtherChoice { + get { return this.allowOtherChoiceField; } + set { + this.allowOtherChoiceField = value; + this.allowOtherChoiceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowOtherChoiceSpecified { + get { return this.allowOtherChoiceFieldSpecified; } + set { this.allowOtherChoiceFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ListStringCreativeTemplateVariable.VariableChoice", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ListStringCreativeTemplateVariableVariableChoice { + private string labelField; + + private string valueField; + + public string label { + get { return this.labelField; } + set { this.labelField = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class LongCreativeTemplateVariable : CreativeTemplateVariable { + private long defaultValueField; + + private bool defaultValueFieldSpecified; + + public long defaultValue { + get { return this.defaultValueField; } + set { + this.defaultValueField = value; + this.defaultValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool defaultValueSpecified { + get { return this.defaultValueFieldSpecified; } + set { this.defaultValueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AssetCreativeTemplateVariable : CreativeTemplateVariable { + private AssetCreativeTemplateVariableMimeType[] mimeTypesField; + + [System.Xml.Serialization.XmlElementAttribute("mimeTypes")] + public AssetCreativeTemplateVariableMimeType[] mimeTypes { + get { return this.mimeTypesField; } + set { this.mimeTypesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AssetCreativeTemplateVariable.MimeType", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum AssetCreativeTemplateVariableMimeType { + JPG, + PNG, + GIF, + SWF + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CreativeTemplateStatus { + ACTIVE, + INACTIVE, + DELETED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CreativeTemplateType { + SYSTEM_DEFINED, + USER_DEFINED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CreativeTemplateError : ApiError { + private CreativeTemplateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeTemplateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeTemplateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CreativeTemplateErrorReason { + CANNOT_PARSE_CREATIVE_TEMPLATE, + VARIABLE_DUPLICATE_UNIQUE_NAME, + VARIABLE_INVALID_UNIQUE_NAME, + LIST_CHOICE_DUPLICATE_VALUE, + LIST_CHOICE_NEEDS_DEFAULT, + LIST_CHOICES_EMPTY, + NO_TARGET_PLATFORMS, + MULTIPLE_TARGET_PLATFORMS, + UNRECOGNIZED_PLACEHOLDER, + PLACEHOLDERS_NOT_IN_FORMATTER, + MISSING_INTERSTITIAL_MACRO, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "PlacementServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SiteTargetingInfo))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class PlacementService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public PlacementService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/PlacementService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Placement createPlacement(Placement placement) { + object[] results = this.Invoke("createPlacement", new object[] { placement }); + return ((Placement) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Placement[] createPlacements([System.Xml.Serialization.XmlElementAttribute("placements")] +Placement[] placements) { + object[] results = this.Invoke("createPlacements", new object[] { placements }); + return ((Placement[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Placement getPlacement(long placementId) { + object[] results = this.Invoke("getPlacement", new object[] { placementId }); + return ((Placement) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public PlacementPage getPlacementsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getPlacementsByStatement", new object[] { filterStatement }); + return ((PlacementPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performPlacementAction(PlacementAction placementAction, Statement filterStatement) { + object[] results = this.Invoke("performPlacementAction", new object[] { placementAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Placement updatePlacement(Placement placement) { + object[] results = this.Invoke("updatePlacement", new object[] { placement }); + return ((Placement) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Placement[] updatePlacements([System.Xml.Serialization.XmlElementAttribute("placements")] +Placement[] placements) { + object[] results = this.Invoke("updatePlacements", new object[] { placements }); + return ((Placement[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivatePlacements))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchivePlacements))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivatePlacements))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class PlacementAction { + private string placementActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("PlacementAction.Type")] + public string PlacementActionType { + get { return this.placementActionTypeField; } + set { this.placementActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DeactivatePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ArchivePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ActivatePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class PlacementPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Placement[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Placement[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class Placement : SiteTargetingInfo { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private string placementCodeField; + + private InventoryStatus statusField; + + private bool statusFieldSpecified; + + private bool isAdSenseTargetingEnabledField; + + private bool isAdSenseTargetingEnabledFieldSpecified; + + private bool isAdPlannerTargetingEnabledField; + + private bool isAdPlannerTargetingEnabledFieldSpecified; + + private string adSenseTargetingLocaleField; + + private string[] targetedAdUnitIdsField; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public string placementCode { + get { return this.placementCodeField; } + set { this.placementCodeField = value; } + } + + public InventoryStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public bool isAdSenseTargetingEnabled { + get { return this.isAdSenseTargetingEnabledField; } + set { + this.isAdSenseTargetingEnabledField = value; + this.isAdSenseTargetingEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAdSenseTargetingEnabledSpecified { + get { return this.isAdSenseTargetingEnabledFieldSpecified; } + set { this.isAdSenseTargetingEnabledFieldSpecified = value; } + } + + public bool isAdPlannerTargetingEnabled { + get { return this.isAdPlannerTargetingEnabledField; } + set { + this.isAdPlannerTargetingEnabledField = value; + this.isAdPlannerTargetingEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAdPlannerTargetingEnabledSpecified { + get { return this.isAdPlannerTargetingEnabledFieldSpecified; } + set { this.isAdPlannerTargetingEnabledFieldSpecified = value; } + } + + public string adSenseTargetingLocale { + get { return this.adSenseTargetingLocaleField; } + set { this.adSenseTargetingLocaleField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedAdUnitIds")] + public string[] targetedAdUnitIds { + get { return this.targetedAdUnitIdsField; } + set { this.targetedAdUnitIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Placement))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class SiteTargetingInfo { + private string targetingDescriptionField; + + private string targetingSiteNameField; + + private string targetingAdLocationField; + + private string siteTargetingInfoTypeField; + + public string targetingDescription { + get { return this.targetingDescriptionField; } + set { this.targetingDescriptionField = value; } + } + + public string targetingSiteName { + get { return this.targetingSiteNameField; } + set { this.targetingSiteNameField = value; } + } + + public string targetingAdLocation { + get { return this.targetingAdLocationField; } + set { this.targetingAdLocationField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("SiteTargetingInfo.Type")] + public string SiteTargetingInfoType { + get { return this.siteTargetingInfoTypeField; } + set { this.siteTargetingInfoTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class PlacementError : ApiError { + private PlacementErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PlacementErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PlacementError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum PlacementErrorReason { + INVALID_ENTITY_TYPE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "OrderServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class OrderService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public OrderService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/OrderService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Order createOrder(Order order) { + object[] results = this.Invoke("createOrder", new object[] { order }); + return ((Order) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Order[] createOrders([System.Xml.Serialization.XmlElementAttribute("orders")] +Order[] orders) { + object[] results = this.Invoke("createOrders", new object[] { orders }); + return ((Order[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Order getOrder(long orderId) { + object[] results = this.Invoke("getOrder", new object[] { orderId }); + return ((Order) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public OrderPage getOrdersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getOrdersByStatement", new object[] { filterStatement }); + return ((OrderPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performOrderAction(OrderAction orderAction, Statement filterStatement) { + object[] results = this.Invoke("performOrderAction", new object[] { orderAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Order updateOrder(Order order) { + object[] results = this.Invoke("updateOrder", new object[] { order }); + return ((Order) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Order[] updateOrders([System.Xml.Serialization.XmlElementAttribute("orders")] +Order[] orders) { + object[] results = this.Invoke("updateOrders", new object[] { orders }); + return ((Order[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApproval))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalAndOverbook))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RetractOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RetractOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PauseOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DisapproveOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DisapproveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class OrderAction { + private string orderActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("OrderAction.Type")] + public string OrderActionType { + get { return this.orderActionTypeField; } + set { this.orderActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class UnarchiveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class SubmitOrdersForApprovalWithoutReservationChanges : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalAndOverbook))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class SubmitOrdersForApproval : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class SubmitOrdersForApprovalAndOverbook : SubmitOrdersForApproval { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class RetractOrdersWithoutReservationChanges : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class RetractOrders : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ResumeOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ResumeAndOverbookOrders : ResumeOrders { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class PauseOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DisapproveOrdersWithoutReservationChanges : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DisapproveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DeleteOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ArchiveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ApproveOrdersWithoutReservationChanges : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ApproveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ApproveAndOverbookOrders : ApproveOrders { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class OrderPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Order[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Order[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class Order { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private OrderStatus statusField; + + private bool statusFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private string notesField; + + private int externalOrderIdField; + + private bool externalOrderIdFieldSpecified; + + private string poNumberField; + + private string currencyCodeField; + + private long advertiserIdField; + + private bool advertiserIdFieldSpecified; + + private long agencyIdField; + + private bool agencyIdFieldSpecified; + + private long creatorIdField; + + private bool creatorIdFieldSpecified; + + private long traffickerIdField; + + private bool traffickerIdFieldSpecified; + + private long[] secondaryTraffickerIdsField; + + private long salespersonIdField; + + private bool salespersonIdFieldSpecified; + + private long[] secondarySalespersonIdsField; + + private long totalImpressionsDeliveredField; + + private bool totalImpressionsDeliveredFieldSpecified; + + private long totalClicksDeliveredField; + + private bool totalClicksDeliveredFieldSpecified; + + private Money totalBudgetField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private string lastModifiedByAppField; + + private long[] appliedTeamIdsField; + + private DateTime lastModifiedDateTimeField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public OrderStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public int externalOrderId { + get { return this.externalOrderIdField; } + set { + this.externalOrderIdField = value; + this.externalOrderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool externalOrderIdSpecified { + get { return this.externalOrderIdFieldSpecified; } + set { this.externalOrderIdFieldSpecified = value; } + } + + public string poNumber { + get { return this.poNumberField; } + set { this.poNumberField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public long advertiserId { + get { return this.advertiserIdField; } + set { + this.advertiserIdField = value; + this.advertiserIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserIdSpecified { + get { return this.advertiserIdFieldSpecified; } + set { this.advertiserIdFieldSpecified = value; } + } + + public long agencyId { + get { return this.agencyIdField; } + set { + this.agencyIdField = value; + this.agencyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool agencyIdSpecified { + get { return this.agencyIdFieldSpecified; } + set { this.agencyIdFieldSpecified = value; } + } + + public long creatorId { + get { return this.creatorIdField; } + set { + this.creatorIdField = value; + this.creatorIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creatorIdSpecified { + get { return this.creatorIdFieldSpecified; } + set { this.creatorIdFieldSpecified = value; } + } + + public long traffickerId { + get { return this.traffickerIdField; } + set { + this.traffickerIdField = value; + this.traffickerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool traffickerIdSpecified { + get { return this.traffickerIdFieldSpecified; } + set { this.traffickerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryTraffickerIds")] + public long[] secondaryTraffickerIds { + get { return this.secondaryTraffickerIdsField; } + set { this.secondaryTraffickerIdsField = value; } + } + + public long salespersonId { + get { return this.salespersonIdField; } + set { + this.salespersonIdField = value; + this.salespersonIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool salespersonIdSpecified { + get { return this.salespersonIdFieldSpecified; } + set { this.salespersonIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondarySalespersonIds")] + public long[] secondarySalespersonIds { + get { return this.secondarySalespersonIdsField; } + set { this.secondarySalespersonIdsField = value; } + } + + public long totalImpressionsDelivered { + get { return this.totalImpressionsDeliveredField; } + set { + this.totalImpressionsDeliveredField = value; + this.totalImpressionsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalImpressionsDeliveredSpecified { + get { return this.totalImpressionsDeliveredFieldSpecified; } + set { this.totalImpressionsDeliveredFieldSpecified = value; } + } + + public long totalClicksDelivered { + get { return this.totalClicksDeliveredField; } + set { + this.totalClicksDeliveredField = value; + this.totalClicksDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalClicksDeliveredSpecified { + get { return this.totalClicksDeliveredFieldSpecified; } + set { this.totalClicksDeliveredFieldSpecified = value; } + } + + public Money totalBudget { + get { return this.totalBudgetField; } + set { this.totalBudgetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public string lastModifiedByApp { + get { return this.lastModifiedByAppField; } + set { this.lastModifiedByAppField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum OrderStatus { + DRAFT, + PENDING_APPROVAL, + APPROVED, + DISAPPROVED, + PAUSED, + CANCELED, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "UserTeamAssociationServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserRecordTeamAssociation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class UserTeamAssociationService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public UserTeamAssociationService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/UserTeamAssociationService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UserTeamAssociation createUserTeamAssociation(UserTeamAssociation userTeamAssociation) { + object[] results = this.Invoke("createUserTeamAssociation", new object[] { userTeamAssociation }); + return ((UserTeamAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UserTeamAssociation[] createUserTeamAssociations([System.Xml.Serialization.XmlElementAttribute("userTeamAssociations")] +UserTeamAssociation[] userTeamAssociations) { + object[] results = this.Invoke("createUserTeamAssociations", new object[] { userTeamAssociations }); + return ((UserTeamAssociation[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UserTeamAssociation getUserTeamAssociation(long teamId, long userId) { + object[] results = this.Invoke("getUserTeamAssociation", new object[] { teamId, userId }); + return ((UserTeamAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UserTeamAssociationPage getUserTeamAssociationsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getUserTeamAssociationsByStatement", new object[] { filterStatement }); + return ((UserTeamAssociationPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performUserTeamAssociationAction(UserTeamAssociationAction userTeamAssociationAction, Statement statement) { + object[] results = this.Invoke("performUserTeamAssociationAction", new object[] { userTeamAssociationAction, statement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UserTeamAssociation updateUserTeamAssociation(UserTeamAssociation userTeamAssociation) { + object[] results = this.Invoke("updateUserTeamAssociation", new object[] { userTeamAssociation }); + return ((UserTeamAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UserTeamAssociation[] updateUserTeamAssociations([System.Xml.Serialization.XmlElementAttribute("userTeamAssociations")] +UserTeamAssociation[] userTeamAssociations) { + object[] results = this.Invoke("updateUserTeamAssociations", new object[] { userTeamAssociations }); + return ((UserTeamAssociation[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteUserTeamAssociations))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class UserTeamAssociationAction { + private string userTeamAssociationActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("UserTeamAssociationAction.Type")] + public string UserTeamAssociationActionType { + get { return this.userTeamAssociationActionTypeField; } + set { this.userTeamAssociationActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DeleteUserTeamAssociations : UserTeamAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class UserTeamAssociationPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private UserTeamAssociation[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public UserTeamAssociation[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class UserTeamAssociation : UserRecordTeamAssociation { + private long userIdField; + + private bool userIdFieldSpecified; + + public long userId { + get { return this.userIdField; } + set { + this.userIdField = value; + this.userIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userIdSpecified { + get { return this.userIdFieldSpecified; } + set { this.userIdFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserTeamAssociation))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class UserRecordTeamAssociation { + private long teamIdField; + + private bool teamIdFieldSpecified; + + private TeamAccessType overriddenTeamAccessTypeField; + + private bool overriddenTeamAccessTypeFieldSpecified; + + private TeamAccessType defaultTeamAccessTypeField; + + private bool defaultTeamAccessTypeFieldSpecified; + + private string userRecordTeamAssociationTypeField; + + public long teamId { + get { return this.teamIdField; } + set { + this.teamIdField = value; + this.teamIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool teamIdSpecified { + get { return this.teamIdFieldSpecified; } + set { this.teamIdFieldSpecified = value; } + } + + public TeamAccessType overriddenTeamAccessType { + get { return this.overriddenTeamAccessTypeField; } + set { + this.overriddenTeamAccessTypeField = value; + this.overriddenTeamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overriddenTeamAccessTypeSpecified { + get { return this.overriddenTeamAccessTypeFieldSpecified; } + set { this.overriddenTeamAccessTypeFieldSpecified = value; } + } + + public TeamAccessType defaultTeamAccessType { + get { return this.defaultTeamAccessTypeField; } + set { + this.defaultTeamAccessTypeField = value; + this.defaultTeamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool defaultTeamAccessTypeSpecified { + get { return this.defaultTeamAccessTypeFieldSpecified; } + set { this.defaultTeamAccessTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("UserRecordTeamAssociation.Type")] + public string UserRecordTeamAssociationType { + get { return this.userRecordTeamAssociationTypeField; } + set { this.userRecordTeamAssociationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CompanyServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CompanyService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CompanyService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/CompanyService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Company[] createCompanies([System.Xml.Serialization.XmlElementAttribute("companies")] +Company[] companies) { + object[] results = this.Invoke("createCompanies", new object[] { companies }); + return ((Company[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Company createCompany(Company company) { + object[] results = this.Invoke("createCompany", new object[] { company }); + return ((Company) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CompanyPage getCompaniesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCompaniesByStatement", new object[] { filterStatement }); + return ((CompanyPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Company getCompany(long companyId) { + object[] results = this.Invoke("getCompany", new object[] { companyId }); + return ((Company) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Company[] updateCompanies([System.Xml.Serialization.XmlElementAttribute("companies")] +Company[] companies) { + object[] results = this.Invoke("updateCompanies", new object[] { companies }); + return ((Company[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Company updateCompany(Company company) { + object[] results = this.Invoke("updateCompany", new object[] { company }); + return ((Company) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CompanyPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Company[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Company[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class Company { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private CompanyType typeField; + + private bool typeFieldSpecified; + + private string addressField; + + private string emailField; + + private string faxPhoneField; + + private string primaryPhoneField; + + private string externalIdField; + + private string commentField; + + private CompanyCreditStatus creditStatusField; + + private bool creditStatusFieldSpecified; + + private AppliedLabel[] appliedLabelsField; + + private bool enableSameAdvertiserCompetitiveExclusionField; + + private bool enableSameAdvertiserCompetitiveExclusionFieldSpecified; + + private long[] appliedTeamIdsField; + + private int thirdPartyCompanyIdField; + + private bool thirdPartyCompanyIdFieldSpecified; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public CompanyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public string address { + get { return this.addressField; } + set { this.addressField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public string faxPhone { + get { return this.faxPhoneField; } + set { this.faxPhoneField = value; } + } + + public string primaryPhone { + get { return this.primaryPhoneField; } + set { this.primaryPhoneField = value; } + } + + public string externalId { + get { return this.externalIdField; } + set { this.externalIdField = value; } + } + + public string comment { + get { return this.commentField; } + set { this.commentField = value; } + } + + public CompanyCreditStatus creditStatus { + get { return this.creditStatusField; } + set { + this.creditStatusField = value; + this.creditStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creditStatusSpecified { + get { return this.creditStatusFieldSpecified; } + set { this.creditStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + public bool enableSameAdvertiserCompetitiveExclusion { + get { return this.enableSameAdvertiserCompetitiveExclusionField; } + set { + this.enableSameAdvertiserCompetitiveExclusionField = value; + this.enableSameAdvertiserCompetitiveExclusionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool enableSameAdvertiserCompetitiveExclusionSpecified { + get { return this.enableSameAdvertiserCompetitiveExclusionFieldSpecified; } + set { this.enableSameAdvertiserCompetitiveExclusionFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public int thirdPartyCompanyId { + get { return this.thirdPartyCompanyIdField; } + set { + this.thirdPartyCompanyIdField = value; + this.thirdPartyCompanyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyCompanyIdSpecified { + get { return this.thirdPartyCompanyIdFieldSpecified; } + set { this.thirdPartyCompanyIdFieldSpecified = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Company.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CompanyType { + HOUSE_ADVERTISER, + HOUSE_AGENCY, + ADVERTISER, + AGENCY, + AD_NETWORK, + AFFILIATE_DISTRIBUTION_PARTNER, + CONTENT_PARTNER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Company.CreditStatus", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CompanyCreditStatus { + ACTIVE, + ON_HOLD, + CREDIT_STOP, + INACTIVE, + BLOCKED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CompanyError : ApiError { + private CompanyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CompanyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CompanyError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum CompanyErrorReason { + CANNOT_SET_THIRD_PARTY_COMPANY_DUE_TO_TYPE, + CANNOT_UPDATE_COMPANY_TYPE, + INVALID_COMPANY_TYPE, + PRIMARY_CONTACT_DOES_NOT_BELONG_TO_THIS_COMPANY, + THIRD_PARTY_STATS_PROVIDER_IS_WRONG_ROLE_TYPE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "UserServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserRecord))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class UserService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public UserService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/UserService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public User createUser(User user) { + object[] results = this.Invoke("createUser", new object[] { user }); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public User[] createUsers([System.Xml.Serialization.XmlElementAttribute("users")] +User[] users) { + object[] results = this.Invoke("createUsers", new object[] { users }); + return ((User[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Role[] getAllRoles() { + object[] results = this.Invoke("getAllRoles", new object[0]); + return ((Role[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public User getCurrentUser() { + object[] results = this.Invoke("getCurrentUser", new object[0]); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public User getUser(long userId) { + object[] results = this.Invoke("getUser", new object[] { userId }); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UserPage getUsersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getUsersByStatement", new object[] { filterStatement }); + return ((UserPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performUserAction(UserAction userAction, Statement filterStatement) { + object[] results = this.Invoke("performUserAction", new object[] { userAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public User updateUser(User user) { + object[] results = this.Invoke("updateUser", new object[] { user }); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public User[] updateUsers([System.Xml.Serialization.XmlElementAttribute("users")] +User[] users) { + object[] results = this.Invoke("updateUsers", new object[] { users }); + return ((User[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateUsers))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateUsers))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class UserAction { + private string userActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("UserAction.Type")] + public string UserActionType { + get { return this.userActionTypeField; } + set { this.userActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DeactivateUsers : UserAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ActivateUsers : UserAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class UserPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private User[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public User[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class User : UserRecord { + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private bool isEmailNotificationAllowedField; + + private bool isEmailNotificationAllowedFieldSpecified; + + private string ordersUiLocalTimeZoneIdField; + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + public bool isEmailNotificationAllowed { + get { return this.isEmailNotificationAllowedField; } + set { + this.isEmailNotificationAllowedField = value; + this.isEmailNotificationAllowedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isEmailNotificationAllowedSpecified { + get { return this.isEmailNotificationAllowedFieldSpecified; } + set { this.isEmailNotificationAllowedFieldSpecified = value; } + } + + public string ordersUiLocalTimeZoneId { + get { return this.ordersUiLocalTimeZoneIdField; } + set { this.ordersUiLocalTimeZoneIdField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(User))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class UserRecord { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string emailField; + + private long roleIdField; + + private bool roleIdFieldSpecified; + + private string roleNameField; + + private string preferredLocaleField; + + private string userRecordTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public long roleId { + get { return this.roleIdField; } + set { + this.roleIdField = value; + this.roleIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roleIdSpecified { + get { return this.roleIdFieldSpecified; } + set { this.roleIdFieldSpecified = value; } + } + + public string roleName { + get { return this.roleNameField; } + set { this.roleNameField = value; } + } + + public string preferredLocale { + get { return this.preferredLocaleField; } + set { this.preferredLocaleField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("UserRecord.Type")] + public string UserRecordType { + get { return this.userRecordTypeField; } + set { this.userRecordTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class Role { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LabelServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LabelService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LabelService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/LabelService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Label createLabel(Label label) { + object[] results = this.Invoke("createLabel", new object[] { label }); + return ((Label) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Label[] createLabels([System.Xml.Serialization.XmlElementAttribute("labels")] +Label[] labels) { + object[] results = this.Invoke("createLabels", new object[] { labels }); + return ((Label[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Label getLabel(long labelId) { + object[] results = this.Invoke("getLabel", new object[] { labelId }); + return ((Label) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LabelPage getLabelsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLabelsByStatement", new object[] { filterStatement }); + return ((LabelPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performLabelAction(LabelAction labelAction, Statement filterStatement) { + object[] results = this.Invoke("performLabelAction", new object[] { labelAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Label updateLabel(Label label) { + object[] results = this.Invoke("updateLabel", new object[] { label }); + return ((Label) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Label[] updateLabels([System.Xml.Serialization.XmlElementAttribute("labels")] +Label[] labels) { + object[] results = this.Invoke("updateLabels", new object[] { labels }); + return ((Label[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateLabels))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLabels))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class LabelAction { + private string labelActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LabelAction.Type")] + public string LabelActionType { + get { return this.labelActionTypeField; } + set { this.labelActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DeactivateLabels : LabelAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ActivateLabels : LabelAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class LabelPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Label[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Label[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class Label { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private LabelType[] typesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("types")] + public LabelType[] types { + get { return this.typesField; } + set { this.typesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum LabelType { + COMPETITIVE_EXCLUSION, + AD_UNIT_FREQUENCY_CAP, + AD_EXCLUSION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class LabelError : ApiError { + private LabelErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LabelErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LabelError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum LabelErrorReason { + INVALID_PREFIX, + NAME_INVALID_CHARS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ForecastServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ForecastService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ForecastService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/ForecastService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Forecast getForecast(LineItem lineItem) { + object[] results = this.Invoke("getForecast", new object[] { lineItem }); + return ((Forecast) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Forecast getForecastById(long lineItemId) { + object[] results = this.Invoke("getForecastById", new object[] { lineItemId }); + return ((Forecast) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class Forecast { + private long idField; + + private bool idFieldSpecified; + + private long orderIdField; + + private bool orderIdFieldSpecified; + + private UnitType unitTypeField; + + private bool unitTypeFieldSpecified; + + private long availableUnitsField; + + private bool availableUnitsFieldSpecified; + + private long deliveredUnitsField; + + private bool deliveredUnitsFieldSpecified; + + private long matchedUnitsField; + + private bool matchedUnitsFieldSpecified; + + private long possibleUnitsField; + + private bool possibleUnitsFieldSpecified; + + private long reservedUnitsField; + + private bool reservedUnitsFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public UnitType unitType { + get { return this.unitTypeField; } + set { + this.unitTypeField = value; + this.unitTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitTypeSpecified { + get { return this.unitTypeFieldSpecified; } + set { this.unitTypeFieldSpecified = value; } + } + + public long availableUnits { + get { return this.availableUnitsField; } + set { + this.availableUnitsField = value; + this.availableUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool availableUnitsSpecified { + get { return this.availableUnitsFieldSpecified; } + set { this.availableUnitsFieldSpecified = value; } + } + + public long deliveredUnits { + get { return this.deliveredUnitsField; } + set { + this.deliveredUnitsField = value; + this.deliveredUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveredUnitsSpecified { + get { return this.deliveredUnitsFieldSpecified; } + set { this.deliveredUnitsFieldSpecified = value; } + } + + public long matchedUnits { + get { return this.matchedUnitsField; } + set { + this.matchedUnitsField = value; + this.matchedUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool matchedUnitsSpecified { + get { return this.matchedUnitsFieldSpecified; } + set { this.matchedUnitsFieldSpecified = value; } + } + + public long possibleUnits { + get { return this.possibleUnitsField; } + set { + this.possibleUnitsField = value; + this.possibleUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool possibleUnitsSpecified { + get { return this.possibleUnitsFieldSpecified; } + set { this.possibleUnitsFieldSpecified = value; } + } + + public long reservedUnits { + get { return this.reservedUnitsField; } + set { + this.reservedUnitsField = value; + this.reservedUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reservedUnitsSpecified { + get { return this.reservedUnitsFieldSpecified; } + set { this.reservedUnitsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Asset))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/CreativeService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Creative createCreative(Creative creative) { + object[] results = this.Invoke("createCreative", new object[] { creative }); + return ((Creative) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Creative[] createCreatives([System.Xml.Serialization.XmlElementAttribute("creatives")] +Creative[] creatives) { + object[] results = this.Invoke("createCreatives", new object[] { creatives }); + return ((Creative[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Creative getCreative(long creativeId) { + object[] results = this.Invoke("getCreative", new object[] { creativeId }); + return ((Creative) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativePage getCreativesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativesByStatement", new object[] { filterStatement }); + return ((CreativePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Creative updateCreative(Creative creative) { + object[] results = this.Invoke("updateCreative", new object[] { creative }); + return ((Creative) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Creative[] updateCreatives([System.Xml.Serialization.XmlElementAttribute("creatives")] +Creative[] creatives) { + object[] results = this.Invoke("updateCreatives", new object[] { creatives }); + return ((Creative[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CreativePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Creative[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Creative[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VastRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnsupportedCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ThirdPartyCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TemplateCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InternalRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasDestinationUrlCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TextAdCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FloatingFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashPushdownCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashExpandableCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpMobileCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseVideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AspectRatioImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClickTrackingCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseRichMediaStudioCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasHtmlSnippetDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class Creative { + private long advertiserIdField; + + private bool advertiserIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private Size sizeField; + + private string previewUrlField; + + private AppliedLabel[] appliedLabelsField; + + private DateTime lastModifiedDateTimeField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private string creativeTypeField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { + this.advertiserIdField = value; + this.advertiserIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserIdSpecified { + get { return this.advertiserIdFieldSpecified; } + set { this.advertiserIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + public string previewUrl { + get { return this.previewUrlField; } + set { this.previewUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Creative.Type")] + public string CreativeType { + get { return this.creativeTypeField; } + set { this.creativeTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class VastRedirectCreative : Creative { + private string vastXmlUrlField; + + private VastRedirectType vastRedirectTypeField; + + private bool vastRedirectTypeFieldSpecified; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + public string vastXmlUrl { + get { return this.vastXmlUrlField; } + set { this.vastXmlUrlField = value; } + } + + public VastRedirectType vastRedirectType { + get { return this.vastRedirectTypeField; } + set { + this.vastRedirectTypeField = value; + this.vastRedirectTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool vastRedirectTypeSpecified { + get { return this.vastRedirectTypeFieldSpecified; } + set { this.vastRedirectTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum VastRedirectType { + LINEAR, + NON_LINEAR, + LINEAR_AND_NON_LINEAR + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ConversionEvent_TrackingUrlsMapEntry { + private ConversionEvent keyField; + + private bool keyFieldSpecified; + + private string[] valueField; + + public ConversionEvent key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("urls", IsNullable = false)] + public string[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum ConversionEvent { + CREATIVE_VIEW, + START, + SKIP_SHOWN, + FIRST_QUARTILE, + MIDPOINT, + THIRD_QUARTILE, + ENGAGED_VIEW, + COMPLETE, + MUTE, + UNMUTE, + PAUSE, + REWIND, + RESUME, + SKIPPED, + FULLSCREEN, + EXPAND, + COLLAPSE, + ACCEPT_INVITATION, + CLOSE, + CLICK_TRACKING, + SURVEY, + CUSTOM_CLICK + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class UnsupportedCreative : Creative { + private string unsupportedCreativeTypeField; + + public string unsupportedCreativeType { + get { return this.unsupportedCreativeTypeField; } + set { this.unsupportedCreativeTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ThirdPartyCreative : Creative { + private string snippetField; + + private string expandedSnippetField; + + public string snippet { + get { return this.snippetField; } + set { this.snippetField = value; } + } + + public string expandedSnippet { + get { return this.expandedSnippetField; } + set { this.expandedSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class TemplateCreative : Creative { + private long creativeTemplateIdField; + + private bool creativeTemplateIdFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + private BaseCreativeTemplateVariableValue[] creativeTemplateVariableValuesField; + + public long creativeTemplateId { + get { return this.creativeTemplateIdField; } + set { + this.creativeTemplateIdField = value; + this.creativeTemplateIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeTemplateIdSpecified { + get { return this.creativeTemplateIdFieldSpecified; } + set { this.creativeTemplateIdFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativeTemplateVariableValues")] + public BaseCreativeTemplateVariableValue[] creativeTemplateVariableValues { + get { return this.creativeTemplateVariableValuesField; } + set { this.creativeTemplateVariableValuesField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UrlCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetCreativeTemplateVariableValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class BaseCreativeTemplateVariableValue { + private string uniqueNameField; + + private string baseCreativeTemplateVariableValueTypeField; + + public string uniqueName { + get { return this.uniqueNameField; } + set { this.uniqueNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseCreativeTemplateVariableValue.Type")] + public string BaseCreativeTemplateVariableValueType { + get { return this.baseCreativeTemplateVariableValueTypeField; } + set { this.baseCreativeTemplateVariableValueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class UrlCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class StringCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class LongCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private long valueField; + + private bool valueFieldSpecified; + + public long value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AssetCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class LegacyDfpCreative : Creative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class InternalRedirectCreative : Creative { + private string internalRedirectUrlField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public string internalRedirectUrl { + get { return this.internalRedirectUrlField; } + set { this.internalRedirectUrlField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TextAdCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FloatingFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashPushdownCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashExpandableCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpMobileCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseVideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AspectRatioImageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class HasDestinationUrlCreative : Creative { + private string destinationUrlField; + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class VpaidLinearRedirectCreative : HasDestinationUrlCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + private string flashUrlField; + + private Size flashAssetSizeField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string flashUrl { + get { return this.flashUrlField; } + set { this.flashUrlField = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class VpaidLinearCreative : HasDestinationUrlCreative { + private string flashNameField; + + private byte[] flashByteArrayField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private Size flashAssetSizeField; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + public string flashName { + get { return this.flashNameField; } + set { this.flashNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] flashByteArray { + get { return this.flashByteArrayField; } + set { this.flashByteArrayField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class TextAdCreative : HasDestinationUrlCreative { + private string hoverTextField; + + private TargetWindow targetWindowField; + + private bool targetWindowFieldSpecified; + + private string linkColorField; + + private string linkTitleField; + + private string textField; + + private string textColorField; + + public string hoverText { + get { return this.hoverTextField; } + set { this.hoverTextField = value; } + } + + public TargetWindow targetWindow { + get { return this.targetWindowField; } + set { + this.targetWindowField = value; + this.targetWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetWindowSpecified { + get { return this.targetWindowFieldSpecified; } + set { this.targetWindowFieldSpecified = value; } + } + + public string linkColor { + get { return this.linkColorField; } + set { this.linkColorField = value; } + } + + public string linkTitle { + get { return this.linkTitleField; } + set { this.linkTitleField = value; } + } + + public string text { + get { return this.textField; } + set { this.textField = value; } + } + + public string textColor { + get { return this.textColorField; } + set { this.textColorField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum TargetWindow { + BLANK, + TOP + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class FloatingFlashCreative : HasDestinationUrlCreative { + private string flashNameField; + + private byte[] flashByteArrayField; + + private long flashAssetIdField; + + private bool flashAssetIdFieldSpecified; + + private string fallbackImageNameField; + + private byte[] fallbackImageByteArrayField; + + private long fallbackImageAssetIdField; + + private bool fallbackImageAssetIdFieldSpecified; + + private int requiredFlashVersionField; + + private bool requiredFlashVersionFieldSpecified; + + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + private string topPositionField; + + private string leftPositionField; + + private int displayTimeInSecondField; + + private bool displayTimeInSecondFieldSpecified; + + private string thirdPartyImpressionTrackerField; + + public string flashName { + get { return this.flashNameField; } + set { this.flashNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] flashByteArray { + get { return this.flashByteArrayField; } + set { this.flashByteArrayField = value; } + } + + public long flashAssetId { + get { return this.flashAssetIdField; } + set { + this.flashAssetIdField = value; + this.flashAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool flashAssetIdSpecified { + get { return this.flashAssetIdFieldSpecified; } + set { this.flashAssetIdFieldSpecified = value; } + } + + public string fallbackImageName { + get { return this.fallbackImageNameField; } + set { this.fallbackImageNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] fallbackImageByteArray { + get { return this.fallbackImageByteArrayField; } + set { this.fallbackImageByteArrayField = value; } + } + + public long fallbackImageAssetId { + get { return this.fallbackImageAssetIdField; } + set { + this.fallbackImageAssetIdField = value; + this.fallbackImageAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fallbackImageAssetIdSpecified { + get { return this.fallbackImageAssetIdFieldSpecified; } + set { this.fallbackImageAssetIdFieldSpecified = value; } + } + + public int requiredFlashVersion { + get { return this.requiredFlashVersionField; } + set { + this.requiredFlashVersionField = value; + this.requiredFlashVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool requiredFlashVersionSpecified { + get { return this.requiredFlashVersionFieldSpecified; } + set { this.requiredFlashVersionFieldSpecified = value; } + } + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + public string topPosition { + get { return this.topPositionField; } + set { this.topPositionField = value; } + } + + public string leftPosition { + get { return this.leftPositionField; } + set { this.leftPositionField = value; } + } + + public int displayTimeInSecond { + get { return this.displayTimeInSecondField; } + set { + this.displayTimeInSecondField = value; + this.displayTimeInSecondSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool displayTimeInSecondSpecified { + get { return this.displayTimeInSecondFieldSpecified; } + set { this.displayTimeInSecondFieldSpecified = value; } + } + + public string thirdPartyImpressionTracker { + get { return this.thirdPartyImpressionTrackerField; } + set { this.thirdPartyImpressionTrackerField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class FlashPushdownCreative : HasDestinationUrlCreative { + private long collapsedFlashAssetIdField; + + private bool collapsedFlashAssetIdFieldSpecified; + + private byte[] collapsedFlashAssetByteArrayField; + + private string collapsedFlashFileNameField; + + private long collapsedFallbackImageAssetIdField; + + private bool collapsedFallbackImageAssetIdFieldSpecified; + + private byte[] collapsedFallbackImageAssetByteArrayField; + + private string collapsedFallbackImageFileNameField; + + private long expandedFlashAssetIdField; + + private bool expandedFlashAssetIdFieldSpecified; + + private byte[] expandedFlashAssetByteArrayField; + + private string expandedFlashFileNameField; + + private int requiredFlashVersionField; + + private bool requiredFlashVersionFieldSpecified; + + private int widthField; + + private bool widthFieldSpecified; + + private int collapsedHeightField; + + private bool collapsedHeightFieldSpecified; + + private int expandedHeightField; + + private bool expandedHeightFieldSpecified; + + private bool pushdownOnMouseOverField; + + private bool pushdownOnMouseOverFieldSpecified; + + private string javascriptFunctionForPushdownField; + + private bool collapseOnMouseOutField; + + private bool collapseOnMouseOutFieldSpecified; + + private string javascriptFunctionForCollapseField; + + public long collapsedFlashAssetId { + get { return this.collapsedFlashAssetIdField; } + set { + this.collapsedFlashAssetIdField = value; + this.collapsedFlashAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapsedFlashAssetIdSpecified { + get { return this.collapsedFlashAssetIdFieldSpecified; } + set { this.collapsedFlashAssetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] collapsedFlashAssetByteArray { + get { return this.collapsedFlashAssetByteArrayField; } + set { this.collapsedFlashAssetByteArrayField = value; } + } + + public string collapsedFlashFileName { + get { return this.collapsedFlashFileNameField; } + set { this.collapsedFlashFileNameField = value; } + } + + public long collapsedFallbackImageAssetId { + get { return this.collapsedFallbackImageAssetIdField; } + set { + this.collapsedFallbackImageAssetIdField = value; + this.collapsedFallbackImageAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapsedFallbackImageAssetIdSpecified { + get { return this.collapsedFallbackImageAssetIdFieldSpecified; } + set { this.collapsedFallbackImageAssetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] collapsedFallbackImageAssetByteArray { + get { return this.collapsedFallbackImageAssetByteArrayField; } + set { this.collapsedFallbackImageAssetByteArrayField = value; } + } + + public string collapsedFallbackImageFileName { + get { return this.collapsedFallbackImageFileNameField; } + set { this.collapsedFallbackImageFileNameField = value; } + } + + public long expandedFlashAssetId { + get { return this.expandedFlashAssetIdField; } + set { + this.expandedFlashAssetIdField = value; + this.expandedFlashAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expandedFlashAssetIdSpecified { + get { return this.expandedFlashAssetIdFieldSpecified; } + set { this.expandedFlashAssetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] expandedFlashAssetByteArray { + get { return this.expandedFlashAssetByteArrayField; } + set { this.expandedFlashAssetByteArrayField = value; } + } + + public string expandedFlashFileName { + get { return this.expandedFlashFileNameField; } + set { this.expandedFlashFileNameField = value; } + } + + public int requiredFlashVersion { + get { return this.requiredFlashVersionField; } + set { + this.requiredFlashVersionField = value; + this.requiredFlashVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool requiredFlashVersionSpecified { + get { return this.requiredFlashVersionFieldSpecified; } + set { this.requiredFlashVersionFieldSpecified = value; } + } + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int collapsedHeight { + get { return this.collapsedHeightField; } + set { + this.collapsedHeightField = value; + this.collapsedHeightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapsedHeightSpecified { + get { return this.collapsedHeightFieldSpecified; } + set { this.collapsedHeightFieldSpecified = value; } + } + + public int expandedHeight { + get { return this.expandedHeightField; } + set { + this.expandedHeightField = value; + this.expandedHeightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expandedHeightSpecified { + get { return this.expandedHeightFieldSpecified; } + set { this.expandedHeightFieldSpecified = value; } + } + + public bool pushdownOnMouseOver { + get { return this.pushdownOnMouseOverField; } + set { + this.pushdownOnMouseOverField = value; + this.pushdownOnMouseOverSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool pushdownOnMouseOverSpecified { + get { return this.pushdownOnMouseOverFieldSpecified; } + set { this.pushdownOnMouseOverFieldSpecified = value; } + } + + public string javascriptFunctionForPushdown { + get { return this.javascriptFunctionForPushdownField; } + set { this.javascriptFunctionForPushdownField = value; } + } + + public bool collapseOnMouseOut { + get { return this.collapseOnMouseOutField; } + set { + this.collapseOnMouseOutField = value; + this.collapseOnMouseOutSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapseOnMouseOutSpecified { + get { return this.collapseOnMouseOutFieldSpecified; } + set { this.collapseOnMouseOutFieldSpecified = value; } + } + + public string javascriptFunctionForCollapse { + get { return this.javascriptFunctionForCollapseField; } + set { this.javascriptFunctionForCollapseField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class FlashExpandableCreative : HasDestinationUrlCreative { + private long collapsedFlashAssetIdField; + + private bool collapsedFlashAssetIdFieldSpecified; + + private byte[] collapsedFlashAssetByteArrayField; + + private string collapsedFlashFileNameField; + + private long collapsedFallbackImageAssetIdField; + + private bool collapsedFallbackImageAssetIdFieldSpecified; + + private byte[] collapsedFallbackImageAssetByteArrayField; + + private string collapsedFallbackImageFileNameField; + + private long expandedFlashAssetIdField; + + private bool expandedFlashAssetIdFieldSpecified; + + private byte[] expandedFlashAssetByteArrayField; + + private string expandedFlashFileNameField; + + private int requiredFlashVersionField; + + private bool requiredFlashVersionFieldSpecified; + + private int collapsedWidthField; + + private bool collapsedWidthFieldSpecified; + + private int collapsedHeightField; + + private bool collapsedHeightFieldSpecified; + + private int expandedWidthField; + + private bool expandedWidthFieldSpecified; + + private int expandedHeightField; + + private bool expandedHeightFieldSpecified; + + private FlashExpandableCreativeExpandDirection expandDirectionField; + + private bool expandDirectionFieldSpecified; + + private bool expandOnMouseOverField; + + private bool expandOnMouseOverFieldSpecified; + + private string javascriptFunctionForExpandField; + + private bool collapseOnMouseOutField; + + private bool collapseOnMouseOutFieldSpecified; + + private string javascriptFunctionForCollapseField; + + public long collapsedFlashAssetId { + get { return this.collapsedFlashAssetIdField; } + set { + this.collapsedFlashAssetIdField = value; + this.collapsedFlashAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapsedFlashAssetIdSpecified { + get { return this.collapsedFlashAssetIdFieldSpecified; } + set { this.collapsedFlashAssetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] collapsedFlashAssetByteArray { + get { return this.collapsedFlashAssetByteArrayField; } + set { this.collapsedFlashAssetByteArrayField = value; } + } + + public string collapsedFlashFileName { + get { return this.collapsedFlashFileNameField; } + set { this.collapsedFlashFileNameField = value; } + } + + public long collapsedFallbackImageAssetId { + get { return this.collapsedFallbackImageAssetIdField; } + set { + this.collapsedFallbackImageAssetIdField = value; + this.collapsedFallbackImageAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapsedFallbackImageAssetIdSpecified { + get { return this.collapsedFallbackImageAssetIdFieldSpecified; } + set { this.collapsedFallbackImageAssetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] collapsedFallbackImageAssetByteArray { + get { return this.collapsedFallbackImageAssetByteArrayField; } + set { this.collapsedFallbackImageAssetByteArrayField = value; } + } + + public string collapsedFallbackImageFileName { + get { return this.collapsedFallbackImageFileNameField; } + set { this.collapsedFallbackImageFileNameField = value; } + } + + public long expandedFlashAssetId { + get { return this.expandedFlashAssetIdField; } + set { + this.expandedFlashAssetIdField = value; + this.expandedFlashAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expandedFlashAssetIdSpecified { + get { return this.expandedFlashAssetIdFieldSpecified; } + set { this.expandedFlashAssetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] expandedFlashAssetByteArray { + get { return this.expandedFlashAssetByteArrayField; } + set { this.expandedFlashAssetByteArrayField = value; } + } + + public string expandedFlashFileName { + get { return this.expandedFlashFileNameField; } + set { this.expandedFlashFileNameField = value; } + } + + public int requiredFlashVersion { + get { return this.requiredFlashVersionField; } + set { + this.requiredFlashVersionField = value; + this.requiredFlashVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool requiredFlashVersionSpecified { + get { return this.requiredFlashVersionFieldSpecified; } + set { this.requiredFlashVersionFieldSpecified = value; } + } + + public int collapsedWidth { + get { return this.collapsedWidthField; } + set { + this.collapsedWidthField = value; + this.collapsedWidthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapsedWidthSpecified { + get { return this.collapsedWidthFieldSpecified; } + set { this.collapsedWidthFieldSpecified = value; } + } + + public int collapsedHeight { + get { return this.collapsedHeightField; } + set { + this.collapsedHeightField = value; + this.collapsedHeightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapsedHeightSpecified { + get { return this.collapsedHeightFieldSpecified; } + set { this.collapsedHeightFieldSpecified = value; } + } + + public int expandedWidth { + get { return this.expandedWidthField; } + set { + this.expandedWidthField = value; + this.expandedWidthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expandedWidthSpecified { + get { return this.expandedWidthFieldSpecified; } + set { this.expandedWidthFieldSpecified = value; } + } + + public int expandedHeight { + get { return this.expandedHeightField; } + set { + this.expandedHeightField = value; + this.expandedHeightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expandedHeightSpecified { + get { return this.expandedHeightFieldSpecified; } + set { this.expandedHeightFieldSpecified = value; } + } + + public FlashExpandableCreativeExpandDirection expandDirection { + get { return this.expandDirectionField; } + set { + this.expandDirectionField = value; + this.expandDirectionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expandDirectionSpecified { + get { return this.expandDirectionFieldSpecified; } + set { this.expandDirectionFieldSpecified = value; } + } + + public bool expandOnMouseOver { + get { return this.expandOnMouseOverField; } + set { + this.expandOnMouseOverField = value; + this.expandOnMouseOverSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expandOnMouseOverSpecified { + get { return this.expandOnMouseOverFieldSpecified; } + set { this.expandOnMouseOverFieldSpecified = value; } + } + + public string javascriptFunctionForExpand { + get { return this.javascriptFunctionForExpandField; } + set { this.javascriptFunctionForExpandField = value; } + } + + public bool collapseOnMouseOut { + get { return this.collapseOnMouseOutField; } + set { + this.collapseOnMouseOutField = value; + this.collapseOnMouseOutSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapseOnMouseOutSpecified { + get { return this.collapseOnMouseOutFieldSpecified; } + set { this.collapseOnMouseOutFieldSpecified = value; } + } + + public string javascriptFunctionForCollapse { + get { return this.javascriptFunctionForCollapseField; } + set { this.javascriptFunctionForCollapseField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FlashExpandableCreative.ExpandDirection", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum FlashExpandableCreativeExpandDirection { + LEFT, + RIGHT, + UP, + DOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class LegacyDfpMobileCreative : HasDestinationUrlCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CustomCreative : HasDestinationUrlCreative { + private string htmlSnippetField; + + private CustomCreativeAsset[] customCreativeAssetsField; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public string htmlSnippet { + get { return this.htmlSnippetField; } + set { this.htmlSnippetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customCreativeAssets")] + public CustomCreativeAsset[] customCreativeAssets { + get { return this.customCreativeAssetsField; } + set { this.customCreativeAssetsField = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CustomCreativeAsset { + private string macroNameField; + + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + private long fileSizeField; + + private bool fileSizeFieldSpecified; + + public string macroName { + get { return this.macroNameField; } + set { this.macroNameField = value; } + } + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public long fileSize { + get { return this.fileSizeField; } + set { + this.fileSizeField = value; + this.fileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fileSizeSpecified { + get { return this.fileSizeFieldSpecified; } + set { this.fileSizeFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class BaseVideoCreative : HasDestinationUrlCreative { + private int durationField; + + private bool durationFieldSpecified; + + private bool allowDurationOverrideField; + + private bool allowDurationOverrideFieldSpecified; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private long[] companionCreativeIdsField; + + private string customParametersField; + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public bool allowDurationOverride { + get { return this.allowDurationOverrideField; } + set { + this.allowDurationOverrideField = value; + this.allowDurationOverrideSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowDurationOverrideSpecified { + get { return this.allowDurationOverrideFieldSpecified; } + set { this.allowDurationOverrideFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class VideoRedirectCreative : BaseVideoCreative { + private VideoRedirectAsset[] videoAssetsField; + + [System.Xml.Serialization.XmlElementAttribute("videoAssets")] + public VideoRedirectAsset[] videoAssets { + get { return this.videoAssetsField; } + set { this.videoAssetsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class VideoRedirectAsset : RedirectAsset { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class RedirectAsset : Asset { + private string redirectUrlField; + + public string redirectUrl { + get { return this.redirectUrlField; } + set { this.redirectUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RedirectAsset))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class Asset { + private string assetTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Asset.Type")] + public string AssetType { + get { return this.assetTypeField; } + set { this.assetTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class VideoCreative : BaseVideoCreative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class BaseImageRedirectCreative : HasDestinationUrlCreative { + private string imageUrlField; + + public string imageUrl { + get { return this.imageUrlField; } + set { this.imageUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ImageRedirectOverlayCreative : BaseImageRedirectCreative { + private Size assetSizeField; + + private int durationField; + + private bool durationFieldSpecified; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + public Size assetSize { + get { return this.assetSizeField; } + set { this.assetSizeField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ImageRedirectCreative : BaseImageRedirectCreative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class BaseImageCreative : HasDestinationUrlCreative { + private string imageNameField; + + private byte[] imageByteArrayField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private Size assetSizeField; + + private string imageUrlField; + + public string imageName { + get { return this.imageNameField; } + set { this.imageNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] imageByteArray { + get { return this.imageByteArrayField; } + set { this.imageByteArrayField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public Size assetSize { + get { return this.assetSizeField; } + set { this.assetSizeField = value; } + } + + public string imageUrl { + get { return this.imageUrlField; } + set { this.imageUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ImageOverlayCreative : BaseImageCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ImageCreative : BaseImageCreative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class BaseFlashRedirectCreative : HasDestinationUrlCreative { + private string flashUrlField; + + private string fallbackUrlField; + + private string fallbackPreviewUrlField; + + public string flashUrl { + get { return this.flashUrlField; } + set { this.flashUrlField = value; } + } + + public string fallbackUrl { + get { return this.fallbackUrlField; } + set { this.fallbackUrlField = value; } + } + + public string fallbackPreviewUrl { + get { return this.fallbackPreviewUrlField; } + set { this.fallbackPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class FlashRedirectOverlayCreative : BaseFlashRedirectCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private ApiFramework apiFrameworkField; + + private bool apiFrameworkFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + private Size flashAssetSizeField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public ApiFramework apiFramework { + get { return this.apiFrameworkField; } + set { + this.apiFrameworkField = value; + this.apiFrameworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool apiFrameworkSpecified { + get { return this.apiFrameworkFieldSpecified; } + set { this.apiFrameworkFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum ApiFramework { + NONE, + CLICKTAG, + VPAID + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class FlashRedirectCreative : BaseFlashRedirectCreative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class BaseFlashCreative : HasDestinationUrlCreative { + private string flashNameField; + + private byte[] flashByteArrayField; + + private string fallbackImageNameField; + + private byte[] fallbackImageByteArrayField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private bool clickTagRequiredField; + + private bool clickTagRequiredFieldSpecified; + + private string fallbackPreviewUrlField; + + private Size flashAssetSizeField; + + private Size fallbackAssetSizeField; + + public string flashName { + get { return this.flashNameField; } + set { this.flashNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] flashByteArray { + get { return this.flashByteArrayField; } + set { this.flashByteArrayField = value; } + } + + public string fallbackImageName { + get { return this.fallbackImageNameField; } + set { this.fallbackImageNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] fallbackImageByteArray { + get { return this.fallbackImageByteArrayField; } + set { this.fallbackImageByteArrayField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public bool clickTagRequired { + get { return this.clickTagRequiredField; } + set { + this.clickTagRequiredField = value; + this.clickTagRequiredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clickTagRequiredSpecified { + get { return this.clickTagRequiredFieldSpecified; } + set { this.clickTagRequiredFieldSpecified = value; } + } + + public string fallbackPreviewUrl { + get { return this.fallbackPreviewUrlField; } + set { this.fallbackPreviewUrlField = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + public Size fallbackAssetSize { + get { return this.fallbackAssetSizeField; } + set { this.fallbackAssetSizeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class FlashOverlayCreative : BaseFlashCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private ApiFramework apiFrameworkField; + + private bool apiFrameworkFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public ApiFramework apiFramework { + get { return this.apiFrameworkField; } + set { + this.apiFrameworkField = value; + this.apiFrameworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool apiFrameworkSpecified { + get { return this.apiFrameworkFieldSpecified; } + set { this.apiFrameworkFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class FlashCreative : BaseFlashCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AspectRatioImageCreative : HasDestinationUrlCreative { + private CreativeAsset[] imageAssetsField; + + private string fallbackTextField; + + [System.Xml.Serialization.XmlElementAttribute("imageAssets")] + public CreativeAsset[] imageAssets { + get { return this.imageAssetsField; } + set { this.imageAssetsField = value; } + } + + public string fallbackText { + get { return this.fallbackTextField; } + set { this.fallbackTextField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class CreativeAsset { + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + private long fileSizeField; + + private bool fileSizeFieldSpecified; + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public long fileSize { + get { return this.fileSizeField; } + set { + this.fileSizeField = value; + this.fileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fileSizeSpecified { + get { return this.fileSizeFieldSpecified; } + set { this.fileSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ClickTrackingCreative : Creative { + private string clickTrackingUrlField; + + public string clickTrackingUrl { + get { return this.clickTrackingUrlField; } + set { this.clickTrackingUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class BaseRichMediaStudioCreative : Creative { + private long studioCreativeIdField; + + private bool studioCreativeIdFieldSpecified; + + private RichMediaStudioCreativeFormat creativeFormatField; + + private bool creativeFormatFieldSpecified; + + private RichMediaStudioCreativeArtworkType artworkTypeField; + + private bool artworkTypeFieldSpecified; + + private long totalFileSizeField; + + private bool totalFileSizeFieldSpecified; + + private string[] adTagKeysField; + + private string[] customKeyValuesField; + + private string surveyUrlField; + + private string allImpressionsUrlField; + + private string richMediaImpressionsUrlField; + + private string backupImageImpressionsUrlField; + + private string overrideCssField; + + private string requiredFlashPluginVersionField; + + private int durationField; + + private bool durationFieldSpecified; + + private RichMediaStudioCreativeBillingAttribute billingAttributeField; + + private bool billingAttributeFieldSpecified; + + private RichMediaStudioChildAssetProperty[] richMediaStudioChildAssetPropertiesField; + + public long studioCreativeId { + get { return this.studioCreativeIdField; } + set { + this.studioCreativeIdField = value; + this.studioCreativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool studioCreativeIdSpecified { + get { return this.studioCreativeIdFieldSpecified; } + set { this.studioCreativeIdFieldSpecified = value; } + } + + public RichMediaStudioCreativeFormat creativeFormat { + get { return this.creativeFormatField; } + set { + this.creativeFormatField = value; + this.creativeFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeFormatSpecified { + get { return this.creativeFormatFieldSpecified; } + set { this.creativeFormatFieldSpecified = value; } + } + + public RichMediaStudioCreativeArtworkType artworkType { + get { return this.artworkTypeField; } + set { + this.artworkTypeField = value; + this.artworkTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool artworkTypeSpecified { + get { return this.artworkTypeFieldSpecified; } + set { this.artworkTypeFieldSpecified = value; } + } + + public long totalFileSize { + get { return this.totalFileSizeField; } + set { + this.totalFileSizeField = value; + this.totalFileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalFileSizeSpecified { + get { return this.totalFileSizeFieldSpecified; } + set { this.totalFileSizeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adTagKeys")] + public string[] adTagKeys { + get { return this.adTagKeysField; } + set { this.adTagKeysField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customKeyValues")] + public string[] customKeyValues { + get { return this.customKeyValuesField; } + set { this.customKeyValuesField = value; } + } + + public string surveyUrl { + get { return this.surveyUrlField; } + set { this.surveyUrlField = value; } + } + + public string allImpressionsUrl { + get { return this.allImpressionsUrlField; } + set { this.allImpressionsUrlField = value; } + } + + public string richMediaImpressionsUrl { + get { return this.richMediaImpressionsUrlField; } + set { this.richMediaImpressionsUrlField = value; } + } + + public string backupImageImpressionsUrl { + get { return this.backupImageImpressionsUrlField; } + set { this.backupImageImpressionsUrlField = value; } + } + + public string overrideCss { + get { return this.overrideCssField; } + set { this.overrideCssField = value; } + } + + public string requiredFlashPluginVersion { + get { return this.requiredFlashPluginVersionField; } + set { this.requiredFlashPluginVersionField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public RichMediaStudioCreativeBillingAttribute billingAttribute { + get { return this.billingAttributeField; } + set { + this.billingAttributeField = value; + this.billingAttributeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingAttributeSpecified { + get { return this.billingAttributeFieldSpecified; } + set { this.billingAttributeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("richMediaStudioChildAssetProperties")] + public RichMediaStudioChildAssetProperty[] richMediaStudioChildAssetProperties { + get { return this.richMediaStudioChildAssetPropertiesField; } + set { this.richMediaStudioChildAssetPropertiesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum RichMediaStudioCreativeFormat { + IN_PAGE, + EXPANDING, + IM_EXPANDING, + FLOATING, + PEEL_DOWN, + IN_PAGE_WITH_FLOATING, + FLASH_IN_FLASH, + FLASH_IN_FLASH_EXPANDING, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum RichMediaStudioCreativeArtworkType { + FLASH, + HTML5, + MIXED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum RichMediaStudioCreativeBillingAttribute { + IN_PAGE, + FLOATING_EXPANDING, + VIDEO, + FLASH_IN_FLASH + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class RichMediaStudioChildAssetProperty { + private string nameField; + + private RichMediaStudioChildAssetPropertyType typeField; + + private bool typeFieldSpecified; + + private long totalFileSizeField; + + private bool totalFileSizeFieldSpecified; + + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + private string urlField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public RichMediaStudioChildAssetPropertyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public long totalFileSize { + get { return this.totalFileSizeField; } + set { + this.totalFileSizeField = value; + this.totalFileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalFileSizeSpecified { + get { return this.totalFileSizeFieldSpecified; } + set { this.totalFileSizeFieldSpecified = value; } + } + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaStudioChildAssetProperty.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum RichMediaStudioChildAssetPropertyType { + FLASH, + VIDEO, + IMAGE, + DATA + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class RichMediaStudioCreative : BaseRichMediaStudioCreative { + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasHtmlSnippetDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class BaseDynamicAllocationCreative : Creative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class HasHtmlSnippetDynamicAllocationCreative : BaseDynamicAllocationCreative { + private string codeSnippetField; + + public string codeSnippet { + get { return this.codeSnippetField; } + set { this.codeSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AdSenseCreative : HasHtmlSnippetDynamicAllocationCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class AdExchangeCreative : HasHtmlSnippetDynamicAllocationCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LineItemCreativeAssociationServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LineItemCreativeAssociationService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LineItemCreativeAssociationService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201208/LineItemCreativeAssociationServ" + "ice"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItemCreativeAssociation createLineItemCreativeAssociation(LineItemCreativeAssociation lineItemCreativeAssociation) { + object[] results = this.Invoke("createLineItemCreativeAssociation", new object[] { lineItemCreativeAssociation }); + return ((LineItemCreativeAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItemCreativeAssociation[] createLineItemCreativeAssociations([System.Xml.Serialization.XmlElementAttribute("lineItemCreativeAssociations")] +LineItemCreativeAssociation[] lineItemCreativeAssociations) { + object[] results = this.Invoke("createLineItemCreativeAssociations", new object[] { lineItemCreativeAssociations }); + return ((LineItemCreativeAssociation[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItemCreativeAssociation getLineItemCreativeAssociation(long lineItemId, long creativeId) { + object[] results = this.Invoke("getLineItemCreativeAssociation", new object[] { lineItemId, creativeId }); + return ((LineItemCreativeAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItemCreativeAssociationPage getLineItemCreativeAssociationsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLineItemCreativeAssociationsByStatement", new object[] { filterStatement }); + return ((LineItemCreativeAssociationPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public string getPreviewUrl(long lineItemId, long creativeId, string siteUrl) { + object[] results = this.Invoke("getPreviewUrl", new object[] { lineItemId, creativeId, siteUrl }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performLineItemCreativeAssociationAction(LineItemCreativeAssociationAction lineItemCreativeAssociationAction, Statement filterStatement) { + object[] results = this.Invoke("performLineItemCreativeAssociationAction", new object[] { lineItemCreativeAssociationAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItemCreativeAssociation updateLineItemCreativeAssociation(LineItemCreativeAssociation lineItemCreativeAssociation) { + object[] results = this.Invoke("updateLineItemCreativeAssociation", new object[] { lineItemCreativeAssociation }); + return ((LineItemCreativeAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201208", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201208", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItemCreativeAssociation[] updateLineItemCreativeAssociations([System.Xml.Serialization.XmlElementAttribute("lineItemCreativeAssociations")] +LineItemCreativeAssociation[] lineItemCreativeAssociations) { + object[] results = this.Invoke("updateLineItemCreativeAssociations", new object[] { lineItemCreativeAssociations }); + return ((LineItemCreativeAssociation[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateLineItemCreativeAssociations))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLineItemCreativeAssociations))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public abstract partial class LineItemCreativeAssociationAction { + private string lineItemCreativeAssociationActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LineItemCreativeAssociationAction.Type")] + public string LineItemCreativeAssociationActionType { + get { return this.lineItemCreativeAssociationActionTypeField; } + set { this.lineItemCreativeAssociationActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class DeactivateLineItemCreativeAssociations : LineItemCreativeAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class ActivateLineItemCreativeAssociations : LineItemCreativeAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class LineItemCreativeAssociationPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LineItemCreativeAssociation[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LineItemCreativeAssociation[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class LineItemCreativeAssociation { + private long lineItemIdField; + + private bool lineItemIdFieldSpecified; + + private long creativeIdField; + + private bool creativeIdFieldSpecified; + + private long creativeSetIdField; + + private bool creativeSetIdFieldSpecified; + + private double manualCreativeRotationWeightField; + + private bool manualCreativeRotationWeightFieldSpecified; + + private int sequentialCreativeRotationIndexField; + + private bool sequentialCreativeRotationIndexFieldSpecified; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private string destinationUrlField; + + private Size[] sizesField; + + private LineItemCreativeAssociationStatus statusField; + + private bool statusFieldSpecified; + + private LineItemCreativeAssociationStats statsField; + + private DateTime lastModifiedDateTimeField; + + public long lineItemId { + get { return this.lineItemIdField; } + set { + this.lineItemIdField = value; + this.lineItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemIdSpecified { + get { return this.lineItemIdFieldSpecified; } + set { this.lineItemIdFieldSpecified = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { + this.creativeIdField = value; + this.creativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeIdSpecified { + get { return this.creativeIdFieldSpecified; } + set { this.creativeIdFieldSpecified = value; } + } + + public long creativeSetId { + get { return this.creativeSetIdField; } + set { + this.creativeSetIdField = value; + this.creativeSetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeSetIdSpecified { + get { return this.creativeSetIdFieldSpecified; } + set { this.creativeSetIdFieldSpecified = value; } + } + + public double manualCreativeRotationWeight { + get { return this.manualCreativeRotationWeightField; } + set { + this.manualCreativeRotationWeightField = value; + this.manualCreativeRotationWeightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manualCreativeRotationWeightSpecified { + get { return this.manualCreativeRotationWeightFieldSpecified; } + set { this.manualCreativeRotationWeightFieldSpecified = value; } + } + + public int sequentialCreativeRotationIndex { + get { return this.sequentialCreativeRotationIndexField; } + set { + this.sequentialCreativeRotationIndexField = value; + this.sequentialCreativeRotationIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sequentialCreativeRotationIndexSpecified { + get { return this.sequentialCreativeRotationIndexFieldSpecified; } + set { this.sequentialCreativeRotationIndexFieldSpecified = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("sizes")] + public Size[] sizes { + get { return this.sizesField; } + set { this.sizesField = value; } + } + + public LineItemCreativeAssociationStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public LineItemCreativeAssociationStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociation.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum LineItemCreativeAssociationStatus { + ACTIVE, + NOT_SERVING, + INACTIVE, + DELETED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class LineItemCreativeAssociationStats { + private Stats statsField; + + private Money costInOrderCurrencyField; + + public Stats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public Money costInOrderCurrency { + get { return this.costInOrderCurrencyField; } + set { this.costInOrderCurrencyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public partial class LineItemCreativeAssociationOperationError : ApiError { + private LineItemCreativeAssociationOperationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemCreativeAssociationOperationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociationOperationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201208")] + public enum LineItemCreativeAssociationOperationErrorReason { + NOT_ALLOWED, + NOT_APPLICABLE, + CANNOT_ACTIVATE_INVALID_CREATIVE, + UNKNOWN + } +} diff --git a/src/Dfp/v201208/DfpServiceV201208.cs b/src/Dfp/v201208/DfpServiceV201208.cs new file mode 100644 index 00000000000..d2de5a73995 --- /dev/null +++ b/src/Dfp/v201208/DfpServiceV201208.cs @@ -0,0 +1,212 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Reflection; + +namespace Google.Api.Ads.Dfp.Lib { + /// + /// Lists all the services available through this library. + /// + public partial class DfpService : AdsService { + /// + /// All the services available in v201208. + /// + public class v201208 { + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AudienceSegmentService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CompanyService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ContentService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeSetService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeTemplateService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomFieldService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomTargetingService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ForecastService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature InventoryService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LabelService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LineItemService; + + /// + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LineItemCreativeAssociationService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature NetworkService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature OrderService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature PlacementService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature PublisherQueryLanguageService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReportService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SuggestedAdUnitService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature TeamService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ThirdPartySlotService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature UserService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature UserTeamAssociationService; + + /// + /// Factory type for v201208 services. + /// + public static readonly Type factoryType = typeof(DfpServiceFactory); + + /// + /// Static constructor to initialize the service constants. + /// + static v201208() { + AudienceSegmentService = DfpService.MakeServiceSignature("v201208", + "AudienceSegmentService"); + CompanyService = DfpService.MakeServiceSignature("v201208", "CompanyService"); + ContentService = DfpService.MakeServiceSignature("v201208", "ContentService"); + CreativeService = DfpService.MakeServiceSignature("v201208", "CreativeService"); + CreativeSetService = DfpService.MakeServiceSignature("v201208", "CreativeSetService"); + CreativeTemplateService = DfpService.MakeServiceSignature("v201208", + "CreativeTemplateService"); + CustomTargetingService = DfpService.MakeServiceSignature("v201208", + "CustomTargetingService"); + CustomFieldService = DfpService.MakeServiceSignature("v201208", + "CustomFieldService"); + ForecastService = DfpService.MakeServiceSignature("v201208", "ForecastService"); + InventoryService = DfpService.MakeServiceSignature("v201208", "InventoryService"); + LabelService = DfpService.MakeServiceSignature("v201208", "LabelService"); + LineItemService = DfpService.MakeServiceSignature("v201208", "LineItemService"); + LineItemCreativeAssociationService = + DfpService.MakeServiceSignature("v201208", "LineItemCreativeAssociationService"); + NetworkService = DfpService.MakeServiceSignature("v201208", "NetworkService"); + OrderService = DfpService.MakeServiceSignature("v201208", "OrderService"); + PlacementService = DfpService.MakeServiceSignature("v201208", "PlacementService"); + PublisherQueryLanguageService = DfpService.MakeServiceSignature("v201208", + "PublisherQueryLanguageService"); + ReportService = DfpService.MakeServiceSignature("v201208", "ReportService"); + SuggestedAdUnitService = DfpService.MakeServiceSignature("v201208", + "SuggestedAdUnitService"); + TeamService = DfpService.MakeServiceSignature("v201208", "TeamService"); + ThirdPartySlotService = DfpService.MakeServiceSignature("v201208", + "ThirdPartySlotService"); + UserService = DfpService.MakeServiceSignature("v201208", "UserService"); + UserTeamAssociationService = DfpService.MakeServiceSignature("v201208", + "UserTeamAssociationService"); + } + } + } +} diff --git a/src/Dfp/v201211/DfpApi.cs b/src/Dfp/v201211/DfpApi.cs new file mode 100644 index 00000000000..d892fd76e96 --- /dev/null +++ b/src/Dfp/v201211/DfpApi.cs @@ -0,0 +1,17186 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +namespace Google.Api.Ads.Dfp.v201211 { + using Google.Api.Ads.Dfp.Lib; + using Google.Api.Ads.Dfp.Headers; + using System; + using System.Web.Services; + using System.Diagnostics; + using System.Web.Services.Protocols; + using System.Xml.Serialization; + using System.ComponentModel; + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeSetServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeSetService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeSetService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/CreativeSetService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeSet createCreativeSet(CreativeSet creativeSet) { + object[] results = this.Invoke("createCreativeSet", new object[] { creativeSet }); + return ((CreativeSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeSet getCreativeSet(long creativeSetId) { + object[] results = this.Invoke("getCreativeSet", new object[] { creativeSetId }); + return ((CreativeSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeSetPage getCreativeSetsByStatement(Statement statement) { + object[] results = this.Invoke("getCreativeSetsByStatement", new object[] { statement }); + return ((CreativeSetPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeSet updateCreativeSet(CreativeSet creativeSet) { + object[] results = this.Invoke("updateCreativeSet", new object[] { creativeSet }); + return ((CreativeSet) (results[0])); + } + } + + + + + + + + + + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OAuth))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClientLogin))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class Authentication { + private string authenticationTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Authentication.Type")] + public string AuthenticationType { + get { return this.authenticationTypeField; } + set { this.authenticationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CreativeSetPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeSet[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeSet[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CreativeSet { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private long masterCreativeIdField; + + private bool masterCreativeIdFieldSpecified; + + private long[] companionCreativeIdsField; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public long masterCreativeId { + get { return this.masterCreativeIdField; } + set { + this.masterCreativeIdField = value; + this.masterCreativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool masterCreativeIdSpecified { + get { return this.masterCreativeIdFieldSpecified; } + set { this.masterCreativeIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DateTime { + private Date dateField; + + private int hourField; + + private bool hourFieldSpecified; + + private int minuteField; + + private bool minuteFieldSpecified; + + private int secondField; + + private bool secondFieldSpecified; + + private string timeZoneIDField; + + public Date date { + get { return this.dateField; } + set { this.dateField = value; } + } + + public int hour { + get { return this.hourField; } + set { + this.hourField = value; + this.hourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hourSpecified { + get { return this.hourFieldSpecified; } + set { this.hourFieldSpecified = value; } + } + + public int minute { + get { return this.minuteField; } + set { + this.minuteField = value; + this.minuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minuteSpecified { + get { return this.minuteFieldSpecified; } + set { this.minuteFieldSpecified = value; } + } + + public int second { + get { return this.secondField; } + set { + this.secondField = value; + this.secondSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool secondSpecified { + get { return this.secondFieldSpecified; } + set { this.secondFieldSpecified = value; } + } + + public string timeZoneID { + get { return this.timeZoneIDField; } + set { this.timeZoneIDField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class Date { + private int yearField; + + private bool yearFieldSpecified; + + private int monthField; + + private bool monthFieldSpecified; + + private int dayField; + + private bool dayFieldSpecified; + + public int year { + get { return this.yearField; } + set { + this.yearField = value; + this.yearSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool yearSpecified { + get { return this.yearFieldSpecified; } + set { this.yearFieldSpecified = value; } + } + + public int month { + get { return this.monthField; } + set { + this.monthField = value; + this.monthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool monthSpecified { + get { return this.monthFieldSpecified; } + set { this.monthFieldSpecified = value; } + } + + public int day { + get { return this.dayField; } + set { + this.dayField = value; + this.daySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool daySpecified { + get { return this.dayFieldSpecified; } + set { this.dayFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TextValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NumberValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateTimeValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BooleanValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class Value { + private string valueTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Value.Type")] + public string ValueType { + get { return this.valueTypeField; } + set { this.valueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class TextValue : Value { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class NumberValue : Value { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DateTimeValue : Value { + private DateTime valueField; + + public DateTime value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class BooleanValue : Value { + private bool valueField; + + private bool valueFieldSpecified; + + public bool value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class String_ValueMapEntry { + private string keyField; + + private Value valueField; + + public string key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public Value value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class Statement { + private string queryField; + + private String_ValueMapEntry[] valuesField; + + public string query { + get { return this.queryField; } + set { this.queryField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("values")] + public String_ValueMapEntry[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UniqueError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TypeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TemplateInstantiatedCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringLengthError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StatementError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServerError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredSizeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredNumberError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredCollectionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RangeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(QuotaError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PublisherQueryLanguageSyntaxError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PublisherQueryLanguageContextError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PermissionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ParseError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NullError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NotNullError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LabelEntityAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidUrlError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidPhoneNumberError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InternalApiError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FileError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeatureError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EntityLimitReachedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeSetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeAssetMacroError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CommonError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AuthenticationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApiVersionError))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RegExError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LabelError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeWrapperError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentPartnerError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TeamError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemCreativeAssociationOperationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemCreativeAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceExtensionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseAccountError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReportError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReservationDetailsError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OrderError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OrderActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemOperationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemFlightDateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidEmailError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitHierarchyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitCodeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitAfcSizeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserDomainTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TechnologyTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GeoTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GenericTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FrequencyCapError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ForecastError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DayPartTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateTimeRangeTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldValueError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CompanyCreditStatusError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClickTrackingLineItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeTemplateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CompanyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitTypeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitSizesError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitPartnerAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidColorError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldError))] + public abstract partial class ApiError { + private string fieldPathField; + + private string triggerField; + + private string errorStringField; + + private string apiErrorTypeField; + + public string fieldPath { + get { return this.fieldPathField; } + set { this.fieldPathField = value; } + } + + public string trigger { + get { return this.triggerField; } + set { this.triggerField = value; } + } + + public string errorString { + get { return this.errorStringField; } + set { this.errorStringField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApiError.Type")] + public string ApiErrorType { + get { return this.apiErrorTypeField; } + set { this.apiErrorTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class UniqueError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class TypeError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class TemplateInstantiatedCreativeError : ApiError { + private TemplateInstantiatedCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TemplateInstantiatedCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TemplateInstantiatedCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum TemplateInstantiatedCreativeErrorReason { + INACTIVE_CREATIVE_TEMPLATE, + FILE_TYPE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class StringLengthError : ApiError { + private StringLengthErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StringLengthErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StringLengthError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum StringLengthErrorReason { + TOO_LONG, + TOO_SHORT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class StatementError : ApiError { + private StatementErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StatementErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StatementError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum StatementErrorReason { + VARIABLE_NOT_BOUND_TO_VALUE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ServerError : ApiError { + private ServerErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ServerErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ServerError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum ServerErrorReason { + SERVER_ERROR, + SERVER_BUSY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class RichMediaStudioCreativeError : ApiError { + private RichMediaStudioCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RichMediaStudioCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaStudioCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum RichMediaStudioCreativeErrorReason { + CREATION_NOT_ALLOWED, + UKNOWN_ERROR, + INVALID_CODE_GENERATION_REQUEST, + INVALID_CREATIVE_OBJECT, + STUDIO_CONNECTION_ERROR, + PUSHDOWN_DURATION_NOT_ALLOWED, + INVALID_POSITION, + INVALID_Z_INDEX, + INVALID_PUSHDOWN_DURATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class RequiredSizeError : ApiError { + private RequiredSizeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredSizeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredSizeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum RequiredSizeErrorReason { + REQUIRED, + NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class RequiredNumberError : ApiError { + private RequiredNumberErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredNumberErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredNumberError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum RequiredNumberErrorReason { + REQUIRED, + TOO_LARGE, + TOO_SMALL, + TOO_LARGE_WITH_DETAILS, + TOO_SMALL_WITH_DETAILS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class RequiredError : ApiError { + private RequiredErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum RequiredErrorReason { + REQUIRED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class RequiredCollectionError : ApiError { + private RequiredCollectionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredCollectionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredCollectionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum RequiredCollectionErrorReason { + REQUIRED, + TOO_LARGE, + TOO_SMALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class RangeError : ApiError { + private RangeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RangeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RangeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum RangeErrorReason { + TOO_HIGH, + TOO_LOW, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class QuotaError : ApiError { + private QuotaErrorReason reasonField; + + private bool reasonFieldSpecified; + + public QuotaErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "QuotaError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum QuotaErrorReason { + EXCEEDED_QUOTA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class PublisherQueryLanguageSyntaxError : ApiError { + private PublisherQueryLanguageSyntaxErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PublisherQueryLanguageSyntaxErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PublisherQueryLanguageSyntaxError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum PublisherQueryLanguageSyntaxErrorReason { + UNPARSABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class PublisherQueryLanguageContextError : ApiError { + private PublisherQueryLanguageContextErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PublisherQueryLanguageContextErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PublisherQueryLanguageContextError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum PublisherQueryLanguageContextErrorReason { + UNEXECUTABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class PermissionError : ApiError { + private PermissionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PermissionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PermissionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum PermissionErrorReason { + PERMISSION_DENIED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ParseError : ApiError { + private ParseErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ParseErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ParseError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum ParseErrorReason { + UNPARSABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class NullError : ApiError { + private NullErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NullErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NullError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum NullErrorReason { + NULL_CONTENT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class NotNullError : ApiError { + private NotNullErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NotNullErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NotNullError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum NotNullErrorReason { + ARG1_NULL, + ARG2_NULL, + ARG3_NULL, + NULL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class LabelEntityAssociationError : ApiError { + private LabelEntityAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LabelEntityAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LabelEntityAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum LabelEntityAssociationErrorReason { + INVALID_COMPANY_TYPE, + DUPLICATE_ASSOCIATION, + INVALID_ASSOCIATION, + DUPLICATE_ASSOCIATION_WITH_NEGATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class InvalidUrlError : ApiError { + private InvalidUrlErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidUrlErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidUrlError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum InvalidUrlErrorReason { + ILLEGAL_CHARACTERS, + INVALID_FORMAT, + INSECURE_SCHEME, + NO_SCHEME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class InvalidPhoneNumberError : ApiError { + private InvalidPhoneNumberErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidPhoneNumberErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidPhoneNumberError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum InvalidPhoneNumberErrorReason { + INVALID_FORMAT, + TOO_SHORT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class InternalApiError : ApiError { + private InternalApiErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InternalApiErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InternalApiError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum InternalApiErrorReason { + UNEXPECTED_INTERNAL_API_ERROR, + UNKNOWN, + DOWNTIME + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ImageError : ApiError { + private ImageErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ImageErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ImageError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum ImageErrorReason { + INVALID_IMAGE, + INVALID_SIZE, + UNEXPECTED_SIZE, + ANIMATED_NOT_ALLOWED, + ANIMATION_TOO_LONG, + CMYK_JPEG_NOT_ALLOWED, + FLASH_NOT_ALLOWED, + FLASH_WITHOUT_CLICKTAG, + ANIMATED_VISUAL_EFFECT, + FLASH_ERROR, + LAYOUT_PROBLEM, + FLASH_HAS_NETWORK_OBJECTS, + FLASH_HAS_NETWORK_METHODS, + FLASH_HAS_URL, + FLASH_HAS_MOUSE_TRACKING, + FLASH_HAS_RANDOM_NUM, + FLASH_SELF_TARGETS, + FLASH_BAD_GETURL_TARGET, + FLASH_VERSION_NOT_SUPPORTED, + FILE_TOO_LARGE, + SYSTEM_ERROR, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class FileError : ApiError { + private FileErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FileErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FileError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum FileErrorReason { + MISSING_CONTENTS, + SIZE_TOO_LARGE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class FeatureError : ApiError { + private FeatureErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FeatureErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeatureError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum FeatureErrorReason { + MISSING_FEATURE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class EntityLimitReachedError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CustomCreativeError : ApiError { + private CustomCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CustomCreativeErrorReason { + DUPLICATE_MACRO_NAME_FOR_CREATIVE, + SNIPPET_REFERENCES_MISSING_MACRO, + UNRECOGNIZED_MACRO, + CUSTOM_CREATIVE_NOT_ALLOWED, + MISSING_INTERSTITIAL_MACRO, + DUPLICATE_ASSET_IN_MACROS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CreativeSetError : ApiError { + private CreativeSetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeSetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeSetError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CreativeSetErrorReason { + VIDEO_FEATURE_REQUIRED, + CANNOT_CREATE_OR_UPDATE_VIDEO_CREATIVES, + ROADBLOCK_FEATURE_REQUIRED, + MASTER_CREATIVE_CANNOT_BE_COMPANION, + VIDEO_CREATIVE_NOT_ALLOWED, + INVALID_ADVERTISER, + UPDATE_MASTER_CREATIVE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CreativeError : ApiError { + private CreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CreativeErrorReason { + FLASH_AND_FALLBACK_URL_ARE_SAME, + INVALID_INTERNAL_REDIRECT_URL, + DESTINATION_URL_REQUIRED, + CANNOT_CREATE_OR_UPDATE_LEGACY_DFP_CREATIVE, + CANNOT_CREATE_OR_UPDATE_LEGACY_DFP_MOBILE_CREATIVE, + MISSING_FEATURE, + INVALID_COMPANY_TYPE, + INVALID_ADSENSE_CREATIVE_SIZE, + INVALID_AD_EXCHANGE_CREATIVE_SIZE, + DUPLICATE_ASSET_IN_CREATIVE, + CREATIVE_ASSET_CANNOT_HAVE_ID_AND_BYTE_ARRAY, + CANNOT_CREATE_OR_UPDATE_UNSUPPORTED_CREATIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CreativeAssetMacroError : ApiError { + private CreativeAssetMacroErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeAssetMacroErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeAssetMacroError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CreativeAssetMacroErrorReason { + INVALID_MACRO_NAME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CommonError : ApiError { + private CommonErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CommonErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CommonError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CommonErrorReason { + NOT_FOUND, + ALREADY_EXISTS, + DUPLICATE_OBJECT, + CANNOT_UPDATE, + CONCURRENT_MODIFICATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AuthenticationError : ApiError { + private AuthenticationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AuthenticationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AuthenticationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum AuthenticationErrorReason { + AMBIGUOUS_SOAP_REQUEST_HEADER, + INVALID_EMAIL, + AUTHENTICATION_FAILED, + INVALID_OAUTH_SIGNATURE, + INVALID_SERVICE, + MISSING_SOAP_REQUEST_HEADER, + MISSING_AUTHENTICATION_HTTP_HEADER, + MISSING_AUTHENTICATION, + NOT_WHITELISTED_FOR_API_ACCESS, + NO_NETWORKS_TO_ACCESS, + NETWORK_NOT_FOUND, + NETWORK_CODE_REQUIRED, + CONNECTION_ERROR, + GOOGLE_ACCOUNT_ALREADY_ASSOCIATED_WITH_NETWORK, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AssetError : ApiError { + private AssetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AssetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AssetError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum AssetErrorReason { + NON_UNIQUE_NAME, + FILE_NAME_TOO_LONG, + FILE_SIZE_TOO_LARGE, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_CLIENT, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_HEIGHT, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_WIDTH, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_FORMAT, + INVALID_CODE_SNIPPET_PARAMETER_VALUE, + INVALID_ASSET_ID, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ApiVersionError : ApiError { + private ApiVersionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ApiVersionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ApiVersionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum ApiVersionErrorReason { + UPDATE_TO_NEWER_VERSION, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApiException))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ApplicationException { + private string messageField; + + private string applicationExceptionTypeField; + + public string message { + get { return this.messageField; } + set { this.messageField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApplicationException.Type")] + public string ApplicationExceptionType { + get { return this.applicationExceptionTypeField; } + set { this.applicationExceptionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ApiException : ApplicationException { + private ApiError[] errorsField; + + [System.Xml.Serialization.XmlElementAttribute("errors")] + public ApiError[] errors { + get { return this.errorsField; } + set { this.errorsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class OAuth : Authentication { + private string parametersField; + + public string parameters { + get { return this.parametersField; } + set { this.parametersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ClientLogin : Authentication { + private string tokenField; + + public string token { + get { return this.tokenField; } + set { this.tokenField = value; } + } + } + + + + + + + + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "PlacementServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SiteTargetingInfo))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class PlacementService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public PlacementService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/PlacementService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Placement createPlacement(Placement placement) { + object[] results = this.Invoke("createPlacement", new object[] { placement }); + return ((Placement) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Placement[] createPlacements([System.Xml.Serialization.XmlElementAttribute("placements")] +Placement[] placements) { + object[] results = this.Invoke("createPlacements", new object[] { placements }); + return ((Placement[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Placement getPlacement(long placementId) { + object[] results = this.Invoke("getPlacement", new object[] { placementId }); + return ((Placement) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public PlacementPage getPlacementsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getPlacementsByStatement", new object[] { filterStatement }); + return ((PlacementPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performPlacementAction(PlacementAction placementAction, Statement filterStatement) { + object[] results = this.Invoke("performPlacementAction", new object[] { placementAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Placement updatePlacement(Placement placement) { + object[] results = this.Invoke("updatePlacement", new object[] { placement }); + return ((Placement) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Placement[] updatePlacements([System.Xml.Serialization.XmlElementAttribute("placements")] +Placement[] placements) { + object[] results = this.Invoke("updatePlacements", new object[] { placements }); + return ((Placement[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class UpdateResult { + private int numChangesField; + + private bool numChangesFieldSpecified; + + public int numChanges { + get { return this.numChangesField; } + set { + this.numChangesField = value; + this.numChangesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numChangesSpecified { + get { return this.numChangesFieldSpecified; } + set { this.numChangesFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivatePlacements))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchivePlacements))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivatePlacements))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class PlacementAction { + private string placementActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("PlacementAction.Type")] + public string PlacementActionType { + get { return this.placementActionTypeField; } + set { this.placementActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DeactivatePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ArchivePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ActivatePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class PlacementPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Placement[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Placement[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class Placement : SiteTargetingInfo { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private string placementCodeField; + + private InventoryStatus statusField; + + private bool statusFieldSpecified; + + private bool isAdSenseTargetingEnabledField; + + private bool isAdSenseTargetingEnabledFieldSpecified; + + private bool isAdPlannerTargetingEnabledField; + + private bool isAdPlannerTargetingEnabledFieldSpecified; + + private string adSenseTargetingLocaleField; + + private string[] targetedAdUnitIdsField; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public string placementCode { + get { return this.placementCodeField; } + set { this.placementCodeField = value; } + } + + public InventoryStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public bool isAdSenseTargetingEnabled { + get { return this.isAdSenseTargetingEnabledField; } + set { + this.isAdSenseTargetingEnabledField = value; + this.isAdSenseTargetingEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAdSenseTargetingEnabledSpecified { + get { return this.isAdSenseTargetingEnabledFieldSpecified; } + set { this.isAdSenseTargetingEnabledFieldSpecified = value; } + } + + public bool isAdPlannerTargetingEnabled { + get { return this.isAdPlannerTargetingEnabledField; } + set { + this.isAdPlannerTargetingEnabledField = value; + this.isAdPlannerTargetingEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAdPlannerTargetingEnabledSpecified { + get { return this.isAdPlannerTargetingEnabledFieldSpecified; } + set { this.isAdPlannerTargetingEnabledFieldSpecified = value; } + } + + public string adSenseTargetingLocale { + get { return this.adSenseTargetingLocaleField; } + set { this.adSenseTargetingLocaleField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedAdUnitIds")] + public string[] targetedAdUnitIds { + get { return this.targetedAdUnitIdsField; } + set { this.targetedAdUnitIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum InventoryStatus { + ACTIVE, + INACTIVE, + ARCHIVED + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Placement))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class SiteTargetingInfo { + private string targetingDescriptionField; + + private string targetingSiteNameField; + + private string targetingAdLocationField; + + private string siteTargetingInfoTypeField; + + public string targetingDescription { + get { return this.targetingDescriptionField; } + set { this.targetingDescriptionField = value; } + } + + public string targetingSiteName { + get { return this.targetingSiteNameField; } + set { this.targetingSiteNameField = value; } + } + + public string targetingAdLocation { + get { return this.targetingAdLocationField; } + set { this.targetingAdLocationField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("SiteTargetingInfo.Type")] + public string SiteTargetingInfoType { + get { return this.siteTargetingInfoTypeField; } + set { this.siteTargetingInfoTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class RegExError : ApiError { + private RegExErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RegExErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RegExError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum RegExErrorReason { + INVALID, + NULL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class PlacementError : ApiError { + private PlacementErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PlacementErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PlacementError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum PlacementErrorReason { + INVALID_ENTITY_TYPE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeWrapperServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeWrapperService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeWrapperService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/CreativeWrapperService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeWrapper createCreativeWrapper(CreativeWrapper creativeWrapper) { + object[] results = this.Invoke("createCreativeWrapper", new object[] { creativeWrapper }); + return ((CreativeWrapper) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeWrapper[] createCreativeWrappers([System.Xml.Serialization.XmlElementAttribute("creativeWrappers")] +CreativeWrapper[] creativeWrappers) { + object[] results = this.Invoke("createCreativeWrappers", new object[] { creativeWrappers }); + return ((CreativeWrapper[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeWrapper getCreativeWrapper(long creativeWrapperId) { + object[] results = this.Invoke("getCreativeWrapper", new object[] { creativeWrapperId }); + return ((CreativeWrapper) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeWrapperPage getCreativeWrappersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativeWrappersByStatement", new object[] { filterStatement }); + return ((CreativeWrapperPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performCreativeWrapperAction(CreativeWrapperAction creativeWrapperAction, Statement filterStatement) { + object[] results = this.Invoke("performCreativeWrapperAction", new object[] { creativeWrapperAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeWrapper updateCreativeWrapper(CreativeWrapper creativeWrapper) { + object[] results = this.Invoke("updateCreativeWrapper", new object[] { creativeWrapper }); + return ((CreativeWrapper) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeWrapper[] updateCreativeWrappers([System.Xml.Serialization.XmlElementAttribute("creativeWrappers")] +CreativeWrapper[] creativeWrappers) { + object[] results = this.Invoke("updateCreativeWrappers", new object[] { creativeWrappers }); + return ((CreativeWrapper[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateCreativeWrappers))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateCreativeWrappers))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class CreativeWrapperAction { + private string creativeWrapperActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CreativeWrapperAction.Type")] + public string CreativeWrapperActionType { + get { return this.creativeWrapperActionTypeField; } + set { this.creativeWrapperActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DeactivateCreativeWrappers : CreativeWrapperAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ActivateCreativeWrappers : CreativeWrapperAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CreativeWrapperPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeWrapper[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeWrapper[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CreativeWrapper { + private long idField; + + private bool idFieldSpecified; + + private long labelIdField; + + private bool labelIdFieldSpecified; + + private CreativeWrapperHtmlSnippet headerField; + + private CreativeWrapperHtmlSnippet footerField; + + private CreativeWrapperOrdering orderingField; + + private bool orderingFieldSpecified; + + private CreativeWrapperStatus statusField; + + private bool statusFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + + public CreativeWrapperHtmlSnippet header { + get { return this.headerField; } + set { this.headerField = value; } + } + + public CreativeWrapperHtmlSnippet footer { + get { return this.footerField; } + set { this.footerField = value; } + } + + public CreativeWrapperOrdering ordering { + get { return this.orderingField; } + set { + this.orderingField = value; + this.orderingSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderingSpecified { + get { return this.orderingFieldSpecified; } + set { this.orderingFieldSpecified = value; } + } + + public CreativeWrapperStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CreativeWrapperHtmlSnippet { + private string htmlSnippetField; + + public string htmlSnippet { + get { return this.htmlSnippetField; } + set { this.htmlSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CreativeWrapperOrdering { + NO_PREFERENCE, + INNER, + OUTER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CreativeWrapperStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class LabelError : ApiError { + private LabelErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LabelErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LabelError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum LabelErrorReason { + INVALID_PREFIX, + NAME_INVALID_CHARS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CreativeWrapperError : ApiError { + private CreativeWrapperErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeWrapperErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeWrapperError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CreativeWrapperErrorReason { + LABEL_ALREADY_ASSOCIATED_WITH_CREATIVE_WRAPPER, + INVALID_LABEL_TYPE, + UNRECOGNIZED_MACRO, + NEITHER_HEADER_NOR_FOOTER_SPECIFIED, + CANNOT_USE_CREATIVE_WRAPPER_TYPE, + CANNOT_UPDATE_LABEL_ID, + CANNOT_APPLY_TO_AD_UNIT_WITH_VIDEO_SIZES, + CANNOT_APPLY_TO_MOBILE_AD_UNIT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ContentServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ContentService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ContentService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/ContentService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ContentPage getContentByStatement(Statement statement) { + object[] results = this.Invoke("getContentByStatement", new object[] { statement }); + return ((ContentPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ContentPage getContentByStatementAndCustomTargetingValue(Statement filterStatement, long customTargetingValueId) { + object[] results = this.Invoke("getContentByStatementAndCustomTargetingValue", new object[] { filterStatement, customTargetingValueId }); + return ((ContentPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ContentPage getUncategorizedContentByStatement(Statement filterStatement) { + object[] results = this.Invoke("getUncategorizedContentByStatement", new object[] { filterStatement }); + return ((ContentPage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class Content { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private ContentStatus statusField; + + private bool statusFieldSpecified; + + private ContentStatusDefinedBy statusDefinedByField; + + private bool statusDefinedByFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ContentStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ContentStatusDefinedBy statusDefinedBy { + get { return this.statusDefinedByField; } + set { + this.statusDefinedByField = value; + this.statusDefinedBySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusDefinedBySpecified { + get { return this.statusDefinedByFieldSpecified; } + set { this.statusDefinedByFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum ContentStatus { + ACTIVE, + INACTIVE, + ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum ContentStatusDefinedBy { + CMS, + USER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ContentPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Content[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Content[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ContentPartnerError : ApiError { + private ContentPartnerErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ContentPartnerErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ContentPartnerError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum ContentPartnerErrorReason { + FEATURE_NOT_ENABLED, + INVALID_PARTNER_TYPE, + NO_PARTNER_CATCH_ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "TeamServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class TeamService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public TeamService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/TeamService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Team createTeam(Team team) { + object[] results = this.Invoke("createTeam", new object[] { team }); + return ((Team) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Team[] createTeams([System.Xml.Serialization.XmlElementAttribute("teams")] +Team[] teams) { + object[] results = this.Invoke("createTeams", new object[] { teams }); + return ((Team[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Team getTeam(long teamId) { + object[] results = this.Invoke("getTeam", new object[] { teamId }); + return ((Team) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public TeamPage getTeamsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getTeamsByStatement", new object[] { filterStatement }); + return ((TeamPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Team updateTeam(Team team) { + object[] results = this.Invoke("updateTeam", new object[] { team }); + return ((Team) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Team[] updateTeams([System.Xml.Serialization.XmlElementAttribute("teams")] +Team[] teams) { + object[] results = this.Invoke("updateTeams", new object[] { teams }); + return ((Team[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class TeamPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Team[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Team[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class Team { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool hasAllCompaniesField; + + private bool hasAllCompaniesFieldSpecified; + + private bool hasAllInventoryField; + + private bool hasAllInventoryFieldSpecified; + + private TeamAccessType teamAccessTypeField; + + private bool teamAccessTypeFieldSpecified; + + private long[] companyIdsField; + + private string[] adUnitIdsField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool hasAllCompanies { + get { return this.hasAllCompaniesField; } + set { + this.hasAllCompaniesField = value; + this.hasAllCompaniesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasAllCompaniesSpecified { + get { return this.hasAllCompaniesFieldSpecified; } + set { this.hasAllCompaniesFieldSpecified = value; } + } + + public bool hasAllInventory { + get { return this.hasAllInventoryField; } + set { + this.hasAllInventoryField = value; + this.hasAllInventorySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasAllInventorySpecified { + get { return this.hasAllInventoryFieldSpecified; } + set { this.hasAllInventoryFieldSpecified = value; } + } + + public TeamAccessType teamAccessType { + get { return this.teamAccessTypeField; } + set { + this.teamAccessTypeField = value; + this.teamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool teamAccessTypeSpecified { + get { return this.teamAccessTypeFieldSpecified; } + set { this.teamAccessTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companyIds")] + public long[] companyIds { + get { return this.companyIdsField; } + set { this.companyIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adUnitIds")] + public string[] adUnitIds { + get { return this.adUnitIdsField; } + set { this.adUnitIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum TeamAccessType { + NONE, + READ_ONLY, + READ_WRITE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class TeamError : ApiError { + private TeamErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TeamErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TeamError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum TeamErrorReason { + ENTITY_NOT_ON_USERS_TEAMS, + MISSING_USERS_TEAM, + ALL_TEAM_ASSOCIATION_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LabelServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LabelService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LabelService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/LabelService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Label createLabel(Label label) { + object[] results = this.Invoke("createLabel", new object[] { label }); + return ((Label) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Label[] createLabels([System.Xml.Serialization.XmlElementAttribute("labels")] +Label[] labels) { + object[] results = this.Invoke("createLabels", new object[] { labels }); + return ((Label[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Label getLabel(long labelId) { + object[] results = this.Invoke("getLabel", new object[] { labelId }); + return ((Label) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LabelPage getLabelsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLabelsByStatement", new object[] { filterStatement }); + return ((LabelPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performLabelAction(LabelAction labelAction, Statement filterStatement) { + object[] results = this.Invoke("performLabelAction", new object[] { labelAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Label updateLabel(Label label) { + object[] results = this.Invoke("updateLabel", new object[] { label }); + return ((Label) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Label[] updateLabels([System.Xml.Serialization.XmlElementAttribute("labels")] +Label[] labels) { + object[] results = this.Invoke("updateLabels", new object[] { labels }); + return ((Label[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateLabels))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLabels))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class LabelAction { + private string labelActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LabelAction.Type")] + public string LabelActionType { + get { return this.labelActionTypeField; } + set { this.labelActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DeactivateLabels : LabelAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ActivateLabels : LabelAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class LabelPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Label[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Label[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class Label { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private LabelType[] typesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("types")] + public LabelType[] types { + get { return this.typesField; } + set { this.typesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum LabelType { + COMPETITIVE_EXCLUSION, + AD_UNIT_FREQUENCY_CAP, + AD_EXCLUSION, + CREATIVE_WRAPPER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomTargetingServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomTargetingService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomTargetingService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/CustomTargetingService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomTargetingKey[] createCustomTargetingKeys([System.Xml.Serialization.XmlElementAttribute("keys")] +CustomTargetingKey[] keys) { + object[] results = this.Invoke("createCustomTargetingKeys", new object[] { keys }); + return ((CustomTargetingKey[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomTargetingValue[] createCustomTargetingValues([System.Xml.Serialization.XmlElementAttribute("values")] +CustomTargetingValue[] values) { + object[] results = this.Invoke("createCustomTargetingValues", new object[] { values }); + return ((CustomTargetingValue[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomTargetingKeyPage getCustomTargetingKeysByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomTargetingKeysByStatement", new object[] { filterStatement }); + return ((CustomTargetingKeyPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomTargetingValuePage getCustomTargetingValuesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomTargetingValuesByStatement", new object[] { filterStatement }); + return ((CustomTargetingValuePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performCustomTargetingKeyAction(CustomTargetingKeyAction customTargetingKeyAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomTargetingKeyAction", new object[] { customTargetingKeyAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performCustomTargetingValueAction(CustomTargetingValueAction customTargetingValueAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomTargetingValueAction", new object[] { customTargetingValueAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomTargetingKey[] updateCustomTargetingKeys([System.Xml.Serialization.XmlElementAttribute("keys")] +CustomTargetingKey[] keys) { + object[] results = this.Invoke("updateCustomTargetingKeys", new object[] { keys }); + return ((CustomTargetingKey[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomTargetingValue[] updateCustomTargetingValues([System.Xml.Serialization.XmlElementAttribute("values")] +CustomTargetingValue[] values) { + object[] results = this.Invoke("updateCustomTargetingValues", new object[] { values }); + return ((CustomTargetingValue[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteCustomTargetingValues))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class CustomTargetingValueAction { + private string customTargetingValueActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomTargetingValueAction.Type")] + public string CustomTargetingValueActionType { + get { return this.customTargetingValueActionTypeField; } + set { this.customTargetingValueActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DeleteCustomTargetingValues : CustomTargetingValueAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteCustomTargetingKeys))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class CustomTargetingKeyAction { + private string customTargetingKeyActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomTargetingKeyAction.Type")] + public string CustomTargetingKeyActionType { + get { return this.customTargetingKeyActionTypeField; } + set { this.customTargetingKeyActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DeleteCustomTargetingKeys : CustomTargetingKeyAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CustomTargetingValuePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomTargetingValue[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomTargetingValue[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CustomTargetingValue { + private long customTargetingKeyIdField; + + private bool customTargetingKeyIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string displayNameField; + + private CustomTargetingValueMatchType matchTypeField; + + private bool matchTypeFieldSpecified; + + public long customTargetingKeyId { + get { return this.customTargetingKeyIdField; } + set { + this.customTargetingKeyIdField = value; + this.customTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customTargetingKeyIdSpecified { + get { return this.customTargetingKeyIdFieldSpecified; } + set { this.customTargetingKeyIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public CustomTargetingValueMatchType matchType { + get { return this.matchTypeField; } + set { + this.matchTypeField = value; + this.matchTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool matchTypeSpecified { + get { return this.matchTypeFieldSpecified; } + set { this.matchTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingValue.MatchType", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CustomTargetingValueMatchType { + EXACT, + BROAD, + PREFIX, + BROAD_PREFIX + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CustomTargetingKeyPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomTargetingKey[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomTargetingKey[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CustomTargetingKey { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string displayNameField; + + private CustomTargetingKeyType typeField; + + private bool typeFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public CustomTargetingKeyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingKey.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CustomTargetingKeyType { + PREDEFINED, + FREEFORM + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CustomTargetingError : ApiError { + private CustomTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CustomTargetingErrorReason { + KEY_NOT_FOUND, + KEY_COUNT_TOO_LARGE, + KEY_NAME_DUPLICATE, + KEY_NAME_EMPTY, + KEY_NAME_INVALID_LENGTH, + KEY_NAME_INVALID_CHARS, + KEY_NAME_RESERVED, + KEY_DISPLAY_NAME_INVALID_LENGTH, + VALUE_NOT_FOUND, + GET_VALUES_BY_STATEMENT_MUST_CONTAIN_KEY_ID, + VALUE_COUNT_FOR_KEY_TOO_LARGE, + VALUE_NAME_DUPLICATE, + VALUE_NAME_EMPTY, + VALUE_NAME_INVALID_LENGTH, + VALUE_NAME_INVALID_CHARS, + VALUE_DISPLAY_NAME_INVALID_LENGTH, + VALUE_MATCH_TYPE_NOT_ALLOWED, + VALUE_MATCH_TYPE_NOT_EXACT_FOR_PREDEFINED_KEY, + KEY_WITH_MISSING_VALUES, + CANNOT_OR_DIFFERENT_KEYS, + INVALID_TARGETING_EXPRESSION, + DELETED_KEY_CANNOT_BE_USED_FOR_TARGETING, + DELETED_VALUE_CANNOT_BE_USED_FOR_TARGETING, + VIDEO_BROWSE_BY_KEY_CANNOT_BE_USED_FOR_CUSTOM_TARGETING, + CANNOT_TARGET_AUDIENCE_SEGMENT, + CANNOT_TARGET_INACTIVE_AUDIENCE_SEGMENT, + INVALID_AUDIENCE_SEGMENTS, + ONLY_APPROVED_AUDIENCE_SEGMENTS_CAN_BE_TARGETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LineItemCreativeAssociationServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LineItemCreativeAssociationService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LineItemCreativeAssociationService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/LineItemCreativeAssociationServ" + "ice"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItemCreativeAssociation createLineItemCreativeAssociation(LineItemCreativeAssociation lineItemCreativeAssociation) { + object[] results = this.Invoke("createLineItemCreativeAssociation", new object[] { lineItemCreativeAssociation }); + return ((LineItemCreativeAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItemCreativeAssociation[] createLineItemCreativeAssociations([System.Xml.Serialization.XmlElementAttribute("lineItemCreativeAssociations")] +LineItemCreativeAssociation[] lineItemCreativeAssociations) { + object[] results = this.Invoke("createLineItemCreativeAssociations", new object[] { lineItemCreativeAssociations }); + return ((LineItemCreativeAssociation[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItemCreativeAssociation getLineItemCreativeAssociation(long lineItemId, long creativeId) { + object[] results = this.Invoke("getLineItemCreativeAssociation", new object[] { lineItemId, creativeId }); + return ((LineItemCreativeAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItemCreativeAssociationPage getLineItemCreativeAssociationsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLineItemCreativeAssociationsByStatement", new object[] { filterStatement }); + return ((LineItemCreativeAssociationPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public string getPreviewUrl(long lineItemId, long creativeId, string siteUrl) { + object[] results = this.Invoke("getPreviewUrl", new object[] { lineItemId, creativeId, siteUrl }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performLineItemCreativeAssociationAction(LineItemCreativeAssociationAction lineItemCreativeAssociationAction, Statement filterStatement) { + object[] results = this.Invoke("performLineItemCreativeAssociationAction", new object[] { lineItemCreativeAssociationAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItemCreativeAssociation updateLineItemCreativeAssociation(LineItemCreativeAssociation lineItemCreativeAssociation) { + object[] results = this.Invoke("updateLineItemCreativeAssociation", new object[] { lineItemCreativeAssociation }); + return ((LineItemCreativeAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItemCreativeAssociation[] updateLineItemCreativeAssociations([System.Xml.Serialization.XmlElementAttribute("lineItemCreativeAssociations")] +LineItemCreativeAssociation[] lineItemCreativeAssociations) { + object[] results = this.Invoke("updateLineItemCreativeAssociations", new object[] { lineItemCreativeAssociations }); + return ((LineItemCreativeAssociation[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateLineItemCreativeAssociations))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLineItemCreativeAssociations))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class LineItemCreativeAssociationAction { + private string lineItemCreativeAssociationActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LineItemCreativeAssociationAction.Type")] + public string LineItemCreativeAssociationActionType { + get { return this.lineItemCreativeAssociationActionTypeField; } + set { this.lineItemCreativeAssociationActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DeactivateLineItemCreativeAssociations : LineItemCreativeAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ActivateLineItemCreativeAssociations : LineItemCreativeAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class LineItemCreativeAssociationPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LineItemCreativeAssociation[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LineItemCreativeAssociation[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class LineItemCreativeAssociation { + private long lineItemIdField; + + private bool lineItemIdFieldSpecified; + + private long creativeIdField; + + private bool creativeIdFieldSpecified; + + private long creativeSetIdField; + + private bool creativeSetIdFieldSpecified; + + private double manualCreativeRotationWeightField; + + private bool manualCreativeRotationWeightFieldSpecified; + + private int sequentialCreativeRotationIndexField; + + private bool sequentialCreativeRotationIndexFieldSpecified; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private string destinationUrlField; + + private Size[] sizesField; + + private LineItemCreativeAssociationStatus statusField; + + private bool statusFieldSpecified; + + private LineItemCreativeAssociationStats statsField; + + private DateTime lastModifiedDateTimeField; + + public long lineItemId { + get { return this.lineItemIdField; } + set { + this.lineItemIdField = value; + this.lineItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemIdSpecified { + get { return this.lineItemIdFieldSpecified; } + set { this.lineItemIdFieldSpecified = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { + this.creativeIdField = value; + this.creativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeIdSpecified { + get { return this.creativeIdFieldSpecified; } + set { this.creativeIdFieldSpecified = value; } + } + + public long creativeSetId { + get { return this.creativeSetIdField; } + set { + this.creativeSetIdField = value; + this.creativeSetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeSetIdSpecified { + get { return this.creativeSetIdFieldSpecified; } + set { this.creativeSetIdFieldSpecified = value; } + } + + public double manualCreativeRotationWeight { + get { return this.manualCreativeRotationWeightField; } + set { + this.manualCreativeRotationWeightField = value; + this.manualCreativeRotationWeightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manualCreativeRotationWeightSpecified { + get { return this.manualCreativeRotationWeightFieldSpecified; } + set { this.manualCreativeRotationWeightFieldSpecified = value; } + } + + public int sequentialCreativeRotationIndex { + get { return this.sequentialCreativeRotationIndexField; } + set { + this.sequentialCreativeRotationIndexField = value; + this.sequentialCreativeRotationIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sequentialCreativeRotationIndexSpecified { + get { return this.sequentialCreativeRotationIndexFieldSpecified; } + set { this.sequentialCreativeRotationIndexFieldSpecified = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("sizes")] + public Size[] sizes { + get { return this.sizesField; } + set { this.sizesField = value; } + } + + public LineItemCreativeAssociationStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public LineItemCreativeAssociationStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum StartDateTimeType { + USE_START_DATE_TIME, + IMMEDIATELY, + ONE_HOUR_FROM_NOW + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class Size { + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + private bool isAspectRatioField; + + private bool isAspectRatioFieldSpecified; + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + public bool isAspectRatio { + get { return this.isAspectRatioField; } + set { + this.isAspectRatioField = value; + this.isAspectRatioSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAspectRatioSpecified { + get { return this.isAspectRatioFieldSpecified; } + set { this.isAspectRatioFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociation.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum LineItemCreativeAssociationStatus { + ACTIVE, + NOT_SERVING, + INACTIVE, + DELETED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class LineItemCreativeAssociationStats { + private Stats statsField; + + private Long_StatsMapEntry[] creativeSetStatsField; + + private Money costInOrderCurrencyField; + + public Stats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativeSetStats")] + public Long_StatsMapEntry[] creativeSetStats { + get { return this.creativeSetStatsField; } + set { this.creativeSetStatsField = value; } + } + + public Money costInOrderCurrency { + get { return this.costInOrderCurrencyField; } + set { this.costInOrderCurrencyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class Stats { + private long impressionsDeliveredField; + + private bool impressionsDeliveredFieldSpecified; + + private long clicksDeliveredField; + + private bool clicksDeliveredFieldSpecified; + + public long impressionsDelivered { + get { return this.impressionsDeliveredField; } + set { + this.impressionsDeliveredField = value; + this.impressionsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsDeliveredSpecified { + get { return this.impressionsDeliveredFieldSpecified; } + set { this.impressionsDeliveredFieldSpecified = value; } + } + + public long clicksDelivered { + get { return this.clicksDeliveredField; } + set { + this.clicksDeliveredField = value; + this.clicksDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clicksDeliveredSpecified { + get { return this.clicksDeliveredFieldSpecified; } + set { this.clicksDeliveredFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class Long_StatsMapEntry { + private long keyField; + + private bool keyFieldSpecified; + + private Stats valueField; + + public long key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public Stats value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class Money { + private string currencyCodeField; + + private long microAmountField; + + private bool microAmountFieldSpecified; + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public long microAmount { + get { return this.microAmountField; } + set { + this.microAmountField = value; + this.microAmountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool microAmountSpecified { + get { return this.microAmountFieldSpecified; } + set { this.microAmountFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class LineItemError : ApiError { + private LineItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum LineItemErrorReason { + ALREADY_STARTED, + UPDATE_RESERVATION_NOT_ALLOWED, + ALL_ROADBLOCK_NOT_ALLOWED, + CREATIVE_SET_ROADBLOCK_NOT_ALLOWED, + FRACTIONAL_PERCENTAGE_NOT_ALLOWED, + DISCOUNT_NOT_ALLOWED, + UPDATE_CANCELED_LINE_ITEM_NOT_ALLOWED, + UPDATE_PENDING_APPROVAL_LINE_ITEM_NOT_ALLOWED, + UPDATE_ARCHIVED_LINE_ITEM_NOT_ALLOWED, + FRONTLOADED_NOT_ALLOWED, + CREATE_OR_UPDATE_LEGACY_DFP_LINE_ITEM_TYPE_NOT_ALLOWED, + COPY_LINE_ITEM_FROM_DIFFERENT_COMPANY_NOT_ALLOWED, + INVALID_SIZE_FOR_PLATFORM, + INVALID_LINE_ITEM_TYPE_FOR_PLATFORM, + INVALID_WEB_PROPERTY_FOR_PLATFORM, + INVALID_WEB_PROPERTY_FOR_ENVIRONMENT, + AFMA_BACKFILL_NOT_ALLOWED, + UPDATE_ENVIRONMENT_TYPE_NOT_ALLOWED, + COMPANIONS_NOT_ALLOWED, + ROADBLOCKS_WITH_NONROADBLOCKS_NOT_ALLOWED, + CANNOT_UPDATE_TO_OR_FROM_CREATIVE_SET_ROADBLOCK, + UPDATE_FROM_BACKFILL_LINE_ITEM_TYPE_NOT_ALLOWED, + UPDATE_TO_BACKFILL_LINE_ITEM_TYPE_NOT_ALLOWED, + UPDATE_BACKFILL_WEB_PROPERTY_NOT_ALLOWED, + INVALID_COMPANION_DELIVERY_OPTION_FOR_ENVIRONMENT_TYPE, + COMPANION_BACKFILL_REQUIRES_VIDEO, + COMPANION_DELIVERY_OPTION_REQUIRE_PREMIUM, + DUPLICATE_MASTER_SIZES, + INVALID_PRIORITY_FOR_LINE_ITEM_TYPE, + INVALID_ENVIRONMENT_TYPE, + INVALID_ENVIRONMENT_TYPE_FOR_PLATFORM, + INVALID_TYPE_FOR_AUTO_EXTENSION, + INVALID_TYPE_FOR_CONTRACTED_UNITS_BOUGHT, + VIDEO_INVALID_ROADBLOCKING, + BACKFILL_TYPE_NOT_ALLOWED, + COMPANION_DELIVERY_OPTIONS_NOT_ALLOWED_WITH_BACKFILL, + INVALID_WEB_PROPERTY_FOR_ADX_BACKFILL, + INVALID_SIZE_FOR_ENVIRONMENT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class LineItemCreativeAssociationOperationError : ApiError { + private LineItemCreativeAssociationOperationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemCreativeAssociationOperationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociationOperationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum LineItemCreativeAssociationOperationErrorReason { + NOT_ALLOWED, + NOT_APPLICABLE, + CANNOT_ACTIVATE_INVALID_CREATIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class LineItemCreativeAssociationError : ApiError { + private LineItemCreativeAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemCreativeAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum LineItemCreativeAssociationErrorReason { + CREATIVE_IN_WRONG_ADVERTISERS_LIBRARY, + INVALID_LINEITEM_CREATIVE_PAIRING, + STARTDATE_BEFORE_LINEITEM_STARTDATE, + STARTDATE_NOT_BEFORE_LINEITEM_ENDDATE, + ENDDATE_AFTER_LINEITEM_ENDDATE, + ENDDATE_NOT_AFTER_LINEITEM_STARTDATE, + ENDDATE_NOT_AFTER_STARTDATE, + ENDDATE_IN_THE_PAST, + CANNOT_COPY_WITHIN_SAME_LINE_ITEM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AudienceExtensionError : ApiError { + private AudienceExtensionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AudienceExtensionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceExtensionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum AudienceExtensionErrorReason { + FREQUENCY_CAPS_NOT_SUPPORTED, + INVALID_TARGETING, + INVENTORY_UNIT_TARGETING_INVALID, + INVALID_CREATIVE_ROTATION, + INVALID_LINE_ITEM_TYPE, + INVALID_MAX_BID, + AUDIENCE_EXTENSION_BULK_UPDATE_NOT_ALLOWED, + UNEXPECTED_AUDIENCE_EXTENSION_ERROR, + MAX_DAILY_BUDGET_AMOUNT_EXCEEDED, + EXTERNAL_CAMPAIGN_ALREADY_EXISTS, + AUDIENCE_EXTENSION_WITHOUT_FEATURE, + AUDIENCE_EXTENSION_WITHOUT_LINKED_ACCOUNT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AdSenseAccountError : ApiError { + private AdSenseAccountErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdSenseAccountErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseAccountError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum AdSenseAccountErrorReason { + ASSOCIATE_ACCOUNT_API_ERROR, + GET_AD_SLOT_API_ERROR, + GET_BULK_ACCOUNT_STATUSES_API_ERROR, + RESEND_VERIFICATION_EMAIL_ERROR, + UNEXPECTED_API_RESPONSE_ERROR, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AudienceSegmentServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AudienceSegmentService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AudienceSegmentService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/AudienceSegmentService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AudienceSegmentPage getAudienceSegmentsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAudienceSegmentsByStatement", new object[] { filterStatement }); + return ((AudienceSegmentPage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AudienceSegment { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private AudienceSegmentStatus statusField; + + private bool statusFieldSpecified; + + private long sizeField; + + private bool sizeFieldSpecified; + + private string audienceSegmentTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public AudienceSegmentStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public long size { + get { return this.sizeField; } + set { + this.sizeField = value; + this.sizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sizeSpecified { + get { return this.sizeFieldSpecified; } + set { this.sizeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("AudienceSegment.Type")] + public string AudienceSegmentType { + get { return this.audienceSegmentTypeField; } + set { this.audienceSegmentTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegment.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum AudienceSegmentStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AudienceSegmentPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AudienceSegment[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AudienceSegment[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReportServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReportService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReportService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/ReportService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public string getReportDownloadURL(long reportJobId, ExportFormat exportFormat) { + object[] results = this.Invoke("getReportDownloadURL", new object[] { reportJobId, exportFormat }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public string getReportDownloadUrlWithOptions(long reportJobId, [System.Xml.Serialization.XmlIgnoreAttribute()] +bool reportJobIdSpecified, ReportDownloadOptions reportDownloadOptions) { + object[] results = this.Invoke("getReportDownloadUrlWithOptions", new object[] { reportJobId, reportJobIdSpecified, reportDownloadOptions }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ReportJob getReportJob(long reportJobId) { + object[] results = this.Invoke("getReportJob", new object[] { reportJobId }); + return ((ReportJob) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ReportJob runReportJob(ReportJob reportJob) { + object[] results = this.Invoke("runReportJob", new object[] { reportJob }); + return ((ReportJob) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ReportQuery { + private Dimension[] dimensionsField; + + private ReportQueryAdUnitView adUnitViewField; + + private bool adUnitViewFieldSpecified; + + private Column[] columnsField; + + private DimensionAttribute[] dimensionAttributesField; + + private long[] customFieldIdsField; + + private Date startDateField; + + private Date endDateField; + + private DateRangeType dateRangeTypeField; + + private bool dateRangeTypeFieldSpecified; + + private DimensionFilter[] dimensionFiltersField; + + private Statement statementField; + + [System.Xml.Serialization.XmlElementAttribute("dimensions")] + public Dimension[] dimensions { + get { return this.dimensionsField; } + set { this.dimensionsField = value; } + } + + public ReportQueryAdUnitView adUnitView { + get { return this.adUnitViewField; } + set { + this.adUnitViewField = value; + this.adUnitViewSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adUnitViewSpecified { + get { return this.adUnitViewFieldSpecified; } + set { this.adUnitViewFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("columns")] + public Column[] columns { + get { return this.columnsField; } + set { this.columnsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("dimensionAttributes")] + public DimensionAttribute[] dimensionAttributes { + get { return this.dimensionAttributesField; } + set { this.dimensionAttributesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldIds")] + public long[] customFieldIds { + get { return this.customFieldIdsField; } + set { this.customFieldIdsField = value; } + } + + public Date startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public Date endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + public DateRangeType dateRangeType { + get { return this.dateRangeTypeField; } + set { + this.dateRangeTypeField = value; + this.dateRangeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dateRangeTypeSpecified { + get { return this.dateRangeTypeFieldSpecified; } + set { this.dateRangeTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("dimensionFilters")] + public DimensionFilter[] dimensionFilters { + get { return this.dimensionFiltersField; } + set { this.dimensionFiltersField = value; } + } + + public Statement statement { + get { return this.statementField; } + set { this.statementField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum Dimension { + MONTH, + WEEK, + DATE, + DAY, + HOUR, + LINE_ITEM_ID, + LINE_ITEM_NAME, + LINE_ITEM, + LINE_ITEM_TYPE, + ORDER_ID, + ORDER_NAME, + ORDER, + ADVERTISER_ID, + ADVERTISER_NAME, + ADVERTISER, + SALESPERSON_ID, + SALESPERSON_NAME, + SALESPERSON, + CREATIVE_ID, + CREATIVE_NAME, + CREATIVE, + CREATIVE_TYPE, + CREATIVE_SIZE, + AD_UNIT_ID, + AD_UNIT_NAME, + AD_UNIT, + PLACEMENT_ID, + PLACEMENT_NAME, + PLACEMENT, + GENERIC_CRITERION_NAME, + COUNTRY_CRITERIA_ID, + COUNTRY_NAME, + REGION_CRITERIA_ID, + REGION_NAME, + CITY_CRITERIA_ID, + CITY_NAME, + METRO_CRITERIA_ID, + METRO_NAME, + POSTAL_CODE_CRITERIA_ID, + POSTAL_CODE, + CUSTOM_TARGETING_VALUE_ID, + CUSTOM_TARGETING, + ACTIVITY_ID, + ACTIVITY_NAME, + ACTIVITY, + ACTIVITY_GROUP_ID, + ACTIVITY_GROUP_NAME, + ACTIVITY_GROUP, + MASTER_COMPANION_CREATIVE_ID, + MASTER_COMPANION_CREATIVE_NAME + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportQuery.AdUnitView", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum ReportQueryAdUnitView { + TOP_LEVEL, + FLAT, + HIERARCHICAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum Column { + AD_SERVER_IMPRESSIONS, + AD_SERVER_CLICKS, + AD_SERVER_CTR, + AD_SERVER_CPM_AND_CPC_REVENUE, + AD_SERVER_AVERAGE_ECPM, + AD_SERVER_INVENTORY_LEVEL_PERCENT_IMPRESSIONS, + AD_SERVER_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + AD_SERVER_INVENTORY_LEVEL_PERCENT_CLICKS, + AD_SERVER_LINE_ITEM_LEVEL_PERCENT_CLICKS, + AD_SERVER_INVENTORY_LEVEL_PERCENT_REVENUE, + AD_SERVER_LINE_ITEM_LEVEL_PERCENT_REVENUE, + AD_SERVER_DELIVERY_INDICATOR, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + ADSENSE_LINE_ITEM_LEVEL_IMPRESSIONS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + ADSENSE_LINE_ITEM_LEVEL_CLICKS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CTR, + ADSENSE_LINE_ITEM_LEVEL_CTR, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_REVENUE, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_AVERAGE_ECPM, + ADSENSE_LINE_ITEM_LEVEL_AVERAGE_ECPM, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_PERCENT_IMPRESSIONS, + ADSENSE_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_PERCENT_CLICKS, + ADSENSE_LINE_ITEM_LEVEL_PERCENT_CLICKS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_PERCENT_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_IMPRESSIONS, + AD_EXCHANGE_LINE_ITEM_LEVEL_CLICKS, + AD_EXCHANGE_LINE_ITEM_LEVEL_CTR, + AD_EXCHANGE_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + AD_EXCHANGE_LINE_ITEM_LEVEL_PERCENT_CLICKS, + AD_EXCHANGE_LINE_ITEM_LEVEL_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_AVERAGE_ECPM, + TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + TOTAL_LINE_ITEM_LEVEL_IMPRESSIONS, + TOTAL_INVENTORY_LEVEL_CLICKS, + TOTAL_LINE_ITEM_LEVEL_CLICKS, + TOTAL_INVENTORY_LEVEL_CTR, + TOTAL_LINE_ITEM_LEVEL_CTR, + TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE, + TOTAL_LINE_ITEM_LEVEL_CPM_AND_CPC_REVENUE, + TOTAL_INVENTORY_LEVEL_AVERAGE_ECPM, + TOTAL_LINE_ITEM_LEVEL_AVERAGE_ECPM, + TOTAL_INVENTORY_LEVEL_UNFILLED_IMPRESSIONS, + MERGED_AD_SERVER_DELIVERY_INDICATOR, + MERGED_AD_SERVER_IMPRESSIONS, + MERGED_AD_SERVER_CLICKS, + MERGED_AD_SERVER_CTR, + MERGED_AD_SERVER_CPM_AND_CPC_REVENUE, + MERGED_AD_SERVER_AVERAGE_ECPM, + OPTIMIZATION_CONTROL_IMPRESSIONS, + OPTIMIZATION_CONTROL_CLICKS, + OPTIMIZATION_CONTROL_CTR, + OPTIMIZATION_OPTIMIZED_IMPRESSIONS, + OPTIMIZATION_OPTIMIZED_CLICKS, + OPTIMIZATION_NON_OPTIMIZED_IMPRESSIONS, + OPTIMIZATION_NON_OPTIMIZED_CLICKS, + OPTIMIZATION_EXTRA_CLICKS, + OPTIMIZATION_OPTIMIZED_CTR, + OPTIMIZATION_LIFT, + OPTIMIZATION_COVERAGE, + OPTIMIZATION_BEHIND_SCHEDULE_IMPRESSIONS, + OPTIMIZATION_NO_CLICKS_RECORDED_IMPRESSIONS, + OPTIMIZATION_SPONSORSHIP_IMPRESSIONS, + OPTIMIZATION_AS_FAST_AS_POSSIBLE_IMPRESSIONS, + OPTIMIZATION_NO_ABSOLUTE_LIFETIME_GOAL_IMPRESSIONS, + OPTIMIZATION_CONTROL_REVENUE, + OPTIMIZATION_OPTIMIZED_REVENUE, + OPTIMIZATION_CONTROL_ECPM, + OPTIMIZATION_OPTIMIZED_ECPM, + OPTIMIZATION_FREED_UP_IMPRESSIONS, + OPTIMIZATION_ECPM_LIFT, + REACH_FREQUENCY, + REACH_AVERAGE_REVENUE, + REACH, + RICH_MEDIA_BACKUP_IMAGES, + RICH_MEDIA_DISPLAY_TIME, + RICH_MEDIA_AVERAGE_DISPLAY_TIME, + RICH_MEDIA_EXPANSIONS, + RICH_MEDIA_EXPANDING_TIME, + RICH_MEDIA_INTERACTION_TIME, + RICH_MEDIA_INTERACTION_COUNT, + RICH_MEDIA_INTERACTION_RATE, + RICH_MEDIA_AVERAGE_INTERACTION_TIME, + RICH_MEDIA_INTERACTION_IMPRESSIONS, + RICH_MEDIA_MANUAL_CLOSES, + RICH_MEDIA_FULL_SCREEN_IMPRESSIONS, + RICH_MEDIA_VIDEO_INTERACTIONS, + RICH_MEDIA_VIDEO_INTERACTION_RATE, + RICH_MEDIA_VIDEO_MUTES, + RICH_MEDIA_VIDEO_PAUSES, + RICH_MEDIA_VIDEO_PLAYES, + RICH_MEDIA_VIDEO_MIDPOINTS, + RICH_MEDIA_VIDEO_COMPLETES, + RICH_MEDIA_VIDEO_REPLAYS, + RICH_MEDIA_VIDEO_STOPS, + RICH_MEDIA_VIDEO_UNMUTES, + RICH_MEDIA_VIDEO_VIEW_TIME, + RICH_MEDIA_VIDEO_VIEW_RATE, + RICH_MEDIA_CUSTOM_CONVERSION_TIME_VALUE, + RICH_MEDIA_CUSTOM_CONVERSION_COUNT_VALUE, + VIDEO_INTERACTION_START, + VIDEO_INTERACTION_FIRST_QUARTILE, + VIDEO_INTERACTION_MIDPOINT, + VIDEO_INTERACTION_THIRD_QUARTILE, + VIDEO_INTERACTION_COMPLETE, + VIDEO_INTERACTION_VIEW_RATE, + VIDEO_INTERACTION_AVERAGE_VIEW_RATE, + VIDEO_INTERACTION_COMPLETION_RATE, + VIDEO_INTERACTION_ERROR_COUNT, + VIDEO_INTERACTION_VIDEO_LENGTH, + VIDEO_INTERACTION_PAUSE, + VIDEO_INTERACTION_RESUME, + VIDEO_INTERACTION_REWIND, + VIDEO_INTERACTION_MUTE, + VIDEO_INTERACTION_UNMUTE, + VIDEO_INTERACTION_COLLAPSE, + VIDEO_INTERACTION_EXPAND, + VIDEO_INTERACTION_FULL_SCREEN, + VIDEO_INTERACTION_AVERAGE_INTERACTION_RATE, + VIDEO_INTERACTION_VIDEO_SKIPS, + VIDEO_INTERACTION_VIDEO_SKIP_SHOWN, + VIDEO_INTERACTION_ENGAGED_VIEW, + VIDEO_INTERACTION_VIEW_THROUGH_RATE, + VIEW_THROUGH_CONVERSIONS, + CONVERSIONS_PER_THOUSAND_IMPRESSIONS, + CLICK_THROUGH_CONVERSIONS, + CONVERSIONS_PER_CLICK, + VIEW_THROUGH_REVENUE, + CLICK_THROUGH_REVENUE, + TOTAL_CONVERSIONS, + TOTAL_CONVERSION_REVENUE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum DimensionAttribute { + LINE_ITEM_LABELS, + LINE_ITEM_LABEL_IDS, + ORDER_START_DATE_TIME, + ORDER_END_DATE_TIME, + ORDER_EXTERNAL_ID, + ORDER_PO_NUMBER, + ORDER_AGENCY, + ORDER_AGENCY_ID, + ORDER_LABELS, + ORDER_LABEL_IDS, + ORDER_TRAFFICKER, + ORDER_SECONDARY_TRAFFICKERS, + ORDER_SALESPERSON, + ORDER_SECONDARY_SALESPEOPLE, + ORDER_LIFETIME_IMPRESSIONS, + ORDER_LIFETIME_CLICKS, + ORDER_LIFETIME_MERGED_IMPRESSIONS, + ORDER_LIFETIME_MERGED_CLICKS, + LINE_ITEM_START_DATE_TIME, + LINE_ITEM_END_DATE_TIME, + LINE_ITEM_EXTERNAL_ID, + LINE_ITEM_COST_TYPE, + LINE_ITEM_COST_PER_UNIT, + LINE_ITEM_GOAL_QUANTITY, + LINE_ITEM_LIFETIME_IMPRESSIONS, + LINE_ITEM_LIFETIME_CLICKS, + LINE_ITEM_LIFETIME_MERGED_IMPRESSIONS, + LINE_ITEM_LIFETIME_MERGED_CLICKS, + CREATIVE_OR_CREATIVE_SET, + MASTER_COMPANION_TYPE, + LINE_ITEM_CONTRACTED_QUANTITY, + ADVERTISER_LABELS, + ADVERTISER_LABEL_IDS, + CREATIVE_CLICK_THROUGH_URL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum DateRangeType { + TODAY, + YESTERDAY, + LAST_WEEK, + LAST_MONTH, + CUSTOM_DATE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum DimensionFilter { + ADVERTISERS, + ACTIVE_ADVERTISERS, + HOUSE_ADVERTISERS, + NON_HOUSE_ADVERTISERS, + ALL_SALESPEOPLE, + WHOLE_NETWORK, + CURRENT_USER_ORDERS, + STARTED_ORDERS, + COMPLETED_ORDERS, + ACTIVE_AD_UNITS, + INACTIVE_AD_UNITS, + ARCHIVED_AD_UNITS, + ACTIVE_PLACEMENTS, + INACTIVE_PLACEMENTS, + ARCHIVED_PLACEMENTS, + OPTIMIZABLE_ORDERS + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ReportJob { + private long idField; + + private bool idFieldSpecified; + + private ReportQuery reportQueryField; + + private ReportJobStatus reportJobStatusField; + + private bool reportJobStatusFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public ReportQuery reportQuery { + get { return this.reportQueryField; } + set { this.reportQueryField = value; } + } + + public ReportJobStatus reportJobStatus { + get { return this.reportJobStatusField; } + set { + this.reportJobStatusField = value; + this.reportJobStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reportJobStatusSpecified { + get { return this.reportJobStatusFieldSpecified; } + set { this.reportJobStatusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum ReportJobStatus { + COMPLETED, + IN_PROGRESS, + FAILED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ReportDownloadOptions { + private ExportFormat exportFormatField; + + private bool exportFormatFieldSpecified; + + private bool includeReportPropertiesField; + + private bool includeReportPropertiesFieldSpecified; + + private bool includeTotalsRowField; + + private bool includeTotalsRowFieldSpecified; + + private bool useGzipCompressionField; + + private bool useGzipCompressionFieldSpecified; + + public ExportFormat exportFormat { + get { return this.exportFormatField; } + set { + this.exportFormatField = value; + this.exportFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool exportFormatSpecified { + get { return this.exportFormatFieldSpecified; } + set { this.exportFormatFieldSpecified = value; } + } + + public bool includeReportProperties { + get { return this.includeReportPropertiesField; } + set { + this.includeReportPropertiesField = value; + this.includeReportPropertiesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeReportPropertiesSpecified { + get { return this.includeReportPropertiesFieldSpecified; } + set { this.includeReportPropertiesFieldSpecified = value; } + } + + public bool includeTotalsRow { + get { return this.includeTotalsRowField; } + set { + this.includeTotalsRowField = value; + this.includeTotalsRowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeTotalsRowSpecified { + get { return this.includeTotalsRowFieldSpecified; } + set { this.includeTotalsRowFieldSpecified = value; } + } + + public bool useGzipCompression { + get { return this.useGzipCompressionField; } + set { + this.useGzipCompressionField = value; + this.useGzipCompressionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool useGzipCompressionSpecified { + get { return this.useGzipCompressionFieldSpecified; } + set { this.useGzipCompressionFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum ExportFormat { + TSV, + CSV_EXCEL, + CSV_DUMP, + XML, + XLS, + XLSX + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ReportError : ApiError { + private ReportErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReportErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum ReportErrorReason { + DEFAULT, + REPORT_ACCESS_NOT_ALLOWED, + DIMENSION_VIEW_NOT_ALLOWED, + DIMENSION_COMBINATION_NOT_ALLOWED, + ATTRIBUTE_VIEW_NOT_ALLOWED, + COLUMN_VIEW_NOT_ALLOWED, + TOO_MANY_CONCURRENT_REPORTS, + REPORT_TOO_BIG, + INVALID_OPERATION_FOR_REPORT_STATE, + INVALID_DIMENSIONS, + INVALID_ATTRIBUTES, + INVALID_COLUMNS, + INVALID_DIMENSION_FILTERS, + INVALID_DATE, + END_DATE_TIME_NOT_AFTER_START_TIME, + NOT_NULL, + ATTRIBUTES_NOT_SUPPORTED_FOR_REQUEST, + COLUMNS_NOT_SUPPORTED_FOR_REQUESTED_DIMENSIONS, + FAILED_TO_STORE_REPORT, + REPORT_NOT_FOUND, + SR_CANNOT_RUN_REPORT_IN_ANOTHER_NETWORK, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "SuggestedAdUnitServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class SuggestedAdUnitService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public SuggestedAdUnitService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/SuggestedAdUnitService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public SuggestedAdUnit getSuggestedAdUnit(string suggestedAdUnitId) { + object[] results = this.Invoke("getSuggestedAdUnit", new object[] { suggestedAdUnitId }); + return ((SuggestedAdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public SuggestedAdUnitPage getSuggestedAdUnitsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getSuggestedAdUnitsByStatement", new object[] { filterStatement }); + return ((SuggestedAdUnitPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public SuggestedAdUnitUpdateResult performSuggestedAdUnitAction(SuggestedAdUnitAction suggestedAdUnitAction, Statement filterStatement) { + object[] results = this.Invoke("performSuggestedAdUnitAction", new object[] { suggestedAdUnitAction, filterStatement }); + return ((SuggestedAdUnitUpdateResult) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class SuggestedAdUnitUpdateResult { + private string[] newAdUnitIdsField; + + private int numChangesField; + + private bool numChangesFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("newAdUnitIds")] + public string[] newAdUnitIds { + get { return this.newAdUnitIdsField; } + set { this.newAdUnitIdsField = value; } + } + + public int numChanges { + get { return this.numChangesField; } + set { + this.numChangesField = value; + this.numChangesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numChangesSpecified { + get { return this.numChangesFieldSpecified; } + set { this.numChangesFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveSuggestedAdUnit))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class SuggestedAdUnitAction { + private string suggestedAdUnitActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("SuggestedAdUnitAction.Type")] + public string SuggestedAdUnitActionType { + get { return this.suggestedAdUnitActionTypeField; } + set { this.suggestedAdUnitActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ApproveSuggestedAdUnit : SuggestedAdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class SuggestedAdUnitPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private SuggestedAdUnit[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public SuggestedAdUnit[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class SuggestedAdUnit { + private string idField; + + private long numRequestsField; + + private bool numRequestsFieldSpecified; + + private string[] pathField; + + private AdUnitParent[] parentPathField; + + private AdUnitTargetWindow targetWindowField; + + private bool targetWindowFieldSpecified; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private AdUnitSize[] suggestedAdUnitSizesField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public long numRequests { + get { return this.numRequestsField; } + set { + this.numRequestsField = value; + this.numRequestsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numRequestsSpecified { + get { return this.numRequestsFieldSpecified; } + set { this.numRequestsFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("path")] + public string[] path { + get { return this.pathField; } + set { this.pathField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("parentPath")] + public AdUnitParent[] parentPath { + get { return this.parentPathField; } + set { this.parentPathField = value; } + } + + public AdUnitTargetWindow targetWindow { + get { return this.targetWindowField; } + set { + this.targetWindowField = value; + this.targetWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetWindowSpecified { + get { return this.targetWindowFieldSpecified; } + set { this.targetWindowFieldSpecified = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("suggestedAdUnitSizes")] + public AdUnitSize[] suggestedAdUnitSizes { + get { return this.suggestedAdUnitSizesField; } + set { this.suggestedAdUnitSizesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AdUnitParent { + private string idField; + + private string nameField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnit.TargetWindow", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum AdUnitTargetWindow { + TOP, + BLANK + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum TargetPlatform { + WEB, + MOBILE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AdUnitSize { + private Size sizeField; + + private EnvironmentType environmentTypeField; + + private bool environmentTypeFieldSpecified; + + private AdUnitSize[] companionsField; + + private string fullDisplayStringField; + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + public EnvironmentType environmentType { + get { return this.environmentTypeField; } + set { + this.environmentTypeField = value; + this.environmentTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool environmentTypeSpecified { + get { return this.environmentTypeFieldSpecified; } + set { this.environmentTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companions")] + public AdUnitSize[] companions { + get { return this.companionsField; } + set { this.companionsField = value; } + } + + public string fullDisplayString { + get { return this.fullDisplayStringField; } + set { this.fullDisplayStringField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum EnvironmentType { + BROWSER, + VIDEO_PLAYER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "PublisherQueryLanguageServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class PublisherQueryLanguageService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public PublisherQueryLanguageService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/PublisherQueryLanguageService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ResultSet select(Statement selectStatement) { + object[] results = this.Invoke("select", new object[] { selectStatement }); + return ((ResultSet) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class Row { + private Value[] valuesField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("values")] + public Value[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ColumnType { + private string labelNameField; + + public string labelName { + get { return this.labelNameField; } + set { this.labelNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ResultSet { + private ColumnType[] columnTypesField; + + private Row[] rowsField; + + [System.Xml.Serialization.XmlElementAttribute("columnTypes")] + public ColumnType[] columnTypes { + get { return this.columnTypesField; } + set { this.columnTypesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("rows")] + public Row[] rows { + get { return this.rowsField; } + set { this.rowsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ReservationDetailsError : ApiError { + private ReservationDetailsErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReservationDetailsErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReservationDetailsError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum ReservationDetailsErrorReason { + UNLIMITED_UNITS_BOUGHT_NOT_ALLOWED, + UNLIMITED_END_DATE_TIME_NOT_ALLOWED, + PERCENTAGE_UNITS_BOUGHT_TOO_HIGH, + DURATION_NOT_ALLOWED, + UNIT_TYPE_NOT_ALLOWED, + COST_TYPE_NOT_ALLOWED, + COST_TYPE_UNIT_TYPE_MISMATCH_NOT_ALLOWED, + LINE_ITEM_TYPE_NOT_ALLOWED, + NETWORK_REMNANT_ORDER_CANNOT_UPDATE_LINEITEM_TYPE, + BACKFILL_WEBPROPERTY_CODE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class OrderError : ApiError { + private OrderErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OrderErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OrderError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum OrderErrorReason { + UPDATE_CANCELED_ORDER_NOT_ALLOWED, + UPDATE_PENDING_APPROVAL_ORDER_NOT_ALLOWED, + UPDATE_ARCHIVED_ORDER_NOT_ALLOWED, + CANNOT_MODIFY_PROPOSAL_ID, + PRIMARY_USER_REQUIRED, + PRIMARY_USER_CANNOT_BE_SECONDARY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class OrderActionError : ApiError { + private OrderActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OrderActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OrderActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum OrderActionErrorReason { + PERMISSION_DENIED, + NOT_APPLICABLE, + IS_ARCHIVED, + HAS_ENDED, + CANNOT_APPROVE_WITH_UNRESERVED_LINE_ITEMS, + CANNOT_DELETE_ORDER_WITH_DELIVERED_LINEITEMS, + CANNOT_APPROVE_COMPANY_CREDIT_STATUS_NOT_ACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class LineItemOperationError : ApiError { + private LineItemOperationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemOperationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemOperationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum LineItemOperationErrorReason { + NOT_ALLOWED, + NOT_APPLICABLE, + HAS_COMPLETED, + HAS_NO_ACTIVE_CREATIVES, + CANNOT_ACTIVATE_LEGACY_DFP_LINE_ITEM, + CANNOT_DELETE_DELIVERED_LINE_ITEM, + CANNOT_RESERVE_COMPANY_CREDIT_STATUS_NOT_ACTIVE, + CANNOT_ACTIVATE_INVALID_COMPANY_CREDIT_STATUS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class LineItemFlightDateError : ApiError { + private LineItemFlightDateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemFlightDateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemFlightDateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum LineItemFlightDateErrorReason { + START_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_NOT_AFTER_START_TIME, + END_DATE_TIME_TOO_LATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class InventoryUnitError : ApiError { + private InventoryUnitErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum InventoryUnitErrorReason { + EXPLICIT_TARGETING_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class InventoryTargetingError : ApiError { + private InventoryTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum InventoryTargetingErrorReason { + AT_LEAST_ONE_PLACEMENT_OR_INVENTORY_UNIT_REQUIRED, + INVENTORY_CANNOT_BE_TARGETED_AND_EXCLUDED, + PARENT_CONTAINS_INVALID_MIX_OF_TARGETED_AND_EXCLUDED_AD_UNITS, + INVENTORY_EXCLUSIONS_MUST_HAVE_PARENT_INVENTORY_UNIT, + INVENTORY_UNIT_CANNOT_BE_TARGETED_IF_ANCESTOR_IS_TARGETED, + INVENTORY_UNIT_CANNOT_BE_TARGETED_IF_ANCESTOR_IS_EXCLUDED, + INVENTORY_UNIT_CANNOT_BE_EXCLUDED_IF_ANCESTOR_IS_EXCLUDED, + EXPLICITLY_TARGETED_INVENTORY_UNIT_CANNOT_BE_TARGETED, + EXPLICITLY_TARGETED_INVENTORY_UNIT_CANNOT_BE_EXCLUDED, + SELF_ONLY_INVENTORY_UNIT_NOT_ALLOWED, + SELF_ONLY_INVENTORY_UNIT_WITHOUT_DESCENDANTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class InvalidEmailError : ApiError { + private InvalidEmailErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidEmailErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidEmailError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum InvalidEmailErrorReason { + INVALID_FORMAT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AdUnitHierarchyError : ApiError { + private AdUnitHierarchyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitHierarchyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitHierarchyError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum AdUnitHierarchyErrorReason { + INVALID_DEPTH, + INVALID_PARENT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AdUnitCodeError : ApiError { + private AdUnitCodeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitCodeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitCodeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum AdUnitCodeErrorReason { + INVALID_CHARACTERS, + INVALID_CHARACTERS_WHEN_UTF_CHARACTERS_ARE_ALLOWED, + LEADING_FORWARD_SLASH, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AdUnitAfcSizeError : ApiError { + private AdUnitAfcSizeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitAfcSizeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitAfcSizeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum AdUnitAfcSizeErrorReason { + INVALID, + DOESNT_FIT, + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "UserTeamAssociationServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserRecordTeamAssociation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class UserTeamAssociationService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public UserTeamAssociationService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/UserTeamAssociationService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UserTeamAssociation createUserTeamAssociation(UserTeamAssociation userTeamAssociation) { + object[] results = this.Invoke("createUserTeamAssociation", new object[] { userTeamAssociation }); + return ((UserTeamAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UserTeamAssociation[] createUserTeamAssociations([System.Xml.Serialization.XmlElementAttribute("userTeamAssociations")] +UserTeamAssociation[] userTeamAssociations) { + object[] results = this.Invoke("createUserTeamAssociations", new object[] { userTeamAssociations }); + return ((UserTeamAssociation[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UserTeamAssociation getUserTeamAssociation(long teamId, long userId) { + object[] results = this.Invoke("getUserTeamAssociation", new object[] { teamId, userId }); + return ((UserTeamAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UserTeamAssociationPage getUserTeamAssociationsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getUserTeamAssociationsByStatement", new object[] { filterStatement }); + return ((UserTeamAssociationPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performUserTeamAssociationAction(UserTeamAssociationAction userTeamAssociationAction, Statement statement) { + object[] results = this.Invoke("performUserTeamAssociationAction", new object[] { userTeamAssociationAction, statement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UserTeamAssociation updateUserTeamAssociation(UserTeamAssociation userTeamAssociation) { + object[] results = this.Invoke("updateUserTeamAssociation", new object[] { userTeamAssociation }); + return ((UserTeamAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UserTeamAssociation[] updateUserTeamAssociations([System.Xml.Serialization.XmlElementAttribute("userTeamAssociations")] +UserTeamAssociation[] userTeamAssociations) { + object[] results = this.Invoke("updateUserTeamAssociations", new object[] { userTeamAssociations }); + return ((UserTeamAssociation[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteUserTeamAssociations))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class UserTeamAssociationAction { + private string userTeamAssociationActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("UserTeamAssociationAction.Type")] + public string UserTeamAssociationActionType { + get { return this.userTeamAssociationActionTypeField; } + set { this.userTeamAssociationActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DeleteUserTeamAssociations : UserTeamAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class UserTeamAssociationPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private UserTeamAssociation[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public UserTeamAssociation[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class UserTeamAssociation : UserRecordTeamAssociation { + private long userIdField; + + private bool userIdFieldSpecified; + + public long userId { + get { return this.userIdField; } + set { + this.userIdField = value; + this.userIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userIdSpecified { + get { return this.userIdFieldSpecified; } + set { this.userIdFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserTeamAssociation))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class UserRecordTeamAssociation { + private long teamIdField; + + private bool teamIdFieldSpecified; + + private TeamAccessType overriddenTeamAccessTypeField; + + private bool overriddenTeamAccessTypeFieldSpecified; + + private TeamAccessType defaultTeamAccessTypeField; + + private bool defaultTeamAccessTypeFieldSpecified; + + private string userRecordTeamAssociationTypeField; + + public long teamId { + get { return this.teamIdField; } + set { + this.teamIdField = value; + this.teamIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool teamIdSpecified { + get { return this.teamIdFieldSpecified; } + set { this.teamIdFieldSpecified = value; } + } + + public TeamAccessType overriddenTeamAccessType { + get { return this.overriddenTeamAccessTypeField; } + set { + this.overriddenTeamAccessTypeField = value; + this.overriddenTeamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overriddenTeamAccessTypeSpecified { + get { return this.overriddenTeamAccessTypeFieldSpecified; } + set { this.overriddenTeamAccessTypeFieldSpecified = value; } + } + + public TeamAccessType defaultTeamAccessType { + get { return this.defaultTeamAccessTypeField; } + set { + this.defaultTeamAccessTypeField = value; + this.defaultTeamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool defaultTeamAccessTypeSpecified { + get { return this.defaultTeamAccessTypeFieldSpecified; } + set { this.defaultTeamAccessTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("UserRecordTeamAssociation.Type")] + public string UserRecordTeamAssociationType { + get { return this.userRecordTeamAssociationTypeField; } + set { this.userRecordTeamAssociationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ForecastServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ForecastService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ForecastService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/ForecastService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Forecast getForecast(LineItem lineItem) { + object[] results = this.Invoke("getForecast", new object[] { lineItem }); + return ((Forecast) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Forecast getForecastById(long lineItemId) { + object[] results = this.Invoke("getForecastById", new object[] { lineItemId }); + return ((Forecast) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class Forecast { + private long idField; + + private bool idFieldSpecified; + + private long orderIdField; + + private bool orderIdFieldSpecified; + + private UnitType unitTypeField; + + private bool unitTypeFieldSpecified; + + private long availableUnitsField; + + private bool availableUnitsFieldSpecified; + + private long deliveredUnitsField; + + private bool deliveredUnitsFieldSpecified; + + private long matchedUnitsField; + + private bool matchedUnitsFieldSpecified; + + private long possibleUnitsField; + + private bool possibleUnitsFieldSpecified; + + private long reservedUnitsField; + + private bool reservedUnitsFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public UnitType unitType { + get { return this.unitTypeField; } + set { + this.unitTypeField = value; + this.unitTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitTypeSpecified { + get { return this.unitTypeFieldSpecified; } + set { this.unitTypeFieldSpecified = value; } + } + + public long availableUnits { + get { return this.availableUnitsField; } + set { + this.availableUnitsField = value; + this.availableUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool availableUnitsSpecified { + get { return this.availableUnitsFieldSpecified; } + set { this.availableUnitsFieldSpecified = value; } + } + + public long deliveredUnits { + get { return this.deliveredUnitsField; } + set { + this.deliveredUnitsField = value; + this.deliveredUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveredUnitsSpecified { + get { return this.deliveredUnitsFieldSpecified; } + set { this.deliveredUnitsFieldSpecified = value; } + } + + public long matchedUnits { + get { return this.matchedUnitsField; } + set { + this.matchedUnitsField = value; + this.matchedUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool matchedUnitsSpecified { + get { return this.matchedUnitsFieldSpecified; } + set { this.matchedUnitsFieldSpecified = value; } + } + + public long possibleUnits { + get { return this.possibleUnitsField; } + set { + this.possibleUnitsField = value; + this.possibleUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool possibleUnitsSpecified { + get { return this.possibleUnitsFieldSpecified; } + set { this.possibleUnitsFieldSpecified = value; } + } + + public long reservedUnits { + get { return this.reservedUnitsField; } + set { + this.reservedUnitsField = value; + this.reservedUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reservedUnitsSpecified { + get { return this.reservedUnitsFieldSpecified; } + set { this.reservedUnitsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum UnitType { + IMPRESSIONS, + CLICKS + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class VideoPositionTargeting { + private VideoPositionTargetingType[] targetedVideoPositionsField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("targetedVideoPositions")] + public VideoPositionTargetingType[] targetedVideoPositions { + get { return this.targetedVideoPositionsField; } + set { this.targetedVideoPositionsField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum VideoPositionTargetingType { + PREROLL, + MIDROLL, + POSTROLL, + BEFORE_PREROLL_BUMPER, + AFTER_PREROLL_BUMPER, + BEFORE_MIDROLL_BUMPERS, + AFTER_MIDROLL_BUMPERS, + BEFORE_POSTROLL_BUMPER, + AFTER_POSTROLL_BUMPER, + FIRST_IN_PREROLL, + LAST_IN_PREROLL, + FIRST_IN_MIDROLL, + LAST_IN_MIDROLL, + FIRST_IN_POSTROLL, + LAST_IN_POSTROLL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ContentTargeting { + private long[] targetedContentIdsField; + + private long[] excludedContentIdsField; + + private long[] targetedVideoCategoryIdsField; + + private long[] excludedVideoCategoryIdsField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("targetedContentIds")] + public long[] targetedContentIds { + get { return this.targetedContentIdsField; } + set { this.targetedContentIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedContentIds")] + public long[] excludedContentIds { + get { return this.excludedContentIdsField; } + set { this.excludedContentIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedVideoCategoryIds")] + public long[] targetedVideoCategoryIds { + get { return this.targetedVideoCategoryIdsField; } + set { this.targetedVideoCategoryIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedVideoCategoryIds")] + public long[] excludedVideoCategoryIds { + get { return this.excludedVideoCategoryIdsField; } + set { this.excludedVideoCategoryIdsField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class UserDomainTargeting { + private string[] domainsField; + + private bool targetedField; + + private bool targetedFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("domains")] + public string[] domains { + get { return this.domainsField; } + set { this.domainsField = value; } + } + + public bool targeted { + get { return this.targetedField; } + set { + this.targetedField = value; + this.targetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetedSpecified { + get { return this.targetedFieldSpecified; } + set { this.targetedFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteriaLeaf))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceSegmentCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteriaSet))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class CustomCriteriaNode { + private string customCriteriaNodeTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomCriteriaNode.Type")] + public string CustomCriteriaNodeType { + get { return this.customCriteriaNodeTypeField; } + set { this.customCriteriaNodeTypeField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceSegmentCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteria))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class CustomCriteriaLeaf : CustomCriteriaNode { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AudienceSegmentCriteria : CustomCriteriaLeaf { + private AudienceSegmentCriteriaComparisonOperator operatorField; + + private bool operatorFieldSpecified; + + private long[] audienceSegmentIdsField; + + public AudienceSegmentCriteriaComparisonOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("audienceSegmentIds")] + public long[] audienceSegmentIds { + get { return this.audienceSegmentIdsField; } + set { this.audienceSegmentIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegmentCriteria.ComparisonOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum AudienceSegmentCriteriaComparisonOperator { + IS, + IS_NOT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CustomCriteria : CustomCriteriaLeaf { + private long keyIdField; + + private bool keyIdFieldSpecified; + + private long[] valueIdsField; + + private CustomCriteriaComparisonOperator operatorField; + + private bool operatorFieldSpecified; + + public long keyId { + get { return this.keyIdField; } + set { + this.keyIdField = value; + this.keyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keyIdSpecified { + get { return this.keyIdFieldSpecified; } + set { this.keyIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("valueIds")] + public long[] valueIds { + get { return this.valueIdsField; } + set { this.valueIdsField = value; } + } + + public CustomCriteriaComparisonOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCriteria.ComparisonOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CustomCriteriaComparisonOperator { + IS, + IS_NOT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CustomCriteriaSet : CustomCriteriaNode { + private CustomCriteriaSetLogicalOperator logicalOperatorField; + + private bool logicalOperatorFieldSpecified; + + private CustomCriteriaNode[] childrenField; + + public CustomCriteriaSetLogicalOperator logicalOperator { + get { return this.logicalOperatorField; } + set { + this.logicalOperatorField = value; + this.logicalOperatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool logicalOperatorSpecified { + get { return this.logicalOperatorFieldSpecified; } + set { this.logicalOperatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("children")] + public CustomCriteriaNode[] children { + get { return this.childrenField; } + set { this.childrenField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCriteriaSet.LogicalOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CustomCriteriaSetLogicalOperator { + AND, + OR + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class OperatingSystemVersionTargeting { + private Technology[] targetedOperatingSystemVersionsField; + + private Technology[] excludedOperatingSystemVersionsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedOperatingSystemVersions")] + public Technology[] targetedOperatingSystemVersions { + get { return this.targetedOperatingSystemVersionsField; } + set { this.targetedOperatingSystemVersionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedOperatingSystemVersions")] + public Technology[] excludedOperatingSystemVersions { + get { return this.excludedOperatingSystemVersionsField; } + set { this.excludedOperatingSystemVersionsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystemVersion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystem))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileDeviceSubmodel))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileDevice))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileCarrier))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceManufacturer))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceCategory))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceCapability))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BrowserLanguage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Browser))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BandwidthGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class Technology { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string technologyTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Technology.Type")] + public string TechnologyType { + get { return this.technologyTypeField; } + set { this.technologyTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class OperatingSystemVersion : Technology { + private int majorVersionField; + + private bool majorVersionFieldSpecified; + + private int minorVersionField; + + private bool minorVersionFieldSpecified; + + private int microVersionField; + + private bool microVersionFieldSpecified; + + public int majorVersion { + get { return this.majorVersionField; } + set { + this.majorVersionField = value; + this.majorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool majorVersionSpecified { + get { return this.majorVersionFieldSpecified; } + set { this.majorVersionFieldSpecified = value; } + } + + public int minorVersion { + get { return this.minorVersionField; } + set { + this.minorVersionField = value; + this.minorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minorVersionSpecified { + get { return this.minorVersionFieldSpecified; } + set { this.minorVersionFieldSpecified = value; } + } + + public int microVersion { + get { return this.microVersionField; } + set { + this.microVersionField = value; + this.microVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool microVersionSpecified { + get { return this.microVersionFieldSpecified; } + set { this.microVersionFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class OperatingSystem : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class MobileDeviceSubmodel : Technology { + private long mobileDeviceCriterionIdField; + + private bool mobileDeviceCriterionIdFieldSpecified; + + private long deviceManufacturerCriterionIdField; + + private bool deviceManufacturerCriterionIdFieldSpecified; + + public long mobileDeviceCriterionId { + get { return this.mobileDeviceCriterionIdField; } + set { + this.mobileDeviceCriterionIdField = value; + this.mobileDeviceCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mobileDeviceCriterionIdSpecified { + get { return this.mobileDeviceCriterionIdFieldSpecified; } + set { this.mobileDeviceCriterionIdFieldSpecified = value; } + } + + public long deviceManufacturerCriterionId { + get { return this.deviceManufacturerCriterionIdField; } + set { + this.deviceManufacturerCriterionIdField = value; + this.deviceManufacturerCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deviceManufacturerCriterionIdSpecified { + get { return this.deviceManufacturerCriterionIdFieldSpecified; } + set { this.deviceManufacturerCriterionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class MobileDevice : Technology { + private long manufacturerCriterionIdField; + + private bool manufacturerCriterionIdFieldSpecified; + + public long manufacturerCriterionId { + get { return this.manufacturerCriterionIdField; } + set { + this.manufacturerCriterionIdField = value; + this.manufacturerCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manufacturerCriterionIdSpecified { + get { return this.manufacturerCriterionIdFieldSpecified; } + set { this.manufacturerCriterionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class MobileCarrier : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DeviceManufacturer : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DeviceCategory : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DeviceCapability : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class BrowserLanguage : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class Browser : Technology { + private string majorVersionField; + + private string minorVersionField; + + public string majorVersion { + get { return this.majorVersionField; } + set { this.majorVersionField = value; } + } + + public string minorVersion { + get { return this.minorVersionField; } + set { this.minorVersionField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class BandwidthGroup : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class OperatingSystemTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] operatingSystemsField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("operatingSystems")] + public Technology[] operatingSystems { + get { return this.operatingSystemsField; } + set { this.operatingSystemsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class MobileDeviceSubmodelTargeting { + private Technology[] targetedMobileDeviceSubmodelsField; + + private Technology[] excludedMobileDeviceSubmodelsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedMobileDeviceSubmodels")] + public Technology[] targetedMobileDeviceSubmodels { + get { return this.targetedMobileDeviceSubmodelsField; } + set { this.targetedMobileDeviceSubmodelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedMobileDeviceSubmodels")] + public Technology[] excludedMobileDeviceSubmodels { + get { return this.excludedMobileDeviceSubmodelsField; } + set { this.excludedMobileDeviceSubmodelsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class MobileDeviceTargeting { + private Technology[] targetedMobileDevicesField; + + private Technology[] excludedMobileDevicesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedMobileDevices")] + public Technology[] targetedMobileDevices { + get { return this.targetedMobileDevicesField; } + set { this.targetedMobileDevicesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedMobileDevices")] + public Technology[] excludedMobileDevices { + get { return this.excludedMobileDevicesField; } + set { this.excludedMobileDevicesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class MobileCarrierTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] mobileCarriersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("mobileCarriers")] + public Technology[] mobileCarriers { + get { return this.mobileCarriersField; } + set { this.mobileCarriersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DeviceManufacturerTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] deviceManufacturersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deviceManufacturers")] + public Technology[] deviceManufacturers { + get { return this.deviceManufacturersField; } + set { this.deviceManufacturersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DeviceCategoryTargeting { + private Technology[] targetedDeviceCategoriesField; + + private Technology[] excludedDeviceCategoriesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedDeviceCategories")] + public Technology[] targetedDeviceCategories { + get { return this.targetedDeviceCategoriesField; } + set { this.targetedDeviceCategoriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedDeviceCategories")] + public Technology[] excludedDeviceCategories { + get { return this.excludedDeviceCategoriesField; } + set { this.excludedDeviceCategoriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DeviceCapabilityTargeting { + private Technology[] targetedDeviceCapabilitiesField; + + private Technology[] excludedDeviceCapabilitiesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedDeviceCapabilities")] + public Technology[] targetedDeviceCapabilities { + get { return this.targetedDeviceCapabilitiesField; } + set { this.targetedDeviceCapabilitiesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedDeviceCapabilities")] + public Technology[] excludedDeviceCapabilities { + get { return this.excludedDeviceCapabilitiesField; } + set { this.excludedDeviceCapabilitiesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class BrowserLanguageTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] browserLanguagesField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("browserLanguages")] + public Technology[] browserLanguages { + get { return this.browserLanguagesField; } + set { this.browserLanguagesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class BrowserTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] browsersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("browsers")] + public Technology[] browsers { + get { return this.browsersField; } + set { this.browsersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class BandwidthGroupTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] bandwidthGroupsField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("bandwidthGroups")] + public Technology[] bandwidthGroups { + get { return this.bandwidthGroupsField; } + set { this.bandwidthGroupsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class TechnologyTargeting { + private BandwidthGroupTargeting bandwidthGroupTargetingField; + + private BrowserTargeting browserTargetingField; + + private BrowserLanguageTargeting browserLanguageTargetingField; + + private DeviceCapabilityTargeting deviceCapabilityTargetingField; + + private DeviceCategoryTargeting deviceCategoryTargetingField; + + private DeviceManufacturerTargeting deviceManufacturerTargetingField; + + private MobileCarrierTargeting mobileCarrierTargetingField; + + private MobileDeviceTargeting mobileDeviceTargetingField; + + private MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargetingField; + + private OperatingSystemTargeting operatingSystemTargetingField; + + private OperatingSystemVersionTargeting operatingSystemVersionTargetingField; + + public BandwidthGroupTargeting bandwidthGroupTargeting { + get { return this.bandwidthGroupTargetingField; } + set { this.bandwidthGroupTargetingField = value; } + } + + public BrowserTargeting browserTargeting { + get { return this.browserTargetingField; } + set { this.browserTargetingField = value; } + } + + public BrowserLanguageTargeting browserLanguageTargeting { + get { return this.browserLanguageTargetingField; } + set { this.browserLanguageTargetingField = value; } + } + + public DeviceCapabilityTargeting deviceCapabilityTargeting { + get { return this.deviceCapabilityTargetingField; } + set { this.deviceCapabilityTargetingField = value; } + } + + public DeviceCategoryTargeting deviceCategoryTargeting { + get { return this.deviceCategoryTargetingField; } + set { this.deviceCategoryTargetingField = value; } + } + + public DeviceManufacturerTargeting deviceManufacturerTargeting { + get { return this.deviceManufacturerTargetingField; } + set { this.deviceManufacturerTargetingField = value; } + } + + public MobileCarrierTargeting mobileCarrierTargeting { + get { return this.mobileCarrierTargetingField; } + set { this.mobileCarrierTargetingField = value; } + } + + public MobileDeviceTargeting mobileDeviceTargeting { + get { return this.mobileDeviceTargetingField; } + set { this.mobileDeviceTargetingField = value; } + } + + public MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargeting { + get { return this.mobileDeviceSubmodelTargetingField; } + set { this.mobileDeviceSubmodelTargetingField = value; } + } + + public OperatingSystemTargeting operatingSystemTargeting { + get { return this.operatingSystemTargetingField; } + set { this.operatingSystemTargetingField = value; } + } + + public OperatingSystemVersionTargeting operatingSystemVersionTargeting { + get { return this.operatingSystemVersionTargetingField; } + set { this.operatingSystemVersionTargetingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class TimeOfDay { + private int hourField; + + private bool hourFieldSpecified; + + private MinuteOfHour minuteField; + + private bool minuteFieldSpecified; + + public int hour { + get { return this.hourField; } + set { + this.hourField = value; + this.hourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hourSpecified { + get { return this.hourFieldSpecified; } + set { this.hourFieldSpecified = value; } + } + + public MinuteOfHour minute { + get { return this.minuteField; } + set { + this.minuteField = value; + this.minuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minuteSpecified { + get { return this.minuteFieldSpecified; } + set { this.minuteFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum MinuteOfHour { + ZERO, + FIFTEEN, + THIRTY, + FORTY_FIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DayPart { + private DayOfWeek dayOfWeekField; + + private bool dayOfWeekFieldSpecified; + + private TimeOfDay startTimeField; + + private TimeOfDay endTimeField; + + public DayOfWeek dayOfWeek { + get { return this.dayOfWeekField; } + set { + this.dayOfWeekField = value; + this.dayOfWeekSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dayOfWeekSpecified { + get { return this.dayOfWeekFieldSpecified; } + set { this.dayOfWeekFieldSpecified = value; } + } + + public TimeOfDay startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public TimeOfDay endTime { + get { return this.endTimeField; } + set { this.endTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum DayOfWeek { + MONDAY, + TUESDAY, + WEDNESDAY, + THURSDAY, + FRIDAY, + SATURDAY, + SUNDAY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DayPartTargeting { + private DayPart[] dayPartsField; + + private DeliveryTimeZone timeZoneField; + + private bool timeZoneFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("dayParts")] + public DayPart[] dayParts { + get { return this.dayPartsField; } + set { this.dayPartsField = value; } + } + + public DeliveryTimeZone timeZone { + get { return this.timeZoneField; } + set { + this.timeZoneField = value; + this.timeZoneSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool timeZoneSpecified { + get { return this.timeZoneFieldSpecified; } + set { this.timeZoneFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum DeliveryTimeZone { + PUBLISHER, + BROWSER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AdUnitTargeting { + private string adUnitIdField; + + private bool includeDescendantsField; + + private bool includeDescendantsFieldSpecified; + + public string adUnitId { + get { return this.adUnitIdField; } + set { this.adUnitIdField = value; } + } + + public bool includeDescendants { + get { return this.includeDescendantsField; } + set { + this.includeDescendantsField = value; + this.includeDescendantsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeDescendantsSpecified { + get { return this.includeDescendantsFieldSpecified; } + set { this.includeDescendantsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class InventoryTargeting { + private AdUnitTargeting[] targetedAdUnitsField; + + private AdUnitTargeting[] excludedAdUnitsField; + + private long[] targetedPlacementIdsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedAdUnits")] + public AdUnitTargeting[] targetedAdUnits { + get { return this.targetedAdUnitsField; } + set { this.targetedAdUnitsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedAdUnits")] + public AdUnitTargeting[] excludedAdUnits { + get { return this.excludedAdUnitsField; } + set { this.excludedAdUnitsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedPlacementIds")] + public long[] targetedPlacementIds { + get { return this.targetedPlacementIdsField; } + set { this.targetedPlacementIdsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RegionLocation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PostalCodeLocation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MetroLocation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CountryLocation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CityLocation))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class Location { + private long idField; + + private bool idFieldSpecified; + + private string locationTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Location.Type")] + public string LocationType { + get { return this.locationTypeField; } + set { this.locationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class RegionLocation : Location { + private string regionCodeField; + + public string regionCode { + get { return this.regionCodeField; } + set { this.regionCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class PostalCodeLocation : Location { + private string postalCodeField; + + private string countryCodeField; + + public string postalCode { + get { return this.postalCodeField; } + set { this.postalCodeField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class MetroLocation : Location { + private string metroCodeField; + + private string countryCodeField; + + public string metroCode { + get { return this.metroCodeField; } + set { this.metroCodeField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CountryLocation : Location { + private string countryCodeField; + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CityLocation : Location { + private string cityNameField; + + private string regionCodeField; + + private string countryCodeField; + + public string cityName { + get { return this.cityNameField; } + set { this.cityNameField = value; } + } + + public string regionCode { + get { return this.regionCodeField; } + set { this.regionCodeField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class GeoTargeting { + private Location[] targetedLocationsField; + + private Location[] excludedLocationsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedLocations")] + public Location[] targetedLocations { + get { return this.targetedLocationsField; } + set { this.targetedLocationsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedLocations")] + public Location[] excludedLocations { + get { return this.excludedLocationsField; } + set { this.excludedLocationsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class Targeting { + private GeoTargeting geoTargetingField; + + private InventoryTargeting inventoryTargetingField; + + private DayPartTargeting dayPartTargetingField; + + private TechnologyTargeting technologyTargetingField; + + private CustomCriteriaSet customTargetingField; + + private UserDomainTargeting userDomainTargetingField; + + private ContentTargeting contentTargetingField; + + private VideoPositionTargeting videoPositionTargetingField; + + public GeoTargeting geoTargeting { + get { return this.geoTargetingField; } + set { this.geoTargetingField = value; } + } + + public InventoryTargeting inventoryTargeting { + get { return this.inventoryTargetingField; } + set { this.inventoryTargetingField = value; } + } + + public DayPartTargeting dayPartTargeting { + get { return this.dayPartTargetingField; } + set { this.dayPartTargetingField = value; } + } + + public TechnologyTargeting technologyTargeting { + get { return this.technologyTargetingField; } + set { this.technologyTargetingField = value; } + } + + public CustomCriteriaSet customTargeting { + get { return this.customTargetingField; } + set { this.customTargetingField = value; } + } + + public UserDomainTargeting userDomainTargeting { + get { return this.userDomainTargetingField; } + set { this.userDomainTargetingField = value; } + } + + public ContentTargeting contentTargeting { + get { return this.contentTargetingField; } + set { this.contentTargetingField = value; } + } + + public VideoPositionTargeting videoPositionTargeting { + get { return this.videoPositionTargetingField; } + set { this.videoPositionTargetingField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DropDownCustomFieldValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class BaseCustomFieldValue { + private long customFieldIdField; + + private bool customFieldIdFieldSpecified; + + private string baseCustomFieldValueTypeField; + + public long customFieldId { + get { return this.customFieldIdField; } + set { + this.customFieldIdField = value; + this.customFieldIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldIdSpecified { + get { return this.customFieldIdFieldSpecified; } + set { this.customFieldIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseCustomFieldValue.Type")] + public string BaseCustomFieldValueType { + get { return this.baseCustomFieldValueTypeField; } + set { this.baseCustomFieldValueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DropDownCustomFieldValue : BaseCustomFieldValue { + private long customFieldOptionIdField; + + private bool customFieldOptionIdFieldSpecified; + + public long customFieldOptionId { + get { return this.customFieldOptionIdField; } + set { + this.customFieldOptionIdField = value; + this.customFieldOptionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldOptionIdSpecified { + get { return this.customFieldOptionIdFieldSpecified; } + set { this.customFieldOptionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CustomFieldValue : BaseCustomFieldValue { + private Value valueField; + + public Value value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DeliveryIndicator { + private double expectedDeliveryPercentageField; + + private bool expectedDeliveryPercentageFieldSpecified; + + private double actualDeliveryPercentageField; + + private bool actualDeliveryPercentageFieldSpecified; + + public double expectedDeliveryPercentage { + get { return this.expectedDeliveryPercentageField; } + set { + this.expectedDeliveryPercentageField = value; + this.expectedDeliveryPercentageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expectedDeliveryPercentageSpecified { + get { return this.expectedDeliveryPercentageFieldSpecified; } + set { this.expectedDeliveryPercentageFieldSpecified = value; } + } + + public double actualDeliveryPercentage { + get { return this.actualDeliveryPercentageField; } + set { + this.actualDeliveryPercentageField = value; + this.actualDeliveryPercentageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool actualDeliveryPercentageSpecified { + get { return this.actualDeliveryPercentageFieldSpecified; } + set { this.actualDeliveryPercentageFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AppliedLabel { + private long labelIdField; + + private bool labelIdFieldSpecified; + + private bool isNegatedField; + + private bool isNegatedFieldSpecified; + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + + public bool isNegated { + get { return this.isNegatedField; } + set { + this.isNegatedField = value; + this.isNegatedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isNegatedSpecified { + get { return this.isNegatedFieldSpecified; } + set { this.isNegatedFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CreativePlaceholder { + private Size sizeField; + + private CreativePlaceholder[] companionsField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private long idField; + + private bool idFieldSpecified; + + private int expectedCreativeCountField; + + private bool expectedCreativeCountFieldSpecified; + + private CreativeSizeType creativeSizeTypeField; + + private bool creativeSizeTypeFieldSpecified; + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companions")] + public CreativePlaceholder[] companions { + get { return this.companionsField; } + set { this.companionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public int expectedCreativeCount { + get { return this.expectedCreativeCountField; } + set { + this.expectedCreativeCountField = value; + this.expectedCreativeCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expectedCreativeCountSpecified { + get { return this.expectedCreativeCountFieldSpecified; } + set { this.expectedCreativeCountFieldSpecified = value; } + } + + public CreativeSizeType creativeSizeType { + get { return this.creativeSizeTypeField; } + set { + this.creativeSizeTypeField = value; + this.creativeSizeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeSizeTypeSpecified { + get { return this.creativeSizeTypeFieldSpecified; } + set { this.creativeSizeTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CreativeSizeType { + PIXEL, + ASPECT_RATIO, + INTERSTITIAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class FrequencyCap { + private int maxImpressionsField; + + private bool maxImpressionsFieldSpecified; + + private int numTimeUnitsField; + + private bool numTimeUnitsFieldSpecified; + + private TimeUnit timeUnitField; + + private bool timeUnitFieldSpecified; + + public int maxImpressions { + get { return this.maxImpressionsField; } + set { + this.maxImpressionsField = value; + this.maxImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxImpressionsSpecified { + get { return this.maxImpressionsFieldSpecified; } + set { this.maxImpressionsFieldSpecified = value; } + } + + public int numTimeUnits { + get { return this.numTimeUnitsField; } + set { + this.numTimeUnitsField = value; + this.numTimeUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numTimeUnitsSpecified { + get { return this.numTimeUnitsFieldSpecified; } + set { this.numTimeUnitsFieldSpecified = value; } + } + + public TimeUnit timeUnit { + get { return this.timeUnitField; } + set { + this.timeUnitField = value; + this.timeUnitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool timeUnitSpecified { + get { return this.timeUnitFieldSpecified; } + set { this.timeUnitFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum TimeUnit { + MINUTE, + HOUR, + DAY, + WEEK, + MONTH, + LIFETIME, + POD, + STREAM + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItem))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class LineItemSummary { + private long orderIdField; + + private bool orderIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string externalIdField; + + private string orderNameField; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private int autoExtensionDaysField; + + private bool autoExtensionDaysFieldSpecified; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private CreativeRotationType creativeRotationTypeField; + + private bool creativeRotationTypeFieldSpecified; + + private DeliveryRateType deliveryRateTypeField; + + private bool deliveryRateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int priorityField; + + private bool priorityFieldSpecified; + + private UnitType unitTypeField; + + private bool unitTypeFieldSpecified; + + private LineItemSummaryDuration durationField; + + private bool durationFieldSpecified; + + private long unitsBoughtField; + + private bool unitsBoughtFieldSpecified; + + private Money costPerUnitField; + + private Money valueCostPerUnitField; + + private CostType costTypeField; + + private bool costTypeFieldSpecified; + + private LineItemDiscountType discountTypeField; + + private bool discountTypeFieldSpecified; + + private double discountField; + + private bool discountFieldSpecified; + + private long contractedUnitsBoughtField; + + private bool contractedUnitsBoughtFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private EnvironmentType environmentTypeField; + + private bool environmentTypeFieldSpecified; + + private CompanionDeliveryOption companionDeliveryOptionField; + + private bool companionDeliveryOptionFieldSpecified; + + private CreativePersistenceType creativePersistenceTypeField; + + private bool creativePersistenceTypeFieldSpecified; + + private bool allowOverbookField; + + private bool allowOverbookFieldSpecified; + + private bool reserveAtCreationField; + + private bool reserveAtCreationFieldSpecified; + + private Stats statsField; + + private DeliveryIndicator deliveryIndicatorField; + + private long[] deliveryDataField; + + private Money budgetField; + + private ComputedStatus statusField; + + private bool statusFieldSpecified; + + private LineItemSummaryReservationStatus reservationStatusField; + + private bool reservationStatusFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private string webPropertyCodeField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private bool disableSameAdvertiserCompetitiveExclusionField; + + private bool disableSameAdvertiserCompetitiveExclusionFieldSpecified; + + private string lastModifiedByAppField; + + private string notesField; + + private DateTime lastModifiedDateTimeField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private string lineItemSummaryTypeField; + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string externalId { + get { return this.externalIdField; } + set { this.externalIdField = value; } + } + + public string orderName { + get { return this.orderNameField; } + set { this.orderNameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public int autoExtensionDays { + get { return this.autoExtensionDaysField; } + set { + this.autoExtensionDaysField = value; + this.autoExtensionDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool autoExtensionDaysSpecified { + get { return this.autoExtensionDaysFieldSpecified; } + set { this.autoExtensionDaysFieldSpecified = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public CreativeRotationType creativeRotationType { + get { return this.creativeRotationTypeField; } + set { + this.creativeRotationTypeField = value; + this.creativeRotationTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeRotationTypeSpecified { + get { return this.creativeRotationTypeFieldSpecified; } + set { this.creativeRotationTypeFieldSpecified = value; } + } + + public DeliveryRateType deliveryRateType { + get { return this.deliveryRateTypeField; } + set { + this.deliveryRateTypeField = value; + this.deliveryRateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryRateTypeSpecified { + get { return this.deliveryRateTypeFieldSpecified; } + set { this.deliveryRateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + public UnitType unitType { + get { return this.unitTypeField; } + set { + this.unitTypeField = value; + this.unitTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitTypeSpecified { + get { return this.unitTypeFieldSpecified; } + set { this.unitTypeFieldSpecified = value; } + } + + public LineItemSummaryDuration duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public long unitsBought { + get { return this.unitsBoughtField; } + set { + this.unitsBoughtField = value; + this.unitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitsBoughtSpecified { + get { return this.unitsBoughtFieldSpecified; } + set { this.unitsBoughtFieldSpecified = value; } + } + + public Money costPerUnit { + get { return this.costPerUnitField; } + set { this.costPerUnitField = value; } + } + + public Money valueCostPerUnit { + get { return this.valueCostPerUnitField; } + set { this.valueCostPerUnitField = value; } + } + + public CostType costType { + get { return this.costTypeField; } + set { + this.costTypeField = value; + this.costTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool costTypeSpecified { + get { return this.costTypeFieldSpecified; } + set { this.costTypeFieldSpecified = value; } + } + + public LineItemDiscountType discountType { + get { return this.discountTypeField; } + set { + this.discountTypeField = value; + this.discountTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool discountTypeSpecified { + get { return this.discountTypeFieldSpecified; } + set { this.discountTypeFieldSpecified = value; } + } + + public double discount { + get { return this.discountField; } + set { + this.discountField = value; + this.discountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool discountSpecified { + get { return this.discountFieldSpecified; } + set { this.discountFieldSpecified = value; } + } + + public long contractedUnitsBought { + get { return this.contractedUnitsBoughtField; } + set { + this.contractedUnitsBoughtField = value; + this.contractedUnitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contractedUnitsBoughtSpecified { + get { return this.contractedUnitsBoughtFieldSpecified; } + set { this.contractedUnitsBoughtFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + public EnvironmentType environmentType { + get { return this.environmentTypeField; } + set { + this.environmentTypeField = value; + this.environmentTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool environmentTypeSpecified { + get { return this.environmentTypeFieldSpecified; } + set { this.environmentTypeFieldSpecified = value; } + } + + public CompanionDeliveryOption companionDeliveryOption { + get { return this.companionDeliveryOptionField; } + set { + this.companionDeliveryOptionField = value; + this.companionDeliveryOptionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companionDeliveryOptionSpecified { + get { return this.companionDeliveryOptionFieldSpecified; } + set { this.companionDeliveryOptionFieldSpecified = value; } + } + + public CreativePersistenceType creativePersistenceType { + get { return this.creativePersistenceTypeField; } + set { + this.creativePersistenceTypeField = value; + this.creativePersistenceTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativePersistenceTypeSpecified { + get { return this.creativePersistenceTypeFieldSpecified; } + set { this.creativePersistenceTypeFieldSpecified = value; } + } + + public bool allowOverbook { + get { return this.allowOverbookField; } + set { + this.allowOverbookField = value; + this.allowOverbookSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowOverbookSpecified { + get { return this.allowOverbookFieldSpecified; } + set { this.allowOverbookFieldSpecified = value; } + } + + public bool reserveAtCreation { + get { return this.reserveAtCreationField; } + set { + this.reserveAtCreationField = value; + this.reserveAtCreationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reserveAtCreationSpecified { + get { return this.reserveAtCreationFieldSpecified; } + set { this.reserveAtCreationFieldSpecified = value; } + } + + public Stats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public DeliveryIndicator deliveryIndicator { + get { return this.deliveryIndicatorField; } + set { this.deliveryIndicatorField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("units", IsNullable = false)] + public long[] deliveryData { + get { return this.deliveryDataField; } + set { this.deliveryDataField = value; } + } + + public Money budget { + get { return this.budgetField; } + set { this.budgetField = value; } + } + + public ComputedStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public LineItemSummaryReservationStatus reservationStatus { + get { return this.reservationStatusField; } + set { + this.reservationStatusField = value; + this.reservationStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reservationStatusSpecified { + get { return this.reservationStatusFieldSpecified; } + set { this.reservationStatusFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public string webPropertyCode { + get { return this.webPropertyCodeField; } + set { this.webPropertyCodeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public bool disableSameAdvertiserCompetitiveExclusion { + get { return this.disableSameAdvertiserCompetitiveExclusionField; } + set { + this.disableSameAdvertiserCompetitiveExclusionField = value; + this.disableSameAdvertiserCompetitiveExclusionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool disableSameAdvertiserCompetitiveExclusionSpecified { + get { return this.disableSameAdvertiserCompetitiveExclusionFieldSpecified; } + set { this.disableSameAdvertiserCompetitiveExclusionFieldSpecified = value; } + } + + public string lastModifiedByApp { + get { return this.lastModifiedByAppField; } + set { this.lastModifiedByAppField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("LineItemSummary.Type")] + public string LineItemSummaryType { + get { return this.lineItemSummaryTypeField; } + set { this.lineItemSummaryTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CreativeRotationType { + EVEN, + OPTIMIZED, + MANUAL, + SEQUENTIAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum DeliveryRateType { + EVENLY, + FRONTLOADED, + AS_FAST_AS_POSSIBLE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum RoadblockingType { + ONLY_ONE, + ONE_OR_MORE, + AS_MANY_AS_POSSIBLE, + ALL_ROADBLOCK, + CREATIVE_SET + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum LineItemType { + SPONSORSHIP, + STANDARD, + NETWORK, + BULK, + PRICE_PRIORITY, + HOUSE, + LEGACY_DFP, + CLICK_TRACKING, + ADSENSE, + AD_EXCHANGE, + BUMPER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemSummary.Duration", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum LineItemSummaryDuration { + NONE, + LIFETIME, + DAILY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CostType { + CPC, + CPD, + CPM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum LineItemDiscountType { + ABSOLUTE_VALUE, + PERCENTAGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CompanionDeliveryOption { + OPTIONAL, + AT_LEAST_ONE, + ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CreativePersistenceType { + NOT_PERSISTENT, + PERSISTENT_AND_EXCLUDE_NONE, + PERSISTENT_AND_EXCLUDE_DISPLAY, + PERSISTENT_AND_EXCLUDE_VIDEO, + PERSISTENT_AND_EXCLUDE_ALL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum ComputedStatus { + DELIVERY_EXTENDED, + DELIVERING, + READY, + PAUSED, + NEEDS_CREATIVES, + PAUSED_INVENTORY_RELEASED, + PENDING_APPROVAL, + COMPLETED, + DISAPPROVED, + DRAFT, + CANCELED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemSummary.ReservationStatus", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum LineItemSummaryReservationStatus { + RESERVED, + UNRESERVED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class LineItem : LineItemSummary { + private Targeting targetingField; + + public Targeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class UserDomainTargetingError : ApiError { + private UserDomainTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public UserDomainTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "UserDomainTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum UserDomainTargetingErrorReason { + INVALID_DOMAIN_NAMES, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class TechnologyTargetingError : ApiError { + private TechnologyTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TechnologyTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TechnologyTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum TechnologyTargetingErrorReason { + MOBILE_LINE_ITEM_CONTAINS_WEB_TECH_CRITERIA, + WEB_LINE_ITEM_CONTAINS_MOBILE_TECH_CRITERIA, + MOBILE_CARRIER_TARGETING_FEATURE_NOT_ENABLED, + DEVICE_CAPABILITY_TARGETING_FEATURE_NOT_ENABLED, + DEVICE_CATEGORY_TARGETING_FEATURE_NOT_ENABLED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class GeoTargetingError : ApiError { + private GeoTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public GeoTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GeoTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum GeoTargetingErrorReason { + TARGETED_LOCATIONS_NOT_EXCLUDABLE, + EXCLUDED_LOCATIONS_CANNOT_HAVE_CHILDREN_TARGETED, + POSTAL_CODES_CANNOT_BE_EXCLUDED, + UNTARGETABLE_LOCATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class GenericTargetingError : ApiError { + private GenericTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public GenericTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GenericTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum GenericTargetingErrorReason { + CONFLICTING_INCLUSION_OR_EXCLUSION_OF_SIBLINGS, + INCLUDING_DESCENDANTS_OF_EXCLUDED_CRITERIA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class FrequencyCapError : ApiError { + private FrequencyCapErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FrequencyCapErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FrequencyCapError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum FrequencyCapErrorReason { + IMPRESSION_LIMIT_EXCEEDED, + IMPRESSIONS_TOO_LOW, + RANGE_LIMIT_EXCEEDED, + RANGE_TOO_LOW, + DUPLICATE_TIME_RANGE, + TOO_MANY_FREQUENCY_CAPS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ForecastError : ApiError { + private ForecastErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ForecastErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ForecastError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum ForecastErrorReason { + SERVER_NOT_AVAILABLE, + INTERNAL_ERROR, + NO_FORECAST_YET, + NOT_ENOUGH_INVENTORY, + SUCCESS, + ZERO_LENGTH_RESERVATION, + EXCEEDED_QUOTA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DayPartTargetingError : ApiError { + private DayPartTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DayPartTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DayPartTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum DayPartTargetingErrorReason { + INVALID_HOUR, + INVALID_MINUTE, + END_TIME_NOT_AFTER_START_TIME, + TIME_PERIODS_OVERLAP, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DateTimeRangeTargetingError : ApiError { + private DateTimeRangeTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DateTimeRangeTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DateTimeRangeTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum DateTimeRangeTargetingErrorReason { + EMPTY_RANGES, + NOT_SPONSORSHIP_LINEITEM, + PAST_RANGES_CHANGED, + RANGES_OVERLAP, + RANGES_OUT_OF_LINEITEM_ACTIVE_PERIOD, + START_TIME_IS_NOT_START_OF_DAY, + END_TIME_IS_NOT_END_OF_DAY, + START_DATE_TIME_IS_IN_PAST, + RANGE_END_TIME_BEFORE_START_TIME, + END_DATE_TIME_IS_TOO_LATE, + LIMITED_RANGES_IN_UNLIMITED_LINEITEM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CustomFieldValueError : ApiError { + private CustomFieldValueErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomFieldValueErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomFieldValueError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CustomFieldValueErrorReason { + CUSTOM_FIELD_NOT_FOUND, + CUSTOM_FIELD_INACTIVE, + CUSTOM_FIELD_OPTION_NOT_FOUND, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CompanyCreditStatusError : ApiError { + private CompanyCreditStatusErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CompanyCreditStatusErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CompanyCreditStatusError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CompanyCreditStatusErrorReason { + COMPANY_CREDIT_STATUS_CHANGE_NOT_ALLOWED, + CANNOT_USE_CREDIT_STATUS_SETTING, + CANNOT_USE_ADVANCED_CREDIT_STATUS_SETTING, + UNACCEPTABLE_COMPANY_CREDIT_STATUS_FOR_ORDER, + UNACCEPTABLE_COMPANY_CREDIT_STATUS_FOR_LINE_ITEM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ClickTrackingLineItemError : ApiError { + private ClickTrackingLineItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ClickTrackingLineItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ClickTrackingLineItemError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum ClickTrackingLineItemErrorReason { + TYPE_IMMUTABLE, + INVALID_TARGETING_TYPE, + INVALID_ROADBLOCKING_TYPE, + INVALID_CREATIVEROTATION_TYPE, + INVALID_DELIVERY_RATE_TYPE, + UNSUPPORTED_FIELD, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeTemplateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeTemplateService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeTemplateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/CreativeTemplateService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeTemplate getCreativeTemplate(long creativeTemplateId) { + object[] results = this.Invoke("getCreativeTemplate", new object[] { creativeTemplateId }); + return ((CreativeTemplate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeTemplatePage getCreativeTemplatesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativeTemplatesByStatement", new object[] { filterStatement }); + return ((CreativeTemplatePage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CreativeTemplatePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeTemplate[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeTemplate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CreativeTemplate { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private CreativeTemplateVariable[] variablesField; + + private CreativeTemplateStatus statusField; + + private bool statusFieldSpecified; + + private CreativeTemplateType typeField; + + private bool typeFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("variables")] + public CreativeTemplateVariable[] variables { + get { return this.variablesField; } + set { this.variablesField = value; } + } + + public CreativeTemplateStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public CreativeTemplateType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UrlCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListStringCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetCreativeTemplateVariable))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class CreativeTemplateVariable { + private string labelField; + + private string uniqueNameField; + + private string descriptionField; + + private bool isRequiredField; + + private bool isRequiredFieldSpecified; + + private string creativeTemplateVariableTypeField; + + public string label { + get { return this.labelField; } + set { this.labelField = value; } + } + + public string uniqueName { + get { return this.uniqueNameField; } + set { this.uniqueNameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isRequired { + get { return this.isRequiredField; } + set { + this.isRequiredField = value; + this.isRequiredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isRequiredSpecified { + get { return this.isRequiredFieldSpecified; } + set { this.isRequiredFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("CreativeTemplateVariable.Type")] + public string CreativeTemplateVariableType { + get { return this.creativeTemplateVariableTypeField; } + set { this.creativeTemplateVariableTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class UrlCreativeTemplateVariable : CreativeTemplateVariable { + private string defaultValueField; + + public string defaultValue { + get { return this.defaultValueField; } + set { this.defaultValueField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListStringCreativeTemplateVariable))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class StringCreativeTemplateVariable : CreativeTemplateVariable { + private string defaultValueField; + + public string defaultValue { + get { return this.defaultValueField; } + set { this.defaultValueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ListStringCreativeTemplateVariable : StringCreativeTemplateVariable { + private ListStringCreativeTemplateVariableVariableChoice[] choicesField; + + private bool allowOtherChoiceField; + + private bool allowOtherChoiceFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("choices")] + public ListStringCreativeTemplateVariableVariableChoice[] choices { + get { return this.choicesField; } + set { this.choicesField = value; } + } + + public bool allowOtherChoice { + get { return this.allowOtherChoiceField; } + set { + this.allowOtherChoiceField = value; + this.allowOtherChoiceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowOtherChoiceSpecified { + get { return this.allowOtherChoiceFieldSpecified; } + set { this.allowOtherChoiceFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ListStringCreativeTemplateVariable.VariableChoice", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ListStringCreativeTemplateVariableVariableChoice { + private string labelField; + + private string valueField; + + public string label { + get { return this.labelField; } + set { this.labelField = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class LongCreativeTemplateVariable : CreativeTemplateVariable { + private long defaultValueField; + + private bool defaultValueFieldSpecified; + + public long defaultValue { + get { return this.defaultValueField; } + set { + this.defaultValueField = value; + this.defaultValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool defaultValueSpecified { + get { return this.defaultValueFieldSpecified; } + set { this.defaultValueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AssetCreativeTemplateVariable : CreativeTemplateVariable { + private AssetCreativeTemplateVariableMimeType[] mimeTypesField; + + [System.Xml.Serialization.XmlElementAttribute("mimeTypes")] + public AssetCreativeTemplateVariableMimeType[] mimeTypes { + get { return this.mimeTypesField; } + set { this.mimeTypesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AssetCreativeTemplateVariable.MimeType", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum AssetCreativeTemplateVariableMimeType { + JPG, + PNG, + GIF, + SWF + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CreativeTemplateStatus { + ACTIVE, + INACTIVE, + DELETED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CreativeTemplateType { + SYSTEM_DEFINED, + USER_DEFINED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CreativeTemplateError : ApiError { + private CreativeTemplateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeTemplateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeTemplateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CreativeTemplateErrorReason { + CANNOT_PARSE_CREATIVE_TEMPLATE, + VARIABLE_DUPLICATE_UNIQUE_NAME, + VARIABLE_INVALID_UNIQUE_NAME, + LIST_CHOICE_DUPLICATE_VALUE, + LIST_CHOICE_NEEDS_DEFAULT, + LIST_CHOICES_EMPTY, + NO_TARGET_PLATFORMS, + MULTIPLE_TARGET_PLATFORMS, + UNRECOGNIZED_PLACEHOLDER, + PLACEHOLDERS_NOT_IN_FORMATTER, + MISSING_INTERSTITIAL_MACRO, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "OrderServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class OrderService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public OrderService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/OrderService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Order createOrder(Order order) { + object[] results = this.Invoke("createOrder", new object[] { order }); + return ((Order) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Order[] createOrders([System.Xml.Serialization.XmlElementAttribute("orders")] +Order[] orders) { + object[] results = this.Invoke("createOrders", new object[] { orders }); + return ((Order[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Order getOrder(long orderId) { + object[] results = this.Invoke("getOrder", new object[] { orderId }); + return ((Order) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public OrderPage getOrdersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getOrdersByStatement", new object[] { filterStatement }); + return ((OrderPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performOrderAction(OrderAction orderAction, Statement filterStatement) { + object[] results = this.Invoke("performOrderAction", new object[] { orderAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Order updateOrder(Order order) { + object[] results = this.Invoke("updateOrder", new object[] { order }); + return ((Order) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Order[] updateOrders([System.Xml.Serialization.XmlElementAttribute("orders")] +Order[] orders) { + object[] results = this.Invoke("updateOrders", new object[] { orders }); + return ((Order[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApproval))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalAndOverbook))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RetractOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RetractOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PauseOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DisapproveOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DisapproveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class OrderAction { + private string orderActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("OrderAction.Type")] + public string OrderActionType { + get { return this.orderActionTypeField; } + set { this.orderActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class UnarchiveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class SubmitOrdersForApprovalWithoutReservationChanges : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalAndOverbook))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class SubmitOrdersForApproval : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class SubmitOrdersForApprovalAndOverbook : SubmitOrdersForApproval { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class RetractOrdersWithoutReservationChanges : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class RetractOrders : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ResumeOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ResumeAndOverbookOrders : ResumeOrders { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class PauseOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DisapproveOrdersWithoutReservationChanges : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DisapproveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DeleteOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ArchiveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ApproveOrdersWithoutReservationChanges : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ApproveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ApproveAndOverbookOrders : ApproveOrders { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class OrderPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Order[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Order[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class Order { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private OrderStatus statusField; + + private bool statusFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private string notesField; + + private int externalOrderIdField; + + private bool externalOrderIdFieldSpecified; + + private string poNumberField; + + private string currencyCodeField; + + private long advertiserIdField; + + private bool advertiserIdFieldSpecified; + + private long agencyIdField; + + private bool agencyIdFieldSpecified; + + private long creatorIdField; + + private bool creatorIdFieldSpecified; + + private long traffickerIdField; + + private bool traffickerIdFieldSpecified; + + private long[] secondaryTraffickerIdsField; + + private long salespersonIdField; + + private bool salespersonIdFieldSpecified; + + private long[] secondarySalespersonIdsField; + + private long totalImpressionsDeliveredField; + + private bool totalImpressionsDeliveredFieldSpecified; + + private long totalClicksDeliveredField; + + private bool totalClicksDeliveredFieldSpecified; + + private Money totalBudgetField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private string lastModifiedByAppField; + + private long[] appliedTeamIdsField; + + private DateTime lastModifiedDateTimeField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public OrderStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public int externalOrderId { + get { return this.externalOrderIdField; } + set { + this.externalOrderIdField = value; + this.externalOrderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool externalOrderIdSpecified { + get { return this.externalOrderIdFieldSpecified; } + set { this.externalOrderIdFieldSpecified = value; } + } + + public string poNumber { + get { return this.poNumberField; } + set { this.poNumberField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public long advertiserId { + get { return this.advertiserIdField; } + set { + this.advertiserIdField = value; + this.advertiserIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserIdSpecified { + get { return this.advertiserIdFieldSpecified; } + set { this.advertiserIdFieldSpecified = value; } + } + + public long agencyId { + get { return this.agencyIdField; } + set { + this.agencyIdField = value; + this.agencyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool agencyIdSpecified { + get { return this.agencyIdFieldSpecified; } + set { this.agencyIdFieldSpecified = value; } + } + + public long creatorId { + get { return this.creatorIdField; } + set { + this.creatorIdField = value; + this.creatorIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creatorIdSpecified { + get { return this.creatorIdFieldSpecified; } + set { this.creatorIdFieldSpecified = value; } + } + + public long traffickerId { + get { return this.traffickerIdField; } + set { + this.traffickerIdField = value; + this.traffickerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool traffickerIdSpecified { + get { return this.traffickerIdFieldSpecified; } + set { this.traffickerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryTraffickerIds")] + public long[] secondaryTraffickerIds { + get { return this.secondaryTraffickerIdsField; } + set { this.secondaryTraffickerIdsField = value; } + } + + public long salespersonId { + get { return this.salespersonIdField; } + set { + this.salespersonIdField = value; + this.salespersonIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool salespersonIdSpecified { + get { return this.salespersonIdFieldSpecified; } + set { this.salespersonIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondarySalespersonIds")] + public long[] secondarySalespersonIds { + get { return this.secondarySalespersonIdsField; } + set { this.secondarySalespersonIdsField = value; } + } + + public long totalImpressionsDelivered { + get { return this.totalImpressionsDeliveredField; } + set { + this.totalImpressionsDeliveredField = value; + this.totalImpressionsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalImpressionsDeliveredSpecified { + get { return this.totalImpressionsDeliveredFieldSpecified; } + set { this.totalImpressionsDeliveredFieldSpecified = value; } + } + + public long totalClicksDelivered { + get { return this.totalClicksDeliveredField; } + set { + this.totalClicksDeliveredField = value; + this.totalClicksDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalClicksDeliveredSpecified { + get { return this.totalClicksDeliveredFieldSpecified; } + set { this.totalClicksDeliveredFieldSpecified = value; } + } + + public Money totalBudget { + get { return this.totalBudgetField; } + set { this.totalBudgetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public string lastModifiedByApp { + get { return this.lastModifiedByAppField; } + set { this.lastModifiedByAppField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum OrderStatus { + DRAFT, + PENDING_APPROVAL, + APPROVED, + DISAPPROVED, + PAUSED, + CANCELED, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "NetworkServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class NetworkService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public NetworkService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/NetworkService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Network[] getAllNetworks() { + object[] results = this.Invoke("getAllNetworks", new object[0]); + return ((Network[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Network getCurrentNetwork() { + object[] results = this.Invoke("getCurrentNetwork", new object[0]); + return ((Network) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Network makeTestNetwork() { + object[] results = this.Invoke("makeTestNetwork", new object[0]); + return ((Network) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Network updateNetwork(Network network) { + object[] results = this.Invoke("updateNetwork", new object[] { network }); + return ((Network) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class Network { + private long idField; + + private bool idFieldSpecified; + + private string displayNameField; + + private string networkCodeField; + + private string propertyCodeField; + + private string timeZoneField; + + private string currencyCodeField; + + private string effectiveRootAdUnitIdField; + + private long contentBrowseCustomTargetingKeyIdField; + + private bool contentBrowseCustomTargetingKeyIdFieldSpecified; + + private bool isTestField; + + private bool isTestFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public string networkCode { + get { return this.networkCodeField; } + set { this.networkCodeField = value; } + } + + public string propertyCode { + get { return this.propertyCodeField; } + set { this.propertyCodeField = value; } + } + + public string timeZone { + get { return this.timeZoneField; } + set { this.timeZoneField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public string effectiveRootAdUnitId { + get { return this.effectiveRootAdUnitIdField; } + set { this.effectiveRootAdUnitIdField = value; } + } + + public long contentBrowseCustomTargetingKeyId { + get { return this.contentBrowseCustomTargetingKeyIdField; } + set { + this.contentBrowseCustomTargetingKeyIdField = value; + this.contentBrowseCustomTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contentBrowseCustomTargetingKeyIdSpecified { + get { return this.contentBrowseCustomTargetingKeyIdFieldSpecified; } + set { this.contentBrowseCustomTargetingKeyIdFieldSpecified = value; } + } + + public bool isTest { + get { return this.isTestField; } + set { + this.isTestField = value; + this.isTestSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTestSpecified { + get { return this.isTestFieldSpecified; } + set { this.isTestFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "UserServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserRecord))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class UserService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public UserService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/UserService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public User createUser(User user) { + object[] results = this.Invoke("createUser", new object[] { user }); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public User[] createUsers([System.Xml.Serialization.XmlElementAttribute("users")] +User[] users) { + object[] results = this.Invoke("createUsers", new object[] { users }); + return ((User[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Role[] getAllRoles() { + object[] results = this.Invoke("getAllRoles", new object[0]); + return ((Role[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public User getCurrentUser() { + object[] results = this.Invoke("getCurrentUser", new object[0]); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public User getUser(long userId) { + object[] results = this.Invoke("getUser", new object[] { userId }); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UserPage getUsersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getUsersByStatement", new object[] { filterStatement }); + return ((UserPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performUserAction(UserAction userAction, Statement filterStatement) { + object[] results = this.Invoke("performUserAction", new object[] { userAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public User updateUser(User user) { + object[] results = this.Invoke("updateUser", new object[] { user }); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public User[] updateUsers([System.Xml.Serialization.XmlElementAttribute("users")] +User[] users) { + object[] results = this.Invoke("updateUsers", new object[] { users }); + return ((User[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateUsers))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateUsers))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class UserAction { + private string userActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("UserAction.Type")] + public string UserActionType { + get { return this.userActionTypeField; } + set { this.userActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DeactivateUsers : UserAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ActivateUsers : UserAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class UserPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private User[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public User[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class User : UserRecord { + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private bool isEmailNotificationAllowedField; + + private bool isEmailNotificationAllowedFieldSpecified; + + private string ordersUiLocalTimeZoneIdField; + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + public bool isEmailNotificationAllowed { + get { return this.isEmailNotificationAllowedField; } + set { + this.isEmailNotificationAllowedField = value; + this.isEmailNotificationAllowedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isEmailNotificationAllowedSpecified { + get { return this.isEmailNotificationAllowedFieldSpecified; } + set { this.isEmailNotificationAllowedFieldSpecified = value; } + } + + public string ordersUiLocalTimeZoneId { + get { return this.ordersUiLocalTimeZoneIdField; } + set { this.ordersUiLocalTimeZoneIdField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(User))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class UserRecord { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string emailField; + + private long roleIdField; + + private bool roleIdFieldSpecified; + + private string roleNameField; + + private string preferredLocaleField; + + private string userRecordTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public long roleId { + get { return this.roleIdField; } + set { + this.roleIdField = value; + this.roleIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roleIdSpecified { + get { return this.roleIdFieldSpecified; } + set { this.roleIdFieldSpecified = value; } + } + + public string roleName { + get { return this.roleNameField; } + set { this.roleNameField = value; } + } + + public string preferredLocale { + get { return this.preferredLocaleField; } + set { this.preferredLocaleField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("UserRecord.Type")] + public string UserRecordType { + get { return this.userRecordTypeField; } + set { this.userRecordTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class Role { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CompanyServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CompanyService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CompanyService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/CompanyService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Company[] createCompanies([System.Xml.Serialization.XmlElementAttribute("companies")] +Company[] companies) { + object[] results = this.Invoke("createCompanies", new object[] { companies }); + return ((Company[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Company createCompany(Company company) { + object[] results = this.Invoke("createCompany", new object[] { company }); + return ((Company) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CompanyPage getCompaniesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCompaniesByStatement", new object[] { filterStatement }); + return ((CompanyPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Company getCompany(long companyId) { + object[] results = this.Invoke("getCompany", new object[] { companyId }); + return ((Company) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Company[] updateCompanies([System.Xml.Serialization.XmlElementAttribute("companies")] +Company[] companies) { + object[] results = this.Invoke("updateCompanies", new object[] { companies }); + return ((Company[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Company updateCompany(Company company) { + object[] results = this.Invoke("updateCompany", new object[] { company }); + return ((Company) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CompanyPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Company[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Company[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class Company { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private CompanyType typeField; + + private bool typeFieldSpecified; + + private string addressField; + + private string emailField; + + private string faxPhoneField; + + private string primaryPhoneField; + + private string externalIdField; + + private string commentField; + + private CompanyCreditStatus creditStatusField; + + private bool creditStatusFieldSpecified; + + private AppliedLabel[] appliedLabelsField; + + private bool enableSameAdvertiserCompetitiveExclusionField; + + private bool enableSameAdvertiserCompetitiveExclusionFieldSpecified; + + private long[] appliedTeamIdsField; + + private int thirdPartyCompanyIdField; + + private bool thirdPartyCompanyIdFieldSpecified; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public CompanyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public string address { + get { return this.addressField; } + set { this.addressField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public string faxPhone { + get { return this.faxPhoneField; } + set { this.faxPhoneField = value; } + } + + public string primaryPhone { + get { return this.primaryPhoneField; } + set { this.primaryPhoneField = value; } + } + + public string externalId { + get { return this.externalIdField; } + set { this.externalIdField = value; } + } + + public string comment { + get { return this.commentField; } + set { this.commentField = value; } + } + + public CompanyCreditStatus creditStatus { + get { return this.creditStatusField; } + set { + this.creditStatusField = value; + this.creditStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creditStatusSpecified { + get { return this.creditStatusFieldSpecified; } + set { this.creditStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + public bool enableSameAdvertiserCompetitiveExclusion { + get { return this.enableSameAdvertiserCompetitiveExclusionField; } + set { + this.enableSameAdvertiserCompetitiveExclusionField = value; + this.enableSameAdvertiserCompetitiveExclusionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool enableSameAdvertiserCompetitiveExclusionSpecified { + get { return this.enableSameAdvertiserCompetitiveExclusionFieldSpecified; } + set { this.enableSameAdvertiserCompetitiveExclusionFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public int thirdPartyCompanyId { + get { return this.thirdPartyCompanyIdField; } + set { + this.thirdPartyCompanyIdField = value; + this.thirdPartyCompanyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyCompanyIdSpecified { + get { return this.thirdPartyCompanyIdFieldSpecified; } + set { this.thirdPartyCompanyIdFieldSpecified = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Company.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CompanyType { + HOUSE_ADVERTISER, + HOUSE_AGENCY, + ADVERTISER, + AGENCY, + AD_NETWORK, + AFFILIATE_DISTRIBUTION_PARTNER, + CONTENT_PARTNER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Company.CreditStatus", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CompanyCreditStatus { + ACTIVE, + ON_HOLD, + CREDIT_STOP, + INACTIVE, + BLOCKED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CompanyError : ApiError { + private CompanyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CompanyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CompanyError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CompanyErrorReason { + CANNOT_SET_THIRD_PARTY_COMPANY_DUE_TO_TYPE, + CANNOT_UPDATE_COMPANY_TYPE, + INVALID_COMPANY_TYPE, + PRIMARY_CONTACT_DOES_NOT_BELONG_TO_THIS_COMPANY, + THIRD_PARTY_STATS_PROVIDER_IS_WRONG_ROLE_TYPE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ThirdPartySlotServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ThirdPartySlotService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ThirdPartySlotService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/ThirdPartySlotService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ThirdPartySlot createThirdPartySlot(ThirdPartySlot thirdPartySlot) { + object[] results = this.Invoke("createThirdPartySlot", new object[] { thirdPartySlot }); + return ((ThirdPartySlot) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ThirdPartySlotPage getThirdPartySlotsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getThirdPartySlotsByStatement", new object[] { filterStatement }); + return ((ThirdPartySlotPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performThirdPartySlotAction(ThirdPartySlotAction thirdPartySlotAction, Statement filterStatement) { + object[] results = this.Invoke("performThirdPartySlotAction", new object[] { thirdPartySlotAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ThirdPartySlot updateThirdPartySlot(ThirdPartySlot thirdPartySlot) { + object[] results = this.Invoke("updateThirdPartySlot", new object[] { thirdPartySlot }); + return ((ThirdPartySlot) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveThirdPartySlots))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateThirdPartySlots))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class ThirdPartySlotAction { + private string thirdPartySlotActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ThirdPartySlotAction.Type")] + public string ThirdPartySlotActionType { + get { return this.thirdPartySlotActionTypeField; } + set { this.thirdPartySlotActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ArchiveThirdPartySlots : ThirdPartySlotAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ActivateThirdPartySlots : ThirdPartySlotAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ThirdPartySlotPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ThirdPartySlot[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ThirdPartySlot[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ThirdPartySlot { + private long idField; + + private bool idFieldSpecified; + + private long[] creativeIdsField; + + private long companyIdField; + + private bool companyIdFieldSpecified; + + private string externalUniqueIdField; + + private string externalUniqueNameField; + + private string descriptionField; + + private ThirdPartySlotStatus statusField; + + private bool statusFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativeIds")] + public long[] creativeIds { + get { return this.creativeIdsField; } + set { this.creativeIdsField = value; } + } + + public long companyId { + get { return this.companyIdField; } + set { + this.companyIdField = value; + this.companyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companyIdSpecified { + get { return this.companyIdFieldSpecified; } + set { this.companyIdFieldSpecified = value; } + } + + public string externalUniqueId { + get { return this.externalUniqueIdField; } + set { this.externalUniqueIdField = value; } + } + + public string externalUniqueName { + get { return this.externalUniqueNameField; } + set { this.externalUniqueNameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public ThirdPartySlotStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ThirdPartySlot.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum ThirdPartySlotStatus { + ACTIVE, + ARCHIVED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "InventoryServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class InventoryService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public InventoryService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/InventoryService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdUnit createAdUnit(AdUnit adUnit) { + object[] results = this.Invoke("createAdUnit", new object[] { adUnit }); + return ((AdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdUnit[] createAdUnits([System.Xml.Serialization.XmlElementAttribute("adUnits")] +AdUnit[] adUnits) { + object[] results = this.Invoke("createAdUnits", new object[] { adUnits }); + return ((AdUnit[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdUnit getAdUnit(string adUnitId) { + object[] results = this.Invoke("getAdUnit", new object[] { adUnitId }); + return ((AdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdUnitSize[] getAdUnitSizesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAdUnitSizesByStatement", new object[] { filterStatement }); + return ((AdUnitSize[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdUnitPage getAdUnitsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAdUnitsByStatement", new object[] { filterStatement }); + return ((AdUnitPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performAdUnitAction(AdUnitAction adUnitAction, Statement filterStatement) { + object[] results = this.Invoke("performAdUnitAction", new object[] { adUnitAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdUnit updateAdUnit(AdUnit adUnit) { + object[] results = this.Invoke("updateAdUnit", new object[] { adUnit }); + return ((AdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdUnit[] updateAdUnits([System.Xml.Serialization.XmlElementAttribute("adUnits")] +AdUnit[] adUnits) { + object[] results = this.Invoke("updateAdUnits", new object[] { adUnits }); + return ((AdUnit[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateAdUnits))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssignAdUnitsToPlacement))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveAdUnits))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateAdUnits))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class AdUnitAction { + private string adUnitActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AdUnitAction.Type")] + public string AdUnitActionType { + get { return this.adUnitActionTypeField; } + set { this.adUnitActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DeactivateAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AssignAdUnitsToPlacement : AdUnitAction { + private long placementIdField; + + private bool placementIdFieldSpecified; + + public long placementId { + get { return this.placementIdField; } + set { + this.placementIdField = value; + this.placementIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool placementIdSpecified { + get { return this.placementIdFieldSpecified; } + set { this.placementIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ArchiveAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ActivateAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AdUnitPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AdUnit[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AdUnit[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AdUnit { + private string idField; + + private string parentIdField; + + private bool hasChildrenField; + + private bool hasChildrenFieldSpecified; + + private AdUnitParent[] parentPathField; + + private string nameField; + + private string descriptionField; + + private AdUnitTargetWindow targetWindowField; + + private bool targetWindowFieldSpecified; + + private InventoryStatus statusField; + + private bool statusFieldSpecified; + + private string adUnitCodeField; + + private AdUnitSize[] adUnitSizesField; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private MobilePlatform mobilePlatformField; + + private bool mobilePlatformFieldSpecified; + + private bool explicitlyTargetedField; + + private bool explicitlyTargetedFieldSpecified; + + private AdSenseSettingsInheritedProperty inheritedAdSenseSettingsField; + + private LabelFrequencyCap[] appliedLabelFrequencyCapsField; + + private LabelFrequencyCap[] effectiveLabelFrequencyCapsField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private long[] effectiveTeamIdsField; + + private long[] appliedTeamIdsField; + + private DateTime lastModifiedDateTimeField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string parentId { + get { return this.parentIdField; } + set { this.parentIdField = value; } + } + + public bool hasChildren { + get { return this.hasChildrenField; } + set { + this.hasChildrenField = value; + this.hasChildrenSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasChildrenSpecified { + get { return this.hasChildrenFieldSpecified; } + set { this.hasChildrenFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("parentPath")] + public AdUnitParent[] parentPath { + get { return this.parentPathField; } + set { this.parentPathField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public AdUnitTargetWindow targetWindow { + get { return this.targetWindowField; } + set { + this.targetWindowField = value; + this.targetWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetWindowSpecified { + get { return this.targetWindowFieldSpecified; } + set { this.targetWindowFieldSpecified = value; } + } + + public InventoryStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string adUnitCode { + get { return this.adUnitCodeField; } + set { this.adUnitCodeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adUnitSizes")] + public AdUnitSize[] adUnitSizes { + get { return this.adUnitSizesField; } + set { this.adUnitSizesField = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + public MobilePlatform mobilePlatform { + get { return this.mobilePlatformField; } + set { + this.mobilePlatformField = value; + this.mobilePlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mobilePlatformSpecified { + get { return this.mobilePlatformFieldSpecified; } + set { this.mobilePlatformFieldSpecified = value; } + } + + public bool explicitlyTargeted { + get { return this.explicitlyTargetedField; } + set { + this.explicitlyTargetedField = value; + this.explicitlyTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool explicitlyTargetedSpecified { + get { return this.explicitlyTargetedFieldSpecified; } + set { this.explicitlyTargetedFieldSpecified = value; } + } + + public AdSenseSettingsInheritedProperty inheritedAdSenseSettings { + get { return this.inheritedAdSenseSettingsField; } + set { this.inheritedAdSenseSettingsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabelFrequencyCaps")] + public LabelFrequencyCap[] appliedLabelFrequencyCaps { + get { return this.appliedLabelFrequencyCapsField; } + set { this.appliedLabelFrequencyCapsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveLabelFrequencyCaps")] + public LabelFrequencyCap[] effectiveLabelFrequencyCaps { + get { return this.effectiveLabelFrequencyCapsField; } + set { this.effectiveLabelFrequencyCapsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveTeamIds")] + public long[] effectiveTeamIds { + get { return this.effectiveTeamIdsField; } + set { this.effectiveTeamIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum MobilePlatform { + SITE, + APPLICATION + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AdSenseSettingsInheritedProperty { + private AdSenseSettings valueField; + + public AdSenseSettings value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AdSenseSettings { + private bool adSenseEnabledField; + + private bool adSenseEnabledFieldSpecified; + + private string borderColorField; + + private string titleColorField; + + private string backgroundColorField; + + private string textColorField; + + private string urlColorField; + + private AdSenseSettingsAdType adTypeField; + + private bool adTypeFieldSpecified; + + private AdSenseSettingsBorderStyle borderStyleField; + + private bool borderStyleFieldSpecified; + + private AdSenseSettingsFontFamily fontFamilyField; + + private bool fontFamilyFieldSpecified; + + private AdSenseSettingsFontSize fontSizeField; + + private bool fontSizeFieldSpecified; + + private Size_StringMapEntry[] afcFormatsField; + + public bool adSenseEnabled { + get { return this.adSenseEnabledField; } + set { + this.adSenseEnabledField = value; + this.adSenseEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adSenseEnabledSpecified { + get { return this.adSenseEnabledFieldSpecified; } + set { this.adSenseEnabledFieldSpecified = value; } + } + + public string borderColor { + get { return this.borderColorField; } + set { this.borderColorField = value; } + } + + public string titleColor { + get { return this.titleColorField; } + set { this.titleColorField = value; } + } + + public string backgroundColor { + get { return this.backgroundColorField; } + set { this.backgroundColorField = value; } + } + + public string textColor { + get { return this.textColorField; } + set { this.textColorField = value; } + } + + public string urlColor { + get { return this.urlColorField; } + set { this.urlColorField = value; } + } + + public AdSenseSettingsAdType adType { + get { return this.adTypeField; } + set { + this.adTypeField = value; + this.adTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adTypeSpecified { + get { return this.adTypeFieldSpecified; } + set { this.adTypeFieldSpecified = value; } + } + + public AdSenseSettingsBorderStyle borderStyle { + get { return this.borderStyleField; } + set { + this.borderStyleField = value; + this.borderStyleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool borderStyleSpecified { + get { return this.borderStyleFieldSpecified; } + set { this.borderStyleFieldSpecified = value; } + } + + public AdSenseSettingsFontFamily fontFamily { + get { return this.fontFamilyField; } + set { + this.fontFamilyField = value; + this.fontFamilySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fontFamilySpecified { + get { return this.fontFamilyFieldSpecified; } + set { this.fontFamilyFieldSpecified = value; } + } + + public AdSenseSettingsFontSize fontSize { + get { return this.fontSizeField; } + set { + this.fontSizeField = value; + this.fontSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fontSizeSpecified { + get { return this.fontSizeFieldSpecified; } + set { this.fontSizeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("afcFormats")] + public Size_StringMapEntry[] afcFormats { + get { return this.afcFormatsField; } + set { this.afcFormatsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.AdType", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum AdSenseSettingsAdType { + TEXT, + IMAGE, + TEXT_AND_IMAGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.BorderStyle", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum AdSenseSettingsBorderStyle { + DEFAULT, + NOT_ROUNDED, + SLIGHTLY_ROUNDED, + VERY_ROUNDED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.FontFamily", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum AdSenseSettingsFontFamily { + DEFAULT, + ARIAL, + TAHOMA, + GEORGIA, + TIMES, + VERDANA + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.FontSize", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum AdSenseSettingsFontSize { + DEFAULT, + SMALL, + MEDIUM, + LARGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class Size_StringMapEntry { + private Size keyField; + + private string valueField; + + public Size key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class LabelFrequencyCap { + private FrequencyCap frequencyCapField; + + private long labelIdField; + + private bool labelIdFieldSpecified; + + public FrequencyCap frequencyCap { + get { return this.frequencyCapField; } + set { this.frequencyCapField = value; } + } + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AdUnitTypeError : ApiError { + private AdUnitTypeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitTypeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitTypeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum AdUnitTypeErrorReason { + MOBILE_APP_PLATFORM_NOT_VALID, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class InventoryUnitSizesError : ApiError { + private InventoryUnitSizesErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitSizesErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitSizesError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum InventoryUnitSizesErrorReason { + INVALID_SIZES, + INVALID_SIZE_FOR_PLATFORM, + INVALID_SIZE_FOR_ENVIRONMENT, + VIDEO_FEATURE_MISSING, + VIDEO_MOBILE_LINE_ITEM_FEATURE_MISSING, + INVALID_SIZE_FOR_MASTER, + INVALID_SIZE_FOR_COMPANION, + DUPLICATE_MASTER_SIZES, + ASPECT_RATIO_NOT_SUPPORTED, + VIDEO_COMPANIONS_NOT_SUPPORTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class InventoryUnitPartnerAssociationError : ApiError { + private InventoryUnitPartnerAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitPartnerAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitPartnerAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum InventoryUnitPartnerAssociationErrorReason { + ANCESTOR_AD_UNIT_HAS_PARTNER_ASSOCIATION, + DESCENDANT_AD_UNIT_HAS_PARTNER_ASSOCIATION, + SAME_PARTNER_ASSOCIATION_IN_INVENTORY_HIERARCHY, + NO_PARTNER_CATCH_ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class InvalidColorError : ApiError { + private InvalidColorErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidColorErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidColorError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum InvalidColorErrorReason { + INVALID_FORMAT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomFieldServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomFieldService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomFieldService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/CustomFieldService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomField createCustomField(CustomField customField) { + object[] results = this.Invoke("createCustomField", new object[] { customField }); + return ((CustomField) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomFieldOption createCustomFieldOption(CustomFieldOption customFieldOption) { + object[] results = this.Invoke("createCustomFieldOption", new object[] { customFieldOption }); + return ((CustomFieldOption) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomFieldOption[] createCustomFieldOptions([System.Xml.Serialization.XmlElementAttribute("customFieldOptions")] +CustomFieldOption[] customFieldOptions) { + object[] results = this.Invoke("createCustomFieldOptions", new object[] { customFieldOptions }); + return ((CustomFieldOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomField[] createCustomFields([System.Xml.Serialization.XmlElementAttribute("customFields")] +CustomField[] customFields) { + object[] results = this.Invoke("createCustomFields", new object[] { customFields }); + return ((CustomField[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomField getCustomField(long customFieldId) { + object[] results = this.Invoke("getCustomField", new object[] { customFieldId }); + return ((CustomField) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomFieldOption getCustomFieldOption(long customFieldOptionId, [System.Xml.Serialization.XmlIgnoreAttribute()] +bool customFieldOptionIdSpecified) { + object[] results = this.Invoke("getCustomFieldOption", new object[] { customFieldOptionId, customFieldOptionIdSpecified }); + return ((CustomFieldOption) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomFieldPage getCustomFieldsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomFieldsByStatement", new object[] { filterStatement }); + return ((CustomFieldPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performCustomFieldAction(CustomFieldAction customFieldAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomFieldAction", new object[] { customFieldAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomField updateCustomField(CustomField customField) { + object[] results = this.Invoke("updateCustomField", new object[] { customField }); + return ((CustomField) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomFieldOption updateCustomFieldOption(CustomFieldOption customFieldOption) { + object[] results = this.Invoke("updateCustomFieldOption", new object[] { customFieldOption }); + return ((CustomFieldOption) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomFieldOption[] updateCustomFieldOptions([System.Xml.Serialization.XmlElementAttribute("customFieldOptions")] +CustomFieldOption[] customFieldOptions) { + object[] results = this.Invoke("updateCustomFieldOptions", new object[] { customFieldOptions }); + return ((CustomFieldOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomField[] updateCustomFields([System.Xml.Serialization.XmlElementAttribute("customFields")] +CustomField[] customFields) { + object[] results = this.Invoke("updateCustomFields", new object[] { customFields }); + return ((CustomField[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateCustomFields))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateCustomFields))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CustomFieldAction { + private string customFieldActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomFieldAction.Type")] + public string CustomFieldActionType { + get { return this.customFieldActionTypeField; } + set { this.customFieldActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DeactivateCustomFields : CustomFieldAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ActivateCustomFields : CustomFieldAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CustomFieldPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomField[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomField[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DropDownCustomField))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CustomField { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private CustomFieldEntityType entityTypeField; + + private bool entityTypeFieldSpecified; + + private CustomFieldDataType dataTypeField; + + private bool dataTypeFieldSpecified; + + private CustomFieldVisibility visibilityField; + + private bool visibilityFieldSpecified; + + private string customFieldTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + public CustomFieldEntityType entityType { + get { return this.entityTypeField; } + set { + this.entityTypeField = value; + this.entityTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool entityTypeSpecified { + get { return this.entityTypeFieldSpecified; } + set { this.entityTypeFieldSpecified = value; } + } + + public CustomFieldDataType dataType { + get { return this.dataTypeField; } + set { + this.dataTypeField = value; + this.dataTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dataTypeSpecified { + get { return this.dataTypeFieldSpecified; } + set { this.dataTypeFieldSpecified = value; } + } + + public CustomFieldVisibility visibility { + get { return this.visibilityField; } + set { + this.visibilityField = value; + this.visibilitySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool visibilitySpecified { + get { return this.visibilityFieldSpecified; } + set { this.visibilityFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("CustomField.Type")] + public string CustomFieldType { + get { return this.customFieldTypeField; } + set { this.customFieldTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CustomFieldEntityType { + LINE_ITEM, + ORDER, + CREATIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CustomFieldDataType { + STRING, + NUMBER, + TOGGLE, + DROP_DOWN, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CustomFieldVisibility { + API_ONLY, + READ_ONLY, + FULL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DropDownCustomField : CustomField { + private CustomFieldOption[] optionsField; + + [System.Xml.Serialization.XmlElementAttribute("options")] + public CustomFieldOption[] options { + get { return this.optionsField; } + set { this.optionsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CustomFieldOption { + private long idField; + + private bool idFieldSpecified; + + private long customFieldIdField; + + private bool customFieldIdFieldSpecified; + + private string displayNameField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long customFieldId { + get { return this.customFieldIdField; } + set { + this.customFieldIdField = value; + this.customFieldIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldIdSpecified { + get { return this.customFieldIdFieldSpecified; } + set { this.customFieldIdFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CustomFieldError : ApiError { + private CustomFieldErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomFieldErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomFieldError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum CustomFieldErrorReason { + INVALID_CUSTOM_FIELD_FOR_OPTION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Asset))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/CreativeService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Creative createCreative(Creative creative) { + object[] results = this.Invoke("createCreative", new object[] { creative }); + return ((Creative) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Creative[] createCreatives([System.Xml.Serialization.XmlElementAttribute("creatives")] +Creative[] creatives) { + object[] results = this.Invoke("createCreatives", new object[] { creatives }); + return ((Creative[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Creative getCreative(long creativeId) { + object[] results = this.Invoke("getCreative", new object[] { creativeId }); + return ((Creative) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativePage getCreativesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativesByStatement", new object[] { filterStatement }); + return ((CreativePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Creative updateCreative(Creative creative) { + object[] results = this.Invoke("updateCreative", new object[] { creative }); + return ((Creative) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Creative[] updateCreatives([System.Xml.Serialization.XmlElementAttribute("creatives")] +Creative[] creatives) { + object[] results = this.Invoke("updateCreatives", new object[] { creatives }); + return ((Creative[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CreativePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Creative[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Creative[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VastRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnsupportedCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ThirdPartyCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TemplateCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InternalRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasDestinationUrlCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TextAdCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FloatingFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashPushdownCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashExpandableCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpMobileCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseVideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AspectRatioImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClickTrackingCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseRichMediaStudioCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasHtmlSnippetDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class Creative { + private long advertiserIdField; + + private bool advertiserIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private Size sizeField; + + private string previewUrlField; + + private AppliedLabel[] appliedLabelsField; + + private DateTime lastModifiedDateTimeField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private string creativeTypeField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { + this.advertiserIdField = value; + this.advertiserIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserIdSpecified { + get { return this.advertiserIdFieldSpecified; } + set { this.advertiserIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + public string previewUrl { + get { return this.previewUrlField; } + set { this.previewUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Creative.Type")] + public string CreativeType { + get { return this.creativeTypeField; } + set { this.creativeTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class VastRedirectCreative : Creative { + private string vastXmlUrlField; + + private VastRedirectType vastRedirectTypeField; + + private bool vastRedirectTypeFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + public string vastXmlUrl { + get { return this.vastXmlUrlField; } + set { this.vastXmlUrlField = value; } + } + + public VastRedirectType vastRedirectType { + get { return this.vastRedirectTypeField; } + set { + this.vastRedirectTypeField = value; + this.vastRedirectTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool vastRedirectTypeSpecified { + get { return this.vastRedirectTypeFieldSpecified; } + set { this.vastRedirectTypeFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum VastRedirectType { + LINEAR, + NON_LINEAR, + LINEAR_AND_NON_LINEAR + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ConversionEvent_TrackingUrlsMapEntry { + private ConversionEvent keyField; + + private bool keyFieldSpecified; + + private string[] valueField; + + public ConversionEvent key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("urls", IsNullable = false)] + public string[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum ConversionEvent { + CREATIVE_VIEW, + START, + SKIP_SHOWN, + FIRST_QUARTILE, + MIDPOINT, + THIRD_QUARTILE, + ENGAGED_VIEW, + COMPLETE, + MUTE, + UNMUTE, + PAUSE, + REWIND, + RESUME, + SKIPPED, + FULLSCREEN, + EXPAND, + COLLAPSE, + ACCEPT_INVITATION, + CLOSE, + CLICK_TRACKING, + SURVEY, + CUSTOM_CLICK + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class UnsupportedCreative : Creative { + private string unsupportedCreativeTypeField; + + public string unsupportedCreativeType { + get { return this.unsupportedCreativeTypeField; } + set { this.unsupportedCreativeTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ThirdPartyCreative : Creative { + private string snippetField; + + private string expandedSnippetField; + + public string snippet { + get { return this.snippetField; } + set { this.snippetField = value; } + } + + public string expandedSnippet { + get { return this.expandedSnippetField; } + set { this.expandedSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class TemplateCreative : Creative { + private long creativeTemplateIdField; + + private bool creativeTemplateIdFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + private BaseCreativeTemplateVariableValue[] creativeTemplateVariableValuesField; + + public long creativeTemplateId { + get { return this.creativeTemplateIdField; } + set { + this.creativeTemplateIdField = value; + this.creativeTemplateIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeTemplateIdSpecified { + get { return this.creativeTemplateIdFieldSpecified; } + set { this.creativeTemplateIdFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativeTemplateVariableValues")] + public BaseCreativeTemplateVariableValue[] creativeTemplateVariableValues { + get { return this.creativeTemplateVariableValuesField; } + set { this.creativeTemplateVariableValuesField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UrlCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetCreativeTemplateVariableValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class BaseCreativeTemplateVariableValue { + private string uniqueNameField; + + private string baseCreativeTemplateVariableValueTypeField; + + public string uniqueName { + get { return this.uniqueNameField; } + set { this.uniqueNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseCreativeTemplateVariableValue.Type")] + public string BaseCreativeTemplateVariableValueType { + get { return this.baseCreativeTemplateVariableValueTypeField; } + set { this.baseCreativeTemplateVariableValueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class UrlCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class StringCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class LongCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private long valueField; + + private bool valueFieldSpecified; + + public long value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AssetCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class LegacyDfpCreative : Creative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class InternalRedirectCreative : Creative { + private string internalRedirectUrlField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public string internalRedirectUrl { + get { return this.internalRedirectUrlField; } + set { this.internalRedirectUrlField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TextAdCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FloatingFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashPushdownCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashExpandableCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpMobileCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseVideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AspectRatioImageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class HasDestinationUrlCreative : Creative { + private string destinationUrlField; + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class VpaidLinearRedirectCreative : HasDestinationUrlCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + private string flashUrlField; + + private Size flashAssetSizeField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string flashUrl { + get { return this.flashUrlField; } + set { this.flashUrlField = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class VpaidLinearCreative : HasDestinationUrlCreative { + private string flashNameField; + + private byte[] flashByteArrayField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private Size flashAssetSizeField; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + public string flashName { + get { return this.flashNameField; } + set { this.flashNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] flashByteArray { + get { return this.flashByteArrayField; } + set { this.flashByteArrayField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class TextAdCreative : HasDestinationUrlCreative { + private string hoverTextField; + + private TargetWindow targetWindowField; + + private bool targetWindowFieldSpecified; + + private string linkColorField; + + private string linkTitleField; + + private string textField; + + private string textColorField; + + public string hoverText { + get { return this.hoverTextField; } + set { this.hoverTextField = value; } + } + + public TargetWindow targetWindow { + get { return this.targetWindowField; } + set { + this.targetWindowField = value; + this.targetWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetWindowSpecified { + get { return this.targetWindowFieldSpecified; } + set { this.targetWindowFieldSpecified = value; } + } + + public string linkColor { + get { return this.linkColorField; } + set { this.linkColorField = value; } + } + + public string linkTitle { + get { return this.linkTitleField; } + set { this.linkTitleField = value; } + } + + public string text { + get { return this.textField; } + set { this.textField = value; } + } + + public string textColor { + get { return this.textColorField; } + set { this.textColorField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum TargetWindow { + BLANK, + TOP + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class FloatingFlashCreative : HasDestinationUrlCreative { + private string flashNameField; + + private byte[] flashByteArrayField; + + private long flashAssetIdField; + + private bool flashAssetIdFieldSpecified; + + private string fallbackImageNameField; + + private byte[] fallbackImageByteArrayField; + + private long fallbackImageAssetIdField; + + private bool fallbackImageAssetIdFieldSpecified; + + private int requiredFlashVersionField; + + private bool requiredFlashVersionFieldSpecified; + + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + private string topPositionField; + + private string leftPositionField; + + private int displayTimeInSecondField; + + private bool displayTimeInSecondFieldSpecified; + + private string thirdPartyImpressionTrackerField; + + public string flashName { + get { return this.flashNameField; } + set { this.flashNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] flashByteArray { + get { return this.flashByteArrayField; } + set { this.flashByteArrayField = value; } + } + + public long flashAssetId { + get { return this.flashAssetIdField; } + set { + this.flashAssetIdField = value; + this.flashAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool flashAssetIdSpecified { + get { return this.flashAssetIdFieldSpecified; } + set { this.flashAssetIdFieldSpecified = value; } + } + + public string fallbackImageName { + get { return this.fallbackImageNameField; } + set { this.fallbackImageNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] fallbackImageByteArray { + get { return this.fallbackImageByteArrayField; } + set { this.fallbackImageByteArrayField = value; } + } + + public long fallbackImageAssetId { + get { return this.fallbackImageAssetIdField; } + set { + this.fallbackImageAssetIdField = value; + this.fallbackImageAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fallbackImageAssetIdSpecified { + get { return this.fallbackImageAssetIdFieldSpecified; } + set { this.fallbackImageAssetIdFieldSpecified = value; } + } + + public int requiredFlashVersion { + get { return this.requiredFlashVersionField; } + set { + this.requiredFlashVersionField = value; + this.requiredFlashVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool requiredFlashVersionSpecified { + get { return this.requiredFlashVersionFieldSpecified; } + set { this.requiredFlashVersionFieldSpecified = value; } + } + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + public string topPosition { + get { return this.topPositionField; } + set { this.topPositionField = value; } + } + + public string leftPosition { + get { return this.leftPositionField; } + set { this.leftPositionField = value; } + } + + public int displayTimeInSecond { + get { return this.displayTimeInSecondField; } + set { + this.displayTimeInSecondField = value; + this.displayTimeInSecondSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool displayTimeInSecondSpecified { + get { return this.displayTimeInSecondFieldSpecified; } + set { this.displayTimeInSecondFieldSpecified = value; } + } + + public string thirdPartyImpressionTracker { + get { return this.thirdPartyImpressionTrackerField; } + set { this.thirdPartyImpressionTrackerField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class FlashPushdownCreative : HasDestinationUrlCreative { + private long collapsedFlashAssetIdField; + + private bool collapsedFlashAssetIdFieldSpecified; + + private byte[] collapsedFlashAssetByteArrayField; + + private string collapsedFlashFileNameField; + + private long collapsedFallbackImageAssetIdField; + + private bool collapsedFallbackImageAssetIdFieldSpecified; + + private byte[] collapsedFallbackImageAssetByteArrayField; + + private string collapsedFallbackImageFileNameField; + + private long expandedFlashAssetIdField; + + private bool expandedFlashAssetIdFieldSpecified; + + private byte[] expandedFlashAssetByteArrayField; + + private string expandedFlashFileNameField; + + private int requiredFlashVersionField; + + private bool requiredFlashVersionFieldSpecified; + + private int widthField; + + private bool widthFieldSpecified; + + private int collapsedHeightField; + + private bool collapsedHeightFieldSpecified; + + private int expandedHeightField; + + private bool expandedHeightFieldSpecified; + + private bool pushdownOnMouseOverField; + + private bool pushdownOnMouseOverFieldSpecified; + + private string javascriptFunctionForPushdownField; + + private bool collapseOnMouseOutField; + + private bool collapseOnMouseOutFieldSpecified; + + private string javascriptFunctionForCollapseField; + + public long collapsedFlashAssetId { + get { return this.collapsedFlashAssetIdField; } + set { + this.collapsedFlashAssetIdField = value; + this.collapsedFlashAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapsedFlashAssetIdSpecified { + get { return this.collapsedFlashAssetIdFieldSpecified; } + set { this.collapsedFlashAssetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] collapsedFlashAssetByteArray { + get { return this.collapsedFlashAssetByteArrayField; } + set { this.collapsedFlashAssetByteArrayField = value; } + } + + public string collapsedFlashFileName { + get { return this.collapsedFlashFileNameField; } + set { this.collapsedFlashFileNameField = value; } + } + + public long collapsedFallbackImageAssetId { + get { return this.collapsedFallbackImageAssetIdField; } + set { + this.collapsedFallbackImageAssetIdField = value; + this.collapsedFallbackImageAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapsedFallbackImageAssetIdSpecified { + get { return this.collapsedFallbackImageAssetIdFieldSpecified; } + set { this.collapsedFallbackImageAssetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] collapsedFallbackImageAssetByteArray { + get { return this.collapsedFallbackImageAssetByteArrayField; } + set { this.collapsedFallbackImageAssetByteArrayField = value; } + } + + public string collapsedFallbackImageFileName { + get { return this.collapsedFallbackImageFileNameField; } + set { this.collapsedFallbackImageFileNameField = value; } + } + + public long expandedFlashAssetId { + get { return this.expandedFlashAssetIdField; } + set { + this.expandedFlashAssetIdField = value; + this.expandedFlashAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expandedFlashAssetIdSpecified { + get { return this.expandedFlashAssetIdFieldSpecified; } + set { this.expandedFlashAssetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] expandedFlashAssetByteArray { + get { return this.expandedFlashAssetByteArrayField; } + set { this.expandedFlashAssetByteArrayField = value; } + } + + public string expandedFlashFileName { + get { return this.expandedFlashFileNameField; } + set { this.expandedFlashFileNameField = value; } + } + + public int requiredFlashVersion { + get { return this.requiredFlashVersionField; } + set { + this.requiredFlashVersionField = value; + this.requiredFlashVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool requiredFlashVersionSpecified { + get { return this.requiredFlashVersionFieldSpecified; } + set { this.requiredFlashVersionFieldSpecified = value; } + } + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int collapsedHeight { + get { return this.collapsedHeightField; } + set { + this.collapsedHeightField = value; + this.collapsedHeightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapsedHeightSpecified { + get { return this.collapsedHeightFieldSpecified; } + set { this.collapsedHeightFieldSpecified = value; } + } + + public int expandedHeight { + get { return this.expandedHeightField; } + set { + this.expandedHeightField = value; + this.expandedHeightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expandedHeightSpecified { + get { return this.expandedHeightFieldSpecified; } + set { this.expandedHeightFieldSpecified = value; } + } + + public bool pushdownOnMouseOver { + get { return this.pushdownOnMouseOverField; } + set { + this.pushdownOnMouseOverField = value; + this.pushdownOnMouseOverSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool pushdownOnMouseOverSpecified { + get { return this.pushdownOnMouseOverFieldSpecified; } + set { this.pushdownOnMouseOverFieldSpecified = value; } + } + + public string javascriptFunctionForPushdown { + get { return this.javascriptFunctionForPushdownField; } + set { this.javascriptFunctionForPushdownField = value; } + } + + public bool collapseOnMouseOut { + get { return this.collapseOnMouseOutField; } + set { + this.collapseOnMouseOutField = value; + this.collapseOnMouseOutSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapseOnMouseOutSpecified { + get { return this.collapseOnMouseOutFieldSpecified; } + set { this.collapseOnMouseOutFieldSpecified = value; } + } + + public string javascriptFunctionForCollapse { + get { return this.javascriptFunctionForCollapseField; } + set { this.javascriptFunctionForCollapseField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class FlashExpandableCreative : HasDestinationUrlCreative { + private long collapsedFlashAssetIdField; + + private bool collapsedFlashAssetIdFieldSpecified; + + private byte[] collapsedFlashAssetByteArrayField; + + private string collapsedFlashFileNameField; + + private long collapsedFallbackImageAssetIdField; + + private bool collapsedFallbackImageAssetIdFieldSpecified; + + private byte[] collapsedFallbackImageAssetByteArrayField; + + private string collapsedFallbackImageFileNameField; + + private long expandedFlashAssetIdField; + + private bool expandedFlashAssetIdFieldSpecified; + + private byte[] expandedFlashAssetByteArrayField; + + private string expandedFlashFileNameField; + + private int requiredFlashVersionField; + + private bool requiredFlashVersionFieldSpecified; + + private int collapsedWidthField; + + private bool collapsedWidthFieldSpecified; + + private int collapsedHeightField; + + private bool collapsedHeightFieldSpecified; + + private int expandedWidthField; + + private bool expandedWidthFieldSpecified; + + private int expandedHeightField; + + private bool expandedHeightFieldSpecified; + + private FlashExpandableCreativeExpandDirection expandDirectionField; + + private bool expandDirectionFieldSpecified; + + private bool expandOnMouseOverField; + + private bool expandOnMouseOverFieldSpecified; + + private string javascriptFunctionForExpandField; + + private bool collapseOnMouseOutField; + + private bool collapseOnMouseOutFieldSpecified; + + private string javascriptFunctionForCollapseField; + + public long collapsedFlashAssetId { + get { return this.collapsedFlashAssetIdField; } + set { + this.collapsedFlashAssetIdField = value; + this.collapsedFlashAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapsedFlashAssetIdSpecified { + get { return this.collapsedFlashAssetIdFieldSpecified; } + set { this.collapsedFlashAssetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] collapsedFlashAssetByteArray { + get { return this.collapsedFlashAssetByteArrayField; } + set { this.collapsedFlashAssetByteArrayField = value; } + } + + public string collapsedFlashFileName { + get { return this.collapsedFlashFileNameField; } + set { this.collapsedFlashFileNameField = value; } + } + + public long collapsedFallbackImageAssetId { + get { return this.collapsedFallbackImageAssetIdField; } + set { + this.collapsedFallbackImageAssetIdField = value; + this.collapsedFallbackImageAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapsedFallbackImageAssetIdSpecified { + get { return this.collapsedFallbackImageAssetIdFieldSpecified; } + set { this.collapsedFallbackImageAssetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] collapsedFallbackImageAssetByteArray { + get { return this.collapsedFallbackImageAssetByteArrayField; } + set { this.collapsedFallbackImageAssetByteArrayField = value; } + } + + public string collapsedFallbackImageFileName { + get { return this.collapsedFallbackImageFileNameField; } + set { this.collapsedFallbackImageFileNameField = value; } + } + + public long expandedFlashAssetId { + get { return this.expandedFlashAssetIdField; } + set { + this.expandedFlashAssetIdField = value; + this.expandedFlashAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expandedFlashAssetIdSpecified { + get { return this.expandedFlashAssetIdFieldSpecified; } + set { this.expandedFlashAssetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] expandedFlashAssetByteArray { + get { return this.expandedFlashAssetByteArrayField; } + set { this.expandedFlashAssetByteArrayField = value; } + } + + public string expandedFlashFileName { + get { return this.expandedFlashFileNameField; } + set { this.expandedFlashFileNameField = value; } + } + + public int requiredFlashVersion { + get { return this.requiredFlashVersionField; } + set { + this.requiredFlashVersionField = value; + this.requiredFlashVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool requiredFlashVersionSpecified { + get { return this.requiredFlashVersionFieldSpecified; } + set { this.requiredFlashVersionFieldSpecified = value; } + } + + public int collapsedWidth { + get { return this.collapsedWidthField; } + set { + this.collapsedWidthField = value; + this.collapsedWidthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapsedWidthSpecified { + get { return this.collapsedWidthFieldSpecified; } + set { this.collapsedWidthFieldSpecified = value; } + } + + public int collapsedHeight { + get { return this.collapsedHeightField; } + set { + this.collapsedHeightField = value; + this.collapsedHeightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapsedHeightSpecified { + get { return this.collapsedHeightFieldSpecified; } + set { this.collapsedHeightFieldSpecified = value; } + } + + public int expandedWidth { + get { return this.expandedWidthField; } + set { + this.expandedWidthField = value; + this.expandedWidthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expandedWidthSpecified { + get { return this.expandedWidthFieldSpecified; } + set { this.expandedWidthFieldSpecified = value; } + } + + public int expandedHeight { + get { return this.expandedHeightField; } + set { + this.expandedHeightField = value; + this.expandedHeightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expandedHeightSpecified { + get { return this.expandedHeightFieldSpecified; } + set { this.expandedHeightFieldSpecified = value; } + } + + public FlashExpandableCreativeExpandDirection expandDirection { + get { return this.expandDirectionField; } + set { + this.expandDirectionField = value; + this.expandDirectionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expandDirectionSpecified { + get { return this.expandDirectionFieldSpecified; } + set { this.expandDirectionFieldSpecified = value; } + } + + public bool expandOnMouseOver { + get { return this.expandOnMouseOverField; } + set { + this.expandOnMouseOverField = value; + this.expandOnMouseOverSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expandOnMouseOverSpecified { + get { return this.expandOnMouseOverFieldSpecified; } + set { this.expandOnMouseOverFieldSpecified = value; } + } + + public string javascriptFunctionForExpand { + get { return this.javascriptFunctionForExpandField; } + set { this.javascriptFunctionForExpandField = value; } + } + + public bool collapseOnMouseOut { + get { return this.collapseOnMouseOutField; } + set { + this.collapseOnMouseOutField = value; + this.collapseOnMouseOutSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapseOnMouseOutSpecified { + get { return this.collapseOnMouseOutFieldSpecified; } + set { this.collapseOnMouseOutFieldSpecified = value; } + } + + public string javascriptFunctionForCollapse { + get { return this.javascriptFunctionForCollapseField; } + set { this.javascriptFunctionForCollapseField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FlashExpandableCreative.ExpandDirection", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum FlashExpandableCreativeExpandDirection { + LEFT, + RIGHT, + UP, + DOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class LegacyDfpMobileCreative : HasDestinationUrlCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CustomCreative : HasDestinationUrlCreative { + private string htmlSnippetField; + + private CustomCreativeAsset[] customCreativeAssetsField; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public string htmlSnippet { + get { return this.htmlSnippetField; } + set { this.htmlSnippetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customCreativeAssets")] + public CustomCreativeAsset[] customCreativeAssets { + get { return this.customCreativeAssetsField; } + set { this.customCreativeAssetsField = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CustomCreativeAsset { + private string macroNameField; + + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + private long fileSizeField; + + private bool fileSizeFieldSpecified; + + public string macroName { + get { return this.macroNameField; } + set { this.macroNameField = value; } + } + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public long fileSize { + get { return this.fileSizeField; } + set { + this.fileSizeField = value; + this.fileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fileSizeSpecified { + get { return this.fileSizeFieldSpecified; } + set { this.fileSizeFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class BaseVideoCreative : HasDestinationUrlCreative { + private int durationField; + + private bool durationFieldSpecified; + + private bool allowDurationOverrideField; + + private bool allowDurationOverrideFieldSpecified; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private long[] companionCreativeIdsField; + + private string customParametersField; + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public bool allowDurationOverride { + get { return this.allowDurationOverrideField; } + set { + this.allowDurationOverrideField = value; + this.allowDurationOverrideSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowDurationOverrideSpecified { + get { return this.allowDurationOverrideFieldSpecified; } + set { this.allowDurationOverrideFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class VideoRedirectCreative : BaseVideoCreative { + private VideoRedirectAsset[] videoAssetsField; + + [System.Xml.Serialization.XmlElementAttribute("videoAssets")] + public VideoRedirectAsset[] videoAssets { + get { return this.videoAssetsField; } + set { this.videoAssetsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class VideoRedirectAsset : RedirectAsset { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class RedirectAsset : Asset { + private string redirectUrlField; + + public string redirectUrl { + get { return this.redirectUrlField; } + set { this.redirectUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RedirectAsset))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class Asset { + private string assetTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Asset.Type")] + public string AssetType { + get { return this.assetTypeField; } + set { this.assetTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class VideoCreative : BaseVideoCreative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class BaseImageRedirectCreative : HasDestinationUrlCreative { + private string imageUrlField; + + public string imageUrl { + get { return this.imageUrlField; } + set { this.imageUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ImageRedirectOverlayCreative : BaseImageRedirectCreative { + private Size assetSizeField; + + private int durationField; + + private bool durationFieldSpecified; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + public Size assetSize { + get { return this.assetSizeField; } + set { this.assetSizeField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ImageRedirectCreative : BaseImageRedirectCreative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class BaseImageCreative : HasDestinationUrlCreative { + private string imageNameField; + + private byte[] imageByteArrayField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private Size assetSizeField; + + private string imageUrlField; + + public string imageName { + get { return this.imageNameField; } + set { this.imageNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] imageByteArray { + get { return this.imageByteArrayField; } + set { this.imageByteArrayField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public Size assetSize { + get { return this.assetSizeField; } + set { this.assetSizeField = value; } + } + + public string imageUrl { + get { return this.imageUrlField; } + set { this.imageUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ImageOverlayCreative : BaseImageCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ImageCreative : BaseImageCreative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class BaseFlashRedirectCreative : HasDestinationUrlCreative { + private string flashUrlField; + + private string fallbackUrlField; + + private string fallbackPreviewUrlField; + + public string flashUrl { + get { return this.flashUrlField; } + set { this.flashUrlField = value; } + } + + public string fallbackUrl { + get { return this.fallbackUrlField; } + set { this.fallbackUrlField = value; } + } + + public string fallbackPreviewUrl { + get { return this.fallbackPreviewUrlField; } + set { this.fallbackPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class FlashRedirectOverlayCreative : BaseFlashRedirectCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private ApiFramework apiFrameworkField; + + private bool apiFrameworkFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + private Size flashAssetSizeField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public ApiFramework apiFramework { + get { return this.apiFrameworkField; } + set { + this.apiFrameworkField = value; + this.apiFrameworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool apiFrameworkSpecified { + get { return this.apiFrameworkFieldSpecified; } + set { this.apiFrameworkFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum ApiFramework { + NONE, + CLICKTAG, + VPAID + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class FlashRedirectCreative : BaseFlashRedirectCreative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class BaseFlashCreative : HasDestinationUrlCreative { + private string flashNameField; + + private byte[] flashByteArrayField; + + private string fallbackImageNameField; + + private byte[] fallbackImageByteArrayField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private bool clickTagRequiredField; + + private bool clickTagRequiredFieldSpecified; + + private string fallbackPreviewUrlField; + + private Size flashAssetSizeField; + + private Size fallbackAssetSizeField; + + public string flashName { + get { return this.flashNameField; } + set { this.flashNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] flashByteArray { + get { return this.flashByteArrayField; } + set { this.flashByteArrayField = value; } + } + + public string fallbackImageName { + get { return this.fallbackImageNameField; } + set { this.fallbackImageNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] fallbackImageByteArray { + get { return this.fallbackImageByteArrayField; } + set { this.fallbackImageByteArrayField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public bool clickTagRequired { + get { return this.clickTagRequiredField; } + set { + this.clickTagRequiredField = value; + this.clickTagRequiredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clickTagRequiredSpecified { + get { return this.clickTagRequiredFieldSpecified; } + set { this.clickTagRequiredFieldSpecified = value; } + } + + public string fallbackPreviewUrl { + get { return this.fallbackPreviewUrlField; } + set { this.fallbackPreviewUrlField = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + public Size fallbackAssetSize { + get { return this.fallbackAssetSizeField; } + set { this.fallbackAssetSizeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class FlashOverlayCreative : BaseFlashCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private ApiFramework apiFrameworkField; + + private bool apiFrameworkFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public ApiFramework apiFramework { + get { return this.apiFrameworkField; } + set { + this.apiFrameworkField = value; + this.apiFrameworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool apiFrameworkSpecified { + get { return this.apiFrameworkFieldSpecified; } + set { this.apiFrameworkFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class FlashCreative : BaseFlashCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AspectRatioImageCreative : HasDestinationUrlCreative { + private CreativeAsset[] imageAssetsField; + + private string fallbackTextField; + + [System.Xml.Serialization.XmlElementAttribute("imageAssets")] + public CreativeAsset[] imageAssets { + get { return this.imageAssetsField; } + set { this.imageAssetsField = value; } + } + + public string fallbackText { + get { return this.fallbackTextField; } + set { this.fallbackTextField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class CreativeAsset { + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + private long fileSizeField; + + private bool fileSizeFieldSpecified; + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public long fileSize { + get { return this.fileSizeField; } + set { + this.fileSizeField = value; + this.fileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fileSizeSpecified { + get { return this.fileSizeFieldSpecified; } + set { this.fileSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ClickTrackingCreative : Creative { + private string clickTrackingUrlField; + + public string clickTrackingUrl { + get { return this.clickTrackingUrlField; } + set { this.clickTrackingUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class BaseRichMediaStudioCreative : Creative { + private long studioCreativeIdField; + + private bool studioCreativeIdFieldSpecified; + + private RichMediaStudioCreativeFormat creativeFormatField; + + private bool creativeFormatFieldSpecified; + + private RichMediaStudioCreativeArtworkType artworkTypeField; + + private bool artworkTypeFieldSpecified; + + private long totalFileSizeField; + + private bool totalFileSizeFieldSpecified; + + private string[] adTagKeysField; + + private string[] customKeyValuesField; + + private string surveyUrlField; + + private string allImpressionsUrlField; + + private string richMediaImpressionsUrlField; + + private string backupImageImpressionsUrlField; + + private string overrideCssField; + + private string requiredFlashPluginVersionField; + + private int durationField; + + private bool durationFieldSpecified; + + private RichMediaStudioCreativeBillingAttribute billingAttributeField; + + private bool billingAttributeFieldSpecified; + + private RichMediaStudioChildAssetProperty[] richMediaStudioChildAssetPropertiesField; + + public long studioCreativeId { + get { return this.studioCreativeIdField; } + set { + this.studioCreativeIdField = value; + this.studioCreativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool studioCreativeIdSpecified { + get { return this.studioCreativeIdFieldSpecified; } + set { this.studioCreativeIdFieldSpecified = value; } + } + + public RichMediaStudioCreativeFormat creativeFormat { + get { return this.creativeFormatField; } + set { + this.creativeFormatField = value; + this.creativeFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeFormatSpecified { + get { return this.creativeFormatFieldSpecified; } + set { this.creativeFormatFieldSpecified = value; } + } + + public RichMediaStudioCreativeArtworkType artworkType { + get { return this.artworkTypeField; } + set { + this.artworkTypeField = value; + this.artworkTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool artworkTypeSpecified { + get { return this.artworkTypeFieldSpecified; } + set { this.artworkTypeFieldSpecified = value; } + } + + public long totalFileSize { + get { return this.totalFileSizeField; } + set { + this.totalFileSizeField = value; + this.totalFileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalFileSizeSpecified { + get { return this.totalFileSizeFieldSpecified; } + set { this.totalFileSizeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adTagKeys")] + public string[] adTagKeys { + get { return this.adTagKeysField; } + set { this.adTagKeysField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customKeyValues")] + public string[] customKeyValues { + get { return this.customKeyValuesField; } + set { this.customKeyValuesField = value; } + } + + public string surveyUrl { + get { return this.surveyUrlField; } + set { this.surveyUrlField = value; } + } + + public string allImpressionsUrl { + get { return this.allImpressionsUrlField; } + set { this.allImpressionsUrlField = value; } + } + + public string richMediaImpressionsUrl { + get { return this.richMediaImpressionsUrlField; } + set { this.richMediaImpressionsUrlField = value; } + } + + public string backupImageImpressionsUrl { + get { return this.backupImageImpressionsUrlField; } + set { this.backupImageImpressionsUrlField = value; } + } + + public string overrideCss { + get { return this.overrideCssField; } + set { this.overrideCssField = value; } + } + + public string requiredFlashPluginVersion { + get { return this.requiredFlashPluginVersionField; } + set { this.requiredFlashPluginVersionField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public RichMediaStudioCreativeBillingAttribute billingAttribute { + get { return this.billingAttributeField; } + set { + this.billingAttributeField = value; + this.billingAttributeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingAttributeSpecified { + get { return this.billingAttributeFieldSpecified; } + set { this.billingAttributeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("richMediaStudioChildAssetProperties")] + public RichMediaStudioChildAssetProperty[] richMediaStudioChildAssetProperties { + get { return this.richMediaStudioChildAssetPropertiesField; } + set { this.richMediaStudioChildAssetPropertiesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum RichMediaStudioCreativeFormat { + IN_PAGE, + EXPANDING, + IM_EXPANDING, + FLOATING, + PEEL_DOWN, + IN_PAGE_WITH_FLOATING, + FLASH_IN_FLASH, + FLASH_IN_FLASH_EXPANDING, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum RichMediaStudioCreativeArtworkType { + FLASH, + HTML5, + MIXED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum RichMediaStudioCreativeBillingAttribute { + IN_PAGE, + FLOATING_EXPANDING, + VIDEO, + FLASH_IN_FLASH + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class RichMediaStudioChildAssetProperty { + private string nameField; + + private RichMediaStudioChildAssetPropertyType typeField; + + private bool typeFieldSpecified; + + private long totalFileSizeField; + + private bool totalFileSizeFieldSpecified; + + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + private string urlField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public RichMediaStudioChildAssetPropertyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public long totalFileSize { + get { return this.totalFileSizeField; } + set { + this.totalFileSizeField = value; + this.totalFileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalFileSizeSpecified { + get { return this.totalFileSizeFieldSpecified; } + set { this.totalFileSizeFieldSpecified = value; } + } + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaStudioChildAssetProperty.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public enum RichMediaStudioChildAssetPropertyType { + FLASH, + VIDEO, + IMAGE, + DATA + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class RichMediaStudioCreative : BaseRichMediaStudioCreative { + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasHtmlSnippetDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class BaseDynamicAllocationCreative : Creative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class HasHtmlSnippetDynamicAllocationCreative : BaseDynamicAllocationCreative { + private string codeSnippetField; + + public string codeSnippet { + get { return this.codeSnippetField; } + set { this.codeSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AdSenseCreative : HasHtmlSnippetDynamicAllocationCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class AdExchangeCreative : HasHtmlSnippetDynamicAllocationCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LineItemServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LineItemService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LineItemService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201211/LineItemService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItem createLineItem(LineItem lineItem) { + object[] results = this.Invoke("createLineItem", new object[] { lineItem }); + return ((LineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItem[] createLineItems([System.Xml.Serialization.XmlElementAttribute("lineItems")] +LineItem[] lineItems) { + object[] results = this.Invoke("createLineItems", new object[] { lineItems }); + return ((LineItem[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItem getLineItem(long lineItemId) { + object[] results = this.Invoke("getLineItem", new object[] { lineItemId }); + return ((LineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItemPage getLineItemsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLineItemsByStatement", new object[] { filterStatement }); + return ((LineItemPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performLineItemAction(LineItemAction lineItemAction, Statement filterStatement) { + object[] results = this.Invoke("performLineItemAction", new object[] { lineItemAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItem updateLineItem(LineItem lineItem) { + object[] results = this.Invoke("updateLineItem", new object[] { lineItem }); + return ((LineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201211", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201211", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItem[] updateLineItems([System.Xml.Serialization.XmlElementAttribute("lineItems")] +LineItem[] lineItems) { + object[] results = this.Invoke("updateLineItems", new object[] { lineItems }); + return ((LineItem[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveAndOverbookLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReleaseLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PauseLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public abstract partial class LineItemAction { + private string lineItemActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LineItemAction.Type")] + public string LineItemActionType { + get { return this.lineItemActionTypeField; } + set { this.lineItemActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class UnarchiveLineItems : LineItemAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ResumeLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ResumeAndOverbookLineItems : ResumeLineItems { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveAndOverbookLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ReserveLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ReserveAndOverbookLineItems : ReserveLineItems { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ReleaseLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class PauseLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class DeleteLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ArchiveLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class ActivateLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201211")] + public partial class LineItemPage { + private int totalResultSetSizeField; + private bool totalResultSetSizeFieldSpecified; + private int startIndexField; + private bool startIndexFieldSpecified; + private LineItem[] resultsField; + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + [System.Xml.Serialization.XmlElementAttribute("results")] + public LineItem[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } +} diff --git a/src/Dfp/v201211/DfpServiceV201211.cs b/src/Dfp/v201211/DfpServiceV201211.cs new file mode 100644 index 00000000000..ccb1660a0d5 --- /dev/null +++ b/src/Dfp/v201211/DfpServiceV201211.cs @@ -0,0 +1,220 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Reflection; + +namespace Google.Api.Ads.Dfp.Lib { + /// + /// Lists all the services available through this library. + /// + public partial class DfpService : AdsService { + /// + /// All the services available in v201211. + /// + public class v201211 { + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AudienceSegmentService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CompanyService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ContentService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeSetService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeTemplateService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeWrapperService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomFieldService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomTargetingService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ForecastService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature InventoryService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LabelService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LineItemService; + + /// + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LineItemCreativeAssociationService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature NetworkService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature OrderService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature PlacementService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature PublisherQueryLanguageService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReportService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SuggestedAdUnitService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature TeamService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ThirdPartySlotService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature UserService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature UserTeamAssociationService; + + /// + /// Factory type for v201211 services. + /// + public static readonly Type factoryType = typeof(DfpServiceFactory); + + /// + /// Static constructor to initialize the service constants. + /// + static v201211() { + AudienceSegmentService = DfpService.MakeServiceSignature("v201211", + "AudienceSegmentService"); + CompanyService = DfpService.MakeServiceSignature("v201211", "CompanyService"); + ContentService = DfpService.MakeServiceSignature("v201211", "ContentService"); + CreativeService = DfpService.MakeServiceSignature("v201211", "CreativeService"); + CreativeSetService = DfpService.MakeServiceSignature("v201211", "CreativeSetService"); + CreativeTemplateService = DfpService.MakeServiceSignature("v201211", + "CreativeTemplateService"); + CreativeWrapperService = DfpService.MakeServiceSignature("v201211", + "CreativeWrapperService"); + CustomTargetingService = DfpService.MakeServiceSignature("v201211", + "CustomTargetingService"); + CustomFieldService = DfpService.MakeServiceSignature("v201211", + "CustomFieldService"); + ForecastService = DfpService.MakeServiceSignature("v201211", "ForecastService"); + InventoryService = DfpService.MakeServiceSignature("v201211", "InventoryService"); + LabelService = DfpService.MakeServiceSignature("v201211", "LabelService"); + LineItemService = DfpService.MakeServiceSignature("v201211", "LineItemService"); + LineItemCreativeAssociationService = + DfpService.MakeServiceSignature("v201211", "LineItemCreativeAssociationService"); + NetworkService = DfpService.MakeServiceSignature("v201211", "NetworkService"); + OrderService = DfpService.MakeServiceSignature("v201211", "OrderService"); + PlacementService = DfpService.MakeServiceSignature("v201211", "PlacementService"); + PublisherQueryLanguageService = DfpService.MakeServiceSignature("v201211", + "PublisherQueryLanguageService"); + ReportService = DfpService.MakeServiceSignature("v201211", "ReportService"); + SuggestedAdUnitService = DfpService.MakeServiceSignature("v201211", + "SuggestedAdUnitService"); + TeamService = DfpService.MakeServiceSignature("v201211", "TeamService"); + ThirdPartySlotService = DfpService.MakeServiceSignature("v201211", + "ThirdPartySlotService"); + UserService = DfpService.MakeServiceSignature("v201211", "UserService"); + UserTeamAssociationService = DfpService.MakeServiceSignature("v201211", + "UserTeamAssociationService"); + } + } + } +} diff --git a/src/Dfp/v201302/DfpApi.cs b/src/Dfp/v201302/DfpApi.cs new file mode 100644 index 00000000000..b71bddd09b7 --- /dev/null +++ b/src/Dfp/v201302/DfpApi.cs @@ -0,0 +1,19273 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +namespace Google.Api.Ads.Dfp.v201302 { + using Google.Api.Ads.Dfp.Lib; + using Google.Api.Ads.Dfp.Headers; + using System; + using System.Web.Services; + using System.Diagnostics; + using System.Web.Services.Protocols; + using System.Xml.Serialization; + using System.ComponentModel; + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AudienceSegmentServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AudienceSegmentService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AudienceSegmentService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/AudienceSegmentService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AudienceSegmentPage getAudienceSegmentsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAudienceSegmentsByStatement", new object[] { filterStatement }); + return ((AudienceSegmentPage) (results[0])); + } + } + + + + + + + + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AudienceSegment { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private AudienceSegmentStatus statusField; + + private bool statusFieldSpecified; + + private long sizeField; + + private bool sizeFieldSpecified; + + private string audienceSegmentTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public AudienceSegmentStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public long size { + get { return this.sizeField; } + set { + this.sizeField = value; + this.sizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sizeSpecified { + get { return this.sizeFieldSpecified; } + set { this.sizeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("AudienceSegment.Type")] + public string AudienceSegmentType { + get { return this.audienceSegmentTypeField; } + set { this.audienceSegmentTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegment.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AudienceSegmentStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AudienceSegmentPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AudienceSegment[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AudienceSegment[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Date { + private int yearField; + + private bool yearFieldSpecified; + + private int monthField; + + private bool monthFieldSpecified; + + private int dayField; + + private bool dayFieldSpecified; + + public int year { + get { return this.yearField; } + set { + this.yearField = value; + this.yearSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool yearSpecified { + get { return this.yearFieldSpecified; } + set { this.yearFieldSpecified = value; } + } + + public int month { + get { return this.monthField; } + set { + this.monthField = value; + this.monthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool monthSpecified { + get { return this.monthFieldSpecified; } + set { this.monthFieldSpecified = value; } + } + + public int day { + get { return this.dayField; } + set { + this.dayField = value; + this.daySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool daySpecified { + get { return this.dayFieldSpecified; } + set { this.dayFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DateTime { + private Date dateField; + + private int hourField; + + private bool hourFieldSpecified; + + private int minuteField; + + private bool minuteFieldSpecified; + + private int secondField; + + private bool secondFieldSpecified; + + private string timeZoneIDField; + + public Date date { + get { return this.dateField; } + set { this.dateField = value; } + } + + public int hour { + get { return this.hourField; } + set { + this.hourField = value; + this.hourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hourSpecified { + get { return this.hourFieldSpecified; } + set { this.hourFieldSpecified = value; } + } + + public int minute { + get { return this.minuteField; } + set { + this.minuteField = value; + this.minuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minuteSpecified { + get { return this.minuteFieldSpecified; } + set { this.minuteFieldSpecified = value; } + } + + public int second { + get { return this.secondField; } + set { + this.secondField = value; + this.secondSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool secondSpecified { + get { return this.secondFieldSpecified; } + set { this.secondFieldSpecified = value; } + } + + public string timeZoneID { + get { return this.timeZoneIDField; } + set { this.timeZoneIDField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TextValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NumberValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateTimeValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BooleanValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class Value { + private string valueTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Value.Type")] + public string ValueType { + get { return this.valueTypeField; } + set { this.valueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class TextValue : Value { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class NumberValue : Value { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DateTimeValue : Value { + private DateTime valueField; + + public DateTime value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class BooleanValue : Value { + private bool valueField; + + private bool valueFieldSpecified; + + public bool value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class String_ValueMapEntry { + private string keyField; + + private Value valueField; + + public string key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public Value value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Statement { + private string queryField; + + private String_ValueMapEntry[] valuesField; + + public string query { + get { return this.queryField; } + set { this.queryField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("values")] + public String_ValueMapEntry[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StatementError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServerError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(QuotaError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PublisherQueryLanguageSyntaxError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PublisherQueryLanguageContextError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PermissionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NotNullError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InternalApiError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeatureError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CommonError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AuthenticationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApiVersionError))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserDomainTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UniqueError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TypeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TechnologyTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TeamError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringLengthError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReservationDetailsError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredSizeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredNumberError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredCollectionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RangeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ParseError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OrderError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NullError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemOperationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemFlightDateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemCreativeAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LabelEntityAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidUrlError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GeoTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GenericTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FrequencyCapError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ForecastError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EntityLimitReachedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DayPartTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateTimeRangeTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldValueError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CompanyCreditStatusError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClickTrackingLineItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceExtensionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentPartnerError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PoddingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRuleSlotError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRulePriorityError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRuleFrequencyCapError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRuleDateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RegExError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TemplateInstantiatedCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidPhoneNumberError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FileError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeSetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeAssetMacroError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitCodeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitAfcSizeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidEmailError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivityError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OrderActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemCreativeAssociationOperationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseAccountError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeTemplateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CompanyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LabelError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeWrapperError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitTypeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitSizesError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitPartnerAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidColorError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitHierarchyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReportError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContactError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldError))] + public abstract partial class ApiError { + private string fieldPathField; + + private string triggerField; + + private string errorStringField; + + private string apiErrorTypeField; + + public string fieldPath { + get { return this.fieldPathField; } + set { this.fieldPathField = value; } + } + + public string trigger { + get { return this.triggerField; } + set { this.triggerField = value; } + } + + public string errorString { + get { return this.errorStringField; } + set { this.errorStringField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApiError.Type")] + public string ApiErrorType { + get { return this.apiErrorTypeField; } + set { this.apiErrorTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class StatementError : ApiError { + private StatementErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StatementErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StatementError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum StatementErrorReason { + VARIABLE_NOT_BOUND_TO_VALUE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ServerError : ApiError { + private ServerErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ServerErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ServerError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ServerErrorReason { + SERVER_ERROR, + SERVER_BUSY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class RequiredError : ApiError { + private RequiredErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum RequiredErrorReason { + REQUIRED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class QuotaError : ApiError { + private QuotaErrorReason reasonField; + + private bool reasonFieldSpecified; + + public QuotaErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "QuotaError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum QuotaErrorReason { + EXCEEDED_QUOTA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class PublisherQueryLanguageSyntaxError : ApiError { + private PublisherQueryLanguageSyntaxErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PublisherQueryLanguageSyntaxErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PublisherQueryLanguageSyntaxError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum PublisherQueryLanguageSyntaxErrorReason { + UNPARSABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class PublisherQueryLanguageContextError : ApiError { + private PublisherQueryLanguageContextErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PublisherQueryLanguageContextErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PublisherQueryLanguageContextError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum PublisherQueryLanguageContextErrorReason { + UNEXECUTABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class PermissionError : ApiError { + private PermissionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PermissionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PermissionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum PermissionErrorReason { + PERMISSION_DENIED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class NotNullError : ApiError { + private NotNullErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NotNullErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NotNullError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum NotNullErrorReason { + ARG1_NULL, + ARG2_NULL, + ARG3_NULL, + NULL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class InternalApiError : ApiError { + private InternalApiErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InternalApiErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InternalApiError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum InternalApiErrorReason { + UNEXPECTED_INTERNAL_API_ERROR, + UNKNOWN, + DOWNTIME + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class FeatureError : ApiError { + private FeatureErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FeatureErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeatureError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum FeatureErrorReason { + MISSING_FEATURE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CommonError : ApiError { + private CommonErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CommonErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CommonError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CommonErrorReason { + NOT_FOUND, + ALREADY_EXISTS, + DUPLICATE_OBJECT, + CANNOT_UPDATE, + CONCURRENT_MODIFICATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AuthenticationError : ApiError { + private AuthenticationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AuthenticationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AuthenticationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AuthenticationErrorReason { + AMBIGUOUS_SOAP_REQUEST_HEADER, + INVALID_EMAIL, + AUTHENTICATION_FAILED, + INVALID_OAUTH_SIGNATURE, + INVALID_SERVICE, + MISSING_SOAP_REQUEST_HEADER, + MISSING_AUTHENTICATION_HTTP_HEADER, + MISSING_AUTHENTICATION, + NOT_WHITELISTED_FOR_API_ACCESS, + NO_NETWORKS_TO_ACCESS, + NETWORK_NOT_FOUND, + NETWORK_CODE_REQUIRED, + CONNECTION_ERROR, + GOOGLE_ACCOUNT_ALREADY_ASSOCIATED_WITH_NETWORK, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ApiVersionError : ApiError { + private ApiVersionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ApiVersionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ApiVersionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ApiVersionErrorReason { + UPDATE_TO_NEWER_VERSION, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApiException))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ApplicationException { + private string messageField; + + private string applicationExceptionTypeField; + + public string message { + get { return this.messageField; } + set { this.messageField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApplicationException.Type")] + public string ApplicationExceptionType { + get { return this.applicationExceptionTypeField; } + set { this.applicationExceptionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ApiException : ApplicationException { + private ApiError[] errorsField; + + [System.Xml.Serialization.XmlElementAttribute("errors")] + public ApiError[] errors { + get { return this.errorsField; } + set { this.errorsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OAuth))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClientLogin))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class Authentication { + private string authenticationTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Authentication.Type")] + public string AuthenticationType { + get { return this.authenticationTypeField; } + set { this.authenticationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class OAuth : Authentication { + private string parametersField; + + public string parameters { + get { return this.parametersField; } + set { this.parametersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ClientLogin : Authentication { + private string tokenField; + + public string token { + get { return this.tokenField; } + set { this.tokenField = value; } + } + } + + + + + + + + + + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LineItemServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LineItemService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LineItemService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/LineItemService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItem createLineItem(LineItem lineItem) { + object[] results = this.Invoke("createLineItem", new object[] { lineItem }); + return ((LineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItem[] createLineItems([System.Xml.Serialization.XmlElementAttribute("lineItems")] +LineItem[] lineItems) { + object[] results = this.Invoke("createLineItems", new object[] { lineItems }); + return ((LineItem[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItem getLineItem(long lineItemId) { + object[] results = this.Invoke("getLineItem", new object[] { lineItemId }); + return ((LineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItemPage getLineItemsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLineItemsByStatement", new object[] { filterStatement }); + return ((LineItemPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performLineItemAction(LineItemAction lineItemAction, Statement filterStatement) { + object[] results = this.Invoke("performLineItemAction", new object[] { lineItemAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItem updateLineItem(LineItem lineItem) { + object[] results = this.Invoke("updateLineItem", new object[] { lineItem }); + return ((LineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItem[] updateLineItems([System.Xml.Serialization.XmlElementAttribute("lineItems")] +LineItem[] lineItems) { + object[] results = this.Invoke("updateLineItems", new object[] { lineItems }); + return ((LineItem[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class UpdateResult { + private int numChangesField; + + private bool numChangesFieldSpecified; + + public int numChanges { + get { return this.numChangesField; } + set { + this.numChangesField = value; + this.numChangesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numChangesSpecified { + get { return this.numChangesFieldSpecified; } + set { this.numChangesFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveAndOverbookLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReleaseLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PauseLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class LineItemAction { + private string lineItemActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LineItemAction.Type")] + public string LineItemActionType { + get { return this.lineItemActionTypeField; } + set { this.lineItemActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class UnarchiveLineItems : LineItemAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ResumeLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ResumeAndOverbookLineItems : ResumeLineItems { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveAndOverbookLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ReserveLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ReserveAndOverbookLineItems : ReserveLineItems { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ReleaseLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class PauseLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DeleteLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ArchiveLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ActivateLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class LineItemPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LineItem[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LineItem[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class LineItem : LineItemSummary { + private Targeting targetingField; + + public Targeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Targeting { + private GeoTargeting geoTargetingField; + + private InventoryTargeting inventoryTargetingField; + + private DayPartTargeting dayPartTargetingField; + + private TechnologyTargeting technologyTargetingField; + + private CustomCriteriaSet customTargetingField; + + private UserDomainTargeting userDomainTargetingField; + + private ContentTargeting contentTargetingField; + + private VideoPositionTargeting videoPositionTargetingField; + + public GeoTargeting geoTargeting { + get { return this.geoTargetingField; } + set { this.geoTargetingField = value; } + } + + public InventoryTargeting inventoryTargeting { + get { return this.inventoryTargetingField; } + set { this.inventoryTargetingField = value; } + } + + public DayPartTargeting dayPartTargeting { + get { return this.dayPartTargetingField; } + set { this.dayPartTargetingField = value; } + } + + public TechnologyTargeting technologyTargeting { + get { return this.technologyTargetingField; } + set { this.technologyTargetingField = value; } + } + + public CustomCriteriaSet customTargeting { + get { return this.customTargetingField; } + set { this.customTargetingField = value; } + } + + public UserDomainTargeting userDomainTargeting { + get { return this.userDomainTargetingField; } + set { this.userDomainTargetingField = value; } + } + + public ContentTargeting contentTargeting { + get { return this.contentTargetingField; } + set { this.contentTargetingField = value; } + } + + public VideoPositionTargeting videoPositionTargeting { + get { return this.videoPositionTargetingField; } + set { this.videoPositionTargetingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class GeoTargeting { + private Location[] targetedLocationsField; + + private Location[] excludedLocationsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedLocations")] + public Location[] targetedLocations { + get { return this.targetedLocationsField; } + set { this.targetedLocationsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedLocations")] + public Location[] excludedLocations { + get { return this.excludedLocationsField; } + set { this.excludedLocationsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RegionLocation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PostalCodeLocation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MetroLocation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CountryLocation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CityLocation))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Location { + private long idField; + + private bool idFieldSpecified; + + private string locationTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Location.Type")] + public string LocationType { + get { return this.locationTypeField; } + set { this.locationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class RegionLocation : Location { + private string regionCodeField; + + public string regionCode { + get { return this.regionCodeField; } + set { this.regionCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class PostalCodeLocation : Location { + private string postalCodeField; + + private string countryCodeField; + + public string postalCode { + get { return this.postalCodeField; } + set { this.postalCodeField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class MetroLocation : Location { + private string metroCodeField; + + private string countryCodeField; + + public string metroCode { + get { return this.metroCodeField; } + set { this.metroCodeField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CountryLocation : Location { + private string countryCodeField; + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CityLocation : Location { + private string cityNameField; + + private string regionCodeField; + + private string countryCodeField; + + public string cityName { + get { return this.cityNameField; } + set { this.cityNameField = value; } + } + + public string regionCode { + get { return this.regionCodeField; } + set { this.regionCodeField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class InventoryTargeting { + private AdUnitTargeting[] targetedAdUnitsField; + + private AdUnitTargeting[] excludedAdUnitsField; + + private long[] targetedPlacementIdsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedAdUnits")] + public AdUnitTargeting[] targetedAdUnits { + get { return this.targetedAdUnitsField; } + set { this.targetedAdUnitsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedAdUnits")] + public AdUnitTargeting[] excludedAdUnits { + get { return this.excludedAdUnitsField; } + set { this.excludedAdUnitsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedPlacementIds")] + public long[] targetedPlacementIds { + get { return this.targetedPlacementIdsField; } + set { this.targetedPlacementIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AdUnitTargeting { + private string adUnitIdField; + + private bool includeDescendantsField; + + private bool includeDescendantsFieldSpecified; + + public string adUnitId { + get { return this.adUnitIdField; } + set { this.adUnitIdField = value; } + } + + public bool includeDescendants { + get { return this.includeDescendantsField; } + set { + this.includeDescendantsField = value; + this.includeDescendantsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeDescendantsSpecified { + get { return this.includeDescendantsFieldSpecified; } + set { this.includeDescendantsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DayPartTargeting { + private DayPart[] dayPartsField; + + private DeliveryTimeZone timeZoneField; + + private bool timeZoneFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("dayParts")] + public DayPart[] dayParts { + get { return this.dayPartsField; } + set { this.dayPartsField = value; } + } + + public DeliveryTimeZone timeZone { + get { return this.timeZoneField; } + set { + this.timeZoneField = value; + this.timeZoneSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool timeZoneSpecified { + get { return this.timeZoneFieldSpecified; } + set { this.timeZoneFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DayPart { + private DayOfWeek dayOfWeekField; + + private bool dayOfWeekFieldSpecified; + + private TimeOfDay startTimeField; + + private TimeOfDay endTimeField; + + public DayOfWeek dayOfWeek { + get { return this.dayOfWeekField; } + set { + this.dayOfWeekField = value; + this.dayOfWeekSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dayOfWeekSpecified { + get { return this.dayOfWeekFieldSpecified; } + set { this.dayOfWeekFieldSpecified = value; } + } + + public TimeOfDay startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public TimeOfDay endTime { + get { return this.endTimeField; } + set { this.endTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum DayOfWeek { + MONDAY, + TUESDAY, + WEDNESDAY, + THURSDAY, + FRIDAY, + SATURDAY, + SUNDAY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class TimeOfDay { + private int hourField; + + private bool hourFieldSpecified; + + private MinuteOfHour minuteField; + + private bool minuteFieldSpecified; + + public int hour { + get { return this.hourField; } + set { + this.hourField = value; + this.hourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hourSpecified { + get { return this.hourFieldSpecified; } + set { this.hourFieldSpecified = value; } + } + + public MinuteOfHour minute { + get { return this.minuteField; } + set { + this.minuteField = value; + this.minuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minuteSpecified { + get { return this.minuteFieldSpecified; } + set { this.minuteFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum MinuteOfHour { + ZERO, + FIFTEEN, + THIRTY, + FORTY_FIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum DeliveryTimeZone { + PUBLISHER, + BROWSER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class TechnologyTargeting { + private BandwidthGroupTargeting bandwidthGroupTargetingField; + + private BrowserTargeting browserTargetingField; + + private BrowserLanguageTargeting browserLanguageTargetingField; + + private DeviceCapabilityTargeting deviceCapabilityTargetingField; + + private DeviceCategoryTargeting deviceCategoryTargetingField; + + private DeviceManufacturerTargeting deviceManufacturerTargetingField; + + private MobileCarrierTargeting mobileCarrierTargetingField; + + private MobileDeviceTargeting mobileDeviceTargetingField; + + private MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargetingField; + + private OperatingSystemTargeting operatingSystemTargetingField; + + private OperatingSystemVersionTargeting operatingSystemVersionTargetingField; + + public BandwidthGroupTargeting bandwidthGroupTargeting { + get { return this.bandwidthGroupTargetingField; } + set { this.bandwidthGroupTargetingField = value; } + } + + public BrowserTargeting browserTargeting { + get { return this.browserTargetingField; } + set { this.browserTargetingField = value; } + } + + public BrowserLanguageTargeting browserLanguageTargeting { + get { return this.browserLanguageTargetingField; } + set { this.browserLanguageTargetingField = value; } + } + + public DeviceCapabilityTargeting deviceCapabilityTargeting { + get { return this.deviceCapabilityTargetingField; } + set { this.deviceCapabilityTargetingField = value; } + } + + public DeviceCategoryTargeting deviceCategoryTargeting { + get { return this.deviceCategoryTargetingField; } + set { this.deviceCategoryTargetingField = value; } + } + + public DeviceManufacturerTargeting deviceManufacturerTargeting { + get { return this.deviceManufacturerTargetingField; } + set { this.deviceManufacturerTargetingField = value; } + } + + public MobileCarrierTargeting mobileCarrierTargeting { + get { return this.mobileCarrierTargetingField; } + set { this.mobileCarrierTargetingField = value; } + } + + public MobileDeviceTargeting mobileDeviceTargeting { + get { return this.mobileDeviceTargetingField; } + set { this.mobileDeviceTargetingField = value; } + } + + public MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargeting { + get { return this.mobileDeviceSubmodelTargetingField; } + set { this.mobileDeviceSubmodelTargetingField = value; } + } + + public OperatingSystemTargeting operatingSystemTargeting { + get { return this.operatingSystemTargetingField; } + set { this.operatingSystemTargetingField = value; } + } + + public OperatingSystemVersionTargeting operatingSystemVersionTargeting { + get { return this.operatingSystemVersionTargetingField; } + set { this.operatingSystemVersionTargetingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class BandwidthGroupTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] bandwidthGroupsField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("bandwidthGroups")] + public Technology[] bandwidthGroups { + get { return this.bandwidthGroupsField; } + set { this.bandwidthGroupsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystemVersion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystem))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileDeviceSubmodel))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileDevice))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileCarrier))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceManufacturer))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceCategory))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceCapability))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BrowserLanguage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Browser))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BandwidthGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Technology { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string technologyTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Technology.Type")] + public string TechnologyType { + get { return this.technologyTypeField; } + set { this.technologyTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class OperatingSystemVersion : Technology { + private int majorVersionField; + + private bool majorVersionFieldSpecified; + + private int minorVersionField; + + private bool minorVersionFieldSpecified; + + private int microVersionField; + + private bool microVersionFieldSpecified; + + public int majorVersion { + get { return this.majorVersionField; } + set { + this.majorVersionField = value; + this.majorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool majorVersionSpecified { + get { return this.majorVersionFieldSpecified; } + set { this.majorVersionFieldSpecified = value; } + } + + public int minorVersion { + get { return this.minorVersionField; } + set { + this.minorVersionField = value; + this.minorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minorVersionSpecified { + get { return this.minorVersionFieldSpecified; } + set { this.minorVersionFieldSpecified = value; } + } + + public int microVersion { + get { return this.microVersionField; } + set { + this.microVersionField = value; + this.microVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool microVersionSpecified { + get { return this.microVersionFieldSpecified; } + set { this.microVersionFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class OperatingSystem : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class MobileDeviceSubmodel : Technology { + private long mobileDeviceCriterionIdField; + + private bool mobileDeviceCriterionIdFieldSpecified; + + private long deviceManufacturerCriterionIdField; + + private bool deviceManufacturerCriterionIdFieldSpecified; + + public long mobileDeviceCriterionId { + get { return this.mobileDeviceCriterionIdField; } + set { + this.mobileDeviceCriterionIdField = value; + this.mobileDeviceCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mobileDeviceCriterionIdSpecified { + get { return this.mobileDeviceCriterionIdFieldSpecified; } + set { this.mobileDeviceCriterionIdFieldSpecified = value; } + } + + public long deviceManufacturerCriterionId { + get { return this.deviceManufacturerCriterionIdField; } + set { + this.deviceManufacturerCriterionIdField = value; + this.deviceManufacturerCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deviceManufacturerCriterionIdSpecified { + get { return this.deviceManufacturerCriterionIdFieldSpecified; } + set { this.deviceManufacturerCriterionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class MobileDevice : Technology { + private long manufacturerCriterionIdField; + + private bool manufacturerCriterionIdFieldSpecified; + + public long manufacturerCriterionId { + get { return this.manufacturerCriterionIdField; } + set { + this.manufacturerCriterionIdField = value; + this.manufacturerCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manufacturerCriterionIdSpecified { + get { return this.manufacturerCriterionIdFieldSpecified; } + set { this.manufacturerCriterionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class MobileCarrier : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DeviceManufacturer : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DeviceCategory : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DeviceCapability : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class BrowserLanguage : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Browser : Technology { + private string majorVersionField; + + private string minorVersionField; + + public string majorVersion { + get { return this.majorVersionField; } + set { this.majorVersionField = value; } + } + + public string minorVersion { + get { return this.minorVersionField; } + set { this.minorVersionField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class BandwidthGroup : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class BrowserTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] browsersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("browsers")] + public Technology[] browsers { + get { return this.browsersField; } + set { this.browsersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class BrowserLanguageTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] browserLanguagesField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("browserLanguages")] + public Technology[] browserLanguages { + get { return this.browserLanguagesField; } + set { this.browserLanguagesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DeviceCapabilityTargeting { + private Technology[] targetedDeviceCapabilitiesField; + + private Technology[] excludedDeviceCapabilitiesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedDeviceCapabilities")] + public Technology[] targetedDeviceCapabilities { + get { return this.targetedDeviceCapabilitiesField; } + set { this.targetedDeviceCapabilitiesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedDeviceCapabilities")] + public Technology[] excludedDeviceCapabilities { + get { return this.excludedDeviceCapabilitiesField; } + set { this.excludedDeviceCapabilitiesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DeviceCategoryTargeting { + private Technology[] targetedDeviceCategoriesField; + + private Technology[] excludedDeviceCategoriesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedDeviceCategories")] + public Technology[] targetedDeviceCategories { + get { return this.targetedDeviceCategoriesField; } + set { this.targetedDeviceCategoriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedDeviceCategories")] + public Technology[] excludedDeviceCategories { + get { return this.excludedDeviceCategoriesField; } + set { this.excludedDeviceCategoriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DeviceManufacturerTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] deviceManufacturersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deviceManufacturers")] + public Technology[] deviceManufacturers { + get { return this.deviceManufacturersField; } + set { this.deviceManufacturersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class MobileCarrierTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] mobileCarriersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("mobileCarriers")] + public Technology[] mobileCarriers { + get { return this.mobileCarriersField; } + set { this.mobileCarriersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class MobileDeviceTargeting { + private Technology[] targetedMobileDevicesField; + + private Technology[] excludedMobileDevicesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedMobileDevices")] + public Technology[] targetedMobileDevices { + get { return this.targetedMobileDevicesField; } + set { this.targetedMobileDevicesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedMobileDevices")] + public Technology[] excludedMobileDevices { + get { return this.excludedMobileDevicesField; } + set { this.excludedMobileDevicesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class MobileDeviceSubmodelTargeting { + private Technology[] targetedMobileDeviceSubmodelsField; + + private Technology[] excludedMobileDeviceSubmodelsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedMobileDeviceSubmodels")] + public Technology[] targetedMobileDeviceSubmodels { + get { return this.targetedMobileDeviceSubmodelsField; } + set { this.targetedMobileDeviceSubmodelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedMobileDeviceSubmodels")] + public Technology[] excludedMobileDeviceSubmodels { + get { return this.excludedMobileDeviceSubmodelsField; } + set { this.excludedMobileDeviceSubmodelsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class OperatingSystemTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] operatingSystemsField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("operatingSystems")] + public Technology[] operatingSystems { + get { return this.operatingSystemsField; } + set { this.operatingSystemsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class OperatingSystemVersionTargeting { + private Technology[] targetedOperatingSystemVersionsField; + + private Technology[] excludedOperatingSystemVersionsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedOperatingSystemVersions")] + public Technology[] targetedOperatingSystemVersions { + get { return this.targetedOperatingSystemVersionsField; } + set { this.targetedOperatingSystemVersionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedOperatingSystemVersions")] + public Technology[] excludedOperatingSystemVersions { + get { return this.excludedOperatingSystemVersionsField; } + set { this.excludedOperatingSystemVersionsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CustomCriteriaSet : CustomCriteriaNode { + private CustomCriteriaSetLogicalOperator logicalOperatorField; + + private bool logicalOperatorFieldSpecified; + + private CustomCriteriaNode[] childrenField; + + public CustomCriteriaSetLogicalOperator logicalOperator { + get { return this.logicalOperatorField; } + set { + this.logicalOperatorField = value; + this.logicalOperatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool logicalOperatorSpecified { + get { return this.logicalOperatorFieldSpecified; } + set { this.logicalOperatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("children")] + public CustomCriteriaNode[] children { + get { return this.childrenField; } + set { this.childrenField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCriteriaSet.LogicalOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CustomCriteriaSetLogicalOperator { + AND, + OR + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteriaLeaf))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceSegmentCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteriaSet))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class CustomCriteriaNode { + private string customCriteriaNodeTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomCriteriaNode.Type")] + public string CustomCriteriaNodeType { + get { return this.customCriteriaNodeTypeField; } + set { this.customCriteriaNodeTypeField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceSegmentCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteria))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class CustomCriteriaLeaf : CustomCriteriaNode { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AudienceSegmentCriteria : CustomCriteriaLeaf { + private AudienceSegmentCriteriaComparisonOperator operatorField; + + private bool operatorFieldSpecified; + + private long[] audienceSegmentIdsField; + + public AudienceSegmentCriteriaComparisonOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("audienceSegmentIds")] + public long[] audienceSegmentIds { + get { return this.audienceSegmentIdsField; } + set { this.audienceSegmentIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegmentCriteria.ComparisonOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AudienceSegmentCriteriaComparisonOperator { + IS, + IS_NOT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CustomCriteria : CustomCriteriaLeaf { + private long keyIdField; + + private bool keyIdFieldSpecified; + + private long[] valueIdsField; + + private CustomCriteriaComparisonOperator operatorField; + + private bool operatorFieldSpecified; + + public long keyId { + get { return this.keyIdField; } + set { + this.keyIdField = value; + this.keyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keyIdSpecified { + get { return this.keyIdFieldSpecified; } + set { this.keyIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("valueIds")] + public long[] valueIds { + get { return this.valueIdsField; } + set { this.valueIdsField = value; } + } + + public CustomCriteriaComparisonOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCriteria.ComparisonOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CustomCriteriaComparisonOperator { + IS, + IS_NOT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class UserDomainTargeting { + private string[] domainsField; + + private bool targetedField; + + private bool targetedFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("domains")] + public string[] domains { + get { return this.domainsField; } + set { this.domainsField = value; } + } + + public bool targeted { + get { return this.targetedField; } + set { + this.targetedField = value; + this.targetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetedSpecified { + get { return this.targetedFieldSpecified; } + set { this.targetedFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ContentTargeting { + private long[] targetedContentIdsField; + + private long[] excludedContentIdsField; + + private long[] targetedVideoCategoryIdsField; + + private long[] excludedVideoCategoryIdsField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("targetedContentIds")] + public long[] targetedContentIds { + get { return this.targetedContentIdsField; } + set { this.targetedContentIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedContentIds")] + public long[] excludedContentIds { + get { return this.excludedContentIdsField; } + set { this.excludedContentIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedVideoCategoryIds")] + public long[] targetedVideoCategoryIds { + get { return this.targetedVideoCategoryIdsField; } + set { this.targetedVideoCategoryIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedVideoCategoryIds")] + public long[] excludedVideoCategoryIds { + get { return this.excludedVideoCategoryIdsField; } + set { this.excludedVideoCategoryIdsField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class VideoPositionTargeting { + private VideoPositionTarget[] targetedPositionsField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("targetedPositions")] + public VideoPositionTarget[] targetedPositions { + get { return this.targetedPositionsField; } + set { this.targetedPositionsField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class VideoPositionTarget { + private VideoPosition videoPositionField; + + private VideoBumperType videoBumperTypeField; + + private bool videoBumperTypeFieldSpecified; + + private VideoPodPositionType videoPodPositionTypeField; + + private bool videoPodPositionTypeFieldSpecified; + + public VideoPosition videoPosition { + get { return this.videoPositionField; } + set { this.videoPositionField = value; } + } + + public VideoBumperType videoBumperType { + get { return this.videoBumperTypeField; } + set { + this.videoBumperTypeField = value; + this.videoBumperTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoBumperTypeSpecified { + get { return this.videoBumperTypeFieldSpecified; } + set { this.videoBumperTypeFieldSpecified = value; } + } + + public VideoPodPositionType videoPodPositionType { + get { return this.videoPodPositionTypeField; } + set { + this.videoPodPositionTypeField = value; + this.videoPodPositionTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoPodPositionTypeSpecified { + get { return this.videoPodPositionTypeFieldSpecified; } + set { this.videoPodPositionTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class VideoPosition { + private VideoPositionType positionTypeField; + + private bool positionTypeFieldSpecified; + + private int midrollIndexField; + + private bool midrollIndexFieldSpecified; + + public VideoPositionType positionType { + get { return this.positionTypeField; } + set { + this.positionTypeField = value; + this.positionTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool positionTypeSpecified { + get { return this.positionTypeFieldSpecified; } + set { this.positionTypeFieldSpecified = value; } + } + + public int midrollIndex { + get { return this.midrollIndexField; } + set { + this.midrollIndexField = value; + this.midrollIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool midrollIndexSpecified { + get { return this.midrollIndexFieldSpecified; } + set { this.midrollIndexFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoPosition.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum VideoPositionType { + PREROLL, + MIDROLL, + POSTROLL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum VideoBumperType { + BEFORE, + AFTER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum VideoPodPositionType { + FIRST, + LAST, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItem))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class LineItemSummary { + private long orderIdField; + + private bool orderIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string externalIdField; + + private string orderNameField; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private int autoExtensionDaysField; + + private bool autoExtensionDaysFieldSpecified; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private CreativeRotationType creativeRotationTypeField; + + private bool creativeRotationTypeFieldSpecified; + + private DeliveryRateType deliveryRateTypeField; + + private bool deliveryRateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int priorityField; + + private bool priorityFieldSpecified; + + private UnitType unitTypeField; + + private bool unitTypeFieldSpecified; + + private LineItemSummaryDuration durationField; + + private bool durationFieldSpecified; + + private long unitsBoughtField; + + private bool unitsBoughtFieldSpecified; + + private Money costPerUnitField; + + private Money valueCostPerUnitField; + + private CostType costTypeField; + + private bool costTypeFieldSpecified; + + private LineItemDiscountType discountTypeField; + + private bool discountTypeFieldSpecified; + + private double discountField; + + private bool discountFieldSpecified; + + private long contractedUnitsBoughtField; + + private bool contractedUnitsBoughtFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private EnvironmentType environmentTypeField; + + private bool environmentTypeFieldSpecified; + + private CompanionDeliveryOption companionDeliveryOptionField; + + private bool companionDeliveryOptionFieldSpecified; + + private CreativePersistenceType creativePersistenceTypeField; + + private bool creativePersistenceTypeFieldSpecified; + + private bool allowOverbookField; + + private bool allowOverbookFieldSpecified; + + private bool reserveAtCreationField; + + private bool reserveAtCreationFieldSpecified; + + private Stats statsField; + + private DeliveryIndicator deliveryIndicatorField; + + private long[] deliveryDataField; + + private Money budgetField; + + private ComputedStatus statusField; + + private bool statusFieldSpecified; + + private LineItemSummaryReservationStatus reservationStatusField; + + private bool reservationStatusFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private string webPropertyCodeField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private bool disableSameAdvertiserCompetitiveExclusionField; + + private bool disableSameAdvertiserCompetitiveExclusionFieldSpecified; + + private string lastModifiedByAppField; + + private string notesField; + + private DateTime lastModifiedDateTimeField; + + private DateTime creationDateTimeField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private string lineItemSummaryTypeField; + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string externalId { + get { return this.externalIdField; } + set { this.externalIdField = value; } + } + + public string orderName { + get { return this.orderNameField; } + set { this.orderNameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public int autoExtensionDays { + get { return this.autoExtensionDaysField; } + set { + this.autoExtensionDaysField = value; + this.autoExtensionDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool autoExtensionDaysSpecified { + get { return this.autoExtensionDaysFieldSpecified; } + set { this.autoExtensionDaysFieldSpecified = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public CreativeRotationType creativeRotationType { + get { return this.creativeRotationTypeField; } + set { + this.creativeRotationTypeField = value; + this.creativeRotationTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeRotationTypeSpecified { + get { return this.creativeRotationTypeFieldSpecified; } + set { this.creativeRotationTypeFieldSpecified = value; } + } + + public DeliveryRateType deliveryRateType { + get { return this.deliveryRateTypeField; } + set { + this.deliveryRateTypeField = value; + this.deliveryRateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryRateTypeSpecified { + get { return this.deliveryRateTypeFieldSpecified; } + set { this.deliveryRateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + public UnitType unitType { + get { return this.unitTypeField; } + set { + this.unitTypeField = value; + this.unitTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitTypeSpecified { + get { return this.unitTypeFieldSpecified; } + set { this.unitTypeFieldSpecified = value; } + } + + public LineItemSummaryDuration duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public long unitsBought { + get { return this.unitsBoughtField; } + set { + this.unitsBoughtField = value; + this.unitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitsBoughtSpecified { + get { return this.unitsBoughtFieldSpecified; } + set { this.unitsBoughtFieldSpecified = value; } + } + + public Money costPerUnit { + get { return this.costPerUnitField; } + set { this.costPerUnitField = value; } + } + + public Money valueCostPerUnit { + get { return this.valueCostPerUnitField; } + set { this.valueCostPerUnitField = value; } + } + + public CostType costType { + get { return this.costTypeField; } + set { + this.costTypeField = value; + this.costTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool costTypeSpecified { + get { return this.costTypeFieldSpecified; } + set { this.costTypeFieldSpecified = value; } + } + + public LineItemDiscountType discountType { + get { return this.discountTypeField; } + set { + this.discountTypeField = value; + this.discountTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool discountTypeSpecified { + get { return this.discountTypeFieldSpecified; } + set { this.discountTypeFieldSpecified = value; } + } + + public double discount { + get { return this.discountField; } + set { + this.discountField = value; + this.discountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool discountSpecified { + get { return this.discountFieldSpecified; } + set { this.discountFieldSpecified = value; } + } + + public long contractedUnitsBought { + get { return this.contractedUnitsBoughtField; } + set { + this.contractedUnitsBoughtField = value; + this.contractedUnitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contractedUnitsBoughtSpecified { + get { return this.contractedUnitsBoughtFieldSpecified; } + set { this.contractedUnitsBoughtFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + public EnvironmentType environmentType { + get { return this.environmentTypeField; } + set { + this.environmentTypeField = value; + this.environmentTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool environmentTypeSpecified { + get { return this.environmentTypeFieldSpecified; } + set { this.environmentTypeFieldSpecified = value; } + } + + public CompanionDeliveryOption companionDeliveryOption { + get { return this.companionDeliveryOptionField; } + set { + this.companionDeliveryOptionField = value; + this.companionDeliveryOptionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companionDeliveryOptionSpecified { + get { return this.companionDeliveryOptionFieldSpecified; } + set { this.companionDeliveryOptionFieldSpecified = value; } + } + + public CreativePersistenceType creativePersistenceType { + get { return this.creativePersistenceTypeField; } + set { + this.creativePersistenceTypeField = value; + this.creativePersistenceTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativePersistenceTypeSpecified { + get { return this.creativePersistenceTypeFieldSpecified; } + set { this.creativePersistenceTypeFieldSpecified = value; } + } + + public bool allowOverbook { + get { return this.allowOverbookField; } + set { + this.allowOverbookField = value; + this.allowOverbookSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowOverbookSpecified { + get { return this.allowOverbookFieldSpecified; } + set { this.allowOverbookFieldSpecified = value; } + } + + public bool reserveAtCreation { + get { return this.reserveAtCreationField; } + set { + this.reserveAtCreationField = value; + this.reserveAtCreationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reserveAtCreationSpecified { + get { return this.reserveAtCreationFieldSpecified; } + set { this.reserveAtCreationFieldSpecified = value; } + } + + public Stats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public DeliveryIndicator deliveryIndicator { + get { return this.deliveryIndicatorField; } + set { this.deliveryIndicatorField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("units", IsNullable = false)] + public long[] deliveryData { + get { return this.deliveryDataField; } + set { this.deliveryDataField = value; } + } + + public Money budget { + get { return this.budgetField; } + set { this.budgetField = value; } + } + + public ComputedStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public LineItemSummaryReservationStatus reservationStatus { + get { return this.reservationStatusField; } + set { + this.reservationStatusField = value; + this.reservationStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reservationStatusSpecified { + get { return this.reservationStatusFieldSpecified; } + set { this.reservationStatusFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public string webPropertyCode { + get { return this.webPropertyCodeField; } + set { this.webPropertyCodeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public bool disableSameAdvertiserCompetitiveExclusion { + get { return this.disableSameAdvertiserCompetitiveExclusionField; } + set { + this.disableSameAdvertiserCompetitiveExclusionField = value; + this.disableSameAdvertiserCompetitiveExclusionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool disableSameAdvertiserCompetitiveExclusionSpecified { + get { return this.disableSameAdvertiserCompetitiveExclusionFieldSpecified; } + set { this.disableSameAdvertiserCompetitiveExclusionFieldSpecified = value; } + } + + public string lastModifiedByApp { + get { return this.lastModifiedByAppField; } + set { this.lastModifiedByAppField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public DateTime creationDateTime { + get { return this.creationDateTimeField; } + set { this.creationDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("LineItemSummary.Type")] + public string LineItemSummaryType { + get { return this.lineItemSummaryTypeField; } + set { this.lineItemSummaryTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum StartDateTimeType { + USE_START_DATE_TIME, + IMMEDIATELY, + ONE_HOUR_FROM_NOW + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CreativeRotationType { + EVEN, + OPTIMIZED, + MANUAL, + SEQUENTIAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum DeliveryRateType { + EVENLY, + FRONTLOADED, + AS_FAST_AS_POSSIBLE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum RoadblockingType { + ONLY_ONE, + ONE_OR_MORE, + AS_MANY_AS_POSSIBLE, + ALL_ROADBLOCK, + CREATIVE_SET + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class FrequencyCap { + private int maxImpressionsField; + + private bool maxImpressionsFieldSpecified; + + private int numTimeUnitsField; + + private bool numTimeUnitsFieldSpecified; + + private TimeUnit timeUnitField; + + private bool timeUnitFieldSpecified; + + public int maxImpressions { + get { return this.maxImpressionsField; } + set { + this.maxImpressionsField = value; + this.maxImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxImpressionsSpecified { + get { return this.maxImpressionsFieldSpecified; } + set { this.maxImpressionsFieldSpecified = value; } + } + + public int numTimeUnits { + get { return this.numTimeUnitsField; } + set { + this.numTimeUnitsField = value; + this.numTimeUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numTimeUnitsSpecified { + get { return this.numTimeUnitsFieldSpecified; } + set { this.numTimeUnitsFieldSpecified = value; } + } + + public TimeUnit timeUnit { + get { return this.timeUnitField; } + set { + this.timeUnitField = value; + this.timeUnitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool timeUnitSpecified { + get { return this.timeUnitFieldSpecified; } + set { this.timeUnitFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum TimeUnit { + MINUTE, + HOUR, + DAY, + WEEK, + MONTH, + LIFETIME, + POD, + STREAM + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum LineItemType { + SPONSORSHIP, + STANDARD, + NETWORK, + BULK, + PRICE_PRIORITY, + HOUSE, + LEGACY_DFP, + CLICK_TRACKING, + ADSENSE, + AD_EXCHANGE, + BUMPER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum UnitType { + IMPRESSIONS, + CLICKS + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemSummary.Duration", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum LineItemSummaryDuration { + NONE, + LIFETIME, + DAILY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Money { + private string currencyCodeField; + + private long microAmountField; + + private bool microAmountFieldSpecified; + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public long microAmount { + get { return this.microAmountField; } + set { + this.microAmountField = value; + this.microAmountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool microAmountSpecified { + get { return this.microAmountFieldSpecified; } + set { this.microAmountFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CostType { + CPC, + CPD, + CPM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum LineItemDiscountType { + ABSOLUTE_VALUE, + PERCENTAGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CreativePlaceholder { + private Size sizeField; + + private CreativePlaceholder[] companionsField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private long idField; + + private bool idFieldSpecified; + + private int expectedCreativeCountField; + + private bool expectedCreativeCountFieldSpecified; + + private CreativeSizeType creativeSizeTypeField; + + private bool creativeSizeTypeFieldSpecified; + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companions")] + public CreativePlaceholder[] companions { + get { return this.companionsField; } + set { this.companionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public int expectedCreativeCount { + get { return this.expectedCreativeCountField; } + set { + this.expectedCreativeCountField = value; + this.expectedCreativeCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expectedCreativeCountSpecified { + get { return this.expectedCreativeCountFieldSpecified; } + set { this.expectedCreativeCountFieldSpecified = value; } + } + + public CreativeSizeType creativeSizeType { + get { return this.creativeSizeTypeField; } + set { + this.creativeSizeTypeField = value; + this.creativeSizeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeSizeTypeSpecified { + get { return this.creativeSizeTypeFieldSpecified; } + set { this.creativeSizeTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Size { + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + private bool isAspectRatioField; + + private bool isAspectRatioFieldSpecified; + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + public bool isAspectRatio { + get { return this.isAspectRatioField; } + set { + this.isAspectRatioField = value; + this.isAspectRatioSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAspectRatioSpecified { + get { return this.isAspectRatioFieldSpecified; } + set { this.isAspectRatioFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AppliedLabel { + private long labelIdField; + + private bool labelIdFieldSpecified; + + private bool isNegatedField; + + private bool isNegatedFieldSpecified; + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + + public bool isNegated { + get { return this.isNegatedField; } + set { + this.isNegatedField = value; + this.isNegatedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isNegatedSpecified { + get { return this.isNegatedFieldSpecified; } + set { this.isNegatedFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CreativeSizeType { + PIXEL, + ASPECT_RATIO, + INTERSTITIAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum TargetPlatform { + WEB, + MOBILE, + ANY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum EnvironmentType { + BROWSER, + VIDEO_PLAYER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CompanionDeliveryOption { + OPTIONAL, + AT_LEAST_ONE, + ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CreativePersistenceType { + NOT_PERSISTENT, + PERSISTENT_AND_EXCLUDE_NONE, + PERSISTENT_AND_EXCLUDE_DISPLAY, + PERSISTENT_AND_EXCLUDE_VIDEO, + PERSISTENT_AND_EXCLUDE_ALL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Stats { + private long impressionsDeliveredField; + + private bool impressionsDeliveredFieldSpecified; + + private long clicksDeliveredField; + + private bool clicksDeliveredFieldSpecified; + + public long impressionsDelivered { + get { return this.impressionsDeliveredField; } + set { + this.impressionsDeliveredField = value; + this.impressionsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsDeliveredSpecified { + get { return this.impressionsDeliveredFieldSpecified; } + set { this.impressionsDeliveredFieldSpecified = value; } + } + + public long clicksDelivered { + get { return this.clicksDeliveredField; } + set { + this.clicksDeliveredField = value; + this.clicksDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clicksDeliveredSpecified { + get { return this.clicksDeliveredFieldSpecified; } + set { this.clicksDeliveredFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DeliveryIndicator { + private double expectedDeliveryPercentageField; + + private bool expectedDeliveryPercentageFieldSpecified; + + private double actualDeliveryPercentageField; + + private bool actualDeliveryPercentageFieldSpecified; + + public double expectedDeliveryPercentage { + get { return this.expectedDeliveryPercentageField; } + set { + this.expectedDeliveryPercentageField = value; + this.expectedDeliveryPercentageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expectedDeliveryPercentageSpecified { + get { return this.expectedDeliveryPercentageFieldSpecified; } + set { this.expectedDeliveryPercentageFieldSpecified = value; } + } + + public double actualDeliveryPercentage { + get { return this.actualDeliveryPercentageField; } + set { + this.actualDeliveryPercentageField = value; + this.actualDeliveryPercentageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool actualDeliveryPercentageSpecified { + get { return this.actualDeliveryPercentageFieldSpecified; } + set { this.actualDeliveryPercentageFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ComputedStatus { + DELIVERY_EXTENDED, + DELIVERING, + READY, + PAUSED, + NEEDS_CREATIVES, + PAUSED_INVENTORY_RELEASED, + PENDING_APPROVAL, + COMPLETED, + DISAPPROVED, + DRAFT, + CANCELED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemSummary.ReservationStatus", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum LineItemSummaryReservationStatus { + RESERVED, + UNRESERVED + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DropDownCustomFieldValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class BaseCustomFieldValue { + private long customFieldIdField; + + private bool customFieldIdFieldSpecified; + + private string baseCustomFieldValueTypeField; + + public long customFieldId { + get { return this.customFieldIdField; } + set { + this.customFieldIdField = value; + this.customFieldIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldIdSpecified { + get { return this.customFieldIdFieldSpecified; } + set { this.customFieldIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseCustomFieldValue.Type")] + public string BaseCustomFieldValueType { + get { return this.baseCustomFieldValueTypeField; } + set { this.baseCustomFieldValueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DropDownCustomFieldValue : BaseCustomFieldValue { + private long customFieldOptionIdField; + + private bool customFieldOptionIdFieldSpecified; + + public long customFieldOptionId { + get { return this.customFieldOptionIdField; } + set { + this.customFieldOptionIdField = value; + this.customFieldOptionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldOptionIdSpecified { + get { return this.customFieldOptionIdFieldSpecified; } + set { this.customFieldOptionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CustomFieldValue : BaseCustomFieldValue { + private Value valueField; + + public Value value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class UserDomainTargetingError : ApiError { + private UserDomainTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public UserDomainTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "UserDomainTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum UserDomainTargetingErrorReason { + INVALID_DOMAIN_NAMES, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class UniqueError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class TypeError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class TechnologyTargetingError : ApiError { + private TechnologyTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TechnologyTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TechnologyTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum TechnologyTargetingErrorReason { + MOBILE_LINE_ITEM_CONTAINS_WEB_TECH_CRITERIA, + WEB_LINE_ITEM_CONTAINS_MOBILE_TECH_CRITERIA, + MOBILE_CARRIER_TARGETING_FEATURE_NOT_ENABLED, + DEVICE_CAPABILITY_TARGETING_FEATURE_NOT_ENABLED, + DEVICE_CATEGORY_TARGETING_FEATURE_NOT_ENABLED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class TeamError : ApiError { + private TeamErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TeamErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TeamError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum TeamErrorReason { + ENTITY_NOT_ON_USERS_TEAMS, + MISSING_USERS_TEAM, + ALL_TEAM_ASSOCIATION_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class StringLengthError : ApiError { + private StringLengthErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StringLengthErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StringLengthError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum StringLengthErrorReason { + TOO_LONG, + TOO_SHORT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ReservationDetailsError : ApiError { + private ReservationDetailsErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReservationDetailsErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReservationDetailsError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ReservationDetailsErrorReason { + UNLIMITED_UNITS_BOUGHT_NOT_ALLOWED, + UNLIMITED_END_DATE_TIME_NOT_ALLOWED, + PERCENTAGE_UNITS_BOUGHT_TOO_HIGH, + DURATION_NOT_ALLOWED, + UNIT_TYPE_NOT_ALLOWED, + COST_TYPE_NOT_ALLOWED, + COST_TYPE_UNIT_TYPE_MISMATCH_NOT_ALLOWED, + LINE_ITEM_TYPE_NOT_ALLOWED, + NETWORK_REMNANT_ORDER_CANNOT_UPDATE_LINEITEM_TYPE, + BACKFILL_WEBPROPERTY_CODE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class RequiredSizeError : ApiError { + private RequiredSizeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredSizeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredSizeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum RequiredSizeErrorReason { + REQUIRED, + NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class RequiredNumberError : ApiError { + private RequiredNumberErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredNumberErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredNumberError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum RequiredNumberErrorReason { + REQUIRED, + TOO_LARGE, + TOO_SMALL, + TOO_LARGE_WITH_DETAILS, + TOO_SMALL_WITH_DETAILS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class RequiredCollectionError : ApiError { + private RequiredCollectionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredCollectionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredCollectionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum RequiredCollectionErrorReason { + REQUIRED, + TOO_LARGE, + TOO_SMALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class RangeError : ApiError { + private RangeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RangeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RangeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum RangeErrorReason { + TOO_HIGH, + TOO_LOW, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ParseError : ApiError { + private ParseErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ParseErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ParseError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ParseErrorReason { + UNPARSABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class OrderError : ApiError { + private OrderErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OrderErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OrderError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum OrderErrorReason { + UPDATE_CANCELED_ORDER_NOT_ALLOWED, + UPDATE_PENDING_APPROVAL_ORDER_NOT_ALLOWED, + UPDATE_ARCHIVED_ORDER_NOT_ALLOWED, + CANNOT_MODIFY_PROPOSAL_ID, + PRIMARY_USER_REQUIRED, + PRIMARY_USER_CANNOT_BE_SECONDARY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class NullError : ApiError { + private NullErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NullErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NullError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum NullErrorReason { + NULL_CONTENT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class LineItemOperationError : ApiError { + private LineItemOperationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemOperationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemOperationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum LineItemOperationErrorReason { + NOT_ALLOWED, + NOT_APPLICABLE, + HAS_COMPLETED, + HAS_NO_ACTIVE_CREATIVES, + CANNOT_ACTIVATE_LEGACY_DFP_LINE_ITEM, + CANNOT_DELETE_DELIVERED_LINE_ITEM, + CANNOT_RESERVE_COMPANY_CREDIT_STATUS_NOT_ACTIVE, + CANNOT_ACTIVATE_INVALID_COMPANY_CREDIT_STATUS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class LineItemFlightDateError : ApiError { + private LineItemFlightDateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemFlightDateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemFlightDateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum LineItemFlightDateErrorReason { + START_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_NOT_AFTER_START_TIME, + END_DATE_TIME_TOO_LATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class LineItemError : ApiError { + private LineItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum LineItemErrorReason { + ALREADY_STARTED, + UPDATE_RESERVATION_NOT_ALLOWED, + ALL_ROADBLOCK_NOT_ALLOWED, + CREATIVE_SET_ROADBLOCK_NOT_ALLOWED, + FRACTIONAL_PERCENTAGE_NOT_ALLOWED, + DISCOUNT_NOT_ALLOWED, + UPDATE_CANCELED_LINE_ITEM_NOT_ALLOWED, + UPDATE_PENDING_APPROVAL_LINE_ITEM_NOT_ALLOWED, + UPDATE_ARCHIVED_LINE_ITEM_NOT_ALLOWED, + FRONTLOADED_NOT_ALLOWED, + CREATE_OR_UPDATE_LEGACY_DFP_LINE_ITEM_TYPE_NOT_ALLOWED, + COPY_LINE_ITEM_FROM_DIFFERENT_COMPANY_NOT_ALLOWED, + INVALID_SIZE_FOR_PLATFORM, + INVALID_LINE_ITEM_TYPE_FOR_PLATFORM, + INVALID_WEB_PROPERTY_FOR_PLATFORM, + INVALID_WEB_PROPERTY_FOR_ENVIRONMENT, + AFMA_BACKFILL_NOT_ALLOWED, + UPDATE_ENVIRONMENT_TYPE_NOT_ALLOWED, + COMPANIONS_NOT_ALLOWED, + ROADBLOCKS_WITH_NONROADBLOCKS_NOT_ALLOWED, + CANNOT_UPDATE_TO_OR_FROM_CREATIVE_SET_ROADBLOCK, + UPDATE_FROM_BACKFILL_LINE_ITEM_TYPE_NOT_ALLOWED, + UPDATE_TO_BACKFILL_LINE_ITEM_TYPE_NOT_ALLOWED, + UPDATE_BACKFILL_WEB_PROPERTY_NOT_ALLOWED, + INVALID_COMPANION_DELIVERY_OPTION_FOR_ENVIRONMENT_TYPE, + COMPANION_BACKFILL_REQUIRES_VIDEO, + COMPANION_DELIVERY_OPTION_REQUIRE_PREMIUM, + DUPLICATE_MASTER_SIZES, + INVALID_PRIORITY_FOR_LINE_ITEM_TYPE, + INVALID_ENVIRONMENT_TYPE, + INVALID_ENVIRONMENT_TYPE_FOR_PLATFORM, + INVALID_TYPE_FOR_AUTO_EXTENSION, + INVALID_TYPE_FOR_CONTRACTED_UNITS_BOUGHT, + VIDEO_INVALID_ROADBLOCKING, + BACKFILL_TYPE_NOT_ALLOWED, + COMPANION_DELIVERY_OPTIONS_NOT_ALLOWED_WITH_BACKFILL, + INVALID_WEB_PROPERTY_FOR_ADX_BACKFILL, + INVALID_SIZE_FOR_ENVIRONMENT, + TARGET_PLATOFRM_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class LineItemCreativeAssociationError : ApiError { + private LineItemCreativeAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemCreativeAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum LineItemCreativeAssociationErrorReason { + CREATIVE_IN_WRONG_ADVERTISERS_LIBRARY, + INVALID_LINEITEM_CREATIVE_PAIRING, + STARTDATE_BEFORE_LINEITEM_STARTDATE, + STARTDATE_NOT_BEFORE_LINEITEM_ENDDATE, + ENDDATE_AFTER_LINEITEM_ENDDATE, + ENDDATE_NOT_AFTER_LINEITEM_STARTDATE, + ENDDATE_NOT_AFTER_STARTDATE, + ENDDATE_IN_THE_PAST, + CANNOT_COPY_WITHIN_SAME_LINE_ITEM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class LabelEntityAssociationError : ApiError { + private LabelEntityAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LabelEntityAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LabelEntityAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum LabelEntityAssociationErrorReason { + INVALID_COMPANY_TYPE, + DUPLICATE_ASSOCIATION, + INVALID_ASSOCIATION, + DUPLICATE_ASSOCIATION_WITH_NEGATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class InventoryTargetingError : ApiError { + private InventoryTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum InventoryTargetingErrorReason { + AT_LEAST_ONE_PLACEMENT_OR_INVENTORY_UNIT_REQUIRED, + INVENTORY_CANNOT_BE_TARGETED_AND_EXCLUDED, + PARENT_CONTAINS_INVALID_MIX_OF_TARGETED_AND_EXCLUDED_AD_UNITS, + INVENTORY_EXCLUSIONS_MUST_HAVE_PARENT_INVENTORY_UNIT, + INVENTORY_UNIT_CANNOT_BE_TARGETED_IF_ANCESTOR_IS_TARGETED, + INVENTORY_UNIT_CANNOT_BE_TARGETED_IF_ANCESTOR_IS_EXCLUDED, + INVENTORY_UNIT_CANNOT_BE_EXCLUDED_IF_ANCESTOR_IS_EXCLUDED, + EXPLICITLY_TARGETED_INVENTORY_UNIT_CANNOT_BE_TARGETED, + EXPLICITLY_TARGETED_INVENTORY_UNIT_CANNOT_BE_EXCLUDED, + SELF_ONLY_INVENTORY_UNIT_NOT_ALLOWED, + SELF_ONLY_INVENTORY_UNIT_WITHOUT_DESCENDANTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class InvalidUrlError : ApiError { + private InvalidUrlErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidUrlErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidUrlError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum InvalidUrlErrorReason { + ILLEGAL_CHARACTERS, + INVALID_FORMAT, + INSECURE_SCHEME, + NO_SCHEME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class GeoTargetingError : ApiError { + private GeoTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public GeoTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GeoTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum GeoTargetingErrorReason { + TARGETED_LOCATIONS_NOT_EXCLUDABLE, + EXCLUDED_LOCATIONS_CANNOT_HAVE_CHILDREN_TARGETED, + POSTAL_CODES_CANNOT_BE_EXCLUDED, + UNTARGETABLE_LOCATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class GenericTargetingError : ApiError { + private GenericTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public GenericTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GenericTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum GenericTargetingErrorReason { + CONFLICTING_INCLUSION_OR_EXCLUSION_OF_SIBLINGS, + INCLUDING_DESCENDANTS_OF_EXCLUDED_CRITERIA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class FrequencyCapError : ApiError { + private FrequencyCapErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FrequencyCapErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FrequencyCapError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum FrequencyCapErrorReason { + IMPRESSION_LIMIT_EXCEEDED, + IMPRESSIONS_TOO_LOW, + RANGE_LIMIT_EXCEEDED, + RANGE_TOO_LOW, + DUPLICATE_TIME_RANGE, + TOO_MANY_FREQUENCY_CAPS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ForecastError : ApiError { + private ForecastErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ForecastErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ForecastError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ForecastErrorReason { + SERVER_NOT_AVAILABLE, + INTERNAL_ERROR, + NO_FORECAST_YET, + NOT_ENOUGH_INVENTORY, + SUCCESS, + ZERO_LENGTH_RESERVATION, + EXCEEDED_QUOTA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class EntityLimitReachedError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DayPartTargetingError : ApiError { + private DayPartTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DayPartTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DayPartTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum DayPartTargetingErrorReason { + INVALID_HOUR, + INVALID_MINUTE, + END_TIME_NOT_AFTER_START_TIME, + TIME_PERIODS_OVERLAP, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DateTimeRangeTargetingError : ApiError { + private DateTimeRangeTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DateTimeRangeTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DateTimeRangeTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum DateTimeRangeTargetingErrorReason { + EMPTY_RANGES, + NOT_SPONSORSHIP_LINEITEM, + PAST_RANGES_CHANGED, + RANGES_OVERLAP, + RANGES_OUT_OF_LINEITEM_ACTIVE_PERIOD, + START_TIME_IS_NOT_START_OF_DAY, + END_TIME_IS_NOT_END_OF_DAY, + START_DATE_TIME_IS_IN_PAST, + RANGE_END_TIME_BEFORE_START_TIME, + END_DATE_TIME_IS_TOO_LATE, + LIMITED_RANGES_IN_UNLIMITED_LINEITEM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CustomTargetingError : ApiError { + private CustomTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CustomTargetingErrorReason { + KEY_NOT_FOUND, + KEY_COUNT_TOO_LARGE, + KEY_NAME_DUPLICATE, + KEY_NAME_EMPTY, + KEY_NAME_INVALID_LENGTH, + KEY_NAME_INVALID_CHARS, + KEY_NAME_RESERVED, + KEY_DISPLAY_NAME_INVALID_LENGTH, + VALUE_NOT_FOUND, + GET_VALUES_BY_STATEMENT_MUST_CONTAIN_KEY_ID, + VALUE_COUNT_FOR_KEY_TOO_LARGE, + VALUE_NAME_DUPLICATE, + VALUE_NAME_EMPTY, + VALUE_NAME_INVALID_LENGTH, + VALUE_NAME_INVALID_CHARS, + VALUE_DISPLAY_NAME_INVALID_LENGTH, + VALUE_MATCH_TYPE_NOT_ALLOWED, + VALUE_MATCH_TYPE_NOT_EXACT_FOR_PREDEFINED_KEY, + KEY_WITH_MISSING_VALUES, + CANNOT_OR_DIFFERENT_KEYS, + INVALID_TARGETING_EXPRESSION, + DELETED_KEY_CANNOT_BE_USED_FOR_TARGETING, + DELETED_VALUE_CANNOT_BE_USED_FOR_TARGETING, + VIDEO_BROWSE_BY_KEY_CANNOT_BE_USED_FOR_CUSTOM_TARGETING, + CANNOT_TARGET_AUDIENCE_SEGMENT, + CANNOT_TARGET_INACTIVE_AUDIENCE_SEGMENT, + INVALID_AUDIENCE_SEGMENTS, + ONLY_APPROVED_AUDIENCE_SEGMENTS_CAN_BE_TARGETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CustomFieldValueError : ApiError { + private CustomFieldValueErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomFieldValueErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomFieldValueError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CustomFieldValueErrorReason { + CUSTOM_FIELD_NOT_FOUND, + CUSTOM_FIELD_INACTIVE, + CUSTOM_FIELD_OPTION_NOT_FOUND, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CreativeError : ApiError { + private CreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CreativeErrorReason { + FLASH_AND_FALLBACK_URL_ARE_SAME, + INVALID_INTERNAL_REDIRECT_URL, + DESTINATION_URL_REQUIRED, + CANNOT_CREATE_OR_UPDATE_LEGACY_DFP_CREATIVE, + CANNOT_CREATE_OR_UPDATE_LEGACY_DFP_MOBILE_CREATIVE, + MISSING_FEATURE, + INVALID_COMPANY_TYPE, + INVALID_ADSENSE_CREATIVE_SIZE, + INVALID_AD_EXCHANGE_CREATIVE_SIZE, + DUPLICATE_ASSET_IN_CREATIVE, + CREATIVE_ASSET_CANNOT_HAVE_ID_AND_BYTE_ARRAY, + CANNOT_CREATE_OR_UPDATE_UNSUPPORTED_CREATIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CompanyCreditStatusError : ApiError { + private CompanyCreditStatusErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CompanyCreditStatusErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CompanyCreditStatusError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CompanyCreditStatusErrorReason { + COMPANY_CREDIT_STATUS_CHANGE_NOT_ALLOWED, + CANNOT_USE_CREDIT_STATUS_SETTING, + CANNOT_USE_ADVANCED_CREDIT_STATUS_SETTING, + UNACCEPTABLE_COMPANY_CREDIT_STATUS_FOR_ORDER, + UNACCEPTABLE_COMPANY_CREDIT_STATUS_FOR_LINE_ITEM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ClickTrackingLineItemError : ApiError { + private ClickTrackingLineItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ClickTrackingLineItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ClickTrackingLineItemError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ClickTrackingLineItemErrorReason { + TYPE_IMMUTABLE, + INVALID_TARGETING_TYPE, + INVALID_ROADBLOCKING_TYPE, + INVALID_CREATIVEROTATION_TYPE, + INVALID_DELIVERY_RATE_TYPE, + UNSUPPORTED_FIELD, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AudienceExtensionError : ApiError { + private AudienceExtensionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AudienceExtensionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceExtensionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AudienceExtensionErrorReason { + FREQUENCY_CAPS_NOT_SUPPORTED, + INVALID_TARGETING, + INVENTORY_UNIT_TARGETING_INVALID, + INVALID_CREATIVE_ROTATION, + INVALID_EXTERNAL_ENTITY_ID, + INVALID_LINE_ITEM_TYPE, + INVALID_MAX_BID, + AUDIENCE_EXTENSION_BULK_UPDATE_NOT_ALLOWED, + UNEXPECTED_AUDIENCE_EXTENSION_ERROR, + MAX_DAILY_BUDGET_AMOUNT_EXCEEDED, + EXTERNAL_CAMPAIGN_ALREADY_EXISTS, + AUDIENCE_EXTENSION_WITHOUT_FEATURE, + AUDIENCE_EXTENSION_WITHOUT_LINKED_ACCOUNT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ContentServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ContentService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ContentService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/ContentService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ContentPage getContentByStatement(Statement statement) { + object[] results = this.Invoke("getContentByStatement", new object[] { statement }); + return ((ContentPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ContentPage getContentByStatementAndCustomTargetingValue(Statement filterStatement, long customTargetingValueId) { + object[] results = this.Invoke("getContentByStatementAndCustomTargetingValue", new object[] { filterStatement, customTargetingValueId }); + return ((ContentPage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CmsContent { + private string displayNameField; + + private string cmsContentIdField; + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public string cmsContentId { + get { return this.cmsContentIdField; } + set { this.cmsContentIdField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Content { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private ContentStatus statusField; + + private bool statusFieldSpecified; + + private ContentStatusDefinedBy statusDefinedByField; + + private bool statusDefinedByFieldSpecified; + + private CmsContent[] cmsSourcesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ContentStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ContentStatusDefinedBy statusDefinedBy { + get { return this.statusDefinedByField; } + set { + this.statusDefinedByField = value; + this.statusDefinedBySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusDefinedBySpecified { + get { return this.statusDefinedByFieldSpecified; } + set { this.statusDefinedByFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("cmsSources")] + public CmsContent[] cmsSources { + get { return this.cmsSourcesField; } + set { this.cmsSourcesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ContentStatus { + ACTIVE, + INACTIVE, + ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ContentStatusDefinedBy { + CMS, + USER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ContentPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Content[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Content[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ContentPartnerError : ApiError { + private ContentPartnerErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ContentPartnerErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ContentPartnerError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ContentPartnerErrorReason { + FEATURE_NOT_ENABLED, + INVALID_PARTNER_TYPE, + NO_PARTNER_CATCH_ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdRuleServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdRuleService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdRuleService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/AdRuleService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdRule createAdRule(AdRule adRule) { + object[] results = this.Invoke("createAdRule", new object[] { adRule }); + return ((AdRule) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdRule[] createAdRules([System.Xml.Serialization.XmlElementAttribute("adRules")] +AdRule[] adRules) { + object[] results = this.Invoke("createAdRules", new object[] { adRules }); + return ((AdRule[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdRule getAdRule(int adRuleId) { + object[] results = this.Invoke("getAdRule", new object[] { adRuleId }); + return ((AdRule) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdRulePage getAdRulesByStatement(Statement statement) { + object[] results = this.Invoke("getAdRulesByStatement", new object[] { statement }); + return ((AdRulePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performAdRuleAction(AdRuleAction adRuleAction, Statement filterStatement) { + object[] results = this.Invoke("performAdRuleAction", new object[] { adRuleAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdRule updateAdRule(AdRule adRule) { + object[] results = this.Invoke("updateAdRule", new object[] { adRule }); + return ((AdRule) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdRule[] updateAdRules([System.Xml.Serialization.XmlElementAttribute("adRules")] +AdRule[] adRules) { + object[] results = this.Invoke("updateAdRules", new object[] { adRules }); + return ((AdRule[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteAdRules))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateAdRules))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateAdRules))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class AdRuleAction { + private string adRuleActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AdRuleAction.Type")] + public string AdRuleActionType { + get { return this.adRuleActionTypeField; } + set { this.adRuleActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DeleteAdRules : AdRuleAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DeactivateAdRules : AdRuleAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ActivateAdRules : AdRuleAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AdRulePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AdRule[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AdRule[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AdRule { + private int idField; + + private bool idFieldSpecified; + + private string nameField; + + private int priorityField; + + private bool priorityFieldSpecified; + + private Targeting targetingField; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private AdRuleStatus statusField; + + private bool statusFieldSpecified; + + private FrequencyCapBehavior frequencyCapBehaviorField; + + private bool frequencyCapBehaviorFieldSpecified; + + private int maxImpressionsPerLineItemPerStreamField; + + private bool maxImpressionsPerLineItemPerStreamFieldSpecified; + + private int maxImpressionsPerLineItemPerPodField; + + private bool maxImpressionsPerLineItemPerPodFieldSpecified; + + private BaseAdRuleSlot prerollField; + + private BaseAdRuleSlot midrollField; + + private BaseAdRuleSlot postrollField; + + public int id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + public Targeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public AdRuleStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public FrequencyCapBehavior frequencyCapBehavior { + get { return this.frequencyCapBehaviorField; } + set { + this.frequencyCapBehaviorField = value; + this.frequencyCapBehaviorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool frequencyCapBehaviorSpecified { + get { return this.frequencyCapBehaviorFieldSpecified; } + set { this.frequencyCapBehaviorFieldSpecified = value; } + } + + public int maxImpressionsPerLineItemPerStream { + get { return this.maxImpressionsPerLineItemPerStreamField; } + set { + this.maxImpressionsPerLineItemPerStreamField = value; + this.maxImpressionsPerLineItemPerStreamSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxImpressionsPerLineItemPerStreamSpecified { + get { return this.maxImpressionsPerLineItemPerStreamFieldSpecified; } + set { this.maxImpressionsPerLineItemPerStreamFieldSpecified = value; } + } + + public int maxImpressionsPerLineItemPerPod { + get { return this.maxImpressionsPerLineItemPerPodField; } + set { + this.maxImpressionsPerLineItemPerPodField = value; + this.maxImpressionsPerLineItemPerPodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxImpressionsPerLineItemPerPodSpecified { + get { return this.maxImpressionsPerLineItemPerPodFieldSpecified; } + set { this.maxImpressionsPerLineItemPerPodFieldSpecified = value; } + } + + public BaseAdRuleSlot preroll { + get { return this.prerollField; } + set { this.prerollField = value; } + } + + public BaseAdRuleSlot midroll { + get { return this.midrollField; } + set { this.midrollField = value; } + } + + public BaseAdRuleSlot postroll { + get { return this.postrollField; } + set { this.postrollField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AdRuleStatus { + ACTIVE, + INACTIVE, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum FrequencyCapBehavior { + TURN_ON, + TURN_OFF, + DEFER, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StandardPoddingAdRuleSlot))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OptimizedPoddingAdRuleSlot))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NoPoddingAdRuleSlot))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class BaseAdRuleSlot { + private long idField; + + private bool idFieldSpecified; + + private AdRuleSlotBehavior slotBehaviorField; + + private bool slotBehaviorFieldSpecified; + + private long minVideoAdDurationField; + + private bool minVideoAdDurationFieldSpecified; + + private long maxVideoAdDurationField; + + private bool maxVideoAdDurationFieldSpecified; + + private MidrollFrequencyType videoMidrollFrequencyTypeField; + + private bool videoMidrollFrequencyTypeFieldSpecified; + + private string videoMidrollFrequencyField; + + private AdRuleSlotBumper bumperField; + + private bool bumperFieldSpecified; + + private long maxBumperDurationField; + + private bool maxBumperDurationFieldSpecified; + + private long minPodDurationField; + + private bool minPodDurationFieldSpecified; + + private long maxPodDurationField; + + private bool maxPodDurationFieldSpecified; + + private int maxAdsInPodField; + + private bool maxAdsInPodFieldSpecified; + + private string baseAdRuleSlotTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public AdRuleSlotBehavior slotBehavior { + get { return this.slotBehaviorField; } + set { + this.slotBehaviorField = value; + this.slotBehaviorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool slotBehaviorSpecified { + get { return this.slotBehaviorFieldSpecified; } + set { this.slotBehaviorFieldSpecified = value; } + } + + public long minVideoAdDuration { + get { return this.minVideoAdDurationField; } + set { + this.minVideoAdDurationField = value; + this.minVideoAdDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minVideoAdDurationSpecified { + get { return this.minVideoAdDurationFieldSpecified; } + set { this.minVideoAdDurationFieldSpecified = value; } + } + + public long maxVideoAdDuration { + get { return this.maxVideoAdDurationField; } + set { + this.maxVideoAdDurationField = value; + this.maxVideoAdDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxVideoAdDurationSpecified { + get { return this.maxVideoAdDurationFieldSpecified; } + set { this.maxVideoAdDurationFieldSpecified = value; } + } + + public MidrollFrequencyType videoMidrollFrequencyType { + get { return this.videoMidrollFrequencyTypeField; } + set { + this.videoMidrollFrequencyTypeField = value; + this.videoMidrollFrequencyTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoMidrollFrequencyTypeSpecified { + get { return this.videoMidrollFrequencyTypeFieldSpecified; } + set { this.videoMidrollFrequencyTypeFieldSpecified = value; } + } + + public string videoMidrollFrequency { + get { return this.videoMidrollFrequencyField; } + set { this.videoMidrollFrequencyField = value; } + } + + public AdRuleSlotBumper bumper { + get { return this.bumperField; } + set { + this.bumperField = value; + this.bumperSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bumperSpecified { + get { return this.bumperFieldSpecified; } + set { this.bumperFieldSpecified = value; } + } + + public long maxBumperDuration { + get { return this.maxBumperDurationField; } + set { + this.maxBumperDurationField = value; + this.maxBumperDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxBumperDurationSpecified { + get { return this.maxBumperDurationFieldSpecified; } + set { this.maxBumperDurationFieldSpecified = value; } + } + + public long minPodDuration { + get { return this.minPodDurationField; } + set { + this.minPodDurationField = value; + this.minPodDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minPodDurationSpecified { + get { return this.minPodDurationFieldSpecified; } + set { this.minPodDurationFieldSpecified = value; } + } + + public long maxPodDuration { + get { return this.maxPodDurationField; } + set { + this.maxPodDurationField = value; + this.maxPodDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxPodDurationSpecified { + get { return this.maxPodDurationFieldSpecified; } + set { this.maxPodDurationFieldSpecified = value; } + } + + public int maxAdsInPod { + get { return this.maxAdsInPodField; } + set { + this.maxAdsInPodField = value; + this.maxAdsInPodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxAdsInPodSpecified { + get { return this.maxAdsInPodFieldSpecified; } + set { this.maxAdsInPodFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseAdRuleSlot.Type")] + public string BaseAdRuleSlotType { + get { return this.baseAdRuleSlotTypeField; } + set { this.baseAdRuleSlotTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AdRuleSlotBehavior { + ALWAYS_SHOW, + NEVER_SHOW, + DEFER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum MidrollFrequencyType { + NONE, + EVERY_N_SECONDS, + FIXED_TIME, + EVERY_N_CUEPOINTS, + FIXED_CUE_POINTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AdRuleSlotBumper { + NONE, + BEFORE, + AFTER, + BEFORE_AND_AFTER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class StandardPoddingAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class OptimizedPoddingAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class NoPoddingAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class PoddingError : ApiError { + private PoddingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PoddingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PoddingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum PoddingErrorReason { + INVALID_PODDING_TYPE_NONE, + INVALID_PODDING_TYPE_STANDARD, + INVALID_OPTIMIZED_POD_WITHOUT_DURATION, + INVALID_OPTIMIZED_POD_WITHOUT_ADS, + INVALID_POD_DURATION_RANGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AdRuleSlotError : ApiError { + private AdRuleSlotErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRuleSlotErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRuleSlotError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AdRuleSlotErrorReason { + DIFFERENT_STATUS_THAN_AD_RULE, + INVALID_VIDEO_AD_DURATION_RANGE, + INVALID_VIDEO_MIDROLL_FREQUENCY_TYPE, + MALFORMED_VIDEO_MIDROLL_FREQUENCY_CSV, + MALFORMED_VIDEO_MIDROLL_FREQUENCY_SINGLE_NUMBER, + INVALID_OVERLAY_AD_DURATION_RANGE, + INVALID_OVERLAY_MIDROLL_FREQUENCY_TYPE, + MALFORMED_OVERLAY_MIDROLL_FREQUENCY_CSV, + MALFORMED_OVERLAY_MIDROLL_FREQUENCY_SINGLE_NUMBER, + INVALID_BUMPER_MAX_DURATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AdRulePriorityError : ApiError { + private AdRulePriorityErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRulePriorityErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRulePriorityError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AdRulePriorityErrorReason { + DUPLICATE_PRIORITY, + PRIORITIES_NOT_SEQUENTIAL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AdRuleFrequencyCapError : ApiError { + private AdRuleFrequencyCapErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRuleFrequencyCapErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRuleFrequencyCapError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AdRuleFrequencyCapErrorReason { + NO_FREQUENCY_CAPS_SPECIFIED_WHEN_FREQUENCY_CAPS_TURNED_ON, + FREQUENCY_CAPS_SPECIFIED_WHEN_FREQUENCY_CAPS_TURNED_OFF, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AdRuleDateError : ApiError { + private AdRuleDateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRuleDateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRuleDateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AdRuleDateErrorReason { + START_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_NOT_AFTER_START_TIME, + END_DATE_TIME_TOO_LATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "PlacementServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SiteTargetingInfo))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class PlacementService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public PlacementService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/PlacementService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Placement createPlacement(Placement placement) { + object[] results = this.Invoke("createPlacement", new object[] { placement }); + return ((Placement) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Placement[] createPlacements([System.Xml.Serialization.XmlElementAttribute("placements")] +Placement[] placements) { + object[] results = this.Invoke("createPlacements", new object[] { placements }); + return ((Placement[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Placement getPlacement(long placementId) { + object[] results = this.Invoke("getPlacement", new object[] { placementId }); + return ((Placement) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public PlacementPage getPlacementsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getPlacementsByStatement", new object[] { filterStatement }); + return ((PlacementPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performPlacementAction(PlacementAction placementAction, Statement filterStatement) { + object[] results = this.Invoke("performPlacementAction", new object[] { placementAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Placement updatePlacement(Placement placement) { + object[] results = this.Invoke("updatePlacement", new object[] { placement }); + return ((Placement) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Placement[] updatePlacements([System.Xml.Serialization.XmlElementAttribute("placements")] +Placement[] placements) { + object[] results = this.Invoke("updatePlacements", new object[] { placements }); + return ((Placement[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivatePlacements))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchivePlacements))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivatePlacements))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class PlacementAction { + private string placementActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("PlacementAction.Type")] + public string PlacementActionType { + get { return this.placementActionTypeField; } + set { this.placementActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DeactivatePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ArchivePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ActivatePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class PlacementPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Placement[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Placement[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Placement : SiteTargetingInfo { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private string placementCodeField; + + private InventoryStatus statusField; + + private bool statusFieldSpecified; + + private bool isAdSenseTargetingEnabledField; + + private bool isAdSenseTargetingEnabledFieldSpecified; + + private bool isAdPlannerTargetingEnabledField; + + private bool isAdPlannerTargetingEnabledFieldSpecified; + + private string adSenseTargetingLocaleField; + + private string[] targetedAdUnitIdsField; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public string placementCode { + get { return this.placementCodeField; } + set { this.placementCodeField = value; } + } + + public InventoryStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public bool isAdSenseTargetingEnabled { + get { return this.isAdSenseTargetingEnabledField; } + set { + this.isAdSenseTargetingEnabledField = value; + this.isAdSenseTargetingEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAdSenseTargetingEnabledSpecified { + get { return this.isAdSenseTargetingEnabledFieldSpecified; } + set { this.isAdSenseTargetingEnabledFieldSpecified = value; } + } + + public bool isAdPlannerTargetingEnabled { + get { return this.isAdPlannerTargetingEnabledField; } + set { + this.isAdPlannerTargetingEnabledField = value; + this.isAdPlannerTargetingEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAdPlannerTargetingEnabledSpecified { + get { return this.isAdPlannerTargetingEnabledFieldSpecified; } + set { this.isAdPlannerTargetingEnabledFieldSpecified = value; } + } + + public string adSenseTargetingLocale { + get { return this.adSenseTargetingLocaleField; } + set { this.adSenseTargetingLocaleField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedAdUnitIds")] + public string[] targetedAdUnitIds { + get { return this.targetedAdUnitIdsField; } + set { this.targetedAdUnitIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum InventoryStatus { + ACTIVE, + INACTIVE, + ARCHIVED + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Placement))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class SiteTargetingInfo { + private string targetingDescriptionField; + + private string targetingSiteNameField; + + private string targetingAdLocationField; + + private string siteTargetingInfoTypeField; + + public string targetingDescription { + get { return this.targetingDescriptionField; } + set { this.targetingDescriptionField = value; } + } + + public string targetingSiteName { + get { return this.targetingSiteNameField; } + set { this.targetingSiteNameField = value; } + } + + public string targetingAdLocation { + get { return this.targetingAdLocationField; } + set { this.targetingAdLocationField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("SiteTargetingInfo.Type")] + public string SiteTargetingInfoType { + get { return this.siteTargetingInfoTypeField; } + set { this.siteTargetingInfoTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class RegExError : ApiError { + private RegExErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RegExErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RegExError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum RegExErrorReason { + INVALID, + NULL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class PlacementError : ApiError { + private PlacementErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PlacementErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PlacementError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum PlacementErrorReason { + INVALID_ENTITY_TYPE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomTargetingServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomTargetingService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomTargetingService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/CustomTargetingService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomTargetingKey[] createCustomTargetingKeys([System.Xml.Serialization.XmlElementAttribute("keys")] +CustomTargetingKey[] keys) { + object[] results = this.Invoke("createCustomTargetingKeys", new object[] { keys }); + return ((CustomTargetingKey[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomTargetingValue[] createCustomTargetingValues([System.Xml.Serialization.XmlElementAttribute("values")] +CustomTargetingValue[] values) { + object[] results = this.Invoke("createCustomTargetingValues", new object[] { values }); + return ((CustomTargetingValue[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomTargetingKeyPage getCustomTargetingKeysByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomTargetingKeysByStatement", new object[] { filterStatement }); + return ((CustomTargetingKeyPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomTargetingValuePage getCustomTargetingValuesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomTargetingValuesByStatement", new object[] { filterStatement }); + return ((CustomTargetingValuePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performCustomTargetingKeyAction(CustomTargetingKeyAction customTargetingKeyAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomTargetingKeyAction", new object[] { customTargetingKeyAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performCustomTargetingValueAction(CustomTargetingValueAction customTargetingValueAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomTargetingValueAction", new object[] { customTargetingValueAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomTargetingKey[] updateCustomTargetingKeys([System.Xml.Serialization.XmlElementAttribute("keys")] +CustomTargetingKey[] keys) { + object[] results = this.Invoke("updateCustomTargetingKeys", new object[] { keys }); + return ((CustomTargetingKey[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomTargetingValue[] updateCustomTargetingValues([System.Xml.Serialization.XmlElementAttribute("values")] +CustomTargetingValue[] values) { + object[] results = this.Invoke("updateCustomTargetingValues", new object[] { values }); + return ((CustomTargetingValue[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteCustomTargetingValues))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class CustomTargetingValueAction { + private string customTargetingValueActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomTargetingValueAction.Type")] + public string CustomTargetingValueActionType { + get { return this.customTargetingValueActionTypeField; } + set { this.customTargetingValueActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DeleteCustomTargetingValues : CustomTargetingValueAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteCustomTargetingKeys))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class CustomTargetingKeyAction { + private string customTargetingKeyActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomTargetingKeyAction.Type")] + public string CustomTargetingKeyActionType { + get { return this.customTargetingKeyActionTypeField; } + set { this.customTargetingKeyActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DeleteCustomTargetingKeys : CustomTargetingKeyAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CustomTargetingValuePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomTargetingValue[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomTargetingValue[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CustomTargetingValue { + private long customTargetingKeyIdField; + + private bool customTargetingKeyIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string displayNameField; + + private CustomTargetingValueMatchType matchTypeField; + + private bool matchTypeFieldSpecified; + + public long customTargetingKeyId { + get { return this.customTargetingKeyIdField; } + set { + this.customTargetingKeyIdField = value; + this.customTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customTargetingKeyIdSpecified { + get { return this.customTargetingKeyIdFieldSpecified; } + set { this.customTargetingKeyIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public CustomTargetingValueMatchType matchType { + get { return this.matchTypeField; } + set { + this.matchTypeField = value; + this.matchTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool matchTypeSpecified { + get { return this.matchTypeFieldSpecified; } + set { this.matchTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingValue.MatchType", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CustomTargetingValueMatchType { + EXACT, + BROAD, + PREFIX, + BROAD_PREFIX + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CustomTargetingKeyPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomTargetingKey[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomTargetingKey[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CustomTargetingKey { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string displayNameField; + + private CustomTargetingKeyType typeField; + + private bool typeFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public CustomTargetingKeyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingKey.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CustomTargetingKeyType { + PREDEFINED, + FREEFORM + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Asset))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/CreativeService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Creative createCreative(Creative creative) { + object[] results = this.Invoke("createCreative", new object[] { creative }); + return ((Creative) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Creative[] createCreatives([System.Xml.Serialization.XmlElementAttribute("creatives")] +Creative[] creatives) { + object[] results = this.Invoke("createCreatives", new object[] { creatives }); + return ((Creative[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Creative getCreative(long creativeId) { + object[] results = this.Invoke("getCreative", new object[] { creativeId }); + return ((Creative) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativePage getCreativesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativesByStatement", new object[] { filterStatement }); + return ((CreativePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Creative updateCreative(Creative creative) { + object[] results = this.Invoke("updateCreative", new object[] { creative }); + return ((Creative) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Creative[] updateCreatives([System.Xml.Serialization.XmlElementAttribute("creatives")] +Creative[] creatives) { + object[] results = this.Invoke("updateCreatives", new object[] { creatives }); + return ((Creative[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CreativePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Creative[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Creative[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VastRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnsupportedCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ThirdPartyCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TemplateCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InternalRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasDestinationUrlCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TextAdCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FloatingFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashPushdownCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashExpandableCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpMobileCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseVideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AspectRatioImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClickTrackingCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseRichMediaStudioCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasHtmlSnippetDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class Creative { + private long advertiserIdField; + + private bool advertiserIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private Size sizeField; + + private string previewUrlField; + + private AppliedLabel[] appliedLabelsField; + + private DateTime lastModifiedDateTimeField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private string creativeTypeField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { + this.advertiserIdField = value; + this.advertiserIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserIdSpecified { + get { return this.advertiserIdFieldSpecified; } + set { this.advertiserIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + public string previewUrl { + get { return this.previewUrlField; } + set { this.previewUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Creative.Type")] + public string CreativeType { + get { return this.creativeTypeField; } + set { this.creativeTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class VastRedirectCreative : Creative { + private string vastXmlUrlField; + + private VastRedirectType vastRedirectTypeField; + + private bool vastRedirectTypeFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + public string vastXmlUrl { + get { return this.vastXmlUrlField; } + set { this.vastXmlUrlField = value; } + } + + public VastRedirectType vastRedirectType { + get { return this.vastRedirectTypeField; } + set { + this.vastRedirectTypeField = value; + this.vastRedirectTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool vastRedirectTypeSpecified { + get { return this.vastRedirectTypeFieldSpecified; } + set { this.vastRedirectTypeFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum VastRedirectType { + LINEAR, + NON_LINEAR, + LINEAR_AND_NON_LINEAR + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ConversionEvent_TrackingUrlsMapEntry { + private ConversionEvent keyField; + + private bool keyFieldSpecified; + + private string[] valueField; + + public ConversionEvent key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("urls", IsNullable = false)] + public string[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ConversionEvent { + CREATIVE_VIEW, + START, + SKIP_SHOWN, + FIRST_QUARTILE, + MIDPOINT, + THIRD_QUARTILE, + ENGAGED_VIEW, + COMPLETE, + MUTE, + UNMUTE, + PAUSE, + REWIND, + RESUME, + SKIPPED, + FULLSCREEN, + EXPAND, + COLLAPSE, + ACCEPT_INVITATION, + CLOSE, + CLICK_TRACKING, + SURVEY, + CUSTOM_CLICK + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class UnsupportedCreative : Creative { + private string unsupportedCreativeTypeField; + + public string unsupportedCreativeType { + get { return this.unsupportedCreativeTypeField; } + set { this.unsupportedCreativeTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ThirdPartyCreative : Creative { + private string snippetField; + + private string expandedSnippetField; + + public string snippet { + get { return this.snippetField; } + set { this.snippetField = value; } + } + + public string expandedSnippet { + get { return this.expandedSnippetField; } + set { this.expandedSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class TemplateCreative : Creative { + private long creativeTemplateIdField; + + private bool creativeTemplateIdFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + private BaseCreativeTemplateVariableValue[] creativeTemplateVariableValuesField; + + public long creativeTemplateId { + get { return this.creativeTemplateIdField; } + set { + this.creativeTemplateIdField = value; + this.creativeTemplateIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeTemplateIdSpecified { + get { return this.creativeTemplateIdFieldSpecified; } + set { this.creativeTemplateIdFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativeTemplateVariableValues")] + public BaseCreativeTemplateVariableValue[] creativeTemplateVariableValues { + get { return this.creativeTemplateVariableValuesField; } + set { this.creativeTemplateVariableValuesField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UrlCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetCreativeTemplateVariableValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class BaseCreativeTemplateVariableValue { + private string uniqueNameField; + + private string baseCreativeTemplateVariableValueTypeField; + + public string uniqueName { + get { return this.uniqueNameField; } + set { this.uniqueNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseCreativeTemplateVariableValue.Type")] + public string BaseCreativeTemplateVariableValueType { + get { return this.baseCreativeTemplateVariableValueTypeField; } + set { this.baseCreativeTemplateVariableValueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class UrlCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class StringCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class LongCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private long valueField; + + private bool valueFieldSpecified; + + public long value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AssetCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class LegacyDfpCreative : Creative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class InternalRedirectCreative : Creative { + private Size assetSizeField; + + private string internalRedirectUrlField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public Size assetSize { + get { return this.assetSizeField; } + set { this.assetSizeField = value; } + } + + public string internalRedirectUrl { + get { return this.internalRedirectUrlField; } + set { this.internalRedirectUrlField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TextAdCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FloatingFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashPushdownCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashExpandableCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpMobileCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseVideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AspectRatioImageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class HasDestinationUrlCreative : Creative { + private string destinationUrlField; + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class VpaidLinearRedirectCreative : HasDestinationUrlCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + private string flashUrlField; + + private Size flashAssetSizeField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string flashUrl { + get { return this.flashUrlField; } + set { this.flashUrlField = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class VpaidLinearCreative : HasDestinationUrlCreative { + private string flashNameField; + + private byte[] flashByteArrayField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private Size flashAssetSizeField; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + public string flashName { + get { return this.flashNameField; } + set { this.flashNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] flashByteArray { + get { return this.flashByteArrayField; } + set { this.flashByteArrayField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class TextAdCreative : HasDestinationUrlCreative { + private string hoverTextField; + + private TargetWindow targetWindowField; + + private bool targetWindowFieldSpecified; + + private string linkColorField; + + private string linkTitleField; + + private string textField; + + private string textColorField; + + public string hoverText { + get { return this.hoverTextField; } + set { this.hoverTextField = value; } + } + + public TargetWindow targetWindow { + get { return this.targetWindowField; } + set { + this.targetWindowField = value; + this.targetWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetWindowSpecified { + get { return this.targetWindowFieldSpecified; } + set { this.targetWindowFieldSpecified = value; } + } + + public string linkColor { + get { return this.linkColorField; } + set { this.linkColorField = value; } + } + + public string linkTitle { + get { return this.linkTitleField; } + set { this.linkTitleField = value; } + } + + public string text { + get { return this.textField; } + set { this.textField = value; } + } + + public string textColor { + get { return this.textColorField; } + set { this.textColorField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum TargetWindow { + BLANK, + TOP + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class FloatingFlashCreative : HasDestinationUrlCreative { + private string flashNameField; + + private byte[] flashByteArrayField; + + private long flashAssetIdField; + + private bool flashAssetIdFieldSpecified; + + private string fallbackImageNameField; + + private byte[] fallbackImageByteArrayField; + + private long fallbackImageAssetIdField; + + private bool fallbackImageAssetIdFieldSpecified; + + private int requiredFlashVersionField; + + private bool requiredFlashVersionFieldSpecified; + + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + private string topPositionField; + + private string leftPositionField; + + private int displayTimeInSecondField; + + private bool displayTimeInSecondFieldSpecified; + + private string thirdPartyImpressionTrackerField; + + public string flashName { + get { return this.flashNameField; } + set { this.flashNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] flashByteArray { + get { return this.flashByteArrayField; } + set { this.flashByteArrayField = value; } + } + + public long flashAssetId { + get { return this.flashAssetIdField; } + set { + this.flashAssetIdField = value; + this.flashAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool flashAssetIdSpecified { + get { return this.flashAssetIdFieldSpecified; } + set { this.flashAssetIdFieldSpecified = value; } + } + + public string fallbackImageName { + get { return this.fallbackImageNameField; } + set { this.fallbackImageNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] fallbackImageByteArray { + get { return this.fallbackImageByteArrayField; } + set { this.fallbackImageByteArrayField = value; } + } + + public long fallbackImageAssetId { + get { return this.fallbackImageAssetIdField; } + set { + this.fallbackImageAssetIdField = value; + this.fallbackImageAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fallbackImageAssetIdSpecified { + get { return this.fallbackImageAssetIdFieldSpecified; } + set { this.fallbackImageAssetIdFieldSpecified = value; } + } + + public int requiredFlashVersion { + get { return this.requiredFlashVersionField; } + set { + this.requiredFlashVersionField = value; + this.requiredFlashVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool requiredFlashVersionSpecified { + get { return this.requiredFlashVersionFieldSpecified; } + set { this.requiredFlashVersionFieldSpecified = value; } + } + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + public string topPosition { + get { return this.topPositionField; } + set { this.topPositionField = value; } + } + + public string leftPosition { + get { return this.leftPositionField; } + set { this.leftPositionField = value; } + } + + public int displayTimeInSecond { + get { return this.displayTimeInSecondField; } + set { + this.displayTimeInSecondField = value; + this.displayTimeInSecondSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool displayTimeInSecondSpecified { + get { return this.displayTimeInSecondFieldSpecified; } + set { this.displayTimeInSecondFieldSpecified = value; } + } + + public string thirdPartyImpressionTracker { + get { return this.thirdPartyImpressionTrackerField; } + set { this.thirdPartyImpressionTrackerField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class FlashPushdownCreative : HasDestinationUrlCreative { + private long collapsedFlashAssetIdField; + + private bool collapsedFlashAssetIdFieldSpecified; + + private byte[] collapsedFlashAssetByteArrayField; + + private string collapsedFlashFileNameField; + + private long collapsedFallbackImageAssetIdField; + + private bool collapsedFallbackImageAssetIdFieldSpecified; + + private byte[] collapsedFallbackImageAssetByteArrayField; + + private string collapsedFallbackImageFileNameField; + + private long expandedFlashAssetIdField; + + private bool expandedFlashAssetIdFieldSpecified; + + private byte[] expandedFlashAssetByteArrayField; + + private string expandedFlashFileNameField; + + private int requiredFlashVersionField; + + private bool requiredFlashVersionFieldSpecified; + + private int widthField; + + private bool widthFieldSpecified; + + private int collapsedHeightField; + + private bool collapsedHeightFieldSpecified; + + private int expandedHeightField; + + private bool expandedHeightFieldSpecified; + + private bool pushdownOnMouseOverField; + + private bool pushdownOnMouseOverFieldSpecified; + + private string javascriptFunctionForPushdownField; + + private bool collapseOnMouseOutField; + + private bool collapseOnMouseOutFieldSpecified; + + private string javascriptFunctionForCollapseField; + + public long collapsedFlashAssetId { + get { return this.collapsedFlashAssetIdField; } + set { + this.collapsedFlashAssetIdField = value; + this.collapsedFlashAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapsedFlashAssetIdSpecified { + get { return this.collapsedFlashAssetIdFieldSpecified; } + set { this.collapsedFlashAssetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] collapsedFlashAssetByteArray { + get { return this.collapsedFlashAssetByteArrayField; } + set { this.collapsedFlashAssetByteArrayField = value; } + } + + public string collapsedFlashFileName { + get { return this.collapsedFlashFileNameField; } + set { this.collapsedFlashFileNameField = value; } + } + + public long collapsedFallbackImageAssetId { + get { return this.collapsedFallbackImageAssetIdField; } + set { + this.collapsedFallbackImageAssetIdField = value; + this.collapsedFallbackImageAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapsedFallbackImageAssetIdSpecified { + get { return this.collapsedFallbackImageAssetIdFieldSpecified; } + set { this.collapsedFallbackImageAssetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] collapsedFallbackImageAssetByteArray { + get { return this.collapsedFallbackImageAssetByteArrayField; } + set { this.collapsedFallbackImageAssetByteArrayField = value; } + } + + public string collapsedFallbackImageFileName { + get { return this.collapsedFallbackImageFileNameField; } + set { this.collapsedFallbackImageFileNameField = value; } + } + + public long expandedFlashAssetId { + get { return this.expandedFlashAssetIdField; } + set { + this.expandedFlashAssetIdField = value; + this.expandedFlashAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expandedFlashAssetIdSpecified { + get { return this.expandedFlashAssetIdFieldSpecified; } + set { this.expandedFlashAssetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] expandedFlashAssetByteArray { + get { return this.expandedFlashAssetByteArrayField; } + set { this.expandedFlashAssetByteArrayField = value; } + } + + public string expandedFlashFileName { + get { return this.expandedFlashFileNameField; } + set { this.expandedFlashFileNameField = value; } + } + + public int requiredFlashVersion { + get { return this.requiredFlashVersionField; } + set { + this.requiredFlashVersionField = value; + this.requiredFlashVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool requiredFlashVersionSpecified { + get { return this.requiredFlashVersionFieldSpecified; } + set { this.requiredFlashVersionFieldSpecified = value; } + } + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int collapsedHeight { + get { return this.collapsedHeightField; } + set { + this.collapsedHeightField = value; + this.collapsedHeightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapsedHeightSpecified { + get { return this.collapsedHeightFieldSpecified; } + set { this.collapsedHeightFieldSpecified = value; } + } + + public int expandedHeight { + get { return this.expandedHeightField; } + set { + this.expandedHeightField = value; + this.expandedHeightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expandedHeightSpecified { + get { return this.expandedHeightFieldSpecified; } + set { this.expandedHeightFieldSpecified = value; } + } + + public bool pushdownOnMouseOver { + get { return this.pushdownOnMouseOverField; } + set { + this.pushdownOnMouseOverField = value; + this.pushdownOnMouseOverSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool pushdownOnMouseOverSpecified { + get { return this.pushdownOnMouseOverFieldSpecified; } + set { this.pushdownOnMouseOverFieldSpecified = value; } + } + + public string javascriptFunctionForPushdown { + get { return this.javascriptFunctionForPushdownField; } + set { this.javascriptFunctionForPushdownField = value; } + } + + public bool collapseOnMouseOut { + get { return this.collapseOnMouseOutField; } + set { + this.collapseOnMouseOutField = value; + this.collapseOnMouseOutSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapseOnMouseOutSpecified { + get { return this.collapseOnMouseOutFieldSpecified; } + set { this.collapseOnMouseOutFieldSpecified = value; } + } + + public string javascriptFunctionForCollapse { + get { return this.javascriptFunctionForCollapseField; } + set { this.javascriptFunctionForCollapseField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class FlashExpandableCreative : HasDestinationUrlCreative { + private long collapsedFlashAssetIdField; + + private bool collapsedFlashAssetIdFieldSpecified; + + private byte[] collapsedFlashAssetByteArrayField; + + private string collapsedFlashFileNameField; + + private long collapsedFallbackImageAssetIdField; + + private bool collapsedFallbackImageAssetIdFieldSpecified; + + private byte[] collapsedFallbackImageAssetByteArrayField; + + private string collapsedFallbackImageFileNameField; + + private long expandedFlashAssetIdField; + + private bool expandedFlashAssetIdFieldSpecified; + + private byte[] expandedFlashAssetByteArrayField; + + private string expandedFlashFileNameField; + + private int requiredFlashVersionField; + + private bool requiredFlashVersionFieldSpecified; + + private int collapsedWidthField; + + private bool collapsedWidthFieldSpecified; + + private int collapsedHeightField; + + private bool collapsedHeightFieldSpecified; + + private int expandedWidthField; + + private bool expandedWidthFieldSpecified; + + private int expandedHeightField; + + private bool expandedHeightFieldSpecified; + + private FlashExpandableCreativeExpandDirection expandDirectionField; + + private bool expandDirectionFieldSpecified; + + private bool expandOnMouseOverField; + + private bool expandOnMouseOverFieldSpecified; + + private string javascriptFunctionForExpandField; + + private bool collapseOnMouseOutField; + + private bool collapseOnMouseOutFieldSpecified; + + private string javascriptFunctionForCollapseField; + + public long collapsedFlashAssetId { + get { return this.collapsedFlashAssetIdField; } + set { + this.collapsedFlashAssetIdField = value; + this.collapsedFlashAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapsedFlashAssetIdSpecified { + get { return this.collapsedFlashAssetIdFieldSpecified; } + set { this.collapsedFlashAssetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] collapsedFlashAssetByteArray { + get { return this.collapsedFlashAssetByteArrayField; } + set { this.collapsedFlashAssetByteArrayField = value; } + } + + public string collapsedFlashFileName { + get { return this.collapsedFlashFileNameField; } + set { this.collapsedFlashFileNameField = value; } + } + + public long collapsedFallbackImageAssetId { + get { return this.collapsedFallbackImageAssetIdField; } + set { + this.collapsedFallbackImageAssetIdField = value; + this.collapsedFallbackImageAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapsedFallbackImageAssetIdSpecified { + get { return this.collapsedFallbackImageAssetIdFieldSpecified; } + set { this.collapsedFallbackImageAssetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] collapsedFallbackImageAssetByteArray { + get { return this.collapsedFallbackImageAssetByteArrayField; } + set { this.collapsedFallbackImageAssetByteArrayField = value; } + } + + public string collapsedFallbackImageFileName { + get { return this.collapsedFallbackImageFileNameField; } + set { this.collapsedFallbackImageFileNameField = value; } + } + + public long expandedFlashAssetId { + get { return this.expandedFlashAssetIdField; } + set { + this.expandedFlashAssetIdField = value; + this.expandedFlashAssetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expandedFlashAssetIdSpecified { + get { return this.expandedFlashAssetIdFieldSpecified; } + set { this.expandedFlashAssetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] expandedFlashAssetByteArray { + get { return this.expandedFlashAssetByteArrayField; } + set { this.expandedFlashAssetByteArrayField = value; } + } + + public string expandedFlashFileName { + get { return this.expandedFlashFileNameField; } + set { this.expandedFlashFileNameField = value; } + } + + public int requiredFlashVersion { + get { return this.requiredFlashVersionField; } + set { + this.requiredFlashVersionField = value; + this.requiredFlashVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool requiredFlashVersionSpecified { + get { return this.requiredFlashVersionFieldSpecified; } + set { this.requiredFlashVersionFieldSpecified = value; } + } + + public int collapsedWidth { + get { return this.collapsedWidthField; } + set { + this.collapsedWidthField = value; + this.collapsedWidthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapsedWidthSpecified { + get { return this.collapsedWidthFieldSpecified; } + set { this.collapsedWidthFieldSpecified = value; } + } + + public int collapsedHeight { + get { return this.collapsedHeightField; } + set { + this.collapsedHeightField = value; + this.collapsedHeightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapsedHeightSpecified { + get { return this.collapsedHeightFieldSpecified; } + set { this.collapsedHeightFieldSpecified = value; } + } + + public int expandedWidth { + get { return this.expandedWidthField; } + set { + this.expandedWidthField = value; + this.expandedWidthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expandedWidthSpecified { + get { return this.expandedWidthFieldSpecified; } + set { this.expandedWidthFieldSpecified = value; } + } + + public int expandedHeight { + get { return this.expandedHeightField; } + set { + this.expandedHeightField = value; + this.expandedHeightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expandedHeightSpecified { + get { return this.expandedHeightFieldSpecified; } + set { this.expandedHeightFieldSpecified = value; } + } + + public FlashExpandableCreativeExpandDirection expandDirection { + get { return this.expandDirectionField; } + set { + this.expandDirectionField = value; + this.expandDirectionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expandDirectionSpecified { + get { return this.expandDirectionFieldSpecified; } + set { this.expandDirectionFieldSpecified = value; } + } + + public bool expandOnMouseOver { + get { return this.expandOnMouseOverField; } + set { + this.expandOnMouseOverField = value; + this.expandOnMouseOverSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expandOnMouseOverSpecified { + get { return this.expandOnMouseOverFieldSpecified; } + set { this.expandOnMouseOverFieldSpecified = value; } + } + + public string javascriptFunctionForExpand { + get { return this.javascriptFunctionForExpandField; } + set { this.javascriptFunctionForExpandField = value; } + } + + public bool collapseOnMouseOut { + get { return this.collapseOnMouseOutField; } + set { + this.collapseOnMouseOutField = value; + this.collapseOnMouseOutSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool collapseOnMouseOutSpecified { + get { return this.collapseOnMouseOutFieldSpecified; } + set { this.collapseOnMouseOutFieldSpecified = value; } + } + + public string javascriptFunctionForCollapse { + get { return this.javascriptFunctionForCollapseField; } + set { this.javascriptFunctionForCollapseField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FlashExpandableCreative.ExpandDirection", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum FlashExpandableCreativeExpandDirection { + LEFT, + RIGHT, + UP, + DOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class LegacyDfpMobileCreative : HasDestinationUrlCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CustomCreative : HasDestinationUrlCreative { + private string htmlSnippetField; + + private CustomCreativeAsset[] customCreativeAssetsField; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public string htmlSnippet { + get { return this.htmlSnippetField; } + set { this.htmlSnippetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customCreativeAssets")] + public CustomCreativeAsset[] customCreativeAssets { + get { return this.customCreativeAssetsField; } + set { this.customCreativeAssetsField = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CustomCreativeAsset { + private string macroNameField; + + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + private long fileSizeField; + + private bool fileSizeFieldSpecified; + + public string macroName { + get { return this.macroNameField; } + set { this.macroNameField = value; } + } + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public long fileSize { + get { return this.fileSizeField; } + set { + this.fileSizeField = value; + this.fileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fileSizeSpecified { + get { return this.fileSizeFieldSpecified; } + set { this.fileSizeFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class BaseVideoCreative : HasDestinationUrlCreative { + private int durationField; + + private bool durationFieldSpecified; + + private bool allowDurationOverrideField; + + private bool allowDurationOverrideFieldSpecified; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private long[] companionCreativeIdsField; + + private string customParametersField; + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public bool allowDurationOverride { + get { return this.allowDurationOverrideField; } + set { + this.allowDurationOverrideField = value; + this.allowDurationOverrideSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowDurationOverrideSpecified { + get { return this.allowDurationOverrideFieldSpecified; } + set { this.allowDurationOverrideFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class VideoRedirectCreative : BaseVideoCreative { + private VideoRedirectAsset[] videoAssetsField; + + [System.Xml.Serialization.XmlElementAttribute("videoAssets")] + public VideoRedirectAsset[] videoAssets { + get { return this.videoAssetsField; } + set { this.videoAssetsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class VideoRedirectAsset : RedirectAsset { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class RedirectAsset : Asset { + private string redirectUrlField; + + public string redirectUrl { + get { return this.redirectUrlField; } + set { this.redirectUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RedirectAsset))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class Asset { + private string assetTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Asset.Type")] + public string AssetType { + get { return this.assetTypeField; } + set { this.assetTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class VideoCreative : BaseVideoCreative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class BaseImageRedirectCreative : HasDestinationUrlCreative { + private string imageUrlField; + + public string imageUrl { + get { return this.imageUrlField; } + set { this.imageUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ImageRedirectOverlayCreative : BaseImageRedirectCreative { + private Size assetSizeField; + + private int durationField; + + private bool durationFieldSpecified; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + public Size assetSize { + get { return this.assetSizeField; } + set { this.assetSizeField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ImageRedirectCreative : BaseImageRedirectCreative { + private string altTextField; + + private string thirdPartyImpressionUrlField; + + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + public string thirdPartyImpressionUrl { + get { return this.thirdPartyImpressionUrlField; } + set { this.thirdPartyImpressionUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class BaseImageCreative : HasDestinationUrlCreative { + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private CreativeAsset primaryImageAssetField; + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public CreativeAsset primaryImageAsset { + get { return this.primaryImageAssetField; } + set { this.primaryImageAssetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CreativeAsset { + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + private long fileSizeField; + + private bool fileSizeFieldSpecified; + + private string assetUrlField; + + private Size sizeField; + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public long fileSize { + get { return this.fileSizeField; } + set { + this.fileSizeField = value; + this.fileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fileSizeSpecified { + get { return this.fileSizeFieldSpecified; } + set { this.fileSizeFieldSpecified = value; } + } + + public string assetUrl { + get { return this.assetUrlField; } + set { this.assetUrlField = value; } + } + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ImageOverlayCreative : BaseImageCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ImageCreative : BaseImageCreative { + private string altTextField; + + private string thirdPartyImpressionUrlField; + + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + public string thirdPartyImpressionUrl { + get { return this.thirdPartyImpressionUrlField; } + set { this.thirdPartyImpressionUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class BaseFlashRedirectCreative : HasDestinationUrlCreative { + private string flashUrlField; + + private string fallbackUrlField; + + private string fallbackPreviewUrlField; + + public string flashUrl { + get { return this.flashUrlField; } + set { this.flashUrlField = value; } + } + + public string fallbackUrl { + get { return this.fallbackUrlField; } + set { this.fallbackUrlField = value; } + } + + public string fallbackPreviewUrl { + get { return this.fallbackPreviewUrlField; } + set { this.fallbackPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class FlashRedirectOverlayCreative : BaseFlashRedirectCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private ApiFramework apiFrameworkField; + + private bool apiFrameworkFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + private Size flashAssetSizeField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public ApiFramework apiFramework { + get { return this.apiFrameworkField; } + set { + this.apiFrameworkField = value; + this.apiFrameworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool apiFrameworkSpecified { + get { return this.apiFrameworkFieldSpecified; } + set { this.apiFrameworkFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ApiFramework { + NONE, + CLICKTAG, + VPAID + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class FlashRedirectCreative : BaseFlashRedirectCreative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class BaseFlashCreative : HasDestinationUrlCreative { + private string flashNameField; + + private byte[] flashByteArrayField; + + private string fallbackImageNameField; + + private byte[] fallbackImageByteArrayField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private bool clickTagRequiredField; + + private bool clickTagRequiredFieldSpecified; + + private string fallbackPreviewUrlField; + + private Size flashAssetSizeField; + + private Size fallbackAssetSizeField; + + public string flashName { + get { return this.flashNameField; } + set { this.flashNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] flashByteArray { + get { return this.flashByteArrayField; } + set { this.flashByteArrayField = value; } + } + + public string fallbackImageName { + get { return this.fallbackImageNameField; } + set { this.fallbackImageNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] fallbackImageByteArray { + get { return this.fallbackImageByteArrayField; } + set { this.fallbackImageByteArrayField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public bool clickTagRequired { + get { return this.clickTagRequiredField; } + set { + this.clickTagRequiredField = value; + this.clickTagRequiredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clickTagRequiredSpecified { + get { return this.clickTagRequiredFieldSpecified; } + set { this.clickTagRequiredFieldSpecified = value; } + } + + public string fallbackPreviewUrl { + get { return this.fallbackPreviewUrlField; } + set { this.fallbackPreviewUrlField = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + public Size fallbackAssetSize { + get { return this.fallbackAssetSizeField; } + set { this.fallbackAssetSizeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class FlashOverlayCreative : BaseFlashCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private ApiFramework apiFrameworkField; + + private bool apiFrameworkFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public ApiFramework apiFramework { + get { return this.apiFrameworkField; } + set { + this.apiFrameworkField = value; + this.apiFrameworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool apiFrameworkSpecified { + get { return this.apiFrameworkFieldSpecified; } + set { this.apiFrameworkFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class FlashCreative : BaseFlashCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AspectRatioImageCreative : HasDestinationUrlCreative { + private CreativeAsset[] imageAssetsField; + + private string altTextField; + + private string thirdPartyImpressionUrlField; + + [System.Xml.Serialization.XmlElementAttribute("imageAssets")] + public CreativeAsset[] imageAssets { + get { return this.imageAssetsField; } + set { this.imageAssetsField = value; } + } + + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + public string thirdPartyImpressionUrl { + get { return this.thirdPartyImpressionUrlField; } + set { this.thirdPartyImpressionUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ClickTrackingCreative : Creative { + private string clickTrackingUrlField; + + public string clickTrackingUrl { + get { return this.clickTrackingUrlField; } + set { this.clickTrackingUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class BaseRichMediaStudioCreative : Creative { + private long studioCreativeIdField; + + private bool studioCreativeIdFieldSpecified; + + private RichMediaStudioCreativeFormat creativeFormatField; + + private bool creativeFormatFieldSpecified; + + private RichMediaStudioCreativeArtworkType artworkTypeField; + + private bool artworkTypeFieldSpecified; + + private long totalFileSizeField; + + private bool totalFileSizeFieldSpecified; + + private string[] adTagKeysField; + + private string[] customKeyValuesField; + + private string surveyUrlField; + + private string allImpressionsUrlField; + + private string richMediaImpressionsUrlField; + + private string backupImageImpressionsUrlField; + + private string overrideCssField; + + private string requiredFlashPluginVersionField; + + private int durationField; + + private bool durationFieldSpecified; + + private RichMediaStudioCreativeBillingAttribute billingAttributeField; + + private bool billingAttributeFieldSpecified; + + private RichMediaStudioChildAssetProperty[] richMediaStudioChildAssetPropertiesField; + + public long studioCreativeId { + get { return this.studioCreativeIdField; } + set { + this.studioCreativeIdField = value; + this.studioCreativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool studioCreativeIdSpecified { + get { return this.studioCreativeIdFieldSpecified; } + set { this.studioCreativeIdFieldSpecified = value; } + } + + public RichMediaStudioCreativeFormat creativeFormat { + get { return this.creativeFormatField; } + set { + this.creativeFormatField = value; + this.creativeFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeFormatSpecified { + get { return this.creativeFormatFieldSpecified; } + set { this.creativeFormatFieldSpecified = value; } + } + + public RichMediaStudioCreativeArtworkType artworkType { + get { return this.artworkTypeField; } + set { + this.artworkTypeField = value; + this.artworkTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool artworkTypeSpecified { + get { return this.artworkTypeFieldSpecified; } + set { this.artworkTypeFieldSpecified = value; } + } + + public long totalFileSize { + get { return this.totalFileSizeField; } + set { + this.totalFileSizeField = value; + this.totalFileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalFileSizeSpecified { + get { return this.totalFileSizeFieldSpecified; } + set { this.totalFileSizeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adTagKeys")] + public string[] adTagKeys { + get { return this.adTagKeysField; } + set { this.adTagKeysField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customKeyValues")] + public string[] customKeyValues { + get { return this.customKeyValuesField; } + set { this.customKeyValuesField = value; } + } + + public string surveyUrl { + get { return this.surveyUrlField; } + set { this.surveyUrlField = value; } + } + + public string allImpressionsUrl { + get { return this.allImpressionsUrlField; } + set { this.allImpressionsUrlField = value; } + } + + public string richMediaImpressionsUrl { + get { return this.richMediaImpressionsUrlField; } + set { this.richMediaImpressionsUrlField = value; } + } + + public string backupImageImpressionsUrl { + get { return this.backupImageImpressionsUrlField; } + set { this.backupImageImpressionsUrlField = value; } + } + + public string overrideCss { + get { return this.overrideCssField; } + set { this.overrideCssField = value; } + } + + public string requiredFlashPluginVersion { + get { return this.requiredFlashPluginVersionField; } + set { this.requiredFlashPluginVersionField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public RichMediaStudioCreativeBillingAttribute billingAttribute { + get { return this.billingAttributeField; } + set { + this.billingAttributeField = value; + this.billingAttributeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingAttributeSpecified { + get { return this.billingAttributeFieldSpecified; } + set { this.billingAttributeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("richMediaStudioChildAssetProperties")] + public RichMediaStudioChildAssetProperty[] richMediaStudioChildAssetProperties { + get { return this.richMediaStudioChildAssetPropertiesField; } + set { this.richMediaStudioChildAssetPropertiesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum RichMediaStudioCreativeFormat { + IN_PAGE, + EXPANDING, + IM_EXPANDING, + FLOATING, + PEEL_DOWN, + IN_PAGE_WITH_FLOATING, + FLASH_IN_FLASH, + FLASH_IN_FLASH_EXPANDING, + IN_APP, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum RichMediaStudioCreativeArtworkType { + FLASH, + HTML5, + MIXED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum RichMediaStudioCreativeBillingAttribute { + IN_PAGE, + FLOATING_EXPANDING, + VIDEO, + FLASH_IN_FLASH + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class RichMediaStudioChildAssetProperty { + private string nameField; + + private RichMediaStudioChildAssetPropertyType typeField; + + private bool typeFieldSpecified; + + private long totalFileSizeField; + + private bool totalFileSizeFieldSpecified; + + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + private string urlField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public RichMediaStudioChildAssetPropertyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public long totalFileSize { + get { return this.totalFileSizeField; } + set { + this.totalFileSizeField = value; + this.totalFileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalFileSizeSpecified { + get { return this.totalFileSizeFieldSpecified; } + set { this.totalFileSizeFieldSpecified = value; } + } + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaStudioChildAssetProperty.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum RichMediaStudioChildAssetPropertyType { + FLASH, + VIDEO, + IMAGE, + DATA + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class RichMediaStudioCreative : BaseRichMediaStudioCreative { + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasHtmlSnippetDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class BaseDynamicAllocationCreative : Creative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class HasHtmlSnippetDynamicAllocationCreative : BaseDynamicAllocationCreative { + private string codeSnippetField; + + public string codeSnippet { + get { return this.codeSnippetField; } + set { this.codeSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AdSenseCreative : HasHtmlSnippetDynamicAllocationCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AdExchangeCreative : HasHtmlSnippetDynamicAllocationCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class TemplateInstantiatedCreativeError : ApiError { + private TemplateInstantiatedCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TemplateInstantiatedCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TemplateInstantiatedCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum TemplateInstantiatedCreativeErrorReason { + INACTIVE_CREATIVE_TEMPLATE, + FILE_TYPE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class RichMediaStudioCreativeError : ApiError { + private RichMediaStudioCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RichMediaStudioCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaStudioCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum RichMediaStudioCreativeErrorReason { + CREATION_NOT_ALLOWED, + UKNOWN_ERROR, + INVALID_CODE_GENERATION_REQUEST, + INVALID_CREATIVE_OBJECT, + STUDIO_CONNECTION_ERROR, + PUSHDOWN_DURATION_NOT_ALLOWED, + INVALID_POSITION, + INVALID_Z_INDEX, + INVALID_PUSHDOWN_DURATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class InvalidPhoneNumberError : ApiError { + private InvalidPhoneNumberErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidPhoneNumberErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidPhoneNumberError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum InvalidPhoneNumberErrorReason { + INVALID_FORMAT, + TOO_SHORT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ImageError : ApiError { + private ImageErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ImageErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ImageError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ImageErrorReason { + INVALID_IMAGE, + INVALID_SIZE, + UNEXPECTED_SIZE, + OVERLAY_SIZE_TOO_LARGE, + ANIMATED_NOT_ALLOWED, + ANIMATION_TOO_LONG, + CMYK_JPEG_NOT_ALLOWED, + FLASH_NOT_ALLOWED, + FLASH_WITHOUT_CLICKTAG, + ANIMATED_VISUAL_EFFECT, + FLASH_ERROR, + LAYOUT_PROBLEM, + FLASH_HAS_NETWORK_OBJECTS, + FLASH_HAS_NETWORK_METHODS, + FLASH_HAS_URL, + FLASH_HAS_MOUSE_TRACKING, + FLASH_HAS_RANDOM_NUM, + FLASH_SELF_TARGETS, + FLASH_BAD_GETURL_TARGET, + FLASH_VERSION_NOT_SUPPORTED, + FILE_TOO_LARGE, + SYSTEM_ERROR, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class FileError : ApiError { + private FileErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FileErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FileError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum FileErrorReason { + MISSING_CONTENTS, + SIZE_TOO_LARGE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CustomCreativeError : ApiError { + private CustomCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CustomCreativeErrorReason { + DUPLICATE_MACRO_NAME_FOR_CREATIVE, + SNIPPET_REFERENCES_MISSING_MACRO, + UNRECOGNIZED_MACRO, + CUSTOM_CREATIVE_NOT_ALLOWED, + MISSING_INTERSTITIAL_MACRO, + DUPLICATE_ASSET_IN_MACROS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CreativeSetError : ApiError { + private CreativeSetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeSetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeSetError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CreativeSetErrorReason { + VIDEO_FEATURE_REQUIRED, + CANNOT_CREATE_OR_UPDATE_VIDEO_CREATIVES, + ROADBLOCK_FEATURE_REQUIRED, + MASTER_CREATIVE_CANNOT_BE_COMPANION, + VIDEO_CREATIVE_NOT_ALLOWED, + INVALID_ADVERTISER, + UPDATE_MASTER_CREATIVE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CreativeAssetMacroError : ApiError { + private CreativeAssetMacroErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeAssetMacroErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeAssetMacroError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CreativeAssetMacroErrorReason { + INVALID_MACRO_NAME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AssetError : ApiError { + private AssetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AssetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AssetError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AssetErrorReason { + NON_UNIQUE_NAME, + FILE_NAME_TOO_LONG, + FILE_SIZE_TOO_LARGE, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_CLIENT, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_HEIGHT, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_WIDTH, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_FORMAT, + INVALID_CODE_SNIPPET_PARAMETER_VALUE, + INVALID_ASSET_ID, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ForecastServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ForecastService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ForecastService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/ForecastService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Forecast getForecast(LineItem lineItem) { + object[] results = this.Invoke("getForecast", new object[] { lineItem }); + return ((Forecast) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Forecast getForecastById(long lineItemId) { + object[] results = this.Invoke("getForecastById", new object[] { lineItemId }); + return ((Forecast) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Forecast { + private long idField; + + private bool idFieldSpecified; + + private long orderIdField; + + private bool orderIdFieldSpecified; + + private UnitType unitTypeField; + + private bool unitTypeFieldSpecified; + + private long availableUnitsField; + + private bool availableUnitsFieldSpecified; + + private long deliveredUnitsField; + + private bool deliveredUnitsFieldSpecified; + + private long matchedUnitsField; + + private bool matchedUnitsFieldSpecified; + + private long possibleUnitsField; + + private bool possibleUnitsFieldSpecified; + + private long reservedUnitsField; + + private bool reservedUnitsFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public UnitType unitType { + get { return this.unitTypeField; } + set { + this.unitTypeField = value; + this.unitTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitTypeSpecified { + get { return this.unitTypeFieldSpecified; } + set { this.unitTypeFieldSpecified = value; } + } + + public long availableUnits { + get { return this.availableUnitsField; } + set { + this.availableUnitsField = value; + this.availableUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool availableUnitsSpecified { + get { return this.availableUnitsFieldSpecified; } + set { this.availableUnitsFieldSpecified = value; } + } + + public long deliveredUnits { + get { return this.deliveredUnitsField; } + set { + this.deliveredUnitsField = value; + this.deliveredUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveredUnitsSpecified { + get { return this.deliveredUnitsFieldSpecified; } + set { this.deliveredUnitsFieldSpecified = value; } + } + + public long matchedUnits { + get { return this.matchedUnitsField; } + set { + this.matchedUnitsField = value; + this.matchedUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool matchedUnitsSpecified { + get { return this.matchedUnitsFieldSpecified; } + set { this.matchedUnitsFieldSpecified = value; } + } + + public long possibleUnits { + get { return this.possibleUnitsField; } + set { + this.possibleUnitsField = value; + this.possibleUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool possibleUnitsSpecified { + get { return this.possibleUnitsFieldSpecified; } + set { this.possibleUnitsFieldSpecified = value; } + } + + public long reservedUnits { + get { return this.reservedUnitsField; } + set { + this.reservedUnitsField = value; + this.reservedUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reservedUnitsSpecified { + get { return this.reservedUnitsFieldSpecified; } + set { this.reservedUnitsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class InventoryUnitError : ApiError { + private InventoryUnitErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum InventoryUnitErrorReason { + EXPLICIT_TARGETING_NOT_ALLOWED, + TARGET_PLATFORM_NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AdUnitCodeError : ApiError { + private AdUnitCodeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitCodeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitCodeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AdUnitCodeErrorReason { + INVALID_CHARACTERS, + INVALID_CHARACTERS_WHEN_UTF_CHARACTERS_ARE_ALLOWED, + LEADING_FORWARD_SLASH, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AdUnitAfcSizeError : ApiError { + private AdUnitAfcSizeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitAfcSizeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitAfcSizeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AdUnitAfcSizeErrorReason { + INVALID, + DOESNT_FIT, + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "UserServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserRecord))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class UserService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public UserService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/UserService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public User createUser(User user) { + object[] results = this.Invoke("createUser", new object[] { user }); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public User[] createUsers([System.Xml.Serialization.XmlElementAttribute("users")] +User[] users) { + object[] results = this.Invoke("createUsers", new object[] { users }); + return ((User[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Role[] getAllRoles() { + object[] results = this.Invoke("getAllRoles", new object[0]); + return ((Role[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public User getCurrentUser() { + object[] results = this.Invoke("getCurrentUser", new object[0]); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public User getUser(long userId) { + object[] results = this.Invoke("getUser", new object[] { userId }); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UserPage getUsersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getUsersByStatement", new object[] { filterStatement }); + return ((UserPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performUserAction(UserAction userAction, Statement filterStatement) { + object[] results = this.Invoke("performUserAction", new object[] { userAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public User updateUser(User user) { + object[] results = this.Invoke("updateUser", new object[] { user }); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public User[] updateUsers([System.Xml.Serialization.XmlElementAttribute("users")] +User[] users) { + object[] results = this.Invoke("updateUsers", new object[] { users }); + return ((User[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateUsers))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateUsers))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class UserAction { + private string userActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("UserAction.Type")] + public string UserActionType { + get { return this.userActionTypeField; } + set { this.userActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DeactivateUsers : UserAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ActivateUsers : UserAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class UserPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private User[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public User[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class User : UserRecord { + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private bool isEmailNotificationAllowedField; + + private bool isEmailNotificationAllowedFieldSpecified; + + private string ordersUiLocalTimeZoneIdField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + public bool isEmailNotificationAllowed { + get { return this.isEmailNotificationAllowedField; } + set { + this.isEmailNotificationAllowedField = value; + this.isEmailNotificationAllowedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isEmailNotificationAllowedSpecified { + get { return this.isEmailNotificationAllowedFieldSpecified; } + set { this.isEmailNotificationAllowedFieldSpecified = value; } + } + + public string ordersUiLocalTimeZoneId { + get { return this.ordersUiLocalTimeZoneIdField; } + set { this.ordersUiLocalTimeZoneIdField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(User))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class UserRecord { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string emailField; + + private long roleIdField; + + private bool roleIdFieldSpecified; + + private string roleNameField; + + private string preferredLocaleField; + + private string userRecordTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public long roleId { + get { return this.roleIdField; } + set { + this.roleIdField = value; + this.roleIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roleIdSpecified { + get { return this.roleIdFieldSpecified; } + set { this.roleIdFieldSpecified = value; } + } + + public string roleName { + get { return this.roleNameField; } + set { this.roleNameField = value; } + } + + public string preferredLocale { + get { return this.preferredLocaleField; } + set { this.preferredLocaleField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("UserRecord.Type")] + public string UserRecordType { + get { return this.userRecordTypeField; } + set { this.userRecordTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Role { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class InvalidEmailError : ApiError { + private InvalidEmailErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidEmailErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidEmailError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum InvalidEmailErrorReason { + INVALID_FORMAT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ActivityGroupServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ActivityGroupService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ActivityGroupService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/ActivityGroupService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ActivityGroup createActivityGroup(ActivityGroup activityGroup) { + object[] results = this.Invoke("createActivityGroup", new object[] { activityGroup }); + return ((ActivityGroup) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ActivityGroup[] createActivityGroups([System.Xml.Serialization.XmlElementAttribute("activityGroups")] +ActivityGroup[] activityGroups) { + object[] results = this.Invoke("createActivityGroups", new object[] { activityGroups }); + return ((ActivityGroup[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ActivityGroup getActivityGroup(int activityGroupId) { + object[] results = this.Invoke("getActivityGroup", new object[] { activityGroupId }); + return ((ActivityGroup) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ActivityGroupPage getActivityGroupsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getActivityGroupsByStatement", new object[] { filterStatement }); + return ((ActivityGroupPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ActivityGroup updateActivityGroup(ActivityGroup activityGroup) { + object[] results = this.Invoke("updateActivityGroup", new object[] { activityGroup }); + return ((ActivityGroup) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ActivityGroup[] updateActivityGroups([System.Xml.Serialization.XmlElementAttribute("activityGroups")] +ActivityGroup[] activityGroups) { + object[] results = this.Invoke("updateActivityGroups", new object[] { activityGroups }); + return ((ActivityGroup[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ActivityGroupPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ActivityGroup[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ActivityGroup[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ActivityGroup { + private int idField; + + private bool idFieldSpecified; + + private string nameField; + + private long[] companyIdsField; + + private int impressionsLookbackField; + + private bool impressionsLookbackFieldSpecified; + + private int clicksLookbackField; + + private bool clicksLookbackFieldSpecified; + + private ActivityGroupStatus statusField; + + private bool statusFieldSpecified; + + public int id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companyIds")] + public long[] companyIds { + get { return this.companyIdsField; } + set { this.companyIdsField = value; } + } + + public int impressionsLookback { + get { return this.impressionsLookbackField; } + set { + this.impressionsLookbackField = value; + this.impressionsLookbackSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsLookbackSpecified { + get { return this.impressionsLookbackFieldSpecified; } + set { this.impressionsLookbackFieldSpecified = value; } + } + + public int clicksLookback { + get { return this.clicksLookbackField; } + set { + this.clicksLookbackField = value; + this.clicksLookbackSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clicksLookbackSpecified { + get { return this.clicksLookbackFieldSpecified; } + set { this.clicksLookbackFieldSpecified = value; } + } + + public ActivityGroupStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ActivityGroup.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ActivityGroupStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ActivityError : ApiError { + private ActivityErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ActivityErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ActivityError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ActivityErrorReason { + ACTIVITIES_FEATURE_REQUIRED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "NetworkServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class NetworkService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public NetworkService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/NetworkService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Network[] getAllNetworks() { + object[] results = this.Invoke("getAllNetworks", new object[0]); + return ((Network[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Network getCurrentNetwork() { + object[] results = this.Invoke("getCurrentNetwork", new object[0]); + return ((Network) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Network makeTestNetwork() { + object[] results = this.Invoke("makeTestNetwork", new object[0]); + return ((Network) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Network updateNetwork(Network network) { + object[] results = this.Invoke("updateNetwork", new object[] { network }); + return ((Network) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Network { + private long idField; + + private bool idFieldSpecified; + + private string displayNameField; + + private string networkCodeField; + + private string propertyCodeField; + + private string timeZoneField; + + private string currencyCodeField; + + private string effectiveRootAdUnitIdField; + + private long contentBrowseCustomTargetingKeyIdField; + + private bool contentBrowseCustomTargetingKeyIdFieldSpecified; + + private bool isTestField; + + private bool isTestFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public string networkCode { + get { return this.networkCodeField; } + set { this.networkCodeField = value; } + } + + public string propertyCode { + get { return this.propertyCodeField; } + set { this.propertyCodeField = value; } + } + + public string timeZone { + get { return this.timeZoneField; } + set { this.timeZoneField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public string effectiveRootAdUnitId { + get { return this.effectiveRootAdUnitIdField; } + set { this.effectiveRootAdUnitIdField = value; } + } + + public long contentBrowseCustomTargetingKeyId { + get { return this.contentBrowseCustomTargetingKeyIdField; } + set { + this.contentBrowseCustomTargetingKeyIdField = value; + this.contentBrowseCustomTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contentBrowseCustomTargetingKeyIdSpecified { + get { return this.contentBrowseCustomTargetingKeyIdFieldSpecified; } + set { this.contentBrowseCustomTargetingKeyIdFieldSpecified = value; } + } + + public bool isTest { + get { return this.isTestField; } + set { + this.isTestField = value; + this.isTestSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTestSpecified { + get { return this.isTestFieldSpecified; } + set { this.isTestFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "OrderServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class OrderService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public OrderService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/OrderService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Order createOrder(Order order) { + object[] results = this.Invoke("createOrder", new object[] { order }); + return ((Order) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Order[] createOrders([System.Xml.Serialization.XmlElementAttribute("orders")] +Order[] orders) { + object[] results = this.Invoke("createOrders", new object[] { orders }); + return ((Order[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Order getOrder(long orderId) { + object[] results = this.Invoke("getOrder", new object[] { orderId }); + return ((Order) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public OrderPage getOrdersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getOrdersByStatement", new object[] { filterStatement }); + return ((OrderPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performOrderAction(OrderAction orderAction, Statement filterStatement) { + object[] results = this.Invoke("performOrderAction", new object[] { orderAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Order updateOrder(Order order) { + object[] results = this.Invoke("updateOrder", new object[] { order }); + return ((Order) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Order[] updateOrders([System.Xml.Serialization.XmlElementAttribute("orders")] +Order[] orders) { + object[] results = this.Invoke("updateOrders", new object[] { orders }); + return ((Order[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApproval))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalAndOverbook))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RetractOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RetractOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PauseOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DisapproveOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DisapproveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class OrderAction { + private string orderActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("OrderAction.Type")] + public string OrderActionType { + get { return this.orderActionTypeField; } + set { this.orderActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class UnarchiveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class SubmitOrdersForApprovalWithoutReservationChanges : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalAndOverbook))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class SubmitOrdersForApproval : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class SubmitOrdersForApprovalAndOverbook : SubmitOrdersForApproval { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class RetractOrdersWithoutReservationChanges : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class RetractOrders : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ResumeOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ResumeAndOverbookOrders : ResumeOrders { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class PauseOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DisapproveOrdersWithoutReservationChanges : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DisapproveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DeleteOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ArchiveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ApproveOrdersWithoutReservationChanges : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ApproveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ApproveAndOverbookOrders : ApproveOrders { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class OrderPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Order[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Order[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Order { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private OrderStatus statusField; + + private bool statusFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private string notesField; + + private int externalOrderIdField; + + private bool externalOrderIdFieldSpecified; + + private string poNumberField; + + private string currencyCodeField; + + private long advertiserIdField; + + private bool advertiserIdFieldSpecified; + + private long[] advertiserContactIdsField; + + private long agencyIdField; + + private bool agencyIdFieldSpecified; + + private long[] agencyContactIdsField; + + private long creatorIdField; + + private bool creatorIdFieldSpecified; + + private long traffickerIdField; + + private bool traffickerIdFieldSpecified; + + private long[] secondaryTraffickerIdsField; + + private long salespersonIdField; + + private bool salespersonIdFieldSpecified; + + private long[] secondarySalespersonIdsField; + + private long totalImpressionsDeliveredField; + + private bool totalImpressionsDeliveredFieldSpecified; + + private long totalClicksDeliveredField; + + private bool totalClicksDeliveredFieldSpecified; + + private Money totalBudgetField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private string lastModifiedByAppField; + + private long[] appliedTeamIdsField; + + private DateTime lastModifiedDateTimeField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public OrderStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public int externalOrderId { + get { return this.externalOrderIdField; } + set { + this.externalOrderIdField = value; + this.externalOrderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool externalOrderIdSpecified { + get { return this.externalOrderIdFieldSpecified; } + set { this.externalOrderIdFieldSpecified = value; } + } + + public string poNumber { + get { return this.poNumberField; } + set { this.poNumberField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public long advertiserId { + get { return this.advertiserIdField; } + set { + this.advertiserIdField = value; + this.advertiserIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserIdSpecified { + get { return this.advertiserIdFieldSpecified; } + set { this.advertiserIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("advertiserContactIds")] + public long[] advertiserContactIds { + get { return this.advertiserContactIdsField; } + set { this.advertiserContactIdsField = value; } + } + + public long agencyId { + get { return this.agencyIdField; } + set { + this.agencyIdField = value; + this.agencyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool agencyIdSpecified { + get { return this.agencyIdFieldSpecified; } + set { this.agencyIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("agencyContactIds")] + public long[] agencyContactIds { + get { return this.agencyContactIdsField; } + set { this.agencyContactIdsField = value; } + } + + public long creatorId { + get { return this.creatorIdField; } + set { + this.creatorIdField = value; + this.creatorIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creatorIdSpecified { + get { return this.creatorIdFieldSpecified; } + set { this.creatorIdFieldSpecified = value; } + } + + public long traffickerId { + get { return this.traffickerIdField; } + set { + this.traffickerIdField = value; + this.traffickerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool traffickerIdSpecified { + get { return this.traffickerIdFieldSpecified; } + set { this.traffickerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryTraffickerIds")] + public long[] secondaryTraffickerIds { + get { return this.secondaryTraffickerIdsField; } + set { this.secondaryTraffickerIdsField = value; } + } + + public long salespersonId { + get { return this.salespersonIdField; } + set { + this.salespersonIdField = value; + this.salespersonIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool salespersonIdSpecified { + get { return this.salespersonIdFieldSpecified; } + set { this.salespersonIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondarySalespersonIds")] + public long[] secondarySalespersonIds { + get { return this.secondarySalespersonIdsField; } + set { this.secondarySalespersonIdsField = value; } + } + + public long totalImpressionsDelivered { + get { return this.totalImpressionsDeliveredField; } + set { + this.totalImpressionsDeliveredField = value; + this.totalImpressionsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalImpressionsDeliveredSpecified { + get { return this.totalImpressionsDeliveredFieldSpecified; } + set { this.totalImpressionsDeliveredFieldSpecified = value; } + } + + public long totalClicksDelivered { + get { return this.totalClicksDeliveredField; } + set { + this.totalClicksDeliveredField = value; + this.totalClicksDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalClicksDeliveredSpecified { + get { return this.totalClicksDeliveredFieldSpecified; } + set { this.totalClicksDeliveredFieldSpecified = value; } + } + + public Money totalBudget { + get { return this.totalBudgetField; } + set { this.totalBudgetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public string lastModifiedByApp { + get { return this.lastModifiedByAppField; } + set { this.lastModifiedByAppField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum OrderStatus { + DRAFT, + PENDING_APPROVAL, + APPROVED, + DISAPPROVED, + PAUSED, + CANCELED, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class OrderActionError : ApiError { + private OrderActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OrderActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OrderActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum OrderActionErrorReason { + PERMISSION_DENIED, + NOT_APPLICABLE, + IS_ARCHIVED, + HAS_ENDED, + CANNOT_APPROVE_WITH_UNRESERVED_LINE_ITEMS, + CANNOT_DELETE_ORDER_WITH_DELIVERED_LINEITEMS, + CANNOT_APPROVE_COMPANY_CREDIT_STATUS_NOT_ACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LineItemCreativeAssociationServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LineItemCreativeAssociationService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LineItemCreativeAssociationService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/LineItemCreativeAssociationServ" + "ice"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItemCreativeAssociation createLineItemCreativeAssociation(LineItemCreativeAssociation lineItemCreativeAssociation) { + object[] results = this.Invoke("createLineItemCreativeAssociation", new object[] { lineItemCreativeAssociation }); + return ((LineItemCreativeAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItemCreativeAssociation[] createLineItemCreativeAssociations([System.Xml.Serialization.XmlElementAttribute("lineItemCreativeAssociations")] +LineItemCreativeAssociation[] lineItemCreativeAssociations) { + object[] results = this.Invoke("createLineItemCreativeAssociations", new object[] { lineItemCreativeAssociations }); + return ((LineItemCreativeAssociation[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItemCreativeAssociation getLineItemCreativeAssociation(long lineItemId, long creativeId) { + object[] results = this.Invoke("getLineItemCreativeAssociation", new object[] { lineItemId, creativeId }); + return ((LineItemCreativeAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItemCreativeAssociationPage getLineItemCreativeAssociationsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLineItemCreativeAssociationsByStatement", new object[] { filterStatement }); + return ((LineItemCreativeAssociationPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public string getPreviewUrl(long lineItemId, long creativeId, string siteUrl) { + object[] results = this.Invoke("getPreviewUrl", new object[] { lineItemId, creativeId, siteUrl }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performLineItemCreativeAssociationAction(LineItemCreativeAssociationAction lineItemCreativeAssociationAction, Statement filterStatement) { + object[] results = this.Invoke("performLineItemCreativeAssociationAction", new object[] { lineItemCreativeAssociationAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItemCreativeAssociation updateLineItemCreativeAssociation(LineItemCreativeAssociation lineItemCreativeAssociation) { + object[] results = this.Invoke("updateLineItemCreativeAssociation", new object[] { lineItemCreativeAssociation }); + return ((LineItemCreativeAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LineItemCreativeAssociation[] updateLineItemCreativeAssociations([System.Xml.Serialization.XmlElementAttribute("lineItemCreativeAssociations")] +LineItemCreativeAssociation[] lineItemCreativeAssociations) { + object[] results = this.Invoke("updateLineItemCreativeAssociations", new object[] { lineItemCreativeAssociations }); + return ((LineItemCreativeAssociation[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateLineItemCreativeAssociations))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLineItemCreativeAssociations))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class LineItemCreativeAssociationAction { + private string lineItemCreativeAssociationActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LineItemCreativeAssociationAction.Type")] + public string LineItemCreativeAssociationActionType { + get { return this.lineItemCreativeAssociationActionTypeField; } + set { this.lineItemCreativeAssociationActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DeactivateLineItemCreativeAssociations : LineItemCreativeAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ActivateLineItemCreativeAssociations : LineItemCreativeAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class LineItemCreativeAssociationPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LineItemCreativeAssociation[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LineItemCreativeAssociation[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class LineItemCreativeAssociation { + private long lineItemIdField; + + private bool lineItemIdFieldSpecified; + + private long creativeIdField; + + private bool creativeIdFieldSpecified; + + private long creativeSetIdField; + + private bool creativeSetIdFieldSpecified; + + private double manualCreativeRotationWeightField; + + private bool manualCreativeRotationWeightFieldSpecified; + + private int sequentialCreativeRotationIndexField; + + private bool sequentialCreativeRotationIndexFieldSpecified; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private string destinationUrlField; + + private Size[] sizesField; + + private LineItemCreativeAssociationStatus statusField; + + private bool statusFieldSpecified; + + private LineItemCreativeAssociationStats statsField; + + private DateTime lastModifiedDateTimeField; + + public long lineItemId { + get { return this.lineItemIdField; } + set { + this.lineItemIdField = value; + this.lineItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemIdSpecified { + get { return this.lineItemIdFieldSpecified; } + set { this.lineItemIdFieldSpecified = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { + this.creativeIdField = value; + this.creativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeIdSpecified { + get { return this.creativeIdFieldSpecified; } + set { this.creativeIdFieldSpecified = value; } + } + + public long creativeSetId { + get { return this.creativeSetIdField; } + set { + this.creativeSetIdField = value; + this.creativeSetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeSetIdSpecified { + get { return this.creativeSetIdFieldSpecified; } + set { this.creativeSetIdFieldSpecified = value; } + } + + public double manualCreativeRotationWeight { + get { return this.manualCreativeRotationWeightField; } + set { + this.manualCreativeRotationWeightField = value; + this.manualCreativeRotationWeightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manualCreativeRotationWeightSpecified { + get { return this.manualCreativeRotationWeightFieldSpecified; } + set { this.manualCreativeRotationWeightFieldSpecified = value; } + } + + public int sequentialCreativeRotationIndex { + get { return this.sequentialCreativeRotationIndexField; } + set { + this.sequentialCreativeRotationIndexField = value; + this.sequentialCreativeRotationIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sequentialCreativeRotationIndexSpecified { + get { return this.sequentialCreativeRotationIndexFieldSpecified; } + set { this.sequentialCreativeRotationIndexFieldSpecified = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("sizes")] + public Size[] sizes { + get { return this.sizesField; } + set { this.sizesField = value; } + } + + public LineItemCreativeAssociationStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public LineItemCreativeAssociationStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociation.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum LineItemCreativeAssociationStatus { + ACTIVE, + NOT_SERVING, + INACTIVE, + DELETED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class LineItemCreativeAssociationStats { + private Stats statsField; + + private Long_StatsMapEntry[] creativeSetStatsField; + + private Money costInOrderCurrencyField; + + public Stats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativeSetStats")] + public Long_StatsMapEntry[] creativeSetStats { + get { return this.creativeSetStatsField; } + set { this.creativeSetStatsField = value; } + } + + public Money costInOrderCurrency { + get { return this.costInOrderCurrencyField; } + set { this.costInOrderCurrencyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Long_StatsMapEntry { + private long keyField; + + private bool keyFieldSpecified; + + private Stats valueField; + + public long key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public Stats value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class LineItemCreativeAssociationOperationError : ApiError { + private LineItemCreativeAssociationOperationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemCreativeAssociationOperationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociationOperationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum LineItemCreativeAssociationOperationErrorReason { + NOT_ALLOWED, + NOT_APPLICABLE, + CANNOT_ACTIVATE_INVALID_CREATIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AdSenseAccountError : ApiError { + private AdSenseAccountErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdSenseAccountErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseAccountError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AdSenseAccountErrorReason { + ASSOCIATE_ACCOUNT_API_ERROR, + GET_AD_SLOT_API_ERROR, + GET_BULK_ACCOUNT_STATUSES_API_ERROR, + RESEND_VERIFICATION_EMAIL_ERROR, + UNEXPECTED_API_RESPONSE_ERROR, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "SuggestedAdUnitServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class SuggestedAdUnitService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public SuggestedAdUnitService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/SuggestedAdUnitService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public SuggestedAdUnit getSuggestedAdUnit(string suggestedAdUnitId) { + object[] results = this.Invoke("getSuggestedAdUnit", new object[] { suggestedAdUnitId }); + return ((SuggestedAdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public SuggestedAdUnitPage getSuggestedAdUnitsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getSuggestedAdUnitsByStatement", new object[] { filterStatement }); + return ((SuggestedAdUnitPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public SuggestedAdUnitUpdateResult performSuggestedAdUnitAction(SuggestedAdUnitAction suggestedAdUnitAction, Statement filterStatement) { + object[] results = this.Invoke("performSuggestedAdUnitAction", new object[] { suggestedAdUnitAction, filterStatement }); + return ((SuggestedAdUnitUpdateResult) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class SuggestedAdUnitUpdateResult { + private string[] newAdUnitIdsField; + + private int numChangesField; + + private bool numChangesFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("newAdUnitIds")] + public string[] newAdUnitIds { + get { return this.newAdUnitIdsField; } + set { this.newAdUnitIdsField = value; } + } + + public int numChanges { + get { return this.numChangesField; } + set { + this.numChangesField = value; + this.numChangesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numChangesSpecified { + get { return this.numChangesFieldSpecified; } + set { this.numChangesFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveSuggestedAdUnit))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class SuggestedAdUnitAction { + private string suggestedAdUnitActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("SuggestedAdUnitAction.Type")] + public string SuggestedAdUnitActionType { + get { return this.suggestedAdUnitActionTypeField; } + set { this.suggestedAdUnitActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ApproveSuggestedAdUnit : SuggestedAdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class SuggestedAdUnitPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private SuggestedAdUnit[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public SuggestedAdUnit[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class SuggestedAdUnit { + private string idField; + + private long numRequestsField; + + private bool numRequestsFieldSpecified; + + private string[] pathField; + + private AdUnitParent[] parentPathField; + + private AdUnitTargetWindow targetWindowField; + + private bool targetWindowFieldSpecified; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private AdUnitSize[] suggestedAdUnitSizesField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public long numRequests { + get { return this.numRequestsField; } + set { + this.numRequestsField = value; + this.numRequestsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numRequestsSpecified { + get { return this.numRequestsFieldSpecified; } + set { this.numRequestsFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("path")] + public string[] path { + get { return this.pathField; } + set { this.pathField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("parentPath")] + public AdUnitParent[] parentPath { + get { return this.parentPathField; } + set { this.parentPathField = value; } + } + + public AdUnitTargetWindow targetWindow { + get { return this.targetWindowField; } + set { + this.targetWindowField = value; + this.targetWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetWindowSpecified { + get { return this.targetWindowFieldSpecified; } + set { this.targetWindowFieldSpecified = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("suggestedAdUnitSizes")] + public AdUnitSize[] suggestedAdUnitSizes { + get { return this.suggestedAdUnitSizesField; } + set { this.suggestedAdUnitSizesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AdUnitParent { + private string idField; + + private string nameField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnit.TargetWindow", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AdUnitTargetWindow { + TOP, + BLANK + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AdUnitSize { + private Size sizeField; + + private EnvironmentType environmentTypeField; + + private bool environmentTypeFieldSpecified; + + private AdUnitSize[] companionsField; + + private string fullDisplayStringField; + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + public EnvironmentType environmentType { + get { return this.environmentTypeField; } + set { + this.environmentTypeField = value; + this.environmentTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool environmentTypeSpecified { + get { return this.environmentTypeFieldSpecified; } + set { this.environmentTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companions")] + public AdUnitSize[] companions { + get { return this.companionsField; } + set { this.companionsField = value; } + } + + public string fullDisplayString { + get { return this.fullDisplayStringField; } + set { this.fullDisplayStringField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeTemplateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeTemplateService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeTemplateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/CreativeTemplateService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeTemplate getCreativeTemplate(long creativeTemplateId) { + object[] results = this.Invoke("getCreativeTemplate", new object[] { creativeTemplateId }); + return ((CreativeTemplate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeTemplatePage getCreativeTemplatesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativeTemplatesByStatement", new object[] { filterStatement }); + return ((CreativeTemplatePage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CreativeTemplatePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeTemplate[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeTemplate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CreativeTemplate { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private CreativeTemplateVariable[] variablesField; + + private CreativeTemplateStatus statusField; + + private bool statusFieldSpecified; + + private CreativeTemplateType typeField; + + private bool typeFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("variables")] + public CreativeTemplateVariable[] variables { + get { return this.variablesField; } + set { this.variablesField = value; } + } + + public CreativeTemplateStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public CreativeTemplateType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UrlCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListStringCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetCreativeTemplateVariable))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class CreativeTemplateVariable { + private string labelField; + + private string uniqueNameField; + + private string descriptionField; + + private bool isRequiredField; + + private bool isRequiredFieldSpecified; + + private string creativeTemplateVariableTypeField; + + public string label { + get { return this.labelField; } + set { this.labelField = value; } + } + + public string uniqueName { + get { return this.uniqueNameField; } + set { this.uniqueNameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isRequired { + get { return this.isRequiredField; } + set { + this.isRequiredField = value; + this.isRequiredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isRequiredSpecified { + get { return this.isRequiredFieldSpecified; } + set { this.isRequiredFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("CreativeTemplateVariable.Type")] + public string CreativeTemplateVariableType { + get { return this.creativeTemplateVariableTypeField; } + set { this.creativeTemplateVariableTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class UrlCreativeTemplateVariable : CreativeTemplateVariable { + private string defaultValueField; + + public string defaultValue { + get { return this.defaultValueField; } + set { this.defaultValueField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListStringCreativeTemplateVariable))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class StringCreativeTemplateVariable : CreativeTemplateVariable { + private string defaultValueField; + + public string defaultValue { + get { return this.defaultValueField; } + set { this.defaultValueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ListStringCreativeTemplateVariable : StringCreativeTemplateVariable { + private ListStringCreativeTemplateVariableVariableChoice[] choicesField; + + private bool allowOtherChoiceField; + + private bool allowOtherChoiceFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("choices")] + public ListStringCreativeTemplateVariableVariableChoice[] choices { + get { return this.choicesField; } + set { this.choicesField = value; } + } + + public bool allowOtherChoice { + get { return this.allowOtherChoiceField; } + set { + this.allowOtherChoiceField = value; + this.allowOtherChoiceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowOtherChoiceSpecified { + get { return this.allowOtherChoiceFieldSpecified; } + set { this.allowOtherChoiceFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ListStringCreativeTemplateVariable.VariableChoice", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ListStringCreativeTemplateVariableVariableChoice { + private string labelField; + + private string valueField; + + public string label { + get { return this.labelField; } + set { this.labelField = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class LongCreativeTemplateVariable : CreativeTemplateVariable { + private long defaultValueField; + + private bool defaultValueFieldSpecified; + + public long defaultValue { + get { return this.defaultValueField; } + set { + this.defaultValueField = value; + this.defaultValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool defaultValueSpecified { + get { return this.defaultValueFieldSpecified; } + set { this.defaultValueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AssetCreativeTemplateVariable : CreativeTemplateVariable { + private AssetCreativeTemplateVariableMimeType[] mimeTypesField; + + [System.Xml.Serialization.XmlElementAttribute("mimeTypes")] + public AssetCreativeTemplateVariableMimeType[] mimeTypes { + get { return this.mimeTypesField; } + set { this.mimeTypesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AssetCreativeTemplateVariable.MimeType", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AssetCreativeTemplateVariableMimeType { + JPG, + PNG, + GIF, + SWF + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CreativeTemplateStatus { + ACTIVE, + INACTIVE, + DELETED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CreativeTemplateType { + SYSTEM_DEFINED, + USER_DEFINED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CreativeTemplateError : ApiError { + private CreativeTemplateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeTemplateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeTemplateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CreativeTemplateErrorReason { + CANNOT_PARSE_CREATIVE_TEMPLATE, + VARIABLE_DUPLICATE_UNIQUE_NAME, + VARIABLE_INVALID_UNIQUE_NAME, + LIST_CHOICE_DUPLICATE_VALUE, + LIST_CHOICE_NEEDS_DEFAULT, + LIST_CHOICES_EMPTY, + NO_TARGET_PLATFORMS, + MULTIPLE_TARGET_PLATFORMS, + UNRECOGNIZED_PLACEHOLDER, + PLACEHOLDERS_NOT_IN_FORMATTER, + MISSING_INTERSTITIAL_MACRO, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CompanyServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CompanyService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CompanyService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/CompanyService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Company[] createCompanies([System.Xml.Serialization.XmlElementAttribute("companies")] +Company[] companies) { + object[] results = this.Invoke("createCompanies", new object[] { companies }); + return ((Company[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Company createCompany(Company company) { + object[] results = this.Invoke("createCompany", new object[] { company }); + return ((Company) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CompanyPage getCompaniesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCompaniesByStatement", new object[] { filterStatement }); + return ((CompanyPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Company getCompany(long companyId) { + object[] results = this.Invoke("getCompany", new object[] { companyId }); + return ((Company) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Company[] updateCompanies([System.Xml.Serialization.XmlElementAttribute("companies")] +Company[] companies) { + object[] results = this.Invoke("updateCompanies", new object[] { companies }); + return ((Company[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Company updateCompany(Company company) { + object[] results = this.Invoke("updateCompany", new object[] { company }); + return ((Company) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CompanyPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Company[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Company[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Company { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private CompanyType typeField; + + private bool typeFieldSpecified; + + private string addressField; + + private string emailField; + + private string faxPhoneField; + + private string primaryPhoneField; + + private string externalIdField; + + private string commentField; + + private CompanyCreditStatus creditStatusField; + + private bool creditStatusFieldSpecified; + + private AppliedLabel[] appliedLabelsField; + + private bool enableSameAdvertiserCompetitiveExclusionField; + + private bool enableSameAdvertiserCompetitiveExclusionFieldSpecified; + + private long primaryContactIdField; + + private bool primaryContactIdFieldSpecified; + + private long[] appliedTeamIdsField; + + private int thirdPartyCompanyIdField; + + private bool thirdPartyCompanyIdFieldSpecified; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public CompanyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public string address { + get { return this.addressField; } + set { this.addressField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public string faxPhone { + get { return this.faxPhoneField; } + set { this.faxPhoneField = value; } + } + + public string primaryPhone { + get { return this.primaryPhoneField; } + set { this.primaryPhoneField = value; } + } + + public string externalId { + get { return this.externalIdField; } + set { this.externalIdField = value; } + } + + public string comment { + get { return this.commentField; } + set { this.commentField = value; } + } + + public CompanyCreditStatus creditStatus { + get { return this.creditStatusField; } + set { + this.creditStatusField = value; + this.creditStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creditStatusSpecified { + get { return this.creditStatusFieldSpecified; } + set { this.creditStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + public bool enableSameAdvertiserCompetitiveExclusion { + get { return this.enableSameAdvertiserCompetitiveExclusionField; } + set { + this.enableSameAdvertiserCompetitiveExclusionField = value; + this.enableSameAdvertiserCompetitiveExclusionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool enableSameAdvertiserCompetitiveExclusionSpecified { + get { return this.enableSameAdvertiserCompetitiveExclusionFieldSpecified; } + set { this.enableSameAdvertiserCompetitiveExclusionFieldSpecified = value; } + } + + public long primaryContactId { + get { return this.primaryContactIdField; } + set { + this.primaryContactIdField = value; + this.primaryContactIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool primaryContactIdSpecified { + get { return this.primaryContactIdFieldSpecified; } + set { this.primaryContactIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public int thirdPartyCompanyId { + get { return this.thirdPartyCompanyIdField; } + set { + this.thirdPartyCompanyIdField = value; + this.thirdPartyCompanyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyCompanyIdSpecified { + get { return this.thirdPartyCompanyIdFieldSpecified; } + set { this.thirdPartyCompanyIdFieldSpecified = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Company.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CompanyType { + HOUSE_ADVERTISER, + HOUSE_AGENCY, + ADVERTISER, + AGENCY, + AD_NETWORK, + AFFILIATE_DISTRIBUTION_PARTNER, + CONTENT_PARTNER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Company.CreditStatus", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CompanyCreditStatus { + ACTIVE, + ON_HOLD, + CREDIT_STOP, + INACTIVE, + BLOCKED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CompanyError : ApiError { + private CompanyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CompanyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CompanyError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CompanyErrorReason { + CANNOT_SET_THIRD_PARTY_COMPANY_DUE_TO_TYPE, + CANNOT_UPDATE_COMPANY_TYPE, + INVALID_COMPANY_TYPE, + PRIMARY_CONTACT_DOES_NOT_BELONG_TO_THIS_COMPANY, + THIRD_PARTY_STATS_PROVIDER_IS_WRONG_ROLE_TYPE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LabelServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LabelService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LabelService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/LabelService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Label createLabel(Label label) { + object[] results = this.Invoke("createLabel", new object[] { label }); + return ((Label) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Label[] createLabels([System.Xml.Serialization.XmlElementAttribute("labels")] +Label[] labels) { + object[] results = this.Invoke("createLabels", new object[] { labels }); + return ((Label[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Label getLabel(long labelId) { + object[] results = this.Invoke("getLabel", new object[] { labelId }); + return ((Label) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public LabelPage getLabelsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLabelsByStatement", new object[] { filterStatement }); + return ((LabelPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performLabelAction(LabelAction labelAction, Statement filterStatement) { + object[] results = this.Invoke("performLabelAction", new object[] { labelAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Label updateLabel(Label label) { + object[] results = this.Invoke("updateLabel", new object[] { label }); + return ((Label) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Label[] updateLabels([System.Xml.Serialization.XmlElementAttribute("labels")] +Label[] labels) { + object[] results = this.Invoke("updateLabels", new object[] { labels }); + return ((Label[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateLabels))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLabels))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class LabelAction { + private string labelActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LabelAction.Type")] + public string LabelActionType { + get { return this.labelActionTypeField; } + set { this.labelActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DeactivateLabels : LabelAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ActivateLabels : LabelAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class LabelPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Label[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Label[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Label { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private LabelType[] typesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("types")] + public LabelType[] types { + get { return this.typesField; } + set { this.typesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum LabelType { + COMPETITIVE_EXCLUSION, + AD_UNIT_FREQUENCY_CAP, + AD_EXCLUSION, + CREATIVE_WRAPPER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class LabelError : ApiError { + private LabelErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LabelErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LabelError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum LabelErrorReason { + INVALID_PREFIX, + NAME_INVALID_CHARS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CreativeWrapperError : ApiError { + private CreativeWrapperErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeWrapperErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeWrapperError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CreativeWrapperErrorReason { + LABEL_ALREADY_ASSOCIATED_WITH_CREATIVE_WRAPPER, + INVALID_LABEL_TYPE, + UNRECOGNIZED_MACRO, + NEITHER_HEADER_NOR_FOOTER_SPECIFIED, + CANNOT_USE_CREATIVE_WRAPPER_TYPE, + CANNOT_UPDATE_LABEL_ID, + CANNOT_APPLY_TO_AD_UNIT_WITH_VIDEO_SIZES, + CANNOT_APPLY_TO_MOBILE_AD_UNIT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "TeamServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class TeamService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public TeamService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/TeamService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Team createTeam(Team team) { + object[] results = this.Invoke("createTeam", new object[] { team }); + return ((Team) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Team[] createTeams([System.Xml.Serialization.XmlElementAttribute("teams")] +Team[] teams) { + object[] results = this.Invoke("createTeams", new object[] { teams }); + return ((Team[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Team getTeam(long teamId) { + object[] results = this.Invoke("getTeam", new object[] { teamId }); + return ((Team) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public TeamPage getTeamsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getTeamsByStatement", new object[] { filterStatement }); + return ((TeamPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Team updateTeam(Team team) { + object[] results = this.Invoke("updateTeam", new object[] { team }); + return ((Team) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Team[] updateTeams([System.Xml.Serialization.XmlElementAttribute("teams")] +Team[] teams) { + object[] results = this.Invoke("updateTeams", new object[] { teams }); + return ((Team[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class TeamPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Team[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Team[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Team { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool hasAllCompaniesField; + + private bool hasAllCompaniesFieldSpecified; + + private bool hasAllInventoryField; + + private bool hasAllInventoryFieldSpecified; + + private TeamAccessType teamAccessTypeField; + + private bool teamAccessTypeFieldSpecified; + + private long[] companyIdsField; + + private string[] adUnitIdsField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool hasAllCompanies { + get { return this.hasAllCompaniesField; } + set { + this.hasAllCompaniesField = value; + this.hasAllCompaniesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasAllCompaniesSpecified { + get { return this.hasAllCompaniesFieldSpecified; } + set { this.hasAllCompaniesFieldSpecified = value; } + } + + public bool hasAllInventory { + get { return this.hasAllInventoryField; } + set { + this.hasAllInventoryField = value; + this.hasAllInventorySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasAllInventorySpecified { + get { return this.hasAllInventoryFieldSpecified; } + set { this.hasAllInventoryFieldSpecified = value; } + } + + public TeamAccessType teamAccessType { + get { return this.teamAccessTypeField; } + set { + this.teamAccessTypeField = value; + this.teamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool teamAccessTypeSpecified { + get { return this.teamAccessTypeFieldSpecified; } + set { this.teamAccessTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companyIds")] + public long[] companyIds { + get { return this.companyIdsField; } + set { this.companyIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adUnitIds")] + public string[] adUnitIds { + get { return this.adUnitIdsField; } + set { this.adUnitIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum TeamAccessType { + NONE, + READ_ONLY, + READ_WRITE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "InventoryServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class InventoryService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public InventoryService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/InventoryService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdUnit createAdUnit(AdUnit adUnit) { + object[] results = this.Invoke("createAdUnit", new object[] { adUnit }); + return ((AdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdUnit[] createAdUnits([System.Xml.Serialization.XmlElementAttribute("adUnits")] +AdUnit[] adUnits) { + object[] results = this.Invoke("createAdUnits", new object[] { adUnits }); + return ((AdUnit[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdUnit getAdUnit(string adUnitId) { + object[] results = this.Invoke("getAdUnit", new object[] { adUnitId }); + return ((AdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdUnitSize[] getAdUnitSizesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAdUnitSizesByStatement", new object[] { filterStatement }); + return ((AdUnitSize[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdUnitPage getAdUnitsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAdUnitsByStatement", new object[] { filterStatement }); + return ((AdUnitPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performAdUnitAction(AdUnitAction adUnitAction, Statement filterStatement) { + object[] results = this.Invoke("performAdUnitAction", new object[] { adUnitAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdUnit updateAdUnit(AdUnit adUnit) { + object[] results = this.Invoke("updateAdUnit", new object[] { adUnit }); + return ((AdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public AdUnit[] updateAdUnits([System.Xml.Serialization.XmlElementAttribute("adUnits")] +AdUnit[] adUnits) { + object[] results = this.Invoke("updateAdUnits", new object[] { adUnits }); + return ((AdUnit[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RemoveAdUnitsFromPlacement))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateAdUnits))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssignAdUnitsToPlacement))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveAdUnits))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateAdUnits))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class AdUnitAction { + private string adUnitActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AdUnitAction.Type")] + public string AdUnitActionType { + get { return this.adUnitActionTypeField; } + set { this.adUnitActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class RemoveAdUnitsFromPlacement : AdUnitAction { + private long placementIdField; + + private bool placementIdFieldSpecified; + + public long placementId { + get { return this.placementIdField; } + set { + this.placementIdField = value; + this.placementIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool placementIdSpecified { + get { return this.placementIdFieldSpecified; } + set { this.placementIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DeactivateAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AssignAdUnitsToPlacement : AdUnitAction { + private long placementIdField; + + private bool placementIdFieldSpecified; + + public long placementId { + get { return this.placementIdField; } + set { + this.placementIdField = value; + this.placementIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool placementIdSpecified { + get { return this.placementIdFieldSpecified; } + set { this.placementIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ArchiveAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ActivateAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AdUnitPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AdUnit[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AdUnit[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AdUnit { + private string idField; + + private string parentIdField; + + private bool hasChildrenField; + + private bool hasChildrenFieldSpecified; + + private AdUnitParent[] parentPathField; + + private string nameField; + + private string descriptionField; + + private AdUnitTargetWindow targetWindowField; + + private bool targetWindowFieldSpecified; + + private InventoryStatus statusField; + + private bool statusFieldSpecified; + + private string adUnitCodeField; + + private AdUnitSize[] adUnitSizesField; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private MobilePlatform mobilePlatformField; + + private bool mobilePlatformFieldSpecified; + + private bool explicitlyTargetedField; + + private bool explicitlyTargetedFieldSpecified; + + private AdSenseSettingsInheritedProperty inheritedAdSenseSettingsField; + + private long partnerIdField; + + private bool partnerIdFieldSpecified; + + private LabelFrequencyCap[] appliedLabelFrequencyCapsField; + + private LabelFrequencyCap[] effectiveLabelFrequencyCapsField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private long[] effectiveTeamIdsField; + + private long[] appliedTeamIdsField; + + private DateTime lastModifiedDateTimeField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string parentId { + get { return this.parentIdField; } + set { this.parentIdField = value; } + } + + public bool hasChildren { + get { return this.hasChildrenField; } + set { + this.hasChildrenField = value; + this.hasChildrenSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasChildrenSpecified { + get { return this.hasChildrenFieldSpecified; } + set { this.hasChildrenFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("parentPath")] + public AdUnitParent[] parentPath { + get { return this.parentPathField; } + set { this.parentPathField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public AdUnitTargetWindow targetWindow { + get { return this.targetWindowField; } + set { + this.targetWindowField = value; + this.targetWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetWindowSpecified { + get { return this.targetWindowFieldSpecified; } + set { this.targetWindowFieldSpecified = value; } + } + + public InventoryStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string adUnitCode { + get { return this.adUnitCodeField; } + set { this.adUnitCodeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adUnitSizes")] + public AdUnitSize[] adUnitSizes { + get { return this.adUnitSizesField; } + set { this.adUnitSizesField = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + public MobilePlatform mobilePlatform { + get { return this.mobilePlatformField; } + set { + this.mobilePlatformField = value; + this.mobilePlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mobilePlatformSpecified { + get { return this.mobilePlatformFieldSpecified; } + set { this.mobilePlatformFieldSpecified = value; } + } + + public bool explicitlyTargeted { + get { return this.explicitlyTargetedField; } + set { + this.explicitlyTargetedField = value; + this.explicitlyTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool explicitlyTargetedSpecified { + get { return this.explicitlyTargetedFieldSpecified; } + set { this.explicitlyTargetedFieldSpecified = value; } + } + + public AdSenseSettingsInheritedProperty inheritedAdSenseSettings { + get { return this.inheritedAdSenseSettingsField; } + set { this.inheritedAdSenseSettingsField = value; } + } + + public long partnerId { + get { return this.partnerIdField; } + set { + this.partnerIdField = value; + this.partnerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool partnerIdSpecified { + get { return this.partnerIdFieldSpecified; } + set { this.partnerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabelFrequencyCaps")] + public LabelFrequencyCap[] appliedLabelFrequencyCaps { + get { return this.appliedLabelFrequencyCapsField; } + set { this.appliedLabelFrequencyCapsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveLabelFrequencyCaps")] + public LabelFrequencyCap[] effectiveLabelFrequencyCaps { + get { return this.effectiveLabelFrequencyCapsField; } + set { this.effectiveLabelFrequencyCapsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveTeamIds")] + public long[] effectiveTeamIds { + get { return this.effectiveTeamIdsField; } + set { this.effectiveTeamIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum MobilePlatform { + SITE, + APPLICATION + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AdSenseSettingsInheritedProperty { + private AdSenseSettings valueField; + + public AdSenseSettings value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AdSenseSettings { + private bool adSenseEnabledField; + + private bool adSenseEnabledFieldSpecified; + + private string borderColorField; + + private string titleColorField; + + private string backgroundColorField; + + private string textColorField; + + private string urlColorField; + + private AdSenseSettingsAdType adTypeField; + + private bool adTypeFieldSpecified; + + private AdSenseSettingsBorderStyle borderStyleField; + + private bool borderStyleFieldSpecified; + + private AdSenseSettingsFontFamily fontFamilyField; + + private bool fontFamilyFieldSpecified; + + private AdSenseSettingsFontSize fontSizeField; + + private bool fontSizeFieldSpecified; + + private Size_StringMapEntry[] afcFormatsField; + + public bool adSenseEnabled { + get { return this.adSenseEnabledField; } + set { + this.adSenseEnabledField = value; + this.adSenseEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adSenseEnabledSpecified { + get { return this.adSenseEnabledFieldSpecified; } + set { this.adSenseEnabledFieldSpecified = value; } + } + + public string borderColor { + get { return this.borderColorField; } + set { this.borderColorField = value; } + } + + public string titleColor { + get { return this.titleColorField; } + set { this.titleColorField = value; } + } + + public string backgroundColor { + get { return this.backgroundColorField; } + set { this.backgroundColorField = value; } + } + + public string textColor { + get { return this.textColorField; } + set { this.textColorField = value; } + } + + public string urlColor { + get { return this.urlColorField; } + set { this.urlColorField = value; } + } + + public AdSenseSettingsAdType adType { + get { return this.adTypeField; } + set { + this.adTypeField = value; + this.adTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adTypeSpecified { + get { return this.adTypeFieldSpecified; } + set { this.adTypeFieldSpecified = value; } + } + + public AdSenseSettingsBorderStyle borderStyle { + get { return this.borderStyleField; } + set { + this.borderStyleField = value; + this.borderStyleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool borderStyleSpecified { + get { return this.borderStyleFieldSpecified; } + set { this.borderStyleFieldSpecified = value; } + } + + public AdSenseSettingsFontFamily fontFamily { + get { return this.fontFamilyField; } + set { + this.fontFamilyField = value; + this.fontFamilySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fontFamilySpecified { + get { return this.fontFamilyFieldSpecified; } + set { this.fontFamilyFieldSpecified = value; } + } + + public AdSenseSettingsFontSize fontSize { + get { return this.fontSizeField; } + set { + this.fontSizeField = value; + this.fontSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fontSizeSpecified { + get { return this.fontSizeFieldSpecified; } + set { this.fontSizeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("afcFormats")] + public Size_StringMapEntry[] afcFormats { + get { return this.afcFormatsField; } + set { this.afcFormatsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.AdType", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AdSenseSettingsAdType { + TEXT, + IMAGE, + TEXT_AND_IMAGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.BorderStyle", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AdSenseSettingsBorderStyle { + DEFAULT, + NOT_ROUNDED, + SLIGHTLY_ROUNDED, + VERY_ROUNDED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.FontFamily", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AdSenseSettingsFontFamily { + DEFAULT, + ARIAL, + TAHOMA, + GEORGIA, + TIMES, + VERDANA + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.FontSize", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AdSenseSettingsFontSize { + DEFAULT, + SMALL, + MEDIUM, + LARGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Size_StringMapEntry { + private Size keyField; + + private string valueField; + + public Size key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class LabelFrequencyCap { + private FrequencyCap frequencyCapField; + + private long labelIdField; + + private bool labelIdFieldSpecified; + + public FrequencyCap frequencyCap { + get { return this.frequencyCapField; } + set { this.frequencyCapField = value; } + } + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AdUnitTypeError : ApiError { + private AdUnitTypeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitTypeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitTypeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AdUnitTypeErrorReason { + MOBILE_APP_PLATFORM_NOT_VALID, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class InventoryUnitSizesError : ApiError { + private InventoryUnitSizesErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitSizesErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitSizesError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum InventoryUnitSizesErrorReason { + INVALID_SIZES, + INVALID_SIZE_FOR_PLATFORM, + VIDEO_FEATURE_MISSING, + VIDEO_MOBILE_LINE_ITEM_FEATURE_MISSING, + INVALID_SIZE_FOR_MASTER, + INVALID_SIZE_FOR_COMPANION, + DUPLICATE_MASTER_SIZES, + ASPECT_RATIO_NOT_SUPPORTED, + VIDEO_COMPANIONS_NOT_SUPPORTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class InventoryUnitPartnerAssociationError : ApiError { + private InventoryUnitPartnerAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitPartnerAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitPartnerAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum InventoryUnitPartnerAssociationErrorReason { + ANCESTOR_AD_UNIT_HAS_PARTNER_ASSOCIATION, + DESCENDANT_AD_UNIT_HAS_PARTNER_ASSOCIATION, + SAME_PARTNER_ASSOCIATION_IN_INVENTORY_HIERARCHY, + NO_PARTNER_CATCH_ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class InvalidColorError : ApiError { + private InvalidColorErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidColorErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidColorError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum InvalidColorErrorReason { + INVALID_FORMAT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class AdUnitHierarchyError : ApiError { + private AdUnitHierarchyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitHierarchyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitHierarchyError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum AdUnitHierarchyErrorReason { + INVALID_DEPTH, + INVALID_PARENT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "UserTeamAssociationServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserRecordTeamAssociation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class UserTeamAssociationService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public UserTeamAssociationService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/UserTeamAssociationService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UserTeamAssociation createUserTeamAssociation(UserTeamAssociation userTeamAssociation) { + object[] results = this.Invoke("createUserTeamAssociation", new object[] { userTeamAssociation }); + return ((UserTeamAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UserTeamAssociation[] createUserTeamAssociations([System.Xml.Serialization.XmlElementAttribute("userTeamAssociations")] +UserTeamAssociation[] userTeamAssociations) { + object[] results = this.Invoke("createUserTeamAssociations", new object[] { userTeamAssociations }); + return ((UserTeamAssociation[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UserTeamAssociation getUserTeamAssociation(long teamId, long userId) { + object[] results = this.Invoke("getUserTeamAssociation", new object[] { teamId, userId }); + return ((UserTeamAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UserTeamAssociationPage getUserTeamAssociationsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getUserTeamAssociationsByStatement", new object[] { filterStatement }); + return ((UserTeamAssociationPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performUserTeamAssociationAction(UserTeamAssociationAction userTeamAssociationAction, Statement statement) { + object[] results = this.Invoke("performUserTeamAssociationAction", new object[] { userTeamAssociationAction, statement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UserTeamAssociation updateUserTeamAssociation(UserTeamAssociation userTeamAssociation) { + object[] results = this.Invoke("updateUserTeamAssociation", new object[] { userTeamAssociation }); + return ((UserTeamAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UserTeamAssociation[] updateUserTeamAssociations([System.Xml.Serialization.XmlElementAttribute("userTeamAssociations")] +UserTeamAssociation[] userTeamAssociations) { + object[] results = this.Invoke("updateUserTeamAssociations", new object[] { userTeamAssociations }); + return ((UserTeamAssociation[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteUserTeamAssociations))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class UserTeamAssociationAction { + private string userTeamAssociationActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("UserTeamAssociationAction.Type")] + public string UserTeamAssociationActionType { + get { return this.userTeamAssociationActionTypeField; } + set { this.userTeamAssociationActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DeleteUserTeamAssociations : UserTeamAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class UserTeamAssociationPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private UserTeamAssociation[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public UserTeamAssociation[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class UserTeamAssociation : UserRecordTeamAssociation { + private long userIdField; + + private bool userIdFieldSpecified; + + public long userId { + get { return this.userIdField; } + set { + this.userIdField = value; + this.userIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userIdSpecified { + get { return this.userIdFieldSpecified; } + set { this.userIdFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserTeamAssociation))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class UserRecordTeamAssociation { + private long teamIdField; + + private bool teamIdFieldSpecified; + + private TeamAccessType overriddenTeamAccessTypeField; + + private bool overriddenTeamAccessTypeFieldSpecified; + + private TeamAccessType defaultTeamAccessTypeField; + + private bool defaultTeamAccessTypeFieldSpecified; + + private string userRecordTeamAssociationTypeField; + + public long teamId { + get { return this.teamIdField; } + set { + this.teamIdField = value; + this.teamIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool teamIdSpecified { + get { return this.teamIdFieldSpecified; } + set { this.teamIdFieldSpecified = value; } + } + + public TeamAccessType overriddenTeamAccessType { + get { return this.overriddenTeamAccessTypeField; } + set { + this.overriddenTeamAccessTypeField = value; + this.overriddenTeamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overriddenTeamAccessTypeSpecified { + get { return this.overriddenTeamAccessTypeFieldSpecified; } + set { this.overriddenTeamAccessTypeFieldSpecified = value; } + } + + public TeamAccessType defaultTeamAccessType { + get { return this.defaultTeamAccessTypeField; } + set { + this.defaultTeamAccessTypeField = value; + this.defaultTeamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool defaultTeamAccessTypeSpecified { + get { return this.defaultTeamAccessTypeFieldSpecified; } + set { this.defaultTeamAccessTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("UserRecordTeamAssociation.Type")] + public string UserRecordTeamAssociationType { + get { return this.userRecordTeamAssociationTypeField; } + set { this.userRecordTeamAssociationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReportServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReportService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReportService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/ReportService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public string getReportDownloadURL(long reportJobId, ExportFormat exportFormat) { + object[] results = this.Invoke("getReportDownloadURL", new object[] { reportJobId, exportFormat }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public string getReportDownloadUrlWithOptions(long reportJobId, ReportDownloadOptions reportDownloadOptions) { + object[] results = this.Invoke("getReportDownloadUrlWithOptions", new object[] { reportJobId, reportDownloadOptions }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ReportJob getReportJob(long reportJobId) { + object[] results = this.Invoke("getReportJob", new object[] { reportJobId }); + return ((ReportJob) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ReportJob runReportJob(ReportJob reportJob) { + object[] results = this.Invoke("runReportJob", new object[] { reportJob }); + return ((ReportJob) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ReportQuery { + private Dimension[] dimensionsField; + + private ReportQueryAdUnitView adUnitViewField; + + private bool adUnitViewFieldSpecified; + + private Column[] columnsField; + + private DimensionAttribute[] dimensionAttributesField; + + private long[] customFieldIdsField; + + private Date startDateField; + + private Date endDateField; + + private DateRangeType dateRangeTypeField; + + private bool dateRangeTypeFieldSpecified; + + private DimensionFilter[] dimensionFiltersField; + + private Statement statementField; + + [System.Xml.Serialization.XmlElementAttribute("dimensions")] + public Dimension[] dimensions { + get { return this.dimensionsField; } + set { this.dimensionsField = value; } + } + + public ReportQueryAdUnitView adUnitView { + get { return this.adUnitViewField; } + set { + this.adUnitViewField = value; + this.adUnitViewSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adUnitViewSpecified { + get { return this.adUnitViewFieldSpecified; } + set { this.adUnitViewFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("columns")] + public Column[] columns { + get { return this.columnsField; } + set { this.columnsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("dimensionAttributes")] + public DimensionAttribute[] dimensionAttributes { + get { return this.dimensionAttributesField; } + set { this.dimensionAttributesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldIds")] + public long[] customFieldIds { + get { return this.customFieldIdsField; } + set { this.customFieldIdsField = value; } + } + + public Date startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public Date endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + public DateRangeType dateRangeType { + get { return this.dateRangeTypeField; } + set { + this.dateRangeTypeField = value; + this.dateRangeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dateRangeTypeSpecified { + get { return this.dateRangeTypeFieldSpecified; } + set { this.dateRangeTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("dimensionFilters")] + public DimensionFilter[] dimensionFilters { + get { return this.dimensionFiltersField; } + set { this.dimensionFiltersField = value; } + } + + public Statement statement { + get { return this.statementField; } + set { this.statementField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum Dimension { + MONTH, + WEEK, + DATE, + DAY, + HOUR, + LINE_ITEM_ID, + LINE_ITEM_NAME, + LINE_ITEM_TYPE, + ORDER_ID, + ORDER_NAME, + ADVERTISER_ID, + ADVERTISER_NAME, + SALESPERSON_ID, + SALESPERSON_NAME, + CREATIVE_ID, + CREATIVE_NAME, + CREATIVE_TYPE, + CREATIVE_SIZE, + AD_UNIT_ID, + AD_UNIT_NAME, + PLACEMENT_ID, + PLACEMENT_NAME, + GENERIC_CRITERION_NAME, + COUNTRY_CRITERIA_ID, + COUNTRY_NAME, + REGION_CRITERIA_ID, + REGION_NAME, + CITY_CRITERIA_ID, + CITY_NAME, + METRO_CRITERIA_ID, + METRO_NAME, + POSTAL_CODE_CRITERIA_ID, + POSTAL_CODE, + CUSTOM_TARGETING_VALUE_ID, + CUSTOM_TARGETING, + ACTIVITY_ID, + ACTIVITY_NAME, + ACTIVITY_GROUP_ID, + ACTIVITY_GROUP_NAME, + CONTENT_ID, + CONTENT_NAME, + AD_REQUEST_AD_UNIT_SIZES, + AD_REQUEST_CUSTOM_CRITERIA, + MASTER_COMPANION_CREATIVE_ID, + MASTER_COMPANION_CREATIVE_NAME, + DISTRIBUTION_PARTNER_ID, + DISTRIBUTION_PARTNER_NAME, + CONTENT_PARTNER_ID, + CONTENT_PARTNER_NAME, + RIGHTS_HOLDER_ID, + RIGHTS_HOLDER_NAME, + AUDIENCE_SEGMENT_ID, + AUDIENCE_SEGMENT_NAME + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportQuery.AdUnitView", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ReportQueryAdUnitView { + TOP_LEVEL, + FLAT, + HIERARCHICAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum Column { + AD_SERVER_IMPRESSIONS, + AD_SERVER_CLICKS, + AD_SERVER_CTR, + AD_SERVER_CPM_AND_CPC_REVENUE, + AD_SERVER_CPD_REVENUE, + AD_SERVER_ALL_REVENUE, + AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM, + AD_SERVER_WITH_CPD_AVERAGE_ECPM, + AD_SERVER_INVENTORY_LEVEL_PERCENT_IMPRESSIONS, + AD_SERVER_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + AD_SERVER_INVENTORY_LEVEL_PERCENT_CLICKS, + AD_SERVER_LINE_ITEM_LEVEL_PERCENT_CLICKS, + AD_SERVER_INVENTORY_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + AD_SERVER_INVENTORY_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_SERVER_LINE_ITEM_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + AD_SERVER_LINE_ITEM_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_SERVER_DELIVERY_INDICATOR, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + ADSENSE_LINE_ITEM_LEVEL_IMPRESSIONS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + ADSENSE_LINE_ITEM_LEVEL_CLICKS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CTR, + ADSENSE_LINE_ITEM_LEVEL_CTR, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_REVENUE, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_AVERAGE_ECPM, + ADSENSE_LINE_ITEM_LEVEL_AVERAGE_ECPM, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_PERCENT_IMPRESSIONS, + ADSENSE_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_PERCENT_CLICKS, + ADSENSE_LINE_ITEM_LEVEL_PERCENT_CLICKS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_WITH_CPD_PERCENT_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_IMPRESSIONS, + AD_EXCHANGE_LINE_ITEM_LEVEL_CLICKS, + AD_EXCHANGE_LINE_ITEM_LEVEL_CTR, + AD_EXCHANGE_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + AD_EXCHANGE_LINE_ITEM_LEVEL_PERCENT_CLICKS, + AD_EXCHANGE_LINE_ITEM_LEVEL_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_AVERAGE_ECPM, + TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + TOTAL_LINE_ITEM_LEVEL_IMPRESSIONS, + TOTAL_INVENTORY_LEVEL_CLICKS, + TOTAL_LINE_ITEM_LEVEL_CLICKS, + TOTAL_INVENTORY_LEVEL_CTR, + TOTAL_LINE_ITEM_LEVEL_CTR, + TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE, + TOTAL_INVENTORY_LEVEL_ALL_REVENUE, + TOTAL_LINE_ITEM_LEVEL_CPM_AND_CPC_REVENUE, + TOTAL_LINE_ITEM_LEVEL_ALL_REVENUE, + TOTAL_INVENTORY_LEVEL_WITHOUT_CPD_AVERAGE_ECPM, + TOTAL_INVENTORY_LEVEL_WITH_CPD_AVERAGE_ECPM, + TOTAL_LINE_ITEM_LEVEL_WITHOUT_CPD_AVERAGE_ECPM, + TOTAL_LINE_ITEM_LEVEL_WITH_CPD_AVERAGE_ECPM, + TOTAL_INVENTORY_LEVEL_UNFILLED_IMPRESSIONS, + MERGED_AD_SERVER_DELIVERY_INDICATOR, + MERGED_AD_SERVER_IMPRESSIONS, + MERGED_AD_SERVER_CLICKS, + MERGED_AD_SERVER_CTR, + MERGED_AD_SERVER_CPM_AND_CPC_REVENUE, + MERGED_AD_SERVER_ALL_REVENUE, + MERGED_AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM, + MERGED_AD_SERVER_WITH_CPD_AVERAGE_ECPM, + OPTIMIZATION_CONTROL_IMPRESSIONS, + OPTIMIZATION_CONTROL_CLICKS, + OPTIMIZATION_CONTROL_CTR, + OPTIMIZATION_OPTIMIZED_IMPRESSIONS, + OPTIMIZATION_OPTIMIZED_CLICKS, + OPTIMIZATION_NON_OPTIMIZED_IMPRESSIONS, + OPTIMIZATION_NON_OPTIMIZED_CLICKS, + OPTIMIZATION_EXTRA_CLICKS, + OPTIMIZATION_OPTIMIZED_CTR, + OPTIMIZATION_LIFT, + OPTIMIZATION_COVERAGE, + OPTIMIZATION_BEHIND_SCHEDULE_IMPRESSIONS, + OPTIMIZATION_NO_CLICKS_RECORDED_IMPRESSIONS, + OPTIMIZATION_SPONSORSHIP_IMPRESSIONS, + OPTIMIZATION_AS_FAST_AS_POSSIBLE_IMPRESSIONS, + OPTIMIZATION_NO_ABSOLUTE_LIFETIME_GOAL_IMPRESSIONS, + OPTIMIZATION_CONTROL_REVENUE, + OPTIMIZATION_OPTIMIZED_REVENUE, + OPTIMIZATION_CONTROL_ECPM, + OPTIMIZATION_OPTIMIZED_ECPM, + OPTIMIZATION_FREED_UP_IMPRESSIONS, + OPTIMIZATION_ECPM_LIFT, + REACH_FREQUENCY, + REACH_AVERAGE_REVENUE, + REACH, + SELL_THROUGH_FORECASTED_IMPRESSIONS, + SELL_THROUGH_AVAILABLE_IMPRESSIONS, + SELL_THROUGH_RESERVED_IMPRESSIONS, + SELL_THROUGH_SELL_THROUGH_RATE, + RICH_MEDIA_BACKUP_IMAGES, + RICH_MEDIA_DISPLAY_TIME, + RICH_MEDIA_AVERAGE_DISPLAY_TIME, + RICH_MEDIA_EXPANSIONS, + RICH_MEDIA_EXPANDING_TIME, + RICH_MEDIA_INTERACTION_TIME, + RICH_MEDIA_INTERACTION_COUNT, + RICH_MEDIA_INTERACTION_RATE, + RICH_MEDIA_AVERAGE_INTERACTION_TIME, + RICH_MEDIA_INTERACTION_IMPRESSIONS, + RICH_MEDIA_MANUAL_CLOSES, + RICH_MEDIA_FULL_SCREEN_IMPRESSIONS, + RICH_MEDIA_VIDEO_INTERACTIONS, + RICH_MEDIA_VIDEO_INTERACTION_RATE, + RICH_MEDIA_VIDEO_MUTES, + RICH_MEDIA_VIDEO_PAUSES, + RICH_MEDIA_VIDEO_PLAYES, + RICH_MEDIA_VIDEO_MIDPOINTS, + RICH_MEDIA_VIDEO_COMPLETES, + RICH_MEDIA_VIDEO_REPLAYS, + RICH_MEDIA_VIDEO_STOPS, + RICH_MEDIA_VIDEO_UNMUTES, + RICH_MEDIA_VIDEO_VIEW_TIME, + RICH_MEDIA_VIDEO_VIEW_RATE, + RICH_MEDIA_CUSTOM_CONVERSION_TIME_VALUE, + RICH_MEDIA_CUSTOM_CONVERSION_COUNT_VALUE, + VIDEO_INTERACTION_START, + VIDEO_INTERACTION_FIRST_QUARTILE, + VIDEO_INTERACTION_MIDPOINT, + VIDEO_INTERACTION_THIRD_QUARTILE, + VIDEO_INTERACTION_COMPLETE, + VIDEO_INTERACTION_VIEW_RATE, + VIDEO_INTERACTION_AVERAGE_VIEW_RATE, + VIDEO_INTERACTION_COMPLETION_RATE, + VIDEO_INTERACTION_ERROR_COUNT, + VIDEO_INTERACTION_VIDEO_LENGTH, + VIDEO_INTERACTION_PAUSE, + VIDEO_INTERACTION_RESUME, + VIDEO_INTERACTION_REWIND, + VIDEO_INTERACTION_MUTE, + VIDEO_INTERACTION_UNMUTE, + VIDEO_INTERACTION_COLLAPSE, + VIDEO_INTERACTION_EXPAND, + VIDEO_INTERACTION_FULL_SCREEN, + VIDEO_INTERACTION_AVERAGE_INTERACTION_RATE, + VIDEO_INTERACTION_VIDEO_SKIPS, + VIDEO_INTERACTION_VIDEO_SKIP_SHOWN, + VIDEO_INTERACTION_ENGAGED_VIEW, + VIDEO_INTERACTION_VIEW_THROUGH_RATE, + DISTRIBUTION_PARTNER_IMPRESSIONS, + DISTRIBUTION_PARTNER_CLICKS, + DISTRIBUTION_PARTNER_CTR, + DISTRIBUTION_PARTNER_GROSS_REVENUE, + DISTRIBUTION_PARTNER_HOST_REVENUE, + DISTRIBUTION_PARTNER_HOST_ECPM, + DISTRIBUTION_PARTNER_PARTNER_REVENUE, + DISTRIBUTION_PARTNER_PARTNER_ECPM, + CONTENT_PARTNER_IMPRESSIONS, + CONTENT_PARTNER_CLICKS, + CONTENT_PARTNER_CTR, + CONTENT_PARTNER_GROSS_REVENUE, + CONTENT_PARTNER_HOST_REVENUE, + CONTENT_PARTNER_HOST_ECPM, + CONTENT_PARTNER_PARTNER_REVENUE, + CONTENT_PARTNER_PARTNER_ECPM, + RIGHTS_HOLDER_IMPRESSIONS, + RIGHTS_HOLDER_CLICKS, + RIGHTS_HOLDER_CTR, + RIGHTS_HOLDER_GROSS_REVENUE, + RIGHTS_HOLDER_HOST_REVENUE, + RIGHTS_HOLDER_HOST_ECPM, + RIGHTS_HOLDER_PARTNER_REVENUE, + RIGHTS_HOLDER_PARTNER_ECPM, + VIEW_THROUGH_CONVERSIONS, + CONVERSIONS_PER_THOUSAND_IMPRESSIONS, + CLICK_THROUGH_CONVERSIONS, + CONVERSIONS_PER_CLICK, + VIEW_THROUGH_REVENUE, + CLICK_THROUGH_REVENUE, + TOTAL_CONVERSIONS, + TOTAL_CONVERSION_REVENUE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum DimensionAttribute { + LINE_ITEM_LABELS, + LINE_ITEM_LABEL_IDS, + ADVERTISER_EXTERNAL_ID, + ORDER_START_DATE_TIME, + ORDER_END_DATE_TIME, + ORDER_EXTERNAL_ID, + ORDER_PO_NUMBER, + ORDER_AGENCY, + ORDER_AGENCY_ID, + ORDER_LABELS, + ORDER_LABEL_IDS, + ORDER_TRAFFICKER, + ORDER_SECONDARY_TRAFFICKERS, + ORDER_SALESPERSON, + ORDER_SECONDARY_SALESPEOPLE, + ORDER_LIFETIME_IMPRESSIONS, + ORDER_LIFETIME_CLICKS, + ORDER_LIFETIME_MERGED_IMPRESSIONS, + ORDER_LIFETIME_MERGED_CLICKS, + LINE_ITEM_START_DATE_TIME, + LINE_ITEM_END_DATE_TIME, + LINE_ITEM_EXTERNAL_ID, + LINE_ITEM_COST_TYPE, + LINE_ITEM_COST_PER_UNIT, + LINE_ITEM_GOAL_QUANTITY, + LINE_ITEM_LIFETIME_IMPRESSIONS, + LINE_ITEM_LIFETIME_CLICKS, + LINE_ITEM_LIFETIME_MERGED_IMPRESSIONS, + LINE_ITEM_LIFETIME_MERGED_CLICKS, + CREATIVE_OR_CREATIVE_SET, + MASTER_COMPANION_TYPE, + LINE_ITEM_CONTRACTED_QUANTITY, + ADVERTISER_LABELS, + ADVERTISER_LABEL_IDS, + CREATIVE_CLICK_THROUGH_URL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum DateRangeType { + TODAY, + YESTERDAY, + LAST_WEEK, + LAST_MONTH, + REACH_LIFETIME, + CUSTOM_DATE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum DimensionFilter { + ADVERTISERS, + ACTIVE_ADVERTISERS, + HOUSE_ADVERTISERS, + NON_HOUSE_ADVERTISERS, + ALL_SALESPEOPLE, + WHOLE_NETWORK, + CURRENT_USER_ORDERS, + STARTED_ORDERS, + COMPLETED_ORDERS, + MOBILE_LINE_ITEMS, + WEB_LINE_ITEMS, + ACTIVE_AD_UNITS, + INACTIVE_AD_UNITS, + MOBILE_INVENTORY_UNITS, + WEB_INVENTORY_UNITS, + ARCHIVED_AD_UNITS, + ACTIVE_PLACEMENTS, + INACTIVE_PLACEMENTS, + ARCHIVED_PLACEMENTS, + OPTIMIZABLE_ORDERS, + PARTNER_STATS_TYPE_ESTIMATED, + PARTNER_STATS_TYPE_RECONCILED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ReportJob { + private long idField; + + private bool idFieldSpecified; + + private ReportQuery reportQueryField; + + private ReportJobStatus reportJobStatusField; + + private bool reportJobStatusFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public ReportQuery reportQuery { + get { return this.reportQueryField; } + set { this.reportQueryField = value; } + } + + public ReportJobStatus reportJobStatus { + get { return this.reportJobStatusField; } + set { + this.reportJobStatusField = value; + this.reportJobStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reportJobStatusSpecified { + get { return this.reportJobStatusFieldSpecified; } + set { this.reportJobStatusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ReportJobStatus { + COMPLETED, + IN_PROGRESS, + FAILED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ReportDownloadOptions { + private ExportFormat exportFormatField; + + private bool exportFormatFieldSpecified; + + private bool includeReportPropertiesField; + + private bool includeReportPropertiesFieldSpecified; + + private bool includeTotalsRowField; + + private bool includeTotalsRowFieldSpecified; + + private bool useGzipCompressionField; + + private bool useGzipCompressionFieldSpecified; + + public ExportFormat exportFormat { + get { return this.exportFormatField; } + set { + this.exportFormatField = value; + this.exportFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool exportFormatSpecified { + get { return this.exportFormatFieldSpecified; } + set { this.exportFormatFieldSpecified = value; } + } + + public bool includeReportProperties { + get { return this.includeReportPropertiesField; } + set { + this.includeReportPropertiesField = value; + this.includeReportPropertiesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeReportPropertiesSpecified { + get { return this.includeReportPropertiesFieldSpecified; } + set { this.includeReportPropertiesFieldSpecified = value; } + } + + public bool includeTotalsRow { + get { return this.includeTotalsRowField; } + set { + this.includeTotalsRowField = value; + this.includeTotalsRowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeTotalsRowSpecified { + get { return this.includeTotalsRowFieldSpecified; } + set { this.includeTotalsRowFieldSpecified = value; } + } + + public bool useGzipCompression { + get { return this.useGzipCompressionField; } + set { + this.useGzipCompressionField = value; + this.useGzipCompressionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool useGzipCompressionSpecified { + get { return this.useGzipCompressionFieldSpecified; } + set { this.useGzipCompressionFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ExportFormat { + TSV, + CSV_EXCEL, + CSV_DUMP, + XML, + XLS, + XLSX + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ReportError : ApiError { + private ReportErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReportErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ReportErrorReason { + DEFAULT, + REPORT_ACCESS_NOT_ALLOWED, + DIMENSION_VIEW_NOT_ALLOWED, + DIMENSION_COMBINATION_NOT_ALLOWED, + ATTRIBUTE_VIEW_NOT_ALLOWED, + COLUMN_VIEW_NOT_ALLOWED, + TOO_MANY_CONCURRENT_REPORTS, + REPORT_TOO_BIG, + INVALID_OPERATION_FOR_REPORT_STATE, + INVALID_DIMENSIONS, + INVALID_ATTRIBUTES, + INVALID_COLUMNS, + INVALID_DIMENSION_FILTERS, + INVALID_DATE, + END_DATE_TIME_NOT_AFTER_START_TIME, + NOT_NULL, + ATTRIBUTES_NOT_SUPPORTED_FOR_REQUEST, + COLUMNS_NOT_SUPPORTED_FOR_REQUESTED_DIMENSIONS, + FAILED_TO_STORE_REPORT, + REPORT_NOT_FOUND, + SR_CANNOT_RUN_REPORT_IN_ANOTHER_NETWORK, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ActivityServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ActivityService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ActivityService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/ActivityService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Activity[] createActivities([System.Xml.Serialization.XmlElementAttribute("activities")] +Activity[] activities) { + object[] results = this.Invoke("createActivities", new object[] { activities }); + return ((Activity[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Activity createActivity(Activity activity) { + object[] results = this.Invoke("createActivity", new object[] { activity }); + return ((Activity) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ActivityPage getActivitiesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getActivitiesByStatement", new object[] { filterStatement }); + return ((ActivityPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Activity getActivity(int activityId) { + object[] results = this.Invoke("getActivity", new object[] { activityId }); + return ((Activity) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Activity[] updateActivities([System.Xml.Serialization.XmlElementAttribute("activities")] +Activity[] activities) { + object[] results = this.Invoke("updateActivities", new object[] { activities }); + return ((Activity[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Activity updateActivity(Activity activity) { + object[] results = this.Invoke("updateActivity", new object[] { activity }); + return ((Activity) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ActivityPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Activity[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Activity[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Activity { + private int idField; + + private bool idFieldSpecified; + + private int activityGroupIdField; + + private bool activityGroupIdFieldSpecified; + + private string nameField; + + private string expectedURLField; + + private ActivityStatus statusField; + + private bool statusFieldSpecified; + + private ActivityType typeField; + + private bool typeFieldSpecified; + + public int id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public int activityGroupId { + get { return this.activityGroupIdField; } + set { + this.activityGroupIdField = value; + this.activityGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool activityGroupIdSpecified { + get { return this.activityGroupIdFieldSpecified; } + set { this.activityGroupIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string expectedURL { + get { return this.expectedURLField; } + set { this.expectedURLField = value; } + } + + public ActivityStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ActivityType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Activity.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ActivityStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Activity.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ActivityType { + PAGE_VIEWS, + DAILY_VISITS, + CUSTOM, + ITEMS_PURCHASED, + TRANSACTIONS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "PublisherQueryLanguageServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class PublisherQueryLanguageService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public PublisherQueryLanguageService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/PublisherQueryLanguageService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ResultSet select(Statement selectStatement) { + object[] results = this.Invoke("select", new object[] { selectStatement }); + return ((ResultSet) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Row { + private Value[] valuesField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("values")] + public Value[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ColumnType { + private string labelNameField; + + public string labelName { + get { return this.labelNameField; } + set { this.labelNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ResultSet { + private ColumnType[] columnTypesField; + + private Row[] rowsField; + + [System.Xml.Serialization.XmlElementAttribute("columnTypes")] + public ColumnType[] columnTypes { + get { return this.columnTypesField; } + set { this.columnTypesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("rows")] + public Row[] rows { + get { return this.rowsField; } + set { this.rowsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ThirdPartySlotServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ThirdPartySlotService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ThirdPartySlotService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/ThirdPartySlotService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ThirdPartySlot createThirdPartySlot(ThirdPartySlot thirdPartySlot) { + object[] results = this.Invoke("createThirdPartySlot", new object[] { thirdPartySlot }); + return ((ThirdPartySlot) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ThirdPartySlotPage getThirdPartySlotsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getThirdPartySlotsByStatement", new object[] { filterStatement }); + return ((ThirdPartySlotPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performThirdPartySlotAction(ThirdPartySlotAction thirdPartySlotAction, Statement filterStatement) { + object[] results = this.Invoke("performThirdPartySlotAction", new object[] { thirdPartySlotAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ThirdPartySlot updateThirdPartySlot(ThirdPartySlot thirdPartySlot) { + object[] results = this.Invoke("updateThirdPartySlot", new object[] { thirdPartySlot }); + return ((ThirdPartySlot) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveThirdPartySlots))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateThirdPartySlots))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class ThirdPartySlotAction { + private string thirdPartySlotActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ThirdPartySlotAction.Type")] + public string ThirdPartySlotActionType { + get { return this.thirdPartySlotActionTypeField; } + set { this.thirdPartySlotActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ArchiveThirdPartySlots : ThirdPartySlotAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ActivateThirdPartySlots : ThirdPartySlotAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ThirdPartySlotPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ThirdPartySlot[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ThirdPartySlot[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ThirdPartySlot { + private long idField; + + private bool idFieldSpecified; + + private long[] creativeIdsField; + + private long companyIdField; + + private bool companyIdFieldSpecified; + + private string externalUniqueIdField; + + private string externalUniqueNameField; + + private string descriptionField; + + private ThirdPartySlotStatus statusField; + + private bool statusFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativeIds")] + public long[] creativeIds { + get { return this.creativeIdsField; } + set { this.creativeIdsField = value; } + } + + public long companyId { + get { return this.companyIdField; } + set { + this.companyIdField = value; + this.companyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companyIdSpecified { + get { return this.companyIdFieldSpecified; } + set { this.companyIdFieldSpecified = value; } + } + + public string externalUniqueId { + get { return this.externalUniqueIdField; } + set { this.externalUniqueIdField = value; } + } + + public string externalUniqueName { + get { return this.externalUniqueNameField; } + set { this.externalUniqueNameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public ThirdPartySlotStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ThirdPartySlot.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ThirdPartySlotStatus { + ACTIVE, + ARCHIVED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeWrapperServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeWrapperService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeWrapperService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/CreativeWrapperService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeWrapper createCreativeWrapper(CreativeWrapper creativeWrapper) { + object[] results = this.Invoke("createCreativeWrapper", new object[] { creativeWrapper }); + return ((CreativeWrapper) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeWrapper[] createCreativeWrappers([System.Xml.Serialization.XmlElementAttribute("creativeWrappers")] +CreativeWrapper[] creativeWrappers) { + object[] results = this.Invoke("createCreativeWrappers", new object[] { creativeWrappers }); + return ((CreativeWrapper[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeWrapper getCreativeWrapper(long creativeWrapperId) { + object[] results = this.Invoke("getCreativeWrapper", new object[] { creativeWrapperId }); + return ((CreativeWrapper) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeWrapperPage getCreativeWrappersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativeWrappersByStatement", new object[] { filterStatement }); + return ((CreativeWrapperPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performCreativeWrapperAction(CreativeWrapperAction creativeWrapperAction, Statement filterStatement) { + object[] results = this.Invoke("performCreativeWrapperAction", new object[] { creativeWrapperAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeWrapper updateCreativeWrapper(CreativeWrapper creativeWrapper) { + object[] results = this.Invoke("updateCreativeWrapper", new object[] { creativeWrapper }); + return ((CreativeWrapper) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeWrapper[] updateCreativeWrappers([System.Xml.Serialization.XmlElementAttribute("creativeWrappers")] +CreativeWrapper[] creativeWrappers) { + object[] results = this.Invoke("updateCreativeWrappers", new object[] { creativeWrappers }); + return ((CreativeWrapper[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateCreativeWrappers))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateCreativeWrappers))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public abstract partial class CreativeWrapperAction { + private string creativeWrapperActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CreativeWrapperAction.Type")] + public string CreativeWrapperActionType { + get { return this.creativeWrapperActionTypeField; } + set { this.creativeWrapperActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DeactivateCreativeWrappers : CreativeWrapperAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ActivateCreativeWrappers : CreativeWrapperAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CreativeWrapperPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeWrapper[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeWrapper[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CreativeWrapper { + private long idField; + + private bool idFieldSpecified; + + private long labelIdField; + + private bool labelIdFieldSpecified; + + private CreativeWrapperHtmlSnippet headerField; + + private CreativeWrapperHtmlSnippet footerField; + + private CreativeWrapperOrdering orderingField; + + private bool orderingFieldSpecified; + + private CreativeWrapperStatus statusField; + + private bool statusFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + + public CreativeWrapperHtmlSnippet header { + get { return this.headerField; } + set { this.headerField = value; } + } + + public CreativeWrapperHtmlSnippet footer { + get { return this.footerField; } + set { this.footerField = value; } + } + + public CreativeWrapperOrdering ordering { + get { return this.orderingField; } + set { + this.orderingField = value; + this.orderingSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderingSpecified { + get { return this.orderingFieldSpecified; } + set { this.orderingFieldSpecified = value; } + } + + public CreativeWrapperStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CreativeWrapperHtmlSnippet { + private string htmlSnippetField; + + public string htmlSnippet { + get { return this.htmlSnippetField; } + set { this.htmlSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CreativeWrapperOrdering { + NO_PREFERENCE, + INNER, + OUTER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CreativeWrapperStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeSetServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeSetService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeSetService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/CreativeSetService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeSet createCreativeSet(CreativeSet creativeSet) { + object[] results = this.Invoke("createCreativeSet", new object[] { creativeSet }); + return ((CreativeSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeSet getCreativeSet(long creativeSetId) { + object[] results = this.Invoke("getCreativeSet", new object[] { creativeSetId }); + return ((CreativeSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeSetPage getCreativeSetsByStatement(Statement statement) { + object[] results = this.Invoke("getCreativeSetsByStatement", new object[] { statement }); + return ((CreativeSetPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CreativeSet updateCreativeSet(CreativeSet creativeSet) { + object[] results = this.Invoke("updateCreativeSet", new object[] { creativeSet }); + return ((CreativeSet) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CreativeSetPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeSet[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeSet[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CreativeSet { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private long masterCreativeIdField; + + private bool masterCreativeIdFieldSpecified; + + private long[] companionCreativeIdsField; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public long masterCreativeId { + get { return this.masterCreativeIdField; } + set { + this.masterCreativeIdField = value; + this.masterCreativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool masterCreativeIdSpecified { + get { return this.masterCreativeIdFieldSpecified; } + set { this.masterCreativeIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ContactServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseContact))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ContactService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ContactService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/ContactService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Contact createContact(Contact contact) { + object[] results = this.Invoke("createContact", new object[] { contact }); + return ((Contact) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Contact[] createContacts([System.Xml.Serialization.XmlElementAttribute("contacts")] +Contact[] contacts) { + object[] results = this.Invoke("createContacts", new object[] { contacts }); + return ((Contact[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Contact getContact(long contactId) { + object[] results = this.Invoke("getContact", new object[] { contactId }); + return ((Contact) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public ContactPage getContactsByStatement(Statement statement) { + object[] results = this.Invoke("getContactsByStatement", new object[] { statement }); + return ((ContactPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Contact updateContact(Contact contact) { + object[] results = this.Invoke("updateContact", new object[] { contact }); + return ((Contact) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public Contact[] updateContacts([System.Xml.Serialization.XmlElementAttribute("contacts")] +Contact[] contacts) { + object[] results = this.Invoke("updateContacts", new object[] { contacts }); + return ((Contact[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ContactPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Contact[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Contact[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class Contact : BaseContact { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private long companyIdField; + + private bool companyIdFieldSpecified; + + private ContactStatus statusField; + + private bool statusFieldSpecified; + + private string addressField; + + private string cellPhoneField; + + private string commentField; + + private string emailField; + + private string faxPhoneField; + + private string titleField; + + private string workPhoneField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public long companyId { + get { return this.companyIdField; } + set { + this.companyIdField = value; + this.companyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companyIdSpecified { + get { return this.companyIdFieldSpecified; } + set { this.companyIdFieldSpecified = value; } + } + + public ContactStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string address { + get { return this.addressField; } + set { this.addressField = value; } + } + + public string cellPhone { + get { return this.cellPhoneField; } + set { this.cellPhoneField = value; } + } + + public string comment { + get { return this.commentField; } + set { this.commentField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public string faxPhone { + get { return this.faxPhoneField; } + set { this.faxPhoneField = value; } + } + + public string title { + get { return this.titleField; } + set { this.titleField = value; } + } + + public string workPhone { + get { return this.workPhoneField; } + set { this.workPhoneField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Contact.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ContactStatus { + UNINVITED, + INVITE_PENDNG, + INVITE_EXPIRED, + INVITE_CANCELED, + USER_ACTIVE, + USER_DISABLED, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Contact))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class BaseContact { + private string baseContactTypeField; + + [System.Xml.Serialization.XmlElementAttribute("BaseContact.Type")] + public string BaseContactType { + get { return this.baseContactTypeField; } + set { this.baseContactTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ContactError : ApiError { + private ContactErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ContactErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ContactError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum ContactErrorReason { + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomFieldServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomFieldService : DfpSoapClient { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomFieldService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201302/CustomFieldService"; + } + + public RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomField createCustomField(CustomField customField) { + object[] results = this.Invoke("createCustomField", new object[] { customField }); + return ((CustomField) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomFieldOption createCustomFieldOption(CustomFieldOption customFieldOption) { + object[] results = this.Invoke("createCustomFieldOption", new object[] { customFieldOption }); + return ((CustomFieldOption) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomFieldOption[] createCustomFieldOptions([System.Xml.Serialization.XmlElementAttribute("customFieldOptions")] +CustomFieldOption[] customFieldOptions) { + object[] results = this.Invoke("createCustomFieldOptions", new object[] { customFieldOptions }); + return ((CustomFieldOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomField[] createCustomFields([System.Xml.Serialization.XmlElementAttribute("customFields")] +CustomField[] customFields) { + object[] results = this.Invoke("createCustomFields", new object[] { customFields }); + return ((CustomField[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomField getCustomField(long customFieldId) { + object[] results = this.Invoke("getCustomField", new object[] { customFieldId }); + return ((CustomField) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomFieldOption getCustomFieldOption(long customFieldOptionId, [System.Xml.Serialization.XmlIgnoreAttribute()] +bool customFieldOptionIdSpecified) { + object[] results = this.Invoke("getCustomFieldOption", new object[] { customFieldOptionId, customFieldOptionIdSpecified }); + return ((CustomFieldOption) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomFieldPage getCustomFieldsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomFieldsByStatement", new object[] { filterStatement }); + return ((CustomFieldPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public UpdateResult performCustomFieldAction(CustomFieldAction customFieldAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomFieldAction", new object[] { customFieldAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomField updateCustomField(CustomField customField) { + object[] results = this.Invoke("updateCustomField", new object[] { customField }); + return ((CustomField) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomFieldOption updateCustomFieldOption(CustomFieldOption customFieldOption) { + object[] results = this.Invoke("updateCustomFieldOption", new object[] { customFieldOption }); + return ((CustomFieldOption) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomFieldOption[] updateCustomFieldOptions([System.Xml.Serialization.XmlElementAttribute("customFieldOptions")] +CustomFieldOption[] customFieldOptions) { + object[] results = this.Invoke("updateCustomFieldOptions", new object[] { customFieldOptions }); + return ((CustomFieldOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201302", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201302", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public CustomField[] updateCustomFields([System.Xml.Serialization.XmlElementAttribute("customFields")] +CustomField[] customFields) { + object[] results = this.Invoke("updateCustomFields", new object[] { customFields }); + return ((CustomField[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateCustomFields))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateCustomFields))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CustomFieldAction { + private string customFieldActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomFieldAction.Type")] + public string CustomFieldActionType { + get { return this.customFieldActionTypeField; } + set { this.customFieldActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DeactivateCustomFields : CustomFieldAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class ActivateCustomFields : CustomFieldAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CustomFieldPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomField[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomField[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DropDownCustomField))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CustomField { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private CustomFieldEntityType entityTypeField; + + private bool entityTypeFieldSpecified; + + private CustomFieldDataType dataTypeField; + + private bool dataTypeFieldSpecified; + + private CustomFieldVisibility visibilityField; + + private bool visibilityFieldSpecified; + + private string customFieldTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + public CustomFieldEntityType entityType { + get { return this.entityTypeField; } + set { + this.entityTypeField = value; + this.entityTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool entityTypeSpecified { + get { return this.entityTypeFieldSpecified; } + set { this.entityTypeFieldSpecified = value; } + } + + public CustomFieldDataType dataType { + get { return this.dataTypeField; } + set { + this.dataTypeField = value; + this.dataTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dataTypeSpecified { + get { return this.dataTypeFieldSpecified; } + set { this.dataTypeFieldSpecified = value; } + } + + public CustomFieldVisibility visibility { + get { return this.visibilityField; } + set { + this.visibilityField = value; + this.visibilitySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool visibilitySpecified { + get { return this.visibilityFieldSpecified; } + set { this.visibilityFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("CustomField.Type")] + public string CustomFieldType { + get { return this.customFieldTypeField; } + set { this.customFieldTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CustomFieldEntityType { + LINE_ITEM, + ORDER, + CREATIVE, + USER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CustomFieldDataType { + STRING, + NUMBER, + TOGGLE, + DROP_DOWN, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CustomFieldVisibility { + API_ONLY, + READ_ONLY, + FULL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class DropDownCustomField : CustomField { + private CustomFieldOption[] optionsField; + + [System.Xml.Serialization.XmlElementAttribute("options")] + public CustomFieldOption[] options { + get { return this.optionsField; } + set { this.optionsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CustomFieldOption { + private long idField; + + private bool idFieldSpecified; + + private long customFieldIdField; + + private bool customFieldIdFieldSpecified; + + private string displayNameField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long customFieldId { + get { return this.customFieldIdField; } + set { + this.customFieldIdField = value; + this.customFieldIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldIdSpecified { + get { return this.customFieldIdFieldSpecified; } + set { this.customFieldIdFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public partial class CustomFieldError : ApiError { + private CustomFieldErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomFieldErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomFieldError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201302")] + public enum CustomFieldErrorReason { + INVALID_CUSTOM_FIELD_FOR_OPTION, + UNKNOWN + } +} diff --git a/src/Dfp/v201302/DfpServiceV201302.cs b/src/Dfp/v201302/DfpServiceV201302.cs new file mode 100644 index 00000000000..c0d2f8720f7 --- /dev/null +++ b/src/Dfp/v201302/DfpServiceV201302.cs @@ -0,0 +1,248 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Reflection; + +namespace Google.Api.Ads.Dfp.Lib { + /// + /// Lists all the services available through this library. + /// + public partial class DfpService : AdsService { + /// + /// All the services available in v201302. + /// + public class v201302 { + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ActivityGroupService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ActivityService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdRuleService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ContactService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AudienceSegmentService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CompanyService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ContentService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeSetService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeTemplateService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeWrapperService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomFieldService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomTargetingService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ForecastService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature InventoryService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LabelService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LineItemService; + + /// + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LineItemCreativeAssociationService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature NetworkService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature OrderService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature PlacementService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature PublisherQueryLanguageService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReportService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SuggestedAdUnitService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature TeamService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ThirdPartySlotService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature UserService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature UserTeamAssociationService; + + /// + /// Factory type for v201302 services. + /// + public static readonly Type factoryType = typeof(DfpServiceFactory); + + /// + /// Static constructor to initialize the service constants. + /// + static v201302() { + ActivityGroupService = DfpService.MakeServiceSignature("v201302", "ActivityGroupService"); + ActivityService = DfpService.MakeServiceSignature("v201302", "ActivityService"); + AdRuleService = DfpService.MakeServiceSignature("v201302", "AdRuleService"); + ContactService = DfpService.MakeServiceSignature("v201302", "ContactService"); + AudienceSegmentService = DfpService.MakeServiceSignature("v201302", + "AudienceSegmentService"); + CompanyService = DfpService.MakeServiceSignature("v201302", "CompanyService"); + ContentService = DfpService.MakeServiceSignature("v201302", "ContentService"); + CreativeService = DfpService.MakeServiceSignature("v201302", "CreativeService"); + CreativeSetService = DfpService.MakeServiceSignature("v201302", "CreativeSetService"); + CreativeTemplateService = DfpService.MakeServiceSignature("v201302", + "CreativeTemplateService"); + CreativeWrapperService = DfpService.MakeServiceSignature("v201302", + "CreativeWrapperService"); + CustomTargetingService = DfpService.MakeServiceSignature("v201302", + "CustomTargetingService"); + CustomFieldService = DfpService.MakeServiceSignature("v201302", + "CustomFieldService"); + ForecastService = DfpService.MakeServiceSignature("v201302", "ForecastService"); + InventoryService = DfpService.MakeServiceSignature("v201302", "InventoryService"); + LabelService = DfpService.MakeServiceSignature("v201302", "LabelService"); + LineItemService = DfpService.MakeServiceSignature("v201302", "LineItemService"); + LineItemCreativeAssociationService = + DfpService.MakeServiceSignature("v201302", "LineItemCreativeAssociationService"); + NetworkService = DfpService.MakeServiceSignature("v201302", "NetworkService"); + OrderService = DfpService.MakeServiceSignature("v201302", "OrderService"); + PlacementService = DfpService.MakeServiceSignature("v201302", "PlacementService"); + PublisherQueryLanguageService = DfpService.MakeServiceSignature("v201302", + "PublisherQueryLanguageService"); + ReportService = DfpService.MakeServiceSignature("v201302", "ReportService"); + SuggestedAdUnitService = DfpService.MakeServiceSignature("v201302", + "SuggestedAdUnitService"); + TeamService = DfpService.MakeServiceSignature("v201302", "TeamService"); + ThirdPartySlotService = DfpService.MakeServiceSignature("v201302", + "ThirdPartySlotService"); + UserService = DfpService.MakeServiceSignature("v201302", "UserService"); + UserTeamAssociationService = DfpService.MakeServiceSignature("v201302", + "UserTeamAssociationService"); + } + } + } +} diff --git a/src/Dfp/v201306/DfpApi.cs b/src/Dfp/v201306/DfpApi.cs new file mode 100644 index 00000000000..f572a86f737 --- /dev/null +++ b/src/Dfp/v201306/DfpApi.cs @@ -0,0 +1,25427 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +namespace Google.Api.Ads.Dfp.v201306 { + using Google.Api.Ads.Dfp.Lib; + using Google.Api.Ads.Dfp.Headers; + using System; + using System.Web.Services; + using System.Diagnostics; + using System.Web.Services.Protocols; + using System.Xml.Serialization; + using System.ComponentModel; + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AudienceSegmentServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AudienceSegmentService : DfpSoapClient, IAudienceSegmentService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AudienceSegmentService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/AudienceSegmentService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AudienceSegmentPage getAudienceSegmentsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAudienceSegmentsByStatement", new object[] { filterStatement }); + return ((AudienceSegmentPage) (results[0])); + } + } + + + + + + + + + + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OAuth))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClientLogin))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class Authentication { + private string authenticationTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Authentication.Type")] + public string AuthenticationType { + get { return this.authenticationTypeField; } + set { this.authenticationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AudienceSegment { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private AudienceSegmentStatus statusField; + + private bool statusFieldSpecified; + + private long sizeField; + + private bool sizeFieldSpecified; + + private string audienceSegmentTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public AudienceSegmentStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public long size { + get { return this.sizeField; } + set { + this.sizeField = value; + this.sizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sizeSpecified { + get { return this.sizeFieldSpecified; } + set { this.sizeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("AudienceSegment.Type")] + public string AudienceSegmentType { + get { return this.audienceSegmentTypeField; } + set { this.audienceSegmentTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegment.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AudienceSegmentStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AudienceSegmentPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AudienceSegment[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AudienceSegment[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Date { + private int yearField; + + private bool yearFieldSpecified; + + private int monthField; + + private bool monthFieldSpecified; + + private int dayField; + + private bool dayFieldSpecified; + + public int year { + get { return this.yearField; } + set { + this.yearField = value; + this.yearSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool yearSpecified { + get { return this.yearFieldSpecified; } + set { this.yearFieldSpecified = value; } + } + + public int month { + get { return this.monthField; } + set { + this.monthField = value; + this.monthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool monthSpecified { + get { return this.monthFieldSpecified; } + set { this.monthFieldSpecified = value; } + } + + public int day { + get { return this.dayField; } + set { + this.dayField = value; + this.daySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool daySpecified { + get { return this.dayFieldSpecified; } + set { this.dayFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DateTime { + private Date dateField; + + private int hourField; + + private bool hourFieldSpecified; + + private int minuteField; + + private bool minuteFieldSpecified; + + private int secondField; + + private bool secondFieldSpecified; + + private string timeZoneIDField; + + public Date date { + get { return this.dateField; } + set { this.dateField = value; } + } + + public int hour { + get { return this.hourField; } + set { + this.hourField = value; + this.hourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hourSpecified { + get { return this.hourFieldSpecified; } + set { this.hourFieldSpecified = value; } + } + + public int minute { + get { return this.minuteField; } + set { + this.minuteField = value; + this.minuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minuteSpecified { + get { return this.minuteFieldSpecified; } + set { this.minuteFieldSpecified = value; } + } + + public int second { + get { return this.secondField; } + set { + this.secondField = value; + this.secondSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool secondSpecified { + get { return this.secondFieldSpecified; } + set { this.secondFieldSpecified = value; } + } + + public string timeZoneID { + get { return this.timeZoneIDField; } + set { this.timeZoneIDField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TextValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NumberValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateTimeValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BooleanValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class Value { + private string valueTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Value.Type")] + public string ValueType { + get { return this.valueTypeField; } + set { this.valueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class TextValue : Value { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class NumberValue : Value { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DateValue : Value { + private Date valueField; + + public Date value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DateTimeValue : Value { + private DateTime valueField; + + public DateTime value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class BooleanValue : Value { + private bool valueField; + + private bool valueFieldSpecified; + + public bool value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class String_ValueMapEntry { + private string keyField; + + private Value valueField; + + public string key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public Value value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Statement { + private string queryField; + + private String_ValueMapEntry[] valuesField; + + public string query { + get { return this.queryField; } + set { this.queryField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("values")] + public String_ValueMapEntry[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StatementError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServerError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(QuotaError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PublisherQueryLanguageSyntaxError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PublisherQueryLanguageContextError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PermissionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NotNullError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InternalApiError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeatureError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CommonError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AuthenticationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApiVersionError))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UniqueError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TypeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ParseError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LabelEntityAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringLengthError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NullError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LabelError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeWrapperError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TeamError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidEmailError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CompanyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CompanyCreditStatusError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredNumberError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PoddingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRuleSlotError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRulePriorityError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRuleFrequencyCapError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRuleDateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NetworkError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReconciliationImportError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReconciliationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RangeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredCollectionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidUrlError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentPartnerError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EntityLimitReachedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserDomainTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TechnologyTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReservationDetailsError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProposalLineItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProposalLineItemActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProposalError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PrecisionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GeoTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GenericTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FrequencyCapError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DayPartTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldValueError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BillingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReportError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivityError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredSizeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OrderError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemOperationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemFlightDateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemCreativeAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ForecastError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateTimeRangeTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClickTrackingLineItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceExtensionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TemplateInstantiatedCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SwiffyConversionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemCreativeAssociationOperationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidPhoneNumberError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FileError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeSetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeAssetMacroError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseAccountError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseRateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RateCardCustomizationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseRateActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RegExError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitTypeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitSizesError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitPartnerAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidColorError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitHierarchyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitCodeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitAfcSizeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductTemplateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductTemplateActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OrderActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RateCardActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WorkflowActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProposalActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeTemplateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContactError))] + public abstract partial class ApiError { + private string fieldPathField; + + private string triggerField; + + private string errorStringField; + + private string apiErrorTypeField; + + public string fieldPath { + get { return this.fieldPathField; } + set { this.fieldPathField = value; } + } + + public string trigger { + get { return this.triggerField; } + set { this.triggerField = value; } + } + + public string errorString { + get { return this.errorStringField; } + set { this.errorStringField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApiError.Type")] + public string ApiErrorType { + get { return this.apiErrorTypeField; } + set { this.apiErrorTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class StatementError : ApiError { + private StatementErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StatementErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StatementError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum StatementErrorReason { + VARIABLE_NOT_BOUND_TO_VALUE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ServerError : ApiError { + private ServerErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ServerErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ServerError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ServerErrorReason { + SERVER_ERROR, + SERVER_BUSY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RequiredError : ApiError { + private RequiredErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum RequiredErrorReason { + REQUIRED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class QuotaError : ApiError { + private QuotaErrorReason reasonField; + + private bool reasonFieldSpecified; + + public QuotaErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "QuotaError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum QuotaErrorReason { + EXCEEDED_QUOTA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class PublisherQueryLanguageSyntaxError : ApiError { + private PublisherQueryLanguageSyntaxErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PublisherQueryLanguageSyntaxErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PublisherQueryLanguageSyntaxError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum PublisherQueryLanguageSyntaxErrorReason { + UNPARSABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class PublisherQueryLanguageContextError : ApiError { + private PublisherQueryLanguageContextErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PublisherQueryLanguageContextErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PublisherQueryLanguageContextError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum PublisherQueryLanguageContextErrorReason { + UNEXECUTABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class PermissionError : ApiError { + private PermissionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PermissionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PermissionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum PermissionErrorReason { + PERMISSION_DENIED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class NotNullError : ApiError { + private NotNullErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NotNullErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NotNullError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum NotNullErrorReason { + ARG1_NULL, + ARG2_NULL, + ARG3_NULL, + NULL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class InternalApiError : ApiError { + private InternalApiErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InternalApiErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InternalApiError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum InternalApiErrorReason { + UNEXPECTED_INTERNAL_API_ERROR, + UNKNOWN, + DOWNTIME + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class FeatureError : ApiError { + private FeatureErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FeatureErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeatureError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum FeatureErrorReason { + MISSING_FEATURE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CommonError : ApiError { + private CommonErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CommonErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CommonError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CommonErrorReason { + NOT_FOUND, + ALREADY_EXISTS, + DUPLICATE_OBJECT, + CANNOT_UPDATE, + CONCURRENT_MODIFICATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AuthenticationError : ApiError { + private AuthenticationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AuthenticationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AuthenticationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AuthenticationErrorReason { + AMBIGUOUS_SOAP_REQUEST_HEADER, + INVALID_EMAIL, + AUTHENTICATION_FAILED, + INVALID_OAUTH_SIGNATURE, + INVALID_SERVICE, + MISSING_SOAP_REQUEST_HEADER, + MISSING_AUTHENTICATION_HTTP_HEADER, + MISSING_AUTHENTICATION, + NOT_WHITELISTED_FOR_API_ACCESS, + NO_NETWORKS_TO_ACCESS, + NETWORK_NOT_FOUND, + NETWORK_CODE_REQUIRED, + CONNECTION_ERROR, + GOOGLE_ACCOUNT_ALREADY_ASSOCIATED_WITH_NETWORK, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ApiVersionError : ApiError { + private ApiVersionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ApiVersionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ApiVersionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ApiVersionErrorReason { + UPDATE_TO_NEWER_VERSION, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApiException))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ApplicationException { + private string messageField; + + private string applicationExceptionTypeField; + + public string message { + get { return this.messageField; } + set { this.messageField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApplicationException.Type")] + public string ApplicationExceptionType { + get { return this.applicationExceptionTypeField; } + set { this.applicationExceptionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ApiException : ApplicationException { + private ApiError[] errorsField; + + [System.Xml.Serialization.XmlElementAttribute("errors")] + public ApiError[] errors { + get { return this.errorsField; } + set { this.errorsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class OAuth : Authentication { + private string parametersField; + + public string parameters { + get { return this.parametersField; } + set { this.parametersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ClientLogin : Authentication { + private string tokenField; + + public string token { + get { return this.tokenField; } + set { this.tokenField = value; } + } + } + + + + + + + + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "SuggestedAdUnitServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class SuggestedAdUnitService : DfpSoapClient, ISuggestedAdUnitService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public SuggestedAdUnitService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/SuggestedAdUnitService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SuggestedAdUnit getSuggestedAdUnit(string suggestedAdUnitId) { + object[] results = this.Invoke("getSuggestedAdUnit", new object[] { suggestedAdUnitId }); + return ((SuggestedAdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SuggestedAdUnitPage getSuggestedAdUnitsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getSuggestedAdUnitsByStatement", new object[] { filterStatement }); + return ((SuggestedAdUnitPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SuggestedAdUnitUpdateResult performSuggestedAdUnitAction(SuggestedAdUnitAction suggestedAdUnitAction, Statement filterStatement) { + object[] results = this.Invoke("performSuggestedAdUnitAction", new object[] { suggestedAdUnitAction, filterStatement }); + return ((SuggestedAdUnitUpdateResult) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class SuggestedAdUnitUpdateResult { + private string[] newAdUnitIdsField; + + private int numChangesField; + + private bool numChangesFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("newAdUnitIds")] + public string[] newAdUnitIds { + get { return this.newAdUnitIdsField; } + set { this.newAdUnitIdsField = value; } + } + + public int numChanges { + get { return this.numChangesField; } + set { + this.numChangesField = value; + this.numChangesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numChangesSpecified { + get { return this.numChangesFieldSpecified; } + set { this.numChangesFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveSuggestedAdUnit))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class SuggestedAdUnitAction { + private string suggestedAdUnitActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("SuggestedAdUnitAction.Type")] + public string SuggestedAdUnitActionType { + get { return this.suggestedAdUnitActionTypeField; } + set { this.suggestedAdUnitActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ApproveSuggestedAdUnit : SuggestedAdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class SuggestedAdUnitPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private SuggestedAdUnit[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public SuggestedAdUnit[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class SuggestedAdUnit { + private string idField; + + private long numRequestsField; + + private bool numRequestsFieldSpecified; + + private string[] pathField; + + private AdUnitParent[] parentPathField; + + private AdUnitTargetWindow targetWindowField; + + private bool targetWindowFieldSpecified; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private AdUnitSize[] suggestedAdUnitSizesField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public long numRequests { + get { return this.numRequestsField; } + set { + this.numRequestsField = value; + this.numRequestsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numRequestsSpecified { + get { return this.numRequestsFieldSpecified; } + set { this.numRequestsFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("path")] + public string[] path { + get { return this.pathField; } + set { this.pathField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("parentPath")] + public AdUnitParent[] parentPath { + get { return this.parentPathField; } + set { this.parentPathField = value; } + } + + public AdUnitTargetWindow targetWindow { + get { return this.targetWindowField; } + set { + this.targetWindowField = value; + this.targetWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetWindowSpecified { + get { return this.targetWindowFieldSpecified; } + set { this.targetWindowFieldSpecified = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("suggestedAdUnitSizes")] + public AdUnitSize[] suggestedAdUnitSizes { + get { return this.suggestedAdUnitSizesField; } + set { this.suggestedAdUnitSizesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AdUnitParent { + private string idField; + + private string nameField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnit.TargetWindow", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AdUnitTargetWindow { + TOP, + BLANK + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum TargetPlatform { + WEB, + MOBILE, + ANY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AdUnitSize { + private Size sizeField; + + private EnvironmentType environmentTypeField; + + private bool environmentTypeFieldSpecified; + + private AdUnitSize[] companionsField; + + private string fullDisplayStringField; + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + public EnvironmentType environmentType { + get { return this.environmentTypeField; } + set { + this.environmentTypeField = value; + this.environmentTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool environmentTypeSpecified { + get { return this.environmentTypeFieldSpecified; } + set { this.environmentTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companions")] + public AdUnitSize[] companions { + get { return this.companionsField; } + set { this.companionsField = value; } + } + + public string fullDisplayString { + get { return this.fullDisplayStringField; } + set { this.fullDisplayStringField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Size { + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + private bool isAspectRatioField; + + private bool isAspectRatioFieldSpecified; + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + public bool isAspectRatio { + get { return this.isAspectRatioField; } + set { + this.isAspectRatioField = value; + this.isAspectRatioSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAspectRatioSpecified { + get { return this.isAspectRatioFieldSpecified; } + set { this.isAspectRatioFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum EnvironmentType { + BROWSER, + VIDEO_PLAYER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class UniqueError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class TypeError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ParseError : ApiError { + private ParseErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ParseErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ParseError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ParseErrorReason { + UNPARSABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class LabelEntityAssociationError : ApiError { + private LabelEntityAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LabelEntityAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LabelEntityAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum LabelEntityAssociationErrorReason { + INVALID_COMPANY_TYPE, + DUPLICATE_ASSOCIATION, + INVALID_ASSOCIATION, + DUPLICATE_ASSOCIATION_WITH_NEGATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LabelServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LabelService : DfpSoapClient, ILabelService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LabelService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/LabelService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Label createLabel(Label label) { + object[] results = this.Invoke("createLabel", new object[] { label }); + return ((Label) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Label[] createLabels([System.Xml.Serialization.XmlElementAttribute("labels")] +Label[] labels) { + object[] results = this.Invoke("createLabels", new object[] { labels }); + return ((Label[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Label getLabel(long labelId) { + object[] results = this.Invoke("getLabel", new object[] { labelId }); + return ((Label) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LabelPage getLabelsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLabelsByStatement", new object[] { filterStatement }); + return ((LabelPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performLabelAction(LabelAction labelAction, Statement filterStatement) { + object[] results = this.Invoke("performLabelAction", new object[] { labelAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Label updateLabel(Label label) { + object[] results = this.Invoke("updateLabel", new object[] { label }); + return ((Label) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Label[] updateLabels([System.Xml.Serialization.XmlElementAttribute("labels")] +Label[] labels) { + object[] results = this.Invoke("updateLabels", new object[] { labels }); + return ((Label[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class UpdateResult { + private int numChangesField; + + private bool numChangesFieldSpecified; + + public int numChanges { + get { return this.numChangesField; } + set { + this.numChangesField = value; + this.numChangesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numChangesSpecified { + get { return this.numChangesFieldSpecified; } + set { this.numChangesFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateLabels))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLabels))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class LabelAction { + private string labelActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LabelAction.Type")] + public string LabelActionType { + get { return this.labelActionTypeField; } + set { this.labelActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeactivateLabels : LabelAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ActivateLabels : LabelAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class LabelPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Label[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Label[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Label { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private LabelType[] typesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("types")] + public LabelType[] types { + get { return this.typesField; } + set { this.typesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum LabelType { + COMPETITIVE_EXCLUSION, + AD_UNIT_FREQUENCY_CAP, + AD_EXCLUSION, + CREATIVE_WRAPPER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class StringLengthError : ApiError { + private StringLengthErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StringLengthErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StringLengthError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum StringLengthErrorReason { + TOO_LONG, + TOO_SHORT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class NullError : ApiError { + private NullErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NullErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NullError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum NullErrorReason { + NULL_CONTENT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class LabelError : ApiError { + private LabelErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LabelErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LabelError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum LabelErrorReason { + INVALID_PREFIX, + NAME_INVALID_CHARS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CreativeWrapperError : ApiError { + private CreativeWrapperErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeWrapperErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeWrapperError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CreativeWrapperErrorReason { + LABEL_ALREADY_ASSOCIATED_WITH_CREATIVE_WRAPPER, + INVALID_LABEL_TYPE, + UNRECOGNIZED_MACRO, + NEITHER_HEADER_NOR_FOOTER_SPECIFIED, + CANNOT_USE_CREATIVE_WRAPPER_TYPE, + CANNOT_UPDATE_LABEL_ID, + CANNOT_APPLY_TO_AD_UNIT_WITH_VIDEO_SIZES, + CANNOT_APPLY_TO_MOBILE_AD_UNIT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CompanyServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CompanyService : DfpSoapClient, ICompanyService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CompanyService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/CompanyService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Company[] createCompanies([System.Xml.Serialization.XmlElementAttribute("companies")] +Company[] companies) { + object[] results = this.Invoke("createCompanies", new object[] { companies }); + return ((Company[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Company createCompany(Company company) { + object[] results = this.Invoke("createCompany", new object[] { company }); + return ((Company) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CompanyPage getCompaniesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCompaniesByStatement", new object[] { filterStatement }); + return ((CompanyPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Company getCompany(long companyId) { + object[] results = this.Invoke("getCompany", new object[] { companyId }); + return ((Company) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Company[] updateCompanies([System.Xml.Serialization.XmlElementAttribute("companies")] +Company[] companies) { + object[] results = this.Invoke("updateCompanies", new object[] { companies }); + return ((Company[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Company updateCompany(Company company) { + object[] results = this.Invoke("updateCompany", new object[] { company }); + return ((Company) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CompanyPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Company[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Company[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Company { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private CompanyType typeField; + + private bool typeFieldSpecified; + + private string addressField; + + private string emailField; + + private string faxPhoneField; + + private string primaryPhoneField; + + private string externalIdField; + + private string commentField; + + private CompanyCreditStatus creditStatusField; + + private bool creditStatusFieldSpecified; + + private AppliedLabel[] appliedLabelsField; + + private bool enableSameAdvertiserCompetitiveExclusionField; + + private bool enableSameAdvertiserCompetitiveExclusionFieldSpecified; + + private long primaryContactIdField; + + private bool primaryContactIdFieldSpecified; + + private long[] appliedTeamIdsField; + + private int thirdPartyCompanyIdField; + + private bool thirdPartyCompanyIdFieldSpecified; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public CompanyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public string address { + get { return this.addressField; } + set { this.addressField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public string faxPhone { + get { return this.faxPhoneField; } + set { this.faxPhoneField = value; } + } + + public string primaryPhone { + get { return this.primaryPhoneField; } + set { this.primaryPhoneField = value; } + } + + public string externalId { + get { return this.externalIdField; } + set { this.externalIdField = value; } + } + + public string comment { + get { return this.commentField; } + set { this.commentField = value; } + } + + public CompanyCreditStatus creditStatus { + get { return this.creditStatusField; } + set { + this.creditStatusField = value; + this.creditStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creditStatusSpecified { + get { return this.creditStatusFieldSpecified; } + set { this.creditStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + public bool enableSameAdvertiserCompetitiveExclusion { + get { return this.enableSameAdvertiserCompetitiveExclusionField; } + set { + this.enableSameAdvertiserCompetitiveExclusionField = value; + this.enableSameAdvertiserCompetitiveExclusionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool enableSameAdvertiserCompetitiveExclusionSpecified { + get { return this.enableSameAdvertiserCompetitiveExclusionFieldSpecified; } + set { this.enableSameAdvertiserCompetitiveExclusionFieldSpecified = value; } + } + + public long primaryContactId { + get { return this.primaryContactIdField; } + set { + this.primaryContactIdField = value; + this.primaryContactIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool primaryContactIdSpecified { + get { return this.primaryContactIdFieldSpecified; } + set { this.primaryContactIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public int thirdPartyCompanyId { + get { return this.thirdPartyCompanyIdField; } + set { + this.thirdPartyCompanyIdField = value; + this.thirdPartyCompanyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyCompanyIdSpecified { + get { return this.thirdPartyCompanyIdFieldSpecified; } + set { this.thirdPartyCompanyIdFieldSpecified = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Company.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CompanyType { + HOUSE_ADVERTISER, + HOUSE_AGENCY, + ADVERTISER, + AGENCY, + AD_NETWORK, + AFFILIATE_DISTRIBUTION_PARTNER, + CONTENT_PARTNER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Company.CreditStatus", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CompanyCreditStatus { + ACTIVE, + ON_HOLD, + CREDIT_STOP, + INACTIVE, + BLOCKED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AppliedLabel { + private long labelIdField; + + private bool labelIdFieldSpecified; + + private bool isNegatedField; + + private bool isNegatedFieldSpecified; + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + + public bool isNegated { + get { return this.isNegatedField; } + set { + this.isNegatedField = value; + this.isNegatedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isNegatedSpecified { + get { return this.isNegatedFieldSpecified; } + set { this.isNegatedFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class TeamError : ApiError { + private TeamErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TeamErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TeamError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum TeamErrorReason { + ENTITY_NOT_ON_USERS_TEAMS, + MISSING_USERS_TEAM, + ALL_TEAM_ASSOCIATION_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class InvalidEmailError : ApiError { + private InvalidEmailErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidEmailErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidEmailError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum InvalidEmailErrorReason { + INVALID_FORMAT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CompanyError : ApiError { + private CompanyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CompanyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CompanyError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CompanyErrorReason { + CANNOT_SET_THIRD_PARTY_COMPANY_DUE_TO_TYPE, + CANNOT_UPDATE_COMPANY_TYPE, + INVALID_COMPANY_TYPE, + PRIMARY_CONTACT_DOES_NOT_BELONG_TO_THIS_COMPANY, + THIRD_PARTY_STATS_PROVIDER_IS_WRONG_ROLE_TYPE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CompanyCreditStatusError : ApiError { + private CompanyCreditStatusErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CompanyCreditStatusErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CompanyCreditStatusError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CompanyCreditStatusErrorReason { + COMPANY_CREDIT_STATUS_CHANGE_NOT_ALLOWED, + CANNOT_USE_CREDIT_STATUS_SETTING, + CANNOT_USE_ADVANCED_CREDIT_STATUS_SETTING, + UNACCEPTABLE_COMPANY_CREDIT_STATUS_FOR_ORDER, + UNACCEPTABLE_COMPANY_CREDIT_STATUS_FOR_LINE_ITEM, + CANNOT_BLOCK_COMPANY_TOO_MANY_APPROVED_ORDERS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdRuleServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdRuleService : DfpSoapClient, IAdRuleService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdRuleService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/AdRuleService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRule createAdRule(AdRule adRule) { + object[] results = this.Invoke("createAdRule", new object[] { adRule }); + return ((AdRule) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRule[] createAdRules([System.Xml.Serialization.XmlElementAttribute("adRules")] +AdRule[] adRules) { + object[] results = this.Invoke("createAdRules", new object[] { adRules }); + return ((AdRule[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRule getAdRule(int adRuleId) { + object[] results = this.Invoke("getAdRule", new object[] { adRuleId }); + return ((AdRule) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRulePage getAdRulesByStatement(Statement statement) { + object[] results = this.Invoke("getAdRulesByStatement", new object[] { statement }); + return ((AdRulePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performAdRuleAction(AdRuleAction adRuleAction, Statement filterStatement) { + object[] results = this.Invoke("performAdRuleAction", new object[] { adRuleAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRule updateAdRule(AdRule adRule) { + object[] results = this.Invoke("updateAdRule", new object[] { adRule }); + return ((AdRule) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRule[] updateAdRules([System.Xml.Serialization.XmlElementAttribute("adRules")] +AdRule[] adRules) { + object[] results = this.Invoke("updateAdRules", new object[] { adRules }); + return ((AdRule[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteAdRules))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateAdRules))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateAdRules))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class AdRuleAction { + private string adRuleActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AdRuleAction.Type")] + public string AdRuleActionType { + get { return this.adRuleActionTypeField; } + set { this.adRuleActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeleteAdRules : AdRuleAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeactivateAdRules : AdRuleAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ActivateAdRules : AdRuleAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AdRulePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AdRule[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AdRule[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AdRule { + private int idField; + + private bool idFieldSpecified; + + private string nameField; + + private int priorityField; + + private bool priorityFieldSpecified; + + private Targeting targetingField; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private AdRuleStatus statusField; + + private bool statusFieldSpecified; + + private FrequencyCapBehavior frequencyCapBehaviorField; + + private bool frequencyCapBehaviorFieldSpecified; + + private int maxImpressionsPerLineItemPerStreamField; + + private bool maxImpressionsPerLineItemPerStreamFieldSpecified; + + private int maxImpressionsPerLineItemPerPodField; + + private bool maxImpressionsPerLineItemPerPodFieldSpecified; + + private BaseAdRuleSlot prerollField; + + private BaseAdRuleSlot midrollField; + + private BaseAdRuleSlot postrollField; + + public int id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + public Targeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public AdRuleStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public FrequencyCapBehavior frequencyCapBehavior { + get { return this.frequencyCapBehaviorField; } + set { + this.frequencyCapBehaviorField = value; + this.frequencyCapBehaviorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool frequencyCapBehaviorSpecified { + get { return this.frequencyCapBehaviorFieldSpecified; } + set { this.frequencyCapBehaviorFieldSpecified = value; } + } + + public int maxImpressionsPerLineItemPerStream { + get { return this.maxImpressionsPerLineItemPerStreamField; } + set { + this.maxImpressionsPerLineItemPerStreamField = value; + this.maxImpressionsPerLineItemPerStreamSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxImpressionsPerLineItemPerStreamSpecified { + get { return this.maxImpressionsPerLineItemPerStreamFieldSpecified; } + set { this.maxImpressionsPerLineItemPerStreamFieldSpecified = value; } + } + + public int maxImpressionsPerLineItemPerPod { + get { return this.maxImpressionsPerLineItemPerPodField; } + set { + this.maxImpressionsPerLineItemPerPodField = value; + this.maxImpressionsPerLineItemPerPodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxImpressionsPerLineItemPerPodSpecified { + get { return this.maxImpressionsPerLineItemPerPodFieldSpecified; } + set { this.maxImpressionsPerLineItemPerPodFieldSpecified = value; } + } + + public BaseAdRuleSlot preroll { + get { return this.prerollField; } + set { this.prerollField = value; } + } + + public BaseAdRuleSlot midroll { + get { return this.midrollField; } + set { this.midrollField = value; } + } + + public BaseAdRuleSlot postroll { + get { return this.postrollField; } + set { this.postrollField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Targeting { + private GeoTargeting geoTargetingField; + + private InventoryTargeting inventoryTargetingField; + + private DayPartTargeting dayPartTargetingField; + + private TechnologyTargeting technologyTargetingField; + + private CustomCriteriaSet customTargetingField; + + private UserDomainTargeting userDomainTargetingField; + + private ContentTargeting contentTargetingField; + + private VideoPositionTargeting videoPositionTargetingField; + + public GeoTargeting geoTargeting { + get { return this.geoTargetingField; } + set { this.geoTargetingField = value; } + } + + public InventoryTargeting inventoryTargeting { + get { return this.inventoryTargetingField; } + set { this.inventoryTargetingField = value; } + } + + public DayPartTargeting dayPartTargeting { + get { return this.dayPartTargetingField; } + set { this.dayPartTargetingField = value; } + } + + public TechnologyTargeting technologyTargeting { + get { return this.technologyTargetingField; } + set { this.technologyTargetingField = value; } + } + + public CustomCriteriaSet customTargeting { + get { return this.customTargetingField; } + set { this.customTargetingField = value; } + } + + public UserDomainTargeting userDomainTargeting { + get { return this.userDomainTargetingField; } + set { this.userDomainTargetingField = value; } + } + + public ContentTargeting contentTargeting { + get { return this.contentTargetingField; } + set { this.contentTargetingField = value; } + } + + public VideoPositionTargeting videoPositionTargeting { + get { return this.videoPositionTargetingField; } + set { this.videoPositionTargetingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class GeoTargeting { + private Location[] targetedLocationsField; + + private Location[] excludedLocationsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedLocations")] + public Location[] targetedLocations { + get { return this.targetedLocationsField; } + set { this.targetedLocationsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedLocations")] + public Location[] excludedLocations { + get { return this.excludedLocationsField; } + set { this.excludedLocationsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RegionLocation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PostalCodeLocation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MetroLocation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CountryLocation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CityLocation))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Location { + private long idField; + + private bool idFieldSpecified; + + private string locationTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Location.Type")] + public string LocationType { + get { return this.locationTypeField; } + set { this.locationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RegionLocation : Location { + private string regionCodeField; + + public string regionCode { + get { return this.regionCodeField; } + set { this.regionCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class PostalCodeLocation : Location { + private string postalCodeField; + + private string countryCodeField; + + public string postalCode { + get { return this.postalCodeField; } + set { this.postalCodeField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class MetroLocation : Location { + private string metroCodeField; + + private string countryCodeField; + + public string metroCode { + get { return this.metroCodeField; } + set { this.metroCodeField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CountryLocation : Location { + private string countryCodeField; + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CityLocation : Location { + private string cityNameField; + + private string regionCodeField; + + private string countryCodeField; + + public string cityName { + get { return this.cityNameField; } + set { this.cityNameField = value; } + } + + public string regionCode { + get { return this.regionCodeField; } + set { this.regionCodeField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class InventoryTargeting { + private AdUnitTargeting[] targetedAdUnitsField; + + private AdUnitTargeting[] excludedAdUnitsField; + + private long[] targetedPlacementIdsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedAdUnits")] + public AdUnitTargeting[] targetedAdUnits { + get { return this.targetedAdUnitsField; } + set { this.targetedAdUnitsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedAdUnits")] + public AdUnitTargeting[] excludedAdUnits { + get { return this.excludedAdUnitsField; } + set { this.excludedAdUnitsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedPlacementIds")] + public long[] targetedPlacementIds { + get { return this.targetedPlacementIdsField; } + set { this.targetedPlacementIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AdUnitTargeting { + private string adUnitIdField; + + private bool includeDescendantsField; + + private bool includeDescendantsFieldSpecified; + + public string adUnitId { + get { return this.adUnitIdField; } + set { this.adUnitIdField = value; } + } + + public bool includeDescendants { + get { return this.includeDescendantsField; } + set { + this.includeDescendantsField = value; + this.includeDescendantsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeDescendantsSpecified { + get { return this.includeDescendantsFieldSpecified; } + set { this.includeDescendantsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DayPartTargeting { + private DayPart[] dayPartsField; + + private DeliveryTimeZone timeZoneField; + + private bool timeZoneFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("dayParts")] + public DayPart[] dayParts { + get { return this.dayPartsField; } + set { this.dayPartsField = value; } + } + + public DeliveryTimeZone timeZone { + get { return this.timeZoneField; } + set { + this.timeZoneField = value; + this.timeZoneSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool timeZoneSpecified { + get { return this.timeZoneFieldSpecified; } + set { this.timeZoneFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DayPart { + private DayOfWeek dayOfWeekField; + + private bool dayOfWeekFieldSpecified; + + private TimeOfDay startTimeField; + + private TimeOfDay endTimeField; + + public DayOfWeek dayOfWeek { + get { return this.dayOfWeekField; } + set { + this.dayOfWeekField = value; + this.dayOfWeekSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dayOfWeekSpecified { + get { return this.dayOfWeekFieldSpecified; } + set { this.dayOfWeekFieldSpecified = value; } + } + + public TimeOfDay startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public TimeOfDay endTime { + get { return this.endTimeField; } + set { this.endTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum DayOfWeek { + MONDAY, + TUESDAY, + WEDNESDAY, + THURSDAY, + FRIDAY, + SATURDAY, + SUNDAY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class TimeOfDay { + private int hourField; + + private bool hourFieldSpecified; + + private MinuteOfHour minuteField; + + private bool minuteFieldSpecified; + + public int hour { + get { return this.hourField; } + set { + this.hourField = value; + this.hourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hourSpecified { + get { return this.hourFieldSpecified; } + set { this.hourFieldSpecified = value; } + } + + public MinuteOfHour minute { + get { return this.minuteField; } + set { + this.minuteField = value; + this.minuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minuteSpecified { + get { return this.minuteFieldSpecified; } + set { this.minuteFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum MinuteOfHour { + ZERO, + FIFTEEN, + THIRTY, + FORTY_FIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum DeliveryTimeZone { + PUBLISHER, + BROWSER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class TechnologyTargeting { + private BandwidthGroupTargeting bandwidthGroupTargetingField; + + private BrowserTargeting browserTargetingField; + + private BrowserLanguageTargeting browserLanguageTargetingField; + + private DeviceCapabilityTargeting deviceCapabilityTargetingField; + + private DeviceCategoryTargeting deviceCategoryTargetingField; + + private DeviceManufacturerTargeting deviceManufacturerTargetingField; + + private MobileCarrierTargeting mobileCarrierTargetingField; + + private MobileDeviceTargeting mobileDeviceTargetingField; + + private MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargetingField; + + private OperatingSystemTargeting operatingSystemTargetingField; + + private OperatingSystemVersionTargeting operatingSystemVersionTargetingField; + + public BandwidthGroupTargeting bandwidthGroupTargeting { + get { return this.bandwidthGroupTargetingField; } + set { this.bandwidthGroupTargetingField = value; } + } + + public BrowserTargeting browserTargeting { + get { return this.browserTargetingField; } + set { this.browserTargetingField = value; } + } + + public BrowserLanguageTargeting browserLanguageTargeting { + get { return this.browserLanguageTargetingField; } + set { this.browserLanguageTargetingField = value; } + } + + public DeviceCapabilityTargeting deviceCapabilityTargeting { + get { return this.deviceCapabilityTargetingField; } + set { this.deviceCapabilityTargetingField = value; } + } + + public DeviceCategoryTargeting deviceCategoryTargeting { + get { return this.deviceCategoryTargetingField; } + set { this.deviceCategoryTargetingField = value; } + } + + public DeviceManufacturerTargeting deviceManufacturerTargeting { + get { return this.deviceManufacturerTargetingField; } + set { this.deviceManufacturerTargetingField = value; } + } + + public MobileCarrierTargeting mobileCarrierTargeting { + get { return this.mobileCarrierTargetingField; } + set { this.mobileCarrierTargetingField = value; } + } + + public MobileDeviceTargeting mobileDeviceTargeting { + get { return this.mobileDeviceTargetingField; } + set { this.mobileDeviceTargetingField = value; } + } + + public MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargeting { + get { return this.mobileDeviceSubmodelTargetingField; } + set { this.mobileDeviceSubmodelTargetingField = value; } + } + + public OperatingSystemTargeting operatingSystemTargeting { + get { return this.operatingSystemTargetingField; } + set { this.operatingSystemTargetingField = value; } + } + + public OperatingSystemVersionTargeting operatingSystemVersionTargeting { + get { return this.operatingSystemVersionTargetingField; } + set { this.operatingSystemVersionTargetingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class BandwidthGroupTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] bandwidthGroupsField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("bandwidthGroups")] + public Technology[] bandwidthGroups { + get { return this.bandwidthGroupsField; } + set { this.bandwidthGroupsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystemVersion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystem))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileDeviceSubmodel))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileDevice))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileCarrier))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceManufacturer))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceCategory))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceCapability))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BrowserLanguage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Browser))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BandwidthGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Technology { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string technologyTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Technology.Type")] + public string TechnologyType { + get { return this.technologyTypeField; } + set { this.technologyTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class OperatingSystemVersion : Technology { + private int majorVersionField; + + private bool majorVersionFieldSpecified; + + private int minorVersionField; + + private bool minorVersionFieldSpecified; + + private int microVersionField; + + private bool microVersionFieldSpecified; + + public int majorVersion { + get { return this.majorVersionField; } + set { + this.majorVersionField = value; + this.majorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool majorVersionSpecified { + get { return this.majorVersionFieldSpecified; } + set { this.majorVersionFieldSpecified = value; } + } + + public int minorVersion { + get { return this.minorVersionField; } + set { + this.minorVersionField = value; + this.minorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minorVersionSpecified { + get { return this.minorVersionFieldSpecified; } + set { this.minorVersionFieldSpecified = value; } + } + + public int microVersion { + get { return this.microVersionField; } + set { + this.microVersionField = value; + this.microVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool microVersionSpecified { + get { return this.microVersionFieldSpecified; } + set { this.microVersionFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class OperatingSystem : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class MobileDeviceSubmodel : Technology { + private long mobileDeviceCriterionIdField; + + private bool mobileDeviceCriterionIdFieldSpecified; + + private long deviceManufacturerCriterionIdField; + + private bool deviceManufacturerCriterionIdFieldSpecified; + + public long mobileDeviceCriterionId { + get { return this.mobileDeviceCriterionIdField; } + set { + this.mobileDeviceCriterionIdField = value; + this.mobileDeviceCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mobileDeviceCriterionIdSpecified { + get { return this.mobileDeviceCriterionIdFieldSpecified; } + set { this.mobileDeviceCriterionIdFieldSpecified = value; } + } + + public long deviceManufacturerCriterionId { + get { return this.deviceManufacturerCriterionIdField; } + set { + this.deviceManufacturerCriterionIdField = value; + this.deviceManufacturerCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deviceManufacturerCriterionIdSpecified { + get { return this.deviceManufacturerCriterionIdFieldSpecified; } + set { this.deviceManufacturerCriterionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class MobileDevice : Technology { + private long manufacturerCriterionIdField; + + private bool manufacturerCriterionIdFieldSpecified; + + public long manufacturerCriterionId { + get { return this.manufacturerCriterionIdField; } + set { + this.manufacturerCriterionIdField = value; + this.manufacturerCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manufacturerCriterionIdSpecified { + get { return this.manufacturerCriterionIdFieldSpecified; } + set { this.manufacturerCriterionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class MobileCarrier : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeviceManufacturer : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeviceCategory : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeviceCapability : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class BrowserLanguage : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Browser : Technology { + private string majorVersionField; + + private string minorVersionField; + + public string majorVersion { + get { return this.majorVersionField; } + set { this.majorVersionField = value; } + } + + public string minorVersion { + get { return this.minorVersionField; } + set { this.minorVersionField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class BandwidthGroup : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class BrowserTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] browsersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("browsers")] + public Technology[] browsers { + get { return this.browsersField; } + set { this.browsersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class BrowserLanguageTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] browserLanguagesField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("browserLanguages")] + public Technology[] browserLanguages { + get { return this.browserLanguagesField; } + set { this.browserLanguagesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeviceCapabilityTargeting { + private Technology[] targetedDeviceCapabilitiesField; + + private Technology[] excludedDeviceCapabilitiesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedDeviceCapabilities")] + public Technology[] targetedDeviceCapabilities { + get { return this.targetedDeviceCapabilitiesField; } + set { this.targetedDeviceCapabilitiesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedDeviceCapabilities")] + public Technology[] excludedDeviceCapabilities { + get { return this.excludedDeviceCapabilitiesField; } + set { this.excludedDeviceCapabilitiesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeviceCategoryTargeting { + private Technology[] targetedDeviceCategoriesField; + + private Technology[] excludedDeviceCategoriesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedDeviceCategories")] + public Technology[] targetedDeviceCategories { + get { return this.targetedDeviceCategoriesField; } + set { this.targetedDeviceCategoriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedDeviceCategories")] + public Technology[] excludedDeviceCategories { + get { return this.excludedDeviceCategoriesField; } + set { this.excludedDeviceCategoriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeviceManufacturerTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] deviceManufacturersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deviceManufacturers")] + public Technology[] deviceManufacturers { + get { return this.deviceManufacturersField; } + set { this.deviceManufacturersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class MobileCarrierTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] mobileCarriersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("mobileCarriers")] + public Technology[] mobileCarriers { + get { return this.mobileCarriersField; } + set { this.mobileCarriersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class MobileDeviceTargeting { + private Technology[] targetedMobileDevicesField; + + private Technology[] excludedMobileDevicesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedMobileDevices")] + public Technology[] targetedMobileDevices { + get { return this.targetedMobileDevicesField; } + set { this.targetedMobileDevicesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedMobileDevices")] + public Technology[] excludedMobileDevices { + get { return this.excludedMobileDevicesField; } + set { this.excludedMobileDevicesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class MobileDeviceSubmodelTargeting { + private Technology[] targetedMobileDeviceSubmodelsField; + + private Technology[] excludedMobileDeviceSubmodelsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedMobileDeviceSubmodels")] + public Technology[] targetedMobileDeviceSubmodels { + get { return this.targetedMobileDeviceSubmodelsField; } + set { this.targetedMobileDeviceSubmodelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedMobileDeviceSubmodels")] + public Technology[] excludedMobileDeviceSubmodels { + get { return this.excludedMobileDeviceSubmodelsField; } + set { this.excludedMobileDeviceSubmodelsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class OperatingSystemTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] operatingSystemsField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("operatingSystems")] + public Technology[] operatingSystems { + get { return this.operatingSystemsField; } + set { this.operatingSystemsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class OperatingSystemVersionTargeting { + private Technology[] targetedOperatingSystemVersionsField; + + private Technology[] excludedOperatingSystemVersionsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedOperatingSystemVersions")] + public Technology[] targetedOperatingSystemVersions { + get { return this.targetedOperatingSystemVersionsField; } + set { this.targetedOperatingSystemVersionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedOperatingSystemVersions")] + public Technology[] excludedOperatingSystemVersions { + get { return this.excludedOperatingSystemVersionsField; } + set { this.excludedOperatingSystemVersionsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CustomCriteriaSet : CustomCriteriaNode { + private CustomCriteriaSetLogicalOperator logicalOperatorField; + + private bool logicalOperatorFieldSpecified; + + private CustomCriteriaNode[] childrenField; + + public CustomCriteriaSetLogicalOperator logicalOperator { + get { return this.logicalOperatorField; } + set { + this.logicalOperatorField = value; + this.logicalOperatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool logicalOperatorSpecified { + get { return this.logicalOperatorFieldSpecified; } + set { this.logicalOperatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("children")] + public CustomCriteriaNode[] children { + get { return this.childrenField; } + set { this.childrenField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCriteriaSet.LogicalOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CustomCriteriaSetLogicalOperator { + AND, + OR + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteriaLeaf))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceSegmentCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteriaSet))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class CustomCriteriaNode { + private string customCriteriaNodeTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomCriteriaNode.Type")] + public string CustomCriteriaNodeType { + get { return this.customCriteriaNodeTypeField; } + set { this.customCriteriaNodeTypeField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceSegmentCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteria))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class CustomCriteriaLeaf : CustomCriteriaNode { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AudienceSegmentCriteria : CustomCriteriaLeaf { + private AudienceSegmentCriteriaComparisonOperator operatorField; + + private bool operatorFieldSpecified; + + private long[] audienceSegmentIdsField; + + public AudienceSegmentCriteriaComparisonOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("audienceSegmentIds")] + public long[] audienceSegmentIds { + get { return this.audienceSegmentIdsField; } + set { this.audienceSegmentIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegmentCriteria.ComparisonOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AudienceSegmentCriteriaComparisonOperator { + IS, + IS_NOT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CustomCriteria : CustomCriteriaLeaf { + private long keyIdField; + + private bool keyIdFieldSpecified; + + private long[] valueIdsField; + + private CustomCriteriaComparisonOperator operatorField; + + private bool operatorFieldSpecified; + + public long keyId { + get { return this.keyIdField; } + set { + this.keyIdField = value; + this.keyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keyIdSpecified { + get { return this.keyIdFieldSpecified; } + set { this.keyIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("valueIds")] + public long[] valueIds { + get { return this.valueIdsField; } + set { this.valueIdsField = value; } + } + + public CustomCriteriaComparisonOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCriteria.ComparisonOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CustomCriteriaComparisonOperator { + IS, + IS_NOT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class UserDomainTargeting { + private string[] domainsField; + + private bool targetedField; + + private bool targetedFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("domains")] + public string[] domains { + get { return this.domainsField; } + set { this.domainsField = value; } + } + + public bool targeted { + get { return this.targetedField; } + set { + this.targetedField = value; + this.targetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetedSpecified { + get { return this.targetedFieldSpecified; } + set { this.targetedFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ContentTargeting { + private long[] targetedContentIdsField; + + private long[] excludedContentIdsField; + + private long[] targetedVideoCategoryIdsField; + + private long[] excludedVideoCategoryIdsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedContentIds")] + public long[] targetedContentIds { + get { return this.targetedContentIdsField; } + set { this.targetedContentIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedContentIds")] + public long[] excludedContentIds { + get { return this.excludedContentIdsField; } + set { this.excludedContentIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedVideoCategoryIds")] + public long[] targetedVideoCategoryIds { + get { return this.targetedVideoCategoryIdsField; } + set { this.targetedVideoCategoryIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedVideoCategoryIds")] + public long[] excludedVideoCategoryIds { + get { return this.excludedVideoCategoryIdsField; } + set { this.excludedVideoCategoryIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class VideoPositionTargeting { + private VideoPositionTarget[] targetedPositionsField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("targetedPositions")] + public VideoPositionTarget[] targetedPositions { + get { return this.targetedPositionsField; } + set { this.targetedPositionsField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class VideoPositionTarget { + private VideoPosition videoPositionField; + + private VideoBumperType videoBumperTypeField; + + private bool videoBumperTypeFieldSpecified; + + private VideoPositionWithinPod videoPositionWithinPodField; + + public VideoPosition videoPosition { + get { return this.videoPositionField; } + set { this.videoPositionField = value; } + } + + public VideoBumperType videoBumperType { + get { return this.videoBumperTypeField; } + set { + this.videoBumperTypeField = value; + this.videoBumperTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoBumperTypeSpecified { + get { return this.videoBumperTypeFieldSpecified; } + set { this.videoBumperTypeFieldSpecified = value; } + } + + public VideoPositionWithinPod videoPositionWithinPod { + get { return this.videoPositionWithinPodField; } + set { this.videoPositionWithinPodField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class VideoPosition { + private VideoPositionType positionTypeField; + + private bool positionTypeFieldSpecified; + + private int midrollIndexField; + + private bool midrollIndexFieldSpecified; + + public VideoPositionType positionType { + get { return this.positionTypeField; } + set { + this.positionTypeField = value; + this.positionTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool positionTypeSpecified { + get { return this.positionTypeFieldSpecified; } + set { this.positionTypeFieldSpecified = value; } + } + + public int midrollIndex { + get { return this.midrollIndexField; } + set { + this.midrollIndexField = value; + this.midrollIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool midrollIndexSpecified { + get { return this.midrollIndexFieldSpecified; } + set { this.midrollIndexFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoPosition.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum VideoPositionType { + PREROLL, + MIDROLL, + POSTROLL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum VideoBumperType { + BEFORE, + AFTER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class VideoPositionWithinPod { + private int indexField; + + private bool indexFieldSpecified; + + public int index { + get { return this.indexField; } + set { + this.indexField = value; + this.indexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool indexSpecified { + get { return this.indexFieldSpecified; } + set { this.indexFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum StartDateTimeType { + USE_START_DATE_TIME, + IMMEDIATELY, + ONE_HOUR_FROM_NOW + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AdRuleStatus { + ACTIVE, + INACTIVE, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum FrequencyCapBehavior { + TURN_ON, + TURN_OFF, + DEFER, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnknownAdRuleSlot))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StandardPoddingAdRuleSlot))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OptimizedPoddingAdRuleSlot))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NoPoddingAdRuleSlot))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class BaseAdRuleSlot { + private long idField; + + private bool idFieldSpecified; + + private AdRuleSlotBehavior slotBehaviorField; + + private bool slotBehaviorFieldSpecified; + + private long minVideoAdDurationField; + + private bool minVideoAdDurationFieldSpecified; + + private long maxVideoAdDurationField; + + private bool maxVideoAdDurationFieldSpecified; + + private MidrollFrequencyType videoMidrollFrequencyTypeField; + + private bool videoMidrollFrequencyTypeFieldSpecified; + + private string videoMidrollFrequencyField; + + private AdRuleSlotBumper bumperField; + + private bool bumperFieldSpecified; + + private long maxBumperDurationField; + + private bool maxBumperDurationFieldSpecified; + + private long minPodDurationField; + + private bool minPodDurationFieldSpecified; + + private long maxPodDurationField; + + private bool maxPodDurationFieldSpecified; + + private int maxAdsInPodField; + + private bool maxAdsInPodFieldSpecified; + + private string baseAdRuleSlotTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public AdRuleSlotBehavior slotBehavior { + get { return this.slotBehaviorField; } + set { + this.slotBehaviorField = value; + this.slotBehaviorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool slotBehaviorSpecified { + get { return this.slotBehaviorFieldSpecified; } + set { this.slotBehaviorFieldSpecified = value; } + } + + public long minVideoAdDuration { + get { return this.minVideoAdDurationField; } + set { + this.minVideoAdDurationField = value; + this.minVideoAdDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minVideoAdDurationSpecified { + get { return this.minVideoAdDurationFieldSpecified; } + set { this.minVideoAdDurationFieldSpecified = value; } + } + + public long maxVideoAdDuration { + get { return this.maxVideoAdDurationField; } + set { + this.maxVideoAdDurationField = value; + this.maxVideoAdDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxVideoAdDurationSpecified { + get { return this.maxVideoAdDurationFieldSpecified; } + set { this.maxVideoAdDurationFieldSpecified = value; } + } + + public MidrollFrequencyType videoMidrollFrequencyType { + get { return this.videoMidrollFrequencyTypeField; } + set { + this.videoMidrollFrequencyTypeField = value; + this.videoMidrollFrequencyTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoMidrollFrequencyTypeSpecified { + get { return this.videoMidrollFrequencyTypeFieldSpecified; } + set { this.videoMidrollFrequencyTypeFieldSpecified = value; } + } + + public string videoMidrollFrequency { + get { return this.videoMidrollFrequencyField; } + set { this.videoMidrollFrequencyField = value; } + } + + public AdRuleSlotBumper bumper { + get { return this.bumperField; } + set { + this.bumperField = value; + this.bumperSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bumperSpecified { + get { return this.bumperFieldSpecified; } + set { this.bumperFieldSpecified = value; } + } + + public long maxBumperDuration { + get { return this.maxBumperDurationField; } + set { + this.maxBumperDurationField = value; + this.maxBumperDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxBumperDurationSpecified { + get { return this.maxBumperDurationFieldSpecified; } + set { this.maxBumperDurationFieldSpecified = value; } + } + + public long minPodDuration { + get { return this.minPodDurationField; } + set { + this.minPodDurationField = value; + this.minPodDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minPodDurationSpecified { + get { return this.minPodDurationFieldSpecified; } + set { this.minPodDurationFieldSpecified = value; } + } + + public long maxPodDuration { + get { return this.maxPodDurationField; } + set { + this.maxPodDurationField = value; + this.maxPodDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxPodDurationSpecified { + get { return this.maxPodDurationFieldSpecified; } + set { this.maxPodDurationFieldSpecified = value; } + } + + public int maxAdsInPod { + get { return this.maxAdsInPodField; } + set { + this.maxAdsInPodField = value; + this.maxAdsInPodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxAdsInPodSpecified { + get { return this.maxAdsInPodFieldSpecified; } + set { this.maxAdsInPodFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseAdRuleSlot.Type")] + public string BaseAdRuleSlotType { + get { return this.baseAdRuleSlotTypeField; } + set { this.baseAdRuleSlotTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AdRuleSlotBehavior { + ALWAYS_SHOW, + NEVER_SHOW, + DEFER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum MidrollFrequencyType { + NONE, + EVERY_N_SECONDS, + FIXED_TIME, + EVERY_N_CUEPOINTS, + FIXED_CUE_POINTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AdRuleSlotBumper { + NONE, + BEFORE, + AFTER, + BEFORE_AND_AFTER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class UnknownAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class StandardPoddingAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class OptimizedPoddingAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class NoPoddingAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RequiredNumberError : ApiError { + private RequiredNumberErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredNumberErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredNumberError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum RequiredNumberErrorReason { + REQUIRED, + TOO_LARGE, + TOO_SMALL, + TOO_LARGE_WITH_DETAILS, + TOO_SMALL_WITH_DETAILS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class PoddingError : ApiError { + private PoddingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PoddingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PoddingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum PoddingErrorReason { + INVALID_PODDING_TYPE_NONE, + INVALID_PODDING_TYPE_STANDARD, + INVALID_OPTIMIZED_POD_WITHOUT_DURATION, + INVALID_OPTIMIZED_POD_WITHOUT_ADS, + INVALID_POD_DURATION_RANGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class InventoryTargetingError : ApiError { + private InventoryTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum InventoryTargetingErrorReason { + AT_LEAST_ONE_PLACEMENT_OR_INVENTORY_UNIT_REQUIRED, + INVENTORY_CANNOT_BE_TARGETED_AND_EXCLUDED, + PARENT_CONTAINS_INVALID_MIX_OF_TARGETED_AND_EXCLUDED_AD_UNITS, + INVENTORY_EXCLUSIONS_MUST_HAVE_PARENT_INVENTORY_UNIT, + INVENTORY_UNIT_CANNOT_BE_TARGETED_IF_ANCESTOR_IS_TARGETED, + INVENTORY_UNIT_CANNOT_BE_TARGETED_IF_ANCESTOR_IS_EXCLUDED, + INVENTORY_UNIT_CANNOT_BE_EXCLUDED_IF_ANCESTOR_IS_EXCLUDED, + EXPLICITLY_TARGETED_INVENTORY_UNIT_CANNOT_BE_TARGETED, + EXPLICITLY_TARGETED_INVENTORY_UNIT_CANNOT_BE_EXCLUDED, + SELF_ONLY_INVENTORY_UNIT_NOT_ALLOWED, + SELF_ONLY_INVENTORY_UNIT_WITHOUT_DESCENDANTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CustomTargetingError : ApiError { + private CustomTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CustomTargetingErrorReason { + KEY_NOT_FOUND, + KEY_COUNT_TOO_LARGE, + KEY_NAME_DUPLICATE, + KEY_NAME_EMPTY, + KEY_NAME_INVALID_LENGTH, + KEY_NAME_INVALID_CHARS, + KEY_NAME_RESERVED, + KEY_DISPLAY_NAME_INVALID_LENGTH, + VALUE_NOT_FOUND, + GET_VALUES_BY_STATEMENT_MUST_CONTAIN_KEY_ID, + VALUE_COUNT_FOR_KEY_TOO_LARGE, + VALUE_NAME_DUPLICATE, + VALUE_NAME_EMPTY, + VALUE_NAME_INVALID_LENGTH, + VALUE_NAME_INVALID_CHARS, + VALUE_DISPLAY_NAME_INVALID_LENGTH, + VALUE_MATCH_TYPE_NOT_ALLOWED, + VALUE_MATCH_TYPE_NOT_EXACT_FOR_PREDEFINED_KEY, + KEY_WITH_MISSING_VALUES, + CANNOT_OR_DIFFERENT_KEYS, + INVALID_TARGETING_EXPRESSION, + DELETED_KEY_CANNOT_BE_USED_FOR_TARGETING, + DELETED_VALUE_CANNOT_BE_USED_FOR_TARGETING, + VIDEO_BROWSE_BY_KEY_CANNOT_BE_USED_FOR_CUSTOM_TARGETING, + CANNOT_TARGET_AUDIENCE_SEGMENT, + CANNOT_TARGET_INACTIVE_AUDIENCE_SEGMENT, + INVALID_AUDIENCE_SEGMENTS, + ONLY_APPROVED_AUDIENCE_SEGMENTS_CAN_BE_TARGETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AdRuleSlotError : ApiError { + private AdRuleSlotErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRuleSlotErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRuleSlotError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AdRuleSlotErrorReason { + DIFFERENT_STATUS_THAN_AD_RULE, + INVALID_VIDEO_AD_DURATION_RANGE, + INVALID_VIDEO_MIDROLL_FREQUENCY_TYPE, + MALFORMED_VIDEO_MIDROLL_FREQUENCY_CSV, + MALFORMED_VIDEO_MIDROLL_FREQUENCY_SINGLE_NUMBER, + INVALID_OVERLAY_AD_DURATION_RANGE, + INVALID_OVERLAY_MIDROLL_FREQUENCY_TYPE, + MALFORMED_OVERLAY_MIDROLL_FREQUENCY_CSV, + MALFORMED_OVERLAY_MIDROLL_FREQUENCY_SINGLE_NUMBER, + INVALID_BUMPER_MAX_DURATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AdRulePriorityError : ApiError { + private AdRulePriorityErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRulePriorityErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRulePriorityError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AdRulePriorityErrorReason { + DUPLICATE_PRIORITY, + PRIORITIES_NOT_SEQUENTIAL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AdRuleFrequencyCapError : ApiError { + private AdRuleFrequencyCapErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRuleFrequencyCapErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRuleFrequencyCapError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AdRuleFrequencyCapErrorReason { + NO_FREQUENCY_CAPS_SPECIFIED_WHEN_FREQUENCY_CAPS_TURNED_ON, + FREQUENCY_CAPS_SPECIFIED_WHEN_FREQUENCY_CAPS_TURNED_OFF, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AdRuleDateError : ApiError { + private AdRuleDateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRuleDateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRuleDateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AdRuleDateErrorReason { + START_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_NOT_AFTER_START_TIME, + END_DATE_TIME_TOO_LATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "WorkflowActionServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class WorkflowActionService : DfpSoapClient, IWorkflowActionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public WorkflowActionService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/WorkflowActionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual WorkflowAction getWorkflowAction(long workflowActionId) { + object[] results = this.Invoke("getWorkflowAction", new object[] { workflowActionId }); + return ((WorkflowAction) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual WorkflowActionPage getWorkflowActionsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getWorkflowActionsByStatement", new object[] { filterStatement }); + return ((WorkflowActionPage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class WorkflowActionPage { + private WorkflowAction[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public WorkflowAction[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class WorkflowAction { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private long[] userIdsField; + + private WorkflowActionType typeField; + + private bool typeFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("userIds")] + public long[] userIds { + get { return this.userIdsField; } + set { this.userIdsField = value; } + } + + public WorkflowActionType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum WorkflowActionType { + APPROVAL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "NetworkServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class NetworkService : DfpSoapClient, INetworkService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public NetworkService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/NetworkService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Network[] getAllNetworks() { + object[] results = this.Invoke("getAllNetworks", new object[0]); + return ((Network[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Network getCurrentNetwork() { + object[] results = this.Invoke("getCurrentNetwork", new object[0]); + return ((Network) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Network makeTestNetwork() { + object[] results = this.Invoke("makeTestNetwork", new object[0]); + return ((Network) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Network updateNetwork(Network network) { + object[] results = this.Invoke("updateNetwork", new object[] { network }); + return ((Network) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Network { + private long idField; + + private bool idFieldSpecified; + + private string displayNameField; + + private string networkCodeField; + + private string propertyCodeField; + + private string timeZoneField; + + private string currencyCodeField; + + private string[] secondaryCurrencyCodesField; + + private string effectiveRootAdUnitIdField; + + private long contentBrowseCustomTargetingKeyIdField; + + private bool contentBrowseCustomTargetingKeyIdFieldSpecified; + + private bool isTestField; + + private bool isTestFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public string networkCode { + get { return this.networkCodeField; } + set { this.networkCodeField = value; } + } + + public string propertyCode { + get { return this.propertyCodeField; } + set { this.propertyCodeField = value; } + } + + public string timeZone { + get { return this.timeZoneField; } + set { this.timeZoneField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryCurrencyCodes")] + public string[] secondaryCurrencyCodes { + get { return this.secondaryCurrencyCodesField; } + set { this.secondaryCurrencyCodesField = value; } + } + + public string effectiveRootAdUnitId { + get { return this.effectiveRootAdUnitIdField; } + set { this.effectiveRootAdUnitIdField = value; } + } + + public long contentBrowseCustomTargetingKeyId { + get { return this.contentBrowseCustomTargetingKeyIdField; } + set { + this.contentBrowseCustomTargetingKeyIdField = value; + this.contentBrowseCustomTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contentBrowseCustomTargetingKeyIdSpecified { + get { return this.contentBrowseCustomTargetingKeyIdFieldSpecified; } + set { this.contentBrowseCustomTargetingKeyIdFieldSpecified = value; } + } + + public bool isTest { + get { return this.isTestField; } + set { + this.isTestField = value; + this.isTestSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTestSpecified { + get { return this.isTestFieldSpecified; } + set { this.isTestFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class NetworkError : ApiError { + private NetworkErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NetworkErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NetworkError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum NetworkErrorReason { + UNKNOWN, + MULTI_CURRENCY_NOT_SUPPORTED, + UNSUPPORTED_CURRENCY, + NETWORK_CURRENCY_CANNOT_BE_SAME_AS_SECONDARY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReconciliationReportServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReconciliationReportService : DfpSoapClient, IReconciliationReportService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReconciliationReportService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/ReconciliationReportService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReport getReconciliationReport(long reconciliationReportId) { + object[] results = this.Invoke("getReconciliationReport", new object[] { reconciliationReportId }); + return ((ReconciliationReport) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReportPage getReconciliationReportsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getReconciliationReportsByStatement", new object[] { filterStatement }); + return ((ReconciliationReportPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReport updateReconciliationReport(ReconciliationReport reconciliationReport) { + object[] results = this.Invoke("updateReconciliationReport", new object[] { reconciliationReport }); + return ((ReconciliationReport) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReport[] updateReconciliationReports([System.Xml.Serialization.XmlElementAttribute("reconciliationReports")] +ReconciliationReport[] reconciliationReports) { + object[] results = this.Invoke("updateReconciliationReports", new object[] { reconciliationReports }); + return ((ReconciliationReport[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ReconciliationReportPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ReconciliationReport[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ReconciliationReport[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ReconciliationReport { + private long idField; + + private bool idFieldSpecified; + + private ReconciliationReportStatus statusField; + + private bool statusFieldSpecified; + + private Date startDateField; + + private string notesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public ReconciliationReportStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public Date startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ReconciliationReportStatus { + DRAFT, + RECONCILED, + REVERTED, + PENDING, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ReconciliationImportError : ApiError { + private ReconciliationImportErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReconciliationImportErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReconciliationImportError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ReconciliationImportErrorReason { + MISSING_EDITABLE_COLUMN, + INCONSISTENT_IMPORT_COLUMNS, + ILLEGAL_CONVERTION, + INCONSISTENT_COLUMNS_COUNT, + IMPORT_INTERNAL_ERROR, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ReconciliationError : ApiError { + private ReconciliationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReconciliationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReconciliationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ReconciliationErrorReason { + CANNOT_CREATE_RECONCILIATION_REPORT_VERSION, + INVALID_RECONCILIATION_REPORT_STATE_TRANSITION, + USER_CANNOT_RECONCILE_RECONCILIATION_REPORT, + CONTRACTED_VOLUME_CANNOT_BE_NULL, + DFP_VOLUME_CANNOT_BE_NULL, + MANUAL_VOLUME_CANNOT_BE_NULL, + THIRD_PARTY_VOLUME_CANNOT_BE_NULL, + DUPLICATE_LINE_ITEM_AND_CREATIVE, + CANNOT_RECONCILE_LINE_ITEM_CREATIVE, + LINE_ITEM_DAYS_MISMATCH, + LINE_ITEM_BILL_OFF_OF_MISMATCH, + CANNOT_MODIFY_RECONCILED_ORDER, + CANNOT_MODIFY_ACROSS_MULTIPLE_RECONCILIATION_REPORTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RangeError : ApiError { + private RangeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RangeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RangeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum RangeErrorReason { + TOO_HIGH, + TOO_LOW, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeWrapperServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeWrapperService : DfpSoapClient, ICreativeWrapperService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeWrapperService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/CreativeWrapperService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapper createCreativeWrapper(CreativeWrapper creativeWrapper) { + object[] results = this.Invoke("createCreativeWrapper", new object[] { creativeWrapper }); + return ((CreativeWrapper) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapper[] createCreativeWrappers([System.Xml.Serialization.XmlElementAttribute("creativeWrappers")] +CreativeWrapper[] creativeWrappers) { + object[] results = this.Invoke("createCreativeWrappers", new object[] { creativeWrappers }); + return ((CreativeWrapper[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapper getCreativeWrapper(long creativeWrapperId) { + object[] results = this.Invoke("getCreativeWrapper", new object[] { creativeWrapperId }); + return ((CreativeWrapper) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapperPage getCreativeWrappersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativeWrappersByStatement", new object[] { filterStatement }); + return ((CreativeWrapperPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performCreativeWrapperAction(CreativeWrapperAction creativeWrapperAction, Statement filterStatement) { + object[] results = this.Invoke("performCreativeWrapperAction", new object[] { creativeWrapperAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapper updateCreativeWrapper(CreativeWrapper creativeWrapper) { + object[] results = this.Invoke("updateCreativeWrapper", new object[] { creativeWrapper }); + return ((CreativeWrapper) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapper[] updateCreativeWrappers([System.Xml.Serialization.XmlElementAttribute("creativeWrappers")] +CreativeWrapper[] creativeWrappers) { + object[] results = this.Invoke("updateCreativeWrappers", new object[] { creativeWrappers }); + return ((CreativeWrapper[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateCreativeWrappers))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateCreativeWrappers))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class CreativeWrapperAction { + private string creativeWrapperActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CreativeWrapperAction.Type")] + public string CreativeWrapperActionType { + get { return this.creativeWrapperActionTypeField; } + set { this.creativeWrapperActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeactivateCreativeWrappers : CreativeWrapperAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ActivateCreativeWrappers : CreativeWrapperAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CreativeWrapperPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeWrapper[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeWrapper[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CreativeWrapper { + private long idField; + + private bool idFieldSpecified; + + private long labelIdField; + + private bool labelIdFieldSpecified; + + private CreativeWrapperHtmlSnippet headerField; + + private CreativeWrapperHtmlSnippet footerField; + + private CreativeWrapperOrdering orderingField; + + private bool orderingFieldSpecified; + + private CreativeWrapperStatus statusField; + + private bool statusFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + + public CreativeWrapperHtmlSnippet header { + get { return this.headerField; } + set { this.headerField = value; } + } + + public CreativeWrapperHtmlSnippet footer { + get { return this.footerField; } + set { this.footerField = value; } + } + + public CreativeWrapperOrdering ordering { + get { return this.orderingField; } + set { + this.orderingField = value; + this.orderingSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderingSpecified { + get { return this.orderingFieldSpecified; } + set { this.orderingFieldSpecified = value; } + } + + public CreativeWrapperStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CreativeWrapperHtmlSnippet { + private string htmlSnippetField; + + public string htmlSnippet { + get { return this.htmlSnippetField; } + set { this.htmlSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CreativeWrapperOrdering { + NO_PREFERENCE, + INNER, + OUTER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CreativeWrapperStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ContentServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ContentService : DfpSoapClient, IContentService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ContentService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/ContentService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContentPage getContentByStatement(Statement statement) { + object[] results = this.Invoke("getContentByStatement", new object[] { statement }); + return ((ContentPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContentPage getContentByStatementAndCustomTargetingValue(Statement filterStatement, long customTargetingValueId) { + object[] results = this.Invoke("getContentByStatementAndCustomTargetingValue", new object[] { filterStatement, customTargetingValueId }); + return ((ContentPage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CmsContent { + private long idField; + + private bool idFieldSpecified; + + private string displayNameField; + + private string cmsContentIdField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public string cmsContentId { + get { return this.cmsContentIdField; } + set { this.cmsContentIdField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Content { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private ContentStatus statusField; + + private bool statusFieldSpecified; + + private ContentStatusDefinedBy statusDefinedByField; + + private bool statusDefinedByFieldSpecified; + + private long[] userDefinedCustomTargetingValueIdsField; + + private long[] mappingRuleDefinedCustomTargetingValueIdsField; + + private CmsContent[] cmsSourcesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ContentStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ContentStatusDefinedBy statusDefinedBy { + get { return this.statusDefinedByField; } + set { + this.statusDefinedByField = value; + this.statusDefinedBySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusDefinedBySpecified { + get { return this.statusDefinedByFieldSpecified; } + set { this.statusDefinedByFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("userDefinedCustomTargetingValueIds")] + public long[] userDefinedCustomTargetingValueIds { + get { return this.userDefinedCustomTargetingValueIdsField; } + set { this.userDefinedCustomTargetingValueIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("mappingRuleDefinedCustomTargetingValueIds")] + public long[] mappingRuleDefinedCustomTargetingValueIds { + get { return this.mappingRuleDefinedCustomTargetingValueIdsField; } + set { this.mappingRuleDefinedCustomTargetingValueIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("cmsSources")] + public CmsContent[] cmsSources { + get { return this.cmsSourcesField; } + set { this.cmsSourcesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ContentStatus { + ACTIVE, + INACTIVE, + ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ContentStatusDefinedBy { + CMS, + USER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ContentPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Content[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Content[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RequiredCollectionError : ApiError { + private RequiredCollectionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredCollectionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredCollectionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum RequiredCollectionErrorReason { + REQUIRED, + TOO_LARGE, + TOO_SMALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class InvalidUrlError : ApiError { + private InvalidUrlErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidUrlErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidUrlError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum InvalidUrlErrorReason { + ILLEGAL_CHARACTERS, + INVALID_FORMAT, + INSECURE_SCHEME, + NO_SCHEME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ContentPartnerError : ApiError { + private ContentPartnerErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ContentPartnerErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ContentPartnerError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ContentPartnerErrorReason { + FEATURE_NOT_ENABLED, + INVALID_PARTNER_TYPE, + NO_PARTNER_CATCH_ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomFieldServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomFieldService : DfpSoapClient, ICustomFieldService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomFieldService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/CustomFieldService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomField createCustomField(CustomField customField) { + object[] results = this.Invoke("createCustomField", new object[] { customField }); + return ((CustomField) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldOption createCustomFieldOption(CustomFieldOption customFieldOption) { + object[] results = this.Invoke("createCustomFieldOption", new object[] { customFieldOption }); + return ((CustomFieldOption) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldOption[] createCustomFieldOptions([System.Xml.Serialization.XmlElementAttribute("customFieldOptions")] +CustomFieldOption[] customFieldOptions) { + object[] results = this.Invoke("createCustomFieldOptions", new object[] { customFieldOptions }); + return ((CustomFieldOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomField[] createCustomFields([System.Xml.Serialization.XmlElementAttribute("customFields")] +CustomField[] customFields) { + object[] results = this.Invoke("createCustomFields", new object[] { customFields }); + return ((CustomField[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomField getCustomField(long customFieldId) { + object[] results = this.Invoke("getCustomField", new object[] { customFieldId }); + return ((CustomField) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldOption getCustomFieldOption(long customFieldOptionId) { + object[] results = this.Invoke("getCustomFieldOption", new object[] { customFieldOptionId }); + return ((CustomFieldOption) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldPage getCustomFieldsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomFieldsByStatement", new object[] { filterStatement }); + return ((CustomFieldPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performCustomFieldAction(CustomFieldAction customFieldAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomFieldAction", new object[] { customFieldAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomField updateCustomField(CustomField customField) { + object[] results = this.Invoke("updateCustomField", new object[] { customField }); + return ((CustomField) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldOption updateCustomFieldOption(CustomFieldOption customFieldOption) { + object[] results = this.Invoke("updateCustomFieldOption", new object[] { customFieldOption }); + return ((CustomFieldOption) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldOption[] updateCustomFieldOptions([System.Xml.Serialization.XmlElementAttribute("customFieldOptions")] +CustomFieldOption[] customFieldOptions) { + object[] results = this.Invoke("updateCustomFieldOptions", new object[] { customFieldOptions }); + return ((CustomFieldOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomField[] updateCustomFields([System.Xml.Serialization.XmlElementAttribute("customFields")] +CustomField[] customFields) { + object[] results = this.Invoke("updateCustomFields", new object[] { customFields }); + return ((CustomField[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateCustomFields))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateCustomFields))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CustomFieldAction { + private string customFieldActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomFieldAction.Type")] + public string CustomFieldActionType { + get { return this.customFieldActionTypeField; } + set { this.customFieldActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeactivateCustomFields : CustomFieldAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ActivateCustomFields : CustomFieldAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CustomFieldPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomField[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomField[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DropDownCustomField))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CustomField { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private CustomFieldEntityType entityTypeField; + + private bool entityTypeFieldSpecified; + + private CustomFieldDataType dataTypeField; + + private bool dataTypeFieldSpecified; + + private CustomFieldVisibility visibilityField; + + private bool visibilityFieldSpecified; + + private string customFieldTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + public CustomFieldEntityType entityType { + get { return this.entityTypeField; } + set { + this.entityTypeField = value; + this.entityTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool entityTypeSpecified { + get { return this.entityTypeFieldSpecified; } + set { this.entityTypeFieldSpecified = value; } + } + + public CustomFieldDataType dataType { + get { return this.dataTypeField; } + set { + this.dataTypeField = value; + this.dataTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dataTypeSpecified { + get { return this.dataTypeFieldSpecified; } + set { this.dataTypeFieldSpecified = value; } + } + + public CustomFieldVisibility visibility { + get { return this.visibilityField; } + set { + this.visibilityField = value; + this.visibilitySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool visibilitySpecified { + get { return this.visibilityFieldSpecified; } + set { this.visibilityFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("CustomField.Type")] + public string CustomFieldType { + get { return this.customFieldTypeField; } + set { this.customFieldTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CustomFieldEntityType { + LINE_ITEM, + ORDER, + CREATIVE, + PRODUCT_TEMPLATE, + PRODUCT, + PROPOSAL, + PROPOSAL_LINE_ITEM, + USER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CustomFieldDataType { + STRING, + NUMBER, + TOGGLE, + DROP_DOWN, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CustomFieldVisibility { + API_ONLY, + READ_ONLY, + FULL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DropDownCustomField : CustomField { + private CustomFieldOption[] optionsField; + + [System.Xml.Serialization.XmlElementAttribute("options")] + public CustomFieldOption[] options { + get { return this.optionsField; } + set { this.optionsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CustomFieldOption { + private long idField; + + private bool idFieldSpecified; + + private long customFieldIdField; + + private bool customFieldIdFieldSpecified; + + private string displayNameField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long customFieldId { + get { return this.customFieldIdField; } + set { + this.customFieldIdField = value; + this.customFieldIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldIdSpecified { + get { return this.customFieldIdFieldSpecified; } + set { this.customFieldIdFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class EntityLimitReachedError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CustomFieldError : ApiError { + private CustomFieldErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomFieldErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomFieldError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CustomFieldErrorReason { + INVALID_CUSTOM_FIELD_FOR_OPTION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProposalLineItemServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProposalLineItemService : DfpSoapClient, IProposalLineItemService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProposalLineItemService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/ProposalLineItemService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItem createProposalLineItem(ProposalLineItem proposalLineItem) { + object[] results = this.Invoke("createProposalLineItem", new object[] { proposalLineItem }); + return ((ProposalLineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItem[] createProposalLineItems([System.Xml.Serialization.XmlElementAttribute("proposalLineItems")] +ProposalLineItem[] proposalLineItems) { + object[] results = this.Invoke("createProposalLineItems", new object[] { proposalLineItems }); + return ((ProposalLineItem[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItem getProposalLineItem(long proposalLineItemId) { + object[] results = this.Invoke("getProposalLineItem", new object[] { proposalLineItemId }); + return ((ProposalLineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItemPage getProposalLineItemsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getProposalLineItemsByStatement", new object[] { filterStatement }); + return ((ProposalLineItemPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performProposalLineItemAction(ProposalLineItemAction proposalLineItemAction, Statement filterStatement) { + object[] results = this.Invoke("performProposalLineItemAction", new object[] { proposalLineItemAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItem updateProposalLineItem(ProposalLineItem proposalLineItem) { + object[] results = this.Invoke("updateProposalLineItem", new object[] { proposalLineItem }); + return ((ProposalLineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItem[] updateProposalLineItems([System.Xml.Serialization.XmlElementAttribute("proposalLineItems")] +ProposalLineItem[] proposalLineItems) { + object[] results = this.Invoke("updateProposalLineItems", new object[] { proposalLineItems }); + return ((ProposalLineItem[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveProposalLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveProposalLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class ProposalLineItemAction { + private string proposalLineItemActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProposalLineItemAction.Type")] + public string ProposalLineItemActionType { + get { return this.proposalLineItemActionTypeField; } + set { this.proposalLineItemActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class UnarchiveProposalLineItems : ProposalLineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ArchiveProposalLineItems : ProposalLineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ProposalLineItemPage { + private ProposalLineItem[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ProposalLineItem[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ProposalLineItem { + private long idField; + + private bool idFieldSpecified; + + private long proposalIdField; + + private bool proposalIdFieldSpecified; + + private long rateCardIdField; + + private bool rateCardIdFieldSpecified; + + private string productIdField; + + private string nameField; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + private string notesField; + + private CostAdjustment costAdjustmentField; + + private bool costAdjustmentFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private long unitsBoughtField; + + private bool unitsBoughtFieldSpecified; + + private int unitsBoughtBufferField; + + private bool unitsBoughtBufferFieldSpecified; + + private DeliveryRateType deliveryRateTypeField; + + private bool deliveryRateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private CompanionDeliveryOption companionDeliveryOptionField; + + private bool companionDeliveryOptionFieldSpecified; + + private CreativeRotationType creativeRotationTypeField; + + private bool creativeRotationTypeFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int lineItemPriorityField; + + private bool lineItemPriorityFieldSpecified; + + private CostType costTypeField; + + private bool costTypeFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private Targeting targetingField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private ProposalLineItemPremium[] premiumsField; + + private Money baseRateField; + + private Money costPerUnitField; + + private Money costField; + + private DeliveryIndicator deliveryIndicatorField; + + private long[] deliveryDataField; + + private ComputedStatus computedStatusField; + + private bool computedStatusFieldSpecified; + + private BillingCap billingCapField; + + private bool billingCapFieldSpecified; + + private BillingSchedule billingScheduleField; + + private bool billingScheduleFieldSpecified; + + private BillingSource billingSourceField; + + private bool billingSourceFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long proposalId { + get { return this.proposalIdField; } + set { + this.proposalIdField = value; + this.proposalIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool proposalIdSpecified { + get { return this.proposalIdFieldSpecified; } + set { this.proposalIdFieldSpecified = value; } + } + + public long rateCardId { + get { return this.rateCardIdField; } + set { + this.rateCardIdField = value; + this.rateCardIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardIdSpecified { + get { return this.rateCardIdFieldSpecified; } + set { this.rateCardIdFieldSpecified = value; } + } + + public string productId { + get { return this.productIdField; } + set { this.productIdField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public CostAdjustment costAdjustment { + get { return this.costAdjustmentField; } + set { + this.costAdjustmentField = value; + this.costAdjustmentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool costAdjustmentSpecified { + get { return this.costAdjustmentFieldSpecified; } + set { this.costAdjustmentFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public long unitsBought { + get { return this.unitsBoughtField; } + set { + this.unitsBoughtField = value; + this.unitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitsBoughtSpecified { + get { return this.unitsBoughtFieldSpecified; } + set { this.unitsBoughtFieldSpecified = value; } + } + + public int unitsBoughtBuffer { + get { return this.unitsBoughtBufferField; } + set { + this.unitsBoughtBufferField = value; + this.unitsBoughtBufferSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitsBoughtBufferSpecified { + get { return this.unitsBoughtBufferFieldSpecified; } + set { this.unitsBoughtBufferFieldSpecified = value; } + } + + public DeliveryRateType deliveryRateType { + get { return this.deliveryRateTypeField; } + set { + this.deliveryRateTypeField = value; + this.deliveryRateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryRateTypeSpecified { + get { return this.deliveryRateTypeFieldSpecified; } + set { this.deliveryRateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + public CompanionDeliveryOption companionDeliveryOption { + get { return this.companionDeliveryOptionField; } + set { + this.companionDeliveryOptionField = value; + this.companionDeliveryOptionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companionDeliveryOptionSpecified { + get { return this.companionDeliveryOptionFieldSpecified; } + set { this.companionDeliveryOptionFieldSpecified = value; } + } + + public CreativeRotationType creativeRotationType { + get { return this.creativeRotationTypeField; } + set { + this.creativeRotationTypeField = value; + this.creativeRotationTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeRotationTypeSpecified { + get { return this.creativeRotationTypeFieldSpecified; } + set { this.creativeRotationTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int lineItemPriority { + get { return this.lineItemPriorityField; } + set { + this.lineItemPriorityField = value; + this.lineItemPrioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemPrioritySpecified { + get { return this.lineItemPriorityFieldSpecified; } + set { this.lineItemPriorityFieldSpecified = value; } + } + + public CostType costType { + get { return this.costTypeField; } + set { + this.costTypeField = value; + this.costTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool costTypeSpecified { + get { return this.costTypeFieldSpecified; } + set { this.costTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public Targeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("premiums")] + public ProposalLineItemPremium[] premiums { + get { return this.premiumsField; } + set { this.premiumsField = value; } + } + + public Money baseRate { + get { return this.baseRateField; } + set { this.baseRateField = value; } + } + + public Money costPerUnit { + get { return this.costPerUnitField; } + set { this.costPerUnitField = value; } + } + + public Money cost { + get { return this.costField; } + set { this.costField = value; } + } + + public DeliveryIndicator deliveryIndicator { + get { return this.deliveryIndicatorField; } + set { this.deliveryIndicatorField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("units", IsNullable = false)] + public long[] deliveryData { + get { return this.deliveryDataField; } + set { this.deliveryDataField = value; } + } + + public ComputedStatus computedStatus { + get { return this.computedStatusField; } + set { + this.computedStatusField = value; + this.computedStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool computedStatusSpecified { + get { return this.computedStatusFieldSpecified; } + set { this.computedStatusFieldSpecified = value; } + } + + public BillingCap billingCap { + get { return this.billingCapField; } + set { + this.billingCapField = value; + this.billingCapSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingCapSpecified { + get { return this.billingCapFieldSpecified; } + set { this.billingCapFieldSpecified = value; } + } + + public BillingSchedule billingSchedule { + get { return this.billingScheduleField; } + set { + this.billingScheduleField = value; + this.billingScheduleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingScheduleSpecified { + get { return this.billingScheduleFieldSpecified; } + set { this.billingScheduleFieldSpecified = value; } + } + + public BillingSource billingSource { + get { return this.billingSourceField; } + set { + this.billingSourceField = value; + this.billingSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingSourceSpecified { + get { return this.billingSourceFieldSpecified; } + set { this.billingSourceFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CostAdjustment { + NONE, + MAKE_GOOD, + BARTER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum DeliveryRateType { + EVENLY, + FRONTLOADED, + AS_FAST_AS_POSSIBLE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum RoadblockingType { + ONLY_ONE, + ONE_OR_MORE, + AS_MANY_AS_POSSIBLE, + ALL_ROADBLOCK, + CREATIVE_SET + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CompanionDeliveryOption { + OPTIONAL, + AT_LEAST_ONE, + ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CreativeRotationType { + EVEN, + OPTIMIZED, + MANUAL, + SEQUENTIAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class FrequencyCap { + private int maxImpressionsField; + + private bool maxImpressionsFieldSpecified; + + private int numTimeUnitsField; + + private bool numTimeUnitsFieldSpecified; + + private TimeUnit timeUnitField; + + private bool timeUnitFieldSpecified; + + public int maxImpressions { + get { return this.maxImpressionsField; } + set { + this.maxImpressionsField = value; + this.maxImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxImpressionsSpecified { + get { return this.maxImpressionsFieldSpecified; } + set { this.maxImpressionsFieldSpecified = value; } + } + + public int numTimeUnits { + get { return this.numTimeUnitsField; } + set { + this.numTimeUnitsField = value; + this.numTimeUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numTimeUnitsSpecified { + get { return this.numTimeUnitsFieldSpecified; } + set { this.numTimeUnitsFieldSpecified = value; } + } + + public TimeUnit timeUnit { + get { return this.timeUnitField; } + set { + this.timeUnitField = value; + this.timeUnitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool timeUnitSpecified { + get { return this.timeUnitFieldSpecified; } + set { this.timeUnitFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum TimeUnit { + MINUTE, + HOUR, + DAY, + WEEK, + MONTH, + LIFETIME, + POD, + STREAM + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum LineItemType { + SPONSORSHIP, + STANDARD, + NETWORK, + BULK, + PRICE_PRIORITY, + HOUSE, + LEGACY_DFP, + CLICK_TRACKING, + ADSENSE, + AD_EXCHANGE, + BUMPER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CostType { + CPC, + CPD, + CPM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CreativePlaceholder { + private Size sizeField; + + private CreativePlaceholder[] companionsField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private long idField; + + private bool idFieldSpecified; + + private int expectedCreativeCountField; + + private bool expectedCreativeCountFieldSpecified; + + private CreativeSizeType creativeSizeTypeField; + + private bool creativeSizeTypeFieldSpecified; + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companions")] + public CreativePlaceholder[] companions { + get { return this.companionsField; } + set { this.companionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public int expectedCreativeCount { + get { return this.expectedCreativeCountField; } + set { + this.expectedCreativeCountField = value; + this.expectedCreativeCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expectedCreativeCountSpecified { + get { return this.expectedCreativeCountFieldSpecified; } + set { this.expectedCreativeCountFieldSpecified = value; } + } + + public CreativeSizeType creativeSizeType { + get { return this.creativeSizeTypeField; } + set { + this.creativeSizeTypeField = value; + this.creativeSizeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeSizeTypeSpecified { + get { return this.creativeSizeTypeFieldSpecified; } + set { this.creativeSizeTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CreativeSizeType { + PIXEL, + ASPECT_RATIO, + INTERSTITIAL + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DropDownCustomFieldValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class BaseCustomFieldValue { + private long customFieldIdField; + + private bool customFieldIdFieldSpecified; + + private string baseCustomFieldValueTypeField; + + public long customFieldId { + get { return this.customFieldIdField; } + set { + this.customFieldIdField = value; + this.customFieldIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldIdSpecified { + get { return this.customFieldIdFieldSpecified; } + set { this.customFieldIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseCustomFieldValue.Type")] + public string BaseCustomFieldValueType { + get { return this.baseCustomFieldValueTypeField; } + set { this.baseCustomFieldValueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DropDownCustomFieldValue : BaseCustomFieldValue { + private long customFieldOptionIdField; + + private bool customFieldOptionIdFieldSpecified; + + public long customFieldOptionId { + get { return this.customFieldOptionIdField; } + set { + this.customFieldOptionIdField = value; + this.customFieldOptionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldOptionIdSpecified { + get { return this.customFieldOptionIdFieldSpecified; } + set { this.customFieldOptionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CustomFieldValue : BaseCustomFieldValue { + private Value valueField; + + public Value value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ProposalLineItemPremium { + private long rateCardCustomizationIdField; + + private bool rateCardCustomizationIdFieldSpecified; + + private ProposalLineItemPremiumStatus statusField; + + private bool statusFieldSpecified; + + public long rateCardCustomizationId { + get { return this.rateCardCustomizationIdField; } + set { + this.rateCardCustomizationIdField = value; + this.rateCardCustomizationIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardCustomizationIdSpecified { + get { return this.rateCardCustomizationIdFieldSpecified; } + set { this.rateCardCustomizationIdFieldSpecified = value; } + } + + public ProposalLineItemPremiumStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ProposalLineItemPremiumStatus { + INCLUDED, + EXCLUDED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Money { + private string currencyCodeField; + + private long microAmountField; + + private bool microAmountFieldSpecified; + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public long microAmount { + get { return this.microAmountField; } + set { + this.microAmountField = value; + this.microAmountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool microAmountSpecified { + get { return this.microAmountFieldSpecified; } + set { this.microAmountFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeliveryIndicator { + private double expectedDeliveryPercentageField; + + private bool expectedDeliveryPercentageFieldSpecified; + + private double actualDeliveryPercentageField; + + private bool actualDeliveryPercentageFieldSpecified; + + public double expectedDeliveryPercentage { + get { return this.expectedDeliveryPercentageField; } + set { + this.expectedDeliveryPercentageField = value; + this.expectedDeliveryPercentageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expectedDeliveryPercentageSpecified { + get { return this.expectedDeliveryPercentageFieldSpecified; } + set { this.expectedDeliveryPercentageFieldSpecified = value; } + } + + public double actualDeliveryPercentage { + get { return this.actualDeliveryPercentageField; } + set { + this.actualDeliveryPercentageField = value; + this.actualDeliveryPercentageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool actualDeliveryPercentageSpecified { + get { return this.actualDeliveryPercentageFieldSpecified; } + set { this.actualDeliveryPercentageFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ComputedStatus { + DELIVERY_EXTENDED, + DELIVERING, + READY, + PAUSED, + NEEDS_CREATIVES, + PAUSED_INVENTORY_RELEASED, + PENDING_APPROVAL, + COMPLETED, + DISAPPROVED, + DRAFT, + CANCELED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum BillingCap { + NO_CAP, + CAPPED_CUMULATIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum BillingSchedule { + PRORATED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum BillingSource { + CONTRACTED, + DFP_VOLUME, + THIRD_PARTY_VOLUME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class UserDomainTargetingError : ApiError { + private UserDomainTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public UserDomainTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "UserDomainTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum UserDomainTargetingErrorReason { + INVALID_DOMAIN_NAMES, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class TechnologyTargetingError : ApiError { + private TechnologyTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TechnologyTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TechnologyTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum TechnologyTargetingErrorReason { + MOBILE_LINE_ITEM_CONTAINS_WEB_TECH_CRITERIA, + WEB_LINE_ITEM_CONTAINS_MOBILE_TECH_CRITERIA, + MOBILE_CARRIER_TARGETING_FEATURE_NOT_ENABLED, + DEVICE_CAPABILITY_TARGETING_FEATURE_NOT_ENABLED, + DEVICE_CATEGORY_TARGETING_FEATURE_NOT_ENABLED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ReservationDetailsError : ApiError { + private ReservationDetailsErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReservationDetailsErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReservationDetailsError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ReservationDetailsErrorReason { + UNLIMITED_UNITS_BOUGHT_NOT_ALLOWED, + UNLIMITED_END_DATE_TIME_NOT_ALLOWED, + PERCENTAGE_UNITS_BOUGHT_TOO_HIGH, + DURATION_NOT_ALLOWED, + UNIT_TYPE_NOT_ALLOWED, + COST_TYPE_NOT_ALLOWED, + COST_TYPE_UNIT_TYPE_MISMATCH_NOT_ALLOWED, + LINE_ITEM_TYPE_NOT_ALLOWED, + NETWORK_REMNANT_ORDER_CANNOT_UPDATE_LINEITEM_TYPE, + BACKFILL_WEBPROPERTY_CODE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ProposalLineItemError : ApiError { + private ProposalLineItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProposalLineItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProposalLineItemError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ProposalLineItemErrorReason { + NOT_SAME_RATE_CARD, + LINE_ITEM_TYPE_NOT_ALLOWED, + END_DATE_TIME_NOT_AFTER_START_TIME, + END_DATE_TIME_TOO_LATE, + START_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_IS_IN_PAST, + FRONTLOADED_NOT_ALLOWED, + ALL_ROADBLOCK_NOT_ALLOWED, + CREATIVE_SET_ROADBLOCK_NOT_ALLOWED, + ALREADY_STARTED, + CONFLICT_WITH_PRODUCT, + MOBILE_TECH_CRITERIA_NOT_SUPPORTED, + UNSUPPORTED_TARGETING_TYPE, + WRONG_COST, + INVALID_PRIORITY_FOR_LINE_ITEM_TYPE, + UPDATE_PROPOSAL_LINE_ITEM_NOT_ALLOWED, + CANNOT_UPDATE_TO_OR_FROM_CREATIVE_SET_ROADBLOCK, + SEQUENTIAL_CREATIVE_ROTATION_NOT_ALLOWED, + UPDATE_RESERVATION_NOT_ALLOWED, + INVALID_COMPANION_DELIVERY_OPTION_FOR_ROADBLOCKING_TYPE, + INCONSISTENT_ROADBLOCK_TYPE, + INVALID_UNITS_BOUGHT_BUFFER, + UPDATE_COST_ADJUSTMENT_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ProposalLineItemActionError : ApiError { + private ProposalLineItemActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProposalLineItemActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProposalLineItemActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ProposalLineItemActionErrorReason { + NOT_APPLICABLE, + PROPOSAL_NOT_EDITABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ProposalError : ApiError { + private ProposalErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProposalErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProposalError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ProposalErrorReason { + AD_SERVER_UNKNOWN_ERROR, + AD_SERVER_API_ERROR, + UPDATE_ADVERTISER_NOT_ALLOWED, + UPDATE_PROPOSAL_NOT_ALLOWED, + INVALID_CONTACT, + DUPLICATED_CONTACT, + UNACCEPTABLE_COMPANY_CREDIT_STATUS, + PRIMARY_AGENCY_REQUIRED, + PRIMARY_AGENCY_NOT_UNIQUE, + DUPLICATED_COMPANY_ASSOCIATION, + DUPLICATED_SALESPERSON, + DUPLICATED_SALES_PLANNER, + DUPLICATED_TRAFFICKER, + HAS_NO_UNARCHIVED_PROPOSAL_LINEITEMS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ProductError : ApiError { + private ProductErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProductErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ProductErrorReason { + TEMPLATE_NOT_FOUND, + MALFORMED_PRODUCT_ID, + BAD_PRODUCT_ID_FEATURE, + BAD_PRODUCT_TEMPLATE_ID, + CANNOT_UPDATE_ARCHIVED_PRODUCT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class PrecisionError : ApiError { + private PrecisionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PrecisionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PrecisionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum PrecisionErrorReason { + WRONG_PRECISION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class GeoTargetingError : ApiError { + private GeoTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public GeoTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GeoTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum GeoTargetingErrorReason { + TARGETED_LOCATIONS_NOT_EXCLUDABLE, + EXCLUDED_LOCATIONS_CANNOT_HAVE_CHILDREN_TARGETED, + POSTAL_CODES_CANNOT_BE_EXCLUDED, + UNTARGETABLE_LOCATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class GenericTargetingError : ApiError { + private GenericTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public GenericTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GenericTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum GenericTargetingErrorReason { + CONFLICTING_INCLUSION_OR_EXCLUSION_OF_SIBLINGS, + INCLUDING_DESCENDANTS_OF_EXCLUDED_CRITERIA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class FrequencyCapError : ApiError { + private FrequencyCapErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FrequencyCapErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FrequencyCapError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum FrequencyCapErrorReason { + IMPRESSION_LIMIT_EXCEEDED, + IMPRESSIONS_TOO_LOW, + RANGE_LIMIT_EXCEEDED, + RANGE_TOO_LOW, + DUPLICATE_TIME_RANGE, + TOO_MANY_FREQUENCY_CAPS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DayPartTargetingError : ApiError { + private DayPartTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DayPartTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DayPartTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum DayPartTargetingErrorReason { + INVALID_HOUR, + INVALID_MINUTE, + END_TIME_NOT_AFTER_START_TIME, + TIME_PERIODS_OVERLAP, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CustomFieldValueError : ApiError { + private CustomFieldValueErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomFieldValueErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomFieldValueError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CustomFieldValueErrorReason { + CUSTOM_FIELD_NOT_FOUND, + CUSTOM_FIELD_INACTIVE, + CUSTOM_FIELD_OPTION_NOT_FOUND, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class BillingError : ApiError { + private BillingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BillingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BillingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum BillingErrorReason { + UNSUPPORTED_BILLING_SCHEDULE, + UNSUPPORTED_BILLING_CAP, + MISSING_BILLING_SOURCE, + MISSING_BILLING_SCHEDULE, + MISSING_BILLING_CAP, + INVALID_BILLING_SOURCE_FOR_OFFLINE, + UPDATE_BILLING_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReportServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReportService : DfpSoapClient, IReportService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReportService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/ReportService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual string getReportDownloadURL(long reportJobId, ExportFormat exportFormat) { + object[] results = this.Invoke("getReportDownloadURL", new object[] { reportJobId, exportFormat }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual string getReportDownloadUrlWithOptions(long reportJobId, ReportDownloadOptions reportDownloadOptions) { + object[] results = this.Invoke("getReportDownloadUrlWithOptions", new object[] { reportJobId, reportDownloadOptions }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReportJob getReportJob(long reportJobId) { + object[] results = this.Invoke("getReportJob", new object[] { reportJobId }); + return ((ReportJob) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReportJob runReportJob(ReportJob reportJob) { + object[] results = this.Invoke("runReportJob", new object[] { reportJob }); + return ((ReportJob) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ReportQuery { + private Dimension[] dimensionsField; + + private ReportQueryAdUnitView adUnitViewField; + + private bool adUnitViewFieldSpecified; + + private Column[] columnsField; + + private DimensionAttribute[] dimensionAttributesField; + + private long[] customFieldIdsField; + + private Date startDateField; + + private Date endDateField; + + private DateRangeType dateRangeTypeField; + + private bool dateRangeTypeFieldSpecified; + + private DimensionFilter[] dimensionFiltersField; + + private Statement statementField; + + private string timeZoneField; + + [System.Xml.Serialization.XmlElementAttribute("dimensions")] + public Dimension[] dimensions { + get { return this.dimensionsField; } + set { this.dimensionsField = value; } + } + + public ReportQueryAdUnitView adUnitView { + get { return this.adUnitViewField; } + set { + this.adUnitViewField = value; + this.adUnitViewSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adUnitViewSpecified { + get { return this.adUnitViewFieldSpecified; } + set { this.adUnitViewFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("columns")] + public Column[] columns { + get { return this.columnsField; } + set { this.columnsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("dimensionAttributes")] + public DimensionAttribute[] dimensionAttributes { + get { return this.dimensionAttributesField; } + set { this.dimensionAttributesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldIds")] + public long[] customFieldIds { + get { return this.customFieldIdsField; } + set { this.customFieldIdsField = value; } + } + + public Date startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public Date endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + public DateRangeType dateRangeType { + get { return this.dateRangeTypeField; } + set { + this.dateRangeTypeField = value; + this.dateRangeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dateRangeTypeSpecified { + get { return this.dateRangeTypeFieldSpecified; } + set { this.dateRangeTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("dimensionFilters")] + public DimensionFilter[] dimensionFilters { + get { return this.dimensionFiltersField; } + set { this.dimensionFiltersField = value; } + } + + public Statement statement { + get { return this.statementField; } + set { this.statementField = value; } + } + + public string timeZone { + get { return this.timeZoneField; } + set { this.timeZoneField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum Dimension { + MONTH, + WEEK, + DATE, + DAY, + HOUR, + LINE_ITEM_ID, + LINE_ITEM_NAME, + LINE_ITEM_TYPE, + ORDER_ID, + ORDER_NAME, + ADVERTISER_ID, + ADVERTISER_NAME, + SALESPERSON_ID, + SALESPERSON_NAME, + CREATIVE_ID, + CREATIVE_NAME, + CREATIVE_TYPE, + CREATIVE_SIZE, + AD_UNIT_ID, + AD_UNIT_NAME, + PLACEMENT_ID, + PLACEMENT_NAME, + GENERIC_CRITERION_NAME, + COUNTRY_CRITERIA_ID, + COUNTRY_NAME, + REGION_CRITERIA_ID, + REGION_NAME, + CITY_CRITERIA_ID, + CITY_NAME, + METRO_CRITERIA_ID, + METRO_NAME, + POSTAL_CODE_CRITERIA_ID, + POSTAL_CODE, + CUSTOM_TARGETING_VALUE_ID, + CUSTOM_CRITERIA, + ACTIVITY_ID, + ACTIVITY_NAME, + ACTIVITY_GROUP_ID, + ACTIVITY_GROUP_NAME, + CONTENT_ID, + CONTENT_NAME, + AD_REQUEST_AD_UNIT_SIZES, + AD_REQUEST_CUSTOM_CRITERIA, + MASTER_COMPANION_CREATIVE_ID, + MASTER_COMPANION_CREATIVE_NAME, + DISTRIBUTION_PARTNER_ID, + DISTRIBUTION_PARTNER_NAME, + CONTENT_PARTNER_ID, + CONTENT_PARTNER_NAME, + RIGHTS_HOLDER_ID, + RIGHTS_HOLDER_NAME, + PROPOSAL_LINE_ITEM_ID, + PROPOSAL_LINE_ITEM_NAME, + PROPOSAL_ID, + PROPOSAL_NAME, + PROPOSAL_ADVERTISER_ID, + PROPOSAL_ADVERTISER_NAME, + PROPOSAL_AGENCY_ID, + PROPOSAL_AGENCY_NAME, + PRODUCT_ID, + PRODUCT_NAME, + PRODUCT_TEMPLATE_ID, + PRODUCT_TEMPLATE_NAME, + AUDIENCE_SEGMENT_ID, + AUDIENCE_SEGMENT_NAME + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportQuery.AdUnitView", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ReportQueryAdUnitView { + TOP_LEVEL, + FLAT, + HIERARCHICAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum Column { + AD_SERVER_IMPRESSIONS, + AD_SERVER_CLICKS, + AD_SERVER_CTR, + AD_SERVER_CPM_AND_CPC_REVENUE, + AD_SERVER_CPD_REVENUE, + AD_SERVER_ALL_REVENUE, + AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM, + AD_SERVER_WITH_CPD_AVERAGE_ECPM, + AD_SERVER_INVENTORY_LEVEL_PERCENT_IMPRESSIONS, + AD_SERVER_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + AD_SERVER_INVENTORY_LEVEL_PERCENT_CLICKS, + AD_SERVER_LINE_ITEM_LEVEL_PERCENT_CLICKS, + AD_SERVER_INVENTORY_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + AD_SERVER_INVENTORY_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_SERVER_LINE_ITEM_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + AD_SERVER_LINE_ITEM_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_SERVER_DELIVERY_INDICATOR, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + ADSENSE_LINE_ITEM_LEVEL_IMPRESSIONS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + ADSENSE_LINE_ITEM_LEVEL_CLICKS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CTR, + ADSENSE_LINE_ITEM_LEVEL_CTR, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_REVENUE, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_AVERAGE_ECPM, + ADSENSE_LINE_ITEM_LEVEL_AVERAGE_ECPM, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_PERCENT_IMPRESSIONS, + ADSENSE_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_PERCENT_CLICKS, + ADSENSE_LINE_ITEM_LEVEL_PERCENT_CLICKS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_WITH_CPD_PERCENT_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_IMPRESSIONS, + AD_EXCHANGE_LINE_ITEM_LEVEL_CLICKS, + AD_EXCHANGE_LINE_ITEM_LEVEL_CTR, + AD_EXCHANGE_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + AD_EXCHANGE_LINE_ITEM_LEVEL_PERCENT_CLICKS, + AD_EXCHANGE_LINE_ITEM_LEVEL_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_AVERAGE_ECPM, + TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + TOTAL_LINE_ITEM_LEVEL_IMPRESSIONS, + TOTAL_INVENTORY_LEVEL_CLICKS, + TOTAL_LINE_ITEM_LEVEL_CLICKS, + TOTAL_INVENTORY_LEVEL_CTR, + TOTAL_LINE_ITEM_LEVEL_CTR, + TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE, + TOTAL_INVENTORY_LEVEL_ALL_REVENUE, + TOTAL_LINE_ITEM_LEVEL_CPM_AND_CPC_REVENUE, + TOTAL_LINE_ITEM_LEVEL_ALL_REVENUE, + TOTAL_INVENTORY_LEVEL_WITHOUT_CPD_AVERAGE_ECPM, + TOTAL_INVENTORY_LEVEL_WITH_CPD_AVERAGE_ECPM, + TOTAL_LINE_ITEM_LEVEL_WITHOUT_CPD_AVERAGE_ECPM, + TOTAL_LINE_ITEM_LEVEL_WITH_CPD_AVERAGE_ECPM, + TOTAL_INVENTORY_LEVEL_UNFILLED_IMPRESSIONS, + MERGED_AD_SERVER_DELIVERY_INDICATOR, + MERGED_AD_SERVER_IMPRESSIONS, + MERGED_AD_SERVER_CLICKS, + MERGED_AD_SERVER_CTR, + MERGED_AD_SERVER_CPM_AND_CPC_REVENUE, + MERGED_AD_SERVER_ALL_REVENUE, + MERGED_AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM, + MERGED_AD_SERVER_WITH_CPD_AVERAGE_ECPM, + OPTIMIZATION_CONTROL_IMPRESSIONS, + OPTIMIZATION_CONTROL_CLICKS, + OPTIMIZATION_CONTROL_CTR, + OPTIMIZATION_OPTIMIZED_IMPRESSIONS, + OPTIMIZATION_OPTIMIZED_CLICKS, + OPTIMIZATION_NON_OPTIMIZED_IMPRESSIONS, + OPTIMIZATION_NON_OPTIMIZED_CLICKS, + OPTIMIZATION_EXTRA_CLICKS, + OPTIMIZATION_OPTIMIZED_CTR, + OPTIMIZATION_LIFT, + OPTIMIZATION_COVERAGE, + OPTIMIZATION_BEHIND_SCHEDULE_IMPRESSIONS, + OPTIMIZATION_NO_CLICKS_RECORDED_IMPRESSIONS, + OPTIMIZATION_SPONSORSHIP_IMPRESSIONS, + OPTIMIZATION_AS_FAST_AS_POSSIBLE_IMPRESSIONS, + OPTIMIZATION_NO_ABSOLUTE_LIFETIME_GOAL_IMPRESSIONS, + OPTIMIZATION_CONTROL_REVENUE, + OPTIMIZATION_OPTIMIZED_REVENUE, + OPTIMIZATION_CONTROL_ECPM, + OPTIMIZATION_OPTIMIZED_ECPM, + OPTIMIZATION_FREED_UP_IMPRESSIONS, + OPTIMIZATION_ECPM_LIFT, + REACH_FREQUENCY, + REACH_AVERAGE_REVENUE, + REACH, + SELL_THROUGH_FORECASTED_IMPRESSIONS, + SELL_THROUGH_AVAILABLE_IMPRESSIONS, + SELL_THROUGH_RESERVED_IMPRESSIONS, + SELL_THROUGH_SELL_THROUGH_RATE, + RICH_MEDIA_BACKUP_IMAGES, + RICH_MEDIA_DISPLAY_TIME, + RICH_MEDIA_AVERAGE_DISPLAY_TIME, + RICH_MEDIA_EXPANSIONS, + RICH_MEDIA_EXPANDING_TIME, + RICH_MEDIA_INTERACTION_TIME, + RICH_MEDIA_INTERACTION_COUNT, + RICH_MEDIA_INTERACTION_RATE, + RICH_MEDIA_AVERAGE_INTERACTION_TIME, + RICH_MEDIA_INTERACTION_IMPRESSIONS, + RICH_MEDIA_MANUAL_CLOSES, + RICH_MEDIA_FULL_SCREEN_IMPRESSIONS, + RICH_MEDIA_VIDEO_INTERACTIONS, + RICH_MEDIA_VIDEO_INTERACTION_RATE, + RICH_MEDIA_VIDEO_MUTES, + RICH_MEDIA_VIDEO_PAUSES, + RICH_MEDIA_VIDEO_PLAYES, + RICH_MEDIA_VIDEO_MIDPOINTS, + RICH_MEDIA_VIDEO_COMPLETES, + RICH_MEDIA_VIDEO_REPLAYS, + RICH_MEDIA_VIDEO_STOPS, + RICH_MEDIA_VIDEO_UNMUTES, + RICH_MEDIA_VIDEO_VIEW_TIME, + RICH_MEDIA_VIDEO_VIEW_RATE, + RICH_MEDIA_CUSTOM_CONVERSION_TIME_VALUE, + RICH_MEDIA_CUSTOM_CONVERSION_COUNT_VALUE, + VIDEO_INTERACTION_START, + VIDEO_INTERACTION_FIRST_QUARTILE, + VIDEO_INTERACTION_MIDPOINT, + VIDEO_INTERACTION_THIRD_QUARTILE, + VIDEO_INTERACTION_COMPLETE, + VIDEO_INTERACTION_VIEW_RATE, + VIDEO_INTERACTION_AVERAGE_VIEW_RATE, + VIDEO_INTERACTION_COMPLETION_RATE, + VIDEO_INTERACTION_ERROR_COUNT, + VIDEO_INTERACTION_VIDEO_LENGTH, + VIDEO_INTERACTION_PAUSE, + VIDEO_INTERACTION_RESUME, + VIDEO_INTERACTION_REWIND, + VIDEO_INTERACTION_MUTE, + VIDEO_INTERACTION_UNMUTE, + VIDEO_INTERACTION_COLLAPSE, + VIDEO_INTERACTION_EXPAND, + VIDEO_INTERACTION_FULL_SCREEN, + VIDEO_INTERACTION_AVERAGE_INTERACTION_RATE, + VIDEO_INTERACTION_VIDEO_SKIPS, + VIDEO_INTERACTION_VIDEO_SKIP_SHOWN, + VIDEO_INTERACTION_ENGAGED_VIEW, + VIDEO_INTERACTION_VIEW_THROUGH_RATE, + DISTRIBUTION_PARTNER_IMPRESSIONS, + DISTRIBUTION_PARTNER_CLICKS, + DISTRIBUTION_PARTNER_CTR, + DISTRIBUTION_PARTNER_GROSS_REVENUE, + DISTRIBUTION_PARTNER_HOST_REVENUE, + DISTRIBUTION_PARTNER_HOST_ECPM, + DISTRIBUTION_PARTNER_PARTNER_REVENUE, + DISTRIBUTION_PARTNER_PARTNER_ECPM, + CONTENT_PARTNER_IMPRESSIONS, + CONTENT_PARTNER_CLICKS, + CONTENT_PARTNER_CTR, + CONTENT_PARTNER_GROSS_REVENUE, + CONTENT_PARTNER_HOST_REVENUE, + CONTENT_PARTNER_HOST_ECPM, + CONTENT_PARTNER_PARTNER_REVENUE, + CONTENT_PARTNER_PARTNER_ECPM, + RIGHTS_HOLDER_IMPRESSIONS, + RIGHTS_HOLDER_CLICKS, + RIGHTS_HOLDER_CTR, + RIGHTS_HOLDER_GROSS_REVENUE, + RIGHTS_HOLDER_HOST_REVENUE, + RIGHTS_HOLDER_HOST_ECPM, + RIGHTS_HOLDER_PARTNER_REVENUE, + RIGHTS_HOLDER_PARTNER_ECPM, + VIEW_THROUGH_CONVERSIONS, + CONVERSIONS_PER_THOUSAND_IMPRESSIONS, + CLICK_THROUGH_CONVERSIONS, + CONVERSIONS_PER_CLICK, + VIEW_THROUGH_REVENUE, + CLICK_THROUGH_REVENUE, + TOTAL_CONVERSIONS, + TOTAL_CONVERSION_REVENUE, + SALES_DFP_REVENUE, + SALES_FORECASTED_NET_REVENUE, + SALES_CONTRACTED_NET_REVENUE, + SALES_CONTRACTED_PLACEMENT_NET_REVENUE, + SALES_CONTRACTED_IMPRESSIONS, + SALES_CONTRACTED_CLICKS, + SALES_CONTRACTED_VOLUME, + SALES_BUDGET, + SALES_REMAINING_BUDGET, + SALES_UNIFIED_NET_REVENUE, + SALES_PIPELINE_NET_REVENUE, + BILLING_AND_RECONCILIATION_LAST_DATE_TIME, + BILLING_AND_RECONCILIATION_RECONCILIATION_STATUS, + BILLING_AND_RECONCILIATION_DFP_VOLUME, + BILLING_AND_RECONCILIATION_THIRD_PARTY_VOLUME, + BILLING_AND_RECONCILIATION_RECONCILED_VOLUME, + BILLING_AND_RECONCILIATION_BILLABLE_NET_REVENUE, + SALES_ADDITIONAL_ADJUSTMENT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum DimensionAttribute { + LINE_ITEM_LABELS, + LINE_ITEM_LABEL_IDS, + LINE_ITEM_OPTIMIZABLE, + LINE_ITEM_DELIVERY_PACING, + LINE_ITEM_FREQUENCY_CAP, + ADVERTISER_EXTERNAL_ID, + ORDER_START_DATE_TIME, + ORDER_END_DATE_TIME, + ORDER_EXTERNAL_ID, + ORDER_PO_NUMBER, + ORDER_AGENCY, + ORDER_AGENCY_ID, + ORDER_LABELS, + ORDER_LABEL_IDS, + ORDER_TRAFFICKER, + ORDER_SECONDARY_TRAFFICKERS, + ORDER_SALESPERSON, + ORDER_SECONDARY_SALESPEOPLE, + ORDER_LIFETIME_IMPRESSIONS, + ORDER_LIFETIME_CLICKS, + ORDER_LIFETIME_MERGED_IMPRESSIONS, + ORDER_LIFETIME_MERGED_CLICKS, + ORDER_BOOKED_CPM, + ORDER_BOOKED_CPC, + LINE_ITEM_START_DATE_TIME, + LINE_ITEM_END_DATE_TIME, + LINE_ITEM_EXTERNAL_ID, + LINE_ITEM_COST_TYPE, + LINE_ITEM_COST_PER_UNIT, + LINE_ITEM_CURRENCY_CODE, + LINE_ITEM_GOAL_QUANTITY, + LINE_ITEM_SPONSORSHIP_GOAL_PERCENTAGE, + LINE_ITEM_LIFETIME_IMPRESSIONS, + LINE_ITEM_LIFETIME_CLICKS, + LINE_ITEM_LIFETIME_MERGED_IMPRESSIONS, + LINE_ITEM_LIFETIME_MERGED_CLICKS, + LINE_ITEM_PRIORITY, + CREATIVE_OR_CREATIVE_SET, + MASTER_COMPANION_TYPE, + LINE_ITEM_CONTRACTED_QUANTITY, + LINE_ITEM_DISCOUNT, + LINE_ITEM_NON_CPD_BOOKED_REVENUE, + ADVERTISER_LABELS, + ADVERTISER_LABEL_IDS, + CREATIVE_CLICK_THROUGH_URL, + LINE_ITEM_CREATIVE_START_DATE, + LINE_ITEM_CREATIVE_END_DATE, + PROPOSAL_START_DATE_TIME, + PROPOSAL_END_DATE_TIME, + PROPOSAL_CREATION_DATE_TIME, + PROPOSAL_PROBABILITY_TO_CLOSE, + PROPOSAL_STATUS, + PROPOSAL_CURRENCY, + PROPOSAL_AGENCY_COMMISSION_RATE, + PROPOSAL_VAT_RATE, + PROPOSAL_BILLING_SOURCE, + PROPOSAL_BILLING_CAP, + PROPOSAL_BILLING_SCHEDULE, + PROPOSAL_LINE_ITEM_START_DATE_TIME, + PROPOSAL_LINE_ITEM_END_DATE_TIME, + PROPOSAL_LINE_ITEM_RATE_TYPE, + PROPOSAL_LINE_ITEM_COST_PER_UNIT, + PROPOSAL_LINE_ITEM_PRODUCT_TYPE, + AD_UNIT_CODE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum DateRangeType { + TODAY, + YESTERDAY, + LAST_WEEK, + LAST_MONTH, + REACH_LIFETIME, + CUSTOM_DATE, + NEXT_DAY, + NEXT_90_DAYS, + NEXT_WEEK, + NEXT_MONTH, + CURRENT_AND_NEXT_MONTH, + NEXT_QUARTER, + NEXT_3_MONTHS, + NEXT_12_MONTHS + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum DimensionFilter { + ADVERTISERS, + ACTIVE_ADVERTISERS, + HOUSE_ADVERTISERS, + NON_HOUSE_ADVERTISERS, + ALL_SALESPEOPLE, + WHOLE_NETWORK, + CURRENT_USER_ORDERS, + STARTED_ORDERS, + COMPLETED_ORDERS, + MOBILE_LINE_ITEMS, + WEB_LINE_ITEMS, + ACTIVE_AD_UNITS, + INACTIVE_AD_UNITS, + MOBILE_INVENTORY_UNITS, + WEB_INVENTORY_UNITS, + ARCHIVED_AD_UNITS, + ACTIVE_PLACEMENTS, + INACTIVE_PLACEMENTS, + ARCHIVED_PLACEMENTS, + OPTIMIZABLE_ORDERS, + PARTNER_STATS_TYPE_ESTIMATED, + PARTNER_STATS_TYPE_RECONCILED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ReportJob { + private long idField; + + private bool idFieldSpecified; + + private ReportQuery reportQueryField; + + private ReportJobStatus reportJobStatusField; + + private bool reportJobStatusFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public ReportQuery reportQuery { + get { return this.reportQueryField; } + set { this.reportQueryField = value; } + } + + public ReportJobStatus reportJobStatus { + get { return this.reportJobStatusField; } + set { + this.reportJobStatusField = value; + this.reportJobStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reportJobStatusSpecified { + get { return this.reportJobStatusFieldSpecified; } + set { this.reportJobStatusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ReportJobStatus { + COMPLETED, + IN_PROGRESS, + FAILED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ReportDownloadOptions { + private ExportFormat exportFormatField; + + private bool exportFormatFieldSpecified; + + private bool includeReportPropertiesField; + + private bool includeReportPropertiesFieldSpecified; + + private bool includeTotalsRowField; + + private bool includeTotalsRowFieldSpecified; + + private bool useGzipCompressionField; + + private bool useGzipCompressionFieldSpecified; + + public ExportFormat exportFormat { + get { return this.exportFormatField; } + set { + this.exportFormatField = value; + this.exportFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool exportFormatSpecified { + get { return this.exportFormatFieldSpecified; } + set { this.exportFormatFieldSpecified = value; } + } + + public bool includeReportProperties { + get { return this.includeReportPropertiesField; } + set { + this.includeReportPropertiesField = value; + this.includeReportPropertiesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeReportPropertiesSpecified { + get { return this.includeReportPropertiesFieldSpecified; } + set { this.includeReportPropertiesFieldSpecified = value; } + } + + public bool includeTotalsRow { + get { return this.includeTotalsRowField; } + set { + this.includeTotalsRowField = value; + this.includeTotalsRowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeTotalsRowSpecified { + get { return this.includeTotalsRowFieldSpecified; } + set { this.includeTotalsRowFieldSpecified = value; } + } + + public bool useGzipCompression { + get { return this.useGzipCompressionField; } + set { + this.useGzipCompressionField = value; + this.useGzipCompressionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool useGzipCompressionSpecified { + get { return this.useGzipCompressionFieldSpecified; } + set { this.useGzipCompressionFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ExportFormat { + TSV, + CSV_EXCEL, + CSV_DUMP, + XML, + XLS, + XLSX + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ReportError : ApiError { + private ReportErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReportErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ReportErrorReason { + DEFAULT, + REPORT_ACCESS_NOT_ALLOWED, + DIMENSION_VIEW_NOT_ALLOWED, + DIMENSION_COMBINATION_NOT_ALLOWED, + ATTRIBUTE_VIEW_NOT_ALLOWED, + COLUMN_VIEW_NOT_ALLOWED, + TOO_MANY_CONCURRENT_REPORTS, + REPORT_TOO_BIG, + INVALID_OPERATION_FOR_REPORT_STATE, + INVALID_DIMENSIONS, + INVALID_ATTRIBUTES, + INVALID_COLUMNS, + INVALID_DIMENSION_FILTERS, + INVALID_DATE, + END_DATE_TIME_NOT_AFTER_START_TIME, + NOT_NULL, + ATTRIBUTES_NOT_SUPPORTED_FOR_REQUEST, + COLUMNS_NOT_SUPPORTED_FOR_REQUESTED_DIMENSIONS, + FAILED_TO_STORE_REPORT, + REPORT_NOT_FOUND, + SR_CANNOT_RUN_REPORT_IN_ANOTHER_NETWORK, + INVALID_TIME_ZONE_FOR_FEATURE_NOT_ENABLED, + INVALID_TIME_ZONE_FOR_ID, + UNSUPPORTED_TIME_ZONE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ActivityGroupServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ActivityGroupService : DfpSoapClient, IActivityGroupService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ActivityGroupService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/ActivityGroupService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroup createActivityGroup(ActivityGroup activityGroup) { + object[] results = this.Invoke("createActivityGroup", new object[] { activityGroup }); + return ((ActivityGroup) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroup[] createActivityGroups([System.Xml.Serialization.XmlElementAttribute("activityGroups")] +ActivityGroup[] activityGroups) { + object[] results = this.Invoke("createActivityGroups", new object[] { activityGroups }); + return ((ActivityGroup[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroup getActivityGroup(int activityGroupId) { + object[] results = this.Invoke("getActivityGroup", new object[] { activityGroupId }); + return ((ActivityGroup) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroupPage getActivityGroupsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getActivityGroupsByStatement", new object[] { filterStatement }); + return ((ActivityGroupPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroup updateActivityGroup(ActivityGroup activityGroup) { + object[] results = this.Invoke("updateActivityGroup", new object[] { activityGroup }); + return ((ActivityGroup) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroup[] updateActivityGroups([System.Xml.Serialization.XmlElementAttribute("activityGroups")] +ActivityGroup[] activityGroups) { + object[] results = this.Invoke("updateActivityGroups", new object[] { activityGroups }); + return ((ActivityGroup[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ActivityGroupPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ActivityGroup[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ActivityGroup[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ActivityGroup { + private int idField; + + private bool idFieldSpecified; + + private string nameField; + + private long[] companyIdsField; + + private int impressionsLookbackField; + + private bool impressionsLookbackFieldSpecified; + + private int clicksLookbackField; + + private bool clicksLookbackFieldSpecified; + + private ActivityGroupStatus statusField; + + private bool statusFieldSpecified; + + public int id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companyIds")] + public long[] companyIds { + get { return this.companyIdsField; } + set { this.companyIdsField = value; } + } + + public int impressionsLookback { + get { return this.impressionsLookbackField; } + set { + this.impressionsLookbackField = value; + this.impressionsLookbackSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsLookbackSpecified { + get { return this.impressionsLookbackFieldSpecified; } + set { this.impressionsLookbackFieldSpecified = value; } + } + + public int clicksLookback { + get { return this.clicksLookbackField; } + set { + this.clicksLookbackField = value; + this.clicksLookbackSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clicksLookbackSpecified { + get { return this.clicksLookbackFieldSpecified; } + set { this.clicksLookbackFieldSpecified = value; } + } + + public ActivityGroupStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ActivityGroup.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ActivityGroupStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ActivityError : ApiError { + private ActivityErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ActivityErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ActivityError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ActivityErrorReason { + ACTIVITIES_FEATURE_REQUIRED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LineItemServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LineItemService : DfpSoapClient, ILineItemService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LineItemService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/LineItemService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItem createLineItem(LineItem lineItem) { + object[] results = this.Invoke("createLineItem", new object[] { lineItem }); + return ((LineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItem[] createLineItems([System.Xml.Serialization.XmlElementAttribute("lineItems")] +LineItem[] lineItems) { + object[] results = this.Invoke("createLineItems", new object[] { lineItems }); + return ((LineItem[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItem getLineItem(long lineItemId) { + object[] results = this.Invoke("getLineItem", new object[] { lineItemId }); + return ((LineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemPage getLineItemsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLineItemsByStatement", new object[] { filterStatement }); + return ((LineItemPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performLineItemAction(LineItemAction lineItemAction, Statement filterStatement) { + object[] results = this.Invoke("performLineItemAction", new object[] { lineItemAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItem updateLineItem(LineItem lineItem) { + object[] results = this.Invoke("updateLineItem", new object[] { lineItem }); + return ((LineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItem[] updateLineItems([System.Xml.Serialization.XmlElementAttribute("lineItems")] +LineItem[] lineItems) { + object[] results = this.Invoke("updateLineItems", new object[] { lineItems }); + return ((LineItem[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveAndOverbookLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReleaseLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PauseLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class LineItemAction { + private string lineItemActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LineItemAction.Type")] + public string LineItemActionType { + get { return this.lineItemActionTypeField; } + set { this.lineItemActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class UnarchiveLineItems : LineItemAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ResumeLineItems : LineItemAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ResumeAndOverbookLineItems : ResumeLineItems { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveAndOverbookLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ReserveLineItems : LineItemAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ReserveAndOverbookLineItems : ReserveLineItems { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ReleaseLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class PauseLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeleteLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ArchiveLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ActivateLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class LineItemPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LineItem[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LineItem[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class LineItem : LineItemSummary { + private Targeting targetingField; + + public Targeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItem))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class LineItemSummary { + private long orderIdField; + + private bool orderIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string externalIdField; + + private string orderNameField; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private int autoExtensionDaysField; + + private bool autoExtensionDaysFieldSpecified; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private CreativeRotationType creativeRotationTypeField; + + private bool creativeRotationTypeFieldSpecified; + + private DeliveryRateType deliveryRateTypeField; + + private bool deliveryRateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int priorityField; + + private bool priorityFieldSpecified; + + private UnitType unitTypeField; + + private bool unitTypeFieldSpecified; + + private LineItemSummaryDuration durationField; + + private bool durationFieldSpecified; + + private long unitsBoughtField; + + private bool unitsBoughtFieldSpecified; + + private Money costPerUnitField; + + private Money valueCostPerUnitField; + + private CostType costTypeField; + + private bool costTypeFieldSpecified; + + private LineItemDiscountType discountTypeField; + + private bool discountTypeFieldSpecified; + + private double discountField; + + private bool discountFieldSpecified; + + private long contractedUnitsBoughtField; + + private bool contractedUnitsBoughtFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private EnvironmentType environmentTypeField; + + private bool environmentTypeFieldSpecified; + + private CompanionDeliveryOption companionDeliveryOptionField; + + private bool companionDeliveryOptionFieldSpecified; + + private CreativePersistenceType creativePersistenceTypeField; + + private bool creativePersistenceTypeFieldSpecified; + + private bool allowOverbookField; + + private bool allowOverbookFieldSpecified; + + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + private bool reserveAtCreationField; + + private bool reserveAtCreationFieldSpecified; + + private Stats statsField; + + private DeliveryIndicator deliveryIndicatorField; + + private long[] deliveryDataField; + + private Money budgetField; + + private ComputedStatus statusField; + + private bool statusFieldSpecified; + + private LineItemSummaryReservationStatus reservationStatusField; + + private bool reservationStatusFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private string webPropertyCodeField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private bool disableSameAdvertiserCompetitiveExclusionField; + + private bool disableSameAdvertiserCompetitiveExclusionFieldSpecified; + + private string lastModifiedByAppField; + + private string notesField; + + private DateTime lastModifiedDateTimeField; + + private DateTime creationDateTimeField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private bool isMissingCreativesField; + + private bool isMissingCreativesFieldSpecified; + + private string lineItemSummaryTypeField; + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string externalId { + get { return this.externalIdField; } + set { this.externalIdField = value; } + } + + public string orderName { + get { return this.orderNameField; } + set { this.orderNameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public int autoExtensionDays { + get { return this.autoExtensionDaysField; } + set { + this.autoExtensionDaysField = value; + this.autoExtensionDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool autoExtensionDaysSpecified { + get { return this.autoExtensionDaysFieldSpecified; } + set { this.autoExtensionDaysFieldSpecified = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public CreativeRotationType creativeRotationType { + get { return this.creativeRotationTypeField; } + set { + this.creativeRotationTypeField = value; + this.creativeRotationTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeRotationTypeSpecified { + get { return this.creativeRotationTypeFieldSpecified; } + set { this.creativeRotationTypeFieldSpecified = value; } + } + + public DeliveryRateType deliveryRateType { + get { return this.deliveryRateTypeField; } + set { + this.deliveryRateTypeField = value; + this.deliveryRateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryRateTypeSpecified { + get { return this.deliveryRateTypeFieldSpecified; } + set { this.deliveryRateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + public UnitType unitType { + get { return this.unitTypeField; } + set { + this.unitTypeField = value; + this.unitTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitTypeSpecified { + get { return this.unitTypeFieldSpecified; } + set { this.unitTypeFieldSpecified = value; } + } + + public LineItemSummaryDuration duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public long unitsBought { + get { return this.unitsBoughtField; } + set { + this.unitsBoughtField = value; + this.unitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitsBoughtSpecified { + get { return this.unitsBoughtFieldSpecified; } + set { this.unitsBoughtFieldSpecified = value; } + } + + public Money costPerUnit { + get { return this.costPerUnitField; } + set { this.costPerUnitField = value; } + } + + public Money valueCostPerUnit { + get { return this.valueCostPerUnitField; } + set { this.valueCostPerUnitField = value; } + } + + public CostType costType { + get { return this.costTypeField; } + set { + this.costTypeField = value; + this.costTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool costTypeSpecified { + get { return this.costTypeFieldSpecified; } + set { this.costTypeFieldSpecified = value; } + } + + public LineItemDiscountType discountType { + get { return this.discountTypeField; } + set { + this.discountTypeField = value; + this.discountTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool discountTypeSpecified { + get { return this.discountTypeFieldSpecified; } + set { this.discountTypeFieldSpecified = value; } + } + + public double discount { + get { return this.discountField; } + set { + this.discountField = value; + this.discountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool discountSpecified { + get { return this.discountFieldSpecified; } + set { this.discountFieldSpecified = value; } + } + + public long contractedUnitsBought { + get { return this.contractedUnitsBoughtField; } + set { + this.contractedUnitsBoughtField = value; + this.contractedUnitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contractedUnitsBoughtSpecified { + get { return this.contractedUnitsBoughtFieldSpecified; } + set { this.contractedUnitsBoughtFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + public EnvironmentType environmentType { + get { return this.environmentTypeField; } + set { + this.environmentTypeField = value; + this.environmentTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool environmentTypeSpecified { + get { return this.environmentTypeFieldSpecified; } + set { this.environmentTypeFieldSpecified = value; } + } + + public CompanionDeliveryOption companionDeliveryOption { + get { return this.companionDeliveryOptionField; } + set { + this.companionDeliveryOptionField = value; + this.companionDeliveryOptionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companionDeliveryOptionSpecified { + get { return this.companionDeliveryOptionFieldSpecified; } + set { this.companionDeliveryOptionFieldSpecified = value; } + } + + public CreativePersistenceType creativePersistenceType { + get { return this.creativePersistenceTypeField; } + set { + this.creativePersistenceTypeField = value; + this.creativePersistenceTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativePersistenceTypeSpecified { + get { return this.creativePersistenceTypeFieldSpecified; } + set { this.creativePersistenceTypeFieldSpecified = value; } + } + + public bool allowOverbook { + get { return this.allowOverbookField; } + set { + this.allowOverbookField = value; + this.allowOverbookSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowOverbookSpecified { + get { return this.allowOverbookFieldSpecified; } + set { this.allowOverbookFieldSpecified = value; } + } + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + + public bool reserveAtCreation { + get { return this.reserveAtCreationField; } + set { + this.reserveAtCreationField = value; + this.reserveAtCreationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reserveAtCreationSpecified { + get { return this.reserveAtCreationFieldSpecified; } + set { this.reserveAtCreationFieldSpecified = value; } + } + + public Stats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public DeliveryIndicator deliveryIndicator { + get { return this.deliveryIndicatorField; } + set { this.deliveryIndicatorField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("units", IsNullable = false)] + public long[] deliveryData { + get { return this.deliveryDataField; } + set { this.deliveryDataField = value; } + } + + public Money budget { + get { return this.budgetField; } + set { this.budgetField = value; } + } + + public ComputedStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public LineItemSummaryReservationStatus reservationStatus { + get { return this.reservationStatusField; } + set { + this.reservationStatusField = value; + this.reservationStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reservationStatusSpecified { + get { return this.reservationStatusFieldSpecified; } + set { this.reservationStatusFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public string webPropertyCode { + get { return this.webPropertyCodeField; } + set { this.webPropertyCodeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public bool disableSameAdvertiserCompetitiveExclusion { + get { return this.disableSameAdvertiserCompetitiveExclusionField; } + set { + this.disableSameAdvertiserCompetitiveExclusionField = value; + this.disableSameAdvertiserCompetitiveExclusionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool disableSameAdvertiserCompetitiveExclusionSpecified { + get { return this.disableSameAdvertiserCompetitiveExclusionFieldSpecified; } + set { this.disableSameAdvertiserCompetitiveExclusionFieldSpecified = value; } + } + + public string lastModifiedByApp { + get { return this.lastModifiedByAppField; } + set { this.lastModifiedByAppField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public DateTime creationDateTime { + get { return this.creationDateTimeField; } + set { this.creationDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + public bool isMissingCreatives { + get { return this.isMissingCreativesField; } + set { + this.isMissingCreativesField = value; + this.isMissingCreativesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isMissingCreativesSpecified { + get { return this.isMissingCreativesFieldSpecified; } + set { this.isMissingCreativesFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("LineItemSummary.Type")] + public string LineItemSummaryType { + get { return this.lineItemSummaryTypeField; } + set { this.lineItemSummaryTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum UnitType { + IMPRESSIONS, + CLICKS + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemSummary.Duration", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum LineItemSummaryDuration { + NONE, + LIFETIME, + DAILY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum LineItemDiscountType { + ABSOLUTE_VALUE, + PERCENTAGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CreativePersistenceType { + NOT_PERSISTENT, + PERSISTENT_AND_EXCLUDE_NONE, + PERSISTENT_AND_EXCLUDE_DISPLAY, + PERSISTENT_AND_EXCLUDE_VIDEO, + PERSISTENT_AND_EXCLUDE_ALL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Stats { + private long impressionsDeliveredField; + + private bool impressionsDeliveredFieldSpecified; + + private long clicksDeliveredField; + + private bool clicksDeliveredFieldSpecified; + + public long impressionsDelivered { + get { return this.impressionsDeliveredField; } + set { + this.impressionsDeliveredField = value; + this.impressionsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsDeliveredSpecified { + get { return this.impressionsDeliveredFieldSpecified; } + set { this.impressionsDeliveredFieldSpecified = value; } + } + + public long clicksDelivered { + get { return this.clicksDeliveredField; } + set { + this.clicksDeliveredField = value; + this.clicksDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clicksDeliveredSpecified { + get { return this.clicksDeliveredFieldSpecified; } + set { this.clicksDeliveredFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemSummary.ReservationStatus", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum LineItemSummaryReservationStatus { + RESERVED, + UNRESERVED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RequiredSizeError : ApiError { + private RequiredSizeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredSizeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredSizeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum RequiredSizeErrorReason { + REQUIRED, + NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class OrderError : ApiError { + private OrderErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OrderErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OrderError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum OrderErrorReason { + UPDATE_CANCELED_ORDER_NOT_ALLOWED, + UPDATE_PENDING_APPROVAL_ORDER_NOT_ALLOWED, + UPDATE_ARCHIVED_ORDER_NOT_ALLOWED, + CANNOT_MODIFY_PROPOSAL_ID, + PRIMARY_USER_REQUIRED, + PRIMARY_USER_CANNOT_BE_SECONDARY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class LineItemOperationError : ApiError { + private LineItemOperationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemOperationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemOperationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum LineItemOperationErrorReason { + NOT_ALLOWED, + NOT_APPLICABLE, + HAS_COMPLETED, + HAS_NO_ACTIVE_CREATIVES, + CANNOT_ACTIVATE_LEGACY_DFP_LINE_ITEM, + CANNOT_DELETE_DELIVERED_LINE_ITEM, + CANNOT_RESERVE_COMPANY_CREDIT_STATUS_NOT_ACTIVE, + CANNOT_ACTIVATE_INVALID_COMPANY_CREDIT_STATUS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class LineItemFlightDateError : ApiError { + private LineItemFlightDateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemFlightDateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemFlightDateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum LineItemFlightDateErrorReason { + START_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_NOT_AFTER_START_TIME, + END_DATE_TIME_TOO_LATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class LineItemError : ApiError { + private LineItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum LineItemErrorReason { + ALREADY_STARTED, + UPDATE_RESERVATION_NOT_ALLOWED, + ALL_ROADBLOCK_NOT_ALLOWED, + CREATIVE_SET_ROADBLOCK_NOT_ALLOWED, + FRACTIONAL_PERCENTAGE_NOT_ALLOWED, + DISCOUNT_NOT_ALLOWED, + UPDATE_CANCELED_LINE_ITEM_NOT_ALLOWED, + UPDATE_PENDING_APPROVAL_LINE_ITEM_NOT_ALLOWED, + UPDATE_ARCHIVED_LINE_ITEM_NOT_ALLOWED, + FRONTLOADED_NOT_ALLOWED, + CREATE_OR_UPDATE_LEGACY_DFP_LINE_ITEM_TYPE_NOT_ALLOWED, + COPY_LINE_ITEM_FROM_DIFFERENT_COMPANY_NOT_ALLOWED, + INVALID_SIZE_FOR_PLATFORM, + INVALID_LINE_ITEM_TYPE_FOR_PLATFORM, + INVALID_WEB_PROPERTY_FOR_PLATFORM, + INVALID_WEB_PROPERTY_FOR_ENVIRONMENT, + AFMA_BACKFILL_NOT_ALLOWED, + UPDATE_ENVIRONMENT_TYPE_NOT_ALLOWED, + COMPANIONS_NOT_ALLOWED, + ROADBLOCKS_WITH_NONROADBLOCKS_NOT_ALLOWED, + CANNOT_UPDATE_TO_OR_FROM_CREATIVE_SET_ROADBLOCK, + UPDATE_FROM_BACKFILL_LINE_ITEM_TYPE_NOT_ALLOWED, + UPDATE_TO_BACKFILL_LINE_ITEM_TYPE_NOT_ALLOWED, + UPDATE_BACKFILL_WEB_PROPERTY_NOT_ALLOWED, + INVALID_COMPANION_DELIVERY_OPTION_FOR_ENVIRONMENT_TYPE, + COMPANION_BACKFILL_REQUIRES_VIDEO, + COMPANION_DELIVERY_OPTION_REQUIRE_PREMIUM, + DUPLICATE_MASTER_SIZES, + INVALID_PRIORITY_FOR_LINE_ITEM_TYPE, + INVALID_ENVIRONMENT_TYPE, + INVALID_ENVIRONMENT_TYPE_FOR_PLATFORM, + INVALID_TYPE_FOR_AUTO_EXTENSION, + INVALID_TYPE_FOR_CONTRACTED_UNITS_BOUGHT, + VIDEO_INVALID_ROADBLOCKING, + BACKFILL_TYPE_NOT_ALLOWED, + COMPANION_DELIVERY_OPTIONS_NOT_ALLOWED_WITH_BACKFILL, + INVALID_WEB_PROPERTY_FOR_ADX_BACKFILL, + INVALID_SIZE_FOR_ENVIRONMENT, + TARGET_PLATOFRM_NOT_ALLOWED, + INVALID_LINE_ITEM_CURRENCY, + LINE_ITEM_CANNOT_HAVE_MULTIPLE_CURRENCIES, + CANNOT_CHANGE_CURRENCY, + INVALID_FOR_OFFLINE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class LineItemCreativeAssociationError : ApiError { + private LineItemCreativeAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemCreativeAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum LineItemCreativeAssociationErrorReason { + CREATIVE_IN_WRONG_ADVERTISERS_LIBRARY, + INVALID_LINEITEM_CREATIVE_PAIRING, + STARTDATE_BEFORE_LINEITEM_STARTDATE, + STARTDATE_NOT_BEFORE_LINEITEM_ENDDATE, + ENDDATE_AFTER_LINEITEM_ENDDATE, + ENDDATE_NOT_AFTER_LINEITEM_STARTDATE, + ENDDATE_NOT_AFTER_STARTDATE, + ENDDATE_IN_THE_PAST, + CANNOT_COPY_WITHIN_SAME_LINE_ITEM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ForecastError : ApiError { + private ForecastErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ForecastErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ForecastError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ForecastErrorReason { + SERVER_NOT_AVAILABLE, + INTERNAL_ERROR, + NO_FORECAST_YET, + NOT_ENOUGH_INVENTORY, + SUCCESS, + ZERO_LENGTH_RESERVATION, + EXCEEDED_QUOTA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DateTimeRangeTargetingError : ApiError { + private DateTimeRangeTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DateTimeRangeTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DateTimeRangeTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum DateTimeRangeTargetingErrorReason { + EMPTY_RANGES, + NOT_SPONSORSHIP_LINEITEM, + PAST_RANGES_CHANGED, + RANGES_OVERLAP, + RANGES_OUT_OF_LINEITEM_ACTIVE_PERIOD, + START_TIME_IS_NOT_START_OF_DAY, + END_TIME_IS_NOT_END_OF_DAY, + START_DATE_TIME_IS_IN_PAST, + RANGE_END_TIME_BEFORE_START_TIME, + END_DATE_TIME_IS_TOO_LATE, + LIMITED_RANGES_IN_UNLIMITED_LINEITEM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CreativeError : ApiError { + private CreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CreativeErrorReason { + FLASH_AND_FALLBACK_URL_ARE_SAME, + INVALID_INTERNAL_REDIRECT_URL, + DESTINATION_URL_REQUIRED, + CANNOT_CREATE_OR_UPDATE_LEGACY_DFP_CREATIVE, + CANNOT_CREATE_OR_UPDATE_LEGACY_DFP_MOBILE_CREATIVE, + MISSING_FEATURE, + INVALID_COMPANY_TYPE, + INVALID_ADSENSE_CREATIVE_SIZE, + INVALID_AD_EXCHANGE_CREATIVE_SIZE, + DUPLICATE_ASSET_IN_CREATIVE, + CREATIVE_ASSET_CANNOT_HAVE_ID_AND_BYTE_ARRAY, + CANNOT_CREATE_OR_UPDATE_UNSUPPORTED_CREATIVE, + CANNOT_COPY_VIDEO_CREATIVE_ACROSS_ADVERTISERS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ClickTrackingLineItemError : ApiError { + private ClickTrackingLineItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ClickTrackingLineItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ClickTrackingLineItemError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ClickTrackingLineItemErrorReason { + TYPE_IMMUTABLE, + INVALID_TARGETING_TYPE, + INVALID_ROADBLOCKING_TYPE, + INVALID_CREATIVEROTATION_TYPE, + INVALID_DELIVERY_RATE_TYPE, + UNSUPPORTED_FIELD, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AudienceExtensionError : ApiError { + private AudienceExtensionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AudienceExtensionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceExtensionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AudienceExtensionErrorReason { + FREQUENCY_CAPS_NOT_SUPPORTED, + INVALID_TARGETING, + INVENTORY_UNIT_TARGETING_INVALID, + INVALID_CREATIVE_ROTATION, + INVALID_EXTERNAL_ENTITY_ID, + INVALID_LINE_ITEM_TYPE, + INVALID_MAX_BID, + AUDIENCE_EXTENSION_BULK_UPDATE_NOT_ALLOWED, + UNEXPECTED_AUDIENCE_EXTENSION_ERROR, + MAX_DAILY_BUDGET_AMOUNT_EXCEEDED, + EXTERNAL_CAMPAIGN_ALREADY_EXISTS, + AUDIENCE_EXTENSION_WITHOUT_FEATURE, + AUDIENCE_EXTENSION_WITHOUT_LINKED_ACCOUNT, + CANNOT_OVERRIDE_CREATIVE_SIZE_WITH_AUDIENCE_EXTENSION, + CANNOT_OVERRIDE_FIELD_WITH_AUDIENCE_EXTENSION, + ONLY_ONE_CREATIVE_PLACEHOLDER_ALLOWED, + MULTIPLE_AUDIENCE_EXTENSION_LINE_ITEMS_ON_ORDER, + CANNOT_COPY_AUDIENCE_EXTENSION_LINE_ITEMS_AND_CREATIVES_TOGETHER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LineItemTemplateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LineItemTemplateService : DfpSoapClient, ILineItemTemplateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LineItemTemplateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/LineItemTemplateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemTemplatePage getLineItemTemplatesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLineItemTemplatesByStatement", new object[] { filterStatement }); + return ((LineItemTemplatePage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class LineItemTemplate { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private bool isDefaultField; + + private bool isDefaultFieldSpecified; + + private string lineItemNameField; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private bool enabledForSameAdvertiserExceptionField; + + private bool enabledForSameAdvertiserExceptionFieldSpecified; + + private string notesField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private DateTime startTimeField; + + private DateTime endTimeField; + + private DeliveryRateType deliveryRateTypeField; + + private bool deliveryRateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private CreativeRotationType creativeRotationTypeField; + + private bool creativeRotationTypeFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public bool isDefault { + get { return this.isDefaultField; } + set { + this.isDefaultField = value; + this.isDefaultSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isDefaultSpecified { + get { return this.isDefaultFieldSpecified; } + set { this.isDefaultFieldSpecified = value; } + } + + public string lineItemName { + get { return this.lineItemNameField; } + set { this.lineItemNameField = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + public bool enabledForSameAdvertiserException { + get { return this.enabledForSameAdvertiserExceptionField; } + set { + this.enabledForSameAdvertiserExceptionField = value; + this.enabledForSameAdvertiserExceptionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool enabledForSameAdvertiserExceptionSpecified { + get { return this.enabledForSameAdvertiserExceptionFieldSpecified; } + set { this.enabledForSameAdvertiserExceptionFieldSpecified = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public DateTime startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public DateTime endTime { + get { return this.endTimeField; } + set { this.endTimeField = value; } + } + + public DeliveryRateType deliveryRateType { + get { return this.deliveryRateTypeField; } + set { + this.deliveryRateTypeField = value; + this.deliveryRateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryRateTypeSpecified { + get { return this.deliveryRateTypeFieldSpecified; } + set { this.deliveryRateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + public CreativeRotationType creativeRotationType { + get { return this.creativeRotationTypeField; } + set { + this.creativeRotationTypeField = value; + this.creativeRotationTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeRotationTypeSpecified { + get { return this.creativeRotationTypeFieldSpecified; } + set { this.creativeRotationTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class LineItemTemplatePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LineItemTemplate[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LineItemTemplate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "UserTeamAssociationServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserRecordTeamAssociation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class UserTeamAssociationService : DfpSoapClient, IUserTeamAssociationService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public UserTeamAssociationService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/UserTeamAssociationService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociation createUserTeamAssociation(UserTeamAssociation userTeamAssociation) { + object[] results = this.Invoke("createUserTeamAssociation", new object[] { userTeamAssociation }); + return ((UserTeamAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociation[] createUserTeamAssociations([System.Xml.Serialization.XmlElementAttribute("userTeamAssociations")] +UserTeamAssociation[] userTeamAssociations) { + object[] results = this.Invoke("createUserTeamAssociations", new object[] { userTeamAssociations }); + return ((UserTeamAssociation[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociation getUserTeamAssociation(long teamId, long userId) { + object[] results = this.Invoke("getUserTeamAssociation", new object[] { teamId, userId }); + return ((UserTeamAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociationPage getUserTeamAssociationsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getUserTeamAssociationsByStatement", new object[] { filterStatement }); + return ((UserTeamAssociationPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performUserTeamAssociationAction(UserTeamAssociationAction userTeamAssociationAction, Statement statement) { + object[] results = this.Invoke("performUserTeamAssociationAction", new object[] { userTeamAssociationAction, statement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociation updateUserTeamAssociation(UserTeamAssociation userTeamAssociation) { + object[] results = this.Invoke("updateUserTeamAssociation", new object[] { userTeamAssociation }); + return ((UserTeamAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociation[] updateUserTeamAssociations([System.Xml.Serialization.XmlElementAttribute("userTeamAssociations")] +UserTeamAssociation[] userTeamAssociations) { + object[] results = this.Invoke("updateUserTeamAssociations", new object[] { userTeamAssociations }); + return ((UserTeamAssociation[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteUserTeamAssociations))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class UserTeamAssociationAction { + private string userTeamAssociationActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("UserTeamAssociationAction.Type")] + public string UserTeamAssociationActionType { + get { return this.userTeamAssociationActionTypeField; } + set { this.userTeamAssociationActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeleteUserTeamAssociations : UserTeamAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class UserTeamAssociationPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private UserTeamAssociation[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public UserTeamAssociation[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class UserTeamAssociation : UserRecordTeamAssociation { + private long userIdField; + + private bool userIdFieldSpecified; + + public long userId { + get { return this.userIdField; } + set { + this.userIdField = value; + this.userIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userIdSpecified { + get { return this.userIdFieldSpecified; } + set { this.userIdFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserTeamAssociation))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class UserRecordTeamAssociation { + private long teamIdField; + + private bool teamIdFieldSpecified; + + private TeamAccessType overriddenTeamAccessTypeField; + + private bool overriddenTeamAccessTypeFieldSpecified; + + private TeamAccessType defaultTeamAccessTypeField; + + private bool defaultTeamAccessTypeFieldSpecified; + + private string userRecordTeamAssociationTypeField; + + public long teamId { + get { return this.teamIdField; } + set { + this.teamIdField = value; + this.teamIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool teamIdSpecified { + get { return this.teamIdFieldSpecified; } + set { this.teamIdFieldSpecified = value; } + } + + public TeamAccessType overriddenTeamAccessType { + get { return this.overriddenTeamAccessTypeField; } + set { + this.overriddenTeamAccessTypeField = value; + this.overriddenTeamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overriddenTeamAccessTypeSpecified { + get { return this.overriddenTeamAccessTypeFieldSpecified; } + set { this.overriddenTeamAccessTypeFieldSpecified = value; } + } + + public TeamAccessType defaultTeamAccessType { + get { return this.defaultTeamAccessTypeField; } + set { + this.defaultTeamAccessTypeField = value; + this.defaultTeamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool defaultTeamAccessTypeSpecified { + get { return this.defaultTeamAccessTypeFieldSpecified; } + set { this.defaultTeamAccessTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("UserRecordTeamAssociation.Type")] + public string UserRecordTeamAssociationType { + get { return this.userRecordTeamAssociationTypeField; } + set { this.userRecordTeamAssociationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum TeamAccessType { + NONE, + READ_ONLY, + READ_WRITE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LineItemCreativeAssociationServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LineItemCreativeAssociationService : DfpSoapClient, ILineItemCreativeAssociationService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LineItemCreativeAssociationService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/LineItemCreativeAssociationServ" + "ice"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociation createLineItemCreativeAssociation(LineItemCreativeAssociation lineItemCreativeAssociation) { + object[] results = this.Invoke("createLineItemCreativeAssociation", new object[] { lineItemCreativeAssociation }); + return ((LineItemCreativeAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociation[] createLineItemCreativeAssociations([System.Xml.Serialization.XmlElementAttribute("lineItemCreativeAssociations")] +LineItemCreativeAssociation[] lineItemCreativeAssociations) { + object[] results = this.Invoke("createLineItemCreativeAssociations", new object[] { lineItemCreativeAssociations }); + return ((LineItemCreativeAssociation[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociation getLineItemCreativeAssociation(long lineItemId, long creativeId) { + object[] results = this.Invoke("getLineItemCreativeAssociation", new object[] { lineItemId, creativeId }); + return ((LineItemCreativeAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociationPage getLineItemCreativeAssociationsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLineItemCreativeAssociationsByStatement", new object[] { filterStatement }); + return ((LineItemCreativeAssociationPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual string getPreviewUrl(long lineItemId, long creativeId, string siteUrl) { + object[] results = this.Invoke("getPreviewUrl", new object[] { lineItemId, creativeId, siteUrl }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performLineItemCreativeAssociationAction(LineItemCreativeAssociationAction lineItemCreativeAssociationAction, Statement filterStatement) { + object[] results = this.Invoke("performLineItemCreativeAssociationAction", new object[] { lineItemCreativeAssociationAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociation updateLineItemCreativeAssociation(LineItemCreativeAssociation lineItemCreativeAssociation) { + object[] results = this.Invoke("updateLineItemCreativeAssociation", new object[] { lineItemCreativeAssociation }); + return ((LineItemCreativeAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociation[] updateLineItemCreativeAssociations([System.Xml.Serialization.XmlElementAttribute("lineItemCreativeAssociations")] +LineItemCreativeAssociation[] lineItemCreativeAssociations) { + object[] results = this.Invoke("updateLineItemCreativeAssociations", new object[] { lineItemCreativeAssociations }); + return ((LineItemCreativeAssociation[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateLineItemCreativeAssociations))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLineItemCreativeAssociations))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class LineItemCreativeAssociationAction { + private string lineItemCreativeAssociationActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LineItemCreativeAssociationAction.Type")] + public string LineItemCreativeAssociationActionType { + get { return this.lineItemCreativeAssociationActionTypeField; } + set { this.lineItemCreativeAssociationActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeactivateLineItemCreativeAssociations : LineItemCreativeAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ActivateLineItemCreativeAssociations : LineItemCreativeAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class LineItemCreativeAssociationPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LineItemCreativeAssociation[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LineItemCreativeAssociation[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class LineItemCreativeAssociation { + private long lineItemIdField; + + private bool lineItemIdFieldSpecified; + + private long creativeIdField; + + private bool creativeIdFieldSpecified; + + private long creativeSetIdField; + + private bool creativeSetIdFieldSpecified; + + private double manualCreativeRotationWeightField; + + private bool manualCreativeRotationWeightFieldSpecified; + + private int sequentialCreativeRotationIndexField; + + private bool sequentialCreativeRotationIndexFieldSpecified; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private string destinationUrlField; + + private Size[] sizesField; + + private LineItemCreativeAssociationStatus statusField; + + private bool statusFieldSpecified; + + private LineItemCreativeAssociationStats statsField; + + private DateTime lastModifiedDateTimeField; + + public long lineItemId { + get { return this.lineItemIdField; } + set { + this.lineItemIdField = value; + this.lineItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemIdSpecified { + get { return this.lineItemIdFieldSpecified; } + set { this.lineItemIdFieldSpecified = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { + this.creativeIdField = value; + this.creativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeIdSpecified { + get { return this.creativeIdFieldSpecified; } + set { this.creativeIdFieldSpecified = value; } + } + + public long creativeSetId { + get { return this.creativeSetIdField; } + set { + this.creativeSetIdField = value; + this.creativeSetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeSetIdSpecified { + get { return this.creativeSetIdFieldSpecified; } + set { this.creativeSetIdFieldSpecified = value; } + } + + public double manualCreativeRotationWeight { + get { return this.manualCreativeRotationWeightField; } + set { + this.manualCreativeRotationWeightField = value; + this.manualCreativeRotationWeightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manualCreativeRotationWeightSpecified { + get { return this.manualCreativeRotationWeightFieldSpecified; } + set { this.manualCreativeRotationWeightFieldSpecified = value; } + } + + public int sequentialCreativeRotationIndex { + get { return this.sequentialCreativeRotationIndexField; } + set { + this.sequentialCreativeRotationIndexField = value; + this.sequentialCreativeRotationIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sequentialCreativeRotationIndexSpecified { + get { return this.sequentialCreativeRotationIndexFieldSpecified; } + set { this.sequentialCreativeRotationIndexFieldSpecified = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("sizes")] + public Size[] sizes { + get { return this.sizesField; } + set { this.sizesField = value; } + } + + public LineItemCreativeAssociationStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public LineItemCreativeAssociationStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociation.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum LineItemCreativeAssociationStatus { + ACTIVE, + NOT_SERVING, + INACTIVE, + DELETED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class LineItemCreativeAssociationStats { + private Stats statsField; + + private Long_StatsMapEntry[] creativeSetStatsField; + + private Money costInOrderCurrencyField; + + public Stats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativeSetStats")] + public Long_StatsMapEntry[] creativeSetStats { + get { return this.creativeSetStatsField; } + set { this.creativeSetStatsField = value; } + } + + public Money costInOrderCurrency { + get { return this.costInOrderCurrencyField; } + set { this.costInOrderCurrencyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Long_StatsMapEntry { + private long keyField; + + private bool keyFieldSpecified; + + private Stats valueField; + + public long key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public Stats value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class TemplateInstantiatedCreativeError : ApiError { + private TemplateInstantiatedCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TemplateInstantiatedCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TemplateInstantiatedCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum TemplateInstantiatedCreativeErrorReason { + INACTIVE_CREATIVE_TEMPLATE, + FILE_TYPE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class SwiffyConversionError : ApiError { + private SwiffyConversionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SwiffyConversionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SwiffyConversionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum SwiffyConversionErrorReason { + SERVER_ERROR, + INVALID_FLASH_FILE, + UNSUPPORTED_FLASH, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RichMediaStudioCreativeError : ApiError { + private RichMediaStudioCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RichMediaStudioCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaStudioCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum RichMediaStudioCreativeErrorReason { + CREATION_NOT_ALLOWED, + UKNOWN_ERROR, + INVALID_CODE_GENERATION_REQUEST, + INVALID_CREATIVE_OBJECT, + STUDIO_CONNECTION_ERROR, + PUSHDOWN_DURATION_NOT_ALLOWED, + INVALID_POSITION, + INVALID_Z_INDEX, + INVALID_PUSHDOWN_DURATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class LineItemCreativeAssociationOperationError : ApiError { + private LineItemCreativeAssociationOperationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemCreativeAssociationOperationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociationOperationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum LineItemCreativeAssociationOperationErrorReason { + NOT_ALLOWED, + NOT_APPLICABLE, + CANNOT_ACTIVATE_INVALID_CREATIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class InvalidPhoneNumberError : ApiError { + private InvalidPhoneNumberErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidPhoneNumberErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidPhoneNumberError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum InvalidPhoneNumberErrorReason { + INVALID_FORMAT, + TOO_SHORT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ImageError : ApiError { + private ImageErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ImageErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ImageError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ImageErrorReason { + INVALID_IMAGE, + INVALID_SIZE, + UNEXPECTED_SIZE, + OVERLAY_SIZE_TOO_LARGE, + ANIMATED_NOT_ALLOWED, + ANIMATION_TOO_LONG, + CMYK_JPEG_NOT_ALLOWED, + FLASH_NOT_ALLOWED, + FLASH_WITHOUT_CLICKTAG, + ANIMATED_VISUAL_EFFECT, + FLASH_ERROR, + LAYOUT_PROBLEM, + FLASH_HAS_NETWORK_OBJECTS, + FLASH_HAS_NETWORK_METHODS, + FLASH_HAS_URL, + FLASH_HAS_MOUSE_TRACKING, + FLASH_HAS_RANDOM_NUM, + FLASH_SELF_TARGETS, + FLASH_BAD_GETURL_TARGET, + FLASH_VERSION_NOT_SUPPORTED, + FILE_TOO_LARGE, + SYSTEM_ERROR, + UNEXPECTED_PRIMARY_ASSET_DENSITY, + DUPLICATE_ASSET_DENSITY, + MISSING_DEFAULT_ASSET, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class FileError : ApiError { + private FileErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FileErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FileError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum FileErrorReason { + MISSING_CONTENTS, + SIZE_TOO_LARGE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CustomCreativeError : ApiError { + private CustomCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CustomCreativeErrorReason { + DUPLICATE_MACRO_NAME_FOR_CREATIVE, + SNIPPET_REFERENCES_MISSING_MACRO, + UNRECOGNIZED_MACRO, + CUSTOM_CREATIVE_NOT_ALLOWED, + MISSING_INTERSTITIAL_MACRO, + DUPLICATE_ASSET_IN_MACROS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CreativeSetError : ApiError { + private CreativeSetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeSetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeSetError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CreativeSetErrorReason { + VIDEO_FEATURE_REQUIRED, + CANNOT_CREATE_OR_UPDATE_VIDEO_CREATIVES, + ROADBLOCK_FEATURE_REQUIRED, + MASTER_CREATIVE_CANNOT_BE_COMPANION, + VIDEO_CREATIVE_NOT_ALLOWED, + INVALID_ADVERTISER, + UPDATE_MASTER_CREATIVE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CreativeAssetMacroError : ApiError { + private CreativeAssetMacroErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeAssetMacroErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeAssetMacroError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CreativeAssetMacroErrorReason { + INVALID_MACRO_NAME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AssetError : ApiError { + private AssetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AssetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AssetError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AssetErrorReason { + NON_UNIQUE_NAME, + FILE_NAME_TOO_LONG, + FILE_SIZE_TOO_LARGE, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_CLIENT, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_HEIGHT, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_WIDTH, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_FORMAT, + INVALID_CODE_SNIPPET_PARAMETER_VALUE, + INVALID_ASSET_ID, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AdSenseAccountError : ApiError { + private AdSenseAccountErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdSenseAccountErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseAccountError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AdSenseAccountErrorReason { + ASSOCIATE_ACCOUNT_API_ERROR, + GET_AD_SLOT_API_ERROR, + GET_BULK_ACCOUNT_STATUSES_API_ERROR, + RESEND_VERIFICATION_EMAIL_ERROR, + UNEXPECTED_API_RESPONSE_ERROR, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProductServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProductService : DfpSoapClient, IProductService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProductService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/ProductService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Product getProduct(string productId) { + object[] results = this.Invoke("getProduct", new object[] { productId }); + return ((Product) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductPage getProductsByStatement(Statement statement) { + object[] results = this.Invoke("getProductsByStatement", new object[] { statement }); + return ((ProductPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performProductAction(ProductAction productAction, Statement filterStatement) { + object[] results = this.Invoke("performProductAction", new object[] { productAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Product updateProduct(Product product) { + object[] results = this.Invoke("updateProduct", new object[] { product }); + return ((Product) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Product[] updateProducts([System.Xml.Serialization.XmlElementAttribute("products")] +Product[] products) { + object[] results = this.Invoke("updateProducts", new object[] { products }); + return ((Product[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateProducts))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveProducts))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateProducts))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class ProductAction { + private string productActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProductAction.Type")] + public string ProductActionType { + get { return this.productActionTypeField; } + set { this.productActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeactivateProducts : ProductAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ArchiveProducts : ProductAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ActivateProducts : ProductAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ProductPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Product[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Product[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Product { + private string nameField; + + private ProductStatus statusField; + + private bool statusFieldSpecified; + + private ProductType productTypeField; + + private bool productTypeFieldSpecified; + + private long productTemplateIdField; + + private bool productTemplateIdFieldSpecified; + + private string idField; + + private string notesField; + + private string productTemplateDescriptionField; + + private DateTime lastModifiedDateTimeField; + + private RateType rateTypeField; + + private bool rateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int priorityField; + + private bool priorityFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private bool allowFrequencyCapsCustomizationField; + + private bool allowFrequencyCapsCustomizationFieldSpecified; + + private ProductTemplateTargeting targetingField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ProductStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ProductType productType { + get { return this.productTypeField; } + set { + this.productTypeField = value; + this.productTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productTypeSpecified { + get { return this.productTypeFieldSpecified; } + set { this.productTypeFieldSpecified = value; } + } + + public long productTemplateId { + get { return this.productTemplateIdField; } + set { + this.productTemplateIdField = value; + this.productTemplateIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productTemplateIdSpecified { + get { return this.productTemplateIdFieldSpecified; } + set { this.productTemplateIdFieldSpecified = value; } + } + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public string productTemplateDescription { + get { return this.productTemplateDescriptionField; } + set { this.productTemplateDescriptionField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public RateType rateType { + get { return this.rateTypeField; } + set { + this.rateTypeField = value; + this.rateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateTypeSpecified { + get { return this.rateTypeFieldSpecified; } + set { this.rateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public bool allowFrequencyCapsCustomization { + get { return this.allowFrequencyCapsCustomizationField; } + set { + this.allowFrequencyCapsCustomizationField = value; + this.allowFrequencyCapsCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowFrequencyCapsCustomizationSpecified { + get { return this.allowFrequencyCapsCustomizationFieldSpecified; } + set { this.allowFrequencyCapsCustomizationFieldSpecified = value; } + } + + public ProductTemplateTargeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ProductStatus { + ACTIVE, + INACTIVE, + ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ProductType { + DFP, + OFFLINE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum RateType { + CPM, + CPC, + CPD, + FLAT_RATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ProductTemplateTargeting { + private GeoTargeting geoTargetingField; + + private bool allowGeoTargetingCustomizationField; + + private bool allowGeoTargetingCustomizationFieldSpecified; + + private InventoryTargeting inventoryTargetingField; + + private bool allowAdUnitTargetingCustomizationField; + + private bool allowAdUnitTargetingCustomizationFieldSpecified; + + private bool allowPlacementTargetingCustomizationField; + + private bool allowPlacementTargetingCustomizationFieldSpecified; + + private long[] customizableCustomTargetingKeyIdsField; + + private UserDomainTargeting userDomainTargetingField; + + private bool allowUserDomainTargetingCustomizationField; + + private bool allowUserDomainTargetingCustomizationFieldSpecified; + + private BandwidthGroupTargeting bandwidthGroupTargetingField; + + private bool allowBandwidthGroupTargetingCustomizationField; + + private bool allowBandwidthGroupTargetingCustomizationFieldSpecified; + + private BrowserTargeting browserTargetingField; + + private bool allowBrowserTargetingCustomizationField; + + private bool allowBrowserTargetingCustomizationFieldSpecified; + + private BrowserLanguageTargeting browserLanguageTargetingField; + + private bool allowBrowserLanguageTargetingCustomizationField; + + private bool allowBrowserLanguageTargetingCustomizationFieldSpecified; + + private OperatingSystemTargeting operatingSystemTargetingField; + + private bool allowOperatingSystemTargetingCustomizationField; + + private bool allowOperatingSystemTargetingCustomizationFieldSpecified; + + public GeoTargeting geoTargeting { + get { return this.geoTargetingField; } + set { this.geoTargetingField = value; } + } + + public bool allowGeoTargetingCustomization { + get { return this.allowGeoTargetingCustomizationField; } + set { + this.allowGeoTargetingCustomizationField = value; + this.allowGeoTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowGeoTargetingCustomizationSpecified { + get { return this.allowGeoTargetingCustomizationFieldSpecified; } + set { this.allowGeoTargetingCustomizationFieldSpecified = value; } + } + + public InventoryTargeting inventoryTargeting { + get { return this.inventoryTargetingField; } + set { this.inventoryTargetingField = value; } + } + + public bool allowAdUnitTargetingCustomization { + get { return this.allowAdUnitTargetingCustomizationField; } + set { + this.allowAdUnitTargetingCustomizationField = value; + this.allowAdUnitTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowAdUnitTargetingCustomizationSpecified { + get { return this.allowAdUnitTargetingCustomizationFieldSpecified; } + set { this.allowAdUnitTargetingCustomizationFieldSpecified = value; } + } + + public bool allowPlacementTargetingCustomization { + get { return this.allowPlacementTargetingCustomizationField; } + set { + this.allowPlacementTargetingCustomizationField = value; + this.allowPlacementTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowPlacementTargetingCustomizationSpecified { + get { return this.allowPlacementTargetingCustomizationFieldSpecified; } + set { this.allowPlacementTargetingCustomizationFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customizableCustomTargetingKeyIds")] + public long[] customizableCustomTargetingKeyIds { + get { return this.customizableCustomTargetingKeyIdsField; } + set { this.customizableCustomTargetingKeyIdsField = value; } + } + + public UserDomainTargeting userDomainTargeting { + get { return this.userDomainTargetingField; } + set { this.userDomainTargetingField = value; } + } + + public bool allowUserDomainTargetingCustomization { + get { return this.allowUserDomainTargetingCustomizationField; } + set { + this.allowUserDomainTargetingCustomizationField = value; + this.allowUserDomainTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowUserDomainTargetingCustomizationSpecified { + get { return this.allowUserDomainTargetingCustomizationFieldSpecified; } + set { this.allowUserDomainTargetingCustomizationFieldSpecified = value; } + } + + public BandwidthGroupTargeting bandwidthGroupTargeting { + get { return this.bandwidthGroupTargetingField; } + set { this.bandwidthGroupTargetingField = value; } + } + + public bool allowBandwidthGroupTargetingCustomization { + get { return this.allowBandwidthGroupTargetingCustomizationField; } + set { + this.allowBandwidthGroupTargetingCustomizationField = value; + this.allowBandwidthGroupTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowBandwidthGroupTargetingCustomizationSpecified { + get { return this.allowBandwidthGroupTargetingCustomizationFieldSpecified; } + set { this.allowBandwidthGroupTargetingCustomizationFieldSpecified = value; } + } + + public BrowserTargeting browserTargeting { + get { return this.browserTargetingField; } + set { this.browserTargetingField = value; } + } + + public bool allowBrowserTargetingCustomization { + get { return this.allowBrowserTargetingCustomizationField; } + set { + this.allowBrowserTargetingCustomizationField = value; + this.allowBrowserTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowBrowserTargetingCustomizationSpecified { + get { return this.allowBrowserTargetingCustomizationFieldSpecified; } + set { this.allowBrowserTargetingCustomizationFieldSpecified = value; } + } + + public BrowserLanguageTargeting browserLanguageTargeting { + get { return this.browserLanguageTargetingField; } + set { this.browserLanguageTargetingField = value; } + } + + public bool allowBrowserLanguageTargetingCustomization { + get { return this.allowBrowserLanguageTargetingCustomizationField; } + set { + this.allowBrowserLanguageTargetingCustomizationField = value; + this.allowBrowserLanguageTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowBrowserLanguageTargetingCustomizationSpecified { + get { return this.allowBrowserLanguageTargetingCustomizationFieldSpecified; } + set { this.allowBrowserLanguageTargetingCustomizationFieldSpecified = value; } + } + + public OperatingSystemTargeting operatingSystemTargeting { + get { return this.operatingSystemTargetingField; } + set { this.operatingSystemTargetingField = value; } + } + + public bool allowOperatingSystemTargetingCustomization { + get { return this.allowOperatingSystemTargetingCustomizationField; } + set { + this.allowOperatingSystemTargetingCustomizationField = value; + this.allowOperatingSystemTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowOperatingSystemTargetingCustomizationSpecified { + get { return this.allowOperatingSystemTargetingCustomizationFieldSpecified; } + set { this.allowOperatingSystemTargetingCustomizationFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ProductActionError : ApiError { + private ProductActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProductActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ProductActionErrorReason { + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class BaseRateError : ApiError { + private BaseRateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BaseRateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BaseRateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum BaseRateErrorReason { + CANNOT_QUERY_BOTH_PRODUCT_TEMPLATE_ID_AND_PRODUCT_ID, + INVALID_CURRENCY_CODE, + UNSUPPORTED_OPERATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReconciliationReportRowServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReconciliationReportRowService : DfpSoapClient, IReconciliationReportRowService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReconciliationReportRowService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/ReconciliationReportRowService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReportRowPage getReconciliationReportRowsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getReconciliationReportRowsByStatement", new object[] { filterStatement }); + return ((ReconciliationReportRowPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReportRow[] updateReconciliationReportRows([System.Xml.Serialization.XmlElementAttribute("reconciliationReportRows")] +ReconciliationReportRow[] reconciliationReportRows) { + object[] results = this.Invoke("updateReconciliationReportRows", new object[] { reconciliationReportRows }); + return ((ReconciliationReportRow[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ReconciliationReportRow { + private long reconciliationReportIdField; + + private bool reconciliationReportIdFieldSpecified; + + private long lineItemIdField; + + private bool lineItemIdFieldSpecified; + + private long creativeIdField; + + private bool creativeIdFieldSpecified; + + private long orderIdField; + + private bool orderIdFieldSpecified; + + private long advertiserIdField; + + private bool advertiserIdFieldSpecified; + + private BillFrom billFromField; + + private bool billFromFieldSpecified; + + private CostType lineItemCostTypeField; + + private bool lineItemCostTypeFieldSpecified; + + private Money lineItemCostPerUnitField; + + private long lineItemContractedUnitsBoughtField; + + private bool lineItemContractedUnitsBoughtFieldSpecified; + + private long dfpClicksField; + + private bool dfpClicksFieldSpecified; + + private long dfpImpressionsField; + + private bool dfpImpressionsFieldSpecified; + + private int dfpLineItemDaysField; + + private bool dfpLineItemDaysFieldSpecified; + + private long thirdPartyClicksField; + + private bool thirdPartyClicksFieldSpecified; + + private long thirdPartyImpressionsField; + + private bool thirdPartyImpressionsFieldSpecified; + + private int thirdPartyLineItemDaysField; + + private bool thirdPartyLineItemDaysFieldSpecified; + + private long manualClicksField; + + private bool manualClicksFieldSpecified; + + private long manualImpressionsField; + + private bool manualImpressionsFieldSpecified; + + private int manualLineItemDaysField; + + private bool manualLineItemDaysFieldSpecified; + + private long reconciledClicksField; + + private bool reconciledClicksFieldSpecified; + + private long reconciledImpressionsField; + + private bool reconciledImpressionsFieldSpecified; + + private int reconciledLineItemDaysField; + + private bool reconciledLineItemDaysFieldSpecified; + + private Money contractedRevenueField; + + private Money dfpRevenueField; + + private Money thirdPartyRevenueField; + + private Money manualRevenueField; + + private Money reconciledRevenueField; + + private string commentsField; + + public long reconciliationReportId { + get { return this.reconciliationReportIdField; } + set { + this.reconciliationReportIdField = value; + this.reconciliationReportIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reconciliationReportIdSpecified { + get { return this.reconciliationReportIdFieldSpecified; } + set { this.reconciliationReportIdFieldSpecified = value; } + } + + public long lineItemId { + get { return this.lineItemIdField; } + set { + this.lineItemIdField = value; + this.lineItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemIdSpecified { + get { return this.lineItemIdFieldSpecified; } + set { this.lineItemIdFieldSpecified = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { + this.creativeIdField = value; + this.creativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeIdSpecified { + get { return this.creativeIdFieldSpecified; } + set { this.creativeIdFieldSpecified = value; } + } + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public long advertiserId { + get { return this.advertiserIdField; } + set { + this.advertiserIdField = value; + this.advertiserIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserIdSpecified { + get { return this.advertiserIdFieldSpecified; } + set { this.advertiserIdFieldSpecified = value; } + } + + public BillFrom billFrom { + get { return this.billFromField; } + set { + this.billFromField = value; + this.billFromSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billFromSpecified { + get { return this.billFromFieldSpecified; } + set { this.billFromFieldSpecified = value; } + } + + public CostType lineItemCostType { + get { return this.lineItemCostTypeField; } + set { + this.lineItemCostTypeField = value; + this.lineItemCostTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemCostTypeSpecified { + get { return this.lineItemCostTypeFieldSpecified; } + set { this.lineItemCostTypeFieldSpecified = value; } + } + + public Money lineItemCostPerUnit { + get { return this.lineItemCostPerUnitField; } + set { this.lineItemCostPerUnitField = value; } + } + + public long lineItemContractedUnitsBought { + get { return this.lineItemContractedUnitsBoughtField; } + set { + this.lineItemContractedUnitsBoughtField = value; + this.lineItemContractedUnitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemContractedUnitsBoughtSpecified { + get { return this.lineItemContractedUnitsBoughtFieldSpecified; } + set { this.lineItemContractedUnitsBoughtFieldSpecified = value; } + } + + public long dfpClicks { + get { return this.dfpClicksField; } + set { + this.dfpClicksField = value; + this.dfpClicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dfpClicksSpecified { + get { return this.dfpClicksFieldSpecified; } + set { this.dfpClicksFieldSpecified = value; } + } + + public long dfpImpressions { + get { return this.dfpImpressionsField; } + set { + this.dfpImpressionsField = value; + this.dfpImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dfpImpressionsSpecified { + get { return this.dfpImpressionsFieldSpecified; } + set { this.dfpImpressionsFieldSpecified = value; } + } + + public int dfpLineItemDays { + get { return this.dfpLineItemDaysField; } + set { + this.dfpLineItemDaysField = value; + this.dfpLineItemDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dfpLineItemDaysSpecified { + get { return this.dfpLineItemDaysFieldSpecified; } + set { this.dfpLineItemDaysFieldSpecified = value; } + } + + public long thirdPartyClicks { + get { return this.thirdPartyClicksField; } + set { + this.thirdPartyClicksField = value; + this.thirdPartyClicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyClicksSpecified { + get { return this.thirdPartyClicksFieldSpecified; } + set { this.thirdPartyClicksFieldSpecified = value; } + } + + public long thirdPartyImpressions { + get { return this.thirdPartyImpressionsField; } + set { + this.thirdPartyImpressionsField = value; + this.thirdPartyImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyImpressionsSpecified { + get { return this.thirdPartyImpressionsFieldSpecified; } + set { this.thirdPartyImpressionsFieldSpecified = value; } + } + + public int thirdPartyLineItemDays { + get { return this.thirdPartyLineItemDaysField; } + set { + this.thirdPartyLineItemDaysField = value; + this.thirdPartyLineItemDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyLineItemDaysSpecified { + get { return this.thirdPartyLineItemDaysFieldSpecified; } + set { this.thirdPartyLineItemDaysFieldSpecified = value; } + } + + public long manualClicks { + get { return this.manualClicksField; } + set { + this.manualClicksField = value; + this.manualClicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manualClicksSpecified { + get { return this.manualClicksFieldSpecified; } + set { this.manualClicksFieldSpecified = value; } + } + + public long manualImpressions { + get { return this.manualImpressionsField; } + set { + this.manualImpressionsField = value; + this.manualImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manualImpressionsSpecified { + get { return this.manualImpressionsFieldSpecified; } + set { this.manualImpressionsFieldSpecified = value; } + } + + public int manualLineItemDays { + get { return this.manualLineItemDaysField; } + set { + this.manualLineItemDaysField = value; + this.manualLineItemDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manualLineItemDaysSpecified { + get { return this.manualLineItemDaysFieldSpecified; } + set { this.manualLineItemDaysFieldSpecified = value; } + } + + public long reconciledClicks { + get { return this.reconciledClicksField; } + set { + this.reconciledClicksField = value; + this.reconciledClicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reconciledClicksSpecified { + get { return this.reconciledClicksFieldSpecified; } + set { this.reconciledClicksFieldSpecified = value; } + } + + public long reconciledImpressions { + get { return this.reconciledImpressionsField; } + set { + this.reconciledImpressionsField = value; + this.reconciledImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reconciledImpressionsSpecified { + get { return this.reconciledImpressionsFieldSpecified; } + set { this.reconciledImpressionsFieldSpecified = value; } + } + + public int reconciledLineItemDays { + get { return this.reconciledLineItemDaysField; } + set { + this.reconciledLineItemDaysField = value; + this.reconciledLineItemDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reconciledLineItemDaysSpecified { + get { return this.reconciledLineItemDaysFieldSpecified; } + set { this.reconciledLineItemDaysFieldSpecified = value; } + } + + public Money contractedRevenue { + get { return this.contractedRevenueField; } + set { this.contractedRevenueField = value; } + } + + public Money dfpRevenue { + get { return this.dfpRevenueField; } + set { this.dfpRevenueField = value; } + } + + public Money thirdPartyRevenue { + get { return this.thirdPartyRevenueField; } + set { this.thirdPartyRevenueField = value; } + } + + public Money manualRevenue { + get { return this.manualRevenueField; } + set { this.manualRevenueField = value; } + } + + public Money reconciledRevenue { + get { return this.reconciledRevenueField; } + set { this.reconciledRevenueField = value; } + } + + public string comments { + get { return this.commentsField; } + set { this.commentsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum BillFrom { + DEFAULT, + DFP, + THIRD_PARTY, + MANUAL, + CONTRACTED_GOAL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ReconciliationReportRowPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ReconciliationReportRow[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ReconciliationReportRow[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "RateCardCustomizationServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class RateCardCustomizationService : DfpSoapClient, IRateCardCustomizationService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public RateCardCustomizationService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/RateCardCustomizationService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomization createRateCardCustomization(RateCardCustomization rateCardCustomization) { + object[] results = this.Invoke("createRateCardCustomization", new object[] { rateCardCustomization }); + return ((RateCardCustomization) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomization[] createRateCardCustomizations([System.Xml.Serialization.XmlElementAttribute("rateCardCustomizations")] +RateCardCustomization[] rateCardCustomizations) { + object[] results = this.Invoke("createRateCardCustomizations", new object[] { rateCardCustomizations }); + return ((RateCardCustomization[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomization getRateCardCustomization(long rateCardCustomizationId) { + object[] results = this.Invoke("getRateCardCustomization", new object[] { rateCardCustomizationId }); + return ((RateCardCustomization) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomizationPage getRateCardCustomizationsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getRateCardCustomizationsByStatement", new object[] { filterStatement }); + return ((RateCardCustomizationPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performRateCardCustomizationAction(RateCardCustomizationAction rateCardCustomizationAction, Statement filterStatement) { + object[] results = this.Invoke("performRateCardCustomizationAction", new object[] { rateCardCustomizationAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomization updateRateCardCustomization(RateCardCustomization rateCardCustomization) { + object[] results = this.Invoke("updateRateCardCustomization", new object[] { rateCardCustomization }); + return ((RateCardCustomization) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomization[] updateRateCardCustomizations([System.Xml.Serialization.XmlElementAttribute("rateCardCustomizations")] +RateCardCustomization[] rateCardCustomizations) { + object[] results = this.Invoke("updateRateCardCustomizations", new object[] { rateCardCustomizations }); + return ((RateCardCustomization[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateRateCardCustomizations))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateRateCardCustomizations))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class RateCardCustomizationAction { + private string rateCardCustomizationActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("RateCardCustomizationAction.Type")] + public string RateCardCustomizationActionType { + get { return this.rateCardCustomizationActionTypeField; } + set { this.rateCardCustomizationActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeactivateRateCardCustomizations : RateCardCustomizationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ActivateRateCardCustomizations : RateCardCustomizationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RateCardCustomizationPage { + private RateCardCustomization[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public RateCardCustomization[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RateCardCustomization { + private long rateCardIdField; + + private bool rateCardIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private RateCardCustomizationStatus statusField; + + private bool statusFieldSpecified; + + private RateCardFeature rateCardFeatureField; + + private RateCardCustomizationAdjustmentType adjustmentTypeField; + + private bool adjustmentTypeFieldSpecified; + + private long adjustmentSizeField; + + private bool adjustmentSizeFieldSpecified; + + private RateType rateTypeField; + + private bool rateTypeFieldSpecified; + + public long rateCardId { + get { return this.rateCardIdField; } + set { + this.rateCardIdField = value; + this.rateCardIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardIdSpecified { + get { return this.rateCardIdFieldSpecified; } + set { this.rateCardIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public RateCardCustomizationStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public RateCardFeature rateCardFeature { + get { return this.rateCardFeatureField; } + set { this.rateCardFeatureField = value; } + } + + public RateCardCustomizationAdjustmentType adjustmentType { + get { return this.adjustmentTypeField; } + set { + this.adjustmentTypeField = value; + this.adjustmentTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adjustmentTypeSpecified { + get { return this.adjustmentTypeFieldSpecified; } + set { this.adjustmentTypeFieldSpecified = value; } + } + + public long adjustmentSize { + get { return this.adjustmentSizeField; } + set { + this.adjustmentSizeField = value; + this.adjustmentSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adjustmentSizeSpecified { + get { return this.adjustmentSizeFieldSpecified; } + set { this.adjustmentSizeFieldSpecified = value; } + } + + public RateType rateType { + get { return this.rateTypeField; } + set { + this.rateTypeField = value; + this.rateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateTypeSpecified { + get { return this.rateTypeFieldSpecified; } + set { this.rateTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum RateCardCustomizationStatus { + ACTIVE, + INACTIVE, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserDomainRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnknownRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystemRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GeographyRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FrequencyCapRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomTargetingRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BrowserLanguageRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BrowserRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BandwidthRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitRateCardFeature))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class RateCardFeature { + private string rateCardFeatureTypeField; + + [System.Xml.Serialization.XmlElementAttribute("RateCardFeature.Type")] + public string RateCardFeatureType { + get { return this.rateCardFeatureTypeField; } + set { this.rateCardFeatureTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class UserDomainRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class UnknownRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class PlacementRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class OperatingSystemRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class GeographyRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class FrequencyCapRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CustomTargetingRateCardFeature : RateCardFeature { + private long customTargetingKeyIdField; + + private bool customTargetingKeyIdFieldSpecified; + + private long customTargetingValueIdField; + + private bool customTargetingValueIdFieldSpecified; + + public long customTargetingKeyId { + get { return this.customTargetingKeyIdField; } + set { + this.customTargetingKeyIdField = value; + this.customTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customTargetingKeyIdSpecified { + get { return this.customTargetingKeyIdFieldSpecified; } + set { this.customTargetingKeyIdFieldSpecified = value; } + } + + public long customTargetingValueId { + get { return this.customTargetingValueIdField; } + set { + this.customTargetingValueIdField = value; + this.customTargetingValueIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customTargetingValueIdSpecified { + get { return this.customTargetingValueIdFieldSpecified; } + set { this.customTargetingValueIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class BrowserLanguageRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class BrowserRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class BandwidthRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AdUnitRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum RateCardCustomizationAdjustmentType { + PERCENTAGE, + ABSOLUTE_VALUE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RateCardCustomizationError : ApiError { + private RateCardCustomizationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RateCardCustomizationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RateCardCustomizationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum RateCardCustomizationErrorReason { + INVALID_RATE_TYPE, + UNSUPPORTED_OPERATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeSetServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeSetService : DfpSoapClient, ICreativeSetService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeSetService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/CreativeSetService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeSet createCreativeSet(CreativeSet creativeSet) { + object[] results = this.Invoke("createCreativeSet", new object[] { creativeSet }); + return ((CreativeSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeSet getCreativeSet(long creativeSetId) { + object[] results = this.Invoke("getCreativeSet", new object[] { creativeSetId }); + return ((CreativeSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeSetPage getCreativeSetsByStatement(Statement statement) { + object[] results = this.Invoke("getCreativeSetsByStatement", new object[] { statement }); + return ((CreativeSetPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeSet updateCreativeSet(CreativeSet creativeSet) { + object[] results = this.Invoke("updateCreativeSet", new object[] { creativeSet }); + return ((CreativeSet) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CreativeSetPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeSet[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeSet[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CreativeSet { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private long masterCreativeIdField; + + private bool masterCreativeIdFieldSpecified; + + private long[] companionCreativeIdsField; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public long masterCreativeId { + get { return this.masterCreativeIdField; } + set { + this.masterCreativeIdField = value; + this.masterCreativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool masterCreativeIdSpecified { + get { return this.masterCreativeIdFieldSpecified; } + set { this.masterCreativeIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "BaseRateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class BaseRateService : DfpSoapClient, IBaseRateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public BaseRateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/BaseRateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRate createBaseRate(BaseRate baseRate) { + object[] results = this.Invoke("createBaseRate", new object[] { baseRate }); + return ((BaseRate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRate[] createBaseRates([System.Xml.Serialization.XmlElementAttribute("baseRates")] +BaseRate[] baseRates) { + object[] results = this.Invoke("createBaseRates", new object[] { baseRates }); + return ((BaseRate[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRate getBaseRate(long baseRateId) { + object[] results = this.Invoke("getBaseRate", new object[] { baseRateId }); + return ((BaseRate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRatePage getBaseRatesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getBaseRatesByStatement", new object[] { filterStatement }); + return ((BaseRatePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performBaseRateAction(BaseRateAction baseRateAction, Statement filterStatement) { + object[] results = this.Invoke("performBaseRateAction", new object[] { baseRateAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRate updateBaseRate(BaseRate baseRate) { + object[] results = this.Invoke("updateBaseRate", new object[] { baseRate }); + return ((BaseRate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRate[] updateBaseRates([System.Xml.Serialization.XmlElementAttribute("baseRates")] +BaseRate[] baseRates) { + object[] results = this.Invoke("updateBaseRates", new object[] { baseRates }); + return ((BaseRate[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateBaseRates))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateBaseRates))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class BaseRateAction { + private string baseRateActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("BaseRateAction.Type")] + public string BaseRateActionType { + get { return this.baseRateActionTypeField; } + set { this.baseRateActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeactivateBaseRates : BaseRateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ActivateBaseRates : BaseRateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class BaseRatePage { + private BaseRate[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public BaseRate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductTemplateBaseRate))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductBaseRate))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class BaseRate { + private long rateCardIdField; + + private bool rateCardIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private BaseRateStatus statusField; + + private bool statusFieldSpecified; + + private string baseRateTypeField; + + public long rateCardId { + get { return this.rateCardIdField; } + set { + this.rateCardIdField = value; + this.rateCardIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardIdSpecified { + get { return this.rateCardIdFieldSpecified; } + set { this.rateCardIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public BaseRateStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseRate.Type")] + public string BaseRateType { + get { return this.baseRateTypeField; } + set { this.baseRateTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum BaseRateStatus { + ACTIVE, + INACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ProductTemplateBaseRate : BaseRate { + private long productTemplateIdField; + + private bool productTemplateIdFieldSpecified; + + private Money rateField; + + public long productTemplateId { + get { return this.productTemplateIdField; } + set { + this.productTemplateIdField = value; + this.productTemplateIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productTemplateIdSpecified { + get { return this.productTemplateIdFieldSpecified; } + set { this.productTemplateIdFieldSpecified = value; } + } + + public Money rate { + get { return this.rateField; } + set { this.rateField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ProductBaseRate : BaseRate { + private string productIdField; + + private Money rateField; + + public string productId { + get { return this.productIdField; } + set { this.productIdField = value; } + } + + public Money rate { + get { return this.rateField; } + set { this.rateField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class BaseRateActionError : ApiError { + private BaseRateActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BaseRateActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BaseRateActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum BaseRateActionErrorReason { + DUPLICATED_BASE_RATES, + ACTIVE_BASE_RATE_ALREADY_EXISTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "InventoryServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class InventoryService : DfpSoapClient, IInventoryService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public InventoryService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/InventoryService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnit createAdUnit(AdUnit adUnit) { + object[] results = this.Invoke("createAdUnit", new object[] { adUnit }); + return ((AdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnit[] createAdUnits([System.Xml.Serialization.XmlElementAttribute("adUnits")] +AdUnit[] adUnits) { + object[] results = this.Invoke("createAdUnits", new object[] { adUnits }); + return ((AdUnit[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnit getAdUnit(string adUnitId) { + object[] results = this.Invoke("getAdUnit", new object[] { adUnitId }); + return ((AdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnitSize[] getAdUnitSizesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAdUnitSizesByStatement", new object[] { filterStatement }); + return ((AdUnitSize[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnitPage getAdUnitsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAdUnitsByStatement", new object[] { filterStatement }); + return ((AdUnitPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performAdUnitAction(AdUnitAction adUnitAction, Statement filterStatement) { + object[] results = this.Invoke("performAdUnitAction", new object[] { adUnitAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnit updateAdUnit(AdUnit adUnit) { + object[] results = this.Invoke("updateAdUnit", new object[] { adUnit }); + return ((AdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnit[] updateAdUnits([System.Xml.Serialization.XmlElementAttribute("adUnits")] +AdUnit[] adUnits) { + object[] results = this.Invoke("updateAdUnits", new object[] { adUnits }); + return ((AdUnit[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RemoveAdUnitsFromPlacement))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateAdUnits))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssignAdUnitsToPlacement))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveAdUnits))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateAdUnits))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class AdUnitAction { + private string adUnitActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AdUnitAction.Type")] + public string AdUnitActionType { + get { return this.adUnitActionTypeField; } + set { this.adUnitActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RemoveAdUnitsFromPlacement : AdUnitAction { + private long placementIdField; + + private bool placementIdFieldSpecified; + + public long placementId { + get { return this.placementIdField; } + set { + this.placementIdField = value; + this.placementIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool placementIdSpecified { + get { return this.placementIdFieldSpecified; } + set { this.placementIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeactivateAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AssignAdUnitsToPlacement : AdUnitAction { + private long placementIdField; + + private bool placementIdFieldSpecified; + + public long placementId { + get { return this.placementIdField; } + set { + this.placementIdField = value; + this.placementIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool placementIdSpecified { + get { return this.placementIdFieldSpecified; } + set { this.placementIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ArchiveAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ActivateAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AdUnitPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AdUnit[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AdUnit[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AdUnit { + private string idField; + + private string parentIdField; + + private bool hasChildrenField; + + private bool hasChildrenFieldSpecified; + + private AdUnitParent[] parentPathField; + + private string nameField; + + private string descriptionField; + + private AdUnitTargetWindow targetWindowField; + + private bool targetWindowFieldSpecified; + + private InventoryStatus statusField; + + private bool statusFieldSpecified; + + private string adUnitCodeField; + + private AdUnitSize[] adUnitSizesField; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private MobilePlatform mobilePlatformField; + + private bool mobilePlatformFieldSpecified; + + private bool explicitlyTargetedField; + + private bool explicitlyTargetedFieldSpecified; + + private AdSenseSettingsInheritedProperty inheritedAdSenseSettingsField; + + private long partnerIdField; + + private bool partnerIdFieldSpecified; + + private LabelFrequencyCap[] appliedLabelFrequencyCapsField; + + private LabelFrequencyCap[] effectiveLabelFrequencyCapsField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private long[] effectiveTeamIdsField; + + private long[] appliedTeamIdsField; + + private DateTime lastModifiedDateTimeField; + + private SmartSizeMode smartSizeModeField; + + private bool smartSizeModeFieldSpecified; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string parentId { + get { return this.parentIdField; } + set { this.parentIdField = value; } + } + + public bool hasChildren { + get { return this.hasChildrenField; } + set { + this.hasChildrenField = value; + this.hasChildrenSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasChildrenSpecified { + get { return this.hasChildrenFieldSpecified; } + set { this.hasChildrenFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("parentPath")] + public AdUnitParent[] parentPath { + get { return this.parentPathField; } + set { this.parentPathField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public AdUnitTargetWindow targetWindow { + get { return this.targetWindowField; } + set { + this.targetWindowField = value; + this.targetWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetWindowSpecified { + get { return this.targetWindowFieldSpecified; } + set { this.targetWindowFieldSpecified = value; } + } + + public InventoryStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string adUnitCode { + get { return this.adUnitCodeField; } + set { this.adUnitCodeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adUnitSizes")] + public AdUnitSize[] adUnitSizes { + get { return this.adUnitSizesField; } + set { this.adUnitSizesField = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + public MobilePlatform mobilePlatform { + get { return this.mobilePlatformField; } + set { + this.mobilePlatformField = value; + this.mobilePlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mobilePlatformSpecified { + get { return this.mobilePlatformFieldSpecified; } + set { this.mobilePlatformFieldSpecified = value; } + } + + public bool explicitlyTargeted { + get { return this.explicitlyTargetedField; } + set { + this.explicitlyTargetedField = value; + this.explicitlyTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool explicitlyTargetedSpecified { + get { return this.explicitlyTargetedFieldSpecified; } + set { this.explicitlyTargetedFieldSpecified = value; } + } + + public AdSenseSettingsInheritedProperty inheritedAdSenseSettings { + get { return this.inheritedAdSenseSettingsField; } + set { this.inheritedAdSenseSettingsField = value; } + } + + public long partnerId { + get { return this.partnerIdField; } + set { + this.partnerIdField = value; + this.partnerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool partnerIdSpecified { + get { return this.partnerIdFieldSpecified; } + set { this.partnerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabelFrequencyCaps")] + public LabelFrequencyCap[] appliedLabelFrequencyCaps { + get { return this.appliedLabelFrequencyCapsField; } + set { this.appliedLabelFrequencyCapsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveLabelFrequencyCaps")] + public LabelFrequencyCap[] effectiveLabelFrequencyCaps { + get { return this.effectiveLabelFrequencyCapsField; } + set { this.effectiveLabelFrequencyCapsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveTeamIds")] + public long[] effectiveTeamIds { + get { return this.effectiveTeamIdsField; } + set { this.effectiveTeamIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public SmartSizeMode smartSizeMode { + get { return this.smartSizeModeField; } + set { + this.smartSizeModeField = value; + this.smartSizeModeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool smartSizeModeSpecified { + get { return this.smartSizeModeFieldSpecified; } + set { this.smartSizeModeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum InventoryStatus { + ACTIVE, + INACTIVE, + ARCHIVED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum MobilePlatform { + SITE, + APPLICATION + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AdSenseSettingsInheritedProperty { + private AdSenseSettings valueField; + + public AdSenseSettings value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AdSenseSettings { + private bool adSenseEnabledField; + + private bool adSenseEnabledFieldSpecified; + + private string borderColorField; + + private string titleColorField; + + private string backgroundColorField; + + private string textColorField; + + private string urlColorField; + + private AdSenseSettingsAdType adTypeField; + + private bool adTypeFieldSpecified; + + private AdSenseSettingsBorderStyle borderStyleField; + + private bool borderStyleFieldSpecified; + + private AdSenseSettingsFontFamily fontFamilyField; + + private bool fontFamilyFieldSpecified; + + private AdSenseSettingsFontSize fontSizeField; + + private bool fontSizeFieldSpecified; + + private Size_StringMapEntry[] afcFormatsField; + + public bool adSenseEnabled { + get { return this.adSenseEnabledField; } + set { + this.adSenseEnabledField = value; + this.adSenseEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adSenseEnabledSpecified { + get { return this.adSenseEnabledFieldSpecified; } + set { this.adSenseEnabledFieldSpecified = value; } + } + + public string borderColor { + get { return this.borderColorField; } + set { this.borderColorField = value; } + } + + public string titleColor { + get { return this.titleColorField; } + set { this.titleColorField = value; } + } + + public string backgroundColor { + get { return this.backgroundColorField; } + set { this.backgroundColorField = value; } + } + + public string textColor { + get { return this.textColorField; } + set { this.textColorField = value; } + } + + public string urlColor { + get { return this.urlColorField; } + set { this.urlColorField = value; } + } + + public AdSenseSettingsAdType adType { + get { return this.adTypeField; } + set { + this.adTypeField = value; + this.adTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adTypeSpecified { + get { return this.adTypeFieldSpecified; } + set { this.adTypeFieldSpecified = value; } + } + + public AdSenseSettingsBorderStyle borderStyle { + get { return this.borderStyleField; } + set { + this.borderStyleField = value; + this.borderStyleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool borderStyleSpecified { + get { return this.borderStyleFieldSpecified; } + set { this.borderStyleFieldSpecified = value; } + } + + public AdSenseSettingsFontFamily fontFamily { + get { return this.fontFamilyField; } + set { + this.fontFamilyField = value; + this.fontFamilySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fontFamilySpecified { + get { return this.fontFamilyFieldSpecified; } + set { this.fontFamilyFieldSpecified = value; } + } + + public AdSenseSettingsFontSize fontSize { + get { return this.fontSizeField; } + set { + this.fontSizeField = value; + this.fontSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fontSizeSpecified { + get { return this.fontSizeFieldSpecified; } + set { this.fontSizeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("afcFormats")] + public Size_StringMapEntry[] afcFormats { + get { return this.afcFormatsField; } + set { this.afcFormatsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.AdType", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AdSenseSettingsAdType { + TEXT, + IMAGE, + TEXT_AND_IMAGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.BorderStyle", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AdSenseSettingsBorderStyle { + DEFAULT, + NOT_ROUNDED, + SLIGHTLY_ROUNDED, + VERY_ROUNDED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.FontFamily", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AdSenseSettingsFontFamily { + DEFAULT, + ARIAL, + TAHOMA, + GEORGIA, + TIMES, + VERDANA + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.FontSize", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AdSenseSettingsFontSize { + DEFAULT, + SMALL, + MEDIUM, + LARGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Size_StringMapEntry { + private Size keyField; + + private string valueField; + + public Size key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class LabelFrequencyCap { + private FrequencyCap frequencyCapField; + + private long labelIdField; + + private bool labelIdFieldSpecified; + + public FrequencyCap frequencyCap { + get { return this.frequencyCapField; } + set { this.frequencyCapField = value; } + } + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum SmartSizeMode { + UNKNOWN, + NONE, + SMART_BANNER, + DYNAMIC_SIZE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RegExError : ApiError { + private RegExErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RegExErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RegExError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum RegExErrorReason { + INVALID, + NULL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AdUnitTypeError : ApiError { + private AdUnitTypeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitTypeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitTypeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AdUnitTypeErrorReason { + MOBILE_APP_PLATFORM_NOT_VALID, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class InventoryUnitSizesError : ApiError { + private InventoryUnitSizesErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitSizesErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitSizesError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum InventoryUnitSizesErrorReason { + INVALID_SIZES, + INVALID_SIZE_FOR_PLATFORM, + VIDEO_FEATURE_MISSING, + VIDEO_MOBILE_LINE_ITEM_FEATURE_MISSING, + INVALID_SIZE_FOR_MASTER, + INVALID_SIZE_FOR_COMPANION, + DUPLICATE_MASTER_SIZES, + ASPECT_RATIO_NOT_SUPPORTED, + VIDEO_COMPANIONS_NOT_SUPPORTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class InventoryUnitPartnerAssociationError : ApiError { + private InventoryUnitPartnerAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitPartnerAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitPartnerAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum InventoryUnitPartnerAssociationErrorReason { + ANCESTOR_AD_UNIT_HAS_PARTNER_ASSOCIATION, + DESCENDANT_AD_UNIT_HAS_PARTNER_ASSOCIATION, + SAME_PARTNER_ASSOCIATION_IN_INVENTORY_HIERARCHY, + NO_PARTNER_CATCH_ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class InventoryUnitError : ApiError { + private InventoryUnitErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum InventoryUnitErrorReason { + EXPLICIT_TARGETING_NOT_ALLOWED, + TARGET_PLATFORM_NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class InvalidColorError : ApiError { + private InvalidColorErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidColorErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidColorError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum InvalidColorErrorReason { + INVALID_FORMAT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AdUnitHierarchyError : ApiError { + private AdUnitHierarchyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitHierarchyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitHierarchyError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AdUnitHierarchyErrorReason { + INVALID_DEPTH, + INVALID_PARENT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AdUnitCodeError : ApiError { + private AdUnitCodeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitCodeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitCodeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AdUnitCodeErrorReason { + INVALID_CHARACTERS, + INVALID_CHARACTERS_WHEN_UTF_CHARACTERS_ARE_ALLOWED, + LEADING_FORWARD_SLASH, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AdUnitAfcSizeError : ApiError { + private AdUnitAfcSizeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitAfcSizeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitAfcSizeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AdUnitAfcSizeErrorReason { + INVALID, + DOESNT_FIT, + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProductTemplateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProductTemplateService : DfpSoapClient, IProductTemplateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProductTemplateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/ProductTemplateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplate createProductTemplate(ProductTemplate productTemplate) { + object[] results = this.Invoke("createProductTemplate", new object[] { productTemplate }); + return ((ProductTemplate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplate[] createProductTemplates([System.Xml.Serialization.XmlElementAttribute("productTemplates")] +ProductTemplate[] productTemplates) { + object[] results = this.Invoke("createProductTemplates", new object[] { productTemplates }); + return ((ProductTemplate[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplate getProductTemplate(long productTemplateId) { + object[] results = this.Invoke("getProductTemplate", new object[] { productTemplateId }); + return ((ProductTemplate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplatePage getProductTemplatesByStatement(Statement statement) { + object[] results = this.Invoke("getProductTemplatesByStatement", new object[] { statement }); + return ((ProductTemplatePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performProductTemplateAction(ProductTemplateAction action, Statement filterStatement) { + object[] results = this.Invoke("performProductTemplateAction", new object[] { action, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplate updateProductTemplate(ProductTemplate productTemplate) { + object[] results = this.Invoke("updateProductTemplate", new object[] { productTemplate }); + return ((ProductTemplate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplate[] updateProductTemplates([System.Xml.Serialization.XmlElementAttribute("productTemplates")] +ProductTemplate[] productTemplates) { + object[] results = this.Invoke("updateProductTemplates", new object[] { productTemplates }); + return ((ProductTemplate[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateProductTemplates))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveProducTemplates))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateProductTemplates))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class ProductTemplateAction { + private string productTemplateActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProductTemplateAction.Type")] + public string ProductTemplateActionType { + get { return this.productTemplateActionTypeField; } + set { this.productTemplateActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeactivateProductTemplates : ProductTemplateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ArchiveProducTemplates : ProductTemplateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ActivateProductTemplates : ProductTemplateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ProductTemplatePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ProductTemplate[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ProductTemplate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ProductTemplate { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private DateTime creationDateTimeField; + + private DateTime lastModifiedDateTimeField; + + private string descriptionField; + + private string nameMacroField; + + private ProductTemplateStatus statusField; + + private bool statusFieldSpecified; + + private ProductType productTypeField; + + private bool productTypeFieldSpecified; + + private long creatorIdField; + + private bool creatorIdFieldSpecified; + + private RateType rateTypeField; + + private bool rateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int priorityField; + + private bool priorityFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private bool allowFrequencyCapsCustomizationField; + + private bool allowFrequencyCapsCustomizationFieldSpecified; + + private ProductSegmentation productSegmentationField; + + private ProductTemplateTargeting targetingField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DateTime creationDateTime { + get { return this.creationDateTimeField; } + set { this.creationDateTimeField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public string nameMacro { + get { return this.nameMacroField; } + set { this.nameMacroField = value; } + } + + public ProductTemplateStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ProductType productType { + get { return this.productTypeField; } + set { + this.productTypeField = value; + this.productTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productTypeSpecified { + get { return this.productTypeFieldSpecified; } + set { this.productTypeFieldSpecified = value; } + } + + public long creatorId { + get { return this.creatorIdField; } + set { + this.creatorIdField = value; + this.creatorIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creatorIdSpecified { + get { return this.creatorIdFieldSpecified; } + set { this.creatorIdFieldSpecified = value; } + } + + public RateType rateType { + get { return this.rateTypeField; } + set { + this.rateTypeField = value; + this.rateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateTypeSpecified { + get { return this.rateTypeFieldSpecified; } + set { this.rateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public bool allowFrequencyCapsCustomization { + get { return this.allowFrequencyCapsCustomizationField; } + set { + this.allowFrequencyCapsCustomizationField = value; + this.allowFrequencyCapsCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowFrequencyCapsCustomizationSpecified { + get { return this.allowFrequencyCapsCustomizationFieldSpecified; } + set { this.allowFrequencyCapsCustomizationFieldSpecified = value; } + } + + public ProductSegmentation productSegmentation { + get { return this.productSegmentationField; } + set { this.productSegmentationField = value; } + } + + public ProductTemplateTargeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ProductTemplateStatus { + ACTIVE, + DRAFT, + CANCELED, + ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ProductSegmentation { + private GeoTargeting geoSegmentField; + + private AdUnitTargeting[] adUnitSegmentsField; + + private long[] placementSegmentField; + + private UserDomainTargeting userDomainSegmentField; + + private BandwidthGroupTargeting bandwidthSegmentField; + + private BrowserTargeting browserSegmentField; + + private BrowserLanguageTargeting browserLanguageSegmentField; + + private OperatingSystemTargeting operatingSystemSegmentField; + + public GeoTargeting geoSegment { + get { return this.geoSegmentField; } + set { this.geoSegmentField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adUnitSegments")] + public AdUnitTargeting[] adUnitSegments { + get { return this.adUnitSegmentsField; } + set { this.adUnitSegmentsField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("targetedPlacementIds", IsNullable = false)] + public long[] placementSegment { + get { return this.placementSegmentField; } + set { this.placementSegmentField = value; } + } + + public UserDomainTargeting userDomainSegment { + get { return this.userDomainSegmentField; } + set { this.userDomainSegmentField = value; } + } + + public BandwidthGroupTargeting bandwidthSegment { + get { return this.bandwidthSegmentField; } + set { this.bandwidthSegmentField = value; } + } + + public BrowserTargeting browserSegment { + get { return this.browserSegmentField; } + set { this.browserSegmentField = value; } + } + + public BrowserLanguageTargeting browserLanguageSegment { + get { return this.browserLanguageSegmentField; } + set { this.browserLanguageSegmentField = value; } + } + + public OperatingSystemTargeting operatingSystemSegment { + get { return this.operatingSystemSegmentField; } + set { this.operatingSystemSegmentField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ProductTemplateError : ApiError { + private ProductTemplateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProductTemplateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductTemplateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ProductTemplateErrorReason { + INVALID_FEATURE_EXPANDED_EXCLUSIVE, + INVALID_EXPANDED_FEATURE_DEFAULT_NOT_TARGETED, + INVALID_EXPANDED_FEATURE_DEFAULT_LOCKED, + INVALID_EXPANDED_FEATURE_VALUE_TARGETED, + INVALID_EXPANDED_FEATURE_VALUE_LOCKED, + INVALID_FEATURE_TYPE, + INVALID_ROADBLOCKING_TYPE, + INVALID_TARGETING, + INVALID_FREQUENCY_CAPS, + INVALID_TECHNOLOGY_INCLUDE_EXCLUDE, + INVALID_EXPANDED_PRODUCT_COUNT, + INVALID_TARGET_PLATFORM, + INVALID_NON_TARGETING_FEATURE, + INVALID_FEATURE_CARDINALITY_AT_LEAST_ONE, + INVALID_FEATURE_CARDINALITY_AT_MOST_ONE, + INVALID_FEATURE_CARDINALITY_EXACTLY_ONE, + INVALID_FEATURE_FOR_OFFLINE, + INVALID_RATE_TYPE_FOR_OFFLINE, + INVALID_RATE_TYPE_FOR_DFP, + INVALID_LINE_ITEM_PRIORITY, + INVALID_LINE_ITEM_TYPE, + DUPLICATED_PLACEHOLDER_IN_NAMEMACRO, + INVALID_EXPANDED_FEATURE_IN_NON_EXPANDABLE_AFFINITY, + INVALID_FEATURE_DEFAULT_TARGET_TYPE, + INVALID_FEATURE_VALUE_TARGET_TYPE, + INVALID_FEATURE_AND_VALUE_LOCK_EXCLUSIVE, + DUPLICATED_FEATURE, + DUPLICATED_CUSTOM_TARGETING_KEY, + INVALID_CUSTOM_TARGETING_KEY_ID, + INVALID_CUSTOM_TARGETING_VALUE_ID, + DUPLICATED_FEATURE_VALUE, + MISSING_EXPANDED_FEATURE_PLACEHOLDER_IN_NAMEMACRO, + MISSING_FEATURE_VALUE_OF_NAMEMACRO_PLACEHOLDER, + MISSING_FEATURE_OF_NAMEMACRO_PLACEHOLDER, + MISSING_SUBTYPE_FOR_CUSTOM_TARGETING, + COMPANION_NOT_ALLOWED, + MISSING_COMPANION, + CANNOT_MODIFY_READONLY_FEATURE, + CANNOT_MODIFY_PRODUCT_TYPE, + CANNOT_ADD_SEGMENTATION, + CANNOT_REMOVE_SEGMENTATION, + CANNOT_REMOVE_VALUE_FROM_SEGMENTATION, + CANNOT_ADD_FEATURE_VALUE_FOR_CUSTOM_TARGETING, + CANNOT_MODIFY_BUILTIN_TARGETING_FEATURE, + CANNOT_UPDATE_ARCHIVED_PRODUCT_TEMPLATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ProductTemplateActionError : ApiError { + private ProductTemplateActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProductTemplateActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductTemplateActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ProductTemplateActionErrorReason { + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ForecastServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ForecastService : DfpSoapClient, IForecastService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ForecastService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/ForecastService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Forecast getForecast(LineItem lineItem) { + object[] results = this.Invoke("getForecast", new object[] { lineItem }); + return ((Forecast) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Forecast getForecastById(long lineItemId) { + object[] results = this.Invoke("getForecastById", new object[] { lineItemId }); + return ((Forecast) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Forecast { + private long idField; + + private bool idFieldSpecified; + + private long orderIdField; + + private bool orderIdFieldSpecified; + + private UnitType unitTypeField; + + private bool unitTypeFieldSpecified; + + private long availableUnitsField; + + private bool availableUnitsFieldSpecified; + + private long deliveredUnitsField; + + private bool deliveredUnitsFieldSpecified; + + private long matchedUnitsField; + + private bool matchedUnitsFieldSpecified; + + private long possibleUnitsField; + + private bool possibleUnitsFieldSpecified; + + private long reservedUnitsField; + + private bool reservedUnitsFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public UnitType unitType { + get { return this.unitTypeField; } + set { + this.unitTypeField = value; + this.unitTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitTypeSpecified { + get { return this.unitTypeFieldSpecified; } + set { this.unitTypeFieldSpecified = value; } + } + + public long availableUnits { + get { return this.availableUnitsField; } + set { + this.availableUnitsField = value; + this.availableUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool availableUnitsSpecified { + get { return this.availableUnitsFieldSpecified; } + set { this.availableUnitsFieldSpecified = value; } + } + + public long deliveredUnits { + get { return this.deliveredUnitsField; } + set { + this.deliveredUnitsField = value; + this.deliveredUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveredUnitsSpecified { + get { return this.deliveredUnitsFieldSpecified; } + set { this.deliveredUnitsFieldSpecified = value; } + } + + public long matchedUnits { + get { return this.matchedUnitsField; } + set { + this.matchedUnitsField = value; + this.matchedUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool matchedUnitsSpecified { + get { return this.matchedUnitsFieldSpecified; } + set { this.matchedUnitsFieldSpecified = value; } + } + + public long possibleUnits { + get { return this.possibleUnitsField; } + set { + this.possibleUnitsField = value; + this.possibleUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool possibleUnitsSpecified { + get { return this.possibleUnitsFieldSpecified; } + set { this.possibleUnitsFieldSpecified = value; } + } + + public long reservedUnits { + get { return this.reservedUnitsField; } + set { + this.reservedUnitsField = value; + this.reservedUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reservedUnitsSpecified { + get { return this.reservedUnitsFieldSpecified; } + set { this.reservedUnitsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "UserServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserRecord))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class UserService : DfpSoapClient, IUserService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public UserService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/UserService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User createUser(User user) { + object[] results = this.Invoke("createUser", new object[] { user }); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User[] createUsers([System.Xml.Serialization.XmlElementAttribute("users")] +User[] users) { + object[] results = this.Invoke("createUsers", new object[] { users }); + return ((User[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Role[] getAllRoles() { + object[] results = this.Invoke("getAllRoles", new object[0]); + return ((Role[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User getCurrentUser() { + object[] results = this.Invoke("getCurrentUser", new object[0]); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User getUser(long userId) { + object[] results = this.Invoke("getUser", new object[] { userId }); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserPage getUsersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getUsersByStatement", new object[] { filterStatement }); + return ((UserPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performUserAction(UserAction userAction, Statement filterStatement) { + object[] results = this.Invoke("performUserAction", new object[] { userAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User updateUser(User user) { + object[] results = this.Invoke("updateUser", new object[] { user }); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User[] updateUsers([System.Xml.Serialization.XmlElementAttribute("users")] +User[] users) { + object[] results = this.Invoke("updateUsers", new object[] { users }); + return ((User[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateUsers))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateUsers))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class UserAction { + private string userActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("UserAction.Type")] + public string UserActionType { + get { return this.userActionTypeField; } + set { this.userActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeactivateUsers : UserAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ActivateUsers : UserAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class UserPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private User[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public User[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class User : UserRecord { + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private bool isEmailNotificationAllowedField; + + private bool isEmailNotificationAllowedFieldSpecified; + + private string externalIdField; + + private string ordersUiLocalTimeZoneIdField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + public bool isEmailNotificationAllowed { + get { return this.isEmailNotificationAllowedField; } + set { + this.isEmailNotificationAllowedField = value; + this.isEmailNotificationAllowedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isEmailNotificationAllowedSpecified { + get { return this.isEmailNotificationAllowedFieldSpecified; } + set { this.isEmailNotificationAllowedFieldSpecified = value; } + } + + public string externalId { + get { return this.externalIdField; } + set { this.externalIdField = value; } + } + + public string ordersUiLocalTimeZoneId { + get { return this.ordersUiLocalTimeZoneIdField; } + set { this.ordersUiLocalTimeZoneIdField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(User))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class UserRecord { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string emailField; + + private long roleIdField; + + private bool roleIdFieldSpecified; + + private string roleNameField; + + private string preferredLocaleField; + + private string userRecordTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public long roleId { + get { return this.roleIdField; } + set { + this.roleIdField = value; + this.roleIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roleIdSpecified { + get { return this.roleIdFieldSpecified; } + set { this.roleIdFieldSpecified = value; } + } + + public string roleName { + get { return this.roleNameField; } + set { this.roleNameField = value; } + } + + public string preferredLocale { + get { return this.preferredLocaleField; } + set { this.preferredLocaleField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("UserRecord.Type")] + public string UserRecordType { + get { return this.userRecordTypeField; } + set { this.userRecordTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Role { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "PublisherQueryLanguageServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class PublisherQueryLanguageService : DfpSoapClient, IPublisherQueryLanguageService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public PublisherQueryLanguageService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/PublisherQueryLanguageService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ResultSet select(Statement selectStatement) { + object[] results = this.Invoke("select", new object[] { selectStatement }); + return ((ResultSet) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Row { + private Value[] valuesField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("values")] + public Value[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ColumnType { + private string labelNameField; + + public string labelName { + get { return this.labelNameField; } + set { this.labelNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ResultSet { + private ColumnType[] columnTypesField; + + private Row[] rowsField; + + [System.Xml.Serialization.XmlElementAttribute("columnTypes")] + public ColumnType[] columnTypes { + get { return this.columnTypesField; } + set { this.columnTypesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("rows")] + public Row[] rows { + get { return this.rowsField; } + set { this.rowsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class OrderActionError : ApiError { + private OrderActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OrderActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OrderActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum OrderActionErrorReason { + PERMISSION_DENIED, + NOT_APPLICABLE, + IS_ARCHIVED, + HAS_ENDED, + CANNOT_APPROVE_WITH_UNRESERVED_LINE_ITEMS, + CANNOT_DELETE_ORDER_WITH_DELIVERED_LINEITEMS, + CANNOT_APPROVE_COMPANY_CREDIT_STATUS_NOT_ACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "TeamServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class TeamService : DfpSoapClient, ITeamService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public TeamService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/TeamService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Team createTeam(Team team) { + object[] results = this.Invoke("createTeam", new object[] { team }); + return ((Team) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Team[] createTeams([System.Xml.Serialization.XmlElementAttribute("teams")] +Team[] teams) { + object[] results = this.Invoke("createTeams", new object[] { teams }); + return ((Team[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Team getTeam(long teamId) { + object[] results = this.Invoke("getTeam", new object[] { teamId }); + return ((Team) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TeamPage getTeamsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getTeamsByStatement", new object[] { filterStatement }); + return ((TeamPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Team updateTeam(Team team) { + object[] results = this.Invoke("updateTeam", new object[] { team }); + return ((Team) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Team[] updateTeams([System.Xml.Serialization.XmlElementAttribute("teams")] +Team[] teams) { + object[] results = this.Invoke("updateTeams", new object[] { teams }); + return ((Team[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class TeamPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Team[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Team[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Team { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool hasAllCompaniesField; + + private bool hasAllCompaniesFieldSpecified; + + private bool hasAllInventoryField; + + private bool hasAllInventoryFieldSpecified; + + private TeamAccessType teamAccessTypeField; + + private bool teamAccessTypeFieldSpecified; + + private long[] companyIdsField; + + private string[] adUnitIdsField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool hasAllCompanies { + get { return this.hasAllCompaniesField; } + set { + this.hasAllCompaniesField = value; + this.hasAllCompaniesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasAllCompaniesSpecified { + get { return this.hasAllCompaniesFieldSpecified; } + set { this.hasAllCompaniesFieldSpecified = value; } + } + + public bool hasAllInventory { + get { return this.hasAllInventoryField; } + set { + this.hasAllInventoryField = value; + this.hasAllInventorySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasAllInventorySpecified { + get { return this.hasAllInventoryFieldSpecified; } + set { this.hasAllInventoryFieldSpecified = value; } + } + + public TeamAccessType teamAccessType { + get { return this.teamAccessTypeField; } + set { + this.teamAccessTypeField = value; + this.teamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool teamAccessTypeSpecified { + get { return this.teamAccessTypeFieldSpecified; } + set { this.teamAccessTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companyIds")] + public long[] companyIds { + get { return this.companyIdsField; } + set { this.companyIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adUnitIds")] + public string[] adUnitIds { + get { return this.adUnitIdsField; } + set { this.adUnitIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "RateCardServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class RateCardService : DfpSoapClient, IRateCardService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public RateCardService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/RateCardService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCard createRateCard(RateCard rateCard) { + object[] results = this.Invoke("createRateCard", new object[] { rateCard }); + return ((RateCard) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCard[] createRateCards([System.Xml.Serialization.XmlElementAttribute("rateCards")] +RateCard[] rateCards) { + object[] results = this.Invoke("createRateCards", new object[] { rateCards }); + return ((RateCard[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCard getRateCard(long rateCardId) { + object[] results = this.Invoke("getRateCard", new object[] { rateCardId }); + return ((RateCard) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardPage getRateCardsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getRateCardsByStatement", new object[] { filterStatement }); + return ((RateCardPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performRateCardAction(RateCardAction rateCardAction, Statement filterStatement) { + object[] results = this.Invoke("performRateCardAction", new object[] { rateCardAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCard updateRateCard(RateCard rateCard) { + object[] results = this.Invoke("updateRateCard", new object[] { rateCard }); + return ((RateCard) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCard[] updateRateCards([System.Xml.Serialization.XmlElementAttribute("rateCards")] +RateCard[] rateCards) { + object[] results = this.Invoke("updateRateCards", new object[] { rateCards }); + return ((RateCard[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateRateCards))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateRateCards))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class RateCardAction { + private string rateCardActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("RateCardAction.Type")] + public string RateCardActionType { + get { return this.rateCardActionTypeField; } + set { this.rateCardActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeactivateRateCards : RateCardAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ActivateRateCards : RateCardAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RateCardPage { + private RateCard[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public RateCard[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RateCard { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private RateCardStatus statusField; + + private bool statusFieldSpecified; + + private long[] appliedTeamIdsField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public RateCardStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum RateCardStatus { + ACTIVE, + INACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RateCardActionError : ApiError { + private RateCardActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RateCardActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RateCardActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum RateCardActionErrorReason { + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "PlacementServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SiteTargetingInfo))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class PlacementService : DfpSoapClient, IPlacementService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public PlacementService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/PlacementService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Placement createPlacement(Placement placement) { + object[] results = this.Invoke("createPlacement", new object[] { placement }); + return ((Placement) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Placement[] createPlacements([System.Xml.Serialization.XmlElementAttribute("placements")] +Placement[] placements) { + object[] results = this.Invoke("createPlacements", new object[] { placements }); + return ((Placement[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Placement getPlacement(long placementId) { + object[] results = this.Invoke("getPlacement", new object[] { placementId }); + return ((Placement) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual PlacementPage getPlacementsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getPlacementsByStatement", new object[] { filterStatement }); + return ((PlacementPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performPlacementAction(PlacementAction placementAction, Statement filterStatement) { + object[] results = this.Invoke("performPlacementAction", new object[] { placementAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Placement updatePlacement(Placement placement) { + object[] results = this.Invoke("updatePlacement", new object[] { placement }); + return ((Placement) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Placement[] updatePlacements([System.Xml.Serialization.XmlElementAttribute("placements")] +Placement[] placements) { + object[] results = this.Invoke("updatePlacements", new object[] { placements }); + return ((Placement[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivatePlacements))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchivePlacements))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivatePlacements))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class PlacementAction { + private string placementActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("PlacementAction.Type")] + public string PlacementActionType { + get { return this.placementActionTypeField; } + set { this.placementActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeactivatePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ArchivePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ActivatePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class PlacementPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Placement[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Placement[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Placement : SiteTargetingInfo { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private string placementCodeField; + + private InventoryStatus statusField; + + private bool statusFieldSpecified; + + private bool isAdSenseTargetingEnabledField; + + private bool isAdSenseTargetingEnabledFieldSpecified; + + private bool isAdPlannerTargetingEnabledField; + + private bool isAdPlannerTargetingEnabledFieldSpecified; + + private string adSenseTargetingLocaleField; + + private string[] targetedAdUnitIdsField; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public string placementCode { + get { return this.placementCodeField; } + set { this.placementCodeField = value; } + } + + public InventoryStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public bool isAdSenseTargetingEnabled { + get { return this.isAdSenseTargetingEnabledField; } + set { + this.isAdSenseTargetingEnabledField = value; + this.isAdSenseTargetingEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAdSenseTargetingEnabledSpecified { + get { return this.isAdSenseTargetingEnabledFieldSpecified; } + set { this.isAdSenseTargetingEnabledFieldSpecified = value; } + } + + public bool isAdPlannerTargetingEnabled { + get { return this.isAdPlannerTargetingEnabledField; } + set { + this.isAdPlannerTargetingEnabledField = value; + this.isAdPlannerTargetingEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAdPlannerTargetingEnabledSpecified { + get { return this.isAdPlannerTargetingEnabledFieldSpecified; } + set { this.isAdPlannerTargetingEnabledFieldSpecified = value; } + } + + public string adSenseTargetingLocale { + get { return this.adSenseTargetingLocaleField; } + set { this.adSenseTargetingLocaleField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedAdUnitIds")] + public string[] targetedAdUnitIds { + get { return this.targetedAdUnitIdsField; } + set { this.targetedAdUnitIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Placement))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class SiteTargetingInfo { + private string targetingDescriptionField; + + private string targetingSiteNameField; + + private string targetingAdLocationField; + + private string siteTargetingInfoTypeField; + + public string targetingDescription { + get { return this.targetingDescriptionField; } + set { this.targetingDescriptionField = value; } + } + + public string targetingSiteName { + get { return this.targetingSiteNameField; } + set { this.targetingSiteNameField = value; } + } + + public string targetingAdLocation { + get { return this.targetingAdLocationField; } + set { this.targetingAdLocationField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("SiteTargetingInfo.Type")] + public string SiteTargetingInfoType { + get { return this.siteTargetingInfoTypeField; } + set { this.siteTargetingInfoTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class PlacementError : ApiError { + private PlacementErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PlacementErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PlacementError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum PlacementErrorReason { + INVALID_ENTITY_TYPE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReconciliationOrderReportServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReconciliationOrderReportService : DfpSoapClient, IReconciliationOrderReportService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReconciliationOrderReportService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/ReconciliationOrderReportServic" + "e"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationOrderReport getReconciliationOrderReport(long reconciliationOrderReportId) { + object[] results = this.Invoke("getReconciliationOrderReport", new object[] { reconciliationOrderReportId }); + return ((ReconciliationOrderReport) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationOrderReportPage getReconciliationOrderReportsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getReconciliationOrderReportsByStatement", new object[] { filterStatement }); + return ((ReconciliationOrderReportPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performReconciliationOrderReportAction(ReconciliationOrderReportAction reconciliationOrderReportAction, Statement filterStatement) { + object[] results = this.Invoke("performReconciliationOrderReportAction", new object[] { reconciliationOrderReportAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RevertReconciliationOrderReports))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitReconciliationOrderReports))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class ReconciliationOrderReportAction { + private string reconciliationOrderReportActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ReconciliationOrderReportAction.Type")] + public string ReconciliationOrderReportActionType { + get { return this.reconciliationOrderReportActionTypeField; } + set { this.reconciliationOrderReportActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RevertReconciliationOrderReports : ReconciliationOrderReportAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class SubmitReconciliationOrderReports : ReconciliationOrderReportAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ReconciliationOrderReportPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ReconciliationOrderReport[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ReconciliationOrderReport[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ReconciliationOrderReport { + private long idField; + + private bool idFieldSpecified; + + private long reconciliationReportIdField; + + private bool reconciliationReportIdFieldSpecified; + + private long orderIdField; + + private bool orderIdFieldSpecified; + + private ReconciliationOrderReportStatus statusField; + + private bool statusFieldSpecified; + + private DateTime submissionDateTimeField; + + private long submitterIdField; + + private bool submitterIdFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long reconciliationReportId { + get { return this.reconciliationReportIdField; } + set { + this.reconciliationReportIdField = value; + this.reconciliationReportIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reconciliationReportIdSpecified { + get { return this.reconciliationReportIdFieldSpecified; } + set { this.reconciliationReportIdFieldSpecified = value; } + } + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public ReconciliationOrderReportStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public DateTime submissionDateTime { + get { return this.submissionDateTimeField; } + set { this.submissionDateTimeField = value; } + } + + public long submitterId { + get { return this.submitterIdField; } + set { + this.submitterIdField = value; + this.submitterIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool submitterIdSpecified { + get { return this.submitterIdFieldSpecified; } + set { this.submitterIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ReconciliationOrderReportStatus { + DRAFT, + RECONCILED, + REVERTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ActivityServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ActivityService : DfpSoapClient, IActivityService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ActivityService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/ActivityService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Activity[] createActivities([System.Xml.Serialization.XmlElementAttribute("activities")] +Activity[] activities) { + object[] results = this.Invoke("createActivities", new object[] { activities }); + return ((Activity[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Activity createActivity(Activity activity) { + object[] results = this.Invoke("createActivity", new object[] { activity }); + return ((Activity) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityPage getActivitiesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getActivitiesByStatement", new object[] { filterStatement }); + return ((ActivityPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Activity getActivity(int activityId) { + object[] results = this.Invoke("getActivity", new object[] { activityId }); + return ((Activity) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Activity[] updateActivities([System.Xml.Serialization.XmlElementAttribute("activities")] +Activity[] activities) { + object[] results = this.Invoke("updateActivities", new object[] { activities }); + return ((Activity[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Activity updateActivity(Activity activity) { + object[] results = this.Invoke("updateActivity", new object[] { activity }); + return ((Activity) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ActivityPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Activity[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Activity[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Activity { + private int idField; + + private bool idFieldSpecified; + + private int activityGroupIdField; + + private bool activityGroupIdFieldSpecified; + + private string nameField; + + private string expectedURLField; + + private ActivityStatus statusField; + + private bool statusFieldSpecified; + + private ActivityType typeField; + + private bool typeFieldSpecified; + + public int id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public int activityGroupId { + get { return this.activityGroupIdField; } + set { + this.activityGroupIdField = value; + this.activityGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool activityGroupIdSpecified { + get { return this.activityGroupIdFieldSpecified; } + set { this.activityGroupIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string expectedURL { + get { return this.expectedURLField; } + set { this.expectedURLField = value; } + } + + public ActivityStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ActivityType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Activity.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ActivityStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Activity.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ActivityType { + PAGE_VIEWS, + DAILY_VISITS, + CUSTOM, + ITEMS_PURCHASED, + TRANSACTIONS, + IOS_APPLICATION_DOWNLOADS, + ANDROID_APPLICATION_DOWNLOADS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "OrderServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class OrderService : DfpSoapClient, IOrderService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public OrderService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/OrderService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Order createOrder(Order order) { + object[] results = this.Invoke("createOrder", new object[] { order }); + return ((Order) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Order[] createOrders([System.Xml.Serialization.XmlElementAttribute("orders")] +Order[] orders) { + object[] results = this.Invoke("createOrders", new object[] { orders }); + return ((Order[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Order getOrder(long orderId) { + object[] results = this.Invoke("getOrder", new object[] { orderId }); + return ((Order) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual OrderPage getOrdersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getOrdersByStatement", new object[] { filterStatement }); + return ((OrderPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performOrderAction(OrderAction orderAction, Statement filterStatement) { + object[] results = this.Invoke("performOrderAction", new object[] { orderAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Order updateOrder(Order order) { + object[] results = this.Invoke("updateOrder", new object[] { order }); + return ((Order) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Order[] updateOrders([System.Xml.Serialization.XmlElementAttribute("orders")] +Order[] orders) { + object[] results = this.Invoke("updateOrders", new object[] { orders }); + return ((Order[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApproval))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalAndOverbook))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RetractOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RetractOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PauseOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DisapproveOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DisapproveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class OrderAction { + private string orderActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("OrderAction.Type")] + public string OrderActionType { + get { return this.orderActionTypeField; } + set { this.orderActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class UnarchiveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class SubmitOrdersForApprovalWithoutReservationChanges : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalAndOverbook))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class SubmitOrdersForApproval : OrderAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class SubmitOrdersForApprovalAndOverbook : SubmitOrdersForApproval { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RetractOrdersWithoutReservationChanges : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RetractOrders : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ResumeOrders : OrderAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ResumeAndOverbookOrders : ResumeOrders { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class PauseOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DisapproveOrdersWithoutReservationChanges : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DisapproveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeleteOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ArchiveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ApproveOrdersWithoutReservationChanges : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ApproveOrders : OrderAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ApproveAndOverbookOrders : ApproveOrders { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class OrderPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Order[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Order[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Order { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private OrderStatus statusField; + + private bool statusFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private string notesField; + + private int externalOrderIdField; + + private bool externalOrderIdFieldSpecified; + + private string poNumberField; + + private string currencyCodeField; + + private long advertiserIdField; + + private bool advertiserIdFieldSpecified; + + private long[] advertiserContactIdsField; + + private long agencyIdField; + + private bool agencyIdFieldSpecified; + + private long[] agencyContactIdsField; + + private long creatorIdField; + + private bool creatorIdFieldSpecified; + + private long traffickerIdField; + + private bool traffickerIdFieldSpecified; + + private long[] secondaryTraffickerIdsField; + + private long salespersonIdField; + + private bool salespersonIdFieldSpecified; + + private long[] secondarySalespersonIdsField; + + private long totalImpressionsDeliveredField; + + private bool totalImpressionsDeliveredFieldSpecified; + + private long totalClicksDeliveredField; + + private bool totalClicksDeliveredFieldSpecified; + + private Money totalBudgetField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private string lastModifiedByAppField; + + private long[] appliedTeamIdsField; + + private DateTime lastModifiedDateTimeField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public OrderStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public int externalOrderId { + get { return this.externalOrderIdField; } + set { + this.externalOrderIdField = value; + this.externalOrderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool externalOrderIdSpecified { + get { return this.externalOrderIdFieldSpecified; } + set { this.externalOrderIdFieldSpecified = value; } + } + + public string poNumber { + get { return this.poNumberField; } + set { this.poNumberField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public long advertiserId { + get { return this.advertiserIdField; } + set { + this.advertiserIdField = value; + this.advertiserIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserIdSpecified { + get { return this.advertiserIdFieldSpecified; } + set { this.advertiserIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("advertiserContactIds")] + public long[] advertiserContactIds { + get { return this.advertiserContactIdsField; } + set { this.advertiserContactIdsField = value; } + } + + public long agencyId { + get { return this.agencyIdField; } + set { + this.agencyIdField = value; + this.agencyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool agencyIdSpecified { + get { return this.agencyIdFieldSpecified; } + set { this.agencyIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("agencyContactIds")] + public long[] agencyContactIds { + get { return this.agencyContactIdsField; } + set { this.agencyContactIdsField = value; } + } + + public long creatorId { + get { return this.creatorIdField; } + set { + this.creatorIdField = value; + this.creatorIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creatorIdSpecified { + get { return this.creatorIdFieldSpecified; } + set { this.creatorIdFieldSpecified = value; } + } + + public long traffickerId { + get { return this.traffickerIdField; } + set { + this.traffickerIdField = value; + this.traffickerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool traffickerIdSpecified { + get { return this.traffickerIdFieldSpecified; } + set { this.traffickerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryTraffickerIds")] + public long[] secondaryTraffickerIds { + get { return this.secondaryTraffickerIdsField; } + set { this.secondaryTraffickerIdsField = value; } + } + + public long salespersonId { + get { return this.salespersonIdField; } + set { + this.salespersonIdField = value; + this.salespersonIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool salespersonIdSpecified { + get { return this.salespersonIdFieldSpecified; } + set { this.salespersonIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondarySalespersonIds")] + public long[] secondarySalespersonIds { + get { return this.secondarySalespersonIdsField; } + set { this.secondarySalespersonIdsField = value; } + } + + public long totalImpressionsDelivered { + get { return this.totalImpressionsDeliveredField; } + set { + this.totalImpressionsDeliveredField = value; + this.totalImpressionsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalImpressionsDeliveredSpecified { + get { return this.totalImpressionsDeliveredFieldSpecified; } + set { this.totalImpressionsDeliveredFieldSpecified = value; } + } + + public long totalClicksDelivered { + get { return this.totalClicksDeliveredField; } + set { + this.totalClicksDeliveredField = value; + this.totalClicksDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalClicksDeliveredSpecified { + get { return this.totalClicksDeliveredFieldSpecified; } + set { this.totalClicksDeliveredFieldSpecified = value; } + } + + public Money totalBudget { + get { return this.totalBudgetField; } + set { this.totalBudgetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public string lastModifiedByApp { + get { return this.lastModifiedByAppField; } + set { this.lastModifiedByAppField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum OrderStatus { + DRAFT, + PENDING_APPROVAL, + APPROVED, + DISAPPROVED, + PAUSED, + CANCELED, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProposalServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProposalService : DfpSoapClient, IProposalService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProposalService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/ProposalService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Proposal createProposal(Proposal proposal) { + object[] results = this.Invoke("createProposal", new object[] { proposal }); + return ((Proposal) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Proposal[] createProposals([System.Xml.Serialization.XmlElementAttribute("proposals")] +Proposal[] proposals) { + object[] results = this.Invoke("createProposals", new object[] { proposals }); + return ((Proposal[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Proposal getProposal(long proposalId) { + object[] results = this.Invoke("getProposal", new object[] { proposalId }); + return ((Proposal) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalPage getProposalsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getProposalsByStatement", new object[] { filterStatement }); + return ((ProposalPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performProposalAction(ProposalAction proposalAction, Statement filterStatement) { + object[] results = this.Invoke("performProposalAction", new object[] { proposalAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Proposal updateProposal(Proposal proposal) { + object[] results = this.Invoke("updateProposal", new object[] { proposal }); + return ((Proposal) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Proposal[] updateProposals([System.Xml.Serialization.XmlElementAttribute("proposals")] +Proposal[] proposals) { + object[] results = this.Invoke("updateProposals", new object[] { proposals }); + return ((Proposal[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveProposals))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitProposalsForApproval))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RetractProposals))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RejectProposals))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveProposals))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveProposals))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class ProposalAction { + private string proposalActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProposalAction.Type")] + public string ProposalActionType { + get { return this.proposalActionTypeField; } + set { this.proposalActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class UnarchiveProposals : ProposalAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class SubmitProposalsForApproval : ProposalAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RetractProposals : ProposalAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RejectProposals : ProposalAction { + private long[] workflowActionIdsField; + + private string commentField; + + [System.Xml.Serialization.XmlElementAttribute("workflowActionIds")] + public long[] workflowActionIds { + get { return this.workflowActionIdsField; } + set { this.workflowActionIdsField = value; } + } + + public string comment { + get { return this.commentField; } + set { this.commentField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ArchiveProposals : ProposalAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ApproveProposals : ProposalAction { + private long[] workflowActionIdsField; + + [System.Xml.Serialization.XmlElementAttribute("workflowActionIds")] + public long[] workflowActionIds { + get { return this.workflowActionIdsField; } + set { this.workflowActionIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ProposalPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Proposal[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Proposal[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Proposal { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + private ProposalStatus statusField; + + private bool statusFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private ProposalCompanyAssociation advertiserField; + + private ProposalCompanyAssociation[] agenciesField; + + private int probabilityToCloseField; + + private bool probabilityToCloseFieldSpecified; + + private BillingCap billingCapField; + + private bool billingCapFieldSpecified; + + private BillingSchedule billingScheduleField; + + private bool billingScheduleFieldSpecified; + + private BillingSource billingSourceField; + + private bool billingSourceFieldSpecified; + + private string poNumberField; + + private string notesField; + + private Money budgetField; + + private SalespersonSplit primarySalespersonField; + + private SalespersonSplit[] secondarySalespeopleField; + + private long[] salesPlannerIdsField; + + private long primaryTraffickerIdField; + + private bool primaryTraffickerIdFieldSpecified; + + private long[] secondaryTraffickerIdsField; + + private long[] appliedTeamIdsField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private long advertiserDiscountField; + + private bool advertiserDiscountFieldSpecified; + + private long proposalDiscountField; + + private bool proposalDiscountFieldSpecified; + + private Money additionalAdjustmentField; + + private long exchangeRateField; + + private bool exchangeRateFieldSpecified; + + private bool refreshExchangeRateField; + + private bool refreshExchangeRateFieldSpecified; + + private long agencyCommissionField; + + private bool agencyCommissionFieldSpecified; + + private long valueAddedTaxField; + + private bool valueAddedTaxFieldSpecified; + + private long[] approvalWorkflowActionIdsField; + + private ProposalApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public ProposalStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public ProposalCompanyAssociation advertiser { + get { return this.advertiserField; } + set { this.advertiserField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("agencies")] + public ProposalCompanyAssociation[] agencies { + get { return this.agenciesField; } + set { this.agenciesField = value; } + } + + public int probabilityToClose { + get { return this.probabilityToCloseField; } + set { + this.probabilityToCloseField = value; + this.probabilityToCloseSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool probabilityToCloseSpecified { + get { return this.probabilityToCloseFieldSpecified; } + set { this.probabilityToCloseFieldSpecified = value; } + } + + public BillingCap billingCap { + get { return this.billingCapField; } + set { + this.billingCapField = value; + this.billingCapSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingCapSpecified { + get { return this.billingCapFieldSpecified; } + set { this.billingCapFieldSpecified = value; } + } + + public BillingSchedule billingSchedule { + get { return this.billingScheduleField; } + set { + this.billingScheduleField = value; + this.billingScheduleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingScheduleSpecified { + get { return this.billingScheduleFieldSpecified; } + set { this.billingScheduleFieldSpecified = value; } + } + + public BillingSource billingSource { + get { return this.billingSourceField; } + set { + this.billingSourceField = value; + this.billingSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingSourceSpecified { + get { return this.billingSourceFieldSpecified; } + set { this.billingSourceFieldSpecified = value; } + } + + public string poNumber { + get { return this.poNumberField; } + set { this.poNumberField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public Money budget { + get { return this.budgetField; } + set { this.budgetField = value; } + } + + public SalespersonSplit primarySalesperson { + get { return this.primarySalespersonField; } + set { this.primarySalespersonField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondarySalespeople")] + public SalespersonSplit[] secondarySalespeople { + get { return this.secondarySalespeopleField; } + set { this.secondarySalespeopleField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("salesPlannerIds")] + public long[] salesPlannerIds { + get { return this.salesPlannerIdsField; } + set { this.salesPlannerIdsField = value; } + } + + public long primaryTraffickerId { + get { return this.primaryTraffickerIdField; } + set { + this.primaryTraffickerIdField = value; + this.primaryTraffickerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool primaryTraffickerIdSpecified { + get { return this.primaryTraffickerIdFieldSpecified; } + set { this.primaryTraffickerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryTraffickerIds")] + public long[] secondaryTraffickerIds { + get { return this.secondaryTraffickerIdsField; } + set { this.secondaryTraffickerIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public long advertiserDiscount { + get { return this.advertiserDiscountField; } + set { + this.advertiserDiscountField = value; + this.advertiserDiscountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserDiscountSpecified { + get { return this.advertiserDiscountFieldSpecified; } + set { this.advertiserDiscountFieldSpecified = value; } + } + + public long proposalDiscount { + get { return this.proposalDiscountField; } + set { + this.proposalDiscountField = value; + this.proposalDiscountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool proposalDiscountSpecified { + get { return this.proposalDiscountFieldSpecified; } + set { this.proposalDiscountFieldSpecified = value; } + } + + public Money additionalAdjustment { + get { return this.additionalAdjustmentField; } + set { this.additionalAdjustmentField = value; } + } + + public long exchangeRate { + get { return this.exchangeRateField; } + set { + this.exchangeRateField = value; + this.exchangeRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool exchangeRateSpecified { + get { return this.exchangeRateFieldSpecified; } + set { this.exchangeRateFieldSpecified = value; } + } + + public bool refreshExchangeRate { + get { return this.refreshExchangeRateField; } + set { + this.refreshExchangeRateField = value; + this.refreshExchangeRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool refreshExchangeRateSpecified { + get { return this.refreshExchangeRateFieldSpecified; } + set { this.refreshExchangeRateFieldSpecified = value; } + } + + public long agencyCommission { + get { return this.agencyCommissionField; } + set { + this.agencyCommissionField = value; + this.agencyCommissionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool agencyCommissionSpecified { + get { return this.agencyCommissionFieldSpecified; } + set { this.agencyCommissionFieldSpecified = value; } + } + + public long valueAddedTax { + get { return this.valueAddedTaxField; } + set { + this.valueAddedTaxField = value; + this.valueAddedTaxSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueAddedTaxSpecified { + get { return this.valueAddedTaxFieldSpecified; } + set { this.valueAddedTaxFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("approvalWorkflowActionIds")] + public long[] approvalWorkflowActionIds { + get { return this.approvalWorkflowActionIdsField; } + set { this.approvalWorkflowActionIdsField = value; } + } + + public ProposalApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ProposalStatus { + DRAFT, + PENDING_APPROVAL, + APPROVED, + REJECTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ProposalCompanyAssociation { + private long companyIdField; + + private bool companyIdFieldSpecified; + + private ProposalCompanyAssociationType typeField; + + private bool typeFieldSpecified; + + private long[] contactIdsField; + + public long companyId { + get { return this.companyIdField; } + set { + this.companyIdField = value; + this.companyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companyIdSpecified { + get { return this.companyIdFieldSpecified; } + set { this.companyIdFieldSpecified = value; } + } + + public ProposalCompanyAssociationType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("contactIds")] + public long[] contactIds { + get { return this.contactIdsField; } + set { this.contactIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ProposalCompanyAssociationType { + PRIMARY_AGENCY, + BILLING_AGENCY, + BRANDING_AGENCY, + OTHER_AGENCY, + ADVERTISER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class SalespersonSplit { + private long userIdField; + + private bool userIdFieldSpecified; + + private int splitField; + + private bool splitFieldSpecified; + + public long userId { + get { return this.userIdField; } + set { + this.userIdField = value; + this.userIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userIdSpecified { + get { return this.userIdFieldSpecified; } + set { this.userIdFieldSpecified = value; } + } + + public int split { + get { return this.splitField; } + set { + this.splitField = value; + this.splitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool splitSpecified { + get { return this.splitFieldSpecified; } + set { this.splitFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ProposalApprovalStatus { + PENDING, + NON_PENDING, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class WorkflowActionError : ApiError { + private WorkflowActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public WorkflowActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "WorkflowActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum WorkflowActionErrorReason { + NOT_APPLICABLE, + WORKFLOW_DEFINITION_NOT_FOUND, + EMPTY_ACTION_LIST, + NOT_ACTION_APPROVER, + WORKFLOW_ALREADY_COMPLETED, + WORKFLOW_ALREADY_FAILED, + WORKFLOW_ALREADY_CANCELED, + ACTION_COMPLETED, + ACTION_FAILED, + ACTION_CANCELED, + ACTION_NOT_ACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ProposalActionError : ApiError { + private ProposalActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProposalActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProposalActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ProposalActionErrorReason { + NOT_APPLICABLE, + IS_ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeTemplateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeTemplateService : DfpSoapClient, ICreativeTemplateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeTemplateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/CreativeTemplateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeTemplate getCreativeTemplate(long creativeTemplateId) { + object[] results = this.Invoke("getCreativeTemplate", new object[] { creativeTemplateId }); + return ((CreativeTemplate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeTemplatePage getCreativeTemplatesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativeTemplatesByStatement", new object[] { filterStatement }); + return ((CreativeTemplatePage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CreativeTemplatePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeTemplate[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeTemplate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CreativeTemplate { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private CreativeTemplateVariable[] variablesField; + + private CreativeTemplateStatus statusField; + + private bool statusFieldSpecified; + + private CreativeTemplateType typeField; + + private bool typeFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("variables")] + public CreativeTemplateVariable[] variables { + get { return this.variablesField; } + set { this.variablesField = value; } + } + + public CreativeTemplateStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public CreativeTemplateType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UrlCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListStringCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetCreativeTemplateVariable))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class CreativeTemplateVariable { + private string labelField; + + private string uniqueNameField; + + private string descriptionField; + + private bool isRequiredField; + + private bool isRequiredFieldSpecified; + + private string creativeTemplateVariableTypeField; + + public string label { + get { return this.labelField; } + set { this.labelField = value; } + } + + public string uniqueName { + get { return this.uniqueNameField; } + set { this.uniqueNameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isRequired { + get { return this.isRequiredField; } + set { + this.isRequiredField = value; + this.isRequiredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isRequiredSpecified { + get { return this.isRequiredFieldSpecified; } + set { this.isRequiredFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("CreativeTemplateVariable.Type")] + public string CreativeTemplateVariableType { + get { return this.creativeTemplateVariableTypeField; } + set { this.creativeTemplateVariableTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class UrlCreativeTemplateVariable : CreativeTemplateVariable { + private string defaultValueField; + + public string defaultValue { + get { return this.defaultValueField; } + set { this.defaultValueField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListStringCreativeTemplateVariable))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class StringCreativeTemplateVariable : CreativeTemplateVariable { + private string defaultValueField; + + public string defaultValue { + get { return this.defaultValueField; } + set { this.defaultValueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ListStringCreativeTemplateVariable : StringCreativeTemplateVariable { + private ListStringCreativeTemplateVariableVariableChoice[] choicesField; + + private bool allowOtherChoiceField; + + private bool allowOtherChoiceFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("choices")] + public ListStringCreativeTemplateVariableVariableChoice[] choices { + get { return this.choicesField; } + set { this.choicesField = value; } + } + + public bool allowOtherChoice { + get { return this.allowOtherChoiceField; } + set { + this.allowOtherChoiceField = value; + this.allowOtherChoiceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowOtherChoiceSpecified { + get { return this.allowOtherChoiceFieldSpecified; } + set { this.allowOtherChoiceFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ListStringCreativeTemplateVariable.VariableChoice", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ListStringCreativeTemplateVariableVariableChoice { + private string labelField; + + private string valueField; + + public string label { + get { return this.labelField; } + set { this.labelField = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class LongCreativeTemplateVariable : CreativeTemplateVariable { + private long defaultValueField; + + private bool defaultValueFieldSpecified; + + public long defaultValue { + get { return this.defaultValueField; } + set { + this.defaultValueField = value; + this.defaultValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool defaultValueSpecified { + get { return this.defaultValueFieldSpecified; } + set { this.defaultValueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AssetCreativeTemplateVariable : CreativeTemplateVariable { + private AssetCreativeTemplateVariableMimeType[] mimeTypesField; + + [System.Xml.Serialization.XmlElementAttribute("mimeTypes")] + public AssetCreativeTemplateVariableMimeType[] mimeTypes { + get { return this.mimeTypesField; } + set { this.mimeTypesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AssetCreativeTemplateVariable.MimeType", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum AssetCreativeTemplateVariableMimeType { + JPG, + PNG, + GIF, + SWF + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CreativeTemplateStatus { + ACTIVE, + INACTIVE, + DELETED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CreativeTemplateType { + SYSTEM_DEFINED, + USER_DEFINED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CreativeTemplateError : ApiError { + private CreativeTemplateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeTemplateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeTemplateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CreativeTemplateErrorReason { + CANNOT_PARSE_CREATIVE_TEMPLATE, + VARIABLE_DUPLICATE_UNIQUE_NAME, + VARIABLE_INVALID_UNIQUE_NAME, + LIST_CHOICE_DUPLICATE_VALUE, + LIST_CHOICE_NEEDS_DEFAULT, + LIST_CHOICES_EMPTY, + NO_TARGET_PLATFORMS, + MULTIPLE_TARGET_PLATFORMS, + UNRECOGNIZED_PLACEHOLDER, + PLACEHOLDERS_NOT_IN_FORMATTER, + MISSING_INTERSTITIAL_MACRO, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Asset))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeService : DfpSoapClient, ICreativeService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/CreativeService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Creative createCreative(Creative creative) { + object[] results = this.Invoke("createCreative", new object[] { creative }); + return ((Creative) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Creative[] createCreatives([System.Xml.Serialization.XmlElementAttribute("creatives")] +Creative[] creatives) { + object[] results = this.Invoke("createCreatives", new object[] { creatives }); + return ((Creative[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Creative getCreative(long creativeId) { + object[] results = this.Invoke("getCreative", new object[] { creativeId }); + return ((Creative) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativePage getCreativesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativesByStatement", new object[] { filterStatement }); + return ((CreativePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Creative updateCreative(Creative creative) { + object[] results = this.Invoke("updateCreative", new object[] { creative }); + return ((Creative) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Creative[] updateCreatives([System.Xml.Serialization.XmlElementAttribute("creatives")] +Creative[] creatives) { + object[] results = this.Invoke("updateCreatives", new object[] { creatives }); + return ((Creative[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CreativePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Creative[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Creative[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VastRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnsupportedCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ThirdPartyCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TemplateCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InternalRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasDestinationUrlCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpMobileCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseVideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AspectRatioImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClickTrackingCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseRichMediaStudioCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasHtmlSnippetDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class Creative { + private long advertiserIdField; + + private bool advertiserIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private Size sizeField; + + private string previewUrlField; + + private AppliedLabel[] appliedLabelsField; + + private DateTime lastModifiedDateTimeField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private string creativeTypeField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { + this.advertiserIdField = value; + this.advertiserIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserIdSpecified { + get { return this.advertiserIdFieldSpecified; } + set { this.advertiserIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + public string previewUrl { + get { return this.previewUrlField; } + set { this.previewUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Creative.Type")] + public string CreativeType { + get { return this.creativeTypeField; } + set { this.creativeTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class VastRedirectCreative : Creative { + private string vastXmlUrlField; + + private VastRedirectType vastRedirectTypeField; + + private bool vastRedirectTypeFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string vastPreviewUrlField; + + public string vastXmlUrl { + get { return this.vastXmlUrlField; } + set { this.vastXmlUrlField = value; } + } + + public VastRedirectType vastRedirectType { + get { return this.vastRedirectTypeField; } + set { + this.vastRedirectTypeField = value; + this.vastRedirectTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool vastRedirectTypeSpecified { + get { return this.vastRedirectTypeFieldSpecified; } + set { this.vastRedirectTypeFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum VastRedirectType { + LINEAR, + NON_LINEAR, + LINEAR_AND_NON_LINEAR + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ConversionEvent_TrackingUrlsMapEntry { + private ConversionEvent keyField; + + private bool keyFieldSpecified; + + private string[] valueField; + + public ConversionEvent key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("urls", IsNullable = false)] + public string[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ConversionEvent { + CREATIVE_VIEW, + START, + SKIP_SHOWN, + FIRST_QUARTILE, + MIDPOINT, + THIRD_QUARTILE, + ENGAGED_VIEW, + COMPLETE, + MUTE, + UNMUTE, + PAUSE, + REWIND, + RESUME, + SKIPPED, + FULLSCREEN, + EXPAND, + COLLAPSE, + ACCEPT_INVITATION, + CLOSE, + CLICK_TRACKING, + SURVEY, + CUSTOM_CLICK + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class UnsupportedCreative : Creative { + private string unsupportedCreativeTypeField; + + public string unsupportedCreativeType { + get { return this.unsupportedCreativeTypeField; } + set { this.unsupportedCreativeTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ThirdPartyCreative : Creative { + private string snippetField; + + private string expandedSnippetField; + + public string snippet { + get { return this.snippetField; } + set { this.snippetField = value; } + } + + public string expandedSnippet { + get { return this.expandedSnippetField; } + set { this.expandedSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class TemplateCreative : Creative { + private long creativeTemplateIdField; + + private bool creativeTemplateIdFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + private string destinationUrlField; + + private BaseCreativeTemplateVariableValue[] creativeTemplateVariableValuesField; + + public long creativeTemplateId { + get { return this.creativeTemplateIdField; } + set { + this.creativeTemplateIdField = value; + this.creativeTemplateIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeTemplateIdSpecified { + get { return this.creativeTemplateIdFieldSpecified; } + set { this.creativeTemplateIdFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativeTemplateVariableValues")] + public BaseCreativeTemplateVariableValue[] creativeTemplateVariableValues { + get { return this.creativeTemplateVariableValuesField; } + set { this.creativeTemplateVariableValuesField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UrlCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetCreativeTemplateVariableValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class BaseCreativeTemplateVariableValue { + private string uniqueNameField; + + private string baseCreativeTemplateVariableValueTypeField; + + public string uniqueName { + get { return this.uniqueNameField; } + set { this.uniqueNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseCreativeTemplateVariableValue.Type")] + public string BaseCreativeTemplateVariableValueType { + get { return this.baseCreativeTemplateVariableValueTypeField; } + set { this.baseCreativeTemplateVariableValueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class UrlCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class StringCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class LongCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private long valueField; + + private bool valueFieldSpecified; + + public long value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AssetCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class LegacyDfpCreative : Creative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class InternalRedirectCreative : Creative { + private Size assetSizeField; + + private string internalRedirectUrlField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public Size assetSize { + get { return this.assetSizeField; } + set { this.assetSizeField = value; } + } + + public string internalRedirectUrl { + get { return this.internalRedirectUrlField; } + set { this.internalRedirectUrlField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpMobileCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseVideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AspectRatioImageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class HasDestinationUrlCreative : Creative { + private string destinationUrlField; + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class VpaidLinearRedirectCreative : HasDestinationUrlCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + private string flashUrlField; + + private Size flashAssetSizeField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string flashUrl { + get { return this.flashUrlField; } + set { this.flashUrlField = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class VpaidLinearCreative : HasDestinationUrlCreative { + private string flashNameField; + + private byte[] flashByteArrayField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private Size flashAssetSizeField; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + private string vastPreviewUrlField; + + public string flashName { + get { return this.flashNameField; } + set { this.flashNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] flashByteArray { + get { return this.flashByteArrayField; } + set { this.flashByteArrayField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class LegacyDfpMobileCreative : HasDestinationUrlCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CustomCreative : HasDestinationUrlCreative { + private string htmlSnippetField; + + private CustomCreativeAsset[] customCreativeAssetsField; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public string htmlSnippet { + get { return this.htmlSnippetField; } + set { this.htmlSnippetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customCreativeAssets")] + public CustomCreativeAsset[] customCreativeAssets { + get { return this.customCreativeAssetsField; } + set { this.customCreativeAssetsField = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CustomCreativeAsset { + private string macroNameField; + + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + private long fileSizeField; + + private bool fileSizeFieldSpecified; + + public string macroName { + get { return this.macroNameField; } + set { this.macroNameField = value; } + } + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public long fileSize { + get { return this.fileSizeField; } + set { + this.fileSizeField = value; + this.fileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fileSizeSpecified { + get { return this.fileSizeFieldSpecified; } + set { this.fileSizeFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class BaseVideoCreative : HasDestinationUrlCreative { + private int durationField; + + private bool durationFieldSpecified; + + private bool allowDurationOverrideField; + + private bool allowDurationOverrideFieldSpecified; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private long[] companionCreativeIdsField; + + private string customParametersField; + + private string vastPreviewUrlField; + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public bool allowDurationOverride { + get { return this.allowDurationOverrideField; } + set { + this.allowDurationOverrideField = value; + this.allowDurationOverrideSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowDurationOverrideSpecified { + get { return this.allowDurationOverrideFieldSpecified; } + set { this.allowDurationOverrideFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class VideoRedirectCreative : BaseVideoCreative { + private VideoRedirectAsset[] videoAssetsField; + + [System.Xml.Serialization.XmlElementAttribute("videoAssets")] + public VideoRedirectAsset[] videoAssets { + get { return this.videoAssetsField; } + set { this.videoAssetsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class VideoRedirectAsset : RedirectAsset { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class RedirectAsset : Asset { + private string redirectUrlField; + + public string redirectUrl { + get { return this.redirectUrlField; } + set { this.redirectUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RedirectAsset))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class Asset { + private string assetTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Asset.Type")] + public string AssetType { + get { return this.assetTypeField; } + set { this.assetTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class VideoCreative : BaseVideoCreative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class BaseImageRedirectCreative : HasDestinationUrlCreative { + private string imageUrlField; + + public string imageUrl { + get { return this.imageUrlField; } + set { this.imageUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ImageRedirectOverlayCreative : BaseImageRedirectCreative { + private Size assetSizeField; + + private int durationField; + + private bool durationFieldSpecified; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private string vastPreviewUrlField; + + public Size assetSize { + get { return this.assetSizeField; } + set { this.assetSizeField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ImageRedirectCreative : BaseImageRedirectCreative { + private string altTextField; + + private string thirdPartyImpressionUrlField; + + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + public string thirdPartyImpressionUrl { + get { return this.thirdPartyImpressionUrlField; } + set { this.thirdPartyImpressionUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class BaseImageCreative : HasDestinationUrlCreative { + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private CreativeAsset primaryImageAssetField; + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public CreativeAsset primaryImageAsset { + get { return this.primaryImageAssetField; } + set { this.primaryImageAssetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CreativeAsset { + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + private long fileSizeField; + + private bool fileSizeFieldSpecified; + + private string assetUrlField; + + private Size sizeField; + + private ImageDensity imageDensityField; + + private bool imageDensityFieldSpecified; + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public long fileSize { + get { return this.fileSizeField; } + set { + this.fileSizeField = value; + this.fileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fileSizeSpecified { + get { return this.fileSizeFieldSpecified; } + set { this.fileSizeFieldSpecified = value; } + } + + public string assetUrl { + get { return this.assetUrlField; } + set { this.assetUrlField = value; } + } + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + public ImageDensity imageDensity { + get { return this.imageDensityField; } + set { + this.imageDensityField = value; + this.imageDensitySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool imageDensitySpecified { + get { return this.imageDensityFieldSpecified; } + set { this.imageDensityFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ImageDensity { + ONE_TO_ONE, + THREE_TO_TWO, + TWO_TO_ONE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ImageOverlayCreative : BaseImageCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + private string vastPreviewUrlField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ImageCreative : BaseImageCreative { + private string altTextField; + + private string thirdPartyImpressionUrlField; + + private CreativeAsset[] secondaryImageAssetsField; + + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + public string thirdPartyImpressionUrl { + get { return this.thirdPartyImpressionUrlField; } + set { this.thirdPartyImpressionUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryImageAssets")] + public CreativeAsset[] secondaryImageAssets { + get { return this.secondaryImageAssetsField; } + set { this.secondaryImageAssetsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class BaseFlashRedirectCreative : HasDestinationUrlCreative { + private string flashUrlField; + + private string fallbackUrlField; + + private string fallbackPreviewUrlField; + + public string flashUrl { + get { return this.flashUrlField; } + set { this.flashUrlField = value; } + } + + public string fallbackUrl { + get { return this.fallbackUrlField; } + set { this.fallbackUrlField = value; } + } + + public string fallbackPreviewUrl { + get { return this.fallbackPreviewUrlField; } + set { this.fallbackPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class FlashRedirectOverlayCreative : BaseFlashRedirectCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private ApiFramework apiFrameworkField; + + private bool apiFrameworkFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + private Size flashAssetSizeField; + + private string vastPreviewUrlField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public ApiFramework apiFramework { + get { return this.apiFrameworkField; } + set { + this.apiFrameworkField = value; + this.apiFrameworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool apiFrameworkSpecified { + get { return this.apiFrameworkFieldSpecified; } + set { this.apiFrameworkFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ApiFramework { + NONE, + CLICKTAG, + VPAID + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class FlashRedirectCreative : BaseFlashRedirectCreative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class BaseFlashCreative : HasDestinationUrlCreative { + private string flashNameField; + + private byte[] flashByteArrayField; + + private string fallbackImageNameField; + + private byte[] fallbackImageByteArrayField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private bool clickTagRequiredField; + + private bool clickTagRequiredFieldSpecified; + + private string fallbackPreviewUrlField; + + private Size flashAssetSizeField; + + private Size fallbackAssetSizeField; + + public string flashName { + get { return this.flashNameField; } + set { this.flashNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] flashByteArray { + get { return this.flashByteArrayField; } + set { this.flashByteArrayField = value; } + } + + public string fallbackImageName { + get { return this.fallbackImageNameField; } + set { this.fallbackImageNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] fallbackImageByteArray { + get { return this.fallbackImageByteArrayField; } + set { this.fallbackImageByteArrayField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public bool clickTagRequired { + get { return this.clickTagRequiredField; } + set { + this.clickTagRequiredField = value; + this.clickTagRequiredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clickTagRequiredSpecified { + get { return this.clickTagRequiredFieldSpecified; } + set { this.clickTagRequiredFieldSpecified = value; } + } + + public string fallbackPreviewUrl { + get { return this.fallbackPreviewUrlField; } + set { this.fallbackPreviewUrlField = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + public Size fallbackAssetSize { + get { return this.fallbackAssetSizeField; } + set { this.fallbackAssetSizeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class FlashOverlayCreative : BaseFlashCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private ApiFramework apiFrameworkField; + + private bool apiFrameworkFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + private string vastPreviewUrlField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public ApiFramework apiFramework { + get { return this.apiFrameworkField; } + set { + this.apiFrameworkField = value; + this.apiFrameworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool apiFrameworkSpecified { + get { return this.apiFrameworkFieldSpecified; } + set { this.apiFrameworkFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class FlashCreative : BaseFlashCreative { + private SwiffyFallbackAsset swiffyAssetField; + + private bool createSwiffyAssetField; + + private bool createSwiffyAssetFieldSpecified; + + public SwiffyFallbackAsset swiffyAsset { + get { return this.swiffyAssetField; } + set { this.swiffyAssetField = value; } + } + + public bool createSwiffyAsset { + get { return this.createSwiffyAssetField; } + set { + this.createSwiffyAssetField = value; + this.createSwiffyAssetSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool createSwiffyAssetSpecified { + get { return this.createSwiffyAssetFieldSpecified; } + set { this.createSwiffyAssetFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class SwiffyFallbackAsset { + private CreativeAsset assetField; + + private Html5Feature[] html5FeaturesField; + + private string[] localizedInfoMessagesField; + + public CreativeAsset asset { + get { return this.assetField; } + set { this.assetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("html5Features")] + public Html5Feature[] html5Features { + get { return this.html5FeaturesField; } + set { this.html5FeaturesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("localizedInfoMessages")] + public string[] localizedInfoMessages { + get { return this.localizedInfoMessagesField; } + set { this.localizedInfoMessagesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum Html5Feature { + BASIC_SVG, + SVG_FILTERS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AspectRatioImageCreative : HasDestinationUrlCreative { + private CreativeAsset[] imageAssetsField; + + private string altTextField; + + private string thirdPartyImpressionUrlField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("imageAssets")] + public CreativeAsset[] imageAssets { + get { return this.imageAssetsField; } + set { this.imageAssetsField = value; } + } + + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + public string thirdPartyImpressionUrl { + get { return this.thirdPartyImpressionUrlField; } + set { this.thirdPartyImpressionUrlField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ClickTrackingCreative : Creative { + private string clickTrackingUrlField; + + public string clickTrackingUrl { + get { return this.clickTrackingUrlField; } + set { this.clickTrackingUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class BaseRichMediaStudioCreative : Creative { + private long studioCreativeIdField; + + private bool studioCreativeIdFieldSpecified; + + private RichMediaStudioCreativeFormat creativeFormatField; + + private bool creativeFormatFieldSpecified; + + private RichMediaStudioCreativeArtworkType artworkTypeField; + + private bool artworkTypeFieldSpecified; + + private long totalFileSizeField; + + private bool totalFileSizeFieldSpecified; + + private string[] adTagKeysField; + + private string[] customKeyValuesField; + + private string surveyUrlField; + + private string allImpressionsUrlField; + + private string richMediaImpressionsUrlField; + + private string backupImageImpressionsUrlField; + + private string overrideCssField; + + private string requiredFlashPluginVersionField; + + private int durationField; + + private bool durationFieldSpecified; + + private RichMediaStudioCreativeBillingAttribute billingAttributeField; + + private bool billingAttributeFieldSpecified; + + private RichMediaStudioChildAssetProperty[] richMediaStudioChildAssetPropertiesField; + + public long studioCreativeId { + get { return this.studioCreativeIdField; } + set { + this.studioCreativeIdField = value; + this.studioCreativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool studioCreativeIdSpecified { + get { return this.studioCreativeIdFieldSpecified; } + set { this.studioCreativeIdFieldSpecified = value; } + } + + public RichMediaStudioCreativeFormat creativeFormat { + get { return this.creativeFormatField; } + set { + this.creativeFormatField = value; + this.creativeFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeFormatSpecified { + get { return this.creativeFormatFieldSpecified; } + set { this.creativeFormatFieldSpecified = value; } + } + + public RichMediaStudioCreativeArtworkType artworkType { + get { return this.artworkTypeField; } + set { + this.artworkTypeField = value; + this.artworkTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool artworkTypeSpecified { + get { return this.artworkTypeFieldSpecified; } + set { this.artworkTypeFieldSpecified = value; } + } + + public long totalFileSize { + get { return this.totalFileSizeField; } + set { + this.totalFileSizeField = value; + this.totalFileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalFileSizeSpecified { + get { return this.totalFileSizeFieldSpecified; } + set { this.totalFileSizeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adTagKeys")] + public string[] adTagKeys { + get { return this.adTagKeysField; } + set { this.adTagKeysField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customKeyValues")] + public string[] customKeyValues { + get { return this.customKeyValuesField; } + set { this.customKeyValuesField = value; } + } + + public string surveyUrl { + get { return this.surveyUrlField; } + set { this.surveyUrlField = value; } + } + + public string allImpressionsUrl { + get { return this.allImpressionsUrlField; } + set { this.allImpressionsUrlField = value; } + } + + public string richMediaImpressionsUrl { + get { return this.richMediaImpressionsUrlField; } + set { this.richMediaImpressionsUrlField = value; } + } + + public string backupImageImpressionsUrl { + get { return this.backupImageImpressionsUrlField; } + set { this.backupImageImpressionsUrlField = value; } + } + + public string overrideCss { + get { return this.overrideCssField; } + set { this.overrideCssField = value; } + } + + public string requiredFlashPluginVersion { + get { return this.requiredFlashPluginVersionField; } + set { this.requiredFlashPluginVersionField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public RichMediaStudioCreativeBillingAttribute billingAttribute { + get { return this.billingAttributeField; } + set { + this.billingAttributeField = value; + this.billingAttributeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingAttributeSpecified { + get { return this.billingAttributeFieldSpecified; } + set { this.billingAttributeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("richMediaStudioChildAssetProperties")] + public RichMediaStudioChildAssetProperty[] richMediaStudioChildAssetProperties { + get { return this.richMediaStudioChildAssetPropertiesField; } + set { this.richMediaStudioChildAssetPropertiesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum RichMediaStudioCreativeFormat { + IN_PAGE, + EXPANDING, + IM_EXPANDING, + FLOATING, + PEEL_DOWN, + IN_PAGE_WITH_FLOATING, + FLASH_IN_FLASH, + FLASH_IN_FLASH_EXPANDING, + IN_APP, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum RichMediaStudioCreativeArtworkType { + FLASH, + HTML5, + MIXED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum RichMediaStudioCreativeBillingAttribute { + IN_PAGE, + FLOATING_EXPANDING, + VIDEO, + FLASH_IN_FLASH + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RichMediaStudioChildAssetProperty { + private string nameField; + + private RichMediaStudioChildAssetPropertyType typeField; + + private bool typeFieldSpecified; + + private long totalFileSizeField; + + private bool totalFileSizeFieldSpecified; + + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + private string urlField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public RichMediaStudioChildAssetPropertyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public long totalFileSize { + get { return this.totalFileSizeField; } + set { + this.totalFileSizeField = value; + this.totalFileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalFileSizeSpecified { + get { return this.totalFileSizeFieldSpecified; } + set { this.totalFileSizeFieldSpecified = value; } + } + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaStudioChildAssetProperty.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum RichMediaStudioChildAssetPropertyType { + FLASH, + VIDEO, + IMAGE, + DATA + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class RichMediaStudioCreative : BaseRichMediaStudioCreative { + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasHtmlSnippetDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class BaseDynamicAllocationCreative : Creative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class HasHtmlSnippetDynamicAllocationCreative : BaseDynamicAllocationCreative { + private string codeSnippetField; + + public string codeSnippet { + get { return this.codeSnippetField; } + set { this.codeSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AdSenseCreative : HasHtmlSnippetDynamicAllocationCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class AdExchangeCreative : HasHtmlSnippetDynamicAllocationCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ContactServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseContact))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ContactService : DfpSoapClient, IContactService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ContactService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/ContactService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Contact createContact(Contact contact) { + object[] results = this.Invoke("createContact", new object[] { contact }); + return ((Contact) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Contact[] createContacts([System.Xml.Serialization.XmlElementAttribute("contacts")] +Contact[] contacts) { + object[] results = this.Invoke("createContacts", new object[] { contacts }); + return ((Contact[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Contact getContact(long contactId) { + object[] results = this.Invoke("getContact", new object[] { contactId }); + return ((Contact) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContactPage getContactsByStatement(Statement statement) { + object[] results = this.Invoke("getContactsByStatement", new object[] { statement }); + return ((ContactPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Contact updateContact(Contact contact) { + object[] results = this.Invoke("updateContact", new object[] { contact }); + return ((Contact) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Contact[] updateContacts([System.Xml.Serialization.XmlElementAttribute("contacts")] +Contact[] contacts) { + object[] results = this.Invoke("updateContacts", new object[] { contacts }); + return ((Contact[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ContactPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Contact[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Contact[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class Contact : BaseContact { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private long companyIdField; + + private bool companyIdFieldSpecified; + + private ContactStatus statusField; + + private bool statusFieldSpecified; + + private string addressField; + + private string cellPhoneField; + + private string commentField; + + private string emailField; + + private string faxPhoneField; + + private string titleField; + + private string workPhoneField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public long companyId { + get { return this.companyIdField; } + set { + this.companyIdField = value; + this.companyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companyIdSpecified { + get { return this.companyIdFieldSpecified; } + set { this.companyIdFieldSpecified = value; } + } + + public ContactStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string address { + get { return this.addressField; } + set { this.addressField = value; } + } + + public string cellPhone { + get { return this.cellPhoneField; } + set { this.cellPhoneField = value; } + } + + public string comment { + get { return this.commentField; } + set { this.commentField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public string faxPhone { + get { return this.faxPhoneField; } + set { this.faxPhoneField = value; } + } + + public string title { + get { return this.titleField; } + set { this.titleField = value; } + } + + public string workPhone { + get { return this.workPhoneField; } + set { this.workPhoneField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Contact.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ContactStatus { + UNINVITED, + INVITE_PENDNG, + INVITE_EXPIRED, + INVITE_CANCELED, + USER_ACTIVE, + USER_DISABLED, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Contact))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class BaseContact { + private string baseContactTypeField; + + [System.Xml.Serialization.XmlElementAttribute("BaseContact.Type")] + public string BaseContactType { + get { return this.baseContactTypeField; } + set { this.baseContactTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class ContactError : ApiError { + private ContactErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ContactErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ContactError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum ContactErrorReason { + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomTargetingServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomTargetingService : DfpSoapClient, ICustomTargetingService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomTargetingService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201306/CustomTargetingService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingKey[] createCustomTargetingKeys([System.Xml.Serialization.XmlElementAttribute("keys")] +CustomTargetingKey[] keys) { + object[] results = this.Invoke("createCustomTargetingKeys", new object[] { keys }); + return ((CustomTargetingKey[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingValue[] createCustomTargetingValues([System.Xml.Serialization.XmlElementAttribute("values")] +CustomTargetingValue[] values) { + object[] results = this.Invoke("createCustomTargetingValues", new object[] { values }); + return ((CustomTargetingValue[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingKeyPage getCustomTargetingKeysByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomTargetingKeysByStatement", new object[] { filterStatement }); + return ((CustomTargetingKeyPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingValuePage getCustomTargetingValuesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomTargetingValuesByStatement", new object[] { filterStatement }); + return ((CustomTargetingValuePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performCustomTargetingKeyAction(CustomTargetingKeyAction customTargetingKeyAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomTargetingKeyAction", new object[] { customTargetingKeyAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performCustomTargetingValueAction(CustomTargetingValueAction customTargetingValueAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomTargetingValueAction", new object[] { customTargetingValueAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingKey[] updateCustomTargetingKeys([System.Xml.Serialization.XmlElementAttribute("keys")] +CustomTargetingKey[] keys) { + object[] results = this.Invoke("updateCustomTargetingKeys", new object[] { keys }); + return ((CustomTargetingKey[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201306", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201306", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingValue[] updateCustomTargetingValues([System.Xml.Serialization.XmlElementAttribute("values")] +CustomTargetingValue[] values) { + object[] results = this.Invoke("updateCustomTargetingValues", new object[] { values }); + return ((CustomTargetingValue[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteCustomTargetingValues))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class CustomTargetingValueAction { + private string customTargetingValueActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomTargetingValueAction.Type")] + public string CustomTargetingValueActionType { + get { return this.customTargetingValueActionTypeField; } + set { this.customTargetingValueActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeleteCustomTargetingValues : CustomTargetingValueAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteCustomTargetingKeys))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public abstract partial class CustomTargetingKeyAction { + private string customTargetingKeyActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomTargetingKeyAction.Type")] + public string CustomTargetingKeyActionType { + get { return this.customTargetingKeyActionTypeField; } + set { this.customTargetingKeyActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class DeleteCustomTargetingKeys : CustomTargetingKeyAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CustomTargetingValuePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomTargetingValue[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomTargetingValue[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CustomTargetingValue { + private long customTargetingKeyIdField; + + private bool customTargetingKeyIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string displayNameField; + + private CustomTargetingValueMatchType matchTypeField; + + private bool matchTypeFieldSpecified; + + public long customTargetingKeyId { + get { return this.customTargetingKeyIdField; } + set { + this.customTargetingKeyIdField = value; + this.customTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customTargetingKeyIdSpecified { + get { return this.customTargetingKeyIdFieldSpecified; } + set { this.customTargetingKeyIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public CustomTargetingValueMatchType matchType { + get { return this.matchTypeField; } + set { + this.matchTypeField = value; + this.matchTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool matchTypeSpecified { + get { return this.matchTypeFieldSpecified; } + set { this.matchTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingValue.MatchType", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CustomTargetingValueMatchType { + EXACT, + BROAD, + PREFIX, + BROAD_PREFIX + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CustomTargetingKeyPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomTargetingKey[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomTargetingKey[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public partial class CustomTargetingKey { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string displayNameField; + + private CustomTargetingKeyType typeField; + + private bool typeFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public CustomTargetingKeyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingKey.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201306")] + public enum CustomTargetingKeyType { + PREDEFINED, + FREEFORM + } + public interface IAudienceSegmentService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AudienceSegmentPage getAudienceSegmentsByStatement(Statement filterStatement); + } + public interface ISuggestedAdUnitService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + SuggestedAdUnit getSuggestedAdUnit(string suggestedAdUnitId); + SuggestedAdUnitPage getSuggestedAdUnitsByStatement(Statement filterStatement); + SuggestedAdUnitUpdateResult performSuggestedAdUnitAction(SuggestedAdUnitAction suggestedAdUnitAction, Statement filterStatement); + } + public interface ILabelService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Label createLabel(Label label); + Label[] createLabels(Label[] labels); + Label getLabel(long labelId); + LabelPage getLabelsByStatement(Statement filterStatement); + UpdateResult performLabelAction(LabelAction labelAction, Statement filterStatement); + Label updateLabel(Label label); + Label[] updateLabels(Label[] labels); + } + public interface ICompanyService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Company[] createCompanies(Company[] companies); + Company createCompany(Company company); + CompanyPage getCompaniesByStatement(Statement filterStatement); + Company getCompany(long companyId); + Company[] updateCompanies(Company[] companies); + Company updateCompany(Company company); + } + public interface IAdRuleService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdRule createAdRule(AdRule adRule); + AdRule[] createAdRules(AdRule[] adRules); + AdRule getAdRule(int adRuleId); + AdRulePage getAdRulesByStatement(Statement statement); + UpdateResult performAdRuleAction(AdRuleAction adRuleAction, Statement filterStatement); + AdRule updateAdRule(AdRule adRule); + AdRule[] updateAdRules(AdRule[] adRules); + } + public interface IWorkflowActionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + WorkflowAction getWorkflowAction(long workflowActionId); + WorkflowActionPage getWorkflowActionsByStatement(Statement filterStatement); + } + public interface INetworkService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Network[] getAllNetworks(); + Network getCurrentNetwork(); + Network makeTestNetwork(); + Network updateNetwork(Network network); + } + public interface IReconciliationReportService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ReconciliationReport getReconciliationReport(long reconciliationReportId); + ReconciliationReportPage getReconciliationReportsByStatement(Statement filterStatement); + ReconciliationReport updateReconciliationReport(ReconciliationReport reconciliationReport); + ReconciliationReport[] updateReconciliationReports(ReconciliationReport[] reconciliationReports); + } + public interface ICreativeWrapperService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CreativeWrapper createCreativeWrapper(CreativeWrapper creativeWrapper); + CreativeWrapper[] createCreativeWrappers(CreativeWrapper[] creativeWrappers); + CreativeWrapper getCreativeWrapper(long creativeWrapperId); + CreativeWrapperPage getCreativeWrappersByStatement(Statement filterStatement); + UpdateResult performCreativeWrapperAction(CreativeWrapperAction creativeWrapperAction, Statement filterStatement); + CreativeWrapper updateCreativeWrapper(CreativeWrapper creativeWrapper); + CreativeWrapper[] updateCreativeWrappers(CreativeWrapper[] creativeWrappers); + } + public interface IContentService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ContentPage getContentByStatement(Statement statement); + ContentPage getContentByStatementAndCustomTargetingValue(Statement filterStatement, long customTargetingValueId); + } + public interface ICustomFieldService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CustomField createCustomField(CustomField customField); + CustomFieldOption createCustomFieldOption(CustomFieldOption customFieldOption); + CustomFieldOption[] createCustomFieldOptions(CustomFieldOption[] customFieldOptions); + CustomField[] createCustomFields(CustomField[] customFields); + CustomField getCustomField(long customFieldId); + CustomFieldOption getCustomFieldOption(long customFieldOptionId); + CustomFieldPage getCustomFieldsByStatement(Statement filterStatement); + UpdateResult performCustomFieldAction(CustomFieldAction customFieldAction, Statement filterStatement); + CustomField updateCustomField(CustomField customField); + CustomFieldOption updateCustomFieldOption(CustomFieldOption customFieldOption); + CustomFieldOption[] updateCustomFieldOptions(CustomFieldOption[] customFieldOptions); + CustomField[] updateCustomFields(CustomField[] customFields); + } + public interface IProposalLineItemService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ProposalLineItem createProposalLineItem(ProposalLineItem proposalLineItem); + ProposalLineItem[] createProposalLineItems(ProposalLineItem[] proposalLineItems); + ProposalLineItem getProposalLineItem(long proposalLineItemId); + ProposalLineItemPage getProposalLineItemsByStatement(Statement filterStatement); + UpdateResult performProposalLineItemAction(ProposalLineItemAction proposalLineItemAction, Statement filterStatement); + ProposalLineItem updateProposalLineItem(ProposalLineItem proposalLineItem); + ProposalLineItem[] updateProposalLineItems(ProposalLineItem[] proposalLineItems); + } + public interface IReportService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + string getReportDownloadURL(long reportJobId, ExportFormat exportFormat); + string getReportDownloadUrlWithOptions(long reportJobId, ReportDownloadOptions reportDownloadOptions); + ReportJob getReportJob(long reportJobId); + ReportJob runReportJob(ReportJob reportJob); + } + public interface IActivityGroupService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ActivityGroup createActivityGroup(ActivityGroup activityGroup); + ActivityGroup[] createActivityGroups(ActivityGroup[] activityGroups); + ActivityGroup getActivityGroup(int activityGroupId); + ActivityGroupPage getActivityGroupsByStatement(Statement filterStatement); + ActivityGroup updateActivityGroup(ActivityGroup activityGroup); + ActivityGroup[] updateActivityGroups(ActivityGroup[] activityGroups); + } + public interface ILineItemService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + LineItem createLineItem(LineItem lineItem); + LineItem[] createLineItems(LineItem[] lineItems); + LineItem getLineItem(long lineItemId); + LineItemPage getLineItemsByStatement(Statement filterStatement); + UpdateResult performLineItemAction(LineItemAction lineItemAction, Statement filterStatement); + LineItem updateLineItem(LineItem lineItem); + LineItem[] updateLineItems(LineItem[] lineItems); + } + public interface ILineItemTemplateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + LineItemTemplatePage getLineItemTemplatesByStatement(Statement filterStatement); + } + public interface IUserTeamAssociationService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + UserTeamAssociation createUserTeamAssociation(UserTeamAssociation userTeamAssociation); + UserTeamAssociation[] createUserTeamAssociations(UserTeamAssociation[] userTeamAssociations); + UserTeamAssociation getUserTeamAssociation(long teamId, long userId); + UserTeamAssociationPage getUserTeamAssociationsByStatement(Statement filterStatement); + UpdateResult performUserTeamAssociationAction(UserTeamAssociationAction userTeamAssociationAction, Statement statement); + UserTeamAssociation updateUserTeamAssociation(UserTeamAssociation userTeamAssociation); + UserTeamAssociation[] updateUserTeamAssociations(UserTeamAssociation[] userTeamAssociations); + } + public interface ILineItemCreativeAssociationService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + LineItemCreativeAssociation createLineItemCreativeAssociation(LineItemCreativeAssociation lineItemCreativeAssociation); + LineItemCreativeAssociation[] createLineItemCreativeAssociations(LineItemCreativeAssociation[] lineItemCreativeAssociations); + LineItemCreativeAssociation getLineItemCreativeAssociation(long lineItemId, long creativeId); + LineItemCreativeAssociationPage getLineItemCreativeAssociationsByStatement(Statement filterStatement); + string getPreviewUrl(long lineItemId, long creativeId, string siteUrl); + UpdateResult performLineItemCreativeAssociationAction(LineItemCreativeAssociationAction lineItemCreativeAssociationAction, Statement filterStatement); + LineItemCreativeAssociation updateLineItemCreativeAssociation(LineItemCreativeAssociation lineItemCreativeAssociation); + LineItemCreativeAssociation[] updateLineItemCreativeAssociations(LineItemCreativeAssociation[] lineItemCreativeAssociations); + } + public interface IProductService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Product getProduct(string productId); + ProductPage getProductsByStatement(Statement statement); + UpdateResult performProductAction(ProductAction productAction, Statement filterStatement); + Product updateProduct(Product product); + Product[] updateProducts(Product[] products); + } + public interface IReconciliationReportRowService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ReconciliationReportRowPage getReconciliationReportRowsByStatement(Statement filterStatement); + ReconciliationReportRow[] updateReconciliationReportRows(ReconciliationReportRow[] reconciliationReportRows); + } + public interface IRateCardCustomizationService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + RateCardCustomization createRateCardCustomization(RateCardCustomization rateCardCustomization); + RateCardCustomization[] createRateCardCustomizations(RateCardCustomization[] rateCardCustomizations); + RateCardCustomization getRateCardCustomization(long rateCardCustomizationId); + RateCardCustomizationPage getRateCardCustomizationsByStatement(Statement filterStatement); + UpdateResult performRateCardCustomizationAction(RateCardCustomizationAction rateCardCustomizationAction, Statement filterStatement); + RateCardCustomization updateRateCardCustomization(RateCardCustomization rateCardCustomization); + RateCardCustomization[] updateRateCardCustomizations(RateCardCustomization[] rateCardCustomizations); + } + public interface ICreativeSetService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CreativeSet createCreativeSet(CreativeSet creativeSet); + CreativeSet getCreativeSet(long creativeSetId); + CreativeSetPage getCreativeSetsByStatement(Statement statement); + CreativeSet updateCreativeSet(CreativeSet creativeSet); + } + public interface IBaseRateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + BaseRate createBaseRate(BaseRate baseRate); + BaseRate[] createBaseRates(BaseRate[] baseRates); + BaseRate getBaseRate(long baseRateId); + BaseRatePage getBaseRatesByStatement(Statement filterStatement); + UpdateResult performBaseRateAction(BaseRateAction baseRateAction, Statement filterStatement); + BaseRate updateBaseRate(BaseRate baseRate); + BaseRate[] updateBaseRates(BaseRate[] baseRates); + } + public interface IInventoryService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdUnit createAdUnit(AdUnit adUnit); + AdUnit[] createAdUnits(AdUnit[] adUnits); + AdUnit getAdUnit(string adUnitId); + AdUnitSize[] getAdUnitSizesByStatement(Statement filterStatement); + AdUnitPage getAdUnitsByStatement(Statement filterStatement); + UpdateResult performAdUnitAction(AdUnitAction adUnitAction, Statement filterStatement); + AdUnit updateAdUnit(AdUnit adUnit); + AdUnit[] updateAdUnits(AdUnit[] adUnits); + } + public interface IProductTemplateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ProductTemplate createProductTemplate(ProductTemplate productTemplate); + ProductTemplate[] createProductTemplates(ProductTemplate[] productTemplates); + ProductTemplate getProductTemplate(long productTemplateId); + ProductTemplatePage getProductTemplatesByStatement(Statement statement); + UpdateResult performProductTemplateAction(ProductTemplateAction action, Statement filterStatement); + ProductTemplate updateProductTemplate(ProductTemplate productTemplate); + ProductTemplate[] updateProductTemplates(ProductTemplate[] productTemplates); + } + public interface IForecastService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Forecast getForecast(LineItem lineItem); + Forecast getForecastById(long lineItemId); + } + public interface IUserService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + User createUser(User user); + User[] createUsers(User[] users); + Role[] getAllRoles(); + User getCurrentUser(); + User getUser(long userId); + UserPage getUsersByStatement(Statement filterStatement); + UpdateResult performUserAction(UserAction userAction, Statement filterStatement); + User updateUser(User user); + User[] updateUsers(User[] users); + } + public interface IPublisherQueryLanguageService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ResultSet select(Statement selectStatement); + } + public interface ITeamService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Team createTeam(Team team); + Team[] createTeams(Team[] teams); + Team getTeam(long teamId); + TeamPage getTeamsByStatement(Statement filterStatement); + Team updateTeam(Team team); + Team[] updateTeams(Team[] teams); + } + public interface IRateCardService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + RateCard createRateCard(RateCard rateCard); + RateCard[] createRateCards(RateCard[] rateCards); + RateCard getRateCard(long rateCardId); + RateCardPage getRateCardsByStatement(Statement filterStatement); + UpdateResult performRateCardAction(RateCardAction rateCardAction, Statement filterStatement); + RateCard updateRateCard(RateCard rateCard); + RateCard[] updateRateCards(RateCard[] rateCards); + } + public interface IPlacementService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Placement createPlacement(Placement placement); + Placement[] createPlacements(Placement[] placements); + Placement getPlacement(long placementId); + PlacementPage getPlacementsByStatement(Statement filterStatement); + UpdateResult performPlacementAction(PlacementAction placementAction, Statement filterStatement); + Placement updatePlacement(Placement placement); + Placement[] updatePlacements(Placement[] placements); + } + public interface IReconciliationOrderReportService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ReconciliationOrderReport getReconciliationOrderReport(long reconciliationOrderReportId); + ReconciliationOrderReportPage getReconciliationOrderReportsByStatement(Statement filterStatement); + UpdateResult performReconciliationOrderReportAction(ReconciliationOrderReportAction reconciliationOrderReportAction, Statement filterStatement); + } + public interface IActivityService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Activity[] createActivities(Activity[] activities); + Activity createActivity(Activity activity); + ActivityPage getActivitiesByStatement(Statement filterStatement); + Activity getActivity(int activityId); + Activity[] updateActivities(Activity[] activities); + Activity updateActivity(Activity activity); + } + public interface IOrderService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Order createOrder(Order order); + Order[] createOrders(Order[] orders); + Order getOrder(long orderId); + OrderPage getOrdersByStatement(Statement filterStatement); + UpdateResult performOrderAction(OrderAction orderAction, Statement filterStatement); + Order updateOrder(Order order); + Order[] updateOrders(Order[] orders); + } + public interface IProposalService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Proposal createProposal(Proposal proposal); + Proposal[] createProposals(Proposal[] proposals); + Proposal getProposal(long proposalId); + ProposalPage getProposalsByStatement(Statement filterStatement); + UpdateResult performProposalAction(ProposalAction proposalAction, Statement filterStatement); + Proposal updateProposal(Proposal proposal); + Proposal[] updateProposals(Proposal[] proposals); + } + public interface ICreativeTemplateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CreativeTemplate getCreativeTemplate(long creativeTemplateId); + CreativeTemplatePage getCreativeTemplatesByStatement(Statement filterStatement); + } + public interface ICreativeService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Creative createCreative(Creative creative); + Creative[] createCreatives(Creative[] creatives); + Creative getCreative(long creativeId); + CreativePage getCreativesByStatement(Statement filterStatement); + Creative updateCreative(Creative creative); + Creative[] updateCreatives(Creative[] creatives); + } + public interface IContactService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Contact createContact(Contact contact); + Contact[] createContacts(Contact[] contacts); + Contact getContact(long contactId); + ContactPage getContactsByStatement(Statement statement); + Contact updateContact(Contact contact); + Contact[] updateContacts(Contact[] contacts); + } + public interface ICustomTargetingService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CustomTargetingKey[] createCustomTargetingKeys(CustomTargetingKey[] keys); + CustomTargetingValue[] createCustomTargetingValues(CustomTargetingValue[] values); + CustomTargetingKeyPage getCustomTargetingKeysByStatement(Statement filterStatement); + CustomTargetingValuePage getCustomTargetingValuesByStatement(Statement filterStatement); + UpdateResult performCustomTargetingKeyAction(CustomTargetingKeyAction customTargetingKeyAction, Statement filterStatement); + UpdateResult performCustomTargetingValueAction(CustomTargetingValueAction customTargetingValueAction, Statement filterStatement); + CustomTargetingKey[] updateCustomTargetingKeys(CustomTargetingKey[] keys); + CustomTargetingValue[] updateCustomTargetingValues(CustomTargetingValue[] values); + } +} diff --git a/src/Dfp/v201306/DfpServiceV201306.cs b/src/Dfp/v201306/DfpServiceV201306.cs new file mode 100644 index 00000000000..fa404fb6629 --- /dev/null +++ b/src/Dfp/v201306/DfpServiceV201306.cs @@ -0,0 +1,329 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Reflection; + +namespace Google.Api.Ads.Dfp.Lib { + /// + /// Lists all the services available through this library. + /// + public partial class DfpService : AdsService { + /// + /// All the services available in v201306. + /// + public class v201306 { + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ActivityGroupService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ActivityService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdRuleService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature BaseRateService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ContactService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AudienceSegmentService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CompanyService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ContentService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeSetService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeTemplateService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeWrapperService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomFieldService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomTargetingService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ForecastService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature InventoryService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LabelService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LineItemTemplateService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LineItemService; + + /// + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LineItemCreativeAssociationService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature NetworkService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature OrderService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature PlacementService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProductService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProductTemplateService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProposalService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProposalLineItemService; + + + /// See + /// this page for details. + /// + public static readonly ServiceSignature PublisherQueryLanguageService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature RateCardService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature RateCardCustomizationService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReconciliationOrderReportService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReconciliationReportService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReconciliationReportRowService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReportService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SuggestedAdUnitService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature TeamService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature UserService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature UserTeamAssociationService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature WorkflowActionService; + + /// + /// Factory type for v201306 services. + /// + public static readonly Type factoryType = typeof(DfpServiceFactory); + + /// + /// Static constructor to initialize the service constants. + /// + static v201306() { + ActivityGroupService = DfpService.MakeServiceSignature("v201306", "ActivityGroupService"); + ActivityService = DfpService.MakeServiceSignature("v201306", "ActivityService"); + AdRuleService = DfpService.MakeServiceSignature("v201306", "AdRuleService"); + BaseRateService = DfpService.MakeServiceSignature("v201306", "BaseRateService"); + ContactService = DfpService.MakeServiceSignature("v201306", "ContactService"); + AudienceSegmentService = DfpService.MakeServiceSignature("v201306", + "AudienceSegmentService"); + CompanyService = DfpService.MakeServiceSignature("v201306", "CompanyService"); + ContentService = DfpService.MakeServiceSignature("v201306", "ContentService"); + CreativeService = DfpService.MakeServiceSignature("v201306", "CreativeService"); + CreativeSetService = DfpService.MakeServiceSignature("v201306", "CreativeSetService"); + CreativeTemplateService = DfpService.MakeServiceSignature("v201306", + "CreativeTemplateService"); + CreativeWrapperService = DfpService.MakeServiceSignature("v201306", + "CreativeWrapperService"); + CustomTargetingService = DfpService.MakeServiceSignature("v201306", + "CustomTargetingService"); + CustomFieldService = DfpService.MakeServiceSignature("v201306", + "CustomFieldService"); + ForecastService = DfpService.MakeServiceSignature("v201306", "ForecastService"); + InventoryService = DfpService.MakeServiceSignature("v201306", "InventoryService"); + LabelService = DfpService.MakeServiceSignature("v201306", "LabelService"); + LineItemTemplateService = DfpService.MakeServiceSignature("v201306", + "LineItemTemplateService"); + LineItemService = DfpService.MakeServiceSignature("v201306", "LineItemService"); + LineItemCreativeAssociationService = + DfpService.MakeServiceSignature("v201306", "LineItemCreativeAssociationService"); + NetworkService = DfpService.MakeServiceSignature("v201306", "NetworkService"); + OrderService = DfpService.MakeServiceSignature("v201306", "OrderService"); + PlacementService = DfpService.MakeServiceSignature("v201306", "PlacementService"); + ProductService = DfpService.MakeServiceSignature("v201306", "ProductService"); + ProductTemplateService = DfpService.MakeServiceSignature("v201306", + "ProductTemplateService"); + ProposalService = DfpService.MakeServiceSignature("v201306", "ProposalService"); + ProposalLineItemService = DfpService.MakeServiceSignature("v201306", + "ProposalLineItemService"); + PublisherQueryLanguageService = DfpService.MakeServiceSignature("v201306", + "PublisherQueryLanguageService"); + RateCardService = DfpService.MakeServiceSignature("v201306", "RateCardService"); + RateCardCustomizationService = DfpService.MakeServiceSignature("v201306", + "RateCardCustomizationService"); + ReconciliationOrderReportService = DfpService.MakeServiceSignature("v201306", + "ReconciliationOrderReportService"); + ReconciliationReportService = DfpService.MakeServiceSignature("v201306", + "ReconciliationReportService"); + ReconciliationReportRowService = DfpService.MakeServiceSignature("v201306", + "ReconciliationReportRowService"); + ReportService = DfpService.MakeServiceSignature("v201306", "ReportService"); + SuggestedAdUnitService = DfpService.MakeServiceSignature("v201306", + "SuggestedAdUnitService"); + TeamService = DfpService.MakeServiceSignature("v201306", "TeamService"); + UserService = DfpService.MakeServiceSignature("v201306", "UserService"); + UserTeamAssociationService = DfpService.MakeServiceSignature("v201306", + "UserTeamAssociationService"); + WorkflowActionService = DfpService.MakeServiceSignature("v201306", + "WorkflowActionService"); + } + } + } +} diff --git a/src/Dfp/v201308/DfpApi.cs b/src/Dfp/v201308/DfpApi.cs new file mode 100644 index 00000000000..260292ff283 --- /dev/null +++ b/src/Dfp/v201308/DfpApi.cs @@ -0,0 +1,26043 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +namespace Google.Api.Ads.Dfp.v201308 { + using Google.Api.Ads.Dfp.Lib; + using Google.Api.Ads.Dfp.Headers; + using System; + using System.Web.Services; + using System.Diagnostics; + using System.Web.Services.Protocols; + using System.Xml.Serialization; + using System.ComponentModel; + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AudienceSegmentServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AudienceSegmentService : DfpSoapClient, IAudienceSegmentService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AudienceSegmentService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/AudienceSegmentService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FirstPartyAudienceSegment[] createAudienceSegments([System.Xml.Serialization.XmlElementAttribute("segments")] +FirstPartyAudienceSegment[] segments) { + object[] results = this.Invoke("createAudienceSegments", new object[] { segments }); + return ((FirstPartyAudienceSegment[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AudienceSegmentPage getAudienceSegmentsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAudienceSegmentsByStatement", new object[] { filterStatement }); + return ((AudienceSegmentPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performAudienceSegmentAction(AudienceSegmentAction action, Statement filterStatement) { + object[] results = this.Invoke("performAudienceSegmentAction", new object[] { action, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FirstPartyAudienceSegment[] updateAudienceSegments([System.Xml.Serialization.XmlElementAttribute("segments")] +FirstPartyAudienceSegment[] segments) { + object[] results = this.Invoke("updateAudienceSegments", new object[] { segments }); + return ((FirstPartyAudienceSegment[]) (results[0])); + } + } + + + + + + + + + + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OAuth))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClientLogin))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class Authentication { + private string authenticationTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Authentication.Type")] + public string AuthenticationType { + get { return this.authenticationTypeField; } + set { this.authenticationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class UpdateResult { + private int numChangesField; + + private bool numChangesFieldSpecified; + + public int numChanges { + get { return this.numChangesField; } + set { + this.numChangesField = value; + this.numChangesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numChangesSpecified { + get { return this.numChangesFieldSpecified; } + set { this.numChangesFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RejectAudienceSegments))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PopulateAudienceSegments))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateAudienceSegments))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveAudienceSegments))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateAudienceSegments))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class AudienceSegmentAction { + private string audienceSegmentActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AudienceSegmentAction.Type")] + public string AudienceSegmentActionType { + get { return this.audienceSegmentActionTypeField; } + set { this.audienceSegmentActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RejectAudienceSegments : AudienceSegmentAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class PopulateAudienceSegments : AudienceSegmentAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeactivateAudienceSegments : AudienceSegmentAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ApproveAudienceSegments : AudienceSegmentAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ActivateAudienceSegments : AudienceSegmentAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AudienceSegmentPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AudienceSegment[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AudienceSegment[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedAudienceSegment))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ThirdPartyAudienceSegment))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FirstPartyAudienceSegment))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RuleBasedFirstPartyAudienceSegmentSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RuleBasedFirstPartyAudienceSegment))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NonRuleBasedFirstPartyAudienceSegment))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AudienceSegment { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private AudienceSegmentStatus statusField; + + private bool statusFieldSpecified; + + private long sizeField; + + private bool sizeFieldSpecified; + + private AudienceSegmentDataProvider dataProviderField; + + private AudienceSegmentAudienceSegmentType typeField; + + private bool typeFieldSpecified; + + private string audienceSegmentTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public AudienceSegmentStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public long size { + get { return this.sizeField; } + set { + this.sizeField = value; + this.sizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sizeSpecified { + get { return this.sizeFieldSpecified; } + set { this.sizeFieldSpecified = value; } + } + + public AudienceSegmentDataProvider dataProvider { + get { return this.dataProviderField; } + set { this.dataProviderField = value; } + } + + public AudienceSegmentAudienceSegmentType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("AudienceSegment.Type")] + public string AudienceSegmentType { + get { return this.audienceSegmentTypeField; } + set { this.audienceSegmentTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegment.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AudienceSegmentStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AudienceSegmentDataProvider { + private string nameField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegment.AudienceSegmentType", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AudienceSegmentAudienceSegmentType { + FIRST_PARTY, + SHARED, + THIRD_PARTY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class SharedAudienceSegment : AudienceSegment { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ThirdPartyAudienceSegment : AudienceSegment { + private ThirdPartyAudienceSegmentAudienceSegmentApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + private Money costField; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + public ThirdPartyAudienceSegmentAudienceSegmentApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + + public Money cost { + get { return this.costField; } + set { this.costField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ThirdPartyAudienceSegment.AudienceSegmentApprovalStatus", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ThirdPartyAudienceSegmentAudienceSegmentApprovalStatus { + UNAPPROVED, + APPROVED, + REJECTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Money { + private string currencyCodeField; + + private long microAmountField; + + private bool microAmountFieldSpecified; + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public long microAmount { + get { return this.microAmountField; } + set { + this.microAmountField = value; + this.microAmountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool microAmountSpecified { + get { return this.microAmountFieldSpecified; } + set { this.microAmountFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DateTime { + private Date dateField; + + private int hourField; + + private bool hourFieldSpecified; + + private int minuteField; + + private bool minuteFieldSpecified; + + private int secondField; + + private bool secondFieldSpecified; + + private string timeZoneIDField; + + public Date date { + get { return this.dateField; } + set { this.dateField = value; } + } + + public int hour { + get { return this.hourField; } + set { + this.hourField = value; + this.hourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hourSpecified { + get { return this.hourFieldSpecified; } + set { this.hourFieldSpecified = value; } + } + + public int minute { + get { return this.minuteField; } + set { + this.minuteField = value; + this.minuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minuteSpecified { + get { return this.minuteFieldSpecified; } + set { this.minuteFieldSpecified = value; } + } + + public int second { + get { return this.secondField; } + set { + this.secondField = value; + this.secondSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool secondSpecified { + get { return this.secondFieldSpecified; } + set { this.secondFieldSpecified = value; } + } + + public string timeZoneID { + get { return this.timeZoneIDField; } + set { this.timeZoneIDField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Date { + private int yearField; + + private bool yearFieldSpecified; + + private int monthField; + + private bool monthFieldSpecified; + + private int dayField; + + private bool dayFieldSpecified; + + public int year { + get { return this.yearField; } + set { + this.yearField = value; + this.yearSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool yearSpecified { + get { return this.yearFieldSpecified; } + set { this.yearFieldSpecified = value; } + } + + public int month { + get { return this.monthField; } + set { + this.monthField = value; + this.monthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool monthSpecified { + get { return this.monthFieldSpecified; } + set { this.monthFieldSpecified = value; } + } + + public int day { + get { return this.dayField; } + set { + this.dayField = value; + this.daySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool daySpecified { + get { return this.dayFieldSpecified; } + set { this.dayFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RuleBasedFirstPartyAudienceSegmentSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RuleBasedFirstPartyAudienceSegment))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NonRuleBasedFirstPartyAudienceSegment))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class FirstPartyAudienceSegment : AudienceSegment { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RuleBasedFirstPartyAudienceSegment))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RuleBasedFirstPartyAudienceSegmentSummary : FirstPartyAudienceSegment { + private int pageViewsField; + + private bool pageViewsFieldSpecified; + + private int recencyDaysField; + + private bool recencyDaysFieldSpecified; + + private int membershipExpirationDaysField; + + private bool membershipExpirationDaysFieldSpecified; + + public int pageViews { + get { return this.pageViewsField; } + set { + this.pageViewsField = value; + this.pageViewsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool pageViewsSpecified { + get { return this.pageViewsFieldSpecified; } + set { this.pageViewsFieldSpecified = value; } + } + + public int recencyDays { + get { return this.recencyDaysField; } + set { + this.recencyDaysField = value; + this.recencyDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool recencyDaysSpecified { + get { return this.recencyDaysFieldSpecified; } + set { this.recencyDaysFieldSpecified = value; } + } + + public int membershipExpirationDays { + get { return this.membershipExpirationDaysField; } + set { + this.membershipExpirationDaysField = value; + this.membershipExpirationDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool membershipExpirationDaysSpecified { + get { return this.membershipExpirationDaysFieldSpecified; } + set { this.membershipExpirationDaysFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RuleBasedFirstPartyAudienceSegment : RuleBasedFirstPartyAudienceSegmentSummary { + private FirstPartyAudienceSegmentRule ruleField; + + public FirstPartyAudienceSegmentRule rule { + get { return this.ruleField; } + set { this.ruleField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class FirstPartyAudienceSegmentRule { + private InventoryTargeting inventoryRuleField; + + private CustomCriteriaSet customCriteriaRuleField; + + public InventoryTargeting inventoryRule { + get { return this.inventoryRuleField; } + set { this.inventoryRuleField = value; } + } + + public CustomCriteriaSet customCriteriaRule { + get { return this.customCriteriaRuleField; } + set { this.customCriteriaRuleField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class InventoryTargeting { + private AdUnitTargeting[] targetedAdUnitsField; + + private AdUnitTargeting[] excludedAdUnitsField; + + private long[] targetedPlacementIdsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedAdUnits")] + public AdUnitTargeting[] targetedAdUnits { + get { return this.targetedAdUnitsField; } + set { this.targetedAdUnitsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedAdUnits")] + public AdUnitTargeting[] excludedAdUnits { + get { return this.excludedAdUnitsField; } + set { this.excludedAdUnitsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedPlacementIds")] + public long[] targetedPlacementIds { + get { return this.targetedPlacementIdsField; } + set { this.targetedPlacementIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AdUnitTargeting { + private string adUnitIdField; + + private bool includeDescendantsField; + + private bool includeDescendantsFieldSpecified; + + public string adUnitId { + get { return this.adUnitIdField; } + set { this.adUnitIdField = value; } + } + + public bool includeDescendants { + get { return this.includeDescendantsField; } + set { + this.includeDescendantsField = value; + this.includeDescendantsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeDescendantsSpecified { + get { return this.includeDescendantsFieldSpecified; } + set { this.includeDescendantsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CustomCriteriaSet : CustomCriteriaNode { + private CustomCriteriaSetLogicalOperator logicalOperatorField; + + private bool logicalOperatorFieldSpecified; + + private CustomCriteriaNode[] childrenField; + + public CustomCriteriaSetLogicalOperator logicalOperator { + get { return this.logicalOperatorField; } + set { + this.logicalOperatorField = value; + this.logicalOperatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool logicalOperatorSpecified { + get { return this.logicalOperatorFieldSpecified; } + set { this.logicalOperatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("children")] + public CustomCriteriaNode[] children { + get { return this.childrenField; } + set { this.childrenField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCriteriaSet.LogicalOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CustomCriteriaSetLogicalOperator { + AND, + OR + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteriaLeaf))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceSegmentCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteriaSet))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class CustomCriteriaNode { + private string customCriteriaNodeTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomCriteriaNode.Type")] + public string CustomCriteriaNodeType { + get { return this.customCriteriaNodeTypeField; } + set { this.customCriteriaNodeTypeField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceSegmentCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteria))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class CustomCriteriaLeaf : CustomCriteriaNode { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AudienceSegmentCriteria : CustomCriteriaLeaf { + private AudienceSegmentCriteriaComparisonOperator operatorField; + + private bool operatorFieldSpecified; + + private long[] audienceSegmentIdsField; + + public AudienceSegmentCriteriaComparisonOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("audienceSegmentIds")] + public long[] audienceSegmentIds { + get { return this.audienceSegmentIdsField; } + set { this.audienceSegmentIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegmentCriteria.ComparisonOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AudienceSegmentCriteriaComparisonOperator { + IS, + IS_NOT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CustomCriteria : CustomCriteriaLeaf { + private long keyIdField; + + private bool keyIdFieldSpecified; + + private long[] valueIdsField; + + private CustomCriteriaComparisonOperator operatorField; + + private bool operatorFieldSpecified; + + public long keyId { + get { return this.keyIdField; } + set { + this.keyIdField = value; + this.keyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keyIdSpecified { + get { return this.keyIdFieldSpecified; } + set { this.keyIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("valueIds")] + public long[] valueIds { + get { return this.valueIdsField; } + set { this.valueIdsField = value; } + } + + public CustomCriteriaComparisonOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCriteria.ComparisonOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CustomCriteriaComparisonOperator { + IS, + IS_NOT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class NonRuleBasedFirstPartyAudienceSegment : FirstPartyAudienceSegment { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TextValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NumberValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateTimeValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BooleanValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class Value { + private string valueTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Value.Type")] + public string ValueType { + get { return this.valueTypeField; } + set { this.valueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class TextValue : Value { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class NumberValue : Value { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DateValue : Value { + private Date valueField; + + public Date value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DateTimeValue : Value { + private DateTime valueField; + + public DateTime value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class BooleanValue : Value { + private bool valueField; + + private bool valueFieldSpecified; + + public bool value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class String_ValueMapEntry { + private string keyField; + + private Value valueField; + + public string key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public Value value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Statement { + private string queryField; + + private String_ValueMapEntry[] valuesField; + + public string query { + get { return this.queryField; } + set { this.queryField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("values")] + public String_ValueMapEntry[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StatementError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServerError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceSegmentError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(QuotaError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PublisherQueryLanguageSyntaxError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PublisherQueryLanguageContextError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PermissionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NotNullError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InternalApiError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeatureError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CommonError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AuthenticationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApiVersionError))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UniqueError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TypeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ParseError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LabelEntityAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringLengthError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NullError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LabelError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeWrapperError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TeamError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidEmailError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CompanyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CompanyCreditStatusError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredNumberError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PoddingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRuleSlotError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRulePriorityError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRuleFrequencyCapError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRuleDateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NetworkError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReconciliationImportError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReconciliationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RangeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredCollectionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidUrlError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentPartnerError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EntityLimitReachedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserDomainTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TechnologyTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReservationDetailsError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProposalLineItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProposalLineItemActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProposalError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PrecisionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GeoTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GenericTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FrequencyCapError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DayPartTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldValueError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BillingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReportError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivityError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredSizeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OrderError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemOperationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemFlightDateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemCreativeAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ForecastError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateTimeRangeTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClickTrackingLineItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceExtensionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TemplateInstantiatedCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SwiffyConversionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemCreativeAssociationOperationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidPhoneNumberError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FileError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeSetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeAssetMacroError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseAccountError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseRateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RateCardCustomizationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseRateActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RegExError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitTypeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitSizesError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitPartnerAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidColorError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitHierarchyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitCodeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitAfcSizeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductTemplateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductTemplateActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OrderActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RateCardActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WorkflowActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProposalActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeTemplateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContactError))] + public abstract partial class ApiError { + private string fieldPathField; + + private string triggerField; + + private string errorStringField; + + private string apiErrorTypeField; + + public string fieldPath { + get { return this.fieldPathField; } + set { this.fieldPathField = value; } + } + + public string trigger { + get { return this.triggerField; } + set { this.triggerField = value; } + } + + public string errorString { + get { return this.errorStringField; } + set { this.errorStringField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApiError.Type")] + public string ApiErrorType { + get { return this.apiErrorTypeField; } + set { this.apiErrorTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class StatementError : ApiError { + private StatementErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StatementErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StatementError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum StatementErrorReason { + VARIABLE_NOT_BOUND_TO_VALUE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ServerError : ApiError { + private ServerErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ServerErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ServerError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ServerErrorReason { + SERVER_ERROR, + SERVER_BUSY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AudienceSegmentError : ApiError { + private AudienceSegmentErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AudienceSegmentErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegmentError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AudienceSegmentErrorReason { + FIRST_PARTY_AUDIENCE_SEGMENT_NOT_SUPPORTED, + ONLY_RULE_BASED_FIRST_PARTY_AUDIENCE_SEGMENTS_CAN_BE_CREATED, + AUDIENCE_SEGMENT_ID_NOT_FOUND, + INVALID_AUDIENCE_SEGMENT_RULE, + AUDIENCE_SEGMENT_RULE_TOO_LONG, + INVALID_AUDIENCE_SEGMENT_NAME, + DUPLICATE_AUDIENCE_SEGMENT_NAME, + INVALID_AUDIENCE_SEGMENT_DESCRIPTION, + INVALID_AUDIENCE_SEGMENT_PAGEVIEWS, + INVALID_AUDIENCE_SEGMENT_RECENCY, + INVALID_AUDIENCE_SEGMENT_MEMBERSHIP_EXPIRATION, + INVALID_AUDIENCE_SEGMENT_CUSTOM_KEY_NAME, + INVALID_AUDIENCE_SEGMENT_CUSTOM_VALUE_NAME, + INVALID_AUDIENCE_SEGMENT_CUSTOM_VALUE_MATCH_TYPE, + INVALID_NESTED_FIRST_PARTY_AUDIENCE_SEGMENT, + INVALID_NESTED_THIRD_PARTY_AUDIENCE_SEGMENT, + INACTIVE_NESTED_AUDIENCE_SEGMENT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RequiredError : ApiError { + private RequiredErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum RequiredErrorReason { + REQUIRED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class QuotaError : ApiError { + private QuotaErrorReason reasonField; + + private bool reasonFieldSpecified; + + public QuotaErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "QuotaError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum QuotaErrorReason { + EXCEEDED_QUOTA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class PublisherQueryLanguageSyntaxError : ApiError { + private PublisherQueryLanguageSyntaxErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PublisherQueryLanguageSyntaxErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PublisherQueryLanguageSyntaxError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum PublisherQueryLanguageSyntaxErrorReason { + UNPARSABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class PublisherQueryLanguageContextError : ApiError { + private PublisherQueryLanguageContextErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PublisherQueryLanguageContextErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PublisherQueryLanguageContextError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum PublisherQueryLanguageContextErrorReason { + UNEXECUTABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class PermissionError : ApiError { + private PermissionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PermissionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PermissionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum PermissionErrorReason { + PERMISSION_DENIED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class NotNullError : ApiError { + private NotNullErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NotNullErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NotNullError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum NotNullErrorReason { + ARG1_NULL, + ARG2_NULL, + ARG3_NULL, + NULL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class InternalApiError : ApiError { + private InternalApiErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InternalApiErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InternalApiError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum InternalApiErrorReason { + UNEXPECTED_INTERNAL_API_ERROR, + UNKNOWN, + DOWNTIME + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class FeatureError : ApiError { + private FeatureErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FeatureErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeatureError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum FeatureErrorReason { + MISSING_FEATURE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CommonError : ApiError { + private CommonErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CommonErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CommonError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CommonErrorReason { + NOT_FOUND, + ALREADY_EXISTS, + DUPLICATE_OBJECT, + CANNOT_UPDATE, + CONCURRENT_MODIFICATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AuthenticationError : ApiError { + private AuthenticationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AuthenticationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AuthenticationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AuthenticationErrorReason { + AMBIGUOUS_SOAP_REQUEST_HEADER, + INVALID_EMAIL, + AUTHENTICATION_FAILED, + INVALID_OAUTH_SIGNATURE, + INVALID_SERVICE, + MISSING_SOAP_REQUEST_HEADER, + MISSING_AUTHENTICATION_HTTP_HEADER, + MISSING_AUTHENTICATION, + NOT_WHITELISTED_FOR_API_ACCESS, + NO_NETWORKS_TO_ACCESS, + NETWORK_NOT_FOUND, + NETWORK_CODE_REQUIRED, + CONNECTION_ERROR, + GOOGLE_ACCOUNT_ALREADY_ASSOCIATED_WITH_NETWORK, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ApiVersionError : ApiError { + private ApiVersionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ApiVersionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ApiVersionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ApiVersionErrorReason { + UPDATE_TO_NEWER_VERSION, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApiException))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ApplicationException { + private string messageField; + + private string applicationExceptionTypeField; + + public string message { + get { return this.messageField; } + set { this.messageField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApplicationException.Type")] + public string ApplicationExceptionType { + get { return this.applicationExceptionTypeField; } + set { this.applicationExceptionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ApiException : ApplicationException { + private ApiError[] errorsField; + + [System.Xml.Serialization.XmlElementAttribute("errors")] + public ApiError[] errors { + get { return this.errorsField; } + set { this.errorsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class OAuth : Authentication { + private string parametersField; + + public string parameters { + get { return this.parametersField; } + set { this.parametersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ClientLogin : Authentication { + private string tokenField; + + public string token { + get { return this.tokenField; } + set { this.tokenField = value; } + } + } + + + + + + + + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "SuggestedAdUnitServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class SuggestedAdUnitService : DfpSoapClient, ISuggestedAdUnitService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public SuggestedAdUnitService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/SuggestedAdUnitService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SuggestedAdUnit getSuggestedAdUnit(string suggestedAdUnitId) { + object[] results = this.Invoke("getSuggestedAdUnit", new object[] { suggestedAdUnitId }); + return ((SuggestedAdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SuggestedAdUnitPage getSuggestedAdUnitsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getSuggestedAdUnitsByStatement", new object[] { filterStatement }); + return ((SuggestedAdUnitPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SuggestedAdUnitUpdateResult performSuggestedAdUnitAction(SuggestedAdUnitAction suggestedAdUnitAction, Statement filterStatement) { + object[] results = this.Invoke("performSuggestedAdUnitAction", new object[] { suggestedAdUnitAction, filterStatement }); + return ((SuggestedAdUnitUpdateResult) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class SuggestedAdUnitUpdateResult { + private string[] newAdUnitIdsField; + + private int numChangesField; + + private bool numChangesFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("newAdUnitIds")] + public string[] newAdUnitIds { + get { return this.newAdUnitIdsField; } + set { this.newAdUnitIdsField = value; } + } + + public int numChanges { + get { return this.numChangesField; } + set { + this.numChangesField = value; + this.numChangesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numChangesSpecified { + get { return this.numChangesFieldSpecified; } + set { this.numChangesFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveSuggestedAdUnit))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class SuggestedAdUnitAction { + private string suggestedAdUnitActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("SuggestedAdUnitAction.Type")] + public string SuggestedAdUnitActionType { + get { return this.suggestedAdUnitActionTypeField; } + set { this.suggestedAdUnitActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ApproveSuggestedAdUnit : SuggestedAdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class SuggestedAdUnitPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private SuggestedAdUnit[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public SuggestedAdUnit[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class SuggestedAdUnit { + private string idField; + + private long numRequestsField; + + private bool numRequestsFieldSpecified; + + private string[] pathField; + + private AdUnitParent[] parentPathField; + + private AdUnitTargetWindow targetWindowField; + + private bool targetWindowFieldSpecified; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private AdUnitSize[] suggestedAdUnitSizesField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public long numRequests { + get { return this.numRequestsField; } + set { + this.numRequestsField = value; + this.numRequestsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numRequestsSpecified { + get { return this.numRequestsFieldSpecified; } + set { this.numRequestsFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("path")] + public string[] path { + get { return this.pathField; } + set { this.pathField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("parentPath")] + public AdUnitParent[] parentPath { + get { return this.parentPathField; } + set { this.parentPathField = value; } + } + + public AdUnitTargetWindow targetWindow { + get { return this.targetWindowField; } + set { + this.targetWindowField = value; + this.targetWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetWindowSpecified { + get { return this.targetWindowFieldSpecified; } + set { this.targetWindowFieldSpecified = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("suggestedAdUnitSizes")] + public AdUnitSize[] suggestedAdUnitSizes { + get { return this.suggestedAdUnitSizesField; } + set { this.suggestedAdUnitSizesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AdUnitParent { + private string idField; + + private string nameField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnit.TargetWindow", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AdUnitTargetWindow { + TOP, + BLANK + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum TargetPlatform { + WEB, + MOBILE, + ANY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AdUnitSize { + private Size sizeField; + + private EnvironmentType environmentTypeField; + + private bool environmentTypeFieldSpecified; + + private AdUnitSize[] companionsField; + + private string fullDisplayStringField; + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + public EnvironmentType environmentType { + get { return this.environmentTypeField; } + set { + this.environmentTypeField = value; + this.environmentTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool environmentTypeSpecified { + get { return this.environmentTypeFieldSpecified; } + set { this.environmentTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companions")] + public AdUnitSize[] companions { + get { return this.companionsField; } + set { this.companionsField = value; } + } + + public string fullDisplayString { + get { return this.fullDisplayStringField; } + set { this.fullDisplayStringField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Size { + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + private bool isAspectRatioField; + + private bool isAspectRatioFieldSpecified; + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + public bool isAspectRatio { + get { return this.isAspectRatioField; } + set { + this.isAspectRatioField = value; + this.isAspectRatioSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAspectRatioSpecified { + get { return this.isAspectRatioFieldSpecified; } + set { this.isAspectRatioFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum EnvironmentType { + BROWSER, + VIDEO_PLAYER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class UniqueError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class TypeError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ParseError : ApiError { + private ParseErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ParseErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ParseError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ParseErrorReason { + UNPARSABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class LabelEntityAssociationError : ApiError { + private LabelEntityAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LabelEntityAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LabelEntityAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum LabelEntityAssociationErrorReason { + INVALID_COMPANY_TYPE, + DUPLICATE_ASSOCIATION, + INVALID_ASSOCIATION, + DUPLICATE_ASSOCIATION_WITH_NEGATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LabelServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LabelService : DfpSoapClient, ILabelService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LabelService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/LabelService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Label createLabel(Label label) { + object[] results = this.Invoke("createLabel", new object[] { label }); + return ((Label) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Label[] createLabels([System.Xml.Serialization.XmlElementAttribute("labels")] +Label[] labels) { + object[] results = this.Invoke("createLabels", new object[] { labels }); + return ((Label[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Label getLabel(long labelId) { + object[] results = this.Invoke("getLabel", new object[] { labelId }); + return ((Label) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LabelPage getLabelsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLabelsByStatement", new object[] { filterStatement }); + return ((LabelPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performLabelAction(LabelAction labelAction, Statement filterStatement) { + object[] results = this.Invoke("performLabelAction", new object[] { labelAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Label updateLabel(Label label) { + object[] results = this.Invoke("updateLabel", new object[] { label }); + return ((Label) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Label[] updateLabels([System.Xml.Serialization.XmlElementAttribute("labels")] +Label[] labels) { + object[] results = this.Invoke("updateLabels", new object[] { labels }); + return ((Label[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateLabels))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLabels))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class LabelAction { + private string labelActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LabelAction.Type")] + public string LabelActionType { + get { return this.labelActionTypeField; } + set { this.labelActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeactivateLabels : LabelAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ActivateLabels : LabelAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class LabelPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Label[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Label[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Label { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private LabelType[] typesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("types")] + public LabelType[] types { + get { return this.typesField; } + set { this.typesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum LabelType { + COMPETITIVE_EXCLUSION, + AD_UNIT_FREQUENCY_CAP, + AD_EXCLUSION, + CREATIVE_WRAPPER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class StringLengthError : ApiError { + private StringLengthErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StringLengthErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StringLengthError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum StringLengthErrorReason { + TOO_LONG, + TOO_SHORT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class NullError : ApiError { + private NullErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NullErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NullError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum NullErrorReason { + NULL_CONTENT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class LabelError : ApiError { + private LabelErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LabelErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LabelError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum LabelErrorReason { + INVALID_PREFIX, + NAME_INVALID_CHARS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CreativeWrapperError : ApiError { + private CreativeWrapperErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeWrapperErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeWrapperError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CreativeWrapperErrorReason { + LABEL_ALREADY_ASSOCIATED_WITH_CREATIVE_WRAPPER, + INVALID_LABEL_TYPE, + UNRECOGNIZED_MACRO, + NEITHER_HEADER_NOR_FOOTER_SPECIFIED, + CANNOT_USE_CREATIVE_WRAPPER_TYPE, + CANNOT_UPDATE_LABEL_ID, + CANNOT_APPLY_TO_AD_UNIT_WITH_VIDEO_SIZES, + CANNOT_APPLY_TO_MOBILE_AD_UNIT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CompanyServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CompanyService : DfpSoapClient, ICompanyService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CompanyService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/CompanyService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Company[] createCompanies([System.Xml.Serialization.XmlElementAttribute("companies")] +Company[] companies) { + object[] results = this.Invoke("createCompanies", new object[] { companies }); + return ((Company[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Company createCompany(Company company) { + object[] results = this.Invoke("createCompany", new object[] { company }); + return ((Company) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CompanyPage getCompaniesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCompaniesByStatement", new object[] { filterStatement }); + return ((CompanyPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Company getCompany(long companyId) { + object[] results = this.Invoke("getCompany", new object[] { companyId }); + return ((Company) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Company[] updateCompanies([System.Xml.Serialization.XmlElementAttribute("companies")] +Company[] companies) { + object[] results = this.Invoke("updateCompanies", new object[] { companies }); + return ((Company[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Company updateCompany(Company company) { + object[] results = this.Invoke("updateCompany", new object[] { company }); + return ((Company) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CompanyPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Company[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Company[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Company { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private CompanyType typeField; + + private bool typeFieldSpecified; + + private string addressField; + + private string emailField; + + private string faxPhoneField; + + private string primaryPhoneField; + + private string externalIdField; + + private string commentField; + + private CompanyCreditStatus creditStatusField; + + private bool creditStatusFieldSpecified; + + private AppliedLabel[] appliedLabelsField; + + private bool enableSameAdvertiserCompetitiveExclusionField; + + private bool enableSameAdvertiserCompetitiveExclusionFieldSpecified; + + private long primaryContactIdField; + + private bool primaryContactIdFieldSpecified; + + private long[] appliedTeamIdsField; + + private int thirdPartyCompanyIdField; + + private bool thirdPartyCompanyIdFieldSpecified; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public CompanyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public string address { + get { return this.addressField; } + set { this.addressField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public string faxPhone { + get { return this.faxPhoneField; } + set { this.faxPhoneField = value; } + } + + public string primaryPhone { + get { return this.primaryPhoneField; } + set { this.primaryPhoneField = value; } + } + + public string externalId { + get { return this.externalIdField; } + set { this.externalIdField = value; } + } + + public string comment { + get { return this.commentField; } + set { this.commentField = value; } + } + + public CompanyCreditStatus creditStatus { + get { return this.creditStatusField; } + set { + this.creditStatusField = value; + this.creditStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creditStatusSpecified { + get { return this.creditStatusFieldSpecified; } + set { this.creditStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + public bool enableSameAdvertiserCompetitiveExclusion { + get { return this.enableSameAdvertiserCompetitiveExclusionField; } + set { + this.enableSameAdvertiserCompetitiveExclusionField = value; + this.enableSameAdvertiserCompetitiveExclusionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool enableSameAdvertiserCompetitiveExclusionSpecified { + get { return this.enableSameAdvertiserCompetitiveExclusionFieldSpecified; } + set { this.enableSameAdvertiserCompetitiveExclusionFieldSpecified = value; } + } + + public long primaryContactId { + get { return this.primaryContactIdField; } + set { + this.primaryContactIdField = value; + this.primaryContactIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool primaryContactIdSpecified { + get { return this.primaryContactIdFieldSpecified; } + set { this.primaryContactIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public int thirdPartyCompanyId { + get { return this.thirdPartyCompanyIdField; } + set { + this.thirdPartyCompanyIdField = value; + this.thirdPartyCompanyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyCompanyIdSpecified { + get { return this.thirdPartyCompanyIdFieldSpecified; } + set { this.thirdPartyCompanyIdFieldSpecified = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Company.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CompanyType { + HOUSE_ADVERTISER, + HOUSE_AGENCY, + ADVERTISER, + AGENCY, + AD_NETWORK, + AFFILIATE_DISTRIBUTION_PARTNER, + CONTENT_PARTNER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Company.CreditStatus", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CompanyCreditStatus { + ACTIVE, + ON_HOLD, + CREDIT_STOP, + INACTIVE, + BLOCKED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AppliedLabel { + private long labelIdField; + + private bool labelIdFieldSpecified; + + private bool isNegatedField; + + private bool isNegatedFieldSpecified; + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + + public bool isNegated { + get { return this.isNegatedField; } + set { + this.isNegatedField = value; + this.isNegatedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isNegatedSpecified { + get { return this.isNegatedFieldSpecified; } + set { this.isNegatedFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class TeamError : ApiError { + private TeamErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TeamErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TeamError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum TeamErrorReason { + ENTITY_NOT_ON_USERS_TEAMS, + AD_UNITS_NOT_ON_ORDER_TEAMS, + PLACEMENTS_NOT_ON_ORDER_TEAMS, + MISSING_USERS_TEAM, + ALL_TEAM_ASSOCIATION_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class InvalidEmailError : ApiError { + private InvalidEmailErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidEmailErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidEmailError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum InvalidEmailErrorReason { + INVALID_FORMAT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CompanyError : ApiError { + private CompanyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CompanyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CompanyError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CompanyErrorReason { + CANNOT_SET_THIRD_PARTY_COMPANY_DUE_TO_TYPE, + CANNOT_UPDATE_COMPANY_TYPE, + INVALID_COMPANY_TYPE, + PRIMARY_CONTACT_DOES_NOT_BELONG_TO_THIS_COMPANY, + THIRD_PARTY_STATS_PROVIDER_IS_WRONG_ROLE_TYPE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CompanyCreditStatusError : ApiError { + private CompanyCreditStatusErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CompanyCreditStatusErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CompanyCreditStatusError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CompanyCreditStatusErrorReason { + COMPANY_CREDIT_STATUS_CHANGE_NOT_ALLOWED, + CANNOT_USE_CREDIT_STATUS_SETTING, + CANNOT_USE_ADVANCED_CREDIT_STATUS_SETTING, + UNACCEPTABLE_COMPANY_CREDIT_STATUS_FOR_ORDER, + UNACCEPTABLE_COMPANY_CREDIT_STATUS_FOR_LINE_ITEM, + CANNOT_BLOCK_COMPANY_TOO_MANY_APPROVED_ORDERS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdRuleServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdRuleService : DfpSoapClient, IAdRuleService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdRuleService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/AdRuleService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRule createAdRule(AdRule adRule) { + object[] results = this.Invoke("createAdRule", new object[] { adRule }); + return ((AdRule) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRule[] createAdRules([System.Xml.Serialization.XmlElementAttribute("adRules")] +AdRule[] adRules) { + object[] results = this.Invoke("createAdRules", new object[] { adRules }); + return ((AdRule[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRule getAdRule(int adRuleId) { + object[] results = this.Invoke("getAdRule", new object[] { adRuleId }); + return ((AdRule) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRulePage getAdRulesByStatement(Statement statement) { + object[] results = this.Invoke("getAdRulesByStatement", new object[] { statement }); + return ((AdRulePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performAdRuleAction(AdRuleAction adRuleAction, Statement filterStatement) { + object[] results = this.Invoke("performAdRuleAction", new object[] { adRuleAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRule updateAdRule(AdRule adRule) { + object[] results = this.Invoke("updateAdRule", new object[] { adRule }); + return ((AdRule) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRule[] updateAdRules([System.Xml.Serialization.XmlElementAttribute("adRules")] +AdRule[] adRules) { + object[] results = this.Invoke("updateAdRules", new object[] { adRules }); + return ((AdRule[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteAdRules))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateAdRules))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateAdRules))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class AdRuleAction { + private string adRuleActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AdRuleAction.Type")] + public string AdRuleActionType { + get { return this.adRuleActionTypeField; } + set { this.adRuleActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeleteAdRules : AdRuleAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeactivateAdRules : AdRuleAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ActivateAdRules : AdRuleAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AdRulePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AdRule[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AdRule[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AdRule { + private int idField; + + private bool idFieldSpecified; + + private string nameField; + + private int priorityField; + + private bool priorityFieldSpecified; + + private Targeting targetingField; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private AdRuleStatus statusField; + + private bool statusFieldSpecified; + + private FrequencyCapBehavior frequencyCapBehaviorField; + + private bool frequencyCapBehaviorFieldSpecified; + + private int maxImpressionsPerLineItemPerStreamField; + + private bool maxImpressionsPerLineItemPerStreamFieldSpecified; + + private int maxImpressionsPerLineItemPerPodField; + + private bool maxImpressionsPerLineItemPerPodFieldSpecified; + + private BaseAdRuleSlot prerollField; + + private BaseAdRuleSlot midrollField; + + private BaseAdRuleSlot postrollField; + + public int id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + public Targeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public AdRuleStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public FrequencyCapBehavior frequencyCapBehavior { + get { return this.frequencyCapBehaviorField; } + set { + this.frequencyCapBehaviorField = value; + this.frequencyCapBehaviorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool frequencyCapBehaviorSpecified { + get { return this.frequencyCapBehaviorFieldSpecified; } + set { this.frequencyCapBehaviorFieldSpecified = value; } + } + + public int maxImpressionsPerLineItemPerStream { + get { return this.maxImpressionsPerLineItemPerStreamField; } + set { + this.maxImpressionsPerLineItemPerStreamField = value; + this.maxImpressionsPerLineItemPerStreamSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxImpressionsPerLineItemPerStreamSpecified { + get { return this.maxImpressionsPerLineItemPerStreamFieldSpecified; } + set { this.maxImpressionsPerLineItemPerStreamFieldSpecified = value; } + } + + public int maxImpressionsPerLineItemPerPod { + get { return this.maxImpressionsPerLineItemPerPodField; } + set { + this.maxImpressionsPerLineItemPerPodField = value; + this.maxImpressionsPerLineItemPerPodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxImpressionsPerLineItemPerPodSpecified { + get { return this.maxImpressionsPerLineItemPerPodFieldSpecified; } + set { this.maxImpressionsPerLineItemPerPodFieldSpecified = value; } + } + + public BaseAdRuleSlot preroll { + get { return this.prerollField; } + set { this.prerollField = value; } + } + + public BaseAdRuleSlot midroll { + get { return this.midrollField; } + set { this.midrollField = value; } + } + + public BaseAdRuleSlot postroll { + get { return this.postrollField; } + set { this.postrollField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Targeting { + private GeoTargeting geoTargetingField; + + private InventoryTargeting inventoryTargetingField; + + private DayPartTargeting dayPartTargetingField; + + private TechnologyTargeting technologyTargetingField; + + private CustomCriteriaSet customTargetingField; + + private UserDomainTargeting userDomainTargetingField; + + private ContentTargeting contentTargetingField; + + private VideoPositionTargeting videoPositionTargetingField; + + public GeoTargeting geoTargeting { + get { return this.geoTargetingField; } + set { this.geoTargetingField = value; } + } + + public InventoryTargeting inventoryTargeting { + get { return this.inventoryTargetingField; } + set { this.inventoryTargetingField = value; } + } + + public DayPartTargeting dayPartTargeting { + get { return this.dayPartTargetingField; } + set { this.dayPartTargetingField = value; } + } + + public TechnologyTargeting technologyTargeting { + get { return this.technologyTargetingField; } + set { this.technologyTargetingField = value; } + } + + public CustomCriteriaSet customTargeting { + get { return this.customTargetingField; } + set { this.customTargetingField = value; } + } + + public UserDomainTargeting userDomainTargeting { + get { return this.userDomainTargetingField; } + set { this.userDomainTargetingField = value; } + } + + public ContentTargeting contentTargeting { + get { return this.contentTargetingField; } + set { this.contentTargetingField = value; } + } + + public VideoPositionTargeting videoPositionTargeting { + get { return this.videoPositionTargetingField; } + set { this.videoPositionTargetingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class GeoTargeting { + private Location[] targetedLocationsField; + + private Location[] excludedLocationsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedLocations")] + public Location[] targetedLocations { + get { return this.targetedLocationsField; } + set { this.targetedLocationsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedLocations")] + public Location[] excludedLocations { + get { return this.excludedLocationsField; } + set { this.excludedLocationsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RegionLocation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PostalCodeLocation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MetroLocation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CountryLocation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CityLocation))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Location { + private long idField; + + private bool idFieldSpecified; + + private string locationTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Location.Type")] + public string LocationType { + get { return this.locationTypeField; } + set { this.locationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RegionLocation : Location { + private string regionCodeField; + + public string regionCode { + get { return this.regionCodeField; } + set { this.regionCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class PostalCodeLocation : Location { + private string postalCodeField; + + private string countryCodeField; + + public string postalCode { + get { return this.postalCodeField; } + set { this.postalCodeField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class MetroLocation : Location { + private string metroCodeField; + + private string countryCodeField; + + public string metroCode { + get { return this.metroCodeField; } + set { this.metroCodeField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CountryLocation : Location { + private string countryCodeField; + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CityLocation : Location { + private string cityNameField; + + private string regionCodeField; + + private string countryCodeField; + + public string cityName { + get { return this.cityNameField; } + set { this.cityNameField = value; } + } + + public string regionCode { + get { return this.regionCodeField; } + set { this.regionCodeField = value; } + } + + public string countryCode { + get { return this.countryCodeField; } + set { this.countryCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DayPartTargeting { + private DayPart[] dayPartsField; + + private DeliveryTimeZone timeZoneField; + + private bool timeZoneFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("dayParts")] + public DayPart[] dayParts { + get { return this.dayPartsField; } + set { this.dayPartsField = value; } + } + + public DeliveryTimeZone timeZone { + get { return this.timeZoneField; } + set { + this.timeZoneField = value; + this.timeZoneSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool timeZoneSpecified { + get { return this.timeZoneFieldSpecified; } + set { this.timeZoneFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DayPart { + private DayOfWeek dayOfWeekField; + + private bool dayOfWeekFieldSpecified; + + private TimeOfDay startTimeField; + + private TimeOfDay endTimeField; + + public DayOfWeek dayOfWeek { + get { return this.dayOfWeekField; } + set { + this.dayOfWeekField = value; + this.dayOfWeekSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dayOfWeekSpecified { + get { return this.dayOfWeekFieldSpecified; } + set { this.dayOfWeekFieldSpecified = value; } + } + + public TimeOfDay startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public TimeOfDay endTime { + get { return this.endTimeField; } + set { this.endTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum DayOfWeek { + MONDAY, + TUESDAY, + WEDNESDAY, + THURSDAY, + FRIDAY, + SATURDAY, + SUNDAY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class TimeOfDay { + private int hourField; + + private bool hourFieldSpecified; + + private MinuteOfHour minuteField; + + private bool minuteFieldSpecified; + + public int hour { + get { return this.hourField; } + set { + this.hourField = value; + this.hourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hourSpecified { + get { return this.hourFieldSpecified; } + set { this.hourFieldSpecified = value; } + } + + public MinuteOfHour minute { + get { return this.minuteField; } + set { + this.minuteField = value; + this.minuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minuteSpecified { + get { return this.minuteFieldSpecified; } + set { this.minuteFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum MinuteOfHour { + ZERO, + FIFTEEN, + THIRTY, + FORTY_FIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum DeliveryTimeZone { + PUBLISHER, + BROWSER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class TechnologyTargeting { + private BandwidthGroupTargeting bandwidthGroupTargetingField; + + private BrowserTargeting browserTargetingField; + + private BrowserLanguageTargeting browserLanguageTargetingField; + + private DeviceCapabilityTargeting deviceCapabilityTargetingField; + + private DeviceCategoryTargeting deviceCategoryTargetingField; + + private DeviceManufacturerTargeting deviceManufacturerTargetingField; + + private MobileCarrierTargeting mobileCarrierTargetingField; + + private MobileDeviceTargeting mobileDeviceTargetingField; + + private MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargetingField; + + private OperatingSystemTargeting operatingSystemTargetingField; + + private OperatingSystemVersionTargeting operatingSystemVersionTargetingField; + + public BandwidthGroupTargeting bandwidthGroupTargeting { + get { return this.bandwidthGroupTargetingField; } + set { this.bandwidthGroupTargetingField = value; } + } + + public BrowserTargeting browserTargeting { + get { return this.browserTargetingField; } + set { this.browserTargetingField = value; } + } + + public BrowserLanguageTargeting browserLanguageTargeting { + get { return this.browserLanguageTargetingField; } + set { this.browserLanguageTargetingField = value; } + } + + public DeviceCapabilityTargeting deviceCapabilityTargeting { + get { return this.deviceCapabilityTargetingField; } + set { this.deviceCapabilityTargetingField = value; } + } + + public DeviceCategoryTargeting deviceCategoryTargeting { + get { return this.deviceCategoryTargetingField; } + set { this.deviceCategoryTargetingField = value; } + } + + public DeviceManufacturerTargeting deviceManufacturerTargeting { + get { return this.deviceManufacturerTargetingField; } + set { this.deviceManufacturerTargetingField = value; } + } + + public MobileCarrierTargeting mobileCarrierTargeting { + get { return this.mobileCarrierTargetingField; } + set { this.mobileCarrierTargetingField = value; } + } + + public MobileDeviceTargeting mobileDeviceTargeting { + get { return this.mobileDeviceTargetingField; } + set { this.mobileDeviceTargetingField = value; } + } + + public MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargeting { + get { return this.mobileDeviceSubmodelTargetingField; } + set { this.mobileDeviceSubmodelTargetingField = value; } + } + + public OperatingSystemTargeting operatingSystemTargeting { + get { return this.operatingSystemTargetingField; } + set { this.operatingSystemTargetingField = value; } + } + + public OperatingSystemVersionTargeting operatingSystemVersionTargeting { + get { return this.operatingSystemVersionTargetingField; } + set { this.operatingSystemVersionTargetingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class BandwidthGroupTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] bandwidthGroupsField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("bandwidthGroups")] + public Technology[] bandwidthGroups { + get { return this.bandwidthGroupsField; } + set { this.bandwidthGroupsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystemVersion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystem))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileDeviceSubmodel))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileDevice))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileCarrier))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceManufacturer))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceCategory))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceCapability))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BrowserLanguage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Browser))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BandwidthGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Technology { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string technologyTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Technology.Type")] + public string TechnologyType { + get { return this.technologyTypeField; } + set { this.technologyTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class OperatingSystemVersion : Technology { + private int majorVersionField; + + private bool majorVersionFieldSpecified; + + private int minorVersionField; + + private bool minorVersionFieldSpecified; + + private int microVersionField; + + private bool microVersionFieldSpecified; + + public int majorVersion { + get { return this.majorVersionField; } + set { + this.majorVersionField = value; + this.majorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool majorVersionSpecified { + get { return this.majorVersionFieldSpecified; } + set { this.majorVersionFieldSpecified = value; } + } + + public int minorVersion { + get { return this.minorVersionField; } + set { + this.minorVersionField = value; + this.minorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minorVersionSpecified { + get { return this.minorVersionFieldSpecified; } + set { this.minorVersionFieldSpecified = value; } + } + + public int microVersion { + get { return this.microVersionField; } + set { + this.microVersionField = value; + this.microVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool microVersionSpecified { + get { return this.microVersionFieldSpecified; } + set { this.microVersionFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class OperatingSystem : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class MobileDeviceSubmodel : Technology { + private long mobileDeviceCriterionIdField; + + private bool mobileDeviceCriterionIdFieldSpecified; + + private long deviceManufacturerCriterionIdField; + + private bool deviceManufacturerCriterionIdFieldSpecified; + + public long mobileDeviceCriterionId { + get { return this.mobileDeviceCriterionIdField; } + set { + this.mobileDeviceCriterionIdField = value; + this.mobileDeviceCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mobileDeviceCriterionIdSpecified { + get { return this.mobileDeviceCriterionIdFieldSpecified; } + set { this.mobileDeviceCriterionIdFieldSpecified = value; } + } + + public long deviceManufacturerCriterionId { + get { return this.deviceManufacturerCriterionIdField; } + set { + this.deviceManufacturerCriterionIdField = value; + this.deviceManufacturerCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deviceManufacturerCriterionIdSpecified { + get { return this.deviceManufacturerCriterionIdFieldSpecified; } + set { this.deviceManufacturerCriterionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class MobileDevice : Technology { + private long manufacturerCriterionIdField; + + private bool manufacturerCriterionIdFieldSpecified; + + public long manufacturerCriterionId { + get { return this.manufacturerCriterionIdField; } + set { + this.manufacturerCriterionIdField = value; + this.manufacturerCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manufacturerCriterionIdSpecified { + get { return this.manufacturerCriterionIdFieldSpecified; } + set { this.manufacturerCriterionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class MobileCarrier : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeviceManufacturer : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeviceCategory : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeviceCapability : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class BrowserLanguage : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Browser : Technology { + private string majorVersionField; + + private string minorVersionField; + + public string majorVersion { + get { return this.majorVersionField; } + set { this.majorVersionField = value; } + } + + public string minorVersion { + get { return this.minorVersionField; } + set { this.minorVersionField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class BandwidthGroup : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class BrowserTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] browsersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("browsers")] + public Technology[] browsers { + get { return this.browsersField; } + set { this.browsersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class BrowserLanguageTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] browserLanguagesField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("browserLanguages")] + public Technology[] browserLanguages { + get { return this.browserLanguagesField; } + set { this.browserLanguagesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeviceCapabilityTargeting { + private Technology[] targetedDeviceCapabilitiesField; + + private Technology[] excludedDeviceCapabilitiesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedDeviceCapabilities")] + public Technology[] targetedDeviceCapabilities { + get { return this.targetedDeviceCapabilitiesField; } + set { this.targetedDeviceCapabilitiesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedDeviceCapabilities")] + public Technology[] excludedDeviceCapabilities { + get { return this.excludedDeviceCapabilitiesField; } + set { this.excludedDeviceCapabilitiesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeviceCategoryTargeting { + private Technology[] targetedDeviceCategoriesField; + + private Technology[] excludedDeviceCategoriesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedDeviceCategories")] + public Technology[] targetedDeviceCategories { + get { return this.targetedDeviceCategoriesField; } + set { this.targetedDeviceCategoriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedDeviceCategories")] + public Technology[] excludedDeviceCategories { + get { return this.excludedDeviceCategoriesField; } + set { this.excludedDeviceCategoriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeviceManufacturerTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] deviceManufacturersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deviceManufacturers")] + public Technology[] deviceManufacturers { + get { return this.deviceManufacturersField; } + set { this.deviceManufacturersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class MobileCarrierTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] mobileCarriersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("mobileCarriers")] + public Technology[] mobileCarriers { + get { return this.mobileCarriersField; } + set { this.mobileCarriersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class MobileDeviceTargeting { + private Technology[] targetedMobileDevicesField; + + private Technology[] excludedMobileDevicesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedMobileDevices")] + public Technology[] targetedMobileDevices { + get { return this.targetedMobileDevicesField; } + set { this.targetedMobileDevicesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedMobileDevices")] + public Technology[] excludedMobileDevices { + get { return this.excludedMobileDevicesField; } + set { this.excludedMobileDevicesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class MobileDeviceSubmodelTargeting { + private Technology[] targetedMobileDeviceSubmodelsField; + + private Technology[] excludedMobileDeviceSubmodelsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedMobileDeviceSubmodels")] + public Technology[] targetedMobileDeviceSubmodels { + get { return this.targetedMobileDeviceSubmodelsField; } + set { this.targetedMobileDeviceSubmodelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedMobileDeviceSubmodels")] + public Technology[] excludedMobileDeviceSubmodels { + get { return this.excludedMobileDeviceSubmodelsField; } + set { this.excludedMobileDeviceSubmodelsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class OperatingSystemTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] operatingSystemsField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("operatingSystems")] + public Technology[] operatingSystems { + get { return this.operatingSystemsField; } + set { this.operatingSystemsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class OperatingSystemVersionTargeting { + private Technology[] targetedOperatingSystemVersionsField; + + private Technology[] excludedOperatingSystemVersionsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedOperatingSystemVersions")] + public Technology[] targetedOperatingSystemVersions { + get { return this.targetedOperatingSystemVersionsField; } + set { this.targetedOperatingSystemVersionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedOperatingSystemVersions")] + public Technology[] excludedOperatingSystemVersions { + get { return this.excludedOperatingSystemVersionsField; } + set { this.excludedOperatingSystemVersionsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class UserDomainTargeting { + private string[] domainsField; + + private bool targetedField; + + private bool targetedFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("domains")] + public string[] domains { + get { return this.domainsField; } + set { this.domainsField = value; } + } + + public bool targeted { + get { return this.targetedField; } + set { + this.targetedField = value; + this.targetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetedSpecified { + get { return this.targetedFieldSpecified; } + set { this.targetedFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ContentTargeting { + private long[] targetedContentIdsField; + + private long[] excludedContentIdsField; + + private long[] targetedVideoCategoryIdsField; + + private long[] excludedVideoCategoryIdsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedContentIds")] + public long[] targetedContentIds { + get { return this.targetedContentIdsField; } + set { this.targetedContentIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedContentIds")] + public long[] excludedContentIds { + get { return this.excludedContentIdsField; } + set { this.excludedContentIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedVideoCategoryIds")] + public long[] targetedVideoCategoryIds { + get { return this.targetedVideoCategoryIdsField; } + set { this.targetedVideoCategoryIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedVideoCategoryIds")] + public long[] excludedVideoCategoryIds { + get { return this.excludedVideoCategoryIdsField; } + set { this.excludedVideoCategoryIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class VideoPositionTargeting { + private VideoPositionTarget[] targetedPositionsField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("targetedPositions")] + public VideoPositionTarget[] targetedPositions { + get { return this.targetedPositionsField; } + set { this.targetedPositionsField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class VideoPositionTarget { + private VideoPosition videoPositionField; + + private VideoBumperType videoBumperTypeField; + + private bool videoBumperTypeFieldSpecified; + + private VideoPositionWithinPod videoPositionWithinPodField; + + public VideoPosition videoPosition { + get { return this.videoPositionField; } + set { this.videoPositionField = value; } + } + + public VideoBumperType videoBumperType { + get { return this.videoBumperTypeField; } + set { + this.videoBumperTypeField = value; + this.videoBumperTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoBumperTypeSpecified { + get { return this.videoBumperTypeFieldSpecified; } + set { this.videoBumperTypeFieldSpecified = value; } + } + + public VideoPositionWithinPod videoPositionWithinPod { + get { return this.videoPositionWithinPodField; } + set { this.videoPositionWithinPodField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class VideoPosition { + private VideoPositionType positionTypeField; + + private bool positionTypeFieldSpecified; + + private int midrollIndexField; + + private bool midrollIndexFieldSpecified; + + public VideoPositionType positionType { + get { return this.positionTypeField; } + set { + this.positionTypeField = value; + this.positionTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool positionTypeSpecified { + get { return this.positionTypeFieldSpecified; } + set { this.positionTypeFieldSpecified = value; } + } + + public int midrollIndex { + get { return this.midrollIndexField; } + set { + this.midrollIndexField = value; + this.midrollIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool midrollIndexSpecified { + get { return this.midrollIndexFieldSpecified; } + set { this.midrollIndexFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoPosition.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum VideoPositionType { + PREROLL, + MIDROLL, + POSTROLL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum VideoBumperType { + BEFORE, + AFTER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class VideoPositionWithinPod { + private int indexField; + + private bool indexFieldSpecified; + + public int index { + get { return this.indexField; } + set { + this.indexField = value; + this.indexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool indexSpecified { + get { return this.indexFieldSpecified; } + set { this.indexFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum StartDateTimeType { + USE_START_DATE_TIME, + IMMEDIATELY, + ONE_HOUR_FROM_NOW + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AdRuleStatus { + ACTIVE, + INACTIVE, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum FrequencyCapBehavior { + TURN_ON, + TURN_OFF, + DEFER, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnknownAdRuleSlot))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StandardPoddingAdRuleSlot))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OptimizedPoddingAdRuleSlot))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NoPoddingAdRuleSlot))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class BaseAdRuleSlot { + private long idField; + + private bool idFieldSpecified; + + private AdRuleSlotBehavior slotBehaviorField; + + private bool slotBehaviorFieldSpecified; + + private long minVideoAdDurationField; + + private bool minVideoAdDurationFieldSpecified; + + private long maxVideoAdDurationField; + + private bool maxVideoAdDurationFieldSpecified; + + private MidrollFrequencyType videoMidrollFrequencyTypeField; + + private bool videoMidrollFrequencyTypeFieldSpecified; + + private string videoMidrollFrequencyField; + + private AdRuleSlotBumper bumperField; + + private bool bumperFieldSpecified; + + private long maxBumperDurationField; + + private bool maxBumperDurationFieldSpecified; + + private long minPodDurationField; + + private bool minPodDurationFieldSpecified; + + private long maxPodDurationField; + + private bool maxPodDurationFieldSpecified; + + private int maxAdsInPodField; + + private bool maxAdsInPodFieldSpecified; + + private string baseAdRuleSlotTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public AdRuleSlotBehavior slotBehavior { + get { return this.slotBehaviorField; } + set { + this.slotBehaviorField = value; + this.slotBehaviorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool slotBehaviorSpecified { + get { return this.slotBehaviorFieldSpecified; } + set { this.slotBehaviorFieldSpecified = value; } + } + + public long minVideoAdDuration { + get { return this.minVideoAdDurationField; } + set { + this.minVideoAdDurationField = value; + this.minVideoAdDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minVideoAdDurationSpecified { + get { return this.minVideoAdDurationFieldSpecified; } + set { this.minVideoAdDurationFieldSpecified = value; } + } + + public long maxVideoAdDuration { + get { return this.maxVideoAdDurationField; } + set { + this.maxVideoAdDurationField = value; + this.maxVideoAdDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxVideoAdDurationSpecified { + get { return this.maxVideoAdDurationFieldSpecified; } + set { this.maxVideoAdDurationFieldSpecified = value; } + } + + public MidrollFrequencyType videoMidrollFrequencyType { + get { return this.videoMidrollFrequencyTypeField; } + set { + this.videoMidrollFrequencyTypeField = value; + this.videoMidrollFrequencyTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoMidrollFrequencyTypeSpecified { + get { return this.videoMidrollFrequencyTypeFieldSpecified; } + set { this.videoMidrollFrequencyTypeFieldSpecified = value; } + } + + public string videoMidrollFrequency { + get { return this.videoMidrollFrequencyField; } + set { this.videoMidrollFrequencyField = value; } + } + + public AdRuleSlotBumper bumper { + get { return this.bumperField; } + set { + this.bumperField = value; + this.bumperSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bumperSpecified { + get { return this.bumperFieldSpecified; } + set { this.bumperFieldSpecified = value; } + } + + public long maxBumperDuration { + get { return this.maxBumperDurationField; } + set { + this.maxBumperDurationField = value; + this.maxBumperDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxBumperDurationSpecified { + get { return this.maxBumperDurationFieldSpecified; } + set { this.maxBumperDurationFieldSpecified = value; } + } + + public long minPodDuration { + get { return this.minPodDurationField; } + set { + this.minPodDurationField = value; + this.minPodDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minPodDurationSpecified { + get { return this.minPodDurationFieldSpecified; } + set { this.minPodDurationFieldSpecified = value; } + } + + public long maxPodDuration { + get { return this.maxPodDurationField; } + set { + this.maxPodDurationField = value; + this.maxPodDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxPodDurationSpecified { + get { return this.maxPodDurationFieldSpecified; } + set { this.maxPodDurationFieldSpecified = value; } + } + + public int maxAdsInPod { + get { return this.maxAdsInPodField; } + set { + this.maxAdsInPodField = value; + this.maxAdsInPodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxAdsInPodSpecified { + get { return this.maxAdsInPodFieldSpecified; } + set { this.maxAdsInPodFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseAdRuleSlot.Type")] + public string BaseAdRuleSlotType { + get { return this.baseAdRuleSlotTypeField; } + set { this.baseAdRuleSlotTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AdRuleSlotBehavior { + ALWAYS_SHOW, + NEVER_SHOW, + DEFER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum MidrollFrequencyType { + NONE, + EVERY_N_SECONDS, + FIXED_TIME, + EVERY_N_CUEPOINTS, + FIXED_CUE_POINTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AdRuleSlotBumper { + NONE, + BEFORE, + AFTER, + BEFORE_AND_AFTER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class UnknownAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class StandardPoddingAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class OptimizedPoddingAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class NoPoddingAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RequiredNumberError : ApiError { + private RequiredNumberErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredNumberErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredNumberError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum RequiredNumberErrorReason { + REQUIRED, + TOO_LARGE, + TOO_SMALL, + TOO_LARGE_WITH_DETAILS, + TOO_SMALL_WITH_DETAILS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class PoddingError : ApiError { + private PoddingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PoddingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PoddingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum PoddingErrorReason { + INVALID_PODDING_TYPE_NONE, + INVALID_PODDING_TYPE_STANDARD, + INVALID_OPTIMIZED_POD_WITHOUT_DURATION, + INVALID_OPTIMIZED_POD_WITHOUT_ADS, + INVALID_POD_DURATION_RANGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class InventoryTargetingError : ApiError { + private InventoryTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum InventoryTargetingErrorReason { + AT_LEAST_ONE_PLACEMENT_OR_INVENTORY_UNIT_REQUIRED, + INVENTORY_CANNOT_BE_TARGETED_AND_EXCLUDED, + PARENT_CONTAINS_INVALID_MIX_OF_TARGETED_AND_EXCLUDED_AD_UNITS, + INVENTORY_EXCLUSIONS_MUST_HAVE_PARENT_INVENTORY_UNIT, + INVENTORY_UNIT_CANNOT_BE_TARGETED_IF_ANCESTOR_IS_TARGETED, + INVENTORY_UNIT_CANNOT_BE_TARGETED_IF_ANCESTOR_IS_EXCLUDED, + INVENTORY_UNIT_CANNOT_BE_EXCLUDED_IF_ANCESTOR_IS_EXCLUDED, + EXPLICITLY_TARGETED_INVENTORY_UNIT_CANNOT_BE_TARGETED, + EXPLICITLY_TARGETED_INVENTORY_UNIT_CANNOT_BE_EXCLUDED, + SELF_ONLY_INVENTORY_UNIT_NOT_ALLOWED, + SELF_ONLY_INVENTORY_UNIT_WITHOUT_DESCENDANTS, + INVENTORY_FROM_MULTIPLE_NETWORKS_CANNOT_BE_TARGETED_SIMULTANEOUSLY, + INVENTORY_FROM_LOCAL_AND_DISTRIBUTOR_NETWORKS_CANNOT_BE_TARGETED_SIMULTANEOUSLY, + SHARED_INVENTORY_CANNOT_BE_TARGETED_WITH_AUDIENCE_SEGMENTS_SIMULTANEOUSLY, + UNSUPPORTED_LINE_ITEM_TYPE_FOR_SHARED_INVENTORY_TARGETING, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CustomTargetingError : ApiError { + private CustomTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CustomTargetingErrorReason { + KEY_NOT_FOUND, + KEY_COUNT_TOO_LARGE, + KEY_NAME_DUPLICATE, + KEY_NAME_EMPTY, + KEY_NAME_INVALID_LENGTH, + KEY_NAME_INVALID_CHARS, + KEY_NAME_RESERVED, + KEY_DISPLAY_NAME_INVALID_LENGTH, + VALUE_NOT_FOUND, + GET_VALUES_BY_STATEMENT_MUST_CONTAIN_KEY_ID, + VALUE_COUNT_FOR_KEY_TOO_LARGE, + VALUE_NAME_DUPLICATE, + VALUE_NAME_EMPTY, + VALUE_NAME_INVALID_LENGTH, + VALUE_NAME_INVALID_CHARS, + VALUE_DISPLAY_NAME_INVALID_LENGTH, + VALUE_MATCH_TYPE_NOT_ALLOWED, + VALUE_MATCH_TYPE_NOT_EXACT_FOR_PREDEFINED_KEY, + SUFFIX_MATCH_TYPE_NOT_ALLOWED, + CONTAINS_MATCH_TYPE_NOT_ALLOWED, + KEY_WITH_MISSING_VALUES, + CANNOT_OR_DIFFERENT_KEYS, + INVALID_TARGETING_EXPRESSION, + DELETED_KEY_CANNOT_BE_USED_FOR_TARGETING, + DELETED_VALUE_CANNOT_BE_USED_FOR_TARGETING, + VIDEO_BROWSE_BY_KEY_CANNOT_BE_USED_FOR_CUSTOM_TARGETING, + CANNOT_TARGET_AUDIENCE_SEGMENT, + CANNOT_TARGET_INACTIVE_AUDIENCE_SEGMENT, + INVALID_AUDIENCE_SEGMENTS, + ONLY_APPROVED_AUDIENCE_SEGMENTS_CAN_BE_TARGETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AdRuleSlotError : ApiError { + private AdRuleSlotErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRuleSlotErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRuleSlotError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AdRuleSlotErrorReason { + DIFFERENT_STATUS_THAN_AD_RULE, + INVALID_VIDEO_AD_DURATION_RANGE, + INVALID_VIDEO_MIDROLL_FREQUENCY_TYPE, + MALFORMED_VIDEO_MIDROLL_FREQUENCY_CSV, + MALFORMED_VIDEO_MIDROLL_FREQUENCY_SINGLE_NUMBER, + INVALID_OVERLAY_AD_DURATION_RANGE, + INVALID_OVERLAY_MIDROLL_FREQUENCY_TYPE, + MALFORMED_OVERLAY_MIDROLL_FREQUENCY_CSV, + MALFORMED_OVERLAY_MIDROLL_FREQUENCY_SINGLE_NUMBER, + INVALID_BUMPER_MAX_DURATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AdRulePriorityError : ApiError { + private AdRulePriorityErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRulePriorityErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRulePriorityError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AdRulePriorityErrorReason { + DUPLICATE_PRIORITY, + PRIORITIES_NOT_SEQUENTIAL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AdRuleFrequencyCapError : ApiError { + private AdRuleFrequencyCapErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRuleFrequencyCapErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRuleFrequencyCapError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AdRuleFrequencyCapErrorReason { + NO_FREQUENCY_CAPS_SPECIFIED_WHEN_FREQUENCY_CAPS_TURNED_ON, + FREQUENCY_CAPS_SPECIFIED_WHEN_FREQUENCY_CAPS_TURNED_OFF, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AdRuleDateError : ApiError { + private AdRuleDateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRuleDateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRuleDateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AdRuleDateErrorReason { + START_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_NOT_AFTER_START_TIME, + END_DATE_TIME_TOO_LATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "WorkflowActionServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class WorkflowActionService : DfpSoapClient, IWorkflowActionService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public WorkflowActionService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/WorkflowActionService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual WorkflowAction getWorkflowAction(long workflowActionId) { + object[] results = this.Invoke("getWorkflowAction", new object[] { workflowActionId }); + return ((WorkflowAction) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual WorkflowActionPage getWorkflowActionsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getWorkflowActionsByStatement", new object[] { filterStatement }); + return ((WorkflowActionPage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class WorkflowActionPage { + private WorkflowAction[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public WorkflowAction[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class WorkflowAction { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private long[] userIdsField; + + private WorkflowActionType typeField; + + private bool typeFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("userIds")] + public long[] userIds { + get { return this.userIdsField; } + set { this.userIdsField = value; } + } + + public WorkflowActionType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum WorkflowActionType { + APPROVAL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "NetworkServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class NetworkService : DfpSoapClient, INetworkService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public NetworkService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/NetworkService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Network[] getAllNetworks() { + object[] results = this.Invoke("getAllNetworks", new object[0]); + return ((Network[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Network getCurrentNetwork() { + object[] results = this.Invoke("getCurrentNetwork", new object[0]); + return ((Network) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Network makeTestNetwork() { + object[] results = this.Invoke("makeTestNetwork", new object[0]); + return ((Network) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Network updateNetwork(Network network) { + object[] results = this.Invoke("updateNetwork", new object[] { network }); + return ((Network) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Network { + private long idField; + + private bool idFieldSpecified; + + private string displayNameField; + + private string networkCodeField; + + private string propertyCodeField; + + private string timeZoneField; + + private string currencyCodeField; + + private string[] secondaryCurrencyCodesField; + + private string effectiveRootAdUnitIdField; + + private long contentBrowseCustomTargetingKeyIdField; + + private bool contentBrowseCustomTargetingKeyIdFieldSpecified; + + private bool isTestField; + + private bool isTestFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public string networkCode { + get { return this.networkCodeField; } + set { this.networkCodeField = value; } + } + + public string propertyCode { + get { return this.propertyCodeField; } + set { this.propertyCodeField = value; } + } + + public string timeZone { + get { return this.timeZoneField; } + set { this.timeZoneField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryCurrencyCodes")] + public string[] secondaryCurrencyCodes { + get { return this.secondaryCurrencyCodesField; } + set { this.secondaryCurrencyCodesField = value; } + } + + public string effectiveRootAdUnitId { + get { return this.effectiveRootAdUnitIdField; } + set { this.effectiveRootAdUnitIdField = value; } + } + + public long contentBrowseCustomTargetingKeyId { + get { return this.contentBrowseCustomTargetingKeyIdField; } + set { + this.contentBrowseCustomTargetingKeyIdField = value; + this.contentBrowseCustomTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contentBrowseCustomTargetingKeyIdSpecified { + get { return this.contentBrowseCustomTargetingKeyIdFieldSpecified; } + set { this.contentBrowseCustomTargetingKeyIdFieldSpecified = value; } + } + + public bool isTest { + get { return this.isTestField; } + set { + this.isTestField = value; + this.isTestSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTestSpecified { + get { return this.isTestFieldSpecified; } + set { this.isTestFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class NetworkError : ApiError { + private NetworkErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NetworkErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NetworkError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum NetworkErrorReason { + UNKNOWN, + MULTI_CURRENCY_NOT_SUPPORTED, + UNSUPPORTED_CURRENCY, + NETWORK_CURRENCY_CANNOT_BE_SAME_AS_SECONDARY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReconciliationReportServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReconciliationReportService : DfpSoapClient, IReconciliationReportService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReconciliationReportService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/ReconciliationReportService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReport getReconciliationReport(long reconciliationReportId) { + object[] results = this.Invoke("getReconciliationReport", new object[] { reconciliationReportId }); + return ((ReconciliationReport) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReportPage getReconciliationReportsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getReconciliationReportsByStatement", new object[] { filterStatement }); + return ((ReconciliationReportPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReport updateReconciliationReport(ReconciliationReport reconciliationReport) { + object[] results = this.Invoke("updateReconciliationReport", new object[] { reconciliationReport }); + return ((ReconciliationReport) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReport[] updateReconciliationReports([System.Xml.Serialization.XmlElementAttribute("reconciliationReports")] +ReconciliationReport[] reconciliationReports) { + object[] results = this.Invoke("updateReconciliationReports", new object[] { reconciliationReports }); + return ((ReconciliationReport[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ReconciliationReportPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ReconciliationReport[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ReconciliationReport[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ReconciliationReport { + private long idField; + + private bool idFieldSpecified; + + private ReconciliationReportStatus statusField; + + private bool statusFieldSpecified; + + private Date startDateField; + + private string notesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public ReconciliationReportStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public Date startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ReconciliationReportStatus { + DRAFT, + RECONCILED, + REVERTED, + PENDING, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ReconciliationImportError : ApiError { + private ReconciliationImportErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReconciliationImportErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReconciliationImportError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ReconciliationImportErrorReason { + MISSING_EDITABLE_COLUMN, + INCONSISTENT_IMPORT_COLUMNS, + ILLEGAL_CONVERTION, + INCONSISTENT_COLUMNS_COUNT, + IMPORT_INTERNAL_ERROR, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ReconciliationError : ApiError { + private ReconciliationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReconciliationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReconciliationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ReconciliationErrorReason { + CANNOT_CREATE_RECONCILIATION_REPORT_VERSION, + INVALID_RECONCILIATION_REPORT_STATE_TRANSITION, + USER_CANNOT_RECONCILE_RECONCILIATION_REPORT, + CONTRACTED_VOLUME_CANNOT_BE_NULL, + DFP_VOLUME_CANNOT_BE_NULL, + MANUAL_VOLUME_CANNOT_BE_NULL, + THIRD_PARTY_VOLUME_CANNOT_BE_NULL, + DUPLICATE_LINE_ITEM_AND_CREATIVE, + CANNOT_RECONCILE_LINE_ITEM_CREATIVE, + LINE_ITEM_DAYS_MISMATCH, + LINE_ITEM_BILL_OFF_OF_MISMATCH, + CANNOT_MODIFY_RECONCILED_ORDER, + CANNOT_MODIFY_ACROSS_MULTIPLE_RECONCILIATION_REPORTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RangeError : ApiError { + private RangeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RangeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RangeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum RangeErrorReason { + TOO_HIGH, + TOO_LOW, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeWrapperServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeWrapperService : DfpSoapClient, ICreativeWrapperService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeWrapperService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/CreativeWrapperService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapper createCreativeWrapper(CreativeWrapper creativeWrapper) { + object[] results = this.Invoke("createCreativeWrapper", new object[] { creativeWrapper }); + return ((CreativeWrapper) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapper[] createCreativeWrappers([System.Xml.Serialization.XmlElementAttribute("creativeWrappers")] +CreativeWrapper[] creativeWrappers) { + object[] results = this.Invoke("createCreativeWrappers", new object[] { creativeWrappers }); + return ((CreativeWrapper[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapper getCreativeWrapper(long creativeWrapperId) { + object[] results = this.Invoke("getCreativeWrapper", new object[] { creativeWrapperId }); + return ((CreativeWrapper) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapperPage getCreativeWrappersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativeWrappersByStatement", new object[] { filterStatement }); + return ((CreativeWrapperPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performCreativeWrapperAction(CreativeWrapperAction creativeWrapperAction, Statement filterStatement) { + object[] results = this.Invoke("performCreativeWrapperAction", new object[] { creativeWrapperAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapper updateCreativeWrapper(CreativeWrapper creativeWrapper) { + object[] results = this.Invoke("updateCreativeWrapper", new object[] { creativeWrapper }); + return ((CreativeWrapper) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapper[] updateCreativeWrappers([System.Xml.Serialization.XmlElementAttribute("creativeWrappers")] +CreativeWrapper[] creativeWrappers) { + object[] results = this.Invoke("updateCreativeWrappers", new object[] { creativeWrappers }); + return ((CreativeWrapper[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateCreativeWrappers))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateCreativeWrappers))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class CreativeWrapperAction { + private string creativeWrapperActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CreativeWrapperAction.Type")] + public string CreativeWrapperActionType { + get { return this.creativeWrapperActionTypeField; } + set { this.creativeWrapperActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeactivateCreativeWrappers : CreativeWrapperAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ActivateCreativeWrappers : CreativeWrapperAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CreativeWrapperPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeWrapper[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeWrapper[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CreativeWrapper { + private long idField; + + private bool idFieldSpecified; + + private long labelIdField; + + private bool labelIdFieldSpecified; + + private CreativeWrapperHtmlSnippet headerField; + + private CreativeWrapperHtmlSnippet footerField; + + private CreativeWrapperOrdering orderingField; + + private bool orderingFieldSpecified; + + private CreativeWrapperStatus statusField; + + private bool statusFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + + public CreativeWrapperHtmlSnippet header { + get { return this.headerField; } + set { this.headerField = value; } + } + + public CreativeWrapperHtmlSnippet footer { + get { return this.footerField; } + set { this.footerField = value; } + } + + public CreativeWrapperOrdering ordering { + get { return this.orderingField; } + set { + this.orderingField = value; + this.orderingSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderingSpecified { + get { return this.orderingFieldSpecified; } + set { this.orderingFieldSpecified = value; } + } + + public CreativeWrapperStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CreativeWrapperHtmlSnippet { + private string htmlSnippetField; + + public string htmlSnippet { + get { return this.htmlSnippetField; } + set { this.htmlSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CreativeWrapperOrdering { + NO_PREFERENCE, + INNER, + OUTER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CreativeWrapperStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ContentServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ContentService : DfpSoapClient, IContentService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ContentService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/ContentService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContentPage getContentByStatement(Statement statement) { + object[] results = this.Invoke("getContentByStatement", new object[] { statement }); + return ((ContentPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContentPage getContentByStatementAndCustomTargetingValue(Statement filterStatement, long customTargetingValueId) { + object[] results = this.Invoke("getContentByStatementAndCustomTargetingValue", new object[] { filterStatement, customTargetingValueId }); + return ((ContentPage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CmsContent { + private long idField; + + private bool idFieldSpecified; + + private string displayNameField; + + private string cmsContentIdField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public string cmsContentId { + get { return this.cmsContentIdField; } + set { this.cmsContentIdField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Content { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private ContentStatus statusField; + + private bool statusFieldSpecified; + + private ContentStatusDefinedBy statusDefinedByField; + + private bool statusDefinedByFieldSpecified; + + private long[] userDefinedCustomTargetingValueIdsField; + + private long[] mappingRuleDefinedCustomTargetingValueIdsField; + + private CmsContent[] cmsSourcesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ContentStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ContentStatusDefinedBy statusDefinedBy { + get { return this.statusDefinedByField; } + set { + this.statusDefinedByField = value; + this.statusDefinedBySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusDefinedBySpecified { + get { return this.statusDefinedByFieldSpecified; } + set { this.statusDefinedByFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("userDefinedCustomTargetingValueIds")] + public long[] userDefinedCustomTargetingValueIds { + get { return this.userDefinedCustomTargetingValueIdsField; } + set { this.userDefinedCustomTargetingValueIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("mappingRuleDefinedCustomTargetingValueIds")] + public long[] mappingRuleDefinedCustomTargetingValueIds { + get { return this.mappingRuleDefinedCustomTargetingValueIdsField; } + set { this.mappingRuleDefinedCustomTargetingValueIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("cmsSources")] + public CmsContent[] cmsSources { + get { return this.cmsSourcesField; } + set { this.cmsSourcesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ContentStatus { + ACTIVE, + INACTIVE, + ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ContentStatusDefinedBy { + CMS, + USER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ContentPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Content[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Content[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RequiredCollectionError : ApiError { + private RequiredCollectionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredCollectionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredCollectionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum RequiredCollectionErrorReason { + REQUIRED, + TOO_LARGE, + TOO_SMALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class InvalidUrlError : ApiError { + private InvalidUrlErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidUrlErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidUrlError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum InvalidUrlErrorReason { + ILLEGAL_CHARACTERS, + INVALID_FORMAT, + INSECURE_SCHEME, + NO_SCHEME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ContentPartnerError : ApiError { + private ContentPartnerErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ContentPartnerErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ContentPartnerError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ContentPartnerErrorReason { + FEATURE_NOT_ENABLED, + INVALID_PARTNER_TYPE, + NO_PARTNER_CATCH_ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomFieldServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomFieldService : DfpSoapClient, ICustomFieldService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomFieldService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/CustomFieldService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomField createCustomField(CustomField customField) { + object[] results = this.Invoke("createCustomField", new object[] { customField }); + return ((CustomField) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldOption createCustomFieldOption(CustomFieldOption customFieldOption) { + object[] results = this.Invoke("createCustomFieldOption", new object[] { customFieldOption }); + return ((CustomFieldOption) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldOption[] createCustomFieldOptions([System.Xml.Serialization.XmlElementAttribute("customFieldOptions")] +CustomFieldOption[] customFieldOptions) { + object[] results = this.Invoke("createCustomFieldOptions", new object[] { customFieldOptions }); + return ((CustomFieldOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomField[] createCustomFields([System.Xml.Serialization.XmlElementAttribute("customFields")] +CustomField[] customFields) { + object[] results = this.Invoke("createCustomFields", new object[] { customFields }); + return ((CustomField[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomField getCustomField(long customFieldId) { + object[] results = this.Invoke("getCustomField", new object[] { customFieldId }); + return ((CustomField) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldOption getCustomFieldOption(long customFieldOptionId) { + object[] results = this.Invoke("getCustomFieldOption", new object[] { customFieldOptionId }); + return ((CustomFieldOption) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldPage getCustomFieldsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomFieldsByStatement", new object[] { filterStatement }); + return ((CustomFieldPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performCustomFieldAction(CustomFieldAction customFieldAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomFieldAction", new object[] { customFieldAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomField updateCustomField(CustomField customField) { + object[] results = this.Invoke("updateCustomField", new object[] { customField }); + return ((CustomField) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldOption updateCustomFieldOption(CustomFieldOption customFieldOption) { + object[] results = this.Invoke("updateCustomFieldOption", new object[] { customFieldOption }); + return ((CustomFieldOption) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldOption[] updateCustomFieldOptions([System.Xml.Serialization.XmlElementAttribute("customFieldOptions")] +CustomFieldOption[] customFieldOptions) { + object[] results = this.Invoke("updateCustomFieldOptions", new object[] { customFieldOptions }); + return ((CustomFieldOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomField[] updateCustomFields([System.Xml.Serialization.XmlElementAttribute("customFields")] +CustomField[] customFields) { + object[] results = this.Invoke("updateCustomFields", new object[] { customFields }); + return ((CustomField[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateCustomFields))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateCustomFields))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CustomFieldAction { + private string customFieldActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomFieldAction.Type")] + public string CustomFieldActionType { + get { return this.customFieldActionTypeField; } + set { this.customFieldActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeactivateCustomFields : CustomFieldAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ActivateCustomFields : CustomFieldAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CustomFieldPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomField[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomField[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DropDownCustomField))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CustomField { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private CustomFieldEntityType entityTypeField; + + private bool entityTypeFieldSpecified; + + private CustomFieldDataType dataTypeField; + + private bool dataTypeFieldSpecified; + + private CustomFieldVisibility visibilityField; + + private bool visibilityFieldSpecified; + + private string customFieldTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + public CustomFieldEntityType entityType { + get { return this.entityTypeField; } + set { + this.entityTypeField = value; + this.entityTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool entityTypeSpecified { + get { return this.entityTypeFieldSpecified; } + set { this.entityTypeFieldSpecified = value; } + } + + public CustomFieldDataType dataType { + get { return this.dataTypeField; } + set { + this.dataTypeField = value; + this.dataTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dataTypeSpecified { + get { return this.dataTypeFieldSpecified; } + set { this.dataTypeFieldSpecified = value; } + } + + public CustomFieldVisibility visibility { + get { return this.visibilityField; } + set { + this.visibilityField = value; + this.visibilitySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool visibilitySpecified { + get { return this.visibilityFieldSpecified; } + set { this.visibilityFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("CustomField.Type")] + public string CustomFieldType { + get { return this.customFieldTypeField; } + set { this.customFieldTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CustomFieldEntityType { + LINE_ITEM, + ORDER, + CREATIVE, + PRODUCT_TEMPLATE, + PRODUCT, + PROPOSAL, + PROPOSAL_LINE_ITEM, + USER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CustomFieldDataType { + STRING, + NUMBER, + TOGGLE, + DROP_DOWN, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CustomFieldVisibility { + API_ONLY, + READ_ONLY, + FULL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DropDownCustomField : CustomField { + private CustomFieldOption[] optionsField; + + [System.Xml.Serialization.XmlElementAttribute("options")] + public CustomFieldOption[] options { + get { return this.optionsField; } + set { this.optionsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CustomFieldOption { + private long idField; + + private bool idFieldSpecified; + + private long customFieldIdField; + + private bool customFieldIdFieldSpecified; + + private string displayNameField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long customFieldId { + get { return this.customFieldIdField; } + set { + this.customFieldIdField = value; + this.customFieldIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldIdSpecified { + get { return this.customFieldIdFieldSpecified; } + set { this.customFieldIdFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class EntityLimitReachedError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CustomFieldError : ApiError { + private CustomFieldErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomFieldErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomFieldError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CustomFieldErrorReason { + INVALID_CUSTOM_FIELD_FOR_OPTION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProposalLineItemServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProposalLineItemService : DfpSoapClient, IProposalLineItemService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProposalLineItemService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/ProposalLineItemService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItem createProposalLineItem(ProposalLineItem proposalLineItem) { + object[] results = this.Invoke("createProposalLineItem", new object[] { proposalLineItem }); + return ((ProposalLineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItem[] createProposalLineItems([System.Xml.Serialization.XmlElementAttribute("proposalLineItems")] +ProposalLineItem[] proposalLineItems) { + object[] results = this.Invoke("createProposalLineItems", new object[] { proposalLineItems }); + return ((ProposalLineItem[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItem getProposalLineItem(long proposalLineItemId) { + object[] results = this.Invoke("getProposalLineItem", new object[] { proposalLineItemId }); + return ((ProposalLineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItemPage getProposalLineItemsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getProposalLineItemsByStatement", new object[] { filterStatement }); + return ((ProposalLineItemPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performProposalLineItemAction(ProposalLineItemAction proposalLineItemAction, Statement filterStatement) { + object[] results = this.Invoke("performProposalLineItemAction", new object[] { proposalLineItemAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItem updateProposalLineItem(ProposalLineItem proposalLineItem) { + object[] results = this.Invoke("updateProposalLineItem", new object[] { proposalLineItem }); + return ((ProposalLineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItem[] updateProposalLineItems([System.Xml.Serialization.XmlElementAttribute("proposalLineItems")] +ProposalLineItem[] proposalLineItems) { + object[] results = this.Invoke("updateProposalLineItems", new object[] { proposalLineItems }); + return ((ProposalLineItem[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveProposalLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveProposalLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class ProposalLineItemAction { + private string proposalLineItemActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProposalLineItemAction.Type")] + public string ProposalLineItemActionType { + get { return this.proposalLineItemActionTypeField; } + set { this.proposalLineItemActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class UnarchiveProposalLineItems : ProposalLineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ArchiveProposalLineItems : ProposalLineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ProposalLineItemPage { + private ProposalLineItem[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ProposalLineItem[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ProposalLineItem { + private long idField; + + private bool idFieldSpecified; + + private long proposalIdField; + + private bool proposalIdFieldSpecified; + + private long rateCardIdField; + + private bool rateCardIdFieldSpecified; + + private string productIdField; + + private string nameField; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + private string notesField; + + private CostAdjustment costAdjustmentField; + + private bool costAdjustmentFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private long unitsBoughtField; + + private bool unitsBoughtFieldSpecified; + + private int unitsBoughtBufferField; + + private bool unitsBoughtBufferFieldSpecified; + + private DeliveryRateType deliveryRateTypeField; + + private bool deliveryRateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private CompanionDeliveryOption companionDeliveryOptionField; + + private bool companionDeliveryOptionFieldSpecified; + + private CreativeRotationType creativeRotationTypeField; + + private bool creativeRotationTypeFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int lineItemPriorityField; + + private bool lineItemPriorityFieldSpecified; + + private CostType costTypeField; + + private bool costTypeFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private Targeting targetingField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private ProposalLineItemPremium[] premiumsField; + + private Money baseRateField; + + private Money costPerUnitField; + + private Money costField; + + private DeliveryIndicator deliveryIndicatorField; + + private long[] deliveryDataField; + + private ComputedStatus computedStatusField; + + private bool computedStatusFieldSpecified; + + private BillingCap billingCapField; + + private bool billingCapFieldSpecified; + + private BillingSchedule billingScheduleField; + + private bool billingScheduleFieldSpecified; + + private BillingSource billingSourceField; + + private bool billingSourceFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long proposalId { + get { return this.proposalIdField; } + set { + this.proposalIdField = value; + this.proposalIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool proposalIdSpecified { + get { return this.proposalIdFieldSpecified; } + set { this.proposalIdFieldSpecified = value; } + } + + public long rateCardId { + get { return this.rateCardIdField; } + set { + this.rateCardIdField = value; + this.rateCardIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardIdSpecified { + get { return this.rateCardIdFieldSpecified; } + set { this.rateCardIdFieldSpecified = value; } + } + + public string productId { + get { return this.productIdField; } + set { this.productIdField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public CostAdjustment costAdjustment { + get { return this.costAdjustmentField; } + set { + this.costAdjustmentField = value; + this.costAdjustmentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool costAdjustmentSpecified { + get { return this.costAdjustmentFieldSpecified; } + set { this.costAdjustmentFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public long unitsBought { + get { return this.unitsBoughtField; } + set { + this.unitsBoughtField = value; + this.unitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitsBoughtSpecified { + get { return this.unitsBoughtFieldSpecified; } + set { this.unitsBoughtFieldSpecified = value; } + } + + public int unitsBoughtBuffer { + get { return this.unitsBoughtBufferField; } + set { + this.unitsBoughtBufferField = value; + this.unitsBoughtBufferSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitsBoughtBufferSpecified { + get { return this.unitsBoughtBufferFieldSpecified; } + set { this.unitsBoughtBufferFieldSpecified = value; } + } + + public DeliveryRateType deliveryRateType { + get { return this.deliveryRateTypeField; } + set { + this.deliveryRateTypeField = value; + this.deliveryRateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryRateTypeSpecified { + get { return this.deliveryRateTypeFieldSpecified; } + set { this.deliveryRateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + public CompanionDeliveryOption companionDeliveryOption { + get { return this.companionDeliveryOptionField; } + set { + this.companionDeliveryOptionField = value; + this.companionDeliveryOptionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companionDeliveryOptionSpecified { + get { return this.companionDeliveryOptionFieldSpecified; } + set { this.companionDeliveryOptionFieldSpecified = value; } + } + + public CreativeRotationType creativeRotationType { + get { return this.creativeRotationTypeField; } + set { + this.creativeRotationTypeField = value; + this.creativeRotationTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeRotationTypeSpecified { + get { return this.creativeRotationTypeFieldSpecified; } + set { this.creativeRotationTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int lineItemPriority { + get { return this.lineItemPriorityField; } + set { + this.lineItemPriorityField = value; + this.lineItemPrioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemPrioritySpecified { + get { return this.lineItemPriorityFieldSpecified; } + set { this.lineItemPriorityFieldSpecified = value; } + } + + public CostType costType { + get { return this.costTypeField; } + set { + this.costTypeField = value; + this.costTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool costTypeSpecified { + get { return this.costTypeFieldSpecified; } + set { this.costTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public Targeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("premiums")] + public ProposalLineItemPremium[] premiums { + get { return this.premiumsField; } + set { this.premiumsField = value; } + } + + public Money baseRate { + get { return this.baseRateField; } + set { this.baseRateField = value; } + } + + public Money costPerUnit { + get { return this.costPerUnitField; } + set { this.costPerUnitField = value; } + } + + public Money cost { + get { return this.costField; } + set { this.costField = value; } + } + + public DeliveryIndicator deliveryIndicator { + get { return this.deliveryIndicatorField; } + set { this.deliveryIndicatorField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("units", IsNullable = false)] + public long[] deliveryData { + get { return this.deliveryDataField; } + set { this.deliveryDataField = value; } + } + + public ComputedStatus computedStatus { + get { return this.computedStatusField; } + set { + this.computedStatusField = value; + this.computedStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool computedStatusSpecified { + get { return this.computedStatusFieldSpecified; } + set { this.computedStatusFieldSpecified = value; } + } + + public BillingCap billingCap { + get { return this.billingCapField; } + set { + this.billingCapField = value; + this.billingCapSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingCapSpecified { + get { return this.billingCapFieldSpecified; } + set { this.billingCapFieldSpecified = value; } + } + + public BillingSchedule billingSchedule { + get { return this.billingScheduleField; } + set { + this.billingScheduleField = value; + this.billingScheduleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingScheduleSpecified { + get { return this.billingScheduleFieldSpecified; } + set { this.billingScheduleFieldSpecified = value; } + } + + public BillingSource billingSource { + get { return this.billingSourceField; } + set { + this.billingSourceField = value; + this.billingSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingSourceSpecified { + get { return this.billingSourceFieldSpecified; } + set { this.billingSourceFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CostAdjustment { + NONE, + MAKE_GOOD, + BARTER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum DeliveryRateType { + EVENLY, + FRONTLOADED, + AS_FAST_AS_POSSIBLE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum RoadblockingType { + ONLY_ONE, + ONE_OR_MORE, + AS_MANY_AS_POSSIBLE, + ALL_ROADBLOCK, + CREATIVE_SET + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CompanionDeliveryOption { + OPTIONAL, + AT_LEAST_ONE, + ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CreativeRotationType { + EVEN, + OPTIMIZED, + MANUAL, + SEQUENTIAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class FrequencyCap { + private int maxImpressionsField; + + private bool maxImpressionsFieldSpecified; + + private int numTimeUnitsField; + + private bool numTimeUnitsFieldSpecified; + + private TimeUnit timeUnitField; + + private bool timeUnitFieldSpecified; + + public int maxImpressions { + get { return this.maxImpressionsField; } + set { + this.maxImpressionsField = value; + this.maxImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxImpressionsSpecified { + get { return this.maxImpressionsFieldSpecified; } + set { this.maxImpressionsFieldSpecified = value; } + } + + public int numTimeUnits { + get { return this.numTimeUnitsField; } + set { + this.numTimeUnitsField = value; + this.numTimeUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numTimeUnitsSpecified { + get { return this.numTimeUnitsFieldSpecified; } + set { this.numTimeUnitsFieldSpecified = value; } + } + + public TimeUnit timeUnit { + get { return this.timeUnitField; } + set { + this.timeUnitField = value; + this.timeUnitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool timeUnitSpecified { + get { return this.timeUnitFieldSpecified; } + set { this.timeUnitFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum TimeUnit { + MINUTE, + HOUR, + DAY, + WEEK, + MONTH, + LIFETIME, + POD, + STREAM + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum LineItemType { + SPONSORSHIP, + STANDARD, + NETWORK, + BULK, + PRICE_PRIORITY, + HOUSE, + LEGACY_DFP, + CLICK_TRACKING, + ADSENSE, + AD_EXCHANGE, + BUMPER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CostType { + CPC, + CPD, + CPM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CreativePlaceholder { + private Size sizeField; + + private CreativePlaceholder[] companionsField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private long idField; + + private bool idFieldSpecified; + + private int expectedCreativeCountField; + + private bool expectedCreativeCountFieldSpecified; + + private CreativeSizeType creativeSizeTypeField; + + private bool creativeSizeTypeFieldSpecified; + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companions")] + public CreativePlaceholder[] companions { + get { return this.companionsField; } + set { this.companionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public int expectedCreativeCount { + get { return this.expectedCreativeCountField; } + set { + this.expectedCreativeCountField = value; + this.expectedCreativeCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expectedCreativeCountSpecified { + get { return this.expectedCreativeCountFieldSpecified; } + set { this.expectedCreativeCountFieldSpecified = value; } + } + + public CreativeSizeType creativeSizeType { + get { return this.creativeSizeTypeField; } + set { + this.creativeSizeTypeField = value; + this.creativeSizeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeSizeTypeSpecified { + get { return this.creativeSizeTypeFieldSpecified; } + set { this.creativeSizeTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CreativeSizeType { + PIXEL, + ASPECT_RATIO, + INTERSTITIAL + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DropDownCustomFieldValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class BaseCustomFieldValue { + private long customFieldIdField; + + private bool customFieldIdFieldSpecified; + + private string baseCustomFieldValueTypeField; + + public long customFieldId { + get { return this.customFieldIdField; } + set { + this.customFieldIdField = value; + this.customFieldIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldIdSpecified { + get { return this.customFieldIdFieldSpecified; } + set { this.customFieldIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseCustomFieldValue.Type")] + public string BaseCustomFieldValueType { + get { return this.baseCustomFieldValueTypeField; } + set { this.baseCustomFieldValueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DropDownCustomFieldValue : BaseCustomFieldValue { + private long customFieldOptionIdField; + + private bool customFieldOptionIdFieldSpecified; + + public long customFieldOptionId { + get { return this.customFieldOptionIdField; } + set { + this.customFieldOptionIdField = value; + this.customFieldOptionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldOptionIdSpecified { + get { return this.customFieldOptionIdFieldSpecified; } + set { this.customFieldOptionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CustomFieldValue : BaseCustomFieldValue { + private Value valueField; + + public Value value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ProposalLineItemPremium { + private long rateCardCustomizationIdField; + + private bool rateCardCustomizationIdFieldSpecified; + + private ProposalLineItemPremiumStatus statusField; + + private bool statusFieldSpecified; + + public long rateCardCustomizationId { + get { return this.rateCardCustomizationIdField; } + set { + this.rateCardCustomizationIdField = value; + this.rateCardCustomizationIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardCustomizationIdSpecified { + get { return this.rateCardCustomizationIdFieldSpecified; } + set { this.rateCardCustomizationIdFieldSpecified = value; } + } + + public ProposalLineItemPremiumStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ProposalLineItemPremiumStatus { + INCLUDED, + EXCLUDED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeliveryIndicator { + private double expectedDeliveryPercentageField; + + private bool expectedDeliveryPercentageFieldSpecified; + + private double actualDeliveryPercentageField; + + private bool actualDeliveryPercentageFieldSpecified; + + public double expectedDeliveryPercentage { + get { return this.expectedDeliveryPercentageField; } + set { + this.expectedDeliveryPercentageField = value; + this.expectedDeliveryPercentageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expectedDeliveryPercentageSpecified { + get { return this.expectedDeliveryPercentageFieldSpecified; } + set { this.expectedDeliveryPercentageFieldSpecified = value; } + } + + public double actualDeliveryPercentage { + get { return this.actualDeliveryPercentageField; } + set { + this.actualDeliveryPercentageField = value; + this.actualDeliveryPercentageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool actualDeliveryPercentageSpecified { + get { return this.actualDeliveryPercentageFieldSpecified; } + set { this.actualDeliveryPercentageFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ComputedStatus { + DELIVERY_EXTENDED, + DELIVERING, + READY, + PAUSED, + NEEDS_CREATIVES, + PAUSED_INVENTORY_RELEASED, + PENDING_APPROVAL, + COMPLETED, + DISAPPROVED, + DRAFT, + CANCELED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum BillingCap { + NO_CAP, + CAPPED_CUMULATIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum BillingSchedule { + PRORATED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum BillingSource { + CONTRACTED, + DFP_VOLUME, + THIRD_PARTY_VOLUME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class UserDomainTargetingError : ApiError { + private UserDomainTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public UserDomainTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "UserDomainTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum UserDomainTargetingErrorReason { + INVALID_DOMAIN_NAMES, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class TechnologyTargetingError : ApiError { + private TechnologyTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TechnologyTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TechnologyTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum TechnologyTargetingErrorReason { + MOBILE_LINE_ITEM_CONTAINS_WEB_TECH_CRITERIA, + WEB_LINE_ITEM_CONTAINS_MOBILE_TECH_CRITERIA, + MOBILE_CARRIER_TARGETING_FEATURE_NOT_ENABLED, + DEVICE_CAPABILITY_TARGETING_FEATURE_NOT_ENABLED, + DEVICE_CATEGORY_TARGETING_FEATURE_NOT_ENABLED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ReservationDetailsError : ApiError { + private ReservationDetailsErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReservationDetailsErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReservationDetailsError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ReservationDetailsErrorReason { + UNLIMITED_UNITS_BOUGHT_NOT_ALLOWED, + UNLIMITED_END_DATE_TIME_NOT_ALLOWED, + PERCENTAGE_UNITS_BOUGHT_TOO_HIGH, + DURATION_NOT_ALLOWED, + UNIT_TYPE_NOT_ALLOWED, + COST_TYPE_NOT_ALLOWED, + COST_TYPE_UNIT_TYPE_MISMATCH_NOT_ALLOWED, + LINE_ITEM_TYPE_NOT_ALLOWED, + NETWORK_REMNANT_ORDER_CANNOT_UPDATE_LINEITEM_TYPE, + BACKFILL_WEBPROPERTY_CODE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ProposalLineItemError : ApiError { + private ProposalLineItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProposalLineItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProposalLineItemError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ProposalLineItemErrorReason { + NOT_SAME_RATE_CARD, + LINE_ITEM_TYPE_NOT_ALLOWED, + END_DATE_TIME_NOT_AFTER_START_TIME, + END_DATE_TIME_TOO_LATE, + START_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_IS_IN_PAST, + FRONTLOADED_NOT_ALLOWED, + ALL_ROADBLOCK_NOT_ALLOWED, + CREATIVE_SET_ROADBLOCK_NOT_ALLOWED, + ALREADY_STARTED, + CONFLICT_WITH_PRODUCT, + MOBILE_TECH_CRITERIA_NOT_SUPPORTED, + UNSUPPORTED_TARGETING_TYPE, + WRONG_COST, + INVALID_PRIORITY_FOR_LINE_ITEM_TYPE, + UPDATE_PROPOSAL_LINE_ITEM_NOT_ALLOWED, + CANNOT_UPDATE_TO_OR_FROM_CREATIVE_SET_ROADBLOCK, + SEQUENTIAL_CREATIVE_ROTATION_NOT_ALLOWED, + UPDATE_RESERVATION_NOT_ALLOWED, + INVALID_COMPANION_DELIVERY_OPTION_FOR_ROADBLOCKING_TYPE, + INCONSISTENT_ROADBLOCK_TYPE, + INVALID_UNITS_BOUGHT_BUFFER, + UPDATE_COST_ADJUSTMENT_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ProposalLineItemActionError : ApiError { + private ProposalLineItemActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProposalLineItemActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProposalLineItemActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ProposalLineItemActionErrorReason { + NOT_APPLICABLE, + PROPOSAL_NOT_EDITABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ProposalError : ApiError { + private ProposalErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProposalErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProposalError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ProposalErrorReason { + AD_SERVER_UNKNOWN_ERROR, + AD_SERVER_API_ERROR, + UPDATE_ADVERTISER_NOT_ALLOWED, + UPDATE_PROPOSAL_NOT_ALLOWED, + INVALID_CONTACT, + DUPLICATED_CONTACT, + UNACCEPTABLE_COMPANY_CREDIT_STATUS, + PRIMARY_AGENCY_REQUIRED, + PRIMARY_AGENCY_NOT_UNIQUE, + DUPLICATED_COMPANY_ASSOCIATION, + DUPLICATED_SALESPERSON, + DUPLICATED_SALES_PLANNER, + DUPLICATED_TRAFFICKER, + HAS_NO_UNARCHIVED_PROPOSAL_LINEITEMS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ProductError : ApiError { + private ProductErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProductErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ProductErrorReason { + TEMPLATE_NOT_FOUND, + MALFORMED_PRODUCT_ID, + BAD_PRODUCT_ID_FEATURE, + BAD_PRODUCT_TEMPLATE_ID, + CANNOT_UPDATE_ARCHIVED_PRODUCT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class PrecisionError : ApiError { + private PrecisionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PrecisionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PrecisionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum PrecisionErrorReason { + WRONG_PRECISION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class GeoTargetingError : ApiError { + private GeoTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public GeoTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GeoTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum GeoTargetingErrorReason { + TARGETED_LOCATIONS_NOT_EXCLUDABLE, + EXCLUDED_LOCATIONS_CANNOT_HAVE_CHILDREN_TARGETED, + POSTAL_CODES_CANNOT_BE_EXCLUDED, + UNTARGETABLE_LOCATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class GenericTargetingError : ApiError { + private GenericTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public GenericTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GenericTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum GenericTargetingErrorReason { + CONFLICTING_INCLUSION_OR_EXCLUSION_OF_SIBLINGS, + INCLUDING_DESCENDANTS_OF_EXCLUDED_CRITERIA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class FrequencyCapError : ApiError { + private FrequencyCapErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FrequencyCapErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FrequencyCapError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum FrequencyCapErrorReason { + IMPRESSION_LIMIT_EXCEEDED, + IMPRESSIONS_TOO_LOW, + RANGE_LIMIT_EXCEEDED, + RANGE_TOO_LOW, + DUPLICATE_TIME_RANGE, + TOO_MANY_FREQUENCY_CAPS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DayPartTargetingError : ApiError { + private DayPartTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DayPartTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DayPartTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum DayPartTargetingErrorReason { + INVALID_HOUR, + INVALID_MINUTE, + END_TIME_NOT_AFTER_START_TIME, + TIME_PERIODS_OVERLAP, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CustomFieldValueError : ApiError { + private CustomFieldValueErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomFieldValueErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomFieldValueError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CustomFieldValueErrorReason { + CUSTOM_FIELD_NOT_FOUND, + CUSTOM_FIELD_INACTIVE, + CUSTOM_FIELD_OPTION_NOT_FOUND, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class BillingError : ApiError { + private BillingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BillingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BillingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum BillingErrorReason { + UNSUPPORTED_BILLING_SCHEDULE, + UNSUPPORTED_BILLING_CAP, + MISSING_BILLING_SOURCE, + MISSING_BILLING_SCHEDULE, + MISSING_BILLING_CAP, + INVALID_BILLING_SOURCE_FOR_OFFLINE, + UPDATE_BILLING_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReportServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReportService : DfpSoapClient, IReportService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReportService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/ReportService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual string getReportDownloadURL(long reportJobId, ExportFormat exportFormat) { + object[] results = this.Invoke("getReportDownloadURL", new object[] { reportJobId, exportFormat }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual string getReportDownloadUrlWithOptions(long reportJobId, ReportDownloadOptions reportDownloadOptions) { + object[] results = this.Invoke("getReportDownloadUrlWithOptions", new object[] { reportJobId, reportDownloadOptions }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReportJob getReportJob(long reportJobId) { + object[] results = this.Invoke("getReportJob", new object[] { reportJobId }); + return ((ReportJob) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReportJob runReportJob(ReportJob reportJob) { + object[] results = this.Invoke("runReportJob", new object[] { reportJob }); + return ((ReportJob) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ReportQuery { + private Dimension[] dimensionsField; + + private ReportQueryAdUnitView adUnitViewField; + + private bool adUnitViewFieldSpecified; + + private Column[] columnsField; + + private DimensionAttribute[] dimensionAttributesField; + + private long[] customFieldIdsField; + + private Date startDateField; + + private Date endDateField; + + private DateRangeType dateRangeTypeField; + + private bool dateRangeTypeFieldSpecified; + + private DimensionFilter[] dimensionFiltersField; + + private Statement statementField; + + private string timeZoneField; + + [System.Xml.Serialization.XmlElementAttribute("dimensions")] + public Dimension[] dimensions { + get { return this.dimensionsField; } + set { this.dimensionsField = value; } + } + + public ReportQueryAdUnitView adUnitView { + get { return this.adUnitViewField; } + set { + this.adUnitViewField = value; + this.adUnitViewSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adUnitViewSpecified { + get { return this.adUnitViewFieldSpecified; } + set { this.adUnitViewFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("columns")] + public Column[] columns { + get { return this.columnsField; } + set { this.columnsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("dimensionAttributes")] + public DimensionAttribute[] dimensionAttributes { + get { return this.dimensionAttributesField; } + set { this.dimensionAttributesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldIds")] + public long[] customFieldIds { + get { return this.customFieldIdsField; } + set { this.customFieldIdsField = value; } + } + + public Date startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public Date endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + public DateRangeType dateRangeType { + get { return this.dateRangeTypeField; } + set { + this.dateRangeTypeField = value; + this.dateRangeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dateRangeTypeSpecified { + get { return this.dateRangeTypeFieldSpecified; } + set { this.dateRangeTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("dimensionFilters")] + public DimensionFilter[] dimensionFilters { + get { return this.dimensionFiltersField; } + set { this.dimensionFiltersField = value; } + } + + public Statement statement { + get { return this.statementField; } + set { this.statementField = value; } + } + + public string timeZone { + get { return this.timeZoneField; } + set { this.timeZoneField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum Dimension { + MONTH, + MONTH_AND_YEAR, + WEEK, + DATE, + DAY, + HOUR, + LINE_ITEM_ID, + LINE_ITEM_NAME, + LINE_ITEM_TYPE, + ORDER_ID, + ORDER_NAME, + ADVERTISER_ID, + ADVERTISER_NAME, + SALESPERSON_ID, + SALESPERSON_NAME, + CREATIVE_ID, + CREATIVE_NAME, + CREATIVE_TYPE, + CREATIVE_SIZE, + AD_UNIT_ID, + AD_UNIT_NAME, + PLACEMENT_ID, + PLACEMENT_NAME, + GENERIC_CRITERION_NAME, + COUNTRY_CRITERIA_ID, + COUNTRY_NAME, + REGION_CRITERIA_ID, + REGION_NAME, + CITY_CRITERIA_ID, + CITY_NAME, + METRO_CRITERIA_ID, + METRO_NAME, + POSTAL_CODE_CRITERIA_ID, + POSTAL_CODE, + CUSTOM_TARGETING_VALUE_ID, + CUSTOM_CRITERIA, + ACTIVITY_ID, + ACTIVITY_NAME, + ACTIVITY_GROUP_ID, + ACTIVITY_GROUP_NAME, + CONTENT_ID, + CONTENT_NAME, + AD_REQUEST_AD_UNIT_SIZES, + AD_REQUEST_CUSTOM_CRITERIA, + MASTER_COMPANION_CREATIVE_ID, + MASTER_COMPANION_CREATIVE_NAME, + DISTRIBUTION_PARTNER_ID, + DISTRIBUTION_PARTNER_NAME, + CONTENT_PARTNER_ID, + CONTENT_PARTNER_NAME, + RIGHTS_HOLDER_ID, + RIGHTS_HOLDER_NAME, + PROPOSAL_LINE_ITEM_ID, + PROPOSAL_LINE_ITEM_NAME, + PROPOSAL_ID, + PROPOSAL_NAME, + PROPOSAL_SALESPERSON_ID, + PROPOSAL_SALESPERSON_NAME, + PROPOSAL_ADVERTISER_ID, + PROPOSAL_ADVERTISER_NAME, + PROPOSAL_AGENCY_ID, + PROPOSAL_AGENCY_NAME, + PRODUCT_ID, + PRODUCT_NAME, + PRODUCT_TEMPLATE_ID, + PRODUCT_TEMPLATE_NAME, + AUDIENCE_SEGMENT_ID, + AUDIENCE_SEGMENT_NAME, + AUDIENCE_SEGMENT_DATA_PROVIDER_NAME + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportQuery.AdUnitView", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ReportQueryAdUnitView { + TOP_LEVEL, + FLAT, + HIERARCHICAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum Column { + AD_SERVER_IMPRESSIONS, + AD_SERVER_TARGETED_IMPRESSIONS, + AD_SERVER_CLICKS, + AD_SERVER_TARGETED_CLICKS, + AD_SERVER_CTR, + AD_SERVER_CPM_AND_CPC_REVENUE, + AD_SERVER_CPD_REVENUE, + AD_SERVER_ALL_REVENUE, + AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM, + AD_SERVER_WITH_CPD_AVERAGE_ECPM, + AD_SERVER_INVENTORY_LEVEL_PERCENT_IMPRESSIONS, + AD_SERVER_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + AD_SERVER_INVENTORY_LEVEL_PERCENT_CLICKS, + AD_SERVER_LINE_ITEM_LEVEL_PERCENT_CLICKS, + AD_SERVER_INVENTORY_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + AD_SERVER_INVENTORY_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_SERVER_LINE_ITEM_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + AD_SERVER_LINE_ITEM_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_SERVER_DELIVERY_INDICATOR, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + ADSENSE_LINE_ITEM_LEVEL_IMPRESSIONS, + ADSENSE_LINE_ITEM_LEVEL_TARGETED_IMPRESSIONS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + ADSENSE_LINE_ITEM_LEVEL_CLICKS, + ADSENSE_LINE_ITEM_LEVEL_TARGETED_CLICKS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CTR, + ADSENSE_LINE_ITEM_LEVEL_CTR, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_REVENUE, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_AVERAGE_ECPM, + ADSENSE_LINE_ITEM_LEVEL_AVERAGE_ECPM, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_PERCENT_IMPRESSIONS, + ADSENSE_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_PERCENT_CLICKS, + ADSENSE_LINE_ITEM_LEVEL_PERCENT_CLICKS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_WITH_CPD_PERCENT_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_IMPRESSIONS, + AD_EXCHANGE_LINE_ITEM_LEVEL_TARGETED_IMPRESSIONS, + AD_EXCHANGE_LINE_ITEM_LEVEL_CLICKS, + AD_EXCHANGE_LINE_ITEM_LEVEL_TARGETED_CLICKS, + AD_EXCHANGE_LINE_ITEM_LEVEL_CTR, + AD_EXCHANGE_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + AD_EXCHANGE_LINE_ITEM_LEVEL_PERCENT_CLICKS, + AD_EXCHANGE_LINE_ITEM_LEVEL_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_AVERAGE_ECPM, + TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + TOTAL_LINE_ITEM_LEVEL_IMPRESSIONS, + TOTAL_LINE_ITEM_LEVEL_TARGETED_IMPRESSIONS, + TOTAL_INVENTORY_LEVEL_CLICKS, + TOTAL_LINE_ITEM_LEVEL_CLICKS, + TOTAL_LINE_ITEM_LEVEL_TARGETED_CLICKS, + TOTAL_INVENTORY_LEVEL_CTR, + TOTAL_LINE_ITEM_LEVEL_CTR, + TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE, + TOTAL_INVENTORY_LEVEL_ALL_REVENUE, + TOTAL_LINE_ITEM_LEVEL_CPM_AND_CPC_REVENUE, + TOTAL_LINE_ITEM_LEVEL_ALL_REVENUE, + TOTAL_INVENTORY_LEVEL_WITHOUT_CPD_AVERAGE_ECPM, + TOTAL_INVENTORY_LEVEL_WITH_CPD_AVERAGE_ECPM, + TOTAL_LINE_ITEM_LEVEL_WITHOUT_CPD_AVERAGE_ECPM, + TOTAL_LINE_ITEM_LEVEL_WITH_CPD_AVERAGE_ECPM, + TOTAL_INVENTORY_LEVEL_UNFILLED_IMPRESSIONS, + MERGED_AD_SERVER_DELIVERY_INDICATOR, + MERGED_AD_SERVER_IMPRESSIONS, + MERGED_AD_SERVER_CLICKS, + MERGED_AD_SERVER_CTR, + MERGED_AD_SERVER_CPM_AND_CPC_REVENUE, + MERGED_AD_SERVER_ALL_REVENUE, + MERGED_AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM, + MERGED_AD_SERVER_WITH_CPD_AVERAGE_ECPM, + OPTIMIZATION_CONTROL_IMPRESSIONS, + OPTIMIZATION_CONTROL_CLICKS, + OPTIMIZATION_CONTROL_CTR, + OPTIMIZATION_OPTIMIZED_IMPRESSIONS, + OPTIMIZATION_OPTIMIZED_CLICKS, + OPTIMIZATION_NON_OPTIMIZED_IMPRESSIONS, + OPTIMIZATION_NON_OPTIMIZED_CLICKS, + OPTIMIZATION_EXTRA_CLICKS, + OPTIMIZATION_OPTIMIZED_CTR, + OPTIMIZATION_LIFT, + OPTIMIZATION_COVERAGE, + OPTIMIZATION_BEHIND_SCHEDULE_IMPRESSIONS, + OPTIMIZATION_NO_CLICKS_RECORDED_IMPRESSIONS, + OPTIMIZATION_SPONSORSHIP_IMPRESSIONS, + OPTIMIZATION_AS_FAST_AS_POSSIBLE_IMPRESSIONS, + OPTIMIZATION_NO_ABSOLUTE_LIFETIME_GOAL_IMPRESSIONS, + OPTIMIZATION_CONTROL_REVENUE, + OPTIMIZATION_OPTIMIZED_REVENUE, + OPTIMIZATION_CONTROL_ECPM, + OPTIMIZATION_OPTIMIZED_ECPM, + OPTIMIZATION_FREED_UP_IMPRESSIONS, + OPTIMIZATION_ECPM_LIFT, + REACH_FREQUENCY, + REACH_AVERAGE_REVENUE, + REACH, + SELL_THROUGH_FORECASTED_IMPRESSIONS, + SELL_THROUGH_AVAILABLE_IMPRESSIONS, + SELL_THROUGH_RESERVED_IMPRESSIONS, + SELL_THROUGH_SELL_THROUGH_RATE, + RICH_MEDIA_BACKUP_IMAGES, + RICH_MEDIA_DISPLAY_TIME, + RICH_MEDIA_AVERAGE_DISPLAY_TIME, + RICH_MEDIA_EXPANSIONS, + RICH_MEDIA_EXPANDING_TIME, + RICH_MEDIA_INTERACTION_TIME, + RICH_MEDIA_INTERACTION_COUNT, + RICH_MEDIA_INTERACTION_RATE, + RICH_MEDIA_AVERAGE_INTERACTION_TIME, + RICH_MEDIA_INTERACTION_IMPRESSIONS, + RICH_MEDIA_MANUAL_CLOSES, + RICH_MEDIA_FULL_SCREEN_IMPRESSIONS, + RICH_MEDIA_VIDEO_INTERACTIONS, + RICH_MEDIA_VIDEO_INTERACTION_RATE, + RICH_MEDIA_VIDEO_MUTES, + RICH_MEDIA_VIDEO_PAUSES, + RICH_MEDIA_VIDEO_PLAYES, + RICH_MEDIA_VIDEO_MIDPOINTS, + RICH_MEDIA_VIDEO_COMPLETES, + RICH_MEDIA_VIDEO_REPLAYS, + RICH_MEDIA_VIDEO_STOPS, + RICH_MEDIA_VIDEO_UNMUTES, + RICH_MEDIA_VIDEO_VIEW_TIME, + RICH_MEDIA_VIDEO_VIEW_RATE, + RICH_MEDIA_CUSTOM_CONVERSION_TIME_VALUE, + RICH_MEDIA_CUSTOM_CONVERSION_COUNT_VALUE, + VIDEO_INTERACTION_START, + VIDEO_INTERACTION_FIRST_QUARTILE, + VIDEO_INTERACTION_MIDPOINT, + VIDEO_INTERACTION_THIRD_QUARTILE, + VIDEO_INTERACTION_COMPLETE, + VIDEO_INTERACTION_VIEW_RATE, + VIDEO_INTERACTION_AVERAGE_VIEW_RATE, + VIDEO_INTERACTION_COMPLETION_RATE, + VIDEO_INTERACTION_ERROR_COUNT, + VIDEO_INTERACTION_VIDEO_LENGTH, + VIDEO_INTERACTION_PAUSE, + VIDEO_INTERACTION_RESUME, + VIDEO_INTERACTION_REWIND, + VIDEO_INTERACTION_MUTE, + VIDEO_INTERACTION_UNMUTE, + VIDEO_INTERACTION_COLLAPSE, + VIDEO_INTERACTION_EXPAND, + VIDEO_INTERACTION_FULL_SCREEN, + VIDEO_INTERACTION_AVERAGE_INTERACTION_RATE, + VIDEO_INTERACTION_VIDEO_SKIPS, + VIDEO_INTERACTION_VIDEO_SKIP_SHOWN, + VIDEO_INTERACTION_ENGAGED_VIEW, + VIDEO_INTERACTION_VIEW_THROUGH_RATE, + ACTIVE_VIEW_VIEWABLE_IMPRESSIONS, + ACTIVE_VIEW_NOT_VIEWABLE_IMPRESSIONS, + ACTIVE_VIEW_NOT_MEASURABLE_IMPRESSIONS, + ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE, + ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS, + ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE, + DISTRIBUTION_PARTNER_IMPRESSIONS, + DISTRIBUTION_PARTNER_CLICKS, + DISTRIBUTION_PARTNER_CTR, + DISTRIBUTION_PARTNER_GROSS_REVENUE, + DISTRIBUTION_PARTNER_HOST_REVENUE, + DISTRIBUTION_PARTNER_HOST_ECPM, + DISTRIBUTION_PARTNER_PARTNER_REVENUE, + DISTRIBUTION_PARTNER_PARTNER_ECPM, + CONTENT_PARTNER_IMPRESSIONS, + CONTENT_PARTNER_CLICKS, + CONTENT_PARTNER_CTR, + CONTENT_PARTNER_GROSS_REVENUE, + CONTENT_PARTNER_HOST_REVENUE, + CONTENT_PARTNER_HOST_ECPM, + CONTENT_PARTNER_PARTNER_REVENUE, + CONTENT_PARTNER_PARTNER_ECPM, + RIGHTS_HOLDER_IMPRESSIONS, + RIGHTS_HOLDER_CLICKS, + RIGHTS_HOLDER_CTR, + RIGHTS_HOLDER_GROSS_REVENUE, + RIGHTS_HOLDER_HOST_REVENUE, + RIGHTS_HOLDER_HOST_ECPM, + RIGHTS_HOLDER_PARTNER_REVENUE, + RIGHTS_HOLDER_PARTNER_ECPM, + VIEW_THROUGH_CONVERSIONS, + CONVERSIONS_PER_THOUSAND_IMPRESSIONS, + CLICK_THROUGH_CONVERSIONS, + CONVERSIONS_PER_CLICK, + VIEW_THROUGH_REVENUE, + CLICK_THROUGH_REVENUE, + TOTAL_CONVERSIONS, + TOTAL_CONVERSION_REVENUE, + CONTRACTED_REVENUE_CONTRACTED_NET_REVENUE, + CONTRACTED_REVENUE_LOCAL_CONTRACTED_NET_REVENUE, + CONTRACTED_REVENUE_CONTRACTED_GROSS_REVENUE, + CONTRACTED_REVENUE_LOCAL_CONTRACTED_GROSS_REVENUE, + CONTRACTED_REVENUE_CONTRACTED_PLACEMENT_NET_REVENUE, + CONTRACTED_REVENUE_CONTRACTED_PLACEMENT_GROSS_REVENUE, + CONTRACTED_REVENUE_CONTRACTED_VAT, + CONTRACTED_REVENUE_LOCAL_CONTRACTED_VAT, + CONTRACTED_REVENUE_CONTRACTED_AGENCY_COMMISSION, + CONTRACTED_REVENUE_LOCAL_CONTRACTED_AGENCY_COMMISSION, + SALES_CONTRACT_CONTRACTED_IMPRESSIONS, + SALES_CONTRACT_CONTRACTED_CLICKS, + SALES_CONTRACT_CONTRACTED_VOLUME, + SALES_CONTRACT_BUDGET, + SALES_CONTRACT_REMAINING_BUDGET, + SALES_CONTRACT_BUFFERED_IMPRESSIONS, + SALES_CONTRACT_BUFFERED_CLICKS, + UNIFIED_REVENUE_UNIFIED_NET_REVENUE, + UNIFIED_REVENUE_LOCAL_UNIFIED_NET_REVENUE, + UNIFIED_REVENUE_UNIFIED_GROSS_REVENUE, + UNIFIED_REVENUE_LOCAL_UNIFIED_GROSS_REVENUE, + UNIFIED_REVENUE_UNIFIED_AGENCY_COMMISSION, + UNIFIED_REVENUE_LOCAL_UNIFIED_AGENCY_COMMISSION, + SALES_PIPELINE_PIPELINE_NET_REVENUE, + SALES_PIPELINE_LOCAL_PIPELINE_NET_REVENUE, + SALES_PIPELINE_PIPELINE_GROSS_REVENUE, + SALES_PIPELINE_LOCAL_PIPELINE_GROSS_REVENUE, + SALES_PIPELINE_PIPELINE_AGENCY_COMMISSION, + SALES_PIPELINE_LOCAL_PIPELINE_AGENCY_COMMISSION, + RECONCILIATION_LAST_DATE_TIME, + RECONCILIATION_RECONCILIATION_STATUS, + RECONCILIATION_DFP_VOLUME, + RECONCILIATION_THIRD_PARTY_VOLUME, + RECONCILIATION_RECONCILED_VOLUME, + RECONCILIATION_DISCREPANCY, + BILLING_BILLABLE_NET_REVENUE, + BILLING_LOCAL_BILLABLE_NET_REVENUE, + BILLING_BILLABLE_GROSS_REVENUE, + BILLING_LOCAL_BILLABLE_GROSS_REVENUE, + BILLING_BILLABLE_VAT, + BILLING_LOCAL_BILLABLE_VAT, + BILLING_BILLABLE_AGENCY_COMMISSION, + BILLING_LOCAL_BILLABLE_AGENCY_COMMISSION, + DISCOUNTS_BREAKDOWN_ADDITIONAL_ADJUSTMENT, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_OVERALL_DISCOUNT, + DISCOUNTS_BREAKDOWN_BILLABLE_NET_OVERALL_DISCOUNT, + DISCOUNTS_BREAKDOWN_BILLABLE_NET_EXCLUDED_PREMIUMS, + DISCOUNTS_BREAKDOWN_BILLABLE_NET_ADVERTISER_DISCOUNT, + DISCOUNTS_BREAKDOWN_BILLABLE_NET_PRODUCT_ADJUSTMENT, + DISCOUNTS_BREAKDOWN_BILLABLE_NET_PROPOSAL_DISCOUNT, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_EXCLUDED_PREMIUMS, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_ADVERTISER_DISCOUNT, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_PRODUCT_ADJUSTMENT, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_PROPOSAL_DISCOUNT, + SALESPERSON_PERFORMANCE_SHARED_PIPELINE_NET_REVENUE, + SALESPERSON_PERFORMANCE_SHARED_PIPELINE_GROSS_REVENUE, + SALESPERSON_PERFORMANCE_SHARED_UNIFIED_NET_REVENUE, + SALESPERSON_PERFORMANCE_SHARED_UNIFIED_GROSS_REVENUE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum DimensionAttribute { + LINE_ITEM_LABELS, + LINE_ITEM_LABEL_IDS, + LINE_ITEM_OPTIMIZABLE, + LINE_ITEM_DELIVERY_PACING, + LINE_ITEM_FREQUENCY_CAP, + ADVERTISER_EXTERNAL_ID, + ORDER_START_DATE_TIME, + ORDER_END_DATE_TIME, + ORDER_EXTERNAL_ID, + ORDER_PO_NUMBER, + ORDER_AGENCY, + ORDER_AGENCY_ID, + ORDER_LABELS, + ORDER_LABEL_IDS, + ORDER_TRAFFICKER, + ORDER_SECONDARY_TRAFFICKERS, + ORDER_SALESPERSON, + ORDER_SECONDARY_SALESPEOPLE, + ORDER_LIFETIME_IMPRESSIONS, + ORDER_LIFETIME_CLICKS, + ORDER_LIFETIME_MERGED_IMPRESSIONS, + ORDER_LIFETIME_MERGED_CLICKS, + ORDER_BOOKED_CPM, + ORDER_BOOKED_CPC, + LINE_ITEM_START_DATE_TIME, + LINE_ITEM_END_DATE_TIME, + LINE_ITEM_EXTERNAL_ID, + LINE_ITEM_COST_TYPE, + LINE_ITEM_COST_PER_UNIT, + LINE_ITEM_CURRENCY_CODE, + LINE_ITEM_GOAL_QUANTITY, + LINE_ITEM_SPONSORSHIP_GOAL_PERCENTAGE, + LINE_ITEM_LIFETIME_IMPRESSIONS, + LINE_ITEM_LIFETIME_CLICKS, + LINE_ITEM_LIFETIME_MERGED_IMPRESSIONS, + LINE_ITEM_LIFETIME_MERGED_CLICKS, + LINE_ITEM_PRIORITY, + CREATIVE_OR_CREATIVE_SET, + MASTER_COMPANION_TYPE, + LINE_ITEM_CONTRACTED_QUANTITY, + LINE_ITEM_DISCOUNT, + LINE_ITEM_NON_CPD_BOOKED_REVENUE, + ADVERTISER_LABELS, + ADVERTISER_LABEL_IDS, + CREATIVE_CLICK_THROUGH_URL, + LINE_ITEM_CREATIVE_START_DATE, + LINE_ITEM_CREATIVE_END_DATE, + PROPOSAL_START_DATE_TIME, + PROPOSAL_END_DATE_TIME, + PROPOSAL_CREATION_DATE_TIME, + PROPOSAL_PROBABILITY_TO_CLOSE, + PROPOSAL_STATUS, + PROPOSAL_CURRENCY, + PROPOSAL_EXCHANGE_RATE, + PROPOSAL_AGENCY_COMMISSION_RATE, + PROPOSAL_VAT_RATE, + PROPOSAL_DISCOUNT, + PROPOSAL_ADVERTISER_DISCOUNT, + PROPOSAL_ADVERTISER, + PROPOSAL_ADVERTISER_ID, + PROPOSAL_AGENCIES, + PROPOSAL_AGENCY_IDS, + PROPOSAL_PO_NUMBER, + PROPOSAL_PRIMARY_SALESPERSON, + PROPOSAL_SECONDARY_SALESPEOPLE, + PROPOSAL_BILLING_SOURCE, + PROPOSAL_BILLING_CAP, + PROPOSAL_BILLING_SCHEDULE, + PROPOSAL_LINE_ITEM_START_DATE_TIME, + PROPOSAL_LINE_ITEM_END_DATE_TIME, + PROPOSAL_LINE_ITEM_RATE_TYPE, + PROPOSAL_LINE_ITEM_COST_PER_UNIT, + PROPOSAL_LINE_ITEM_LOCAL_COST_PER_UNIT, + PROPOSAL_LINE_ITEM_COST_PER_UNIT_GROSS, + PROPOSAL_LINE_ITEM_LOCAL_COST_PER_UNIT_GROSS, + PROPOSAL_LINE_ITEM_TYPE_AND_PRIORITY, + PROPOSAL_LINE_ITEM_SIZE, + PROPOSAL_LINE_ITEM_PRODUCT_ADJUSTMENT, + PROPOSAL_LINE_ITEM_BUFFER, + PROPOSAL_LINE_ITEM_TARGET_RATE_NET, + PROPOSAL_LINE_ITEM_BILLING_SOURCE, + PROPOSAL_LINE_ITEM_BILLING_CAP, + PROPOSAL_LINE_ITEM_BILLING_SCHEDULE, + PRODUCT_TEMPLATE_RATE_TYPE, + PRODUCT_TEMPLATE_STATUS, + PRODUCT_TEMPLATE_TYPE_AND_PRIORITY, + PRODUCT_PRODUCT_TEMPLATE_NAME, + PRODUCT_RATE_TYPE, + PRODUCT_STATUS, + PRODUCT_TYPE_AND_PRIORITY, + PROPOSAL_ADVERTISER_TYPE, + PROPOSAL_ADVERTISER_CREDIT_STATUS, + PROPOSAL_AGENCY_TYPE, + PROPOSAL_AGENCY_CREDIT_STATUS, + CONTENT_CMS_NAME, + CONTENT_CMS_VIDEO_ID, + AD_UNIT_CODE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum DateRangeType { + TODAY, + YESTERDAY, + LAST_WEEK, + LAST_MONTH, + REACH_LIFETIME, + CUSTOM_DATE, + NEXT_DAY, + NEXT_90_DAYS, + NEXT_WEEK, + NEXT_MONTH, + CURRENT_AND_NEXT_MONTH, + NEXT_QUARTER, + NEXT_3_MONTHS, + NEXT_12_MONTHS + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum DimensionFilter { + ADVERTISERS, + ACTIVE_ADVERTISERS, + HOUSE_ADVERTISERS, + NON_HOUSE_ADVERTISERS, + ALL_SALESPEOPLE, + WHOLE_NETWORK, + CURRENT_USER_ORDERS, + STARTED_ORDERS, + COMPLETED_ORDERS, + MOBILE_LINE_ITEMS, + WEB_LINE_ITEMS, + ACTIVE_AD_UNITS, + INACTIVE_AD_UNITS, + MOBILE_INVENTORY_UNITS, + WEB_INVENTORY_UNITS, + ARCHIVED_AD_UNITS, + ACTIVE_PLACEMENTS, + INACTIVE_PLACEMENTS, + ARCHIVED_PLACEMENTS, + OPTIMIZABLE_ORDERS, + PARTNER_STATS_TYPE_ESTIMATED, + PARTNER_STATS_TYPE_RECONCILED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ReportJob { + private long idField; + + private bool idFieldSpecified; + + private ReportQuery reportQueryField; + + private ReportJobStatus reportJobStatusField; + + private bool reportJobStatusFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public ReportQuery reportQuery { + get { return this.reportQueryField; } + set { this.reportQueryField = value; } + } + + public ReportJobStatus reportJobStatus { + get { return this.reportJobStatusField; } + set { + this.reportJobStatusField = value; + this.reportJobStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reportJobStatusSpecified { + get { return this.reportJobStatusFieldSpecified; } + set { this.reportJobStatusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ReportJobStatus { + COMPLETED, + IN_PROGRESS, + FAILED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ReportDownloadOptions { + private ExportFormat exportFormatField; + + private bool exportFormatFieldSpecified; + + private bool includeReportPropertiesField; + + private bool includeReportPropertiesFieldSpecified; + + private bool includeTotalsRowField; + + private bool includeTotalsRowFieldSpecified; + + private bool useGzipCompressionField; + + private bool useGzipCompressionFieldSpecified; + + public ExportFormat exportFormat { + get { return this.exportFormatField; } + set { + this.exportFormatField = value; + this.exportFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool exportFormatSpecified { + get { return this.exportFormatFieldSpecified; } + set { this.exportFormatFieldSpecified = value; } + } + + public bool includeReportProperties { + get { return this.includeReportPropertiesField; } + set { + this.includeReportPropertiesField = value; + this.includeReportPropertiesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeReportPropertiesSpecified { + get { return this.includeReportPropertiesFieldSpecified; } + set { this.includeReportPropertiesFieldSpecified = value; } + } + + public bool includeTotalsRow { + get { return this.includeTotalsRowField; } + set { + this.includeTotalsRowField = value; + this.includeTotalsRowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeTotalsRowSpecified { + get { return this.includeTotalsRowFieldSpecified; } + set { this.includeTotalsRowFieldSpecified = value; } + } + + public bool useGzipCompression { + get { return this.useGzipCompressionField; } + set { + this.useGzipCompressionField = value; + this.useGzipCompressionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool useGzipCompressionSpecified { + get { return this.useGzipCompressionFieldSpecified; } + set { this.useGzipCompressionFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ExportFormat { + TSV, + CSV_EXCEL, + CSV_DUMP, + XML, + XLS, + XLSX + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ReportError : ApiError { + private ReportErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReportErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ReportErrorReason { + DEFAULT, + REPORT_ACCESS_NOT_ALLOWED, + DIMENSION_VIEW_NOT_ALLOWED, + DIMENSION_COMBINATION_NOT_ALLOWED, + ATTRIBUTE_VIEW_NOT_ALLOWED, + COLUMN_VIEW_NOT_ALLOWED, + TOO_MANY_CONCURRENT_REPORTS, + REPORT_TOO_BIG, + INVALID_OPERATION_FOR_REPORT_STATE, + INVALID_DIMENSIONS, + INVALID_ATTRIBUTES, + INVALID_COLUMNS, + INVALID_DIMENSION_FILTERS, + INVALID_DATE, + END_DATE_TIME_NOT_AFTER_START_TIME, + NOT_NULL, + ATTRIBUTES_NOT_SUPPORTED_FOR_REQUEST, + COLUMNS_NOT_SUPPORTED_FOR_REQUESTED_DIMENSIONS, + FAILED_TO_STORE_REPORT, + REPORT_NOT_FOUND, + SR_CANNOT_RUN_REPORT_IN_ANOTHER_NETWORK, + INVALID_TIME_ZONE_FOR_FEATURE_NOT_ENABLED, + INVALID_TIME_ZONE_FOR_ID, + UNSUPPORTED_TIME_ZONE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ActivityGroupServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ActivityGroupService : DfpSoapClient, IActivityGroupService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ActivityGroupService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/ActivityGroupService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroup createActivityGroup(ActivityGroup activityGroup) { + object[] results = this.Invoke("createActivityGroup", new object[] { activityGroup }); + return ((ActivityGroup) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroup[] createActivityGroups([System.Xml.Serialization.XmlElementAttribute("activityGroups")] +ActivityGroup[] activityGroups) { + object[] results = this.Invoke("createActivityGroups", new object[] { activityGroups }); + return ((ActivityGroup[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroup getActivityGroup(int activityGroupId) { + object[] results = this.Invoke("getActivityGroup", new object[] { activityGroupId }); + return ((ActivityGroup) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroupPage getActivityGroupsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getActivityGroupsByStatement", new object[] { filterStatement }); + return ((ActivityGroupPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroup updateActivityGroup(ActivityGroup activityGroup) { + object[] results = this.Invoke("updateActivityGroup", new object[] { activityGroup }); + return ((ActivityGroup) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroup[] updateActivityGroups([System.Xml.Serialization.XmlElementAttribute("activityGroups")] +ActivityGroup[] activityGroups) { + object[] results = this.Invoke("updateActivityGroups", new object[] { activityGroups }); + return ((ActivityGroup[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ActivityGroupPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ActivityGroup[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ActivityGroup[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ActivityGroup { + private int idField; + + private bool idFieldSpecified; + + private string nameField; + + private long[] companyIdsField; + + private int impressionsLookbackField; + + private bool impressionsLookbackFieldSpecified; + + private int clicksLookbackField; + + private bool clicksLookbackFieldSpecified; + + private ActivityGroupStatus statusField; + + private bool statusFieldSpecified; + + public int id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companyIds")] + public long[] companyIds { + get { return this.companyIdsField; } + set { this.companyIdsField = value; } + } + + public int impressionsLookback { + get { return this.impressionsLookbackField; } + set { + this.impressionsLookbackField = value; + this.impressionsLookbackSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsLookbackSpecified { + get { return this.impressionsLookbackFieldSpecified; } + set { this.impressionsLookbackFieldSpecified = value; } + } + + public int clicksLookback { + get { return this.clicksLookbackField; } + set { + this.clicksLookbackField = value; + this.clicksLookbackSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clicksLookbackSpecified { + get { return this.clicksLookbackFieldSpecified; } + set { this.clicksLookbackFieldSpecified = value; } + } + + public ActivityGroupStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ActivityGroup.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ActivityGroupStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ActivityError : ApiError { + private ActivityErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ActivityErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ActivityError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ActivityErrorReason { + ACTIVITIES_FEATURE_REQUIRED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LineItemServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LineItemService : DfpSoapClient, ILineItemService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LineItemService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/LineItemService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItem createLineItem(LineItem lineItem) { + object[] results = this.Invoke("createLineItem", new object[] { lineItem }); + return ((LineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItem[] createLineItems([System.Xml.Serialization.XmlElementAttribute("lineItems")] +LineItem[] lineItems) { + object[] results = this.Invoke("createLineItems", new object[] { lineItems }); + return ((LineItem[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItem getLineItem(long lineItemId) { + object[] results = this.Invoke("getLineItem", new object[] { lineItemId }); + return ((LineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemPage getLineItemsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLineItemsByStatement", new object[] { filterStatement }); + return ((LineItemPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performLineItemAction(LineItemAction lineItemAction, Statement filterStatement) { + object[] results = this.Invoke("performLineItemAction", new object[] { lineItemAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItem updateLineItem(LineItem lineItem) { + object[] results = this.Invoke("updateLineItem", new object[] { lineItem }); + return ((LineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItem[] updateLineItems([System.Xml.Serialization.XmlElementAttribute("lineItems")] +LineItem[] lineItems) { + object[] results = this.Invoke("updateLineItems", new object[] { lineItems }); + return ((LineItem[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveAndOverbookLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReleaseLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PauseLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class LineItemAction { + private string lineItemActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LineItemAction.Type")] + public string LineItemActionType { + get { return this.lineItemActionTypeField; } + set { this.lineItemActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class UnarchiveLineItems : LineItemAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ResumeLineItems : LineItemAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ResumeAndOverbookLineItems : ResumeLineItems { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveAndOverbookLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ReserveLineItems : LineItemAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ReserveAndOverbookLineItems : ReserveLineItems { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ReleaseLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class PauseLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeleteLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ArchiveLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ActivateLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class LineItemPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LineItem[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LineItem[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class LineItem : LineItemSummary { + private Targeting targetingField; + + public Targeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItem))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class LineItemSummary { + private long orderIdField; + + private bool orderIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string externalIdField; + + private string orderNameField; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private int autoExtensionDaysField; + + private bool autoExtensionDaysFieldSpecified; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private CreativeRotationType creativeRotationTypeField; + + private bool creativeRotationTypeFieldSpecified; + + private DeliveryRateType deliveryRateTypeField; + + private bool deliveryRateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int priorityField; + + private bool priorityFieldSpecified; + + private UnitType unitTypeField; + + private bool unitTypeFieldSpecified; + + private LineItemSummaryDuration durationField; + + private bool durationFieldSpecified; + + private long unitsBoughtField; + + private bool unitsBoughtFieldSpecified; + + private Money costPerUnitField; + + private Money valueCostPerUnitField; + + private CostType costTypeField; + + private bool costTypeFieldSpecified; + + private LineItemDiscountType discountTypeField; + + private bool discountTypeFieldSpecified; + + private double discountField; + + private bool discountFieldSpecified; + + private long contractedUnitsBoughtField; + + private bool contractedUnitsBoughtFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private EnvironmentType environmentTypeField; + + private bool environmentTypeFieldSpecified; + + private CompanionDeliveryOption companionDeliveryOptionField; + + private bool companionDeliveryOptionFieldSpecified; + + private CreativePersistenceType creativePersistenceTypeField; + + private bool creativePersistenceTypeFieldSpecified; + + private bool allowOverbookField; + + private bool allowOverbookFieldSpecified; + + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + private bool reserveAtCreationField; + + private bool reserveAtCreationFieldSpecified; + + private Stats statsField; + + private DeliveryIndicator deliveryIndicatorField; + + private long[] deliveryDataField; + + private Money budgetField; + + private ComputedStatus statusField; + + private bool statusFieldSpecified; + + private LineItemSummaryReservationStatus reservationStatusField; + + private bool reservationStatusFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private string webPropertyCodeField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private bool disableSameAdvertiserCompetitiveExclusionField; + + private bool disableSameAdvertiserCompetitiveExclusionFieldSpecified; + + private string lastModifiedByAppField; + + private string notesField; + + private DateTime lastModifiedDateTimeField; + + private DateTime creationDateTimeField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private bool isMissingCreativesField; + + private bool isMissingCreativesFieldSpecified; + + private string lineItemSummaryTypeField; + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string externalId { + get { return this.externalIdField; } + set { this.externalIdField = value; } + } + + public string orderName { + get { return this.orderNameField; } + set { this.orderNameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public int autoExtensionDays { + get { return this.autoExtensionDaysField; } + set { + this.autoExtensionDaysField = value; + this.autoExtensionDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool autoExtensionDaysSpecified { + get { return this.autoExtensionDaysFieldSpecified; } + set { this.autoExtensionDaysFieldSpecified = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public CreativeRotationType creativeRotationType { + get { return this.creativeRotationTypeField; } + set { + this.creativeRotationTypeField = value; + this.creativeRotationTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeRotationTypeSpecified { + get { return this.creativeRotationTypeFieldSpecified; } + set { this.creativeRotationTypeFieldSpecified = value; } + } + + public DeliveryRateType deliveryRateType { + get { return this.deliveryRateTypeField; } + set { + this.deliveryRateTypeField = value; + this.deliveryRateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryRateTypeSpecified { + get { return this.deliveryRateTypeFieldSpecified; } + set { this.deliveryRateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + public UnitType unitType { + get { return this.unitTypeField; } + set { + this.unitTypeField = value; + this.unitTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitTypeSpecified { + get { return this.unitTypeFieldSpecified; } + set { this.unitTypeFieldSpecified = value; } + } + + public LineItemSummaryDuration duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public long unitsBought { + get { return this.unitsBoughtField; } + set { + this.unitsBoughtField = value; + this.unitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitsBoughtSpecified { + get { return this.unitsBoughtFieldSpecified; } + set { this.unitsBoughtFieldSpecified = value; } + } + + public Money costPerUnit { + get { return this.costPerUnitField; } + set { this.costPerUnitField = value; } + } + + public Money valueCostPerUnit { + get { return this.valueCostPerUnitField; } + set { this.valueCostPerUnitField = value; } + } + + public CostType costType { + get { return this.costTypeField; } + set { + this.costTypeField = value; + this.costTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool costTypeSpecified { + get { return this.costTypeFieldSpecified; } + set { this.costTypeFieldSpecified = value; } + } + + public LineItemDiscountType discountType { + get { return this.discountTypeField; } + set { + this.discountTypeField = value; + this.discountTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool discountTypeSpecified { + get { return this.discountTypeFieldSpecified; } + set { this.discountTypeFieldSpecified = value; } + } + + public double discount { + get { return this.discountField; } + set { + this.discountField = value; + this.discountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool discountSpecified { + get { return this.discountFieldSpecified; } + set { this.discountFieldSpecified = value; } + } + + public long contractedUnitsBought { + get { return this.contractedUnitsBoughtField; } + set { + this.contractedUnitsBoughtField = value; + this.contractedUnitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contractedUnitsBoughtSpecified { + get { return this.contractedUnitsBoughtFieldSpecified; } + set { this.contractedUnitsBoughtFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + public EnvironmentType environmentType { + get { return this.environmentTypeField; } + set { + this.environmentTypeField = value; + this.environmentTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool environmentTypeSpecified { + get { return this.environmentTypeFieldSpecified; } + set { this.environmentTypeFieldSpecified = value; } + } + + public CompanionDeliveryOption companionDeliveryOption { + get { return this.companionDeliveryOptionField; } + set { + this.companionDeliveryOptionField = value; + this.companionDeliveryOptionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companionDeliveryOptionSpecified { + get { return this.companionDeliveryOptionFieldSpecified; } + set { this.companionDeliveryOptionFieldSpecified = value; } + } + + public CreativePersistenceType creativePersistenceType { + get { return this.creativePersistenceTypeField; } + set { + this.creativePersistenceTypeField = value; + this.creativePersistenceTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativePersistenceTypeSpecified { + get { return this.creativePersistenceTypeFieldSpecified; } + set { this.creativePersistenceTypeFieldSpecified = value; } + } + + public bool allowOverbook { + get { return this.allowOverbookField; } + set { + this.allowOverbookField = value; + this.allowOverbookSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowOverbookSpecified { + get { return this.allowOverbookFieldSpecified; } + set { this.allowOverbookFieldSpecified = value; } + } + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + + public bool reserveAtCreation { + get { return this.reserveAtCreationField; } + set { + this.reserveAtCreationField = value; + this.reserveAtCreationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reserveAtCreationSpecified { + get { return this.reserveAtCreationFieldSpecified; } + set { this.reserveAtCreationFieldSpecified = value; } + } + + public Stats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public DeliveryIndicator deliveryIndicator { + get { return this.deliveryIndicatorField; } + set { this.deliveryIndicatorField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("units", IsNullable = false)] + public long[] deliveryData { + get { return this.deliveryDataField; } + set { this.deliveryDataField = value; } + } + + public Money budget { + get { return this.budgetField; } + set { this.budgetField = value; } + } + + public ComputedStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public LineItemSummaryReservationStatus reservationStatus { + get { return this.reservationStatusField; } + set { + this.reservationStatusField = value; + this.reservationStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reservationStatusSpecified { + get { return this.reservationStatusFieldSpecified; } + set { this.reservationStatusFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public string webPropertyCode { + get { return this.webPropertyCodeField; } + set { this.webPropertyCodeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public bool disableSameAdvertiserCompetitiveExclusion { + get { return this.disableSameAdvertiserCompetitiveExclusionField; } + set { + this.disableSameAdvertiserCompetitiveExclusionField = value; + this.disableSameAdvertiserCompetitiveExclusionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool disableSameAdvertiserCompetitiveExclusionSpecified { + get { return this.disableSameAdvertiserCompetitiveExclusionFieldSpecified; } + set { this.disableSameAdvertiserCompetitiveExclusionFieldSpecified = value; } + } + + public string lastModifiedByApp { + get { return this.lastModifiedByAppField; } + set { this.lastModifiedByAppField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public DateTime creationDateTime { + get { return this.creationDateTimeField; } + set { this.creationDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + public bool isMissingCreatives { + get { return this.isMissingCreativesField; } + set { + this.isMissingCreativesField = value; + this.isMissingCreativesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isMissingCreativesSpecified { + get { return this.isMissingCreativesFieldSpecified; } + set { this.isMissingCreativesFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("LineItemSummary.Type")] + public string LineItemSummaryType { + get { return this.lineItemSummaryTypeField; } + set { this.lineItemSummaryTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum UnitType { + IMPRESSIONS, + CLICKS + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemSummary.Duration", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum LineItemSummaryDuration { + NONE, + LIFETIME, + DAILY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum LineItemDiscountType { + ABSOLUTE_VALUE, + PERCENTAGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CreativePersistenceType { + NOT_PERSISTENT, + PERSISTENT_AND_EXCLUDE_NONE, + PERSISTENT_AND_EXCLUDE_DISPLAY, + PERSISTENT_AND_EXCLUDE_VIDEO, + PERSISTENT_AND_EXCLUDE_ALL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Stats { + private long impressionsDeliveredField; + + private bool impressionsDeliveredFieldSpecified; + + private long clicksDeliveredField; + + private bool clicksDeliveredFieldSpecified; + + private long videoCompletionsDeliveredField; + + private bool videoCompletionsDeliveredFieldSpecified; + + private long videoStartsDeliveredField; + + private bool videoStartsDeliveredFieldSpecified; + + public long impressionsDelivered { + get { return this.impressionsDeliveredField; } + set { + this.impressionsDeliveredField = value; + this.impressionsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsDeliveredSpecified { + get { return this.impressionsDeliveredFieldSpecified; } + set { this.impressionsDeliveredFieldSpecified = value; } + } + + public long clicksDelivered { + get { return this.clicksDeliveredField; } + set { + this.clicksDeliveredField = value; + this.clicksDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clicksDeliveredSpecified { + get { return this.clicksDeliveredFieldSpecified; } + set { this.clicksDeliveredFieldSpecified = value; } + } + + public long videoCompletionsDelivered { + get { return this.videoCompletionsDeliveredField; } + set { + this.videoCompletionsDeliveredField = value; + this.videoCompletionsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoCompletionsDeliveredSpecified { + get { return this.videoCompletionsDeliveredFieldSpecified; } + set { this.videoCompletionsDeliveredFieldSpecified = value; } + } + + public long videoStartsDelivered { + get { return this.videoStartsDeliveredField; } + set { + this.videoStartsDeliveredField = value; + this.videoStartsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoStartsDeliveredSpecified { + get { return this.videoStartsDeliveredFieldSpecified; } + set { this.videoStartsDeliveredFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemSummary.ReservationStatus", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum LineItemSummaryReservationStatus { + RESERVED, + UNRESERVED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RequiredSizeError : ApiError { + private RequiredSizeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredSizeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredSizeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum RequiredSizeErrorReason { + REQUIRED, + NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class OrderError : ApiError { + private OrderErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OrderErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OrderError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum OrderErrorReason { + UPDATE_CANCELED_ORDER_NOT_ALLOWED, + UPDATE_PENDING_APPROVAL_ORDER_NOT_ALLOWED, + UPDATE_ARCHIVED_ORDER_NOT_ALLOWED, + CANNOT_MODIFY_PROPOSAL_ID, + PRIMARY_USER_REQUIRED, + PRIMARY_USER_CANNOT_BE_SECONDARY, + ORDER_TEAM_NOT_ASSOCIATED_WITH_ADVERTISER, + USER_NOT_ON_ORDERS_TEAMS, + AGENCY_NOT_ON_ORDERS_TEAMS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class LineItemOperationError : ApiError { + private LineItemOperationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemOperationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemOperationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum LineItemOperationErrorReason { + NOT_ALLOWED, + NOT_APPLICABLE, + HAS_COMPLETED, + HAS_NO_ACTIVE_CREATIVES, + CANNOT_ACTIVATE_LEGACY_DFP_LINE_ITEM, + CANNOT_DELETE_DELIVERED_LINE_ITEM, + CANNOT_RESERVE_COMPANY_CREDIT_STATUS_NOT_ACTIVE, + CANNOT_ACTIVATE_INVALID_COMPANY_CREDIT_STATUS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class LineItemFlightDateError : ApiError { + private LineItemFlightDateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemFlightDateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemFlightDateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum LineItemFlightDateErrorReason { + START_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_NOT_AFTER_START_TIME, + END_DATE_TIME_TOO_LATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class LineItemError : ApiError { + private LineItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum LineItemErrorReason { + ALREADY_STARTED, + UPDATE_RESERVATION_NOT_ALLOWED, + ALL_ROADBLOCK_NOT_ALLOWED, + CREATIVE_SET_ROADBLOCK_NOT_ALLOWED, + FRACTIONAL_PERCENTAGE_NOT_ALLOWED, + DISCOUNT_NOT_ALLOWED, + UPDATE_CANCELED_LINE_ITEM_NOT_ALLOWED, + UPDATE_PENDING_APPROVAL_LINE_ITEM_NOT_ALLOWED, + UPDATE_ARCHIVED_LINE_ITEM_NOT_ALLOWED, + FRONTLOADED_NOT_ALLOWED, + CREATE_OR_UPDATE_LEGACY_DFP_LINE_ITEM_TYPE_NOT_ALLOWED, + COPY_LINE_ITEM_FROM_DIFFERENT_COMPANY_NOT_ALLOWED, + INVALID_SIZE_FOR_PLATFORM, + INVALID_LINE_ITEM_TYPE_FOR_PLATFORM, + INVALID_WEB_PROPERTY_FOR_PLATFORM, + INVALID_WEB_PROPERTY_FOR_ENVIRONMENT, + AFMA_BACKFILL_NOT_ALLOWED, + UPDATE_ENVIRONMENT_TYPE_NOT_ALLOWED, + COMPANIONS_NOT_ALLOWED, + ROADBLOCKS_WITH_NONROADBLOCKS_NOT_ALLOWED, + CANNOT_UPDATE_TO_OR_FROM_CREATIVE_SET_ROADBLOCK, + UPDATE_FROM_BACKFILL_LINE_ITEM_TYPE_NOT_ALLOWED, + UPDATE_TO_BACKFILL_LINE_ITEM_TYPE_NOT_ALLOWED, + UPDATE_BACKFILL_WEB_PROPERTY_NOT_ALLOWED, + INVALID_COMPANION_DELIVERY_OPTION_FOR_ENVIRONMENT_TYPE, + COMPANION_BACKFILL_REQUIRES_VIDEO, + COMPANION_DELIVERY_OPTION_REQUIRE_PREMIUM, + DUPLICATE_MASTER_SIZES, + INVALID_PRIORITY_FOR_LINE_ITEM_TYPE, + INVALID_ENVIRONMENT_TYPE, + INVALID_ENVIRONMENT_TYPE_FOR_PLATFORM, + INVALID_TYPE_FOR_AUTO_EXTENSION, + INVALID_TYPE_FOR_CONTRACTED_UNITS_BOUGHT, + VIDEO_INVALID_ROADBLOCKING, + BACKFILL_TYPE_NOT_ALLOWED, + COMPANION_DELIVERY_OPTIONS_NOT_ALLOWED_WITH_BACKFILL, + INVALID_WEB_PROPERTY_FOR_ADX_BACKFILL, + INVALID_SIZE_FOR_ENVIRONMENT, + TARGET_PLATOFRM_NOT_ALLOWED, + INVALID_LINE_ITEM_CURRENCY, + LINE_ITEM_CANNOT_HAVE_MULTIPLE_CURRENCIES, + CANNOT_CHANGE_CURRENCY, + INVALID_FOR_OFFLINE, + INVALID_LINE_ITEM_DATE_TIME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class LineItemCreativeAssociationError : ApiError { + private LineItemCreativeAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemCreativeAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum LineItemCreativeAssociationErrorReason { + CREATIVE_IN_WRONG_ADVERTISERS_LIBRARY, + INVALID_LINEITEM_CREATIVE_PAIRING, + STARTDATE_BEFORE_LINEITEM_STARTDATE, + STARTDATE_NOT_BEFORE_LINEITEM_ENDDATE, + ENDDATE_AFTER_LINEITEM_ENDDATE, + ENDDATE_NOT_AFTER_LINEITEM_STARTDATE, + ENDDATE_NOT_AFTER_STARTDATE, + ENDDATE_IN_THE_PAST, + CANNOT_COPY_WITHIN_SAME_LINE_ITEM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ForecastError : ApiError { + private ForecastErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ForecastErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ForecastError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ForecastErrorReason { + SERVER_NOT_AVAILABLE, + INTERNAL_ERROR, + NO_FORECAST_YET, + NOT_ENOUGH_INVENTORY, + SUCCESS, + ZERO_LENGTH_RESERVATION, + EXCEEDED_QUOTA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DateTimeRangeTargetingError : ApiError { + private DateTimeRangeTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DateTimeRangeTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DateTimeRangeTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum DateTimeRangeTargetingErrorReason { + EMPTY_RANGES, + NOT_SPONSORSHIP_LINEITEM, + PAST_RANGES_CHANGED, + RANGES_OVERLAP, + RANGES_OUT_OF_LINEITEM_ACTIVE_PERIOD, + START_TIME_IS_NOT_START_OF_DAY, + END_TIME_IS_NOT_END_OF_DAY, + START_DATE_TIME_IS_IN_PAST, + RANGE_END_TIME_BEFORE_START_TIME, + END_DATE_TIME_IS_TOO_LATE, + LIMITED_RANGES_IN_UNLIMITED_LINEITEM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CreativeError : ApiError { + private CreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CreativeErrorReason { + FLASH_AND_FALLBACK_URL_ARE_SAME, + INVALID_INTERNAL_REDIRECT_URL, + DESTINATION_URL_REQUIRED, + CANNOT_CREATE_OR_UPDATE_LEGACY_DFP_CREATIVE, + CANNOT_CREATE_OR_UPDATE_LEGACY_DFP_MOBILE_CREATIVE, + MISSING_FEATURE, + INVALID_COMPANY_TYPE, + INVALID_ADSENSE_CREATIVE_SIZE, + INVALID_AD_EXCHANGE_CREATIVE_SIZE, + DUPLICATE_ASSET_IN_CREATIVE, + CREATIVE_ASSET_CANNOT_HAVE_ID_AND_BYTE_ARRAY, + CANNOT_CREATE_OR_UPDATE_UNSUPPORTED_CREATIVE, + CANNOT_COPY_VIDEO_CREATIVE_ACROSS_ADVERTISERS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ClickTrackingLineItemError : ApiError { + private ClickTrackingLineItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ClickTrackingLineItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ClickTrackingLineItemError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ClickTrackingLineItemErrorReason { + TYPE_IMMUTABLE, + INVALID_TARGETING_TYPE, + INVALID_ROADBLOCKING_TYPE, + INVALID_CREATIVEROTATION_TYPE, + INVALID_DELIVERY_RATE_TYPE, + UNSUPPORTED_FIELD, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AudienceExtensionError : ApiError { + private AudienceExtensionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AudienceExtensionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceExtensionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AudienceExtensionErrorReason { + FREQUENCY_CAPS_NOT_SUPPORTED, + INVALID_TARGETING, + INVENTORY_UNIT_TARGETING_INVALID, + INVALID_CREATIVE_ROTATION, + INVALID_EXTERNAL_ENTITY_ID, + INVALID_LINE_ITEM_TYPE, + INVALID_MAX_BID, + AUDIENCE_EXTENSION_BULK_UPDATE_NOT_ALLOWED, + UNEXPECTED_AUDIENCE_EXTENSION_ERROR, + MAX_DAILY_BUDGET_AMOUNT_EXCEEDED, + EXTERNAL_CAMPAIGN_ALREADY_EXISTS, + AUDIENCE_EXTENSION_WITHOUT_FEATURE, + AUDIENCE_EXTENSION_WITHOUT_LINKED_ACCOUNT, + CANNOT_OVERRIDE_CREATIVE_SIZE_WITH_AUDIENCE_EXTENSION, + CANNOT_OVERRIDE_FIELD_WITH_AUDIENCE_EXTENSION, + ONLY_ONE_CREATIVE_PLACEHOLDER_ALLOWED, + MULTIPLE_AUDIENCE_EXTENSION_LINE_ITEMS_ON_ORDER, + CANNOT_COPY_AUDIENCE_EXTENSION_LINE_ITEMS_AND_CREATIVES_TOGETHER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LineItemTemplateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LineItemTemplateService : DfpSoapClient, ILineItemTemplateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LineItemTemplateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/LineItemTemplateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemTemplatePage getLineItemTemplatesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLineItemTemplatesByStatement", new object[] { filterStatement }); + return ((LineItemTemplatePage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class LineItemTemplate { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private bool isDefaultField; + + private bool isDefaultFieldSpecified; + + private string lineItemNameField; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private bool enabledForSameAdvertiserExceptionField; + + private bool enabledForSameAdvertiserExceptionFieldSpecified; + + private string notesField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private DateTime startTimeField; + + private DateTime endTimeField; + + private DeliveryRateType deliveryRateTypeField; + + private bool deliveryRateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private CreativeRotationType creativeRotationTypeField; + + private bool creativeRotationTypeFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public bool isDefault { + get { return this.isDefaultField; } + set { + this.isDefaultField = value; + this.isDefaultSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isDefaultSpecified { + get { return this.isDefaultFieldSpecified; } + set { this.isDefaultFieldSpecified = value; } + } + + public string lineItemName { + get { return this.lineItemNameField; } + set { this.lineItemNameField = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + public bool enabledForSameAdvertiserException { + get { return this.enabledForSameAdvertiserExceptionField; } + set { + this.enabledForSameAdvertiserExceptionField = value; + this.enabledForSameAdvertiserExceptionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool enabledForSameAdvertiserExceptionSpecified { + get { return this.enabledForSameAdvertiserExceptionFieldSpecified; } + set { this.enabledForSameAdvertiserExceptionFieldSpecified = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public DateTime startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public DateTime endTime { + get { return this.endTimeField; } + set { this.endTimeField = value; } + } + + public DeliveryRateType deliveryRateType { + get { return this.deliveryRateTypeField; } + set { + this.deliveryRateTypeField = value; + this.deliveryRateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryRateTypeSpecified { + get { return this.deliveryRateTypeFieldSpecified; } + set { this.deliveryRateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + public CreativeRotationType creativeRotationType { + get { return this.creativeRotationTypeField; } + set { + this.creativeRotationTypeField = value; + this.creativeRotationTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeRotationTypeSpecified { + get { return this.creativeRotationTypeFieldSpecified; } + set { this.creativeRotationTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class LineItemTemplatePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LineItemTemplate[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LineItemTemplate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "UserTeamAssociationServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserRecordTeamAssociation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class UserTeamAssociationService : DfpSoapClient, IUserTeamAssociationService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public UserTeamAssociationService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/UserTeamAssociationService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociation createUserTeamAssociation(UserTeamAssociation userTeamAssociation) { + object[] results = this.Invoke("createUserTeamAssociation", new object[] { userTeamAssociation }); + return ((UserTeamAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociation[] createUserTeamAssociations([System.Xml.Serialization.XmlElementAttribute("userTeamAssociations")] +UserTeamAssociation[] userTeamAssociations) { + object[] results = this.Invoke("createUserTeamAssociations", new object[] { userTeamAssociations }); + return ((UserTeamAssociation[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociation getUserTeamAssociation(long teamId, long userId) { + object[] results = this.Invoke("getUserTeamAssociation", new object[] { teamId, userId }); + return ((UserTeamAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociationPage getUserTeamAssociationsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getUserTeamAssociationsByStatement", new object[] { filterStatement }); + return ((UserTeamAssociationPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performUserTeamAssociationAction(UserTeamAssociationAction userTeamAssociationAction, Statement statement) { + object[] results = this.Invoke("performUserTeamAssociationAction", new object[] { userTeamAssociationAction, statement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociation updateUserTeamAssociation(UserTeamAssociation userTeamAssociation) { + object[] results = this.Invoke("updateUserTeamAssociation", new object[] { userTeamAssociation }); + return ((UserTeamAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociation[] updateUserTeamAssociations([System.Xml.Serialization.XmlElementAttribute("userTeamAssociations")] +UserTeamAssociation[] userTeamAssociations) { + object[] results = this.Invoke("updateUserTeamAssociations", new object[] { userTeamAssociations }); + return ((UserTeamAssociation[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteUserTeamAssociations))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class UserTeamAssociationAction { + private string userTeamAssociationActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("UserTeamAssociationAction.Type")] + public string UserTeamAssociationActionType { + get { return this.userTeamAssociationActionTypeField; } + set { this.userTeamAssociationActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeleteUserTeamAssociations : UserTeamAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class UserTeamAssociationPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private UserTeamAssociation[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public UserTeamAssociation[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class UserTeamAssociation : UserRecordTeamAssociation { + private long userIdField; + + private bool userIdFieldSpecified; + + public long userId { + get { return this.userIdField; } + set { + this.userIdField = value; + this.userIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userIdSpecified { + get { return this.userIdFieldSpecified; } + set { this.userIdFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserTeamAssociation))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class UserRecordTeamAssociation { + private long teamIdField; + + private bool teamIdFieldSpecified; + + private TeamAccessType overriddenTeamAccessTypeField; + + private bool overriddenTeamAccessTypeFieldSpecified; + + private TeamAccessType defaultTeamAccessTypeField; + + private bool defaultTeamAccessTypeFieldSpecified; + + private string userRecordTeamAssociationTypeField; + + public long teamId { + get { return this.teamIdField; } + set { + this.teamIdField = value; + this.teamIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool teamIdSpecified { + get { return this.teamIdFieldSpecified; } + set { this.teamIdFieldSpecified = value; } + } + + public TeamAccessType overriddenTeamAccessType { + get { return this.overriddenTeamAccessTypeField; } + set { + this.overriddenTeamAccessTypeField = value; + this.overriddenTeamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overriddenTeamAccessTypeSpecified { + get { return this.overriddenTeamAccessTypeFieldSpecified; } + set { this.overriddenTeamAccessTypeFieldSpecified = value; } + } + + public TeamAccessType defaultTeamAccessType { + get { return this.defaultTeamAccessTypeField; } + set { + this.defaultTeamAccessTypeField = value; + this.defaultTeamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool defaultTeamAccessTypeSpecified { + get { return this.defaultTeamAccessTypeFieldSpecified; } + set { this.defaultTeamAccessTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("UserRecordTeamAssociation.Type")] + public string UserRecordTeamAssociationType { + get { return this.userRecordTeamAssociationTypeField; } + set { this.userRecordTeamAssociationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum TeamAccessType { + NONE, + READ_ONLY, + READ_WRITE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LineItemCreativeAssociationServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LineItemCreativeAssociationService : DfpSoapClient, ILineItemCreativeAssociationService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LineItemCreativeAssociationService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/LineItemCreativeAssociationServ" + "ice"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociation createLineItemCreativeAssociation(LineItemCreativeAssociation lineItemCreativeAssociation) { + object[] results = this.Invoke("createLineItemCreativeAssociation", new object[] { lineItemCreativeAssociation }); + return ((LineItemCreativeAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociation[] createLineItemCreativeAssociations([System.Xml.Serialization.XmlElementAttribute("lineItemCreativeAssociations")] +LineItemCreativeAssociation[] lineItemCreativeAssociations) { + object[] results = this.Invoke("createLineItemCreativeAssociations", new object[] { lineItemCreativeAssociations }); + return ((LineItemCreativeAssociation[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociation getLineItemCreativeAssociation(long lineItemId, long creativeId) { + object[] results = this.Invoke("getLineItemCreativeAssociation", new object[] { lineItemId, creativeId }); + return ((LineItemCreativeAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociationPage getLineItemCreativeAssociationsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLineItemCreativeAssociationsByStatement", new object[] { filterStatement }); + return ((LineItemCreativeAssociationPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual string getPreviewUrl(long lineItemId, long creativeId, string siteUrl) { + object[] results = this.Invoke("getPreviewUrl", new object[] { lineItemId, creativeId, siteUrl }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performLineItemCreativeAssociationAction(LineItemCreativeAssociationAction lineItemCreativeAssociationAction, Statement filterStatement) { + object[] results = this.Invoke("performLineItemCreativeAssociationAction", new object[] { lineItemCreativeAssociationAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociation updateLineItemCreativeAssociation(LineItemCreativeAssociation lineItemCreativeAssociation) { + object[] results = this.Invoke("updateLineItemCreativeAssociation", new object[] { lineItemCreativeAssociation }); + return ((LineItemCreativeAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociation[] updateLineItemCreativeAssociations([System.Xml.Serialization.XmlElementAttribute("lineItemCreativeAssociations")] +LineItemCreativeAssociation[] lineItemCreativeAssociations) { + object[] results = this.Invoke("updateLineItemCreativeAssociations", new object[] { lineItemCreativeAssociations }); + return ((LineItemCreativeAssociation[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateLineItemCreativeAssociations))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLineItemCreativeAssociations))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class LineItemCreativeAssociationAction { + private string lineItemCreativeAssociationActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LineItemCreativeAssociationAction.Type")] + public string LineItemCreativeAssociationActionType { + get { return this.lineItemCreativeAssociationActionTypeField; } + set { this.lineItemCreativeAssociationActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeactivateLineItemCreativeAssociations : LineItemCreativeAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ActivateLineItemCreativeAssociations : LineItemCreativeAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class LineItemCreativeAssociationPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LineItemCreativeAssociation[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LineItemCreativeAssociation[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class LineItemCreativeAssociation { + private long lineItemIdField; + + private bool lineItemIdFieldSpecified; + + private long creativeIdField; + + private bool creativeIdFieldSpecified; + + private long creativeSetIdField; + + private bool creativeSetIdFieldSpecified; + + private double manualCreativeRotationWeightField; + + private bool manualCreativeRotationWeightFieldSpecified; + + private int sequentialCreativeRotationIndexField; + + private bool sequentialCreativeRotationIndexFieldSpecified; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private string destinationUrlField; + + private Size[] sizesField; + + private LineItemCreativeAssociationStatus statusField; + + private bool statusFieldSpecified; + + private LineItemCreativeAssociationStats statsField; + + private DateTime lastModifiedDateTimeField; + + public long lineItemId { + get { return this.lineItemIdField; } + set { + this.lineItemIdField = value; + this.lineItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemIdSpecified { + get { return this.lineItemIdFieldSpecified; } + set { this.lineItemIdFieldSpecified = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { + this.creativeIdField = value; + this.creativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeIdSpecified { + get { return this.creativeIdFieldSpecified; } + set { this.creativeIdFieldSpecified = value; } + } + + public long creativeSetId { + get { return this.creativeSetIdField; } + set { + this.creativeSetIdField = value; + this.creativeSetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeSetIdSpecified { + get { return this.creativeSetIdFieldSpecified; } + set { this.creativeSetIdFieldSpecified = value; } + } + + public double manualCreativeRotationWeight { + get { return this.manualCreativeRotationWeightField; } + set { + this.manualCreativeRotationWeightField = value; + this.manualCreativeRotationWeightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manualCreativeRotationWeightSpecified { + get { return this.manualCreativeRotationWeightFieldSpecified; } + set { this.manualCreativeRotationWeightFieldSpecified = value; } + } + + public int sequentialCreativeRotationIndex { + get { return this.sequentialCreativeRotationIndexField; } + set { + this.sequentialCreativeRotationIndexField = value; + this.sequentialCreativeRotationIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sequentialCreativeRotationIndexSpecified { + get { return this.sequentialCreativeRotationIndexFieldSpecified; } + set { this.sequentialCreativeRotationIndexFieldSpecified = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("sizes")] + public Size[] sizes { + get { return this.sizesField; } + set { this.sizesField = value; } + } + + public LineItemCreativeAssociationStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public LineItemCreativeAssociationStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociation.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum LineItemCreativeAssociationStatus { + ACTIVE, + NOT_SERVING, + INACTIVE, + DELETED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class LineItemCreativeAssociationStats { + private Stats statsField; + + private Long_StatsMapEntry[] creativeSetStatsField; + + private Money costInOrderCurrencyField; + + public Stats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativeSetStats")] + public Long_StatsMapEntry[] creativeSetStats { + get { return this.creativeSetStatsField; } + set { this.creativeSetStatsField = value; } + } + + public Money costInOrderCurrency { + get { return this.costInOrderCurrencyField; } + set { this.costInOrderCurrencyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Long_StatsMapEntry { + private long keyField; + + private bool keyFieldSpecified; + + private Stats valueField; + + public long key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public Stats value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class TemplateInstantiatedCreativeError : ApiError { + private TemplateInstantiatedCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TemplateInstantiatedCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TemplateInstantiatedCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum TemplateInstantiatedCreativeErrorReason { + INACTIVE_CREATIVE_TEMPLATE, + FILE_TYPE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class SwiffyConversionError : ApiError { + private SwiffyConversionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SwiffyConversionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SwiffyConversionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum SwiffyConversionErrorReason { + SERVER_ERROR, + INVALID_FLASH_FILE, + UNSUPPORTED_FLASH, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RichMediaStudioCreativeError : ApiError { + private RichMediaStudioCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RichMediaStudioCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaStudioCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum RichMediaStudioCreativeErrorReason { + CREATION_NOT_ALLOWED, + UKNOWN_ERROR, + INVALID_CODE_GENERATION_REQUEST, + INVALID_CREATIVE_OBJECT, + STUDIO_CONNECTION_ERROR, + PUSHDOWN_DURATION_NOT_ALLOWED, + INVALID_POSITION, + INVALID_Z_INDEX, + INVALID_PUSHDOWN_DURATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class LineItemCreativeAssociationOperationError : ApiError { + private LineItemCreativeAssociationOperationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemCreativeAssociationOperationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociationOperationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum LineItemCreativeAssociationOperationErrorReason { + NOT_ALLOWED, + NOT_APPLICABLE, + CANNOT_ACTIVATE_INVALID_CREATIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class InvalidPhoneNumberError : ApiError { + private InvalidPhoneNumberErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidPhoneNumberErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidPhoneNumberError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum InvalidPhoneNumberErrorReason { + INVALID_FORMAT, + TOO_SHORT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ImageError : ApiError { + private ImageErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ImageErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ImageError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ImageErrorReason { + INVALID_IMAGE, + INVALID_SIZE, + UNEXPECTED_SIZE, + OVERLAY_SIZE_TOO_LARGE, + ANIMATED_NOT_ALLOWED, + ANIMATION_TOO_LONG, + CMYK_JPEG_NOT_ALLOWED, + FLASH_NOT_ALLOWED, + FLASH_WITHOUT_CLICKTAG, + ANIMATED_VISUAL_EFFECT, + FLASH_ERROR, + LAYOUT_PROBLEM, + FLASH_HAS_NETWORK_OBJECTS, + FLASH_HAS_NETWORK_METHODS, + FLASH_HAS_URL, + FLASH_HAS_MOUSE_TRACKING, + FLASH_HAS_RANDOM_NUM, + FLASH_SELF_TARGETS, + FLASH_BAD_GETURL_TARGET, + FLASH_VERSION_NOT_SUPPORTED, + FILE_TOO_LARGE, + SYSTEM_ERROR, + UNEXPECTED_PRIMARY_ASSET_DENSITY, + DUPLICATE_ASSET_DENSITY, + MISSING_DEFAULT_ASSET, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class FileError : ApiError { + private FileErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FileErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FileError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum FileErrorReason { + MISSING_CONTENTS, + SIZE_TOO_LARGE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CustomCreativeError : ApiError { + private CustomCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CustomCreativeErrorReason { + DUPLICATE_MACRO_NAME_FOR_CREATIVE, + SNIPPET_REFERENCES_MISSING_MACRO, + UNRECOGNIZED_MACRO, + CUSTOM_CREATIVE_NOT_ALLOWED, + MISSING_INTERSTITIAL_MACRO, + DUPLICATE_ASSET_IN_MACROS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CreativeSetError : ApiError { + private CreativeSetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeSetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeSetError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CreativeSetErrorReason { + VIDEO_FEATURE_REQUIRED, + CANNOT_CREATE_OR_UPDATE_VIDEO_CREATIVES, + ROADBLOCK_FEATURE_REQUIRED, + MASTER_CREATIVE_CANNOT_BE_COMPANION, + INVALID_ADVERTISER, + UPDATE_MASTER_CREATIVE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CreativeAssetMacroError : ApiError { + private CreativeAssetMacroErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeAssetMacroErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeAssetMacroError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CreativeAssetMacroErrorReason { + INVALID_MACRO_NAME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AssetError : ApiError { + private AssetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AssetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AssetError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AssetErrorReason { + NON_UNIQUE_NAME, + FILE_NAME_TOO_LONG, + FILE_SIZE_TOO_LARGE, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_CLIENT, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_HEIGHT, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_WIDTH, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_FORMAT, + INVALID_CODE_SNIPPET_PARAMETER_VALUE, + INVALID_ASSET_ID, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AdSenseAccountError : ApiError { + private AdSenseAccountErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdSenseAccountErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseAccountError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AdSenseAccountErrorReason { + ASSOCIATE_ACCOUNT_API_ERROR, + GET_AD_SLOT_API_ERROR, + GET_CHANNEL_API_ERROR, + GET_BULK_ACCOUNT_STATUSES_API_ERROR, + RESEND_VERIFICATION_EMAIL_ERROR, + UNEXPECTED_API_RESPONSE_ERROR, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProductServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProductService : DfpSoapClient, IProductService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProductService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/ProductService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Product getProduct(string productId) { + object[] results = this.Invoke("getProduct", new object[] { productId }); + return ((Product) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductPage getProductsByStatement(Statement statement) { + object[] results = this.Invoke("getProductsByStatement", new object[] { statement }); + return ((ProductPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performProductAction(ProductAction productAction, Statement filterStatement) { + object[] results = this.Invoke("performProductAction", new object[] { productAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Product updateProduct(Product product) { + object[] results = this.Invoke("updateProduct", new object[] { product }); + return ((Product) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Product[] updateProducts([System.Xml.Serialization.XmlElementAttribute("products")] +Product[] products) { + object[] results = this.Invoke("updateProducts", new object[] { products }); + return ((Product[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateProducts))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveProducts))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateProducts))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class ProductAction { + private string productActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProductAction.Type")] + public string ProductActionType { + get { return this.productActionTypeField; } + set { this.productActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeactivateProducts : ProductAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ArchiveProducts : ProductAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ActivateProducts : ProductAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ProductPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Product[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Product[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Product { + private string nameField; + + private ProductStatus statusField; + + private bool statusFieldSpecified; + + private ProductType productTypeField; + + private bool productTypeFieldSpecified; + + private long productTemplateIdField; + + private bool productTemplateIdFieldSpecified; + + private string idField; + + private string notesField; + + private string productTemplateDescriptionField; + + private DateTime lastModifiedDateTimeField; + + private RateType rateTypeField; + + private bool rateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int priorityField; + + private bool priorityFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private bool allowFrequencyCapsCustomizationField; + + private bool allowFrequencyCapsCustomizationFieldSpecified; + + private ProductTemplateTargeting targetingField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ProductStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ProductType productType { + get { return this.productTypeField; } + set { + this.productTypeField = value; + this.productTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productTypeSpecified { + get { return this.productTypeFieldSpecified; } + set { this.productTypeFieldSpecified = value; } + } + + public long productTemplateId { + get { return this.productTemplateIdField; } + set { + this.productTemplateIdField = value; + this.productTemplateIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productTemplateIdSpecified { + get { return this.productTemplateIdFieldSpecified; } + set { this.productTemplateIdFieldSpecified = value; } + } + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public string productTemplateDescription { + get { return this.productTemplateDescriptionField; } + set { this.productTemplateDescriptionField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public RateType rateType { + get { return this.rateTypeField; } + set { + this.rateTypeField = value; + this.rateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateTypeSpecified { + get { return this.rateTypeFieldSpecified; } + set { this.rateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public bool allowFrequencyCapsCustomization { + get { return this.allowFrequencyCapsCustomizationField; } + set { + this.allowFrequencyCapsCustomizationField = value; + this.allowFrequencyCapsCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowFrequencyCapsCustomizationSpecified { + get { return this.allowFrequencyCapsCustomizationFieldSpecified; } + set { this.allowFrequencyCapsCustomizationFieldSpecified = value; } + } + + public ProductTemplateTargeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ProductStatus { + ACTIVE, + INACTIVE, + ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ProductType { + DFP, + OFFLINE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum RateType { + CPM, + CPC, + CPD, + FLAT_RATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ProductTemplateTargeting { + private GeoTargeting geoTargetingField; + + private bool allowGeoTargetingCustomizationField; + + private bool allowGeoTargetingCustomizationFieldSpecified; + + private InventoryTargeting inventoryTargetingField; + + private bool allowAdUnitTargetingCustomizationField; + + private bool allowAdUnitTargetingCustomizationFieldSpecified; + + private bool allowPlacementTargetingCustomizationField; + + private bool allowPlacementTargetingCustomizationFieldSpecified; + + private long[] customizableCustomTargetingKeyIdsField; + + private UserDomainTargeting userDomainTargetingField; + + private bool allowUserDomainTargetingCustomizationField; + + private bool allowUserDomainTargetingCustomizationFieldSpecified; + + private BandwidthGroupTargeting bandwidthGroupTargetingField; + + private bool allowBandwidthGroupTargetingCustomizationField; + + private bool allowBandwidthGroupTargetingCustomizationFieldSpecified; + + private BrowserTargeting browserTargetingField; + + private bool allowBrowserTargetingCustomizationField; + + private bool allowBrowserTargetingCustomizationFieldSpecified; + + private BrowserLanguageTargeting browserLanguageTargetingField; + + private bool allowBrowserLanguageTargetingCustomizationField; + + private bool allowBrowserLanguageTargetingCustomizationFieldSpecified; + + private OperatingSystemTargeting operatingSystemTargetingField; + + private bool allowOperatingSystemTargetingCustomizationField; + + private bool allowOperatingSystemTargetingCustomizationFieldSpecified; + + public GeoTargeting geoTargeting { + get { return this.geoTargetingField; } + set { this.geoTargetingField = value; } + } + + public bool allowGeoTargetingCustomization { + get { return this.allowGeoTargetingCustomizationField; } + set { + this.allowGeoTargetingCustomizationField = value; + this.allowGeoTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowGeoTargetingCustomizationSpecified { + get { return this.allowGeoTargetingCustomizationFieldSpecified; } + set { this.allowGeoTargetingCustomizationFieldSpecified = value; } + } + + public InventoryTargeting inventoryTargeting { + get { return this.inventoryTargetingField; } + set { this.inventoryTargetingField = value; } + } + + public bool allowAdUnitTargetingCustomization { + get { return this.allowAdUnitTargetingCustomizationField; } + set { + this.allowAdUnitTargetingCustomizationField = value; + this.allowAdUnitTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowAdUnitTargetingCustomizationSpecified { + get { return this.allowAdUnitTargetingCustomizationFieldSpecified; } + set { this.allowAdUnitTargetingCustomizationFieldSpecified = value; } + } + + public bool allowPlacementTargetingCustomization { + get { return this.allowPlacementTargetingCustomizationField; } + set { + this.allowPlacementTargetingCustomizationField = value; + this.allowPlacementTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowPlacementTargetingCustomizationSpecified { + get { return this.allowPlacementTargetingCustomizationFieldSpecified; } + set { this.allowPlacementTargetingCustomizationFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customizableCustomTargetingKeyIds")] + public long[] customizableCustomTargetingKeyIds { + get { return this.customizableCustomTargetingKeyIdsField; } + set { this.customizableCustomTargetingKeyIdsField = value; } + } + + public UserDomainTargeting userDomainTargeting { + get { return this.userDomainTargetingField; } + set { this.userDomainTargetingField = value; } + } + + public bool allowUserDomainTargetingCustomization { + get { return this.allowUserDomainTargetingCustomizationField; } + set { + this.allowUserDomainTargetingCustomizationField = value; + this.allowUserDomainTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowUserDomainTargetingCustomizationSpecified { + get { return this.allowUserDomainTargetingCustomizationFieldSpecified; } + set { this.allowUserDomainTargetingCustomizationFieldSpecified = value; } + } + + public BandwidthGroupTargeting bandwidthGroupTargeting { + get { return this.bandwidthGroupTargetingField; } + set { this.bandwidthGroupTargetingField = value; } + } + + public bool allowBandwidthGroupTargetingCustomization { + get { return this.allowBandwidthGroupTargetingCustomizationField; } + set { + this.allowBandwidthGroupTargetingCustomizationField = value; + this.allowBandwidthGroupTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowBandwidthGroupTargetingCustomizationSpecified { + get { return this.allowBandwidthGroupTargetingCustomizationFieldSpecified; } + set { this.allowBandwidthGroupTargetingCustomizationFieldSpecified = value; } + } + + public BrowserTargeting browserTargeting { + get { return this.browserTargetingField; } + set { this.browserTargetingField = value; } + } + + public bool allowBrowserTargetingCustomization { + get { return this.allowBrowserTargetingCustomizationField; } + set { + this.allowBrowserTargetingCustomizationField = value; + this.allowBrowserTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowBrowserTargetingCustomizationSpecified { + get { return this.allowBrowserTargetingCustomizationFieldSpecified; } + set { this.allowBrowserTargetingCustomizationFieldSpecified = value; } + } + + public BrowserLanguageTargeting browserLanguageTargeting { + get { return this.browserLanguageTargetingField; } + set { this.browserLanguageTargetingField = value; } + } + + public bool allowBrowserLanguageTargetingCustomization { + get { return this.allowBrowserLanguageTargetingCustomizationField; } + set { + this.allowBrowserLanguageTargetingCustomizationField = value; + this.allowBrowserLanguageTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowBrowserLanguageTargetingCustomizationSpecified { + get { return this.allowBrowserLanguageTargetingCustomizationFieldSpecified; } + set { this.allowBrowserLanguageTargetingCustomizationFieldSpecified = value; } + } + + public OperatingSystemTargeting operatingSystemTargeting { + get { return this.operatingSystemTargetingField; } + set { this.operatingSystemTargetingField = value; } + } + + public bool allowOperatingSystemTargetingCustomization { + get { return this.allowOperatingSystemTargetingCustomizationField; } + set { + this.allowOperatingSystemTargetingCustomizationField = value; + this.allowOperatingSystemTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowOperatingSystemTargetingCustomizationSpecified { + get { return this.allowOperatingSystemTargetingCustomizationFieldSpecified; } + set { this.allowOperatingSystemTargetingCustomizationFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ProductActionError : ApiError { + private ProductActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProductActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ProductActionErrorReason { + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class BaseRateError : ApiError { + private BaseRateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BaseRateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BaseRateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum BaseRateErrorReason { + CANNOT_QUERY_BOTH_PRODUCT_TEMPLATE_ID_AND_PRODUCT_ID, + INVALID_CURRENCY_CODE, + UNSUPPORTED_OPERATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReconciliationReportRowServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReconciliationReportRowService : DfpSoapClient, IReconciliationReportRowService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReconciliationReportRowService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/ReconciliationReportRowService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReportRowPage getReconciliationReportRowsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getReconciliationReportRowsByStatement", new object[] { filterStatement }); + return ((ReconciliationReportRowPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReportRow[] updateReconciliationReportRows([System.Xml.Serialization.XmlElementAttribute("reconciliationReportRows")] +ReconciliationReportRow[] reconciliationReportRows) { + object[] results = this.Invoke("updateReconciliationReportRows", new object[] { reconciliationReportRows }); + return ((ReconciliationReportRow[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ReconciliationReportRow { + private long reconciliationReportIdField; + + private bool reconciliationReportIdFieldSpecified; + + private long lineItemIdField; + + private bool lineItemIdFieldSpecified; + + private long creativeIdField; + + private bool creativeIdFieldSpecified; + + private long orderIdField; + + private bool orderIdFieldSpecified; + + private long advertiserIdField; + + private bool advertiserIdFieldSpecified; + + private BillFrom billFromField; + + private bool billFromFieldSpecified; + + private CostType lineItemCostTypeField; + + private bool lineItemCostTypeFieldSpecified; + + private Money lineItemCostPerUnitField; + + private long lineItemContractedUnitsBoughtField; + + private bool lineItemContractedUnitsBoughtFieldSpecified; + + private long dfpClicksField; + + private bool dfpClicksFieldSpecified; + + private long dfpImpressionsField; + + private bool dfpImpressionsFieldSpecified; + + private int dfpLineItemDaysField; + + private bool dfpLineItemDaysFieldSpecified; + + private long thirdPartyClicksField; + + private bool thirdPartyClicksFieldSpecified; + + private long thirdPartyImpressionsField; + + private bool thirdPartyImpressionsFieldSpecified; + + private int thirdPartyLineItemDaysField; + + private bool thirdPartyLineItemDaysFieldSpecified; + + private long manualClicksField; + + private bool manualClicksFieldSpecified; + + private long manualImpressionsField; + + private bool manualImpressionsFieldSpecified; + + private int manualLineItemDaysField; + + private bool manualLineItemDaysFieldSpecified; + + private long reconciledClicksField; + + private bool reconciledClicksFieldSpecified; + + private long reconciledImpressionsField; + + private bool reconciledImpressionsFieldSpecified; + + private int reconciledLineItemDaysField; + + private bool reconciledLineItemDaysFieldSpecified; + + private Money contractedRevenueField; + + private Money dfpRevenueField; + + private Money thirdPartyRevenueField; + + private Money manualRevenueField; + + private Money reconciledRevenueField; + + private string commentsField; + + public long reconciliationReportId { + get { return this.reconciliationReportIdField; } + set { + this.reconciliationReportIdField = value; + this.reconciliationReportIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reconciliationReportIdSpecified { + get { return this.reconciliationReportIdFieldSpecified; } + set { this.reconciliationReportIdFieldSpecified = value; } + } + + public long lineItemId { + get { return this.lineItemIdField; } + set { + this.lineItemIdField = value; + this.lineItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemIdSpecified { + get { return this.lineItemIdFieldSpecified; } + set { this.lineItemIdFieldSpecified = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { + this.creativeIdField = value; + this.creativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeIdSpecified { + get { return this.creativeIdFieldSpecified; } + set { this.creativeIdFieldSpecified = value; } + } + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public long advertiserId { + get { return this.advertiserIdField; } + set { + this.advertiserIdField = value; + this.advertiserIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserIdSpecified { + get { return this.advertiserIdFieldSpecified; } + set { this.advertiserIdFieldSpecified = value; } + } + + public BillFrom billFrom { + get { return this.billFromField; } + set { + this.billFromField = value; + this.billFromSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billFromSpecified { + get { return this.billFromFieldSpecified; } + set { this.billFromFieldSpecified = value; } + } + + public CostType lineItemCostType { + get { return this.lineItemCostTypeField; } + set { + this.lineItemCostTypeField = value; + this.lineItemCostTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemCostTypeSpecified { + get { return this.lineItemCostTypeFieldSpecified; } + set { this.lineItemCostTypeFieldSpecified = value; } + } + + public Money lineItemCostPerUnit { + get { return this.lineItemCostPerUnitField; } + set { this.lineItemCostPerUnitField = value; } + } + + public long lineItemContractedUnitsBought { + get { return this.lineItemContractedUnitsBoughtField; } + set { + this.lineItemContractedUnitsBoughtField = value; + this.lineItemContractedUnitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemContractedUnitsBoughtSpecified { + get { return this.lineItemContractedUnitsBoughtFieldSpecified; } + set { this.lineItemContractedUnitsBoughtFieldSpecified = value; } + } + + public long dfpClicks { + get { return this.dfpClicksField; } + set { + this.dfpClicksField = value; + this.dfpClicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dfpClicksSpecified { + get { return this.dfpClicksFieldSpecified; } + set { this.dfpClicksFieldSpecified = value; } + } + + public long dfpImpressions { + get { return this.dfpImpressionsField; } + set { + this.dfpImpressionsField = value; + this.dfpImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dfpImpressionsSpecified { + get { return this.dfpImpressionsFieldSpecified; } + set { this.dfpImpressionsFieldSpecified = value; } + } + + public int dfpLineItemDays { + get { return this.dfpLineItemDaysField; } + set { + this.dfpLineItemDaysField = value; + this.dfpLineItemDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dfpLineItemDaysSpecified { + get { return this.dfpLineItemDaysFieldSpecified; } + set { this.dfpLineItemDaysFieldSpecified = value; } + } + + public long thirdPartyClicks { + get { return this.thirdPartyClicksField; } + set { + this.thirdPartyClicksField = value; + this.thirdPartyClicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyClicksSpecified { + get { return this.thirdPartyClicksFieldSpecified; } + set { this.thirdPartyClicksFieldSpecified = value; } + } + + public long thirdPartyImpressions { + get { return this.thirdPartyImpressionsField; } + set { + this.thirdPartyImpressionsField = value; + this.thirdPartyImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyImpressionsSpecified { + get { return this.thirdPartyImpressionsFieldSpecified; } + set { this.thirdPartyImpressionsFieldSpecified = value; } + } + + public int thirdPartyLineItemDays { + get { return this.thirdPartyLineItemDaysField; } + set { + this.thirdPartyLineItemDaysField = value; + this.thirdPartyLineItemDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyLineItemDaysSpecified { + get { return this.thirdPartyLineItemDaysFieldSpecified; } + set { this.thirdPartyLineItemDaysFieldSpecified = value; } + } + + public long manualClicks { + get { return this.manualClicksField; } + set { + this.manualClicksField = value; + this.manualClicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manualClicksSpecified { + get { return this.manualClicksFieldSpecified; } + set { this.manualClicksFieldSpecified = value; } + } + + public long manualImpressions { + get { return this.manualImpressionsField; } + set { + this.manualImpressionsField = value; + this.manualImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manualImpressionsSpecified { + get { return this.manualImpressionsFieldSpecified; } + set { this.manualImpressionsFieldSpecified = value; } + } + + public int manualLineItemDays { + get { return this.manualLineItemDaysField; } + set { + this.manualLineItemDaysField = value; + this.manualLineItemDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manualLineItemDaysSpecified { + get { return this.manualLineItemDaysFieldSpecified; } + set { this.manualLineItemDaysFieldSpecified = value; } + } + + public long reconciledClicks { + get { return this.reconciledClicksField; } + set { + this.reconciledClicksField = value; + this.reconciledClicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reconciledClicksSpecified { + get { return this.reconciledClicksFieldSpecified; } + set { this.reconciledClicksFieldSpecified = value; } + } + + public long reconciledImpressions { + get { return this.reconciledImpressionsField; } + set { + this.reconciledImpressionsField = value; + this.reconciledImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reconciledImpressionsSpecified { + get { return this.reconciledImpressionsFieldSpecified; } + set { this.reconciledImpressionsFieldSpecified = value; } + } + + public int reconciledLineItemDays { + get { return this.reconciledLineItemDaysField; } + set { + this.reconciledLineItemDaysField = value; + this.reconciledLineItemDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reconciledLineItemDaysSpecified { + get { return this.reconciledLineItemDaysFieldSpecified; } + set { this.reconciledLineItemDaysFieldSpecified = value; } + } + + public Money contractedRevenue { + get { return this.contractedRevenueField; } + set { this.contractedRevenueField = value; } + } + + public Money dfpRevenue { + get { return this.dfpRevenueField; } + set { this.dfpRevenueField = value; } + } + + public Money thirdPartyRevenue { + get { return this.thirdPartyRevenueField; } + set { this.thirdPartyRevenueField = value; } + } + + public Money manualRevenue { + get { return this.manualRevenueField; } + set { this.manualRevenueField = value; } + } + + public Money reconciledRevenue { + get { return this.reconciledRevenueField; } + set { this.reconciledRevenueField = value; } + } + + public string comments { + get { return this.commentsField; } + set { this.commentsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum BillFrom { + DEFAULT, + DFP, + THIRD_PARTY, + MANUAL, + CONTRACTED_GOAL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ReconciliationReportRowPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ReconciliationReportRow[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ReconciliationReportRow[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "RateCardCustomizationServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class RateCardCustomizationService : DfpSoapClient, IRateCardCustomizationService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public RateCardCustomizationService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/RateCardCustomizationService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomization createRateCardCustomization(RateCardCustomization rateCardCustomization) { + object[] results = this.Invoke("createRateCardCustomization", new object[] { rateCardCustomization }); + return ((RateCardCustomization) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomization[] createRateCardCustomizations([System.Xml.Serialization.XmlElementAttribute("rateCardCustomizations")] +RateCardCustomization[] rateCardCustomizations) { + object[] results = this.Invoke("createRateCardCustomizations", new object[] { rateCardCustomizations }); + return ((RateCardCustomization[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomization getRateCardCustomization(long rateCardCustomizationId) { + object[] results = this.Invoke("getRateCardCustomization", new object[] { rateCardCustomizationId }); + return ((RateCardCustomization) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomizationPage getRateCardCustomizationsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getRateCardCustomizationsByStatement", new object[] { filterStatement }); + return ((RateCardCustomizationPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performRateCardCustomizationAction(RateCardCustomizationAction rateCardCustomizationAction, Statement filterStatement) { + object[] results = this.Invoke("performRateCardCustomizationAction", new object[] { rateCardCustomizationAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomization updateRateCardCustomization(RateCardCustomization rateCardCustomization) { + object[] results = this.Invoke("updateRateCardCustomization", new object[] { rateCardCustomization }); + return ((RateCardCustomization) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomization[] updateRateCardCustomizations([System.Xml.Serialization.XmlElementAttribute("rateCardCustomizations")] +RateCardCustomization[] rateCardCustomizations) { + object[] results = this.Invoke("updateRateCardCustomizations", new object[] { rateCardCustomizations }); + return ((RateCardCustomization[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateRateCardCustomizations))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateRateCardCustomizations))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class RateCardCustomizationAction { + private string rateCardCustomizationActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("RateCardCustomizationAction.Type")] + public string RateCardCustomizationActionType { + get { return this.rateCardCustomizationActionTypeField; } + set { this.rateCardCustomizationActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeactivateRateCardCustomizations : RateCardCustomizationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ActivateRateCardCustomizations : RateCardCustomizationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RateCardCustomizationPage { + private RateCardCustomization[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public RateCardCustomization[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RateCardCustomization { + private long rateCardIdField; + + private bool rateCardIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private RateCardCustomizationStatus statusField; + + private bool statusFieldSpecified; + + private RateCardFeature rateCardFeatureField; + + private RateCardCustomizationAdjustmentType adjustmentTypeField; + + private bool adjustmentTypeFieldSpecified; + + private long adjustmentSizeField; + + private bool adjustmentSizeFieldSpecified; + + private RateType rateTypeField; + + private bool rateTypeFieldSpecified; + + public long rateCardId { + get { return this.rateCardIdField; } + set { + this.rateCardIdField = value; + this.rateCardIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardIdSpecified { + get { return this.rateCardIdFieldSpecified; } + set { this.rateCardIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public RateCardCustomizationStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public RateCardFeature rateCardFeature { + get { return this.rateCardFeatureField; } + set { this.rateCardFeatureField = value; } + } + + public RateCardCustomizationAdjustmentType adjustmentType { + get { return this.adjustmentTypeField; } + set { + this.adjustmentTypeField = value; + this.adjustmentTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adjustmentTypeSpecified { + get { return this.adjustmentTypeFieldSpecified; } + set { this.adjustmentTypeFieldSpecified = value; } + } + + public long adjustmentSize { + get { return this.adjustmentSizeField; } + set { + this.adjustmentSizeField = value; + this.adjustmentSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adjustmentSizeSpecified { + get { return this.adjustmentSizeFieldSpecified; } + set { this.adjustmentSizeFieldSpecified = value; } + } + + public RateType rateType { + get { return this.rateTypeField; } + set { + this.rateTypeField = value; + this.rateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateTypeSpecified { + get { return this.rateTypeFieldSpecified; } + set { this.rateTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum RateCardCustomizationStatus { + ACTIVE, + INACTIVE, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserDomainRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnknownRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystemRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GeographyRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FrequencyCapRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomTargetingRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BrowserLanguageRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BrowserRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BandwidthRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitRateCardFeature))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class RateCardFeature { + private string rateCardFeatureTypeField; + + [System.Xml.Serialization.XmlElementAttribute("RateCardFeature.Type")] + public string RateCardFeatureType { + get { return this.rateCardFeatureTypeField; } + set { this.rateCardFeatureTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class UserDomainRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class UnknownRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class PlacementRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class OperatingSystemRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class GeographyRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class FrequencyCapRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CustomTargetingRateCardFeature : RateCardFeature { + private long customTargetingKeyIdField; + + private bool customTargetingKeyIdFieldSpecified; + + private long customTargetingValueIdField; + + private bool customTargetingValueIdFieldSpecified; + + public long customTargetingKeyId { + get { return this.customTargetingKeyIdField; } + set { + this.customTargetingKeyIdField = value; + this.customTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customTargetingKeyIdSpecified { + get { return this.customTargetingKeyIdFieldSpecified; } + set { this.customTargetingKeyIdFieldSpecified = value; } + } + + public long customTargetingValueId { + get { return this.customTargetingValueIdField; } + set { + this.customTargetingValueIdField = value; + this.customTargetingValueIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customTargetingValueIdSpecified { + get { return this.customTargetingValueIdFieldSpecified; } + set { this.customTargetingValueIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class BrowserLanguageRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class BrowserRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class BandwidthRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AdUnitRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum RateCardCustomizationAdjustmentType { + PERCENTAGE, + ABSOLUTE_VALUE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RateCardCustomizationError : ApiError { + private RateCardCustomizationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RateCardCustomizationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RateCardCustomizationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum RateCardCustomizationErrorReason { + INVALID_RATE_TYPE, + UNSUPPORTED_OPERATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeSetServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeSetService : DfpSoapClient, ICreativeSetService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeSetService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/CreativeSetService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeSet createCreativeSet(CreativeSet creativeSet) { + object[] results = this.Invoke("createCreativeSet", new object[] { creativeSet }); + return ((CreativeSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeSet getCreativeSet(long creativeSetId) { + object[] results = this.Invoke("getCreativeSet", new object[] { creativeSetId }); + return ((CreativeSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeSetPage getCreativeSetsByStatement(Statement statement) { + object[] results = this.Invoke("getCreativeSetsByStatement", new object[] { statement }); + return ((CreativeSetPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeSet updateCreativeSet(CreativeSet creativeSet) { + object[] results = this.Invoke("updateCreativeSet", new object[] { creativeSet }); + return ((CreativeSet) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CreativeSetPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeSet[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeSet[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CreativeSet { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private long masterCreativeIdField; + + private bool masterCreativeIdFieldSpecified; + + private long[] companionCreativeIdsField; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public long masterCreativeId { + get { return this.masterCreativeIdField; } + set { + this.masterCreativeIdField = value; + this.masterCreativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool masterCreativeIdSpecified { + get { return this.masterCreativeIdFieldSpecified; } + set { this.masterCreativeIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "BaseRateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class BaseRateService : DfpSoapClient, IBaseRateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public BaseRateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/BaseRateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRate createBaseRate(BaseRate baseRate) { + object[] results = this.Invoke("createBaseRate", new object[] { baseRate }); + return ((BaseRate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRate[] createBaseRates([System.Xml.Serialization.XmlElementAttribute("baseRates")] +BaseRate[] baseRates) { + object[] results = this.Invoke("createBaseRates", new object[] { baseRates }); + return ((BaseRate[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRate getBaseRate(long baseRateId) { + object[] results = this.Invoke("getBaseRate", new object[] { baseRateId }); + return ((BaseRate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRatePage getBaseRatesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getBaseRatesByStatement", new object[] { filterStatement }); + return ((BaseRatePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performBaseRateAction(BaseRateAction baseRateAction, Statement filterStatement) { + object[] results = this.Invoke("performBaseRateAction", new object[] { baseRateAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRate updateBaseRate(BaseRate baseRate) { + object[] results = this.Invoke("updateBaseRate", new object[] { baseRate }); + return ((BaseRate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRate[] updateBaseRates([System.Xml.Serialization.XmlElementAttribute("baseRates")] +BaseRate[] baseRates) { + object[] results = this.Invoke("updateBaseRates", new object[] { baseRates }); + return ((BaseRate[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateBaseRates))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateBaseRates))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class BaseRateAction { + private string baseRateActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("BaseRateAction.Type")] + public string BaseRateActionType { + get { return this.baseRateActionTypeField; } + set { this.baseRateActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeactivateBaseRates : BaseRateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ActivateBaseRates : BaseRateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class BaseRatePage { + private BaseRate[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public BaseRate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductTemplateBaseRate))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductBaseRate))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class BaseRate { + private long rateCardIdField; + + private bool rateCardIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private BaseRateStatus statusField; + + private bool statusFieldSpecified; + + private string baseRateTypeField; + + public long rateCardId { + get { return this.rateCardIdField; } + set { + this.rateCardIdField = value; + this.rateCardIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardIdSpecified { + get { return this.rateCardIdFieldSpecified; } + set { this.rateCardIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public BaseRateStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseRate.Type")] + public string BaseRateType { + get { return this.baseRateTypeField; } + set { this.baseRateTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum BaseRateStatus { + ACTIVE, + INACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ProductTemplateBaseRate : BaseRate { + private long productTemplateIdField; + + private bool productTemplateIdFieldSpecified; + + private Money rateField; + + public long productTemplateId { + get { return this.productTemplateIdField; } + set { + this.productTemplateIdField = value; + this.productTemplateIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productTemplateIdSpecified { + get { return this.productTemplateIdFieldSpecified; } + set { this.productTemplateIdFieldSpecified = value; } + } + + public Money rate { + get { return this.rateField; } + set { this.rateField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ProductBaseRate : BaseRate { + private string productIdField; + + private Money rateField; + + public string productId { + get { return this.productIdField; } + set { this.productIdField = value; } + } + + public Money rate { + get { return this.rateField; } + set { this.rateField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class BaseRateActionError : ApiError { + private BaseRateActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BaseRateActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BaseRateActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum BaseRateActionErrorReason { + DUPLICATED_BASE_RATES, + ACTIVE_BASE_RATE_ALREADY_EXISTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "InventoryServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class InventoryService : DfpSoapClient, IInventoryService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public InventoryService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/InventoryService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnit createAdUnit(AdUnit adUnit) { + object[] results = this.Invoke("createAdUnit", new object[] { adUnit }); + return ((AdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnit[] createAdUnits([System.Xml.Serialization.XmlElementAttribute("adUnits")] +AdUnit[] adUnits) { + object[] results = this.Invoke("createAdUnits", new object[] { adUnits }); + return ((AdUnit[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnit getAdUnit(string adUnitId) { + object[] results = this.Invoke("getAdUnit", new object[] { adUnitId }); + return ((AdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnitSize[] getAdUnitSizesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAdUnitSizesByStatement", new object[] { filterStatement }); + return ((AdUnitSize[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnitPage getAdUnitsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAdUnitsByStatement", new object[] { filterStatement }); + return ((AdUnitPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performAdUnitAction(AdUnitAction adUnitAction, Statement filterStatement) { + object[] results = this.Invoke("performAdUnitAction", new object[] { adUnitAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnit updateAdUnit(AdUnit adUnit) { + object[] results = this.Invoke("updateAdUnit", new object[] { adUnit }); + return ((AdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnit[] updateAdUnits([System.Xml.Serialization.XmlElementAttribute("adUnits")] +AdUnit[] adUnits) { + object[] results = this.Invoke("updateAdUnits", new object[] { adUnits }); + return ((AdUnit[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RemoveAdUnitsFromPlacement))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateAdUnits))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssignAdUnitsToPlacement))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveAdUnits))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateAdUnits))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class AdUnitAction { + private string adUnitActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AdUnitAction.Type")] + public string AdUnitActionType { + get { return this.adUnitActionTypeField; } + set { this.adUnitActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RemoveAdUnitsFromPlacement : AdUnitAction { + private long placementIdField; + + private bool placementIdFieldSpecified; + + public long placementId { + get { return this.placementIdField; } + set { + this.placementIdField = value; + this.placementIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool placementIdSpecified { + get { return this.placementIdFieldSpecified; } + set { this.placementIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeactivateAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AssignAdUnitsToPlacement : AdUnitAction { + private long placementIdField; + + private bool placementIdFieldSpecified; + + public long placementId { + get { return this.placementIdField; } + set { + this.placementIdField = value; + this.placementIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool placementIdSpecified { + get { return this.placementIdFieldSpecified; } + set { this.placementIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ArchiveAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ActivateAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AdUnitPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AdUnit[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AdUnit[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AdUnit { + private string idField; + + private string parentIdField; + + private bool hasChildrenField; + + private bool hasChildrenFieldSpecified; + + private AdUnitParent[] parentPathField; + + private string nameField; + + private string descriptionField; + + private AdUnitTargetWindow targetWindowField; + + private bool targetWindowFieldSpecified; + + private InventoryStatus statusField; + + private bool statusFieldSpecified; + + private string adUnitCodeField; + + private AdUnitSize[] adUnitSizesField; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private MobilePlatform mobilePlatformField; + + private bool mobilePlatformFieldSpecified; + + private bool explicitlyTargetedField; + + private bool explicitlyTargetedFieldSpecified; + + private AdSenseSettingsInheritedProperty inheritedAdSenseSettingsField; + + private long partnerIdField; + + private bool partnerIdFieldSpecified; + + private LabelFrequencyCap[] appliedLabelFrequencyCapsField; + + private LabelFrequencyCap[] effectiveLabelFrequencyCapsField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private long[] effectiveTeamIdsField; + + private long[] appliedTeamIdsField; + + private DateTime lastModifiedDateTimeField; + + private SmartSizeMode smartSizeModeField; + + private bool smartSizeModeFieldSpecified; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string parentId { + get { return this.parentIdField; } + set { this.parentIdField = value; } + } + + public bool hasChildren { + get { return this.hasChildrenField; } + set { + this.hasChildrenField = value; + this.hasChildrenSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasChildrenSpecified { + get { return this.hasChildrenFieldSpecified; } + set { this.hasChildrenFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("parentPath")] + public AdUnitParent[] parentPath { + get { return this.parentPathField; } + set { this.parentPathField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public AdUnitTargetWindow targetWindow { + get { return this.targetWindowField; } + set { + this.targetWindowField = value; + this.targetWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetWindowSpecified { + get { return this.targetWindowFieldSpecified; } + set { this.targetWindowFieldSpecified = value; } + } + + public InventoryStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string adUnitCode { + get { return this.adUnitCodeField; } + set { this.adUnitCodeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adUnitSizes")] + public AdUnitSize[] adUnitSizes { + get { return this.adUnitSizesField; } + set { this.adUnitSizesField = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + public MobilePlatform mobilePlatform { + get { return this.mobilePlatformField; } + set { + this.mobilePlatformField = value; + this.mobilePlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mobilePlatformSpecified { + get { return this.mobilePlatformFieldSpecified; } + set { this.mobilePlatformFieldSpecified = value; } + } + + public bool explicitlyTargeted { + get { return this.explicitlyTargetedField; } + set { + this.explicitlyTargetedField = value; + this.explicitlyTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool explicitlyTargetedSpecified { + get { return this.explicitlyTargetedFieldSpecified; } + set { this.explicitlyTargetedFieldSpecified = value; } + } + + public AdSenseSettingsInheritedProperty inheritedAdSenseSettings { + get { return this.inheritedAdSenseSettingsField; } + set { this.inheritedAdSenseSettingsField = value; } + } + + public long partnerId { + get { return this.partnerIdField; } + set { + this.partnerIdField = value; + this.partnerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool partnerIdSpecified { + get { return this.partnerIdFieldSpecified; } + set { this.partnerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabelFrequencyCaps")] + public LabelFrequencyCap[] appliedLabelFrequencyCaps { + get { return this.appliedLabelFrequencyCapsField; } + set { this.appliedLabelFrequencyCapsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveLabelFrequencyCaps")] + public LabelFrequencyCap[] effectiveLabelFrequencyCaps { + get { return this.effectiveLabelFrequencyCapsField; } + set { this.effectiveLabelFrequencyCapsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveTeamIds")] + public long[] effectiveTeamIds { + get { return this.effectiveTeamIdsField; } + set { this.effectiveTeamIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public SmartSizeMode smartSizeMode { + get { return this.smartSizeModeField; } + set { + this.smartSizeModeField = value; + this.smartSizeModeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool smartSizeModeSpecified { + get { return this.smartSizeModeFieldSpecified; } + set { this.smartSizeModeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum InventoryStatus { + ACTIVE, + INACTIVE, + ARCHIVED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum MobilePlatform { + SITE, + APPLICATION + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AdSenseSettingsInheritedProperty { + private AdSenseSettings valueField; + + public AdSenseSettings value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AdSenseSettings { + private bool adSenseEnabledField; + + private bool adSenseEnabledFieldSpecified; + + private string borderColorField; + + private string titleColorField; + + private string backgroundColorField; + + private string textColorField; + + private string urlColorField; + + private AdSenseSettingsAdType adTypeField; + + private bool adTypeFieldSpecified; + + private AdSenseSettingsBorderStyle borderStyleField; + + private bool borderStyleFieldSpecified; + + private AdSenseSettingsFontFamily fontFamilyField; + + private bool fontFamilyFieldSpecified; + + private AdSenseSettingsFontSize fontSizeField; + + private bool fontSizeFieldSpecified; + + private Size_StringMapEntry[] afcFormatsField; + + public bool adSenseEnabled { + get { return this.adSenseEnabledField; } + set { + this.adSenseEnabledField = value; + this.adSenseEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adSenseEnabledSpecified { + get { return this.adSenseEnabledFieldSpecified; } + set { this.adSenseEnabledFieldSpecified = value; } + } + + public string borderColor { + get { return this.borderColorField; } + set { this.borderColorField = value; } + } + + public string titleColor { + get { return this.titleColorField; } + set { this.titleColorField = value; } + } + + public string backgroundColor { + get { return this.backgroundColorField; } + set { this.backgroundColorField = value; } + } + + public string textColor { + get { return this.textColorField; } + set { this.textColorField = value; } + } + + public string urlColor { + get { return this.urlColorField; } + set { this.urlColorField = value; } + } + + public AdSenseSettingsAdType adType { + get { return this.adTypeField; } + set { + this.adTypeField = value; + this.adTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adTypeSpecified { + get { return this.adTypeFieldSpecified; } + set { this.adTypeFieldSpecified = value; } + } + + public AdSenseSettingsBorderStyle borderStyle { + get { return this.borderStyleField; } + set { + this.borderStyleField = value; + this.borderStyleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool borderStyleSpecified { + get { return this.borderStyleFieldSpecified; } + set { this.borderStyleFieldSpecified = value; } + } + + public AdSenseSettingsFontFamily fontFamily { + get { return this.fontFamilyField; } + set { + this.fontFamilyField = value; + this.fontFamilySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fontFamilySpecified { + get { return this.fontFamilyFieldSpecified; } + set { this.fontFamilyFieldSpecified = value; } + } + + public AdSenseSettingsFontSize fontSize { + get { return this.fontSizeField; } + set { + this.fontSizeField = value; + this.fontSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fontSizeSpecified { + get { return this.fontSizeFieldSpecified; } + set { this.fontSizeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("afcFormats")] + public Size_StringMapEntry[] afcFormats { + get { return this.afcFormatsField; } + set { this.afcFormatsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.AdType", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AdSenseSettingsAdType { + TEXT, + IMAGE, + TEXT_AND_IMAGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.BorderStyle", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AdSenseSettingsBorderStyle { + DEFAULT, + NOT_ROUNDED, + SLIGHTLY_ROUNDED, + VERY_ROUNDED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.FontFamily", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AdSenseSettingsFontFamily { + DEFAULT, + ARIAL, + TAHOMA, + GEORGIA, + TIMES, + VERDANA + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.FontSize", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AdSenseSettingsFontSize { + DEFAULT, + SMALL, + MEDIUM, + LARGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Size_StringMapEntry { + private Size keyField; + + private string valueField; + + public Size key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class LabelFrequencyCap { + private FrequencyCap frequencyCapField; + + private long labelIdField; + + private bool labelIdFieldSpecified; + + public FrequencyCap frequencyCap { + get { return this.frequencyCapField; } + set { this.frequencyCapField = value; } + } + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum SmartSizeMode { + UNKNOWN, + NONE, + SMART_BANNER, + DYNAMIC_SIZE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RegExError : ApiError { + private RegExErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RegExErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RegExError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum RegExErrorReason { + INVALID, + NULL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AdUnitTypeError : ApiError { + private AdUnitTypeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitTypeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitTypeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AdUnitTypeErrorReason { + MOBILE_APP_PLATFORM_NOT_VALID, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class InventoryUnitSizesError : ApiError { + private InventoryUnitSizesErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitSizesErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitSizesError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum InventoryUnitSizesErrorReason { + INVALID_SIZES, + INVALID_SIZE_FOR_PLATFORM, + VIDEO_FEATURE_MISSING, + VIDEO_MOBILE_LINE_ITEM_FEATURE_MISSING, + INVALID_SIZE_FOR_MASTER, + INVALID_SIZE_FOR_COMPANION, + DUPLICATE_MASTER_SIZES, + ASPECT_RATIO_NOT_SUPPORTED, + VIDEO_COMPANIONS_NOT_SUPPORTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class InventoryUnitPartnerAssociationError : ApiError { + private InventoryUnitPartnerAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitPartnerAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitPartnerAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum InventoryUnitPartnerAssociationErrorReason { + ANCESTOR_AD_UNIT_HAS_PARTNER_ASSOCIATION, + DESCENDANT_AD_UNIT_HAS_PARTNER_ASSOCIATION, + SAME_PARTNER_ASSOCIATION_IN_INVENTORY_HIERARCHY, + NO_PARTNER_CATCH_ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class InventoryUnitError : ApiError { + private InventoryUnitErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum InventoryUnitErrorReason { + EXPLICIT_TARGETING_NOT_ALLOWED, + TARGET_PLATFORM_NOT_APPLICABLE, + ADSENSE_CANNOT_BE_ENABLED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class InvalidColorError : ApiError { + private InvalidColorErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidColorErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidColorError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum InvalidColorErrorReason { + INVALID_FORMAT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AdUnitHierarchyError : ApiError { + private AdUnitHierarchyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitHierarchyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitHierarchyError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AdUnitHierarchyErrorReason { + INVALID_DEPTH, + INVALID_PARENT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AdUnitCodeError : ApiError { + private AdUnitCodeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitCodeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitCodeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AdUnitCodeErrorReason { + INVALID_CHARACTERS, + INVALID_CHARACTERS_WHEN_UTF_CHARACTERS_ARE_ALLOWED, + LEADING_FORWARD_SLASH, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AdUnitAfcSizeError : ApiError { + private AdUnitAfcSizeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitAfcSizeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitAfcSizeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AdUnitAfcSizeErrorReason { + INVALID, + DOESNT_FIT, + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProductTemplateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProductTemplateService : DfpSoapClient, IProductTemplateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProductTemplateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/ProductTemplateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplate createProductTemplate(ProductTemplate productTemplate) { + object[] results = this.Invoke("createProductTemplate", new object[] { productTemplate }); + return ((ProductTemplate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplate[] createProductTemplates([System.Xml.Serialization.XmlElementAttribute("productTemplates")] +ProductTemplate[] productTemplates) { + object[] results = this.Invoke("createProductTemplates", new object[] { productTemplates }); + return ((ProductTemplate[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplate getProductTemplate(long productTemplateId) { + object[] results = this.Invoke("getProductTemplate", new object[] { productTemplateId }); + return ((ProductTemplate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplatePage getProductTemplatesByStatement(Statement statement) { + object[] results = this.Invoke("getProductTemplatesByStatement", new object[] { statement }); + return ((ProductTemplatePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performProductTemplateAction(ProductTemplateAction action, Statement filterStatement) { + object[] results = this.Invoke("performProductTemplateAction", new object[] { action, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplate updateProductTemplate(ProductTemplate productTemplate) { + object[] results = this.Invoke("updateProductTemplate", new object[] { productTemplate }); + return ((ProductTemplate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplate[] updateProductTemplates([System.Xml.Serialization.XmlElementAttribute("productTemplates")] +ProductTemplate[] productTemplates) { + object[] results = this.Invoke("updateProductTemplates", new object[] { productTemplates }); + return ((ProductTemplate[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateProductTemplates))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveProducTemplates))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateProductTemplates))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class ProductTemplateAction { + private string productTemplateActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProductTemplateAction.Type")] + public string ProductTemplateActionType { + get { return this.productTemplateActionTypeField; } + set { this.productTemplateActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeactivateProductTemplates : ProductTemplateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ArchiveProducTemplates : ProductTemplateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ActivateProductTemplates : ProductTemplateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ProductTemplatePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ProductTemplate[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ProductTemplate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ProductTemplate { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private DateTime creationDateTimeField; + + private DateTime lastModifiedDateTimeField; + + private string descriptionField; + + private string nameMacroField; + + private ProductTemplateStatus statusField; + + private bool statusFieldSpecified; + + private ProductType productTypeField; + + private bool productTypeFieldSpecified; + + private long creatorIdField; + + private bool creatorIdFieldSpecified; + + private RateType rateTypeField; + + private bool rateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int priorityField; + + private bool priorityFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private bool allowFrequencyCapsCustomizationField; + + private bool allowFrequencyCapsCustomizationFieldSpecified; + + private ProductSegmentation productSegmentationField; + + private ProductTemplateTargeting targetingField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DateTime creationDateTime { + get { return this.creationDateTimeField; } + set { this.creationDateTimeField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public string nameMacro { + get { return this.nameMacroField; } + set { this.nameMacroField = value; } + } + + public ProductTemplateStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ProductType productType { + get { return this.productTypeField; } + set { + this.productTypeField = value; + this.productTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productTypeSpecified { + get { return this.productTypeFieldSpecified; } + set { this.productTypeFieldSpecified = value; } + } + + public long creatorId { + get { return this.creatorIdField; } + set { + this.creatorIdField = value; + this.creatorIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creatorIdSpecified { + get { return this.creatorIdFieldSpecified; } + set { this.creatorIdFieldSpecified = value; } + } + + public RateType rateType { + get { return this.rateTypeField; } + set { + this.rateTypeField = value; + this.rateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateTypeSpecified { + get { return this.rateTypeFieldSpecified; } + set { this.rateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public bool allowFrequencyCapsCustomization { + get { return this.allowFrequencyCapsCustomizationField; } + set { + this.allowFrequencyCapsCustomizationField = value; + this.allowFrequencyCapsCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowFrequencyCapsCustomizationSpecified { + get { return this.allowFrequencyCapsCustomizationFieldSpecified; } + set { this.allowFrequencyCapsCustomizationFieldSpecified = value; } + } + + public ProductSegmentation productSegmentation { + get { return this.productSegmentationField; } + set { this.productSegmentationField = value; } + } + + public ProductTemplateTargeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ProductTemplateStatus { + ACTIVE, + DRAFT, + CANCELED, + ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ProductSegmentation { + private GeoTargeting geoSegmentField; + + private AdUnitTargeting[] adUnitSegmentsField; + + private long[] placementSegmentField; + + private UserDomainTargeting userDomainSegmentField; + + private BandwidthGroupTargeting bandwidthSegmentField; + + private BrowserTargeting browserSegmentField; + + private BrowserLanguageTargeting browserLanguageSegmentField; + + private OperatingSystemTargeting operatingSystemSegmentField; + + public GeoTargeting geoSegment { + get { return this.geoSegmentField; } + set { this.geoSegmentField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adUnitSegments")] + public AdUnitTargeting[] adUnitSegments { + get { return this.adUnitSegmentsField; } + set { this.adUnitSegmentsField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("targetedPlacementIds", IsNullable = false)] + public long[] placementSegment { + get { return this.placementSegmentField; } + set { this.placementSegmentField = value; } + } + + public UserDomainTargeting userDomainSegment { + get { return this.userDomainSegmentField; } + set { this.userDomainSegmentField = value; } + } + + public BandwidthGroupTargeting bandwidthSegment { + get { return this.bandwidthSegmentField; } + set { this.bandwidthSegmentField = value; } + } + + public BrowserTargeting browserSegment { + get { return this.browserSegmentField; } + set { this.browserSegmentField = value; } + } + + public BrowserLanguageTargeting browserLanguageSegment { + get { return this.browserLanguageSegmentField; } + set { this.browserLanguageSegmentField = value; } + } + + public OperatingSystemTargeting operatingSystemSegment { + get { return this.operatingSystemSegmentField; } + set { this.operatingSystemSegmentField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ProductTemplateError : ApiError { + private ProductTemplateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProductTemplateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductTemplateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ProductTemplateErrorReason { + INVALID_FEATURE_EXPANDED_EXCLUSIVE, + INVALID_EXPANDED_FEATURE_DEFAULT_NOT_TARGETED, + INVALID_EXPANDED_FEATURE_DEFAULT_LOCKED, + INVALID_EXPANDED_FEATURE_VALUE_TARGETED, + INVALID_EXPANDED_FEATURE_VALUE_LOCKED, + INVALID_FEATURE_TYPE, + INVALID_ROADBLOCKING_TYPE, + INVALID_TARGETING, + INVALID_FREQUENCY_CAPS, + INVALID_TECHNOLOGY_INCLUDE_EXCLUDE, + INVALID_EXPANDED_PRODUCT_COUNT, + INVALID_TARGET_PLATFORM, + INVALID_NON_TARGETING_FEATURE, + INVALID_FEATURE_CARDINALITY_AT_LEAST_ONE, + INVALID_FEATURE_CARDINALITY_AT_MOST_ONE, + INVALID_FEATURE_CARDINALITY_EXACTLY_ONE, + INVALID_FEATURE_FOR_OFFLINE, + INVALID_RATE_TYPE_FOR_OFFLINE, + INVALID_RATE_TYPE_FOR_DFP, + INVALID_LINE_ITEM_PRIORITY, + INVALID_LINE_ITEM_TYPE, + DUPLICATED_PLACEHOLDER_IN_NAMEMACRO, + INVALID_EXPANDED_FEATURE_IN_NON_EXPANDABLE_AFFINITY, + INVALID_FEATURE_DEFAULT_TARGET_TYPE, + INVALID_FEATURE_VALUE_TARGET_TYPE, + INVALID_FEATURE_AND_VALUE_LOCK_EXCLUSIVE, + DUPLICATED_FEATURE, + DUPLICATED_CUSTOM_TARGETING_KEY, + DUPLICATED_CUSTOM_TARGETING_VALUE, + INVALID_CUSTOM_TARGETING_KEY_ID, + INVALID_CUSTOM_TARGETING_VALUE_ID, + LOCATION_CANNOT_BE_TARGETED_IF_PARENT_IS_TARGETED, + LOCATION_CANNOT_BE_EXCLUDED_IF_PARENT_IS_EXCLUDED, + LOCATION_CANNOT_BE_EXCLUDED_DIRECTLY_WHEN_HAVE_TARGETED_LOCATION, + CUSTOMIZABLE_CUSTOM_KEY_CANNOT_BE_SEGMENTED, + DUPLICATED_FEATURE_VALUE, + MISSING_EXPANDED_FEATURE_PLACEHOLDER_IN_NAMEMACRO, + MISSING_FEATURE_VALUE_OF_NAMEMACRO_PLACEHOLDER, + MISSING_FEATURE_OF_NAMEMACRO_PLACEHOLDER, + MISSING_SUBTYPE_FOR_CUSTOM_TARGETING, + COMPANION_NOT_ALLOWED, + MISSING_COMPANION, + DUPLICATED_MASTER_SIZE, + CANNOT_MODIFY_READONLY_FEATURE, + CANNOT_MODIFY_PRODUCT_TYPE, + CANNOT_ADD_SEGMENTATION, + CANNOT_REMOVE_SEGMENTATION, + CANNOT_REMOVE_VALUE_FROM_SEGMENTATION, + CANNOT_ADD_FEATURE_VALUE_FOR_CUSTOM_TARGETING, + CANNOT_MODIFY_BUILTIN_TARGETING_FEATURE, + CANNOT_UPDATE_ARCHIVED_PRODUCT_TEMPLATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ProductTemplateActionError : ApiError { + private ProductTemplateActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProductTemplateActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductTemplateActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ProductTemplateActionErrorReason { + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ForecastServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ForecastService : DfpSoapClient, IForecastService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ForecastService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/ForecastService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Forecast getForecast(LineItem lineItem) { + object[] results = this.Invoke("getForecast", new object[] { lineItem }); + return ((Forecast) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Forecast getForecastById(long lineItemId) { + object[] results = this.Invoke("getForecastById", new object[] { lineItemId }); + return ((Forecast) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ContendingLineItem { + private long lineItemIdField; + + private bool lineItemIdFieldSpecified; + + private long contendingImpressionsField; + + private bool contendingImpressionsFieldSpecified; + + public long lineItemId { + get { return this.lineItemIdField; } + set { + this.lineItemIdField = value; + this.lineItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemIdSpecified { + get { return this.lineItemIdFieldSpecified; } + set { this.lineItemIdFieldSpecified = value; } + } + + public long contendingImpressions { + get { return this.contendingImpressionsField; } + set { + this.contendingImpressionsField = value; + this.contendingImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contendingImpressionsSpecified { + get { return this.contendingImpressionsFieldSpecified; } + set { this.contendingImpressionsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Forecast { + private long idField; + + private bool idFieldSpecified; + + private long orderIdField; + + private bool orderIdFieldSpecified; + + private UnitType unitTypeField; + + private bool unitTypeFieldSpecified; + + private long availableUnitsField; + + private bool availableUnitsFieldSpecified; + + private long deliveredUnitsField; + + private bool deliveredUnitsFieldSpecified; + + private long matchedUnitsField; + + private bool matchedUnitsFieldSpecified; + + private long possibleUnitsField; + + private bool possibleUnitsFieldSpecified; + + private long reservedUnitsField; + + private bool reservedUnitsFieldSpecified; + + private ContendingLineItem[] contendingLineItemsField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public UnitType unitType { + get { return this.unitTypeField; } + set { + this.unitTypeField = value; + this.unitTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitTypeSpecified { + get { return this.unitTypeFieldSpecified; } + set { this.unitTypeFieldSpecified = value; } + } + + public long availableUnits { + get { return this.availableUnitsField; } + set { + this.availableUnitsField = value; + this.availableUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool availableUnitsSpecified { + get { return this.availableUnitsFieldSpecified; } + set { this.availableUnitsFieldSpecified = value; } + } + + public long deliveredUnits { + get { return this.deliveredUnitsField; } + set { + this.deliveredUnitsField = value; + this.deliveredUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveredUnitsSpecified { + get { return this.deliveredUnitsFieldSpecified; } + set { this.deliveredUnitsFieldSpecified = value; } + } + + public long matchedUnits { + get { return this.matchedUnitsField; } + set { + this.matchedUnitsField = value; + this.matchedUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool matchedUnitsSpecified { + get { return this.matchedUnitsFieldSpecified; } + set { this.matchedUnitsFieldSpecified = value; } + } + + public long possibleUnits { + get { return this.possibleUnitsField; } + set { + this.possibleUnitsField = value; + this.possibleUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool possibleUnitsSpecified { + get { return this.possibleUnitsFieldSpecified; } + set { this.possibleUnitsFieldSpecified = value; } + } + + public long reservedUnits { + get { return this.reservedUnitsField; } + set { + this.reservedUnitsField = value; + this.reservedUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reservedUnitsSpecified { + get { return this.reservedUnitsFieldSpecified; } + set { this.reservedUnitsFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("contendingLineItems")] + public ContendingLineItem[] contendingLineItems { + get { return this.contendingLineItemsField; } + set { this.contendingLineItemsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "UserServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserRecord))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class UserService : DfpSoapClient, IUserService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public UserService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/UserService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User createUser(User user) { + object[] results = this.Invoke("createUser", new object[] { user }); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User[] createUsers([System.Xml.Serialization.XmlElementAttribute("users")] +User[] users) { + object[] results = this.Invoke("createUsers", new object[] { users }); + return ((User[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Role[] getAllRoles() { + object[] results = this.Invoke("getAllRoles", new object[0]); + return ((Role[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User getCurrentUser() { + object[] results = this.Invoke("getCurrentUser", new object[0]); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User getUser(long userId) { + object[] results = this.Invoke("getUser", new object[] { userId }); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserPage getUsersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getUsersByStatement", new object[] { filterStatement }); + return ((UserPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performUserAction(UserAction userAction, Statement filterStatement) { + object[] results = this.Invoke("performUserAction", new object[] { userAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User updateUser(User user) { + object[] results = this.Invoke("updateUser", new object[] { user }); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User[] updateUsers([System.Xml.Serialization.XmlElementAttribute("users")] +User[] users) { + object[] results = this.Invoke("updateUsers", new object[] { users }); + return ((User[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateUsers))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateUsers))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class UserAction { + private string userActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("UserAction.Type")] + public string UserActionType { + get { return this.userActionTypeField; } + set { this.userActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeactivateUsers : UserAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ActivateUsers : UserAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class UserPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private User[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public User[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class User : UserRecord { + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private bool isEmailNotificationAllowedField; + + private bool isEmailNotificationAllowedFieldSpecified; + + private string externalIdField; + + private string ordersUiLocalTimeZoneIdField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + public bool isEmailNotificationAllowed { + get { return this.isEmailNotificationAllowedField; } + set { + this.isEmailNotificationAllowedField = value; + this.isEmailNotificationAllowedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isEmailNotificationAllowedSpecified { + get { return this.isEmailNotificationAllowedFieldSpecified; } + set { this.isEmailNotificationAllowedFieldSpecified = value; } + } + + public string externalId { + get { return this.externalIdField; } + set { this.externalIdField = value; } + } + + public string ordersUiLocalTimeZoneId { + get { return this.ordersUiLocalTimeZoneIdField; } + set { this.ordersUiLocalTimeZoneIdField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(User))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class UserRecord { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string emailField; + + private long roleIdField; + + private bool roleIdFieldSpecified; + + private string roleNameField; + + private string preferredLocaleField; + + private string userRecordTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public long roleId { + get { return this.roleIdField; } + set { + this.roleIdField = value; + this.roleIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roleIdSpecified { + get { return this.roleIdFieldSpecified; } + set { this.roleIdFieldSpecified = value; } + } + + public string roleName { + get { return this.roleNameField; } + set { this.roleNameField = value; } + } + + public string preferredLocale { + get { return this.preferredLocaleField; } + set { this.preferredLocaleField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("UserRecord.Type")] + public string UserRecordType { + get { return this.userRecordTypeField; } + set { this.userRecordTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Role { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "PublisherQueryLanguageServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class PublisherQueryLanguageService : DfpSoapClient, IPublisherQueryLanguageService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public PublisherQueryLanguageService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/PublisherQueryLanguageService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ResultSet select(Statement selectStatement) { + object[] results = this.Invoke("select", new object[] { selectStatement }); + return ((ResultSet) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Row { + private Value[] valuesField; + + private string dummyField; + + [System.Xml.Serialization.XmlElementAttribute("values")] + public Value[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + + public string dummy { + get { return this.dummyField; } + set { this.dummyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ColumnType { + private string labelNameField; + + public string labelName { + get { return this.labelNameField; } + set { this.labelNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ResultSet { + private ColumnType[] columnTypesField; + + private Row[] rowsField; + + [System.Xml.Serialization.XmlElementAttribute("columnTypes")] + public ColumnType[] columnTypes { + get { return this.columnTypesField; } + set { this.columnTypesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("rows")] + public Row[] rows { + get { return this.rowsField; } + set { this.rowsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class OrderActionError : ApiError { + private OrderActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OrderActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OrderActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum OrderActionErrorReason { + PERMISSION_DENIED, + NOT_APPLICABLE, + IS_ARCHIVED, + HAS_ENDED, + CANNOT_APPROVE_WITH_UNRESERVED_LINE_ITEMS, + CANNOT_DELETE_ORDER_WITH_DELIVERED_LINEITEMS, + CANNOT_APPROVE_COMPANY_CREDIT_STATUS_NOT_ACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "TeamServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class TeamService : DfpSoapClient, ITeamService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public TeamService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/TeamService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Team createTeam(Team team) { + object[] results = this.Invoke("createTeam", new object[] { team }); + return ((Team) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Team[] createTeams([System.Xml.Serialization.XmlElementAttribute("teams")] +Team[] teams) { + object[] results = this.Invoke("createTeams", new object[] { teams }); + return ((Team[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Team getTeam(long teamId) { + object[] results = this.Invoke("getTeam", new object[] { teamId }); + return ((Team) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TeamPage getTeamsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getTeamsByStatement", new object[] { filterStatement }); + return ((TeamPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Team updateTeam(Team team) { + object[] results = this.Invoke("updateTeam", new object[] { team }); + return ((Team) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Team[] updateTeams([System.Xml.Serialization.XmlElementAttribute("teams")] +Team[] teams) { + object[] results = this.Invoke("updateTeams", new object[] { teams }); + return ((Team[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class TeamPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Team[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Team[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Team { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool hasAllCompaniesField; + + private bool hasAllCompaniesFieldSpecified; + + private bool hasAllInventoryField; + + private bool hasAllInventoryFieldSpecified; + + private TeamAccessType teamAccessTypeField; + + private bool teamAccessTypeFieldSpecified; + + private long[] companyIdsField; + + private string[] adUnitIdsField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool hasAllCompanies { + get { return this.hasAllCompaniesField; } + set { + this.hasAllCompaniesField = value; + this.hasAllCompaniesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasAllCompaniesSpecified { + get { return this.hasAllCompaniesFieldSpecified; } + set { this.hasAllCompaniesFieldSpecified = value; } + } + + public bool hasAllInventory { + get { return this.hasAllInventoryField; } + set { + this.hasAllInventoryField = value; + this.hasAllInventorySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasAllInventorySpecified { + get { return this.hasAllInventoryFieldSpecified; } + set { this.hasAllInventoryFieldSpecified = value; } + } + + public TeamAccessType teamAccessType { + get { return this.teamAccessTypeField; } + set { + this.teamAccessTypeField = value; + this.teamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool teamAccessTypeSpecified { + get { return this.teamAccessTypeFieldSpecified; } + set { this.teamAccessTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companyIds")] + public long[] companyIds { + get { return this.companyIdsField; } + set { this.companyIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adUnitIds")] + public string[] adUnitIds { + get { return this.adUnitIdsField; } + set { this.adUnitIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "RateCardServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class RateCardService : DfpSoapClient, IRateCardService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public RateCardService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/RateCardService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCard createRateCard(RateCard rateCard) { + object[] results = this.Invoke("createRateCard", new object[] { rateCard }); + return ((RateCard) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCard[] createRateCards([System.Xml.Serialization.XmlElementAttribute("rateCards")] +RateCard[] rateCards) { + object[] results = this.Invoke("createRateCards", new object[] { rateCards }); + return ((RateCard[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCard getRateCard(long rateCardId) { + object[] results = this.Invoke("getRateCard", new object[] { rateCardId }); + return ((RateCard) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardPage getRateCardsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getRateCardsByStatement", new object[] { filterStatement }); + return ((RateCardPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performRateCardAction(RateCardAction rateCardAction, Statement filterStatement) { + object[] results = this.Invoke("performRateCardAction", new object[] { rateCardAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCard updateRateCard(RateCard rateCard) { + object[] results = this.Invoke("updateRateCard", new object[] { rateCard }); + return ((RateCard) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCard[] updateRateCards([System.Xml.Serialization.XmlElementAttribute("rateCards")] +RateCard[] rateCards) { + object[] results = this.Invoke("updateRateCards", new object[] { rateCards }); + return ((RateCard[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateRateCards))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateRateCards))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class RateCardAction { + private string rateCardActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("RateCardAction.Type")] + public string RateCardActionType { + get { return this.rateCardActionTypeField; } + set { this.rateCardActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeactivateRateCards : RateCardAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ActivateRateCards : RateCardAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RateCardPage { + private RateCard[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public RateCard[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RateCard { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private RateCardStatus statusField; + + private bool statusFieldSpecified; + + private long[] appliedTeamIdsField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public RateCardStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum RateCardStatus { + ACTIVE, + INACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RateCardActionError : ApiError { + private RateCardActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RateCardActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RateCardActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum RateCardActionErrorReason { + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "PlacementServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SiteTargetingInfo))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class PlacementService : DfpSoapClient, IPlacementService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public PlacementService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/PlacementService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Placement createPlacement(Placement placement) { + object[] results = this.Invoke("createPlacement", new object[] { placement }); + return ((Placement) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Placement[] createPlacements([System.Xml.Serialization.XmlElementAttribute("placements")] +Placement[] placements) { + object[] results = this.Invoke("createPlacements", new object[] { placements }); + return ((Placement[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Placement getPlacement(long placementId) { + object[] results = this.Invoke("getPlacement", new object[] { placementId }); + return ((Placement) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual PlacementPage getPlacementsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getPlacementsByStatement", new object[] { filterStatement }); + return ((PlacementPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performPlacementAction(PlacementAction placementAction, Statement filterStatement) { + object[] results = this.Invoke("performPlacementAction", new object[] { placementAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Placement updatePlacement(Placement placement) { + object[] results = this.Invoke("updatePlacement", new object[] { placement }); + return ((Placement) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Placement[] updatePlacements([System.Xml.Serialization.XmlElementAttribute("placements")] +Placement[] placements) { + object[] results = this.Invoke("updatePlacements", new object[] { placements }); + return ((Placement[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivatePlacements))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchivePlacements))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivatePlacements))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class PlacementAction { + private string placementActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("PlacementAction.Type")] + public string PlacementActionType { + get { return this.placementActionTypeField; } + set { this.placementActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeactivatePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ArchivePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ActivatePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class PlacementPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Placement[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Placement[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Placement : SiteTargetingInfo { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private string placementCodeField; + + private InventoryStatus statusField; + + private bool statusFieldSpecified; + + private bool isAdSenseTargetingEnabledField; + + private bool isAdSenseTargetingEnabledFieldSpecified; + + private bool isAdPlannerTargetingEnabledField; + + private bool isAdPlannerTargetingEnabledFieldSpecified; + + private string adSenseTargetingLocaleField; + + private string[] targetedAdUnitIdsField; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public string placementCode { + get { return this.placementCodeField; } + set { this.placementCodeField = value; } + } + + public InventoryStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public bool isAdSenseTargetingEnabled { + get { return this.isAdSenseTargetingEnabledField; } + set { + this.isAdSenseTargetingEnabledField = value; + this.isAdSenseTargetingEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAdSenseTargetingEnabledSpecified { + get { return this.isAdSenseTargetingEnabledFieldSpecified; } + set { this.isAdSenseTargetingEnabledFieldSpecified = value; } + } + + public bool isAdPlannerTargetingEnabled { + get { return this.isAdPlannerTargetingEnabledField; } + set { + this.isAdPlannerTargetingEnabledField = value; + this.isAdPlannerTargetingEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAdPlannerTargetingEnabledSpecified { + get { return this.isAdPlannerTargetingEnabledFieldSpecified; } + set { this.isAdPlannerTargetingEnabledFieldSpecified = value; } + } + + public string adSenseTargetingLocale { + get { return this.adSenseTargetingLocaleField; } + set { this.adSenseTargetingLocaleField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedAdUnitIds")] + public string[] targetedAdUnitIds { + get { return this.targetedAdUnitIdsField; } + set { this.targetedAdUnitIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Placement))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class SiteTargetingInfo { + private string targetingDescriptionField; + + private string targetingSiteNameField; + + private string targetingAdLocationField; + + private string siteTargetingInfoTypeField; + + public string targetingDescription { + get { return this.targetingDescriptionField; } + set { this.targetingDescriptionField = value; } + } + + public string targetingSiteName { + get { return this.targetingSiteNameField; } + set { this.targetingSiteNameField = value; } + } + + public string targetingAdLocation { + get { return this.targetingAdLocationField; } + set { this.targetingAdLocationField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("SiteTargetingInfo.Type")] + public string SiteTargetingInfoType { + get { return this.siteTargetingInfoTypeField; } + set { this.siteTargetingInfoTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class PlacementError : ApiError { + private PlacementErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PlacementErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PlacementError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum PlacementErrorReason { + INVALID_ENTITY_TYPE, + SHARED_INVENTORY_ASSIGNED, + PLACEMENTS_CANNOT_INCLUDE_INVENTORY_FROM_MULTIPLE_DISTRIBUTOR_NETWORKS, + PLACEMENTS_CANNOT_INCLUDE_BOTH_LOCAL_AND_SHARED_INVENTORY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReconciliationOrderReportServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReconciliationOrderReportService : DfpSoapClient, IReconciliationOrderReportService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReconciliationOrderReportService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/ReconciliationOrderReportServic" + "e"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationOrderReport getReconciliationOrderReport(long reconciliationOrderReportId) { + object[] results = this.Invoke("getReconciliationOrderReport", new object[] { reconciliationOrderReportId }); + return ((ReconciliationOrderReport) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationOrderReportPage getReconciliationOrderReportsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getReconciliationOrderReportsByStatement", new object[] { filterStatement }); + return ((ReconciliationOrderReportPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performReconciliationOrderReportAction(ReconciliationOrderReportAction reconciliationOrderReportAction, Statement filterStatement) { + object[] results = this.Invoke("performReconciliationOrderReportAction", new object[] { reconciliationOrderReportAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RevertReconciliationOrderReports))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitReconciliationOrderReports))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class ReconciliationOrderReportAction { + private string reconciliationOrderReportActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ReconciliationOrderReportAction.Type")] + public string ReconciliationOrderReportActionType { + get { return this.reconciliationOrderReportActionTypeField; } + set { this.reconciliationOrderReportActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RevertReconciliationOrderReports : ReconciliationOrderReportAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class SubmitReconciliationOrderReports : ReconciliationOrderReportAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ReconciliationOrderReportPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ReconciliationOrderReport[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ReconciliationOrderReport[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ReconciliationOrderReport { + private long idField; + + private bool idFieldSpecified; + + private long reconciliationReportIdField; + + private bool reconciliationReportIdFieldSpecified; + + private long orderIdField; + + private bool orderIdFieldSpecified; + + private ReconciliationOrderReportStatus statusField; + + private bool statusFieldSpecified; + + private DateTime submissionDateTimeField; + + private long submitterIdField; + + private bool submitterIdFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long reconciliationReportId { + get { return this.reconciliationReportIdField; } + set { + this.reconciliationReportIdField = value; + this.reconciliationReportIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reconciliationReportIdSpecified { + get { return this.reconciliationReportIdFieldSpecified; } + set { this.reconciliationReportIdFieldSpecified = value; } + } + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public ReconciliationOrderReportStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public DateTime submissionDateTime { + get { return this.submissionDateTimeField; } + set { this.submissionDateTimeField = value; } + } + + public long submitterId { + get { return this.submitterIdField; } + set { + this.submitterIdField = value; + this.submitterIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool submitterIdSpecified { + get { return this.submitterIdFieldSpecified; } + set { this.submitterIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ReconciliationOrderReportStatus { + DRAFT, + RECONCILED, + REVERTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ActivityServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ActivityService : DfpSoapClient, IActivityService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ActivityService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/ActivityService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Activity[] createActivities([System.Xml.Serialization.XmlElementAttribute("activities")] +Activity[] activities) { + object[] results = this.Invoke("createActivities", new object[] { activities }); + return ((Activity[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Activity createActivity(Activity activity) { + object[] results = this.Invoke("createActivity", new object[] { activity }); + return ((Activity) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityPage getActivitiesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getActivitiesByStatement", new object[] { filterStatement }); + return ((ActivityPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Activity getActivity(int activityId) { + object[] results = this.Invoke("getActivity", new object[] { activityId }); + return ((Activity) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Activity[] updateActivities([System.Xml.Serialization.XmlElementAttribute("activities")] +Activity[] activities) { + object[] results = this.Invoke("updateActivities", new object[] { activities }); + return ((Activity[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Activity updateActivity(Activity activity) { + object[] results = this.Invoke("updateActivity", new object[] { activity }); + return ((Activity) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ActivityPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Activity[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Activity[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Activity { + private int idField; + + private bool idFieldSpecified; + + private int activityGroupIdField; + + private bool activityGroupIdFieldSpecified; + + private string nameField; + + private string expectedURLField; + + private ActivityStatus statusField; + + private bool statusFieldSpecified; + + private ActivityType typeField; + + private bool typeFieldSpecified; + + public int id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public int activityGroupId { + get { return this.activityGroupIdField; } + set { + this.activityGroupIdField = value; + this.activityGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool activityGroupIdSpecified { + get { return this.activityGroupIdFieldSpecified; } + set { this.activityGroupIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string expectedURL { + get { return this.expectedURLField; } + set { this.expectedURLField = value; } + } + + public ActivityStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ActivityType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Activity.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ActivityStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Activity.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ActivityType { + PAGE_VIEWS, + DAILY_VISITS, + CUSTOM, + ITEMS_PURCHASED, + TRANSACTIONS, + IOS_APPLICATION_DOWNLOADS, + ANDROID_APPLICATION_DOWNLOADS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "OrderServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class OrderService : DfpSoapClient, IOrderService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public OrderService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/OrderService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Order createOrder(Order order) { + object[] results = this.Invoke("createOrder", new object[] { order }); + return ((Order) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Order[] createOrders([System.Xml.Serialization.XmlElementAttribute("orders")] +Order[] orders) { + object[] results = this.Invoke("createOrders", new object[] { orders }); + return ((Order[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Order getOrder(long orderId) { + object[] results = this.Invoke("getOrder", new object[] { orderId }); + return ((Order) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual OrderPage getOrdersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getOrdersByStatement", new object[] { filterStatement }); + return ((OrderPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performOrderAction(OrderAction orderAction, Statement filterStatement) { + object[] results = this.Invoke("performOrderAction", new object[] { orderAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Order updateOrder(Order order) { + object[] results = this.Invoke("updateOrder", new object[] { order }); + return ((Order) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Order[] updateOrders([System.Xml.Serialization.XmlElementAttribute("orders")] +Order[] orders) { + object[] results = this.Invoke("updateOrders", new object[] { orders }); + return ((Order[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApproval))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalAndOverbook))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RetractOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RetractOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PauseOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DisapproveOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DisapproveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class OrderAction { + private string orderActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("OrderAction.Type")] + public string OrderActionType { + get { return this.orderActionTypeField; } + set { this.orderActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class UnarchiveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class SubmitOrdersForApprovalWithoutReservationChanges : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalAndOverbook))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class SubmitOrdersForApproval : OrderAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class SubmitOrdersForApprovalAndOverbook : SubmitOrdersForApproval { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RetractOrdersWithoutReservationChanges : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RetractOrders : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ResumeOrders : OrderAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ResumeAndOverbookOrders : ResumeOrders { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class PauseOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DisapproveOrdersWithoutReservationChanges : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DisapproveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeleteOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ArchiveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ApproveOrdersWithoutReservationChanges : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ApproveOrders : OrderAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ApproveAndOverbookOrders : ApproveOrders { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class OrderPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Order[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Order[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Order { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private OrderStatus statusField; + + private bool statusFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private string notesField; + + private int externalOrderIdField; + + private bool externalOrderIdFieldSpecified; + + private string poNumberField; + + private string currencyCodeField; + + private long advertiserIdField; + + private bool advertiserIdFieldSpecified; + + private long[] advertiserContactIdsField; + + private long agencyIdField; + + private bool agencyIdFieldSpecified; + + private long[] agencyContactIdsField; + + private long creatorIdField; + + private bool creatorIdFieldSpecified; + + private long traffickerIdField; + + private bool traffickerIdFieldSpecified; + + private long[] secondaryTraffickerIdsField; + + private long salespersonIdField; + + private bool salespersonIdFieldSpecified; + + private long[] secondarySalespersonIdsField; + + private long totalImpressionsDeliveredField; + + private bool totalImpressionsDeliveredFieldSpecified; + + private long totalClicksDeliveredField; + + private bool totalClicksDeliveredFieldSpecified; + + private Money totalBudgetField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private string lastModifiedByAppField; + + private long[] appliedTeamIdsField; + + private DateTime lastModifiedDateTimeField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public OrderStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public int externalOrderId { + get { return this.externalOrderIdField; } + set { + this.externalOrderIdField = value; + this.externalOrderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool externalOrderIdSpecified { + get { return this.externalOrderIdFieldSpecified; } + set { this.externalOrderIdFieldSpecified = value; } + } + + public string poNumber { + get { return this.poNumberField; } + set { this.poNumberField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public long advertiserId { + get { return this.advertiserIdField; } + set { + this.advertiserIdField = value; + this.advertiserIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserIdSpecified { + get { return this.advertiserIdFieldSpecified; } + set { this.advertiserIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("advertiserContactIds")] + public long[] advertiserContactIds { + get { return this.advertiserContactIdsField; } + set { this.advertiserContactIdsField = value; } + } + + public long agencyId { + get { return this.agencyIdField; } + set { + this.agencyIdField = value; + this.agencyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool agencyIdSpecified { + get { return this.agencyIdFieldSpecified; } + set { this.agencyIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("agencyContactIds")] + public long[] agencyContactIds { + get { return this.agencyContactIdsField; } + set { this.agencyContactIdsField = value; } + } + + public long creatorId { + get { return this.creatorIdField; } + set { + this.creatorIdField = value; + this.creatorIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creatorIdSpecified { + get { return this.creatorIdFieldSpecified; } + set { this.creatorIdFieldSpecified = value; } + } + + public long traffickerId { + get { return this.traffickerIdField; } + set { + this.traffickerIdField = value; + this.traffickerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool traffickerIdSpecified { + get { return this.traffickerIdFieldSpecified; } + set { this.traffickerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryTraffickerIds")] + public long[] secondaryTraffickerIds { + get { return this.secondaryTraffickerIdsField; } + set { this.secondaryTraffickerIdsField = value; } + } + + public long salespersonId { + get { return this.salespersonIdField; } + set { + this.salespersonIdField = value; + this.salespersonIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool salespersonIdSpecified { + get { return this.salespersonIdFieldSpecified; } + set { this.salespersonIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondarySalespersonIds")] + public long[] secondarySalespersonIds { + get { return this.secondarySalespersonIdsField; } + set { this.secondarySalespersonIdsField = value; } + } + + public long totalImpressionsDelivered { + get { return this.totalImpressionsDeliveredField; } + set { + this.totalImpressionsDeliveredField = value; + this.totalImpressionsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalImpressionsDeliveredSpecified { + get { return this.totalImpressionsDeliveredFieldSpecified; } + set { this.totalImpressionsDeliveredFieldSpecified = value; } + } + + public long totalClicksDelivered { + get { return this.totalClicksDeliveredField; } + set { + this.totalClicksDeliveredField = value; + this.totalClicksDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalClicksDeliveredSpecified { + get { return this.totalClicksDeliveredFieldSpecified; } + set { this.totalClicksDeliveredFieldSpecified = value; } + } + + public Money totalBudget { + get { return this.totalBudgetField; } + set { this.totalBudgetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public string lastModifiedByApp { + get { return this.lastModifiedByAppField; } + set { this.lastModifiedByAppField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum OrderStatus { + DRAFT, + PENDING_APPROVAL, + APPROVED, + DISAPPROVED, + PAUSED, + CANCELED, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProposalServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProposalService : DfpSoapClient, IProposalService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProposalService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/ProposalService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Proposal createProposal(Proposal proposal) { + object[] results = this.Invoke("createProposal", new object[] { proposal }); + return ((Proposal) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Proposal[] createProposals([System.Xml.Serialization.XmlElementAttribute("proposals")] +Proposal[] proposals) { + object[] results = this.Invoke("createProposals", new object[] { proposals }); + return ((Proposal[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Proposal getProposal(long proposalId) { + object[] results = this.Invoke("getProposal", new object[] { proposalId }); + return ((Proposal) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalPage getProposalsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getProposalsByStatement", new object[] { filterStatement }); + return ((ProposalPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performProposalAction(ProposalAction proposalAction, Statement filterStatement) { + object[] results = this.Invoke("performProposalAction", new object[] { proposalAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Proposal updateProposal(Proposal proposal) { + object[] results = this.Invoke("updateProposal", new object[] { proposal }); + return ((Proposal) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Proposal[] updateProposals([System.Xml.Serialization.XmlElementAttribute("proposals")] +Proposal[] proposals) { + object[] results = this.Invoke("updateProposals", new object[] { proposals }); + return ((Proposal[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveProposals))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitProposalsForApproval))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RetractProposals))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RejectProposals))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveProposals))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveProposals))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class ProposalAction { + private string proposalActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProposalAction.Type")] + public string ProposalActionType { + get { return this.proposalActionTypeField; } + set { this.proposalActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class UnarchiveProposals : ProposalAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class SubmitProposalsForApproval : ProposalAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RetractProposals : ProposalAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RejectProposals : ProposalAction { + private long[] workflowActionIdsField; + + private string commentField; + + [System.Xml.Serialization.XmlElementAttribute("workflowActionIds")] + public long[] workflowActionIds { + get { return this.workflowActionIdsField; } + set { this.workflowActionIdsField = value; } + } + + public string comment { + get { return this.commentField; } + set { this.commentField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ArchiveProposals : ProposalAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ApproveProposals : ProposalAction { + private long[] workflowActionIdsField; + + [System.Xml.Serialization.XmlElementAttribute("workflowActionIds")] + public long[] workflowActionIds { + get { return this.workflowActionIdsField; } + set { this.workflowActionIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ProposalPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Proposal[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Proposal[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Proposal { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + private ProposalStatus statusField; + + private bool statusFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private ProposalCompanyAssociation advertiserField; + + private ProposalCompanyAssociation[] agenciesField; + + private int probabilityToCloseField; + + private bool probabilityToCloseFieldSpecified; + + private BillingCap billingCapField; + + private bool billingCapFieldSpecified; + + private BillingSchedule billingScheduleField; + + private bool billingScheduleFieldSpecified; + + private BillingSource billingSourceField; + + private bool billingSourceFieldSpecified; + + private string poNumberField; + + private string notesField; + + private Money budgetField; + + private SalespersonSplit primarySalespersonField; + + private SalespersonSplit[] secondarySalespeopleField; + + private long[] salesPlannerIdsField; + + private long primaryTraffickerIdField; + + private bool primaryTraffickerIdFieldSpecified; + + private long[] secondaryTraffickerIdsField; + + private long[] appliedTeamIdsField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private long advertiserDiscountField; + + private bool advertiserDiscountFieldSpecified; + + private long proposalDiscountField; + + private bool proposalDiscountFieldSpecified; + + private Money additionalAdjustmentField; + + private long exchangeRateField; + + private bool exchangeRateFieldSpecified; + + private bool refreshExchangeRateField; + + private bool refreshExchangeRateFieldSpecified; + + private long agencyCommissionField; + + private bool agencyCommissionFieldSpecified; + + private long valueAddedTaxField; + + private bool valueAddedTaxFieldSpecified; + + private long[] approvalWorkflowActionIdsField; + + private ProposalApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public ProposalStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public ProposalCompanyAssociation advertiser { + get { return this.advertiserField; } + set { this.advertiserField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("agencies")] + public ProposalCompanyAssociation[] agencies { + get { return this.agenciesField; } + set { this.agenciesField = value; } + } + + public int probabilityToClose { + get { return this.probabilityToCloseField; } + set { + this.probabilityToCloseField = value; + this.probabilityToCloseSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool probabilityToCloseSpecified { + get { return this.probabilityToCloseFieldSpecified; } + set { this.probabilityToCloseFieldSpecified = value; } + } + + public BillingCap billingCap { + get { return this.billingCapField; } + set { + this.billingCapField = value; + this.billingCapSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingCapSpecified { + get { return this.billingCapFieldSpecified; } + set { this.billingCapFieldSpecified = value; } + } + + public BillingSchedule billingSchedule { + get { return this.billingScheduleField; } + set { + this.billingScheduleField = value; + this.billingScheduleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingScheduleSpecified { + get { return this.billingScheduleFieldSpecified; } + set { this.billingScheduleFieldSpecified = value; } + } + + public BillingSource billingSource { + get { return this.billingSourceField; } + set { + this.billingSourceField = value; + this.billingSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingSourceSpecified { + get { return this.billingSourceFieldSpecified; } + set { this.billingSourceFieldSpecified = value; } + } + + public string poNumber { + get { return this.poNumberField; } + set { this.poNumberField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public Money budget { + get { return this.budgetField; } + set { this.budgetField = value; } + } + + public SalespersonSplit primarySalesperson { + get { return this.primarySalespersonField; } + set { this.primarySalespersonField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondarySalespeople")] + public SalespersonSplit[] secondarySalespeople { + get { return this.secondarySalespeopleField; } + set { this.secondarySalespeopleField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("salesPlannerIds")] + public long[] salesPlannerIds { + get { return this.salesPlannerIdsField; } + set { this.salesPlannerIdsField = value; } + } + + public long primaryTraffickerId { + get { return this.primaryTraffickerIdField; } + set { + this.primaryTraffickerIdField = value; + this.primaryTraffickerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool primaryTraffickerIdSpecified { + get { return this.primaryTraffickerIdFieldSpecified; } + set { this.primaryTraffickerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryTraffickerIds")] + public long[] secondaryTraffickerIds { + get { return this.secondaryTraffickerIdsField; } + set { this.secondaryTraffickerIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public long advertiserDiscount { + get { return this.advertiserDiscountField; } + set { + this.advertiserDiscountField = value; + this.advertiserDiscountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserDiscountSpecified { + get { return this.advertiserDiscountFieldSpecified; } + set { this.advertiserDiscountFieldSpecified = value; } + } + + public long proposalDiscount { + get { return this.proposalDiscountField; } + set { + this.proposalDiscountField = value; + this.proposalDiscountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool proposalDiscountSpecified { + get { return this.proposalDiscountFieldSpecified; } + set { this.proposalDiscountFieldSpecified = value; } + } + + public Money additionalAdjustment { + get { return this.additionalAdjustmentField; } + set { this.additionalAdjustmentField = value; } + } + + public long exchangeRate { + get { return this.exchangeRateField; } + set { + this.exchangeRateField = value; + this.exchangeRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool exchangeRateSpecified { + get { return this.exchangeRateFieldSpecified; } + set { this.exchangeRateFieldSpecified = value; } + } + + public bool refreshExchangeRate { + get { return this.refreshExchangeRateField; } + set { + this.refreshExchangeRateField = value; + this.refreshExchangeRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool refreshExchangeRateSpecified { + get { return this.refreshExchangeRateFieldSpecified; } + set { this.refreshExchangeRateFieldSpecified = value; } + } + + public long agencyCommission { + get { return this.agencyCommissionField; } + set { + this.agencyCommissionField = value; + this.agencyCommissionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool agencyCommissionSpecified { + get { return this.agencyCommissionFieldSpecified; } + set { this.agencyCommissionFieldSpecified = value; } + } + + public long valueAddedTax { + get { return this.valueAddedTaxField; } + set { + this.valueAddedTaxField = value; + this.valueAddedTaxSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueAddedTaxSpecified { + get { return this.valueAddedTaxFieldSpecified; } + set { this.valueAddedTaxFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("approvalWorkflowActionIds")] + public long[] approvalWorkflowActionIds { + get { return this.approvalWorkflowActionIdsField; } + set { this.approvalWorkflowActionIdsField = value; } + } + + public ProposalApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ProposalStatus { + DRAFT, + PENDING_APPROVAL, + APPROVED, + REJECTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ProposalCompanyAssociation { + private long companyIdField; + + private bool companyIdFieldSpecified; + + private ProposalCompanyAssociationType typeField; + + private bool typeFieldSpecified; + + private long[] contactIdsField; + + public long companyId { + get { return this.companyIdField; } + set { + this.companyIdField = value; + this.companyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companyIdSpecified { + get { return this.companyIdFieldSpecified; } + set { this.companyIdFieldSpecified = value; } + } + + public ProposalCompanyAssociationType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("contactIds")] + public long[] contactIds { + get { return this.contactIdsField; } + set { this.contactIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ProposalCompanyAssociationType { + PRIMARY_AGENCY, + BILLING_AGENCY, + BRANDING_AGENCY, + OTHER_AGENCY, + ADVERTISER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class SalespersonSplit { + private long userIdField; + + private bool userIdFieldSpecified; + + private int splitField; + + private bool splitFieldSpecified; + + public long userId { + get { return this.userIdField; } + set { + this.userIdField = value; + this.userIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userIdSpecified { + get { return this.userIdFieldSpecified; } + set { this.userIdFieldSpecified = value; } + } + + public int split { + get { return this.splitField; } + set { + this.splitField = value; + this.splitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool splitSpecified { + get { return this.splitFieldSpecified; } + set { this.splitFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ProposalApprovalStatus { + PENDING, + NON_PENDING, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class WorkflowActionError : ApiError { + private WorkflowActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public WorkflowActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "WorkflowActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum WorkflowActionErrorReason { + NOT_APPLICABLE, + WORKFLOW_DEFINITION_NOT_FOUND, + EMPTY_ACTION_LIST, + NOT_ACTION_APPROVER, + WORKFLOW_ALREADY_COMPLETED, + WORKFLOW_ALREADY_FAILED, + WORKFLOW_ALREADY_CANCELED, + ACTION_COMPLETED, + ACTION_FAILED, + ACTION_CANCELED, + ACTION_NOT_ACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ProposalActionError : ApiError { + private ProposalActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProposalActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProposalActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ProposalActionErrorReason { + NOT_APPLICABLE, + IS_ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeTemplateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeTemplateService : DfpSoapClient, ICreativeTemplateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeTemplateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/CreativeTemplateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeTemplate getCreativeTemplate(long creativeTemplateId) { + object[] results = this.Invoke("getCreativeTemplate", new object[] { creativeTemplateId }); + return ((CreativeTemplate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeTemplatePage getCreativeTemplatesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativeTemplatesByStatement", new object[] { filterStatement }); + return ((CreativeTemplatePage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CreativeTemplatePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeTemplate[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeTemplate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CreativeTemplate { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private CreativeTemplateVariable[] variablesField; + + private CreativeTemplateStatus statusField; + + private bool statusFieldSpecified; + + private CreativeTemplateType typeField; + + private bool typeFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("variables")] + public CreativeTemplateVariable[] variables { + get { return this.variablesField; } + set { this.variablesField = value; } + } + + public CreativeTemplateStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public CreativeTemplateType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UrlCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListStringCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetCreativeTemplateVariable))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class CreativeTemplateVariable { + private string labelField; + + private string uniqueNameField; + + private string descriptionField; + + private bool isRequiredField; + + private bool isRequiredFieldSpecified; + + private string creativeTemplateVariableTypeField; + + public string label { + get { return this.labelField; } + set { this.labelField = value; } + } + + public string uniqueName { + get { return this.uniqueNameField; } + set { this.uniqueNameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isRequired { + get { return this.isRequiredField; } + set { + this.isRequiredField = value; + this.isRequiredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isRequiredSpecified { + get { return this.isRequiredFieldSpecified; } + set { this.isRequiredFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("CreativeTemplateVariable.Type")] + public string CreativeTemplateVariableType { + get { return this.creativeTemplateVariableTypeField; } + set { this.creativeTemplateVariableTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class UrlCreativeTemplateVariable : CreativeTemplateVariable { + private string defaultValueField; + + public string defaultValue { + get { return this.defaultValueField; } + set { this.defaultValueField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListStringCreativeTemplateVariable))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class StringCreativeTemplateVariable : CreativeTemplateVariable { + private string defaultValueField; + + public string defaultValue { + get { return this.defaultValueField; } + set { this.defaultValueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ListStringCreativeTemplateVariable : StringCreativeTemplateVariable { + private ListStringCreativeTemplateVariableVariableChoice[] choicesField; + + private bool allowOtherChoiceField; + + private bool allowOtherChoiceFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("choices")] + public ListStringCreativeTemplateVariableVariableChoice[] choices { + get { return this.choicesField; } + set { this.choicesField = value; } + } + + public bool allowOtherChoice { + get { return this.allowOtherChoiceField; } + set { + this.allowOtherChoiceField = value; + this.allowOtherChoiceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowOtherChoiceSpecified { + get { return this.allowOtherChoiceFieldSpecified; } + set { this.allowOtherChoiceFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ListStringCreativeTemplateVariable.VariableChoice", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ListStringCreativeTemplateVariableVariableChoice { + private string labelField; + + private string valueField; + + public string label { + get { return this.labelField; } + set { this.labelField = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class LongCreativeTemplateVariable : CreativeTemplateVariable { + private long defaultValueField; + + private bool defaultValueFieldSpecified; + + public long defaultValue { + get { return this.defaultValueField; } + set { + this.defaultValueField = value; + this.defaultValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool defaultValueSpecified { + get { return this.defaultValueFieldSpecified; } + set { this.defaultValueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AssetCreativeTemplateVariable : CreativeTemplateVariable { + private AssetCreativeTemplateVariableMimeType[] mimeTypesField; + + [System.Xml.Serialization.XmlElementAttribute("mimeTypes")] + public AssetCreativeTemplateVariableMimeType[] mimeTypes { + get { return this.mimeTypesField; } + set { this.mimeTypesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AssetCreativeTemplateVariable.MimeType", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum AssetCreativeTemplateVariableMimeType { + JPG, + PNG, + GIF, + SWF + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CreativeTemplateStatus { + ACTIVE, + INACTIVE, + DELETED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CreativeTemplateType { + SYSTEM_DEFINED, + USER_DEFINED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CreativeTemplateError : ApiError { + private CreativeTemplateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeTemplateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeTemplateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CreativeTemplateErrorReason { + CANNOT_PARSE_CREATIVE_TEMPLATE, + VARIABLE_DUPLICATE_UNIQUE_NAME, + VARIABLE_INVALID_UNIQUE_NAME, + LIST_CHOICE_DUPLICATE_VALUE, + LIST_CHOICE_NEEDS_DEFAULT, + LIST_CHOICES_EMPTY, + NO_TARGET_PLATFORMS, + MULTIPLE_TARGET_PLATFORMS, + UNRECOGNIZED_PLACEHOLDER, + PLACEHOLDERS_NOT_IN_FORMATTER, + MISSING_INTERSTITIAL_MACRO, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Asset))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeService : DfpSoapClient, ICreativeService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/CreativeService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Creative createCreative(Creative creative) { + object[] results = this.Invoke("createCreative", new object[] { creative }); + return ((Creative) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Creative[] createCreatives([System.Xml.Serialization.XmlElementAttribute("creatives")] +Creative[] creatives) { + object[] results = this.Invoke("createCreatives", new object[] { creatives }); + return ((Creative[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Creative getCreative(long creativeId) { + object[] results = this.Invoke("getCreative", new object[] { creativeId }); + return ((Creative) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativePage getCreativesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativesByStatement", new object[] { filterStatement }); + return ((CreativePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Creative updateCreative(Creative creative) { + object[] results = this.Invoke("updateCreative", new object[] { creative }); + return ((Creative) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Creative[] updateCreatives([System.Xml.Serialization.XmlElementAttribute("creatives")] +Creative[] creatives) { + object[] results = this.Invoke("updateCreatives", new object[] { creatives }); + return ((Creative[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CreativePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Creative[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Creative[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VastRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnsupportedCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ThirdPartyCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TemplateCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InternalRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasDestinationUrlCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpMobileCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseVideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AspectRatioImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClickTrackingCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseRichMediaStudioCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasHtmlSnippetDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class Creative { + private long advertiserIdField; + + private bool advertiserIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private Size sizeField; + + private string previewUrlField; + + private AppliedLabel[] appliedLabelsField; + + private DateTime lastModifiedDateTimeField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private string creativeTypeField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { + this.advertiserIdField = value; + this.advertiserIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserIdSpecified { + get { return this.advertiserIdFieldSpecified; } + set { this.advertiserIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + public string previewUrl { + get { return this.previewUrlField; } + set { this.previewUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Creative.Type")] + public string CreativeType { + get { return this.creativeTypeField; } + set { this.creativeTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class VastRedirectCreative : Creative { + private string vastXmlUrlField; + + private VastRedirectType vastRedirectTypeField; + + private bool vastRedirectTypeFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string vastPreviewUrlField; + + public string vastXmlUrl { + get { return this.vastXmlUrlField; } + set { this.vastXmlUrlField = value; } + } + + public VastRedirectType vastRedirectType { + get { return this.vastRedirectTypeField; } + set { + this.vastRedirectTypeField = value; + this.vastRedirectTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool vastRedirectTypeSpecified { + get { return this.vastRedirectTypeFieldSpecified; } + set { this.vastRedirectTypeFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum VastRedirectType { + LINEAR, + NON_LINEAR, + LINEAR_AND_NON_LINEAR + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ConversionEvent_TrackingUrlsMapEntry { + private ConversionEvent keyField; + + private bool keyFieldSpecified; + + private string[] valueField; + + public ConversionEvent key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("urls", IsNullable = false)] + public string[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ConversionEvent { + CREATIVE_VIEW, + START, + SKIP_SHOWN, + FIRST_QUARTILE, + MIDPOINT, + THIRD_QUARTILE, + ENGAGED_VIEW, + COMPLETE, + MUTE, + UNMUTE, + PAUSE, + REWIND, + RESUME, + SKIPPED, + FULLSCREEN, + EXPAND, + COLLAPSE, + ACCEPT_INVITATION, + CLOSE, + CLICK_TRACKING, + SURVEY, + CUSTOM_CLICK + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class UnsupportedCreative : Creative { + private string unsupportedCreativeTypeField; + + public string unsupportedCreativeType { + get { return this.unsupportedCreativeTypeField; } + set { this.unsupportedCreativeTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ThirdPartyCreative : Creative { + private string snippetField; + + private string expandedSnippetField; + + public string snippet { + get { return this.snippetField; } + set { this.snippetField = value; } + } + + public string expandedSnippet { + get { return this.expandedSnippetField; } + set { this.expandedSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class TemplateCreative : Creative { + private long creativeTemplateIdField; + + private bool creativeTemplateIdFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + private string destinationUrlField; + + private BaseCreativeTemplateVariableValue[] creativeTemplateVariableValuesField; + + public long creativeTemplateId { + get { return this.creativeTemplateIdField; } + set { + this.creativeTemplateIdField = value; + this.creativeTemplateIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeTemplateIdSpecified { + get { return this.creativeTemplateIdFieldSpecified; } + set { this.creativeTemplateIdFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativeTemplateVariableValues")] + public BaseCreativeTemplateVariableValue[] creativeTemplateVariableValues { + get { return this.creativeTemplateVariableValuesField; } + set { this.creativeTemplateVariableValuesField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UrlCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetCreativeTemplateVariableValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class BaseCreativeTemplateVariableValue { + private string uniqueNameField; + + private string baseCreativeTemplateVariableValueTypeField; + + public string uniqueName { + get { return this.uniqueNameField; } + set { this.uniqueNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseCreativeTemplateVariableValue.Type")] + public string BaseCreativeTemplateVariableValueType { + get { return this.baseCreativeTemplateVariableValueTypeField; } + set { this.baseCreativeTemplateVariableValueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class UrlCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class StringCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class LongCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private long valueField; + + private bool valueFieldSpecified; + + public long value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AssetCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class LegacyDfpCreative : Creative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class InternalRedirectCreative : Creative { + private Size assetSizeField; + + private string internalRedirectUrlField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public Size assetSize { + get { return this.assetSizeField; } + set { this.assetSizeField = value; } + } + + public string internalRedirectUrl { + get { return this.internalRedirectUrlField; } + set { this.internalRedirectUrlField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpMobileCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseVideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AspectRatioImageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class HasDestinationUrlCreative : Creative { + private string destinationUrlField; + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class VpaidLinearRedirectCreative : HasDestinationUrlCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + private string flashUrlField; + + private Size flashAssetSizeField; + + private string vastPreviewUrlField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string flashUrl { + get { return this.flashUrlField; } + set { this.flashUrlField = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class VpaidLinearCreative : HasDestinationUrlCreative { + private string flashNameField; + + private byte[] flashByteArrayField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private Size flashAssetSizeField; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + private string vastPreviewUrlField; + + public string flashName { + get { return this.flashNameField; } + set { this.flashNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] flashByteArray { + get { return this.flashByteArrayField; } + set { this.flashByteArrayField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class LegacyDfpMobileCreative : HasDestinationUrlCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CustomCreative : HasDestinationUrlCreative { + private string htmlSnippetField; + + private CustomCreativeAsset[] customCreativeAssetsField; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public string htmlSnippet { + get { return this.htmlSnippetField; } + set { this.htmlSnippetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customCreativeAssets")] + public CustomCreativeAsset[] customCreativeAssets { + get { return this.customCreativeAssetsField; } + set { this.customCreativeAssetsField = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CustomCreativeAsset { + private string macroNameField; + + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + private long fileSizeField; + + private bool fileSizeFieldSpecified; + + public string macroName { + get { return this.macroNameField; } + set { this.macroNameField = value; } + } + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public long fileSize { + get { return this.fileSizeField; } + set { + this.fileSizeField = value; + this.fileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fileSizeSpecified { + get { return this.fileSizeFieldSpecified; } + set { this.fileSizeFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class BaseVideoCreative : HasDestinationUrlCreative { + private int durationField; + + private bool durationFieldSpecified; + + private bool allowDurationOverrideField; + + private bool allowDurationOverrideFieldSpecified; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private long[] companionCreativeIdsField; + + private string customParametersField; + + private string vastPreviewUrlField; + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public bool allowDurationOverride { + get { return this.allowDurationOverrideField; } + set { + this.allowDurationOverrideField = value; + this.allowDurationOverrideSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowDurationOverrideSpecified { + get { return this.allowDurationOverrideFieldSpecified; } + set { this.allowDurationOverrideFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class VideoRedirectCreative : BaseVideoCreative { + private VideoRedirectAsset[] videoAssetsField; + + [System.Xml.Serialization.XmlElementAttribute("videoAssets")] + public VideoRedirectAsset[] videoAssets { + get { return this.videoAssetsField; } + set { this.videoAssetsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class VideoRedirectAsset : RedirectAsset { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class RedirectAsset : Asset { + private string redirectUrlField; + + public string redirectUrl { + get { return this.redirectUrlField; } + set { this.redirectUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RedirectAsset))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class Asset { + private string assetTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Asset.Type")] + public string AssetType { + get { return this.assetTypeField; } + set { this.assetTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class VideoCreative : BaseVideoCreative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class BaseImageRedirectCreative : HasDestinationUrlCreative { + private string imageUrlField; + + public string imageUrl { + get { return this.imageUrlField; } + set { this.imageUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ImageRedirectOverlayCreative : BaseImageRedirectCreative { + private Size assetSizeField; + + private int durationField; + + private bool durationFieldSpecified; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private string vastPreviewUrlField; + + public Size assetSize { + get { return this.assetSizeField; } + set { this.assetSizeField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ImageRedirectCreative : BaseImageRedirectCreative { + private string altTextField; + + private string thirdPartyImpressionUrlField; + + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + public string thirdPartyImpressionUrl { + get { return this.thirdPartyImpressionUrlField; } + set { this.thirdPartyImpressionUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class BaseImageCreative : HasDestinationUrlCreative { + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private CreativeAsset primaryImageAssetField; + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public CreativeAsset primaryImageAsset { + get { return this.primaryImageAssetField; } + set { this.primaryImageAssetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CreativeAsset { + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + private long fileSizeField; + + private bool fileSizeFieldSpecified; + + private string assetUrlField; + + private Size sizeField; + + private ImageDensity imageDensityField; + + private bool imageDensityFieldSpecified; + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public long fileSize { + get { return this.fileSizeField; } + set { + this.fileSizeField = value; + this.fileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fileSizeSpecified { + get { return this.fileSizeFieldSpecified; } + set { this.fileSizeFieldSpecified = value; } + } + + public string assetUrl { + get { return this.assetUrlField; } + set { this.assetUrlField = value; } + } + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + public ImageDensity imageDensity { + get { return this.imageDensityField; } + set { + this.imageDensityField = value; + this.imageDensitySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool imageDensitySpecified { + get { return this.imageDensityFieldSpecified; } + set { this.imageDensityFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ImageDensity { + ONE_TO_ONE, + THREE_TO_TWO, + TWO_TO_ONE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ImageOverlayCreative : BaseImageCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + private string vastPreviewUrlField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ImageCreative : BaseImageCreative { + private string altTextField; + + private string thirdPartyImpressionUrlField; + + private CreativeAsset[] secondaryImageAssetsField; + + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + public string thirdPartyImpressionUrl { + get { return this.thirdPartyImpressionUrlField; } + set { this.thirdPartyImpressionUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryImageAssets")] + public CreativeAsset[] secondaryImageAssets { + get { return this.secondaryImageAssetsField; } + set { this.secondaryImageAssetsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class BaseFlashRedirectCreative : HasDestinationUrlCreative { + private string flashUrlField; + + private string fallbackUrlField; + + private string fallbackPreviewUrlField; + + public string flashUrl { + get { return this.flashUrlField; } + set { this.flashUrlField = value; } + } + + public string fallbackUrl { + get { return this.fallbackUrlField; } + set { this.fallbackUrlField = value; } + } + + public string fallbackPreviewUrl { + get { return this.fallbackPreviewUrlField; } + set { this.fallbackPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class FlashRedirectOverlayCreative : BaseFlashRedirectCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private ApiFramework apiFrameworkField; + + private bool apiFrameworkFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + private Size flashAssetSizeField; + + private string vastPreviewUrlField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public ApiFramework apiFramework { + get { return this.apiFrameworkField; } + set { + this.apiFrameworkField = value; + this.apiFrameworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool apiFrameworkSpecified { + get { return this.apiFrameworkFieldSpecified; } + set { this.apiFrameworkFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ApiFramework { + NONE, + CLICKTAG, + VPAID + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class FlashRedirectCreative : BaseFlashRedirectCreative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class BaseFlashCreative : HasDestinationUrlCreative { + private string flashNameField; + + private byte[] flashByteArrayField; + + private string fallbackImageNameField; + + private byte[] fallbackImageByteArrayField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private bool clickTagRequiredField; + + private bool clickTagRequiredFieldSpecified; + + private string fallbackPreviewUrlField; + + private Size flashAssetSizeField; + + private Size fallbackAssetSizeField; + + public string flashName { + get { return this.flashNameField; } + set { this.flashNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] flashByteArray { + get { return this.flashByteArrayField; } + set { this.flashByteArrayField = value; } + } + + public string fallbackImageName { + get { return this.fallbackImageNameField; } + set { this.fallbackImageNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] fallbackImageByteArray { + get { return this.fallbackImageByteArrayField; } + set { this.fallbackImageByteArrayField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public bool clickTagRequired { + get { return this.clickTagRequiredField; } + set { + this.clickTagRequiredField = value; + this.clickTagRequiredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clickTagRequiredSpecified { + get { return this.clickTagRequiredFieldSpecified; } + set { this.clickTagRequiredFieldSpecified = value; } + } + + public string fallbackPreviewUrl { + get { return this.fallbackPreviewUrlField; } + set { this.fallbackPreviewUrlField = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + public Size fallbackAssetSize { + get { return this.fallbackAssetSizeField; } + set { this.fallbackAssetSizeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class FlashOverlayCreative : BaseFlashCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private ApiFramework apiFrameworkField; + + private bool apiFrameworkFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + private string vastPreviewUrlField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public ApiFramework apiFramework { + get { return this.apiFrameworkField; } + set { + this.apiFrameworkField = value; + this.apiFrameworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool apiFrameworkSpecified { + get { return this.apiFrameworkFieldSpecified; } + set { this.apiFrameworkFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class FlashCreative : BaseFlashCreative { + private SwiffyFallbackAsset swiffyAssetField; + + private bool createSwiffyAssetField; + + private bool createSwiffyAssetFieldSpecified; + + public SwiffyFallbackAsset swiffyAsset { + get { return this.swiffyAssetField; } + set { this.swiffyAssetField = value; } + } + + public bool createSwiffyAsset { + get { return this.createSwiffyAssetField; } + set { + this.createSwiffyAssetField = value; + this.createSwiffyAssetSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool createSwiffyAssetSpecified { + get { return this.createSwiffyAssetFieldSpecified; } + set { this.createSwiffyAssetFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class SwiffyFallbackAsset { + private CreativeAsset assetField; + + private Html5Feature[] html5FeaturesField; + + private string[] localizedInfoMessagesField; + + public CreativeAsset asset { + get { return this.assetField; } + set { this.assetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("html5Features")] + public Html5Feature[] html5Features { + get { return this.html5FeaturesField; } + set { this.html5FeaturesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("localizedInfoMessages")] + public string[] localizedInfoMessages { + get { return this.localizedInfoMessagesField; } + set { this.localizedInfoMessagesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum Html5Feature { + BASIC_SVG, + SVG_FILTERS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AspectRatioImageCreative : HasDestinationUrlCreative { + private CreativeAsset[] imageAssetsField; + + private string altTextField; + + private string thirdPartyImpressionUrlField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("imageAssets")] + public CreativeAsset[] imageAssets { + get { return this.imageAssetsField; } + set { this.imageAssetsField = value; } + } + + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + public string thirdPartyImpressionUrl { + get { return this.thirdPartyImpressionUrlField; } + set { this.thirdPartyImpressionUrlField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ClickTrackingCreative : Creative { + private string clickTrackingUrlField; + + public string clickTrackingUrl { + get { return this.clickTrackingUrlField; } + set { this.clickTrackingUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class BaseRichMediaStudioCreative : Creative { + private long studioCreativeIdField; + + private bool studioCreativeIdFieldSpecified; + + private RichMediaStudioCreativeFormat creativeFormatField; + + private bool creativeFormatFieldSpecified; + + private RichMediaStudioCreativeArtworkType artworkTypeField; + + private bool artworkTypeFieldSpecified; + + private long totalFileSizeField; + + private bool totalFileSizeFieldSpecified; + + private string[] adTagKeysField; + + private string[] customKeyValuesField; + + private string surveyUrlField; + + private string allImpressionsUrlField; + + private string richMediaImpressionsUrlField; + + private string backupImageImpressionsUrlField; + + private string overrideCssField; + + private string requiredFlashPluginVersionField; + + private int durationField; + + private bool durationFieldSpecified; + + private RichMediaStudioCreativeBillingAttribute billingAttributeField; + + private bool billingAttributeFieldSpecified; + + private RichMediaStudioChildAssetProperty[] richMediaStudioChildAssetPropertiesField; + + public long studioCreativeId { + get { return this.studioCreativeIdField; } + set { + this.studioCreativeIdField = value; + this.studioCreativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool studioCreativeIdSpecified { + get { return this.studioCreativeIdFieldSpecified; } + set { this.studioCreativeIdFieldSpecified = value; } + } + + public RichMediaStudioCreativeFormat creativeFormat { + get { return this.creativeFormatField; } + set { + this.creativeFormatField = value; + this.creativeFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeFormatSpecified { + get { return this.creativeFormatFieldSpecified; } + set { this.creativeFormatFieldSpecified = value; } + } + + public RichMediaStudioCreativeArtworkType artworkType { + get { return this.artworkTypeField; } + set { + this.artworkTypeField = value; + this.artworkTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool artworkTypeSpecified { + get { return this.artworkTypeFieldSpecified; } + set { this.artworkTypeFieldSpecified = value; } + } + + public long totalFileSize { + get { return this.totalFileSizeField; } + set { + this.totalFileSizeField = value; + this.totalFileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalFileSizeSpecified { + get { return this.totalFileSizeFieldSpecified; } + set { this.totalFileSizeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adTagKeys")] + public string[] adTagKeys { + get { return this.adTagKeysField; } + set { this.adTagKeysField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customKeyValues")] + public string[] customKeyValues { + get { return this.customKeyValuesField; } + set { this.customKeyValuesField = value; } + } + + public string surveyUrl { + get { return this.surveyUrlField; } + set { this.surveyUrlField = value; } + } + + public string allImpressionsUrl { + get { return this.allImpressionsUrlField; } + set { this.allImpressionsUrlField = value; } + } + + public string richMediaImpressionsUrl { + get { return this.richMediaImpressionsUrlField; } + set { this.richMediaImpressionsUrlField = value; } + } + + public string backupImageImpressionsUrl { + get { return this.backupImageImpressionsUrlField; } + set { this.backupImageImpressionsUrlField = value; } + } + + public string overrideCss { + get { return this.overrideCssField; } + set { this.overrideCssField = value; } + } + + public string requiredFlashPluginVersion { + get { return this.requiredFlashPluginVersionField; } + set { this.requiredFlashPluginVersionField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public RichMediaStudioCreativeBillingAttribute billingAttribute { + get { return this.billingAttributeField; } + set { + this.billingAttributeField = value; + this.billingAttributeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingAttributeSpecified { + get { return this.billingAttributeFieldSpecified; } + set { this.billingAttributeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("richMediaStudioChildAssetProperties")] + public RichMediaStudioChildAssetProperty[] richMediaStudioChildAssetProperties { + get { return this.richMediaStudioChildAssetPropertiesField; } + set { this.richMediaStudioChildAssetPropertiesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum RichMediaStudioCreativeFormat { + IN_PAGE, + EXPANDING, + IM_EXPANDING, + FLOATING, + PEEL_DOWN, + IN_PAGE_WITH_FLOATING, + FLASH_IN_FLASH, + FLASH_IN_FLASH_EXPANDING, + IN_APP, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum RichMediaStudioCreativeArtworkType { + FLASH, + HTML5, + MIXED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum RichMediaStudioCreativeBillingAttribute { + IN_PAGE, + FLOATING_EXPANDING, + VIDEO, + FLASH_IN_FLASH + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RichMediaStudioChildAssetProperty { + private string nameField; + + private RichMediaStudioChildAssetPropertyType typeField; + + private bool typeFieldSpecified; + + private long totalFileSizeField; + + private bool totalFileSizeFieldSpecified; + + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + private string urlField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public RichMediaStudioChildAssetPropertyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public long totalFileSize { + get { return this.totalFileSizeField; } + set { + this.totalFileSizeField = value; + this.totalFileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalFileSizeSpecified { + get { return this.totalFileSizeFieldSpecified; } + set { this.totalFileSizeFieldSpecified = value; } + } + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaStudioChildAssetProperty.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum RichMediaStudioChildAssetPropertyType { + FLASH, + VIDEO, + IMAGE, + DATA + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class RichMediaStudioCreative : BaseRichMediaStudioCreative { + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasHtmlSnippetDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class BaseDynamicAllocationCreative : Creative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class HasHtmlSnippetDynamicAllocationCreative : BaseDynamicAllocationCreative { + private string codeSnippetField; + + public string codeSnippet { + get { return this.codeSnippetField; } + set { this.codeSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AdSenseCreative : HasHtmlSnippetDynamicAllocationCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class AdExchangeCreative : HasHtmlSnippetDynamicAllocationCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ContactServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseContact))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ContactService : DfpSoapClient, IContactService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ContactService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/ContactService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Contact createContact(Contact contact) { + object[] results = this.Invoke("createContact", new object[] { contact }); + return ((Contact) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Contact[] createContacts([System.Xml.Serialization.XmlElementAttribute("contacts")] +Contact[] contacts) { + object[] results = this.Invoke("createContacts", new object[] { contacts }); + return ((Contact[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Contact getContact(long contactId) { + object[] results = this.Invoke("getContact", new object[] { contactId }); + return ((Contact) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContactPage getContactsByStatement(Statement statement) { + object[] results = this.Invoke("getContactsByStatement", new object[] { statement }); + return ((ContactPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Contact updateContact(Contact contact) { + object[] results = this.Invoke("updateContact", new object[] { contact }); + return ((Contact) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Contact[] updateContacts([System.Xml.Serialization.XmlElementAttribute("contacts")] +Contact[] contacts) { + object[] results = this.Invoke("updateContacts", new object[] { contacts }); + return ((Contact[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ContactPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Contact[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Contact[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class Contact : BaseContact { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private long companyIdField; + + private bool companyIdFieldSpecified; + + private ContactStatus statusField; + + private bool statusFieldSpecified; + + private string addressField; + + private string cellPhoneField; + + private string commentField; + + private string emailField; + + private string faxPhoneField; + + private string titleField; + + private string workPhoneField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public long companyId { + get { return this.companyIdField; } + set { + this.companyIdField = value; + this.companyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companyIdSpecified { + get { return this.companyIdFieldSpecified; } + set { this.companyIdFieldSpecified = value; } + } + + public ContactStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string address { + get { return this.addressField; } + set { this.addressField = value; } + } + + public string cellPhone { + get { return this.cellPhoneField; } + set { this.cellPhoneField = value; } + } + + public string comment { + get { return this.commentField; } + set { this.commentField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public string faxPhone { + get { return this.faxPhoneField; } + set { this.faxPhoneField = value; } + } + + public string title { + get { return this.titleField; } + set { this.titleField = value; } + } + + public string workPhone { + get { return this.workPhoneField; } + set { this.workPhoneField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Contact.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ContactStatus { + UNINVITED, + INVITE_PENDNG, + INVITE_EXPIRED, + INVITE_CANCELED, + USER_ACTIVE, + USER_DISABLED, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Contact))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class BaseContact { + private string baseContactTypeField; + + [System.Xml.Serialization.XmlElementAttribute("BaseContact.Type")] + public string BaseContactType { + get { return this.baseContactTypeField; } + set { this.baseContactTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class ContactError : ApiError { + private ContactErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ContactErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ContactError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum ContactErrorReason { + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomTargetingServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomTargetingService : DfpSoapClient, ICustomTargetingService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomTargetingService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201308/CustomTargetingService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingKey[] createCustomTargetingKeys([System.Xml.Serialization.XmlElementAttribute("keys")] +CustomTargetingKey[] keys) { + object[] results = this.Invoke("createCustomTargetingKeys", new object[] { keys }); + return ((CustomTargetingKey[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingValue[] createCustomTargetingValues([System.Xml.Serialization.XmlElementAttribute("values")] +CustomTargetingValue[] values) { + object[] results = this.Invoke("createCustomTargetingValues", new object[] { values }); + return ((CustomTargetingValue[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingKeyPage getCustomTargetingKeysByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomTargetingKeysByStatement", new object[] { filterStatement }); + return ((CustomTargetingKeyPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingValuePage getCustomTargetingValuesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomTargetingValuesByStatement", new object[] { filterStatement }); + return ((CustomTargetingValuePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performCustomTargetingKeyAction(CustomTargetingKeyAction customTargetingKeyAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomTargetingKeyAction", new object[] { customTargetingKeyAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performCustomTargetingValueAction(CustomTargetingValueAction customTargetingValueAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomTargetingValueAction", new object[] { customTargetingValueAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingKey[] updateCustomTargetingKeys([System.Xml.Serialization.XmlElementAttribute("keys")] +CustomTargetingKey[] keys) { + object[] results = this.Invoke("updateCustomTargetingKeys", new object[] { keys }); + return ((CustomTargetingKey[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201308", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201308", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingValue[] updateCustomTargetingValues([System.Xml.Serialization.XmlElementAttribute("values")] +CustomTargetingValue[] values) { + object[] results = this.Invoke("updateCustomTargetingValues", new object[] { values }); + return ((CustomTargetingValue[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteCustomTargetingValues))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class CustomTargetingValueAction { + private string customTargetingValueActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomTargetingValueAction.Type")] + public string CustomTargetingValueActionType { + get { return this.customTargetingValueActionTypeField; } + set { this.customTargetingValueActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeleteCustomTargetingValues : CustomTargetingValueAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteCustomTargetingKeys))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public abstract partial class CustomTargetingKeyAction { + private string customTargetingKeyActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomTargetingKeyAction.Type")] + public string CustomTargetingKeyActionType { + get { return this.customTargetingKeyActionTypeField; } + set { this.customTargetingKeyActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class DeleteCustomTargetingKeys : CustomTargetingKeyAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CustomTargetingValuePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomTargetingValue[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomTargetingValue[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CustomTargetingValue { + private long customTargetingKeyIdField; + + private bool customTargetingKeyIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string displayNameField; + + private CustomTargetingValueMatchType matchTypeField; + + private bool matchTypeFieldSpecified; + + public long customTargetingKeyId { + get { return this.customTargetingKeyIdField; } + set { + this.customTargetingKeyIdField = value; + this.customTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customTargetingKeyIdSpecified { + get { return this.customTargetingKeyIdFieldSpecified; } + set { this.customTargetingKeyIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public CustomTargetingValueMatchType matchType { + get { return this.matchTypeField; } + set { + this.matchTypeField = value; + this.matchTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool matchTypeSpecified { + get { return this.matchTypeFieldSpecified; } + set { this.matchTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingValue.MatchType", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CustomTargetingValueMatchType { + EXACT, + BROAD, + PREFIX, + BROAD_PREFIX, + SUFFIX, + CONTAINS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CustomTargetingKeyPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomTargetingKey[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomTargetingKey[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public partial class CustomTargetingKey { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string displayNameField; + + private CustomTargetingKeyType typeField; + + private bool typeFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public CustomTargetingKeyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingKey.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201308")] + public enum CustomTargetingKeyType { + PREDEFINED, + FREEFORM + } + public interface IAudienceSegmentService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + FirstPartyAudienceSegment[] createAudienceSegments(FirstPartyAudienceSegment[] segments); + AudienceSegmentPage getAudienceSegmentsByStatement(Statement filterStatement); + UpdateResult performAudienceSegmentAction(AudienceSegmentAction action, Statement filterStatement); + FirstPartyAudienceSegment[] updateAudienceSegments(FirstPartyAudienceSegment[] segments); + } + public interface ISuggestedAdUnitService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + SuggestedAdUnit getSuggestedAdUnit(string suggestedAdUnitId); + SuggestedAdUnitPage getSuggestedAdUnitsByStatement(Statement filterStatement); + SuggestedAdUnitUpdateResult performSuggestedAdUnitAction(SuggestedAdUnitAction suggestedAdUnitAction, Statement filterStatement); + } + public interface ILabelService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Label createLabel(Label label); + Label[] createLabels(Label[] labels); + Label getLabel(long labelId); + LabelPage getLabelsByStatement(Statement filterStatement); + UpdateResult performLabelAction(LabelAction labelAction, Statement filterStatement); + Label updateLabel(Label label); + Label[] updateLabels(Label[] labels); + } + public interface ICompanyService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Company[] createCompanies(Company[] companies); + Company createCompany(Company company); + CompanyPage getCompaniesByStatement(Statement filterStatement); + Company getCompany(long companyId); + Company[] updateCompanies(Company[] companies); + Company updateCompany(Company company); + } + public interface IAdRuleService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdRule createAdRule(AdRule adRule); + AdRule[] createAdRules(AdRule[] adRules); + AdRule getAdRule(int adRuleId); + AdRulePage getAdRulesByStatement(Statement statement); + UpdateResult performAdRuleAction(AdRuleAction adRuleAction, Statement filterStatement); + AdRule updateAdRule(AdRule adRule); + AdRule[] updateAdRules(AdRule[] adRules); + } + public interface IWorkflowActionService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + WorkflowAction getWorkflowAction(long workflowActionId); + WorkflowActionPage getWorkflowActionsByStatement(Statement filterStatement); + } + public interface INetworkService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Network[] getAllNetworks(); + Network getCurrentNetwork(); + Network makeTestNetwork(); + Network updateNetwork(Network network); + } + public interface IReconciliationReportService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ReconciliationReport getReconciliationReport(long reconciliationReportId); + ReconciliationReportPage getReconciliationReportsByStatement(Statement filterStatement); + ReconciliationReport updateReconciliationReport(ReconciliationReport reconciliationReport); + ReconciliationReport[] updateReconciliationReports(ReconciliationReport[] reconciliationReports); + } + public interface ICreativeWrapperService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CreativeWrapper createCreativeWrapper(CreativeWrapper creativeWrapper); + CreativeWrapper[] createCreativeWrappers(CreativeWrapper[] creativeWrappers); + CreativeWrapper getCreativeWrapper(long creativeWrapperId); + CreativeWrapperPage getCreativeWrappersByStatement(Statement filterStatement); + UpdateResult performCreativeWrapperAction(CreativeWrapperAction creativeWrapperAction, Statement filterStatement); + CreativeWrapper updateCreativeWrapper(CreativeWrapper creativeWrapper); + CreativeWrapper[] updateCreativeWrappers(CreativeWrapper[] creativeWrappers); + } + public interface IContentService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ContentPage getContentByStatement(Statement statement); + ContentPage getContentByStatementAndCustomTargetingValue(Statement filterStatement, long customTargetingValueId); + } + public interface ICustomFieldService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CustomField createCustomField(CustomField customField); + CustomFieldOption createCustomFieldOption(CustomFieldOption customFieldOption); + CustomFieldOption[] createCustomFieldOptions(CustomFieldOption[] customFieldOptions); + CustomField[] createCustomFields(CustomField[] customFields); + CustomField getCustomField(long customFieldId); + CustomFieldOption getCustomFieldOption(long customFieldOptionId); + CustomFieldPage getCustomFieldsByStatement(Statement filterStatement); + UpdateResult performCustomFieldAction(CustomFieldAction customFieldAction, Statement filterStatement); + CustomField updateCustomField(CustomField customField); + CustomFieldOption updateCustomFieldOption(CustomFieldOption customFieldOption); + CustomFieldOption[] updateCustomFieldOptions(CustomFieldOption[] customFieldOptions); + CustomField[] updateCustomFields(CustomField[] customFields); + } + public interface IProposalLineItemService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ProposalLineItem createProposalLineItem(ProposalLineItem proposalLineItem); + ProposalLineItem[] createProposalLineItems(ProposalLineItem[] proposalLineItems); + ProposalLineItem getProposalLineItem(long proposalLineItemId); + ProposalLineItemPage getProposalLineItemsByStatement(Statement filterStatement); + UpdateResult performProposalLineItemAction(ProposalLineItemAction proposalLineItemAction, Statement filterStatement); + ProposalLineItem updateProposalLineItem(ProposalLineItem proposalLineItem); + ProposalLineItem[] updateProposalLineItems(ProposalLineItem[] proposalLineItems); + } + public interface IReportService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + string getReportDownloadURL(long reportJobId, ExportFormat exportFormat); + string getReportDownloadUrlWithOptions(long reportJobId, ReportDownloadOptions reportDownloadOptions); + ReportJob getReportJob(long reportJobId); + ReportJob runReportJob(ReportJob reportJob); + } + public interface IActivityGroupService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ActivityGroup createActivityGroup(ActivityGroup activityGroup); + ActivityGroup[] createActivityGroups(ActivityGroup[] activityGroups); + ActivityGroup getActivityGroup(int activityGroupId); + ActivityGroupPage getActivityGroupsByStatement(Statement filterStatement); + ActivityGroup updateActivityGroup(ActivityGroup activityGroup); + ActivityGroup[] updateActivityGroups(ActivityGroup[] activityGroups); + } + public interface ILineItemService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + LineItem createLineItem(LineItem lineItem); + LineItem[] createLineItems(LineItem[] lineItems); + LineItem getLineItem(long lineItemId); + LineItemPage getLineItemsByStatement(Statement filterStatement); + UpdateResult performLineItemAction(LineItemAction lineItemAction, Statement filterStatement); + LineItem updateLineItem(LineItem lineItem); + LineItem[] updateLineItems(LineItem[] lineItems); + } + public interface ILineItemTemplateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + LineItemTemplatePage getLineItemTemplatesByStatement(Statement filterStatement); + } + public interface IUserTeamAssociationService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + UserTeamAssociation createUserTeamAssociation(UserTeamAssociation userTeamAssociation); + UserTeamAssociation[] createUserTeamAssociations(UserTeamAssociation[] userTeamAssociations); + UserTeamAssociation getUserTeamAssociation(long teamId, long userId); + UserTeamAssociationPage getUserTeamAssociationsByStatement(Statement filterStatement); + UpdateResult performUserTeamAssociationAction(UserTeamAssociationAction userTeamAssociationAction, Statement statement); + UserTeamAssociation updateUserTeamAssociation(UserTeamAssociation userTeamAssociation); + UserTeamAssociation[] updateUserTeamAssociations(UserTeamAssociation[] userTeamAssociations); + } + public interface ILineItemCreativeAssociationService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + LineItemCreativeAssociation createLineItemCreativeAssociation(LineItemCreativeAssociation lineItemCreativeAssociation); + LineItemCreativeAssociation[] createLineItemCreativeAssociations(LineItemCreativeAssociation[] lineItemCreativeAssociations); + LineItemCreativeAssociation getLineItemCreativeAssociation(long lineItemId, long creativeId); + LineItemCreativeAssociationPage getLineItemCreativeAssociationsByStatement(Statement filterStatement); + string getPreviewUrl(long lineItemId, long creativeId, string siteUrl); + UpdateResult performLineItemCreativeAssociationAction(LineItemCreativeAssociationAction lineItemCreativeAssociationAction, Statement filterStatement); + LineItemCreativeAssociation updateLineItemCreativeAssociation(LineItemCreativeAssociation lineItemCreativeAssociation); + LineItemCreativeAssociation[] updateLineItemCreativeAssociations(LineItemCreativeAssociation[] lineItemCreativeAssociations); + } + public interface IProductService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Product getProduct(string productId); + ProductPage getProductsByStatement(Statement statement); + UpdateResult performProductAction(ProductAction productAction, Statement filterStatement); + Product updateProduct(Product product); + Product[] updateProducts(Product[] products); + } + public interface IReconciliationReportRowService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ReconciliationReportRowPage getReconciliationReportRowsByStatement(Statement filterStatement); + ReconciliationReportRow[] updateReconciliationReportRows(ReconciliationReportRow[] reconciliationReportRows); + } + public interface IRateCardCustomizationService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + RateCardCustomization createRateCardCustomization(RateCardCustomization rateCardCustomization); + RateCardCustomization[] createRateCardCustomizations(RateCardCustomization[] rateCardCustomizations); + RateCardCustomization getRateCardCustomization(long rateCardCustomizationId); + RateCardCustomizationPage getRateCardCustomizationsByStatement(Statement filterStatement); + UpdateResult performRateCardCustomizationAction(RateCardCustomizationAction rateCardCustomizationAction, Statement filterStatement); + RateCardCustomization updateRateCardCustomization(RateCardCustomization rateCardCustomization); + RateCardCustomization[] updateRateCardCustomizations(RateCardCustomization[] rateCardCustomizations); + } + public interface ICreativeSetService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CreativeSet createCreativeSet(CreativeSet creativeSet); + CreativeSet getCreativeSet(long creativeSetId); + CreativeSetPage getCreativeSetsByStatement(Statement statement); + CreativeSet updateCreativeSet(CreativeSet creativeSet); + } + public interface IBaseRateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + BaseRate createBaseRate(BaseRate baseRate); + BaseRate[] createBaseRates(BaseRate[] baseRates); + BaseRate getBaseRate(long baseRateId); + BaseRatePage getBaseRatesByStatement(Statement filterStatement); + UpdateResult performBaseRateAction(BaseRateAction baseRateAction, Statement filterStatement); + BaseRate updateBaseRate(BaseRate baseRate); + BaseRate[] updateBaseRates(BaseRate[] baseRates); + } + public interface IInventoryService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdUnit createAdUnit(AdUnit adUnit); + AdUnit[] createAdUnits(AdUnit[] adUnits); + AdUnit getAdUnit(string adUnitId); + AdUnitSize[] getAdUnitSizesByStatement(Statement filterStatement); + AdUnitPage getAdUnitsByStatement(Statement filterStatement); + UpdateResult performAdUnitAction(AdUnitAction adUnitAction, Statement filterStatement); + AdUnit updateAdUnit(AdUnit adUnit); + AdUnit[] updateAdUnits(AdUnit[] adUnits); + } + public interface IProductTemplateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ProductTemplate createProductTemplate(ProductTemplate productTemplate); + ProductTemplate[] createProductTemplates(ProductTemplate[] productTemplates); + ProductTemplate getProductTemplate(long productTemplateId); + ProductTemplatePage getProductTemplatesByStatement(Statement statement); + UpdateResult performProductTemplateAction(ProductTemplateAction action, Statement filterStatement); + ProductTemplate updateProductTemplate(ProductTemplate productTemplate); + ProductTemplate[] updateProductTemplates(ProductTemplate[] productTemplates); + } + public interface IForecastService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Forecast getForecast(LineItem lineItem); + Forecast getForecastById(long lineItemId); + } + public interface IUserService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + User createUser(User user); + User[] createUsers(User[] users); + Role[] getAllRoles(); + User getCurrentUser(); + User getUser(long userId); + UserPage getUsersByStatement(Statement filterStatement); + UpdateResult performUserAction(UserAction userAction, Statement filterStatement); + User updateUser(User user); + User[] updateUsers(User[] users); + } + public interface IPublisherQueryLanguageService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ResultSet select(Statement selectStatement); + } + public interface ITeamService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Team createTeam(Team team); + Team[] createTeams(Team[] teams); + Team getTeam(long teamId); + TeamPage getTeamsByStatement(Statement filterStatement); + Team updateTeam(Team team); + Team[] updateTeams(Team[] teams); + } + public interface IRateCardService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + RateCard createRateCard(RateCard rateCard); + RateCard[] createRateCards(RateCard[] rateCards); + RateCard getRateCard(long rateCardId); + RateCardPage getRateCardsByStatement(Statement filterStatement); + UpdateResult performRateCardAction(RateCardAction rateCardAction, Statement filterStatement); + RateCard updateRateCard(RateCard rateCard); + RateCard[] updateRateCards(RateCard[] rateCards); + } + public interface IPlacementService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Placement createPlacement(Placement placement); + Placement[] createPlacements(Placement[] placements); + Placement getPlacement(long placementId); + PlacementPage getPlacementsByStatement(Statement filterStatement); + UpdateResult performPlacementAction(PlacementAction placementAction, Statement filterStatement); + Placement updatePlacement(Placement placement); + Placement[] updatePlacements(Placement[] placements); + } + public interface IReconciliationOrderReportService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ReconciliationOrderReport getReconciliationOrderReport(long reconciliationOrderReportId); + ReconciliationOrderReportPage getReconciliationOrderReportsByStatement(Statement filterStatement); + UpdateResult performReconciliationOrderReportAction(ReconciliationOrderReportAction reconciliationOrderReportAction, Statement filterStatement); + } + public interface IActivityService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Activity[] createActivities(Activity[] activities); + Activity createActivity(Activity activity); + ActivityPage getActivitiesByStatement(Statement filterStatement); + Activity getActivity(int activityId); + Activity[] updateActivities(Activity[] activities); + Activity updateActivity(Activity activity); + } + public interface IOrderService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Order createOrder(Order order); + Order[] createOrders(Order[] orders); + Order getOrder(long orderId); + OrderPage getOrdersByStatement(Statement filterStatement); + UpdateResult performOrderAction(OrderAction orderAction, Statement filterStatement); + Order updateOrder(Order order); + Order[] updateOrders(Order[] orders); + } + public interface IProposalService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Proposal createProposal(Proposal proposal); + Proposal[] createProposals(Proposal[] proposals); + Proposal getProposal(long proposalId); + ProposalPage getProposalsByStatement(Statement filterStatement); + UpdateResult performProposalAction(ProposalAction proposalAction, Statement filterStatement); + Proposal updateProposal(Proposal proposal); + Proposal[] updateProposals(Proposal[] proposals); + } + public interface ICreativeTemplateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CreativeTemplate getCreativeTemplate(long creativeTemplateId); + CreativeTemplatePage getCreativeTemplatesByStatement(Statement filterStatement); + } + public interface ICreativeService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Creative createCreative(Creative creative); + Creative[] createCreatives(Creative[] creatives); + Creative getCreative(long creativeId); + CreativePage getCreativesByStatement(Statement filterStatement); + Creative updateCreative(Creative creative); + Creative[] updateCreatives(Creative[] creatives); + } + public interface IContactService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Contact createContact(Contact contact); + Contact[] createContacts(Contact[] contacts); + Contact getContact(long contactId); + ContactPage getContactsByStatement(Statement statement); + Contact updateContact(Contact contact); + Contact[] updateContacts(Contact[] contacts); + } + public interface ICustomTargetingService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CustomTargetingKey[] createCustomTargetingKeys(CustomTargetingKey[] keys); + CustomTargetingValue[] createCustomTargetingValues(CustomTargetingValue[] values); + CustomTargetingKeyPage getCustomTargetingKeysByStatement(Statement filterStatement); + CustomTargetingValuePage getCustomTargetingValuesByStatement(Statement filterStatement); + UpdateResult performCustomTargetingKeyAction(CustomTargetingKeyAction customTargetingKeyAction, Statement filterStatement); + UpdateResult performCustomTargetingValueAction(CustomTargetingValueAction customTargetingValueAction, Statement filterStatement); + CustomTargetingKey[] updateCustomTargetingKeys(CustomTargetingKey[] keys); + CustomTargetingValue[] updateCustomTargetingValues(CustomTargetingValue[] values); + } +} diff --git a/src/Dfp/v201308/DfpServiceV201308.cs b/src/Dfp/v201308/DfpServiceV201308.cs new file mode 100644 index 00000000000..0c8efc711b7 --- /dev/null +++ b/src/Dfp/v201308/DfpServiceV201308.cs @@ -0,0 +1,329 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Reflection; + +namespace Google.Api.Ads.Dfp.Lib { + /// + /// Lists all the services available through this library. + /// + public partial class DfpService : AdsService { + /// + /// All the services available in v201308. + /// + public class v201308 { + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ActivityGroupService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ActivityService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdRuleService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature BaseRateService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ContactService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AudienceSegmentService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CompanyService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ContentService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeSetService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeTemplateService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeWrapperService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomFieldService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomTargetingService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ForecastService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature InventoryService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LabelService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LineItemTemplateService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LineItemService; + + /// + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LineItemCreativeAssociationService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature NetworkService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature OrderService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature PlacementService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProductService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProductTemplateService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProposalService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProposalLineItemService; + + + /// See + /// this page for details. + /// + public static readonly ServiceSignature PublisherQueryLanguageService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature RateCardService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature RateCardCustomizationService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReconciliationOrderReportService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReconciliationReportService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReconciliationReportRowService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReportService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SuggestedAdUnitService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature TeamService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature UserService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature UserTeamAssociationService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature WorkflowActionService; + + /// + /// Factory type for v201308 services. + /// + public static readonly Type factoryType = typeof(DfpServiceFactory); + + /// + /// Static constructor to initialize the service constants. + /// + static v201308() { + ActivityGroupService = DfpService.MakeServiceSignature("v201308", "ActivityGroupService"); + ActivityService = DfpService.MakeServiceSignature("v201308", "ActivityService"); + AdRuleService = DfpService.MakeServiceSignature("v201308", "AdRuleService"); + BaseRateService = DfpService.MakeServiceSignature("v201308", "BaseRateService"); + ContactService = DfpService.MakeServiceSignature("v201308", "ContactService"); + AudienceSegmentService = DfpService.MakeServiceSignature("v201308", + "AudienceSegmentService"); + CompanyService = DfpService.MakeServiceSignature("v201308", "CompanyService"); + ContentService = DfpService.MakeServiceSignature("v201308", "ContentService"); + CreativeService = DfpService.MakeServiceSignature("v201308", "CreativeService"); + CreativeSetService = DfpService.MakeServiceSignature("v201308", "CreativeSetService"); + CreativeTemplateService = DfpService.MakeServiceSignature("v201308", + "CreativeTemplateService"); + CreativeWrapperService = DfpService.MakeServiceSignature("v201308", + "CreativeWrapperService"); + CustomTargetingService = DfpService.MakeServiceSignature("v201308", + "CustomTargetingService"); + CustomFieldService = DfpService.MakeServiceSignature("v201308", + "CustomFieldService"); + ForecastService = DfpService.MakeServiceSignature("v201308", "ForecastService"); + InventoryService = DfpService.MakeServiceSignature("v201308", "InventoryService"); + LabelService = DfpService.MakeServiceSignature("v201308", "LabelService"); + LineItemTemplateService = DfpService.MakeServiceSignature("v201308", + "LineItemTemplateService"); + LineItemService = DfpService.MakeServiceSignature("v201308", "LineItemService"); + LineItemCreativeAssociationService = + DfpService.MakeServiceSignature("v201308", "LineItemCreativeAssociationService"); + NetworkService = DfpService.MakeServiceSignature("v201308", "NetworkService"); + OrderService = DfpService.MakeServiceSignature("v201308", "OrderService"); + PlacementService = DfpService.MakeServiceSignature("v201308", "PlacementService"); + ProductService = DfpService.MakeServiceSignature("v201308", "ProductService"); + ProductTemplateService = DfpService.MakeServiceSignature("v201308", + "ProductTemplateService"); + ProposalService = DfpService.MakeServiceSignature("v201308", "ProposalService"); + ProposalLineItemService = DfpService.MakeServiceSignature("v201308", + "ProposalLineItemService"); + PublisherQueryLanguageService = DfpService.MakeServiceSignature("v201308", + "PublisherQueryLanguageService"); + RateCardService = DfpService.MakeServiceSignature("v201308", "RateCardService"); + RateCardCustomizationService = DfpService.MakeServiceSignature("v201308", + "RateCardCustomizationService"); + ReconciliationOrderReportService = DfpService.MakeServiceSignature("v201308", + "ReconciliationOrderReportService"); + ReconciliationReportService = DfpService.MakeServiceSignature("v201308", + "ReconciliationReportService"); + ReconciliationReportRowService = DfpService.MakeServiceSignature("v201308", + "ReconciliationReportRowService"); + ReportService = DfpService.MakeServiceSignature("v201308", "ReportService"); + SuggestedAdUnitService = DfpService.MakeServiceSignature("v201308", + "SuggestedAdUnitService"); + TeamService = DfpService.MakeServiceSignature("v201308", "TeamService"); + UserService = DfpService.MakeServiceSignature("v201308", "UserService"); + UserTeamAssociationService = DfpService.MakeServiceSignature("v201308", + "UserTeamAssociationService"); + WorkflowActionService = DfpService.MakeServiceSignature("v201308", + "WorkflowActionService"); + } + } + } +} diff --git a/src/Dfp/v201311/DfpApi.cs b/src/Dfp/v201311/DfpApi.cs new file mode 100644 index 00000000000..3605ee0d60d --- /dev/null +++ b/src/Dfp/v201311/DfpApi.cs @@ -0,0 +1,26871 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +namespace Google.Api.Ads.Dfp.v201311 { + using Google.Api.Ads.Dfp.Lib; + using Google.Api.Ads.Dfp.Headers; + using System; + using System.Web.Services; + using System.Diagnostics; + using System.Web.Services.Protocols; + using System.Xml.Serialization; + using System.ComponentModel; + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AudienceSegmentServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AudienceSegmentService : DfpSoapClient, IAudienceSegmentService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AudienceSegmentService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/AudienceSegmentService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FirstPartyAudienceSegment[] createAudienceSegments([System.Xml.Serialization.XmlElementAttribute("segments")] +FirstPartyAudienceSegment[] segments) { + object[] results = this.Invoke("createAudienceSegments", new object[] { segments }); + return ((FirstPartyAudienceSegment[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AudienceSegmentPage getAudienceSegmentsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAudienceSegmentsByStatement", new object[] { filterStatement }); + return ((AudienceSegmentPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performAudienceSegmentAction(AudienceSegmentAction action, Statement filterStatement) { + object[] results = this.Invoke("performAudienceSegmentAction", new object[] { action, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FirstPartyAudienceSegment[] updateAudienceSegments([System.Xml.Serialization.XmlElementAttribute("segments")] +FirstPartyAudienceSegment[] segments) { + object[] results = this.Invoke("updateAudienceSegments", new object[] { segments }); + return ((FirstPartyAudienceSegment[]) (results[0])); + } + } + + + + + + + + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class UpdateResult { + private int numChangesField; + + private bool numChangesFieldSpecified; + + public int numChanges { + get { return this.numChangesField; } + set { + this.numChangesField = value; + this.numChangesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numChangesSpecified { + get { return this.numChangesFieldSpecified; } + set { this.numChangesFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RejectAudienceSegments))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PopulateAudienceSegments))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateAudienceSegments))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveAudienceSegments))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateAudienceSegments))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class AudienceSegmentAction { + private string audienceSegmentActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AudienceSegmentAction.Type")] + public string AudienceSegmentActionType { + get { return this.audienceSegmentActionTypeField; } + set { this.audienceSegmentActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RejectAudienceSegments : AudienceSegmentAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class PopulateAudienceSegments : AudienceSegmentAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeactivateAudienceSegments : AudienceSegmentAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ApproveAudienceSegments : AudienceSegmentAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ActivateAudienceSegments : AudienceSegmentAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AudienceSegmentPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AudienceSegment[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AudienceSegment[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedAudienceSegment))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ThirdPartyAudienceSegment))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FirstPartyAudienceSegment))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RuleBasedFirstPartyAudienceSegmentSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RuleBasedFirstPartyAudienceSegment))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NonRuleBasedFirstPartyAudienceSegment))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AudienceSegment { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private AudienceSegmentStatus statusField; + + private bool statusFieldSpecified; + + private long sizeField; + + private bool sizeFieldSpecified; + + private AudienceSegmentDataProvider dataProviderField; + + private AudienceSegmentAudienceSegmentType typeField; + + private bool typeFieldSpecified; + + private string audienceSegmentTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public AudienceSegmentStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public long size { + get { return this.sizeField; } + set { + this.sizeField = value; + this.sizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sizeSpecified { + get { return this.sizeFieldSpecified; } + set { this.sizeFieldSpecified = value; } + } + + public AudienceSegmentDataProvider dataProvider { + get { return this.dataProviderField; } + set { this.dataProviderField = value; } + } + + public AudienceSegmentAudienceSegmentType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("AudienceSegment.Type")] + public string AudienceSegmentType { + get { return this.audienceSegmentTypeField; } + set { this.audienceSegmentTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegment.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AudienceSegmentStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AudienceSegmentDataProvider { + private string nameField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegment.AudienceSegmentType", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AudienceSegmentAudienceSegmentType { + FIRST_PARTY, + SHARED, + THIRD_PARTY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class SharedAudienceSegment : AudienceSegment { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ThirdPartyAudienceSegment : AudienceSegment { + private ThirdPartyAudienceSegmentAudienceSegmentApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + private Money costField; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + public ThirdPartyAudienceSegmentAudienceSegmentApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + + public Money cost { + get { return this.costField; } + set { this.costField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ThirdPartyAudienceSegment.AudienceSegmentApprovalStatus", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ThirdPartyAudienceSegmentAudienceSegmentApprovalStatus { + UNAPPROVED, + APPROVED, + REJECTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Money { + private string currencyCodeField; + + private long microAmountField; + + private bool microAmountFieldSpecified; + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public long microAmount { + get { return this.microAmountField; } + set { + this.microAmountField = value; + this.microAmountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool microAmountSpecified { + get { return this.microAmountFieldSpecified; } + set { this.microAmountFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DateTime { + private Date dateField; + + private int hourField; + + private bool hourFieldSpecified; + + private int minuteField; + + private bool minuteFieldSpecified; + + private int secondField; + + private bool secondFieldSpecified; + + private string timeZoneIDField; + + public Date date { + get { return this.dateField; } + set { this.dateField = value; } + } + + public int hour { + get { return this.hourField; } + set { + this.hourField = value; + this.hourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hourSpecified { + get { return this.hourFieldSpecified; } + set { this.hourFieldSpecified = value; } + } + + public int minute { + get { return this.minuteField; } + set { + this.minuteField = value; + this.minuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minuteSpecified { + get { return this.minuteFieldSpecified; } + set { this.minuteFieldSpecified = value; } + } + + public int second { + get { return this.secondField; } + set { + this.secondField = value; + this.secondSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool secondSpecified { + get { return this.secondFieldSpecified; } + set { this.secondFieldSpecified = value; } + } + + public string timeZoneID { + get { return this.timeZoneIDField; } + set { this.timeZoneIDField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Date { + private int yearField; + + private bool yearFieldSpecified; + + private int monthField; + + private bool monthFieldSpecified; + + private int dayField; + + private bool dayFieldSpecified; + + public int year { + get { return this.yearField; } + set { + this.yearField = value; + this.yearSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool yearSpecified { + get { return this.yearFieldSpecified; } + set { this.yearFieldSpecified = value; } + } + + public int month { + get { return this.monthField; } + set { + this.monthField = value; + this.monthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool monthSpecified { + get { return this.monthFieldSpecified; } + set { this.monthFieldSpecified = value; } + } + + public int day { + get { return this.dayField; } + set { + this.dayField = value; + this.daySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool daySpecified { + get { return this.dayFieldSpecified; } + set { this.dayFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RuleBasedFirstPartyAudienceSegmentSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RuleBasedFirstPartyAudienceSegment))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NonRuleBasedFirstPartyAudienceSegment))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class FirstPartyAudienceSegment : AudienceSegment { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RuleBasedFirstPartyAudienceSegment))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RuleBasedFirstPartyAudienceSegmentSummary : FirstPartyAudienceSegment { + private int pageViewsField; + + private bool pageViewsFieldSpecified; + + private int recencyDaysField; + + private bool recencyDaysFieldSpecified; + + private int membershipExpirationDaysField; + + private bool membershipExpirationDaysFieldSpecified; + + public int pageViews { + get { return this.pageViewsField; } + set { + this.pageViewsField = value; + this.pageViewsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool pageViewsSpecified { + get { return this.pageViewsFieldSpecified; } + set { this.pageViewsFieldSpecified = value; } + } + + public int recencyDays { + get { return this.recencyDaysField; } + set { + this.recencyDaysField = value; + this.recencyDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool recencyDaysSpecified { + get { return this.recencyDaysFieldSpecified; } + set { this.recencyDaysFieldSpecified = value; } + } + + public int membershipExpirationDays { + get { return this.membershipExpirationDaysField; } + set { + this.membershipExpirationDaysField = value; + this.membershipExpirationDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool membershipExpirationDaysSpecified { + get { return this.membershipExpirationDaysFieldSpecified; } + set { this.membershipExpirationDaysFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RuleBasedFirstPartyAudienceSegment : RuleBasedFirstPartyAudienceSegmentSummary { + private FirstPartyAudienceSegmentRule ruleField; + + public FirstPartyAudienceSegmentRule rule { + get { return this.ruleField; } + set { this.ruleField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class FirstPartyAudienceSegmentRule { + private InventoryTargeting inventoryRuleField; + + private CustomCriteriaSet customCriteriaRuleField; + + public InventoryTargeting inventoryRule { + get { return this.inventoryRuleField; } + set { this.inventoryRuleField = value; } + } + + public CustomCriteriaSet customCriteriaRule { + get { return this.customCriteriaRuleField; } + set { this.customCriteriaRuleField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class InventoryTargeting { + private AdUnitTargeting[] targetedAdUnitsField; + + private AdUnitTargeting[] excludedAdUnitsField; + + private long[] targetedPlacementIdsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedAdUnits")] + public AdUnitTargeting[] targetedAdUnits { + get { return this.targetedAdUnitsField; } + set { this.targetedAdUnitsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedAdUnits")] + public AdUnitTargeting[] excludedAdUnits { + get { return this.excludedAdUnitsField; } + set { this.excludedAdUnitsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedPlacementIds")] + public long[] targetedPlacementIds { + get { return this.targetedPlacementIdsField; } + set { this.targetedPlacementIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdUnitTargeting { + private string adUnitIdField; + + private bool includeDescendantsField; + + private bool includeDescendantsFieldSpecified; + + public string adUnitId { + get { return this.adUnitIdField; } + set { this.adUnitIdField = value; } + } + + public bool includeDescendants { + get { return this.includeDescendantsField; } + set { + this.includeDescendantsField = value; + this.includeDescendantsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeDescendantsSpecified { + get { return this.includeDescendantsFieldSpecified; } + set { this.includeDescendantsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CustomCriteriaSet : CustomCriteriaNode { + private CustomCriteriaSetLogicalOperator logicalOperatorField; + + private bool logicalOperatorFieldSpecified; + + private CustomCriteriaNode[] childrenField; + + public CustomCriteriaSetLogicalOperator logicalOperator { + get { return this.logicalOperatorField; } + set { + this.logicalOperatorField = value; + this.logicalOperatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool logicalOperatorSpecified { + get { return this.logicalOperatorFieldSpecified; } + set { this.logicalOperatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("children")] + public CustomCriteriaNode[] children { + get { return this.childrenField; } + set { this.childrenField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCriteriaSet.LogicalOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CustomCriteriaSetLogicalOperator { + AND, + OR + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteriaLeaf))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceSegmentCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteriaSet))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class CustomCriteriaNode { + private string customCriteriaNodeTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomCriteriaNode.Type")] + public string CustomCriteriaNodeType { + get { return this.customCriteriaNodeTypeField; } + set { this.customCriteriaNodeTypeField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceSegmentCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteria))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class CustomCriteriaLeaf : CustomCriteriaNode { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AudienceSegmentCriteria : CustomCriteriaLeaf { + private AudienceSegmentCriteriaComparisonOperator operatorField; + + private bool operatorFieldSpecified; + + private long[] audienceSegmentIdsField; + + public AudienceSegmentCriteriaComparisonOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("audienceSegmentIds")] + public long[] audienceSegmentIds { + get { return this.audienceSegmentIdsField; } + set { this.audienceSegmentIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegmentCriteria.ComparisonOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AudienceSegmentCriteriaComparisonOperator { + IS, + IS_NOT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CustomCriteria : CustomCriteriaLeaf { + private long keyIdField; + + private bool keyIdFieldSpecified; + + private long[] valueIdsField; + + private CustomCriteriaComparisonOperator operatorField; + + private bool operatorFieldSpecified; + + public long keyId { + get { return this.keyIdField; } + set { + this.keyIdField = value; + this.keyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keyIdSpecified { + get { return this.keyIdFieldSpecified; } + set { this.keyIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("valueIds")] + public long[] valueIds { + get { return this.valueIdsField; } + set { this.valueIdsField = value; } + } + + public CustomCriteriaComparisonOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCriteria.ComparisonOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CustomCriteriaComparisonOperator { + IS, + IS_NOT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class NonRuleBasedFirstPartyAudienceSegment : FirstPartyAudienceSegment { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TextValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SetValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NumberValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateTimeValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BooleanValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class Value { + private string valueTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Value.Type")] + public string ValueType { + get { return this.valueTypeField; } + set { this.valueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class TextValue : Value { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class SetValue : Value { + private Value[] valuesField; + + [System.Xml.Serialization.XmlElementAttribute("values")] + public Value[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class NumberValue : Value { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DateValue : Value { + private Date valueField; + + public Date value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DateTimeValue : Value { + private DateTime valueField; + + public DateTime value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class BooleanValue : Value { + private bool valueField; + + private bool valueFieldSpecified; + + public bool value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class String_ValueMapEntry { + private string keyField; + + private Value valueField; + + public string key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public Value value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Statement { + private string queryField; + + private String_ValueMapEntry[] valuesField; + + public string query { + get { return this.queryField; } + set { this.queryField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("values")] + public String_ValueMapEntry[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StatementError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServerError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceSegmentError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(QuotaError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PublisherQueryLanguageSyntaxError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PublisherQueryLanguageContextError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PermissionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NotNullError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InternalApiError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeatureError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CommonError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AuthenticationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApiVersionError))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReconciliationImportError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReconciliationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RangeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NullError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserDomainTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UniqueError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TypeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TechnologyTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TeamError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringLengthError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReservationDetailsError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredSizeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredNumberError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredCollectionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RegExError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ParseError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OrderError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemOperationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemFlightDateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemCreativeAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LabelEntityAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidUrlError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GeoTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GenericTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FrequencyCapError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ForecastError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EntityLimitReachedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DayPartTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateTimeRangeTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldValueError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentMetadataTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CompanyCreditStatusError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClickTrackingLineItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceExtensionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitCodeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitAfcSizeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidEmailError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CompanyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PoddingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRuleSlotError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRulePriorityError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRuleFrequencyCapError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRuleDateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RateCardCustomizationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeTemplateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentMetadataKeyHierarchyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductTemplateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductTemplateActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseRateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivityError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LabelError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeWrapperError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TemplateInstantiatedCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SwiffyConversionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemCreativeAssociationOperationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidPhoneNumberError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FileError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeSetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeAssetMacroError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseAccountError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitTypeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitSizesError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitPartnerAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidColorError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitHierarchyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OrderActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExchangeRateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseRateActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WorkflowActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProposalLineItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProposalError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProposalActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PrecisionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BillingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReportError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProposalLineItemActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NetworkError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RateCardActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentPartnerError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContactError))] + public abstract partial class ApiError { + private string fieldPathField; + + private string triggerField; + + private string errorStringField; + + private string apiErrorTypeField; + + public string fieldPath { + get { return this.fieldPathField; } + set { this.fieldPathField = value; } + } + + public string trigger { + get { return this.triggerField; } + set { this.triggerField = value; } + } + + public string errorString { + get { return this.errorStringField; } + set { this.errorStringField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApiError.Type")] + public string ApiErrorType { + get { return this.apiErrorTypeField; } + set { this.apiErrorTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class StatementError : ApiError { + private StatementErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StatementErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StatementError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum StatementErrorReason { + VARIABLE_NOT_BOUND_TO_VALUE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ServerError : ApiError { + private ServerErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ServerErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ServerError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ServerErrorReason { + SERVER_ERROR, + SERVER_BUSY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AudienceSegmentError : ApiError { + private AudienceSegmentErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AudienceSegmentErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegmentError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AudienceSegmentErrorReason { + FIRST_PARTY_AUDIENCE_SEGMENT_NOT_SUPPORTED, + ONLY_RULE_BASED_FIRST_PARTY_AUDIENCE_SEGMENTS_CAN_BE_CREATED, + AUDIENCE_SEGMENT_ID_NOT_FOUND, + INVALID_AUDIENCE_SEGMENT_RULE, + AUDIENCE_SEGMENT_RULE_TOO_LONG, + INVALID_AUDIENCE_SEGMENT_NAME, + DUPLICATE_AUDIENCE_SEGMENT_NAME, + INVALID_AUDIENCE_SEGMENT_DESCRIPTION, + INVALID_AUDIENCE_SEGMENT_PAGEVIEWS, + INVALID_AUDIENCE_SEGMENT_RECENCY, + INVALID_AUDIENCE_SEGMENT_MEMBERSHIP_EXPIRATION, + INVALID_AUDIENCE_SEGMENT_CUSTOM_KEY_NAME, + INVALID_AUDIENCE_SEGMENT_CUSTOM_VALUE_NAME, + INVALID_AUDIENCE_SEGMENT_CUSTOM_VALUE_MATCH_TYPE, + INVALID_NESTED_FIRST_PARTY_AUDIENCE_SEGMENT, + INVALID_NESTED_THIRD_PARTY_AUDIENCE_SEGMENT, + INACTIVE_NESTED_AUDIENCE_SEGMENT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RequiredError : ApiError { + private RequiredErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum RequiredErrorReason { + REQUIRED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class QuotaError : ApiError { + private QuotaErrorReason reasonField; + + private bool reasonFieldSpecified; + + public QuotaErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "QuotaError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum QuotaErrorReason { + EXCEEDED_QUOTA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class PublisherQueryLanguageSyntaxError : ApiError { + private PublisherQueryLanguageSyntaxErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PublisherQueryLanguageSyntaxErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PublisherQueryLanguageSyntaxError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum PublisherQueryLanguageSyntaxErrorReason { + UNPARSABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class PublisherQueryLanguageContextError : ApiError { + private PublisherQueryLanguageContextErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PublisherQueryLanguageContextErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PublisherQueryLanguageContextError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum PublisherQueryLanguageContextErrorReason { + UNEXECUTABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class PermissionError : ApiError { + private PermissionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PermissionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PermissionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum PermissionErrorReason { + PERMISSION_DENIED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class NotNullError : ApiError { + private NotNullErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NotNullErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NotNullError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum NotNullErrorReason { + ARG1_NULL, + ARG2_NULL, + ARG3_NULL, + NULL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class InternalApiError : ApiError { + private InternalApiErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InternalApiErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InternalApiError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum InternalApiErrorReason { + UNEXPECTED_INTERNAL_API_ERROR, + UNKNOWN, + DOWNTIME + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class FeatureError : ApiError { + private FeatureErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FeatureErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeatureError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum FeatureErrorReason { + MISSING_FEATURE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CommonError : ApiError { + private CommonErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CommonErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CommonError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CommonErrorReason { + NOT_FOUND, + ALREADY_EXISTS, + DUPLICATE_OBJECT, + CANNOT_UPDATE, + CONCURRENT_MODIFICATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AuthenticationError : ApiError { + private AuthenticationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AuthenticationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AuthenticationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AuthenticationErrorReason { + AMBIGUOUS_SOAP_REQUEST_HEADER, + INVALID_EMAIL, + AUTHENTICATION_FAILED, + INVALID_OAUTH_SIGNATURE, + INVALID_SERVICE, + MISSING_SOAP_REQUEST_HEADER, + MISSING_AUTHENTICATION_HTTP_HEADER, + MISSING_AUTHENTICATION, + NOT_WHITELISTED_FOR_API_ACCESS, + NO_NETWORKS_TO_ACCESS, + NETWORK_NOT_FOUND, + NETWORK_CODE_REQUIRED, + CONNECTION_ERROR, + GOOGLE_ACCOUNT_ALREADY_ASSOCIATED_WITH_NETWORK, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ApiVersionError : ApiError { + private ApiVersionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ApiVersionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ApiVersionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ApiVersionErrorReason { + UPDATE_TO_NEWER_VERSION, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApiException))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ApplicationException { + private string messageField; + + private string applicationExceptionTypeField; + + public string message { + get { return this.messageField; } + set { this.messageField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApplicationException.Type")] + public string ApplicationExceptionType { + get { return this.applicationExceptionTypeField; } + set { this.applicationExceptionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ApiException : ApplicationException { + private ApiError[] errorsField; + + [System.Xml.Serialization.XmlElementAttribute("errors")] + public ApiError[] errors { + get { return this.errorsField; } + set { this.errorsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OAuth))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClientLogin))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class Authentication { + private string authenticationTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Authentication.Type")] + public string AuthenticationType { + get { return this.authenticationTypeField; } + set { this.authenticationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class OAuth : Authentication { + private string parametersField; + + public string parameters { + get { return this.parametersField; } + set { this.parametersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ClientLogin : Authentication { + private string tokenField; + + public string token { + get { return this.tokenField; } + set { this.tokenField = value; } + } + } + + + + + + + + + + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReconciliationReportRowServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReconciliationReportRowService : DfpSoapClient, IReconciliationReportRowService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReconciliationReportRowService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/ReconciliationReportRowService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReportRowPage getReconciliationReportRowsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getReconciliationReportRowsByStatement", new object[] { filterStatement }); + return ((ReconciliationReportRowPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReportRow[] updateReconciliationReportRows([System.Xml.Serialization.XmlElementAttribute("reconciliationReportRows")] +ReconciliationReportRow[] reconciliationReportRows) { + object[] results = this.Invoke("updateReconciliationReportRows", new object[] { reconciliationReportRows }); + return ((ReconciliationReportRow[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ReconciliationReportRow { + private long reconciliationReportIdField; + + private bool reconciliationReportIdFieldSpecified; + + private long lineItemIdField; + + private bool lineItemIdFieldSpecified; + + private long creativeIdField; + + private bool creativeIdFieldSpecified; + + private long orderIdField; + + private bool orderIdFieldSpecified; + + private long advertiserIdField; + + private bool advertiserIdFieldSpecified; + + private BillFrom billFromField; + + private bool billFromFieldSpecified; + + private CostType lineItemCostTypeField; + + private bool lineItemCostTypeFieldSpecified; + + private Money lineItemCostPerUnitField; + + private long lineItemContractedUnitsBoughtField; + + private bool lineItemContractedUnitsBoughtFieldSpecified; + + private long dfpClicksField; + + private bool dfpClicksFieldSpecified; + + private long dfpImpressionsField; + + private bool dfpImpressionsFieldSpecified; + + private int dfpLineItemDaysField; + + private bool dfpLineItemDaysFieldSpecified; + + private long thirdPartyClicksField; + + private bool thirdPartyClicksFieldSpecified; + + private long thirdPartyImpressionsField; + + private bool thirdPartyImpressionsFieldSpecified; + + private int thirdPartyLineItemDaysField; + + private bool thirdPartyLineItemDaysFieldSpecified; + + private long manualClicksField; + + private bool manualClicksFieldSpecified; + + private long manualImpressionsField; + + private bool manualImpressionsFieldSpecified; + + private int manualLineItemDaysField; + + private bool manualLineItemDaysFieldSpecified; + + private long reconciledClicksField; + + private bool reconciledClicksFieldSpecified; + + private long reconciledImpressionsField; + + private bool reconciledImpressionsFieldSpecified; + + private int reconciledLineItemDaysField; + + private bool reconciledLineItemDaysFieldSpecified; + + private Money contractedRevenueField; + + private Money dfpRevenueField; + + private Money thirdPartyRevenueField; + + private Money manualRevenueField; + + private Money reconciledRevenueField; + + private string commentsField; + + public long reconciliationReportId { + get { return this.reconciliationReportIdField; } + set { + this.reconciliationReportIdField = value; + this.reconciliationReportIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reconciliationReportIdSpecified { + get { return this.reconciliationReportIdFieldSpecified; } + set { this.reconciliationReportIdFieldSpecified = value; } + } + + public long lineItemId { + get { return this.lineItemIdField; } + set { + this.lineItemIdField = value; + this.lineItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemIdSpecified { + get { return this.lineItemIdFieldSpecified; } + set { this.lineItemIdFieldSpecified = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { + this.creativeIdField = value; + this.creativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeIdSpecified { + get { return this.creativeIdFieldSpecified; } + set { this.creativeIdFieldSpecified = value; } + } + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public long advertiserId { + get { return this.advertiserIdField; } + set { + this.advertiserIdField = value; + this.advertiserIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserIdSpecified { + get { return this.advertiserIdFieldSpecified; } + set { this.advertiserIdFieldSpecified = value; } + } + + public BillFrom billFrom { + get { return this.billFromField; } + set { + this.billFromField = value; + this.billFromSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billFromSpecified { + get { return this.billFromFieldSpecified; } + set { this.billFromFieldSpecified = value; } + } + + public CostType lineItemCostType { + get { return this.lineItemCostTypeField; } + set { + this.lineItemCostTypeField = value; + this.lineItemCostTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemCostTypeSpecified { + get { return this.lineItemCostTypeFieldSpecified; } + set { this.lineItemCostTypeFieldSpecified = value; } + } + + public Money lineItemCostPerUnit { + get { return this.lineItemCostPerUnitField; } + set { this.lineItemCostPerUnitField = value; } + } + + public long lineItemContractedUnitsBought { + get { return this.lineItemContractedUnitsBoughtField; } + set { + this.lineItemContractedUnitsBoughtField = value; + this.lineItemContractedUnitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemContractedUnitsBoughtSpecified { + get { return this.lineItemContractedUnitsBoughtFieldSpecified; } + set { this.lineItemContractedUnitsBoughtFieldSpecified = value; } + } + + public long dfpClicks { + get { return this.dfpClicksField; } + set { + this.dfpClicksField = value; + this.dfpClicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dfpClicksSpecified { + get { return this.dfpClicksFieldSpecified; } + set { this.dfpClicksFieldSpecified = value; } + } + + public long dfpImpressions { + get { return this.dfpImpressionsField; } + set { + this.dfpImpressionsField = value; + this.dfpImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dfpImpressionsSpecified { + get { return this.dfpImpressionsFieldSpecified; } + set { this.dfpImpressionsFieldSpecified = value; } + } + + public int dfpLineItemDays { + get { return this.dfpLineItemDaysField; } + set { + this.dfpLineItemDaysField = value; + this.dfpLineItemDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dfpLineItemDaysSpecified { + get { return this.dfpLineItemDaysFieldSpecified; } + set { this.dfpLineItemDaysFieldSpecified = value; } + } + + public long thirdPartyClicks { + get { return this.thirdPartyClicksField; } + set { + this.thirdPartyClicksField = value; + this.thirdPartyClicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyClicksSpecified { + get { return this.thirdPartyClicksFieldSpecified; } + set { this.thirdPartyClicksFieldSpecified = value; } + } + + public long thirdPartyImpressions { + get { return this.thirdPartyImpressionsField; } + set { + this.thirdPartyImpressionsField = value; + this.thirdPartyImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyImpressionsSpecified { + get { return this.thirdPartyImpressionsFieldSpecified; } + set { this.thirdPartyImpressionsFieldSpecified = value; } + } + + public int thirdPartyLineItemDays { + get { return this.thirdPartyLineItemDaysField; } + set { + this.thirdPartyLineItemDaysField = value; + this.thirdPartyLineItemDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyLineItemDaysSpecified { + get { return this.thirdPartyLineItemDaysFieldSpecified; } + set { this.thirdPartyLineItemDaysFieldSpecified = value; } + } + + public long manualClicks { + get { return this.manualClicksField; } + set { + this.manualClicksField = value; + this.manualClicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manualClicksSpecified { + get { return this.manualClicksFieldSpecified; } + set { this.manualClicksFieldSpecified = value; } + } + + public long manualImpressions { + get { return this.manualImpressionsField; } + set { + this.manualImpressionsField = value; + this.manualImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manualImpressionsSpecified { + get { return this.manualImpressionsFieldSpecified; } + set { this.manualImpressionsFieldSpecified = value; } + } + + public int manualLineItemDays { + get { return this.manualLineItemDaysField; } + set { + this.manualLineItemDaysField = value; + this.manualLineItemDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manualLineItemDaysSpecified { + get { return this.manualLineItemDaysFieldSpecified; } + set { this.manualLineItemDaysFieldSpecified = value; } + } + + public long reconciledClicks { + get { return this.reconciledClicksField; } + set { + this.reconciledClicksField = value; + this.reconciledClicksSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reconciledClicksSpecified { + get { return this.reconciledClicksFieldSpecified; } + set { this.reconciledClicksFieldSpecified = value; } + } + + public long reconciledImpressions { + get { return this.reconciledImpressionsField; } + set { + this.reconciledImpressionsField = value; + this.reconciledImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reconciledImpressionsSpecified { + get { return this.reconciledImpressionsFieldSpecified; } + set { this.reconciledImpressionsFieldSpecified = value; } + } + + public int reconciledLineItemDays { + get { return this.reconciledLineItemDaysField; } + set { + this.reconciledLineItemDaysField = value; + this.reconciledLineItemDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reconciledLineItemDaysSpecified { + get { return this.reconciledLineItemDaysFieldSpecified; } + set { this.reconciledLineItemDaysFieldSpecified = value; } + } + + public Money contractedRevenue { + get { return this.contractedRevenueField; } + set { this.contractedRevenueField = value; } + } + + public Money dfpRevenue { + get { return this.dfpRevenueField; } + set { this.dfpRevenueField = value; } + } + + public Money thirdPartyRevenue { + get { return this.thirdPartyRevenueField; } + set { this.thirdPartyRevenueField = value; } + } + + public Money manualRevenue { + get { return this.manualRevenueField; } + set { this.manualRevenueField = value; } + } + + public Money reconciledRevenue { + get { return this.reconciledRevenueField; } + set { this.reconciledRevenueField = value; } + } + + public string comments { + get { return this.commentsField; } + set { this.commentsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum BillFrom { + DEFAULT, + DFP, + THIRD_PARTY, + MANUAL, + CONTRACTED_GOAL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CostType { + CPC, + CPD, + CPM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ReconciliationReportRowPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ReconciliationReportRow[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ReconciliationReportRow[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ReconciliationImportError : ApiError { + private ReconciliationImportErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReconciliationImportErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReconciliationImportError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ReconciliationImportErrorReason { + MISSING_EDITABLE_COLUMN, + INCONSISTENT_IMPORT_COLUMNS, + ILLEGAL_CONVERTION, + INCONSISTENT_COLUMNS_COUNT, + IMPORT_INTERNAL_ERROR, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ReconciliationError : ApiError { + private ReconciliationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReconciliationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReconciliationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ReconciliationErrorReason { + CANNOT_CREATE_RECONCILIATION_REPORT_VERSION, + INVALID_RECONCILIATION_REPORT_STATE_TRANSITION, + USER_CANNOT_RECONCILE_RECONCILIATION_REPORT, + CONTRACTED_VOLUME_CANNOT_BE_NULL, + DFP_VOLUME_CANNOT_BE_NULL, + MANUAL_VOLUME_CANNOT_BE_NULL, + THIRD_PARTY_VOLUME_CANNOT_BE_NULL, + DUPLICATE_LINE_ITEM_AND_CREATIVE, + CANNOT_RECONCILE_LINE_ITEM_CREATIVE, + LINE_ITEM_DAYS_MISMATCH, + LINE_ITEM_BILL_OFF_OF_MISMATCH, + CANNOT_MODIFY_RECONCILED_ORDER, + CANNOT_MODIFY_ACROSS_MULTIPLE_RECONCILIATION_REPORTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RangeError : ApiError { + private RangeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RangeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RangeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum RangeErrorReason { + TOO_HIGH, + TOO_LOW, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class NullError : ApiError { + private NullErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NullErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NullError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum NullErrorReason { + NULL_CONTENT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ForecastServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ForecastService : DfpSoapClient, IForecastService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ForecastService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/ForecastService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Forecast getForecast(LineItem lineItem) { + object[] results = this.Invoke("getForecast", new object[] { lineItem }); + return ((Forecast) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Forecast getForecastById(long lineItemId) { + object[] results = this.Invoke("getForecastById", new object[] { lineItemId }); + return ((Forecast) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ContendingLineItem { + private long lineItemIdField; + + private bool lineItemIdFieldSpecified; + + private long contendingImpressionsField; + + private bool contendingImpressionsFieldSpecified; + + public long lineItemId { + get { return this.lineItemIdField; } + set { + this.lineItemIdField = value; + this.lineItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemIdSpecified { + get { return this.lineItemIdFieldSpecified; } + set { this.lineItemIdFieldSpecified = value; } + } + + public long contendingImpressions { + get { return this.contendingImpressionsField; } + set { + this.contendingImpressionsField = value; + this.contendingImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contendingImpressionsSpecified { + get { return this.contendingImpressionsFieldSpecified; } + set { this.contendingImpressionsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Forecast { + private long idField; + + private bool idFieldSpecified; + + private long orderIdField; + + private bool orderIdFieldSpecified; + + private UnitType unitTypeField; + + private bool unitTypeFieldSpecified; + + private long availableUnitsField; + + private bool availableUnitsFieldSpecified; + + private long deliveredUnitsField; + + private bool deliveredUnitsFieldSpecified; + + private long matchedUnitsField; + + private bool matchedUnitsFieldSpecified; + + private long possibleUnitsField; + + private bool possibleUnitsFieldSpecified; + + private long reservedUnitsField; + + private bool reservedUnitsFieldSpecified; + + private ContendingLineItem[] contendingLineItemsField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public UnitType unitType { + get { return this.unitTypeField; } + set { + this.unitTypeField = value; + this.unitTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitTypeSpecified { + get { return this.unitTypeFieldSpecified; } + set { this.unitTypeFieldSpecified = value; } + } + + public long availableUnits { + get { return this.availableUnitsField; } + set { + this.availableUnitsField = value; + this.availableUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool availableUnitsSpecified { + get { return this.availableUnitsFieldSpecified; } + set { this.availableUnitsFieldSpecified = value; } + } + + public long deliveredUnits { + get { return this.deliveredUnitsField; } + set { + this.deliveredUnitsField = value; + this.deliveredUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveredUnitsSpecified { + get { return this.deliveredUnitsFieldSpecified; } + set { this.deliveredUnitsFieldSpecified = value; } + } + + public long matchedUnits { + get { return this.matchedUnitsField; } + set { + this.matchedUnitsField = value; + this.matchedUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool matchedUnitsSpecified { + get { return this.matchedUnitsFieldSpecified; } + set { this.matchedUnitsFieldSpecified = value; } + } + + public long possibleUnits { + get { return this.possibleUnitsField; } + set { + this.possibleUnitsField = value; + this.possibleUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool possibleUnitsSpecified { + get { return this.possibleUnitsFieldSpecified; } + set { this.possibleUnitsFieldSpecified = value; } + } + + public long reservedUnits { + get { return this.reservedUnitsField; } + set { + this.reservedUnitsField = value; + this.reservedUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reservedUnitsSpecified { + get { return this.reservedUnitsFieldSpecified; } + set { this.reservedUnitsFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("contendingLineItems")] + public ContendingLineItem[] contendingLineItems { + get { return this.contendingLineItemsField; } + set { this.contendingLineItemsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum UnitType { + IMPRESSIONS, + CLICKS + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class VideoPositionWithinPod { + private int indexField; + + private bool indexFieldSpecified; + + public int index { + get { return this.indexField; } + set { + this.indexField = value; + this.indexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool indexSpecified { + get { return this.indexFieldSpecified; } + set { this.indexFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class VideoPosition { + private VideoPositionType positionTypeField; + + private bool positionTypeFieldSpecified; + + private int midrollIndexField; + + private bool midrollIndexFieldSpecified; + + public VideoPositionType positionType { + get { return this.positionTypeField; } + set { + this.positionTypeField = value; + this.positionTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool positionTypeSpecified { + get { return this.positionTypeFieldSpecified; } + set { this.positionTypeFieldSpecified = value; } + } + + public int midrollIndex { + get { return this.midrollIndexField; } + set { + this.midrollIndexField = value; + this.midrollIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool midrollIndexSpecified { + get { return this.midrollIndexFieldSpecified; } + set { this.midrollIndexFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoPosition.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum VideoPositionType { + PREROLL, + MIDROLL, + POSTROLL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class VideoPositionTarget { + private VideoPosition videoPositionField; + + private VideoBumperType videoBumperTypeField; + + private bool videoBumperTypeFieldSpecified; + + private VideoPositionWithinPod videoPositionWithinPodField; + + public VideoPosition videoPosition { + get { return this.videoPositionField; } + set { this.videoPositionField = value; } + } + + public VideoBumperType videoBumperType { + get { return this.videoBumperTypeField; } + set { + this.videoBumperTypeField = value; + this.videoBumperTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoBumperTypeSpecified { + get { return this.videoBumperTypeFieldSpecified; } + set { this.videoBumperTypeFieldSpecified = value; } + } + + public VideoPositionWithinPod videoPositionWithinPod { + get { return this.videoPositionWithinPodField; } + set { this.videoPositionWithinPodField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum VideoBumperType { + BEFORE, + AFTER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class VideoPositionTargeting { + private VideoPositionTarget[] targetedPositionsField; + + + [System.Xml.Serialization.XmlElementAttribute("targetedPositions")] + public VideoPositionTarget[] targetedPositions { + get { return this.targetedPositionsField; } + set { this.targetedPositionsField = value; } + } + + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ContentMetadataKeyHierarchyTargeting { + private long[] customTargetingValueIdsField; + + + [System.Xml.Serialization.XmlElementAttribute("customTargetingValueIds")] + public long[] customTargetingValueIds { + get { return this.customTargetingValueIdsField; } + set { this.customTargetingValueIdsField = value; } + } + + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ContentTargeting { + private long[] targetedContentIdsField; + + private long[] excludedContentIdsField; + + private long[] targetedVideoCategoryIdsField; + + private long[] excludedVideoCategoryIdsField; + + private long[] targetedVideoContentBundleIdsField; + + private long[] excludedVideoContentBundleIdsField; + + private ContentMetadataKeyHierarchyTargeting[] targetedContentMetadataField; + + private ContentMetadataKeyHierarchyTargeting[] excludedContentMetadataField; + + + [System.Xml.Serialization.XmlElementAttribute("targetedContentIds")] + public long[] targetedContentIds { + get { return this.targetedContentIdsField; } + set { this.targetedContentIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedContentIds")] + public long[] excludedContentIds { + get { return this.excludedContentIdsField; } + set { this.excludedContentIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedVideoCategoryIds")] + public long[] targetedVideoCategoryIds { + get { return this.targetedVideoCategoryIdsField; } + set { this.targetedVideoCategoryIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedVideoCategoryIds")] + public long[] excludedVideoCategoryIds { + get { return this.excludedVideoCategoryIdsField; } + set { this.excludedVideoCategoryIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedVideoContentBundleIds")] + public long[] targetedVideoContentBundleIds { + get { return this.targetedVideoContentBundleIdsField; } + set { this.targetedVideoContentBundleIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedVideoContentBundleIds")] + public long[] excludedVideoContentBundleIds { + get { return this.excludedVideoContentBundleIdsField; } + set { this.excludedVideoContentBundleIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedContentMetadata")] + public ContentMetadataKeyHierarchyTargeting[] targetedContentMetadata { + get { return this.targetedContentMetadataField; } + set { this.targetedContentMetadataField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedContentMetadata")] + public ContentMetadataKeyHierarchyTargeting[] excludedContentMetadata { + get { return this.excludedContentMetadataField; } + set { this.excludedContentMetadataField = value; } + } + + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class UserDomainTargeting { + private string[] domainsField; + + private bool targetedField; + + private bool targetedFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("domains")] + public string[] domains { + get { return this.domainsField; } + set { this.domainsField = value; } + } + + public bool targeted { + get { return this.targetedField; } + set { + this.targetedField = value; + this.targetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetedSpecified { + get { return this.targetedFieldSpecified; } + set { this.targetedFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class OperatingSystemVersionTargeting { + private Technology[] targetedOperatingSystemVersionsField; + + private Technology[] excludedOperatingSystemVersionsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedOperatingSystemVersions")] + public Technology[] targetedOperatingSystemVersions { + get { return this.targetedOperatingSystemVersionsField; } + set { this.targetedOperatingSystemVersionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedOperatingSystemVersions")] + public Technology[] excludedOperatingSystemVersions { + get { return this.excludedOperatingSystemVersionsField; } + set { this.excludedOperatingSystemVersionsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystemVersion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystem))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileDeviceSubmodel))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileDevice))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileCarrier))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceManufacturer))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceCategory))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceCapability))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BrowserLanguage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Browser))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BandwidthGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Technology { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string technologyTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Technology.Type")] + public string TechnologyType { + get { return this.technologyTypeField; } + set { this.technologyTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class OperatingSystemVersion : Technology { + private int majorVersionField; + + private bool majorVersionFieldSpecified; + + private int minorVersionField; + + private bool minorVersionFieldSpecified; + + private int microVersionField; + + private bool microVersionFieldSpecified; + + public int majorVersion { + get { return this.majorVersionField; } + set { + this.majorVersionField = value; + this.majorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool majorVersionSpecified { + get { return this.majorVersionFieldSpecified; } + set { this.majorVersionFieldSpecified = value; } + } + + public int minorVersion { + get { return this.minorVersionField; } + set { + this.minorVersionField = value; + this.minorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minorVersionSpecified { + get { return this.minorVersionFieldSpecified; } + set { this.minorVersionFieldSpecified = value; } + } + + public int microVersion { + get { return this.microVersionField; } + set { + this.microVersionField = value; + this.microVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool microVersionSpecified { + get { return this.microVersionFieldSpecified; } + set { this.microVersionFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class OperatingSystem : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class MobileDeviceSubmodel : Technology { + private long mobileDeviceCriterionIdField; + + private bool mobileDeviceCriterionIdFieldSpecified; + + private long deviceManufacturerCriterionIdField; + + private bool deviceManufacturerCriterionIdFieldSpecified; + + public long mobileDeviceCriterionId { + get { return this.mobileDeviceCriterionIdField; } + set { + this.mobileDeviceCriterionIdField = value; + this.mobileDeviceCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mobileDeviceCriterionIdSpecified { + get { return this.mobileDeviceCriterionIdFieldSpecified; } + set { this.mobileDeviceCriterionIdFieldSpecified = value; } + } + + public long deviceManufacturerCriterionId { + get { return this.deviceManufacturerCriterionIdField; } + set { + this.deviceManufacturerCriterionIdField = value; + this.deviceManufacturerCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deviceManufacturerCriterionIdSpecified { + get { return this.deviceManufacturerCriterionIdFieldSpecified; } + set { this.deviceManufacturerCriterionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class MobileDevice : Technology { + private long manufacturerCriterionIdField; + + private bool manufacturerCriterionIdFieldSpecified; + + public long manufacturerCriterionId { + get { return this.manufacturerCriterionIdField; } + set { + this.manufacturerCriterionIdField = value; + this.manufacturerCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manufacturerCriterionIdSpecified { + get { return this.manufacturerCriterionIdFieldSpecified; } + set { this.manufacturerCriterionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class MobileCarrier : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeviceManufacturer : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeviceCategory : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeviceCapability : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class BrowserLanguage : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Browser : Technology { + private string majorVersionField; + + private string minorVersionField; + + public string majorVersion { + get { return this.majorVersionField; } + set { this.majorVersionField = value; } + } + + public string minorVersion { + get { return this.minorVersionField; } + set { this.minorVersionField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class BandwidthGroup : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class OperatingSystemTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] operatingSystemsField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("operatingSystems")] + public Technology[] operatingSystems { + get { return this.operatingSystemsField; } + set { this.operatingSystemsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class MobileDeviceSubmodelTargeting { + private Technology[] targetedMobileDeviceSubmodelsField; + + private Technology[] excludedMobileDeviceSubmodelsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedMobileDeviceSubmodels")] + public Technology[] targetedMobileDeviceSubmodels { + get { return this.targetedMobileDeviceSubmodelsField; } + set { this.targetedMobileDeviceSubmodelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedMobileDeviceSubmodels")] + public Technology[] excludedMobileDeviceSubmodels { + get { return this.excludedMobileDeviceSubmodelsField; } + set { this.excludedMobileDeviceSubmodelsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class MobileDeviceTargeting { + private Technology[] targetedMobileDevicesField; + + private Technology[] excludedMobileDevicesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedMobileDevices")] + public Technology[] targetedMobileDevices { + get { return this.targetedMobileDevicesField; } + set { this.targetedMobileDevicesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedMobileDevices")] + public Technology[] excludedMobileDevices { + get { return this.excludedMobileDevicesField; } + set { this.excludedMobileDevicesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class MobileCarrierTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] mobileCarriersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("mobileCarriers")] + public Technology[] mobileCarriers { + get { return this.mobileCarriersField; } + set { this.mobileCarriersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeviceManufacturerTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] deviceManufacturersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deviceManufacturers")] + public Technology[] deviceManufacturers { + get { return this.deviceManufacturersField; } + set { this.deviceManufacturersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeviceCategoryTargeting { + private Technology[] targetedDeviceCategoriesField; + + private Technology[] excludedDeviceCategoriesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedDeviceCategories")] + public Technology[] targetedDeviceCategories { + get { return this.targetedDeviceCategoriesField; } + set { this.targetedDeviceCategoriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedDeviceCategories")] + public Technology[] excludedDeviceCategories { + get { return this.excludedDeviceCategoriesField; } + set { this.excludedDeviceCategoriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeviceCapabilityTargeting { + private Technology[] targetedDeviceCapabilitiesField; + + private Technology[] excludedDeviceCapabilitiesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedDeviceCapabilities")] + public Technology[] targetedDeviceCapabilities { + get { return this.targetedDeviceCapabilitiesField; } + set { this.targetedDeviceCapabilitiesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedDeviceCapabilities")] + public Technology[] excludedDeviceCapabilities { + get { return this.excludedDeviceCapabilitiesField; } + set { this.excludedDeviceCapabilitiesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class BrowserLanguageTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] browserLanguagesField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("browserLanguages")] + public Technology[] browserLanguages { + get { return this.browserLanguagesField; } + set { this.browserLanguagesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class BrowserTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] browsersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("browsers")] + public Technology[] browsers { + get { return this.browsersField; } + set { this.browsersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class BandwidthGroupTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] bandwidthGroupsField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("bandwidthGroups")] + public Technology[] bandwidthGroups { + get { return this.bandwidthGroupsField; } + set { this.bandwidthGroupsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class TechnologyTargeting { + private BandwidthGroupTargeting bandwidthGroupTargetingField; + + private BrowserTargeting browserTargetingField; + + private BrowserLanguageTargeting browserLanguageTargetingField; + + private DeviceCapabilityTargeting deviceCapabilityTargetingField; + + private DeviceCategoryTargeting deviceCategoryTargetingField; + + private DeviceManufacturerTargeting deviceManufacturerTargetingField; + + private MobileCarrierTargeting mobileCarrierTargetingField; + + private MobileDeviceTargeting mobileDeviceTargetingField; + + private MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargetingField; + + private OperatingSystemTargeting operatingSystemTargetingField; + + private OperatingSystemVersionTargeting operatingSystemVersionTargetingField; + + public BandwidthGroupTargeting bandwidthGroupTargeting { + get { return this.bandwidthGroupTargetingField; } + set { this.bandwidthGroupTargetingField = value; } + } + + public BrowserTargeting browserTargeting { + get { return this.browserTargetingField; } + set { this.browserTargetingField = value; } + } + + public BrowserLanguageTargeting browserLanguageTargeting { + get { return this.browserLanguageTargetingField; } + set { this.browserLanguageTargetingField = value; } + } + + public DeviceCapabilityTargeting deviceCapabilityTargeting { + get { return this.deviceCapabilityTargetingField; } + set { this.deviceCapabilityTargetingField = value; } + } + + public DeviceCategoryTargeting deviceCategoryTargeting { + get { return this.deviceCategoryTargetingField; } + set { this.deviceCategoryTargetingField = value; } + } + + public DeviceManufacturerTargeting deviceManufacturerTargeting { + get { return this.deviceManufacturerTargetingField; } + set { this.deviceManufacturerTargetingField = value; } + } + + public MobileCarrierTargeting mobileCarrierTargeting { + get { return this.mobileCarrierTargetingField; } + set { this.mobileCarrierTargetingField = value; } + } + + public MobileDeviceTargeting mobileDeviceTargeting { + get { return this.mobileDeviceTargetingField; } + set { this.mobileDeviceTargetingField = value; } + } + + public MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargeting { + get { return this.mobileDeviceSubmodelTargetingField; } + set { this.mobileDeviceSubmodelTargetingField = value; } + } + + public OperatingSystemTargeting operatingSystemTargeting { + get { return this.operatingSystemTargetingField; } + set { this.operatingSystemTargetingField = value; } + } + + public OperatingSystemVersionTargeting operatingSystemVersionTargeting { + get { return this.operatingSystemVersionTargetingField; } + set { this.operatingSystemVersionTargetingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class TimeOfDay { + private int hourField; + + private bool hourFieldSpecified; + + private MinuteOfHour minuteField; + + private bool minuteFieldSpecified; + + public int hour { + get { return this.hourField; } + set { + this.hourField = value; + this.hourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hourSpecified { + get { return this.hourFieldSpecified; } + set { this.hourFieldSpecified = value; } + } + + public MinuteOfHour minute { + get { return this.minuteField; } + set { + this.minuteField = value; + this.minuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minuteSpecified { + get { return this.minuteFieldSpecified; } + set { this.minuteFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum MinuteOfHour { + ZERO, + FIFTEEN, + THIRTY, + FORTY_FIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DayPart { + private DayOfWeek dayOfWeekField; + + private bool dayOfWeekFieldSpecified; + + private TimeOfDay startTimeField; + + private TimeOfDay endTimeField; + + public DayOfWeek dayOfWeek { + get { return this.dayOfWeekField; } + set { + this.dayOfWeekField = value; + this.dayOfWeekSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dayOfWeekSpecified { + get { return this.dayOfWeekFieldSpecified; } + set { this.dayOfWeekFieldSpecified = value; } + } + + public TimeOfDay startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public TimeOfDay endTime { + get { return this.endTimeField; } + set { this.endTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum DayOfWeek { + MONDAY, + TUESDAY, + WEDNESDAY, + THURSDAY, + FRIDAY, + SATURDAY, + SUNDAY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DayPartTargeting { + private DayPart[] dayPartsField; + + private DeliveryTimeZone timeZoneField; + + private bool timeZoneFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("dayParts")] + public DayPart[] dayParts { + get { return this.dayPartsField; } + set { this.dayPartsField = value; } + } + + public DeliveryTimeZone timeZone { + get { return this.timeZoneField; } + set { + this.timeZoneField = value; + this.timeZoneSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool timeZoneSpecified { + get { return this.timeZoneFieldSpecified; } + set { this.timeZoneFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum DeliveryTimeZone { + PUBLISHER, + BROWSER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Location { + private long idField; + + private bool idFieldSpecified; + + private string typeField; + + private int canonicalParentIdField; + + private bool canonicalParentIdFieldSpecified; + + private string displayNameField; + + private string locationTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string type { + get { return this.typeField; } + set { this.typeField = value; } + } + + public int canonicalParentId { + get { return this.canonicalParentIdField; } + set { + this.canonicalParentIdField = value; + this.canonicalParentIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool canonicalParentIdSpecified { + get { return this.canonicalParentIdFieldSpecified; } + set { this.canonicalParentIdFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Location.Type")] + public string LocationType { + get { return this.locationTypeField; } + set { this.locationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class GeoTargeting { + private Location[] targetedLocationsField; + + private Location[] excludedLocationsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedLocations")] + public Location[] targetedLocations { + get { return this.targetedLocationsField; } + set { this.targetedLocationsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedLocations")] + public Location[] excludedLocations { + get { return this.excludedLocationsField; } + set { this.excludedLocationsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Targeting { + private GeoTargeting geoTargetingField; + + private InventoryTargeting inventoryTargetingField; + + private DayPartTargeting dayPartTargetingField; + + private TechnologyTargeting technologyTargetingField; + + private CustomCriteriaSet customTargetingField; + + private UserDomainTargeting userDomainTargetingField; + + private ContentTargeting contentTargetingField; + + private VideoPositionTargeting videoPositionTargetingField; + + public GeoTargeting geoTargeting { + get { return this.geoTargetingField; } + set { this.geoTargetingField = value; } + } + + public InventoryTargeting inventoryTargeting { + get { return this.inventoryTargetingField; } + set { this.inventoryTargetingField = value; } + } + + public DayPartTargeting dayPartTargeting { + get { return this.dayPartTargetingField; } + set { this.dayPartTargetingField = value; } + } + + public TechnologyTargeting technologyTargeting { + get { return this.technologyTargetingField; } + set { this.technologyTargetingField = value; } + } + + public CustomCriteriaSet customTargeting { + get { return this.customTargetingField; } + set { this.customTargetingField = value; } + } + + public UserDomainTargeting userDomainTargeting { + get { return this.userDomainTargetingField; } + set { this.userDomainTargetingField = value; } + } + + public ContentTargeting contentTargeting { + get { return this.contentTargetingField; } + set { this.contentTargetingField = value; } + } + + public VideoPositionTargeting videoPositionTargeting { + get { return this.videoPositionTargetingField; } + set { this.videoPositionTargetingField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DropDownCustomFieldValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class BaseCustomFieldValue { + private long customFieldIdField; + + private bool customFieldIdFieldSpecified; + + private string baseCustomFieldValueTypeField; + + public long customFieldId { + get { return this.customFieldIdField; } + set { + this.customFieldIdField = value; + this.customFieldIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldIdSpecified { + get { return this.customFieldIdFieldSpecified; } + set { this.customFieldIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseCustomFieldValue.Type")] + public string BaseCustomFieldValueType { + get { return this.baseCustomFieldValueTypeField; } + set { this.baseCustomFieldValueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DropDownCustomFieldValue : BaseCustomFieldValue { + private long customFieldOptionIdField; + + private bool customFieldOptionIdFieldSpecified; + + public long customFieldOptionId { + get { return this.customFieldOptionIdField; } + set { + this.customFieldOptionIdField = value; + this.customFieldOptionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldOptionIdSpecified { + get { return this.customFieldOptionIdFieldSpecified; } + set { this.customFieldOptionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CustomFieldValue : BaseCustomFieldValue { + private Value valueField; + + public Value value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeliveryIndicator { + private double expectedDeliveryPercentageField; + + private bool expectedDeliveryPercentageFieldSpecified; + + private double actualDeliveryPercentageField; + + private bool actualDeliveryPercentageFieldSpecified; + + public double expectedDeliveryPercentage { + get { return this.expectedDeliveryPercentageField; } + set { + this.expectedDeliveryPercentageField = value; + this.expectedDeliveryPercentageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expectedDeliveryPercentageSpecified { + get { return this.expectedDeliveryPercentageFieldSpecified; } + set { this.expectedDeliveryPercentageFieldSpecified = value; } + } + + public double actualDeliveryPercentage { + get { return this.actualDeliveryPercentageField; } + set { + this.actualDeliveryPercentageField = value; + this.actualDeliveryPercentageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool actualDeliveryPercentageSpecified { + get { return this.actualDeliveryPercentageFieldSpecified; } + set { this.actualDeliveryPercentageFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Stats { + private long impressionsDeliveredField; + + private bool impressionsDeliveredFieldSpecified; + + private long clicksDeliveredField; + + private bool clicksDeliveredFieldSpecified; + + private long videoCompletionsDeliveredField; + + private bool videoCompletionsDeliveredFieldSpecified; + + private long videoStartsDeliveredField; + + private bool videoStartsDeliveredFieldSpecified; + + public long impressionsDelivered { + get { return this.impressionsDeliveredField; } + set { + this.impressionsDeliveredField = value; + this.impressionsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsDeliveredSpecified { + get { return this.impressionsDeliveredFieldSpecified; } + set { this.impressionsDeliveredFieldSpecified = value; } + } + + public long clicksDelivered { + get { return this.clicksDeliveredField; } + set { + this.clicksDeliveredField = value; + this.clicksDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clicksDeliveredSpecified { + get { return this.clicksDeliveredFieldSpecified; } + set { this.clicksDeliveredFieldSpecified = value; } + } + + public long videoCompletionsDelivered { + get { return this.videoCompletionsDeliveredField; } + set { + this.videoCompletionsDeliveredField = value; + this.videoCompletionsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoCompletionsDeliveredSpecified { + get { return this.videoCompletionsDeliveredFieldSpecified; } + set { this.videoCompletionsDeliveredFieldSpecified = value; } + } + + public long videoStartsDelivered { + get { return this.videoStartsDeliveredField; } + set { + this.videoStartsDeliveredField = value; + this.videoStartsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoStartsDeliveredSpecified { + get { return this.videoStartsDeliveredFieldSpecified; } + set { this.videoStartsDeliveredFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AppliedLabel { + private long labelIdField; + + private bool labelIdFieldSpecified; + + private bool isNegatedField; + + private bool isNegatedFieldSpecified; + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + + public bool isNegated { + get { return this.isNegatedField; } + set { + this.isNegatedField = value; + this.isNegatedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isNegatedSpecified { + get { return this.isNegatedFieldSpecified; } + set { this.isNegatedFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Size { + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + private bool isAspectRatioField; + + private bool isAspectRatioFieldSpecified; + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + public bool isAspectRatio { + get { return this.isAspectRatioField; } + set { + this.isAspectRatioField = value; + this.isAspectRatioSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAspectRatioSpecified { + get { return this.isAspectRatioFieldSpecified; } + set { this.isAspectRatioFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CreativePlaceholder { + private Size sizeField; + + private CreativePlaceholder[] companionsField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private long idField; + + private bool idFieldSpecified; + + private int expectedCreativeCountField; + + private bool expectedCreativeCountFieldSpecified; + + private CreativeSizeType creativeSizeTypeField; + + private bool creativeSizeTypeFieldSpecified; + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companions")] + public CreativePlaceholder[] companions { + get { return this.companionsField; } + set { this.companionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public int expectedCreativeCount { + get { return this.expectedCreativeCountField; } + set { + this.expectedCreativeCountField = value; + this.expectedCreativeCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expectedCreativeCountSpecified { + get { return this.expectedCreativeCountFieldSpecified; } + set { this.expectedCreativeCountFieldSpecified = value; } + } + + public CreativeSizeType creativeSizeType { + get { return this.creativeSizeTypeField; } + set { + this.creativeSizeTypeField = value; + this.creativeSizeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeSizeTypeSpecified { + get { return this.creativeSizeTypeFieldSpecified; } + set { this.creativeSizeTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CreativeSizeType { + PIXEL, + ASPECT_RATIO, + INTERSTITIAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class FrequencyCap { + private int maxImpressionsField; + + private bool maxImpressionsFieldSpecified; + + private int numTimeUnitsField; + + private bool numTimeUnitsFieldSpecified; + + private TimeUnit timeUnitField; + + private bool timeUnitFieldSpecified; + + public int maxImpressions { + get { return this.maxImpressionsField; } + set { + this.maxImpressionsField = value; + this.maxImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxImpressionsSpecified { + get { return this.maxImpressionsFieldSpecified; } + set { this.maxImpressionsFieldSpecified = value; } + } + + public int numTimeUnits { + get { return this.numTimeUnitsField; } + set { + this.numTimeUnitsField = value; + this.numTimeUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numTimeUnitsSpecified { + get { return this.numTimeUnitsFieldSpecified; } + set { this.numTimeUnitsFieldSpecified = value; } + } + + public TimeUnit timeUnit { + get { return this.timeUnitField; } + set { + this.timeUnitField = value; + this.timeUnitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool timeUnitSpecified { + get { return this.timeUnitFieldSpecified; } + set { this.timeUnitFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum TimeUnit { + MINUTE, + HOUR, + DAY, + WEEK, + MONTH, + LIFETIME, + POD, + STREAM + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItem))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class LineItemSummary { + private long orderIdField; + + private bool orderIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string externalIdField; + + private string orderNameField; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private int autoExtensionDaysField; + + private bool autoExtensionDaysFieldSpecified; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private CreativeRotationType creativeRotationTypeField; + + private bool creativeRotationTypeFieldSpecified; + + private DeliveryRateType deliveryRateTypeField; + + private bool deliveryRateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int priorityField; + + private bool priorityFieldSpecified; + + private UnitType unitTypeField; + + private bool unitTypeFieldSpecified; + + private LineItemSummaryDuration durationField; + + private bool durationFieldSpecified; + + private long unitsBoughtField; + + private bool unitsBoughtFieldSpecified; + + private Money costPerUnitField; + + private Money valueCostPerUnitField; + + private CostType costTypeField; + + private bool costTypeFieldSpecified; + + private LineItemDiscountType discountTypeField; + + private bool discountTypeFieldSpecified; + + private double discountField; + + private bool discountFieldSpecified; + + private long contractedUnitsBoughtField; + + private bool contractedUnitsBoughtFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private EnvironmentType environmentTypeField; + + private bool environmentTypeFieldSpecified; + + private CompanionDeliveryOption companionDeliveryOptionField; + + private bool companionDeliveryOptionFieldSpecified; + + private CreativePersistenceType creativePersistenceTypeField; + + private bool creativePersistenceTypeFieldSpecified; + + private bool allowOverbookField; + + private bool allowOverbookFieldSpecified; + + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + private bool reserveAtCreationField; + + private bool reserveAtCreationFieldSpecified; + + private Stats statsField; + + private DeliveryIndicator deliveryIndicatorField; + + private long[] deliveryDataField; + + private Money budgetField; + + private ComputedStatus statusField; + + private bool statusFieldSpecified; + + private LineItemSummaryReservationStatus reservationStatusField; + + private bool reservationStatusFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private string webPropertyCodeField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private bool disableSameAdvertiserCompetitiveExclusionField; + + private bool disableSameAdvertiserCompetitiveExclusionFieldSpecified; + + private string lastModifiedByAppField; + + private string notesField; + + private DateTime lastModifiedDateTimeField; + + private DateTime creationDateTimeField; + + private bool isPrioritizedPreferredDealsEnabledField; + + private bool isPrioritizedPreferredDealsEnabledFieldSpecified; + + private int adExchangeAuctionOpeningPriorityField; + + private bool adExchangeAuctionOpeningPriorityFieldSpecified; + + private BaseCustomFieldValue[] customFieldValuesField; + + private bool isMissingCreativesField; + + private bool isMissingCreativesFieldSpecified; + + private string lineItemSummaryTypeField; + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string externalId { + get { return this.externalIdField; } + set { this.externalIdField = value; } + } + + public string orderName { + get { return this.orderNameField; } + set { this.orderNameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public int autoExtensionDays { + get { return this.autoExtensionDaysField; } + set { + this.autoExtensionDaysField = value; + this.autoExtensionDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool autoExtensionDaysSpecified { + get { return this.autoExtensionDaysFieldSpecified; } + set { this.autoExtensionDaysFieldSpecified = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public CreativeRotationType creativeRotationType { + get { return this.creativeRotationTypeField; } + set { + this.creativeRotationTypeField = value; + this.creativeRotationTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeRotationTypeSpecified { + get { return this.creativeRotationTypeFieldSpecified; } + set { this.creativeRotationTypeFieldSpecified = value; } + } + + public DeliveryRateType deliveryRateType { + get { return this.deliveryRateTypeField; } + set { + this.deliveryRateTypeField = value; + this.deliveryRateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryRateTypeSpecified { + get { return this.deliveryRateTypeFieldSpecified; } + set { this.deliveryRateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + public UnitType unitType { + get { return this.unitTypeField; } + set { + this.unitTypeField = value; + this.unitTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitTypeSpecified { + get { return this.unitTypeFieldSpecified; } + set { this.unitTypeFieldSpecified = value; } + } + + public LineItemSummaryDuration duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public long unitsBought { + get { return this.unitsBoughtField; } + set { + this.unitsBoughtField = value; + this.unitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitsBoughtSpecified { + get { return this.unitsBoughtFieldSpecified; } + set { this.unitsBoughtFieldSpecified = value; } + } + + public Money costPerUnit { + get { return this.costPerUnitField; } + set { this.costPerUnitField = value; } + } + + public Money valueCostPerUnit { + get { return this.valueCostPerUnitField; } + set { this.valueCostPerUnitField = value; } + } + + public CostType costType { + get { return this.costTypeField; } + set { + this.costTypeField = value; + this.costTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool costTypeSpecified { + get { return this.costTypeFieldSpecified; } + set { this.costTypeFieldSpecified = value; } + } + + public LineItemDiscountType discountType { + get { return this.discountTypeField; } + set { + this.discountTypeField = value; + this.discountTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool discountTypeSpecified { + get { return this.discountTypeFieldSpecified; } + set { this.discountTypeFieldSpecified = value; } + } + + public double discount { + get { return this.discountField; } + set { + this.discountField = value; + this.discountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool discountSpecified { + get { return this.discountFieldSpecified; } + set { this.discountFieldSpecified = value; } + } + + public long contractedUnitsBought { + get { return this.contractedUnitsBoughtField; } + set { + this.contractedUnitsBoughtField = value; + this.contractedUnitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contractedUnitsBoughtSpecified { + get { return this.contractedUnitsBoughtFieldSpecified; } + set { this.contractedUnitsBoughtFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + public EnvironmentType environmentType { + get { return this.environmentTypeField; } + set { + this.environmentTypeField = value; + this.environmentTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool environmentTypeSpecified { + get { return this.environmentTypeFieldSpecified; } + set { this.environmentTypeFieldSpecified = value; } + } + + public CompanionDeliveryOption companionDeliveryOption { + get { return this.companionDeliveryOptionField; } + set { + this.companionDeliveryOptionField = value; + this.companionDeliveryOptionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companionDeliveryOptionSpecified { + get { return this.companionDeliveryOptionFieldSpecified; } + set { this.companionDeliveryOptionFieldSpecified = value; } + } + + public CreativePersistenceType creativePersistenceType { + get { return this.creativePersistenceTypeField; } + set { + this.creativePersistenceTypeField = value; + this.creativePersistenceTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativePersistenceTypeSpecified { + get { return this.creativePersistenceTypeFieldSpecified; } + set { this.creativePersistenceTypeFieldSpecified = value; } + } + + public bool allowOverbook { + get { return this.allowOverbookField; } + set { + this.allowOverbookField = value; + this.allowOverbookSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowOverbookSpecified { + get { return this.allowOverbookFieldSpecified; } + set { this.allowOverbookFieldSpecified = value; } + } + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + + public bool reserveAtCreation { + get { return this.reserveAtCreationField; } + set { + this.reserveAtCreationField = value; + this.reserveAtCreationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reserveAtCreationSpecified { + get { return this.reserveAtCreationFieldSpecified; } + set { this.reserveAtCreationFieldSpecified = value; } + } + + public Stats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public DeliveryIndicator deliveryIndicator { + get { return this.deliveryIndicatorField; } + set { this.deliveryIndicatorField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("units", IsNullable = false)] + public long[] deliveryData { + get { return this.deliveryDataField; } + set { this.deliveryDataField = value; } + } + + public Money budget { + get { return this.budgetField; } + set { this.budgetField = value; } + } + + public ComputedStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public LineItemSummaryReservationStatus reservationStatus { + get { return this.reservationStatusField; } + set { + this.reservationStatusField = value; + this.reservationStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reservationStatusSpecified { + get { return this.reservationStatusFieldSpecified; } + set { this.reservationStatusFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public string webPropertyCode { + get { return this.webPropertyCodeField; } + set { this.webPropertyCodeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public bool disableSameAdvertiserCompetitiveExclusion { + get { return this.disableSameAdvertiserCompetitiveExclusionField; } + set { + this.disableSameAdvertiserCompetitiveExclusionField = value; + this.disableSameAdvertiserCompetitiveExclusionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool disableSameAdvertiserCompetitiveExclusionSpecified { + get { return this.disableSameAdvertiserCompetitiveExclusionFieldSpecified; } + set { this.disableSameAdvertiserCompetitiveExclusionFieldSpecified = value; } + } + + public string lastModifiedByApp { + get { return this.lastModifiedByAppField; } + set { this.lastModifiedByAppField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public DateTime creationDateTime { + get { return this.creationDateTimeField; } + set { this.creationDateTimeField = value; } + } + + public bool isPrioritizedPreferredDealsEnabled { + get { return this.isPrioritizedPreferredDealsEnabledField; } + set { + this.isPrioritizedPreferredDealsEnabledField = value; + this.isPrioritizedPreferredDealsEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isPrioritizedPreferredDealsEnabledSpecified { + get { return this.isPrioritizedPreferredDealsEnabledFieldSpecified; } + set { this.isPrioritizedPreferredDealsEnabledFieldSpecified = value; } + } + + public int adExchangeAuctionOpeningPriority { + get { return this.adExchangeAuctionOpeningPriorityField; } + set { + this.adExchangeAuctionOpeningPriorityField = value; + this.adExchangeAuctionOpeningPrioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adExchangeAuctionOpeningPrioritySpecified { + get { return this.adExchangeAuctionOpeningPriorityFieldSpecified; } + set { this.adExchangeAuctionOpeningPriorityFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + public bool isMissingCreatives { + get { return this.isMissingCreativesField; } + set { + this.isMissingCreativesField = value; + this.isMissingCreativesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isMissingCreativesSpecified { + get { return this.isMissingCreativesFieldSpecified; } + set { this.isMissingCreativesFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("LineItemSummary.Type")] + public string LineItemSummaryType { + get { return this.lineItemSummaryTypeField; } + set { this.lineItemSummaryTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum StartDateTimeType { + USE_START_DATE_TIME, + IMMEDIATELY, + ONE_HOUR_FROM_NOW + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CreativeRotationType { + EVEN, + OPTIMIZED, + MANUAL, + SEQUENTIAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum DeliveryRateType { + EVENLY, + FRONTLOADED, + AS_FAST_AS_POSSIBLE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum RoadblockingType { + ONLY_ONE, + ONE_OR_MORE, + AS_MANY_AS_POSSIBLE, + ALL_ROADBLOCK, + CREATIVE_SET + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum LineItemType { + SPONSORSHIP, + STANDARD, + NETWORK, + BULK, + PRICE_PRIORITY, + HOUSE, + LEGACY_DFP, + CLICK_TRACKING, + ADSENSE, + AD_EXCHANGE, + BUMPER, + ADMOB, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemSummary.Duration", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum LineItemSummaryDuration { + NONE, + LIFETIME, + DAILY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum LineItemDiscountType { + ABSOLUTE_VALUE, + PERCENTAGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum TargetPlatform { + WEB, + MOBILE, + ANY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum EnvironmentType { + BROWSER, + VIDEO_PLAYER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CompanionDeliveryOption { + OPTIONAL, + AT_LEAST_ONE, + ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CreativePersistenceType { + NOT_PERSISTENT, + PERSISTENT_AND_EXCLUDE_NONE, + PERSISTENT_AND_EXCLUDE_DISPLAY, + PERSISTENT_AND_EXCLUDE_VIDEO, + PERSISTENT_AND_EXCLUDE_ALL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ComputedStatus { + DELIVERY_EXTENDED, + DELIVERING, + READY, + PAUSED, + NEEDS_CREATIVES, + PAUSED_INVENTORY_RELEASED, + PENDING_APPROVAL, + COMPLETED, + DISAPPROVED, + DRAFT, + CANCELED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemSummary.ReservationStatus", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum LineItemSummaryReservationStatus { + RESERVED, + UNRESERVED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class LineItem : LineItemSummary { + private Targeting targetingField; + + public Targeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class UserDomainTargetingError : ApiError { + private UserDomainTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public UserDomainTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "UserDomainTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum UserDomainTargetingErrorReason { + INVALID_DOMAIN_NAMES, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class UniqueError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class TypeError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class TechnologyTargetingError : ApiError { + private TechnologyTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TechnologyTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TechnologyTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum TechnologyTargetingErrorReason { + MOBILE_LINE_ITEM_CONTAINS_WEB_TECH_CRITERIA, + WEB_LINE_ITEM_CONTAINS_MOBILE_TECH_CRITERIA, + MOBILE_CARRIER_TARGETING_FEATURE_NOT_ENABLED, + DEVICE_CAPABILITY_TARGETING_FEATURE_NOT_ENABLED, + DEVICE_CATEGORY_TARGETING_FEATURE_NOT_ENABLED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class TeamError : ApiError { + private TeamErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TeamErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TeamError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum TeamErrorReason { + ENTITY_NOT_ON_USERS_TEAMS, + AD_UNITS_NOT_ON_ORDER_TEAMS, + PLACEMENTS_NOT_ON_ORDER_TEAMS, + MISSING_USERS_TEAM, + ALL_TEAM_ASSOCIATION_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class StringLengthError : ApiError { + private StringLengthErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StringLengthErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StringLengthError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum StringLengthErrorReason { + TOO_LONG, + TOO_SHORT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ReservationDetailsError : ApiError { + private ReservationDetailsErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReservationDetailsErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReservationDetailsError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ReservationDetailsErrorReason { + UNLIMITED_UNITS_BOUGHT_NOT_ALLOWED, + UNLIMITED_END_DATE_TIME_NOT_ALLOWED, + PERCENTAGE_UNITS_BOUGHT_TOO_HIGH, + DURATION_NOT_ALLOWED, + UNIT_TYPE_NOT_ALLOWED, + COST_TYPE_NOT_ALLOWED, + COST_TYPE_UNIT_TYPE_MISMATCH_NOT_ALLOWED, + LINE_ITEM_TYPE_NOT_ALLOWED, + NETWORK_REMNANT_ORDER_CANNOT_UPDATE_LINEITEM_TYPE, + BACKFILL_WEBPROPERTY_CODE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RequiredSizeError : ApiError { + private RequiredSizeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredSizeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredSizeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum RequiredSizeErrorReason { + REQUIRED, + NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RequiredNumberError : ApiError { + private RequiredNumberErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredNumberErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredNumberError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum RequiredNumberErrorReason { + REQUIRED, + TOO_LARGE, + TOO_SMALL, + TOO_LARGE_WITH_DETAILS, + TOO_SMALL_WITH_DETAILS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RequiredCollectionError : ApiError { + private RequiredCollectionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredCollectionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredCollectionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum RequiredCollectionErrorReason { + REQUIRED, + TOO_LARGE, + TOO_SMALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RegExError : ApiError { + private RegExErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RegExErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RegExError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum RegExErrorReason { + INVALID, + NULL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ParseError : ApiError { + private ParseErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ParseErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ParseError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ParseErrorReason { + UNPARSABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class OrderError : ApiError { + private OrderErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OrderErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OrderError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum OrderErrorReason { + UPDATE_CANCELED_ORDER_NOT_ALLOWED, + UPDATE_PENDING_APPROVAL_ORDER_NOT_ALLOWED, + UPDATE_ARCHIVED_ORDER_NOT_ALLOWED, + CANNOT_MODIFY_PROPOSAL_ID, + PRIMARY_USER_REQUIRED, + PRIMARY_USER_CANNOT_BE_SECONDARY, + ORDER_TEAM_NOT_ASSOCIATED_WITH_ADVERTISER, + USER_NOT_ON_ORDERS_TEAMS, + AGENCY_NOT_ON_ORDERS_TEAMS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class LineItemOperationError : ApiError { + private LineItemOperationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemOperationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemOperationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum LineItemOperationErrorReason { + NOT_ALLOWED, + NOT_APPLICABLE, + HAS_COMPLETED, + HAS_NO_ACTIVE_CREATIVES, + CANNOT_ACTIVATE_LEGACY_DFP_LINE_ITEM, + CANNOT_DELETE_DELIVERED_LINE_ITEM, + CANNOT_RESERVE_COMPANY_CREDIT_STATUS_NOT_ACTIVE, + CANNOT_ACTIVATE_INVALID_COMPANY_CREDIT_STATUS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class LineItemFlightDateError : ApiError { + private LineItemFlightDateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemFlightDateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemFlightDateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum LineItemFlightDateErrorReason { + START_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_NOT_AFTER_START_TIME, + END_DATE_TIME_TOO_LATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class LineItemError : ApiError { + private LineItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum LineItemErrorReason { + ALREADY_STARTED, + UPDATE_RESERVATION_NOT_ALLOWED, + ALL_ROADBLOCK_NOT_ALLOWED, + CREATIVE_SET_ROADBLOCK_NOT_ALLOWED, + FRACTIONAL_PERCENTAGE_NOT_ALLOWED, + DISCOUNT_NOT_ALLOWED, + UPDATE_CANCELED_LINE_ITEM_NOT_ALLOWED, + UPDATE_PENDING_APPROVAL_LINE_ITEM_NOT_ALLOWED, + UPDATE_ARCHIVED_LINE_ITEM_NOT_ALLOWED, + FRONTLOADED_NOT_ALLOWED, + CREATE_OR_UPDATE_LEGACY_DFP_LINE_ITEM_TYPE_NOT_ALLOWED, + COPY_LINE_ITEM_FROM_DIFFERENT_COMPANY_NOT_ALLOWED, + INVALID_SIZE_FOR_PLATFORM, + INVALID_LINE_ITEM_TYPE_FOR_PLATFORM, + INVALID_WEB_PROPERTY_FOR_PLATFORM, + INVALID_WEB_PROPERTY_FOR_ENVIRONMENT, + AFMA_BACKFILL_NOT_ALLOWED, + UPDATE_ENVIRONMENT_TYPE_NOT_ALLOWED, + COMPANIONS_NOT_ALLOWED, + ROADBLOCKS_WITH_NONROADBLOCKS_NOT_ALLOWED, + CANNOT_UPDATE_TO_OR_FROM_CREATIVE_SET_ROADBLOCK, + UPDATE_FROM_BACKFILL_LINE_ITEM_TYPE_NOT_ALLOWED, + UPDATE_TO_BACKFILL_LINE_ITEM_TYPE_NOT_ALLOWED, + UPDATE_BACKFILL_WEB_PROPERTY_NOT_ALLOWED, + INVALID_COMPANION_DELIVERY_OPTION_FOR_ENVIRONMENT_TYPE, + COMPANION_BACKFILL_REQUIRES_VIDEO, + COMPANION_DELIVERY_OPTION_REQUIRE_PREMIUM, + DUPLICATE_MASTER_SIZES, + INVALID_PRIORITY_FOR_LINE_ITEM_TYPE, + INVALID_ENVIRONMENT_TYPE, + INVALID_ENVIRONMENT_TYPE_FOR_PLATFORM, + INVALID_TYPE_FOR_AUTO_EXTENSION, + INVALID_TYPE_FOR_CONTRACTED_UNITS_BOUGHT, + VIDEO_INVALID_ROADBLOCKING, + BACKFILL_TYPE_NOT_ALLOWED, + COMPANION_DELIVERY_OPTIONS_NOT_ALLOWED_WITH_BACKFILL, + INVALID_WEB_PROPERTY_FOR_ADX_BACKFILL, + INVALID_SIZE_FOR_ENVIRONMENT, + TARGET_PLATOFRM_NOT_ALLOWED, + INVALID_LINE_ITEM_CURRENCY, + LINE_ITEM_CANNOT_HAVE_MULTIPLE_CURRENCIES, + CANNOT_CHANGE_CURRENCY, + INVALID_FOR_OFFLINE, + INVALID_LINE_ITEM_DATE_TIME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class LineItemCreativeAssociationError : ApiError { + private LineItemCreativeAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemCreativeAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum LineItemCreativeAssociationErrorReason { + CREATIVE_IN_WRONG_ADVERTISERS_LIBRARY, + INVALID_LINEITEM_CREATIVE_PAIRING, + STARTDATE_BEFORE_LINEITEM_STARTDATE, + STARTDATE_NOT_BEFORE_LINEITEM_ENDDATE, + ENDDATE_AFTER_LINEITEM_ENDDATE, + ENDDATE_NOT_AFTER_LINEITEM_STARTDATE, + ENDDATE_NOT_AFTER_STARTDATE, + ENDDATE_IN_THE_PAST, + CANNOT_COPY_WITHIN_SAME_LINE_ITEM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class LabelEntityAssociationError : ApiError { + private LabelEntityAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LabelEntityAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LabelEntityAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum LabelEntityAssociationErrorReason { + INVALID_COMPANY_TYPE, + DUPLICATE_ASSOCIATION, + INVALID_ASSOCIATION, + DUPLICATE_ASSOCIATION_WITH_NEGATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class InventoryUnitError : ApiError { + private InventoryUnitErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum InventoryUnitErrorReason { + EXPLICIT_TARGETING_NOT_ALLOWED, + TARGET_PLATFORM_NOT_APPLICABLE, + ADSENSE_CANNOT_BE_ENABLED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class InventoryTargetingError : ApiError { + private InventoryTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum InventoryTargetingErrorReason { + AT_LEAST_ONE_PLACEMENT_OR_INVENTORY_UNIT_REQUIRED, + INVENTORY_CANNOT_BE_TARGETED_AND_EXCLUDED, + PARENT_CONTAINS_INVALID_MIX_OF_TARGETED_AND_EXCLUDED_AD_UNITS, + INVENTORY_EXCLUSIONS_MUST_HAVE_PARENT_INVENTORY_UNIT, + INVENTORY_UNIT_CANNOT_BE_TARGETED_IF_ANCESTOR_IS_TARGETED, + INVENTORY_UNIT_CANNOT_BE_TARGETED_IF_ANCESTOR_IS_EXCLUDED, + INVENTORY_UNIT_CANNOT_BE_EXCLUDED_IF_ANCESTOR_IS_EXCLUDED, + EXPLICITLY_TARGETED_INVENTORY_UNIT_CANNOT_BE_TARGETED, + EXPLICITLY_TARGETED_INVENTORY_UNIT_CANNOT_BE_EXCLUDED, + SELF_ONLY_INVENTORY_UNIT_NOT_ALLOWED, + SELF_ONLY_INVENTORY_UNIT_WITHOUT_DESCENDANTS, + INVENTORY_FROM_MULTIPLE_NETWORKS_CANNOT_BE_TARGETED_SIMULTANEOUSLY, + INVENTORY_FROM_LOCAL_AND_DISTRIBUTOR_NETWORKS_CANNOT_BE_TARGETED_SIMULTANEOUSLY, + SHARED_INVENTORY_CANNOT_BE_TARGETED_WITH_AUDIENCE_SEGMENTS_SIMULTANEOUSLY, + UNSUPPORTED_LINE_ITEM_TYPE_FOR_SHARED_INVENTORY_TARGETING, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class InvalidUrlError : ApiError { + private InvalidUrlErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidUrlErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidUrlError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum InvalidUrlErrorReason { + ILLEGAL_CHARACTERS, + INVALID_FORMAT, + INSECURE_SCHEME, + NO_SCHEME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class GeoTargetingError : ApiError { + private GeoTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public GeoTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GeoTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum GeoTargetingErrorReason { + TARGETED_LOCATIONS_NOT_EXCLUDABLE, + EXCLUDED_LOCATIONS_CANNOT_HAVE_CHILDREN_TARGETED, + POSTAL_CODES_CANNOT_BE_EXCLUDED, + UNTARGETABLE_LOCATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class GenericTargetingError : ApiError { + private GenericTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public GenericTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GenericTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum GenericTargetingErrorReason { + CONFLICTING_INCLUSION_OR_EXCLUSION_OF_SIBLINGS, + INCLUDING_DESCENDANTS_OF_EXCLUDED_CRITERIA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class FrequencyCapError : ApiError { + private FrequencyCapErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FrequencyCapErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FrequencyCapError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum FrequencyCapErrorReason { + IMPRESSION_LIMIT_EXCEEDED, + IMPRESSIONS_TOO_LOW, + RANGE_LIMIT_EXCEEDED, + RANGE_TOO_LOW, + DUPLICATE_TIME_RANGE, + TOO_MANY_FREQUENCY_CAPS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ForecastError : ApiError { + private ForecastErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ForecastErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ForecastError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ForecastErrorReason { + SERVER_NOT_AVAILABLE, + INTERNAL_ERROR, + NO_FORECAST_YET, + NOT_ENOUGH_INVENTORY, + SUCCESS, + ZERO_LENGTH_RESERVATION, + EXCEEDED_QUOTA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class EntityLimitReachedError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DayPartTargetingError : ApiError { + private DayPartTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DayPartTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DayPartTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum DayPartTargetingErrorReason { + INVALID_HOUR, + INVALID_MINUTE, + END_TIME_NOT_AFTER_START_TIME, + TIME_PERIODS_OVERLAP, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DateTimeRangeTargetingError : ApiError { + private DateTimeRangeTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DateTimeRangeTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DateTimeRangeTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum DateTimeRangeTargetingErrorReason { + EMPTY_RANGES, + NOT_SPONSORSHIP_LINEITEM, + PAST_RANGES_CHANGED, + RANGES_OVERLAP, + RANGES_OUT_OF_LINEITEM_ACTIVE_PERIOD, + START_TIME_IS_NOT_START_OF_DAY, + END_TIME_IS_NOT_END_OF_DAY, + START_DATE_TIME_IS_IN_PAST, + RANGE_END_TIME_BEFORE_START_TIME, + END_DATE_TIME_IS_TOO_LATE, + LIMITED_RANGES_IN_UNLIMITED_LINEITEM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CustomTargetingError : ApiError { + private CustomTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CustomTargetingErrorReason { + KEY_NOT_FOUND, + KEY_COUNT_TOO_LARGE, + KEY_NAME_DUPLICATE, + KEY_NAME_EMPTY, + KEY_NAME_INVALID_LENGTH, + KEY_NAME_INVALID_CHARS, + KEY_NAME_RESERVED, + KEY_DISPLAY_NAME_INVALID_LENGTH, + VALUE_NOT_FOUND, + GET_VALUES_BY_STATEMENT_MUST_CONTAIN_KEY_ID, + VALUE_COUNT_FOR_KEY_TOO_LARGE, + VALUE_NAME_DUPLICATE, + VALUE_NAME_EMPTY, + VALUE_NAME_INVALID_LENGTH, + VALUE_NAME_INVALID_CHARS, + VALUE_DISPLAY_NAME_INVALID_LENGTH, + VALUE_MATCH_TYPE_NOT_ALLOWED, + VALUE_MATCH_TYPE_NOT_EXACT_FOR_PREDEFINED_KEY, + SUFFIX_MATCH_TYPE_NOT_ALLOWED, + CONTAINS_MATCH_TYPE_NOT_ALLOWED, + KEY_WITH_MISSING_VALUES, + CANNOT_OR_DIFFERENT_KEYS, + INVALID_TARGETING_EXPRESSION, + DELETED_KEY_CANNOT_BE_USED_FOR_TARGETING, + DELETED_VALUE_CANNOT_BE_USED_FOR_TARGETING, + VIDEO_BROWSE_BY_KEY_CANNOT_BE_USED_FOR_CUSTOM_TARGETING, + CANNOT_TARGET_AUDIENCE_SEGMENT, + CANNOT_TARGET_INACTIVE_AUDIENCE_SEGMENT, + INVALID_AUDIENCE_SEGMENTS, + ONLY_APPROVED_AUDIENCE_SEGMENTS_CAN_BE_TARGETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CustomFieldValueError : ApiError { + private CustomFieldValueErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomFieldValueErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomFieldValueError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CustomFieldValueErrorReason { + CUSTOM_FIELD_NOT_FOUND, + CUSTOM_FIELD_INACTIVE, + CUSTOM_FIELD_OPTION_NOT_FOUND, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CreativeError : ApiError { + private CreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CreativeErrorReason { + FLASH_AND_FALLBACK_URL_ARE_SAME, + INVALID_INTERNAL_REDIRECT_URL, + DESTINATION_URL_REQUIRED, + CANNOT_CREATE_OR_UPDATE_LEGACY_DFP_CREATIVE, + CANNOT_CREATE_OR_UPDATE_LEGACY_DFP_MOBILE_CREATIVE, + MISSING_FEATURE, + INVALID_COMPANY_TYPE, + INVALID_ADSENSE_CREATIVE_SIZE, + INVALID_AD_EXCHANGE_CREATIVE_SIZE, + DUPLICATE_ASSET_IN_CREATIVE, + CREATIVE_ASSET_CANNOT_HAVE_ID_AND_BYTE_ARRAY, + CANNOT_CREATE_OR_UPDATE_UNSUPPORTED_CREATIVE, + CANNOT_COPY_VIDEO_CREATIVE_ACROSS_ADVERTISERS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ContentMetadataTargetingError : ApiError { + private ContentMetadataTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ContentMetadataTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ContentMetadataTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ContentMetadataTargetingErrorReason { + VALUES_DO_NOT_BELONG_TO_A_HIERARCHY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CompanyCreditStatusError : ApiError { + private CompanyCreditStatusErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CompanyCreditStatusErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CompanyCreditStatusError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CompanyCreditStatusErrorReason { + COMPANY_CREDIT_STATUS_CHANGE_NOT_ALLOWED, + CANNOT_USE_CREDIT_STATUS_SETTING, + CANNOT_USE_ADVANCED_CREDIT_STATUS_SETTING, + UNACCEPTABLE_COMPANY_CREDIT_STATUS_FOR_ORDER, + UNACCEPTABLE_COMPANY_CREDIT_STATUS_FOR_LINE_ITEM, + CANNOT_BLOCK_COMPANY_TOO_MANY_APPROVED_ORDERS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ClickTrackingLineItemError : ApiError { + private ClickTrackingLineItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ClickTrackingLineItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ClickTrackingLineItemError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ClickTrackingLineItemErrorReason { + TYPE_IMMUTABLE, + INVALID_TARGETING_TYPE, + INVALID_ROADBLOCKING_TYPE, + INVALID_CREATIVEROTATION_TYPE, + INVALID_DELIVERY_RATE_TYPE, + UNSUPPORTED_FIELD, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AudienceExtensionError : ApiError { + private AudienceExtensionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AudienceExtensionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceExtensionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AudienceExtensionErrorReason { + FREQUENCY_CAPS_NOT_SUPPORTED, + INVALID_TARGETING, + INVENTORY_UNIT_TARGETING_INVALID, + INVALID_CREATIVE_ROTATION, + INVALID_EXTERNAL_ENTITY_ID, + INVALID_LINE_ITEM_TYPE, + INVALID_MAX_BID, + AUDIENCE_EXTENSION_BULK_UPDATE_NOT_ALLOWED, + UNEXPECTED_AUDIENCE_EXTENSION_ERROR, + MAX_DAILY_BUDGET_AMOUNT_EXCEEDED, + EXTERNAL_CAMPAIGN_ALREADY_EXISTS, + AUDIENCE_EXTENSION_WITHOUT_FEATURE, + AUDIENCE_EXTENSION_WITHOUT_LINKED_ACCOUNT, + CANNOT_OVERRIDE_CREATIVE_SIZE_WITH_AUDIENCE_EXTENSION, + CANNOT_OVERRIDE_FIELD_WITH_AUDIENCE_EXTENSION, + ONLY_ONE_CREATIVE_PLACEHOLDER_ALLOWED, + MULTIPLE_AUDIENCE_EXTENSION_LINE_ITEMS_ON_ORDER, + CANNOT_COPY_AUDIENCE_EXTENSION_LINE_ITEMS_AND_CREATIVES_TOGETHER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdUnitCodeError : ApiError { + private AdUnitCodeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitCodeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitCodeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AdUnitCodeErrorReason { + INVALID_CHARACTERS, + INVALID_CHARACTERS_WHEN_UTF_CHARACTERS_ARE_ALLOWED, + LEADING_FORWARD_SLASH, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdUnitAfcSizeError : ApiError { + private AdUnitAfcSizeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitAfcSizeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitAfcSizeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AdUnitAfcSizeErrorReason { + INVALID, + DOESNT_FIT, + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CompanyServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CompanyService : DfpSoapClient, ICompanyService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CompanyService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/CompanyService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Company[] createCompanies([System.Xml.Serialization.XmlElementAttribute("companies")] +Company[] companies) { + object[] results = this.Invoke("createCompanies", new object[] { companies }); + return ((Company[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Company createCompany(Company company) { + object[] results = this.Invoke("createCompany", new object[] { company }); + return ((Company) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CompanyPage getCompaniesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCompaniesByStatement", new object[] { filterStatement }); + return ((CompanyPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Company getCompany(long companyId) { + object[] results = this.Invoke("getCompany", new object[] { companyId }); + return ((Company) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Company[] updateCompanies([System.Xml.Serialization.XmlElementAttribute("companies")] +Company[] companies) { + object[] results = this.Invoke("updateCompanies", new object[] { companies }); + return ((Company[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Company updateCompany(Company company) { + object[] results = this.Invoke("updateCompany", new object[] { company }); + return ((Company) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CompanyPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Company[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Company[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Company { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private CompanyType typeField; + + private bool typeFieldSpecified; + + private string addressField; + + private string emailField; + + private string faxPhoneField; + + private string primaryPhoneField; + + private string externalIdField; + + private string commentField; + + private CompanyCreditStatus creditStatusField; + + private bool creditStatusFieldSpecified; + + private AppliedLabel[] appliedLabelsField; + + private bool enableSameAdvertiserCompetitiveExclusionField; + + private bool enableSameAdvertiserCompetitiveExclusionFieldSpecified; + + private long primaryContactIdField; + + private bool primaryContactIdFieldSpecified; + + private long[] appliedTeamIdsField; + + private int thirdPartyCompanyIdField; + + private bool thirdPartyCompanyIdFieldSpecified; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public CompanyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public string address { + get { return this.addressField; } + set { this.addressField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public string faxPhone { + get { return this.faxPhoneField; } + set { this.faxPhoneField = value; } + } + + public string primaryPhone { + get { return this.primaryPhoneField; } + set { this.primaryPhoneField = value; } + } + + public string externalId { + get { return this.externalIdField; } + set { this.externalIdField = value; } + } + + public string comment { + get { return this.commentField; } + set { this.commentField = value; } + } + + public CompanyCreditStatus creditStatus { + get { return this.creditStatusField; } + set { + this.creditStatusField = value; + this.creditStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creditStatusSpecified { + get { return this.creditStatusFieldSpecified; } + set { this.creditStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + public bool enableSameAdvertiserCompetitiveExclusion { + get { return this.enableSameAdvertiserCompetitiveExclusionField; } + set { + this.enableSameAdvertiserCompetitiveExclusionField = value; + this.enableSameAdvertiserCompetitiveExclusionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool enableSameAdvertiserCompetitiveExclusionSpecified { + get { return this.enableSameAdvertiserCompetitiveExclusionFieldSpecified; } + set { this.enableSameAdvertiserCompetitiveExclusionFieldSpecified = value; } + } + + public long primaryContactId { + get { return this.primaryContactIdField; } + set { + this.primaryContactIdField = value; + this.primaryContactIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool primaryContactIdSpecified { + get { return this.primaryContactIdFieldSpecified; } + set { this.primaryContactIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public int thirdPartyCompanyId { + get { return this.thirdPartyCompanyIdField; } + set { + this.thirdPartyCompanyIdField = value; + this.thirdPartyCompanyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyCompanyIdSpecified { + get { return this.thirdPartyCompanyIdFieldSpecified; } + set { this.thirdPartyCompanyIdFieldSpecified = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Company.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CompanyType { + HOUSE_ADVERTISER, + HOUSE_AGENCY, + ADVERTISER, + AGENCY, + AD_NETWORK, + AFFILIATE_DISTRIBUTION_PARTNER, + CONTENT_PARTNER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Company.CreditStatus", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CompanyCreditStatus { + ACTIVE, + ON_HOLD, + CREDIT_STOP, + INACTIVE, + BLOCKED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class InvalidEmailError : ApiError { + private InvalidEmailErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidEmailErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidEmailError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum InvalidEmailErrorReason { + INVALID_FORMAT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CompanyError : ApiError { + private CompanyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CompanyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CompanyError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CompanyErrorReason { + CANNOT_SET_THIRD_PARTY_COMPANY_DUE_TO_TYPE, + CANNOT_UPDATE_COMPANY_TYPE, + INVALID_COMPANY_TYPE, + PRIMARY_CONTACT_DOES_NOT_BELONG_TO_THIS_COMPANY, + THIRD_PARTY_STATS_PROVIDER_IS_WRONG_ROLE_TYPE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdRuleServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdRuleService : DfpSoapClient, IAdRuleService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdRuleService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/AdRuleService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRule createAdRule(AdRule adRule) { + object[] results = this.Invoke("createAdRule", new object[] { adRule }); + return ((AdRule) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRule[] createAdRules([System.Xml.Serialization.XmlElementAttribute("adRules")] +AdRule[] adRules) { + object[] results = this.Invoke("createAdRules", new object[] { adRules }); + return ((AdRule[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRule getAdRule(int adRuleId) { + object[] results = this.Invoke("getAdRule", new object[] { adRuleId }); + return ((AdRule) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRulePage getAdRulesByStatement(Statement statement) { + object[] results = this.Invoke("getAdRulesByStatement", new object[] { statement }); + return ((AdRulePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performAdRuleAction(AdRuleAction adRuleAction, Statement filterStatement) { + object[] results = this.Invoke("performAdRuleAction", new object[] { adRuleAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRule updateAdRule(AdRule adRule) { + object[] results = this.Invoke("updateAdRule", new object[] { adRule }); + return ((AdRule) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRule[] updateAdRules([System.Xml.Serialization.XmlElementAttribute("adRules")] +AdRule[] adRules) { + object[] results = this.Invoke("updateAdRules", new object[] { adRules }); + return ((AdRule[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteAdRules))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateAdRules))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateAdRules))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class AdRuleAction { + private string adRuleActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AdRuleAction.Type")] + public string AdRuleActionType { + get { return this.adRuleActionTypeField; } + set { this.adRuleActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeleteAdRules : AdRuleAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeactivateAdRules : AdRuleAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ActivateAdRules : AdRuleAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdRulePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AdRule[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AdRule[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdRule { + private int idField; + + private bool idFieldSpecified; + + private string nameField; + + private int priorityField; + + private bool priorityFieldSpecified; + + private Targeting targetingField; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private AdRuleStatus statusField; + + private bool statusFieldSpecified; + + private FrequencyCapBehavior frequencyCapBehaviorField; + + private bool frequencyCapBehaviorFieldSpecified; + + private int maxImpressionsPerLineItemPerStreamField; + + private bool maxImpressionsPerLineItemPerStreamFieldSpecified; + + private int maxImpressionsPerLineItemPerPodField; + + private bool maxImpressionsPerLineItemPerPodFieldSpecified; + + private BaseAdRuleSlot prerollField; + + private BaseAdRuleSlot midrollField; + + private BaseAdRuleSlot postrollField; + + public int id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + public Targeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public AdRuleStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public FrequencyCapBehavior frequencyCapBehavior { + get { return this.frequencyCapBehaviorField; } + set { + this.frequencyCapBehaviorField = value; + this.frequencyCapBehaviorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool frequencyCapBehaviorSpecified { + get { return this.frequencyCapBehaviorFieldSpecified; } + set { this.frequencyCapBehaviorFieldSpecified = value; } + } + + public int maxImpressionsPerLineItemPerStream { + get { return this.maxImpressionsPerLineItemPerStreamField; } + set { + this.maxImpressionsPerLineItemPerStreamField = value; + this.maxImpressionsPerLineItemPerStreamSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxImpressionsPerLineItemPerStreamSpecified { + get { return this.maxImpressionsPerLineItemPerStreamFieldSpecified; } + set { this.maxImpressionsPerLineItemPerStreamFieldSpecified = value; } + } + + public int maxImpressionsPerLineItemPerPod { + get { return this.maxImpressionsPerLineItemPerPodField; } + set { + this.maxImpressionsPerLineItemPerPodField = value; + this.maxImpressionsPerLineItemPerPodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxImpressionsPerLineItemPerPodSpecified { + get { return this.maxImpressionsPerLineItemPerPodFieldSpecified; } + set { this.maxImpressionsPerLineItemPerPodFieldSpecified = value; } + } + + public BaseAdRuleSlot preroll { + get { return this.prerollField; } + set { this.prerollField = value; } + } + + public BaseAdRuleSlot midroll { + get { return this.midrollField; } + set { this.midrollField = value; } + } + + public BaseAdRuleSlot postroll { + get { return this.postrollField; } + set { this.postrollField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AdRuleStatus { + ACTIVE, + INACTIVE, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum FrequencyCapBehavior { + TURN_ON, + TURN_OFF, + DEFER, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnknownAdRuleSlot))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StandardPoddingAdRuleSlot))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OptimizedPoddingAdRuleSlot))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NoPoddingAdRuleSlot))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class BaseAdRuleSlot { + private long idField; + + private bool idFieldSpecified; + + private AdRuleSlotBehavior slotBehaviorField; + + private bool slotBehaviorFieldSpecified; + + private long minVideoAdDurationField; + + private bool minVideoAdDurationFieldSpecified; + + private long maxVideoAdDurationField; + + private bool maxVideoAdDurationFieldSpecified; + + private MidrollFrequencyType videoMidrollFrequencyTypeField; + + private bool videoMidrollFrequencyTypeFieldSpecified; + + private string videoMidrollFrequencyField; + + private AdRuleSlotBumper bumperField; + + private bool bumperFieldSpecified; + + private long maxBumperDurationField; + + private bool maxBumperDurationFieldSpecified; + + private long minPodDurationField; + + private bool minPodDurationFieldSpecified; + + private long maxPodDurationField; + + private bool maxPodDurationFieldSpecified; + + private int maxAdsInPodField; + + private bool maxAdsInPodFieldSpecified; + + private string baseAdRuleSlotTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public AdRuleSlotBehavior slotBehavior { + get { return this.slotBehaviorField; } + set { + this.slotBehaviorField = value; + this.slotBehaviorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool slotBehaviorSpecified { + get { return this.slotBehaviorFieldSpecified; } + set { this.slotBehaviorFieldSpecified = value; } + } + + public long minVideoAdDuration { + get { return this.minVideoAdDurationField; } + set { + this.minVideoAdDurationField = value; + this.minVideoAdDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minVideoAdDurationSpecified { + get { return this.minVideoAdDurationFieldSpecified; } + set { this.minVideoAdDurationFieldSpecified = value; } + } + + public long maxVideoAdDuration { + get { return this.maxVideoAdDurationField; } + set { + this.maxVideoAdDurationField = value; + this.maxVideoAdDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxVideoAdDurationSpecified { + get { return this.maxVideoAdDurationFieldSpecified; } + set { this.maxVideoAdDurationFieldSpecified = value; } + } + + public MidrollFrequencyType videoMidrollFrequencyType { + get { return this.videoMidrollFrequencyTypeField; } + set { + this.videoMidrollFrequencyTypeField = value; + this.videoMidrollFrequencyTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoMidrollFrequencyTypeSpecified { + get { return this.videoMidrollFrequencyTypeFieldSpecified; } + set { this.videoMidrollFrequencyTypeFieldSpecified = value; } + } + + public string videoMidrollFrequency { + get { return this.videoMidrollFrequencyField; } + set { this.videoMidrollFrequencyField = value; } + } + + public AdRuleSlotBumper bumper { + get { return this.bumperField; } + set { + this.bumperField = value; + this.bumperSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bumperSpecified { + get { return this.bumperFieldSpecified; } + set { this.bumperFieldSpecified = value; } + } + + public long maxBumperDuration { + get { return this.maxBumperDurationField; } + set { + this.maxBumperDurationField = value; + this.maxBumperDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxBumperDurationSpecified { + get { return this.maxBumperDurationFieldSpecified; } + set { this.maxBumperDurationFieldSpecified = value; } + } + + public long minPodDuration { + get { return this.minPodDurationField; } + set { + this.minPodDurationField = value; + this.minPodDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minPodDurationSpecified { + get { return this.minPodDurationFieldSpecified; } + set { this.minPodDurationFieldSpecified = value; } + } + + public long maxPodDuration { + get { return this.maxPodDurationField; } + set { + this.maxPodDurationField = value; + this.maxPodDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxPodDurationSpecified { + get { return this.maxPodDurationFieldSpecified; } + set { this.maxPodDurationFieldSpecified = value; } + } + + public int maxAdsInPod { + get { return this.maxAdsInPodField; } + set { + this.maxAdsInPodField = value; + this.maxAdsInPodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxAdsInPodSpecified { + get { return this.maxAdsInPodFieldSpecified; } + set { this.maxAdsInPodFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseAdRuleSlot.Type")] + public string BaseAdRuleSlotType { + get { return this.baseAdRuleSlotTypeField; } + set { this.baseAdRuleSlotTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AdRuleSlotBehavior { + ALWAYS_SHOW, + NEVER_SHOW, + DEFER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum MidrollFrequencyType { + NONE, + EVERY_N_SECONDS, + FIXED_TIME, + EVERY_N_CUEPOINTS, + FIXED_CUE_POINTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AdRuleSlotBumper { + NONE, + BEFORE, + AFTER, + BEFORE_AND_AFTER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class UnknownAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class StandardPoddingAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class OptimizedPoddingAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class NoPoddingAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class PoddingError : ApiError { + private PoddingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PoddingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PoddingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum PoddingErrorReason { + INVALID_PODDING_TYPE_NONE, + INVALID_PODDING_TYPE_STANDARD, + INVALID_OPTIMIZED_POD_WITHOUT_DURATION, + INVALID_OPTIMIZED_POD_WITHOUT_ADS, + INVALID_POD_DURATION_RANGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdRuleSlotError : ApiError { + private AdRuleSlotErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRuleSlotErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRuleSlotError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AdRuleSlotErrorReason { + DIFFERENT_STATUS_THAN_AD_RULE, + INVALID_VIDEO_AD_DURATION_RANGE, + INVALID_VIDEO_MIDROLL_FREQUENCY_TYPE, + MALFORMED_VIDEO_MIDROLL_FREQUENCY_CSV, + MALFORMED_VIDEO_MIDROLL_FREQUENCY_SINGLE_NUMBER, + INVALID_OVERLAY_AD_DURATION_RANGE, + INVALID_OVERLAY_MIDROLL_FREQUENCY_TYPE, + MALFORMED_OVERLAY_MIDROLL_FREQUENCY_CSV, + MALFORMED_OVERLAY_MIDROLL_FREQUENCY_SINGLE_NUMBER, + INVALID_BUMPER_MAX_DURATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdRulePriorityError : ApiError { + private AdRulePriorityErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRulePriorityErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRulePriorityError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AdRulePriorityErrorReason { + DUPLICATE_PRIORITY, + PRIORITIES_NOT_SEQUENTIAL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdRuleFrequencyCapError : ApiError { + private AdRuleFrequencyCapErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRuleFrequencyCapErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRuleFrequencyCapError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AdRuleFrequencyCapErrorReason { + NO_FREQUENCY_CAPS_SPECIFIED_WHEN_FREQUENCY_CAPS_TURNED_ON, + FREQUENCY_CAPS_SPECIFIED_WHEN_FREQUENCY_CAPS_TURNED_OFF, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdRuleDateError : ApiError { + private AdRuleDateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRuleDateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRuleDateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AdRuleDateErrorReason { + START_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_NOT_AFTER_START_TIME, + END_DATE_TIME_TOO_LATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "UserServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserRecord))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class UserService : DfpSoapClient, IUserService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public UserService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/UserService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User createUser(User user) { + object[] results = this.Invoke("createUser", new object[] { user }); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User[] createUsers([System.Xml.Serialization.XmlElementAttribute("users")] +User[] users) { + object[] results = this.Invoke("createUsers", new object[] { users }); + return ((User[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Role[] getAllRoles() { + object[] results = this.Invoke("getAllRoles", new object[0]); + return ((Role[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User getCurrentUser() { + object[] results = this.Invoke("getCurrentUser", new object[0]); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User getUser(long userId) { + object[] results = this.Invoke("getUser", new object[] { userId }); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserPage getUsersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getUsersByStatement", new object[] { filterStatement }); + return ((UserPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performUserAction(UserAction userAction, Statement filterStatement) { + object[] results = this.Invoke("performUserAction", new object[] { userAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User updateUser(User user) { + object[] results = this.Invoke("updateUser", new object[] { user }); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User[] updateUsers([System.Xml.Serialization.XmlElementAttribute("users")] +User[] users) { + object[] results = this.Invoke("updateUsers", new object[] { users }); + return ((User[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateUsers))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateUsers))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class UserAction { + private string userActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("UserAction.Type")] + public string UserActionType { + get { return this.userActionTypeField; } + set { this.userActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeactivateUsers : UserAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ActivateUsers : UserAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class UserPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private User[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public User[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class User : UserRecord { + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private bool isEmailNotificationAllowedField; + + private bool isEmailNotificationAllowedFieldSpecified; + + private string externalIdField; + + private string ordersUiLocalTimeZoneIdField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + public bool isEmailNotificationAllowed { + get { return this.isEmailNotificationAllowedField; } + set { + this.isEmailNotificationAllowedField = value; + this.isEmailNotificationAllowedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isEmailNotificationAllowedSpecified { + get { return this.isEmailNotificationAllowedFieldSpecified; } + set { this.isEmailNotificationAllowedFieldSpecified = value; } + } + + public string externalId { + get { return this.externalIdField; } + set { this.externalIdField = value; } + } + + public string ordersUiLocalTimeZoneId { + get { return this.ordersUiLocalTimeZoneIdField; } + set { this.ordersUiLocalTimeZoneIdField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(User))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class UserRecord { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string emailField; + + private long roleIdField; + + private bool roleIdFieldSpecified; + + private string roleNameField; + + private string preferredLocaleField; + + private string userRecordTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public long roleId { + get { return this.roleIdField; } + set { + this.roleIdField = value; + this.roleIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roleIdSpecified { + get { return this.roleIdFieldSpecified; } + set { this.roleIdFieldSpecified = value; } + } + + public string roleName { + get { return this.roleNameField; } + set { this.roleNameField = value; } + } + + public string preferredLocale { + get { return this.preferredLocaleField; } + set { this.preferredLocaleField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("UserRecord.Type")] + public string UserRecordType { + get { return this.userRecordTypeField; } + set { this.userRecordTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Role { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LineItemServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LineItemService : DfpSoapClient, ILineItemService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LineItemService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/LineItemService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItem createLineItem(LineItem lineItem) { + object[] results = this.Invoke("createLineItem", new object[] { lineItem }); + return ((LineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItem[] createLineItems([System.Xml.Serialization.XmlElementAttribute("lineItems")] +LineItem[] lineItems) { + object[] results = this.Invoke("createLineItems", new object[] { lineItems }); + return ((LineItem[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItem getLineItem(long lineItemId) { + object[] results = this.Invoke("getLineItem", new object[] { lineItemId }); + return ((LineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemPage getLineItemsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLineItemsByStatement", new object[] { filterStatement }); + return ((LineItemPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performLineItemAction(LineItemAction lineItemAction, Statement filterStatement) { + object[] results = this.Invoke("performLineItemAction", new object[] { lineItemAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItem updateLineItem(LineItem lineItem) { + object[] results = this.Invoke("updateLineItem", new object[] { lineItem }); + return ((LineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItem[] updateLineItems([System.Xml.Serialization.XmlElementAttribute("lineItems")] +LineItem[] lineItems) { + object[] results = this.Invoke("updateLineItems", new object[] { lineItems }); + return ((LineItem[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveAndOverbookLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReleaseLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PauseLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class LineItemAction { + private string lineItemActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LineItemAction.Type")] + public string LineItemActionType { + get { return this.lineItemActionTypeField; } + set { this.lineItemActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class UnarchiveLineItems : LineItemAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ResumeLineItems : LineItemAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ResumeAndOverbookLineItems : ResumeLineItems { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveAndOverbookLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ReserveLineItems : LineItemAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ReserveAndOverbookLineItems : ReserveLineItems { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ReleaseLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class PauseLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeleteLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ArchiveLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ActivateLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class LineItemPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LineItem[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LineItem[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "RateCardCustomizationServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class RateCardCustomizationService : DfpSoapClient, IRateCardCustomizationService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public RateCardCustomizationService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/RateCardCustomizationService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomization createRateCardCustomization(RateCardCustomization rateCardCustomization) { + object[] results = this.Invoke("createRateCardCustomization", new object[] { rateCardCustomization }); + return ((RateCardCustomization) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomization[] createRateCardCustomizations([System.Xml.Serialization.XmlElementAttribute("rateCardCustomizations")] +RateCardCustomization[] rateCardCustomizations) { + object[] results = this.Invoke("createRateCardCustomizations", new object[] { rateCardCustomizations }); + return ((RateCardCustomization[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomization getRateCardCustomization(long rateCardCustomizationId) { + object[] results = this.Invoke("getRateCardCustomization", new object[] { rateCardCustomizationId }); + return ((RateCardCustomization) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomizationPage getRateCardCustomizationsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getRateCardCustomizationsByStatement", new object[] { filterStatement }); + return ((RateCardCustomizationPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performRateCardCustomizationAction(RateCardCustomizationAction rateCardCustomizationAction, Statement filterStatement) { + object[] results = this.Invoke("performRateCardCustomizationAction", new object[] { rateCardCustomizationAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomization updateRateCardCustomization(RateCardCustomization rateCardCustomization) { + object[] results = this.Invoke("updateRateCardCustomization", new object[] { rateCardCustomization }); + return ((RateCardCustomization) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomization[] updateRateCardCustomizations([System.Xml.Serialization.XmlElementAttribute("rateCardCustomizations")] +RateCardCustomization[] rateCardCustomizations) { + object[] results = this.Invoke("updateRateCardCustomizations", new object[] { rateCardCustomizations }); + return ((RateCardCustomization[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateRateCardCustomizations))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateRateCardCustomizations))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class RateCardCustomizationAction { + private string rateCardCustomizationActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("RateCardCustomizationAction.Type")] + public string RateCardCustomizationActionType { + get { return this.rateCardCustomizationActionTypeField; } + set { this.rateCardCustomizationActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeactivateRateCardCustomizations : RateCardCustomizationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ActivateRateCardCustomizations : RateCardCustomizationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RateCardCustomizationPage { + private RateCardCustomization[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public RateCardCustomization[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RateCardCustomization { + private long rateCardIdField; + + private bool rateCardIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private RateCardCustomizationStatus statusField; + + private bool statusFieldSpecified; + + private RateCardFeature rateCardFeatureField; + + private RateCardCustomizationAdjustmentType adjustmentTypeField; + + private bool adjustmentTypeFieldSpecified; + + private long adjustmentSizeField; + + private bool adjustmentSizeFieldSpecified; + + private RateType rateTypeField; + + private bool rateTypeFieldSpecified; + + public long rateCardId { + get { return this.rateCardIdField; } + set { + this.rateCardIdField = value; + this.rateCardIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardIdSpecified { + get { return this.rateCardIdFieldSpecified; } + set { this.rateCardIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public RateCardCustomizationStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public RateCardFeature rateCardFeature { + get { return this.rateCardFeatureField; } + set { this.rateCardFeatureField = value; } + } + + public RateCardCustomizationAdjustmentType adjustmentType { + get { return this.adjustmentTypeField; } + set { + this.adjustmentTypeField = value; + this.adjustmentTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adjustmentTypeSpecified { + get { return this.adjustmentTypeFieldSpecified; } + set { this.adjustmentTypeFieldSpecified = value; } + } + + public long adjustmentSize { + get { return this.adjustmentSizeField; } + set { + this.adjustmentSizeField = value; + this.adjustmentSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adjustmentSizeSpecified { + get { return this.adjustmentSizeFieldSpecified; } + set { this.adjustmentSizeFieldSpecified = value; } + } + + public RateType rateType { + get { return this.rateTypeField; } + set { + this.rateTypeField = value; + this.rateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateTypeSpecified { + get { return this.rateTypeFieldSpecified; } + set { this.rateTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum RateCardCustomizationStatus { + ACTIVE, + INACTIVE, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserDomainRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnknownRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystemRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GeographyRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FrequencyCapRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomTargetingRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BrowserLanguageRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BrowserRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BandwidthRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitRateCardFeature))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class RateCardFeature { + private string rateCardFeatureTypeField; + + [System.Xml.Serialization.XmlElementAttribute("RateCardFeature.Type")] + public string RateCardFeatureType { + get { return this.rateCardFeatureTypeField; } + set { this.rateCardFeatureTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class UserDomainRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class UnknownRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class PlacementRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class OperatingSystemRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class GeographyRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class FrequencyCapRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CustomTargetingRateCardFeature : RateCardFeature { + private long customTargetingKeyIdField; + + private bool customTargetingKeyIdFieldSpecified; + + private long customTargetingValueIdField; + + private bool customTargetingValueIdFieldSpecified; + + public long customTargetingKeyId { + get { return this.customTargetingKeyIdField; } + set { + this.customTargetingKeyIdField = value; + this.customTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customTargetingKeyIdSpecified { + get { return this.customTargetingKeyIdFieldSpecified; } + set { this.customTargetingKeyIdFieldSpecified = value; } + } + + public long customTargetingValueId { + get { return this.customTargetingValueIdField; } + set { + this.customTargetingValueIdField = value; + this.customTargetingValueIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customTargetingValueIdSpecified { + get { return this.customTargetingValueIdFieldSpecified; } + set { this.customTargetingValueIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class BrowserLanguageRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class BrowserRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class BandwidthRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdUnitRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum RateCardCustomizationAdjustmentType { + PERCENTAGE, + ABSOLUTE_VALUE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum RateType { + CPM, + CPC, + CPD, + CPU, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RateCardCustomizationError : ApiError { + private RateCardCustomizationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RateCardCustomizationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RateCardCustomizationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum RateCardCustomizationErrorReason { + INVALID_RATE_TYPE, + UNSUPPORTED_OPERATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeTemplateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeTemplateService : DfpSoapClient, ICreativeTemplateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeTemplateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/CreativeTemplateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeTemplate getCreativeTemplate(long creativeTemplateId) { + object[] results = this.Invoke("getCreativeTemplate", new object[] { creativeTemplateId }); + return ((CreativeTemplate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeTemplatePage getCreativeTemplatesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativeTemplatesByStatement", new object[] { filterStatement }); + return ((CreativeTemplatePage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CreativeTemplatePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeTemplate[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeTemplate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CreativeTemplate { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private CreativeTemplateVariable[] variablesField; + + private CreativeTemplateStatus statusField; + + private bool statusFieldSpecified; + + private CreativeTemplateType typeField; + + private bool typeFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("variables")] + public CreativeTemplateVariable[] variables { + get { return this.variablesField; } + set { this.variablesField = value; } + } + + public CreativeTemplateStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public CreativeTemplateType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UrlCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListStringCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetCreativeTemplateVariable))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class CreativeTemplateVariable { + private string labelField; + + private string uniqueNameField; + + private string descriptionField; + + private bool isRequiredField; + + private bool isRequiredFieldSpecified; + + private string creativeTemplateVariableTypeField; + + public string label { + get { return this.labelField; } + set { this.labelField = value; } + } + + public string uniqueName { + get { return this.uniqueNameField; } + set { this.uniqueNameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isRequired { + get { return this.isRequiredField; } + set { + this.isRequiredField = value; + this.isRequiredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isRequiredSpecified { + get { return this.isRequiredFieldSpecified; } + set { this.isRequiredFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("CreativeTemplateVariable.Type")] + public string CreativeTemplateVariableType { + get { return this.creativeTemplateVariableTypeField; } + set { this.creativeTemplateVariableTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class UrlCreativeTemplateVariable : CreativeTemplateVariable { + private string defaultValueField; + + private bool isTrackingUrlField; + + private bool isTrackingUrlFieldSpecified; + + public string defaultValue { + get { return this.defaultValueField; } + set { this.defaultValueField = value; } + } + + public bool isTrackingUrl { + get { return this.isTrackingUrlField; } + set { + this.isTrackingUrlField = value; + this.isTrackingUrlSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTrackingUrlSpecified { + get { return this.isTrackingUrlFieldSpecified; } + set { this.isTrackingUrlFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListStringCreativeTemplateVariable))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class StringCreativeTemplateVariable : CreativeTemplateVariable { + private string defaultValueField; + + public string defaultValue { + get { return this.defaultValueField; } + set { this.defaultValueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ListStringCreativeTemplateVariable : StringCreativeTemplateVariable { + private ListStringCreativeTemplateVariableVariableChoice[] choicesField; + + private bool allowOtherChoiceField; + + private bool allowOtherChoiceFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("choices")] + public ListStringCreativeTemplateVariableVariableChoice[] choices { + get { return this.choicesField; } + set { this.choicesField = value; } + } + + public bool allowOtherChoice { + get { return this.allowOtherChoiceField; } + set { + this.allowOtherChoiceField = value; + this.allowOtherChoiceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowOtherChoiceSpecified { + get { return this.allowOtherChoiceFieldSpecified; } + set { this.allowOtherChoiceFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ListStringCreativeTemplateVariable.VariableChoice", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ListStringCreativeTemplateVariableVariableChoice { + private string labelField; + + private string valueField; + + public string label { + get { return this.labelField; } + set { this.labelField = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class LongCreativeTemplateVariable : CreativeTemplateVariable { + private long defaultValueField; + + private bool defaultValueFieldSpecified; + + public long defaultValue { + get { return this.defaultValueField; } + set { + this.defaultValueField = value; + this.defaultValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool defaultValueSpecified { + get { return this.defaultValueFieldSpecified; } + set { this.defaultValueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AssetCreativeTemplateVariable : CreativeTemplateVariable { + private AssetCreativeTemplateVariableMimeType[] mimeTypesField; + + [System.Xml.Serialization.XmlElementAttribute("mimeTypes")] + public AssetCreativeTemplateVariableMimeType[] mimeTypes { + get { return this.mimeTypesField; } + set { this.mimeTypesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AssetCreativeTemplateVariable.MimeType", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AssetCreativeTemplateVariableMimeType { + JPG, + PNG, + GIF, + SWF + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CreativeTemplateStatus { + ACTIVE, + INACTIVE, + DELETED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CreativeTemplateType { + SYSTEM_DEFINED, + USER_DEFINED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CreativeTemplateError : ApiError { + private CreativeTemplateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeTemplateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeTemplateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CreativeTemplateErrorReason { + CANNOT_PARSE_CREATIVE_TEMPLATE, + VARIABLE_DUPLICATE_UNIQUE_NAME, + VARIABLE_INVALID_UNIQUE_NAME, + LIST_CHOICE_DUPLICATE_VALUE, + LIST_CHOICE_NEEDS_DEFAULT, + LIST_CHOICES_EMPTY, + NO_TARGET_PLATFORMS, + MULTIPLE_TARGET_PLATFORMS, + UNRECOGNIZED_PLACEHOLDER, + PLACEHOLDERS_NOT_IN_FORMATTER, + MISSING_INTERSTITIAL_MACRO, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ContentMetadataKeyHierarchyServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ContentMetadataKeyHierarchyService : DfpSoapClient, IContentMetadataKeyHierarchyService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ContentMetadataKeyHierarchyService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/ContentMetadataKeyHierarchyServ" + "ice"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContentMetadataKeyHierarchyPage getContentMetadataKeyHierarchiesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getContentMetadataKeyHierarchiesByStatement", new object[] { filterStatement }); + return ((ContentMetadataKeyHierarchyPage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ContentMetadataKeyHierarchyLevel { + private long customTargetingKeyIdField; + + private bool customTargetingKeyIdFieldSpecified; + + private int hierarchyLevelField; + + private bool hierarchyLevelFieldSpecified; + + public long customTargetingKeyId { + get { return this.customTargetingKeyIdField; } + set { + this.customTargetingKeyIdField = value; + this.customTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customTargetingKeyIdSpecified { + get { return this.customTargetingKeyIdFieldSpecified; } + set { this.customTargetingKeyIdFieldSpecified = value; } + } + + public int hierarchyLevel { + get { return this.hierarchyLevelField; } + set { + this.hierarchyLevelField = value; + this.hierarchyLevelSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hierarchyLevelSpecified { + get { return this.hierarchyLevelFieldSpecified; } + set { this.hierarchyLevelFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ContentMetadataKeyHierarchy { + private int idField; + + private bool idFieldSpecified; + + private string nameField; + + private ContentMetadataKeyHierarchyLevel[] hierarchyLevelsField; + + public int id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("hierarchyLevels")] + public ContentMetadataKeyHierarchyLevel[] hierarchyLevels { + get { return this.hierarchyLevelsField; } + set { this.hierarchyLevelsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ContentMetadataKeyHierarchyPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ContentMetadataKeyHierarchy[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ContentMetadataKeyHierarchy[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ContentMetadataKeyHierarchyError : ApiError { + private ContentMetadataKeyHierarchyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ContentMetadataKeyHierarchyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ContentMetadataKeyHierarchyError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ContentMetadataKeyHierarchyErrorReason { + LEVEL_MISSING, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomTargetingServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomTargetingService : DfpSoapClient, ICustomTargetingService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomTargetingService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/CustomTargetingService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingKey[] createCustomTargetingKeys([System.Xml.Serialization.XmlElementAttribute("keys")] +CustomTargetingKey[] keys) { + object[] results = this.Invoke("createCustomTargetingKeys", new object[] { keys }); + return ((CustomTargetingKey[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingValue[] createCustomTargetingValues([System.Xml.Serialization.XmlElementAttribute("values")] +CustomTargetingValue[] values) { + object[] results = this.Invoke("createCustomTargetingValues", new object[] { values }); + return ((CustomTargetingValue[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingKeyPage getCustomTargetingKeysByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomTargetingKeysByStatement", new object[] { filterStatement }); + return ((CustomTargetingKeyPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingValuePage getCustomTargetingValuesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomTargetingValuesByStatement", new object[] { filterStatement }); + return ((CustomTargetingValuePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performCustomTargetingKeyAction(CustomTargetingKeyAction customTargetingKeyAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomTargetingKeyAction", new object[] { customTargetingKeyAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performCustomTargetingValueAction(CustomTargetingValueAction customTargetingValueAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomTargetingValueAction", new object[] { customTargetingValueAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingKey[] updateCustomTargetingKeys([System.Xml.Serialization.XmlElementAttribute("keys")] +CustomTargetingKey[] keys) { + object[] results = this.Invoke("updateCustomTargetingKeys", new object[] { keys }); + return ((CustomTargetingKey[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingValue[] updateCustomTargetingValues([System.Xml.Serialization.XmlElementAttribute("values")] +CustomTargetingValue[] values) { + object[] results = this.Invoke("updateCustomTargetingValues", new object[] { values }); + return ((CustomTargetingValue[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteCustomTargetingValues))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class CustomTargetingValueAction { + private string customTargetingValueActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomTargetingValueAction.Type")] + public string CustomTargetingValueActionType { + get { return this.customTargetingValueActionTypeField; } + set { this.customTargetingValueActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeleteCustomTargetingValues : CustomTargetingValueAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteCustomTargetingKeys))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class CustomTargetingKeyAction { + private string customTargetingKeyActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomTargetingKeyAction.Type")] + public string CustomTargetingKeyActionType { + get { return this.customTargetingKeyActionTypeField; } + set { this.customTargetingKeyActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeleteCustomTargetingKeys : CustomTargetingKeyAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CustomTargetingValuePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomTargetingValue[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomTargetingValue[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CustomTargetingValue { + private long customTargetingKeyIdField; + + private bool customTargetingKeyIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string displayNameField; + + private CustomTargetingValueMatchType matchTypeField; + + private bool matchTypeFieldSpecified; + + public long customTargetingKeyId { + get { return this.customTargetingKeyIdField; } + set { + this.customTargetingKeyIdField = value; + this.customTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customTargetingKeyIdSpecified { + get { return this.customTargetingKeyIdFieldSpecified; } + set { this.customTargetingKeyIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public CustomTargetingValueMatchType matchType { + get { return this.matchTypeField; } + set { + this.matchTypeField = value; + this.matchTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool matchTypeSpecified { + get { return this.matchTypeFieldSpecified; } + set { this.matchTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingValue.MatchType", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CustomTargetingValueMatchType { + EXACT, + BROAD, + PREFIX, + BROAD_PREFIX, + SUFFIX, + CONTAINS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CustomTargetingKeyPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomTargetingKey[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomTargetingKey[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CustomTargetingKey { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string displayNameField; + + private CustomTargetingKeyType typeField; + + private bool typeFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public CustomTargetingKeyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingKey.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CustomTargetingKeyType { + PREDEFINED, + FREEFORM + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProductTemplateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProductTemplateService : DfpSoapClient, IProductTemplateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProductTemplateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/ProductTemplateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplate createProductTemplate(ProductTemplate productTemplate) { + object[] results = this.Invoke("createProductTemplate", new object[] { productTemplate }); + return ((ProductTemplate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplate[] createProductTemplates([System.Xml.Serialization.XmlElementAttribute("productTemplates")] +ProductTemplate[] productTemplates) { + object[] results = this.Invoke("createProductTemplates", new object[] { productTemplates }); + return ((ProductTemplate[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplate getProductTemplate(long productTemplateId) { + object[] results = this.Invoke("getProductTemplate", new object[] { productTemplateId }); + return ((ProductTemplate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplatePage getProductTemplatesByStatement(Statement statement) { + object[] results = this.Invoke("getProductTemplatesByStatement", new object[] { statement }); + return ((ProductTemplatePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performProductTemplateAction(ProductTemplateAction action, Statement filterStatement) { + object[] results = this.Invoke("performProductTemplateAction", new object[] { action, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplate updateProductTemplate(ProductTemplate productTemplate) { + object[] results = this.Invoke("updateProductTemplate", new object[] { productTemplate }); + return ((ProductTemplate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplate[] updateProductTemplates([System.Xml.Serialization.XmlElementAttribute("productTemplates")] +ProductTemplate[] productTemplates) { + object[] results = this.Invoke("updateProductTemplates", new object[] { productTemplates }); + return ((ProductTemplate[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateProductTemplates))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveProducTemplates))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateProductTemplates))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class ProductTemplateAction { + private string productTemplateActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProductTemplateAction.Type")] + public string ProductTemplateActionType { + get { return this.productTemplateActionTypeField; } + set { this.productTemplateActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeactivateProductTemplates : ProductTemplateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ArchiveProducTemplates : ProductTemplateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ActivateProductTemplates : ProductTemplateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ProductTemplatePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ProductTemplate[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ProductTemplate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ProductTemplate { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private DateTime creationDateTimeField; + + private DateTime lastModifiedDateTimeField; + + private string descriptionField; + + private string nameMacroField; + + private ProductTemplateStatus statusField; + + private bool statusFieldSpecified; + + private ProductType productTypeField; + + private bool productTypeFieldSpecified; + + private long creatorIdField; + + private bool creatorIdFieldSpecified; + + private RateType rateTypeField; + + private bool rateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int priorityField; + + private bool priorityFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private bool allowFrequencyCapsCustomizationField; + + private bool allowFrequencyCapsCustomizationFieldSpecified; + + private ProductSegmentation productSegmentationField; + + private ProductTemplateTargeting targetingField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DateTime creationDateTime { + get { return this.creationDateTimeField; } + set { this.creationDateTimeField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public string nameMacro { + get { return this.nameMacroField; } + set { this.nameMacroField = value; } + } + + public ProductTemplateStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ProductType productType { + get { return this.productTypeField; } + set { + this.productTypeField = value; + this.productTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productTypeSpecified { + get { return this.productTypeFieldSpecified; } + set { this.productTypeFieldSpecified = value; } + } + + public long creatorId { + get { return this.creatorIdField; } + set { + this.creatorIdField = value; + this.creatorIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creatorIdSpecified { + get { return this.creatorIdFieldSpecified; } + set { this.creatorIdFieldSpecified = value; } + } + + public RateType rateType { + get { return this.rateTypeField; } + set { + this.rateTypeField = value; + this.rateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateTypeSpecified { + get { return this.rateTypeFieldSpecified; } + set { this.rateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public bool allowFrequencyCapsCustomization { + get { return this.allowFrequencyCapsCustomizationField; } + set { + this.allowFrequencyCapsCustomizationField = value; + this.allowFrequencyCapsCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowFrequencyCapsCustomizationSpecified { + get { return this.allowFrequencyCapsCustomizationFieldSpecified; } + set { this.allowFrequencyCapsCustomizationFieldSpecified = value; } + } + + public ProductSegmentation productSegmentation { + get { return this.productSegmentationField; } + set { this.productSegmentationField = value; } + } + + public ProductTemplateTargeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ProductTemplateStatus { + ACTIVE, + DRAFT, + CANCELED, + ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ProductType { + DFP, + OFFLINE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ProductSegmentation { + private GeoTargeting geoSegmentField; + + private AdUnitTargeting[] adUnitSegmentsField; + + private long[] placementSegmentField; + + private UserDomainTargeting userDomainSegmentField; + + private BandwidthGroupTargeting bandwidthSegmentField; + + private BrowserTargeting browserSegmentField; + + private BrowserLanguageTargeting browserLanguageSegmentField; + + private OperatingSystemTargeting operatingSystemSegmentField; + + public GeoTargeting geoSegment { + get { return this.geoSegmentField; } + set { this.geoSegmentField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adUnitSegments")] + public AdUnitTargeting[] adUnitSegments { + get { return this.adUnitSegmentsField; } + set { this.adUnitSegmentsField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("targetedPlacementIds", IsNullable = false)] + public long[] placementSegment { + get { return this.placementSegmentField; } + set { this.placementSegmentField = value; } + } + + public UserDomainTargeting userDomainSegment { + get { return this.userDomainSegmentField; } + set { this.userDomainSegmentField = value; } + } + + public BandwidthGroupTargeting bandwidthSegment { + get { return this.bandwidthSegmentField; } + set { this.bandwidthSegmentField = value; } + } + + public BrowserTargeting browserSegment { + get { return this.browserSegmentField; } + set { this.browserSegmentField = value; } + } + + public BrowserLanguageTargeting browserLanguageSegment { + get { return this.browserLanguageSegmentField; } + set { this.browserLanguageSegmentField = value; } + } + + public OperatingSystemTargeting operatingSystemSegment { + get { return this.operatingSystemSegmentField; } + set { this.operatingSystemSegmentField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ProductTemplateTargeting { + private GeoTargeting geoTargetingField; + + private bool allowGeoTargetingCustomizationField; + + private bool allowGeoTargetingCustomizationFieldSpecified; + + private InventoryTargeting inventoryTargetingField; + + private bool allowAdUnitTargetingCustomizationField; + + private bool allowAdUnitTargetingCustomizationFieldSpecified; + + private bool allowPlacementTargetingCustomizationField; + + private bool allowPlacementTargetingCustomizationFieldSpecified; + + private long[] customizableCustomTargetingKeyIdsField; + + private UserDomainTargeting userDomainTargetingField; + + private bool allowUserDomainTargetingCustomizationField; + + private bool allowUserDomainTargetingCustomizationFieldSpecified; + + private BandwidthGroupTargeting bandwidthGroupTargetingField; + + private bool allowBandwidthGroupTargetingCustomizationField; + + private bool allowBandwidthGroupTargetingCustomizationFieldSpecified; + + private BrowserTargeting browserTargetingField; + + private bool allowBrowserTargetingCustomizationField; + + private bool allowBrowserTargetingCustomizationFieldSpecified; + + private BrowserLanguageTargeting browserLanguageTargetingField; + + private bool allowBrowserLanguageTargetingCustomizationField; + + private bool allowBrowserLanguageTargetingCustomizationFieldSpecified; + + private OperatingSystemTargeting operatingSystemTargetingField; + + private bool allowOperatingSystemTargetingCustomizationField; + + private bool allowOperatingSystemTargetingCustomizationFieldSpecified; + + public GeoTargeting geoTargeting { + get { return this.geoTargetingField; } + set { this.geoTargetingField = value; } + } + + public bool allowGeoTargetingCustomization { + get { return this.allowGeoTargetingCustomizationField; } + set { + this.allowGeoTargetingCustomizationField = value; + this.allowGeoTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowGeoTargetingCustomizationSpecified { + get { return this.allowGeoTargetingCustomizationFieldSpecified; } + set { this.allowGeoTargetingCustomizationFieldSpecified = value; } + } + + public InventoryTargeting inventoryTargeting { + get { return this.inventoryTargetingField; } + set { this.inventoryTargetingField = value; } + } + + public bool allowAdUnitTargetingCustomization { + get { return this.allowAdUnitTargetingCustomizationField; } + set { + this.allowAdUnitTargetingCustomizationField = value; + this.allowAdUnitTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowAdUnitTargetingCustomizationSpecified { + get { return this.allowAdUnitTargetingCustomizationFieldSpecified; } + set { this.allowAdUnitTargetingCustomizationFieldSpecified = value; } + } + + public bool allowPlacementTargetingCustomization { + get { return this.allowPlacementTargetingCustomizationField; } + set { + this.allowPlacementTargetingCustomizationField = value; + this.allowPlacementTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowPlacementTargetingCustomizationSpecified { + get { return this.allowPlacementTargetingCustomizationFieldSpecified; } + set { this.allowPlacementTargetingCustomizationFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customizableCustomTargetingKeyIds")] + public long[] customizableCustomTargetingKeyIds { + get { return this.customizableCustomTargetingKeyIdsField; } + set { this.customizableCustomTargetingKeyIdsField = value; } + } + + public UserDomainTargeting userDomainTargeting { + get { return this.userDomainTargetingField; } + set { this.userDomainTargetingField = value; } + } + + public bool allowUserDomainTargetingCustomization { + get { return this.allowUserDomainTargetingCustomizationField; } + set { + this.allowUserDomainTargetingCustomizationField = value; + this.allowUserDomainTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowUserDomainTargetingCustomizationSpecified { + get { return this.allowUserDomainTargetingCustomizationFieldSpecified; } + set { this.allowUserDomainTargetingCustomizationFieldSpecified = value; } + } + + public BandwidthGroupTargeting bandwidthGroupTargeting { + get { return this.bandwidthGroupTargetingField; } + set { this.bandwidthGroupTargetingField = value; } + } + + public bool allowBandwidthGroupTargetingCustomization { + get { return this.allowBandwidthGroupTargetingCustomizationField; } + set { + this.allowBandwidthGroupTargetingCustomizationField = value; + this.allowBandwidthGroupTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowBandwidthGroupTargetingCustomizationSpecified { + get { return this.allowBandwidthGroupTargetingCustomizationFieldSpecified; } + set { this.allowBandwidthGroupTargetingCustomizationFieldSpecified = value; } + } + + public BrowserTargeting browserTargeting { + get { return this.browserTargetingField; } + set { this.browserTargetingField = value; } + } + + public bool allowBrowserTargetingCustomization { + get { return this.allowBrowserTargetingCustomizationField; } + set { + this.allowBrowserTargetingCustomizationField = value; + this.allowBrowserTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowBrowserTargetingCustomizationSpecified { + get { return this.allowBrowserTargetingCustomizationFieldSpecified; } + set { this.allowBrowserTargetingCustomizationFieldSpecified = value; } + } + + public BrowserLanguageTargeting browserLanguageTargeting { + get { return this.browserLanguageTargetingField; } + set { this.browserLanguageTargetingField = value; } + } + + public bool allowBrowserLanguageTargetingCustomization { + get { return this.allowBrowserLanguageTargetingCustomizationField; } + set { + this.allowBrowserLanguageTargetingCustomizationField = value; + this.allowBrowserLanguageTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowBrowserLanguageTargetingCustomizationSpecified { + get { return this.allowBrowserLanguageTargetingCustomizationFieldSpecified; } + set { this.allowBrowserLanguageTargetingCustomizationFieldSpecified = value; } + } + + public OperatingSystemTargeting operatingSystemTargeting { + get { return this.operatingSystemTargetingField; } + set { this.operatingSystemTargetingField = value; } + } + + public bool allowOperatingSystemTargetingCustomization { + get { return this.allowOperatingSystemTargetingCustomizationField; } + set { + this.allowOperatingSystemTargetingCustomizationField = value; + this.allowOperatingSystemTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowOperatingSystemTargetingCustomizationSpecified { + get { return this.allowOperatingSystemTargetingCustomizationFieldSpecified; } + set { this.allowOperatingSystemTargetingCustomizationFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ProductTemplateError : ApiError { + private ProductTemplateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProductTemplateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductTemplateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ProductTemplateErrorReason { + INVALID_FEATURE_EXPANDED_EXCLUSIVE, + INVALID_EXPANDED_FEATURE_DEFAULT_NOT_TARGETED, + INVALID_EXPANDED_FEATURE_DEFAULT_LOCKED, + INVALID_EXPANDED_FEATURE_VALUE_TARGETED, + INVALID_EXPANDED_FEATURE_VALUE_LOCKED, + INVALID_FEATURE_TYPE, + INVALID_ROADBLOCKING_TYPE, + INVALID_TARGETING, + INVALID_FREQUENCY_CAPS, + INVALID_TECHNOLOGY_INCLUDE_EXCLUDE, + INVALID_EXPANDED_PRODUCT_COUNT, + INVALID_TARGET_PLATFORM, + INVALID_NON_TARGETING_FEATURE, + INVALID_FEATURE_CARDINALITY_AT_LEAST_ONE, + INVALID_FEATURE_CARDINALITY_AT_MOST_ONE, + INVALID_FEATURE_CARDINALITY_EXACTLY_ONE, + INVALID_FEATURE_FOR_OFFLINE, + INVALID_RATE_TYPE_FOR_OFFLINE, + INVALID_RATE_TYPE_FOR_DFP, + INVALID_LINE_ITEM_PRIORITY, + INVALID_LINE_ITEM_TYPE, + DUPLICATED_PLACEHOLDER_IN_NAMEMACRO, + INVALID_EXPANDED_FEATURE_IN_NON_EXPANDABLE_AFFINITY, + INVALID_FEATURE_DEFAULT_TARGET_TYPE, + INVALID_FEATURE_VALUE_TARGET_TYPE, + INVALID_FEATURE_AND_VALUE_LOCK_EXCLUSIVE, + DUPLICATED_FEATURE, + DUPLICATED_CUSTOM_TARGETING_KEY, + DUPLICATED_CUSTOM_TARGETING_VALUE, + INVALID_CUSTOM_TARGETING_KEY_ID, + INVALID_CUSTOM_TARGETING_VALUE_ID, + LOCATION_CANNOT_BE_TARGETED_IF_PARENT_IS_TARGETED, + LOCATION_CANNOT_BE_EXCLUDED_IF_PARENT_IS_EXCLUDED, + LOCATION_CANNOT_BE_EXCLUDED_DIRECTLY_WHEN_HAVE_TARGETED_LOCATION, + CUSTOMIZABLE_CUSTOM_KEY_CANNOT_BE_SEGMENTED, + DUPLICATED_FEATURE_VALUE, + MISSING_EXPANDED_FEATURE_PLACEHOLDER_IN_NAMEMACRO, + MISSING_FEATURE_VALUE_OF_NAMEMACRO_PLACEHOLDER, + MISSING_FEATURE_OF_NAMEMACRO_PLACEHOLDER, + MISSING_SUBTYPE_FOR_CUSTOM_TARGETING, + COMPANION_NOT_ALLOWED, + MISSING_COMPANION, + DUPLICATED_MASTER_SIZE, + CANNOT_MODIFY_READONLY_FEATURE, + CANNOT_MODIFY_PRODUCT_TYPE, + CANNOT_ADD_SEGMENTATION, + CANNOT_REMOVE_SEGMENTATION, + CANNOT_REMOVE_VALUE_FROM_SEGMENTATION, + CANNOT_ADD_FEATURE_VALUE_FOR_CUSTOM_TARGETING, + CANNOT_MODIFY_BUILTIN_TARGETING_FEATURE, + CANNOT_UPDATE_ARCHIVED_PRODUCT_TEMPLATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ProductTemplateActionError : ApiError { + private ProductTemplateActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProductTemplateActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductTemplateActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ProductTemplateActionErrorReason { + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class BaseRateError : ApiError { + private BaseRateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BaseRateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BaseRateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum BaseRateErrorReason { + CANNOT_QUERY_BOTH_PRODUCT_TEMPLATE_ID_AND_PRODUCT_ID, + INVALID_CURRENCY_CODE, + UNSUPPORTED_OPERATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReconciliationReportServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReconciliationReportService : DfpSoapClient, IReconciliationReportService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReconciliationReportService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/ReconciliationReportService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReport getReconciliationReport(long reconciliationReportId) { + object[] results = this.Invoke("getReconciliationReport", new object[] { reconciliationReportId }); + return ((ReconciliationReport) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReportPage getReconciliationReportsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getReconciliationReportsByStatement", new object[] { filterStatement }); + return ((ReconciliationReportPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReport updateReconciliationReport(ReconciliationReport reconciliationReport) { + object[] results = this.Invoke("updateReconciliationReport", new object[] { reconciliationReport }); + return ((ReconciliationReport) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReport[] updateReconciliationReports([System.Xml.Serialization.XmlElementAttribute("reconciliationReports")] +ReconciliationReport[] reconciliationReports) { + object[] results = this.Invoke("updateReconciliationReports", new object[] { reconciliationReports }); + return ((ReconciliationReport[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ReconciliationReportPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ReconciliationReport[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ReconciliationReport[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ReconciliationReport { + private long idField; + + private bool idFieldSpecified; + + private ReconciliationReportStatus statusField; + + private bool statusFieldSpecified; + + private Date startDateField; + + private string notesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public ReconciliationReportStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public Date startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ReconciliationReportStatus { + DRAFT, + RECONCILED, + REVERTED, + PENDING, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ActivityGroupServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ActivityGroupService : DfpSoapClient, IActivityGroupService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ActivityGroupService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/ActivityGroupService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroup createActivityGroup(ActivityGroup activityGroup) { + object[] results = this.Invoke("createActivityGroup", new object[] { activityGroup }); + return ((ActivityGroup) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroup[] createActivityGroups([System.Xml.Serialization.XmlElementAttribute("activityGroups")] +ActivityGroup[] activityGroups) { + object[] results = this.Invoke("createActivityGroups", new object[] { activityGroups }); + return ((ActivityGroup[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroup getActivityGroup(int activityGroupId) { + object[] results = this.Invoke("getActivityGroup", new object[] { activityGroupId }); + return ((ActivityGroup) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroupPage getActivityGroupsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getActivityGroupsByStatement", new object[] { filterStatement }); + return ((ActivityGroupPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroup updateActivityGroup(ActivityGroup activityGroup) { + object[] results = this.Invoke("updateActivityGroup", new object[] { activityGroup }); + return ((ActivityGroup) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroup[] updateActivityGroups([System.Xml.Serialization.XmlElementAttribute("activityGroups")] +ActivityGroup[] activityGroups) { + object[] results = this.Invoke("updateActivityGroups", new object[] { activityGroups }); + return ((ActivityGroup[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ActivityGroupPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ActivityGroup[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ActivityGroup[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ActivityGroup { + private int idField; + + private bool idFieldSpecified; + + private string nameField; + + private long[] companyIdsField; + + private int impressionsLookbackField; + + private bool impressionsLookbackFieldSpecified; + + private int clicksLookbackField; + + private bool clicksLookbackFieldSpecified; + + private ActivityGroupStatus statusField; + + private bool statusFieldSpecified; + + public int id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companyIds")] + public long[] companyIds { + get { return this.companyIdsField; } + set { this.companyIdsField = value; } + } + + public int impressionsLookback { + get { return this.impressionsLookbackField; } + set { + this.impressionsLookbackField = value; + this.impressionsLookbackSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsLookbackSpecified { + get { return this.impressionsLookbackFieldSpecified; } + set { this.impressionsLookbackFieldSpecified = value; } + } + + public int clicksLookback { + get { return this.clicksLookbackField; } + set { + this.clicksLookbackField = value; + this.clicksLookbackSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clicksLookbackSpecified { + get { return this.clicksLookbackFieldSpecified; } + set { this.clicksLookbackFieldSpecified = value; } + } + + public ActivityGroupStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ActivityGroup.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ActivityGroupStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ActivityError : ApiError { + private ActivityErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ActivityErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ActivityError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ActivityErrorReason { + ACTIVITIES_FEATURE_REQUIRED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LabelServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LabelService : DfpSoapClient, ILabelService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LabelService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/LabelService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Label createLabel(Label label) { + object[] results = this.Invoke("createLabel", new object[] { label }); + return ((Label) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Label[] createLabels([System.Xml.Serialization.XmlElementAttribute("labels")] +Label[] labels) { + object[] results = this.Invoke("createLabels", new object[] { labels }); + return ((Label[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Label getLabel(long labelId) { + object[] results = this.Invoke("getLabel", new object[] { labelId }); + return ((Label) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LabelPage getLabelsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLabelsByStatement", new object[] { filterStatement }); + return ((LabelPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performLabelAction(LabelAction labelAction, Statement filterStatement) { + object[] results = this.Invoke("performLabelAction", new object[] { labelAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Label updateLabel(Label label) { + object[] results = this.Invoke("updateLabel", new object[] { label }); + return ((Label) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Label[] updateLabels([System.Xml.Serialization.XmlElementAttribute("labels")] +Label[] labels) { + object[] results = this.Invoke("updateLabels", new object[] { labels }); + return ((Label[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateLabels))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLabels))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class LabelAction { + private string labelActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LabelAction.Type")] + public string LabelActionType { + get { return this.labelActionTypeField; } + set { this.labelActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeactivateLabels : LabelAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ActivateLabels : LabelAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class LabelPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Label[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Label[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Label { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private LabelType[] typesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("types")] + public LabelType[] types { + get { return this.typesField; } + set { this.typesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum LabelType { + COMPETITIVE_EXCLUSION, + AD_UNIT_FREQUENCY_CAP, + AD_EXCLUSION, + CREATIVE_WRAPPER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class LabelError : ApiError { + private LabelErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LabelErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LabelError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum LabelErrorReason { + INVALID_PREFIX, + NAME_INVALID_CHARS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CreativeWrapperError : ApiError { + private CreativeWrapperErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeWrapperErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeWrapperError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CreativeWrapperErrorReason { + LABEL_ALREADY_ASSOCIATED_WITH_CREATIVE_WRAPPER, + INVALID_LABEL_TYPE, + UNRECOGNIZED_MACRO, + NEITHER_HEADER_NOR_FOOTER_SPECIFIED, + CANNOT_USE_CREATIVE_WRAPPER_TYPE, + CANNOT_UPDATE_LABEL_ID, + CANNOT_APPLY_TO_AD_UNIT_WITH_VIDEO_SIZES, + CANNOT_APPLY_TO_MOBILE_AD_UNIT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LineItemCreativeAssociationServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LineItemCreativeAssociationService : DfpSoapClient, ILineItemCreativeAssociationService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LineItemCreativeAssociationService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/LineItemCreativeAssociationServ" + "ice"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociation createLineItemCreativeAssociation(LineItemCreativeAssociation lineItemCreativeAssociation) { + object[] results = this.Invoke("createLineItemCreativeAssociation", new object[] { lineItemCreativeAssociation }); + return ((LineItemCreativeAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociation[] createLineItemCreativeAssociations([System.Xml.Serialization.XmlElementAttribute("lineItemCreativeAssociations")] +LineItemCreativeAssociation[] lineItemCreativeAssociations) { + object[] results = this.Invoke("createLineItemCreativeAssociations", new object[] { lineItemCreativeAssociations }); + return ((LineItemCreativeAssociation[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociation getLineItemCreativeAssociation(long lineItemId, long creativeId) { + object[] results = this.Invoke("getLineItemCreativeAssociation", new object[] { lineItemId, creativeId }); + return ((LineItemCreativeAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociationPage getLineItemCreativeAssociationsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLineItemCreativeAssociationsByStatement", new object[] { filterStatement }); + return ((LineItemCreativeAssociationPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual string getPreviewUrl(long lineItemId, long creativeId, string siteUrl) { + object[] results = this.Invoke("getPreviewUrl", new object[] { lineItemId, creativeId, siteUrl }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performLineItemCreativeAssociationAction(LineItemCreativeAssociationAction lineItemCreativeAssociationAction, Statement filterStatement) { + object[] results = this.Invoke("performLineItemCreativeAssociationAction", new object[] { lineItemCreativeAssociationAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociation updateLineItemCreativeAssociation(LineItemCreativeAssociation lineItemCreativeAssociation) { + object[] results = this.Invoke("updateLineItemCreativeAssociation", new object[] { lineItemCreativeAssociation }); + return ((LineItemCreativeAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociation[] updateLineItemCreativeAssociations([System.Xml.Serialization.XmlElementAttribute("lineItemCreativeAssociations")] +LineItemCreativeAssociation[] lineItemCreativeAssociations) { + object[] results = this.Invoke("updateLineItemCreativeAssociations", new object[] { lineItemCreativeAssociations }); + return ((LineItemCreativeAssociation[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateLineItemCreativeAssociations))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLineItemCreativeAssociations))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class LineItemCreativeAssociationAction { + private string lineItemCreativeAssociationActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LineItemCreativeAssociationAction.Type")] + public string LineItemCreativeAssociationActionType { + get { return this.lineItemCreativeAssociationActionTypeField; } + set { this.lineItemCreativeAssociationActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeactivateLineItemCreativeAssociations : LineItemCreativeAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ActivateLineItemCreativeAssociations : LineItemCreativeAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class LineItemCreativeAssociationPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LineItemCreativeAssociation[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LineItemCreativeAssociation[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class LineItemCreativeAssociation { + private long lineItemIdField; + + private bool lineItemIdFieldSpecified; + + private long creativeIdField; + + private bool creativeIdFieldSpecified; + + private long creativeSetIdField; + + private bool creativeSetIdFieldSpecified; + + private double manualCreativeRotationWeightField; + + private bool manualCreativeRotationWeightFieldSpecified; + + private int sequentialCreativeRotationIndexField; + + private bool sequentialCreativeRotationIndexFieldSpecified; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private string destinationUrlField; + + private Size[] sizesField; + + private LineItemCreativeAssociationStatus statusField; + + private bool statusFieldSpecified; + + private LineItemCreativeAssociationStats statsField; + + private DateTime lastModifiedDateTimeField; + + public long lineItemId { + get { return this.lineItemIdField; } + set { + this.lineItemIdField = value; + this.lineItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemIdSpecified { + get { return this.lineItemIdFieldSpecified; } + set { this.lineItemIdFieldSpecified = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { + this.creativeIdField = value; + this.creativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeIdSpecified { + get { return this.creativeIdFieldSpecified; } + set { this.creativeIdFieldSpecified = value; } + } + + public long creativeSetId { + get { return this.creativeSetIdField; } + set { + this.creativeSetIdField = value; + this.creativeSetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeSetIdSpecified { + get { return this.creativeSetIdFieldSpecified; } + set { this.creativeSetIdFieldSpecified = value; } + } + + public double manualCreativeRotationWeight { + get { return this.manualCreativeRotationWeightField; } + set { + this.manualCreativeRotationWeightField = value; + this.manualCreativeRotationWeightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manualCreativeRotationWeightSpecified { + get { return this.manualCreativeRotationWeightFieldSpecified; } + set { this.manualCreativeRotationWeightFieldSpecified = value; } + } + + public int sequentialCreativeRotationIndex { + get { return this.sequentialCreativeRotationIndexField; } + set { + this.sequentialCreativeRotationIndexField = value; + this.sequentialCreativeRotationIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sequentialCreativeRotationIndexSpecified { + get { return this.sequentialCreativeRotationIndexFieldSpecified; } + set { this.sequentialCreativeRotationIndexFieldSpecified = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("sizes")] + public Size[] sizes { + get { return this.sizesField; } + set { this.sizesField = value; } + } + + public LineItemCreativeAssociationStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public LineItemCreativeAssociationStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociation.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum LineItemCreativeAssociationStatus { + ACTIVE, + NOT_SERVING, + INACTIVE, + DELETED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class LineItemCreativeAssociationStats { + private Stats statsField; + + private Long_StatsMapEntry[] creativeSetStatsField; + + private Money costInOrderCurrencyField; + + public Stats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativeSetStats")] + public Long_StatsMapEntry[] creativeSetStats { + get { return this.creativeSetStatsField; } + set { this.creativeSetStatsField = value; } + } + + public Money costInOrderCurrency { + get { return this.costInOrderCurrencyField; } + set { this.costInOrderCurrencyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Long_StatsMapEntry { + private long keyField; + + private bool keyFieldSpecified; + + private Stats valueField; + + public long key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public Stats value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class TemplateInstantiatedCreativeError : ApiError { + private TemplateInstantiatedCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TemplateInstantiatedCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TemplateInstantiatedCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum TemplateInstantiatedCreativeErrorReason { + INACTIVE_CREATIVE_TEMPLATE, + FILE_TYPE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class SwiffyConversionError : ApiError { + private SwiffyConversionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SwiffyConversionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SwiffyConversionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum SwiffyConversionErrorReason { + SERVER_ERROR, + INVALID_FLASH_FILE, + UNSUPPORTED_FLASH, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RichMediaStudioCreativeError : ApiError { + private RichMediaStudioCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RichMediaStudioCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaStudioCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum RichMediaStudioCreativeErrorReason { + CREATION_NOT_ALLOWED, + UKNOWN_ERROR, + INVALID_CODE_GENERATION_REQUEST, + INVALID_CREATIVE_OBJECT, + STUDIO_CONNECTION_ERROR, + PUSHDOWN_DURATION_NOT_ALLOWED, + INVALID_POSITION, + INVALID_Z_INDEX, + INVALID_PUSHDOWN_DURATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class LineItemCreativeAssociationOperationError : ApiError { + private LineItemCreativeAssociationOperationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemCreativeAssociationOperationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociationOperationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum LineItemCreativeAssociationOperationErrorReason { + NOT_ALLOWED, + NOT_APPLICABLE, + CANNOT_ACTIVATE_INVALID_CREATIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class InvalidPhoneNumberError : ApiError { + private InvalidPhoneNumberErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidPhoneNumberErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidPhoneNumberError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum InvalidPhoneNumberErrorReason { + INVALID_FORMAT, + TOO_SHORT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ImageError : ApiError { + private ImageErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ImageErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ImageError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ImageErrorReason { + INVALID_IMAGE, + INVALID_SIZE, + UNEXPECTED_SIZE, + OVERLAY_SIZE_TOO_LARGE, + ANIMATED_NOT_ALLOWED, + ANIMATION_TOO_LONG, + CMYK_JPEG_NOT_ALLOWED, + FLASH_NOT_ALLOWED, + FLASH_WITHOUT_CLICKTAG, + ANIMATED_VISUAL_EFFECT, + FLASH_ERROR, + LAYOUT_PROBLEM, + FLASH_HAS_NETWORK_OBJECTS, + FLASH_HAS_NETWORK_METHODS, + FLASH_HAS_URL, + FLASH_HAS_MOUSE_TRACKING, + FLASH_HAS_RANDOM_NUM, + FLASH_SELF_TARGETS, + FLASH_BAD_GETURL_TARGET, + FLASH_VERSION_NOT_SUPPORTED, + FILE_TOO_LARGE, + SYSTEM_ERROR, + UNEXPECTED_PRIMARY_ASSET_DENSITY, + DUPLICATE_ASSET_DENSITY, + MISSING_DEFAULT_ASSET, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class FileError : ApiError { + private FileErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FileErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FileError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum FileErrorReason { + MISSING_CONTENTS, + SIZE_TOO_LARGE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CustomCreativeError : ApiError { + private CustomCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CustomCreativeErrorReason { + DUPLICATE_MACRO_NAME_FOR_CREATIVE, + SNIPPET_REFERENCES_MISSING_MACRO, + UNRECOGNIZED_MACRO, + CUSTOM_CREATIVE_NOT_ALLOWED, + MISSING_INTERSTITIAL_MACRO, + DUPLICATE_ASSET_IN_MACROS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CreativeSetError : ApiError { + private CreativeSetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeSetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeSetError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CreativeSetErrorReason { + VIDEO_FEATURE_REQUIRED, + CANNOT_CREATE_OR_UPDATE_VIDEO_CREATIVES, + ROADBLOCK_FEATURE_REQUIRED, + MASTER_CREATIVE_CANNOT_BE_COMPANION, + INVALID_ADVERTISER, + UPDATE_MASTER_CREATIVE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CreativeAssetMacroError : ApiError { + private CreativeAssetMacroErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeAssetMacroErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeAssetMacroError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CreativeAssetMacroErrorReason { + INVALID_MACRO_NAME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AssetError : ApiError { + private AssetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AssetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AssetError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AssetErrorReason { + NON_UNIQUE_NAME, + FILE_NAME_TOO_LONG, + FILE_SIZE_TOO_LARGE, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_CLIENT, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_HEIGHT, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_WIDTH, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_FORMAT, + INVALID_CODE_SNIPPET_PARAMETER_VALUE, + INVALID_ASSET_ID, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdSenseAccountError : ApiError { + private AdSenseAccountErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdSenseAccountErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseAccountError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AdSenseAccountErrorReason { + ASSOCIATE_ACCOUNT_API_ERROR, + GET_AD_SLOT_API_ERROR, + GET_CHANNEL_API_ERROR, + GET_BULK_ACCOUNT_STATUSES_API_ERROR, + RESEND_VERIFICATION_EMAIL_ERROR, + UNEXPECTED_API_RESPONSE_ERROR, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "TeamServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class TeamService : DfpSoapClient, ITeamService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public TeamService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/TeamService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Team createTeam(Team team) { + object[] results = this.Invoke("createTeam", new object[] { team }); + return ((Team) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Team[] createTeams([System.Xml.Serialization.XmlElementAttribute("teams")] +Team[] teams) { + object[] results = this.Invoke("createTeams", new object[] { teams }); + return ((Team[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Team getTeam(long teamId) { + object[] results = this.Invoke("getTeam", new object[] { teamId }); + return ((Team) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TeamPage getTeamsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getTeamsByStatement", new object[] { filterStatement }); + return ((TeamPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Team updateTeam(Team team) { + object[] results = this.Invoke("updateTeam", new object[] { team }); + return ((Team) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Team[] updateTeams([System.Xml.Serialization.XmlElementAttribute("teams")] +Team[] teams) { + object[] results = this.Invoke("updateTeams", new object[] { teams }); + return ((Team[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class TeamPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Team[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Team[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Team { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool hasAllCompaniesField; + + private bool hasAllCompaniesFieldSpecified; + + private bool hasAllInventoryField; + + private bool hasAllInventoryFieldSpecified; + + private TeamAccessType teamAccessTypeField; + + private bool teamAccessTypeFieldSpecified; + + private long[] companyIdsField; + + private string[] adUnitIdsField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool hasAllCompanies { + get { return this.hasAllCompaniesField; } + set { + this.hasAllCompaniesField = value; + this.hasAllCompaniesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasAllCompaniesSpecified { + get { return this.hasAllCompaniesFieldSpecified; } + set { this.hasAllCompaniesFieldSpecified = value; } + } + + public bool hasAllInventory { + get { return this.hasAllInventoryField; } + set { + this.hasAllInventoryField = value; + this.hasAllInventorySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasAllInventorySpecified { + get { return this.hasAllInventoryFieldSpecified; } + set { this.hasAllInventoryFieldSpecified = value; } + } + + public TeamAccessType teamAccessType { + get { return this.teamAccessTypeField; } + set { + this.teamAccessTypeField = value; + this.teamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool teamAccessTypeSpecified { + get { return this.teamAccessTypeFieldSpecified; } + set { this.teamAccessTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companyIds")] + public long[] companyIds { + get { return this.companyIdsField; } + set { this.companyIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adUnitIds")] + public string[] adUnitIds { + get { return this.adUnitIdsField; } + set { this.adUnitIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum TeamAccessType { + NONE, + READ_ONLY, + READ_WRITE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "InventoryServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class InventoryService : DfpSoapClient, IInventoryService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public InventoryService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/InventoryService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnit createAdUnit(AdUnit adUnit) { + object[] results = this.Invoke("createAdUnit", new object[] { adUnit }); + return ((AdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnit[] createAdUnits([System.Xml.Serialization.XmlElementAttribute("adUnits")] +AdUnit[] adUnits) { + object[] results = this.Invoke("createAdUnits", new object[] { adUnits }); + return ((AdUnit[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnit getAdUnit(string adUnitId) { + object[] results = this.Invoke("getAdUnit", new object[] { adUnitId }); + return ((AdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnitSize[] getAdUnitSizesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAdUnitSizesByStatement", new object[] { filterStatement }); + return ((AdUnitSize[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnitPage getAdUnitsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAdUnitsByStatement", new object[] { filterStatement }); + return ((AdUnitPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performAdUnitAction(AdUnitAction adUnitAction, Statement filterStatement) { + object[] results = this.Invoke("performAdUnitAction", new object[] { adUnitAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnit updateAdUnit(AdUnit adUnit) { + object[] results = this.Invoke("updateAdUnit", new object[] { adUnit }); + return ((AdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnit[] updateAdUnits([System.Xml.Serialization.XmlElementAttribute("adUnits")] +AdUnit[] adUnits) { + object[] results = this.Invoke("updateAdUnits", new object[] { adUnits }); + return ((AdUnit[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RemoveAdUnitsFromPlacement))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateAdUnits))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssignAdUnitsToPlacement))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveAdUnits))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateAdUnits))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class AdUnitAction { + private string adUnitActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AdUnitAction.Type")] + public string AdUnitActionType { + get { return this.adUnitActionTypeField; } + set { this.adUnitActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RemoveAdUnitsFromPlacement : AdUnitAction { + private long placementIdField; + + private bool placementIdFieldSpecified; + + public long placementId { + get { return this.placementIdField; } + set { + this.placementIdField = value; + this.placementIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool placementIdSpecified { + get { return this.placementIdFieldSpecified; } + set { this.placementIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeactivateAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AssignAdUnitsToPlacement : AdUnitAction { + private long placementIdField; + + private bool placementIdFieldSpecified; + + public long placementId { + get { return this.placementIdField; } + set { + this.placementIdField = value; + this.placementIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool placementIdSpecified { + get { return this.placementIdFieldSpecified; } + set { this.placementIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ArchiveAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ActivateAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdUnitPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AdUnit[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AdUnit[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdUnit { + private string idField; + + private string parentIdField; + + private bool hasChildrenField; + + private bool hasChildrenFieldSpecified; + + private AdUnitParent[] parentPathField; + + private string nameField; + + private string descriptionField; + + private AdUnitTargetWindow targetWindowField; + + private bool targetWindowFieldSpecified; + + private InventoryStatus statusField; + + private bool statusFieldSpecified; + + private string adUnitCodeField; + + private AdUnitSize[] adUnitSizesField; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private MobilePlatform mobilePlatformField; + + private bool mobilePlatformFieldSpecified; + + private bool explicitlyTargetedField; + + private bool explicitlyTargetedFieldSpecified; + + private AdSenseSettingsInheritedProperty inheritedAdSenseSettingsField; + + private long partnerIdField; + + private bool partnerIdFieldSpecified; + + private LabelFrequencyCap[] appliedLabelFrequencyCapsField; + + private LabelFrequencyCap[] effectiveLabelFrequencyCapsField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private long[] effectiveTeamIdsField; + + private long[] appliedTeamIdsField; + + private DateTime lastModifiedDateTimeField; + + private SmartSizeMode smartSizeModeField; + + private bool smartSizeModeFieldSpecified; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string parentId { + get { return this.parentIdField; } + set { this.parentIdField = value; } + } + + public bool hasChildren { + get { return this.hasChildrenField; } + set { + this.hasChildrenField = value; + this.hasChildrenSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasChildrenSpecified { + get { return this.hasChildrenFieldSpecified; } + set { this.hasChildrenFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("parentPath")] + public AdUnitParent[] parentPath { + get { return this.parentPathField; } + set { this.parentPathField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public AdUnitTargetWindow targetWindow { + get { return this.targetWindowField; } + set { + this.targetWindowField = value; + this.targetWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetWindowSpecified { + get { return this.targetWindowFieldSpecified; } + set { this.targetWindowFieldSpecified = value; } + } + + public InventoryStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string adUnitCode { + get { return this.adUnitCodeField; } + set { this.adUnitCodeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adUnitSizes")] + public AdUnitSize[] adUnitSizes { + get { return this.adUnitSizesField; } + set { this.adUnitSizesField = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + public MobilePlatform mobilePlatform { + get { return this.mobilePlatformField; } + set { + this.mobilePlatformField = value; + this.mobilePlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mobilePlatformSpecified { + get { return this.mobilePlatformFieldSpecified; } + set { this.mobilePlatformFieldSpecified = value; } + } + + public bool explicitlyTargeted { + get { return this.explicitlyTargetedField; } + set { + this.explicitlyTargetedField = value; + this.explicitlyTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool explicitlyTargetedSpecified { + get { return this.explicitlyTargetedFieldSpecified; } + set { this.explicitlyTargetedFieldSpecified = value; } + } + + public AdSenseSettingsInheritedProperty inheritedAdSenseSettings { + get { return this.inheritedAdSenseSettingsField; } + set { this.inheritedAdSenseSettingsField = value; } + } + + public long partnerId { + get { return this.partnerIdField; } + set { + this.partnerIdField = value; + this.partnerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool partnerIdSpecified { + get { return this.partnerIdFieldSpecified; } + set { this.partnerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabelFrequencyCaps")] + public LabelFrequencyCap[] appliedLabelFrequencyCaps { + get { return this.appliedLabelFrequencyCapsField; } + set { this.appliedLabelFrequencyCapsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveLabelFrequencyCaps")] + public LabelFrequencyCap[] effectiveLabelFrequencyCaps { + get { return this.effectiveLabelFrequencyCapsField; } + set { this.effectiveLabelFrequencyCapsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveTeamIds")] + public long[] effectiveTeamIds { + get { return this.effectiveTeamIdsField; } + set { this.effectiveTeamIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public SmartSizeMode smartSizeMode { + get { return this.smartSizeModeField; } + set { + this.smartSizeModeField = value; + this.smartSizeModeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool smartSizeModeSpecified { + get { return this.smartSizeModeFieldSpecified; } + set { this.smartSizeModeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdUnitParent { + private string idField; + + private string nameField; + + private string adUnitCodeField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string adUnitCode { + get { return this.adUnitCodeField; } + set { this.adUnitCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnit.TargetWindow", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AdUnitTargetWindow { + TOP, + BLANK + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum InventoryStatus { + ACTIVE, + INACTIVE, + ARCHIVED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdUnitSize { + private Size sizeField; + + private EnvironmentType environmentTypeField; + + private bool environmentTypeFieldSpecified; + + private AdUnitSize[] companionsField; + + private string fullDisplayStringField; + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + public EnvironmentType environmentType { + get { return this.environmentTypeField; } + set { + this.environmentTypeField = value; + this.environmentTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool environmentTypeSpecified { + get { return this.environmentTypeFieldSpecified; } + set { this.environmentTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companions")] + public AdUnitSize[] companions { + get { return this.companionsField; } + set { this.companionsField = value; } + } + + public string fullDisplayString { + get { return this.fullDisplayStringField; } + set { this.fullDisplayStringField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum MobilePlatform { + SITE, + APPLICATION + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdSenseSettingsInheritedProperty { + private AdSenseSettings valueField; + + public AdSenseSettings value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdSenseSettings { + private bool adSenseEnabledField; + + private bool adSenseEnabledFieldSpecified; + + private string borderColorField; + + private string titleColorField; + + private string backgroundColorField; + + private string textColorField; + + private string urlColorField; + + private AdSenseSettingsAdType adTypeField; + + private bool adTypeFieldSpecified; + + private AdSenseSettingsBorderStyle borderStyleField; + + private bool borderStyleFieldSpecified; + + private AdSenseSettingsFontFamily fontFamilyField; + + private bool fontFamilyFieldSpecified; + + private AdSenseSettingsFontSize fontSizeField; + + private bool fontSizeFieldSpecified; + + private Size_StringMapEntry[] afcFormatsField; + + public bool adSenseEnabled { + get { return this.adSenseEnabledField; } + set { + this.adSenseEnabledField = value; + this.adSenseEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adSenseEnabledSpecified { + get { return this.adSenseEnabledFieldSpecified; } + set { this.adSenseEnabledFieldSpecified = value; } + } + + public string borderColor { + get { return this.borderColorField; } + set { this.borderColorField = value; } + } + + public string titleColor { + get { return this.titleColorField; } + set { this.titleColorField = value; } + } + + public string backgroundColor { + get { return this.backgroundColorField; } + set { this.backgroundColorField = value; } + } + + public string textColor { + get { return this.textColorField; } + set { this.textColorField = value; } + } + + public string urlColor { + get { return this.urlColorField; } + set { this.urlColorField = value; } + } + + public AdSenseSettingsAdType adType { + get { return this.adTypeField; } + set { + this.adTypeField = value; + this.adTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adTypeSpecified { + get { return this.adTypeFieldSpecified; } + set { this.adTypeFieldSpecified = value; } + } + + public AdSenseSettingsBorderStyle borderStyle { + get { return this.borderStyleField; } + set { + this.borderStyleField = value; + this.borderStyleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool borderStyleSpecified { + get { return this.borderStyleFieldSpecified; } + set { this.borderStyleFieldSpecified = value; } + } + + public AdSenseSettingsFontFamily fontFamily { + get { return this.fontFamilyField; } + set { + this.fontFamilyField = value; + this.fontFamilySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fontFamilySpecified { + get { return this.fontFamilyFieldSpecified; } + set { this.fontFamilyFieldSpecified = value; } + } + + public AdSenseSettingsFontSize fontSize { + get { return this.fontSizeField; } + set { + this.fontSizeField = value; + this.fontSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fontSizeSpecified { + get { return this.fontSizeFieldSpecified; } + set { this.fontSizeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("afcFormats")] + public Size_StringMapEntry[] afcFormats { + get { return this.afcFormatsField; } + set { this.afcFormatsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.AdType", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AdSenseSettingsAdType { + TEXT, + IMAGE, + TEXT_AND_IMAGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.BorderStyle", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AdSenseSettingsBorderStyle { + DEFAULT, + NOT_ROUNDED, + SLIGHTLY_ROUNDED, + VERY_ROUNDED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.FontFamily", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AdSenseSettingsFontFamily { + DEFAULT, + ARIAL, + TAHOMA, + GEORGIA, + TIMES, + VERDANA + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.FontSize", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AdSenseSettingsFontSize { + DEFAULT, + SMALL, + MEDIUM, + LARGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Size_StringMapEntry { + private Size keyField; + + private string valueField; + + public Size key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class LabelFrequencyCap { + private FrequencyCap frequencyCapField; + + private long labelIdField; + + private bool labelIdFieldSpecified; + + public FrequencyCap frequencyCap { + get { return this.frequencyCapField; } + set { this.frequencyCapField = value; } + } + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum SmartSizeMode { + UNKNOWN, + NONE, + SMART_BANNER, + DYNAMIC_SIZE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdUnitTypeError : ApiError { + private AdUnitTypeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitTypeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitTypeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AdUnitTypeErrorReason { + MOBILE_APP_PLATFORM_NOT_VALID, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class InventoryUnitSizesError : ApiError { + private InventoryUnitSizesErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitSizesErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitSizesError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum InventoryUnitSizesErrorReason { + INVALID_SIZES, + INVALID_SIZE_FOR_PLATFORM, + VIDEO_FEATURE_MISSING, + VIDEO_MOBILE_LINE_ITEM_FEATURE_MISSING, + INVALID_SIZE_FOR_MASTER, + INVALID_SIZE_FOR_COMPANION, + DUPLICATE_MASTER_SIZES, + ASPECT_RATIO_NOT_SUPPORTED, + VIDEO_COMPANIONS_NOT_SUPPORTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class InventoryUnitPartnerAssociationError : ApiError { + private InventoryUnitPartnerAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitPartnerAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitPartnerAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum InventoryUnitPartnerAssociationErrorReason { + ANCESTOR_AD_UNIT_HAS_PARTNER_ASSOCIATION, + DESCENDANT_AD_UNIT_HAS_PARTNER_ASSOCIATION, + SAME_PARTNER_ASSOCIATION_IN_INVENTORY_HIERARCHY, + NO_PARTNER_CATCH_ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class InvalidColorError : ApiError { + private InvalidColorErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidColorErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidColorError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum InvalidColorErrorReason { + INVALID_FORMAT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdUnitHierarchyError : ApiError { + private AdUnitHierarchyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitHierarchyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitHierarchyError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum AdUnitHierarchyErrorReason { + INVALID_DEPTH, + INVALID_PARENT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "UserTeamAssociationServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserRecordTeamAssociation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class UserTeamAssociationService : DfpSoapClient, IUserTeamAssociationService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public UserTeamAssociationService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/UserTeamAssociationService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociation createUserTeamAssociation(UserTeamAssociation userTeamAssociation) { + object[] results = this.Invoke("createUserTeamAssociation", new object[] { userTeamAssociation }); + return ((UserTeamAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociation[] createUserTeamAssociations([System.Xml.Serialization.XmlElementAttribute("userTeamAssociations")] +UserTeamAssociation[] userTeamAssociations) { + object[] results = this.Invoke("createUserTeamAssociations", new object[] { userTeamAssociations }); + return ((UserTeamAssociation[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociation getUserTeamAssociation(long teamId, long userId) { + object[] results = this.Invoke("getUserTeamAssociation", new object[] { teamId, userId }); + return ((UserTeamAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociationPage getUserTeamAssociationsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getUserTeamAssociationsByStatement", new object[] { filterStatement }); + return ((UserTeamAssociationPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performUserTeamAssociationAction(UserTeamAssociationAction userTeamAssociationAction, Statement statement) { + object[] results = this.Invoke("performUserTeamAssociationAction", new object[] { userTeamAssociationAction, statement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociation updateUserTeamAssociation(UserTeamAssociation userTeamAssociation) { + object[] results = this.Invoke("updateUserTeamAssociation", new object[] { userTeamAssociation }); + return ((UserTeamAssociation) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociation[] updateUserTeamAssociations([System.Xml.Serialization.XmlElementAttribute("userTeamAssociations")] +UserTeamAssociation[] userTeamAssociations) { + object[] results = this.Invoke("updateUserTeamAssociations", new object[] { userTeamAssociations }); + return ((UserTeamAssociation[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteUserTeamAssociations))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class UserTeamAssociationAction { + private string userTeamAssociationActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("UserTeamAssociationAction.Type")] + public string UserTeamAssociationActionType { + get { return this.userTeamAssociationActionTypeField; } + set { this.userTeamAssociationActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeleteUserTeamAssociations : UserTeamAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class UserTeamAssociationPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private UserTeamAssociation[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public UserTeamAssociation[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class UserTeamAssociation : UserRecordTeamAssociation { + private long userIdField; + + private bool userIdFieldSpecified; + + public long userId { + get { return this.userIdField; } + set { + this.userIdField = value; + this.userIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userIdSpecified { + get { return this.userIdFieldSpecified; } + set { this.userIdFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserTeamAssociation))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class UserRecordTeamAssociation { + private long teamIdField; + + private bool teamIdFieldSpecified; + + private TeamAccessType overriddenTeamAccessTypeField; + + private bool overriddenTeamAccessTypeFieldSpecified; + + private TeamAccessType defaultTeamAccessTypeField; + + private bool defaultTeamAccessTypeFieldSpecified; + + private string userRecordTeamAssociationTypeField; + + public long teamId { + get { return this.teamIdField; } + set { + this.teamIdField = value; + this.teamIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool teamIdSpecified { + get { return this.teamIdFieldSpecified; } + set { this.teamIdFieldSpecified = value; } + } + + public TeamAccessType overriddenTeamAccessType { + get { return this.overriddenTeamAccessTypeField; } + set { + this.overriddenTeamAccessTypeField = value; + this.overriddenTeamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overriddenTeamAccessTypeSpecified { + get { return this.overriddenTeamAccessTypeFieldSpecified; } + set { this.overriddenTeamAccessTypeFieldSpecified = value; } + } + + public TeamAccessType defaultTeamAccessType { + get { return this.defaultTeamAccessTypeField; } + set { + this.defaultTeamAccessTypeField = value; + this.defaultTeamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool defaultTeamAccessTypeSpecified { + get { return this.defaultTeamAccessTypeFieldSpecified; } + set { this.defaultTeamAccessTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("UserRecordTeamAssociation.Type")] + public string UserRecordTeamAssociationType { + get { return this.userRecordTeamAssociationTypeField; } + set { this.userRecordTeamAssociationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "OrderServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class OrderService : DfpSoapClient, IOrderService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public OrderService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/OrderService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Order createOrder(Order order) { + object[] results = this.Invoke("createOrder", new object[] { order }); + return ((Order) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Order[] createOrders([System.Xml.Serialization.XmlElementAttribute("orders")] +Order[] orders) { + object[] results = this.Invoke("createOrders", new object[] { orders }); + return ((Order[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Order getOrder(long orderId) { + object[] results = this.Invoke("getOrder", new object[] { orderId }); + return ((Order) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual OrderPage getOrdersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getOrdersByStatement", new object[] { filterStatement }); + return ((OrderPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performOrderAction(OrderAction orderAction, Statement filterStatement) { + object[] results = this.Invoke("performOrderAction", new object[] { orderAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Order updateOrder(Order order) { + object[] results = this.Invoke("updateOrder", new object[] { order }); + return ((Order) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Order[] updateOrders([System.Xml.Serialization.XmlElementAttribute("orders")] +Order[] orders) { + object[] results = this.Invoke("updateOrders", new object[] { orders }); + return ((Order[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApproval))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalAndOverbook))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RetractOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RetractOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PauseOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DisapproveOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DisapproveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class OrderAction { + private string orderActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("OrderAction.Type")] + public string OrderActionType { + get { return this.orderActionTypeField; } + set { this.orderActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class UnarchiveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class SubmitOrdersForApprovalWithoutReservationChanges : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalAndOverbook))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class SubmitOrdersForApproval : OrderAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class SubmitOrdersForApprovalAndOverbook : SubmitOrdersForApproval { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RetractOrdersWithoutReservationChanges : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RetractOrders : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ResumeOrders : OrderAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ResumeAndOverbookOrders : ResumeOrders { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class PauseOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DisapproveOrdersWithoutReservationChanges : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DisapproveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeleteOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ArchiveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ApproveOrdersWithoutReservationChanges : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ApproveOrders : OrderAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ApproveAndOverbookOrders : ApproveOrders { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class OrderPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Order[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Order[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Order { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private OrderStatus statusField; + + private bool statusFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private string notesField; + + private int externalOrderIdField; + + private bool externalOrderIdFieldSpecified; + + private string poNumberField; + + private string currencyCodeField; + + private long advertiserIdField; + + private bool advertiserIdFieldSpecified; + + private long[] advertiserContactIdsField; + + private long agencyIdField; + + private bool agencyIdFieldSpecified; + + private long[] agencyContactIdsField; + + private long creatorIdField; + + private bool creatorIdFieldSpecified; + + private long traffickerIdField; + + private bool traffickerIdFieldSpecified; + + private long[] secondaryTraffickerIdsField; + + private long salespersonIdField; + + private bool salespersonIdFieldSpecified; + + private long[] secondarySalespersonIdsField; + + private long totalImpressionsDeliveredField; + + private bool totalImpressionsDeliveredFieldSpecified; + + private long totalClicksDeliveredField; + + private bool totalClicksDeliveredFieldSpecified; + + private Money totalBudgetField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private string lastModifiedByAppField; + + private long[] appliedTeamIdsField; + + private DateTime lastModifiedDateTimeField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public OrderStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public int externalOrderId { + get { return this.externalOrderIdField; } + set { + this.externalOrderIdField = value; + this.externalOrderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool externalOrderIdSpecified { + get { return this.externalOrderIdFieldSpecified; } + set { this.externalOrderIdFieldSpecified = value; } + } + + public string poNumber { + get { return this.poNumberField; } + set { this.poNumberField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public long advertiserId { + get { return this.advertiserIdField; } + set { + this.advertiserIdField = value; + this.advertiserIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserIdSpecified { + get { return this.advertiserIdFieldSpecified; } + set { this.advertiserIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("advertiserContactIds")] + public long[] advertiserContactIds { + get { return this.advertiserContactIdsField; } + set { this.advertiserContactIdsField = value; } + } + + public long agencyId { + get { return this.agencyIdField; } + set { + this.agencyIdField = value; + this.agencyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool agencyIdSpecified { + get { return this.agencyIdFieldSpecified; } + set { this.agencyIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("agencyContactIds")] + public long[] agencyContactIds { + get { return this.agencyContactIdsField; } + set { this.agencyContactIdsField = value; } + } + + public long creatorId { + get { return this.creatorIdField; } + set { + this.creatorIdField = value; + this.creatorIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creatorIdSpecified { + get { return this.creatorIdFieldSpecified; } + set { this.creatorIdFieldSpecified = value; } + } + + public long traffickerId { + get { return this.traffickerIdField; } + set { + this.traffickerIdField = value; + this.traffickerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool traffickerIdSpecified { + get { return this.traffickerIdFieldSpecified; } + set { this.traffickerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryTraffickerIds")] + public long[] secondaryTraffickerIds { + get { return this.secondaryTraffickerIdsField; } + set { this.secondaryTraffickerIdsField = value; } + } + + public long salespersonId { + get { return this.salespersonIdField; } + set { + this.salespersonIdField = value; + this.salespersonIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool salespersonIdSpecified { + get { return this.salespersonIdFieldSpecified; } + set { this.salespersonIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondarySalespersonIds")] + public long[] secondarySalespersonIds { + get { return this.secondarySalespersonIdsField; } + set { this.secondarySalespersonIdsField = value; } + } + + public long totalImpressionsDelivered { + get { return this.totalImpressionsDeliveredField; } + set { + this.totalImpressionsDeliveredField = value; + this.totalImpressionsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalImpressionsDeliveredSpecified { + get { return this.totalImpressionsDeliveredFieldSpecified; } + set { this.totalImpressionsDeliveredFieldSpecified = value; } + } + + public long totalClicksDelivered { + get { return this.totalClicksDeliveredField; } + set { + this.totalClicksDeliveredField = value; + this.totalClicksDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalClicksDeliveredSpecified { + get { return this.totalClicksDeliveredFieldSpecified; } + set { this.totalClicksDeliveredFieldSpecified = value; } + } + + public Money totalBudget { + get { return this.totalBudgetField; } + set { this.totalBudgetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public string lastModifiedByApp { + get { return this.lastModifiedByAppField; } + set { this.lastModifiedByAppField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum OrderStatus { + DRAFT, + PENDING_APPROVAL, + APPROVED, + DISAPPROVED, + PAUSED, + CANCELED, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class OrderActionError : ApiError { + private OrderActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OrderActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OrderActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum OrderActionErrorReason { + PERMISSION_DENIED, + NOT_APPLICABLE, + IS_ARCHIVED, + HAS_ENDED, + CANNOT_APPROVE_WITH_UNRESERVED_LINE_ITEMS, + CANNOT_DELETE_ORDER_WITH_DELIVERED_LINEITEMS, + CANNOT_APPROVE_COMPANY_CREDIT_STATUS_NOT_ACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReconciliationOrderReportServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReconciliationOrderReportService : DfpSoapClient, IReconciliationOrderReportService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReconciliationOrderReportService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/ReconciliationOrderReportServic" + "e"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationOrderReport getReconciliationOrderReport(long reconciliationOrderReportId) { + object[] results = this.Invoke("getReconciliationOrderReport", new object[] { reconciliationOrderReportId }); + return ((ReconciliationOrderReport) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationOrderReportPage getReconciliationOrderReportsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getReconciliationOrderReportsByStatement", new object[] { filterStatement }); + return ((ReconciliationOrderReportPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performReconciliationOrderReportAction(ReconciliationOrderReportAction reconciliationOrderReportAction, Statement filterStatement) { + object[] results = this.Invoke("performReconciliationOrderReportAction", new object[] { reconciliationOrderReportAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RevertReconciliationOrderReports))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitReconciliationOrderReports))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class ReconciliationOrderReportAction { + private string reconciliationOrderReportActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ReconciliationOrderReportAction.Type")] + public string ReconciliationOrderReportActionType { + get { return this.reconciliationOrderReportActionTypeField; } + set { this.reconciliationOrderReportActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RevertReconciliationOrderReports : ReconciliationOrderReportAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class SubmitReconciliationOrderReports : ReconciliationOrderReportAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ReconciliationOrderReportPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ReconciliationOrderReport[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ReconciliationOrderReport[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ReconciliationOrderReport { + private long idField; + + private bool idFieldSpecified; + + private long reconciliationReportIdField; + + private bool reconciliationReportIdFieldSpecified; + + private long orderIdField; + + private bool orderIdFieldSpecified; + + private ReconciliationOrderReportStatus statusField; + + private bool statusFieldSpecified; + + private DateTime submissionDateTimeField; + + private long submitterIdField; + + private bool submitterIdFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long reconciliationReportId { + get { return this.reconciliationReportIdField; } + set { + this.reconciliationReportIdField = value; + this.reconciliationReportIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reconciliationReportIdSpecified { + get { return this.reconciliationReportIdFieldSpecified; } + set { this.reconciliationReportIdFieldSpecified = value; } + } + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public ReconciliationOrderReportStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public DateTime submissionDateTime { + get { return this.submissionDateTimeField; } + set { this.submissionDateTimeField = value; } + } + + public long submitterId { + get { return this.submitterIdField; } + set { + this.submitterIdField = value; + this.submitterIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool submitterIdSpecified { + get { return this.submitterIdFieldSpecified; } + set { this.submitterIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ReconciliationOrderReportStatus { + DRAFT, + RECONCILED, + REVERTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "PublisherQueryLanguageServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class PublisherQueryLanguageService : DfpSoapClient, IPublisherQueryLanguageService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public PublisherQueryLanguageService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/PublisherQueryLanguageService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ResultSet select(Statement selectStatement) { + object[] results = this.Invoke("select", new object[] { selectStatement }); + return ((ResultSet) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Row { + private Value[] valuesField; + + + [System.Xml.Serialization.XmlElementAttribute("values")] + public Value[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ColumnType { + private string labelNameField; + + public string labelName { + get { return this.labelNameField; } + set { this.labelNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ResultSet { + private ColumnType[] columnTypesField; + + private Row[] rowsField; + + [System.Xml.Serialization.XmlElementAttribute("columnTypes")] + public ColumnType[] columnTypes { + get { return this.columnTypesField; } + set { this.columnTypesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("rows")] + public Row[] rows { + get { return this.rowsField; } + set { this.rowsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ExchangeRateError : ApiError { + private ExchangeRateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ExchangeRateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ExchangeRateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ExchangeRateErrorReason { + INVALID_CURRENCY_CODE, + UNSUPPORTED_CURRENCY_CODE, + CURRENCY_CODE_ALREADY_EXISTS, + INVALID_EXCHANGE_RATE, + EXCHANGE_RATE_NOT_FOUND, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Asset))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeService : DfpSoapClient, ICreativeService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/CreativeService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Creative createCreative(Creative creative) { + object[] results = this.Invoke("createCreative", new object[] { creative }); + return ((Creative) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Creative[] createCreatives([System.Xml.Serialization.XmlElementAttribute("creatives")] +Creative[] creatives) { + object[] results = this.Invoke("createCreatives", new object[] { creatives }); + return ((Creative[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Creative getCreative(long creativeId) { + object[] results = this.Invoke("getCreative", new object[] { creativeId }); + return ((Creative) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativePage getCreativesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativesByStatement", new object[] { filterStatement }); + return ((CreativePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Creative updateCreative(Creative creative) { + object[] results = this.Invoke("updateCreative", new object[] { creative }); + return ((Creative) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Creative[] updateCreatives([System.Xml.Serialization.XmlElementAttribute("creatives")] +Creative[] creatives) { + object[] results = this.Invoke("updateCreatives", new object[] { creatives }); + return ((Creative[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CreativePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Creative[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Creative[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VastRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnsupportedCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ThirdPartyCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TemplateCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InternalRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasDestinationUrlCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpMobileCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseVideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AspectRatioImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClickTrackingCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseRichMediaStudioCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasHtmlSnippetDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdMobBackfillCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class Creative { + private long advertiserIdField; + + private bool advertiserIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private Size sizeField; + + private string previewUrlField; + + private AppliedLabel[] appliedLabelsField; + + private DateTime lastModifiedDateTimeField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private string creativeTypeField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { + this.advertiserIdField = value; + this.advertiserIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserIdSpecified { + get { return this.advertiserIdFieldSpecified; } + set { this.advertiserIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + public string previewUrl { + get { return this.previewUrlField; } + set { this.previewUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Creative.Type")] + public string CreativeType { + get { return this.creativeTypeField; } + set { this.creativeTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class VastRedirectCreative : Creative { + private string vastXmlUrlField; + + private VastRedirectType vastRedirectTypeField; + + private bool vastRedirectTypeFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string vastPreviewUrlField; + + public string vastXmlUrl { + get { return this.vastXmlUrlField; } + set { this.vastXmlUrlField = value; } + } + + public VastRedirectType vastRedirectType { + get { return this.vastRedirectTypeField; } + set { + this.vastRedirectTypeField = value; + this.vastRedirectTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool vastRedirectTypeSpecified { + get { return this.vastRedirectTypeFieldSpecified; } + set { this.vastRedirectTypeFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum VastRedirectType { + LINEAR, + NON_LINEAR, + LINEAR_AND_NON_LINEAR + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ConversionEvent_TrackingUrlsMapEntry { + private ConversionEvent keyField; + + private bool keyFieldSpecified; + + private string[] valueField; + + public ConversionEvent key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("urls", IsNullable = false)] + public string[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ConversionEvent { + CREATIVE_VIEW, + START, + SKIP_SHOWN, + FIRST_QUARTILE, + MIDPOINT, + THIRD_QUARTILE, + ENGAGED_VIEW, + COMPLETE, + MUTE, + UNMUTE, + PAUSE, + REWIND, + RESUME, + SKIPPED, + FULLSCREEN, + EXPAND, + COLLAPSE, + ACCEPT_INVITATION, + CLOSE, + CLICK_TRACKING, + SURVEY, + CUSTOM_CLICK + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class UnsupportedCreative : Creative { + private string unsupportedCreativeTypeField; + + public string unsupportedCreativeType { + get { return this.unsupportedCreativeTypeField; } + set { this.unsupportedCreativeTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ThirdPartyCreative : Creative { + private string snippetField; + + private string expandedSnippetField; + + public string snippet { + get { return this.snippetField; } + set { this.snippetField = value; } + } + + public string expandedSnippet { + get { return this.expandedSnippetField; } + set { this.expandedSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class TemplateCreative : Creative { + private long creativeTemplateIdField; + + private bool creativeTemplateIdFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + private string destinationUrlField; + + private BaseCreativeTemplateVariableValue[] creativeTemplateVariableValuesField; + + public long creativeTemplateId { + get { return this.creativeTemplateIdField; } + set { + this.creativeTemplateIdField = value; + this.creativeTemplateIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeTemplateIdSpecified { + get { return this.creativeTemplateIdFieldSpecified; } + set { this.creativeTemplateIdFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativeTemplateVariableValues")] + public BaseCreativeTemplateVariableValue[] creativeTemplateVariableValues { + get { return this.creativeTemplateVariableValuesField; } + set { this.creativeTemplateVariableValuesField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UrlCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetCreativeTemplateVariableValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class BaseCreativeTemplateVariableValue { + private string uniqueNameField; + + private string baseCreativeTemplateVariableValueTypeField; + + public string uniqueName { + get { return this.uniqueNameField; } + set { this.uniqueNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseCreativeTemplateVariableValue.Type")] + public string BaseCreativeTemplateVariableValueType { + get { return this.baseCreativeTemplateVariableValueTypeField; } + set { this.baseCreativeTemplateVariableValueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class UrlCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class StringCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class LongCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private long valueField; + + private bool valueFieldSpecified; + + public long value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AssetCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class LegacyDfpCreative : Creative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class InternalRedirectCreative : Creative { + private Size assetSizeField; + + private string internalRedirectUrlField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public Size assetSize { + get { return this.assetSizeField; } + set { this.assetSizeField = value; } + } + + public string internalRedirectUrl { + get { return this.internalRedirectUrlField; } + set { this.internalRedirectUrlField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpMobileCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseVideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AspectRatioImageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class HasDestinationUrlCreative : Creative { + private string destinationUrlField; + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class VpaidLinearRedirectCreative : HasDestinationUrlCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + private string flashUrlField; + + private Size flashAssetSizeField; + + private string vastPreviewUrlField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string flashUrl { + get { return this.flashUrlField; } + set { this.flashUrlField = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class VpaidLinearCreative : HasDestinationUrlCreative { + private string flashNameField; + + private byte[] flashByteArrayField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private Size flashAssetSizeField; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + private string vastPreviewUrlField; + + public string flashName { + get { return this.flashNameField; } + set { this.flashNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] flashByteArray { + get { return this.flashByteArrayField; } + set { this.flashByteArrayField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class LegacyDfpMobileCreative : HasDestinationUrlCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CustomCreative : HasDestinationUrlCreative { + private string htmlSnippetField; + + private CustomCreativeAsset[] customCreativeAssetsField; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public string htmlSnippet { + get { return this.htmlSnippetField; } + set { this.htmlSnippetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customCreativeAssets")] + public CustomCreativeAsset[] customCreativeAssets { + get { return this.customCreativeAssetsField; } + set { this.customCreativeAssetsField = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CustomCreativeAsset { + private string macroNameField; + + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + private long fileSizeField; + + private bool fileSizeFieldSpecified; + + public string macroName { + get { return this.macroNameField; } + set { this.macroNameField = value; } + } + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public long fileSize { + get { return this.fileSizeField; } + set { + this.fileSizeField = value; + this.fileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fileSizeSpecified { + get { return this.fileSizeFieldSpecified; } + set { this.fileSizeFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class BaseVideoCreative : HasDestinationUrlCreative { + private int durationField; + + private bool durationFieldSpecified; + + private bool allowDurationOverrideField; + + private bool allowDurationOverrideFieldSpecified; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private long[] companionCreativeIdsField; + + private string customParametersField; + + private string vastPreviewUrlField; + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public bool allowDurationOverride { + get { return this.allowDurationOverrideField; } + set { + this.allowDurationOverrideField = value; + this.allowDurationOverrideSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowDurationOverrideSpecified { + get { return this.allowDurationOverrideFieldSpecified; } + set { this.allowDurationOverrideFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class VideoRedirectCreative : BaseVideoCreative { + private VideoRedirectAsset[] videoAssetsField; + + [System.Xml.Serialization.XmlElementAttribute("videoAssets")] + public VideoRedirectAsset[] videoAssets { + get { return this.videoAssetsField; } + set { this.videoAssetsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class VideoRedirectAsset : RedirectAsset { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class RedirectAsset : Asset { + private string redirectUrlField; + + public string redirectUrl { + get { return this.redirectUrlField; } + set { this.redirectUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RedirectAsset))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class Asset { + private string assetTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Asset.Type")] + public string AssetType { + get { return this.assetTypeField; } + set { this.assetTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class VideoCreative : BaseVideoCreative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class BaseImageRedirectCreative : HasDestinationUrlCreative { + private string imageUrlField; + + public string imageUrl { + get { return this.imageUrlField; } + set { this.imageUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ImageRedirectOverlayCreative : BaseImageRedirectCreative { + private Size assetSizeField; + + private int durationField; + + private bool durationFieldSpecified; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private string vastPreviewUrlField; + + public Size assetSize { + get { return this.assetSizeField; } + set { this.assetSizeField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ImageRedirectCreative : BaseImageRedirectCreative { + private string altTextField; + + private string thirdPartyImpressionUrlField; + + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + public string thirdPartyImpressionUrl { + get { return this.thirdPartyImpressionUrlField; } + set { this.thirdPartyImpressionUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class BaseImageCreative : HasDestinationUrlCreative { + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private CreativeAsset primaryImageAssetField; + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public CreativeAsset primaryImageAsset { + get { return this.primaryImageAssetField; } + set { this.primaryImageAssetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CreativeAsset { + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + private long fileSizeField; + + private bool fileSizeFieldSpecified; + + private string assetUrlField; + + private Size sizeField; + + private ImageDensity imageDensityField; + + private bool imageDensityFieldSpecified; + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public long fileSize { + get { return this.fileSizeField; } + set { + this.fileSizeField = value; + this.fileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fileSizeSpecified { + get { return this.fileSizeFieldSpecified; } + set { this.fileSizeFieldSpecified = value; } + } + + public string assetUrl { + get { return this.assetUrlField; } + set { this.assetUrlField = value; } + } + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + public ImageDensity imageDensity { + get { return this.imageDensityField; } + set { + this.imageDensityField = value; + this.imageDensitySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool imageDensitySpecified { + get { return this.imageDensityFieldSpecified; } + set { this.imageDensityFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ImageDensity { + ONE_TO_ONE, + THREE_TO_TWO, + TWO_TO_ONE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ImageOverlayCreative : BaseImageCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + private string vastPreviewUrlField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ImageCreative : BaseImageCreative { + private string altTextField; + + private string thirdPartyImpressionUrlField; + + private CreativeAsset[] secondaryImageAssetsField; + + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + public string thirdPartyImpressionUrl { + get { return this.thirdPartyImpressionUrlField; } + set { this.thirdPartyImpressionUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryImageAssets")] + public CreativeAsset[] secondaryImageAssets { + get { return this.secondaryImageAssetsField; } + set { this.secondaryImageAssetsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class BaseFlashRedirectCreative : HasDestinationUrlCreative { + private string flashUrlField; + + private string fallbackUrlField; + + private string fallbackPreviewUrlField; + + public string flashUrl { + get { return this.flashUrlField; } + set { this.flashUrlField = value; } + } + + public string fallbackUrl { + get { return this.fallbackUrlField; } + set { this.fallbackUrlField = value; } + } + + public string fallbackPreviewUrl { + get { return this.fallbackPreviewUrlField; } + set { this.fallbackPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class FlashRedirectOverlayCreative : BaseFlashRedirectCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private ApiFramework apiFrameworkField; + + private bool apiFrameworkFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + private Size flashAssetSizeField; + + private string vastPreviewUrlField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public ApiFramework apiFramework { + get { return this.apiFrameworkField; } + set { + this.apiFrameworkField = value; + this.apiFrameworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool apiFrameworkSpecified { + get { return this.apiFrameworkFieldSpecified; } + set { this.apiFrameworkFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ApiFramework { + NONE, + CLICKTAG, + VPAID + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class FlashRedirectCreative : BaseFlashRedirectCreative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class BaseFlashCreative : HasDestinationUrlCreative { + private string flashNameField; + + private byte[] flashByteArrayField; + + private string fallbackImageNameField; + + private byte[] fallbackImageByteArrayField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private bool clickTagRequiredField; + + private bool clickTagRequiredFieldSpecified; + + private string fallbackPreviewUrlField; + + private Size flashAssetSizeField; + + private Size fallbackAssetSizeField; + + public string flashName { + get { return this.flashNameField; } + set { this.flashNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] flashByteArray { + get { return this.flashByteArrayField; } + set { this.flashByteArrayField = value; } + } + + public string fallbackImageName { + get { return this.fallbackImageNameField; } + set { this.fallbackImageNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] fallbackImageByteArray { + get { return this.fallbackImageByteArrayField; } + set { this.fallbackImageByteArrayField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public bool clickTagRequired { + get { return this.clickTagRequiredField; } + set { + this.clickTagRequiredField = value; + this.clickTagRequiredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clickTagRequiredSpecified { + get { return this.clickTagRequiredFieldSpecified; } + set { this.clickTagRequiredFieldSpecified = value; } + } + + public string fallbackPreviewUrl { + get { return this.fallbackPreviewUrlField; } + set { this.fallbackPreviewUrlField = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + public Size fallbackAssetSize { + get { return this.fallbackAssetSizeField; } + set { this.fallbackAssetSizeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class FlashOverlayCreative : BaseFlashCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private ApiFramework apiFrameworkField; + + private bool apiFrameworkFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + private string vastPreviewUrlField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public ApiFramework apiFramework { + get { return this.apiFrameworkField; } + set { + this.apiFrameworkField = value; + this.apiFrameworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool apiFrameworkSpecified { + get { return this.apiFrameworkFieldSpecified; } + set { this.apiFrameworkFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class FlashCreative : BaseFlashCreative { + private SwiffyFallbackAsset swiffyAssetField; + + private bool createSwiffyAssetField; + + private bool createSwiffyAssetFieldSpecified; + + public SwiffyFallbackAsset swiffyAsset { + get { return this.swiffyAssetField; } + set { this.swiffyAssetField = value; } + } + + public bool createSwiffyAsset { + get { return this.createSwiffyAssetField; } + set { + this.createSwiffyAssetField = value; + this.createSwiffyAssetSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool createSwiffyAssetSpecified { + get { return this.createSwiffyAssetFieldSpecified; } + set { this.createSwiffyAssetFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class SwiffyFallbackAsset { + private CreativeAsset assetField; + + private Html5Feature[] html5FeaturesField; + + private string[] localizedInfoMessagesField; + + public CreativeAsset asset { + get { return this.assetField; } + set { this.assetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("html5Features")] + public Html5Feature[] html5Features { + get { return this.html5FeaturesField; } + set { this.html5FeaturesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("localizedInfoMessages")] + public string[] localizedInfoMessages { + get { return this.localizedInfoMessagesField; } + set { this.localizedInfoMessagesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum Html5Feature { + BASIC_SVG, + SVG_FILTERS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AspectRatioImageCreative : HasDestinationUrlCreative { + private CreativeAsset[] imageAssetsField; + + private string altTextField; + + private string thirdPartyImpressionUrlField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("imageAssets")] + public CreativeAsset[] imageAssets { + get { return this.imageAssetsField; } + set { this.imageAssetsField = value; } + } + + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + public string thirdPartyImpressionUrl { + get { return this.thirdPartyImpressionUrlField; } + set { this.thirdPartyImpressionUrlField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ClickTrackingCreative : Creative { + private string clickTrackingUrlField; + + public string clickTrackingUrl { + get { return this.clickTrackingUrlField; } + set { this.clickTrackingUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class BaseRichMediaStudioCreative : Creative { + private long studioCreativeIdField; + + private bool studioCreativeIdFieldSpecified; + + private RichMediaStudioCreativeFormat creativeFormatField; + + private bool creativeFormatFieldSpecified; + + private RichMediaStudioCreativeArtworkType artworkTypeField; + + private bool artworkTypeFieldSpecified; + + private long totalFileSizeField; + + private bool totalFileSizeFieldSpecified; + + private string[] adTagKeysField; + + private string[] customKeyValuesField; + + private string surveyUrlField; + + private string allImpressionsUrlField; + + private string richMediaImpressionsUrlField; + + private string backupImageImpressionsUrlField; + + private string overrideCssField; + + private string requiredFlashPluginVersionField; + + private int durationField; + + private bool durationFieldSpecified; + + private RichMediaStudioCreativeBillingAttribute billingAttributeField; + + private bool billingAttributeFieldSpecified; + + private RichMediaStudioChildAssetProperty[] richMediaStudioChildAssetPropertiesField; + + public long studioCreativeId { + get { return this.studioCreativeIdField; } + set { + this.studioCreativeIdField = value; + this.studioCreativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool studioCreativeIdSpecified { + get { return this.studioCreativeIdFieldSpecified; } + set { this.studioCreativeIdFieldSpecified = value; } + } + + public RichMediaStudioCreativeFormat creativeFormat { + get { return this.creativeFormatField; } + set { + this.creativeFormatField = value; + this.creativeFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeFormatSpecified { + get { return this.creativeFormatFieldSpecified; } + set { this.creativeFormatFieldSpecified = value; } + } + + public RichMediaStudioCreativeArtworkType artworkType { + get { return this.artworkTypeField; } + set { + this.artworkTypeField = value; + this.artworkTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool artworkTypeSpecified { + get { return this.artworkTypeFieldSpecified; } + set { this.artworkTypeFieldSpecified = value; } + } + + public long totalFileSize { + get { return this.totalFileSizeField; } + set { + this.totalFileSizeField = value; + this.totalFileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalFileSizeSpecified { + get { return this.totalFileSizeFieldSpecified; } + set { this.totalFileSizeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adTagKeys")] + public string[] adTagKeys { + get { return this.adTagKeysField; } + set { this.adTagKeysField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customKeyValues")] + public string[] customKeyValues { + get { return this.customKeyValuesField; } + set { this.customKeyValuesField = value; } + } + + public string surveyUrl { + get { return this.surveyUrlField; } + set { this.surveyUrlField = value; } + } + + public string allImpressionsUrl { + get { return this.allImpressionsUrlField; } + set { this.allImpressionsUrlField = value; } + } + + public string richMediaImpressionsUrl { + get { return this.richMediaImpressionsUrlField; } + set { this.richMediaImpressionsUrlField = value; } + } + + public string backupImageImpressionsUrl { + get { return this.backupImageImpressionsUrlField; } + set { this.backupImageImpressionsUrlField = value; } + } + + public string overrideCss { + get { return this.overrideCssField; } + set { this.overrideCssField = value; } + } + + public string requiredFlashPluginVersion { + get { return this.requiredFlashPluginVersionField; } + set { this.requiredFlashPluginVersionField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public RichMediaStudioCreativeBillingAttribute billingAttribute { + get { return this.billingAttributeField; } + set { + this.billingAttributeField = value; + this.billingAttributeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingAttributeSpecified { + get { return this.billingAttributeFieldSpecified; } + set { this.billingAttributeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("richMediaStudioChildAssetProperties")] + public RichMediaStudioChildAssetProperty[] richMediaStudioChildAssetProperties { + get { return this.richMediaStudioChildAssetPropertiesField; } + set { this.richMediaStudioChildAssetPropertiesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum RichMediaStudioCreativeFormat { + IN_PAGE, + EXPANDING, + IM_EXPANDING, + FLOATING, + PEEL_DOWN, + IN_PAGE_WITH_FLOATING, + FLASH_IN_FLASH, + FLASH_IN_FLASH_EXPANDING, + IN_APP, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum RichMediaStudioCreativeArtworkType { + FLASH, + HTML5, + MIXED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum RichMediaStudioCreativeBillingAttribute { + IN_PAGE, + FLOATING_EXPANDING, + VIDEO, + FLASH_IN_FLASH + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RichMediaStudioChildAssetProperty { + private string nameField; + + private RichMediaStudioChildAssetPropertyType typeField; + + private bool typeFieldSpecified; + + private long totalFileSizeField; + + private bool totalFileSizeFieldSpecified; + + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + private string urlField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public RichMediaStudioChildAssetPropertyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public long totalFileSize { + get { return this.totalFileSizeField; } + set { + this.totalFileSizeField = value; + this.totalFileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalFileSizeSpecified { + get { return this.totalFileSizeFieldSpecified; } + set { this.totalFileSizeFieldSpecified = value; } + } + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaStudioChildAssetProperty.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum RichMediaStudioChildAssetPropertyType { + FLASH, + VIDEO, + IMAGE, + DATA + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RichMediaStudioCreative : BaseRichMediaStudioCreative { + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasHtmlSnippetDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdMobBackfillCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class BaseDynamicAllocationCreative : Creative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class HasHtmlSnippetDynamicAllocationCreative : BaseDynamicAllocationCreative { + private string codeSnippetField; + + public string codeSnippet { + get { return this.codeSnippetField; } + set { this.codeSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdSenseCreative : HasHtmlSnippetDynamicAllocationCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdExchangeCreative : HasHtmlSnippetDynamicAllocationCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class AdMobBackfillCreative : BaseDynamicAllocationCreative { + private string additionalParametersField; + + private string publisherIdField; + + public string additionalParameters { + get { return this.additionalParametersField; } + set { this.additionalParametersField = value; } + } + + public string publisherId { + get { return this.publisherIdField; } + set { this.publisherIdField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "BaseRateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class BaseRateService : DfpSoapClient, IBaseRateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public BaseRateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/BaseRateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRate createBaseRate(BaseRate baseRate) { + object[] results = this.Invoke("createBaseRate", new object[] { baseRate }); + return ((BaseRate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRate[] createBaseRates([System.Xml.Serialization.XmlElementAttribute("baseRates")] +BaseRate[] baseRates) { + object[] results = this.Invoke("createBaseRates", new object[] { baseRates }); + return ((BaseRate[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRate getBaseRate(long baseRateId) { + object[] results = this.Invoke("getBaseRate", new object[] { baseRateId }); + return ((BaseRate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRatePage getBaseRatesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getBaseRatesByStatement", new object[] { filterStatement }); + return ((BaseRatePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performBaseRateAction(BaseRateAction baseRateAction, Statement filterStatement) { + object[] results = this.Invoke("performBaseRateAction", new object[] { baseRateAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRate updateBaseRate(BaseRate baseRate) { + object[] results = this.Invoke("updateBaseRate", new object[] { baseRate }); + return ((BaseRate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRate[] updateBaseRates([System.Xml.Serialization.XmlElementAttribute("baseRates")] +BaseRate[] baseRates) { + object[] results = this.Invoke("updateBaseRates", new object[] { baseRates }); + return ((BaseRate[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateBaseRates))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateBaseRates))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class BaseRateAction { + private string baseRateActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("BaseRateAction.Type")] + public string BaseRateActionType { + get { return this.baseRateActionTypeField; } + set { this.baseRateActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeactivateBaseRates : BaseRateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ActivateBaseRates : BaseRateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class BaseRatePage { + private BaseRate[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public BaseRate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductTemplateBaseRate))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductBaseRate))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class BaseRate { + private long rateCardIdField; + + private bool rateCardIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private BaseRateStatus statusField; + + private bool statusFieldSpecified; + + private string baseRateTypeField; + + public long rateCardId { + get { return this.rateCardIdField; } + set { + this.rateCardIdField = value; + this.rateCardIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardIdSpecified { + get { return this.rateCardIdFieldSpecified; } + set { this.rateCardIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public BaseRateStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseRate.Type")] + public string BaseRateType { + get { return this.baseRateTypeField; } + set { this.baseRateTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum BaseRateStatus { + ACTIVE, + INACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ProductTemplateBaseRate : BaseRate { + private long productTemplateIdField; + + private bool productTemplateIdFieldSpecified; + + private Money rateField; + + public long productTemplateId { + get { return this.productTemplateIdField; } + set { + this.productTemplateIdField = value; + this.productTemplateIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productTemplateIdSpecified { + get { return this.productTemplateIdFieldSpecified; } + set { this.productTemplateIdFieldSpecified = value; } + } + + public Money rate { + get { return this.rateField; } + set { this.rateField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ProductBaseRate : BaseRate { + private string productIdField; + + private Money rateField; + + public string productId { + get { return this.productIdField; } + set { this.productIdField = value; } + } + + public Money rate { + get { return this.rateField; } + set { this.rateField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class BaseRateActionError : ApiError { + private BaseRateActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BaseRateActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BaseRateActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum BaseRateActionErrorReason { + DUPLICATED_BASE_RATES, + ACTIVE_BASE_RATE_ALREADY_EXISTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ExchangeRateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ExchangeRateService : DfpSoapClient, IExchangeRateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ExchangeRateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/ExchangeRateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExchangeRate[] createExchangeRates([System.Xml.Serialization.XmlElementAttribute("exchangeRates")] +ExchangeRate[] exchangeRates) { + object[] results = this.Invoke("createExchangeRates", new object[] { exchangeRates }); + return ((ExchangeRate[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExchangeRate getExchangeRate(long exchangeRateId, [System.Xml.Serialization.XmlIgnoreAttribute()] +bool exchangeRateIdSpecified) { + object[] results = this.Invoke("getExchangeRate", new object[] { exchangeRateId, exchangeRateIdSpecified }); + return ((ExchangeRate) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExchangeRatePage getExchangeRatesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getExchangeRatesByStatement", new object[] { filterStatement }); + return ((ExchangeRatePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performExchangeRateAction(ExchangeRateAction exchangeRateAction, Statement filterStatement) { + object[] results = this.Invoke("performExchangeRateAction", new object[] { exchangeRateAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExchangeRate[] updateExchangeRates([System.Xml.Serialization.XmlElementAttribute("exchangeRates")] +ExchangeRate[] exchangeRates) { + object[] results = this.Invoke("updateExchangeRates", new object[] { exchangeRates }); + return ((ExchangeRate[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteExchangeRates))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class ExchangeRateAction { + private string exchangeRateActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ExchangeRateAction.Type")] + public string ExchangeRateActionType { + get { return this.exchangeRateActionTypeField; } + set { this.exchangeRateActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeleteExchangeRates : ExchangeRateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ExchangeRatePage { + private ExchangeRate[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ExchangeRate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ExchangeRate { + private long idField; + + private bool idFieldSpecified; + + private string currencyCodeField; + + private ExchangeRateRefreshRate refreshRateField; + + private bool refreshRateFieldSpecified; + + private ExchangeRateDirection directionField; + + private bool directionFieldSpecified; + + private long exchangeRateField; + + private bool exchangeRateFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public ExchangeRateRefreshRate refreshRate { + get { return this.refreshRateField; } + set { + this.refreshRateField = value; + this.refreshRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool refreshRateSpecified { + get { return this.refreshRateFieldSpecified; } + set { this.refreshRateFieldSpecified = value; } + } + + public ExchangeRateDirection direction { + get { return this.directionField; } + set { + this.directionField = value; + this.directionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool directionSpecified { + get { return this.directionFieldSpecified; } + set { this.directionFieldSpecified = value; } + } + + public long exchangeRate { + get { return this.exchangeRateField; } + set { + this.exchangeRateField = value; + this.exchangeRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool exchangeRateSpecified { + get { return this.exchangeRateFieldSpecified; } + set { this.exchangeRateFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ExchangeRateRefreshRate { + FIXED, + DAILY, + MONTHLY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ExchangeRateDirection { + TO_NETWORK, + FROM_NETWORK, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "PlacementServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SiteTargetingInfo))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class PlacementService : DfpSoapClient, IPlacementService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public PlacementService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/PlacementService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Placement createPlacement(Placement placement) { + object[] results = this.Invoke("createPlacement", new object[] { placement }); + return ((Placement) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Placement[] createPlacements([System.Xml.Serialization.XmlElementAttribute("placements")] +Placement[] placements) { + object[] results = this.Invoke("createPlacements", new object[] { placements }); + return ((Placement[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Placement getPlacement(long placementId) { + object[] results = this.Invoke("getPlacement", new object[] { placementId }); + return ((Placement) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual PlacementPage getPlacementsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getPlacementsByStatement", new object[] { filterStatement }); + return ((PlacementPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performPlacementAction(PlacementAction placementAction, Statement filterStatement) { + object[] results = this.Invoke("performPlacementAction", new object[] { placementAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Placement updatePlacement(Placement placement) { + object[] results = this.Invoke("updatePlacement", new object[] { placement }); + return ((Placement) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Placement[] updatePlacements([System.Xml.Serialization.XmlElementAttribute("placements")] +Placement[] placements) { + object[] results = this.Invoke("updatePlacements", new object[] { placements }); + return ((Placement[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivatePlacements))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchivePlacements))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivatePlacements))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class PlacementAction { + private string placementActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("PlacementAction.Type")] + public string PlacementActionType { + get { return this.placementActionTypeField; } + set { this.placementActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeactivatePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ArchivePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ActivatePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class PlacementPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Placement[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Placement[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Placement : SiteTargetingInfo { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private string placementCodeField; + + private InventoryStatus statusField; + + private bool statusFieldSpecified; + + private bool isAdSenseTargetingEnabledField; + + private bool isAdSenseTargetingEnabledFieldSpecified; + + private bool isAdPlannerTargetingEnabledField; + + private bool isAdPlannerTargetingEnabledFieldSpecified; + + private string adSenseTargetingLocaleField; + + private string[] targetedAdUnitIdsField; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public string placementCode { + get { return this.placementCodeField; } + set { this.placementCodeField = value; } + } + + public InventoryStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public bool isAdSenseTargetingEnabled { + get { return this.isAdSenseTargetingEnabledField; } + set { + this.isAdSenseTargetingEnabledField = value; + this.isAdSenseTargetingEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAdSenseTargetingEnabledSpecified { + get { return this.isAdSenseTargetingEnabledFieldSpecified; } + set { this.isAdSenseTargetingEnabledFieldSpecified = value; } + } + + public bool isAdPlannerTargetingEnabled { + get { return this.isAdPlannerTargetingEnabledField; } + set { + this.isAdPlannerTargetingEnabledField = value; + this.isAdPlannerTargetingEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAdPlannerTargetingEnabledSpecified { + get { return this.isAdPlannerTargetingEnabledFieldSpecified; } + set { this.isAdPlannerTargetingEnabledFieldSpecified = value; } + } + + public string adSenseTargetingLocale { + get { return this.adSenseTargetingLocaleField; } + set { this.adSenseTargetingLocaleField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedAdUnitIds")] + public string[] targetedAdUnitIds { + get { return this.targetedAdUnitIdsField; } + set { this.targetedAdUnitIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Placement))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class SiteTargetingInfo { + private string targetingDescriptionField; + + private string targetingSiteNameField; + + private string targetingAdLocationField; + + private string siteTargetingInfoTypeField; + + public string targetingDescription { + get { return this.targetingDescriptionField; } + set { this.targetingDescriptionField = value; } + } + + public string targetingSiteName { + get { return this.targetingSiteNameField; } + set { this.targetingSiteNameField = value; } + } + + public string targetingAdLocation { + get { return this.targetingAdLocationField; } + set { this.targetingAdLocationField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("SiteTargetingInfo.Type")] + public string SiteTargetingInfoType { + get { return this.siteTargetingInfoTypeField; } + set { this.siteTargetingInfoTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class PlacementError : ApiError { + private PlacementErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PlacementErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PlacementError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum PlacementErrorReason { + INVALID_ENTITY_TYPE, + SHARED_INVENTORY_ASSIGNED, + PLACEMENTS_CANNOT_INCLUDE_INVENTORY_FROM_MULTIPLE_DISTRIBUTOR_NETWORKS, + PLACEMENTS_CANNOT_INCLUDE_BOTH_LOCAL_AND_SHARED_INVENTORY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomFieldServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomFieldService : DfpSoapClient, ICustomFieldService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomFieldService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/CustomFieldService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomField createCustomField(CustomField customField) { + object[] results = this.Invoke("createCustomField", new object[] { customField }); + return ((CustomField) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldOption createCustomFieldOption(CustomFieldOption customFieldOption) { + object[] results = this.Invoke("createCustomFieldOption", new object[] { customFieldOption }); + return ((CustomFieldOption) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldOption[] createCustomFieldOptions([System.Xml.Serialization.XmlElementAttribute("customFieldOptions")] +CustomFieldOption[] customFieldOptions) { + object[] results = this.Invoke("createCustomFieldOptions", new object[] { customFieldOptions }); + return ((CustomFieldOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomField[] createCustomFields([System.Xml.Serialization.XmlElementAttribute("customFields")] +CustomField[] customFields) { + object[] results = this.Invoke("createCustomFields", new object[] { customFields }); + return ((CustomField[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomField getCustomField(long customFieldId) { + object[] results = this.Invoke("getCustomField", new object[] { customFieldId }); + return ((CustomField) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldOption getCustomFieldOption(long customFieldOptionId) { + object[] results = this.Invoke("getCustomFieldOption", new object[] { customFieldOptionId }); + return ((CustomFieldOption) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldPage getCustomFieldsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomFieldsByStatement", new object[] { filterStatement }); + return ((CustomFieldPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performCustomFieldAction(CustomFieldAction customFieldAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomFieldAction", new object[] { customFieldAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomField updateCustomField(CustomField customField) { + object[] results = this.Invoke("updateCustomField", new object[] { customField }); + return ((CustomField) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldOption updateCustomFieldOption(CustomFieldOption customFieldOption) { + object[] results = this.Invoke("updateCustomFieldOption", new object[] { customFieldOption }); + return ((CustomFieldOption) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldOption[] updateCustomFieldOptions([System.Xml.Serialization.XmlElementAttribute("customFieldOptions")] +CustomFieldOption[] customFieldOptions) { + object[] results = this.Invoke("updateCustomFieldOptions", new object[] { customFieldOptions }); + return ((CustomFieldOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomField[] updateCustomFields([System.Xml.Serialization.XmlElementAttribute("customFields")] +CustomField[] customFields) { + object[] results = this.Invoke("updateCustomFields", new object[] { customFields }); + return ((CustomField[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateCustomFields))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateCustomFields))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CustomFieldAction { + private string customFieldActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomFieldAction.Type")] + public string CustomFieldActionType { + get { return this.customFieldActionTypeField; } + set { this.customFieldActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeactivateCustomFields : CustomFieldAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ActivateCustomFields : CustomFieldAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CustomFieldPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomField[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomField[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DropDownCustomField))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CustomField { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private CustomFieldEntityType entityTypeField; + + private bool entityTypeFieldSpecified; + + private CustomFieldDataType dataTypeField; + + private bool dataTypeFieldSpecified; + + private CustomFieldVisibility visibilityField; + + private bool visibilityFieldSpecified; + + private string customFieldTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + public CustomFieldEntityType entityType { + get { return this.entityTypeField; } + set { + this.entityTypeField = value; + this.entityTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool entityTypeSpecified { + get { return this.entityTypeFieldSpecified; } + set { this.entityTypeFieldSpecified = value; } + } + + public CustomFieldDataType dataType { + get { return this.dataTypeField; } + set { + this.dataTypeField = value; + this.dataTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dataTypeSpecified { + get { return this.dataTypeFieldSpecified; } + set { this.dataTypeFieldSpecified = value; } + } + + public CustomFieldVisibility visibility { + get { return this.visibilityField; } + set { + this.visibilityField = value; + this.visibilitySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool visibilitySpecified { + get { return this.visibilityFieldSpecified; } + set { this.visibilityFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("CustomField.Type")] + public string CustomFieldType { + get { return this.customFieldTypeField; } + set { this.customFieldTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CustomFieldEntityType { + LINE_ITEM, + ORDER, + CREATIVE, + PRODUCT_TEMPLATE, + PRODUCT, + PROPOSAL, + PROPOSAL_LINE_ITEM, + USER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CustomFieldDataType { + STRING, + NUMBER, + TOGGLE, + DROP_DOWN, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CustomFieldVisibility { + API_ONLY, + READ_ONLY, + FULL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DropDownCustomField : CustomField { + private CustomFieldOption[] optionsField; + + [System.Xml.Serialization.XmlElementAttribute("options")] + public CustomFieldOption[] options { + get { return this.optionsField; } + set { this.optionsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CustomFieldOption { + private long idField; + + private bool idFieldSpecified; + + private long customFieldIdField; + + private bool customFieldIdFieldSpecified; + + private string displayNameField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long customFieldId { + get { return this.customFieldIdField; } + set { + this.customFieldIdField = value; + this.customFieldIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldIdSpecified { + get { return this.customFieldIdFieldSpecified; } + set { this.customFieldIdFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CustomFieldError : ApiError { + private CustomFieldErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomFieldErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomFieldError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CustomFieldErrorReason { + INVALID_CUSTOM_FIELD_FOR_OPTION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "SuggestedAdUnitServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class SuggestedAdUnitService : DfpSoapClient, ISuggestedAdUnitService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public SuggestedAdUnitService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/SuggestedAdUnitService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SuggestedAdUnit getSuggestedAdUnit(string suggestedAdUnitId) { + object[] results = this.Invoke("getSuggestedAdUnit", new object[] { suggestedAdUnitId }); + return ((SuggestedAdUnit) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SuggestedAdUnitPage getSuggestedAdUnitsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getSuggestedAdUnitsByStatement", new object[] { filterStatement }); + return ((SuggestedAdUnitPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SuggestedAdUnitUpdateResult performSuggestedAdUnitAction(SuggestedAdUnitAction suggestedAdUnitAction, Statement filterStatement) { + object[] results = this.Invoke("performSuggestedAdUnitAction", new object[] { suggestedAdUnitAction, filterStatement }); + return ((SuggestedAdUnitUpdateResult) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class SuggestedAdUnitUpdateResult { + private string[] newAdUnitIdsField; + + private int numChangesField; + + private bool numChangesFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("newAdUnitIds")] + public string[] newAdUnitIds { + get { return this.newAdUnitIdsField; } + set { this.newAdUnitIdsField = value; } + } + + public int numChanges { + get { return this.numChangesField; } + set { + this.numChangesField = value; + this.numChangesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numChangesSpecified { + get { return this.numChangesFieldSpecified; } + set { this.numChangesFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveSuggestedAdUnit))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class SuggestedAdUnitAction { + private string suggestedAdUnitActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("SuggestedAdUnitAction.Type")] + public string SuggestedAdUnitActionType { + get { return this.suggestedAdUnitActionTypeField; } + set { this.suggestedAdUnitActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ApproveSuggestedAdUnit : SuggestedAdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class SuggestedAdUnitPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private SuggestedAdUnit[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public SuggestedAdUnit[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class SuggestedAdUnit { + private string idField; + + private long numRequestsField; + + private bool numRequestsFieldSpecified; + + private string[] pathField; + + private AdUnitParent[] parentPathField; + + private AdUnitTargetWindow targetWindowField; + + private bool targetWindowFieldSpecified; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private AdUnitSize[] suggestedAdUnitSizesField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public long numRequests { + get { return this.numRequestsField; } + set { + this.numRequestsField = value; + this.numRequestsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numRequestsSpecified { + get { return this.numRequestsFieldSpecified; } + set { this.numRequestsFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("path")] + public string[] path { + get { return this.pathField; } + set { this.pathField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("parentPath")] + public AdUnitParent[] parentPath { + get { return this.parentPathField; } + set { this.parentPathField = value; } + } + + public AdUnitTargetWindow targetWindow { + get { return this.targetWindowField; } + set { + this.targetWindowField = value; + this.targetWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetWindowSpecified { + get { return this.targetWindowFieldSpecified; } + set { this.targetWindowFieldSpecified = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("suggestedAdUnitSizes")] + public AdUnitSize[] suggestedAdUnitSizes { + get { return this.suggestedAdUnitSizesField; } + set { this.suggestedAdUnitSizesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProposalServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProposalService : DfpSoapClient, IProposalService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProposalService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/ProposalService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Proposal createProposal(Proposal proposal) { + object[] results = this.Invoke("createProposal", new object[] { proposal }); + return ((Proposal) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Proposal[] createProposals([System.Xml.Serialization.XmlElementAttribute("proposals")] +Proposal[] proposals) { + object[] results = this.Invoke("createProposals", new object[] { proposals }); + return ((Proposal[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Proposal getProposal(long proposalId) { + object[] results = this.Invoke("getProposal", new object[] { proposalId }); + return ((Proposal) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalPage getProposalsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getProposalsByStatement", new object[] { filterStatement }); + return ((ProposalPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performProposalAction(ProposalAction proposalAction, Statement filterStatement) { + object[] results = this.Invoke("performProposalAction", new object[] { proposalAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Proposal updateProposal(Proposal proposal) { + object[] results = this.Invoke("updateProposal", new object[] { proposal }); + return ((Proposal) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Proposal[] updateProposals([System.Xml.Serialization.XmlElementAttribute("proposals")] +Proposal[] proposals) { + object[] results = this.Invoke("updateProposals", new object[] { proposals }); + return ((Proposal[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveProposals))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitProposalsForApproval))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RetractProposals))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveProposals))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class ProposalAction { + private string proposalActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProposalAction.Type")] + public string ProposalActionType { + get { return this.proposalActionTypeField; } + set { this.proposalActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class UnarchiveProposals : ProposalAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class SubmitProposalsForApproval : ProposalAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RetractProposals : ProposalAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ArchiveProposals : ProposalAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ProposalPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Proposal[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Proposal[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Proposal { + private long idField; + + private bool idFieldSpecified; + + private long dfpOrderIdField; + + private bool dfpOrderIdFieldSpecified; + + private string nameField; + + private PricingModel pricingModelField; + + private bool pricingModelFieldSpecified; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + private ProposalStatus statusField; + + private bool statusFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private ProposalCompanyAssociation advertiserField; + + private ProposalCompanyAssociation[] agenciesField; + + private int probabilityToCloseField; + + private bool probabilityToCloseFieldSpecified; + + private BillingCap billingCapField; + + private bool billingCapFieldSpecified; + + private BillingSchedule billingScheduleField; + + private bool billingScheduleFieldSpecified; + + private BillingSource billingSourceField; + + private bool billingSourceFieldSpecified; + + private string poNumberField; + + private string notesField; + + private Money budgetField; + + private SalespersonSplit primarySalespersonField; + + private SalespersonSplit[] secondarySalespeopleField; + + private long[] salesPlannerIdsField; + + private long primaryTraffickerIdField; + + private bool primaryTraffickerIdFieldSpecified; + + private long[] secondaryTraffickerIdsField; + + private long[] appliedTeamIdsField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private long advertiserDiscountField; + + private bool advertiserDiscountFieldSpecified; + + private long proposalDiscountField; + + private bool proposalDiscountFieldSpecified; + + private Money additionalAdjustmentField; + + private string currencyCodeField; + + private long exchangeRateField; + + private bool exchangeRateFieldSpecified; + + private bool refreshExchangeRateField; + + private bool refreshExchangeRateFieldSpecified; + + private long agencyCommissionField; + + private bool agencyCommissionFieldSpecified; + + private long valueAddedTaxField; + + private bool valueAddedTaxFieldSpecified; + + private ProposalApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long dfpOrderId { + get { return this.dfpOrderIdField; } + set { + this.dfpOrderIdField = value; + this.dfpOrderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dfpOrderIdSpecified { + get { return this.dfpOrderIdFieldSpecified; } + set { this.dfpOrderIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public PricingModel pricingModel { + get { return this.pricingModelField; } + set { + this.pricingModelField = value; + this.pricingModelSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool pricingModelSpecified { + get { return this.pricingModelFieldSpecified; } + set { this.pricingModelFieldSpecified = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public ProposalStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public ProposalCompanyAssociation advertiser { + get { return this.advertiserField; } + set { this.advertiserField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("agencies")] + public ProposalCompanyAssociation[] agencies { + get { return this.agenciesField; } + set { this.agenciesField = value; } + } + + public int probabilityToClose { + get { return this.probabilityToCloseField; } + set { + this.probabilityToCloseField = value; + this.probabilityToCloseSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool probabilityToCloseSpecified { + get { return this.probabilityToCloseFieldSpecified; } + set { this.probabilityToCloseFieldSpecified = value; } + } + + public BillingCap billingCap { + get { return this.billingCapField; } + set { + this.billingCapField = value; + this.billingCapSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingCapSpecified { + get { return this.billingCapFieldSpecified; } + set { this.billingCapFieldSpecified = value; } + } + + public BillingSchedule billingSchedule { + get { return this.billingScheduleField; } + set { + this.billingScheduleField = value; + this.billingScheduleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingScheduleSpecified { + get { return this.billingScheduleFieldSpecified; } + set { this.billingScheduleFieldSpecified = value; } + } + + public BillingSource billingSource { + get { return this.billingSourceField; } + set { + this.billingSourceField = value; + this.billingSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingSourceSpecified { + get { return this.billingSourceFieldSpecified; } + set { this.billingSourceFieldSpecified = value; } + } + + public string poNumber { + get { return this.poNumberField; } + set { this.poNumberField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public Money budget { + get { return this.budgetField; } + set { this.budgetField = value; } + } + + public SalespersonSplit primarySalesperson { + get { return this.primarySalespersonField; } + set { this.primarySalespersonField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondarySalespeople")] + public SalespersonSplit[] secondarySalespeople { + get { return this.secondarySalespeopleField; } + set { this.secondarySalespeopleField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("salesPlannerIds")] + public long[] salesPlannerIds { + get { return this.salesPlannerIdsField; } + set { this.salesPlannerIdsField = value; } + } + + public long primaryTraffickerId { + get { return this.primaryTraffickerIdField; } + set { + this.primaryTraffickerIdField = value; + this.primaryTraffickerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool primaryTraffickerIdSpecified { + get { return this.primaryTraffickerIdFieldSpecified; } + set { this.primaryTraffickerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryTraffickerIds")] + public long[] secondaryTraffickerIds { + get { return this.secondaryTraffickerIdsField; } + set { this.secondaryTraffickerIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public long advertiserDiscount { + get { return this.advertiserDiscountField; } + set { + this.advertiserDiscountField = value; + this.advertiserDiscountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserDiscountSpecified { + get { return this.advertiserDiscountFieldSpecified; } + set { this.advertiserDiscountFieldSpecified = value; } + } + + public long proposalDiscount { + get { return this.proposalDiscountField; } + set { + this.proposalDiscountField = value; + this.proposalDiscountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool proposalDiscountSpecified { + get { return this.proposalDiscountFieldSpecified; } + set { this.proposalDiscountFieldSpecified = value; } + } + + public Money additionalAdjustment { + get { return this.additionalAdjustmentField; } + set { this.additionalAdjustmentField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public long exchangeRate { + get { return this.exchangeRateField; } + set { + this.exchangeRateField = value; + this.exchangeRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool exchangeRateSpecified { + get { return this.exchangeRateFieldSpecified; } + set { this.exchangeRateFieldSpecified = value; } + } + + public bool refreshExchangeRate { + get { return this.refreshExchangeRateField; } + set { + this.refreshExchangeRateField = value; + this.refreshExchangeRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool refreshExchangeRateSpecified { + get { return this.refreshExchangeRateFieldSpecified; } + set { this.refreshExchangeRateFieldSpecified = value; } + } + + public long agencyCommission { + get { return this.agencyCommissionField; } + set { + this.agencyCommissionField = value; + this.agencyCommissionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool agencyCommissionSpecified { + get { return this.agencyCommissionFieldSpecified; } + set { this.agencyCommissionFieldSpecified = value; } + } + + public long valueAddedTax { + get { return this.valueAddedTaxField; } + set { + this.valueAddedTaxField = value; + this.valueAddedTaxSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueAddedTaxSpecified { + get { return this.valueAddedTaxFieldSpecified; } + set { this.valueAddedTaxFieldSpecified = value; } + } + + public ProposalApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum PricingModel { + NET, + GROSS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ProposalStatus { + DRAFT, + PENDING_APPROVAL, + APPROVED, + REJECTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ProposalCompanyAssociation { + private long companyIdField; + + private bool companyIdFieldSpecified; + + private ProposalCompanyAssociationType typeField; + + private bool typeFieldSpecified; + + private long[] contactIdsField; + + public long companyId { + get { return this.companyIdField; } + set { + this.companyIdField = value; + this.companyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companyIdSpecified { + get { return this.companyIdFieldSpecified; } + set { this.companyIdFieldSpecified = value; } + } + + public ProposalCompanyAssociationType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("contactIds")] + public long[] contactIds { + get { return this.contactIdsField; } + set { this.contactIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ProposalCompanyAssociationType { + PRIMARY_AGENCY, + BILLING_AGENCY, + BRANDING_AGENCY, + OTHER_AGENCY, + ADVERTISER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum BillingCap { + NO_CAP, + CAPPED_CUMULATIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum BillingSchedule { + PRORATED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum BillingSource { + CONTRACTED, + DFP_VOLUME, + THIRD_PARTY_VOLUME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class SalespersonSplit { + private long userIdField; + + private bool userIdFieldSpecified; + + private int splitField; + + private bool splitFieldSpecified; + + public long userId { + get { return this.userIdField; } + set { + this.userIdField = value; + this.userIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userIdSpecified { + get { return this.userIdFieldSpecified; } + set { this.userIdFieldSpecified = value; } + } + + public int split { + get { return this.splitField; } + set { + this.splitField = value; + this.splitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool splitSpecified { + get { return this.splitFieldSpecified; } + set { this.splitFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ProposalApprovalStatus { + PENDING, + NON_PENDING, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class WorkflowActionError : ApiError { + private WorkflowActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public WorkflowActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "WorkflowActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum WorkflowActionErrorReason { + NOT_APPLICABLE, + WORKFLOW_DEFINITION_NOT_FOUND, + EMPTY_ACTION_LIST, + NOT_ACTION_APPROVER, + WORKFLOW_ALREADY_COMPLETED, + WORKFLOW_ALREADY_FAILED, + WORKFLOW_ALREADY_CANCELED, + ACTION_COMPLETED, + ACTION_FAILED, + ACTION_CANCELED, + ACTION_NOT_ACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ProposalLineItemError : ApiError { + private ProposalLineItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProposalLineItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProposalLineItemError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ProposalLineItemErrorReason { + NOT_SAME_RATE_CARD, + LINE_ITEM_TYPE_NOT_ALLOWED, + END_DATE_TIME_NOT_AFTER_START_TIME, + END_DATE_TIME_TOO_LATE, + START_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_IS_IN_PAST, + FRONTLOADED_NOT_ALLOWED, + ALL_ROADBLOCK_NOT_ALLOWED, + CREATIVE_SET_ROADBLOCK_NOT_ALLOWED, + ALREADY_STARTED, + CONFLICT_WITH_PRODUCT, + MOBILE_TECH_CRITERIA_NOT_SUPPORTED, + UNSUPPORTED_TARGETING_TYPE, + WRONG_COST, + INVALID_PRIORITY_FOR_LINE_ITEM_TYPE, + UPDATE_PROPOSAL_LINE_ITEM_NOT_ALLOWED, + CANNOT_UPDATE_TO_OR_FROM_CREATIVE_SET_ROADBLOCK, + SEQUENTIAL_CREATIVE_ROTATION_NOT_ALLOWED, + UPDATE_RESERVATION_NOT_ALLOWED, + INVALID_COMPANION_DELIVERY_OPTION_FOR_ROADBLOCKING_TYPE, + INCONSISTENT_ROADBLOCK_TYPE, + INVALID_UNITS_BOUGHT_BUFFER, + UPDATE_COST_ADJUSTMENT_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ProposalError : ApiError { + private ProposalErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProposalErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProposalError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ProposalErrorReason { + AD_SERVER_UNKNOWN_ERROR, + AD_SERVER_API_ERROR, + UPDATE_ADVERTISER_NOT_ALLOWED, + UPDATE_PROPOSAL_NOT_ALLOWED, + INVALID_CONTACT, + DUPLICATED_CONTACT, + UNACCEPTABLE_COMPANY_CREDIT_STATUS, + PRIMARY_AGENCY_REQUIRED, + PRIMARY_AGENCY_NOT_UNIQUE, + DUPLICATED_COMPANY_ASSOCIATION, + DUPLICATED_SALESPERSON, + DUPLICATED_SALES_PLANNER, + DUPLICATED_TRAFFICKER, + HAS_NO_UNARCHIVED_PROPOSAL_LINEITEMS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ProposalActionError : ApiError { + private ProposalActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProposalActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProposalActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ProposalActionErrorReason { + NOT_APPLICABLE, + IS_ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ProductError : ApiError { + private ProductErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProductErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ProductErrorReason { + TEMPLATE_NOT_FOUND, + MALFORMED_PRODUCT_ID, + BAD_PRODUCT_ID_FEATURE, + BAD_PRODUCT_TEMPLATE_ID, + CANNOT_UPDATE_ARCHIVED_PRODUCT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class PrecisionError : ApiError { + private PrecisionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PrecisionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PrecisionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum PrecisionErrorReason { + WRONG_PRECISION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class BillingError : ApiError { + private BillingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BillingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BillingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum BillingErrorReason { + UNSUPPORTED_BILLING_SCHEDULE, + UNSUPPORTED_BILLING_CAP, + MISSING_BILLING_SOURCE, + MISSING_BILLING_SCHEDULE, + MISSING_BILLING_CAP, + INVALID_BILLING_SOURCE_FOR_OFFLINE, + UPDATE_BILLING_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReportServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReportService : DfpSoapClient, IReportService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReportService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/ReportService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual string getReportDownloadURL(long reportJobId, ExportFormat exportFormat) { + object[] results = this.Invoke("getReportDownloadURL", new object[] { reportJobId, exportFormat }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual string getReportDownloadUrlWithOptions(long reportJobId, ReportDownloadOptions reportDownloadOptions) { + object[] results = this.Invoke("getReportDownloadUrlWithOptions", new object[] { reportJobId, reportDownloadOptions }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReportJob getReportJob(long reportJobId) { + object[] results = this.Invoke("getReportJob", new object[] { reportJobId }); + return ((ReportJob) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReportJob runReportJob(ReportJob reportJob) { + object[] results = this.Invoke("runReportJob", new object[] { reportJob }); + return ((ReportJob) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ReportQuery { + private Dimension[] dimensionsField; + + private ReportQueryAdUnitView adUnitViewField; + + private bool adUnitViewFieldSpecified; + + private Column[] columnsField; + + private DimensionAttribute[] dimensionAttributesField; + + private long[] customFieldIdsField; + + private Date startDateField; + + private Date endDateField; + + private DateRangeType dateRangeTypeField; + + private bool dateRangeTypeFieldSpecified; + + private DimensionFilter[] dimensionFiltersField; + + private Statement statementField; + + private string timeZoneField; + + [System.Xml.Serialization.XmlElementAttribute("dimensions")] + public Dimension[] dimensions { + get { return this.dimensionsField; } + set { this.dimensionsField = value; } + } + + public ReportQueryAdUnitView adUnitView { + get { return this.adUnitViewField; } + set { + this.adUnitViewField = value; + this.adUnitViewSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adUnitViewSpecified { + get { return this.adUnitViewFieldSpecified; } + set { this.adUnitViewFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("columns")] + public Column[] columns { + get { return this.columnsField; } + set { this.columnsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("dimensionAttributes")] + public DimensionAttribute[] dimensionAttributes { + get { return this.dimensionAttributesField; } + set { this.dimensionAttributesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldIds")] + public long[] customFieldIds { + get { return this.customFieldIdsField; } + set { this.customFieldIdsField = value; } + } + + public Date startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public Date endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + public DateRangeType dateRangeType { + get { return this.dateRangeTypeField; } + set { + this.dateRangeTypeField = value; + this.dateRangeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dateRangeTypeSpecified { + get { return this.dateRangeTypeFieldSpecified; } + set { this.dateRangeTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("dimensionFilters")] + public DimensionFilter[] dimensionFilters { + get { return this.dimensionFiltersField; } + set { this.dimensionFiltersField = value; } + } + + public Statement statement { + get { return this.statementField; } + set { this.statementField = value; } + } + + public string timeZone { + get { return this.timeZoneField; } + set { this.timeZoneField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum Dimension { + MONTH, + MONTH_AND_YEAR, + WEEK, + DATE, + DAY, + HOUR, + LINE_ITEM_ID, + LINE_ITEM_NAME, + LINE_ITEM_TYPE, + ORDER_ID, + ORDER_NAME, + ADVERTISER_ID, + ADVERTISER_NAME, + SALESPERSON_ID, + SALESPERSON_NAME, + CREATIVE_ID, + CREATIVE_NAME, + CREATIVE_TYPE, + CUSTOM_EVENT_ID, + CUSTOM_EVENT_NAME, + CUSTOM_EVENT_TYPE, + CREATIVE_SIZE, + AD_UNIT_ID, + AD_UNIT_NAME, + AD_UNIT_ANCESTOR_AD_UNIT_ID, + AD_UNIT_ANCESTOR_AD_UNIT_NAME, + PLACEMENT_ID, + PLACEMENT_NAME, + GENERIC_CRITERION_NAME, + COUNTRY_CRITERIA_ID, + COUNTRY_NAME, + REGION_CRITERIA_ID, + REGION_NAME, + CITY_CRITERIA_ID, + CITY_NAME, + METRO_CRITERIA_ID, + METRO_NAME, + POSTAL_CODE_CRITERIA_ID, + POSTAL_CODE, + CUSTOM_TARGETING_VALUE_ID, + CUSTOM_CRITERIA, + ACTIVITY_ID, + ACTIVITY_NAME, + ACTIVITY_GROUP_ID, + ACTIVITY_GROUP_NAME, + CONTENT_ID, + CONTENT_NAME, + CONTENT_BUNDLE_ID, + CONTENT_BUNDLE_NAME, + VIDEO_FALLBACK_POSITION, + POSITION_OF_POD, + POSITION_IN_POD, + AD_REQUEST_AD_UNIT_SIZES, + AD_REQUEST_CUSTOM_CRITERIA, + MASTER_COMPANION_CREATIVE_ID, + MASTER_COMPANION_CREATIVE_NAME, + DISTRIBUTION_PARTNER_ID, + DISTRIBUTION_PARTNER_NAME, + CONTENT_PARTNER_ID, + CONTENT_PARTNER_NAME, + RIGHTS_HOLDER_ID, + RIGHTS_HOLDER_NAME, + PROPOSAL_LINE_ITEM_ID, + PROPOSAL_LINE_ITEM_NAME, + PROPOSAL_ID, + PROPOSAL_NAME, + PROPOSAL_SALESPERSON_ID, + PROPOSAL_SALESPERSON_NAME, + PROPOSAL_AGENCY_ID, + PROPOSAL_AGENCY_NAME, + PRODUCT_ID, + PRODUCT_NAME, + PRODUCT_TEMPLATE_ID, + PRODUCT_TEMPLATE_NAME, + AUDIENCE_SEGMENT_ID, + AUDIENCE_SEGMENT_NAME, + AUDIENCE_SEGMENT_DATA_PROVIDER_NAME + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportQuery.AdUnitView", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ReportQueryAdUnitView { + TOP_LEVEL, + FLAT, + HIERARCHICAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum Column { + AD_SERVER_IMPRESSIONS, + AD_SERVER_TARGETED_IMPRESSIONS, + AD_SERVER_CLICKS, + AD_SERVER_TARGETED_CLICKS, + AD_SERVER_CTR, + AD_SERVER_CPM_AND_CPC_REVENUE, + AD_SERVER_CPD_REVENUE, + AD_SERVER_CPA_REVENUE, + AD_SERVER_ALL_REVENUE, + AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM, + AD_SERVER_WITH_CPD_AVERAGE_ECPM, + AD_SERVER_INVENTORY_LEVEL_PERCENT_IMPRESSIONS, + AD_SERVER_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + AD_SERVER_INVENTORY_LEVEL_PERCENT_CLICKS, + AD_SERVER_LINE_ITEM_LEVEL_PERCENT_CLICKS, + AD_SERVER_INVENTORY_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + AD_SERVER_INVENTORY_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_SERVER_LINE_ITEM_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + AD_SERVER_LINE_ITEM_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_SERVER_DELIVERY_INDICATOR, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + ADSENSE_LINE_ITEM_LEVEL_IMPRESSIONS, + ADSENSE_LINE_ITEM_LEVEL_TARGETED_IMPRESSIONS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + ADSENSE_LINE_ITEM_LEVEL_CLICKS, + ADSENSE_LINE_ITEM_LEVEL_TARGETED_CLICKS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CTR, + ADSENSE_LINE_ITEM_LEVEL_CTR, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_REVENUE, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_AVERAGE_ECPM, + ADSENSE_LINE_ITEM_LEVEL_AVERAGE_ECPM, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_PERCENT_IMPRESSIONS, + ADSENSE_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_PERCENT_CLICKS, + ADSENSE_LINE_ITEM_LEVEL_PERCENT_CLICKS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_WITH_CPD_PERCENT_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_IMPRESSIONS, + AD_EXCHANGE_LINE_ITEM_LEVEL_TARGETED_IMPRESSIONS, + AD_EXCHANGE_LINE_ITEM_LEVEL_CLICKS, + AD_EXCHANGE_LINE_ITEM_LEVEL_TARGETED_CLICKS, + AD_EXCHANGE_LINE_ITEM_LEVEL_CTR, + AD_EXCHANGE_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + AD_EXCHANGE_LINE_ITEM_LEVEL_PERCENT_CLICKS, + AD_EXCHANGE_LINE_ITEM_LEVEL_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_AVERAGE_ECPM, + TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + TOTAL_LINE_ITEM_LEVEL_IMPRESSIONS, + TOTAL_LINE_ITEM_LEVEL_TARGETED_IMPRESSIONS, + TOTAL_INVENTORY_LEVEL_CLICKS, + TOTAL_LINE_ITEM_LEVEL_CLICKS, + TOTAL_LINE_ITEM_LEVEL_TARGETED_CLICKS, + TOTAL_INVENTORY_LEVEL_CTR, + TOTAL_LINE_ITEM_LEVEL_CTR, + TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE, + TOTAL_INVENTORY_LEVEL_ALL_REVENUE, + TOTAL_LINE_ITEM_LEVEL_CPM_AND_CPC_REVENUE, + TOTAL_LINE_ITEM_LEVEL_ALL_REVENUE, + TOTAL_INVENTORY_LEVEL_WITHOUT_CPD_AVERAGE_ECPM, + TOTAL_INVENTORY_LEVEL_WITH_CPD_AVERAGE_ECPM, + TOTAL_LINE_ITEM_LEVEL_WITHOUT_CPD_AVERAGE_ECPM, + TOTAL_LINE_ITEM_LEVEL_WITH_CPD_AVERAGE_ECPM, + TOTAL_INVENTORY_LEVEL_UNFILLED_IMPRESSIONS, + MERGED_AD_SERVER_DELIVERY_INDICATOR, + MERGED_AD_SERVER_IMPRESSIONS, + MERGED_AD_SERVER_CLICKS, + MERGED_AD_SERVER_CTR, + MERGED_AD_SERVER_CPM_AND_CPC_REVENUE, + MERGED_AD_SERVER_ALL_REVENUE, + MERGED_AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM, + MERGED_AD_SERVER_WITH_CPD_AVERAGE_ECPM, + OPTIMIZATION_CONTROL_IMPRESSIONS, + OPTIMIZATION_CONTROL_CLICKS, + OPTIMIZATION_CONTROL_CTR, + OPTIMIZATION_OPTIMIZED_IMPRESSIONS, + OPTIMIZATION_OPTIMIZED_CLICKS, + OPTIMIZATION_NON_OPTIMIZED_IMPRESSIONS, + OPTIMIZATION_NON_OPTIMIZED_CLICKS, + OPTIMIZATION_EXTRA_CLICKS, + OPTIMIZATION_OPTIMIZED_CTR, + OPTIMIZATION_LIFT, + OPTIMIZATION_COVERAGE, + OPTIMIZATION_BEHIND_SCHEDULE_IMPRESSIONS, + OPTIMIZATION_NO_CLICKS_RECORDED_IMPRESSIONS, + OPTIMIZATION_SPONSORSHIP_IMPRESSIONS, + OPTIMIZATION_AS_FAST_AS_POSSIBLE_IMPRESSIONS, + OPTIMIZATION_NO_ABSOLUTE_LIFETIME_GOAL_IMPRESSIONS, + OPTIMIZATION_CONTROL_REVENUE, + OPTIMIZATION_OPTIMIZED_REVENUE, + OPTIMIZATION_CONTROL_ECPM, + OPTIMIZATION_OPTIMIZED_ECPM, + OPTIMIZATION_FREED_UP_IMPRESSIONS, + OPTIMIZATION_ECPM_LIFT, + REACH_FREQUENCY, + REACH_AVERAGE_REVENUE, + REACH, + SELL_THROUGH_FORECASTED_IMPRESSIONS, + SELL_THROUGH_AVAILABLE_IMPRESSIONS, + SELL_THROUGH_RESERVED_IMPRESSIONS, + SELL_THROUGH_SELL_THROUGH_RATE, + RICH_MEDIA_BACKUP_IMAGES, + RICH_MEDIA_DISPLAY_TIME, + RICH_MEDIA_AVERAGE_DISPLAY_TIME, + RICH_MEDIA_EXPANSIONS, + RICH_MEDIA_EXPANDING_TIME, + RICH_MEDIA_INTERACTION_TIME, + RICH_MEDIA_INTERACTION_COUNT, + RICH_MEDIA_INTERACTION_RATE, + RICH_MEDIA_AVERAGE_INTERACTION_TIME, + RICH_MEDIA_INTERACTION_IMPRESSIONS, + RICH_MEDIA_MANUAL_CLOSES, + RICH_MEDIA_FULL_SCREEN_IMPRESSIONS, + RICH_MEDIA_VIDEO_INTERACTIONS, + RICH_MEDIA_VIDEO_INTERACTION_RATE, + RICH_MEDIA_VIDEO_MUTES, + RICH_MEDIA_VIDEO_PAUSES, + RICH_MEDIA_VIDEO_PLAYES, + RICH_MEDIA_VIDEO_MIDPOINTS, + RICH_MEDIA_VIDEO_COMPLETES, + RICH_MEDIA_VIDEO_REPLAYS, + RICH_MEDIA_VIDEO_STOPS, + RICH_MEDIA_VIDEO_UNMUTES, + RICH_MEDIA_VIDEO_VIEW_TIME, + RICH_MEDIA_VIDEO_VIEW_RATE, + RICH_MEDIA_CUSTOM_EVENT_TIME, + RICH_MEDIA_CUSTOM_EVENT_COUNT, + VIDEO_INTERACTION_START, + VIDEO_INTERACTION_FIRST_QUARTILE, + VIDEO_INTERACTION_MIDPOINT, + VIDEO_INTERACTION_THIRD_QUARTILE, + VIDEO_INTERACTION_COMPLETE, + VIDEO_INTERACTION_VIEW_RATE, + VIDEO_INTERACTION_AVERAGE_VIEW_RATE, + VIDEO_INTERACTION_COMPLETION_RATE, + VIDEO_INTERACTION_ERROR_COUNT, + VIDEO_INTERACTION_VIDEO_LENGTH, + VIDEO_INTERACTION_PAUSE, + VIDEO_INTERACTION_RESUME, + VIDEO_INTERACTION_REWIND, + VIDEO_INTERACTION_MUTE, + VIDEO_INTERACTION_UNMUTE, + VIDEO_INTERACTION_COLLAPSE, + VIDEO_INTERACTION_EXPAND, + VIDEO_INTERACTION_FULL_SCREEN, + VIDEO_INTERACTION_AVERAGE_INTERACTION_RATE, + VIDEO_INTERACTION_VIDEO_SKIPS, + VIDEO_INTERACTION_VIDEO_SKIP_SHOWN, + VIDEO_INTERACTION_ENGAGED_VIEW, + VIDEO_INTERACTION_VIEW_THROUGH_RATE, + ACTIVE_VIEW_VIEWABLE_IMPRESSIONS, + ACTIVE_VIEW_NOT_VIEWABLE_IMPRESSIONS, + ACTIVE_VIEW_NOT_MEASURABLE_IMPRESSIONS, + ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE, + ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS, + ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE, + DISTRIBUTION_PARTNER_IMPRESSIONS, + DISTRIBUTION_PARTNER_CLICKS, + DISTRIBUTION_PARTNER_CTR, + DISTRIBUTION_PARTNER_GROSS_REVENUE, + DISTRIBUTION_PARTNER_HOST_REVENUE, + DISTRIBUTION_PARTNER_HOST_ECPM, + DISTRIBUTION_PARTNER_PARTNER_REVENUE, + DISTRIBUTION_PARTNER_PARTNER_ECPM, + CONTENT_PARTNER_IMPRESSIONS, + CONTENT_PARTNER_CLICKS, + CONTENT_PARTNER_CTR, + CONTENT_PARTNER_GROSS_REVENUE, + CONTENT_PARTNER_HOST_REVENUE, + CONTENT_PARTNER_HOST_ECPM, + CONTENT_PARTNER_PARTNER_REVENUE, + CONTENT_PARTNER_PARTNER_ECPM, + RIGHTS_HOLDER_IMPRESSIONS, + RIGHTS_HOLDER_CLICKS, + RIGHTS_HOLDER_CTR, + RIGHTS_HOLDER_GROSS_REVENUE, + RIGHTS_HOLDER_HOST_REVENUE, + RIGHTS_HOLDER_HOST_ECPM, + RIGHTS_HOLDER_PARTNER_REVENUE, + RIGHTS_HOLDER_PARTNER_ECPM, + VIEW_THROUGH_CONVERSIONS, + CONVERSIONS_PER_THOUSAND_IMPRESSIONS, + CLICK_THROUGH_CONVERSIONS, + CONVERSIONS_PER_CLICK, + VIEW_THROUGH_REVENUE, + CLICK_THROUGH_REVENUE, + TOTAL_CONVERSIONS, + TOTAL_CONVERSION_REVENUE, + CONTRACTED_REVENUE_CONTRACTED_NET_REVENUE, + CONTRACTED_REVENUE_LOCAL_CONTRACTED_NET_REVENUE, + CONTRACTED_REVENUE_CONTRACTED_GROSS_REVENUE, + CONTRACTED_REVENUE_LOCAL_CONTRACTED_GROSS_REVENUE, + CONTRACTED_REVENUE_CONTRACTED_PLACEMENT_NET_REVENUE, + CONTRACTED_REVENUE_CONTRACTED_PLACEMENT_GROSS_REVENUE, + CONTRACTED_REVENUE_CONTRACTED_VAT, + CONTRACTED_REVENUE_LOCAL_CONTRACTED_VAT, + CONTRACTED_REVENUE_CONTRACTED_AGENCY_COMMISSION, + CONTRACTED_REVENUE_LOCAL_CONTRACTED_AGENCY_COMMISSION, + SALES_CONTRACT_CONTRACTED_IMPRESSIONS, + SALES_CONTRACT_CONTRACTED_CLICKS, + SALES_CONTRACT_CONTRACTED_VOLUME, + SALES_CONTRACT_BUDGET, + SALES_CONTRACT_REMAINING_BUDGET, + SALES_CONTRACT_BUFFERED_IMPRESSIONS, + SALES_CONTRACT_BUFFERED_CLICKS, + UNIFIED_REVENUE_UNIFIED_NET_REVENUE, + UNIFIED_REVENUE_LOCAL_UNIFIED_NET_REVENUE, + UNIFIED_REVENUE_UNIFIED_GROSS_REVENUE, + UNIFIED_REVENUE_LOCAL_UNIFIED_GROSS_REVENUE, + UNIFIED_REVENUE_UNIFIED_AGENCY_COMMISSION, + UNIFIED_REVENUE_LOCAL_UNIFIED_AGENCY_COMMISSION, + SALES_PIPELINE_PIPELINE_NET_REVENUE, + SALES_PIPELINE_LOCAL_PIPELINE_NET_REVENUE, + SALES_PIPELINE_PIPELINE_GROSS_REVENUE, + SALES_PIPELINE_LOCAL_PIPELINE_GROSS_REVENUE, + SALES_PIPELINE_PIPELINE_AGENCY_COMMISSION, + SALES_PIPELINE_LOCAL_PIPELINE_AGENCY_COMMISSION, + RECONCILIATION_LAST_DATE_TIME, + RECONCILIATION_RECONCILIATION_STATUS, + RECONCILIATION_DFP_VOLUME, + RECONCILIATION_THIRD_PARTY_VOLUME, + RECONCILIATION_RECONCILED_VOLUME, + RECONCILIATION_DISCREPANCY, + RECONCILIATION_RECONCILED_REVENUE, + BILLING_BILLABLE_NET_REVENUE, + BILLING_LOCAL_BILLABLE_NET_REVENUE, + BILLING_BILLABLE_GROSS_REVENUE, + BILLING_LOCAL_BILLABLE_GROSS_REVENUE, + BILLING_BILLABLE_VAT, + BILLING_LOCAL_BILLABLE_VAT, + BILLING_BILLABLE_AGENCY_COMMISSION, + BILLING_LOCAL_BILLABLE_AGENCY_COMMISSION, + BILLING_CAP_QUANTITY, + BILLING_BILLABLE_VOLUME, + BILLING_DELIVERY_ROLLOVER_FROM_PREVIOUS, + DISCOUNTS_BREAKDOWN_ADDITIONAL_ADJUSTMENT, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_OVERALL_DISCOUNT, + DISCOUNTS_BREAKDOWN_BILLABLE_NET_OVERALL_DISCOUNT, + DISCOUNTS_BREAKDOWN_BILLABLE_NET_EXCLUDED_PREMIUMS, + DISCOUNTS_BREAKDOWN_BILLABLE_NET_ADVERTISER_DISCOUNT, + DISCOUNTS_BREAKDOWN_BILLABLE_NET_PRODUCT_ADJUSTMENT, + DISCOUNTS_BREAKDOWN_BILLABLE_NET_PROPOSAL_DISCOUNT, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_EXCLUDED_PREMIUMS, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_ADVERTISER_DISCOUNT, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_PRODUCT_ADJUSTMENT, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_PROPOSAL_DISCOUNT, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_NON_BILLABLE, + SALESPERSON_PERFORMANCE_SHARED_PIPELINE_NET_REVENUE, + SALESPERSON_PERFORMANCE_SHARED_PIPELINE_GROSS_REVENUE, + SALESPERSON_PERFORMANCE_SHARED_UNIFIED_NET_REVENUE, + SALESPERSON_PERFORMANCE_SHARED_UNIFIED_GROSS_REVENUE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum DimensionAttribute { + LINE_ITEM_LABELS, + LINE_ITEM_LABEL_IDS, + LINE_ITEM_OPTIMIZABLE, + LINE_ITEM_DELIVERY_PACING, + LINE_ITEM_FREQUENCY_CAP, + LINE_ITEM_RECONCILED_RATE, + ADVERTISER_EXTERNAL_ID, + ORDER_START_DATE_TIME, + ORDER_END_DATE_TIME, + ORDER_EXTERNAL_ID, + ORDER_PO_NUMBER, + ORDER_AGENCY, + ORDER_AGENCY_ID, + ORDER_LABELS, + ORDER_LABEL_IDS, + ORDER_TRAFFICKER, + ORDER_TRAFFICKER_ID, + ORDER_SECONDARY_TRAFFICKERS, + ORDER_SALESPERSON, + ORDER_SECONDARY_SALESPEOPLE, + ORDER_LIFETIME_IMPRESSIONS, + ORDER_LIFETIME_CLICKS, + ORDER_LIFETIME_MERGED_IMPRESSIONS, + ORDER_LIFETIME_MERGED_CLICKS, + ORDER_BOOKED_CPM, + ORDER_BOOKED_CPC, + LINE_ITEM_START_DATE_TIME, + LINE_ITEM_END_DATE_TIME, + LINE_ITEM_EXTERNAL_ID, + LINE_ITEM_COST_TYPE, + LINE_ITEM_COST_PER_UNIT, + LINE_ITEM_CURRENCY_CODE, + LINE_ITEM_GOAL_QUANTITY, + LINE_ITEM_SPONSORSHIP_GOAL_PERCENTAGE, + LINE_ITEM_LIFETIME_IMPRESSIONS, + LINE_ITEM_LIFETIME_CLICKS, + LINE_ITEM_LIFETIME_MERGED_IMPRESSIONS, + LINE_ITEM_LIFETIME_MERGED_CLICKS, + LINE_ITEM_PRIORITY, + CREATIVE_OR_CREATIVE_SET, + MASTER_COMPANION_TYPE, + LINE_ITEM_CONTRACTED_QUANTITY, + LINE_ITEM_DISCOUNT, + LINE_ITEM_NON_CPD_BOOKED_REVENUE, + ADVERTISER_LABELS, + ADVERTISER_LABEL_IDS, + CREATIVE_CLICK_THROUGH_URL, + LINE_ITEM_CREATIVE_START_DATE, + LINE_ITEM_CREATIVE_END_DATE, + PROPOSAL_START_DATE_TIME, + PROPOSAL_END_DATE_TIME, + PROPOSAL_CREATION_DATE_TIME, + PROPOSAL_PROBABILITY_TO_CLOSE, + PROPOSAL_STATUS, + PROPOSAL_CURRENCY, + PROPOSAL_EXCHANGE_RATE, + PROPOSAL_AGENCY_COMMISSION_RATE, + PROPOSAL_VAT_RATE, + PROPOSAL_DISCOUNT, + PROPOSAL_ADVERTISER_DISCOUNT, + PROPOSAL_ADVERTISER, + PROPOSAL_ADVERTISER_ID, + PROPOSAL_AGENCIES, + PROPOSAL_AGENCY_IDS, + PROPOSAL_PO_NUMBER, + PROPOSAL_PRIMARY_SALESPERSON, + PROPOSAL_SECONDARY_SALESPEOPLE, + PROPOSAL_PRICING_MODEL, + PROPOSAL_BILLING_SOURCE, + PROPOSAL_BILLING_CAP, + PROPOSAL_BILLING_SCHEDULE, + PROPOSAL_LINE_ITEM_START_DATE_TIME, + PROPOSAL_LINE_ITEM_END_DATE_TIME, + PROPOSAL_LINE_ITEM_RATE_TYPE, + PROPOSAL_LINE_ITEM_COST_PER_UNIT, + PROPOSAL_LINE_ITEM_LOCAL_COST_PER_UNIT, + PROPOSAL_LINE_ITEM_COST_PER_UNIT_GROSS, + PROPOSAL_LINE_ITEM_LOCAL_COST_PER_UNIT_GROSS, + PROPOSAL_LINE_ITEM_TYPE_AND_PRIORITY, + PROPOSAL_LINE_ITEM_SIZE, + PROPOSAL_LINE_ITEM_PRODUCT_ADJUSTMENT, + PROPOSAL_LINE_ITEM_BUFFER, + PROPOSAL_LINE_ITEM_TARGET_RATE_NET, + PROPOSAL_LINE_ITEM_BILLING_SOURCE, + PROPOSAL_LINE_ITEM_BILLING_CAP, + PROPOSAL_LINE_ITEM_BILLING_SCHEDULE, + PRODUCT_TEMPLATE_RATE_TYPE, + PRODUCT_TEMPLATE_STATUS, + PRODUCT_TEMPLATE_TYPE_AND_PRIORITY, + PRODUCT_PRODUCT_TEMPLATE_NAME, + PRODUCT_RATE_TYPE, + PRODUCT_STATUS, + PRODUCT_TYPE_AND_PRIORITY, + PROPOSAL_AGENCY_TYPE, + PROPOSAL_AGENCY_CREDIT_STATUS, + CONTENT_CMS_NAME, + CONTENT_CMS_VIDEO_ID, + AD_UNIT_CODE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum DateRangeType { + TODAY, + YESTERDAY, + LAST_WEEK, + LAST_MONTH, + REACH_LIFETIME, + CUSTOM_DATE, + NEXT_DAY, + NEXT_90_DAYS, + NEXT_WEEK, + NEXT_MONTH, + CURRENT_AND_NEXT_MONTH, + NEXT_QUARTER, + NEXT_3_MONTHS, + NEXT_12_MONTHS + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum DimensionFilter { + ADVERTISERS, + ACTIVE_ADVERTISERS, + HOUSE_ADVERTISERS, + NON_HOUSE_ADVERTISERS, + ALL_SALESPEOPLE, + WHOLE_NETWORK, + CURRENT_USER_ORDERS, + STARTED_ORDERS, + COMPLETED_ORDERS, + MOBILE_LINE_ITEMS, + WEB_LINE_ITEMS, + ACTIVE_AD_UNITS, + INACTIVE_AD_UNITS, + MOBILE_INVENTORY_UNITS, + WEB_INVENTORY_UNITS, + ARCHIVED_AD_UNITS, + ACTIVE_PLACEMENTS, + INACTIVE_PLACEMENTS, + ARCHIVED_PLACEMENTS, + OPTIMIZABLE_ORDERS, + PARTNER_STATS_TYPE_ESTIMATED, + PARTNER_STATS_TYPE_RECONCILED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ReportJob { + private long idField; + + private bool idFieldSpecified; + + private ReportQuery reportQueryField; + + private ReportJobStatus reportJobStatusField; + + private bool reportJobStatusFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public ReportQuery reportQuery { + get { return this.reportQueryField; } + set { this.reportQueryField = value; } + } + + public ReportJobStatus reportJobStatus { + get { return this.reportJobStatusField; } + set { + this.reportJobStatusField = value; + this.reportJobStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reportJobStatusSpecified { + get { return this.reportJobStatusFieldSpecified; } + set { this.reportJobStatusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ReportJobStatus { + COMPLETED, + IN_PROGRESS, + FAILED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ReportDownloadOptions { + private ExportFormat exportFormatField; + + private bool exportFormatFieldSpecified; + + private bool includeReportPropertiesField; + + private bool includeReportPropertiesFieldSpecified; + + private bool includeTotalsRowField; + + private bool includeTotalsRowFieldSpecified; + + private bool useGzipCompressionField; + + private bool useGzipCompressionFieldSpecified; + + public ExportFormat exportFormat { + get { return this.exportFormatField; } + set { + this.exportFormatField = value; + this.exportFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool exportFormatSpecified { + get { return this.exportFormatFieldSpecified; } + set { this.exportFormatFieldSpecified = value; } + } + + public bool includeReportProperties { + get { return this.includeReportPropertiesField; } + set { + this.includeReportPropertiesField = value; + this.includeReportPropertiesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeReportPropertiesSpecified { + get { return this.includeReportPropertiesFieldSpecified; } + set { this.includeReportPropertiesFieldSpecified = value; } + } + + public bool includeTotalsRow { + get { return this.includeTotalsRowField; } + set { + this.includeTotalsRowField = value; + this.includeTotalsRowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeTotalsRowSpecified { + get { return this.includeTotalsRowFieldSpecified; } + set { this.includeTotalsRowFieldSpecified = value; } + } + + public bool useGzipCompression { + get { return this.useGzipCompressionField; } + set { + this.useGzipCompressionField = value; + this.useGzipCompressionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool useGzipCompressionSpecified { + get { return this.useGzipCompressionFieldSpecified; } + set { this.useGzipCompressionFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ExportFormat { + TSV, + CSV_EXCEL, + CSV_DUMP, + XML, + XLS, + XLSX + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ReportError : ApiError { + private ReportErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReportErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ReportErrorReason { + DEFAULT, + REPORT_ACCESS_NOT_ALLOWED, + DIMENSION_VIEW_NOT_ALLOWED, + DIMENSION_COMBINATION_NOT_ALLOWED, + ATTRIBUTE_VIEW_NOT_ALLOWED, + COLUMN_VIEW_NOT_ALLOWED, + TOO_MANY_CONCURRENT_REPORTS, + REPORT_TOO_BIG, + INVALID_OPERATION_FOR_REPORT_STATE, + INVALID_DIMENSIONS, + INVALID_ATTRIBUTES, + INVALID_COLUMNS, + INVALID_DIMENSION_FILTERS, + INVALID_DATE, + END_DATE_TIME_NOT_AFTER_START_TIME, + NOT_NULL, + ATTRIBUTES_NOT_SUPPORTED_FOR_REQUEST, + COLUMNS_NOT_SUPPORTED_FOR_REQUESTED_DIMENSIONS, + FAILED_TO_STORE_REPORT, + REPORT_NOT_FOUND, + SR_CANNOT_RUN_REPORT_IN_ANOTHER_NETWORK, + INVALID_TIME_ZONE_FOR_FEATURE_NOT_ENABLED, + INVALID_TIME_ZONE_FOR_ID, + UNSUPPORTED_TIME_ZONE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProposalLineItemServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProposalLineItemService : DfpSoapClient, IProposalLineItemService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProposalLineItemService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/ProposalLineItemService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItem createProposalLineItem(ProposalLineItem proposalLineItem) { + object[] results = this.Invoke("createProposalLineItem", new object[] { proposalLineItem }); + return ((ProposalLineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItem[] createProposalLineItems([System.Xml.Serialization.XmlElementAttribute("proposalLineItems")] +ProposalLineItem[] proposalLineItems) { + object[] results = this.Invoke("createProposalLineItems", new object[] { proposalLineItems }); + return ((ProposalLineItem[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItem getProposalLineItem(long proposalLineItemId) { + object[] results = this.Invoke("getProposalLineItem", new object[] { proposalLineItemId }); + return ((ProposalLineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItemPage getProposalLineItemsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getProposalLineItemsByStatement", new object[] { filterStatement }); + return ((ProposalLineItemPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performProposalLineItemAction(ProposalLineItemAction proposalLineItemAction, Statement filterStatement) { + object[] results = this.Invoke("performProposalLineItemAction", new object[] { proposalLineItemAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItem updateProposalLineItem(ProposalLineItem proposalLineItem) { + object[] results = this.Invoke("updateProposalLineItem", new object[] { proposalLineItem }); + return ((ProposalLineItem) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItem[] updateProposalLineItems([System.Xml.Serialization.XmlElementAttribute("proposalLineItems")] +ProposalLineItem[] proposalLineItems) { + object[] results = this.Invoke("updateProposalLineItems", new object[] { proposalLineItems }); + return ((ProposalLineItem[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveProposalLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveProposalLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class ProposalLineItemAction { + private string proposalLineItemActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProposalLineItemAction.Type")] + public string ProposalLineItemActionType { + get { return this.proposalLineItemActionTypeField; } + set { this.proposalLineItemActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class UnarchiveProposalLineItems : ProposalLineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ArchiveProposalLineItems : ProposalLineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ProposalLineItemPage { + private ProposalLineItem[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ProposalLineItem[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ProposalLineItem { + private long idField; + + private bool idFieldSpecified; + + private long proposalIdField; + + private bool proposalIdFieldSpecified; + + private long rateCardIdField; + + private bool rateCardIdFieldSpecified; + + private string productIdField; + + private string nameField; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + private string notesField; + + private CostAdjustment costAdjustmentField; + + private bool costAdjustmentFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private long unitsBoughtField; + + private bool unitsBoughtFieldSpecified; + + private int unitsBoughtBufferField; + + private bool unitsBoughtBufferFieldSpecified; + + private DeliveryRateType deliveryRateTypeField; + + private bool deliveryRateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private CompanionDeliveryOption companionDeliveryOptionField; + + private bool companionDeliveryOptionFieldSpecified; + + private CreativeRotationType creativeRotationTypeField; + + private bool creativeRotationTypeFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private long dfpLineItemIdField; + + private bool dfpLineItemIdFieldSpecified; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int lineItemPriorityField; + + private bool lineItemPriorityFieldSpecified; + + private RateType rateTypeField; + + private bool rateTypeFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private Targeting targetingField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private ProposalLineItemPremium[] premiumsField; + + private Money baseRateField; + + private Money costPerUnitField; + + private Money costField; + + private DeliveryIndicator deliveryIndicatorField; + + private long[] deliveryDataField; + + private ComputedStatus computedStatusField; + + private bool computedStatusFieldSpecified; + + private BillingCap billingCapField; + + private bool billingCapFieldSpecified; + + private BillingSchedule billingScheduleField; + + private bool billingScheduleFieldSpecified; + + private BillingSource billingSourceField; + + private bool billingSourceFieldSpecified; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long proposalId { + get { return this.proposalIdField; } + set { + this.proposalIdField = value; + this.proposalIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool proposalIdSpecified { + get { return this.proposalIdFieldSpecified; } + set { this.proposalIdFieldSpecified = value; } + } + + public long rateCardId { + get { return this.rateCardIdField; } + set { + this.rateCardIdField = value; + this.rateCardIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardIdSpecified { + get { return this.rateCardIdFieldSpecified; } + set { this.rateCardIdFieldSpecified = value; } + } + + public string productId { + get { return this.productIdField; } + set { this.productIdField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public CostAdjustment costAdjustment { + get { return this.costAdjustmentField; } + set { + this.costAdjustmentField = value; + this.costAdjustmentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool costAdjustmentSpecified { + get { return this.costAdjustmentFieldSpecified; } + set { this.costAdjustmentFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public long unitsBought { + get { return this.unitsBoughtField; } + set { + this.unitsBoughtField = value; + this.unitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitsBoughtSpecified { + get { return this.unitsBoughtFieldSpecified; } + set { this.unitsBoughtFieldSpecified = value; } + } + + public int unitsBoughtBuffer { + get { return this.unitsBoughtBufferField; } + set { + this.unitsBoughtBufferField = value; + this.unitsBoughtBufferSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitsBoughtBufferSpecified { + get { return this.unitsBoughtBufferFieldSpecified; } + set { this.unitsBoughtBufferFieldSpecified = value; } + } + + public DeliveryRateType deliveryRateType { + get { return this.deliveryRateTypeField; } + set { + this.deliveryRateTypeField = value; + this.deliveryRateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryRateTypeSpecified { + get { return this.deliveryRateTypeFieldSpecified; } + set { this.deliveryRateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + public CompanionDeliveryOption companionDeliveryOption { + get { return this.companionDeliveryOptionField; } + set { + this.companionDeliveryOptionField = value; + this.companionDeliveryOptionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companionDeliveryOptionSpecified { + get { return this.companionDeliveryOptionFieldSpecified; } + set { this.companionDeliveryOptionFieldSpecified = value; } + } + + public CreativeRotationType creativeRotationType { + get { return this.creativeRotationTypeField; } + set { + this.creativeRotationTypeField = value; + this.creativeRotationTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeRotationTypeSpecified { + get { return this.creativeRotationTypeFieldSpecified; } + set { this.creativeRotationTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public long dfpLineItemId { + get { return this.dfpLineItemIdField; } + set { + this.dfpLineItemIdField = value; + this.dfpLineItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dfpLineItemIdSpecified { + get { return this.dfpLineItemIdFieldSpecified; } + set { this.dfpLineItemIdFieldSpecified = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int lineItemPriority { + get { return this.lineItemPriorityField; } + set { + this.lineItemPriorityField = value; + this.lineItemPrioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemPrioritySpecified { + get { return this.lineItemPriorityFieldSpecified; } + set { this.lineItemPriorityFieldSpecified = value; } + } + + public RateType rateType { + get { return this.rateTypeField; } + set { + this.rateTypeField = value; + this.rateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateTypeSpecified { + get { return this.rateTypeFieldSpecified; } + set { this.rateTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public Targeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("premiums")] + public ProposalLineItemPremium[] premiums { + get { return this.premiumsField; } + set { this.premiumsField = value; } + } + + public Money baseRate { + get { return this.baseRateField; } + set { this.baseRateField = value; } + } + + public Money costPerUnit { + get { return this.costPerUnitField; } + set { this.costPerUnitField = value; } + } + + public Money cost { + get { return this.costField; } + set { this.costField = value; } + } + + public DeliveryIndicator deliveryIndicator { + get { return this.deliveryIndicatorField; } + set { this.deliveryIndicatorField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("units", IsNullable = false)] + public long[] deliveryData { + get { return this.deliveryDataField; } + set { this.deliveryDataField = value; } + } + + public ComputedStatus computedStatus { + get { return this.computedStatusField; } + set { + this.computedStatusField = value; + this.computedStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool computedStatusSpecified { + get { return this.computedStatusFieldSpecified; } + set { this.computedStatusFieldSpecified = value; } + } + + public BillingCap billingCap { + get { return this.billingCapField; } + set { + this.billingCapField = value; + this.billingCapSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingCapSpecified { + get { return this.billingCapFieldSpecified; } + set { this.billingCapFieldSpecified = value; } + } + + public BillingSchedule billingSchedule { + get { return this.billingScheduleField; } + set { + this.billingScheduleField = value; + this.billingScheduleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingScheduleSpecified { + get { return this.billingScheduleFieldSpecified; } + set { this.billingScheduleFieldSpecified = value; } + } + + public BillingSource billingSource { + get { return this.billingSourceField; } + set { + this.billingSourceField = value; + this.billingSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingSourceSpecified { + get { return this.billingSourceFieldSpecified; } + set { this.billingSourceFieldSpecified = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CostAdjustment { + NONE, + MAKE_GOOD, + BARTER, + ADDED_VALUE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ProposalLineItemPremium { + private long rateCardCustomizationIdField; + + private bool rateCardCustomizationIdFieldSpecified; + + private ProposalLineItemPremiumStatus statusField; + + private bool statusFieldSpecified; + + public long rateCardCustomizationId { + get { return this.rateCardCustomizationIdField; } + set { + this.rateCardCustomizationIdField = value; + this.rateCardCustomizationIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardCustomizationIdSpecified { + get { return this.rateCardCustomizationIdFieldSpecified; } + set { this.rateCardCustomizationIdFieldSpecified = value; } + } + + public ProposalLineItemPremiumStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ProposalLineItemPremiumStatus { + INCLUDED, + EXCLUDED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ProposalLineItemActionError : ApiError { + private ProposalLineItemActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProposalLineItemActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProposalLineItemActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ProposalLineItemActionErrorReason { + NOT_APPLICABLE, + PROPOSAL_NOT_EDITABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "NetworkServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class NetworkService : DfpSoapClient, INetworkService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public NetworkService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/NetworkService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Network[] getAllNetworks() { + object[] results = this.Invoke("getAllNetworks", new object[0]); + return ((Network[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Network getCurrentNetwork() { + object[] results = this.Invoke("getCurrentNetwork", new object[0]); + return ((Network) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Network makeTestNetwork() { + object[] results = this.Invoke("makeTestNetwork", new object[0]); + return ((Network) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Network updateNetwork(Network network) { + object[] results = this.Invoke("updateNetwork", new object[] { network }); + return ((Network) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Network { + private long idField; + + private bool idFieldSpecified; + + private string displayNameField; + + private string networkCodeField; + + private string propertyCodeField; + + private string timeZoneField; + + private string currencyCodeField; + + private string[] secondaryCurrencyCodesField; + + private string effectiveRootAdUnitIdField; + + private long contentBrowseCustomTargetingKeyIdField; + + private bool contentBrowseCustomTargetingKeyIdFieldSpecified; + + private bool isTestField; + + private bool isTestFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public string networkCode { + get { return this.networkCodeField; } + set { this.networkCodeField = value; } + } + + public string propertyCode { + get { return this.propertyCodeField; } + set { this.propertyCodeField = value; } + } + + public string timeZone { + get { return this.timeZoneField; } + set { this.timeZoneField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryCurrencyCodes")] + public string[] secondaryCurrencyCodes { + get { return this.secondaryCurrencyCodesField; } + set { this.secondaryCurrencyCodesField = value; } + } + + public string effectiveRootAdUnitId { + get { return this.effectiveRootAdUnitIdField; } + set { this.effectiveRootAdUnitIdField = value; } + } + + public long contentBrowseCustomTargetingKeyId { + get { return this.contentBrowseCustomTargetingKeyIdField; } + set { + this.contentBrowseCustomTargetingKeyIdField = value; + this.contentBrowseCustomTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contentBrowseCustomTargetingKeyIdSpecified { + get { return this.contentBrowseCustomTargetingKeyIdFieldSpecified; } + set { this.contentBrowseCustomTargetingKeyIdFieldSpecified = value; } + } + + public bool isTest { + get { return this.isTestField; } + set { + this.isTestField = value; + this.isTestSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTestSpecified { + get { return this.isTestFieldSpecified; } + set { this.isTestFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class NetworkError : ApiError { + private NetworkErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NetworkErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NetworkError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum NetworkErrorReason { + UNKNOWN, + MULTI_CURRENCY_NOT_SUPPORTED, + UNSUPPORTED_CURRENCY, + NETWORK_CURRENCY_CANNOT_BE_SAME_AS_SECONDARY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "RateCardServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class RateCardService : DfpSoapClient, IRateCardService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public RateCardService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/RateCardService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCard createRateCard(RateCard rateCard) { + object[] results = this.Invoke("createRateCard", new object[] { rateCard }); + return ((RateCard) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCard[] createRateCards([System.Xml.Serialization.XmlElementAttribute("rateCards")] +RateCard[] rateCards) { + object[] results = this.Invoke("createRateCards", new object[] { rateCards }); + return ((RateCard[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCard getRateCard(long rateCardId) { + object[] results = this.Invoke("getRateCard", new object[] { rateCardId }); + return ((RateCard) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardPage getRateCardsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getRateCardsByStatement", new object[] { filterStatement }); + return ((RateCardPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performRateCardAction(RateCardAction rateCardAction, Statement filterStatement) { + object[] results = this.Invoke("performRateCardAction", new object[] { rateCardAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCard updateRateCard(RateCard rateCard) { + object[] results = this.Invoke("updateRateCard", new object[] { rateCard }); + return ((RateCard) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCard[] updateRateCards([System.Xml.Serialization.XmlElementAttribute("rateCards")] +RateCard[] rateCards) { + object[] results = this.Invoke("updateRateCards", new object[] { rateCards }); + return ((RateCard[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateRateCards))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateRateCards))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class RateCardAction { + private string rateCardActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("RateCardAction.Type")] + public string RateCardActionType { + get { return this.rateCardActionTypeField; } + set { this.rateCardActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeactivateRateCards : RateCardAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ActivateRateCards : RateCardAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RateCardPage { + private RateCard[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public RateCard[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RateCard { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string currencyCodeField; + + private RateCardStatus statusField; + + private bool statusFieldSpecified; + + private long[] appliedTeamIdsField; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public RateCardStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum RateCardStatus { + ACTIVE, + INACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RateCardActionError : ApiError { + private RateCardActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RateCardActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RateCardActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum RateCardActionErrorReason { + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ActivityServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ActivityService : DfpSoapClient, IActivityService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ActivityService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/ActivityService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Activity[] createActivities([System.Xml.Serialization.XmlElementAttribute("activities")] +Activity[] activities) { + object[] results = this.Invoke("createActivities", new object[] { activities }); + return ((Activity[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Activity createActivity(Activity activity) { + object[] results = this.Invoke("createActivity", new object[] { activity }); + return ((Activity) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityPage getActivitiesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getActivitiesByStatement", new object[] { filterStatement }); + return ((ActivityPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Activity getActivity(int activityId) { + object[] results = this.Invoke("getActivity", new object[] { activityId }); + return ((Activity) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Activity[] updateActivities([System.Xml.Serialization.XmlElementAttribute("activities")] +Activity[] activities) { + object[] results = this.Invoke("updateActivities", new object[] { activities }); + return ((Activity[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Activity updateActivity(Activity activity) { + object[] results = this.Invoke("updateActivity", new object[] { activity }); + return ((Activity) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ActivityPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Activity[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Activity[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Activity { + private int idField; + + private bool idFieldSpecified; + + private int activityGroupIdField; + + private bool activityGroupIdFieldSpecified; + + private string nameField; + + private string expectedURLField; + + private ActivityStatus statusField; + + private bool statusFieldSpecified; + + private ActivityType typeField; + + private bool typeFieldSpecified; + + public int id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public int activityGroupId { + get { return this.activityGroupIdField; } + set { + this.activityGroupIdField = value; + this.activityGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool activityGroupIdSpecified { + get { return this.activityGroupIdFieldSpecified; } + set { this.activityGroupIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string expectedURL { + get { return this.expectedURLField; } + set { this.expectedURLField = value; } + } + + public ActivityStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ActivityType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Activity.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ActivityStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Activity.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ActivityType { + PAGE_VIEWS, + DAILY_VISITS, + CUSTOM, + ITEMS_PURCHASED, + TRANSACTIONS, + IOS_APPLICATION_DOWNLOADS, + ANDROID_APPLICATION_DOWNLOADS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LineItemTemplateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LineItemTemplateService : DfpSoapClient, ILineItemTemplateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LineItemTemplateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/LineItemTemplateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemTemplatePage getLineItemTemplatesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLineItemTemplatesByStatement", new object[] { filterStatement }); + return ((LineItemTemplatePage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class LineItemTemplate { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private bool isDefaultField; + + private bool isDefaultFieldSpecified; + + private string lineItemNameField; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private bool enabledForSameAdvertiserExceptionField; + + private bool enabledForSameAdvertiserExceptionFieldSpecified; + + private string notesField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private DateTime startTimeField; + + private DateTime endTimeField; + + private DeliveryRateType deliveryRateTypeField; + + private bool deliveryRateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private CreativeRotationType creativeRotationTypeField; + + private bool creativeRotationTypeFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public bool isDefault { + get { return this.isDefaultField; } + set { + this.isDefaultField = value; + this.isDefaultSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isDefaultSpecified { + get { return this.isDefaultFieldSpecified; } + set { this.isDefaultFieldSpecified = value; } + } + + public string lineItemName { + get { return this.lineItemNameField; } + set { this.lineItemNameField = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + public bool enabledForSameAdvertiserException { + get { return this.enabledForSameAdvertiserExceptionField; } + set { + this.enabledForSameAdvertiserExceptionField = value; + this.enabledForSameAdvertiserExceptionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool enabledForSameAdvertiserExceptionSpecified { + get { return this.enabledForSameAdvertiserExceptionFieldSpecified; } + set { this.enabledForSameAdvertiserExceptionFieldSpecified = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public DateTime startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public DateTime endTime { + get { return this.endTimeField; } + set { this.endTimeField = value; } + } + + public DeliveryRateType deliveryRateType { + get { return this.deliveryRateTypeField; } + set { + this.deliveryRateTypeField = value; + this.deliveryRateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryRateTypeSpecified { + get { return this.deliveryRateTypeFieldSpecified; } + set { this.deliveryRateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + public CreativeRotationType creativeRotationType { + get { return this.creativeRotationTypeField; } + set { + this.creativeRotationTypeField = value; + this.creativeRotationTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeRotationTypeSpecified { + get { return this.creativeRotationTypeFieldSpecified; } + set { this.creativeRotationTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class LineItemTemplatePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LineItemTemplate[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LineItemTemplate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProductServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProductService : DfpSoapClient, IProductService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProductService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/ProductService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Product getProduct(string productId) { + object[] results = this.Invoke("getProduct", new object[] { productId }); + return ((Product) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductPage getProductsByStatement(Statement statement) { + object[] results = this.Invoke("getProductsByStatement", new object[] { statement }); + return ((ProductPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performProductAction(ProductAction productAction, Statement filterStatement) { + object[] results = this.Invoke("performProductAction", new object[] { productAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Product updateProduct(Product product) { + object[] results = this.Invoke("updateProduct", new object[] { product }); + return ((Product) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Product[] updateProducts([System.Xml.Serialization.XmlElementAttribute("products")] +Product[] products) { + object[] results = this.Invoke("updateProducts", new object[] { products }); + return ((Product[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateProducts))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveProducts))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateProducts))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class ProductAction { + private string productActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProductAction.Type")] + public string ProductActionType { + get { return this.productActionTypeField; } + set { this.productActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeactivateProducts : ProductAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ArchiveProducts : ProductAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ActivateProducts : ProductAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ProductPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Product[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Product[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Product { + private string nameField; + + private ProductStatus statusField; + + private bool statusFieldSpecified; + + private ProductType productTypeField; + + private bool productTypeFieldSpecified; + + private long productTemplateIdField; + + private bool productTemplateIdFieldSpecified; + + private string idField; + + private string notesField; + + private string productTemplateDescriptionField; + + private DateTime lastModifiedDateTimeField; + + private RateType rateTypeField; + + private bool rateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int priorityField; + + private bool priorityFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private bool allowFrequencyCapsCustomizationField; + + private bool allowFrequencyCapsCustomizationFieldSpecified; + + private ProductTemplateTargeting targetingField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ProductStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ProductType productType { + get { return this.productTypeField; } + set { + this.productTypeField = value; + this.productTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productTypeSpecified { + get { return this.productTypeFieldSpecified; } + set { this.productTypeFieldSpecified = value; } + } + + public long productTemplateId { + get { return this.productTemplateIdField; } + set { + this.productTemplateIdField = value; + this.productTemplateIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productTemplateIdSpecified { + get { return this.productTemplateIdFieldSpecified; } + set { this.productTemplateIdFieldSpecified = value; } + } + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public string productTemplateDescription { + get { return this.productTemplateDescriptionField; } + set { this.productTemplateDescriptionField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public RateType rateType { + get { return this.rateTypeField; } + set { + this.rateTypeField = value; + this.rateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateTypeSpecified { + get { return this.rateTypeFieldSpecified; } + set { this.rateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public bool allowFrequencyCapsCustomization { + get { return this.allowFrequencyCapsCustomizationField; } + set { + this.allowFrequencyCapsCustomizationField = value; + this.allowFrequencyCapsCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowFrequencyCapsCustomizationSpecified { + get { return this.allowFrequencyCapsCustomizationFieldSpecified; } + set { this.allowFrequencyCapsCustomizationFieldSpecified = value; } + } + + public ProductTemplateTargeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ProductStatus { + ACTIVE, + INACTIVE, + ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ProductActionError : ApiError { + private ProductActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProductActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ProductActionErrorReason { + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeSetServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeSetService : DfpSoapClient, ICreativeSetService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeSetService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/CreativeSetService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeSet createCreativeSet(CreativeSet creativeSet) { + object[] results = this.Invoke("createCreativeSet", new object[] { creativeSet }); + return ((CreativeSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeSet getCreativeSet(long creativeSetId) { + object[] results = this.Invoke("getCreativeSet", new object[] { creativeSetId }); + return ((CreativeSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeSetPage getCreativeSetsByStatement(Statement statement) { + object[] results = this.Invoke("getCreativeSetsByStatement", new object[] { statement }); + return ((CreativeSetPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeSet updateCreativeSet(CreativeSet creativeSet) { + object[] results = this.Invoke("updateCreativeSet", new object[] { creativeSet }); + return ((CreativeSet) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CreativeSetPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeSet[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeSet[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CreativeSet { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private long masterCreativeIdField; + + private bool masterCreativeIdFieldSpecified; + + private long[] companionCreativeIdsField; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public long masterCreativeId { + get { return this.masterCreativeIdField; } + set { + this.masterCreativeIdField = value; + this.masterCreativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool masterCreativeIdSpecified { + get { return this.masterCreativeIdFieldSpecified; } + set { this.masterCreativeIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ContentServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ContentService : DfpSoapClient, IContentService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ContentService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/ContentService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContentPage getContentByStatement(Statement statement) { + object[] results = this.Invoke("getContentByStatement", new object[] { statement }); + return ((ContentPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContentPage getContentByStatementAndCustomTargetingValue(Statement filterStatement, long customTargetingValueId) { + object[] results = this.Invoke("getContentByStatementAndCustomTargetingValue", new object[] { filterStatement, customTargetingValueId }); + return ((ContentPage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CmsContent { + private long idField; + + private bool idFieldSpecified; + + private string displayNameField; + + private string cmsContentIdField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public string cmsContentId { + get { return this.cmsContentIdField; } + set { this.cmsContentIdField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Content { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private ContentStatus statusField; + + private bool statusFieldSpecified; + + private ContentStatusDefinedBy statusDefinedByField; + + private bool statusDefinedByFieldSpecified; + + private DateTime lastModifiedDateTimeField; + + private long[] userDefinedCustomTargetingValueIdsField; + + private long[] mappingRuleDefinedCustomTargetingValueIdsField; + + private CmsContent[] cmsSourcesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ContentStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ContentStatusDefinedBy statusDefinedBy { + get { return this.statusDefinedByField; } + set { + this.statusDefinedByField = value; + this.statusDefinedBySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusDefinedBySpecified { + get { return this.statusDefinedByFieldSpecified; } + set { this.statusDefinedByFieldSpecified = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("userDefinedCustomTargetingValueIds")] + public long[] userDefinedCustomTargetingValueIds { + get { return this.userDefinedCustomTargetingValueIdsField; } + set { this.userDefinedCustomTargetingValueIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("mappingRuleDefinedCustomTargetingValueIds")] + public long[] mappingRuleDefinedCustomTargetingValueIds { + get { return this.mappingRuleDefinedCustomTargetingValueIdsField; } + set { this.mappingRuleDefinedCustomTargetingValueIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("cmsSources")] + public CmsContent[] cmsSources { + get { return this.cmsSourcesField; } + set { this.cmsSourcesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ContentStatus { + ACTIVE, + INACTIVE, + ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ContentStatusDefinedBy { + CMS, + USER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ContentPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Content[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Content[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ContentPartnerError : ApiError { + private ContentPartnerErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ContentPartnerErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ContentPartnerError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ContentPartnerErrorReason { + FEATURE_NOT_ENABLED, + INVALID_PARTNER_TYPE, + NO_PARTNER_CATCH_ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "WorkflowRequestServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class WorkflowRequestService : DfpSoapClient, IWorkflowRequestService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public WorkflowRequestService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/WorkflowRequestService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual WorkflowRequestPage getWorkflowRequestsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getWorkflowRequestsByStatement", new object[] { filterStatement }); + return ((WorkflowRequestPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performWorkflowRequestAction(WorkflowRequestAction action, Statement filterStatement) { + object[] results = this.Invoke("performWorkflowRequestAction", new object[] { action, filterStatement }); + return ((UpdateResult) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RejectWorkflowApprovalRequests))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveWorkflowApprovalRequests))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class WorkflowRequestAction { + private string workflowRequestActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("WorkflowRequestAction.Type")] + public string WorkflowRequestActionType { + get { return this.workflowRequestActionTypeField; } + set { this.workflowRequestActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class RejectWorkflowApprovalRequests : WorkflowRequestAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ApproveWorkflowApprovalRequests : WorkflowRequestAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WorkflowApprovalRequest))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class WorkflowRequest { + private long idField; + + private bool idFieldSpecified; + + private string workflowRuleNameField; + + private long entityIdField; + + private bool entityIdFieldSpecified; + + private WorkflowEntityType entityTypeField; + + private bool entityTypeFieldSpecified; + + private string workflowRequestTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string workflowRuleName { + get { return this.workflowRuleNameField; } + set { this.workflowRuleNameField = value; } + } + + public long entityId { + get { return this.entityIdField; } + set { + this.entityIdField = value; + this.entityIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool entityIdSpecified { + get { return this.entityIdFieldSpecified; } + set { this.entityIdFieldSpecified = value; } + } + + public WorkflowEntityType entityType { + get { return this.entityTypeField; } + set { + this.entityTypeField = value; + this.entityTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool entityTypeSpecified { + get { return this.entityTypeFieldSpecified; } + set { this.entityTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("WorkflowRequest.Type")] + public string WorkflowRequestType { + get { return this.workflowRequestTypeField; } + set { this.workflowRequestTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum WorkflowEntityType { + PROPOSAL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class WorkflowApprovalRequest : WorkflowRequest { + private WorkflowApprovalRequestStatus statusField; + + private bool statusFieldSpecified; + + public WorkflowApprovalRequestStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum WorkflowApprovalRequestStatus { + PENDING_APPROVAL, + APPROVED, + REJECTED, + RETRACTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class WorkflowRequestPage { + private WorkflowRequest[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public WorkflowRequest[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ContactServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseContact))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ContactService : DfpSoapClient, IContactService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ContactService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/ContactService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Contact createContact(Contact contact) { + object[] results = this.Invoke("createContact", new object[] { contact }); + return ((Contact) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Contact[] createContacts([System.Xml.Serialization.XmlElementAttribute("contacts")] +Contact[] contacts) { + object[] results = this.Invoke("createContacts", new object[] { contacts }); + return ((Contact[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Contact getContact(long contactId) { + object[] results = this.Invoke("getContact", new object[] { contactId }); + return ((Contact) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContactPage getContactsByStatement(Statement statement) { + object[] results = this.Invoke("getContactsByStatement", new object[] { statement }); + return ((ContactPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Contact updateContact(Contact contact) { + object[] results = this.Invoke("updateContact", new object[] { contact }); + return ((Contact) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Contact[] updateContacts([System.Xml.Serialization.XmlElementAttribute("contacts")] +Contact[] contacts) { + object[] results = this.Invoke("updateContacts", new object[] { contacts }); + return ((Contact[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ContactPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Contact[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Contact[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class Contact : BaseContact { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private long companyIdField; + + private bool companyIdFieldSpecified; + + private ContactStatus statusField; + + private bool statusFieldSpecified; + + private string addressField; + + private string cellPhoneField; + + private string commentField; + + private string emailField; + + private string faxPhoneField; + + private string titleField; + + private string workPhoneField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public long companyId { + get { return this.companyIdField; } + set { + this.companyIdField = value; + this.companyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companyIdSpecified { + get { return this.companyIdFieldSpecified; } + set { this.companyIdFieldSpecified = value; } + } + + public ContactStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string address { + get { return this.addressField; } + set { this.addressField = value; } + } + + public string cellPhone { + get { return this.cellPhoneField; } + set { this.cellPhoneField = value; } + } + + public string comment { + get { return this.commentField; } + set { this.commentField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public string faxPhone { + get { return this.faxPhoneField; } + set { this.faxPhoneField = value; } + } + + public string title { + get { return this.titleField; } + set { this.titleField = value; } + } + + public string workPhone { + get { return this.workPhoneField; } + set { this.workPhoneField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Contact.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ContactStatus { + UNINVITED, + INVITE_PENDNG, + INVITE_EXPIRED, + INVITE_CANCELED, + USER_ACTIVE, + USER_DISABLED, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Contact))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class BaseContact { + private string baseContactTypeField; + + [System.Xml.Serialization.XmlElementAttribute("BaseContact.Type")] + public string BaseContactType { + get { return this.baseContactTypeField; } + set { this.baseContactTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ContactError : ApiError { + private ContactErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ContactErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ContactError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum ContactErrorReason { + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeWrapperServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeWrapperService : DfpSoapClient, ICreativeWrapperService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeWrapperService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201311/CreativeWrapperService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapper createCreativeWrapper(CreativeWrapper creativeWrapper) { + object[] results = this.Invoke("createCreativeWrapper", new object[] { creativeWrapper }); + return ((CreativeWrapper) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapper[] createCreativeWrappers([System.Xml.Serialization.XmlElementAttribute("creativeWrappers")] +CreativeWrapper[] creativeWrappers) { + object[] results = this.Invoke("createCreativeWrappers", new object[] { creativeWrappers }); + return ((CreativeWrapper[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapper getCreativeWrapper(long creativeWrapperId) { + object[] results = this.Invoke("getCreativeWrapper", new object[] { creativeWrapperId }); + return ((CreativeWrapper) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapperPage getCreativeWrappersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativeWrappersByStatement", new object[] { filterStatement }); + return ((CreativeWrapperPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performCreativeWrapperAction(CreativeWrapperAction creativeWrapperAction, Statement filterStatement) { + object[] results = this.Invoke("performCreativeWrapperAction", new object[] { creativeWrapperAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapper updateCreativeWrapper(CreativeWrapper creativeWrapper) { + object[] results = this.Invoke("updateCreativeWrapper", new object[] { creativeWrapper }); + return ((CreativeWrapper) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201311", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201311", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapper[] updateCreativeWrappers([System.Xml.Serialization.XmlElementAttribute("creativeWrappers")] +CreativeWrapper[] creativeWrappers) { + object[] results = this.Invoke("updateCreativeWrappers", new object[] { creativeWrappers }); + return ((CreativeWrapper[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateCreativeWrappers))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateCreativeWrappers))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public abstract partial class CreativeWrapperAction { + private string creativeWrapperActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CreativeWrapperAction.Type")] + public string CreativeWrapperActionType { + get { return this.creativeWrapperActionTypeField; } + set { this.creativeWrapperActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class DeactivateCreativeWrappers : CreativeWrapperAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class ActivateCreativeWrappers : CreativeWrapperAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CreativeWrapperPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeWrapper[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeWrapper[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CreativeWrapper { + private long idField; + + private bool idFieldSpecified; + + private long labelIdField; + + private bool labelIdFieldSpecified; + + private CreativeWrapperHtmlSnippet headerField; + + private CreativeWrapperHtmlSnippet footerField; + + private CreativeWrapperOrdering orderingField; + + private bool orderingFieldSpecified; + + private CreativeWrapperStatus statusField; + + private bool statusFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + + public CreativeWrapperHtmlSnippet header { + get { return this.headerField; } + set { this.headerField = value; } + } + + public CreativeWrapperHtmlSnippet footer { + get { return this.footerField; } + set { this.footerField = value; } + } + + public CreativeWrapperOrdering ordering { + get { return this.orderingField; } + set { + this.orderingField = value; + this.orderingSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderingSpecified { + get { return this.orderingFieldSpecified; } + set { this.orderingFieldSpecified = value; } + } + + public CreativeWrapperStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public partial class CreativeWrapperHtmlSnippet { + private string htmlSnippetField; + + public string htmlSnippet { + get { return this.htmlSnippetField; } + set { this.htmlSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CreativeWrapperOrdering { + NO_PREFERENCE, + INNER, + OUTER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201311")] + public enum CreativeWrapperStatus { + ACTIVE, + INACTIVE + } + public interface IAudienceSegmentService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + FirstPartyAudienceSegment[] createAudienceSegments(FirstPartyAudienceSegment[] segments); + AudienceSegmentPage getAudienceSegmentsByStatement(Statement filterStatement); + UpdateResult performAudienceSegmentAction(AudienceSegmentAction action, Statement filterStatement); + FirstPartyAudienceSegment[] updateAudienceSegments(FirstPartyAudienceSegment[] segments); + } + public interface IReconciliationReportRowService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ReconciliationReportRowPage getReconciliationReportRowsByStatement(Statement filterStatement); + ReconciliationReportRow[] updateReconciliationReportRows(ReconciliationReportRow[] reconciliationReportRows); + } + public interface IForecastService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Forecast getForecast(LineItem lineItem); + Forecast getForecastById(long lineItemId); + } + public interface ICompanyService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Company[] createCompanies(Company[] companies); + Company createCompany(Company company); + CompanyPage getCompaniesByStatement(Statement filterStatement); + Company getCompany(long companyId); + Company[] updateCompanies(Company[] companies); + Company updateCompany(Company company); + } + public interface IAdRuleService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdRule createAdRule(AdRule adRule); + AdRule[] createAdRules(AdRule[] adRules); + AdRule getAdRule(int adRuleId); + AdRulePage getAdRulesByStatement(Statement statement); + UpdateResult performAdRuleAction(AdRuleAction adRuleAction, Statement filterStatement); + AdRule updateAdRule(AdRule adRule); + AdRule[] updateAdRules(AdRule[] adRules); + } + public interface IUserService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + User createUser(User user); + User[] createUsers(User[] users); + Role[] getAllRoles(); + User getCurrentUser(); + User getUser(long userId); + UserPage getUsersByStatement(Statement filterStatement); + UpdateResult performUserAction(UserAction userAction, Statement filterStatement); + User updateUser(User user); + User[] updateUsers(User[] users); + } + public interface ILineItemService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + LineItem createLineItem(LineItem lineItem); + LineItem[] createLineItems(LineItem[] lineItems); + LineItem getLineItem(long lineItemId); + LineItemPage getLineItemsByStatement(Statement filterStatement); + UpdateResult performLineItemAction(LineItemAction lineItemAction, Statement filterStatement); + LineItem updateLineItem(LineItem lineItem); + LineItem[] updateLineItems(LineItem[] lineItems); + } + public interface IRateCardCustomizationService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + RateCardCustomization createRateCardCustomization(RateCardCustomization rateCardCustomization); + RateCardCustomization[] createRateCardCustomizations(RateCardCustomization[] rateCardCustomizations); + RateCardCustomization getRateCardCustomization(long rateCardCustomizationId); + RateCardCustomizationPage getRateCardCustomizationsByStatement(Statement filterStatement); + UpdateResult performRateCardCustomizationAction(RateCardCustomizationAction rateCardCustomizationAction, Statement filterStatement); + RateCardCustomization updateRateCardCustomization(RateCardCustomization rateCardCustomization); + RateCardCustomization[] updateRateCardCustomizations(RateCardCustomization[] rateCardCustomizations); + } + public interface ICreativeTemplateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CreativeTemplate getCreativeTemplate(long creativeTemplateId); + CreativeTemplatePage getCreativeTemplatesByStatement(Statement filterStatement); + } + public interface IContentMetadataKeyHierarchyService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ContentMetadataKeyHierarchyPage getContentMetadataKeyHierarchiesByStatement(Statement filterStatement); + } + public interface ICustomTargetingService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CustomTargetingKey[] createCustomTargetingKeys(CustomTargetingKey[] keys); + CustomTargetingValue[] createCustomTargetingValues(CustomTargetingValue[] values); + CustomTargetingKeyPage getCustomTargetingKeysByStatement(Statement filterStatement); + CustomTargetingValuePage getCustomTargetingValuesByStatement(Statement filterStatement); + UpdateResult performCustomTargetingKeyAction(CustomTargetingKeyAction customTargetingKeyAction, Statement filterStatement); + UpdateResult performCustomTargetingValueAction(CustomTargetingValueAction customTargetingValueAction, Statement filterStatement); + CustomTargetingKey[] updateCustomTargetingKeys(CustomTargetingKey[] keys); + CustomTargetingValue[] updateCustomTargetingValues(CustomTargetingValue[] values); + } + public interface IProductTemplateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ProductTemplate createProductTemplate(ProductTemplate productTemplate); + ProductTemplate[] createProductTemplates(ProductTemplate[] productTemplates); + ProductTemplate getProductTemplate(long productTemplateId); + ProductTemplatePage getProductTemplatesByStatement(Statement statement); + UpdateResult performProductTemplateAction(ProductTemplateAction action, Statement filterStatement); + ProductTemplate updateProductTemplate(ProductTemplate productTemplate); + ProductTemplate[] updateProductTemplates(ProductTemplate[] productTemplates); + } + public interface IReconciliationReportService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ReconciliationReport getReconciliationReport(long reconciliationReportId); + ReconciliationReportPage getReconciliationReportsByStatement(Statement filterStatement); + ReconciliationReport updateReconciliationReport(ReconciliationReport reconciliationReport); + ReconciliationReport[] updateReconciliationReports(ReconciliationReport[] reconciliationReports); + } + public interface IActivityGroupService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ActivityGroup createActivityGroup(ActivityGroup activityGroup); + ActivityGroup[] createActivityGroups(ActivityGroup[] activityGroups); + ActivityGroup getActivityGroup(int activityGroupId); + ActivityGroupPage getActivityGroupsByStatement(Statement filterStatement); + ActivityGroup updateActivityGroup(ActivityGroup activityGroup); + ActivityGroup[] updateActivityGroups(ActivityGroup[] activityGroups); + } + public interface ILabelService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Label createLabel(Label label); + Label[] createLabels(Label[] labels); + Label getLabel(long labelId); + LabelPage getLabelsByStatement(Statement filterStatement); + UpdateResult performLabelAction(LabelAction labelAction, Statement filterStatement); + Label updateLabel(Label label); + Label[] updateLabels(Label[] labels); + } + public interface ILineItemCreativeAssociationService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + LineItemCreativeAssociation createLineItemCreativeAssociation(LineItemCreativeAssociation lineItemCreativeAssociation); + LineItemCreativeAssociation[] createLineItemCreativeAssociations(LineItemCreativeAssociation[] lineItemCreativeAssociations); + LineItemCreativeAssociation getLineItemCreativeAssociation(long lineItemId, long creativeId); + LineItemCreativeAssociationPage getLineItemCreativeAssociationsByStatement(Statement filterStatement); + string getPreviewUrl(long lineItemId, long creativeId, string siteUrl); + UpdateResult performLineItemCreativeAssociationAction(LineItemCreativeAssociationAction lineItemCreativeAssociationAction, Statement filterStatement); + LineItemCreativeAssociation updateLineItemCreativeAssociation(LineItemCreativeAssociation lineItemCreativeAssociation); + LineItemCreativeAssociation[] updateLineItemCreativeAssociations(LineItemCreativeAssociation[] lineItemCreativeAssociations); + } + public interface ITeamService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Team createTeam(Team team); + Team[] createTeams(Team[] teams); + Team getTeam(long teamId); + TeamPage getTeamsByStatement(Statement filterStatement); + Team updateTeam(Team team); + Team[] updateTeams(Team[] teams); + } + public interface IInventoryService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdUnit createAdUnit(AdUnit adUnit); + AdUnit[] createAdUnits(AdUnit[] adUnits); + AdUnit getAdUnit(string adUnitId); + AdUnitSize[] getAdUnitSizesByStatement(Statement filterStatement); + AdUnitPage getAdUnitsByStatement(Statement filterStatement); + UpdateResult performAdUnitAction(AdUnitAction adUnitAction, Statement filterStatement); + AdUnit updateAdUnit(AdUnit adUnit); + AdUnit[] updateAdUnits(AdUnit[] adUnits); + } + public interface IUserTeamAssociationService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + UserTeamAssociation createUserTeamAssociation(UserTeamAssociation userTeamAssociation); + UserTeamAssociation[] createUserTeamAssociations(UserTeamAssociation[] userTeamAssociations); + UserTeamAssociation getUserTeamAssociation(long teamId, long userId); + UserTeamAssociationPage getUserTeamAssociationsByStatement(Statement filterStatement); + UpdateResult performUserTeamAssociationAction(UserTeamAssociationAction userTeamAssociationAction, Statement statement); + UserTeamAssociation updateUserTeamAssociation(UserTeamAssociation userTeamAssociation); + UserTeamAssociation[] updateUserTeamAssociations(UserTeamAssociation[] userTeamAssociations); + } + public interface IOrderService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Order createOrder(Order order); + Order[] createOrders(Order[] orders); + Order getOrder(long orderId); + OrderPage getOrdersByStatement(Statement filterStatement); + UpdateResult performOrderAction(OrderAction orderAction, Statement filterStatement); + Order updateOrder(Order order); + Order[] updateOrders(Order[] orders); + } + public interface IReconciliationOrderReportService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ReconciliationOrderReport getReconciliationOrderReport(long reconciliationOrderReportId); + ReconciliationOrderReportPage getReconciliationOrderReportsByStatement(Statement filterStatement); + UpdateResult performReconciliationOrderReportAction(ReconciliationOrderReportAction reconciliationOrderReportAction, Statement filterStatement); + } + public interface IPublisherQueryLanguageService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ResultSet select(Statement selectStatement); + } + public interface ICreativeService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Creative createCreative(Creative creative); + Creative[] createCreatives(Creative[] creatives); + Creative getCreative(long creativeId); + CreativePage getCreativesByStatement(Statement filterStatement); + Creative updateCreative(Creative creative); + Creative[] updateCreatives(Creative[] creatives); + } + public interface IBaseRateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + BaseRate createBaseRate(BaseRate baseRate); + BaseRate[] createBaseRates(BaseRate[] baseRates); + BaseRate getBaseRate(long baseRateId); + BaseRatePage getBaseRatesByStatement(Statement filterStatement); + UpdateResult performBaseRateAction(BaseRateAction baseRateAction, Statement filterStatement); + BaseRate updateBaseRate(BaseRate baseRate); + BaseRate[] updateBaseRates(BaseRate[] baseRates); + } + public interface IExchangeRateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ExchangeRate[] createExchangeRates(ExchangeRate[] exchangeRates); + ExchangeRate getExchangeRate(long exchangeRateId, bool exchangeRateIdSpecified); + ExchangeRatePage getExchangeRatesByStatement(Statement filterStatement); + UpdateResult performExchangeRateAction(ExchangeRateAction exchangeRateAction, Statement filterStatement); + ExchangeRate[] updateExchangeRates(ExchangeRate[] exchangeRates); + } + public interface IPlacementService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Placement createPlacement(Placement placement); + Placement[] createPlacements(Placement[] placements); + Placement getPlacement(long placementId); + PlacementPage getPlacementsByStatement(Statement filterStatement); + UpdateResult performPlacementAction(PlacementAction placementAction, Statement filterStatement); + Placement updatePlacement(Placement placement); + Placement[] updatePlacements(Placement[] placements); + } + public interface ICustomFieldService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CustomField createCustomField(CustomField customField); + CustomFieldOption createCustomFieldOption(CustomFieldOption customFieldOption); + CustomFieldOption[] createCustomFieldOptions(CustomFieldOption[] customFieldOptions); + CustomField[] createCustomFields(CustomField[] customFields); + CustomField getCustomField(long customFieldId); + CustomFieldOption getCustomFieldOption(long customFieldOptionId); + CustomFieldPage getCustomFieldsByStatement(Statement filterStatement); + UpdateResult performCustomFieldAction(CustomFieldAction customFieldAction, Statement filterStatement); + CustomField updateCustomField(CustomField customField); + CustomFieldOption updateCustomFieldOption(CustomFieldOption customFieldOption); + CustomFieldOption[] updateCustomFieldOptions(CustomFieldOption[] customFieldOptions); + CustomField[] updateCustomFields(CustomField[] customFields); + } + public interface ISuggestedAdUnitService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + SuggestedAdUnit getSuggestedAdUnit(string suggestedAdUnitId); + SuggestedAdUnitPage getSuggestedAdUnitsByStatement(Statement filterStatement); + SuggestedAdUnitUpdateResult performSuggestedAdUnitAction(SuggestedAdUnitAction suggestedAdUnitAction, Statement filterStatement); + } + public interface IProposalService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Proposal createProposal(Proposal proposal); + Proposal[] createProposals(Proposal[] proposals); + Proposal getProposal(long proposalId); + ProposalPage getProposalsByStatement(Statement filterStatement); + UpdateResult performProposalAction(ProposalAction proposalAction, Statement filterStatement); + Proposal updateProposal(Proposal proposal); + Proposal[] updateProposals(Proposal[] proposals); + } + public interface IReportService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + string getReportDownloadURL(long reportJobId, ExportFormat exportFormat); + string getReportDownloadUrlWithOptions(long reportJobId, ReportDownloadOptions reportDownloadOptions); + ReportJob getReportJob(long reportJobId); + ReportJob runReportJob(ReportJob reportJob); + } + public interface IProposalLineItemService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ProposalLineItem createProposalLineItem(ProposalLineItem proposalLineItem); + ProposalLineItem[] createProposalLineItems(ProposalLineItem[] proposalLineItems); + ProposalLineItem getProposalLineItem(long proposalLineItemId); + ProposalLineItemPage getProposalLineItemsByStatement(Statement filterStatement); + UpdateResult performProposalLineItemAction(ProposalLineItemAction proposalLineItemAction, Statement filterStatement); + ProposalLineItem updateProposalLineItem(ProposalLineItem proposalLineItem); + ProposalLineItem[] updateProposalLineItems(ProposalLineItem[] proposalLineItems); + } + public interface INetworkService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Network[] getAllNetworks(); + Network getCurrentNetwork(); + Network makeTestNetwork(); + Network updateNetwork(Network network); + } + public interface IRateCardService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + RateCard createRateCard(RateCard rateCard); + RateCard[] createRateCards(RateCard[] rateCards); + RateCard getRateCard(long rateCardId); + RateCardPage getRateCardsByStatement(Statement filterStatement); + UpdateResult performRateCardAction(RateCardAction rateCardAction, Statement filterStatement); + RateCard updateRateCard(RateCard rateCard); + RateCard[] updateRateCards(RateCard[] rateCards); + } + public interface IActivityService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Activity[] createActivities(Activity[] activities); + Activity createActivity(Activity activity); + ActivityPage getActivitiesByStatement(Statement filterStatement); + Activity getActivity(int activityId); + Activity[] updateActivities(Activity[] activities); + Activity updateActivity(Activity activity); + } + public interface ILineItemTemplateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + LineItemTemplatePage getLineItemTemplatesByStatement(Statement filterStatement); + } + public interface IProductService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Product getProduct(string productId); + ProductPage getProductsByStatement(Statement statement); + UpdateResult performProductAction(ProductAction productAction, Statement filterStatement); + Product updateProduct(Product product); + Product[] updateProducts(Product[] products); + } + public interface ICreativeSetService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CreativeSet createCreativeSet(CreativeSet creativeSet); + CreativeSet getCreativeSet(long creativeSetId); + CreativeSetPage getCreativeSetsByStatement(Statement statement); + CreativeSet updateCreativeSet(CreativeSet creativeSet); + } + public interface IContentService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ContentPage getContentByStatement(Statement statement); + ContentPage getContentByStatementAndCustomTargetingValue(Statement filterStatement, long customTargetingValueId); + } + public interface IWorkflowRequestService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + WorkflowRequestPage getWorkflowRequestsByStatement(Statement filterStatement); + UpdateResult performWorkflowRequestAction(WorkflowRequestAction action, Statement filterStatement); + } + public interface IContactService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Contact createContact(Contact contact); + Contact[] createContacts(Contact[] contacts); + Contact getContact(long contactId); + ContactPage getContactsByStatement(Statement statement); + Contact updateContact(Contact contact); + Contact[] updateContacts(Contact[] contacts); + } + public interface ICreativeWrapperService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CreativeWrapper createCreativeWrapper(CreativeWrapper creativeWrapper); + CreativeWrapper[] createCreativeWrappers(CreativeWrapper[] creativeWrappers); + CreativeWrapper getCreativeWrapper(long creativeWrapperId); + CreativeWrapperPage getCreativeWrappersByStatement(Statement filterStatement); + UpdateResult performCreativeWrapperAction(CreativeWrapperAction creativeWrapperAction, Statement filterStatement); + CreativeWrapper updateCreativeWrapper(CreativeWrapper creativeWrapper); + CreativeWrapper[] updateCreativeWrappers(CreativeWrapper[] creativeWrappers); + } +} diff --git a/src/Dfp/v201311/DfpServiceV201311.cs b/src/Dfp/v201311/DfpServiceV201311.cs new file mode 100644 index 00000000000..be166cf784a --- /dev/null +++ b/src/Dfp/v201311/DfpServiceV201311.cs @@ -0,0 +1,344 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Reflection; + +namespace Google.Api.Ads.Dfp.Lib { + /// + /// Lists all the services available through this library. + /// + public partial class DfpService : AdsService { + /// + /// All the services available in v201311. + /// + public class v201311 { + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ActivityGroupService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ActivityService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdRuleService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature BaseRateService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ContactService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AudienceSegmentService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CompanyService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ContentService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ContentMetadataKeyHierarchyService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeSetService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeTemplateService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeWrapperService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomFieldService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomTargetingService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ExchangeRateService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ForecastService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature InventoryService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LabelService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LineItemTemplateService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LineItemService; + + /// + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LineItemCreativeAssociationService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature NetworkService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature OrderService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature PlacementService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProductService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProductTemplateService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProposalService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProposalLineItemService; + + + /// See + /// this page for details. + /// + public static readonly ServiceSignature PublisherQueryLanguageService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature RateCardService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature RateCardCustomizationService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReconciliationOrderReportService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReconciliationReportService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReconciliationReportRowService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReportService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SuggestedAdUnitService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature TeamService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature UserService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature UserTeamAssociationService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature WorkflowRequestService; + + /// + /// Factory type for v201311 services. + /// + public static readonly Type factoryType = typeof(DfpServiceFactory); + + /// + /// Static constructor to initialize the service constants. + /// + static v201311() { + ActivityGroupService = DfpService.MakeServiceSignature("v201311", "ActivityGroupService"); + ActivityService = DfpService.MakeServiceSignature("v201311", "ActivityService"); + AdRuleService = DfpService.MakeServiceSignature("v201311", "AdRuleService"); + BaseRateService = DfpService.MakeServiceSignature("v201311", "BaseRateService"); + ContactService = DfpService.MakeServiceSignature("v201311", "ContactService"); + AudienceSegmentService = DfpService.MakeServiceSignature("v201311", + "AudienceSegmentService"); + CompanyService = DfpService.MakeServiceSignature("v201311", "CompanyService"); + ContentService = DfpService.MakeServiceSignature("v201311", "ContentService"); + ContentMetadataKeyHierarchyService = DfpService.MakeServiceSignature("v201311", + "ContentMetadataKeyHierarchyService"); + CreativeService = DfpService.MakeServiceSignature("v201311", "CreativeService"); + CreativeSetService = DfpService.MakeServiceSignature("v201311", "CreativeSetService"); + CreativeTemplateService = DfpService.MakeServiceSignature("v201311", + "CreativeTemplateService"); + CreativeWrapperService = DfpService.MakeServiceSignature("v201311", + "CreativeWrapperService"); + CustomTargetingService = DfpService.MakeServiceSignature("v201311", + "CustomTargetingService"); + CustomFieldService = DfpService.MakeServiceSignature("v201311", + "CustomFieldService"); + ExchangeRateService = DfpService.MakeServiceSignature("v201311", "ExchangeRateService"); + ForecastService = DfpService.MakeServiceSignature("v201311", "ForecastService"); + InventoryService = DfpService.MakeServiceSignature("v201311", "InventoryService"); + LabelService = DfpService.MakeServiceSignature("v201311", "LabelService"); + LineItemTemplateService = DfpService.MakeServiceSignature("v201311", + "LineItemTemplateService"); + LineItemService = DfpService.MakeServiceSignature("v201311", "LineItemService"); + LineItemCreativeAssociationService = + DfpService.MakeServiceSignature("v201311", "LineItemCreativeAssociationService"); + NetworkService = DfpService.MakeServiceSignature("v201311", "NetworkService"); + OrderService = DfpService.MakeServiceSignature("v201311", "OrderService"); + PlacementService = DfpService.MakeServiceSignature("v201311", "PlacementService"); + ProductService = DfpService.MakeServiceSignature("v201311", "ProductService"); + ProductTemplateService = DfpService.MakeServiceSignature("v201311", + "ProductTemplateService"); + ProposalService = DfpService.MakeServiceSignature("v201311", "ProposalService"); + ProposalLineItemService = DfpService.MakeServiceSignature("v201311", + "ProposalLineItemService"); + PublisherQueryLanguageService = DfpService.MakeServiceSignature("v201311", + "PublisherQueryLanguageService"); + RateCardService = DfpService.MakeServiceSignature("v201311", "RateCardService"); + RateCardCustomizationService = DfpService.MakeServiceSignature("v201311", + "RateCardCustomizationService"); + ReconciliationOrderReportService = DfpService.MakeServiceSignature("v201311", + "ReconciliationOrderReportService"); + ReconciliationReportService = DfpService.MakeServiceSignature("v201311", + "ReconciliationReportService"); + ReconciliationReportRowService = DfpService.MakeServiceSignature("v201311", + "ReconciliationReportRowService"); + ReportService = DfpService.MakeServiceSignature("v201311", "ReportService"); + SuggestedAdUnitService = DfpService.MakeServiceSignature("v201311", + "SuggestedAdUnitService"); + TeamService = DfpService.MakeServiceSignature("v201311", "TeamService"); + UserService = DfpService.MakeServiceSignature("v201311", "UserService"); + UserTeamAssociationService = DfpService.MakeServiceSignature("v201311", + "UserTeamAssociationService"); + WorkflowRequestService = DfpService.MakeServiceSignature("v201311", + "WorkflowRequestService"); + } + } + } +} diff --git a/src/Dfp/v201403/DfpApi.cs b/src/Dfp/v201403/DfpApi.cs new file mode 100644 index 00000000000..ac4a79243a0 --- /dev/null +++ b/src/Dfp/v201403/DfpApi.cs @@ -0,0 +1,26775 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +namespace Google.Api.Ads.Dfp.v201403 { + using Google.Api.Ads.Dfp.Lib; + using Google.Api.Ads.Dfp.Headers; + using System; + using System.Web.Services; + using System.Diagnostics; + using System.Web.Services.Protocols; + using System.Xml.Serialization; + using System.ComponentModel; + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AudienceSegmentServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AudienceSegmentService : DfpSoapClient, IAudienceSegmentService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AudienceSegmentService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/AudienceSegmentService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FirstPartyAudienceSegment[] createAudienceSegments([System.Xml.Serialization.XmlElementAttribute("segments")] +FirstPartyAudienceSegment[] segments) { + object[] results = this.Invoke("createAudienceSegments", new object[] { segments }); + return ((FirstPartyAudienceSegment[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AudienceSegmentPage getAudienceSegmentsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAudienceSegmentsByStatement", new object[] { filterStatement }); + return ((AudienceSegmentPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performAudienceSegmentAction(AudienceSegmentAction action, Statement filterStatement) { + object[] results = this.Invoke("performAudienceSegmentAction", new object[] { action, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FirstPartyAudienceSegment[] updateAudienceSegments([System.Xml.Serialization.XmlElementAttribute("segments")] +FirstPartyAudienceSegment[] segments) { + object[] results = this.Invoke("updateAudienceSegments", new object[] { segments }); + return ((FirstPartyAudienceSegment[]) (results[0])); + } + } + + + + + + + + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class UpdateResult { + private int numChangesField; + + private bool numChangesFieldSpecified; + + public int numChanges { + get { return this.numChangesField; } + set { + this.numChangesField = value; + this.numChangesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numChangesSpecified { + get { return this.numChangesFieldSpecified; } + set { this.numChangesFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RejectAudienceSegments))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PopulateAudienceSegments))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateAudienceSegments))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveAudienceSegments))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateAudienceSegments))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class AudienceSegmentAction { + private string audienceSegmentActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AudienceSegmentAction.Type")] + public string AudienceSegmentActionType { + get { return this.audienceSegmentActionTypeField; } + set { this.audienceSegmentActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RejectAudienceSegments : AudienceSegmentAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class PopulateAudienceSegments : AudienceSegmentAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeactivateAudienceSegments : AudienceSegmentAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ApproveAudienceSegments : AudienceSegmentAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ActivateAudienceSegments : AudienceSegmentAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AudienceSegmentPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AudienceSegment[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AudienceSegment[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedAudienceSegment))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ThirdPartyAudienceSegment))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FirstPartyAudienceSegment))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RuleBasedFirstPartyAudienceSegmentSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RuleBasedFirstPartyAudienceSegment))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NonRuleBasedFirstPartyAudienceSegment))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AudienceSegment { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private AudienceSegmentStatus statusField; + + private bool statusFieldSpecified; + + private long sizeField; + + private bool sizeFieldSpecified; + + private AudienceSegmentDataProvider dataProviderField; + + private AudienceSegmentAudienceSegmentType typeField; + + private bool typeFieldSpecified; + + private string audienceSegmentTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public AudienceSegmentStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public long size { + get { return this.sizeField; } + set { + this.sizeField = value; + this.sizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sizeSpecified { + get { return this.sizeFieldSpecified; } + set { this.sizeFieldSpecified = value; } + } + + public AudienceSegmentDataProvider dataProvider { + get { return this.dataProviderField; } + set { this.dataProviderField = value; } + } + + public AudienceSegmentAudienceSegmentType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("AudienceSegment.Type")] + public string AudienceSegmentType { + get { return this.audienceSegmentTypeField; } + set { this.audienceSegmentTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegment.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AudienceSegmentStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AudienceSegmentDataProvider { + private string nameField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegment.AudienceSegmentType", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AudienceSegmentAudienceSegmentType { + FIRST_PARTY, + SHARED, + THIRD_PARTY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class SharedAudienceSegment : AudienceSegment { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ThirdPartyAudienceSegment : AudienceSegment { + private ThirdPartyAudienceSegmentAudienceSegmentApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + private Money costField; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + public ThirdPartyAudienceSegmentAudienceSegmentApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + + public Money cost { + get { return this.costField; } + set { this.costField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ThirdPartyAudienceSegment.AudienceSegmentApprovalStatus", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ThirdPartyAudienceSegmentAudienceSegmentApprovalStatus { + UNAPPROVED, + APPROVED, + REJECTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Money { + private string currencyCodeField; + + private long microAmountField; + + private bool microAmountFieldSpecified; + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public long microAmount { + get { return this.microAmountField; } + set { + this.microAmountField = value; + this.microAmountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool microAmountSpecified { + get { return this.microAmountFieldSpecified; } + set { this.microAmountFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DateTime { + private Date dateField; + + private int hourField; + + private bool hourFieldSpecified; + + private int minuteField; + + private bool minuteFieldSpecified; + + private int secondField; + + private bool secondFieldSpecified; + + private string timeZoneIDField; + + public Date date { + get { return this.dateField; } + set { this.dateField = value; } + } + + public int hour { + get { return this.hourField; } + set { + this.hourField = value; + this.hourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hourSpecified { + get { return this.hourFieldSpecified; } + set { this.hourFieldSpecified = value; } + } + + public int minute { + get { return this.minuteField; } + set { + this.minuteField = value; + this.minuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minuteSpecified { + get { return this.minuteFieldSpecified; } + set { this.minuteFieldSpecified = value; } + } + + public int second { + get { return this.secondField; } + set { + this.secondField = value; + this.secondSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool secondSpecified { + get { return this.secondFieldSpecified; } + set { this.secondFieldSpecified = value; } + } + + public string timeZoneID { + get { return this.timeZoneIDField; } + set { this.timeZoneIDField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Date { + private int yearField; + + private bool yearFieldSpecified; + + private int monthField; + + private bool monthFieldSpecified; + + private int dayField; + + private bool dayFieldSpecified; + + public int year { + get { return this.yearField; } + set { + this.yearField = value; + this.yearSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool yearSpecified { + get { return this.yearFieldSpecified; } + set { this.yearFieldSpecified = value; } + } + + public int month { + get { return this.monthField; } + set { + this.monthField = value; + this.monthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool monthSpecified { + get { return this.monthFieldSpecified; } + set { this.monthFieldSpecified = value; } + } + + public int day { + get { return this.dayField; } + set { + this.dayField = value; + this.daySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool daySpecified { + get { return this.dayFieldSpecified; } + set { this.dayFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RuleBasedFirstPartyAudienceSegmentSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RuleBasedFirstPartyAudienceSegment))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NonRuleBasedFirstPartyAudienceSegment))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class FirstPartyAudienceSegment : AudienceSegment { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RuleBasedFirstPartyAudienceSegment))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RuleBasedFirstPartyAudienceSegmentSummary : FirstPartyAudienceSegment { + private int pageViewsField; + + private bool pageViewsFieldSpecified; + + private int recencyDaysField; + + private bool recencyDaysFieldSpecified; + + private int membershipExpirationDaysField; + + private bool membershipExpirationDaysFieldSpecified; + + public int pageViews { + get { return this.pageViewsField; } + set { + this.pageViewsField = value; + this.pageViewsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool pageViewsSpecified { + get { return this.pageViewsFieldSpecified; } + set { this.pageViewsFieldSpecified = value; } + } + + public int recencyDays { + get { return this.recencyDaysField; } + set { + this.recencyDaysField = value; + this.recencyDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool recencyDaysSpecified { + get { return this.recencyDaysFieldSpecified; } + set { this.recencyDaysFieldSpecified = value; } + } + + public int membershipExpirationDays { + get { return this.membershipExpirationDaysField; } + set { + this.membershipExpirationDaysField = value; + this.membershipExpirationDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool membershipExpirationDaysSpecified { + get { return this.membershipExpirationDaysFieldSpecified; } + set { this.membershipExpirationDaysFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RuleBasedFirstPartyAudienceSegment : RuleBasedFirstPartyAudienceSegmentSummary { + private FirstPartyAudienceSegmentRule ruleField; + + public FirstPartyAudienceSegmentRule rule { + get { return this.ruleField; } + set { this.ruleField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class FirstPartyAudienceSegmentRule { + private InventoryTargeting inventoryRuleField; + + private CustomCriteriaSet customCriteriaRuleField; + + public InventoryTargeting inventoryRule { + get { return this.inventoryRuleField; } + set { this.inventoryRuleField = value; } + } + + public CustomCriteriaSet customCriteriaRule { + get { return this.customCriteriaRuleField; } + set { this.customCriteriaRuleField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class InventoryTargeting { + private AdUnitTargeting[] targetedAdUnitsField; + + private AdUnitTargeting[] excludedAdUnitsField; + + private long[] targetedPlacementIdsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedAdUnits")] + public AdUnitTargeting[] targetedAdUnits { + get { return this.targetedAdUnitsField; } + set { this.targetedAdUnitsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedAdUnits")] + public AdUnitTargeting[] excludedAdUnits { + get { return this.excludedAdUnitsField; } + set { this.excludedAdUnitsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedPlacementIds")] + public long[] targetedPlacementIds { + get { return this.targetedPlacementIdsField; } + set { this.targetedPlacementIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdUnitTargeting { + private string adUnitIdField; + + private bool includeDescendantsField; + + private bool includeDescendantsFieldSpecified; + + public string adUnitId { + get { return this.adUnitIdField; } + set { this.adUnitIdField = value; } + } + + public bool includeDescendants { + get { return this.includeDescendantsField; } + set { + this.includeDescendantsField = value; + this.includeDescendantsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeDescendantsSpecified { + get { return this.includeDescendantsFieldSpecified; } + set { this.includeDescendantsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CustomCriteriaSet : CustomCriteriaNode { + private CustomCriteriaSetLogicalOperator logicalOperatorField; + + private bool logicalOperatorFieldSpecified; + + private CustomCriteriaNode[] childrenField; + + public CustomCriteriaSetLogicalOperator logicalOperator { + get { return this.logicalOperatorField; } + set { + this.logicalOperatorField = value; + this.logicalOperatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool logicalOperatorSpecified { + get { return this.logicalOperatorFieldSpecified; } + set { this.logicalOperatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("children")] + public CustomCriteriaNode[] children { + get { return this.childrenField; } + set { this.childrenField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCriteriaSet.LogicalOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CustomCriteriaSetLogicalOperator { + AND, + OR + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteriaLeaf))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceSegmentCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteriaSet))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class CustomCriteriaNode { + private string customCriteriaNodeTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomCriteriaNode.Type")] + public string CustomCriteriaNodeType { + get { return this.customCriteriaNodeTypeField; } + set { this.customCriteriaNodeTypeField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceSegmentCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteria))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class CustomCriteriaLeaf : CustomCriteriaNode { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AudienceSegmentCriteria : CustomCriteriaLeaf { + private AudienceSegmentCriteriaComparisonOperator operatorField; + + private bool operatorFieldSpecified; + + private long[] audienceSegmentIdsField; + + public AudienceSegmentCriteriaComparisonOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("audienceSegmentIds")] + public long[] audienceSegmentIds { + get { return this.audienceSegmentIdsField; } + set { this.audienceSegmentIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegmentCriteria.ComparisonOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AudienceSegmentCriteriaComparisonOperator { + IS, + IS_NOT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CustomCriteria : CustomCriteriaLeaf { + private long keyIdField; + + private bool keyIdFieldSpecified; + + private long[] valueIdsField; + + private CustomCriteriaComparisonOperator operatorField; + + private bool operatorFieldSpecified; + + public long keyId { + get { return this.keyIdField; } + set { + this.keyIdField = value; + this.keyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keyIdSpecified { + get { return this.keyIdFieldSpecified; } + set { this.keyIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("valueIds")] + public long[] valueIds { + get { return this.valueIdsField; } + set { this.valueIdsField = value; } + } + + public CustomCriteriaComparisonOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCriteria.ComparisonOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CustomCriteriaComparisonOperator { + IS, + IS_NOT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class NonRuleBasedFirstPartyAudienceSegment : FirstPartyAudienceSegment { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TextValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SetValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NumberValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateTimeValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BooleanValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class Value { + private string valueTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Value.Type")] + public string ValueType { + get { return this.valueTypeField; } + set { this.valueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class TextValue : Value { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class SetValue : Value { + private Value[] valuesField; + + [System.Xml.Serialization.XmlElementAttribute("values")] + public Value[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class NumberValue : Value { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DateValue : Value { + private Date valueField; + + public Date value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DateTimeValue : Value { + private DateTime valueField; + + public DateTime value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class BooleanValue : Value { + private bool valueField; + + private bool valueFieldSpecified; + + public bool value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class String_ValueMapEntry { + private string keyField; + + private Value valueField; + + public string key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public Value value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Statement { + private string queryField; + + private String_ValueMapEntry[] valuesField; + + public string query { + get { return this.queryField; } + set { this.queryField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("values")] + public String_ValueMapEntry[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StatementError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServerError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceSegmentError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(QuotaError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PublisherQueryLanguageSyntaxError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PublisherQueryLanguageContextError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PermissionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NotNullError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InternalApiError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeatureError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CommonError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AuthenticationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApiVersionError))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReconciliationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RangeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NullError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserDomainTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UniqueError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TypeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TechnologyTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TeamError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringLengthError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReservationDetailsError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredSizeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredNumberError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredCollectionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RegExError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ParseError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OrderError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemOperationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemFlightDateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemCreativeAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LabelEntityAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidUrlError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GeoTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GenericTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FrequencyCapError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ForecastError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EntityLimitReachedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DayPartTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateTimeRangeTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldValueError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentMetadataTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CompanyCreditStatusError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClickTrackingLineItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceExtensionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitCodeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitAfcSizeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidEmailError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CompanyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PoddingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRuleSlotError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRulePriorityError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRuleFrequencyCapError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRuleDateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RateCardError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RateCardActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeTemplateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentMetadataKeyHierarchyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseRateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RateCardCustomizationGroupError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivityError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LabelError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeWrapperError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TemplateInstantiatedCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SwiffyConversionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemCreativeAssociationOperationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidPhoneNumberError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FileError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeSetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeAssetMacroError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseAccountError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReportError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitTypeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitSizesError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitPartnerAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidColorError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitHierarchyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NetworkError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExchangeRateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RateCardCustomizationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProposalLineItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProposalLineItemActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProposalError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PrecisionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BillingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseRateActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OrderActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReconciliationImportError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductTemplateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductTemplateActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WorkflowActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProposalActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LiveStreamEventDateTimeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentPartnerError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContactError))] + public abstract partial class ApiError { + private string fieldPathField; + + private string triggerField; + + private string errorStringField; + + private string apiErrorTypeField; + + public string fieldPath { + get { return this.fieldPathField; } + set { this.fieldPathField = value; } + } + + public string trigger { + get { return this.triggerField; } + set { this.triggerField = value; } + } + + public string errorString { + get { return this.errorStringField; } + set { this.errorStringField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApiError.Type")] + public string ApiErrorType { + get { return this.apiErrorTypeField; } + set { this.apiErrorTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class StatementError : ApiError { + private StatementErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StatementErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StatementError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum StatementErrorReason { + VARIABLE_NOT_BOUND_TO_VALUE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ServerError : ApiError { + private ServerErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ServerErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ServerError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ServerErrorReason { + SERVER_ERROR, + SERVER_BUSY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AudienceSegmentError : ApiError { + private AudienceSegmentErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AudienceSegmentErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegmentError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AudienceSegmentErrorReason { + FIRST_PARTY_AUDIENCE_SEGMENT_NOT_SUPPORTED, + ONLY_RULE_BASED_FIRST_PARTY_AUDIENCE_SEGMENTS_CAN_BE_CREATED, + AUDIENCE_SEGMENT_ID_NOT_FOUND, + INVALID_AUDIENCE_SEGMENT_RULE, + AUDIENCE_SEGMENT_RULE_TOO_LONG, + INVALID_AUDIENCE_SEGMENT_NAME, + DUPLICATE_AUDIENCE_SEGMENT_NAME, + INVALID_AUDIENCE_SEGMENT_DESCRIPTION, + INVALID_AUDIENCE_SEGMENT_PAGEVIEWS, + INVALID_AUDIENCE_SEGMENT_RECENCY, + INVALID_AUDIENCE_SEGMENT_MEMBERSHIP_EXPIRATION, + INVALID_AUDIENCE_SEGMENT_CUSTOM_KEY_NAME, + INVALID_AUDIENCE_SEGMENT_CUSTOM_VALUE_NAME, + INVALID_AUDIENCE_SEGMENT_CUSTOM_VALUE_MATCH_TYPE, + INVALID_NESTED_FIRST_PARTY_AUDIENCE_SEGMENT, + INVALID_NESTED_THIRD_PARTY_AUDIENCE_SEGMENT, + INACTIVE_NESTED_AUDIENCE_SEGMENT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RequiredError : ApiError { + private RequiredErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum RequiredErrorReason { + REQUIRED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class QuotaError : ApiError { + private QuotaErrorReason reasonField; + + private bool reasonFieldSpecified; + + public QuotaErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "QuotaError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum QuotaErrorReason { + EXCEEDED_QUOTA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class PublisherQueryLanguageSyntaxError : ApiError { + private PublisherQueryLanguageSyntaxErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PublisherQueryLanguageSyntaxErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PublisherQueryLanguageSyntaxError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum PublisherQueryLanguageSyntaxErrorReason { + UNPARSABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class PublisherQueryLanguageContextError : ApiError { + private PublisherQueryLanguageContextErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PublisherQueryLanguageContextErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PublisherQueryLanguageContextError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum PublisherQueryLanguageContextErrorReason { + UNEXECUTABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class PermissionError : ApiError { + private PermissionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PermissionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PermissionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum PermissionErrorReason { + PERMISSION_DENIED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class NotNullError : ApiError { + private NotNullErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NotNullErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NotNullError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum NotNullErrorReason { + ARG1_NULL, + ARG2_NULL, + ARG3_NULL, + NULL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class InternalApiError : ApiError { + private InternalApiErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InternalApiErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InternalApiError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum InternalApiErrorReason { + UNEXPECTED_INTERNAL_API_ERROR, + UNKNOWN, + DOWNTIME + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class FeatureError : ApiError { + private FeatureErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FeatureErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeatureError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum FeatureErrorReason { + MISSING_FEATURE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CommonError : ApiError { + private CommonErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CommonErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CommonError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CommonErrorReason { + NOT_FOUND, + ALREADY_EXISTS, + DUPLICATE_OBJECT, + CANNOT_UPDATE, + CONCURRENT_MODIFICATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AuthenticationError : ApiError { + private AuthenticationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AuthenticationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AuthenticationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AuthenticationErrorReason { + AMBIGUOUS_SOAP_REQUEST_HEADER, + INVALID_EMAIL, + AUTHENTICATION_FAILED, + INVALID_OAUTH_SIGNATURE, + INVALID_SERVICE, + MISSING_SOAP_REQUEST_HEADER, + MISSING_AUTHENTICATION_HTTP_HEADER, + MISSING_AUTHENTICATION, + NOT_WHITELISTED_FOR_API_ACCESS, + NO_NETWORKS_TO_ACCESS, + NETWORK_NOT_FOUND, + NETWORK_CODE_REQUIRED, + CONNECTION_ERROR, + GOOGLE_ACCOUNT_ALREADY_ASSOCIATED_WITH_NETWORK, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ApiVersionError : ApiError { + private ApiVersionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ApiVersionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ApiVersionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ApiVersionErrorReason { + UPDATE_TO_NEWER_VERSION, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApiException))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ApplicationException { + private string messageField; + + private string applicationExceptionTypeField; + + public string message { + get { return this.messageField; } + set { this.messageField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApplicationException.Type")] + public string ApplicationExceptionType { + get { return this.applicationExceptionTypeField; } + set { this.applicationExceptionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ApiException : ApplicationException { + private ApiError[] errorsField; + + [System.Xml.Serialization.XmlElementAttribute("errors")] + public ApiError[] errors { + get { return this.errorsField; } + set { this.errorsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OAuth))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class Authentication { + private string authenticationTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Authentication.Type")] + public string AuthenticationType { + get { return this.authenticationTypeField; } + set { this.authenticationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class OAuth : Authentication { + private string parametersField; + + public string parameters { + get { return this.parametersField; } + set { this.parametersField = value; } + } + } + + + + + + + + + + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReconciliationOrderReportServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReconciliationOrderReportService : DfpSoapClient, IReconciliationOrderReportService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReconciliationOrderReportService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/ReconciliationOrderReportServic" + "e"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationOrderReportPage getReconciliationOrderReportsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getReconciliationOrderReportsByStatement", new object[] { filterStatement }); + return ((ReconciliationOrderReportPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performReconciliationOrderReportAction(ReconciliationOrderReportAction reconciliationOrderReportAction, Statement filterStatement) { + object[] results = this.Invoke("performReconciliationOrderReportAction", new object[] { reconciliationOrderReportAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RevertReconciliationOrderReports))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitReconciliationOrderReports))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class ReconciliationOrderReportAction { + private string reconciliationOrderReportActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ReconciliationOrderReportAction.Type")] + public string ReconciliationOrderReportActionType { + get { return this.reconciliationOrderReportActionTypeField; } + set { this.reconciliationOrderReportActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RevertReconciliationOrderReports : ReconciliationOrderReportAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class SubmitReconciliationOrderReports : ReconciliationOrderReportAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ReconciliationOrderReport { + private long idField; + + private bool idFieldSpecified; + + private long reconciliationReportIdField; + + private bool reconciliationReportIdFieldSpecified; + + private long orderIdField; + + private bool orderIdFieldSpecified; + + private ReconciliationOrderReportStatus statusField; + + private bool statusFieldSpecified; + + private DateTime submissionDateTimeField; + + private long submitterIdField; + + private bool submitterIdFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long reconciliationReportId { + get { return this.reconciliationReportIdField; } + set { + this.reconciliationReportIdField = value; + this.reconciliationReportIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reconciliationReportIdSpecified { + get { return this.reconciliationReportIdFieldSpecified; } + set { this.reconciliationReportIdFieldSpecified = value; } + } + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public ReconciliationOrderReportStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public DateTime submissionDateTime { + get { return this.submissionDateTimeField; } + set { this.submissionDateTimeField = value; } + } + + public long submitterId { + get { return this.submitterIdField; } + set { + this.submitterIdField = value; + this.submitterIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool submitterIdSpecified { + get { return this.submitterIdFieldSpecified; } + set { this.submitterIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ReconciliationOrderReportStatus { + DRAFT, + RECONCILED, + REVERTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ReconciliationOrderReportPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ReconciliationOrderReport[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ReconciliationOrderReport[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ReconciliationError : ApiError { + private ReconciliationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReconciliationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReconciliationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ReconciliationErrorReason { + CANNOT_CREATE_RECONCILIATION_REPORT_VERSION, + INVALID_RECONCILIATION_REPORT_STATE_TRANSITION, + USER_CANNOT_RECONCILE_RECONCILIATION_REPORT, + CONTRACTED_VOLUME_CANNOT_BE_NULL, + DFP_VOLUME_CANNOT_BE_NULL, + MANUAL_VOLUME_CANNOT_BE_NULL, + THIRD_PARTY_VOLUME_CANNOT_BE_NULL, + DUPLICATE_LINE_ITEM_AND_CREATIVE, + CANNOT_RECONCILE_LINE_ITEM_CREATIVE, + LINE_ITEM_DAYS_MISMATCH, + LINE_ITEM_BILL_OFF_OF_MISMATCH, + CANNOT_MODIFY_RECONCILED_ORDER, + CANNOT_MODIFY_ACROSS_MULTIPLE_RECONCILIATION_REPORTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RangeError : ApiError { + private RangeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RangeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RangeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum RangeErrorReason { + TOO_HIGH, + TOO_LOW, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class NullError : ApiError { + private NullErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NullErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NullError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum NullErrorReason { + NULL_CONTENT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ForecastServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ForecastService : DfpSoapClient, IForecastService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ForecastService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/ForecastService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Forecast getForecast(LineItem lineItem) { + object[] results = this.Invoke("getForecast", new object[] { lineItem }); + return ((Forecast) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Forecast getForecastById(long lineItemId) { + object[] results = this.Invoke("getForecastById", new object[] { lineItemId }); + return ((Forecast) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ContendingLineItem { + private long lineItemIdField; + + private bool lineItemIdFieldSpecified; + + private long contendingImpressionsField; + + private bool contendingImpressionsFieldSpecified; + + public long lineItemId { + get { return this.lineItemIdField; } + set { + this.lineItemIdField = value; + this.lineItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemIdSpecified { + get { return this.lineItemIdFieldSpecified; } + set { this.lineItemIdFieldSpecified = value; } + } + + public long contendingImpressions { + get { return this.contendingImpressionsField; } + set { + this.contendingImpressionsField = value; + this.contendingImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contendingImpressionsSpecified { + get { return this.contendingImpressionsFieldSpecified; } + set { this.contendingImpressionsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Forecast { + private long idField; + + private bool idFieldSpecified; + + private long orderIdField; + + private bool orderIdFieldSpecified; + + private UnitType unitTypeField; + + private bool unitTypeFieldSpecified; + + private long availableUnitsField; + + private bool availableUnitsFieldSpecified; + + private long deliveredUnitsField; + + private bool deliveredUnitsFieldSpecified; + + private long matchedUnitsField; + + private bool matchedUnitsFieldSpecified; + + private long possibleUnitsField; + + private bool possibleUnitsFieldSpecified; + + private long reservedUnitsField; + + private bool reservedUnitsFieldSpecified; + + private ContendingLineItem[] contendingLineItemsField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public UnitType unitType { + get { return this.unitTypeField; } + set { + this.unitTypeField = value; + this.unitTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitTypeSpecified { + get { return this.unitTypeFieldSpecified; } + set { this.unitTypeFieldSpecified = value; } + } + + public long availableUnits { + get { return this.availableUnitsField; } + set { + this.availableUnitsField = value; + this.availableUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool availableUnitsSpecified { + get { return this.availableUnitsFieldSpecified; } + set { this.availableUnitsFieldSpecified = value; } + } + + public long deliveredUnits { + get { return this.deliveredUnitsField; } + set { + this.deliveredUnitsField = value; + this.deliveredUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveredUnitsSpecified { + get { return this.deliveredUnitsFieldSpecified; } + set { this.deliveredUnitsFieldSpecified = value; } + } + + public long matchedUnits { + get { return this.matchedUnitsField; } + set { + this.matchedUnitsField = value; + this.matchedUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool matchedUnitsSpecified { + get { return this.matchedUnitsFieldSpecified; } + set { this.matchedUnitsFieldSpecified = value; } + } + + public long possibleUnits { + get { return this.possibleUnitsField; } + set { + this.possibleUnitsField = value; + this.possibleUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool possibleUnitsSpecified { + get { return this.possibleUnitsFieldSpecified; } + set { this.possibleUnitsFieldSpecified = value; } + } + + public long reservedUnits { + get { return this.reservedUnitsField; } + set { + this.reservedUnitsField = value; + this.reservedUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reservedUnitsSpecified { + get { return this.reservedUnitsFieldSpecified; } + set { this.reservedUnitsFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("contendingLineItems")] + public ContendingLineItem[] contendingLineItems { + get { return this.contendingLineItemsField; } + set { this.contendingLineItemsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum UnitType { + IMPRESSIONS, + CLICKS + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class VideoPositionWithinPod { + private int indexField; + + private bool indexFieldSpecified; + + public int index { + get { return this.indexField; } + set { + this.indexField = value; + this.indexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool indexSpecified { + get { return this.indexFieldSpecified; } + set { this.indexFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class VideoPosition { + private VideoPositionType positionTypeField; + + private bool positionTypeFieldSpecified; + + private int midrollIndexField; + + private bool midrollIndexFieldSpecified; + + public VideoPositionType positionType { + get { return this.positionTypeField; } + set { + this.positionTypeField = value; + this.positionTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool positionTypeSpecified { + get { return this.positionTypeFieldSpecified; } + set { this.positionTypeFieldSpecified = value; } + } + + public int midrollIndex { + get { return this.midrollIndexField; } + set { + this.midrollIndexField = value; + this.midrollIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool midrollIndexSpecified { + get { return this.midrollIndexFieldSpecified; } + set { this.midrollIndexFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoPosition.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum VideoPositionType { + PREROLL, + MIDROLL, + POSTROLL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class VideoPositionTarget { + private VideoPosition videoPositionField; + + private VideoBumperType videoBumperTypeField; + + private bool videoBumperTypeFieldSpecified; + + private VideoPositionWithinPod videoPositionWithinPodField; + + public VideoPosition videoPosition { + get { return this.videoPositionField; } + set { this.videoPositionField = value; } + } + + public VideoBumperType videoBumperType { + get { return this.videoBumperTypeField; } + set { + this.videoBumperTypeField = value; + this.videoBumperTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoBumperTypeSpecified { + get { return this.videoBumperTypeFieldSpecified; } + set { this.videoBumperTypeFieldSpecified = value; } + } + + public VideoPositionWithinPod videoPositionWithinPod { + get { return this.videoPositionWithinPodField; } + set { this.videoPositionWithinPodField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum VideoBumperType { + BEFORE, + AFTER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class VideoPositionTargeting { + private VideoPositionTarget[] targetedPositionsField; + + + [System.Xml.Serialization.XmlElementAttribute("targetedPositions")] + public VideoPositionTarget[] targetedPositions { + get { return this.targetedPositionsField; } + set { this.targetedPositionsField = value; } + } + + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ContentMetadataKeyHierarchyTargeting { + private long[] customTargetingValueIdsField; + + + [System.Xml.Serialization.XmlElementAttribute("customTargetingValueIds")] + public long[] customTargetingValueIds { + get { return this.customTargetingValueIdsField; } + set { this.customTargetingValueIdsField = value; } + } + + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ContentTargeting { + private long[] targetedContentIdsField; + + private long[] excludedContentIdsField; + + private long[] targetedVideoCategoryIdsField; + + private long[] excludedVideoCategoryIdsField; + + private long[] targetedVideoContentBundleIdsField; + + private long[] excludedVideoContentBundleIdsField; + + private ContentMetadataKeyHierarchyTargeting[] targetedContentMetadataField; + + private ContentMetadataKeyHierarchyTargeting[] excludedContentMetadataField; + + + [System.Xml.Serialization.XmlElementAttribute("targetedContentIds")] + public long[] targetedContentIds { + get { return this.targetedContentIdsField; } + set { this.targetedContentIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedContentIds")] + public long[] excludedContentIds { + get { return this.excludedContentIdsField; } + set { this.excludedContentIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedVideoCategoryIds")] + public long[] targetedVideoCategoryIds { + get { return this.targetedVideoCategoryIdsField; } + set { this.targetedVideoCategoryIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedVideoCategoryIds")] + public long[] excludedVideoCategoryIds { + get { return this.excludedVideoCategoryIdsField; } + set { this.excludedVideoCategoryIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedVideoContentBundleIds")] + public long[] targetedVideoContentBundleIds { + get { return this.targetedVideoContentBundleIdsField; } + set { this.targetedVideoContentBundleIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedVideoContentBundleIds")] + public long[] excludedVideoContentBundleIds { + get { return this.excludedVideoContentBundleIdsField; } + set { this.excludedVideoContentBundleIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedContentMetadata")] + public ContentMetadataKeyHierarchyTargeting[] targetedContentMetadata { + get { return this.targetedContentMetadataField; } + set { this.targetedContentMetadataField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedContentMetadata")] + public ContentMetadataKeyHierarchyTargeting[] excludedContentMetadata { + get { return this.excludedContentMetadataField; } + set { this.excludedContentMetadataField = value; } + } + + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class UserDomainTargeting { + private string[] domainsField; + + private bool targetedField; + + private bool targetedFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("domains")] + public string[] domains { + get { return this.domainsField; } + set { this.domainsField = value; } + } + + public bool targeted { + get { return this.targetedField; } + set { + this.targetedField = value; + this.targetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetedSpecified { + get { return this.targetedFieldSpecified; } + set { this.targetedFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class OperatingSystemVersionTargeting { + private Technology[] targetedOperatingSystemVersionsField; + + private Technology[] excludedOperatingSystemVersionsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedOperatingSystemVersions")] + public Technology[] targetedOperatingSystemVersions { + get { return this.targetedOperatingSystemVersionsField; } + set { this.targetedOperatingSystemVersionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedOperatingSystemVersions")] + public Technology[] excludedOperatingSystemVersions { + get { return this.excludedOperatingSystemVersionsField; } + set { this.excludedOperatingSystemVersionsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystemVersion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystem))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileDeviceSubmodel))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileDevice))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileCarrier))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceManufacturer))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceCategory))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceCapability))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BrowserLanguage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Browser))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BandwidthGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Technology { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string technologyTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Technology.Type")] + public string TechnologyType { + get { return this.technologyTypeField; } + set { this.technologyTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class OperatingSystemVersion : Technology { + private int majorVersionField; + + private bool majorVersionFieldSpecified; + + private int minorVersionField; + + private bool minorVersionFieldSpecified; + + private int microVersionField; + + private bool microVersionFieldSpecified; + + public int majorVersion { + get { return this.majorVersionField; } + set { + this.majorVersionField = value; + this.majorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool majorVersionSpecified { + get { return this.majorVersionFieldSpecified; } + set { this.majorVersionFieldSpecified = value; } + } + + public int minorVersion { + get { return this.minorVersionField; } + set { + this.minorVersionField = value; + this.minorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minorVersionSpecified { + get { return this.minorVersionFieldSpecified; } + set { this.minorVersionFieldSpecified = value; } + } + + public int microVersion { + get { return this.microVersionField; } + set { + this.microVersionField = value; + this.microVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool microVersionSpecified { + get { return this.microVersionFieldSpecified; } + set { this.microVersionFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class OperatingSystem : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class MobileDeviceSubmodel : Technology { + private long mobileDeviceCriterionIdField; + + private bool mobileDeviceCriterionIdFieldSpecified; + + private long deviceManufacturerCriterionIdField; + + private bool deviceManufacturerCriterionIdFieldSpecified; + + public long mobileDeviceCriterionId { + get { return this.mobileDeviceCriterionIdField; } + set { + this.mobileDeviceCriterionIdField = value; + this.mobileDeviceCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mobileDeviceCriterionIdSpecified { + get { return this.mobileDeviceCriterionIdFieldSpecified; } + set { this.mobileDeviceCriterionIdFieldSpecified = value; } + } + + public long deviceManufacturerCriterionId { + get { return this.deviceManufacturerCriterionIdField; } + set { + this.deviceManufacturerCriterionIdField = value; + this.deviceManufacturerCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deviceManufacturerCriterionIdSpecified { + get { return this.deviceManufacturerCriterionIdFieldSpecified; } + set { this.deviceManufacturerCriterionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class MobileDevice : Technology { + private long manufacturerCriterionIdField; + + private bool manufacturerCriterionIdFieldSpecified; + + public long manufacturerCriterionId { + get { return this.manufacturerCriterionIdField; } + set { + this.manufacturerCriterionIdField = value; + this.manufacturerCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manufacturerCriterionIdSpecified { + get { return this.manufacturerCriterionIdFieldSpecified; } + set { this.manufacturerCriterionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class MobileCarrier : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeviceManufacturer : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeviceCategory : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeviceCapability : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class BrowserLanguage : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Browser : Technology { + private string majorVersionField; + + private string minorVersionField; + + public string majorVersion { + get { return this.majorVersionField; } + set { this.majorVersionField = value; } + } + + public string minorVersion { + get { return this.minorVersionField; } + set { this.minorVersionField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class BandwidthGroup : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class OperatingSystemTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] operatingSystemsField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("operatingSystems")] + public Technology[] operatingSystems { + get { return this.operatingSystemsField; } + set { this.operatingSystemsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class MobileDeviceSubmodelTargeting { + private Technology[] targetedMobileDeviceSubmodelsField; + + private Technology[] excludedMobileDeviceSubmodelsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedMobileDeviceSubmodels")] + public Technology[] targetedMobileDeviceSubmodels { + get { return this.targetedMobileDeviceSubmodelsField; } + set { this.targetedMobileDeviceSubmodelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedMobileDeviceSubmodels")] + public Technology[] excludedMobileDeviceSubmodels { + get { return this.excludedMobileDeviceSubmodelsField; } + set { this.excludedMobileDeviceSubmodelsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class MobileDeviceTargeting { + private Technology[] targetedMobileDevicesField; + + private Technology[] excludedMobileDevicesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedMobileDevices")] + public Technology[] targetedMobileDevices { + get { return this.targetedMobileDevicesField; } + set { this.targetedMobileDevicesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedMobileDevices")] + public Technology[] excludedMobileDevices { + get { return this.excludedMobileDevicesField; } + set { this.excludedMobileDevicesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class MobileCarrierTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] mobileCarriersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("mobileCarriers")] + public Technology[] mobileCarriers { + get { return this.mobileCarriersField; } + set { this.mobileCarriersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeviceManufacturerTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] deviceManufacturersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deviceManufacturers")] + public Technology[] deviceManufacturers { + get { return this.deviceManufacturersField; } + set { this.deviceManufacturersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeviceCategoryTargeting { + private Technology[] targetedDeviceCategoriesField; + + private Technology[] excludedDeviceCategoriesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedDeviceCategories")] + public Technology[] targetedDeviceCategories { + get { return this.targetedDeviceCategoriesField; } + set { this.targetedDeviceCategoriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedDeviceCategories")] + public Technology[] excludedDeviceCategories { + get { return this.excludedDeviceCategoriesField; } + set { this.excludedDeviceCategoriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeviceCapabilityTargeting { + private Technology[] targetedDeviceCapabilitiesField; + + private Technology[] excludedDeviceCapabilitiesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedDeviceCapabilities")] + public Technology[] targetedDeviceCapabilities { + get { return this.targetedDeviceCapabilitiesField; } + set { this.targetedDeviceCapabilitiesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedDeviceCapabilities")] + public Technology[] excludedDeviceCapabilities { + get { return this.excludedDeviceCapabilitiesField; } + set { this.excludedDeviceCapabilitiesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class BrowserLanguageTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] browserLanguagesField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("browserLanguages")] + public Technology[] browserLanguages { + get { return this.browserLanguagesField; } + set { this.browserLanguagesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class BrowserTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] browsersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("browsers")] + public Technology[] browsers { + get { return this.browsersField; } + set { this.browsersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class BandwidthGroupTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] bandwidthGroupsField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("bandwidthGroups")] + public Technology[] bandwidthGroups { + get { return this.bandwidthGroupsField; } + set { this.bandwidthGroupsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class TechnologyTargeting { + private BandwidthGroupTargeting bandwidthGroupTargetingField; + + private BrowserTargeting browserTargetingField; + + private BrowserLanguageTargeting browserLanguageTargetingField; + + private DeviceCapabilityTargeting deviceCapabilityTargetingField; + + private DeviceCategoryTargeting deviceCategoryTargetingField; + + private DeviceManufacturerTargeting deviceManufacturerTargetingField; + + private MobileCarrierTargeting mobileCarrierTargetingField; + + private MobileDeviceTargeting mobileDeviceTargetingField; + + private MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargetingField; + + private OperatingSystemTargeting operatingSystemTargetingField; + + private OperatingSystemVersionTargeting operatingSystemVersionTargetingField; + + public BandwidthGroupTargeting bandwidthGroupTargeting { + get { return this.bandwidthGroupTargetingField; } + set { this.bandwidthGroupTargetingField = value; } + } + + public BrowserTargeting browserTargeting { + get { return this.browserTargetingField; } + set { this.browserTargetingField = value; } + } + + public BrowserLanguageTargeting browserLanguageTargeting { + get { return this.browserLanguageTargetingField; } + set { this.browserLanguageTargetingField = value; } + } + + public DeviceCapabilityTargeting deviceCapabilityTargeting { + get { return this.deviceCapabilityTargetingField; } + set { this.deviceCapabilityTargetingField = value; } + } + + public DeviceCategoryTargeting deviceCategoryTargeting { + get { return this.deviceCategoryTargetingField; } + set { this.deviceCategoryTargetingField = value; } + } + + public DeviceManufacturerTargeting deviceManufacturerTargeting { + get { return this.deviceManufacturerTargetingField; } + set { this.deviceManufacturerTargetingField = value; } + } + + public MobileCarrierTargeting mobileCarrierTargeting { + get { return this.mobileCarrierTargetingField; } + set { this.mobileCarrierTargetingField = value; } + } + + public MobileDeviceTargeting mobileDeviceTargeting { + get { return this.mobileDeviceTargetingField; } + set { this.mobileDeviceTargetingField = value; } + } + + public MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargeting { + get { return this.mobileDeviceSubmodelTargetingField; } + set { this.mobileDeviceSubmodelTargetingField = value; } + } + + public OperatingSystemTargeting operatingSystemTargeting { + get { return this.operatingSystemTargetingField; } + set { this.operatingSystemTargetingField = value; } + } + + public OperatingSystemVersionTargeting operatingSystemVersionTargeting { + get { return this.operatingSystemVersionTargetingField; } + set { this.operatingSystemVersionTargetingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class TimeOfDay { + private int hourField; + + private bool hourFieldSpecified; + + private MinuteOfHour minuteField; + + private bool minuteFieldSpecified; + + public int hour { + get { return this.hourField; } + set { + this.hourField = value; + this.hourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hourSpecified { + get { return this.hourFieldSpecified; } + set { this.hourFieldSpecified = value; } + } + + public MinuteOfHour minute { + get { return this.minuteField; } + set { + this.minuteField = value; + this.minuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minuteSpecified { + get { return this.minuteFieldSpecified; } + set { this.minuteFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum MinuteOfHour { + ZERO, + FIFTEEN, + THIRTY, + FORTY_FIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DayPart { + private DayOfWeek dayOfWeekField; + + private bool dayOfWeekFieldSpecified; + + private TimeOfDay startTimeField; + + private TimeOfDay endTimeField; + + public DayOfWeek dayOfWeek { + get { return this.dayOfWeekField; } + set { + this.dayOfWeekField = value; + this.dayOfWeekSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dayOfWeekSpecified { + get { return this.dayOfWeekFieldSpecified; } + set { this.dayOfWeekFieldSpecified = value; } + } + + public TimeOfDay startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public TimeOfDay endTime { + get { return this.endTimeField; } + set { this.endTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum DayOfWeek { + MONDAY, + TUESDAY, + WEDNESDAY, + THURSDAY, + FRIDAY, + SATURDAY, + SUNDAY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DayPartTargeting { + private DayPart[] dayPartsField; + + private DeliveryTimeZone timeZoneField; + + private bool timeZoneFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("dayParts")] + public DayPart[] dayParts { + get { return this.dayPartsField; } + set { this.dayPartsField = value; } + } + + public DeliveryTimeZone timeZone { + get { return this.timeZoneField; } + set { + this.timeZoneField = value; + this.timeZoneSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool timeZoneSpecified { + get { return this.timeZoneFieldSpecified; } + set { this.timeZoneFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum DeliveryTimeZone { + PUBLISHER, + BROWSER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Location { + private long idField; + + private bool idFieldSpecified; + + private string typeField; + + private int canonicalParentIdField; + + private bool canonicalParentIdFieldSpecified; + + private string displayNameField; + + private string locationTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string type { + get { return this.typeField; } + set { this.typeField = value; } + } + + public int canonicalParentId { + get { return this.canonicalParentIdField; } + set { + this.canonicalParentIdField = value; + this.canonicalParentIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool canonicalParentIdSpecified { + get { return this.canonicalParentIdFieldSpecified; } + set { this.canonicalParentIdFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Location.Type")] + public string LocationType { + get { return this.locationTypeField; } + set { this.locationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class GeoTargeting { + private Location[] targetedLocationsField; + + private Location[] excludedLocationsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedLocations")] + public Location[] targetedLocations { + get { return this.targetedLocationsField; } + set { this.targetedLocationsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedLocations")] + public Location[] excludedLocations { + get { return this.excludedLocationsField; } + set { this.excludedLocationsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Targeting { + private GeoTargeting geoTargetingField; + + private InventoryTargeting inventoryTargetingField; + + private DayPartTargeting dayPartTargetingField; + + private TechnologyTargeting technologyTargetingField; + + private CustomCriteriaSet customTargetingField; + + private UserDomainTargeting userDomainTargetingField; + + private ContentTargeting contentTargetingField; + + private VideoPositionTargeting videoPositionTargetingField; + + public GeoTargeting geoTargeting { + get { return this.geoTargetingField; } + set { this.geoTargetingField = value; } + } + + public InventoryTargeting inventoryTargeting { + get { return this.inventoryTargetingField; } + set { this.inventoryTargetingField = value; } + } + + public DayPartTargeting dayPartTargeting { + get { return this.dayPartTargetingField; } + set { this.dayPartTargetingField = value; } + } + + public TechnologyTargeting technologyTargeting { + get { return this.technologyTargetingField; } + set { this.technologyTargetingField = value; } + } + + public CustomCriteriaSet customTargeting { + get { return this.customTargetingField; } + set { this.customTargetingField = value; } + } + + public UserDomainTargeting userDomainTargeting { + get { return this.userDomainTargetingField; } + set { this.userDomainTargetingField = value; } + } + + public ContentTargeting contentTargeting { + get { return this.contentTargetingField; } + set { this.contentTargetingField = value; } + } + + public VideoPositionTargeting videoPositionTargeting { + get { return this.videoPositionTargetingField; } + set { this.videoPositionTargetingField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DropDownCustomFieldValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class BaseCustomFieldValue { + private long customFieldIdField; + + private bool customFieldIdFieldSpecified; + + private string baseCustomFieldValueTypeField; + + public long customFieldId { + get { return this.customFieldIdField; } + set { + this.customFieldIdField = value; + this.customFieldIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldIdSpecified { + get { return this.customFieldIdFieldSpecified; } + set { this.customFieldIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseCustomFieldValue.Type")] + public string BaseCustomFieldValueType { + get { return this.baseCustomFieldValueTypeField; } + set { this.baseCustomFieldValueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DropDownCustomFieldValue : BaseCustomFieldValue { + private long customFieldOptionIdField; + + private bool customFieldOptionIdFieldSpecified; + + public long customFieldOptionId { + get { return this.customFieldOptionIdField; } + set { + this.customFieldOptionIdField = value; + this.customFieldOptionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldOptionIdSpecified { + get { return this.customFieldOptionIdFieldSpecified; } + set { this.customFieldOptionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CustomFieldValue : BaseCustomFieldValue { + private Value valueField; + + public Value value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeliveryIndicator { + private double expectedDeliveryPercentageField; + + private bool expectedDeliveryPercentageFieldSpecified; + + private double actualDeliveryPercentageField; + + private bool actualDeliveryPercentageFieldSpecified; + + public double expectedDeliveryPercentage { + get { return this.expectedDeliveryPercentageField; } + set { + this.expectedDeliveryPercentageField = value; + this.expectedDeliveryPercentageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expectedDeliveryPercentageSpecified { + get { return this.expectedDeliveryPercentageFieldSpecified; } + set { this.expectedDeliveryPercentageFieldSpecified = value; } + } + + public double actualDeliveryPercentage { + get { return this.actualDeliveryPercentageField; } + set { + this.actualDeliveryPercentageField = value; + this.actualDeliveryPercentageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool actualDeliveryPercentageSpecified { + get { return this.actualDeliveryPercentageFieldSpecified; } + set { this.actualDeliveryPercentageFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Stats { + private long impressionsDeliveredField; + + private bool impressionsDeliveredFieldSpecified; + + private long clicksDeliveredField; + + private bool clicksDeliveredFieldSpecified; + + private long videoCompletionsDeliveredField; + + private bool videoCompletionsDeliveredFieldSpecified; + + private long videoStartsDeliveredField; + + private bool videoStartsDeliveredFieldSpecified; + + public long impressionsDelivered { + get { return this.impressionsDeliveredField; } + set { + this.impressionsDeliveredField = value; + this.impressionsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsDeliveredSpecified { + get { return this.impressionsDeliveredFieldSpecified; } + set { this.impressionsDeliveredFieldSpecified = value; } + } + + public long clicksDelivered { + get { return this.clicksDeliveredField; } + set { + this.clicksDeliveredField = value; + this.clicksDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clicksDeliveredSpecified { + get { return this.clicksDeliveredFieldSpecified; } + set { this.clicksDeliveredFieldSpecified = value; } + } + + public long videoCompletionsDelivered { + get { return this.videoCompletionsDeliveredField; } + set { + this.videoCompletionsDeliveredField = value; + this.videoCompletionsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoCompletionsDeliveredSpecified { + get { return this.videoCompletionsDeliveredFieldSpecified; } + set { this.videoCompletionsDeliveredFieldSpecified = value; } + } + + public long videoStartsDelivered { + get { return this.videoStartsDeliveredField; } + set { + this.videoStartsDeliveredField = value; + this.videoStartsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoStartsDeliveredSpecified { + get { return this.videoStartsDeliveredFieldSpecified; } + set { this.videoStartsDeliveredFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AppliedLabel { + private long labelIdField; + + private bool labelIdFieldSpecified; + + private bool isNegatedField; + + private bool isNegatedFieldSpecified; + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + + public bool isNegated { + get { return this.isNegatedField; } + set { + this.isNegatedField = value; + this.isNegatedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isNegatedSpecified { + get { return this.isNegatedFieldSpecified; } + set { this.isNegatedFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Size { + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + private bool isAspectRatioField; + + private bool isAspectRatioFieldSpecified; + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + public bool isAspectRatio { + get { return this.isAspectRatioField; } + set { + this.isAspectRatioField = value; + this.isAspectRatioSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAspectRatioSpecified { + get { return this.isAspectRatioFieldSpecified; } + set { this.isAspectRatioFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CreativePlaceholder { + private Size sizeField; + + private CreativePlaceholder[] companionsField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private long idField; + + private bool idFieldSpecified; + + private int expectedCreativeCountField; + + private bool expectedCreativeCountFieldSpecified; + + private CreativeSizeType creativeSizeTypeField; + + private bool creativeSizeTypeFieldSpecified; + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companions")] + public CreativePlaceholder[] companions { + get { return this.companionsField; } + set { this.companionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public int expectedCreativeCount { + get { return this.expectedCreativeCountField; } + set { + this.expectedCreativeCountField = value; + this.expectedCreativeCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expectedCreativeCountSpecified { + get { return this.expectedCreativeCountFieldSpecified; } + set { this.expectedCreativeCountFieldSpecified = value; } + } + + public CreativeSizeType creativeSizeType { + get { return this.creativeSizeTypeField; } + set { + this.creativeSizeTypeField = value; + this.creativeSizeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeSizeTypeSpecified { + get { return this.creativeSizeTypeFieldSpecified; } + set { this.creativeSizeTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CreativeSizeType { + PIXEL, + ASPECT_RATIO, + INTERSTITIAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class FrequencyCap { + private int maxImpressionsField; + + private bool maxImpressionsFieldSpecified; + + private int numTimeUnitsField; + + private bool numTimeUnitsFieldSpecified; + + private TimeUnit timeUnitField; + + private bool timeUnitFieldSpecified; + + public int maxImpressions { + get { return this.maxImpressionsField; } + set { + this.maxImpressionsField = value; + this.maxImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxImpressionsSpecified { + get { return this.maxImpressionsFieldSpecified; } + set { this.maxImpressionsFieldSpecified = value; } + } + + public int numTimeUnits { + get { return this.numTimeUnitsField; } + set { + this.numTimeUnitsField = value; + this.numTimeUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numTimeUnitsSpecified { + get { return this.numTimeUnitsFieldSpecified; } + set { this.numTimeUnitsFieldSpecified = value; } + } + + public TimeUnit timeUnit { + get { return this.timeUnitField; } + set { + this.timeUnitField = value; + this.timeUnitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool timeUnitSpecified { + get { return this.timeUnitFieldSpecified; } + set { this.timeUnitFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum TimeUnit { + MINUTE, + HOUR, + DAY, + WEEK, + MONTH, + LIFETIME, + POD, + STREAM + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItem))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LineItemSummary { + private long orderIdField; + + private bool orderIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string externalIdField; + + private string orderNameField; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private int autoExtensionDaysField; + + private bool autoExtensionDaysFieldSpecified; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private CreativeRotationType creativeRotationTypeField; + + private bool creativeRotationTypeFieldSpecified; + + private DeliveryRateType deliveryRateTypeField; + + private bool deliveryRateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int priorityField; + + private bool priorityFieldSpecified; + + private UnitType unitTypeField; + + private bool unitTypeFieldSpecified; + + private LineItemSummaryDuration durationField; + + private bool durationFieldSpecified; + + private long unitsBoughtField; + + private bool unitsBoughtFieldSpecified; + + private Money costPerUnitField; + + private Money valueCostPerUnitField; + + private CostType costTypeField; + + private bool costTypeFieldSpecified; + + private LineItemDiscountType discountTypeField; + + private bool discountTypeFieldSpecified; + + private double discountField; + + private bool discountFieldSpecified; + + private long contractedUnitsBoughtField; + + private bool contractedUnitsBoughtFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private EnvironmentType environmentTypeField; + + private bool environmentTypeFieldSpecified; + + private CompanionDeliveryOption companionDeliveryOptionField; + + private bool companionDeliveryOptionFieldSpecified; + + private CreativePersistenceType creativePersistenceTypeField; + + private bool creativePersistenceTypeFieldSpecified; + + private bool allowOverbookField; + + private bool allowOverbookFieldSpecified; + + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + private bool reserveAtCreationField; + + private bool reserveAtCreationFieldSpecified; + + private Stats statsField; + + private DeliveryIndicator deliveryIndicatorField; + + private long[] deliveryDataField; + + private Money budgetField; + + private ComputedStatus statusField; + + private bool statusFieldSpecified; + + private LineItemSummaryReservationStatus reservationStatusField; + + private bool reservationStatusFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private string webPropertyCodeField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private bool disableSameAdvertiserCompetitiveExclusionField; + + private bool disableSameAdvertiserCompetitiveExclusionFieldSpecified; + + private string lastModifiedByAppField; + + private string notesField; + + private DateTime lastModifiedDateTimeField; + + private DateTime creationDateTimeField; + + private bool isPrioritizedPreferredDealsEnabledField; + + private bool isPrioritizedPreferredDealsEnabledFieldSpecified; + + private int adExchangeAuctionOpeningPriorityField; + + private bool adExchangeAuctionOpeningPriorityFieldSpecified; + + private BaseCustomFieldValue[] customFieldValuesField; + + private bool isMissingCreativesField; + + private bool isMissingCreativesFieldSpecified; + + private string lineItemSummaryTypeField; + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string externalId { + get { return this.externalIdField; } + set { this.externalIdField = value; } + } + + public string orderName { + get { return this.orderNameField; } + set { this.orderNameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public int autoExtensionDays { + get { return this.autoExtensionDaysField; } + set { + this.autoExtensionDaysField = value; + this.autoExtensionDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool autoExtensionDaysSpecified { + get { return this.autoExtensionDaysFieldSpecified; } + set { this.autoExtensionDaysFieldSpecified = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public CreativeRotationType creativeRotationType { + get { return this.creativeRotationTypeField; } + set { + this.creativeRotationTypeField = value; + this.creativeRotationTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeRotationTypeSpecified { + get { return this.creativeRotationTypeFieldSpecified; } + set { this.creativeRotationTypeFieldSpecified = value; } + } + + public DeliveryRateType deliveryRateType { + get { return this.deliveryRateTypeField; } + set { + this.deliveryRateTypeField = value; + this.deliveryRateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryRateTypeSpecified { + get { return this.deliveryRateTypeFieldSpecified; } + set { this.deliveryRateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + public UnitType unitType { + get { return this.unitTypeField; } + set { + this.unitTypeField = value; + this.unitTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitTypeSpecified { + get { return this.unitTypeFieldSpecified; } + set { this.unitTypeFieldSpecified = value; } + } + + public LineItemSummaryDuration duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public long unitsBought { + get { return this.unitsBoughtField; } + set { + this.unitsBoughtField = value; + this.unitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitsBoughtSpecified { + get { return this.unitsBoughtFieldSpecified; } + set { this.unitsBoughtFieldSpecified = value; } + } + + public Money costPerUnit { + get { return this.costPerUnitField; } + set { this.costPerUnitField = value; } + } + + public Money valueCostPerUnit { + get { return this.valueCostPerUnitField; } + set { this.valueCostPerUnitField = value; } + } + + public CostType costType { + get { return this.costTypeField; } + set { + this.costTypeField = value; + this.costTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool costTypeSpecified { + get { return this.costTypeFieldSpecified; } + set { this.costTypeFieldSpecified = value; } + } + + public LineItemDiscountType discountType { + get { return this.discountTypeField; } + set { + this.discountTypeField = value; + this.discountTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool discountTypeSpecified { + get { return this.discountTypeFieldSpecified; } + set { this.discountTypeFieldSpecified = value; } + } + + public double discount { + get { return this.discountField; } + set { + this.discountField = value; + this.discountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool discountSpecified { + get { return this.discountFieldSpecified; } + set { this.discountFieldSpecified = value; } + } + + public long contractedUnitsBought { + get { return this.contractedUnitsBoughtField; } + set { + this.contractedUnitsBoughtField = value; + this.contractedUnitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contractedUnitsBoughtSpecified { + get { return this.contractedUnitsBoughtFieldSpecified; } + set { this.contractedUnitsBoughtFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + public EnvironmentType environmentType { + get { return this.environmentTypeField; } + set { + this.environmentTypeField = value; + this.environmentTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool environmentTypeSpecified { + get { return this.environmentTypeFieldSpecified; } + set { this.environmentTypeFieldSpecified = value; } + } + + public CompanionDeliveryOption companionDeliveryOption { + get { return this.companionDeliveryOptionField; } + set { + this.companionDeliveryOptionField = value; + this.companionDeliveryOptionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companionDeliveryOptionSpecified { + get { return this.companionDeliveryOptionFieldSpecified; } + set { this.companionDeliveryOptionFieldSpecified = value; } + } + + public CreativePersistenceType creativePersistenceType { + get { return this.creativePersistenceTypeField; } + set { + this.creativePersistenceTypeField = value; + this.creativePersistenceTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativePersistenceTypeSpecified { + get { return this.creativePersistenceTypeFieldSpecified; } + set { this.creativePersistenceTypeFieldSpecified = value; } + } + + public bool allowOverbook { + get { return this.allowOverbookField; } + set { + this.allowOverbookField = value; + this.allowOverbookSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowOverbookSpecified { + get { return this.allowOverbookFieldSpecified; } + set { this.allowOverbookFieldSpecified = value; } + } + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + + public bool reserveAtCreation { + get { return this.reserveAtCreationField; } + set { + this.reserveAtCreationField = value; + this.reserveAtCreationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reserveAtCreationSpecified { + get { return this.reserveAtCreationFieldSpecified; } + set { this.reserveAtCreationFieldSpecified = value; } + } + + public Stats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public DeliveryIndicator deliveryIndicator { + get { return this.deliveryIndicatorField; } + set { this.deliveryIndicatorField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("units", IsNullable = false)] + public long[] deliveryData { + get { return this.deliveryDataField; } + set { this.deliveryDataField = value; } + } + + public Money budget { + get { return this.budgetField; } + set { this.budgetField = value; } + } + + public ComputedStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public LineItemSummaryReservationStatus reservationStatus { + get { return this.reservationStatusField; } + set { + this.reservationStatusField = value; + this.reservationStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reservationStatusSpecified { + get { return this.reservationStatusFieldSpecified; } + set { this.reservationStatusFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public string webPropertyCode { + get { return this.webPropertyCodeField; } + set { this.webPropertyCodeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public bool disableSameAdvertiserCompetitiveExclusion { + get { return this.disableSameAdvertiserCompetitiveExclusionField; } + set { + this.disableSameAdvertiserCompetitiveExclusionField = value; + this.disableSameAdvertiserCompetitiveExclusionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool disableSameAdvertiserCompetitiveExclusionSpecified { + get { return this.disableSameAdvertiserCompetitiveExclusionFieldSpecified; } + set { this.disableSameAdvertiserCompetitiveExclusionFieldSpecified = value; } + } + + public string lastModifiedByApp { + get { return this.lastModifiedByAppField; } + set { this.lastModifiedByAppField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public DateTime creationDateTime { + get { return this.creationDateTimeField; } + set { this.creationDateTimeField = value; } + } + + public bool isPrioritizedPreferredDealsEnabled { + get { return this.isPrioritizedPreferredDealsEnabledField; } + set { + this.isPrioritizedPreferredDealsEnabledField = value; + this.isPrioritizedPreferredDealsEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isPrioritizedPreferredDealsEnabledSpecified { + get { return this.isPrioritizedPreferredDealsEnabledFieldSpecified; } + set { this.isPrioritizedPreferredDealsEnabledFieldSpecified = value; } + } + + public int adExchangeAuctionOpeningPriority { + get { return this.adExchangeAuctionOpeningPriorityField; } + set { + this.adExchangeAuctionOpeningPriorityField = value; + this.adExchangeAuctionOpeningPrioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adExchangeAuctionOpeningPrioritySpecified { + get { return this.adExchangeAuctionOpeningPriorityFieldSpecified; } + set { this.adExchangeAuctionOpeningPriorityFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + public bool isMissingCreatives { + get { return this.isMissingCreativesField; } + set { + this.isMissingCreativesField = value; + this.isMissingCreativesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isMissingCreativesSpecified { + get { return this.isMissingCreativesFieldSpecified; } + set { this.isMissingCreativesFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("LineItemSummary.Type")] + public string LineItemSummaryType { + get { return this.lineItemSummaryTypeField; } + set { this.lineItemSummaryTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum StartDateTimeType { + USE_START_DATE_TIME, + IMMEDIATELY, + ONE_HOUR_FROM_NOW + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CreativeRotationType { + EVEN, + OPTIMIZED, + MANUAL, + SEQUENTIAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum DeliveryRateType { + EVENLY, + FRONTLOADED, + AS_FAST_AS_POSSIBLE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum RoadblockingType { + ONLY_ONE, + ONE_OR_MORE, + AS_MANY_AS_POSSIBLE, + ALL_ROADBLOCK, + CREATIVE_SET + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum LineItemType { + SPONSORSHIP, + STANDARD, + NETWORK, + BULK, + PRICE_PRIORITY, + HOUSE, + LEGACY_DFP, + CLICK_TRACKING, + ADSENSE, + AD_EXCHANGE, + BUMPER, + ADMOB, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemSummary.Duration", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum LineItemSummaryDuration { + NONE, + LIFETIME, + DAILY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CostType { + CPC, + CPD, + CPM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum LineItemDiscountType { + ABSOLUTE_VALUE, + PERCENTAGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum TargetPlatform { + WEB, + MOBILE, + ANY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum EnvironmentType { + BROWSER, + VIDEO_PLAYER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CompanionDeliveryOption { + OPTIONAL, + AT_LEAST_ONE, + ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CreativePersistenceType { + NOT_PERSISTENT, + PERSISTENT_AND_EXCLUDE_NONE, + PERSISTENT_AND_EXCLUDE_DISPLAY, + PERSISTENT_AND_EXCLUDE_VIDEO, + PERSISTENT_AND_EXCLUDE_ALL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ComputedStatus { + DELIVERY_EXTENDED, + DELIVERING, + READY, + PAUSED, + NEEDS_CREATIVES, + PAUSED_INVENTORY_RELEASED, + PENDING_APPROVAL, + COMPLETED, + DISAPPROVED, + DRAFT, + CANCELED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemSummary.ReservationStatus", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum LineItemSummaryReservationStatus { + RESERVED, + UNRESERVED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LineItem : LineItemSummary { + private Targeting targetingField; + + public Targeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class UserDomainTargetingError : ApiError { + private UserDomainTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public UserDomainTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "UserDomainTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum UserDomainTargetingErrorReason { + INVALID_DOMAIN_NAMES, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class UniqueError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class TypeError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class TechnologyTargetingError : ApiError { + private TechnologyTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TechnologyTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TechnologyTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum TechnologyTargetingErrorReason { + MOBILE_LINE_ITEM_CONTAINS_WEB_TECH_CRITERIA, + WEB_LINE_ITEM_CONTAINS_MOBILE_TECH_CRITERIA, + MOBILE_CARRIER_TARGETING_FEATURE_NOT_ENABLED, + DEVICE_CAPABILITY_TARGETING_FEATURE_NOT_ENABLED, + DEVICE_CATEGORY_TARGETING_FEATURE_NOT_ENABLED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class TeamError : ApiError { + private TeamErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TeamErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TeamError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum TeamErrorReason { + ENTITY_NOT_ON_USERS_TEAMS, + AD_UNITS_NOT_ON_ORDER_TEAMS, + PLACEMENTS_NOT_ON_ORDER_TEAMS, + MISSING_USERS_TEAM, + ALL_TEAM_ASSOCIATION_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class StringLengthError : ApiError { + private StringLengthErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StringLengthErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StringLengthError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum StringLengthErrorReason { + TOO_LONG, + TOO_SHORT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ReservationDetailsError : ApiError { + private ReservationDetailsErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReservationDetailsErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReservationDetailsError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ReservationDetailsErrorReason { + UNLIMITED_UNITS_BOUGHT_NOT_ALLOWED, + UNLIMITED_END_DATE_TIME_NOT_ALLOWED, + PERCENTAGE_UNITS_BOUGHT_TOO_HIGH, + DURATION_NOT_ALLOWED, + UNIT_TYPE_NOT_ALLOWED, + COST_TYPE_NOT_ALLOWED, + COST_TYPE_UNIT_TYPE_MISMATCH_NOT_ALLOWED, + LINE_ITEM_TYPE_NOT_ALLOWED, + NETWORK_REMNANT_ORDER_CANNOT_UPDATE_LINEITEM_TYPE, + BACKFILL_WEBPROPERTY_CODE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RequiredSizeError : ApiError { + private RequiredSizeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredSizeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredSizeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum RequiredSizeErrorReason { + REQUIRED, + NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RequiredNumberError : ApiError { + private RequiredNumberErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredNumberErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredNumberError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum RequiredNumberErrorReason { + REQUIRED, + TOO_LARGE, + TOO_SMALL, + TOO_LARGE_WITH_DETAILS, + TOO_SMALL_WITH_DETAILS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RequiredCollectionError : ApiError { + private RequiredCollectionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredCollectionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredCollectionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum RequiredCollectionErrorReason { + REQUIRED, + TOO_LARGE, + TOO_SMALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RegExError : ApiError { + private RegExErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RegExErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RegExError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum RegExErrorReason { + INVALID, + NULL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ParseError : ApiError { + private ParseErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ParseErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ParseError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ParseErrorReason { + UNPARSABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class OrderError : ApiError { + private OrderErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OrderErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OrderError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum OrderErrorReason { + UPDATE_CANCELED_ORDER_NOT_ALLOWED, + UPDATE_PENDING_APPROVAL_ORDER_NOT_ALLOWED, + UPDATE_ARCHIVED_ORDER_NOT_ALLOWED, + CANNOT_MODIFY_PROPOSAL_ID, + PRIMARY_USER_REQUIRED, + PRIMARY_USER_CANNOT_BE_SECONDARY, + ORDER_TEAM_NOT_ASSOCIATED_WITH_ADVERTISER, + USER_NOT_ON_ORDERS_TEAMS, + AGENCY_NOT_ON_ORDERS_TEAMS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LineItemOperationError : ApiError { + private LineItemOperationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemOperationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemOperationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum LineItemOperationErrorReason { + NOT_ALLOWED, + NOT_APPLICABLE, + HAS_COMPLETED, + HAS_NO_ACTIVE_CREATIVES, + CANNOT_ACTIVATE_LEGACY_DFP_LINE_ITEM, + CANNOT_DELETE_DELIVERED_LINE_ITEM, + CANNOT_RESERVE_COMPANY_CREDIT_STATUS_NOT_ACTIVE, + CANNOT_ACTIVATE_INVALID_COMPANY_CREDIT_STATUS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LineItemFlightDateError : ApiError { + private LineItemFlightDateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemFlightDateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemFlightDateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum LineItemFlightDateErrorReason { + START_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_NOT_AFTER_START_TIME, + END_DATE_TIME_TOO_LATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LineItemError : ApiError { + private LineItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum LineItemErrorReason { + ALREADY_STARTED, + UPDATE_RESERVATION_NOT_ALLOWED, + ALL_ROADBLOCK_NOT_ALLOWED, + CREATIVE_SET_ROADBLOCK_NOT_ALLOWED, + FRACTIONAL_PERCENTAGE_NOT_ALLOWED, + DISCOUNT_NOT_ALLOWED, + UPDATE_CANCELED_LINE_ITEM_NOT_ALLOWED, + UPDATE_PENDING_APPROVAL_LINE_ITEM_NOT_ALLOWED, + UPDATE_ARCHIVED_LINE_ITEM_NOT_ALLOWED, + FRONTLOADED_NOT_ALLOWED, + CREATE_OR_UPDATE_LEGACY_DFP_LINE_ITEM_TYPE_NOT_ALLOWED, + COPY_LINE_ITEM_FROM_DIFFERENT_COMPANY_NOT_ALLOWED, + INVALID_SIZE_FOR_PLATFORM, + INVALID_LINE_ITEM_TYPE_FOR_PLATFORM, + INVALID_WEB_PROPERTY_FOR_PLATFORM, + INVALID_WEB_PROPERTY_FOR_ENVIRONMENT, + AFMA_BACKFILL_NOT_ALLOWED, + UPDATE_ENVIRONMENT_TYPE_NOT_ALLOWED, + COMPANIONS_NOT_ALLOWED, + ROADBLOCKS_WITH_NONROADBLOCKS_NOT_ALLOWED, + CANNOT_UPDATE_TO_OR_FROM_CREATIVE_SET_ROADBLOCK, + UPDATE_FROM_BACKFILL_LINE_ITEM_TYPE_NOT_ALLOWED, + UPDATE_TO_BACKFILL_LINE_ITEM_TYPE_NOT_ALLOWED, + UPDATE_BACKFILL_WEB_PROPERTY_NOT_ALLOWED, + INVALID_COMPANION_DELIVERY_OPTION_FOR_ENVIRONMENT_TYPE, + COMPANION_BACKFILL_REQUIRES_VIDEO, + COMPANION_DELIVERY_OPTION_REQUIRE_PREMIUM, + DUPLICATE_MASTER_SIZES, + INVALID_PRIORITY_FOR_LINE_ITEM_TYPE, + INVALID_ENVIRONMENT_TYPE, + INVALID_ENVIRONMENT_TYPE_FOR_PLATFORM, + INVALID_TYPE_FOR_AUTO_EXTENSION, + INVALID_TYPE_FOR_CONTRACTED_UNITS_BOUGHT, + VIDEO_INVALID_ROADBLOCKING, + BACKFILL_TYPE_NOT_ALLOWED, + COMPANION_DELIVERY_OPTIONS_NOT_ALLOWED_WITH_BACKFILL, + INVALID_WEB_PROPERTY_FOR_ADX_BACKFILL, + INVALID_SIZE_FOR_ENVIRONMENT, + TARGET_PLATOFRM_NOT_ALLOWED, + INVALID_LINE_ITEM_CURRENCY, + LINE_ITEM_CANNOT_HAVE_MULTIPLE_CURRENCIES, + CANNOT_CHANGE_CURRENCY, + INVALID_FOR_OFFLINE, + INVALID_LINE_ITEM_DATE_TIME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LineItemCreativeAssociationError : ApiError { + private LineItemCreativeAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemCreativeAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum LineItemCreativeAssociationErrorReason { + CREATIVE_IN_WRONG_ADVERTISERS_LIBRARY, + INVALID_LINEITEM_CREATIVE_PAIRING, + STARTDATE_BEFORE_LINEITEM_STARTDATE, + STARTDATE_NOT_BEFORE_LINEITEM_ENDDATE, + ENDDATE_AFTER_LINEITEM_ENDDATE, + ENDDATE_NOT_AFTER_LINEITEM_STARTDATE, + ENDDATE_NOT_AFTER_STARTDATE, + ENDDATE_IN_THE_PAST, + CANNOT_COPY_WITHIN_SAME_LINE_ITEM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LabelEntityAssociationError : ApiError { + private LabelEntityAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LabelEntityAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LabelEntityAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum LabelEntityAssociationErrorReason { + INVALID_COMPANY_TYPE, + DUPLICATE_ASSOCIATION, + INVALID_ASSOCIATION, + DUPLICATE_ASSOCIATION_WITH_NEGATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class InventoryUnitError : ApiError { + private InventoryUnitErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum InventoryUnitErrorReason { + EXPLICIT_TARGETING_NOT_ALLOWED, + TARGET_PLATFORM_NOT_APPLICABLE, + ADSENSE_CANNOT_BE_ENABLED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class InventoryTargetingError : ApiError { + private InventoryTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum InventoryTargetingErrorReason { + AT_LEAST_ONE_PLACEMENT_OR_INVENTORY_UNIT_REQUIRED, + INVENTORY_CANNOT_BE_TARGETED_AND_EXCLUDED, + PARENT_CONTAINS_INVALID_MIX_OF_TARGETED_AND_EXCLUDED_AD_UNITS, + INVENTORY_EXCLUSIONS_MUST_HAVE_PARENT_INVENTORY_UNIT, + INVENTORY_UNIT_CANNOT_BE_TARGETED_IF_ANCESTOR_IS_TARGETED, + INVENTORY_UNIT_CANNOT_BE_TARGETED_IF_ANCESTOR_IS_EXCLUDED, + INVENTORY_UNIT_CANNOT_BE_EXCLUDED_IF_ANCESTOR_IS_EXCLUDED, + EXPLICITLY_TARGETED_INVENTORY_UNIT_CANNOT_BE_TARGETED, + EXPLICITLY_TARGETED_INVENTORY_UNIT_CANNOT_BE_EXCLUDED, + SELF_ONLY_INVENTORY_UNIT_NOT_ALLOWED, + SELF_ONLY_INVENTORY_UNIT_WITHOUT_DESCENDANTS, + INVENTORY_FROM_MULTIPLE_NETWORKS_CANNOT_BE_TARGETED_SIMULTANEOUSLY, + INVENTORY_FROM_LOCAL_AND_DISTRIBUTOR_NETWORKS_CANNOT_BE_TARGETED_SIMULTANEOUSLY, + SHARED_INVENTORY_CANNOT_BE_TARGETED_WITH_AUDIENCE_SEGMENTS_SIMULTANEOUSLY, + UNSUPPORTED_LINE_ITEM_TYPE_FOR_SHARED_INVENTORY_TARGETING, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class InvalidUrlError : ApiError { + private InvalidUrlErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidUrlErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidUrlError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum InvalidUrlErrorReason { + ILLEGAL_CHARACTERS, + INVALID_FORMAT, + INSECURE_SCHEME, + NO_SCHEME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class GeoTargetingError : ApiError { + private GeoTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public GeoTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GeoTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum GeoTargetingErrorReason { + TARGETED_LOCATIONS_NOT_EXCLUDABLE, + EXCLUDED_LOCATIONS_CANNOT_HAVE_CHILDREN_TARGETED, + POSTAL_CODES_CANNOT_BE_EXCLUDED, + UNTARGETABLE_LOCATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class GenericTargetingError : ApiError { + private GenericTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public GenericTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GenericTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum GenericTargetingErrorReason { + CONFLICTING_INCLUSION_OR_EXCLUSION_OF_SIBLINGS, + INCLUDING_DESCENDANTS_OF_EXCLUDED_CRITERIA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class FrequencyCapError : ApiError { + private FrequencyCapErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FrequencyCapErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FrequencyCapError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum FrequencyCapErrorReason { + IMPRESSION_LIMIT_EXCEEDED, + IMPRESSIONS_TOO_LOW, + RANGE_LIMIT_EXCEEDED, + RANGE_TOO_LOW, + DUPLICATE_TIME_RANGE, + TOO_MANY_FREQUENCY_CAPS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ForecastError : ApiError { + private ForecastErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ForecastErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ForecastError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ForecastErrorReason { + SERVER_NOT_AVAILABLE, + INTERNAL_ERROR, + NO_FORECAST_YET, + NOT_ENOUGH_INVENTORY, + SUCCESS, + ZERO_LENGTH_RESERVATION, + EXCEEDED_QUOTA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class EntityLimitReachedError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DayPartTargetingError : ApiError { + private DayPartTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DayPartTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DayPartTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum DayPartTargetingErrorReason { + INVALID_HOUR, + INVALID_MINUTE, + END_TIME_NOT_AFTER_START_TIME, + TIME_PERIODS_OVERLAP, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DateTimeRangeTargetingError : ApiError { + private DateTimeRangeTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DateTimeRangeTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DateTimeRangeTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum DateTimeRangeTargetingErrorReason { + EMPTY_RANGES, + NOT_SPONSORSHIP_LINEITEM, + PAST_RANGES_CHANGED, + RANGES_OVERLAP, + RANGES_OUT_OF_LINEITEM_ACTIVE_PERIOD, + START_TIME_IS_NOT_START_OF_DAY, + END_TIME_IS_NOT_END_OF_DAY, + START_DATE_TIME_IS_IN_PAST, + RANGE_END_TIME_BEFORE_START_TIME, + END_DATE_TIME_IS_TOO_LATE, + LIMITED_RANGES_IN_UNLIMITED_LINEITEM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CustomTargetingError : ApiError { + private CustomTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CustomTargetingErrorReason { + KEY_NOT_FOUND, + KEY_COUNT_TOO_LARGE, + KEY_NAME_DUPLICATE, + KEY_NAME_EMPTY, + KEY_NAME_INVALID_LENGTH, + KEY_NAME_INVALID_CHARS, + KEY_NAME_RESERVED, + KEY_DISPLAY_NAME_INVALID_LENGTH, + VALUE_NOT_FOUND, + GET_VALUES_BY_STATEMENT_MUST_CONTAIN_KEY_ID, + VALUE_COUNT_FOR_KEY_TOO_LARGE, + VALUE_NAME_DUPLICATE, + VALUE_NAME_EMPTY, + VALUE_NAME_INVALID_LENGTH, + VALUE_NAME_INVALID_CHARS, + VALUE_DISPLAY_NAME_INVALID_LENGTH, + VALUE_MATCH_TYPE_NOT_ALLOWED, + VALUE_MATCH_TYPE_NOT_EXACT_FOR_PREDEFINED_KEY, + SUFFIX_MATCH_TYPE_NOT_ALLOWED, + CONTAINS_MATCH_TYPE_NOT_ALLOWED, + KEY_WITH_MISSING_VALUES, + CANNOT_OR_DIFFERENT_KEYS, + INVALID_TARGETING_EXPRESSION, + DELETED_KEY_CANNOT_BE_USED_FOR_TARGETING, + DELETED_VALUE_CANNOT_BE_USED_FOR_TARGETING, + VIDEO_BROWSE_BY_KEY_CANNOT_BE_USED_FOR_CUSTOM_TARGETING, + CANNOT_TARGET_AUDIENCE_SEGMENT, + CANNOT_TARGET_INACTIVE_AUDIENCE_SEGMENT, + INVALID_AUDIENCE_SEGMENTS, + ONLY_APPROVED_AUDIENCE_SEGMENTS_CAN_BE_TARGETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CustomFieldValueError : ApiError { + private CustomFieldValueErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomFieldValueErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomFieldValueError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CustomFieldValueErrorReason { + CUSTOM_FIELD_NOT_FOUND, + CUSTOM_FIELD_INACTIVE, + CUSTOM_FIELD_OPTION_NOT_FOUND, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CreativeError : ApiError { + private CreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CreativeErrorReason { + FLASH_AND_FALLBACK_URL_ARE_SAME, + INVALID_INTERNAL_REDIRECT_URL, + DESTINATION_URL_REQUIRED, + CANNOT_CREATE_OR_UPDATE_LEGACY_DFP_CREATIVE, + CANNOT_CREATE_OR_UPDATE_LEGACY_DFP_MOBILE_CREATIVE, + MISSING_FEATURE, + INVALID_COMPANY_TYPE, + INVALID_ADSENSE_CREATIVE_SIZE, + INVALID_AD_EXCHANGE_CREATIVE_SIZE, + DUPLICATE_ASSET_IN_CREATIVE, + CREATIVE_ASSET_CANNOT_HAVE_ID_AND_BYTE_ARRAY, + CANNOT_CREATE_OR_UPDATE_UNSUPPORTED_CREATIVE, + CANNOT_COPY_VIDEO_CREATIVE_ACROSS_ADVERTISERS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ContentMetadataTargetingError : ApiError { + private ContentMetadataTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ContentMetadataTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ContentMetadataTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ContentMetadataTargetingErrorReason { + VALUES_DO_NOT_BELONG_TO_A_HIERARCHY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CompanyCreditStatusError : ApiError { + private CompanyCreditStatusErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CompanyCreditStatusErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CompanyCreditStatusError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CompanyCreditStatusErrorReason { + COMPANY_CREDIT_STATUS_CHANGE_NOT_ALLOWED, + CANNOT_USE_CREDIT_STATUS_SETTING, + CANNOT_USE_ADVANCED_CREDIT_STATUS_SETTING, + UNACCEPTABLE_COMPANY_CREDIT_STATUS_FOR_ORDER, + UNACCEPTABLE_COMPANY_CREDIT_STATUS_FOR_LINE_ITEM, + CANNOT_BLOCK_COMPANY_TOO_MANY_APPROVED_ORDERS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ClickTrackingLineItemError : ApiError { + private ClickTrackingLineItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ClickTrackingLineItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ClickTrackingLineItemError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ClickTrackingLineItemErrorReason { + TYPE_IMMUTABLE, + INVALID_TARGETING_TYPE, + INVALID_ROADBLOCKING_TYPE, + INVALID_CREATIVEROTATION_TYPE, + INVALID_DELIVERY_RATE_TYPE, + UNSUPPORTED_FIELD, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AudienceExtensionError : ApiError { + private AudienceExtensionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AudienceExtensionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceExtensionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AudienceExtensionErrorReason { + FREQUENCY_CAPS_NOT_SUPPORTED, + INVALID_TARGETING, + INVENTORY_UNIT_TARGETING_INVALID, + INVALID_CREATIVE_ROTATION, + INVALID_EXTERNAL_ENTITY_ID, + INVALID_LINE_ITEM_TYPE, + INVALID_MAX_BID, + AUDIENCE_EXTENSION_BULK_UPDATE_NOT_ALLOWED, + UNEXPECTED_AUDIENCE_EXTENSION_ERROR, + MAX_DAILY_BUDGET_AMOUNT_EXCEEDED, + EXTERNAL_CAMPAIGN_ALREADY_EXISTS, + AUDIENCE_EXTENSION_WITHOUT_FEATURE, + AUDIENCE_EXTENSION_WITHOUT_LINKED_ACCOUNT, + CANNOT_OVERRIDE_CREATIVE_SIZE_WITH_AUDIENCE_EXTENSION, + CANNOT_OVERRIDE_FIELD_WITH_AUDIENCE_EXTENSION, + ONLY_ONE_CREATIVE_PLACEHOLDER_ALLOWED, + MULTIPLE_AUDIENCE_EXTENSION_LINE_ITEMS_ON_ORDER, + CANNOT_COPY_AUDIENCE_EXTENSION_LINE_ITEMS_AND_CREATIVES_TOGETHER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdUnitCodeError : ApiError { + private AdUnitCodeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitCodeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitCodeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AdUnitCodeErrorReason { + INVALID_CHARACTERS, + INVALID_CHARACTERS_WHEN_UTF_CHARACTERS_ARE_ALLOWED, + LEADING_FORWARD_SLASH, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdUnitAfcSizeError : ApiError { + private AdUnitAfcSizeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitAfcSizeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitAfcSizeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AdUnitAfcSizeErrorReason { + INVALID, + DOESNT_FIT, + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CompanyServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CompanyService : DfpSoapClient, ICompanyService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CompanyService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/CompanyService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Company[] createCompanies([System.Xml.Serialization.XmlElementAttribute("companies")] +Company[] companies) { + object[] results = this.Invoke("createCompanies", new object[] { companies }); + return ((Company[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CompanyPage getCompaniesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCompaniesByStatement", new object[] { filterStatement }); + return ((CompanyPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Company[] updateCompanies([System.Xml.Serialization.XmlElementAttribute("companies")] +Company[] companies) { + object[] results = this.Invoke("updateCompanies", new object[] { companies }); + return ((Company[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CompanyPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Company[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Company[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Company { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private CompanyType typeField; + + private bool typeFieldSpecified; + + private string addressField; + + private string emailField; + + private string faxPhoneField; + + private string primaryPhoneField; + + private string externalIdField; + + private string commentField; + + private CompanyCreditStatus creditStatusField; + + private bool creditStatusFieldSpecified; + + private AppliedLabel[] appliedLabelsField; + + private bool enableSameAdvertiserCompetitiveExclusionField; + + private bool enableSameAdvertiserCompetitiveExclusionFieldSpecified; + + private long primaryContactIdField; + + private bool primaryContactIdFieldSpecified; + + private long[] appliedTeamIdsField; + + private int thirdPartyCompanyIdField; + + private bool thirdPartyCompanyIdFieldSpecified; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public CompanyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public string address { + get { return this.addressField; } + set { this.addressField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public string faxPhone { + get { return this.faxPhoneField; } + set { this.faxPhoneField = value; } + } + + public string primaryPhone { + get { return this.primaryPhoneField; } + set { this.primaryPhoneField = value; } + } + + public string externalId { + get { return this.externalIdField; } + set { this.externalIdField = value; } + } + + public string comment { + get { return this.commentField; } + set { this.commentField = value; } + } + + public CompanyCreditStatus creditStatus { + get { return this.creditStatusField; } + set { + this.creditStatusField = value; + this.creditStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creditStatusSpecified { + get { return this.creditStatusFieldSpecified; } + set { this.creditStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + public bool enableSameAdvertiserCompetitiveExclusion { + get { return this.enableSameAdvertiserCompetitiveExclusionField; } + set { + this.enableSameAdvertiserCompetitiveExclusionField = value; + this.enableSameAdvertiserCompetitiveExclusionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool enableSameAdvertiserCompetitiveExclusionSpecified { + get { return this.enableSameAdvertiserCompetitiveExclusionFieldSpecified; } + set { this.enableSameAdvertiserCompetitiveExclusionFieldSpecified = value; } + } + + public long primaryContactId { + get { return this.primaryContactIdField; } + set { + this.primaryContactIdField = value; + this.primaryContactIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool primaryContactIdSpecified { + get { return this.primaryContactIdFieldSpecified; } + set { this.primaryContactIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public int thirdPartyCompanyId { + get { return this.thirdPartyCompanyIdField; } + set { + this.thirdPartyCompanyIdField = value; + this.thirdPartyCompanyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyCompanyIdSpecified { + get { return this.thirdPartyCompanyIdFieldSpecified; } + set { this.thirdPartyCompanyIdFieldSpecified = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Company.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CompanyType { + HOUSE_ADVERTISER, + HOUSE_AGENCY, + ADVERTISER, + AGENCY, + AD_NETWORK, + AFFILIATE_DISTRIBUTION_PARTNER, + CONTENT_PARTNER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Company.CreditStatus", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CompanyCreditStatus { + ACTIVE, + ON_HOLD, + CREDIT_STOP, + INACTIVE, + BLOCKED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class InvalidEmailError : ApiError { + private InvalidEmailErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidEmailErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidEmailError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum InvalidEmailErrorReason { + INVALID_FORMAT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CompanyError : ApiError { + private CompanyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CompanyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CompanyError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CompanyErrorReason { + CANNOT_SET_THIRD_PARTY_COMPANY_DUE_TO_TYPE, + CANNOT_UPDATE_COMPANY_TYPE, + INVALID_COMPANY_TYPE, + PRIMARY_CONTACT_DOES_NOT_BELONG_TO_THIS_COMPANY, + THIRD_PARTY_STATS_PROVIDER_IS_WRONG_ROLE_TYPE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdRuleServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdRuleService : DfpSoapClient, IAdRuleService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdRuleService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/AdRuleService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRule[] createAdRules([System.Xml.Serialization.XmlElementAttribute("adRules")] +AdRule[] adRules) { + object[] results = this.Invoke("createAdRules", new object[] { adRules }); + return ((AdRule[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRulePage getAdRulesByStatement(Statement statement) { + object[] results = this.Invoke("getAdRulesByStatement", new object[] { statement }); + return ((AdRulePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performAdRuleAction(AdRuleAction adRuleAction, Statement filterStatement) { + object[] results = this.Invoke("performAdRuleAction", new object[] { adRuleAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRule[] updateAdRules([System.Xml.Serialization.XmlElementAttribute("adRules")] +AdRule[] adRules) { + object[] results = this.Invoke("updateAdRules", new object[] { adRules }); + return ((AdRule[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteAdRules))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateAdRules))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateAdRules))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class AdRuleAction { + private string adRuleActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AdRuleAction.Type")] + public string AdRuleActionType { + get { return this.adRuleActionTypeField; } + set { this.adRuleActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeleteAdRules : AdRuleAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeactivateAdRules : AdRuleAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ActivateAdRules : AdRuleAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdRulePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AdRule[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AdRule[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdRule { + private int idField; + + private bool idFieldSpecified; + + private string nameField; + + private int priorityField; + + private bool priorityFieldSpecified; + + private Targeting targetingField; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private AdRuleStatus statusField; + + private bool statusFieldSpecified; + + private FrequencyCapBehavior frequencyCapBehaviorField; + + private bool frequencyCapBehaviorFieldSpecified; + + private int maxImpressionsPerLineItemPerStreamField; + + private bool maxImpressionsPerLineItemPerStreamFieldSpecified; + + private int maxImpressionsPerLineItemPerPodField; + + private bool maxImpressionsPerLineItemPerPodFieldSpecified; + + private BaseAdRuleSlot prerollField; + + private BaseAdRuleSlot midrollField; + + private BaseAdRuleSlot postrollField; + + public int id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + public Targeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public AdRuleStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public FrequencyCapBehavior frequencyCapBehavior { + get { return this.frequencyCapBehaviorField; } + set { + this.frequencyCapBehaviorField = value; + this.frequencyCapBehaviorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool frequencyCapBehaviorSpecified { + get { return this.frequencyCapBehaviorFieldSpecified; } + set { this.frequencyCapBehaviorFieldSpecified = value; } + } + + public int maxImpressionsPerLineItemPerStream { + get { return this.maxImpressionsPerLineItemPerStreamField; } + set { + this.maxImpressionsPerLineItemPerStreamField = value; + this.maxImpressionsPerLineItemPerStreamSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxImpressionsPerLineItemPerStreamSpecified { + get { return this.maxImpressionsPerLineItemPerStreamFieldSpecified; } + set { this.maxImpressionsPerLineItemPerStreamFieldSpecified = value; } + } + + public int maxImpressionsPerLineItemPerPod { + get { return this.maxImpressionsPerLineItemPerPodField; } + set { + this.maxImpressionsPerLineItemPerPodField = value; + this.maxImpressionsPerLineItemPerPodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxImpressionsPerLineItemPerPodSpecified { + get { return this.maxImpressionsPerLineItemPerPodFieldSpecified; } + set { this.maxImpressionsPerLineItemPerPodFieldSpecified = value; } + } + + public BaseAdRuleSlot preroll { + get { return this.prerollField; } + set { this.prerollField = value; } + } + + public BaseAdRuleSlot midroll { + get { return this.midrollField; } + set { this.midrollField = value; } + } + + public BaseAdRuleSlot postroll { + get { return this.postrollField; } + set { this.postrollField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AdRuleStatus { + ACTIVE, + INACTIVE, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum FrequencyCapBehavior { + TURN_ON, + TURN_OFF, + DEFER, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnknownAdRuleSlot))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StandardPoddingAdRuleSlot))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OptimizedPoddingAdRuleSlot))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NoPoddingAdRuleSlot))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class BaseAdRuleSlot { + private long idField; + + private bool idFieldSpecified; + + private AdRuleSlotBehavior slotBehaviorField; + + private bool slotBehaviorFieldSpecified; + + private long minVideoAdDurationField; + + private bool minVideoAdDurationFieldSpecified; + + private long maxVideoAdDurationField; + + private bool maxVideoAdDurationFieldSpecified; + + private MidrollFrequencyType videoMidrollFrequencyTypeField; + + private bool videoMidrollFrequencyTypeFieldSpecified; + + private string videoMidrollFrequencyField; + + private AdRuleSlotBumper bumperField; + + private bool bumperFieldSpecified; + + private long maxBumperDurationField; + + private bool maxBumperDurationFieldSpecified; + + private long minPodDurationField; + + private bool minPodDurationFieldSpecified; + + private long maxPodDurationField; + + private bool maxPodDurationFieldSpecified; + + private int maxAdsInPodField; + + private bool maxAdsInPodFieldSpecified; + + private string baseAdRuleSlotTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public AdRuleSlotBehavior slotBehavior { + get { return this.slotBehaviorField; } + set { + this.slotBehaviorField = value; + this.slotBehaviorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool slotBehaviorSpecified { + get { return this.slotBehaviorFieldSpecified; } + set { this.slotBehaviorFieldSpecified = value; } + } + + public long minVideoAdDuration { + get { return this.minVideoAdDurationField; } + set { + this.minVideoAdDurationField = value; + this.minVideoAdDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minVideoAdDurationSpecified { + get { return this.minVideoAdDurationFieldSpecified; } + set { this.minVideoAdDurationFieldSpecified = value; } + } + + public long maxVideoAdDuration { + get { return this.maxVideoAdDurationField; } + set { + this.maxVideoAdDurationField = value; + this.maxVideoAdDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxVideoAdDurationSpecified { + get { return this.maxVideoAdDurationFieldSpecified; } + set { this.maxVideoAdDurationFieldSpecified = value; } + } + + public MidrollFrequencyType videoMidrollFrequencyType { + get { return this.videoMidrollFrequencyTypeField; } + set { + this.videoMidrollFrequencyTypeField = value; + this.videoMidrollFrequencyTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoMidrollFrequencyTypeSpecified { + get { return this.videoMidrollFrequencyTypeFieldSpecified; } + set { this.videoMidrollFrequencyTypeFieldSpecified = value; } + } + + public string videoMidrollFrequency { + get { return this.videoMidrollFrequencyField; } + set { this.videoMidrollFrequencyField = value; } + } + + public AdRuleSlotBumper bumper { + get { return this.bumperField; } + set { + this.bumperField = value; + this.bumperSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bumperSpecified { + get { return this.bumperFieldSpecified; } + set { this.bumperFieldSpecified = value; } + } + + public long maxBumperDuration { + get { return this.maxBumperDurationField; } + set { + this.maxBumperDurationField = value; + this.maxBumperDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxBumperDurationSpecified { + get { return this.maxBumperDurationFieldSpecified; } + set { this.maxBumperDurationFieldSpecified = value; } + } + + public long minPodDuration { + get { return this.minPodDurationField; } + set { + this.minPodDurationField = value; + this.minPodDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minPodDurationSpecified { + get { return this.minPodDurationFieldSpecified; } + set { this.minPodDurationFieldSpecified = value; } + } + + public long maxPodDuration { + get { return this.maxPodDurationField; } + set { + this.maxPodDurationField = value; + this.maxPodDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxPodDurationSpecified { + get { return this.maxPodDurationFieldSpecified; } + set { this.maxPodDurationFieldSpecified = value; } + } + + public int maxAdsInPod { + get { return this.maxAdsInPodField; } + set { + this.maxAdsInPodField = value; + this.maxAdsInPodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxAdsInPodSpecified { + get { return this.maxAdsInPodFieldSpecified; } + set { this.maxAdsInPodFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseAdRuleSlot.Type")] + public string BaseAdRuleSlotType { + get { return this.baseAdRuleSlotTypeField; } + set { this.baseAdRuleSlotTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AdRuleSlotBehavior { + ALWAYS_SHOW, + NEVER_SHOW, + DEFER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum MidrollFrequencyType { + NONE, + EVERY_N_SECONDS, + FIXED_TIME, + EVERY_N_CUEPOINTS, + FIXED_CUE_POINTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AdRuleSlotBumper { + NONE, + BEFORE, + AFTER, + BEFORE_AND_AFTER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class UnknownAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class StandardPoddingAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class OptimizedPoddingAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class NoPoddingAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class PoddingError : ApiError { + private PoddingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PoddingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PoddingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum PoddingErrorReason { + INVALID_PODDING_TYPE_NONE, + INVALID_PODDING_TYPE_STANDARD, + INVALID_OPTIMIZED_POD_WITHOUT_DURATION, + INVALID_OPTIMIZED_POD_WITHOUT_ADS, + INVALID_POD_DURATION_RANGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdRuleSlotError : ApiError { + private AdRuleSlotErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRuleSlotErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRuleSlotError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AdRuleSlotErrorReason { + DIFFERENT_STATUS_THAN_AD_RULE, + INVALID_VIDEO_AD_DURATION_RANGE, + INVALID_VIDEO_MIDROLL_FREQUENCY_TYPE, + MALFORMED_VIDEO_MIDROLL_FREQUENCY_CSV, + MALFORMED_VIDEO_MIDROLL_FREQUENCY_SINGLE_NUMBER, + INVALID_OVERLAY_AD_DURATION_RANGE, + INVALID_OVERLAY_MIDROLL_FREQUENCY_TYPE, + MALFORMED_OVERLAY_MIDROLL_FREQUENCY_CSV, + MALFORMED_OVERLAY_MIDROLL_FREQUENCY_SINGLE_NUMBER, + INVALID_BUMPER_MAX_DURATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdRulePriorityError : ApiError { + private AdRulePriorityErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRulePriorityErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRulePriorityError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AdRulePriorityErrorReason { + DUPLICATE_PRIORITY, + PRIORITIES_NOT_SEQUENTIAL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdRuleFrequencyCapError : ApiError { + private AdRuleFrequencyCapErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRuleFrequencyCapErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRuleFrequencyCapError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AdRuleFrequencyCapErrorReason { + NO_FREQUENCY_CAPS_SPECIFIED_WHEN_FREQUENCY_CAPS_TURNED_ON, + FREQUENCY_CAPS_SPECIFIED_WHEN_FREQUENCY_CAPS_TURNED_OFF, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdRuleDateError : ApiError { + private AdRuleDateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRuleDateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRuleDateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AdRuleDateErrorReason { + START_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_NOT_AFTER_START_TIME, + END_DATE_TIME_TOO_LATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "SuggestedAdUnitServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class SuggestedAdUnitService : DfpSoapClient, ISuggestedAdUnitService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public SuggestedAdUnitService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/SuggestedAdUnitService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SuggestedAdUnitPage getSuggestedAdUnitsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getSuggestedAdUnitsByStatement", new object[] { filterStatement }); + return ((SuggestedAdUnitPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SuggestedAdUnitUpdateResult performSuggestedAdUnitAction(SuggestedAdUnitAction suggestedAdUnitAction, Statement filterStatement) { + object[] results = this.Invoke("performSuggestedAdUnitAction", new object[] { suggestedAdUnitAction, filterStatement }); + return ((SuggestedAdUnitUpdateResult) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class SuggestedAdUnitUpdateResult { + private string[] newAdUnitIdsField; + + private int numChangesField; + + private bool numChangesFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("newAdUnitIds")] + public string[] newAdUnitIds { + get { return this.newAdUnitIdsField; } + set { this.newAdUnitIdsField = value; } + } + + public int numChanges { + get { return this.numChangesField; } + set { + this.numChangesField = value; + this.numChangesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numChangesSpecified { + get { return this.numChangesFieldSpecified; } + set { this.numChangesFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveSuggestedAdUnit))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class SuggestedAdUnitAction { + private string suggestedAdUnitActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("SuggestedAdUnitAction.Type")] + public string SuggestedAdUnitActionType { + get { return this.suggestedAdUnitActionTypeField; } + set { this.suggestedAdUnitActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ApproveSuggestedAdUnit : SuggestedAdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdUnitSize { + private Size sizeField; + + private EnvironmentType environmentTypeField; + + private bool environmentTypeFieldSpecified; + + private AdUnitSize[] companionsField; + + private string fullDisplayStringField; + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + public EnvironmentType environmentType { + get { return this.environmentTypeField; } + set { + this.environmentTypeField = value; + this.environmentTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool environmentTypeSpecified { + get { return this.environmentTypeFieldSpecified; } + set { this.environmentTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companions")] + public AdUnitSize[] companions { + get { return this.companionsField; } + set { this.companionsField = value; } + } + + public string fullDisplayString { + get { return this.fullDisplayStringField; } + set { this.fullDisplayStringField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdUnitParent { + private string idField; + + private string nameField; + + private string adUnitCodeField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string adUnitCode { + get { return this.adUnitCodeField; } + set { this.adUnitCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class SuggestedAdUnit { + private string idField; + + private long numRequestsField; + + private bool numRequestsFieldSpecified; + + private string[] pathField; + + private AdUnitParent[] parentPathField; + + private AdUnitTargetWindow targetWindowField; + + private bool targetWindowFieldSpecified; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private AdUnitSize[] suggestedAdUnitSizesField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public long numRequests { + get { return this.numRequestsField; } + set { + this.numRequestsField = value; + this.numRequestsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numRequestsSpecified { + get { return this.numRequestsFieldSpecified; } + set { this.numRequestsFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("path")] + public string[] path { + get { return this.pathField; } + set { this.pathField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("parentPath")] + public AdUnitParent[] parentPath { + get { return this.parentPathField; } + set { this.parentPathField = value; } + } + + public AdUnitTargetWindow targetWindow { + get { return this.targetWindowField; } + set { + this.targetWindowField = value; + this.targetWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetWindowSpecified { + get { return this.targetWindowFieldSpecified; } + set { this.targetWindowFieldSpecified = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("suggestedAdUnitSizes")] + public AdUnitSize[] suggestedAdUnitSizes { + get { return this.suggestedAdUnitSizesField; } + set { this.suggestedAdUnitSizesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnit.TargetWindow", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AdUnitTargetWindow { + TOP, + BLANK + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class SuggestedAdUnitPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private SuggestedAdUnit[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public SuggestedAdUnit[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LineItemServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LineItemService : DfpSoapClient, ILineItemService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LineItemService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/LineItemService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItem[] createLineItems([System.Xml.Serialization.XmlElementAttribute("lineItems")] +LineItem[] lineItems) { + object[] results = this.Invoke("createLineItems", new object[] { lineItems }); + return ((LineItem[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemPage getLineItemsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLineItemsByStatement", new object[] { filterStatement }); + return ((LineItemPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performLineItemAction(LineItemAction lineItemAction, Statement filterStatement) { + object[] results = this.Invoke("performLineItemAction", new object[] { lineItemAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItem[] updateLineItems([System.Xml.Serialization.XmlElementAttribute("lineItems")] +LineItem[] lineItems) { + object[] results = this.Invoke("updateLineItems", new object[] { lineItems }); + return ((LineItem[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveAndOverbookLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReleaseLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PauseLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class LineItemAction { + private string lineItemActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LineItemAction.Type")] + public string LineItemActionType { + get { return this.lineItemActionTypeField; } + set { this.lineItemActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class UnarchiveLineItems : LineItemAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ResumeLineItems : LineItemAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ResumeAndOverbookLineItems : ResumeLineItems { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveAndOverbookLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ReserveLineItems : LineItemAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ReserveAndOverbookLineItems : ReserveLineItems { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ReleaseLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class PauseLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeleteLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ArchiveLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ActivateLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LineItemPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LineItem[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LineItem[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "RateCardServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class RateCardService : DfpSoapClient, IRateCardService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public RateCardService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/RateCardService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCard[] createRateCards([System.Xml.Serialization.XmlElementAttribute("rateCards")] +RateCard[] rateCards) { + object[] results = this.Invoke("createRateCards", new object[] { rateCards }); + return ((RateCard[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardPage getRateCardsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getRateCardsByStatement", new object[] { filterStatement }); + return ((RateCardPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performRateCardAction(RateCardAction rateCardAction, Statement filterStatement) { + object[] results = this.Invoke("performRateCardAction", new object[] { rateCardAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCard[] updateRateCards([System.Xml.Serialization.XmlElementAttribute("rateCards")] +RateCard[] rateCards) { + object[] results = this.Invoke("updateRateCards", new object[] { rateCards }); + return ((RateCard[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateRateCards))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateRateCards))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class RateCardAction { + private string rateCardActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("RateCardAction.Type")] + public string RateCardActionType { + get { return this.rateCardActionTypeField; } + set { this.rateCardActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeactivateRateCards : RateCardAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ActivateRateCards : RateCardAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RateCardPage { + private RateCard[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public RateCard[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RateCard { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string currencyCodeField; + + private RateCardStatus statusField; + + private bool statusFieldSpecified; + + private long[] appliedTeamIdsField; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public RateCardStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum RateCardStatus { + ACTIVE, + INACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RateCardError : ApiError { + private RateCardErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RateCardErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RateCardError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum RateCardErrorReason { + INVALID_CURRENCY_CODE, + UNSUPPORTED_CURRENCY_CODE, + UNCHANGEABLE_CURRENCY_CODE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RateCardActionError : ApiError { + private RateCardActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RateCardActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RateCardActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum RateCardActionErrorReason { + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeTemplateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeTemplateService : DfpSoapClient, ICreativeTemplateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeTemplateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/CreativeTemplateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeTemplatePage getCreativeTemplatesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativeTemplatesByStatement", new object[] { filterStatement }); + return ((CreativeTemplatePage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ListStringCreativeTemplateVariable.VariableChoice", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ListStringCreativeTemplateVariableVariableChoice { + private string labelField; + + private string valueField; + + public string label { + get { return this.labelField; } + set { this.labelField = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UrlCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListStringCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetCreativeTemplateVariable))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class CreativeTemplateVariable { + private string labelField; + + private string uniqueNameField; + + private string descriptionField; + + private bool isRequiredField; + + private bool isRequiredFieldSpecified; + + private string creativeTemplateVariableTypeField; + + public string label { + get { return this.labelField; } + set { this.labelField = value; } + } + + public string uniqueName { + get { return this.uniqueNameField; } + set { this.uniqueNameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isRequired { + get { return this.isRequiredField; } + set { + this.isRequiredField = value; + this.isRequiredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isRequiredSpecified { + get { return this.isRequiredFieldSpecified; } + set { this.isRequiredFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("CreativeTemplateVariable.Type")] + public string CreativeTemplateVariableType { + get { return this.creativeTemplateVariableTypeField; } + set { this.creativeTemplateVariableTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class UrlCreativeTemplateVariable : CreativeTemplateVariable { + private string defaultValueField; + + private bool isTrackingUrlField; + + private bool isTrackingUrlFieldSpecified; + + public string defaultValue { + get { return this.defaultValueField; } + set { this.defaultValueField = value; } + } + + public bool isTrackingUrl { + get { return this.isTrackingUrlField; } + set { + this.isTrackingUrlField = value; + this.isTrackingUrlSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTrackingUrlSpecified { + get { return this.isTrackingUrlFieldSpecified; } + set { this.isTrackingUrlFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListStringCreativeTemplateVariable))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class StringCreativeTemplateVariable : CreativeTemplateVariable { + private string defaultValueField; + + public string defaultValue { + get { return this.defaultValueField; } + set { this.defaultValueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ListStringCreativeTemplateVariable : StringCreativeTemplateVariable { + private ListStringCreativeTemplateVariableVariableChoice[] choicesField; + + private bool allowOtherChoiceField; + + private bool allowOtherChoiceFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("choices")] + public ListStringCreativeTemplateVariableVariableChoice[] choices { + get { return this.choicesField; } + set { this.choicesField = value; } + } + + public bool allowOtherChoice { + get { return this.allowOtherChoiceField; } + set { + this.allowOtherChoiceField = value; + this.allowOtherChoiceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowOtherChoiceSpecified { + get { return this.allowOtherChoiceFieldSpecified; } + set { this.allowOtherChoiceFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LongCreativeTemplateVariable : CreativeTemplateVariable { + private long defaultValueField; + + private bool defaultValueFieldSpecified; + + public long defaultValue { + get { return this.defaultValueField; } + set { + this.defaultValueField = value; + this.defaultValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool defaultValueSpecified { + get { return this.defaultValueFieldSpecified; } + set { this.defaultValueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AssetCreativeTemplateVariable : CreativeTemplateVariable { + private AssetCreativeTemplateVariableMimeType[] mimeTypesField; + + [System.Xml.Serialization.XmlElementAttribute("mimeTypes")] + public AssetCreativeTemplateVariableMimeType[] mimeTypes { + get { return this.mimeTypesField; } + set { this.mimeTypesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AssetCreativeTemplateVariable.MimeType", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AssetCreativeTemplateVariableMimeType { + JPG, + PNG, + GIF, + SWF + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CreativeTemplate { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private CreativeTemplateVariable[] variablesField; + + private string snippetField; + + private CreativeTemplateStatus statusField; + + private bool statusFieldSpecified; + + private CreativeTemplateType typeField; + + private bool typeFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("variables")] + public CreativeTemplateVariable[] variables { + get { return this.variablesField; } + set { this.variablesField = value; } + } + + public string snippet { + get { return this.snippetField; } + set { this.snippetField = value; } + } + + public CreativeTemplateStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public CreativeTemplateType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CreativeTemplateStatus { + ACTIVE, + INACTIVE, + DELETED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CreativeTemplateType { + SYSTEM_DEFINED, + USER_DEFINED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CreativeTemplatePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeTemplate[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeTemplate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CreativeTemplateError : ApiError { + private CreativeTemplateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeTemplateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeTemplateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CreativeTemplateErrorReason { + CANNOT_PARSE_CREATIVE_TEMPLATE, + VARIABLE_DUPLICATE_UNIQUE_NAME, + VARIABLE_INVALID_UNIQUE_NAME, + LIST_CHOICE_DUPLICATE_VALUE, + LIST_CHOICE_NEEDS_DEFAULT, + LIST_CHOICES_EMPTY, + NO_TARGET_PLATFORMS, + MULTIPLE_TARGET_PLATFORMS, + UNRECOGNIZED_PLACEHOLDER, + PLACEHOLDERS_NOT_IN_FORMATTER, + MISSING_INTERSTITIAL_MACRO, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ContentMetadataKeyHierarchyServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ContentMetadataKeyHierarchyService : DfpSoapClient, IContentMetadataKeyHierarchyService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ContentMetadataKeyHierarchyService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/ContentMetadataKeyHierarchyServ" + "ice"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContentMetadataKeyHierarchy[] createContentMetadataKeyHierarchies([System.Xml.Serialization.XmlElementAttribute("contentMetadataKeyHierarchies")] +ContentMetadataKeyHierarchy[] contentMetadataKeyHierarchies) { + object[] results = this.Invoke("createContentMetadataKeyHierarchies", new object[] { contentMetadataKeyHierarchies }); + return ((ContentMetadataKeyHierarchy[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContentMetadataKeyHierarchyPage getContentMetadataKeyHierarchiesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getContentMetadataKeyHierarchiesByStatement", new object[] { filterStatement }); + return ((ContentMetadataKeyHierarchyPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performContentMetadataKeyHierarchyAction(ContentMetadataKeyHierarchyAction contentMetadataKeyHierarchyAction, Statement filterStatement) { + object[] results = this.Invoke("performContentMetadataKeyHierarchyAction", new object[] { contentMetadataKeyHierarchyAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContentMetadataKeyHierarchy[] updateContentMetadataKeyHierarchies([System.Xml.Serialization.XmlElementAttribute("contentMetadataKeyHierarchies")] +ContentMetadataKeyHierarchy[] contentMetadataKeyHierarchies) { + object[] results = this.Invoke("updateContentMetadataKeyHierarchies", new object[] { contentMetadataKeyHierarchies }); + return ((ContentMetadataKeyHierarchy[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteContentMetadataKeyHierarchies))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class ContentMetadataKeyHierarchyAction { + private string contentMetadataKeyHierarchyActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ContentMetadataKeyHierarchyAction.Type")] + public string ContentMetadataKeyHierarchyActionType { + get { return this.contentMetadataKeyHierarchyActionTypeField; } + set { this.contentMetadataKeyHierarchyActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeleteContentMetadataKeyHierarchies : ContentMetadataKeyHierarchyAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ContentMetadataKeyHierarchyPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ContentMetadataKeyHierarchy[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ContentMetadataKeyHierarchy[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ContentMetadataKeyHierarchy { + private int idField; + + private bool idFieldSpecified; + + private string nameField; + + private ContentMetadataKeyHierarchyLevel[] hierarchyLevelsField; + + private ContentMetadataKeyHierarchyStatus statusField; + + private bool statusFieldSpecified; + + public int id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("hierarchyLevels")] + public ContentMetadataKeyHierarchyLevel[] hierarchyLevels { + get { return this.hierarchyLevelsField; } + set { this.hierarchyLevelsField = value; } + } + + public ContentMetadataKeyHierarchyStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ContentMetadataKeyHierarchyLevel { + private long customTargetingKeyIdField; + + private bool customTargetingKeyIdFieldSpecified; + + private int hierarchyLevelField; + + private bool hierarchyLevelFieldSpecified; + + public long customTargetingKeyId { + get { return this.customTargetingKeyIdField; } + set { + this.customTargetingKeyIdField = value; + this.customTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customTargetingKeyIdSpecified { + get { return this.customTargetingKeyIdFieldSpecified; } + set { this.customTargetingKeyIdFieldSpecified = value; } + } + + public int hierarchyLevel { + get { return this.hierarchyLevelField; } + set { + this.hierarchyLevelField = value; + this.hierarchyLevelSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hierarchyLevelSpecified { + get { return this.hierarchyLevelFieldSpecified; } + set { this.hierarchyLevelFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ContentMetadataKeyHierarchyStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ContentMetadataKeyHierarchyError : ApiError { + private ContentMetadataKeyHierarchyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ContentMetadataKeyHierarchyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ContentMetadataKeyHierarchyError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ContentMetadataKeyHierarchyErrorReason { + LEVEL_MISSING, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomTargetingServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomTargetingService : DfpSoapClient, ICustomTargetingService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomTargetingService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/CustomTargetingService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingKey[] createCustomTargetingKeys([System.Xml.Serialization.XmlElementAttribute("keys")] +CustomTargetingKey[] keys) { + object[] results = this.Invoke("createCustomTargetingKeys", new object[] { keys }); + return ((CustomTargetingKey[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingValue[] createCustomTargetingValues([System.Xml.Serialization.XmlElementAttribute("values")] +CustomTargetingValue[] values) { + object[] results = this.Invoke("createCustomTargetingValues", new object[] { values }); + return ((CustomTargetingValue[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingKeyPage getCustomTargetingKeysByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomTargetingKeysByStatement", new object[] { filterStatement }); + return ((CustomTargetingKeyPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingValuePage getCustomTargetingValuesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomTargetingValuesByStatement", new object[] { filterStatement }); + return ((CustomTargetingValuePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performCustomTargetingKeyAction(CustomTargetingKeyAction customTargetingKeyAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomTargetingKeyAction", new object[] { customTargetingKeyAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performCustomTargetingValueAction(CustomTargetingValueAction customTargetingValueAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomTargetingValueAction", new object[] { customTargetingValueAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingKey[] updateCustomTargetingKeys([System.Xml.Serialization.XmlElementAttribute("keys")] +CustomTargetingKey[] keys) { + object[] results = this.Invoke("updateCustomTargetingKeys", new object[] { keys }); + return ((CustomTargetingKey[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingValue[] updateCustomTargetingValues([System.Xml.Serialization.XmlElementAttribute("values")] +CustomTargetingValue[] values) { + object[] results = this.Invoke("updateCustomTargetingValues", new object[] { values }); + return ((CustomTargetingValue[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteCustomTargetingValues))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class CustomTargetingValueAction { + private string customTargetingValueActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomTargetingValueAction.Type")] + public string CustomTargetingValueActionType { + get { return this.customTargetingValueActionTypeField; } + set { this.customTargetingValueActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeleteCustomTargetingValues : CustomTargetingValueAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteCustomTargetingKeys))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class CustomTargetingKeyAction { + private string customTargetingKeyActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomTargetingKeyAction.Type")] + public string CustomTargetingKeyActionType { + get { return this.customTargetingKeyActionTypeField; } + set { this.customTargetingKeyActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeleteCustomTargetingKeys : CustomTargetingKeyAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CustomTargetingValuePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomTargetingValue[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomTargetingValue[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CustomTargetingValue { + private long customTargetingKeyIdField; + + private bool customTargetingKeyIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string displayNameField; + + private CustomTargetingValueMatchType matchTypeField; + + private bool matchTypeFieldSpecified; + + public long customTargetingKeyId { + get { return this.customTargetingKeyIdField; } + set { + this.customTargetingKeyIdField = value; + this.customTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customTargetingKeyIdSpecified { + get { return this.customTargetingKeyIdFieldSpecified; } + set { this.customTargetingKeyIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public CustomTargetingValueMatchType matchType { + get { return this.matchTypeField; } + set { + this.matchTypeField = value; + this.matchTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool matchTypeSpecified { + get { return this.matchTypeFieldSpecified; } + set { this.matchTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingValue.MatchType", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CustomTargetingValueMatchType { + EXACT, + BROAD, + PREFIX, + BROAD_PREFIX, + SUFFIX, + CONTAINS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CustomTargetingKeyPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomTargetingKey[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomTargetingKey[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CustomTargetingKey { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string displayNameField; + + private CustomTargetingKeyType typeField; + + private bool typeFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public CustomTargetingKeyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingKey.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CustomTargetingKeyType { + PREDEFINED, + FREEFORM + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProductServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProductService : DfpSoapClient, IProductService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProductService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/ProductService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductPage getProductsByStatement(Statement statement) { + object[] results = this.Invoke("getProductsByStatement", new object[] { statement }); + return ((ProductPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performProductAction(ProductAction productAction, Statement filterStatement) { + object[] results = this.Invoke("performProductAction", new object[] { productAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Product[] updateProducts([System.Xml.Serialization.XmlElementAttribute("products")] +Product[] products) { + object[] results = this.Invoke("updateProducts", new object[] { products }); + return ((Product[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateProducts))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveProducts))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateProducts))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class ProductAction { + private string productActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProductAction.Type")] + public string ProductActionType { + get { return this.productActionTypeField; } + set { this.productActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeactivateProducts : ProductAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ArchiveProducts : ProductAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ActivateProducts : ProductAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ProductTemplateTargeting { + private GeoTargeting geoTargetingField; + + private bool allowGeoTargetingCustomizationField; + + private bool allowGeoTargetingCustomizationFieldSpecified; + + private InventoryTargeting inventoryTargetingField; + + private bool allowAdUnitTargetingCustomizationField; + + private bool allowAdUnitTargetingCustomizationFieldSpecified; + + private bool allowPlacementTargetingCustomizationField; + + private bool allowPlacementTargetingCustomizationFieldSpecified; + + private CustomCriteriaSet customTargetingField; + + private long[] customizableCustomTargetingKeyIdsField; + + private UserDomainTargeting userDomainTargetingField; + + private bool allowUserDomainTargetingCustomizationField; + + private bool allowUserDomainTargetingCustomizationFieldSpecified; + + private BandwidthGroupTargeting bandwidthGroupTargetingField; + + private bool allowBandwidthGroupTargetingCustomizationField; + + private bool allowBandwidthGroupTargetingCustomizationFieldSpecified; + + private BrowserTargeting browserTargetingField; + + private bool allowBrowserTargetingCustomizationField; + + private bool allowBrowserTargetingCustomizationFieldSpecified; + + private BrowserLanguageTargeting browserLanguageTargetingField; + + private bool allowBrowserLanguageTargetingCustomizationField; + + private bool allowBrowserLanguageTargetingCustomizationFieldSpecified; + + private OperatingSystemTargeting operatingSystemTargetingField; + + private bool allowOperatingSystemTargetingCustomizationField; + + private bool allowOperatingSystemTargetingCustomizationFieldSpecified; + + public GeoTargeting geoTargeting { + get { return this.geoTargetingField; } + set { this.geoTargetingField = value; } + } + + public bool allowGeoTargetingCustomization { + get { return this.allowGeoTargetingCustomizationField; } + set { + this.allowGeoTargetingCustomizationField = value; + this.allowGeoTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowGeoTargetingCustomizationSpecified { + get { return this.allowGeoTargetingCustomizationFieldSpecified; } + set { this.allowGeoTargetingCustomizationFieldSpecified = value; } + } + + public InventoryTargeting inventoryTargeting { + get { return this.inventoryTargetingField; } + set { this.inventoryTargetingField = value; } + } + + public bool allowAdUnitTargetingCustomization { + get { return this.allowAdUnitTargetingCustomizationField; } + set { + this.allowAdUnitTargetingCustomizationField = value; + this.allowAdUnitTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowAdUnitTargetingCustomizationSpecified { + get { return this.allowAdUnitTargetingCustomizationFieldSpecified; } + set { this.allowAdUnitTargetingCustomizationFieldSpecified = value; } + } + + public bool allowPlacementTargetingCustomization { + get { return this.allowPlacementTargetingCustomizationField; } + set { + this.allowPlacementTargetingCustomizationField = value; + this.allowPlacementTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowPlacementTargetingCustomizationSpecified { + get { return this.allowPlacementTargetingCustomizationFieldSpecified; } + set { this.allowPlacementTargetingCustomizationFieldSpecified = value; } + } + + public CustomCriteriaSet customTargeting { + get { return this.customTargetingField; } + set { this.customTargetingField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customizableCustomTargetingKeyIds")] + public long[] customizableCustomTargetingKeyIds { + get { return this.customizableCustomTargetingKeyIdsField; } + set { this.customizableCustomTargetingKeyIdsField = value; } + } + + public UserDomainTargeting userDomainTargeting { + get { return this.userDomainTargetingField; } + set { this.userDomainTargetingField = value; } + } + + public bool allowUserDomainTargetingCustomization { + get { return this.allowUserDomainTargetingCustomizationField; } + set { + this.allowUserDomainTargetingCustomizationField = value; + this.allowUserDomainTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowUserDomainTargetingCustomizationSpecified { + get { return this.allowUserDomainTargetingCustomizationFieldSpecified; } + set { this.allowUserDomainTargetingCustomizationFieldSpecified = value; } + } + + public BandwidthGroupTargeting bandwidthGroupTargeting { + get { return this.bandwidthGroupTargetingField; } + set { this.bandwidthGroupTargetingField = value; } + } + + public bool allowBandwidthGroupTargetingCustomization { + get { return this.allowBandwidthGroupTargetingCustomizationField; } + set { + this.allowBandwidthGroupTargetingCustomizationField = value; + this.allowBandwidthGroupTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowBandwidthGroupTargetingCustomizationSpecified { + get { return this.allowBandwidthGroupTargetingCustomizationFieldSpecified; } + set { this.allowBandwidthGroupTargetingCustomizationFieldSpecified = value; } + } + + public BrowserTargeting browserTargeting { + get { return this.browserTargetingField; } + set { this.browserTargetingField = value; } + } + + public bool allowBrowserTargetingCustomization { + get { return this.allowBrowserTargetingCustomizationField; } + set { + this.allowBrowserTargetingCustomizationField = value; + this.allowBrowserTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowBrowserTargetingCustomizationSpecified { + get { return this.allowBrowserTargetingCustomizationFieldSpecified; } + set { this.allowBrowserTargetingCustomizationFieldSpecified = value; } + } + + public BrowserLanguageTargeting browserLanguageTargeting { + get { return this.browserLanguageTargetingField; } + set { this.browserLanguageTargetingField = value; } + } + + public bool allowBrowserLanguageTargetingCustomization { + get { return this.allowBrowserLanguageTargetingCustomizationField; } + set { + this.allowBrowserLanguageTargetingCustomizationField = value; + this.allowBrowserLanguageTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowBrowserLanguageTargetingCustomizationSpecified { + get { return this.allowBrowserLanguageTargetingCustomizationFieldSpecified; } + set { this.allowBrowserLanguageTargetingCustomizationFieldSpecified = value; } + } + + public OperatingSystemTargeting operatingSystemTargeting { + get { return this.operatingSystemTargetingField; } + set { this.operatingSystemTargetingField = value; } + } + + public bool allowOperatingSystemTargetingCustomization { + get { return this.allowOperatingSystemTargetingCustomizationField; } + set { + this.allowOperatingSystemTargetingCustomizationField = value; + this.allowOperatingSystemTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowOperatingSystemTargetingCustomizationSpecified { + get { return this.allowOperatingSystemTargetingCustomizationFieldSpecified; } + set { this.allowOperatingSystemTargetingCustomizationFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Product { + private string nameField; + + private ProductStatus statusField; + + private bool statusFieldSpecified; + + private ProductType productTypeField; + + private bool productTypeFieldSpecified; + + private long productTemplateIdField; + + private bool productTemplateIdFieldSpecified; + + private string idField; + + private string notesField; + + private string productTemplateDescriptionField; + + private DateTime lastModifiedDateTimeField; + + private RateType rateTypeField; + + private bool rateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int priorityField; + + private bool priorityFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private bool allowFrequencyCapsCustomizationField; + + private bool allowFrequencyCapsCustomizationFieldSpecified; + + private ProductTemplateTargeting targetingField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ProductStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ProductType productType { + get { return this.productTypeField; } + set { + this.productTypeField = value; + this.productTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productTypeSpecified { + get { return this.productTypeFieldSpecified; } + set { this.productTypeFieldSpecified = value; } + } + + public long productTemplateId { + get { return this.productTemplateIdField; } + set { + this.productTemplateIdField = value; + this.productTemplateIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productTemplateIdSpecified { + get { return this.productTemplateIdFieldSpecified; } + set { this.productTemplateIdFieldSpecified = value; } + } + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public string productTemplateDescription { + get { return this.productTemplateDescriptionField; } + set { this.productTemplateDescriptionField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public RateType rateType { + get { return this.rateTypeField; } + set { + this.rateTypeField = value; + this.rateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateTypeSpecified { + get { return this.rateTypeFieldSpecified; } + set { this.rateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public bool allowFrequencyCapsCustomization { + get { return this.allowFrequencyCapsCustomizationField; } + set { + this.allowFrequencyCapsCustomizationField = value; + this.allowFrequencyCapsCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowFrequencyCapsCustomizationSpecified { + get { return this.allowFrequencyCapsCustomizationFieldSpecified; } + set { this.allowFrequencyCapsCustomizationFieldSpecified = value; } + } + + public ProductTemplateTargeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ProductStatus { + ACTIVE, + INACTIVE, + ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ProductType { + DFP, + OFFLINE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum RateType { + CPM, + CPC, + CPD, + CPU, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ProductPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Product[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Product[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ProductError : ApiError { + private ProductErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProductErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ProductErrorReason { + TEMPLATE_NOT_FOUND, + MALFORMED_PRODUCT_ID, + BAD_PRODUCT_ID_FEATURE, + BAD_PRODUCT_TEMPLATE_ID, + CANNOT_UPDATE_ARCHIVED_PRODUCT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ProductActionError : ApiError { + private ProductActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProductActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ProductActionErrorReason { + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class BaseRateError : ApiError { + private BaseRateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BaseRateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BaseRateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum BaseRateErrorReason { + CANNOT_QUERY_BOTH_PRODUCT_TEMPLATE_ID_AND_PRODUCT_ID, + INVALID_CURRENCY_CODE, + PRODUCT_TEMPLATE_ARCHIVED, + UNSUPPORTED_OPERATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "RateCardCustomizationGroupServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class RateCardCustomizationGroupService : DfpSoapClient, IRateCardCustomizationGroupService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public RateCardCustomizationGroupService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/RateCardCustomizationGroupServi" + "ce"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomizationGroup[] createRateCardCustomizationGroups([System.Xml.Serialization.XmlElementAttribute("rateCardCustomizationGroups")] +RateCardCustomizationGroup[] rateCardCustomizationGroups) { + object[] results = this.Invoke("createRateCardCustomizationGroups", new object[] { rateCardCustomizationGroups }); + return ((RateCardCustomizationGroup[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomizationGroupPage getRateCardCustomizationGroupsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getRateCardCustomizationGroupsByStatement", new object[] { filterStatement }); + return ((RateCardCustomizationGroupPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomizationGroup[] updateRateCardCustomizationGroups([System.Xml.Serialization.XmlElementAttribute("rateCardCustomizationGroups")] +RateCardCustomizationGroup[] rateCardCustomizationGroups) { + object[] results = this.Invoke("updateRateCardCustomizationGroups", new object[] { rateCardCustomizationGroups }); + return ((RateCardCustomizationGroup[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RateCardCustomizationGroupPage { + private RateCardCustomizationGroup[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public RateCardCustomizationGroup[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RateCardCustomizationGroup { + private long idField; + + private bool idFieldSpecified; + + private long rateCardIdField; + + private bool rateCardIdFieldSpecified; + + private PricingMethod pricingMethodField; + + private bool pricingMethodFieldSpecified; + + private RateCardFeature rateCardFeatureField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long rateCardId { + get { return this.rateCardIdField; } + set { + this.rateCardIdField = value; + this.rateCardIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardIdSpecified { + get { return this.rateCardIdFieldSpecified; } + set { this.rateCardIdFieldSpecified = value; } + } + + public PricingMethod pricingMethod { + get { return this.pricingMethodField; } + set { + this.pricingMethodField = value; + this.pricingMethodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool pricingMethodSpecified { + get { return this.pricingMethodFieldSpecified; } + set { this.pricingMethodFieldSpecified = value; } + } + + public RateCardFeature rateCardFeature { + get { return this.rateCardFeatureField; } + set { this.rateCardFeatureField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum PricingMethod { + SUM, + HIGHEST, + ANY_VALUE, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserDomainRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnknownRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystemRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GeographyRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FrequencyCapRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomTargetingRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BrowserLanguageRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BrowserRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BandwidthRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitRateCardFeature))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class RateCardFeature { + private string rateCardFeatureTypeField; + + [System.Xml.Serialization.XmlElementAttribute("RateCardFeature.Type")] + public string RateCardFeatureType { + get { return this.rateCardFeatureTypeField; } + set { this.rateCardFeatureTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class UserDomainRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class UnknownRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class PlacementRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class OperatingSystemRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class GeographyRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class FrequencyCapRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CustomTargetingRateCardFeature : RateCardFeature { + private long customTargetingKeyIdField; + + private bool customTargetingKeyIdFieldSpecified; + + private long customTargetingValueIdField; + + private bool customTargetingValueIdFieldSpecified; + + public long customTargetingKeyId { + get { return this.customTargetingKeyIdField; } + set { + this.customTargetingKeyIdField = value; + this.customTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customTargetingKeyIdSpecified { + get { return this.customTargetingKeyIdFieldSpecified; } + set { this.customTargetingKeyIdFieldSpecified = value; } + } + + public long customTargetingValueId { + get { return this.customTargetingValueIdField; } + set { + this.customTargetingValueIdField = value; + this.customTargetingValueIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customTargetingValueIdSpecified { + get { return this.customTargetingValueIdFieldSpecified; } + set { this.customTargetingValueIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class BrowserLanguageRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class BrowserRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class BandwidthRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdUnitRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RateCardCustomizationGroupError : ApiError { + private RateCardCustomizationGroupErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RateCardCustomizationGroupErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RateCardCustomizationGroupError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum RateCardCustomizationGroupErrorReason { + INVALID_PRICING_METHOD, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ActivityGroupServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ActivityGroupService : DfpSoapClient, IActivityGroupService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ActivityGroupService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/ActivityGroupService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroup[] createActivityGroups([System.Xml.Serialization.XmlElementAttribute("activityGroups")] +ActivityGroup[] activityGroups) { + object[] results = this.Invoke("createActivityGroups", new object[] { activityGroups }); + return ((ActivityGroup[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroupPage getActivityGroupsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getActivityGroupsByStatement", new object[] { filterStatement }); + return ((ActivityGroupPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroup[] updateActivityGroups([System.Xml.Serialization.XmlElementAttribute("activityGroups")] +ActivityGroup[] activityGroups) { + object[] results = this.Invoke("updateActivityGroups", new object[] { activityGroups }); + return ((ActivityGroup[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ActivityGroupPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ActivityGroup[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ActivityGroup[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ActivityGroup { + private int idField; + + private bool idFieldSpecified; + + private string nameField; + + private long[] companyIdsField; + + private int impressionsLookbackField; + + private bool impressionsLookbackFieldSpecified; + + private int clicksLookbackField; + + private bool clicksLookbackFieldSpecified; + + private ActivityGroupStatus statusField; + + private bool statusFieldSpecified; + + public int id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companyIds")] + public long[] companyIds { + get { return this.companyIdsField; } + set { this.companyIdsField = value; } + } + + public int impressionsLookback { + get { return this.impressionsLookbackField; } + set { + this.impressionsLookbackField = value; + this.impressionsLookbackSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsLookbackSpecified { + get { return this.impressionsLookbackFieldSpecified; } + set { this.impressionsLookbackFieldSpecified = value; } + } + + public int clicksLookback { + get { return this.clicksLookbackField; } + set { + this.clicksLookbackField = value; + this.clicksLookbackSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clicksLookbackSpecified { + get { return this.clicksLookbackFieldSpecified; } + set { this.clicksLookbackFieldSpecified = value; } + } + + public ActivityGroupStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ActivityGroup.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ActivityGroupStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ActivityError : ApiError { + private ActivityErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ActivityErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ActivityError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ActivityErrorReason { + ACTIVITIES_FEATURE_REQUIRED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LabelServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LabelService : DfpSoapClient, ILabelService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LabelService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/LabelService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Label[] createLabels([System.Xml.Serialization.XmlElementAttribute("labels")] +Label[] labels) { + object[] results = this.Invoke("createLabels", new object[] { labels }); + return ((Label[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LabelPage getLabelsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLabelsByStatement", new object[] { filterStatement }); + return ((LabelPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performLabelAction(LabelAction labelAction, Statement filterStatement) { + object[] results = this.Invoke("performLabelAction", new object[] { labelAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Label[] updateLabels([System.Xml.Serialization.XmlElementAttribute("labels")] +Label[] labels) { + object[] results = this.Invoke("updateLabels", new object[] { labels }); + return ((Label[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateLabels))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLabels))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class LabelAction { + private string labelActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LabelAction.Type")] + public string LabelActionType { + get { return this.labelActionTypeField; } + set { this.labelActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeactivateLabels : LabelAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ActivateLabels : LabelAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LabelPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Label[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Label[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Label { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private LabelType[] typesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("types")] + public LabelType[] types { + get { return this.typesField; } + set { this.typesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum LabelType { + COMPETITIVE_EXCLUSION, + AD_UNIT_FREQUENCY_CAP, + AD_EXCLUSION, + CREATIVE_WRAPPER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LabelError : ApiError { + private LabelErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LabelErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LabelError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum LabelErrorReason { + INVALID_PREFIX, + NAME_INVALID_CHARS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CreativeWrapperError : ApiError { + private CreativeWrapperErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeWrapperErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeWrapperError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CreativeWrapperErrorReason { + LABEL_ALREADY_ASSOCIATED_WITH_CREATIVE_WRAPPER, + INVALID_LABEL_TYPE, + UNRECOGNIZED_MACRO, + NEITHER_HEADER_NOR_FOOTER_SPECIFIED, + CANNOT_USE_CREATIVE_WRAPPER_TYPE, + CANNOT_UPDATE_LABEL_ID, + CANNOT_APPLY_TO_AD_UNIT_WITH_VIDEO_SIZES, + CANNOT_APPLY_TO_MOBILE_AD_UNIT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LineItemCreativeAssociationServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LineItemCreativeAssociationService : DfpSoapClient, ILineItemCreativeAssociationService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LineItemCreativeAssociationService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/LineItemCreativeAssociationServ" + "ice"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociation[] createLineItemCreativeAssociations([System.Xml.Serialization.XmlElementAttribute("lineItemCreativeAssociations")] +LineItemCreativeAssociation[] lineItemCreativeAssociations) { + object[] results = this.Invoke("createLineItemCreativeAssociations", new object[] { lineItemCreativeAssociations }); + return ((LineItemCreativeAssociation[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociationPage getLineItemCreativeAssociationsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLineItemCreativeAssociationsByStatement", new object[] { filterStatement }); + return ((LineItemCreativeAssociationPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual string getPreviewUrl(long lineItemId, long creativeId, string siteUrl) { + object[] results = this.Invoke("getPreviewUrl", new object[] { lineItemId, creativeId, siteUrl }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performLineItemCreativeAssociationAction(LineItemCreativeAssociationAction lineItemCreativeAssociationAction, Statement filterStatement) { + object[] results = this.Invoke("performLineItemCreativeAssociationAction", new object[] { lineItemCreativeAssociationAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociation[] updateLineItemCreativeAssociations([System.Xml.Serialization.XmlElementAttribute("lineItemCreativeAssociations")] +LineItemCreativeAssociation[] lineItemCreativeAssociations) { + object[] results = this.Invoke("updateLineItemCreativeAssociations", new object[] { lineItemCreativeAssociations }); + return ((LineItemCreativeAssociation[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateLineItemCreativeAssociations))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLineItemCreativeAssociations))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class LineItemCreativeAssociationAction { + private string lineItemCreativeAssociationActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LineItemCreativeAssociationAction.Type")] + public string LineItemCreativeAssociationActionType { + get { return this.lineItemCreativeAssociationActionTypeField; } + set { this.lineItemCreativeAssociationActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeactivateLineItemCreativeAssociations : LineItemCreativeAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ActivateLineItemCreativeAssociations : LineItemCreativeAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LineItemCreativeAssociationPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LineItemCreativeAssociation[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LineItemCreativeAssociation[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LineItemCreativeAssociation { + private long lineItemIdField; + + private bool lineItemIdFieldSpecified; + + private long creativeIdField; + + private bool creativeIdFieldSpecified; + + private long creativeSetIdField; + + private bool creativeSetIdFieldSpecified; + + private double manualCreativeRotationWeightField; + + private bool manualCreativeRotationWeightFieldSpecified; + + private int sequentialCreativeRotationIndexField; + + private bool sequentialCreativeRotationIndexFieldSpecified; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private string destinationUrlField; + + private Size[] sizesField; + + private LineItemCreativeAssociationStatus statusField; + + private bool statusFieldSpecified; + + private LineItemCreativeAssociationStats statsField; + + private DateTime lastModifiedDateTimeField; + + public long lineItemId { + get { return this.lineItemIdField; } + set { + this.lineItemIdField = value; + this.lineItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemIdSpecified { + get { return this.lineItemIdFieldSpecified; } + set { this.lineItemIdFieldSpecified = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { + this.creativeIdField = value; + this.creativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeIdSpecified { + get { return this.creativeIdFieldSpecified; } + set { this.creativeIdFieldSpecified = value; } + } + + public long creativeSetId { + get { return this.creativeSetIdField; } + set { + this.creativeSetIdField = value; + this.creativeSetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeSetIdSpecified { + get { return this.creativeSetIdFieldSpecified; } + set { this.creativeSetIdFieldSpecified = value; } + } + + public double manualCreativeRotationWeight { + get { return this.manualCreativeRotationWeightField; } + set { + this.manualCreativeRotationWeightField = value; + this.manualCreativeRotationWeightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manualCreativeRotationWeightSpecified { + get { return this.manualCreativeRotationWeightFieldSpecified; } + set { this.manualCreativeRotationWeightFieldSpecified = value; } + } + + public int sequentialCreativeRotationIndex { + get { return this.sequentialCreativeRotationIndexField; } + set { + this.sequentialCreativeRotationIndexField = value; + this.sequentialCreativeRotationIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sequentialCreativeRotationIndexSpecified { + get { return this.sequentialCreativeRotationIndexFieldSpecified; } + set { this.sequentialCreativeRotationIndexFieldSpecified = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("sizes")] + public Size[] sizes { + get { return this.sizesField; } + set { this.sizesField = value; } + } + + public LineItemCreativeAssociationStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public LineItemCreativeAssociationStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociation.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum LineItemCreativeAssociationStatus { + ACTIVE, + NOT_SERVING, + INACTIVE, + DELETED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LineItemCreativeAssociationStats { + private Stats statsField; + + private Long_StatsMapEntry[] creativeSetStatsField; + + private Money costInOrderCurrencyField; + + public Stats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativeSetStats")] + public Long_StatsMapEntry[] creativeSetStats { + get { return this.creativeSetStatsField; } + set { this.creativeSetStatsField = value; } + } + + public Money costInOrderCurrency { + get { return this.costInOrderCurrencyField; } + set { this.costInOrderCurrencyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Long_StatsMapEntry { + private long keyField; + + private bool keyFieldSpecified; + + private Stats valueField; + + public long key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public Stats value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class TemplateInstantiatedCreativeError : ApiError { + private TemplateInstantiatedCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TemplateInstantiatedCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TemplateInstantiatedCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum TemplateInstantiatedCreativeErrorReason { + INACTIVE_CREATIVE_TEMPLATE, + FILE_TYPE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class SwiffyConversionError : ApiError { + private SwiffyConversionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SwiffyConversionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SwiffyConversionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum SwiffyConversionErrorReason { + SERVER_ERROR, + INVALID_FLASH_FILE, + UNSUPPORTED_FLASH, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RichMediaStudioCreativeError : ApiError { + private RichMediaStudioCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RichMediaStudioCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaStudioCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum RichMediaStudioCreativeErrorReason { + CREATION_NOT_ALLOWED, + UKNOWN_ERROR, + INVALID_CODE_GENERATION_REQUEST, + INVALID_CREATIVE_OBJECT, + STUDIO_CONNECTION_ERROR, + PUSHDOWN_DURATION_NOT_ALLOWED, + INVALID_POSITION, + INVALID_Z_INDEX, + INVALID_PUSHDOWN_DURATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LineItemCreativeAssociationOperationError : ApiError { + private LineItemCreativeAssociationOperationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemCreativeAssociationOperationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociationOperationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum LineItemCreativeAssociationOperationErrorReason { + NOT_ALLOWED, + NOT_APPLICABLE, + CANNOT_ACTIVATE_INVALID_CREATIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class InvalidPhoneNumberError : ApiError { + private InvalidPhoneNumberErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidPhoneNumberErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidPhoneNumberError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum InvalidPhoneNumberErrorReason { + INVALID_FORMAT, + TOO_SHORT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ImageError : ApiError { + private ImageErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ImageErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ImageError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ImageErrorReason { + INVALID_IMAGE, + INVALID_SIZE, + UNEXPECTED_SIZE, + OVERLAY_SIZE_TOO_LARGE, + ANIMATED_NOT_ALLOWED, + ANIMATION_TOO_LONG, + CMYK_JPEG_NOT_ALLOWED, + FLASH_NOT_ALLOWED, + FLASH_WITHOUT_CLICKTAG, + ANIMATED_VISUAL_EFFECT, + FLASH_ERROR, + LAYOUT_PROBLEM, + FLASH_HAS_NETWORK_OBJECTS, + FLASH_HAS_NETWORK_METHODS, + FLASH_HAS_URL, + FLASH_HAS_MOUSE_TRACKING, + FLASH_HAS_RANDOM_NUM, + FLASH_SELF_TARGETS, + FLASH_BAD_GETURL_TARGET, + FLASH_VERSION_NOT_SUPPORTED, + FILE_TOO_LARGE, + SYSTEM_ERROR, + UNEXPECTED_PRIMARY_ASSET_DENSITY, + DUPLICATE_ASSET_DENSITY, + MISSING_DEFAULT_ASSET, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class FileError : ApiError { + private FileErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FileErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FileError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum FileErrorReason { + MISSING_CONTENTS, + SIZE_TOO_LARGE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CustomCreativeError : ApiError { + private CustomCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CustomCreativeErrorReason { + DUPLICATE_MACRO_NAME_FOR_CREATIVE, + SNIPPET_REFERENCES_MISSING_MACRO, + UNRECOGNIZED_MACRO, + CUSTOM_CREATIVE_NOT_ALLOWED, + MISSING_INTERSTITIAL_MACRO, + DUPLICATE_ASSET_IN_MACROS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CreativeSetError : ApiError { + private CreativeSetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeSetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeSetError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CreativeSetErrorReason { + VIDEO_FEATURE_REQUIRED, + CANNOT_CREATE_OR_UPDATE_VIDEO_CREATIVES, + ROADBLOCK_FEATURE_REQUIRED, + MASTER_CREATIVE_CANNOT_BE_COMPANION, + INVALID_ADVERTISER, + UPDATE_MASTER_CREATIVE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CreativeAssetMacroError : ApiError { + private CreativeAssetMacroErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeAssetMacroErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeAssetMacroError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CreativeAssetMacroErrorReason { + INVALID_MACRO_NAME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AssetError : ApiError { + private AssetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AssetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AssetError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AssetErrorReason { + NON_UNIQUE_NAME, + FILE_NAME_TOO_LONG, + FILE_SIZE_TOO_LARGE, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_CLIENT, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_HEIGHT, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_WIDTH, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_FORMAT, + INVALID_CODE_SNIPPET_PARAMETER_VALUE, + INVALID_ASSET_ID, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdSenseAccountError : ApiError { + private AdSenseAccountErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdSenseAccountErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseAccountError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AdSenseAccountErrorReason { + ASSOCIATE_ACCOUNT_API_ERROR, + GET_AD_SLOT_API_ERROR, + GET_CHANNEL_API_ERROR, + GET_BULK_ACCOUNT_STATUSES_API_ERROR, + RESEND_VERIFICATION_EMAIL_ERROR, + UNEXPECTED_API_RESPONSE_ERROR, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReportServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReportService : DfpSoapClient, IReportService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReportService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/ReportService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual string getReportDownloadURL(long reportJobId, ExportFormat exportFormat) { + object[] results = this.Invoke("getReportDownloadURL", new object[] { reportJobId, exportFormat }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual string getReportDownloadUrlWithOptions(long reportJobId, ReportDownloadOptions reportDownloadOptions) { + object[] results = this.Invoke("getReportDownloadUrlWithOptions", new object[] { reportJobId, reportDownloadOptions }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReportJob getReportJob(long reportJobId) { + object[] results = this.Invoke("getReportJob", new object[] { reportJobId }); + return ((ReportJob) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReportJob runReportJob(ReportJob reportJob) { + object[] results = this.Invoke("runReportJob", new object[] { reportJob }); + return ((ReportJob) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ReportQuery { + private Dimension[] dimensionsField; + + private ReportQueryAdUnitView adUnitViewField; + + private bool adUnitViewFieldSpecified; + + private Column[] columnsField; + + private DimensionAttribute[] dimensionAttributesField; + + private long[] customFieldIdsField; + + private long[] contentMetadataKeyHierarchyCustomTargetingKeyIdsField; + + private Date startDateField; + + private Date endDateField; + + private DateRangeType dateRangeTypeField; + + private bool dateRangeTypeFieldSpecified; + + private DimensionFilter[] dimensionFiltersField; + + private Statement statementField; + + private string timeZoneField; + + [System.Xml.Serialization.XmlElementAttribute("dimensions")] + public Dimension[] dimensions { + get { return this.dimensionsField; } + set { this.dimensionsField = value; } + } + + public ReportQueryAdUnitView adUnitView { + get { return this.adUnitViewField; } + set { + this.adUnitViewField = value; + this.adUnitViewSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adUnitViewSpecified { + get { return this.adUnitViewFieldSpecified; } + set { this.adUnitViewFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("columns")] + public Column[] columns { + get { return this.columnsField; } + set { this.columnsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("dimensionAttributes")] + public DimensionAttribute[] dimensionAttributes { + get { return this.dimensionAttributesField; } + set { this.dimensionAttributesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldIds")] + public long[] customFieldIds { + get { return this.customFieldIdsField; } + set { this.customFieldIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("contentMetadataKeyHierarchyCustomTargetingKeyIds")] + public long[] contentMetadataKeyHierarchyCustomTargetingKeyIds { + get { return this.contentMetadataKeyHierarchyCustomTargetingKeyIdsField; } + set { this.contentMetadataKeyHierarchyCustomTargetingKeyIdsField = value; } + } + + public Date startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public Date endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + public DateRangeType dateRangeType { + get { return this.dateRangeTypeField; } + set { + this.dateRangeTypeField = value; + this.dateRangeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dateRangeTypeSpecified { + get { return this.dateRangeTypeFieldSpecified; } + set { this.dateRangeTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("dimensionFilters")] + public DimensionFilter[] dimensionFilters { + get { return this.dimensionFiltersField; } + set { this.dimensionFiltersField = value; } + } + + public Statement statement { + get { return this.statementField; } + set { this.statementField = value; } + } + + public string timeZone { + get { return this.timeZoneField; } + set { this.timeZoneField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum Dimension { + MONTH, + MONTH_AND_YEAR, + WEEK, + DATE, + DAY, + HOUR, + LINE_ITEM_ID, + LINE_ITEM_NAME, + LINE_ITEM_TYPE, + ORDER_ID, + ORDER_NAME, + ADVERTISER_ID, + ADVERTISER_NAME, + SALESPERSON_ID, + SALESPERSON_NAME, + CREATIVE_ID, + CREATIVE_NAME, + CREATIVE_TYPE, + CUSTOM_EVENT_ID, + CUSTOM_EVENT_NAME, + CUSTOM_EVENT_TYPE, + CREATIVE_SIZE, + AD_UNIT_ID, + AD_UNIT_NAME, + AD_UNIT_ANCESTOR_AD_UNIT_ID, + AD_UNIT_ANCESTOR_AD_UNIT_NAME, + PLACEMENT_ID, + PLACEMENT_NAME, + GENERIC_CRITERION_NAME, + DEVICE_CATEGORY_ID, + DEVICE_CATEGORY_NAME, + COUNTRY_CRITERIA_ID, + COUNTRY_NAME, + REGION_CRITERIA_ID, + REGION_NAME, + CITY_CRITERIA_ID, + CITY_NAME, + METRO_CRITERIA_ID, + METRO_NAME, + POSTAL_CODE_CRITERIA_ID, + POSTAL_CODE, + CUSTOM_TARGETING_VALUE_ID, + CUSTOM_CRITERIA, + ACTIVITY_ID, + ACTIVITY_NAME, + ACTIVITY_GROUP_ID, + ACTIVITY_GROUP_NAME, + CONTENT_ID, + CONTENT_NAME, + CONTENT_BUNDLE_ID, + CONTENT_BUNDLE_NAME, + CONTENT_HIERARCHY, + VIDEO_FALLBACK_POSITION, + POSITION_OF_POD, + POSITION_IN_POD, + AD_REQUEST_AD_UNIT_SIZES, + AD_REQUEST_CUSTOM_CRITERIA, + MASTER_COMPANION_CREATIVE_ID, + MASTER_COMPANION_CREATIVE_NAME, + DISTRIBUTION_PARTNER_ID, + DISTRIBUTION_PARTNER_NAME, + CONTENT_PARTNER_ID, + CONTENT_PARTNER_NAME, + RIGHTS_HOLDER_ID, + RIGHTS_HOLDER_NAME, + PROPOSAL_LINE_ITEM_ID, + PROPOSAL_LINE_ITEM_NAME, + PROPOSAL_ID, + PROPOSAL_NAME, + ALL_SALESPEOPLE_ID, + ALL_SALESPEOPLE_NAME, + PROPOSAL_AGENCY_ID, + PROPOSAL_AGENCY_NAME, + PRODUCT_ID, + PRODUCT_NAME, + PRODUCT_TEMPLATE_ID, + PRODUCT_TEMPLATE_NAME, + AUDIENCE_SEGMENT_ID, + AUDIENCE_SEGMENT_NAME, + AUDIENCE_SEGMENT_DATA_PROVIDER_NAME + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportQuery.AdUnitView", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ReportQueryAdUnitView { + TOP_LEVEL, + FLAT, + HIERARCHICAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum Column { + AD_SERVER_IMPRESSIONS, + AD_SERVER_TARGETED_IMPRESSIONS, + AD_SERVER_CLICKS, + AD_SERVER_TARGETED_CLICKS, + AD_SERVER_CTR, + AD_SERVER_CPM_AND_CPC_REVENUE, + AD_SERVER_CPD_REVENUE, + AD_SERVER_CPA_REVENUE, + AD_SERVER_ALL_REVENUE, + AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM, + AD_SERVER_WITH_CPD_AVERAGE_ECPM, + AD_SERVER_INVENTORY_LEVEL_PERCENT_IMPRESSIONS, + AD_SERVER_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + AD_SERVER_INVENTORY_LEVEL_PERCENT_CLICKS, + AD_SERVER_LINE_ITEM_LEVEL_PERCENT_CLICKS, + AD_SERVER_INVENTORY_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + AD_SERVER_INVENTORY_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_SERVER_LINE_ITEM_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + AD_SERVER_LINE_ITEM_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_SERVER_DELIVERY_INDICATOR, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + ADSENSE_LINE_ITEM_LEVEL_IMPRESSIONS, + ADSENSE_LINE_ITEM_LEVEL_TARGETED_IMPRESSIONS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + ADSENSE_LINE_ITEM_LEVEL_CLICKS, + ADSENSE_LINE_ITEM_LEVEL_TARGETED_CLICKS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CTR, + ADSENSE_LINE_ITEM_LEVEL_CTR, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_REVENUE, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_AVERAGE_ECPM, + ADSENSE_LINE_ITEM_LEVEL_AVERAGE_ECPM, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_PERCENT_IMPRESSIONS, + ADSENSE_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_PERCENT_CLICKS, + ADSENSE_LINE_ITEM_LEVEL_PERCENT_CLICKS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_WITH_CPD_PERCENT_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_IMPRESSIONS, + AD_EXCHANGE_LINE_ITEM_LEVEL_TARGETED_IMPRESSIONS, + AD_EXCHANGE_LINE_ITEM_LEVEL_CLICKS, + AD_EXCHANGE_LINE_ITEM_LEVEL_TARGETED_CLICKS, + AD_EXCHANGE_LINE_ITEM_LEVEL_CTR, + AD_EXCHANGE_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + AD_EXCHANGE_LINE_ITEM_LEVEL_PERCENT_CLICKS, + AD_EXCHANGE_LINE_ITEM_LEVEL_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_AVERAGE_ECPM, + TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + TOTAL_LINE_ITEM_LEVEL_IMPRESSIONS, + TOTAL_LINE_ITEM_LEVEL_TARGETED_IMPRESSIONS, + TOTAL_INVENTORY_LEVEL_CLICKS, + TOTAL_LINE_ITEM_LEVEL_CLICKS, + TOTAL_LINE_ITEM_LEVEL_TARGETED_CLICKS, + TOTAL_INVENTORY_LEVEL_CTR, + TOTAL_LINE_ITEM_LEVEL_CTR, + TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE, + TOTAL_INVENTORY_LEVEL_ALL_REVENUE, + TOTAL_LINE_ITEM_LEVEL_CPM_AND_CPC_REVENUE, + TOTAL_LINE_ITEM_LEVEL_ALL_REVENUE, + TOTAL_INVENTORY_LEVEL_WITHOUT_CPD_AVERAGE_ECPM, + TOTAL_INVENTORY_LEVEL_WITH_CPD_AVERAGE_ECPM, + TOTAL_LINE_ITEM_LEVEL_WITHOUT_CPD_AVERAGE_ECPM, + TOTAL_LINE_ITEM_LEVEL_WITH_CPD_AVERAGE_ECPM, + TOTAL_INVENTORY_LEVEL_UNFILLED_IMPRESSIONS, + MERGED_AD_SERVER_DELIVERY_INDICATOR, + MERGED_AD_SERVER_IMPRESSIONS, + MERGED_AD_SERVER_CLICKS, + MERGED_AD_SERVER_CTR, + MERGED_AD_SERVER_CPM_AND_CPC_REVENUE, + MERGED_AD_SERVER_ALL_REVENUE, + MERGED_AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM, + MERGED_AD_SERVER_WITH_CPD_AVERAGE_ECPM, + OPTIMIZATION_CONTROL_IMPRESSIONS, + OPTIMIZATION_CONTROL_CLICKS, + OPTIMIZATION_CONTROL_CTR, + OPTIMIZATION_OPTIMIZED_IMPRESSIONS, + OPTIMIZATION_OPTIMIZED_CLICKS, + OPTIMIZATION_NON_OPTIMIZED_IMPRESSIONS, + OPTIMIZATION_NON_OPTIMIZED_CLICKS, + OPTIMIZATION_EXTRA_CLICKS, + OPTIMIZATION_OPTIMIZED_CTR, + OPTIMIZATION_LIFT, + OPTIMIZATION_COVERAGE, + OPTIMIZATION_BEHIND_SCHEDULE_IMPRESSIONS, + OPTIMIZATION_NO_CLICKS_RECORDED_IMPRESSIONS, + OPTIMIZATION_SPONSORSHIP_IMPRESSIONS, + OPTIMIZATION_AS_FAST_AS_POSSIBLE_IMPRESSIONS, + OPTIMIZATION_NO_ABSOLUTE_LIFETIME_GOAL_IMPRESSIONS, + OPTIMIZATION_CONTROL_REVENUE, + OPTIMIZATION_OPTIMIZED_REVENUE, + OPTIMIZATION_CONTROL_ECPM, + OPTIMIZATION_OPTIMIZED_ECPM, + OPTIMIZATION_FREED_UP_IMPRESSIONS, + OPTIMIZATION_ECPM_LIFT, + REACH_FREQUENCY, + REACH_AVERAGE_REVENUE, + REACH, + SELL_THROUGH_FORECASTED_IMPRESSIONS, + SELL_THROUGH_AVAILABLE_IMPRESSIONS, + SELL_THROUGH_RESERVED_IMPRESSIONS, + SELL_THROUGH_SELL_THROUGH_RATE, + RICH_MEDIA_BACKUP_IMAGES, + RICH_MEDIA_DISPLAY_TIME, + RICH_MEDIA_AVERAGE_DISPLAY_TIME, + RICH_MEDIA_EXPANSIONS, + RICH_MEDIA_EXPANDING_TIME, + RICH_MEDIA_INTERACTION_TIME, + RICH_MEDIA_INTERACTION_COUNT, + RICH_MEDIA_INTERACTION_RATE, + RICH_MEDIA_AVERAGE_INTERACTION_TIME, + RICH_MEDIA_INTERACTION_IMPRESSIONS, + RICH_MEDIA_MANUAL_CLOSES, + RICH_MEDIA_FULL_SCREEN_IMPRESSIONS, + RICH_MEDIA_VIDEO_INTERACTIONS, + RICH_MEDIA_VIDEO_INTERACTION_RATE, + RICH_MEDIA_VIDEO_MUTES, + RICH_MEDIA_VIDEO_PAUSES, + RICH_MEDIA_VIDEO_PLAYES, + RICH_MEDIA_VIDEO_MIDPOINTS, + RICH_MEDIA_VIDEO_COMPLETES, + RICH_MEDIA_VIDEO_REPLAYS, + RICH_MEDIA_VIDEO_STOPS, + RICH_MEDIA_VIDEO_UNMUTES, + RICH_MEDIA_VIDEO_VIEW_TIME, + RICH_MEDIA_VIDEO_VIEW_RATE, + RICH_MEDIA_CUSTOM_EVENT_TIME, + RICH_MEDIA_CUSTOM_EVENT_COUNT, + VIDEO_INTERACTION_START, + VIDEO_INTERACTION_FIRST_QUARTILE, + VIDEO_INTERACTION_MIDPOINT, + VIDEO_INTERACTION_THIRD_QUARTILE, + VIDEO_INTERACTION_COMPLETE, + VIDEO_INTERACTION_VIEW_RATE, + VIDEO_INTERACTION_AVERAGE_VIEW_RATE, + VIDEO_INTERACTION_COMPLETION_RATE, + VIDEO_INTERACTION_ERROR_COUNT, + VIDEO_VIEWERSHIP_TOTAL_ERROR_RATE, + VIDEO_ERRORS_VAST_2_ERROR_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_100_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_101_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_102_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_200_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_201_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_202_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_203_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_300_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_301_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_302_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_303_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_400_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_401_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_402_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_403_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_405_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_500_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_501_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_502_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_503_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_600_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_601_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_602_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_603_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_604_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_900_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_901_COUNT, + VIDEO_INTERACTION_VIDEO_LENGTH, + VIDEO_INTERACTION_PAUSE, + VIDEO_INTERACTION_RESUME, + VIDEO_INTERACTION_REWIND, + VIDEO_INTERACTION_MUTE, + VIDEO_INTERACTION_UNMUTE, + VIDEO_INTERACTION_COLLAPSE, + VIDEO_INTERACTION_EXPAND, + VIDEO_INTERACTION_FULL_SCREEN, + VIDEO_INTERACTION_AVERAGE_INTERACTION_RATE, + VIDEO_INTERACTION_VIDEO_SKIPS, + VIDEO_INTERACTION_VIDEO_SKIP_SHOWN, + VIDEO_INTERACTION_ENGAGED_VIEW, + VIDEO_INTERACTION_VIEW_THROUGH_RATE, + ACTIVE_VIEW_VIEWABLE_IMPRESSIONS, + ACTIVE_VIEW_NOT_VIEWABLE_IMPRESSIONS, + ACTIVE_VIEW_NOT_MEASURABLE_IMPRESSIONS, + ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE, + ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS, + ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE, + DISTRIBUTION_PARTNER_IMPRESSIONS, + DISTRIBUTION_PARTNER_CLICKS, + DISTRIBUTION_PARTNER_CTR, + DISTRIBUTION_PARTNER_GROSS_REVENUE, + DISTRIBUTION_PARTNER_HOST_REVENUE, + DISTRIBUTION_PARTNER_HOST_ECPM, + DISTRIBUTION_PARTNER_PARTNER_REVENUE, + DISTRIBUTION_PARTNER_PARTNER_ECPM, + CONTENT_PARTNER_IMPRESSIONS, + CONTENT_PARTNER_CLICKS, + CONTENT_PARTNER_CTR, + CONTENT_PARTNER_GROSS_REVENUE, + CONTENT_PARTNER_HOST_REVENUE, + CONTENT_PARTNER_HOST_ECPM, + CONTENT_PARTNER_PARTNER_REVENUE, + CONTENT_PARTNER_PARTNER_ECPM, + RIGHTS_HOLDER_IMPRESSIONS, + RIGHTS_HOLDER_CLICKS, + RIGHTS_HOLDER_CTR, + RIGHTS_HOLDER_GROSS_REVENUE, + RIGHTS_HOLDER_HOST_REVENUE, + RIGHTS_HOLDER_HOST_ECPM, + RIGHTS_HOLDER_PARTNER_REVENUE, + RIGHTS_HOLDER_PARTNER_ECPM, + VIEW_THROUGH_CONVERSIONS, + CONVERSIONS_PER_THOUSAND_IMPRESSIONS, + CLICK_THROUGH_CONVERSIONS, + CONVERSIONS_PER_CLICK, + VIEW_THROUGH_REVENUE, + CLICK_THROUGH_REVENUE, + TOTAL_CONVERSIONS, + TOTAL_CONVERSION_REVENUE, + CONTRACTED_REVENUE_CONTRACTED_NET_REVENUE, + CONTRACTED_REVENUE_LOCAL_CONTRACTED_NET_REVENUE, + CONTRACTED_REVENUE_CONTRACTED_GROSS_REVENUE, + CONTRACTED_REVENUE_LOCAL_CONTRACTED_GROSS_REVENUE, + CONTRACTED_REVENUE_CONTRACTED_PLACEMENT_NET_REVENUE, + CONTRACTED_REVENUE_CONTRACTED_PLACEMENT_GROSS_REVENUE, + CONTRACTED_REVENUE_CONTRACTED_VAT, + CONTRACTED_REVENUE_LOCAL_CONTRACTED_VAT, + CONTRACTED_REVENUE_CONTRACTED_AGENCY_COMMISSION, + CONTRACTED_REVENUE_LOCAL_CONTRACTED_AGENCY_COMMISSION, + SALES_CONTRACT_CONTRACTED_IMPRESSIONS, + SALES_CONTRACT_CONTRACTED_CLICKS, + SALES_CONTRACT_CONTRACTED_VOLUME, + SALES_CONTRACT_BUDGET, + SALES_CONTRACT_REMAINING_BUDGET, + SALES_CONTRACT_BUFFERED_IMPRESSIONS, + SALES_CONTRACT_BUFFERED_CLICKS, + UNIFIED_REVENUE_UNIFIED_NET_REVENUE, + UNIFIED_REVENUE_LOCAL_UNIFIED_NET_REVENUE, + UNIFIED_REVENUE_UNIFIED_GROSS_REVENUE, + UNIFIED_REVENUE_LOCAL_UNIFIED_GROSS_REVENUE, + UNIFIED_REVENUE_UNIFIED_AGENCY_COMMISSION, + UNIFIED_REVENUE_LOCAL_UNIFIED_AGENCY_COMMISSION, + SALES_PIPELINE_PIPELINE_NET_REVENUE, + SALES_PIPELINE_LOCAL_PIPELINE_NET_REVENUE, + SALES_PIPELINE_PIPELINE_GROSS_REVENUE, + SALES_PIPELINE_LOCAL_PIPELINE_GROSS_REVENUE, + SALES_PIPELINE_PIPELINE_AGENCY_COMMISSION, + SALES_PIPELINE_LOCAL_PIPELINE_AGENCY_COMMISSION, + RECONCILIATION_LAST_DATE_TIME, + RECONCILIATION_RECONCILIATION_STATUS, + RECONCILIATION_DFP_VOLUME, + RECONCILIATION_THIRD_PARTY_VOLUME, + RECONCILIATION_RECONCILED_VOLUME, + RECONCILIATION_DISCREPANCY, + RECONCILIATION_RECONCILED_REVENUE, + BILLING_BILLABLE_NET_REVENUE, + BILLING_LOCAL_BILLABLE_NET_REVENUE, + BILLING_BILLABLE_GROSS_REVENUE, + BILLING_LOCAL_BILLABLE_GROSS_REVENUE, + BILLING_BILLABLE_VAT, + BILLING_LOCAL_BILLABLE_VAT, + BILLING_BILLABLE_AGENCY_COMMISSION, + BILLING_LOCAL_BILLABLE_AGENCY_COMMISSION, + BILLING_CAP_QUANTITY, + BILLING_BILLABLE_VOLUME, + BILLING_DELIVERY_ROLLOVER_FROM_PREVIOUS, + DISCOUNTS_BREAKDOWN_ADDITIONAL_ADJUSTMENT, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_OVERALL_DISCOUNT, + DISCOUNTS_BREAKDOWN_BILLABLE_NET_OVERALL_DISCOUNT, + DISCOUNTS_BREAKDOWN_BILLABLE_NET_EXCLUDED_PREMIUMS, + DISCOUNTS_BREAKDOWN_BILLABLE_NET_ADVERTISER_DISCOUNT, + DISCOUNTS_BREAKDOWN_BILLABLE_NET_PRODUCT_ADJUSTMENT, + DISCOUNTS_BREAKDOWN_BILLABLE_NET_PROPOSAL_DISCOUNT, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_EXCLUDED_PREMIUMS, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_ADVERTISER_DISCOUNT, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_PRODUCT_ADJUSTMENT, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_PROPOSAL_DISCOUNT, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_NON_BILLABLE, + SALESPERSON_PERFORMANCE_SHARED_PIPELINE_NET_REVENUE, + SALESPERSON_PERFORMANCE_SHARED_PIPELINE_GROSS_REVENUE, + SALESPERSON_PERFORMANCE_SHARED_UNIFIED_NET_REVENUE, + SALESPERSON_PERFORMANCE_SHARED_UNIFIED_GROSS_REVENUE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum DimensionAttribute { + LINE_ITEM_LABELS, + LINE_ITEM_LABEL_IDS, + LINE_ITEM_OPTIMIZABLE, + LINE_ITEM_DELIVERY_PACING, + LINE_ITEM_FREQUENCY_CAP, + LINE_ITEM_RECONCILED_RATE, + ADVERTISER_EXTERNAL_ID, + ORDER_START_DATE_TIME, + ORDER_END_DATE_TIME, + ORDER_EXTERNAL_ID, + ORDER_PO_NUMBER, + ORDER_AGENCY, + ORDER_AGENCY_ID, + ORDER_LABELS, + ORDER_LABEL_IDS, + ORDER_TRAFFICKER, + ORDER_TRAFFICKER_ID, + ORDER_SECONDARY_TRAFFICKERS, + ORDER_SALESPERSON, + ORDER_SECONDARY_SALESPEOPLE, + ORDER_LIFETIME_IMPRESSIONS, + ORDER_LIFETIME_CLICKS, + ORDER_LIFETIME_MERGED_IMPRESSIONS, + ORDER_LIFETIME_MERGED_CLICKS, + ORDER_BOOKED_CPM, + ORDER_BOOKED_CPC, + LINE_ITEM_START_DATE_TIME, + LINE_ITEM_END_DATE_TIME, + LINE_ITEM_EXTERNAL_ID, + LINE_ITEM_COST_TYPE, + LINE_ITEM_COST_PER_UNIT, + LINE_ITEM_CURRENCY_CODE, + LINE_ITEM_GOAL_QUANTITY, + LINE_ITEM_SPONSORSHIP_GOAL_PERCENTAGE, + LINE_ITEM_LIFETIME_IMPRESSIONS, + LINE_ITEM_LIFETIME_CLICKS, + LINE_ITEM_LIFETIME_MERGED_IMPRESSIONS, + LINE_ITEM_LIFETIME_MERGED_CLICKS, + LINE_ITEM_PRIORITY, + CREATIVE_OR_CREATIVE_SET, + MASTER_COMPANION_TYPE, + LINE_ITEM_CONTRACTED_QUANTITY, + LINE_ITEM_DISCOUNT, + LINE_ITEM_NON_CPD_BOOKED_REVENUE, + ADVERTISER_LABELS, + ADVERTISER_LABEL_IDS, + CREATIVE_CLICK_THROUGH_URL, + CREATIVE_SSL_SCAN_RESULT, + CREATIVE_SSL_COMPLIANCE_OVERRIDE, + LINE_ITEM_CREATIVE_START_DATE, + LINE_ITEM_CREATIVE_END_DATE, + PROPOSAL_START_DATE_TIME, + PROPOSAL_END_DATE_TIME, + PROPOSAL_CREATION_DATE_TIME, + PROPOSAL_PROBABILITY_TO_CLOSE, + PROPOSAL_STATUS, + PROPOSAL_CURRENCY, + PROPOSAL_EXCHANGE_RATE, + PROPOSAL_AGENCY_COMMISSION_RATE, + PROPOSAL_VAT_RATE, + PROPOSAL_DISCOUNT, + PROPOSAL_ADVERTISER_DISCOUNT, + PROPOSAL_ADVERTISER, + PROPOSAL_ADVERTISER_ID, + PROPOSAL_AGENCIES, + PROPOSAL_AGENCY_IDS, + PROPOSAL_PO_NUMBER, + PROPOSAL_PRIMARY_SALESPERSON, + PROPOSAL_SECONDARY_SALESPEOPLE, + PROPOSAL_PRICING_MODEL, + PROPOSAL_BILLING_SOURCE, + PROPOSAL_BILLING_CAP, + PROPOSAL_BILLING_SCHEDULE, + PROPOSAL_LINE_ITEM_START_DATE_TIME, + PROPOSAL_LINE_ITEM_END_DATE_TIME, + PROPOSAL_LINE_ITEM_RATE_TYPE, + PROPOSAL_LINE_ITEM_COST_PER_UNIT, + PROPOSAL_LINE_ITEM_LOCAL_COST_PER_UNIT, + PROPOSAL_LINE_ITEM_COST_PER_UNIT_GROSS, + PROPOSAL_LINE_ITEM_LOCAL_COST_PER_UNIT_GROSS, + PROPOSAL_LINE_ITEM_TYPE_AND_PRIORITY, + PROPOSAL_LINE_ITEM_SIZE, + PROPOSAL_LINE_ITEM_PRODUCT_ADJUSTMENT, + PROPOSAL_LINE_ITEM_BUFFER, + PROPOSAL_LINE_ITEM_TARGET_RATE_NET, + PROPOSAL_LINE_ITEM_BILLING_SOURCE, + PROPOSAL_LINE_ITEM_BILLING_CAP, + PROPOSAL_LINE_ITEM_BILLING_SCHEDULE, + PRODUCT_TEMPLATE_RATE_TYPE, + PRODUCT_TEMPLATE_STATUS, + PRODUCT_TEMPLATE_TYPE_AND_PRIORITY, + PRODUCT_PRODUCT_TEMPLATE_NAME, + PRODUCT_RATE_TYPE, + PRODUCT_STATUS, + PRODUCT_TYPE_AND_PRIORITY, + PROPOSAL_AGENCY_TYPE, + PROPOSAL_AGENCY_CREDIT_STATUS, + CONTENT_CMS_NAME, + CONTENT_CMS_VIDEO_ID, + AD_UNIT_CODE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum DateRangeType { + TODAY, + YESTERDAY, + LAST_WEEK, + LAST_MONTH, + REACH_LIFETIME, + CUSTOM_DATE, + NEXT_DAY, + NEXT_90_DAYS, + NEXT_WEEK, + NEXT_MONTH, + CURRENT_AND_NEXT_MONTH, + NEXT_QUARTER, + NEXT_3_MONTHS, + NEXT_12_MONTHS + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum DimensionFilter { + ADVERTISERS, + ACTIVE_ADVERTISERS, + HOUSE_ADVERTISERS, + NON_HOUSE_ADVERTISERS, + ALL_SALESPEOPLE, + WHOLE_NETWORK, + CURRENT_USER_ORDERS, + STARTED_ORDERS, + COMPLETED_ORDERS, + MOBILE_LINE_ITEMS, + WEB_LINE_ITEMS, + ACTIVE_AD_UNITS, + INACTIVE_AD_UNITS, + MOBILE_INVENTORY_UNITS, + WEB_INVENTORY_UNITS, + ARCHIVED_AD_UNITS, + ACTIVE_PLACEMENTS, + INACTIVE_PLACEMENTS, + ARCHIVED_PLACEMENTS, + OPTIMIZABLE_ORDERS, + PARTNER_STATS_TYPE_ESTIMATED, + PARTNER_STATS_TYPE_RECONCILED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ReportJob { + private long idField; + + private bool idFieldSpecified; + + private ReportQuery reportQueryField; + + private ReportJobStatus reportJobStatusField; + + private bool reportJobStatusFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public ReportQuery reportQuery { + get { return this.reportQueryField; } + set { this.reportQueryField = value; } + } + + public ReportJobStatus reportJobStatus { + get { return this.reportJobStatusField; } + set { + this.reportJobStatusField = value; + this.reportJobStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reportJobStatusSpecified { + get { return this.reportJobStatusFieldSpecified; } + set { this.reportJobStatusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ReportJobStatus { + COMPLETED, + IN_PROGRESS, + FAILED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ReportDownloadOptions { + private ExportFormat exportFormatField; + + private bool exportFormatFieldSpecified; + + private bool includeReportPropertiesField; + + private bool includeReportPropertiesFieldSpecified; + + private bool includeTotalsRowField; + + private bool includeTotalsRowFieldSpecified; + + private bool useGzipCompressionField; + + private bool useGzipCompressionFieldSpecified; + + public ExportFormat exportFormat { + get { return this.exportFormatField; } + set { + this.exportFormatField = value; + this.exportFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool exportFormatSpecified { + get { return this.exportFormatFieldSpecified; } + set { this.exportFormatFieldSpecified = value; } + } + + public bool includeReportProperties { + get { return this.includeReportPropertiesField; } + set { + this.includeReportPropertiesField = value; + this.includeReportPropertiesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeReportPropertiesSpecified { + get { return this.includeReportPropertiesFieldSpecified; } + set { this.includeReportPropertiesFieldSpecified = value; } + } + + public bool includeTotalsRow { + get { return this.includeTotalsRowField; } + set { + this.includeTotalsRowField = value; + this.includeTotalsRowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeTotalsRowSpecified { + get { return this.includeTotalsRowFieldSpecified; } + set { this.includeTotalsRowFieldSpecified = value; } + } + + public bool useGzipCompression { + get { return this.useGzipCompressionField; } + set { + this.useGzipCompressionField = value; + this.useGzipCompressionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool useGzipCompressionSpecified { + get { return this.useGzipCompressionFieldSpecified; } + set { this.useGzipCompressionFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ExportFormat { + TSV, + CSV_EXCEL, + CSV_DUMP, + XML, + XLS, + XLSX + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ReportError : ApiError { + private ReportErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReportErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ReportErrorReason { + DEFAULT, + REPORT_ACCESS_NOT_ALLOWED, + DIMENSION_VIEW_NOT_ALLOWED, + DIMENSION_COMBINATION_NOT_ALLOWED, + ATTRIBUTE_VIEW_NOT_ALLOWED, + COLUMN_VIEW_NOT_ALLOWED, + TOO_MANY_CONCURRENT_REPORTS, + REPORT_TOO_BIG, + INVALID_OPERATION_FOR_REPORT_STATE, + INVALID_DIMENSIONS, + INVALID_ATTRIBUTES, + INVALID_CONTENT_HIERARCHY_DIMENSIONS, + INVALID_COLUMNS, + INVALID_DIMENSION_FILTERS, + INVALID_DATE, + END_DATE_TIME_NOT_AFTER_START_TIME, + NOT_NULL, + ATTRIBUTES_NOT_SUPPORTED_FOR_REQUEST, + COLUMNS_NOT_SUPPORTED_FOR_REQUESTED_DIMENSIONS, + FAILED_TO_STORE_REPORT, + REPORT_NOT_FOUND, + SR_CANNOT_RUN_REPORT_IN_ANOTHER_NETWORK, + INVALID_TIME_ZONE_FOR_FEATURE_NOT_ENABLED, + INVALID_TIME_ZONE_FOR_ID, + UNSUPPORTED_TIME_ZONE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "InventoryServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class InventoryService : DfpSoapClient, IInventoryService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public InventoryService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/InventoryService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnit[] createAdUnits([System.Xml.Serialization.XmlElementAttribute("adUnits")] +AdUnit[] adUnits) { + object[] results = this.Invoke("createAdUnits", new object[] { adUnits }); + return ((AdUnit[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnitSize[] getAdUnitSizesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAdUnitSizesByStatement", new object[] { filterStatement }); + return ((AdUnitSize[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnitPage getAdUnitsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAdUnitsByStatement", new object[] { filterStatement }); + return ((AdUnitPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performAdUnitAction(AdUnitAction adUnitAction, Statement filterStatement) { + object[] results = this.Invoke("performAdUnitAction", new object[] { adUnitAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnit[] updateAdUnits([System.Xml.Serialization.XmlElementAttribute("adUnits")] +AdUnit[] adUnits) { + object[] results = this.Invoke("updateAdUnits", new object[] { adUnits }); + return ((AdUnit[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RemoveAdUnitsFromPlacement))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateAdUnits))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssignAdUnitsToPlacement))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveAdUnits))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateAdUnits))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class AdUnitAction { + private string adUnitActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AdUnitAction.Type")] + public string AdUnitActionType { + get { return this.adUnitActionTypeField; } + set { this.adUnitActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RemoveAdUnitsFromPlacement : AdUnitAction { + private long placementIdField; + + private bool placementIdFieldSpecified; + + public long placementId { + get { return this.placementIdField; } + set { + this.placementIdField = value; + this.placementIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool placementIdSpecified { + get { return this.placementIdFieldSpecified; } + set { this.placementIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeactivateAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AssignAdUnitsToPlacement : AdUnitAction { + private long placementIdField; + + private bool placementIdFieldSpecified; + + public long placementId { + get { return this.placementIdField; } + set { + this.placementIdField = value; + this.placementIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool placementIdSpecified { + get { return this.placementIdFieldSpecified; } + set { this.placementIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ArchiveAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ActivateAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdUnitPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AdUnit[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AdUnit[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdUnit { + private string idField; + + private string parentIdField; + + private bool hasChildrenField; + + private bool hasChildrenFieldSpecified; + + private AdUnitParent[] parentPathField; + + private string nameField; + + private string descriptionField; + + private AdUnitTargetWindow targetWindowField; + + private bool targetWindowFieldSpecified; + + private InventoryStatus statusField; + + private bool statusFieldSpecified; + + private string adUnitCodeField; + + private AdUnitSize[] adUnitSizesField; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private MobilePlatform mobilePlatformField; + + private bool mobilePlatformFieldSpecified; + + private bool explicitlyTargetedField; + + private bool explicitlyTargetedFieldSpecified; + + private AdSenseSettingsInheritedProperty inheritedAdSenseSettingsField; + + private long partnerIdField; + + private bool partnerIdFieldSpecified; + + private LabelFrequencyCap[] appliedLabelFrequencyCapsField; + + private LabelFrequencyCap[] effectiveLabelFrequencyCapsField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private long[] effectiveTeamIdsField; + + private long[] appliedTeamIdsField; + + private DateTime lastModifiedDateTimeField; + + private SmartSizeMode smartSizeModeField; + + private bool smartSizeModeFieldSpecified; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string parentId { + get { return this.parentIdField; } + set { this.parentIdField = value; } + } + + public bool hasChildren { + get { return this.hasChildrenField; } + set { + this.hasChildrenField = value; + this.hasChildrenSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasChildrenSpecified { + get { return this.hasChildrenFieldSpecified; } + set { this.hasChildrenFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("parentPath")] + public AdUnitParent[] parentPath { + get { return this.parentPathField; } + set { this.parentPathField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public AdUnitTargetWindow targetWindow { + get { return this.targetWindowField; } + set { + this.targetWindowField = value; + this.targetWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetWindowSpecified { + get { return this.targetWindowFieldSpecified; } + set { this.targetWindowFieldSpecified = value; } + } + + public InventoryStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string adUnitCode { + get { return this.adUnitCodeField; } + set { this.adUnitCodeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adUnitSizes")] + public AdUnitSize[] adUnitSizes { + get { return this.adUnitSizesField; } + set { this.adUnitSizesField = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + public MobilePlatform mobilePlatform { + get { return this.mobilePlatformField; } + set { + this.mobilePlatformField = value; + this.mobilePlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mobilePlatformSpecified { + get { return this.mobilePlatformFieldSpecified; } + set { this.mobilePlatformFieldSpecified = value; } + } + + public bool explicitlyTargeted { + get { return this.explicitlyTargetedField; } + set { + this.explicitlyTargetedField = value; + this.explicitlyTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool explicitlyTargetedSpecified { + get { return this.explicitlyTargetedFieldSpecified; } + set { this.explicitlyTargetedFieldSpecified = value; } + } + + public AdSenseSettingsInheritedProperty inheritedAdSenseSettings { + get { return this.inheritedAdSenseSettingsField; } + set { this.inheritedAdSenseSettingsField = value; } + } + + public long partnerId { + get { return this.partnerIdField; } + set { + this.partnerIdField = value; + this.partnerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool partnerIdSpecified { + get { return this.partnerIdFieldSpecified; } + set { this.partnerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabelFrequencyCaps")] + public LabelFrequencyCap[] appliedLabelFrequencyCaps { + get { return this.appliedLabelFrequencyCapsField; } + set { this.appliedLabelFrequencyCapsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveLabelFrequencyCaps")] + public LabelFrequencyCap[] effectiveLabelFrequencyCaps { + get { return this.effectiveLabelFrequencyCapsField; } + set { this.effectiveLabelFrequencyCapsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveTeamIds")] + public long[] effectiveTeamIds { + get { return this.effectiveTeamIdsField; } + set { this.effectiveTeamIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public SmartSizeMode smartSizeMode { + get { return this.smartSizeModeField; } + set { + this.smartSizeModeField = value; + this.smartSizeModeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool smartSizeModeSpecified { + get { return this.smartSizeModeFieldSpecified; } + set { this.smartSizeModeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum InventoryStatus { + ACTIVE, + INACTIVE, + ARCHIVED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum MobilePlatform { + SITE, + APPLICATION + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdSenseSettingsInheritedProperty { + private AdSenseSettings valueField; + + public AdSenseSettings value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdSenseSettings { + private bool adSenseEnabledField; + + private bool adSenseEnabledFieldSpecified; + + private string borderColorField; + + private string titleColorField; + + private string backgroundColorField; + + private string textColorField; + + private string urlColorField; + + private AdSenseSettingsAdType adTypeField; + + private bool adTypeFieldSpecified; + + private AdSenseSettingsBorderStyle borderStyleField; + + private bool borderStyleFieldSpecified; + + private AdSenseSettingsFontFamily fontFamilyField; + + private bool fontFamilyFieldSpecified; + + private AdSenseSettingsFontSize fontSizeField; + + private bool fontSizeFieldSpecified; + + private Size_StringMapEntry[] afcFormatsField; + + public bool adSenseEnabled { + get { return this.adSenseEnabledField; } + set { + this.adSenseEnabledField = value; + this.adSenseEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adSenseEnabledSpecified { + get { return this.adSenseEnabledFieldSpecified; } + set { this.adSenseEnabledFieldSpecified = value; } + } + + public string borderColor { + get { return this.borderColorField; } + set { this.borderColorField = value; } + } + + public string titleColor { + get { return this.titleColorField; } + set { this.titleColorField = value; } + } + + public string backgroundColor { + get { return this.backgroundColorField; } + set { this.backgroundColorField = value; } + } + + public string textColor { + get { return this.textColorField; } + set { this.textColorField = value; } + } + + public string urlColor { + get { return this.urlColorField; } + set { this.urlColorField = value; } + } + + public AdSenseSettingsAdType adType { + get { return this.adTypeField; } + set { + this.adTypeField = value; + this.adTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adTypeSpecified { + get { return this.adTypeFieldSpecified; } + set { this.adTypeFieldSpecified = value; } + } + + public AdSenseSettingsBorderStyle borderStyle { + get { return this.borderStyleField; } + set { + this.borderStyleField = value; + this.borderStyleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool borderStyleSpecified { + get { return this.borderStyleFieldSpecified; } + set { this.borderStyleFieldSpecified = value; } + } + + public AdSenseSettingsFontFamily fontFamily { + get { return this.fontFamilyField; } + set { + this.fontFamilyField = value; + this.fontFamilySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fontFamilySpecified { + get { return this.fontFamilyFieldSpecified; } + set { this.fontFamilyFieldSpecified = value; } + } + + public AdSenseSettingsFontSize fontSize { + get { return this.fontSizeField; } + set { + this.fontSizeField = value; + this.fontSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fontSizeSpecified { + get { return this.fontSizeFieldSpecified; } + set { this.fontSizeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("afcFormats")] + public Size_StringMapEntry[] afcFormats { + get { return this.afcFormatsField; } + set { this.afcFormatsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.AdType", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AdSenseSettingsAdType { + TEXT, + IMAGE, + TEXT_AND_IMAGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.BorderStyle", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AdSenseSettingsBorderStyle { + DEFAULT, + NOT_ROUNDED, + SLIGHTLY_ROUNDED, + VERY_ROUNDED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.FontFamily", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AdSenseSettingsFontFamily { + DEFAULT, + ARIAL, + TAHOMA, + GEORGIA, + TIMES, + VERDANA + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.FontSize", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AdSenseSettingsFontSize { + DEFAULT, + SMALL, + MEDIUM, + LARGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Size_StringMapEntry { + private Size keyField; + + private string valueField; + + public Size key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LabelFrequencyCap { + private FrequencyCap frequencyCapField; + + private long labelIdField; + + private bool labelIdFieldSpecified; + + public FrequencyCap frequencyCap { + get { return this.frequencyCapField; } + set { this.frequencyCapField = value; } + } + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum SmartSizeMode { + UNKNOWN, + NONE, + SMART_BANNER, + DYNAMIC_SIZE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdUnitTypeError : ApiError { + private AdUnitTypeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitTypeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitTypeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AdUnitTypeErrorReason { + MOBILE_APP_PLATFORM_NOT_VALID, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class InventoryUnitSizesError : ApiError { + private InventoryUnitSizesErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitSizesErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitSizesError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum InventoryUnitSizesErrorReason { + INVALID_SIZES, + INVALID_SIZE_FOR_PLATFORM, + VIDEO_FEATURE_MISSING, + VIDEO_MOBILE_LINE_ITEM_FEATURE_MISSING, + INVALID_SIZE_FOR_MASTER, + INVALID_SIZE_FOR_COMPANION, + DUPLICATE_MASTER_SIZES, + ASPECT_RATIO_NOT_SUPPORTED, + VIDEO_COMPANIONS_NOT_SUPPORTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class InventoryUnitPartnerAssociationError : ApiError { + private InventoryUnitPartnerAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitPartnerAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitPartnerAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum InventoryUnitPartnerAssociationErrorReason { + ANCESTOR_AD_UNIT_HAS_PARTNER_ASSOCIATION, + DESCENDANT_AD_UNIT_HAS_PARTNER_ASSOCIATION, + SAME_PARTNER_ASSOCIATION_IN_INVENTORY_HIERARCHY, + NO_PARTNER_CATCH_ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class InvalidColorError : ApiError { + private InvalidColorErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidColorErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidColorError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum InvalidColorErrorReason { + INVALID_FORMAT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdUnitHierarchyError : ApiError { + private AdUnitHierarchyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitHierarchyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitHierarchyError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum AdUnitHierarchyErrorReason { + INVALID_DEPTH, + INVALID_PARENT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "TeamServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class TeamService : DfpSoapClient, ITeamService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public TeamService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/TeamService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Team[] createTeams([System.Xml.Serialization.XmlElementAttribute("teams")] +Team[] teams) { + object[] results = this.Invoke("createTeams", new object[] { teams }); + return ((Team[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TeamPage getTeamsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getTeamsByStatement", new object[] { filterStatement }); + return ((TeamPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Team[] updateTeams([System.Xml.Serialization.XmlElementAttribute("teams")] +Team[] teams) { + object[] results = this.Invoke("updateTeams", new object[] { teams }); + return ((Team[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class TeamPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Team[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Team[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Team { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool hasAllCompaniesField; + + private bool hasAllCompaniesFieldSpecified; + + private bool hasAllInventoryField; + + private bool hasAllInventoryFieldSpecified; + + private TeamAccessType teamAccessTypeField; + + private bool teamAccessTypeFieldSpecified; + + private long[] companyIdsField; + + private string[] adUnitIdsField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool hasAllCompanies { + get { return this.hasAllCompaniesField; } + set { + this.hasAllCompaniesField = value; + this.hasAllCompaniesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasAllCompaniesSpecified { + get { return this.hasAllCompaniesFieldSpecified; } + set { this.hasAllCompaniesFieldSpecified = value; } + } + + public bool hasAllInventory { + get { return this.hasAllInventoryField; } + set { + this.hasAllInventoryField = value; + this.hasAllInventorySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasAllInventorySpecified { + get { return this.hasAllInventoryFieldSpecified; } + set { this.hasAllInventoryFieldSpecified = value; } + } + + public TeamAccessType teamAccessType { + get { return this.teamAccessTypeField; } + set { + this.teamAccessTypeField = value; + this.teamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool teamAccessTypeSpecified { + get { return this.teamAccessTypeFieldSpecified; } + set { this.teamAccessTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companyIds")] + public long[] companyIds { + get { return this.companyIdsField; } + set { this.companyIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adUnitIds")] + public string[] adUnitIds { + get { return this.adUnitIdsField; } + set { this.adUnitIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum TeamAccessType { + NONE, + READ_ONLY, + READ_WRITE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "NetworkServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class NetworkService : DfpSoapClient, INetworkService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public NetworkService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/NetworkService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Network[] getAllNetworks() { + object[] results = this.Invoke("getAllNetworks", new object[0]); + return ((Network[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Network getCurrentNetwork() { + object[] results = this.Invoke("getCurrentNetwork", new object[0]); + return ((Network) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Network makeTestNetwork() { + object[] results = this.Invoke("makeTestNetwork", new object[0]); + return ((Network) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Network updateNetwork(Network network) { + object[] results = this.Invoke("updateNetwork", new object[] { network }); + return ((Network) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Network { + private long idField; + + private bool idFieldSpecified; + + private string displayNameField; + + private string networkCodeField; + + private string propertyCodeField; + + private string timeZoneField; + + private string currencyCodeField; + + private string[] secondaryCurrencyCodesField; + + private string effectiveRootAdUnitIdField; + + private long contentBrowseCustomTargetingKeyIdField; + + private bool contentBrowseCustomTargetingKeyIdFieldSpecified; + + private bool isTestField; + + private bool isTestFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public string networkCode { + get { return this.networkCodeField; } + set { this.networkCodeField = value; } + } + + public string propertyCode { + get { return this.propertyCodeField; } + set { this.propertyCodeField = value; } + } + + public string timeZone { + get { return this.timeZoneField; } + set { this.timeZoneField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryCurrencyCodes")] + public string[] secondaryCurrencyCodes { + get { return this.secondaryCurrencyCodesField; } + set { this.secondaryCurrencyCodesField = value; } + } + + public string effectiveRootAdUnitId { + get { return this.effectiveRootAdUnitIdField; } + set { this.effectiveRootAdUnitIdField = value; } + } + + public long contentBrowseCustomTargetingKeyId { + get { return this.contentBrowseCustomTargetingKeyIdField; } + set { + this.contentBrowseCustomTargetingKeyIdField = value; + this.contentBrowseCustomTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contentBrowseCustomTargetingKeyIdSpecified { + get { return this.contentBrowseCustomTargetingKeyIdFieldSpecified; } + set { this.contentBrowseCustomTargetingKeyIdFieldSpecified = value; } + } + + public bool isTest { + get { return this.isTestField; } + set { + this.isTestField = value; + this.isTestSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTestSpecified { + get { return this.isTestFieldSpecified; } + set { this.isTestFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class NetworkError : ApiError { + private NetworkErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NetworkErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NetworkError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum NetworkErrorReason { + UNKNOWN, + MULTI_CURRENCY_NOT_SUPPORTED, + UNSUPPORTED_CURRENCY, + NETWORK_CURRENCY_CANNOT_BE_SAME_AS_SECONDARY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ExchangeRateError : ApiError { + private ExchangeRateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ExchangeRateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ExchangeRateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ExchangeRateErrorReason { + INVALID_CURRENCY_CODE, + UNSUPPORTED_CURRENCY_CODE, + CURRENCY_CODE_ALREADY_EXISTS, + INVALID_EXCHANGE_RATE, + EXCHANGE_RATE_NOT_FOUND, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "RateCardCustomizationServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class RateCardCustomizationService : DfpSoapClient, IRateCardCustomizationService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public RateCardCustomizationService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/RateCardCustomizationService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomization[] createRateCardCustomizations([System.Xml.Serialization.XmlElementAttribute("rateCardCustomizations")] +RateCardCustomization[] rateCardCustomizations) { + object[] results = this.Invoke("createRateCardCustomizations", new object[] { rateCardCustomizations }); + return ((RateCardCustomization[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomizationPage getRateCardCustomizationsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getRateCardCustomizationsByStatement", new object[] { filterStatement }); + return ((RateCardCustomizationPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performRateCardCustomizationAction(RateCardCustomizationAction rateCardCustomizationAction, Statement filterStatement) { + object[] results = this.Invoke("performRateCardCustomizationAction", new object[] { rateCardCustomizationAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomization[] updateRateCardCustomizations([System.Xml.Serialization.XmlElementAttribute("rateCardCustomizations")] +RateCardCustomization[] rateCardCustomizations) { + object[] results = this.Invoke("updateRateCardCustomizations", new object[] { rateCardCustomizations }); + return ((RateCardCustomization[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateRateCardCustomizations))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateRateCardCustomizations))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class RateCardCustomizationAction { + private string rateCardCustomizationActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("RateCardCustomizationAction.Type")] + public string RateCardCustomizationActionType { + get { return this.rateCardCustomizationActionTypeField; } + set { this.rateCardCustomizationActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeactivateRateCardCustomizations : RateCardCustomizationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ActivateRateCardCustomizations : RateCardCustomizationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RateCardCustomizationPage { + private RateCardCustomization[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public RateCardCustomization[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RateCardCustomization { + private long rateCardCustomizationGroupIdField; + + private bool rateCardCustomizationGroupIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private RateCardCustomizationStatus statusField; + + private bool statusFieldSpecified; + + private RateCardFeature rateCardFeatureField; + + private RateCardCustomizationAdjustmentType adjustmentTypeField; + + private bool adjustmentTypeFieldSpecified; + + private long adjustmentSizeField; + + private bool adjustmentSizeFieldSpecified; + + private RateType rateTypeField; + + private bool rateTypeFieldSpecified; + + public long rateCardCustomizationGroupId { + get { return this.rateCardCustomizationGroupIdField; } + set { + this.rateCardCustomizationGroupIdField = value; + this.rateCardCustomizationGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardCustomizationGroupIdSpecified { + get { return this.rateCardCustomizationGroupIdFieldSpecified; } + set { this.rateCardCustomizationGroupIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public RateCardCustomizationStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public RateCardFeature rateCardFeature { + get { return this.rateCardFeatureField; } + set { this.rateCardFeatureField = value; } + } + + public RateCardCustomizationAdjustmentType adjustmentType { + get { return this.adjustmentTypeField; } + set { + this.adjustmentTypeField = value; + this.adjustmentTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adjustmentTypeSpecified { + get { return this.adjustmentTypeFieldSpecified; } + set { this.adjustmentTypeFieldSpecified = value; } + } + + public long adjustmentSize { + get { return this.adjustmentSizeField; } + set { + this.adjustmentSizeField = value; + this.adjustmentSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adjustmentSizeSpecified { + get { return this.adjustmentSizeFieldSpecified; } + set { this.adjustmentSizeFieldSpecified = value; } + } + + public RateType rateType { + get { return this.rateTypeField; } + set { + this.rateTypeField = value; + this.rateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateTypeSpecified { + get { return this.rateTypeFieldSpecified; } + set { this.rateTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum RateCardCustomizationStatus { + ACTIVE, + INACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum RateCardCustomizationAdjustmentType { + PERCENTAGE, + ABSOLUTE_VALUE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RateCardCustomizationError : ApiError { + private RateCardCustomizationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RateCardCustomizationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RateCardCustomizationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum RateCardCustomizationErrorReason { + INVALID_RATE_TYPE, + CANNOT_ADD_TO_GROUP_BY_PRICING_METHOD, + GROUP_FOR_FEATURE_ALREADY_EXISTS, + FEATURE_NOT_BELONGS_TO_GROUP, + SAME_GROUP_DIFFERENT_FEATURE, + DIFFERENT_GROUP_SAME_FEATURE, + UNSUPPORTED_OPERATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProposalLineItemServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProposalLineItemService : DfpSoapClient, IProposalLineItemService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProposalLineItemService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/ProposalLineItemService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItem[] createProposalLineItems([System.Xml.Serialization.XmlElementAttribute("proposalLineItems")] +ProposalLineItem[] proposalLineItems) { + object[] results = this.Invoke("createProposalLineItems", new object[] { proposalLineItems }); + return ((ProposalLineItem[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItemPage getProposalLineItemsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getProposalLineItemsByStatement", new object[] { filterStatement }); + return ((ProposalLineItemPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performProposalLineItemAction(ProposalLineItemAction proposalLineItemAction, Statement filterStatement) { + object[] results = this.Invoke("performProposalLineItemAction", new object[] { proposalLineItemAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItem[] updateProposalLineItems([System.Xml.Serialization.XmlElementAttribute("proposalLineItems")] +ProposalLineItem[] proposalLineItems) { + object[] results = this.Invoke("updateProposalLineItems", new object[] { proposalLineItems }); + return ((ProposalLineItem[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveProposalLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveProposalLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class ProposalLineItemAction { + private string proposalLineItemActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProposalLineItemAction.Type")] + public string ProposalLineItemActionType { + get { return this.proposalLineItemActionTypeField; } + set { this.proposalLineItemActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class UnarchiveProposalLineItems : ProposalLineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ArchiveProposalLineItems : ProposalLineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ProposalLineItemPage { + private ProposalLineItem[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ProposalLineItem[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ProposalLineItem { + private long idField; + + private bool idFieldSpecified; + + private long proposalIdField; + + private bool proposalIdFieldSpecified; + + private long rateCardIdField; + + private bool rateCardIdFieldSpecified; + + private string productIdField; + + private string nameField; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + private string notesField; + + private CostAdjustment costAdjustmentField; + + private bool costAdjustmentFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private long unitsBoughtField; + + private bool unitsBoughtFieldSpecified; + + private int unitsBoughtBufferField; + + private bool unitsBoughtBufferFieldSpecified; + + private DeliveryRateType deliveryRateTypeField; + + private bool deliveryRateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private CompanionDeliveryOption companionDeliveryOptionField; + + private bool companionDeliveryOptionFieldSpecified; + + private CreativeRotationType creativeRotationTypeField; + + private bool creativeRotationTypeFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private long dfpLineItemIdField; + + private bool dfpLineItemIdFieldSpecified; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int lineItemPriorityField; + + private bool lineItemPriorityFieldSpecified; + + private RateType rateTypeField; + + private bool rateTypeFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private Targeting targetingField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private ProposalLineItemPremium[] premiumsField; + + private Money baseRateField; + + private Money costPerUnitField; + + private Money costField; + + private DeliveryIndicator deliveryIndicatorField; + + private long[] deliveryDataField; + + private ComputedStatus computedStatusField; + + private bool computedStatusFieldSpecified; + + private BillingCap billingCapField; + + private bool billingCapFieldSpecified; + + private BillingSchedule billingScheduleField; + + private bool billingScheduleFieldSpecified; + + private BillingSource billingSourceField; + + private bool billingSourceFieldSpecified; + + private DateTime lastModifiedDateTimeField; + + private bool useThirdPartyAdServerFromProposalField; + + private bool useThirdPartyAdServerFromProposalFieldSpecified; + + private int thirdPartyAdServerIdField; + + private bool thirdPartyAdServerIdFieldSpecified; + + private string customThirdPartyAdServerNameField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long proposalId { + get { return this.proposalIdField; } + set { + this.proposalIdField = value; + this.proposalIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool proposalIdSpecified { + get { return this.proposalIdFieldSpecified; } + set { this.proposalIdFieldSpecified = value; } + } + + public long rateCardId { + get { return this.rateCardIdField; } + set { + this.rateCardIdField = value; + this.rateCardIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardIdSpecified { + get { return this.rateCardIdFieldSpecified; } + set { this.rateCardIdFieldSpecified = value; } + } + + public string productId { + get { return this.productIdField; } + set { this.productIdField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public CostAdjustment costAdjustment { + get { return this.costAdjustmentField; } + set { + this.costAdjustmentField = value; + this.costAdjustmentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool costAdjustmentSpecified { + get { return this.costAdjustmentFieldSpecified; } + set { this.costAdjustmentFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public long unitsBought { + get { return this.unitsBoughtField; } + set { + this.unitsBoughtField = value; + this.unitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitsBoughtSpecified { + get { return this.unitsBoughtFieldSpecified; } + set { this.unitsBoughtFieldSpecified = value; } + } + + public int unitsBoughtBuffer { + get { return this.unitsBoughtBufferField; } + set { + this.unitsBoughtBufferField = value; + this.unitsBoughtBufferSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitsBoughtBufferSpecified { + get { return this.unitsBoughtBufferFieldSpecified; } + set { this.unitsBoughtBufferFieldSpecified = value; } + } + + public DeliveryRateType deliveryRateType { + get { return this.deliveryRateTypeField; } + set { + this.deliveryRateTypeField = value; + this.deliveryRateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryRateTypeSpecified { + get { return this.deliveryRateTypeFieldSpecified; } + set { this.deliveryRateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + public CompanionDeliveryOption companionDeliveryOption { + get { return this.companionDeliveryOptionField; } + set { + this.companionDeliveryOptionField = value; + this.companionDeliveryOptionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companionDeliveryOptionSpecified { + get { return this.companionDeliveryOptionFieldSpecified; } + set { this.companionDeliveryOptionFieldSpecified = value; } + } + + public CreativeRotationType creativeRotationType { + get { return this.creativeRotationTypeField; } + set { + this.creativeRotationTypeField = value; + this.creativeRotationTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeRotationTypeSpecified { + get { return this.creativeRotationTypeFieldSpecified; } + set { this.creativeRotationTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public long dfpLineItemId { + get { return this.dfpLineItemIdField; } + set { + this.dfpLineItemIdField = value; + this.dfpLineItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dfpLineItemIdSpecified { + get { return this.dfpLineItemIdFieldSpecified; } + set { this.dfpLineItemIdFieldSpecified = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int lineItemPriority { + get { return this.lineItemPriorityField; } + set { + this.lineItemPriorityField = value; + this.lineItemPrioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemPrioritySpecified { + get { return this.lineItemPriorityFieldSpecified; } + set { this.lineItemPriorityFieldSpecified = value; } + } + + public RateType rateType { + get { return this.rateTypeField; } + set { + this.rateTypeField = value; + this.rateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateTypeSpecified { + get { return this.rateTypeFieldSpecified; } + set { this.rateTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public Targeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("premiums")] + public ProposalLineItemPremium[] premiums { + get { return this.premiumsField; } + set { this.premiumsField = value; } + } + + public Money baseRate { + get { return this.baseRateField; } + set { this.baseRateField = value; } + } + + public Money costPerUnit { + get { return this.costPerUnitField; } + set { this.costPerUnitField = value; } + } + + public Money cost { + get { return this.costField; } + set { this.costField = value; } + } + + public DeliveryIndicator deliveryIndicator { + get { return this.deliveryIndicatorField; } + set { this.deliveryIndicatorField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("units", IsNullable = false)] + public long[] deliveryData { + get { return this.deliveryDataField; } + set { this.deliveryDataField = value; } + } + + public ComputedStatus computedStatus { + get { return this.computedStatusField; } + set { + this.computedStatusField = value; + this.computedStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool computedStatusSpecified { + get { return this.computedStatusFieldSpecified; } + set { this.computedStatusFieldSpecified = value; } + } + + public BillingCap billingCap { + get { return this.billingCapField; } + set { + this.billingCapField = value; + this.billingCapSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingCapSpecified { + get { return this.billingCapFieldSpecified; } + set { this.billingCapFieldSpecified = value; } + } + + public BillingSchedule billingSchedule { + get { return this.billingScheduleField; } + set { + this.billingScheduleField = value; + this.billingScheduleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingScheduleSpecified { + get { return this.billingScheduleFieldSpecified; } + set { this.billingScheduleFieldSpecified = value; } + } + + public BillingSource billingSource { + get { return this.billingSourceField; } + set { + this.billingSourceField = value; + this.billingSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingSourceSpecified { + get { return this.billingSourceFieldSpecified; } + set { this.billingSourceFieldSpecified = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public bool useThirdPartyAdServerFromProposal { + get { return this.useThirdPartyAdServerFromProposalField; } + set { + this.useThirdPartyAdServerFromProposalField = value; + this.useThirdPartyAdServerFromProposalSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool useThirdPartyAdServerFromProposalSpecified { + get { return this.useThirdPartyAdServerFromProposalFieldSpecified; } + set { this.useThirdPartyAdServerFromProposalFieldSpecified = value; } + } + + public int thirdPartyAdServerId { + get { return this.thirdPartyAdServerIdField; } + set { + this.thirdPartyAdServerIdField = value; + this.thirdPartyAdServerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyAdServerIdSpecified { + get { return this.thirdPartyAdServerIdFieldSpecified; } + set { this.thirdPartyAdServerIdFieldSpecified = value; } + } + + public string customThirdPartyAdServerName { + get { return this.customThirdPartyAdServerNameField; } + set { this.customThirdPartyAdServerNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CostAdjustment { + NONE, + MAKE_GOOD, + BARTER, + ADDED_VALUE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ProposalLineItemPremium { + private long rateCardCustomizationIdField; + + private bool rateCardCustomizationIdFieldSpecified; + + private ProposalLineItemPremiumStatus statusField; + + private bool statusFieldSpecified; + + public long rateCardCustomizationId { + get { return this.rateCardCustomizationIdField; } + set { + this.rateCardCustomizationIdField = value; + this.rateCardCustomizationIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardCustomizationIdSpecified { + get { return this.rateCardCustomizationIdFieldSpecified; } + set { this.rateCardCustomizationIdFieldSpecified = value; } + } + + public ProposalLineItemPremiumStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ProposalLineItemPremiumStatus { + INCLUDED, + EXCLUDED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum BillingCap { + NO_CAP, + CAPPED_CUMULATIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum BillingSchedule { + PRORATED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum BillingSource { + CONTRACTED, + DFP_VOLUME, + THIRD_PARTY_VOLUME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ProposalLineItemError : ApiError { + private ProposalLineItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProposalLineItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProposalLineItemError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ProposalLineItemErrorReason { + NOT_SAME_RATE_CARD, + LINE_ITEM_TYPE_NOT_ALLOWED, + END_DATE_TIME_NOT_AFTER_START_TIME, + END_DATE_TIME_TOO_LATE, + START_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_IS_IN_PAST, + FRONTLOADED_NOT_ALLOWED, + ALL_ROADBLOCK_NOT_ALLOWED, + CREATIVE_SET_ROADBLOCK_NOT_ALLOWED, + ALREADY_STARTED, + CONFLICT_WITH_PRODUCT, + MOBILE_TECH_CRITERIA_NOT_SUPPORTED, + UNSUPPORTED_TARGETING_TYPE, + WRONG_COST, + INVALID_PRIORITY_FOR_LINE_ITEM_TYPE, + UPDATE_PROPOSAL_LINE_ITEM_NOT_ALLOWED, + CANNOT_UPDATE_TO_OR_FROM_CREATIVE_SET_ROADBLOCK, + SEQUENTIAL_CREATIVE_ROTATION_NOT_ALLOWED, + UPDATE_RESERVATION_NOT_ALLOWED, + INVALID_COMPANION_DELIVERY_OPTION_FOR_ROADBLOCKING_TYPE, + INCONSISTENT_ROADBLOCK_TYPE, + INVALID_UNITS_BOUGHT_BUFFER, + UPDATE_COST_ADJUSTMENT_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ProposalLineItemActionError : ApiError { + private ProposalLineItemActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProposalLineItemActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProposalLineItemActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ProposalLineItemActionErrorReason { + NOT_APPLICABLE, + PROPOSAL_NOT_EDITABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ProposalError : ApiError { + private ProposalErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProposalErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProposalError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ProposalErrorReason { + AD_SERVER_UNKNOWN_ERROR, + AD_SERVER_API_ERROR, + UPDATE_ADVERTISER_NOT_ALLOWED, + UPDATE_PROPOSAL_NOT_ALLOWED, + INVALID_CONTACT, + DUPLICATED_CONTACT, + UNACCEPTABLE_COMPANY_CREDIT_STATUS, + PRIMARY_AGENCY_REQUIRED, + PRIMARY_AGENCY_NOT_UNIQUE, + DUPLICATED_COMPANY_ASSOCIATION, + DUPLICATED_SALESPERSON, + DUPLICATED_SALES_PLANNER, + DUPLICATED_TRAFFICKER, + HAS_NO_UNARCHIVED_PROPOSAL_LINEITEMS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class PrecisionError : ApiError { + private PrecisionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PrecisionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PrecisionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum PrecisionErrorReason { + WRONG_PRECISION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class BillingError : ApiError { + private BillingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BillingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BillingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum BillingErrorReason { + UNSUPPORTED_BILLING_SCHEDULE, + UNSUPPORTED_BILLING_CAP, + MISSING_BILLING_SOURCE, + MISSING_BILLING_SCHEDULE, + MISSING_BILLING_CAP, + INVALID_BILLING_SOURCE_FOR_OFFLINE, + UPDATE_BILLING_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Asset))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeService : DfpSoapClient, ICreativeService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/CreativeService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Creative[] createCreatives([System.Xml.Serialization.XmlElementAttribute("creatives")] +Creative[] creatives) { + object[] results = this.Invoke("createCreatives", new object[] { creatives }); + return ((Creative[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativePage getCreativesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativesByStatement", new object[] { filterStatement }); + return ((CreativePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Creative[] updateCreatives([System.Xml.Serialization.XmlElementAttribute("creatives")] +Creative[] creatives) { + object[] results = this.Invoke("updateCreatives", new object[] { creatives }); + return ((Creative[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CreativePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Creative[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Creative[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VastRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnsupportedCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ThirdPartyCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TemplateCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InternalRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasDestinationUrlCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpMobileCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseVideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AspectRatioImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClickTrackingCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseRichMediaStudioCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasHtmlSnippetDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdMobBackfillCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class Creative { + private long advertiserIdField; + + private bool advertiserIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private Size sizeField; + + private string previewUrlField; + + private AppliedLabel[] appliedLabelsField; + + private DateTime lastModifiedDateTimeField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private string creativeTypeField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { + this.advertiserIdField = value; + this.advertiserIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserIdSpecified { + get { return this.advertiserIdFieldSpecified; } + set { this.advertiserIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + public string previewUrl { + get { return this.previewUrlField; } + set { this.previewUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Creative.Type")] + public string CreativeType { + get { return this.creativeTypeField; } + set { this.creativeTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class VastRedirectCreative : Creative { + private string vastXmlUrlField; + + private VastRedirectType vastRedirectTypeField; + + private bool vastRedirectTypeFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string vastPreviewUrlField; + + public string vastXmlUrl { + get { return this.vastXmlUrlField; } + set { this.vastXmlUrlField = value; } + } + + public VastRedirectType vastRedirectType { + get { return this.vastRedirectTypeField; } + set { + this.vastRedirectTypeField = value; + this.vastRedirectTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool vastRedirectTypeSpecified { + get { return this.vastRedirectTypeFieldSpecified; } + set { this.vastRedirectTypeFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum VastRedirectType { + LINEAR, + NON_LINEAR, + LINEAR_AND_NON_LINEAR + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ConversionEvent_TrackingUrlsMapEntry { + private ConversionEvent keyField; + + private bool keyFieldSpecified; + + private string[] valueField; + + public ConversionEvent key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("urls", IsNullable = false)] + public string[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ConversionEvent { + CREATIVE_VIEW, + START, + SKIP_SHOWN, + FIRST_QUARTILE, + MIDPOINT, + THIRD_QUARTILE, + ENGAGED_VIEW, + COMPLETE, + MUTE, + UNMUTE, + PAUSE, + REWIND, + RESUME, + SKIPPED, + FULLSCREEN, + EXPAND, + COLLAPSE, + ACCEPT_INVITATION, + CLOSE, + CLICK_TRACKING, + SURVEY, + CUSTOM_CLICK + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class UnsupportedCreative : Creative { + private string unsupportedCreativeTypeField; + + public string unsupportedCreativeType { + get { return this.unsupportedCreativeTypeField; } + set { this.unsupportedCreativeTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ThirdPartyCreative : Creative { + private string snippetField; + + private string expandedSnippetField; + + public string snippet { + get { return this.snippetField; } + set { this.snippetField = value; } + } + + public string expandedSnippet { + get { return this.expandedSnippetField; } + set { this.expandedSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class TemplateCreative : Creative { + private long creativeTemplateIdField; + + private bool creativeTemplateIdFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + private string destinationUrlField; + + private BaseCreativeTemplateVariableValue[] creativeTemplateVariableValuesField; + + public long creativeTemplateId { + get { return this.creativeTemplateIdField; } + set { + this.creativeTemplateIdField = value; + this.creativeTemplateIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeTemplateIdSpecified { + get { return this.creativeTemplateIdFieldSpecified; } + set { this.creativeTemplateIdFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativeTemplateVariableValues")] + public BaseCreativeTemplateVariableValue[] creativeTemplateVariableValues { + get { return this.creativeTemplateVariableValuesField; } + set { this.creativeTemplateVariableValuesField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UrlCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetCreativeTemplateVariableValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class BaseCreativeTemplateVariableValue { + private string uniqueNameField; + + private string baseCreativeTemplateVariableValueTypeField; + + public string uniqueName { + get { return this.uniqueNameField; } + set { this.uniqueNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseCreativeTemplateVariableValue.Type")] + public string BaseCreativeTemplateVariableValueType { + get { return this.baseCreativeTemplateVariableValueTypeField; } + set { this.baseCreativeTemplateVariableValueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class UrlCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class StringCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LongCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private long valueField; + + private bool valueFieldSpecified; + + public long value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AssetCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LegacyDfpCreative : Creative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class InternalRedirectCreative : Creative { + private Size assetSizeField; + + private string internalRedirectUrlField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public Size assetSize { + get { return this.assetSizeField; } + set { this.assetSizeField = value; } + } + + public string internalRedirectUrl { + get { return this.internalRedirectUrlField; } + set { this.internalRedirectUrlField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpMobileCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseVideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AspectRatioImageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class HasDestinationUrlCreative : Creative { + private string destinationUrlField; + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class VpaidLinearRedirectCreative : HasDestinationUrlCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + private string flashUrlField; + + private Size flashAssetSizeField; + + private string vastPreviewUrlField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string flashUrl { + get { return this.flashUrlField; } + set { this.flashUrlField = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class VpaidLinearCreative : HasDestinationUrlCreative { + private string flashNameField; + + private byte[] flashByteArrayField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private Size flashAssetSizeField; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + private string vastPreviewUrlField; + + public string flashName { + get { return this.flashNameField; } + set { this.flashNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] flashByteArray { + get { return this.flashByteArrayField; } + set { this.flashByteArrayField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LegacyDfpMobileCreative : HasDestinationUrlCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CustomCreative : HasDestinationUrlCreative { + private string htmlSnippetField; + + private CustomCreativeAsset[] customCreativeAssetsField; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public string htmlSnippet { + get { return this.htmlSnippetField; } + set { this.htmlSnippetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customCreativeAssets")] + public CustomCreativeAsset[] customCreativeAssets { + get { return this.customCreativeAssetsField; } + set { this.customCreativeAssetsField = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CustomCreativeAsset { + private string macroNameField; + + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + private long fileSizeField; + + private bool fileSizeFieldSpecified; + + public string macroName { + get { return this.macroNameField; } + set { this.macroNameField = value; } + } + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public long fileSize { + get { return this.fileSizeField; } + set { + this.fileSizeField = value; + this.fileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fileSizeSpecified { + get { return this.fileSizeFieldSpecified; } + set { this.fileSizeFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class BaseVideoCreative : HasDestinationUrlCreative { + private int durationField; + + private bool durationFieldSpecified; + + private bool allowDurationOverrideField; + + private bool allowDurationOverrideFieldSpecified; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private long[] companionCreativeIdsField; + + private string customParametersField; + + private string vastPreviewUrlField; + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public bool allowDurationOverride { + get { return this.allowDurationOverrideField; } + set { + this.allowDurationOverrideField = value; + this.allowDurationOverrideSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowDurationOverrideSpecified { + get { return this.allowDurationOverrideFieldSpecified; } + set { this.allowDurationOverrideFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class VideoRedirectCreative : BaseVideoCreative { + private VideoRedirectAsset[] videoAssetsField; + + [System.Xml.Serialization.XmlElementAttribute("videoAssets")] + public VideoRedirectAsset[] videoAssets { + get { return this.videoAssetsField; } + set { this.videoAssetsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class VideoRedirectAsset : RedirectAsset { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class RedirectAsset : Asset { + private string redirectUrlField; + + public string redirectUrl { + get { return this.redirectUrlField; } + set { this.redirectUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RedirectAsset))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class Asset { + private string assetTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Asset.Type")] + public string AssetType { + get { return this.assetTypeField; } + set { this.assetTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class VideoCreative : BaseVideoCreative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class BaseImageRedirectCreative : HasDestinationUrlCreative { + private string imageUrlField; + + public string imageUrl { + get { return this.imageUrlField; } + set { this.imageUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ImageRedirectOverlayCreative : BaseImageRedirectCreative { + private Size assetSizeField; + + private int durationField; + + private bool durationFieldSpecified; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private string vastPreviewUrlField; + + public Size assetSize { + get { return this.assetSizeField; } + set { this.assetSizeField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ImageRedirectCreative : BaseImageRedirectCreative { + private string altTextField; + + private string thirdPartyImpressionUrlField; + + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + public string thirdPartyImpressionUrl { + get { return this.thirdPartyImpressionUrlField; } + set { this.thirdPartyImpressionUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class BaseImageCreative : HasDestinationUrlCreative { + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private CreativeAsset primaryImageAssetField; + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public CreativeAsset primaryImageAsset { + get { return this.primaryImageAssetField; } + set { this.primaryImageAssetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CreativeAsset { + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + private long fileSizeField; + + private bool fileSizeFieldSpecified; + + private string assetUrlField; + + private Size sizeField; + + private ImageDensity imageDensityField; + + private bool imageDensityFieldSpecified; + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public long fileSize { + get { return this.fileSizeField; } + set { + this.fileSizeField = value; + this.fileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fileSizeSpecified { + get { return this.fileSizeFieldSpecified; } + set { this.fileSizeFieldSpecified = value; } + } + + public string assetUrl { + get { return this.assetUrlField; } + set { this.assetUrlField = value; } + } + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + public ImageDensity imageDensity { + get { return this.imageDensityField; } + set { + this.imageDensityField = value; + this.imageDensitySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool imageDensitySpecified { + get { return this.imageDensityFieldSpecified; } + set { this.imageDensityFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ImageDensity { + ONE_TO_ONE, + THREE_TO_TWO, + TWO_TO_ONE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ImageOverlayCreative : BaseImageCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + private string vastPreviewUrlField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ImageCreative : BaseImageCreative { + private string altTextField; + + private string thirdPartyImpressionUrlField; + + private CreativeAsset[] secondaryImageAssetsField; + + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + public string thirdPartyImpressionUrl { + get { return this.thirdPartyImpressionUrlField; } + set { this.thirdPartyImpressionUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryImageAssets")] + public CreativeAsset[] secondaryImageAssets { + get { return this.secondaryImageAssetsField; } + set { this.secondaryImageAssetsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class BaseFlashRedirectCreative : HasDestinationUrlCreative { + private string flashUrlField; + + private string fallbackUrlField; + + private string fallbackPreviewUrlField; + + public string flashUrl { + get { return this.flashUrlField; } + set { this.flashUrlField = value; } + } + + public string fallbackUrl { + get { return this.fallbackUrlField; } + set { this.fallbackUrlField = value; } + } + + public string fallbackPreviewUrl { + get { return this.fallbackPreviewUrlField; } + set { this.fallbackPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class FlashRedirectOverlayCreative : BaseFlashRedirectCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private ApiFramework apiFrameworkField; + + private bool apiFrameworkFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + private Size flashAssetSizeField; + + private string vastPreviewUrlField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public ApiFramework apiFramework { + get { return this.apiFrameworkField; } + set { + this.apiFrameworkField = value; + this.apiFrameworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool apiFrameworkSpecified { + get { return this.apiFrameworkFieldSpecified; } + set { this.apiFrameworkFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ApiFramework { + NONE, + CLICKTAG, + VPAID + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class FlashRedirectCreative : BaseFlashRedirectCreative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class BaseFlashCreative : HasDestinationUrlCreative { + private string flashNameField; + + private byte[] flashByteArrayField; + + private string fallbackImageNameField; + + private byte[] fallbackImageByteArrayField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private bool clickTagRequiredField; + + private bool clickTagRequiredFieldSpecified; + + private string fallbackPreviewUrlField; + + private Size flashAssetSizeField; + + private Size fallbackAssetSizeField; + + public string flashName { + get { return this.flashNameField; } + set { this.flashNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] flashByteArray { + get { return this.flashByteArrayField; } + set { this.flashByteArrayField = value; } + } + + public string fallbackImageName { + get { return this.fallbackImageNameField; } + set { this.fallbackImageNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] fallbackImageByteArray { + get { return this.fallbackImageByteArrayField; } + set { this.fallbackImageByteArrayField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public bool clickTagRequired { + get { return this.clickTagRequiredField; } + set { + this.clickTagRequiredField = value; + this.clickTagRequiredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clickTagRequiredSpecified { + get { return this.clickTagRequiredFieldSpecified; } + set { this.clickTagRequiredFieldSpecified = value; } + } + + public string fallbackPreviewUrl { + get { return this.fallbackPreviewUrlField; } + set { this.fallbackPreviewUrlField = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + public Size fallbackAssetSize { + get { return this.fallbackAssetSizeField; } + set { this.fallbackAssetSizeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class FlashOverlayCreative : BaseFlashCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private ApiFramework apiFrameworkField; + + private bool apiFrameworkFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + private string vastPreviewUrlField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public ApiFramework apiFramework { + get { return this.apiFrameworkField; } + set { + this.apiFrameworkField = value; + this.apiFrameworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool apiFrameworkSpecified { + get { return this.apiFrameworkFieldSpecified; } + set { this.apiFrameworkFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class FlashCreative : BaseFlashCreative { + private SwiffyFallbackAsset swiffyAssetField; + + private bool createSwiffyAssetField; + + private bool createSwiffyAssetFieldSpecified; + + public SwiffyFallbackAsset swiffyAsset { + get { return this.swiffyAssetField; } + set { this.swiffyAssetField = value; } + } + + public bool createSwiffyAsset { + get { return this.createSwiffyAssetField; } + set { + this.createSwiffyAssetField = value; + this.createSwiffyAssetSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool createSwiffyAssetSpecified { + get { return this.createSwiffyAssetFieldSpecified; } + set { this.createSwiffyAssetFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class SwiffyFallbackAsset { + private CreativeAsset assetField; + + private Html5Feature[] html5FeaturesField; + + private string[] localizedInfoMessagesField; + + public CreativeAsset asset { + get { return this.assetField; } + set { this.assetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("html5Features")] + public Html5Feature[] html5Features { + get { return this.html5FeaturesField; } + set { this.html5FeaturesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("localizedInfoMessages")] + public string[] localizedInfoMessages { + get { return this.localizedInfoMessagesField; } + set { this.localizedInfoMessagesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum Html5Feature { + BASIC_SVG, + SVG_FILTERS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AspectRatioImageCreative : HasDestinationUrlCreative { + private CreativeAsset[] imageAssetsField; + + private string altTextField; + + private string thirdPartyImpressionUrlField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("imageAssets")] + public CreativeAsset[] imageAssets { + get { return this.imageAssetsField; } + set { this.imageAssetsField = value; } + } + + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + public string thirdPartyImpressionUrl { + get { return this.thirdPartyImpressionUrlField; } + set { this.thirdPartyImpressionUrlField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ClickTrackingCreative : Creative { + private string clickTrackingUrlField; + + public string clickTrackingUrl { + get { return this.clickTrackingUrlField; } + set { this.clickTrackingUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class BaseRichMediaStudioCreative : Creative { + private long studioCreativeIdField; + + private bool studioCreativeIdFieldSpecified; + + private RichMediaStudioCreativeFormat creativeFormatField; + + private bool creativeFormatFieldSpecified; + + private RichMediaStudioCreativeArtworkType artworkTypeField; + + private bool artworkTypeFieldSpecified; + + private long totalFileSizeField; + + private bool totalFileSizeFieldSpecified; + + private string[] adTagKeysField; + + private string[] customKeyValuesField; + + private string surveyUrlField; + + private string allImpressionsUrlField; + + private string richMediaImpressionsUrlField; + + private string backupImageImpressionsUrlField; + + private string overrideCssField; + + private string requiredFlashPluginVersionField; + + private int durationField; + + private bool durationFieldSpecified; + + private RichMediaStudioCreativeBillingAttribute billingAttributeField; + + private bool billingAttributeFieldSpecified; + + private RichMediaStudioChildAssetProperty[] richMediaStudioChildAssetPropertiesField; + + public long studioCreativeId { + get { return this.studioCreativeIdField; } + set { + this.studioCreativeIdField = value; + this.studioCreativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool studioCreativeIdSpecified { + get { return this.studioCreativeIdFieldSpecified; } + set { this.studioCreativeIdFieldSpecified = value; } + } + + public RichMediaStudioCreativeFormat creativeFormat { + get { return this.creativeFormatField; } + set { + this.creativeFormatField = value; + this.creativeFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeFormatSpecified { + get { return this.creativeFormatFieldSpecified; } + set { this.creativeFormatFieldSpecified = value; } + } + + public RichMediaStudioCreativeArtworkType artworkType { + get { return this.artworkTypeField; } + set { + this.artworkTypeField = value; + this.artworkTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool artworkTypeSpecified { + get { return this.artworkTypeFieldSpecified; } + set { this.artworkTypeFieldSpecified = value; } + } + + public long totalFileSize { + get { return this.totalFileSizeField; } + set { + this.totalFileSizeField = value; + this.totalFileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalFileSizeSpecified { + get { return this.totalFileSizeFieldSpecified; } + set { this.totalFileSizeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adTagKeys")] + public string[] adTagKeys { + get { return this.adTagKeysField; } + set { this.adTagKeysField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customKeyValues")] + public string[] customKeyValues { + get { return this.customKeyValuesField; } + set { this.customKeyValuesField = value; } + } + + public string surveyUrl { + get { return this.surveyUrlField; } + set { this.surveyUrlField = value; } + } + + public string allImpressionsUrl { + get { return this.allImpressionsUrlField; } + set { this.allImpressionsUrlField = value; } + } + + public string richMediaImpressionsUrl { + get { return this.richMediaImpressionsUrlField; } + set { this.richMediaImpressionsUrlField = value; } + } + + public string backupImageImpressionsUrl { + get { return this.backupImageImpressionsUrlField; } + set { this.backupImageImpressionsUrlField = value; } + } + + public string overrideCss { + get { return this.overrideCssField; } + set { this.overrideCssField = value; } + } + + public string requiredFlashPluginVersion { + get { return this.requiredFlashPluginVersionField; } + set { this.requiredFlashPluginVersionField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public RichMediaStudioCreativeBillingAttribute billingAttribute { + get { return this.billingAttributeField; } + set { + this.billingAttributeField = value; + this.billingAttributeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingAttributeSpecified { + get { return this.billingAttributeFieldSpecified; } + set { this.billingAttributeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("richMediaStudioChildAssetProperties")] + public RichMediaStudioChildAssetProperty[] richMediaStudioChildAssetProperties { + get { return this.richMediaStudioChildAssetPropertiesField; } + set { this.richMediaStudioChildAssetPropertiesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum RichMediaStudioCreativeFormat { + IN_PAGE, + EXPANDING, + IM_EXPANDING, + FLOATING, + PEEL_DOWN, + IN_PAGE_WITH_FLOATING, + FLASH_IN_FLASH, + FLASH_IN_FLASH_EXPANDING, + IN_APP, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum RichMediaStudioCreativeArtworkType { + FLASH, + HTML5, + MIXED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum RichMediaStudioCreativeBillingAttribute { + IN_PAGE, + FLOATING_EXPANDING, + VIDEO, + FLASH_IN_FLASH + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RichMediaStudioChildAssetProperty { + private string nameField; + + private RichMediaStudioChildAssetPropertyType typeField; + + private bool typeFieldSpecified; + + private long totalFileSizeField; + + private bool totalFileSizeFieldSpecified; + + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + private string urlField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public RichMediaStudioChildAssetPropertyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public long totalFileSize { + get { return this.totalFileSizeField; } + set { + this.totalFileSizeField = value; + this.totalFileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalFileSizeSpecified { + get { return this.totalFileSizeFieldSpecified; } + set { this.totalFileSizeFieldSpecified = value; } + } + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaStudioChildAssetProperty.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum RichMediaStudioChildAssetPropertyType { + FLASH, + VIDEO, + IMAGE, + DATA + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RichMediaStudioCreative : BaseRichMediaStudioCreative { + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasHtmlSnippetDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdMobBackfillCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class BaseDynamicAllocationCreative : Creative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class HasHtmlSnippetDynamicAllocationCreative : BaseDynamicAllocationCreative { + private string codeSnippetField; + + public string codeSnippet { + get { return this.codeSnippetField; } + set { this.codeSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdSenseCreative : HasHtmlSnippetDynamicAllocationCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdExchangeCreative : HasHtmlSnippetDynamicAllocationCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class AdMobBackfillCreative : BaseDynamicAllocationCreative { + private string additionalParametersField; + + private string publisherIdField; + + public string additionalParameters { + get { return this.additionalParametersField; } + set { this.additionalParametersField = value; } + } + + public string publisherId { + get { return this.publisherIdField; } + set { this.publisherIdField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "BaseRateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class BaseRateService : DfpSoapClient, IBaseRateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public BaseRateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/BaseRateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRate[] createBaseRates([System.Xml.Serialization.XmlElementAttribute("baseRates")] +BaseRate[] baseRates) { + object[] results = this.Invoke("createBaseRates", new object[] { baseRates }); + return ((BaseRate[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRatePage getBaseRatesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getBaseRatesByStatement", new object[] { filterStatement }); + return ((BaseRatePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performBaseRateAction(BaseRateAction baseRateAction, Statement filterStatement) { + object[] results = this.Invoke("performBaseRateAction", new object[] { baseRateAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRate[] updateBaseRates([System.Xml.Serialization.XmlElementAttribute("baseRates")] +BaseRate[] baseRates) { + object[] results = this.Invoke("updateBaseRates", new object[] { baseRates }); + return ((BaseRate[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateBaseRates))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateBaseRates))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class BaseRateAction { + private string baseRateActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("BaseRateAction.Type")] + public string BaseRateActionType { + get { return this.baseRateActionTypeField; } + set { this.baseRateActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeactivateBaseRates : BaseRateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ActivateBaseRates : BaseRateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class BaseRatePage { + private BaseRate[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public BaseRate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnknownBaseRate))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductTemplateBaseRate))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductBaseRate))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class BaseRate { + private long rateCardIdField; + + private bool rateCardIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private BaseRateStatus statusField; + + private bool statusFieldSpecified; + + private string baseRateTypeField; + + public long rateCardId { + get { return this.rateCardIdField; } + set { + this.rateCardIdField = value; + this.rateCardIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardIdSpecified { + get { return this.rateCardIdFieldSpecified; } + set { this.rateCardIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public BaseRateStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseRate.Type")] + public string BaseRateType { + get { return this.baseRateTypeField; } + set { this.baseRateTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum BaseRateStatus { + ACTIVE, + INACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class UnknownBaseRate : BaseRate { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ProductTemplateBaseRate : BaseRate { + private long productTemplateIdField; + + private bool productTemplateIdFieldSpecified; + + private Money rateField; + + public long productTemplateId { + get { return this.productTemplateIdField; } + set { + this.productTemplateIdField = value; + this.productTemplateIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productTemplateIdSpecified { + get { return this.productTemplateIdFieldSpecified; } + set { this.productTemplateIdFieldSpecified = value; } + } + + public Money rate { + get { return this.rateField; } + set { this.rateField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ProductBaseRate : BaseRate { + private string productIdField; + + private Money rateField; + + public string productId { + get { return this.productIdField; } + set { this.productIdField = value; } + } + + public Money rate { + get { return this.rateField; } + set { this.rateField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class BaseRateActionError : ApiError { + private BaseRateActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BaseRateActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BaseRateActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum BaseRateActionErrorReason { + DUPLICATED_BASE_RATES, + ACTIVE_BASE_RATE_ALREADY_EXISTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ExchangeRateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ExchangeRateService : DfpSoapClient, IExchangeRateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ExchangeRateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/ExchangeRateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExchangeRate[] createExchangeRates([System.Xml.Serialization.XmlElementAttribute("exchangeRates")] +ExchangeRate[] exchangeRates) { + object[] results = this.Invoke("createExchangeRates", new object[] { exchangeRates }); + return ((ExchangeRate[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExchangeRatePage getExchangeRatesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getExchangeRatesByStatement", new object[] { filterStatement }); + return ((ExchangeRatePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performExchangeRateAction(ExchangeRateAction exchangeRateAction, Statement filterStatement) { + object[] results = this.Invoke("performExchangeRateAction", new object[] { exchangeRateAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExchangeRate[] updateExchangeRates([System.Xml.Serialization.XmlElementAttribute("exchangeRates")] +ExchangeRate[] exchangeRates) { + object[] results = this.Invoke("updateExchangeRates", new object[] { exchangeRates }); + return ((ExchangeRate[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteExchangeRates))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class ExchangeRateAction { + private string exchangeRateActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ExchangeRateAction.Type")] + public string ExchangeRateActionType { + get { return this.exchangeRateActionTypeField; } + set { this.exchangeRateActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeleteExchangeRates : ExchangeRateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ExchangeRatePage { + private ExchangeRate[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ExchangeRate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ExchangeRate { + private long idField; + + private bool idFieldSpecified; + + private string currencyCodeField; + + private ExchangeRateRefreshRate refreshRateField; + + private bool refreshRateFieldSpecified; + + private ExchangeRateDirection directionField; + + private bool directionFieldSpecified; + + private long exchangeRateField; + + private bool exchangeRateFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public ExchangeRateRefreshRate refreshRate { + get { return this.refreshRateField; } + set { + this.refreshRateField = value; + this.refreshRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool refreshRateSpecified { + get { return this.refreshRateFieldSpecified; } + set { this.refreshRateFieldSpecified = value; } + } + + public ExchangeRateDirection direction { + get { return this.directionField; } + set { + this.directionField = value; + this.directionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool directionSpecified { + get { return this.directionFieldSpecified; } + set { this.directionFieldSpecified = value; } + } + + public long exchangeRate { + get { return this.exchangeRateField; } + set { + this.exchangeRateField = value; + this.exchangeRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool exchangeRateSpecified { + get { return this.exchangeRateFieldSpecified; } + set { this.exchangeRateFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ExchangeRateRefreshRate { + FIXED, + DAILY, + MONTHLY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ExchangeRateDirection { + TO_NETWORK, + FROM_NETWORK, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "OrderServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class OrderService : DfpSoapClient, IOrderService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public OrderService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/OrderService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Order[] createOrders([System.Xml.Serialization.XmlElementAttribute("orders")] +Order[] orders) { + object[] results = this.Invoke("createOrders", new object[] { orders }); + return ((Order[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual OrderPage getOrdersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getOrdersByStatement", new object[] { filterStatement }); + return ((OrderPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performOrderAction(OrderAction orderAction, Statement filterStatement) { + object[] results = this.Invoke("performOrderAction", new object[] { orderAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Order[] updateOrders([System.Xml.Serialization.XmlElementAttribute("orders")] +Order[] orders) { + object[] results = this.Invoke("updateOrders", new object[] { orders }); + return ((Order[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApproval))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalAndOverbook))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RetractOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RetractOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PauseOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DisapproveOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DisapproveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class OrderAction { + private string orderActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("OrderAction.Type")] + public string OrderActionType { + get { return this.orderActionTypeField; } + set { this.orderActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class UnarchiveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class SubmitOrdersForApprovalWithoutReservationChanges : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalAndOverbook))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class SubmitOrdersForApproval : OrderAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class SubmitOrdersForApprovalAndOverbook : SubmitOrdersForApproval { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RetractOrdersWithoutReservationChanges : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RetractOrders : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ResumeOrders : OrderAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ResumeAndOverbookOrders : ResumeOrders { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class PauseOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DisapproveOrdersWithoutReservationChanges : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DisapproveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeleteOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ArchiveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ApproveOrdersWithoutReservationChanges : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ApproveOrders : OrderAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ApproveAndOverbookOrders : ApproveOrders { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class OrderPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Order[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Order[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Order { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private OrderStatus statusField; + + private bool statusFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private string notesField; + + private int externalOrderIdField; + + private bool externalOrderIdFieldSpecified; + + private string poNumberField; + + private string currencyCodeField; + + private long advertiserIdField; + + private bool advertiserIdFieldSpecified; + + private long[] advertiserContactIdsField; + + private long agencyIdField; + + private bool agencyIdFieldSpecified; + + private long[] agencyContactIdsField; + + private long creatorIdField; + + private bool creatorIdFieldSpecified; + + private long traffickerIdField; + + private bool traffickerIdFieldSpecified; + + private long[] secondaryTraffickerIdsField; + + private long salespersonIdField; + + private bool salespersonIdFieldSpecified; + + private long[] secondarySalespersonIdsField; + + private long totalImpressionsDeliveredField; + + private bool totalImpressionsDeliveredFieldSpecified; + + private long totalClicksDeliveredField; + + private bool totalClicksDeliveredFieldSpecified; + + private Money totalBudgetField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private string lastModifiedByAppField; + + private long[] appliedTeamIdsField; + + private DateTime lastModifiedDateTimeField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public OrderStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public int externalOrderId { + get { return this.externalOrderIdField; } + set { + this.externalOrderIdField = value; + this.externalOrderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool externalOrderIdSpecified { + get { return this.externalOrderIdFieldSpecified; } + set { this.externalOrderIdFieldSpecified = value; } + } + + public string poNumber { + get { return this.poNumberField; } + set { this.poNumberField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public long advertiserId { + get { return this.advertiserIdField; } + set { + this.advertiserIdField = value; + this.advertiserIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserIdSpecified { + get { return this.advertiserIdFieldSpecified; } + set { this.advertiserIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("advertiserContactIds")] + public long[] advertiserContactIds { + get { return this.advertiserContactIdsField; } + set { this.advertiserContactIdsField = value; } + } + + public long agencyId { + get { return this.agencyIdField; } + set { + this.agencyIdField = value; + this.agencyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool agencyIdSpecified { + get { return this.agencyIdFieldSpecified; } + set { this.agencyIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("agencyContactIds")] + public long[] agencyContactIds { + get { return this.agencyContactIdsField; } + set { this.agencyContactIdsField = value; } + } + + public long creatorId { + get { return this.creatorIdField; } + set { + this.creatorIdField = value; + this.creatorIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creatorIdSpecified { + get { return this.creatorIdFieldSpecified; } + set { this.creatorIdFieldSpecified = value; } + } + + public long traffickerId { + get { return this.traffickerIdField; } + set { + this.traffickerIdField = value; + this.traffickerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool traffickerIdSpecified { + get { return this.traffickerIdFieldSpecified; } + set { this.traffickerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryTraffickerIds")] + public long[] secondaryTraffickerIds { + get { return this.secondaryTraffickerIdsField; } + set { this.secondaryTraffickerIdsField = value; } + } + + public long salespersonId { + get { return this.salespersonIdField; } + set { + this.salespersonIdField = value; + this.salespersonIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool salespersonIdSpecified { + get { return this.salespersonIdFieldSpecified; } + set { this.salespersonIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondarySalespersonIds")] + public long[] secondarySalespersonIds { + get { return this.secondarySalespersonIdsField; } + set { this.secondarySalespersonIdsField = value; } + } + + public long totalImpressionsDelivered { + get { return this.totalImpressionsDeliveredField; } + set { + this.totalImpressionsDeliveredField = value; + this.totalImpressionsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalImpressionsDeliveredSpecified { + get { return this.totalImpressionsDeliveredFieldSpecified; } + set { this.totalImpressionsDeliveredFieldSpecified = value; } + } + + public long totalClicksDelivered { + get { return this.totalClicksDeliveredField; } + set { + this.totalClicksDeliveredField = value; + this.totalClicksDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalClicksDeliveredSpecified { + get { return this.totalClicksDeliveredFieldSpecified; } + set { this.totalClicksDeliveredFieldSpecified = value; } + } + + public Money totalBudget { + get { return this.totalBudgetField; } + set { this.totalBudgetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public string lastModifiedByApp { + get { return this.lastModifiedByAppField; } + set { this.lastModifiedByAppField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum OrderStatus { + DRAFT, + PENDING_APPROVAL, + APPROVED, + DISAPPROVED, + PAUSED, + CANCELED, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class OrderActionError : ApiError { + private OrderActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OrderActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OrderActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum OrderActionErrorReason { + PERMISSION_DENIED, + NOT_APPLICABLE, + IS_ARCHIVED, + HAS_ENDED, + CANNOT_APPROVE_WITH_UNRESERVED_LINE_ITEMS, + CANNOT_DELETE_ORDER_WITH_DELIVERED_LINEITEMS, + CANNOT_APPROVE_COMPANY_CREDIT_STATUS_NOT_ACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomFieldServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomFieldService : DfpSoapClient, ICustomFieldService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomFieldService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/CustomFieldService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldOption[] createCustomFieldOptions([System.Xml.Serialization.XmlElementAttribute("customFieldOptions")] +CustomFieldOption[] customFieldOptions) { + object[] results = this.Invoke("createCustomFieldOptions", new object[] { customFieldOptions }); + return ((CustomFieldOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomField[] createCustomFields([System.Xml.Serialization.XmlElementAttribute("customFields")] +CustomField[] customFields) { + object[] results = this.Invoke("createCustomFields", new object[] { customFields }); + return ((CustomField[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldOption getCustomFieldOption(long customFieldOptionId) { + object[] results = this.Invoke("getCustomFieldOption", new object[] { customFieldOptionId }); + return ((CustomFieldOption) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldPage getCustomFieldsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomFieldsByStatement", new object[] { filterStatement }); + return ((CustomFieldPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performCustomFieldAction(CustomFieldAction customFieldAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomFieldAction", new object[] { customFieldAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldOption[] updateCustomFieldOptions([System.Xml.Serialization.XmlElementAttribute("customFieldOptions")] +CustomFieldOption[] customFieldOptions) { + object[] results = this.Invoke("updateCustomFieldOptions", new object[] { customFieldOptions }); + return ((CustomFieldOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomField[] updateCustomFields([System.Xml.Serialization.XmlElementAttribute("customFields")] +CustomField[] customFields) { + object[] results = this.Invoke("updateCustomFields", new object[] { customFields }); + return ((CustomField[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateCustomFields))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateCustomFields))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CustomFieldAction { + private string customFieldActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomFieldAction.Type")] + public string CustomFieldActionType { + get { return this.customFieldActionTypeField; } + set { this.customFieldActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeactivateCustomFields : CustomFieldAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ActivateCustomFields : CustomFieldAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CustomFieldPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomField[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomField[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DropDownCustomField))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CustomField { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private CustomFieldEntityType entityTypeField; + + private bool entityTypeFieldSpecified; + + private CustomFieldDataType dataTypeField; + + private bool dataTypeFieldSpecified; + + private CustomFieldVisibility visibilityField; + + private bool visibilityFieldSpecified; + + private string customFieldTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + public CustomFieldEntityType entityType { + get { return this.entityTypeField; } + set { + this.entityTypeField = value; + this.entityTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool entityTypeSpecified { + get { return this.entityTypeFieldSpecified; } + set { this.entityTypeFieldSpecified = value; } + } + + public CustomFieldDataType dataType { + get { return this.dataTypeField; } + set { + this.dataTypeField = value; + this.dataTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dataTypeSpecified { + get { return this.dataTypeFieldSpecified; } + set { this.dataTypeFieldSpecified = value; } + } + + public CustomFieldVisibility visibility { + get { return this.visibilityField; } + set { + this.visibilityField = value; + this.visibilitySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool visibilitySpecified { + get { return this.visibilityFieldSpecified; } + set { this.visibilityFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("CustomField.Type")] + public string CustomFieldType { + get { return this.customFieldTypeField; } + set { this.customFieldTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CustomFieldEntityType { + LINE_ITEM, + ORDER, + CREATIVE, + PRODUCT_TEMPLATE, + PRODUCT, + PROPOSAL, + PROPOSAL_LINE_ITEM, + USER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CustomFieldDataType { + STRING, + NUMBER, + TOGGLE, + DROP_DOWN, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CustomFieldVisibility { + API_ONLY, + READ_ONLY, + FULL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DropDownCustomField : CustomField { + private CustomFieldOption[] optionsField; + + [System.Xml.Serialization.XmlElementAttribute("options")] + public CustomFieldOption[] options { + get { return this.optionsField; } + set { this.optionsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CustomFieldOption { + private long idField; + + private bool idFieldSpecified; + + private long customFieldIdField; + + private bool customFieldIdFieldSpecified; + + private string displayNameField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long customFieldId { + get { return this.customFieldIdField; } + set { + this.customFieldIdField = value; + this.customFieldIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldIdSpecified { + get { return this.customFieldIdFieldSpecified; } + set { this.customFieldIdFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CustomFieldError : ApiError { + private CustomFieldErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomFieldErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomFieldError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CustomFieldErrorReason { + INVALID_CUSTOM_FIELD_FOR_OPTION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReconciliationReportRowServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReconciliationReportRowService : DfpSoapClient, IReconciliationReportRowService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReconciliationReportRowService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/ReconciliationReportRowService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReportRowPage getReconciliationReportRowsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getReconciliationReportRowsByStatement", new object[] { filterStatement }); + return ((ReconciliationReportRowPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReportRow[] updateReconciliationReportRows([System.Xml.Serialization.XmlElementAttribute("reconciliationReportRows")] +ReconciliationReportRow[] reconciliationReportRows) { + object[] results = this.Invoke("updateReconciliationReportRows", new object[] { reconciliationReportRows }); + return ((ReconciliationReportRow[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ReconciliationReportRow { + private long reconciliationReportIdField; + + private bool reconciliationReportIdFieldSpecified; + + private long lineItemIdField; + + private bool lineItemIdFieldSpecified; + + private long creativeIdField; + + private bool creativeIdFieldSpecified; + + private long orderIdField; + + private bool orderIdFieldSpecified; + + private long advertiserIdField; + + private bool advertiserIdFieldSpecified; + + private BillFrom billFromField; + + private bool billFromFieldSpecified; + + private RateType rateTypeField; + + private bool rateTypeFieldSpecified; + + private Money lineItemCostPerUnitField; + + private long lineItemContractedUnitsBoughtField; + + private bool lineItemContractedUnitsBoughtFieldSpecified; + + private long dfpVolumeField; + + private bool dfpVolumeFieldSpecified; + + private long thirdPartyVolumeField; + + private bool thirdPartyVolumeFieldSpecified; + + private long manualVolumeField; + + private bool manualVolumeFieldSpecified; + + private long reconciledVolumeField; + + private bool reconciledVolumeFieldSpecified; + + private Money contractedRevenueField; + + private Money dfpRevenueField; + + private Money thirdPartyRevenueField; + + private Money manualRevenueField; + + private Money reconciledRevenueField; + + private string commentsField; + + public long reconciliationReportId { + get { return this.reconciliationReportIdField; } + set { + this.reconciliationReportIdField = value; + this.reconciliationReportIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reconciliationReportIdSpecified { + get { return this.reconciliationReportIdFieldSpecified; } + set { this.reconciliationReportIdFieldSpecified = value; } + } + + public long lineItemId { + get { return this.lineItemIdField; } + set { + this.lineItemIdField = value; + this.lineItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemIdSpecified { + get { return this.lineItemIdFieldSpecified; } + set { this.lineItemIdFieldSpecified = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { + this.creativeIdField = value; + this.creativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeIdSpecified { + get { return this.creativeIdFieldSpecified; } + set { this.creativeIdFieldSpecified = value; } + } + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public long advertiserId { + get { return this.advertiserIdField; } + set { + this.advertiserIdField = value; + this.advertiserIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserIdSpecified { + get { return this.advertiserIdFieldSpecified; } + set { this.advertiserIdFieldSpecified = value; } + } + + public BillFrom billFrom { + get { return this.billFromField; } + set { + this.billFromField = value; + this.billFromSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billFromSpecified { + get { return this.billFromFieldSpecified; } + set { this.billFromFieldSpecified = value; } + } + + public RateType rateType { + get { return this.rateTypeField; } + set { + this.rateTypeField = value; + this.rateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateTypeSpecified { + get { return this.rateTypeFieldSpecified; } + set { this.rateTypeFieldSpecified = value; } + } + + public Money lineItemCostPerUnit { + get { return this.lineItemCostPerUnitField; } + set { this.lineItemCostPerUnitField = value; } + } + + public long lineItemContractedUnitsBought { + get { return this.lineItemContractedUnitsBoughtField; } + set { + this.lineItemContractedUnitsBoughtField = value; + this.lineItemContractedUnitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemContractedUnitsBoughtSpecified { + get { return this.lineItemContractedUnitsBoughtFieldSpecified; } + set { this.lineItemContractedUnitsBoughtFieldSpecified = value; } + } + + public long dfpVolume { + get { return this.dfpVolumeField; } + set { + this.dfpVolumeField = value; + this.dfpVolumeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dfpVolumeSpecified { + get { return this.dfpVolumeFieldSpecified; } + set { this.dfpVolumeFieldSpecified = value; } + } + + public long thirdPartyVolume { + get { return this.thirdPartyVolumeField; } + set { + this.thirdPartyVolumeField = value; + this.thirdPartyVolumeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyVolumeSpecified { + get { return this.thirdPartyVolumeFieldSpecified; } + set { this.thirdPartyVolumeFieldSpecified = value; } + } + + public long manualVolume { + get { return this.manualVolumeField; } + set { + this.manualVolumeField = value; + this.manualVolumeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manualVolumeSpecified { + get { return this.manualVolumeFieldSpecified; } + set { this.manualVolumeFieldSpecified = value; } + } + + public long reconciledVolume { + get { return this.reconciledVolumeField; } + set { + this.reconciledVolumeField = value; + this.reconciledVolumeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reconciledVolumeSpecified { + get { return this.reconciledVolumeFieldSpecified; } + set { this.reconciledVolumeFieldSpecified = value; } + } + + public Money contractedRevenue { + get { return this.contractedRevenueField; } + set { this.contractedRevenueField = value; } + } + + public Money dfpRevenue { + get { return this.dfpRevenueField; } + set { this.dfpRevenueField = value; } + } + + public Money thirdPartyRevenue { + get { return this.thirdPartyRevenueField; } + set { this.thirdPartyRevenueField = value; } + } + + public Money manualRevenue { + get { return this.manualRevenueField; } + set { this.manualRevenueField = value; } + } + + public Money reconciledRevenue { + get { return this.reconciledRevenueField; } + set { this.reconciledRevenueField = value; } + } + + public string comments { + get { return this.commentsField; } + set { this.commentsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum BillFrom { + DEFAULT, + DFP, + THIRD_PARTY, + MANUAL, + CONTRACTED_GOAL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ReconciliationReportRowPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ReconciliationReportRow[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ReconciliationReportRow[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ReconciliationImportError : ApiError { + private ReconciliationImportErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReconciliationImportErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReconciliationImportError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ReconciliationImportErrorReason { + MISSING_EDITABLE_COLUMN, + INCONSISTENT_IMPORT_COLUMNS, + ILLEGAL_CONVERTION, + INCONSISTENT_COLUMNS_COUNT, + IMPORT_INTERNAL_ERROR, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProductTemplateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProductTemplateService : DfpSoapClient, IProductTemplateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProductTemplateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/ProductTemplateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplate[] createProductTemplates([System.Xml.Serialization.XmlElementAttribute("productTemplates")] +ProductTemplate[] productTemplates) { + object[] results = this.Invoke("createProductTemplates", new object[] { productTemplates }); + return ((ProductTemplate[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplatePage getProductTemplatesByStatement(Statement statement) { + object[] results = this.Invoke("getProductTemplatesByStatement", new object[] { statement }); + return ((ProductTemplatePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performProductTemplateAction(ProductTemplateAction action, Statement filterStatement) { + object[] results = this.Invoke("performProductTemplateAction", new object[] { action, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplate[] updateProductTemplates([System.Xml.Serialization.XmlElementAttribute("productTemplates")] +ProductTemplate[] productTemplates) { + object[] results = this.Invoke("updateProductTemplates", new object[] { productTemplates }); + return ((ProductTemplate[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateProductTemplates))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveProducTemplates))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateProductTemplates))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class ProductTemplateAction { + private string productTemplateActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProductTemplateAction.Type")] + public string ProductTemplateActionType { + get { return this.productTemplateActionTypeField; } + set { this.productTemplateActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeactivateProductTemplates : ProductTemplateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ArchiveProducTemplates : ProductTemplateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ActivateProductTemplates : ProductTemplateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ProductTemplatePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ProductTemplate[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ProductTemplate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ProductTemplate { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private DateTime creationDateTimeField; + + private DateTime lastModifiedDateTimeField; + + private string descriptionField; + + private string nameMacroField; + + private ProductTemplateStatus statusField; + + private bool statusFieldSpecified; + + private ProductType productTypeField; + + private bool productTypeFieldSpecified; + + private long creatorIdField; + + private bool creatorIdFieldSpecified; + + private RateType rateTypeField; + + private bool rateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int priorityField; + + private bool priorityFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private bool allowFrequencyCapsCustomizationField; + + private bool allowFrequencyCapsCustomizationFieldSpecified; + + private ProductSegmentation productSegmentationField; + + private ProductTemplateTargeting targetingField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DateTime creationDateTime { + get { return this.creationDateTimeField; } + set { this.creationDateTimeField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public string nameMacro { + get { return this.nameMacroField; } + set { this.nameMacroField = value; } + } + + public ProductTemplateStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ProductType productType { + get { return this.productTypeField; } + set { + this.productTypeField = value; + this.productTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productTypeSpecified { + get { return this.productTypeFieldSpecified; } + set { this.productTypeFieldSpecified = value; } + } + + public long creatorId { + get { return this.creatorIdField; } + set { + this.creatorIdField = value; + this.creatorIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creatorIdSpecified { + get { return this.creatorIdFieldSpecified; } + set { this.creatorIdFieldSpecified = value; } + } + + public RateType rateType { + get { return this.rateTypeField; } + set { + this.rateTypeField = value; + this.rateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateTypeSpecified { + get { return this.rateTypeFieldSpecified; } + set { this.rateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public bool allowFrequencyCapsCustomization { + get { return this.allowFrequencyCapsCustomizationField; } + set { + this.allowFrequencyCapsCustomizationField = value; + this.allowFrequencyCapsCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowFrequencyCapsCustomizationSpecified { + get { return this.allowFrequencyCapsCustomizationFieldSpecified; } + set { this.allowFrequencyCapsCustomizationFieldSpecified = value; } + } + + public ProductSegmentation productSegmentation { + get { return this.productSegmentationField; } + set { this.productSegmentationField = value; } + } + + public ProductTemplateTargeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ProductTemplateStatus { + ACTIVE, + DRAFT, + CANCELED, + ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ProductSegmentation { + private GeoTargeting geoSegmentField; + + private AdUnitTargeting[] adUnitSegmentsField; + + private long[] placementSegmentField; + + private CustomCriteria[] customTargetingSegmentField; + + private UserDomainTargeting userDomainSegmentField; + + private BandwidthGroupTargeting bandwidthSegmentField; + + private BrowserTargeting browserSegmentField; + + private BrowserLanguageTargeting browserLanguageSegmentField; + + private OperatingSystemTargeting operatingSystemSegmentField; + + public GeoTargeting geoSegment { + get { return this.geoSegmentField; } + set { this.geoSegmentField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adUnitSegments")] + public AdUnitTargeting[] adUnitSegments { + get { return this.adUnitSegmentsField; } + set { this.adUnitSegmentsField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("targetedPlacementIds", IsNullable = false)] + public long[] placementSegment { + get { return this.placementSegmentField; } + set { this.placementSegmentField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customTargetingSegment")] + public CustomCriteria[] customTargetingSegment { + get { return this.customTargetingSegmentField; } + set { this.customTargetingSegmentField = value; } + } + + public UserDomainTargeting userDomainSegment { + get { return this.userDomainSegmentField; } + set { this.userDomainSegmentField = value; } + } + + public BandwidthGroupTargeting bandwidthSegment { + get { return this.bandwidthSegmentField; } + set { this.bandwidthSegmentField = value; } + } + + public BrowserTargeting browserSegment { + get { return this.browserSegmentField; } + set { this.browserSegmentField = value; } + } + + public BrowserLanguageTargeting browserLanguageSegment { + get { return this.browserLanguageSegmentField; } + set { this.browserLanguageSegmentField = value; } + } + + public OperatingSystemTargeting operatingSystemSegment { + get { return this.operatingSystemSegmentField; } + set { this.operatingSystemSegmentField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ProductTemplateError : ApiError { + private ProductTemplateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProductTemplateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductTemplateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ProductTemplateErrorReason { + INVALID_FEATURE_EXPANDED_EXCLUSIVE, + INVALID_EXPANDED_FEATURE_DEFAULT_NOT_TARGETED, + INVALID_EXPANDED_FEATURE_DEFAULT_LOCKED, + INVALID_EXPANDED_FEATURE_VALUE_TARGETED, + INVALID_EXPANDED_FEATURE_VALUE_LOCKED, + INVALID_FEATURE_TYPE, + INVALID_ROADBLOCKING_TYPE, + INVALID_TARGETING, + INVALID_FREQUENCY_CAPS, + INVALID_TECHNOLOGY_INCLUDE_EXCLUDE, + INVALID_EXPANDED_PRODUCT_COUNT, + INVALID_TARGET_PLATFORM, + INVALID_NON_TARGETING_FEATURE, + INVALID_FEATURE_CARDINALITY_AT_LEAST_ONE, + INVALID_FEATURE_CARDINALITY_AT_MOST_ONE, + INVALID_FEATURE_CARDINALITY_EXACTLY_ONE, + INVALID_FEATURE_FOR_OFFLINE, + INVALID_RATE_TYPE_FOR_OFFLINE, + INVALID_RATE_TYPE_FOR_DFP, + INVALID_LINE_ITEM_PRIORITY, + INVALID_LINE_ITEM_TYPE, + DUPLICATED_PLACEHOLDER_IN_NAMEMACRO, + INVALID_EXPANDED_FEATURE_IN_NON_EXPANDABLE_AFFINITY, + INVALID_FEATURE_DEFAULT_TARGET_TYPE, + INVALID_FEATURE_VALUE_TARGET_TYPE, + INVALID_FEATURE_AND_VALUE_LOCK_EXCLUSIVE, + DUPLICATED_FEATURE, + DUPLICATED_CUSTOM_TARGETING_KEY, + DUPLICATED_CUSTOM_TARGETING_VALUE, + INVALID_CUSTOM_TARGETING_KEY_ID, + INVALID_CUSTOM_TARGETING_VALUE_ID, + MISSING_CUSTOM_TARGETING_VALUES, + LOCATION_CANNOT_BE_TARGETED_IF_PARENT_IS_TARGETED, + LOCATION_CANNOT_BE_EXCLUDED_IF_PARENT_IS_EXCLUDED, + LOCATION_CANNOT_BE_EXCLUDED_DIRECTLY_WHEN_HAVE_TARGETED_LOCATION, + CUSTOMIZABLE_CUSTOM_KEY_CANNOT_BE_SEGMENTED, + CUSTOM_KEY_USED_IN_TARGETING_CANNOT_BE_SEGMENTED, + DUPLICATED_FEATURE_VALUE, + MISSING_EXPANDED_FEATURE_PLACEHOLDER_IN_NAMEMACRO, + MISSING_FEATURE_VALUE_OF_NAMEMACRO_PLACEHOLDER, + MISSING_FEATURE_OF_NAMEMACRO_PLACEHOLDER, + MISSING_SUBTYPE_FOR_CUSTOM_TARGETING, + COMPANION_NOT_ALLOWED, + MISSING_COMPANION, + DUPLICATED_MASTER_SIZE, + CANNOT_MODIFY_READONLY_FEATURE, + CANNOT_MODIFY_PRODUCT_TYPE, + CANNOT_ADD_SEGMENTATION, + CANNOT_REMOVE_SEGMENTATION, + CANNOT_REMOVE_VALUE_FROM_SEGMENTATION, + CANNOT_ADD_FEATURE_VALUE_FOR_CUSTOM_TARGETING, + CANNOT_MODIFY_BUILTIN_TARGETING_FEATURE, + CANNOT_UPDATE_ARCHIVED_PRODUCT_TEMPLATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ProductTemplateActionError : ApiError { + private ProductTemplateActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProductTemplateActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductTemplateActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ProductTemplateActionErrorReason { + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReconciliationReportServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReconciliationReportService : DfpSoapClient, IReconciliationReportService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReconciliationReportService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/ReconciliationReportService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReportPage getReconciliationReportsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getReconciliationReportsByStatement", new object[] { filterStatement }); + return ((ReconciliationReportPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReport[] updateReconciliationReports([System.Xml.Serialization.XmlElementAttribute("reconciliationReports")] +ReconciliationReport[] reconciliationReports) { + object[] results = this.Invoke("updateReconciliationReports", new object[] { reconciliationReports }); + return ((ReconciliationReport[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ReconciliationReport { + private long idField; + + private bool idFieldSpecified; + + private ReconciliationReportStatus statusField; + + private bool statusFieldSpecified; + + private Date startDateField; + + private string notesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public ReconciliationReportStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public Date startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ReconciliationReportStatus { + DRAFT, + RECONCILED, + REVERTED, + PENDING, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ReconciliationReportPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ReconciliationReport[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ReconciliationReport[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProposalServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProposalService : DfpSoapClient, IProposalService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProposalService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/ProposalService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Proposal[] createProposals([System.Xml.Serialization.XmlElementAttribute("proposals")] +Proposal[] proposals) { + object[] results = this.Invoke("createProposals", new object[] { proposals }); + return ((Proposal[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalPage getProposalsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getProposalsByStatement", new object[] { filterStatement }); + return ((ProposalPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performProposalAction(ProposalAction proposalAction, Statement filterStatement) { + object[] results = this.Invoke("performProposalAction", new object[] { proposalAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Proposal[] updateProposals([System.Xml.Serialization.XmlElementAttribute("proposals")] +Proposal[] proposals) { + object[] results = this.Invoke("updateProposals", new object[] { proposals }); + return ((Proposal[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveProposals))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitProposalsForApproval))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RetractProposals))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveProposals))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class ProposalAction { + private string proposalActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProposalAction.Type")] + public string ProposalActionType { + get { return this.proposalActionTypeField; } + set { this.proposalActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class UnarchiveProposals : ProposalAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class SubmitProposalsForApproval : ProposalAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RetractProposals : ProposalAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ArchiveProposals : ProposalAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ProposalPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Proposal[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Proposal[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Proposal { + private long idField; + + private bool idFieldSpecified; + + private long dfpOrderIdField; + + private bool dfpOrderIdFieldSpecified; + + private string nameField; + + private PricingModel pricingModelField; + + private bool pricingModelFieldSpecified; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + private ProposalStatus statusField; + + private bool statusFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private ProposalCompanyAssociation advertiserField; + + private ProposalCompanyAssociation[] agenciesField; + + private int probabilityToCloseField; + + private bool probabilityToCloseFieldSpecified; + + private BillingCap billingCapField; + + private bool billingCapFieldSpecified; + + private BillingSchedule billingScheduleField; + + private bool billingScheduleFieldSpecified; + + private BillingSource billingSourceField; + + private bool billingSourceFieldSpecified; + + private string poNumberField; + + private string notesField; + + private Money budgetField; + + private SalespersonSplit primarySalespersonField; + + private SalespersonSplit[] secondarySalespeopleField; + + private long[] salesPlannerIdsField; + + private long primaryTraffickerIdField; + + private bool primaryTraffickerIdFieldSpecified; + + private long[] secondaryTraffickerIdsField; + + private long[] appliedTeamIdsField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private long advertiserDiscountField; + + private bool advertiserDiscountFieldSpecified; + + private long proposalDiscountField; + + private bool proposalDiscountFieldSpecified; + + private Money additionalAdjustmentField; + + private string currencyCodeField; + + private long exchangeRateField; + + private bool exchangeRateFieldSpecified; + + private bool refreshExchangeRateField; + + private bool refreshExchangeRateFieldSpecified; + + private long agencyCommissionField; + + private bool agencyCommissionFieldSpecified; + + private long valueAddedTaxField; + + private bool valueAddedTaxFieldSpecified; + + private bool isSoldField; + + private bool isSoldFieldSpecified; + + private ProposalApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + private DateTime lastModifiedDateTimeField; + + private int thirdPartyAdServerIdField; + + private bool thirdPartyAdServerIdFieldSpecified; + + private string customThirdPartyAdServerNameField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long dfpOrderId { + get { return this.dfpOrderIdField; } + set { + this.dfpOrderIdField = value; + this.dfpOrderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dfpOrderIdSpecified { + get { return this.dfpOrderIdFieldSpecified; } + set { this.dfpOrderIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public PricingModel pricingModel { + get { return this.pricingModelField; } + set { + this.pricingModelField = value; + this.pricingModelSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool pricingModelSpecified { + get { return this.pricingModelFieldSpecified; } + set { this.pricingModelFieldSpecified = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public ProposalStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public ProposalCompanyAssociation advertiser { + get { return this.advertiserField; } + set { this.advertiserField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("agencies")] + public ProposalCompanyAssociation[] agencies { + get { return this.agenciesField; } + set { this.agenciesField = value; } + } + + public int probabilityToClose { + get { return this.probabilityToCloseField; } + set { + this.probabilityToCloseField = value; + this.probabilityToCloseSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool probabilityToCloseSpecified { + get { return this.probabilityToCloseFieldSpecified; } + set { this.probabilityToCloseFieldSpecified = value; } + } + + public BillingCap billingCap { + get { return this.billingCapField; } + set { + this.billingCapField = value; + this.billingCapSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingCapSpecified { + get { return this.billingCapFieldSpecified; } + set { this.billingCapFieldSpecified = value; } + } + + public BillingSchedule billingSchedule { + get { return this.billingScheduleField; } + set { + this.billingScheduleField = value; + this.billingScheduleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingScheduleSpecified { + get { return this.billingScheduleFieldSpecified; } + set { this.billingScheduleFieldSpecified = value; } + } + + public BillingSource billingSource { + get { return this.billingSourceField; } + set { + this.billingSourceField = value; + this.billingSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingSourceSpecified { + get { return this.billingSourceFieldSpecified; } + set { this.billingSourceFieldSpecified = value; } + } + + public string poNumber { + get { return this.poNumberField; } + set { this.poNumberField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public Money budget { + get { return this.budgetField; } + set { this.budgetField = value; } + } + + public SalespersonSplit primarySalesperson { + get { return this.primarySalespersonField; } + set { this.primarySalespersonField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondarySalespeople")] + public SalespersonSplit[] secondarySalespeople { + get { return this.secondarySalespeopleField; } + set { this.secondarySalespeopleField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("salesPlannerIds")] + public long[] salesPlannerIds { + get { return this.salesPlannerIdsField; } + set { this.salesPlannerIdsField = value; } + } + + public long primaryTraffickerId { + get { return this.primaryTraffickerIdField; } + set { + this.primaryTraffickerIdField = value; + this.primaryTraffickerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool primaryTraffickerIdSpecified { + get { return this.primaryTraffickerIdFieldSpecified; } + set { this.primaryTraffickerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryTraffickerIds")] + public long[] secondaryTraffickerIds { + get { return this.secondaryTraffickerIdsField; } + set { this.secondaryTraffickerIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public long advertiserDiscount { + get { return this.advertiserDiscountField; } + set { + this.advertiserDiscountField = value; + this.advertiserDiscountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserDiscountSpecified { + get { return this.advertiserDiscountFieldSpecified; } + set { this.advertiserDiscountFieldSpecified = value; } + } + + public long proposalDiscount { + get { return this.proposalDiscountField; } + set { + this.proposalDiscountField = value; + this.proposalDiscountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool proposalDiscountSpecified { + get { return this.proposalDiscountFieldSpecified; } + set { this.proposalDiscountFieldSpecified = value; } + } + + public Money additionalAdjustment { + get { return this.additionalAdjustmentField; } + set { this.additionalAdjustmentField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public long exchangeRate { + get { return this.exchangeRateField; } + set { + this.exchangeRateField = value; + this.exchangeRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool exchangeRateSpecified { + get { return this.exchangeRateFieldSpecified; } + set { this.exchangeRateFieldSpecified = value; } + } + + public bool refreshExchangeRate { + get { return this.refreshExchangeRateField; } + set { + this.refreshExchangeRateField = value; + this.refreshExchangeRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool refreshExchangeRateSpecified { + get { return this.refreshExchangeRateFieldSpecified; } + set { this.refreshExchangeRateFieldSpecified = value; } + } + + public long agencyCommission { + get { return this.agencyCommissionField; } + set { + this.agencyCommissionField = value; + this.agencyCommissionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool agencyCommissionSpecified { + get { return this.agencyCommissionFieldSpecified; } + set { this.agencyCommissionFieldSpecified = value; } + } + + public long valueAddedTax { + get { return this.valueAddedTaxField; } + set { + this.valueAddedTaxField = value; + this.valueAddedTaxSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueAddedTaxSpecified { + get { return this.valueAddedTaxFieldSpecified; } + set { this.valueAddedTaxFieldSpecified = value; } + } + + public bool isSold { + get { return this.isSoldField; } + set { + this.isSoldField = value; + this.isSoldSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isSoldSpecified { + get { return this.isSoldFieldSpecified; } + set { this.isSoldFieldSpecified = value; } + } + + public ProposalApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public int thirdPartyAdServerId { + get { return this.thirdPartyAdServerIdField; } + set { + this.thirdPartyAdServerIdField = value; + this.thirdPartyAdServerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyAdServerIdSpecified { + get { return this.thirdPartyAdServerIdFieldSpecified; } + set { this.thirdPartyAdServerIdFieldSpecified = value; } + } + + public string customThirdPartyAdServerName { + get { return this.customThirdPartyAdServerNameField; } + set { this.customThirdPartyAdServerNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum PricingModel { + NET, + GROSS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ProposalStatus { + DRAFT, + PENDING_APPROVAL, + APPROVED, + REJECTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ProposalCompanyAssociation { + private long companyIdField; + + private bool companyIdFieldSpecified; + + private ProposalCompanyAssociationType typeField; + + private bool typeFieldSpecified; + + private long[] contactIdsField; + + public long companyId { + get { return this.companyIdField; } + set { + this.companyIdField = value; + this.companyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companyIdSpecified { + get { return this.companyIdFieldSpecified; } + set { this.companyIdFieldSpecified = value; } + } + + public ProposalCompanyAssociationType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("contactIds")] + public long[] contactIds { + get { return this.contactIdsField; } + set { this.contactIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ProposalCompanyAssociationType { + PRIMARY_AGENCY, + BILLING_AGENCY, + BRANDING_AGENCY, + OTHER_AGENCY, + ADVERTISER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class SalespersonSplit { + private long userIdField; + + private bool userIdFieldSpecified; + + private int splitField; + + private bool splitFieldSpecified; + + public long userId { + get { return this.userIdField; } + set { + this.userIdField = value; + this.userIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userIdSpecified { + get { return this.userIdFieldSpecified; } + set { this.userIdFieldSpecified = value; } + } + + public int split { + get { return this.splitField; } + set { + this.splitField = value; + this.splitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool splitSpecified { + get { return this.splitFieldSpecified; } + set { this.splitFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ProposalApprovalStatus { + PENDING, + NON_PENDING, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class WorkflowActionError : ApiError { + private WorkflowActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public WorkflowActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "WorkflowActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum WorkflowActionErrorReason { + NOT_APPLICABLE, + WORKFLOW_DEFINITION_NOT_FOUND, + EMPTY_ACTION_LIST, + NOT_ACTION_APPROVER, + WORKFLOW_ALREADY_COMPLETED, + WORKFLOW_ALREADY_FAILED, + WORKFLOW_ALREADY_CANCELED, + ACTION_COMPLETED, + ACTION_FAILED, + ACTION_CANCELED, + ACTION_NOT_ACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ProposalActionError : ApiError { + private ProposalActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProposalActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProposalActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ProposalActionErrorReason { + NOT_APPLICABLE, + IS_ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LiveStreamEventServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LiveStreamEventService : DfpSoapClient, ILiveStreamEventService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LiveStreamEventService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/LiveStreamEventService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LiveStreamEvent[] createLiveStreamEvents([System.Xml.Serialization.XmlElementAttribute("liveStreamEvents")] +LiveStreamEvent[] liveStreamEvents) { + object[] results = this.Invoke("createLiveStreamEvents", new object[] { liveStreamEvents }); + return ((LiveStreamEvent[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LiveStreamEventPage getLiveStreamEventsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLiveStreamEventsByStatement", new object[] { filterStatement }); + return ((LiveStreamEventPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performLiveStreamEventAction(LiveStreamEventAction liveStreamEventAction, Statement filterStatement) { + object[] results = this.Invoke("performLiveStreamEventAction", new object[] { liveStreamEventAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LiveStreamEvent[] updateLiveStreamEvents([System.Xml.Serialization.XmlElementAttribute("liveStreamEvents")] +LiveStreamEvent[] liveStreamEvents) { + object[] results = this.Invoke("updateLiveStreamEvents", new object[] { liveStreamEvents }); + return ((LiveStreamEvent[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PauseLiveStreamEvents))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveLiveStreamEvents))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLiveStreamEvents))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class LiveStreamEventAction { + private string liveStreamEventActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LiveStreamEventAction.Type")] + public string LiveStreamEventActionType { + get { return this.liveStreamEventActionTypeField; } + set { this.liveStreamEventActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class PauseLiveStreamEvents : LiveStreamEventAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ArchiveLiveStreamEvents : LiveStreamEventAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ActivateLiveStreamEvents : LiveStreamEventAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LiveStreamEventPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LiveStreamEvent[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LiveStreamEvent[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LiveStreamEvent { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private LiveStreamEventStatus statusField; + + private bool statusFieldSpecified; + + private DateTime creationDateTimeField; + + private DateTime lastModifiedDateTimeField; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + private long totalEstimatedConcurrentUsersField; + + private bool totalEstimatedConcurrentUsersFieldSpecified; + + private string[] contentUrlsField; + + private string[] adTagsField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public LiveStreamEventStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public DateTime creationDateTime { + get { return this.creationDateTimeField; } + set { this.creationDateTimeField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public long totalEstimatedConcurrentUsers { + get { return this.totalEstimatedConcurrentUsersField; } + set { + this.totalEstimatedConcurrentUsersField = value; + this.totalEstimatedConcurrentUsersSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalEstimatedConcurrentUsersSpecified { + get { return this.totalEstimatedConcurrentUsersFieldSpecified; } + set { this.totalEstimatedConcurrentUsersFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("contentUrls")] + public string[] contentUrls { + get { return this.contentUrlsField; } + set { this.contentUrlsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adTags")] + public string[] adTags { + get { return this.adTagsField; } + set { this.adTagsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum LiveStreamEventStatus { + ACTIVE, + ARCHIVED, + PAUSED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LiveStreamEventDateTimeError : ApiError { + private LiveStreamEventDateTimeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LiveStreamEventDateTimeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LiveStreamEventDateTimeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum LiveStreamEventDateTimeErrorReason { + START_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_NOT_AFTER_START_DATE_TIME, + END_DATE_TIME_TOO_LATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "PublisherQueryLanguageServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class PublisherQueryLanguageService : DfpSoapClient, IPublisherQueryLanguageService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public PublisherQueryLanguageService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/PublisherQueryLanguageService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ResultSet select(Statement selectStatement) { + object[] results = this.Invoke("select", new object[] { selectStatement }); + return ((ResultSet) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Row { + private Value[] valuesField; + + + [System.Xml.Serialization.XmlElementAttribute("values")] + public Value[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ColumnType { + private string labelNameField; + + public string labelName { + get { return this.labelNameField; } + set { this.labelNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ResultSet { + private ColumnType[] columnTypesField; + + private Row[] rowsField; + + [System.Xml.Serialization.XmlElementAttribute("columnTypes")] + public ColumnType[] columnTypes { + get { return this.columnTypesField; } + set { this.columnTypesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("rows")] + public Row[] rows { + get { return this.rowsField; } + set { this.rowsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ActivityServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ActivityService : DfpSoapClient, IActivityService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ActivityService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/ActivityService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Activity[] createActivities([System.Xml.Serialization.XmlElementAttribute("activities")] +Activity[] activities) { + object[] results = this.Invoke("createActivities", new object[] { activities }); + return ((Activity[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityPage getActivitiesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getActivitiesByStatement", new object[] { filterStatement }); + return ((ActivityPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Activity[] updateActivities([System.Xml.Serialization.XmlElementAttribute("activities")] +Activity[] activities) { + object[] results = this.Invoke("updateActivities", new object[] { activities }); + return ((Activity[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ActivityPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Activity[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Activity[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Activity { + private int idField; + + private bool idFieldSpecified; + + private int activityGroupIdField; + + private bool activityGroupIdFieldSpecified; + + private string nameField; + + private string expectedURLField; + + private ActivityStatus statusField; + + private bool statusFieldSpecified; + + private ActivityType typeField; + + private bool typeFieldSpecified; + + public int id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public int activityGroupId { + get { return this.activityGroupIdField; } + set { + this.activityGroupIdField = value; + this.activityGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool activityGroupIdSpecified { + get { return this.activityGroupIdFieldSpecified; } + set { this.activityGroupIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string expectedURL { + get { return this.expectedURLField; } + set { this.expectedURLField = value; } + } + + public ActivityStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ActivityType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Activity.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ActivityStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Activity.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ActivityType { + PAGE_VIEWS, + DAILY_VISITS, + CUSTOM, + ITEMS_PURCHASED, + TRANSACTIONS, + IOS_APPLICATION_DOWNLOADS, + ANDROID_APPLICATION_DOWNLOADS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LineItemTemplateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LineItemTemplateService : DfpSoapClient, ILineItemTemplateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LineItemTemplateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/LineItemTemplateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemTemplatePage getLineItemTemplatesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLineItemTemplatesByStatement", new object[] { filterStatement }); + return ((LineItemTemplatePage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LineItemTemplate { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private bool isDefaultField; + + private bool isDefaultFieldSpecified; + + private string lineItemNameField; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private bool enabledForSameAdvertiserExceptionField; + + private bool enabledForSameAdvertiserExceptionFieldSpecified; + + private string notesField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private DateTime startTimeField; + + private DateTime endTimeField; + + private DeliveryRateType deliveryRateTypeField; + + private bool deliveryRateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private CreativeRotationType creativeRotationTypeField; + + private bool creativeRotationTypeFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public bool isDefault { + get { return this.isDefaultField; } + set { + this.isDefaultField = value; + this.isDefaultSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isDefaultSpecified { + get { return this.isDefaultFieldSpecified; } + set { this.isDefaultFieldSpecified = value; } + } + + public string lineItemName { + get { return this.lineItemNameField; } + set { this.lineItemNameField = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + public bool enabledForSameAdvertiserException { + get { return this.enabledForSameAdvertiserExceptionField; } + set { + this.enabledForSameAdvertiserExceptionField = value; + this.enabledForSameAdvertiserExceptionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool enabledForSameAdvertiserExceptionSpecified { + get { return this.enabledForSameAdvertiserExceptionFieldSpecified; } + set { this.enabledForSameAdvertiserExceptionFieldSpecified = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public DateTime startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public DateTime endTime { + get { return this.endTimeField; } + set { this.endTimeField = value; } + } + + public DeliveryRateType deliveryRateType { + get { return this.deliveryRateTypeField; } + set { + this.deliveryRateTypeField = value; + this.deliveryRateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryRateTypeSpecified { + get { return this.deliveryRateTypeFieldSpecified; } + set { this.deliveryRateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + public CreativeRotationType creativeRotationType { + get { return this.creativeRotationTypeField; } + set { + this.creativeRotationTypeField = value; + this.creativeRotationTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeRotationTypeSpecified { + get { return this.creativeRotationTypeFieldSpecified; } + set { this.creativeRotationTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class LineItemTemplatePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LineItemTemplate[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LineItemTemplate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "WorkflowRequestServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class WorkflowRequestService : DfpSoapClient, IWorkflowRequestService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public WorkflowRequestService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/WorkflowRequestService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual WorkflowRequestPage getWorkflowRequestsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getWorkflowRequestsByStatement", new object[] { filterStatement }); + return ((WorkflowRequestPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performWorkflowRequestAction(WorkflowRequestAction action, Statement filterStatement) { + object[] results = this.Invoke("performWorkflowRequestAction", new object[] { action, filterStatement }); + return ((UpdateResult) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RejectWorkflowApprovalRequests))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveWorkflowApprovalRequests))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class WorkflowRequestAction { + private string workflowRequestActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("WorkflowRequestAction.Type")] + public string WorkflowRequestActionType { + get { return this.workflowRequestActionTypeField; } + set { this.workflowRequestActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class RejectWorkflowApprovalRequests : WorkflowRequestAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ApproveWorkflowApprovalRequests : WorkflowRequestAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WorkflowApprovalRequest))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class WorkflowRequest { + private long idField; + + private bool idFieldSpecified; + + private string workflowRuleNameField; + + private long entityIdField; + + private bool entityIdFieldSpecified; + + private WorkflowEntityType entityTypeField; + + private bool entityTypeFieldSpecified; + + private string workflowRequestTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string workflowRuleName { + get { return this.workflowRuleNameField; } + set { this.workflowRuleNameField = value; } + } + + public long entityId { + get { return this.entityIdField; } + set { + this.entityIdField = value; + this.entityIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool entityIdSpecified { + get { return this.entityIdFieldSpecified; } + set { this.entityIdFieldSpecified = value; } + } + + public WorkflowEntityType entityType { + get { return this.entityTypeField; } + set { + this.entityTypeField = value; + this.entityTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool entityTypeSpecified { + get { return this.entityTypeFieldSpecified; } + set { this.entityTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("WorkflowRequest.Type")] + public string WorkflowRequestType { + get { return this.workflowRequestTypeField; } + set { this.workflowRequestTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum WorkflowEntityType { + PROPOSAL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class WorkflowApprovalRequest : WorkflowRequest { + private WorkflowApprovalRequestStatus statusField; + + private bool statusFieldSpecified; + + public WorkflowApprovalRequestStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum WorkflowApprovalRequestStatus { + PENDING_APPROVAL, + APPROVED, + REJECTED, + RETRACTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class WorkflowRequestPage { + private WorkflowRequest[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public WorkflowRequest[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "PlacementServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SiteTargetingInfo))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class PlacementService : DfpSoapClient, IPlacementService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public PlacementService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/PlacementService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Placement[] createPlacements([System.Xml.Serialization.XmlElementAttribute("placements")] +Placement[] placements) { + object[] results = this.Invoke("createPlacements", new object[] { placements }); + return ((Placement[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual PlacementPage getPlacementsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getPlacementsByStatement", new object[] { filterStatement }); + return ((PlacementPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performPlacementAction(PlacementAction placementAction, Statement filterStatement) { + object[] results = this.Invoke("performPlacementAction", new object[] { placementAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Placement[] updatePlacements([System.Xml.Serialization.XmlElementAttribute("placements")] +Placement[] placements) { + object[] results = this.Invoke("updatePlacements", new object[] { placements }); + return ((Placement[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivatePlacements))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchivePlacements))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivatePlacements))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class PlacementAction { + private string placementActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("PlacementAction.Type")] + public string PlacementActionType { + get { return this.placementActionTypeField; } + set { this.placementActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeactivatePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ArchivePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ActivatePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class PlacementPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Placement[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Placement[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Placement : SiteTargetingInfo { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private string placementCodeField; + + private InventoryStatus statusField; + + private bool statusFieldSpecified; + + private bool isAdSenseTargetingEnabledField; + + private bool isAdSenseTargetingEnabledFieldSpecified; + + private string adSenseTargetingLocaleField; + + private string[] targetedAdUnitIdsField; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public string placementCode { + get { return this.placementCodeField; } + set { this.placementCodeField = value; } + } + + public InventoryStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public bool isAdSenseTargetingEnabled { + get { return this.isAdSenseTargetingEnabledField; } + set { + this.isAdSenseTargetingEnabledField = value; + this.isAdSenseTargetingEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAdSenseTargetingEnabledSpecified { + get { return this.isAdSenseTargetingEnabledFieldSpecified; } + set { this.isAdSenseTargetingEnabledFieldSpecified = value; } + } + + public string adSenseTargetingLocale { + get { return this.adSenseTargetingLocaleField; } + set { this.adSenseTargetingLocaleField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedAdUnitIds")] + public string[] targetedAdUnitIds { + get { return this.targetedAdUnitIdsField; } + set { this.targetedAdUnitIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Placement))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class SiteTargetingInfo { + private string targetingDescriptionField; + + private string targetingSiteNameField; + + private string targetingAdLocationField; + + private string siteTargetingInfoTypeField; + + public string targetingDescription { + get { return this.targetingDescriptionField; } + set { this.targetingDescriptionField = value; } + } + + public string targetingSiteName { + get { return this.targetingSiteNameField; } + set { this.targetingSiteNameField = value; } + } + + public string targetingAdLocation { + get { return this.targetingAdLocationField; } + set { this.targetingAdLocationField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("SiteTargetingInfo.Type")] + public string SiteTargetingInfoType { + get { return this.siteTargetingInfoTypeField; } + set { this.siteTargetingInfoTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class PlacementError : ApiError { + private PlacementErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PlacementErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PlacementError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum PlacementErrorReason { + INVALID_ENTITY_TYPE, + SHARED_INVENTORY_ASSIGNED, + PLACEMENTS_CANNOT_INCLUDE_INVENTORY_FROM_MULTIPLE_DISTRIBUTOR_NETWORKS, + PLACEMENTS_CANNOT_INCLUDE_BOTH_LOCAL_AND_SHARED_INVENTORY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "UserTeamAssociationServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserRecordTeamAssociation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class UserTeamAssociationService : DfpSoapClient, IUserTeamAssociationService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public UserTeamAssociationService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/UserTeamAssociationService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociation[] createUserTeamAssociations([System.Xml.Serialization.XmlElementAttribute("userTeamAssociations")] +UserTeamAssociation[] userTeamAssociations) { + object[] results = this.Invoke("createUserTeamAssociations", new object[] { userTeamAssociations }); + return ((UserTeamAssociation[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociationPage getUserTeamAssociationsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getUserTeamAssociationsByStatement", new object[] { filterStatement }); + return ((UserTeamAssociationPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performUserTeamAssociationAction(UserTeamAssociationAction userTeamAssociationAction, Statement statement) { + object[] results = this.Invoke("performUserTeamAssociationAction", new object[] { userTeamAssociationAction, statement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociation[] updateUserTeamAssociations([System.Xml.Serialization.XmlElementAttribute("userTeamAssociations")] +UserTeamAssociation[] userTeamAssociations) { + object[] results = this.Invoke("updateUserTeamAssociations", new object[] { userTeamAssociations }); + return ((UserTeamAssociation[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteUserTeamAssociations))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class UserTeamAssociationAction { + private string userTeamAssociationActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("UserTeamAssociationAction.Type")] + public string UserTeamAssociationActionType { + get { return this.userTeamAssociationActionTypeField; } + set { this.userTeamAssociationActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeleteUserTeamAssociations : UserTeamAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class UserTeamAssociationPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private UserTeamAssociation[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public UserTeamAssociation[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class UserTeamAssociation : UserRecordTeamAssociation { + private long userIdField; + + private bool userIdFieldSpecified; + + public long userId { + get { return this.userIdField; } + set { + this.userIdField = value; + this.userIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userIdSpecified { + get { return this.userIdFieldSpecified; } + set { this.userIdFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserTeamAssociation))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class UserRecordTeamAssociation { + private long teamIdField; + + private bool teamIdFieldSpecified; + + private TeamAccessType overriddenTeamAccessTypeField; + + private bool overriddenTeamAccessTypeFieldSpecified; + + private TeamAccessType defaultTeamAccessTypeField; + + private bool defaultTeamAccessTypeFieldSpecified; + + private string userRecordTeamAssociationTypeField; + + public long teamId { + get { return this.teamIdField; } + set { + this.teamIdField = value; + this.teamIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool teamIdSpecified { + get { return this.teamIdFieldSpecified; } + set { this.teamIdFieldSpecified = value; } + } + + public TeamAccessType overriddenTeamAccessType { + get { return this.overriddenTeamAccessTypeField; } + set { + this.overriddenTeamAccessTypeField = value; + this.overriddenTeamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overriddenTeamAccessTypeSpecified { + get { return this.overriddenTeamAccessTypeFieldSpecified; } + set { this.overriddenTeamAccessTypeFieldSpecified = value; } + } + + public TeamAccessType defaultTeamAccessType { + get { return this.defaultTeamAccessTypeField; } + set { + this.defaultTeamAccessTypeField = value; + this.defaultTeamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool defaultTeamAccessTypeSpecified { + get { return this.defaultTeamAccessTypeFieldSpecified; } + set { this.defaultTeamAccessTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("UserRecordTeamAssociation.Type")] + public string UserRecordTeamAssociationType { + get { return this.userRecordTeamAssociationTypeField; } + set { this.userRecordTeamAssociationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeSetServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeSetService : DfpSoapClient, ICreativeSetService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeSetService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/CreativeSetService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeSet createCreativeSet(CreativeSet creativeSet) { + object[] results = this.Invoke("createCreativeSet", new object[] { creativeSet }); + return ((CreativeSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeSetPage getCreativeSetsByStatement(Statement statement) { + object[] results = this.Invoke("getCreativeSetsByStatement", new object[] { statement }); + return ((CreativeSetPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeSet updateCreativeSet(CreativeSet creativeSet) { + object[] results = this.Invoke("updateCreativeSet", new object[] { creativeSet }); + return ((CreativeSet) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CreativeSetPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeSet[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeSet[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CreativeSet { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private long masterCreativeIdField; + + private bool masterCreativeIdFieldSpecified; + + private long[] companionCreativeIdsField; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public long masterCreativeId { + get { return this.masterCreativeIdField; } + set { + this.masterCreativeIdField = value; + this.masterCreativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool masterCreativeIdSpecified { + get { return this.masterCreativeIdFieldSpecified; } + set { this.masterCreativeIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ContentServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ContentService : DfpSoapClient, IContentService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ContentService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/ContentService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContentPage getContentByStatement(Statement statement) { + object[] results = this.Invoke("getContentByStatement", new object[] { statement }); + return ((ContentPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContentPage getContentByStatementAndCustomTargetingValue(Statement filterStatement, long customTargetingValueId) { + object[] results = this.Invoke("getContentByStatementAndCustomTargetingValue", new object[] { filterStatement, customTargetingValueId }); + return ((ContentPage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CmsContent { + private long idField; + + private bool idFieldSpecified; + + private string displayNameField; + + private string cmsContentIdField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public string cmsContentId { + get { return this.cmsContentIdField; } + set { this.cmsContentIdField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Content { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private ContentStatus statusField; + + private bool statusFieldSpecified; + + private ContentStatusDefinedBy statusDefinedByField; + + private bool statusDefinedByFieldSpecified; + + private DateTime lastModifiedDateTimeField; + + private long[] userDefinedCustomTargetingValueIdsField; + + private long[] mappingRuleDefinedCustomTargetingValueIdsField; + + private CmsContent[] cmsSourcesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ContentStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ContentStatusDefinedBy statusDefinedBy { + get { return this.statusDefinedByField; } + set { + this.statusDefinedByField = value; + this.statusDefinedBySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusDefinedBySpecified { + get { return this.statusDefinedByFieldSpecified; } + set { this.statusDefinedByFieldSpecified = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("userDefinedCustomTargetingValueIds")] + public long[] userDefinedCustomTargetingValueIds { + get { return this.userDefinedCustomTargetingValueIdsField; } + set { this.userDefinedCustomTargetingValueIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("mappingRuleDefinedCustomTargetingValueIds")] + public long[] mappingRuleDefinedCustomTargetingValueIds { + get { return this.mappingRuleDefinedCustomTargetingValueIdsField; } + set { this.mappingRuleDefinedCustomTargetingValueIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("cmsSources")] + public CmsContent[] cmsSources { + get { return this.cmsSourcesField; } + set { this.cmsSourcesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ContentStatus { + ACTIVE, + INACTIVE, + ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ContentStatusDefinedBy { + CMS, + USER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ContentPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Content[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Content[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ContentPartnerError : ApiError { + private ContentPartnerErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ContentPartnerErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ContentPartnerError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ContentPartnerErrorReason { + FEATURE_NOT_ENABLED, + INVALID_PARTNER_TYPE, + NO_PARTNER_CATCH_ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "UserServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserRecord))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class UserService : DfpSoapClient, IUserService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public UserService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/UserService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User[] createUsers([System.Xml.Serialization.XmlElementAttribute("users")] +User[] users) { + object[] results = this.Invoke("createUsers", new object[] { users }); + return ((User[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Role[] getAllRoles() { + object[] results = this.Invoke("getAllRoles", new object[0]); + return ((Role[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User getCurrentUser() { + object[] results = this.Invoke("getCurrentUser", new object[0]); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserPage getUsersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getUsersByStatement", new object[] { filterStatement }); + return ((UserPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performUserAction(UserAction userAction, Statement filterStatement) { + object[] results = this.Invoke("performUserAction", new object[] { userAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User[] updateUsers([System.Xml.Serialization.XmlElementAttribute("users")] +User[] users) { + object[] results = this.Invoke("updateUsers", new object[] { users }); + return ((User[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateUsers))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateUsers))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class UserAction { + private string userActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("UserAction.Type")] + public string UserActionType { + get { return this.userActionTypeField; } + set { this.userActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeactivateUsers : UserAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ActivateUsers : UserAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class UserPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private User[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public User[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class User : UserRecord { + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private bool isEmailNotificationAllowedField; + + private bool isEmailNotificationAllowedFieldSpecified; + + private string externalIdField; + + private string ordersUiLocalTimeZoneIdField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + public bool isEmailNotificationAllowed { + get { return this.isEmailNotificationAllowedField; } + set { + this.isEmailNotificationAllowedField = value; + this.isEmailNotificationAllowedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isEmailNotificationAllowedSpecified { + get { return this.isEmailNotificationAllowedFieldSpecified; } + set { this.isEmailNotificationAllowedFieldSpecified = value; } + } + + public string externalId { + get { return this.externalIdField; } + set { this.externalIdField = value; } + } + + public string ordersUiLocalTimeZoneId { + get { return this.ordersUiLocalTimeZoneIdField; } + set { this.ordersUiLocalTimeZoneIdField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(User))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class UserRecord { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string emailField; + + private long roleIdField; + + private bool roleIdFieldSpecified; + + private string roleNameField; + + private string preferredLocaleField; + + private string userRecordTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public long roleId { + get { return this.roleIdField; } + set { + this.roleIdField = value; + this.roleIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roleIdSpecified { + get { return this.roleIdFieldSpecified; } + set { this.roleIdFieldSpecified = value; } + } + + public string roleName { + get { return this.roleNameField; } + set { this.roleNameField = value; } + } + + public string preferredLocale { + get { return this.preferredLocaleField; } + set { this.preferredLocaleField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("UserRecord.Type")] + public string UserRecordType { + get { return this.userRecordTypeField; } + set { this.userRecordTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Role { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ContactServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseContact))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ContactService : DfpSoapClient, IContactService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ContactService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/ContactService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Contact[] createContacts([System.Xml.Serialization.XmlElementAttribute("contacts")] +Contact[] contacts) { + object[] results = this.Invoke("createContacts", new object[] { contacts }); + return ((Contact[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContactPage getContactsByStatement(Statement statement) { + object[] results = this.Invoke("getContactsByStatement", new object[] { statement }); + return ((ContactPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Contact[] updateContacts([System.Xml.Serialization.XmlElementAttribute("contacts")] +Contact[] contacts) { + object[] results = this.Invoke("updateContacts", new object[] { contacts }); + return ((Contact[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ContactPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Contact[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Contact[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class Contact : BaseContact { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private long companyIdField; + + private bool companyIdFieldSpecified; + + private ContactStatus statusField; + + private bool statusFieldSpecified; + + private string addressField; + + private string cellPhoneField; + + private string commentField; + + private string emailField; + + private string faxPhoneField; + + private string titleField; + + private string workPhoneField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public long companyId { + get { return this.companyIdField; } + set { + this.companyIdField = value; + this.companyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companyIdSpecified { + get { return this.companyIdFieldSpecified; } + set { this.companyIdFieldSpecified = value; } + } + + public ContactStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string address { + get { return this.addressField; } + set { this.addressField = value; } + } + + public string cellPhone { + get { return this.cellPhoneField; } + set { this.cellPhoneField = value; } + } + + public string comment { + get { return this.commentField; } + set { this.commentField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public string faxPhone { + get { return this.faxPhoneField; } + set { this.faxPhoneField = value; } + } + + public string title { + get { return this.titleField; } + set { this.titleField = value; } + } + + public string workPhone { + get { return this.workPhoneField; } + set { this.workPhoneField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Contact.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ContactStatus { + UNINVITED, + INVITE_PENDNG, + INVITE_EXPIRED, + INVITE_CANCELED, + USER_ACTIVE, + USER_DISABLED, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Contact))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class BaseContact { + private string baseContactTypeField; + + [System.Xml.Serialization.XmlElementAttribute("BaseContact.Type")] + public string BaseContactType { + get { return this.baseContactTypeField; } + set { this.baseContactTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ContactError : ApiError { + private ContactErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ContactErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ContactError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum ContactErrorReason { + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeWrapperServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeWrapperService : DfpSoapClient, ICreativeWrapperService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeWrapperService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201403/CreativeWrapperService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapper[] createCreativeWrappers([System.Xml.Serialization.XmlElementAttribute("creativeWrappers")] +CreativeWrapper[] creativeWrappers) { + object[] results = this.Invoke("createCreativeWrappers", new object[] { creativeWrappers }); + return ((CreativeWrapper[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapperPage getCreativeWrappersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativeWrappersByStatement", new object[] { filterStatement }); + return ((CreativeWrapperPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performCreativeWrapperAction(CreativeWrapperAction creativeWrapperAction, Statement filterStatement) { + object[] results = this.Invoke("performCreativeWrapperAction", new object[] { creativeWrapperAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201403", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201403", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapper[] updateCreativeWrappers([System.Xml.Serialization.XmlElementAttribute("creativeWrappers")] +CreativeWrapper[] creativeWrappers) { + object[] results = this.Invoke("updateCreativeWrappers", new object[] { creativeWrappers }); + return ((CreativeWrapper[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateCreativeWrappers))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateCreativeWrappers))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public abstract partial class CreativeWrapperAction { + private string creativeWrapperActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CreativeWrapperAction.Type")] + public string CreativeWrapperActionType { + get { return this.creativeWrapperActionTypeField; } + set { this.creativeWrapperActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class DeactivateCreativeWrappers : CreativeWrapperAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class ActivateCreativeWrappers : CreativeWrapperAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CreativeWrapperPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeWrapper[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeWrapper[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CreativeWrapper { + private long idField; + + private bool idFieldSpecified; + + private long labelIdField; + + private bool labelIdFieldSpecified; + + private CreativeWrapperHtmlSnippet headerField; + + private CreativeWrapperHtmlSnippet footerField; + + private CreativeWrapperOrdering orderingField; + + private bool orderingFieldSpecified; + + private CreativeWrapperStatus statusField; + + private bool statusFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + + public CreativeWrapperHtmlSnippet header { + get { return this.headerField; } + set { this.headerField = value; } + } + + public CreativeWrapperHtmlSnippet footer { + get { return this.footerField; } + set { this.footerField = value; } + } + + public CreativeWrapperOrdering ordering { + get { return this.orderingField; } + set { + this.orderingField = value; + this.orderingSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderingSpecified { + get { return this.orderingFieldSpecified; } + set { this.orderingFieldSpecified = value; } + } + + public CreativeWrapperStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public partial class CreativeWrapperHtmlSnippet { + private string htmlSnippetField; + + public string htmlSnippet { + get { return this.htmlSnippetField; } + set { this.htmlSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CreativeWrapperOrdering { + NO_PREFERENCE, + INNER, + OUTER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201403")] + public enum CreativeWrapperStatus { + ACTIVE, + INACTIVE + } + public interface IAudienceSegmentService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + FirstPartyAudienceSegment[] createAudienceSegments(FirstPartyAudienceSegment[] segments); + AudienceSegmentPage getAudienceSegmentsByStatement(Statement filterStatement); + UpdateResult performAudienceSegmentAction(AudienceSegmentAction action, Statement filterStatement); + FirstPartyAudienceSegment[] updateAudienceSegments(FirstPartyAudienceSegment[] segments); + } + public interface IReconciliationOrderReportService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ReconciliationOrderReportPage getReconciliationOrderReportsByStatement(Statement filterStatement); + UpdateResult performReconciliationOrderReportAction(ReconciliationOrderReportAction reconciliationOrderReportAction, Statement filterStatement); + } + public interface IForecastService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Forecast getForecast(LineItem lineItem); + Forecast getForecastById(long lineItemId); + } + public interface ICompanyService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Company[] createCompanies(Company[] companies); + CompanyPage getCompaniesByStatement(Statement filterStatement); + Company[] updateCompanies(Company[] companies); + } + public interface IAdRuleService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdRule[] createAdRules(AdRule[] adRules); + AdRulePage getAdRulesByStatement(Statement statement); + UpdateResult performAdRuleAction(AdRuleAction adRuleAction, Statement filterStatement); + AdRule[] updateAdRules(AdRule[] adRules); + } + public interface ISuggestedAdUnitService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + SuggestedAdUnitPage getSuggestedAdUnitsByStatement(Statement filterStatement); + SuggestedAdUnitUpdateResult performSuggestedAdUnitAction(SuggestedAdUnitAction suggestedAdUnitAction, Statement filterStatement); + } + public interface ILineItemService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + LineItem[] createLineItems(LineItem[] lineItems); + LineItemPage getLineItemsByStatement(Statement filterStatement); + UpdateResult performLineItemAction(LineItemAction lineItemAction, Statement filterStatement); + LineItem[] updateLineItems(LineItem[] lineItems); + } + public interface IRateCardService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + RateCard[] createRateCards(RateCard[] rateCards); + RateCardPage getRateCardsByStatement(Statement filterStatement); + UpdateResult performRateCardAction(RateCardAction rateCardAction, Statement filterStatement); + RateCard[] updateRateCards(RateCard[] rateCards); + } + public interface ICreativeTemplateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CreativeTemplatePage getCreativeTemplatesByStatement(Statement filterStatement); + } + public interface IContentMetadataKeyHierarchyService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ContentMetadataKeyHierarchy[] createContentMetadataKeyHierarchies(ContentMetadataKeyHierarchy[] contentMetadataKeyHierarchies); + ContentMetadataKeyHierarchyPage getContentMetadataKeyHierarchiesByStatement(Statement filterStatement); + UpdateResult performContentMetadataKeyHierarchyAction(ContentMetadataKeyHierarchyAction contentMetadataKeyHierarchyAction, Statement filterStatement); + ContentMetadataKeyHierarchy[] updateContentMetadataKeyHierarchies(ContentMetadataKeyHierarchy[] contentMetadataKeyHierarchies); + } + public interface ICustomTargetingService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CustomTargetingKey[] createCustomTargetingKeys(CustomTargetingKey[] keys); + CustomTargetingValue[] createCustomTargetingValues(CustomTargetingValue[] values); + CustomTargetingKeyPage getCustomTargetingKeysByStatement(Statement filterStatement); + CustomTargetingValuePage getCustomTargetingValuesByStatement(Statement filterStatement); + UpdateResult performCustomTargetingKeyAction(CustomTargetingKeyAction customTargetingKeyAction, Statement filterStatement); + UpdateResult performCustomTargetingValueAction(CustomTargetingValueAction customTargetingValueAction, Statement filterStatement); + CustomTargetingKey[] updateCustomTargetingKeys(CustomTargetingKey[] keys); + CustomTargetingValue[] updateCustomTargetingValues(CustomTargetingValue[] values); + } + public interface IProductService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ProductPage getProductsByStatement(Statement statement); + UpdateResult performProductAction(ProductAction productAction, Statement filterStatement); + Product[] updateProducts(Product[] products); + } + public interface IRateCardCustomizationGroupService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + RateCardCustomizationGroup[] createRateCardCustomizationGroups(RateCardCustomizationGroup[] rateCardCustomizationGroups); + RateCardCustomizationGroupPage getRateCardCustomizationGroupsByStatement(Statement filterStatement); + RateCardCustomizationGroup[] updateRateCardCustomizationGroups(RateCardCustomizationGroup[] rateCardCustomizationGroups); + } + public interface IActivityGroupService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ActivityGroup[] createActivityGroups(ActivityGroup[] activityGroups); + ActivityGroupPage getActivityGroupsByStatement(Statement filterStatement); + ActivityGroup[] updateActivityGroups(ActivityGroup[] activityGroups); + } + public interface ILabelService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Label[] createLabels(Label[] labels); + LabelPage getLabelsByStatement(Statement filterStatement); + UpdateResult performLabelAction(LabelAction labelAction, Statement filterStatement); + Label[] updateLabels(Label[] labels); + } + public interface ILineItemCreativeAssociationService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + LineItemCreativeAssociation[] createLineItemCreativeAssociations(LineItemCreativeAssociation[] lineItemCreativeAssociations); + LineItemCreativeAssociationPage getLineItemCreativeAssociationsByStatement(Statement filterStatement); + string getPreviewUrl(long lineItemId, long creativeId, string siteUrl); + UpdateResult performLineItemCreativeAssociationAction(LineItemCreativeAssociationAction lineItemCreativeAssociationAction, Statement filterStatement); + LineItemCreativeAssociation[] updateLineItemCreativeAssociations(LineItemCreativeAssociation[] lineItemCreativeAssociations); + } + public interface IReportService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + string getReportDownloadURL(long reportJobId, ExportFormat exportFormat); + string getReportDownloadUrlWithOptions(long reportJobId, ReportDownloadOptions reportDownloadOptions); + ReportJob getReportJob(long reportJobId); + ReportJob runReportJob(ReportJob reportJob); + } + public interface IInventoryService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdUnit[] createAdUnits(AdUnit[] adUnits); + AdUnitSize[] getAdUnitSizesByStatement(Statement filterStatement); + AdUnitPage getAdUnitsByStatement(Statement filterStatement); + UpdateResult performAdUnitAction(AdUnitAction adUnitAction, Statement filterStatement); + AdUnit[] updateAdUnits(AdUnit[] adUnits); + } + public interface ITeamService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Team[] createTeams(Team[] teams); + TeamPage getTeamsByStatement(Statement filterStatement); + Team[] updateTeams(Team[] teams); + } + public interface INetworkService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Network[] getAllNetworks(); + Network getCurrentNetwork(); + Network makeTestNetwork(); + Network updateNetwork(Network network); + } + public interface IRateCardCustomizationService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + RateCardCustomization[] createRateCardCustomizations(RateCardCustomization[] rateCardCustomizations); + RateCardCustomizationPage getRateCardCustomizationsByStatement(Statement filterStatement); + UpdateResult performRateCardCustomizationAction(RateCardCustomizationAction rateCardCustomizationAction, Statement filterStatement); + RateCardCustomization[] updateRateCardCustomizations(RateCardCustomization[] rateCardCustomizations); + } + public interface IProposalLineItemService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ProposalLineItem[] createProposalLineItems(ProposalLineItem[] proposalLineItems); + ProposalLineItemPage getProposalLineItemsByStatement(Statement filterStatement); + UpdateResult performProposalLineItemAction(ProposalLineItemAction proposalLineItemAction, Statement filterStatement); + ProposalLineItem[] updateProposalLineItems(ProposalLineItem[] proposalLineItems); + } + public interface ICreativeService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Creative[] createCreatives(Creative[] creatives); + CreativePage getCreativesByStatement(Statement filterStatement); + Creative[] updateCreatives(Creative[] creatives); + } + public interface IBaseRateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + BaseRate[] createBaseRates(BaseRate[] baseRates); + BaseRatePage getBaseRatesByStatement(Statement filterStatement); + UpdateResult performBaseRateAction(BaseRateAction baseRateAction, Statement filterStatement); + BaseRate[] updateBaseRates(BaseRate[] baseRates); + } + public interface IExchangeRateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ExchangeRate[] createExchangeRates(ExchangeRate[] exchangeRates); + ExchangeRatePage getExchangeRatesByStatement(Statement filterStatement); + UpdateResult performExchangeRateAction(ExchangeRateAction exchangeRateAction, Statement filterStatement); + ExchangeRate[] updateExchangeRates(ExchangeRate[] exchangeRates); + } + public interface IOrderService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Order[] createOrders(Order[] orders); + OrderPage getOrdersByStatement(Statement filterStatement); + UpdateResult performOrderAction(OrderAction orderAction, Statement filterStatement); + Order[] updateOrders(Order[] orders); + } + public interface ICustomFieldService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CustomFieldOption[] createCustomFieldOptions(CustomFieldOption[] customFieldOptions); + CustomField[] createCustomFields(CustomField[] customFields); + CustomFieldOption getCustomFieldOption(long customFieldOptionId); + CustomFieldPage getCustomFieldsByStatement(Statement filterStatement); + UpdateResult performCustomFieldAction(CustomFieldAction customFieldAction, Statement filterStatement); + CustomFieldOption[] updateCustomFieldOptions(CustomFieldOption[] customFieldOptions); + CustomField[] updateCustomFields(CustomField[] customFields); + } + public interface IReconciliationReportRowService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ReconciliationReportRowPage getReconciliationReportRowsByStatement(Statement filterStatement); + ReconciliationReportRow[] updateReconciliationReportRows(ReconciliationReportRow[] reconciliationReportRows); + } + public interface IProductTemplateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ProductTemplate[] createProductTemplates(ProductTemplate[] productTemplates); + ProductTemplatePage getProductTemplatesByStatement(Statement statement); + UpdateResult performProductTemplateAction(ProductTemplateAction action, Statement filterStatement); + ProductTemplate[] updateProductTemplates(ProductTemplate[] productTemplates); + } + public interface IReconciliationReportService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ReconciliationReportPage getReconciliationReportsByStatement(Statement filterStatement); + ReconciliationReport[] updateReconciliationReports(ReconciliationReport[] reconciliationReports); + } + public interface IProposalService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Proposal[] createProposals(Proposal[] proposals); + ProposalPage getProposalsByStatement(Statement filterStatement); + UpdateResult performProposalAction(ProposalAction proposalAction, Statement filterStatement); + Proposal[] updateProposals(Proposal[] proposals); + } + public interface ILiveStreamEventService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + LiveStreamEvent[] createLiveStreamEvents(LiveStreamEvent[] liveStreamEvents); + LiveStreamEventPage getLiveStreamEventsByStatement(Statement filterStatement); + UpdateResult performLiveStreamEventAction(LiveStreamEventAction liveStreamEventAction, Statement filterStatement); + LiveStreamEvent[] updateLiveStreamEvents(LiveStreamEvent[] liveStreamEvents); + } + public interface IPublisherQueryLanguageService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ResultSet select(Statement selectStatement); + } + public interface IActivityService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Activity[] createActivities(Activity[] activities); + ActivityPage getActivitiesByStatement(Statement filterStatement); + Activity[] updateActivities(Activity[] activities); + } + public interface ILineItemTemplateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + LineItemTemplatePage getLineItemTemplatesByStatement(Statement filterStatement); + } + public interface IWorkflowRequestService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + WorkflowRequestPage getWorkflowRequestsByStatement(Statement filterStatement); + UpdateResult performWorkflowRequestAction(WorkflowRequestAction action, Statement filterStatement); + } + public interface IPlacementService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Placement[] createPlacements(Placement[] placements); + PlacementPage getPlacementsByStatement(Statement filterStatement); + UpdateResult performPlacementAction(PlacementAction placementAction, Statement filterStatement); + Placement[] updatePlacements(Placement[] placements); + } + public interface IUserTeamAssociationService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + UserTeamAssociation[] createUserTeamAssociations(UserTeamAssociation[] userTeamAssociations); + UserTeamAssociationPage getUserTeamAssociationsByStatement(Statement filterStatement); + UpdateResult performUserTeamAssociationAction(UserTeamAssociationAction userTeamAssociationAction, Statement statement); + UserTeamAssociation[] updateUserTeamAssociations(UserTeamAssociation[] userTeamAssociations); + } + public interface ICreativeSetService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CreativeSet createCreativeSet(CreativeSet creativeSet); + CreativeSetPage getCreativeSetsByStatement(Statement statement); + CreativeSet updateCreativeSet(CreativeSet creativeSet); + } + public interface IContentService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ContentPage getContentByStatement(Statement statement); + ContentPage getContentByStatementAndCustomTargetingValue(Statement filterStatement, long customTargetingValueId); + } + public interface IUserService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + User[] createUsers(User[] users); + Role[] getAllRoles(); + User getCurrentUser(); + UserPage getUsersByStatement(Statement filterStatement); + UpdateResult performUserAction(UserAction userAction, Statement filterStatement); + User[] updateUsers(User[] users); + } + public interface IContactService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Contact[] createContacts(Contact[] contacts); + ContactPage getContactsByStatement(Statement statement); + Contact[] updateContacts(Contact[] contacts); + } + public interface ICreativeWrapperService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CreativeWrapper[] createCreativeWrappers(CreativeWrapper[] creativeWrappers); + CreativeWrapperPage getCreativeWrappersByStatement(Statement filterStatement); + UpdateResult performCreativeWrapperAction(CreativeWrapperAction creativeWrapperAction, Statement filterStatement); + CreativeWrapper[] updateCreativeWrappers(CreativeWrapper[] creativeWrappers); + } +} diff --git a/src/Dfp/v201403/DfpServiceV201403.cs b/src/Dfp/v201403/DfpServiceV201403.cs new file mode 100644 index 00000000000..b7c7ccc6110 --- /dev/null +++ b/src/Dfp/v201403/DfpServiceV201403.cs @@ -0,0 +1,360 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Reflection; + +namespace Google.Api.Ads.Dfp.Lib { + /// + /// Lists all the services available through this library. + /// + public partial class DfpService : AdsService { + /// + /// All the services available in v201403. + /// + public class v201403 { + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ActivityGroupService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ActivityService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdRuleService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature BaseRateService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ContactService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AudienceSegmentService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CompanyService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ContentService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ContentMetadataKeyHierarchyService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeSetService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeTemplateService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeWrapperService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomFieldService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomTargetingService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ExchangeRateService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ForecastService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature InventoryService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LabelService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LineItemTemplateService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LineItemService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LineItemCreativeAssociationService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LiveStreamEventService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature NetworkService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature OrderService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature PlacementService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProductService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProductTemplateService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProposalService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProposalLineItemService; + + + /// See + /// this page for details. + /// + public static readonly ServiceSignature PublisherQueryLanguageService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature RateCardService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature RateCardCustomizationService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature RateCardCustomizationGroupService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReconciliationOrderReportService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReconciliationReportService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReconciliationReportRowService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReportService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SuggestedAdUnitService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature TeamService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature UserService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature UserTeamAssociationService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature WorkflowRequestService; + + /// + /// Factory type for v201403 services. + /// + public static readonly Type factoryType = typeof(DfpServiceFactory); + + /// + /// Static constructor to initialize the service constants. + /// + static v201403() { + ActivityGroupService = DfpService.MakeServiceSignature("v201403", "ActivityGroupService"); + ActivityService = DfpService.MakeServiceSignature("v201403", "ActivityService"); + AdRuleService = DfpService.MakeServiceSignature("v201403", "AdRuleService"); + BaseRateService = DfpService.MakeServiceSignature("v201403", "BaseRateService"); + ContactService = DfpService.MakeServiceSignature("v201403", "ContactService"); + AudienceSegmentService = DfpService.MakeServiceSignature("v201403", + "AudienceSegmentService"); + CompanyService = DfpService.MakeServiceSignature("v201403", "CompanyService"); + ContentService = DfpService.MakeServiceSignature("v201403", "ContentService"); + ContentMetadataKeyHierarchyService = DfpService.MakeServiceSignature("v201403", + "ContentMetadataKeyHierarchyService"); + CreativeService = DfpService.MakeServiceSignature("v201403", "CreativeService"); + CreativeSetService = DfpService.MakeServiceSignature("v201403", "CreativeSetService"); + CreativeTemplateService = DfpService.MakeServiceSignature("v201403", + "CreativeTemplateService"); + CreativeWrapperService = DfpService.MakeServiceSignature("v201403", + "CreativeWrapperService"); + CustomTargetingService = DfpService.MakeServiceSignature("v201403", + "CustomTargetingService"); + CustomFieldService = DfpService.MakeServiceSignature("v201403", + "CustomFieldService"); + ExchangeRateService = DfpService.MakeServiceSignature("v201403", "ExchangeRateService"); + ForecastService = DfpService.MakeServiceSignature("v201403", "ForecastService"); + InventoryService = DfpService.MakeServiceSignature("v201403", "InventoryService"); + LabelService = DfpService.MakeServiceSignature("v201403", "LabelService"); + LineItemTemplateService = DfpService.MakeServiceSignature("v201403", + "LineItemTemplateService"); + LineItemService = DfpService.MakeServiceSignature("v201403", "LineItemService"); + LineItemCreativeAssociationService = + DfpService.MakeServiceSignature("v201403", "LineItemCreativeAssociationService"); + LiveStreamEventService = DfpService.MakeServiceSignature("v201403", + "LiveStreamEventService"); + NetworkService = DfpService.MakeServiceSignature("v201403", "NetworkService"); + OrderService = DfpService.MakeServiceSignature("v201403", "OrderService"); + PlacementService = DfpService.MakeServiceSignature("v201403", "PlacementService"); + ProductService = DfpService.MakeServiceSignature("v201403", "ProductService"); + ProductTemplateService = DfpService.MakeServiceSignature("v201403", + "ProductTemplateService"); + ProposalService = DfpService.MakeServiceSignature("v201403", "ProposalService"); + ProposalLineItemService = DfpService.MakeServiceSignature("v201403", + "ProposalLineItemService"); + PublisherQueryLanguageService = DfpService.MakeServiceSignature("v201403", + "PublisherQueryLanguageService"); + RateCardService = DfpService.MakeServiceSignature("v201403", "RateCardService"); + RateCardCustomizationService = DfpService.MakeServiceSignature("v201403", + "RateCardCustomizationService"); + RateCardCustomizationGroupService = DfpService.MakeServiceSignature("v201403", + "RateCardCustomizationGroupService"); + ReconciliationOrderReportService = DfpService.MakeServiceSignature("v201403", + "ReconciliationOrderReportService"); + ReconciliationReportService = DfpService.MakeServiceSignature("v201403", + "ReconciliationReportService"); + ReconciliationReportRowService = DfpService.MakeServiceSignature("v201403", + "ReconciliationReportRowService"); + ReportService = DfpService.MakeServiceSignature("v201403", "ReportService"); + SuggestedAdUnitService = DfpService.MakeServiceSignature("v201403", + "SuggestedAdUnitService"); + TeamService = DfpService.MakeServiceSignature("v201403", "TeamService"); + UserService = DfpService.MakeServiceSignature("v201403", "UserService"); + UserTeamAssociationService = DfpService.MakeServiceSignature("v201403", + "UserTeamAssociationService"); + WorkflowRequestService = DfpService.MakeServiceSignature("v201403", + "WorkflowRequestService"); + } + } + } +} diff --git a/src/Dfp/v201405/DfpApi.cs b/src/Dfp/v201405/DfpApi.cs new file mode 100644 index 00000000000..00d25f2e7aa --- /dev/null +++ b/src/Dfp/v201405/DfpApi.cs @@ -0,0 +1,27857 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +namespace Google.Api.Ads.Dfp.v201405 { + using Google.Api.Ads.Dfp.Lib; + using Google.Api.Ads.Dfp.Headers; + using System; + using System.Web.Services; + using System.Diagnostics; + using System.Web.Services.Protocols; + using System.Xml.Serialization; + using System.ComponentModel; + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AudienceSegmentServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AudienceSegmentService : DfpSoapClient, IAudienceSegmentService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AudienceSegmentService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/AudienceSegmentService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FirstPartyAudienceSegment[] createAudienceSegments([System.Xml.Serialization.XmlElementAttribute("segments")] +FirstPartyAudienceSegment[] segments) { + object[] results = this.Invoke("createAudienceSegments", new object[] { segments }); + return ((FirstPartyAudienceSegment[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AudienceSegmentPage getAudienceSegmentsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAudienceSegmentsByStatement", new object[] { filterStatement }); + return ((AudienceSegmentPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performAudienceSegmentAction(AudienceSegmentAction action, Statement filterStatement) { + object[] results = this.Invoke("performAudienceSegmentAction", new object[] { action, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual FirstPartyAudienceSegment[] updateAudienceSegments([System.Xml.Serialization.XmlElementAttribute("segments")] +FirstPartyAudienceSegment[] segments) { + object[] results = this.Invoke("updateAudienceSegments", new object[] { segments }); + return ((FirstPartyAudienceSegment[]) (results[0])); + } + } + + + + + + + + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class UpdateResult { + private int numChangesField; + + private bool numChangesFieldSpecified; + + public int numChanges { + get { return this.numChangesField; } + set { + this.numChangesField = value; + this.numChangesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numChangesSpecified { + get { return this.numChangesFieldSpecified; } + set { this.numChangesFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RejectAudienceSegments))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PopulateAudienceSegments))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateAudienceSegments))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveAudienceSegments))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateAudienceSegments))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class AudienceSegmentAction { + private string audienceSegmentActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AudienceSegmentAction.Type")] + public string AudienceSegmentActionType { + get { return this.audienceSegmentActionTypeField; } + set { this.audienceSegmentActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RejectAudienceSegments : AudienceSegmentAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class PopulateAudienceSegments : AudienceSegmentAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeactivateAudienceSegments : AudienceSegmentAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ApproveAudienceSegments : AudienceSegmentAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ActivateAudienceSegments : AudienceSegmentAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AudienceSegmentPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AudienceSegment[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AudienceSegment[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SharedAudienceSegment))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ThirdPartyAudienceSegment))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FirstPartyAudienceSegment))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RuleBasedFirstPartyAudienceSegmentSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RuleBasedFirstPartyAudienceSegment))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NonRuleBasedFirstPartyAudienceSegment))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AudienceSegment { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private AudienceSegmentStatus statusField; + + private bool statusFieldSpecified; + + private long sizeField; + + private bool sizeFieldSpecified; + + private AudienceSegmentDataProvider dataProviderField; + + private AudienceSegmentAudienceSegmentType typeField; + + private bool typeFieldSpecified; + + private string audienceSegmentTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public AudienceSegmentStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public long size { + get { return this.sizeField; } + set { + this.sizeField = value; + this.sizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sizeSpecified { + get { return this.sizeFieldSpecified; } + set { this.sizeFieldSpecified = value; } + } + + public AudienceSegmentDataProvider dataProvider { + get { return this.dataProviderField; } + set { this.dataProviderField = value; } + } + + public AudienceSegmentAudienceSegmentType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("AudienceSegment.Type")] + public string AudienceSegmentType { + get { return this.audienceSegmentTypeField; } + set { this.audienceSegmentTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegment.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AudienceSegmentStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AudienceSegmentDataProvider { + private string nameField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegment.AudienceSegmentType", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AudienceSegmentAudienceSegmentType { + FIRST_PARTY, + SHARED, + THIRD_PARTY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class SharedAudienceSegment : AudienceSegment { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ThirdPartyAudienceSegment : AudienceSegment { + private ThirdPartyAudienceSegmentAudienceSegmentApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + private Money costField; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + public ThirdPartyAudienceSegmentAudienceSegmentApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + + public Money cost { + get { return this.costField; } + set { this.costField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ThirdPartyAudienceSegment.AudienceSegmentApprovalStatus", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ThirdPartyAudienceSegmentAudienceSegmentApprovalStatus { + UNAPPROVED, + APPROVED, + REJECTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Money { + private string currencyCodeField; + + private long microAmountField; + + private bool microAmountFieldSpecified; + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public long microAmount { + get { return this.microAmountField; } + set { + this.microAmountField = value; + this.microAmountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool microAmountSpecified { + get { return this.microAmountFieldSpecified; } + set { this.microAmountFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DateTime { + private Date dateField; + + private int hourField; + + private bool hourFieldSpecified; + + private int minuteField; + + private bool minuteFieldSpecified; + + private int secondField; + + private bool secondFieldSpecified; + + private string timeZoneIDField; + + public Date date { + get { return this.dateField; } + set { this.dateField = value; } + } + + public int hour { + get { return this.hourField; } + set { + this.hourField = value; + this.hourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hourSpecified { + get { return this.hourFieldSpecified; } + set { this.hourFieldSpecified = value; } + } + + public int minute { + get { return this.minuteField; } + set { + this.minuteField = value; + this.minuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minuteSpecified { + get { return this.minuteFieldSpecified; } + set { this.minuteFieldSpecified = value; } + } + + public int second { + get { return this.secondField; } + set { + this.secondField = value; + this.secondSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool secondSpecified { + get { return this.secondFieldSpecified; } + set { this.secondFieldSpecified = value; } + } + + public string timeZoneID { + get { return this.timeZoneIDField; } + set { this.timeZoneIDField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Date { + private int yearField; + + private bool yearFieldSpecified; + + private int monthField; + + private bool monthFieldSpecified; + + private int dayField; + + private bool dayFieldSpecified; + + public int year { + get { return this.yearField; } + set { + this.yearField = value; + this.yearSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool yearSpecified { + get { return this.yearFieldSpecified; } + set { this.yearFieldSpecified = value; } + } + + public int month { + get { return this.monthField; } + set { + this.monthField = value; + this.monthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool monthSpecified { + get { return this.monthFieldSpecified; } + set { this.monthFieldSpecified = value; } + } + + public int day { + get { return this.dayField; } + set { + this.dayField = value; + this.daySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool daySpecified { + get { return this.dayFieldSpecified; } + set { this.dayFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RuleBasedFirstPartyAudienceSegmentSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RuleBasedFirstPartyAudienceSegment))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NonRuleBasedFirstPartyAudienceSegment))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class FirstPartyAudienceSegment : AudienceSegment { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RuleBasedFirstPartyAudienceSegment))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RuleBasedFirstPartyAudienceSegmentSummary : FirstPartyAudienceSegment { + private int pageViewsField; + + private bool pageViewsFieldSpecified; + + private int recencyDaysField; + + private bool recencyDaysFieldSpecified; + + private int membershipExpirationDaysField; + + private bool membershipExpirationDaysFieldSpecified; + + public int pageViews { + get { return this.pageViewsField; } + set { + this.pageViewsField = value; + this.pageViewsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool pageViewsSpecified { + get { return this.pageViewsFieldSpecified; } + set { this.pageViewsFieldSpecified = value; } + } + + public int recencyDays { + get { return this.recencyDaysField; } + set { + this.recencyDaysField = value; + this.recencyDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool recencyDaysSpecified { + get { return this.recencyDaysFieldSpecified; } + set { this.recencyDaysFieldSpecified = value; } + } + + public int membershipExpirationDays { + get { return this.membershipExpirationDaysField; } + set { + this.membershipExpirationDaysField = value; + this.membershipExpirationDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool membershipExpirationDaysSpecified { + get { return this.membershipExpirationDaysFieldSpecified; } + set { this.membershipExpirationDaysFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RuleBasedFirstPartyAudienceSegment : RuleBasedFirstPartyAudienceSegmentSummary { + private FirstPartyAudienceSegmentRule ruleField; + + public FirstPartyAudienceSegmentRule rule { + get { return this.ruleField; } + set { this.ruleField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class FirstPartyAudienceSegmentRule { + private InventoryTargeting inventoryRuleField; + + private CustomCriteriaSet customCriteriaRuleField; + + public InventoryTargeting inventoryRule { + get { return this.inventoryRuleField; } + set { this.inventoryRuleField = value; } + } + + public CustomCriteriaSet customCriteriaRule { + get { return this.customCriteriaRuleField; } + set { this.customCriteriaRuleField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class InventoryTargeting { + private AdUnitTargeting[] targetedAdUnitsField; + + private AdUnitTargeting[] excludedAdUnitsField; + + private long[] targetedPlacementIdsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedAdUnits")] + public AdUnitTargeting[] targetedAdUnits { + get { return this.targetedAdUnitsField; } + set { this.targetedAdUnitsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedAdUnits")] + public AdUnitTargeting[] excludedAdUnits { + get { return this.excludedAdUnitsField; } + set { this.excludedAdUnitsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedPlacementIds")] + public long[] targetedPlacementIds { + get { return this.targetedPlacementIdsField; } + set { this.targetedPlacementIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdUnitTargeting { + private string adUnitIdField; + + private bool includeDescendantsField; + + private bool includeDescendantsFieldSpecified; + + public string adUnitId { + get { return this.adUnitIdField; } + set { this.adUnitIdField = value; } + } + + public bool includeDescendants { + get { return this.includeDescendantsField; } + set { + this.includeDescendantsField = value; + this.includeDescendantsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeDescendantsSpecified { + get { return this.includeDescendantsFieldSpecified; } + set { this.includeDescendantsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CustomCriteriaSet : CustomCriteriaNode { + private CustomCriteriaSetLogicalOperator logicalOperatorField; + + private bool logicalOperatorFieldSpecified; + + private CustomCriteriaNode[] childrenField; + + public CustomCriteriaSetLogicalOperator logicalOperator { + get { return this.logicalOperatorField; } + set { + this.logicalOperatorField = value; + this.logicalOperatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool logicalOperatorSpecified { + get { return this.logicalOperatorFieldSpecified; } + set { this.logicalOperatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("children")] + public CustomCriteriaNode[] children { + get { return this.childrenField; } + set { this.childrenField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCriteriaSet.LogicalOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CustomCriteriaSetLogicalOperator { + AND, + OR + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteriaLeaf))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceSegmentCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteriaSet))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class CustomCriteriaNode { + private string customCriteriaNodeTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomCriteriaNode.Type")] + public string CustomCriteriaNodeType { + get { return this.customCriteriaNodeTypeField; } + set { this.customCriteriaNodeTypeField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceSegmentCriteria))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCriteria))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class CustomCriteriaLeaf : CustomCriteriaNode { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AudienceSegmentCriteria : CustomCriteriaLeaf { + private AudienceSegmentCriteriaComparisonOperator operatorField; + + private bool operatorFieldSpecified; + + private long[] audienceSegmentIdsField; + + public AudienceSegmentCriteriaComparisonOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("audienceSegmentIds")] + public long[] audienceSegmentIds { + get { return this.audienceSegmentIdsField; } + set { this.audienceSegmentIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegmentCriteria.ComparisonOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AudienceSegmentCriteriaComparisonOperator { + IS, + IS_NOT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CustomCriteria : CustomCriteriaLeaf { + private long keyIdField; + + private bool keyIdFieldSpecified; + + private long[] valueIdsField; + + private CustomCriteriaComparisonOperator operatorField; + + private bool operatorFieldSpecified; + + public long keyId { + get { return this.keyIdField; } + set { + this.keyIdField = value; + this.keyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keyIdSpecified { + get { return this.keyIdFieldSpecified; } + set { this.keyIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("valueIds")] + public long[] valueIds { + get { return this.valueIdsField; } + set { this.valueIdsField = value; } + } + + public CustomCriteriaComparisonOperator @operator { + get { return this.operatorField; } + set { + this.operatorField = value; + this.operatorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool operatorSpecified { + get { return this.operatorFieldSpecified; } + set { this.operatorFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCriteria.ComparisonOperator", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CustomCriteriaComparisonOperator { + IS, + IS_NOT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class NonRuleBasedFirstPartyAudienceSegment : FirstPartyAudienceSegment { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TextValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SetValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NumberValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateTimeValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BooleanValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class Value { + private string valueTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Value.Type")] + public string ValueType { + get { return this.valueTypeField; } + set { this.valueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class TextValue : Value { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class SetValue : Value { + private Value[] valuesField; + + [System.Xml.Serialization.XmlElementAttribute("values")] + public Value[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class NumberValue : Value { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DateValue : Value { + private Date valueField; + + public Date value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DateTimeValue : Value { + private DateTime valueField; + + public DateTime value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class BooleanValue : Value { + private bool valueField; + + private bool valueFieldSpecified; + + public bool value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class String_ValueMapEntry { + private string keyField; + + private Value valueField; + + public string key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public Value value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Statement { + private string queryField; + + private String_ValueMapEntry[] valuesField; + + public string query { + get { return this.queryField; } + set { this.queryField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("values")] + public String_ValueMapEntry[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StatementError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServerError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceSegmentError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(QuotaError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PublisherQueryLanguageSyntaxError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PublisherQueryLanguageContextError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PermissionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NotNullError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InternalApiError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FeatureError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CommonError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AuthenticationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApiVersionError))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReconciliationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RangeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NullError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserDomainTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UniqueError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TypeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TechnologyTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TeamError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringLengthError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReservationDetailsError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredSizeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredNumberError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequiredCollectionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RegExError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProgrammaticError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ParseError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OrderError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemOperationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemFlightDateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemCreativeAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LabelEntityAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidUrlError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GeoTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GenericTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FrequencyCapError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ForecastError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EntityLimitReachedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EntityChildrenLimitReachedError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DayPartTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DateTimeRangeTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldValueError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentMetadataTargetingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CompanyCreditStatusError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClickTrackingLineItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceExtensionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitCodeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitAfcSizeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidEmailError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CompanyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AvailableBillingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PoddingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRuleSlotError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRulePriorityError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRuleFrequencyCapError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdRuleDateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RateCardError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RateCardActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeTemplateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentMetadataKeyHierarchyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseRateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RateCardCustomizationGroupError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivityError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LabelError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeWrapperError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TemplateInstantiatedCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SwiffyConversionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemCreativeAssociationOperationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidPhoneNumberError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FileError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreativeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeSetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreativeAssetMacroError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseAccountError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReportError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitTypeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitSizesError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InventoryUnitPartnerAssociationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvalidColorError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitHierarchyError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NetworkError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExchangeRateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RateCardCustomizationError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProposalLineItemError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProposalLineItemActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProposalError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PrecisionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BillingError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseRateActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OrderActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReconciliationImportError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductTemplateError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductTemplateActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WorkflowActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProposalActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LiveStreamEventDateTimeError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LiveStreamEventActionError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WorkflowRequestError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContentPartnerError))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContactError))] + public abstract partial class ApiError { + private string fieldPathField; + + private string triggerField; + + private string errorStringField; + + private string apiErrorTypeField; + + public string fieldPath { + get { return this.fieldPathField; } + set { this.fieldPathField = value; } + } + + public string trigger { + get { return this.triggerField; } + set { this.triggerField = value; } + } + + public string errorString { + get { return this.errorStringField; } + set { this.errorStringField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApiError.Type")] + public string ApiErrorType { + get { return this.apiErrorTypeField; } + set { this.apiErrorTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class StatementError : ApiError { + private StatementErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StatementErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StatementError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum StatementErrorReason { + VARIABLE_NOT_BOUND_TO_VALUE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ServerError : ApiError { + private ServerErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ServerErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ServerError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ServerErrorReason { + SERVER_ERROR, + SERVER_BUSY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AudienceSegmentError : ApiError { + private AudienceSegmentErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AudienceSegmentErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceSegmentError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AudienceSegmentErrorReason { + FIRST_PARTY_AUDIENCE_SEGMENT_NOT_SUPPORTED, + ONLY_RULE_BASED_FIRST_PARTY_AUDIENCE_SEGMENTS_CAN_BE_CREATED, + AUDIENCE_SEGMENT_ID_NOT_FOUND, + INVALID_AUDIENCE_SEGMENT_RULE, + AUDIENCE_SEGMENT_RULE_TOO_LONG, + INVALID_AUDIENCE_SEGMENT_NAME, + DUPLICATE_AUDIENCE_SEGMENT_NAME, + INVALID_AUDIENCE_SEGMENT_DESCRIPTION, + INVALID_AUDIENCE_SEGMENT_PAGEVIEWS, + INVALID_AUDIENCE_SEGMENT_RECENCY, + INVALID_AUDIENCE_SEGMENT_MEMBERSHIP_EXPIRATION, + INVALID_AUDIENCE_SEGMENT_CUSTOM_KEY_NAME, + INVALID_AUDIENCE_SEGMENT_CUSTOM_VALUE_NAME, + INVALID_AUDIENCE_SEGMENT_CUSTOM_VALUE_MATCH_TYPE, + INVALID_NESTED_FIRST_PARTY_AUDIENCE_SEGMENT, + INVALID_NESTED_THIRD_PARTY_AUDIENCE_SEGMENT, + INACTIVE_NESTED_AUDIENCE_SEGMENT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RequiredError : ApiError { + private RequiredErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum RequiredErrorReason { + REQUIRED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class QuotaError : ApiError { + private QuotaErrorReason reasonField; + + private bool reasonFieldSpecified; + + public QuotaErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "QuotaError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum QuotaErrorReason { + EXCEEDED_QUOTA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class PublisherQueryLanguageSyntaxError : ApiError { + private PublisherQueryLanguageSyntaxErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PublisherQueryLanguageSyntaxErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PublisherQueryLanguageSyntaxError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum PublisherQueryLanguageSyntaxErrorReason { + UNPARSABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class PublisherQueryLanguageContextError : ApiError { + private PublisherQueryLanguageContextErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PublisherQueryLanguageContextErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PublisherQueryLanguageContextError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum PublisherQueryLanguageContextErrorReason { + UNEXECUTABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class PermissionError : ApiError { + private PermissionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PermissionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PermissionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum PermissionErrorReason { + PERMISSION_DENIED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class NotNullError : ApiError { + private NotNullErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NotNullErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NotNullError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum NotNullErrorReason { + ARG1_NULL, + ARG2_NULL, + ARG3_NULL, + NULL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class InternalApiError : ApiError { + private InternalApiErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InternalApiErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InternalApiError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum InternalApiErrorReason { + UNEXPECTED_INTERNAL_API_ERROR, + UNKNOWN, + DOWNTIME + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class FeatureError : ApiError { + private FeatureErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FeatureErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FeatureError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum FeatureErrorReason { + MISSING_FEATURE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CommonError : ApiError { + private CommonErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CommonErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CommonError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CommonErrorReason { + NOT_FOUND, + ALREADY_EXISTS, + DUPLICATE_OBJECT, + CANNOT_UPDATE, + CONCURRENT_MODIFICATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AuthenticationError : ApiError { + private AuthenticationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AuthenticationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AuthenticationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AuthenticationErrorReason { + AMBIGUOUS_SOAP_REQUEST_HEADER, + INVALID_EMAIL, + AUTHENTICATION_FAILED, + INVALID_OAUTH_SIGNATURE, + INVALID_SERVICE, + MISSING_SOAP_REQUEST_HEADER, + MISSING_AUTHENTICATION_HTTP_HEADER, + MISSING_AUTHENTICATION, + NOT_WHITELISTED_FOR_API_ACCESS, + NO_NETWORKS_TO_ACCESS, + NETWORK_NOT_FOUND, + NETWORK_CODE_REQUIRED, + CONNECTION_ERROR, + GOOGLE_ACCOUNT_ALREADY_ASSOCIATED_WITH_NETWORK, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ApiVersionError : ApiError { + private ApiVersionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ApiVersionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ApiVersionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ApiVersionErrorReason { + UPDATE_TO_NEWER_VERSION, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApiException))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ApplicationException { + private string messageField; + + private string applicationExceptionTypeField; + + public string message { + get { return this.messageField; } + set { this.messageField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("ApplicationException.Type")] + public string ApplicationExceptionType { + get { return this.applicationExceptionTypeField; } + set { this.applicationExceptionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ApiException : ApplicationException { + private ApiError[] errorsField; + + [System.Xml.Serialization.XmlElementAttribute("errors")] + public ApiError[] errors { + get { return this.errorsField; } + set { this.errorsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class Authentication { + private string authenticationTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Authentication.Type")] + public string AuthenticationType { + get { return this.authenticationTypeField; } + set { this.authenticationTypeField = value; } + } + } + + + + + + + + + + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReconciliationOrderReportServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReconciliationOrderReportService : DfpSoapClient, IReconciliationOrderReportService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReconciliationOrderReportService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/ReconciliationOrderReportServic" + "e"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationOrderReportPage getReconciliationOrderReportsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getReconciliationOrderReportsByStatement", new object[] { filterStatement }); + return ((ReconciliationOrderReportPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performReconciliationOrderReportAction(ReconciliationOrderReportAction reconciliationOrderReportAction, Statement filterStatement) { + object[] results = this.Invoke("performReconciliationOrderReportAction", new object[] { reconciliationOrderReportAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RevertReconciliationOrderReports))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitReconciliationOrderReports))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class ReconciliationOrderReportAction { + private string reconciliationOrderReportActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ReconciliationOrderReportAction.Type")] + public string ReconciliationOrderReportActionType { + get { return this.reconciliationOrderReportActionTypeField; } + set { this.reconciliationOrderReportActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RevertReconciliationOrderReports : ReconciliationOrderReportAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class SubmitReconciliationOrderReports : ReconciliationOrderReportAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ReconciliationOrderReport { + private long idField; + + private bool idFieldSpecified; + + private long reconciliationReportIdField; + + private bool reconciliationReportIdFieldSpecified; + + private long orderIdField; + + private bool orderIdFieldSpecified; + + private ReconciliationOrderReportStatus statusField; + + private bool statusFieldSpecified; + + private DateTime submissionDateTimeField; + + private long submitterIdField; + + private bool submitterIdFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long reconciliationReportId { + get { return this.reconciliationReportIdField; } + set { + this.reconciliationReportIdField = value; + this.reconciliationReportIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reconciliationReportIdSpecified { + get { return this.reconciliationReportIdFieldSpecified; } + set { this.reconciliationReportIdFieldSpecified = value; } + } + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public ReconciliationOrderReportStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public DateTime submissionDateTime { + get { return this.submissionDateTimeField; } + set { this.submissionDateTimeField = value; } + } + + public long submitterId { + get { return this.submitterIdField; } + set { + this.submitterIdField = value; + this.submitterIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool submitterIdSpecified { + get { return this.submitterIdFieldSpecified; } + set { this.submitterIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ReconciliationOrderReportStatus { + DRAFT, + RECONCILED, + REVERTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ReconciliationOrderReportPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ReconciliationOrderReport[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ReconciliationOrderReport[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ReconciliationError : ApiError { + private ReconciliationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReconciliationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReconciliationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ReconciliationErrorReason { + CANNOT_CREATE_RECONCILIATION_REPORT_VERSION, + INVALID_RECONCILIATION_REPORT_STATE_TRANSITION, + INVALID_RECONCILIATION_PROPOSAL_SUBMISSION_SEQUENCE, + USER_CANNOT_RECONCILE_RECONCILIATION_REPORT, + CONTRACTED_VOLUME_CANNOT_BE_NULL, + DFP_VOLUME_CANNOT_BE_NULL, + MANUAL_VOLUME_CANNOT_BE_NULL, + THIRD_PARTY_VOLUME_CANNOT_BE_NULL, + DUPLICATE_LINE_ITEM_AND_CREATIVE, + CANNOT_RECONCILE_LINE_ITEM_CREATIVE, + LINE_ITEM_DAYS_MISMATCH, + LINE_ITEM_BILL_OFF_OF_MISMATCH, + CANNOT_MODIFY_RECONCILED_ORDER, + CANNOT_MODIFY_ACROSS_MULTIPLE_RECONCILIATION_REPORTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RangeError : ApiError { + private RangeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RangeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RangeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum RangeErrorReason { + TOO_HIGH, + TOO_LOW, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class NullError : ApiError { + private NullErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NullErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NullError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum NullErrorReason { + NULL_CONTENT + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ForecastServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ForecastService : DfpSoapClient, IForecastService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ForecastService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/ForecastService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Forecast getForecast(LineItem lineItem) { + object[] results = this.Invoke("getForecast", new object[] { lineItem }); + return ((Forecast) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Forecast getForecastById(long lineItemId) { + object[] results = this.Invoke("getForecastById", new object[] { lineItemId }); + return ((Forecast) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ContendingLineItem { + private long lineItemIdField; + + private bool lineItemIdFieldSpecified; + + private long contendingImpressionsField; + + private bool contendingImpressionsFieldSpecified; + + public long lineItemId { + get { return this.lineItemIdField; } + set { + this.lineItemIdField = value; + this.lineItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemIdSpecified { + get { return this.lineItemIdFieldSpecified; } + set { this.lineItemIdFieldSpecified = value; } + } + + public long contendingImpressions { + get { return this.contendingImpressionsField; } + set { + this.contendingImpressionsField = value; + this.contendingImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contendingImpressionsSpecified { + get { return this.contendingImpressionsFieldSpecified; } + set { this.contendingImpressionsFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Forecast { + private long idField; + + private bool idFieldSpecified; + + private long orderIdField; + + private bool orderIdFieldSpecified; + + private UnitType unitTypeField; + + private bool unitTypeFieldSpecified; + + private long availableUnitsField; + + private bool availableUnitsFieldSpecified; + + private long deliveredUnitsField; + + private bool deliveredUnitsFieldSpecified; + + private long matchedUnitsField; + + private bool matchedUnitsFieldSpecified; + + private long possibleUnitsField; + + private bool possibleUnitsFieldSpecified; + + private long reservedUnitsField; + + private bool reservedUnitsFieldSpecified; + + private ContendingLineItem[] contendingLineItemsField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public UnitType unitType { + get { return this.unitTypeField; } + set { + this.unitTypeField = value; + this.unitTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitTypeSpecified { + get { return this.unitTypeFieldSpecified; } + set { this.unitTypeFieldSpecified = value; } + } + + public long availableUnits { + get { return this.availableUnitsField; } + set { + this.availableUnitsField = value; + this.availableUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool availableUnitsSpecified { + get { return this.availableUnitsFieldSpecified; } + set { this.availableUnitsFieldSpecified = value; } + } + + public long deliveredUnits { + get { return this.deliveredUnitsField; } + set { + this.deliveredUnitsField = value; + this.deliveredUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveredUnitsSpecified { + get { return this.deliveredUnitsFieldSpecified; } + set { this.deliveredUnitsFieldSpecified = value; } + } + + public long matchedUnits { + get { return this.matchedUnitsField; } + set { + this.matchedUnitsField = value; + this.matchedUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool matchedUnitsSpecified { + get { return this.matchedUnitsFieldSpecified; } + set { this.matchedUnitsFieldSpecified = value; } + } + + public long possibleUnits { + get { return this.possibleUnitsField; } + set { + this.possibleUnitsField = value; + this.possibleUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool possibleUnitsSpecified { + get { return this.possibleUnitsFieldSpecified; } + set { this.possibleUnitsFieldSpecified = value; } + } + + public long reservedUnits { + get { return this.reservedUnitsField; } + set { + this.reservedUnitsField = value; + this.reservedUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reservedUnitsSpecified { + get { return this.reservedUnitsFieldSpecified; } + set { this.reservedUnitsFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("contendingLineItems")] + public ContendingLineItem[] contendingLineItems { + get { return this.contendingLineItemsField; } + set { this.contendingLineItemsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum UnitType { + IMPRESSIONS, + CLICKS + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class VideoPositionWithinPod { + private int indexField; + + private bool indexFieldSpecified; + + public int index { + get { return this.indexField; } + set { + this.indexField = value; + this.indexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool indexSpecified { + get { return this.indexFieldSpecified; } + set { this.indexFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class VideoPosition { + private VideoPositionType positionTypeField; + + private bool positionTypeFieldSpecified; + + private int midrollIndexField; + + private bool midrollIndexFieldSpecified; + + public VideoPositionType positionType { + get { return this.positionTypeField; } + set { + this.positionTypeField = value; + this.positionTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool positionTypeSpecified { + get { return this.positionTypeFieldSpecified; } + set { this.positionTypeFieldSpecified = value; } + } + + public int midrollIndex { + get { return this.midrollIndexField; } + set { + this.midrollIndexField = value; + this.midrollIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool midrollIndexSpecified { + get { return this.midrollIndexFieldSpecified; } + set { this.midrollIndexFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "VideoPosition.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum VideoPositionType { + PREROLL, + MIDROLL, + POSTROLL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class VideoPositionTarget { + private VideoPosition videoPositionField; + + private VideoBumperType videoBumperTypeField; + + private bool videoBumperTypeFieldSpecified; + + private VideoPositionWithinPod videoPositionWithinPodField; + + public VideoPosition videoPosition { + get { return this.videoPositionField; } + set { this.videoPositionField = value; } + } + + public VideoBumperType videoBumperType { + get { return this.videoBumperTypeField; } + set { + this.videoBumperTypeField = value; + this.videoBumperTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoBumperTypeSpecified { + get { return this.videoBumperTypeFieldSpecified; } + set { this.videoBumperTypeFieldSpecified = value; } + } + + public VideoPositionWithinPod videoPositionWithinPod { + get { return this.videoPositionWithinPodField; } + set { this.videoPositionWithinPodField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum VideoBumperType { + BEFORE, + AFTER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class VideoPositionTargeting { + private VideoPositionTarget[] targetedPositionsField; + + + [System.Xml.Serialization.XmlElementAttribute("targetedPositions")] + public VideoPositionTarget[] targetedPositions { + get { return this.targetedPositionsField; } + set { this.targetedPositionsField = value; } + } + + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ContentMetadataKeyHierarchyTargeting { + private long[] customTargetingValueIdsField; + + + [System.Xml.Serialization.XmlElementAttribute("customTargetingValueIds")] + public long[] customTargetingValueIds { + get { return this.customTargetingValueIdsField; } + set { this.customTargetingValueIdsField = value; } + } + + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ContentTargeting { + private long[] targetedContentIdsField; + + private long[] excludedContentIdsField; + + private long[] targetedVideoCategoryIdsField; + + private long[] excludedVideoCategoryIdsField; + + private long[] targetedVideoContentBundleIdsField; + + private long[] excludedVideoContentBundleIdsField; + + private ContentMetadataKeyHierarchyTargeting[] targetedContentMetadataField; + + private ContentMetadataKeyHierarchyTargeting[] excludedContentMetadataField; + + + [System.Xml.Serialization.XmlElementAttribute("targetedContentIds")] + public long[] targetedContentIds { + get { return this.targetedContentIdsField; } + set { this.targetedContentIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedContentIds")] + public long[] excludedContentIds { + get { return this.excludedContentIdsField; } + set { this.excludedContentIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedVideoCategoryIds")] + public long[] targetedVideoCategoryIds { + get { return this.targetedVideoCategoryIdsField; } + set { this.targetedVideoCategoryIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedVideoCategoryIds")] + public long[] excludedVideoCategoryIds { + get { return this.excludedVideoCategoryIdsField; } + set { this.excludedVideoCategoryIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedVideoContentBundleIds")] + public long[] targetedVideoContentBundleIds { + get { return this.targetedVideoContentBundleIdsField; } + set { this.targetedVideoContentBundleIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedVideoContentBundleIds")] + public long[] excludedVideoContentBundleIds { + get { return this.excludedVideoContentBundleIdsField; } + set { this.excludedVideoContentBundleIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedContentMetadata")] + public ContentMetadataKeyHierarchyTargeting[] targetedContentMetadata { + get { return this.targetedContentMetadataField; } + set { this.targetedContentMetadataField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedContentMetadata")] + public ContentMetadataKeyHierarchyTargeting[] excludedContentMetadata { + get { return this.excludedContentMetadataField; } + set { this.excludedContentMetadataField = value; } + } + + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class UserDomainTargeting { + private string[] domainsField; + + private bool targetedField; + + private bool targetedFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("domains")] + public string[] domains { + get { return this.domainsField; } + set { this.domainsField = value; } + } + + public bool targeted { + get { return this.targetedField; } + set { + this.targetedField = value; + this.targetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetedSpecified { + get { return this.targetedFieldSpecified; } + set { this.targetedFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class OperatingSystemVersionTargeting { + private Technology[] targetedOperatingSystemVersionsField; + + private Technology[] excludedOperatingSystemVersionsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedOperatingSystemVersions")] + public Technology[] targetedOperatingSystemVersions { + get { return this.targetedOperatingSystemVersionsField; } + set { this.targetedOperatingSystemVersionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedOperatingSystemVersions")] + public Technology[] excludedOperatingSystemVersions { + get { return this.excludedOperatingSystemVersionsField; } + set { this.excludedOperatingSystemVersionsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystemVersion))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystem))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileDeviceSubmodel))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileDevice))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileCarrier))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceManufacturer))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceCategory))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceCapability))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BrowserLanguage))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Browser))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BandwidthGroup))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Technology { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string technologyTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Technology.Type")] + public string TechnologyType { + get { return this.technologyTypeField; } + set { this.technologyTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class OperatingSystemVersion : Technology { + private int majorVersionField; + + private bool majorVersionFieldSpecified; + + private int minorVersionField; + + private bool minorVersionFieldSpecified; + + private int microVersionField; + + private bool microVersionFieldSpecified; + + public int majorVersion { + get { return this.majorVersionField; } + set { + this.majorVersionField = value; + this.majorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool majorVersionSpecified { + get { return this.majorVersionFieldSpecified; } + set { this.majorVersionFieldSpecified = value; } + } + + public int minorVersion { + get { return this.minorVersionField; } + set { + this.minorVersionField = value; + this.minorVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minorVersionSpecified { + get { return this.minorVersionFieldSpecified; } + set { this.minorVersionFieldSpecified = value; } + } + + public int microVersion { + get { return this.microVersionField; } + set { + this.microVersionField = value; + this.microVersionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool microVersionSpecified { + get { return this.microVersionFieldSpecified; } + set { this.microVersionFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class OperatingSystem : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class MobileDeviceSubmodel : Technology { + private long mobileDeviceCriterionIdField; + + private bool mobileDeviceCriterionIdFieldSpecified; + + private long deviceManufacturerCriterionIdField; + + private bool deviceManufacturerCriterionIdFieldSpecified; + + public long mobileDeviceCriterionId { + get { return this.mobileDeviceCriterionIdField; } + set { + this.mobileDeviceCriterionIdField = value; + this.mobileDeviceCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mobileDeviceCriterionIdSpecified { + get { return this.mobileDeviceCriterionIdFieldSpecified; } + set { this.mobileDeviceCriterionIdFieldSpecified = value; } + } + + public long deviceManufacturerCriterionId { + get { return this.deviceManufacturerCriterionIdField; } + set { + this.deviceManufacturerCriterionIdField = value; + this.deviceManufacturerCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deviceManufacturerCriterionIdSpecified { + get { return this.deviceManufacturerCriterionIdFieldSpecified; } + set { this.deviceManufacturerCriterionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class MobileDevice : Technology { + private long manufacturerCriterionIdField; + + private bool manufacturerCriterionIdFieldSpecified; + + public long manufacturerCriterionId { + get { return this.manufacturerCriterionIdField; } + set { + this.manufacturerCriterionIdField = value; + this.manufacturerCriterionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manufacturerCriterionIdSpecified { + get { return this.manufacturerCriterionIdFieldSpecified; } + set { this.manufacturerCriterionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class MobileCarrier : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeviceManufacturer : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeviceCategory : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeviceCapability : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class BrowserLanguage : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Browser : Technology { + private string majorVersionField; + + private string minorVersionField; + + public string majorVersion { + get { return this.majorVersionField; } + set { this.majorVersionField = value; } + } + + public string minorVersion { + get { return this.minorVersionField; } + set { this.minorVersionField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class BandwidthGroup : Technology { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class OperatingSystemTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] operatingSystemsField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("operatingSystems")] + public Technology[] operatingSystems { + get { return this.operatingSystemsField; } + set { this.operatingSystemsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class MobileDeviceSubmodelTargeting { + private Technology[] targetedMobileDeviceSubmodelsField; + + private Technology[] excludedMobileDeviceSubmodelsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedMobileDeviceSubmodels")] + public Technology[] targetedMobileDeviceSubmodels { + get { return this.targetedMobileDeviceSubmodelsField; } + set { this.targetedMobileDeviceSubmodelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedMobileDeviceSubmodels")] + public Technology[] excludedMobileDeviceSubmodels { + get { return this.excludedMobileDeviceSubmodelsField; } + set { this.excludedMobileDeviceSubmodelsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class MobileDeviceTargeting { + private Technology[] targetedMobileDevicesField; + + private Technology[] excludedMobileDevicesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedMobileDevices")] + public Technology[] targetedMobileDevices { + get { return this.targetedMobileDevicesField; } + set { this.targetedMobileDevicesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedMobileDevices")] + public Technology[] excludedMobileDevices { + get { return this.excludedMobileDevicesField; } + set { this.excludedMobileDevicesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class MobileCarrierTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] mobileCarriersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("mobileCarriers")] + public Technology[] mobileCarriers { + get { return this.mobileCarriersField; } + set { this.mobileCarriersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeviceManufacturerTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] deviceManufacturersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("deviceManufacturers")] + public Technology[] deviceManufacturers { + get { return this.deviceManufacturersField; } + set { this.deviceManufacturersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeviceCategoryTargeting { + private Technology[] targetedDeviceCategoriesField; + + private Technology[] excludedDeviceCategoriesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedDeviceCategories")] + public Technology[] targetedDeviceCategories { + get { return this.targetedDeviceCategoriesField; } + set { this.targetedDeviceCategoriesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedDeviceCategories")] + public Technology[] excludedDeviceCategories { + get { return this.excludedDeviceCategoriesField; } + set { this.excludedDeviceCategoriesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeviceCapabilityTargeting { + private Technology[] targetedDeviceCapabilitiesField; + + private Technology[] excludedDeviceCapabilitiesField; + + [System.Xml.Serialization.XmlElementAttribute("targetedDeviceCapabilities")] + public Technology[] targetedDeviceCapabilities { + get { return this.targetedDeviceCapabilitiesField; } + set { this.targetedDeviceCapabilitiesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedDeviceCapabilities")] + public Technology[] excludedDeviceCapabilities { + get { return this.excludedDeviceCapabilitiesField; } + set { this.excludedDeviceCapabilitiesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class BrowserLanguageTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] browserLanguagesField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("browserLanguages")] + public Technology[] browserLanguages { + get { return this.browserLanguagesField; } + set { this.browserLanguagesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class BrowserTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] browsersField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("browsers")] + public Technology[] browsers { + get { return this.browsersField; } + set { this.browsersField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class BandwidthGroupTargeting { + private bool isTargetedField; + + private bool isTargetedFieldSpecified; + + private Technology[] bandwidthGroupsField; + + public bool isTargeted { + get { return this.isTargetedField; } + set { + this.isTargetedField = value; + this.isTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTargetedSpecified { + get { return this.isTargetedFieldSpecified; } + set { this.isTargetedFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("bandwidthGroups")] + public Technology[] bandwidthGroups { + get { return this.bandwidthGroupsField; } + set { this.bandwidthGroupsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class TechnologyTargeting { + private BandwidthGroupTargeting bandwidthGroupTargetingField; + + private BrowserTargeting browserTargetingField; + + private BrowserLanguageTargeting browserLanguageTargetingField; + + private DeviceCapabilityTargeting deviceCapabilityTargetingField; + + private DeviceCategoryTargeting deviceCategoryTargetingField; + + private DeviceManufacturerTargeting deviceManufacturerTargetingField; + + private MobileCarrierTargeting mobileCarrierTargetingField; + + private MobileDeviceTargeting mobileDeviceTargetingField; + + private MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargetingField; + + private OperatingSystemTargeting operatingSystemTargetingField; + + private OperatingSystemVersionTargeting operatingSystemVersionTargetingField; + + public BandwidthGroupTargeting bandwidthGroupTargeting { + get { return this.bandwidthGroupTargetingField; } + set { this.bandwidthGroupTargetingField = value; } + } + + public BrowserTargeting browserTargeting { + get { return this.browserTargetingField; } + set { this.browserTargetingField = value; } + } + + public BrowserLanguageTargeting browserLanguageTargeting { + get { return this.browserLanguageTargetingField; } + set { this.browserLanguageTargetingField = value; } + } + + public DeviceCapabilityTargeting deviceCapabilityTargeting { + get { return this.deviceCapabilityTargetingField; } + set { this.deviceCapabilityTargetingField = value; } + } + + public DeviceCategoryTargeting deviceCategoryTargeting { + get { return this.deviceCategoryTargetingField; } + set { this.deviceCategoryTargetingField = value; } + } + + public DeviceManufacturerTargeting deviceManufacturerTargeting { + get { return this.deviceManufacturerTargetingField; } + set { this.deviceManufacturerTargetingField = value; } + } + + public MobileCarrierTargeting mobileCarrierTargeting { + get { return this.mobileCarrierTargetingField; } + set { this.mobileCarrierTargetingField = value; } + } + + public MobileDeviceTargeting mobileDeviceTargeting { + get { return this.mobileDeviceTargetingField; } + set { this.mobileDeviceTargetingField = value; } + } + + public MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargeting { + get { return this.mobileDeviceSubmodelTargetingField; } + set { this.mobileDeviceSubmodelTargetingField = value; } + } + + public OperatingSystemTargeting operatingSystemTargeting { + get { return this.operatingSystemTargetingField; } + set { this.operatingSystemTargetingField = value; } + } + + public OperatingSystemVersionTargeting operatingSystemVersionTargeting { + get { return this.operatingSystemVersionTargetingField; } + set { this.operatingSystemVersionTargetingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class TimeOfDay { + private int hourField; + + private bool hourFieldSpecified; + + private MinuteOfHour minuteField; + + private bool minuteFieldSpecified; + + public int hour { + get { return this.hourField; } + set { + this.hourField = value; + this.hourSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hourSpecified { + get { return this.hourFieldSpecified; } + set { this.hourFieldSpecified = value; } + } + + public MinuteOfHour minute { + get { return this.minuteField; } + set { + this.minuteField = value; + this.minuteSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minuteSpecified { + get { return this.minuteFieldSpecified; } + set { this.minuteFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum MinuteOfHour { + ZERO, + FIFTEEN, + THIRTY, + FORTY_FIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DayPart { + private DayOfWeek dayOfWeekField; + + private bool dayOfWeekFieldSpecified; + + private TimeOfDay startTimeField; + + private TimeOfDay endTimeField; + + public DayOfWeek dayOfWeek { + get { return this.dayOfWeekField; } + set { + this.dayOfWeekField = value; + this.dayOfWeekSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dayOfWeekSpecified { + get { return this.dayOfWeekFieldSpecified; } + set { this.dayOfWeekFieldSpecified = value; } + } + + public TimeOfDay startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public TimeOfDay endTime { + get { return this.endTimeField; } + set { this.endTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum DayOfWeek { + MONDAY, + TUESDAY, + WEDNESDAY, + THURSDAY, + FRIDAY, + SATURDAY, + SUNDAY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DayPartTargeting { + private DayPart[] dayPartsField; + + private DeliveryTimeZone timeZoneField; + + private bool timeZoneFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("dayParts")] + public DayPart[] dayParts { + get { return this.dayPartsField; } + set { this.dayPartsField = value; } + } + + public DeliveryTimeZone timeZone { + get { return this.timeZoneField; } + set { + this.timeZoneField = value; + this.timeZoneSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool timeZoneSpecified { + get { return this.timeZoneFieldSpecified; } + set { this.timeZoneFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum DeliveryTimeZone { + PUBLISHER, + BROWSER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Location { + private long idField; + + private bool idFieldSpecified; + + private string typeField; + + private int canonicalParentIdField; + + private bool canonicalParentIdFieldSpecified; + + private string displayNameField; + + private string locationTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string type { + get { return this.typeField; } + set { this.typeField = value; } + } + + public int canonicalParentId { + get { return this.canonicalParentIdField; } + set { + this.canonicalParentIdField = value; + this.canonicalParentIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool canonicalParentIdSpecified { + get { return this.canonicalParentIdFieldSpecified; } + set { this.canonicalParentIdFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Location.Type")] + public string LocationType { + get { return this.locationTypeField; } + set { this.locationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class GeoTargeting { + private Location[] targetedLocationsField; + + private Location[] excludedLocationsField; + + [System.Xml.Serialization.XmlElementAttribute("targetedLocations")] + public Location[] targetedLocations { + get { return this.targetedLocationsField; } + set { this.targetedLocationsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("excludedLocations")] + public Location[] excludedLocations { + get { return this.excludedLocationsField; } + set { this.excludedLocationsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Targeting { + private GeoTargeting geoTargetingField; + + private InventoryTargeting inventoryTargetingField; + + private DayPartTargeting dayPartTargetingField; + + private TechnologyTargeting technologyTargetingField; + + private CustomCriteriaSet customTargetingField; + + private UserDomainTargeting userDomainTargetingField; + + private ContentTargeting contentTargetingField; + + private VideoPositionTargeting videoPositionTargetingField; + + public GeoTargeting geoTargeting { + get { return this.geoTargetingField; } + set { this.geoTargetingField = value; } + } + + public InventoryTargeting inventoryTargeting { + get { return this.inventoryTargetingField; } + set { this.inventoryTargetingField = value; } + } + + public DayPartTargeting dayPartTargeting { + get { return this.dayPartTargetingField; } + set { this.dayPartTargetingField = value; } + } + + public TechnologyTargeting technologyTargeting { + get { return this.technologyTargetingField; } + set { this.technologyTargetingField = value; } + } + + public CustomCriteriaSet customTargeting { + get { return this.customTargetingField; } + set { this.customTargetingField = value; } + } + + public UserDomainTargeting userDomainTargeting { + get { return this.userDomainTargetingField; } + set { this.userDomainTargetingField = value; } + } + + public ContentTargeting contentTargeting { + get { return this.contentTargetingField; } + set { this.contentTargetingField = value; } + } + + public VideoPositionTargeting videoPositionTargeting { + get { return this.videoPositionTargetingField; } + set { this.videoPositionTargetingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class GrpSettings { + private long minTargetAgeField; + + private bool minTargetAgeFieldSpecified; + + private long maxTargetAgeField; + + private bool maxTargetAgeFieldSpecified; + + private GrpTargetGender targetGenderField; + + private bool targetGenderFieldSpecified; + + private GrpProvider providerField; + + private bool providerFieldSpecified; + + public long minTargetAge { + get { return this.minTargetAgeField; } + set { + this.minTargetAgeField = value; + this.minTargetAgeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minTargetAgeSpecified { + get { return this.minTargetAgeFieldSpecified; } + set { this.minTargetAgeFieldSpecified = value; } + } + + public long maxTargetAge { + get { return this.maxTargetAgeField; } + set { + this.maxTargetAgeField = value; + this.maxTargetAgeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxTargetAgeSpecified { + get { return this.maxTargetAgeFieldSpecified; } + set { this.maxTargetAgeFieldSpecified = value; } + } + + public GrpTargetGender targetGender { + get { return this.targetGenderField; } + set { + this.targetGenderField = value; + this.targetGenderSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetGenderSpecified { + get { return this.targetGenderFieldSpecified; } + set { this.targetGenderFieldSpecified = value; } + } + + public GrpProvider provider { + get { return this.providerField; } + set { + this.providerField = value; + this.providerSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool providerSpecified { + get { return this.providerFieldSpecified; } + set { this.providerFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum GrpTargetGender { + UNKNOWN, + MALE, + FEMALE, + BOTH + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum GrpProvider { + UNKNOWN, + NIELSEN, + COMSCORE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Goal { + private UnitType unitTypeField; + + private bool unitTypeFieldSpecified; + + private long unitsField; + + private bool unitsFieldSpecified; + + public UnitType unitType { + get { return this.unitTypeField; } + set { + this.unitTypeField = value; + this.unitTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitTypeSpecified { + get { return this.unitTypeFieldSpecified; } + set { this.unitTypeFieldSpecified = value; } + } + + public long units { + get { return this.unitsField; } + set { + this.unitsField = value; + this.unitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitsSpecified { + get { return this.unitsFieldSpecified; } + set { this.unitsFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DropDownCustomFieldValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomFieldValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class BaseCustomFieldValue { + private long customFieldIdField; + + private bool customFieldIdFieldSpecified; + + private string baseCustomFieldValueTypeField; + + public long customFieldId { + get { return this.customFieldIdField; } + set { + this.customFieldIdField = value; + this.customFieldIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldIdSpecified { + get { return this.customFieldIdFieldSpecified; } + set { this.customFieldIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseCustomFieldValue.Type")] + public string BaseCustomFieldValueType { + get { return this.baseCustomFieldValueTypeField; } + set { this.baseCustomFieldValueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DropDownCustomFieldValue : BaseCustomFieldValue { + private long customFieldOptionIdField; + + private bool customFieldOptionIdFieldSpecified; + + public long customFieldOptionId { + get { return this.customFieldOptionIdField; } + set { + this.customFieldOptionIdField = value; + this.customFieldOptionIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldOptionIdSpecified { + get { return this.customFieldOptionIdFieldSpecified; } + set { this.customFieldOptionIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CustomFieldValue : BaseCustomFieldValue { + private Value valueField; + + public Value value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeliveryIndicator { + private double expectedDeliveryPercentageField; + + private bool expectedDeliveryPercentageFieldSpecified; + + private double actualDeliveryPercentageField; + + private bool actualDeliveryPercentageFieldSpecified; + + public double expectedDeliveryPercentage { + get { return this.expectedDeliveryPercentageField; } + set { + this.expectedDeliveryPercentageField = value; + this.expectedDeliveryPercentageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expectedDeliveryPercentageSpecified { + get { return this.expectedDeliveryPercentageFieldSpecified; } + set { this.expectedDeliveryPercentageFieldSpecified = value; } + } + + public double actualDeliveryPercentage { + get { return this.actualDeliveryPercentageField; } + set { + this.actualDeliveryPercentageField = value; + this.actualDeliveryPercentageSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool actualDeliveryPercentageSpecified { + get { return this.actualDeliveryPercentageFieldSpecified; } + set { this.actualDeliveryPercentageFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Stats { + private long impressionsDeliveredField; + + private bool impressionsDeliveredFieldSpecified; + + private long clicksDeliveredField; + + private bool clicksDeliveredFieldSpecified; + + private long videoCompletionsDeliveredField; + + private bool videoCompletionsDeliveredFieldSpecified; + + private long videoStartsDeliveredField; + + private bool videoStartsDeliveredFieldSpecified; + + public long impressionsDelivered { + get { return this.impressionsDeliveredField; } + set { + this.impressionsDeliveredField = value; + this.impressionsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsDeliveredSpecified { + get { return this.impressionsDeliveredFieldSpecified; } + set { this.impressionsDeliveredFieldSpecified = value; } + } + + public long clicksDelivered { + get { return this.clicksDeliveredField; } + set { + this.clicksDeliveredField = value; + this.clicksDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clicksDeliveredSpecified { + get { return this.clicksDeliveredFieldSpecified; } + set { this.clicksDeliveredFieldSpecified = value; } + } + + public long videoCompletionsDelivered { + get { return this.videoCompletionsDeliveredField; } + set { + this.videoCompletionsDeliveredField = value; + this.videoCompletionsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoCompletionsDeliveredSpecified { + get { return this.videoCompletionsDeliveredFieldSpecified; } + set { this.videoCompletionsDeliveredFieldSpecified = value; } + } + + public long videoStartsDelivered { + get { return this.videoStartsDeliveredField; } + set { + this.videoStartsDeliveredField = value; + this.videoStartsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoStartsDeliveredSpecified { + get { return this.videoStartsDeliveredFieldSpecified; } + set { this.videoStartsDeliveredFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AppliedLabel { + private long labelIdField; + + private bool labelIdFieldSpecified; + + private bool isNegatedField; + + private bool isNegatedFieldSpecified; + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + + public bool isNegated { + get { return this.isNegatedField; } + set { + this.isNegatedField = value; + this.isNegatedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isNegatedSpecified { + get { return this.isNegatedFieldSpecified; } + set { this.isNegatedFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Size { + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + private bool isAspectRatioField; + + private bool isAspectRatioFieldSpecified; + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + public bool isAspectRatio { + get { return this.isAspectRatioField; } + set { + this.isAspectRatioField = value; + this.isAspectRatioSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAspectRatioSpecified { + get { return this.isAspectRatioFieldSpecified; } + set { this.isAspectRatioFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CreativePlaceholder { + private Size sizeField; + + private CreativePlaceholder[] companionsField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private long idField; + + private bool idFieldSpecified; + + private int expectedCreativeCountField; + + private bool expectedCreativeCountFieldSpecified; + + private CreativeSizeType creativeSizeTypeField; + + private bool creativeSizeTypeFieldSpecified; + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companions")] + public CreativePlaceholder[] companions { + get { return this.companionsField; } + set { this.companionsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public int expectedCreativeCount { + get { return this.expectedCreativeCountField; } + set { + this.expectedCreativeCountField = value; + this.expectedCreativeCountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool expectedCreativeCountSpecified { + get { return this.expectedCreativeCountFieldSpecified; } + set { this.expectedCreativeCountFieldSpecified = value; } + } + + public CreativeSizeType creativeSizeType { + get { return this.creativeSizeTypeField; } + set { + this.creativeSizeTypeField = value; + this.creativeSizeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeSizeTypeSpecified { + get { return this.creativeSizeTypeFieldSpecified; } + set { this.creativeSizeTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CreativeSizeType { + PIXEL, + ASPECT_RATIO, + INTERSTITIAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class FrequencyCap { + private int maxImpressionsField; + + private bool maxImpressionsFieldSpecified; + + private int numTimeUnitsField; + + private bool numTimeUnitsFieldSpecified; + + private TimeUnit timeUnitField; + + private bool timeUnitFieldSpecified; + + public int maxImpressions { + get { return this.maxImpressionsField; } + set { + this.maxImpressionsField = value; + this.maxImpressionsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxImpressionsSpecified { + get { return this.maxImpressionsFieldSpecified; } + set { this.maxImpressionsFieldSpecified = value; } + } + + public int numTimeUnits { + get { return this.numTimeUnitsField; } + set { + this.numTimeUnitsField = value; + this.numTimeUnitsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numTimeUnitsSpecified { + get { return this.numTimeUnitsFieldSpecified; } + set { this.numTimeUnitsFieldSpecified = value; } + } + + public TimeUnit timeUnit { + get { return this.timeUnitField; } + set { + this.timeUnitField = value; + this.timeUnitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool timeUnitSpecified { + get { return this.timeUnitFieldSpecified; } + set { this.timeUnitFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum TimeUnit { + MINUTE, + HOUR, + DAY, + WEEK, + MONTH, + LIFETIME, + POD, + STREAM + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItem))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LineItemSummary { + private long orderIdField; + + private bool orderIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string externalIdField; + + private string orderNameField; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private int autoExtensionDaysField; + + private bool autoExtensionDaysFieldSpecified; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private CreativeRotationType creativeRotationTypeField; + + private bool creativeRotationTypeFieldSpecified; + + private DeliveryRateType deliveryRateTypeField; + + private bool deliveryRateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int priorityField; + + private bool priorityFieldSpecified; + + private Money costPerUnitField; + + private Money valueCostPerUnitField; + + private CostType costTypeField; + + private bool costTypeFieldSpecified; + + private LineItemDiscountType discountTypeField; + + private bool discountTypeFieldSpecified; + + private double discountField; + + private bool discountFieldSpecified; + + private long contractedUnitsBoughtField; + + private bool contractedUnitsBoughtFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private EnvironmentType environmentTypeField; + + private bool environmentTypeFieldSpecified; + + private CompanionDeliveryOption companionDeliveryOptionField; + + private bool companionDeliveryOptionFieldSpecified; + + private CreativePersistenceType creativePersistenceTypeField; + + private bool creativePersistenceTypeFieldSpecified; + + private bool allowOverbookField; + + private bool allowOverbookFieldSpecified; + + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + private bool reserveAtCreationField; + + private bool reserveAtCreationFieldSpecified; + + private Stats statsField; + + private DeliveryIndicator deliveryIndicatorField; + + private long[] deliveryDataField; + + private Money budgetField; + + private ComputedStatus statusField; + + private bool statusFieldSpecified; + + private LineItemSummaryReservationStatus reservationStatusField; + + private bool reservationStatusFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private string webPropertyCodeField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private bool disableSameAdvertiserCompetitiveExclusionField; + + private bool disableSameAdvertiserCompetitiveExclusionFieldSpecified; + + private string lastModifiedByAppField; + + private string notesField; + + private DateTime lastModifiedDateTimeField; + + private DateTime creationDateTimeField; + + private bool isPrioritizedPreferredDealsEnabledField; + + private bool isPrioritizedPreferredDealsEnabledFieldSpecified; + + private int adExchangeAuctionOpeningPriorityField; + + private bool adExchangeAuctionOpeningPriorityFieldSpecified; + + private BaseCustomFieldValue[] customFieldValuesField; + + private bool isMissingCreativesField; + + private bool isMissingCreativesFieldSpecified; + + private Goal primaryGoalField; + + private GrpSettings grpSettingsField; + + private string lineItemSummaryTypeField; + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string externalId { + get { return this.externalIdField; } + set { this.externalIdField = value; } + } + + public string orderName { + get { return this.orderNameField; } + set { this.orderNameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public int autoExtensionDays { + get { return this.autoExtensionDaysField; } + set { + this.autoExtensionDaysField = value; + this.autoExtensionDaysSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool autoExtensionDaysSpecified { + get { return this.autoExtensionDaysFieldSpecified; } + set { this.autoExtensionDaysFieldSpecified = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public CreativeRotationType creativeRotationType { + get { return this.creativeRotationTypeField; } + set { + this.creativeRotationTypeField = value; + this.creativeRotationTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeRotationTypeSpecified { + get { return this.creativeRotationTypeFieldSpecified; } + set { this.creativeRotationTypeFieldSpecified = value; } + } + + public DeliveryRateType deliveryRateType { + get { return this.deliveryRateTypeField; } + set { + this.deliveryRateTypeField = value; + this.deliveryRateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryRateTypeSpecified { + get { return this.deliveryRateTypeFieldSpecified; } + set { this.deliveryRateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + public Money costPerUnit { + get { return this.costPerUnitField; } + set { this.costPerUnitField = value; } + } + + public Money valueCostPerUnit { + get { return this.valueCostPerUnitField; } + set { this.valueCostPerUnitField = value; } + } + + public CostType costType { + get { return this.costTypeField; } + set { + this.costTypeField = value; + this.costTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool costTypeSpecified { + get { return this.costTypeFieldSpecified; } + set { this.costTypeFieldSpecified = value; } + } + + public LineItemDiscountType discountType { + get { return this.discountTypeField; } + set { + this.discountTypeField = value; + this.discountTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool discountTypeSpecified { + get { return this.discountTypeFieldSpecified; } + set { this.discountTypeFieldSpecified = value; } + } + + public double discount { + get { return this.discountField; } + set { + this.discountField = value; + this.discountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool discountSpecified { + get { return this.discountFieldSpecified; } + set { this.discountFieldSpecified = value; } + } + + public long contractedUnitsBought { + get { return this.contractedUnitsBoughtField; } + set { + this.contractedUnitsBoughtField = value; + this.contractedUnitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contractedUnitsBoughtSpecified { + get { return this.contractedUnitsBoughtFieldSpecified; } + set { this.contractedUnitsBoughtFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + public EnvironmentType environmentType { + get { return this.environmentTypeField; } + set { + this.environmentTypeField = value; + this.environmentTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool environmentTypeSpecified { + get { return this.environmentTypeFieldSpecified; } + set { this.environmentTypeFieldSpecified = value; } + } + + public CompanionDeliveryOption companionDeliveryOption { + get { return this.companionDeliveryOptionField; } + set { + this.companionDeliveryOptionField = value; + this.companionDeliveryOptionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companionDeliveryOptionSpecified { + get { return this.companionDeliveryOptionFieldSpecified; } + set { this.companionDeliveryOptionFieldSpecified = value; } + } + + public CreativePersistenceType creativePersistenceType { + get { return this.creativePersistenceTypeField; } + set { + this.creativePersistenceTypeField = value; + this.creativePersistenceTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativePersistenceTypeSpecified { + get { return this.creativePersistenceTypeFieldSpecified; } + set { this.creativePersistenceTypeFieldSpecified = value; } + } + + public bool allowOverbook { + get { return this.allowOverbookField; } + set { + this.allowOverbookField = value; + this.allowOverbookSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowOverbookSpecified { + get { return this.allowOverbookFieldSpecified; } + set { this.allowOverbookFieldSpecified = value; } + } + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + + public bool reserveAtCreation { + get { return this.reserveAtCreationField; } + set { + this.reserveAtCreationField = value; + this.reserveAtCreationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reserveAtCreationSpecified { + get { return this.reserveAtCreationFieldSpecified; } + set { this.reserveAtCreationFieldSpecified = value; } + } + + public Stats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public DeliveryIndicator deliveryIndicator { + get { return this.deliveryIndicatorField; } + set { this.deliveryIndicatorField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("units", IsNullable = false)] + public long[] deliveryData { + get { return this.deliveryDataField; } + set { this.deliveryDataField = value; } + } + + public Money budget { + get { return this.budgetField; } + set { this.budgetField = value; } + } + + public ComputedStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public LineItemSummaryReservationStatus reservationStatus { + get { return this.reservationStatusField; } + set { + this.reservationStatusField = value; + this.reservationStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reservationStatusSpecified { + get { return this.reservationStatusFieldSpecified; } + set { this.reservationStatusFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public string webPropertyCode { + get { return this.webPropertyCodeField; } + set { this.webPropertyCodeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public bool disableSameAdvertiserCompetitiveExclusion { + get { return this.disableSameAdvertiserCompetitiveExclusionField; } + set { + this.disableSameAdvertiserCompetitiveExclusionField = value; + this.disableSameAdvertiserCompetitiveExclusionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool disableSameAdvertiserCompetitiveExclusionSpecified { + get { return this.disableSameAdvertiserCompetitiveExclusionFieldSpecified; } + set { this.disableSameAdvertiserCompetitiveExclusionFieldSpecified = value; } + } + + public string lastModifiedByApp { + get { return this.lastModifiedByAppField; } + set { this.lastModifiedByAppField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public DateTime creationDateTime { + get { return this.creationDateTimeField; } + set { this.creationDateTimeField = value; } + } + + public bool isPrioritizedPreferredDealsEnabled { + get { return this.isPrioritizedPreferredDealsEnabledField; } + set { + this.isPrioritizedPreferredDealsEnabledField = value; + this.isPrioritizedPreferredDealsEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isPrioritizedPreferredDealsEnabledSpecified { + get { return this.isPrioritizedPreferredDealsEnabledFieldSpecified; } + set { this.isPrioritizedPreferredDealsEnabledFieldSpecified = value; } + } + + public int adExchangeAuctionOpeningPriority { + get { return this.adExchangeAuctionOpeningPriorityField; } + set { + this.adExchangeAuctionOpeningPriorityField = value; + this.adExchangeAuctionOpeningPrioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adExchangeAuctionOpeningPrioritySpecified { + get { return this.adExchangeAuctionOpeningPriorityFieldSpecified; } + set { this.adExchangeAuctionOpeningPriorityFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + public bool isMissingCreatives { + get { return this.isMissingCreativesField; } + set { + this.isMissingCreativesField = value; + this.isMissingCreativesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isMissingCreativesSpecified { + get { return this.isMissingCreativesFieldSpecified; } + set { this.isMissingCreativesFieldSpecified = value; } + } + + public Goal primaryGoal { + get { return this.primaryGoalField; } + set { this.primaryGoalField = value; } + } + + public GrpSettings grpSettings { + get { return this.grpSettingsField; } + set { this.grpSettingsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("LineItemSummary.Type")] + public string LineItemSummaryType { + get { return this.lineItemSummaryTypeField; } + set { this.lineItemSummaryTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum StartDateTimeType { + USE_START_DATE_TIME, + IMMEDIATELY, + ONE_HOUR_FROM_NOW + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CreativeRotationType { + EVEN, + OPTIMIZED, + MANUAL, + SEQUENTIAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum DeliveryRateType { + EVENLY, + FRONTLOADED, + AS_FAST_AS_POSSIBLE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum RoadblockingType { + ONLY_ONE, + ONE_OR_MORE, + AS_MANY_AS_POSSIBLE, + ALL_ROADBLOCK, + CREATIVE_SET + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum LineItemType { + SPONSORSHIP, + STANDARD, + NETWORK, + BULK, + PRICE_PRIORITY, + HOUSE, + LEGACY_DFP, + CLICK_TRACKING, + ADSENSE, + AD_EXCHANGE, + BUMPER, + ADMOB, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CostType { + CPC, + CPD, + CPM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum LineItemDiscountType { + ABSOLUTE_VALUE, + PERCENTAGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum TargetPlatform { + WEB, + MOBILE, + ANY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum EnvironmentType { + BROWSER, + VIDEO_PLAYER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CompanionDeliveryOption { + OPTIONAL, + AT_LEAST_ONE, + ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CreativePersistenceType { + NOT_PERSISTENT, + PERSISTENT_AND_EXCLUDE_NONE, + PERSISTENT_AND_EXCLUDE_DISPLAY, + PERSISTENT_AND_EXCLUDE_VIDEO, + PERSISTENT_AND_EXCLUDE_ALL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ComputedStatus { + DELIVERY_EXTENDED, + DELIVERING, + READY, + PAUSED, + NEEDS_CREATIVES, + PAUSED_INVENTORY_RELEASED, + PENDING_APPROVAL, + COMPLETED, + DISAPPROVED, + DRAFT, + CANCELED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemSummary.ReservationStatus", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum LineItemSummaryReservationStatus { + RESERVED, + UNRESERVED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LineItem : LineItemSummary { + private Targeting targetingField; + + public Targeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class UserDomainTargetingError : ApiError { + private UserDomainTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public UserDomainTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "UserDomainTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum UserDomainTargetingErrorReason { + INVALID_DOMAIN_NAMES, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class UniqueError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class TypeError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class TechnologyTargetingError : ApiError { + private TechnologyTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TechnologyTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TechnologyTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum TechnologyTargetingErrorReason { + MOBILE_LINE_ITEM_CONTAINS_WEB_TECH_CRITERIA, + WEB_LINE_ITEM_CONTAINS_MOBILE_TECH_CRITERIA, + MOBILE_CARRIER_TARGETING_FEATURE_NOT_ENABLED, + DEVICE_CAPABILITY_TARGETING_FEATURE_NOT_ENABLED, + DEVICE_CATEGORY_TARGETING_FEATURE_NOT_ENABLED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class TeamError : ApiError { + private TeamErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TeamErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TeamError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum TeamErrorReason { + ENTITY_NOT_ON_USERS_TEAMS, + AD_UNITS_NOT_ON_ORDER_TEAMS, + PLACEMENTS_NOT_ON_ORDER_TEAMS, + MISSING_USERS_TEAM, + ALL_TEAM_ASSOCIATION_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class StringLengthError : ApiError { + private StringLengthErrorReason reasonField; + + private bool reasonFieldSpecified; + + public StringLengthErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "StringLengthError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum StringLengthErrorReason { + TOO_LONG, + TOO_SHORT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ReservationDetailsError : ApiError { + private ReservationDetailsErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReservationDetailsErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReservationDetailsError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ReservationDetailsErrorReason { + UNLIMITED_UNITS_BOUGHT_NOT_ALLOWED, + UNLIMITED_END_DATE_TIME_NOT_ALLOWED, + PERCENTAGE_UNITS_BOUGHT_TOO_HIGH, + DURATION_NOT_ALLOWED, + UNIT_TYPE_NOT_ALLOWED, + COST_TYPE_NOT_ALLOWED, + COST_TYPE_UNIT_TYPE_MISMATCH_NOT_ALLOWED, + LINE_ITEM_TYPE_NOT_ALLOWED, + NETWORK_REMNANT_ORDER_CANNOT_UPDATE_LINEITEM_TYPE, + BACKFILL_WEBPROPERTY_CODE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RequiredSizeError : ApiError { + private RequiredSizeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredSizeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredSizeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum RequiredSizeErrorReason { + REQUIRED, + NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RequiredNumberError : ApiError { + private RequiredNumberErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredNumberErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredNumberError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum RequiredNumberErrorReason { + REQUIRED, + TOO_LARGE, + TOO_SMALL, + TOO_LARGE_WITH_DETAILS, + TOO_SMALL_WITH_DETAILS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RequiredCollectionError : ApiError { + private RequiredCollectionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RequiredCollectionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RequiredCollectionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum RequiredCollectionErrorReason { + REQUIRED, + TOO_LARGE, + TOO_SMALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RegExError : ApiError { + private RegExErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RegExErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RegExError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum RegExErrorReason { + INVALID, + NULL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProgrammaticError : ApiError { + private ProgrammaticErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProgrammaticErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProgrammaticError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ProgrammaticErrorReason { + AUDIENCE_EXTENSION_NOT_SUPPORTED, + VIDEO_NOT_SUPPORTED, + ROADBLOCKING_NOT_SUPPORTED, + INVALID_CREATIVE_ROTATION, + INVALID_LINE_ITEM_TYPE, + SIZE_NOT_SUPPORTED, + CANNOT_UPDATE_FIELD_FOR_APPROVED_LINE_ITEMS, + CANNOT_CREATE_LINE_ITEM_FOR_APPROVED_ORDER, + CANNOT_UPDATE_BACKFILL_WEB_PROPERTY_FOR_APPROVED_LINE_ITEMS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ParseError : ApiError { + private ParseErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ParseErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ParseError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ParseErrorReason { + UNPARSABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class OrderError : ApiError { + private OrderErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OrderErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OrderError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum OrderErrorReason { + UPDATE_CANCELED_ORDER_NOT_ALLOWED, + UPDATE_PENDING_APPROVAL_ORDER_NOT_ALLOWED, + UPDATE_ARCHIVED_ORDER_NOT_ALLOWED, + CANNOT_MODIFY_PROPOSAL_ID, + PRIMARY_USER_REQUIRED, + PRIMARY_USER_CANNOT_BE_SECONDARY, + ORDER_TEAM_NOT_ASSOCIATED_WITH_ADVERTISER, + USER_NOT_ON_ORDERS_TEAMS, + AGENCY_NOT_ON_ORDERS_TEAMS, + INVALID_FIELDS_SET_FOR_NON_PROGRAMMATIC_ORDER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LineItemOperationError : ApiError { + private LineItemOperationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemOperationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemOperationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum LineItemOperationErrorReason { + NOT_ALLOWED, + NOT_APPLICABLE, + HAS_COMPLETED, + HAS_NO_ACTIVE_CREATIVES, + CANNOT_ACTIVATE_LEGACY_DFP_LINE_ITEM, + CANNOT_DELETE_DELIVERED_LINE_ITEM, + CANNOT_RESERVE_COMPANY_CREDIT_STATUS_NOT_ACTIVE, + CANNOT_ACTIVATE_INVALID_COMPANY_CREDIT_STATUS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LineItemFlightDateError : ApiError { + private LineItemFlightDateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemFlightDateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemFlightDateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum LineItemFlightDateErrorReason { + START_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_NOT_AFTER_START_TIME, + END_DATE_TIME_TOO_LATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LineItemError : ApiError { + private LineItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum LineItemErrorReason { + ALREADY_STARTED, + UPDATE_RESERVATION_NOT_ALLOWED, + ALL_ROADBLOCK_NOT_ALLOWED, + CREATIVE_SET_ROADBLOCK_NOT_ALLOWED, + FRACTIONAL_PERCENTAGE_NOT_ALLOWED, + DISCOUNT_NOT_ALLOWED, + UPDATE_CANCELED_LINE_ITEM_NOT_ALLOWED, + UPDATE_PENDING_APPROVAL_LINE_ITEM_NOT_ALLOWED, + UPDATE_ARCHIVED_LINE_ITEM_NOT_ALLOWED, + FRONTLOADED_NOT_ALLOWED, + CREATE_OR_UPDATE_LEGACY_DFP_LINE_ITEM_TYPE_NOT_ALLOWED, + COPY_LINE_ITEM_FROM_DIFFERENT_COMPANY_NOT_ALLOWED, + INVALID_SIZE_FOR_PLATFORM, + INVALID_LINE_ITEM_TYPE_FOR_PLATFORM, + INVALID_WEB_PROPERTY_FOR_PLATFORM, + INVALID_WEB_PROPERTY_FOR_ENVIRONMENT, + AFMA_BACKFILL_NOT_ALLOWED, + UPDATE_ENVIRONMENT_TYPE_NOT_ALLOWED, + COMPANIONS_NOT_ALLOWED, + ROADBLOCKS_WITH_NONROADBLOCKS_NOT_ALLOWED, + CANNOT_UPDATE_TO_OR_FROM_CREATIVE_SET_ROADBLOCK, + UPDATE_FROM_BACKFILL_LINE_ITEM_TYPE_NOT_ALLOWED, + UPDATE_TO_BACKFILL_LINE_ITEM_TYPE_NOT_ALLOWED, + UPDATE_BACKFILL_WEB_PROPERTY_NOT_ALLOWED, + INVALID_COMPANION_DELIVERY_OPTION_FOR_ENVIRONMENT_TYPE, + COMPANION_BACKFILL_REQUIRES_VIDEO, + COMPANION_DELIVERY_OPTION_REQUIRE_PREMIUM, + DUPLICATE_MASTER_SIZES, + INVALID_PRIORITY_FOR_LINE_ITEM_TYPE, + INVALID_ENVIRONMENT_TYPE, + INVALID_ENVIRONMENT_TYPE_FOR_PLATFORM, + INVALID_TYPE_FOR_AUTO_EXTENSION, + INVALID_TYPE_FOR_CONTRACTED_UNITS_BOUGHT, + VIDEO_INVALID_ROADBLOCKING, + BACKFILL_TYPE_NOT_ALLOWED, + INVALID_BACKFILL_LINK_TYPE, + DIFFERENT_BACKFILL_WEB_PROPERTY_CODE, + COMPANION_DELIVERY_OPTIONS_NOT_ALLOWED_WITH_BACKFILL, + INVALID_WEB_PROPERTY_FOR_ADX_BACKFILL, + INVALID_SIZE_FOR_ENVIRONMENT, + TARGET_PLATOFRM_NOT_ALLOWED, + INVALID_LINE_ITEM_CURRENCY, + LINE_ITEM_CANNOT_HAVE_MULTIPLE_CURRENCIES, + CANNOT_CHANGE_CURRENCY, + INVALID_FOR_OFFLINE, + INVALID_LINE_ITEM_DATE_TIME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LineItemCreativeAssociationError : ApiError { + private LineItemCreativeAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemCreativeAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum LineItemCreativeAssociationErrorReason { + CREATIVE_IN_WRONG_ADVERTISERS_LIBRARY, + INVALID_LINEITEM_CREATIVE_PAIRING, + STARTDATE_BEFORE_LINEITEM_STARTDATE, + STARTDATE_NOT_BEFORE_LINEITEM_ENDDATE, + ENDDATE_AFTER_LINEITEM_ENDDATE, + ENDDATE_NOT_AFTER_LINEITEM_STARTDATE, + ENDDATE_NOT_AFTER_STARTDATE, + ENDDATE_IN_THE_PAST, + CANNOT_COPY_WITHIN_SAME_LINE_ITEM, + PROGRAMMATIC_CREATIVES_CAN_ONLY_BE_ASSIGNED_TO_ONE_LINE_ITEM, + CANNOT_CREATE_PROGRAMMATIC_CREATIVES, + CANNOT_UPDATE_PROGRAMMATIC_CREATIVES, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LabelEntityAssociationError : ApiError { + private LabelEntityAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LabelEntityAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LabelEntityAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum LabelEntityAssociationErrorReason { + INVALID_COMPANY_TYPE, + DUPLICATE_ASSOCIATION, + INVALID_ASSOCIATION, + DUPLICATE_ASSOCIATION_WITH_NEGATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class InventoryUnitError : ApiError { + private InventoryUnitErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum InventoryUnitErrorReason { + EXPLICIT_TARGETING_NOT_ALLOWED, + TARGET_PLATFORM_NOT_APPLICABLE, + ADSENSE_CANNOT_BE_ENABLED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class InventoryTargetingError : ApiError { + private InventoryTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum InventoryTargetingErrorReason { + AT_LEAST_ONE_PLACEMENT_OR_INVENTORY_UNIT_REQUIRED, + INVENTORY_CANNOT_BE_TARGETED_AND_EXCLUDED, + PARENT_CONTAINS_INVALID_MIX_OF_TARGETED_AND_EXCLUDED_AD_UNITS, + INVENTORY_EXCLUSIONS_MUST_HAVE_PARENT_INVENTORY_UNIT, + INVENTORY_UNIT_CANNOT_BE_TARGETED_IF_ANCESTOR_IS_TARGETED, + INVENTORY_UNIT_CANNOT_BE_TARGETED_IF_ANCESTOR_IS_EXCLUDED, + INVENTORY_UNIT_CANNOT_BE_EXCLUDED_IF_ANCESTOR_IS_EXCLUDED, + EXPLICITLY_TARGETED_INVENTORY_UNIT_CANNOT_BE_TARGETED, + EXPLICITLY_TARGETED_INVENTORY_UNIT_CANNOT_BE_EXCLUDED, + SELF_ONLY_INVENTORY_UNIT_NOT_ALLOWED, + SELF_ONLY_INVENTORY_UNIT_WITHOUT_DESCENDANTS, + INVENTORY_FROM_MULTIPLE_NETWORKS_CANNOT_BE_TARGETED_SIMULTANEOUSLY, + INVENTORY_FROM_LOCAL_AND_DISTRIBUTOR_NETWORKS_CANNOT_BE_TARGETED_SIMULTANEOUSLY, + SHARED_INVENTORY_CANNOT_BE_TARGETED_WITH_AUDIENCE_SEGMENTS_SIMULTANEOUSLY, + UNSUPPORTED_LINE_ITEM_TYPE_FOR_SHARED_INVENTORY_TARGETING, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class InvalidUrlError : ApiError { + private InvalidUrlErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidUrlErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidUrlError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum InvalidUrlErrorReason { + ILLEGAL_CHARACTERS, + INVALID_FORMAT, + INSECURE_SCHEME, + NO_SCHEME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class GeoTargetingError : ApiError { + private GeoTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public GeoTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GeoTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum GeoTargetingErrorReason { + TARGETED_LOCATIONS_NOT_EXCLUDABLE, + EXCLUDED_LOCATIONS_CANNOT_HAVE_CHILDREN_TARGETED, + POSTAL_CODES_CANNOT_BE_EXCLUDED, + UNTARGETABLE_LOCATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class GenericTargetingError : ApiError { + private GenericTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public GenericTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "GenericTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum GenericTargetingErrorReason { + CONFLICTING_INCLUSION_OR_EXCLUSION_OF_SIBLINGS, + INCLUDING_DESCENDANTS_OF_EXCLUDED_CRITERIA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class FrequencyCapError : ApiError { + private FrequencyCapErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FrequencyCapErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FrequencyCapError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum FrequencyCapErrorReason { + IMPRESSION_LIMIT_EXCEEDED, + IMPRESSIONS_TOO_LOW, + RANGE_LIMIT_EXCEEDED, + RANGE_TOO_LOW, + DUPLICATE_TIME_RANGE, + TOO_MANY_FREQUENCY_CAPS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ForecastError : ApiError { + private ForecastErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ForecastErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ForecastError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ForecastErrorReason { + SERVER_NOT_AVAILABLE, + INTERNAL_ERROR, + NO_FORECAST_YET, + NOT_ENOUGH_INVENTORY, + SUCCESS, + ZERO_LENGTH_RESERVATION, + EXCEEDED_QUOTA, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class EntityLimitReachedError : ApiError { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class EntityChildrenLimitReachedError : ApiError { + private EntityChildrenLimitReachedErrorReason reasonField; + + private bool reasonFieldSpecified; + + public EntityChildrenLimitReachedErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "EntityChildrenLimitReachedError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum EntityChildrenLimitReachedErrorReason { + LINE_ITEM_LIMIT_FOR_ORDER_REACHED, + CREATIVE_ASSOCIATION_LIMIT_FOR_LINE_ITEM_REACHED, + AD_UNIT_LIMIT_FOR_PLACEMENT_REACHED, + TARGETING_EXPRESSION_LIMIT_FOR_LINE_ITEM_REACHED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DayPartTargetingError : ApiError { + private DayPartTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DayPartTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DayPartTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum DayPartTargetingErrorReason { + INVALID_HOUR, + INVALID_MINUTE, + END_TIME_NOT_AFTER_START_TIME, + TIME_PERIODS_OVERLAP, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DateTimeRangeTargetingError : ApiError { + private DateTimeRangeTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public DateTimeRangeTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "DateTimeRangeTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum DateTimeRangeTargetingErrorReason { + EMPTY_RANGES, + NOT_SPONSORSHIP_LINEITEM, + PAST_RANGES_CHANGED, + RANGES_OVERLAP, + RANGES_OUT_OF_LINEITEM_ACTIVE_PERIOD, + START_TIME_IS_NOT_START_OF_DAY, + END_TIME_IS_NOT_END_OF_DAY, + START_DATE_TIME_IS_IN_PAST, + RANGE_END_TIME_BEFORE_START_TIME, + END_DATE_TIME_IS_TOO_LATE, + LIMITED_RANGES_IN_UNLIMITED_LINEITEM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CustomTargetingError : ApiError { + private CustomTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CustomTargetingErrorReason { + KEY_NOT_FOUND, + KEY_COUNT_TOO_LARGE, + KEY_NAME_DUPLICATE, + KEY_NAME_EMPTY, + KEY_NAME_INVALID_LENGTH, + KEY_NAME_INVALID_CHARS, + KEY_NAME_RESERVED, + KEY_DISPLAY_NAME_INVALID_LENGTH, + VALUE_NOT_FOUND, + GET_VALUES_BY_STATEMENT_MUST_CONTAIN_KEY_ID, + VALUE_COUNT_FOR_KEY_TOO_LARGE, + VALUE_NAME_DUPLICATE, + VALUE_NAME_EMPTY, + VALUE_NAME_INVALID_LENGTH, + VALUE_NAME_INVALID_CHARS, + VALUE_DISPLAY_NAME_INVALID_LENGTH, + VALUE_MATCH_TYPE_NOT_ALLOWED, + VALUE_MATCH_TYPE_NOT_EXACT_FOR_PREDEFINED_KEY, + SUFFIX_MATCH_TYPE_NOT_ALLOWED, + CONTAINS_MATCH_TYPE_NOT_ALLOWED, + KEY_WITH_MISSING_VALUES, + CANNOT_OR_DIFFERENT_KEYS, + INVALID_TARGETING_EXPRESSION, + DELETED_KEY_CANNOT_BE_USED_FOR_TARGETING, + DELETED_VALUE_CANNOT_BE_USED_FOR_TARGETING, + VIDEO_BROWSE_BY_KEY_CANNOT_BE_USED_FOR_CUSTOM_TARGETING, + CANNOT_TARGET_AUDIENCE_SEGMENT, + CANNOT_TARGET_INACTIVE_AUDIENCE_SEGMENT, + INVALID_AUDIENCE_SEGMENTS, + ONLY_APPROVED_AUDIENCE_SEGMENTS_CAN_BE_TARGETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CustomFieldValueError : ApiError { + private CustomFieldValueErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomFieldValueErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomFieldValueError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CustomFieldValueErrorReason { + CUSTOM_FIELD_NOT_FOUND, + CUSTOM_FIELD_INACTIVE, + CUSTOM_FIELD_OPTION_NOT_FOUND, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CreativeError : ApiError { + private CreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CreativeErrorReason { + FLASH_AND_FALLBACK_URL_ARE_SAME, + INVALID_INTERNAL_REDIRECT_URL, + DESTINATION_URL_REQUIRED, + CANNOT_CREATE_OR_UPDATE_LEGACY_DFP_CREATIVE, + CANNOT_CREATE_OR_UPDATE_LEGACY_DFP_MOBILE_CREATIVE, + MISSING_FEATURE, + INVALID_COMPANY_TYPE, + INVALID_ADSENSE_CREATIVE_SIZE, + INVALID_AD_EXCHANGE_CREATIVE_SIZE, + DUPLICATE_ASSET_IN_CREATIVE, + CREATIVE_ASSET_CANNOT_HAVE_ID_AND_BYTE_ARRAY, + CANNOT_CREATE_OR_UPDATE_UNSUPPORTED_CREATIVE, + CANNOT_COPY_VIDEO_CREATIVE_ACROSS_ADVERTISERS, + CANNOT_CREATE_PROGRAMMATIC_CREATIVES, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ContentMetadataTargetingError : ApiError { + private ContentMetadataTargetingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ContentMetadataTargetingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ContentMetadataTargetingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ContentMetadataTargetingErrorReason { + VALUES_DO_NOT_BELONG_TO_A_HIERARCHY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CompanyCreditStatusError : ApiError { + private CompanyCreditStatusErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CompanyCreditStatusErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CompanyCreditStatusError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CompanyCreditStatusErrorReason { + COMPANY_CREDIT_STATUS_CHANGE_NOT_ALLOWED, + CANNOT_USE_CREDIT_STATUS_SETTING, + CANNOT_USE_ADVANCED_CREDIT_STATUS_SETTING, + UNACCEPTABLE_COMPANY_CREDIT_STATUS_FOR_ORDER, + UNACCEPTABLE_COMPANY_CREDIT_STATUS_FOR_LINE_ITEM, + CANNOT_BLOCK_COMPANY_TOO_MANY_APPROVED_ORDERS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ClickTrackingLineItemError : ApiError { + private ClickTrackingLineItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ClickTrackingLineItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ClickTrackingLineItemError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ClickTrackingLineItemErrorReason { + TYPE_IMMUTABLE, + INVALID_TARGETING_TYPE, + INVALID_ROADBLOCKING_TYPE, + INVALID_CREATIVEROTATION_TYPE, + INVALID_DELIVERY_RATE_TYPE, + UNSUPPORTED_FIELD, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AudienceExtensionError : ApiError { + private AudienceExtensionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AudienceExtensionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AudienceExtensionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AudienceExtensionErrorReason { + FREQUENCY_CAPS_NOT_SUPPORTED, + INVALID_TARGETING, + INVENTORY_UNIT_TARGETING_INVALID, + INVALID_CREATIVE_ROTATION, + INVALID_EXTERNAL_ENTITY_ID, + INVALID_LINE_ITEM_TYPE, + INVALID_MAX_BID, + AUDIENCE_EXTENSION_BULK_UPDATE_NOT_ALLOWED, + UNEXPECTED_AUDIENCE_EXTENSION_ERROR, + MAX_DAILY_BUDGET_AMOUNT_EXCEEDED, + EXTERNAL_CAMPAIGN_ALREADY_EXISTS, + AUDIENCE_EXTENSION_WITHOUT_FEATURE, + AUDIENCE_EXTENSION_WITHOUT_LINKED_ACCOUNT, + CANNOT_OVERRIDE_CREATIVE_SIZE_WITH_AUDIENCE_EXTENSION, + CANNOT_OVERRIDE_FIELD_WITH_AUDIENCE_EXTENSION, + ONLY_ONE_CREATIVE_PLACEHOLDER_ALLOWED, + MULTIPLE_AUDIENCE_EXTENSION_LINE_ITEMS_ON_ORDER, + CANNOT_COPY_AUDIENCE_EXTENSION_LINE_ITEMS_AND_CREATIVES_TOGETHER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdUnitCodeError : ApiError { + private AdUnitCodeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitCodeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitCodeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AdUnitCodeErrorReason { + INVALID_CHARACTERS, + INVALID_CHARACTERS_WHEN_UTF_CHARACTERS_ARE_ALLOWED, + LEADING_FORWARD_SLASH, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdUnitAfcSizeError : ApiError { + private AdUnitAfcSizeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitAfcSizeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitAfcSizeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AdUnitAfcSizeErrorReason { + INVALID, + DOESNT_FIT, + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CompanyServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CompanyService : DfpSoapClient, ICompanyService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CompanyService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/CompanyService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Company[] createCompanies([System.Xml.Serialization.XmlElementAttribute("companies")] +Company[] companies) { + object[] results = this.Invoke("createCompanies", new object[] { companies }); + return ((Company[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CompanyPage getCompaniesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCompaniesByStatement", new object[] { filterStatement }); + return ((CompanyPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Company[] updateCompanies([System.Xml.Serialization.XmlElementAttribute("companies")] +Company[] companies) { + object[] results = this.Invoke("updateCompanies", new object[] { companies }); + return ((Company[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CompanyPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Company[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Company[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Company { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private CompanyType typeField; + + private bool typeFieldSpecified; + + private string addressField; + + private string emailField; + + private string faxPhoneField; + + private string primaryPhoneField; + + private string externalIdField; + + private string commentField; + + private CompanyCreditStatus creditStatusField; + + private bool creditStatusFieldSpecified; + + private AppliedLabel[] appliedLabelsField; + + private bool enableSameAdvertiserCompetitiveExclusionField; + + private bool enableSameAdvertiserCompetitiveExclusionFieldSpecified; + + private long primaryContactIdField; + + private bool primaryContactIdFieldSpecified; + + private long[] appliedTeamIdsField; + + private int thirdPartyCompanyIdField; + + private bool thirdPartyCompanyIdFieldSpecified; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public CompanyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public string address { + get { return this.addressField; } + set { this.addressField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public string faxPhone { + get { return this.faxPhoneField; } + set { this.faxPhoneField = value; } + } + + public string primaryPhone { + get { return this.primaryPhoneField; } + set { this.primaryPhoneField = value; } + } + + public string externalId { + get { return this.externalIdField; } + set { this.externalIdField = value; } + } + + public string comment { + get { return this.commentField; } + set { this.commentField = value; } + } + + public CompanyCreditStatus creditStatus { + get { return this.creditStatusField; } + set { + this.creditStatusField = value; + this.creditStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creditStatusSpecified { + get { return this.creditStatusFieldSpecified; } + set { this.creditStatusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + public bool enableSameAdvertiserCompetitiveExclusion { + get { return this.enableSameAdvertiserCompetitiveExclusionField; } + set { + this.enableSameAdvertiserCompetitiveExclusionField = value; + this.enableSameAdvertiserCompetitiveExclusionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool enableSameAdvertiserCompetitiveExclusionSpecified { + get { return this.enableSameAdvertiserCompetitiveExclusionFieldSpecified; } + set { this.enableSameAdvertiserCompetitiveExclusionFieldSpecified = value; } + } + + public long primaryContactId { + get { return this.primaryContactIdField; } + set { + this.primaryContactIdField = value; + this.primaryContactIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool primaryContactIdSpecified { + get { return this.primaryContactIdFieldSpecified; } + set { this.primaryContactIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public int thirdPartyCompanyId { + get { return this.thirdPartyCompanyIdField; } + set { + this.thirdPartyCompanyIdField = value; + this.thirdPartyCompanyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyCompanyIdSpecified { + get { return this.thirdPartyCompanyIdFieldSpecified; } + set { this.thirdPartyCompanyIdFieldSpecified = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Company.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CompanyType { + HOUSE_ADVERTISER, + HOUSE_AGENCY, + ADVERTISER, + AGENCY, + AD_NETWORK, + AFFILIATE_DISTRIBUTION_PARTNER, + CONTENT_PARTNER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Company.CreditStatus", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CompanyCreditStatus { + ACTIVE, + ON_HOLD, + CREDIT_STOP, + INACTIVE, + BLOCKED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class InvalidEmailError : ApiError { + private InvalidEmailErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidEmailErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidEmailError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum InvalidEmailErrorReason { + INVALID_FORMAT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CompanyError : ApiError { + private CompanyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CompanyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CompanyError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CompanyErrorReason { + CANNOT_SET_THIRD_PARTY_COMPANY_DUE_TO_TYPE, + CANNOT_UPDATE_COMPANY_TYPE, + INVALID_COMPANY_TYPE, + PRIMARY_CONTACT_DOES_NOT_BELONG_TO_THIS_COMPANY, + THIRD_PARTY_STATS_PROVIDER_IS_WRONG_ROLE_TYPE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AvailableBillingError : ApiError { + private AvailableBillingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AvailableBillingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AvailableBillingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AvailableBillingErrorReason { + BILLING_SOURCE_IS_NOT_AVAILABLE, + BILLING_SCHEDULE_IS_NOT_AVAILABLE, + BILLING_CAP_IS_NOT_AVAILABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "AdRuleServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class AdRuleService : DfpSoapClient, IAdRuleService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public AdRuleService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/AdRuleService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRule[] createAdRules([System.Xml.Serialization.XmlElementAttribute("adRules")] +AdRule[] adRules) { + object[] results = this.Invoke("createAdRules", new object[] { adRules }); + return ((AdRule[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRulePage getAdRulesByStatement(Statement statement) { + object[] results = this.Invoke("getAdRulesByStatement", new object[] { statement }); + return ((AdRulePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performAdRuleAction(AdRuleAction adRuleAction, Statement filterStatement) { + object[] results = this.Invoke("performAdRuleAction", new object[] { adRuleAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdRule[] updateAdRules([System.Xml.Serialization.XmlElementAttribute("adRules")] +AdRule[] adRules) { + object[] results = this.Invoke("updateAdRules", new object[] { adRules }); + return ((AdRule[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteAdRules))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateAdRules))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateAdRules))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class AdRuleAction { + private string adRuleActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AdRuleAction.Type")] + public string AdRuleActionType { + get { return this.adRuleActionTypeField; } + set { this.adRuleActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeleteAdRules : AdRuleAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeactivateAdRules : AdRuleAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ActivateAdRules : AdRuleAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdRulePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AdRule[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AdRule[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdRule { + private int idField; + + private bool idFieldSpecified; + + private string nameField; + + private int priorityField; + + private bool priorityFieldSpecified; + + private Targeting targetingField; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private AdRuleStatus statusField; + + private bool statusFieldSpecified; + + private FrequencyCapBehavior frequencyCapBehaviorField; + + private bool frequencyCapBehaviorFieldSpecified; + + private int maxImpressionsPerLineItemPerStreamField; + + private bool maxImpressionsPerLineItemPerStreamFieldSpecified; + + private int maxImpressionsPerLineItemPerPodField; + + private bool maxImpressionsPerLineItemPerPodFieldSpecified; + + private BaseAdRuleSlot prerollField; + + private BaseAdRuleSlot midrollField; + + private BaseAdRuleSlot postrollField; + + public int id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + public Targeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public AdRuleStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public FrequencyCapBehavior frequencyCapBehavior { + get { return this.frequencyCapBehaviorField; } + set { + this.frequencyCapBehaviorField = value; + this.frequencyCapBehaviorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool frequencyCapBehaviorSpecified { + get { return this.frequencyCapBehaviorFieldSpecified; } + set { this.frequencyCapBehaviorFieldSpecified = value; } + } + + public int maxImpressionsPerLineItemPerStream { + get { return this.maxImpressionsPerLineItemPerStreamField; } + set { + this.maxImpressionsPerLineItemPerStreamField = value; + this.maxImpressionsPerLineItemPerStreamSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxImpressionsPerLineItemPerStreamSpecified { + get { return this.maxImpressionsPerLineItemPerStreamFieldSpecified; } + set { this.maxImpressionsPerLineItemPerStreamFieldSpecified = value; } + } + + public int maxImpressionsPerLineItemPerPod { + get { return this.maxImpressionsPerLineItemPerPodField; } + set { + this.maxImpressionsPerLineItemPerPodField = value; + this.maxImpressionsPerLineItemPerPodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxImpressionsPerLineItemPerPodSpecified { + get { return this.maxImpressionsPerLineItemPerPodFieldSpecified; } + set { this.maxImpressionsPerLineItemPerPodFieldSpecified = value; } + } + + public BaseAdRuleSlot preroll { + get { return this.prerollField; } + set { this.prerollField = value; } + } + + public BaseAdRuleSlot midroll { + get { return this.midrollField; } + set { this.midrollField = value; } + } + + public BaseAdRuleSlot postroll { + get { return this.postrollField; } + set { this.postrollField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AdRuleStatus { + ACTIVE, + INACTIVE, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum FrequencyCapBehavior { + TURN_ON, + TURN_OFF, + DEFER, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnknownAdRuleSlot))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StandardPoddingAdRuleSlot))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OptimizedPoddingAdRuleSlot))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NoPoddingAdRuleSlot))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class BaseAdRuleSlot { + private long idField; + + private bool idFieldSpecified; + + private AdRuleSlotBehavior slotBehaviorField; + + private bool slotBehaviorFieldSpecified; + + private long minVideoAdDurationField; + + private bool minVideoAdDurationFieldSpecified; + + private long maxVideoAdDurationField; + + private bool maxVideoAdDurationFieldSpecified; + + private MidrollFrequencyType videoMidrollFrequencyTypeField; + + private bool videoMidrollFrequencyTypeFieldSpecified; + + private string videoMidrollFrequencyField; + + private AdRuleSlotBumper bumperField; + + private bool bumperFieldSpecified; + + private long maxBumperDurationField; + + private bool maxBumperDurationFieldSpecified; + + private long minPodDurationField; + + private bool minPodDurationFieldSpecified; + + private long maxPodDurationField; + + private bool maxPodDurationFieldSpecified; + + private int maxAdsInPodField; + + private bool maxAdsInPodFieldSpecified; + + private string baseAdRuleSlotTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public AdRuleSlotBehavior slotBehavior { + get { return this.slotBehaviorField; } + set { + this.slotBehaviorField = value; + this.slotBehaviorSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool slotBehaviorSpecified { + get { return this.slotBehaviorFieldSpecified; } + set { this.slotBehaviorFieldSpecified = value; } + } + + public long minVideoAdDuration { + get { return this.minVideoAdDurationField; } + set { + this.minVideoAdDurationField = value; + this.minVideoAdDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minVideoAdDurationSpecified { + get { return this.minVideoAdDurationFieldSpecified; } + set { this.minVideoAdDurationFieldSpecified = value; } + } + + public long maxVideoAdDuration { + get { return this.maxVideoAdDurationField; } + set { + this.maxVideoAdDurationField = value; + this.maxVideoAdDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxVideoAdDurationSpecified { + get { return this.maxVideoAdDurationFieldSpecified; } + set { this.maxVideoAdDurationFieldSpecified = value; } + } + + public MidrollFrequencyType videoMidrollFrequencyType { + get { return this.videoMidrollFrequencyTypeField; } + set { + this.videoMidrollFrequencyTypeField = value; + this.videoMidrollFrequencyTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool videoMidrollFrequencyTypeSpecified { + get { return this.videoMidrollFrequencyTypeFieldSpecified; } + set { this.videoMidrollFrequencyTypeFieldSpecified = value; } + } + + public string videoMidrollFrequency { + get { return this.videoMidrollFrequencyField; } + set { this.videoMidrollFrequencyField = value; } + } + + public AdRuleSlotBumper bumper { + get { return this.bumperField; } + set { + this.bumperField = value; + this.bumperSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool bumperSpecified { + get { return this.bumperFieldSpecified; } + set { this.bumperFieldSpecified = value; } + } + + public long maxBumperDuration { + get { return this.maxBumperDurationField; } + set { + this.maxBumperDurationField = value; + this.maxBumperDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxBumperDurationSpecified { + get { return this.maxBumperDurationFieldSpecified; } + set { this.maxBumperDurationFieldSpecified = value; } + } + + public long minPodDuration { + get { return this.minPodDurationField; } + set { + this.minPodDurationField = value; + this.minPodDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool minPodDurationSpecified { + get { return this.minPodDurationFieldSpecified; } + set { this.minPodDurationFieldSpecified = value; } + } + + public long maxPodDuration { + get { return this.maxPodDurationField; } + set { + this.maxPodDurationField = value; + this.maxPodDurationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxPodDurationSpecified { + get { return this.maxPodDurationFieldSpecified; } + set { this.maxPodDurationFieldSpecified = value; } + } + + public int maxAdsInPod { + get { return this.maxAdsInPodField; } + set { + this.maxAdsInPodField = value; + this.maxAdsInPodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool maxAdsInPodSpecified { + get { return this.maxAdsInPodFieldSpecified; } + set { this.maxAdsInPodFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseAdRuleSlot.Type")] + public string BaseAdRuleSlotType { + get { return this.baseAdRuleSlotTypeField; } + set { this.baseAdRuleSlotTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AdRuleSlotBehavior { + ALWAYS_SHOW, + NEVER_SHOW, + DEFER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum MidrollFrequencyType { + NONE, + EVERY_N_SECONDS, + FIXED_TIME, + EVERY_N_CUEPOINTS, + FIXED_CUE_POINTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AdRuleSlotBumper { + NONE, + BEFORE, + AFTER, + BEFORE_AND_AFTER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class UnknownAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class StandardPoddingAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class OptimizedPoddingAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class NoPoddingAdRuleSlot : BaseAdRuleSlot { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class PoddingError : ApiError { + private PoddingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PoddingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PoddingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum PoddingErrorReason { + INVALID_PODDING_TYPE_NONE, + INVALID_PODDING_TYPE_STANDARD, + INVALID_OPTIMIZED_POD_WITHOUT_DURATION, + INVALID_OPTIMIZED_POD_WITHOUT_ADS, + INVALID_POD_DURATION_RANGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdRuleSlotError : ApiError { + private AdRuleSlotErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRuleSlotErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRuleSlotError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AdRuleSlotErrorReason { + DIFFERENT_STATUS_THAN_AD_RULE, + INVALID_VIDEO_AD_DURATION_RANGE, + INVALID_VIDEO_MIDROLL_FREQUENCY_TYPE, + MALFORMED_VIDEO_MIDROLL_FREQUENCY_CSV, + MALFORMED_VIDEO_MIDROLL_FREQUENCY_SINGLE_NUMBER, + INVALID_OVERLAY_AD_DURATION_RANGE, + INVALID_OVERLAY_MIDROLL_FREQUENCY_TYPE, + MALFORMED_OVERLAY_MIDROLL_FREQUENCY_CSV, + MALFORMED_OVERLAY_MIDROLL_FREQUENCY_SINGLE_NUMBER, + INVALID_BUMPER_MAX_DURATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdRulePriorityError : ApiError { + private AdRulePriorityErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRulePriorityErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRulePriorityError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AdRulePriorityErrorReason { + DUPLICATE_PRIORITY, + PRIORITIES_NOT_SEQUENTIAL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdRuleFrequencyCapError : ApiError { + private AdRuleFrequencyCapErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRuleFrequencyCapErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRuleFrequencyCapError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AdRuleFrequencyCapErrorReason { + NO_FREQUENCY_CAPS_SPECIFIED_WHEN_FREQUENCY_CAPS_TURNED_ON, + FREQUENCY_CAPS_SPECIFIED_WHEN_FREQUENCY_CAPS_TURNED_OFF, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdRuleDateError : ApiError { + private AdRuleDateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdRuleDateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdRuleDateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AdRuleDateErrorReason { + START_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_NOT_AFTER_START_TIME, + END_DATE_TIME_TOO_LATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "SuggestedAdUnitServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class SuggestedAdUnitService : DfpSoapClient, ISuggestedAdUnitService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public SuggestedAdUnitService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/SuggestedAdUnitService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SuggestedAdUnitPage getSuggestedAdUnitsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getSuggestedAdUnitsByStatement", new object[] { filterStatement }); + return ((SuggestedAdUnitPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual SuggestedAdUnitUpdateResult performSuggestedAdUnitAction(SuggestedAdUnitAction suggestedAdUnitAction, Statement filterStatement) { + object[] results = this.Invoke("performSuggestedAdUnitAction", new object[] { suggestedAdUnitAction, filterStatement }); + return ((SuggestedAdUnitUpdateResult) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class SuggestedAdUnitUpdateResult { + private string[] newAdUnitIdsField; + + private int numChangesField; + + private bool numChangesFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("newAdUnitIds")] + public string[] newAdUnitIds { + get { return this.newAdUnitIdsField; } + set { this.newAdUnitIdsField = value; } + } + + public int numChanges { + get { return this.numChangesField; } + set { + this.numChangesField = value; + this.numChangesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numChangesSpecified { + get { return this.numChangesFieldSpecified; } + set { this.numChangesFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveSuggestedAdUnit))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class SuggestedAdUnitAction { + private string suggestedAdUnitActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("SuggestedAdUnitAction.Type")] + public string SuggestedAdUnitActionType { + get { return this.suggestedAdUnitActionTypeField; } + set { this.suggestedAdUnitActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ApproveSuggestedAdUnit : SuggestedAdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdUnitSize { + private Size sizeField; + + private EnvironmentType environmentTypeField; + + private bool environmentTypeFieldSpecified; + + private AdUnitSize[] companionsField; + + private string fullDisplayStringField; + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + public EnvironmentType environmentType { + get { return this.environmentTypeField; } + set { + this.environmentTypeField = value; + this.environmentTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool environmentTypeSpecified { + get { return this.environmentTypeFieldSpecified; } + set { this.environmentTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companions")] + public AdUnitSize[] companions { + get { return this.companionsField; } + set { this.companionsField = value; } + } + + public string fullDisplayString { + get { return this.fullDisplayStringField; } + set { this.fullDisplayStringField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdUnitParent { + private string idField; + + private string nameField; + + private string adUnitCodeField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string adUnitCode { + get { return this.adUnitCodeField; } + set { this.adUnitCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class SuggestedAdUnit { + private string idField; + + private long numRequestsField; + + private bool numRequestsFieldSpecified; + + private string[] pathField; + + private AdUnitParent[] parentPathField; + + private AdUnitTargetWindow targetWindowField; + + private bool targetWindowFieldSpecified; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private AdUnitSize[] suggestedAdUnitSizesField; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public long numRequests { + get { return this.numRequestsField; } + set { + this.numRequestsField = value; + this.numRequestsSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool numRequestsSpecified { + get { return this.numRequestsFieldSpecified; } + set { this.numRequestsFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("path")] + public string[] path { + get { return this.pathField; } + set { this.pathField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("parentPath")] + public AdUnitParent[] parentPath { + get { return this.parentPathField; } + set { this.parentPathField = value; } + } + + public AdUnitTargetWindow targetWindow { + get { return this.targetWindowField; } + set { + this.targetWindowField = value; + this.targetWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetWindowSpecified { + get { return this.targetWindowFieldSpecified; } + set { this.targetWindowFieldSpecified = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("suggestedAdUnitSizes")] + public AdUnitSize[] suggestedAdUnitSizes { + get { return this.suggestedAdUnitSizesField; } + set { this.suggestedAdUnitSizesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnit.TargetWindow", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AdUnitTargetWindow { + TOP, + BLANK + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class SuggestedAdUnitPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private SuggestedAdUnit[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public SuggestedAdUnit[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LineItemServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LineItemSummary))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LineItemService : DfpSoapClient, ILineItemService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LineItemService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/LineItemService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItem[] createLineItems([System.Xml.Serialization.XmlElementAttribute("lineItems")] +LineItem[] lineItems) { + object[] results = this.Invoke("createLineItems", new object[] { lineItems }); + return ((LineItem[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemPage getLineItemsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLineItemsByStatement", new object[] { filterStatement }); + return ((LineItemPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performLineItemAction(LineItemAction lineItemAction, Statement filterStatement) { + object[] results = this.Invoke("performLineItemAction", new object[] { lineItemAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItem[] updateLineItems([System.Xml.Serialization.XmlElementAttribute("lineItems")] +LineItem[] lineItems) { + object[] results = this.Invoke("updateLineItems", new object[] { lineItems }); + return ((LineItem[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveAndOverbookLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReleaseLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PauseLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class LineItemAction { + private string lineItemActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LineItemAction.Type")] + public string LineItemActionType { + get { return this.lineItemActionTypeField; } + set { this.lineItemActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class UnarchiveLineItems : LineItemAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ResumeLineItems : LineItemAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ResumeAndOverbookLineItems : ResumeLineItems { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReserveAndOverbookLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ReserveLineItems : LineItemAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ReserveAndOverbookLineItems : ReserveLineItems { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ReleaseLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class PauseLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeleteLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ArchiveLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ActivateLineItems : LineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LineItemPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LineItem[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LineItem[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "RateCardServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class RateCardService : DfpSoapClient, IRateCardService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public RateCardService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/RateCardService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCard[] createRateCards([System.Xml.Serialization.XmlElementAttribute("rateCards")] +RateCard[] rateCards) { + object[] results = this.Invoke("createRateCards", new object[] { rateCards }); + return ((RateCard[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardPage getRateCardsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getRateCardsByStatement", new object[] { filterStatement }); + return ((RateCardPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performRateCardAction(RateCardAction rateCardAction, Statement filterStatement) { + object[] results = this.Invoke("performRateCardAction", new object[] { rateCardAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCard[] updateRateCards([System.Xml.Serialization.XmlElementAttribute("rateCards")] +RateCard[] rateCards) { + object[] results = this.Invoke("updateRateCards", new object[] { rateCards }); + return ((RateCard[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateRateCards))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateRateCards))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class RateCardAction { + private string rateCardActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("RateCardAction.Type")] + public string RateCardActionType { + get { return this.rateCardActionTypeField; } + set { this.rateCardActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeactivateRateCards : RateCardAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ActivateRateCards : RateCardAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RateCardPage { + private RateCard[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public RateCard[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RateCard { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string currencyCodeField; + + private RateCardStatus statusField; + + private bool statusFieldSpecified; + + private long[] appliedTeamIdsField; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public RateCardStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum RateCardStatus { + ACTIVE, + INACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RateCardError : ApiError { + private RateCardErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RateCardErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RateCardError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum RateCardErrorReason { + INVALID_CURRENCY_CODE, + UNSUPPORTED_CURRENCY_CODE, + UNCHANGEABLE_CURRENCY_CODE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RateCardActionError : ApiError { + private RateCardActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RateCardActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RateCardActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum RateCardActionErrorReason { + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeTemplateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeTemplateService : DfpSoapClient, ICreativeTemplateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeTemplateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/CreativeTemplateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeTemplatePage getCreativeTemplatesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativeTemplatesByStatement", new object[] { filterStatement }); + return ((CreativeTemplatePage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ListStringCreativeTemplateVariable.VariableChoice", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ListStringCreativeTemplateVariableVariableChoice { + private string labelField; + + private string valueField; + + public string label { + get { return this.labelField; } + set { this.labelField = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UrlCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListStringCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongCreativeTemplateVariable))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetCreativeTemplateVariable))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class CreativeTemplateVariable { + private string labelField; + + private string uniqueNameField; + + private string descriptionField; + + private bool isRequiredField; + + private bool isRequiredFieldSpecified; + + private string creativeTemplateVariableTypeField; + + public string label { + get { return this.labelField; } + set { this.labelField = value; } + } + + public string uniqueName { + get { return this.uniqueNameField; } + set { this.uniqueNameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isRequired { + get { return this.isRequiredField; } + set { + this.isRequiredField = value; + this.isRequiredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isRequiredSpecified { + get { return this.isRequiredFieldSpecified; } + set { this.isRequiredFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("CreativeTemplateVariable.Type")] + public string CreativeTemplateVariableType { + get { return this.creativeTemplateVariableTypeField; } + set { this.creativeTemplateVariableTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class UrlCreativeTemplateVariable : CreativeTemplateVariable { + private string defaultValueField; + + private bool isTrackingUrlField; + + private bool isTrackingUrlFieldSpecified; + + public string defaultValue { + get { return this.defaultValueField; } + set { this.defaultValueField = value; } + } + + public bool isTrackingUrl { + get { return this.isTrackingUrlField; } + set { + this.isTrackingUrlField = value; + this.isTrackingUrlSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTrackingUrlSpecified { + get { return this.isTrackingUrlFieldSpecified; } + set { this.isTrackingUrlFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListStringCreativeTemplateVariable))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class StringCreativeTemplateVariable : CreativeTemplateVariable { + private string defaultValueField; + + public string defaultValue { + get { return this.defaultValueField; } + set { this.defaultValueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ListStringCreativeTemplateVariable : StringCreativeTemplateVariable { + private ListStringCreativeTemplateVariableVariableChoice[] choicesField; + + private bool allowOtherChoiceField; + + private bool allowOtherChoiceFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("choices")] + public ListStringCreativeTemplateVariableVariableChoice[] choices { + get { return this.choicesField; } + set { this.choicesField = value; } + } + + public bool allowOtherChoice { + get { return this.allowOtherChoiceField; } + set { + this.allowOtherChoiceField = value; + this.allowOtherChoiceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowOtherChoiceSpecified { + get { return this.allowOtherChoiceFieldSpecified; } + set { this.allowOtherChoiceFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LongCreativeTemplateVariable : CreativeTemplateVariable { + private long defaultValueField; + + private bool defaultValueFieldSpecified; + + public long defaultValue { + get { return this.defaultValueField; } + set { + this.defaultValueField = value; + this.defaultValueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool defaultValueSpecified { + get { return this.defaultValueFieldSpecified; } + set { this.defaultValueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AssetCreativeTemplateVariable : CreativeTemplateVariable { + private AssetCreativeTemplateVariableMimeType[] mimeTypesField; + + [System.Xml.Serialization.XmlElementAttribute("mimeTypes")] + public AssetCreativeTemplateVariableMimeType[] mimeTypes { + get { return this.mimeTypesField; } + set { this.mimeTypesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AssetCreativeTemplateVariable.MimeType", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AssetCreativeTemplateVariableMimeType { + JPG, + PNG, + GIF, + SWF + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CreativeTemplate { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private CreativeTemplateVariable[] variablesField; + + private string snippetField; + + private CreativeTemplateStatus statusField; + + private bool statusFieldSpecified; + + private CreativeTemplateType typeField; + + private bool typeFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("variables")] + public CreativeTemplateVariable[] variables { + get { return this.variablesField; } + set { this.variablesField = value; } + } + + public string snippet { + get { return this.snippetField; } + set { this.snippetField = value; } + } + + public CreativeTemplateStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public CreativeTemplateType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CreativeTemplateStatus { + ACTIVE, + INACTIVE, + DELETED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CreativeTemplateType { + SYSTEM_DEFINED, + USER_DEFINED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CreativeTemplatePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeTemplate[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeTemplate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CreativeTemplateError : ApiError { + private CreativeTemplateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeTemplateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeTemplateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CreativeTemplateErrorReason { + CANNOT_PARSE_CREATIVE_TEMPLATE, + VARIABLE_DUPLICATE_UNIQUE_NAME, + VARIABLE_INVALID_UNIQUE_NAME, + LIST_CHOICE_DUPLICATE_VALUE, + LIST_CHOICE_NEEDS_DEFAULT, + LIST_CHOICES_EMPTY, + NO_TARGET_PLATFORMS, + MULTIPLE_TARGET_PLATFORMS, + UNRECOGNIZED_PLACEHOLDER, + PLACEHOLDERS_NOT_IN_FORMATTER, + MISSING_INTERSTITIAL_MACRO, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ContentMetadataKeyHierarchyServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ContentMetadataKeyHierarchyService : DfpSoapClient, IContentMetadataKeyHierarchyService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ContentMetadataKeyHierarchyService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/ContentMetadataKeyHierarchyServ" + "ice"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContentMetadataKeyHierarchy[] createContentMetadataKeyHierarchies([System.Xml.Serialization.XmlElementAttribute("contentMetadataKeyHierarchies")] +ContentMetadataKeyHierarchy[] contentMetadataKeyHierarchies) { + object[] results = this.Invoke("createContentMetadataKeyHierarchies", new object[] { contentMetadataKeyHierarchies }); + return ((ContentMetadataKeyHierarchy[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContentMetadataKeyHierarchyPage getContentMetadataKeyHierarchiesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getContentMetadataKeyHierarchiesByStatement", new object[] { filterStatement }); + return ((ContentMetadataKeyHierarchyPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performContentMetadataKeyHierarchyAction(ContentMetadataKeyHierarchyAction contentMetadataKeyHierarchyAction, Statement filterStatement) { + object[] results = this.Invoke("performContentMetadataKeyHierarchyAction", new object[] { contentMetadataKeyHierarchyAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContentMetadataKeyHierarchy[] updateContentMetadataKeyHierarchies([System.Xml.Serialization.XmlElementAttribute("contentMetadataKeyHierarchies")] +ContentMetadataKeyHierarchy[] contentMetadataKeyHierarchies) { + object[] results = this.Invoke("updateContentMetadataKeyHierarchies", new object[] { contentMetadataKeyHierarchies }); + return ((ContentMetadataKeyHierarchy[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteContentMetadataKeyHierarchies))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class ContentMetadataKeyHierarchyAction { + private string contentMetadataKeyHierarchyActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ContentMetadataKeyHierarchyAction.Type")] + public string ContentMetadataKeyHierarchyActionType { + get { return this.contentMetadataKeyHierarchyActionTypeField; } + set { this.contentMetadataKeyHierarchyActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeleteContentMetadataKeyHierarchies : ContentMetadataKeyHierarchyAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ContentMetadataKeyHierarchyPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ContentMetadataKeyHierarchy[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ContentMetadataKeyHierarchy[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ContentMetadataKeyHierarchy { + private int idField; + + private bool idFieldSpecified; + + private string nameField; + + private ContentMetadataKeyHierarchyLevel[] hierarchyLevelsField; + + private ContentMetadataKeyHierarchyStatus statusField; + + private bool statusFieldSpecified; + + public int id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("hierarchyLevels")] + public ContentMetadataKeyHierarchyLevel[] hierarchyLevels { + get { return this.hierarchyLevelsField; } + set { this.hierarchyLevelsField = value; } + } + + public ContentMetadataKeyHierarchyStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ContentMetadataKeyHierarchyLevel { + private long customTargetingKeyIdField; + + private bool customTargetingKeyIdFieldSpecified; + + private int hierarchyLevelField; + + private bool hierarchyLevelFieldSpecified; + + public long customTargetingKeyId { + get { return this.customTargetingKeyIdField; } + set { + this.customTargetingKeyIdField = value; + this.customTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customTargetingKeyIdSpecified { + get { return this.customTargetingKeyIdFieldSpecified; } + set { this.customTargetingKeyIdFieldSpecified = value; } + } + + public int hierarchyLevel { + get { return this.hierarchyLevelField; } + set { + this.hierarchyLevelField = value; + this.hierarchyLevelSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hierarchyLevelSpecified { + get { return this.hierarchyLevelFieldSpecified; } + set { this.hierarchyLevelFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ContentMetadataKeyHierarchyStatus { + ACTIVE, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ContentMetadataKeyHierarchyError : ApiError { + private ContentMetadataKeyHierarchyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ContentMetadataKeyHierarchyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ContentMetadataKeyHierarchyError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ContentMetadataKeyHierarchyErrorReason { + LEVEL_MISSING, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomTargetingServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomTargetingService : DfpSoapClient, ICustomTargetingService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomTargetingService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/CustomTargetingService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingKey[] createCustomTargetingKeys([System.Xml.Serialization.XmlElementAttribute("keys")] +CustomTargetingKey[] keys) { + object[] results = this.Invoke("createCustomTargetingKeys", new object[] { keys }); + return ((CustomTargetingKey[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingValue[] createCustomTargetingValues([System.Xml.Serialization.XmlElementAttribute("values")] +CustomTargetingValue[] values) { + object[] results = this.Invoke("createCustomTargetingValues", new object[] { values }); + return ((CustomTargetingValue[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingKeyPage getCustomTargetingKeysByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomTargetingKeysByStatement", new object[] { filterStatement }); + return ((CustomTargetingKeyPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingValuePage getCustomTargetingValuesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomTargetingValuesByStatement", new object[] { filterStatement }); + return ((CustomTargetingValuePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performCustomTargetingKeyAction(CustomTargetingKeyAction customTargetingKeyAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomTargetingKeyAction", new object[] { customTargetingKeyAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performCustomTargetingValueAction(CustomTargetingValueAction customTargetingValueAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomTargetingValueAction", new object[] { customTargetingValueAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingKey[] updateCustomTargetingKeys([System.Xml.Serialization.XmlElementAttribute("keys")] +CustomTargetingKey[] keys) { + object[] results = this.Invoke("updateCustomTargetingKeys", new object[] { keys }); + return ((CustomTargetingKey[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomTargetingValue[] updateCustomTargetingValues([System.Xml.Serialization.XmlElementAttribute("values")] +CustomTargetingValue[] values) { + object[] results = this.Invoke("updateCustomTargetingValues", new object[] { values }); + return ((CustomTargetingValue[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteCustomTargetingValues))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class CustomTargetingValueAction { + private string customTargetingValueActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomTargetingValueAction.Type")] + public string CustomTargetingValueActionType { + get { return this.customTargetingValueActionTypeField; } + set { this.customTargetingValueActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeleteCustomTargetingValues : CustomTargetingValueAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteCustomTargetingKeys))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class CustomTargetingKeyAction { + private string customTargetingKeyActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomTargetingKeyAction.Type")] + public string CustomTargetingKeyActionType { + get { return this.customTargetingKeyActionTypeField; } + set { this.customTargetingKeyActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeleteCustomTargetingKeys : CustomTargetingKeyAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CustomTargetingValuePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomTargetingValue[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomTargetingValue[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CustomTargetingValue { + private long customTargetingKeyIdField; + + private bool customTargetingKeyIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string displayNameField; + + private CustomTargetingValueMatchType matchTypeField; + + private bool matchTypeFieldSpecified; + + public long customTargetingKeyId { + get { return this.customTargetingKeyIdField; } + set { + this.customTargetingKeyIdField = value; + this.customTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customTargetingKeyIdSpecified { + get { return this.customTargetingKeyIdFieldSpecified; } + set { this.customTargetingKeyIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public CustomTargetingValueMatchType matchType { + get { return this.matchTypeField; } + set { + this.matchTypeField = value; + this.matchTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool matchTypeSpecified { + get { return this.matchTypeFieldSpecified; } + set { this.matchTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingValue.MatchType", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CustomTargetingValueMatchType { + EXACT, + BROAD, + PREFIX, + BROAD_PREFIX, + SUFFIX, + CONTAINS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CustomTargetingKeyPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomTargetingKey[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomTargetingKey[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CustomTargetingKey { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string displayNameField; + + private CustomTargetingKeyType typeField; + + private bool typeFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public CustomTargetingKeyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomTargetingKey.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CustomTargetingKeyType { + PREDEFINED, + FREEFORM + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProductServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProductService : DfpSoapClient, IProductService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProductService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/ProductService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductPage getProductsByStatement(Statement statement) { + object[] results = this.Invoke("getProductsByStatement", new object[] { statement }); + return ((ProductPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performProductAction(ProductAction productAction, Statement filterStatement) { + object[] results = this.Invoke("performProductAction", new object[] { productAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Product[] updateProducts([System.Xml.Serialization.XmlElementAttribute("products")] +Product[] products) { + object[] results = this.Invoke("updateProducts", new object[] { products }); + return ((Product[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateProducts))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveProducts))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateProducts))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class ProductAction { + private string productActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProductAction.Type")] + public string ProductActionType { + get { return this.productActionTypeField; } + set { this.productActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeactivateProducts : ProductAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ArchiveProducts : ProductAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ActivateProducts : ProductAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProductTemplateTargeting { + private GeoTargeting geoTargetingField; + + private bool allowGeoTargetingCustomizationField; + + private bool allowGeoTargetingCustomizationFieldSpecified; + + private InventoryTargeting inventoryTargetingField; + + private bool allowAdUnitTargetingCustomizationField; + + private bool allowAdUnitTargetingCustomizationFieldSpecified; + + private bool allowPlacementTargetingCustomizationField; + + private bool allowPlacementTargetingCustomizationFieldSpecified; + + private CustomCriteriaSet customTargetingField; + + private long[] customizableCustomTargetingKeyIdsField; + + private bool allowAudienceSegmentTargetingCustomizationField; + + private bool allowAudienceSegmentTargetingCustomizationFieldSpecified; + + private UserDomainTargeting userDomainTargetingField; + + private bool allowUserDomainTargetingCustomizationField; + + private bool allowUserDomainTargetingCustomizationFieldSpecified; + + private BandwidthGroupTargeting bandwidthGroupTargetingField; + + private bool allowBandwidthGroupTargetingCustomizationField; + + private bool allowBandwidthGroupTargetingCustomizationFieldSpecified; + + private BrowserTargeting browserTargetingField; + + private bool allowBrowserTargetingCustomizationField; + + private bool allowBrowserTargetingCustomizationFieldSpecified; + + private BrowserLanguageTargeting browserLanguageTargetingField; + + private bool allowBrowserLanguageTargetingCustomizationField; + + private bool allowBrowserLanguageTargetingCustomizationFieldSpecified; + + private OperatingSystemTargeting operatingSystemTargetingField; + + private bool allowOperatingSystemTargetingCustomizationField; + + private bool allowOperatingSystemTargetingCustomizationFieldSpecified; + + private DeviceCapabilityTargeting deviceCapabilityTargetingField; + + private bool allowDeviceCapabilityTargetingCustomizationField; + + private bool allowDeviceCapabilityTargetingCustomizationFieldSpecified; + + private DeviceCategoryTargeting deviceCategoryTargetingField; + + private bool allowDeviceCategoryTargetingCustomizationField; + + private bool allowDeviceCategoryTargetingCustomizationFieldSpecified; + + private MobileCarrierTargeting mobileCarrierTargetingField; + + private bool allowMobileCarrierTargetingCustomizationField; + + private bool allowMobileCarrierTargetingCustomizationFieldSpecified; + + private DeviceManufacturerTargeting deviceManufacturerTargetingField; + + private MobileDeviceTargeting mobileDeviceTargetingField; + + private MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargetingField; + + private bool allowMobileDeviceAndManufacturerTargetingCustomizationField; + + private bool allowMobileDeviceAndManufacturerTargetingCustomizationFieldSpecified; + + public GeoTargeting geoTargeting { + get { return this.geoTargetingField; } + set { this.geoTargetingField = value; } + } + + public bool allowGeoTargetingCustomization { + get { return this.allowGeoTargetingCustomizationField; } + set { + this.allowGeoTargetingCustomizationField = value; + this.allowGeoTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowGeoTargetingCustomizationSpecified { + get { return this.allowGeoTargetingCustomizationFieldSpecified; } + set { this.allowGeoTargetingCustomizationFieldSpecified = value; } + } + + public InventoryTargeting inventoryTargeting { + get { return this.inventoryTargetingField; } + set { this.inventoryTargetingField = value; } + } + + public bool allowAdUnitTargetingCustomization { + get { return this.allowAdUnitTargetingCustomizationField; } + set { + this.allowAdUnitTargetingCustomizationField = value; + this.allowAdUnitTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowAdUnitTargetingCustomizationSpecified { + get { return this.allowAdUnitTargetingCustomizationFieldSpecified; } + set { this.allowAdUnitTargetingCustomizationFieldSpecified = value; } + } + + public bool allowPlacementTargetingCustomization { + get { return this.allowPlacementTargetingCustomizationField; } + set { + this.allowPlacementTargetingCustomizationField = value; + this.allowPlacementTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowPlacementTargetingCustomizationSpecified { + get { return this.allowPlacementTargetingCustomizationFieldSpecified; } + set { this.allowPlacementTargetingCustomizationFieldSpecified = value; } + } + + public CustomCriteriaSet customTargeting { + get { return this.customTargetingField; } + set { this.customTargetingField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customizableCustomTargetingKeyIds")] + public long[] customizableCustomTargetingKeyIds { + get { return this.customizableCustomTargetingKeyIdsField; } + set { this.customizableCustomTargetingKeyIdsField = value; } + } + + public bool allowAudienceSegmentTargetingCustomization { + get { return this.allowAudienceSegmentTargetingCustomizationField; } + set { + this.allowAudienceSegmentTargetingCustomizationField = value; + this.allowAudienceSegmentTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowAudienceSegmentTargetingCustomizationSpecified { + get { return this.allowAudienceSegmentTargetingCustomizationFieldSpecified; } + set { this.allowAudienceSegmentTargetingCustomizationFieldSpecified = value; } + } + + public UserDomainTargeting userDomainTargeting { + get { return this.userDomainTargetingField; } + set { this.userDomainTargetingField = value; } + } + + public bool allowUserDomainTargetingCustomization { + get { return this.allowUserDomainTargetingCustomizationField; } + set { + this.allowUserDomainTargetingCustomizationField = value; + this.allowUserDomainTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowUserDomainTargetingCustomizationSpecified { + get { return this.allowUserDomainTargetingCustomizationFieldSpecified; } + set { this.allowUserDomainTargetingCustomizationFieldSpecified = value; } + } + + public BandwidthGroupTargeting bandwidthGroupTargeting { + get { return this.bandwidthGroupTargetingField; } + set { this.bandwidthGroupTargetingField = value; } + } + + public bool allowBandwidthGroupTargetingCustomization { + get { return this.allowBandwidthGroupTargetingCustomizationField; } + set { + this.allowBandwidthGroupTargetingCustomizationField = value; + this.allowBandwidthGroupTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowBandwidthGroupTargetingCustomizationSpecified { + get { return this.allowBandwidthGroupTargetingCustomizationFieldSpecified; } + set { this.allowBandwidthGroupTargetingCustomizationFieldSpecified = value; } + } + + public BrowserTargeting browserTargeting { + get { return this.browserTargetingField; } + set { this.browserTargetingField = value; } + } + + public bool allowBrowserTargetingCustomization { + get { return this.allowBrowserTargetingCustomizationField; } + set { + this.allowBrowserTargetingCustomizationField = value; + this.allowBrowserTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowBrowserTargetingCustomizationSpecified { + get { return this.allowBrowserTargetingCustomizationFieldSpecified; } + set { this.allowBrowserTargetingCustomizationFieldSpecified = value; } + } + + public BrowserLanguageTargeting browserLanguageTargeting { + get { return this.browserLanguageTargetingField; } + set { this.browserLanguageTargetingField = value; } + } + + public bool allowBrowserLanguageTargetingCustomization { + get { return this.allowBrowserLanguageTargetingCustomizationField; } + set { + this.allowBrowserLanguageTargetingCustomizationField = value; + this.allowBrowserLanguageTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowBrowserLanguageTargetingCustomizationSpecified { + get { return this.allowBrowserLanguageTargetingCustomizationFieldSpecified; } + set { this.allowBrowserLanguageTargetingCustomizationFieldSpecified = value; } + } + + public OperatingSystemTargeting operatingSystemTargeting { + get { return this.operatingSystemTargetingField; } + set { this.operatingSystemTargetingField = value; } + } + + public bool allowOperatingSystemTargetingCustomization { + get { return this.allowOperatingSystemTargetingCustomizationField; } + set { + this.allowOperatingSystemTargetingCustomizationField = value; + this.allowOperatingSystemTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowOperatingSystemTargetingCustomizationSpecified { + get { return this.allowOperatingSystemTargetingCustomizationFieldSpecified; } + set { this.allowOperatingSystemTargetingCustomizationFieldSpecified = value; } + } + + public DeviceCapabilityTargeting deviceCapabilityTargeting { + get { return this.deviceCapabilityTargetingField; } + set { this.deviceCapabilityTargetingField = value; } + } + + public bool allowDeviceCapabilityTargetingCustomization { + get { return this.allowDeviceCapabilityTargetingCustomizationField; } + set { + this.allowDeviceCapabilityTargetingCustomizationField = value; + this.allowDeviceCapabilityTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowDeviceCapabilityTargetingCustomizationSpecified { + get { return this.allowDeviceCapabilityTargetingCustomizationFieldSpecified; } + set { this.allowDeviceCapabilityTargetingCustomizationFieldSpecified = value; } + } + + public DeviceCategoryTargeting deviceCategoryTargeting { + get { return this.deviceCategoryTargetingField; } + set { this.deviceCategoryTargetingField = value; } + } + + public bool allowDeviceCategoryTargetingCustomization { + get { return this.allowDeviceCategoryTargetingCustomizationField; } + set { + this.allowDeviceCategoryTargetingCustomizationField = value; + this.allowDeviceCategoryTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowDeviceCategoryTargetingCustomizationSpecified { + get { return this.allowDeviceCategoryTargetingCustomizationFieldSpecified; } + set { this.allowDeviceCategoryTargetingCustomizationFieldSpecified = value; } + } + + public MobileCarrierTargeting mobileCarrierTargeting { + get { return this.mobileCarrierTargetingField; } + set { this.mobileCarrierTargetingField = value; } + } + + public bool allowMobileCarrierTargetingCustomization { + get { return this.allowMobileCarrierTargetingCustomizationField; } + set { + this.allowMobileCarrierTargetingCustomizationField = value; + this.allowMobileCarrierTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowMobileCarrierTargetingCustomizationSpecified { + get { return this.allowMobileCarrierTargetingCustomizationFieldSpecified; } + set { this.allowMobileCarrierTargetingCustomizationFieldSpecified = value; } + } + + public DeviceManufacturerTargeting deviceManufacturerTargeting { + get { return this.deviceManufacturerTargetingField; } + set { this.deviceManufacturerTargetingField = value; } + } + + public MobileDeviceTargeting mobileDeviceTargeting { + get { return this.mobileDeviceTargetingField; } + set { this.mobileDeviceTargetingField = value; } + } + + public MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargeting { + get { return this.mobileDeviceSubmodelTargetingField; } + set { this.mobileDeviceSubmodelTargetingField = value; } + } + + public bool allowMobileDeviceAndManufacturerTargetingCustomization { + get { return this.allowMobileDeviceAndManufacturerTargetingCustomizationField; } + set { + this.allowMobileDeviceAndManufacturerTargetingCustomizationField = value; + this.allowMobileDeviceAndManufacturerTargetingCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowMobileDeviceAndManufacturerTargetingCustomizationSpecified { + get { return this.allowMobileDeviceAndManufacturerTargetingCustomizationFieldSpecified; } + set { this.allowMobileDeviceAndManufacturerTargetingCustomizationFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Product { + private string nameField; + + private ProductStatus statusField; + + private bool statusFieldSpecified; + + private ProductType productTypeField; + + private bool productTypeFieldSpecified; + + private long productTemplateIdField; + + private bool productTemplateIdFieldSpecified; + + private string idField; + + private string notesField; + + private string productTemplateDescriptionField; + + private DateTime lastModifiedDateTimeField; + + private RateType rateTypeField; + + private bool rateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int priorityField; + + private bool priorityFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private bool allowFrequencyCapsCustomizationField; + + private bool allowFrequencyCapsCustomizationFieldSpecified; + + private ProductTemplateTargeting targetingField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ProductStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ProductType productType { + get { return this.productTypeField; } + set { + this.productTypeField = value; + this.productTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productTypeSpecified { + get { return this.productTypeFieldSpecified; } + set { this.productTypeFieldSpecified = value; } + } + + public long productTemplateId { + get { return this.productTemplateIdField; } + set { + this.productTemplateIdField = value; + this.productTemplateIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productTemplateIdSpecified { + get { return this.productTemplateIdFieldSpecified; } + set { this.productTemplateIdFieldSpecified = value; } + } + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public string productTemplateDescription { + get { return this.productTemplateDescriptionField; } + set { this.productTemplateDescriptionField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public RateType rateType { + get { return this.rateTypeField; } + set { + this.rateTypeField = value; + this.rateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateTypeSpecified { + get { return this.rateTypeFieldSpecified; } + set { this.rateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public bool allowFrequencyCapsCustomization { + get { return this.allowFrequencyCapsCustomizationField; } + set { + this.allowFrequencyCapsCustomizationField = value; + this.allowFrequencyCapsCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowFrequencyCapsCustomizationSpecified { + get { return this.allowFrequencyCapsCustomizationFieldSpecified; } + set { this.allowFrequencyCapsCustomizationFieldSpecified = value; } + } + + public ProductTemplateTargeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ProductStatus { + ACTIVE, + INACTIVE, + ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ProductType { + DFP, + OFFLINE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum RateType { + CPM, + CPC, + CPD, + CPU, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProductPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Product[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Product[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProductError : ApiError { + private ProductErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProductErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ProductErrorReason { + TEMPLATE_NOT_FOUND, + MALFORMED_PRODUCT_ID, + BAD_PRODUCT_ID_FEATURE, + BAD_PRODUCT_TEMPLATE_ID, + CANNOT_UPDATE_ARCHIVED_PRODUCT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProductActionError : ApiError { + private ProductActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProductActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ProductActionErrorReason { + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class BaseRateError : ApiError { + private BaseRateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BaseRateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BaseRateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum BaseRateErrorReason { + CANNOT_QUERY_BOTH_PRODUCT_TEMPLATE_ID_AND_PRODUCT_ID, + INVALID_CURRENCY_CODE, + PRODUCT_TEMPLATE_ARCHIVED, + UNSUPPORTED_OPERATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "RateCardCustomizationGroupServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class RateCardCustomizationGroupService : DfpSoapClient, IRateCardCustomizationGroupService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public RateCardCustomizationGroupService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/RateCardCustomizationGroupServi" + "ce"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomizationGroup[] createRateCardCustomizationGroups([System.Xml.Serialization.XmlElementAttribute("rateCardCustomizationGroups")] +RateCardCustomizationGroup[] rateCardCustomizationGroups) { + object[] results = this.Invoke("createRateCardCustomizationGroups", new object[] { rateCardCustomizationGroups }); + return ((RateCardCustomizationGroup[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomizationGroupPage getRateCardCustomizationGroupsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getRateCardCustomizationGroupsByStatement", new object[] { filterStatement }); + return ((RateCardCustomizationGroupPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomizationGroup[] updateRateCardCustomizationGroups([System.Xml.Serialization.XmlElementAttribute("rateCardCustomizationGroups")] +RateCardCustomizationGroup[] rateCardCustomizationGroups) { + object[] results = this.Invoke("updateRateCardCustomizationGroups", new object[] { rateCardCustomizationGroups }); + return ((RateCardCustomizationGroup[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RateCardCustomizationGroupPage { + private RateCardCustomizationGroup[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public RateCardCustomizationGroup[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RateCardCustomizationGroup { + private long idField; + + private bool idFieldSpecified; + + private long rateCardIdField; + + private bool rateCardIdFieldSpecified; + + private PricingMethod pricingMethodField; + + private bool pricingMethodFieldSpecified; + + private RateCardFeature rateCardFeatureField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long rateCardId { + get { return this.rateCardIdField; } + set { + this.rateCardIdField = value; + this.rateCardIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardIdSpecified { + get { return this.rateCardIdFieldSpecified; } + set { this.rateCardIdFieldSpecified = value; } + } + + public PricingMethod pricingMethod { + get { return this.pricingMethodField; } + set { + this.pricingMethodField = value; + this.pricingMethodSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool pricingMethodSpecified { + get { return this.pricingMethodFieldSpecified; } + set { this.pricingMethodFieldSpecified = value; } + } + + public RateCardFeature rateCardFeature { + get { return this.rateCardFeatureField; } + set { this.rateCardFeatureField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum PricingMethod { + SUM, + HIGHEST, + ANY_VALUE, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserDomainRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnknownRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlacementRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OperatingSystemRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MobileCarrierRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GeographyRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FrequencyCapRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceManufacturerRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceCategoryRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeviceCapabilityRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DaypartRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomTargetingRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BrowserLanguageRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BrowserRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BandwidthRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AudienceSegmentRateCardFeature))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdUnitRateCardFeature))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class RateCardFeature { + private string rateCardFeatureTypeField; + + [System.Xml.Serialization.XmlElementAttribute("RateCardFeature.Type")] + public string RateCardFeatureType { + get { return this.rateCardFeatureTypeField; } + set { this.rateCardFeatureTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class UserDomainRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class UnknownRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class PlacementRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class OperatingSystemRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class MobileCarrierRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class GeographyRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class FrequencyCapRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeviceManufacturerRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeviceCategoryRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeviceCapabilityRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DaypartRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CustomTargetingRateCardFeature : RateCardFeature { + private long customTargetingKeyIdField; + + private bool customTargetingKeyIdFieldSpecified; + + private long customTargetingValueIdField; + + private bool customTargetingValueIdFieldSpecified; + + public long customTargetingKeyId { + get { return this.customTargetingKeyIdField; } + set { + this.customTargetingKeyIdField = value; + this.customTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customTargetingKeyIdSpecified { + get { return this.customTargetingKeyIdFieldSpecified; } + set { this.customTargetingKeyIdFieldSpecified = value; } + } + + public long customTargetingValueId { + get { return this.customTargetingValueIdField; } + set { + this.customTargetingValueIdField = value; + this.customTargetingValueIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customTargetingValueIdSpecified { + get { return this.customTargetingValueIdFieldSpecified; } + set { this.customTargetingValueIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class BrowserLanguageRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class BrowserRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class BandwidthRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AudienceSegmentRateCardFeature : RateCardFeature { + private long audienceSegmentIdField; + + private bool audienceSegmentIdFieldSpecified; + + public long audienceSegmentId { + get { return this.audienceSegmentIdField; } + set { + this.audienceSegmentIdField = value; + this.audienceSegmentIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool audienceSegmentIdSpecified { + get { return this.audienceSegmentIdFieldSpecified; } + set { this.audienceSegmentIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdUnitRateCardFeature : RateCardFeature { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RateCardCustomizationGroupError : ApiError { + private RateCardCustomizationGroupErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RateCardCustomizationGroupErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RateCardCustomizationGroupError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum RateCardCustomizationGroupErrorReason { + INVALID_PRICING_METHOD, + INVALID_RATE_CARD_FEATURE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ActivityGroupServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ActivityGroupService : DfpSoapClient, IActivityGroupService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ActivityGroupService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/ActivityGroupService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroup[] createActivityGroups([System.Xml.Serialization.XmlElementAttribute("activityGroups")] +ActivityGroup[] activityGroups) { + object[] results = this.Invoke("createActivityGroups", new object[] { activityGroups }); + return ((ActivityGroup[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroupPage getActivityGroupsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getActivityGroupsByStatement", new object[] { filterStatement }); + return ((ActivityGroupPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityGroup[] updateActivityGroups([System.Xml.Serialization.XmlElementAttribute("activityGroups")] +ActivityGroup[] activityGroups) { + object[] results = this.Invoke("updateActivityGroups", new object[] { activityGroups }); + return ((ActivityGroup[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ActivityGroupPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ActivityGroup[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ActivityGroup[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ActivityGroup { + private int idField; + + private bool idFieldSpecified; + + private string nameField; + + private long[] companyIdsField; + + private int impressionsLookbackField; + + private bool impressionsLookbackFieldSpecified; + + private int clicksLookbackField; + + private bool clicksLookbackFieldSpecified; + + private ActivityGroupStatus statusField; + + private bool statusFieldSpecified; + + public int id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companyIds")] + public long[] companyIds { + get { return this.companyIdsField; } + set { this.companyIdsField = value; } + } + + public int impressionsLookback { + get { return this.impressionsLookbackField; } + set { + this.impressionsLookbackField = value; + this.impressionsLookbackSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool impressionsLookbackSpecified { + get { return this.impressionsLookbackFieldSpecified; } + set { this.impressionsLookbackFieldSpecified = value; } + } + + public int clicksLookback { + get { return this.clicksLookbackField; } + set { + this.clicksLookbackField = value; + this.clicksLookbackSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clicksLookbackSpecified { + get { return this.clicksLookbackFieldSpecified; } + set { this.clicksLookbackFieldSpecified = value; } + } + + public ActivityGroupStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ActivityGroup.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ActivityGroupStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ActivityError : ApiError { + private ActivityErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ActivityErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ActivityError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ActivityErrorReason { + ACTIVITIES_FEATURE_REQUIRED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LabelServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LabelService : DfpSoapClient, ILabelService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LabelService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/LabelService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Label[] createLabels([System.Xml.Serialization.XmlElementAttribute("labels")] +Label[] labels) { + object[] results = this.Invoke("createLabels", new object[] { labels }); + return ((Label[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LabelPage getLabelsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLabelsByStatement", new object[] { filterStatement }); + return ((LabelPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performLabelAction(LabelAction labelAction, Statement filterStatement) { + object[] results = this.Invoke("performLabelAction", new object[] { labelAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Label[] updateLabels([System.Xml.Serialization.XmlElementAttribute("labels")] +Label[] labels) { + object[] results = this.Invoke("updateLabels", new object[] { labels }); + return ((Label[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateLabels))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLabels))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class LabelAction { + private string labelActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LabelAction.Type")] + public string LabelActionType { + get { return this.labelActionTypeField; } + set { this.labelActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeactivateLabels : LabelAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ActivateLabels : LabelAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LabelPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Label[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Label[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Label { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private LabelType[] typesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("types")] + public LabelType[] types { + get { return this.typesField; } + set { this.typesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum LabelType { + COMPETITIVE_EXCLUSION, + AD_UNIT_FREQUENCY_CAP, + AD_EXCLUSION, + CREATIVE_WRAPPER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LabelError : ApiError { + private LabelErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LabelErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LabelError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum LabelErrorReason { + INVALID_PREFIX, + NAME_INVALID_CHARS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CreativeWrapperError : ApiError { + private CreativeWrapperErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeWrapperErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeWrapperError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CreativeWrapperErrorReason { + LABEL_ALREADY_ASSOCIATED_WITH_CREATIVE_WRAPPER, + INVALID_LABEL_TYPE, + UNRECOGNIZED_MACRO, + NEITHER_HEADER_NOR_FOOTER_SPECIFIED, + CANNOT_USE_CREATIVE_WRAPPER_TYPE, + CANNOT_UPDATE_LABEL_ID, + CANNOT_APPLY_TO_AD_UNIT_WITH_VIDEO_SIZES, + CANNOT_APPLY_TO_MOBILE_AD_UNIT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LineItemCreativeAssociationServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LineItemCreativeAssociationService : DfpSoapClient, ILineItemCreativeAssociationService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LineItemCreativeAssociationService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/LineItemCreativeAssociationServ" + "ice"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociation[] createLineItemCreativeAssociations([System.Xml.Serialization.XmlElementAttribute("lineItemCreativeAssociations")] +LineItemCreativeAssociation[] lineItemCreativeAssociations) { + object[] results = this.Invoke("createLineItemCreativeAssociations", new object[] { lineItemCreativeAssociations }); + return ((LineItemCreativeAssociation[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociationPage getLineItemCreativeAssociationsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLineItemCreativeAssociationsByStatement", new object[] { filterStatement }); + return ((LineItemCreativeAssociationPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual string getPreviewUrl(long lineItemId, long creativeId, string siteUrl) { + object[] results = this.Invoke("getPreviewUrl", new object[] { lineItemId, creativeId, siteUrl }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performLineItemCreativeAssociationAction(LineItemCreativeAssociationAction lineItemCreativeAssociationAction, Statement filterStatement) { + object[] results = this.Invoke("performLineItemCreativeAssociationAction", new object[] { lineItemCreativeAssociationAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemCreativeAssociation[] updateLineItemCreativeAssociations([System.Xml.Serialization.XmlElementAttribute("lineItemCreativeAssociations")] +LineItemCreativeAssociation[] lineItemCreativeAssociations) { + object[] results = this.Invoke("updateLineItemCreativeAssociations", new object[] { lineItemCreativeAssociations }); + return ((LineItemCreativeAssociation[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateLineItemCreativeAssociations))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLineItemCreativeAssociations))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class LineItemCreativeAssociationAction { + private string lineItemCreativeAssociationActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LineItemCreativeAssociationAction.Type")] + public string LineItemCreativeAssociationActionType { + get { return this.lineItemCreativeAssociationActionTypeField; } + set { this.lineItemCreativeAssociationActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeactivateLineItemCreativeAssociations : LineItemCreativeAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ActivateLineItemCreativeAssociations : LineItemCreativeAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LineItemCreativeAssociationPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LineItemCreativeAssociation[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LineItemCreativeAssociation[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LineItemCreativeAssociation { + private long lineItemIdField; + + private bool lineItemIdFieldSpecified; + + private long creativeIdField; + + private bool creativeIdFieldSpecified; + + private long creativeSetIdField; + + private bool creativeSetIdFieldSpecified; + + private double manualCreativeRotationWeightField; + + private bool manualCreativeRotationWeightFieldSpecified; + + private int sequentialCreativeRotationIndexField; + + private bool sequentialCreativeRotationIndexFieldSpecified; + + private DateTime startDateTimeField; + + private StartDateTimeType startDateTimeTypeField; + + private bool startDateTimeTypeFieldSpecified; + + private DateTime endDateTimeField; + + private string destinationUrlField; + + private Size[] sizesField; + + private LineItemCreativeAssociationStatus statusField; + + private bool statusFieldSpecified; + + private LineItemCreativeAssociationStats statsField; + + private DateTime lastModifiedDateTimeField; + + public long lineItemId { + get { return this.lineItemIdField; } + set { + this.lineItemIdField = value; + this.lineItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemIdSpecified { + get { return this.lineItemIdFieldSpecified; } + set { this.lineItemIdFieldSpecified = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { + this.creativeIdField = value; + this.creativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeIdSpecified { + get { return this.creativeIdFieldSpecified; } + set { this.creativeIdFieldSpecified = value; } + } + + public long creativeSetId { + get { return this.creativeSetIdField; } + set { + this.creativeSetIdField = value; + this.creativeSetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeSetIdSpecified { + get { return this.creativeSetIdFieldSpecified; } + set { this.creativeSetIdFieldSpecified = value; } + } + + public double manualCreativeRotationWeight { + get { return this.manualCreativeRotationWeightField; } + set { + this.manualCreativeRotationWeightField = value; + this.manualCreativeRotationWeightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manualCreativeRotationWeightSpecified { + get { return this.manualCreativeRotationWeightFieldSpecified; } + set { this.manualCreativeRotationWeightFieldSpecified = value; } + } + + public int sequentialCreativeRotationIndex { + get { return this.sequentialCreativeRotationIndexField; } + set { + this.sequentialCreativeRotationIndexField = value; + this.sequentialCreativeRotationIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool sequentialCreativeRotationIndexSpecified { + get { return this.sequentialCreativeRotationIndexFieldSpecified; } + set { this.sequentialCreativeRotationIndexFieldSpecified = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public StartDateTimeType startDateTimeType { + get { return this.startDateTimeTypeField; } + set { + this.startDateTimeTypeField = value; + this.startDateTimeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startDateTimeTypeSpecified { + get { return this.startDateTimeTypeFieldSpecified; } + set { this.startDateTimeTypeFieldSpecified = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("sizes")] + public Size[] sizes { + get { return this.sizesField; } + set { this.sizesField = value; } + } + + public LineItemCreativeAssociationStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public LineItemCreativeAssociationStats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociation.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum LineItemCreativeAssociationStatus { + ACTIVE, + NOT_SERVING, + INACTIVE, + DELETED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LineItemCreativeAssociationStats { + private Stats statsField; + + private Long_StatsMapEntry[] creativeSetStatsField; + + private Money costInOrderCurrencyField; + + public Stats stats { + get { return this.statsField; } + set { this.statsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativeSetStats")] + public Long_StatsMapEntry[] creativeSetStats { + get { return this.creativeSetStatsField; } + set { this.creativeSetStatsField = value; } + } + + public Money costInOrderCurrency { + get { return this.costInOrderCurrencyField; } + set { this.costInOrderCurrencyField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Long_StatsMapEntry { + private long keyField; + + private bool keyFieldSpecified; + + private Stats valueField; + + public long key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + public Stats value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class TemplateInstantiatedCreativeError : ApiError { + private TemplateInstantiatedCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public TemplateInstantiatedCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "TemplateInstantiatedCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum TemplateInstantiatedCreativeErrorReason { + INACTIVE_CREATIVE_TEMPLATE, + FILE_TYPE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class SwiffyConversionError : ApiError { + private SwiffyConversionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public SwiffyConversionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "SwiffyConversionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum SwiffyConversionErrorReason { + SERVER_ERROR, + INVALID_FLASH_FILE, + UNSUPPORTED_FLASH, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RichMediaStudioCreativeError : ApiError { + private RichMediaStudioCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RichMediaStudioCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaStudioCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum RichMediaStudioCreativeErrorReason { + CREATION_NOT_ALLOWED, + UKNOWN_ERROR, + INVALID_CODE_GENERATION_REQUEST, + INVALID_CREATIVE_OBJECT, + STUDIO_CONNECTION_ERROR, + PUSHDOWN_DURATION_NOT_ALLOWED, + INVALID_POSITION, + INVALID_Z_INDEX, + INVALID_PUSHDOWN_DURATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LineItemCreativeAssociationOperationError : ApiError { + private LineItemCreativeAssociationOperationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LineItemCreativeAssociationOperationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LineItemCreativeAssociationOperationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum LineItemCreativeAssociationOperationErrorReason { + NOT_ALLOWED, + NOT_APPLICABLE, + CANNOT_ACTIVATE_INVALID_CREATIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class InvalidPhoneNumberError : ApiError { + private InvalidPhoneNumberErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidPhoneNumberErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidPhoneNumberError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum InvalidPhoneNumberErrorReason { + INVALID_FORMAT, + TOO_SHORT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ImageError : ApiError { + private ImageErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ImageErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ImageError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ImageErrorReason { + INVALID_IMAGE, + INVALID_SIZE, + UNEXPECTED_SIZE, + OVERLAY_SIZE_TOO_LARGE, + ANIMATED_NOT_ALLOWED, + ANIMATION_TOO_LONG, + CMYK_JPEG_NOT_ALLOWED, + FLASH_NOT_ALLOWED, + FLASH_WITHOUT_CLICKTAG, + ANIMATED_VISUAL_EFFECT, + FLASH_ERROR, + LAYOUT_PROBLEM, + FLASH_HAS_NETWORK_OBJECTS, + FLASH_HAS_NETWORK_METHODS, + FLASH_HAS_URL, + FLASH_HAS_MOUSE_TRACKING, + FLASH_HAS_RANDOM_NUM, + FLASH_SELF_TARGETS, + FLASH_BAD_GETURL_TARGET, + FLASH_VERSION_NOT_SUPPORTED, + FILE_TOO_LARGE, + SYSTEM_ERROR, + UNEXPECTED_PRIMARY_ASSET_DENSITY, + DUPLICATE_ASSET_DENSITY, + MISSING_DEFAULT_ASSET, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class FileError : ApiError { + private FileErrorReason reasonField; + + private bool reasonFieldSpecified; + + public FileErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FileError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum FileErrorReason { + MISSING_CONTENTS, + SIZE_TOO_LARGE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CustomCreativeError : ApiError { + private CustomCreativeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomCreativeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomCreativeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CustomCreativeErrorReason { + DUPLICATE_MACRO_NAME_FOR_CREATIVE, + SNIPPET_REFERENCES_MISSING_MACRO, + UNRECOGNIZED_MACRO, + CUSTOM_CREATIVE_NOT_ALLOWED, + MISSING_INTERSTITIAL_MACRO, + DUPLICATE_ASSET_IN_MACROS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CreativeSetError : ApiError { + private CreativeSetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeSetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeSetError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CreativeSetErrorReason { + VIDEO_FEATURE_REQUIRED, + CANNOT_CREATE_OR_UPDATE_VIDEO_CREATIVES, + ROADBLOCK_FEATURE_REQUIRED, + MASTER_CREATIVE_CANNOT_BE_COMPANION, + INVALID_ADVERTISER, + UPDATE_MASTER_CREATIVE_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CreativeAssetMacroError : ApiError { + private CreativeAssetMacroErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CreativeAssetMacroErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CreativeAssetMacroError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CreativeAssetMacroErrorReason { + INVALID_MACRO_NAME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AssetError : ApiError { + private AssetErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AssetErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AssetError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AssetErrorReason { + NON_UNIQUE_NAME, + FILE_NAME_TOO_LONG, + FILE_SIZE_TOO_LARGE, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_CLIENT, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_HEIGHT, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_WIDTH, + MISSING_REQUIRED_DYNAMIC_ALLOCATION_FORMAT, + INVALID_CODE_SNIPPET_PARAMETER_VALUE, + INVALID_ASSET_ID, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdSenseAccountError : ApiError { + private AdSenseAccountErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdSenseAccountErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseAccountError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AdSenseAccountErrorReason { + ASSOCIATE_ACCOUNT_API_ERROR, + GET_AD_SLOT_API_ERROR, + GET_CHANNEL_API_ERROR, + GET_BULK_ACCOUNT_STATUSES_API_ERROR, + RESEND_VERIFICATION_EMAIL_ERROR, + UNEXPECTED_API_RESPONSE_ERROR, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReportServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReportService : DfpSoapClient, IReportService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReportService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/ReportService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual string getReportDownloadURL(long reportJobId, ExportFormat exportFormat) { + object[] results = this.Invoke("getReportDownloadURL", new object[] { reportJobId, exportFormat }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual string getReportDownloadUrlWithOptions(long reportJobId, ReportDownloadOptions reportDownloadOptions) { + object[] results = this.Invoke("getReportDownloadUrlWithOptions", new object[] { reportJobId, reportDownloadOptions }); + return ((string) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReportJob getReportJob(long reportJobId) { + object[] results = this.Invoke("getReportJob", new object[] { reportJobId }); + return ((ReportJob) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReportJob runReportJob(ReportJob reportJob) { + object[] results = this.Invoke("runReportJob", new object[] { reportJob }); + return ((ReportJob) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ReportQuery { + private Dimension[] dimensionsField; + + private ReportQueryAdUnitView adUnitViewField; + + private bool adUnitViewFieldSpecified; + + private Column[] columnsField; + + private DimensionAttribute[] dimensionAttributesField; + + private long[] customFieldIdsField; + + private long[] contentMetadataKeyHierarchyCustomTargetingKeyIdsField; + + private Date startDateField; + + private Date endDateField; + + private DateRangeType dateRangeTypeField; + + private bool dateRangeTypeFieldSpecified; + + private DimensionFilter[] dimensionFiltersField; + + private Statement statementField; + + private string timeZoneField; + + [System.Xml.Serialization.XmlElementAttribute("dimensions")] + public Dimension[] dimensions { + get { return this.dimensionsField; } + set { this.dimensionsField = value; } + } + + public ReportQueryAdUnitView adUnitView { + get { return this.adUnitViewField; } + set { + this.adUnitViewField = value; + this.adUnitViewSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adUnitViewSpecified { + get { return this.adUnitViewFieldSpecified; } + set { this.adUnitViewFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("columns")] + public Column[] columns { + get { return this.columnsField; } + set { this.columnsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("dimensionAttributes")] + public DimensionAttribute[] dimensionAttributes { + get { return this.dimensionAttributesField; } + set { this.dimensionAttributesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldIds")] + public long[] customFieldIds { + get { return this.customFieldIdsField; } + set { this.customFieldIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("contentMetadataKeyHierarchyCustomTargetingKeyIds")] + public long[] contentMetadataKeyHierarchyCustomTargetingKeyIds { + get { return this.contentMetadataKeyHierarchyCustomTargetingKeyIdsField; } + set { this.contentMetadataKeyHierarchyCustomTargetingKeyIdsField = value; } + } + + public Date startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public Date endDate { + get { return this.endDateField; } + set { this.endDateField = value; } + } + + public DateRangeType dateRangeType { + get { return this.dateRangeTypeField; } + set { + this.dateRangeTypeField = value; + this.dateRangeTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dateRangeTypeSpecified { + get { return this.dateRangeTypeFieldSpecified; } + set { this.dateRangeTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("dimensionFilters")] + public DimensionFilter[] dimensionFilters { + get { return this.dimensionFiltersField; } + set { this.dimensionFiltersField = value; } + } + + public Statement statement { + get { return this.statementField; } + set { this.statementField = value; } + } + + public string timeZone { + get { return this.timeZoneField; } + set { this.timeZoneField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum Dimension { + MONTH_AND_YEAR, + WEEK, + DATE, + DAY, + HOUR, + LINE_ITEM_ID, + LINE_ITEM_NAME, + LINE_ITEM_TYPE, + ORDER_ID, + ORDER_NAME, + ADVERTISER_ID, + ADVERTISER_NAME, + AD_NETWORK_ID, + AD_NETWORK_NAME, + SALESPERSON_ID, + SALESPERSON_NAME, + CREATIVE_ID, + CREATIVE_NAME, + CREATIVE_TYPE, + CUSTOM_EVENT_ID, + CUSTOM_EVENT_NAME, + CUSTOM_EVENT_TYPE, + CREATIVE_SIZE, + AD_UNIT_ID, + AD_UNIT_NAME, + PARENT_AD_UNIT_ID, + PARENT_AD_UNIT_NAME, + PLACEMENT_ID, + PLACEMENT_NAME, + TARGETING, + DEVICE_CATEGORY_ID, + DEVICE_CATEGORY_NAME, + COUNTRY_CRITERIA_ID, + COUNTRY_NAME, + REGION_CRITERIA_ID, + REGION_NAME, + CITY_CRITERIA_ID, + CITY_NAME, + METRO_CRITERIA_ID, + METRO_NAME, + POSTAL_CODE_CRITERIA_ID, + POSTAL_CODE, + CUSTOM_TARGETING_VALUE_ID, + CUSTOM_CRITERIA, + ACTIVITY_ID, + ACTIVITY_NAME, + ACTIVITY_GROUP_ID, + ACTIVITY_GROUP_NAME, + CONTENT_ID, + CONTENT_NAME, + CONTENT_BUNDLE_ID, + CONTENT_BUNDLE_NAME, + CONTENT_HIERARCHY, + VIDEO_FALLBACK_POSITION, + POSITION_OF_POD, + POSITION_IN_POD, + GRP_DEMOGRAPHICS, + AD_REQUEST_SIZE, + AD_REQUEST_AD_UNIT_SIZES, + AD_REQUEST_CUSTOM_CRITERIA, + BUYER_ID, + BUYER_NAME, + VERIFIED_ADVERTISER_ID, + VERIFIED_ADVERTISER_NAME, + MASTER_COMPANION_CREATIVE_ID, + MASTER_COMPANION_CREATIVE_NAME, + DISTRIBUTION_PARTNER_ID, + DISTRIBUTION_PARTNER_NAME, + CONTENT_PARTNER_ID, + CONTENT_PARTNER_NAME, + RIGHTS_HOLDER_ID, + RIGHTS_HOLDER_NAME, + PROPOSAL_LINE_ITEM_ID, + PROPOSAL_LINE_ITEM_NAME, + PROPOSAL_ID, + PROPOSAL_NAME, + ALL_SALESPEOPLE_ID, + ALL_SALESPEOPLE_NAME, + PROPOSAL_AGENCY_ID, + PROPOSAL_AGENCY_NAME, + PRODUCT_ID, + PRODUCT_NAME, + PRODUCT_TEMPLATE_ID, + PRODUCT_TEMPLATE_NAME, + RATE_CARD_ID, + RATE_CARD_NAME, + WORKFLOW_ID, + WORKFLOW_NAME, + AUDIENCE_SEGMENT_ID, + AUDIENCE_SEGMENT_NAME, + AUDIENCE_SEGMENT_DATA_PROVIDER_NAME + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportQuery.AdUnitView", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ReportQueryAdUnitView { + TOP_LEVEL, + FLAT, + HIERARCHICAL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum Column { + AD_SERVER_IMPRESSIONS, + AD_SERVER_TARGETED_IMPRESSIONS, + AD_SERVER_CLICKS, + AD_SERVER_TARGETED_CLICKS, + AD_SERVER_CTR, + AD_SERVER_CPM_AND_CPC_REVENUE, + AD_SERVER_CPD_REVENUE, + AD_SERVER_CPA_REVENUE, + AD_SERVER_ALL_REVENUE, + AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM, + AD_SERVER_WITH_CPD_AVERAGE_ECPM, + AD_SERVER_INVENTORY_LEVEL_PERCENT_IMPRESSIONS, + AD_SERVER_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + AD_SERVER_INVENTORY_LEVEL_PERCENT_CLICKS, + AD_SERVER_LINE_ITEM_LEVEL_PERCENT_CLICKS, + AD_SERVER_INVENTORY_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + AD_SERVER_INVENTORY_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_SERVER_LINE_ITEM_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + AD_SERVER_LINE_ITEM_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_SERVER_DELIVERY_INDICATOR, + AD_SERVER_CODE_SERVED_COUNT, + AD_SERVER_IMPRESSIONS_OUT_OF_NETWORK, + AD_SERVER_CLICKS_OUT_OF_NETWORK, + AD_SERVER_CTR_OUT_OF_NETWORK, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + TOTAL_DYNAMIC_ALLOCATION_IMPRESSIONS_OUT_OF_NETWORK, + ADSENSE_LINE_ITEM_LEVEL_IMPRESSIONS, + ADSENSE_LINE_ITEM_LEVEL_TARGETED_IMPRESSIONS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + ADSENSE_LINE_ITEM_LEVEL_CLICKS, + ADSENSE_LINE_ITEM_LEVEL_TARGETED_CLICKS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CTR, + ADSENSE_LINE_ITEM_LEVEL_CTR, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_REVENUE, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_AVERAGE_ECPM, + ADSENSE_LINE_ITEM_LEVEL_AVERAGE_ECPM, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_PERCENT_IMPRESSIONS, + ADSENSE_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_PERCENT_CLICKS, + ADSENSE_LINE_ITEM_LEVEL_PERCENT_CLICKS, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + DYNAMIC_ALLOCATION_INVENTORY_LEVEL_WITH_CPD_PERCENT_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + ADSENSE_LINE_ITEM_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_IMPRESSIONS, + AD_EXCHANGE_LINE_ITEM_LEVEL_TARGETED_IMPRESSIONS, + AD_EXCHANGE_LINE_ITEM_LEVEL_CLICKS, + AD_EXCHANGE_LINE_ITEM_LEVEL_TARGETED_CLICKS, + AD_EXCHANGE_LINE_ITEM_LEVEL_CTR, + AD_EXCHANGE_LINE_ITEM_LEVEL_PERCENT_IMPRESSIONS, + AD_EXCHANGE_LINE_ITEM_LEVEL_PERCENT_CLICKS, + AD_EXCHANGE_LINE_ITEM_LEVEL_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_WITHOUT_CPD_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_WITH_CPD_PERCENT_REVENUE, + AD_EXCHANGE_LINE_ITEM_LEVEL_AVERAGE_ECPM, + TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + TOTAL_LINE_ITEM_LEVEL_IMPRESSIONS, + TOTAL_LINE_ITEM_LEVEL_TARGETED_IMPRESSIONS, + TOTAL_LINE_ITEM_LEVEL_IMPRESSIONS_INCLUDING_OUT_OF_NETWORK_DELIVERY, + TOTAL_INVENTORY_LEVEL_CLICKS, + TOTAL_LINE_ITEM_LEVEL_CLICKS, + TOTAL_LINE_ITEM_LEVEL_TARGETED_CLICKS, + TOTAL_INVENTORY_LEVEL_CTR, + TOTAL_LINE_ITEM_LEVEL_CTR, + TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE, + TOTAL_INVENTORY_LEVEL_ALL_REVENUE, + TOTAL_LINE_ITEM_LEVEL_CPM_AND_CPC_REVENUE, + TOTAL_LINE_ITEM_LEVEL_ALL_REVENUE, + TOTAL_INVENTORY_LEVEL_WITHOUT_CPD_AVERAGE_ECPM, + TOTAL_INVENTORY_LEVEL_WITH_CPD_AVERAGE_ECPM, + TOTAL_LINE_ITEM_LEVEL_WITHOUT_CPD_AVERAGE_ECPM, + TOTAL_LINE_ITEM_LEVEL_WITH_CPD_AVERAGE_ECPM, + TOTAL_CODE_SERVED_COUNT, + TOTAL_INVENTORY_LEVEL_UNFILLED_IMPRESSIONS, + TOTAL_UNFILLED_IMPRESSIONS_INCLUDING_OUT_OF_NETWORK_DELIVERY, + MERGED_AD_SERVER_DELIVERY_INDICATOR, + MERGED_AD_SERVER_IMPRESSIONS, + MERGED_AD_SERVER_CLICKS, + MERGED_AD_SERVER_CTR, + MERGED_AD_SERVER_CPM_AND_CPC_REVENUE, + MERGED_AD_SERVER_ALL_REVENUE, + MERGED_AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM, + MERGED_AD_SERVER_WITH_CPD_AVERAGE_ECPM, + OPTIMIZATION_CONTROL_IMPRESSIONS, + OPTIMIZATION_CONTROL_CLICKS, + OPTIMIZATION_CONTROL_CTR, + OPTIMIZATION_OPTIMIZED_IMPRESSIONS, + OPTIMIZATION_OPTIMIZED_CLICKS, + OPTIMIZATION_NON_OPTIMIZED_IMPRESSIONS, + OPTIMIZATION_NON_OPTIMIZED_CLICKS, + OPTIMIZATION_EXTRA_CLICKS, + OPTIMIZATION_OPTIMIZED_CTR, + OPTIMIZATION_LIFT, + OPTIMIZATION_COVERAGE, + OPTIMIZATION_BEHIND_SCHEDULE_IMPRESSIONS, + OPTIMIZATION_NO_CLICKS_RECORDED_IMPRESSIONS, + OPTIMIZATION_SPONSORSHIP_IMPRESSIONS, + OPTIMIZATION_AS_FAST_AS_POSSIBLE_IMPRESSIONS, + OPTIMIZATION_NO_ABSOLUTE_LIFETIME_GOAL_IMPRESSIONS, + OPTIMIZATION_CONTROL_REVENUE, + OPTIMIZATION_OPTIMIZED_REVENUE, + OPTIMIZATION_CONTROL_ECPM, + OPTIMIZATION_OPTIMIZED_ECPM, + OPTIMIZATION_FREED_UP_IMPRESSIONS, + OPTIMIZATION_ECPM_LIFT, + REACH_FREQUENCY, + REACH_AVERAGE_REVENUE, + REACH, + GRP_POPULATION, + GRP_UNIQUE_AUDIENCE, + GRP_UNIQUE_AUDIENCE_SHARE, + GRP_AUDIENCE_IMPRESSIONS, + GRP_AUDIENCE_IMPRESSIONS_SHARE, + GRP_AUDIENCE_REACH, + GRP_AUDIENCE_AVERAGE_FREQUENCY, + GRP_GROSS_RATING_POINTS, + SDK_MEDIATION_CREATIVE_IMPRESSIONS, + SDK_MEDIATION_CREATIVE_CLICKS, + SELL_THROUGH_FORECASTED_IMPRESSIONS, + SELL_THROUGH_AVAILABLE_IMPRESSIONS, + SELL_THROUGH_RESERVED_IMPRESSIONS, + SELL_THROUGH_SELL_THROUGH_RATE, + RICH_MEDIA_BACKUP_IMAGES, + RICH_MEDIA_DISPLAY_TIME, + RICH_MEDIA_AVERAGE_DISPLAY_TIME, + RICH_MEDIA_EXPANSIONS, + RICH_MEDIA_EXPANDING_TIME, + RICH_MEDIA_INTERACTION_TIME, + RICH_MEDIA_INTERACTION_COUNT, + RICH_MEDIA_INTERACTION_RATE, + RICH_MEDIA_AVERAGE_INTERACTION_TIME, + RICH_MEDIA_INTERACTION_IMPRESSIONS, + RICH_MEDIA_MANUAL_CLOSES, + RICH_MEDIA_FULL_SCREEN_IMPRESSIONS, + RICH_MEDIA_VIDEO_INTERACTIONS, + RICH_MEDIA_VIDEO_INTERACTION_RATE, + RICH_MEDIA_VIDEO_MUTES, + RICH_MEDIA_VIDEO_PAUSES, + RICH_MEDIA_VIDEO_PLAYES, + RICH_MEDIA_VIDEO_MIDPOINTS, + RICH_MEDIA_VIDEO_COMPLETES, + RICH_MEDIA_VIDEO_REPLAYS, + RICH_MEDIA_VIDEO_STOPS, + RICH_MEDIA_VIDEO_UNMUTES, + RICH_MEDIA_VIDEO_VIEW_TIME, + RICH_MEDIA_VIDEO_VIEW_RATE, + RICH_MEDIA_CUSTOM_EVENT_TIME, + RICH_MEDIA_CUSTOM_EVENT_COUNT, + VIDEO_VIEWERSHIP_START, + VIDEO_VIEWERSHIP_FIRST_QUARTILE, + VIDEO_VIEWERSHIP_MIDPOINT, + VIDEO_VIEWERSHIP_THIRD_QUARTILE, + VIDEO_VIEWERSHIP_COMPLETE, + VIDEO_VIEWERSHIP_AVERAGE_VIEW_RATE, + VIDEO_VIEWERSHIP_AVERAGE_VIEW_TIME, + VIDEO_VIEWERSHIP_COMPLETION_RATE, + VIDEO_VIEWERSHIP_TOTAL_ERROR_COUNT, + VIDEO_VIEWERSHIP_VIDEO_LENGTH, + VIDEO_VIEWERSHIP_SKIP_BUTTON_SHOWN, + VIDEO_VIEWERSHIP_ENGAGED_VIEW, + VIDEO_VIEWERSHIP_VIEW_THROUGH_RATE, + VIDEO_VIEWERSHIP_TOTAL_ERROR_RATE, + VIDEO_ERRORS_VAST_2_ERROR_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_100_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_101_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_102_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_200_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_201_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_202_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_203_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_300_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_301_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_302_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_303_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_400_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_401_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_402_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_403_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_405_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_500_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_501_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_502_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_503_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_600_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_601_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_602_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_603_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_604_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_900_COUNT, + VIDEO_ERRORS_VAST_3_ERROR_901_COUNT, + VIDEO_INTERACTION_PAUSE, + VIDEO_INTERACTION_RESUME, + VIDEO_INTERACTION_REWIND, + VIDEO_INTERACTION_MUTE, + VIDEO_INTERACTION_UNMUTE, + VIDEO_INTERACTION_COLLAPSE, + VIDEO_INTERACTION_EXPAND, + VIDEO_INTERACTION_FULL_SCREEN, + VIDEO_INTERACTION_AVERAGE_INTERACTION_RATE, + VIDEO_INTERACTION_VIDEO_SKIPS, + VIDEO_OPTIMIZATION_CONTROL_STARTS, + VIDEO_OPTIMIZATION_OPTIMIZED_STARTS, + VIDEO_OPTIMIZATION_CONTROL_COMPLETES, + VIDEO_OPTIMIZATION_OPTIMIZED_COMPLETES, + VIDEO_OPTIMIZATION_CONTROL_COMPLETION_RATE, + VIDEO_OPTIMIZATION_OPTIMIZED_COMPLETION_RATE, + VIDEO_OPTIMIZATION_COMPLETION_RATE_LIFT, + VIDEO_OPTIMIZATION_CONTROL_SKIP_BUTTON_SHOWN, + VIDEO_OPTIMIZATION_OPTIMIZED_SKIP_BUTTON_SHOWN, + VIDEO_OPTIMIZATION_CONTROL_ENGAGED_VIEW, + VIDEO_OPTIMIZATION_OPTIMIZED_ENGAGED_VIEW, + VIDEO_OPTIMIZATION_CONTROL_VIEW_THROUGH_RATE, + VIDEO_OPTIMIZATION_OPTIMIZED_VIEW_THROUGH_RATE, + VIDEO_OPTIMIZATION_VIEW_THROUGH_RATE_LIFT, + TOTAL_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS, + TOTAL_ACTIVE_VIEW_NOT_VIEWABLE_IMPRESSIONS, + TOTAL_ACTIVE_VIEW_NOT_MEASURABLE_IMPRESSIONS, + TOTAL_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE, + TOTAL_ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS, + TOTAL_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE, + AD_SERVER_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS, + AD_SERVER_ACTIVE_VIEW_NOT_VIEWABLE_IMPRESSIONS, + AD_SERVER_ACTIVE_VIEW_NOT_MEASURABLE_IMPRESSIONS, + AD_SERVER_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE, + AD_SERVER_ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS, + AD_SERVER_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE, + ADSENSE_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS, + ADSENSE_ACTIVE_VIEW_NOT_VIEWABLE_IMPRESSIONS, + ADSENSE_ACTIVE_VIEW_NOT_MEASURABLE_IMPRESSIONS, + ADSENSE_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE, + ADSENSE_ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS, + ADSENSE_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE, + AD_EXCHANGE_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS, + AD_EXCHANGE_ACTIVE_VIEW_NOT_VIEWABLE_IMPRESSIONS, + AD_EXCHANGE_ACTIVE_VIEW_NOT_MEASURABLE_IMPRESSIONS, + AD_EXCHANGE_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE, + AD_EXCHANGE_ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS, + AD_EXCHANGE_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE, + DISTRIBUTION_PARTNER_IMPRESSIONS, + DISTRIBUTION_PARTNER_CLICKS, + DISTRIBUTION_PARTNER_CTR, + DISTRIBUTION_PARTNER_GROSS_REVENUE, + DISTRIBUTION_PARTNER_HOST_REVENUE, + DISTRIBUTION_PARTNER_HOST_ECPM, + DISTRIBUTION_PARTNER_PARTNER_REVENUE, + DISTRIBUTION_PARTNER_PARTNER_ECPM, + CONTENT_PARTNER_IMPRESSIONS, + CONTENT_PARTNER_CLICKS, + CONTENT_PARTNER_CTR, + CONTENT_PARTNER_GROSS_REVENUE, + CONTENT_PARTNER_HOST_REVENUE, + CONTENT_PARTNER_HOST_ECPM, + CONTENT_PARTNER_PARTNER_REVENUE, + CONTENT_PARTNER_PARTNER_ECPM, + RIGHTS_HOLDER_IMPRESSIONS, + RIGHTS_HOLDER_CLICKS, + RIGHTS_HOLDER_CTR, + RIGHTS_HOLDER_GROSS_REVENUE, + RIGHTS_HOLDER_HOST_REVENUE, + RIGHTS_HOLDER_HOST_ECPM, + RIGHTS_HOLDER_PARTNER_REVENUE, + RIGHTS_HOLDER_PARTNER_ECPM, + VIEW_THROUGH_CONVERSIONS, + CONVERSIONS_PER_THOUSAND_IMPRESSIONS, + CLICK_THROUGH_CONVERSIONS, + CONVERSIONS_PER_CLICK, + VIEW_THROUGH_REVENUE, + CLICK_THROUGH_REVENUE, + TOTAL_CONVERSIONS, + TOTAL_CONVERSION_REVENUE, + DYNAMIC_ALLOCATION_OPPORTUNITY_IMPRESSIONS_COMPETING, + DYNAMIC_ALLOCATION_OPPORTUNITY_UNFILLED_IMPRESSIONS_COMPETING, + DYNAMIC_ALLOCATION_OPPORTUNITY_ELIGIBLE_IMPRESSIONS, + DYNAMIC_ALLOCATION_OPPORTUNITY_IMPRESSIONS_NOT_COMPETING, + DYNAMIC_ALLOCATION_OPPORTUNITY_IMPRESSIONS_NOT_COMPETING_PERCENT, + DYNAMIC_ALLOCATION_OPPORTUNITY_SATURATION_RATE, + DYNAMIC_ALLOCATION_OPPORTUNITY_MATCH_RATE, + CONTRACTED_REVENUE_CONTRACTED_NET_REVENUE, + CONTRACTED_REVENUE_LOCAL_CONTRACTED_NET_REVENUE, + CONTRACTED_REVENUE_CONTRACTED_GROSS_REVENUE, + CONTRACTED_REVENUE_LOCAL_CONTRACTED_GROSS_REVENUE, + CONTRACTED_REVENUE_CONTRACTED_PLACEMENT_NET_REVENUE, + CONTRACTED_REVENUE_CONTRACTED_PLACEMENT_GROSS_REVENUE, + CONTRACTED_REVENUE_CONTRACTED_VAT, + CONTRACTED_REVENUE_LOCAL_CONTRACTED_VAT, + CONTRACTED_REVENUE_CONTRACTED_AGENCY_COMMISSION, + CONTRACTED_REVENUE_LOCAL_CONTRACTED_AGENCY_COMMISSION, + SALES_CONTRACT_CONTRACTED_IMPRESSIONS, + SALES_CONTRACT_CONTRACTED_CLICKS, + SALES_CONTRACT_CONTRACTED_VOLUME, + SALES_CONTRACT_BUDGET, + SALES_CONTRACT_REMAINING_BUDGET, + SALES_CONTRACT_BUFFERED_IMPRESSIONS, + SALES_CONTRACT_BUFFERED_CLICKS, + UNIFIED_REVENUE_UNRECONCILED_NET_REVENUE, + UNIFIED_REVENUE_LOCAL_UNRECONCILED_NET_REVENUE, + UNIFIED_REVENUE_UNRECONCILED_GROSS_REVENUE, + UNIFIED_REVENUE_LOCAL_UNRECONCILED_GROSS_REVENUE, + UNIFIED_REVENUE_FORECASTED_NET_REVENUE, + UNIFIED_REVENUE_LOCAL_FORECASTED_NET_REVENUE, + UNIFIED_REVENUE_FORECASTED_GROSS_REVENUE, + UNIFIED_REVENUE_LOCAL_FORECASTED_GROSS_REVENUE, + UNIFIED_REVENUE_UNIFIED_NET_REVENUE, + UNIFIED_REVENUE_LOCAL_UNIFIED_NET_REVENUE, + UNIFIED_REVENUE_UNIFIED_GROSS_REVENUE, + UNIFIED_REVENUE_LOCAL_UNIFIED_GROSS_REVENUE, + UNIFIED_REVENUE_UNIFIED_AGENCY_COMMISSION, + UNIFIED_REVENUE_LOCAL_UNIFIED_AGENCY_COMMISSION, + EXPECTED_REVENUE_EXPECTED_NET_REVENUE, + EXPECTED_REVENUE_LOCAL_EXPECTED_NET_REVENUE, + EXPECTED_REVENUE_EXPECTED_GROSS_REVENUE, + EXPECTED_REVENUE_LOCAL_EXPECTED_GROSS_REVENUE, + SALES_PIPELINE_PIPELINE_NET_REVENUE, + SALES_PIPELINE_LOCAL_PIPELINE_NET_REVENUE, + SALES_PIPELINE_PIPELINE_GROSS_REVENUE, + SALES_PIPELINE_LOCAL_PIPELINE_GROSS_REVENUE, + SALES_PIPELINE_PIPELINE_AGENCY_COMMISSION, + SALES_PIPELINE_LOCAL_PIPELINE_AGENCY_COMMISSION, + RECONCILIATION_LAST_DATE_TIME, + RECONCILIATION_RECONCILIATION_STATUS, + RECONCILIATION_DFP_VOLUME, + RECONCILIATION_THIRD_PARTY_VOLUME, + RECONCILIATION_RECONCILED_VOLUME, + RECONCILIATION_DISCREPANCY, + RECONCILIATION_RECONCILED_REVENUE, + BILLING_BILLABLE_NET_REVENUE, + BILLING_LOCAL_BILLABLE_NET_REVENUE, + BILLING_BILLABLE_GROSS_REVENUE, + BILLING_LOCAL_BILLABLE_GROSS_REVENUE, + BILLING_BILLABLE_VAT, + BILLING_LOCAL_BILLABLE_VAT, + BILLING_BILLABLE_AGENCY_COMMISSION, + BILLING_LOCAL_BILLABLE_AGENCY_COMMISSION, + BILLING_CAP_QUANTITY, + BILLING_BILLABLE_VOLUME, + BILLING_DELIVERY_ROLLOVER_FROM_PREVIOUS, + DISCOUNTS_BREAKDOWN_ADDITIONAL_ADJUSTMENT, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_OVERALL_DISCOUNT, + DISCOUNTS_BREAKDOWN_BILLABLE_NET_OVERALL_DISCOUNT, + DISCOUNTS_BREAKDOWN_BILLABLE_NET_EXCLUDED_PREMIUMS, + DISCOUNTS_BREAKDOWN_BILLABLE_NET_ADVERTISER_DISCOUNT, + DISCOUNTS_BREAKDOWN_BILLABLE_NET_PRODUCT_ADJUSTMENT, + DISCOUNTS_BREAKDOWN_BILLABLE_NET_PROPOSAL_DISCOUNT, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_EXCLUDED_PREMIUMS, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_ADVERTISER_DISCOUNT, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_PRODUCT_ADJUSTMENT, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_PROPOSAL_DISCOUNT, + DISCOUNTS_BREAKDOWN_CONTRACTED_NET_NON_BILLABLE, + SALESPERSON_PERFORMANCE_SHARED_PIPELINE_NET_REVENUE, + SALESPERSON_PERFORMANCE_SHARED_PIPELINE_GROSS_REVENUE, + SALESPERSON_PERFORMANCE_SHARED_UNIFIED_NET_REVENUE, + SALESPERSON_PERFORMANCE_SHARED_UNIFIED_GROSS_REVENUE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum DimensionAttribute { + LINE_ITEM_LABELS, + LINE_ITEM_LABEL_IDS, + LINE_ITEM_OPTIMIZABLE, + LINE_ITEM_DELIVERY_PACING, + LINE_ITEM_FREQUENCY_CAP, + LINE_ITEM_RECONCILED_RATE, + ADVERTISER_EXTERNAL_ID, + ADVERTISER_PRIMARY_CONTACT, + ORDER_START_DATE_TIME, + ORDER_END_DATE_TIME, + ORDER_EXTERNAL_ID, + ORDER_PO_NUMBER, + ORDER_IS_PROGRAMMATIC, + ORDER_AGENCY, + ORDER_AGENCY_ID, + ORDER_LABELS, + ORDER_LABEL_IDS, + ORDER_TRAFFICKER, + ORDER_TRAFFICKER_ID, + ORDER_SECONDARY_TRAFFICKERS, + ORDER_SALESPERSON, + ORDER_SECONDARY_SALESPEOPLE, + ORDER_LIFETIME_IMPRESSIONS, + ORDER_LIFETIME_CLICKS, + ORDER_LIFETIME_MERGED_IMPRESSIONS, + ORDER_LIFETIME_MERGED_CLICKS, + ORDER_BOOKED_CPM, + ORDER_BOOKED_CPC, + LINE_ITEM_START_DATE_TIME, + LINE_ITEM_END_DATE_TIME, + LINE_ITEM_EXTERNAL_ID, + LINE_ITEM_COST_TYPE, + LINE_ITEM_COST_PER_UNIT, + LINE_ITEM_CURRENCY_CODE, + LINE_ITEM_GOAL_QUANTITY, + LINE_ITEM_SPONSORSHIP_GOAL_PERCENTAGE, + LINE_ITEM_LIFETIME_IMPRESSIONS, + LINE_ITEM_LIFETIME_CLICKS, + LINE_ITEM_LIFETIME_MERGED_IMPRESSIONS, + LINE_ITEM_LIFETIME_MERGED_CLICKS, + LINE_ITEM_PRIORITY, + CREATIVE_OR_CREATIVE_SET, + MASTER_COMPANION_TYPE, + LINE_ITEM_CONTRACTED_QUANTITY, + LINE_ITEM_DISCOUNT, + LINE_ITEM_NON_CPD_BOOKED_REVENUE, + ADVERTISER_LABELS, + ADVERTISER_LABEL_IDS, + CREATIVE_CLICK_THROUGH_URL, + CREATIVE_SSL_SCAN_RESULT, + CREATIVE_SSL_COMPLIANCE_OVERRIDE, + LINE_ITEM_CREATIVE_START_DATE, + LINE_ITEM_CREATIVE_END_DATE, + PROPOSAL_START_DATE_TIME, + PROPOSAL_END_DATE_TIME, + PROPOSAL_CREATION_DATE_TIME, + PROPOSAL_SOLD_DATE_TIME, + PROPOSAL_IS_SOLD, + PROPOSAL_PROBABILITY_TO_CLOSE, + PROPOSAL_STATUS, + PROPOSAL_ARCHIVAL_STATUS, + PROPOSAL_CURRENCY, + PROPOSAL_EXCHANGE_RATE, + PROPOSAL_AGENCY_COMMISSION_RATE, + PROPOSAL_VAT_RATE, + PROPOSAL_DISCOUNT, + PROPOSAL_ADVERTISER_DISCOUNT, + PROPOSAL_ADVERTISER, + PROPOSAL_ADVERTISER_ID, + PROPOSAL_AGENCIES, + PROPOSAL_AGENCY_IDS, + PROPOSAL_PO_NUMBER, + PROPOSAL_PRIMARY_SALESPERSON, + PROPOSAL_SECONDARY_SALESPEOPLE, + PROPOSAL_CREATOR, + PROPOSAL_SALES_PLANNERS, + PROPOSAL_PRICING_MODEL, + PROPOSAL_BILLING_SOURCE, + PROPOSAL_BILLING_CAP, + PROPOSAL_BILLING_SCHEDULE, + PROPOSAL_APPLIED_TEAM_NAMES, + PROPOSAL_APPROVAL_STAGE, + PROPOSAL_LINE_ITEM_START_DATE_TIME, + PROPOSAL_LINE_ITEM_END_DATE_TIME, + PROPOSAL_LINE_ITEM_RATE_TYPE, + PROPOSAL_LINE_ITEM_COST_PER_UNIT, + PROPOSAL_LINE_ITEM_LOCAL_COST_PER_UNIT, + PROPOSAL_LINE_ITEM_COST_PER_UNIT_GROSS, + PROPOSAL_LINE_ITEM_LOCAL_COST_PER_UNIT_GROSS, + PROPOSAL_LINE_ITEM_TYPE_AND_PRIORITY, + PROPOSAL_LINE_ITEM_SIZE, + PROPOSAL_LINE_ITEM_ARCHIVAL_STATUS, + PROPOSAL_LINE_ITEM_PRODUCT_ADJUSTMENT, + PROPOSAL_LINE_ITEM_BUFFER, + PROPOSAL_LINE_ITEM_TARGET_RATE_NET, + PROPOSAL_LINE_ITEM_BILLING_SOURCE, + PROPOSAL_LINE_ITEM_BILLING_CAP, + PROPOSAL_LINE_ITEM_BILLING_SCHEDULE, + PROPOSAL_LINE_ITEM_GOAL_PERCENTAGE, + PROPOSAL_LINE_ITEM_COST_ADJUSTMENT, + PROPOSAL_LINE_ITEM_COMMENTS, + PRODUCT_TEMPLATE_RATE_TYPE, + PRODUCT_TEMPLATE_STATUS, + PRODUCT_TEMPLATE_TYPE_AND_PRIORITY, + PRODUCT_TEMPLATE_PRODUCT_TYPE, + PRODUCT_TEMPLATE_DESCRIPTION, + PRODUCT_PRODUCT_TEMPLATE_NAME, + PRODUCT_RATE_TYPE, + PRODUCT_STATUS, + PRODUCT_TYPE_AND_PRIORITY, + PRODUCT_PRODUCT_TYPE, + PRODUCT_NOTES, + PROPOSAL_AGENCY_TYPE, + PROPOSAL_AGENCY_CREDIT_STATUS, + PROPOSAL_AGENCY_EXTERNAL_ID, + PROPOSAL_AGENCY_COMMENT, + SALESPEOPLE_PROPOSAL_CONTRIBUTION, + SALESPERSON_PROPOSAL_CONTRIBUTION, + CONTENT_CMS_NAME, + CONTENT_CMS_VIDEO_ID, + AD_UNIT_CODE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum DateRangeType { + TODAY, + YESTERDAY, + LAST_WEEK, + LAST_MONTH, + REACH_LIFETIME, + CUSTOM_DATE, + NEXT_DAY, + NEXT_90_DAYS, + NEXT_WEEK, + NEXT_MONTH, + CURRENT_AND_NEXT_MONTH, + NEXT_QUARTER, + NEXT_3_MONTHS, + NEXT_12_MONTHS + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum DimensionFilter { + ADVERTISERS, + ACTIVE_ADVERTISERS, + HOUSE_ADVERTISERS, + NON_HOUSE_ADVERTISERS, + ALL_SALESPEOPLE, + WHOLE_NETWORK, + CURRENT_USER_ORDERS, + STARTED_ORDERS, + COMPLETED_ORDERS, + MOBILE_LINE_ITEMS, + WEB_LINE_ITEMS, + ACTIVE_AD_UNITS, + INACTIVE_AD_UNITS, + MOBILE_INVENTORY_UNITS, + WEB_INVENTORY_UNITS, + ARCHIVED_AD_UNITS, + ACTIVE_PLACEMENTS, + INACTIVE_PLACEMENTS, + ARCHIVED_PLACEMENTS, + OPTIMIZABLE_ORDERS, + PARTNER_STATS_TYPE_ESTIMATED, + PARTNER_STATS_TYPE_RECONCILED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ReportJob { + private long idField; + + private bool idFieldSpecified; + + private ReportQuery reportQueryField; + + private ReportJobStatus reportJobStatusField; + + private bool reportJobStatusFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public ReportQuery reportQuery { + get { return this.reportQueryField; } + set { this.reportQueryField = value; } + } + + public ReportJobStatus reportJobStatus { + get { return this.reportJobStatusField; } + set { + this.reportJobStatusField = value; + this.reportJobStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reportJobStatusSpecified { + get { return this.reportJobStatusFieldSpecified; } + set { this.reportJobStatusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ReportJobStatus { + COMPLETED, + IN_PROGRESS, + FAILED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ReportDownloadOptions { + private ExportFormat exportFormatField; + + private bool exportFormatFieldSpecified; + + private bool includeReportPropertiesField; + + private bool includeReportPropertiesFieldSpecified; + + private bool includeTotalsRowField; + + private bool includeTotalsRowFieldSpecified; + + private bool useGzipCompressionField; + + private bool useGzipCompressionFieldSpecified; + + public ExportFormat exportFormat { + get { return this.exportFormatField; } + set { + this.exportFormatField = value; + this.exportFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool exportFormatSpecified { + get { return this.exportFormatFieldSpecified; } + set { this.exportFormatFieldSpecified = value; } + } + + public bool includeReportProperties { + get { return this.includeReportPropertiesField; } + set { + this.includeReportPropertiesField = value; + this.includeReportPropertiesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeReportPropertiesSpecified { + get { return this.includeReportPropertiesFieldSpecified; } + set { this.includeReportPropertiesFieldSpecified = value; } + } + + public bool includeTotalsRow { + get { return this.includeTotalsRowField; } + set { + this.includeTotalsRowField = value; + this.includeTotalsRowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool includeTotalsRowSpecified { + get { return this.includeTotalsRowFieldSpecified; } + set { this.includeTotalsRowFieldSpecified = value; } + } + + public bool useGzipCompression { + get { return this.useGzipCompressionField; } + set { + this.useGzipCompressionField = value; + this.useGzipCompressionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool useGzipCompressionSpecified { + get { return this.useGzipCompressionFieldSpecified; } + set { this.useGzipCompressionFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ExportFormat { + TSV, + CSV_EXCEL, + CSV_DUMP, + XML, + XLS, + XLSX + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ReportError : ApiError { + private ReportErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReportErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReportError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ReportErrorReason { + DEFAULT, + REPORT_ACCESS_NOT_ALLOWED, + DIMENSION_VIEW_NOT_ALLOWED, + DIMENSION_COMBINATION_NOT_ALLOWED, + ATTRIBUTE_VIEW_NOT_ALLOWED, + COLUMN_VIEW_NOT_ALLOWED, + TOO_MANY_CONCURRENT_REPORTS, + REPORT_QUERY_TOO_LONG, + INVALID_OPERATION_FOR_REPORT_STATE, + INVALID_DIMENSIONS, + INVALID_ATTRIBUTES, + INVALID_CONTENT_HIERARCHY_DIMENSIONS, + INVALID_COLUMNS, + INVALID_DIMENSION_FILTERS, + INVALID_DATE, + END_DATE_TIME_NOT_AFTER_START_TIME, + NOT_NULL, + ATTRIBUTES_NOT_SUPPORTED_FOR_REQUEST, + COLUMNS_NOT_SUPPORTED_FOR_REQUESTED_DIMENSIONS, + FAILED_TO_STORE_REPORT, + REPORT_NOT_FOUND, + SR_CANNOT_RUN_REPORT_IN_ANOTHER_NETWORK, + INVALID_TIME_ZONE_FOR_FEATURE_NOT_ENABLED, + INVALID_TIME_ZONE_FOR_ID, + UNSUPPORTED_TIME_ZONE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "InventoryServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class InventoryService : DfpSoapClient, IInventoryService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public InventoryService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/InventoryService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnit[] createAdUnits([System.Xml.Serialization.XmlElementAttribute("adUnits")] +AdUnit[] adUnits) { + object[] results = this.Invoke("createAdUnits", new object[] { adUnits }); + return ((AdUnit[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnitSize[] getAdUnitSizesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAdUnitSizesByStatement", new object[] { filterStatement }); + return ((AdUnitSize[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnitPage getAdUnitsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getAdUnitsByStatement", new object[] { filterStatement }); + return ((AdUnitPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performAdUnitAction(AdUnitAction adUnitAction, Statement filterStatement) { + object[] results = this.Invoke("performAdUnitAction", new object[] { adUnitAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual AdUnit[] updateAdUnits([System.Xml.Serialization.XmlElementAttribute("adUnits")] +AdUnit[] adUnits) { + object[] results = this.Invoke("updateAdUnits", new object[] { adUnits }); + return ((AdUnit[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RemoveAdUnitsFromPlacement))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateAdUnits))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssignAdUnitsToPlacement))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveAdUnits))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateAdUnits))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class AdUnitAction { + private string adUnitActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("AdUnitAction.Type")] + public string AdUnitActionType { + get { return this.adUnitActionTypeField; } + set { this.adUnitActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RemoveAdUnitsFromPlacement : AdUnitAction { + private long placementIdField; + + private bool placementIdFieldSpecified; + + public long placementId { + get { return this.placementIdField; } + set { + this.placementIdField = value; + this.placementIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool placementIdSpecified { + get { return this.placementIdFieldSpecified; } + set { this.placementIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeactivateAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AssignAdUnitsToPlacement : AdUnitAction { + private long placementIdField; + + private bool placementIdFieldSpecified; + + public long placementId { + get { return this.placementIdField; } + set { + this.placementIdField = value; + this.placementIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool placementIdSpecified { + get { return this.placementIdFieldSpecified; } + set { this.placementIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ArchiveAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ActivateAdUnits : AdUnitAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdUnitPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private AdUnit[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public AdUnit[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdUnit { + private string idField; + + private string parentIdField; + + private bool hasChildrenField; + + private bool hasChildrenFieldSpecified; + + private AdUnitParent[] parentPathField; + + private string nameField; + + private string descriptionField; + + private AdUnitTargetWindow targetWindowField; + + private bool targetWindowFieldSpecified; + + private InventoryStatus statusField; + + private bool statusFieldSpecified; + + private string adUnitCodeField; + + private AdUnitSize[] adUnitSizesField; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private MobilePlatform mobilePlatformField; + + private bool mobilePlatformFieldSpecified; + + private bool explicitlyTargetedField; + + private bool explicitlyTargetedFieldSpecified; + + private AdSenseSettingsInheritedProperty inheritedAdSenseSettingsField; + + private long partnerIdField; + + private bool partnerIdFieldSpecified; + + private LabelFrequencyCap[] appliedLabelFrequencyCapsField; + + private LabelFrequencyCap[] effectiveLabelFrequencyCapsField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private long[] effectiveTeamIdsField; + + private long[] appliedTeamIdsField; + + private DateTime lastModifiedDateTimeField; + + private SmartSizeMode smartSizeModeField; + + private bool smartSizeModeFieldSpecified; + + public string id { + get { return this.idField; } + set { this.idField = value; } + } + + public string parentId { + get { return this.parentIdField; } + set { this.parentIdField = value; } + } + + public bool hasChildren { + get { return this.hasChildrenField; } + set { + this.hasChildrenField = value; + this.hasChildrenSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasChildrenSpecified { + get { return this.hasChildrenFieldSpecified; } + set { this.hasChildrenFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("parentPath")] + public AdUnitParent[] parentPath { + get { return this.parentPathField; } + set { this.parentPathField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public AdUnitTargetWindow targetWindow { + get { return this.targetWindowField; } + set { + this.targetWindowField = value; + this.targetWindowSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetWindowSpecified { + get { return this.targetWindowFieldSpecified; } + set { this.targetWindowFieldSpecified = value; } + } + + public InventoryStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string adUnitCode { + get { return this.adUnitCodeField; } + set { this.adUnitCodeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adUnitSizes")] + public AdUnitSize[] adUnitSizes { + get { return this.adUnitSizesField; } + set { this.adUnitSizesField = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + public MobilePlatform mobilePlatform { + get { return this.mobilePlatformField; } + set { + this.mobilePlatformField = value; + this.mobilePlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool mobilePlatformSpecified { + get { return this.mobilePlatformFieldSpecified; } + set { this.mobilePlatformFieldSpecified = value; } + } + + public bool explicitlyTargeted { + get { return this.explicitlyTargetedField; } + set { + this.explicitlyTargetedField = value; + this.explicitlyTargetedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool explicitlyTargetedSpecified { + get { return this.explicitlyTargetedFieldSpecified; } + set { this.explicitlyTargetedFieldSpecified = value; } + } + + public AdSenseSettingsInheritedProperty inheritedAdSenseSettings { + get { return this.inheritedAdSenseSettingsField; } + set { this.inheritedAdSenseSettingsField = value; } + } + + public long partnerId { + get { return this.partnerIdField; } + set { + this.partnerIdField = value; + this.partnerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool partnerIdSpecified { + get { return this.partnerIdFieldSpecified; } + set { this.partnerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabelFrequencyCaps")] + public LabelFrequencyCap[] appliedLabelFrequencyCaps { + get { return this.appliedLabelFrequencyCapsField; } + set { this.appliedLabelFrequencyCapsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveLabelFrequencyCaps")] + public LabelFrequencyCap[] effectiveLabelFrequencyCaps { + get { return this.effectiveLabelFrequencyCapsField; } + set { this.effectiveLabelFrequencyCapsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveTeamIds")] + public long[] effectiveTeamIds { + get { return this.effectiveTeamIdsField; } + set { this.effectiveTeamIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public SmartSizeMode smartSizeMode { + get { return this.smartSizeModeField; } + set { + this.smartSizeModeField = value; + this.smartSizeModeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool smartSizeModeSpecified { + get { return this.smartSizeModeFieldSpecified; } + set { this.smartSizeModeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum InventoryStatus { + ACTIVE, + INACTIVE, + ARCHIVED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum MobilePlatform { + SITE, + APPLICATION + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdSenseSettingsInheritedProperty { + private AdSenseSettings valueField; + + public AdSenseSettings value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdSenseSettings { + private bool adSenseEnabledField; + + private bool adSenseEnabledFieldSpecified; + + private string borderColorField; + + private string titleColorField; + + private string backgroundColorField; + + private string textColorField; + + private string urlColorField; + + private AdSenseSettingsAdType adTypeField; + + private bool adTypeFieldSpecified; + + private AdSenseSettingsBorderStyle borderStyleField; + + private bool borderStyleFieldSpecified; + + private AdSenseSettingsFontFamily fontFamilyField; + + private bool fontFamilyFieldSpecified; + + private AdSenseSettingsFontSize fontSizeField; + + private bool fontSizeFieldSpecified; + + private Size_StringMapEntry[] afcFormatsField; + + public bool adSenseEnabled { + get { return this.adSenseEnabledField; } + set { + this.adSenseEnabledField = value; + this.adSenseEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adSenseEnabledSpecified { + get { return this.adSenseEnabledFieldSpecified; } + set { this.adSenseEnabledFieldSpecified = value; } + } + + public string borderColor { + get { return this.borderColorField; } + set { this.borderColorField = value; } + } + + public string titleColor { + get { return this.titleColorField; } + set { this.titleColorField = value; } + } + + public string backgroundColor { + get { return this.backgroundColorField; } + set { this.backgroundColorField = value; } + } + + public string textColor { + get { return this.textColorField; } + set { this.textColorField = value; } + } + + public string urlColor { + get { return this.urlColorField; } + set { this.urlColorField = value; } + } + + public AdSenseSettingsAdType adType { + get { return this.adTypeField; } + set { + this.adTypeField = value; + this.adTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adTypeSpecified { + get { return this.adTypeFieldSpecified; } + set { this.adTypeFieldSpecified = value; } + } + + public AdSenseSettingsBorderStyle borderStyle { + get { return this.borderStyleField; } + set { + this.borderStyleField = value; + this.borderStyleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool borderStyleSpecified { + get { return this.borderStyleFieldSpecified; } + set { this.borderStyleFieldSpecified = value; } + } + + public AdSenseSettingsFontFamily fontFamily { + get { return this.fontFamilyField; } + set { + this.fontFamilyField = value; + this.fontFamilySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fontFamilySpecified { + get { return this.fontFamilyFieldSpecified; } + set { this.fontFamilyFieldSpecified = value; } + } + + public AdSenseSettingsFontSize fontSize { + get { return this.fontSizeField; } + set { + this.fontSizeField = value; + this.fontSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fontSizeSpecified { + get { return this.fontSizeFieldSpecified; } + set { this.fontSizeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("afcFormats")] + public Size_StringMapEntry[] afcFormats { + get { return this.afcFormatsField; } + set { this.afcFormatsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.AdType", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AdSenseSettingsAdType { + TEXT, + IMAGE, + TEXT_AND_IMAGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.BorderStyle", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AdSenseSettingsBorderStyle { + DEFAULT, + NOT_ROUNDED, + SLIGHTLY_ROUNDED, + VERY_ROUNDED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.FontFamily", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AdSenseSettingsFontFamily { + DEFAULT, + ARIAL, + TAHOMA, + GEORGIA, + TIMES, + VERDANA + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdSenseSettings.FontSize", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AdSenseSettingsFontSize { + DEFAULT, + SMALL, + MEDIUM, + LARGE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Size_StringMapEntry { + private Size keyField; + + private string valueField; + + public Size key { + get { return this.keyField; } + set { this.keyField = value; } + } + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LabelFrequencyCap { + private FrequencyCap frequencyCapField; + + private long labelIdField; + + private bool labelIdFieldSpecified; + + public FrequencyCap frequencyCap { + get { return this.frequencyCapField; } + set { this.frequencyCapField = value; } + } + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum SmartSizeMode { + UNKNOWN, + NONE, + SMART_BANNER, + DYNAMIC_SIZE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdUnitTypeError : ApiError { + private AdUnitTypeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitTypeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitTypeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AdUnitTypeErrorReason { + MOBILE_APP_PLATFORM_NOT_VALID, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class InventoryUnitSizesError : ApiError { + private InventoryUnitSizesErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitSizesErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitSizesError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum InventoryUnitSizesErrorReason { + INVALID_SIZES, + INVALID_SIZE_FOR_PLATFORM, + VIDEO_FEATURE_MISSING, + VIDEO_MOBILE_LINE_ITEM_FEATURE_MISSING, + INVALID_SIZE_FOR_MASTER, + INVALID_SIZE_FOR_COMPANION, + DUPLICATE_MASTER_SIZES, + ASPECT_RATIO_NOT_SUPPORTED, + VIDEO_COMPANIONS_NOT_SUPPORTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class InventoryUnitPartnerAssociationError : ApiError { + private InventoryUnitPartnerAssociationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InventoryUnitPartnerAssociationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InventoryUnitPartnerAssociationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum InventoryUnitPartnerAssociationErrorReason { + ANCESTOR_AD_UNIT_HAS_PARTNER_ASSOCIATION, + DESCENDANT_AD_UNIT_HAS_PARTNER_ASSOCIATION, + SAME_PARTNER_ASSOCIATION_IN_INVENTORY_HIERARCHY, + NO_PARTNER_CATCH_ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class InvalidColorError : ApiError { + private InvalidColorErrorReason reasonField; + + private bool reasonFieldSpecified; + + public InvalidColorErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "InvalidColorError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum InvalidColorErrorReason { + INVALID_FORMAT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdUnitHierarchyError : ApiError { + private AdUnitHierarchyErrorReason reasonField; + + private bool reasonFieldSpecified; + + public AdUnitHierarchyErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "AdUnitHierarchyError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum AdUnitHierarchyErrorReason { + INVALID_DEPTH, + INVALID_PARENT, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "TeamServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class TeamService : DfpSoapClient, ITeamService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public TeamService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/TeamService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Team[] createTeams([System.Xml.Serialization.XmlElementAttribute("teams")] +Team[] teams) { + object[] results = this.Invoke("createTeams", new object[] { teams }); + return ((Team[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual TeamPage getTeamsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getTeamsByStatement", new object[] { filterStatement }); + return ((TeamPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Team[] updateTeams([System.Xml.Serialization.XmlElementAttribute("teams")] +Team[] teams) { + object[] results = this.Invoke("updateTeams", new object[] { teams }); + return ((Team[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class TeamPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Team[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Team[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Team { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool hasAllCompaniesField; + + private bool hasAllCompaniesFieldSpecified; + + private bool hasAllInventoryField; + + private bool hasAllInventoryFieldSpecified; + + private TeamAccessType teamAccessTypeField; + + private bool teamAccessTypeFieldSpecified; + + private long[] companyIdsField; + + private string[] adUnitIdsField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool hasAllCompanies { + get { return this.hasAllCompaniesField; } + set { + this.hasAllCompaniesField = value; + this.hasAllCompaniesSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasAllCompaniesSpecified { + get { return this.hasAllCompaniesFieldSpecified; } + set { this.hasAllCompaniesFieldSpecified = value; } + } + + public bool hasAllInventory { + get { return this.hasAllInventoryField; } + set { + this.hasAllInventoryField = value; + this.hasAllInventorySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool hasAllInventorySpecified { + get { return this.hasAllInventoryFieldSpecified; } + set { this.hasAllInventoryFieldSpecified = value; } + } + + public TeamAccessType teamAccessType { + get { return this.teamAccessTypeField; } + set { + this.teamAccessTypeField = value; + this.teamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool teamAccessTypeSpecified { + get { return this.teamAccessTypeFieldSpecified; } + set { this.teamAccessTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companyIds")] + public long[] companyIds { + get { return this.companyIdsField; } + set { this.companyIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adUnitIds")] + public string[] adUnitIds { + get { return this.adUnitIdsField; } + set { this.adUnitIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum TeamAccessType { + NONE, + READ_ONLY, + READ_WRITE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "NetworkServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class NetworkService : DfpSoapClient, INetworkService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public NetworkService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/NetworkService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Network[] getAllNetworks() { + object[] results = this.Invoke("getAllNetworks", new object[0]); + return ((Network[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Network getCurrentNetwork() { + object[] results = this.Invoke("getCurrentNetwork", new object[0]); + return ((Network) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Network makeTestNetwork() { + object[] results = this.Invoke("makeTestNetwork", new object[0]); + return ((Network) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Network updateNetwork(Network network) { + object[] results = this.Invoke("updateNetwork", new object[] { network }); + return ((Network) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Network { + private long idField; + + private bool idFieldSpecified; + + private string displayNameField; + + private string networkCodeField; + + private string propertyCodeField; + + private string timeZoneField; + + private string currencyCodeField; + + private string[] secondaryCurrencyCodesField; + + private string effectiveRootAdUnitIdField; + + private long contentBrowseCustomTargetingKeyIdField; + + private bool contentBrowseCustomTargetingKeyIdFieldSpecified; + + private bool isTestField; + + private bool isTestFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public string networkCode { + get { return this.networkCodeField; } + set { this.networkCodeField = value; } + } + + public string propertyCode { + get { return this.propertyCodeField; } + set { this.propertyCodeField = value; } + } + + public string timeZone { + get { return this.timeZoneField; } + set { this.timeZoneField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryCurrencyCodes")] + public string[] secondaryCurrencyCodes { + get { return this.secondaryCurrencyCodesField; } + set { this.secondaryCurrencyCodesField = value; } + } + + public string effectiveRootAdUnitId { + get { return this.effectiveRootAdUnitIdField; } + set { this.effectiveRootAdUnitIdField = value; } + } + + public long contentBrowseCustomTargetingKeyId { + get { return this.contentBrowseCustomTargetingKeyIdField; } + set { + this.contentBrowseCustomTargetingKeyIdField = value; + this.contentBrowseCustomTargetingKeyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool contentBrowseCustomTargetingKeyIdSpecified { + get { return this.contentBrowseCustomTargetingKeyIdFieldSpecified; } + set { this.contentBrowseCustomTargetingKeyIdFieldSpecified = value; } + } + + public bool isTest { + get { return this.isTestField; } + set { + this.isTestField = value; + this.isTestSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isTestSpecified { + get { return this.isTestFieldSpecified; } + set { this.isTestFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class NetworkError : ApiError { + private NetworkErrorReason reasonField; + + private bool reasonFieldSpecified; + + public NetworkErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "NetworkError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum NetworkErrorReason { + UNKNOWN, + MULTI_CURRENCY_NOT_SUPPORTED, + UNSUPPORTED_CURRENCY, + NETWORK_CURRENCY_CANNOT_BE_SAME_AS_SECONDARY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ExchangeRateError : ApiError { + private ExchangeRateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ExchangeRateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ExchangeRateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ExchangeRateErrorReason { + INVALID_CURRENCY_CODE, + UNSUPPORTED_CURRENCY_CODE, + CURRENCY_CODE_ALREADY_EXISTS, + INVALID_EXCHANGE_RATE, + EXCHANGE_RATE_NOT_FOUND, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "RateCardCustomizationServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class RateCardCustomizationService : DfpSoapClient, IRateCardCustomizationService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public RateCardCustomizationService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/RateCardCustomizationService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomization[] createRateCardCustomizations([System.Xml.Serialization.XmlElementAttribute("rateCardCustomizations")] +RateCardCustomization[] rateCardCustomizations) { + object[] results = this.Invoke("createRateCardCustomizations", new object[] { rateCardCustomizations }); + return ((RateCardCustomization[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomizationPage getRateCardCustomizationsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getRateCardCustomizationsByStatement", new object[] { filterStatement }); + return ((RateCardCustomizationPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performRateCardCustomizationAction(RateCardCustomizationAction rateCardCustomizationAction, Statement filterStatement) { + object[] results = this.Invoke("performRateCardCustomizationAction", new object[] { rateCardCustomizationAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual RateCardCustomization[] updateRateCardCustomizations([System.Xml.Serialization.XmlElementAttribute("rateCardCustomizations")] +RateCardCustomization[] rateCardCustomizations) { + object[] results = this.Invoke("updateRateCardCustomizations", new object[] { rateCardCustomizations }); + return ((RateCardCustomization[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteRateCardCustomizations))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class RateCardCustomizationAction { + private string rateCardCustomizationActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("RateCardCustomizationAction.Type")] + public string RateCardCustomizationActionType { + get { return this.rateCardCustomizationActionTypeField; } + set { this.rateCardCustomizationActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeleteRateCardCustomizations : RateCardCustomizationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RateCardCustomizationPage { + private RateCardCustomization[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public RateCardCustomization[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RateCardCustomization { + private long rateCardCustomizationGroupIdField; + + private bool rateCardCustomizationGroupIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private RateCardFeature rateCardFeatureField; + + private RateCardCustomizationAdjustmentType adjustmentTypeField; + + private bool adjustmentTypeFieldSpecified; + + private long adjustmentSizeField; + + private bool adjustmentSizeFieldSpecified; + + private RateType rateTypeField; + + private bool rateTypeFieldSpecified; + + public long rateCardCustomizationGroupId { + get { return this.rateCardCustomizationGroupIdField; } + set { + this.rateCardCustomizationGroupIdField = value; + this.rateCardCustomizationGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardCustomizationGroupIdSpecified { + get { return this.rateCardCustomizationGroupIdFieldSpecified; } + set { this.rateCardCustomizationGroupIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public RateCardFeature rateCardFeature { + get { return this.rateCardFeatureField; } + set { this.rateCardFeatureField = value; } + } + + public RateCardCustomizationAdjustmentType adjustmentType { + get { return this.adjustmentTypeField; } + set { + this.adjustmentTypeField = value; + this.adjustmentTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adjustmentTypeSpecified { + get { return this.adjustmentTypeFieldSpecified; } + set { this.adjustmentTypeFieldSpecified = value; } + } + + public long adjustmentSize { + get { return this.adjustmentSizeField; } + set { + this.adjustmentSizeField = value; + this.adjustmentSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adjustmentSizeSpecified { + get { return this.adjustmentSizeFieldSpecified; } + set { this.adjustmentSizeFieldSpecified = value; } + } + + public RateType rateType { + get { return this.rateTypeField; } + set { + this.rateTypeField = value; + this.rateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateTypeSpecified { + get { return this.rateTypeFieldSpecified; } + set { this.rateTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum RateCardCustomizationAdjustmentType { + PERCENTAGE, + ABSOLUTE_VALUE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RateCardCustomizationError : ApiError { + private RateCardCustomizationErrorReason reasonField; + + private bool reasonFieldSpecified; + + public RateCardCustomizationErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RateCardCustomizationError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum RateCardCustomizationErrorReason { + INVALID_RATE_TYPE, + CANNOT_ADD_TO_GROUP_BY_PRICING_METHOD, + FEATURE_NOT_BELONGS_TO_GROUP, + UNSUPPORTED_OPERATION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProposalLineItemServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProposalLineItemService : DfpSoapClient, IProposalLineItemService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProposalLineItemService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/ProposalLineItemService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItem[] createProposalLineItems([System.Xml.Serialization.XmlElementAttribute("proposalLineItems")] +ProposalLineItem[] proposalLineItems) { + object[] results = this.Invoke("createProposalLineItems", new object[] { proposalLineItems }); + return ((ProposalLineItem[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItemPage getProposalLineItemsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getProposalLineItemsByStatement", new object[] { filterStatement }); + return ((ProposalLineItemPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performProposalLineItemAction(ProposalLineItemAction proposalLineItemAction, Statement filterStatement) { + object[] results = this.Invoke("performProposalLineItemAction", new object[] { proposalLineItemAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalLineItem[] updateProposalLineItems([System.Xml.Serialization.XmlElementAttribute("proposalLineItems")] +ProposalLineItem[] proposalLineItems) { + object[] results = this.Invoke("updateProposalLineItems", new object[] { proposalLineItems }); + return ((ProposalLineItem[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveProposalLineItems))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveProposalLineItems))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class ProposalLineItemAction { + private string proposalLineItemActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProposalLineItemAction.Type")] + public string ProposalLineItemActionType { + get { return this.proposalLineItemActionTypeField; } + set { this.proposalLineItemActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class UnarchiveProposalLineItems : ProposalLineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ArchiveProposalLineItems : ProposalLineItemAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProposalLineItemPage { + private ProposalLineItem[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ProposalLineItem[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProposalLineItem { + private long idField; + + private bool idFieldSpecified; + + private long proposalIdField; + + private bool proposalIdFieldSpecified; + + private long rateCardIdField; + + private bool rateCardIdFieldSpecified; + + private string productIdField; + + private string nameField; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + private string notesField; + + private CostAdjustment costAdjustmentField; + + private bool costAdjustmentFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private long unitsBoughtField; + + private bool unitsBoughtFieldSpecified; + + private int unitsBoughtBufferField; + + private bool unitsBoughtBufferFieldSpecified; + + private DeliveryRateType deliveryRateTypeField; + + private bool deliveryRateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private CompanionDeliveryOption companionDeliveryOptionField; + + private bool companionDeliveryOptionFieldSpecified; + + private CreativeRotationType creativeRotationTypeField; + + private bool creativeRotationTypeFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private long dfpLineItemIdField; + + private bool dfpLineItemIdFieldSpecified; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int lineItemPriorityField; + + private bool lineItemPriorityFieldSpecified; + + private RateType rateTypeField; + + private bool rateTypeFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private Targeting targetingField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private ProposalLineItemPremium[] premiumsField; + + private bool isSoldField; + + private bool isSoldFieldSpecified; + + private Money baseRateField; + + private Money costPerUnitField; + + private Money costField; + + private DeliveryIndicator deliveryIndicatorField; + + private long[] deliveryDataField; + + private ComputedStatus computedStatusField; + + private bool computedStatusFieldSpecified; + + private BillingCap billingCapField; + + private bool billingCapFieldSpecified; + + private BillingSchedule billingScheduleField; + + private bool billingScheduleFieldSpecified; + + private BillingSource billingSourceField; + + private bool billingSourceFieldSpecified; + + private DateTime lastModifiedDateTimeField; + + private bool useThirdPartyAdServerFromProposalField; + + private bool useThirdPartyAdServerFromProposalFieldSpecified; + + private int thirdPartyAdServerIdField; + + private bool thirdPartyAdServerIdFieldSpecified; + + private string customThirdPartyAdServerNameField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long proposalId { + get { return this.proposalIdField; } + set { + this.proposalIdField = value; + this.proposalIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool proposalIdSpecified { + get { return this.proposalIdFieldSpecified; } + set { this.proposalIdFieldSpecified = value; } + } + + public long rateCardId { + get { return this.rateCardIdField; } + set { + this.rateCardIdField = value; + this.rateCardIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardIdSpecified { + get { return this.rateCardIdFieldSpecified; } + set { this.rateCardIdFieldSpecified = value; } + } + + public string productId { + get { return this.productIdField; } + set { this.productIdField = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public CostAdjustment costAdjustment { + get { return this.costAdjustmentField; } + set { + this.costAdjustmentField = value; + this.costAdjustmentSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool costAdjustmentSpecified { + get { return this.costAdjustmentFieldSpecified; } + set { this.costAdjustmentFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public long unitsBought { + get { return this.unitsBoughtField; } + set { + this.unitsBoughtField = value; + this.unitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitsBoughtSpecified { + get { return this.unitsBoughtFieldSpecified; } + set { this.unitsBoughtFieldSpecified = value; } + } + + public int unitsBoughtBuffer { + get { return this.unitsBoughtBufferField; } + set { + this.unitsBoughtBufferField = value; + this.unitsBoughtBufferSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unitsBoughtBufferSpecified { + get { return this.unitsBoughtBufferFieldSpecified; } + set { this.unitsBoughtBufferFieldSpecified = value; } + } + + public DeliveryRateType deliveryRateType { + get { return this.deliveryRateTypeField; } + set { + this.deliveryRateTypeField = value; + this.deliveryRateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryRateTypeSpecified { + get { return this.deliveryRateTypeFieldSpecified; } + set { this.deliveryRateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + public CompanionDeliveryOption companionDeliveryOption { + get { return this.companionDeliveryOptionField; } + set { + this.companionDeliveryOptionField = value; + this.companionDeliveryOptionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companionDeliveryOptionSpecified { + get { return this.companionDeliveryOptionFieldSpecified; } + set { this.companionDeliveryOptionFieldSpecified = value; } + } + + public CreativeRotationType creativeRotationType { + get { return this.creativeRotationTypeField; } + set { + this.creativeRotationTypeField = value; + this.creativeRotationTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeRotationTypeSpecified { + get { return this.creativeRotationTypeFieldSpecified; } + set { this.creativeRotationTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public long dfpLineItemId { + get { return this.dfpLineItemIdField; } + set { + this.dfpLineItemIdField = value; + this.dfpLineItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dfpLineItemIdSpecified { + get { return this.dfpLineItemIdFieldSpecified; } + set { this.dfpLineItemIdFieldSpecified = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int lineItemPriority { + get { return this.lineItemPriorityField; } + set { + this.lineItemPriorityField = value; + this.lineItemPrioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemPrioritySpecified { + get { return this.lineItemPriorityFieldSpecified; } + set { this.lineItemPriorityFieldSpecified = value; } + } + + public RateType rateType { + get { return this.rateTypeField; } + set { + this.rateTypeField = value; + this.rateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateTypeSpecified { + get { return this.rateTypeFieldSpecified; } + set { this.rateTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public Targeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("premiums")] + public ProposalLineItemPremium[] premiums { + get { return this.premiumsField; } + set { this.premiumsField = value; } + } + + public bool isSold { + get { return this.isSoldField; } + set { + this.isSoldField = value; + this.isSoldSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isSoldSpecified { + get { return this.isSoldFieldSpecified; } + set { this.isSoldFieldSpecified = value; } + } + + public Money baseRate { + get { return this.baseRateField; } + set { this.baseRateField = value; } + } + + public Money costPerUnit { + get { return this.costPerUnitField; } + set { this.costPerUnitField = value; } + } + + public Money cost { + get { return this.costField; } + set { this.costField = value; } + } + + public DeliveryIndicator deliveryIndicator { + get { return this.deliveryIndicatorField; } + set { this.deliveryIndicatorField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("units", IsNullable = false)] + public long[] deliveryData { + get { return this.deliveryDataField; } + set { this.deliveryDataField = value; } + } + + public ComputedStatus computedStatus { + get { return this.computedStatusField; } + set { + this.computedStatusField = value; + this.computedStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool computedStatusSpecified { + get { return this.computedStatusFieldSpecified; } + set { this.computedStatusFieldSpecified = value; } + } + + public BillingCap billingCap { + get { return this.billingCapField; } + set { + this.billingCapField = value; + this.billingCapSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingCapSpecified { + get { return this.billingCapFieldSpecified; } + set { this.billingCapFieldSpecified = value; } + } + + public BillingSchedule billingSchedule { + get { return this.billingScheduleField; } + set { + this.billingScheduleField = value; + this.billingScheduleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingScheduleSpecified { + get { return this.billingScheduleFieldSpecified; } + set { this.billingScheduleFieldSpecified = value; } + } + + public BillingSource billingSource { + get { return this.billingSourceField; } + set { + this.billingSourceField = value; + this.billingSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingSourceSpecified { + get { return this.billingSourceFieldSpecified; } + set { this.billingSourceFieldSpecified = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public bool useThirdPartyAdServerFromProposal { + get { return this.useThirdPartyAdServerFromProposalField; } + set { + this.useThirdPartyAdServerFromProposalField = value; + this.useThirdPartyAdServerFromProposalSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool useThirdPartyAdServerFromProposalSpecified { + get { return this.useThirdPartyAdServerFromProposalFieldSpecified; } + set { this.useThirdPartyAdServerFromProposalFieldSpecified = value; } + } + + public int thirdPartyAdServerId { + get { return this.thirdPartyAdServerIdField; } + set { + this.thirdPartyAdServerIdField = value; + this.thirdPartyAdServerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyAdServerIdSpecified { + get { return this.thirdPartyAdServerIdFieldSpecified; } + set { this.thirdPartyAdServerIdFieldSpecified = value; } + } + + public string customThirdPartyAdServerName { + get { return this.customThirdPartyAdServerNameField; } + set { this.customThirdPartyAdServerNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CostAdjustment { + NONE, + MAKE_GOOD, + BARTER, + ADDED_VALUE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProposalLineItemPremium { + private long rateCardCustomizationIdField; + + private bool rateCardCustomizationIdFieldSpecified; + + private ProposalLineItemPremiumStatus statusField; + + private bool statusFieldSpecified; + + public long rateCardCustomizationId { + get { return this.rateCardCustomizationIdField; } + set { + this.rateCardCustomizationIdField = value; + this.rateCardCustomizationIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardCustomizationIdSpecified { + get { return this.rateCardCustomizationIdFieldSpecified; } + set { this.rateCardCustomizationIdFieldSpecified = value; } + } + + public ProposalLineItemPremiumStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ProposalLineItemPremiumStatus { + INCLUDED, + EXCLUDED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum BillingCap { + NO_CAP, + CAPPED_CUMULATIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum BillingSchedule { + PRORATED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum BillingSource { + CONTRACTED, + DFP_VOLUME, + THIRD_PARTY_VOLUME, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProposalLineItemError : ApiError { + private ProposalLineItemErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProposalLineItemErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProposalLineItemError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ProposalLineItemErrorReason { + NOT_SAME_RATE_CARD, + LINE_ITEM_TYPE_NOT_ALLOWED, + END_DATE_TIME_NOT_AFTER_START_TIME, + END_DATE_TIME_TOO_LATE, + START_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_IS_IN_PAST, + FRONTLOADED_NOT_ALLOWED, + ALL_ROADBLOCK_NOT_ALLOWED, + CREATIVE_SET_ROADBLOCK_NOT_ALLOWED, + ALREADY_STARTED, + CONFLICT_WITH_PRODUCT, + MOBILE_TECH_CRITERIA_NOT_SUPPORTED, + UNSUPPORTED_TARGETING_TYPE, + WRONG_COST, + INVALID_PRIORITY_FOR_LINE_ITEM_TYPE, + UPDATE_PROPOSAL_LINE_ITEM_NOT_ALLOWED, + CANNOT_UPDATE_TO_OR_FROM_CREATIVE_SET_ROADBLOCK, + SEQUENTIAL_CREATIVE_ROTATION_NOT_ALLOWED, + UPDATE_RESERVATION_NOT_ALLOWED, + INVALID_COMPANION_DELIVERY_OPTION_FOR_ROADBLOCKING_TYPE, + INCONSISTENT_ROADBLOCK_TYPE, + INVALID_UNITS_BOUGHT_BUFFER, + UPDATE_COST_ADJUSTMENT_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProposalLineItemActionError : ApiError { + private ProposalLineItemActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProposalLineItemActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProposalLineItemActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ProposalLineItemActionErrorReason { + NOT_APPLICABLE, + PROPOSAL_NOT_EDITABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProposalError : ApiError { + private ProposalErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProposalErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProposalError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ProposalErrorReason { + AD_SERVER_UNKNOWN_ERROR, + AD_SERVER_API_ERROR, + UPDATE_ADVERTISER_NOT_ALLOWED, + UPDATE_PROPOSAL_NOT_ALLOWED, + INVALID_CONTACT, + DUPLICATED_CONTACT, + UNACCEPTABLE_COMPANY_CREDIT_STATUS, + PRIMARY_AGENCY_REQUIRED, + PRIMARY_AGENCY_NOT_UNIQUE, + DUPLICATED_COMPANY_ASSOCIATION, + DUPLICATED_SALESPERSON, + DUPLICATED_SALES_PLANNER, + DUPLICATED_TRAFFICKER, + HAS_NO_UNARCHIVED_PROPOSAL_LINEITEMS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class PrecisionError : ApiError { + private PrecisionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PrecisionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PrecisionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum PrecisionErrorReason { + WRONG_PRECISION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class BillingError : ApiError { + private BillingErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BillingErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BillingError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum BillingErrorReason { + UNSUPPORTED_BILLING_SCHEDULE, + UNSUPPORTED_BILLING_CAP, + MISSING_BILLING_SOURCE, + MISSING_BILLING_SCHEDULE, + MISSING_BILLING_CAP, + INVALID_BILLING_SOURCE_FOR_OFFLINE, + UPDATE_BILLING_NOT_ALLOWED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Asset))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeService : DfpSoapClient, ICreativeService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/CreativeService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Creative[] createCreatives([System.Xml.Serialization.XmlElementAttribute("creatives")] +Creative[] creatives) { + object[] results = this.Invoke("createCreatives", new object[] { creatives }); + return ((Creative[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativePage getCreativesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativesByStatement", new object[] { filterStatement }); + return ((CreativePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Creative[] updateCreatives([System.Xml.Serialization.XmlElementAttribute("creatives")] +Creative[] creatives) { + object[] results = this.Invoke("updateCreatives", new object[] { creatives }); + return ((Creative[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CreativePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Creative[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Creative[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VastRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnsupportedCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ThirdPartyCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TemplateCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProgrammaticCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(InternalRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasDestinationUrlCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpMobileCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseVideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AspectRatioImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClickTrackingCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseRichMediaStudioCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasHtmlSnippetDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdMobBackfillCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class Creative { + private long advertiserIdField; + + private bool advertiserIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private Size sizeField; + + private string previewUrlField; + + private AppliedLabel[] appliedLabelsField; + + private DateTime lastModifiedDateTimeField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private string creativeTypeField; + + public long advertiserId { + get { return this.advertiserIdField; } + set { + this.advertiserIdField = value; + this.advertiserIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserIdSpecified { + get { return this.advertiserIdFieldSpecified; } + set { this.advertiserIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + public string previewUrl { + get { return this.previewUrlField; } + set { this.previewUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("Creative.Type")] + public string CreativeType { + get { return this.creativeTypeField; } + set { this.creativeTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class VastRedirectCreative : Creative { + private string vastXmlUrlField; + + private VastRedirectType vastRedirectTypeField; + + private bool vastRedirectTypeFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string vastPreviewUrlField; + + public string vastXmlUrl { + get { return this.vastXmlUrlField; } + set { this.vastXmlUrlField = value; } + } + + public VastRedirectType vastRedirectType { + get { return this.vastRedirectTypeField; } + set { + this.vastRedirectTypeField = value; + this.vastRedirectTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool vastRedirectTypeSpecified { + get { return this.vastRedirectTypeFieldSpecified; } + set { this.vastRedirectTypeFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum VastRedirectType { + LINEAR, + NON_LINEAR, + LINEAR_AND_NON_LINEAR + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ConversionEvent_TrackingUrlsMapEntry { + private ConversionEvent keyField; + + private bool keyFieldSpecified; + + private string[] valueField; + + public ConversionEvent key { + get { return this.keyField; } + set { + this.keyField = value; + this.keySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool keySpecified { + get { return this.keyFieldSpecified; } + set { this.keyFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("urls", IsNullable = false)] + public string[] value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ConversionEvent { + CREATIVE_VIEW, + START, + SKIP_SHOWN, + FIRST_QUARTILE, + MIDPOINT, + THIRD_QUARTILE, + ENGAGED_VIEW, + COMPLETE, + MUTE, + UNMUTE, + PAUSE, + REWIND, + RESUME, + SKIPPED, + FULLSCREEN, + EXPAND, + COLLAPSE, + ACCEPT_INVITATION, + CLOSE, + CLICK_TRACKING, + SURVEY, + CUSTOM_CLICK + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class UnsupportedCreative : Creative { + private string unsupportedCreativeTypeField; + + public string unsupportedCreativeType { + get { return this.unsupportedCreativeTypeField; } + set { this.unsupportedCreativeTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ThirdPartyCreative : Creative { + private string snippetField; + + private string expandedSnippetField; + + private LockedOrientation lockedOrientationField; + + private bool lockedOrientationFieldSpecified; + + public string snippet { + get { return this.snippetField; } + set { this.snippetField = value; } + } + + public string expandedSnippet { + get { return this.expandedSnippetField; } + set { this.expandedSnippetField = value; } + } + + public LockedOrientation lockedOrientation { + get { return this.lockedOrientationField; } + set { + this.lockedOrientationField = value; + this.lockedOrientationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lockedOrientationSpecified { + get { return this.lockedOrientationFieldSpecified; } + set { this.lockedOrientationFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum LockedOrientation { + UNKNOWN, + FREE_ORIENTATION, + PORTRAIT_ONLY, + LANDSCAPE_ONLY + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class TemplateCreative : Creative { + private long creativeTemplateIdField; + + private bool creativeTemplateIdFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + private string destinationUrlField; + + private BaseCreativeTemplateVariableValue[] creativeTemplateVariableValuesField; + + private LockedOrientation lockedOrientationField; + + private bool lockedOrientationFieldSpecified; + + public long creativeTemplateId { + get { return this.creativeTemplateIdField; } + set { + this.creativeTemplateIdField = value; + this.creativeTemplateIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeTemplateIdSpecified { + get { return this.creativeTemplateIdFieldSpecified; } + set { this.creativeTemplateIdFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativeTemplateVariableValues")] + public BaseCreativeTemplateVariableValue[] creativeTemplateVariableValues { + get { return this.creativeTemplateVariableValuesField; } + set { this.creativeTemplateVariableValuesField = value; } + } + + public LockedOrientation lockedOrientation { + get { return this.lockedOrientationField; } + set { + this.lockedOrientationField = value; + this.lockedOrientationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lockedOrientationSpecified { + get { return this.lockedOrientationFieldSpecified; } + set { this.lockedOrientationFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UrlCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(StringCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LongCreativeTemplateVariableValue))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AssetCreativeTemplateVariableValue))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class BaseCreativeTemplateVariableValue { + private string uniqueNameField; + + private string baseCreativeTemplateVariableValueTypeField; + + public string uniqueName { + get { return this.uniqueNameField; } + set { this.uniqueNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseCreativeTemplateVariableValue.Type")] + public string BaseCreativeTemplateVariableValueType { + get { return this.baseCreativeTemplateVariableValueTypeField; } + set { this.baseCreativeTemplateVariableValueTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class UrlCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class StringCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private string valueField; + + public string value { + get { return this.valueField; } + set { this.valueField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LongCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private long valueField; + + private bool valueFieldSpecified; + + public long value { + get { return this.valueField; } + set { + this.valueField = value; + this.valueSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueSpecified { + get { return this.valueFieldSpecified; } + set { this.valueFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AssetCreativeTemplateVariableValue : BaseCreativeTemplateVariableValue { + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProgrammaticCreative : Creative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LegacyDfpCreative : Creative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class InternalRedirectCreative : Creative { + private LockedOrientation lockedOrientationField; + + private bool lockedOrientationFieldSpecified; + + private Size assetSizeField; + + private string internalRedirectUrlField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public LockedOrientation lockedOrientation { + get { return this.lockedOrientationField; } + set { + this.lockedOrientationField = value; + this.lockedOrientationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lockedOrientationSpecified { + get { return this.lockedOrientationFieldSpecified; } + set { this.lockedOrientationFieldSpecified = value; } + } + + public Size assetSize { + get { return this.assetSizeField; } + set { this.assetSizeField = value; } + } + + public string internalRedirectUrl { + get { return this.internalRedirectUrlField; } + set { this.internalRedirectUrlField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VpaidLinearCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(LegacyDfpMobileCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseVideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AspectRatioImageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class HasDestinationUrlCreative : Creative { + private string destinationUrlField; + + public string destinationUrl { + get { return this.destinationUrlField; } + set { this.destinationUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class VpaidLinearRedirectCreative : HasDestinationUrlCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + private string flashUrlField; + + private Size flashAssetSizeField; + + private string vastPreviewUrlField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string flashUrl { + get { return this.flashUrlField; } + set { this.flashUrlField = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class VpaidLinearCreative : HasDestinationUrlCreative { + private string flashNameField; + + private byte[] flashByteArrayField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private Size flashAssetSizeField; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + private string vastPreviewUrlField; + + public string flashName { + get { return this.flashNameField; } + set { this.flashNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] flashByteArray { + get { return this.flashByteArrayField; } + set { this.flashByteArrayField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LegacyDfpMobileCreative : HasDestinationUrlCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CustomCreative : HasDestinationUrlCreative { + private string htmlSnippetField; + + private CustomCreativeAsset[] customCreativeAssetsField; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + private LockedOrientation lockedOrientationField; + + private bool lockedOrientationFieldSpecified; + + public string htmlSnippet { + get { return this.htmlSnippetField; } + set { this.htmlSnippetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customCreativeAssets")] + public CustomCreativeAsset[] customCreativeAssets { + get { return this.customCreativeAssetsField; } + set { this.customCreativeAssetsField = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + + public LockedOrientation lockedOrientation { + get { return this.lockedOrientationField; } + set { + this.lockedOrientationField = value; + this.lockedOrientationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lockedOrientationSpecified { + get { return this.lockedOrientationFieldSpecified; } + set { this.lockedOrientationFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CustomCreativeAsset { + private string macroNameField; + + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + private long fileSizeField; + + private bool fileSizeFieldSpecified; + + public string macroName { + get { return this.macroNameField; } + set { this.macroNameField = value; } + } + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public long fileSize { + get { return this.fileSizeField; } + set { + this.fileSizeField = value; + this.fileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fileSizeSpecified { + get { return this.fileSizeFieldSpecified; } + set { this.fileSizeFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class BaseVideoCreative : HasDestinationUrlCreative { + private int durationField; + + private bool durationFieldSpecified; + + private bool allowDurationOverrideField; + + private bool allowDurationOverrideFieldSpecified; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private long[] companionCreativeIdsField; + + private string customParametersField; + + private string vastPreviewUrlField; + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public bool allowDurationOverride { + get { return this.allowDurationOverrideField; } + set { + this.allowDurationOverrideField = value; + this.allowDurationOverrideSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowDurationOverrideSpecified { + get { return this.allowDurationOverrideFieldSpecified; } + set { this.allowDurationOverrideFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class VideoRedirectCreative : BaseVideoCreative { + private VideoRedirectAsset[] videoAssetsField; + + [System.Xml.Serialization.XmlElementAttribute("videoAssets")] + public VideoRedirectAsset[] videoAssets { + get { return this.videoAssetsField; } + set { this.videoAssetsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class VideoRedirectAsset : RedirectAsset { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class RedirectAsset : Asset { + private string redirectUrlField; + + public string redirectUrl { + get { return this.redirectUrlField; } + set { this.redirectUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RedirectAsset))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(VideoRedirectAsset))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class Asset { + private string assetTypeField; + + [System.Xml.Serialization.XmlElementAttribute("Asset.Type")] + public string AssetType { + get { return this.assetTypeField; } + set { this.assetTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class VideoCreative : BaseVideoCreative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageRedirectCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class BaseImageRedirectCreative : HasDestinationUrlCreative { + private string imageUrlField; + + public string imageUrl { + get { return this.imageUrlField; } + set { this.imageUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ImageRedirectOverlayCreative : BaseImageRedirectCreative { + private Size assetSizeField; + + private int durationField; + + private bool durationFieldSpecified; + + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private string vastPreviewUrlField; + + public Size assetSize { + get { return this.assetSizeField; } + set { this.assetSizeField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ImageRedirectCreative : BaseImageRedirectCreative { + private string altTextField; + + private string thirdPartyImpressionUrlField; + + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + public string thirdPartyImpressionUrl { + get { return this.thirdPartyImpressionUrlField; } + set { this.thirdPartyImpressionUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ImageCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class BaseImageCreative : HasDestinationUrlCreative { + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private CreativeAsset primaryImageAssetField; + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public CreativeAsset primaryImageAsset { + get { return this.primaryImageAssetField; } + set { this.primaryImageAssetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CreativeAsset { + private long assetIdField; + + private bool assetIdFieldSpecified; + + private byte[] assetByteArrayField; + + private string fileNameField; + + private long fileSizeField; + + private bool fileSizeFieldSpecified; + + private string assetUrlField; + + private Size sizeField; + + private ImageDensity imageDensityField; + + private bool imageDensityFieldSpecified; + + public long assetId { + get { return this.assetIdField; } + set { + this.assetIdField = value; + this.assetIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool assetIdSpecified { + get { return this.assetIdFieldSpecified; } + set { this.assetIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] assetByteArray { + get { return this.assetByteArrayField; } + set { this.assetByteArrayField = value; } + } + + public string fileName { + get { return this.fileNameField; } + set { this.fileNameField = value; } + } + + public long fileSize { + get { return this.fileSizeField; } + set { + this.fileSizeField = value; + this.fileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool fileSizeSpecified { + get { return this.fileSizeFieldSpecified; } + set { this.fileSizeFieldSpecified = value; } + } + + public string assetUrl { + get { return this.assetUrlField; } + set { this.assetUrlField = value; } + } + + public Size size { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + public ImageDensity imageDensity { + get { return this.imageDensityField; } + set { + this.imageDensityField = value; + this.imageDensitySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool imageDensitySpecified { + get { return this.imageDensityFieldSpecified; } + set { this.imageDensityFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ImageDensity { + ONE_TO_ONE, + THREE_TO_TWO, + TWO_TO_ONE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ImageOverlayCreative : BaseImageCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private LockedOrientation lockedOrientationField; + + private bool lockedOrientationFieldSpecified; + + private string customParametersField; + + private int durationField; + + private bool durationFieldSpecified; + + private string vastPreviewUrlField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public LockedOrientation lockedOrientation { + get { return this.lockedOrientationField; } + set { + this.lockedOrientationField = value; + this.lockedOrientationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lockedOrientationSpecified { + get { return this.lockedOrientationFieldSpecified; } + set { this.lockedOrientationFieldSpecified = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ImageCreative : BaseImageCreative { + private string altTextField; + + private string thirdPartyImpressionUrlField; + + private CreativeAsset[] secondaryImageAssetsField; + + private LockedOrientation lockedOrientationField; + + private bool lockedOrientationFieldSpecified; + + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + public string thirdPartyImpressionUrl { + get { return this.thirdPartyImpressionUrlField; } + set { this.thirdPartyImpressionUrlField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryImageAssets")] + public CreativeAsset[] secondaryImageAssets { + get { return this.secondaryImageAssetsField; } + set { this.secondaryImageAssetsField = value; } + } + + public LockedOrientation lockedOrientation { + get { return this.lockedOrientationField; } + set { + this.lockedOrientationField = value; + this.lockedOrientationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lockedOrientationSpecified { + get { return this.lockedOrientationFieldSpecified; } + set { this.lockedOrientationFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashRedirectCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class BaseFlashRedirectCreative : HasDestinationUrlCreative { + private string flashUrlField; + + private string fallbackUrlField; + + private string fallbackPreviewUrlField; + + public string flashUrl { + get { return this.flashUrlField; } + set { this.flashUrlField = value; } + } + + public string fallbackUrl { + get { return this.fallbackUrlField; } + set { this.fallbackUrlField = value; } + } + + public string fallbackPreviewUrl { + get { return this.fallbackPreviewUrlField; } + set { this.fallbackPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class FlashRedirectOverlayCreative : BaseFlashRedirectCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private ApiFramework apiFrameworkField; + + private bool apiFrameworkFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + private Size flashAssetSizeField; + + private string vastPreviewUrlField; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public ApiFramework apiFramework { + get { return this.apiFrameworkField; } + set { + this.apiFrameworkField = value; + this.apiFrameworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool apiFrameworkSpecified { + get { return this.apiFrameworkFieldSpecified; } + set { this.apiFrameworkFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ApiFramework { + NONE, + CLICKTAG, + VPAID + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class FlashRedirectCreative : BaseFlashRedirectCreative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashOverlayCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlashCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class BaseFlashCreative : HasDestinationUrlCreative { + private string flashNameField; + + private byte[] flashByteArrayField; + + private string fallbackImageNameField; + + private byte[] fallbackImageByteArrayField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + private bool clickTagRequiredField; + + private bool clickTagRequiredFieldSpecified; + + private string fallbackPreviewUrlField; + + private Size flashAssetSizeField; + + private Size fallbackAssetSizeField; + + public string flashName { + get { return this.flashNameField; } + set { this.flashNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] flashByteArray { + get { return this.flashByteArrayField; } + set { this.flashByteArrayField = value; } + } + + public string fallbackImageName { + get { return this.fallbackImageNameField; } + set { this.fallbackImageNameField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] fallbackImageByteArray { + get { return this.fallbackImageByteArrayField; } + set { this.fallbackImageByteArrayField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + + public bool clickTagRequired { + get { return this.clickTagRequiredField; } + set { + this.clickTagRequiredField = value; + this.clickTagRequiredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clickTagRequiredSpecified { + get { return this.clickTagRequiredFieldSpecified; } + set { this.clickTagRequiredFieldSpecified = value; } + } + + public string fallbackPreviewUrl { + get { return this.fallbackPreviewUrlField; } + set { this.fallbackPreviewUrlField = value; } + } + + public Size flashAssetSize { + get { return this.flashAssetSizeField; } + set { this.flashAssetSizeField = value; } + } + + public Size fallbackAssetSize { + get { return this.fallbackAssetSizeField; } + set { this.fallbackAssetSizeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class FlashOverlayCreative : BaseFlashCreative { + private long[] companionCreativeIdsField; + + private ConversionEvent_TrackingUrlsMapEntry[] trackingUrlsField; + + private string customParametersField; + + private ApiFramework apiFrameworkField; + + private bool apiFrameworkFieldSpecified; + + private int durationField; + + private bool durationFieldSpecified; + + private string vastPreviewUrlField; + + private LockedOrientation lockedOrientationField; + + private bool lockedOrientationFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("trackingUrls")] + public ConversionEvent_TrackingUrlsMapEntry[] trackingUrls { + get { return this.trackingUrlsField; } + set { this.trackingUrlsField = value; } + } + + public string customParameters { + get { return this.customParametersField; } + set { this.customParametersField = value; } + } + + public ApiFramework apiFramework { + get { return this.apiFrameworkField; } + set { + this.apiFrameworkField = value; + this.apiFrameworkSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool apiFrameworkSpecified { + get { return this.apiFrameworkFieldSpecified; } + set { this.apiFrameworkFieldSpecified = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public string vastPreviewUrl { + get { return this.vastPreviewUrlField; } + set { this.vastPreviewUrlField = value; } + } + + public LockedOrientation lockedOrientation { + get { return this.lockedOrientationField; } + set { + this.lockedOrientationField = value; + this.lockedOrientationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lockedOrientationSpecified { + get { return this.lockedOrientationFieldSpecified; } + set { this.lockedOrientationFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class FlashCreative : BaseFlashCreative { + private SwiffyFallbackAsset swiffyAssetField; + + private bool createSwiffyAssetField; + + private bool createSwiffyAssetFieldSpecified; + + private LockedOrientation lockedOrientationField; + + private bool lockedOrientationFieldSpecified; + + private bool clickTagOverlayEnabledField; + + private bool clickTagOverlayEnabledFieldSpecified; + + public SwiffyFallbackAsset swiffyAsset { + get { return this.swiffyAssetField; } + set { this.swiffyAssetField = value; } + } + + public bool createSwiffyAsset { + get { return this.createSwiffyAssetField; } + set { + this.createSwiffyAssetField = value; + this.createSwiffyAssetSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool createSwiffyAssetSpecified { + get { return this.createSwiffyAssetFieldSpecified; } + set { this.createSwiffyAssetFieldSpecified = value; } + } + + public LockedOrientation lockedOrientation { + get { return this.lockedOrientationField; } + set { + this.lockedOrientationField = value; + this.lockedOrientationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lockedOrientationSpecified { + get { return this.lockedOrientationFieldSpecified; } + set { this.lockedOrientationFieldSpecified = value; } + } + + public bool clickTagOverlayEnabled { + get { return this.clickTagOverlayEnabledField; } + set { + this.clickTagOverlayEnabledField = value; + this.clickTagOverlayEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool clickTagOverlayEnabledSpecified { + get { return this.clickTagOverlayEnabledFieldSpecified; } + set { this.clickTagOverlayEnabledFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class SwiffyFallbackAsset { + private CreativeAsset assetField; + + private Html5Feature[] html5FeaturesField; + + private string[] localizedInfoMessagesField; + + public CreativeAsset asset { + get { return this.assetField; } + set { this.assetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("html5Features")] + public Html5Feature[] html5Features { + get { return this.html5FeaturesField; } + set { this.html5FeaturesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("localizedInfoMessages")] + public string[] localizedInfoMessages { + get { return this.localizedInfoMessagesField; } + set { this.localizedInfoMessagesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum Html5Feature { + BASIC_SVG, + SVG_FILTERS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AspectRatioImageCreative : HasDestinationUrlCreative { + private CreativeAsset[] imageAssetsField; + + private string altTextField; + + private string thirdPartyImpressionUrlField; + + private bool overrideSizeField; + + private bool overrideSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("imageAssets")] + public CreativeAsset[] imageAssets { + get { return this.imageAssetsField; } + set { this.imageAssetsField = value; } + } + + public string altText { + get { return this.altTextField; } + set { this.altTextField = value; } + } + + public string thirdPartyImpressionUrl { + get { return this.thirdPartyImpressionUrlField; } + set { this.thirdPartyImpressionUrlField = value; } + } + + public bool overrideSize { + get { return this.overrideSizeField; } + set { + this.overrideSizeField = value; + this.overrideSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overrideSizeSpecified { + get { return this.overrideSizeFieldSpecified; } + set { this.overrideSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ClickTrackingCreative : Creative { + private string clickTrackingUrlField; + + public string clickTrackingUrl { + get { return this.clickTrackingUrlField; } + set { this.clickTrackingUrlField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RichMediaStudioCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class BaseRichMediaStudioCreative : Creative { + private long studioCreativeIdField; + + private bool studioCreativeIdFieldSpecified; + + private RichMediaStudioCreativeFormat creativeFormatField; + + private bool creativeFormatFieldSpecified; + + private RichMediaStudioCreativeArtworkType artworkTypeField; + + private bool artworkTypeFieldSpecified; + + private long totalFileSizeField; + + private bool totalFileSizeFieldSpecified; + + private string[] adTagKeysField; + + private string[] customKeyValuesField; + + private string surveyUrlField; + + private string allImpressionsUrlField; + + private string richMediaImpressionsUrlField; + + private string backupImageImpressionsUrlField; + + private string overrideCssField; + + private string requiredFlashPluginVersionField; + + private int durationField; + + private bool durationFieldSpecified; + + private RichMediaStudioCreativeBillingAttribute billingAttributeField; + + private bool billingAttributeFieldSpecified; + + private RichMediaStudioChildAssetProperty[] richMediaStudioChildAssetPropertiesField; + + public long studioCreativeId { + get { return this.studioCreativeIdField; } + set { + this.studioCreativeIdField = value; + this.studioCreativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool studioCreativeIdSpecified { + get { return this.studioCreativeIdFieldSpecified; } + set { this.studioCreativeIdFieldSpecified = value; } + } + + public RichMediaStudioCreativeFormat creativeFormat { + get { return this.creativeFormatField; } + set { + this.creativeFormatField = value; + this.creativeFormatSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeFormatSpecified { + get { return this.creativeFormatFieldSpecified; } + set { this.creativeFormatFieldSpecified = value; } + } + + public RichMediaStudioCreativeArtworkType artworkType { + get { return this.artworkTypeField; } + set { + this.artworkTypeField = value; + this.artworkTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool artworkTypeSpecified { + get { return this.artworkTypeFieldSpecified; } + set { this.artworkTypeFieldSpecified = value; } + } + + public long totalFileSize { + get { return this.totalFileSizeField; } + set { + this.totalFileSizeField = value; + this.totalFileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalFileSizeSpecified { + get { return this.totalFileSizeFieldSpecified; } + set { this.totalFileSizeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adTagKeys")] + public string[] adTagKeys { + get { return this.adTagKeysField; } + set { this.adTagKeysField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customKeyValues")] + public string[] customKeyValues { + get { return this.customKeyValuesField; } + set { this.customKeyValuesField = value; } + } + + public string surveyUrl { + get { return this.surveyUrlField; } + set { this.surveyUrlField = value; } + } + + public string allImpressionsUrl { + get { return this.allImpressionsUrlField; } + set { this.allImpressionsUrlField = value; } + } + + public string richMediaImpressionsUrl { + get { return this.richMediaImpressionsUrlField; } + set { this.richMediaImpressionsUrlField = value; } + } + + public string backupImageImpressionsUrl { + get { return this.backupImageImpressionsUrlField; } + set { this.backupImageImpressionsUrlField = value; } + } + + public string overrideCss { + get { return this.overrideCssField; } + set { this.overrideCssField = value; } + } + + public string requiredFlashPluginVersion { + get { return this.requiredFlashPluginVersionField; } + set { this.requiredFlashPluginVersionField = value; } + } + + public int duration { + get { return this.durationField; } + set { + this.durationField = value; + this.durationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool durationSpecified { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + public RichMediaStudioCreativeBillingAttribute billingAttribute { + get { return this.billingAttributeField; } + set { + this.billingAttributeField = value; + this.billingAttributeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingAttributeSpecified { + get { return this.billingAttributeFieldSpecified; } + set { this.billingAttributeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("richMediaStudioChildAssetProperties")] + public RichMediaStudioChildAssetProperty[] richMediaStudioChildAssetProperties { + get { return this.richMediaStudioChildAssetPropertiesField; } + set { this.richMediaStudioChildAssetPropertiesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum RichMediaStudioCreativeFormat { + IN_PAGE, + EXPANDING, + IM_EXPANDING, + FLOATING, + PEEL_DOWN, + IN_PAGE_WITH_FLOATING, + FLASH_IN_FLASH, + FLASH_IN_FLASH_EXPANDING, + IN_APP, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum RichMediaStudioCreativeArtworkType { + FLASH, + HTML5, + MIXED + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum RichMediaStudioCreativeBillingAttribute { + IN_PAGE, + FLOATING_EXPANDING, + VIDEO, + FLASH_IN_FLASH + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RichMediaStudioChildAssetProperty { + private string nameField; + + private RichMediaStudioChildAssetPropertyType typeField; + + private bool typeFieldSpecified; + + private long totalFileSizeField; + + private bool totalFileSizeFieldSpecified; + + private int widthField; + + private bool widthFieldSpecified; + + private int heightField; + + private bool heightFieldSpecified; + + private string urlField; + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public RichMediaStudioChildAssetPropertyType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + public long totalFileSize { + get { return this.totalFileSizeField; } + set { + this.totalFileSizeField = value; + this.totalFileSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalFileSizeSpecified { + get { return this.totalFileSizeFieldSpecified; } + set { this.totalFileSizeFieldSpecified = value; } + } + + public int width { + get { return this.widthField; } + set { + this.widthField = value; + this.widthSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool widthSpecified { + get { return this.widthFieldSpecified; } + set { this.widthFieldSpecified = value; } + } + + public int height { + get { return this.heightField; } + set { + this.heightField = value; + this.heightSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool heightSpecified { + get { return this.heightFieldSpecified; } + set { this.heightFieldSpecified = value; } + } + + public string url { + get { return this.urlField; } + set { this.urlField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "RichMediaStudioChildAssetProperty.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum RichMediaStudioChildAssetPropertyType { + FLASH, + VIDEO, + IMAGE, + DATA + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RichMediaStudioCreative : BaseRichMediaStudioCreative { + private LockedOrientation lockedOrientationField; + + private bool lockedOrientationFieldSpecified; + + private bool isInterstitialField; + + private bool isInterstitialFieldSpecified; + + public LockedOrientation lockedOrientation { + get { return this.lockedOrientationField; } + set { + this.lockedOrientationField = value; + this.lockedOrientationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lockedOrientationSpecified { + get { return this.lockedOrientationFieldSpecified; } + set { this.lockedOrientationFieldSpecified = value; } + } + + public bool isInterstitial { + get { return this.isInterstitialField; } + set { + this.isInterstitialField = value; + this.isInterstitialSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isInterstitialSpecified { + get { return this.isInterstitialFieldSpecified; } + set { this.isInterstitialFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(HasHtmlSnippetDynamicAllocationCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdMobBackfillCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class BaseDynamicAllocationCreative : Creative { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdSenseCreative))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AdExchangeCreative))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class HasHtmlSnippetDynamicAllocationCreative : BaseDynamicAllocationCreative { + private string codeSnippetField; + + public string codeSnippet { + get { return this.codeSnippetField; } + set { this.codeSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdSenseCreative : HasHtmlSnippetDynamicAllocationCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdExchangeCreative : HasHtmlSnippetDynamicAllocationCreative { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class AdMobBackfillCreative : BaseDynamicAllocationCreative { + private string additionalParametersField; + + private string publisherIdField; + + private LockedOrientation lockedOrientationField; + + private bool lockedOrientationFieldSpecified; + + public string additionalParameters { + get { return this.additionalParametersField; } + set { this.additionalParametersField = value; } + } + + public string publisherId { + get { return this.publisherIdField; } + set { this.publisherIdField = value; } + } + + public LockedOrientation lockedOrientation { + get { return this.lockedOrientationField; } + set { + this.lockedOrientationField = value; + this.lockedOrientationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lockedOrientationSpecified { + get { return this.lockedOrientationFieldSpecified; } + set { this.lockedOrientationFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "BaseRateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class BaseRateService : DfpSoapClient, IBaseRateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public BaseRateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/BaseRateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRate[] createBaseRates([System.Xml.Serialization.XmlElementAttribute("baseRates")] +BaseRate[] baseRates) { + object[] results = this.Invoke("createBaseRates", new object[] { baseRates }); + return ((BaseRate[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRatePage getBaseRatesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getBaseRatesByStatement", new object[] { filterStatement }); + return ((BaseRatePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performBaseRateAction(BaseRateAction baseRateAction, Statement filterStatement) { + object[] results = this.Invoke("performBaseRateAction", new object[] { baseRateAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual BaseRate[] updateBaseRates([System.Xml.Serialization.XmlElementAttribute("baseRates")] +BaseRate[] baseRates) { + object[] results = this.Invoke("updateBaseRates", new object[] { baseRates }); + return ((BaseRate[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteBaseRates))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class BaseRateAction { + private string baseRateActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("BaseRateAction.Type")] + public string BaseRateActionType { + get { return this.baseRateActionTypeField; } + set { this.baseRateActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeleteBaseRates : BaseRateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class BaseRatePage { + private BaseRate[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public BaseRate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnknownBaseRate))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductTemplateBaseRate))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProductBaseRate))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class BaseRate { + private long rateCardIdField; + + private bool rateCardIdFieldSpecified; + + private long idField; + + private bool idFieldSpecified; + + private string baseRateTypeField; + + public long rateCardId { + get { return this.rateCardIdField; } + set { + this.rateCardIdField = value; + this.rateCardIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateCardIdSpecified { + get { return this.rateCardIdFieldSpecified; } + set { this.rateCardIdFieldSpecified = value; } + } + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("BaseRate.Type")] + public string BaseRateType { + get { return this.baseRateTypeField; } + set { this.baseRateTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class UnknownBaseRate : BaseRate { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProductTemplateBaseRate : BaseRate { + private long productTemplateIdField; + + private bool productTemplateIdFieldSpecified; + + private Money rateField; + + public long productTemplateId { + get { return this.productTemplateIdField; } + set { + this.productTemplateIdField = value; + this.productTemplateIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productTemplateIdSpecified { + get { return this.productTemplateIdFieldSpecified; } + set { this.productTemplateIdFieldSpecified = value; } + } + + public Money rate { + get { return this.rateField; } + set { this.rateField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProductBaseRate : BaseRate { + private string productIdField; + + private Money rateField; + + public string productId { + get { return this.productIdField; } + set { this.productIdField = value; } + } + + public Money rate { + get { return this.rateField; } + set { this.rateField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class BaseRateActionError : ApiError { + private BaseRateActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public BaseRateActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "BaseRateActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum BaseRateActionErrorReason { + DUPLICATED_BASE_RATES, + ACTIVE_BASE_RATE_ALREADY_EXISTS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ExchangeRateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ExchangeRateService : DfpSoapClient, IExchangeRateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ExchangeRateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/ExchangeRateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExchangeRate[] createExchangeRates([System.Xml.Serialization.XmlElementAttribute("exchangeRates")] +ExchangeRate[] exchangeRates) { + object[] results = this.Invoke("createExchangeRates", new object[] { exchangeRates }); + return ((ExchangeRate[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExchangeRatePage getExchangeRatesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getExchangeRatesByStatement", new object[] { filterStatement }); + return ((ExchangeRatePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performExchangeRateAction(ExchangeRateAction exchangeRateAction, Statement filterStatement) { + object[] results = this.Invoke("performExchangeRateAction", new object[] { exchangeRateAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ExchangeRate[] updateExchangeRates([System.Xml.Serialization.XmlElementAttribute("exchangeRates")] +ExchangeRate[] exchangeRates) { + object[] results = this.Invoke("updateExchangeRates", new object[] { exchangeRates }); + return ((ExchangeRate[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteExchangeRates))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class ExchangeRateAction { + private string exchangeRateActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ExchangeRateAction.Type")] + public string ExchangeRateActionType { + get { return this.exchangeRateActionTypeField; } + set { this.exchangeRateActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeleteExchangeRates : ExchangeRateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ExchangeRatePage { + private ExchangeRate[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ExchangeRate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ExchangeRate { + private long idField; + + private bool idFieldSpecified; + + private string currencyCodeField; + + private ExchangeRateRefreshRate refreshRateField; + + private bool refreshRateFieldSpecified; + + private ExchangeRateDirection directionField; + + private bool directionFieldSpecified; + + private long exchangeRateField; + + private bool exchangeRateFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public ExchangeRateRefreshRate refreshRate { + get { return this.refreshRateField; } + set { + this.refreshRateField = value; + this.refreshRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool refreshRateSpecified { + get { return this.refreshRateFieldSpecified; } + set { this.refreshRateFieldSpecified = value; } + } + + public ExchangeRateDirection direction { + get { return this.directionField; } + set { + this.directionField = value; + this.directionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool directionSpecified { + get { return this.directionFieldSpecified; } + set { this.directionFieldSpecified = value; } + } + + public long exchangeRate { + get { return this.exchangeRateField; } + set { + this.exchangeRateField = value; + this.exchangeRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool exchangeRateSpecified { + get { return this.exchangeRateFieldSpecified; } + set { this.exchangeRateFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ExchangeRateRefreshRate { + FIXED, + DAILY, + MONTHLY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ExchangeRateDirection { + TO_NETWORK, + FROM_NETWORK, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "OrderServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class OrderService : DfpSoapClient, IOrderService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public OrderService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/OrderService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Order[] createOrders([System.Xml.Serialization.XmlElementAttribute("orders")] +Order[] orders) { + object[] results = this.Invoke("createOrders", new object[] { orders }); + return ((Order[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual OrderPage getOrdersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getOrdersByStatement", new object[] { filterStatement }); + return ((OrderPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performOrderAction(OrderAction orderAction, Statement filterStatement) { + object[] results = this.Invoke("performOrderAction", new object[] { orderAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Order[] updateOrders([System.Xml.Serialization.XmlElementAttribute("orders")] +Order[] orders) { + object[] results = this.Invoke("updateOrders", new object[] { orders }); + return ((Order[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApproval))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalAndOverbook))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RetractOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RetractOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PauseOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DisapproveOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DisapproveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveOrdersWithoutReservationChanges))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveOrders))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class OrderAction { + private string orderActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("OrderAction.Type")] + public string OrderActionType { + get { return this.orderActionTypeField; } + set { this.orderActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class UnarchiveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class SubmitOrdersForApprovalWithoutReservationChanges : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitOrdersForApprovalAndOverbook))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class SubmitOrdersForApproval : OrderAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class SubmitOrdersForApprovalAndOverbook : SubmitOrdersForApproval { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RetractOrdersWithoutReservationChanges : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RetractOrders : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResumeAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ResumeOrders : OrderAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ResumeAndOverbookOrders : ResumeOrders { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class PauseOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DisapproveOrdersWithoutReservationChanges : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DisapproveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeleteOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ArchiveOrders : OrderAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ApproveOrdersWithoutReservationChanges : OrderAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveAndOverbookOrders))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ApproveOrders : OrderAction { + private bool skipInventoryCheckField; + + private bool skipInventoryCheckFieldSpecified; + + public bool skipInventoryCheck { + get { return this.skipInventoryCheckField; } + set { + this.skipInventoryCheckField = value; + this.skipInventoryCheckSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool skipInventoryCheckSpecified { + get { return this.skipInventoryCheckFieldSpecified; } + set { this.skipInventoryCheckFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ApproveAndOverbookOrders : ApproveOrders { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class OrderPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Order[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Order[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Order { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + private bool unlimitedEndDateTimeField; + + private bool unlimitedEndDateTimeFieldSpecified; + + private OrderStatus statusField; + + private bool statusFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private string notesField; + + private int externalOrderIdField; + + private bool externalOrderIdFieldSpecified; + + private string poNumberField; + + private string currencyCodeField; + + private long advertiserIdField; + + private bool advertiserIdFieldSpecified; + + private long[] advertiserContactIdsField; + + private long agencyIdField; + + private bool agencyIdFieldSpecified; + + private long[] agencyContactIdsField; + + private long creatorIdField; + + private bool creatorIdFieldSpecified; + + private long traffickerIdField; + + private bool traffickerIdFieldSpecified; + + private long[] secondaryTraffickerIdsField; + + private long salespersonIdField; + + private bool salespersonIdFieldSpecified; + + private long[] secondarySalespersonIdsField; + + private long totalImpressionsDeliveredField; + + private bool totalImpressionsDeliveredFieldSpecified; + + private long totalClicksDeliveredField; + + private bool totalClicksDeliveredFieldSpecified; + + private Money totalBudgetField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private string lastModifiedByAppField; + + private bool isProgrammaticField; + + private bool isProgrammaticFieldSpecified; + + private ProgrammaticSettings programmaticSettingsField; + + private long[] appliedTeamIdsField; + + private DateTime lastModifiedDateTimeField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public bool unlimitedEndDateTime { + get { return this.unlimitedEndDateTimeField; } + set { + this.unlimitedEndDateTimeField = value; + this.unlimitedEndDateTimeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool unlimitedEndDateTimeSpecified { + get { return this.unlimitedEndDateTimeFieldSpecified; } + set { this.unlimitedEndDateTimeFieldSpecified = value; } + } + + public OrderStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public int externalOrderId { + get { return this.externalOrderIdField; } + set { + this.externalOrderIdField = value; + this.externalOrderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool externalOrderIdSpecified { + get { return this.externalOrderIdFieldSpecified; } + set { this.externalOrderIdFieldSpecified = value; } + } + + public string poNumber { + get { return this.poNumberField; } + set { this.poNumberField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public long advertiserId { + get { return this.advertiserIdField; } + set { + this.advertiserIdField = value; + this.advertiserIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserIdSpecified { + get { return this.advertiserIdFieldSpecified; } + set { this.advertiserIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("advertiserContactIds")] + public long[] advertiserContactIds { + get { return this.advertiserContactIdsField; } + set { this.advertiserContactIdsField = value; } + } + + public long agencyId { + get { return this.agencyIdField; } + set { + this.agencyIdField = value; + this.agencyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool agencyIdSpecified { + get { return this.agencyIdFieldSpecified; } + set { this.agencyIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("agencyContactIds")] + public long[] agencyContactIds { + get { return this.agencyContactIdsField; } + set { this.agencyContactIdsField = value; } + } + + public long creatorId { + get { return this.creatorIdField; } + set { + this.creatorIdField = value; + this.creatorIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creatorIdSpecified { + get { return this.creatorIdFieldSpecified; } + set { this.creatorIdFieldSpecified = value; } + } + + public long traffickerId { + get { return this.traffickerIdField; } + set { + this.traffickerIdField = value; + this.traffickerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool traffickerIdSpecified { + get { return this.traffickerIdFieldSpecified; } + set { this.traffickerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryTraffickerIds")] + public long[] secondaryTraffickerIds { + get { return this.secondaryTraffickerIdsField; } + set { this.secondaryTraffickerIdsField = value; } + } + + public long salespersonId { + get { return this.salespersonIdField; } + set { + this.salespersonIdField = value; + this.salespersonIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool salespersonIdSpecified { + get { return this.salespersonIdFieldSpecified; } + set { this.salespersonIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondarySalespersonIds")] + public long[] secondarySalespersonIds { + get { return this.secondarySalespersonIdsField; } + set { this.secondarySalespersonIdsField = value; } + } + + public long totalImpressionsDelivered { + get { return this.totalImpressionsDeliveredField; } + set { + this.totalImpressionsDeliveredField = value; + this.totalImpressionsDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalImpressionsDeliveredSpecified { + get { return this.totalImpressionsDeliveredFieldSpecified; } + set { this.totalImpressionsDeliveredFieldSpecified = value; } + } + + public long totalClicksDelivered { + get { return this.totalClicksDeliveredField; } + set { + this.totalClicksDeliveredField = value; + this.totalClicksDeliveredSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalClicksDeliveredSpecified { + get { return this.totalClicksDeliveredFieldSpecified; } + set { this.totalClicksDeliveredFieldSpecified = value; } + } + + public Money totalBudget { + get { return this.totalBudgetField; } + set { this.totalBudgetField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public string lastModifiedByApp { + get { return this.lastModifiedByAppField; } + set { this.lastModifiedByAppField = value; } + } + + public bool isProgrammatic { + get { return this.isProgrammaticField; } + set { + this.isProgrammaticField = value; + this.isProgrammaticSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isProgrammaticSpecified { + get { return this.isProgrammaticFieldSpecified; } + set { this.isProgrammaticFieldSpecified = value; } + } + + public ProgrammaticSettings programmaticSettings { + get { return this.programmaticSettingsField; } + set { this.programmaticSettingsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum OrderStatus { + DRAFT, + PENDING_APPROVAL, + APPROVED, + DISAPPROVED, + PAUSED, + CANCELED, + DELETED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProgrammaticSettings { + private long adxBuyerNetworkIdField; + + private bool adxBuyerNetworkIdFieldSpecified; + + private long buyerIdField; + + private bool buyerIdFieldSpecified; + + private BuyerPlatform buyerPlatformField; + + private bool buyerPlatformFieldSpecified; + + private BillingTermsType billingTermsTypeField; + + private bool billingTermsTypeFieldSpecified; + + private ProgrammaticStatus statusField; + + private bool statusFieldSpecified; + + public long adxBuyerNetworkId { + get { return this.adxBuyerNetworkIdField; } + set { + this.adxBuyerNetworkIdField = value; + this.adxBuyerNetworkIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool adxBuyerNetworkIdSpecified { + get { return this.adxBuyerNetworkIdFieldSpecified; } + set { this.adxBuyerNetworkIdFieldSpecified = value; } + } + + public long buyerId { + get { return this.buyerIdField; } + set { + this.buyerIdField = value; + this.buyerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool buyerIdSpecified { + get { return this.buyerIdFieldSpecified; } + set { this.buyerIdFieldSpecified = value; } + } + + public BuyerPlatform buyerPlatform { + get { return this.buyerPlatformField; } + set { + this.buyerPlatformField = value; + this.buyerPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool buyerPlatformSpecified { + get { return this.buyerPlatformFieldSpecified; } + set { this.buyerPlatformFieldSpecified = value; } + } + + public BillingTermsType billingTermsType { + get { return this.billingTermsTypeField; } + set { + this.billingTermsTypeField = value; + this.billingTermsTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingTermsTypeSpecified { + get { return this.billingTermsTypeFieldSpecified; } + set { this.billingTermsTypeFieldSpecified = value; } + } + + public ProgrammaticStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum BuyerPlatform { + DCM, + DBM, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum BillingTermsType { + CAPPED_ACTUALS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ProgrammaticStatus { + PRE_APPROVAL, + PENDING_BUYER_APPROVAL, + BUYER_APPROVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class OrderActionError : ApiError { + private OrderActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public OrderActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "OrderActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum OrderActionErrorReason { + PERMISSION_DENIED, + NOT_APPLICABLE, + IS_ARCHIVED, + HAS_ENDED, + CANNOT_APPROVE_WITH_UNRESERVED_LINE_ITEMS, + CANNOT_DELETE_ORDER_WITH_DELIVERED_LINEITEMS, + CANNOT_APPROVE_COMPANY_CREDIT_STATUS_NOT_ACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CustomFieldServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CustomFieldService : DfpSoapClient, ICustomFieldService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CustomFieldService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/CustomFieldService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldOption[] createCustomFieldOptions([System.Xml.Serialization.XmlElementAttribute("customFieldOptions")] +CustomFieldOption[] customFieldOptions) { + object[] results = this.Invoke("createCustomFieldOptions", new object[] { customFieldOptions }); + return ((CustomFieldOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomField[] createCustomFields([System.Xml.Serialization.XmlElementAttribute("customFields")] +CustomField[] customFields) { + object[] results = this.Invoke("createCustomFields", new object[] { customFields }); + return ((CustomField[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldOption getCustomFieldOption(long customFieldOptionId) { + object[] results = this.Invoke("getCustomFieldOption", new object[] { customFieldOptionId }); + return ((CustomFieldOption) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldPage getCustomFieldsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCustomFieldsByStatement", new object[] { filterStatement }); + return ((CustomFieldPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performCustomFieldAction(CustomFieldAction customFieldAction, Statement filterStatement) { + object[] results = this.Invoke("performCustomFieldAction", new object[] { customFieldAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomFieldOption[] updateCustomFieldOptions([System.Xml.Serialization.XmlElementAttribute("customFieldOptions")] +CustomFieldOption[] customFieldOptions) { + object[] results = this.Invoke("updateCustomFieldOptions", new object[] { customFieldOptions }); + return ((CustomFieldOption[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CustomField[] updateCustomFields([System.Xml.Serialization.XmlElementAttribute("customFields")] +CustomField[] customFields) { + object[] results = this.Invoke("updateCustomFields", new object[] { customFields }); + return ((CustomField[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateCustomFields))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateCustomFields))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CustomFieldAction { + private string customFieldActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CustomFieldAction.Type")] + public string CustomFieldActionType { + get { return this.customFieldActionTypeField; } + set { this.customFieldActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeactivateCustomFields : CustomFieldAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ActivateCustomFields : CustomFieldAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CustomFieldPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CustomField[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CustomField[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DropDownCustomField))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CustomField { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private CustomFieldEntityType entityTypeField; + + private bool entityTypeFieldSpecified; + + private CustomFieldDataType dataTypeField; + + private bool dataTypeFieldSpecified; + + private CustomFieldVisibility visibilityField; + + private bool visibilityFieldSpecified; + + private string customFieldTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + public CustomFieldEntityType entityType { + get { return this.entityTypeField; } + set { + this.entityTypeField = value; + this.entityTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool entityTypeSpecified { + get { return this.entityTypeFieldSpecified; } + set { this.entityTypeFieldSpecified = value; } + } + + public CustomFieldDataType dataType { + get { return this.dataTypeField; } + set { + this.dataTypeField = value; + this.dataTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dataTypeSpecified { + get { return this.dataTypeFieldSpecified; } + set { this.dataTypeFieldSpecified = value; } + } + + public CustomFieldVisibility visibility { + get { return this.visibilityField; } + set { + this.visibilityField = value; + this.visibilitySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool visibilitySpecified { + get { return this.visibilityFieldSpecified; } + set { this.visibilityFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("CustomField.Type")] + public string CustomFieldType { + get { return this.customFieldTypeField; } + set { this.customFieldTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CustomFieldEntityType { + LINE_ITEM, + ORDER, + CREATIVE, + PRODUCT_TEMPLATE, + PRODUCT, + PROPOSAL, + PROPOSAL_LINE_ITEM, + USER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CustomFieldDataType { + STRING, + NUMBER, + TOGGLE, + DROP_DOWN, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CustomFieldVisibility { + API_ONLY, + READ_ONLY, + FULL + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DropDownCustomField : CustomField { + private CustomFieldOption[] optionsField; + + [System.Xml.Serialization.XmlElementAttribute("options")] + public CustomFieldOption[] options { + get { return this.optionsField; } + set { this.optionsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CustomFieldOption { + private long idField; + + private bool idFieldSpecified; + + private long customFieldIdField; + + private bool customFieldIdFieldSpecified; + + private string displayNameField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long customFieldId { + get { return this.customFieldIdField; } + set { + this.customFieldIdField = value; + this.customFieldIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool customFieldIdSpecified { + get { return this.customFieldIdFieldSpecified; } + set { this.customFieldIdFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CustomFieldError : ApiError { + private CustomFieldErrorReason reasonField; + + private bool reasonFieldSpecified; + + public CustomFieldErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "CustomFieldError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CustomFieldErrorReason { + INVALID_CUSTOM_FIELD_FOR_OPTION, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReconciliationReportRowServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReconciliationReportRowService : DfpSoapClient, IReconciliationReportRowService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReconciliationReportRowService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/ReconciliationReportRowService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReportRowPage getReconciliationReportRowsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getReconciliationReportRowsByStatement", new object[] { filterStatement }); + return ((ReconciliationReportRowPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReportRow[] updateReconciliationReportRows([System.Xml.Serialization.XmlElementAttribute("reconciliationReportRows")] +ReconciliationReportRow[] reconciliationReportRows) { + object[] results = this.Invoke("updateReconciliationReportRows", new object[] { reconciliationReportRows }); + return ((ReconciliationReportRow[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ReconciliationReportRow { + private long reconciliationReportIdField; + + private bool reconciliationReportIdFieldSpecified; + + private long lineItemIdField; + + private bool lineItemIdFieldSpecified; + + private long creativeIdField; + + private bool creativeIdFieldSpecified; + + private long orderIdField; + + private bool orderIdFieldSpecified; + + private long advertiserIdField; + + private bool advertiserIdFieldSpecified; + + private BillFrom billFromField; + + private bool billFromFieldSpecified; + + private RateType rateTypeField; + + private bool rateTypeFieldSpecified; + + private Money lineItemCostPerUnitField; + + private long lineItemContractedUnitsBoughtField; + + private bool lineItemContractedUnitsBoughtFieldSpecified; + + private long dfpVolumeField; + + private bool dfpVolumeFieldSpecified; + + private long thirdPartyVolumeField; + + private bool thirdPartyVolumeFieldSpecified; + + private long manualVolumeField; + + private bool manualVolumeFieldSpecified; + + private long reconciledVolumeField; + + private bool reconciledVolumeFieldSpecified; + + private Money contractedRevenueField; + + private Money dfpRevenueField; + + private Money thirdPartyRevenueField; + + private Money manualRevenueField; + + private Money reconciledRevenueField; + + private string commentsField; + + public long reconciliationReportId { + get { return this.reconciliationReportIdField; } + set { + this.reconciliationReportIdField = value; + this.reconciliationReportIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reconciliationReportIdSpecified { + get { return this.reconciliationReportIdFieldSpecified; } + set { this.reconciliationReportIdFieldSpecified = value; } + } + + public long lineItemId { + get { return this.lineItemIdField; } + set { + this.lineItemIdField = value; + this.lineItemIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemIdSpecified { + get { return this.lineItemIdFieldSpecified; } + set { this.lineItemIdFieldSpecified = value; } + } + + public long creativeId { + get { return this.creativeIdField; } + set { + this.creativeIdField = value; + this.creativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeIdSpecified { + get { return this.creativeIdFieldSpecified; } + set { this.creativeIdFieldSpecified = value; } + } + + public long orderId { + get { return this.orderIdField; } + set { + this.orderIdField = value; + this.orderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderIdSpecified { + get { return this.orderIdFieldSpecified; } + set { this.orderIdFieldSpecified = value; } + } + + public long advertiserId { + get { return this.advertiserIdField; } + set { + this.advertiserIdField = value; + this.advertiserIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserIdSpecified { + get { return this.advertiserIdFieldSpecified; } + set { this.advertiserIdFieldSpecified = value; } + } + + public BillFrom billFrom { + get { return this.billFromField; } + set { + this.billFromField = value; + this.billFromSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billFromSpecified { + get { return this.billFromFieldSpecified; } + set { this.billFromFieldSpecified = value; } + } + + public RateType rateType { + get { return this.rateTypeField; } + set { + this.rateTypeField = value; + this.rateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateTypeSpecified { + get { return this.rateTypeFieldSpecified; } + set { this.rateTypeFieldSpecified = value; } + } + + public Money lineItemCostPerUnit { + get { return this.lineItemCostPerUnitField; } + set { this.lineItemCostPerUnitField = value; } + } + + public long lineItemContractedUnitsBought { + get { return this.lineItemContractedUnitsBoughtField; } + set { + this.lineItemContractedUnitsBoughtField = value; + this.lineItemContractedUnitsBoughtSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemContractedUnitsBoughtSpecified { + get { return this.lineItemContractedUnitsBoughtFieldSpecified; } + set { this.lineItemContractedUnitsBoughtFieldSpecified = value; } + } + + public long dfpVolume { + get { return this.dfpVolumeField; } + set { + this.dfpVolumeField = value; + this.dfpVolumeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dfpVolumeSpecified { + get { return this.dfpVolumeFieldSpecified; } + set { this.dfpVolumeFieldSpecified = value; } + } + + public long thirdPartyVolume { + get { return this.thirdPartyVolumeField; } + set { + this.thirdPartyVolumeField = value; + this.thirdPartyVolumeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyVolumeSpecified { + get { return this.thirdPartyVolumeFieldSpecified; } + set { this.thirdPartyVolumeFieldSpecified = value; } + } + + public long manualVolume { + get { return this.manualVolumeField; } + set { + this.manualVolumeField = value; + this.manualVolumeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool manualVolumeSpecified { + get { return this.manualVolumeFieldSpecified; } + set { this.manualVolumeFieldSpecified = value; } + } + + public long reconciledVolume { + get { return this.reconciledVolumeField; } + set { + this.reconciledVolumeField = value; + this.reconciledVolumeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reconciledVolumeSpecified { + get { return this.reconciledVolumeFieldSpecified; } + set { this.reconciledVolumeFieldSpecified = value; } + } + + public Money contractedRevenue { + get { return this.contractedRevenueField; } + set { this.contractedRevenueField = value; } + } + + public Money dfpRevenue { + get { return this.dfpRevenueField; } + set { this.dfpRevenueField = value; } + } + + public Money thirdPartyRevenue { + get { return this.thirdPartyRevenueField; } + set { this.thirdPartyRevenueField = value; } + } + + public Money manualRevenue { + get { return this.manualRevenueField; } + set { this.manualRevenueField = value; } + } + + public Money reconciledRevenue { + get { return this.reconciledRevenueField; } + set { this.reconciledRevenueField = value; } + } + + public string comments { + get { return this.commentsField; } + set { this.commentsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum BillFrom { + DEFAULT, + DFP, + THIRD_PARTY, + MANUAL, + CONTRACTED_GOAL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ReconciliationReportRowPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ReconciliationReportRow[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ReconciliationReportRow[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ReconciliationImportError : ApiError { + private ReconciliationImportErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ReconciliationImportErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ReconciliationImportError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ReconciliationImportErrorReason { + MISSING_EDITABLE_COLUMN, + INCONSISTENT_IMPORT_COLUMNS, + ILLEGAL_CONVERTION, + INCONSISTENT_COLUMNS_COUNT, + IMPORT_INTERNAL_ERROR, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProductTemplateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProductTemplateService : DfpSoapClient, IProductTemplateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProductTemplateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/ProductTemplateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplate[] createProductTemplates([System.Xml.Serialization.XmlElementAttribute("productTemplates")] +ProductTemplate[] productTemplates) { + object[] results = this.Invoke("createProductTemplates", new object[] { productTemplates }); + return ((ProductTemplate[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplatePage getProductTemplatesByStatement(Statement statement) { + object[] results = this.Invoke("getProductTemplatesByStatement", new object[] { statement }); + return ((ProductTemplatePage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performProductTemplateAction(ProductTemplateAction action, Statement filterStatement) { + object[] results = this.Invoke("performProductTemplateAction", new object[] { action, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProductTemplate[] updateProductTemplates([System.Xml.Serialization.XmlElementAttribute("productTemplates")] +ProductTemplate[] productTemplates) { + object[] results = this.Invoke("updateProductTemplates", new object[] { productTemplates }); + return ((ProductTemplate[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateProductTemplates))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveProducTemplates))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateProductTemplates))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class ProductTemplateAction { + private string productTemplateActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProductTemplateAction.Type")] + public string ProductTemplateActionType { + get { return this.productTemplateActionTypeField; } + set { this.productTemplateActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeactivateProductTemplates : ProductTemplateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ArchiveProducTemplates : ProductTemplateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ActivateProductTemplates : ProductTemplateAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProductTemplatePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ProductTemplate[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ProductTemplate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProductTemplate { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private DateTime creationDateTimeField; + + private DateTime lastModifiedDateTimeField; + + private string descriptionField; + + private string nameMacroField; + + private ProductTemplateStatus statusField; + + private bool statusFieldSpecified; + + private ProductType productTypeField; + + private bool productTypeFieldSpecified; + + private long creatorIdField; + + private bool creatorIdFieldSpecified; + + private RateType rateTypeField; + + private bool rateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private CreativePlaceholder[] creativePlaceholdersField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private int priorityField; + + private bool priorityFieldSpecified; + + private FrequencyCap[] frequencyCapsField; + + private bool allowFrequencyCapsCustomizationField; + + private bool allowFrequencyCapsCustomizationFieldSpecified; + + private ProductSegmentation productSegmentationField; + + private ProductTemplateTargeting targetingField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public DateTime creationDateTime { + get { return this.creationDateTimeField; } + set { this.creationDateTimeField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public string nameMacro { + get { return this.nameMacroField; } + set { this.nameMacroField = value; } + } + + public ProductTemplateStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ProductType productType { + get { return this.productTypeField; } + set { + this.productTypeField = value; + this.productTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool productTypeSpecified { + get { return this.productTypeFieldSpecified; } + set { this.productTypeFieldSpecified = value; } + } + + public long creatorId { + get { return this.creatorIdField; } + set { + this.creatorIdField = value; + this.creatorIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creatorIdSpecified { + get { return this.creatorIdFieldSpecified; } + set { this.creatorIdFieldSpecified = value; } + } + + public RateType rateType { + get { return this.rateTypeField; } + set { + this.rateTypeField = value; + this.rateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool rateTypeSpecified { + get { return this.rateTypeFieldSpecified; } + set { this.rateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("creativePlaceholders")] + public CreativePlaceholder[] creativePlaceholders { + get { return this.creativePlaceholdersField; } + set { this.creativePlaceholdersField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public int priority { + get { return this.priorityField; } + set { + this.priorityField = value; + this.prioritySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool prioritySpecified { + get { return this.priorityFieldSpecified; } + set { this.priorityFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("frequencyCaps")] + public FrequencyCap[] frequencyCaps { + get { return this.frequencyCapsField; } + set { this.frequencyCapsField = value; } + } + + public bool allowFrequencyCapsCustomization { + get { return this.allowFrequencyCapsCustomizationField; } + set { + this.allowFrequencyCapsCustomizationField = value; + this.allowFrequencyCapsCustomizationSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool allowFrequencyCapsCustomizationSpecified { + get { return this.allowFrequencyCapsCustomizationFieldSpecified; } + set { this.allowFrequencyCapsCustomizationFieldSpecified = value; } + } + + public ProductSegmentation productSegmentation { + get { return this.productSegmentationField; } + set { this.productSegmentationField = value; } + } + + public ProductTemplateTargeting targeting { + get { return this.targetingField; } + set { this.targetingField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ProductTemplateStatus { + ACTIVE, + DRAFT, + CANCELED, + ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProductSegmentation { + private GeoTargeting geoSegmentField; + + private AdUnitTargeting[] adUnitSegmentsField; + + private long[] placementSegmentField; + + private CustomCriteria[] customTargetingSegmentField; + + private UserDomainTargeting userDomainSegmentField; + + private BandwidthGroupTargeting bandwidthSegmentField; + + private BrowserTargeting browserSegmentField; + + private BrowserLanguageTargeting browserLanguageSegmentField; + + private OperatingSystemTargeting operatingSystemSegmentField; + + private MobileCarrierTargeting mobileCarrierSegmentField; + + private DeviceCapabilityTargeting deviceCapabilitySegmentField; + + private DeviceCategoryTargeting deviceCategorySegmentField; + + private DeviceManufacturerTargeting deviceManufacturerSegmentField; + + private MobileDeviceTargeting mobileDeviceSegmentField; + + private MobileDeviceSubmodelTargeting mobileDeviceSubmodelSegmentField; + + public GeoTargeting geoSegment { + get { return this.geoSegmentField; } + set { this.geoSegmentField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adUnitSegments")] + public AdUnitTargeting[] adUnitSegments { + get { return this.adUnitSegmentsField; } + set { this.adUnitSegmentsField = value; } + } + + [System.Xml.Serialization.XmlArrayItemAttribute("targetedPlacementIds", IsNullable = false)] + public long[] placementSegment { + get { return this.placementSegmentField; } + set { this.placementSegmentField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customTargetingSegment")] + public CustomCriteria[] customTargetingSegment { + get { return this.customTargetingSegmentField; } + set { this.customTargetingSegmentField = value; } + } + + public UserDomainTargeting userDomainSegment { + get { return this.userDomainSegmentField; } + set { this.userDomainSegmentField = value; } + } + + public BandwidthGroupTargeting bandwidthSegment { + get { return this.bandwidthSegmentField; } + set { this.bandwidthSegmentField = value; } + } + + public BrowserTargeting browserSegment { + get { return this.browserSegmentField; } + set { this.browserSegmentField = value; } + } + + public BrowserLanguageTargeting browserLanguageSegment { + get { return this.browserLanguageSegmentField; } + set { this.browserLanguageSegmentField = value; } + } + + public OperatingSystemTargeting operatingSystemSegment { + get { return this.operatingSystemSegmentField; } + set { this.operatingSystemSegmentField = value; } + } + + public MobileCarrierTargeting mobileCarrierSegment { + get { return this.mobileCarrierSegmentField; } + set { this.mobileCarrierSegmentField = value; } + } + + public DeviceCapabilityTargeting deviceCapabilitySegment { + get { return this.deviceCapabilitySegmentField; } + set { this.deviceCapabilitySegmentField = value; } + } + + public DeviceCategoryTargeting deviceCategorySegment { + get { return this.deviceCategorySegmentField; } + set { this.deviceCategorySegmentField = value; } + } + + public DeviceManufacturerTargeting deviceManufacturerSegment { + get { return this.deviceManufacturerSegmentField; } + set { this.deviceManufacturerSegmentField = value; } + } + + public MobileDeviceTargeting mobileDeviceSegment { + get { return this.mobileDeviceSegmentField; } + set { this.mobileDeviceSegmentField = value; } + } + + public MobileDeviceSubmodelTargeting mobileDeviceSubmodelSegment { + get { return this.mobileDeviceSubmodelSegmentField; } + set { this.mobileDeviceSubmodelSegmentField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProductTemplateError : ApiError { + private ProductTemplateErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProductTemplateErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductTemplateError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ProductTemplateErrorReason { + INVALID_FEATURE_EXPANDED_EXCLUSIVE, + INVALID_EXPANDED_FEATURE_DEFAULT_NOT_TARGETED, + INVALID_EXPANDED_FEATURE_DEFAULT_LOCKED, + INVALID_EXPANDED_FEATURE_VALUE_TARGETED, + INVALID_EXPANDED_FEATURE_VALUE_LOCKED, + INVALID_FEATURE_TYPE, + INVALID_ROADBLOCKING_TYPE, + INVALID_TARGETING, + INVALID_FREQUENCY_CAPS, + INVALID_TECHNOLOGY_INCLUDE_EXCLUDE, + INVALID_EXPANDED_PRODUCT_COUNT, + INVALID_TARGET_PLATFORM, + INVALID_NON_TARGETING_FEATURE, + INVALID_FEATURE_CARDINALITY_AT_LEAST_ONE, + INVALID_FEATURE_CARDINALITY_AT_MOST_ONE, + INVALID_FEATURE_CARDINALITY_EXACTLY_ONE, + INVALID_FEATURE_FOR_OFFLINE, + INVALID_RATE_TYPE_FOR_OFFLINE, + INVALID_RATE_TYPE_FOR_DFP, + INVALID_LINE_ITEM_PRIORITY, + INVALID_LINE_ITEM_TYPE, + DUPLICATED_PLACEHOLDER_IN_NAMEMACRO, + INVALID_EXPANDED_FEATURE_IN_NON_EXPANDABLE_AFFINITY, + INVALID_FEATURE_DEFAULT_TARGET_TYPE, + INVALID_FEATURE_VALUE_TARGET_TYPE, + INVALID_FEATURE_AND_VALUE_LOCK_EXCLUSIVE, + DUPLICATED_FEATURE, + DUPLICATED_CUSTOM_TARGETING_KEY, + DUPLICATED_CUSTOM_TARGETING_VALUE, + INVALID_CUSTOM_TARGETING_KEY_ID, + INVALID_CUSTOM_TARGETING_VALUE_ID, + MISSING_CUSTOM_TARGETING_VALUES, + LOCATION_CANNOT_BE_TARGETED_IF_PARENT_IS_TARGETED, + LOCATION_CANNOT_BE_EXCLUDED_IF_PARENT_IS_EXCLUDED, + LOCATION_CANNOT_BE_EXCLUDED_DIRECTLY_WHEN_HAVE_TARGETED_LOCATION, + CUSTOMIZABLE_CUSTOM_KEY_CANNOT_BE_SEGMENTED, + CUSTOM_KEY_USED_IN_TARGETING_CANNOT_BE_SEGMENTED, + DUPLICATED_FEATURE_VALUE, + MISSING_EXPANDED_FEATURE_PLACEHOLDER_IN_NAMEMACRO, + MISSING_FEATURE_VALUE_OF_NAMEMACRO_PLACEHOLDER, + MISSING_FEATURE_OF_NAMEMACRO_PLACEHOLDER, + MISSING_SUBTYPE_FOR_CUSTOM_TARGETING, + COMPANION_NOT_ALLOWED, + MISSING_COMPANION, + DUPLICATED_MASTER_SIZE, + CANNOT_MODIFY_READONLY_FEATURE, + CANNOT_MODIFY_PRODUCT_TYPE, + CANNOT_ADD_SEGMENTATION, + CANNOT_REMOVE_SEGMENTATION, + CANNOT_REMOVE_VALUE_FROM_SEGMENTATION, + CANNOT_ADD_FEATURE_VALUE_FOR_CUSTOM_TARGETING, + CANNOT_MODIFY_BUILTIN_TARGETING_FEATURE, + CANNOT_UPDATE_ARCHIVED_PRODUCT_TEMPLATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProductTemplateActionError : ApiError { + private ProductTemplateActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProductTemplateActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProductTemplateActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ProductTemplateActionErrorReason { + NOT_APPLICABLE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ReconciliationReportServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ReconciliationReportService : DfpSoapClient, IReconciliationReportService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ReconciliationReportService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/ReconciliationReportService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReportPage getReconciliationReportsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getReconciliationReportsByStatement", new object[] { filterStatement }); + return ((ReconciliationReportPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ReconciliationReport[] updateReconciliationReports([System.Xml.Serialization.XmlElementAttribute("reconciliationReports")] +ReconciliationReport[] reconciliationReports) { + object[] results = this.Invoke("updateReconciliationReports", new object[] { reconciliationReports }); + return ((ReconciliationReport[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ReconciliationReport { + private long idField; + + private bool idFieldSpecified; + + private ReconciliationReportStatus statusField; + + private bool statusFieldSpecified; + + private Date startDateField; + + private string notesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public ReconciliationReportStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public Date startDate { + get { return this.startDateField; } + set { this.startDateField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ReconciliationReportStatus { + DRAFT, + RECONCILED, + REVERTED, + PENDING, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ReconciliationReportPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private ReconciliationReport[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public ReconciliationReport[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ProposalServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ProposalService : DfpSoapClient, IProposalService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ProposalService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/ProposalService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Proposal[] createProposals([System.Xml.Serialization.XmlElementAttribute("proposals")] +Proposal[] proposals) { + object[] results = this.Invoke("createProposals", new object[] { proposals }); + return ((Proposal[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ProposalPage getProposalsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getProposalsByStatement", new object[] { filterStatement }); + return ((ProposalPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performProposalAction(ProposalAction proposalAction, Statement filterStatement) { + object[] results = this.Invoke("performProposalAction", new object[] { proposalAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Proposal[] updateProposals([System.Xml.Serialization.XmlElementAttribute("proposals")] +Proposal[] proposals) { + object[] results = this.Invoke("updateProposals", new object[] { proposals }); + return ((Proposal[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnarchiveProposals))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubmitProposalsForApproval))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RetractProposals))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveProposals))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class ProposalAction { + private string proposalActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("ProposalAction.Type")] + public string ProposalActionType { + get { return this.proposalActionTypeField; } + set { this.proposalActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class UnarchiveProposals : ProposalAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class SubmitProposalsForApproval : ProposalAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RetractProposals : ProposalAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ArchiveProposals : ProposalAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProposalPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Proposal[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Proposal[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Proposal { + private long idField; + + private bool idFieldSpecified; + + private long dfpOrderIdField; + + private bool dfpOrderIdFieldSpecified; + + private string nameField; + + private PricingModel pricingModelField; + + private bool pricingModelFieldSpecified; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + private ProposalStatus statusField; + + private bool statusFieldSpecified; + + private bool isArchivedField; + + private bool isArchivedFieldSpecified; + + private ProposalCompanyAssociation advertiserField; + + private ProposalCompanyAssociation[] agenciesField; + + private int probabilityToCloseField; + + private bool probabilityToCloseFieldSpecified; + + private BillingCap billingCapField; + + private bool billingCapFieldSpecified; + + private BillingSchedule billingScheduleField; + + private bool billingScheduleFieldSpecified; + + private BillingSource billingSourceField; + + private bool billingSourceFieldSpecified; + + private string poNumberField; + + private string notesField; + + private Money budgetField; + + private SalespersonSplit primarySalespersonField; + + private SalespersonSplit[] secondarySalespeopleField; + + private long[] salesPlannerIdsField; + + private long primaryTraffickerIdField; + + private bool primaryTraffickerIdFieldSpecified; + + private long[] secondaryTraffickerIdsField; + + private long[] appliedTeamIdsField; + + private BaseCustomFieldValue[] customFieldValuesField; + + private AppliedLabel[] appliedLabelsField; + + private AppliedLabel[] effectiveAppliedLabelsField; + + private long advertiserDiscountField; + + private bool advertiserDiscountFieldSpecified; + + private long proposalDiscountField; + + private bool proposalDiscountFieldSpecified; + + private Money additionalAdjustmentField; + + private string currencyCodeField; + + private long exchangeRateField; + + private bool exchangeRateFieldSpecified; + + private bool refreshExchangeRateField; + + private bool refreshExchangeRateFieldSpecified; + + private long agencyCommissionField; + + private bool agencyCommissionFieldSpecified; + + private long valueAddedTaxField; + + private bool valueAddedTaxFieldSpecified; + + private bool isSoldField; + + private bool isSoldFieldSpecified; + + private ProposalApprovalStatus approvalStatusField; + + private bool approvalStatusFieldSpecified; + + private DateTime lastModifiedDateTimeField; + + private int thirdPartyAdServerIdField; + + private bool thirdPartyAdServerIdFieldSpecified; + + private string customThirdPartyAdServerNameField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long dfpOrderId { + get { return this.dfpOrderIdField; } + set { + this.dfpOrderIdField = value; + this.dfpOrderIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool dfpOrderIdSpecified { + get { return this.dfpOrderIdFieldSpecified; } + set { this.dfpOrderIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public PricingModel pricingModel { + get { return this.pricingModelField; } + set { + this.pricingModelField = value; + this.pricingModelSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool pricingModelSpecified { + get { return this.pricingModelFieldSpecified; } + set { this.pricingModelFieldSpecified = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public ProposalStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public bool isArchived { + get { return this.isArchivedField; } + set { + this.isArchivedField = value; + this.isArchivedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isArchivedSpecified { + get { return this.isArchivedFieldSpecified; } + set { this.isArchivedFieldSpecified = value; } + } + + public ProposalCompanyAssociation advertiser { + get { return this.advertiserField; } + set { this.advertiserField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("agencies")] + public ProposalCompanyAssociation[] agencies { + get { return this.agenciesField; } + set { this.agenciesField = value; } + } + + public int probabilityToClose { + get { return this.probabilityToCloseField; } + set { + this.probabilityToCloseField = value; + this.probabilityToCloseSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool probabilityToCloseSpecified { + get { return this.probabilityToCloseFieldSpecified; } + set { this.probabilityToCloseFieldSpecified = value; } + } + + public BillingCap billingCap { + get { return this.billingCapField; } + set { + this.billingCapField = value; + this.billingCapSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingCapSpecified { + get { return this.billingCapFieldSpecified; } + set { this.billingCapFieldSpecified = value; } + } + + public BillingSchedule billingSchedule { + get { return this.billingScheduleField; } + set { + this.billingScheduleField = value; + this.billingScheduleSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingScheduleSpecified { + get { return this.billingScheduleFieldSpecified; } + set { this.billingScheduleFieldSpecified = value; } + } + + public BillingSource billingSource { + get { return this.billingSourceField; } + set { + this.billingSourceField = value; + this.billingSourceSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool billingSourceSpecified { + get { return this.billingSourceFieldSpecified; } + set { this.billingSourceFieldSpecified = value; } + } + + public string poNumber { + get { return this.poNumberField; } + set { this.poNumberField = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public Money budget { + get { return this.budgetField; } + set { this.budgetField = value; } + } + + public SalespersonSplit primarySalesperson { + get { return this.primarySalespersonField; } + set { this.primarySalespersonField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondarySalespeople")] + public SalespersonSplit[] secondarySalespeople { + get { return this.secondarySalespeopleField; } + set { this.secondarySalespeopleField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("salesPlannerIds")] + public long[] salesPlannerIds { + get { return this.salesPlannerIdsField; } + set { this.salesPlannerIdsField = value; } + } + + public long primaryTraffickerId { + get { return this.primaryTraffickerIdField; } + set { + this.primaryTraffickerIdField = value; + this.primaryTraffickerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool primaryTraffickerIdSpecified { + get { return this.primaryTraffickerIdFieldSpecified; } + set { this.primaryTraffickerIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("secondaryTraffickerIds")] + public long[] secondaryTraffickerIds { + get { return this.secondaryTraffickerIdsField; } + set { this.secondaryTraffickerIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedTeamIds")] + public long[] appliedTeamIds { + get { return this.appliedTeamIdsField; } + set { this.appliedTeamIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("appliedLabels")] + public AppliedLabel[] appliedLabels { + get { return this.appliedLabelsField; } + set { this.appliedLabelsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("effectiveAppliedLabels")] + public AppliedLabel[] effectiveAppliedLabels { + get { return this.effectiveAppliedLabelsField; } + set { this.effectiveAppliedLabelsField = value; } + } + + public long advertiserDiscount { + get { return this.advertiserDiscountField; } + set { + this.advertiserDiscountField = value; + this.advertiserDiscountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool advertiserDiscountSpecified { + get { return this.advertiserDiscountFieldSpecified; } + set { this.advertiserDiscountFieldSpecified = value; } + } + + public long proposalDiscount { + get { return this.proposalDiscountField; } + set { + this.proposalDiscountField = value; + this.proposalDiscountSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool proposalDiscountSpecified { + get { return this.proposalDiscountFieldSpecified; } + set { this.proposalDiscountFieldSpecified = value; } + } + + public Money additionalAdjustment { + get { return this.additionalAdjustmentField; } + set { this.additionalAdjustmentField = value; } + } + + public string currencyCode { + get { return this.currencyCodeField; } + set { this.currencyCodeField = value; } + } + + public long exchangeRate { + get { return this.exchangeRateField; } + set { + this.exchangeRateField = value; + this.exchangeRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool exchangeRateSpecified { + get { return this.exchangeRateFieldSpecified; } + set { this.exchangeRateFieldSpecified = value; } + } + + public bool refreshExchangeRate { + get { return this.refreshExchangeRateField; } + set { + this.refreshExchangeRateField = value; + this.refreshExchangeRateSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool refreshExchangeRateSpecified { + get { return this.refreshExchangeRateFieldSpecified; } + set { this.refreshExchangeRateFieldSpecified = value; } + } + + public long agencyCommission { + get { return this.agencyCommissionField; } + set { + this.agencyCommissionField = value; + this.agencyCommissionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool agencyCommissionSpecified { + get { return this.agencyCommissionFieldSpecified; } + set { this.agencyCommissionFieldSpecified = value; } + } + + public long valueAddedTax { + get { return this.valueAddedTaxField; } + set { + this.valueAddedTaxField = value; + this.valueAddedTaxSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool valueAddedTaxSpecified { + get { return this.valueAddedTaxFieldSpecified; } + set { this.valueAddedTaxFieldSpecified = value; } + } + + public bool isSold { + get { return this.isSoldField; } + set { + this.isSoldField = value; + this.isSoldSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isSoldSpecified { + get { return this.isSoldFieldSpecified; } + set { this.isSoldFieldSpecified = value; } + } + + public ProposalApprovalStatus approvalStatus { + get { return this.approvalStatusField; } + set { + this.approvalStatusField = value; + this.approvalStatusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool approvalStatusSpecified { + get { return this.approvalStatusFieldSpecified; } + set { this.approvalStatusFieldSpecified = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public int thirdPartyAdServerId { + get { return this.thirdPartyAdServerIdField; } + set { + this.thirdPartyAdServerIdField = value; + this.thirdPartyAdServerIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool thirdPartyAdServerIdSpecified { + get { return this.thirdPartyAdServerIdFieldSpecified; } + set { this.thirdPartyAdServerIdFieldSpecified = value; } + } + + public string customThirdPartyAdServerName { + get { return this.customThirdPartyAdServerNameField; } + set { this.customThirdPartyAdServerNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum PricingModel { + NET, + GROSS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ProposalStatus { + DRAFT, + PENDING_APPROVAL, + APPROVED, + REJECTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProposalCompanyAssociation { + private long companyIdField; + + private bool companyIdFieldSpecified; + + private ProposalCompanyAssociationType typeField; + + private bool typeFieldSpecified; + + private long[] contactIdsField; + + public long companyId { + get { return this.companyIdField; } + set { + this.companyIdField = value; + this.companyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companyIdSpecified { + get { return this.companyIdFieldSpecified; } + set { this.companyIdFieldSpecified = value; } + } + + public ProposalCompanyAssociationType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("contactIds")] + public long[] contactIds { + get { return this.contactIdsField; } + set { this.contactIdsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ProposalCompanyAssociationType { + PRIMARY_AGENCY, + BILLING_AGENCY, + BRANDING_AGENCY, + OTHER_AGENCY, + ADVERTISER, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class SalespersonSplit { + private long userIdField; + + private bool userIdFieldSpecified; + + private int splitField; + + private bool splitFieldSpecified; + + public long userId { + get { return this.userIdField; } + set { + this.userIdField = value; + this.userIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userIdSpecified { + get { return this.userIdFieldSpecified; } + set { this.userIdFieldSpecified = value; } + } + + public int split { + get { return this.splitField; } + set { + this.splitField = value; + this.splitSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool splitSpecified { + get { return this.splitFieldSpecified; } + set { this.splitFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ProposalApprovalStatus { + PENDING, + NON_PENDING, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class WorkflowActionError : ApiError { + private WorkflowActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public WorkflowActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "WorkflowActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum WorkflowActionErrorReason { + NOT_APPLICABLE, + WORKFLOW_DEFINITION_NOT_FOUND, + EMPTY_ACTION_LIST, + NOT_ACTION_APPROVER, + WORKFLOW_ALREADY_COMPLETED, + WORKFLOW_ALREADY_FAILED, + WORKFLOW_ALREADY_CANCELED, + ACTION_COMPLETED, + ACTION_FAILED, + ACTION_CANCELED, + ACTION_NOT_ACTIVE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ProposalActionError : ApiError { + private ProposalActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ProposalActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ProposalActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ProposalActionErrorReason { + NOT_APPLICABLE, + IS_ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LiveStreamEventServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LiveStreamEventService : DfpSoapClient, ILiveStreamEventService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LiveStreamEventService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/LiveStreamEventService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LiveStreamEvent[] createLiveStreamEvents([System.Xml.Serialization.XmlElementAttribute("liveStreamEvents")] +LiveStreamEvent[] liveStreamEvents) { + object[] results = this.Invoke("createLiveStreamEvents", new object[] { liveStreamEvents }); + return ((LiveStreamEvent[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LiveStreamEventPage getLiveStreamEventsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLiveStreamEventsByStatement", new object[] { filterStatement }); + return ((LiveStreamEventPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performLiveStreamEventAction(LiveStreamEventAction liveStreamEventAction, Statement filterStatement) { + object[] results = this.Invoke("performLiveStreamEventAction", new object[] { liveStreamEventAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LiveStreamEvent[] updateLiveStreamEvents([System.Xml.Serialization.XmlElementAttribute("liveStreamEvents")] +LiveStreamEvent[] liveStreamEvents) { + object[] results = this.Invoke("updateLiveStreamEvents", new object[] { liveStreamEvents }); + return ((LiveStreamEvent[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PauseLiveStreamEvents))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchiveLiveStreamEvents))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateLiveStreamEvents))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class LiveStreamEventAction { + private string liveStreamEventActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("LiveStreamEventAction.Type")] + public string LiveStreamEventActionType { + get { return this.liveStreamEventActionTypeField; } + set { this.liveStreamEventActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class PauseLiveStreamEvents : LiveStreamEventAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ArchiveLiveStreamEvents : LiveStreamEventAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ActivateLiveStreamEvents : LiveStreamEventAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LiveStreamEventPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LiveStreamEvent[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LiveStreamEvent[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LiveStreamEvent { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private LiveStreamEventStatus statusField; + + private bool statusFieldSpecified; + + private DateTime creationDateTimeField; + + private DateTime lastModifiedDateTimeField; + + private DateTime startDateTimeField; + + private DateTime endDateTimeField; + + private long totalEstimatedConcurrentUsersField; + + private bool totalEstimatedConcurrentUsersFieldSpecified; + + private string[] contentUrlsField; + + private string[] adTagsField; + + private string liveStreamEventCodeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public LiveStreamEventStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public DateTime creationDateTime { + get { return this.creationDateTimeField; } + set { this.creationDateTimeField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + public DateTime startDateTime { + get { return this.startDateTimeField; } + set { this.startDateTimeField = value; } + } + + public DateTime endDateTime { + get { return this.endDateTimeField; } + set { this.endDateTimeField = value; } + } + + public long totalEstimatedConcurrentUsers { + get { return this.totalEstimatedConcurrentUsersField; } + set { + this.totalEstimatedConcurrentUsersField = value; + this.totalEstimatedConcurrentUsersSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalEstimatedConcurrentUsersSpecified { + get { return this.totalEstimatedConcurrentUsersFieldSpecified; } + set { this.totalEstimatedConcurrentUsersFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("contentUrls")] + public string[] contentUrls { + get { return this.contentUrlsField; } + set { this.contentUrlsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("adTags")] + public string[] adTags { + get { return this.adTagsField; } + set { this.adTagsField = value; } + } + + public string liveStreamEventCode { + get { return this.liveStreamEventCodeField; } + set { this.liveStreamEventCodeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum LiveStreamEventStatus { + ACTIVE, + ARCHIVED, + PAUSED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LiveStreamEventDateTimeError : ApiError { + private LiveStreamEventDateTimeErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LiveStreamEventDateTimeErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LiveStreamEventDateTimeError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum LiveStreamEventDateTimeErrorReason { + START_DATE_TIME_IS_IN_PAST, + END_DATE_TIME_NOT_AFTER_START_DATE_TIME, + END_DATE_TIME_TOO_LATE, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LiveStreamEventActionError : ApiError { + private LiveStreamEventActionErrorReason reasonField; + + private bool reasonFieldSpecified; + + public LiveStreamEventActionErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "LiveStreamEventActionError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum LiveStreamEventActionErrorReason { + INVALID_STATUS_TRANSITION, + IS_ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "PublisherQueryLanguageServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class PublisherQueryLanguageService : DfpSoapClient, IPublisherQueryLanguageService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public PublisherQueryLanguageService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/PublisherQueryLanguageService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ResultSet select(Statement selectStatement) { + object[] results = this.Invoke("select", new object[] { selectStatement }); + return ((ResultSet) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Row { + private Value[] valuesField; + + + [System.Xml.Serialization.XmlElementAttribute("values")] + public Value[] values { + get { return this.valuesField; } + set { this.valuesField = value; } + } + + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ColumnType { + private string labelNameField; + + public string labelName { + get { return this.labelNameField; } + set { this.labelNameField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ResultSet { + private ColumnType[] columnTypesField; + + private Row[] rowsField; + + [System.Xml.Serialization.XmlElementAttribute("columnTypes")] + public ColumnType[] columnTypes { + get { return this.columnTypesField; } + set { this.columnTypesField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("rows")] + public Row[] rows { + get { return this.rowsField; } + set { this.rowsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ActivityServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ActivityService : DfpSoapClient, IActivityService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ActivityService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/ActivityService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Activity[] createActivities([System.Xml.Serialization.XmlElementAttribute("activities")] +Activity[] activities) { + object[] results = this.Invoke("createActivities", new object[] { activities }); + return ((Activity[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ActivityPage getActivitiesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getActivitiesByStatement", new object[] { filterStatement }); + return ((ActivityPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Activity[] updateActivities([System.Xml.Serialization.XmlElementAttribute("activities")] +Activity[] activities) { + object[] results = this.Invoke("updateActivities", new object[] { activities }); + return ((Activity[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ActivityPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Activity[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Activity[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Activity { + private int idField; + + private bool idFieldSpecified; + + private int activityGroupIdField; + + private bool activityGroupIdFieldSpecified; + + private string nameField; + + private string expectedURLField; + + private ActivityStatus statusField; + + private bool statusFieldSpecified; + + private ActivityType typeField; + + private bool typeFieldSpecified; + + public int id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public int activityGroupId { + get { return this.activityGroupIdField; } + set { + this.activityGroupIdField = value; + this.activityGroupIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool activityGroupIdSpecified { + get { return this.activityGroupIdFieldSpecified; } + set { this.activityGroupIdFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string expectedURL { + get { return this.expectedURLField; } + set { this.expectedURLField = value; } + } + + public ActivityStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ActivityType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Activity.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ActivityStatus { + ACTIVE, + INACTIVE + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Activity.Type", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ActivityType { + PAGE_VIEWS, + DAILY_VISITS, + CUSTOM, + ITEMS_PURCHASED, + TRANSACTIONS, + IOS_APPLICATION_DOWNLOADS, + ANDROID_APPLICATION_DOWNLOADS, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LineItemTemplateServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class LineItemTemplateService : DfpSoapClient, ILineItemTemplateService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public LineItemTemplateService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/LineItemTemplateService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual LineItemTemplatePage getLineItemTemplatesByStatement(Statement filterStatement) { + object[] results = this.Invoke("getLineItemTemplatesByStatement", new object[] { filterStatement }); + return ((LineItemTemplatePage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LineItemTemplate { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private bool isDefaultField; + + private bool isDefaultFieldSpecified; + + private string lineItemNameField; + + private TargetPlatform targetPlatformField; + + private bool targetPlatformFieldSpecified; + + private bool enabledForSameAdvertiserExceptionField; + + private bool enabledForSameAdvertiserExceptionFieldSpecified; + + private string notesField; + + private LineItemType lineItemTypeField; + + private bool lineItemTypeFieldSpecified; + + private DateTime startTimeField; + + private DateTime endTimeField; + + private DeliveryRateType deliveryRateTypeField; + + private bool deliveryRateTypeFieldSpecified; + + private RoadblockingType roadblockingTypeField; + + private bool roadblockingTypeFieldSpecified; + + private CreativeRotationType creativeRotationTypeField; + + private bool creativeRotationTypeFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public bool isDefault { + get { return this.isDefaultField; } + set { + this.isDefaultField = value; + this.isDefaultSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isDefaultSpecified { + get { return this.isDefaultFieldSpecified; } + set { this.isDefaultFieldSpecified = value; } + } + + public string lineItemName { + get { return this.lineItemNameField; } + set { this.lineItemNameField = value; } + } + + public TargetPlatform targetPlatform { + get { return this.targetPlatformField; } + set { + this.targetPlatformField = value; + this.targetPlatformSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool targetPlatformSpecified { + get { return this.targetPlatformFieldSpecified; } + set { this.targetPlatformFieldSpecified = value; } + } + + public bool enabledForSameAdvertiserException { + get { return this.enabledForSameAdvertiserExceptionField; } + set { + this.enabledForSameAdvertiserExceptionField = value; + this.enabledForSameAdvertiserExceptionSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool enabledForSameAdvertiserExceptionSpecified { + get { return this.enabledForSameAdvertiserExceptionFieldSpecified; } + set { this.enabledForSameAdvertiserExceptionFieldSpecified = value; } + } + + public string notes { + get { return this.notesField; } + set { this.notesField = value; } + } + + public LineItemType lineItemType { + get { return this.lineItemTypeField; } + set { + this.lineItemTypeField = value; + this.lineItemTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool lineItemTypeSpecified { + get { return this.lineItemTypeFieldSpecified; } + set { this.lineItemTypeFieldSpecified = value; } + } + + public DateTime startTime { + get { return this.startTimeField; } + set { this.startTimeField = value; } + } + + public DateTime endTime { + get { return this.endTimeField; } + set { this.endTimeField = value; } + } + + public DeliveryRateType deliveryRateType { + get { return this.deliveryRateTypeField; } + set { + this.deliveryRateTypeField = value; + this.deliveryRateTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool deliveryRateTypeSpecified { + get { return this.deliveryRateTypeFieldSpecified; } + set { this.deliveryRateTypeFieldSpecified = value; } + } + + public RoadblockingType roadblockingType { + get { return this.roadblockingTypeField; } + set { + this.roadblockingTypeField = value; + this.roadblockingTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roadblockingTypeSpecified { + get { return this.roadblockingTypeFieldSpecified; } + set { this.roadblockingTypeFieldSpecified = value; } + } + + public CreativeRotationType creativeRotationType { + get { return this.creativeRotationTypeField; } + set { + this.creativeRotationTypeField = value; + this.creativeRotationTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool creativeRotationTypeSpecified { + get { return this.creativeRotationTypeFieldSpecified; } + set { this.creativeRotationTypeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class LineItemTemplatePage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private LineItemTemplate[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public LineItemTemplate[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "WorkflowRequestServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class WorkflowRequestService : DfpSoapClient, IWorkflowRequestService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public WorkflowRequestService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/WorkflowRequestService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual WorkflowRequestPage getWorkflowRequestsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getWorkflowRequestsByStatement", new object[] { filterStatement }); + return ((WorkflowRequestPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performWorkflowRequestAction(WorkflowRequestAction action, Statement filterStatement) { + object[] results = this.Invoke("performWorkflowRequestAction", new object[] { action, filterStatement }); + return ((UpdateResult) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RejectWorkflowApprovalRequests))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TriggerWorkflowExternalConditionRequests))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SkipWorkflowExternalConditionRequests))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApproveWorkflowApprovalRequests))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class WorkflowRequestAction { + private string workflowRequestActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("WorkflowRequestAction.Type")] + public string WorkflowRequestActionType { + get { return this.workflowRequestActionTypeField; } + set { this.workflowRequestActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class RejectWorkflowApprovalRequests : WorkflowRequestAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class TriggerWorkflowExternalConditionRequests : WorkflowRequestAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class SkipWorkflowExternalConditionRequests : WorkflowRequestAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ApproveWorkflowApprovalRequests : WorkflowRequestAction { + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WorkflowExternalConditionRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WorkflowApprovalRequest))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class WorkflowRequest { + private long idField; + + private bool idFieldSpecified; + + private string workflowRuleNameField; + + private long entityIdField; + + private bool entityIdFieldSpecified; + + private WorkflowEntityType entityTypeField; + + private bool entityTypeFieldSpecified; + + private WorkflowRequestType typeField; + + private bool typeFieldSpecified; + + private string workflowRequestTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string workflowRuleName { + get { return this.workflowRuleNameField; } + set { this.workflowRuleNameField = value; } + } + + public long entityId { + get { return this.entityIdField; } + set { + this.entityIdField = value; + this.entityIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool entityIdSpecified { + get { return this.entityIdFieldSpecified; } + set { this.entityIdFieldSpecified = value; } + } + + public WorkflowEntityType entityType { + get { return this.entityTypeField; } + set { + this.entityTypeField = value; + this.entityTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool entityTypeSpecified { + get { return this.entityTypeFieldSpecified; } + set { this.entityTypeFieldSpecified = value; } + } + + public WorkflowRequestType type { + get { return this.typeField; } + set { + this.typeField = value; + this.typeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool typeSpecified { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("WorkflowRequest.Type")] + public string WorkflowRequestType { + get { return this.workflowRequestTypeField; } + set { this.workflowRequestTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum WorkflowEntityType { + PROPOSAL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum WorkflowRequestType { + WORKFLOW_APPROVAL_REQUEST, + WORKFLOW_EXTERNAL_CONDITION_REQUEST, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class WorkflowExternalConditionRequest : WorkflowRequest { + private WorkflowExternalConditionStatus statusField; + + private bool statusFieldSpecified; + + public WorkflowExternalConditionStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum WorkflowExternalConditionStatus { + PENDING, + TRIGGERED, + NOT_TRIGGERED, + CANCELLED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class WorkflowApprovalRequest : WorkflowRequest { + private WorkflowApprovalRequestStatus statusField; + + private bool statusFieldSpecified; + + public WorkflowApprovalRequestStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum WorkflowApprovalRequestStatus { + PENDING_APPROVAL, + APPROVED, + REJECTED, + RETRACTED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class WorkflowRequestPage { + private WorkflowRequest[] resultsField; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + [System.Xml.Serialization.XmlElementAttribute("results")] + public WorkflowRequest[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class WorkflowRequestError : ApiError { + private WorkflowRequestErrorReason reasonField; + + private bool reasonFieldSpecified; + + public WorkflowRequestErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "WorkflowRequestError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum WorkflowRequestErrorReason { + REQUEST_ALREADY_PROCESSED, + WORKFLOW_NOT_IN_PROGRESS, + INVALID_REQUEST_ID, + INVALID_ACTION, + TYPE_REQUIRED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "PlacementServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SiteTargetingInfo))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class PlacementService : DfpSoapClient, IPlacementService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public PlacementService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/PlacementService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Placement[] createPlacements([System.Xml.Serialization.XmlElementAttribute("placements")] +Placement[] placements) { + object[] results = this.Invoke("createPlacements", new object[] { placements }); + return ((Placement[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual PlacementPage getPlacementsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getPlacementsByStatement", new object[] { filterStatement }); + return ((PlacementPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performPlacementAction(PlacementAction placementAction, Statement filterStatement) { + object[] results = this.Invoke("performPlacementAction", new object[] { placementAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Placement[] updatePlacements([System.Xml.Serialization.XmlElementAttribute("placements")] +Placement[] placements) { + object[] results = this.Invoke("updatePlacements", new object[] { placements }); + return ((Placement[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivatePlacements))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArchivePlacements))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivatePlacements))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class PlacementAction { + private string placementActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("PlacementAction.Type")] + public string PlacementActionType { + get { return this.placementActionTypeField; } + set { this.placementActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeactivatePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ArchivePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ActivatePlacements : PlacementAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class PlacementPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Placement[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Placement[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Placement : SiteTargetingInfo { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + private string placementCodeField; + + private InventoryStatus statusField; + + private bool statusFieldSpecified; + + private bool isAdSenseTargetingEnabledField; + + private bool isAdSenseTargetingEnabledFieldSpecified; + + private string adSenseTargetingLocaleField; + + private string[] targetedAdUnitIdsField; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + public string placementCode { + get { return this.placementCodeField; } + set { this.placementCodeField = value; } + } + + public InventoryStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public bool isAdSenseTargetingEnabled { + get { return this.isAdSenseTargetingEnabledField; } + set { + this.isAdSenseTargetingEnabledField = value; + this.isAdSenseTargetingEnabledSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isAdSenseTargetingEnabledSpecified { + get { return this.isAdSenseTargetingEnabledFieldSpecified; } + set { this.isAdSenseTargetingEnabledFieldSpecified = value; } + } + + public string adSenseTargetingLocale { + get { return this.adSenseTargetingLocaleField; } + set { this.adSenseTargetingLocaleField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("targetedAdUnitIds")] + public string[] targetedAdUnitIds { + get { return this.targetedAdUnitIdsField; } + set { this.targetedAdUnitIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Placement))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class SiteTargetingInfo { + private string targetingDescriptionField; + + private string targetingSiteNameField; + + private string targetingAdLocationField; + + private string siteTargetingInfoTypeField; + + public string targetingDescription { + get { return this.targetingDescriptionField; } + set { this.targetingDescriptionField = value; } + } + + public string targetingSiteName { + get { return this.targetingSiteNameField; } + set { this.targetingSiteNameField = value; } + } + + public string targetingAdLocation { + get { return this.targetingAdLocationField; } + set { this.targetingAdLocationField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("SiteTargetingInfo.Type")] + public string SiteTargetingInfoType { + get { return this.siteTargetingInfoTypeField; } + set { this.siteTargetingInfoTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class PlacementError : ApiError { + private PlacementErrorReason reasonField; + + private bool reasonFieldSpecified; + + public PlacementErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "PlacementError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum PlacementErrorReason { + INVALID_ENTITY_TYPE, + SHARED_INVENTORY_ASSIGNED, + PLACEMENTS_CANNOT_INCLUDE_INVENTORY_FROM_MULTIPLE_DISTRIBUTOR_NETWORKS, + PLACEMENTS_CANNOT_INCLUDE_BOTH_LOCAL_AND_SHARED_INVENTORY, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "UserTeamAssociationServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserRecordTeamAssociation))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class UserTeamAssociationService : DfpSoapClient, IUserTeamAssociationService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public UserTeamAssociationService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/UserTeamAssociationService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociation[] createUserTeamAssociations([System.Xml.Serialization.XmlElementAttribute("userTeamAssociations")] +UserTeamAssociation[] userTeamAssociations) { + object[] results = this.Invoke("createUserTeamAssociations", new object[] { userTeamAssociations }); + return ((UserTeamAssociation[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociationPage getUserTeamAssociationsByStatement(Statement filterStatement) { + object[] results = this.Invoke("getUserTeamAssociationsByStatement", new object[] { filterStatement }); + return ((UserTeamAssociationPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performUserTeamAssociationAction(UserTeamAssociationAction userTeamAssociationAction, Statement statement) { + object[] results = this.Invoke("performUserTeamAssociationAction", new object[] { userTeamAssociationAction, statement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserTeamAssociation[] updateUserTeamAssociations([System.Xml.Serialization.XmlElementAttribute("userTeamAssociations")] +UserTeamAssociation[] userTeamAssociations) { + object[] results = this.Invoke("updateUserTeamAssociations", new object[] { userTeamAssociations }); + return ((UserTeamAssociation[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteUserTeamAssociations))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class UserTeamAssociationAction { + private string userTeamAssociationActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("UserTeamAssociationAction.Type")] + public string UserTeamAssociationActionType { + get { return this.userTeamAssociationActionTypeField; } + set { this.userTeamAssociationActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeleteUserTeamAssociations : UserTeamAssociationAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class UserTeamAssociationPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private UserTeamAssociation[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public UserTeamAssociation[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class UserTeamAssociation : UserRecordTeamAssociation { + private long userIdField; + + private bool userIdFieldSpecified; + + public long userId { + get { return this.userIdField; } + set { + this.userIdField = value; + this.userIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool userIdSpecified { + get { return this.userIdFieldSpecified; } + set { this.userIdFieldSpecified = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserTeamAssociation))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class UserRecordTeamAssociation { + private long teamIdField; + + private bool teamIdFieldSpecified; + + private TeamAccessType overriddenTeamAccessTypeField; + + private bool overriddenTeamAccessTypeFieldSpecified; + + private TeamAccessType defaultTeamAccessTypeField; + + private bool defaultTeamAccessTypeFieldSpecified; + + private string userRecordTeamAssociationTypeField; + + public long teamId { + get { return this.teamIdField; } + set { + this.teamIdField = value; + this.teamIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool teamIdSpecified { + get { return this.teamIdFieldSpecified; } + set { this.teamIdFieldSpecified = value; } + } + + public TeamAccessType overriddenTeamAccessType { + get { return this.overriddenTeamAccessTypeField; } + set { + this.overriddenTeamAccessTypeField = value; + this.overriddenTeamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool overriddenTeamAccessTypeSpecified { + get { return this.overriddenTeamAccessTypeFieldSpecified; } + set { this.overriddenTeamAccessTypeFieldSpecified = value; } + } + + public TeamAccessType defaultTeamAccessType { + get { return this.defaultTeamAccessTypeField; } + set { + this.defaultTeamAccessTypeField = value; + this.defaultTeamAccessTypeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool defaultTeamAccessTypeSpecified { + get { return this.defaultTeamAccessTypeFieldSpecified; } + set { this.defaultTeamAccessTypeFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("UserRecordTeamAssociation.Type")] + public string UserRecordTeamAssociationType { + get { return this.userRecordTeamAssociationTypeField; } + set { this.userRecordTeamAssociationTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeSetServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeSetService : DfpSoapClient, ICreativeSetService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeSetService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/CreativeSetService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeSet createCreativeSet(CreativeSet creativeSet) { + object[] results = this.Invoke("createCreativeSet", new object[] { creativeSet }); + return ((CreativeSet) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeSetPage getCreativeSetsByStatement(Statement statement) { + object[] results = this.Invoke("getCreativeSetsByStatement", new object[] { statement }); + return ((CreativeSetPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeSet updateCreativeSet(CreativeSet creativeSet) { + object[] results = this.Invoke("updateCreativeSet", new object[] { creativeSet }); + return ((CreativeSet) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CreativeSetPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeSet[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeSet[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CreativeSet { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private long masterCreativeIdField; + + private bool masterCreativeIdFieldSpecified; + + private long[] companionCreativeIdsField; + + private DateTime lastModifiedDateTimeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public long masterCreativeId { + get { return this.masterCreativeIdField; } + set { + this.masterCreativeIdField = value; + this.masterCreativeIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool masterCreativeIdSpecified { + get { return this.masterCreativeIdFieldSpecified; } + set { this.masterCreativeIdFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("companionCreativeIds")] + public long[] companionCreativeIds { + get { return this.companionCreativeIdsField; } + set { this.companionCreativeIdsField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ContentServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ContentService : DfpSoapClient, IContentService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ContentService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/ContentService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContentPage getContentByStatement(Statement statement) { + object[] results = this.Invoke("getContentByStatement", new object[] { statement }); + return ((ContentPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContentPage getContentByStatementAndCustomTargetingValue(Statement filterStatement, long customTargetingValueId) { + object[] results = this.Invoke("getContentByStatementAndCustomTargetingValue", new object[] { filterStatement, customTargetingValueId }); + return ((ContentPage) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CmsContent { + private long idField; + + private bool idFieldSpecified; + + private string displayNameField; + + private string cmsContentIdField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string displayName { + get { return this.displayNameField; } + set { this.displayNameField = value; } + } + + public string cmsContentId { + get { return this.cmsContentIdField; } + set { this.cmsContentIdField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Content { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private ContentStatus statusField; + + private bool statusFieldSpecified; + + private ContentStatusDefinedBy statusDefinedByField; + + private bool statusDefinedByFieldSpecified; + + private DateTime publishDateTimeField; + + private DateTime lastModifiedDateTimeField; + + private long[] userDefinedCustomTargetingValueIdsField; + + private long[] mappingRuleDefinedCustomTargetingValueIdsField; + + private CmsContent[] cmsSourcesField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public ContentStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public ContentStatusDefinedBy statusDefinedBy { + get { return this.statusDefinedByField; } + set { + this.statusDefinedByField = value; + this.statusDefinedBySpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusDefinedBySpecified { + get { return this.statusDefinedByFieldSpecified; } + set { this.statusDefinedByFieldSpecified = value; } + } + + public DateTime publishDateTime { + get { return this.publishDateTimeField; } + set { this.publishDateTimeField = value; } + } + + public DateTime lastModifiedDateTime { + get { return this.lastModifiedDateTimeField; } + set { this.lastModifiedDateTimeField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("userDefinedCustomTargetingValueIds")] + public long[] userDefinedCustomTargetingValueIds { + get { return this.userDefinedCustomTargetingValueIdsField; } + set { this.userDefinedCustomTargetingValueIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("mappingRuleDefinedCustomTargetingValueIds")] + public long[] mappingRuleDefinedCustomTargetingValueIds { + get { return this.mappingRuleDefinedCustomTargetingValueIdsField; } + set { this.mappingRuleDefinedCustomTargetingValueIdsField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("cmsSources")] + public CmsContent[] cmsSources { + get { return this.cmsSourcesField; } + set { this.cmsSourcesField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ContentStatus { + ACTIVE, + INACTIVE, + ARCHIVED, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ContentStatusDefinedBy { + CMS, + USER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ContentPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Content[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Content[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ContentPartnerError : ApiError { + private ContentPartnerErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ContentPartnerErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ContentPartnerError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ContentPartnerErrorReason { + FEATURE_NOT_ENABLED, + INVALID_PARTNER_TYPE, + NO_PARTNER_CATCH_ALL, + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "UserServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UserRecord))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class UserService : DfpSoapClient, IUserService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public UserService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/UserService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User[] createUsers([System.Xml.Serialization.XmlElementAttribute("users")] +User[] users) { + object[] results = this.Invoke("createUsers", new object[] { users }); + return ((User[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Role[] getAllRoles() { + object[] results = this.Invoke("getAllRoles", new object[0]); + return ((Role[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User getCurrentUser() { + object[] results = this.Invoke("getCurrentUser", new object[0]); + return ((User) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UserPage getUsersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getUsersByStatement", new object[] { filterStatement }); + return ((UserPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performUserAction(UserAction userAction, Statement filterStatement) { + object[] results = this.Invoke("performUserAction", new object[] { userAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual User[] updateUsers([System.Xml.Serialization.XmlElementAttribute("users")] +User[] users) { + object[] results = this.Invoke("updateUsers", new object[] { users }); + return ((User[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateUsers))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateUsers))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class UserAction { + private string userActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("UserAction.Type")] + public string UserActionType { + get { return this.userActionTypeField; } + set { this.userActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeactivateUsers : UserAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ActivateUsers : UserAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class UserPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private User[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public User[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class User : UserRecord { + private bool isActiveField; + + private bool isActiveFieldSpecified; + + private bool isEmailNotificationAllowedField; + + private bool isEmailNotificationAllowedFieldSpecified; + + private string externalIdField; + + private string ordersUiLocalTimeZoneIdField; + + private BaseCustomFieldValue[] customFieldValuesField; + + public bool isActive { + get { return this.isActiveField; } + set { + this.isActiveField = value; + this.isActiveSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isActiveSpecified { + get { return this.isActiveFieldSpecified; } + set { this.isActiveFieldSpecified = value; } + } + + public bool isEmailNotificationAllowed { + get { return this.isEmailNotificationAllowedField; } + set { + this.isEmailNotificationAllowedField = value; + this.isEmailNotificationAllowedSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool isEmailNotificationAllowedSpecified { + get { return this.isEmailNotificationAllowedFieldSpecified; } + set { this.isEmailNotificationAllowedFieldSpecified = value; } + } + + public string externalId { + get { return this.externalIdField; } + set { this.externalIdField = value; } + } + + public string ordersUiLocalTimeZoneId { + get { return this.ordersUiLocalTimeZoneIdField; } + set { this.ordersUiLocalTimeZoneIdField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("customFieldValues")] + public BaseCustomFieldValue[] customFieldValues { + get { return this.customFieldValuesField; } + set { this.customFieldValuesField = value; } + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(User))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class UserRecord { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string emailField; + + private long roleIdField; + + private bool roleIdFieldSpecified; + + private string roleNameField; + + private string preferredLocaleField; + + private string userRecordTypeField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public long roleId { + get { return this.roleIdField; } + set { + this.roleIdField = value; + this.roleIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool roleIdSpecified { + get { return this.roleIdFieldSpecified; } + set { this.roleIdFieldSpecified = value; } + } + + public string roleName { + get { return this.roleNameField; } + set { this.roleNameField = value; } + } + + public string preferredLocale { + get { return this.preferredLocaleField; } + set { this.preferredLocaleField = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("UserRecord.Type")] + public string UserRecordType { + get { return this.userRecordTypeField; } + set { this.userRecordTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Role { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private string descriptionField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public string description { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ContactServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseContact))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class ContactService : DfpSoapClient, IContactService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public ContactService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/ContactService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Contact[] createContacts([System.Xml.Serialization.XmlElementAttribute("contacts")] +Contact[] contacts) { + object[] results = this.Invoke("createContacts", new object[] { contacts }); + return ((Contact[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual ContactPage getContactsByStatement(Statement statement) { + object[] results = this.Invoke("getContactsByStatement", new object[] { statement }); + return ((ContactPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual Contact[] updateContacts([System.Xml.Serialization.XmlElementAttribute("contacts")] +Contact[] contacts) { + object[] results = this.Invoke("updateContacts", new object[] { contacts }); + return ((Contact[]) (results[0])); + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ContactPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private Contact[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public Contact[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class Contact : BaseContact { + private long idField; + + private bool idFieldSpecified; + + private string nameField; + + private long companyIdField; + + private bool companyIdFieldSpecified; + + private ContactStatus statusField; + + private bool statusFieldSpecified; + + private string addressField; + + private string cellPhoneField; + + private string commentField; + + private string emailField; + + private string faxPhoneField; + + private string titleField; + + private string workPhoneField; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public string name { + get { return this.nameField; } + set { this.nameField = value; } + } + + public long companyId { + get { return this.companyIdField; } + set { + this.companyIdField = value; + this.companyIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool companyIdSpecified { + get { return this.companyIdFieldSpecified; } + set { this.companyIdFieldSpecified = value; } + } + + public ContactStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + + public string address { + get { return this.addressField; } + set { this.addressField = value; } + } + + public string cellPhone { + get { return this.cellPhoneField; } + set { this.cellPhoneField = value; } + } + + public string comment { + get { return this.commentField; } + set { this.commentField = value; } + } + + public string email { + get { return this.emailField; } + set { this.emailField = value; } + } + + public string faxPhone { + get { return this.faxPhoneField; } + set { this.faxPhoneField = value; } + } + + public string title { + get { return this.titleField; } + set { this.titleField = value; } + } + + public string workPhone { + get { return this.workPhoneField; } + set { this.workPhoneField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "Contact.Status", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ContactStatus { + UNINVITED, + INVITE_PENDNG, + INVITE_EXPIRED, + INVITE_CANCELED, + USER_ACTIVE, + USER_DISABLED, + UNKNOWN + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(Contact))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class BaseContact { + private string baseContactTypeField; + + [System.Xml.Serialization.XmlElementAttribute("BaseContact.Type")] + public string BaseContactType { + get { return this.baseContactTypeField; } + set { this.baseContactTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ContactError : ApiError { + private ContactErrorReason reasonField; + + private bool reasonFieldSpecified; + + public ContactErrorReason reason { + get { return this.reasonField; } + set { + this.reasonField = value; + this.reasonSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool reasonSpecified { + get { return this.reasonFieldSpecified; } + set { this.reasonFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "ContactError.Reason", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum ContactErrorReason { + UNKNOWN + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "CreativeWrapperServiceSoapBinding", Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ApplicationException))] + public partial class CreativeWrapperService : DfpSoapClient, ICreativeWrapperService { + private RequestHeader requestHeaderField; + + private ResponseHeader responseHeaderField; + + public CreativeWrapperService() { + this.Url = "https://www.google.com/apis/ads/publisher/v201405/CreativeWrapperService"; + } + + public virtual RequestHeader RequestHeader { + get { return this.requestHeaderField; } + set { this.requestHeaderField = value; } + } + + public virtual ResponseHeader ResponseHeader { + get { return this.responseHeaderField; } + set { this.responseHeaderField = value; } + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapper[] createCreativeWrappers([System.Xml.Serialization.XmlElementAttribute("creativeWrappers")] +CreativeWrapper[] creativeWrappers) { + object[] results = this.Invoke("createCreativeWrappers", new object[] { creativeWrappers }); + return ((CreativeWrapper[]) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapperPage getCreativeWrappersByStatement(Statement filterStatement) { + object[] results = this.Invoke("getCreativeWrappersByStatement", new object[] { filterStatement }); + return ((CreativeWrapperPage) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual UpdateResult performCreativeWrapperAction(CreativeWrapperAction creativeWrapperAction, Statement filterStatement) { + object[] results = this.Invoke("performCreativeWrapperAction", new object[] { creativeWrapperAction, filterStatement }); + return ((UpdateResult) (results[0])); + } + + [System.Web.Services.Protocols.SoapHeaderAttribute("ResponseHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "https://www.google.com/apis/ads/publisher/v201405", ResponseNamespace = "https://www.google.com/apis/ads/publisher/v201405", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("rval")] + public virtual CreativeWrapper[] updateCreativeWrappers([System.Xml.Serialization.XmlElementAttribute("creativeWrappers")] +CreativeWrapper[] creativeWrappers) { + object[] results = this.Invoke("updateCreativeWrappers", new object[] { creativeWrappers }); + return ((CreativeWrapper[]) (results[0])); + } + } + + + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeactivateCreativeWrappers))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActivateCreativeWrappers))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public abstract partial class CreativeWrapperAction { + private string creativeWrapperActionTypeField; + + [System.Xml.Serialization.XmlElementAttribute("CreativeWrapperAction.Type")] + public string CreativeWrapperActionType { + get { return this.creativeWrapperActionTypeField; } + set { this.creativeWrapperActionTypeField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class DeactivateCreativeWrappers : CreativeWrapperAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class ActivateCreativeWrappers : CreativeWrapperAction { + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CreativeWrapperPage { + private int totalResultSetSizeField; + + private bool totalResultSetSizeFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private CreativeWrapper[] resultsField; + + public int totalResultSetSize { + get { return this.totalResultSetSizeField; } + set { + this.totalResultSetSizeField = value; + this.totalResultSetSizeSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool totalResultSetSizeSpecified { + get { return this.totalResultSetSizeFieldSpecified; } + set { this.totalResultSetSizeFieldSpecified = value; } + } + + public int startIndex { + get { return this.startIndexField; } + set { + this.startIndexField = value; + this.startIndexSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool startIndexSpecified { + get { return this.startIndexFieldSpecified; } + set { this.startIndexFieldSpecified = value; } + } + + [System.Xml.Serialization.XmlElementAttribute("results")] + public CreativeWrapper[] results { + get { return this.resultsField; } + set { this.resultsField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CreativeWrapper { + private long idField; + + private bool idFieldSpecified; + + private long labelIdField; + + private bool labelIdFieldSpecified; + + private CreativeWrapperHtmlSnippet headerField; + + private CreativeWrapperHtmlSnippet footerField; + + private CreativeWrapperOrdering orderingField; + + private bool orderingFieldSpecified; + + private CreativeWrapperStatus statusField; + + private bool statusFieldSpecified; + + public long id { + get { return this.idField; } + set { + this.idField = value; + this.idSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool idSpecified { + get { return this.idFieldSpecified; } + set { this.idFieldSpecified = value; } + } + + public long labelId { + get { return this.labelIdField; } + set { + this.labelIdField = value; + this.labelIdSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool labelIdSpecified { + get { return this.labelIdFieldSpecified; } + set { this.labelIdFieldSpecified = value; } + } + + public CreativeWrapperHtmlSnippet header { + get { return this.headerField; } + set { this.headerField = value; } + } + + public CreativeWrapperHtmlSnippet footer { + get { return this.footerField; } + set { this.footerField = value; } + } + + public CreativeWrapperOrdering ordering { + get { return this.orderingField; } + set { + this.orderingField = value; + this.orderingSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool orderingSpecified { + get { return this.orderingFieldSpecified; } + set { this.orderingFieldSpecified = value; } + } + + public CreativeWrapperStatus status { + get { return this.statusField; } + set { + this.statusField = value; + this.statusSpecified = true; + } + } + + [System.Xml.Serialization.XmlIgnoreAttribute()] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool statusSpecified { + get { return this.statusFieldSpecified; } + set { this.statusFieldSpecified = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public partial class CreativeWrapperHtmlSnippet { + private string htmlSnippetField; + + public string htmlSnippet { + get { return this.htmlSnippetField; } + set { this.htmlSnippetField = value; } + } + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CreativeWrapperOrdering { + NO_PREFERENCE, + INNER, + OUTER + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "https://www.google.com/apis/ads/publisher/v201405")] + public enum CreativeWrapperStatus { + ACTIVE, + INACTIVE + } + public interface IAudienceSegmentService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + FirstPartyAudienceSegment[] createAudienceSegments(FirstPartyAudienceSegment[] segments); + AudienceSegmentPage getAudienceSegmentsByStatement(Statement filterStatement); + UpdateResult performAudienceSegmentAction(AudienceSegmentAction action, Statement filterStatement); + FirstPartyAudienceSegment[] updateAudienceSegments(FirstPartyAudienceSegment[] segments); + } + public interface IReconciliationOrderReportService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ReconciliationOrderReportPage getReconciliationOrderReportsByStatement(Statement filterStatement); + UpdateResult performReconciliationOrderReportAction(ReconciliationOrderReportAction reconciliationOrderReportAction, Statement filterStatement); + } + public interface IForecastService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Forecast getForecast(LineItem lineItem); + Forecast getForecastById(long lineItemId); + } + public interface ICompanyService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Company[] createCompanies(Company[] companies); + CompanyPage getCompaniesByStatement(Statement filterStatement); + Company[] updateCompanies(Company[] companies); + } + public interface IAdRuleService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdRule[] createAdRules(AdRule[] adRules); + AdRulePage getAdRulesByStatement(Statement statement); + UpdateResult performAdRuleAction(AdRuleAction adRuleAction, Statement filterStatement); + AdRule[] updateAdRules(AdRule[] adRules); + } + public interface ISuggestedAdUnitService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + SuggestedAdUnitPage getSuggestedAdUnitsByStatement(Statement filterStatement); + SuggestedAdUnitUpdateResult performSuggestedAdUnitAction(SuggestedAdUnitAction suggestedAdUnitAction, Statement filterStatement); + } + public interface ILineItemService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + LineItem[] createLineItems(LineItem[] lineItems); + LineItemPage getLineItemsByStatement(Statement filterStatement); + UpdateResult performLineItemAction(LineItemAction lineItemAction, Statement filterStatement); + LineItem[] updateLineItems(LineItem[] lineItems); + } + public interface IRateCardService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + RateCard[] createRateCards(RateCard[] rateCards); + RateCardPage getRateCardsByStatement(Statement filterStatement); + UpdateResult performRateCardAction(RateCardAction rateCardAction, Statement filterStatement); + RateCard[] updateRateCards(RateCard[] rateCards); + } + public interface ICreativeTemplateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CreativeTemplatePage getCreativeTemplatesByStatement(Statement filterStatement); + } + public interface IContentMetadataKeyHierarchyService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ContentMetadataKeyHierarchy[] createContentMetadataKeyHierarchies(ContentMetadataKeyHierarchy[] contentMetadataKeyHierarchies); + ContentMetadataKeyHierarchyPage getContentMetadataKeyHierarchiesByStatement(Statement filterStatement); + UpdateResult performContentMetadataKeyHierarchyAction(ContentMetadataKeyHierarchyAction contentMetadataKeyHierarchyAction, Statement filterStatement); + ContentMetadataKeyHierarchy[] updateContentMetadataKeyHierarchies(ContentMetadataKeyHierarchy[] contentMetadataKeyHierarchies); + } + public interface ICustomTargetingService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CustomTargetingKey[] createCustomTargetingKeys(CustomTargetingKey[] keys); + CustomTargetingValue[] createCustomTargetingValues(CustomTargetingValue[] values); + CustomTargetingKeyPage getCustomTargetingKeysByStatement(Statement filterStatement); + CustomTargetingValuePage getCustomTargetingValuesByStatement(Statement filterStatement); + UpdateResult performCustomTargetingKeyAction(CustomTargetingKeyAction customTargetingKeyAction, Statement filterStatement); + UpdateResult performCustomTargetingValueAction(CustomTargetingValueAction customTargetingValueAction, Statement filterStatement); + CustomTargetingKey[] updateCustomTargetingKeys(CustomTargetingKey[] keys); + CustomTargetingValue[] updateCustomTargetingValues(CustomTargetingValue[] values); + } + public interface IProductService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ProductPage getProductsByStatement(Statement statement); + UpdateResult performProductAction(ProductAction productAction, Statement filterStatement); + Product[] updateProducts(Product[] products); + } + public interface IRateCardCustomizationGroupService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + RateCardCustomizationGroup[] createRateCardCustomizationGroups(RateCardCustomizationGroup[] rateCardCustomizationGroups); + RateCardCustomizationGroupPage getRateCardCustomizationGroupsByStatement(Statement filterStatement); + RateCardCustomizationGroup[] updateRateCardCustomizationGroups(RateCardCustomizationGroup[] rateCardCustomizationGroups); + } + public interface IActivityGroupService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ActivityGroup[] createActivityGroups(ActivityGroup[] activityGroups); + ActivityGroupPage getActivityGroupsByStatement(Statement filterStatement); + ActivityGroup[] updateActivityGroups(ActivityGroup[] activityGroups); + } + public interface ILabelService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Label[] createLabels(Label[] labels); + LabelPage getLabelsByStatement(Statement filterStatement); + UpdateResult performLabelAction(LabelAction labelAction, Statement filterStatement); + Label[] updateLabels(Label[] labels); + } + public interface ILineItemCreativeAssociationService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + LineItemCreativeAssociation[] createLineItemCreativeAssociations(LineItemCreativeAssociation[] lineItemCreativeAssociations); + LineItemCreativeAssociationPage getLineItemCreativeAssociationsByStatement(Statement filterStatement); + string getPreviewUrl(long lineItemId, long creativeId, string siteUrl); + UpdateResult performLineItemCreativeAssociationAction(LineItemCreativeAssociationAction lineItemCreativeAssociationAction, Statement filterStatement); + LineItemCreativeAssociation[] updateLineItemCreativeAssociations(LineItemCreativeAssociation[] lineItemCreativeAssociations); + } + public interface IReportService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + string getReportDownloadURL(long reportJobId, ExportFormat exportFormat); + string getReportDownloadUrlWithOptions(long reportJobId, ReportDownloadOptions reportDownloadOptions); + ReportJob getReportJob(long reportJobId); + ReportJob runReportJob(ReportJob reportJob); + } + public interface IInventoryService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + AdUnit[] createAdUnits(AdUnit[] adUnits); + AdUnitSize[] getAdUnitSizesByStatement(Statement filterStatement); + AdUnitPage getAdUnitsByStatement(Statement filterStatement); + UpdateResult performAdUnitAction(AdUnitAction adUnitAction, Statement filterStatement); + AdUnit[] updateAdUnits(AdUnit[] adUnits); + } + public interface ITeamService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Team[] createTeams(Team[] teams); + TeamPage getTeamsByStatement(Statement filterStatement); + Team[] updateTeams(Team[] teams); + } + public interface INetworkService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Network[] getAllNetworks(); + Network getCurrentNetwork(); + Network makeTestNetwork(); + Network updateNetwork(Network network); + } + public interface IRateCardCustomizationService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + RateCardCustomization[] createRateCardCustomizations(RateCardCustomization[] rateCardCustomizations); + RateCardCustomizationPage getRateCardCustomizationsByStatement(Statement filterStatement); + UpdateResult performRateCardCustomizationAction(RateCardCustomizationAction rateCardCustomizationAction, Statement filterStatement); + RateCardCustomization[] updateRateCardCustomizations(RateCardCustomization[] rateCardCustomizations); + } + public interface IProposalLineItemService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ProposalLineItem[] createProposalLineItems(ProposalLineItem[] proposalLineItems); + ProposalLineItemPage getProposalLineItemsByStatement(Statement filterStatement); + UpdateResult performProposalLineItemAction(ProposalLineItemAction proposalLineItemAction, Statement filterStatement); + ProposalLineItem[] updateProposalLineItems(ProposalLineItem[] proposalLineItems); + } + public interface ICreativeService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Creative[] createCreatives(Creative[] creatives); + CreativePage getCreativesByStatement(Statement filterStatement); + Creative[] updateCreatives(Creative[] creatives); + } + public interface IBaseRateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + BaseRate[] createBaseRates(BaseRate[] baseRates); + BaseRatePage getBaseRatesByStatement(Statement filterStatement); + UpdateResult performBaseRateAction(BaseRateAction baseRateAction, Statement filterStatement); + BaseRate[] updateBaseRates(BaseRate[] baseRates); + } + public interface IExchangeRateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ExchangeRate[] createExchangeRates(ExchangeRate[] exchangeRates); + ExchangeRatePage getExchangeRatesByStatement(Statement filterStatement); + UpdateResult performExchangeRateAction(ExchangeRateAction exchangeRateAction, Statement filterStatement); + ExchangeRate[] updateExchangeRates(ExchangeRate[] exchangeRates); + } + public interface IOrderService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Order[] createOrders(Order[] orders); + OrderPage getOrdersByStatement(Statement filterStatement); + UpdateResult performOrderAction(OrderAction orderAction, Statement filterStatement); + Order[] updateOrders(Order[] orders); + } + public interface ICustomFieldService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CustomFieldOption[] createCustomFieldOptions(CustomFieldOption[] customFieldOptions); + CustomField[] createCustomFields(CustomField[] customFields); + CustomFieldOption getCustomFieldOption(long customFieldOptionId); + CustomFieldPage getCustomFieldsByStatement(Statement filterStatement); + UpdateResult performCustomFieldAction(CustomFieldAction customFieldAction, Statement filterStatement); + CustomFieldOption[] updateCustomFieldOptions(CustomFieldOption[] customFieldOptions); + CustomField[] updateCustomFields(CustomField[] customFields); + } + public interface IReconciliationReportRowService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ReconciliationReportRowPage getReconciliationReportRowsByStatement(Statement filterStatement); + ReconciliationReportRow[] updateReconciliationReportRows(ReconciliationReportRow[] reconciliationReportRows); + } + public interface IProductTemplateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ProductTemplate[] createProductTemplates(ProductTemplate[] productTemplates); + ProductTemplatePage getProductTemplatesByStatement(Statement statement); + UpdateResult performProductTemplateAction(ProductTemplateAction action, Statement filterStatement); + ProductTemplate[] updateProductTemplates(ProductTemplate[] productTemplates); + } + public interface IReconciliationReportService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ReconciliationReportPage getReconciliationReportsByStatement(Statement filterStatement); + ReconciliationReport[] updateReconciliationReports(ReconciliationReport[] reconciliationReports); + } + public interface IProposalService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Proposal[] createProposals(Proposal[] proposals); + ProposalPage getProposalsByStatement(Statement filterStatement); + UpdateResult performProposalAction(ProposalAction proposalAction, Statement filterStatement); + Proposal[] updateProposals(Proposal[] proposals); + } + public interface ILiveStreamEventService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + LiveStreamEvent[] createLiveStreamEvents(LiveStreamEvent[] liveStreamEvents); + LiveStreamEventPage getLiveStreamEventsByStatement(Statement filterStatement); + UpdateResult performLiveStreamEventAction(LiveStreamEventAction liveStreamEventAction, Statement filterStatement); + LiveStreamEvent[] updateLiveStreamEvents(LiveStreamEvent[] liveStreamEvents); + } + public interface IPublisherQueryLanguageService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ResultSet select(Statement selectStatement); + } + public interface IActivityService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Activity[] createActivities(Activity[] activities); + ActivityPage getActivitiesByStatement(Statement filterStatement); + Activity[] updateActivities(Activity[] activities); + } + public interface ILineItemTemplateService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + LineItemTemplatePage getLineItemTemplatesByStatement(Statement filterStatement); + } + public interface IWorkflowRequestService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + WorkflowRequestPage getWorkflowRequestsByStatement(Statement filterStatement); + UpdateResult performWorkflowRequestAction(WorkflowRequestAction action, Statement filterStatement); + } + public interface IPlacementService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Placement[] createPlacements(Placement[] placements); + PlacementPage getPlacementsByStatement(Statement filterStatement); + UpdateResult performPlacementAction(PlacementAction placementAction, Statement filterStatement); + Placement[] updatePlacements(Placement[] placements); + } + public interface IUserTeamAssociationService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + UserTeamAssociation[] createUserTeamAssociations(UserTeamAssociation[] userTeamAssociations); + UserTeamAssociationPage getUserTeamAssociationsByStatement(Statement filterStatement); + UpdateResult performUserTeamAssociationAction(UserTeamAssociationAction userTeamAssociationAction, Statement statement); + UserTeamAssociation[] updateUserTeamAssociations(UserTeamAssociation[] userTeamAssociations); + } + public interface ICreativeSetService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CreativeSet createCreativeSet(CreativeSet creativeSet); + CreativeSetPage getCreativeSetsByStatement(Statement statement); + CreativeSet updateCreativeSet(CreativeSet creativeSet); + } + public interface IContentService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + ContentPage getContentByStatement(Statement statement); + ContentPage getContentByStatementAndCustomTargetingValue(Statement filterStatement, long customTargetingValueId); + } + public interface IUserService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + User[] createUsers(User[] users); + Role[] getAllRoles(); + User getCurrentUser(); + UserPage getUsersByStatement(Statement filterStatement); + UpdateResult performUserAction(UserAction userAction, Statement filterStatement); + User[] updateUsers(User[] users); + } + public interface IContactService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + Contact[] createContacts(Contact[] contacts); + ContactPage getContactsByStatement(Statement statement); + Contact[] updateContacts(Contact[] contacts); + } + public interface ICreativeWrapperService { + RequestHeader RequestHeader { + get; + set; + } + ResponseHeader ResponseHeader { + get; + set; + } + CreativeWrapper[] createCreativeWrappers(CreativeWrapper[] creativeWrappers); + CreativeWrapperPage getCreativeWrappersByStatement(Statement filterStatement); + UpdateResult performCreativeWrapperAction(CreativeWrapperAction creativeWrapperAction, Statement filterStatement); + CreativeWrapper[] updateCreativeWrappers(CreativeWrapper[] creativeWrappers); + } +} diff --git a/src/Dfp/v201405/DfpServiceV201405.cs b/src/Dfp/v201405/DfpServiceV201405.cs new file mode 100644 index 00000000000..664059f1c3f --- /dev/null +++ b/src/Dfp/v201405/DfpServiceV201405.cs @@ -0,0 +1,360 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Reflection; + +namespace Google.Api.Ads.Dfp.Lib { + /// + /// Lists all the services available through this library. + /// + public partial class DfpService : AdsService { + /// + /// All the services available in v201405. + /// + public class v201405 { + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ActivityGroupService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ActivityService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AdRuleService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature BaseRateService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ContactService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature AudienceSegmentService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CompanyService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ContentService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ContentMetadataKeyHierarchyService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeSetService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeTemplateService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CreativeWrapperService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomFieldService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature CustomTargetingService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ExchangeRateService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ForecastService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature InventoryService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LabelService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LineItemTemplateService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LineItemService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LineItemCreativeAssociationService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature LiveStreamEventService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature NetworkService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature OrderService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature PlacementService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProductService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProductTemplateService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProposalService; + + /// See + /// this page for details. + /// + public static readonly ServiceSignature ProposalLineItemService; + + + /// See + /// this page for details. + /// + public static readonly ServiceSignature PublisherQueryLanguageService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature RateCardService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature RateCardCustomizationService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature RateCardCustomizationGroupService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReconciliationOrderReportService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReconciliationReportService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReconciliationReportRowService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature ReportService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature SuggestedAdUnitService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature TeamService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature UserService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature UserTeamAssociationService; + + /// + /// See + /// this page for details. + /// + public static readonly ServiceSignature WorkflowRequestService; + + /// + /// Factory type for v201405 services. + /// + public static readonly Type factoryType = typeof(DfpServiceFactory); + + /// + /// Static constructor to initialize the service constants. + /// + static v201405() { + ActivityGroupService = DfpService.MakeServiceSignature("v201405", "ActivityGroupService"); + ActivityService = DfpService.MakeServiceSignature("v201405", "ActivityService"); + AdRuleService = DfpService.MakeServiceSignature("v201405", "AdRuleService"); + BaseRateService = DfpService.MakeServiceSignature("v201405", "BaseRateService"); + ContactService = DfpService.MakeServiceSignature("v201405", "ContactService"); + AudienceSegmentService = DfpService.MakeServiceSignature("v201405", + "AudienceSegmentService"); + CompanyService = DfpService.MakeServiceSignature("v201405", "CompanyService"); + ContentService = DfpService.MakeServiceSignature("v201405", "ContentService"); + ContentMetadataKeyHierarchyService = DfpService.MakeServiceSignature("v201405", + "ContentMetadataKeyHierarchyService"); + CreativeService = DfpService.MakeServiceSignature("v201405", "CreativeService"); + CreativeSetService = DfpService.MakeServiceSignature("v201405", "CreativeSetService"); + CreativeTemplateService = DfpService.MakeServiceSignature("v201405", + "CreativeTemplateService"); + CreativeWrapperService = DfpService.MakeServiceSignature("v201405", + "CreativeWrapperService"); + CustomTargetingService = DfpService.MakeServiceSignature("v201405", + "CustomTargetingService"); + CustomFieldService = DfpService.MakeServiceSignature("v201405", + "CustomFieldService"); + ExchangeRateService = DfpService.MakeServiceSignature("v201405", "ExchangeRateService"); + ForecastService = DfpService.MakeServiceSignature("v201405", "ForecastService"); + InventoryService = DfpService.MakeServiceSignature("v201405", "InventoryService"); + LabelService = DfpService.MakeServiceSignature("v201405", "LabelService"); + LineItemTemplateService = DfpService.MakeServiceSignature("v201405", + "LineItemTemplateService"); + LineItemService = DfpService.MakeServiceSignature("v201405", "LineItemService"); + LineItemCreativeAssociationService = + DfpService.MakeServiceSignature("v201405", "LineItemCreativeAssociationService"); + LiveStreamEventService = DfpService.MakeServiceSignature("v201405", + "LiveStreamEventService"); + NetworkService = DfpService.MakeServiceSignature("v201405", "NetworkService"); + OrderService = DfpService.MakeServiceSignature("v201405", "OrderService"); + PlacementService = DfpService.MakeServiceSignature("v201405", "PlacementService"); + ProductService = DfpService.MakeServiceSignature("v201405", "ProductService"); + ProductTemplateService = DfpService.MakeServiceSignature("v201405", + "ProductTemplateService"); + ProposalService = DfpService.MakeServiceSignature("v201405", "ProposalService"); + ProposalLineItemService = DfpService.MakeServiceSignature("v201405", + "ProposalLineItemService"); + PublisherQueryLanguageService = DfpService.MakeServiceSignature("v201405", + "PublisherQueryLanguageService"); + RateCardService = DfpService.MakeServiceSignature("v201405", "RateCardService"); + RateCardCustomizationService = DfpService.MakeServiceSignature("v201405", + "RateCardCustomizationService"); + RateCardCustomizationGroupService = DfpService.MakeServiceSignature("v201405", + "RateCardCustomizationGroupService"); + ReconciliationOrderReportService = DfpService.MakeServiceSignature("v201405", + "ReconciliationOrderReportService"); + ReconciliationReportService = DfpService.MakeServiceSignature("v201405", + "ReconciliationReportService"); + ReconciliationReportRowService = DfpService.MakeServiceSignature("v201405", + "ReconciliationReportRowService"); + ReportService = DfpService.MakeServiceSignature("v201405", "ReportService"); + SuggestedAdUnitService = DfpService.MakeServiceSignature("v201405", + "SuggestedAdUnitService"); + TeamService = DfpService.MakeServiceSignature("v201405", "TeamService"); + UserService = DfpService.MakeServiceSignature("v201405", "UserService"); + UserTeamAssociationService = DfpService.MakeServiceSignature("v201405", + "UserTeamAssociationService"); + WorkflowRequestService = DfpService.MakeServiceSignature("v201405", + "WorkflowRequestService"); + } + } + } +} diff --git a/tests/AdWords/AdWords.Tests.csproj b/tests/AdWords/AdWords.Tests.csproj new file mode 100644 index 00000000000..c0bcc5c721c --- /dev/null +++ b/tests/AdWords/AdWords.Tests.csproj @@ -0,0 +1,153 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F} + Library + Properties + Google.Api.Ads.AdWords.Tests + Google.AdWords.Tests + v4.0 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AnyCPU + 0618 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\lib\NUnit\nunit.framework.dll + + + + + + + + + + {277404DB-A439-4450-B3A5-186294CDF245} + Common + + + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6} + Common.Tests + + + {5C1DE791-767A-4599-A0B9-51D6D2DFCC81} + AdWords.Examples.CSharp + + + {A4AE3724-C225-4F03-AC77-A71C1330D8DD} + AdWords.Examples.VB + + + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745} + AdWords + + + + + + + ResXFileCodeGenerator + SoapMessages.v201406.Designer.cs + Designer + + + ResXFileCodeGenerator + SoapMessages.v201402.Designer.cs + Designer + + + ResXFileCodeGenerator + SoapMessages.v201309.Designer.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/AdWords/AdWordsRequestInterceptor.cs b/tests/AdWords/AdWordsRequestInterceptor.cs new file mode 100644 index 00000000000..a1f8c6c06e4 --- /dev/null +++ b/tests/AdWords/AdWordsRequestInterceptor.cs @@ -0,0 +1,90 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.Common.Tests; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.Net; +using System.Reflection; +using System.Text; + +namespace Google.Api.Ads.AdWords.Tests { + /// + /// Intercepts SOAP messages from AdWords API client library for testing + /// purposes. + /// + public class AdWordsRequestInterceptor : WebRequestInterceptor { + /// + /// The queue that holds the messages being mocked. + /// + static Queue messageQueue = new Queue(); + + /// + /// Content type for SOAP messages. + /// + public const string SOAP_RESPONSE_TYPE = "text/xml; charset=UTF-8"; + + /// + /// Singleton instance. + /// + private static WebRequestInterceptor instance; + + + /// + /// Gets the only instance. + /// + public static WebRequestInterceptor Instance { + get { + return instance; + } + } + + /// + /// Initializes the class. + /// + static AdWordsRequestInterceptor() { + AdWordsAppConfig config = new AdWordsAppConfig(); + instance = new AdWordsRequestInterceptor(); + WebRequest.RegisterPrefix(config.AdWordsApiServer, instance); + } + + /// + /// Loads the messages for mock sequence. + /// + /// The messages for mock purposes. + /// The callbac to be called before sending response. + /// + public void LoadMessages(HttpMessage[] messages, OnBeforeSendResponse callback) { + messageQueue.Clear(); + foreach (HttpMessage message in messages) { + messageQueue.Enqueue(message); + } + BeforeSendResponse += callback; + } + + public override HttpMessage GetNextMessage() { + if (messageQueue.Count != 0) { + return messageQueue.Dequeue(); + } else { + throw new WebException("Mock queue is empty.", WebExceptionStatus.SendFailure); + } + } + } +} diff --git a/tests/AdWords/App.config b/tests/AdWords/App.config new file mode 100644 index 00000000000..1ee298baf62 --- /dev/null +++ b/tests/AdWords/App.config @@ -0,0 +1,192 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/AdWords/ExampleTestsBase.cs b/tests/AdWords/ExampleTestsBase.cs new file mode 100644 index 00000000000..9978cbba6f8 --- /dev/null +++ b/tests/AdWords/ExampleTestsBase.cs @@ -0,0 +1,178 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.Common.Tests; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Threading; +using System.Xml; +using Google.Api.Ads.Common.Lib; + +namespace Google.Api.Ads.AdWords.Tests { + /// + /// UnitTests for code examples. + /// + public class ExampleTestsBase { + /// + /// The AdWordsUser instance for running code examples. + /// + protected AdWordsUser user = new AdWordsUser(); + + /// + /// The interceptor for ClientLogin requests when running mocked code + /// examples. + /// + protected ClientLoginRequestInterceptor clientLoginInterceptor = + ClientLoginRequestInterceptor.Instance as ClientLoginRequestInterceptor; + + /// + /// The interceptor for AdWords API requests when running mocked code + /// examples. + /// + protected AdWordsRequestInterceptor awapiInterceptor = + AdWordsRequestInterceptor.Instance as AdWordsRequestInterceptor; + + /// + /// Default public constructor. + /// + public ExampleTestsBase() : base() { + } + + /// + /// Runs a code example in mocked mode. + /// + /// The mock data for mocking SOAP request and + /// responses for API calls. + /// The delegate that initializes and runs the + /// code example. + /// The callback to be called before mocked responses + /// are sent. You could use this callback to verify if the request was + /// serialized correctly. + /// This method is not thread safe, but since NUnit can run tests + /// only in a single threaded mode, thread safety is not a requirement. + /// + protected void RunMockedExample(ExamplesMockData mockData, TestDelegate exampleDelegate, + WebRequestInterceptor.OnBeforeSendResponse callback) { + TextWriter oldWriter = Console.Out; + try { + clientLoginInterceptor.Intercept = true; + clientLoginInterceptor.RaiseException = false; + awapiInterceptor.Intercept = true; + AuthToken.Cache.Clear(); + awapiInterceptor.LoadMessages(mockData.MockMessages, + delegate(Uri requestUri, WebHeaderCollection headers, String body) { + VerifySoapHeaders(requestUri, body); + callback(requestUri, headers, body); + } + ); + StringWriter newWriter = new StringWriter(); + Console.SetOut(newWriter); + AdWordsAppConfig config = (user.Config as AdWordsAppConfig); + exampleDelegate.Invoke(); + Assert.AreEqual(newWriter.ToString().Trim(), mockData.ExpectedOutput.Trim()); + } finally { + Console.SetOut(oldWriter); + clientLoginInterceptor.Intercept = false; + awapiInterceptor.Intercept = false; + } + } + + /// + /// Runs a code example. + /// + /// The delegate that initializes and runs the + /// code example. + protected void RunExample(TestDelegate exampleDelegate) { + Thread.Sleep(3000); + StringWriter writer = new StringWriter(); + Assert.DoesNotThrow(delegate() { + TextWriter oldWriter = Console.Out; + Console.SetOut(writer); + AuthToken.Cache.Clear(); + exampleDelegate.Invoke(); + Console.SetOut(oldWriter); + Console.WriteLine(writer.ToString()); + }); + } + + /// + /// Loads the mock data for a code example. + /// + /// The mock data. + /// The parsed mock data. + protected ExamplesMockData LoadMockData(string mockData) { + List messages = new List(); + + XmlDocument xDoc = new XmlDocument(); + xDoc.LoadXml(mockData); + XmlNodeList soapNodes = xDoc.SelectNodes("Example/SOAP"); + + foreach (XmlElement soapNode in soapNodes) { + messages.Add(new HttpMessage(soapNode.SelectSingleNode("Request").InnerText, + soapNode.SelectSingleNode("Response").InnerText, + AdWordsRequestInterceptor.SOAP_RESPONSE_TYPE)); + } + return new ExamplesMockData(messages.ToArray(), xDoc.SelectSingleNode("Example/Output"). + InnerText); + } + + /// + /// Verifies the SOAP headers. + /// + /// The request URI. + /// The request body. + protected void VerifySoapHeaders(Uri requestUri, string requestBody) { + AdWordsAppConfig config = user.Config as AdWordsAppConfig; + + if (requestUri.AbsoluteUri.StartsWith(config.AdWordsApiServer)) { + XmlDocument xDoc = new XmlDocument(); + xDoc.LoadXml(requestBody); + + XmlNamespaceManager xmlns = new XmlNamespaceManager(xDoc.NameTable); + xmlns.AddNamespace("soap", "http://schemas.xmlsoap.org/soap/envelope/"); + XmlElement requestHeaders = (XmlElement) xDoc.SelectSingleNode( + "soap:Envelope/soap:Header/child::*", xmlns); + Assert.NotNull(requestHeaders); + Assert.AreEqual(requestHeaders.Name, "RequestHeader"); + foreach (XmlElement childNode in requestHeaders.ChildNodes) { + switch (childNode.Name) { + case "authToken": + Assert.AreEqual(childNode.InnerText, "AUTH_TOKEN"); + break; + + case "developerToken": + Assert.AreEqual(childNode.InnerText, config.DeveloperToken); + break; + + case "clientCustomerId": + Assert.AreEqual(childNode.InnerText, config.ClientCustomerId); + break; + + case "userAgent": + Assert.AreEqual(childNode.InnerText, config.GetUserAgent()); + break; + } + } + } + } + } +} diff --git a/tests/AdWords/ExamplesMockData.cs b/tests/AdWords/ExamplesMockData.cs new file mode 100644 index 00000000000..14207ff6d69 --- /dev/null +++ b/tests/AdWords/ExamplesMockData.cs @@ -0,0 +1,68 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Tests; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.AdWords.Tests { + /// + /// Contains mock data for a given code example. + /// + public class ExamplesMockData { + /// + /// List of HTTP messages to be mocked. + /// + HttpMessage[] mockMessages = null; + + /// + /// Expected output from the code example. + /// + string expectedOutput = ""; + + /// + /// Overloaded constructor. + /// + /// The list of HTTP messages to be mocked. + /// + /// Expected output from the code example. + /// + public ExamplesMockData(HttpMessage[] mockMessages, string expectedOutput) { + this.mockMessages = mockMessages; + this.expectedOutput = expectedOutput; + } + + /// + /// Gets the mock messages. + /// + public HttpMessage[] MockMessages { + get { + return mockMessages; + } + } + + /// + /// Gets the expected output. + /// + public string ExpectedOutput { + get { + return expectedOutput; + } + } + } +} diff --git a/tests/AdWords/Lib/AdWordsCallListenerTest.cs b/tests/AdWords/Lib/AdWordsCallListenerTest.cs new file mode 100644 index 00000000000..7d8329bde34 --- /dev/null +++ b/tests/AdWords/Lib/AdWordsCallListenerTest.cs @@ -0,0 +1,103 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Examples.CSharp.v201309; +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Tests.v201309; +using Google.Api.Ads.AdWords.v201309; +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Common.Tests; +using Google.Api.Ads.Common.Util; + + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; +using System.Threading; +using System.Xml; + +namespace Google.Api.Ads.AdWords.Tests.Lib { + /// + /// Test cases for AdWordsCallListener. + /// + class AdWordsCallListenerTest : VersionedExampleTestsBase { + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + user.ResetCallHistory(); + } + + /// + /// Integration test to make sure Api Call Listener works. + /// + [Test] + [Category("Integration")] + public void TestGetAccountAlertsCSharpExample() { + ExamplesMockData mockData = LoadMockData(SoapMessages_v201309.GetAccountAlerts); + RunMockedExample(mockData, delegate() { + new GetAccountAlerts().Run(user); + Assert.AreEqual(user.GetTotalOperationCount(), 2); + Assert.AreEqual(user.GetOperationCountForLastCall(), 2); + ApiCallEntry[] callEntries = user.GetCallDetails(); + Assert.AreEqual(callEntries.Length, 1); + ApiCallEntry callEntry = user.GetCallDetails()[0]; + Assert.AreEqual(callEntry.OperationCount, 2); + Assert.AreEqual(callEntry.Method, "get"); + Assert.AreEqual(callEntry.Service.Signature.ServiceName, "AlertService"); + }, new WebRequestInterceptor.OnBeforeSendResponse(delegate(Uri uri, + WebHeaderCollection headers, String body) { + })); + } + + /// + /// Tests if SOAP messages are handled correctly. + /// + [Test] + [Category("Small")] + public void TestHandleMessage() { + try { + ContextStore.AddKey("SoapMethod", "get"); + + XmlDocument xDoc = new XmlDocument(); + xDoc.LoadXml(SoapMessages_v201309.GetAccountAlerts); + XmlElement xRequest = (XmlElement) xDoc.SelectSingleNode("/Example/SOAP/Response"); + xDoc.LoadXml(xRequest.InnerText); + AlertService service = (AlertService) user.GetService(AdWordsService.v201309.AlertService); + + AdWordsCallListener.Instance.HandleMessage(xDoc, service, SoapMessageDirection.IN); + + Assert.AreEqual(user.GetTotalOperationCount(), 2); + Assert.AreEqual(user.GetOperationCountForLastCall(), 2); + ApiCallEntry[] callEntries = user.GetCallDetails(); + Assert.AreEqual(callEntries.Length, 1); + ApiCallEntry callEntry = user.GetCallDetails()[0]; + + Assert.AreEqual(callEntry.OperationCount, 2); + Assert.AreEqual(callEntry.Method, "get"); + Assert.AreEqual(callEntry.Service.Signature.ServiceName, "AlertService"); + } finally { + ContextStore.RemoveKey("SoapMethod"); + } + } + } +} diff --git a/tests/AdWords/Lib/AdWordsServiceFactoryTests.cs b/tests/AdWords/Lib/AdWordsServiceFactoryTests.cs new file mode 100644 index 00000000000..47669cd13a3 --- /dev/null +++ b/tests/AdWords/Lib/AdWordsServiceFactoryTests.cs @@ -0,0 +1,112 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.AdWords.Lib; +using NUnit.Framework; + + +namespace Google.Api.Ads.AdWords.Tests.Lib { + /// + /// Tests for the AdWordsServiceFactory + /// + [TestFixture] + class AdWordsServiceFactoryTests { + private const string DEPRECATED_CLIENT_LOGIN_VERSION = "v201402"; + private const string SUPPORTED_CLIENT_LOGIN_VERSION = "v201309"; + private const string TEST_SERVICE = "MediaService"; + private const string TEST_GROUP_NAME = "express"; + + private AdWordsServiceFactory serviceFactory; + private ServiceSignature serviceSignature; + private Uri testUri; + + /// + /// Default public constructor. + /// + public AdWordsServiceFactoryTests() { + + } + + [SetUp] + public void Init() { + serviceFactory = new AdWordsServiceFactory(); + testUri = new Uri("https://google.com"); + } + + /// + /// Test that creating a service using ClientLogin in a deprecated version + /// throws an exception + /// + [Test] + [ExpectedException(typeof(AdWordsException))] + public void TestCreateServiceClientLoginDeprecated() { + ConfigureForClientLogin(); + serviceSignature = new AdWordsServiceSignature(DEPRECATED_CLIENT_LOGIN_VERSION, + TEST_SERVICE, TEST_GROUP_NAME); + serviceFactory.CreateService(serviceSignature, new AdWordsUser(), testUri); + } + + /// + /// Test that creating a service using ClientLogin in a supported version does not + /// throw an exception + /// + [Test] + public void TestCreateServiceClientLoginSupported() { + ConfigureForClientLogin(); + serviceSignature = new AdWordsServiceSignature(SUPPORTED_CLIENT_LOGIN_VERSION, + TEST_SERVICE, TEST_GROUP_NAME); + serviceFactory.CreateService(serviceSignature, new AdWordsUser(), testUri); + } + + /// + /// Test creating a service using OAuth2 in a version where ClientLogin is supported + /// + [Test] + public void TestCreateServiceOAuth2ClientLoginSupported() { + ConfigureForOAuth2(); + serviceSignature = new AdWordsServiceSignature(SUPPORTED_CLIENT_LOGIN_VERSION, + TEST_SERVICE, TEST_GROUP_NAME); + serviceFactory.CreateService(serviceSignature, new AdWordsUser(), testUri); + } + + /// + /// Test creating a service using OAuth2 in a version where ClientLogin is deprecated + /// + [Test] + public void TestCreateServiceOAuth2ClientLoginDeprecated() { + ConfigureForOAuth2(); + serviceSignature = new AdWordsServiceSignature(DEPRECATED_CLIENT_LOGIN_VERSION, + TEST_SERVICE, TEST_GROUP_NAME); + serviceFactory.CreateService(serviceSignature, new AdWordsUser(), testUri); + } + + private void ConfigureForOAuth2() { + AdWordsAppConfig config = new AdWordsAppConfig(); + config.AuthorizationMethod = AdWordsAuthorizationMethod.OAuth2; + serviceFactory.Config = config; + } + + private void ConfigureForClientLogin() { + AdWordsAppConfig config = new AdWordsAppConfig(); + config.AuthorizationMethod = AdWordsAuthorizationMethod.ClientLogin; + serviceFactory.Config = config; + } + } +} diff --git a/tests/AdWords/Properties/AssemblyInfo.cs b/tests/AdWords/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..63c0c1dd678 --- /dev/null +++ b/tests/AdWords/Properties/AssemblyInfo.cs @@ -0,0 +1,37 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("AdWords API Client Library Tests")] +[assembly: AssemblyDescription( + "This library contains NUnit tests for the client library.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d5c43f55-9efa-408a-98cd-795ee48b558d")] diff --git a/tests/AdWords/Properties/Properties.cs b/tests/AdWords/Properties/Properties.cs new file mode 100644 index 00000000000..de944c8264a --- /dev/null +++ b/tests/AdWords/Properties/Properties.cs @@ -0,0 +1,24 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; + +[assembly: AssemblyCompany("Google")] +[assembly: AssemblyProduct("AdWords API DotNet Client Library")] +[assembly: AssemblyCopyright("Copyright 2011, Google Inc. All Rights Reserved.")] + +[assembly: AssemblyVersion("18.0.0.0")] +[assembly: AssemblyFileVersion("18.0.0.0")] diff --git a/tests/AdWords/Resources/GetAccountAlerts.v201309.txt b/tests/AdWords/Resources/GetAccountAlerts.v201309.txt new file mode 100644 index 00000000000..5ca47280728 --- /dev/null +++ b/tests/AdWords/Resources/GetAccountAlerts.v201309.txt @@ -0,0 +1,12 @@ + + + + <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><RequestHeader xmlns="https://adwords.google.com/api/adwords/mcm/v201309"><authToken xmlns="https://adwords.google.com/api/adwords/cm/v201309">******</authToken><developerToken xmlns="https://adwords.google.com/api/adwords/cm/v201309">******</developerToken><userAgent xmlns="https://adwords.google.com/api/adwords/cm/v201309">INSERT_YOUR_COMPANY_OR_APPLICATION_NAME_HERE (AwApi-DotNet/15.1.0, Common-Dotnet/1.4.0, .NET CLR/2.0.50727.5456)</userAgent></RequestHeader></soap:Header><soap:Body><get xmlns="https://adwords.google.com/api/adwords/mcm/v201309"><selector><query><clientSpec>ALL</clientSpec><filterSpec>ALL</filterSpec><types>ACCOUNT_ON_TARGET</types><types>DECLINED_PAYMENT</types><types>CREDIT_CARD_EXPIRING</types><types>ACCOUNT_BUDGET_ENDING</types><types>CAMPAIGN_ENDING</types><types>PAYMENT_NOT_ENTERED</types><types>MISSING_BANK_REFERENCE_NUMBER</types><types>CAMPAIGN_ENDED</types><types>ACCOUNT_BUDGET_BURN_RATE</types><types>USER_INVITE_PENDING</types><types>USER_INVITE_ACCEPTED</types><types>MANAGER_LINK_PENDING</types><types>ZERO_DAILY_SPENDING_LIMIT</types><types>TV_ACCOUNT_ON_TARGET</types><types>TV_ACCOUNT_BUDGET_ENDING</types><types>TV_ZERO_DAILY_SPENDING_LIMIT</types><types>UNKNOWN</types><severities>GREEN</severities><severities>YELLOW</severities><severities>RED</severities><triggerTimeSpec>ALL_TIME</triggerTimeSpec></query><paging><startIndex xmlns="https://adwords.google.com/api/adwords/cm/v201309">0</startIndex><numberResults xmlns="https://adwords.google.com/api/adwords/cm/v201309">500</numberResults></paging></selector></get></soap:Body></soap:Envelope> + <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ResponseHeader xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201309" xmlns="https://adwords.google.com/api/adwords/mcm/v201309"><ns2:requestId>0004cd7c5357ea800a837b1100006fdf</ns2:requestId><ns2:serviceName>AlertService</ns2:serviceName><ns2:methodName>get</ns2:methodName><ns2:operations>2</ns2:operations><ns2:responseTime>464</ns2:responseTime><ns2:units>2</ns2:units></ResponseHeader></soap:Header><soap:Body><getResponse xmlns="https://adwords.google.com/api/adwords/mcm/v201309" xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201309"><rval><ns2:totalNumEntries>2</ns2:totalNumEntries><ns2:Page.Type>AlertPage</ns2:Page.Type><entries><alertSeverity>RED</alertSeverity><alertType>PAYMENT_NOT_ENTERED</alertType><clientCustomerId>1234567890</clientCustomerId><details><triggerTime>20121101 162410 PST8PDT</triggerTime></details></entries><entries><alertSeverity>RED</alertSeverity><alertType>PAYMENT_NOT_ENTERED</alertType><clientCustomerId>1234567890</clientCustomerId><details><triggerTime>20121101 162433 PST8PDT</triggerTime></details></entries></rval></getResponse></soap:Body></soap:Envelope> + + 1) Customer Id is 123-456-7890, Alert type is 'PAYMENT_NOT_ENTERED', Severity is RED + - Triggered at 20121101 162410 PST8PDT +2) Customer Id is 123-456-7890, Alert type is 'PAYMENT_NOT_ENTERED', Severity is RED + - Triggered at 20121101 162433 PST8PDT +Number of alerts found: 2 + diff --git a/tests/AdWords/Resources/GetAccountAlerts.v201402.txt b/tests/AdWords/Resources/GetAccountAlerts.v201402.txt new file mode 100644 index 00000000000..3bf1e44f920 --- /dev/null +++ b/tests/AdWords/Resources/GetAccountAlerts.v201402.txt @@ -0,0 +1,12 @@ + + + + <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><RequestHeader xmlns="https://adwords.google.com/api/adwords/mcm/v201402"><authToken xmlns="https://adwords.google.com/api/adwords/cm/v201402">******</authToken><developerToken xmlns="https://adwords.google.com/api/adwords/cm/v201402">******</developerToken><userAgent xmlns="https://adwords.google.com/api/adwords/cm/v201402">INSERT_YOUR_COMPANY_OR_APPLICATION_NAME_HERE (AwApi-DotNet/15.1.0, Common-Dotnet/1.4.0, .NET CLR/2.0.50727.5456)</userAgent></RequestHeader></soap:Header><soap:Body><get xmlns="https://adwords.google.com/api/adwords/mcm/v201402"><selector><query><clientSpec>ALL</clientSpec><filterSpec>ALL</filterSpec><types>ACCOUNT_ON_TARGET</types><types>DECLINED_PAYMENT</types><types>CREDIT_CARD_EXPIRING</types><types>ACCOUNT_BUDGET_ENDING</types><types>CAMPAIGN_ENDING</types><types>PAYMENT_NOT_ENTERED</types><types>MISSING_BANK_REFERENCE_NUMBER</types><types>CAMPAIGN_ENDED</types><types>ACCOUNT_BUDGET_BURN_RATE</types><types>USER_INVITE_PENDING</types><types>USER_INVITE_ACCEPTED</types><types>MANAGER_LINK_PENDING</types><types>ZERO_DAILY_SPENDING_LIMIT</types><types>TV_ACCOUNT_ON_TARGET</types><types>TV_ACCOUNT_BUDGET_ENDING</types><types>TV_ZERO_DAILY_SPENDING_LIMIT</types><types>UNKNOWN</types><severities>GREEN</severities><severities>YELLOW</severities><severities>RED</severities><triggerTimeSpec>ALL_TIME</triggerTimeSpec></query><paging><startIndex xmlns="https://adwords.google.com/api/adwords/cm/v201402">0</startIndex><numberResults xmlns="https://adwords.google.com/api/adwords/cm/v201402">500</numberResults></paging></selector></get></soap:Body></soap:Envelope> + <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ResponseHeader xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201402" xmlns="https://adwords.google.com/api/adwords/mcm/v201402"><ns2:requestId>0004cd7c5357ea800a837b1100006fdf</ns2:requestId><ns2:serviceName>AlertService</ns2:serviceName><ns2:methodName>get</ns2:methodName><ns2:operations>2</ns2:operations><ns2:responseTime>464</ns2:responseTime><ns2:units>2</ns2:units></ResponseHeader></soap:Header><soap:Body><getResponse xmlns="https://adwords.google.com/api/adwords/mcm/v201402" xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201402"><rval><ns2:totalNumEntries>2</ns2:totalNumEntries><ns2:Page.Type>AlertPage</ns2:Page.Type><entries><alertSeverity>RED</alertSeverity><alertType>PAYMENT_NOT_ENTERED</alertType><clientCustomerId>1234567890</clientCustomerId><details><triggerTime>20121101 162410 PST8PDT</triggerTime></details></entries><entries><alertSeverity>RED</alertSeverity><alertType>PAYMENT_NOT_ENTERED</alertType><clientCustomerId>1234567890</clientCustomerId><details><triggerTime>20121101 162433 PST8PDT</triggerTime></details></entries></rval></getResponse></soap:Body></soap:Envelope> + + 1) Customer Id is 123-456-7890, Alert type is 'PAYMENT_NOT_ENTERED', Severity is RED + - Triggered at 20121101 162410 PST8PDT +2) Customer Id is 123-456-7890, Alert type is 'PAYMENT_NOT_ENTERED', Severity is RED + - Triggered at 20121101 162433 PST8PDT +Number of alerts found: 2 + diff --git a/tests/AdWords/Resources/GetAccountAlerts.v201406.txt b/tests/AdWords/Resources/GetAccountAlerts.v201406.txt new file mode 100644 index 00000000000..52730ec32be --- /dev/null +++ b/tests/AdWords/Resources/GetAccountAlerts.v201406.txt @@ -0,0 +1,12 @@ + + + + <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><RequestHeader xmlns="https://adwords.google.com/api/adwords/mcm/v201406"><authToken xmlns="https://adwords.google.com/api/adwords/cm/v201406">******</authToken><developerToken xmlns="https://adwords.google.com/api/adwords/cm/v201406">******</developerToken><userAgent xmlns="https://adwords.google.com/api/adwords/cm/v201406">INSERT_YOUR_COMPANY_OR_APPLICATION_NAME_HERE (AwApi-DotNet/15.1.0, Common-Dotnet/1.4.0, .NET CLR/2.0.50727.5456)</userAgent></RequestHeader></soap:Header><soap:Body><get xmlns="https://adwords.google.com/api/adwords/mcm/v201406"><selector><query><clientSpec>ALL</clientSpec><filterSpec>ALL</filterSpec><types>ACCOUNT_ON_TARGET</types><types>DECLINED_PAYMENT</types><types>CREDIT_CARD_EXPIRING</types><types>ACCOUNT_BUDGET_ENDING</types><types>CAMPAIGN_ENDING</types><types>PAYMENT_NOT_ENTERED</types><types>MISSING_BANK_REFERENCE_NUMBER</types><types>CAMPAIGN_ENDED</types><types>ACCOUNT_BUDGET_BURN_RATE</types><types>USER_INVITE_PENDING</types><types>USER_INVITE_ACCEPTED</types><types>MANAGER_LINK_PENDING</types><types>ZERO_DAILY_SPENDING_LIMIT</types><types>TV_ACCOUNT_ON_TARGET</types><types>TV_ACCOUNT_BUDGET_ENDING</types><types>TV_ZERO_DAILY_SPENDING_LIMIT</types><types>UNKNOWN</types><severities>GREEN</severities><severities>YELLOW</severities><severities>RED</severities><triggerTimeSpec>ALL_TIME</triggerTimeSpec></query><paging><startIndex xmlns="https://adwords.google.com/api/adwords/cm/v201406">0</startIndex><numberResults xmlns="https://adwords.google.com/api/adwords/cm/v201406">500</numberResults></paging></selector></get></soap:Body></soap:Envelope> + <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ResponseHeader xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201406" xmlns="https://adwords.google.com/api/adwords/mcm/v201406"><ns2:requestId>0004cd7c5357ea800a837b1100006fdf</ns2:requestId><ns2:serviceName>AlertService</ns2:serviceName><ns2:methodName>get</ns2:methodName><ns2:operations>2</ns2:operations><ns2:responseTime>464</ns2:responseTime><ns2:units>2</ns2:units></ResponseHeader></soap:Header><soap:Body><getResponse xmlns="https://adwords.google.com/api/adwords/mcm/v201406" xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201406"><rval><ns2:totalNumEntries>2</ns2:totalNumEntries><ns2:Page.Type>AlertPage</ns2:Page.Type><entries><alertSeverity>RED</alertSeverity><alertType>PAYMENT_NOT_ENTERED</alertType><clientCustomerId>1234567890</clientCustomerId><details><triggerTime>20121101 162410 PST8PDT</triggerTime></details></entries><entries><alertSeverity>RED</alertSeverity><alertType>PAYMENT_NOT_ENTERED</alertType><clientCustomerId>1234567890</clientCustomerId><details><triggerTime>20121101 162433 PST8PDT</triggerTime></details></entries></rval></getResponse></soap:Body></soap:Envelope> + + 1) Customer Id is 123-456-7890, Alert type is 'PAYMENT_NOT_ENTERED', Severity is RED + - Triggered at 20121101 162410 PST8PDT +2) Customer Id is 123-456-7890, Alert type is 'PAYMENT_NOT_ENTERED', Severity is RED + - Triggered at 20121101 162433 PST8PDT +Number of alerts found: 2 + diff --git a/tests/AdWords/ServiceCreationTests.cs b/tests/AdWords/ServiceCreationTests.cs new file mode 100644 index 00000000000..ef38406dc4e --- /dev/null +++ b/tests/AdWords/ServiceCreationTests.cs @@ -0,0 +1,63 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.AdWords.Lib; + +using NUnit.Framework; + +using System; +using System.Reflection; + +namespace Google.Api.Ads.AdWords.Tests { + + /// + /// UnitTests for service creation. + /// + [TestFixture] + public class ServiceCreationTests : ExampleTestsBase { + + /// + /// Default public constructor. + /// + public ServiceCreationTests() + : base() { + } + + /// + /// Test whether we can create all the services without any exceptions. + /// + [Test] + public void TestCreateServices() { + Type adwordsServiceType = typeof(AdWordsService); + + Type[] versionTypes = adwordsServiceType.GetNestedTypes(); + + foreach (Type versionType in versionTypes) { + FieldInfo[] serviceFields = versionType.GetFields + (BindingFlags.Static | BindingFlags.Public); + foreach (FieldInfo fieldInfo in serviceFields) { + if (fieldInfo.FieldType == typeof(ServiceSignature)) { + ServiceSignature value = (ServiceSignature) fieldInfo.GetValue(null); + Assert.DoesNotThrow(delegate() { + AdsClient service = user.GetService(value); + }); + } + } + } + } + } +} \ No newline at end of file diff --git a/tests/AdWords/SoapMessages.v201309.Designer.cs b/tests/AdWords/SoapMessages.v201309.Designer.cs new file mode 100644 index 00000000000..b5a1056ed68 --- /dev/null +++ b/tests/AdWords/SoapMessages.v201309.Designer.cs @@ -0,0 +1,75 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.1008 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Google.Api.Ads.AdWords.Tests { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class SoapMessages_v201309 { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal SoapMessages_v201309() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Google.Api.Ads.AdWords.Tests.SoapMessages.v201309", typeof(SoapMessages_v201309).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0"?> + ///<Example> + /// <SOAP> + /// <Request>&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;&lt;soap:Header&gt;&lt;RequestHeader xmlns="https://adwords.google.com/api/adwords/mcm/v201306"&gt;&lt;authToken xmlns="https://adwords.google.com/api/adwords/cm/v201306"&gt;******&lt;/authToken&gt;&lt;developerToken xmlns="https://adwo [rest of string was truncated]";. + /// + internal static string GetAccountAlerts { + get { + return ResourceManager.GetString("GetAccountAlerts", resourceCulture); + } + } + } +} diff --git a/tests/AdWords/SoapMessages.v201309.resx b/tests/AdWords/SoapMessages.v201309.resx new file mode 100644 index 00000000000..128d3580b85 --- /dev/null +++ b/tests/AdWords/SoapMessages.v201309.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Resources\GetAccountAlerts.v201309.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + + \ No newline at end of file diff --git a/tests/AdWords/SoapMessages.v201402.Designer.cs b/tests/AdWords/SoapMessages.v201402.Designer.cs new file mode 100644 index 00000000000..bfb6387eb93 --- /dev/null +++ b/tests/AdWords/SoapMessages.v201402.Designer.cs @@ -0,0 +1,75 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18063 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Google.Api.Ads.AdWords.Tests { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class SoapMessages_v201402 { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal SoapMessages_v201402() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Google.Api.Ads.AdWords.Tests.SoapMessages.v201402", typeof(SoapMessages_v201402).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0"?> + ///<Example> + /// <SOAP> + /// <Request>&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;&lt;soap:Header&gt;&lt;RequestHeader xmlns="https://adwords.google.com/api/adwords/mcm/v201309"&gt;&lt;authToken xmlns="https://adwords.google.com/api/adwords/cm/v201309"&gt;******&lt;/authToken&gt;&lt;developerToken xmlns="https://adwo [rest of string was truncated]";. + /// + internal static string GetAccountAlerts { + get { + return ResourceManager.GetString("GetAccountAlerts", resourceCulture); + } + } + } +} diff --git a/tests/AdWords/SoapMessages.v201402.resx b/tests/AdWords/SoapMessages.v201402.resx new file mode 100644 index 00000000000..eaf45f3fdf6 --- /dev/null +++ b/tests/AdWords/SoapMessages.v201402.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Resources\GetAccountAlerts.v201402.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + + \ No newline at end of file diff --git a/tests/AdWords/SoapMessages.v201406.Designer.cs b/tests/AdWords/SoapMessages.v201406.Designer.cs new file mode 100644 index 00000000000..cbea7b84503 --- /dev/null +++ b/tests/AdWords/SoapMessages.v201406.Designer.cs @@ -0,0 +1,75 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18444 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Google.Api.Ads.AdWords.Tests { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class SoapMessages_v201406 { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal SoapMessages_v201406() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Google.Api.Ads.AdWords.Tests.SoapMessages.v201406", typeof(SoapMessages_v201406).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0"?> + ///<Example> + /// <SOAP> + /// <Request>&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;&lt;soap:Header&gt;&lt;RequestHeader xmlns="https://adwords.google.com/api/adwords/mcm/v201406"&gt;&lt;authToken xmlns="https://adwords.google.com/api/adwords/cm/v201406"&gt;******&lt;/authToken&gt;&lt;developerToken xmlns="https://adwords [rest of string was truncated]";. + /// + internal static string GetAccountAlerts { + get { + return ResourceManager.GetString("GetAccountAlerts", resourceCulture); + } + } + } +} diff --git a/tests/AdWords/SoapMessages.v201406.resx b/tests/AdWords/SoapMessages.v201406.resx new file mode 100644 index 00000000000..404c3cea959 --- /dev/null +++ b/tests/AdWords/SoapMessages.v201406.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Resources\GetAccountAlerts.v201406.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + + \ No newline at end of file diff --git a/tests/AdWords/Util/v201309/MapUtilitiesTest.cs b/tests/AdWords/Util/v201309/MapUtilitiesTest.cs new file mode 100644 index 00000000000..43abfc745af --- /dev/null +++ b/tests/AdWords/Util/v201309/MapUtilitiesTest.cs @@ -0,0 +1,129 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + + +using Google.Api.Ads.AdWords.Util.v201309; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.Text; + +using NUnit.Framework; + +namespace Google.Api.Ads.AdWords.Tests.Util.v201309 { + /// + /// Tests for MapUtilities class. + /// + public class MapUtilitiesTest { + /// + /// Internal MapUtils instance for testing purposes. + /// + private MapUtilities mapUtils; + + /// + /// Initializes this instance. + /// + [SetUp] + public void Init() { + this.mapUtils = new MapUtilities(); + } + + /// + /// Tests the Add method. + /// + [Test] + public void TestAddKeyValue() { + mapUtils.Add("key1", "value1"); + mapUtils.Add("key2", "value2"); + String_StringMapEntry[] entries = mapUtils.AsArray(); + Assert.AreEqual(2, entries.Length); + Assert.AreEqual(entries[0].key, "key1"); + Assert.AreEqual(entries[0].value, "value1"); + Assert.AreEqual(entries[1].key, "key2"); + Assert.AreEqual(entries[1].value, "value2"); + } + + /// + /// Tests the AddEntry method. + /// + [Test] + public void TestAddEntry() { + String_StringMapEntry item1 = new String_StringMapEntry(); + item1.key = "key3"; + item1.value = "value3"; + mapUtils.AddEntry(item1); + + String_StringMapEntry item2 = new String_StringMapEntry(); + item2.key = "key4"; + item2.value = "value4"; + mapUtils.AddEntry(item2); + + String_StringMapEntry[] entries = mapUtils.AsArray(); + Assert.AreEqual(2, entries.Length); + Assert.AreEqual(entries[0].key, item1.key); + Assert.AreEqual(entries[0].value, item1.value); + Assert.AreEqual(entries[1].key, item2.key); + Assert.AreEqual(entries[1].value, item2.value); + } + + /// + /// Tests the AddEntries method. + /// + [Test] + public void TestAddEntries() { + String_StringMapEntry item1 = new String_StringMapEntry(); + item1.key = "key5"; + item1.value = "value5"; + + String_StringMapEntry item2 = new String_StringMapEntry(); + item2.key = "key6"; + item2.value = "value6"; + + mapUtils.AddEntries(new String_StringMapEntry[] {item1, item2}); + + String_StringMapEntry[] entries = mapUtils.AsArray(); + Assert.AreEqual(2, entries.Length); + Assert.AreEqual(entries[0].key, item1.key); + Assert.AreEqual(entries[0].value, item1.value); + Assert.AreEqual(entries[1].key, item2.key); + Assert.AreEqual(entries[1].value, item2.value); + } + + /// + /// Tests the AsDict method. + /// + [Test] + public void TestAsDict() { + String_StringMapEntry item1 = new String_StringMapEntry(); + item1.key = "key7"; + item1.value = "value7"; + + String_StringMapEntry item2 = new String_StringMapEntry(); + item2.key = "key8"; + item2.value = "value8"; + + mapUtils.AddEntries(new String_StringMapEntry[] {item1, item2}); + + Dictionary entries = mapUtils.AsDict(); + Assert.AreEqual(2, entries.Count); + Assert.True(entries.ContainsKey("key7")); + Assert.True(entries.ContainsKey("key8")); + Assert.AreEqual(entries["key7"], item1.value); + Assert.AreEqual(entries["key8"], item2.value); + } + } +} diff --git a/tests/AdWords/Util/v201402/MapUtilitiesTest.cs b/tests/AdWords/Util/v201402/MapUtilitiesTest.cs new file mode 100644 index 00000000000..443f0f35739 --- /dev/null +++ b/tests/AdWords/Util/v201402/MapUtilitiesTest.cs @@ -0,0 +1,129 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + + +using Google.Api.Ads.AdWords.Util.v201402; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.Text; + +using NUnit.Framework; + +namespace Google.Api.Ads.AdWords.Tests.Util.v201402 { + /// + /// Tests for MapUtilities class. + /// + public class MapUtilitiesTest { + /// + /// Internal MapUtils instance for testing purposes. + /// + private MapUtilities mapUtils; + + /// + /// Initializes this instance. + /// + [SetUp] + public void Init() { + this.mapUtils = new MapUtilities(); + } + + /// + /// Tests the Add method. + /// + [Test] + public void TestAddKeyValue() { + mapUtils.Add("key1", "value1"); + mapUtils.Add("key2", "value2"); + String_StringMapEntry[] entries = mapUtils.AsArray(); + Assert.AreEqual(2, entries.Length); + Assert.AreEqual(entries[0].key, "key1"); + Assert.AreEqual(entries[0].value, "value1"); + Assert.AreEqual(entries[1].key, "key2"); + Assert.AreEqual(entries[1].value, "value2"); + } + + /// + /// Tests the AddEntry method. + /// + [Test] + public void TestAddEntry() { + String_StringMapEntry item1 = new String_StringMapEntry(); + item1.key = "key3"; + item1.value = "value3"; + mapUtils.AddEntry(item1); + + String_StringMapEntry item2 = new String_StringMapEntry(); + item2.key = "key4"; + item2.value = "value4"; + mapUtils.AddEntry(item2); + + String_StringMapEntry[] entries = mapUtils.AsArray(); + Assert.AreEqual(2, entries.Length); + Assert.AreEqual(entries[0].key, item1.key); + Assert.AreEqual(entries[0].value, item1.value); + Assert.AreEqual(entries[1].key, item2.key); + Assert.AreEqual(entries[1].value, item2.value); + } + + /// + /// Tests the AddEntries method. + /// + [Test] + public void TestAddEntries() { + String_StringMapEntry item1 = new String_StringMapEntry(); + item1.key = "key5"; + item1.value = "value5"; + + String_StringMapEntry item2 = new String_StringMapEntry(); + item2.key = "key6"; + item2.value = "value6"; + + mapUtils.AddEntries(new String_StringMapEntry[] {item1, item2}); + + String_StringMapEntry[] entries = mapUtils.AsArray(); + Assert.AreEqual(2, entries.Length); + Assert.AreEqual(entries[0].key, item1.key); + Assert.AreEqual(entries[0].value, item1.value); + Assert.AreEqual(entries[1].key, item2.key); + Assert.AreEqual(entries[1].value, item2.value); + } + + /// + /// Tests the AsDict method. + /// + [Test] + public void TestAsDict() { + String_StringMapEntry item1 = new String_StringMapEntry(); + item1.key = "key7"; + item1.value = "value7"; + + String_StringMapEntry item2 = new String_StringMapEntry(); + item2.key = "key8"; + item2.value = "value8"; + + mapUtils.AddEntries(new String_StringMapEntry[] {item1, item2}); + + Dictionary entries = mapUtils.AsDict(); + Assert.AreEqual(2, entries.Count); + Assert.True(entries.ContainsKey("key7")); + Assert.True(entries.ContainsKey("key8")); + Assert.AreEqual(entries["key7"], item1.value); + Assert.AreEqual(entries["key8"], item2.value); + } + } +} diff --git a/tests/AdWords/Util/v201406/MapUtilitiesTest.cs b/tests/AdWords/Util/v201406/MapUtilitiesTest.cs new file mode 100644 index 00000000000..e1edf61d408 --- /dev/null +++ b/tests/AdWords/Util/v201406/MapUtilitiesTest.cs @@ -0,0 +1,129 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + + +using Google.Api.Ads.AdWords.Util.v201406; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.Text; + +using NUnit.Framework; + +namespace Google.Api.Ads.AdWords.Tests.Util.v201406 { + /// + /// Tests for MapUtilities class. + /// + public class MapUtilitiesTest { + /// + /// Internal MapUtils instance for testing purposes. + /// + private MapUtilities mapUtils; + + /// + /// Initializes this instance. + /// + [SetUp] + public void Init() { + this.mapUtils = new MapUtilities(); + } + + /// + /// Tests the Add method. + /// + [Test] + public void TestAddKeyValue() { + mapUtils.Add("key1", "value1"); + mapUtils.Add("key2", "value2"); + String_StringMapEntry[] entries = mapUtils.AsArray(); + Assert.AreEqual(2, entries.Length); + Assert.AreEqual(entries[0].key, "key1"); + Assert.AreEqual(entries[0].value, "value1"); + Assert.AreEqual(entries[1].key, "key2"); + Assert.AreEqual(entries[1].value, "value2"); + } + + /// + /// Tests the AddEntry method. + /// + [Test] + public void TestAddEntry() { + String_StringMapEntry item1 = new String_StringMapEntry(); + item1.key = "key3"; + item1.value = "value3"; + mapUtils.AddEntry(item1); + + String_StringMapEntry item2 = new String_StringMapEntry(); + item2.key = "key4"; + item2.value = "value4"; + mapUtils.AddEntry(item2); + + String_StringMapEntry[] entries = mapUtils.AsArray(); + Assert.AreEqual(2, entries.Length); + Assert.AreEqual(entries[0].key, item1.key); + Assert.AreEqual(entries[0].value, item1.value); + Assert.AreEqual(entries[1].key, item2.key); + Assert.AreEqual(entries[1].value, item2.value); + } + + /// + /// Tests the AddEntries method. + /// + [Test] + public void TestAddEntries() { + String_StringMapEntry item1 = new String_StringMapEntry(); + item1.key = "key5"; + item1.value = "value5"; + + String_StringMapEntry item2 = new String_StringMapEntry(); + item2.key = "key6"; + item2.value = "value6"; + + mapUtils.AddEntries(new String_StringMapEntry[] {item1, item2}); + + String_StringMapEntry[] entries = mapUtils.AsArray(); + Assert.AreEqual(2, entries.Length); + Assert.AreEqual(entries[0].key, item1.key); + Assert.AreEqual(entries[0].value, item1.value); + Assert.AreEqual(entries[1].key, item2.key); + Assert.AreEqual(entries[1].value, item2.value); + } + + /// + /// Tests the AsDict method. + /// + [Test] + public void TestAsDict() { + String_StringMapEntry item1 = new String_StringMapEntry(); + item1.key = "key7"; + item1.value = "value7"; + + String_StringMapEntry item2 = new String_StringMapEntry(); + item2.key = "key8"; + item2.value = "value8"; + + mapUtils.AddEntries(new String_StringMapEntry[] {item1, item2}); + + Dictionary entries = mapUtils.AsDict(); + Assert.AreEqual(2, entries.Count); + Assert.True(entries.ContainsKey("key7")); + Assert.True(entries.ContainsKey("key8")); + Assert.AreEqual(entries["key7"], item1.value); + Assert.AreEqual(entries["key8"], item2.value); + } + } +} diff --git a/tests/AdWords/v201309/AccountManagementTest.cs b/tests/AdWords/v201309/AccountManagementTest.cs new file mode 100644 index 00000000000..921d7256376 --- /dev/null +++ b/tests/AdWords/v201309/AccountManagementTest.cs @@ -0,0 +1,113 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; +using Google.Api.Ads.Common.Tests; +using Google.Api.Ads.Common.Util; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; +using System.Threading; +using System.Xml; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201309; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201309; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Test cases for all the code examples under v201309\AccountManagement. + /// + class AccountManagementTest : VersionedExampleTestsBase { + /// + /// Tests the GetAccountAlerts VB.NET code example. + /// + [Test] + public void TestGetAccountAlertsVBExample() { + ExamplesMockData mockData = LoadMockData(SoapMessages_v201309.GetAccountAlerts); + RunMockedExample(mockData, delegate() { + new VBExamples.GetAccountAlerts().Run(user); + }, new WebRequestInterceptor.OnBeforeSendResponse(VerifyGetAccountAlertsRequest)); + } + + /// + /// Tests the GetAccountAlerts C# code example. + /// + [Test] + public void TestGetAccountAlertsCSharpExample() { + ExamplesMockData mockData = LoadMockData(SoapMessages_v201309.GetAccountAlerts); + RunMockedExample(mockData, delegate() { + new CSharpExamples.GetAccountAlerts().Run(user); + }, new WebRequestInterceptor.OnBeforeSendResponse(VerifyGetAccountAlertsRequest)); + } + + /// + /// Verifies whether GetAccountAlerts is serializing the request correctly. + /// + /// The request URI. + /// The headers. + /// The body. + private void VerifyGetAccountAlertsRequest(Uri requestUri, WebHeaderCollection headers, + string body) { + XmlDocument doc = new XmlDocument(); + doc.LoadXml(body); + XmlElement node = (XmlElement) doc.GetElementsByTagName("selector")[0]; + AlertSelector selector = + (AlertSelector) SerializationUtilities.DeserializeFromXmlTextCustomRootNs( + node.OuterXml, typeof(AlertSelector), + "https://adwords.google.com/api/adwords/mcm/v201309", "selector"); + + Assert.AreEqual(selector.query.filterSpec, FilterSpec.ALL); + Assert.AreEqual(selector.query.clientSpec, ClientSpec.ALL); + Assert.AreEqual(selector.query.triggerTimeSpec, TriggerTimeSpec.ALL_TIME); + Assert.Contains(AlertSeverity.GREEN, selector.query.severities); + Assert.Contains(AlertSeverity.YELLOW, selector.query.severities); + Assert.Contains(AlertSeverity.RED, selector.query.severities); + + foreach (AlertType alertType in Enum.GetValues(typeof(AlertType))) { + Assert.Contains(alertType, selector.query.types); + } + + Assert.AreEqual(selector.paging.startIndex, 0); + Assert.AreEqual(selector.paging.numberResults, 500); + } + + /// + /// Tests the GetAccountChanges VB.NET code example. + /// + [Test] + public void TestGetAccountChangesVBExample() { + RunExample(delegate() { + new VBExamples.GetAccountChanges().Run(user); + }); + } + + /// + /// Tests the GetAccountChanges C# code example. + /// + [Test] + public void TestGetAccountChangesCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAccountChanges().Run(user); + }); + } + } +} diff --git a/tests/AdWords/v201309/AdvancedOperationsTest.cs b/tests/AdWords/v201309/AdvancedOperationsTest.cs new file mode 100644 index 00000000000..fc72c7da9ea --- /dev/null +++ b/tests/AdWords/v201309/AdvancedOperationsTest.cs @@ -0,0 +1,128 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.v201309; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201309; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201309; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Test cases for all the code examples under v201309\AdvancedOperations. + /// + class AdvancedOperationsTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + const double BID_MODIFIER = 0.2; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateCampaign(user, BiddingStrategyType.MANUAL_CPC); + adGroupId = utils.CreateAdGroup(user, campaignId); + } + + /// + /// Tests the AddClickToDownloadAd VB.NET code example. + /// + [Test] + public void TestAddClickToDownloadAdVBExample() { + RunExample(delegate() { + new VBExamples.AddClickToDownloadAd().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddClickToDownloadAd C# code example. + /// + [Test] + public void TestAddClickToDownloadAdCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddClickToDownloadAd().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddSiteLinks VB.NET code example. + /// + [Test] + public void TestAddSiteLinksVBExample() { + RunExample(delegate() { + new VBExamples.AddSiteLinks().Run(user, campaignId); + }); + } + + /// + /// Tests the AddSiteLinks C# code example. + /// + [Test] + public void TestAddSiteLinksCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddSiteLinks().Run(user, campaignId); + }); + } + + /// + /// Tests the AddAdGroupBidModifier C# code example. + /// + [Test] + public void TestAddAdGroupBidModifierCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddAdGroupBidModifier().Run(user, adGroupId, BID_MODIFIER); + }); + } + + /// + /// Tests the AddAdGroupBidModifier VB.NET code example. + /// + [Test] + public void TestAddAdGroupBidModifierVBExample() { + RunExample(delegate() { + new VBExamples.AddAdGroupBidModifier().Run(user, adGroupId, BID_MODIFIER); + }); + } + + /// + /// Tests the GetAdGroupBidModifiers C# code example. + /// + [Test] + public void TestGetAdGroupBidModifiersCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAdGroupBidModifiers().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAdGroupBidModifiers VB.NET code example. + /// + [Test] + public void TestGetAdGroupBidModifiersVBExample() { + RunExample(delegate() { + new VBExamples.GetAdGroupBidModifiers().Run(user, campaignId); + }); + } + } +} diff --git a/tests/AdWords/v201309/BasicOperationsTest.cs b/tests/AdWords/v201309/BasicOperationsTest.cs new file mode 100644 index 00000000000..05a077de41f --- /dev/null +++ b/tests/AdWords/v201309/BasicOperationsTest.cs @@ -0,0 +1,371 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.v201309; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201309; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201309; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Test cases for all the code examples under v201309\BasicOperations. + /// + class BasicOperationsTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + long adId; + long keywordId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateCampaign(user, BiddingStrategyType.MANUAL_CPC); + adGroupId = utils.CreateAdGroup(user, campaignId); + adId = utils.CreateTextAd(user, adGroupId, false); + keywordId = utils.CreateKeyword(user, adGroupId); + } + + /// + /// Tests the AddAdGroup VB.NET code example. + /// + [Test] + public void TestAddAdGroupVBExample() { + RunExample(delegate() { + new VBExamples.AddAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the AddAdGroup C# code example. + /// + [Test] + public void TestAddAdGroupCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the AddCampaign VB.NET code example. + /// + [Test] + public void TestAddCampaignVBExample() { + RunExample(delegate() { + new VBExamples.AddCampaigns().Run(user); + }); + } + + /// + /// Tests the AddCampaign C# code example. + /// + [Test] + public void TestAddCampaignCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddCampaigns().Run(user); + }); + } + + /// + /// Tests the AddKeywords VB.NET code example. + /// + [Test] + public void TestAddKeywordsVBExample() { + RunExample(delegate() { + new VBExamples.AddKeywords().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddKeywords C# code example. + /// + [Test] + public void TestAddKeywordsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddKeywords().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddTextAds VB.NET code example. + /// + [Test] + public void TestAddTextAdsVBExample() { + RunExample(delegate() { + new VBExamples.AddTextAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddTextAds C# code example. + /// + [Test] + public void TestAddTextAdsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddTextAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the DeleteAdGroup VB.NET code example. + /// + [Test] + public void TestDeleteAdGroupVBExample() { + RunExample(delegate() { + new VBExamples.DeleteAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the DeleteAdGroup C# code example. + /// + [Test] + public void TestDeleteAdGroupCSharpExample() { + RunExample(delegate() { + new VBExamples.DeleteAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the DeleteAd VB.NET code example. + /// + [Test] + public void TestDeleteAdVBExample() { + RunExample(delegate() { + new VBExamples.DeleteAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the DeleteAd C# code example. + /// + [Test] + public void TestDeleteAdCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DeleteAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the DeleteCampaign VB.NET code example. + /// + [Test] + public void TestDeleteCampaignVBExample() { + RunExample(delegate() { + new VBExamples.DeleteCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the DeleteCampaign C# code example. + /// + [Test] + public void TestDeleteCampaignCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DeleteCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the DeleteKeyword VB.NET code example. + /// + [Test] + public void TestDeleteKeywordVBExample() { + RunExample(delegate() { + new VBExamples.DeleteKeyword().Run(user, adGroupId, keywordId); + }); + } + + /// + /// Tests the DeleteKeyword C# code example. + /// + [Test] + public void TestDeleteKeywordCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DeleteKeyword().Run(user, adGroupId, keywordId); + }); + } + + /// + /// Tests the GetAdGroups VB.NET code example. + /// + [Test] + public void TestGetAdGroupsVBExample() { + RunExample(delegate() { + new VBExamples.GetAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAdGroups C# code example. + /// + [Test] + public void TestGetAdGroupsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the GetCampaigns VB.NET code example. + /// + [Test] + public void TestGetCampaignsVBExample() { + RunExample(delegate() { + new VBExamples.GetCampaigns().Run(user); + }); + } + + /// + /// Tests the GetCampaigns C# code example. + /// + [Test] + public void TestGetCampaignsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetCampaigns().Run(user); + }); + } + + /// + /// Tests the GetKeywords VB.NET code example. + /// + [Test] + public void TestGetKeywordsVBExample() { + RunExample(delegate() { + new VBExamples.GetKeywords().Run(user); + }); + } + + /// + /// Tests the GetKeywords C# code example. + /// + [Test] + public void TestGetKeywordsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetKeywords().Run(user); + }); + } + + /// + /// Tests the GetTextAds VB.NET code example. + /// + [Test] + public void TestGetTextAdsVBExample() { + RunExample(delegate() { + new VBExamples.GetTextAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the GetTextAds C# code example. + /// + [Test] + public void TestGetTextAdsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetTextAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the PauseAd VB.NET code example. + /// + [Test] + public void TestPauseAdVBExample() { + RunExample(delegate() { + new VBExamples.PauseAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the PauseAd C# code example. + /// + [Test] + public void TestPauseAdCSharpExample() { + RunExample(delegate() { + new CSharpExamples.PauseAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the UpdateAdGroup VB.NET code example. + /// + [Test] + public void TestUpdateAdGroupVBExample() { + RunExample(delegate() { + new VBExamples.UpdateAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the UpdateAdGroup C# code example. + /// + [Test] + public void TestUpdateAdGroupCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UpdateAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the UpdateCampaign VB.NET code example. + /// + [Test] + public void TestUpdateCampaignVBExample() { + RunExample(delegate() { + new VBExamples.UpdateCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the UpdateCampaign C# code example. + /// + [Test] + public void TestUpdateCampaignCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UpdateCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the UpdateKeyword VB.NET code example. + /// + [Test] + public void TestUpdateKeywordVBExample() { + RunExample(delegate() { + new VBExamples.UpdateKeyword().Run(user, adGroupId, keywordId); + }); + } + + /// + /// Tests the UpdateKeyword C# code example. + /// + [Test] + public void TestUpdateKeywordCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UpdateKeyword().Run(user, adGroupId, keywordId); + }); + } + } +} diff --git a/tests/AdWords/v201309/CampaignManagementTest.cs b/tests/AdWords/v201309/CampaignManagementTest.cs new file mode 100644 index 00000000000..71bb6b6b94f --- /dev/null +++ b/tests/AdWords/v201309/CampaignManagementTest.cs @@ -0,0 +1,233 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201309; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201309; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Test cases for all the code examples under v201309\CampaignManagement. + /// + class CampaignManagementTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + long criterionId; + long adId; + long locationExtensionId; + long enhancedCampaignId; + + const Double BID_MODIFIER = 1.5; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateCampaign(user, BiddingStrategyType.MANUAL_CPC); + adGroupId = utils.CreateAdGroup(user, campaignId); + criterionId = utils.CreateKeyword(user, adGroupId); + adId = utils.CreateTextAd(user, adGroupId, false); + locationExtensionId = utils.CreateLocationExtension(user, campaignId); + + enhancedCampaignId = utils.CreateCampaign(user, BiddingStrategyType.MANUAL_CPC); + utils.EnhanceCampaign(user, enhancedCampaignId); + } + + /// + /// Tests the AddExperiment VB.NET code example. + /// + [Test] + public void TestAddExperimentVBExample() { + RunExample(delegate() { + new VBExamples.AddExperiment().Run(user, campaignId, adGroupId, criterionId); + }); + } + + /// + /// Tests the AddExperiment C# code example. + /// + [Test] + public void TestAddExperimentCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddExperiment().Run(user, campaignId, adGroupId, criterionId); + }); + } + + /// + /// Tests the AddKeywordsInBulk VB.NET code example. + /// + [Test] + public void TestAddKeywordsInBulkVBExample() { + RunExample(delegate() { + new VBExamples.AddKeywordsInBulk().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddKeywordsInBulk C# code example. + /// + [Test] + public void TestAddKeywordsInBulkCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddKeywordsInBulk().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddLocationExtension VB.NET code example. + /// + [Test] + public void TestAddLocationExtensionVBExample() { + RunExample(delegate() { + new VBExamples.AddLocationExtension().Run(user, campaignId); + }); + } + + /// + /// Tests the AddLocationExtension C# code example. + /// + [Test] + public void TestAddLocationExtensionCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddLocationExtension().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAllDisapprovedAds VB.NET code example. + /// + [Test] + public void TestGetAllDisapprovedAdsVBExample() { + RunExample(delegate() { + new VBExamples.GetAllDisapprovedAds().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAllDisapprovedAds C# code example. + /// + [Test] + public void TestGetAllDisapprovedAdsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAllDisapprovedAds().Run(user, campaignId); + }); + } + + /// + /// Tests the PromoteExperiment VB.NET code example. + /// + [Test] + public void TestPromoteExperimentVBExample() { + long experimentId = CreateExperimentForPromotion(); + RunExample(delegate() { + new VBExamples.PromoteExperiment().Run(user, experimentId); + }); + } + + /// + /// Tests the PromoteExperiment C# code example. + /// + [Test] + public void TestPromoteExperimentCSharpExample() { + long experimentId = CreateExperimentForPromotion(); + RunExample(delegate() { + new CSharpExamples.PromoteExperiment().Run(user, experimentId); + }); + } + + /// + /// Tests the SetAdParameters VB.NET code example. + /// + [Test] + public void TestSetAdParametersVBExample() { + RunExample(delegate() { + new VBExamples.SetAdParameters().Run(user, adGroupId, criterionId); + }); + } + + /// + /// Tests the SetAdParameters C# code example. + /// + [Test] + public void TestSetAdParametersCSharpExample() { + RunExample(delegate() { + new CSharpExamples.SetAdParameters().Run(user, adGroupId, criterionId); + }); + } + + /// + /// Tests the ValidateTextAd VB.NET code example. + /// + [Test] + public void TestValidateTextAdVBExample() { + RunExample(delegate() { + new VBExamples.ValidateTextAd().Run(user, adGroupId); + }); + } + + /// + /// Tests the ValidateTextAd C# code example. + /// + [Test] + public void TestValidateTextAdCSharpExample() { + RunExample(delegate() { + new CSharpExamples.ValidateTextAd().Run(user, adGroupId); + }); + } + + /// + /// Tests the SetBidModifier C# code example. + /// + [Test] + public void TestSetBidModifierCSharpExample() { + RunExample(delegate() { + new CSharpExamples.SetBidModifier().Run(user, enhancedCampaignId, BID_MODIFIER); + }); + } + + /// + /// Tests the SetBidModifier VB.NET code example. + /// + [Test] + public void TestSetBidModifierVBExample() { + RunExample(delegate() { + new VBExamples.SetBidModifier().Run(user, enhancedCampaignId, BID_MODIFIER); + }); + } + + /// + /// Create an experiment for promotion. + /// + /// Experiment id for promotion. + /// This code cannot be added in Init(), since there can be only + /// one experiment per campaign, and if we add this to Init(), then + /// AddExperiment tests will fail. + private long CreateExperimentForPromotion() { + return utils.AddExperiment(user, campaignId, adGroupId, criterionId); + } + } +} diff --git a/tests/AdWords/v201309/ErrorHandlingTest.cs b/tests/AdWords/v201309/ErrorHandlingTest.cs new file mode 100644 index 00000000000..291ccae02cd --- /dev/null +++ b/tests/AdWords/v201309/ErrorHandlingTest.cs @@ -0,0 +1,108 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201309; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201309; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Test cases for all the code examples under v201309\ErrorHandling. + /// + class ErrorHandlingTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateCampaign(user, BiddingStrategyType.MANUAL_CPC); + adGroupId = utils.CreateAdGroup(user, campaignId); + } + + /// + /// Tests the HandlePartialFailures VB.NET code example. + /// + [Test] + public void TestHandlePartialFailuresVBExample() { + RunExample(delegate() { + new VBExamples.HandlePartialFailures().Run(user, adGroupId); + }); + } + + /// + /// Tests the HandlePartialFailures C# code example. + /// + [Test] + public void TestHandlePartialFailuresCSharpExample() { + RunExample(delegate() { + new CSharpExamples.HandlePartialFailures().Run(user, adGroupId); + }); + } + + /// + /// Tests the HandlePolicyViolationError VB.NET code example. + /// + [Test] + public void TestHandlePolicyViolationErrorVBExample() { + RunExample(delegate() { + new VBExamples.HandlePolicyViolationError().Run(user, adGroupId); + }); + } + + /// + /// Tests the HandlePolicyViolationError C# code example. + /// + [Test] + public void TestHandlePolicyViolationErrorCSharpExample() { + RunExample(delegate() { + new CSharpExamples.HandlePolicyViolationError().Run(user, adGroupId); + }); + } + + /// + /// Tests the HandleTwoFactorAuthorizationError VB.NET code example. + /// + [Test] + public void TestHandleTwoFactorAuthorizationErrorVBExample() { + RunExample(delegate() { + new VBExamples.HandleTwoFactorAuthorizationError().Run(user); + }); + } + + /// + /// Tests the HandleTwoFactorAuthorizationError C# code example. + /// + [Test] + public void TestHandleTwoFactorAuthorizationErrorCSharpExample() { + RunExample(delegate() { + new CSharpExamples.HandleTwoFactorAuthorizationError().Run(user); + }); + } + } +} diff --git a/tests/AdWords/v201309/MiscellaneousTest.cs b/tests/AdWords/v201309/MiscellaneousTest.cs new file mode 100644 index 00000000000..d0dc3587977 --- /dev/null +++ b/tests/AdWords/v201309/MiscellaneousTest.cs @@ -0,0 +1,83 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201309; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201309; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Test cases for all the code examples under v201309\Miscellaneous. + /// + class MiscellaneousTest : VersionedExampleTestsBase { + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + } + + /// + /// Tests the GetAllVideosAndImages VB.NET code example. + /// + [Test] + public void TestGetAllVideosAndImagesVBExample() { + RunExample(delegate() { + new VBExamples.GetAllVideosAndImages().Run(user); + }); + } + + /// + /// Tests the GetAllVideosAndImages C# code example. + /// + [Test] + public void TestGetAllVideosAndImagesCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAllVideosAndImages().Run(user); + }); + } + + /// + /// Tests the UploadImage VB.NET code example. + /// + [Test] + public void TestUploadImageVBExample() { + RunExample(delegate() { + new VBExamples.UploadImage().Run(user); + }); + } + + /// + /// Tests the UploadImage C# code example. + /// + [Test] + public void TestUploadImageCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UploadImage().Run(user); + }); + } + } +} diff --git a/tests/AdWords/v201309/OptimizationTest.cs b/tests/AdWords/v201309/OptimizationTest.cs new file mode 100644 index 00000000000..60cd2f7ffc1 --- /dev/null +++ b/tests/AdWords/v201309/OptimizationTest.cs @@ -0,0 +1,130 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201309; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201309; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Test cases for all the code examples under v201309\Optimization. + /// + class OptimizationTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + long keywordId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateCampaign(user, BiddingStrategyType.MANUAL_CPC); + adGroupId = utils.CreateAdGroup(user, campaignId); + keywordId = utils.CreateKeyword(user, adGroupId); + } + + /// + /// Tests the EstimateKeywordTraffic VB.NET code example. + /// + [Test] + public void TestEstimateKeywordTrafficVBExample() { + RunExample(delegate() { + new VBExamples.EstimateKeywordTraffic().Run(user); + }); + } + + /// + /// Tests the EstimateKeywordTraffic C# code example. + /// + [Test] + public void TestEstimateKeywordTrafficCSharpExample() { + RunExample(delegate() { + new CSharpExamples.EstimateKeywordTraffic().Run(user); + }); + } + + /// + /// Tests the GetAdGroupBidSimulations VB.NET code example. + /// + [Test] + public void TestGetAdGroupBidSimulationsVBExample() { + RunExample(delegate() { + new VBExamples.GetAdGroupBidSimulations().Run(user, adGroupId); + }); + } + + /// + /// Tests the GetAdGroupBidSimulations C# code example. + /// + [Test] + public void TestGetAdGroupBidSimulationsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAdGroupBidSimulations().Run(user, adGroupId); + }); + } + + /// + /// Tests the GetKeywordBidSimulations VB.NET code example. + /// + [Test] + public void TestGetKeywordBidSimulationsVBExample() { + RunExample(delegate() { + new VBExamples.GetKeywordBidSimulations().Run(user, adGroupId, keywordId); + }); + } + + /// + /// Tests the GetKeywordBidSimulations C# code example. + /// + [Test] + public void TestGetKeywordBidSimulationsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetKeywordBidSimulations().Run(user, adGroupId, keywordId); + }); + } + + /// + /// Tests the GetPlacementIdeas VB.NET code example. + /// + [Test] + public void TestGetPlacementIdeasVBExample() { + RunExample(delegate() { + new VBExamples.GetPlacementIdeas().Run(user); + }); + } + + /// + /// Tests the GetPlacementIdeas C# code example. + /// + [Test] + public void TestGetPlacementIdeasCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetPlacementIdeas().Run(user); + }); + } + } +} diff --git a/tests/AdWords/v201309/RemarketingTest.cs b/tests/AdWords/v201309/RemarketingTest.cs new file mode 100644 index 00000000000..ddd6b746ea4 --- /dev/null +++ b/tests/AdWords/v201309/RemarketingTest.cs @@ -0,0 +1,84 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201309; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201309; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Test cases for all the code examples under + /// v201309\AudienceAndConversionManagement. + /// + class RemarketingTest : VersionedExampleTestsBase { + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + } + + /// + /// Tests the AddAudience VB.NET code example. + /// + [Test] + public void TestAddAudienceVBExample() { + RunExample(delegate() { + new VBExamples.AddAudience().Run(user); + }); + } + + /// + /// Tests the AddAudience C# code example. + /// + [Test] + public void TestAddAudienceCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddAudience().Run(user); + }); + } + + /// + /// Tests the AddConversionTracker VB.NET code example. + /// + [Test] + public void TestAddConversionTrackerVBExample() { + RunExample(delegate() { + new VBExamples.AddConversionTracker().Run(user); + }); + } + + /// + /// Tests the AddConversionTracker C# code example. + /// + [Test] + public void TestAddConversionTrackerCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddConversionTracker().Run(user); + }); + } + } +} diff --git a/tests/AdWords/v201309/ReportingTest.cs b/tests/AdWords/v201309/ReportingTest.cs new file mode 100644 index 00000000000..dce4868a8c2 --- /dev/null +++ b/tests/AdWords/v201309/ReportingTest.cs @@ -0,0 +1,87 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.v201309; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201309; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201309; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Test cases for all the code examples under v201309\Reporting. + /// + class ReportingTest : VersionedExampleTestsBase { + string outputFileName; + ReportDefinitionReportType reportType; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + outputFileName = Path.GetFileName(Path.GetTempFileName()); + reportType = ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT; + } + + /// + /// Tests the DownloadCriteriaReport VB.NET code example. + /// + [Test] + public void TestDownloadCriteriaReportVBExample() { + RunExample(delegate() { + new VBExamples.DownloadCriteriaReport().Run(user, outputFileName); + }); + } + + /// + /// Tests the DownloadCriteriaReport C# code example. + /// + [Test] + public void TestDownloadCriteriaReportCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DownloadCriteriaReport().Run(user, outputFileName); + }); + } + + /// + /// Tests the GetReportFields VB.NET code example. + /// + [Test] + public void TestGetReportFieldsVBExample() { + RunExample(delegate() { + new VBExamples.GetReportFields().Run(user, reportType); + }); + } + + /// + /// Tests the GetReportFields C# code example. + /// + [Test] + public void TestGetReportFieldsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetReportFields().Run(user, reportType); + }); + } + } +} diff --git a/tests/AdWords/v201309/TargetingTest.cs b/tests/AdWords/v201309/TargetingTest.cs new file mode 100644 index 00000000000..95ab33a0a06 --- /dev/null +++ b/tests/AdWords/v201309/TargetingTest.cs @@ -0,0 +1,128 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201309; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201309; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Test cases for all the code examples under v201309\Targeting. + /// + class TargetingTest : VersionedExampleTestsBase { + long campaignId; + long campaignCriterionId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateCampaign(user, BiddingStrategyType.MANUAL_CPC); + campaignCriterionId = utils.AddCampaignTargetingCriteria(user, campaignId); + } + + /// + /// Tests the AddCampaignTargetingCriteria VB.NET code example. + /// + [Test] + public void TestAddCampaignTargetingCriteriaVBExample() { + RunExample(delegate() { + new VBExamples.AddCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the AddCampaignTargetingCriteria C# code example. + /// + [Test] + public void TestAddCampaignTargetingCriteriaCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the GetCampaignTargetingCriteria VB.NET code example. + /// + [Test] + public void TestGetCampaignTargetingCriteriaVBExample() { + RunExample(delegate() { + new VBExamples.GetCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the GetCampaignTargetingCriteria C# code example. + /// + [Test] + public void TestGetCampaignTargetingCriteriaCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the GetTargetableLanguagesAndCarriers VB.NET code example. + /// + [Test] + public void TestGetTargetableLanguagesAndCarriersVBExample() { + RunExample(delegate() { + new VBExamples.GetTargetableLanguagesAndCarriers().Run(user); + }); + } + + /// + /// Tests the GetTargetableLanguagesAndCarriers C# code example. + /// + [Test] + public void TestGetTargetableLanguagesAndCarriersCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetTargetableLanguagesAndCarriers().Run(user); + }); + } + + /// + /// Tests the LookupLocation VB.NET code example. + /// + [Test] + public void TestLookupLocationVBExample() { + RunExample(delegate() { + new VBExamples.LookupLocation().Run(user); + }); + } + + /// + /// Tests the LookupLocation C# code example. + /// + [Test] + public void TestLookupLocationCSharpExample() { + RunExample(delegate() { + new CSharpExamples.LookupLocation().Run(user); + }); + } + } +} diff --git a/tests/AdWords/v201309/TestUtils.cs b/tests/AdWords/v201309/TestUtils.cs new file mode 100644 index 00000000000..7de7a7d3c1a --- /dev/null +++ b/tests/AdWords/v201309/TestUtils.cs @@ -0,0 +1,541 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util.v201309; +using Google.Api.Ads.AdWords.v201309; +using Google.Api.Ads.Common.Util; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// A utility class to assist the testing of v201309 services. + /// + class TestUtils { + /// + /// Creates a test campaign for running further tests. + /// + /// The AdWords user. + /// The bidding strategy to be used. + /// The campaign id. + public long CreateCampaign(AdWordsUser user, BiddingStrategyType strategyType) { + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201309.CampaignService); + + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + biddingConfig.biddingStrategyType = strategyType; + + CampaignOperation campaignOperation = new CampaignOperation(); + campaignOperation.@operator = Operator.ADD; + campaignOperation.operand = new Campaign(); + campaignOperation.operand.name = + string.Format("Campaign {0}", DateTime.Now.ToString("yyyy-M-d H:m:s.ffffff")); + campaignOperation.operand.status = CampaignStatus.PAUSED; + campaignOperation.operand.biddingStrategyConfiguration = biddingConfig; + campaignOperation.operand.budget = new Budget(); + campaignOperation.operand.budget.period = BudgetBudgetPeriod.DAILY; + campaignOperation.operand.budget.amount = new Money(); + campaignOperation.operand.budget.amount.microAmount = 100000000; + campaignOperation.operand.budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + KeywordMatchSetting matchSetting = new KeywordMatchSetting(); + matchSetting.optIn = true; + campaignOperation.operand.settings = new Setting[] {matchSetting}; + + CampaignReturnValue retVal = + campaignService.mutate(new CampaignOperation[] {campaignOperation}); + return retVal.value[0].id; + } + + /// + /// Creates the legacy sitelinks. + /// + /// The AdWords user. + /// The campaign id. + /// The list of legacy sitelinks. + public Sitelink[] CreateLegacySitelinks(AdWordsUser user, long campaignId) { + // Get the CampaignAdExtensionService. + CampaignAdExtensionService campaignExtensionService = + (CampaignAdExtensionService) user.GetService(AdWordsService.v201309. + CampaignAdExtensionService); + + // Create the sitelinks. + SitelinksExtension siteLinkExtension = new SitelinksExtension(); + + Sitelink siteLink1 = new Sitelink(); + siteLink1.displayText = "Music"; + siteLink1.destinationUrl = "http://www.example.com/music"; + + Sitelink siteLink2 = new Sitelink(); + siteLink2.displayText = "DVDs"; + siteLink2.destinationUrl = "http://www.example.com/dvds"; + + Sitelink siteLink3 = new Sitelink(); + siteLink3.displayText = "New albums"; + siteLink3.destinationUrl = "http://www.example.com/albums/new"; + + siteLinkExtension.sitelinks = new Sitelink[] {siteLink1, siteLink2, siteLink3}; + + CampaignAdExtension campaignAdExtension = new CampaignAdExtension(); + campaignAdExtension.adExtension = siteLinkExtension; + campaignAdExtension.campaignId = campaignId; + + // Create the operation. + CampaignAdExtensionOperation operation = new CampaignAdExtensionOperation(); + operation.@operator = Operator.ADD; + operation.operand = campaignAdExtension; + + // Create the sitelinks. + CampaignAdExtensionReturnValue retVal = + campaignExtensionService.mutate(new CampaignAdExtensionOperation[] {operation}); + + return (retVal.value[0].adExtension as SitelinksExtension).sitelinks; + } + + /// + /// Converts a campaign into enhanced campaign using forward compatibility + /// map. + /// + /// The user. + /// The campaign id. + public void EnhanceCampaign(AdWordsUser user, long campaignId) { + CampaignService campaignService = (CampaignService) user.GetService( + AdWordsService.v201309.CampaignService); + + // Campaign to be updated with the enhanced value. + // Note: After setting the enhanced value to true, setting it back to false + // will generate an ApiError. + Campaign campaign = new Campaign(); + campaign.id = campaignId; + + // Create operation. + CampaignOperation operation = new CampaignOperation(); + operation.@operator = Operator.SET; + operation.operand = campaign; + + campaignService.mutate(new CampaignOperation[] {operation}); + return; + } + + /// + /// Creates a test adgroup for running further tests. + /// + /// The AdWords user. + /// The campaign id for which the adgroup is created. + /// The adgroup id. + public long CreateAdGroup(AdWordsUser user, long campaignId) { + return CreateAdGroup(user, campaignId, false); + } + + /// + /// Creates a test adgroup for running further tests. + /// + /// The AdWords user. + /// The campaign id for which the adgroup is created. + /// True, if a ManualCPM bid is to be used. + /// The adgroup id. + public long CreateAdGroup(AdWordsUser user, long campaignId, bool isCpmBid) { + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201309.AdGroupService); + + AdGroupOperation adGroupOperation = new AdGroupOperation(); + adGroupOperation.@operator = Operator.ADD; + adGroupOperation.operand = new AdGroup(); + adGroupOperation.operand.campaignId = campaignId; + adGroupOperation.operand.name = + string.Format("AdGroup {0}", DateTime.Now.ToString("yyyy-M-d H:m:s.ffffff")); + adGroupOperation.operand.status = AdGroupStatus.ENABLED; + + if (isCpmBid) { + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + CpmBid cpmBid = new CpmBid(); + cpmBid.bid = new Money(); + cpmBid.bid.microAmount = 10000000; + biddingConfig.bids = new Bids[] {cpmBid}; + adGroupOperation.operand.biddingStrategyConfiguration = biddingConfig; + } else { + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + CpcBid cpcBid = new CpcBid(); + cpcBid.bid = new Money(); + cpcBid.bid.microAmount = 10000000; + biddingConfig.bids = new Bids[] {cpcBid}; + adGroupOperation.operand.biddingStrategyConfiguration = biddingConfig; + } + AdGroupReturnValue retVal = adGroupService.mutate(new AdGroupOperation[] {adGroupOperation}); + return retVal.value[0].id; + } + + /// + /// Creates a test textad for running further tests. + /// + /// The AdWords user. + /// The adgroup id for which the ad is created. + /// + /// True, if an ad param placeholder should be + /// added. + /// The text ad id. + public long CreateTextAd(AdWordsUser user, long adGroupId, bool hasAdParam) { + AdGroupAdService adGroupAdService = + (AdGroupAdService) user.GetService(AdWordsService.v201309.AdGroupAdService); + AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation(); + adGroupAdOperation.@operator = Operator.ADD; + adGroupAdOperation.operand = new AdGroupAd(); + adGroupAdOperation.operand.adGroupId = adGroupId; + TextAd ad = new TextAd(); + + ad.headline = "Luxury Cruise to Mars"; + ad.description1 = "Visit the Red Planet in style."; + if (hasAdParam) { + ad.description2 = "Low-gravity fun for {param1:cheap}!"; + } else { + ad.description2 = "Low-gravity fun for everyone!"; + } + ad.displayUrl = "example.com"; + ad.url = "http://www.example.com"; + + adGroupAdOperation.operand.ad = ad; + + AdGroupAdReturnValue retVal = + adGroupAdService.mutate(new AdGroupAdOperation[] {adGroupAdOperation}); + return retVal.value[0].ad.id; + } + + /// + /// Creates a test ThirdPartyRedirectAd for running further tests. + /// + /// The AdWords user. + /// The adgroup id for which the ad is created. + /// + /// True, if an ad param placeholder should be + /// added. + /// The text ad id. + public long CreateThirdPartyRedirectAd(AdWordsUser user, long adGroupId) { + AdGroupAdService adGroupAdService = + (AdGroupAdService) user.GetService(AdWordsService.v201309.AdGroupAdService); + AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation(); + adGroupAdOperation.@operator = Operator.ADD; + adGroupAdOperation.operand = new AdGroupAd(); + adGroupAdOperation.operand.adGroupId = adGroupId; + + // Create the third party redirect ad. + ThirdPartyRedirectAd redirectAd = new ThirdPartyRedirectAd(); + redirectAd.name = string.Format("Example third party ad #{0}", this.GetTimeStamp()); + redirectAd.url = "http://www.example.com"; + + redirectAd.dimensions = new Dimensions(); + redirectAd.dimensions.height = 250; + redirectAd.dimensions.width = 300; + + // This field normally contains the javascript ad tag. + redirectAd.snippet = + ""; + redirectAd.impressionBeaconUrl = "http://www.examples.com/beacon"; + redirectAd.certifiedVendorFormatId = 119; + redirectAd.isCookieTargeted = false; + redirectAd.isUserInterestTargeted = false; + redirectAd.isTagged = false; + + adGroupAdOperation.operand.ad = redirectAd; + + AdGroupAdReturnValue retVal = + adGroupAdService.mutate(new AdGroupAdOperation[] {adGroupAdOperation}); + return retVal.value[0].ad.id; + } + + /// + /// Sets an adparam for running further tests. + /// + /// The AdWords user. + /// The adgroup id to which criterionId belongs. + /// + /// The criterion id to which adparam is set. + /// + public void SetAdParam(AdWordsUser user, long adGroupId, long criterionId) { + AdParamService adParamService = + (AdParamService) user.GetService(AdWordsService.v201309.AdParamService); + + // Prepare for setting ad parameters. + AdParam adParam = new AdParam(); + adParam.adGroupId = adGroupId; + adParam.criterionId = criterionId; + adParam.paramIndex = 1; + adParam.insertionText = "$100"; + + AdParamOperation adParamOperation = new AdParamOperation(); + adParamOperation.@operator = Operator.SET; + adParamOperation.operand = adParam; + + // Set ad parameters. + AdParam[] newAdParams = adParamService.mutate(new AdParamOperation[] {adParamOperation}); + return; + } + + /// + /// Creates a keyword for running further tests. + /// + /// The AdWords user. + /// The adgroup id for which the keyword is + /// created. + /// The keyword id. + public long CreateKeyword(AdWordsUser user, long adGroupId) { + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201309.AdGroupCriterionService); + + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.@operator = Operator.ADD; + operation.operand = new BiddableAdGroupCriterion(); + operation.operand.adGroupId = adGroupId; + + Keyword keyword = new Keyword(); + keyword.matchType = KeywordMatchType.BROAD; + keyword.text = "mars cruise"; + + operation.operand.criterion = keyword; + AdGroupCriterionReturnValue retVal = + adGroupCriterionService.mutate(new AdGroupCriterionOperation[] {operation}); + return retVal.value[0].criterion.id; + } + + /// + /// Creates the placement. + /// + /// The AdWords user. + /// The adgroup id for which the placement is + /// created. + /// The placement id. + public long CreatePlacement(AdWordsUser user, long adGroupId) { + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201309.AdGroupCriterionService); + + Placement placement = new Placement(); + placement.url = "http://mars.google.com"; + + AdGroupCriterion placementCriterion = new BiddableAdGroupCriterion(); + placementCriterion.adGroupId = adGroupId; + placementCriterion.criterion = placement; + + AdGroupCriterionOperation placementOperation = new AdGroupCriterionOperation(); + placementOperation.@operator = Operator.ADD; + placementOperation.operand = placementCriterion; + + AdGroupCriterionReturnValue retVal = adGroupCriterionService.mutate( + new AdGroupCriterionOperation[] {placementOperation}); + + return retVal.value[0].criterion.id; + } + + /// + /// Creates a campaign ad extension for running further tests. + /// + /// The AdWords user. + /// The campaign id for which extension is + /// created. + /// The campaign ad extension id. + public long CreateLocationExtension(AdWordsUser user, long campaignId) { + CampaignAdExtensionService campaignExtensionService = + (CampaignAdExtensionService) user.GetService(AdWordsService.v201309. + CampaignAdExtensionService); + + CampaignAdExtensionOperation operation = new CampaignAdExtensionOperation(); + operation.@operator = Operator.ADD; + + CampaignAdExtension extension = new CampaignAdExtension(); + extension.campaignId = campaignId; + extension.status = CampaignAdExtensionStatus.ACTIVE; + + Address address = new Address(); + address.streetAddress = "1600 Amphitheatre Pkwy, Mountain View"; + address.countryCode = "US"; + + GeoLocation location = GetLocationForAddress(user, address); + + LocationExtension locationExtension = new LocationExtension(); + + // Note: Do not populate an address directly. Instead, use + // GeoLocationService to obtain the location of an address, + // and use the address as per the location it returns. + locationExtension.address = location.address; + locationExtension.geoPoint = location.geoPoint; + locationExtension.encodedLocation = location.encodedLocation; + locationExtension.source = LocationExtensionSource.ADWORDS_FRONTEND; + + extension.adExtension = locationExtension; + operation.operand = extension; + CampaignAdExtensionReturnValue retVal = + campaignExtensionService.mutate(new CampaignAdExtensionOperation[] {operation}); + return retVal.value[0].adExtension.id; + } + + /// + /// Adds site links to a campaign. + /// + /// The user. + /// The campaign id. + /// The sitelinks campaign adextension id. + public long AddSiteLinks(AdWordsUser user, long campaignId) { + // Get the CampaignAdExtensionService. + CampaignAdExtensionService campaignExtensionService = + (CampaignAdExtensionService) user.GetService(AdWordsService.v201309. + CampaignAdExtensionService); + + // Create the sitelinks. + SitelinksExtension siteLinkExtension = new SitelinksExtension(); + + Sitelink siteLink1 = new Sitelink(); + siteLink1.displayText = "Music"; + siteLink1.destinationUrl = "http://www.example.com/music"; + + Sitelink siteLink2 = new Sitelink(); + siteLink2.displayText = "DVDs"; + siteLink2.destinationUrl = "http://www.example.com/dvds"; + + Sitelink siteLink3 = new Sitelink(); + siteLink3.displayText = "New albums"; + siteLink3.destinationUrl = "http://www.example.com/albums/new"; + + siteLinkExtension.sitelinks = new Sitelink[] {siteLink1, siteLink2, siteLink3}; + + CampaignAdExtension campaignAdExtension = new CampaignAdExtension(); + campaignAdExtension.adExtension = siteLinkExtension; + campaignAdExtension.campaignId = campaignId; + + // Create the operation. + CampaignAdExtensionOperation operation = new CampaignAdExtensionOperation(); + operation.@operator = Operator.ADD; + operation.operand = campaignAdExtension; + + // Create the sitelinks. + CampaignAdExtensionReturnValue retVal = + campaignExtensionService.mutate(new CampaignAdExtensionOperation[] {operation}); + + return retVal.value[0].adExtension.id; + } + + /// + /// Adds an experiment. + /// + /// The user. + /// The campaign id. + /// The ad group id. + /// The criterion id. + /// The experiment id. + public long AddExperiment(AdWordsUser user, long campaignId, long adGroupId, long criterionId) { + // Get the ExperimentService. + ExperimentService experimentService = + (ExperimentService) user.GetService(AdWordsService.v201309.ExperimentService); + + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201309.AdGroupService); + + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201309.AdGroupCriterionService); + + // Create the experiment. + Experiment experiment = new Experiment(); + experiment.campaignId = campaignId; + experiment.name = "Interplanetary Cruise #" + GetTimeStamp(); + experiment.queryPercentage = 10; + experiment.startDateTime = DateTime.Now.AddDays(1).ToString("yyyyMMdd HHmmss"); + + // Create the operation. + ExperimentOperation experimentOperation = new ExperimentOperation(); + experimentOperation.@operator = Operator.ADD; + experimentOperation.operand = experiment; + + // Add the experiment. + ExperimentReturnValue experimentRetVal = experimentService.mutate( + new ExperimentOperation[] {experimentOperation}); + + return experimentRetVal.value[0].id; + } + + /// + /// Adds the campaign targeting criteria to a campaign. + /// + /// The user. + /// The campaign id. + /// The campaign criteria id. + public long AddCampaignTargetingCriteria(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201309.CampaignCriterionService); + + // Create language criteria. + // See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + // for a detailed list of language codes. + Language language1 = new Language(); + language1.id = 1002; // French + CampaignCriterion languageCriterion1 = new CampaignCriterion(); + languageCriterion1.campaignId = campaignId; + languageCriterion1.criterion = language1; + + CampaignCriterion[] criteria = new CampaignCriterion[] {languageCriterion1}; + + List operations = new List(); + + foreach (CampaignCriterion criterion in criteria) { + CampaignCriterionOperation operation = new CampaignCriterionOperation(); + operation.@operator = Operator.ADD; + operation.operand = criterion; + operations.Add(operation); + } + + CampaignCriterionReturnValue retVal = campaignCriterionService.mutate(operations.ToArray()); + return retVal.value[0].criterion.id; + } + + /// + /// Returns an image which can be used for creating image ads. + /// + /// The image data, as an array of bytes. + public byte[] GetTestImage() { + return MediaUtilities.GetAssetDataFromUrl("http://goo.gl/HJM3L"); + } + + /// + /// Gets the geo location for a given address. + /// + /// The AdWords user. + /// The address for which geolocation should be + /// fetched. + /// Geo location for the address. + public GeoLocation GetLocationForAddress(AdWordsUser user, Address address) { + GeoLocationService geoService = + (GeoLocationService) user.GetService(AdWordsService.v201309.GeoLocationService); + + GeoLocationSelector selector = new GeoLocationSelector(); + selector.addresses = new Address[] {address}; + return geoService.get(selector)[0]; + } + + /// + /// Gets the current timestamp. + /// + /// The timestamp as a string. + public string GetTimeStamp() { + return (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalMilliseconds.ToString(); + } + } +} diff --git a/tests/AdWords/v201309/VersionedExampleTestsBase.cs b/tests/AdWords/v201309/VersionedExampleTestsBase.cs new file mode 100644 index 00000000000..565f25160de --- /dev/null +++ b/tests/AdWords/v201309/VersionedExampleTestsBase.cs @@ -0,0 +1,35 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Base class for code examples that adds version-specific features. + /// + class VersionedExampleTestsBase : ExampleTestsBase { + /// + /// Test utilities instance for support functionality when running tests. + /// + protected TestUtils utils = new TestUtils(); + + /// + /// Default public constructor. + /// + public VersionedExampleTestsBase() : base() { + } + } +} diff --git a/tests/AdWords/v201402/AccountManagementTest.cs b/tests/AdWords/v201402/AccountManagementTest.cs new file mode 100644 index 00000000000..8477f4cefd2 --- /dev/null +++ b/tests/AdWords/v201402/AccountManagementTest.cs @@ -0,0 +1,113 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; +using Google.Api.Ads.Common.Tests; +using Google.Api.Ads.Common.Util; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; +using System.Threading; +using System.Xml; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201402; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201402; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Test cases for all the code examples under v201402\AccountManagement. + /// + class AccountManagementTest : VersionedExampleTestsBase { + /// + /// Tests the GetAccountAlerts VB.NET code example. + /// + [Test] + public void TestGetAccountAlertsVBExample() { + ExamplesMockData mockData = LoadMockData(SoapMessages_v201402.GetAccountAlerts); + RunMockedExample(mockData, delegate() { + new VBExamples.GetAccountAlerts().Run(user); + }, new WebRequestInterceptor.OnBeforeSendResponse(VerifyGetAccountAlertsRequest)); + } + + /// + /// Tests the GetAccountAlerts C# code example. + /// + [Test] + public void TestGetAccountAlertsCSharpExample() { + ExamplesMockData mockData = LoadMockData(SoapMessages_v201402.GetAccountAlerts); + RunMockedExample(mockData, delegate() { + new CSharpExamples.GetAccountAlerts().Run(user); + }, new WebRequestInterceptor.OnBeforeSendResponse(VerifyGetAccountAlertsRequest)); + } + + /// + /// Verifies whether GetAccountAlerts is serializing the request correctly. + /// + /// The request URI. + /// The headers. + /// The body. + private void VerifyGetAccountAlertsRequest(Uri requestUri, WebHeaderCollection headers, + string body) { + XmlDocument doc = new XmlDocument(); + doc.LoadXml(body); + XmlElement node = (XmlElement) doc.GetElementsByTagName("selector")[0]; + AlertSelector selector = + (AlertSelector) SerializationUtilities.DeserializeFromXmlTextCustomRootNs( + node.OuterXml, typeof(AlertSelector), + "https://adwords.google.com/api/adwords/mcm/v201402", "selector"); + + Assert.AreEqual(selector.query.filterSpec, FilterSpec.ALL); + Assert.AreEqual(selector.query.clientSpec, ClientSpec.ALL); + Assert.AreEqual(selector.query.triggerTimeSpec, TriggerTimeSpec.ALL_TIME); + Assert.Contains(AlertSeverity.GREEN, selector.query.severities); + Assert.Contains(AlertSeverity.YELLOW, selector.query.severities); + Assert.Contains(AlertSeverity.RED, selector.query.severities); + + foreach (AlertType alertType in Enum.GetValues(typeof(AlertType))) { + Assert.Contains(alertType, selector.query.types); + } + + Assert.AreEqual(selector.paging.startIndex, 0); + Assert.AreEqual(selector.paging.numberResults, 500); + } + + /// + /// Tests the GetAccountChanges VB.NET code example. + /// + [Test] + public void TestGetAccountChangesVBExample() { + RunExample(delegate() { + new VBExamples.GetAccountChanges().Run(user); + }); + } + + /// + /// Tests the GetAccountChanges C# code example. + /// + [Test] + public void TestGetAccountChangesCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAccountChanges().Run(user); + }); + } + } +} diff --git a/tests/AdWords/v201402/AdvancedOperationsTest.cs b/tests/AdWords/v201402/AdvancedOperationsTest.cs new file mode 100644 index 00000000000..e6e769d8333 --- /dev/null +++ b/tests/AdWords/v201402/AdvancedOperationsTest.cs @@ -0,0 +1,166 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.v201402; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201402; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201402; +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.Common.Lib; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Test cases for all the code examples under v201402\AdvancedOperations. + /// + class AdvancedOperationsTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + const double BID_MODIFIER = 0.2; + string placesAccessToken = ""; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateSearchCampaign(user, BiddingStrategyType.MANUAL_CPC); + adGroupId = utils.CreateAdGroup(user, campaignId); + + // Load defaults from config file. + AdWordsAppConfig appConfig = new AdWordsAppConfig(); + appConfig.OAuth2RefreshToken = appConfig.PlacesOAuth2RefreshToken; + + AdsOAuthProviderForApplications oAuth2Provider = new OAuth2ProviderForApplications(appConfig); + oAuth2Provider.RefreshAccessToken(); + + placesAccessToken = oAuth2Provider.AccessToken; + } + + /// + /// Tests the AddClickToDownloadAd VB.NET code example. + /// + [Test] + public void TestAddClickToDownloadAdVBExample() { + RunExample(delegate() { + new VBExamples.AddClickToDownloadAd().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddClickToDownloadAd C# code example. + /// + [Test] + public void TestAddClickToDownloadAdCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddClickToDownloadAd().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddSiteLinks VB.NET code example. + /// + [Test] + public void TestAddSiteLinksVBExample() { + RunExample(delegate() { + new VBExamples.AddSiteLinks().Run(user, campaignId); + }); + } + + /// + /// Tests the AddSiteLinks C# code example. + /// + [Test] + public void TestAddSiteLinksCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddSiteLinks().Run(user, campaignId); + }); + } + + /// + /// Tests the AddAdGroupBidModifier C# code example. + /// + [Test] + public void TestAddAdGroupBidModifierCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddAdGroupBidModifier().Run(user, adGroupId, BID_MODIFIER); + }); + } + + /// + /// Tests the AddAdGroupBidModifier VB.NET code example. + /// + [Test] + public void TestAddAdGroupBidModifierVBExample() { + RunExample(delegate() { + new VBExamples.AddAdGroupBidModifier().Run(user, adGroupId, BID_MODIFIER); + }); + } + + /// + /// Tests the GetAdGroupBidModifiers C# code example. + /// + [Test] + public void TestGetAdGroupBidModifiersCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAdGroupBidModifiers().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAdGroupBidModifiers VB.NET code example. + /// + [Test] + public void TestGetAdGroupBidModifiersVBExample() { + RunExample(delegate() { + new VBExamples.GetAdGroupBidModifiers().Run(user, campaignId); + }); + } + + /// + /// Tests the AddPlacesLocationExtension C# code example. + /// + [Test] + public void TestAddPlacesLocationExtensionCSharpExample() { + AdWordsAppConfig config = (AdWordsAppConfig) user.Config; + + RunExample(delegate() { + new CSharpExamples.AddPlacesLocationExtension().Run(user, config.PlacesLoginEmail, + placesAccessToken); + }); + } + + /// + /// Tests the AddPlacesLocationExtension VB.NET code example. + /// + [Test] + public void TestAddPlacesLocationExtensionVBExample() { + AdWordsAppConfig config = (AdWordsAppConfig) user.Config; + + RunExample(delegate() { + new VBExamples.AddPlacesLocationExtension().Run(user, config.PlacesLoginEmail, + placesAccessToken); + }); + } + } +} diff --git a/tests/AdWords/v201402/BasicOperationsTest.cs b/tests/AdWords/v201402/BasicOperationsTest.cs new file mode 100644 index 00000000000..696a3802974 --- /dev/null +++ b/tests/AdWords/v201402/BasicOperationsTest.cs @@ -0,0 +1,371 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.v201402; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201402; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201402; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Test cases for all the code examples under v201402\BasicOperations. + /// + class BasicOperationsTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + long adId; + long keywordId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateSearchCampaign(user, BiddingStrategyType.MANUAL_CPC); + adGroupId = utils.CreateAdGroup(user, campaignId); + adId = utils.CreateTextAd(user, adGroupId, false); + keywordId = utils.CreateKeyword(user, adGroupId); + } + + /// + /// Tests the AddAdGroup VB.NET code example. + /// + [Test] + public void TestAddAdGroupVBExample() { + RunExample(delegate() { + new VBExamples.AddAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the AddAdGroup C# code example. + /// + [Test] + public void TestAddAdGroupCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the AddCampaign VB.NET code example. + /// + [Test] + public void TestAddCampaignVBExample() { + RunExample(delegate() { + new VBExamples.AddCampaigns().Run(user); + }); + } + + /// + /// Tests the AddCampaign C# code example. + /// + [Test] + public void TestAddCampaignCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddCampaigns().Run(user); + }); + } + + /// + /// Tests the AddKeywords VB.NET code example. + /// + [Test] + public void TestAddKeywordsVBExample() { + RunExample(delegate() { + new VBExamples.AddKeywords().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddKeywords C# code example. + /// + [Test] + public void TestAddKeywordsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddKeywords().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddTextAds VB.NET code example. + /// + [Test] + public void TestAddTextAdsVBExample() { + RunExample(delegate() { + new VBExamples.AddTextAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddTextAds C# code example. + /// + [Test] + public void TestAddTextAdsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddTextAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the DeleteAdGroup VB.NET code example. + /// + [Test] + public void TestDeleteAdGroupVBExample() { + RunExample(delegate() { + new VBExamples.DeleteAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the DeleteAdGroup C# code example. + /// + [Test] + public void TestDeleteAdGroupCSharpExample() { + RunExample(delegate() { + new VBExamples.DeleteAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the DeleteAd VB.NET code example. + /// + [Test] + public void TestDeleteAdVBExample() { + RunExample(delegate() { + new VBExamples.DeleteAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the DeleteAd C# code example. + /// + [Test] + public void TestDeleteAdCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DeleteAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the DeleteCampaign VB.NET code example. + /// + [Test] + public void TestDeleteCampaignVBExample() { + RunExample(delegate() { + new VBExamples.DeleteCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the DeleteCampaign C# code example. + /// + [Test] + public void TestDeleteCampaignCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DeleteCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the DeleteKeyword VB.NET code example. + /// + [Test] + public void TestDeleteKeywordVBExample() { + RunExample(delegate() { + new VBExamples.DeleteKeyword().Run(user, adGroupId, keywordId); + }); + } + + /// + /// Tests the DeleteKeyword C# code example. + /// + [Test] + public void TestDeleteKeywordCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DeleteKeyword().Run(user, adGroupId, keywordId); + }); + } + + /// + /// Tests the GetAdGroups VB.NET code example. + /// + [Test] + public void TestGetAdGroupsVBExample() { + RunExample(delegate() { + new VBExamples.GetAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAdGroups C# code example. + /// + [Test] + public void TestGetAdGroupsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the GetCampaigns VB.NET code example. + /// + [Test] + public void TestGetCampaignsVBExample() { + RunExample(delegate() { + new VBExamples.GetCampaigns().Run(user); + }); + } + + /// + /// Tests the GetCampaigns C# code example. + /// + [Test] + public void TestGetCampaignsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetCampaigns().Run(user); + }); + } + + /// + /// Tests the GetKeywords VB.NET code example. + /// + [Test] + public void TestGetKeywordsVBExample() { + RunExample(delegate() { + new VBExamples.GetKeywords().Run(user); + }); + } + + /// + /// Tests the GetKeywords C# code example. + /// + [Test] + public void TestGetKeywordsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetKeywords().Run(user); + }); + } + + /// + /// Tests the GetTextAds VB.NET code example. + /// + [Test] + public void TestGetTextAdsVBExample() { + RunExample(delegate() { + new VBExamples.GetTextAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the GetTextAds C# code example. + /// + [Test] + public void TestGetTextAdsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetTextAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the PauseAd VB.NET code example. + /// + [Test] + public void TestPauseAdVBExample() { + RunExample(delegate() { + new VBExamples.PauseAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the PauseAd C# code example. + /// + [Test] + public void TestPauseAdCSharpExample() { + RunExample(delegate() { + new CSharpExamples.PauseAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the UpdateAdGroup VB.NET code example. + /// + [Test] + public void TestUpdateAdGroupVBExample() { + RunExample(delegate() { + new VBExamples.UpdateAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the UpdateAdGroup C# code example. + /// + [Test] + public void TestUpdateAdGroupCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UpdateAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the UpdateCampaign VB.NET code example. + /// + [Test] + public void TestUpdateCampaignVBExample() { + RunExample(delegate() { + new VBExamples.UpdateCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the UpdateCampaign C# code example. + /// + [Test] + public void TestUpdateCampaignCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UpdateCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the UpdateKeyword VB.NET code example. + /// + [Test] + public void TestUpdateKeywordVBExample() { + RunExample(delegate() { + new VBExamples.UpdateKeyword().Run(user, adGroupId, keywordId); + }); + } + + /// + /// Tests the UpdateKeyword C# code example. + /// + [Test] + public void TestUpdateKeywordCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UpdateKeyword().Run(user, adGroupId, keywordId); + }); + } + } +} diff --git a/tests/AdWords/v201402/CampaignManagementTest.cs b/tests/AdWords/v201402/CampaignManagementTest.cs new file mode 100644 index 00000000000..52524869dd0 --- /dev/null +++ b/tests/AdWords/v201402/CampaignManagementTest.cs @@ -0,0 +1,229 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201402; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201402; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Test cases for all the code examples under v201402\CampaignManagement. + /// + class CampaignManagementTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + long criterionId; + long adId; + long locationExtensionId; + + const Double BID_MODIFIER = 1.5; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateSearchCampaign(user, BiddingStrategyType.MANUAL_CPC); + adGroupId = utils.CreateAdGroup(user, campaignId); + criterionId = utils.CreateKeyword(user, adGroupId); + adId = utils.CreateTextAd(user, adGroupId, false); + locationExtensionId = utils.CreateLocationExtension(user, campaignId); + } + + /// + /// Tests the AddExperiment VB.NET code example. + /// + [Test] + public void TestAddExperimentVBExample() { + RunExample(delegate() { + new VBExamples.AddExperiment().Run(user, campaignId, adGroupId, criterionId); + }); + } + + /// + /// Tests the AddExperiment C# code example. + /// + [Test] + public void TestAddExperimentCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddExperiment().Run(user, campaignId, adGroupId, criterionId); + }); + } + + /// + /// Tests the AddKeywordsInBulk VB.NET code example. + /// + [Test] + public void TestAddKeywordsInBulkVBExample() { + RunExample(delegate() { + new VBExamples.AddKeywordsInBulk().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddKeywordsInBulk C# code example. + /// + [Test] + public void TestAddKeywordsInBulkCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddKeywordsInBulk().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddLocationExtension VB.NET code example. + /// + [Test] + public void TestAddLocationExtensionVBExample() { + RunExample(delegate() { + new VBExamples.AddLocationExtension().Run(user, campaignId); + }); + } + + /// + /// Tests the AddLocationExtension C# code example. + /// + [Test] + public void TestAddLocationExtensionCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddLocationExtension().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAllDisapprovedAds VB.NET code example. + /// + [Test] + public void TestGetAllDisapprovedAdsVBExample() { + RunExample(delegate() { + new VBExamples.GetAllDisapprovedAds().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAllDisapprovedAds C# code example. + /// + [Test] + public void TestGetAllDisapprovedAdsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAllDisapprovedAds().Run(user, campaignId); + }); + } + + /// + /// Tests the PromoteExperiment VB.NET code example. + /// + [Test] + public void TestPromoteExperimentVBExample() { + long experimentId = CreateExperimentForPromotion(); + RunExample(delegate() { + new VBExamples.PromoteExperiment().Run(user, experimentId); + }); + } + + /// + /// Tests the PromoteExperiment C# code example. + /// + [Test] + public void TestPromoteExperimentCSharpExample() { + long experimentId = CreateExperimentForPromotion(); + RunExample(delegate() { + new CSharpExamples.PromoteExperiment().Run(user, experimentId); + }); + } + + /// + /// Tests the SetAdParameters VB.NET code example. + /// + [Test] + public void TestSetAdParametersVBExample() { + RunExample(delegate() { + new VBExamples.SetAdParameters().Run(user, adGroupId, criterionId); + }); + } + + /// + /// Tests the SetAdParameters C# code example. + /// + [Test] + public void TestSetAdParametersCSharpExample() { + RunExample(delegate() { + new CSharpExamples.SetAdParameters().Run(user, adGroupId, criterionId); + }); + } + + /// + /// Tests the ValidateTextAd VB.NET code example. + /// + [Test] + public void TestValidateTextAdVBExample() { + RunExample(delegate() { + new VBExamples.ValidateTextAd().Run(user, adGroupId); + }); + } + + /// + /// Tests the ValidateTextAd C# code example. + /// + [Test] + public void TestValidateTextAdCSharpExample() { + RunExample(delegate() { + new CSharpExamples.ValidateTextAd().Run(user, adGroupId); + }); + } + + /// + /// Tests the SetBidModifier C# code example. + /// + [Test] + public void TestSetBidModifierCSharpExample() { + RunExample(delegate() { + new CSharpExamples.SetBidModifier().Run(user, campaignId, BID_MODIFIER); + }); + } + + /// + /// Tests the SetBidModifier VB.NET code example. + /// + [Test] + public void TestSetBidModifierVBExample() { + RunExample(delegate() { + new VBExamples.SetBidModifier().Run(user, campaignId, BID_MODIFIER); + }); + } + + /// + /// Create an experiment for promotion. + /// + /// Experiment id for promotion. + /// This code cannot be added in Init(), since there can be only + /// one experiment per campaign, and if we add this to Init(), then + /// AddExperiment tests will fail. + private long CreateExperimentForPromotion() { + return utils.AddExperiment(user, campaignId, adGroupId, criterionId); + } + } +} diff --git a/tests/AdWords/v201402/ErrorHandlingTest.cs b/tests/AdWords/v201402/ErrorHandlingTest.cs new file mode 100644 index 00000000000..423aeda38f3 --- /dev/null +++ b/tests/AdWords/v201402/ErrorHandlingTest.cs @@ -0,0 +1,88 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201402; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201402; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Test cases for all the code examples under v201402\ErrorHandling. + /// + class ErrorHandlingTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateSearchCampaign(user, BiddingStrategyType.MANUAL_CPC); + adGroupId = utils.CreateAdGroup(user, campaignId); + } + + /// + /// Tests the HandlePartialFailures VB.NET code example. + /// + [Test] + public void TestHandlePartialFailuresVBExample() { + RunExample(delegate() { + new VBExamples.HandlePartialFailures().Run(user, adGroupId); + }); + } + + /// + /// Tests the HandlePartialFailures C# code example. + /// + [Test] + public void TestHandlePartialFailuresCSharpExample() { + RunExample(delegate() { + new CSharpExamples.HandlePartialFailures().Run(user, adGroupId); + }); + } + + /// + /// Tests the HandlePolicyViolationError VB.NET code example. + /// + [Test] + public void TestHandlePolicyViolationErrorVBExample() { + RunExample(delegate() { + new VBExamples.HandlePolicyViolationError().Run(user, adGroupId); + }); + } + + /// + /// Tests the HandlePolicyViolationError C# code example. + /// + [Test] + public void TestHandlePolicyViolationErrorCSharpExample() { + RunExample(delegate() { + new CSharpExamples.HandlePolicyViolationError().Run(user, adGroupId); + }); + } + } +} diff --git a/tests/AdWords/v201402/MiscellaneousTest.cs b/tests/AdWords/v201402/MiscellaneousTest.cs new file mode 100644 index 00000000000..fa2dd0ae72d --- /dev/null +++ b/tests/AdWords/v201402/MiscellaneousTest.cs @@ -0,0 +1,83 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201402; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201402; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Test cases for all the code examples under v201402\Miscellaneous. + /// + class MiscellaneousTest : VersionedExampleTestsBase { + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + } + + /// + /// Tests the GetAllVideosAndImages VB.NET code example. + /// + [Test] + public void TestGetAllVideosAndImagesVBExample() { + RunExample(delegate() { + new VBExamples.GetAllVideosAndImages().Run(user); + }); + } + + /// + /// Tests the GetAllVideosAndImages C# code example. + /// + [Test] + public void TestGetAllVideosAndImagesCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAllVideosAndImages().Run(user); + }); + } + + /// + /// Tests the UploadImage VB.NET code example. + /// + [Test] + public void TestUploadImageVBExample() { + RunExample(delegate() { + new VBExamples.UploadImage().Run(user); + }); + } + + /// + /// Tests the UploadImage C# code example. + /// + [Test] + public void TestUploadImageCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UploadImage().Run(user); + }); + } + } +} diff --git a/tests/AdWords/v201402/OptimizationTest.cs b/tests/AdWords/v201402/OptimizationTest.cs new file mode 100644 index 00000000000..f07c994a5a3 --- /dev/null +++ b/tests/AdWords/v201402/OptimizationTest.cs @@ -0,0 +1,130 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201402; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201402; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Test cases for all the code examples under v201402\Optimization. + /// + class OptimizationTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + long keywordId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateSearchCampaign(user, BiddingStrategyType.MANUAL_CPC); + adGroupId = utils.CreateAdGroup(user, campaignId); + keywordId = utils.CreateKeyword(user, adGroupId); + } + + /// + /// Tests the EstimateKeywordTraffic VB.NET code example. + /// + [Test] + public void TestEstimateKeywordTrafficVBExample() { + RunExample(delegate() { + new VBExamples.EstimateKeywordTraffic().Run(user); + }); + } + + /// + /// Tests the EstimateKeywordTraffic C# code example. + /// + [Test] + public void TestEstimateKeywordTrafficCSharpExample() { + RunExample(delegate() { + new CSharpExamples.EstimateKeywordTraffic().Run(user); + }); + } + + /// + /// Tests the GetAdGroupBidSimulations VB.NET code example. + /// + [Test] + public void TestGetAdGroupBidSimulationsVBExample() { + RunExample(delegate() { + new VBExamples.GetAdGroupBidSimulations().Run(user, adGroupId); + }); + } + + /// + /// Tests the GetAdGroupBidSimulations C# code example. + /// + [Test] + public void TestGetAdGroupBidSimulationsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAdGroupBidSimulations().Run(user, adGroupId); + }); + } + + /// + /// Tests the GetKeywordBidSimulations VB.NET code example. + /// + [Test] + public void TestGetKeywordBidSimulationsVBExample() { + RunExample(delegate() { + new VBExamples.GetKeywordBidSimulations().Run(user, adGroupId, keywordId); + }); + } + + /// + /// Tests the GetKeywordBidSimulations C# code example. + /// + [Test] + public void TestGetKeywordBidSimulationsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetKeywordBidSimulations().Run(user, adGroupId, keywordId); + }); + } + + /// + /// Tests the GetPlacementIdeas VB.NET code example. + /// + [Test] + public void TestGetPlacementIdeasVBExample() { + RunExample(delegate() { + new VBExamples.GetPlacementIdeas().Run(user); + }); + } + + /// + /// Tests the GetPlacementIdeas C# code example. + /// + [Test] + public void TestGetPlacementIdeasCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetPlacementIdeas().Run(user); + }); + } + } +} diff --git a/tests/AdWords/v201402/RemarketingTest.cs b/tests/AdWords/v201402/RemarketingTest.cs new file mode 100644 index 00000000000..ecd04a94459 --- /dev/null +++ b/tests/AdWords/v201402/RemarketingTest.cs @@ -0,0 +1,84 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201402; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201402; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Test cases for all the code examples under + /// v201402\AudienceAndConversionManagement. + /// + class RemarketingTest : VersionedExampleTestsBase { + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + } + + /// + /// Tests the AddAudience VB.NET code example. + /// + [Test] + public void TestAddAudienceVBExample() { + RunExample(delegate() { + new VBExamples.AddAudience().Run(user); + }); + } + + /// + /// Tests the AddAudience C# code example. + /// + [Test] + public void TestAddAudienceCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddAudience().Run(user); + }); + } + + /// + /// Tests the AddConversionTracker VB.NET code example. + /// + [Test] + public void TestAddConversionTrackerVBExample() { + RunExample(delegate() { + new VBExamples.AddConversionTracker().Run(user); + }); + } + + /// + /// Tests the AddConversionTracker C# code example. + /// + [Test] + public void TestAddConversionTrackerCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddConversionTracker().Run(user); + }); + } + } +} diff --git a/tests/AdWords/v201402/ReportingTest.cs b/tests/AdWords/v201402/ReportingTest.cs new file mode 100644 index 00000000000..4f6b60972eb --- /dev/null +++ b/tests/AdWords/v201402/ReportingTest.cs @@ -0,0 +1,87 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.v201402; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201402; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201402; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Test cases for all the code examples under v201402\Reporting. + /// + class ReportingTest : VersionedExampleTestsBase { + string outputFileName; + ReportDefinitionReportType reportType; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + outputFileName = Path.GetFileName(Path.GetTempFileName()); + reportType = ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT; + } + + /// + /// Tests the DownloadCriteriaReport VB.NET code example. + /// + [Test] + public void TestDownloadCriteriaReportVBExample() { + RunExample(delegate() { + new VBExamples.DownloadCriteriaReport().Run(user, outputFileName); + }); + } + + /// + /// Tests the DownloadCriteriaReport C# code example. + /// + [Test] + public void TestDownloadCriteriaReportCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DownloadCriteriaReport().Run(user, outputFileName); + }); + } + + /// + /// Tests the GetReportFields VB.NET code example. + /// + [Test] + public void TestGetReportFieldsVBExample() { + RunExample(delegate() { + new VBExamples.GetReportFields().Run(user, reportType); + }); + } + + /// + /// Tests the GetReportFields C# code example. + /// + [Test] + public void TestGetReportFieldsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetReportFields().Run(user, reportType); + }); + } + } +} diff --git a/tests/AdWords/v201402/ShoppingCampaignsTest.cs b/tests/AdWords/v201402/ShoppingCampaignsTest.cs new file mode 100644 index 00000000000..f919b647bf1 --- /dev/null +++ b/tests/AdWords/v201402/ShoppingCampaignsTest.cs @@ -0,0 +1,147 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using NUnit.Framework; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201402; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201402; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + + /// + /// Test cases for all the code examples under v201402\ShoppingCampaigns. + /// + internal class ShoppingCampaignsTest : VersionedExampleTestsBase { + private long adGroupId; + private long budgetId; + private long campaignId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + budgetId = utils.CreateBudget(user); + campaignId = utils.CreateShoppingCampaign(user, BiddingStrategyType.MANUAL_CPC); + adGroupId = utils.CreateAdGroup(user, campaignId); + } + + /// + /// Tests the AddProductPartitionTree C# code example. + /// + [Test] + public void TestAddProductPartitionTreeCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddProductPartitionTree().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddProductPartitionTree VB.NET code example. + /// + [Test] + public void TestAddProductPartitionTreeVBExample() { + RunExample(delegate() { + new VBExamples.AddProductPartitionTree().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddProductScope C# code example. + /// + [Test] + public void TestAddProductScopeCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddProductScope().Run(user, campaignId); + }); + } + + /// + /// Tests the AddProductScope VB.NET code example. + /// + [Test] + public void TestAddProductScopeVBExample() { + RunExample(delegate() { + new VBExamples.AddProductScope().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAccountChanges C# code example. + /// + [Test] + public void TestAddShoppingCampaignCSharpExample() { + AdWordsAppConfig config = (AdWordsAppConfig) user.Config; + RunExample(delegate() { + new CSharpExamples.AddShoppingCampaign().Run(user, budgetId, config.MerchantCenterId); + }); + } + + /// + /// Tests the GetAccountChanges VB.NET code example. + /// + [Test] + public void TestAddShoppingCampaignVBExample() { + AdWordsAppConfig config = (AdWordsAppConfig) user.Config; + RunExample(delegate() { + new VBExamples.AddShoppingCampaign().Run(user, budgetId, config.MerchantCenterId); + }); + } + + /// + /// Tests the GetProductCategoryTaxonomy C# code example. + /// + [Test] + public void TestGetProductCategoryTaxonomyCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetProductCategoryTaxonomy().Run(user); + }); + } + + /// + /// Tests the GetProductCategoryTaxonomy VB.NET code example. + /// + [Test] + public void TestGetProductCategoryTaxonomyVBExample() { + RunExample(delegate() { + new VBExamples.GetProductCategoryTaxonomy().Run(user); + }); + } + + /// + /// Tests the SetProductSalesChannel C# code example. + /// + [Test] + public void TestSetProductSalesChannelCSharpExample() { + RunExample(delegate() { + new CSharpExamples.SetProductSalesChannel().Run(user, campaignId); + }); + } + + /// + /// Tests the SetProductSalesChannel VB.NET code example. + /// + [Test] + public void TestSetProductSalesChannelVBExample() { + RunExample(delegate() { + new VBExamples.SetProductSalesChannel().Run(user, campaignId); + }); + } + } +} diff --git a/tests/AdWords/v201402/TargetingTest.cs b/tests/AdWords/v201402/TargetingTest.cs new file mode 100644 index 00000000000..991373c963c --- /dev/null +++ b/tests/AdWords/v201402/TargetingTest.cs @@ -0,0 +1,128 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201402; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201402; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Test cases for all the code examples under v201402\Targeting. + /// + class TargetingTest : VersionedExampleTestsBase { + long campaignId; + long campaignCriterionId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateSearchCampaign(user, BiddingStrategyType.MANUAL_CPC); + campaignCriterionId = utils.AddCampaignTargetingCriteria(user, campaignId); + } + + /// + /// Tests the AddCampaignTargetingCriteria VB.NET code example. + /// + [Test] + public void TestAddCampaignTargetingCriteriaVBExample() { + RunExample(delegate() { + new VBExamples.AddCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the AddCampaignTargetingCriteria C# code example. + /// + [Test] + public void TestAddCampaignTargetingCriteriaCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the GetCampaignTargetingCriteria VB.NET code example. + /// + [Test] + public void TestGetCampaignTargetingCriteriaVBExample() { + RunExample(delegate() { + new VBExamples.GetCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the GetCampaignTargetingCriteria C# code example. + /// + [Test] + public void TestGetCampaignTargetingCriteriaCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the GetTargetableLanguagesAndCarriers VB.NET code example. + /// + [Test] + public void TestGetTargetableLanguagesAndCarriersVBExample() { + RunExample(delegate() { + new VBExamples.GetTargetableLanguagesAndCarriers().Run(user); + }); + } + + /// + /// Tests the GetTargetableLanguagesAndCarriers C# code example. + /// + [Test] + public void TestGetTargetableLanguagesAndCarriersCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetTargetableLanguagesAndCarriers().Run(user); + }); + } + + /// + /// Tests the LookupLocation VB.NET code example. + /// + [Test] + public void TestLookupLocationVBExample() { + RunExample(delegate() { + new VBExamples.LookupLocation().Run(user); + }); + } + + /// + /// Tests the LookupLocation C# code example. + /// + [Test] + public void TestLookupLocationCSharpExample() { + RunExample(delegate() { + new CSharpExamples.LookupLocation().Run(user); + }); + } + } +} diff --git a/tests/AdWords/v201402/TestUtils.cs b/tests/AdWords/v201402/TestUtils.cs new file mode 100644 index 00000000000..2d3408a3925 --- /dev/null +++ b/tests/AdWords/v201402/TestUtils.cs @@ -0,0 +1,493 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util.v201402; +using Google.Api.Ads.AdWords.v201402; +using Google.Api.Ads.Common.Util; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// A utility class to assist the testing of v201402 services. + /// + class TestUtils { + + public long CreateBudget(AdWordsUser user) { + BudgetService budgetService = + (BudgetService) user.GetService(AdWordsService.v201402.BudgetService); + + // Create the campaign budget. + Budget budget = new Budget(); + budget.name = "Interplanetary Cruise Budget #" + DateTime.Now.ToString("yyyy-M-d H:m:s.ffffff"); + budget.period = BudgetBudgetPeriod.DAILY; + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + budget.amount = new Money(); + budget.amount.microAmount = 500000; + + BudgetOperation budgetOperation = new BudgetOperation(); + budgetOperation.@operator = Operator.ADD; + budgetOperation.operand = budget; + + BudgetReturnValue budgetRetval = budgetService.mutate(new BudgetOperation[] { budgetOperation }); + return budgetRetval.value[0].budgetId; + } + + /// + /// Creates a test search campaign for running further tests. + /// + /// The user. + /// The bidding strategy to be used. + /// The campaign id. + public long CreateSearchCampaign(AdWordsUser user, BiddingStrategyType strategyType) { + return CreateCampaign(user, AdvertisingChannelType.SEARCH, strategyType); + } + + /// + /// Creates a display campaign for running further tests. + /// + /// The user. + /// The bidding strategy to be used. + /// The campaign id. + public long CreateDisplayCampaign(AdWordsUser user, BiddingStrategyType strategyType) { + return CreateCampaign(user, AdvertisingChannelType.DISPLAY, strategyType); + } + + /// + /// Creates a test shopping campaign for running further tests. + /// + /// The user. + /// The bidding strategy to be used. + /// The campaign id. + public long CreateShoppingCampaign(AdWordsUser user, BiddingStrategyType strategyType) { + return CreateCampaign(user, AdvertisingChannelType.SHOPPING, strategyType); + } + + /// + /// Creates a test campaign for running further tests. + /// + /// The AdWords user. + /// The bidding strategy to be used. + /// The campaign id. + public long CreateCampaign(AdWordsUser user, AdvertisingChannelType channelType, + BiddingStrategyType strategyType) { + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201402.CampaignService); + + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + biddingConfig.biddingStrategyType = strategyType; + + CampaignOperation campaignOperation = new CampaignOperation(); + campaignOperation.@operator = Operator.ADD; + campaignOperation.operand = new Campaign(); + campaignOperation.operand.name = + string.Format("Campaign {0}", DateTime.Now.ToString("yyyy-M-d H:m:s.ffffff")); + campaignOperation.operand.advertisingChannelType = channelType; + campaignOperation.operand.status = CampaignStatus.PAUSED; + campaignOperation.operand.biddingStrategyConfiguration = biddingConfig; + campaignOperation.operand.budget = new Budget(); + campaignOperation.operand.budget.budgetId = CreateBudget(user); + campaignOperation.operand.budget.period = BudgetBudgetPeriod.DAILY; + campaignOperation.operand.budget.amount = new Money(); + campaignOperation.operand.budget.amount.microAmount = 100000000; + campaignOperation.operand.budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + + List settings = new List(); + KeywordMatchSetting matchSetting = new KeywordMatchSetting(); + matchSetting.optIn = true; + settings.Add(matchSetting); + + if (channelType == AdvertisingChannelType.SHOPPING) { + // All Shopping campaigns need a ShoppingSetting. + ShoppingSetting shoppingSetting = new ShoppingSetting(); + shoppingSetting.salesCountry = "US"; + shoppingSetting.campaignPriority = 0; + shoppingSetting.merchantId = (user.Config as AdWordsAppConfig).MerchantCenterId; + + settings.Add(shoppingSetting); + } + campaignOperation.operand.settings = settings.ToArray(); + + CampaignReturnValue retVal = + campaignService.mutate(new CampaignOperation[] {campaignOperation}); + return retVal.value[0].id; + } + + /// + /// Creates a test adgroup for running further tests. + /// + /// The AdWords user. + /// The campaign id for which the adgroup is created. + /// The adgroup id. + public long CreateAdGroup(AdWordsUser user, long campaignId) { + return CreateAdGroup(user, campaignId, false); + } + + /// + /// Creates a test adgroup for running further tests. + /// + /// The AdWords user. + /// The campaign id for which the adgroup is created. + /// True, if a ManualCPM bid is to be used. + /// The adgroup id. + public long CreateAdGroup(AdWordsUser user, long campaignId, bool isCpmBid) { + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201402.AdGroupService); + + AdGroupOperation adGroupOperation = new AdGroupOperation(); + adGroupOperation.@operator = Operator.ADD; + adGroupOperation.operand = new AdGroup(); + adGroupOperation.operand.campaignId = campaignId; + adGroupOperation.operand.name = + string.Format("AdGroup {0}", DateTime.Now.ToString("yyyy-M-d H:m:s.ffffff")); + adGroupOperation.operand.status = AdGroupStatus.ENABLED; + + if (isCpmBid) { + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + CpmBid cpmBid = new CpmBid(); + cpmBid.bid = new Money(); + cpmBid.bid.microAmount = 10000000; + biddingConfig.bids = new Bids[] {cpmBid}; + adGroupOperation.operand.biddingStrategyConfiguration = biddingConfig; + } else { + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + CpcBid cpcBid = new CpcBid(); + cpcBid.bid = new Money(); + cpcBid.bid.microAmount = 10000000; + biddingConfig.bids = new Bids[] {cpcBid}; + adGroupOperation.operand.biddingStrategyConfiguration = biddingConfig; + } + AdGroupReturnValue retVal = adGroupService.mutate(new AdGroupOperation[] {adGroupOperation}); + return retVal.value[0].id; + } + + /// + /// Creates a test textad for running further tests. + /// + /// The AdWords user. + /// The adgroup id for which the ad is created. + /// + /// True, if an ad param placeholder should be + /// added. + /// The text ad id. + public long CreateTextAd(AdWordsUser user, long adGroupId, bool hasAdParam) { + AdGroupAdService adGroupAdService = + (AdGroupAdService) user.GetService(AdWordsService.v201402.AdGroupAdService); + AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation(); + adGroupAdOperation.@operator = Operator.ADD; + adGroupAdOperation.operand = new AdGroupAd(); + adGroupAdOperation.operand.adGroupId = adGroupId; + TextAd ad = new TextAd(); + + ad.headline = "Luxury Cruise to Mars"; + ad.description1 = "Visit the Red Planet in style."; + if (hasAdParam) { + ad.description2 = "Low-gravity fun for {param1:cheap}!"; + } else { + ad.description2 = "Low-gravity fun for everyone!"; + } + ad.displayUrl = "example.com"; + ad.url = "http://www.example.com"; + + adGroupAdOperation.operand.ad = ad; + + AdGroupAdReturnValue retVal = + adGroupAdService.mutate(new AdGroupAdOperation[] {adGroupAdOperation}); + return retVal.value[0].ad.id; + } + + /// + /// Creates a test ThirdPartyRedirectAd for running further tests. + /// + /// The AdWords user. + /// The adgroup id for which the ad is created. + /// + /// True, if an ad param placeholder should be + /// added. + /// The text ad id. + public long CreateThirdPartyRedirectAd(AdWordsUser user, long adGroupId) { + AdGroupAdService adGroupAdService = + (AdGroupAdService) user.GetService(AdWordsService.v201402.AdGroupAdService); + AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation(); + adGroupAdOperation.@operator = Operator.ADD; + adGroupAdOperation.operand = new AdGroupAd(); + adGroupAdOperation.operand.adGroupId = adGroupId; + + // Create the third party redirect ad. + ThirdPartyRedirectAd redirectAd = new ThirdPartyRedirectAd(); + redirectAd.name = string.Format("Example third party ad #{0}", this.GetTimeStamp()); + redirectAd.url = "http://www.example.com"; + + redirectAd.dimensions = new Dimensions(); + redirectAd.dimensions.height = 250; + redirectAd.dimensions.width = 300; + + // This field normally contains the javascript ad tag. + redirectAd.snippet = + ""; + redirectAd.impressionBeaconUrl = "http://www.examples.com/beacon"; + redirectAd.certifiedVendorFormatId = 119; + redirectAd.isCookieTargeted = false; + redirectAd.isUserInterestTargeted = false; + redirectAd.isTagged = false; + + adGroupAdOperation.operand.ad = redirectAd; + + AdGroupAdReturnValue retVal = + adGroupAdService.mutate(new AdGroupAdOperation[] {adGroupAdOperation}); + return retVal.value[0].ad.id; + } + + /// + /// Sets an adparam for running further tests. + /// + /// The AdWords user. + /// The adgroup id to which criterionId belongs. + /// + /// The criterion id to which adparam is set. + /// + public void SetAdParam(AdWordsUser user, long adGroupId, long criterionId) { + AdParamService adParamService = + (AdParamService) user.GetService(AdWordsService.v201402.AdParamService); + + // Prepare for setting ad parameters. + AdParam adParam = new AdParam(); + adParam.adGroupId = adGroupId; + adParam.criterionId = criterionId; + adParam.paramIndex = 1; + adParam.insertionText = "$100"; + + AdParamOperation adParamOperation = new AdParamOperation(); + adParamOperation.@operator = Operator.SET; + adParamOperation.operand = adParam; + + // Set ad parameters. + AdParam[] newAdParams = adParamService.mutate(new AdParamOperation[] {adParamOperation}); + return; + } + + /// + /// Creates a keyword for running further tests. + /// + /// The AdWords user. + /// The adgroup id for which the keyword is + /// created. + /// The keyword id. + public long CreateKeyword(AdWordsUser user, long adGroupId) { + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201402.AdGroupCriterionService); + + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.@operator = Operator.ADD; + operation.operand = new BiddableAdGroupCriterion(); + operation.operand.adGroupId = adGroupId; + + Keyword keyword = new Keyword(); + keyword.matchType = KeywordMatchType.BROAD; + keyword.text = "mars cruise"; + + operation.operand.criterion = keyword; + AdGroupCriterionReturnValue retVal = + adGroupCriterionService.mutate(new AdGroupCriterionOperation[] {operation}); + return retVal.value[0].criterion.id; + } + + /// + /// Creates the placement. + /// + /// The AdWords user. + /// The adgroup id for which the placement is + /// created. + /// The placement id. + public long CreatePlacement(AdWordsUser user, long adGroupId) { + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201402.AdGroupCriterionService); + + Placement placement = new Placement(); + placement.url = "http://mars.google.com"; + + AdGroupCriterion placementCriterion = new BiddableAdGroupCriterion(); + placementCriterion.adGroupId = adGroupId; + placementCriterion.criterion = placement; + + AdGroupCriterionOperation placementOperation = new AdGroupCriterionOperation(); + placementOperation.@operator = Operator.ADD; + placementOperation.operand = placementCriterion; + + AdGroupCriterionReturnValue retVal = adGroupCriterionService.mutate( + new AdGroupCriterionOperation[] {placementOperation}); + + return retVal.value[0].criterion.id; + } + + /// + /// Creates a campaign ad extension for running further tests. + /// + /// The AdWords user. + /// The campaign id for which extension is + /// created. + /// The campaign ad extension id. + public long CreateLocationExtension(AdWordsUser user, long campaignId) { + CampaignAdExtensionService campaignExtensionService = + (CampaignAdExtensionService) user.GetService(AdWordsService.v201402. + CampaignAdExtensionService); + + CampaignAdExtensionOperation operation = new CampaignAdExtensionOperation(); + operation.@operator = Operator.ADD; + + CampaignAdExtension extension = new CampaignAdExtension(); + extension.campaignId = campaignId; + extension.status = CampaignAdExtensionStatus.ACTIVE; + + Address address = new Address(); + address.streetAddress = "1600 Amphitheatre Pkwy, Mountain View"; + address.countryCode = "US"; + + GeoLocation location = GetLocationForAddress(user, address); + + LocationExtension locationExtension = new LocationExtension(); + + // Note: Do not populate an address directly. Instead, use + // GeoLocationService to obtain the location of an address, + // and use the address as per the location it returns. + locationExtension.address = location.address; + locationExtension.geoPoint = location.geoPoint; + locationExtension.encodedLocation = location.encodedLocation; + locationExtension.source = LocationExtensionSource.ADWORDS_FRONTEND; + + extension.adExtension = locationExtension; + operation.operand = extension; + CampaignAdExtensionReturnValue retVal = + campaignExtensionService.mutate(new CampaignAdExtensionOperation[] {operation}); + return retVal.value[0].adExtension.id; + } + + /// + /// Adds an experiment. + /// + /// The user. + /// The campaign id. + /// The ad group id. + /// The criterion id. + /// The experiment id. + public long AddExperiment(AdWordsUser user, long campaignId, long adGroupId, long criterionId) { + // Get the ExperimentService. + ExperimentService experimentService = + (ExperimentService) user.GetService(AdWordsService.v201402.ExperimentService); + + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201402.AdGroupService); + + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201402.AdGroupCriterionService); + + // Create the experiment. + Experiment experiment = new Experiment(); + experiment.campaignId = campaignId; + experiment.name = "Interplanetary Cruise #" + GetTimeStamp(); + experiment.queryPercentage = 10; + experiment.startDateTime = DateTime.Now.AddDays(1).ToString("yyyyMMdd HHmmss"); + + // Create the operation. + ExperimentOperation experimentOperation = new ExperimentOperation(); + experimentOperation.@operator = Operator.ADD; + experimentOperation.operand = experiment; + + // Add the experiment. + ExperimentReturnValue experimentRetVal = experimentService.mutate( + new ExperimentOperation[] {experimentOperation}); + + return experimentRetVal.value[0].id; + } + + /// + /// Adds the campaign targeting criteria to a campaign. + /// + /// The user. + /// The campaign id. + /// The campaign criteria id. + public long AddCampaignTargetingCriteria(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201402.CampaignCriterionService); + + // Create language criteria. + // See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + // for a detailed list of language codes. + Language language1 = new Language(); + language1.id = 1002; // French + CampaignCriterion languageCriterion1 = new CampaignCriterion(); + languageCriterion1.campaignId = campaignId; + languageCriterion1.criterion = language1; + + CampaignCriterion[] criteria = new CampaignCriterion[] {languageCriterion1}; + + List operations = new List(); + + foreach (CampaignCriterion criterion in criteria) { + CampaignCriterionOperation operation = new CampaignCriterionOperation(); + operation.@operator = Operator.ADD; + operation.operand = criterion; + operations.Add(operation); + } + + CampaignCriterionReturnValue retVal = campaignCriterionService.mutate(operations.ToArray()); + return retVal.value[0].criterion.id; + } + + /// + /// Returns an image which can be used for creating image ads. + /// + /// The image data, as an array of bytes. + public byte[] GetTestImage() { + return MediaUtilities.GetAssetDataFromUrl("http://goo.gl/HJM3L"); + } + + /// + /// Gets the geo location for a given address. + /// + /// The AdWords user. + /// The address for which geolocation should be + /// fetched. + /// Geo location for the address. + public GeoLocation GetLocationForAddress(AdWordsUser user, Address address) { + GeoLocationService geoService = + (GeoLocationService) user.GetService(AdWordsService.v201402.GeoLocationService); + + GeoLocationSelector selector = new GeoLocationSelector(); + selector.addresses = new Address[] {address}; + return geoService.get(selector)[0]; + } + + /// + /// Gets the current timestamp. + /// + /// The timestamp as a string. + public string GetTimeStamp() { + return (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalMilliseconds.ToString(); + } + } +} diff --git a/tests/AdWords/v201402/VersionedExampleTestsBase.cs b/tests/AdWords/v201402/VersionedExampleTestsBase.cs new file mode 100644 index 00000000000..a56a1276fdc --- /dev/null +++ b/tests/AdWords/v201402/VersionedExampleTestsBase.cs @@ -0,0 +1,35 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Base class for code examples that adds version-specific features. + /// + class VersionedExampleTestsBase : ExampleTestsBase { + /// + /// Test utilities instance for support functionality when running tests. + /// + protected TestUtils utils = new TestUtils(); + + /// + /// Default public constructor. + /// + public VersionedExampleTestsBase() : base() { + } + } +} diff --git a/tests/AdWords/v201406/AccountManagementTest.cs b/tests/AdWords/v201406/AccountManagementTest.cs new file mode 100644 index 00000000000..eb33634c70c --- /dev/null +++ b/tests/AdWords/v201406/AccountManagementTest.cs @@ -0,0 +1,113 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; +using Google.Api.Ads.Common.Tests; +using Google.Api.Ads.Common.Util; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; +using System.Threading; +using System.Xml; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201406; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201406; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Test cases for all the code examples under v201406\AccountManagement. + /// + class AccountManagementTest : VersionedExampleTestsBase { + /// + /// Tests the GetAccountAlerts VB.NET code example. + /// + [Test] + public void TestGetAccountAlertsVBExample() { + ExamplesMockData mockData = LoadMockData(SoapMessages_v201406.GetAccountAlerts); + RunMockedExample(mockData, delegate() { + new VBExamples.GetAccountAlerts().Run(user); + }, new WebRequestInterceptor.OnBeforeSendResponse(VerifyGetAccountAlertsRequest)); + } + + /// + /// Tests the GetAccountAlerts C# code example. + /// + [Test] + public void TestGetAccountAlertsCSharpExample() { + ExamplesMockData mockData = LoadMockData(SoapMessages_v201406.GetAccountAlerts); + RunMockedExample(mockData, delegate() { + new CSharpExamples.GetAccountAlerts().Run(user); + }, new WebRequestInterceptor.OnBeforeSendResponse(VerifyGetAccountAlertsRequest)); + } + + /// + /// Verifies whether GetAccountAlerts is serializing the request correctly. + /// + /// The request URI. + /// The headers. + /// The body. + private void VerifyGetAccountAlertsRequest(Uri requestUri, WebHeaderCollection headers, + string body) { + XmlDocument doc = new XmlDocument(); + doc.LoadXml(body); + XmlElement node = (XmlElement) doc.GetElementsByTagName("selector")[0]; + AlertSelector selector = + (AlertSelector) SerializationUtilities.DeserializeFromXmlTextCustomRootNs( + node.OuterXml, typeof(AlertSelector), + "https://adwords.google.com/api/adwords/mcm/v201406", "selector"); + + Assert.AreEqual(selector.query.filterSpec, FilterSpec.ALL); + Assert.AreEqual(selector.query.clientSpec, ClientSpec.ALL); + Assert.AreEqual(selector.query.triggerTimeSpec, TriggerTimeSpec.ALL_TIME); + Assert.Contains(AlertSeverity.GREEN, selector.query.severities); + Assert.Contains(AlertSeverity.YELLOW, selector.query.severities); + Assert.Contains(AlertSeverity.RED, selector.query.severities); + + foreach (AlertType alertType in Enum.GetValues(typeof(AlertType))) { + Assert.Contains(alertType, selector.query.types); + } + + Assert.AreEqual(selector.paging.startIndex, 0); + Assert.AreEqual(selector.paging.numberResults, 500); + } + + /// + /// Tests the GetAccountChanges VB.NET code example. + /// + [Test] + public void TestGetAccountChangesVBExample() { + RunExample(delegate() { + new VBExamples.GetAccountChanges().Run(user); + }); + } + + /// + /// Tests the GetAccountChanges C# code example. + /// + [Test] + public void TestGetAccountChangesCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAccountChanges().Run(user); + }); + } + } +} diff --git a/tests/AdWords/v201406/AdvancedOperationsTest.cs b/tests/AdWords/v201406/AdvancedOperationsTest.cs new file mode 100644 index 00000000000..5946fc793a8 --- /dev/null +++ b/tests/AdWords/v201406/AdvancedOperationsTest.cs @@ -0,0 +1,166 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.v201406; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201406; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201406; +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.Common.Lib; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Test cases for all the code examples under v201406\AdvancedOperations. + /// + class AdvancedOperationsTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + const double BID_MODIFIER = 0.2; + string placesAccessToken = ""; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateSearchCampaign(user, BiddingStrategyType.MANUAL_CPC); + adGroupId = utils.CreateAdGroup(user, campaignId); + + // Load defaults from config file. + AdWordsAppConfig appConfig = new AdWordsAppConfig(); + appConfig.OAuth2RefreshToken = appConfig.PlacesOAuth2RefreshToken; + + AdsOAuthProviderForApplications oAuth2Provider = new OAuth2ProviderForApplications(appConfig); + oAuth2Provider.RefreshAccessToken(); + + placesAccessToken = oAuth2Provider.AccessToken; + } + + /// + /// Tests the AddClickToDownloadAd VB.NET code example. + /// + [Test] + public void TestAddClickToDownloadAdVBExample() { + RunExample(delegate() { + new VBExamples.AddClickToDownloadAd().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddClickToDownloadAd C# code example. + /// + [Test] + public void TestAddClickToDownloadAdCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddClickToDownloadAd().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddSiteLinks VB.NET code example. + /// + [Test] + public void TestAddSiteLinksVBExample() { + RunExample(delegate() { + new VBExamples.AddSiteLinks().Run(user, campaignId); + }); + } + + /// + /// Tests the AddSiteLinks C# code example. + /// + [Test] + public void TestAddSiteLinksCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddSiteLinks().Run(user, campaignId); + }); + } + + /// + /// Tests the AddAdGroupBidModifier C# code example. + /// + [Test] + public void TestAddAdGroupBidModifierCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddAdGroupBidModifier().Run(user, adGroupId, BID_MODIFIER); + }); + } + + /// + /// Tests the AddAdGroupBidModifier VB.NET code example. + /// + [Test] + public void TestAddAdGroupBidModifierVBExample() { + RunExample(delegate() { + new VBExamples.AddAdGroupBidModifier().Run(user, adGroupId, BID_MODIFIER); + }); + } + + /// + /// Tests the GetAdGroupBidModifiers C# code example. + /// + [Test] + public void TestGetAdGroupBidModifiersCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAdGroupBidModifiers().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAdGroupBidModifiers VB.NET code example. + /// + [Test] + public void TestGetAdGroupBidModifiersVBExample() { + RunExample(delegate() { + new VBExamples.GetAdGroupBidModifiers().Run(user, campaignId); + }); + } + + /// + /// Tests the AddPlacesLocationExtension C# code example. + /// + [Test] + public void TestAddPlacesLocationExtensionCSharpExample() { + AdWordsAppConfig config = (AdWordsAppConfig) user.Config; + + RunExample(delegate() { + new CSharpExamples.AddPlacesLocationExtension().Run(user, config.PlacesLoginEmail, + placesAccessToken); + }); + } + + /// + /// Tests the AddPlacesLocationExtension VB.NET code example. + /// + [Test] + public void TestAddPlacesLocationExtensionVBExample() { + AdWordsAppConfig config = (AdWordsAppConfig) user.Config; + + RunExample(delegate() { + new VBExamples.AddPlacesLocationExtension().Run(user, config.PlacesLoginEmail, + placesAccessToken); + }); + } + } +} diff --git a/tests/AdWords/v201406/BasicOperationsTest.cs b/tests/AdWords/v201406/BasicOperationsTest.cs new file mode 100644 index 00000000000..49671425ce1 --- /dev/null +++ b/tests/AdWords/v201406/BasicOperationsTest.cs @@ -0,0 +1,371 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.v201406; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201406; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201406; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Test cases for all the code examples under v201406\BasicOperations. + /// + class BasicOperationsTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + long adId; + long keywordId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateSearchCampaign(user, BiddingStrategyType.MANUAL_CPC); + adGroupId = utils.CreateAdGroup(user, campaignId); + adId = utils.CreateTextAd(user, adGroupId, false); + keywordId = utils.CreateKeyword(user, adGroupId); + } + + /// + /// Tests the AddAdGroup VB.NET code example. + /// + [Test] + public void TestAddAdGroupVBExample() { + RunExample(delegate() { + new VBExamples.AddAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the AddAdGroup C# code example. + /// + [Test] + public void TestAddAdGroupCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the AddCampaign VB.NET code example. + /// + [Test] + public void TestAddCampaignVBExample() { + RunExample(delegate() { + new VBExamples.AddCampaigns().Run(user); + }); + } + + /// + /// Tests the AddCampaign C# code example. + /// + [Test] + public void TestAddCampaignCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddCampaigns().Run(user); + }); + } + + /// + /// Tests the AddKeywords VB.NET code example. + /// + [Test] + public void TestAddKeywordsVBExample() { + RunExample(delegate() { + new VBExamples.AddKeywords().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddKeywords C# code example. + /// + [Test] + public void TestAddKeywordsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddKeywords().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddTextAds VB.NET code example. + /// + [Test] + public void TestAddTextAdsVBExample() { + RunExample(delegate() { + new VBExamples.AddTextAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddTextAds C# code example. + /// + [Test] + public void TestAddTextAdsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddTextAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the RemoveAdGroup VB.NET code example. + /// + [Test] + public void TestRemoveAdGroupVBExample() { + RunExample(delegate() { + new VBExamples.RemoveAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the RemoveAdGroup C# code example. + /// + [Test] + public void TestRemoveAdGroupCSharpExample() { + RunExample(delegate() { + new CSharpExamples.RemoveAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the RemoveAd VB.NET code example. + /// + [Test] + public void TestRemoveAdVBExample() { + RunExample(delegate() { + new VBExamples.RemoveAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the RemoveAd C# code example. + /// + [Test] + public void TestRemoveAdCSharpExample() { + RunExample(delegate() { + new CSharpExamples.RemoveAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the RemoveCampaign VB.NET code example. + /// + [Test] + public void TestRemoveCampaignVBExample() { + RunExample(delegate() { + new VBExamples.RemoveCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the RemoveCampaign C# code example. + /// + [Test] + public void TestRemoveCampaignCSharpExample() { + RunExample(delegate() { + new CSharpExamples.RemoveCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the RemoveKeyword VB.NET code example. + /// + [Test] + public void TestRemoveKeywordVBExample() { + RunExample(delegate() { + new VBExamples.RemoveKeyword().Run(user, adGroupId, keywordId); + }); + } + + /// + /// Tests the RemoveKeyword C# code example. + /// + [Test] + public void TestRemoveKeywordCSharpExample() { + RunExample(delegate() { + new CSharpExamples.RemoveKeyword().Run(user, adGroupId, keywordId); + }); + } + + /// + /// Tests the GetAdGroups VB.NET code example. + /// + [Test] + public void TestGetAdGroupsVBExample() { + RunExample(delegate() { + new VBExamples.GetAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAdGroups C# code example. + /// + [Test] + public void TestGetAdGroupsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the GetCampaigns VB.NET code example. + /// + [Test] + public void TestGetCampaignsVBExample() { + RunExample(delegate() { + new VBExamples.GetCampaigns().Run(user); + }); + } + + /// + /// Tests the GetCampaigns C# code example. + /// + [Test] + public void TestGetCampaignsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetCampaigns().Run(user); + }); + } + + /// + /// Tests the GetKeywords VB.NET code example. + /// + [Test] + public void TestGetKeywordsVBExample() { + RunExample(delegate() { + new VBExamples.GetKeywords().Run(user); + }); + } + + /// + /// Tests the GetKeywords C# code example. + /// + [Test] + public void TestGetKeywordsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetKeywords().Run(user); + }); + } + + /// + /// Tests the GetTextAds VB.NET code example. + /// + [Test] + public void TestGetTextAdsVBExample() { + RunExample(delegate() { + new VBExamples.GetTextAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the GetTextAds C# code example. + /// + [Test] + public void TestGetTextAdsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetTextAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the PauseAd VB.NET code example. + /// + [Test] + public void TestPauseAdVBExample() { + RunExample(delegate() { + new VBExamples.PauseAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the PauseAd C# code example. + /// + [Test] + public void TestPauseAdCSharpExample() { + RunExample(delegate() { + new CSharpExamples.PauseAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the UpdateAdGroup VB.NET code example. + /// + [Test] + public void TestUpdateAdGroupVBExample() { + RunExample(delegate() { + new VBExamples.UpdateAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the UpdateAdGroup C# code example. + /// + [Test] + public void TestUpdateAdGroupCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UpdateAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the UpdateCampaign VB.NET code example. + /// + [Test] + public void TestUpdateCampaignVBExample() { + RunExample(delegate() { + new VBExamples.UpdateCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the UpdateCampaign C# code example. + /// + [Test] + public void TestUpdateCampaignCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UpdateCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the UpdateKeyword VB.NET code example. + /// + [Test] + public void TestUpdateKeywordVBExample() { + RunExample(delegate() { + new VBExamples.UpdateKeyword().Run(user, adGroupId, keywordId); + }); + } + + /// + /// Tests the UpdateKeyword C# code example. + /// + [Test] + public void TestUpdateKeywordCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UpdateKeyword().Run(user, adGroupId, keywordId); + }); + } + } +} diff --git a/tests/AdWords/v201406/CampaignManagementTest.cs b/tests/AdWords/v201406/CampaignManagementTest.cs new file mode 100644 index 00000000000..a47907bb23a --- /dev/null +++ b/tests/AdWords/v201406/CampaignManagementTest.cs @@ -0,0 +1,229 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201406; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201406; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Test cases for all the code examples under v201406\CampaignManagement. + /// + class CampaignManagementTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + long criterionId; + long adId; + long locationExtensionId; + + const Double BID_MODIFIER = 1.5; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateSearchCampaign(user, BiddingStrategyType.MANUAL_CPC); + adGroupId = utils.CreateAdGroup(user, campaignId); + criterionId = utils.CreateKeyword(user, adGroupId); + adId = utils.CreateTextAd(user, adGroupId, false); + locationExtensionId = utils.CreateLocationExtension(user, campaignId); + } + + /// + /// Tests the AddExperiment VB.NET code example. + /// + [Test] + public void TestAddExperimentVBExample() { + RunExample(delegate() { + new VBExamples.AddExperiment().Run(user, campaignId, adGroupId, criterionId); + }); + } + + /// + /// Tests the AddExperiment C# code example. + /// + [Test] + public void TestAddExperimentCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddExperiment().Run(user, campaignId, adGroupId, criterionId); + }); + } + + /// + /// Tests the AddKeywordsInBulk VB.NET code example. + /// + [Test] + public void TestAddKeywordsInBulkVBExample() { + RunExample(delegate() { + new VBExamples.AddKeywordsInBulk().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddKeywordsInBulk C# code example. + /// + [Test] + public void TestAddKeywordsInBulkCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddKeywordsInBulk().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddLocationExtension VB.NET code example. + /// + [Test] + public void TestAddLocationExtensionVBExample() { + RunExample(delegate() { + new VBExamples.AddLocationExtension().Run(user, campaignId); + }); + } + + /// + /// Tests the AddLocationExtension C# code example. + /// + [Test] + public void TestAddLocationExtensionCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddLocationExtension().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAllDisapprovedAds VB.NET code example. + /// + [Test] + public void TestGetAllDisapprovedAdsVBExample() { + RunExample(delegate() { + new VBExamples.GetAllDisapprovedAds().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAllDisapprovedAds C# code example. + /// + [Test] + public void TestGetAllDisapprovedAdsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAllDisapprovedAds().Run(user, campaignId); + }); + } + + /// + /// Tests the PromoteExperiment VB.NET code example. + /// + [Test] + public void TestPromoteExperimentVBExample() { + long experimentId = CreateExperimentForPromotion(); + RunExample(delegate() { + new VBExamples.PromoteExperiment().Run(user, experimentId); + }); + } + + /// + /// Tests the PromoteExperiment C# code example. + /// + [Test] + public void TestPromoteExperimentCSharpExample() { + long experimentId = CreateExperimentForPromotion(); + RunExample(delegate() { + new CSharpExamples.PromoteExperiment().Run(user, experimentId); + }); + } + + /// + /// Tests the SetAdParameters VB.NET code example. + /// + [Test] + public void TestSetAdParametersVBExample() { + RunExample(delegate() { + new VBExamples.SetAdParameters().Run(user, adGroupId, criterionId); + }); + } + + /// + /// Tests the SetAdParameters C# code example. + /// + [Test] + public void TestSetAdParametersCSharpExample() { + RunExample(delegate() { + new CSharpExamples.SetAdParameters().Run(user, adGroupId, criterionId); + }); + } + + /// + /// Tests the ValidateTextAd VB.NET code example. + /// + [Test] + public void TestValidateTextAdVBExample() { + RunExample(delegate() { + new VBExamples.ValidateTextAd().Run(user, adGroupId); + }); + } + + /// + /// Tests the ValidateTextAd C# code example. + /// + [Test] + public void TestValidateTextAdCSharpExample() { + RunExample(delegate() { + new CSharpExamples.ValidateTextAd().Run(user, adGroupId); + }); + } + + /// + /// Tests the SetBidModifier C# code example. + /// + [Test] + public void TestSetBidModifierCSharpExample() { + RunExample(delegate() { + new CSharpExamples.SetBidModifier().Run(user, campaignId, BID_MODIFIER); + }); + } + + /// + /// Tests the SetBidModifier VB.NET code example. + /// + [Test] + public void TestSetBidModifierVBExample() { + RunExample(delegate() { + new VBExamples.SetBidModifier().Run(user, campaignId, BID_MODIFIER); + }); + } + + /// + /// Create an experiment for promotion. + /// + /// Experiment id for promotion. + /// This code cannot be added in Init(), since there can be only + /// one experiment per campaign, and if we add this to Init(), then + /// AddExperiment tests will fail. + private long CreateExperimentForPromotion() { + return utils.AddExperiment(user, campaignId, adGroupId, criterionId); + } + } +} diff --git a/tests/AdWords/v201406/ErrorHandlingTest.cs b/tests/AdWords/v201406/ErrorHandlingTest.cs new file mode 100644 index 00000000000..d5ba3805364 --- /dev/null +++ b/tests/AdWords/v201406/ErrorHandlingTest.cs @@ -0,0 +1,88 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201406; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201406; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Test cases for all the code examples under v201406\ErrorHandling. + /// + class ErrorHandlingTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateSearchCampaign(user, BiddingStrategyType.MANUAL_CPC); + adGroupId = utils.CreateAdGroup(user, campaignId); + } + + /// + /// Tests the HandlePartialFailures VB.NET code example. + /// + [Test] + public void TestHandlePartialFailuresVBExample() { + RunExample(delegate() { + new VBExamples.HandlePartialFailures().Run(user, adGroupId); + }); + } + + /// + /// Tests the HandlePartialFailures C# code example. + /// + [Test] + public void TestHandlePartialFailuresCSharpExample() { + RunExample(delegate() { + new CSharpExamples.HandlePartialFailures().Run(user, adGroupId); + }); + } + + /// + /// Tests the HandlePolicyViolationError VB.NET code example. + /// + [Test] + public void TestHandlePolicyViolationErrorVBExample() { + RunExample(delegate() { + new VBExamples.HandlePolicyViolationError().Run(user, adGroupId); + }); + } + + /// + /// Tests the HandlePolicyViolationError C# code example. + /// + [Test] + public void TestHandlePolicyViolationErrorCSharpExample() { + RunExample(delegate() { + new CSharpExamples.HandlePolicyViolationError().Run(user, adGroupId); + }); + } + } +} diff --git a/tests/AdWords/v201406/MiscellaneousTest.cs b/tests/AdWords/v201406/MiscellaneousTest.cs new file mode 100644 index 00000000000..f0afc6609bd --- /dev/null +++ b/tests/AdWords/v201406/MiscellaneousTest.cs @@ -0,0 +1,83 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201406; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201406; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Test cases for all the code examples under v201406\Miscellaneous. + /// + class MiscellaneousTest : VersionedExampleTestsBase { + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + } + + /// + /// Tests the GetAllVideosAndImages VB.NET code example. + /// + [Test] + public void TestGetAllVideosAndImagesVBExample() { + RunExample(delegate() { + new VBExamples.GetAllVideosAndImages().Run(user); + }); + } + + /// + /// Tests the GetAllVideosAndImages C# code example. + /// + [Test] + public void TestGetAllVideosAndImagesCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAllVideosAndImages().Run(user); + }); + } + + /// + /// Tests the UploadImage VB.NET code example. + /// + [Test] + public void TestUploadImageVBExample() { + RunExample(delegate() { + new VBExamples.UploadImage().Run(user); + }); + } + + /// + /// Tests the UploadImage C# code example. + /// + [Test] + public void TestUploadImageCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UploadImage().Run(user); + }); + } + } +} diff --git a/tests/AdWords/v201406/OptimizationTest.cs b/tests/AdWords/v201406/OptimizationTest.cs new file mode 100644 index 00000000000..239185bc0e2 --- /dev/null +++ b/tests/AdWords/v201406/OptimizationTest.cs @@ -0,0 +1,130 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201406; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201406; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Test cases for all the code examples under v201406\Optimization. + /// + class OptimizationTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + long keywordId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateSearchCampaign(user, BiddingStrategyType.MANUAL_CPC); + adGroupId = utils.CreateAdGroup(user, campaignId); + keywordId = utils.CreateKeyword(user, adGroupId); + } + + /// + /// Tests the EstimateKeywordTraffic VB.NET code example. + /// + [Test] + public void TestEstimateKeywordTrafficVBExample() { + RunExample(delegate() { + new VBExamples.EstimateKeywordTraffic().Run(user); + }); + } + + /// + /// Tests the EstimateKeywordTraffic C# code example. + /// + [Test] + public void TestEstimateKeywordTrafficCSharpExample() { + RunExample(delegate() { + new CSharpExamples.EstimateKeywordTraffic().Run(user); + }); + } + + /// + /// Tests the GetAdGroupBidSimulations VB.NET code example. + /// + [Test] + public void TestGetAdGroupBidSimulationsVBExample() { + RunExample(delegate() { + new VBExamples.GetAdGroupBidSimulations().Run(user, adGroupId); + }); + } + + /// + /// Tests the GetAdGroupBidSimulations C# code example. + /// + [Test] + public void TestGetAdGroupBidSimulationsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAdGroupBidSimulations().Run(user, adGroupId); + }); + } + + /// + /// Tests the GetKeywordBidSimulations VB.NET code example. + /// + [Test] + public void TestGetKeywordBidSimulationsVBExample() { + RunExample(delegate() { + new VBExamples.GetKeywordBidSimulations().Run(user, adGroupId, keywordId); + }); + } + + /// + /// Tests the GetKeywordBidSimulations C# code example. + /// + [Test] + public void TestGetKeywordBidSimulationsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetKeywordBidSimulations().Run(user, adGroupId, keywordId); + }); + } + + /// + /// Tests the GetPlacementIdeas VB.NET code example. + /// + [Test] + public void TestGetPlacementIdeasVBExample() { + RunExample(delegate() { + new VBExamples.GetPlacementIdeas().Run(user); + }); + } + + /// + /// Tests the GetPlacementIdeas C# code example. + /// + [Test] + public void TestGetPlacementIdeasCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetPlacementIdeas().Run(user); + }); + } + } +} diff --git a/tests/AdWords/v201406/RemarketingTest.cs b/tests/AdWords/v201406/RemarketingTest.cs new file mode 100644 index 00000000000..1e2c8dae709 --- /dev/null +++ b/tests/AdWords/v201406/RemarketingTest.cs @@ -0,0 +1,84 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201406; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201406; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Test cases for all the code examples under + /// v201406\AudienceAndConversionManagement. + /// + class RemarketingTest : VersionedExampleTestsBase { + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + } + + /// + /// Tests the AddAudience VB.NET code example. + /// + [Test] + public void TestAddAudienceVBExample() { + RunExample(delegate() { + new VBExamples.AddAudience().Run(user); + }); + } + + /// + /// Tests the AddAudience C# code example. + /// + [Test] + public void TestAddAudienceCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddAudience().Run(user); + }); + } + + /// + /// Tests the AddConversionTracker VB.NET code example. + /// + [Test] + public void TestAddConversionTrackerVBExample() { + RunExample(delegate() { + new VBExamples.AddConversionTracker().Run(user); + }); + } + + /// + /// Tests the AddConversionTracker C# code example. + /// + [Test] + public void TestAddConversionTrackerCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddConversionTracker().Run(user); + }); + } + } +} diff --git a/tests/AdWords/v201406/ReportingTest.cs b/tests/AdWords/v201406/ReportingTest.cs new file mode 100644 index 00000000000..ca6332b3026 --- /dev/null +++ b/tests/AdWords/v201406/ReportingTest.cs @@ -0,0 +1,87 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.v201406; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201406; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201406; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Test cases for all the code examples under v201406\Reporting. + /// + class ReportingTest : VersionedExampleTestsBase { + string outputFileName; + ReportDefinitionReportType reportType; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + outputFileName = Path.GetFileName(Path.GetTempFileName()); + reportType = ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT; + } + + /// + /// Tests the DownloadCriteriaReport VB.NET code example. + /// + [Test] + public void TestDownloadCriteriaReportVBExample() { + RunExample(delegate() { + new VBExamples.DownloadCriteriaReport().Run(user, outputFileName); + }); + } + + /// + /// Tests the DownloadCriteriaReport C# code example. + /// + [Test] + public void TestDownloadCriteriaReportCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DownloadCriteriaReport().Run(user, outputFileName); + }); + } + + /// + /// Tests the GetReportFields VB.NET code example. + /// + [Test] + public void TestGetReportFieldsVBExample() { + RunExample(delegate() { + new VBExamples.GetReportFields().Run(user, reportType); + }); + } + + /// + /// Tests the GetReportFields C# code example. + /// + [Test] + public void TestGetReportFieldsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetReportFields().Run(user, reportType); + }); + } + } +} diff --git a/tests/AdWords/v201406/ShoppingCampaignsTest.cs b/tests/AdWords/v201406/ShoppingCampaignsTest.cs new file mode 100644 index 00000000000..425d92ffb62 --- /dev/null +++ b/tests/AdWords/v201406/ShoppingCampaignsTest.cs @@ -0,0 +1,147 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using NUnit.Framework; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201406; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201406; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + + /// + /// Test cases for all the code examples under v201406\ShoppingCampaigns. + /// + internal class ShoppingCampaignsTest : VersionedExampleTestsBase { + private long adGroupId; + private long budgetId; + private long campaignId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + budgetId = utils.CreateBudget(user); + campaignId = utils.CreateShoppingCampaign(user, BiddingStrategyType.MANUAL_CPC); + adGroupId = utils.CreateAdGroup(user, campaignId); + } + + /// + /// Tests the AddProductPartitionTree C# code example. + /// + [Test] + public void TestAddProductPartitionTreeCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddProductPartitionTree().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddProductPartitionTree VB.NET code example. + /// + [Test] + public void TestAddProductPartitionTreeVBExample() { + RunExample(delegate() { + new VBExamples.AddProductPartitionTree().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddProductScope C# code example. + /// + [Test] + public void TestAddProductScopeCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddProductScope().Run(user, campaignId); + }); + } + + /// + /// Tests the AddProductScope VB.NET code example. + /// + [Test] + public void TestAddProductScopeVBExample() { + RunExample(delegate() { + new VBExamples.AddProductScope().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAccountChanges C# code example. + /// + [Test] + public void TestAddShoppingCampaignCSharpExample() { + AdWordsAppConfig config = (AdWordsAppConfig) user.Config; + RunExample(delegate() { + new CSharpExamples.AddShoppingCampaign().Run(user, budgetId, config.MerchantCenterId); + }); + } + + /// + /// Tests the GetAccountChanges VB.NET code example. + /// + [Test] + public void TestAddShoppingCampaignVBExample() { + AdWordsAppConfig config = (AdWordsAppConfig) user.Config; + RunExample(delegate() { + new VBExamples.AddShoppingCampaign().Run(user, budgetId, config.MerchantCenterId); + }); + } + + /// + /// Tests the GetProductCategoryTaxonomy C# code example. + /// + [Test] + public void TestGetProductCategoryTaxonomyCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetProductCategoryTaxonomy().Run(user); + }); + } + + /// + /// Tests the GetProductCategoryTaxonomy VB.NET code example. + /// + [Test] + public void TestGetProductCategoryTaxonomyVBExample() { + RunExample(delegate() { + new VBExamples.GetProductCategoryTaxonomy().Run(user); + }); + } + + /// + /// Tests the SetProductSalesChannel C# code example. + /// + [Test] + public void TestSetProductSalesChannelCSharpExample() { + RunExample(delegate() { + new CSharpExamples.SetProductSalesChannel().Run(user, campaignId); + }); + } + + /// + /// Tests the SetProductSalesChannel VB.NET code example. + /// + [Test] + public void TestSetProductSalesChannelVBExample() { + RunExample(delegate() { + new VBExamples.SetProductSalesChannel().Run(user, campaignId); + }); + } + } +} diff --git a/tests/AdWords/v201406/TargetingTest.cs b/tests/AdWords/v201406/TargetingTest.cs new file mode 100644 index 00000000000..003787f742f --- /dev/null +++ b/tests/AdWords/v201406/TargetingTest.cs @@ -0,0 +1,128 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201406; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201406; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Test cases for all the code examples under v201406\Targeting. + /// + class TargetingTest : VersionedExampleTestsBase { + long campaignId; + long campaignCriterionId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateSearchCampaign(user, BiddingStrategyType.MANUAL_CPC); + campaignCriterionId = utils.AddCampaignTargetingCriteria(user, campaignId); + } + + /// + /// Tests the AddCampaignTargetingCriteria VB.NET code example. + /// + [Test] + public void TestAddCampaignTargetingCriteriaVBExample() { + RunExample(delegate() { + new VBExamples.AddCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the AddCampaignTargetingCriteria C# code example. + /// + [Test] + public void TestAddCampaignTargetingCriteriaCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the GetCampaignTargetingCriteria VB.NET code example. + /// + [Test] + public void TestGetCampaignTargetingCriteriaVBExample() { + RunExample(delegate() { + new VBExamples.GetCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the GetCampaignTargetingCriteria C# code example. + /// + [Test] + public void TestGetCampaignTargetingCriteriaCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the GetTargetableLanguagesAndCarriers VB.NET code example. + /// + [Test] + public void TestGetTargetableLanguagesAndCarriersVBExample() { + RunExample(delegate() { + new VBExamples.GetTargetableLanguagesAndCarriers().Run(user); + }); + } + + /// + /// Tests the GetTargetableLanguagesAndCarriers C# code example. + /// + [Test] + public void TestGetTargetableLanguagesAndCarriersCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetTargetableLanguagesAndCarriers().Run(user); + }); + } + + /// + /// Tests the LookupLocation VB.NET code example. + /// + [Test] + public void TestLookupLocationVBExample() { + RunExample(delegate() { + new VBExamples.LookupLocation().Run(user); + }); + } + + /// + /// Tests the LookupLocation C# code example. + /// + [Test] + public void TestLookupLocationCSharpExample() { + RunExample(delegate() { + new CSharpExamples.LookupLocation().Run(user); + }); + } + } +} diff --git a/tests/AdWords/v201406/TestUtils.cs b/tests/AdWords/v201406/TestUtils.cs new file mode 100644 index 00000000000..f919d9ad8e4 --- /dev/null +++ b/tests/AdWords/v201406/TestUtils.cs @@ -0,0 +1,493 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util.v201406; +using Google.Api.Ads.AdWords.v201406; +using Google.Api.Ads.Common.Util; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// A utility class to assist the testing of v201406 services. + /// + class TestUtils { + + public long CreateBudget(AdWordsUser user) { + BudgetService budgetService = + (BudgetService) user.GetService(AdWordsService.v201406.BudgetService); + + // Create the campaign budget. + Budget budget = new Budget(); + budget.name = "Interplanetary Cruise Budget #" + DateTime.Now.ToString("yyyy-M-d H:m:s.ffffff"); + budget.period = BudgetBudgetPeriod.DAILY; + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + budget.amount = new Money(); + budget.amount.microAmount = 500000; + + BudgetOperation budgetOperation = new BudgetOperation(); + budgetOperation.@operator = Operator.ADD; + budgetOperation.operand = budget; + + BudgetReturnValue budgetRetval = budgetService.mutate(new BudgetOperation[] { budgetOperation }); + return budgetRetval.value[0].budgetId; + } + + /// + /// Creates a test search campaign for running further tests. + /// + /// The user. + /// The bidding strategy to be used. + /// The campaign id. + public long CreateSearchCampaign(AdWordsUser user, BiddingStrategyType strategyType) { + return CreateCampaign(user, AdvertisingChannelType.SEARCH, strategyType); + } + + /// + /// Creates a display campaign for running further tests. + /// + /// The user. + /// The bidding strategy to be used. + /// The campaign id. + public long CreateDisplayCampaign(AdWordsUser user, BiddingStrategyType strategyType) { + return CreateCampaign(user, AdvertisingChannelType.DISPLAY, strategyType); + } + + /// + /// Creates a test shopping campaign for running further tests. + /// + /// The user. + /// The bidding strategy to be used. + /// The campaign id. + public long CreateShoppingCampaign(AdWordsUser user, BiddingStrategyType strategyType) { + return CreateCampaign(user, AdvertisingChannelType.SHOPPING, strategyType); + } + + /// + /// Creates a test campaign for running further tests. + /// + /// The AdWords user. + /// The bidding strategy to be used. + /// The campaign id. + public long CreateCampaign(AdWordsUser user, AdvertisingChannelType channelType, + BiddingStrategyType strategyType) { + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201406.CampaignService); + + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + biddingConfig.biddingStrategyType = strategyType; + + CampaignOperation campaignOperation = new CampaignOperation(); + campaignOperation.@operator = Operator.ADD; + campaignOperation.operand = new Campaign(); + campaignOperation.operand.name = + string.Format("Campaign {0}", DateTime.Now.ToString("yyyy-M-d H:m:s.ffffff")); + campaignOperation.operand.advertisingChannelType = channelType; + campaignOperation.operand.status = CampaignStatus.PAUSED; + campaignOperation.operand.biddingStrategyConfiguration = biddingConfig; + campaignOperation.operand.budget = new Budget(); + campaignOperation.operand.budget.budgetId = CreateBudget(user); + campaignOperation.operand.budget.period = BudgetBudgetPeriod.DAILY; + campaignOperation.operand.budget.amount = new Money(); + campaignOperation.operand.budget.amount.microAmount = 100000000; + campaignOperation.operand.budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + + List settings = new List(); + KeywordMatchSetting matchSetting = new KeywordMatchSetting(); + matchSetting.optIn = true; + settings.Add(matchSetting); + + if (channelType == AdvertisingChannelType.SHOPPING) { + // All Shopping campaigns need a ShoppingSetting. + ShoppingSetting shoppingSetting = new ShoppingSetting(); + shoppingSetting.salesCountry = "US"; + shoppingSetting.campaignPriority = 0; + shoppingSetting.merchantId = (user.Config as AdWordsAppConfig).MerchantCenterId; + + settings.Add(shoppingSetting); + } + campaignOperation.operand.settings = settings.ToArray(); + + CampaignReturnValue retVal = + campaignService.mutate(new CampaignOperation[] {campaignOperation}); + return retVal.value[0].id; + } + + /// + /// Creates a test adgroup for running further tests. + /// + /// The AdWords user. + /// The campaign id for which the adgroup is created. + /// The adgroup id. + public long CreateAdGroup(AdWordsUser user, long campaignId) { + return CreateAdGroup(user, campaignId, false); + } + + /// + /// Creates a test adgroup for running further tests. + /// + /// The AdWords user. + /// The campaign id for which the adgroup is created. + /// True, if a ManualCPM bid is to be used. + /// The adgroup id. + public long CreateAdGroup(AdWordsUser user, long campaignId, bool isCpmBid) { + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201406.AdGroupService); + + AdGroupOperation adGroupOperation = new AdGroupOperation(); + adGroupOperation.@operator = Operator.ADD; + adGroupOperation.operand = new AdGroup(); + adGroupOperation.operand.campaignId = campaignId; + adGroupOperation.operand.name = + string.Format("AdGroup {0}", DateTime.Now.ToString("yyyy-M-d H:m:s.ffffff")); + adGroupOperation.operand.status = AdGroupStatus.ENABLED; + + if (isCpmBid) { + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + CpmBid cpmBid = new CpmBid(); + cpmBid.bid = new Money(); + cpmBid.bid.microAmount = 10000000; + biddingConfig.bids = new Bids[] {cpmBid}; + adGroupOperation.operand.biddingStrategyConfiguration = biddingConfig; + } else { + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + CpcBid cpcBid = new CpcBid(); + cpcBid.bid = new Money(); + cpcBid.bid.microAmount = 10000000; + biddingConfig.bids = new Bids[] {cpcBid}; + adGroupOperation.operand.biddingStrategyConfiguration = biddingConfig; + } + AdGroupReturnValue retVal = adGroupService.mutate(new AdGroupOperation[] {adGroupOperation}); + return retVal.value[0].id; + } + + /// + /// Creates a test textad for running further tests. + /// + /// The AdWords user. + /// The adgroup id for which the ad is created. + /// + /// True, if an ad param placeholder should be + /// added. + /// The text ad id. + public long CreateTextAd(AdWordsUser user, long adGroupId, bool hasAdParam) { + AdGroupAdService adGroupAdService = + (AdGroupAdService) user.GetService(AdWordsService.v201406.AdGroupAdService); + AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation(); + adGroupAdOperation.@operator = Operator.ADD; + adGroupAdOperation.operand = new AdGroupAd(); + adGroupAdOperation.operand.adGroupId = adGroupId; + TextAd ad = new TextAd(); + + ad.headline = "Luxury Cruise to Mars"; + ad.description1 = "Visit the Red Planet in style."; + if (hasAdParam) { + ad.description2 = "Low-gravity fun for {param1:cheap}!"; + } else { + ad.description2 = "Low-gravity fun for everyone!"; + } + ad.displayUrl = "example.com"; + ad.url = "http://www.example.com"; + + adGroupAdOperation.operand.ad = ad; + + AdGroupAdReturnValue retVal = + adGroupAdService.mutate(new AdGroupAdOperation[] {adGroupAdOperation}); + return retVal.value[0].ad.id; + } + + /// + /// Creates a test ThirdPartyRedirectAd for running further tests. + /// + /// The AdWords user. + /// The adgroup id for which the ad is created. + /// + /// True, if an ad param placeholder should be + /// added. + /// The text ad id. + public long CreateThirdPartyRedirectAd(AdWordsUser user, long adGroupId) { + AdGroupAdService adGroupAdService = + (AdGroupAdService) user.GetService(AdWordsService.v201406.AdGroupAdService); + AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation(); + adGroupAdOperation.@operator = Operator.ADD; + adGroupAdOperation.operand = new AdGroupAd(); + adGroupAdOperation.operand.adGroupId = adGroupId; + + // Create the third party redirect ad. + ThirdPartyRedirectAd redirectAd = new ThirdPartyRedirectAd(); + redirectAd.name = string.Format("Example third party ad #{0}", this.GetTimeStamp()); + redirectAd.url = "http://www.example.com"; + + redirectAd.dimensions = new Dimensions(); + redirectAd.dimensions.height = 250; + redirectAd.dimensions.width = 300; + + // This field normally contains the javascript ad tag. + redirectAd.snippet = + ""; + redirectAd.impressionBeaconUrl = "http://www.examples.com/beacon"; + redirectAd.certifiedVendorFormatId = 119; + redirectAd.isCookieTargeted = false; + redirectAd.isUserInterestTargeted = false; + redirectAd.isTagged = false; + + adGroupAdOperation.operand.ad = redirectAd; + + AdGroupAdReturnValue retVal = + adGroupAdService.mutate(new AdGroupAdOperation[] {adGroupAdOperation}); + return retVal.value[0].ad.id; + } + + /// + /// Sets an adparam for running further tests. + /// + /// The AdWords user. + /// The adgroup id to which criterionId belongs. + /// + /// The criterion id to which adparam is set. + /// + public void SetAdParam(AdWordsUser user, long adGroupId, long criterionId) { + AdParamService adParamService = + (AdParamService) user.GetService(AdWordsService.v201406.AdParamService); + + // Prepare for setting ad parameters. + AdParam adParam = new AdParam(); + adParam.adGroupId = adGroupId; + adParam.criterionId = criterionId; + adParam.paramIndex = 1; + adParam.insertionText = "$100"; + + AdParamOperation adParamOperation = new AdParamOperation(); + adParamOperation.@operator = Operator.SET; + adParamOperation.operand = adParam; + + // Set ad parameters. + AdParam[] newAdParams = adParamService.mutate(new AdParamOperation[] {adParamOperation}); + return; + } + + /// + /// Creates a keyword for running further tests. + /// + /// The AdWords user. + /// The adgroup id for which the keyword is + /// created. + /// The keyword id. + public long CreateKeyword(AdWordsUser user, long adGroupId) { + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201406.AdGroupCriterionService); + + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.@operator = Operator.ADD; + operation.operand = new BiddableAdGroupCriterion(); + operation.operand.adGroupId = adGroupId; + + Keyword keyword = new Keyword(); + keyword.matchType = KeywordMatchType.BROAD; + keyword.text = "mars cruise"; + + operation.operand.criterion = keyword; + AdGroupCriterionReturnValue retVal = + adGroupCriterionService.mutate(new AdGroupCriterionOperation[] {operation}); + return retVal.value[0].criterion.id; + } + + /// + /// Creates the placement. + /// + /// The AdWords user. + /// The adgroup id for which the placement is + /// created. + /// The placement id. + public long CreatePlacement(AdWordsUser user, long adGroupId) { + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201406.AdGroupCriterionService); + + Placement placement = new Placement(); + placement.url = "http://mars.google.com"; + + AdGroupCriterion placementCriterion = new BiddableAdGroupCriterion(); + placementCriterion.adGroupId = adGroupId; + placementCriterion.criterion = placement; + + AdGroupCriterionOperation placementOperation = new AdGroupCriterionOperation(); + placementOperation.@operator = Operator.ADD; + placementOperation.operand = placementCriterion; + + AdGroupCriterionReturnValue retVal = adGroupCriterionService.mutate( + new AdGroupCriterionOperation[] {placementOperation}); + + return retVal.value[0].criterion.id; + } + + /// + /// Creates a campaign ad extension for running further tests. + /// + /// The AdWords user. + /// The campaign id for which extension is + /// created. + /// The campaign ad extension id. + public long CreateLocationExtension(AdWordsUser user, long campaignId) { + CampaignAdExtensionService campaignExtensionService = + (CampaignAdExtensionService) user.GetService(AdWordsService.v201406. + CampaignAdExtensionService); + + CampaignAdExtensionOperation operation = new CampaignAdExtensionOperation(); + operation.@operator = Operator.ADD; + + CampaignAdExtension extension = new CampaignAdExtension(); + extension.campaignId = campaignId; + extension.status = CampaignAdExtensionStatus.ENABLED; + + Address address = new Address(); + address.streetAddress = "1600 Amphitheatre Pkwy, Mountain View"; + address.countryCode = "US"; + + GeoLocation location = GetLocationForAddress(user, address); + + LocationExtension locationExtension = new LocationExtension(); + + // Note: Do not populate an address directly. Instead, use + // GeoLocationService to obtain the location of an address, + // and use the address as per the location it returns. + locationExtension.address = location.address; + locationExtension.geoPoint = location.geoPoint; + locationExtension.encodedLocation = location.encodedLocation; + locationExtension.source = LocationExtensionSource.ADWORDS_FRONTEND; + + extension.adExtension = locationExtension; + operation.operand = extension; + CampaignAdExtensionReturnValue retVal = + campaignExtensionService.mutate(new CampaignAdExtensionOperation[] {operation}); + return retVal.value[0].adExtension.id; + } + + /// + /// Adds an experiment. + /// + /// The user. + /// The campaign id. + /// The ad group id. + /// The criterion id. + /// The experiment id. + public long AddExperiment(AdWordsUser user, long campaignId, long adGroupId, long criterionId) { + // Get the ExperimentService. + ExperimentService experimentService = + (ExperimentService) user.GetService(AdWordsService.v201406.ExperimentService); + + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201406.AdGroupService); + + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201406.AdGroupCriterionService); + + // Create the experiment. + Experiment experiment = new Experiment(); + experiment.campaignId = campaignId; + experiment.name = "Interplanetary Cruise #" + GetTimeStamp(); + experiment.queryPercentage = 10; + experiment.startDateTime = DateTime.Now.AddDays(1).ToString("yyyyMMdd HHmmss"); + + // Create the operation. + ExperimentOperation experimentOperation = new ExperimentOperation(); + experimentOperation.@operator = Operator.ADD; + experimentOperation.operand = experiment; + + // Add the experiment. + ExperimentReturnValue experimentRetVal = experimentService.mutate( + new ExperimentOperation[] {experimentOperation}); + + return experimentRetVal.value[0].id; + } + + /// + /// Adds the campaign targeting criteria to a campaign. + /// + /// The user. + /// The campaign id. + /// The campaign criteria id. + public long AddCampaignTargetingCriteria(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201406.CampaignCriterionService); + + // Create language criteria. + // See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + // for a detailed list of language codes. + Language language1 = new Language(); + language1.id = 1002; // French + CampaignCriterion languageCriterion1 = new CampaignCriterion(); + languageCriterion1.campaignId = campaignId; + languageCriterion1.criterion = language1; + + CampaignCriterion[] criteria = new CampaignCriterion[] {languageCriterion1}; + + List operations = new List(); + + foreach (CampaignCriterion criterion in criteria) { + CampaignCriterionOperation operation = new CampaignCriterionOperation(); + operation.@operator = Operator.ADD; + operation.operand = criterion; + operations.Add(operation); + } + + CampaignCriterionReturnValue retVal = campaignCriterionService.mutate(operations.ToArray()); + return retVal.value[0].criterion.id; + } + + /// + /// Returns an image which can be used for creating image ads. + /// + /// The image data, as an array of bytes. + public byte[] GetTestImage() { + return MediaUtilities.GetAssetDataFromUrl("http://goo.gl/HJM3L"); + } + + /// + /// Gets the geo location for a given address. + /// + /// The AdWords user. + /// The address for which geolocation should be + /// fetched. + /// Geo location for the address. + public GeoLocation GetLocationForAddress(AdWordsUser user, Address address) { + GeoLocationService geoService = + (GeoLocationService) user.GetService(AdWordsService.v201406.GeoLocationService); + + GeoLocationSelector selector = new GeoLocationSelector(); + selector.addresses = new Address[] {address}; + return geoService.get(selector)[0]; + } + + /// + /// Gets the current timestamp. + /// + /// The timestamp as a string. + public string GetTimeStamp() { + return (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalMilliseconds.ToString(); + } + } +} diff --git a/tests/AdWords/v201406/VersionedExampleTestsBase.cs b/tests/AdWords/v201406/VersionedExampleTestsBase.cs new file mode 100644 index 00000000000..423bcce08f8 --- /dev/null +++ b/tests/AdWords/v201406/VersionedExampleTestsBase.cs @@ -0,0 +1,35 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Base class for code examples that adds version-specific features. + /// + class VersionedExampleTestsBase : ExampleTestsBase { + /// + /// Test utilities instance for support functionality when running tests. + /// + protected TestUtils utils = new TestUtils(); + + /// + /// Default public constructor. + /// + public VersionedExampleTestsBase() : base() { + } + } +} diff --git a/tests/AdXBuyer/AdWords.Tests.csproj b/tests/AdXBuyer/AdWords.Tests.csproj new file mode 100644 index 00000000000..55300382673 --- /dev/null +++ b/tests/AdXBuyer/AdWords.Tests.csproj @@ -0,0 +1,127 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {6D64AF43-1FC4-4128-9496-5ECE53F00B7F} + Library + Properties + Google.Api.Ads.AdWords.Tests + Google.AdWords.Tests + v4.0 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AnyCPU + 0618 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\lib\NUnit\nunit.framework.dll + + + + + + + + + + {277404DB-A439-4450-B3A5-186294CDF245} + Common + + + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6} + Common.Tests + + + {01EF0848-0412-4AA5-9360-033E2060447F} + AdWords.Examples.CSharp + + + {D64BB23B-38E7-4E7D-88AD-2D608C713F1C} + AdWords.Examples.VB + + + {50C9CC2A-0664-4CFA-B72D-AEE6C91BD745} + AdWords + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/AdXBuyer/AdWordsRequestInterceptor.cs b/tests/AdXBuyer/AdWordsRequestInterceptor.cs new file mode 100644 index 00000000000..a1f8c6c06e4 --- /dev/null +++ b/tests/AdXBuyer/AdWordsRequestInterceptor.cs @@ -0,0 +1,90 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.Common.Tests; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.Net; +using System.Reflection; +using System.Text; + +namespace Google.Api.Ads.AdWords.Tests { + /// + /// Intercepts SOAP messages from AdWords API client library for testing + /// purposes. + /// + public class AdWordsRequestInterceptor : WebRequestInterceptor { + /// + /// The queue that holds the messages being mocked. + /// + static Queue messageQueue = new Queue(); + + /// + /// Content type for SOAP messages. + /// + public const string SOAP_RESPONSE_TYPE = "text/xml; charset=UTF-8"; + + /// + /// Singleton instance. + /// + private static WebRequestInterceptor instance; + + + /// + /// Gets the only instance. + /// + public static WebRequestInterceptor Instance { + get { + return instance; + } + } + + /// + /// Initializes the class. + /// + static AdWordsRequestInterceptor() { + AdWordsAppConfig config = new AdWordsAppConfig(); + instance = new AdWordsRequestInterceptor(); + WebRequest.RegisterPrefix(config.AdWordsApiServer, instance); + } + + /// + /// Loads the messages for mock sequence. + /// + /// The messages for mock purposes. + /// The callbac to be called before sending response. + /// + public void LoadMessages(HttpMessage[] messages, OnBeforeSendResponse callback) { + messageQueue.Clear(); + foreach (HttpMessage message in messages) { + messageQueue.Enqueue(message); + } + BeforeSendResponse += callback; + } + + public override HttpMessage GetNextMessage() { + if (messageQueue.Count != 0) { + return messageQueue.Dequeue(); + } else { + throw new WebException("Mock queue is empty.", WebExceptionStatus.SendFailure); + } + } + } +} diff --git a/tests/AdXBuyer/App.config b/tests/AdXBuyer/App.config new file mode 100644 index 00000000000..1ee298baf62 --- /dev/null +++ b/tests/AdXBuyer/App.config @@ -0,0 +1,192 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/AdXBuyer/ExampleTestsBase.cs b/tests/AdXBuyer/ExampleTestsBase.cs new file mode 100644 index 00000000000..9978cbba6f8 --- /dev/null +++ b/tests/AdXBuyer/ExampleTestsBase.cs @@ -0,0 +1,178 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.Common.Tests; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Threading; +using System.Xml; +using Google.Api.Ads.Common.Lib; + +namespace Google.Api.Ads.AdWords.Tests { + /// + /// UnitTests for code examples. + /// + public class ExampleTestsBase { + /// + /// The AdWordsUser instance for running code examples. + /// + protected AdWordsUser user = new AdWordsUser(); + + /// + /// The interceptor for ClientLogin requests when running mocked code + /// examples. + /// + protected ClientLoginRequestInterceptor clientLoginInterceptor = + ClientLoginRequestInterceptor.Instance as ClientLoginRequestInterceptor; + + /// + /// The interceptor for AdWords API requests when running mocked code + /// examples. + /// + protected AdWordsRequestInterceptor awapiInterceptor = + AdWordsRequestInterceptor.Instance as AdWordsRequestInterceptor; + + /// + /// Default public constructor. + /// + public ExampleTestsBase() : base() { + } + + /// + /// Runs a code example in mocked mode. + /// + /// The mock data for mocking SOAP request and + /// responses for API calls. + /// The delegate that initializes and runs the + /// code example. + /// The callback to be called before mocked responses + /// are sent. You could use this callback to verify if the request was + /// serialized correctly. + /// This method is not thread safe, but since NUnit can run tests + /// only in a single threaded mode, thread safety is not a requirement. + /// + protected void RunMockedExample(ExamplesMockData mockData, TestDelegate exampleDelegate, + WebRequestInterceptor.OnBeforeSendResponse callback) { + TextWriter oldWriter = Console.Out; + try { + clientLoginInterceptor.Intercept = true; + clientLoginInterceptor.RaiseException = false; + awapiInterceptor.Intercept = true; + AuthToken.Cache.Clear(); + awapiInterceptor.LoadMessages(mockData.MockMessages, + delegate(Uri requestUri, WebHeaderCollection headers, String body) { + VerifySoapHeaders(requestUri, body); + callback(requestUri, headers, body); + } + ); + StringWriter newWriter = new StringWriter(); + Console.SetOut(newWriter); + AdWordsAppConfig config = (user.Config as AdWordsAppConfig); + exampleDelegate.Invoke(); + Assert.AreEqual(newWriter.ToString().Trim(), mockData.ExpectedOutput.Trim()); + } finally { + Console.SetOut(oldWriter); + clientLoginInterceptor.Intercept = false; + awapiInterceptor.Intercept = false; + } + } + + /// + /// Runs a code example. + /// + /// The delegate that initializes and runs the + /// code example. + protected void RunExample(TestDelegate exampleDelegate) { + Thread.Sleep(3000); + StringWriter writer = new StringWriter(); + Assert.DoesNotThrow(delegate() { + TextWriter oldWriter = Console.Out; + Console.SetOut(writer); + AuthToken.Cache.Clear(); + exampleDelegate.Invoke(); + Console.SetOut(oldWriter); + Console.WriteLine(writer.ToString()); + }); + } + + /// + /// Loads the mock data for a code example. + /// + /// The mock data. + /// The parsed mock data. + protected ExamplesMockData LoadMockData(string mockData) { + List messages = new List(); + + XmlDocument xDoc = new XmlDocument(); + xDoc.LoadXml(mockData); + XmlNodeList soapNodes = xDoc.SelectNodes("Example/SOAP"); + + foreach (XmlElement soapNode in soapNodes) { + messages.Add(new HttpMessage(soapNode.SelectSingleNode("Request").InnerText, + soapNode.SelectSingleNode("Response").InnerText, + AdWordsRequestInterceptor.SOAP_RESPONSE_TYPE)); + } + return new ExamplesMockData(messages.ToArray(), xDoc.SelectSingleNode("Example/Output"). + InnerText); + } + + /// + /// Verifies the SOAP headers. + /// + /// The request URI. + /// The request body. + protected void VerifySoapHeaders(Uri requestUri, string requestBody) { + AdWordsAppConfig config = user.Config as AdWordsAppConfig; + + if (requestUri.AbsoluteUri.StartsWith(config.AdWordsApiServer)) { + XmlDocument xDoc = new XmlDocument(); + xDoc.LoadXml(requestBody); + + XmlNamespaceManager xmlns = new XmlNamespaceManager(xDoc.NameTable); + xmlns.AddNamespace("soap", "http://schemas.xmlsoap.org/soap/envelope/"); + XmlElement requestHeaders = (XmlElement) xDoc.SelectSingleNode( + "soap:Envelope/soap:Header/child::*", xmlns); + Assert.NotNull(requestHeaders); + Assert.AreEqual(requestHeaders.Name, "RequestHeader"); + foreach (XmlElement childNode in requestHeaders.ChildNodes) { + switch (childNode.Name) { + case "authToken": + Assert.AreEqual(childNode.InnerText, "AUTH_TOKEN"); + break; + + case "developerToken": + Assert.AreEqual(childNode.InnerText, config.DeveloperToken); + break; + + case "clientCustomerId": + Assert.AreEqual(childNode.InnerText, config.ClientCustomerId); + break; + + case "userAgent": + Assert.AreEqual(childNode.InnerText, config.GetUserAgent()); + break; + } + } + } + } + } +} diff --git a/tests/AdXBuyer/ExamplesMockData.cs b/tests/AdXBuyer/ExamplesMockData.cs new file mode 100644 index 00000000000..14207ff6d69 --- /dev/null +++ b/tests/AdXBuyer/ExamplesMockData.cs @@ -0,0 +1,68 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Tests; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Google.Api.Ads.AdWords.Tests { + /// + /// Contains mock data for a given code example. + /// + public class ExamplesMockData { + /// + /// List of HTTP messages to be mocked. + /// + HttpMessage[] mockMessages = null; + + /// + /// Expected output from the code example. + /// + string expectedOutput = ""; + + /// + /// Overloaded constructor. + /// + /// The list of HTTP messages to be mocked. + /// + /// Expected output from the code example. + /// + public ExamplesMockData(HttpMessage[] mockMessages, string expectedOutput) { + this.mockMessages = mockMessages; + this.expectedOutput = expectedOutput; + } + + /// + /// Gets the mock messages. + /// + public HttpMessage[] MockMessages { + get { + return mockMessages; + } + } + + /// + /// Gets the expected output. + /// + public string ExpectedOutput { + get { + return expectedOutput; + } + } + } +} diff --git a/tests/AdXBuyer/Lib/AdWordsServiceFactoryTests.cs b/tests/AdXBuyer/Lib/AdWordsServiceFactoryTests.cs new file mode 100644 index 00000000000..47669cd13a3 --- /dev/null +++ b/tests/AdXBuyer/Lib/AdWordsServiceFactoryTests.cs @@ -0,0 +1,112 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.AdWords.Lib; +using NUnit.Framework; + + +namespace Google.Api.Ads.AdWords.Tests.Lib { + /// + /// Tests for the AdWordsServiceFactory + /// + [TestFixture] + class AdWordsServiceFactoryTests { + private const string DEPRECATED_CLIENT_LOGIN_VERSION = "v201402"; + private const string SUPPORTED_CLIENT_LOGIN_VERSION = "v201309"; + private const string TEST_SERVICE = "MediaService"; + private const string TEST_GROUP_NAME = "express"; + + private AdWordsServiceFactory serviceFactory; + private ServiceSignature serviceSignature; + private Uri testUri; + + /// + /// Default public constructor. + /// + public AdWordsServiceFactoryTests() { + + } + + [SetUp] + public void Init() { + serviceFactory = new AdWordsServiceFactory(); + testUri = new Uri("https://google.com"); + } + + /// + /// Test that creating a service using ClientLogin in a deprecated version + /// throws an exception + /// + [Test] + [ExpectedException(typeof(AdWordsException))] + public void TestCreateServiceClientLoginDeprecated() { + ConfigureForClientLogin(); + serviceSignature = new AdWordsServiceSignature(DEPRECATED_CLIENT_LOGIN_VERSION, + TEST_SERVICE, TEST_GROUP_NAME); + serviceFactory.CreateService(serviceSignature, new AdWordsUser(), testUri); + } + + /// + /// Test that creating a service using ClientLogin in a supported version does not + /// throw an exception + /// + [Test] + public void TestCreateServiceClientLoginSupported() { + ConfigureForClientLogin(); + serviceSignature = new AdWordsServiceSignature(SUPPORTED_CLIENT_LOGIN_VERSION, + TEST_SERVICE, TEST_GROUP_NAME); + serviceFactory.CreateService(serviceSignature, new AdWordsUser(), testUri); + } + + /// + /// Test creating a service using OAuth2 in a version where ClientLogin is supported + /// + [Test] + public void TestCreateServiceOAuth2ClientLoginSupported() { + ConfigureForOAuth2(); + serviceSignature = new AdWordsServiceSignature(SUPPORTED_CLIENT_LOGIN_VERSION, + TEST_SERVICE, TEST_GROUP_NAME); + serviceFactory.CreateService(serviceSignature, new AdWordsUser(), testUri); + } + + /// + /// Test creating a service using OAuth2 in a version where ClientLogin is deprecated + /// + [Test] + public void TestCreateServiceOAuth2ClientLoginDeprecated() { + ConfigureForOAuth2(); + serviceSignature = new AdWordsServiceSignature(DEPRECATED_CLIENT_LOGIN_VERSION, + TEST_SERVICE, TEST_GROUP_NAME); + serviceFactory.CreateService(serviceSignature, new AdWordsUser(), testUri); + } + + private void ConfigureForOAuth2() { + AdWordsAppConfig config = new AdWordsAppConfig(); + config.AuthorizationMethod = AdWordsAuthorizationMethod.OAuth2; + serviceFactory.Config = config; + } + + private void ConfigureForClientLogin() { + AdWordsAppConfig config = new AdWordsAppConfig(); + config.AuthorizationMethod = AdWordsAuthorizationMethod.ClientLogin; + serviceFactory.Config = config; + } + } +} diff --git a/tests/AdXBuyer/Properties/AssemblyInfo.cs b/tests/AdXBuyer/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..63c0c1dd678 --- /dev/null +++ b/tests/AdXBuyer/Properties/AssemblyInfo.cs @@ -0,0 +1,37 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("AdWords API Client Library Tests")] +[assembly: AssemblyDescription( + "This library contains NUnit tests for the client library.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d5c43f55-9efa-408a-98cd-795ee48b558d")] diff --git a/tests/AdXBuyer/Properties/Properties.cs b/tests/AdXBuyer/Properties/Properties.cs new file mode 100644 index 00000000000..de944c8264a --- /dev/null +++ b/tests/AdXBuyer/Properties/Properties.cs @@ -0,0 +1,24 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; + +[assembly: AssemblyCompany("Google")] +[assembly: AssemblyProduct("AdWords API DotNet Client Library")] +[assembly: AssemblyCopyright("Copyright 2011, Google Inc. All Rights Reserved.")] + +[assembly: AssemblyVersion("18.0.0.0")] +[assembly: AssemblyFileVersion("18.0.0.0")] diff --git a/tests/AdXBuyer/Util/v201309/MapUtilitiesTest.cs b/tests/AdXBuyer/Util/v201309/MapUtilitiesTest.cs new file mode 100644 index 00000000000..43abfc745af --- /dev/null +++ b/tests/AdXBuyer/Util/v201309/MapUtilitiesTest.cs @@ -0,0 +1,129 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + + +using Google.Api.Ads.AdWords.Util.v201309; +using Google.Api.Ads.AdWords.v201309; + +using System; +using System.Collections.Generic; +using System.Text; + +using NUnit.Framework; + +namespace Google.Api.Ads.AdWords.Tests.Util.v201309 { + /// + /// Tests for MapUtilities class. + /// + public class MapUtilitiesTest { + /// + /// Internal MapUtils instance for testing purposes. + /// + private MapUtilities mapUtils; + + /// + /// Initializes this instance. + /// + [SetUp] + public void Init() { + this.mapUtils = new MapUtilities(); + } + + /// + /// Tests the Add method. + /// + [Test] + public void TestAddKeyValue() { + mapUtils.Add("key1", "value1"); + mapUtils.Add("key2", "value2"); + String_StringMapEntry[] entries = mapUtils.AsArray(); + Assert.AreEqual(2, entries.Length); + Assert.AreEqual(entries[0].key, "key1"); + Assert.AreEqual(entries[0].value, "value1"); + Assert.AreEqual(entries[1].key, "key2"); + Assert.AreEqual(entries[1].value, "value2"); + } + + /// + /// Tests the AddEntry method. + /// + [Test] + public void TestAddEntry() { + String_StringMapEntry item1 = new String_StringMapEntry(); + item1.key = "key3"; + item1.value = "value3"; + mapUtils.AddEntry(item1); + + String_StringMapEntry item2 = new String_StringMapEntry(); + item2.key = "key4"; + item2.value = "value4"; + mapUtils.AddEntry(item2); + + String_StringMapEntry[] entries = mapUtils.AsArray(); + Assert.AreEqual(2, entries.Length); + Assert.AreEqual(entries[0].key, item1.key); + Assert.AreEqual(entries[0].value, item1.value); + Assert.AreEqual(entries[1].key, item2.key); + Assert.AreEqual(entries[1].value, item2.value); + } + + /// + /// Tests the AddEntries method. + /// + [Test] + public void TestAddEntries() { + String_StringMapEntry item1 = new String_StringMapEntry(); + item1.key = "key5"; + item1.value = "value5"; + + String_StringMapEntry item2 = new String_StringMapEntry(); + item2.key = "key6"; + item2.value = "value6"; + + mapUtils.AddEntries(new String_StringMapEntry[] {item1, item2}); + + String_StringMapEntry[] entries = mapUtils.AsArray(); + Assert.AreEqual(2, entries.Length); + Assert.AreEqual(entries[0].key, item1.key); + Assert.AreEqual(entries[0].value, item1.value); + Assert.AreEqual(entries[1].key, item2.key); + Assert.AreEqual(entries[1].value, item2.value); + } + + /// + /// Tests the AsDict method. + /// + [Test] + public void TestAsDict() { + String_StringMapEntry item1 = new String_StringMapEntry(); + item1.key = "key7"; + item1.value = "value7"; + + String_StringMapEntry item2 = new String_StringMapEntry(); + item2.key = "key8"; + item2.value = "value8"; + + mapUtils.AddEntries(new String_StringMapEntry[] {item1, item2}); + + Dictionary entries = mapUtils.AsDict(); + Assert.AreEqual(2, entries.Count); + Assert.True(entries.ContainsKey("key7")); + Assert.True(entries.ContainsKey("key8")); + Assert.AreEqual(entries["key7"], item1.value); + Assert.AreEqual(entries["key8"], item2.value); + } + } +} diff --git a/tests/AdXBuyer/Util/v201402/MapUtilitiesTest.cs b/tests/AdXBuyer/Util/v201402/MapUtilitiesTest.cs new file mode 100644 index 00000000000..443f0f35739 --- /dev/null +++ b/tests/AdXBuyer/Util/v201402/MapUtilitiesTest.cs @@ -0,0 +1,129 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + + +using Google.Api.Ads.AdWords.Util.v201402; +using Google.Api.Ads.AdWords.v201402; + +using System; +using System.Collections.Generic; +using System.Text; + +using NUnit.Framework; + +namespace Google.Api.Ads.AdWords.Tests.Util.v201402 { + /// + /// Tests for MapUtilities class. + /// + public class MapUtilitiesTest { + /// + /// Internal MapUtils instance for testing purposes. + /// + private MapUtilities mapUtils; + + /// + /// Initializes this instance. + /// + [SetUp] + public void Init() { + this.mapUtils = new MapUtilities(); + } + + /// + /// Tests the Add method. + /// + [Test] + public void TestAddKeyValue() { + mapUtils.Add("key1", "value1"); + mapUtils.Add("key2", "value2"); + String_StringMapEntry[] entries = mapUtils.AsArray(); + Assert.AreEqual(2, entries.Length); + Assert.AreEqual(entries[0].key, "key1"); + Assert.AreEqual(entries[0].value, "value1"); + Assert.AreEqual(entries[1].key, "key2"); + Assert.AreEqual(entries[1].value, "value2"); + } + + /// + /// Tests the AddEntry method. + /// + [Test] + public void TestAddEntry() { + String_StringMapEntry item1 = new String_StringMapEntry(); + item1.key = "key3"; + item1.value = "value3"; + mapUtils.AddEntry(item1); + + String_StringMapEntry item2 = new String_StringMapEntry(); + item2.key = "key4"; + item2.value = "value4"; + mapUtils.AddEntry(item2); + + String_StringMapEntry[] entries = mapUtils.AsArray(); + Assert.AreEqual(2, entries.Length); + Assert.AreEqual(entries[0].key, item1.key); + Assert.AreEqual(entries[0].value, item1.value); + Assert.AreEqual(entries[1].key, item2.key); + Assert.AreEqual(entries[1].value, item2.value); + } + + /// + /// Tests the AddEntries method. + /// + [Test] + public void TestAddEntries() { + String_StringMapEntry item1 = new String_StringMapEntry(); + item1.key = "key5"; + item1.value = "value5"; + + String_StringMapEntry item2 = new String_StringMapEntry(); + item2.key = "key6"; + item2.value = "value6"; + + mapUtils.AddEntries(new String_StringMapEntry[] {item1, item2}); + + String_StringMapEntry[] entries = mapUtils.AsArray(); + Assert.AreEqual(2, entries.Length); + Assert.AreEqual(entries[0].key, item1.key); + Assert.AreEqual(entries[0].value, item1.value); + Assert.AreEqual(entries[1].key, item2.key); + Assert.AreEqual(entries[1].value, item2.value); + } + + /// + /// Tests the AsDict method. + /// + [Test] + public void TestAsDict() { + String_StringMapEntry item1 = new String_StringMapEntry(); + item1.key = "key7"; + item1.value = "value7"; + + String_StringMapEntry item2 = new String_StringMapEntry(); + item2.key = "key8"; + item2.value = "value8"; + + mapUtils.AddEntries(new String_StringMapEntry[] {item1, item2}); + + Dictionary entries = mapUtils.AsDict(); + Assert.AreEqual(2, entries.Count); + Assert.True(entries.ContainsKey("key7")); + Assert.True(entries.ContainsKey("key8")); + Assert.AreEqual(entries["key7"], item1.value); + Assert.AreEqual(entries["key8"], item2.value); + } + } +} diff --git a/tests/AdXBuyer/Util/v201406/MapUtilitiesTest.cs b/tests/AdXBuyer/Util/v201406/MapUtilitiesTest.cs new file mode 100644 index 00000000000..e1edf61d408 --- /dev/null +++ b/tests/AdXBuyer/Util/v201406/MapUtilitiesTest.cs @@ -0,0 +1,129 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + + +using Google.Api.Ads.AdWords.Util.v201406; +using Google.Api.Ads.AdWords.v201406; + +using System; +using System.Collections.Generic; +using System.Text; + +using NUnit.Framework; + +namespace Google.Api.Ads.AdWords.Tests.Util.v201406 { + /// + /// Tests for MapUtilities class. + /// + public class MapUtilitiesTest { + /// + /// Internal MapUtils instance for testing purposes. + /// + private MapUtilities mapUtils; + + /// + /// Initializes this instance. + /// + [SetUp] + public void Init() { + this.mapUtils = new MapUtilities(); + } + + /// + /// Tests the Add method. + /// + [Test] + public void TestAddKeyValue() { + mapUtils.Add("key1", "value1"); + mapUtils.Add("key2", "value2"); + String_StringMapEntry[] entries = mapUtils.AsArray(); + Assert.AreEqual(2, entries.Length); + Assert.AreEqual(entries[0].key, "key1"); + Assert.AreEqual(entries[0].value, "value1"); + Assert.AreEqual(entries[1].key, "key2"); + Assert.AreEqual(entries[1].value, "value2"); + } + + /// + /// Tests the AddEntry method. + /// + [Test] + public void TestAddEntry() { + String_StringMapEntry item1 = new String_StringMapEntry(); + item1.key = "key3"; + item1.value = "value3"; + mapUtils.AddEntry(item1); + + String_StringMapEntry item2 = new String_StringMapEntry(); + item2.key = "key4"; + item2.value = "value4"; + mapUtils.AddEntry(item2); + + String_StringMapEntry[] entries = mapUtils.AsArray(); + Assert.AreEqual(2, entries.Length); + Assert.AreEqual(entries[0].key, item1.key); + Assert.AreEqual(entries[0].value, item1.value); + Assert.AreEqual(entries[1].key, item2.key); + Assert.AreEqual(entries[1].value, item2.value); + } + + /// + /// Tests the AddEntries method. + /// + [Test] + public void TestAddEntries() { + String_StringMapEntry item1 = new String_StringMapEntry(); + item1.key = "key5"; + item1.value = "value5"; + + String_StringMapEntry item2 = new String_StringMapEntry(); + item2.key = "key6"; + item2.value = "value6"; + + mapUtils.AddEntries(new String_StringMapEntry[] {item1, item2}); + + String_StringMapEntry[] entries = mapUtils.AsArray(); + Assert.AreEqual(2, entries.Length); + Assert.AreEqual(entries[0].key, item1.key); + Assert.AreEqual(entries[0].value, item1.value); + Assert.AreEqual(entries[1].key, item2.key); + Assert.AreEqual(entries[1].value, item2.value); + } + + /// + /// Tests the AsDict method. + /// + [Test] + public void TestAsDict() { + String_StringMapEntry item1 = new String_StringMapEntry(); + item1.key = "key7"; + item1.value = "value7"; + + String_StringMapEntry item2 = new String_StringMapEntry(); + item2.key = "key8"; + item2.value = "value8"; + + mapUtils.AddEntries(new String_StringMapEntry[] {item1, item2}); + + Dictionary entries = mapUtils.AsDict(); + Assert.AreEqual(2, entries.Count); + Assert.True(entries.ContainsKey("key7")); + Assert.True(entries.ContainsKey("key8")); + Assert.AreEqual(entries["key7"], item1.value); + Assert.AreEqual(entries["key8"], item2.value); + } + } +} diff --git a/tests/AdXBuyer/v201309/AccountManagementTest.cs b/tests/AdXBuyer/v201309/AccountManagementTest.cs new file mode 100644 index 00000000000..f650af108a4 --- /dev/null +++ b/tests/AdXBuyer/v201309/AccountManagementTest.cs @@ -0,0 +1,56 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201309; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201309; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Test cases for all the code examples under v201309\AccountManagement. + /// + class AccountManagementTest : VersionedExampleTestsBase { + /// + /// Tests the GetAccountChanges VB.NET code example. + /// + [Test] + public void TestGetAccountChangesVBExample() { + RunExample(delegate() { + new VBExamples.GetAccountChanges().Run(user); + }); + } + + /// + /// Tests the GetAccountChanges C# code example. + /// + [Test] + public void TestGetAccountChangesCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAccountChanges().Run(user); + }); + } + } +} diff --git a/tests/AdXBuyer/v201309/AdvancedOperationsTest.cs b/tests/AdXBuyer/v201309/AdvancedOperationsTest.cs new file mode 100644 index 00000000000..7c79c3cb28c --- /dev/null +++ b/tests/AdXBuyer/v201309/AdvancedOperationsTest.cs @@ -0,0 +1,90 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.v201309; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201309; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201309; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Test cases for all the code examples under v201309\AdvancedOperations. + /// + class AdvancedOperationsTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + long adId; + long keywordId; + const double BID_MODIFIER = 0.2; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateCampaign(user, BiddingStrategyType.MANUAL_CPM); + adGroupId = utils.CreateAdGroup(user, campaignId); + } + + /// + /// Tests the AddAdGroupBidModifier C# code example. + /// + [Test] + public void TestAddAdGroupBidModifierCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddAdGroupBidModifier().Run(user, adGroupId, BID_MODIFIER); + }); + } + + /// + /// Tests the AddAdGroupBidModifier VB.NET code example. + /// + [Test] + public void TestAddAdGroupBidModifierVBExample() { + RunExample(delegate() { + new VBExamples.AddAdGroupBidModifier().Run(user, adGroupId, BID_MODIFIER); + }); + } + + /// + /// Tests the GetAdGroupBidModifiers C# code example. + /// + [Test] + public void TestGetAdGroupBidModifiersCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAdGroupBidModifiers().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAdGroupBidModifiers VB.NET code example. + /// + [Test] + public void TestGetAdGroupBidModifiersVBExample() { + RunExample(delegate() { + new VBExamples.GetAdGroupBidModifiers().Run(user, campaignId); + }); + } + } +} diff --git a/tests/AdXBuyer/v201309/BasicOperationsTest.cs b/tests/AdXBuyer/v201309/BasicOperationsTest.cs new file mode 100644 index 00000000000..561c8d4145d --- /dev/null +++ b/tests/AdXBuyer/v201309/BasicOperationsTest.cs @@ -0,0 +1,391 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.v201309; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201309; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201309; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Test cases for all the code examples under v201309\BasicOperations. + /// + class BasicOperationsTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + long adId; + long placementId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateCampaign(user, BiddingStrategyType.MANUAL_CPM); + adGroupId = utils.CreateAdGroup(user, campaignId, true); + adId = utils.CreateTextAd(user, adGroupId, false); + placementId = utils.CreatePlacement(user, adGroupId); + } + + /// + /// Tests the AddAdGroup VB.NET code example. + /// + [Test] + public void TestAddAdGroupVBExample() { + RunExample(delegate() { + new VBExamples.AddAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the AddAdGroup C# code example. + /// + [Test] + public void TestAddAdGroupCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the AddCampaign VB.NET code example. + /// + [Test] + public void TestAddCampaignVBExample() { + RunExample(delegate() { + new VBExamples.AddCampaigns().Run(user); + }); + } + + /// + /// Tests the AddCampaign C# code example. + /// + [Test] + public void TestAddCampaignCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddCampaigns().Run(user); + }); + } + + /// + /// Tests the AddPlacements VB.NET code example. + /// + [Test] + public void TestAddPlacementsVBExample() { + RunExample(delegate() { + new VBExamples.AddPlacements().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddPlacements C# code example. + /// + [Test] + public void TestAddPlacementsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddPlacements().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddThirdPartyRedirectAd VB.NET code example. + /// + [Test] + public void TestAddThirdPartyRedirectAdVBExample() { + RunExample(delegate() { + new VBExamples.AddThirdPartyRedirectAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddThirdPartyRedirectAd C# code example. + /// + [Test] + public void TestAddThirdPartyRedirectAdCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddThirdPartyRedirectAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the DeleteAdGroup VB.NET code example. + /// + [Test] + public void TestDeleteAdGroupVBExample() { + RunExample(delegate() { + new VBExamples.DeleteAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the DeleteAdGroup C# code example. + /// + [Test] + public void TestDeleteAdGroupCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DeleteAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the DeleteAd VB.NET code example. + /// + [Test] + public void TestDeleteAdVBExample() { + RunExample(delegate() { + new VBExamples.DeleteAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the DeleteAd C# code example. + /// + [Test] + public void TestDeleteAdCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DeleteAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the DeleteCampaign VB.NET code example. + /// + [Test] + public void TestDeleteCampaignVBExample() { + RunExample(delegate() { + new VBExamples.DeleteCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the DeleteCampaign C# code example. + /// + [Test] + public void TestDeleteCampaignCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DeleteCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the DeletePlacement VB.NET code example. + /// + [Test] + public void TestDeletePlacementVBExample() { + RunExample(delegate() { + new VBExamples.DeletePlacement().Run(user, adGroupId, placementId); + }); + } + + /// + /// Tests the DeletePlacement C# code example. + /// + [Test] + public void TestDeletePlacementCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DeletePlacement().Run(user, adGroupId, placementId); + }); + } + + /// + /// Tests the GetAdGroups VB.NET code example. + /// + [Test] + public void TestGetAdGroupsVBExample() { + RunExample(delegate() { + new VBExamples.GetAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAdGroups C# code example. + /// + [Test] + public void TestGetAdGroupsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the GetCampaigns VB.NET code example. + /// + [Test] + public void TestGetCampaignsVBExample() { + RunExample(delegate() { + new VBExamples.GetCampaigns().Run(user); + }); + } + + /// + /// Tests the GetCampaigns C# code example. + /// + [Test] + public void TestGetCampaignsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetCampaigns().Run(user); + }); + } + + /// + /// Tests the GetCampaignsWithAwql VB.NET code example. + /// + [Test] + public void TestGetCampaignsWithAwqlVBExample() { + RunExample(delegate() { + new VBExamples.GetCampaignsWithAwql().Run(user); + }); + } + + /// + /// Tests the GetCampaignsWithAwql C# code example. + /// + [Test] + public void TestGetCampaignsWithAwqlCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetCampaignsWithAwql().Run(user); + }); + } + + /// + /// Tests the GetPlacements VB.NET code example. + /// + [Test] + public void TestGetPlacementsVBExample() { + RunExample(delegate() { + new VBExamples.GetPlacements().Run(user); + }); + } + + /// + /// Tests the GetPlacements C# code example. + /// + [Test] + public void TestGetPlacementsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetPlacements().Run(user); + }); + } + + /// + /// Tests the GetThirdPartyRedirectAds VB.NET code example. + /// + [Test] + public void TestGetThirdPartyRedirectAdsVBExample() { + RunExample(delegate() { + new VBExamples.GetThirdPartyRedirectAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the GetThirdPartyRedirectAds C# code example. + /// + [Test] + public void TestGetThirdPartyRedirectAdsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetThirdPartyRedirectAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the PauseAd VB.NET code example. + /// + [Test] + public void TestPauseAdVBExample() { + RunExample(delegate() { + new VBExamples.PauseAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the PauseAd C# code example. + /// + [Test] + public void TestPauseAdCSharpExample() { + RunExample(delegate() { + new CSharpExamples.PauseAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the UpdateAdGroup VB.NET code example. + /// + [Test] + public void TestUpdateAdGroupVBExample() { + RunExample(delegate() { + new VBExamples.UpdateAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the UpdateAdGroup C# code example. + /// + [Test] + public void TestUpdateAdGroupCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UpdateAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the UpdateCampaign VB.NET code example. + /// + [Test] + public void TestUpdateCampaignVBExample() { + RunExample(delegate() { + new VBExamples.UpdateCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the UpdateCampaign C# code example. + /// + [Test] + public void TestUpdateCampaignCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UpdateCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the UpdatePlacement VB.NET code example. + /// + [Test] + public void TestUpdatePlacementVBExample() { + RunExample(delegate() { + new VBExamples.UpdatePlacement().Run(user, adGroupId, placementId); + }); + } + + /// + /// Tests the UpdatePlacement C# code example. + /// + [Test] + public void TestUpdatePlacementCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UpdatePlacement().Run(user, adGroupId, placementId); + }); + } + } +} diff --git a/tests/AdXBuyer/v201309/CampaignManagementTest.cs b/tests/AdXBuyer/v201309/CampaignManagementTest.cs new file mode 100644 index 00000000000..ff67fcf102c --- /dev/null +++ b/tests/AdXBuyer/v201309/CampaignManagementTest.cs @@ -0,0 +1,108 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201309; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201309; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Test cases for all the code examples under v201309\CampaignManagement. + /// + class CampaignManagementTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateCampaign(user, BiddingStrategyType.MANUAL_CPM); + adGroupId = utils.CreateAdGroup(user, campaignId, true); + } + + /// + /// Tests the AddKeywordsInBulk VB.NET code example. + /// + [Test] + public void TestAddPlacementsInBulkVBExample() { + RunExample(delegate() { + new VBExamples.AddPlacementsInBulk().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddKeywordsInBulk C# code example. + /// + [Test] + public void TestAddPlacementsInBulkCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddPlacementsInBulk().Run(user, adGroupId); + }); + } + + /// + /// Tests the GetAllDisapprovedAds VB.NET code example. + /// + [Test] + public void TestGetAllDisapprovedAdsVBExample() { + RunExample(delegate() { + new VBExamples.GetAllDisapprovedAds().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAllDisapprovedAds C# code example. + /// + [Test] + public void TestGetAllDisapprovedAdsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAllDisapprovedAds().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAllDisapprovedAdsWithAwql VB.NET code example. + /// + [Test] + public void TestGetAllDisapprovedAdsWithAwqlVBExample() { + RunExample(delegate() { + new VBExamples.GetAllDisapprovedAdsWithAwql().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAllDisapprovedAdsWithAwql C# code example. + /// + [Test] + public void TestGetAllDisapprovedAdsWithAwqlCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAllDisapprovedAdsWithAwql().Run(user, campaignId); + }); + } + } +} diff --git a/tests/AdXBuyer/v201309/ErrorHandlingTest.cs b/tests/AdXBuyer/v201309/ErrorHandlingTest.cs new file mode 100644 index 00000000000..0a8281a5302 --- /dev/null +++ b/tests/AdXBuyer/v201309/ErrorHandlingTest.cs @@ -0,0 +1,108 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201309; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201309; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Test cases for all the code examples under v201309\ErrorHandling. + /// + class ErrorHandlingTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateCampaign(user, BiddingStrategyType.MANUAL_CPM); + adGroupId = utils.CreateAdGroup(user, campaignId); + } + + /// + /// Tests the HandlePartialFailures VB.NET code example. + /// + [Test] + public void TestHandlePartialFailuresVBExample() { + RunExample(delegate() { + new VBExamples.HandlePartialFailures().Run(user, adGroupId); + }); + } + + /// + /// Tests the HandlePartialFailures C# code example. + /// + [Test] + public void TestHandlePartialFailuresCSharpExample() { + RunExample(delegate() { + new CSharpExamples.HandlePartialFailures().Run(user, adGroupId); + }); + } + + /// + /// Tests the HandlePolicyViolationError VB.NET code example. + /// + [Test] + public void TestHandlePolicyViolationErrorVBExample() { + RunExample(delegate() { + new VBExamples.HandlePolicyViolationError().Run(user, adGroupId); + }); + } + + /// + /// Tests the HandlePolicyViolationError C# code example. + /// + [Test] + public void TestHandlePolicyViolationErrorCSharpExample() { + RunExample(delegate() { + new CSharpExamples.HandlePolicyViolationError().Run(user, adGroupId); + }); + } + + /// + /// Tests the HandleTwoFactorAuthorizationError VB.NET code example. + /// + [Test] + public void TestHandleTwoFactorAuthorizationErrorVBExample() { + RunExample(delegate() { + new VBExamples.HandleTwoFactorAuthorizationError().Run(user); + }); + } + + /// + /// Tests the HandleTwoFactorAuthorizationError C# code example. + /// + [Test] + public void TestHandleTwoFactorAuthorizationErrorCSharpExample() { + RunExample(delegate() { + new CSharpExamples.HandleTwoFactorAuthorizationError().Run(user); + }); + } + } +} diff --git a/tests/AdXBuyer/v201309/MiscellaneousTest.cs b/tests/AdXBuyer/v201309/MiscellaneousTest.cs new file mode 100644 index 00000000000..d0dc3587977 --- /dev/null +++ b/tests/AdXBuyer/v201309/MiscellaneousTest.cs @@ -0,0 +1,83 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201309; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201309; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Test cases for all the code examples under v201309\Miscellaneous. + /// + class MiscellaneousTest : VersionedExampleTestsBase { + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + } + + /// + /// Tests the GetAllVideosAndImages VB.NET code example. + /// + [Test] + public void TestGetAllVideosAndImagesVBExample() { + RunExample(delegate() { + new VBExamples.GetAllVideosAndImages().Run(user); + }); + } + + /// + /// Tests the GetAllVideosAndImages C# code example. + /// + [Test] + public void TestGetAllVideosAndImagesCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAllVideosAndImages().Run(user); + }); + } + + /// + /// Tests the UploadImage VB.NET code example. + /// + [Test] + public void TestUploadImageVBExample() { + RunExample(delegate() { + new VBExamples.UploadImage().Run(user); + }); + } + + /// + /// Tests the UploadImage C# code example. + /// + [Test] + public void TestUploadImageCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UploadImage().Run(user); + }); + } + } +} diff --git a/tests/AdXBuyer/v201309/OptimizationTest.cs b/tests/AdXBuyer/v201309/OptimizationTest.cs new file mode 100644 index 00000000000..6e710cd3600 --- /dev/null +++ b/tests/AdXBuyer/v201309/OptimizationTest.cs @@ -0,0 +1,68 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201309; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201309; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Test cases for all the code examples under v201309\Optimization. + /// + class OptimizationTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateCampaign(user, BiddingStrategyType.MANUAL_CPM); + adGroupId = utils.CreateAdGroup(user, campaignId, true); + } + + /// + /// Tests the GetPlacementIdeas VB.NET code example. + /// + [Test] + public void TestGetPlacementIdeasVBExample() { + RunExample(delegate() { + new VBExamples.GetPlacementIdeas().Run(user); + }); + } + + /// + /// Tests the GetPlacementIdeas C# code example. + /// + [Test] + public void TestGetPlacementIdeasCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetPlacementIdeas().Run(user); + }); + } + } +} diff --git a/tests/AdXBuyer/v201309/RemarketingTest.cs b/tests/AdXBuyer/v201309/RemarketingTest.cs new file mode 100644 index 00000000000..7ec2529de32 --- /dev/null +++ b/tests/AdXBuyer/v201309/RemarketingTest.cs @@ -0,0 +1,84 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201309; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201309; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Test cases for all the code examples under + /// v201309\Remarketing. + /// + class RemarketingTest : VersionedExampleTestsBase { + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + } + + /// + /// Tests the AddAudience VB.NET code example. + /// + [Test] + public void TestAddAudienceVBExample() { + RunExample(delegate() { + new VBExamples.AddAudience().Run(user); + }); + } + + /// + /// Tests the AddAudience C# code example. + /// + [Test] + public void TestAddAudienceCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddAudience().Run(user); + }); + } + + /// + /// Tests the AddConversionTracker VB.NET code example. + /// + [Test] + public void TestAddConversionTrackerVBExample() { + RunExample(delegate() { + new VBExamples.AddConversionTracker().Run(user); + }); + } + + /// + /// Tests the AddConversionTracker C# code example. + /// + [Test] + public void TestAddConversionTrackerCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddConversionTracker().Run(user); + }); + } + } +} diff --git a/tests/AdXBuyer/v201309/ReportingTest.cs b/tests/AdXBuyer/v201309/ReportingTest.cs new file mode 100644 index 00000000000..5ab714cbfb0 --- /dev/null +++ b/tests/AdXBuyer/v201309/ReportingTest.cs @@ -0,0 +1,107 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.v201309; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201309; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201309; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Test cases for all the code examples under v201309\Reporting. + /// + class ReportingTest : VersionedExampleTestsBase { + string outputFileName; + ReportDefinitionReportType reportType; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + outputFileName = Path.GetFileName(Path.GetTempFileName()); + reportType = ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT; + } + + /// + /// Tests the DownloadCriteriaReport VB.NET code example. + /// + [Test] + public void TestDownloadCriteriaReportVBExample() { + RunExample(delegate() { + new VBExamples.DownloadCriteriaReport().Run(user, outputFileName); + }); + } + + /// + /// Tests the DownloadCriteriaReport C# code example. + /// + [Test] + public void TestDownloadCriteriaReportCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DownloadCriteriaReport().Run(user, outputFileName); + }); + } + + /// + /// Tests the DownloadCriteriaReportWithAwql VB.NET code example. + /// + [Test] + public void TestDownloadCriteriaReportWithAwqlVBExample() { + RunExample(delegate() { + new VBExamples.DownloadCriteriaReportWithAwql().Run(user, outputFileName); + }); + } + + /// + /// Tests the DownloadCriteriaReportWithAwql C# code example. + /// + [Test] + public void TestDownloadCriteriaReportWithAwqlCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DownloadCriteriaReportWithAwql().Run(user, outputFileName); + }); + } + + /// + /// Tests the GetReportFields VB.NET code example. + /// + [Test] + public void TestGetReportFieldsVBExample() { + RunExample(delegate() { + new VBExamples.GetReportFields().Run(user, reportType); + }); + } + + /// + /// Tests the GetReportFields C# code example. + /// + [Test] + public void TestGetReportFieldsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetReportFields().Run(user, reportType); + }); + } + } +} diff --git a/tests/AdXBuyer/v201309/TargetingTest.cs b/tests/AdXBuyer/v201309/TargetingTest.cs new file mode 100644 index 00000000000..86501fc74a3 --- /dev/null +++ b/tests/AdXBuyer/v201309/TargetingTest.cs @@ -0,0 +1,129 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201309; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201309; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201309; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Test cases for all the code examples under v201309\Targeting. + /// + class TargetingTest : VersionedExampleTestsBase { + long campaignId; + long campaignCriterionId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateCampaign(user, BiddingStrategyType.MANUAL_CPM); + campaignCriterionId = utils.AddCampaignTargetingCriteria(user, campaignId); + } + + /// + /// Tests the AddCampaignTargetingCriteria VB.NET code example. + /// + [Test] + public void TestAddCampaignTargetingCriteriaVBExample() { + RunExample(delegate() { + new VBExamples.AddCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the AddCampaignTargetingCriteria C# code example. + /// + [Test] + public void TestAddCampaignTargetingCriteriaCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the GetCampaignTargetingCriteria VB.NET code example. + /// + [Test] + public void TestGetCampaignTargetingCriteriaVBExample() { + RunExample(delegate() { + new VBExamples.GetCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the GetCampaignTargetingCriteria C# code example. + /// + [Test] + public void TestGetCampaignTargetingCriteriaCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the GetTargetableLanguagesAndCarriers VB.NET code example. + /// + [Test] + public void TestGetTargetableLanguagesAndCarriersVBExample() { + RunExample(delegate() { + new VBExamples.GetTargetableLanguagesAndCarriers().Run(user); + }); + } + + /// + /// Tests the GetTargetableLanguagesAndCarriers C# code example. + /// + [Test] + public void TestGetTargetableLanguagesAndCarriersCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetTargetableLanguagesAndCarriers().Run(user); + }); + } + + /// + /// Tests the LookupLocation VB.NET code example. + /// + [Test] + public void TestLookupLocationVBExample() { + RunExample(delegate() { + new VBExamples.LookupLocation().Run(user); + }); + } + + /// + /// Tests the LookupLocation C# code example. + /// + [Test] + public void TestLookupLocationCSharpExample() { + RunExample(delegate() { + new CSharpExamples.LookupLocation().Run(user); + }); + } + + } +} diff --git a/tests/AdXBuyer/v201309/TestUtils.cs b/tests/AdXBuyer/v201309/TestUtils.cs new file mode 100644 index 00000000000..7de7a7d3c1a --- /dev/null +++ b/tests/AdXBuyer/v201309/TestUtils.cs @@ -0,0 +1,541 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util.v201309; +using Google.Api.Ads.AdWords.v201309; +using Google.Api.Ads.Common.Util; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// A utility class to assist the testing of v201309 services. + /// + class TestUtils { + /// + /// Creates a test campaign for running further tests. + /// + /// The AdWords user. + /// The bidding strategy to be used. + /// The campaign id. + public long CreateCampaign(AdWordsUser user, BiddingStrategyType strategyType) { + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201309.CampaignService); + + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + biddingConfig.biddingStrategyType = strategyType; + + CampaignOperation campaignOperation = new CampaignOperation(); + campaignOperation.@operator = Operator.ADD; + campaignOperation.operand = new Campaign(); + campaignOperation.operand.name = + string.Format("Campaign {0}", DateTime.Now.ToString("yyyy-M-d H:m:s.ffffff")); + campaignOperation.operand.status = CampaignStatus.PAUSED; + campaignOperation.operand.biddingStrategyConfiguration = biddingConfig; + campaignOperation.operand.budget = new Budget(); + campaignOperation.operand.budget.period = BudgetBudgetPeriod.DAILY; + campaignOperation.operand.budget.amount = new Money(); + campaignOperation.operand.budget.amount.microAmount = 100000000; + campaignOperation.operand.budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + KeywordMatchSetting matchSetting = new KeywordMatchSetting(); + matchSetting.optIn = true; + campaignOperation.operand.settings = new Setting[] {matchSetting}; + + CampaignReturnValue retVal = + campaignService.mutate(new CampaignOperation[] {campaignOperation}); + return retVal.value[0].id; + } + + /// + /// Creates the legacy sitelinks. + /// + /// The AdWords user. + /// The campaign id. + /// The list of legacy sitelinks. + public Sitelink[] CreateLegacySitelinks(AdWordsUser user, long campaignId) { + // Get the CampaignAdExtensionService. + CampaignAdExtensionService campaignExtensionService = + (CampaignAdExtensionService) user.GetService(AdWordsService.v201309. + CampaignAdExtensionService); + + // Create the sitelinks. + SitelinksExtension siteLinkExtension = new SitelinksExtension(); + + Sitelink siteLink1 = new Sitelink(); + siteLink1.displayText = "Music"; + siteLink1.destinationUrl = "http://www.example.com/music"; + + Sitelink siteLink2 = new Sitelink(); + siteLink2.displayText = "DVDs"; + siteLink2.destinationUrl = "http://www.example.com/dvds"; + + Sitelink siteLink3 = new Sitelink(); + siteLink3.displayText = "New albums"; + siteLink3.destinationUrl = "http://www.example.com/albums/new"; + + siteLinkExtension.sitelinks = new Sitelink[] {siteLink1, siteLink2, siteLink3}; + + CampaignAdExtension campaignAdExtension = new CampaignAdExtension(); + campaignAdExtension.adExtension = siteLinkExtension; + campaignAdExtension.campaignId = campaignId; + + // Create the operation. + CampaignAdExtensionOperation operation = new CampaignAdExtensionOperation(); + operation.@operator = Operator.ADD; + operation.operand = campaignAdExtension; + + // Create the sitelinks. + CampaignAdExtensionReturnValue retVal = + campaignExtensionService.mutate(new CampaignAdExtensionOperation[] {operation}); + + return (retVal.value[0].adExtension as SitelinksExtension).sitelinks; + } + + /// + /// Converts a campaign into enhanced campaign using forward compatibility + /// map. + /// + /// The user. + /// The campaign id. + public void EnhanceCampaign(AdWordsUser user, long campaignId) { + CampaignService campaignService = (CampaignService) user.GetService( + AdWordsService.v201309.CampaignService); + + // Campaign to be updated with the enhanced value. + // Note: After setting the enhanced value to true, setting it back to false + // will generate an ApiError. + Campaign campaign = new Campaign(); + campaign.id = campaignId; + + // Create operation. + CampaignOperation operation = new CampaignOperation(); + operation.@operator = Operator.SET; + operation.operand = campaign; + + campaignService.mutate(new CampaignOperation[] {operation}); + return; + } + + /// + /// Creates a test adgroup for running further tests. + /// + /// The AdWords user. + /// The campaign id for which the adgroup is created. + /// The adgroup id. + public long CreateAdGroup(AdWordsUser user, long campaignId) { + return CreateAdGroup(user, campaignId, false); + } + + /// + /// Creates a test adgroup for running further tests. + /// + /// The AdWords user. + /// The campaign id for which the adgroup is created. + /// True, if a ManualCPM bid is to be used. + /// The adgroup id. + public long CreateAdGroup(AdWordsUser user, long campaignId, bool isCpmBid) { + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201309.AdGroupService); + + AdGroupOperation adGroupOperation = new AdGroupOperation(); + adGroupOperation.@operator = Operator.ADD; + adGroupOperation.operand = new AdGroup(); + adGroupOperation.operand.campaignId = campaignId; + adGroupOperation.operand.name = + string.Format("AdGroup {0}", DateTime.Now.ToString("yyyy-M-d H:m:s.ffffff")); + adGroupOperation.operand.status = AdGroupStatus.ENABLED; + + if (isCpmBid) { + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + CpmBid cpmBid = new CpmBid(); + cpmBid.bid = new Money(); + cpmBid.bid.microAmount = 10000000; + biddingConfig.bids = new Bids[] {cpmBid}; + adGroupOperation.operand.biddingStrategyConfiguration = biddingConfig; + } else { + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + CpcBid cpcBid = new CpcBid(); + cpcBid.bid = new Money(); + cpcBid.bid.microAmount = 10000000; + biddingConfig.bids = new Bids[] {cpcBid}; + adGroupOperation.operand.biddingStrategyConfiguration = biddingConfig; + } + AdGroupReturnValue retVal = adGroupService.mutate(new AdGroupOperation[] {adGroupOperation}); + return retVal.value[0].id; + } + + /// + /// Creates a test textad for running further tests. + /// + /// The AdWords user. + /// The adgroup id for which the ad is created. + /// + /// True, if an ad param placeholder should be + /// added. + /// The text ad id. + public long CreateTextAd(AdWordsUser user, long adGroupId, bool hasAdParam) { + AdGroupAdService adGroupAdService = + (AdGroupAdService) user.GetService(AdWordsService.v201309.AdGroupAdService); + AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation(); + adGroupAdOperation.@operator = Operator.ADD; + adGroupAdOperation.operand = new AdGroupAd(); + adGroupAdOperation.operand.adGroupId = adGroupId; + TextAd ad = new TextAd(); + + ad.headline = "Luxury Cruise to Mars"; + ad.description1 = "Visit the Red Planet in style."; + if (hasAdParam) { + ad.description2 = "Low-gravity fun for {param1:cheap}!"; + } else { + ad.description2 = "Low-gravity fun for everyone!"; + } + ad.displayUrl = "example.com"; + ad.url = "http://www.example.com"; + + adGroupAdOperation.operand.ad = ad; + + AdGroupAdReturnValue retVal = + adGroupAdService.mutate(new AdGroupAdOperation[] {adGroupAdOperation}); + return retVal.value[0].ad.id; + } + + /// + /// Creates a test ThirdPartyRedirectAd for running further tests. + /// + /// The AdWords user. + /// The adgroup id for which the ad is created. + /// + /// True, if an ad param placeholder should be + /// added. + /// The text ad id. + public long CreateThirdPartyRedirectAd(AdWordsUser user, long adGroupId) { + AdGroupAdService adGroupAdService = + (AdGroupAdService) user.GetService(AdWordsService.v201309.AdGroupAdService); + AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation(); + adGroupAdOperation.@operator = Operator.ADD; + adGroupAdOperation.operand = new AdGroupAd(); + adGroupAdOperation.operand.adGroupId = adGroupId; + + // Create the third party redirect ad. + ThirdPartyRedirectAd redirectAd = new ThirdPartyRedirectAd(); + redirectAd.name = string.Format("Example third party ad #{0}", this.GetTimeStamp()); + redirectAd.url = "http://www.example.com"; + + redirectAd.dimensions = new Dimensions(); + redirectAd.dimensions.height = 250; + redirectAd.dimensions.width = 300; + + // This field normally contains the javascript ad tag. + redirectAd.snippet = + ""; + redirectAd.impressionBeaconUrl = "http://www.examples.com/beacon"; + redirectAd.certifiedVendorFormatId = 119; + redirectAd.isCookieTargeted = false; + redirectAd.isUserInterestTargeted = false; + redirectAd.isTagged = false; + + adGroupAdOperation.operand.ad = redirectAd; + + AdGroupAdReturnValue retVal = + adGroupAdService.mutate(new AdGroupAdOperation[] {adGroupAdOperation}); + return retVal.value[0].ad.id; + } + + /// + /// Sets an adparam for running further tests. + /// + /// The AdWords user. + /// The adgroup id to which criterionId belongs. + /// + /// The criterion id to which adparam is set. + /// + public void SetAdParam(AdWordsUser user, long adGroupId, long criterionId) { + AdParamService adParamService = + (AdParamService) user.GetService(AdWordsService.v201309.AdParamService); + + // Prepare for setting ad parameters. + AdParam adParam = new AdParam(); + adParam.adGroupId = adGroupId; + adParam.criterionId = criterionId; + adParam.paramIndex = 1; + adParam.insertionText = "$100"; + + AdParamOperation adParamOperation = new AdParamOperation(); + adParamOperation.@operator = Operator.SET; + adParamOperation.operand = adParam; + + // Set ad parameters. + AdParam[] newAdParams = adParamService.mutate(new AdParamOperation[] {adParamOperation}); + return; + } + + /// + /// Creates a keyword for running further tests. + /// + /// The AdWords user. + /// The adgroup id for which the keyword is + /// created. + /// The keyword id. + public long CreateKeyword(AdWordsUser user, long adGroupId) { + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201309.AdGroupCriterionService); + + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.@operator = Operator.ADD; + operation.operand = new BiddableAdGroupCriterion(); + operation.operand.adGroupId = adGroupId; + + Keyword keyword = new Keyword(); + keyword.matchType = KeywordMatchType.BROAD; + keyword.text = "mars cruise"; + + operation.operand.criterion = keyword; + AdGroupCriterionReturnValue retVal = + adGroupCriterionService.mutate(new AdGroupCriterionOperation[] {operation}); + return retVal.value[0].criterion.id; + } + + /// + /// Creates the placement. + /// + /// The AdWords user. + /// The adgroup id for which the placement is + /// created. + /// The placement id. + public long CreatePlacement(AdWordsUser user, long adGroupId) { + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201309.AdGroupCriterionService); + + Placement placement = new Placement(); + placement.url = "http://mars.google.com"; + + AdGroupCriterion placementCriterion = new BiddableAdGroupCriterion(); + placementCriterion.adGroupId = adGroupId; + placementCriterion.criterion = placement; + + AdGroupCriterionOperation placementOperation = new AdGroupCriterionOperation(); + placementOperation.@operator = Operator.ADD; + placementOperation.operand = placementCriterion; + + AdGroupCriterionReturnValue retVal = adGroupCriterionService.mutate( + new AdGroupCriterionOperation[] {placementOperation}); + + return retVal.value[0].criterion.id; + } + + /// + /// Creates a campaign ad extension for running further tests. + /// + /// The AdWords user. + /// The campaign id for which extension is + /// created. + /// The campaign ad extension id. + public long CreateLocationExtension(AdWordsUser user, long campaignId) { + CampaignAdExtensionService campaignExtensionService = + (CampaignAdExtensionService) user.GetService(AdWordsService.v201309. + CampaignAdExtensionService); + + CampaignAdExtensionOperation operation = new CampaignAdExtensionOperation(); + operation.@operator = Operator.ADD; + + CampaignAdExtension extension = new CampaignAdExtension(); + extension.campaignId = campaignId; + extension.status = CampaignAdExtensionStatus.ACTIVE; + + Address address = new Address(); + address.streetAddress = "1600 Amphitheatre Pkwy, Mountain View"; + address.countryCode = "US"; + + GeoLocation location = GetLocationForAddress(user, address); + + LocationExtension locationExtension = new LocationExtension(); + + // Note: Do not populate an address directly. Instead, use + // GeoLocationService to obtain the location of an address, + // and use the address as per the location it returns. + locationExtension.address = location.address; + locationExtension.geoPoint = location.geoPoint; + locationExtension.encodedLocation = location.encodedLocation; + locationExtension.source = LocationExtensionSource.ADWORDS_FRONTEND; + + extension.adExtension = locationExtension; + operation.operand = extension; + CampaignAdExtensionReturnValue retVal = + campaignExtensionService.mutate(new CampaignAdExtensionOperation[] {operation}); + return retVal.value[0].adExtension.id; + } + + /// + /// Adds site links to a campaign. + /// + /// The user. + /// The campaign id. + /// The sitelinks campaign adextension id. + public long AddSiteLinks(AdWordsUser user, long campaignId) { + // Get the CampaignAdExtensionService. + CampaignAdExtensionService campaignExtensionService = + (CampaignAdExtensionService) user.GetService(AdWordsService.v201309. + CampaignAdExtensionService); + + // Create the sitelinks. + SitelinksExtension siteLinkExtension = new SitelinksExtension(); + + Sitelink siteLink1 = new Sitelink(); + siteLink1.displayText = "Music"; + siteLink1.destinationUrl = "http://www.example.com/music"; + + Sitelink siteLink2 = new Sitelink(); + siteLink2.displayText = "DVDs"; + siteLink2.destinationUrl = "http://www.example.com/dvds"; + + Sitelink siteLink3 = new Sitelink(); + siteLink3.displayText = "New albums"; + siteLink3.destinationUrl = "http://www.example.com/albums/new"; + + siteLinkExtension.sitelinks = new Sitelink[] {siteLink1, siteLink2, siteLink3}; + + CampaignAdExtension campaignAdExtension = new CampaignAdExtension(); + campaignAdExtension.adExtension = siteLinkExtension; + campaignAdExtension.campaignId = campaignId; + + // Create the operation. + CampaignAdExtensionOperation operation = new CampaignAdExtensionOperation(); + operation.@operator = Operator.ADD; + operation.operand = campaignAdExtension; + + // Create the sitelinks. + CampaignAdExtensionReturnValue retVal = + campaignExtensionService.mutate(new CampaignAdExtensionOperation[] {operation}); + + return retVal.value[0].adExtension.id; + } + + /// + /// Adds an experiment. + /// + /// The user. + /// The campaign id. + /// The ad group id. + /// The criterion id. + /// The experiment id. + public long AddExperiment(AdWordsUser user, long campaignId, long adGroupId, long criterionId) { + // Get the ExperimentService. + ExperimentService experimentService = + (ExperimentService) user.GetService(AdWordsService.v201309.ExperimentService); + + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201309.AdGroupService); + + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201309.AdGroupCriterionService); + + // Create the experiment. + Experiment experiment = new Experiment(); + experiment.campaignId = campaignId; + experiment.name = "Interplanetary Cruise #" + GetTimeStamp(); + experiment.queryPercentage = 10; + experiment.startDateTime = DateTime.Now.AddDays(1).ToString("yyyyMMdd HHmmss"); + + // Create the operation. + ExperimentOperation experimentOperation = new ExperimentOperation(); + experimentOperation.@operator = Operator.ADD; + experimentOperation.operand = experiment; + + // Add the experiment. + ExperimentReturnValue experimentRetVal = experimentService.mutate( + new ExperimentOperation[] {experimentOperation}); + + return experimentRetVal.value[0].id; + } + + /// + /// Adds the campaign targeting criteria to a campaign. + /// + /// The user. + /// The campaign id. + /// The campaign criteria id. + public long AddCampaignTargetingCriteria(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201309.CampaignCriterionService); + + // Create language criteria. + // See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + // for a detailed list of language codes. + Language language1 = new Language(); + language1.id = 1002; // French + CampaignCriterion languageCriterion1 = new CampaignCriterion(); + languageCriterion1.campaignId = campaignId; + languageCriterion1.criterion = language1; + + CampaignCriterion[] criteria = new CampaignCriterion[] {languageCriterion1}; + + List operations = new List(); + + foreach (CampaignCriterion criterion in criteria) { + CampaignCriterionOperation operation = new CampaignCriterionOperation(); + operation.@operator = Operator.ADD; + operation.operand = criterion; + operations.Add(operation); + } + + CampaignCriterionReturnValue retVal = campaignCriterionService.mutate(operations.ToArray()); + return retVal.value[0].criterion.id; + } + + /// + /// Returns an image which can be used for creating image ads. + /// + /// The image data, as an array of bytes. + public byte[] GetTestImage() { + return MediaUtilities.GetAssetDataFromUrl("http://goo.gl/HJM3L"); + } + + /// + /// Gets the geo location for a given address. + /// + /// The AdWords user. + /// The address for which geolocation should be + /// fetched. + /// Geo location for the address. + public GeoLocation GetLocationForAddress(AdWordsUser user, Address address) { + GeoLocationService geoService = + (GeoLocationService) user.GetService(AdWordsService.v201309.GeoLocationService); + + GeoLocationSelector selector = new GeoLocationSelector(); + selector.addresses = new Address[] {address}; + return geoService.get(selector)[0]; + } + + /// + /// Gets the current timestamp. + /// + /// The timestamp as a string. + public string GetTimeStamp() { + return (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalMilliseconds.ToString(); + } + } +} diff --git a/tests/AdXBuyer/v201309/VersionedExampleTestsBase.cs b/tests/AdXBuyer/v201309/VersionedExampleTestsBase.cs new file mode 100644 index 00000000000..565f25160de --- /dev/null +++ b/tests/AdXBuyer/v201309/VersionedExampleTestsBase.cs @@ -0,0 +1,35 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; + +namespace Google.Api.Ads.AdWords.Tests.v201309 { + /// + /// Base class for code examples that adds version-specific features. + /// + class VersionedExampleTestsBase : ExampleTestsBase { + /// + /// Test utilities instance for support functionality when running tests. + /// + protected TestUtils utils = new TestUtils(); + + /// + /// Default public constructor. + /// + public VersionedExampleTestsBase() : base() { + } + } +} diff --git a/tests/AdXBuyer/v201402/AccountManagementTest.cs b/tests/AdXBuyer/v201402/AccountManagementTest.cs new file mode 100644 index 00000000000..7ccf3df80c4 --- /dev/null +++ b/tests/AdXBuyer/v201402/AccountManagementTest.cs @@ -0,0 +1,56 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201402; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201402; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Test cases for all the code examples under v201402\AccountManagement. + /// + class AccountManagementTest : VersionedExampleTestsBase { + /// + /// Tests the GetAccountChanges VB.NET code example. + /// + [Test] + public void TestGetAccountChangesVBExample() { + RunExample(delegate() { + new VBExamples.GetAccountChanges().Run(user); + }); + } + + /// + /// Tests the GetAccountChanges C# code example. + /// + [Test] + public void TestGetAccountChangesCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAccountChanges().Run(user); + }); + } + } +} diff --git a/tests/AdXBuyer/v201402/AdvancedOperationsTest.cs b/tests/AdXBuyer/v201402/AdvancedOperationsTest.cs new file mode 100644 index 00000000000..9e49ada9e2c --- /dev/null +++ b/tests/AdXBuyer/v201402/AdvancedOperationsTest.cs @@ -0,0 +1,90 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.v201402; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201402; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201402; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Test cases for all the code examples under v201402\AdvancedOperations. + /// + class AdvancedOperationsTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + long adId; + long keywordId; + const double BID_MODIFIER = 0.2; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateDisplayCampaign(user, BiddingStrategyType.MANUAL_CPM); + adGroupId = utils.CreateAdGroup(user, campaignId); + } + + /// + /// Tests the AddAdGroupBidModifier C# code example. + /// + [Test] + public void TestAddAdGroupBidModifierCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddAdGroupBidModifier().Run(user, adGroupId, BID_MODIFIER); + }); + } + + /// + /// Tests the AddAdGroupBidModifier VB.NET code example. + /// + [Test] + public void TestAddAdGroupBidModifierVBExample() { + RunExample(delegate() { + new VBExamples.AddAdGroupBidModifier().Run(user, adGroupId, BID_MODIFIER); + }); + } + + /// + /// Tests the GetAdGroupBidModifiers C# code example. + /// + [Test] + public void TestGetAdGroupBidModifiersCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAdGroupBidModifiers().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAdGroupBidModifiers VB.NET code example. + /// + [Test] + public void TestGetAdGroupBidModifiersVBExample() { + RunExample(delegate() { + new VBExamples.GetAdGroupBidModifiers().Run(user, campaignId); + }); + } + } +} diff --git a/tests/AdXBuyer/v201402/BasicOperationsTest.cs b/tests/AdXBuyer/v201402/BasicOperationsTest.cs new file mode 100644 index 00000000000..67748b01c77 --- /dev/null +++ b/tests/AdXBuyer/v201402/BasicOperationsTest.cs @@ -0,0 +1,391 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.v201402; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201402; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201402; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Test cases for all the code examples under v201402\BasicOperations. + /// + class BasicOperationsTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + long adId; + long placementId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateDisplayCampaign(user, BiddingStrategyType.MANUAL_CPM); + adGroupId = utils.CreateAdGroup(user, campaignId, true); + adId = utils.CreateTextAd(user, adGroupId, false); + placementId = utils.CreatePlacement(user, adGroupId); + } + + /// + /// Tests the AddAdGroup VB.NET code example. + /// + [Test] + public void TestAddAdGroupVBExample() { + RunExample(delegate() { + new VBExamples.AddAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the AddAdGroup C# code example. + /// + [Test] + public void TestAddAdGroupCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the AddCampaign VB.NET code example. + /// + [Test] + public void TestAddCampaignVBExample() { + RunExample(delegate() { + new VBExamples.AddCampaigns().Run(user); + }); + } + + /// + /// Tests the AddCampaign C# code example. + /// + [Test] + public void TestAddCampaignCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddCampaigns().Run(user); + }); + } + + /// + /// Tests the AddPlacements VB.NET code example. + /// + [Test] + public void TestAddPlacementsVBExample() { + RunExample(delegate() { + new VBExamples.AddPlacements().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddPlacements C# code example. + /// + [Test] + public void TestAddPlacementsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddPlacements().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddThirdPartyRedirectAd VB.NET code example. + /// + [Test] + public void TestAddThirdPartyRedirectAdVBExample() { + RunExample(delegate() { + new VBExamples.AddThirdPartyRedirectAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddThirdPartyRedirectAd C# code example. + /// + [Test] + public void TestAddThirdPartyRedirectAdCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddThirdPartyRedirectAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the DeleteAdGroup VB.NET code example. + /// + [Test] + public void TestDeleteAdGroupVBExample() { + RunExample(delegate() { + new VBExamples.DeleteAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the DeleteAdGroup C# code example. + /// + [Test] + public void TestDeleteAdGroupCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DeleteAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the DeleteAd VB.NET code example. + /// + [Test] + public void TestDeleteAdVBExample() { + RunExample(delegate() { + new VBExamples.DeleteAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the DeleteAd C# code example. + /// + [Test] + public void TestDeleteAdCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DeleteAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the DeleteCampaign VB.NET code example. + /// + [Test] + public void TestDeleteCampaignVBExample() { + RunExample(delegate() { + new VBExamples.DeleteCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the DeleteCampaign C# code example. + /// + [Test] + public void TestDeleteCampaignCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DeleteCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the DeletePlacement VB.NET code example. + /// + [Test] + public void TestDeletePlacementVBExample() { + RunExample(delegate() { + new VBExamples.DeletePlacement().Run(user, adGroupId, placementId); + }); + } + + /// + /// Tests the DeletePlacement C# code example. + /// + [Test] + public void TestDeletePlacementCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DeletePlacement().Run(user, adGroupId, placementId); + }); + } + + /// + /// Tests the GetAdGroups VB.NET code example. + /// + [Test] + public void TestGetAdGroupsVBExample() { + RunExample(delegate() { + new VBExamples.GetAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAdGroups C# code example. + /// + [Test] + public void TestGetAdGroupsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the GetCampaigns VB.NET code example. + /// + [Test] + public void TestGetCampaignsVBExample() { + RunExample(delegate() { + new VBExamples.GetCampaigns().Run(user); + }); + } + + /// + /// Tests the GetCampaigns C# code example. + /// + [Test] + public void TestGetCampaignsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetCampaigns().Run(user); + }); + } + + /// + /// Tests the GetCampaignsWithAwql VB.NET code example. + /// + [Test] + public void TestGetCampaignsWithAwqlVBExample() { + RunExample(delegate() { + new VBExamples.GetCampaignsWithAwql().Run(user); + }); + } + + /// + /// Tests the GetCampaignsWithAwql C# code example. + /// + [Test] + public void TestGetCampaignsWithAwqlCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetCampaignsWithAwql().Run(user); + }); + } + + /// + /// Tests the GetPlacements VB.NET code example. + /// + [Test] + public void TestGetPlacementsVBExample() { + RunExample(delegate() { + new VBExamples.GetPlacements().Run(user); + }); + } + + /// + /// Tests the GetPlacements C# code example. + /// + [Test] + public void TestGetPlacementsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetPlacements().Run(user); + }); + } + + /// + /// Tests the GetThirdPartyRedirectAds VB.NET code example. + /// + [Test] + public void TestGetThirdPartyRedirectAdsVBExample() { + RunExample(delegate() { + new VBExamples.GetThirdPartyRedirectAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the GetThirdPartyRedirectAds C# code example. + /// + [Test] + public void TestGetThirdPartyRedirectAdsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetThirdPartyRedirectAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the PauseAd VB.NET code example. + /// + [Test] + public void TestPauseAdVBExample() { + RunExample(delegate() { + new VBExamples.PauseAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the PauseAd C# code example. + /// + [Test] + public void TestPauseAdCSharpExample() { + RunExample(delegate() { + new CSharpExamples.PauseAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the UpdateAdGroup VB.NET code example. + /// + [Test] + public void TestUpdateAdGroupVBExample() { + RunExample(delegate() { + new VBExamples.UpdateAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the UpdateAdGroup C# code example. + /// + [Test] + public void TestUpdateAdGroupCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UpdateAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the UpdateCampaign VB.NET code example. + /// + [Test] + public void TestUpdateCampaignVBExample() { + RunExample(delegate() { + new VBExamples.UpdateCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the UpdateCampaign C# code example. + /// + [Test] + public void TestUpdateCampaignCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UpdateCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the UpdatePlacement VB.NET code example. + /// + [Test] + public void TestUpdatePlacementVBExample() { + RunExample(delegate() { + new VBExamples.UpdatePlacement().Run(user, adGroupId, placementId); + }); + } + + /// + /// Tests the UpdatePlacement C# code example. + /// + [Test] + public void TestUpdatePlacementCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UpdatePlacement().Run(user, adGroupId, placementId); + }); + } + } +} diff --git a/tests/AdXBuyer/v201402/CampaignManagementTest.cs b/tests/AdXBuyer/v201402/CampaignManagementTest.cs new file mode 100644 index 00000000000..a5a20b8ce45 --- /dev/null +++ b/tests/AdXBuyer/v201402/CampaignManagementTest.cs @@ -0,0 +1,108 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201402; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201402; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Test cases for all the code examples under v201402\CampaignManagement. + /// + class CampaignManagementTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateDisplayCampaign(user, BiddingStrategyType.MANUAL_CPM); + adGroupId = utils.CreateAdGroup(user, campaignId, true); + } + + /// + /// Tests the AddKeywordsInBulk VB.NET code example. + /// + [Test] + public void TestAddPlacementsInBulkVBExample() { + RunExample(delegate() { + new VBExamples.AddPlacementsInBulk().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddKeywordsInBulk C# code example. + /// + [Test] + public void TestAddPlacementsInBulkCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddPlacementsInBulk().Run(user, adGroupId); + }); + } + + /// + /// Tests the GetAllDisapprovedAds VB.NET code example. + /// + [Test] + public void TestGetAllDisapprovedAdsVBExample() { + RunExample(delegate() { + new VBExamples.GetAllDisapprovedAds().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAllDisapprovedAds C# code example. + /// + [Test] + public void TestGetAllDisapprovedAdsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAllDisapprovedAds().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAllDisapprovedAdsWithAwql VB.NET code example. + /// + [Test] + public void TestGetAllDisapprovedAdsWithAwqlVBExample() { + RunExample(delegate() { + new VBExamples.GetAllDisapprovedAdsWithAwql().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAllDisapprovedAdsWithAwql C# code example. + /// + [Test] + public void TestGetAllDisapprovedAdsWithAwqlCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAllDisapprovedAdsWithAwql().Run(user, campaignId); + }); + } + } +} diff --git a/tests/AdXBuyer/v201402/ErrorHandlingTest.cs b/tests/AdXBuyer/v201402/ErrorHandlingTest.cs new file mode 100644 index 00000000000..d81eb802dab --- /dev/null +++ b/tests/AdXBuyer/v201402/ErrorHandlingTest.cs @@ -0,0 +1,88 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201402; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201402; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Test cases for all the code examples under v201402\ErrorHandling. + /// + class ErrorHandlingTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateDisplayCampaign(user, BiddingStrategyType.MANUAL_CPM); + adGroupId = utils.CreateAdGroup(user, campaignId); + } + + /// + /// Tests the HandlePartialFailures VB.NET code example. + /// + [Test] + public void TestHandlePartialFailuresVBExample() { + RunExample(delegate() { + new VBExamples.HandlePartialFailures().Run(user, adGroupId); + }); + } + + /// + /// Tests the HandlePartialFailures C# code example. + /// + [Test] + public void TestHandlePartialFailuresCSharpExample() { + RunExample(delegate() { + new CSharpExamples.HandlePartialFailures().Run(user, adGroupId); + }); + } + + /// + /// Tests the HandlePolicyViolationError VB.NET code example. + /// + [Test] + public void TestHandlePolicyViolationErrorVBExample() { + RunExample(delegate() { + new VBExamples.HandlePolicyViolationError().Run(user, adGroupId); + }); + } + + /// + /// Tests the HandlePolicyViolationError C# code example. + /// + [Test] + public void TestHandlePolicyViolationErrorCSharpExample() { + RunExample(delegate() { + new CSharpExamples.HandlePolicyViolationError().Run(user, adGroupId); + }); + } + } +} diff --git a/tests/AdXBuyer/v201402/MiscellaneousTest.cs b/tests/AdXBuyer/v201402/MiscellaneousTest.cs new file mode 100644 index 00000000000..fa2dd0ae72d --- /dev/null +++ b/tests/AdXBuyer/v201402/MiscellaneousTest.cs @@ -0,0 +1,83 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201402; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201402; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Test cases for all the code examples under v201402\Miscellaneous. + /// + class MiscellaneousTest : VersionedExampleTestsBase { + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + } + + /// + /// Tests the GetAllVideosAndImages VB.NET code example. + /// + [Test] + public void TestGetAllVideosAndImagesVBExample() { + RunExample(delegate() { + new VBExamples.GetAllVideosAndImages().Run(user); + }); + } + + /// + /// Tests the GetAllVideosAndImages C# code example. + /// + [Test] + public void TestGetAllVideosAndImagesCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAllVideosAndImages().Run(user); + }); + } + + /// + /// Tests the UploadImage VB.NET code example. + /// + [Test] + public void TestUploadImageVBExample() { + RunExample(delegate() { + new VBExamples.UploadImage().Run(user); + }); + } + + /// + /// Tests the UploadImage C# code example. + /// + [Test] + public void TestUploadImageCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UploadImage().Run(user); + }); + } + } +} diff --git a/tests/AdXBuyer/v201402/OptimizationTest.cs b/tests/AdXBuyer/v201402/OptimizationTest.cs new file mode 100644 index 00000000000..ff2dbc22fde --- /dev/null +++ b/tests/AdXBuyer/v201402/OptimizationTest.cs @@ -0,0 +1,68 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201402; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201402; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Test cases for all the code examples under v201402\Optimization. + /// + class OptimizationTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateDisplayCampaign(user, BiddingStrategyType.MANUAL_CPM); + adGroupId = utils.CreateAdGroup(user, campaignId, true); + } + + /// + /// Tests the GetPlacementIdeas VB.NET code example. + /// + [Test] + public void TestGetPlacementIdeasVBExample() { + RunExample(delegate() { + new VBExamples.GetPlacementIdeas().Run(user); + }); + } + + /// + /// Tests the GetPlacementIdeas C# code example. + /// + [Test] + public void TestGetPlacementIdeasCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetPlacementIdeas().Run(user); + }); + } + } +} diff --git a/tests/AdXBuyer/v201402/RemarketingTest.cs b/tests/AdXBuyer/v201402/RemarketingTest.cs new file mode 100644 index 00000000000..feb66bb1468 --- /dev/null +++ b/tests/AdXBuyer/v201402/RemarketingTest.cs @@ -0,0 +1,84 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201402; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201402; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Test cases for all the code examples under + /// v201402\Remarketing. + /// + class RemarketingTest : VersionedExampleTestsBase { + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + } + + /// + /// Tests the AddAudience VB.NET code example. + /// + [Test] + public void TestAddAudienceVBExample() { + RunExample(delegate() { + new VBExamples.AddAudience().Run(user); + }); + } + + /// + /// Tests the AddAudience C# code example. + /// + [Test] + public void TestAddAudienceCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddAudience().Run(user); + }); + } + + /// + /// Tests the AddConversionTracker VB.NET code example. + /// + [Test] + public void TestAddConversionTrackerVBExample() { + RunExample(delegate() { + new VBExamples.AddConversionTracker().Run(user); + }); + } + + /// + /// Tests the AddConversionTracker C# code example. + /// + [Test] + public void TestAddConversionTrackerCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddConversionTracker().Run(user); + }); + } + } +} diff --git a/tests/AdXBuyer/v201402/ReportingTest.cs b/tests/AdXBuyer/v201402/ReportingTest.cs new file mode 100644 index 00000000000..1fd775839c5 --- /dev/null +++ b/tests/AdXBuyer/v201402/ReportingTest.cs @@ -0,0 +1,107 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.v201402; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201402; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201402; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Test cases for all the code examples under v201402\Reporting. + /// + class ReportingTest : VersionedExampleTestsBase { + string outputFileName; + ReportDefinitionReportType reportType; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + outputFileName = Path.GetFileName(Path.GetTempFileName()); + reportType = ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT; + } + + /// + /// Tests the DownloadCriteriaReport VB.NET code example. + /// + [Test] + public void TestDownloadCriteriaReportVBExample() { + RunExample(delegate() { + new VBExamples.DownloadCriteriaReport().Run(user, outputFileName); + }); + } + + /// + /// Tests the DownloadCriteriaReport C# code example. + /// + [Test] + public void TestDownloadCriteriaReportCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DownloadCriteriaReport().Run(user, outputFileName); + }); + } + + /// + /// Tests the DownloadCriteriaReportWithAwql VB.NET code example. + /// + [Test] + public void TestDownloadCriteriaReportWithAwqlVBExample() { + RunExample(delegate() { + new VBExamples.DownloadCriteriaReportWithAwql().Run(user, outputFileName); + }); + } + + /// + /// Tests the DownloadCriteriaReportWithAwql C# code example. + /// + [Test] + public void TestDownloadCriteriaReportWithAwqlCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DownloadCriteriaReportWithAwql().Run(user, outputFileName); + }); + } + + /// + /// Tests the GetReportFields VB.NET code example. + /// + [Test] + public void TestGetReportFieldsVBExample() { + RunExample(delegate() { + new VBExamples.GetReportFields().Run(user, reportType); + }); + } + + /// + /// Tests the GetReportFields C# code example. + /// + [Test] + public void TestGetReportFieldsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetReportFields().Run(user, reportType); + }); + } + } +} diff --git a/tests/AdXBuyer/v201402/TargetingTest.cs b/tests/AdXBuyer/v201402/TargetingTest.cs new file mode 100644 index 00000000000..89e7aed88f8 --- /dev/null +++ b/tests/AdXBuyer/v201402/TargetingTest.cs @@ -0,0 +1,129 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201402; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201402; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201402; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Test cases for all the code examples under v201402\Targeting. + /// + class TargetingTest : VersionedExampleTestsBase { + long campaignId; + long campaignCriterionId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateDisplayCampaign(user, BiddingStrategyType.MANUAL_CPM); + campaignCriterionId = utils.AddCampaignTargetingCriteria(user, campaignId); + } + + /// + /// Tests the AddCampaignTargetingCriteria VB.NET code example. + /// + [Test] + public void TestAddCampaignTargetingCriteriaVBExample() { + RunExample(delegate() { + new VBExamples.AddCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the AddCampaignTargetingCriteria C# code example. + /// + [Test] + public void TestAddCampaignTargetingCriteriaCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the GetCampaignTargetingCriteria VB.NET code example. + /// + [Test] + public void TestGetCampaignTargetingCriteriaVBExample() { + RunExample(delegate() { + new VBExamples.GetCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the GetCampaignTargetingCriteria C# code example. + /// + [Test] + public void TestGetCampaignTargetingCriteriaCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the GetTargetableLanguagesAndCarriers VB.NET code example. + /// + [Test] + public void TestGetTargetableLanguagesAndCarriersVBExample() { + RunExample(delegate() { + new VBExamples.GetTargetableLanguagesAndCarriers().Run(user); + }); + } + + /// + /// Tests the GetTargetableLanguagesAndCarriers C# code example. + /// + [Test] + public void TestGetTargetableLanguagesAndCarriersCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetTargetableLanguagesAndCarriers().Run(user); + }); + } + + /// + /// Tests the LookupLocation VB.NET code example. + /// + [Test] + public void TestLookupLocationVBExample() { + RunExample(delegate() { + new VBExamples.LookupLocation().Run(user); + }); + } + + /// + /// Tests the LookupLocation C# code example. + /// + [Test] + public void TestLookupLocationCSharpExample() { + RunExample(delegate() { + new CSharpExamples.LookupLocation().Run(user); + }); + } + + } +} diff --git a/tests/AdXBuyer/v201402/TestUtils.cs b/tests/AdXBuyer/v201402/TestUtils.cs new file mode 100644 index 00000000000..2d3408a3925 --- /dev/null +++ b/tests/AdXBuyer/v201402/TestUtils.cs @@ -0,0 +1,493 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util.v201402; +using Google.Api.Ads.AdWords.v201402; +using Google.Api.Ads.Common.Util; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// A utility class to assist the testing of v201402 services. + /// + class TestUtils { + + public long CreateBudget(AdWordsUser user) { + BudgetService budgetService = + (BudgetService) user.GetService(AdWordsService.v201402.BudgetService); + + // Create the campaign budget. + Budget budget = new Budget(); + budget.name = "Interplanetary Cruise Budget #" + DateTime.Now.ToString("yyyy-M-d H:m:s.ffffff"); + budget.period = BudgetBudgetPeriod.DAILY; + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + budget.amount = new Money(); + budget.amount.microAmount = 500000; + + BudgetOperation budgetOperation = new BudgetOperation(); + budgetOperation.@operator = Operator.ADD; + budgetOperation.operand = budget; + + BudgetReturnValue budgetRetval = budgetService.mutate(new BudgetOperation[] { budgetOperation }); + return budgetRetval.value[0].budgetId; + } + + /// + /// Creates a test search campaign for running further tests. + /// + /// The user. + /// The bidding strategy to be used. + /// The campaign id. + public long CreateSearchCampaign(AdWordsUser user, BiddingStrategyType strategyType) { + return CreateCampaign(user, AdvertisingChannelType.SEARCH, strategyType); + } + + /// + /// Creates a display campaign for running further tests. + /// + /// The user. + /// The bidding strategy to be used. + /// The campaign id. + public long CreateDisplayCampaign(AdWordsUser user, BiddingStrategyType strategyType) { + return CreateCampaign(user, AdvertisingChannelType.DISPLAY, strategyType); + } + + /// + /// Creates a test shopping campaign for running further tests. + /// + /// The user. + /// The bidding strategy to be used. + /// The campaign id. + public long CreateShoppingCampaign(AdWordsUser user, BiddingStrategyType strategyType) { + return CreateCampaign(user, AdvertisingChannelType.SHOPPING, strategyType); + } + + /// + /// Creates a test campaign for running further tests. + /// + /// The AdWords user. + /// The bidding strategy to be used. + /// The campaign id. + public long CreateCampaign(AdWordsUser user, AdvertisingChannelType channelType, + BiddingStrategyType strategyType) { + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201402.CampaignService); + + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + biddingConfig.biddingStrategyType = strategyType; + + CampaignOperation campaignOperation = new CampaignOperation(); + campaignOperation.@operator = Operator.ADD; + campaignOperation.operand = new Campaign(); + campaignOperation.operand.name = + string.Format("Campaign {0}", DateTime.Now.ToString("yyyy-M-d H:m:s.ffffff")); + campaignOperation.operand.advertisingChannelType = channelType; + campaignOperation.operand.status = CampaignStatus.PAUSED; + campaignOperation.operand.biddingStrategyConfiguration = biddingConfig; + campaignOperation.operand.budget = new Budget(); + campaignOperation.operand.budget.budgetId = CreateBudget(user); + campaignOperation.operand.budget.period = BudgetBudgetPeriod.DAILY; + campaignOperation.operand.budget.amount = new Money(); + campaignOperation.operand.budget.amount.microAmount = 100000000; + campaignOperation.operand.budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + + List settings = new List(); + KeywordMatchSetting matchSetting = new KeywordMatchSetting(); + matchSetting.optIn = true; + settings.Add(matchSetting); + + if (channelType == AdvertisingChannelType.SHOPPING) { + // All Shopping campaigns need a ShoppingSetting. + ShoppingSetting shoppingSetting = new ShoppingSetting(); + shoppingSetting.salesCountry = "US"; + shoppingSetting.campaignPriority = 0; + shoppingSetting.merchantId = (user.Config as AdWordsAppConfig).MerchantCenterId; + + settings.Add(shoppingSetting); + } + campaignOperation.operand.settings = settings.ToArray(); + + CampaignReturnValue retVal = + campaignService.mutate(new CampaignOperation[] {campaignOperation}); + return retVal.value[0].id; + } + + /// + /// Creates a test adgroup for running further tests. + /// + /// The AdWords user. + /// The campaign id for which the adgroup is created. + /// The adgroup id. + public long CreateAdGroup(AdWordsUser user, long campaignId) { + return CreateAdGroup(user, campaignId, false); + } + + /// + /// Creates a test adgroup for running further tests. + /// + /// The AdWords user. + /// The campaign id for which the adgroup is created. + /// True, if a ManualCPM bid is to be used. + /// The adgroup id. + public long CreateAdGroup(AdWordsUser user, long campaignId, bool isCpmBid) { + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201402.AdGroupService); + + AdGroupOperation adGroupOperation = new AdGroupOperation(); + adGroupOperation.@operator = Operator.ADD; + adGroupOperation.operand = new AdGroup(); + adGroupOperation.operand.campaignId = campaignId; + adGroupOperation.operand.name = + string.Format("AdGroup {0}", DateTime.Now.ToString("yyyy-M-d H:m:s.ffffff")); + adGroupOperation.operand.status = AdGroupStatus.ENABLED; + + if (isCpmBid) { + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + CpmBid cpmBid = new CpmBid(); + cpmBid.bid = new Money(); + cpmBid.bid.microAmount = 10000000; + biddingConfig.bids = new Bids[] {cpmBid}; + adGroupOperation.operand.biddingStrategyConfiguration = biddingConfig; + } else { + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + CpcBid cpcBid = new CpcBid(); + cpcBid.bid = new Money(); + cpcBid.bid.microAmount = 10000000; + biddingConfig.bids = new Bids[] {cpcBid}; + adGroupOperation.operand.biddingStrategyConfiguration = biddingConfig; + } + AdGroupReturnValue retVal = adGroupService.mutate(new AdGroupOperation[] {adGroupOperation}); + return retVal.value[0].id; + } + + /// + /// Creates a test textad for running further tests. + /// + /// The AdWords user. + /// The adgroup id for which the ad is created. + /// + /// True, if an ad param placeholder should be + /// added. + /// The text ad id. + public long CreateTextAd(AdWordsUser user, long adGroupId, bool hasAdParam) { + AdGroupAdService adGroupAdService = + (AdGroupAdService) user.GetService(AdWordsService.v201402.AdGroupAdService); + AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation(); + adGroupAdOperation.@operator = Operator.ADD; + adGroupAdOperation.operand = new AdGroupAd(); + adGroupAdOperation.operand.adGroupId = adGroupId; + TextAd ad = new TextAd(); + + ad.headline = "Luxury Cruise to Mars"; + ad.description1 = "Visit the Red Planet in style."; + if (hasAdParam) { + ad.description2 = "Low-gravity fun for {param1:cheap}!"; + } else { + ad.description2 = "Low-gravity fun for everyone!"; + } + ad.displayUrl = "example.com"; + ad.url = "http://www.example.com"; + + adGroupAdOperation.operand.ad = ad; + + AdGroupAdReturnValue retVal = + adGroupAdService.mutate(new AdGroupAdOperation[] {adGroupAdOperation}); + return retVal.value[0].ad.id; + } + + /// + /// Creates a test ThirdPartyRedirectAd for running further tests. + /// + /// The AdWords user. + /// The adgroup id for which the ad is created. + /// + /// True, if an ad param placeholder should be + /// added. + /// The text ad id. + public long CreateThirdPartyRedirectAd(AdWordsUser user, long adGroupId) { + AdGroupAdService adGroupAdService = + (AdGroupAdService) user.GetService(AdWordsService.v201402.AdGroupAdService); + AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation(); + adGroupAdOperation.@operator = Operator.ADD; + adGroupAdOperation.operand = new AdGroupAd(); + adGroupAdOperation.operand.adGroupId = adGroupId; + + // Create the third party redirect ad. + ThirdPartyRedirectAd redirectAd = new ThirdPartyRedirectAd(); + redirectAd.name = string.Format("Example third party ad #{0}", this.GetTimeStamp()); + redirectAd.url = "http://www.example.com"; + + redirectAd.dimensions = new Dimensions(); + redirectAd.dimensions.height = 250; + redirectAd.dimensions.width = 300; + + // This field normally contains the javascript ad tag. + redirectAd.snippet = + ""; + redirectAd.impressionBeaconUrl = "http://www.examples.com/beacon"; + redirectAd.certifiedVendorFormatId = 119; + redirectAd.isCookieTargeted = false; + redirectAd.isUserInterestTargeted = false; + redirectAd.isTagged = false; + + adGroupAdOperation.operand.ad = redirectAd; + + AdGroupAdReturnValue retVal = + adGroupAdService.mutate(new AdGroupAdOperation[] {adGroupAdOperation}); + return retVal.value[0].ad.id; + } + + /// + /// Sets an adparam for running further tests. + /// + /// The AdWords user. + /// The adgroup id to which criterionId belongs. + /// + /// The criterion id to which adparam is set. + /// + public void SetAdParam(AdWordsUser user, long adGroupId, long criterionId) { + AdParamService adParamService = + (AdParamService) user.GetService(AdWordsService.v201402.AdParamService); + + // Prepare for setting ad parameters. + AdParam adParam = new AdParam(); + adParam.adGroupId = adGroupId; + adParam.criterionId = criterionId; + adParam.paramIndex = 1; + adParam.insertionText = "$100"; + + AdParamOperation adParamOperation = new AdParamOperation(); + adParamOperation.@operator = Operator.SET; + adParamOperation.operand = adParam; + + // Set ad parameters. + AdParam[] newAdParams = adParamService.mutate(new AdParamOperation[] {adParamOperation}); + return; + } + + /// + /// Creates a keyword for running further tests. + /// + /// The AdWords user. + /// The adgroup id for which the keyword is + /// created. + /// The keyword id. + public long CreateKeyword(AdWordsUser user, long adGroupId) { + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201402.AdGroupCriterionService); + + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.@operator = Operator.ADD; + operation.operand = new BiddableAdGroupCriterion(); + operation.operand.adGroupId = adGroupId; + + Keyword keyword = new Keyword(); + keyword.matchType = KeywordMatchType.BROAD; + keyword.text = "mars cruise"; + + operation.operand.criterion = keyword; + AdGroupCriterionReturnValue retVal = + adGroupCriterionService.mutate(new AdGroupCriterionOperation[] {operation}); + return retVal.value[0].criterion.id; + } + + /// + /// Creates the placement. + /// + /// The AdWords user. + /// The adgroup id for which the placement is + /// created. + /// The placement id. + public long CreatePlacement(AdWordsUser user, long adGroupId) { + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201402.AdGroupCriterionService); + + Placement placement = new Placement(); + placement.url = "http://mars.google.com"; + + AdGroupCriterion placementCriterion = new BiddableAdGroupCriterion(); + placementCriterion.adGroupId = adGroupId; + placementCriterion.criterion = placement; + + AdGroupCriterionOperation placementOperation = new AdGroupCriterionOperation(); + placementOperation.@operator = Operator.ADD; + placementOperation.operand = placementCriterion; + + AdGroupCriterionReturnValue retVal = adGroupCriterionService.mutate( + new AdGroupCriterionOperation[] {placementOperation}); + + return retVal.value[0].criterion.id; + } + + /// + /// Creates a campaign ad extension for running further tests. + /// + /// The AdWords user. + /// The campaign id for which extension is + /// created. + /// The campaign ad extension id. + public long CreateLocationExtension(AdWordsUser user, long campaignId) { + CampaignAdExtensionService campaignExtensionService = + (CampaignAdExtensionService) user.GetService(AdWordsService.v201402. + CampaignAdExtensionService); + + CampaignAdExtensionOperation operation = new CampaignAdExtensionOperation(); + operation.@operator = Operator.ADD; + + CampaignAdExtension extension = new CampaignAdExtension(); + extension.campaignId = campaignId; + extension.status = CampaignAdExtensionStatus.ACTIVE; + + Address address = new Address(); + address.streetAddress = "1600 Amphitheatre Pkwy, Mountain View"; + address.countryCode = "US"; + + GeoLocation location = GetLocationForAddress(user, address); + + LocationExtension locationExtension = new LocationExtension(); + + // Note: Do not populate an address directly. Instead, use + // GeoLocationService to obtain the location of an address, + // and use the address as per the location it returns. + locationExtension.address = location.address; + locationExtension.geoPoint = location.geoPoint; + locationExtension.encodedLocation = location.encodedLocation; + locationExtension.source = LocationExtensionSource.ADWORDS_FRONTEND; + + extension.adExtension = locationExtension; + operation.operand = extension; + CampaignAdExtensionReturnValue retVal = + campaignExtensionService.mutate(new CampaignAdExtensionOperation[] {operation}); + return retVal.value[0].adExtension.id; + } + + /// + /// Adds an experiment. + /// + /// The user. + /// The campaign id. + /// The ad group id. + /// The criterion id. + /// The experiment id. + public long AddExperiment(AdWordsUser user, long campaignId, long adGroupId, long criterionId) { + // Get the ExperimentService. + ExperimentService experimentService = + (ExperimentService) user.GetService(AdWordsService.v201402.ExperimentService); + + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201402.AdGroupService); + + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201402.AdGroupCriterionService); + + // Create the experiment. + Experiment experiment = new Experiment(); + experiment.campaignId = campaignId; + experiment.name = "Interplanetary Cruise #" + GetTimeStamp(); + experiment.queryPercentage = 10; + experiment.startDateTime = DateTime.Now.AddDays(1).ToString("yyyyMMdd HHmmss"); + + // Create the operation. + ExperimentOperation experimentOperation = new ExperimentOperation(); + experimentOperation.@operator = Operator.ADD; + experimentOperation.operand = experiment; + + // Add the experiment. + ExperimentReturnValue experimentRetVal = experimentService.mutate( + new ExperimentOperation[] {experimentOperation}); + + return experimentRetVal.value[0].id; + } + + /// + /// Adds the campaign targeting criteria to a campaign. + /// + /// The user. + /// The campaign id. + /// The campaign criteria id. + public long AddCampaignTargetingCriteria(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201402.CampaignCriterionService); + + // Create language criteria. + // See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + // for a detailed list of language codes. + Language language1 = new Language(); + language1.id = 1002; // French + CampaignCriterion languageCriterion1 = new CampaignCriterion(); + languageCriterion1.campaignId = campaignId; + languageCriterion1.criterion = language1; + + CampaignCriterion[] criteria = new CampaignCriterion[] {languageCriterion1}; + + List operations = new List(); + + foreach (CampaignCriterion criterion in criteria) { + CampaignCriterionOperation operation = new CampaignCriterionOperation(); + operation.@operator = Operator.ADD; + operation.operand = criterion; + operations.Add(operation); + } + + CampaignCriterionReturnValue retVal = campaignCriterionService.mutate(operations.ToArray()); + return retVal.value[0].criterion.id; + } + + /// + /// Returns an image which can be used for creating image ads. + /// + /// The image data, as an array of bytes. + public byte[] GetTestImage() { + return MediaUtilities.GetAssetDataFromUrl("http://goo.gl/HJM3L"); + } + + /// + /// Gets the geo location for a given address. + /// + /// The AdWords user. + /// The address for which geolocation should be + /// fetched. + /// Geo location for the address. + public GeoLocation GetLocationForAddress(AdWordsUser user, Address address) { + GeoLocationService geoService = + (GeoLocationService) user.GetService(AdWordsService.v201402.GeoLocationService); + + GeoLocationSelector selector = new GeoLocationSelector(); + selector.addresses = new Address[] {address}; + return geoService.get(selector)[0]; + } + + /// + /// Gets the current timestamp. + /// + /// The timestamp as a string. + public string GetTimeStamp() { + return (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalMilliseconds.ToString(); + } + } +} diff --git a/tests/AdXBuyer/v201402/VersionedExampleTestsBase.cs b/tests/AdXBuyer/v201402/VersionedExampleTestsBase.cs new file mode 100644 index 00000000000..a56a1276fdc --- /dev/null +++ b/tests/AdXBuyer/v201402/VersionedExampleTestsBase.cs @@ -0,0 +1,35 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; + +namespace Google.Api.Ads.AdWords.Tests.v201402 { + /// + /// Base class for code examples that adds version-specific features. + /// + class VersionedExampleTestsBase : ExampleTestsBase { + /// + /// Test utilities instance for support functionality when running tests. + /// + protected TestUtils utils = new TestUtils(); + + /// + /// Default public constructor. + /// + public VersionedExampleTestsBase() : base() { + } + } +} diff --git a/tests/AdXBuyer/v201406/AccountManagementTest.cs b/tests/AdXBuyer/v201406/AccountManagementTest.cs new file mode 100644 index 00000000000..aadc3127f38 --- /dev/null +++ b/tests/AdXBuyer/v201406/AccountManagementTest.cs @@ -0,0 +1,56 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201406; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201406; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Test cases for all the code examples under v201406\AccountManagement. + /// + class AccountManagementTest : VersionedExampleTestsBase { + /// + /// Tests the GetAccountChanges VB.NET code example. + /// + [Test] + public void TestGetAccountChangesVBExample() { + RunExample(delegate() { + new VBExamples.GetAccountChanges().Run(user); + }); + } + + /// + /// Tests the GetAccountChanges C# code example. + /// + [Test] + public void TestGetAccountChangesCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAccountChanges().Run(user); + }); + } + } +} diff --git a/tests/AdXBuyer/v201406/AdvancedOperationsTest.cs b/tests/AdXBuyer/v201406/AdvancedOperationsTest.cs new file mode 100644 index 00000000000..20a816d2611 --- /dev/null +++ b/tests/AdXBuyer/v201406/AdvancedOperationsTest.cs @@ -0,0 +1,90 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.v201406; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201406; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201406; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Test cases for all the code examples under v201406\AdvancedOperations. + /// + class AdvancedOperationsTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + long adId; + long keywordId; + const double BID_MODIFIER = 0.2; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateDisplayCampaign(user, BiddingStrategyType.MANUAL_CPM); + adGroupId = utils.CreateAdGroup(user, campaignId); + } + + /// + /// Tests the AddAdGroupBidModifier C# code example. + /// + [Test] + public void TestAddAdGroupBidModifierCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddAdGroupBidModifier().Run(user, adGroupId, BID_MODIFIER); + }); + } + + /// + /// Tests the AddAdGroupBidModifier VB.NET code example. + /// + [Test] + public void TestAddAdGroupBidModifierVBExample() { + RunExample(delegate() { + new VBExamples.AddAdGroupBidModifier().Run(user, adGroupId, BID_MODIFIER); + }); + } + + /// + /// Tests the GetAdGroupBidModifiers C# code example. + /// + [Test] + public void TestGetAdGroupBidModifiersCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAdGroupBidModifiers().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAdGroupBidModifiers VB.NET code example. + /// + [Test] + public void TestGetAdGroupBidModifiersVBExample() { + RunExample(delegate() { + new VBExamples.GetAdGroupBidModifiers().Run(user, campaignId); + }); + } + } +} diff --git a/tests/AdXBuyer/v201406/BasicOperationsTest.cs b/tests/AdXBuyer/v201406/BasicOperationsTest.cs new file mode 100644 index 00000000000..41ea2364dff --- /dev/null +++ b/tests/AdXBuyer/v201406/BasicOperationsTest.cs @@ -0,0 +1,391 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.v201406; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201406; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201406; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Test cases for all the code examples under v201406\BasicOperations. + /// + class BasicOperationsTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + long adId; + long placementId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateDisplayCampaign(user, BiddingStrategyType.MANUAL_CPM); + adGroupId = utils.CreateAdGroup(user, campaignId, true); + adId = utils.CreateTextAd(user, adGroupId, false); + placementId = utils.CreatePlacement(user, adGroupId); + } + + /// + /// Tests the AddAdGroup VB.NET code example. + /// + [Test] + public void TestAddAdGroupVBExample() { + RunExample(delegate() { + new VBExamples.AddAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the AddAdGroup C# code example. + /// + [Test] + public void TestAddAdGroupCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the AddCampaign VB.NET code example. + /// + [Test] + public void TestAddCampaignVBExample() { + RunExample(delegate() { + new VBExamples.AddCampaigns().Run(user); + }); + } + + /// + /// Tests the AddCampaign C# code example. + /// + [Test] + public void TestAddCampaignCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddCampaigns().Run(user); + }); + } + + /// + /// Tests the AddPlacements VB.NET code example. + /// + [Test] + public void TestAddPlacementsVBExample() { + RunExample(delegate() { + new VBExamples.AddPlacements().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddPlacements C# code example. + /// + [Test] + public void TestAddPlacementsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddPlacements().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddThirdPartyRedirectAd VB.NET code example. + /// + [Test] + public void TestAddThirdPartyRedirectAdVBExample() { + RunExample(delegate() { + new VBExamples.AddThirdPartyRedirectAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddThirdPartyRedirectAd C# code example. + /// + [Test] + public void TestAddThirdPartyRedirectAdCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddThirdPartyRedirectAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the RemoveAdGroup VB.NET code example. + /// + [Test] + public void TestRemoveAdGroupVBExample() { + RunExample(delegate() { + new VBExamples.RemoveAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the RemoveAdGroup C# code example. + /// + [Test] + public void TestRemoveAdGroupCSharpExample() { + RunExample(delegate() { + new CSharpExamples.RemoveAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the RemoveAd VB.NET code example. + /// + [Test] + public void TestRemoveAdVBExample() { + RunExample(delegate() { + new VBExamples.RemoveAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the RemoveAd C# code example. + /// + [Test] + public void TestRemoveAdCSharpExample() { + RunExample(delegate() { + new CSharpExamples.RemoveAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the RemoveCampaign VB.NET code example. + /// + [Test] + public void TestRemoveCampaignVBExample() { + RunExample(delegate() { + new VBExamples.RemoveCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the RemoveCampaign C# code example. + /// + [Test] + public void TestRemoveCampaignCSharpExample() { + RunExample(delegate() { + new CSharpExamples.RemoveCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the RemovePlacement VB.NET code example. + /// + [Test] + public void TestRemovePlacementVBExample() { + RunExample(delegate() { + new VBExamples.RemovePlacement().Run(user, adGroupId, placementId); + }); + } + + /// + /// Tests the RemovePlacement C# code example. + /// + [Test] + public void TestRemovePlacementCSharpExample() { + RunExample(delegate() { + new CSharpExamples.RemovePlacement().Run(user, adGroupId, placementId); + }); + } + + /// + /// Tests the GetAdGroups VB.NET code example. + /// + [Test] + public void TestGetAdGroupsVBExample() { + RunExample(delegate() { + new VBExamples.GetAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAdGroups C# code example. + /// + [Test] + public void TestGetAdGroupsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAdGroups().Run(user, campaignId); + }); + } + + /// + /// Tests the GetCampaigns VB.NET code example. + /// + [Test] + public void TestGetCampaignsVBExample() { + RunExample(delegate() { + new VBExamples.GetCampaigns().Run(user); + }); + } + + /// + /// Tests the GetCampaigns C# code example. + /// + [Test] + public void TestGetCampaignsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetCampaigns().Run(user); + }); + } + + /// + /// Tests the GetCampaignsWithAwql VB.NET code example. + /// + [Test] + public void TestGetCampaignsWithAwqlVBExample() { + RunExample(delegate() { + new VBExamples.GetCampaignsWithAwql().Run(user); + }); + } + + /// + /// Tests the GetCampaignsWithAwql C# code example. + /// + [Test] + public void TestGetCampaignsWithAwqlCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetCampaignsWithAwql().Run(user); + }); + } + + /// + /// Tests the GetPlacements VB.NET code example. + /// + [Test] + public void TestGetPlacementsVBExample() { + RunExample(delegate() { + new VBExamples.GetPlacements().Run(user); + }); + } + + /// + /// Tests the GetPlacements C# code example. + /// + [Test] + public void TestGetPlacementsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetPlacements().Run(user); + }); + } + + /// + /// Tests the GetThirdPartyRedirectAds VB.NET code example. + /// + [Test] + public void TestGetThirdPartyRedirectAdsVBExample() { + RunExample(delegate() { + new VBExamples.GetThirdPartyRedirectAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the GetThirdPartyRedirectAds C# code example. + /// + [Test] + public void TestGetThirdPartyRedirectAdsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetThirdPartyRedirectAds().Run(user, adGroupId); + }); + } + + /// + /// Tests the PauseAd VB.NET code example. + /// + [Test] + public void TestPauseAdVBExample() { + RunExample(delegate() { + new VBExamples.PauseAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the PauseAd C# code example. + /// + [Test] + public void TestPauseAdCSharpExample() { + RunExample(delegate() { + new CSharpExamples.PauseAd().Run(user, adGroupId, adId); + }); + } + + /// + /// Tests the UpdateAdGroup VB.NET code example. + /// + [Test] + public void TestUpdateAdGroupVBExample() { + RunExample(delegate() { + new VBExamples.UpdateAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the UpdateAdGroup C# code example. + /// + [Test] + public void TestUpdateAdGroupCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UpdateAdGroup().Run(user, adGroupId); + }); + } + + /// + /// Tests the UpdateCampaign VB.NET code example. + /// + [Test] + public void TestUpdateCampaignVBExample() { + RunExample(delegate() { + new VBExamples.UpdateCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the UpdateCampaign C# code example. + /// + [Test] + public void TestUpdateCampaignCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UpdateCampaign().Run(user, campaignId); + }); + } + + /// + /// Tests the UpdatePlacement VB.NET code example. + /// + [Test] + public void TestUpdatePlacementVBExample() { + RunExample(delegate() { + new VBExamples.UpdatePlacement().Run(user, adGroupId, placementId); + }); + } + + /// + /// Tests the UpdatePlacement C# code example. + /// + [Test] + public void TestUpdatePlacementCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UpdatePlacement().Run(user, adGroupId, placementId); + }); + } + } +} diff --git a/tests/AdXBuyer/v201406/CampaignManagementTest.cs b/tests/AdXBuyer/v201406/CampaignManagementTest.cs new file mode 100644 index 00000000000..fdc70a5170b --- /dev/null +++ b/tests/AdXBuyer/v201406/CampaignManagementTest.cs @@ -0,0 +1,108 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201406; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201406; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Test cases for all the code examples under v201406\CampaignManagement. + /// + class CampaignManagementTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateDisplayCampaign(user, BiddingStrategyType.MANUAL_CPM); + adGroupId = utils.CreateAdGroup(user, campaignId, true); + } + + /// + /// Tests the AddKeywordsInBulk VB.NET code example. + /// + [Test] + public void TestAddPlacementsInBulkVBExample() { + RunExample(delegate() { + new VBExamples.AddPlacementsInBulk().Run(user, adGroupId); + }); + } + + /// + /// Tests the AddKeywordsInBulk C# code example. + /// + [Test] + public void TestAddPlacementsInBulkCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddPlacementsInBulk().Run(user, adGroupId); + }); + } + + /// + /// Tests the GetAllDisapprovedAds VB.NET code example. + /// + [Test] + public void TestGetAllDisapprovedAdsVBExample() { + RunExample(delegate() { + new VBExamples.GetAllDisapprovedAds().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAllDisapprovedAds C# code example. + /// + [Test] + public void TestGetAllDisapprovedAdsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAllDisapprovedAds().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAllDisapprovedAdsWithAwql VB.NET code example. + /// + [Test] + public void TestGetAllDisapprovedAdsWithAwqlVBExample() { + RunExample(delegate() { + new VBExamples.GetAllDisapprovedAdsWithAwql().Run(user, campaignId); + }); + } + + /// + /// Tests the GetAllDisapprovedAdsWithAwql C# code example. + /// + [Test] + public void TestGetAllDisapprovedAdsWithAwqlCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAllDisapprovedAdsWithAwql().Run(user, campaignId); + }); + } + } +} diff --git a/tests/AdXBuyer/v201406/ErrorHandlingTest.cs b/tests/AdXBuyer/v201406/ErrorHandlingTest.cs new file mode 100644 index 00000000000..f681e5b36dd --- /dev/null +++ b/tests/AdXBuyer/v201406/ErrorHandlingTest.cs @@ -0,0 +1,88 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201406; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201406; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Test cases for all the code examples under v201406\ErrorHandling. + /// + class ErrorHandlingTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateDisplayCampaign(user, BiddingStrategyType.MANUAL_CPM); + adGroupId = utils.CreateAdGroup(user, campaignId); + } + + /// + /// Tests the HandlePartialFailures VB.NET code example. + /// + [Test] + public void TestHandlePartialFailuresVBExample() { + RunExample(delegate() { + new VBExamples.HandlePartialFailures().Run(user, adGroupId); + }); + } + + /// + /// Tests the HandlePartialFailures C# code example. + /// + [Test] + public void TestHandlePartialFailuresCSharpExample() { + RunExample(delegate() { + new CSharpExamples.HandlePartialFailures().Run(user, adGroupId); + }); + } + + /// + /// Tests the HandlePolicyViolationError VB.NET code example. + /// + [Test] + public void TestHandlePolicyViolationErrorVBExample() { + RunExample(delegate() { + new VBExamples.HandlePolicyViolationError().Run(user, adGroupId); + }); + } + + /// + /// Tests the HandlePolicyViolationError C# code example. + /// + [Test] + public void TestHandlePolicyViolationErrorCSharpExample() { + RunExample(delegate() { + new CSharpExamples.HandlePolicyViolationError().Run(user, adGroupId); + }); + } + } +} diff --git a/tests/AdXBuyer/v201406/MiscellaneousTest.cs b/tests/AdXBuyer/v201406/MiscellaneousTest.cs new file mode 100644 index 00000000000..f0afc6609bd --- /dev/null +++ b/tests/AdXBuyer/v201406/MiscellaneousTest.cs @@ -0,0 +1,83 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201406; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201406; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Test cases for all the code examples under v201406\Miscellaneous. + /// + class MiscellaneousTest : VersionedExampleTestsBase { + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + } + + /// + /// Tests the GetAllVideosAndImages VB.NET code example. + /// + [Test] + public void TestGetAllVideosAndImagesVBExample() { + RunExample(delegate() { + new VBExamples.GetAllVideosAndImages().Run(user); + }); + } + + /// + /// Tests the GetAllVideosAndImages C# code example. + /// + [Test] + public void TestGetAllVideosAndImagesCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetAllVideosAndImages().Run(user); + }); + } + + /// + /// Tests the UploadImage VB.NET code example. + /// + [Test] + public void TestUploadImageVBExample() { + RunExample(delegate() { + new VBExamples.UploadImage().Run(user); + }); + } + + /// + /// Tests the UploadImage C# code example. + /// + [Test] + public void TestUploadImageCSharpExample() { + RunExample(delegate() { + new CSharpExamples.UploadImage().Run(user); + }); + } + } +} diff --git a/tests/AdXBuyer/v201406/OptimizationTest.cs b/tests/AdXBuyer/v201406/OptimizationTest.cs new file mode 100644 index 00000000000..0438d00ddaa --- /dev/null +++ b/tests/AdXBuyer/v201406/OptimizationTest.cs @@ -0,0 +1,68 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201406; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201406; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Test cases for all the code examples under v201406\Optimization. + /// + class OptimizationTest : VersionedExampleTestsBase { + long campaignId; + long adGroupId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateDisplayCampaign(user, BiddingStrategyType.MANUAL_CPM); + adGroupId = utils.CreateAdGroup(user, campaignId, true); + } + + /// + /// Tests the GetPlacementIdeas VB.NET code example. + /// + [Test] + public void TestGetPlacementIdeasVBExample() { + RunExample(delegate() { + new VBExamples.GetPlacementIdeas().Run(user); + }); + } + + /// + /// Tests the GetPlacementIdeas C# code example. + /// + [Test] + public void TestGetPlacementIdeasCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetPlacementIdeas().Run(user); + }); + } + } +} diff --git a/tests/AdXBuyer/v201406/RemarketingTest.cs b/tests/AdXBuyer/v201406/RemarketingTest.cs new file mode 100644 index 00000000000..da87f6cd77b --- /dev/null +++ b/tests/AdXBuyer/v201406/RemarketingTest.cs @@ -0,0 +1,84 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201406; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201406; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Test cases for all the code examples under + /// v201406\Remarketing. + /// + class RemarketingTest : VersionedExampleTestsBase { + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + } + + /// + /// Tests the AddAudience VB.NET code example. + /// + [Test] + public void TestAddAudienceVBExample() { + RunExample(delegate() { + new VBExamples.AddAudience().Run(user); + }); + } + + /// + /// Tests the AddAudience C# code example. + /// + [Test] + public void TestAddAudienceCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddAudience().Run(user); + }); + } + + /// + /// Tests the AddConversionTracker VB.NET code example. + /// + [Test] + public void TestAddConversionTrackerVBExample() { + RunExample(delegate() { + new VBExamples.AddConversionTracker().Run(user); + }); + } + + /// + /// Tests the AddConversionTracker C# code example. + /// + [Test] + public void TestAddConversionTrackerCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddConversionTracker().Run(user); + }); + } + } +} diff --git a/tests/AdXBuyer/v201406/ReportingTest.cs b/tests/AdXBuyer/v201406/ReportingTest.cs new file mode 100644 index 00000000000..5442d56d2e0 --- /dev/null +++ b/tests/AdXBuyer/v201406/ReportingTest.cs @@ -0,0 +1,107 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.v201406; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201406; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201406; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Test cases for all the code examples under v201406\Reporting. + /// + class ReportingTest : VersionedExampleTestsBase { + string outputFileName; + ReportDefinitionReportType reportType; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + outputFileName = Path.GetFileName(Path.GetTempFileName()); + reportType = ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT; + } + + /// + /// Tests the DownloadCriteriaReport VB.NET code example. + /// + [Test] + public void TestDownloadCriteriaReportVBExample() { + RunExample(delegate() { + new VBExamples.DownloadCriteriaReport().Run(user, outputFileName); + }); + } + + /// + /// Tests the DownloadCriteriaReport C# code example. + /// + [Test] + public void TestDownloadCriteriaReportCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DownloadCriteriaReport().Run(user, outputFileName); + }); + } + + /// + /// Tests the DownloadCriteriaReportWithAwql VB.NET code example. + /// + [Test] + public void TestDownloadCriteriaReportWithAwqlVBExample() { + RunExample(delegate() { + new VBExamples.DownloadCriteriaReportWithAwql().Run(user, outputFileName); + }); + } + + /// + /// Tests the DownloadCriteriaReportWithAwql C# code example. + /// + [Test] + public void TestDownloadCriteriaReportWithAwqlCSharpExample() { + RunExample(delegate() { + new CSharpExamples.DownloadCriteriaReportWithAwql().Run(user, outputFileName); + }); + } + + /// + /// Tests the GetReportFields VB.NET code example. + /// + [Test] + public void TestGetReportFieldsVBExample() { + RunExample(delegate() { + new VBExamples.GetReportFields().Run(user, reportType); + }); + } + + /// + /// Tests the GetReportFields C# code example. + /// + [Test] + public void TestGetReportFieldsCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetReportFields().Run(user, reportType); + }); + } + } +} diff --git a/tests/AdXBuyer/v201406/TargetingTest.cs b/tests/AdXBuyer/v201406/TargetingTest.cs new file mode 100644 index 00000000000..c77dea6f57c --- /dev/null +++ b/tests/AdXBuyer/v201406/TargetingTest.cs @@ -0,0 +1,129 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.v201406; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +using CSharpExamples = Google.Api.Ads.AdWords.Examples.CSharp.v201406; +using VBExamples = Google.Api.Ads.AdWords.Examples.VB.v201406; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Test cases for all the code examples under v201406\Targeting. + /// + class TargetingTest : VersionedExampleTestsBase { + long campaignId; + long campaignCriterionId; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + campaignId = utils.CreateDisplayCampaign(user, BiddingStrategyType.MANUAL_CPM); + campaignCriterionId = utils.AddCampaignTargetingCriteria(user, campaignId); + } + + /// + /// Tests the AddCampaignTargetingCriteria VB.NET code example. + /// + [Test] + public void TestAddCampaignTargetingCriteriaVBExample() { + RunExample(delegate() { + new VBExamples.AddCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the AddCampaignTargetingCriteria C# code example. + /// + [Test] + public void TestAddCampaignTargetingCriteriaCSharpExample() { + RunExample(delegate() { + new CSharpExamples.AddCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the GetCampaignTargetingCriteria VB.NET code example. + /// + [Test] + public void TestGetCampaignTargetingCriteriaVBExample() { + RunExample(delegate() { + new VBExamples.GetCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the GetCampaignTargetingCriteria C# code example. + /// + [Test] + public void TestGetCampaignTargetingCriteriaCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetCampaignTargetingCriteria().Run(user, campaignId); + }); + } + + /// + /// Tests the GetTargetableLanguagesAndCarriers VB.NET code example. + /// + [Test] + public void TestGetTargetableLanguagesAndCarriersVBExample() { + RunExample(delegate() { + new VBExamples.GetTargetableLanguagesAndCarriers().Run(user); + }); + } + + /// + /// Tests the GetTargetableLanguagesAndCarriers C# code example. + /// + [Test] + public void TestGetTargetableLanguagesAndCarriersCSharpExample() { + RunExample(delegate() { + new CSharpExamples.GetTargetableLanguagesAndCarriers().Run(user); + }); + } + + /// + /// Tests the LookupLocation VB.NET code example. + /// + [Test] + public void TestLookupLocationVBExample() { + RunExample(delegate() { + new VBExamples.LookupLocation().Run(user); + }); + } + + /// + /// Tests the LookupLocation C# code example. + /// + [Test] + public void TestLookupLocationCSharpExample() { + RunExample(delegate() { + new CSharpExamples.LookupLocation().Run(user); + }); + } + + } +} diff --git a/tests/AdXBuyer/v201406/TestUtils.cs b/tests/AdXBuyer/v201406/TestUtils.cs new file mode 100644 index 00000000000..f919d9ad8e4 --- /dev/null +++ b/tests/AdXBuyer/v201406/TestUtils.cs @@ -0,0 +1,493 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.AdWords.Lib; +using Google.Api.Ads.AdWords.Util.v201406; +using Google.Api.Ads.AdWords.v201406; +using Google.Api.Ads.Common.Util; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// A utility class to assist the testing of v201406 services. + /// + class TestUtils { + + public long CreateBudget(AdWordsUser user) { + BudgetService budgetService = + (BudgetService) user.GetService(AdWordsService.v201406.BudgetService); + + // Create the campaign budget. + Budget budget = new Budget(); + budget.name = "Interplanetary Cruise Budget #" + DateTime.Now.ToString("yyyy-M-d H:m:s.ffffff"); + budget.period = BudgetBudgetPeriod.DAILY; + budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + budget.amount = new Money(); + budget.amount.microAmount = 500000; + + BudgetOperation budgetOperation = new BudgetOperation(); + budgetOperation.@operator = Operator.ADD; + budgetOperation.operand = budget; + + BudgetReturnValue budgetRetval = budgetService.mutate(new BudgetOperation[] { budgetOperation }); + return budgetRetval.value[0].budgetId; + } + + /// + /// Creates a test search campaign for running further tests. + /// + /// The user. + /// The bidding strategy to be used. + /// The campaign id. + public long CreateSearchCampaign(AdWordsUser user, BiddingStrategyType strategyType) { + return CreateCampaign(user, AdvertisingChannelType.SEARCH, strategyType); + } + + /// + /// Creates a display campaign for running further tests. + /// + /// The user. + /// The bidding strategy to be used. + /// The campaign id. + public long CreateDisplayCampaign(AdWordsUser user, BiddingStrategyType strategyType) { + return CreateCampaign(user, AdvertisingChannelType.DISPLAY, strategyType); + } + + /// + /// Creates a test shopping campaign for running further tests. + /// + /// The user. + /// The bidding strategy to be used. + /// The campaign id. + public long CreateShoppingCampaign(AdWordsUser user, BiddingStrategyType strategyType) { + return CreateCampaign(user, AdvertisingChannelType.SHOPPING, strategyType); + } + + /// + /// Creates a test campaign for running further tests. + /// + /// The AdWords user. + /// The bidding strategy to be used. + /// The campaign id. + public long CreateCampaign(AdWordsUser user, AdvertisingChannelType channelType, + BiddingStrategyType strategyType) { + CampaignService campaignService = + (CampaignService) user.GetService(AdWordsService.v201406.CampaignService); + + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + biddingConfig.biddingStrategyType = strategyType; + + CampaignOperation campaignOperation = new CampaignOperation(); + campaignOperation.@operator = Operator.ADD; + campaignOperation.operand = new Campaign(); + campaignOperation.operand.name = + string.Format("Campaign {0}", DateTime.Now.ToString("yyyy-M-d H:m:s.ffffff")); + campaignOperation.operand.advertisingChannelType = channelType; + campaignOperation.operand.status = CampaignStatus.PAUSED; + campaignOperation.operand.biddingStrategyConfiguration = biddingConfig; + campaignOperation.operand.budget = new Budget(); + campaignOperation.operand.budget.budgetId = CreateBudget(user); + campaignOperation.operand.budget.period = BudgetBudgetPeriod.DAILY; + campaignOperation.operand.budget.amount = new Money(); + campaignOperation.operand.budget.amount.microAmount = 100000000; + campaignOperation.operand.budget.deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD; + + List settings = new List(); + KeywordMatchSetting matchSetting = new KeywordMatchSetting(); + matchSetting.optIn = true; + settings.Add(matchSetting); + + if (channelType == AdvertisingChannelType.SHOPPING) { + // All Shopping campaigns need a ShoppingSetting. + ShoppingSetting shoppingSetting = new ShoppingSetting(); + shoppingSetting.salesCountry = "US"; + shoppingSetting.campaignPriority = 0; + shoppingSetting.merchantId = (user.Config as AdWordsAppConfig).MerchantCenterId; + + settings.Add(shoppingSetting); + } + campaignOperation.operand.settings = settings.ToArray(); + + CampaignReturnValue retVal = + campaignService.mutate(new CampaignOperation[] {campaignOperation}); + return retVal.value[0].id; + } + + /// + /// Creates a test adgroup for running further tests. + /// + /// The AdWords user. + /// The campaign id for which the adgroup is created. + /// The adgroup id. + public long CreateAdGroup(AdWordsUser user, long campaignId) { + return CreateAdGroup(user, campaignId, false); + } + + /// + /// Creates a test adgroup for running further tests. + /// + /// The AdWords user. + /// The campaign id for which the adgroup is created. + /// True, if a ManualCPM bid is to be used. + /// The adgroup id. + public long CreateAdGroup(AdWordsUser user, long campaignId, bool isCpmBid) { + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201406.AdGroupService); + + AdGroupOperation adGroupOperation = new AdGroupOperation(); + adGroupOperation.@operator = Operator.ADD; + adGroupOperation.operand = new AdGroup(); + adGroupOperation.operand.campaignId = campaignId; + adGroupOperation.operand.name = + string.Format("AdGroup {0}", DateTime.Now.ToString("yyyy-M-d H:m:s.ffffff")); + adGroupOperation.operand.status = AdGroupStatus.ENABLED; + + if (isCpmBid) { + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + CpmBid cpmBid = new CpmBid(); + cpmBid.bid = new Money(); + cpmBid.bid.microAmount = 10000000; + biddingConfig.bids = new Bids[] {cpmBid}; + adGroupOperation.operand.biddingStrategyConfiguration = biddingConfig; + } else { + BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); + CpcBid cpcBid = new CpcBid(); + cpcBid.bid = new Money(); + cpcBid.bid.microAmount = 10000000; + biddingConfig.bids = new Bids[] {cpcBid}; + adGroupOperation.operand.biddingStrategyConfiguration = biddingConfig; + } + AdGroupReturnValue retVal = adGroupService.mutate(new AdGroupOperation[] {adGroupOperation}); + return retVal.value[0].id; + } + + /// + /// Creates a test textad for running further tests. + /// + /// The AdWords user. + /// The adgroup id for which the ad is created. + /// + /// True, if an ad param placeholder should be + /// added. + /// The text ad id. + public long CreateTextAd(AdWordsUser user, long adGroupId, bool hasAdParam) { + AdGroupAdService adGroupAdService = + (AdGroupAdService) user.GetService(AdWordsService.v201406.AdGroupAdService); + AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation(); + adGroupAdOperation.@operator = Operator.ADD; + adGroupAdOperation.operand = new AdGroupAd(); + adGroupAdOperation.operand.adGroupId = adGroupId; + TextAd ad = new TextAd(); + + ad.headline = "Luxury Cruise to Mars"; + ad.description1 = "Visit the Red Planet in style."; + if (hasAdParam) { + ad.description2 = "Low-gravity fun for {param1:cheap}!"; + } else { + ad.description2 = "Low-gravity fun for everyone!"; + } + ad.displayUrl = "example.com"; + ad.url = "http://www.example.com"; + + adGroupAdOperation.operand.ad = ad; + + AdGroupAdReturnValue retVal = + adGroupAdService.mutate(new AdGroupAdOperation[] {adGroupAdOperation}); + return retVal.value[0].ad.id; + } + + /// + /// Creates a test ThirdPartyRedirectAd for running further tests. + /// + /// The AdWords user. + /// The adgroup id for which the ad is created. + /// + /// True, if an ad param placeholder should be + /// added. + /// The text ad id. + public long CreateThirdPartyRedirectAd(AdWordsUser user, long adGroupId) { + AdGroupAdService adGroupAdService = + (AdGroupAdService) user.GetService(AdWordsService.v201406.AdGroupAdService); + AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation(); + adGroupAdOperation.@operator = Operator.ADD; + adGroupAdOperation.operand = new AdGroupAd(); + adGroupAdOperation.operand.adGroupId = adGroupId; + + // Create the third party redirect ad. + ThirdPartyRedirectAd redirectAd = new ThirdPartyRedirectAd(); + redirectAd.name = string.Format("Example third party ad #{0}", this.GetTimeStamp()); + redirectAd.url = "http://www.example.com"; + + redirectAd.dimensions = new Dimensions(); + redirectAd.dimensions.height = 250; + redirectAd.dimensions.width = 300; + + // This field normally contains the javascript ad tag. + redirectAd.snippet = + ""; + redirectAd.impressionBeaconUrl = "http://www.examples.com/beacon"; + redirectAd.certifiedVendorFormatId = 119; + redirectAd.isCookieTargeted = false; + redirectAd.isUserInterestTargeted = false; + redirectAd.isTagged = false; + + adGroupAdOperation.operand.ad = redirectAd; + + AdGroupAdReturnValue retVal = + adGroupAdService.mutate(new AdGroupAdOperation[] {adGroupAdOperation}); + return retVal.value[0].ad.id; + } + + /// + /// Sets an adparam for running further tests. + /// + /// The AdWords user. + /// The adgroup id to which criterionId belongs. + /// + /// The criterion id to which adparam is set. + /// + public void SetAdParam(AdWordsUser user, long adGroupId, long criterionId) { + AdParamService adParamService = + (AdParamService) user.GetService(AdWordsService.v201406.AdParamService); + + // Prepare for setting ad parameters. + AdParam adParam = new AdParam(); + adParam.adGroupId = adGroupId; + adParam.criterionId = criterionId; + adParam.paramIndex = 1; + adParam.insertionText = "$100"; + + AdParamOperation adParamOperation = new AdParamOperation(); + adParamOperation.@operator = Operator.SET; + adParamOperation.operand = adParam; + + // Set ad parameters. + AdParam[] newAdParams = adParamService.mutate(new AdParamOperation[] {adParamOperation}); + return; + } + + /// + /// Creates a keyword for running further tests. + /// + /// The AdWords user. + /// The adgroup id for which the keyword is + /// created. + /// The keyword id. + public long CreateKeyword(AdWordsUser user, long adGroupId) { + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201406.AdGroupCriterionService); + + AdGroupCriterionOperation operation = new AdGroupCriterionOperation(); + operation.@operator = Operator.ADD; + operation.operand = new BiddableAdGroupCriterion(); + operation.operand.adGroupId = adGroupId; + + Keyword keyword = new Keyword(); + keyword.matchType = KeywordMatchType.BROAD; + keyword.text = "mars cruise"; + + operation.operand.criterion = keyword; + AdGroupCriterionReturnValue retVal = + adGroupCriterionService.mutate(new AdGroupCriterionOperation[] {operation}); + return retVal.value[0].criterion.id; + } + + /// + /// Creates the placement. + /// + /// The AdWords user. + /// The adgroup id for which the placement is + /// created. + /// The placement id. + public long CreatePlacement(AdWordsUser user, long adGroupId) { + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201406.AdGroupCriterionService); + + Placement placement = new Placement(); + placement.url = "http://mars.google.com"; + + AdGroupCriterion placementCriterion = new BiddableAdGroupCriterion(); + placementCriterion.adGroupId = adGroupId; + placementCriterion.criterion = placement; + + AdGroupCriterionOperation placementOperation = new AdGroupCriterionOperation(); + placementOperation.@operator = Operator.ADD; + placementOperation.operand = placementCriterion; + + AdGroupCriterionReturnValue retVal = adGroupCriterionService.mutate( + new AdGroupCriterionOperation[] {placementOperation}); + + return retVal.value[0].criterion.id; + } + + /// + /// Creates a campaign ad extension for running further tests. + /// + /// The AdWords user. + /// The campaign id for which extension is + /// created. + /// The campaign ad extension id. + public long CreateLocationExtension(AdWordsUser user, long campaignId) { + CampaignAdExtensionService campaignExtensionService = + (CampaignAdExtensionService) user.GetService(AdWordsService.v201406. + CampaignAdExtensionService); + + CampaignAdExtensionOperation operation = new CampaignAdExtensionOperation(); + operation.@operator = Operator.ADD; + + CampaignAdExtension extension = new CampaignAdExtension(); + extension.campaignId = campaignId; + extension.status = CampaignAdExtensionStatus.ENABLED; + + Address address = new Address(); + address.streetAddress = "1600 Amphitheatre Pkwy, Mountain View"; + address.countryCode = "US"; + + GeoLocation location = GetLocationForAddress(user, address); + + LocationExtension locationExtension = new LocationExtension(); + + // Note: Do not populate an address directly. Instead, use + // GeoLocationService to obtain the location of an address, + // and use the address as per the location it returns. + locationExtension.address = location.address; + locationExtension.geoPoint = location.geoPoint; + locationExtension.encodedLocation = location.encodedLocation; + locationExtension.source = LocationExtensionSource.ADWORDS_FRONTEND; + + extension.adExtension = locationExtension; + operation.operand = extension; + CampaignAdExtensionReturnValue retVal = + campaignExtensionService.mutate(new CampaignAdExtensionOperation[] {operation}); + return retVal.value[0].adExtension.id; + } + + /// + /// Adds an experiment. + /// + /// The user. + /// The campaign id. + /// The ad group id. + /// The criterion id. + /// The experiment id. + public long AddExperiment(AdWordsUser user, long campaignId, long adGroupId, long criterionId) { + // Get the ExperimentService. + ExperimentService experimentService = + (ExperimentService) user.GetService(AdWordsService.v201406.ExperimentService); + + // Get the AdGroupService. + AdGroupService adGroupService = + (AdGroupService) user.GetService(AdWordsService.v201406.AdGroupService); + + // Get the AdGroupCriterionService. + AdGroupCriterionService adGroupCriterionService = + (AdGroupCriterionService) user.GetService(AdWordsService.v201406.AdGroupCriterionService); + + // Create the experiment. + Experiment experiment = new Experiment(); + experiment.campaignId = campaignId; + experiment.name = "Interplanetary Cruise #" + GetTimeStamp(); + experiment.queryPercentage = 10; + experiment.startDateTime = DateTime.Now.AddDays(1).ToString("yyyyMMdd HHmmss"); + + // Create the operation. + ExperimentOperation experimentOperation = new ExperimentOperation(); + experimentOperation.@operator = Operator.ADD; + experimentOperation.operand = experiment; + + // Add the experiment. + ExperimentReturnValue experimentRetVal = experimentService.mutate( + new ExperimentOperation[] {experimentOperation}); + + return experimentRetVal.value[0].id; + } + + /// + /// Adds the campaign targeting criteria to a campaign. + /// + /// The user. + /// The campaign id. + /// The campaign criteria id. + public long AddCampaignTargetingCriteria(AdWordsUser user, long campaignId) { + // Get the CampaignCriterionService. + CampaignCriterionService campaignCriterionService = + (CampaignCriterionService) user.GetService( + AdWordsService.v201406.CampaignCriterionService); + + // Create language criteria. + // See http://code.google.com/apis/adwords/docs/appendix/languagecodes.html + // for a detailed list of language codes. + Language language1 = new Language(); + language1.id = 1002; // French + CampaignCriterion languageCriterion1 = new CampaignCriterion(); + languageCriterion1.campaignId = campaignId; + languageCriterion1.criterion = language1; + + CampaignCriterion[] criteria = new CampaignCriterion[] {languageCriterion1}; + + List operations = new List(); + + foreach (CampaignCriterion criterion in criteria) { + CampaignCriterionOperation operation = new CampaignCriterionOperation(); + operation.@operator = Operator.ADD; + operation.operand = criterion; + operations.Add(operation); + } + + CampaignCriterionReturnValue retVal = campaignCriterionService.mutate(operations.ToArray()); + return retVal.value[0].criterion.id; + } + + /// + /// Returns an image which can be used for creating image ads. + /// + /// The image data, as an array of bytes. + public byte[] GetTestImage() { + return MediaUtilities.GetAssetDataFromUrl("http://goo.gl/HJM3L"); + } + + /// + /// Gets the geo location for a given address. + /// + /// The AdWords user. + /// The address for which geolocation should be + /// fetched. + /// Geo location for the address. + public GeoLocation GetLocationForAddress(AdWordsUser user, Address address) { + GeoLocationService geoService = + (GeoLocationService) user.GetService(AdWordsService.v201406.GeoLocationService); + + GeoLocationSelector selector = new GeoLocationSelector(); + selector.addresses = new Address[] {address}; + return geoService.get(selector)[0]; + } + + /// + /// Gets the current timestamp. + /// + /// The timestamp as a string. + public string GetTimeStamp() { + return (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalMilliseconds.ToString(); + } + } +} diff --git a/tests/AdXBuyer/v201406/VersionedExampleTestsBase.cs b/tests/AdXBuyer/v201406/VersionedExampleTestsBase.cs new file mode 100644 index 00000000000..423bcce08f8 --- /dev/null +++ b/tests/AdXBuyer/v201406/VersionedExampleTestsBase.cs @@ -0,0 +1,35 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; + +namespace Google.Api.Ads.AdWords.Tests.v201406 { + /// + /// Base class for code examples that adds version-specific features. + /// + class VersionedExampleTestsBase : ExampleTestsBase { + /// + /// Test utilities instance for support functionality when running tests. + /// + protected TestUtils utils = new TestUtils(); + + /// + /// Default public constructor. + /// + public VersionedExampleTestsBase() : base() { + } + } +} diff --git a/tests/Common/ClientLoginRequestInterceptor.cs b/tests/Common/ClientLoginRequestInterceptor.cs new file mode 100644 index 00000000000..e5d62c55669 --- /dev/null +++ b/tests/Common/ClientLoginRequestInterceptor.cs @@ -0,0 +1,92 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Net; +using System.Text; + +// Disable deprecation warnings for AuthToken class. +#pragma warning disable 612, 618 + +namespace Google.Api.Ads.Common.Tests { + /// + /// Intercepts calls to ClientLogin API for testing purposes. + /// + public class ClientLoginRequestInterceptor : WebRequestInterceptor { + /// + /// AuthToken returned by interceptor. + /// + public const string AUTH_TOKEN = "AUTH_TOKEN"; + + /// + /// Standard response for ClientLogin calls. + /// + private const string CLIENTLOGIN_RESPONSE = "SID=DQAAA\r\nLSID=DQAAA\r\nAuth=" + AUTH_TOKEN; + + /// + /// Error response for ClientLogin calls. + /// + private const string CLIENTLOGIN_ERROR_RESPONSE = + "Error=BadAuthentication\r\nUrl=http://localhost"; + + /// + /// Singleton instance. + /// + private static WebRequestInterceptor instance; + + + /// + /// Content type for ClientLogin API calls. + /// + private const string CLIENTLOGIN_RESPONSE_TYPE = "text/plain"; + + /// + /// Gets the only instance. + /// + public static WebRequestInterceptor Instance { + get { + return instance; + } + } + + /// + /// Initializes the class. + /// + static ClientLoginRequestInterceptor() { + instance = new ClientLoginRequestInterceptor(); + WebRequest.RegisterPrefix(AuthToken.Url.AbsoluteUri, instance); + } + + /// + /// Gets the next message to be mocked. + /// + /// + /// An HttpMessage object that represents the next message. + /// + public override HttpMessage GetNextMessage() { + if (RaiseException) { + return new HttpMessage(null, CLIENTLOGIN_ERROR_RESPONSE, CLIENTLOGIN_RESPONSE_TYPE); + } else { + return new HttpMessage(null, CLIENTLOGIN_RESPONSE, CLIENTLOGIN_RESPONSE_TYPE); + } + } + } +} + +#pragma warning restore 612, 618 diff --git a/tests/Common/Common.Tests.csproj b/tests/Common/Common.Tests.csproj new file mode 100644 index 00000000000..5ca5e345ae3 --- /dev/null +++ b/tests/Common/Common.Tests.csproj @@ -0,0 +1,105 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {7AA5533E-FED0-4E0C-919C-19E7D7EE2FF6} + Library + Properties + Google.Api.Ads.Common.Tests + Common.Tests + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AnyCPU + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\lib\NUnit\nunit.framework.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + Resources.resx + + + + + {277404DB-A439-4450-B3A5-186294CDF245} + Common + + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + + + + + + + + + \ No newline at end of file diff --git a/tests/Common/HttpMessage.cs b/tests/Common/HttpMessage.cs new file mode 100644 index 00000000000..9e8e7288971 --- /dev/null +++ b/tests/Common/HttpMessage.cs @@ -0,0 +1,76 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +namespace Google.Api.Ads.Common.Tests { + /// + /// Represents an HTTP request / response pair to be mocked. + /// + public class HttpMessage { + /// + /// Request body. + /// + string request; + + /// + /// Response body. + /// + string response; + + /// + /// Response type. + /// + string responseType; + + /// + /// Overloaded constructor. + /// + /// The request body. + /// The response body. + /// The response type. + public HttpMessage(string request, string response, string responseType) { + this.request = request; + this.response = response; + this.responseType = responseType; + } + + /// + /// Gets the request. + /// + public string Request { + get { + return request; + } + } + + /// + /// Gets the response. + /// + public string Response { + get { + return response; + } + } + + /// + /// Gets the response type. + /// + public string ResponseType { + get { + return responseType; + } + } + } +} diff --git a/tests/Common/Lib/AdsExceptionTests.cs b/tests/Common/Lib/AdsExceptionTests.cs new file mode 100644 index 00000000000..0974990b1c4 --- /dev/null +++ b/tests/Common/Lib/AdsExceptionTests.cs @@ -0,0 +1,93 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Common.Tests.Mocks; + +using NUnit.Framework; + +using System; +using System.IO; +using System.Runtime.Serialization.Formatters.Binary; + +namespace Google.Api.Ads.Common.Tests.Lib { + /// + /// Coverage tests for AdsException class. + /// + public class AdsExceptionTests { + /// + /// Message to be used for running tests. + /// + private string message = "This is a test message"; + + /// + /// Inner exception to be used for running tests. + /// + private ApplicationException innerException = new ApplicationException(); + + /// + /// Tests the default constructor. + /// + [Test] + [Category("Small")] + public void TestContructor1() { + Assert.DoesNotThrow(delegate() { + AdsException exception = new MockAdsException(); + }); + } + + /// + /// Tests the overloaded constructors. + /// + [Test] + [Category("Small")] + public void TestContructor2() { + AdsException exception = new MockAdsException(message); + Assert.AreEqual(message, exception.Message); + Assert.Null(exception.InnerException); + } + + /// + /// Tests the overloaded constructors. + /// + [Test] + [Category("Small")] + public void TestContructor3() { + AdsException exception = new MockAdsException(message, innerException); + Assert.AreEqual(message, exception.Message); + Assert.AreEqual(innerException, exception.InnerException); + } + + /// + /// Tests the protected serialization constructor. + /// + [Test] + [Category("Small")] + public void TestContructor4() { + Assert.DoesNotThrow(delegate() { + MockAdsException exception = new MockAdsException(); + exception.MockProperty = 2; + BinaryFormatter formatter = new BinaryFormatter(); + MemoryStream memStream = new MemoryStream(); + formatter.Serialize(memStream, exception); + memStream.Seek(0, SeekOrigin.Begin); + MockAdsException exception1 = (MockAdsException) formatter.Deserialize(memStream); + memStream.Dispose(); + Assert.AreEqual(2, exception1.MockProperty); + }); + } + } +} diff --git a/tests/Common/Lib/AdsOAuthExceptionTests.cs b/tests/Common/Lib/AdsOAuthExceptionTests.cs new file mode 100644 index 00000000000..1046eb31a96 --- /dev/null +++ b/tests/Common/Lib/AdsOAuthExceptionTests.cs @@ -0,0 +1,91 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using NUnit.Framework; + +using System; +using System.IO; +using System.Runtime.Serialization.Formatters.Binary; + +namespace Google.Api.Ads.Common.Tests.Lib { + /// + /// Coverage tests for AdsOAuthException class. + /// + public class AdsOAuthExceptionTests { + /// + /// Message to be used for running tests. + /// + private string message = "This is a test message"; + + /// + /// Inner exception to be used for running tests. + /// + private ApplicationException innerException = new ApplicationException(); + + /// + /// Tests the overloaded constructors. + /// + [Test] + [Category("Small")] + public void TestContructor1() { + AdsOAuthException exception = new AdsOAuthException(message); + Assert.AreEqual(message, exception.Message); + Assert.Null(exception.InnerException); + } + + /// + /// Tests the overloaded constructors. + /// + [Test] + [Category("Small")] + public void TestContructor2() { + AdsOAuthException exception = new AdsOAuthException(message, innerException); + Assert.AreEqual(message, exception.Message); + Assert.AreEqual(innerException, exception.InnerException); + } + + /// + /// Tests the default constructor. + /// + [Test] + [Category("Small")] + public void TestContructor3() { + AdsOAuthException exception = new AdsOAuthException(); + Assert.AreEqual("Exception of type 'Google.Api.Ads.Common.Lib." + + "AdsOAuthException' was thrown.", exception.Message); + Assert.Null(exception.InnerException); + } + + /// + /// Tests the protected serialization constructor. + /// + [Test] + [Category("Small")] + public void TestContructor4() { + Assert.DoesNotThrow(delegate() { + AdsOAuthException exception = new AdsOAuthException(); + BinaryFormatter formatter = new BinaryFormatter(); + MemoryStream memStream = new MemoryStream(); + formatter.Serialize(memStream, exception); + memStream.Seek(0, SeekOrigin.Begin); + formatter.Deserialize(memStream); + memStream.Dispose(); + }); + } + } +} diff --git a/tests/Common/Lib/AppConfigBaseTests.cs b/tests/Common/Lib/AppConfigBaseTests.cs new file mode 100644 index 00000000000..5d3a17d5635 --- /dev/null +++ b/tests/Common/Lib/AppConfigBaseTests.cs @@ -0,0 +1,154 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.Text; +using NUnit.Framework; +using Google.Api.Ads.Common.Lib; +using System.Runtime.Serialization.Formatters.Binary; +using System.IO; +using Google.Api.Ads.Common.Tests.Mocks; +using System.Collections; +using System.Net; + +namespace Google.Api.Ads.Common.Tests.Lib { + /// + /// Coverage tests for AppConfigBase class. + /// + public class AppConfigBaseTests { + /// + /// The hashtable to hold the test data. + /// + private Hashtable tblSettings; + + /// + /// Inits this instance. + /// + [SetUp] + [Category("Small")] + public void Init() { + tblSettings = new Hashtable(); + tblSettings.Add("ProxyServer", "http://localhost/"); + tblSettings.Add("ProxyUser", "ProxyUser"); + tblSettings.Add("ProxyPassword", "ProxyPassword"); + tblSettings.Add("ProxyDomain", "ProxyDomain"); + tblSettings.Add("MaskCredentials", "false"); + tblSettings.Add("Timeout", "20"); + tblSettings.Add("RetryCount", "5"); + + tblSettings.Add("OAuth2ClientId", "OAuth2ClientId"); + tblSettings.Add("OAuth2ClientSecret", "OAuth2ClientSecret"); + tblSettings.Add("OAuth2ServiceAccountEmail", "OAuth2ServiceAccountEmail"); + tblSettings.Add("OAuth2PrnEmail", "OAuth2PrnEmail"); + tblSettings.Add("OAuth2JwtCertificatePath", "OAuth2JwtCertificatePath"); + tblSettings.Add("OAuth2JwtCertificatePassword", "OAuth2JwtCertificatePassword"); + tblSettings.Add("OAuth2AccessToken", "OAuth2AccessToken"); + tblSettings.Add("OAuth2RefreshToken", "OAuth2RefreshToken"); + tblSettings.Add("OAuth2Scope", "OAuth2Scope"); + tblSettings.Add("OAuth2RedirectUri", "OAuth2RedirectUri"); + tblSettings.Add("OAuth2Mode", "SERVICE_ACCOUNT"); + + tblSettings.Add("Email", "Email"); + tblSettings.Add("Password", "Password"); + tblSettings.Add("AuthToken", "AuthToken"); + tblSettings.Add("EnableGzipCompression", "false"); + } + + /// + /// Tests the overloaded constructors. + /// + [Test] + [Category("Small")] + public void TestReadSettings() { + MockAppConfig config = new MockAppConfig(); + config.MockReadSettings(tblSettings); + NetworkCredential credential = (NetworkCredential) config.Proxy.Credentials; + Assert.AreEqual(tblSettings["ProxyUser"].ToString(), credential.UserName); + Assert.AreEqual(tblSettings["ProxyPassword"].ToString(), credential.Password); + Assert.AreEqual(tblSettings["ProxyDomain"].ToString(), credential.Domain); + Assert.AreEqual(bool.Parse(tblSettings["MaskCredentials"].ToString()), + config.MaskCredentials); + Assert.AreEqual(int.Parse(tblSettings["Timeout"].ToString()), config.Timeout); + Assert.AreEqual(int.Parse(tblSettings["RetryCount"].ToString()), config.RetryCount); + + Assert.AreEqual(tblSettings["OAuth2ClientId"].ToString(), config.OAuth2ClientId); + Assert.AreEqual(tblSettings["OAuth2ClientSecret"].ToString(), config.OAuth2ClientSecret); + Assert.AreEqual(tblSettings["OAuth2ServiceAccountEmail"].ToString(), + config.OAuth2ServiceAccountEmail); + Assert.AreEqual(tblSettings["OAuth2PrnEmail"].ToString(), config.OAuth2PrnEmail); + Assert.AreEqual(tblSettings["OAuth2AccessToken"].ToString(), config.OAuth2AccessToken); + Assert.AreEqual(tblSettings["OAuth2RefreshToken"].ToString(), config.OAuth2RefreshToken); + Assert.AreEqual(tblSettings["OAuth2Scope"].ToString(), config.OAuth2Scope); + Assert.AreEqual(tblSettings["OAuth2RedirectUri"].ToString(), config.OAuth2RedirectUri); + Assert.AreEqual(tblSettings["OAuth2JwtCertificatePath"].ToString(), + config.OAuth2CertificatePath); + Assert.AreEqual(tblSettings["OAuth2JwtCertificatePassword"].ToString(), + config.OAuth2CertificatePassword); + Assert.AreEqual(tblSettings["OAuth2Mode"].ToString(), config.OAuth2Mode.ToString()); + + Assert.AreEqual(tblSettings["Email"].ToString(), config.Email); + Assert.AreEqual(tblSettings["Password"].ToString(), config.Password); + Assert.AreEqual(tblSettings["AuthToken"].ToString(), config.AuthToken); + Assert.AreEqual(bool.Parse(tblSettings["EnableGzipCompression"].ToString()), + config.EnableGzipCompression); + } + + /// + /// Tests the overloaded constructors. + /// + [Test] + [Category("Small")] + public void TestReadSettingsForDefaults() { + Assert.DoesNotThrow(delegate() { + MockAppConfig config = new MockAppConfig(); + config.MockReadSettings(null); + }); + } + + /// + /// Tests the timeout property setters and getters. + /// + [Test] + [Category("Small")] + public void TestTimeout() { + MockAppConfig config = new MockAppConfig(); + config.Timeout = 20; + Assert.AreEqual(20, config.Timeout); + } + + /// + /// Tests the retry count property setters and getters. + /// + [Test] + [Category("Small")] + public void TestRetryCount() { + MockAppConfig config = new MockAppConfig(); + config.RetryCount = 20; + Assert.AreEqual(20, config.RetryCount); + } + + /// + /// Tests the signature property getter. + /// + [Test] + [Category("Small")] + public void TestSignature() { + MockAppConfig config = new MockAppConfig(); + Assert.NotNull(config.Signature); + } + } +} diff --git a/tests/Common/Lib/AuthTokenTest.cs b/tests/Common/Lib/AuthTokenTest.cs new file mode 100644 index 00000000000..3f3e6ab2a67 --- /dev/null +++ b/tests/Common/Lib/AuthTokenTest.cs @@ -0,0 +1,175 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Common.Tests.Mocks; + +using NUnit.Framework; + +// Disable deprecation warnings for AuthToken class. +#pragma warning disable 612, 618 + +namespace Google.Api.Ads.Common.Tests.Lib { + /// + /// Tests for AuthToken class. + /// + class AuthTokenTest { + /// + /// Mock config instance for testing purposes. + /// + private readonly AppConfig config = new MockAppConfig(); + /// + /// Mock cache for testing purposes. + /// + private readonly AuthTokenCache cache = new MockAuthTokenCache(); + + /// + /// Service name. + /// + private const string SERVICE = "adwords"; + + /// + /// Login email. + /// + private const string EMAIL = "testemail"; + + /// + /// Login password. + /// + private const string PASSWORD = "testpassword"; + + /// + /// WebRequestInterceptor for intercepting calls to ClientLogin service. + /// + protected ClientLoginRequestInterceptor clientLoginInterceptor = + ClientLoginRequestInterceptor.Instance as ClientLoginRequestInterceptor; + + /// + /// Old cache before mocking. + /// + AuthTokenCache oldCache; + + /// + /// Inits the tests. + /// + [SetUp] + public void Init() { + config.Email = EMAIL; + config.Password = PASSWORD; + oldCache = AuthToken.Cache; + AuthToken.Cache = cache; + clientLoginInterceptor.Intercept = true; + } + + /// + /// Tears down the tests. + /// + [TearDown] + public void TearDown() { + AuthToken.Cache = oldCache; + clientLoginInterceptor.Intercept = false; + } + + /// + /// Tests the default constructor. + /// + [Test] + [Category("Small")] + public void TestDefaultConstructor() { + AuthToken authToken = new AuthToken(); + Assert.Null(authToken.Config); + Assert.Null(authToken.Service); + } + + /// + /// Tests the overloaded constructor. + /// + [Test] + [Category("Small")] + public void TestOverloadedConstructor() { + AuthToken authToken = new AuthToken(config, SERVICE); + Assert.AreEqual(authToken.Config, config); + Assert.AreEqual(authToken.Service, SERVICE); + } + + /// + /// Tests the property setters and getters. + /// + [Test] + [Category("Small")] + public void TestProperties() { + AuthToken authToken = new AuthToken(); + authToken.Email = EMAIL; + Assert.AreEqual(authToken.Email, EMAIL); + + authToken.Password = PASSWORD; + Assert.AreEqual(authToken.Password, PASSWORD); + + authToken.Service = SERVICE; + Assert.AreEqual(authToken.Service, SERVICE); + } + + /// + /// Tests the cache setter and getter methods. + /// + [Test] + [Category("Small")] + public void TestCacheSetterGetter() { + MockAuthTokenCache testCache = new MockAuthTokenCache(); + AuthToken.Cache = testCache; + Assert.AreEqual(AuthToken.Cache, testCache); + } + + /// + /// Tests if we can get an authToken successfully. + /// + [Test] + [Category("Small")] + public void TestGetToken() { + AuthToken authToken = new AuthToken(config, SERVICE); + TestUtils.ValidateRequiredParameters(authToken, new string[] {"Email", "Password"}, + delegate() { + authToken.GetToken(); + } + ); + string token = authToken.GetToken(); + Assert.AreEqual(token, ClientLoginRequestInterceptor.AUTH_TOKEN); + } + + /// + /// Tests if we can get an AuthTokenException correctly when the server + /// throws an exception. + /// + [Test] + [Category("Small")] + public void TestGetTokenThrowsException() { + try { + clientLoginInterceptor.RaiseException = true; + try { + AuthToken authToken = new AuthToken(config, SERVICE); + string token = authToken.GetToken(); + Assert.Fail(); + } catch (AuthTokenException ex) { + Assert.AreEqual(ex.ErrorCode, AuthTokenErrorCode.BadAuthentication); + } + } finally { + clientLoginInterceptor.RaiseException = false; + } + } + } +} + +#pragma warning restore 612, 618 diff --git a/tests/Common/Lib/DefaultAuthTokenCacheTests.cs b/tests/Common/Lib/DefaultAuthTokenCacheTests.cs new file mode 100644 index 00000000000..57acfe800f4 --- /dev/null +++ b/tests/Common/Lib/DefaultAuthTokenCacheTests.cs @@ -0,0 +1,116 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using NUnit.Framework; + +using System; + +// Disable deprecation warnings for DefaultAuthTokenCache class. +#pragma warning disable 612, 618 + +namespace Google.Api.Ads.Common.Tests.Lib { + /// + /// Tests for DefaultAuthTokenCache class. + /// + class DefaultAuthTokenCacheTests { + /// + /// The service name. + /// + private const string SERVICE = "adwords"; + + /// + /// Login email. + /// + private const string EMAIL = "testemail"; + + /// + /// AuthToken for test purposes. + /// + private const string AUTHTOKEN = "AUTHTOKEN"; + + /// + /// Cache instance for testing purposes. + /// + private DefaultAuthTokenCache cache = new DefaultAuthTokenCache(); + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + cache.Clear(); + } + + /// + /// Tests if we can add a token. + /// + [Test] + [Category("Small")] + public void TestAddToken() { + string token = cache.AddToken(SERVICE, EMAIL, AUTHTOKEN); + Assert.AreEqual(AUTHTOKEN, token); + } + + /// + /// Tests if arguments are validated when token is added to cache. + /// + [Test] + [Category("Small")] + public void TestAddTokenValidatesParams() { + Assert.Throws(typeof(ArgumentException), delegate() { + cache.AddToken(null, EMAIL, AUTHTOKEN); + }); + Assert.Throws(typeof(ArgumentException), delegate() { + cache.AddToken(SERVICE, null, AUTHTOKEN); + }); + } + + /// + /// Tests if we can retrieve a token after adding it. + /// + [Test] + [Category("Small")] + public void TestGetToken() { + cache.AddToken(SERVICE, EMAIL, AUTHTOKEN); + Assert.AreEqual(AUTHTOKEN, cache.GetToken(SERVICE, EMAIL)); + } + + /// + /// Tests if we can clear the cache. + /// + [Test] + [Category("Small")] + public void TestClear() { + Assert.Null(cache.GetToken(SERVICE, EMAIL)); + } + + /// + /// Tests if we can invalidate a token. + /// + [Test] + [Category("Small")] + public void TestInvalidateToken() { + cache.AddToken(SERVICE, EMAIL, AUTHTOKEN); + Assert.AreEqual(AUTHTOKEN, cache.GetToken(SERVICE, EMAIL)); + cache.InvalidateToken(AUTHTOKEN); + Assert.Null(cache.GetToken(SERVICE, EMAIL)); + } + } +} + +#pragma warning restore 612, 618 diff --git a/tests/Common/Lib/OAuth2ProviderForApplicationsTests.cs b/tests/Common/Lib/OAuth2ProviderForApplicationsTests.cs new file mode 100644 index 00000000000..3b7e49b1ddf --- /dev/null +++ b/tests/Common/Lib/OAuth2ProviderForApplicationsTests.cs @@ -0,0 +1,317 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using NUnit.Framework; + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Common.Tests; +using Google.Api.Ads.Common.Tests.Mocks; + +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Reflection; +using System.Text; + + +namespace Google.Api.Ads.Common.Tests.Lib { + /// + /// Tests for OAuth2ProviderForApplications class. + /// + public class OAuth2ProviderForApplicationsTests { + private OAuth2ProviderForApplications provider; + + private MockAppConfig appConfig; + private OAuth2RequestInterceptor oauth2RequestInterceptor = + (OAuth2RequestInterceptor) OAuth2RequestInterceptor.Instance; + + /// + /// The hashtable to hold the test data. + /// + private Hashtable tblSettings; + + // Keys for TestPropertySettersAndGetters. + private const string TEST_CLIENT_ID = "TEST_CLIENT_ID"; + private const string TEST_CLIENT_SECRET = "TEST_CLIENT_SECRET"; + private const string TEST_ACCESS_TOKEN = OAuth2RequestInterceptor.TEST_ACCESS_TOKEN; + private const string TEST_REFRESH_TOKEN = OAuth2RequestInterceptor.TEST_REFRESH_TOKEN; + private const string TEST_SCOPE = "TEST_SCOPE"; + private const string TEST_STATE = "TEST_STATE"; + private const bool TEST_OFFLINE = false; + private readonly OAuthTokensObtainedCallback TEST_CALLBACK = + delegate(AdsOAuthProvider provider) {}; + private const string TEST_REDIRECT_URI = "TEST_REDIRECT_URI"; + + /// + /// Signed request for getting access token for an installed application. + /// + private const string FETCH_ACCESS_TOKEN_REQUEST = "code=https%3a%2f%2faccounts.goog" + + "le.com%2fo%2foauth2%2fauth%3fscope%3dOAuth2Scope%26state%3d%26redirect_uri%3dO" + + "Auth2RedirectUri%26response_type%3dcode%26client_id%3dOAuth2ClientId%26access_" + + "type%3doffline&client_id=OAuth2ClientId&client_secret=OAuth2ClientSecret&redir" + + "ect_uri=OAuth2RedirectUri&grant_type=authorization_code"; + + /// + /// Authorization url for OAuth2. + /// + private const string AUTHORIZATION_URL = "https://accounts.google.com/o/oauth2/auth?" + + "scope=OAuth2Scope&state=&redirect_uri=OAuth2RedirectUri&response_type=code&clie" + + "nt_id=OAuth2ClientId&access_type=offline"; + + /// + /// Signed request for rereshing access token for an installed application. + /// + private const string REFRESH_ACCESS_TOKEN_REQUEST = "client_id=OAuth2ClientId&clien" + + "t_secret=OAuth2ClientSecret&refresh_token=" + TEST_REFRESH_TOKEN + + "&grant_type=refresh_token"; + + /// + /// OAuth2 url for revoking a refresh token. + /// + private const string REVOKE_REFRESH_TOKEN_URL = "https://accounts.google.com/o/oauth" + + "2/revoke?token=" + TEST_REFRESH_TOKEN; + + /// + /// OAuth2 authorization header. + /// + private const String AUTHORIZATION_HEADER = "Bearer " + TEST_ACCESS_TOKEN; + + /// + /// OAuth2 authorization code. + /// + private const string AUTHORIZATION_CODE = "AuthorizationCode"; + + /// + /// Initializes the test case. + /// + [SetUp] + public void Init() { + tblSettings = new Hashtable(); + + tblSettings.Add("OAuth2ClientId", "OAuth2ClientId"); + tblSettings.Add("OAuth2ClientSecret", "OAuth2ClientSecret"); + tblSettings.Add("OAuth2AccessToken", "OAuth2AccessToken"); + tblSettings.Add("OAuth2RefreshToken", "OAuth2RefreshToken"); + tblSettings.Add("OAuth2Scope", "OAuth2Scope"); + tblSettings.Add("OAuth2RedirectUri", "OAuth2RedirectUri"); + + appConfig = new MockAppConfig(); + appConfig.MockReadSettings(tblSettings); + provider = new OAuth2ProviderForApplications(appConfig); + oauth2RequestInterceptor.Intercept = true; + } + + /// + /// Tears down the test case. + /// + [TearDown] + public void TearDown() { + oauth2RequestInterceptor.Intercept = false; + } + + /// + /// Tests the default constructor. + /// + [Test] + public void TestConstructor() { + provider = new OAuth2ProviderForApplications(appConfig); + Assert.AreEqual(provider.ClientId, appConfig.OAuth2ClientId); + Assert.AreEqual(provider.ClientSecret, appConfig.OAuth2ClientSecret); + Assert.AreEqual(provider.AccessToken, appConfig.OAuth2AccessToken); + Assert.AreEqual(provider.RefreshToken, appConfig.OAuth2RefreshToken); + Assert.AreEqual(provider.Scope, appConfig.OAuth2Scope); + Assert.AreEqual(provider.RedirectUri, appConfig.OAuth2RedirectUri); + } + + /// + /// Tests the OAuth2 access token expiration logic. + /// + [Test] + public void TestIsAccessTokenExpiring() { + MethodInfo mi = typeof(OAuth2ProviderBase).GetMethod("IsAccessTokenExpiring", + BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.FlattenHierarchy); + + provider.OAuth2RefreshCutoffLimit = 60; + + // Test if token is not expired if there's > 60 seconds remaining. + provider.UpdatedOn = DateTime.Now.Subtract(new TimeSpan(0, 0, 1800)); + provider.ExpiresIn = 3600; + Assert.False((bool) mi.Invoke(provider, null)); + + // Test if token is expired if there's 60 seconds or lesser remaining. + provider.UpdatedOn = DateTime.Now.Subtract(new TimeSpan(0, 0, 3600)); + provider.ExpiresIn = 3600 - provider.OAuth2RefreshCutoffLimit; + Assert.True((bool) mi.Invoke(provider, null)); + + // Test if token is expired if there's no time left for expiration. + provider.UpdatedOn = DateTime.Now.Subtract(new TimeSpan(0, 0, 3700)); + provider.ExpiresIn = 3600; + Assert.True((bool) mi.Invoke(provider, null)); + } + + /// + /// Tests if we can the fetch access and refresh tokens for installed + /// clients. + /// + [Test] + public void TestFetchAccessAndRefreshTokens() { + TestUtils.ValidateRequiredParameters(provider, new string[] {"ClientId", "ClientSecret"}, + delegate() { + provider.RefreshAccessToken(); + } + ); + + oauth2RequestInterceptor.RequestType = + OAuth2RequestInterceptor.OAuth2RequestType.FetchAccessAndRefreshToken; + WebRequestInterceptor.OnBeforeSendResponse callback = delegate(Uri uri, + WebHeaderCollection headers, String body) { + Assert.AreEqual(FETCH_ACCESS_TOKEN_REQUEST, body); + }; + try { + oauth2RequestInterceptor.BeforeSendResponse += callback; + provider.FetchAccessAndRefreshTokens(AUTHORIZATION_URL); + Assert.AreEqual(provider.AccessToken, OAuth2RequestInterceptor.TEST_ACCESS_TOKEN); + Assert.AreEqual(provider.RefreshToken, OAuth2RequestInterceptor.TEST_REFRESH_TOKEN); + Assert.AreEqual(provider.TokenType, OAuth2RequestInterceptor.ACCESS_TOKEN_TYPE); + Assert.AreEqual(provider.ExpiresIn.ToString(), OAuth2RequestInterceptor.EXPIRES_IN); + } finally { + oauth2RequestInterceptor.BeforeSendResponse -= callback; + } + } + + /// + /// Tests if we can refresh an access token for installed clients. + /// + [Test] + public void TestRefreshAccessToken() { + TestUtils.ValidateRequiredParameters(provider, new string[] {"RefreshToken"}, delegate() { + provider.RefreshAccessToken(); + }); + provider.IsOffline = false; + Assert.Throws(delegate() { + provider.RefreshAccessToken(); + }); + provider.IsOffline = true; + + oauth2RequestInterceptor.RequestType = + OAuth2RequestInterceptor.OAuth2RequestType.RefreshAccessToken; + WebRequestInterceptor.OnBeforeSendResponse callback = delegate(Uri uri, + WebHeaderCollection headers, String body) { + Assert.AreEqual(REFRESH_ACCESS_TOKEN_REQUEST, body); + }; + try { + provider.RefreshToken = TEST_REFRESH_TOKEN; + oauth2RequestInterceptor.BeforeSendResponse += callback; + provider.RefreshAccessToken(); + Assert.AreEqual(provider.RefreshToken, TEST_REFRESH_TOKEN); + Assert.AreEqual(provider.TokenType, OAuth2RequestInterceptor.ACCESS_TOKEN_TYPE); + Assert.AreEqual(provider.ExpiresIn.ToString(), OAuth2RequestInterceptor.EXPIRES_IN); + } finally { + oauth2RequestInterceptor.BeforeSendResponse -= callback; + } + } + + /// + /// Tests if we can revoke a refresh token. + /// + [Test] + public void TestRevokeRefreshToken() { + TestUtils.ValidateRequiredParameters(provider, new string[] {"RefreshToken"}, delegate() { + provider.RevokeRefreshToken(); + }); + + oauth2RequestInterceptor.RequestType = + OAuth2RequestInterceptor.OAuth2RequestType.RefreshAccessToken; + WebRequestInterceptor.OnBeforeSendResponse callback = delegate(Uri uri, + WebHeaderCollection headers, String body) { + Assert.AreEqual(uri.AbsoluteUri, REVOKE_REFRESH_TOKEN_URL); + }; + try { + provider.RefreshToken = OAuth2RequestInterceptor.TEST_REFRESH_TOKEN; + oauth2RequestInterceptor.BeforeSendResponse += callback; + provider.RevokeRefreshToken(); + } finally { + oauth2RequestInterceptor.BeforeSendResponse -= callback; + } + } + + /// + /// Tests if we can retrieve an authorization url for OAuth2 authorization + /// process. + /// + [Test] + public void TestGetAuthorizationUrl() { + provider = new OAuth2ProviderForApplications(appConfig); + + TestUtils.ValidateRequiredParameters(provider, new string[] {"ClientId", "Scope"}, + delegate() { + provider.GetAuthorizationUrl(); + } + ); + + Assert.AreEqual(AUTHORIZATION_URL, provider.GetAuthorizationUrl()); + } + + /// + /// Tests if we can retrieve an OAuth2 authorization header. + /// + [Test] + public void TestGetAuthHeader() { + provider = new OAuth2ProviderForApplications(appConfig); + Assert.AreEqual(AUTHORIZATION_HEADER, provider.GetAuthHeader()); + } + + /// + /// Tests the property setters and getters. + /// + [Test] + public void TestPropertySettersAndGetters() { + provider = new OAuth2ProviderForApplications(appConfig); + + provider.ClientId = TEST_CLIENT_ID; + Assert.AreEqual(provider.ClientId, TEST_CLIENT_ID); + + provider.ClientSecret = TEST_CLIENT_SECRET; + Assert.AreEqual(provider.ClientSecret, TEST_CLIENT_SECRET); + + provider.AccessToken = TEST_ACCESS_TOKEN; + Assert.AreEqual(provider.AccessToken, TEST_ACCESS_TOKEN); + + provider.RefreshToken = TEST_REFRESH_TOKEN; + Assert.AreEqual(provider.RefreshToken, TEST_REFRESH_TOKEN); + + provider.Scope = TEST_SCOPE; + Assert.AreEqual(provider.Scope, TEST_SCOPE); + + provider.State = TEST_STATE; + Assert.AreEqual(provider.State, TEST_STATE); + + provider.IsOffline = TEST_OFFLINE; + Assert.AreEqual(provider.IsOffline, TEST_OFFLINE); + + provider.OnOAuthTokensObtained = TEST_CALLBACK; + Assert.AreEqual(provider.OnOAuthTokensObtained, TEST_CALLBACK); + + provider.IsOffline = TEST_OFFLINE; + Assert.AreEqual(provider.IsOffline, TEST_OFFLINE); + + provider.RedirectUri = TEST_REDIRECT_URI; + Assert.AreEqual(provider.RedirectUri, TEST_REDIRECT_URI); + } + } +} diff --git a/tests/Common/Lib/OAuth2ProviderForServiceAccountsTests.cs b/tests/Common/Lib/OAuth2ProviderForServiceAccountsTests.cs new file mode 100644 index 00000000000..8be5fca372d --- /dev/null +++ b/tests/Common/Lib/OAuth2ProviderForServiceAccountsTests.cs @@ -0,0 +1,202 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using NUnit.Framework; + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Common.Tests; +using Google.Api.Ads.Common.Tests.Mocks; + +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Reflection; +using System.Text; + +namespace Google.Api.Ads.Common.Tests.Lib { + /// + /// Tests for OAuth2ProviderForServiceAccounts class. + /// + public class OAuth2ProviderForServiceAccountsTests { + private OAuth2ProviderForServiceAccounts provider; + private MockAppConfig appConfig; + private OAuth2RequestInterceptor oauth2RequestInterceptor = + (OAuth2RequestInterceptor) OAuth2RequestInterceptor.Instance; + + /// + /// The hashtable to hold the test data. + /// + private Hashtable tblSettings; + + /// + /// Signed request for getting access token for a service account. + /// + private const string SERVICE_ACCOUNT_REQUEST = "grant_type=urn%3aietf%3aparams%3aoa" + + "uth%3agrant-type%3ajwt-bearer&assertion=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.e" + + "yJpc3MiOiJPQXV0aDJTZXJ2aWNlQWNjb3VudEVtYWlsIiwgInNjb3BlIjoiT0F1dGgyU2NvcGUiLCA" + + "iYXVkIjoiaHR0cHM6Ly9hY2NvdW50cy5nb29nbGUuY29tL28vb2F1dGgyL3Rva2VuIiwgImV4cCI6M" + + "TM1MzkyODU1MSwgImlhdCI6MTM1MzkyNDk1MSwgInBybiI6Ik9BdXRoMlBybkVtYWlsIn0.bYZ4PtQ" + + "nRVLrmTfaalQtoLyAOZFOqrHjAMV0i62N5RoGosHPH6xC4tmb9FNigdgFrBKzz1z61ussF_ZPVs-PR" + + "8XceOk9pu-67YCZLo9C2wHLiotl8JE9yR-B1tTSU8L4w0yiAw5HY1GdT1Qa3iB2seA7bDjp5TQjvyw" + + "h1-PQ6Lw"; + + /// + /// OAuth2 authorization header. + /// + private const String AUTHORIZATION_HEADER = "Bearer " + TEST_ACCESS_TOKEN; + + // Keys for TestPropertySettersAndGetters. + private const string TEST_CLIENT_ID = "TEST_CLIENT_ID"; + private const string TEST_CLIENT_SECRET = "TEST_CLIENT_SECRET"; + private const string TEST_ACCESS_TOKEN = OAuth2RequestInterceptor.TEST_ACCESS_TOKEN; + private const string TEST_SCOPE = "TEST_SCOPE"; + private const string TEST_STATE = "TEST_STATE"; + private readonly OAuthTokensObtainedCallback TEST_CALLBACK = + delegate(AdsOAuthProvider provider) {}; + private const string TEST_SERVICE_ACCOUNT_EMAIL = "TEST_SERVICE_ACCOUNT_EMAIL"; + private const string TEST_PRN_EMAIL = "TEST_PRN_EMAIL"; + private const string TEST_JWT_CERTIFICATE_PATH = "TEST_JWT_CERTIFICATE_PATH"; + private const string TEST_JWT_CERTIFICATE_PASSWORD = "TEST_JWT_CERTIFICATE_PASSWORD"; + + /// + /// Initializes the test case. + /// + [SetUp] + public void Init() { + tblSettings = new Hashtable(); + tblSettings.Add("OAuth2ClientId", "OAuth2ClientId"); + tblSettings.Add("OAuth2ClientSecret", "OAuth2ClientSecret"); + tblSettings.Add("OAuth2ServiceAccountEmail", "OAuth2ServiceAccountEmail"); + tblSettings.Add("OAuth2PrnEmail", "OAuth2PrnEmail"); + + tblSettings.Add("OAuth2AccessToken", "OAuth2AccessToken"); + tblSettings.Add("OAuth2Scope", "OAuth2Scope"); + tblSettings.Add("OAuth2RedirectUri", "OAuth2RedirectUri"); + string tempCertificatePath = Path.GetTempFileName(); + using (FileStream fs = File.OpenWrite(tempCertificatePath)) { + fs.Write(Resources.certificate, 0, Resources.certificate.Length); + } + tblSettings.Add("OAuth2JwtCertificatePath", tempCertificatePath); + tblSettings.Add("OAuth2JwtCertificatePassword", "notasecret"); + + appConfig = new MockAppConfig(); + appConfig.MockReadSettings(tblSettings); + provider = new OAuth2ProviderForServiceAccounts(appConfig); + oauth2RequestInterceptor.Intercept = true; + } + + /// + /// Tears down the test case. + /// + [TearDown] + public void TearDown() { + oauth2RequestInterceptor.Intercept = false; + } + + /// + /// Tests the default constructor. + /// + [Test] + public void TestConstructor() { + provider = new OAuth2ProviderForServiceAccounts(appConfig); + Assert.AreEqual(provider.ClientId, appConfig.OAuth2ClientId); + Assert.AreEqual(provider.ClientSecret, appConfig.OAuth2ClientSecret); + Assert.AreEqual(provider.AccessToken, appConfig.OAuth2AccessToken); + Assert.AreEqual(provider.Scope, appConfig.OAuth2Scope); + Assert.AreEqual(provider.ServiceAccountEmail, appConfig.OAuth2ServiceAccountEmail); + Assert.AreEqual(provider.PrnEmail, appConfig.OAuth2PrnEmail); + Assert.AreEqual(provider.JwtCertificatePath, appConfig.OAuth2CertificatePath); + Assert.AreEqual(provider.JwtCertificatePassword, appConfig.OAuth2CertificatePassword); + } + + /// + /// Tests if we can generate an access token for service accounts. + /// + [Test] + public void TestGenerateAccessTokenForServiceAccounts() { + TestUtils.ValidateRequiredParameters(provider, new string[] {"ServiceAccountEmail", + "Scope", "PrnEmail", "JwtCertificatePath", "JwtCertificatePassword"}, + delegate() { + provider.GenerateAccessTokenForServiceAccount(); + } + ); + oauth2RequestInterceptor.RequestType = + OAuth2RequestInterceptor.OAuth2RequestType.FetchAccessTokenForServiceAccount; + WebRequestInterceptor.OnBeforeSendResponse callback = delegate(Uri uri, + WebHeaderCollection headers, String body) { + Assert.AreEqual(SERVICE_ACCOUNT_REQUEST, body); + }; + try { + oauth2RequestInterceptor.BeforeSendResponse += callback; + provider.GenerateAccessTokenForServiceAccount(); + Assert.AreEqual(provider.AccessToken, OAuth2RequestInterceptor.TEST_ACCESS_TOKEN); + Assert.AreEqual(provider.TokenType, OAuth2RequestInterceptor.ACCESS_TOKEN_TYPE); + Assert.AreEqual(provider.ExpiresIn.ToString(), OAuth2RequestInterceptor.EXPIRES_IN); + } finally { + oauth2RequestInterceptor.BeforeSendResponse -= callback; + } + } + + /// + /// Tests if we can retrieve an OAuth2 authorization header. + /// + [Test] + public void TestGetAuthHeader() { + provider = new OAuth2ProviderForServiceAccounts(appConfig); + Assert.AreEqual(AUTHORIZATION_HEADER, provider.GetAuthHeader()); + } + + /// + /// Tests the property setters and getters. + /// + [Test] + public void TestPropertySettersAndGetters() { + provider = new OAuth2ProviderForServiceAccounts(appConfig); + + provider.ClientId = TEST_CLIENT_ID; + Assert.AreEqual(provider.ClientId, TEST_CLIENT_ID); + + provider.ClientSecret = TEST_CLIENT_SECRET; + Assert.AreEqual(provider.ClientSecret, TEST_CLIENT_SECRET); + + provider.AccessToken = TEST_ACCESS_TOKEN; + Assert.AreEqual(provider.AccessToken, TEST_ACCESS_TOKEN); + + provider.Scope = TEST_SCOPE; + Assert.AreEqual(provider.Scope, TEST_SCOPE); + + provider.State = TEST_STATE; + Assert.AreEqual(provider.State, TEST_STATE); + + provider.OnOAuthTokensObtained = TEST_CALLBACK; + Assert.AreEqual(provider.OnOAuthTokensObtained, TEST_CALLBACK); + + provider.ServiceAccountEmail = TEST_SERVICE_ACCOUNT_EMAIL; + Assert.AreEqual(provider.ServiceAccountEmail, TEST_SERVICE_ACCOUNT_EMAIL); + + provider.PrnEmail = TEST_PRN_EMAIL; + Assert.AreEqual(provider.PrnEmail, TEST_PRN_EMAIL); + + provider.JwtCertificatePath = TEST_JWT_CERTIFICATE_PATH; + Assert.AreEqual(provider.JwtCertificatePath, TEST_JWT_CERTIFICATE_PATH); + + provider.JwtCertificatePassword = TEST_JWT_CERTIFICATE_PASSWORD; + Assert.AreEqual(provider.JwtCertificatePassword, TEST_JWT_CERTIFICATE_PASSWORD); + } + } +} diff --git a/tests/Common/Lib/ServiceFactoryTests.cs b/tests/Common/Lib/ServiceFactoryTests.cs new file mode 100644 index 00000000000..43cd5951b78 --- /dev/null +++ b/tests/Common/Lib/ServiceFactoryTests.cs @@ -0,0 +1,45 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Common.Tests.Mocks; + +using NUnit.Framework; + +using System; + +namespace Google.Api.Ads.Common.Tests.Lib { + /// + /// Tests the ServiceFactory class. + /// + public class ServiceFactoryTests { + /// + /// The test configuration class. + /// + MockAppConfig config = new MockAppConfig(); + + /// + /// Tests the property setters and getters. + /// + [Test] + [Category("Small")] + public void TestProperties() { + ServiceFactory serviceFactory = new MockServiceFactory(); + serviceFactory.Config = config; + Assert.AreEqual(config, serviceFactory.Config); + } + } +} diff --git a/tests/Common/Lib/ServiceSignatureTests.cs b/tests/Common/Lib/ServiceSignatureTests.cs new file mode 100644 index 00000000000..1a5cafe4cae --- /dev/null +++ b/tests/Common/Lib/ServiceSignatureTests.cs @@ -0,0 +1,58 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Common.Tests.Mocks; + +using NUnit.Framework; + +using System; + +namespace Google.Api.Ads.Common.Tests.Lib { + /// + /// Tests the ServiceSignature class. + /// + public class ServiceSignatureTests { + /// + /// The test version string. + /// + const string VERSION = "TEST_VERSION"; + + /// + /// The test service name string. + /// + const string SERVICE_NAME = "SERVICE_NAME"; + + /// + /// The test protocol. + /// + const ServiceSignature.SupportedProtocols PROTOCOLS = ServiceSignature.SupportedProtocols.SOAP; + + /// + /// Tests the property setters and getters. + /// + [Test] + [Category("Small")] + public void TestProperties() { + MockServiceSignature signature = new MockServiceSignature(VERSION, SERVICE_NAME, PROTOCOLS); + Assert.AreEqual(VERSION, signature.Version); + Assert.AreEqual(SERVICE_NAME, signature.ServiceName); + Assert.AreEqual(PROTOCOLS, signature.SupportedProtocol); + Assert.NotNull(signature.Id); + Assert.Null(signature.ServiceType); + } + } +} diff --git a/tests/Common/Lib/TraceListenerTests.cs b/tests/Common/Lib/TraceListenerTests.cs new file mode 100644 index 00000000000..7023e3c7fda --- /dev/null +++ b/tests/Common/Lib/TraceListenerTests.cs @@ -0,0 +1,157 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Common.Tests.Mocks; + +using NUnit.Framework; + +using System; +using System.IO; +using System.Runtime.Serialization.Formatters.Binary; +using System.Xml; + +namespace Google.Api.Ads.Common.Tests.Lib { + /// + /// Tests for TraceListener class. + /// + public class TraceListenerTests { + /// + /// The AppConfig instance for testing this class. + /// + MockAppConfig config = new MockAppConfig(); + + /// + /// The TraceListener instance for testing this class. + /// + MockTraceListener listener; + + /// + /// The AdsUser instance for testing this class. + /// + MockAdsUser user; + + /// + /// The AdsClient instance for testing this class. + /// + MockAdsClient adsClient; + + /// + /// Initializes the test case. + /// + [SetUp] + public void Init() { + user = new MockAdsUser(config); + adsClient = new MockAdsClient(); + adsClient.User = user; + + MockWebResponse response = new MockWebResponse(null, null); + response.Headers["TestResponseKey"] = "TestResponseValue"; + adsClient.LastResponse = response; + + MockWebRequest request = new MockWebRequest(response, new Uri("http://localhost"), null, + false); + request.Method = "POST"; + request.Headers["TestRequestKey"] = "TestRequestValue"; + adsClient.LastRequest = request; + } + + /// + /// Tears down the test case. + /// + [TearDown] + public void Dispose() { + listener.CleanupAfterCall(); + } + + /// + /// Tests the HandleMessage method. + /// + [Test] + [Category("Small")] + public void TestHandleMessage() { + config.SetPropertyFieldForTests("MaskCredentials", true); + listener = new MockTraceListener(config); + + XmlDocument xOutgoing = new XmlDocument(); + xOutgoing.LoadXml(Resources.XmlRequest); + listener.HandleMessage(xOutgoing, adsClient, SoapMessageDirection.OUT); + Assert.AreEqual(xOutgoing.OuterXml, ContextStore.GetValue("SoapRequest")); + + XmlDocument xIncoming = new XmlDocument(); + xIncoming.LoadXml(Resources.XmlResponse); + listener.HandleMessage(xIncoming, adsClient, SoapMessageDirection.IN); + Assert.AreEqual(xIncoming.OuterXml, ContextStore.GetValue("SoapResponse")); + Assert.AreEqual(Resources.SoapLog.Replace("\r\n", "\n"), + ((string) ContextStore.GetValue("FormattedSoapLog")).Replace("\r\n", "\n")); + Assert.AreEqual(Resources.ResponseLog.Replace("\r\n", "\n"), + ((string) ContextStore.GetValue("FormattedRequestLog")).Replace("\r\n", "\n")); + } + + /// + /// Tests the HandleMessage method to see if logging doesn't happen if + /// the AdsClient instance is null. + /// + [Test] + [Category("Small")] + public void TestHandleMessageNoClient() { + config.SetPropertyFieldForTests("MaskCredentials", true); + listener = new MockTraceListener(config); + + XmlDocument xOutgoing = new XmlDocument(); + xOutgoing.LoadXml(Resources.XmlRequest); + listener.HandleMessage(xOutgoing, null, SoapMessageDirection.OUT); + Assert.AreEqual(xOutgoing.OuterXml, ContextStore.GetValue("SoapRequest")); + + XmlDocument xIncoming = new XmlDocument(); + xIncoming.LoadXml(Resources.XmlResponse); + listener.HandleMessage(xIncoming, null, SoapMessageDirection.IN); + Assert.AreEqual(xIncoming.OuterXml, ContextStore.GetValue("SoapResponse")); + Assert.IsNull(ContextStore.GetValue("FormattedSoapLog")); + Assert.IsNull(ContextStore.GetValue("FormattedRequestLog")); + } + + /// + /// Test the GetTimeStamp method. + /// + [Test] + [Category("Small")] + public void TestGetTimeStamp() { + listener = new MockTraceListener(config); + Assert.DoesNotThrow(delegate() { + listener.GetTimeStampForTest(); + }); + } + + /// + /// Tests the CleanupAfterCall method. + /// + [Test] + [Category("Small")] + public void TestCleanupAfterCall() { + listener = new MockTraceListener(config); + ContextStore.AddKey("SoapRequest", "SoapRequest"); + ContextStore.AddKey("SoapResponse", "SoapResponse"); + ContextStore.AddKey("FormattedSoapLog", "FormattedSoapLog"); + ContextStore.AddKey("FormattedRequestLog", "FormattedRequestLog"); + listener.CleanupAfterCall(); + Assert.Null(ContextStore.GetValue("SoapRequest")); + Assert.Null(ContextStore.GetValue("SoapResponse")); + Assert.Null(ContextStore.GetValue("FormattedSoapLog")); + Assert.Null(ContextStore.GetValue("FormattedRequestLog")); + } + } +} diff --git a/tests/Common/MockWebRequest.cs b/tests/Common/MockWebRequest.cs new file mode 100644 index 00000000000..445bb54f39a --- /dev/null +++ b/tests/Common/MockWebRequest.cs @@ -0,0 +1,299 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; + +namespace Google.Api.Ads.Common.Tests { + /// + /// Represents a mock web request object used by WebRequestInterceptor. + /// + public class MockWebRequest : WebRequest { + /// + /// Timeout in milliseconds. + /// + int timeout; + + /// + /// The connection group name. + /// + string connectionGroupName; + + /// + /// The web credentials. + /// + ICredentials credentials; + + /// + /// Flag to decide whether or not to preauthenticate. + /// + bool preAuthenticate; + + /// + /// HTTP request content type. + /// + string contentType; + + /// + /// HTTP method name. + /// + string method; + + /// + /// HTTP request headers. + /// + WebHeaderCollection headers = new WebHeaderCollection(); + + /// + /// Request stream. + /// + MemoryStream requestStream = new MemoryStream(); + + /// + /// Response for this request. + /// + WebResponse webResponse; + + /// + /// Request url. + /// + Uri requestUri; + + /// + /// Web proxy. + /// + IWebProxy proxy; + + /// + /// Request content length in bytes. + /// + long contentLength; + + /// + /// Callback delegate before sending response. + /// + WebRequestInterceptor.OnBeforeSendResponse onBeforeSendResponse; + + /// + /// If set to true, then Get will return an error code rather + /// than a successful response. + /// + private bool raiseException; + + /// + /// Initializes a new instance of the class. + /// + /// The web response. + /// The request URI. + /// Callback to be called before sending + /// response. + public MockWebRequest(MockWebResponse webResponse, Uri requestUri, + WebRequestInterceptor.OnBeforeSendResponse onBeforeSendResponse, bool raiseException) { + this.webResponse = webResponse; + this.requestUri = requestUri; + this.onBeforeSendResponse = onBeforeSendResponse; + this.raiseException = raiseException; + } + + /// + /// Gets or sets the content length of the request data being sent. + /// + /// + /// The number of bytes of request data being sent. + /// + public override long ContentLength { + get { + return contentLength; + } + set { + contentLength = value; + } + } + + /// + /// Gets or sets the network proxy to use to access this Internet resource. + /// + /// + /// The to use to access the Internet + /// resource. + /// + public override IWebProxy Proxy { + get { + return proxy; + } + set { + proxy = value; + } + } + + /// + /// Gets or sets the length of time, in milliseconds, before the request + /// times out. + /// + /// + /// The length of time, in milliseconds, until the request times out, or + /// the value to indicate + /// that the request does not time out. The default value is defined by the + /// descendant class. + /// + public override int Timeout { + get { + return timeout; + } + set { + timeout = value; + } + } + + /// + /// Gets the URI of the Internet resource associated with the request. + /// + /// + /// A representing the resource associated with + /// the request + /// + public override Uri RequestUri { + get { + return requestUri; + } + } + + /// + /// Gets or sets the name of the connection group for the request. + /// + /// + /// The name of the connection group for the request. + /// + public override string ConnectionGroupName { + get { + return connectionGroupName; + } + set { + connectionGroupName = value; + } + } + + /// + /// Gets or sets the network credentials used for authenticating the request + /// with the Internet resource. + /// + /// + /// An containing the authentication + /// credentials associated with the request. The default is null. + /// + public override ICredentials Credentials { + get { + return credentials; + } + set { + credentials = value; + } + } + + /// + /// Indicates whether to pre-authenticate the request. + /// + /// true to pre-authenticate; otherwise, false. + /// + public override bool PreAuthenticate { + get { + return preAuthenticate; + } + set { + preAuthenticate = value; + } + } + + /// + /// Gets or sets the content type of the request data being sent. + /// + /// + /// The content type of the request data. + /// + public override string ContentType { + get { + return contentType; + } + set { + contentType = value; + } + } + + /// + /// Gets or sets the protocol method to use in this request. + /// + /// + /// The protocol method to use in this request. + /// + public override string Method { + get { + return method; + } + set { + method = value; + } + } + + /// + /// Gets or sets the collection of header name/value pairs associated with + /// the request. + /// + /// + /// A containing the header + /// name/value pairs associated with this request. + /// + public override WebHeaderCollection Headers { + get { + return headers; + } + set { + headers = value; + } + } + + /// + /// Returns a for writing data to the + /// Internet resource. + /// + /// + /// A for writing data to the Internet + /// resource. + /// + public override Stream GetRequestStream() { + return requestStream; + } + + /// + /// Returns a response to an Internet request. + /// + /// + /// A containing the response to the + /// Internet request. + /// + public override WebResponse GetResponse() { + onBeforeSendResponse(this.requestUri, headers, Encoding.UTF8.GetString( + requestStream.ToArray())); + if (raiseException) { + throw new WebException("", null, WebExceptionStatus.ProtocolError, webResponse); + } else { + return webResponse; + } + } + } +} diff --git a/tests/Common/MockWebResponse.cs b/tests/Common/MockWebResponse.cs new file mode 100644 index 00000000000..eecb34160d1 --- /dev/null +++ b/tests/Common/MockWebResponse.cs @@ -0,0 +1,119 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.IO; +using System.Net; +using System.Text; + +namespace Google.Api.Ads.Common.Tests { + /// + /// Represents a mock web response object used by WebRequestInterceptor. + /// + public class MockWebResponse : WebResponse { + /// + /// The response stream. + /// + MemoryStream responseStream; + + /// + /// The response content type. + /// + string contentType; + + /// + /// The HTTP response headers. + /// + WebHeaderCollection headers = new WebHeaderCollection(); + + /// + /// Initializes a new instance of the class. + /// + /// The mock response. + /// Type of the content. + public MockWebResponse(string mockResponse, string contentType) { + this.contentType = contentType; + this.responseStream = new MemoryStream(); + + if (mockResponse != null) { + byte[] data = Encoding.UTF8.GetBytes(mockResponse); + this.responseStream.Write(data, 0, data.Length); + } + } + + /// + /// Returns the data stream from the Internet resource. + /// + /// + /// An instance of the class for reading + /// data from the Internet resource. + /// + public override Stream GetResponseStream() { + this.responseStream.Seek(0, SeekOrigin.Begin); + return responseStream; + } + + /// + /// Closes the response stream. + /// + public override void Close() { + responseStream.Close(); + } + + /// + /// Gets or sets the content type of the data being received. + /// + /// + /// A string that contains the content type of the response. + /// + public override string ContentType { + get { + return contentType; + } + set { + contentType = value; + } + } + + /// + /// Gets or sets the content length of data being received. + /// + /// + /// The number of bytes returned from the Internet resource. + /// + public override long ContentLength { + get { + return base.ContentLength; + } + set { + base.ContentLength = value; + } + } + + /// + /// Gets a collection of header name-value pairs associated with this + /// request. + /// + /// + /// An instance of the class + /// that contains header values associated with this response. + /// + public override WebHeaderCollection Headers { + get { + return headers; + } + } + } +} diff --git a/tests/Common/Mocks/MockAdsClient.cs b/tests/Common/Mocks/MockAdsClient.cs new file mode 100644 index 00000000000..4773f35882f --- /dev/null +++ b/tests/Common/Mocks/MockAdsClient.cs @@ -0,0 +1,224 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Net; +using System.Security.Cryptography.X509Certificates; +using System.Text; + +namespace Google.Api.Ads.Common.Tests.Mocks { + /// + /// Implements a mock version of AdsClient interface for testing purposes. + /// + /// Only the properties needed for testing Ads.Common assembly are + /// implemented, all other properties throw a NotImplementedException. + /// + class MockAdsClient : AdsClient { + /// + /// The user who created this service. + /// + AdsUser user; + + /// + /// The webrequest used for making the last API call. + /// + WebRequest lastRequest; + + /// + /// The webresponse from the last API call. + /// + WebResponse response; + + /// + /// Gets or sets the AdsUser object that created this + /// service. + /// + public AdsUser User { + get { + return user; + } + set { + user = value; + } + } + + + /// + /// Gets or sets the signature for this service. + /// + public ServiceSignature Signature { + get { + throw new NotImplementedException(); + } + set { + throw new NotImplementedException(); + } + } + + /// + /// Gets or sets the web request associated with this service's + /// last API call. + /// + public WebRequest LastRequest { + get { + return lastRequest; + } + set { + lastRequest = value; + } + } + + /// + /// Gets or sets the web response associated with this service's + /// last API call. + /// + public WebResponse LastResponse { + get { + return response; + } + set { + response = value; + } + } + + #region Unimplemented Properties + + public string ConnectionGroupName { + get { + throw new NotImplementedException(); + } + set { + throw new NotImplementedException(); + } + } + + public ICredentials Credentials { + get { + throw new NotImplementedException(); + } + set { + throw new NotImplementedException(); + } + } + + public bool PreAuthenticate { + get { + throw new NotImplementedException(); + } + set { + throw new NotImplementedException(); + } + } + + public Encoding RequestEncoding { + get { + throw new NotImplementedException(); + } + set { + throw new NotImplementedException(); + } + } + + public int Timeout { + get { + throw new NotImplementedException(); + } + set { + throw new NotImplementedException(); + } + } + + public string Url { + get { + throw new NotImplementedException(); + } + set { + throw new NotImplementedException(); + } + } + + public bool UseDefaultCredentials { + get { + throw new NotImplementedException(); + } + set { + throw new NotImplementedException(); + } + } + + public bool AllowAutoRedirect { + get { + throw new NotImplementedException(); + } + set { + throw new NotImplementedException(); + } + } + + public X509CertificateCollection ClientCertificates { + get { throw new NotImplementedException(); } + } + + public CookieContainer CookieContainer { + get { + throw new NotImplementedException(); + } + set { + throw new NotImplementedException(); + } + } + + public bool EnableDecompression { + get { + throw new NotImplementedException(); + } + set { + throw new NotImplementedException(); + } + } + + public IWebProxy Proxy { + get { + throw new NotImplementedException(); + } + set { + throw new NotImplementedException(); + } + } + + public bool UnsafeAuthenticatedConnectionSharing { + get { + throw new NotImplementedException(); + } + set { + throw new NotImplementedException(); + } + } + + public string UserAgent { + get { + throw new NotImplementedException(); + } + set { + throw new NotImplementedException(); + } + } + + #endregion + } +} diff --git a/tests/Common/Mocks/MockAdsException.cs b/tests/Common/Mocks/MockAdsException.cs new file mode 100644 index 00000000000..2a9bff60ff7 --- /dev/null +++ b/tests/Common/Mocks/MockAdsException.cs @@ -0,0 +1,97 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Runtime.Serialization; +using System.Security.Permissions; + +namespace Google.Api.Ads.Common.Tests.Mocks { + /// + /// Implements a mock version of AdsException class for testing purposes. + /// + [Serializable()] + public class MockAdsException : AdsException { + /// + /// Mock property, for testing serialization. + /// + int mockProperty; + + /// + /// Gets or sets the mock property for testing serialization. + /// + /// + /// The mock property. + /// + public int MockProperty { + get { + return mockProperty; + } + set { + mockProperty = value; + } + } + + /// + /// Public constructor. + /// + public MockAdsException() : base() { + } + + /// + /// Public constructor. + /// + /// Error message for this API exception. + public MockAdsException(string message) : base(message) { + } + + /// + /// Public constructor. + /// + /// Error message for this API exception. + /// Inner exception, if any. + public MockAdsException(string message, Exception innerException) + : base(message, innerException) { + } + + + /// + /// Protected constructor. Used by serialization frameworks while + /// deserializing an exception object. + /// + /// Info about the serialization context. + /// A streaming context that represents the + /// serialization stream. + protected MockAdsException(SerializationInfo info, StreamingContext context) + : base(info, context) { + mockProperty = GetValue(info, "MockProperty"); + } + + /// + /// This method is called by serialization frameworks while serializing + /// an exception object. + /// + /// Info about the serialization context. + /// A streaming context that represents the + /// serialization stream. + [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)] + public override void GetObjectData(SerializationInfo info, StreamingContext context) { + base.GetObjectData(info, context); + info.AddValue("MockProperty", mockProperty); + } + } +} diff --git a/tests/Common/Mocks/MockAdsUser.cs b/tests/Common/Mocks/MockAdsUser.cs new file mode 100644 index 00000000000..411c394afe8 --- /dev/null +++ b/tests/Common/Mocks/MockAdsUser.cs @@ -0,0 +1,54 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; + +namespace Google.Api.Ads.Common.Tests.Mocks { + /// + /// Implments a mock version of AdsUser class for testing purposes. + /// + class MockAdsUser : AdsUser { + /// + /// Overloaded constructor. + /// + /// The configuration class. + public MockAdsUser(MockAppConfig config) + : base(config) { + } + + /// + /// Gets all the service types to be registered against this user. + /// + /// + /// The type of all service classes to be registered. + /// + public override Type[] GetServiceTypes() { + return null; + } + + /// + /// Gets the default listeners. + /// + /// + /// A list of default listeners + /// + public override SoapListener[] GetDefaultListeners() { + return new SoapListener[] {new MockTraceListener(this.Config)}; + } + } +} diff --git a/tests/Common/Mocks/MockAppConfig.cs b/tests/Common/Mocks/MockAppConfig.cs new file mode 100644 index 00000000000..3b51b971fc3 --- /dev/null +++ b/tests/Common/Mocks/MockAppConfig.cs @@ -0,0 +1,87 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections; + +namespace Google.Api.Ads.Common.Tests.Mocks { + /// + /// Implements a mock version of AppConfigBase class for testing purposes. + /// + public class MockAppConfig : AppConfigBase { + /// + /// The short name to identify this assembly. + /// + private const string SHORT_NAME = "Mock-DotNet"; + + private const long TEST_TIMESTAMP = 1353924951; + + private const string TEST_OAUTH2_SCOPE = "TEST_OAUTH2_SCOPE"; + + /// + /// Default constuctor. + /// + public MockAppConfig() : base() { + } + + /// + /// Gets the number of seconds after Jan 1, 1970, 00:00:00 + /// + public override long UnixTimestamp { + get { + return TEST_TIMESTAMP; + } + } + + /// + /// Gets the default OAuth2 scope. + /// + /// + public override string GetDefaultOAuth2Scope() { + return TEST_OAUTH2_SCOPE; + } + + /// + /// Allows the test cases to call ReadSettings method for testing purposes. + /// + /// The configuraiton settings. + /// AppConfigBase class loads its settings from App.config, and the + /// framework calls ReadSettings method to load the values. However, this is + /// a protected method, so we expose ReadSettings in the mock version to + /// allow easier configuration of AppConfig while running test cases. + /// + public void MockReadSettings(Hashtable tblSettings) { + base.ReadSettings(tblSettings); + } + + /// + /// Sets the property field for tests. + /// + /// Name of the property. + /// The new value. + /// Most properties in AppConfigBase class are readonly, and are + /// initalized at during the creation of the AppConfig instance. However, + /// it is desirable during testing to change the value of one of these + /// properties so that we can avoid initializing a new AppConfig instance + /// just to test the coverage of another class that uses the config class. + /// + public void SetPropertyFieldForTests(string propertyName, object newValue) { + this.GetType().GetProperty(propertyName).SetValue(this, newValue, null); + } + } +} diff --git a/tests/Common/Mocks/MockAuthTokenCache.cs b/tests/Common/Mocks/MockAuthTokenCache.cs new file mode 100644 index 00000000000..624e83512b9 --- /dev/null +++ b/tests/Common/Mocks/MockAuthTokenCache.cs @@ -0,0 +1,102 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.Collections.Generic; +using System.Text; + +// Disable deprecation warnings for AuthTokenCache class. +#pragma warning disable 612, 618 + +namespace Google.Api.Ads.Common.Tests.Mocks { + /// + /// Mock class for AuthTokenCache. + /// + class MockAuthTokenCache : AuthTokenCache { + /// + /// Adds an auth token to cache. + /// + /// The ClientLogin service for which this auth token + /// is generated. + /// The login email. + /// The login password. + /// The auth token. + /// + /// The auth token. + /// + public string AddToken(string service, string email, string password, string token) { + return AddToken(service, email, token); + } + + /// + /// Gets an auth token from cache. + /// + /// The ClientLogin service for which this auth token + /// is generated. + /// The login email. + /// The login password. + /// + /// The auth token, or null if the cache doesn't have a token. + /// + public string GetToken(string service, string email, string password) { + return GetToken(service, email); + } + + /// + /// Adds an auth token to cache. + /// + /// The ClientLogin service for which this auth token + /// is generated. + /// The login email. + /// The auth token. + /// + /// The auth token. + /// + public string AddToken(string service, string email, string token) { + return token; + } + + /// + /// Gets an auth token from cache. + /// + /// The ClientLogin service for which this auth token + /// is generated. + /// The login email. + /// + /// The auth token, or null if the cache doesn't have a token. + /// + public string GetToken(string service, string email) { + return null; + } + + /// + /// Invalidates an auth token. + /// + /// The auth token. + public void InvalidateToken(string token) { + } + + /// + /// Clears the cache. + /// + public void Clear() { + } + } +} + +#pragma warning restore 612, 618 diff --git a/tests/Common/Mocks/MockServiceFactory.cs b/tests/Common/Mocks/MockServiceFactory.cs new file mode 100644 index 00000000000..38fdc5de8ae --- /dev/null +++ b/tests/Common/Mocks/MockServiceFactory.cs @@ -0,0 +1,59 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using System; + +namespace Google.Api.Ads.Common.Tests.Mocks { + /// + /// Implements a mock version of the ServiceFactory interface for testing + /// purposes. + /// + public class MockServiceFactory : ServiceFactory { + /// + /// Create a service object. + /// + /// Signature of the service being created. + /// The user for which the service is being created. + /// The server to which the API calls should be + /// made. + /// + /// + /// An object of the desired service type. + /// + public override AdsClient CreateService(ServiceSignature signature, AdsUser user, + Uri serverUrl) { + return null; + } + + /// + /// Reads the headers from App.config. + /// + /// The configuration class. + protected override void ReadHeadersFromConfig(AppConfig config) { + return; + } + + /// + /// Checks preconditions of the service signature and throws and exception if the service + /// cannot be generated. + /// + /// the service signature for generating the service + protected override void CheckServicePreconditions(ServiceSignature signature) { + return; + } + } +} diff --git a/tests/Common/Mocks/MockServiceSignature.cs b/tests/Common/Mocks/MockServiceSignature.cs new file mode 100644 index 00000000000..1fb82e28568 --- /dev/null +++ b/tests/Common/Mocks/MockServiceSignature.cs @@ -0,0 +1,47 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; + +namespace Google.Api.Ads.Common.Tests.Mocks { + /// + /// Implements a mock version of the ServiceSignature class for testing + /// purposes. + /// + public class MockServiceSignature : ServiceSignature { + /// + /// Initializes a new instance of the + /// class. + /// + /// The version. + /// Name of the service. + /// The protocols. + public MockServiceSignature(string version, string serviceName, SupportedProtocols protocols) + : base(version, serviceName, protocols) { + } + + /// + /// Gets the type of service. + /// + public override Type ServiceType { + get { + return null; + } + } + } +} diff --git a/tests/Common/Mocks/MockTraceListener.cs b/tests/Common/Mocks/MockTraceListener.cs new file mode 100644 index 00000000000..1fb86d96ae2 --- /dev/null +++ b/tests/Common/Mocks/MockTraceListener.cs @@ -0,0 +1,62 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using System; + +namespace Google.Api.Ads.Common.Tests.Mocks { + /// + /// Implements a mock version of the TraceListener class for testing purposes. + /// + class MockTraceListener : TraceListener { + /// + /// Initializes a new instance of the class. + /// + /// The config class. + public MockTraceListener(AppConfig config) : base(config) { + } + + /// + /// Gets a list of fields to be masked in xml logs. + /// + /// + /// The list of fields to be masked. + /// + protected override string[] GetFieldsToMask() { + return new string[] {"authToken", "developerToken"}; + } + + /// + /// Gets the time stamp for test. + /// + /// The current timestamp, in string format. + public string GetTimeStampForTest() { + return base.GetTimeStamp(); + } + + /// + /// Gets the current timestamp as a formatted string. + /// + /// + /// The current timestamp. + /// + /// The mock version returns a predefined text, so that the soap + /// logs may be compared with a known log for correctness. + protected override string GetTimeStamp() { + return "TEST_TIMESTAMP"; + } + } +} diff --git a/tests/Common/OAuth2RequestInterceptor.cs b/tests/Common/OAuth2RequestInterceptor.cs new file mode 100644 index 00000000000..c2ef063c1e7 --- /dev/null +++ b/tests/Common/OAuth2RequestInterceptor.cs @@ -0,0 +1,161 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Common.Tests; + +using System; +using System.Collections.Generic; +using System.Net; +using System.Text; + +namespace Google.Api.Ads.Common.Tests { + /// + /// Intercepts calls to OAuth2 API for testing purposes. + /// + public class OAuth2RequestInterceptor : WebRequestInterceptor { + /// + /// Type of OAuth2 requests that can be mocked by this interceptor. + /// + public enum OAuth2RequestType { + FetchAccessAndRefreshToken, + FetchAccessTokenForServiceAccount, + RefreshAccessToken, + RevokeRefreshToken + } + + /// + /// Type of OAuth2 request being mocked by this interceptor. + /// + private OAuth2RequestType requestType; + + /// + /// Url prefix for OAuth2 requests. + /// + public const string OAUTH2_URL_PREFIX = "https://accounts.google.com/o/oauth2"; + + /// + /// Access token returned by interceptor. + /// + public const string TEST_ACCESS_TOKEN = "TEST_ACCESS_TOKEN"; + + /// + /// Refresh token returned by interceptor. + /// + public const string TEST_REFRESH_TOKEN = "TEST_REFRESH_TOKEN"; + + /// + /// Access token type returned by interceptor. + /// + public const string ACCESS_TOKEN_TYPE = "Bearer"; + + /// + /// Access token expiration returned by interceptor. + /// + public const string EXPIRES_IN = "3600"; + + /// + /// Mock response when requesting access token for serviced accounts. + /// + private const string SERVICED_ACCOUNT_RESPONSE = "{\r\n\"access_token\" : \"" + + TEST_ACCESS_TOKEN + "\",\r\n\"token_type\" : \"" + ACCESS_TOKEN_TYPE + + "\",\r\n \"expires_in\" : " + EXPIRES_IN + "\r\n}"; + + /// + /// Mock response when reqquesting access token in offline mode for + /// installed clients. + /// + private const string ACCESS_REFRESH_TOKEN_RESPONSE = "{\r\n\"access_token\" " + + ": \"" + TEST_ACCESS_TOKEN + "\",\r\n" + + "\"token_type\" : \"" + ACCESS_TOKEN_TYPE + "\",\r\n\"expires_in\" : " + + EXPIRES_IN + ",\"refresh_token\"" + " : \"" + TEST_REFRESH_TOKEN + "\"\r\n}"; + + /// + /// Mock response when refreshing access token for installed clients. + /// + private const string REFRESH_TOKEN_RESPONSE = "{\r\n\"access_token\" : \"" + + TEST_ACCESS_TOKEN + "\",\r\n\"token_type\" : \"" + ACCESS_TOKEN_TYPE + + "\", \"expires_in\" : " + EXPIRES_IN + "}"; + + /// + /// Content type for OAuth2 API calls. + /// + private const string OAUTH2_RESPONSE_TYPE = "application/json"; + + /// + /// Singleton instance. + /// + private static WebRequestInterceptor instance; + + + /// + /// Gets the only instance. + /// + public static WebRequestInterceptor Instance { + get { + return instance; + } + } + + /// + /// Gets or sets the type of the request being handled by this interceptor. + /// + public OAuth2RequestType RequestType { + get { + return requestType; + } + set { + requestType = value; + } + } + + /// + /// Initializes the class. + /// + static OAuth2RequestInterceptor() { + instance = new OAuth2RequestInterceptor(); + WebRequest.RegisterPrefix(OAUTH2_URL_PREFIX, instance); + } + + /// + /// Gets the next message to be mocked. + /// + /// + /// An HttpMessage object that represents the next message. + /// + public override HttpMessage GetNextMessage() { + string message = null; + switch (RequestType) { + case OAuth2RequestType.FetchAccessTokenForServiceAccount: + message = SERVICED_ACCOUNT_RESPONSE; + break; + + case OAuth2RequestType.FetchAccessAndRefreshToken: + message = ACCESS_REFRESH_TOKEN_RESPONSE; + break; + + case OAuth2RequestType.RefreshAccessToken: + message = REFRESH_TOKEN_RESPONSE; + break; + + case OAuth2RequestType.RevokeRefreshToken: + message = ""; + break; + } + return new HttpMessage(null, message, OAUTH2_RESPONSE_TYPE); + } + } +} diff --git a/tests/Common/Resources.Designer.cs b/tests/Common/Resources.Designer.cs new file mode 100644 index 00000000000..fc643233673 --- /dev/null +++ b/tests/Common/Resources.Designer.cs @@ -0,0 +1,132 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.296 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Google.Api.Ads.Common.Tests { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Google.Api.Ads.Common.Tests.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static byte[] certificate { + get { + object obj = ResourceManager.GetObject("certificate", resourceCulture); + return ((byte[])(obj)); + } + } + + /// + /// Looks up a localized string similar to host=localhost,url=/,,. + /// + internal static string ResponseLog { + get { + return ResourceManager.GetString("ResponseLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to -----------------BEGIN API CALL--------------------- + /// + ///Request + ///------- + /// + /// + ///<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><!--POST / + ///TestRequestKey: TestRequestValue + ///TimeStamp: TEST_TIMESTAMP + ///--><soap:Header><RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201109"><authToken xmlns="https://adwords.google.com/api/adwords/cm/v2011 [rest of string was truncated]";. + /// + internal static string SoapLog { + get { + return ResourceManager.GetString("SoapLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> + ///<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + /// <soap:Header> + /// <RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201109"> + /// <authToken xmlns="https://adwords.google.com/api/adwords/cm/v201109">TEST_AUTHTOKEN</authToken> + /// <developerToken xmlns="https://adwords.google.com/api/adwords/cm/v201109">TEST_DEVELOPER_TOKEN</ [rest of string was truncated]";. + /// + internal static string XmlRequest { + get { + return ResourceManager.GetString("XmlRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> + /// <soap:Header> + /// <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201109"> + /// <requestId>0004bf2e364aeb380ae752d50000576f</requestId> + /// <serviceName>CampaignService</serviceName> + /// <methodName>get</methodName> + /// <operations>8</operations> + /// <responseTime>1665</responseTime> + /// <units>8</units> + /// </ResponseHeader> + /// </soap:Header> + /// <soap:Body> + /// <getResponse xmlns="https://adwords [rest of string was truncated]";. + /// + internal static string XmlResponse { + get { + return ResourceManager.GetString("XmlResponse", resourceCulture); + } + } + } +} diff --git a/tests/Common/Resources.resx b/tests/Common/Resources.resx new file mode 100644 index 00000000000..fadac28f776 --- /dev/null +++ b/tests/Common/Resources.resx @@ -0,0 +1,345 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Resources\certificate.p12;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + host=localhost,url=/,, + + + +-----------------BEGIN API CALL--------------------- + +Request +------- + + +<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><!--POST / +TestRequestKey: TestRequestValue +TimeStamp: TEST_TIMESTAMP +--><soap:Header><RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201109"><authToken xmlns="https://adwords.google.com/api/adwords/cm/v201109">******</authToken><developerToken xmlns="https://adwords.google.com/api/adwords/cm/v201109">******</developerToken><clientCustomerId xmlns="https://adwords.google.com/api/adwords/cm/v201109">TEST_CUSTOMERID</clientCustomerId><userAgent xmlns="https://adwords.google.com/api/adwords/cm/v201109">TEST_USERAGENT</userAgent></RequestHeader></soap:Header><soap:Body><get xmlns="https://adwords.google.com/api/adwords/cm/v201109"><serviceSelector><fields>Id</fields><fields>Name</fields><fields>Status</fields><paging><startIndex>0</startIndex><numberResults>500</numberResults></paging></serviceSelector></get></soap:Body></soap:Envelope> + +Response +-------- + + +<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><!--TestResponseKey: TestResponseValue +TimeStamp: TEST_TIMESTAMP +--><soap:Header><ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201109"><requestId>0004bf2e364aeb380ae752d50000576f</requestId><serviceName>CampaignService</serviceName><methodName>get</methodName><operations>8</operations><responseTime>1665</responseTime><units>8</units></ResponseHeader></soap:Header><soap:Body><getResponse xmlns="https://adwords.google.com/api/adwords/cm/v201109"><rval><totalNumEntries>8</totalNumEntries><Page.Type>CampaignPage</Page.Type><totalBudget><period>DAILY</period><amount><ComparableValue.Type>Money</ComparableValue.Type><microAmount>0</microAmount></amount></totalBudget><entries><id>61561890</id><name>Test Adx Campaign</name><status>ACTIVE</status><conversionOptimizerEligibility><eligible>false</eligible><rejectionReasons>NOT_CPC_CAMPAIGN</rejectionReasons><rejectionReasons>CONVERSION_TRACKING_NOT_ENABLED</rejectionReasons></conversionOptimizerEligibility><campaignStats><network>ALL</network><Stats.Type>CampaignStats</Stats.Type></campaignStats><frequencyCap><impressions>0</impressions></frequencyCap></entries><entries><id>62798730</id><name>Interplanetary Cruise #1284660861</name><status>PAUSED</status><conversionOptimizerEligibility><eligible>false</eligible><rejectionReasons>NOT_CPC_CAMPAIGN</rejectionReasons><rejectionReasons>CAMPAIGN_IS_NOT_ACTIVE</rejectionReasons><rejectionReasons>CONVERSION_TRACKING_NOT_ENABLED</rejectionReasons></conversionOptimizerEligibility><campaignStats><network>ALL</network><Stats.Type>CampaignStats</Stats.Type></campaignStats><frequencyCap><impressions>0</impressions></frequencyCap></entries><entries><id>82779810</id><name>Interplanetary Cruise #1302802125300</name><status>PAUSED</status><conversionOptimizerEligibility><eligible>false</eligible><rejectionReasons>NOT_CPC_CAMPAIGN</rejectionReasons><rejectionReasons>CAMPAIGN_IS_NOT_ACTIVE</rejectionReasons><rejectionReasons>CONVERSION_TRACKING_NOT_ENABLED</rejectionReasons></conversionOptimizerEligibility><campaignStats><network>ALL</network><Stats.Type>CampaignStats</Stats.Type></campaignStats><frequencyCap><impressions>0</impressions></frequencyCap></entries><entries><id>84762330</id><name>Interplanetary Cruise #1304540562541</name><status>PAUSED</status><conversionOptimizerEligibility><eligible>false</eligible><rejectionReasons>NOT_CPC_CAMPAIGN</rejectionReasons><rejectionReasons>CAMPAIGN_IS_NOT_ACTIVE</rejectionReasons><rejectionReasons>CONVERSION_TRACKING_NOT_ENABLED</rejectionReasons></conversionOptimizerEligibility><campaignStats><network>ALL</network><Stats.Type>CampaignStats</Stats.Type></campaignStats><frequencyCap><impressions>0</impressions></frequencyCap></entries><entries><id>84765690</id><name>Interplanetary Cruise #367921212517452011</name><status>PAUSED</status><conversionOptimizerEligibility><eligible>false</eligible><rejectionReasons>NOT_CPC_CAMPAIGN</rejectionReasons><rejectionReasons>CAMPAIGN_IS_NOT_ACTIVE</rejectionReasons><rejectionReasons>CONVERSION_TRACKING_NOT_ENABLED</rejectionReasons></conversionOptimizerEligibility><campaignStats><network>ALL</network><Stats.Type>CampaignStats</Stats.Type></campaignStats><frequencyCap><impressions>0</impressions></frequencyCap></entries><entries><id>84765810</id><name>Interplanetary Cruise #396773322517452011</name><status>PAUSED</status><conversionOptimizerEligibility><eligible>false</eligible><rejectionReasons>NOT_CPC_CAMPAIGN</rejectionReasons><rejectionReasons>CAMPAIGN_IS_NOT_ACTIVE</rejectionReasons><rejectionReasons>CONVERSION_TRACKING_NOT_ENABLED</rejectionReasons></conversionOptimizerEligibility><campaignStats><network>ALL</network><Stats.Type>CampaignStats</Stats.Type></campaignStats><frequencyCap><impressions>0</impressions></frequencyCap></entries><entries><id>109690890</id><name>RTB Test Campaign</name><status>ACTIVE</status><conversionOptimizerEligibility><eligible>false</eligible><rejectionReasons>NOT_CPC_CAMPAIGN</rejectionReasons><rejectionReasons>CONVERSION_TRACKING_NOT_ENABLED</rejectionReasons></conversionOptimizerEligibility><campaignStats><network>ALL</network><Stats.Type>CampaignStats</Stats.Type></campaignStats><frequencyCap><impressions>0</impressions></frequencyCap></entries><entries><id>114182850</id><name>Campaign #1</name><status>ACTIVE</status><conversionOptimizerEligibility><eligible>false</eligible><rejectionReasons>NOT_CPC_CAMPAIGN</rejectionReasons><rejectionReasons>CONVERSION_TRACKING_NOT_ENABLED</rejectionReasons></conversionOptimizerEligibility><campaignStats><network>ALL</network><Stats.Type>CampaignStats</Stats.Type></campaignStats><frequencyCap><impressions>0</impressions></frequencyCap></entries></rval></getResponse></soap:Body></soap:Envelope> +-----------------END API CALL----------------------- + + + + <?xml version="1.0" encoding="utf-8"?> +<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <soap:Header> + <RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201109"> + <authToken xmlns="https://adwords.google.com/api/adwords/cm/v201109">TEST_AUTHTOKEN</authToken> + <developerToken xmlns="https://adwords.google.com/api/adwords/cm/v201109">TEST_DEVELOPER_TOKEN</developerToken> + <clientCustomerId xmlns="https://adwords.google.com/api/adwords/cm/v201109">TEST_CUSTOMERID</clientCustomerId> + <userAgent xmlns="https://adwords.google.com/api/adwords/cm/v201109">TEST_USERAGENT</userAgent> + </RequestHeader> + </soap:Header> + <soap:Body> + <get xmlns="https://adwords.google.com/api/adwords/cm/v201109"> + <serviceSelector> + <fields>Id</fields> + <fields>Name</fields> + <fields>Status</fields> + <paging> + <startIndex>0</startIndex> + <numberResults>500</numberResults> + </paging> + </serviceSelector> + </get> + </soap:Body> +</soap:Envelope> + + + <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> + <soap:Header> + <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201109"> + <requestId>0004bf2e364aeb380ae752d50000576f</requestId> + <serviceName>CampaignService</serviceName> + <methodName>get</methodName> + <operations>8</operations> + <responseTime>1665</responseTime> + <units>8</units> + </ResponseHeader> + </soap:Header> + <soap:Body> + <getResponse xmlns="https://adwords.google.com/api/adwords/cm/v201109"> + <rval> + <totalNumEntries>8</totalNumEntries> + <Page.Type>CampaignPage</Page.Type> + <totalBudget> + <period>DAILY</period> + <amount> + <ComparableValue.Type>Money</ComparableValue.Type> + <microAmount>0</microAmount> + </amount> + </totalBudget> + <entries> + <id>61561890</id> + <name>Test Adx Campaign</name> + <status>ACTIVE</status> + <conversionOptimizerEligibility> + <eligible>false</eligible> + <rejectionReasons>NOT_CPC_CAMPAIGN</rejectionReasons> + <rejectionReasons>CONVERSION_TRACKING_NOT_ENABLED</rejectionReasons> + </conversionOptimizerEligibility> + <campaignStats> + <network>ALL</network> + <Stats.Type>CampaignStats</Stats.Type> + </campaignStats> + <frequencyCap> + <impressions>0</impressions> + </frequencyCap> + </entries> + <entries> + <id>62798730</id> + <name>Interplanetary Cruise #1284660861</name> + <status>PAUSED</status> + <conversionOptimizerEligibility> + <eligible>false</eligible> + <rejectionReasons>NOT_CPC_CAMPAIGN</rejectionReasons> + <rejectionReasons>CAMPAIGN_IS_NOT_ACTIVE</rejectionReasons> + <rejectionReasons>CONVERSION_TRACKING_NOT_ENABLED</rejectionReasons> + </conversionOptimizerEligibility> + <campaignStats> + <network>ALL</network> + <Stats.Type>CampaignStats</Stats.Type> + </campaignStats> + <frequencyCap> + <impressions>0</impressions> + </frequencyCap> + </entries> + <entries> + <id>82779810</id> + <name>Interplanetary Cruise #1302802125300</name> + <status>PAUSED</status> + <conversionOptimizerEligibility> + <eligible>false</eligible> + <rejectionReasons>NOT_CPC_CAMPAIGN</rejectionReasons> + <rejectionReasons>CAMPAIGN_IS_NOT_ACTIVE</rejectionReasons> + <rejectionReasons>CONVERSION_TRACKING_NOT_ENABLED</rejectionReasons> + </conversionOptimizerEligibility> + <campaignStats> + <network>ALL</network> + <Stats.Type>CampaignStats</Stats.Type> + </campaignStats> + <frequencyCap> + <impressions>0</impressions> + </frequencyCap> + </entries> + <entries> + <id>84762330</id> + <name>Interplanetary Cruise #1304540562541</name> + <status>PAUSED</status> + <conversionOptimizerEligibility> + <eligible>false</eligible> + <rejectionReasons>NOT_CPC_CAMPAIGN</rejectionReasons> + <rejectionReasons>CAMPAIGN_IS_NOT_ACTIVE</rejectionReasons> + <rejectionReasons>CONVERSION_TRACKING_NOT_ENABLED</rejectionReasons> + </conversionOptimizerEligibility> + <campaignStats> + <network>ALL</network> + <Stats.Type>CampaignStats</Stats.Type> + </campaignStats> + <frequencyCap> + <impressions>0</impressions> + </frequencyCap> + </entries> + <entries> + <id>84765690</id> + <name>Interplanetary Cruise #367921212517452011</name> + <status>PAUSED</status> + <conversionOptimizerEligibility> + <eligible>false</eligible> + <rejectionReasons>NOT_CPC_CAMPAIGN</rejectionReasons> + <rejectionReasons>CAMPAIGN_IS_NOT_ACTIVE</rejectionReasons> + <rejectionReasons>CONVERSION_TRACKING_NOT_ENABLED</rejectionReasons> + </conversionOptimizerEligibility> + <campaignStats> + <network>ALL</network> + <Stats.Type>CampaignStats</Stats.Type> + </campaignStats> + <frequencyCap> + <impressions>0</impressions> + </frequencyCap> + </entries> + <entries> + <id>84765810</id> + <name>Interplanetary Cruise #396773322517452011</name> + <status>PAUSED</status> + <conversionOptimizerEligibility> + <eligible>false</eligible> + <rejectionReasons>NOT_CPC_CAMPAIGN</rejectionReasons> + <rejectionReasons>CAMPAIGN_IS_NOT_ACTIVE</rejectionReasons> + <rejectionReasons>CONVERSION_TRACKING_NOT_ENABLED</rejectionReasons> + </conversionOptimizerEligibility> + <campaignStats> + <network>ALL</network> + <Stats.Type>CampaignStats</Stats.Type> + </campaignStats> + <frequencyCap> + <impressions>0</impressions> + </frequencyCap> + </entries> + <entries> + <id>109690890</id> + <name>RTB Test Campaign</name> + <status>ACTIVE</status> + <conversionOptimizerEligibility> + <eligible>false</eligible> + <rejectionReasons>NOT_CPC_CAMPAIGN</rejectionReasons> + <rejectionReasons>CONVERSION_TRACKING_NOT_ENABLED</rejectionReasons> + </conversionOptimizerEligibility> + <campaignStats> + <network>ALL</network> + <Stats.Type>CampaignStats</Stats.Type> + </campaignStats> + <frequencyCap> + <impressions>0</impressions> + </frequencyCap> + </entries> + <entries> + <id>114182850</id> + <name>Campaign #1</name> + <status>ACTIVE</status> + <conversionOptimizerEligibility> + <eligible>false</eligible> + <rejectionReasons>NOT_CPC_CAMPAIGN</rejectionReasons> + <rejectionReasons>CONVERSION_TRACKING_NOT_ENABLED</rejectionReasons> + </conversionOptimizerEligibility> + <campaignStats> + <network>ALL</network> + <Stats.Type>CampaignStats</Stats.Type> + </campaignStats> + <frequencyCap> + <impressions>0</impressions> + </frequencyCap> + </entries> + </rval> + </getResponse> + </soap:Body> +</soap:Envelope> + + \ No newline at end of file diff --git a/tests/Common/Resources/certificate.p12 b/tests/Common/Resources/certificate.p12 new file mode 100644 index 0000000000000000000000000000000000000000..00a13df518bddb5141797d058016946f9e4e1410 GIT binary patch literal 1668 zcmY+DX*Amj7smftL`2aNRBTb{B$$v)65T9C&}xk(N=^Hs8gHU08nLv&R8xCROEH$F zi>j@Nq7|ct!AK-UE!A4uT1vepRYfDWB9p%Ai|3m<5yv!z!>Tfd|3;OM>V@c@S*{-liBenCf3wTM!`dEgra@zyk{i zI2hvpSn(VMMc&l7{4mXo{+wf{WveSm>ksH84uQc?0LlX=cE>E>n;wa`w|tv^_(*O> z{Z8>HhRUwXMja09oXv}UIon_EIdoL?h0)P{4P6NfRwK(EdgwWBB>SDOu4Ne}4G0?8 z&XzULXPD%Mu|8*k+G#(sK@JRAQ; z6x(u7>yH7?^`77jH72Xri=P9;myrWs9e+?Q+~%{nY1FY4u7c27m?_n_5ujFV&YYtE z{&cbsu)EL5 zS=~Dx%nI7G!5ID`WSHz5ZnQ4JJw_!$_u$k$yK7YWA1(bHX6(HUZ&NT~ zO0-kFdcR22*}|MYIsOJHw5t7;Q`+vr7OzG3(`YMu?s4pM{)4&){PtHmwt4*2~TCmZY?c^ z+DZ{GTi8;0fd7Q!yVMJA(^$it45p`Q-MbIQxI6b;r<#FL_5buT3=htJ@65XspSnmq zKrsC~;VMX?ju8?#14II$Kn!pKhyp?YmSWBkO#U%x6Om9&pU|)nG?7I4ZWm>jHOZPx zqA0Sz^0!GDrl`Y=0!@NJfMSjQqk#TZ5ZKp(VB{Z2+!?aG=Sxwi-9} zHe5`@d;g+OsmUaYxH^+hc!8)O(-6t7+|Pw-sb7LMimrEVYhG;`-;|mtbRw6&ax9xl zN$HmeOF~XwI5JMHf_#9Hlels4X#JmC&ARIVcJcHc21Mmsve+^RY5H{#>O$jGJUlgqYX<^5}jNpvhTyN1X~0#0VnXZiz#sb0q}hRIqcwihw_l}U8{@SP?R?%IZb=OpbjTXS zZ*976a5@McnW+U12!$)*Ofy`AZ1d4pVcss~Zm(g4MsY-{>LkU6Jrh20zM* zt|TRbbe3InI*=)OV^1^B-3Bivcp>P&Y!{|~CgjUK#HL95Rvmunx!Yq75D{u{uTpKj zOQzmh{%Lrr&YYJHrF!6SIht0`ZLn(7aDR5O;PZqSM~{nx$H(LujOaq1fdPK>!?kiq zdsC|U+a>?=Ht^;xqQmnOwHNd1y-A;3)!r9v$Xuuaae@DBV5}RSmM9Z!2_^&;n39D$ z1dLJwpvb$@3MuVOsLP7g)z%%gtUi@$>P0BhaV$zm7Z@`i%q)-7e={5j-ZYK;8u32? D2-N83 literal 0 HcmV?d00001 diff --git a/tests/Common/TestUtils.cs b/tests/Common/TestUtils.cs new file mode 100644 index 00000000000..e47dceaf08b --- /dev/null +++ b/tests/Common/TestUtils.cs @@ -0,0 +1,48 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; + +namespace Google.Api.Ads.Common.Tests { + /// + /// Support utility methods for running test cases. + /// + public class TestUtils { + /// + /// Validates whether an ArgumentNullException is called whenever a required + /// property in targetObject is null, and testDelegate is invoked. + /// + /// The target object. + /// The property names to be checked for null + /// values. + /// The test delegate. + public static void ValidateRequiredParameters(object targetObject, string[] propertyNames, + TestDelegate testDelegate) { + foreach (string propertyName in propertyNames) { + PropertyInfo propInfo = targetObject.GetType().GetProperty(propertyName); + object oldValue = propInfo.GetValue(targetObject, null); + propInfo.SetValue(targetObject, null, null); + Assert.Throws(testDelegate); + propInfo.SetValue(targetObject, oldValue, null); + } + } + } +} diff --git a/tests/Common/Util/CsvFileTests.cs b/tests/Common/Util/CsvFileTests.cs new file mode 100644 index 00000000000..ae0f466c710 --- /dev/null +++ b/tests/Common/Util/CsvFileTests.cs @@ -0,0 +1,72 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; + +namespace Google.Api.Ads.Common.Tests.Util { + /// + /// UnitTests for class. + /// + [TestFixture] + public class CsvFileTests { + /// + /// Test for CsvFile.Write() and CsvFile.Read() + /// + [Test] + public void TestCsvReadWrite() { + string fileName = Path.GetTempFileName(); + + CsvFile csvDoc = new CsvFile(); + csvDoc.Headers.AddRange(new string[] {"item1", "item2"}); + csvDoc.Records.Add(new string[] {"a", "1"}); + csvDoc.Records.Add(new string[] {"b,c", "2"}); + csvDoc.Records.Add(new string[] {"\"d\", \"e\"", "3"}); + Assert.DoesNotThrow( + delegate() { + csvDoc.Write(fileName); + }, + "CsvFile.Write() should not throw an exception."); + + // Downloaded report should be a valid csv. + csvDoc = new CsvFile(); + Assert.DoesNotThrow( + delegate() { + csvDoc.Read(fileName, true); + }, + "CsvFile should not throw an exception."); + + Assert.AreEqual(csvDoc.Headers.Count, 2); + Assert.AreEqual(csvDoc.Headers[0], "item1"); + Assert.AreEqual(csvDoc.Headers[1], "item2"); + + Assert.AreEqual(csvDoc.Records.Count, 3); + + Assert.AreEqual(csvDoc.Records[0][0], "a"); + Assert.AreEqual(csvDoc.Records[0][1], "1"); + Assert.AreEqual(csvDoc.Records[1][0], "b,c"); + Assert.AreEqual(csvDoc.Records[1][1], "2"); + Assert.AreEqual(csvDoc.Records[2][0], "\"d\", \"e\""); + Assert.AreEqual(csvDoc.Records[2][1], "3"); + } + } +} diff --git a/tests/Common/Util/DeprecationUtilitiesTest.cs b/tests/Common/Util/DeprecationUtilitiesTest.cs new file mode 100644 index 00000000000..993da7436a5 --- /dev/null +++ b/tests/Common/Util/DeprecationUtilitiesTest.cs @@ -0,0 +1,84 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using Google.Api.Ads.Common.Util; +using System.Diagnostics; +using System.IO; + +namespace Google.Api.Ads.Common.Tests.Util { + /// + /// Tests for DeprecationUtilities class. + /// + [TestFixture] + public class DeprecationUtilitiesTest { + private const string DEPRECATION_MESSAGE = "This is a deprecation message."; + +#pragma warning disable 414 + [Obsolete(DEPRECATION_MESSAGE)] + private string deprecatedField = ""; + + private string nonDeprecatedField = ""; +#pragma warning restore 414 + + private MemberInfo deprecatedMemberInfo; + private MemberInfo nonDeprecatedMemberInfo; + private MemoryStream memStream; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + memStream = new MemoryStream(); + TextWriterTraceListener textListener = new TextWriterTraceListener(memStream); + Trace.Listeners.Add(textListener); + deprecatedMemberInfo = this.GetType().GetField("deprecatedField", + BindingFlags.NonPublic | BindingFlags.Instance); + nonDeprecatedMemberInfo = this.GetType().GetField("nonDeprecatedField", + BindingFlags.NonPublic | BindingFlags.Instance); + } + + /// + /// Tests if deprecation methods are displayed for deprecated fields. + /// + [Test] + public void TestShowsDeprecationForDeprecatedField() { + DeprecationUtilities.ShowDeprecationMessage(deprecatedMemberInfo); + String traceContents = Encoding.UTF8.GetString(memStream.ToArray()); + if (!traceContents.Contains(DEPRECATION_MESSAGE)) { + Assert.Fail("Deprecation message is missing in trace logs."); + } + } + + /// + /// Tests if deprecation methods not displayed for non-deprecated fields. + /// + [Test] + public void TestDoesNotShowDeprecationForNonDeprecatedField() { + DeprecationUtilities.ShowDeprecationMessage(nonDeprecatedMemberInfo); + String traceContents = Encoding.UTF8.GetString(memStream.ToArray()); + if (traceContents.Contains(DEPRECATION_MESSAGE)) { + Assert.Fail("Deprecation message is present in trace logs."); + } + } + } +} diff --git a/tests/Common/Util/MediaUtilitiesTests.cs b/tests/Common/Util/MediaUtilitiesTests.cs new file mode 100644 index 00000000000..d0a6165c090 --- /dev/null +++ b/tests/Common/Util/MediaUtilitiesTests.cs @@ -0,0 +1,128 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Text; +using System.IO.Compression; + +namespace Google.Api.Ads.Common.Tests.Util { + /// + /// UnitTests for class. + /// + [TestFixture] + public class MediaUtilitiesTests { + const string FILE_CONTENTS = "Hello world"; + + Uri fileUri = null; + byte[] compressedData; + MemoryStream sourceStream; + MemoryStream targetStream; + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + String fileName = Path.GetTempFileName(); + using (StreamWriter writer = new StreamWriter(fileName)) { + writer.Write(FILE_CONTENTS); + } + fileUri = new Uri(fileName); + + MemoryStream dataStream = new MemoryStream(); + byte[] data = Encoding.UTF8.GetBytes(FILE_CONTENTS); + using (GZipStream gzipStream = new GZipStream(dataStream, CompressionMode.Compress)) { + gzipStream.Write(data, 0, data.Length); + } + compressedData = dataStream.ToArray(); + + sourceStream = new MemoryStream(); + targetStream = new MemoryStream(); + sourceStream.Write(data, 0, data.Length); + sourceStream.Seek(0, SeekOrigin.Begin); + } + + /// + /// Tears down this instance. + /// + [TearDown] + public void Teardown() { + sourceStream.Close(); + targetStream.Close(); + } + + + /// + /// Tests if data can be retrieved from a url. + /// + [Test] + [Category("Small")] + public void TestGetAssetDataFromUrl1() { + byte[] data = MediaUtilities.GetAssetDataFromUrl(fileUri); + Assert.AreEqual(FILE_CONTENTS, Encoding.UTF8.GetString(data)); + } + + /// + /// Tests if data can be retrieved from a url. + /// + [Test] + [Category("Small")] + public void TestGetAssetDataFromUrl2() { + byte[] data = MediaUtilities.GetAssetDataFromUrl(fileUri.AbsoluteUri); + Assert.AreEqual(FILE_CONTENTS, Encoding.UTF8.GetString(data)); + } + + /// + /// Tests if data can be deflated properly. + /// + [Test] + [Category("Small")] + public void TestDeflateGZipData() { + byte[] deflatedData = MediaUtilities.DeflateGZipData(compressedData); + Assert.AreEqual(FILE_CONTENTS, Encoding.UTF8.GetString(deflatedData)); + } + + /// + /// Tests if data can be copied from one stream to another correctly. + /// + [Test] + [Category("Small")] + public void TestCopyStream() { + MediaUtilities.CopyStream(sourceStream, targetStream); + Assert.AreEqual(FILE_CONTENTS, Encoding.UTF8.GetString(sourceStream.ToArray())); + } + + /// + /// Tests if data can be copied from one stream to another correctly with + /// preview. + /// + [Test] + [Category("Small")] + public void CopyStreamWithPreview() { + byte[] preview = MediaUtilities.CopyStreamWithPreview(sourceStream, targetStream, 5); + Assert.AreEqual(FILE_CONTENTS.Substring(0, 5), Encoding.UTF8.GetString(preview)); + Assert.AreEqual(FILE_CONTENTS, Encoding.UTF8.GetString(sourceStream.ToArray())); + } + + } +} diff --git a/tests/Common/WebRequestInterceptor.cs b/tests/Common/WebRequestInterceptor.cs new file mode 100644 index 00000000000..88691c87fa4 --- /dev/null +++ b/tests/Common/WebRequestInterceptor.cs @@ -0,0 +1,140 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Reflection; +using System.Text; + +namespace Google.Api.Ads.Common.Tests { + /// + /// Intercepts a web request for testing purposes. + /// + public abstract class WebRequestInterceptor : IWebRequestCreate { + /// + /// Callback delegate for listening to outgoing requests. + /// + /// The URI to which calls are being made. + /// The HTTP request headers. + /// The HTTP request body. + public delegate void OnBeforeSendResponse(Uri uri, WebHeaderCollection headers, String body); + + /// + /// Callback for listening to outgoing request. + /// + private OnBeforeSendResponse beforeSendResponse = OnBeforeSendResponseCallback; + + /// + /// True, to intercept a request, false to bypass the request. + /// + bool intercept; + + /// + /// If set to true, then the interceptor will return an error code rather + /// than a successful response. + /// + private bool raiseException; + + /// + /// Gets or sets a value indicating whether this handler should intercept + /// a request or not. + /// + public bool Intercept { + get { + return intercept; + } + set { + intercept = value; + } + } + + /// + /// Gets or sets a value indicating whether to return an error code rather + /// than a successful response. + /// + public bool RaiseException { + get { + return raiseException; + } + set { + raiseException = value; + } + } + + /// + /// Gets or sets the beforeSendResponse callback. + /// + public OnBeforeSendResponse BeforeSendResponse { + get { + return beforeSendResponse; + } + set { + beforeSendResponse = value; + } + } + + /// + /// Default handler for OnBeforeSendResponse. + /// + /// The URI to which calls are being made. + /// The HTTP request headers. + /// The HTTP request body. + static void OnBeforeSendResponseCallback(Uri uri, WebHeaderCollection headers, string body) { + } + + /// + /// Gets the next message to be mocked. + /// + /// An HttpMessage object that represents the next message. + public abstract HttpMessage GetNextMessage(); + + /// + /// Gets the default HTTP handler. + /// + /// The uri to handler. + /// The web request handler. + /// This is a slightly hacky method to get the default handler. + /// We are using reflection to call the internal constructor of + /// HttpWebRequest, since WebRequest.RegisterPrefix neither allows us to + /// unregister the handler for a prefix, nor gives us back the old prefix. + /// + protected static WebRequest GetDefaultHttpHandler(Uri uri) { + ConstructorInfo ci = typeof(HttpWebRequest).GetConstructor(BindingFlags.NonPublic | + BindingFlags.Instance, null, new Type[] {typeof(Uri), typeof(ServicePoint)}, null); + return (HttpWebRequest) ci.Invoke(new object[] {uri, null}); + } + + /// + /// Creates a instance. + /// + /// The uniform resource identifier (URI) of the Web + /// resource. + /// + /// A instance. + /// + public WebRequest Create(Uri uri) { + if (Intercept) { + HttpMessage message = GetNextMessage(); + MockWebResponse response = new MockWebResponse(message.Response, message.ResponseType); + return new MockWebRequest(response, uri, beforeSendResponse, RaiseException); + } else { + return GetDefaultHttpHandler(uri); + } + } + } +} diff --git a/tests/Dfa/App.config b/tests/Dfa/App.config new file mode 100644 index 00000000000..3a6bc204c19 --- /dev/null +++ b/tests/Dfa/App.config @@ -0,0 +1,189 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/Dfa/BaseTests.cs b/tests/Dfa/BaseTests.cs new file mode 100644 index 00000000000..e26f0a4389e --- /dev/null +++ b/tests/Dfa/BaseTests.cs @@ -0,0 +1,48 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfa.Lib; + +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; + +namespace Google.Api.Ads.Dfa.Tests { + /// + /// Base class for all test suites. + /// + public class BaseTests { + /// + /// The Dfa user to be used for tests. + /// + protected DfaUser user = new DfaUser(); + + /// + /// Default public constructor. + /// + /// The constructor adds a 2000 ms delay between running individual + /// tests so that we don't hit the ClientLogin server frequently and cause + /// it throw captcha errors. You shouldn't do this in your code, instead + /// you should generate an authtoken, set it in your App.config and reuse + /// it to avoid performance issues. + /// + public BaseTests() { + // Make sure we don't hit the authtoken endpoint really bad. + Thread.Sleep(2000); + } + } +} diff --git a/tests/Dfa/Dfa.Tests.csproj b/tests/Dfa/Dfa.Tests.csproj new file mode 100644 index 00000000000..ecc5b212f86 --- /dev/null +++ b/tests/Dfa/Dfa.Tests.csproj @@ -0,0 +1,74 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51} + Library + Properties + Google.Api.Ads.Dfa.Tests + Dfa.Tests + v4.0 + + + true + full + false + bin\Debug\ + TRACE;DEBUG + prompt + 4 + AnyCPU + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\lib\nunit\nunit.framework.dll + + + + + + + + + + {277404DB-A439-4450-B3A5-186294CDF245} + Common + + + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB} + Dfa + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/Dfa/Lib/DefaultLoginTokenCacheTests.cs b/tests/Dfa/Lib/DefaultLoginTokenCacheTests.cs new file mode 100644 index 00000000000..be3197eb6b6 --- /dev/null +++ b/tests/Dfa/Lib/DefaultLoginTokenCacheTests.cs @@ -0,0 +1,112 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using NUnit.Framework; + +using System; +using Google.Api.Ads.Dfa.Lib; + +// Disable deprecation warnings for DefaultAuthTokenCache class. +#pragma warning disable 612, 618 + +namespace Google.Api.Ads.Dfa.Tests.Lib { + /// + /// Tests for DefaultAuthTokenCache class. + /// + class DefaultLoginTokenCacheTests { + /// + /// Dfa user for testing purposes. + /// + private const string USERNAME = "testuser"; + + /// + /// Dfa password for testing purposes. + /// + private const string PASSWORD = "testpassword"; + + /// + /// LoginToken for test purposes. + /// + private readonly UserToken USERTOKEN = new UserToken(USERNAME, PASSWORD); + + /// + /// Cache instance for testing purposes. + /// + private DefaultLoginTokenCache cache = new DefaultLoginTokenCache(); + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + cache.Clear(); + } + + /// + /// Tests if we can add a token. + /// + [Test] + [Category("Small")] + public void TestAddToken() { + UserToken token = cache.AddToken(USERNAME, USERTOKEN); + Assert.AreEqual(USERTOKEN, token); + } + + /// + /// Tests if arguments are validated when token is added to cache. + /// + [Test] + [Category("Small")] + public void TestAddTokenValidatesParams() { + Assert.Throws(typeof(ArgumentException), delegate() { + cache.AddToken(null, USERTOKEN); + }); + } + + /// + /// Tests if we can retrieve a token after adding it. + /// + [Test] + [Category("Small")] + public void TestGetToken() { + cache.AddToken(USERNAME, USERTOKEN); + Assert.AreEqual(USERTOKEN, cache.GetToken(USERNAME)); + } + + /// + /// Tests if we can clear the cache. + /// + [Test] + [Category("Small")] + public void TestClear() { + Assert.Null(cache.GetToken(USERNAME)); + } + + /// + /// Tests if we can invalidate a token. + /// + [Test] + [Category("Small")] + public void TestInvalidateToken() { + cache.AddToken(USERNAME, USERTOKEN); + Assert.AreEqual(USERTOKEN, cache.GetToken(USERNAME)); + cache.InvalidateToken(USERTOKEN); + Assert.Null(cache.GetToken(USERNAME)); + } + } +} + +#pragma warning restore 612, 618 diff --git a/tests/Dfa/Lib/DfaErrorHandlerTests.cs b/tests/Dfa/Lib/DfaErrorHandlerTests.cs new file mode 100644 index 00000000000..7b5922465b9 --- /dev/null +++ b/tests/Dfa/Lib/DfaErrorHandlerTests.cs @@ -0,0 +1,132 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using NUnit.Framework; + +using System; +using Google.Api.Ads.Dfa.Lib; +using Google.Api.Ads.Dfa.v1_20; +using Google.Api.Ads.Dfa.Util; + +namespace Google.Api.Ads.Dfa.Tests.Lib { + /// + /// Tests for DfaErrorHandler class. + /// + class DfaErrorHandlerTests { + private static readonly ErrorCode TOKEN_EXPIRED_CODE = ErrorCode.FromCode(4); + private const string TOKEN_EXPIRED_MESSAGE = "Authentication token has expired."; + + private static readonly ErrorCode RANDOM_ERROR_CODE = ErrorCode.FromCode(20); + private const string RANDOM_ERROR_MESSAGE = "RANDOM_ERROR_MESSAGE"; + + private const string USER_NAME = "USER_NAME"; + private const string PASSWORD = "PASSWORD"; + + private DfaUser user; + private AdRemoteService adRemoteService; + + private readonly UserToken USER_TOKEN = new UserToken(USER_NAME, PASSWORD); + + /// + /// Inits this instance. + /// + [SetUp] + public void Init() { + user = new DfaUser(); + adRemoteService = (AdRemoteService) user.GetService(DfaService.v1_20.AdRemoteService); + } + + /// + /// Tests if TokenExpiredError is recognized correctly. + /// + [Test] + [Category("Small")] + public void TestIsTokenExpiredError() { + DfaException exception = null; + + exception = new DfaApiException(TOKEN_EXPIRED_CODE, TOKEN_EXPIRED_MESSAGE); + Assert.IsTrue(DfaErrorHandler.IsTokenExpiredError(exception)); + + exception = new DfaApiException(TOKEN_EXPIRED_CODE, RANDOM_ERROR_MESSAGE); + Assert.IsFalse(DfaErrorHandler.IsTokenExpiredError(exception)); + + exception = new DfaApiException(RANDOM_ERROR_CODE, TOKEN_EXPIRED_MESSAGE); + Assert.IsFalse(DfaErrorHandler.IsTokenExpiredError(exception)); + } + + /// + /// Tests if retry logic is working fine. + /// + [Test] + [Category("Small")] + public void TestShouldRetry() { + DfaErrorHandler errorHandler = null; + + // Should not retry if RetryCount == 0 + errorHandler = new DfaErrorHandler(adRemoteService); + user.Config.RetryCount = 0; + Assert.IsFalse(errorHandler.ShouldRetry(new DfaCredentialsExpiredException(USER_TOKEN))); + + // Should not retry if exception is not DfaCredentialsExpiredException. + errorHandler = new DfaErrorHandler(adRemoteService); + user.Config.RetryCount = 1; + Assert.IsFalse(errorHandler.ShouldRetry(new ArgumentNullException())); + + // Should retry if exception is DfaCredentialsExpiredException and + // RetryCount > 0 + errorHandler = new DfaErrorHandler(adRemoteService); + user.Config.RetryCount = 1; + Assert.IsTrue(errorHandler.ShouldRetry(new DfaCredentialsExpiredException(USER_TOKEN))); + } + + /// + /// Tests if prepare for retry works as expected. + /// + [Test] + [Category("Small")] + public void TestPrepareForRetry() { + LoginUtil.Cache.AddToken(USER_NAME, USER_TOKEN); + (user.Config as DfaAppConfig).DfaAuthToken = PASSWORD; + adRemoteService.Token = USER_TOKEN; + user.Config.RetryCount = 1; + + // PrepareForRetry should reset all relevant values when presented with + // correct values. + DfaErrorHandler errorHandler = new DfaErrorHandler(adRemoteService); + errorHandler.PrepareForRetry(new DfaCredentialsExpiredException(USER_TOKEN)); + Assert.IsNull(LoginUtil.Cache.GetToken(USER_NAME)); + Assert.IsNull(adRemoteService.Token); + Assert.IsNull((user.Config as DfaAppConfig).DfaAuthToken); + + // Indirectly test retryCount. This should become 1 after + // PrepareForRetry() and another attempt to retry should fail. + Assert.IsFalse(errorHandler.ShouldRetry(new DfaCredentialsExpiredException(USER_TOKEN))); + + // PrepareRetry should rethrow any exception that is not + // DfaCredentialsExpiredException + errorHandler = new DfaErrorHandler(adRemoteService); + + Exception ex = new Exception(); + try { + errorHandler.PrepareForRetry(ex); + Assert.Fail("Should not prepare for retry if exception is not " + + "DfaCredentialsExpiredException."); + } catch (Exception e) { + Assert.AreSame(ex, e); + } + } + } +} diff --git a/tests/Dfa/Properties/AssemblyInfo.cs b/tests/Dfa/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..800e06bdd0a --- /dev/null +++ b/tests/Dfa/Properties/AssemblyInfo.cs @@ -0,0 +1,37 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("DoubleClick for Advertisers API Client Library Tests")] +[assembly: AssemblyDescription( + "This library contains NUnit tests for the client library.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("70e39068-dfac-4702-b6dd-e426525b17a9")] diff --git a/tests/Dfa/Properties/Properties.cs b/tests/Dfa/Properties/Properties.cs new file mode 100644 index 00000000000..e227e002fbb --- /dev/null +++ b/tests/Dfa/Properties/Properties.cs @@ -0,0 +1,24 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; + +[assembly: AssemblyCompany("Google")] +[assembly: AssemblyProduct("DoubleClick for Advertisers API DotNet Client Library")] +[assembly: AssemblyCopyright("Copyright 2011, Google Inc. All Rights Reserved.")] + +[assembly: AssemblyVersion("18.0.0.0")] +[assembly: AssemblyFileVersion("18.0.0.0")] diff --git a/tests/Dfp/App.config b/tests/Dfp/App.config new file mode 100644 index 00000000000..95e79456764 --- /dev/null +++ b/tests/Dfp/App.config @@ -0,0 +1,190 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/Dfp/BaseTests.cs b/tests/Dfp/BaseTests.cs new file mode 100644 index 00000000000..0e34d720a2e --- /dev/null +++ b/tests/Dfp/BaseTests.cs @@ -0,0 +1,47 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; + +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests { + /// + /// Base class for all test suites. + /// + public class BaseTests { + /// + /// The Dfp user to be used for tests. + /// + protected DfpUser user = new DfpUser(); + + /// + /// Default public constructor. + /// + /// The constructor adds a 2000 ms delay between running individual + /// tests so that we don't hit the ClientLogin server frequently and cause + /// it throw captcha errors. You shouldn't do this in your code, instead + /// you should generate an authtoken, set it in your App.config and reuse + /// it to avoid performance issues. + /// + public BaseTests() { + Thread.Sleep(2000); + } + } +} diff --git a/tests/Dfp/Dfp.Tests.csproj b/tests/Dfp/Dfp.Tests.csproj new file mode 100644 index 00000000000..b4980dbe56a --- /dev/null +++ b/tests/Dfp/Dfp.Tests.csproj @@ -0,0 +1,207 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {FB12F1ED-8B46-4F49-8B0C-0F948DF7BB51} + Library + Properties + Google.Api.Ads.Dfp.Tests + Dfp.Tests + + + + + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AnyCPU + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\lib\nunit\nunit.framework.dll + + + + + + + + + + {277404DB-A439-4450-B3A5-186294CDF245} + Common + + + {CE15CE8A-532B-49DA-8CF7-2BFCDEE845DB} + Dfp + + + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/Dfp/DfpServiceFactoryTests.cs b/tests/Dfp/DfpServiceFactoryTests.cs new file mode 100644 index 00000000000..41b24590205 --- /dev/null +++ b/tests/Dfp/DfpServiceFactoryTests.cs @@ -0,0 +1,106 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +using System; +using System.Collections.Generic; +using System.Text; +using Google.Api.Ads.Common.Lib; +using Google.Api.Ads.Dfp.Lib; +using NUnit.Framework; + +namespace Google.Api.Ads.Dfp.Tests { + + /// + /// Tests for the DfpServiceFactory + /// + [TestFixture] + class DfpServiceFactoryTests { + + private const string DEPRECATED_CLIENT_LOGIN_VERSION = "v201403"; + private const string SUPPORTED_CLIENT_LOGIN_VERSION = "v201311"; + private const string TEST_SERVICE = "LineItemService"; + + private DfpServiceFactory serviceFactory; + private ServiceSignature serviceSignature; + + /// + /// Default public constructor. + /// + public DfpServiceFactoryTests() { + + } + + [SetUp] + public void Init() { + serviceFactory = new DfpServiceFactory(); + } + + /// + /// Test that creating a service using ClientLogin in a deprecated version + /// throws an exception + /// + [Test] + [ExpectedException(typeof(DfpException))] + public void TestCreateServiceClientLoginDeprecated() { + ConfigureForClientLogin(); + serviceSignature = new DfpServiceSignature(DEPRECATED_CLIENT_LOGIN_VERSION, TEST_SERVICE); + serviceFactory.CreateService(serviceSignature, new DfpUser(), null); + } + + /// + /// Test that creating a service using ClientLogin in a supported version does not + /// throw an exception + /// + [Test] + public void TestCreateServiceClientLoginSupported() { + ConfigureForClientLogin(); + serviceSignature = new DfpServiceSignature(SUPPORTED_CLIENT_LOGIN_VERSION, TEST_SERVICE); + serviceFactory.CreateService(serviceSignature, new DfpUser(), null); + } + + /// + /// Test creating a service using OAuth2 in a version where ClientLogin is supported + /// + [Test] + public void TestCreateServiceOAuth2ClientLoginSupported() { + ConfigureForOAuth2(); + serviceSignature = new DfpServiceSignature(SUPPORTED_CLIENT_LOGIN_VERSION, TEST_SERVICE); + serviceFactory.CreateService(serviceSignature, new DfpUser(), null); + } + + /// + /// Test creating a service using OAuth2 in a version where ClientLogin is deprecated + /// + [Test] + public void TestCreateServiceOAuth2ClientLoginDeprecated() { + ConfigureForOAuth2(); + serviceSignature = new DfpServiceSignature(DEPRECATED_CLIENT_LOGIN_VERSION, TEST_SERVICE); + serviceFactory.CreateService(serviceSignature, new DfpUser(), null); + } + + private void ConfigureForOAuth2() { + DfpAppConfig config = new DfpAppConfig(); + config.AuthorizationMethod = DfpAuthorizationMethod.OAuth2; + serviceFactory.Config = config; + } + + private void ConfigureForClientLogin() { + DfpAppConfig config = new DfpAppConfig(); + config.AuthorizationMethod = DfpAuthorizationMethod.ClientLogin; + serviceFactory.Config = config; + } + } +} diff --git a/tests/Dfp/Properties/AssemblyInfo.cs b/tests/Dfp/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..da43fb334b0 --- /dev/null +++ b/tests/Dfp/Properties/AssemblyInfo.cs @@ -0,0 +1,37 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Google's DoubleClick for Publishers API Client Library Tests")] +[assembly: AssemblyDescription( + "This library contains NUnit tests for the client library.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("70e39068-dfac-4702-b6dd-e426525b17a9")] diff --git a/tests/Dfp/Properties/Properties.cs b/tests/Dfp/Properties/Properties.cs new file mode 100644 index 00000000000..0d4995b8074 --- /dev/null +++ b/tests/Dfp/Properties/Properties.cs @@ -0,0 +1,24 @@ +// Copyright 2011, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; + +[assembly: AssemblyCompany("Google")] +[assembly: AssemblyProduct("Google's DoubleClick for Publishers API DotNet Client Library")] +[assembly: AssemblyCopyright("Copyright 2011, Google Inc. All Rights Reserved.")] + +[assembly: AssemblyVersion("18.0.0.0")] +[assembly: AssemblyFileVersion("18.0.0.0")] diff --git a/tests/Dfp/ServiceCreationTests.cs b/tests/Dfp/ServiceCreationTests.cs new file mode 100644 index 00000000000..be62cc9fa96 --- /dev/null +++ b/tests/Dfp/ServiceCreationTests.cs @@ -0,0 +1,68 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; +using System.Reflection; +using Google.Api.Ads.Common.Lib; + + +namespace Google.Api.Ads.Dfp.Tests { + /// + /// UnitTests for service creation. + /// + [TestFixture] + public class ServiceCreationTests : BaseTests { + + /// + /// Default public constructor. + /// + public ServiceCreationTests() : base() { + } + + /// + /// Test whether we can create all the services without any exceptions. + /// + [Test] + public void TestCreateServices() { + Type dfpServiceType = typeof(DfpService); + + Type[] versionTypes = dfpServiceType.GetNestedTypes(); + + foreach (Type versionType in versionTypes) { + FieldInfo[] serviceFields = versionType.GetFields + (BindingFlags.Static | BindingFlags.Public); + foreach (FieldInfo fieldInfo in serviceFields) { + if (fieldInfo.FieldType == typeof(ServiceSignature)) { + ServiceSignature value = (ServiceSignature) fieldInfo.GetValue(null); + Assert.DoesNotThrow(delegate() { + AdsClient service = user.GetService(value); + }); + } + } + } + } + } +} diff --git a/tests/Dfp/v201208/CompanyServiceTests.cs b/tests/Dfp/v201208/CompanyServiceTests.cs new file mode 100644 index 00000000000..7f5b4161ab3 --- /dev/null +++ b/tests/Dfp/v201208/CompanyServiceTests.cs @@ -0,0 +1,192 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201208 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class CompanyServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private CompanyService companyService; + + /// + /// The company to be used for further tests. + /// + private Company testCompany1 = null; + + /// + /// The company to be used for further tests. + /// + private Company testCompany2 = null; + + /// + /// Default public constructor. + /// + public CompanyServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + companyService = (CompanyService) user.GetService(DfpService.v201208.CompanyService); + testCompany1 = utils.CreateCompany(user, CompanyType.ADVERTISER); + testCompany2 = utils.CreateCompany(user, CompanyType.ADVERTISER); + } + + + /// + /// Test whether we can create a company. + /// + [Test] + public void TestCreateCompany() { + Company company = new Company(); + company.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company.type = CompanyType.ADVERTISER; + + Company newCompany = null; + Assert.DoesNotThrow(delegate() { + newCompany = companyService.createCompany(company); + }); + + Assert.NotNull(newCompany); + Assert.AreEqual(company.name, newCompany.name); + Assert.AreEqual(company.type, newCompany.type); + } + + /// + /// Test whether we can create a list of companies. + /// + [Test] + public void TestCreateCompanies() { + Company company1 = new Company(); + company1.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company1.type = CompanyType.ADVERTISER; + + Company company2 = new Company(); + company2.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company2.type = CompanyType.ADVERTISER; + + Company[] newCompanies = null; + Assert.DoesNotThrow(delegate() { + newCompanies = companyService.createCompanies(new Company[] {company1, company2}); + }); + + Assert.NotNull(newCompanies); + Assert.AreEqual(newCompanies.Length, 2); + + Assert.AreEqual(company1.name, newCompanies[0].name); + Assert.AreEqual(company1.type, newCompanies[0].type); + Assert.AreEqual(company2.name, newCompanies[1].name); + Assert.AreEqual(company2.type, newCompanies[1].type); + } + + /// + /// Test whether we can fetch an existing company. + /// + [Test] + public void TestGetCompany() { + Company company1 = null; + + Assert.DoesNotThrow(delegate() { + company1 = companyService.getCompany(testCompany1.id); + }); + + Assert.NotNull(company1); + Assert.AreEqual(testCompany1.id, company1.id); + Assert.AreEqual(testCompany1.name, company1.name); + } + + /// + /// Test whether we can fetch a list of existing companies that match given + /// statement. + /// + [Test] + public void TestGetCompaniesByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = {0} ORDER BY name LIMIT 1", testCompany1.id); + CompanyPage page = null; + + Assert.DoesNotThrow(delegate() { + page = companyService.getCompaniesByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.results.Length, 1); + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].id, testCompany1.id); + Assert.AreEqual(page.results[0].name, testCompany1.name); + } + + /// + /// Test whether we can update a company. + /// + [Test] + public void TestUpdateCompany() { + testCompany1.name = "Corp " + testCompany1.name; + Company newCompany = null; + + Assert.DoesNotThrow(delegate() { + newCompany = companyService.updateCompany(testCompany1); + }); + + Assert.NotNull(newCompany); + Assert.AreEqual(newCompany.id, testCompany1.id); + Assert.AreEqual(newCompany.name, testCompany1.name); + } + + /// + /// Test whether we can update a list of companies. + /// + [Test] + public void TestUpdateCompanies() { + testCompany1.name = "Corp " + testCompany1.name; + testCompany2.name = "Corp " + testCompany2.name; + + Company[] newCompanies = null; + + Assert.DoesNotThrow(delegate() { + newCompanies = companyService.updateCompanies(new Company[] {testCompany1, testCompany2}); + }); + + Assert.NotNull(newCompanies); + Assert.AreEqual(newCompanies.Length, 2); + + Assert.AreEqual(testCompany1.name, newCompanies[0].name); + Assert.AreEqual(testCompany1.type, newCompanies[0].type); + Assert.AreEqual(testCompany2.name, newCompanies[1].name); + Assert.AreEqual(testCompany2.type, newCompanies[1].type); + } + } +} diff --git a/tests/Dfp/v201208/CreativeServiceTests.cs b/tests/Dfp/v201208/CreativeServiceTests.cs new file mode 100644 index 00000000000..45325d38dd5 --- /dev/null +++ b/tests/Dfp/v201208/CreativeServiceTests.cs @@ -0,0 +1,266 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201208 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class CreativeServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private CreativeService creativeService; + + /// + /// The advertiser company id to be used for running tests. + /// + private long advertiserId = 0; + + /// + /// The creative 1 to be used for running tests. + /// + private Creative creative1 = null; + + /// + /// The creative 2 to be used for running tests. + /// + private Creative creative2 = null; + + /// + /// Default public constructor. + /// + public CreativeServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + creativeService = (CreativeService)user.GetService(DfpService.v201208.CreativeService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + creative1 = utils.CreateCreative(user, advertiserId); + creative2 = utils.CreateCreative(user, advertiserId); + } + + /// + /// Test whether we can create a creative. + /// + [Test] + public void TestCreateCreative() { + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", new TestUtils().GetTimeStamp()); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.imageName = "image.jpg"; + imageCreative.imageByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + + Size imageSize = new Size(); + imageSize.width = 300; + imageSize.height = 250; + + imageCreative.size = imageSize; + + Creative newCreative = null; + + Assert.DoesNotThrow(delegate() { + newCreative = creativeService.createCreative(imageCreative); + }); + + Assert.NotNull(newCreative); + Assert.That(newCreative is ImageCreative); + Assert.AreEqual(newCreative.advertiserId, imageCreative.advertiserId); + Assert.AreEqual(newCreative.name, imageCreative.name); + } + + /// + /// Test whether we can create a list of creatives. + /// + [Test] + public void TestCreateCreatives() { + ImageCreative imageCreative1 = new ImageCreative(); + imageCreative1.name = string.Format("Image creative #{0}", new TestUtils().GetTimeStamp()); + imageCreative1.advertiserId = advertiserId; + imageCreative1.destinationUrl = "http://www.google.com"; + imageCreative1.imageName = "image.jpg"; + imageCreative1.imageByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + + Size imageSize1 = new Size(); + imageSize1.width = 300; + imageSize1.height = 250; + + imageCreative1.size = imageSize1; + + ImageCreative imageCreative2 = new ImageCreative(); + imageCreative2.name = string.Format("Image creative #{0}", new TestUtils().GetTimeStamp()); + imageCreative2.advertiserId = advertiserId; + imageCreative2.destinationUrl = "http://www.google.com"; + imageCreative2.imageName = "image.jpg"; + imageCreative2.imageByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/skyscraper.jpg"); + + Size imageSize2 = new Size(); + imageSize2.width = 120; + imageSize2.height = 600; + + imageCreative2.size = imageSize2; + + Creative[] newCreatives = null; + + Assert.DoesNotThrow(delegate() { + newCreatives = creativeService.createCreatives(new Creative[] {imageCreative1, + imageCreative2}); + }); + + Assert.NotNull(newCreatives); + Assert.AreEqual(newCreatives.Length, 2); + Assert.NotNull(newCreatives[0]); + Assert.That(newCreatives[0] is ImageCreative); + Assert.AreEqual(newCreatives[0].advertiserId, imageCreative1.advertiserId); + Assert.AreEqual(newCreatives[0].name, imageCreative1.name); + Assert.NotNull(newCreatives[1]); + Assert.That(newCreatives[1] is ImageCreative); + Assert.AreEqual(newCreatives[1].advertiserId, imageCreative2.advertiserId); + Assert.AreEqual(newCreatives[1].name, imageCreative2.name); + } + + /// + /// Test whether we can fetch an existing creative. + /// + [Test] + public void TestGetCreative() { + Creative localCreative = null; + Assert.DoesNotThrow(delegate() { + localCreative = creativeService.getCreative(creative1.id); + }); + Assert.NotNull(localCreative); + Assert.AreEqual(localCreative.id, creative1.id); + Assert.AreEqual(localCreative.GetType(), creative1.GetType()); + Assert.AreEqual(localCreative.name, creative1.name); + Assert.AreEqual(localCreative.advertiserId, creative1.advertiserId); + Assert.AreEqual(localCreative.previewUrl, creative1.previewUrl); + Assert.AreEqual(localCreative.size.height, creative1.size.height); + Assert.AreEqual(localCreative.size.width, creative1.size.width); + } + + /// + /// Test whether we can fetch a list of existing creatives that match given + /// statement. + /// + [Test] + public void TestGetCreativesByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 500", creative1.id); + + CreativePage page = null; + + Assert.DoesNotThrow(delegate() { + page = creativeService.getCreativesByStatement(statement); + }); + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].id, creative1.id); + Assert.AreEqual(page.results[0].GetType(), creative1.GetType()); + Assert.AreEqual(page.results[0].name, creative1.name); + Assert.AreEqual(page.results[0].advertiserId, creative1.advertiserId); + Assert.AreEqual(page.results[0].previewUrl, creative1.previewUrl); + Assert.AreEqual(page.results[0].size.height, creative1.size.height); + Assert.AreEqual(page.results[0].size.width, creative1.size.width); + } + + /// + /// Test whether we can update a creative. + /// + [Test] + public void TestUpdateCreative() { + ImageCreative imageCreative = (ImageCreative) creative1; + imageCreative.destinationUrl = "http://news.google.com"; + + Creative newCreative = null; + + Assert.DoesNotThrow(delegate() { + newCreative = creativeService.updateCreative(creative1); + }); + + Assert.NotNull(newCreative); + Assert.AreEqual(newCreative.id, creative1.id); + Assert.AreEqual(newCreative.name, creative1.name); + Assert.AreEqual(newCreative.advertiserId, creative1.advertiserId); + Assert.AreEqual(newCreative.size.height, creative1.size.height); + Assert.AreEqual(newCreative.size.width, creative1.size.width); + Assert.That(newCreative is ImageCreative); + Assert.AreEqual((newCreative as ImageCreative).destinationUrl, imageCreative.destinationUrl); + } + + /// + /// Test whether we can update a list of creatives. + /// + [Test] + public void TestUpdateCreatives() { + ImageCreative imageCreative1 = (ImageCreative) creative1; + imageCreative1.destinationUrl = "http://news.google.com"; + + ImageCreative imageCreative2 = (ImageCreative) creative2; + imageCreative2.destinationUrl = "http://finance.google.com"; + + Creative[] newCreatives = null; + + Assert.DoesNotThrow(delegate() { + newCreatives = creativeService.updateCreatives(new Creative[] {creative1, creative2}); + }); + + Assert.NotNull(newCreatives); + Assert.AreEqual(newCreatives.Length, 2); + + Assert.AreEqual(newCreatives[0].id, creative1.id); + Assert.AreEqual(newCreatives[0].name, creative1.name); + Assert.AreEqual(newCreatives[0].advertiserId, creative1.advertiserId); + Assert.AreEqual(newCreatives[0].size.height, creative1.size.height); + Assert.AreEqual(newCreatives[0].size.width, creative1.size.width); + Assert.That(newCreatives[0] is ImageCreative); + Assert.AreEqual((newCreatives[0] as ImageCreative).destinationUrl, + imageCreative1.destinationUrl); + + Assert.AreEqual(newCreatives[1].id, creative2.id); + Assert.AreEqual(newCreatives[1].name, creative2.name); + Assert.AreEqual(newCreatives[1].advertiserId, creative2.advertiserId); + Assert.AreEqual(newCreatives[1].size.height, creative2.size.height); + Assert.AreEqual(newCreatives[1].size.width, creative2.size.width); + Assert.That(newCreatives[1] is ImageCreative); + Assert.AreEqual((newCreatives[1] as ImageCreative).destinationUrl, + imageCreative2.destinationUrl); + } + } +} diff --git a/tests/Dfp/v201208/ForecastServiceTests.cs b/tests/Dfp/v201208/ForecastServiceTests.cs new file mode 100644 index 00000000000..62e2f8f2f1d --- /dev/null +++ b/tests/Dfp/v201208/ForecastServiceTests.cs @@ -0,0 +1,171 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201208 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class ForecastServiceTests : BaseTests { + /// + /// ForecastService object to be used in this test. + /// + private ForecastService forecastService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Placement id for running tests. + /// + private long placementId; + + /// + /// Line item id for running tests. + /// + private long lineItemId; + + /// + /// Default public constructor. + /// + public ForecastServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + forecastService = (ForecastService)user.GetService(DfpService.v201208.ForecastService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + placementId = utils.CreatePlacement(user, new string[] {adUnitId}).id; + lineItemId = utils.CreateLineItem(user, orderId, adUnitId).id; + } + + /// + /// Test whether we can get a forecast for given line item. + /// + [Test] + public void TestGetForecast() { + TestUtils utils = new TestUtils(); + + LineItem lineItem = new LineItem(); + lineItem.name = string.Format("Line item #{0}", utils.GetTimeStamp()); + + lineItem.orderId = orderId; + + lineItem.targeting = new Targeting(); + lineItem.targeting.inventoryTargeting = new InventoryTargeting(); + lineItem.targeting.inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + Size size1 = new Size(); + size1.width = 300; + size1.height = 250; + + Size size2 = new Size(); + size2.width = 120; + size2.height = 600; + + // Create the creative placeholders. + CreativePlaceholder creativePlaceholder1 = new CreativePlaceholder(); + creativePlaceholder1.size = size1; + + CreativePlaceholder creativePlaceholder2 = new CreativePlaceholder(); + creativePlaceholder1.size = size2; + + lineItem.creativePlaceholders = + new CreativePlaceholder[] {creativePlaceholder1, creativePlaceholder2}; + + lineItem.lineItemType = LineItemType.STANDARD; + + // Set start date time and end date time. + lineItem.startDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddDays(1)); + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000; + + lineItem.creativeRotationType = CreativeRotationType.EVEN; + lineItem.discountType = LineItemDiscountType.PERCENTAGE; + + lineItem.unitsBought = 500000; + lineItem.unitType = UnitType.IMPRESSIONS; + + Forecast forecast = null; + Assert.DoesNotThrow(delegate() { + forecast = forecastService.getForecast(lineItem); + }); + Assert.NotNull(forecast); + Assert.AreEqual(forecast.orderId, orderId); + Assert.AreEqual(forecast.unitType, lineItem.unitType); + } + + /// + /// Test whether we can get a forecast for existing line item. + /// + [Test] + public void TestGetForecastById() { + Forecast forecast = null; + Assert.DoesNotThrow(delegate() { + forecast = forecastService.getForecastById(lineItemId); + }); + Assert.NotNull(forecast); + Assert.AreEqual(forecast.orderId, orderId); + } + } +} diff --git a/tests/Dfp/v201208/InventoryServiceTests.cs b/tests/Dfp/v201208/InventoryServiceTests.cs new file mode 100644 index 00000000000..ed917856bdc --- /dev/null +++ b/tests/Dfp/v201208/InventoryServiceTests.cs @@ -0,0 +1,295 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201208 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class InventoryServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private InventoryService inventoryService; + + /// + /// The ad unit 1 for running tests. + /// + private AdUnit adUnit1; + + /// + /// The ad unit 2 for running tests. + /// + private AdUnit adUnit2; + + /// + /// Default public constructor. + /// + public InventoryServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + inventoryService = (InventoryService) user.GetService(DfpService.v201208.InventoryService); + adUnit1 = utils.CreateAdUnit(user); + adUnit2 = utils.CreateAdUnit(user); + } + + /// + /// Test whether we can create an ad unit. + /// + [Test] + public void TestCreateAdUnit() { + AdUnit localAdUnit = new AdUnit(); + localAdUnit.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit.parentId = adUnit1.id; + + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + localAdUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + + AdUnit newAdUnit = null; + + Assert.DoesNotThrow(delegate() { + newAdUnit = inventoryService.createAdUnit(localAdUnit); + }); + + Assert.NotNull(newAdUnit); + Assert.AreEqual(newAdUnit.name, localAdUnit.name); + Assert.AreEqual(newAdUnit.parentId, localAdUnit.parentId); + Assert.AreEqual(newAdUnit.parentId, adUnit1.id); + Assert.AreEqual(newAdUnit.status, localAdUnit.status); + Assert.AreEqual(newAdUnit.targetWindow, localAdUnit.targetWindow); + } + + /// + /// Test whether we can create a list of ad units. + /// + [Test] + public void TestCreateAdUnits() { + // Create ad unit 1. + AdUnit localAdUnit1 = new AdUnit(); + localAdUnit1.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit1.parentId = adUnit1.id; + + Size size1 = new Size(); + size1.width = 300; + size1.height = 250; + + AdUnitSize adUnitSize1 = new AdUnitSize(); + adUnitSize1.size = size1; + adUnitSize1.environmentType = EnvironmentType.BROWSER; + + localAdUnit1.adUnitSizes = new AdUnitSize[] {adUnitSize1}; + + // Create ad unit 2. + AdUnit localAdUnit2 = new AdUnit(); + localAdUnit2.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit2.parentId = adUnit1.id; + + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + + AdUnitSize adUnitSize2 = new AdUnitSize(); + adUnitSize2.size = size2; + adUnitSize2.environmentType = EnvironmentType.BROWSER; + + localAdUnit2.adUnitSizes = new AdUnitSize[] {adUnitSize2}; + + AdUnit[] newAdUnits = null; + + Assert.DoesNotThrow(delegate() { + newAdUnits = inventoryService.createAdUnits(new AdUnit[] {localAdUnit1, localAdUnit2}); + }); + + Assert.NotNull(newAdUnits); + Assert.AreEqual(newAdUnits.Length, 2); + + Assert.AreEqual(newAdUnits[0].name, localAdUnit1.name); + Assert.AreEqual(newAdUnits[0].parentId, localAdUnit1.parentId); + Assert.AreEqual(newAdUnits[0].parentId, adUnit1.id); + Assert.AreEqual(newAdUnits[0].status, localAdUnit1.status); + Assert.AreEqual(newAdUnits[0].targetWindow, localAdUnit1.targetWindow); + + Assert.AreEqual(newAdUnits[1].name, localAdUnit2.name); + Assert.AreEqual(newAdUnits[1].parentId, localAdUnit2.parentId); + Assert.AreEqual(newAdUnits[1].parentId, adUnit1.id); + Assert.AreEqual(newAdUnits[1].status, localAdUnit2.status); + Assert.AreEqual(newAdUnits[1].targetWindow, localAdUnit2.targetWindow); + } + + /// + /// Test whether we can fetch a list of existing ad units that match given + /// statement. + /// + [Test] + public void TestGetAdUnitsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", adUnit1.id); + + AdUnitPage page = null; + + Assert.DoesNotThrow(delegate() { + page = inventoryService.getAdUnitsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results[0]); + + Assert.AreEqual(page.results[0].name, adUnit1.name); + Assert.AreEqual(page.results[0].parentId, adUnit1.parentId); + Assert.AreEqual(page.results[0].id, adUnit1.id); + Assert.AreEqual(page.results[0].status, adUnit1.status); + Assert.AreEqual(page.results[0].targetWindow, adUnit1.targetWindow); + } + + /// + /// Test whether we can deactivate an ad unit. + /// + [Test] + public void TestPerformAdUnitAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", adUnit1.id); + + UpdateResult result = null; + Assert.DoesNotThrow(delegate() { + result = inventoryService.performAdUnitAction(new DeactivateAdUnits(), statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update an ad unit. + /// + [Test] + public void TestUpdateAdUnit() { + List adUnitSizes = new List(adUnit1.adUnitSizes); + + Size size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit1.adUnitSizes = adUnitSizes.ToArray(); + + AdUnit newAdUnit = null; + Assert.DoesNotThrow(delegate() { + newAdUnit = inventoryService.updateAdUnit(adUnit1); + }); + + Assert.NotNull(newAdUnit); + + Assert.AreEqual(newAdUnit.name, adUnit1.name); + Assert.AreEqual(newAdUnit.parentId, adUnit1.parentId); + Assert.AreEqual(newAdUnit.id, adUnit1.id); + Assert.AreEqual(newAdUnit.status, adUnit1.status); + Assert.AreEqual(newAdUnit.targetWindow, adUnit1.targetWindow); + Assert.AreEqual(newAdUnit.adUnitSizes.Length, adUnit1.adUnitSizes.Length); + } + + /// + /// Test whether we can update a list of an ad units. + /// + [Test] + public void TestUpdateAdUnits() { + List adUnitSizes = null; + Size size = null; + + // Modify ad unit 1. + adUnitSizes = new List(adUnit1.adUnitSizes); + size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit1.adUnitSizes = adUnitSizes.ToArray(); + + // Modify ad unit 2. + adUnitSizes = new List(adUnit2.adUnitSizes); + size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit2.adUnitSizes = adUnitSizes.ToArray(); + + AdUnit[] newAdUnits = null; + Assert.DoesNotThrow(delegate() { + newAdUnits = inventoryService.updateAdUnits(new AdUnit[] {adUnit1, adUnit2}); + }); + + Assert.NotNull(newAdUnits); + Assert.AreEqual(newAdUnits.Length, 2); + + Assert.AreEqual(newAdUnits[0].name, adUnit1.name); + Assert.AreEqual(newAdUnits[0].parentId, adUnit1.parentId); + Assert.AreEqual(newAdUnits[0].id, adUnit1.id); + Assert.AreEqual(newAdUnits[0].status, adUnit1.status); + Assert.AreEqual(newAdUnits[0].targetWindow, adUnit1.targetWindow); + Assert.AreEqual(newAdUnits[0].adUnitSizes.Length, adUnit1.adUnitSizes.Length); + + Assert.AreEqual(newAdUnits[1].name, adUnit2.name); + Assert.AreEqual(newAdUnits[1].parentId, adUnit2.parentId); + Assert.AreEqual(newAdUnits[1].id, adUnit2.id); + Assert.AreEqual(newAdUnits[1].status, adUnit2.status); + Assert.AreEqual(newAdUnits[1].targetWindow, adUnit2.targetWindow); + Assert.AreEqual(newAdUnits[1].adUnitSizes.Length, adUnit2.adUnitSizes.Length); + } + } +} diff --git a/tests/Dfp/v201208/LineItemCreativeAssociationServiceTests.cs b/tests/Dfp/v201208/LineItemCreativeAssociationServiceTests.cs new file mode 100644 index 00000000000..75f602a4c38 --- /dev/null +++ b/tests/Dfp/v201208/LineItemCreativeAssociationServiceTests.cs @@ -0,0 +1,303 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201208 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class LineItemCreativeAssociationServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private LineItemCreativeAssociationService licaService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Creative id 1 for running tests. + /// + private long creativeId1; + + /// + /// Creative id 2 for running tests. + /// + private long creativeId2; + + /// + /// Creative id 3 for running tests. + /// + private long creativeId3; + + /// + /// Creative id 4 for running tests. + /// + private long creativeId4; + + /// + /// Line item id 1 for running tests. + /// + private long lineItemId1; + + /// + /// Line item id 2 for running tests. + /// + private long lineItemId2; + + /// + /// Line item id 3 for running tests. + /// + private long lineItemId3; + + /// + /// Line item id 4 for running tests. + /// + private long lineItemId4; + + /// + /// Line item creative association 1 for running tests. + /// + private LineItemCreativeAssociation lica1; + + /// + /// Line item creative association 2 for running tests. + /// + private LineItemCreativeAssociation lica2; + + /// + /// Default public constructor. + /// + public LineItemCreativeAssociationServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + licaService = (LineItemCreativeAssociationService) user.GetService( + DfpService.v201208.LineItemCreativeAssociationService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + + lineItemId1 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId2 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId3 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId4 = utils.CreateLineItem(user, orderId, adUnitId).id; + + creativeId1 = utils.CreateCreative(user, advertiserId).id; + creativeId2 = utils.CreateCreative(user, advertiserId).id; + creativeId3 = utils.CreateCreative(user, advertiserId).id; + creativeId4 = utils.CreateCreative(user, advertiserId).id; + + lica1 = utils.CreateLica(user, lineItemId3, creativeId3); + lica2 = utils.CreateLica(user, lineItemId4, creativeId4); + } + + /// + /// Test whether we can create a line item creative association. + /// + [Test] + public void TestCreateLineItemCreativeAssociation() { + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId1; + lica.lineItemId = lineItemId1; + + LineItemCreativeAssociation newLica = null; + + Assert.DoesNotThrow(delegate() { + newLica = licaService.createLineItemCreativeAssociation(lica); + }); + + Assert.NotNull(newLica); + Assert.AreEqual(newLica.creativeId, lica.creativeId); + Assert.AreEqual(newLica.lineItemId, lica.lineItemId); + } + + /// + /// Test whether we can create a list of line item creative associations. + /// + [Test] + public void TestCreateLineItemCreativeAssociations() { + LineItemCreativeAssociation localLica1 = new LineItemCreativeAssociation(); + localLica1.creativeId = creativeId1; + localLica1.lineItemId = lineItemId1; + + LineItemCreativeAssociation localLica2 = new LineItemCreativeAssociation(); + localLica2.creativeId = creativeId2; + localLica2.lineItemId = lineItemId2; + + LineItemCreativeAssociation[] newLicas = null; + + Assert.DoesNotThrow(delegate() { + newLicas = licaService.createLineItemCreativeAssociations( + new LineItemCreativeAssociation[] {localLica1, localLica2}); + }); + + Assert.NotNull(newLicas); + Assert.AreEqual(newLicas.Length, 2); + + Assert.NotNull(newLicas[0]); + Assert.AreEqual(newLicas[0].creativeId, localLica1.creativeId); + Assert.AreEqual(newLicas[0].lineItemId, localLica1.lineItemId); + + Assert.NotNull(newLicas[1]); + Assert.AreEqual(newLicas[1].creativeId, localLica2.creativeId); + Assert.AreEqual(newLicas[1].lineItemId, localLica2.lineItemId); + } + + /// + /// Test whether we can fetch an existing line item creative association. + /// + [Test] + public void TestGetLineItemCreativeAssociation() { + LineItemCreativeAssociation newLica = null; + + Assert.DoesNotThrow(delegate() { + newLica = licaService.getLineItemCreativeAssociation(lineItemId3, creativeId3); + }); + + Assert.NotNull(newLica); + Assert.AreEqual(newLica.creativeId, lica1.creativeId); + Assert.AreEqual(newLica.lineItemId, lica1.lineItemId); + } + + /// + /// Test whether we can fetch a list of existing line item creative + /// associations that match given statement. + /// + [Test] + public void TestGetLineItemCreativeAssociationsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE lineItemId = '{0}' LIMIT 500", lineItemId3); + + LineItemCreativeAssociationPage page = null; + Assert.DoesNotThrow(delegate() { + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + }); + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].creativeId, lica1.creativeId); + Assert.AreEqual(page.results[0].lineItemId, lica1.lineItemId); + } + + /// + /// Test whether we can deactivate a line item create association. + /// + [Test] + public void TestPerformLineItemCreativeAssociationAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE lineItemId = '{0}' LIMIT 1", lineItemId3); + + DeactivateLineItemCreativeAssociations action = new DeactivateLineItemCreativeAssociations(); + + UpdateResult result = null; + Assert.DoesNotThrow(delegate() { + result = licaService.performLineItemCreativeAssociationAction(action, statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update a line item creative association. + /// + [Test] + public void TestUpdateLineItemCreativeAssociation() { + lica1.destinationUrl = "http://news.google.com"; + + LineItemCreativeAssociation newLica = null; + Assert.DoesNotThrow(delegate() { + newLica = licaService.updateLineItemCreativeAssociation(lica1); + }); + + Assert.NotNull(newLica); + Assert.AreEqual(newLica.creativeId, lica1.creativeId); + Assert.AreEqual(newLica.lineItemId, lica1.lineItemId); + Assert.AreEqual(newLica.destinationUrl, lica1.destinationUrl); + } + + /// + /// Test whether we can update a list of line item creative associations. + /// + [Test] + public void TestUpdateLineItemCreativeAssociations() { + lica1.destinationUrl = "http://news.google.com"; + lica2.destinationUrl = "http://news.google.com"; + + LineItemCreativeAssociation[] newLicas = null; + Assert.DoesNotThrow(delegate() { + newLicas = licaService.updateLineItemCreativeAssociations( + new LineItemCreativeAssociation[] {lica1, lica2}); + }); + + Assert.NotNull(newLicas); + Assert.AreEqual(newLicas.Length, 2); + + Assert.NotNull(newLicas[0]); + Assert.AreEqual(newLicas[0].creativeId, lica1.creativeId); + Assert.AreEqual(newLicas[0].lineItemId, lica1.lineItemId); + + Assert.NotNull(newLicas[1]); + Assert.AreEqual(newLicas[1].creativeId, lica2.creativeId); + Assert.AreEqual(newLicas[1].lineItemId, lica2.lineItemId); + } + } +} diff --git a/tests/Dfp/v201208/LineItemServiceTests.cs b/tests/Dfp/v201208/LineItemServiceTests.cs new file mode 100644 index 00000000000..938be9bd5de --- /dev/null +++ b/tests/Dfp/v201208/LineItemServiceTests.cs @@ -0,0 +1,486 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201208 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class LineItemServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private LineItemService lineItemService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Placement id for running tests. + /// + private long placementId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Line item 1 for running tests. + /// + private LineItem lineItem1; + + /// + /// Line item 2 for running tests. + /// + private LineItem lineItem2; + + /// + /// Default public constructor. + /// + public LineItemServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + lineItemService = (LineItemService)user.GetService(DfpService.v201208.LineItemService); + + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + placementId = utils.CreatePlacement(user, new string[] {adUnitId}).id; + lineItem1 = utils.CreateLineItem(user, orderId, adUnitId); + lineItem2 = utils.CreateLineItem(user, orderId, adUnitId); + } + + /// + /// Test whether we can create a line item creative association. + /// + [Test] + public void TestCreateLineItem() { + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201208.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201208.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + LineItem localLineItem = null; + + Assert.DoesNotThrow(delegate() { + localLineItem = lineItemService.createLineItem(lineItem); + }); + + Assert.NotNull(localLineItem); + Assert.AreEqual(localLineItem.name, lineItem.name); + Assert.AreEqual(localLineItem.orderId, lineItem.orderId); + } + + /// + /// Test whether we can create a list of line items. + /// + [Test] + public void TestCreateLineItems() { + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201208.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201208.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + // Create an array to store local line item objects. + LineItem[] lineItems = new LineItem[2]; + + for (int i = 0; i < lineItems.Length; i++) { + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + lineItems[i] = lineItem; + } + + LineItem[] localLineItems = null; + + Assert.DoesNotThrow(delegate() { + localLineItems = lineItemService.createLineItems(lineItems); + }); + + Assert.NotNull(localLineItems); + Assert.AreEqual(localLineItems.Length, 2); + + Assert.AreEqual(localLineItems[0].name, lineItems[0].name); + Assert.AreEqual(localLineItems[0].orderId, lineItems[0].orderId); + + Assert.AreEqual(localLineItems[1].name, lineItems[1].name); + Assert.AreEqual(localLineItems[1].orderId, lineItems[1].orderId); + } + + /// + /// Test whether we can fetch an existing line item. + /// + [Test] + public void TestGetLineItem() { + LineItem localLineItem = null; + + Assert.DoesNotThrow(delegate() { + localLineItem = lineItemService.getLineItem(lineItem1.id); + }); + + Assert.NotNull(localLineItem); + Assert.AreEqual(localLineItem.id, lineItem1.id); + Assert.AreEqual(localLineItem.name, lineItem1.name); + Assert.AreEqual(localLineItem.orderId, lineItem1.orderId); + } + + /// + /// Test whether we can fetch a list of existing line items that match given + /// statement. + /// + [Test] + public void TestGetLineItemsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", lineItem1.id); + + LineItemPage page = null; + + Assert.DoesNotThrow(delegate() { + page = lineItemService.getLineItemsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results); + Assert.AreEqual(page.results[0].id, lineItem1.id); + Assert.AreEqual(page.results[0].name, lineItem1.name); + Assert.AreEqual(page.results[0].orderId, lineItem1.orderId); + } + + /// + /// Test whether we can activate a line item. + /// + [Test] + public void TestPerformLineItemAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE orderId = '{0}' and status = '{1}'", + orderId, ComputedStatus.NEEDS_CREATIVES); + + ActivateLineItems action = new ActivateLineItems(); + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = lineItemService.performLineItemAction(action, statement); + }); + + Assert.NotNull(result); + } + + /// + /// Test whether we can update a line item. + /// + [Test] + public void TestUpdateLineItem() { + lineItem1.deliveryRateType = DeliveryRateType.AS_FAST_AS_POSSIBLE; + + LineItem localLineItem = null; + Assert.DoesNotThrow(delegate() { + localLineItem = lineItemService.updateLineItem(lineItem1); + }); + + Assert.NotNull(localLineItem); + Assert.AreEqual(localLineItem.id, lineItem1.id); + Assert.AreEqual(localLineItem.name, lineItem1.name); + Assert.AreEqual(localLineItem.orderId, lineItem1.orderId); + Assert.AreEqual(localLineItem.deliveryRateType, lineItem1.deliveryRateType); + } + + /// + /// Test whether we can update a list of line items. + /// + [Test] + public void TestUpdateLineItems() { + lineItem1.costPerUnit.microAmount = 3500000; + lineItem2.costPerUnit.microAmount = 3500000; + + LineItem[] localLineItems = null; + + Assert.DoesNotThrow(delegate() { + localLineItems = lineItemService.updateLineItems(new LineItem[] {lineItem1, lineItem2}); + }); + + Assert.NotNull(localLineItems); + Assert.AreEqual(localLineItems.Length, 2); + + Assert.AreEqual(localLineItems[0].id, lineItem1.id); + Assert.AreEqual(localLineItems[0].name, lineItem1.name); + Assert.AreEqual(localLineItems[0].orderId, lineItem1.orderId); + Assert.AreEqual(localLineItems[0].costPerUnit.microAmount, lineItem1.costPerUnit.microAmount); + + Assert.AreEqual(localLineItems[1].id, lineItem2.id); + Assert.AreEqual(localLineItems[1].name, lineItem2.name); + Assert.AreEqual(localLineItems[1].orderId, lineItem2.orderId); + Assert.AreEqual(localLineItems[1].costPerUnit.microAmount, lineItem2.costPerUnit.microAmount); + } + } +} diff --git a/tests/Dfp/v201208/OrderServiceTests.cs b/tests/Dfp/v201208/OrderServiceTests.cs new file mode 100644 index 00000000000..dc944362cad --- /dev/null +++ b/tests/Dfp/v201208/OrderServiceTests.cs @@ -0,0 +1,229 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfp.Tests.v201208 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class OrderServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private OrderService orderService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Default public constructor. + /// + public OrderServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + orderService = (OrderService) user.GetService(DfpService.v201208.OrderService); + + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + } + + /// + /// Test whether we can create an order. + /// + [Test] + public void TestCreateOrder() { + Order order = new Order(); + order.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order.advertiserId = advertiserId; + order.traffickerId = traffickerId; + order.currencyCode = "USD"; + + Order newOrder = null; + + Assert.DoesNotThrow(delegate() { + newOrder = orderService.createOrder(order); + }); + + Assert.NotNull(newOrder); + Assert.AreEqual(order.name, newOrder.name); + } + + /// + /// Test whether we can create a list of orders. + /// + [Test] + public void TestCreateOrders() { + Order order1 = new Order(); + order1.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order1.advertiserId = advertiserId; + order1.traffickerId = traffickerId; + order1.currencyCode = "USD"; + + Order order2 = new Order(); + order2.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order2.advertiserId = advertiserId; + order2.traffickerId = traffickerId; + order2.currencyCode = "USD"; + + Order[] newOrders = null; + + Assert.DoesNotThrow(delegate() { + newOrders = orderService.createOrders(new Order[] {order1, order2}); + }); + + Statement statement = new Statement(); + statement.query = string.Format("WHERE advertiserId = '{0}' LIMIT 500", advertiserId); + + OrderPage page = orderService.getOrdersByStatement(statement); + Assert.NotNull(newOrders); + Assert.AreEqual(newOrders.Length, 2); + + Assert.AreEqual(order1.name, newOrders[0].name); + Assert.AreEqual(order1.advertiserId, newOrders[0].advertiserId); + Assert.AreEqual(order1.traffickerId, newOrders[0].traffickerId); + Assert.AreEqual(order1.currencyCode, newOrders[0].currencyCode); + + Assert.AreEqual(order2.name, newOrders[1].name); + Assert.AreEqual(order2.advertiserId, newOrders[1].advertiserId); + Assert.AreEqual(order2.traffickerId, newOrders[1].traffickerId); + Assert.AreEqual(order2.currencyCode, newOrders[1].currencyCode); + } + + /// + /// Test whether we can perform an order action. + /// + [Test] + public void TestPerformOrderAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE status IN ('{0}', '{1}')", + OrderStatus.DRAFT, OrderStatus.PENDING_APPROVAL); + + ApproveOrders action = new ApproveOrders(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = orderService.performOrderAction(action, statement); + }); + + Assert.NotNull(result); + Assert.GreaterOrEqual(result.numChanges, 0); + } + + /// + /// Test whether we can create an order. + /// + [Test] + public void TestGetOrder() { + Order order = null; + + Assert.DoesNotThrow(delegate() { + order = orderService.getOrder(orderId); + }); + + Assert.NotNull(order); + Assert.AreEqual(order.id, orderId); + Assert.AreEqual(order.advertiserId, advertiserId); + Assert.AreEqual(order.traffickerId, traffickerId); + Assert.AreEqual(order.salespersonId, salespersonId); + } + + /// + /// Test whether we can update an order. + /// + [Test] + public void TestUpdateOrder() { + Order order = orderService.getOrder(orderId); + order.notes = "Spoke to advertiser. All is well."; + + Order newOrder = null; + + Assert.DoesNotThrow(delegate() { + newOrder = orderService.updateOrder(order); + }); + + Assert.NotNull(newOrder); + Assert.AreEqual(order.name, newOrder.name); + Assert.AreEqual(order.advertiserId, newOrder.advertiserId); + Assert.AreEqual(order.traffickerId, newOrder.traffickerId); + Assert.AreEqual(order.currencyCode, newOrder.currencyCode); + Assert.AreEqual(order.notes, newOrder.notes); + } + + /// + /// Test whether we can update a list of orders. + /// + [Test] + public void TestUpdateOrders() { + Order order = orderService.getOrder(orderId); + order.notes = "Spoke to advertiser. All is well."; + + Order[] newOrders = null; + + Assert.DoesNotThrow(delegate() { + newOrders = orderService.updateOrders(new Order[] {order}); + }); + + Assert.NotNull(newOrders); + Assert.AreEqual(newOrders.Length, 1); + + Assert.AreEqual(order.id, newOrders[0].id); + Assert.AreEqual(order.name, newOrders[0].name); + Assert.AreEqual(order.notes, newOrders[0].notes); + Assert.AreEqual(order.advertiserId, newOrders[0].advertiserId); + Assert.AreEqual(order.traffickerId, newOrders[0].traffickerId); + Assert.AreEqual(order.currencyCode, newOrders[0].currencyCode); + } + } +} diff --git a/tests/Dfp/v201208/PlacementServiceTests.cs b/tests/Dfp/v201208/PlacementServiceTests.cs new file mode 100644 index 00000000000..c44ebaf344f --- /dev/null +++ b/tests/Dfp/v201208/PlacementServiceTests.cs @@ -0,0 +1,242 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201208 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class PlacementServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private PlacementService placementService; + + /// + /// The ad unit 1 for running tests. + /// + private AdUnit adUnit1; + + /// + /// The ad unit 2 for running tests. + /// + private AdUnit adUnit2; + + /// + /// The placement for running tests. + /// + private Placement placement; + + /// + /// Default public constructor. + /// + public PlacementServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + placementService = (PlacementService) user.GetService(DfpService.v201208.PlacementService); + adUnit1 = utils.CreateAdUnit(user); + adUnit2 = utils.CreateAdUnit(user); + placement = utils.CreatePlacement(user, new string[] {adUnit1.id, adUnit2.id}); + } + + /// + /// Test whether we can create a placement. + /// + [Test] + public void TestCreatePlacement() { + Placement placement = new Placement(); + placement.name = string.Format("Medium Square AdUnit Placement #{0}", + new TestUtils().GetTimeStamp()); + placement.description = "Contains ad units that can hold creatives of size 300x250"; + placement.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement newPlacement = null; + + Assert.DoesNotThrow(delegate() { + newPlacement = placementService.createPlacement(placement); + }); + + Assert.NotNull(newPlacement); + Assert.AreEqual(newPlacement.name, placement.name); + Assert.AreEqual(newPlacement.description, placement.description); + Assert.Contains(adUnit1.id, newPlacement.targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacement.targetedAdUnitIds); + } + + /// + /// Test whether we can create a list of placements items. + /// + [Test] + public void TestCreatePlacements() { + TestUtils utils = new TestUtils(); + Placement placement1 = new Placement(); + placement1.name = string.Format("Medium Square AdUnit Placement #{0}", utils.GetTimeStamp()); + placement1.description = "Contains ad units that can hold creatives of size 300x250"; + placement1.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement placement2 = new Placement(); + placement2.name = string.Format("Medium Square AdUnit Placement #{0}", utils.GetTimeStamp()); + placement2.description = "Contains ad units that can hold creatives of size 300x250"; + placement2.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement[] newPlacements = null; + + Assert.DoesNotThrow(delegate() { + newPlacements = placementService.createPlacements(new Placement[] {placement1, placement2}); + }); + + Assert.NotNull(newPlacements); + Assert.AreEqual(newPlacements.Length, 2); + + Assert.NotNull(newPlacements[0]); + Assert.AreEqual(newPlacements[0].name, placement1.name); + Assert.AreEqual(newPlacements[0].description, placement1.description); + Assert.Contains(adUnit1.id, newPlacements[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[0].targetedAdUnitIds); + + Assert.NotNull(newPlacements[1]); + Assert.AreEqual(newPlacements[1].name, placement2.name); + Assert.AreEqual(newPlacements[1].description, placement2.description); + Assert.Contains(adUnit1.id, newPlacements[1].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[1].targetedAdUnitIds); + } + + /// + /// Test whether we can create a list of placements items. + /// + [Test] + public void TestGetPlacement() { + Placement newPlacement = null; + + Assert.DoesNotThrow(delegate() { + newPlacement = placementService.getPlacement(placement.id); + }); + + Assert.NotNull(newPlacement); + Assert.AreEqual(newPlacement.name, placement.name); + Assert.AreEqual(newPlacement.description, placement.description); + Assert.Contains(adUnit1.id, newPlacement.targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacement.targetedAdUnitIds); + } + + /// + /// Test whether we can fetch a list of existing placements that match given + /// statement. + /// + [Test] + public void TestGetPlacementsByStatement() { + // Create a Statement to only select active placements. + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}'", placement.id); + + PlacementPage page = null; + + Assert.DoesNotThrow(delegate() { + page = placementService.getPlacementsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.results.Length, 1); + + Assert.AreEqual(page.results[0].id, placement.id); + Assert.AreEqual(page.results[0].name, placement.name); + Assert.AreEqual(page.results[0].description, placement.description); + Assert.Contains(adUnit1.id, page.results[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, page.results[0].targetedAdUnitIds); + } + + /// + /// Test whether we can deactivate a placement. + /// + [Test] + public void TestPerformPlacementAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE status = '{0}'", InventoryStatus.ACTIVE); + + DeactivatePlacements action = new DeactivatePlacements(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = placementService.performPlacementAction(action, statement); + }); + + Assert.NotNull(result); + Assert.GreaterOrEqual(result.numChanges, 0); + } + + /// + /// Test whether we can update a placement. + /// + [Test] + public void TestUpdatePlacement() { + placement.description += "More description"; + + Placement newPlacement = null; + + Assert.DoesNotThrow(delegate() { + newPlacement = placementService.updatePlacement(placement); + }); + + Assert.NotNull(newPlacement); + Assert.AreEqual(newPlacement.name, placement.name); + Assert.AreEqual(newPlacement.description, placement.description); + Assert.Contains(adUnit1.id, newPlacement.targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacement.targetedAdUnitIds); + } + + /// + /// Test whether we can update a list of placements. + /// + [Test] + public void TestUpdatePlacements() { + placement.description += "More description"; + + Placement[] newPlacements = null; + + Assert.DoesNotThrow(delegate() { + newPlacements = placementService.updatePlacements(new Placement[] {placement}); + }); + + Assert.NotNull(newPlacements); + Assert.AreEqual(newPlacements.Length, 1); + + Assert.NotNull(newPlacements[0]); + Assert.AreEqual(newPlacements[0].name, placement.name); + Assert.AreEqual(newPlacements[0].description, placement.description); + Assert.Contains(adUnit1.id, newPlacements[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[0].targetedAdUnitIds); + } + } +} diff --git a/tests/Dfp/v201208/ReportServiceTests.cs b/tests/Dfp/v201208/ReportServiceTests.cs new file mode 100644 index 00000000000..d8921bcb12f --- /dev/null +++ b/tests/Dfp/v201208/ReportServiceTests.cs @@ -0,0 +1,160 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201208 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class ReportServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private ReportService reportService; + + /// + /// Report id for running further tests. + /// + long reportId; + + /// + /// Default public constructor. + /// + public ReportServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + reportService = (ReportService) user.GetService(DfpService.v201208.ReportService); + reportId = utils.CreateReport(user).id; + } + + /// + /// Test whether we can run a delivery report. + /// + [Test] + public void TestRunDeliveryReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can run an inventory report. + /// + [Test] + public void TestRunInventoryReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.DATE}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + Column.TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + Column.TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_WEEK; + + ReportJob newReportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can run a sales report. + /// + [Test] + public void TestRunSalesReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.SALESPERSON}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CPM_AND_CPC_REVENUE, Column.AD_SERVER_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + ReportJob newReportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can retrieve existing report job. + /// + [Test] + public void TestGetReportJob() { + ReportJob reportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.getReportJob(reportId); + }); + + Assert.NotNull(reportJob); + Assert.AreEqual(reportJob.id, reportId); + } + + /// + /// Test whether we can retrieve report download URL. + /// + [Test] + public void TestGetReportDownloadUrl() { + string url = null; + + Assert.DoesNotThrow(delegate() { + url = reportService.getReportDownloadURL(reportId, ExportFormat.CSV_EXCEL); + }); + + Assert.True(Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)); + + Assert.DoesNotThrow(delegate() { + url = reportService.getReportDownloadURL(reportId, ExportFormat.TSV); + }); + + Assert.True(Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)); + } + } +} diff --git a/tests/Dfp/v201208/StatementBuilderTests.cs b/tests/Dfp/v201208/StatementBuilderTests.cs new file mode 100644 index 00000000000..9928efb0d72 --- /dev/null +++ b/tests/Dfp/v201208/StatementBuilderTests.cs @@ -0,0 +1,275 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using System.Xml; +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; +using NUnit.Framework; +using DateTime = Google.Api.Ads.Dfp.v201208.DateTime; + +namespace Google.Api.Ads.Dfp.Tests.v201208 { + + /// + /// UnitTests for class. + /// + [TestFixture] + public class StatementBuilderTests { + + private static bool StatementsAreEqual(Statement s1, Statement s2) { + // Assumes both Statements are non-null and have non-null properties + if (String.Compare(s1.query, s2.query, true) != 0) { + return false; + } + if (s1.values.Length != s2.values.Length) { + return false; + } + // Assumes Statement values are in the same order + for (int i = 0; i < s1.values.Length; i++) { + if (!StringValueMapEntriesAreEqual(s1.values[i], s2.values[i])) { + return false; + } + } + return true; + } + + private static bool StringValueMapEntriesAreEqual(String_ValueMapEntry entry1, + String_ValueMapEntry entry2) { + return String.Equals(entry1.key, entry2.key) && ValuesAreEqual(entry1.value, entry2.value); + } + + private delegate bool ValueEqualityDelegate(Value value1, Value value2); + + private static bool ValuesAreEqual(Value value1, Value value2) { + Dictionary switcher = + new Dictionary(); + switcher.Add(typeof(TextValue), new ValueEqualityDelegate(TextValuesAreEqual)); + switcher.Add(typeof(NumberValue), new ValueEqualityDelegate(NumberValuesAreEqual)); + switcher.Add(typeof(BooleanValue), new ValueEqualityDelegate(BooleanValuesAreEqual)); + switcher.Add(typeof(DateTimeValue), new ValueEqualityDelegate(DateTimeValuesAreEqual)); + + if (switcher.ContainsKey(value1.GetType())) { + return switcher[value1.GetType()](value1, value2); + } + throw new NotImplementedException(String.Format("Unknown Value type {0}", value1.GetType())); + } + + private static bool TextValuesAreEqual(Value value1, Value value2) { + return String.Equals((value1 as TextValue).value, (value2 as TextValue).value); + } + + private static bool NumberValuesAreEqual(Value value1, Value value2) { + return String.Equals((value1 as NumberValue).value, (value2 as NumberValue).value); + } + + private static bool BooleanValuesAreEqual(Value value1, Value value2) { + return (value1 as BooleanValue).value == (value2 as BooleanValue).value; + } + + private static bool DateTimeValuesAreEqual(Value value1, Value value2) { + DateTime dateTime1 = (value1 as DateTimeValue).value; + DateTime dateTime2 = (value2 as DateTimeValue).value; + return DatesAreEqual(dateTime1.date, dateTime2.date) + && dateTime1.hour == dateTime2.hour + && dateTime1.minute == dateTime2.minute + && dateTime1.second == dateTime2.second + && String.Equals(dateTime1.timeZoneID, dateTime2.timeZoneID); + } + + private static bool DatesAreEqual(Date date1, Date date2) { + return date1.day == date2.day + && date1.month == date2.month + && date1.year == date2.year; + } + + [Test] + public void TestStatementBuilderBlankStatement() { + StatementBuilder statementBuilder = new StatementBuilder(); + + Statement expectedStatement = new Statement(); + expectedStatement.query = ""; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderBasicStatement() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("ID = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE ID = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderIgnoresKeyword() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("WHERE ID = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE ID = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderIncludesKeywordPrefix() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("WHEREWITHALL = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE WHEREWITHALL = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestAllStatementBuilderPartialFunctions() { + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Name, Id") + .From("Geo_Target") + .Where("Targetable = :targetable") + .OrderBy("Id DESC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .Offset(0) + .AddValue("targetable", true) + .IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .RemoveLimitAndOffset(); + Assert.AreEqual(null, statementBuilder.GetOffset()); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "SELECT Name, Id FROM Geo_Target" + + " WHERE Targetable = :targetable ORDER BY Id DESC"; + String_ValueMapEntry targetableEntry = new String_ValueMapEntry(); + targetableEntry.key = "targetable"; + BooleanValue targetableValue = new BooleanValue(); + targetableValue.value = true; + targetableEntry.value = targetableValue; + expectedStatement.values = new String_ValueMapEntry[] {targetableEntry}; + Assert.True(StatementsAreEqual(expectedStatement, statementBuilder.ToStatement())); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesWhere() { + StatementBuilder statementBuilder = new StatementBuilder("WHERE ID = 1") + .Where("ID = 2"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesFrom() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .From("Geo_Table"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesSelect() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Select("Id, Type"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesLimit() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Offset(100); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesIncreaseOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .IncreaseOffsetBy(100); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesRemoveLimitAndOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .RemoveLimitAndOffset(); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithSelect() { + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Id, Type"); + statementBuilder.Query = "SELECT Id, Type FROM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithFrom() { + StatementBuilder statementBuilder = new StatementBuilder() + .From("Geo_Table"); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithWhere() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("Type = City"); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithLimit() { + StatementBuilder statementBuilder = new StatementBuilder() + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithOffset() { + StatementBuilder statementBuilder = new StatementBuilder() + .Offset(100); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + } +} diff --git a/tests/Dfp/v201208/TestUtils.cs b/tests/Dfp/v201208/TestUtils.cs new file mode 100644 index 00000000000..7868670e937 --- /dev/null +++ b/tests/Dfp/v201208/TestUtils.cs @@ -0,0 +1,343 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201208; +using Google.Api.Ads.Dfp.v201208; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; +using System.Threading; +using System.Configuration; +using System.Collections; + +namespace Google.Api.Ads.Dfp.Tests.v201208 { + /// + /// A utility class to assist the testing of v201004 services. + /// + public class TestUtils { + public User GetCurrentUser(DfpUser user) { + return GetUserByEmail(user, new DfpAppConfig().Email); + } + + public User GetTrafficker(DfpUser user) { + return GetUserByEmail(user, "dfp.api.trafficker@gmail.com"); + } + + public User GetSalesperson(DfpUser user) { + return GetUserByEmail(user, "dfp.api.salesperson@gmail.com"); + } + + public User GetUserByEmail(DfpUser user, string email) { + UserService userService = (UserService) user.GetService(DfpService.v201208.UserService); + + // Create a Statement to get all users sorted by name. + Statement statement = new Statement(); + statement.query = string.Format("where email = '{0}' LIMIT 1", email); + + UserPage page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + return page.results[0]; + } else { + return null; + } + } + + public Role GetRole(DfpUser user, string roleName) { + UserService userService = (UserService)user.GetService(DfpService.v201208.UserService); + + // Get all roles. + Role[] roles = userService.getAllRoles(); + foreach (Role role in roles) { + if (role.name == roleName) { + return role; + } + } + return null; + } + + /// + /// Create a test company for running further tests. + /// + /// A test company for running further tests. + public Company CreateCompany(DfpUser user, CompanyType companyType) { + CompanyService companyService = (CompanyService) user.GetService( + DfpService.v201208.CompanyService); + Company company = new Company(); + company.name = string.Format("Company #{0}", GetTimeStamp()); + company.type = companyType; + + return companyService.createCompany(company); + } + + public Order CreateOrder(DfpUser user, long advertiserId, long salespersonId, + long traffickerId) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201208.OrderService); + + Order order = new Order(); + order.name = string.Format("Order #{0}", GetTimeStamp()); + order.advertiserId = advertiserId; + order.salespersonId = salespersonId; + order.traffickerId = traffickerId; + + return orderService.createOrder(order); + } + + public LineItem CreateLineItem(DfpUser user, long orderId, string adUnitId) { + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201208.LineItemService); + + long placementId = CreatePlacement(user, new string[] {adUnitId}).id; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201208.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201208.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + return lineItemService.createLineItem(lineItem); + } + + /// + /// Create a test company for running further tests. + /// + /// A creative for running further tests. + public Creative CreateCreative(DfpUser user, long advertiserId) { + CreativeService creativeService = (CreativeService)user.GetService( + DfpService.v201208.CreativeService); + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", GetTimeStamp()); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.imageName = "image.jpg"; + imageCreative.imageByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + + Size imageSize = new Size(); + imageSize.width = 300; + imageSize.height = 250; + + imageCreative.size = imageSize; + + return creativeService.createCreative(imageCreative); + } + + public LineItemCreativeAssociation CreateLica(DfpUser user, long lineItemId, long creativeId) { + LineItemCreativeAssociationService licaService = + (LineItemCreativeAssociationService)user.GetService( + DfpService.v201208.LineItemCreativeAssociationService); + + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId; + lica.lineItemId = lineItemId; + + return licaService.createLineItemCreativeAssociation(lica); + } + + public AdUnit CreateAdUnit(DfpUser user) { + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201208.InventoryService); + + AdUnit adUnit = new AdUnit(); + adUnit.name = string.Format("Ad_Unit_{0}", GetTimeStamp()); + adUnit.parentId = FindRootAdUnit(user).id; + + // Set the size of possible creatives that can match this ad unit. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + return inventoryService.createAdUnit(adUnit); + } + + public AdUnit FindRootAdUnit(DfpUser user) { + // Get InventoryService. + InventoryService inventoryService = + (InventoryService)user.GetService(DfpService.v201208.InventoryService); + + // Create a Statement to only select the root ad unit. + Statement statement = new Statement(); + statement.query = "WHERE parentId IS NULL LIMIT 500"; + + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + return page.results[0]; + } + + public Placement CreatePlacement(DfpUser user, string[] targetedAdUnitIds) { + // Get InventoryService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201208.PlacementService); + + Placement placement = new Placement(); + placement.name = string.Format("Test placement #{0}", this.GetTimeStamp()); + placement.description = "Test placement"; + placement.targetedAdUnitIds = targetedAdUnitIds; + + return placementService.createPlacement(placement); + } + + public ReportJob CreateReport(DfpUser user) { + // Get ReportService. + ReportService reportService = + (ReportService) user.GetService(DfpService.v201208.ReportService); + + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + return reportService.runReportJob(reportJob); + } + + /// + /// Gets the current timestamp as a string. + /// + /// The current timestamp as a string. + public string GetTimeStamp() { + Thread.Sleep(500); + return (System.DateTime.UtcNow - new System.DateTime(1970, 1, 1)).Ticks. + ToString(); + } + } +} diff --git a/tests/Dfp/v201208/UserServiceTests.cs b/tests/Dfp/v201208/UserServiceTests.cs new file mode 100644 index 00000000000..ebb6b58237a --- /dev/null +++ b/tests/Dfp/v201208/UserServiceTests.cs @@ -0,0 +1,217 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201208; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201208 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class UserServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private UserService userService; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Current user id for running tests. + /// + private long currentUserId; + + /// + /// Default public constructor. + /// + public UserServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + userService = (UserService) user.GetService(DfpService.v201208.UserService); + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + currentUserId = utils.GetCurrentUser(user).id; + } + + /// + /// Test whether we can fetch all roles. + /// + [Test] + public void TestGetAllRoles() { + Role[] roles = null; + + Assert.DoesNotThrow(delegate() { + roles = userService.getAllRoles(); + }); + Assert.NotNull(roles); + Assert.GreaterOrEqual(roles.Length, 0); + } + + /// + /// Test whether we can fetch the current user. + /// + [Test] + public void TestGetCurrentUser() { + User user = null; + + Assert.DoesNotThrow(delegate() { + user = userService.getCurrentUser(); + }); + + Assert.NotNull(user); + Assert.AreEqual(user.id, currentUserId); + } + + /// + /// Test whether we can fetch an existing user. + /// + [Test] + public void TestGetUser() { + User user = null; + + Assert.DoesNotThrow(delegate() { + user = userService.getUser(salespersonId); + }); + + Assert.NotNull(user); + Assert.AreEqual(user.id, salespersonId); + } + + /// + /// Test whether we can fetch a list of existing users that match given + /// statement. + /// + [Test] + public void TestGetUsersByStatement() { + Statement statement = new Statement(); + statement.query = "ORDER BY name LIMIT 500"; + + UserPage page = null; + + Assert.DoesNotThrow(delegate() { + page = userService.getUsersByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + + List salesPersonIds = new List(); + List traffickerIds = new List(); + + foreach(User tempUser in page.results) { + if (tempUser.roleName == "Salesperson") { + salesPersonIds.Add(tempUser.id); + } else if (tempUser.roleName == "Trafficker") { + traffickerIds.Add(tempUser.id); + } + } + Assert.Contains(salespersonId, salesPersonIds); + Assert.Contains(traffickerId, traffickerIds); + } + + /// + /// Test whether we can deactivate and activate a user. + /// + [Test] + public void TestPerformUserAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = {0}", salespersonId); + + DeactivateUsers action = new DeactivateUsers(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = userService.performUserAction(action, statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + + // Activate the user again. + + Assert.DoesNotThrow(delegate() { + result = userService.performUserAction(new ActivateUsers(), statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update a user. + /// + [Test] + public void TestUpdateUser() { + User user = userService.getUser(salespersonId); + user.preferredLocale = (user.preferredLocale == "fr_FR")? "en_US" : "fr_FR"; + + User newUser = null; + + Assert.DoesNotThrow(delegate() { + newUser = userService.updateUser(user); + }); + + Assert.NotNull(newUser); + Assert.AreEqual(newUser.id, user.id); + Assert.AreEqual(newUser.preferredLocale, user.preferredLocale); + } + + /// + /// Test whether we can update a list of users. + /// + [Test] + public void TestUpdateUsers() { + User user = userService.getUser(salespersonId); + user.preferredLocale = (user.preferredLocale == "fr_FR")? "en_US" : "fr_FR"; + + User[] newUsers = null; + + Assert.DoesNotThrow(delegate() { + newUsers = userService.updateUsers(new User[] {user}); + }); + + Assert.NotNull(newUsers); + Assert.AreEqual(newUsers.Length, 1); + Assert.AreEqual(newUsers[0].id, user.id); + Assert.AreEqual(newUsers[0].preferredLocale, user.preferredLocale); + } + } +} diff --git a/tests/Dfp/v201211/CompanyServiceTests.cs b/tests/Dfp/v201211/CompanyServiceTests.cs new file mode 100644 index 00000000000..10799d9da62 --- /dev/null +++ b/tests/Dfp/v201211/CompanyServiceTests.cs @@ -0,0 +1,192 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201211 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class CompanyServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private CompanyService companyService; + + /// + /// The company to be used for further tests. + /// + private Company testCompany1 = null; + + /// + /// The company to be used for further tests. + /// + private Company testCompany2 = null; + + /// + /// Default public constructor. + /// + public CompanyServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + companyService = (CompanyService) user.GetService(DfpService.v201211.CompanyService); + testCompany1 = utils.CreateCompany(user, CompanyType.ADVERTISER); + testCompany2 = utils.CreateCompany(user, CompanyType.ADVERTISER); + } + + + /// + /// Test whether we can create a company. + /// + [Test] + public void TestCreateCompany() { + Company company = new Company(); + company.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company.type = CompanyType.ADVERTISER; + + Company newCompany = null; + Assert.DoesNotThrow(delegate() { + newCompany = companyService.createCompany(company); + }); + + Assert.NotNull(newCompany); + Assert.AreEqual(company.name, newCompany.name); + Assert.AreEqual(company.type, newCompany.type); + } + + /// + /// Test whether we can create a list of companies. + /// + [Test] + public void TestCreateCompanies() { + Company company1 = new Company(); + company1.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company1.type = CompanyType.ADVERTISER; + + Company company2 = new Company(); + company2.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company2.type = CompanyType.ADVERTISER; + + Company[] newCompanies = null; + Assert.DoesNotThrow(delegate() { + newCompanies = companyService.createCompanies(new Company[] {company1, company2}); + }); + + Assert.NotNull(newCompanies); + Assert.AreEqual(newCompanies.Length, 2); + + Assert.AreEqual(company1.name, newCompanies[0].name); + Assert.AreEqual(company1.type, newCompanies[0].type); + Assert.AreEqual(company2.name, newCompanies[1].name); + Assert.AreEqual(company2.type, newCompanies[1].type); + } + + /// + /// Test whether we can fetch an existing company. + /// + [Test] + public void TestGetCompany() { + Company company1 = null; + + Assert.DoesNotThrow(delegate() { + company1 = companyService.getCompany(testCompany1.id); + }); + + Assert.NotNull(company1); + Assert.AreEqual(testCompany1.id, company1.id); + Assert.AreEqual(testCompany1.name, company1.name); + } + + /// + /// Test whether we can fetch a list of existing companies that match given + /// statement. + /// + [Test] + public void TestGetCompaniesByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = {0} ORDER BY name LIMIT 1", testCompany1.id); + CompanyPage page = null; + + Assert.DoesNotThrow(delegate() { + page = companyService.getCompaniesByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.results.Length, 1); + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].id, testCompany1.id); + Assert.AreEqual(page.results[0].name, testCompany1.name); + } + + /// + /// Test whether we can update a company. + /// + [Test] + public void TestUpdateCompany() { + testCompany1.name = "Corp " + testCompany1.name; + Company newCompany = null; + + Assert.DoesNotThrow(delegate() { + newCompany = companyService.updateCompany(testCompany1); + }); + + Assert.NotNull(newCompany); + Assert.AreEqual(newCompany.id, testCompany1.id); + Assert.AreEqual(newCompany.name, testCompany1.name); + } + + /// + /// Test whether we can update a list of companies. + /// + [Test] + public void TestUpdateCompanies() { + testCompany1.name = "Corp " + testCompany1.name; + testCompany2.name = "Corp " + testCompany2.name; + + Company[] newCompanies = null; + + Assert.DoesNotThrow(delegate() { + newCompanies = companyService.updateCompanies(new Company[] {testCompany1, testCompany2}); + }); + + Assert.NotNull(newCompanies); + Assert.AreEqual(newCompanies.Length, 2); + + Assert.AreEqual(testCompany1.name, newCompanies[0].name); + Assert.AreEqual(testCompany1.type, newCompanies[0].type); + Assert.AreEqual(testCompany2.name, newCompanies[1].name); + Assert.AreEqual(testCompany2.type, newCompanies[1].type); + } + } +} diff --git a/tests/Dfp/v201211/CreativeServiceTests.cs b/tests/Dfp/v201211/CreativeServiceTests.cs new file mode 100644 index 00000000000..7895a55b16d --- /dev/null +++ b/tests/Dfp/v201211/CreativeServiceTests.cs @@ -0,0 +1,266 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201211 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class CreativeServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private CreativeService creativeService; + + /// + /// The advertiser company id to be used for running tests. + /// + private long advertiserId = 0; + + /// + /// The creative 1 to be used for running tests. + /// + private Creative creative1 = null; + + /// + /// The creative 2 to be used for running tests. + /// + private Creative creative2 = null; + + /// + /// Default public constructor. + /// + public CreativeServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + creativeService = (CreativeService)user.GetService(DfpService.v201211.CreativeService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + creative1 = utils.CreateCreative(user, advertiserId); + creative2 = utils.CreateCreative(user, advertiserId); + } + + /// + /// Test whether we can create a creative. + /// + [Test] + public void TestCreateCreative() { + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", new TestUtils().GetTimeStamp()); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.imageName = "image.jpg"; + imageCreative.imageByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + + Size imageSize = new Size(); + imageSize.width = 300; + imageSize.height = 250; + + imageCreative.size = imageSize; + + Creative newCreative = null; + + Assert.DoesNotThrow(delegate() { + newCreative = creativeService.createCreative(imageCreative); + }); + + Assert.NotNull(newCreative); + Assert.That(newCreative is ImageCreative); + Assert.AreEqual(newCreative.advertiserId, imageCreative.advertiserId); + Assert.AreEqual(newCreative.name, imageCreative.name); + } + + /// + /// Test whether we can create a list of creatives. + /// + [Test] + public void TestCreateCreatives() { + ImageCreative imageCreative1 = new ImageCreative(); + imageCreative1.name = string.Format("Image creative #{0}", new TestUtils().GetTimeStamp()); + imageCreative1.advertiserId = advertiserId; + imageCreative1.destinationUrl = "http://www.google.com"; + imageCreative1.imageName = "image.jpg"; + imageCreative1.imageByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + + Size imageSize1 = new Size(); + imageSize1.width = 300; + imageSize1.height = 250; + + imageCreative1.size = imageSize1; + + ImageCreative imageCreative2 = new ImageCreative(); + imageCreative2.name = string.Format("Image creative #{0}", new TestUtils().GetTimeStamp()); + imageCreative2.advertiserId = advertiserId; + imageCreative2.destinationUrl = "http://www.google.com"; + imageCreative2.imageName = "image.jpg"; + imageCreative2.imageByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/skyscraper.jpg"); + + Size imageSize2 = new Size(); + imageSize2.width = 120; + imageSize2.height = 600; + + imageCreative2.size = imageSize2; + + Creative[] newCreatives = null; + + Assert.DoesNotThrow(delegate() { + newCreatives = creativeService.createCreatives(new Creative[] {imageCreative1, + imageCreative2}); + }); + + Assert.NotNull(newCreatives); + Assert.AreEqual(newCreatives.Length, 2); + Assert.NotNull(newCreatives[0]); + Assert.That(newCreatives[0] is ImageCreative); + Assert.AreEqual(newCreatives[0].advertiserId, imageCreative1.advertiserId); + Assert.AreEqual(newCreatives[0].name, imageCreative1.name); + Assert.NotNull(newCreatives[1]); + Assert.That(newCreatives[1] is ImageCreative); + Assert.AreEqual(newCreatives[1].advertiserId, imageCreative2.advertiserId); + Assert.AreEqual(newCreatives[1].name, imageCreative2.name); + } + + /// + /// Test whether we can fetch an existing creative. + /// + [Test] + public void TestGetCreative() { + Creative localCreative = null; + Assert.DoesNotThrow(delegate() { + localCreative = creativeService.getCreative(creative1.id); + }); + Assert.NotNull(localCreative); + Assert.AreEqual(localCreative.id, creative1.id); + Assert.AreEqual(localCreative.GetType(), creative1.GetType()); + Assert.AreEqual(localCreative.name, creative1.name); + Assert.AreEqual(localCreative.advertiserId, creative1.advertiserId); + Assert.AreEqual(localCreative.previewUrl, creative1.previewUrl); + Assert.AreEqual(localCreative.size.height, creative1.size.height); + Assert.AreEqual(localCreative.size.width, creative1.size.width); + } + + /// + /// Test whether we can fetch a list of existing creatives that match given + /// statement. + /// + [Test] + public void TestGetCreativesByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 500", creative1.id); + + CreativePage page = null; + + Assert.DoesNotThrow(delegate() { + page = creativeService.getCreativesByStatement(statement); + }); + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].id, creative1.id); + Assert.AreEqual(page.results[0].GetType(), creative1.GetType()); + Assert.AreEqual(page.results[0].name, creative1.name); + Assert.AreEqual(page.results[0].advertiserId, creative1.advertiserId); + Assert.AreEqual(page.results[0].previewUrl, creative1.previewUrl); + Assert.AreEqual(page.results[0].size.height, creative1.size.height); + Assert.AreEqual(page.results[0].size.width, creative1.size.width); + } + + /// + /// Test whether we can update a creative. + /// + [Test] + public void TestUpdateCreative() { + ImageCreative imageCreative = (ImageCreative) creative1; + imageCreative.destinationUrl = "http://news.google.com"; + + Creative newCreative = null; + + Assert.DoesNotThrow(delegate() { + newCreative = creativeService.updateCreative(creative1); + }); + + Assert.NotNull(newCreative); + Assert.AreEqual(newCreative.id, creative1.id); + Assert.AreEqual(newCreative.name, creative1.name); + Assert.AreEqual(newCreative.advertiserId, creative1.advertiserId); + Assert.AreEqual(newCreative.size.height, creative1.size.height); + Assert.AreEqual(newCreative.size.width, creative1.size.width); + Assert.That(newCreative is ImageCreative); + Assert.AreEqual((newCreative as ImageCreative).destinationUrl, imageCreative.destinationUrl); + } + + /// + /// Test whether we can update a list of creatives. + /// + [Test] + public void TestUpdateCreatives() { + ImageCreative imageCreative1 = (ImageCreative) creative1; + imageCreative1.destinationUrl = "http://news.google.com"; + + ImageCreative imageCreative2 = (ImageCreative) creative2; + imageCreative2.destinationUrl = "http://finance.google.com"; + + Creative[] newCreatives = null; + + Assert.DoesNotThrow(delegate() { + newCreatives = creativeService.updateCreatives(new Creative[] {creative1, creative2}); + }); + + Assert.NotNull(newCreatives); + Assert.AreEqual(newCreatives.Length, 2); + + Assert.AreEqual(newCreatives[0].id, creative1.id); + Assert.AreEqual(newCreatives[0].name, creative1.name); + Assert.AreEqual(newCreatives[0].advertiserId, creative1.advertiserId); + Assert.AreEqual(newCreatives[0].size.height, creative1.size.height); + Assert.AreEqual(newCreatives[0].size.width, creative1.size.width); + Assert.That(newCreatives[0] is ImageCreative); + Assert.AreEqual((newCreatives[0] as ImageCreative).destinationUrl, + imageCreative1.destinationUrl); + + Assert.AreEqual(newCreatives[1].id, creative2.id); + Assert.AreEqual(newCreatives[1].name, creative2.name); + Assert.AreEqual(newCreatives[1].advertiserId, creative2.advertiserId); + Assert.AreEqual(newCreatives[1].size.height, creative2.size.height); + Assert.AreEqual(newCreatives[1].size.width, creative2.size.width); + Assert.That(newCreatives[1] is ImageCreative); + Assert.AreEqual((newCreatives[1] as ImageCreative).destinationUrl, + imageCreative2.destinationUrl); + } + } +} diff --git a/tests/Dfp/v201211/ForecastServiceTests.cs b/tests/Dfp/v201211/ForecastServiceTests.cs new file mode 100644 index 00000000000..0a6e079a0e0 --- /dev/null +++ b/tests/Dfp/v201211/ForecastServiceTests.cs @@ -0,0 +1,171 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201211 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class ForecastServiceTests : BaseTests { + /// + /// ForecastService object to be used in this test. + /// + private ForecastService forecastService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Placement id for running tests. + /// + private long placementId; + + /// + /// Line item id for running tests. + /// + private long lineItemId; + + /// + /// Default public constructor. + /// + public ForecastServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + forecastService = (ForecastService)user.GetService(DfpService.v201211.ForecastService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + placementId = utils.CreatePlacement(user, new string[] {adUnitId}).id; + lineItemId = utils.CreateLineItem(user, orderId, adUnitId).id; + } + + /// + /// Test whether we can get a forecast for given line item. + /// + [Test] + public void TestGetForecast() { + TestUtils utils = new TestUtils(); + + LineItem lineItem = new LineItem(); + lineItem.name = string.Format("Line item #{0}", utils.GetTimeStamp()); + + lineItem.orderId = orderId; + + lineItem.targeting = new Targeting(); + lineItem.targeting.inventoryTargeting = new InventoryTargeting(); + lineItem.targeting.inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + Size size1 = new Size(); + size1.width = 300; + size1.height = 250; + + Size size2 = new Size(); + size2.width = 120; + size2.height = 600; + + // Create the creative placeholders. + CreativePlaceholder creativePlaceholder1 = new CreativePlaceholder(); + creativePlaceholder1.size = size1; + + CreativePlaceholder creativePlaceholder2 = new CreativePlaceholder(); + creativePlaceholder1.size = size2; + + lineItem.creativePlaceholders = + new CreativePlaceholder[] {creativePlaceholder1, creativePlaceholder2}; + + lineItem.lineItemType = LineItemType.STANDARD; + + // Set start date time and end date time. + lineItem.startDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddDays(1)); + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000; + + lineItem.creativeRotationType = CreativeRotationType.EVEN; + lineItem.discountType = LineItemDiscountType.PERCENTAGE; + + lineItem.unitsBought = 500000; + lineItem.unitType = UnitType.IMPRESSIONS; + + Forecast forecast = null; + Assert.DoesNotThrow(delegate() { + forecast = forecastService.getForecast(lineItem); + }); + Assert.NotNull(forecast); + Assert.AreEqual(forecast.orderId, orderId); + Assert.AreEqual(forecast.unitType, lineItem.unitType); + } + + /// + /// Test whether we can get a forecast for existing line item. + /// + [Test] + public void TestGetForecastById() { + Forecast forecast = null; + Assert.DoesNotThrow(delegate() { + forecast = forecastService.getForecastById(lineItemId); + }); + Assert.NotNull(forecast); + Assert.AreEqual(forecast.orderId, orderId); + } + } +} diff --git a/tests/Dfp/v201211/InventoryServiceTests.cs b/tests/Dfp/v201211/InventoryServiceTests.cs new file mode 100644 index 00000000000..199c8a6aafe --- /dev/null +++ b/tests/Dfp/v201211/InventoryServiceTests.cs @@ -0,0 +1,295 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201211 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class InventoryServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private InventoryService inventoryService; + + /// + /// The ad unit 1 for running tests. + /// + private AdUnit adUnit1; + + /// + /// The ad unit 2 for running tests. + /// + private AdUnit adUnit2; + + /// + /// Default public constructor. + /// + public InventoryServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + inventoryService = (InventoryService) user.GetService(DfpService.v201211.InventoryService); + adUnit1 = utils.CreateAdUnit(user); + adUnit2 = utils.CreateAdUnit(user); + } + + /// + /// Test whether we can create an ad unit. + /// + [Test] + public void TestCreateAdUnit() { + AdUnit localAdUnit = new AdUnit(); + localAdUnit.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit.parentId = adUnit1.id; + + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + localAdUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + + AdUnit newAdUnit = null; + + Assert.DoesNotThrow(delegate() { + newAdUnit = inventoryService.createAdUnit(localAdUnit); + }); + + Assert.NotNull(newAdUnit); + Assert.AreEqual(newAdUnit.name, localAdUnit.name); + Assert.AreEqual(newAdUnit.parentId, localAdUnit.parentId); + Assert.AreEqual(newAdUnit.parentId, adUnit1.id); + Assert.AreEqual(newAdUnit.status, localAdUnit.status); + Assert.AreEqual(newAdUnit.targetWindow, localAdUnit.targetWindow); + } + + /// + /// Test whether we can create a list of ad units. + /// + [Test] + public void TestCreateAdUnits() { + // Create ad unit 1. + AdUnit localAdUnit1 = new AdUnit(); + localAdUnit1.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit1.parentId = adUnit1.id; + + Size size1 = new Size(); + size1.width = 300; + size1.height = 250; + + AdUnitSize adUnitSize1 = new AdUnitSize(); + adUnitSize1.size = size1; + adUnitSize1.environmentType = EnvironmentType.BROWSER; + + localAdUnit1.adUnitSizes = new AdUnitSize[] {adUnitSize1}; + + // Create ad unit 2. + AdUnit localAdUnit2 = new AdUnit(); + localAdUnit2.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit2.parentId = adUnit1.id; + + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + + AdUnitSize adUnitSize2 = new AdUnitSize(); + adUnitSize2.size = size2; + adUnitSize2.environmentType = EnvironmentType.BROWSER; + + localAdUnit2.adUnitSizes = new AdUnitSize[] {adUnitSize2}; + + AdUnit[] newAdUnits = null; + + Assert.DoesNotThrow(delegate() { + newAdUnits = inventoryService.createAdUnits(new AdUnit[] {localAdUnit1, localAdUnit2}); + }); + + Assert.NotNull(newAdUnits); + Assert.AreEqual(newAdUnits.Length, 2); + + Assert.AreEqual(newAdUnits[0].name, localAdUnit1.name); + Assert.AreEqual(newAdUnits[0].parentId, localAdUnit1.parentId); + Assert.AreEqual(newAdUnits[0].parentId, adUnit1.id); + Assert.AreEqual(newAdUnits[0].status, localAdUnit1.status); + Assert.AreEqual(newAdUnits[0].targetWindow, localAdUnit1.targetWindow); + + Assert.AreEqual(newAdUnits[1].name, localAdUnit2.name); + Assert.AreEqual(newAdUnits[1].parentId, localAdUnit2.parentId); + Assert.AreEqual(newAdUnits[1].parentId, adUnit1.id); + Assert.AreEqual(newAdUnits[1].status, localAdUnit2.status); + Assert.AreEqual(newAdUnits[1].targetWindow, localAdUnit2.targetWindow); + } + + /// + /// Test whether we can fetch a list of existing ad units that match given + /// statement. + /// + [Test] + public void TestGetAdUnitsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", adUnit1.id); + + AdUnitPage page = null; + + Assert.DoesNotThrow(delegate() { + page = inventoryService.getAdUnitsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results[0]); + + Assert.AreEqual(page.results[0].name, adUnit1.name); + Assert.AreEqual(page.results[0].parentId, adUnit1.parentId); + Assert.AreEqual(page.results[0].id, adUnit1.id); + Assert.AreEqual(page.results[0].status, adUnit1.status); + Assert.AreEqual(page.results[0].targetWindow, adUnit1.targetWindow); + } + + /// + /// Test whether we can deactivate an ad unit. + /// + [Test] + public void TestPerformAdUnitAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", adUnit1.id); + + UpdateResult result = null; + Assert.DoesNotThrow(delegate() { + result = inventoryService.performAdUnitAction(new DeactivateAdUnits(), statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update an ad unit. + /// + [Test] + public void TestUpdateAdUnit() { + List adUnitSizes = new List(adUnit1.adUnitSizes); + + Size size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit1.adUnitSizes = adUnitSizes.ToArray(); + + AdUnit newAdUnit = null; + Assert.DoesNotThrow(delegate() { + newAdUnit = inventoryService.updateAdUnit(adUnit1); + }); + + Assert.NotNull(newAdUnit); + + Assert.AreEqual(newAdUnit.name, adUnit1.name); + Assert.AreEqual(newAdUnit.parentId, adUnit1.parentId); + Assert.AreEqual(newAdUnit.id, adUnit1.id); + Assert.AreEqual(newAdUnit.status, adUnit1.status); + Assert.AreEqual(newAdUnit.targetWindow, adUnit1.targetWindow); + Assert.AreEqual(newAdUnit.adUnitSizes.Length, adUnit1.adUnitSizes.Length); + } + + /// + /// Test whether we can update a list of an ad units. + /// + [Test] + public void TestUpdateAdUnits() { + List adUnitSizes = null; + Size size = null; + + // Modify ad unit 1. + adUnitSizes = new List(adUnit1.adUnitSizes); + size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit1.adUnitSizes = adUnitSizes.ToArray(); + + // Modify ad unit 2. + adUnitSizes = new List(adUnit2.adUnitSizes); + size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit2.adUnitSizes = adUnitSizes.ToArray(); + + AdUnit[] newAdUnits = null; + Assert.DoesNotThrow(delegate() { + newAdUnits = inventoryService.updateAdUnits(new AdUnit[] {adUnit1, adUnit2}); + }); + + Assert.NotNull(newAdUnits); + Assert.AreEqual(newAdUnits.Length, 2); + + Assert.AreEqual(newAdUnits[0].name, adUnit1.name); + Assert.AreEqual(newAdUnits[0].parentId, adUnit1.parentId); + Assert.AreEqual(newAdUnits[0].id, adUnit1.id); + Assert.AreEqual(newAdUnits[0].status, adUnit1.status); + Assert.AreEqual(newAdUnits[0].targetWindow, adUnit1.targetWindow); + Assert.AreEqual(newAdUnits[0].adUnitSizes.Length, adUnit1.adUnitSizes.Length); + + Assert.AreEqual(newAdUnits[1].name, adUnit2.name); + Assert.AreEqual(newAdUnits[1].parentId, adUnit2.parentId); + Assert.AreEqual(newAdUnits[1].id, adUnit2.id); + Assert.AreEqual(newAdUnits[1].status, adUnit2.status); + Assert.AreEqual(newAdUnits[1].targetWindow, adUnit2.targetWindow); + Assert.AreEqual(newAdUnits[1].adUnitSizes.Length, adUnit2.adUnitSizes.Length); + } + } +} diff --git a/tests/Dfp/v201211/LineItemCreativeAssociationServiceTests.cs b/tests/Dfp/v201211/LineItemCreativeAssociationServiceTests.cs new file mode 100644 index 00000000000..72fbe1da845 --- /dev/null +++ b/tests/Dfp/v201211/LineItemCreativeAssociationServiceTests.cs @@ -0,0 +1,303 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201211 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class LineItemCreativeAssociationServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private LineItemCreativeAssociationService licaService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Creative id 1 for running tests. + /// + private long creativeId1; + + /// + /// Creative id 2 for running tests. + /// + private long creativeId2; + + /// + /// Creative id 3 for running tests. + /// + private long creativeId3; + + /// + /// Creative id 4 for running tests. + /// + private long creativeId4; + + /// + /// Line item id 1 for running tests. + /// + private long lineItemId1; + + /// + /// Line item id 2 for running tests. + /// + private long lineItemId2; + + /// + /// Line item id 3 for running tests. + /// + private long lineItemId3; + + /// + /// Line item id 4 for running tests. + /// + private long lineItemId4; + + /// + /// Line item creative association 1 for running tests. + /// + private LineItemCreativeAssociation lica1; + + /// + /// Line item creative association 2 for running tests. + /// + private LineItemCreativeAssociation lica2; + + /// + /// Default public constructor. + /// + public LineItemCreativeAssociationServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + licaService = (LineItemCreativeAssociationService) user.GetService( + DfpService.v201211.LineItemCreativeAssociationService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + + lineItemId1 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId2 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId3 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId4 = utils.CreateLineItem(user, orderId, adUnitId).id; + + creativeId1 = utils.CreateCreative(user, advertiserId).id; + creativeId2 = utils.CreateCreative(user, advertiserId).id; + creativeId3 = utils.CreateCreative(user, advertiserId).id; + creativeId4 = utils.CreateCreative(user, advertiserId).id; + + lica1 = utils.CreateLica(user, lineItemId3, creativeId3); + lica2 = utils.CreateLica(user, lineItemId4, creativeId4); + } + + /// + /// Test whether we can create a line item creative association. + /// + [Test] + public void TestCreateLineItemCreativeAssociation() { + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId1; + lica.lineItemId = lineItemId1; + + LineItemCreativeAssociation newLica = null; + + Assert.DoesNotThrow(delegate() { + newLica = licaService.createLineItemCreativeAssociation(lica); + }); + + Assert.NotNull(newLica); + Assert.AreEqual(newLica.creativeId, lica.creativeId); + Assert.AreEqual(newLica.lineItemId, lica.lineItemId); + } + + /// + /// Test whether we can create a list of line item creative associations. + /// + [Test] + public void TestCreateLineItemCreativeAssociations() { + LineItemCreativeAssociation localLica1 = new LineItemCreativeAssociation(); + localLica1.creativeId = creativeId1; + localLica1.lineItemId = lineItemId1; + + LineItemCreativeAssociation localLica2 = new LineItemCreativeAssociation(); + localLica2.creativeId = creativeId2; + localLica2.lineItemId = lineItemId2; + + LineItemCreativeAssociation[] newLicas = null; + + Assert.DoesNotThrow(delegate() { + newLicas = licaService.createLineItemCreativeAssociations( + new LineItemCreativeAssociation[] {localLica1, localLica2}); + }); + + Assert.NotNull(newLicas); + Assert.AreEqual(newLicas.Length, 2); + + Assert.NotNull(newLicas[0]); + Assert.AreEqual(newLicas[0].creativeId, localLica1.creativeId); + Assert.AreEqual(newLicas[0].lineItemId, localLica1.lineItemId); + + Assert.NotNull(newLicas[1]); + Assert.AreEqual(newLicas[1].creativeId, localLica2.creativeId); + Assert.AreEqual(newLicas[1].lineItemId, localLica2.lineItemId); + } + + /// + /// Test whether we can fetch an existing line item creative association. + /// + [Test] + public void TestGetLineItemCreativeAssociation() { + LineItemCreativeAssociation newLica = null; + + Assert.DoesNotThrow(delegate() { + newLica = licaService.getLineItemCreativeAssociation(lineItemId3, creativeId3); + }); + + Assert.NotNull(newLica); + Assert.AreEqual(newLica.creativeId, lica1.creativeId); + Assert.AreEqual(newLica.lineItemId, lica1.lineItemId); + } + + /// + /// Test whether we can fetch a list of existing line item creative + /// associations that match given statement. + /// + [Test] + public void TestGetLineItemCreativeAssociationsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE lineItemId = '{0}' LIMIT 500", lineItemId3); + + LineItemCreativeAssociationPage page = null; + Assert.DoesNotThrow(delegate() { + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + }); + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].creativeId, lica1.creativeId); + Assert.AreEqual(page.results[0].lineItemId, lica1.lineItemId); + } + + /// + /// Test whether we can deactivate a line item create association. + /// + [Test] + public void TestPerformLineItemCreativeAssociationAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE lineItemId = '{0}' LIMIT 1", lineItemId3); + + DeactivateLineItemCreativeAssociations action = new DeactivateLineItemCreativeAssociations(); + + UpdateResult result = null; + Assert.DoesNotThrow(delegate() { + result = licaService.performLineItemCreativeAssociationAction(action, statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update a line item creative association. + /// + [Test] + public void TestUpdateLineItemCreativeAssociation() { + lica1.destinationUrl = "http://news.google.com"; + + LineItemCreativeAssociation newLica = null; + Assert.DoesNotThrow(delegate() { + newLica = licaService.updateLineItemCreativeAssociation(lica1); + }); + + Assert.NotNull(newLica); + Assert.AreEqual(newLica.creativeId, lica1.creativeId); + Assert.AreEqual(newLica.lineItemId, lica1.lineItemId); + Assert.AreEqual(newLica.destinationUrl, lica1.destinationUrl); + } + + /// + /// Test whether we can update a list of line item creative associations. + /// + [Test] + public void TestUpdateLineItemCreativeAssociations() { + lica1.destinationUrl = "http://news.google.com"; + lica2.destinationUrl = "http://news.google.com"; + + LineItemCreativeAssociation[] newLicas = null; + Assert.DoesNotThrow(delegate() { + newLicas = licaService.updateLineItemCreativeAssociations( + new LineItemCreativeAssociation[] {lica1, lica2}); + }); + + Assert.NotNull(newLicas); + Assert.AreEqual(newLicas.Length, 2); + + Assert.NotNull(newLicas[0]); + Assert.AreEqual(newLicas[0].creativeId, lica1.creativeId); + Assert.AreEqual(newLicas[0].lineItemId, lica1.lineItemId); + + Assert.NotNull(newLicas[1]); + Assert.AreEqual(newLicas[1].creativeId, lica2.creativeId); + Assert.AreEqual(newLicas[1].lineItemId, lica2.lineItemId); + } + } +} diff --git a/tests/Dfp/v201211/LineItemServiceTests.cs b/tests/Dfp/v201211/LineItemServiceTests.cs new file mode 100644 index 00000000000..b671c771fa5 --- /dev/null +++ b/tests/Dfp/v201211/LineItemServiceTests.cs @@ -0,0 +1,486 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201211 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class LineItemServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private LineItemService lineItemService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Placement id for running tests. + /// + private long placementId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Line item 1 for running tests. + /// + private LineItem lineItem1; + + /// + /// Line item 2 for running tests. + /// + private LineItem lineItem2; + + /// + /// Default public constructor. + /// + public LineItemServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + lineItemService = (LineItemService)user.GetService(DfpService.v201211.LineItemService); + + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + placementId = utils.CreatePlacement(user, new string[] {adUnitId}).id; + lineItem1 = utils.CreateLineItem(user, orderId, adUnitId); + lineItem2 = utils.CreateLineItem(user, orderId, adUnitId); + } + + /// + /// Test whether we can create a line item creative association. + /// + [Test] + public void TestCreateLineItem() { + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201211.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201211.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + LineItem localLineItem = null; + + Assert.DoesNotThrow(delegate() { + localLineItem = lineItemService.createLineItem(lineItem); + }); + + Assert.NotNull(localLineItem); + Assert.AreEqual(localLineItem.name, lineItem.name); + Assert.AreEqual(localLineItem.orderId, lineItem.orderId); + } + + /// + /// Test whether we can create a list of line items. + /// + [Test] + public void TestCreateLineItems() { + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201211.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201211.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + // Create an array to store local line item objects. + LineItem[] lineItems = new LineItem[2]; + + for (int i = 0; i < lineItems.Length; i++) { + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + lineItems[i] = lineItem; + } + + LineItem[] localLineItems = null; + + Assert.DoesNotThrow(delegate() { + localLineItems = lineItemService.createLineItems(lineItems); + }); + + Assert.NotNull(localLineItems); + Assert.AreEqual(localLineItems.Length, 2); + + Assert.AreEqual(localLineItems[0].name, lineItems[0].name); + Assert.AreEqual(localLineItems[0].orderId, lineItems[0].orderId); + + Assert.AreEqual(localLineItems[1].name, lineItems[1].name); + Assert.AreEqual(localLineItems[1].orderId, lineItems[1].orderId); + } + + /// + /// Test whether we can fetch an existing line item. + /// + [Test] + public void TestGetLineItem() { + LineItem localLineItem = null; + + Assert.DoesNotThrow(delegate() { + localLineItem = lineItemService.getLineItem(lineItem1.id); + }); + + Assert.NotNull(localLineItem); + Assert.AreEqual(localLineItem.id, lineItem1.id); + Assert.AreEqual(localLineItem.name, lineItem1.name); + Assert.AreEqual(localLineItem.orderId, lineItem1.orderId); + } + + /// + /// Test whether we can fetch a list of existing line items that match given + /// statement. + /// + [Test] + public void TestGetLineItemsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", lineItem1.id); + + LineItemPage page = null; + + Assert.DoesNotThrow(delegate() { + page = lineItemService.getLineItemsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results); + Assert.AreEqual(page.results[0].id, lineItem1.id); + Assert.AreEqual(page.results[0].name, lineItem1.name); + Assert.AreEqual(page.results[0].orderId, lineItem1.orderId); + } + + /// + /// Test whether we can activate a line item. + /// + [Test] + public void TestPerformLineItemAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE orderId = '{0}' and status = '{1}'", + orderId, ComputedStatus.NEEDS_CREATIVES); + + ActivateLineItems action = new ActivateLineItems(); + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = lineItemService.performLineItemAction(action, statement); + }); + + Assert.NotNull(result); + } + + /// + /// Test whether we can update a line item. + /// + [Test] + public void TestUpdateLineItem() { + lineItem1.deliveryRateType = DeliveryRateType.AS_FAST_AS_POSSIBLE; + + LineItem localLineItem = null; + Assert.DoesNotThrow(delegate() { + localLineItem = lineItemService.updateLineItem(lineItem1); + }); + + Assert.NotNull(localLineItem); + Assert.AreEqual(localLineItem.id, lineItem1.id); + Assert.AreEqual(localLineItem.name, lineItem1.name); + Assert.AreEqual(localLineItem.orderId, lineItem1.orderId); + Assert.AreEqual(localLineItem.deliveryRateType, lineItem1.deliveryRateType); + } + + /// + /// Test whether we can update a list of line items. + /// + [Test] + public void TestUpdateLineItems() { + lineItem1.costPerUnit.microAmount = 3500000; + lineItem2.costPerUnit.microAmount = 3500000; + + LineItem[] localLineItems = null; + + Assert.DoesNotThrow(delegate() { + localLineItems = lineItemService.updateLineItems(new LineItem[] {lineItem1, lineItem2}); + }); + + Assert.NotNull(localLineItems); + Assert.AreEqual(localLineItems.Length, 2); + + Assert.AreEqual(localLineItems[0].id, lineItem1.id); + Assert.AreEqual(localLineItems[0].name, lineItem1.name); + Assert.AreEqual(localLineItems[0].orderId, lineItem1.orderId); + Assert.AreEqual(localLineItems[0].costPerUnit.microAmount, lineItem1.costPerUnit.microAmount); + + Assert.AreEqual(localLineItems[1].id, lineItem2.id); + Assert.AreEqual(localLineItems[1].name, lineItem2.name); + Assert.AreEqual(localLineItems[1].orderId, lineItem2.orderId); + Assert.AreEqual(localLineItems[1].costPerUnit.microAmount, lineItem2.costPerUnit.microAmount); + } + } +} diff --git a/tests/Dfp/v201211/OrderServiceTests.cs b/tests/Dfp/v201211/OrderServiceTests.cs new file mode 100644 index 00000000000..b534bf4943f --- /dev/null +++ b/tests/Dfp/v201211/OrderServiceTests.cs @@ -0,0 +1,229 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfp.Tests.v201211 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class OrderServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private OrderService orderService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Default public constructor. + /// + public OrderServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + orderService = (OrderService) user.GetService(DfpService.v201211.OrderService); + + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + } + + /// + /// Test whether we can create an order. + /// + [Test] + public void TestCreateOrder() { + Order order = new Order(); + order.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order.advertiserId = advertiserId; + order.traffickerId = traffickerId; + order.currencyCode = "USD"; + + Order newOrder = null; + + Assert.DoesNotThrow(delegate() { + newOrder = orderService.createOrder(order); + }); + + Assert.NotNull(newOrder); + Assert.AreEqual(order.name, newOrder.name); + } + + /// + /// Test whether we can create a list of orders. + /// + [Test] + public void TestCreateOrders() { + Order order1 = new Order(); + order1.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order1.advertiserId = advertiserId; + order1.traffickerId = traffickerId; + order1.currencyCode = "USD"; + + Order order2 = new Order(); + order2.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order2.advertiserId = advertiserId; + order2.traffickerId = traffickerId; + order2.currencyCode = "USD"; + + Order[] newOrders = null; + + Assert.DoesNotThrow(delegate() { + newOrders = orderService.createOrders(new Order[] {order1, order2}); + }); + + Statement statement = new Statement(); + statement.query = string.Format("WHERE advertiserId = '{0}' LIMIT 500", advertiserId); + + OrderPage page = orderService.getOrdersByStatement(statement); + Assert.NotNull(newOrders); + Assert.AreEqual(newOrders.Length, 2); + + Assert.AreEqual(order1.name, newOrders[0].name); + Assert.AreEqual(order1.advertiserId, newOrders[0].advertiserId); + Assert.AreEqual(order1.traffickerId, newOrders[0].traffickerId); + Assert.AreEqual(order1.currencyCode, newOrders[0].currencyCode); + + Assert.AreEqual(order2.name, newOrders[1].name); + Assert.AreEqual(order2.advertiserId, newOrders[1].advertiserId); + Assert.AreEqual(order2.traffickerId, newOrders[1].traffickerId); + Assert.AreEqual(order2.currencyCode, newOrders[1].currencyCode); + } + + /// + /// Test whether we can perform an order action. + /// + [Test] + public void TestPerformOrderAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE status IN ('{0}', '{1}')", + OrderStatus.DRAFT, OrderStatus.PENDING_APPROVAL); + + ApproveOrders action = new ApproveOrders(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = orderService.performOrderAction(action, statement); + }); + + Assert.NotNull(result); + Assert.GreaterOrEqual(result.numChanges, 0); + } + + /// + /// Test whether we can create an order. + /// + [Test] + public void TestGetOrder() { + Order order = null; + + Assert.DoesNotThrow(delegate() { + order = orderService.getOrder(orderId); + }); + + Assert.NotNull(order); + Assert.AreEqual(order.id, orderId); + Assert.AreEqual(order.advertiserId, advertiserId); + Assert.AreEqual(order.traffickerId, traffickerId); + Assert.AreEqual(order.salespersonId, salespersonId); + } + + /// + /// Test whether we can update an order. + /// + [Test] + public void TestUpdateOrder() { + Order order = orderService.getOrder(orderId); + order.notes = "Spoke to advertiser. All is well."; + + Order newOrder = null; + + Assert.DoesNotThrow(delegate() { + newOrder = orderService.updateOrder(order); + }); + + Assert.NotNull(newOrder); + Assert.AreEqual(order.name, newOrder.name); + Assert.AreEqual(order.advertiserId, newOrder.advertiserId); + Assert.AreEqual(order.traffickerId, newOrder.traffickerId); + Assert.AreEqual(order.currencyCode, newOrder.currencyCode); + Assert.AreEqual(order.notes, newOrder.notes); + } + + /// + /// Test whether we can update a list of orders. + /// + [Test] + public void TestUpdateOrders() { + Order order = orderService.getOrder(orderId); + order.notes = "Spoke to advertiser. All is well."; + + Order[] newOrders = null; + + Assert.DoesNotThrow(delegate() { + newOrders = orderService.updateOrders(new Order[] {order}); + }); + + Assert.NotNull(newOrders); + Assert.AreEqual(newOrders.Length, 1); + + Assert.AreEqual(order.id, newOrders[0].id); + Assert.AreEqual(order.name, newOrders[0].name); + Assert.AreEqual(order.notes, newOrders[0].notes); + Assert.AreEqual(order.advertiserId, newOrders[0].advertiserId); + Assert.AreEqual(order.traffickerId, newOrders[0].traffickerId); + Assert.AreEqual(order.currencyCode, newOrders[0].currencyCode); + } + } +} diff --git a/tests/Dfp/v201211/PlacementServiceTests.cs b/tests/Dfp/v201211/PlacementServiceTests.cs new file mode 100644 index 00000000000..3754f1ef58e --- /dev/null +++ b/tests/Dfp/v201211/PlacementServiceTests.cs @@ -0,0 +1,242 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201211 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class PlacementServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private PlacementService placementService; + + /// + /// The ad unit 1 for running tests. + /// + private AdUnit adUnit1; + + /// + /// The ad unit 2 for running tests. + /// + private AdUnit adUnit2; + + /// + /// The placement for running tests. + /// + private Placement placement; + + /// + /// Default public constructor. + /// + public PlacementServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + placementService = (PlacementService) user.GetService(DfpService.v201211.PlacementService); + adUnit1 = utils.CreateAdUnit(user); + adUnit2 = utils.CreateAdUnit(user); + placement = utils.CreatePlacement(user, new string[] {adUnit1.id, adUnit2.id}); + } + + /// + /// Test whether we can create a placement. + /// + [Test] + public void TestCreatePlacement() { + Placement placement = new Placement(); + placement.name = string.Format("Medium Square AdUnit Placement #{0}", + new TestUtils().GetTimeStamp()); + placement.description = "Contains ad units that can hold creatives of size 300x250"; + placement.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement newPlacement = null; + + Assert.DoesNotThrow(delegate() { + newPlacement = placementService.createPlacement(placement); + }); + + Assert.NotNull(newPlacement); + Assert.AreEqual(newPlacement.name, placement.name); + Assert.AreEqual(newPlacement.description, placement.description); + Assert.Contains(adUnit1.id, newPlacement.targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacement.targetedAdUnitIds); + } + + /// + /// Test whether we can create a list of placements items. + /// + [Test] + public void TestCreatePlacements() { + TestUtils utils = new TestUtils(); + Placement placement1 = new Placement(); + placement1.name = string.Format("Medium Square AdUnit Placement #{0}", utils.GetTimeStamp()); + placement1.description = "Contains ad units that can hold creatives of size 300x250"; + placement1.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement placement2 = new Placement(); + placement2.name = string.Format("Medium Square AdUnit Placement #{0}", utils.GetTimeStamp()); + placement2.description = "Contains ad units that can hold creatives of size 300x250"; + placement2.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement[] newPlacements = null; + + Assert.DoesNotThrow(delegate() { + newPlacements = placementService.createPlacements(new Placement[] {placement1, placement2}); + }); + + Assert.NotNull(newPlacements); + Assert.AreEqual(newPlacements.Length, 2); + + Assert.NotNull(newPlacements[0]); + Assert.AreEqual(newPlacements[0].name, placement1.name); + Assert.AreEqual(newPlacements[0].description, placement1.description); + Assert.Contains(adUnit1.id, newPlacements[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[0].targetedAdUnitIds); + + Assert.NotNull(newPlacements[1]); + Assert.AreEqual(newPlacements[1].name, placement2.name); + Assert.AreEqual(newPlacements[1].description, placement2.description); + Assert.Contains(adUnit1.id, newPlacements[1].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[1].targetedAdUnitIds); + } + + /// + /// Test whether we can create a list of placements items. + /// + [Test] + public void TestGetPlacement() { + Placement newPlacement = null; + + Assert.DoesNotThrow(delegate() { + newPlacement = placementService.getPlacement(placement.id); + }); + + Assert.NotNull(newPlacement); + Assert.AreEqual(newPlacement.name, placement.name); + Assert.AreEqual(newPlacement.description, placement.description); + Assert.Contains(adUnit1.id, newPlacement.targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacement.targetedAdUnitIds); + } + + /// + /// Test whether we can fetch a list of existing placements that match given + /// statement. + /// + [Test] + public void TestGetPlacementsByStatement() { + // Create a Statement to only select active placements. + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}'", placement.id); + + PlacementPage page = null; + + Assert.DoesNotThrow(delegate() { + page = placementService.getPlacementsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.results.Length, 1); + + Assert.AreEqual(page.results[0].id, placement.id); + Assert.AreEqual(page.results[0].name, placement.name); + Assert.AreEqual(page.results[0].description, placement.description); + Assert.Contains(adUnit1.id, page.results[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, page.results[0].targetedAdUnitIds); + } + + /// + /// Test whether we can deactivate a placement. + /// + [Test] + public void TestPerformPlacementAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE status = '{0}'", InventoryStatus.ACTIVE); + + DeactivatePlacements action = new DeactivatePlacements(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = placementService.performPlacementAction(action, statement); + }); + + Assert.NotNull(result); + Assert.GreaterOrEqual(result.numChanges, 0); + } + + /// + /// Test whether we can update a placement. + /// + [Test] + public void TestUpdatePlacement() { + placement.description += "More description"; + + Placement newPlacement = null; + + Assert.DoesNotThrow(delegate() { + newPlacement = placementService.updatePlacement(placement); + }); + + Assert.NotNull(newPlacement); + Assert.AreEqual(newPlacement.name, placement.name); + Assert.AreEqual(newPlacement.description, placement.description); + Assert.Contains(adUnit1.id, newPlacement.targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacement.targetedAdUnitIds); + } + + /// + /// Test whether we can update a list of placements. + /// + [Test] + public void TestUpdatePlacements() { + placement.description += "More description"; + + Placement[] newPlacements = null; + + Assert.DoesNotThrow(delegate() { + newPlacements = placementService.updatePlacements(new Placement[] {placement}); + }); + + Assert.NotNull(newPlacements); + Assert.AreEqual(newPlacements.Length, 1); + + Assert.NotNull(newPlacements[0]); + Assert.AreEqual(newPlacements[0].name, placement.name); + Assert.AreEqual(newPlacements[0].description, placement.description); + Assert.Contains(adUnit1.id, newPlacements[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[0].targetedAdUnitIds); + } + } +} diff --git a/tests/Dfp/v201211/ReportServiceTests.cs b/tests/Dfp/v201211/ReportServiceTests.cs new file mode 100644 index 00000000000..08d062d1c37 --- /dev/null +++ b/tests/Dfp/v201211/ReportServiceTests.cs @@ -0,0 +1,160 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201211 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class ReportServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private ReportService reportService; + + /// + /// Report id for running further tests. + /// + long reportId; + + /// + /// Default public constructor. + /// + public ReportServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + reportService = (ReportService) user.GetService(DfpService.v201211.ReportService); + reportId = utils.CreateReport(user).id; + } + + /// + /// Test whether we can run a delivery report. + /// + [Test] + public void TestRunDeliveryReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can run an inventory report. + /// + [Test] + public void TestRunInventoryReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.DATE}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + Column.TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + Column.TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_WEEK; + + ReportJob newReportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can run a sales report. + /// + [Test] + public void TestRunSalesReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.SALESPERSON}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CPM_AND_CPC_REVENUE, Column.AD_SERVER_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + ReportJob newReportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can retrieve existing report job. + /// + [Test] + public void TestGetReportJob() { + ReportJob reportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.getReportJob(reportId); + }); + + Assert.NotNull(reportJob); + Assert.AreEqual(reportJob.id, reportId); + } + + /// + /// Test whether we can retrieve report download URL. + /// + [Test] + public void TestGetReportDownloadUrl() { + string url = null; + + Assert.DoesNotThrow(delegate() { + url = reportService.getReportDownloadURL(reportId, ExportFormat.CSV_EXCEL); + }); + + Assert.True(Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)); + + Assert.DoesNotThrow(delegate() { + url = reportService.getReportDownloadURL(reportId, ExportFormat.TSV); + }); + + Assert.True(Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)); + } + } +} diff --git a/tests/Dfp/v201211/StatementBuilderTests.cs b/tests/Dfp/v201211/StatementBuilderTests.cs new file mode 100644 index 00000000000..b4c471cafeb --- /dev/null +++ b/tests/Dfp/v201211/StatementBuilderTests.cs @@ -0,0 +1,275 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using System.Xml; +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; +using NUnit.Framework; +using DateTime = Google.Api.Ads.Dfp.v201211.DateTime; + +namespace Google.Api.Ads.Dfp.Tests.v201211 { + + /// + /// UnitTests for class. + /// + [TestFixture] + public class StatementBuilderTests { + + private static bool StatementsAreEqual(Statement s1, Statement s2) { + // Assumes both Statements are non-null and have non-null properties + if (String.Compare(s1.query, s2.query, true) != 0) { + return false; + } + if (s1.values.Length != s2.values.Length) { + return false; + } + // Assumes Statement values are in the same order + for (int i = 0; i < s1.values.Length; i++) { + if (!StringValueMapEntriesAreEqual(s1.values[i], s2.values[i])) { + return false; + } + } + return true; + } + + private static bool StringValueMapEntriesAreEqual(String_ValueMapEntry entry1, + String_ValueMapEntry entry2) { + return String.Equals(entry1.key, entry2.key) && ValuesAreEqual(entry1.value, entry2.value); + } + + private delegate bool ValueEqualityDelegate(Value value1, Value value2); + + private static bool ValuesAreEqual(Value value1, Value value2) { + Dictionary switcher = + new Dictionary(); + switcher.Add(typeof(TextValue), new ValueEqualityDelegate(TextValuesAreEqual)); + switcher.Add(typeof(NumberValue), new ValueEqualityDelegate(NumberValuesAreEqual)); + switcher.Add(typeof(BooleanValue), new ValueEqualityDelegate(BooleanValuesAreEqual)); + switcher.Add(typeof(DateTimeValue), new ValueEqualityDelegate(DateTimeValuesAreEqual)); + + if (switcher.ContainsKey(value1.GetType())) { + return switcher[value1.GetType()](value1, value2); + } + throw new NotImplementedException(String.Format("Unknown Value type {0}", value1.GetType())); + } + + private static bool TextValuesAreEqual(Value value1, Value value2) { + return String.Equals((value1 as TextValue).value, (value2 as TextValue).value); + } + + private static bool NumberValuesAreEqual(Value value1, Value value2) { + return String.Equals((value1 as NumberValue).value, (value2 as NumberValue).value); + } + + private static bool BooleanValuesAreEqual(Value value1, Value value2) { + return (value1 as BooleanValue).value == (value2 as BooleanValue).value; + } + + private static bool DateTimeValuesAreEqual(Value value1, Value value2) { + DateTime dateTime1 = (value1 as DateTimeValue).value; + DateTime dateTime2 = (value2 as DateTimeValue).value; + return DatesAreEqual(dateTime1.date, dateTime2.date) + && dateTime1.hour == dateTime2.hour + && dateTime1.minute == dateTime2.minute + && dateTime1.second == dateTime2.second + && String.Equals(dateTime1.timeZoneID, dateTime2.timeZoneID); + } + + private static bool DatesAreEqual(Date date1, Date date2) { + return date1.day == date2.day + && date1.month == date2.month + && date1.year == date2.year; + } + + [Test] + public void TestStatementBuilderBlankStatement() { + StatementBuilder statementBuilder = new StatementBuilder(); + + Statement expectedStatement = new Statement(); + expectedStatement.query = ""; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderBasicStatement() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("ID = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE ID = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderIgnoresKeyword() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("WHERE ID = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE ID = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderIncludesKeywordPrefix() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("WHEREWITHALL = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE WHEREWITHALL = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestAllStatementBuilderPartialFunctions() { + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Name, Id") + .From("Geo_Target") + .Where("Targetable = :targetable") + .OrderBy("Id DESC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .Offset(0) + .AddValue("targetable", true) + .IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .RemoveLimitAndOffset(); + Assert.AreEqual(null, statementBuilder.GetOffset()); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "SELECT Name, Id FROM Geo_Target" + + " WHERE Targetable = :targetable ORDER BY Id DESC"; + String_ValueMapEntry targetableEntry = new String_ValueMapEntry(); + targetableEntry.key = "targetable"; + BooleanValue targetableValue = new BooleanValue(); + targetableValue.value = true; + targetableEntry.value = targetableValue; + expectedStatement.values = new String_ValueMapEntry[] {targetableEntry}; + Assert.True(StatementsAreEqual(expectedStatement, statementBuilder.ToStatement())); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesWhere() { + StatementBuilder statementBuilder = new StatementBuilder("WHERE ID = 1") + .Where("ID = 2"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesFrom() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .From("Geo_Table"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesSelect() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Select("Id, Type"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesLimit() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Offset(100); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesIncreaseOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .IncreaseOffsetBy(100); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesRemoveLimitAndOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .RemoveLimitAndOffset(); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithSelect() { + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Id, Type"); + statementBuilder.Query = "SELECT Id, Type FROM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithFrom() { + StatementBuilder statementBuilder = new StatementBuilder() + .From("Geo_Table"); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithWhere() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("Type = City"); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithLimit() { + StatementBuilder statementBuilder = new StatementBuilder() + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithOffset() { + StatementBuilder statementBuilder = new StatementBuilder() + .Offset(100); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + } +} diff --git a/tests/Dfp/v201211/TestUtils.cs b/tests/Dfp/v201211/TestUtils.cs new file mode 100644 index 00000000000..28612308016 --- /dev/null +++ b/tests/Dfp/v201211/TestUtils.cs @@ -0,0 +1,343 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201211; +using Google.Api.Ads.Dfp.v201211; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; +using System.Threading; +using System.Configuration; +using System.Collections; + +namespace Google.Api.Ads.Dfp.Tests.v201211 { + /// + /// A utility class to assist the testing of v201004 services. + /// + public class TestUtils { + public User GetCurrentUser(DfpUser user) { + return GetUserByEmail(user, new DfpAppConfig().Email); + } + + public User GetTrafficker(DfpUser user) { + return GetUserByEmail(user, "dfp.api.trafficker@gmail.com"); + } + + public User GetSalesperson(DfpUser user) { + return GetUserByEmail(user, "dfp.api.salesperson@gmail.com"); + } + + public User GetUserByEmail(DfpUser user, string email) { + UserService userService = (UserService) user.GetService(DfpService.v201211.UserService); + + // Create a Statement to get all users sorted by name. + Statement statement = new Statement(); + statement.query = string.Format("where email = '{0}' LIMIT 1", email); + + UserPage page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + return page.results[0]; + } else { + return null; + } + } + + public Role GetRole(DfpUser user, string roleName) { + UserService userService = (UserService)user.GetService(DfpService.v201211.UserService); + + // Get all roles. + Role[] roles = userService.getAllRoles(); + foreach (Role role in roles) { + if (role.name == roleName) { + return role; + } + } + return null; + } + + /// + /// Create a test company for running further tests. + /// + /// A test company for running further tests. + public Company CreateCompany(DfpUser user, CompanyType companyType) { + CompanyService companyService = (CompanyService) user.GetService( + DfpService.v201211.CompanyService); + Company company = new Company(); + company.name = string.Format("Company #{0}", GetTimeStamp()); + company.type = companyType; + + return companyService.createCompany(company); + } + + public Order CreateOrder(DfpUser user, long advertiserId, long salespersonId, + long traffickerId) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201211.OrderService); + + Order order = new Order(); + order.name = string.Format("Order #{0}", GetTimeStamp()); + order.advertiserId = advertiserId; + order.salespersonId = salespersonId; + order.traffickerId = traffickerId; + + return orderService.createOrder(order); + } + + public LineItem CreateLineItem(DfpUser user, long orderId, string adUnitId) { + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201211.LineItemService); + + long placementId = CreatePlacement(user, new string[] {adUnitId}).id; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201211.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201211.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + return lineItemService.createLineItem(lineItem); + } + + /// + /// Create a test company for running further tests. + /// + /// A creative for running further tests. + public Creative CreateCreative(DfpUser user, long advertiserId) { + CreativeService creativeService = (CreativeService)user.GetService( + DfpService.v201211.CreativeService); + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", GetTimeStamp()); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.imageName = "image.jpg"; + imageCreative.imageByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + + Size imageSize = new Size(); + imageSize.width = 300; + imageSize.height = 250; + + imageCreative.size = imageSize; + + return creativeService.createCreative(imageCreative); + } + + public LineItemCreativeAssociation CreateLica(DfpUser user, long lineItemId, long creativeId) { + LineItemCreativeAssociationService licaService = + (LineItemCreativeAssociationService)user.GetService( + DfpService.v201211.LineItemCreativeAssociationService); + + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId; + lica.lineItemId = lineItemId; + + return licaService.createLineItemCreativeAssociation(lica); + } + + public AdUnit CreateAdUnit(DfpUser user) { + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201211.InventoryService); + + AdUnit adUnit = new AdUnit(); + adUnit.name = string.Format("Ad_Unit_{0}", GetTimeStamp()); + adUnit.parentId = FindRootAdUnit(user).id; + + // Set the size of possible creatives that can match this ad unit. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + return inventoryService.createAdUnit(adUnit); + } + + public AdUnit FindRootAdUnit(DfpUser user) { + // Get InventoryService. + InventoryService inventoryService = + (InventoryService)user.GetService(DfpService.v201211.InventoryService); + + // Create a Statement to only select the root ad unit. + Statement statement = new Statement(); + statement.query = "WHERE parentId IS NULL LIMIT 500"; + + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + return page.results[0]; + } + + public Placement CreatePlacement(DfpUser user, string[] targetedAdUnitIds) { + // Get InventoryService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201211.PlacementService); + + Placement placement = new Placement(); + placement.name = string.Format("Test placement #{0}", this.GetTimeStamp()); + placement.description = "Test placement"; + placement.targetedAdUnitIds = targetedAdUnitIds; + + return placementService.createPlacement(placement); + } + + public ReportJob CreateReport(DfpUser user) { + // Get ReportService. + ReportService reportService = + (ReportService) user.GetService(DfpService.v201211.ReportService); + + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + return reportService.runReportJob(reportJob); + } + + /// + /// Gets the current timestamp as a string. + /// + /// The current timestamp as a string. + public string GetTimeStamp() { + Thread.Sleep(500); + return (System.DateTime.UtcNow - new System.DateTime(1970, 1, 1)).Ticks. + ToString(); + } + } +} diff --git a/tests/Dfp/v201211/UserServiceTests.cs b/tests/Dfp/v201211/UserServiceTests.cs new file mode 100644 index 00000000000..0b56ea0885d --- /dev/null +++ b/tests/Dfp/v201211/UserServiceTests.cs @@ -0,0 +1,217 @@ +// Copyright 2012, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201211; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201211 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class UserServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private UserService userService; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Current user id for running tests. + /// + private long currentUserId; + + /// + /// Default public constructor. + /// + public UserServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + userService = (UserService) user.GetService(DfpService.v201211.UserService); + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + currentUserId = utils.GetCurrentUser(user).id; + } + + /// + /// Test whether we can fetch all roles. + /// + [Test] + public void TestGetAllRoles() { + Role[] roles = null; + + Assert.DoesNotThrow(delegate() { + roles = userService.getAllRoles(); + }); + Assert.NotNull(roles); + Assert.GreaterOrEqual(roles.Length, 0); + } + + /// + /// Test whether we can fetch the current user. + /// + [Test] + public void TestGetCurrentUser() { + User user = null; + + Assert.DoesNotThrow(delegate() { + user = userService.getCurrentUser(); + }); + + Assert.NotNull(user); + Assert.AreEqual(user.id, currentUserId); + } + + /// + /// Test whether we can fetch an existing user. + /// + [Test] + public void TestGetUser() { + User user = null; + + Assert.DoesNotThrow(delegate() { + user = userService.getUser(salespersonId); + }); + + Assert.NotNull(user); + Assert.AreEqual(user.id, salespersonId); + } + + /// + /// Test whether we can fetch a list of existing users that match given + /// statement. + /// + [Test] + public void TestGetUsersByStatement() { + Statement statement = new Statement(); + statement.query = "ORDER BY name LIMIT 500"; + + UserPage page = null; + + Assert.DoesNotThrow(delegate() { + page = userService.getUsersByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + + List salesPersonIds = new List(); + List traffickerIds = new List(); + + foreach(User tempUser in page.results) { + if (tempUser.roleName == "Salesperson") { + salesPersonIds.Add(tempUser.id); + } else if (tempUser.roleName == "Trafficker") { + traffickerIds.Add(tempUser.id); + } + } + Assert.Contains(salespersonId, salesPersonIds); + Assert.Contains(traffickerId, traffickerIds); + } + + /// + /// Test whether we can deactivate and activate a user. + /// + [Test] + public void TestPerformUserAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = {0}", salespersonId); + + DeactivateUsers action = new DeactivateUsers(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = userService.performUserAction(action, statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + + // Activate the user again. + + Assert.DoesNotThrow(delegate() { + result = userService.performUserAction(new ActivateUsers(), statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update a user. + /// + [Test] + public void TestUpdateUser() { + User user = userService.getUser(salespersonId); + user.preferredLocale = (user.preferredLocale == "fr_FR")? "en_US" : "fr_FR"; + + User newUser = null; + + Assert.DoesNotThrow(delegate() { + newUser = userService.updateUser(user); + }); + + Assert.NotNull(newUser); + Assert.AreEqual(newUser.id, user.id); + Assert.AreEqual(newUser.preferredLocale, user.preferredLocale); + } + + /// + /// Test whether we can update a list of users. + /// + [Test] + public void TestUpdateUsers() { + User user = userService.getUser(salespersonId); + user.preferredLocale = (user.preferredLocale == "fr_FR")? "en_US" : "fr_FR"; + + User[] newUsers = null; + + Assert.DoesNotThrow(delegate() { + newUsers = userService.updateUsers(new User[] {user}); + }); + + Assert.NotNull(newUsers); + Assert.AreEqual(newUsers.Length, 1); + Assert.AreEqual(newUsers[0].id, user.id); + Assert.AreEqual(newUsers[0].preferredLocale, user.preferredLocale); + } + } +} diff --git a/tests/Dfp/v201302/CompanyServiceTests.cs b/tests/Dfp/v201302/CompanyServiceTests.cs new file mode 100644 index 00000000000..6f1b46609eb --- /dev/null +++ b/tests/Dfp/v201302/CompanyServiceTests.cs @@ -0,0 +1,192 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201302 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class CompanyServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private CompanyService companyService; + + /// + /// The company to be used for further tests. + /// + private Company testCompany1 = null; + + /// + /// The company to be used for further tests. + /// + private Company testCompany2 = null; + + /// + /// Default public constructor. + /// + public CompanyServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + companyService = (CompanyService) user.GetService(DfpService.v201302.CompanyService); + testCompany1 = utils.CreateCompany(user, CompanyType.ADVERTISER); + testCompany2 = utils.CreateCompany(user, CompanyType.ADVERTISER); + } + + + /// + /// Test whether we can create a company. + /// + [Test] + public void TestCreateCompany() { + Company company = new Company(); + company.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company.type = CompanyType.ADVERTISER; + + Company newCompany = null; + Assert.DoesNotThrow(delegate() { + newCompany = companyService.createCompany(company); + }); + + Assert.NotNull(newCompany); + Assert.AreEqual(company.name, newCompany.name); + Assert.AreEqual(company.type, newCompany.type); + } + + /// + /// Test whether we can create a list of companies. + /// + [Test] + public void TestCreateCompanies() { + Company company1 = new Company(); + company1.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company1.type = CompanyType.ADVERTISER; + + Company company2 = new Company(); + company2.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company2.type = CompanyType.ADVERTISER; + + Company[] newCompanies = null; + Assert.DoesNotThrow(delegate() { + newCompanies = companyService.createCompanies(new Company[] {company1, company2}); + }); + + Assert.NotNull(newCompanies); + Assert.AreEqual(newCompanies.Length, 2); + + Assert.AreEqual(company1.name, newCompanies[0].name); + Assert.AreEqual(company1.type, newCompanies[0].type); + Assert.AreEqual(company2.name, newCompanies[1].name); + Assert.AreEqual(company2.type, newCompanies[1].type); + } + + /// + /// Test whether we can fetch an existing company. + /// + [Test] + public void TestGetCompany() { + Company company1 = null; + + Assert.DoesNotThrow(delegate() { + company1 = companyService.getCompany(testCompany1.id); + }); + + Assert.NotNull(company1); + Assert.AreEqual(testCompany1.id, company1.id); + Assert.AreEqual(testCompany1.name, company1.name); + } + + /// + /// Test whether we can fetch a list of existing companies that match given + /// statement. + /// + [Test] + public void TestGetCompaniesByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = {0} ORDER BY name LIMIT 1", testCompany1.id); + CompanyPage page = null; + + Assert.DoesNotThrow(delegate() { + page = companyService.getCompaniesByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.results.Length, 1); + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].id, testCompany1.id); + Assert.AreEqual(page.results[0].name, testCompany1.name); + } + + /// + /// Test whether we can update a company. + /// + [Test] + public void TestUpdateCompany() { + testCompany1.name = "Corp " + testCompany1.name; + Company newCompany = null; + + Assert.DoesNotThrow(delegate() { + newCompany = companyService.updateCompany(testCompany1); + }); + + Assert.NotNull(newCompany); + Assert.AreEqual(newCompany.id, testCompany1.id); + Assert.AreEqual(newCompany.name, testCompany1.name); + } + + /// + /// Test whether we can update a list of companies. + /// + [Test] + public void TestUpdateCompanies() { + testCompany1.name = "Corp " + testCompany1.name; + testCompany2.name = "Corp " + testCompany2.name; + + Company[] newCompanies = null; + + Assert.DoesNotThrow(delegate() { + newCompanies = companyService.updateCompanies(new Company[] {testCompany1, testCompany2}); + }); + + Assert.NotNull(newCompanies); + Assert.AreEqual(newCompanies.Length, 2); + + Assert.AreEqual(testCompany1.name, newCompanies[0].name); + Assert.AreEqual(testCompany1.type, newCompanies[0].type); + Assert.AreEqual(testCompany2.name, newCompanies[1].name); + Assert.AreEqual(testCompany2.type, newCompanies[1].type); + } + } +} diff --git a/tests/Dfp/v201302/CreativeServiceTests.cs b/tests/Dfp/v201302/CreativeServiceTests.cs new file mode 100644 index 00000000000..3d47856ab7d --- /dev/null +++ b/tests/Dfp/v201302/CreativeServiceTests.cs @@ -0,0 +1,270 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201302 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class CreativeServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private CreativeService creativeService; + + /// + /// The advertiser company id to be used for running tests. + /// + private long advertiserId = 0; + + /// + /// The creative 1 to be used for running tests. + /// + private Creative creative1 = null; + + /// + /// The creative 2 to be used for running tests. + /// + private Creative creative2 = null; + + /// + /// Default public constructor. + /// + public CreativeServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + creativeService = (CreativeService)user.GetService(DfpService.v201302.CreativeService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + creative1 = utils.CreateCreative(user, advertiserId); + creative2 = utils.CreateCreative(user, advertiserId); + } + + /// + /// Test whether we can create a creative. + /// + [Test] + public void TestCreateCreative() { + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", new TestUtils().GetTimeStamp()); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + Creative newCreative = null; + + Assert.DoesNotThrow(delegate() { + newCreative = creativeService.createCreative(imageCreative); + }); + + Assert.NotNull(newCreative); + Assert.That(newCreative is ImageCreative); + Assert.AreEqual(newCreative.advertiserId, imageCreative.advertiserId); + Assert.AreEqual(newCreative.name, imageCreative.name); + } + + /// + /// Test whether we can create a list of creatives. + /// + [Test] + public void TestCreateCreatives() { + // Create an array to store local image creative objects. + Creative[] imageCreatives = new ImageCreative[2]; + + for (int i = 0; i < 2; i++) { + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", i); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + imageCreatives[i] = imageCreative; + } + + Creative[] newCreatives = null; + + Assert.DoesNotThrow(delegate() { + newCreatives = creativeService.createCreatives(imageCreatives); + }); + + Assert.NotNull(newCreatives); + Assert.AreEqual(newCreatives.Length, 2); + Assert.NotNull(newCreatives[0]); + Assert.That(newCreatives[0] is ImageCreative); + Assert.AreEqual(newCreatives[0].advertiserId, advertiserId); + Assert.AreEqual(newCreatives[0].name, "Image creative #0"); + Assert.NotNull(newCreatives[1]); + Assert.That(newCreatives[1] is ImageCreative); + Assert.AreEqual(newCreatives[1].advertiserId, advertiserId); + Assert.AreEqual(newCreatives[1].name, "Image creative #1"); + } + + /// + /// Test whether we can fetch an existing creative. + /// + [Test] + public void TestGetCreative() { + Creative localCreative = null; + Assert.DoesNotThrow(delegate() { + localCreative = creativeService.getCreative(creative1.id); + }); + Assert.NotNull(localCreative); + Assert.AreEqual(localCreative.id, creative1.id); + Assert.AreEqual(localCreative.GetType(), creative1.GetType()); + Assert.AreEqual(localCreative.name, creative1.name); + Assert.AreEqual(localCreative.advertiserId, creative1.advertiserId); + Assert.AreEqual(localCreative.previewUrl, creative1.previewUrl); + Assert.AreEqual(localCreative.size.height, creative1.size.height); + Assert.AreEqual(localCreative.size.width, creative1.size.width); + } + + /// + /// Test whether we can fetch a list of existing creatives that match given + /// statement. + /// + [Test] + public void TestGetCreativesByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 500", creative1.id); + + CreativePage page = null; + + Assert.DoesNotThrow(delegate() { + page = creativeService.getCreativesByStatement(statement); + }); + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].id, creative1.id); + Assert.AreEqual(page.results[0].GetType(), creative1.GetType()); + Assert.AreEqual(page.results[0].name, creative1.name); + Assert.AreEqual(page.results[0].advertiserId, creative1.advertiserId); + Assert.AreEqual(page.results[0].previewUrl, creative1.previewUrl); + Assert.AreEqual(page.results[0].size.height, creative1.size.height); + Assert.AreEqual(page.results[0].size.width, creative1.size.width); + } + + /// + /// Test whether we can update a creative. + /// + [Test] + public void TestUpdateCreative() { + ImageCreative imageCreative = (ImageCreative) creative1; + imageCreative.destinationUrl = "http://news.google.com"; + + Creative newCreative = null; + + Assert.DoesNotThrow(delegate() { + newCreative = creativeService.updateCreative(creative1); + }); + + Assert.NotNull(newCreative); + Assert.AreEqual(newCreative.id, creative1.id); + Assert.AreEqual(newCreative.name, creative1.name); + Assert.AreEqual(newCreative.advertiserId, creative1.advertiserId); + Assert.AreEqual(newCreative.size.height, creative1.size.height); + Assert.AreEqual(newCreative.size.width, creative1.size.width); + Assert.That(newCreative is ImageCreative); + Assert.AreEqual((newCreative as ImageCreative).destinationUrl, imageCreative.destinationUrl); + } + + /// + /// Test whether we can update a list of creatives. + /// + [Test] + public void TestUpdateCreatives() { + ImageCreative imageCreative1 = (ImageCreative) creative1; + imageCreative1.destinationUrl = "http://news.google.com"; + + ImageCreative imageCreative2 = (ImageCreative) creative2; + imageCreative2.destinationUrl = "http://finance.google.com"; + + Creative[] newCreatives = null; + + Assert.DoesNotThrow(delegate() { + newCreatives = creativeService.updateCreatives(new Creative[] {creative1, creative2}); + }); + + Assert.NotNull(newCreatives); + Assert.AreEqual(newCreatives.Length, 2); + + Assert.AreEqual(newCreatives[0].id, creative1.id); + Assert.AreEqual(newCreatives[0].name, creative1.name); + Assert.AreEqual(newCreatives[0].advertiserId, creative1.advertiserId); + Assert.AreEqual(newCreatives[0].size.height, creative1.size.height); + Assert.AreEqual(newCreatives[0].size.width, creative1.size.width); + Assert.That(newCreatives[0] is ImageCreative); + Assert.AreEqual((newCreatives[0] as ImageCreative).destinationUrl, + imageCreative1.destinationUrl); + + Assert.AreEqual(newCreatives[1].id, creative2.id); + Assert.AreEqual(newCreatives[1].name, creative2.name); + Assert.AreEqual(newCreatives[1].advertiserId, creative2.advertiserId); + Assert.AreEqual(newCreatives[1].size.height, creative2.size.height); + Assert.AreEqual(newCreatives[1].size.width, creative2.size.width); + Assert.That(newCreatives[1] is ImageCreative); + Assert.AreEqual((newCreatives[1] as ImageCreative).destinationUrl, + imageCreative2.destinationUrl); + } + } +} diff --git a/tests/Dfp/v201302/ForecastServiceTests.cs b/tests/Dfp/v201302/ForecastServiceTests.cs new file mode 100644 index 00000000000..a52c5cf7fb9 --- /dev/null +++ b/tests/Dfp/v201302/ForecastServiceTests.cs @@ -0,0 +1,171 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201302 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class ForecastServiceTests : BaseTests { + /// + /// ForecastService object to be used in this test. + /// + private ForecastService forecastService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Placement id for running tests. + /// + private long placementId; + + /// + /// Line item id for running tests. + /// + private long lineItemId; + + /// + /// Default public constructor. + /// + public ForecastServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + forecastService = (ForecastService)user.GetService(DfpService.v201302.ForecastService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + placementId = utils.CreatePlacement(user, new string[] {adUnitId}).id; + lineItemId = utils.CreateLineItem(user, orderId, adUnitId).id; + } + + /// + /// Test whether we can get a forecast for given line item. + /// + [Test] + public void TestGetForecast() { + TestUtils utils = new TestUtils(); + + LineItem lineItem = new LineItem(); + lineItem.name = string.Format("Line item #{0}", utils.GetTimeStamp()); + + lineItem.orderId = orderId; + + lineItem.targeting = new Targeting(); + lineItem.targeting.inventoryTargeting = new InventoryTargeting(); + lineItem.targeting.inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + Size size1 = new Size(); + size1.width = 300; + size1.height = 250; + + Size size2 = new Size(); + size2.width = 120; + size2.height = 600; + + // Create the creative placeholders. + CreativePlaceholder creativePlaceholder1 = new CreativePlaceholder(); + creativePlaceholder1.size = size1; + + CreativePlaceholder creativePlaceholder2 = new CreativePlaceholder(); + creativePlaceholder1.size = size2; + + lineItem.creativePlaceholders = + new CreativePlaceholder[] {creativePlaceholder1, creativePlaceholder2}; + + lineItem.lineItemType = LineItemType.STANDARD; + + // Set start date time and end date time. + lineItem.startDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddDays(1)); + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000; + + lineItem.creativeRotationType = CreativeRotationType.EVEN; + lineItem.discountType = LineItemDiscountType.PERCENTAGE; + + lineItem.unitsBought = 500000; + lineItem.unitType = UnitType.IMPRESSIONS; + + Forecast forecast = null; + Assert.DoesNotThrow(delegate() { + forecast = forecastService.getForecast(lineItem); + }); + Assert.NotNull(forecast); + Assert.AreEqual(forecast.orderId, orderId); + Assert.AreEqual(forecast.unitType, lineItem.unitType); + } + + /// + /// Test whether we can get a forecast for existing line item. + /// + [Test] + public void TestGetForecastById() { + Forecast forecast = null; + Assert.DoesNotThrow(delegate() { + forecast = forecastService.getForecastById(lineItemId); + }); + Assert.NotNull(forecast); + Assert.AreEqual(forecast.orderId, orderId); + } + } +} diff --git a/tests/Dfp/v201302/InventoryServiceTests.cs b/tests/Dfp/v201302/InventoryServiceTests.cs new file mode 100644 index 00000000000..5b8abf40e80 --- /dev/null +++ b/tests/Dfp/v201302/InventoryServiceTests.cs @@ -0,0 +1,295 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201302 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class InventoryServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private InventoryService inventoryService; + + /// + /// The ad unit 1 for running tests. + /// + private AdUnit adUnit1; + + /// + /// The ad unit 2 for running tests. + /// + private AdUnit adUnit2; + + /// + /// Default public constructor. + /// + public InventoryServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + inventoryService = (InventoryService) user.GetService(DfpService.v201302.InventoryService); + adUnit1 = utils.CreateAdUnit(user); + adUnit2 = utils.CreateAdUnit(user); + } + + /// + /// Test whether we can create an ad unit. + /// + [Test] + public void TestCreateAdUnit() { + AdUnit localAdUnit = new AdUnit(); + localAdUnit.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit.parentId = adUnit1.id; + + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + localAdUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + + AdUnit newAdUnit = null; + + Assert.DoesNotThrow(delegate() { + newAdUnit = inventoryService.createAdUnit(localAdUnit); + }); + + Assert.NotNull(newAdUnit); + Assert.AreEqual(newAdUnit.name, localAdUnit.name); + Assert.AreEqual(newAdUnit.parentId, localAdUnit.parentId); + Assert.AreEqual(newAdUnit.parentId, adUnit1.id); + Assert.AreEqual(newAdUnit.status, localAdUnit.status); + Assert.AreEqual(newAdUnit.targetWindow, localAdUnit.targetWindow); + } + + /// + /// Test whether we can create a list of ad units. + /// + [Test] + public void TestCreateAdUnits() { + // Create ad unit 1. + AdUnit localAdUnit1 = new AdUnit(); + localAdUnit1.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit1.parentId = adUnit1.id; + + Size size1 = new Size(); + size1.width = 300; + size1.height = 250; + + AdUnitSize adUnitSize1 = new AdUnitSize(); + adUnitSize1.size = size1; + adUnitSize1.environmentType = EnvironmentType.BROWSER; + + localAdUnit1.adUnitSizes = new AdUnitSize[] {adUnitSize1}; + + // Create ad unit 2. + AdUnit localAdUnit2 = new AdUnit(); + localAdUnit2.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit2.parentId = adUnit1.id; + + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + + AdUnitSize adUnitSize2 = new AdUnitSize(); + adUnitSize2.size = size2; + adUnitSize2.environmentType = EnvironmentType.BROWSER; + + localAdUnit2.adUnitSizes = new AdUnitSize[] {adUnitSize2}; + + AdUnit[] newAdUnits = null; + + Assert.DoesNotThrow(delegate() { + newAdUnits = inventoryService.createAdUnits(new AdUnit[] {localAdUnit1, localAdUnit2}); + }); + + Assert.NotNull(newAdUnits); + Assert.AreEqual(newAdUnits.Length, 2); + + Assert.AreEqual(newAdUnits[0].name, localAdUnit1.name); + Assert.AreEqual(newAdUnits[0].parentId, localAdUnit1.parentId); + Assert.AreEqual(newAdUnits[0].parentId, adUnit1.id); + Assert.AreEqual(newAdUnits[0].status, localAdUnit1.status); + Assert.AreEqual(newAdUnits[0].targetWindow, localAdUnit1.targetWindow); + + Assert.AreEqual(newAdUnits[1].name, localAdUnit2.name); + Assert.AreEqual(newAdUnits[1].parentId, localAdUnit2.parentId); + Assert.AreEqual(newAdUnits[1].parentId, adUnit1.id); + Assert.AreEqual(newAdUnits[1].status, localAdUnit2.status); + Assert.AreEqual(newAdUnits[1].targetWindow, localAdUnit2.targetWindow); + } + + /// + /// Test whether we can fetch a list of existing ad units that match given + /// statement. + /// + [Test] + public void TestGetAdUnitsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", adUnit1.id); + + AdUnitPage page = null; + + Assert.DoesNotThrow(delegate() { + page = inventoryService.getAdUnitsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results[0]); + + Assert.AreEqual(page.results[0].name, adUnit1.name); + Assert.AreEqual(page.results[0].parentId, adUnit1.parentId); + Assert.AreEqual(page.results[0].id, adUnit1.id); + Assert.AreEqual(page.results[0].status, adUnit1.status); + Assert.AreEqual(page.results[0].targetWindow, adUnit1.targetWindow); + } + + /// + /// Test whether we can deactivate an ad unit. + /// + [Test] + public void TestPerformAdUnitAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", adUnit1.id); + + UpdateResult result = null; + Assert.DoesNotThrow(delegate() { + result = inventoryService.performAdUnitAction(new DeactivateAdUnits(), statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update an ad unit. + /// + [Test] + public void TestUpdateAdUnit() { + List adUnitSizes = new List(adUnit1.adUnitSizes); + + Size size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit1.adUnitSizes = adUnitSizes.ToArray(); + + AdUnit newAdUnit = null; + Assert.DoesNotThrow(delegate() { + newAdUnit = inventoryService.updateAdUnit(adUnit1); + }); + + Assert.NotNull(newAdUnit); + + Assert.AreEqual(newAdUnit.name, adUnit1.name); + Assert.AreEqual(newAdUnit.parentId, adUnit1.parentId); + Assert.AreEqual(newAdUnit.id, adUnit1.id); + Assert.AreEqual(newAdUnit.status, adUnit1.status); + Assert.AreEqual(newAdUnit.targetWindow, adUnit1.targetWindow); + Assert.AreEqual(newAdUnit.adUnitSizes.Length, adUnit1.adUnitSizes.Length); + } + + /// + /// Test whether we can update a list of an ad units. + /// + [Test] + public void TestUpdateAdUnits() { + List adUnitSizes = null; + Size size = null; + + // Modify ad unit 1. + adUnitSizes = new List(adUnit1.adUnitSizes); + size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit1.adUnitSizes = adUnitSizes.ToArray(); + + // Modify ad unit 2. + adUnitSizes = new List(adUnit2.adUnitSizes); + size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit2.adUnitSizes = adUnitSizes.ToArray(); + + AdUnit[] newAdUnits = null; + Assert.DoesNotThrow(delegate() { + newAdUnits = inventoryService.updateAdUnits(new AdUnit[] {adUnit1, adUnit2}); + }); + + Assert.NotNull(newAdUnits); + Assert.AreEqual(newAdUnits.Length, 2); + + Assert.AreEqual(newAdUnits[0].name, adUnit1.name); + Assert.AreEqual(newAdUnits[0].parentId, adUnit1.parentId); + Assert.AreEqual(newAdUnits[0].id, adUnit1.id); + Assert.AreEqual(newAdUnits[0].status, adUnit1.status); + Assert.AreEqual(newAdUnits[0].targetWindow, adUnit1.targetWindow); + Assert.AreEqual(newAdUnits[0].adUnitSizes.Length, adUnit1.adUnitSizes.Length); + + Assert.AreEqual(newAdUnits[1].name, adUnit2.name); + Assert.AreEqual(newAdUnits[1].parentId, adUnit2.parentId); + Assert.AreEqual(newAdUnits[1].id, adUnit2.id); + Assert.AreEqual(newAdUnits[1].status, adUnit2.status); + Assert.AreEqual(newAdUnits[1].targetWindow, adUnit2.targetWindow); + Assert.AreEqual(newAdUnits[1].adUnitSizes.Length, adUnit2.adUnitSizes.Length); + } + } +} diff --git a/tests/Dfp/v201302/LineItemCreativeAssociationServiceTests.cs b/tests/Dfp/v201302/LineItemCreativeAssociationServiceTests.cs new file mode 100644 index 00000000000..159bf742eb9 --- /dev/null +++ b/tests/Dfp/v201302/LineItemCreativeAssociationServiceTests.cs @@ -0,0 +1,303 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201302 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class LineItemCreativeAssociationServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private LineItemCreativeAssociationService licaService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Creative id 1 for running tests. + /// + private long creativeId1; + + /// + /// Creative id 2 for running tests. + /// + private long creativeId2; + + /// + /// Creative id 3 for running tests. + /// + private long creativeId3; + + /// + /// Creative id 4 for running tests. + /// + private long creativeId4; + + /// + /// Line item id 1 for running tests. + /// + private long lineItemId1; + + /// + /// Line item id 2 for running tests. + /// + private long lineItemId2; + + /// + /// Line item id 3 for running tests. + /// + private long lineItemId3; + + /// + /// Line item id 4 for running tests. + /// + private long lineItemId4; + + /// + /// Line item creative association 1 for running tests. + /// + private LineItemCreativeAssociation lica1; + + /// + /// Line item creative association 2 for running tests. + /// + private LineItemCreativeAssociation lica2; + + /// + /// Default public constructor. + /// + public LineItemCreativeAssociationServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + licaService = (LineItemCreativeAssociationService) user.GetService( + DfpService.v201302.LineItemCreativeAssociationService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + + lineItemId1 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId2 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId3 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId4 = utils.CreateLineItem(user, orderId, adUnitId).id; + + creativeId1 = utils.CreateCreative(user, advertiserId).id; + creativeId2 = utils.CreateCreative(user, advertiserId).id; + creativeId3 = utils.CreateCreative(user, advertiserId).id; + creativeId4 = utils.CreateCreative(user, advertiserId).id; + + lica1 = utils.CreateLica(user, lineItemId3, creativeId3); + lica2 = utils.CreateLica(user, lineItemId4, creativeId4); + } + + /// + /// Test whether we can create a line item creative association. + /// + [Test] + public void TestCreateLineItemCreativeAssociation() { + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId1; + lica.lineItemId = lineItemId1; + + LineItemCreativeAssociation newLica = null; + + Assert.DoesNotThrow(delegate() { + newLica = licaService.createLineItemCreativeAssociation(lica); + }); + + Assert.NotNull(newLica); + Assert.AreEqual(newLica.creativeId, lica.creativeId); + Assert.AreEqual(newLica.lineItemId, lica.lineItemId); + } + + /// + /// Test whether we can create a list of line item creative associations. + /// + [Test] + public void TestCreateLineItemCreativeAssociations() { + LineItemCreativeAssociation localLica1 = new LineItemCreativeAssociation(); + localLica1.creativeId = creativeId1; + localLica1.lineItemId = lineItemId1; + + LineItemCreativeAssociation localLica2 = new LineItemCreativeAssociation(); + localLica2.creativeId = creativeId2; + localLica2.lineItemId = lineItemId2; + + LineItemCreativeAssociation[] newLicas = null; + + Assert.DoesNotThrow(delegate() { + newLicas = licaService.createLineItemCreativeAssociations( + new LineItemCreativeAssociation[] {localLica1, localLica2}); + }); + + Assert.NotNull(newLicas); + Assert.AreEqual(newLicas.Length, 2); + + Assert.NotNull(newLicas[0]); + Assert.AreEqual(newLicas[0].creativeId, localLica1.creativeId); + Assert.AreEqual(newLicas[0].lineItemId, localLica1.lineItemId); + + Assert.NotNull(newLicas[1]); + Assert.AreEqual(newLicas[1].creativeId, localLica2.creativeId); + Assert.AreEqual(newLicas[1].lineItemId, localLica2.lineItemId); + } + + /// + /// Test whether we can fetch an existing line item creative association. + /// + [Test] + public void TestGetLineItemCreativeAssociation() { + LineItemCreativeAssociation newLica = null; + + Assert.DoesNotThrow(delegate() { + newLica = licaService.getLineItemCreativeAssociation(lineItemId3, creativeId3); + }); + + Assert.NotNull(newLica); + Assert.AreEqual(newLica.creativeId, lica1.creativeId); + Assert.AreEqual(newLica.lineItemId, lica1.lineItemId); + } + + /// + /// Test whether we can fetch a list of existing line item creative + /// associations that match given statement. + /// + [Test] + public void TestGetLineItemCreativeAssociationsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE lineItemId = '{0}' LIMIT 500", lineItemId3); + + LineItemCreativeAssociationPage page = null; + Assert.DoesNotThrow(delegate() { + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + }); + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].creativeId, lica1.creativeId); + Assert.AreEqual(page.results[0].lineItemId, lica1.lineItemId); + } + + /// + /// Test whether we can deactivate a line item create association. + /// + [Test] + public void TestPerformLineItemCreativeAssociationAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE lineItemId = '{0}' LIMIT 1", lineItemId3); + + DeactivateLineItemCreativeAssociations action = new DeactivateLineItemCreativeAssociations(); + + UpdateResult result = null; + Assert.DoesNotThrow(delegate() { + result = licaService.performLineItemCreativeAssociationAction(action, statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update a line item creative association. + /// + [Test] + public void TestUpdateLineItemCreativeAssociation() { + lica1.destinationUrl = "http://news.google.com"; + + LineItemCreativeAssociation newLica = null; + Assert.DoesNotThrow(delegate() { + newLica = licaService.updateLineItemCreativeAssociation(lica1); + }); + + Assert.NotNull(newLica); + Assert.AreEqual(newLica.creativeId, lica1.creativeId); + Assert.AreEqual(newLica.lineItemId, lica1.lineItemId); + Assert.AreEqual(newLica.destinationUrl, lica1.destinationUrl); + } + + /// + /// Test whether we can update a list of line item creative associations. + /// + [Test] + public void TestUpdateLineItemCreativeAssociations() { + lica1.destinationUrl = "http://news.google.com"; + lica2.destinationUrl = "http://news.google.com"; + + LineItemCreativeAssociation[] newLicas = null; + Assert.DoesNotThrow(delegate() { + newLicas = licaService.updateLineItemCreativeAssociations( + new LineItemCreativeAssociation[] {lica1, lica2}); + }); + + Assert.NotNull(newLicas); + Assert.AreEqual(newLicas.Length, 2); + + Assert.NotNull(newLicas[0]); + Assert.AreEqual(newLicas[0].creativeId, lica1.creativeId); + Assert.AreEqual(newLicas[0].lineItemId, lica1.lineItemId); + + Assert.NotNull(newLicas[1]); + Assert.AreEqual(newLicas[1].creativeId, lica2.creativeId); + Assert.AreEqual(newLicas[1].lineItemId, lica2.lineItemId); + } + } +} diff --git a/tests/Dfp/v201302/LineItemServiceTests.cs b/tests/Dfp/v201302/LineItemServiceTests.cs new file mode 100644 index 00000000000..56f5bc47cec --- /dev/null +++ b/tests/Dfp/v201302/LineItemServiceTests.cs @@ -0,0 +1,486 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201302 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class LineItemServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private LineItemService lineItemService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Placement id for running tests. + /// + private long placementId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Line item 1 for running tests. + /// + private LineItem lineItem1; + + /// + /// Line item 2 for running tests. + /// + private LineItem lineItem2; + + /// + /// Default public constructor. + /// + public LineItemServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + lineItemService = (LineItemService)user.GetService(DfpService.v201302.LineItemService); + + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + placementId = utils.CreatePlacement(user, new string[] {adUnitId}).id; + lineItem1 = utils.CreateLineItem(user, orderId, adUnitId); + lineItem2 = utils.CreateLineItem(user, orderId, adUnitId); + } + + /// + /// Test whether we can create a line item creative association. + /// + [Test] + public void TestCreateLineItem() { + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201302.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201302.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + LineItem localLineItem = null; + + Assert.DoesNotThrow(delegate() { + localLineItem = lineItemService.createLineItem(lineItem); + }); + + Assert.NotNull(localLineItem); + Assert.AreEqual(localLineItem.name, lineItem.name); + Assert.AreEqual(localLineItem.orderId, lineItem.orderId); + } + + /// + /// Test whether we can create a list of line items. + /// + [Test] + public void TestCreateLineItems() { + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201302.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201302.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + // Create an array to store local line item objects. + LineItem[] lineItems = new LineItem[2]; + + for (int i = 0; i < lineItems.Length; i++) { + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + lineItems[i] = lineItem; + } + + LineItem[] localLineItems = null; + + Assert.DoesNotThrow(delegate() { + localLineItems = lineItemService.createLineItems(lineItems); + }); + + Assert.NotNull(localLineItems); + Assert.AreEqual(localLineItems.Length, 2); + + Assert.AreEqual(localLineItems[0].name, lineItems[0].name); + Assert.AreEqual(localLineItems[0].orderId, lineItems[0].orderId); + + Assert.AreEqual(localLineItems[1].name, lineItems[1].name); + Assert.AreEqual(localLineItems[1].orderId, lineItems[1].orderId); + } + + /// + /// Test whether we can fetch an existing line item. + /// + [Test] + public void TestGetLineItem() { + LineItem localLineItem = null; + + Assert.DoesNotThrow(delegate() { + localLineItem = lineItemService.getLineItem(lineItem1.id); + }); + + Assert.NotNull(localLineItem); + Assert.AreEqual(localLineItem.id, lineItem1.id); + Assert.AreEqual(localLineItem.name, lineItem1.name); + Assert.AreEqual(localLineItem.orderId, lineItem1.orderId); + } + + /// + /// Test whether we can fetch a list of existing line items that match given + /// statement. + /// + [Test] + public void TestGetLineItemsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", lineItem1.id); + + LineItemPage page = null; + + Assert.DoesNotThrow(delegate() { + page = lineItemService.getLineItemsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results); + Assert.AreEqual(page.results[0].id, lineItem1.id); + Assert.AreEqual(page.results[0].name, lineItem1.name); + Assert.AreEqual(page.results[0].orderId, lineItem1.orderId); + } + + /// + /// Test whether we can activate a line item. + /// + [Test] + public void TestPerformLineItemAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE orderId = '{0}' and status = '{1}'", + orderId, ComputedStatus.NEEDS_CREATIVES); + + ActivateLineItems action = new ActivateLineItems(); + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = lineItemService.performLineItemAction(action, statement); + }); + + Assert.NotNull(result); + } + + /// + /// Test whether we can update a line item. + /// + [Test] + public void TestUpdateLineItem() { + lineItem1.deliveryRateType = DeliveryRateType.AS_FAST_AS_POSSIBLE; + + LineItem localLineItem = null; + Assert.DoesNotThrow(delegate() { + localLineItem = lineItemService.updateLineItem(lineItem1); + }); + + Assert.NotNull(localLineItem); + Assert.AreEqual(localLineItem.id, lineItem1.id); + Assert.AreEqual(localLineItem.name, lineItem1.name); + Assert.AreEqual(localLineItem.orderId, lineItem1.orderId); + Assert.AreEqual(localLineItem.deliveryRateType, lineItem1.deliveryRateType); + } + + /// + /// Test whether we can update a list of line items. + /// + [Test] + public void TestUpdateLineItems() { + lineItem1.costPerUnit.microAmount = 3500000; + lineItem2.costPerUnit.microAmount = 3500000; + + LineItem[] localLineItems = null; + + Assert.DoesNotThrow(delegate() { + localLineItems = lineItemService.updateLineItems(new LineItem[] {lineItem1, lineItem2}); + }); + + Assert.NotNull(localLineItems); + Assert.AreEqual(localLineItems.Length, 2); + + Assert.AreEqual(localLineItems[0].id, lineItem1.id); + Assert.AreEqual(localLineItems[0].name, lineItem1.name); + Assert.AreEqual(localLineItems[0].orderId, lineItem1.orderId); + Assert.AreEqual(localLineItems[0].costPerUnit.microAmount, lineItem1.costPerUnit.microAmount); + + Assert.AreEqual(localLineItems[1].id, lineItem2.id); + Assert.AreEqual(localLineItems[1].name, lineItem2.name); + Assert.AreEqual(localLineItems[1].orderId, lineItem2.orderId); + Assert.AreEqual(localLineItems[1].costPerUnit.microAmount, lineItem2.costPerUnit.microAmount); + } + } +} diff --git a/tests/Dfp/v201302/OrderServiceTests.cs b/tests/Dfp/v201302/OrderServiceTests.cs new file mode 100644 index 00000000000..bf5e21c86fd --- /dev/null +++ b/tests/Dfp/v201302/OrderServiceTests.cs @@ -0,0 +1,229 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfp.Tests.v201302 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class OrderServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private OrderService orderService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Default public constructor. + /// + public OrderServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + orderService = (OrderService) user.GetService(DfpService.v201302.OrderService); + + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + } + + /// + /// Test whether we can create an order. + /// + [Test] + public void TestCreateOrder() { + Order order = new Order(); + order.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order.advertiserId = advertiserId; + order.traffickerId = traffickerId; + order.currencyCode = "USD"; + + Order newOrder = null; + + Assert.DoesNotThrow(delegate() { + newOrder = orderService.createOrder(order); + }); + + Assert.NotNull(newOrder); + Assert.AreEqual(order.name, newOrder.name); + } + + /// + /// Test whether we can create a list of orders. + /// + [Test] + public void TestCreateOrders() { + Order order1 = new Order(); + order1.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order1.advertiserId = advertiserId; + order1.traffickerId = traffickerId; + order1.currencyCode = "USD"; + + Order order2 = new Order(); + order2.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order2.advertiserId = advertiserId; + order2.traffickerId = traffickerId; + order2.currencyCode = "USD"; + + Order[] newOrders = null; + + Assert.DoesNotThrow(delegate() { + newOrders = orderService.createOrders(new Order[] {order1, order2}); + }); + + Statement statement = new Statement(); + statement.query = string.Format("WHERE advertiserId = '{0}' LIMIT 500", advertiserId); + + OrderPage page = orderService.getOrdersByStatement(statement); + Assert.NotNull(newOrders); + Assert.AreEqual(newOrders.Length, 2); + + Assert.AreEqual(order1.name, newOrders[0].name); + Assert.AreEqual(order1.advertiserId, newOrders[0].advertiserId); + Assert.AreEqual(order1.traffickerId, newOrders[0].traffickerId); + Assert.AreEqual(order1.currencyCode, newOrders[0].currencyCode); + + Assert.AreEqual(order2.name, newOrders[1].name); + Assert.AreEqual(order2.advertiserId, newOrders[1].advertiserId); + Assert.AreEqual(order2.traffickerId, newOrders[1].traffickerId); + Assert.AreEqual(order2.currencyCode, newOrders[1].currencyCode); + } + + /// + /// Test whether we can perform an order action. + /// + [Test] + public void TestPerformOrderAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE status IN ('{0}', '{1}')", + OrderStatus.DRAFT, OrderStatus.PENDING_APPROVAL); + + ApproveOrders action = new ApproveOrders(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = orderService.performOrderAction(action, statement); + }); + + Assert.NotNull(result); + Assert.GreaterOrEqual(result.numChanges, 0); + } + + /// + /// Test whether we can create an order. + /// + [Test] + public void TestGetOrder() { + Order order = null; + + Assert.DoesNotThrow(delegate() { + order = orderService.getOrder(orderId); + }); + + Assert.NotNull(order); + Assert.AreEqual(order.id, orderId); + Assert.AreEqual(order.advertiserId, advertiserId); + Assert.AreEqual(order.traffickerId, traffickerId); + Assert.AreEqual(order.salespersonId, salespersonId); + } + + /// + /// Test whether we can update an order. + /// + [Test] + public void TestUpdateOrder() { + Order order = orderService.getOrder(orderId); + order.notes = "Spoke to advertiser. All is well."; + + Order newOrder = null; + + Assert.DoesNotThrow(delegate() { + newOrder = orderService.updateOrder(order); + }); + + Assert.NotNull(newOrder); + Assert.AreEqual(order.name, newOrder.name); + Assert.AreEqual(order.advertiserId, newOrder.advertiserId); + Assert.AreEqual(order.traffickerId, newOrder.traffickerId); + Assert.AreEqual(order.currencyCode, newOrder.currencyCode); + Assert.AreEqual(order.notes, newOrder.notes); + } + + /// + /// Test whether we can update a list of orders. + /// + [Test] + public void TestUpdateOrders() { + Order order = orderService.getOrder(orderId); + order.notes = "Spoke to advertiser. All is well."; + + Order[] newOrders = null; + + Assert.DoesNotThrow(delegate() { + newOrders = orderService.updateOrders(new Order[] {order}); + }); + + Assert.NotNull(newOrders); + Assert.AreEqual(newOrders.Length, 1); + + Assert.AreEqual(order.id, newOrders[0].id); + Assert.AreEqual(order.name, newOrders[0].name); + Assert.AreEqual(order.notes, newOrders[0].notes); + Assert.AreEqual(order.advertiserId, newOrders[0].advertiserId); + Assert.AreEqual(order.traffickerId, newOrders[0].traffickerId); + Assert.AreEqual(order.currencyCode, newOrders[0].currencyCode); + } + } +} diff --git a/tests/Dfp/v201302/PlacementServiceTests.cs b/tests/Dfp/v201302/PlacementServiceTests.cs new file mode 100644 index 00000000000..9cfe844149d --- /dev/null +++ b/tests/Dfp/v201302/PlacementServiceTests.cs @@ -0,0 +1,242 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201302 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class PlacementServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private PlacementService placementService; + + /// + /// The ad unit 1 for running tests. + /// + private AdUnit adUnit1; + + /// + /// The ad unit 2 for running tests. + /// + private AdUnit adUnit2; + + /// + /// The placement for running tests. + /// + private Placement placement; + + /// + /// Default public constructor. + /// + public PlacementServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + placementService = (PlacementService) user.GetService(DfpService.v201302.PlacementService); + adUnit1 = utils.CreateAdUnit(user); + adUnit2 = utils.CreateAdUnit(user); + placement = utils.CreatePlacement(user, new string[] {adUnit1.id, adUnit2.id}); + } + + /// + /// Test whether we can create a placement. + /// + [Test] + public void TestCreatePlacement() { + Placement placement = new Placement(); + placement.name = string.Format("Medium Square AdUnit Placement #{0}", + new TestUtils().GetTimeStamp()); + placement.description = "Contains ad units that can hold creatives of size 300x250"; + placement.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement newPlacement = null; + + Assert.DoesNotThrow(delegate() { + newPlacement = placementService.createPlacement(placement); + }); + + Assert.NotNull(newPlacement); + Assert.AreEqual(newPlacement.name, placement.name); + Assert.AreEqual(newPlacement.description, placement.description); + Assert.Contains(adUnit1.id, newPlacement.targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacement.targetedAdUnitIds); + } + + /// + /// Test whether we can create a list of placements items. + /// + [Test] + public void TestCreatePlacements() { + TestUtils utils = new TestUtils(); + Placement placement1 = new Placement(); + placement1.name = string.Format("Medium Square AdUnit Placement #{0}", utils.GetTimeStamp()); + placement1.description = "Contains ad units that can hold creatives of size 300x250"; + placement1.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement placement2 = new Placement(); + placement2.name = string.Format("Medium Square AdUnit Placement #{0}", utils.GetTimeStamp()); + placement2.description = "Contains ad units that can hold creatives of size 300x250"; + placement2.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement[] newPlacements = null; + + Assert.DoesNotThrow(delegate() { + newPlacements = placementService.createPlacements(new Placement[] {placement1, placement2}); + }); + + Assert.NotNull(newPlacements); + Assert.AreEqual(newPlacements.Length, 2); + + Assert.NotNull(newPlacements[0]); + Assert.AreEqual(newPlacements[0].name, placement1.name); + Assert.AreEqual(newPlacements[0].description, placement1.description); + Assert.Contains(adUnit1.id, newPlacements[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[0].targetedAdUnitIds); + + Assert.NotNull(newPlacements[1]); + Assert.AreEqual(newPlacements[1].name, placement2.name); + Assert.AreEqual(newPlacements[1].description, placement2.description); + Assert.Contains(adUnit1.id, newPlacements[1].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[1].targetedAdUnitIds); + } + + /// + /// Test whether we can create a list of placements items. + /// + [Test] + public void TestGetPlacement() { + Placement newPlacement = null; + + Assert.DoesNotThrow(delegate() { + newPlacement = placementService.getPlacement(placement.id); + }); + + Assert.NotNull(newPlacement); + Assert.AreEqual(newPlacement.name, placement.name); + Assert.AreEqual(newPlacement.description, placement.description); + Assert.Contains(adUnit1.id, newPlacement.targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacement.targetedAdUnitIds); + } + + /// + /// Test whether we can fetch a list of existing placements that match given + /// statement. + /// + [Test] + public void TestGetPlacementsByStatement() { + // Create a Statement to only select active placements. + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}'", placement.id); + + PlacementPage page = null; + + Assert.DoesNotThrow(delegate() { + page = placementService.getPlacementsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.results.Length, 1); + + Assert.AreEqual(page.results[0].id, placement.id); + Assert.AreEqual(page.results[0].name, placement.name); + Assert.AreEqual(page.results[0].description, placement.description); + Assert.Contains(adUnit1.id, page.results[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, page.results[0].targetedAdUnitIds); + } + + /// + /// Test whether we can deactivate a placement. + /// + [Test] + public void TestPerformPlacementAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE status = '{0}'", InventoryStatus.ACTIVE); + + DeactivatePlacements action = new DeactivatePlacements(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = placementService.performPlacementAction(action, statement); + }); + + Assert.NotNull(result); + Assert.GreaterOrEqual(result.numChanges, 0); + } + + /// + /// Test whether we can update a placement. + /// + [Test] + public void TestUpdatePlacement() { + placement.description += "More description"; + + Placement newPlacement = null; + + Assert.DoesNotThrow(delegate() { + newPlacement = placementService.updatePlacement(placement); + }); + + Assert.NotNull(newPlacement); + Assert.AreEqual(newPlacement.name, placement.name); + Assert.AreEqual(newPlacement.description, placement.description); + Assert.Contains(adUnit1.id, newPlacement.targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacement.targetedAdUnitIds); + } + + /// + /// Test whether we can update a list of placements. + /// + [Test] + public void TestUpdatePlacements() { + placement.description += "More description"; + + Placement[] newPlacements = null; + + Assert.DoesNotThrow(delegate() { + newPlacements = placementService.updatePlacements(new Placement[] {placement}); + }); + + Assert.NotNull(newPlacements); + Assert.AreEqual(newPlacements.Length, 1); + + Assert.NotNull(newPlacements[0]); + Assert.AreEqual(newPlacements[0].name, placement.name); + Assert.AreEqual(newPlacements[0].description, placement.description); + Assert.Contains(adUnit1.id, newPlacements[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[0].targetedAdUnitIds); + } + } +} diff --git a/tests/Dfp/v201302/ReportServiceTests.cs b/tests/Dfp/v201302/ReportServiceTests.cs new file mode 100644 index 00000000000..f0058f6c2d7 --- /dev/null +++ b/tests/Dfp/v201302/ReportServiceTests.cs @@ -0,0 +1,161 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201302 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class ReportServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private ReportService reportService; + + /// + /// Report id for running further tests. + /// + long reportId; + + /// + /// Default public constructor. + /// + public ReportServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + reportService = (ReportService) user.GetService(DfpService.v201302.ReportService); + reportId = utils.CreateReport(user).id; + } + + /// + /// Test whether we can run a delivery report. + /// + [Test] + public void TestRunDeliveryReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can run an inventory report. + /// + [Test] + public void TestRunInventoryReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.DATE}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + Column.TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + Column.TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_WEEK; + + ReportJob newReportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can run a sales report. + /// + [Test] + public void TestRunSalesReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.SALESPERSON_ID, + Dimension.SALESPERSON_NAME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CPM_AND_CPC_REVENUE, Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + ReportJob newReportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can retrieve existing report job. + /// + [Test] + public void TestGetReportJob() { + ReportJob reportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.getReportJob(reportId); + }); + + Assert.NotNull(reportJob); + Assert.AreEqual(reportJob.id, reportId); + } + + /// + /// Test whether we can retrieve report download URL. + /// + [Test] + public void TestGetReportDownloadUrl() { + string url = null; + + Assert.DoesNotThrow(delegate() { + url = reportService.getReportDownloadURL(reportId, ExportFormat.CSV_EXCEL); + }); + + Assert.True(Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)); + + Assert.DoesNotThrow(delegate() { + url = reportService.getReportDownloadURL(reportId, ExportFormat.TSV); + }); + + Assert.True(Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)); + } + } +} diff --git a/tests/Dfp/v201302/StatementBuilderTests.cs b/tests/Dfp/v201302/StatementBuilderTests.cs new file mode 100644 index 00000000000..cc5e1200489 --- /dev/null +++ b/tests/Dfp/v201302/StatementBuilderTests.cs @@ -0,0 +1,275 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using System.Xml; +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; +using NUnit.Framework; +using DateTime = Google.Api.Ads.Dfp.v201302.DateTime; + +namespace Google.Api.Ads.Dfp.Tests.v201302 { + + /// + /// UnitTests for class. + /// + [TestFixture] + public class StatementBuilderTests { + + private static bool StatementsAreEqual(Statement s1, Statement s2) { + // Assumes both Statements are non-null and have non-null properties + if (String.Compare(s1.query, s2.query, true) != 0) { + return false; + } + if (s1.values.Length != s2.values.Length) { + return false; + } + // Assumes Statement values are in the same order + for (int i = 0; i < s1.values.Length; i++) { + if (!StringValueMapEntriesAreEqual(s1.values[i], s2.values[i])) { + return false; + } + } + return true; + } + + private static bool StringValueMapEntriesAreEqual(String_ValueMapEntry entry1, + String_ValueMapEntry entry2) { + return String.Equals(entry1.key, entry2.key) && ValuesAreEqual(entry1.value, entry2.value); + } + + private delegate bool ValueEqualityDelegate(Value value1, Value value2); + + private static bool ValuesAreEqual(Value value1, Value value2) { + Dictionary switcher = + new Dictionary(); + switcher.Add(typeof(TextValue), new ValueEqualityDelegate(TextValuesAreEqual)); + switcher.Add(typeof(NumberValue), new ValueEqualityDelegate(NumberValuesAreEqual)); + switcher.Add(typeof(BooleanValue), new ValueEqualityDelegate(BooleanValuesAreEqual)); + switcher.Add(typeof(DateTimeValue), new ValueEqualityDelegate(DateTimeValuesAreEqual)); + + if (switcher.ContainsKey(value1.GetType())) { + return switcher[value1.GetType()](value1, value2); + } + throw new NotImplementedException(String.Format("Unknown Value type {0}", value1.GetType())); + } + + private static bool TextValuesAreEqual(Value value1, Value value2) { + return String.Equals((value1 as TextValue).value, (value2 as TextValue).value); + } + + private static bool NumberValuesAreEqual(Value value1, Value value2) { + return String.Equals((value1 as NumberValue).value, (value2 as NumberValue).value); + } + + private static bool BooleanValuesAreEqual(Value value1, Value value2) { + return (value1 as BooleanValue).value == (value2 as BooleanValue).value; + } + + private static bool DateTimeValuesAreEqual(Value value1, Value value2) { + DateTime dateTime1 = (value1 as DateTimeValue).value; + DateTime dateTime2 = (value2 as DateTimeValue).value; + return DatesAreEqual(dateTime1.date, dateTime2.date) + && dateTime1.hour == dateTime2.hour + && dateTime1.minute == dateTime2.minute + && dateTime1.second == dateTime2.second + && String.Equals(dateTime1.timeZoneID, dateTime2.timeZoneID); + } + + private static bool DatesAreEqual(Date date1, Date date2) { + return date1.day == date2.day + && date1.month == date2.month + && date1.year == date2.year; + } + + [Test] + public void TestStatementBuilderBlankStatement() { + StatementBuilder statementBuilder = new StatementBuilder(); + + Statement expectedStatement = new Statement(); + expectedStatement.query = ""; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderBasicStatement() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("ID = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE ID = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderIgnoresKeyword() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("WHERE ID = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE ID = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderIncludesKeywordPrefix() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("WHEREWITHALL = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE WHEREWITHALL = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestAllStatementBuilderPartialFunctions() { + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Name, Id") + .From("Geo_Target") + .Where("Targetable = :targetable") + .OrderBy("Id DESC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .Offset(0) + .AddValue("targetable", true) + .IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .RemoveLimitAndOffset(); + Assert.AreEqual(null, statementBuilder.GetOffset()); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "SELECT Name, Id FROM Geo_Target" + + " WHERE Targetable = :targetable ORDER BY Id DESC"; + String_ValueMapEntry targetableEntry = new String_ValueMapEntry(); + targetableEntry.key = "targetable"; + BooleanValue targetableValue = new BooleanValue(); + targetableValue.value = true; + targetableEntry.value = targetableValue; + expectedStatement.values = new String_ValueMapEntry[] {targetableEntry}; + Assert.True(StatementsAreEqual(expectedStatement, statementBuilder.ToStatement())); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesWhere() { + StatementBuilder statementBuilder = new StatementBuilder("WHERE ID = 1") + .Where("ID = 2"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesFrom() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .From("Geo_Table"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesSelect() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Select("Id, Type"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesLimit() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Offset(100); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesIncreaseOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .IncreaseOffsetBy(100); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesRemoveLimitAndOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .RemoveLimitAndOffset(); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithSelect() { + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Id, Type"); + statementBuilder.Query = "SELECT Id, Type FROM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithFrom() { + StatementBuilder statementBuilder = new StatementBuilder() + .From("Geo_Table"); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithWhere() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("Type = City"); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithLimit() { + StatementBuilder statementBuilder = new StatementBuilder() + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithOffset() { + StatementBuilder statementBuilder = new StatementBuilder() + .Offset(100); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + } +} diff --git a/tests/Dfp/v201302/TestUtils.cs b/tests/Dfp/v201302/TestUtils.cs new file mode 100644 index 00000000000..1a6a44c0214 --- /dev/null +++ b/tests/Dfp/v201302/TestUtils.cs @@ -0,0 +1,350 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201302; +using Google.Api.Ads.Dfp.v201302; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; +using System.Threading; +using System.Configuration; +using System.Collections; + +namespace Google.Api.Ads.Dfp.Tests.v201302 { + /// + /// A utility class to assist the testing of v201004 services. + /// + public class TestUtils { + public User GetCurrentUser(DfpUser user) { + return GetUserByEmail(user, new DfpAppConfig().Email); + } + + public User GetTrafficker(DfpUser user) { + return GetUserByEmail(user, "dfp.api.trafficker@gmail.com"); + } + + public User GetSalesperson(DfpUser user) { + return GetUserByEmail(user, "dfp.api.salesperson@gmail.com"); + } + + public User GetUserByEmail(DfpUser user, string email) { + UserService userService = (UserService) user.GetService(DfpService.v201302.UserService); + + // Create a Statement to get all users sorted by name. + Statement statement = new Statement(); + statement.query = string.Format("where email = '{0}' LIMIT 1", email); + + UserPage page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + return page.results[0]; + } else { + return null; + } + } + + public Role GetRole(DfpUser user, string roleName) { + UserService userService = (UserService)user.GetService(DfpService.v201302.UserService); + + // Get all roles. + Role[] roles = userService.getAllRoles(); + foreach (Role role in roles) { + if (role.name == roleName) { + return role; + } + } + return null; + } + + /// + /// Create a test company for running further tests. + /// + /// A test company for running further tests. + public Company CreateCompany(DfpUser user, CompanyType companyType) { + CompanyService companyService = (CompanyService) user.GetService( + DfpService.v201302.CompanyService); + Company company = new Company(); + company.name = string.Format("Company #{0}", GetTimeStamp()); + company.type = companyType; + + return companyService.createCompany(company); + } + + public Order CreateOrder(DfpUser user, long advertiserId, long salespersonId, + long traffickerId) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201302.OrderService); + + Order order = new Order(); + order.name = string.Format("Order #{0}", GetTimeStamp()); + order.advertiserId = advertiserId; + order.salespersonId = salespersonId; + order.traffickerId = traffickerId; + + return orderService.createOrder(order); + } + + public LineItem CreateLineItem(DfpUser user, long orderId, string adUnitId) { + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201302.LineItemService); + + long placementId = CreatePlacement(user, new string[] {adUnitId}).id; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201302.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201302.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + return lineItemService.createLineItem(lineItem); + } + + /// + /// Create a test company for running further tests. + /// + /// A creative for running further tests. + public Creative CreateCreative(DfpUser user, long advertiserId) { + CreativeService creativeService = (CreativeService)user.GetService( + DfpService.v201302.CreativeService); + + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", GetTimeStamp()); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + return creativeService.createCreative(imageCreative); + } + + public LineItemCreativeAssociation CreateLica(DfpUser user, long lineItemId, long creativeId) { + LineItemCreativeAssociationService licaService = + (LineItemCreativeAssociationService)user.GetService( + DfpService.v201302.LineItemCreativeAssociationService); + + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId; + lica.lineItemId = lineItemId; + + return licaService.createLineItemCreativeAssociation(lica); + } + + public AdUnit CreateAdUnit(DfpUser user) { + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201302.InventoryService); + + AdUnit adUnit = new AdUnit(); + adUnit.name = string.Format("Ad_Unit_{0}", GetTimeStamp()); + adUnit.parentId = FindRootAdUnit(user).id; + + // Set the size of possible creatives that can match this ad unit. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + return inventoryService.createAdUnit(adUnit); + } + + public AdUnit FindRootAdUnit(DfpUser user) { + // Get InventoryService. + InventoryService inventoryService = + (InventoryService)user.GetService(DfpService.v201302.InventoryService); + + // Create a Statement to only select the root ad unit. + Statement statement = new Statement(); + statement.query = "WHERE parentId IS NULL LIMIT 500"; + + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + return page.results[0]; + } + + public Placement CreatePlacement(DfpUser user, string[] targetedAdUnitIds) { + // Get InventoryService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201302.PlacementService); + + Placement placement = new Placement(); + placement.name = string.Format("Test placement #{0}", this.GetTimeStamp()); + placement.description = "Test placement"; + placement.targetedAdUnitIds = targetedAdUnitIds; + + return placementService.createPlacement(placement); + } + + public ReportJob CreateReport(DfpUser user) { + // Get ReportService. + ReportService reportService = + (ReportService) user.GetService(DfpService.v201302.ReportService); + + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + return reportService.runReportJob(reportJob); + } + + /// + /// Gets the current timestamp as a string. + /// + /// The current timestamp as a string. + public string GetTimeStamp() { + Thread.Sleep(500); + return (System.DateTime.UtcNow - new System.DateTime(1970, 1, 1)).Ticks. + ToString(); + } + } +} diff --git a/tests/Dfp/v201302/UserServiceTests.cs b/tests/Dfp/v201302/UserServiceTests.cs new file mode 100644 index 00000000000..988d50c9389 --- /dev/null +++ b/tests/Dfp/v201302/UserServiceTests.cs @@ -0,0 +1,217 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201302; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201302 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class UserServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private UserService userService; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Current user id for running tests. + /// + private long currentUserId; + + /// + /// Default public constructor. + /// + public UserServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + userService = (UserService) user.GetService(DfpService.v201302.UserService); + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + currentUserId = utils.GetCurrentUser(user).id; + } + + /// + /// Test whether we can fetch all roles. + /// + [Test] + public void TestGetAllRoles() { + Role[] roles = null; + + Assert.DoesNotThrow(delegate() { + roles = userService.getAllRoles(); + }); + Assert.NotNull(roles); + Assert.GreaterOrEqual(roles.Length, 0); + } + + /// + /// Test whether we can fetch the current user. + /// + [Test] + public void TestGetCurrentUser() { + User user = null; + + Assert.DoesNotThrow(delegate() { + user = userService.getCurrentUser(); + }); + + Assert.NotNull(user); + Assert.AreEqual(user.id, currentUserId); + } + + /// + /// Test whether we can fetch an existing user. + /// + [Test] + public void TestGetUser() { + User user = null; + + Assert.DoesNotThrow(delegate() { + user = userService.getUser(salespersonId); + }); + + Assert.NotNull(user); + Assert.AreEqual(user.id, salespersonId); + } + + /// + /// Test whether we can fetch a list of existing users that match given + /// statement. + /// + [Test] + public void TestGetUsersByStatement() { + Statement statement = new Statement(); + statement.query = "ORDER BY name LIMIT 500"; + + UserPage page = null; + + Assert.DoesNotThrow(delegate() { + page = userService.getUsersByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + + List salesPersonIds = new List(); + List traffickerIds = new List(); + + foreach(User tempUser in page.results) { + if (tempUser.roleName == "Salesperson") { + salesPersonIds.Add(tempUser.id); + } else if (tempUser.roleName == "Trafficker") { + traffickerIds.Add(tempUser.id); + } + } + Assert.Contains(salespersonId, salesPersonIds); + Assert.Contains(traffickerId, traffickerIds); + } + + /// + /// Test whether we can deactivate and activate a user. + /// + [Test] + public void TestPerformUserAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = {0}", salespersonId); + + DeactivateUsers action = new DeactivateUsers(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = userService.performUserAction(action, statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + + // Activate the user again. + + Assert.DoesNotThrow(delegate() { + result = userService.performUserAction(new ActivateUsers(), statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update a user. + /// + [Test] + public void TestUpdateUser() { + User user = userService.getUser(salespersonId); + user.preferredLocale = (user.preferredLocale == "fr_FR")? "en_US" : "fr_FR"; + + User newUser = null; + + Assert.DoesNotThrow(delegate() { + newUser = userService.updateUser(user); + }); + + Assert.NotNull(newUser); + Assert.AreEqual(newUser.id, user.id); + Assert.AreEqual(newUser.preferredLocale, user.preferredLocale); + } + + /// + /// Test whether we can update a list of users. + /// + [Test] + public void TestUpdateUsers() { + User user = userService.getUser(salespersonId); + user.preferredLocale = (user.preferredLocale == "fr_FR")? "en_US" : "fr_FR"; + + User[] newUsers = null; + + Assert.DoesNotThrow(delegate() { + newUsers = userService.updateUsers(new User[] {user}); + }); + + Assert.NotNull(newUsers); + Assert.AreEqual(newUsers.Length, 1); + Assert.AreEqual(newUsers[0].id, user.id); + Assert.AreEqual(newUsers[0].preferredLocale, user.preferredLocale); + } + } +} diff --git a/tests/Dfp/v201306/CompanyServiceTests.cs b/tests/Dfp/v201306/CompanyServiceTests.cs new file mode 100644 index 00000000000..87dc51fa27d --- /dev/null +++ b/tests/Dfp/v201306/CompanyServiceTests.cs @@ -0,0 +1,192 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201306 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class CompanyServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private CompanyService companyService; + + /// + /// The company to be used for further tests. + /// + private Company testCompany1 = null; + + /// + /// The company to be used for further tests. + /// + private Company testCompany2 = null; + + /// + /// Default public constructor. + /// + public CompanyServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + companyService = (CompanyService) user.GetService(DfpService.v201306.CompanyService); + testCompany1 = utils.CreateCompany(user, CompanyType.ADVERTISER); + testCompany2 = utils.CreateCompany(user, CompanyType.ADVERTISER); + } + + + /// + /// Test whether we can create a company. + /// + [Test] + public void TestCreateCompany() { + Company company = new Company(); + company.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company.type = CompanyType.ADVERTISER; + + Company newCompany = null; + Assert.DoesNotThrow(delegate() { + newCompany = companyService.createCompany(company); + }); + + Assert.NotNull(newCompany); + Assert.AreEqual(company.name, newCompany.name); + Assert.AreEqual(company.type, newCompany.type); + } + + /// + /// Test whether we can create a list of companies. + /// + [Test] + public void TestCreateCompanies() { + Company company1 = new Company(); + company1.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company1.type = CompanyType.ADVERTISER; + + Company company2 = new Company(); + company2.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company2.type = CompanyType.ADVERTISER; + + Company[] newCompanies = null; + Assert.DoesNotThrow(delegate() { + newCompanies = companyService.createCompanies(new Company[] {company1, company2}); + }); + + Assert.NotNull(newCompanies); + Assert.AreEqual(newCompanies.Length, 2); + + Assert.AreEqual(company1.name, newCompanies[0].name); + Assert.AreEqual(company1.type, newCompanies[0].type); + Assert.AreEqual(company2.name, newCompanies[1].name); + Assert.AreEqual(company2.type, newCompanies[1].type); + } + + /// + /// Test whether we can fetch an existing company. + /// + [Test] + public void TestGetCompany() { + Company company1 = null; + + Assert.DoesNotThrow(delegate() { + company1 = companyService.getCompany(testCompany1.id); + }); + + Assert.NotNull(company1); + Assert.AreEqual(testCompany1.id, company1.id); + Assert.AreEqual(testCompany1.name, company1.name); + } + + /// + /// Test whether we can fetch a list of existing companies that match given + /// statement. + /// + [Test] + public void TestGetCompaniesByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = {0} ORDER BY name LIMIT 1", testCompany1.id); + CompanyPage page = null; + + Assert.DoesNotThrow(delegate() { + page = companyService.getCompaniesByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.results.Length, 1); + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].id, testCompany1.id); + Assert.AreEqual(page.results[0].name, testCompany1.name); + } + + /// + /// Test whether we can update a company. + /// + [Test] + public void TestUpdateCompany() { + testCompany1.name = "Corp " + testCompany1.name; + Company newCompany = null; + + Assert.DoesNotThrow(delegate() { + newCompany = companyService.updateCompany(testCompany1); + }); + + Assert.NotNull(newCompany); + Assert.AreEqual(newCompany.id, testCompany1.id); + Assert.AreEqual(newCompany.name, testCompany1.name); + } + + /// + /// Test whether we can update a list of companies. + /// + [Test] + public void TestUpdateCompanies() { + testCompany1.name = "Corp " + testCompany1.name; + testCompany2.name = "Corp " + testCompany2.name; + + Company[] newCompanies = null; + + Assert.DoesNotThrow(delegate() { + newCompanies = companyService.updateCompanies(new Company[] {testCompany1, testCompany2}); + }); + + Assert.NotNull(newCompanies); + Assert.AreEqual(newCompanies.Length, 2); + + Assert.AreEqual(testCompany1.name, newCompanies[0].name); + Assert.AreEqual(testCompany1.type, newCompanies[0].type); + Assert.AreEqual(testCompany2.name, newCompanies[1].name); + Assert.AreEqual(testCompany2.type, newCompanies[1].type); + } + } +} diff --git a/tests/Dfp/v201306/CreativeServiceTests.cs b/tests/Dfp/v201306/CreativeServiceTests.cs new file mode 100644 index 00000000000..7fb5d086883 --- /dev/null +++ b/tests/Dfp/v201306/CreativeServiceTests.cs @@ -0,0 +1,270 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201306 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class CreativeServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private CreativeService creativeService; + + /// + /// The advertiser company id to be used for running tests. + /// + private long advertiserId = 0; + + /// + /// The creative 1 to be used for running tests. + /// + private Creative creative1 = null; + + /// + /// The creative 2 to be used for running tests. + /// + private Creative creative2 = null; + + /// + /// Default public constructor. + /// + public CreativeServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + creativeService = (CreativeService)user.GetService(DfpService.v201306.CreativeService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + creative1 = utils.CreateCreative(user, advertiserId); + creative2 = utils.CreateCreative(user, advertiserId); + } + + /// + /// Test whether we can create a creative. + /// + [Test] + public void TestCreateCreative() { + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", new TestUtils().GetTimeStamp()); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + Creative newCreative = null; + + Assert.DoesNotThrow(delegate() { + newCreative = creativeService.createCreative(imageCreative); + }); + + Assert.NotNull(newCreative); + Assert.That(newCreative is ImageCreative); + Assert.AreEqual(newCreative.advertiserId, imageCreative.advertiserId); + Assert.AreEqual(newCreative.name, imageCreative.name); + } + + /// + /// Test whether we can create a list of creatives. + /// + [Test] + public void TestCreateCreatives() { + // Create an array to store local image creative objects. + Creative[] imageCreatives = new ImageCreative[2]; + + for (int i = 0; i < 2; i++) { + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", i); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + imageCreatives[i] = imageCreative; + } + + Creative[] newCreatives = null; + + Assert.DoesNotThrow(delegate() { + newCreatives = creativeService.createCreatives(imageCreatives); + }); + + Assert.NotNull(newCreatives); + Assert.AreEqual(newCreatives.Length, 2); + Assert.NotNull(newCreatives[0]); + Assert.That(newCreatives[0] is ImageCreative); + Assert.AreEqual(newCreatives[0].advertiserId, advertiserId); + Assert.AreEqual(newCreatives[0].name, "Image creative #0"); + Assert.NotNull(newCreatives[1]); + Assert.That(newCreatives[1] is ImageCreative); + Assert.AreEqual(newCreatives[1].advertiserId, advertiserId); + Assert.AreEqual(newCreatives[1].name, "Image creative #1"); + } + + /// + /// Test whether we can fetch an existing creative. + /// + [Test] + public void TestGetCreative() { + Creative localCreative = null; + Assert.DoesNotThrow(delegate() { + localCreative = creativeService.getCreative(creative1.id); + }); + Assert.NotNull(localCreative); + Assert.AreEqual(localCreative.id, creative1.id); + Assert.AreEqual(localCreative.GetType(), creative1.GetType()); + Assert.AreEqual(localCreative.name, creative1.name); + Assert.AreEqual(localCreative.advertiserId, creative1.advertiserId); + Assert.AreEqual(localCreative.previewUrl, creative1.previewUrl); + Assert.AreEqual(localCreative.size.height, creative1.size.height); + Assert.AreEqual(localCreative.size.width, creative1.size.width); + } + + /// + /// Test whether we can fetch a list of existing creatives that match given + /// statement. + /// + [Test] + public void TestGetCreativesByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 500", creative1.id); + + CreativePage page = null; + + Assert.DoesNotThrow(delegate() { + page = creativeService.getCreativesByStatement(statement); + }); + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].id, creative1.id); + Assert.AreEqual(page.results[0].GetType(), creative1.GetType()); + Assert.AreEqual(page.results[0].name, creative1.name); + Assert.AreEqual(page.results[0].advertiserId, creative1.advertiserId); + Assert.AreEqual(page.results[0].previewUrl, creative1.previewUrl); + Assert.AreEqual(page.results[0].size.height, creative1.size.height); + Assert.AreEqual(page.results[0].size.width, creative1.size.width); + } + + /// + /// Test whether we can update a creative. + /// + [Test] + public void TestUpdateCreative() { + ImageCreative imageCreative = (ImageCreative) creative1; + imageCreative.destinationUrl = "http://news.google.com"; + + Creative newCreative = null; + + Assert.DoesNotThrow(delegate() { + newCreative = creativeService.updateCreative(creative1); + }); + + Assert.NotNull(newCreative); + Assert.AreEqual(newCreative.id, creative1.id); + Assert.AreEqual(newCreative.name, creative1.name); + Assert.AreEqual(newCreative.advertiserId, creative1.advertiserId); + Assert.AreEqual(newCreative.size.height, creative1.size.height); + Assert.AreEqual(newCreative.size.width, creative1.size.width); + Assert.That(newCreative is ImageCreative); + Assert.AreEqual((newCreative as ImageCreative).destinationUrl, imageCreative.destinationUrl); + } + + /// + /// Test whether we can update a list of creatives. + /// + [Test] + public void TestUpdateCreatives() { + ImageCreative imageCreative1 = (ImageCreative) creative1; + imageCreative1.destinationUrl = "http://news.google.com"; + + ImageCreative imageCreative2 = (ImageCreative) creative2; + imageCreative2.destinationUrl = "http://finance.google.com"; + + Creative[] newCreatives = null; + + Assert.DoesNotThrow(delegate() { + newCreatives = creativeService.updateCreatives(new Creative[] {creative1, creative2}); + }); + + Assert.NotNull(newCreatives); + Assert.AreEqual(newCreatives.Length, 2); + + Assert.AreEqual(newCreatives[0].id, creative1.id); + Assert.AreEqual(newCreatives[0].name, creative1.name); + Assert.AreEqual(newCreatives[0].advertiserId, creative1.advertiserId); + Assert.AreEqual(newCreatives[0].size.height, creative1.size.height); + Assert.AreEqual(newCreatives[0].size.width, creative1.size.width); + Assert.That(newCreatives[0] is ImageCreative); + Assert.AreEqual((newCreatives[0] as ImageCreative).destinationUrl, + imageCreative1.destinationUrl); + + Assert.AreEqual(newCreatives[1].id, creative2.id); + Assert.AreEqual(newCreatives[1].name, creative2.name); + Assert.AreEqual(newCreatives[1].advertiserId, creative2.advertiserId); + Assert.AreEqual(newCreatives[1].size.height, creative2.size.height); + Assert.AreEqual(newCreatives[1].size.width, creative2.size.width); + Assert.That(newCreatives[1] is ImageCreative); + Assert.AreEqual((newCreatives[1] as ImageCreative).destinationUrl, + imageCreative2.destinationUrl); + } + } +} diff --git a/tests/Dfp/v201306/ForecastServiceTests.cs b/tests/Dfp/v201306/ForecastServiceTests.cs new file mode 100644 index 00000000000..4c973f1b7e3 --- /dev/null +++ b/tests/Dfp/v201306/ForecastServiceTests.cs @@ -0,0 +1,171 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201306 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class ForecastServiceTests : BaseTests { + /// + /// ForecastService object to be used in this test. + /// + private ForecastService forecastService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Placement id for running tests. + /// + private long placementId; + + /// + /// Line item id for running tests. + /// + private long lineItemId; + + /// + /// Default public constructor. + /// + public ForecastServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + forecastService = (ForecastService)user.GetService(DfpService.v201306.ForecastService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + placementId = utils.CreatePlacement(user, new string[] {adUnitId}).id; + lineItemId = utils.CreateLineItem(user, orderId, adUnitId).id; + } + + /// + /// Test whether we can get a forecast for given line item. + /// + [Test] + public void TestGetForecast() { + TestUtils utils = new TestUtils(); + + LineItem lineItem = new LineItem(); + lineItem.name = string.Format("Line item #{0}", utils.GetTimeStamp()); + + lineItem.orderId = orderId; + + lineItem.targeting = new Targeting(); + lineItem.targeting.inventoryTargeting = new InventoryTargeting(); + lineItem.targeting.inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + Size size1 = new Size(); + size1.width = 300; + size1.height = 250; + + Size size2 = new Size(); + size2.width = 120; + size2.height = 600; + + // Create the creative placeholders. + CreativePlaceholder creativePlaceholder1 = new CreativePlaceholder(); + creativePlaceholder1.size = size1; + + CreativePlaceholder creativePlaceholder2 = new CreativePlaceholder(); + creativePlaceholder1.size = size2; + + lineItem.creativePlaceholders = + new CreativePlaceholder[] {creativePlaceholder1, creativePlaceholder2}; + + lineItem.lineItemType = LineItemType.STANDARD; + + // Set start date time and end date time. + lineItem.startDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddDays(1)); + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000; + + lineItem.creativeRotationType = CreativeRotationType.EVEN; + lineItem.discountType = LineItemDiscountType.PERCENTAGE; + + lineItem.unitsBought = 500000; + lineItem.unitType = UnitType.IMPRESSIONS; + + Forecast forecast = null; + Assert.DoesNotThrow(delegate() { + forecast = forecastService.getForecast(lineItem); + }); + Assert.NotNull(forecast); + Assert.AreEqual(forecast.orderId, orderId); + Assert.AreEqual(forecast.unitType, lineItem.unitType); + } + + /// + /// Test whether we can get a forecast for existing line item. + /// + [Test] + public void TestGetForecastById() { + Forecast forecast = null; + Assert.DoesNotThrow(delegate() { + forecast = forecastService.getForecastById(lineItemId); + }); + Assert.NotNull(forecast); + Assert.AreEqual(forecast.orderId, orderId); + } + } +} diff --git a/tests/Dfp/v201306/InventoryServiceTests.cs b/tests/Dfp/v201306/InventoryServiceTests.cs new file mode 100644 index 00000000000..7c71b2668fd --- /dev/null +++ b/tests/Dfp/v201306/InventoryServiceTests.cs @@ -0,0 +1,295 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201306 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class InventoryServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private InventoryService inventoryService; + + /// + /// The ad unit 1 for running tests. + /// + private AdUnit adUnit1; + + /// + /// The ad unit 2 for running tests. + /// + private AdUnit adUnit2; + + /// + /// Default public constructor. + /// + public InventoryServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + inventoryService = (InventoryService) user.GetService(DfpService.v201306.InventoryService); + adUnit1 = utils.CreateAdUnit(user); + adUnit2 = utils.CreateAdUnit(user); + } + + /// + /// Test whether we can create an ad unit. + /// + [Test] + public void TestCreateAdUnit() { + AdUnit localAdUnit = new AdUnit(); + localAdUnit.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit.parentId = adUnit1.id; + + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + localAdUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + + AdUnit newAdUnit = null; + + Assert.DoesNotThrow(delegate() { + newAdUnit = inventoryService.createAdUnit(localAdUnit); + }); + + Assert.NotNull(newAdUnit); + Assert.AreEqual(newAdUnit.name, localAdUnit.name); + Assert.AreEqual(newAdUnit.parentId, localAdUnit.parentId); + Assert.AreEqual(newAdUnit.parentId, adUnit1.id); + Assert.AreEqual(newAdUnit.status, localAdUnit.status); + Assert.AreEqual(newAdUnit.targetWindow, localAdUnit.targetWindow); + } + + /// + /// Test whether we can create a list of ad units. + /// + [Test] + public void TestCreateAdUnits() { + // Create ad unit 1. + AdUnit localAdUnit1 = new AdUnit(); + localAdUnit1.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit1.parentId = adUnit1.id; + + Size size1 = new Size(); + size1.width = 300; + size1.height = 250; + + AdUnitSize adUnitSize1 = new AdUnitSize(); + adUnitSize1.size = size1; + adUnitSize1.environmentType = EnvironmentType.BROWSER; + + localAdUnit1.adUnitSizes = new AdUnitSize[] {adUnitSize1}; + + // Create ad unit 2. + AdUnit localAdUnit2 = new AdUnit(); + localAdUnit2.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit2.parentId = adUnit1.id; + + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + + AdUnitSize adUnitSize2 = new AdUnitSize(); + adUnitSize2.size = size2; + adUnitSize2.environmentType = EnvironmentType.BROWSER; + + localAdUnit2.adUnitSizes = new AdUnitSize[] {adUnitSize2}; + + AdUnit[] newAdUnits = null; + + Assert.DoesNotThrow(delegate() { + newAdUnits = inventoryService.createAdUnits(new AdUnit[] {localAdUnit1, localAdUnit2}); + }); + + Assert.NotNull(newAdUnits); + Assert.AreEqual(newAdUnits.Length, 2); + + Assert.AreEqual(newAdUnits[0].name, localAdUnit1.name); + Assert.AreEqual(newAdUnits[0].parentId, localAdUnit1.parentId); + Assert.AreEqual(newAdUnits[0].parentId, adUnit1.id); + Assert.AreEqual(newAdUnits[0].status, localAdUnit1.status); + Assert.AreEqual(newAdUnits[0].targetWindow, localAdUnit1.targetWindow); + + Assert.AreEqual(newAdUnits[1].name, localAdUnit2.name); + Assert.AreEqual(newAdUnits[1].parentId, localAdUnit2.parentId); + Assert.AreEqual(newAdUnits[1].parentId, adUnit1.id); + Assert.AreEqual(newAdUnits[1].status, localAdUnit2.status); + Assert.AreEqual(newAdUnits[1].targetWindow, localAdUnit2.targetWindow); + } + + /// + /// Test whether we can fetch a list of existing ad units that match given + /// statement. + /// + [Test] + public void TestGetAdUnitsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", adUnit1.id); + + AdUnitPage page = null; + + Assert.DoesNotThrow(delegate() { + page = inventoryService.getAdUnitsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results[0]); + + Assert.AreEqual(page.results[0].name, adUnit1.name); + Assert.AreEqual(page.results[0].parentId, adUnit1.parentId); + Assert.AreEqual(page.results[0].id, adUnit1.id); + Assert.AreEqual(page.results[0].status, adUnit1.status); + Assert.AreEqual(page.results[0].targetWindow, adUnit1.targetWindow); + } + + /// + /// Test whether we can deactivate an ad unit. + /// + [Test] + public void TestPerformAdUnitAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", adUnit1.id); + + UpdateResult result = null; + Assert.DoesNotThrow(delegate() { + result = inventoryService.performAdUnitAction(new DeactivateAdUnits(), statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update an ad unit. + /// + [Test] + public void TestUpdateAdUnit() { + List adUnitSizes = new List(adUnit1.adUnitSizes); + + Size size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit1.adUnitSizes = adUnitSizes.ToArray(); + + AdUnit newAdUnit = null; + Assert.DoesNotThrow(delegate() { + newAdUnit = inventoryService.updateAdUnit(adUnit1); + }); + + Assert.NotNull(newAdUnit); + + Assert.AreEqual(newAdUnit.name, adUnit1.name); + Assert.AreEqual(newAdUnit.parentId, adUnit1.parentId); + Assert.AreEqual(newAdUnit.id, adUnit1.id); + Assert.AreEqual(newAdUnit.status, adUnit1.status); + Assert.AreEqual(newAdUnit.targetWindow, adUnit1.targetWindow); + Assert.AreEqual(newAdUnit.adUnitSizes.Length, adUnit1.adUnitSizes.Length); + } + + /// + /// Test whether we can update a list of an ad units. + /// + [Test] + public void TestUpdateAdUnits() { + List adUnitSizes = null; + Size size = null; + + // Modify ad unit 1. + adUnitSizes = new List(adUnit1.adUnitSizes); + size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit1.adUnitSizes = adUnitSizes.ToArray(); + + // Modify ad unit 2. + adUnitSizes = new List(adUnit2.adUnitSizes); + size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit2.adUnitSizes = adUnitSizes.ToArray(); + + AdUnit[] newAdUnits = null; + Assert.DoesNotThrow(delegate() { + newAdUnits = inventoryService.updateAdUnits(new AdUnit[] {adUnit1, adUnit2}); + }); + + Assert.NotNull(newAdUnits); + Assert.AreEqual(newAdUnits.Length, 2); + + Assert.AreEqual(newAdUnits[0].name, adUnit1.name); + Assert.AreEqual(newAdUnits[0].parentId, adUnit1.parentId); + Assert.AreEqual(newAdUnits[0].id, adUnit1.id); + Assert.AreEqual(newAdUnits[0].status, adUnit1.status); + Assert.AreEqual(newAdUnits[0].targetWindow, adUnit1.targetWindow); + Assert.AreEqual(newAdUnits[0].adUnitSizes.Length, adUnit1.adUnitSizes.Length); + + Assert.AreEqual(newAdUnits[1].name, adUnit2.name); + Assert.AreEqual(newAdUnits[1].parentId, adUnit2.parentId); + Assert.AreEqual(newAdUnits[1].id, adUnit2.id); + Assert.AreEqual(newAdUnits[1].status, adUnit2.status); + Assert.AreEqual(newAdUnits[1].targetWindow, adUnit2.targetWindow); + Assert.AreEqual(newAdUnits[1].adUnitSizes.Length, adUnit2.adUnitSizes.Length); + } + } +} diff --git a/tests/Dfp/v201306/LineItemCreativeAssociationServiceTests.cs b/tests/Dfp/v201306/LineItemCreativeAssociationServiceTests.cs new file mode 100644 index 00000000000..ff52e892512 --- /dev/null +++ b/tests/Dfp/v201306/LineItemCreativeAssociationServiceTests.cs @@ -0,0 +1,303 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201306 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class LineItemCreativeAssociationServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private LineItemCreativeAssociationService licaService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Creative id 1 for running tests. + /// + private long creativeId1; + + /// + /// Creative id 2 for running tests. + /// + private long creativeId2; + + /// + /// Creative id 3 for running tests. + /// + private long creativeId3; + + /// + /// Creative id 4 for running tests. + /// + private long creativeId4; + + /// + /// Line item id 1 for running tests. + /// + private long lineItemId1; + + /// + /// Line item id 2 for running tests. + /// + private long lineItemId2; + + /// + /// Line item id 3 for running tests. + /// + private long lineItemId3; + + /// + /// Line item id 4 for running tests. + /// + private long lineItemId4; + + /// + /// Line item creative association 1 for running tests. + /// + private LineItemCreativeAssociation lica1; + + /// + /// Line item creative association 2 for running tests. + /// + private LineItemCreativeAssociation lica2; + + /// + /// Default public constructor. + /// + public LineItemCreativeAssociationServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + licaService = (LineItemCreativeAssociationService) user.GetService( + DfpService.v201306.LineItemCreativeAssociationService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + + lineItemId1 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId2 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId3 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId4 = utils.CreateLineItem(user, orderId, adUnitId).id; + + creativeId1 = utils.CreateCreative(user, advertiserId).id; + creativeId2 = utils.CreateCreative(user, advertiserId).id; + creativeId3 = utils.CreateCreative(user, advertiserId).id; + creativeId4 = utils.CreateCreative(user, advertiserId).id; + + lica1 = utils.CreateLica(user, lineItemId3, creativeId3); + lica2 = utils.CreateLica(user, lineItemId4, creativeId4); + } + + /// + /// Test whether we can create a line item creative association. + /// + [Test] + public void TestCreateLineItemCreativeAssociation() { + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId1; + lica.lineItemId = lineItemId1; + + LineItemCreativeAssociation newLica = null; + + Assert.DoesNotThrow(delegate() { + newLica = licaService.createLineItemCreativeAssociation(lica); + }); + + Assert.NotNull(newLica); + Assert.AreEqual(newLica.creativeId, lica.creativeId); + Assert.AreEqual(newLica.lineItemId, lica.lineItemId); + } + + /// + /// Test whether we can create a list of line item creative associations. + /// + [Test] + public void TestCreateLineItemCreativeAssociations() { + LineItemCreativeAssociation localLica1 = new LineItemCreativeAssociation(); + localLica1.creativeId = creativeId1; + localLica1.lineItemId = lineItemId1; + + LineItemCreativeAssociation localLica2 = new LineItemCreativeAssociation(); + localLica2.creativeId = creativeId2; + localLica2.lineItemId = lineItemId2; + + LineItemCreativeAssociation[] newLicas = null; + + Assert.DoesNotThrow(delegate() { + newLicas = licaService.createLineItemCreativeAssociations( + new LineItemCreativeAssociation[] {localLica1, localLica2}); + }); + + Assert.NotNull(newLicas); + Assert.AreEqual(newLicas.Length, 2); + + Assert.NotNull(newLicas[0]); + Assert.AreEqual(newLicas[0].creativeId, localLica1.creativeId); + Assert.AreEqual(newLicas[0].lineItemId, localLica1.lineItemId); + + Assert.NotNull(newLicas[1]); + Assert.AreEqual(newLicas[1].creativeId, localLica2.creativeId); + Assert.AreEqual(newLicas[1].lineItemId, localLica2.lineItemId); + } + + /// + /// Test whether we can fetch an existing line item creative association. + /// + [Test] + public void TestGetLineItemCreativeAssociation() { + LineItemCreativeAssociation newLica = null; + + Assert.DoesNotThrow(delegate() { + newLica = licaService.getLineItemCreativeAssociation(lineItemId3, creativeId3); + }); + + Assert.NotNull(newLica); + Assert.AreEqual(newLica.creativeId, lica1.creativeId); + Assert.AreEqual(newLica.lineItemId, lica1.lineItemId); + } + + /// + /// Test whether we can fetch a list of existing line item creative + /// associations that match given statement. + /// + [Test] + public void TestGetLineItemCreativeAssociationsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE lineItemId = '{0}' LIMIT 500", lineItemId3); + + LineItemCreativeAssociationPage page = null; + Assert.DoesNotThrow(delegate() { + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + }); + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].creativeId, lica1.creativeId); + Assert.AreEqual(page.results[0].lineItemId, lica1.lineItemId); + } + + /// + /// Test whether we can deactivate a line item create association. + /// + [Test] + public void TestPerformLineItemCreativeAssociationAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE lineItemId = '{0}' LIMIT 1", lineItemId3); + + DeactivateLineItemCreativeAssociations action = new DeactivateLineItemCreativeAssociations(); + + UpdateResult result = null; + Assert.DoesNotThrow(delegate() { + result = licaService.performLineItemCreativeAssociationAction(action, statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update a line item creative association. + /// + [Test] + public void TestUpdateLineItemCreativeAssociation() { + lica1.destinationUrl = "http://news.google.com"; + + LineItemCreativeAssociation newLica = null; + Assert.DoesNotThrow(delegate() { + newLica = licaService.updateLineItemCreativeAssociation(lica1); + }); + + Assert.NotNull(newLica); + Assert.AreEqual(newLica.creativeId, lica1.creativeId); + Assert.AreEqual(newLica.lineItemId, lica1.lineItemId); + Assert.AreEqual(newLica.destinationUrl, lica1.destinationUrl); + } + + /// + /// Test whether we can update a list of line item creative associations. + /// + [Test] + public void TestUpdateLineItemCreativeAssociations() { + lica1.destinationUrl = "http://news.google.com"; + lica2.destinationUrl = "http://news.google.com"; + + LineItemCreativeAssociation[] newLicas = null; + Assert.DoesNotThrow(delegate() { + newLicas = licaService.updateLineItemCreativeAssociations( + new LineItemCreativeAssociation[] {lica1, lica2}); + }); + + Assert.NotNull(newLicas); + Assert.AreEqual(newLicas.Length, 2); + + Assert.NotNull(newLicas[0]); + Assert.AreEqual(newLicas[0].creativeId, lica1.creativeId); + Assert.AreEqual(newLicas[0].lineItemId, lica1.lineItemId); + + Assert.NotNull(newLicas[1]); + Assert.AreEqual(newLicas[1].creativeId, lica2.creativeId); + Assert.AreEqual(newLicas[1].lineItemId, lica2.lineItemId); + } + } +} diff --git a/tests/Dfp/v201306/LineItemServiceTests.cs b/tests/Dfp/v201306/LineItemServiceTests.cs new file mode 100644 index 00000000000..117d4723ff8 --- /dev/null +++ b/tests/Dfp/v201306/LineItemServiceTests.cs @@ -0,0 +1,486 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201306 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class LineItemServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private LineItemService lineItemService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Placement id for running tests. + /// + private long placementId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Line item 1 for running tests. + /// + private LineItem lineItem1; + + /// + /// Line item 2 for running tests. + /// + private LineItem lineItem2; + + /// + /// Default public constructor. + /// + public LineItemServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + lineItemService = (LineItemService)user.GetService(DfpService.v201306.LineItemService); + + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + placementId = utils.CreatePlacement(user, new string[] {adUnitId}).id; + lineItem1 = utils.CreateLineItem(user, orderId, adUnitId); + lineItem2 = utils.CreateLineItem(user, orderId, adUnitId); + } + + /// + /// Test whether we can create a line item creative association. + /// + [Test] + public void TestCreateLineItem() { + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201306.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201306.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + LineItem localLineItem = null; + + Assert.DoesNotThrow(delegate() { + localLineItem = lineItemService.createLineItem(lineItem); + }); + + Assert.NotNull(localLineItem); + Assert.AreEqual(localLineItem.name, lineItem.name); + Assert.AreEqual(localLineItem.orderId, lineItem.orderId); + } + + /// + /// Test whether we can create a list of line items. + /// + [Test] + public void TestCreateLineItems() { + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201306.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201306.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + // Create an array to store local line item objects. + LineItem[] lineItems = new LineItem[2]; + + for (int i = 0; i < lineItems.Length; i++) { + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + lineItems[i] = lineItem; + } + + LineItem[] localLineItems = null; + + Assert.DoesNotThrow(delegate() { + localLineItems = lineItemService.createLineItems(lineItems); + }); + + Assert.NotNull(localLineItems); + Assert.AreEqual(localLineItems.Length, 2); + + Assert.AreEqual(localLineItems[0].name, lineItems[0].name); + Assert.AreEqual(localLineItems[0].orderId, lineItems[0].orderId); + + Assert.AreEqual(localLineItems[1].name, lineItems[1].name); + Assert.AreEqual(localLineItems[1].orderId, lineItems[1].orderId); + } + + /// + /// Test whether we can fetch an existing line item. + /// + [Test] + public void TestGetLineItem() { + LineItem localLineItem = null; + + Assert.DoesNotThrow(delegate() { + localLineItem = lineItemService.getLineItem(lineItem1.id); + }); + + Assert.NotNull(localLineItem); + Assert.AreEqual(localLineItem.id, lineItem1.id); + Assert.AreEqual(localLineItem.name, lineItem1.name); + Assert.AreEqual(localLineItem.orderId, lineItem1.orderId); + } + + /// + /// Test whether we can fetch a list of existing line items that match given + /// statement. + /// + [Test] + public void TestGetLineItemsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", lineItem1.id); + + LineItemPage page = null; + + Assert.DoesNotThrow(delegate() { + page = lineItemService.getLineItemsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results); + Assert.AreEqual(page.results[0].id, lineItem1.id); + Assert.AreEqual(page.results[0].name, lineItem1.name); + Assert.AreEqual(page.results[0].orderId, lineItem1.orderId); + } + + /// + /// Test whether we can activate a line item. + /// + [Test] + public void TestPerformLineItemAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE orderId = '{0}' and status = '{1}'", + orderId, ComputedStatus.NEEDS_CREATIVES); + + ActivateLineItems action = new ActivateLineItems(); + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = lineItemService.performLineItemAction(action, statement); + }); + + Assert.NotNull(result); + } + + /// + /// Test whether we can update a line item. + /// + [Test] + public void TestUpdateLineItem() { + lineItem1.deliveryRateType = DeliveryRateType.AS_FAST_AS_POSSIBLE; + + LineItem localLineItem = null; + Assert.DoesNotThrow(delegate() { + localLineItem = lineItemService.updateLineItem(lineItem1); + }); + + Assert.NotNull(localLineItem); + Assert.AreEqual(localLineItem.id, lineItem1.id); + Assert.AreEqual(localLineItem.name, lineItem1.name); + Assert.AreEqual(localLineItem.orderId, lineItem1.orderId); + Assert.AreEqual(localLineItem.deliveryRateType, lineItem1.deliveryRateType); + } + + /// + /// Test whether we can update a list of line items. + /// + [Test] + public void TestUpdateLineItems() { + lineItem1.costPerUnit.microAmount = 3500000; + lineItem2.costPerUnit.microAmount = 3500000; + + LineItem[] localLineItems = null; + + Assert.DoesNotThrow(delegate() { + localLineItems = lineItemService.updateLineItems(new LineItem[] {lineItem1, lineItem2}); + }); + + Assert.NotNull(localLineItems); + Assert.AreEqual(localLineItems.Length, 2); + + Assert.AreEqual(localLineItems[0].id, lineItem1.id); + Assert.AreEqual(localLineItems[0].name, lineItem1.name); + Assert.AreEqual(localLineItems[0].orderId, lineItem1.orderId); + Assert.AreEqual(localLineItems[0].costPerUnit.microAmount, lineItem1.costPerUnit.microAmount); + + Assert.AreEqual(localLineItems[1].id, lineItem2.id); + Assert.AreEqual(localLineItems[1].name, lineItem2.name); + Assert.AreEqual(localLineItems[1].orderId, lineItem2.orderId); + Assert.AreEqual(localLineItems[1].costPerUnit.microAmount, lineItem2.costPerUnit.microAmount); + } + } +} diff --git a/tests/Dfp/v201306/OrderServiceTests.cs b/tests/Dfp/v201306/OrderServiceTests.cs new file mode 100644 index 00000000000..2d10cc2c1a7 --- /dev/null +++ b/tests/Dfp/v201306/OrderServiceTests.cs @@ -0,0 +1,229 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfp.Tests.v201306 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class OrderServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private OrderService orderService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Default public constructor. + /// + public OrderServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + orderService = (OrderService) user.GetService(DfpService.v201306.OrderService); + + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + } + + /// + /// Test whether we can create an order. + /// + [Test] + public void TestCreateOrder() { + Order order = new Order(); + order.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order.advertiserId = advertiserId; + order.traffickerId = traffickerId; + order.currencyCode = "USD"; + + Order newOrder = null; + + Assert.DoesNotThrow(delegate() { + newOrder = orderService.createOrder(order); + }); + + Assert.NotNull(newOrder); + Assert.AreEqual(order.name, newOrder.name); + } + + /// + /// Test whether we can create a list of orders. + /// + [Test] + public void TestCreateOrders() { + Order order1 = new Order(); + order1.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order1.advertiserId = advertiserId; + order1.traffickerId = traffickerId; + order1.currencyCode = "USD"; + + Order order2 = new Order(); + order2.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order2.advertiserId = advertiserId; + order2.traffickerId = traffickerId; + order2.currencyCode = "USD"; + + Order[] newOrders = null; + + Assert.DoesNotThrow(delegate() { + newOrders = orderService.createOrders(new Order[] {order1, order2}); + }); + + Statement statement = new Statement(); + statement.query = string.Format("WHERE advertiserId = '{0}' LIMIT 500", advertiserId); + + OrderPage page = orderService.getOrdersByStatement(statement); + Assert.NotNull(newOrders); + Assert.AreEqual(newOrders.Length, 2); + + Assert.AreEqual(order1.name, newOrders[0].name); + Assert.AreEqual(order1.advertiserId, newOrders[0].advertiserId); + Assert.AreEqual(order1.traffickerId, newOrders[0].traffickerId); + Assert.AreEqual(order1.currencyCode, newOrders[0].currencyCode); + + Assert.AreEqual(order2.name, newOrders[1].name); + Assert.AreEqual(order2.advertiserId, newOrders[1].advertiserId); + Assert.AreEqual(order2.traffickerId, newOrders[1].traffickerId); + Assert.AreEqual(order2.currencyCode, newOrders[1].currencyCode); + } + + /// + /// Test whether we can perform an order action. + /// + [Test] + public void TestPerformOrderAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE status IN ('{0}', '{1}')", + OrderStatus.DRAFT, OrderStatus.PENDING_APPROVAL); + + ApproveOrders action = new ApproveOrders(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = orderService.performOrderAction(action, statement); + }); + + Assert.NotNull(result); + Assert.GreaterOrEqual(result.numChanges, 0); + } + + /// + /// Test whether we can create an order. + /// + [Test] + public void TestGetOrder() { + Order order = null; + + Assert.DoesNotThrow(delegate() { + order = orderService.getOrder(orderId); + }); + + Assert.NotNull(order); + Assert.AreEqual(order.id, orderId); + Assert.AreEqual(order.advertiserId, advertiserId); + Assert.AreEqual(order.traffickerId, traffickerId); + Assert.AreEqual(order.salespersonId, salespersonId); + } + + /// + /// Test whether we can update an order. + /// + [Test] + public void TestUpdateOrder() { + Order order = orderService.getOrder(orderId); + order.notes = "Spoke to advertiser. All is well."; + + Order newOrder = null; + + Assert.DoesNotThrow(delegate() { + newOrder = orderService.updateOrder(order); + }); + + Assert.NotNull(newOrder); + Assert.AreEqual(order.name, newOrder.name); + Assert.AreEqual(order.advertiserId, newOrder.advertiserId); + Assert.AreEqual(order.traffickerId, newOrder.traffickerId); + Assert.AreEqual(order.currencyCode, newOrder.currencyCode); + Assert.AreEqual(order.notes, newOrder.notes); + } + + /// + /// Test whether we can update a list of orders. + /// + [Test] + public void TestUpdateOrders() { + Order order = orderService.getOrder(orderId); + order.notes = "Spoke to advertiser. All is well."; + + Order[] newOrders = null; + + Assert.DoesNotThrow(delegate() { + newOrders = orderService.updateOrders(new Order[] {order}); + }); + + Assert.NotNull(newOrders); + Assert.AreEqual(newOrders.Length, 1); + + Assert.AreEqual(order.id, newOrders[0].id); + Assert.AreEqual(order.name, newOrders[0].name); + Assert.AreEqual(order.notes, newOrders[0].notes); + Assert.AreEqual(order.advertiserId, newOrders[0].advertiserId); + Assert.AreEqual(order.traffickerId, newOrders[0].traffickerId); + Assert.AreEqual(order.currencyCode, newOrders[0].currencyCode); + } + } +} diff --git a/tests/Dfp/v201306/PlacementServiceTests.cs b/tests/Dfp/v201306/PlacementServiceTests.cs new file mode 100644 index 00000000000..fe429d5e479 --- /dev/null +++ b/tests/Dfp/v201306/PlacementServiceTests.cs @@ -0,0 +1,242 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201306 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class PlacementServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private PlacementService placementService; + + /// + /// The ad unit 1 for running tests. + /// + private AdUnit adUnit1; + + /// + /// The ad unit 2 for running tests. + /// + private AdUnit adUnit2; + + /// + /// The placement for running tests. + /// + private Placement placement; + + /// + /// Default public constructor. + /// + public PlacementServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + placementService = (PlacementService) user.GetService(DfpService.v201306.PlacementService); + adUnit1 = utils.CreateAdUnit(user); + adUnit2 = utils.CreateAdUnit(user); + placement = utils.CreatePlacement(user, new string[] {adUnit1.id, adUnit2.id}); + } + + /// + /// Test whether we can create a placement. + /// + [Test] + public void TestCreatePlacement() { + Placement placement = new Placement(); + placement.name = string.Format("Medium Square AdUnit Placement #{0}", + new TestUtils().GetTimeStamp()); + placement.description = "Contains ad units that can hold creatives of size 300x250"; + placement.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement newPlacement = null; + + Assert.DoesNotThrow(delegate() { + newPlacement = placementService.createPlacement(placement); + }); + + Assert.NotNull(newPlacement); + Assert.AreEqual(newPlacement.name, placement.name); + Assert.AreEqual(newPlacement.description, placement.description); + Assert.Contains(adUnit1.id, newPlacement.targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacement.targetedAdUnitIds); + } + + /// + /// Test whether we can create a list of placements items. + /// + [Test] + public void TestCreatePlacements() { + TestUtils utils = new TestUtils(); + Placement placement1 = new Placement(); + placement1.name = string.Format("Medium Square AdUnit Placement #{0}", utils.GetTimeStamp()); + placement1.description = "Contains ad units that can hold creatives of size 300x250"; + placement1.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement placement2 = new Placement(); + placement2.name = string.Format("Medium Square AdUnit Placement #{0}", utils.GetTimeStamp()); + placement2.description = "Contains ad units that can hold creatives of size 300x250"; + placement2.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement[] newPlacements = null; + + Assert.DoesNotThrow(delegate() { + newPlacements = placementService.createPlacements(new Placement[] {placement1, placement2}); + }); + + Assert.NotNull(newPlacements); + Assert.AreEqual(newPlacements.Length, 2); + + Assert.NotNull(newPlacements[0]); + Assert.AreEqual(newPlacements[0].name, placement1.name); + Assert.AreEqual(newPlacements[0].description, placement1.description); + Assert.Contains(adUnit1.id, newPlacements[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[0].targetedAdUnitIds); + + Assert.NotNull(newPlacements[1]); + Assert.AreEqual(newPlacements[1].name, placement2.name); + Assert.AreEqual(newPlacements[1].description, placement2.description); + Assert.Contains(adUnit1.id, newPlacements[1].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[1].targetedAdUnitIds); + } + + /// + /// Test whether we can create a list of placements items. + /// + [Test] + public void TestGetPlacement() { + Placement newPlacement = null; + + Assert.DoesNotThrow(delegate() { + newPlacement = placementService.getPlacement(placement.id); + }); + + Assert.NotNull(newPlacement); + Assert.AreEqual(newPlacement.name, placement.name); + Assert.AreEqual(newPlacement.description, placement.description); + Assert.Contains(adUnit1.id, newPlacement.targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacement.targetedAdUnitIds); + } + + /// + /// Test whether we can fetch a list of existing placements that match given + /// statement. + /// + [Test] + public void TestGetPlacementsByStatement() { + // Create a Statement to only select active placements. + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}'", placement.id); + + PlacementPage page = null; + + Assert.DoesNotThrow(delegate() { + page = placementService.getPlacementsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.results.Length, 1); + + Assert.AreEqual(page.results[0].id, placement.id); + Assert.AreEqual(page.results[0].name, placement.name); + Assert.AreEqual(page.results[0].description, placement.description); + Assert.Contains(adUnit1.id, page.results[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, page.results[0].targetedAdUnitIds); + } + + /// + /// Test whether we can deactivate a placement. + /// + [Test] + public void TestPerformPlacementAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE status = '{0}'", InventoryStatus.ACTIVE); + + DeactivatePlacements action = new DeactivatePlacements(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = placementService.performPlacementAction(action, statement); + }); + + Assert.NotNull(result); + Assert.GreaterOrEqual(result.numChanges, 0); + } + + /// + /// Test whether we can update a placement. + /// + [Test] + public void TestUpdatePlacement() { + placement.description += "More description"; + + Placement newPlacement = null; + + Assert.DoesNotThrow(delegate() { + newPlacement = placementService.updatePlacement(placement); + }); + + Assert.NotNull(newPlacement); + Assert.AreEqual(newPlacement.name, placement.name); + Assert.AreEqual(newPlacement.description, placement.description); + Assert.Contains(adUnit1.id, newPlacement.targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacement.targetedAdUnitIds); + } + + /// + /// Test whether we can update a list of placements. + /// + [Test] + public void TestUpdatePlacements() { + placement.description += "More description"; + + Placement[] newPlacements = null; + + Assert.DoesNotThrow(delegate() { + newPlacements = placementService.updatePlacements(new Placement[] {placement}); + }); + + Assert.NotNull(newPlacements); + Assert.AreEqual(newPlacements.Length, 1); + + Assert.NotNull(newPlacements[0]); + Assert.AreEqual(newPlacements[0].name, placement.name); + Assert.AreEqual(newPlacements[0].description, placement.description); + Assert.Contains(adUnit1.id, newPlacements[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[0].targetedAdUnitIds); + } + } +} diff --git a/tests/Dfp/v201306/ReportServiceTests.cs b/tests/Dfp/v201306/ReportServiceTests.cs new file mode 100644 index 00000000000..277bb542702 --- /dev/null +++ b/tests/Dfp/v201306/ReportServiceTests.cs @@ -0,0 +1,161 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201306 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class ReportServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private ReportService reportService; + + /// + /// Report id for running further tests. + /// + long reportId; + + /// + /// Default public constructor. + /// + public ReportServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + reportService = (ReportService) user.GetService(DfpService.v201306.ReportService); + reportId = utils.CreateReport(user).id; + } + + /// + /// Test whether we can run a delivery report. + /// + [Test] + public void TestRunDeliveryReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can run an inventory report. + /// + [Test] + public void TestRunInventoryReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.DATE}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + Column.TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + Column.TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_WEEK; + + ReportJob newReportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can run a sales report. + /// + [Test] + public void TestRunSalesReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.SALESPERSON_ID, + Dimension.SALESPERSON_NAME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CPM_AND_CPC_REVENUE, Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + ReportJob newReportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can retrieve existing report job. + /// + [Test] + public void TestGetReportJob() { + ReportJob reportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.getReportJob(reportId); + }); + + Assert.NotNull(reportJob); + Assert.AreEqual(reportJob.id, reportId); + } + + /// + /// Test whether we can retrieve report download URL. + /// + [Test] + public void TestGetReportDownloadUrl() { + string url = null; + + Assert.DoesNotThrow(delegate() { + url = reportService.getReportDownloadURL(reportId, ExportFormat.CSV_EXCEL); + }); + + Assert.True(Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)); + + Assert.DoesNotThrow(delegate() { + url = reportService.getReportDownloadURL(reportId, ExportFormat.TSV); + }); + + Assert.True(Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)); + } + } +} diff --git a/tests/Dfp/v201306/StatementBuilderTests.cs b/tests/Dfp/v201306/StatementBuilderTests.cs new file mode 100644 index 00000000000..04c29f25ada --- /dev/null +++ b/tests/Dfp/v201306/StatementBuilderTests.cs @@ -0,0 +1,282 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using System.Xml; +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; +using NUnit.Framework; +using DateTime = Google.Api.Ads.Dfp.v201306.DateTime; + +namespace Google.Api.Ads.Dfp.Tests.v201306 { + + /// + /// UnitTests for class. + /// + [TestFixture] + public class StatementBuilderTests { + + private static bool StatementsAreEqual(Statement s1, Statement s2) { + // Assumes both Statements are non-null and have non-null properties + if (String.Compare(s1.query, s2.query, true) != 0) { + return false; + } + if (s1.values.Length != s2.values.Length) { + return false; + } + // Assumes Statement values are in the same order + for (int i = 0; i < s1.values.Length; i++) { + if (!StringValueMapEntriesAreEqual(s1.values[i], s2.values[i])) { + return false; + } + } + return true; + } + + private static bool StringValueMapEntriesAreEqual(String_ValueMapEntry entry1, + String_ValueMapEntry entry2) { + return String.Equals(entry1.key, entry2.key) && ValuesAreEqual(entry1.value, entry2.value); + } + + private delegate bool ValueEqualityDelegate(Value value1, Value value2); + + private static bool ValuesAreEqual(Value value1, Value value2) { + Dictionary switcher = + new Dictionary(); + switcher.Add(typeof(TextValue), new ValueEqualityDelegate(TextValuesAreEqual)); + switcher.Add(typeof(NumberValue), new ValueEqualityDelegate(NumberValuesAreEqual)); + switcher.Add(typeof(BooleanValue), new ValueEqualityDelegate(BooleanValuesAreEqual)); + switcher.Add(typeof(DateValue), new ValueEqualityDelegate(DateValuesAreEqual)); + switcher.Add(typeof(DateTimeValue), new ValueEqualityDelegate(DateTimeValuesAreEqual)); + + if (switcher.ContainsKey(value1.GetType())) { + return switcher[value1.GetType()](value1, value2); + } + throw new NotImplementedException(String.Format("Unknown Value type {0}", value1.GetType())); + } + + private static bool TextValuesAreEqual(Value value1, Value value2) { + return String.Equals((value1 as TextValue).value, (value2 as TextValue).value); + } + + private static bool NumberValuesAreEqual(Value value1, Value value2) { + return String.Equals((value1 as NumberValue).value, (value2 as NumberValue).value); + } + + private static bool BooleanValuesAreEqual(Value value1, Value value2) { + return (value1 as BooleanValue).value == (value2 as BooleanValue).value; + } + + private static bool DateValuesAreEqual(Value value1, Value value2) { + Date date1 = (value1 as DateValue).value; + Date date2 = (value2 as DateValue).value; + return DatesAreEqual(date1, date2); + } + + private static bool DateTimeValuesAreEqual(Value value1, Value value2) { + DateTime dateTime1 = (value1 as DateTimeValue).value; + DateTime dateTime2 = (value2 as DateTimeValue).value; + return DatesAreEqual(dateTime1.date, dateTime2.date) + && dateTime1.hour == dateTime2.hour + && dateTime1.minute == dateTime2.minute + && dateTime1.second == dateTime2.second + && String.Equals(dateTime1.timeZoneID, dateTime2.timeZoneID); + } + + private static bool DatesAreEqual(Date date1, Date date2) { + return date1.day == date2.day + && date1.month == date2.month + && date1.year == date2.year; + } + + [Test] + public void TestStatementBuilderBlankStatement() { + StatementBuilder statementBuilder = new StatementBuilder(); + + Statement expectedStatement = new Statement(); + expectedStatement.query = ""; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderBasicStatement() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("ID = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE ID = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderIgnoresKeyword() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("WHERE ID = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE ID = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderIncludesKeywordPrefix() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("WHEREWITHALL = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE WHEREWITHALL = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestAllStatementBuilderPartialFunctions() { + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Name, Id") + .From("Geo_Target") + .Where("Targetable = :targetable") + .OrderBy("Id DESC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .Offset(0) + .AddValue("targetable", true) + .IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .RemoveLimitAndOffset(); + Assert.AreEqual(null, statementBuilder.GetOffset()); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "SELECT Name, Id FROM Geo_Target" + + " WHERE Targetable = :targetable ORDER BY Id DESC"; + String_ValueMapEntry targetableEntry = new String_ValueMapEntry(); + targetableEntry.key = "targetable"; + BooleanValue targetableValue = new BooleanValue(); + targetableValue.value = true; + targetableEntry.value = targetableValue; + expectedStatement.values = new String_ValueMapEntry[] {targetableEntry}; + Assert.True(StatementsAreEqual(expectedStatement, statementBuilder.ToStatement())); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesWhere() { + StatementBuilder statementBuilder = new StatementBuilder("WHERE ID = 1") + .Where("ID = 2"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesFrom() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .From("Geo_Table"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesSelect() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Select("Id, Type"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesLimit() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Offset(100); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesIncreaseOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .IncreaseOffsetBy(100); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesRemoveLimitAndOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .RemoveLimitAndOffset(); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithSelect() { + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Id, Type"); + statementBuilder.Query = "SELECT Id, Type FROM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithFrom() { + StatementBuilder statementBuilder = new StatementBuilder() + .From("Geo_Table"); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithWhere() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("Type = City"); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithLimit() { + StatementBuilder statementBuilder = new StatementBuilder() + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithOffset() { + StatementBuilder statementBuilder = new StatementBuilder() + .Offset(100); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + } +} diff --git a/tests/Dfp/v201306/TestUtils.cs b/tests/Dfp/v201306/TestUtils.cs new file mode 100644 index 00000000000..40451d140ea --- /dev/null +++ b/tests/Dfp/v201306/TestUtils.cs @@ -0,0 +1,350 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201306; +using Google.Api.Ads.Dfp.v201306; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; +using System.Threading; +using System.Configuration; +using System.Collections; + +namespace Google.Api.Ads.Dfp.Tests.v201306 { + /// + /// A utility class to assist the testing of v201004 services. + /// + public class TestUtils { + public User GetCurrentUser(DfpUser user) { + return GetUserByEmail(user, new DfpAppConfig().Email); + } + + public User GetTrafficker(DfpUser user) { + return GetUserByEmail(user, "dfp.api.trafficker@gmail.com"); + } + + public User GetSalesperson(DfpUser user) { + return GetUserByEmail(user, "dfp.api.salesperson@gmail.com"); + } + + public User GetUserByEmail(DfpUser user, string email) { + UserService userService = (UserService) user.GetService(DfpService.v201306.UserService); + + // Create a Statement to get all users sorted by name. + Statement statement = new Statement(); + statement.query = string.Format("where email = '{0}' LIMIT 1", email); + + UserPage page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + return page.results[0]; + } else { + return null; + } + } + + public Role GetRole(DfpUser user, string roleName) { + UserService userService = (UserService)user.GetService(DfpService.v201306.UserService); + + // Get all roles. + Role[] roles = userService.getAllRoles(); + foreach (Role role in roles) { + if (role.name == roleName) { + return role; + } + } + return null; + } + + /// + /// Create a test company for running further tests. + /// + /// A test company for running further tests. + public Company CreateCompany(DfpUser user, CompanyType companyType) { + CompanyService companyService = (CompanyService) user.GetService( + DfpService.v201306.CompanyService); + Company company = new Company(); + company.name = string.Format("Company #{0}", GetTimeStamp()); + company.type = companyType; + + return companyService.createCompany(company); + } + + public Order CreateOrder(DfpUser user, long advertiserId, long salespersonId, + long traffickerId) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201306.OrderService); + + Order order = new Order(); + order.name = string.Format("Order #{0}", GetTimeStamp()); + order.advertiserId = advertiserId; + order.salespersonId = salespersonId; + order.traffickerId = traffickerId; + + return orderService.createOrder(order); + } + + public LineItem CreateLineItem(DfpUser user, long orderId, string adUnitId) { + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201306.LineItemService); + + long placementId = CreatePlacement(user, new string[] {adUnitId}).id; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201306.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201306.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + return lineItemService.createLineItem(lineItem); + } + + /// + /// Create a test company for running further tests. + /// + /// A creative for running further tests. + public Creative CreateCreative(DfpUser user, long advertiserId) { + CreativeService creativeService = (CreativeService)user.GetService( + DfpService.v201306.CreativeService); + + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", GetTimeStamp()); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + return creativeService.createCreative(imageCreative); + } + + public LineItemCreativeAssociation CreateLica(DfpUser user, long lineItemId, long creativeId) { + LineItemCreativeAssociationService licaService = + (LineItemCreativeAssociationService)user.GetService( + DfpService.v201306.LineItemCreativeAssociationService); + + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId; + lica.lineItemId = lineItemId; + + return licaService.createLineItemCreativeAssociation(lica); + } + + public AdUnit CreateAdUnit(DfpUser user) { + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201306.InventoryService); + + AdUnit adUnit = new AdUnit(); + adUnit.name = string.Format("Ad_Unit_{0}", GetTimeStamp()); + adUnit.parentId = FindRootAdUnit(user).id; + + // Set the size of possible creatives that can match this ad unit. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + return inventoryService.createAdUnit(adUnit); + } + + public AdUnit FindRootAdUnit(DfpUser user) { + // Get InventoryService. + InventoryService inventoryService = + (InventoryService)user.GetService(DfpService.v201306.InventoryService); + + // Create a Statement to only select the root ad unit. + Statement statement = new Statement(); + statement.query = "WHERE parentId IS NULL LIMIT 500"; + + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + return page.results[0]; + } + + public Placement CreatePlacement(DfpUser user, string[] targetedAdUnitIds) { + // Get InventoryService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201306.PlacementService); + + Placement placement = new Placement(); + placement.name = string.Format("Test placement #{0}", this.GetTimeStamp()); + placement.description = "Test placement"; + placement.targetedAdUnitIds = targetedAdUnitIds; + + return placementService.createPlacement(placement); + } + + public ReportJob CreateReport(DfpUser user) { + // Get ReportService. + ReportService reportService = + (ReportService) user.GetService(DfpService.v201306.ReportService); + + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + return reportService.runReportJob(reportJob); + } + + /// + /// Gets the current timestamp as a string. + /// + /// The current timestamp as a string. + public string GetTimeStamp() { + Thread.Sleep(500); + return (System.DateTime.UtcNow - new System.DateTime(1970, 1, 1)).Ticks. + ToString(); + } + } +} diff --git a/tests/Dfp/v201306/UserServiceTests.cs b/tests/Dfp/v201306/UserServiceTests.cs new file mode 100644 index 00000000000..0120dc9247d --- /dev/null +++ b/tests/Dfp/v201306/UserServiceTests.cs @@ -0,0 +1,217 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201306; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201306 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class UserServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private UserService userService; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Current user id for running tests. + /// + private long currentUserId; + + /// + /// Default public constructor. + /// + public UserServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + userService = (UserService) user.GetService(DfpService.v201306.UserService); + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + currentUserId = utils.GetCurrentUser(user).id; + } + + /// + /// Test whether we can fetch all roles. + /// + [Test] + public void TestGetAllRoles() { + Role[] roles = null; + + Assert.DoesNotThrow(delegate() { + roles = userService.getAllRoles(); + }); + Assert.NotNull(roles); + Assert.GreaterOrEqual(roles.Length, 0); + } + + /// + /// Test whether we can fetch the current user. + /// + [Test] + public void TestGetCurrentUser() { + User user = null; + + Assert.DoesNotThrow(delegate() { + user = userService.getCurrentUser(); + }); + + Assert.NotNull(user); + Assert.AreEqual(user.id, currentUserId); + } + + /// + /// Test whether we can fetch an existing user. + /// + [Test] + public void TestGetUser() { + User user = null; + + Assert.DoesNotThrow(delegate() { + user = userService.getUser(salespersonId); + }); + + Assert.NotNull(user); + Assert.AreEqual(user.id, salespersonId); + } + + /// + /// Test whether we can fetch a list of existing users that match given + /// statement. + /// + [Test] + public void TestGetUsersByStatement() { + Statement statement = new Statement(); + statement.query = "ORDER BY name LIMIT 500"; + + UserPage page = null; + + Assert.DoesNotThrow(delegate() { + page = userService.getUsersByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + + List salesPersonIds = new List(); + List traffickerIds = new List(); + + foreach(User tempUser in page.results) { + if (tempUser.roleName == "Salesperson") { + salesPersonIds.Add(tempUser.id); + } else if (tempUser.roleName == "Trafficker") { + traffickerIds.Add(tempUser.id); + } + } + Assert.Contains(salespersonId, salesPersonIds); + Assert.Contains(traffickerId, traffickerIds); + } + + /// + /// Test whether we can deactivate and activate a user. + /// + [Test] + public void TestPerformUserAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = {0}", salespersonId); + + DeactivateUsers action = new DeactivateUsers(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = userService.performUserAction(action, statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + + // Activate the user again. + + Assert.DoesNotThrow(delegate() { + result = userService.performUserAction(new ActivateUsers(), statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update a user. + /// + [Test] + public void TestUpdateUser() { + User user = userService.getUser(salespersonId); + user.preferredLocale = (user.preferredLocale == "fr_FR")? "en_US" : "fr_FR"; + + User newUser = null; + + Assert.DoesNotThrow(delegate() { + newUser = userService.updateUser(user); + }); + + Assert.NotNull(newUser); + Assert.AreEqual(newUser.id, user.id); + Assert.AreEqual(newUser.preferredLocale, user.preferredLocale); + } + + /// + /// Test whether we can update a list of users. + /// + [Test] + public void TestUpdateUsers() { + User user = userService.getUser(salespersonId); + user.preferredLocale = (user.preferredLocale == "fr_FR")? "en_US" : "fr_FR"; + + User[] newUsers = null; + + Assert.DoesNotThrow(delegate() { + newUsers = userService.updateUsers(new User[] {user}); + }); + + Assert.NotNull(newUsers); + Assert.AreEqual(newUsers.Length, 1); + Assert.AreEqual(newUsers[0].id, user.id); + Assert.AreEqual(newUsers[0].preferredLocale, user.preferredLocale); + } + } +} diff --git a/tests/Dfp/v201308/CompanyServiceTests.cs b/tests/Dfp/v201308/CompanyServiceTests.cs new file mode 100644 index 00000000000..027469e60c9 --- /dev/null +++ b/tests/Dfp/v201308/CompanyServiceTests.cs @@ -0,0 +1,192 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201308 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class CompanyServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private CompanyService companyService; + + /// + /// The company to be used for further tests. + /// + private Company testCompany1 = null; + + /// + /// The company to be used for further tests. + /// + private Company testCompany2 = null; + + /// + /// Default public constructor. + /// + public CompanyServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + companyService = (CompanyService) user.GetService(DfpService.v201308.CompanyService); + testCompany1 = utils.CreateCompany(user, CompanyType.ADVERTISER); + testCompany2 = utils.CreateCompany(user, CompanyType.ADVERTISER); + } + + + /// + /// Test whether we can create a company. + /// + [Test] + public void TestCreateCompany() { + Company company = new Company(); + company.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company.type = CompanyType.ADVERTISER; + + Company newCompany = null; + Assert.DoesNotThrow(delegate() { + newCompany = companyService.createCompany(company); + }); + + Assert.NotNull(newCompany); + Assert.AreEqual(company.name, newCompany.name); + Assert.AreEqual(company.type, newCompany.type); + } + + /// + /// Test whether we can create a list of companies. + /// + [Test] + public void TestCreateCompanies() { + Company company1 = new Company(); + company1.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company1.type = CompanyType.ADVERTISER; + + Company company2 = new Company(); + company2.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company2.type = CompanyType.ADVERTISER; + + Company[] newCompanies = null; + Assert.DoesNotThrow(delegate() { + newCompanies = companyService.createCompanies(new Company[] {company1, company2}); + }); + + Assert.NotNull(newCompanies); + Assert.AreEqual(newCompanies.Length, 2); + + Assert.AreEqual(company1.name, newCompanies[0].name); + Assert.AreEqual(company1.type, newCompanies[0].type); + Assert.AreEqual(company2.name, newCompanies[1].name); + Assert.AreEqual(company2.type, newCompanies[1].type); + } + + /// + /// Test whether we can fetch an existing company. + /// + [Test] + public void TestGetCompany() { + Company company1 = null; + + Assert.DoesNotThrow(delegate() { + company1 = companyService.getCompany(testCompany1.id); + }); + + Assert.NotNull(company1); + Assert.AreEqual(testCompany1.id, company1.id); + Assert.AreEqual(testCompany1.name, company1.name); + } + + /// + /// Test whether we can fetch a list of existing companies that match given + /// statement. + /// + [Test] + public void TestGetCompaniesByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = {0} ORDER BY name LIMIT 1", testCompany1.id); + CompanyPage page = null; + + Assert.DoesNotThrow(delegate() { + page = companyService.getCompaniesByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.results.Length, 1); + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].id, testCompany1.id); + Assert.AreEqual(page.results[0].name, testCompany1.name); + } + + /// + /// Test whether we can update a company. + /// + [Test] + public void TestUpdateCompany() { + testCompany1.name = "Corp " + testCompany1.name; + Company newCompany = null; + + Assert.DoesNotThrow(delegate() { + newCompany = companyService.updateCompany(testCompany1); + }); + + Assert.NotNull(newCompany); + Assert.AreEqual(newCompany.id, testCompany1.id); + Assert.AreEqual(newCompany.name, testCompany1.name); + } + + /// + /// Test whether we can update a list of companies. + /// + [Test] + public void TestUpdateCompanies() { + testCompany1.name = "Corp " + testCompany1.name; + testCompany2.name = "Corp " + testCompany2.name; + + Company[] newCompanies = null; + + Assert.DoesNotThrow(delegate() { + newCompanies = companyService.updateCompanies(new Company[] {testCompany1, testCompany2}); + }); + + Assert.NotNull(newCompanies); + Assert.AreEqual(newCompanies.Length, 2); + + Assert.AreEqual(testCompany1.name, newCompanies[0].name); + Assert.AreEqual(testCompany1.type, newCompanies[0].type); + Assert.AreEqual(testCompany2.name, newCompanies[1].name); + Assert.AreEqual(testCompany2.type, newCompanies[1].type); + } + } +} diff --git a/tests/Dfp/v201308/CreativeServiceTests.cs b/tests/Dfp/v201308/CreativeServiceTests.cs new file mode 100644 index 00000000000..30f933ee299 --- /dev/null +++ b/tests/Dfp/v201308/CreativeServiceTests.cs @@ -0,0 +1,270 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201308 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class CreativeServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private CreativeService creativeService; + + /// + /// The advertiser company id to be used for running tests. + /// + private long advertiserId = 0; + + /// + /// The creative 1 to be used for running tests. + /// + private Creative creative1 = null; + + /// + /// The creative 2 to be used for running tests. + /// + private Creative creative2 = null; + + /// + /// Default public constructor. + /// + public CreativeServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + creativeService = (CreativeService)user.GetService(DfpService.v201308.CreativeService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + creative1 = utils.CreateCreative(user, advertiserId); + creative2 = utils.CreateCreative(user, advertiserId); + } + + /// + /// Test whether we can create a creative. + /// + [Test] + public void TestCreateCreative() { + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", new TestUtils().GetTimeStamp()); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + Creative newCreative = null; + + Assert.DoesNotThrow(delegate() { + newCreative = creativeService.createCreative(imageCreative); + }); + + Assert.NotNull(newCreative); + Assert.That(newCreative is ImageCreative); + Assert.AreEqual(newCreative.advertiserId, imageCreative.advertiserId); + Assert.AreEqual(newCreative.name, imageCreative.name); + } + + /// + /// Test whether we can create a list of creatives. + /// + [Test] + public void TestCreateCreatives() { + // Create an array to store local image creative objects. + Creative[] imageCreatives = new ImageCreative[2]; + + for (int i = 0; i < 2; i++) { + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", i); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + imageCreatives[i] = imageCreative; + } + + Creative[] newCreatives = null; + + Assert.DoesNotThrow(delegate() { + newCreatives = creativeService.createCreatives(imageCreatives); + }); + + Assert.NotNull(newCreatives); + Assert.AreEqual(newCreatives.Length, 2); + Assert.NotNull(newCreatives[0]); + Assert.That(newCreatives[0] is ImageCreative); + Assert.AreEqual(newCreatives[0].advertiserId, advertiserId); + Assert.AreEqual(newCreatives[0].name, "Image creative #0"); + Assert.NotNull(newCreatives[1]); + Assert.That(newCreatives[1] is ImageCreative); + Assert.AreEqual(newCreatives[1].advertiserId, advertiserId); + Assert.AreEqual(newCreatives[1].name, "Image creative #1"); + } + + /// + /// Test whether we can fetch an existing creative. + /// + [Test] + public void TestGetCreative() { + Creative localCreative = null; + Assert.DoesNotThrow(delegate() { + localCreative = creativeService.getCreative(creative1.id); + }); + Assert.NotNull(localCreative); + Assert.AreEqual(localCreative.id, creative1.id); + Assert.AreEqual(localCreative.GetType(), creative1.GetType()); + Assert.AreEqual(localCreative.name, creative1.name); + Assert.AreEqual(localCreative.advertiserId, creative1.advertiserId); + Assert.AreEqual(localCreative.previewUrl, creative1.previewUrl); + Assert.AreEqual(localCreative.size.height, creative1.size.height); + Assert.AreEqual(localCreative.size.width, creative1.size.width); + } + + /// + /// Test whether we can fetch a list of existing creatives that match given + /// statement. + /// + [Test] + public void TestGetCreativesByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 500", creative1.id); + + CreativePage page = null; + + Assert.DoesNotThrow(delegate() { + page = creativeService.getCreativesByStatement(statement); + }); + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].id, creative1.id); + Assert.AreEqual(page.results[0].GetType(), creative1.GetType()); + Assert.AreEqual(page.results[0].name, creative1.name); + Assert.AreEqual(page.results[0].advertiserId, creative1.advertiserId); + Assert.AreEqual(page.results[0].previewUrl, creative1.previewUrl); + Assert.AreEqual(page.results[0].size.height, creative1.size.height); + Assert.AreEqual(page.results[0].size.width, creative1.size.width); + } + + /// + /// Test whether we can update a creative. + /// + [Test] + public void TestUpdateCreative() { + ImageCreative imageCreative = (ImageCreative) creative1; + imageCreative.destinationUrl = "http://news.google.com"; + + Creative newCreative = null; + + Assert.DoesNotThrow(delegate() { + newCreative = creativeService.updateCreative(creative1); + }); + + Assert.NotNull(newCreative); + Assert.AreEqual(newCreative.id, creative1.id); + Assert.AreEqual(newCreative.name, creative1.name); + Assert.AreEqual(newCreative.advertiserId, creative1.advertiserId); + Assert.AreEqual(newCreative.size.height, creative1.size.height); + Assert.AreEqual(newCreative.size.width, creative1.size.width); + Assert.That(newCreative is ImageCreative); + Assert.AreEqual((newCreative as ImageCreative).destinationUrl, imageCreative.destinationUrl); + } + + /// + /// Test whether we can update a list of creatives. + /// + [Test] + public void TestUpdateCreatives() { + ImageCreative imageCreative1 = (ImageCreative) creative1; + imageCreative1.destinationUrl = "http://news.google.com"; + + ImageCreative imageCreative2 = (ImageCreative) creative2; + imageCreative2.destinationUrl = "http://finance.google.com"; + + Creative[] newCreatives = null; + + Assert.DoesNotThrow(delegate() { + newCreatives = creativeService.updateCreatives(new Creative[] {creative1, creative2}); + }); + + Assert.NotNull(newCreatives); + Assert.AreEqual(newCreatives.Length, 2); + + Assert.AreEqual(newCreatives[0].id, creative1.id); + Assert.AreEqual(newCreatives[0].name, creative1.name); + Assert.AreEqual(newCreatives[0].advertiserId, creative1.advertiserId); + Assert.AreEqual(newCreatives[0].size.height, creative1.size.height); + Assert.AreEqual(newCreatives[0].size.width, creative1.size.width); + Assert.That(newCreatives[0] is ImageCreative); + Assert.AreEqual((newCreatives[0] as ImageCreative).destinationUrl, + imageCreative1.destinationUrl); + + Assert.AreEqual(newCreatives[1].id, creative2.id); + Assert.AreEqual(newCreatives[1].name, creative2.name); + Assert.AreEqual(newCreatives[1].advertiserId, creative2.advertiserId); + Assert.AreEqual(newCreatives[1].size.height, creative2.size.height); + Assert.AreEqual(newCreatives[1].size.width, creative2.size.width); + Assert.That(newCreatives[1] is ImageCreative); + Assert.AreEqual((newCreatives[1] as ImageCreative).destinationUrl, + imageCreative2.destinationUrl); + } + } +} diff --git a/tests/Dfp/v201308/ForecastServiceTests.cs b/tests/Dfp/v201308/ForecastServiceTests.cs new file mode 100644 index 00000000000..0890b468ce3 --- /dev/null +++ b/tests/Dfp/v201308/ForecastServiceTests.cs @@ -0,0 +1,171 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201308 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class ForecastServiceTests : BaseTests { + /// + /// ForecastService object to be used in this test. + /// + private ForecastService forecastService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Placement id for running tests. + /// + private long placementId; + + /// + /// Line item id for running tests. + /// + private long lineItemId; + + /// + /// Default public constructor. + /// + public ForecastServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + forecastService = (ForecastService)user.GetService(DfpService.v201308.ForecastService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + placementId = utils.CreatePlacement(user, new string[] {adUnitId}).id; + lineItemId = utils.CreateLineItem(user, orderId, adUnitId).id; + } + + /// + /// Test whether we can get a forecast for given line item. + /// + [Test] + public void TestGetForecast() { + TestUtils utils = new TestUtils(); + + LineItem lineItem = new LineItem(); + lineItem.name = string.Format("Line item #{0}", utils.GetTimeStamp()); + + lineItem.orderId = orderId; + + lineItem.targeting = new Targeting(); + lineItem.targeting.inventoryTargeting = new InventoryTargeting(); + lineItem.targeting.inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + Size size1 = new Size(); + size1.width = 300; + size1.height = 250; + + Size size2 = new Size(); + size2.width = 120; + size2.height = 600; + + // Create the creative placeholders. + CreativePlaceholder creativePlaceholder1 = new CreativePlaceholder(); + creativePlaceholder1.size = size1; + + CreativePlaceholder creativePlaceholder2 = new CreativePlaceholder(); + creativePlaceholder1.size = size2; + + lineItem.creativePlaceholders = + new CreativePlaceholder[] {creativePlaceholder1, creativePlaceholder2}; + + lineItem.lineItemType = LineItemType.STANDARD; + + // Set start date time and end date time. + lineItem.startDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddDays(1)); + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000; + + lineItem.creativeRotationType = CreativeRotationType.EVEN; + lineItem.discountType = LineItemDiscountType.PERCENTAGE; + + lineItem.unitsBought = 500000; + lineItem.unitType = UnitType.IMPRESSIONS; + + Forecast forecast = null; + Assert.DoesNotThrow(delegate() { + forecast = forecastService.getForecast(lineItem); + }); + Assert.NotNull(forecast); + Assert.AreEqual(forecast.orderId, orderId); + Assert.AreEqual(forecast.unitType, lineItem.unitType); + } + + /// + /// Test whether we can get a forecast for existing line item. + /// + [Test] + public void TestGetForecastById() { + Forecast forecast = null; + Assert.DoesNotThrow(delegate() { + forecast = forecastService.getForecastById(lineItemId); + }); + Assert.NotNull(forecast); + Assert.AreEqual(forecast.orderId, orderId); + } + } +} diff --git a/tests/Dfp/v201308/InventoryServiceTests.cs b/tests/Dfp/v201308/InventoryServiceTests.cs new file mode 100644 index 00000000000..cab61310e78 --- /dev/null +++ b/tests/Dfp/v201308/InventoryServiceTests.cs @@ -0,0 +1,295 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201308 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class InventoryServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private InventoryService inventoryService; + + /// + /// The ad unit 1 for running tests. + /// + private AdUnit adUnit1; + + /// + /// The ad unit 2 for running tests. + /// + private AdUnit adUnit2; + + /// + /// Default public constructor. + /// + public InventoryServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + inventoryService = (InventoryService) user.GetService(DfpService.v201308.InventoryService); + adUnit1 = utils.CreateAdUnit(user); + adUnit2 = utils.CreateAdUnit(user); + } + + /// + /// Test whether we can create an ad unit. + /// + [Test] + public void TestCreateAdUnit() { + AdUnit localAdUnit = new AdUnit(); + localAdUnit.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit.parentId = adUnit1.id; + + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + localAdUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + + AdUnit newAdUnit = null; + + Assert.DoesNotThrow(delegate() { + newAdUnit = inventoryService.createAdUnit(localAdUnit); + }); + + Assert.NotNull(newAdUnit); + Assert.AreEqual(newAdUnit.name, localAdUnit.name); + Assert.AreEqual(newAdUnit.parentId, localAdUnit.parentId); + Assert.AreEqual(newAdUnit.parentId, adUnit1.id); + Assert.AreEqual(newAdUnit.status, localAdUnit.status); + Assert.AreEqual(newAdUnit.targetWindow, localAdUnit.targetWindow); + } + + /// + /// Test whether we can create a list of ad units. + /// + [Test] + public void TestCreateAdUnits() { + // Create ad unit 1. + AdUnit localAdUnit1 = new AdUnit(); + localAdUnit1.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit1.parentId = adUnit1.id; + + Size size1 = new Size(); + size1.width = 300; + size1.height = 250; + + AdUnitSize adUnitSize1 = new AdUnitSize(); + adUnitSize1.size = size1; + adUnitSize1.environmentType = EnvironmentType.BROWSER; + + localAdUnit1.adUnitSizes = new AdUnitSize[] {adUnitSize1}; + + // Create ad unit 2. + AdUnit localAdUnit2 = new AdUnit(); + localAdUnit2.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit2.parentId = adUnit1.id; + + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + + AdUnitSize adUnitSize2 = new AdUnitSize(); + adUnitSize2.size = size2; + adUnitSize2.environmentType = EnvironmentType.BROWSER; + + localAdUnit2.adUnitSizes = new AdUnitSize[] {adUnitSize2}; + + AdUnit[] newAdUnits = null; + + Assert.DoesNotThrow(delegate() { + newAdUnits = inventoryService.createAdUnits(new AdUnit[] {localAdUnit1, localAdUnit2}); + }); + + Assert.NotNull(newAdUnits); + Assert.AreEqual(newAdUnits.Length, 2); + + Assert.AreEqual(newAdUnits[0].name, localAdUnit1.name); + Assert.AreEqual(newAdUnits[0].parentId, localAdUnit1.parentId); + Assert.AreEqual(newAdUnits[0].parentId, adUnit1.id); + Assert.AreEqual(newAdUnits[0].status, localAdUnit1.status); + Assert.AreEqual(newAdUnits[0].targetWindow, localAdUnit1.targetWindow); + + Assert.AreEqual(newAdUnits[1].name, localAdUnit2.name); + Assert.AreEqual(newAdUnits[1].parentId, localAdUnit2.parentId); + Assert.AreEqual(newAdUnits[1].parentId, adUnit1.id); + Assert.AreEqual(newAdUnits[1].status, localAdUnit2.status); + Assert.AreEqual(newAdUnits[1].targetWindow, localAdUnit2.targetWindow); + } + + /// + /// Test whether we can fetch a list of existing ad units that match given + /// statement. + /// + [Test] + public void TestGetAdUnitsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", adUnit1.id); + + AdUnitPage page = null; + + Assert.DoesNotThrow(delegate() { + page = inventoryService.getAdUnitsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results[0]); + + Assert.AreEqual(page.results[0].name, adUnit1.name); + Assert.AreEqual(page.results[0].parentId, adUnit1.parentId); + Assert.AreEqual(page.results[0].id, adUnit1.id); + Assert.AreEqual(page.results[0].status, adUnit1.status); + Assert.AreEqual(page.results[0].targetWindow, adUnit1.targetWindow); + } + + /// + /// Test whether we can deactivate an ad unit. + /// + [Test] + public void TestPerformAdUnitAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", adUnit1.id); + + UpdateResult result = null; + Assert.DoesNotThrow(delegate() { + result = inventoryService.performAdUnitAction(new DeactivateAdUnits(), statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update an ad unit. + /// + [Test] + public void TestUpdateAdUnit() { + List adUnitSizes = new List(adUnit1.adUnitSizes); + + Size size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit1.adUnitSizes = adUnitSizes.ToArray(); + + AdUnit newAdUnit = null; + Assert.DoesNotThrow(delegate() { + newAdUnit = inventoryService.updateAdUnit(adUnit1); + }); + + Assert.NotNull(newAdUnit); + + Assert.AreEqual(newAdUnit.name, adUnit1.name); + Assert.AreEqual(newAdUnit.parentId, adUnit1.parentId); + Assert.AreEqual(newAdUnit.id, adUnit1.id); + Assert.AreEqual(newAdUnit.status, adUnit1.status); + Assert.AreEqual(newAdUnit.targetWindow, adUnit1.targetWindow); + Assert.AreEqual(newAdUnit.adUnitSizes.Length, adUnit1.adUnitSizes.Length); + } + + /// + /// Test whether we can update a list of an ad units. + /// + [Test] + public void TestUpdateAdUnits() { + List adUnitSizes = null; + Size size = null; + + // Modify ad unit 1. + adUnitSizes = new List(adUnit1.adUnitSizes); + size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit1.adUnitSizes = adUnitSizes.ToArray(); + + // Modify ad unit 2. + adUnitSizes = new List(adUnit2.adUnitSizes); + size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit2.adUnitSizes = adUnitSizes.ToArray(); + + AdUnit[] newAdUnits = null; + Assert.DoesNotThrow(delegate() { + newAdUnits = inventoryService.updateAdUnits(new AdUnit[] {adUnit1, adUnit2}); + }); + + Assert.NotNull(newAdUnits); + Assert.AreEqual(newAdUnits.Length, 2); + + Assert.AreEqual(newAdUnits[0].name, adUnit1.name); + Assert.AreEqual(newAdUnits[0].parentId, adUnit1.parentId); + Assert.AreEqual(newAdUnits[0].id, adUnit1.id); + Assert.AreEqual(newAdUnits[0].status, adUnit1.status); + Assert.AreEqual(newAdUnits[0].targetWindow, adUnit1.targetWindow); + Assert.AreEqual(newAdUnits[0].adUnitSizes.Length, adUnit1.adUnitSizes.Length); + + Assert.AreEqual(newAdUnits[1].name, adUnit2.name); + Assert.AreEqual(newAdUnits[1].parentId, adUnit2.parentId); + Assert.AreEqual(newAdUnits[1].id, adUnit2.id); + Assert.AreEqual(newAdUnits[1].status, adUnit2.status); + Assert.AreEqual(newAdUnits[1].targetWindow, adUnit2.targetWindow); + Assert.AreEqual(newAdUnits[1].adUnitSizes.Length, adUnit2.adUnitSizes.Length); + } + } +} diff --git a/tests/Dfp/v201308/LineItemCreativeAssociationServiceTests.cs b/tests/Dfp/v201308/LineItemCreativeAssociationServiceTests.cs new file mode 100644 index 00000000000..c4f52d1399c --- /dev/null +++ b/tests/Dfp/v201308/LineItemCreativeAssociationServiceTests.cs @@ -0,0 +1,303 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201308 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class LineItemCreativeAssociationServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private LineItemCreativeAssociationService licaService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Creative id 1 for running tests. + /// + private long creativeId1; + + /// + /// Creative id 2 for running tests. + /// + private long creativeId2; + + /// + /// Creative id 3 for running tests. + /// + private long creativeId3; + + /// + /// Creative id 4 for running tests. + /// + private long creativeId4; + + /// + /// Line item id 1 for running tests. + /// + private long lineItemId1; + + /// + /// Line item id 2 for running tests. + /// + private long lineItemId2; + + /// + /// Line item id 3 for running tests. + /// + private long lineItemId3; + + /// + /// Line item id 4 for running tests. + /// + private long lineItemId4; + + /// + /// Line item creative association 1 for running tests. + /// + private LineItemCreativeAssociation lica1; + + /// + /// Line item creative association 2 for running tests. + /// + private LineItemCreativeAssociation lica2; + + /// + /// Default public constructor. + /// + public LineItemCreativeAssociationServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + licaService = (LineItemCreativeAssociationService) user.GetService( + DfpService.v201308.LineItemCreativeAssociationService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + + lineItemId1 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId2 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId3 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId4 = utils.CreateLineItem(user, orderId, adUnitId).id; + + creativeId1 = utils.CreateCreative(user, advertiserId).id; + creativeId2 = utils.CreateCreative(user, advertiserId).id; + creativeId3 = utils.CreateCreative(user, advertiserId).id; + creativeId4 = utils.CreateCreative(user, advertiserId).id; + + lica1 = utils.CreateLica(user, lineItemId3, creativeId3); + lica2 = utils.CreateLica(user, lineItemId4, creativeId4); + } + + /// + /// Test whether we can create a line item creative association. + /// + [Test] + public void TestCreateLineItemCreativeAssociation() { + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId1; + lica.lineItemId = lineItemId1; + + LineItemCreativeAssociation newLica = null; + + Assert.DoesNotThrow(delegate() { + newLica = licaService.createLineItemCreativeAssociation(lica); + }); + + Assert.NotNull(newLica); + Assert.AreEqual(newLica.creativeId, lica.creativeId); + Assert.AreEqual(newLica.lineItemId, lica.lineItemId); + } + + /// + /// Test whether we can create a list of line item creative associations. + /// + [Test] + public void TestCreateLineItemCreativeAssociations() { + LineItemCreativeAssociation localLica1 = new LineItemCreativeAssociation(); + localLica1.creativeId = creativeId1; + localLica1.lineItemId = lineItemId1; + + LineItemCreativeAssociation localLica2 = new LineItemCreativeAssociation(); + localLica2.creativeId = creativeId2; + localLica2.lineItemId = lineItemId2; + + LineItemCreativeAssociation[] newLicas = null; + + Assert.DoesNotThrow(delegate() { + newLicas = licaService.createLineItemCreativeAssociations( + new LineItemCreativeAssociation[] {localLica1, localLica2}); + }); + + Assert.NotNull(newLicas); + Assert.AreEqual(newLicas.Length, 2); + + Assert.NotNull(newLicas[0]); + Assert.AreEqual(newLicas[0].creativeId, localLica1.creativeId); + Assert.AreEqual(newLicas[0].lineItemId, localLica1.lineItemId); + + Assert.NotNull(newLicas[1]); + Assert.AreEqual(newLicas[1].creativeId, localLica2.creativeId); + Assert.AreEqual(newLicas[1].lineItemId, localLica2.lineItemId); + } + + /// + /// Test whether we can fetch an existing line item creative association. + /// + [Test] + public void TestGetLineItemCreativeAssociation() { + LineItemCreativeAssociation newLica = null; + + Assert.DoesNotThrow(delegate() { + newLica = licaService.getLineItemCreativeAssociation(lineItemId3, creativeId3); + }); + + Assert.NotNull(newLica); + Assert.AreEqual(newLica.creativeId, lica1.creativeId); + Assert.AreEqual(newLica.lineItemId, lica1.lineItemId); + } + + /// + /// Test whether we can fetch a list of existing line item creative + /// associations that match given statement. + /// + [Test] + public void TestGetLineItemCreativeAssociationsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE lineItemId = '{0}' LIMIT 500", lineItemId3); + + LineItemCreativeAssociationPage page = null; + Assert.DoesNotThrow(delegate() { + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + }); + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].creativeId, lica1.creativeId); + Assert.AreEqual(page.results[0].lineItemId, lica1.lineItemId); + } + + /// + /// Test whether we can deactivate a line item create association. + /// + [Test] + public void TestPerformLineItemCreativeAssociationAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE lineItemId = '{0}' LIMIT 1", lineItemId3); + + DeactivateLineItemCreativeAssociations action = new DeactivateLineItemCreativeAssociations(); + + UpdateResult result = null; + Assert.DoesNotThrow(delegate() { + result = licaService.performLineItemCreativeAssociationAction(action, statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update a line item creative association. + /// + [Test] + public void TestUpdateLineItemCreativeAssociation() { + lica1.destinationUrl = "http://news.google.com"; + + LineItemCreativeAssociation newLica = null; + Assert.DoesNotThrow(delegate() { + newLica = licaService.updateLineItemCreativeAssociation(lica1); + }); + + Assert.NotNull(newLica); + Assert.AreEqual(newLica.creativeId, lica1.creativeId); + Assert.AreEqual(newLica.lineItemId, lica1.lineItemId); + Assert.AreEqual(newLica.destinationUrl, lica1.destinationUrl); + } + + /// + /// Test whether we can update a list of line item creative associations. + /// + [Test] + public void TestUpdateLineItemCreativeAssociations() { + lica1.destinationUrl = "http://news.google.com"; + lica2.destinationUrl = "http://news.google.com"; + + LineItemCreativeAssociation[] newLicas = null; + Assert.DoesNotThrow(delegate() { + newLicas = licaService.updateLineItemCreativeAssociations( + new LineItemCreativeAssociation[] {lica1, lica2}); + }); + + Assert.NotNull(newLicas); + Assert.AreEqual(newLicas.Length, 2); + + Assert.NotNull(newLicas[0]); + Assert.AreEqual(newLicas[0].creativeId, lica1.creativeId); + Assert.AreEqual(newLicas[0].lineItemId, lica1.lineItemId); + + Assert.NotNull(newLicas[1]); + Assert.AreEqual(newLicas[1].creativeId, lica2.creativeId); + Assert.AreEqual(newLicas[1].lineItemId, lica2.lineItemId); + } + } +} diff --git a/tests/Dfp/v201308/LineItemServiceTests.cs b/tests/Dfp/v201308/LineItemServiceTests.cs new file mode 100644 index 00000000000..1ced3bef594 --- /dev/null +++ b/tests/Dfp/v201308/LineItemServiceTests.cs @@ -0,0 +1,486 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201308 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class LineItemServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private LineItemService lineItemService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Placement id for running tests. + /// + private long placementId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Line item 1 for running tests. + /// + private LineItem lineItem1; + + /// + /// Line item 2 for running tests. + /// + private LineItem lineItem2; + + /// + /// Default public constructor. + /// + public LineItemServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + lineItemService = (LineItemService)user.GetService(DfpService.v201308.LineItemService); + + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + placementId = utils.CreatePlacement(user, new string[] {adUnitId}).id; + lineItem1 = utils.CreateLineItem(user, orderId, adUnitId); + lineItem2 = utils.CreateLineItem(user, orderId, adUnitId); + } + + /// + /// Test whether we can create a line item creative association. + /// + [Test] + public void TestCreateLineItem() { + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201308.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201308.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + LineItem localLineItem = null; + + Assert.DoesNotThrow(delegate() { + localLineItem = lineItemService.createLineItem(lineItem); + }); + + Assert.NotNull(localLineItem); + Assert.AreEqual(localLineItem.name, lineItem.name); + Assert.AreEqual(localLineItem.orderId, lineItem.orderId); + } + + /// + /// Test whether we can create a list of line items. + /// + [Test] + public void TestCreateLineItems() { + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201308.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201308.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + // Create an array to store local line item objects. + LineItem[] lineItems = new LineItem[2]; + + for (int i = 0; i < lineItems.Length; i++) { + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + lineItems[i] = lineItem; + } + + LineItem[] localLineItems = null; + + Assert.DoesNotThrow(delegate() { + localLineItems = lineItemService.createLineItems(lineItems); + }); + + Assert.NotNull(localLineItems); + Assert.AreEqual(localLineItems.Length, 2); + + Assert.AreEqual(localLineItems[0].name, lineItems[0].name); + Assert.AreEqual(localLineItems[0].orderId, lineItems[0].orderId); + + Assert.AreEqual(localLineItems[1].name, lineItems[1].name); + Assert.AreEqual(localLineItems[1].orderId, lineItems[1].orderId); + } + + /// + /// Test whether we can fetch an existing line item. + /// + [Test] + public void TestGetLineItem() { + LineItem localLineItem = null; + + Assert.DoesNotThrow(delegate() { + localLineItem = lineItemService.getLineItem(lineItem1.id); + }); + + Assert.NotNull(localLineItem); + Assert.AreEqual(localLineItem.id, lineItem1.id); + Assert.AreEqual(localLineItem.name, lineItem1.name); + Assert.AreEqual(localLineItem.orderId, lineItem1.orderId); + } + + /// + /// Test whether we can fetch a list of existing line items that match given + /// statement. + /// + [Test] + public void TestGetLineItemsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", lineItem1.id); + + LineItemPage page = null; + + Assert.DoesNotThrow(delegate() { + page = lineItemService.getLineItemsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results); + Assert.AreEqual(page.results[0].id, lineItem1.id); + Assert.AreEqual(page.results[0].name, lineItem1.name); + Assert.AreEqual(page.results[0].orderId, lineItem1.orderId); + } + + /// + /// Test whether we can activate a line item. + /// + [Test] + public void TestPerformLineItemAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE orderId = '{0}' and status = '{1}'", + orderId, ComputedStatus.NEEDS_CREATIVES); + + ActivateLineItems action = new ActivateLineItems(); + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = lineItemService.performLineItemAction(action, statement); + }); + + Assert.NotNull(result); + } + + /// + /// Test whether we can update a line item. + /// + [Test] + public void TestUpdateLineItem() { + lineItem1.deliveryRateType = DeliveryRateType.AS_FAST_AS_POSSIBLE; + + LineItem localLineItem = null; + Assert.DoesNotThrow(delegate() { + localLineItem = lineItemService.updateLineItem(lineItem1); + }); + + Assert.NotNull(localLineItem); + Assert.AreEqual(localLineItem.id, lineItem1.id); + Assert.AreEqual(localLineItem.name, lineItem1.name); + Assert.AreEqual(localLineItem.orderId, lineItem1.orderId); + Assert.AreEqual(localLineItem.deliveryRateType, lineItem1.deliveryRateType); + } + + /// + /// Test whether we can update a list of line items. + /// + [Test] + public void TestUpdateLineItems() { + lineItem1.costPerUnit.microAmount = 3500000; + lineItem2.costPerUnit.microAmount = 3500000; + + LineItem[] localLineItems = null; + + Assert.DoesNotThrow(delegate() { + localLineItems = lineItemService.updateLineItems(new LineItem[] {lineItem1, lineItem2}); + }); + + Assert.NotNull(localLineItems); + Assert.AreEqual(localLineItems.Length, 2); + + Assert.AreEqual(localLineItems[0].id, lineItem1.id); + Assert.AreEqual(localLineItems[0].name, lineItem1.name); + Assert.AreEqual(localLineItems[0].orderId, lineItem1.orderId); + Assert.AreEqual(localLineItems[0].costPerUnit.microAmount, lineItem1.costPerUnit.microAmount); + + Assert.AreEqual(localLineItems[1].id, lineItem2.id); + Assert.AreEqual(localLineItems[1].name, lineItem2.name); + Assert.AreEqual(localLineItems[1].orderId, lineItem2.orderId); + Assert.AreEqual(localLineItems[1].costPerUnit.microAmount, lineItem2.costPerUnit.microAmount); + } + } +} diff --git a/tests/Dfp/v201308/OrderServiceTests.cs b/tests/Dfp/v201308/OrderServiceTests.cs new file mode 100644 index 00000000000..7a1af802def --- /dev/null +++ b/tests/Dfp/v201308/OrderServiceTests.cs @@ -0,0 +1,229 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfp.Tests.v201308 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class OrderServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private OrderService orderService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Default public constructor. + /// + public OrderServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + orderService = (OrderService) user.GetService(DfpService.v201308.OrderService); + + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + } + + /// + /// Test whether we can create an order. + /// + [Test] + public void TestCreateOrder() { + Order order = new Order(); + order.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order.advertiserId = advertiserId; + order.traffickerId = traffickerId; + order.currencyCode = "USD"; + + Order newOrder = null; + + Assert.DoesNotThrow(delegate() { + newOrder = orderService.createOrder(order); + }); + + Assert.NotNull(newOrder); + Assert.AreEqual(order.name, newOrder.name); + } + + /// + /// Test whether we can create a list of orders. + /// + [Test] + public void TestCreateOrders() { + Order order1 = new Order(); + order1.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order1.advertiserId = advertiserId; + order1.traffickerId = traffickerId; + order1.currencyCode = "USD"; + + Order order2 = new Order(); + order2.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order2.advertiserId = advertiserId; + order2.traffickerId = traffickerId; + order2.currencyCode = "USD"; + + Order[] newOrders = null; + + Assert.DoesNotThrow(delegate() { + newOrders = orderService.createOrders(new Order[] {order1, order2}); + }); + + Statement statement = new Statement(); + statement.query = string.Format("WHERE advertiserId = '{0}' LIMIT 500", advertiserId); + + OrderPage page = orderService.getOrdersByStatement(statement); + Assert.NotNull(newOrders); + Assert.AreEqual(newOrders.Length, 2); + + Assert.AreEqual(order1.name, newOrders[0].name); + Assert.AreEqual(order1.advertiserId, newOrders[0].advertiserId); + Assert.AreEqual(order1.traffickerId, newOrders[0].traffickerId); + Assert.AreEqual(order1.currencyCode, newOrders[0].currencyCode); + + Assert.AreEqual(order2.name, newOrders[1].name); + Assert.AreEqual(order2.advertiserId, newOrders[1].advertiserId); + Assert.AreEqual(order2.traffickerId, newOrders[1].traffickerId); + Assert.AreEqual(order2.currencyCode, newOrders[1].currencyCode); + } + + /// + /// Test whether we can perform an order action. + /// + [Test] + public void TestPerformOrderAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE status IN ('{0}', '{1}')", + OrderStatus.DRAFT, OrderStatus.PENDING_APPROVAL); + + ApproveOrders action = new ApproveOrders(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = orderService.performOrderAction(action, statement); + }); + + Assert.NotNull(result); + Assert.GreaterOrEqual(result.numChanges, 0); + } + + /// + /// Test whether we can create an order. + /// + [Test] + public void TestGetOrder() { + Order order = null; + + Assert.DoesNotThrow(delegate() { + order = orderService.getOrder(orderId); + }); + + Assert.NotNull(order); + Assert.AreEqual(order.id, orderId); + Assert.AreEqual(order.advertiserId, advertiserId); + Assert.AreEqual(order.traffickerId, traffickerId); + Assert.AreEqual(order.salespersonId, salespersonId); + } + + /// + /// Test whether we can update an order. + /// + [Test] + public void TestUpdateOrder() { + Order order = orderService.getOrder(orderId); + order.notes = "Spoke to advertiser. All is well."; + + Order newOrder = null; + + Assert.DoesNotThrow(delegate() { + newOrder = orderService.updateOrder(order); + }); + + Assert.NotNull(newOrder); + Assert.AreEqual(order.name, newOrder.name); + Assert.AreEqual(order.advertiserId, newOrder.advertiserId); + Assert.AreEqual(order.traffickerId, newOrder.traffickerId); + Assert.AreEqual(order.currencyCode, newOrder.currencyCode); + Assert.AreEqual(order.notes, newOrder.notes); + } + + /// + /// Test whether we can update a list of orders. + /// + [Test] + public void TestUpdateOrders() { + Order order = orderService.getOrder(orderId); + order.notes = "Spoke to advertiser. All is well."; + + Order[] newOrders = null; + + Assert.DoesNotThrow(delegate() { + newOrders = orderService.updateOrders(new Order[] {order}); + }); + + Assert.NotNull(newOrders); + Assert.AreEqual(newOrders.Length, 1); + + Assert.AreEqual(order.id, newOrders[0].id); + Assert.AreEqual(order.name, newOrders[0].name); + Assert.AreEqual(order.notes, newOrders[0].notes); + Assert.AreEqual(order.advertiserId, newOrders[0].advertiserId); + Assert.AreEqual(order.traffickerId, newOrders[0].traffickerId); + Assert.AreEqual(order.currencyCode, newOrders[0].currencyCode); + } + } +} diff --git a/tests/Dfp/v201308/PlacementServiceTests.cs b/tests/Dfp/v201308/PlacementServiceTests.cs new file mode 100644 index 00000000000..f724c6c23b3 --- /dev/null +++ b/tests/Dfp/v201308/PlacementServiceTests.cs @@ -0,0 +1,242 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201308 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class PlacementServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private PlacementService placementService; + + /// + /// The ad unit 1 for running tests. + /// + private AdUnit adUnit1; + + /// + /// The ad unit 2 for running tests. + /// + private AdUnit adUnit2; + + /// + /// The placement for running tests. + /// + private Placement placement; + + /// + /// Default public constructor. + /// + public PlacementServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + placementService = (PlacementService) user.GetService(DfpService.v201308.PlacementService); + adUnit1 = utils.CreateAdUnit(user); + adUnit2 = utils.CreateAdUnit(user); + placement = utils.CreatePlacement(user, new string[] {adUnit1.id, adUnit2.id}); + } + + /// + /// Test whether we can create a placement. + /// + [Test] + public void TestCreatePlacement() { + Placement placement = new Placement(); + placement.name = string.Format("Medium Square AdUnit Placement #{0}", + new TestUtils().GetTimeStamp()); + placement.description = "Contains ad units that can hold creatives of size 300x250"; + placement.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement newPlacement = null; + + Assert.DoesNotThrow(delegate() { + newPlacement = placementService.createPlacement(placement); + }); + + Assert.NotNull(newPlacement); + Assert.AreEqual(newPlacement.name, placement.name); + Assert.AreEqual(newPlacement.description, placement.description); + Assert.Contains(adUnit1.id, newPlacement.targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacement.targetedAdUnitIds); + } + + /// + /// Test whether we can create a list of placements items. + /// + [Test] + public void TestCreatePlacements() { + TestUtils utils = new TestUtils(); + Placement placement1 = new Placement(); + placement1.name = string.Format("Medium Square AdUnit Placement #{0}", utils.GetTimeStamp()); + placement1.description = "Contains ad units that can hold creatives of size 300x250"; + placement1.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement placement2 = new Placement(); + placement2.name = string.Format("Medium Square AdUnit Placement #{0}", utils.GetTimeStamp()); + placement2.description = "Contains ad units that can hold creatives of size 300x250"; + placement2.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement[] newPlacements = null; + + Assert.DoesNotThrow(delegate() { + newPlacements = placementService.createPlacements(new Placement[] {placement1, placement2}); + }); + + Assert.NotNull(newPlacements); + Assert.AreEqual(newPlacements.Length, 2); + + Assert.NotNull(newPlacements[0]); + Assert.AreEqual(newPlacements[0].name, placement1.name); + Assert.AreEqual(newPlacements[0].description, placement1.description); + Assert.Contains(adUnit1.id, newPlacements[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[0].targetedAdUnitIds); + + Assert.NotNull(newPlacements[1]); + Assert.AreEqual(newPlacements[1].name, placement2.name); + Assert.AreEqual(newPlacements[1].description, placement2.description); + Assert.Contains(adUnit1.id, newPlacements[1].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[1].targetedAdUnitIds); + } + + /// + /// Test whether we can create a list of placements items. + /// + [Test] + public void TestGetPlacement() { + Placement newPlacement = null; + + Assert.DoesNotThrow(delegate() { + newPlacement = placementService.getPlacement(placement.id); + }); + + Assert.NotNull(newPlacement); + Assert.AreEqual(newPlacement.name, placement.name); + Assert.AreEqual(newPlacement.description, placement.description); + Assert.Contains(adUnit1.id, newPlacement.targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacement.targetedAdUnitIds); + } + + /// + /// Test whether we can fetch a list of existing placements that match given + /// statement. + /// + [Test] + public void TestGetPlacementsByStatement() { + // Create a Statement to only select active placements. + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}'", placement.id); + + PlacementPage page = null; + + Assert.DoesNotThrow(delegate() { + page = placementService.getPlacementsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.results.Length, 1); + + Assert.AreEqual(page.results[0].id, placement.id); + Assert.AreEqual(page.results[0].name, placement.name); + Assert.AreEqual(page.results[0].description, placement.description); + Assert.Contains(adUnit1.id, page.results[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, page.results[0].targetedAdUnitIds); + } + + /// + /// Test whether we can deactivate a placement. + /// + [Test] + public void TestPerformPlacementAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE status = '{0}'", InventoryStatus.ACTIVE); + + DeactivatePlacements action = new DeactivatePlacements(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = placementService.performPlacementAction(action, statement); + }); + + Assert.NotNull(result); + Assert.GreaterOrEqual(result.numChanges, 0); + } + + /// + /// Test whether we can update a placement. + /// + [Test] + public void TestUpdatePlacement() { + placement.description += "More description"; + + Placement newPlacement = null; + + Assert.DoesNotThrow(delegate() { + newPlacement = placementService.updatePlacement(placement); + }); + + Assert.NotNull(newPlacement); + Assert.AreEqual(newPlacement.name, placement.name); + Assert.AreEqual(newPlacement.description, placement.description); + Assert.Contains(adUnit1.id, newPlacement.targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacement.targetedAdUnitIds); + } + + /// + /// Test whether we can update a list of placements. + /// + [Test] + public void TestUpdatePlacements() { + placement.description += "More description"; + + Placement[] newPlacements = null; + + Assert.DoesNotThrow(delegate() { + newPlacements = placementService.updatePlacements(new Placement[] {placement}); + }); + + Assert.NotNull(newPlacements); + Assert.AreEqual(newPlacements.Length, 1); + + Assert.NotNull(newPlacements[0]); + Assert.AreEqual(newPlacements[0].name, placement.name); + Assert.AreEqual(newPlacements[0].description, placement.description); + Assert.Contains(adUnit1.id, newPlacements[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[0].targetedAdUnitIds); + } + } +} diff --git a/tests/Dfp/v201308/ReportServiceTests.cs b/tests/Dfp/v201308/ReportServiceTests.cs new file mode 100644 index 00000000000..3e044fb6364 --- /dev/null +++ b/tests/Dfp/v201308/ReportServiceTests.cs @@ -0,0 +1,161 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201308 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class ReportServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private ReportService reportService; + + /// + /// Report id for running further tests. + /// + long reportId; + + /// + /// Default public constructor. + /// + public ReportServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + reportService = (ReportService) user.GetService(DfpService.v201308.ReportService); + reportId = utils.CreateReport(user).id; + } + + /// + /// Test whether we can run a delivery report. + /// + [Test] + public void TestRunDeliveryReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can run an inventory report. + /// + [Test] + public void TestRunInventoryReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.DATE}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + Column.TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + Column.TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_WEEK; + + ReportJob newReportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can run a sales report. + /// + [Test] + public void TestRunSalesReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.SALESPERSON_ID, + Dimension.SALESPERSON_NAME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CPM_AND_CPC_REVENUE, Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + ReportJob newReportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can retrieve existing report job. + /// + [Test] + public void TestGetReportJob() { + ReportJob reportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.getReportJob(reportId); + }); + + Assert.NotNull(reportJob); + Assert.AreEqual(reportJob.id, reportId); + } + + /// + /// Test whether we can retrieve report download URL. + /// + [Test] + public void TestGetReportDownloadUrl() { + string url = null; + + Assert.DoesNotThrow(delegate() { + url = reportService.getReportDownloadURL(reportId, ExportFormat.CSV_EXCEL); + }); + + Assert.True(Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)); + + Assert.DoesNotThrow(delegate() { + url = reportService.getReportDownloadURL(reportId, ExportFormat.TSV); + }); + + Assert.True(Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)); + } + } +} diff --git a/tests/Dfp/v201308/StatementBuilderTests.cs b/tests/Dfp/v201308/StatementBuilderTests.cs new file mode 100644 index 00000000000..348e1b1f9fe --- /dev/null +++ b/tests/Dfp/v201308/StatementBuilderTests.cs @@ -0,0 +1,282 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using System.Xml; +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; +using NUnit.Framework; +using DateTime = Google.Api.Ads.Dfp.v201308.DateTime; + +namespace Google.Api.Ads.Dfp.Tests.v201308 { + + /// + /// UnitTests for class. + /// + [TestFixture] + public class StatementBuilderTests { + + private static bool StatementsAreEqual(Statement s1, Statement s2) { + // Assumes both Statements are non-null and have non-null properties + if (String.Compare(s1.query, s2.query, true) != 0) { + return false; + } + if (s1.values.Length != s2.values.Length) { + return false; + } + // Assumes Statement values are in the same order + for (int i = 0; i < s1.values.Length; i++) { + if (!StringValueMapEntriesAreEqual(s1.values[i], s2.values[i])) { + return false; + } + } + return true; + } + + private static bool StringValueMapEntriesAreEqual(String_ValueMapEntry entry1, + String_ValueMapEntry entry2) { + return String.Equals(entry1.key, entry2.key) && ValuesAreEqual(entry1.value, entry2.value); + } + + private delegate bool ValueEqualityDelegate(Value value1, Value value2); + + private static bool ValuesAreEqual(Value value1, Value value2) { + Dictionary switcher = + new Dictionary(); + switcher.Add(typeof(TextValue), new ValueEqualityDelegate(TextValuesAreEqual)); + switcher.Add(typeof(NumberValue), new ValueEqualityDelegate(NumberValuesAreEqual)); + switcher.Add(typeof(BooleanValue), new ValueEqualityDelegate(BooleanValuesAreEqual)); + switcher.Add(typeof(DateValue), new ValueEqualityDelegate(DateValuesAreEqual)); + switcher.Add(typeof(DateTimeValue), new ValueEqualityDelegate(DateTimeValuesAreEqual)); + + if (switcher.ContainsKey(value1.GetType())) { + return switcher[value1.GetType()](value1, value2); + } + throw new NotImplementedException(String.Format("Unknown Value type {0}", value1.GetType())); + } + + private static bool TextValuesAreEqual(Value value1, Value value2) { + return String.Equals((value1 as TextValue).value, (value2 as TextValue).value); + } + + private static bool NumberValuesAreEqual(Value value1, Value value2) { + return String.Equals((value1 as NumberValue).value, (value2 as NumberValue).value); + } + + private static bool BooleanValuesAreEqual(Value value1, Value value2) { + return (value1 as BooleanValue).value == (value2 as BooleanValue).value; + } + + private static bool DateValuesAreEqual(Value value1, Value value2) { + Date date1 = (value1 as DateValue).value; + Date date2 = (value2 as DateValue).value; + return DatesAreEqual(date1, date2); + } + + private static bool DateTimeValuesAreEqual(Value value1, Value value2) { + DateTime dateTime1 = (value1 as DateTimeValue).value; + DateTime dateTime2 = (value2 as DateTimeValue).value; + return DatesAreEqual(dateTime1.date, dateTime2.date) + && dateTime1.hour == dateTime2.hour + && dateTime1.minute == dateTime2.minute + && dateTime1.second == dateTime2.second + && String.Equals(dateTime1.timeZoneID, dateTime2.timeZoneID); + } + + private static bool DatesAreEqual(Date date1, Date date2) { + return date1.day == date2.day + && date1.month == date2.month + && date1.year == date2.year; + } + + [Test] + public void TestStatementBuilderBlankStatement() { + StatementBuilder statementBuilder = new StatementBuilder(); + + Statement expectedStatement = new Statement(); + expectedStatement.query = ""; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderBasicStatement() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("ID = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE ID = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderIgnoresKeyword() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("WHERE ID = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE ID = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderIncludesKeywordPrefix() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("WHEREWITHALL = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE WHEREWITHALL = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestAllStatementBuilderPartialFunctions() { + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Name, Id") + .From("Geo_Target") + .Where("Targetable = :targetable") + .OrderBy("Id DESC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .Offset(0) + .AddValue("targetable", true) + .IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .RemoveLimitAndOffset(); + Assert.AreEqual(null, statementBuilder.GetOffset()); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "SELECT Name, Id FROM Geo_Target" + + " WHERE Targetable = :targetable ORDER BY Id DESC"; + String_ValueMapEntry targetableEntry = new String_ValueMapEntry(); + targetableEntry.key = "targetable"; + BooleanValue targetableValue = new BooleanValue(); + targetableValue.value = true; + targetableEntry.value = targetableValue; + expectedStatement.values = new String_ValueMapEntry[] {targetableEntry}; + Assert.True(StatementsAreEqual(expectedStatement, statementBuilder.ToStatement())); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesWhere() { + StatementBuilder statementBuilder = new StatementBuilder("WHERE ID = 1") + .Where("ID = 2"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesFrom() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .From("Geo_Table"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesSelect() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Select("Id, Type"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesLimit() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Offset(100); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesIncreaseOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .IncreaseOffsetBy(100); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesRemoveLimitAndOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .RemoveLimitAndOffset(); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithSelect() { + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Id, Type"); + statementBuilder.Query = "SELECT Id, Type FROM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithFrom() { + StatementBuilder statementBuilder = new StatementBuilder() + .From("Geo_Table"); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithWhere() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("Type = City"); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithLimit() { + StatementBuilder statementBuilder = new StatementBuilder() + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithOffset() { + StatementBuilder statementBuilder = new StatementBuilder() + .Offset(100); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + } +} diff --git a/tests/Dfp/v201308/TestUtils.cs b/tests/Dfp/v201308/TestUtils.cs new file mode 100644 index 00000000000..853e7c8fc4b --- /dev/null +++ b/tests/Dfp/v201308/TestUtils.cs @@ -0,0 +1,350 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201308; +using Google.Api.Ads.Dfp.v201308; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; +using System.Threading; +using System.Configuration; +using System.Collections; + +namespace Google.Api.Ads.Dfp.Tests.v201308 { + /// + /// A utility class to assist the testing of v201004 services. + /// + public class TestUtils { + public User GetCurrentUser(DfpUser user) { + return GetUserByEmail(user, new DfpAppConfig().Email); + } + + public User GetTrafficker(DfpUser user) { + return GetUserByEmail(user, "dfp.api.trafficker@gmail.com"); + } + + public User GetSalesperson(DfpUser user) { + return GetUserByEmail(user, "dfp.api.salesperson@gmail.com"); + } + + public User GetUserByEmail(DfpUser user, string email) { + UserService userService = (UserService) user.GetService(DfpService.v201308.UserService); + + // Create a Statement to get all users sorted by name. + Statement statement = new Statement(); + statement.query = string.Format("where email = '{0}' LIMIT 1", email); + + UserPage page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + return page.results[0]; + } else { + return null; + } + } + + public Role GetRole(DfpUser user, string roleName) { + UserService userService = (UserService)user.GetService(DfpService.v201308.UserService); + + // Get all roles. + Role[] roles = userService.getAllRoles(); + foreach (Role role in roles) { + if (role.name == roleName) { + return role; + } + } + return null; + } + + /// + /// Create a test company for running further tests. + /// + /// A test company for running further tests. + public Company CreateCompany(DfpUser user, CompanyType companyType) { + CompanyService companyService = (CompanyService) user.GetService( + DfpService.v201308.CompanyService); + Company company = new Company(); + company.name = string.Format("Company #{0}", GetTimeStamp()); + company.type = companyType; + + return companyService.createCompany(company); + } + + public Order CreateOrder(DfpUser user, long advertiserId, long salespersonId, + long traffickerId) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201308.OrderService); + + Order order = new Order(); + order.name = string.Format("Order #{0}", GetTimeStamp()); + order.advertiserId = advertiserId; + order.salespersonId = salespersonId; + order.traffickerId = traffickerId; + + return orderService.createOrder(order); + } + + public LineItem CreateLineItem(DfpUser user, long orderId, string adUnitId) { + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201308.LineItemService); + + long placementId = CreatePlacement(user, new string[] {adUnitId}).id; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201308.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201308.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + return lineItemService.createLineItem(lineItem); + } + + /// + /// Create a test company for running further tests. + /// + /// A creative for running further tests. + public Creative CreateCreative(DfpUser user, long advertiserId) { + CreativeService creativeService = (CreativeService)user.GetService( + DfpService.v201308.CreativeService); + + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", GetTimeStamp()); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + return creativeService.createCreative(imageCreative); + } + + public LineItemCreativeAssociation CreateLica(DfpUser user, long lineItemId, long creativeId) { + LineItemCreativeAssociationService licaService = + (LineItemCreativeAssociationService)user.GetService( + DfpService.v201308.LineItemCreativeAssociationService); + + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId; + lica.lineItemId = lineItemId; + + return licaService.createLineItemCreativeAssociation(lica); + } + + public AdUnit CreateAdUnit(DfpUser user) { + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201308.InventoryService); + + AdUnit adUnit = new AdUnit(); + adUnit.name = string.Format("Ad_Unit_{0}", GetTimeStamp()); + adUnit.parentId = FindRootAdUnit(user).id; + + // Set the size of possible creatives that can match this ad unit. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + return inventoryService.createAdUnit(adUnit); + } + + public AdUnit FindRootAdUnit(DfpUser user) { + // Get InventoryService. + InventoryService inventoryService = + (InventoryService)user.GetService(DfpService.v201308.InventoryService); + + // Create a Statement to only select the root ad unit. + Statement statement = new Statement(); + statement.query = "WHERE parentId IS NULL LIMIT 500"; + + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + return page.results[0]; + } + + public Placement CreatePlacement(DfpUser user, string[] targetedAdUnitIds) { + // Get InventoryService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201308.PlacementService); + + Placement placement = new Placement(); + placement.name = string.Format("Test placement #{0}", this.GetTimeStamp()); + placement.description = "Test placement"; + placement.targetedAdUnitIds = targetedAdUnitIds; + + return placementService.createPlacement(placement); + } + + public ReportJob CreateReport(DfpUser user) { + // Get ReportService. + ReportService reportService = + (ReportService) user.GetService(DfpService.v201308.ReportService); + + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + return reportService.runReportJob(reportJob); + } + + /// + /// Gets the current timestamp as a string. + /// + /// The current timestamp as a string. + public string GetTimeStamp() { + Thread.Sleep(500); + return (System.DateTime.UtcNow - new System.DateTime(1970, 1, 1)).Ticks. + ToString(); + } + } +} diff --git a/tests/Dfp/v201308/UserServiceTests.cs b/tests/Dfp/v201308/UserServiceTests.cs new file mode 100644 index 00000000000..18da7711db4 --- /dev/null +++ b/tests/Dfp/v201308/UserServiceTests.cs @@ -0,0 +1,217 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201308; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201308 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class UserServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private UserService userService; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Current user id for running tests. + /// + private long currentUserId; + + /// + /// Default public constructor. + /// + public UserServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + userService = (UserService) user.GetService(DfpService.v201308.UserService); + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + currentUserId = utils.GetCurrentUser(user).id; + } + + /// + /// Test whether we can fetch all roles. + /// + [Test] + public void TestGetAllRoles() { + Role[] roles = null; + + Assert.DoesNotThrow(delegate() { + roles = userService.getAllRoles(); + }); + Assert.NotNull(roles); + Assert.GreaterOrEqual(roles.Length, 0); + } + + /// + /// Test whether we can fetch the current user. + /// + [Test] + public void TestGetCurrentUser() { + User user = null; + + Assert.DoesNotThrow(delegate() { + user = userService.getCurrentUser(); + }); + + Assert.NotNull(user); + Assert.AreEqual(user.id, currentUserId); + } + + /// + /// Test whether we can fetch an existing user. + /// + [Test] + public void TestGetUser() { + User user = null; + + Assert.DoesNotThrow(delegate() { + user = userService.getUser(salespersonId); + }); + + Assert.NotNull(user); + Assert.AreEqual(user.id, salespersonId); + } + + /// + /// Test whether we can fetch a list of existing users that match given + /// statement. + /// + [Test] + public void TestGetUsersByStatement() { + Statement statement = new Statement(); + statement.query = "ORDER BY name LIMIT 500"; + + UserPage page = null; + + Assert.DoesNotThrow(delegate() { + page = userService.getUsersByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + + List salesPersonIds = new List(); + List traffickerIds = new List(); + + foreach(User tempUser in page.results) { + if (tempUser.roleName == "Salesperson") { + salesPersonIds.Add(tempUser.id); + } else if (tempUser.roleName == "Trafficker") { + traffickerIds.Add(tempUser.id); + } + } + Assert.Contains(salespersonId, salesPersonIds); + Assert.Contains(traffickerId, traffickerIds); + } + + /// + /// Test whether we can deactivate and activate a user. + /// + [Test] + public void TestPerformUserAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = {0}", salespersonId); + + DeactivateUsers action = new DeactivateUsers(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = userService.performUserAction(action, statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + + // Activate the user again. + + Assert.DoesNotThrow(delegate() { + result = userService.performUserAction(new ActivateUsers(), statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update a user. + /// + [Test] + public void TestUpdateUser() { + User user = userService.getUser(salespersonId); + user.preferredLocale = (user.preferredLocale == "fr_FR")? "en_US" : "fr_FR"; + + User newUser = null; + + Assert.DoesNotThrow(delegate() { + newUser = userService.updateUser(user); + }); + + Assert.NotNull(newUser); + Assert.AreEqual(newUser.id, user.id); + Assert.AreEqual(newUser.preferredLocale, user.preferredLocale); + } + + /// + /// Test whether we can update a list of users. + /// + [Test] + public void TestUpdateUsers() { + User user = userService.getUser(salespersonId); + user.preferredLocale = (user.preferredLocale == "fr_FR")? "en_US" : "fr_FR"; + + User[] newUsers = null; + + Assert.DoesNotThrow(delegate() { + newUsers = userService.updateUsers(new User[] {user}); + }); + + Assert.NotNull(newUsers); + Assert.AreEqual(newUsers.Length, 1); + Assert.AreEqual(newUsers[0].id, user.id); + Assert.AreEqual(newUsers[0].preferredLocale, user.preferredLocale); + } + } +} diff --git a/tests/Dfp/v201311/CompanyServiceTests.cs b/tests/Dfp/v201311/CompanyServiceTests.cs new file mode 100644 index 00000000000..2332b80ee2c --- /dev/null +++ b/tests/Dfp/v201311/CompanyServiceTests.cs @@ -0,0 +1,192 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201311 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class CompanyServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private CompanyService companyService; + + /// + /// The company to be used for further tests. + /// + private Company testCompany1 = null; + + /// + /// The company to be used for further tests. + /// + private Company testCompany2 = null; + + /// + /// Default public constructor. + /// + public CompanyServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + companyService = (CompanyService) user.GetService(DfpService.v201311.CompanyService); + testCompany1 = utils.CreateCompany(user, CompanyType.ADVERTISER); + testCompany2 = utils.CreateCompany(user, CompanyType.ADVERTISER); + } + + + /// + /// Test whether we can create a company. + /// + [Test] + public void TestCreateCompany() { + Company company = new Company(); + company.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company.type = CompanyType.ADVERTISER; + + Company newCompany = null; + Assert.DoesNotThrow(delegate() { + newCompany = companyService.createCompany(company); + }); + + Assert.NotNull(newCompany); + Assert.AreEqual(company.name, newCompany.name); + Assert.AreEqual(company.type, newCompany.type); + } + + /// + /// Test whether we can create a list of companies. + /// + [Test] + public void TestCreateCompanies() { + Company company1 = new Company(); + company1.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company1.type = CompanyType.ADVERTISER; + + Company company2 = new Company(); + company2.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company2.type = CompanyType.ADVERTISER; + + Company[] newCompanies = null; + Assert.DoesNotThrow(delegate() { + newCompanies = companyService.createCompanies(new Company[] {company1, company2}); + }); + + Assert.NotNull(newCompanies); + Assert.AreEqual(newCompanies.Length, 2); + + Assert.AreEqual(company1.name, newCompanies[0].name); + Assert.AreEqual(company1.type, newCompanies[0].type); + Assert.AreEqual(company2.name, newCompanies[1].name); + Assert.AreEqual(company2.type, newCompanies[1].type); + } + + /// + /// Test whether we can fetch an existing company. + /// + [Test] + public void TestGetCompany() { + Company company1 = null; + + Assert.DoesNotThrow(delegate() { + company1 = companyService.getCompany(testCompany1.id); + }); + + Assert.NotNull(company1); + Assert.AreEqual(testCompany1.id, company1.id); + Assert.AreEqual(testCompany1.name, company1.name); + } + + /// + /// Test whether we can fetch a list of existing companies that match given + /// statement. + /// + [Test] + public void TestGetCompaniesByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = {0} ORDER BY name LIMIT 1", testCompany1.id); + CompanyPage page = null; + + Assert.DoesNotThrow(delegate() { + page = companyService.getCompaniesByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.results.Length, 1); + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].id, testCompany1.id); + Assert.AreEqual(page.results[0].name, testCompany1.name); + } + + /// + /// Test whether we can update a company. + /// + [Test] + public void TestUpdateCompany() { + testCompany1.name = "Corp " + testCompany1.name; + Company newCompany = null; + + Assert.DoesNotThrow(delegate() { + newCompany = companyService.updateCompany(testCompany1); + }); + + Assert.NotNull(newCompany); + Assert.AreEqual(newCompany.id, testCompany1.id); + Assert.AreEqual(newCompany.name, testCompany1.name); + } + + /// + /// Test whether we can update a list of companies. + /// + [Test] + public void TestUpdateCompanies() { + testCompany1.name = "Corp " + testCompany1.name; + testCompany2.name = "Corp " + testCompany2.name; + + Company[] newCompanies = null; + + Assert.DoesNotThrow(delegate() { + newCompanies = companyService.updateCompanies(new Company[] {testCompany1, testCompany2}); + }); + + Assert.NotNull(newCompanies); + Assert.AreEqual(newCompanies.Length, 2); + + Assert.AreEqual(testCompany1.name, newCompanies[0].name); + Assert.AreEqual(testCompany1.type, newCompanies[0].type); + Assert.AreEqual(testCompany2.name, newCompanies[1].name); + Assert.AreEqual(testCompany2.type, newCompanies[1].type); + } + } +} diff --git a/tests/Dfp/v201311/CreativeServiceTests.cs b/tests/Dfp/v201311/CreativeServiceTests.cs new file mode 100644 index 00000000000..dfd8be35aae --- /dev/null +++ b/tests/Dfp/v201311/CreativeServiceTests.cs @@ -0,0 +1,270 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201311 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class CreativeServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private CreativeService creativeService; + + /// + /// The advertiser company id to be used for running tests. + /// + private long advertiserId = 0; + + /// + /// The creative 1 to be used for running tests. + /// + private Creative creative1 = null; + + /// + /// The creative 2 to be used for running tests. + /// + private Creative creative2 = null; + + /// + /// Default public constructor. + /// + public CreativeServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + creativeService = (CreativeService)user.GetService(DfpService.v201311.CreativeService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + creative1 = utils.CreateCreative(user, advertiserId); + creative2 = utils.CreateCreative(user, advertiserId); + } + + /// + /// Test whether we can create a creative. + /// + [Test] + public void TestCreateCreative() { + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", new TestUtils().GetTimeStamp()); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + Creative newCreative = null; + + Assert.DoesNotThrow(delegate() { + newCreative = creativeService.createCreative(imageCreative); + }); + + Assert.NotNull(newCreative); + Assert.That(newCreative is ImageCreative); + Assert.AreEqual(newCreative.advertiserId, imageCreative.advertiserId); + Assert.AreEqual(newCreative.name, imageCreative.name); + } + + /// + /// Test whether we can create a list of creatives. + /// + [Test] + public void TestCreateCreatives() { + // Create an array to store local image creative objects. + Creative[] imageCreatives = new ImageCreative[2]; + + for (int i = 0; i < 2; i++) { + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", i); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + imageCreatives[i] = imageCreative; + } + + Creative[] newCreatives = null; + + Assert.DoesNotThrow(delegate() { + newCreatives = creativeService.createCreatives(imageCreatives); + }); + + Assert.NotNull(newCreatives); + Assert.AreEqual(newCreatives.Length, 2); + Assert.NotNull(newCreatives[0]); + Assert.That(newCreatives[0] is ImageCreative); + Assert.AreEqual(newCreatives[0].advertiserId, advertiserId); + Assert.AreEqual(newCreatives[0].name, "Image creative #0"); + Assert.NotNull(newCreatives[1]); + Assert.That(newCreatives[1] is ImageCreative); + Assert.AreEqual(newCreatives[1].advertiserId, advertiserId); + Assert.AreEqual(newCreatives[1].name, "Image creative #1"); + } + + /// + /// Test whether we can fetch an existing creative. + /// + [Test] + public void TestGetCreative() { + Creative localCreative = null; + Assert.DoesNotThrow(delegate() { + localCreative = creativeService.getCreative(creative1.id); + }); + Assert.NotNull(localCreative); + Assert.AreEqual(localCreative.id, creative1.id); + Assert.AreEqual(localCreative.GetType(), creative1.GetType()); + Assert.AreEqual(localCreative.name, creative1.name); + Assert.AreEqual(localCreative.advertiserId, creative1.advertiserId); + Assert.AreEqual(localCreative.previewUrl, creative1.previewUrl); + Assert.AreEqual(localCreative.size.height, creative1.size.height); + Assert.AreEqual(localCreative.size.width, creative1.size.width); + } + + /// + /// Test whether we can fetch a list of existing creatives that match given + /// statement. + /// + [Test] + public void TestGetCreativesByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 500", creative1.id); + + CreativePage page = null; + + Assert.DoesNotThrow(delegate() { + page = creativeService.getCreativesByStatement(statement); + }); + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].id, creative1.id); + Assert.AreEqual(page.results[0].GetType(), creative1.GetType()); + Assert.AreEqual(page.results[0].name, creative1.name); + Assert.AreEqual(page.results[0].advertiserId, creative1.advertiserId); + Assert.AreEqual(page.results[0].previewUrl, creative1.previewUrl); + Assert.AreEqual(page.results[0].size.height, creative1.size.height); + Assert.AreEqual(page.results[0].size.width, creative1.size.width); + } + + /// + /// Test whether we can update a creative. + /// + [Test] + public void TestUpdateCreative() { + ImageCreative imageCreative = (ImageCreative) creative1; + imageCreative.destinationUrl = "http://news.google.com"; + + Creative newCreative = null; + + Assert.DoesNotThrow(delegate() { + newCreative = creativeService.updateCreative(creative1); + }); + + Assert.NotNull(newCreative); + Assert.AreEqual(newCreative.id, creative1.id); + Assert.AreEqual(newCreative.name, creative1.name); + Assert.AreEqual(newCreative.advertiserId, creative1.advertiserId); + Assert.AreEqual(newCreative.size.height, creative1.size.height); + Assert.AreEqual(newCreative.size.width, creative1.size.width); + Assert.That(newCreative is ImageCreative); + Assert.AreEqual((newCreative as ImageCreative).destinationUrl, imageCreative.destinationUrl); + } + + /// + /// Test whether we can update a list of creatives. + /// + [Test] + public void TestUpdateCreatives() { + ImageCreative imageCreative1 = (ImageCreative) creative1; + imageCreative1.destinationUrl = "http://news.google.com"; + + ImageCreative imageCreative2 = (ImageCreative) creative2; + imageCreative2.destinationUrl = "http://finance.google.com"; + + Creative[] newCreatives = null; + + Assert.DoesNotThrow(delegate() { + newCreatives = creativeService.updateCreatives(new Creative[] {creative1, creative2}); + }); + + Assert.NotNull(newCreatives); + Assert.AreEqual(newCreatives.Length, 2); + + Assert.AreEqual(newCreatives[0].id, creative1.id); + Assert.AreEqual(newCreatives[0].name, creative1.name); + Assert.AreEqual(newCreatives[0].advertiserId, creative1.advertiserId); + Assert.AreEqual(newCreatives[0].size.height, creative1.size.height); + Assert.AreEqual(newCreatives[0].size.width, creative1.size.width); + Assert.That(newCreatives[0] is ImageCreative); + Assert.AreEqual((newCreatives[0] as ImageCreative).destinationUrl, + imageCreative1.destinationUrl); + + Assert.AreEqual(newCreatives[1].id, creative2.id); + Assert.AreEqual(newCreatives[1].name, creative2.name); + Assert.AreEqual(newCreatives[1].advertiserId, creative2.advertiserId); + Assert.AreEqual(newCreatives[1].size.height, creative2.size.height); + Assert.AreEqual(newCreatives[1].size.width, creative2.size.width); + Assert.That(newCreatives[1] is ImageCreative); + Assert.AreEqual((newCreatives[1] as ImageCreative).destinationUrl, + imageCreative2.destinationUrl); + } + } +} diff --git a/tests/Dfp/v201311/ForecastServiceTests.cs b/tests/Dfp/v201311/ForecastServiceTests.cs new file mode 100644 index 00000000000..8aec8cd2fc1 --- /dev/null +++ b/tests/Dfp/v201311/ForecastServiceTests.cs @@ -0,0 +1,171 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201311 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class ForecastServiceTests : BaseTests { + /// + /// ForecastService object to be used in this test. + /// + private ForecastService forecastService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Placement id for running tests. + /// + private long placementId; + + /// + /// Line item id for running tests. + /// + private long lineItemId; + + /// + /// Default public constructor. + /// + public ForecastServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + forecastService = (ForecastService)user.GetService(DfpService.v201311.ForecastService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + placementId = utils.CreatePlacement(user, new string[] {adUnitId}).id; + lineItemId = utils.CreateLineItem(user, orderId, adUnitId).id; + } + + /// + /// Test whether we can get a forecast for given line item. + /// + [Test] + public void TestGetForecast() { + TestUtils utils = new TestUtils(); + + LineItem lineItem = new LineItem(); + lineItem.name = string.Format("Line item #{0}", utils.GetTimeStamp()); + + lineItem.orderId = orderId; + + lineItem.targeting = new Targeting(); + lineItem.targeting.inventoryTargeting = new InventoryTargeting(); + lineItem.targeting.inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + Size size1 = new Size(); + size1.width = 300; + size1.height = 250; + + Size size2 = new Size(); + size2.width = 120; + size2.height = 600; + + // Create the creative placeholders. + CreativePlaceholder creativePlaceholder1 = new CreativePlaceholder(); + creativePlaceholder1.size = size1; + + CreativePlaceholder creativePlaceholder2 = new CreativePlaceholder(); + creativePlaceholder1.size = size2; + + lineItem.creativePlaceholders = + new CreativePlaceholder[] {creativePlaceholder1, creativePlaceholder2}; + + lineItem.lineItemType = LineItemType.STANDARD; + + // Set start date time and end date time. + lineItem.startDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddDays(1)); + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000; + + lineItem.creativeRotationType = CreativeRotationType.EVEN; + lineItem.discountType = LineItemDiscountType.PERCENTAGE; + + lineItem.unitsBought = 500000; + lineItem.unitType = UnitType.IMPRESSIONS; + + Forecast forecast = null; + Assert.DoesNotThrow(delegate() { + forecast = forecastService.getForecast(lineItem); + }); + Assert.NotNull(forecast); + Assert.AreEqual(forecast.orderId, orderId); + Assert.AreEqual(forecast.unitType, lineItem.unitType); + } + + /// + /// Test whether we can get a forecast for existing line item. + /// + [Test] + public void TestGetForecastById() { + Forecast forecast = null; + Assert.DoesNotThrow(delegate() { + forecast = forecastService.getForecastById(lineItemId); + }); + Assert.NotNull(forecast); + Assert.AreEqual(forecast.orderId, orderId); + } + } +} diff --git a/tests/Dfp/v201311/InventoryServiceTests.cs b/tests/Dfp/v201311/InventoryServiceTests.cs new file mode 100644 index 00000000000..322339b42c7 --- /dev/null +++ b/tests/Dfp/v201311/InventoryServiceTests.cs @@ -0,0 +1,295 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201311 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class InventoryServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private InventoryService inventoryService; + + /// + /// The ad unit 1 for running tests. + /// + private AdUnit adUnit1; + + /// + /// The ad unit 2 for running tests. + /// + private AdUnit adUnit2; + + /// + /// Default public constructor. + /// + public InventoryServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + inventoryService = (InventoryService) user.GetService(DfpService.v201311.InventoryService); + adUnit1 = utils.CreateAdUnit(user); + adUnit2 = utils.CreateAdUnit(user); + } + + /// + /// Test whether we can create an ad unit. + /// + [Test] + public void TestCreateAdUnit() { + AdUnit localAdUnit = new AdUnit(); + localAdUnit.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit.parentId = adUnit1.id; + + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + localAdUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + + AdUnit newAdUnit = null; + + Assert.DoesNotThrow(delegate() { + newAdUnit = inventoryService.createAdUnit(localAdUnit); + }); + + Assert.NotNull(newAdUnit); + Assert.AreEqual(newAdUnit.name, localAdUnit.name); + Assert.AreEqual(newAdUnit.parentId, localAdUnit.parentId); + Assert.AreEqual(newAdUnit.parentId, adUnit1.id); + Assert.AreEqual(newAdUnit.status, localAdUnit.status); + Assert.AreEqual(newAdUnit.targetWindow, localAdUnit.targetWindow); + } + + /// + /// Test whether we can create a list of ad units. + /// + [Test] + public void TestCreateAdUnits() { + // Create ad unit 1. + AdUnit localAdUnit1 = new AdUnit(); + localAdUnit1.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit1.parentId = adUnit1.id; + + Size size1 = new Size(); + size1.width = 300; + size1.height = 250; + + AdUnitSize adUnitSize1 = new AdUnitSize(); + adUnitSize1.size = size1; + adUnitSize1.environmentType = EnvironmentType.BROWSER; + + localAdUnit1.adUnitSizes = new AdUnitSize[] {adUnitSize1}; + + // Create ad unit 2. + AdUnit localAdUnit2 = new AdUnit(); + localAdUnit2.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit2.parentId = adUnit1.id; + + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + + AdUnitSize adUnitSize2 = new AdUnitSize(); + adUnitSize2.size = size2; + adUnitSize2.environmentType = EnvironmentType.BROWSER; + + localAdUnit2.adUnitSizes = new AdUnitSize[] {adUnitSize2}; + + AdUnit[] newAdUnits = null; + + Assert.DoesNotThrow(delegate() { + newAdUnits = inventoryService.createAdUnits(new AdUnit[] {localAdUnit1, localAdUnit2}); + }); + + Assert.NotNull(newAdUnits); + Assert.AreEqual(newAdUnits.Length, 2); + + Assert.AreEqual(newAdUnits[0].name, localAdUnit1.name); + Assert.AreEqual(newAdUnits[0].parentId, localAdUnit1.parentId); + Assert.AreEqual(newAdUnits[0].parentId, adUnit1.id); + Assert.AreEqual(newAdUnits[0].status, localAdUnit1.status); + Assert.AreEqual(newAdUnits[0].targetWindow, localAdUnit1.targetWindow); + + Assert.AreEqual(newAdUnits[1].name, localAdUnit2.name); + Assert.AreEqual(newAdUnits[1].parentId, localAdUnit2.parentId); + Assert.AreEqual(newAdUnits[1].parentId, adUnit1.id); + Assert.AreEqual(newAdUnits[1].status, localAdUnit2.status); + Assert.AreEqual(newAdUnits[1].targetWindow, localAdUnit2.targetWindow); + } + + /// + /// Test whether we can fetch a list of existing ad units that match given + /// statement. + /// + [Test] + public void TestGetAdUnitsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", adUnit1.id); + + AdUnitPage page = null; + + Assert.DoesNotThrow(delegate() { + page = inventoryService.getAdUnitsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results[0]); + + Assert.AreEqual(page.results[0].name, adUnit1.name); + Assert.AreEqual(page.results[0].parentId, adUnit1.parentId); + Assert.AreEqual(page.results[0].id, adUnit1.id); + Assert.AreEqual(page.results[0].status, adUnit1.status); + Assert.AreEqual(page.results[0].targetWindow, adUnit1.targetWindow); + } + + /// + /// Test whether we can deactivate an ad unit. + /// + [Test] + public void TestPerformAdUnitAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", adUnit1.id); + + UpdateResult result = null; + Assert.DoesNotThrow(delegate() { + result = inventoryService.performAdUnitAction(new DeactivateAdUnits(), statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update an ad unit. + /// + [Test] + public void TestUpdateAdUnit() { + List adUnitSizes = new List(adUnit1.adUnitSizes); + + Size size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit1.adUnitSizes = adUnitSizes.ToArray(); + + AdUnit newAdUnit = null; + Assert.DoesNotThrow(delegate() { + newAdUnit = inventoryService.updateAdUnit(adUnit1); + }); + + Assert.NotNull(newAdUnit); + + Assert.AreEqual(newAdUnit.name, adUnit1.name); + Assert.AreEqual(newAdUnit.parentId, adUnit1.parentId); + Assert.AreEqual(newAdUnit.id, adUnit1.id); + Assert.AreEqual(newAdUnit.status, adUnit1.status); + Assert.AreEqual(newAdUnit.targetWindow, adUnit1.targetWindow); + Assert.AreEqual(newAdUnit.adUnitSizes.Length, adUnit1.adUnitSizes.Length); + } + + /// + /// Test whether we can update a list of an ad units. + /// + [Test] + public void TestUpdateAdUnits() { + List adUnitSizes = null; + Size size = null; + + // Modify ad unit 1. + adUnitSizes = new List(adUnit1.adUnitSizes); + size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit1.adUnitSizes = adUnitSizes.ToArray(); + + // Modify ad unit 2. + adUnitSizes = new List(adUnit2.adUnitSizes); + size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit2.adUnitSizes = adUnitSizes.ToArray(); + + AdUnit[] newAdUnits = null; + Assert.DoesNotThrow(delegate() { + newAdUnits = inventoryService.updateAdUnits(new AdUnit[] {adUnit1, adUnit2}); + }); + + Assert.NotNull(newAdUnits); + Assert.AreEqual(newAdUnits.Length, 2); + + Assert.AreEqual(newAdUnits[0].name, adUnit1.name); + Assert.AreEqual(newAdUnits[0].parentId, adUnit1.parentId); + Assert.AreEqual(newAdUnits[0].id, adUnit1.id); + Assert.AreEqual(newAdUnits[0].status, adUnit1.status); + Assert.AreEqual(newAdUnits[0].targetWindow, adUnit1.targetWindow); + Assert.AreEqual(newAdUnits[0].adUnitSizes.Length, adUnit1.adUnitSizes.Length); + + Assert.AreEqual(newAdUnits[1].name, adUnit2.name); + Assert.AreEqual(newAdUnits[1].parentId, adUnit2.parentId); + Assert.AreEqual(newAdUnits[1].id, adUnit2.id); + Assert.AreEqual(newAdUnits[1].status, adUnit2.status); + Assert.AreEqual(newAdUnits[1].targetWindow, adUnit2.targetWindow); + Assert.AreEqual(newAdUnits[1].adUnitSizes.Length, adUnit2.adUnitSizes.Length); + } + } +} diff --git a/tests/Dfp/v201311/LineItemCreativeAssociationServiceTests.cs b/tests/Dfp/v201311/LineItemCreativeAssociationServiceTests.cs new file mode 100644 index 00000000000..b0b91dc3630 --- /dev/null +++ b/tests/Dfp/v201311/LineItemCreativeAssociationServiceTests.cs @@ -0,0 +1,303 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201311 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class LineItemCreativeAssociationServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private LineItemCreativeAssociationService licaService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Creative id 1 for running tests. + /// + private long creativeId1; + + /// + /// Creative id 2 for running tests. + /// + private long creativeId2; + + /// + /// Creative id 3 for running tests. + /// + private long creativeId3; + + /// + /// Creative id 4 for running tests. + /// + private long creativeId4; + + /// + /// Line item id 1 for running tests. + /// + private long lineItemId1; + + /// + /// Line item id 2 for running tests. + /// + private long lineItemId2; + + /// + /// Line item id 3 for running tests. + /// + private long lineItemId3; + + /// + /// Line item id 4 for running tests. + /// + private long lineItemId4; + + /// + /// Line item creative association 1 for running tests. + /// + private LineItemCreativeAssociation lica1; + + /// + /// Line item creative association 2 for running tests. + /// + private LineItemCreativeAssociation lica2; + + /// + /// Default public constructor. + /// + public LineItemCreativeAssociationServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + licaService = (LineItemCreativeAssociationService) user.GetService( + DfpService.v201311.LineItemCreativeAssociationService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + + lineItemId1 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId2 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId3 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId4 = utils.CreateLineItem(user, orderId, adUnitId).id; + + creativeId1 = utils.CreateCreative(user, advertiserId).id; + creativeId2 = utils.CreateCreative(user, advertiserId).id; + creativeId3 = utils.CreateCreative(user, advertiserId).id; + creativeId4 = utils.CreateCreative(user, advertiserId).id; + + lica1 = utils.CreateLica(user, lineItemId3, creativeId3); + lica2 = utils.CreateLica(user, lineItemId4, creativeId4); + } + + /// + /// Test whether we can create a line item creative association. + /// + [Test] + public void TestCreateLineItemCreativeAssociation() { + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId1; + lica.lineItemId = lineItemId1; + + LineItemCreativeAssociation newLica = null; + + Assert.DoesNotThrow(delegate() { + newLica = licaService.createLineItemCreativeAssociation(lica); + }); + + Assert.NotNull(newLica); + Assert.AreEqual(newLica.creativeId, lica.creativeId); + Assert.AreEqual(newLica.lineItemId, lica.lineItemId); + } + + /// + /// Test whether we can create a list of line item creative associations. + /// + [Test] + public void TestCreateLineItemCreativeAssociations() { + LineItemCreativeAssociation localLica1 = new LineItemCreativeAssociation(); + localLica1.creativeId = creativeId1; + localLica1.lineItemId = lineItemId1; + + LineItemCreativeAssociation localLica2 = new LineItemCreativeAssociation(); + localLica2.creativeId = creativeId2; + localLica2.lineItemId = lineItemId2; + + LineItemCreativeAssociation[] newLicas = null; + + Assert.DoesNotThrow(delegate() { + newLicas = licaService.createLineItemCreativeAssociations( + new LineItemCreativeAssociation[] {localLica1, localLica2}); + }); + + Assert.NotNull(newLicas); + Assert.AreEqual(newLicas.Length, 2); + + Assert.NotNull(newLicas[0]); + Assert.AreEqual(newLicas[0].creativeId, localLica1.creativeId); + Assert.AreEqual(newLicas[0].lineItemId, localLica1.lineItemId); + + Assert.NotNull(newLicas[1]); + Assert.AreEqual(newLicas[1].creativeId, localLica2.creativeId); + Assert.AreEqual(newLicas[1].lineItemId, localLica2.lineItemId); + } + + /// + /// Test whether we can fetch an existing line item creative association. + /// + [Test] + public void TestGetLineItemCreativeAssociation() { + LineItemCreativeAssociation newLica = null; + + Assert.DoesNotThrow(delegate() { + newLica = licaService.getLineItemCreativeAssociation(lineItemId3, creativeId3); + }); + + Assert.NotNull(newLica); + Assert.AreEqual(newLica.creativeId, lica1.creativeId); + Assert.AreEqual(newLica.lineItemId, lica1.lineItemId); + } + + /// + /// Test whether we can fetch a list of existing line item creative + /// associations that match given statement. + /// + [Test] + public void TestGetLineItemCreativeAssociationsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE lineItemId = '{0}' LIMIT 500", lineItemId3); + + LineItemCreativeAssociationPage page = null; + Assert.DoesNotThrow(delegate() { + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + }); + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].creativeId, lica1.creativeId); + Assert.AreEqual(page.results[0].lineItemId, lica1.lineItemId); + } + + /// + /// Test whether we can deactivate a line item create association. + /// + [Test] + public void TestPerformLineItemCreativeAssociationAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE lineItemId = '{0}' LIMIT 1", lineItemId3); + + DeactivateLineItemCreativeAssociations action = new DeactivateLineItemCreativeAssociations(); + + UpdateResult result = null; + Assert.DoesNotThrow(delegate() { + result = licaService.performLineItemCreativeAssociationAction(action, statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update a line item creative association. + /// + [Test] + public void TestUpdateLineItemCreativeAssociation() { + lica1.destinationUrl = "http://news.google.com"; + + LineItemCreativeAssociation newLica = null; + Assert.DoesNotThrow(delegate() { + newLica = licaService.updateLineItemCreativeAssociation(lica1); + }); + + Assert.NotNull(newLica); + Assert.AreEqual(newLica.creativeId, lica1.creativeId); + Assert.AreEqual(newLica.lineItemId, lica1.lineItemId); + Assert.AreEqual(newLica.destinationUrl, lica1.destinationUrl); + } + + /// + /// Test whether we can update a list of line item creative associations. + /// + [Test] + public void TestUpdateLineItemCreativeAssociations() { + lica1.destinationUrl = "http://news.google.com"; + lica2.destinationUrl = "http://news.google.com"; + + LineItemCreativeAssociation[] newLicas = null; + Assert.DoesNotThrow(delegate() { + newLicas = licaService.updateLineItemCreativeAssociations( + new LineItemCreativeAssociation[] {lica1, lica2}); + }); + + Assert.NotNull(newLicas); + Assert.AreEqual(newLicas.Length, 2); + + Assert.NotNull(newLicas[0]); + Assert.AreEqual(newLicas[0].creativeId, lica1.creativeId); + Assert.AreEqual(newLicas[0].lineItemId, lica1.lineItemId); + + Assert.NotNull(newLicas[1]); + Assert.AreEqual(newLicas[1].creativeId, lica2.creativeId); + Assert.AreEqual(newLicas[1].lineItemId, lica2.lineItemId); + } + } +} diff --git a/tests/Dfp/v201311/LineItemServiceTests.cs b/tests/Dfp/v201311/LineItemServiceTests.cs new file mode 100644 index 00000000000..3533415eee5 --- /dev/null +++ b/tests/Dfp/v201311/LineItemServiceTests.cs @@ -0,0 +1,486 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201311 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class LineItemServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private LineItemService lineItemService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Placement id for running tests. + /// + private long placementId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Line item 1 for running tests. + /// + private LineItem lineItem1; + + /// + /// Line item 2 for running tests. + /// + private LineItem lineItem2; + + /// + /// Default public constructor. + /// + public LineItemServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + lineItemService = (LineItemService)user.GetService(DfpService.v201311.LineItemService); + + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + placementId = utils.CreatePlacement(user, new string[] {adUnitId}).id; + lineItem1 = utils.CreateLineItem(user, orderId, adUnitId); + lineItem2 = utils.CreateLineItem(user, orderId, adUnitId); + } + + /// + /// Test whether we can create a line item creative association. + /// + [Test] + public void TestCreateLineItem() { + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201311.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201311.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + LineItem localLineItem = null; + + Assert.DoesNotThrow(delegate() { + localLineItem = lineItemService.createLineItem(lineItem); + }); + + Assert.NotNull(localLineItem); + Assert.AreEqual(localLineItem.name, lineItem.name); + Assert.AreEqual(localLineItem.orderId, lineItem.orderId); + } + + /// + /// Test whether we can create a list of line items. + /// + [Test] + public void TestCreateLineItems() { + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201311.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201311.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + // Create an array to store local line item objects. + LineItem[] lineItems = new LineItem[2]; + + for (int i = 0; i < lineItems.Length; i++) { + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + lineItems[i] = lineItem; + } + + LineItem[] localLineItems = null; + + Assert.DoesNotThrow(delegate() { + localLineItems = lineItemService.createLineItems(lineItems); + }); + + Assert.NotNull(localLineItems); + Assert.AreEqual(localLineItems.Length, 2); + + Assert.AreEqual(localLineItems[0].name, lineItems[0].name); + Assert.AreEqual(localLineItems[0].orderId, lineItems[0].orderId); + + Assert.AreEqual(localLineItems[1].name, lineItems[1].name); + Assert.AreEqual(localLineItems[1].orderId, lineItems[1].orderId); + } + + /// + /// Test whether we can fetch an existing line item. + /// + [Test] + public void TestGetLineItem() { + LineItem localLineItem = null; + + Assert.DoesNotThrow(delegate() { + localLineItem = lineItemService.getLineItem(lineItem1.id); + }); + + Assert.NotNull(localLineItem); + Assert.AreEqual(localLineItem.id, lineItem1.id); + Assert.AreEqual(localLineItem.name, lineItem1.name); + Assert.AreEqual(localLineItem.orderId, lineItem1.orderId); + } + + /// + /// Test whether we can fetch a list of existing line items that match given + /// statement. + /// + [Test] + public void TestGetLineItemsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", lineItem1.id); + + LineItemPage page = null; + + Assert.DoesNotThrow(delegate() { + page = lineItemService.getLineItemsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results); + Assert.AreEqual(page.results[0].id, lineItem1.id); + Assert.AreEqual(page.results[0].name, lineItem1.name); + Assert.AreEqual(page.results[0].orderId, lineItem1.orderId); + } + + /// + /// Test whether we can activate a line item. + /// + [Test] + public void TestPerformLineItemAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE orderId = '{0}' and status = '{1}'", + orderId, ComputedStatus.NEEDS_CREATIVES); + + ActivateLineItems action = new ActivateLineItems(); + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = lineItemService.performLineItemAction(action, statement); + }); + + Assert.NotNull(result); + } + + /// + /// Test whether we can update a line item. + /// + [Test] + public void TestUpdateLineItem() { + lineItem1.deliveryRateType = DeliveryRateType.AS_FAST_AS_POSSIBLE; + + LineItem localLineItem = null; + Assert.DoesNotThrow(delegate() { + localLineItem = lineItemService.updateLineItem(lineItem1); + }); + + Assert.NotNull(localLineItem); + Assert.AreEqual(localLineItem.id, lineItem1.id); + Assert.AreEqual(localLineItem.name, lineItem1.name); + Assert.AreEqual(localLineItem.orderId, lineItem1.orderId); + Assert.AreEqual(localLineItem.deliveryRateType, lineItem1.deliveryRateType); + } + + /// + /// Test whether we can update a list of line items. + /// + [Test] + public void TestUpdateLineItems() { + lineItem1.costPerUnit.microAmount = 3500000; + lineItem2.costPerUnit.microAmount = 3500000; + + LineItem[] localLineItems = null; + + Assert.DoesNotThrow(delegate() { + localLineItems = lineItemService.updateLineItems(new LineItem[] {lineItem1, lineItem2}); + }); + + Assert.NotNull(localLineItems); + Assert.AreEqual(localLineItems.Length, 2); + + Assert.AreEqual(localLineItems[0].id, lineItem1.id); + Assert.AreEqual(localLineItems[0].name, lineItem1.name); + Assert.AreEqual(localLineItems[0].orderId, lineItem1.orderId); + Assert.AreEqual(localLineItems[0].costPerUnit.microAmount, lineItem1.costPerUnit.microAmount); + + Assert.AreEqual(localLineItems[1].id, lineItem2.id); + Assert.AreEqual(localLineItems[1].name, lineItem2.name); + Assert.AreEqual(localLineItems[1].orderId, lineItem2.orderId); + Assert.AreEqual(localLineItems[1].costPerUnit.microAmount, lineItem2.costPerUnit.microAmount); + } + } +} diff --git a/tests/Dfp/v201311/OrderServiceTests.cs b/tests/Dfp/v201311/OrderServiceTests.cs new file mode 100644 index 00000000000..276254434c9 --- /dev/null +++ b/tests/Dfp/v201311/OrderServiceTests.cs @@ -0,0 +1,229 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfp.Tests.v201311 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class OrderServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private OrderService orderService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Default public constructor. + /// + public OrderServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + orderService = (OrderService) user.GetService(DfpService.v201311.OrderService); + + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + } + + /// + /// Test whether we can create an order. + /// + [Test] + public void TestCreateOrder() { + Order order = new Order(); + order.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order.advertiserId = advertiserId; + order.traffickerId = traffickerId; + order.currencyCode = "USD"; + + Order newOrder = null; + + Assert.DoesNotThrow(delegate() { + newOrder = orderService.createOrder(order); + }); + + Assert.NotNull(newOrder); + Assert.AreEqual(order.name, newOrder.name); + } + + /// + /// Test whether we can create a list of orders. + /// + [Test] + public void TestCreateOrders() { + Order order1 = new Order(); + order1.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order1.advertiserId = advertiserId; + order1.traffickerId = traffickerId; + order1.currencyCode = "USD"; + + Order order2 = new Order(); + order2.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order2.advertiserId = advertiserId; + order2.traffickerId = traffickerId; + order2.currencyCode = "USD"; + + Order[] newOrders = null; + + Assert.DoesNotThrow(delegate() { + newOrders = orderService.createOrders(new Order[] {order1, order2}); + }); + + Statement statement = new Statement(); + statement.query = string.Format("WHERE advertiserId = '{0}' LIMIT 500", advertiserId); + + OrderPage page = orderService.getOrdersByStatement(statement); + Assert.NotNull(newOrders); + Assert.AreEqual(newOrders.Length, 2); + + Assert.AreEqual(order1.name, newOrders[0].name); + Assert.AreEqual(order1.advertiserId, newOrders[0].advertiserId); + Assert.AreEqual(order1.traffickerId, newOrders[0].traffickerId); + Assert.AreEqual(order1.currencyCode, newOrders[0].currencyCode); + + Assert.AreEqual(order2.name, newOrders[1].name); + Assert.AreEqual(order2.advertiserId, newOrders[1].advertiserId); + Assert.AreEqual(order2.traffickerId, newOrders[1].traffickerId); + Assert.AreEqual(order2.currencyCode, newOrders[1].currencyCode); + } + + /// + /// Test whether we can perform an order action. + /// + [Test] + public void TestPerformOrderAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE status IN ('{0}', '{1}')", + OrderStatus.DRAFT, OrderStatus.PENDING_APPROVAL); + + ApproveOrders action = new ApproveOrders(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = orderService.performOrderAction(action, statement); + }); + + Assert.NotNull(result); + Assert.GreaterOrEqual(result.numChanges, 0); + } + + /// + /// Test whether we can create an order. + /// + [Test] + public void TestGetOrder() { + Order order = null; + + Assert.DoesNotThrow(delegate() { + order = orderService.getOrder(orderId); + }); + + Assert.NotNull(order); + Assert.AreEqual(order.id, orderId); + Assert.AreEqual(order.advertiserId, advertiserId); + Assert.AreEqual(order.traffickerId, traffickerId); + Assert.AreEqual(order.salespersonId, salespersonId); + } + + /// + /// Test whether we can update an order. + /// + [Test] + public void TestUpdateOrder() { + Order order = orderService.getOrder(orderId); + order.notes = "Spoke to advertiser. All is well."; + + Order newOrder = null; + + Assert.DoesNotThrow(delegate() { + newOrder = orderService.updateOrder(order); + }); + + Assert.NotNull(newOrder); + Assert.AreEqual(order.name, newOrder.name); + Assert.AreEqual(order.advertiserId, newOrder.advertiserId); + Assert.AreEqual(order.traffickerId, newOrder.traffickerId); + Assert.AreEqual(order.currencyCode, newOrder.currencyCode); + Assert.AreEqual(order.notes, newOrder.notes); + } + + /// + /// Test whether we can update a list of orders. + /// + [Test] + public void TestUpdateOrders() { + Order order = orderService.getOrder(orderId); + order.notes = "Spoke to advertiser. All is well."; + + Order[] newOrders = null; + + Assert.DoesNotThrow(delegate() { + newOrders = orderService.updateOrders(new Order[] {order}); + }); + + Assert.NotNull(newOrders); + Assert.AreEqual(newOrders.Length, 1); + + Assert.AreEqual(order.id, newOrders[0].id); + Assert.AreEqual(order.name, newOrders[0].name); + Assert.AreEqual(order.notes, newOrders[0].notes); + Assert.AreEqual(order.advertiserId, newOrders[0].advertiserId); + Assert.AreEqual(order.traffickerId, newOrders[0].traffickerId); + Assert.AreEqual(order.currencyCode, newOrders[0].currencyCode); + } + } +} diff --git a/tests/Dfp/v201311/PlacementServiceTests.cs b/tests/Dfp/v201311/PlacementServiceTests.cs new file mode 100644 index 00000000000..e3b65a3916a --- /dev/null +++ b/tests/Dfp/v201311/PlacementServiceTests.cs @@ -0,0 +1,242 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201311 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class PlacementServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private PlacementService placementService; + + /// + /// The ad unit 1 for running tests. + /// + private AdUnit adUnit1; + + /// + /// The ad unit 2 for running tests. + /// + private AdUnit adUnit2; + + /// + /// The placement for running tests. + /// + private Placement placement; + + /// + /// Default public constructor. + /// + public PlacementServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + placementService = (PlacementService) user.GetService(DfpService.v201311.PlacementService); + adUnit1 = utils.CreateAdUnit(user); + adUnit2 = utils.CreateAdUnit(user); + placement = utils.CreatePlacement(user, new string[] {adUnit1.id, adUnit2.id}); + } + + /// + /// Test whether we can create a placement. + /// + [Test] + public void TestCreatePlacement() { + Placement placement = new Placement(); + placement.name = string.Format("Medium Square AdUnit Placement #{0}", + new TestUtils().GetTimeStamp()); + placement.description = "Contains ad units that can hold creatives of size 300x250"; + placement.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement newPlacement = null; + + Assert.DoesNotThrow(delegate() { + newPlacement = placementService.createPlacement(placement); + }); + + Assert.NotNull(newPlacement); + Assert.AreEqual(newPlacement.name, placement.name); + Assert.AreEqual(newPlacement.description, placement.description); + Assert.Contains(adUnit1.id, newPlacement.targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacement.targetedAdUnitIds); + } + + /// + /// Test whether we can create a list of placements items. + /// + [Test] + public void TestCreatePlacements() { + TestUtils utils = new TestUtils(); + Placement placement1 = new Placement(); + placement1.name = string.Format("Medium Square AdUnit Placement #{0}", utils.GetTimeStamp()); + placement1.description = "Contains ad units that can hold creatives of size 300x250"; + placement1.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement placement2 = new Placement(); + placement2.name = string.Format("Medium Square AdUnit Placement #{0}", utils.GetTimeStamp()); + placement2.description = "Contains ad units that can hold creatives of size 300x250"; + placement2.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement[] newPlacements = null; + + Assert.DoesNotThrow(delegate() { + newPlacements = placementService.createPlacements(new Placement[] {placement1, placement2}); + }); + + Assert.NotNull(newPlacements); + Assert.AreEqual(newPlacements.Length, 2); + + Assert.NotNull(newPlacements[0]); + Assert.AreEqual(newPlacements[0].name, placement1.name); + Assert.AreEqual(newPlacements[0].description, placement1.description); + Assert.Contains(adUnit1.id, newPlacements[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[0].targetedAdUnitIds); + + Assert.NotNull(newPlacements[1]); + Assert.AreEqual(newPlacements[1].name, placement2.name); + Assert.AreEqual(newPlacements[1].description, placement2.description); + Assert.Contains(adUnit1.id, newPlacements[1].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[1].targetedAdUnitIds); + } + + /// + /// Test whether we can create a list of placements items. + /// + [Test] + public void TestGetPlacement() { + Placement newPlacement = null; + + Assert.DoesNotThrow(delegate() { + newPlacement = placementService.getPlacement(placement.id); + }); + + Assert.NotNull(newPlacement); + Assert.AreEqual(newPlacement.name, placement.name); + Assert.AreEqual(newPlacement.description, placement.description); + Assert.Contains(adUnit1.id, newPlacement.targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacement.targetedAdUnitIds); + } + + /// + /// Test whether we can fetch a list of existing placements that match given + /// statement. + /// + [Test] + public void TestGetPlacementsByStatement() { + // Create a Statement to only select active placements. + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}'", placement.id); + + PlacementPage page = null; + + Assert.DoesNotThrow(delegate() { + page = placementService.getPlacementsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.results.Length, 1); + + Assert.AreEqual(page.results[0].id, placement.id); + Assert.AreEqual(page.results[0].name, placement.name); + Assert.AreEqual(page.results[0].description, placement.description); + Assert.Contains(adUnit1.id, page.results[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, page.results[0].targetedAdUnitIds); + } + + /// + /// Test whether we can deactivate a placement. + /// + [Test] + public void TestPerformPlacementAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE status = '{0}'", InventoryStatus.ACTIVE); + + DeactivatePlacements action = new DeactivatePlacements(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = placementService.performPlacementAction(action, statement); + }); + + Assert.NotNull(result); + Assert.GreaterOrEqual(result.numChanges, 0); + } + + /// + /// Test whether we can update a placement. + /// + [Test] + public void TestUpdatePlacement() { + placement.description += "More description"; + + Placement newPlacement = null; + + Assert.DoesNotThrow(delegate() { + newPlacement = placementService.updatePlacement(placement); + }); + + Assert.NotNull(newPlacement); + Assert.AreEqual(newPlacement.name, placement.name); + Assert.AreEqual(newPlacement.description, placement.description); + Assert.Contains(adUnit1.id, newPlacement.targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacement.targetedAdUnitIds); + } + + /// + /// Test whether we can update a list of placements. + /// + [Test] + public void TestUpdatePlacements() { + placement.description += "More description"; + + Placement[] newPlacements = null; + + Assert.DoesNotThrow(delegate() { + newPlacements = placementService.updatePlacements(new Placement[] {placement}); + }); + + Assert.NotNull(newPlacements); + Assert.AreEqual(newPlacements.Length, 1); + + Assert.NotNull(newPlacements[0]); + Assert.AreEqual(newPlacements[0].name, placement.name); + Assert.AreEqual(newPlacements[0].description, placement.description); + Assert.Contains(adUnit1.id, newPlacements[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[0].targetedAdUnitIds); + } + } +} diff --git a/tests/Dfp/v201311/ReportServiceTests.cs b/tests/Dfp/v201311/ReportServiceTests.cs new file mode 100644 index 00000000000..29c3637f1aa --- /dev/null +++ b/tests/Dfp/v201311/ReportServiceTests.cs @@ -0,0 +1,161 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201311 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class ReportServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private ReportService reportService; + + /// + /// Report id for running further tests. + /// + long reportId; + + /// + /// Default public constructor. + /// + public ReportServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + reportService = (ReportService) user.GetService(DfpService.v201311.ReportService); + reportId = utils.CreateReport(user).id; + } + + /// + /// Test whether we can run a delivery report. + /// + [Test] + public void TestRunDeliveryReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can run an inventory report. + /// + [Test] + public void TestRunInventoryReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.DATE}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + Column.TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + Column.TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_WEEK; + + ReportJob newReportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can run a sales report. + /// + [Test] + public void TestRunSalesReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.SALESPERSON_ID, + Dimension.SALESPERSON_NAME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CPM_AND_CPC_REVENUE, Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + ReportJob newReportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can retrieve existing report job. + /// + [Test] + public void TestGetReportJob() { + ReportJob reportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.getReportJob(reportId); + }); + + Assert.NotNull(reportJob); + Assert.AreEqual(reportJob.id, reportId); + } + + /// + /// Test whether we can retrieve report download URL. + /// + [Test] + public void TestGetReportDownloadUrl() { + string url = null; + + Assert.DoesNotThrow(delegate() { + url = reportService.getReportDownloadURL(reportId, ExportFormat.CSV_EXCEL); + }); + + Assert.True(Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)); + + Assert.DoesNotThrow(delegate() { + url = reportService.getReportDownloadURL(reportId, ExportFormat.TSV); + }); + + Assert.True(Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)); + } + } +} diff --git a/tests/Dfp/v201311/StatementBuilderTests.cs b/tests/Dfp/v201311/StatementBuilderTests.cs new file mode 100644 index 00000000000..105eff9abc8 --- /dev/null +++ b/tests/Dfp/v201311/StatementBuilderTests.cs @@ -0,0 +1,299 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: Chris Seeley (https://github.com/Narwalter) + +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using System.Xml; +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; +using NUnit.Framework; +using DateTime = Google.Api.Ads.Dfp.v201311.DateTime; + +namespace Google.Api.Ads.Dfp.Tests.v201311 { + + /// + /// UnitTests for class. + /// + [TestFixture] + public class StatementBuilderTests { + + private static bool StatementsAreEqual(Statement s1, Statement s2) { + // Assumes both Statements are non-null and have non-null properties + if (String.Compare(s1.query, s2.query, true) != 0) { + return false; + } + if (s1.values.Length != s2.values.Length) { + return false; + } + // Assumes Statement values are in the same order + for (int i = 0; i < s1.values.Length; i++) { + if (!StringValueMapEntriesAreEqual(s1.values[i], s2.values[i])) { + return false; + } + } + return true; + } + + private static bool StringValueMapEntriesAreEqual(String_ValueMapEntry entry1, + String_ValueMapEntry entry2) { + return String.Equals(entry1.key, entry2.key) && ValuesAreEqual(entry1.value, entry2.value); + } + + private delegate bool ValueEqualityDelegate(Value value1, Value value2); + + private static bool ValuesAreEqual(Value value1, Value value2) { + Dictionary switcher = + new Dictionary(); + switcher.Add(typeof(TextValue), new ValueEqualityDelegate(TextValuesAreEqual)); + switcher.Add(typeof(NumberValue), new ValueEqualityDelegate(NumberValuesAreEqual)); + switcher.Add(typeof(BooleanValue), new ValueEqualityDelegate(BooleanValuesAreEqual)); + switcher.Add(typeof(SetValue), new ValueEqualityDelegate(SetValuesAreEqual)); + switcher.Add(typeof(DateValue), new ValueEqualityDelegate(DateValuesAreEqual)); + switcher.Add(typeof(DateTimeValue), new ValueEqualityDelegate(DateTimeValuesAreEqual)); + + if (switcher.ContainsKey(value1.GetType())) { + return switcher[value1.GetType()](value1, value2); + } + throw new NotImplementedException(String.Format("Unknown Value type {0}", value1.GetType())); + } + + private static bool TextValuesAreEqual(Value value1, Value value2) { + return String.Equals((value1 as TextValue).value, (value2 as TextValue).value); + } + + private static bool NumberValuesAreEqual(Value value1, Value value2) { + return String.Equals((value1 as NumberValue).value, (value2 as NumberValue).value); + } + + private static bool BooleanValuesAreEqual(Value value1, Value value2) { + return (value1 as BooleanValue).value == (value2 as BooleanValue).value; + } + + private static bool SetValuesAreEqual(Value value1, Value value2) { + Value[] set1 = (value1 as SetValue).values; + Value[] set2 = (value2 as SetValue).values; + + if (set1.Length != set2.Length) { + return false; + } + + for (int i = 0; i < set1.Length; i++) { + if (!ValuesAreEqual(set1[i], set2[i])) { + return false; + } + } + return true; + } + + private static bool DateValuesAreEqual(Value value1, Value value2) { + Date date1 = (value1 as DateValue).value; + Date date2 = (value2 as DateValue).value; + return DatesAreEqual(date1, date2); + } + + private static bool DateTimeValuesAreEqual(Value value1, Value value2) { + DateTime dateTime1 = (value1 as DateTimeValue).value; + DateTime dateTime2 = (value2 as DateTimeValue).value; + return DatesAreEqual(dateTime1.date, dateTime2.date) + && dateTime1.hour == dateTime2.hour + && dateTime1.minute == dateTime2.minute + && dateTime1.second == dateTime2.second + && String.Equals(dateTime1.timeZoneID, dateTime2.timeZoneID); + } + + private static bool DatesAreEqual(Date date1, Date date2) { + return date1.day == date2.day + && date1.month == date2.month + && date1.year == date2.year; + } + + [Test] + public void TestStatementBuilderBlankStatement() { + StatementBuilder statementBuilder = new StatementBuilder(); + + Statement expectedStatement = new Statement(); + expectedStatement.query = ""; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderBasicStatement() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("ID = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE ID = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderIgnoresKeyword() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("WHERE ID = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE ID = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderIncludesKeywordPrefix() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("WHEREWITHALL = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE WHEREWITHALL = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestAllStatementBuilderPartialFunctions() { + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Name, Id") + .From("Geo_Target") + .Where("Targetable = :targetable") + .OrderBy("Id DESC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .Offset(0) + .AddValue("targetable", true) + .IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .RemoveLimitAndOffset(); + Assert.AreEqual(null, statementBuilder.GetOffset()); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "SELECT Name, Id FROM Geo_Target" + + " WHERE Targetable = :targetable ORDER BY Id DESC"; + String_ValueMapEntry targetableEntry = new String_ValueMapEntry(); + targetableEntry.key = "targetable"; + BooleanValue targetableValue = new BooleanValue(); + targetableValue.value = true; + targetableEntry.value = targetableValue; + expectedStatement.values = new String_ValueMapEntry[] {targetableEntry}; + Assert.True(StatementsAreEqual(expectedStatement, statementBuilder.ToStatement())); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesWhere() { + StatementBuilder statementBuilder = new StatementBuilder("WHERE ID = 1") + .Where("ID = 2"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesFrom() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .From("Geo_Table"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesSelect() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Select("Id, Type"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesLimit() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Offset(100); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesIncreaseOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .IncreaseOffsetBy(100); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesRemoveLimitAndOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .RemoveLimitAndOffset(); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithSelect() { + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Id, Type"); + statementBuilder.Query = "SELECT Id, Type FROM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithFrom() { + StatementBuilder statementBuilder = new StatementBuilder() + .From("Geo_Table"); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithWhere() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("Type = City"); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithLimit() { + StatementBuilder statementBuilder = new StatementBuilder() + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithOffset() { + StatementBuilder statementBuilder = new StatementBuilder() + .Offset(100); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + } +} diff --git a/tests/Dfp/v201311/TestUtils.cs b/tests/Dfp/v201311/TestUtils.cs new file mode 100644 index 00000000000..bf725bf8791 --- /dev/null +++ b/tests/Dfp/v201311/TestUtils.cs @@ -0,0 +1,350 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201311; +using Google.Api.Ads.Dfp.v201311; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; +using System.Threading; +using System.Configuration; +using System.Collections; + +namespace Google.Api.Ads.Dfp.Tests.v201311 { + /// + /// A utility class to assist the testing of v201004 services. + /// + public class TestUtils { + public User GetCurrentUser(DfpUser user) { + return GetUserByEmail(user, new DfpAppConfig().Email); + } + + public User GetTrafficker(DfpUser user) { + return GetUserByEmail(user, "dfp.api.trafficker@gmail.com"); + } + + public User GetSalesperson(DfpUser user) { + return GetUserByEmail(user, "dfp.api.salesperson@gmail.com"); + } + + public User GetUserByEmail(DfpUser user, string email) { + UserService userService = (UserService) user.GetService(DfpService.v201311.UserService); + + // Create a Statement to get all users sorted by name. + Statement statement = new Statement(); + statement.query = string.Format("where email = '{0}' LIMIT 1", email); + + UserPage page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + return page.results[0]; + } else { + return null; + } + } + + public Role GetRole(DfpUser user, string roleName) { + UserService userService = (UserService)user.GetService(DfpService.v201311.UserService); + + // Get all roles. + Role[] roles = userService.getAllRoles(); + foreach (Role role in roles) { + if (role.name == roleName) { + return role; + } + } + return null; + } + + /// + /// Create a test company for running further tests. + /// + /// A test company for running further tests. + public Company CreateCompany(DfpUser user, CompanyType companyType) { + CompanyService companyService = (CompanyService) user.GetService( + DfpService.v201311.CompanyService); + Company company = new Company(); + company.name = string.Format("Company #{0}", GetTimeStamp()); + company.type = companyType; + + return companyService.createCompany(company); + } + + public Order CreateOrder(DfpUser user, long advertiserId, long salespersonId, + long traffickerId) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201311.OrderService); + + Order order = new Order(); + order.name = string.Format("Order #{0}", GetTimeStamp()); + order.advertiserId = advertiserId; + order.salespersonId = salespersonId; + order.traffickerId = traffickerId; + + return orderService.createOrder(order); + } + + public LineItem CreateLineItem(DfpUser user, long orderId, string adUnitId) { + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201311.LineItemService); + + long placementId = CreatePlacement(user, new string[] {adUnitId}).id; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201311.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201311.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + return lineItemService.createLineItem(lineItem); + } + + /// + /// Create a test company for running further tests. + /// + /// A creative for running further tests. + public Creative CreateCreative(DfpUser user, long advertiserId) { + CreativeService creativeService = (CreativeService)user.GetService( + DfpService.v201311.CreativeService); + + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", GetTimeStamp()); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + return creativeService.createCreative(imageCreative); + } + + public LineItemCreativeAssociation CreateLica(DfpUser user, long lineItemId, long creativeId) { + LineItemCreativeAssociationService licaService = + (LineItemCreativeAssociationService)user.GetService( + DfpService.v201311.LineItemCreativeAssociationService); + + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId; + lica.lineItemId = lineItemId; + + return licaService.createLineItemCreativeAssociation(lica); + } + + public AdUnit CreateAdUnit(DfpUser user) { + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201311.InventoryService); + + AdUnit adUnit = new AdUnit(); + adUnit.name = string.Format("Ad_Unit_{0}", GetTimeStamp()); + adUnit.parentId = FindRootAdUnit(user).id; + + // Set the size of possible creatives that can match this ad unit. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + return inventoryService.createAdUnit(adUnit); + } + + public AdUnit FindRootAdUnit(DfpUser user) { + // Get InventoryService. + InventoryService inventoryService = + (InventoryService)user.GetService(DfpService.v201311.InventoryService); + + // Create a Statement to only select the root ad unit. + Statement statement = new Statement(); + statement.query = "WHERE parentId IS NULL LIMIT 500"; + + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + return page.results[0]; + } + + public Placement CreatePlacement(DfpUser user, string[] targetedAdUnitIds) { + // Get InventoryService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201311.PlacementService); + + Placement placement = new Placement(); + placement.name = string.Format("Test placement #{0}", this.GetTimeStamp()); + placement.description = "Test placement"; + placement.targetedAdUnitIds = targetedAdUnitIds; + + return placementService.createPlacement(placement); + } + + public ReportJob CreateReport(DfpUser user) { + // Get ReportService. + ReportService reportService = + (ReportService) user.GetService(DfpService.v201311.ReportService); + + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + return reportService.runReportJob(reportJob); + } + + /// + /// Gets the current timestamp as a string. + /// + /// The current timestamp as a string. + public string GetTimeStamp() { + Thread.Sleep(500); + return (System.DateTime.UtcNow - new System.DateTime(1970, 1, 1)).Ticks. + ToString(); + } + } +} diff --git a/tests/Dfp/v201311/UserServiceTests.cs b/tests/Dfp/v201311/UserServiceTests.cs new file mode 100644 index 00000000000..0f78f07992c --- /dev/null +++ b/tests/Dfp/v201311/UserServiceTests.cs @@ -0,0 +1,217 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201311; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201311 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class UserServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private UserService userService; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Current user id for running tests. + /// + private long currentUserId; + + /// + /// Default public constructor. + /// + public UserServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + userService = (UserService) user.GetService(DfpService.v201311.UserService); + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + currentUserId = utils.GetCurrentUser(user).id; + } + + /// + /// Test whether we can fetch all roles. + /// + [Test] + public void TestGetAllRoles() { + Role[] roles = null; + + Assert.DoesNotThrow(delegate() { + roles = userService.getAllRoles(); + }); + Assert.NotNull(roles); + Assert.GreaterOrEqual(roles.Length, 0); + } + + /// + /// Test whether we can fetch the current user. + /// + [Test] + public void TestGetCurrentUser() { + User user = null; + + Assert.DoesNotThrow(delegate() { + user = userService.getCurrentUser(); + }); + + Assert.NotNull(user); + Assert.AreEqual(user.id, currentUserId); + } + + /// + /// Test whether we can fetch an existing user. + /// + [Test] + public void TestGetUser() { + User user = null; + + Assert.DoesNotThrow(delegate() { + user = userService.getUser(salespersonId); + }); + + Assert.NotNull(user); + Assert.AreEqual(user.id, salespersonId); + } + + /// + /// Test whether we can fetch a list of existing users that match given + /// statement. + /// + [Test] + public void TestGetUsersByStatement() { + Statement statement = new Statement(); + statement.query = "ORDER BY name LIMIT 500"; + + UserPage page = null; + + Assert.DoesNotThrow(delegate() { + page = userService.getUsersByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + + List salesPersonIds = new List(); + List traffickerIds = new List(); + + foreach(User tempUser in page.results) { + if (tempUser.roleName == "Salesperson") { + salesPersonIds.Add(tempUser.id); + } else if (tempUser.roleName == "Trafficker") { + traffickerIds.Add(tempUser.id); + } + } + Assert.Contains(salespersonId, salesPersonIds); + Assert.Contains(traffickerId, traffickerIds); + } + + /// + /// Test whether we can deactivate and activate a user. + /// + [Test] + public void TestPerformUserAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = {0}", salespersonId); + + DeactivateUsers action = new DeactivateUsers(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = userService.performUserAction(action, statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + + // Activate the user again. + + Assert.DoesNotThrow(delegate() { + result = userService.performUserAction(new ActivateUsers(), statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update a user. + /// + [Test] + public void TestUpdateUser() { + User user = userService.getUser(salespersonId); + user.preferredLocale = (user.preferredLocale == "fr_FR")? "en_US" : "fr_FR"; + + User newUser = null; + + Assert.DoesNotThrow(delegate() { + newUser = userService.updateUser(user); + }); + + Assert.NotNull(newUser); + Assert.AreEqual(newUser.id, user.id); + Assert.AreEqual(newUser.preferredLocale, user.preferredLocale); + } + + /// + /// Test whether we can update a list of users. + /// + [Test] + public void TestUpdateUsers() { + User user = userService.getUser(salespersonId); + user.preferredLocale = (user.preferredLocale == "fr_FR")? "en_US" : "fr_FR"; + + User[] newUsers = null; + + Assert.DoesNotThrow(delegate() { + newUsers = userService.updateUsers(new User[] {user}); + }); + + Assert.NotNull(newUsers); + Assert.AreEqual(newUsers.Length, 1); + Assert.AreEqual(newUsers[0].id, user.id); + Assert.AreEqual(newUsers[0].preferredLocale, user.preferredLocale); + } + } +} diff --git a/tests/Dfp/v201403/CompanyServiceTests.cs b/tests/Dfp/v201403/CompanyServiceTests.cs new file mode 100644 index 00000000000..2f49e6b2396 --- /dev/null +++ b/tests/Dfp/v201403/CompanyServiceTests.cs @@ -0,0 +1,139 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201403 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class CompanyServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private CompanyService companyService; + + /// + /// The company to be used for further tests. + /// + private Company testCompany1 = null; + + /// + /// The company to be used for further tests. + /// + private Company testCompany2 = null; + + /// + /// Default public constructor. + /// + public CompanyServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + companyService = (CompanyService) user.GetService(DfpService.v201403.CompanyService); + testCompany1 = utils.CreateCompany(user, CompanyType.ADVERTISER); + testCompany2 = utils.CreateCompany(user, CompanyType.ADVERTISER); + } + + /// + /// Test whether we can create a list of companies. + /// + [Test] + public void TestCreateCompanies() { + Company company1 = new Company(); + company1.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company1.type = CompanyType.ADVERTISER; + + Company company2 = new Company(); + company2.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company2.type = CompanyType.ADVERTISER; + + Company[] newCompanies = null; + Assert.DoesNotThrow(delegate() { + newCompanies = companyService.createCompanies(new Company[] {company1, company2}); + }); + + Assert.NotNull(newCompanies); + Assert.AreEqual(newCompanies.Length, 2); + + Assert.AreEqual(company1.name, newCompanies[0].name); + Assert.AreEqual(company1.type, newCompanies[0].type); + Assert.AreEqual(company2.name, newCompanies[1].name); + Assert.AreEqual(company2.type, newCompanies[1].type); + } + + /// + /// Test whether we can fetch a list of existing companies that match given + /// statement. + /// + [Test] + public void TestGetCompaniesByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = {0} ORDER BY name LIMIT 1", testCompany1.id); + CompanyPage page = null; + + Assert.DoesNotThrow(delegate() { + page = companyService.getCompaniesByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.results.Length, 1); + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].id, testCompany1.id); + Assert.AreEqual(page.results[0].name, testCompany1.name); + } + + /// + /// Test whether we can update a list of companies. + /// + [Test] + public void TestUpdateCompanies() { + testCompany1.name = "Corp " + testCompany1.name; + testCompany2.name = "Corp " + testCompany2.name; + + Company[] newCompanies = null; + + Assert.DoesNotThrow(delegate() { + newCompanies = companyService.updateCompanies(new Company[] {testCompany1, testCompany2}); + }); + + Assert.NotNull(newCompanies); + Assert.AreEqual(newCompanies.Length, 2); + + Assert.AreEqual(testCompany1.name, newCompanies[0].name); + Assert.AreEqual(testCompany1.type, newCompanies[0].type); + Assert.AreEqual(testCompany2.name, newCompanies[1].name); + Assert.AreEqual(testCompany2.type, newCompanies[1].type); + } + } +} diff --git a/tests/Dfp/v201403/CreativeServiceTests.cs b/tests/Dfp/v201403/CreativeServiceTests.cs new file mode 100644 index 00000000000..3b5ee11f8c6 --- /dev/null +++ b/tests/Dfp/v201403/CreativeServiceTests.cs @@ -0,0 +1,190 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201403 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class CreativeServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private CreativeService creativeService; + + /// + /// The advertiser company id to be used for running tests. + /// + private long advertiserId = 0; + + /// + /// The creative 1 to be used for running tests. + /// + private Creative creative1 = null; + + /// + /// The creative 2 to be used for running tests. + /// + private Creative creative2 = null; + + /// + /// Default public constructor. + /// + public CreativeServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + creativeService = (CreativeService)user.GetService(DfpService.v201403.CreativeService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + creative1 = utils.CreateCreative(user, advertiserId); + creative2 = utils.CreateCreative(user, advertiserId); + } + + /// + /// Test whether we can create a list of creatives. + /// + [Test] + public void TestCreateCreatives() { + // Create an array to store local image creative objects. + Creative[] imageCreatives = new ImageCreative[2]; + + for (int i = 0; i < 2; i++) { + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", i); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + imageCreatives[i] = imageCreative; + } + + Creative[] newCreatives = null; + + Assert.DoesNotThrow(delegate() { + newCreatives = creativeService.createCreatives(imageCreatives); + }); + + Assert.NotNull(newCreatives); + Assert.AreEqual(newCreatives.Length, 2); + Assert.NotNull(newCreatives[0]); + Assert.That(newCreatives[0] is ImageCreative); + Assert.AreEqual(newCreatives[0].advertiserId, advertiserId); + Assert.AreEqual(newCreatives[0].name, "Image creative #0"); + Assert.NotNull(newCreatives[1]); + Assert.That(newCreatives[1] is ImageCreative); + Assert.AreEqual(newCreatives[1].advertiserId, advertiserId); + Assert.AreEqual(newCreatives[1].name, "Image creative #1"); + } + + /// + /// Test whether we can fetch a list of existing creatives that match given + /// statement. + /// + [Test] + public void TestGetCreativesByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 500", creative1.id); + + CreativePage page = null; + + Assert.DoesNotThrow(delegate() { + page = creativeService.getCreativesByStatement(statement); + }); + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].id, creative1.id); + Assert.AreEqual(page.results[0].GetType(), creative1.GetType()); + Assert.AreEqual(page.results[0].name, creative1.name); + Assert.AreEqual(page.results[0].advertiserId, creative1.advertiserId); + Assert.AreEqual(page.results[0].previewUrl, creative1.previewUrl); + Assert.AreEqual(page.results[0].size.height, creative1.size.height); + Assert.AreEqual(page.results[0].size.width, creative1.size.width); + } + + /// + /// Test whether we can update a list of creatives. + /// + [Test] + public void TestUpdateCreatives() { + ImageCreative imageCreative1 = (ImageCreative) creative1; + imageCreative1.destinationUrl = "http://news.google.com"; + + ImageCreative imageCreative2 = (ImageCreative) creative2; + imageCreative2.destinationUrl = "http://finance.google.com"; + + Creative[] newCreatives = null; + + Assert.DoesNotThrow(delegate() { + newCreatives = creativeService.updateCreatives(new Creative[] {creative1, creative2}); + }); + + Assert.NotNull(newCreatives); + Assert.AreEqual(newCreatives.Length, 2); + + Assert.AreEqual(newCreatives[0].id, creative1.id); + Assert.AreEqual(newCreatives[0].name, creative1.name); + Assert.AreEqual(newCreatives[0].advertiserId, creative1.advertiserId); + Assert.AreEqual(newCreatives[0].size.height, creative1.size.height); + Assert.AreEqual(newCreatives[0].size.width, creative1.size.width); + Assert.That(newCreatives[0] is ImageCreative); + Assert.AreEqual((newCreatives[0] as ImageCreative).destinationUrl, + imageCreative1.destinationUrl); + + Assert.AreEqual(newCreatives[1].id, creative2.id); + Assert.AreEqual(newCreatives[1].name, creative2.name); + Assert.AreEqual(newCreatives[1].advertiserId, creative2.advertiserId); + Assert.AreEqual(newCreatives[1].size.height, creative2.size.height); + Assert.AreEqual(newCreatives[1].size.width, creative2.size.width); + Assert.That(newCreatives[1] is ImageCreative); + Assert.AreEqual((newCreatives[1] as ImageCreative).destinationUrl, + imageCreative2.destinationUrl); + } + } +} diff --git a/tests/Dfp/v201403/ForecastServiceTests.cs b/tests/Dfp/v201403/ForecastServiceTests.cs new file mode 100644 index 00000000000..d777c3ed6ee --- /dev/null +++ b/tests/Dfp/v201403/ForecastServiceTests.cs @@ -0,0 +1,171 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201403 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class ForecastServiceTests : BaseTests { + /// + /// ForecastService object to be used in this test. + /// + private ForecastService forecastService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Placement id for running tests. + /// + private long placementId; + + /// + /// Line item id for running tests. + /// + private long lineItemId; + + /// + /// Default public constructor. + /// + public ForecastServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + forecastService = (ForecastService)user.GetService(DfpService.v201403.ForecastService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + placementId = utils.CreatePlacement(user, new string[] {adUnitId}).id; + lineItemId = utils.CreateLineItem(user, orderId, adUnitId).id; + } + + /// + /// Test whether we can get a forecast for given line item. + /// + [Test] + public void TestGetForecast() { + TestUtils utils = new TestUtils(); + + LineItem lineItem = new LineItem(); + lineItem.name = string.Format("Line item #{0}", utils.GetTimeStamp()); + + lineItem.orderId = orderId; + + lineItem.targeting = new Targeting(); + lineItem.targeting.inventoryTargeting = new InventoryTargeting(); + lineItem.targeting.inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + Size size1 = new Size(); + size1.width = 300; + size1.height = 250; + + Size size2 = new Size(); + size2.width = 120; + size2.height = 600; + + // Create the creative placeholders. + CreativePlaceholder creativePlaceholder1 = new CreativePlaceholder(); + creativePlaceholder1.size = size1; + + CreativePlaceholder creativePlaceholder2 = new CreativePlaceholder(); + creativePlaceholder1.size = size2; + + lineItem.creativePlaceholders = + new CreativePlaceholder[] {creativePlaceholder1, creativePlaceholder2}; + + lineItem.lineItemType = LineItemType.STANDARD; + + // Set start date time and end date time. + lineItem.startDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddDays(1)); + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000; + + lineItem.creativeRotationType = CreativeRotationType.EVEN; + lineItem.discountType = LineItemDiscountType.PERCENTAGE; + + lineItem.unitsBought = 500000; + lineItem.unitType = UnitType.IMPRESSIONS; + + Forecast forecast = null; + Assert.DoesNotThrow(delegate() { + forecast = forecastService.getForecast(lineItem); + }); + Assert.NotNull(forecast); + Assert.AreEqual(forecast.orderId, orderId); + Assert.AreEqual(forecast.unitType, lineItem.unitType); + } + + /// + /// Test whether we can get a forecast for existing line item. + /// + [Test] + public void TestGetForecastById() { + Forecast forecast = null; + Assert.DoesNotThrow(delegate() { + forecast = forecastService.getForecastById(lineItemId); + }); + Assert.NotNull(forecast); + Assert.AreEqual(forecast.orderId, orderId); + } + } +} diff --git a/tests/Dfp/v201403/InventoryServiceTests.cs b/tests/Dfp/v201403/InventoryServiceTests.cs new file mode 100644 index 00000000000..9c0400e4fd3 --- /dev/null +++ b/tests/Dfp/v201403/InventoryServiceTests.cs @@ -0,0 +1,227 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201403 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class InventoryServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private InventoryService inventoryService; + + /// + /// The ad unit 1 for running tests. + /// + private AdUnit adUnit1; + + /// + /// The ad unit 2 for running tests. + /// + private AdUnit adUnit2; + + /// + /// Default public constructor. + /// + public InventoryServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + inventoryService = (InventoryService) user.GetService(DfpService.v201403.InventoryService); + adUnit1 = utils.CreateAdUnit(user); + adUnit2 = utils.CreateAdUnit(user); + } + + /// + /// Test whether we can create a list of ad units. + /// + [Test] + public void TestCreateAdUnits() { + // Create ad unit 1. + AdUnit localAdUnit1 = new AdUnit(); + localAdUnit1.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit1.parentId = adUnit1.id; + + Size size1 = new Size(); + size1.width = 300; + size1.height = 250; + + AdUnitSize adUnitSize1 = new AdUnitSize(); + adUnitSize1.size = size1; + adUnitSize1.environmentType = EnvironmentType.BROWSER; + + localAdUnit1.adUnitSizes = new AdUnitSize[] {adUnitSize1}; + + // Create ad unit 2. + AdUnit localAdUnit2 = new AdUnit(); + localAdUnit2.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit2.parentId = adUnit1.id; + + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + + AdUnitSize adUnitSize2 = new AdUnitSize(); + adUnitSize2.size = size2; + adUnitSize2.environmentType = EnvironmentType.BROWSER; + + localAdUnit2.adUnitSizes = new AdUnitSize[] {adUnitSize2}; + + AdUnit[] newAdUnits = null; + + Assert.DoesNotThrow(delegate() { + newAdUnits = inventoryService.createAdUnits(new AdUnit[] {localAdUnit1, localAdUnit2}); + }); + + Assert.NotNull(newAdUnits); + Assert.AreEqual(newAdUnits.Length, 2); + + Assert.AreEqual(newAdUnits[0].name, localAdUnit1.name); + Assert.AreEqual(newAdUnits[0].parentId, localAdUnit1.parentId); + Assert.AreEqual(newAdUnits[0].parentId, adUnit1.id); + Assert.AreEqual(newAdUnits[0].status, localAdUnit1.status); + Assert.AreEqual(newAdUnits[0].targetWindow, localAdUnit1.targetWindow); + + Assert.AreEqual(newAdUnits[1].name, localAdUnit2.name); + Assert.AreEqual(newAdUnits[1].parentId, localAdUnit2.parentId); + Assert.AreEqual(newAdUnits[1].parentId, adUnit1.id); + Assert.AreEqual(newAdUnits[1].status, localAdUnit2.status); + Assert.AreEqual(newAdUnits[1].targetWindow, localAdUnit2.targetWindow); + } + + /// + /// Test whether we can fetch a list of existing ad units that match given + /// statement. + /// + [Test] + public void TestGetAdUnitsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", adUnit1.id); + + AdUnitPage page = null; + + Assert.DoesNotThrow(delegate() { + page = inventoryService.getAdUnitsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results[0]); + + Assert.AreEqual(page.results[0].name, adUnit1.name); + Assert.AreEqual(page.results[0].parentId, adUnit1.parentId); + Assert.AreEqual(page.results[0].id, adUnit1.id); + Assert.AreEqual(page.results[0].status, adUnit1.status); + Assert.AreEqual(page.results[0].targetWindow, adUnit1.targetWindow); + } + + /// + /// Test whether we can deactivate an ad unit. + /// + [Test] + public void TestPerformAdUnitAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", adUnit1.id); + + UpdateResult result = null; + Assert.DoesNotThrow(delegate() { + result = inventoryService.performAdUnitAction(new DeactivateAdUnits(), statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update a list of an ad units. + /// + [Test] + public void TestUpdateAdUnits() { + List adUnitSizes = null; + Size size = null; + + // Modify ad unit 1. + adUnitSizes = new List(adUnit1.adUnitSizes); + size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit1.adUnitSizes = adUnitSizes.ToArray(); + + // Modify ad unit 2. + adUnitSizes = new List(adUnit2.adUnitSizes); + size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit2.adUnitSizes = adUnitSizes.ToArray(); + + AdUnit[] newAdUnits = null; + Assert.DoesNotThrow(delegate() { + newAdUnits = inventoryService.updateAdUnits(new AdUnit[] {adUnit1, adUnit2}); + }); + + Assert.NotNull(newAdUnits); + Assert.AreEqual(newAdUnits.Length, 2); + + Assert.AreEqual(newAdUnits[0].name, adUnit1.name); + Assert.AreEqual(newAdUnits[0].parentId, adUnit1.parentId); + Assert.AreEqual(newAdUnits[0].id, adUnit1.id); + Assert.AreEqual(newAdUnits[0].status, adUnit1.status); + Assert.AreEqual(newAdUnits[0].targetWindow, adUnit1.targetWindow); + Assert.AreEqual(newAdUnits[0].adUnitSizes.Length, adUnit1.adUnitSizes.Length); + + Assert.AreEqual(newAdUnits[1].name, adUnit2.name); + Assert.AreEqual(newAdUnits[1].parentId, adUnit2.parentId); + Assert.AreEqual(newAdUnits[1].id, adUnit2.id); + Assert.AreEqual(newAdUnits[1].status, adUnit2.status); + Assert.AreEqual(newAdUnits[1].targetWindow, adUnit2.targetWindow); + Assert.AreEqual(newAdUnits[1].adUnitSizes.Length, adUnit2.adUnitSizes.Length); + } + } +} diff --git a/tests/Dfp/v201403/LineItemCreativeAssociationServiceTests.cs b/tests/Dfp/v201403/LineItemCreativeAssociationServiceTests.cs new file mode 100644 index 00000000000..b9b72cdf60f --- /dev/null +++ b/tests/Dfp/v201403/LineItemCreativeAssociationServiceTests.cs @@ -0,0 +1,249 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201403 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class LineItemCreativeAssociationServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private LineItemCreativeAssociationService licaService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Creative id 1 for running tests. + /// + private long creativeId1; + + /// + /// Creative id 2 for running tests. + /// + private long creativeId2; + + /// + /// Creative id 3 for running tests. + /// + private long creativeId3; + + /// + /// Creative id 4 for running tests. + /// + private long creativeId4; + + /// + /// Line item id 1 for running tests. + /// + private long lineItemId1; + + /// + /// Line item id 2 for running tests. + /// + private long lineItemId2; + + /// + /// Line item id 3 for running tests. + /// + private long lineItemId3; + + /// + /// Line item id 4 for running tests. + /// + private long lineItemId4; + + /// + /// Line item creative association 1 for running tests. + /// + private LineItemCreativeAssociation lica1; + + /// + /// Line item creative association 2 for running tests. + /// + private LineItemCreativeAssociation lica2; + + /// + /// Default public constructor. + /// + public LineItemCreativeAssociationServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + licaService = (LineItemCreativeAssociationService) user.GetService( + DfpService.v201403.LineItemCreativeAssociationService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + + lineItemId1 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId2 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId3 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId4 = utils.CreateLineItem(user, orderId, adUnitId).id; + + creativeId1 = utils.CreateCreative(user, advertiserId).id; + creativeId2 = utils.CreateCreative(user, advertiserId).id; + creativeId3 = utils.CreateCreative(user, advertiserId).id; + creativeId4 = utils.CreateCreative(user, advertiserId).id; + + lica1 = utils.CreateLica(user, lineItemId3, creativeId3); + lica2 = utils.CreateLica(user, lineItemId4, creativeId4); + } + + /// + /// Test whether we can create a list of line item creative associations. + /// + [Test] + public void TestCreateLineItemCreativeAssociations() { + LineItemCreativeAssociation localLica1 = new LineItemCreativeAssociation(); + localLica1.creativeId = creativeId1; + localLica1.lineItemId = lineItemId1; + + LineItemCreativeAssociation localLica2 = new LineItemCreativeAssociation(); + localLica2.creativeId = creativeId2; + localLica2.lineItemId = lineItemId2; + + LineItemCreativeAssociation[] newLicas = null; + + Assert.DoesNotThrow(delegate() { + newLicas = licaService.createLineItemCreativeAssociations( + new LineItemCreativeAssociation[] {localLica1, localLica2}); + }); + + Assert.NotNull(newLicas); + Assert.AreEqual(newLicas.Length, 2); + + Assert.NotNull(newLicas[0]); + Assert.AreEqual(newLicas[0].creativeId, localLica1.creativeId); + Assert.AreEqual(newLicas[0].lineItemId, localLica1.lineItemId); + + Assert.NotNull(newLicas[1]); + Assert.AreEqual(newLicas[1].creativeId, localLica2.creativeId); + Assert.AreEqual(newLicas[1].lineItemId, localLica2.lineItemId); + } + + /// + /// Test whether we can fetch a list of existing line item creative + /// associations that match given statement. + /// + [Test] + public void TestGetLineItemCreativeAssociationsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE lineItemId = '{0}' LIMIT 500", lineItemId3); + + LineItemCreativeAssociationPage page = null; + Assert.DoesNotThrow(delegate() { + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + }); + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].creativeId, lica1.creativeId); + Assert.AreEqual(page.results[0].lineItemId, lica1.lineItemId); + } + + /// + /// Test whether we can deactivate a line item create association. + /// + [Test] + public void TestPerformLineItemCreativeAssociationAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE lineItemId = '{0}' LIMIT 1", lineItemId3); + + DeactivateLineItemCreativeAssociations action = new DeactivateLineItemCreativeAssociations(); + + UpdateResult result = null; + Assert.DoesNotThrow(delegate() { + result = licaService.performLineItemCreativeAssociationAction(action, statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update a list of line item creative associations. + /// + [Test] + public void TestUpdateLineItemCreativeAssociations() { + lica1.destinationUrl = "http://news.google.com"; + lica2.destinationUrl = "http://news.google.com"; + + LineItemCreativeAssociation[] newLicas = null; + Assert.DoesNotThrow(delegate() { + newLicas = licaService.updateLineItemCreativeAssociations( + new LineItemCreativeAssociation[] {lica1, lica2}); + }); + + Assert.NotNull(newLicas); + Assert.AreEqual(newLicas.Length, 2); + + Assert.NotNull(newLicas[0]); + Assert.AreEqual(newLicas[0].creativeId, lica1.creativeId); + Assert.AreEqual(newLicas[0].lineItemId, lica1.lineItemId); + + Assert.NotNull(newLicas[1]); + Assert.AreEqual(newLicas[1].creativeId, lica2.creativeId); + Assert.AreEqual(newLicas[1].lineItemId, lica2.lineItemId); + } + } +} diff --git a/tests/Dfp/v201403/LineItemServiceTests.cs b/tests/Dfp/v201403/LineItemServiceTests.cs new file mode 100644 index 00000000000..0cfee51a594 --- /dev/null +++ b/tests/Dfp/v201403/LineItemServiceTests.cs @@ -0,0 +1,318 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201403 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class LineItemServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private LineItemService lineItemService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Placement id for running tests. + /// + private long placementId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Line item 1 for running tests. + /// + private LineItem lineItem1; + + /// + /// Line item 2 for running tests. + /// + private LineItem lineItem2; + + /// + /// Default public constructor. + /// + public LineItemServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + lineItemService = (LineItemService)user.GetService(DfpService.v201403.LineItemService); + + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + placementId = utils.CreatePlacement(user, new string[] {adUnitId}).id; + lineItem1 = utils.CreateLineItem(user, orderId, adUnitId); + lineItem2 = utils.CreateLineItem(user, orderId, adUnitId); + } + + /// + /// Test whether we can create a list of line items. + /// + [Test] + public void TestCreateLineItems() { + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201403.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201403.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + // Create an array to store local line item objects. + LineItem[] lineItems = new LineItem[2]; + + for (int i = 0; i < lineItems.Length; i++) { + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + lineItems[i] = lineItem; + } + + LineItem[] localLineItems = null; + + Assert.DoesNotThrow(delegate() { + localLineItems = lineItemService.createLineItems(lineItems); + }); + + Assert.NotNull(localLineItems); + Assert.AreEqual(localLineItems.Length, 2); + + Assert.AreEqual(localLineItems[0].name, lineItems[0].name); + Assert.AreEqual(localLineItems[0].orderId, lineItems[0].orderId); + + Assert.AreEqual(localLineItems[1].name, lineItems[1].name); + Assert.AreEqual(localLineItems[1].orderId, lineItems[1].orderId); + } + + /// + /// Test whether we can fetch a list of existing line items that match given + /// statement. + /// + [Test] + public void TestGetLineItemsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", lineItem1.id); + + LineItemPage page = null; + + Assert.DoesNotThrow(delegate() { + page = lineItemService.getLineItemsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results); + Assert.AreEqual(page.results[0].id, lineItem1.id); + Assert.AreEqual(page.results[0].name, lineItem1.name); + Assert.AreEqual(page.results[0].orderId, lineItem1.orderId); + } + + /// + /// Test whether we can activate a line item. + /// + [Test] + public void TestPerformLineItemAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE orderId = '{0}' and status = '{1}'", + orderId, ComputedStatus.NEEDS_CREATIVES); + + ActivateLineItems action = new ActivateLineItems(); + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = lineItemService.performLineItemAction(action, statement); + }); + + Assert.NotNull(result); + } + + /// + /// Test whether we can update a list of line items. + /// + [Test] + public void TestUpdateLineItems() { + lineItem1.costPerUnit.microAmount = 3500000; + lineItem2.costPerUnit.microAmount = 3500000; + + LineItem[] localLineItems = null; + + Assert.DoesNotThrow(delegate() { + localLineItems = lineItemService.updateLineItems(new LineItem[] {lineItem1, lineItem2}); + }); + + Assert.NotNull(localLineItems); + Assert.AreEqual(localLineItems.Length, 2); + + Assert.AreEqual(localLineItems[0].id, lineItem1.id); + Assert.AreEqual(localLineItems[0].name, lineItem1.name); + Assert.AreEqual(localLineItems[0].orderId, lineItem1.orderId); + Assert.AreEqual(localLineItems[0].costPerUnit.microAmount, lineItem1.costPerUnit.microAmount); + + Assert.AreEqual(localLineItems[1].id, lineItem2.id); + Assert.AreEqual(localLineItems[1].name, lineItem2.name); + Assert.AreEqual(localLineItems[1].orderId, lineItem2.orderId); + Assert.AreEqual(localLineItems[1].costPerUnit.microAmount, lineItem2.costPerUnit.microAmount); + } + } +} diff --git a/tests/Dfp/v201403/OrderServiceTests.cs b/tests/Dfp/v201403/OrderServiceTests.cs new file mode 100644 index 00000000000..c9d81a16232 --- /dev/null +++ b/tests/Dfp/v201403/OrderServiceTests.cs @@ -0,0 +1,172 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfp.Tests.v201403 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class OrderServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private OrderService orderService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Default public constructor. + /// + public OrderServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + orderService = (OrderService) user.GetService(DfpService.v201403.OrderService); + + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + } + + /// + /// Test whether we can create a list of orders. + /// + [Test] + public void TestCreateOrders() { + Order order1 = new Order(); + order1.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order1.advertiserId = advertiserId; + order1.traffickerId = traffickerId; + order1.currencyCode = "USD"; + + Order order2 = new Order(); + order2.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order2.advertiserId = advertiserId; + order2.traffickerId = traffickerId; + order2.currencyCode = "USD"; + + Order[] newOrders = null; + + Assert.DoesNotThrow(delegate() { + newOrders = orderService.createOrders(new Order[] {order1, order2}); + }); + + Statement statement = new Statement(); + statement.query = string.Format("WHERE advertiserId = '{0}' LIMIT 500", advertiserId); + + OrderPage page = orderService.getOrdersByStatement(statement); + Assert.NotNull(newOrders); + Assert.AreEqual(newOrders.Length, 2); + + Assert.AreEqual(order1.name, newOrders[0].name); + Assert.AreEqual(order1.advertiserId, newOrders[0].advertiserId); + Assert.AreEqual(order1.traffickerId, newOrders[0].traffickerId); + Assert.AreEqual(order1.currencyCode, newOrders[0].currencyCode); + + Assert.AreEqual(order2.name, newOrders[1].name); + Assert.AreEqual(order2.advertiserId, newOrders[1].advertiserId); + Assert.AreEqual(order2.traffickerId, newOrders[1].traffickerId); + Assert.AreEqual(order2.currencyCode, newOrders[1].currencyCode); + } + + /// + /// Test whether we can perform an order action. + /// + [Test] + public void TestPerformOrderAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE status IN ('{0}', '{1}')", + OrderStatus.DRAFT, OrderStatus.PENDING_APPROVAL); + + ApproveOrders action = new ApproveOrders(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = orderService.performOrderAction(action, statement); + }); + + Assert.NotNull(result); + Assert.GreaterOrEqual(result.numChanges, 0); + } + + /// + /// Test whether we can update a list of orders. + /// + [Test] + public void TestUpdateOrders() { + Statement statement = new Statement(); + statement.query = String.Format("WHERE id = {0} LIMIT 1", orderId); + Order order = orderService.getOrdersByStatement(statement).results[0]; + order.notes = "Spoke to advertiser. All is well."; + + Order[] newOrders = null; + + Assert.DoesNotThrow(delegate() { + newOrders = orderService.updateOrders(new Order[] {order}); + }); + + Assert.NotNull(newOrders); + Assert.AreEqual(newOrders.Length, 1); + + Assert.AreEqual(order.id, newOrders[0].id); + Assert.AreEqual(order.name, newOrders[0].name); + Assert.AreEqual(order.notes, newOrders[0].notes); + Assert.AreEqual(order.advertiserId, newOrders[0].advertiserId); + Assert.AreEqual(order.traffickerId, newOrders[0].traffickerId); + Assert.AreEqual(order.currencyCode, newOrders[0].currencyCode); + } + } + + +} diff --git a/tests/Dfp/v201403/PlacementServiceTests.cs b/tests/Dfp/v201403/PlacementServiceTests.cs new file mode 100644 index 00000000000..01e713d6f9f --- /dev/null +++ b/tests/Dfp/v201403/PlacementServiceTests.cs @@ -0,0 +1,180 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201403 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class PlacementServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private PlacementService placementService; + + /// + /// The ad unit 1 for running tests. + /// + private AdUnit adUnit1; + + /// + /// The ad unit 2 for running tests. + /// + private AdUnit adUnit2; + + /// + /// The placement for running tests. + /// + private Placement placement; + + /// + /// Default public constructor. + /// + public PlacementServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + placementService = (PlacementService) user.GetService(DfpService.v201403.PlacementService); + adUnit1 = utils.CreateAdUnit(user); + adUnit2 = utils.CreateAdUnit(user); + placement = utils.CreatePlacement(user, new string[] {adUnit1.id, adUnit2.id}); + } + + /// + /// Test whether we can create a list of placements items. + /// + [Test] + public void TestCreatePlacements() { + TestUtils utils = new TestUtils(); + Placement placement1 = new Placement(); + placement1.name = string.Format("Medium Square AdUnit Placement #{0}", utils.GetTimeStamp()); + placement1.description = "Contains ad units that can hold creatives of size 300x250"; + placement1.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement placement2 = new Placement(); + placement2.name = string.Format("Medium Square AdUnit Placement #{0}", utils.GetTimeStamp()); + placement2.description = "Contains ad units that can hold creatives of size 300x250"; + placement2.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement[] newPlacements = null; + + Assert.DoesNotThrow(delegate() { + newPlacements = placementService.createPlacements(new Placement[] {placement1, placement2}); + }); + + Assert.NotNull(newPlacements); + Assert.AreEqual(newPlacements.Length, 2); + + Assert.NotNull(newPlacements[0]); + Assert.AreEqual(newPlacements[0].name, placement1.name); + Assert.AreEqual(newPlacements[0].description, placement1.description); + Assert.Contains(adUnit1.id, newPlacements[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[0].targetedAdUnitIds); + + Assert.NotNull(newPlacements[1]); + Assert.AreEqual(newPlacements[1].name, placement2.name); + Assert.AreEqual(newPlacements[1].description, placement2.description); + Assert.Contains(adUnit1.id, newPlacements[1].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[1].targetedAdUnitIds); + } + + /// + /// Test whether we can fetch a list of existing placements that match given + /// statement. + /// + [Test] + public void TestGetPlacementsByStatement() { + // Create a Statement to only select active placements. + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}'", placement.id); + + PlacementPage page = null; + + Assert.DoesNotThrow(delegate() { + page = placementService.getPlacementsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.results.Length, 1); + + Assert.AreEqual(page.results[0].id, placement.id); + Assert.AreEqual(page.results[0].name, placement.name); + Assert.AreEqual(page.results[0].description, placement.description); + Assert.Contains(adUnit1.id, page.results[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, page.results[0].targetedAdUnitIds); + } + + /// + /// Test whether we can deactivate a placement. + /// + [Test] + public void TestPerformPlacementAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE status = '{0}'", InventoryStatus.ACTIVE); + + DeactivatePlacements action = new DeactivatePlacements(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = placementService.performPlacementAction(action, statement); + }); + + Assert.NotNull(result); + Assert.GreaterOrEqual(result.numChanges, 0); + } + + /// + /// Test whether we can update a list of placements. + /// + [Test] + public void TestUpdatePlacements() { + placement.description += "More description"; + + Placement[] newPlacements = null; + + Assert.DoesNotThrow(delegate() { + newPlacements = placementService.updatePlacements(new Placement[] {placement}); + }); + + Assert.NotNull(newPlacements); + Assert.AreEqual(newPlacements.Length, 1); + + Assert.NotNull(newPlacements[0]); + Assert.AreEqual(newPlacements[0].name, placement.name); + Assert.AreEqual(newPlacements[0].description, placement.description); + Assert.Contains(adUnit1.id, newPlacements[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[0].targetedAdUnitIds); + } + } +} diff --git a/tests/Dfp/v201403/ReportServiceTests.cs b/tests/Dfp/v201403/ReportServiceTests.cs new file mode 100644 index 00000000000..b48eb84e65d --- /dev/null +++ b/tests/Dfp/v201403/ReportServiceTests.cs @@ -0,0 +1,161 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201403 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class ReportServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private ReportService reportService; + + /// + /// Report id for running further tests. + /// + long reportId; + + /// + /// Default public constructor. + /// + public ReportServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + reportService = (ReportService) user.GetService(DfpService.v201403.ReportService); + reportId = utils.CreateReport(user).id; + } + + /// + /// Test whether we can run a delivery report. + /// + [Test] + public void TestRunDeliveryReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can run an inventory report. + /// + [Test] + public void TestRunInventoryReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.DATE}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + Column.TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + Column.TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_WEEK; + + ReportJob newReportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can run a sales report. + /// + [Test] + public void TestRunSalesReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.SALESPERSON_ID, + Dimension.SALESPERSON_NAME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CPM_AND_CPC_REVENUE, Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + ReportJob newReportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can retrieve existing report job. + /// + [Test] + public void TestGetReportJob() { + ReportJob reportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.getReportJob(reportId); + }); + + Assert.NotNull(reportJob); + Assert.AreEqual(reportJob.id, reportId); + } + + /// + /// Test whether we can retrieve report download URL. + /// + [Test] + public void TestGetReportDownloadUrl() { + string url = null; + + Assert.DoesNotThrow(delegate() { + url = reportService.getReportDownloadURL(reportId, ExportFormat.CSV_EXCEL); + }); + + Assert.True(Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)); + + Assert.DoesNotThrow(delegate() { + url = reportService.getReportDownloadURL(reportId, ExportFormat.TSV); + }); + + Assert.True(Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)); + } + } +} diff --git a/tests/Dfp/v201403/StatementBuilderTests.cs b/tests/Dfp/v201403/StatementBuilderTests.cs new file mode 100644 index 00000000000..2350ce6ac35 --- /dev/null +++ b/tests/Dfp/v201403/StatementBuilderTests.cs @@ -0,0 +1,299 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: christopherseeley@gmail.com (Christopher Seeley) + +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using System.Xml; +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; +using NUnit.Framework; +using DateTime = Google.Api.Ads.Dfp.v201403.DateTime; + +namespace Google.Api.Ads.Dfp.Tests.v201403 { + + /// + /// UnitTests for class. + /// + [TestFixture] + public class StatementBuilderTests { + + private static bool StatementsAreEqual(Statement s1, Statement s2) { + // Assumes both Statements are non-null and have non-null properties + if (String.Compare(s1.query, s2.query, true) != 0) { + return false; + } + if (s1.values.Length != s2.values.Length) { + return false; + } + // Assumes Statement values are in the same order + for (int i = 0; i < s1.values.Length; i++) { + if (!StringValueMapEntriesAreEqual(s1.values[i], s2.values[i])) { + return false; + } + } + return true; + } + + private static bool StringValueMapEntriesAreEqual(String_ValueMapEntry entry1, + String_ValueMapEntry entry2) { + return String.Equals(entry1.key, entry2.key) && ValuesAreEqual(entry1.value, entry2.value); + } + + private delegate bool ValueEqualityDelegate(Value value1, Value value2); + + private static bool ValuesAreEqual(Value value1, Value value2) { + Dictionary switcher = + new Dictionary(); + switcher.Add(typeof(TextValue), new ValueEqualityDelegate(TextValuesAreEqual)); + switcher.Add(typeof(NumberValue), new ValueEqualityDelegate(NumberValuesAreEqual)); + switcher.Add(typeof(BooleanValue), new ValueEqualityDelegate(BooleanValuesAreEqual)); + switcher.Add(typeof(SetValue), new ValueEqualityDelegate(SetValuesAreEqual)); + switcher.Add(typeof(DateValue), new ValueEqualityDelegate(DateValuesAreEqual)); + switcher.Add(typeof(DateTimeValue), new ValueEqualityDelegate(DateTimeValuesAreEqual)); + + if (switcher.ContainsKey(value1.GetType())) { + return switcher[value1.GetType()](value1, value2); + } + throw new NotImplementedException(String.Format("Unknown Value type {0}", value1.GetType())); + } + + private static bool TextValuesAreEqual(Value value1, Value value2) { + return String.Equals((value1 as TextValue).value, (value2 as TextValue).value); + } + + private static bool NumberValuesAreEqual(Value value1, Value value2) { + return String.Equals((value1 as NumberValue).value, (value2 as NumberValue).value); + } + + private static bool BooleanValuesAreEqual(Value value1, Value value2) { + return (value1 as BooleanValue).value == (value2 as BooleanValue).value; + } + + private static bool SetValuesAreEqual(Value value1, Value value2) { + Value[] set1 = (value1 as SetValue).values; + Value[] set2 = (value2 as SetValue).values; + + if (set1.Length != set2.Length) { + return false; + } + + for (int i = 0; i < set1.Length; i++) { + if (!ValuesAreEqual(set1[i], set2[i])) { + return false; + } + } + return true; + } + + private static bool DateValuesAreEqual(Value value1, Value value2) { + Date date1 = (value1 as DateValue).value; + Date date2 = (value2 as DateValue).value; + return DatesAreEqual(date1, date2); + } + + private static bool DateTimeValuesAreEqual(Value value1, Value value2) { + DateTime dateTime1 = (value1 as DateTimeValue).value; + DateTime dateTime2 = (value2 as DateTimeValue).value; + return DatesAreEqual(dateTime1.date, dateTime2.date) + && dateTime1.hour == dateTime2.hour + && dateTime1.minute == dateTime2.minute + && dateTime1.second == dateTime2.second + && String.Equals(dateTime1.timeZoneID, dateTime2.timeZoneID); + } + + private static bool DatesAreEqual(Date date1, Date date2) { + return date1.day == date2.day + && date1.month == date2.month + && date1.year == date2.year; + } + + [Test] + public void TestStatementBuilderBlankStatement() { + StatementBuilder statementBuilder = new StatementBuilder(); + + Statement expectedStatement = new Statement(); + expectedStatement.query = ""; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderBasicStatement() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("ID = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE ID = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderIgnoresKeyword() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("WHERE ID = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE ID = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderIncludesKeywordPrefix() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("WHEREWITHALL = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE WHEREWITHALL = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestAllStatementBuilderPartialFunctions() { + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Name, Id") + .From("Geo_Target") + .Where("Targetable = :targetable") + .OrderBy("Id DESC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .Offset(0) + .AddValue("targetable", true) + .IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .RemoveLimitAndOffset(); + Assert.AreEqual(null, statementBuilder.GetOffset()); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "SELECT Name, Id FROM Geo_Target" + + " WHERE Targetable = :targetable ORDER BY Id DESC"; + String_ValueMapEntry targetableEntry = new String_ValueMapEntry(); + targetableEntry.key = "targetable"; + BooleanValue targetableValue = new BooleanValue(); + targetableValue.value = true; + targetableEntry.value = targetableValue; + expectedStatement.values = new String_ValueMapEntry[] {targetableEntry}; + Assert.True(StatementsAreEqual(expectedStatement, statementBuilder.ToStatement())); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesWhere() { + StatementBuilder statementBuilder = new StatementBuilder("WHERE ID = 1") + .Where("ID = 2"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesFrom() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .From("Geo_Table"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesSelect() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Select("Id, Type"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesLimit() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Offset(100); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesIncreaseOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .IncreaseOffsetBy(100); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesRemoveLimitAndOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .RemoveLimitAndOffset(); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithSelect() { + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Id, Type"); + statementBuilder.Query = "SELECT Id, Type FROM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithFrom() { + StatementBuilder statementBuilder = new StatementBuilder() + .From("Geo_Table"); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithWhere() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("Type = City"); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithLimit() { + StatementBuilder statementBuilder = new StatementBuilder() + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithOffset() { + StatementBuilder statementBuilder = new StatementBuilder() + .Offset(100); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + } +} diff --git a/tests/Dfp/v201403/TestUtils.cs b/tests/Dfp/v201403/TestUtils.cs new file mode 100644 index 00000000000..361af279ed0 --- /dev/null +++ b/tests/Dfp/v201403/TestUtils.cs @@ -0,0 +1,351 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201403; +using Google.Api.Ads.Dfp.v201403; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; +using System.Threading; +using System.Configuration; +using System.Collections; + +namespace Google.Api.Ads.Dfp.Tests.v201403 { + /// + /// A utility class to assist the testing of v201403 services. + /// + public class TestUtils { + public User GetCurrentUser(DfpUser user) { + return GetUserByEmail(user, new DfpAppConfig().Email); + } + + public User GetTrafficker(DfpUser user) { + return GetUserByEmail(user, "dfp.api.trafficker@gmail.com"); + } + + public User GetSalesperson(DfpUser user) { + return GetUserByEmail(user, "dfp.api.salesperson@gmail.com"); + } + + public User GetUserByEmail(DfpUser user, string email) { + UserService userService = (UserService) user.GetService(DfpService.v201403.UserService); + + // Create a Statement to get all users sorted by name. + Statement statement = new Statement(); + statement.query = string.Format("where email = '{0}' LIMIT 1", email); + + UserPage page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + return page.results[0]; + } else { + return null; + } + } + + public Role GetRole(DfpUser user, string roleName) { + UserService userService = (UserService)user.GetService(DfpService.v201403.UserService); + + // Get all roles. + Role[] roles = userService.getAllRoles(); + foreach (Role role in roles) { + if (role.name == roleName) { + return role; + } + } + return null; + } + + /// + /// Create a test company for running further tests. + /// + /// A test company for running further tests. + public Company CreateCompany(DfpUser user, CompanyType companyType) { + CompanyService companyService = (CompanyService) user.GetService( + DfpService.v201403.CompanyService); + Company company = new Company(); + company.name = string.Format("Company #{0}", GetTimeStamp()); + company.type = companyType; + + return companyService.createCompanies(new Company[] {company})[0]; + } + + public Order CreateOrder(DfpUser user, long advertiserId, long salespersonId, + long traffickerId) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201403.OrderService); + + Order order = new Order(); + order.name = string.Format("Order #{0}", GetTimeStamp()); + order.advertiserId = advertiserId; + order.salespersonId = salespersonId; + order.traffickerId = traffickerId; + + return orderService.createOrders(new Order[] {order})[0]; + } + + public LineItem CreateLineItem(DfpUser user, long orderId, string adUnitId) { + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201403.LineItemService); + + long placementId = CreatePlacement(user, new string[] {adUnitId}).id; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201403.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201403.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + lineItem.unitsBought = 500000L; + lineItem.unitType = UnitType.IMPRESSIONS; + + return lineItemService.createLineItems(new LineItem[] {lineItem})[0]; + } + + /// + /// Create a test company for running further tests. + /// + /// A creative for running further tests. + public Creative CreateCreative(DfpUser user, long advertiserId) { + CreativeService creativeService = (CreativeService)user.GetService( + DfpService.v201403.CreativeService); + + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", GetTimeStamp()); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + return creativeService.createCreatives(new Creative[] {imageCreative})[0]; + } + + public LineItemCreativeAssociation CreateLica(DfpUser user, long lineItemId, long creativeId) { + LineItemCreativeAssociationService licaService = + (LineItemCreativeAssociationService)user.GetService( + DfpService.v201403.LineItemCreativeAssociationService); + + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId; + lica.lineItemId = lineItemId; + + return licaService.createLineItemCreativeAssociations( + new LineItemCreativeAssociation[] {lica})[0]; + } + + public AdUnit CreateAdUnit(DfpUser user) { + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201403.InventoryService); + + AdUnit adUnit = new AdUnit(); + adUnit.name = string.Format("Ad_Unit_{0}", GetTimeStamp()); + adUnit.parentId = FindRootAdUnit(user).id; + + // Set the size of possible creatives that can match this ad unit. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + return inventoryService.createAdUnits(new AdUnit[] {adUnit})[0]; + } + + public AdUnit FindRootAdUnit(DfpUser user) { + // Get InventoryService. + InventoryService inventoryService = + (InventoryService)user.GetService(DfpService.v201403.InventoryService); + + // Create a Statement to only select the root ad unit. + Statement statement = new Statement(); + statement.query = "WHERE parentId IS NULL LIMIT 500"; + + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + return page.results[0]; + } + + public Placement CreatePlacement(DfpUser user, string[] targetedAdUnitIds) { + // Get InventoryService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201403.PlacementService); + + Placement placement = new Placement(); + placement.name = string.Format("Test placement #{0}", this.GetTimeStamp()); + placement.description = "Test placement"; + placement.targetedAdUnitIds = targetedAdUnitIds; + + return placementService.createPlacements(new Placement[] {placement})[0]; + } + + public ReportJob CreateReport(DfpUser user) { + // Get ReportService. + ReportService reportService = + (ReportService) user.GetService(DfpService.v201403.ReportService); + + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + return reportService.runReportJob(reportJob); + } + + /// + /// Gets the current timestamp as a string. + /// + /// The current timestamp as a string. + public string GetTimeStamp() { + Thread.Sleep(500); + return (System.DateTime.UtcNow - new System.DateTime(1970, 1, 1)).Ticks. + ToString(); + } + } +} diff --git a/tests/Dfp/v201403/UserServiceTests.cs b/tests/Dfp/v201403/UserServiceTests.cs new file mode 100644 index 00000000000..df0c5ae38cc --- /dev/null +++ b/tests/Dfp/v201403/UserServiceTests.cs @@ -0,0 +1,185 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201403; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201403 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class UserServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private UserService userService; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Current user id for running tests. + /// + private long currentUserId; + + /// + /// Default public constructor. + /// + public UserServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + userService = (UserService) user.GetService(DfpService.v201403.UserService); + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + currentUserId = utils.GetCurrentUser(user).id; + } + + /// + /// Test whether we can fetch all roles. + /// + [Test] + public void TestGetAllRoles() { + Role[] roles = null; + + Assert.DoesNotThrow(delegate() { + roles = userService.getAllRoles(); + }); + Assert.NotNull(roles); + Assert.GreaterOrEqual(roles.Length, 0); + } + + /// + /// Test whether we can fetch the current user. + /// + [Test] + public void TestGetCurrentUser() { + User user = null; + + Assert.DoesNotThrow(delegate() { + user = userService.getCurrentUser(); + }); + + Assert.NotNull(user); + Assert.AreEqual(user.id, currentUserId); + } + + /// + /// Test whether we can fetch a list of existing users that match given + /// statement. + /// + [Test] + public void TestGetUsersByStatement() { + Statement statement = new Statement(); + statement.query = "ORDER BY name LIMIT 500"; + + UserPage page = null; + + Assert.DoesNotThrow(delegate() { + page = userService.getUsersByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + + List salesPersonIds = new List(); + List traffickerIds = new List(); + + foreach(User tempUser in page.results) { + if (tempUser.roleName == "Salesperson") { + salesPersonIds.Add(tempUser.id); + } else if (tempUser.roleName == "Trafficker") { + traffickerIds.Add(tempUser.id); + } + } + Assert.Contains(salespersonId, salesPersonIds); + Assert.Contains(traffickerId, traffickerIds); + } + + /// + /// Test whether we can deactivate and activate a user. + /// + [Test] + public void TestPerformUserAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = {0}", salespersonId); + + DeactivateUsers action = new DeactivateUsers(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = userService.performUserAction(action, statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + + // Activate the user again. + + Assert.DoesNotThrow(delegate() { + result = userService.performUserAction(new ActivateUsers(), statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update a list of users. + /// + [Test] + public void TestUpdateUsers() { + Statement statement = new Statement(); + statement.query = String.Format("WHERE id = {0} LIMIT 1", salespersonId); + User user = userService.getUsersByStatement(statement).results[0]; + user.preferredLocale = (user.preferredLocale == "fr_FR")? "en_US" : "fr_FR"; + + User[] newUsers = null; + + Assert.DoesNotThrow(delegate() { + newUsers = userService.updateUsers(new User[] {user}); + }); + + Assert.NotNull(newUsers); + Assert.AreEqual(newUsers.Length, 1); + Assert.AreEqual(newUsers[0].id, user.id); + Assert.AreEqual(newUsers[0].preferredLocale, user.preferredLocale); + } + } +} diff --git a/tests/Dfp/v201405/CompanyServiceTests.cs b/tests/Dfp/v201405/CompanyServiceTests.cs new file mode 100644 index 00000000000..69e51c0e81b --- /dev/null +++ b/tests/Dfp/v201405/CompanyServiceTests.cs @@ -0,0 +1,139 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201405 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class CompanyServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private CompanyService companyService; + + /// + /// The company to be used for further tests. + /// + private Company testCompany1 = null; + + /// + /// The company to be used for further tests. + /// + private Company testCompany2 = null; + + /// + /// Default public constructor. + /// + public CompanyServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + companyService = (CompanyService) user.GetService(DfpService.v201405.CompanyService); + testCompany1 = utils.CreateCompany(user, CompanyType.ADVERTISER); + testCompany2 = utils.CreateCompany(user, CompanyType.ADVERTISER); + } + + /// + /// Test whether we can create a list of companies. + /// + [Test] + public void TestCreateCompanies() { + Company company1 = new Company(); + company1.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company1.type = CompanyType.ADVERTISER; + + Company company2 = new Company(); + company2.name = string.Format("Company #{0}", new TestUtils().GetTimeStamp()); + company2.type = CompanyType.ADVERTISER; + + Company[] newCompanies = null; + Assert.DoesNotThrow(delegate() { + newCompanies = companyService.createCompanies(new Company[] {company1, company2}); + }); + + Assert.NotNull(newCompanies); + Assert.AreEqual(newCompanies.Length, 2); + + Assert.AreEqual(company1.name, newCompanies[0].name); + Assert.AreEqual(company1.type, newCompanies[0].type); + Assert.AreEqual(company2.name, newCompanies[1].name); + Assert.AreEqual(company2.type, newCompanies[1].type); + } + + /// + /// Test whether we can fetch a list of existing companies that match given + /// statement. + /// + [Test] + public void TestGetCompaniesByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = {0} ORDER BY name LIMIT 1", testCompany1.id); + CompanyPage page = null; + + Assert.DoesNotThrow(delegate() { + page = companyService.getCompaniesByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.results.Length, 1); + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].id, testCompany1.id); + Assert.AreEqual(page.results[0].name, testCompany1.name); + } + + /// + /// Test whether we can update a list of companies. + /// + [Test] + public void TestUpdateCompanies() { + testCompany1.name = "Corp " + testCompany1.name; + testCompany2.name = "Corp " + testCompany2.name; + + Company[] newCompanies = null; + + Assert.DoesNotThrow(delegate() { + newCompanies = companyService.updateCompanies(new Company[] {testCompany1, testCompany2}); + }); + + Assert.NotNull(newCompanies); + Assert.AreEqual(newCompanies.Length, 2); + + Assert.AreEqual(testCompany1.name, newCompanies[0].name); + Assert.AreEqual(testCompany1.type, newCompanies[0].type); + Assert.AreEqual(testCompany2.name, newCompanies[1].name); + Assert.AreEqual(testCompany2.type, newCompanies[1].type); + } + } +} diff --git a/tests/Dfp/v201405/CreativeServiceTests.cs b/tests/Dfp/v201405/CreativeServiceTests.cs new file mode 100644 index 00000000000..0fe62dd3130 --- /dev/null +++ b/tests/Dfp/v201405/CreativeServiceTests.cs @@ -0,0 +1,190 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201405 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class CreativeServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private CreativeService creativeService; + + /// + /// The advertiser company id to be used for running tests. + /// + private long advertiserId = 0; + + /// + /// The creative 1 to be used for running tests. + /// + private Creative creative1 = null; + + /// + /// The creative 2 to be used for running tests. + /// + private Creative creative2 = null; + + /// + /// Default public constructor. + /// + public CreativeServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + creativeService = (CreativeService)user.GetService(DfpService.v201405.CreativeService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + creative1 = utils.CreateCreative(user, advertiserId); + creative2 = utils.CreateCreative(user, advertiserId); + } + + /// + /// Test whether we can create a list of creatives. + /// + [Test] + public void TestCreateCreatives() { + // Create an array to store local image creative objects. + Creative[] imageCreatives = new ImageCreative[2]; + + for (int i = 0; i < 2; i++) { + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", i); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + imageCreatives[i] = imageCreative; + } + + Creative[] newCreatives = null; + + Assert.DoesNotThrow(delegate() { + newCreatives = creativeService.createCreatives(imageCreatives); + }); + + Assert.NotNull(newCreatives); + Assert.AreEqual(newCreatives.Length, 2); + Assert.NotNull(newCreatives[0]); + Assert.That(newCreatives[0] is ImageCreative); + Assert.AreEqual(newCreatives[0].advertiserId, advertiserId); + Assert.AreEqual(newCreatives[0].name, "Image creative #0"); + Assert.NotNull(newCreatives[1]); + Assert.That(newCreatives[1] is ImageCreative); + Assert.AreEqual(newCreatives[1].advertiserId, advertiserId); + Assert.AreEqual(newCreatives[1].name, "Image creative #1"); + } + + /// + /// Test whether we can fetch a list of existing creatives that match given + /// statement. + /// + [Test] + public void TestGetCreativesByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 500", creative1.id); + + CreativePage page = null; + + Assert.DoesNotThrow(delegate() { + page = creativeService.getCreativesByStatement(statement); + }); + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].id, creative1.id); + Assert.AreEqual(page.results[0].GetType(), creative1.GetType()); + Assert.AreEqual(page.results[0].name, creative1.name); + Assert.AreEqual(page.results[0].advertiserId, creative1.advertiserId); + Assert.AreEqual(page.results[0].previewUrl, creative1.previewUrl); + Assert.AreEqual(page.results[0].size.height, creative1.size.height); + Assert.AreEqual(page.results[0].size.width, creative1.size.width); + } + + /// + /// Test whether we can update a list of creatives. + /// + [Test] + public void TestUpdateCreatives() { + ImageCreative imageCreative1 = (ImageCreative) creative1; + imageCreative1.destinationUrl = "http://news.google.com"; + + ImageCreative imageCreative2 = (ImageCreative) creative2; + imageCreative2.destinationUrl = "http://finance.google.com"; + + Creative[] newCreatives = null; + + Assert.DoesNotThrow(delegate() { + newCreatives = creativeService.updateCreatives(new Creative[] {creative1, creative2}); + }); + + Assert.NotNull(newCreatives); + Assert.AreEqual(newCreatives.Length, 2); + + Assert.AreEqual(newCreatives[0].id, creative1.id); + Assert.AreEqual(newCreatives[0].name, creative1.name); + Assert.AreEqual(newCreatives[0].advertiserId, creative1.advertiserId); + Assert.AreEqual(newCreatives[0].size.height, creative1.size.height); + Assert.AreEqual(newCreatives[0].size.width, creative1.size.width); + Assert.That(newCreatives[0] is ImageCreative); + Assert.AreEqual((newCreatives[0] as ImageCreative).destinationUrl, + imageCreative1.destinationUrl); + + Assert.AreEqual(newCreatives[1].id, creative2.id); + Assert.AreEqual(newCreatives[1].name, creative2.name); + Assert.AreEqual(newCreatives[1].advertiserId, creative2.advertiserId); + Assert.AreEqual(newCreatives[1].size.height, creative2.size.height); + Assert.AreEqual(newCreatives[1].size.width, creative2.size.width); + Assert.That(newCreatives[1] is ImageCreative); + Assert.AreEqual((newCreatives[1] as ImageCreative).destinationUrl, + imageCreative2.destinationUrl); + } + } +} diff --git a/tests/Dfp/v201405/ForecastServiceTests.cs b/tests/Dfp/v201405/ForecastServiceTests.cs new file mode 100644 index 00000000000..35837972f2a --- /dev/null +++ b/tests/Dfp/v201405/ForecastServiceTests.cs @@ -0,0 +1,173 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201405 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class ForecastServiceTests : BaseTests { + /// + /// ForecastService object to be used in this test. + /// + private ForecastService forecastService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Placement id for running tests. + /// + private long placementId; + + /// + /// Line item id for running tests. + /// + private long lineItemId; + + /// + /// Default public constructor. + /// + public ForecastServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + forecastService = (ForecastService)user.GetService(DfpService.v201405.ForecastService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + placementId = utils.CreatePlacement(user, new string[] {adUnitId}).id; + lineItemId = utils.CreateLineItem(user, orderId, adUnitId).id; + } + + /// + /// Test whether we can get a forecast for given line item. + /// + [Test] + public void TestGetForecast() { + TestUtils utils = new TestUtils(); + + LineItem lineItem = new LineItem(); + lineItem.name = string.Format("Line item #{0}", utils.GetTimeStamp()); + + lineItem.orderId = orderId; + + lineItem.targeting = new Targeting(); + lineItem.targeting.inventoryTargeting = new InventoryTargeting(); + lineItem.targeting.inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + Size size1 = new Size(); + size1.width = 300; + size1.height = 250; + + Size size2 = new Size(); + size2.width = 120; + size2.height = 600; + + // Create the creative placeholders. + CreativePlaceholder creativePlaceholder1 = new CreativePlaceholder(); + creativePlaceholder1.size = size1; + + CreativePlaceholder creativePlaceholder2 = new CreativePlaceholder(); + creativePlaceholder1.size = size2; + + lineItem.creativePlaceholders = + new CreativePlaceholder[] {creativePlaceholder1, creativePlaceholder2}; + + lineItem.lineItemType = LineItemType.STANDARD; + + // Set start date time and end date time. + lineItem.startDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddDays(1)); + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000; + + lineItem.creativeRotationType = CreativeRotationType.EVEN; + lineItem.discountType = LineItemDiscountType.PERCENTAGE; + + Goal goal = new Goal(); + goal.units = 500000; + goal.unitType = UnitType.IMPRESSIONS; + lineItem.primaryGoal = goal; + + Forecast forecast = null; + Assert.DoesNotThrow(delegate() { + forecast = forecastService.getForecast(lineItem); + }); + Assert.NotNull(forecast); + Assert.AreEqual(forecast.orderId, orderId); + Assert.AreEqual(forecast.unitType, lineItem.primaryGoal.unitType); + } + + /// + /// Test whether we can get a forecast for existing line item. + /// + [Test] + public void TestGetForecastById() { + Forecast forecast = null; + Assert.DoesNotThrow(delegate() { + forecast = forecastService.getForecastById(lineItemId); + }); + Assert.NotNull(forecast); + Assert.AreEqual(forecast.orderId, orderId); + } + } +} diff --git a/tests/Dfp/v201405/InventoryServiceTests.cs b/tests/Dfp/v201405/InventoryServiceTests.cs new file mode 100644 index 00000000000..cfe2102b626 --- /dev/null +++ b/tests/Dfp/v201405/InventoryServiceTests.cs @@ -0,0 +1,227 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201405 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class InventoryServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private InventoryService inventoryService; + + /// + /// The ad unit 1 for running tests. + /// + private AdUnit adUnit1; + + /// + /// The ad unit 2 for running tests. + /// + private AdUnit adUnit2; + + /// + /// Default public constructor. + /// + public InventoryServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + inventoryService = (InventoryService) user.GetService(DfpService.v201405.InventoryService); + adUnit1 = utils.CreateAdUnit(user); + adUnit2 = utils.CreateAdUnit(user); + } + + /// + /// Test whether we can create a list of ad units. + /// + [Test] + public void TestCreateAdUnits() { + // Create ad unit 1. + AdUnit localAdUnit1 = new AdUnit(); + localAdUnit1.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit1.parentId = adUnit1.id; + + Size size1 = new Size(); + size1.width = 300; + size1.height = 250; + + AdUnitSize adUnitSize1 = new AdUnitSize(); + adUnitSize1.size = size1; + adUnitSize1.environmentType = EnvironmentType.BROWSER; + + localAdUnit1.adUnitSizes = new AdUnitSize[] {adUnitSize1}; + + // Create ad unit 2. + AdUnit localAdUnit2 = new AdUnit(); + localAdUnit2.name = string.Format("Ad_Unit_{0}", new TestUtils().GetTimeStamp()); + localAdUnit2.parentId = adUnit1.id; + + Size size2 = new Size(); + size2.width = 300; + size2.height = 250; + + AdUnitSize adUnitSize2 = new AdUnitSize(); + adUnitSize2.size = size2; + adUnitSize2.environmentType = EnvironmentType.BROWSER; + + localAdUnit2.adUnitSizes = new AdUnitSize[] {adUnitSize2}; + + AdUnit[] newAdUnits = null; + + Assert.DoesNotThrow(delegate() { + newAdUnits = inventoryService.createAdUnits(new AdUnit[] {localAdUnit1, localAdUnit2}); + }); + + Assert.NotNull(newAdUnits); + Assert.AreEqual(newAdUnits.Length, 2); + + Assert.AreEqual(newAdUnits[0].name, localAdUnit1.name); + Assert.AreEqual(newAdUnits[0].parentId, localAdUnit1.parentId); + Assert.AreEqual(newAdUnits[0].parentId, adUnit1.id); + Assert.AreEqual(newAdUnits[0].status, localAdUnit1.status); + Assert.AreEqual(newAdUnits[0].targetWindow, localAdUnit1.targetWindow); + + Assert.AreEqual(newAdUnits[1].name, localAdUnit2.name); + Assert.AreEqual(newAdUnits[1].parentId, localAdUnit2.parentId); + Assert.AreEqual(newAdUnits[1].parentId, adUnit1.id); + Assert.AreEqual(newAdUnits[1].status, localAdUnit2.status); + Assert.AreEqual(newAdUnits[1].targetWindow, localAdUnit2.targetWindow); + } + + /// + /// Test whether we can fetch a list of existing ad units that match given + /// statement. + /// + [Test] + public void TestGetAdUnitsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", adUnit1.id); + + AdUnitPage page = null; + + Assert.DoesNotThrow(delegate() { + page = inventoryService.getAdUnitsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results[0]); + + Assert.AreEqual(page.results[0].name, adUnit1.name); + Assert.AreEqual(page.results[0].parentId, adUnit1.parentId); + Assert.AreEqual(page.results[0].id, adUnit1.id); + Assert.AreEqual(page.results[0].status, adUnit1.status); + Assert.AreEqual(page.results[0].targetWindow, adUnit1.targetWindow); + } + + /// + /// Test whether we can deactivate an ad unit. + /// + [Test] + public void TestPerformAdUnitAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", adUnit1.id); + + UpdateResult result = null; + Assert.DoesNotThrow(delegate() { + result = inventoryService.performAdUnitAction(new DeactivateAdUnits(), statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update a list of an ad units. + /// + [Test] + public void TestUpdateAdUnits() { + List adUnitSizes = null; + Size size = null; + + // Modify ad unit 1. + adUnitSizes = new List(adUnit1.adUnitSizes); + size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit1.adUnitSizes = adUnitSizes.ToArray(); + + // Modify ad unit 2. + adUnitSizes = new List(adUnit2.adUnitSizes); + size = new Size(); + size.width = 728; + size.height = 90; + + // Create ad unit size. + adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnitSizes.Add(adUnitSize); + adUnit2.adUnitSizes = adUnitSizes.ToArray(); + + AdUnit[] newAdUnits = null; + Assert.DoesNotThrow(delegate() { + newAdUnits = inventoryService.updateAdUnits(new AdUnit[] {adUnit1, adUnit2}); + }); + + Assert.NotNull(newAdUnits); + Assert.AreEqual(newAdUnits.Length, 2); + + Assert.AreEqual(newAdUnits[0].name, adUnit1.name); + Assert.AreEqual(newAdUnits[0].parentId, adUnit1.parentId); + Assert.AreEqual(newAdUnits[0].id, adUnit1.id); + Assert.AreEqual(newAdUnits[0].status, adUnit1.status); + Assert.AreEqual(newAdUnits[0].targetWindow, adUnit1.targetWindow); + Assert.AreEqual(newAdUnits[0].adUnitSizes.Length, adUnit1.adUnitSizes.Length); + + Assert.AreEqual(newAdUnits[1].name, adUnit2.name); + Assert.AreEqual(newAdUnits[1].parentId, adUnit2.parentId); + Assert.AreEqual(newAdUnits[1].id, adUnit2.id); + Assert.AreEqual(newAdUnits[1].status, adUnit2.status); + Assert.AreEqual(newAdUnits[1].targetWindow, adUnit2.targetWindow); + Assert.AreEqual(newAdUnits[1].adUnitSizes.Length, adUnit2.adUnitSizes.Length); + } + } +} diff --git a/tests/Dfp/v201405/LineItemCreativeAssociationServiceTests.cs b/tests/Dfp/v201405/LineItemCreativeAssociationServiceTests.cs new file mode 100644 index 00000000000..f04a80e584b --- /dev/null +++ b/tests/Dfp/v201405/LineItemCreativeAssociationServiceTests.cs @@ -0,0 +1,249 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201405 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class LineItemCreativeAssociationServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private LineItemCreativeAssociationService licaService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Creative id 1 for running tests. + /// + private long creativeId1; + + /// + /// Creative id 2 for running tests. + /// + private long creativeId2; + + /// + /// Creative id 3 for running tests. + /// + private long creativeId3; + + /// + /// Creative id 4 for running tests. + /// + private long creativeId4; + + /// + /// Line item id 1 for running tests. + /// + private long lineItemId1; + + /// + /// Line item id 2 for running tests. + /// + private long lineItemId2; + + /// + /// Line item id 3 for running tests. + /// + private long lineItemId3; + + /// + /// Line item id 4 for running tests. + /// + private long lineItemId4; + + /// + /// Line item creative association 1 for running tests. + /// + private LineItemCreativeAssociation lica1; + + /// + /// Line item creative association 2 for running tests. + /// + private LineItemCreativeAssociation lica2; + + /// + /// Default public constructor. + /// + public LineItemCreativeAssociationServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + licaService = (LineItemCreativeAssociationService) user.GetService( + DfpService.v201405.LineItemCreativeAssociationService); + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + + lineItemId1 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId2 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId3 = utils.CreateLineItem(user, orderId, adUnitId).id; + lineItemId4 = utils.CreateLineItem(user, orderId, adUnitId).id; + + creativeId1 = utils.CreateCreative(user, advertiserId).id; + creativeId2 = utils.CreateCreative(user, advertiserId).id; + creativeId3 = utils.CreateCreative(user, advertiserId).id; + creativeId4 = utils.CreateCreative(user, advertiserId).id; + + lica1 = utils.CreateLica(user, lineItemId3, creativeId3); + lica2 = utils.CreateLica(user, lineItemId4, creativeId4); + } + + /// + /// Test whether we can create a list of line item creative associations. + /// + [Test] + public void TestCreateLineItemCreativeAssociations() { + LineItemCreativeAssociation localLica1 = new LineItemCreativeAssociation(); + localLica1.creativeId = creativeId1; + localLica1.lineItemId = lineItemId1; + + LineItemCreativeAssociation localLica2 = new LineItemCreativeAssociation(); + localLica2.creativeId = creativeId2; + localLica2.lineItemId = lineItemId2; + + LineItemCreativeAssociation[] newLicas = null; + + Assert.DoesNotThrow(delegate() { + newLicas = licaService.createLineItemCreativeAssociations( + new LineItemCreativeAssociation[] {localLica1, localLica2}); + }); + + Assert.NotNull(newLicas); + Assert.AreEqual(newLicas.Length, 2); + + Assert.NotNull(newLicas[0]); + Assert.AreEqual(newLicas[0].creativeId, localLica1.creativeId); + Assert.AreEqual(newLicas[0].lineItemId, localLica1.lineItemId); + + Assert.NotNull(newLicas[1]); + Assert.AreEqual(newLicas[1].creativeId, localLica2.creativeId); + Assert.AreEqual(newLicas[1].lineItemId, localLica2.lineItemId); + } + + /// + /// Test whether we can fetch a list of existing line item creative + /// associations that match given statement. + /// + [Test] + public void TestGetLineItemCreativeAssociationsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE lineItemId = '{0}' LIMIT 500", lineItemId3); + + LineItemCreativeAssociationPage page = null; + Assert.DoesNotThrow(delegate() { + page = licaService.getLineItemCreativeAssociationsByStatement(statement); + }); + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.totalResultSetSize, 1); + + Assert.NotNull(page.results[0]); + Assert.AreEqual(page.results[0].creativeId, lica1.creativeId); + Assert.AreEqual(page.results[0].lineItemId, lica1.lineItemId); + } + + /// + /// Test whether we can deactivate a line item create association. + /// + [Test] + public void TestPerformLineItemCreativeAssociationAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE lineItemId = '{0}' LIMIT 1", lineItemId3); + + DeactivateLineItemCreativeAssociations action = new DeactivateLineItemCreativeAssociations(); + + UpdateResult result = null; + Assert.DoesNotThrow(delegate() { + result = licaService.performLineItemCreativeAssociationAction(action, statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update a list of line item creative associations. + /// + [Test] + public void TestUpdateLineItemCreativeAssociations() { + lica1.destinationUrl = "http://news.google.com"; + lica2.destinationUrl = "http://news.google.com"; + + LineItemCreativeAssociation[] newLicas = null; + Assert.DoesNotThrow(delegate() { + newLicas = licaService.updateLineItemCreativeAssociations( + new LineItemCreativeAssociation[] {lica1, lica2}); + }); + + Assert.NotNull(newLicas); + Assert.AreEqual(newLicas.Length, 2); + + Assert.NotNull(newLicas[0]); + Assert.AreEqual(newLicas[0].creativeId, lica1.creativeId); + Assert.AreEqual(newLicas[0].lineItemId, lica1.lineItemId); + + Assert.NotNull(newLicas[1]); + Assert.AreEqual(newLicas[1].creativeId, lica2.creativeId); + Assert.AreEqual(newLicas[1].lineItemId, lica2.lineItemId); + } + } +} diff --git a/tests/Dfp/v201405/LineItemServiceTests.cs b/tests/Dfp/v201405/LineItemServiceTests.cs new file mode 100644 index 00000000000..7be676cfa40 --- /dev/null +++ b/tests/Dfp/v201405/LineItemServiceTests.cs @@ -0,0 +1,320 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201405 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class LineItemServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private LineItemService lineItemService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Ad unit id for running tests. + /// + private string adUnitId; + + /// + /// Placement id for running tests. + /// + private long placementId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Line item 1 for running tests. + /// + private LineItem lineItem1; + + /// + /// Line item 2 for running tests. + /// + private LineItem lineItem2; + + /// + /// Default public constructor. + /// + public LineItemServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + lineItemService = (LineItemService)user.GetService(DfpService.v201405.LineItemService); + + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + adUnitId = utils.CreateAdUnit(user).id; + placementId = utils.CreatePlacement(user, new string[] {adUnitId}).id; + lineItem1 = utils.CreateLineItem(user, orderId, adUnitId); + lineItem2 = utils.CreateLineItem(user, orderId, adUnitId); + } + + /// + /// Test whether we can create a list of line items. + /// + [Test] + public void TestCreateLineItems() { + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201405.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201405.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + // Create an array to store local line item objects. + LineItem[] lineItems = new LineItem[2]; + + for (int i = 0; i < lineItems.Length; i++) { + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + Goal goal = new Goal(); + goal.units = 500000L; + goal.unitType = UnitType.IMPRESSIONS; + lineItem.primaryGoal = goal; + + lineItems[i] = lineItem; + } + + LineItem[] localLineItems = null; + + Assert.DoesNotThrow(delegate() { + localLineItems = lineItemService.createLineItems(lineItems); + }); + + Assert.NotNull(localLineItems); + Assert.AreEqual(localLineItems.Length, 2); + + Assert.AreEqual(localLineItems[0].name, lineItems[0].name); + Assert.AreEqual(localLineItems[0].orderId, lineItems[0].orderId); + + Assert.AreEqual(localLineItems[1].name, lineItems[1].name); + Assert.AreEqual(localLineItems[1].orderId, lineItems[1].orderId); + } + + /// + /// Test whether we can fetch a list of existing line items that match given + /// statement. + /// + [Test] + public void TestGetLineItemsByStatement() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}' LIMIT 1", lineItem1.id); + + LineItemPage page = null; + + Assert.DoesNotThrow(delegate() { + page = lineItemService.getLineItemsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.AreEqual(page.totalResultSetSize, 1); + Assert.NotNull(page.results); + Assert.AreEqual(page.results[0].id, lineItem1.id); + Assert.AreEqual(page.results[0].name, lineItem1.name); + Assert.AreEqual(page.results[0].orderId, lineItem1.orderId); + } + + /// + /// Test whether we can activate a line item. + /// + [Test] + public void TestPerformLineItemAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE orderId = '{0}' and status = '{1}'", + orderId, ComputedStatus.NEEDS_CREATIVES); + + ActivateLineItems action = new ActivateLineItems(); + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = lineItemService.performLineItemAction(action, statement); + }); + + Assert.NotNull(result); + } + + /// + /// Test whether we can update a list of line items. + /// + [Test] + public void TestUpdateLineItems() { + lineItem1.costPerUnit.microAmount = 3500000; + lineItem2.costPerUnit.microAmount = 3500000; + + LineItem[] localLineItems = null; + + Assert.DoesNotThrow(delegate() { + localLineItems = lineItemService.updateLineItems(new LineItem[] {lineItem1, lineItem2}); + }); + + Assert.NotNull(localLineItems); + Assert.AreEqual(localLineItems.Length, 2); + + Assert.AreEqual(localLineItems[0].id, lineItem1.id); + Assert.AreEqual(localLineItems[0].name, lineItem1.name); + Assert.AreEqual(localLineItems[0].orderId, lineItem1.orderId); + Assert.AreEqual(localLineItems[0].costPerUnit.microAmount, lineItem1.costPerUnit.microAmount); + + Assert.AreEqual(localLineItems[1].id, lineItem2.id); + Assert.AreEqual(localLineItems[1].name, lineItem2.name); + Assert.AreEqual(localLineItems[1].orderId, lineItem2.orderId); + Assert.AreEqual(localLineItems[1].costPerUnit.microAmount, lineItem2.costPerUnit.microAmount); + } + } +} diff --git a/tests/Dfp/v201405/OrderServiceTests.cs b/tests/Dfp/v201405/OrderServiceTests.cs new file mode 100644 index 00000000000..dfabe28cc1a --- /dev/null +++ b/tests/Dfp/v201405/OrderServiceTests.cs @@ -0,0 +1,172 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; +using System.Xml.Serialization; + +namespace Google.Api.Ads.Dfp.Tests.v201405 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class OrderServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private OrderService orderService; + + /// + /// Advertiser company id for running tests. + /// + private long advertiserId; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Order id for running tests. + /// + private long orderId; + + /// + /// Default public constructor. + /// + public OrderServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + orderService = (OrderService) user.GetService(DfpService.v201405.OrderService); + + advertiserId = utils.CreateCompany(user, CompanyType.ADVERTISER).id; + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + + orderId = utils.CreateOrder(user, advertiserId, salespersonId, traffickerId).id; + } + + /// + /// Test whether we can create a list of orders. + /// + [Test] + public void TestCreateOrders() { + Order order1 = new Order(); + order1.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order1.advertiserId = advertiserId; + order1.traffickerId = traffickerId; + order1.currencyCode = "USD"; + + Order order2 = new Order(); + order2.name = string.Format("Order #{0}", new TestUtils().GetTimeStamp()); + order2.advertiserId = advertiserId; + order2.traffickerId = traffickerId; + order2.currencyCode = "USD"; + + Order[] newOrders = null; + + Assert.DoesNotThrow(delegate() { + newOrders = orderService.createOrders(new Order[] {order1, order2}); + }); + + Statement statement = new Statement(); + statement.query = string.Format("WHERE advertiserId = '{0}' LIMIT 500", advertiserId); + + OrderPage page = orderService.getOrdersByStatement(statement); + Assert.NotNull(newOrders); + Assert.AreEqual(newOrders.Length, 2); + + Assert.AreEqual(order1.name, newOrders[0].name); + Assert.AreEqual(order1.advertiserId, newOrders[0].advertiserId); + Assert.AreEqual(order1.traffickerId, newOrders[0].traffickerId); + Assert.AreEqual(order1.currencyCode, newOrders[0].currencyCode); + + Assert.AreEqual(order2.name, newOrders[1].name); + Assert.AreEqual(order2.advertiserId, newOrders[1].advertiserId); + Assert.AreEqual(order2.traffickerId, newOrders[1].traffickerId); + Assert.AreEqual(order2.currencyCode, newOrders[1].currencyCode); + } + + /// + /// Test whether we can perform an order action. + /// + [Test] + public void TestPerformOrderAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE status IN ('{0}', '{1}')", + OrderStatus.DRAFT, OrderStatus.PENDING_APPROVAL); + + ApproveOrders action = new ApproveOrders(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = orderService.performOrderAction(action, statement); + }); + + Assert.NotNull(result); + Assert.GreaterOrEqual(result.numChanges, 0); + } + + /// + /// Test whether we can update a list of orders. + /// + [Test] + public void TestUpdateOrders() { + Statement statement = new Statement(); + statement.query = String.Format("WHERE id = {0} LIMIT 1", orderId); + Order order = orderService.getOrdersByStatement(statement).results[0]; + order.notes = "Spoke to advertiser. All is well."; + + Order[] newOrders = null; + + Assert.DoesNotThrow(delegate() { + newOrders = orderService.updateOrders(new Order[] {order}); + }); + + Assert.NotNull(newOrders); + Assert.AreEqual(newOrders.Length, 1); + + Assert.AreEqual(order.id, newOrders[0].id); + Assert.AreEqual(order.name, newOrders[0].name); + Assert.AreEqual(order.notes, newOrders[0].notes); + Assert.AreEqual(order.advertiserId, newOrders[0].advertiserId); + Assert.AreEqual(order.traffickerId, newOrders[0].traffickerId); + Assert.AreEqual(order.currencyCode, newOrders[0].currencyCode); + } + } + + +} diff --git a/tests/Dfp/v201405/PlacementServiceTests.cs b/tests/Dfp/v201405/PlacementServiceTests.cs new file mode 100644 index 00000000000..19fa3450f3e --- /dev/null +++ b/tests/Dfp/v201405/PlacementServiceTests.cs @@ -0,0 +1,180 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201405 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class PlacementServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private PlacementService placementService; + + /// + /// The ad unit 1 for running tests. + /// + private AdUnit adUnit1; + + /// + /// The ad unit 2 for running tests. + /// + private AdUnit adUnit2; + + /// + /// The placement for running tests. + /// + private Placement placement; + + /// + /// Default public constructor. + /// + public PlacementServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + placementService = (PlacementService) user.GetService(DfpService.v201405.PlacementService); + adUnit1 = utils.CreateAdUnit(user); + adUnit2 = utils.CreateAdUnit(user); + placement = utils.CreatePlacement(user, new string[] {adUnit1.id, adUnit2.id}); + } + + /// + /// Test whether we can create a list of placements items. + /// + [Test] + public void TestCreatePlacements() { + TestUtils utils = new TestUtils(); + Placement placement1 = new Placement(); + placement1.name = string.Format("Medium Square AdUnit Placement #{0}", utils.GetTimeStamp()); + placement1.description = "Contains ad units that can hold creatives of size 300x250"; + placement1.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement placement2 = new Placement(); + placement2.name = string.Format("Medium Square AdUnit Placement #{0}", utils.GetTimeStamp()); + placement2.description = "Contains ad units that can hold creatives of size 300x250"; + placement2.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id}; + + Placement[] newPlacements = null; + + Assert.DoesNotThrow(delegate() { + newPlacements = placementService.createPlacements(new Placement[] {placement1, placement2}); + }); + + Assert.NotNull(newPlacements); + Assert.AreEqual(newPlacements.Length, 2); + + Assert.NotNull(newPlacements[0]); + Assert.AreEqual(newPlacements[0].name, placement1.name); + Assert.AreEqual(newPlacements[0].description, placement1.description); + Assert.Contains(adUnit1.id, newPlacements[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[0].targetedAdUnitIds); + + Assert.NotNull(newPlacements[1]); + Assert.AreEqual(newPlacements[1].name, placement2.name); + Assert.AreEqual(newPlacements[1].description, placement2.description); + Assert.Contains(adUnit1.id, newPlacements[1].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[1].targetedAdUnitIds); + } + + /// + /// Test whether we can fetch a list of existing placements that match given + /// statement. + /// + [Test] + public void TestGetPlacementsByStatement() { + // Create a Statement to only select active placements. + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = '{0}'", placement.id); + + PlacementPage page = null; + + Assert.DoesNotThrow(delegate() { + page = placementService.getPlacementsByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + Assert.AreEqual(page.results.Length, 1); + + Assert.AreEqual(page.results[0].id, placement.id); + Assert.AreEqual(page.results[0].name, placement.name); + Assert.AreEqual(page.results[0].description, placement.description); + Assert.Contains(adUnit1.id, page.results[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, page.results[0].targetedAdUnitIds); + } + + /// + /// Test whether we can deactivate a placement. + /// + [Test] + public void TestPerformPlacementAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE status = '{0}'", InventoryStatus.ACTIVE); + + DeactivatePlacements action = new DeactivatePlacements(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = placementService.performPlacementAction(action, statement); + }); + + Assert.NotNull(result); + Assert.GreaterOrEqual(result.numChanges, 0); + } + + /// + /// Test whether we can update a list of placements. + /// + [Test] + public void TestUpdatePlacements() { + placement.description += "More description"; + + Placement[] newPlacements = null; + + Assert.DoesNotThrow(delegate() { + newPlacements = placementService.updatePlacements(new Placement[] {placement}); + }); + + Assert.NotNull(newPlacements); + Assert.AreEqual(newPlacements.Length, 1); + + Assert.NotNull(newPlacements[0]); + Assert.AreEqual(newPlacements[0].name, placement.name); + Assert.AreEqual(newPlacements[0].description, placement.description); + Assert.Contains(adUnit1.id, newPlacements[0].targetedAdUnitIds); + Assert.Contains(adUnit2.id, newPlacements[0].targetedAdUnitIds); + } + } +} diff --git a/tests/Dfp/v201405/ReportServiceTests.cs b/tests/Dfp/v201405/ReportServiceTests.cs new file mode 100644 index 00000000000..f087b5ad39d --- /dev/null +++ b/tests/Dfp/v201405/ReportServiceTests.cs @@ -0,0 +1,161 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + +namespace Google.Api.Ads.Dfp.Tests.v201405 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class ReportServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private ReportService reportService; + + /// + /// Report id for running further tests. + /// + long reportId; + + /// + /// Default public constructor. + /// + public ReportServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + reportService = (ReportService) user.GetService(DfpService.v201405.ReportService); + reportId = utils.CreateReport(user).id; + } + + /// + /// Test whether we can run a delivery report. + /// + [Test] + public void TestRunDeliveryReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can run an inventory report. + /// + [Test] + public void TestRunInventoryReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.DATE}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS, + Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS, + Column.TOTAL_INVENTORY_LEVEL_IMPRESSIONS, + Column.TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_WEEK; + + ReportJob newReportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can run a sales report. + /// + [Test] + public void TestRunSalesReport() { + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.SALESPERSON_ID, + Dimension.SALESPERSON_NAME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CPM_AND_CPC_REVENUE, Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + ReportJob newReportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.runReportJob(reportJob); + }); + + Assert.NotNull(reportJob); + } + + /// + /// Test whether we can retrieve existing report job. + /// + [Test] + public void TestGetReportJob() { + ReportJob reportJob = null; + + Assert.DoesNotThrow(delegate() { + reportJob = reportService.getReportJob(reportId); + }); + + Assert.NotNull(reportJob); + Assert.AreEqual(reportJob.id, reportId); + } + + /// + /// Test whether we can retrieve report download URL. + /// + [Test] + public void TestGetReportDownloadUrl() { + string url = null; + + Assert.DoesNotThrow(delegate() { + url = reportService.getReportDownloadURL(reportId, ExportFormat.CSV_EXCEL); + }); + + Assert.True(Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)); + + Assert.DoesNotThrow(delegate() { + url = reportService.getReportDownloadURL(reportId, ExportFormat.TSV); + }); + + Assert.True(Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)); + } + } +} diff --git a/tests/Dfp/v201405/StatementBuilderTests.cs b/tests/Dfp/v201405/StatementBuilderTests.cs new file mode 100644 index 00000000000..4ab797620a6 --- /dev/null +++ b/tests/Dfp/v201405/StatementBuilderTests.cs @@ -0,0 +1,299 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: christopherseeley@gmail.com (Christopher Seeley) + +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using System.Xml; +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; +using NUnit.Framework; +using DateTime = Google.Api.Ads.Dfp.v201405.DateTime; + +namespace Google.Api.Ads.Dfp.Tests.v201405 { + + /// + /// UnitTests for class. + /// + [TestFixture] + public class StatementBuilderTests { + + private static bool StatementsAreEqual(Statement s1, Statement s2) { + // Assumes both Statements are non-null and have non-null properties + if (String.Compare(s1.query, s2.query, true) != 0) { + return false; + } + if (s1.values.Length != s2.values.Length) { + return false; + } + // Assumes Statement values are in the same order + for (int i = 0; i < s1.values.Length; i++) { + if (!StringValueMapEntriesAreEqual(s1.values[i], s2.values[i])) { + return false; + } + } + return true; + } + + private static bool StringValueMapEntriesAreEqual(String_ValueMapEntry entry1, + String_ValueMapEntry entry2) { + return String.Equals(entry1.key, entry2.key) && ValuesAreEqual(entry1.value, entry2.value); + } + + private delegate bool ValueEqualityDelegate(Value value1, Value value2); + + private static bool ValuesAreEqual(Value value1, Value value2) { + Dictionary switcher = + new Dictionary(); + switcher.Add(typeof(TextValue), new ValueEqualityDelegate(TextValuesAreEqual)); + switcher.Add(typeof(NumberValue), new ValueEqualityDelegate(NumberValuesAreEqual)); + switcher.Add(typeof(BooleanValue), new ValueEqualityDelegate(BooleanValuesAreEqual)); + switcher.Add(typeof(SetValue), new ValueEqualityDelegate(SetValuesAreEqual)); + switcher.Add(typeof(DateValue), new ValueEqualityDelegate(DateValuesAreEqual)); + switcher.Add(typeof(DateTimeValue), new ValueEqualityDelegate(DateTimeValuesAreEqual)); + + if (switcher.ContainsKey(value1.GetType())) { + return switcher[value1.GetType()](value1, value2); + } + throw new NotImplementedException(String.Format("Unknown Value type {0}", value1.GetType())); + } + + private static bool TextValuesAreEqual(Value value1, Value value2) { + return String.Equals((value1 as TextValue).value, (value2 as TextValue).value); + } + + private static bool NumberValuesAreEqual(Value value1, Value value2) { + return String.Equals((value1 as NumberValue).value, (value2 as NumberValue).value); + } + + private static bool BooleanValuesAreEqual(Value value1, Value value2) { + return (value1 as BooleanValue).value == (value2 as BooleanValue).value; + } + + private static bool SetValuesAreEqual(Value value1, Value value2) { + Value[] set1 = (value1 as SetValue).values; + Value[] set2 = (value2 as SetValue).values; + + if (set1.Length != set2.Length) { + return false; + } + + for (int i = 0; i < set1.Length; i++) { + if (!ValuesAreEqual(set1[i], set2[i])) { + return false; + } + } + return true; + } + + private static bool DateValuesAreEqual(Value value1, Value value2) { + Date date1 = (value1 as DateValue).value; + Date date2 = (value2 as DateValue).value; + return DatesAreEqual(date1, date2); + } + + private static bool DateTimeValuesAreEqual(Value value1, Value value2) { + DateTime dateTime1 = (value1 as DateTimeValue).value; + DateTime dateTime2 = (value2 as DateTimeValue).value; + return DatesAreEqual(dateTime1.date, dateTime2.date) + && dateTime1.hour == dateTime2.hour + && dateTime1.minute == dateTime2.minute + && dateTime1.second == dateTime2.second + && String.Equals(dateTime1.timeZoneID, dateTime2.timeZoneID); + } + + private static bool DatesAreEqual(Date date1, Date date2) { + return date1.day == date2.day + && date1.month == date2.month + && date1.year == date2.year; + } + + [Test] + public void TestStatementBuilderBlankStatement() { + StatementBuilder statementBuilder = new StatementBuilder(); + + Statement expectedStatement = new Statement(); + expectedStatement.query = ""; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderBasicStatement() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("ID = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE ID = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderIgnoresKeyword() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("WHERE ID = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE ID = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestStatementBuilderIncludesKeywordPrefix() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("WHEREWITHALL = 1"); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "WHERE WHEREWITHALL = 1"; + expectedStatement.values = new String_ValueMapEntry[0]; + + Assert.True(StatementsAreEqual(expectedStatement, + statementBuilder.ToStatement())); + } + + [Test] + public void TestAllStatementBuilderPartialFunctions() { + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Name, Id") + .From("Geo_Target") + .Where("Targetable = :targetable") + .OrderBy("Id DESC") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .Offset(0) + .AddValue("targetable", true) + .IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT) + .RemoveLimitAndOffset(); + Assert.AreEqual(null, statementBuilder.GetOffset()); + + Statement expectedStatement = new Statement(); + expectedStatement.query = "SELECT Name, Id FROM Geo_Target" + + " WHERE Targetable = :targetable ORDER BY Id DESC"; + String_ValueMapEntry targetableEntry = new String_ValueMapEntry(); + targetableEntry.key = "targetable"; + BooleanValue targetableValue = new BooleanValue(); + targetableValue.value = true; + targetableEntry.value = targetableValue; + expectedStatement.values = new String_ValueMapEntry[] {targetableEntry}; + Assert.True(StatementsAreEqual(expectedStatement, statementBuilder.ToStatement())); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesWhere() { + StatementBuilder statementBuilder = new StatementBuilder("WHERE ID = 1") + .Where("ID = 2"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesFrom() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .From("Geo_Table"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesSelect() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Select("Id, Type"); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesLimit() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .Offset(100); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesIncreaseOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .IncreaseOffsetBy(100); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionMixingStylesRemoveLimitAndOffset() { + StatementBuilder statementBuilder = new StatementBuilder( + "SELECT Id, Type FROM Geo_Table WHERE Type = City") + .RemoveLimitAndOffset(); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithSelect() { + StatementBuilder statementBuilder = new StatementBuilder() + .Select("Id, Type"); + statementBuilder.Query = "SELECT Id, Type FROM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithFrom() { + StatementBuilder statementBuilder = new StatementBuilder() + .From("Geo_Table"); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithWhere() { + StatementBuilder statementBuilder = new StatementBuilder() + .Where("Type = City"); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithLimit() { + StatementBuilder statementBuilder = new StatementBuilder() + .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void TestStatementBuilderThrowsExceptionSettingQueryWithOffset() { + StatementBuilder statementBuilder = new StatementBuilder() + .Offset(100); + statementBuilder.Query = "SELECT Id, Type FOM Geo_Table WHERE Type = City"; + } + } +} diff --git a/tests/Dfp/v201405/TestUtils.cs b/tests/Dfp/v201405/TestUtils.cs new file mode 100644 index 00000000000..d48f67ee16b --- /dev/null +++ b/tests/Dfp/v201405/TestUtils.cs @@ -0,0 +1,353 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Util; +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.Util.v201405; +using Google.Api.Ads.Dfp.v201405; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; +using System.Threading; +using System.Configuration; +using System.Collections; + +namespace Google.Api.Ads.Dfp.Tests.v201405 { + /// + /// A utility class to assist the testing of v201405 services. + /// + public class TestUtils { + public User GetCurrentUser(DfpUser user) { + return GetUserByEmail(user, new DfpAppConfig().Email); + } + + public User GetTrafficker(DfpUser user) { + return GetUserByEmail(user, "dfp.api.trafficker@gmail.com"); + } + + public User GetSalesperson(DfpUser user) { + return GetUserByEmail(user, "dfp.api.salesperson@gmail.com"); + } + + public User GetUserByEmail(DfpUser user, string email) { + UserService userService = (UserService) user.GetService(DfpService.v201405.UserService); + + // Create a Statement to get all users sorted by name. + Statement statement = new Statement(); + statement.query = string.Format("where email = '{0}' LIMIT 1", email); + + UserPage page = userService.getUsersByStatement(statement); + + if (page.results != null && page.results.Length > 0) { + return page.results[0]; + } else { + return null; + } + } + + public Role GetRole(DfpUser user, string roleName) { + UserService userService = (UserService)user.GetService(DfpService.v201405.UserService); + + // Get all roles. + Role[] roles = userService.getAllRoles(); + foreach (Role role in roles) { + if (role.name == roleName) { + return role; + } + } + return null; + } + + /// + /// Create a test company for running further tests. + /// + /// A test company for running further tests. + public Company CreateCompany(DfpUser user, CompanyType companyType) { + CompanyService companyService = (CompanyService) user.GetService( + DfpService.v201405.CompanyService); + Company company = new Company(); + company.name = string.Format("Company #{0}", GetTimeStamp()); + company.type = companyType; + + return companyService.createCompanies(new Company[] {company})[0]; + } + + public Order CreateOrder(DfpUser user, long advertiserId, long salespersonId, + long traffickerId) { + // Get the OrderService. + OrderService orderService = (OrderService) user.GetService(DfpService.v201405.OrderService); + + Order order = new Order(); + order.name = string.Format("Order #{0}", GetTimeStamp()); + order.advertiserId = advertiserId; + order.salespersonId = salespersonId; + order.traffickerId = traffickerId; + + return orderService.createOrders(new Order[] {order})[0]; + } + + public LineItem CreateLineItem(DfpUser user, long orderId, string adUnitId) { + LineItemService lineItemService = + (LineItemService) user.GetService(DfpService.v201405.LineItemService); + + long placementId = CreatePlacement(user, new string[] {adUnitId}).id; + + // Create inventory targeting. + InventoryTargeting inventoryTargeting = new InventoryTargeting(); + inventoryTargeting.targetedPlacementIds = new long[] {placementId}; + + // Create geographical targeting. + GeoTargeting geoTargeting = new GeoTargeting(); + + // Include the US and Quebec, Canada. + Location countryLocation = new Location(); + countryLocation.id = 2840L; + + Location regionLocation = new Location(); + regionLocation.id = 20123L; + geoTargeting.targetedLocations = new Location[] {countryLocation, regionLocation}; + + // Exclude Chicago and the New York metro area. + Location cityLocation = new Location(); + cityLocation.id = 1016367L; + + Location metroLocation = new Location(); + metroLocation.id = 200501L; + geoTargeting.excludedLocations = new Location[] {cityLocation, metroLocation}; + + // Exclude domains that are not under the network's control. + UserDomainTargeting userDomainTargeting = new UserDomainTargeting(); + userDomainTargeting.domains = new String[] {"usa.gov"}; + userDomainTargeting.targeted = false; + + // Create day-part targeting. + DayPartTargeting dayPartTargeting = new DayPartTargeting(); + dayPartTargeting.timeZone = DeliveryTimeZone.BROWSER; + + // Target only the weekend in the browser's timezone. + DayPart saturdayDayPart = new DayPart(); + saturdayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201405.DayOfWeek.SATURDAY; + + saturdayDayPart.startTime = new TimeOfDay(); + saturdayDayPart.startTime.hour = 0; + saturdayDayPart.startTime.minute = MinuteOfHour.ZERO; + + saturdayDayPart.endTime = new TimeOfDay(); + saturdayDayPart.endTime.hour = 24; + saturdayDayPart.endTime.minute = MinuteOfHour.ZERO; + + DayPart sundayDayPart = new DayPart(); + sundayDayPart.dayOfWeek = Google.Api.Ads.Dfp.v201405.DayOfWeek.SUNDAY; + + sundayDayPart.startTime = new TimeOfDay(); + sundayDayPart.startTime.hour = 0; + sundayDayPart.startTime.minute = MinuteOfHour.ZERO; + + sundayDayPart.endTime = new TimeOfDay(); + sundayDayPart.endTime.hour = 24; + sundayDayPart.endTime.minute = MinuteOfHour.ZERO; + + dayPartTargeting.dayParts = new DayPart[] {saturdayDayPart, sundayDayPart}; + + + // Create technology targeting. + TechnologyTargeting technologyTargeting = new TechnologyTargeting(); + + // Create browser targeting. + BrowserTargeting browserTargeting = new BrowserTargeting(); + browserTargeting.isTargeted = true; + + // Target just the Chrome browser. + Technology browserTechnology = new Technology(); + browserTechnology.id = 500072L; + browserTargeting.browsers = new Technology[] {browserTechnology}; + technologyTargeting.browserTargeting = browserTargeting; + + LineItem lineItem = new LineItem(); + lineItem.name = "Line item #" + new TestUtils().GetTimeStamp(); + lineItem.orderId = orderId; + lineItem.targeting = new Targeting(); + + lineItem.targeting.inventoryTargeting = inventoryTargeting; + lineItem.targeting.geoTargeting = geoTargeting; + lineItem.targeting.userDomainTargeting = userDomainTargeting; + lineItem.targeting.dayPartTargeting = dayPartTargeting; + lineItem.targeting.technologyTargeting = technologyTargeting; + + lineItem.lineItemType = LineItemType.STANDARD; + lineItem.allowOverbook = true; + + // Set the creative rotation type to even. + lineItem.creativeRotationType = CreativeRotationType.EVEN; + + // Set the size of creatives that can be associated with this line item. + Size size = new Size(); + size.width = 300; + size.height = 250; + size.isAspectRatio = false; + + // Create the creative placeholder. + CreativePlaceholder creativePlaceholder = new CreativePlaceholder(); + creativePlaceholder.size = size; + + lineItem.creativePlaceholders = new CreativePlaceholder[] {creativePlaceholder}; + + // Set the length of the line item to run. + //lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.startDateTimeType = StartDateTimeType.IMMEDIATELY; + lineItem.endDateTime = DateTimeUtilities.FromDateTime(System.DateTime.Today.AddMonths(1)); + + // Set the cost per unit to $2. + lineItem.costType = CostType.CPM; + lineItem.costPerUnit = new Money(); + lineItem.costPerUnit.currencyCode = "USD"; + lineItem.costPerUnit.microAmount = 2000000L; + + // Set the number of units bought to 500,000 so that the budget is + // $1,000. + Goal goal = new Goal(); + goal.units = 500000L; + goal.unitType = UnitType.IMPRESSIONS; + lineItem.primaryGoal = goal; + + return lineItemService.createLineItems(new LineItem[] {lineItem})[0]; + } + + /// + /// Create a test company for running further tests. + /// + /// A creative for running further tests. + public Creative CreateCreative(DfpUser user, long advertiserId) { + CreativeService creativeService = (CreativeService)user.GetService( + DfpService.v201405.CreativeService); + + // Create creative size. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create an image creative. + ImageCreative imageCreative = new ImageCreative(); + imageCreative.name = string.Format("Image creative #{0}", GetTimeStamp()); + imageCreative.advertiserId = advertiserId; + imageCreative.destinationUrl = "http://www.google.com"; + imageCreative.size = size; + + // Create image asset. + CreativeAsset creativeAsset = new CreativeAsset(); + creativeAsset.fileName = "image.jpg"; + creativeAsset.assetByteArray = MediaUtilities.GetAssetDataFromUrl( + "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"); + creativeAsset.size = size; + imageCreative.primaryImageAsset = creativeAsset; + + return creativeService.createCreatives(new Creative[] {imageCreative})[0]; + } + + public LineItemCreativeAssociation CreateLica(DfpUser user, long lineItemId, long creativeId) { + LineItemCreativeAssociationService licaService = + (LineItemCreativeAssociationService)user.GetService( + DfpService.v201405.LineItemCreativeAssociationService); + + LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); + lica.creativeId = creativeId; + lica.lineItemId = lineItemId; + + return licaService.createLineItemCreativeAssociations( + new LineItemCreativeAssociation[] {lica})[0]; + } + + public AdUnit CreateAdUnit(DfpUser user) { + InventoryService inventoryService = + (InventoryService) user.GetService(DfpService.v201405.InventoryService); + + AdUnit adUnit = new AdUnit(); + adUnit.name = string.Format("Ad_Unit_{0}", GetTimeStamp()); + adUnit.parentId = FindRootAdUnit(user).id; + + // Set the size of possible creatives that can match this ad unit. + Size size = new Size(); + size.width = 300; + size.height = 250; + + // Create ad unit size. + AdUnitSize adUnitSize = new AdUnitSize(); + adUnitSize.size = size; + adUnitSize.environmentType = EnvironmentType.BROWSER; + + adUnit.adUnitSizes = new AdUnitSize[] {adUnitSize}; + return inventoryService.createAdUnits(new AdUnit[] {adUnit})[0]; + } + + public AdUnit FindRootAdUnit(DfpUser user) { + // Get InventoryService. + InventoryService inventoryService = + (InventoryService)user.GetService(DfpService.v201405.InventoryService); + + // Create a Statement to only select the root ad unit. + Statement statement = new Statement(); + statement.query = "WHERE parentId IS NULL LIMIT 500"; + + // Get ad units by Statement. + AdUnitPage page = inventoryService.getAdUnitsByStatement(statement); + return page.results[0]; + } + + public Placement CreatePlacement(DfpUser user, string[] targetedAdUnitIds) { + // Get InventoryService. + PlacementService placementService = + (PlacementService) user.GetService(DfpService.v201405.PlacementService); + + Placement placement = new Placement(); + placement.name = string.Format("Test placement #{0}", this.GetTimeStamp()); + placement.description = "Test placement"; + placement.targetedAdUnitIds = targetedAdUnitIds; + + return placementService.createPlacements(new Placement[] {placement})[0]; + } + + public ReportJob CreateReport(DfpUser user) { + // Get ReportService. + ReportService reportService = + (ReportService) user.GetService(DfpService.v201405.ReportService); + + ReportJob reportJob = new ReportJob(); + reportJob.reportQuery = new ReportQuery(); + reportJob.reportQuery.dimensions = new Dimension[] {Dimension.ORDER_ID, Dimension.ORDER_NAME}; + reportJob.reportQuery.columns = new Column[] {Column.AD_SERVER_IMPRESSIONS, + Column.AD_SERVER_CLICKS, Column.AD_SERVER_CTR, Column.AD_SERVER_CPM_AND_CPC_REVENUE, + Column.AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM}; + reportJob.reportQuery.dateRangeType = DateRangeType.LAST_MONTH; + + return reportService.runReportJob(reportJob); + } + + /// + /// Gets the current timestamp as a string. + /// + /// The current timestamp as a string. + public string GetTimeStamp() { + Thread.Sleep(500); + return (System.DateTime.UtcNow - new System.DateTime(1970, 1, 1)).Ticks. + ToString(); + } + } +} diff --git a/tests/Dfp/v201405/UserServiceTests.cs b/tests/Dfp/v201405/UserServiceTests.cs new file mode 100644 index 00000000000..13f25717c0d --- /dev/null +++ b/tests/Dfp/v201405/UserServiceTests.cs @@ -0,0 +1,185 @@ +// Copyright 2014, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Dfp.Lib; +using Google.Api.Ads.Dfp.v201405; + +using NUnit.Framework; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Threading; + + +namespace Google.Api.Ads.Dfp.Tests.v201405 { + /// + /// UnitTests for class. + /// + [TestFixture] + public class UserServiceTests : BaseTests { + /// + /// UnitTests for class. + /// + private UserService userService; + + /// + /// Salesperson user id for running tests. + /// + private long salespersonId; + + /// + /// Trafficker user id for running tests. + /// + private long traffickerId; + + /// + /// Current user id for running tests. + /// + private long currentUserId; + + /// + /// Default public constructor. + /// + public UserServiceTests() : base() { + } + + /// + /// Initialize the test case. + /// + [SetUp] + public void Init() { + TestUtils utils = new TestUtils(); + userService = (UserService) user.GetService(DfpService.v201405.UserService); + salespersonId = utils.GetSalesperson(user).id; + traffickerId = utils.GetTrafficker(user).id; + currentUserId = utils.GetCurrentUser(user).id; + } + + /// + /// Test whether we can fetch all roles. + /// + [Test] + public void TestGetAllRoles() { + Role[] roles = null; + + Assert.DoesNotThrow(delegate() { + roles = userService.getAllRoles(); + }); + Assert.NotNull(roles); + Assert.GreaterOrEqual(roles.Length, 0); + } + + /// + /// Test whether we can fetch the current user. + /// + [Test] + public void TestGetCurrentUser() { + User user = null; + + Assert.DoesNotThrow(delegate() { + user = userService.getCurrentUser(); + }); + + Assert.NotNull(user); + Assert.AreEqual(user.id, currentUserId); + } + + /// + /// Test whether we can fetch a list of existing users that match given + /// statement. + /// + [Test] + public void TestGetUsersByStatement() { + Statement statement = new Statement(); + statement.query = "ORDER BY name LIMIT 500"; + + UserPage page = null; + + Assert.DoesNotThrow(delegate() { + page = userService.getUsersByStatement(statement); + }); + + Assert.NotNull(page); + Assert.NotNull(page.results); + + List salesPersonIds = new List(); + List traffickerIds = new List(); + + foreach(User tempUser in page.results) { + if (tempUser.roleName == "Salesperson") { + salesPersonIds.Add(tempUser.id); + } else if (tempUser.roleName == "Trafficker") { + traffickerIds.Add(tempUser.id); + } + } + Assert.Contains(salespersonId, salesPersonIds); + Assert.Contains(traffickerId, traffickerIds); + } + + /// + /// Test whether we can deactivate and activate a user. + /// + [Test] + public void TestPerformUserAction() { + Statement statement = new Statement(); + statement.query = string.Format("WHERE id = {0}", salespersonId); + + DeactivateUsers action = new DeactivateUsers(); + + UpdateResult result = null; + + Assert.DoesNotThrow(delegate() { + result = userService.performUserAction(action, statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + + // Activate the user again. + + Assert.DoesNotThrow(delegate() { + result = userService.performUserAction(new ActivateUsers(), statement); + }); + + Assert.NotNull(result); + Assert.AreEqual(result.numChanges, 1); + } + + /// + /// Test whether we can update a list of users. + /// + [Test] + public void TestUpdateUsers() { + Statement statement = new Statement(); + statement.query = String.Format("WHERE id = {0} LIMIT 1", salespersonId); + User user = userService.getUsersByStatement(statement).results[0]; + user.preferredLocale = (user.preferredLocale == "fr_FR")? "en_US" : "fr_FR"; + + User[] newUsers = null; + + Assert.DoesNotThrow(delegate() { + newUsers = userService.updateUsers(new User[] {user}); + }); + + Assert.NotNull(newUsers); + Assert.AreEqual(newUsers.Length, 1); + Assert.AreEqual(newUsers[0].id, user.id); + Assert.AreEqual(newUsers[0].preferredLocale, user.preferredLocale); + } + } +} diff --git a/utilities/OAuthTokenGenerator/LoginForm.Designer.cs b/utilities/OAuthTokenGenerator/LoginForm.Designer.cs new file mode 100644 index 00000000000..bba875e7c94 --- /dev/null +++ b/utilities/OAuthTokenGenerator/LoginForm.Designer.cs @@ -0,0 +1,76 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +namespace Google.Api.Ads.Common.Utilities.OAuthTokenGenerator { + partial class LoginForm { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; + /// otherwise, false. + protected override void Dispose(bool disposing) { + if (disposing && (components != null)) { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() { + this.loginBrowser = new System.Windows.Forms.WebBrowser(); + this.SuspendLayout(); + // + // loginBrowser + // + this.loginBrowser.Dock = System.Windows.Forms.DockStyle.Fill; + this.loginBrowser.Location = new System.Drawing.Point(0, 0); + this.loginBrowser.MinimumSize = new System.Drawing.Size(20, 20); + this.loginBrowser.Name = "loginBrowser"; + this.loginBrowser.Size = new System.Drawing.Size(633, 338); + this.loginBrowser.TabIndex = 7; + // + // LoginForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(633, 338); + this.Controls.Add(this.loginBrowser); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "LoginForm"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Login to your account"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.WebBrowser loginBrowser; + } +} \ No newline at end of file diff --git a/utilities/OAuthTokenGenerator/LoginForm.cs b/utilities/OAuthTokenGenerator/LoginForm.cs new file mode 100644 index 00000000000..7b7d3c7e396 --- /dev/null +++ b/utilities/OAuthTokenGenerator/LoginForm.cs @@ -0,0 +1,160 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using Google.Api.Ads.Common.Lib; + +using System; +using System.IO; +using System.Net; +using System.Threading; +using System.Windows.Forms; + +namespace Google.Api.Ads.Common.Utilities.OAuthTokenGenerator { + + /// + /// The form to handle user login. + /// + public partial class LoginForm : Form { + + /// + /// Simple placeholder class to use the abstract AppConfigBase class. + /// + private class SimpleAppConfig : AppConfigBase { + } + + /// + /// The Application configuration patch to be displayed to the user. + /// + private const string APP_CONFIG_PATCH = @" + + + + +"; + + /// + /// The application configuration instance. + /// + private AppConfig appConfig = new SimpleAppConfig(); + + /// + /// Flag to indicate that the server thread can exit. + /// + private bool canExit; + + /// + /// The address of the local server that receives the OAuth2 callback. + /// + private string LOCALHOST_ADDRESS = "http://localhost:8080/"; + + /// + /// The HTTP listener that runs the local server. + /// + private HttpListener newHttpListener; + + /// + /// The OAuth2 provider for doing OAuth2 installed application flow. + /// + private OAuth2ProviderForApplications oAuth2; + + /// + /// The server thread to listen to incoming web requests and handle them, + /// so that the main UI thread isn't blocked. + /// + private Thread serverThread; + + /// + /// Initializes a new instance of the class. + /// + /// The OAuth2 client identifier. + /// The OAuth2 client secret. + /// The OAuth2 scope. + public LoginForm(string clientId, string clientSecret, string scope) { + InitializeComponent(); + startLocalServer(); + + appConfig.OAuth2RedirectUri = LOCALHOST_ADDRESS; + appConfig.OAuth2ClientId = clientId; + appConfig.OAuth2ClientSecret = clientSecret; + appConfig.OAuth2Scope = scope; + + oAuth2 = new OAuth2ProviderForApplications(appConfig); + + // Get the authorization url and open a browser. + string authorizationUrl = oAuth2.GetAuthorizationUrl(); + loginBrowser.Navigate(authorizationUrl); + } + + /// + /// Raises the event. + /// + /// The that contains + /// the event data. + protected override void OnClosed(EventArgs e) { + base.OnClosed(e); + newHttpListener.Stop(); + serverThread.Join(); + } + + /// + /// Starts the local server. + /// + private void startLocalServer() { + // Start the server on localhost. + canExit = false; + newHttpListener = new System.Net.HttpListener(); + newHttpListener.Prefixes.Add(LOCALHOST_ADDRESS); + newHttpListener.Start(); + + // Start the listener. + serverThread = new Thread(delegate() { + while (true) { + try { + HttpListenerContext ctx = newHttpListener.GetContext(); + HandlePageRequest(ctx); + } catch (HttpListenerException) { + break; + } + } + }); + serverThread.Start(); + } + + /// + /// Handles the page request. + /// + /// The listener context. + private void HandlePageRequest(HttpListenerContext context) { + string url = context.Request.Url.OriginalString; + string authorizationCode = context.Request.QueryString["code"]; + oAuth2.FetchAccessAndRefreshTokens(authorizationCode); + + HttpListenerResponse response = context.Response; + response.ContentType = "text/plain"; + + using (StreamWriter textWriter = new StreamWriter(response.OutputStream)) { + textWriter.Write("Copy the snippet shown below to your App.config/Web.config.\n\n"); + string responseText = string.Format(APP_CONFIG_PATCH, appConfig.OAuth2ClientId, + appConfig.OAuth2ClientSecret, appConfig.OAuth2RefreshToken); + textWriter.Write(responseText); + } + + response.StatusCode = (int) HttpStatusCode.OK; + response.StatusDescription = "OK"; + response.OutputStream.Close(); + } + } +} \ No newline at end of file diff --git a/utilities/OAuthTokenGenerator/LoginForm.resx b/utilities/OAuthTokenGenerator/LoginForm.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/utilities/OAuthTokenGenerator/LoginForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/utilities/OAuthTokenGenerator/MainForm.Designer.cs b/utilities/OAuthTokenGenerator/MainForm.Designer.cs new file mode 100644 index 00000000000..76caa88f158 --- /dev/null +++ b/utilities/OAuthTokenGenerator/MainForm.Designer.cs @@ -0,0 +1,168 @@ +namespace Google.Api.Ads.Common.Utilities.OAuthTokenGenerator { + partial class MainForm { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) { + if (disposing && (components != null)) { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); + this.panel1 = new System.Windows.Forms.Panel(); + this.label1 = new System.Windows.Forms.Label(); + this.txtClientID = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.txtClientSecret = new System.Windows.Forms.TextBox(); + this.chkScopes = new System.Windows.Forms.CheckedListBox(); + this.label3 = new System.Windows.Forms.Label(); + this.btnOK = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.Controls.Add(this.label1); + this.panel1.Controls.Add(this.txtClientID); + this.panel1.Controls.Add(this.label2); + this.panel1.Controls.Add(this.txtClientSecret); + this.panel1.Controls.Add(this.chkScopes); + this.panel1.Controls.Add(this.label3); + this.panel1.Location = new System.Drawing.Point(12, 161); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(430, 117); + this.panel1.TabIndex = 11; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(3, 10); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(47, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Client ID"; + // + // txtClientID + // + this.txtClientID.Location = new System.Drawing.Point(141, 10); + this.txtClientID.Name = "txtClientID"; + this.txtClientID.Size = new System.Drawing.Size(282, 20); + this.txtClientID.TabIndex = 1; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(3, 36); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(67, 13); + this.label2.TabIndex = 2; + this.label2.Text = "Client Secret"; + // + // txtClientSecret + // + this.txtClientSecret.Location = new System.Drawing.Point(141, 36); + this.txtClientSecret.Name = "txtClientSecret"; + this.txtClientSecret.Size = new System.Drawing.Size(282, 20); + this.txtClientSecret.TabIndex = 3; + // + // chkScopes + // + this.chkScopes.FormattingEnabled = true; + this.chkScopes.Location = new System.Drawing.Point(141, 62); + this.chkScopes.Name = "chkScopes"; + this.chkScopes.Size = new System.Drawing.Size(282, 49); + this.chkScopes.TabIndex = 4; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(3, 62); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(77, 13); + this.label3.TabIndex = 5; + this.label3.Text = "OAuth2 Scope"; + // + // btnOK + // + this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; + this.btnOK.Location = new System.Drawing.Point(286, 284); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(75, 23); + this.btnOK.TabIndex = 12; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler(this.btnOk_Click); + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(367, 284); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 23); + this.btnCancel.TabIndex = 13; + this.btnCancel.Text = "Close"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(11, 12); + this.textBox1.Multiline = true; + this.textBox1.Name = "textBox1"; + this.textBox1.ReadOnly = true; + this.textBox1.Size = new System.Drawing.Size(431, 134); + this.textBox1.TabIndex = 15; + this.textBox1.Text = resources.GetString("textBox1.Text"); + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(451, 315); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnOK); + this.Controls.Add(this.panel1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.Name = "MainForm"; + this.Text = "OAuth2 Token Generator"; + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox txtClientID; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox txtClientSecret; + private System.Windows.Forms.CheckedListBox chkScopes; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.TextBox textBox1; + } +} + diff --git a/utilities/OAuthTokenGenerator/MainForm.cs b/utilities/OAuthTokenGenerator/MainForm.cs new file mode 100644 index 00000000000..85bcd55caf4 --- /dev/null +++ b/utilities/OAuthTokenGenerator/MainForm.cs @@ -0,0 +1,94 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +namespace Google.Api.Ads.Common.Utilities.OAuthTokenGenerator { + + /// + /// Main application form. + /// + public partial class MainForm : Form { + /// + /// The dictionary to maintain a map between the API name, and the + /// corrsponding OAuth2 scope. + /// + private Dictionary scopeMap = new Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + public MainForm() { + InitializeComponent(); + + scopeMap.Add("AdWords API", "https://www.googleapis.com/auth/adwords"); + scopeMap.Add("Doubleclick for Publishers API", "https://www.google.com/apis/ads/publisher"); + scopeMap.Add("DoubleClick for Advertisers API", + "https://www.googleapis.com/auth/dfatrafficking"); + scopeMap.Add("Google Places for Business", "https://www.google.com/local/add"); + + foreach (string key in scopeMap.Keys) { + chkScopes.Items.Add(key); + } + } + + /// + /// Handles the Click event of the btnOk control. + /// + /// The source of the event. + /// The instance containing the + /// event data. + private void btnOk_Click(object sender, EventArgs e) { + string clientId = txtClientID.Text.Trim(); + if (string.IsNullOrEmpty(clientId)) { + MessageBox.Show("Client ID cannot be empty."); + return; + } + + string clientSecret = txtClientSecret.Text.Trim(); + if (string.IsNullOrEmpty(clientSecret)) { + MessageBox.Show("Client Secret cannot be empty."); + return; + } + + if (chkScopes.SelectedItems.Count == 0) { + MessageBox.Show("You should select at least one scope."); + return; + } + + StringBuilder scopeBuilder = new StringBuilder(); + for (int i = 0; i < chkScopes.SelectedItems.Count; i++) { + scopeBuilder.Append(scopeMap[chkScopes.SelectedItems[i].ToString()] + " "); + } + + LoginForm loginForm = new LoginForm(clientId, clientSecret, scopeBuilder.ToString().Trim()); + loginForm.ShowDialog(); + } + + /// + /// Handles the Click event of the btnCancel control. + /// + /// The source of the event. + /// The instance containing the + /// event data. + private void btnCancel_Click(object sender, EventArgs e) { + this.Close(); + } + } +} \ No newline at end of file diff --git a/utilities/OAuthTokenGenerator/MainForm.resx b/utilities/OAuthTokenGenerator/MainForm.resx new file mode 100644 index 00000000000..91685536585 --- /dev/null +++ b/utilities/OAuthTokenGenerator/MainForm.resx @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + This application generates an OAuth2 refresh token for use with Ads* API .NET client libraries. + +This application requires an OAuth2 client id and secret. If you don't have one yet, you can create a OAuth2 Client ID of type "Installed Application" from the Google Developers Console (https://console.developers.google.com). + +You can refer to https://developers.google.com/console/help/new/ on how to navigate and use the Google Developers Console. + + + \ No newline at end of file diff --git a/utilities/OAuthTokenGenerator/OAuthTokenGenerator.csproj b/utilities/OAuthTokenGenerator/OAuthTokenGenerator.csproj new file mode 100644 index 00000000000..13897609b84 --- /dev/null +++ b/utilities/OAuthTokenGenerator/OAuthTokenGenerator.csproj @@ -0,0 +1,99 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {44B870E6-C579-40F5-A4BA-370C58708E36} + WinExe + Properties + Google.Api.Ads.Common.Utilities.OAuthTokenGenerator + OAuthTokenGenerator + v4.0 + + + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + bin\Debug\ + DEBUG;TRACE + full + AnyCPU + prompt + + + bin\Release\ + TRACE + true + pdbonly + AnyCPU + prompt + + + + + + + + + + + Properties\Properties.cs + + + + Form + + + MainForm.cs + + + Form + + + LoginForm.cs + + + + MainForm.cs + + + LoginForm.cs + + + + + {277404DB-A439-4450-B3A5-186294CDF245} + Common + + + + + \ No newline at end of file diff --git a/utilities/OAuthTokenGenerator/Program.cs b/utilities/OAuthTokenGenerator/Program.cs new file mode 100644 index 00000000000..67f3dbbd275 --- /dev/null +++ b/utilities/OAuthTokenGenerator/Program.cs @@ -0,0 +1,38 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace Google.Api.Ads.Common.Utilities.OAuthTokenGenerator { + + /// + /// Entry point for the application. + /// + internal static class Program { + + /// + /// The main entry point for the application. + /// + [STAThread] + private static void Main() { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); + } + } +} \ No newline at end of file diff --git a/utilities/OAuthTokenGenerator/Properties/AssemblyInfo.cs b/utilities/OAuthTokenGenerator/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..fae576da7ab --- /dev/null +++ b/utilities/OAuthTokenGenerator/Properties/AssemblyInfo.cs @@ -0,0 +1,38 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("OAuth2 Token Generator Utility")] +[assembly: AssemblyDescription("This application helps you generate the necessary " + + "configuration files to use the Ads* API .NET libraries with OAuth2 as " + + "authentication mechanism.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("e3893401-64bf-41c9-83ec-0604f870ca9a")] \ No newline at end of file diff --git a/utilities/OAuthTokenGenerator/Properties/Properties.cs b/utilities/OAuthTokenGenerator/Properties/Properties.cs new file mode 100644 index 00000000000..63a131184af --- /dev/null +++ b/utilities/OAuthTokenGenerator/Properties/Properties.cs @@ -0,0 +1,23 @@ +// Copyright 2013, Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Author: api.anash@gmail.com (Anash P. Oommen) + +using System.Reflection; + +[assembly: AssemblyCompany("Google")] +[assembly: AssemblyProduct("Ads API Dotnet Common Library")] +[assembly: AssemblyCopyright("Copyright 2012, Google Inc. All Rights Reserved.")] +[assembly: AssemblyVersion("3.0.0.0")] +[assembly: AssemblyFileVersion("3.0.0.0")]